mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
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:
@@ -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();
|
||||
}
|
||||
|
||||
@@ -20,6 +20,7 @@
|
||||
|
||||
#include "swift/Basic/LLVM.h"
|
||||
#include "swift/AST/Type.h"
|
||||
#include "swift/SIL/SILLocation.h"
|
||||
#include "llvm/ADT/DenseMap.h"
|
||||
#include "llvm/IR/CallingConv.h"
|
||||
#include "IRBuilder.h"
|
||||
@@ -91,7 +92,8 @@ public:
|
||||
IRGenFunction(IRGenModule &IGM,
|
||||
Mangle::ExplosionKind explosion,
|
||||
llvm::Function *fn,
|
||||
SILDebugScope* DS = nullptr);
|
||||
SILDebugScope* DbgScope = nullptr,
|
||||
SILLocation DbgLoc = SILLocation());
|
||||
~IRGenFunction();
|
||||
|
||||
void unimplemented(SourceLoc Loc, StringRef Message);
|
||||
|
||||
@@ -645,7 +645,7 @@ IRGenSILFunction::IRGenSILFunction(IRGenModule &IGM,
|
||||
ExplosionKind explosionLevel)
|
||||
: IRGenFunction(IGM, explosionLevel,
|
||||
IGM.getAddrOfSILFunction(f, explosionLevel),
|
||||
f->getDebugScope()),
|
||||
f->getDebugScope(), f->getLocation()),
|
||||
CurSILFn(f)
|
||||
{}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user