diff options
author | Eric Christopher <echristo@apple.com> | 2012-09-21 22:18:42 +0000 |
---|---|---|
committer | Eric Christopher <echristo@apple.com> | 2012-09-21 22:18:42 +0000 |
commit | a52a6a8351283a694f23bb90669c93950b83308b (patch) | |
tree | dde3d68620ac3b1bb4e3b7d32d5008bb00a766ec /clang/lib/CodeGen/CGDebugInfo.cpp | |
parent | 89df5ecaf2222e1104cbb11292fdb1272170f57c (diff) | |
download | bcm5719-llvm-a52a6a8351283a694f23bb90669c93950b83308b.tar.gz bcm5719-llvm-a52a6a8351283a694f23bb90669c93950b83308b.zip |
Mark the passed in "self" for a block as an object pointer so
that the backend can mark it as the representative pointer for
the block.
rdar://12001329
llvm-svn: 164418
Diffstat (limited to 'clang/lib/CodeGen/CGDebugInfo.cpp')
-rw-r--r-- | clang/lib/CodeGen/CGDebugInfo.cpp | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/clang/lib/CodeGen/CGDebugInfo.cpp b/clang/lib/CodeGen/CGDebugInfo.cpp index 5169cdf4ee2..9a0bcd5dd8f 100644 --- a/clang/lib/CodeGen/CGDebugInfo.cpp +++ b/clang/lib/CodeGen/CGDebugInfo.cpp @@ -2418,9 +2418,10 @@ void CGDebugInfo::EmitDeclareOfAutoVariable(const VarDecl *VD, EmitDeclare(VD, llvm::dwarf::DW_TAG_auto_variable, Storage, 0, Builder); } -void CGDebugInfo::EmitDeclareOfBlockDeclRefVariable( - const VarDecl *VD, llvm::Value *Storage, CGBuilderTy &Builder, - const CGBlockInfo &blockInfo) { +void CGDebugInfo::EmitDeclareOfBlockDeclRefVariable(const VarDecl *VD, + llvm::Value *Storage, + CGBuilderTy &Builder, + const CGBlockInfo &blockInfo) { assert(CGM.getCodeGenOpts().DebugInfo >= CodeGenOptions::LimitedDebugInfo); assert(!LexicalBlockStack.empty() && "Region stack mismatch, stack empty!"); @@ -2437,6 +2438,11 @@ void CGDebugInfo::EmitDeclareOfBlockDeclRefVariable( else Ty = getOrCreateType(VD->getType(), Unit); + // Self is passed along as an implicit non-arg variable in a + // block. Mark it as the object pointer. + if (isa<ImplicitParamDecl>(VD) && VD->getName() == "self") + Ty = DBuilder.createObjectPointerType(Ty); + // Get location information. unsigned Line = getLineNumber(VD->getLocation()); unsigned Column = getColumnNumber(VD->getLocation()); |