aboutsummaryrefslogtreecommitdiff
path: root/src/main.cpp
diff options
context:
space:
mode:
authorVexu <git@vexu.eu>2019-12-21 14:38:32 +0200
committerVexu <git@vexu.eu>2019-12-29 11:04:45 +0200
commitfceda07f94c9e4181f97ecacc1bdc1b9a0b7ab16 (patch)
tree44c4ff6b7f727e430cefaa4ee2af67953c2a332b /src/main.cpp
parentbda355d976c11a6bf1c820b6f1c2a477acd214fd (diff)
downloadzig-fceda07f94c9e4181f97ecacc1bdc1b9a0b7ab16.tar.gz
zig-fceda07f94c9e4181f97ecacc1bdc1b9a0b7ab16.zip
use self hosted translate-c for cimports
Diffstat (limited to 'src/main.cpp')
-rw-r--r--src/main.cpp16
1 files changed, 5 insertions, 11 deletions
diff --git a/src/main.cpp b/src/main.cpp
index 2cda18f7a0..43a89b4efe 100644
--- a/src/main.cpp
+++ b/src/main.cpp
@@ -243,7 +243,6 @@ enum Cmd {
CmdTargets,
CmdTest,
CmdTranslateC,
- CmdTranslateCUserland,
CmdVersion,
CmdZen,
CmdLibC,
@@ -960,8 +959,6 @@ int main(int argc, char **argv) {
cmd = CmdLibC;
} else if (strcmp(arg, "translate-c") == 0) {
cmd = CmdTranslateC;
- } else if (strcmp(arg, "translate-c-2") == 0) {
- cmd = CmdTranslateCUserland;
} else if (strcmp(arg, "test") == 0) {
cmd = CmdTest;
out_type = OutTypeExe;
@@ -978,7 +975,6 @@ int main(int argc, char **argv) {
case CmdBuild:
case CmdRun:
case CmdTranslateC:
- case CmdTranslateCUserland:
case CmdTest:
case CmdLibC:
if (!in_file) {
@@ -1112,7 +1108,6 @@ int main(int argc, char **argv) {
case CmdRun:
case CmdBuild:
case CmdTranslateC:
- case CmdTranslateCUserland:
case CmdTest:
{
if (cmd == CmdBuild && !in_file && objects.length == 0 &&
@@ -1124,7 +1119,7 @@ int main(int argc, char **argv) {
" * --object argument\n"
" * --c-source argument\n");
return print_error_usage(arg0);
- } else if ((cmd == CmdTranslateC || cmd == CmdTranslateCUserland ||
+ } else if ((cmd == CmdTranslateC ||
cmd == CmdTest || cmd == CmdRun) && !in_file)
{
fprintf(stderr, "Expected source file argument.\n");
@@ -1136,7 +1131,7 @@ int main(int argc, char **argv) {
assert(cmd != CmdBuild || out_type != OutTypeUnknown);
- bool need_name = (cmd == CmdBuild || cmd == CmdTranslateC || cmd == CmdTranslateCUserland);
+ bool need_name = (cmd == CmdBuild || cmd == CmdTranslateC);
if (cmd == CmdRun) {
out_name = "run";
@@ -1170,8 +1165,7 @@ int main(int argc, char **argv) {
return print_error_usage(arg0);
}
- Buf *zig_root_source_file = (cmd == CmdTranslateC || cmd == CmdTranslateCUserland) ?
- nullptr : in_file_buf;
+ Buf *zig_root_source_file = cmd == CmdTranslateC ? nullptr : in_file_buf;
if (cmd == CmdRun && buf_out_name == nullptr) {
buf_out_name = buf_create_from_str("run");
@@ -1336,8 +1330,8 @@ int main(int argc, char **argv) {
} else {
zig_unreachable();
}
- } else if (cmd == CmdTranslateC || cmd == CmdTranslateCUserland) {
- codegen_translate_c(g, in_file_buf, stdout, cmd == CmdTranslateCUserland);
+ } else if (cmd == CmdTranslateC) {
+ codegen_translate_c(g, in_file_buf, stdout);
if (timing_info)
codegen_print_timing_report(g, stderr);
return main_exit(root_progress_node, EXIT_SUCCESS);