comparison gen/optimizer.cpp @ 1294:dd84ec4353ce

Strip metadata even when addPassesForOptLevel() isn't called, for instance when only inlining or when manually specifying passes.
author Frits van Bommel <fvbommel wxs.nl>
date Sun, 03 May 2009 20:16:15 +0200
parents e109e4031e8a
children 79b201533cf8
comparison
equal deleted inserted replaced
1293:00b408a5b7fa 1294:dd84ec4353ce
154 pm.add(createInstructionCombiningPass()); 154 pm.add(createInstructionCombiningPass());
155 pm.add(createCFGSimplificationPass()); 155 pm.add(createCFGSimplificationPass());
156 } 156 }
157 #endif 157 #endif
158 } 158 }
159 #ifdef USE_METADATA
160 if (!disableStripMetaData) {
161 // This one is purposely not disabled by disableLangSpecificPasses
162 // because the code generator will assert if it's not used.
163 pm.add(createStripMetaData());
164 }
165 #endif
166 159
167 // -O3 160 // -O3
168 if (optimizeLevel >= 3) 161 if (optimizeLevel >= 3)
169 { 162 {
170 pm.add(createArgumentPromotionPass()); 163 pm.add(createArgumentPromotionPass());
250 } 243 }
251 // insert -O<N> / -enable-inlining if specified at the end, 244 // insert -O<N> / -enable-inlining if specified at the end,
252 if (optimize) 245 if (optimize)
253 addPassesForOptLevel(pm); 246 addPassesForOptLevel(pm);
254 247
248 #ifdef USE_METADATA
249 if (!disableStripMetaData) {
250 // This one is purposely not disabled by disableLangSpecificPasses
251 // because the code generator will assert if it's not used.
252 pm.add(createStripMetaData());
253 }
254 #endif
255
255 pm.run(*m); 256 pm.run(*m);
256 return true; 257 return true;
257 } 258 }