llvm.org GIT mirror llvm / e733e54
Debug Info: Move DIEDwarfExpression into DwarfExpression.h because it 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 Adrian Prantl 5 years ago
2 changed file(s) with 17 addition(s) and 14 deletion(s). Raw diff Collapse all Expand all
2121 class AsmPrinter;
2222 class ByteStreamer;
2323 class TargetRegisterInfo;
24 class DwarfUnit;
25 class DIELoc;
2426
2527 /// Base class containing the logic for constructing DWARF expressions
2628 /// independently of whether they are emitted into a DIE or into a .debug_loc
107109 void EmitUnsigned(unsigned Value) override;
108110 bool isFrameRegister(unsigned MachineReg) override;
109111 };
112
113 /// DwarfExpression implementation for singular DW_AT_location.
114 class DIEDwarfExpression : public DwarfExpression {
115 DwarfUnit &DU;
116 DIELoc ¨
117
118 public:
119 DIEDwarfExpression(const AsmPrinter &AP, DwarfUnit &DU, DIELoc &DIE)
120 : DwarfExpression(AP), DU(DU), DIE(DIE) {}
121
122 void EmitOp(uint8_t Op, const char *Comment = nullptr) override;
123 void EmitSigned(int Value) override;
124 void EmitUnsigned(unsigned Value) override;
125 bool isFrameRegister(unsigned MachineReg) override;
126 };
110127 }
111128
112129 #endif
4242 GenerateDwarfTypeUnits("generate-type-units", cl::Hidden,
4343 cl::desc("Generate DWARF4 type units."),
4444 cl::init(false));
45
46 /// DwarfExpression implementation for DwarfUnit.
47 class DIEDwarfExpression : public DwarfExpression {
48 DwarfUnit &DU;
49 DIELoc ¨
50 public:
51 DIEDwarfExpression(const AsmPrinter &AP, DwarfUnit &DU, DIELoc &DIE)
52 : DwarfExpression(AP), DU(DU), DIE(DIE) {}
53
54 void EmitOp(uint8_t Op, const char* Comment = nullptr) override;
55 void EmitSigned(int Value) override;
56 void EmitUnsigned(unsigned Value) override;
57 bool isFrameRegister(unsigned MachineReg) override;
58 };
5945
6046 void DIEDwarfExpression::EmitOp(uint8_t Op, const char* Comment) {
6147 DU.addUInt(DIE, dwarf::DW_FORM_data1, Op);