aboutsummaryrefslogtreecommitdiff
path: root/src/main.cpp
diff options
context:
space:
mode:
authorAndrew Kelley <andrew@ziglang.org>2020-01-03 22:11:19 -0500
committerAndrew Kelley <andrew@ziglang.org>2020-01-03 22:11:19 -0500
commit14fcfe29817c03c3cac023b045433ea7abe4bd47 (patch)
tree9c209c80ec8d0382921934b7ef7baec8a78b7f31 /src/main.cpp
parent695c8f756b7ef12c4e8993720503b9c6d2242689 (diff)
downloadzig-14fcfe29817c03c3cac023b045433ea7abe4bd47.tar.gz
zig-14fcfe29817c03c3cac023b045433ea7abe4bd47.zip
translate-c supports --cache on
this will be used to provide a zig build step
Diffstat (limited to 'src/main.cpp')
-rw-r--r--src/main.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/main.cpp b/src/main.cpp
index ea9f089072..8a661bfa05 100644
--- a/src/main.cpp
+++ b/src/main.cpp
@@ -1164,7 +1164,7 @@ int main(int argc, char **argv) {
return print_error_usage(arg0);
}
- Buf *zig_root_source_file = cmd == CmdTranslateC ? 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");
@@ -1330,7 +1330,8 @@ int main(int argc, char **argv) {
zig_unreachable();
}
} else if (cmd == CmdTranslateC) {
- codegen_translate_c(g, in_file_buf, stdout);
+ g->enable_cache = get_cache_opt(enable_cache, false);
+ codegen_translate_c(g, in_file_buf);
if (timing_info)
codegen_print_timing_report(g, stderr);
return main_exit(root_progress_node, EXIT_SUCCESS);