Debug Info: Set the debug location for the function prologue to the decl of the function.

rdar://problem/14536357

Swift SVN r6576
This commit is contained in:
Adrian Prantl
2013-07-25 01:03:46 +00:00
parent b85ba363a8
commit 511ddc46fd
3 changed files with 7 additions and 4 deletions

View File

@@ -32,13 +32,14 @@ using namespace irgen;
IRGenFunction::IRGenFunction(IRGenModule &IGM,
ExplosionKind explosionLevel,
llvm::Function *Fn,
SILDebugScope *DS)
SILDebugScope *DbgScope,
SILLocation DbgLoc)
: IGM(IGM), Builder(IGM.getLLVMContext()),
CurFn(Fn), CurExplosionLevel(explosionLevel),
ContextPtr(nullptr) {
// Make sure the instructions in this function are attached its debug scope.
if (IGM.DebugInfo)
IGM.DebugInfo->setCurrentLoc(Builder, DS);
IGM.DebugInfo->setCurrentLoc(Builder, DbgScope, DbgLoc);
emitPrologue();
}