diff options
author | Alon Zakai <alonzakai@gmail.com> | 2012-12-11 10:27:23 -0800 |
---|---|---|
committer | Alon Zakai <alonzakai@gmail.com> | 2012-12-21 10:47:41 -0800 |
commit | 2221065294b1d71590a68f088a19f7eeb8303022 (patch) | |
tree | a1e464145fae40c985b2aff0c789d51d29c090ac /emcc | |
parent | ea72b923bf5419de8e948a44387e55eea657f9f4 (diff) |
avoid separate lto pass
Diffstat (limited to 'emcc')
-rwxr-xr-x | emcc | 10 |
1 files changed, 3 insertions, 7 deletions
@@ -1058,18 +1058,14 @@ try: # If we can LTO, do it before dce, since it opens up dce opportunities if llvm_lto and shared.Building.can_use_unsafe_opts(): if not shared.Building.can_inline(): link_opts.append('-disable-inlining') - link_opts += ['-std-link-opts', '-disable-internalize'] - if DEBUG: print >> sys.stderr, 'emcc: LLVM linktime:', link_opts - shared.Building.llvm_opt(in_temp(target_basename + '.bc'), link_opts) - if DEBUG: save_intermediate('linktime', 'bc') - link_opts = [] + # do not internalize in std-link-opts - it ignores the internalize-public-api-list we pass later + link_opts += ['-disable-internalize', '-std-link-opts'] # At minimum remove dead functions etc., this potentially saves a lot in the size of the generated code (and the time to compile it) exports = ','.join(map(lambda exp: exp[1:], shared.Settings.EXPORTED_FUNCTIONS)) - # internalize carefully, llvm 3.2 will remove even main if not told not to link_opts += shared.Building.get_safe_internalize() + ['-globaldce'] if DEBUG: print >> sys.stderr, 'emcc: LLVM linktime:', link_opts shared.Building.llvm_opt(in_temp(target_basename + '.bc'), link_opts) - if DEBUG: save_intermediate('dce', 'bc') + if DEBUG: save_intermediate('linktime', 'bc') # Prepare .ll for Emscripten if not LEAVE_INPUTS_RAW: |