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/link.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/link.cpp')
| -rw-r--r-- | src/link.cpp | 16 |
1 files changed, 4 insertions, 12 deletions
diff --git a/src/link.cpp b/src/link.cpp index ebabdd46aa..b9328eff28 100644 --- a/src/link.cpp +++ b/src/link.cpp @@ -746,18 +746,10 @@ void codegen_link(CodeGen *g, const char *out_file) { buf_resize(&lj.out_file, 0); } - bool is_optimized = g->is_release_build; - if (is_optimized) { - if (g->verbose) { - fprintf(stderr, "\nOptimization:\n"); - fprintf(stderr, "---------------\n"); - } - - ZigLLVMOptimizeModule(g->target_machine, g->module); - - if (g->verbose) { - LLVMDumpModule(g->module); - } + if (g->verbose) { + fprintf(stderr, "\nOptimization:\n"); + fprintf(stderr, "---------------\n"); + LLVMDumpModule(g->module); } if (g->verbose) { fprintf(stderr, "\nLink:\n"); |
