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 | d751c64a679148bfe111bbba47f4a344ba813df9 (patch) | |
tree | 60248aac12098d4447cb7126cab40f77785bc5e4 /lib/Target/X86/AsmPrinter/X86ATTAsmPrinter.cpp | |
parent | 4dcc8a373d23cb5e9aa83c27f2c7ada95ed10708 (diff) | |
download | external_llvm-d751c64a679148bfe111bbba47f4a344ba813df9.zip external_llvm-d751c64a679148bfe111bbba47f4a344ba813df9.tar.gz external_llvm-d751c64a679148bfe111bbba47f4a344ba813df9.tar.bz2 |
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.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@56628 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Target/X86/AsmPrinter/X86ATTAsmPrinter.cpp')
-rw-r--r-- | lib/Target/X86/AsmPrinter/X86ATTAsmPrinter.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/Target/X86/AsmPrinter/X86ATTAsmPrinter.cpp b/lib/Target/X86/AsmPrinter/X86ATTAsmPrinter.cpp index 57db933..eb66a4f 100644 --- a/lib/Target/X86/AsmPrinter/X86ATTAsmPrinter.cpp +++ b/lib/Target/X86/AsmPrinter/X86ATTAsmPrinter.cpp @@ -260,7 +260,7 @@ bool X86ATTAsmPrinter::runOnMachineFunction(MachineFunction &MF) { // Emit post-function debug information. if (TAI->doesSupportDebugInformation()) - DW.EndFunction(); + DW.EndFunction(&MF); // Print out jump tables referenced by the function. EmitJumpTableInfo(MF.getJumpTableInfo(), MF); |