diff gen/optimizer.cpp @ 1576:4551475bc6b6

Kill off StripMetaData.
author Benjamin Kramer <benny.kra@gmail.com>
date Tue, 25 Aug 2009 21:35:43 +0200
parents 3adcb70700cb
children 40bd4a0d4870
line wrap: on
line diff
--- a/gen/optimizer.cpp	Tue Aug 25 21:21:37 2009 +0200
+++ b/gen/optimizer.cpp	Tue Aug 25 21:35:43 2009 +0200
@@ -58,12 +58,6 @@
     cl::desc("Disable promotion of GC allocations to stack memory in -O<N>"),
     cl::ZeroOrMore);
 
-// Not recommended; metadata currently triggers an assert in the backend...
-static cl::opt<bool>
-disableStripMetaData("disable-strip-metadata",
-    cl::desc("Disable default metadata stripping (not recommended)"),
-    cl::ZeroOrMore);
-
 static cl::opt<opts::BoolOrDefaultAdapter, false, opts::FlagParser>
 enableInlining("inlining",
     cl::desc("(*) Enable function inlining in -O<N>"),
@@ -222,18 +216,8 @@
 // Returns true if any optimization passes were invoked.
 bool ldc_optimize_module(llvm::Module* m)
 {
-    if (!optimize()) {
-#if USE_METADATA
-        if (!disableStripMetaData) {
-            // This one always needs to run if metadata is generated, because
-            // the code generator will assert if it's not used.
-            ModulePass* stripMD = createStripMetaData();
-            stripMD->runOnModule(*m);
-            delete stripMD;
-        }
-#endif
+    if (!optimize())
         return false;
-    }
 
     PassManager pm;
     
@@ -270,14 +254,6 @@
     if (optimize)
         addPassesForOptLevel(pm);
 
-#if USE_METADATA
-    if (!disableStripMetaData) {
-        // This one is purposely not disabled by disableLangSpecificPasses
-        // because the code generator will assert if it's not used.
-        addPass(pm, createStripMetaData());
-    }
-#endif // USE_METADATA
-
     pm.run(*m);
     return true;
 }