aboutsummaryrefslogtreecommitdiff
path: root/lib/CodeGen/CGDebugInfo.cpp
diff options
context:
space:
mode:
authorAdrian Prantl <aprantl@apple.com>2013-03-14 21:52:59 +0000
committerAdrian Prantl <aprantl@apple.com>2013-03-14 21:52:59 +0000
commitbea407c92780ded6ef9aabc9d8ebbe60d233f381 (patch)
tree14c7375456b88a6e91c93b23c9815c8488721482 /lib/CodeGen/CGDebugInfo.cpp
parent7f99d5c54135ae812a7cb7c86f135086d3d65031 (diff)
Always declare the .block_descriptor parameter, not just the local copy.
Un-breaks gdb's invoke-block behavior. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@177118 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/CGDebugInfo.cpp')
-rw-r--r--lib/CodeGen/CGDebugInfo.cpp19
1 files changed, 10 insertions, 9 deletions
diff --git a/lib/CodeGen/CGDebugInfo.cpp b/lib/CodeGen/CGDebugInfo.cpp
index 6b0edbcafe..ae88732c82 100644
--- a/lib/CodeGen/CGDebugInfo.cpp
+++ b/lib/CodeGen/CGDebugInfo.cpp
@@ -2817,17 +2817,18 @@ void CGDebugInfo::EmitDeclareOfBlockLiteralArgVariable(const CGBlockInfo &block,
CGM.getLangOpts().Optimize, flags,
cast<llvm::Argument>(Arg)->getArgNo() + 1);
- // Matching the code in EmitParmDecl, depending on optimization level.
- llvm::Instruction *Call;
- if (LocalAddr)
+ if (LocalAddr) {
// Insert an llvm.dbg.value into the current block.
- Call = DBuilder.insertDbgValueIntrinsic(LocalAddr, 0, debugVar,
- Builder.GetInsertBlock());
- else
- // Insert an llvm.dbg.declare into the current block.
- Call = DBuilder.insertDeclare(Arg, debugVar, Builder.GetInsertBlock());
+ llvm::Instruction *DbgVal =
+ DBuilder.insertDbgValueIntrinsic(LocalAddr, 0, debugVar,
+ Builder.GetInsertBlock());
+ DbgVal->setDebugLoc(llvm::DebugLoc::get(line, column, scope));
+ }
- Call->setDebugLoc(llvm::DebugLoc::get(line, column, scope));
+ // Insert an llvm.dbg.declare into the current block.
+ llvm::Instruction *DbgDecl =
+ DBuilder.insertDeclare(Arg, debugVar, Builder.GetInsertBlock());
+ DbgDecl->setDebugLoc(llvm::DebugLoc::get(line, column, scope));
}
/// getStaticDataMemberDeclaration - If D is an out-of-class definition of