From 17dbddfe4191d32803a123482fb2bc004c01d5d0 Mon Sep 17 00:00:00 2001 From: Christian Kamm Date: Sun, 26 Apr 2009 18:21:07 +0200 Subject: [PATCH] Force 'fast' compilation when debug info is requested. LLVM trunk seems to skip debug info for non-fast compilation. --- gen/toobj.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/gen/toobj.cpp b/gen/toobj.cpp index 1ae2b297..e1a1f1a2 100644 --- a/gen/toobj.cpp +++ b/gen/toobj.cpp @@ -269,8 +269,8 @@ void write_asm_to_file(llvm::TargetMachine &Target, llvm::Module& m, llvm::raw_f // Ask the target to add backend passes as necessary. MachineCodeEmitter *MCE = 0; -//TODO: May want to switch it on for -O0? - bool Fast = false; + // debug info doesn't work properly without fast! + bool Fast = !optimize() || global.params.symdebug; FileModel::Model mod = Target.addPassesToEmitFile(Passes, out, TargetMachine::AssemblyFile, Fast); assert(mod == FileModel::AsmFile);