Strip metadata even when addPassesForOptLevel() isn't called, for instance when

only inlining or when manually specifying passes.
This commit is contained in:
Frits van Bommel
2009-05-03 20:16:15 +02:00
parent 3572944b90
commit 865ae79e27

View File

@@ -156,13 +156,6 @@ static void addPassesForOptLevel(PassManager& pm) {
}
#endif
}
#ifdef USE_METADATA
if (!disableStripMetaData) {
// This one is purposely not disabled by disableLangSpecificPasses
// because the code generator will assert if it's not used.
pm.add(createStripMetaData());
}
#endif
// -O3
if (optimizeLevel >= 3)
@@ -252,6 +245,14 @@ bool ldc_optimize_module(llvm::Module* m)
if (optimize)
addPassesForOptLevel(pm);
#ifdef USE_METADATA
if (!disableStripMetaData) {
// This one is purposely not disabled by disableLangSpecificPasses
// because the code generator will assert if it's not used.
pm.add(createStripMetaData());
}
#endif
pm.run(*m);
return true;
}