Skip to content

Commit aa8afad

Browse files
committed
MCSymbolRefExpr: Migrate away from deprecated VariantKind
1 parent 2ed0401 commit aa8afad

File tree

2 files changed

+7
-12
lines changed

2 files changed

+7
-12
lines changed

llvm/include/llvm/MC/MCExpr.h

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,7 @@ class MCExpr {
5757
bool InSet) const;
5858

5959
protected:
60+
using Spec = uint16_t;
6061
explicit MCExpr(ExprKind Kind, SMLoc Loc, unsigned SubclassData = 0)
6162
: Kind(Kind), SubclassData(SubclassData), Loc(Loc) {
6263
assert(SubclassData < (1 << NumSubclassDataBits) &&
@@ -200,7 +201,7 @@ class MCSymbolRefExpr : public MCExpr {
200201
/// The symbol being referenced.
201202
const MCSymbol *Symbol;
202203

203-
explicit MCSymbolRefExpr(const MCSymbol *Symbol, VariantKind Kind,
204+
explicit MCSymbolRefExpr(const MCSymbol *Symbol, Spec specifier,
204205
const MCAsmInfo *MAI, SMLoc Loc = SMLoc());
205206

206207
public:
@@ -213,13 +214,8 @@ class MCSymbolRefExpr : public MCExpr {
213214
}
214215

215216
LLVM_ABI static const MCSymbolRefExpr *create(const MCSymbol *Symbol,
216-
VariantKind Kind,
217-
MCContext &Ctx,
217+
Spec specifier, MCContext &Ctx,
218218
SMLoc Loc = SMLoc());
219-
static const MCSymbolRefExpr *create(const MCSymbol *Symbol, uint16_t Kind,
220-
MCContext &Ctx, SMLoc Loc = SMLoc()) {
221-
return MCSymbolRefExpr::create(Symbol, VariantKind(Kind), Ctx, Loc);
222-
}
223219

224220
/// @}
225221
/// \name Accessors
@@ -495,7 +491,6 @@ class LLVM_ABI MCTargetExpr : public MCExpr {
495491
/// MCExprs are bump pointer allocated and not destructed.
496492
class LLVM_ABI MCSpecifierExpr : public MCExpr {
497493
protected:
498-
using Spec = uint16_t;
499494
const MCExpr *Expr;
500495
// Target-specific relocation specifier code
501496
const Spec specifier;

llvm/lib/MC/MCExpr.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -217,16 +217,16 @@ const MCConstantExpr *MCConstantExpr::create(int64_t Value, MCContext &Ctx,
217217

218218
/* *** */
219219

220-
MCSymbolRefExpr::MCSymbolRefExpr(const MCSymbol *Symbol, VariantKind Kind,
220+
MCSymbolRefExpr::MCSymbolRefExpr(const MCSymbol *Symbol, Spec specifier,
221221
const MCAsmInfo *MAI, SMLoc Loc)
222-
: MCExpr(MCExpr::SymbolRef, Loc, Kind), Symbol(Symbol) {
222+
: MCExpr(MCExpr::SymbolRef, Loc, specifier), Symbol(Symbol) {
223223
assert(Symbol);
224224
}
225225

226226
const MCSymbolRefExpr *MCSymbolRefExpr::create(const MCSymbol *Sym,
227-
VariantKind Kind,
227+
uint16_t specifier,
228228
MCContext &Ctx, SMLoc Loc) {
229-
return new (Ctx) MCSymbolRefExpr(Sym, Kind, Ctx.getAsmInfo(), Loc);
229+
return new (Ctx) MCSymbolRefExpr(Sym, specifier, Ctx.getAsmInfo(), Loc);
230230
}
231231

232232
/* *** */

0 commit comments

Comments
 (0)