diff options
| author | Andrew Kelley <superjoe30@gmail.com> | 2017-04-11 03:37:44 -0400 |
|---|---|---|
| committer | Andrew Kelley <superjoe30@gmail.com> | 2017-04-11 03:37:44 -0400 |
| commit | 7f47b0c271931466d8ce88c0928ff2bef8f8109f (patch) | |
| tree | 18e3aa9436bd8d4ae543e13c5e6955b20c95b49e /src/codegen.cpp | |
| parent | 11a655032400fda22132c54131546f3e671476a9 (diff) | |
| download | zig-7f47b0c271931466d8ce88c0928ff2bef8f8109f.tar.gz zig-7f47b0c271931466d8ce88c0928ff2bef8f8109f.zip | |
run alwaysinline pass in debug mode
before this commit, the optimized IR code that is displayed in
--verbose mode is not actually what gets emitted to an object
file.
that is now corrected, and we make sure to run the alwaysinliner
pass even in debug mode, so you can rely on "inline" keyword
inlining a function, guaranteed.
See #306
Diffstat (limited to 'src/codegen.cpp')
| -rw-r--r-- | src/codegen.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/codegen.cpp b/src/codegen.cpp index 54a76d9b54..938798f505 100644 --- a/src/codegen.cpp +++ b/src/codegen.cpp @@ -3826,8 +3826,8 @@ static void do_code_gen(CodeGen *g) { Buf *out_file_o = buf_create_from_buf(g->root_out_name); const char *o_ext = target_o_file_ext(&g->zig_target); buf_append_str(out_file_o, o_ext); - if (LLVMTargetMachineEmitToFile(g->target_machine, g->module, buf_ptr(out_file_o), - LLVMObjectFile, &err_msg)) + if (ZigLLVMTargetMachineEmitToFile(g->target_machine, g->module, buf_ptr(out_file_o), + LLVMObjectFile, &err_msg, !g->is_release_build)) { zig_panic("unable to write object file: %s", err_msg); } |
