Push DwarfUnit::addAddress down into DwarfCompileUnit
authorDavid Blaikie <dblaikie@gmail.com>
Sun, 2 Nov 2014 06:46:40 +0000 (06:46 +0000)
committerDavid Blaikie <dblaikie@gmail.com>
Sun, 2 Nov 2014 06:46:40 +0000 (06:46 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@221085 91177308-0d34-0410-b5e6-96231b3b80d8

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

index 142d32e5591943f9a9af164a5c8027e7db0659bb..76b58684da8df455d03a8b21a4a1b21a97fb1d74 100644 (file)
@@ -724,4 +724,23 @@ void DwarfCompileUnit::addVariableAddress(const DbgVariable &DV, DIE &Die,
     addAddress(Die, dwarf::DW_AT_location, Location,
                DV.getVariable().isIndirect());
 }
+
+/// Add an address attribute to a die based on the location provided.
+void DwarfCompileUnit::addAddress(DIE &Die, dwarf::Attribute Attribute,
+                                  const MachineLocation &Location,
+                                  bool Indirect) {
+  DIELoc *Loc = new (DIEValueAllocator) DIELoc();
+
+  if (Location.isReg() && !Indirect)
+    addRegisterOpPiece(*Loc, Location.getReg());
+  else {
+    addRegisterOffset(*Loc, Location.getReg(), Location.getOffset());
+    if (Indirect && !Location.isReg()) {
+      addUInt(*Loc, dwarf::DW_FORM_data1, dwarf::DW_OP_deref);
+    }
+  }
+
+  // Now attach the location information to the DIE.
+  addBlock(Die, Attribute, Loc);
+}
 } // end llvm namespace
index a98c1417b28d9152a3cd34bb25c94a3001e4c638..82b52b18838dc3c430e64d309234efca6d983cf9 100644 (file)
@@ -196,6 +196,9 @@ public:
   /// MachineLocation.
   void addVariableAddress(const DbgVariable &DV, DIE &Die,
                           MachineLocation Location);
+  /// Add an address attribute to a die based on the location provided.
+  void addAddress(DIE &Die, dwarf::Attribute Attribute,
+                  const MachineLocation &Location, bool Indirect = false);
 };
 
 } // end llvm namespace
index dc855453a9f242020816d06bfa719b656ceb186b..ff2c1a5614c7f316a6f6deb37cbc4fc52490aeb2 100644 (file)
@@ -493,25 +493,6 @@ void DwarfUnit::addRegisterOffset(DIELoc &TheDie, unsigned Reg,
   addSInt(TheDie, dwarf::DW_FORM_sdata, Offset);
 }
 
-/// addAddress - Add an address attribute to a die based on the location
-/// provided.
-void DwarfUnit::addAddress(DIE &Die, dwarf::Attribute Attribute,
-                           const MachineLocation &Location, bool Indirect) {
-  DIELoc *Loc = new (DIEValueAllocator) DIELoc();
-
-  if (Location.isReg() && !Indirect)
-    addRegisterOpPiece(*Loc, Location.getReg());
-  else {
-    addRegisterOffset(*Loc, Location.getReg(), Location.getOffset());
-    if (Indirect && !Location.isReg()) {
-      addUInt(*Loc, dwarf::DW_FORM_data1, dwarf::DW_OP_deref);
-    }
-  }
-
-  // Now attach the location information to the DIE.
-  addBlock(Die, Attribute, Loc);
-}
-
 /// addComplexAddress - Start with the address based on the location provided,
 /// and generate the DWARF information necessary to find the actual variable
 /// given the extra address information encoded in the DbgVariable, starting
index ec04780ef65d367869aebfce41efd0807296bf2d..a314ee8d9982a15536d6cf3d0428b82815696f51 100644 (file)
@@ -262,11 +262,6 @@ public:
   void addSourceLine(DIE &Die, DINameSpace NS);
   void addSourceLine(DIE &Die, DIObjCProperty Ty);
 
-  /// addAddress - Add an address attribute to a die based on the location
-  /// provided.
-  void addAddress(DIE &Die, dwarf::Attribute Attribute,
-                  const MachineLocation &Location, bool Indirect = false);
-
   /// addConstantValue - Add constant value entry in variable DIE.
   void addConstantValue(DIE &Die, const MachineOperand &MO, DIType Ty);
   void addConstantValue(DIE &Die, const ConstantInt *CI, DIType Ty);