comparison gen/toobj.cpp @ 1280:00a307a393f2

Now the backend wants an enum value as optimization level. Hopefully this'll be the last change to that code...
author Frits van Bommel <fvbommel wxs.nl>
date Thu, 30 Apr 2009 11:56:03 +0200
parents fa20726fe074
children 847b767b2d0b
comparison
equal deleted inserted replaced
1279:04c36605feb9 1280:00a307a393f2
266 266
267 #if LLVM_REV < 70343 267 #if LLVM_REV < 70343
268 // Last argument is bool Fast 268 // Last argument is bool Fast
269 // debug info doesn't work properly without fast! 269 // debug info doesn't work properly without fast!
270 bool LastArg = !optimize() || global.params.symdebug; 270 bool LastArg = !optimize() || global.params.symdebug;
271 #else 271 #elif LLVM_REV < 70459
272 // Last argument is unsigned OptLevel 272 // Last argument is unsigned OptLevel
273 // debug info doesn't work properly with OptLevel > 0! 273 // debug info doesn't work properly with OptLevel > 0!
274 unsigned LastArg = global.params.symdebug ? 0 : optLevel(); 274 unsigned LastArg = global.params.symdebug ? 0 : optLevel();
275 #else
276 // Last argument is enum CodeGenOpt::Level OptLevel
277 // debug info doesn't work properly with OptLevel != None!
278 CodeGenOpt::Level LastArg = CodeGenOpt::Default;
279 if (global.params.symdebug)
280 LastArg = CodeGenOpt::None;
281 else if (optLevel() >= 3)
282 LastArg = CodeGenOpt::Aggressive;
275 #endif 283 #endif
276 FileModel::Model mod = Target.addPassesToEmitFile(Passes, out, TargetMachine::AssemblyFile, LastArg); 284 FileModel::Model mod = Target.addPassesToEmitFile(Passes, out, TargetMachine::AssemblyFile, LastArg);
277 assert(mod == FileModel::AsmFile); 285 assert(mod == FileModel::AsmFile);
278 286
279 bool err = Target.addPassesToEmitFileFinish(Passes, MCE, LastArg); 287 bool err = Target.addPassesToEmitFileFinish(Passes, MCE, LastArg);