diff options
author | Adrian Prantl <aprantl@apple.com> | 2014-10-01 18:10:14 +0000 |
---|---|---|
committer | Adrian Prantl <aprantl@apple.com> | 2014-10-01 18:10:14 +0000 |
commit | af11fdba0ae7f09054e71744b454c6e1fd47cf7c (patch) | |
tree | 33abd0f5e4389950cf706041455c96144c9bb99c /clang/lib/CodeGen/CGDebugInfo.cpp | |
parent | 7bd22e98be7d552e85b7f0516d1d6ff785c2757e (diff) | |
download | bcm5719-llvm-af11fdba0ae7f09054e71744b454c6e1fd47cf7c.tar.gz bcm5719-llvm-af11fdba0ae7f09054e71744b454c6e1fd47cf7c.zip |
Reverting r218777 while investigating buildbot breakage.
"Update CGDebugInfo to the updated API in LLVM."
llvm-svn: 218781
Diffstat (limited to 'clang/lib/CodeGen/CGDebugInfo.cpp')
-rw-r--r-- | clang/lib/CodeGen/CGDebugInfo.cpp | 46 |
1 files changed, 21 insertions, 25 deletions
diff --git a/clang/lib/CodeGen/CGDebugInfo.cpp b/clang/lib/CodeGen/CGDebugInfo.cpp index a23ecaedaed..1d330690e25 100644 --- a/clang/lib/CodeGen/CGDebugInfo.cpp +++ b/clang/lib/CodeGen/CGDebugInfo.cpp @@ -2783,26 +2783,27 @@ void CGDebugInfo::EmitDeclare(const VarDecl *VD, llvm::dwarf::LLVMConstants Tag, CharUnits offset = CharUnits::fromQuantity(32); SmallVector<llvm::Value *, 9> addr; llvm::Type *Int64Ty = CGM.Int64Ty; - addr.push_back(llvm::ConstantInt::get(Int64Ty, llvm::dwarf::DW_OP_plus)); + addr.push_back(llvm::ConstantInt::get(Int64Ty, llvm::DIBuilder::OpPlus)); // offset of __forwarding field offset = CGM.getContext().toCharUnitsFromBits( CGM.getTarget().getPointerWidth(0)); addr.push_back(llvm::ConstantInt::get(Int64Ty, offset.getQuantity())); - addr.push_back(llvm::ConstantInt::get(Int64Ty, llvm::dwarf::DW_OP_deref)); - addr.push_back(llvm::ConstantInt::get(Int64Ty, llvm::dwarf::DW_OP_plus)); + addr.push_back(llvm::ConstantInt::get(Int64Ty, llvm::DIBuilder::OpDeref)); + addr.push_back(llvm::ConstantInt::get(Int64Ty, llvm::DIBuilder::OpPlus)); // offset of x field offset = CGM.getContext().toCharUnitsFromBits(XOffset); addr.push_back(llvm::ConstantInt::get(Int64Ty, offset.getQuantity())); // Create the descriptor for the variable. llvm::DIVariable D = - DBuilder.createLocalVariable(Tag, llvm::DIDescriptor(Scope), - VD->getName(), Unit, Line, Ty, ArgNo); + DBuilder.createComplexVariable(Tag, + llvm::DIDescriptor(Scope), + VD->getName(), Unit, Line, Ty, + addr, ArgNo); // Insert an llvm.dbg.declare into the current block. llvm::Instruction *Call = - DBuilder.insertDeclare(Storage, D, DBuilder.createExpression(addr), - Builder.GetInsertBlock()); + DBuilder.insertDeclare(Storage, D, Builder.GetInsertBlock()); Call->setDebugLoc(llvm::DebugLoc::get(Line, Column, Scope)); return; } else if (isa<VariableArrayType>(VD->getType())) @@ -2829,8 +2830,7 @@ void CGDebugInfo::EmitDeclare(const VarDecl *VD, llvm::dwarf::LLVMConstants Tag, // Insert an llvm.dbg.declare into the current block. llvm::Instruction *Call = - DBuilder.insertDeclare(Storage, D, DBuilder.createExpression(), - Builder.GetInsertBlock()); + DBuilder.insertDeclare(Storage, D, Builder.GetInsertBlock()); Call->setDebugLoc(llvm::DebugLoc::get(Line, Column, Scope)); } return; @@ -2845,8 +2845,7 @@ void CGDebugInfo::EmitDeclare(const VarDecl *VD, llvm::dwarf::LLVMConstants Tag, // Insert an llvm.dbg.declare into the current block. llvm::Instruction *Call = - DBuilder.insertDeclare(Storage, D, DBuilder.createExpression(), - Builder.GetInsertBlock()); + DBuilder.insertDeclare(Storage, D, Builder.GetInsertBlock()); Call->setDebugLoc(llvm::DebugLoc::get(Line, Column, Scope)); } @@ -2908,18 +2907,18 @@ void CGDebugInfo::EmitDeclareOfBlockDeclRefVariable(const VarDecl *VD, SmallVector<llvm::Value *, 9> addr; llvm::Type *Int64Ty = CGM.Int64Ty; if (isa<llvm::AllocaInst>(Storage)) - addr.push_back(llvm::ConstantInt::get(Int64Ty, llvm::dwarf::DW_OP_deref)); - addr.push_back(llvm::ConstantInt::get(Int64Ty, llvm::dwarf::DW_OP_plus)); + addr.push_back(llvm::ConstantInt::get(Int64Ty, llvm::DIBuilder::OpDeref)); + addr.push_back(llvm::ConstantInt::get(Int64Ty, llvm::DIBuilder::OpPlus)); addr.push_back(llvm::ConstantInt::get(Int64Ty, offset.getQuantity())); if (isByRef) { - addr.push_back(llvm::ConstantInt::get(Int64Ty, llvm::dwarf::DW_OP_deref)); - addr.push_back(llvm::ConstantInt::get(Int64Ty, llvm::dwarf::DW_OP_plus)); + addr.push_back(llvm::ConstantInt::get(Int64Ty, llvm::DIBuilder::OpDeref)); + addr.push_back(llvm::ConstantInt::get(Int64Ty, llvm::DIBuilder::OpPlus)); // offset of __forwarding field offset = CGM.getContext() .toCharUnitsFromBits(target.getPointerSizeInBits(0)); addr.push_back(llvm::ConstantInt::get(Int64Ty, offset.getQuantity())); - addr.push_back(llvm::ConstantInt::get(Int64Ty, llvm::dwarf::DW_OP_deref)); - addr.push_back(llvm::ConstantInt::get(Int64Ty, llvm::dwarf::DW_OP_plus)); + addr.push_back(llvm::ConstantInt::get(Int64Ty, llvm::DIBuilder::OpDeref)); + addr.push_back(llvm::ConstantInt::get(Int64Ty, llvm::DIBuilder::OpPlus)); // offset of x field offset = CGM.getContext().toCharUnitsFromBits(XOffset); addr.push_back(llvm::ConstantInt::get(Int64Ty, offset.getQuantity())); @@ -2927,14 +2926,13 @@ void CGDebugInfo::EmitDeclareOfBlockDeclRefVariable(const VarDecl *VD, // Create the descriptor for the variable. llvm::DIVariable D = - DBuilder.createLocalVariable(llvm::dwarf::DW_TAG_auto_variable, - llvm::DIDescriptor(LexicalBlockStack.back()), - VD->getName(), Unit, Line, Ty); + DBuilder.createComplexVariable(llvm::dwarf::DW_TAG_auto_variable, + llvm::DIDescriptor(LexicalBlockStack.back()), + VD->getName(), Unit, Line, Ty, addr); // Insert an llvm.dbg.declare into the current block. llvm::Instruction *Call = - DBuilder.insertDeclare(Storage, D, DBuilder.createExpression(addr), - Builder.GetInsertPoint()); + DBuilder.insertDeclare(Storage, D, Builder.GetInsertPoint()); Call->setDebugLoc(llvm::DebugLoc::get(Line, Column, LexicalBlockStack.back())); } @@ -3098,15 +3096,13 @@ void CGDebugInfo::EmitDeclareOfBlockLiteralArgVariable(const CGBlockInfo &block, // Insert an llvm.dbg.value into the current block. llvm::Instruction *DbgVal = DBuilder.insertDbgValueIntrinsic(LocalAddr, 0, debugVar, - DBuilder.createExpression(), Builder.GetInsertBlock()); DbgVal->setDebugLoc(llvm::DebugLoc::get(line, column, scope)); } // Insert an llvm.dbg.declare into the current block. llvm::Instruction *DbgDecl = - DBuilder.insertDeclare(Arg, debugVar, DBuilder.createExpression(), - Builder.GetInsertBlock()); + DBuilder.insertDeclare(Arg, debugVar, Builder.GetInsertBlock()); DbgDecl->setDebugLoc(llvm::DebugLoc::get(line, column, scope)); } |