Debug Info: Move DIEDwarfExpression into DwarfExpression.h because it
authorAdrian Prantl <aprantl@apple.com>
Wed, 14 Jan 2015 01:01:22 +0000 (01:01 +0000)
committerAdrian Prantl <aprantl@apple.com>
Wed, 14 Jan 2015 01:01:22 +0000 (01:01 +0000)
needs to be accessed from both DwarfCompileUnit.cpp and DwarfUnit.cpp.

NFC.

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

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

index f164f1c85133ba5bf58e530708a510614f79e015..4df958c5a033a666a913eda917f2f73c403768fb 100644 (file)
@@ -22,6 +22,8 @@ namespace llvm {
 class AsmPrinter;
 class ByteStreamer;
 class TargetRegisterInfo;
+class DwarfUnit;
+class DIELoc;
 
 /// Base class containing the logic for constructing DWARF expressions
 /// independently of whether they are emitted into a DIE or into a .debug_loc
@@ -108,6 +110,21 @@ public:
   void EmitUnsigned(unsigned Value) override;
   bool isFrameRegister(unsigned MachineReg) override;
 };
+
+/// DwarfExpression implementation for singular DW_AT_location.
+class DIEDwarfExpression : public DwarfExpression {
+  DwarfUnit &DU;
+  DIELoc &DIE;
+
+public:
+  DIEDwarfExpression(const AsmPrinter &AP, DwarfUnit &DU, DIELoc &DIE)
+      : DwarfExpression(AP), DU(DU), DIE(DIE) {}
+
+  void EmitOp(uint8_t Op, const char *Comment = nullptr) override;
+  void EmitSigned(int Value) override;
+  void EmitUnsigned(unsigned Value) override;
+  bool isFrameRegister(unsigned MachineReg) override;
+};
 }
 
 #endif
index 7b32831c77f5db2ed7ece1196f2e0362c7d968ca..2f2d9c6b54e36c27623b3a3feef2ee576ff92c82 100644 (file)
@@ -44,20 +44,6 @@ GenerateDwarfTypeUnits("generate-type-units", cl::Hidden,
                        cl::desc("Generate DWARF4 type units."),
                        cl::init(false));
 
-/// DwarfExpression implementation for DwarfUnit.
-class DIEDwarfExpression : public DwarfExpression {
-  DwarfUnit &DU;
-  DIELoc &DIE;
-public:
-  DIEDwarfExpression(const AsmPrinter &AP, DwarfUnit &DU, DIELoc &DIE)
-  : DwarfExpression(AP), DU(DU), DIE(DIE) {}
-
-  void EmitOp(uint8_t Op, const char* Comment = nullptr) override;
-  void EmitSigned(int Value) override;
-  void EmitUnsigned(unsigned Value) override;
-  bool isFrameRegister(unsigned MachineReg) override;
-};
-
 void DIEDwarfExpression::EmitOp(uint8_t Op, const char* Comment) {
   DU.addUInt(DIE, dwarf::DW_FORM_data1, Op);
 }