authorgravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2018-09-11 20:54:39-04:00
committergravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2018-09-11 20:54:39-04:00
log7e9f25dd18b7da750e547de94a779e3c14c07d94
treefe246e3b6b94e35f2f1dde9d228640ee0c1a7e0b
parent04dc5cdacaa953ca5365245f32158db70213b90e
signaturelock-open Commit is signed but in an unrecognized format.

stage1: clean up timing report in test mode


2 files changed, 10 insertions(+), 5 deletions(-)

src/codegen.cpp+5-2
...@@ -6388,9 +6388,9 @@ static void do_code_gen(CodeGen *g) {...@@ -6388,9 +6388,9 @@ static void do_code_gen(CodeGen *g) {
6388 char *error = nullptr;6388 char *error = nullptr;
6389 LLVMVerifyModule(g->module, LLVMAbortProcessAction, &error);6389 LLVMVerifyModule(g->module, LLVMAbortProcessAction, &error);
6390#endif6390#endif
6391}
63916392
6392 codegen_add_time_event(g, "LLVM Emit Output");6393static void zig_llvm_emit_output(CodeGen *g) {
6393
6394 bool is_small = g->build_mode == BuildModeSmallRelease;6394 bool is_small = g->build_mode == BuildModeSmallRelease;
63956395
6396 Buf *output_path = &g->o_file_output_path;6396 Buf *output_path = &g->o_file_output_path;
...@@ -8228,6 +8228,9 @@ void codegen_build_and_link(CodeGen *g) {...@@ -8228,6 +8228,9 @@ void codegen_build_and_link(CodeGen *g) {
82288228
8229 codegen_add_time_event(g, "Code Generation");8229 codegen_add_time_event(g, "Code Generation");
8230 do_code_gen(g);8230 do_code_gen(g);
8231 codegen_add_time_event(g, "LLVM Emit Output");
8232 zig_llvm_emit_output(g);
8233
8231 if (g->want_h_file) {8234 if (g->want_h_file) {
8232 codegen_add_time_event(g, "Generate .h");8235 codegen_add_time_event(g, "Generate .h");
8233 gen_h_file(g);8236 gen_h_file(g);
src/main.cpp+5-3
...@@ -971,6 +971,11 @@ int main(int argc, char **argv) {...@@ -971,6 +971,11 @@ int main(int argc, char **argv) {
971971
972 g->enable_cache = get_cache_opt(enable_cache, false);972 g->enable_cache = get_cache_opt(enable_cache, false);
973 codegen_build_and_link(g);973 codegen_build_and_link(g);
974
975 if (timing_info) {
976 codegen_print_timing_report(g, stdout);
977 }
978
974 Buf *test_exe_path_unresolved = &g->output_file_path;979 Buf *test_exe_path_unresolved = &g->output_file_path;
975 Buf *test_exe_path = buf_alloc();980 Buf *test_exe_path = buf_alloc();
976 *test_exe_path = os_path_resolve(&test_exe_path_unresolved, 1);981 *test_exe_path = os_path_resolve(&test_exe_path_unresolved, 1);
...@@ -981,7 +986,6 @@ int main(int argc, char **argv) {...@@ -981,7 +986,6 @@ int main(int argc, char **argv) {
981 }986 }
982 }987 }
983988
984
985 if (!target_can_exec(&native, target)) {989 if (!target_can_exec(&native, target)) {
986 fprintf(stderr, "Created %s but skipping execution because it is non-native.\n",990 fprintf(stderr, "Created %s but skipping execution because it is non-native.\n",
987 buf_ptr(test_exe_path));991 buf_ptr(test_exe_path));
...@@ -1003,8 +1007,6 @@ int main(int argc, char **argv) {...@@ -1003,8 +1007,6 @@ int main(int argc, char **argv) {
1003 if (term.how != TerminationIdClean || term.code != 0) {1007 if (term.how != TerminationIdClean || term.code != 0) {
1004 fprintf(stderr, "\nTests failed. Use the following command to reproduce the failure:\n");1008 fprintf(stderr, "\nTests failed. Use the following command to reproduce the failure:\n");
1005 fprintf(stderr, "%s\n", buf_ptr(test_exe_path));1009 fprintf(stderr, "%s\n", buf_ptr(test_exe_path));
1006 } else if (timing_info) {
1007 codegen_print_timing_report(g, stdout);
1008 }1010 }
1009 return (term.how == TerminationIdClean) ? term.code : -1;1011 return (term.how == TerminationIdClean) ? term.code : -1;
1010 } else {1012 } else {