diff options
author | Chris Lattner <sabre@nondot.org> | 2010-04-01 06:31:43 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2010-04-01 06:31:43 +0000 |
commit | c60346388d60b1756f3675dabb60dc58da0728ec (patch) | |
tree | 626b0516cbc5d52c9fffcba487f62d2aca68c3d8 /lib/CodeGen/CGDebugInfo.cpp | |
parent | 3a3e584cc2db4ef44a63b5903b2a98986234da54 (diff) |
adjust to IRBuilder change and use faster DebugLoc apis.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@100093 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/CGDebugInfo.cpp')
-rw-r--r-- | lib/CodeGen/CGDebugInfo.cpp | 26 |
1 files changed, 8 insertions, 18 deletions
diff --git a/lib/CodeGen/CGDebugInfo.cpp b/lib/CodeGen/CGDebugInfo.cpp index fc7c0c52eb..58acd3c2e1 100644 --- a/lib/CodeGen/CGDebugInfo.cpp +++ b/lib/CodeGen/CGDebugInfo.cpp @@ -1389,13 +1389,10 @@ void CGDebugInfo::EmitStopPoint(llvm::Function *Fn, CGBuilderTy &Builder) { llvm::DIFile Unit = getOrCreateFile(CurLoc); PresumedLoc PLoc = SM.getPresumedLoc(CurLoc); - llvm::DIDescriptor DR(RegionStack.back()); - llvm::DIScope DS = llvm::DIScope(DR.getNode()); - llvm::DILocation DO(NULL); - llvm::DILocation DL = - DebugFactory.CreateLocation(PLoc.getLine(), PLoc.getColumn(), - DS, DO); - Builder.SetCurrentDebugLocation(DL.getNode()); + llvm::MDNode *Scope = RegionStack.back(); + Builder.SetCurrentDebugLocation(llvm::NewDebugLoc::get(PLoc.getLine(), + PLoc.getColumn(), + Scope)); } /// EmitRegionStart- Constructs the debug code for entering a declarative @@ -1598,11 +1595,8 @@ void CGDebugInfo::EmitDeclare(const VarDecl *VD, unsigned Tag, llvm::Instruction *Call = DebugFactory.InsertDeclare(Storage, D, Builder.GetInsertBlock()); - llvm::DIScope DS(RegionStack.back()); - llvm::DILocation DO(NULL); - llvm::DILocation DL = DebugFactory.CreateLocation(Line, Column, DS, DO); - - Call->setDbgMetadata(DL.getNode()); + llvm::MDNode *Scope = RegionStack.back(); + Call->setDebugLoc(llvm::NewDebugLoc::get(Line, Column, Scope)); } /// EmitDeclare - Emit local variable declaration debug info. @@ -1664,13 +1658,9 @@ void CGDebugInfo::EmitDeclare(const BlockDeclRefExpr *BDRE, unsigned Tag, // Insert an llvm.dbg.declare into the current block. llvm::Instruction *Call = DebugFactory.InsertDeclare(Storage, D, Builder.GetInsertBlock()); - - llvm::DIScope DS(RegionStack.back()); - llvm::DILocation DO(NULL); - llvm::DILocation DL = - DebugFactory.CreateLocation(Line, PLoc.getColumn(), DS, DO); - Call->setDbgMetadata(DL.getNode()); + llvm::MDNode *Scope = RegionStack.back(); + Call->setDebugLoc(llvm::NewDebugLoc::get(Line, PLoc.getColumn(), Scope)); } void CGDebugInfo::EmitDeclareOfAutoVariable(const VarDecl *VD, |