Mercurial > projects > ldc
diff gen/optimizer.cpp @ 1558:3adcb70700cb
Added back option to disable metadata generation and users. Set USE_METADATA to OFF in ccmake.
author | Tomas Lindquist Olsen <tomas.l.olsen gmail com> |
---|---|
date | Fri, 31 Jul 2009 11:28:31 +0200 |
parents | 259b031f3d22 |
children | 4551475bc6b6 |
line wrap: on
line diff
--- a/gen/optimizer.cpp Fri Jul 31 01:44:47 2009 +0200 +++ b/gen/optimizer.cpp Fri Jul 31 11:28:31 2009 +0200 @@ -160,8 +160,10 @@ if (!disableSimplifyRuntimeCalls) addPass(pm, createSimplifyDRuntimeCalls()); +#if USE_METADATA if (!disableGCToStack) addPass(pm, createGarbageCollect2Stack()); +#endif // USE_METADATA } // Run some clean-up passes addPass(pm, createInstructionCombiningPass()); @@ -221,6 +223,7 @@ 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. @@ -228,6 +231,7 @@ stripMD->runOnModule(*m); delete stripMD; } +#endif return false; } @@ -266,11 +270,13 @@ 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;