diff options
| author | Bill Wendling <isanbard@gmail.com> | 2008-09-26 00:28:12 +0000 |
|---|---|---|
| committer | Bill Wendling <isanbard@gmail.com> | 2008-09-26 00:28:12 +0000 |
| commit | 374d7f2b160143e4fe413783d230b028127217c9 (patch) | |
| tree | 6dc5ac4b89bc8d55380f9995f565418d11b85fa0 /llvm/lib/Target/CellSPU/SPUAsmPrinter.cpp | |
| parent | 9dbe45c00061a38521b8921cfbc6aa7c48d93d73 (diff) | |
| download | bcm5719-llvm-374d7f2b160143e4fe413783d230b028127217c9.tar.gz bcm5719-llvm-374d7f2b160143e4fe413783d230b028127217c9.zip | |
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
Diffstat (limited to 'llvm/lib/Target/CellSPU/SPUAsmPrinter.cpp')
| -rw-r--r-- | llvm/lib/Target/CellSPU/SPUAsmPrinter.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
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; |

