diff options
author | Devang Patel <dpatel@apple.com> | 2009-10-08 18:53:37 +0000 |
---|---|---|
committer | Devang Patel <dpatel@apple.com> | 2009-10-08 18:53:37 +0000 |
commit | e23429269f9cd86d6fed25432763fad520eb7f82 (patch) | |
tree | 5b4004babb36a3de13f1c4e90998cd3b19050af8 /lib/CodeGen/CGDecl.cpp | |
parent | 27d4be5b3f455275ff6b6afe5ce155d6435081d7 (diff) |
Record location info before emiting alloca for arguments. This allows arguments to have proper location info.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@83567 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/CGDecl.cpp')
-rw-r--r-- | lib/CodeGen/CGDecl.cpp | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/lib/CodeGen/CGDecl.cpp b/lib/CodeGen/CGDecl.cpp index 73bc0a04a0..cc8f547191 100644 --- a/lib/CodeGen/CGDecl.cpp +++ b/lib/CodeGen/CGDecl.cpp @@ -550,6 +550,11 @@ void CodeGenFunction::EmitParmDecl(const VarDecl &D, llvm::Value *Arg) { "Invalid argument to EmitParmDecl"); QualType Ty = D.getType(); + if (CGDebugInfo *DI = getDebugInfo()) { + DI->setLocation(D.getLocation()); + DI->EmitStopPoint(CurFn, Builder); + } + llvm::Value *DeclPtr; if (!Ty->isConstantSizeType()) { // Variable sized values always are passed by-reference. @@ -578,9 +583,7 @@ void CodeGenFunction::EmitParmDecl(const VarDecl &D, llvm::Value *Arg) { DMEntry = DeclPtr; // Emit debug info for param declaration. - if (CGDebugInfo *DI = getDebugInfo()) { - DI->setLocation(D.getLocation()); + if (CGDebugInfo *DI = getDebugInfo()) DI->EmitDeclareOfArgVariable(&D, DeclPtr, Builder); - } } |