]> granicus.if.org Git - llvm/commitdiff
Remove unreachable code. (NFC)
authorAdrian Prantl <aprantl@apple.com>
Wed, 2 Aug 2017 15:22:17 +0000 (15:22 +0000)
committerAdrian Prantl <aprantl@apple.com>
Wed, 2 Aug 2017 15:22:17 +0000 (15:22 +0000)
MachineLocation::getOffset() always returns 0.

rdar://problem/33580047

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

lib/CodeGen/AsmPrinter/DebugLocEntry.h
lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp
lib/CodeGen/AsmPrinter/DwarfDebug.cpp
lib/CodeGen/AsmPrinter/DwarfUnit.cpp

index a68e8cc6b4b31ca4f06c8f8b376c615ac4937925..3d6d8a76529ccc807c0882b5fcf3de0e54ab8ff7 100644 (file)
@@ -81,7 +81,7 @@ public:
       if (isLocation()) {
         llvm::dbgs() << "Loc = { reg=" << Loc.getReg() << " ";
         if (Loc.isIndirect())
-          llvm::dbgs() << '+' << Loc.getOffset();
+          llvm::dbgs() << "+0";
         llvm::dbgs() << "} ";
       }
       else if (isConstantInt())
index e4b8939f2abc7f631425f255b524a4b1bcbdd624..5c763b42da3364a1f8d9fcaeb117f7fb6551d5e2 100644 (file)
@@ -799,12 +799,7 @@ void DwarfCompileUnit::addAddress(DIE &Die, dwarf::Attribute Attribute,
   if (Location.isIndirect())
     DwarfExpr.setMemoryLocationKind();
 
-  SmallVector<uint64_t, 8> Ops;
-  if (Location.isIndirect() && Location.getOffset()) {
-    Ops.push_back(dwarf::DW_OP_plus_uconst);
-    Ops.push_back(Location.getOffset());
-  }
-  DIExpressionCursor Cursor(Ops);
+  DIExpressionCursor Cursor({});
   const TargetRegisterInfo &TRI = *Asm->MF->getSubtarget().getRegisterInfo();
   if (!DwarfExpr.addMachineRegExpression(TRI, Cursor, Location.getReg()))
     return;
@@ -828,13 +823,7 @@ void DwarfCompileUnit::addComplexAddress(const DbgVariable &DV, DIE &Die,
   if (Location.isIndirect())
     DwarfExpr.setMemoryLocationKind();
 
-  SmallVector<uint64_t, 8> Ops;
-  if (Location.isIndirect() && Location.getOffset()) {
-    Ops.push_back(dwarf::DW_OP_plus_uconst);
-    Ops.push_back(Location.getOffset());
-  }
-  Ops.append(DIExpr->elements_begin(), DIExpr->elements_end());
-  DIExpressionCursor Cursor(Ops);
+  DIExpressionCursor Cursor(DIExpr);
   const TargetRegisterInfo &TRI = *Asm->MF->getSubtarget().getRegisterInfo();
   if (!DwarfExpr.addMachineRegExpression(TRI, Cursor, Location.getReg()))
     return;
index b97ff4ca6c89aa47f630a74dbe934ed5f7baddd1..6e9afde0f28a0034780e6ba0bf0e2a1cfe87dcd8 100644 (file)
@@ -1578,13 +1578,7 @@ static void emitDebugLocValue(const AsmPrinter &AP, const DIBasicType *BT,
     MachineLocation Location = Value.getLoc();
     if (Location.isIndirect())
       DwarfExpr.setMemoryLocationKind();
-    SmallVector<uint64_t, 8> Ops;
-    if (Location.isIndirect() && Location.getOffset()) {
-      Ops.push_back(dwarf::DW_OP_plus_uconst);
-      Ops.push_back(Location.getOffset());
-    }
-    Ops.append(DIExpr->elements_begin(), DIExpr->elements_end());
-    DIExpressionCursor Cursor(Ops);
+    DIExpressionCursor Cursor(DIExpr);
     const TargetRegisterInfo &TRI = *AP.MF->getSubtarget().getRegisterInfo();
     if (!DwarfExpr.addMachineRegExpression(TRI, Cursor, Location.getReg()))
       return;
index 4f4ebfc562977e9f275ba2688971f12f96c3d82e..784a1d512c17a1bba8b8a4f471ffde057a9d15b7 100644 (file)
@@ -473,11 +473,7 @@ void DwarfUnit::addBlockByrefAddress(const DbgVariable &DV, DIE &Die,
   if (Location.isIndirect())
     DwarfExpr.setMemoryLocationKind();
 
-  SmallVector<uint64_t, 9> Ops;
-  if (Location.isIndirect() && Location.getOffset()) {
-    Ops.push_back(dwarf::DW_OP_plus_uconst);
-    Ops.push_back(Location.getOffset());
-  }
+  SmallVector<uint64_t, 6> Ops;
   // If we started with a pointer to the __Block_byref... struct, then
   // the first thing we need to do is dereference the pointer (DW_OP_deref).
   if (isPointer)