Run backend without optimizations when no optimization parameters were used,

even when not generating debug info.
This commit is contained in:
Frits van Bommel
2009-05-10 20:22:08 +02:00
parent dfaba71dce
commit 57fc3463f6

View File

@@ -276,7 +276,7 @@ void write_asm_to_file(llvm::TargetMachine &Target, llvm::Module& m, llvm::raw_f
// Last argument is enum CodeGenOpt::Level OptLevel
// debug info doesn't work properly with OptLevel != None!
CodeGenOpt::Level LastArg = CodeGenOpt::Default;
if (global.params.symdebug)
if (global.params.symdebug || !optimize())
LastArg = CodeGenOpt::None;
else if (optLevel() >= 3)
LastArg = CodeGenOpt::Aggressive;