From 374d7f2b160143e4fe413783d230b028127217c9 Mon Sep 17 00:00:00 2001 From: Bill Wendling Date: Fri, 26 Sep 2008 00:28:12 +0000 Subject: If we have a function with an unreachable statement such that the ending debug information is in an unreachable block, then it's possible that the high/low pc values won't be set for the dwarf information. E.g., this function: void abort(void) __attribute__((__noreturn__)); void dead_beef(void) __attribute__ ((noreturn)); int *b; void dead_beef(void) { *b=0xdeadbeef; abort(); } has a call to "@llvm.dbg.region.end" only in the unreachable block: define void @dead_beef() noreturn nounwind { entry: call void @llvm.dbg.func.start(...) call void @llvm.dbg.stoppoint(...) ... call void @abort( ) noreturn nounwind unreachable return: ; No predecessors! call void @llvm.dbg.stoppoint(...) call void @llvm.dbg.region.end(...) ret void } The dwarf information emitted is something like: 0x00000084: TAG_subprogram [5] AT_name( "dead_beef" ) AT_external( 0x01 ) AT_prototyped( 0x01 ) AT_decl_file( 0x01 ) AT_decl_line( 0x08 ) Note that this is *not* the best fix for this problem, but a band-aid for an gaping wound. This code needs to be changed when we revamp our debugging information. llvm-svn: 56628 --- llvm/lib/Target/CellSPU/SPUAsmPrinter.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'llvm/lib/Target/CellSPU/SPUAsmPrinter.cpp') diff --git a/llvm/lib/Target/CellSPU/SPUAsmPrinter.cpp b/llvm/lib/Target/CellSPU/SPUAsmPrinter.cpp index 5b0bacfc89f..8d9e8911162 100644 --- a/llvm/lib/Target/CellSPU/SPUAsmPrinter.cpp +++ b/llvm/lib/Target/CellSPU/SPUAsmPrinter.cpp @@ -461,7 +461,7 @@ LinuxAsmPrinter::runOnMachineFunction(MachineFunction &MF) EmitJumpTableInfo(MF.getJumpTableInfo(), MF); // Emit post-function debug information. - DW.EndFunction(); + DW.EndFunction(&MF); // We didn't modify anything. return false; -- cgit v1.2.3