aboutsummaryrefslogtreecommitdiff
path: root/emcc
diff options
context:
space:
mode:
authorAlon Zakai <alonzakai@gmail.com>2013-07-02 12:11:50 -0700
committerAlon Zakai <alonzakai@gmail.com>2013-07-03 15:31:05 -0700
commit4a907afae04289b7c22536a429f0e5adfdb39349 (patch)
tree05969695e7820e325c9731a5a8d4e76bcebe1089 /emcc
parentfa5cc31c396c0a46e6706b4df68e0b63aaae1d74 (diff)
always do globaldce (and potentially strip-debug), even when we are building something linkable
Diffstat (limited to 'emcc')
-rwxr-xr-xemcc21
1 files changed, 10 insertions, 11 deletions
diff --git a/emcc b/emcc
index b0eb7e0c..5ce8a3dd 100755
--- a/emcc
+++ b/emcc
@@ -1450,17 +1450,16 @@ try:
shared.Building.llvm_opt(in_temp(target_basename + '.bc'), ['-O3'])
if DEBUG: save_intermediate('opt', 'bc')
- if shared.Building.can_build_standalone():
- # If we can LTO, do it before dce, since it opens up dce opportunities
- if llvm_lto and llvm_lto != 2 and shared.Building.can_use_unsafe_opts():
- if not shared.Building.can_inline(): link_opts.append('-disable-inlining')
- # do not internalize in std-link-opts - it ignores internalize-public-api-list - and add a manual internalize
- link_opts += ['-disable-internalize'] + shared.Building.get_safe_internalize() + ['-std-link-opts']
- else:
- # At minimum remove dead functions etc., this potentially saves a lot in the size of the generated code (and the time to compile it)
- link_opts += shared.Building.get_safe_internalize() + ['-globaldce']
- shared.Building.llvm_opt(in_temp(target_basename + '.bc'), link_opts)
- if DEBUG: save_intermediate('linktime', 'bc')
+ # If we can LTO, do it before dce, since it opens up dce opportunities
+ if shared.Building.can_build_standalone() and llvm_lto and llvm_lto != 2 and shared.Building.can_use_unsafe_opts():
+ if not shared.Building.can_inline(): link_opts.append('-disable-inlining')
+ # do not internalize in std-link-opts - it ignores internalize-public-api-list - and add a manual internalize
+ link_opts += ['-disable-internalize'] + shared.Building.get_safe_internalize() + ['-std-link-opts']
+ else:
+ # At minimum remove dead functions etc., this potentially saves a lot in the size of the generated code (and the time to compile it)
+ link_opts += shared.Building.get_safe_internalize() + ['-globaldce']
+ shared.Building.llvm_opt(in_temp(target_basename + '.bc'), link_opts)
+ if DEBUG: save_intermediate('linktime', 'bc')
if save_bc:
shutil.copyfile(final, save_bc)