2121
2222namespace llvm {
2323
24- class AArch64MCExpr : public MCTargetExpr {
24+ class AArch64MCExpr : public MCSpecifierExpr {
2525public:
26- enum Specifier : uint16_t {
26+ using Specifier = uint16_t ;
27+ enum {
2728 // clang-format off
2829 None = 0 ,
2930 // Symbol locations specifying (roughly speaking) what calculation should be
@@ -139,32 +140,13 @@ class AArch64MCExpr : public MCTargetExpr {
139140 // clang-format on
140141 };
141142
142- private:
143- const MCExpr *Expr;
144- const Specifier specifier;
145-
146143protected:
147144 explicit AArch64MCExpr (const MCExpr *Expr, Specifier S)
148- : Expr (Expr), specifier( S) {}
145+ : MCSpecifierExpr (Expr, S) {}
149146
150147public:
151- // / @name Construction
152- // / @{
153-
154148 static const AArch64MCExpr *create (const MCExpr *Expr, Specifier,
155149 MCContext &Ctx);
156-
157- // / @}
158- // / @name Accessors
159- // / @{
160-
161- // / Get the kind of this expression.
162- Specifier getSpecifier () const { return specifier; }
163-
164- // / Get the expression this modifier applies to.
165- const MCExpr *getSubExpr () const { return Expr; }
166-
167- // / @}
168150 // / @name VariantKind information extractors.
169151 // / @{
170152
@@ -185,16 +167,8 @@ class AArch64MCExpr : public MCTargetExpr {
185167 StringRef getSpecifierName () const ;
186168
187169 void printImpl (raw_ostream &OS, const MCAsmInfo *MAI) const override ;
188-
189- void visitUsedExpr (MCStreamer &Streamer) const override ;
190-
191- MCFragment *findAssociatedFragment () const override ;
192-
193170 bool evaluateAsRelocatableImpl (MCValue &Res,
194171 const MCAssembler *Asm) const override ;
195- static bool classof (const MCExpr *E) {
196- return E->getKind () == MCExpr::Target;
197- }
198172};
199173
200174class AArch64AuthMCExpr final : public AArch64MCExpr {
@@ -217,10 +191,6 @@ class AArch64AuthMCExpr final : public AArch64MCExpr {
217191
218192 void printImpl (raw_ostream &OS, const MCAsmInfo *MAI) const override ;
219193
220- void visitUsedExpr (MCStreamer &Streamer) const override ;
221-
222- MCFragment *findAssociatedFragment () const override ;
223-
224194 static bool classof (const MCExpr *E) {
225195 return isa<AArch64MCExpr>(E) && classof (cast<AArch64MCExpr>(E));
226196 }
0 commit comments