]> granicus.if.org Git - clang/commitdiff
DIBuilder: Encapsulate DIExpression's element type
authorDuncan P. N. Exon Smith <dexonsmith@apple.com>
Wed, 1 Oct 2014 20:26:18 +0000 (20:26 +0000)
committerDuncan P. N. Exon Smith <dexonsmith@apple.com>
Wed, 1 Oct 2014 20:26:18 +0000 (20:26 +0000)
Update for corresponding LLVM API change for
`DIBuilder::createExpression()`.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@218798 91177308-0d34-0410-b5e6-96231b3b80d8

lib/CodeGen/CGDebugInfo.cpp

index a23ecaedaed3b374584c621eda11babb459f40b3..bc7f574fbd81bfa3d7f3a0fc50601796c1f2e2c0 100644 (file)
@@ -2781,18 +2781,17 @@ void CGDebugInfo::EmitDeclare(const VarDecl *VD, llvm::dwarf::LLVMConstants Tag,
   if (!Name.empty()) {
     if (VD->hasAttr<BlocksAttr>()) {
       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));
+      SmallVector<int64_t, 9> addr;
+      addr.push_back(llvm::dwarf::DW_OP_plus);
       // 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(offset.getQuantity());
+      addr.push_back(llvm::dwarf::DW_OP_deref);
+      addr.push_back(llvm::dwarf::DW_OP_plus);
       // offset of x field
       offset = CGM.getContext().toCharUnitsFromBits(XOffset);
-      addr.push_back(llvm::ConstantInt::get(Int64Ty, offset.getQuantity()));
+      addr.push_back(offset.getQuantity());
 
       // Create the descriptor for the variable.
       llvm::DIVariable D =
@@ -2905,24 +2904,23 @@ void CGDebugInfo::EmitDeclareOfBlockDeclRefVariable(const VarDecl *VD,
     target.getStructLayout(blockInfo.StructureType)
           ->getElementOffset(blockInfo.getCapture(VD).getIndex()));
 
-  SmallVector<llvm::Value *, 9> addr;
-  llvm::Type *Int64Ty = CGM.Int64Ty;
+  SmallVector<int64_t, 9> addr;
   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, offset.getQuantity()));
+    addr.push_back(llvm::dwarf::DW_OP_deref);
+  addr.push_back(llvm::dwarf::DW_OP_plus);
+  addr.push_back(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::dwarf::DW_OP_deref);
+    addr.push_back(llvm::dwarf::DW_OP_plus);
     // 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(offset.getQuantity());
+    addr.push_back(llvm::dwarf::DW_OP_deref);
+    addr.push_back(llvm::dwarf::DW_OP_plus);
     // offset of x field
     offset = CGM.getContext().toCharUnitsFromBits(XOffset);
-    addr.push_back(llvm::ConstantInt::get(Int64Ty, offset.getQuantity()));
+    addr.push_back(offset.getQuantity());
   }
 
   // Create the descriptor for the variable.