diff options
Diffstat (limited to 'lib/CodeGen')
-rw-r--r-- | lib/CodeGen/CGDebugInfo.cpp | 35 | ||||
-rw-r--r-- | lib/CodeGen/CGDebugInfo.h | 5 |
2 files changed, 14 insertions, 26 deletions
diff --git a/lib/CodeGen/CGDebugInfo.cpp b/lib/CodeGen/CGDebugInfo.cpp index 77e6336a60..a90237cb32 100644 --- a/lib/CodeGen/CGDebugInfo.cpp +++ b/lib/CodeGen/CGDebugInfo.cpp @@ -1969,17 +1969,22 @@ void CGDebugInfo::EmitDeclare(const VarDecl *VD, unsigned Tag, } } -/// EmitDeclare - Emit local variable declaration debug info. -void CGDebugInfo::EmitDeclare(const VarDecl *VD, unsigned Tag, - llvm::Value *Storage, CGBuilderTy &Builder, - const CGBlockInfo &blockInfo) { - assert(!RegionStack.empty() && "Region stack mismatch, stack empty!"); +void CGDebugInfo::EmitDeclareOfAutoVariable(const VarDecl *VD, + llvm::Value *Storage, + CGBuilderTy &Builder) { + 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) { + assert(!RegionStack.empty() && "Region stack mismatch, stack empty!"); + if (Builder.GetInsertBlock() == 0) return; - + bool isByRef = VD->hasAttr<BlocksAttr>(); - + uint64_t XOffset = 0; llvm::DIFile Unit = getOrCreateFile(VD->getLocation()); llvm::DIType Ty; @@ -2017,7 +2022,8 @@ void CGDebugInfo::EmitDeclare(const VarDecl *VD, unsigned Tag, // Create the descriptor for the variable. llvm::DIVariable D = - DBuilder.createComplexVariable(Tag, llvm::DIDescriptor(RegionStack.back()), + DBuilder.createComplexVariable(llvm::dwarf::DW_TAG_auto_variable, + llvm::DIDescriptor(RegionStack.back()), VD->getName(), Unit, Line, Ty, addr); // Insert an llvm.dbg.declare into the current block. llvm::Instruction *Call = @@ -2027,19 +2033,6 @@ void CGDebugInfo::EmitDeclare(const VarDecl *VD, unsigned Tag, Call->setDebugLoc(llvm::DebugLoc::get(Line, Column, Scope)); } -void CGDebugInfo::EmitDeclareOfAutoVariable(const VarDecl *VD, - llvm::Value *Storage, - CGBuilderTy &Builder) { - EmitDeclare(VD, llvm::dwarf::DW_TAG_auto_variable, Storage, 0, Builder); -} - -void CGDebugInfo::EmitDeclareOfBlockDeclRefVariable( - const VarDecl *variable, llvm::Value *Storage, CGBuilderTy &Builder, - const CGBlockInfo &blockInfo) { - EmitDeclare(variable, llvm::dwarf::DW_TAG_auto_variable, Storage, Builder, - blockInfo); -} - /// EmitDeclareOfArgVariable - Emit call to llvm.dbg.declare for an argument /// variable declaration. void CGDebugInfo::EmitDeclareOfArgVariable(const VarDecl *VD, llvm::Value *AI, diff --git a/lib/CodeGen/CGDebugInfo.h b/lib/CodeGen/CGDebugInfo.h index af00c2f84f..27d991bbee 100644 --- a/lib/CodeGen/CGDebugInfo.h +++ b/lib/CodeGen/CGDebugInfo.h @@ -221,11 +221,6 @@ private: void EmitDeclare(const VarDecl *decl, unsigned Tag, llvm::Value *AI, unsigned ArgNo, CGBuilderTy &Builder); - /// EmitDeclare - Emit call to llvm.dbg.declare for a variable - /// declaration from an enclosing block. - void EmitDeclare(const VarDecl *decl, unsigned Tag, llvm::Value *AI, - CGBuilderTy &Builder, const CGBlockInfo &blockInfo); - // EmitTypeForVarWithBlocksAttr - Build up structure info for the byref. // See BuildByRefType. llvm::DIType EmitTypeForVarWithBlocksAttr(const ValueDecl *VD, |