Emit prefix data after debug and EH directives.

This ensures that the prefix data is treated as part of the function for
the purpose of debug info.  This provides a better debugging experience,
among other things by allowing a debug info client to correctly look up
a function in debug info given a function pointer.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@193042 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Peter Collingbourne 2013-10-20 02:16:21 +00:00
parent e52fac1632
commit 0abc36205a
2 changed files with 6 additions and 4 deletions

View File

@ -462,10 +462,6 @@ void AsmPrinter::EmitFunctionHeader() {
OutStreamer.EmitLabel(DeadBlockSyms[i]);
}
// Emit the prefix data.
if (F->hasPrefixData())
EmitGlobalConstant(F->getPrefixData());
// Emit pre-function debug and/or EH information.
if (DE) {
NamedRegionTimer T(EHTimerName, DWARFGroupName, TimePassesIsEnabled);
@ -475,6 +471,10 @@ void AsmPrinter::EmitFunctionHeader() {
NamedRegionTimer T(DbgTimerName, DWARFGroupName, TimePassesIsEnabled);
DD->beginFunction(MF);
}
// Emit the prefix data.
if (F->hasPrefixData())
EmitGlobalConstant(F->getPrefixData());
}
/// EmitFunctionEntryLabel - Emit the label that is the entrypoint for the

View File

@ -3,12 +3,14 @@
@i = linkonce_odr global i32 1
; CHECK: f:
; CHECK-NEXT: .cfi_startproc
; CHECK-NEXT: .long 1
define void @f() prefix i32 1 {
ret void
}
; CHECK: g:
; CHECK-NEXT: .cfi_startproc
; CHECK-NEXT: .quad i
define void @g() prefix i32* @i {
ret void