diff options
author | Adrian Prantl <aprantl@apple.com> | 2013-04-30 22:45:09 +0000 |
---|---|---|
committer | Adrian Prantl <aprantl@apple.com> | 2013-04-30 22:45:09 +0000 |
commit | 230ea4179a4684ec0d89954b7a93731b176546e9 (patch) | |
tree | 7aed71fd3da3db9fbf5fe6b0d0c229fe5aaea1fa /lib/CodeGen/CGDebugInfo.cpp | |
parent | 58eb37036b47bbe7433f72d92a2cb60848507707 (diff) |
Revert 180817 because 180816 was reverted.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@180823 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/CGDebugInfo.cpp')
-rw-r--r-- | lib/CodeGen/CGDebugInfo.cpp | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/lib/CodeGen/CGDebugInfo.cpp b/lib/CodeGen/CGDebugInfo.cpp index bb2c300ed8..6beba66c79 100644 --- a/lib/CodeGen/CGDebugInfo.cpp +++ b/lib/CodeGen/CGDebugInfo.cpp @@ -2511,6 +2511,22 @@ void CGDebugInfo::EmitDeclare(const VarDecl *VD, unsigned Tag, DBuilder.insertDeclare(Storage, D, Builder.GetInsertBlock()); Call->setDebugLoc(llvm::DebugLoc::get(Line, Column, Scope)); return; + } else if (isa<VariableArrayType>(VD->getType())) { + // These are "complex" variables in that they need an op_deref. + // Create the descriptor for the variable. + llvm::Value *Addr = llvm::ConstantInt::get(CGM.Int64Ty, + llvm::DIBuilder::OpDeref); + llvm::DIVariable D = + DBuilder.createComplexVariable(Tag, + llvm::DIDescriptor(Scope), + Name, Unit, Line, Ty, + Addr, ArgNo); + + // Insert an llvm.dbg.declare into the current block. + llvm::Instruction *Call = + DBuilder.insertDeclare(Storage, D, Builder.GetInsertBlock()); + Call->setDebugLoc(llvm::DebugLoc::get(Line, Column, Scope)); + return; } } else if (const RecordType *RT = dyn_cast<RecordType>(VD->getType())) { // If VD is an anonymous union then Storage represents value for |