mirror of
https://github.com/xomboverlord/ldc.git
synced 2026-01-26 17:43:14 +01:00
Strip metadata even when addPassesForOptLevel() isn't called, for instance when
only inlining or when manually specifying passes.
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user