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
void EmitUnsigned(unsigned Value) override;
bool isFrameRegister(unsigned MachineReg) override;
};
+
+/// DwarfExpression implementation for singular DW_AT_location.
+class DIEDwarfExpression : public DwarfExpression {
+ DwarfUnit &DU;
+ DIELoc ¨
+
+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
cl::desc("Generate DWARF4 type units."),
cl::init(false));
-/// DwarfExpression implementation for DwarfUnit.
-class DIEDwarfExpression : public DwarfExpression {
- DwarfUnit &DU;
- DIELoc ¨
-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);
}