1616namespace llvm {
1717
1818// / A expression in AVR machine code.
19- class AVRMCExpr : public MCTargetExpr {
19+ class AVRMCExpr : public MCSpecifierExpr {
2020public:
21+ using Specifier = Spec;
2122 // / Specifies the type of an expression.
22- enum Specifier {
23+ enum {
2324 VK_None,
2425
2526 VK_AVR_NONE = MCSymbolRefExpr::FirstTargetSpecifier,
@@ -48,11 +49,8 @@ class AVRMCExpr : public MCTargetExpr {
4849 static const AVRMCExpr *create (Specifier S, const MCExpr *Expr,
4950 bool isNegated, MCContext &Ctx);
5051
51- // / Gets the type of the expression.
52- Specifier getSpecifier () const { return specifier; }
5352 // / Gets the name of the expression.
5453 const char *getName () const ;
55- const MCExpr *getSubExpr () const { return SubExpr; }
5654 // / Gets the fixup which corresponds to the expression.
5755 AVR::Fixups getFixupKind () const ;
5856 // / Evaluates the fixup as a constant value.
@@ -64,30 +62,18 @@ class AVRMCExpr : public MCTargetExpr {
6462 void printImpl (raw_ostream &OS, const MCAsmInfo *MAI) const override ;
6563 bool evaluateAsRelocatableImpl (MCValue &Res,
6664 const MCAssembler *Asm) const override ;
67- void visitUsedExpr (MCStreamer &streamer) const override ;
68-
69- MCFragment *findAssociatedFragment () const override {
70- return getSubExpr ()->findAssociatedFragment ();
71- }
72-
73- static bool classof (const MCExpr *E) {
74- return E->getKind () == MCExpr::Target;
75- }
7665
7766public:
7867 static Specifier parseSpecifier (StringRef Name);
7968
8069private:
8170 int64_t evaluateAsInt64 (int64_t Value) const ;
8271
83- const Specifier specifier;
84- const MCExpr *SubExpr;
8572 bool Negated;
8673
8774private:
8875 explicit AVRMCExpr (Specifier S, const MCExpr *Expr, bool Negated)
89- : specifier(S), SubExpr(Expr), Negated(Negated) {}
90- ~AVRMCExpr () = default ;
76+ : MCSpecifierExpr(Expr, S), Negated(Negated) {}
9177};
9278
9379} // end namespace llvm
0 commit comments