llvm-6502/lib/Target/X86/AsmPrinter
Bill Wendling d751c64a67 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
2008-09-26 00:28:12 +00:00
..
CMakeLists.txt CMake build system: support for parallel builds. 2008-09-22 18:21:51 +00:00
Makefile Move X86 assembler printers into separate directory. This allows JIT-only users not to link it in (use 'x86codegen' llvm-config arg for this) 2008-08-17 13:53:59 +00:00
X86AsmPrinter.cpp Use additionnal include directory instead of ../ in #include. 2008-08-24 12:30:46 +00:00
X86ATTAsmPrinter.cpp If we have a function with an unreachable statement such that the ending debug 2008-09-26 00:28:12 +00:00
X86ATTAsmPrinter.h Drop obsolete hook and change all usage to new interface 2008-09-24 22:13:07 +00:00
X86IntelAsmPrinter.cpp Large mechanical patch. 2008-09-25 21:00:45 +00:00
X86IntelAsmPrinter.h Drop obsolete hook and change all usage to new interface 2008-09-24 22:13:07 +00:00