2020namespace llvm {
2121
2222class StringRef ;
23- class VEMCExpr : public MCTargetExpr {
23+ class VEMCExpr : public MCSpecifierExpr {
2424public:
2525 enum Specifier {
2626 VK_None,
@@ -43,51 +43,20 @@ class VEMCExpr : public MCTargetExpr {
4343 };
4444
4545private:
46- const Specifier specifier;
47- const MCExpr *Expr;
48-
49- explicit VEMCExpr (Specifier S, const MCExpr *Expr)
50- : specifier(S), Expr(Expr) {}
46+ explicit VEMCExpr (const MCExpr *Expr, Specifier S)
47+ : MCSpecifierExpr(Expr, S) {}
5148
5249public:
53- // / @name Construction
54- // / @{
55-
5650 static const VEMCExpr *create (Specifier Kind, const MCExpr *Expr,
5751 MCContext &Ctx);
58- // / @}
59- // / @name Accessors
60- // / @{
61-
62- // / getOpcode - Get the kind of this expression.
63- Specifier getSpecifier () const { return specifier; }
64-
65- // / getSubExpr - Get the child of this expression.
66- const MCExpr *getSubExpr () const { return Expr; }
6752
68- // / getFixupKind - Get the fixup kind of this expression.
69- VE::Fixups getFixupKind () const { return getFixupKind (specifier); }
70-
71- // / @}
7253 void printImpl (raw_ostream &OS, const MCAsmInfo *MAI) const override ;
7354 bool evaluateAsRelocatableImpl (MCValue &Res,
7455 const MCAssembler *Asm) const override ;
75- void visitUsedExpr (MCStreamer &Streamer) const override ;
76- MCFragment *findAssociatedFragment () const override {
77- return getSubExpr ()->findAssociatedFragment ();
78- }
79-
80- static bool classof (const MCExpr *E) {
81- return E->getKind () == MCExpr::Target;
82- }
8356
84- static VE::Fixups getFixupKind (Specifier S);
57+ static VE::Fixups getFixupKind (Spec S);
8558};
8659
87- static inline VEMCExpr::Specifier getSpecifier (const MCSymbolRefExpr *SRE) {
88- return VEMCExpr::Specifier (SRE->getKind ());
89- }
90-
9160} // namespace llvm
9261
9362#endif
0 commit comments