Skip to content

Commit 6f14f1c

Browse files
MaskRaySchrodingerZhu
authored andcommitted
[RISCV] Remove unused declarations and getSpecifier. NFC
Remove unused declarations after llvm#132569. Simplify some code as we no longer use MCSymbolRefExpr::VariantKind.
1 parent a0930ac commit 6f14f1c

File tree

3 files changed

+2
-14
lines changed

3 files changed

+2
-14
lines changed

llvm/lib/Target/RISCV/AsmParser/RISCVAsmParser.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2104,8 +2104,7 @@ ParseStatus RISCVAsmParser::parsePseudoJumpSymbol(OperandVector &Operands) {
21042104
if (getParser().parseExpression(Res, E))
21052105
return ParseStatus::Failure;
21062106

2107-
if (Res->getKind() != MCExpr::ExprKind::SymbolRef ||
2108-
getSpecifier(cast<MCSymbolRefExpr>(Res)) == RISCVMCExpr::VK_PLTPCREL)
2107+
if (Res->getKind() != MCExpr::ExprKind::SymbolRef)
21092108
return Error(S, "operand must be a valid jump target");
21102109

21112110
Res = RISCVMCExpr::create(Res, RISCVMCExpr::VK_CALL, getContext());

llvm/lib/Target/RISCV/MCTargetDesc/RISCVMCCodeEmitter.cpp

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -557,10 +557,7 @@ uint64_t RISCVMCCodeEmitter::getImmOpValue(const MCInst &MI, unsigned OpNo,
557557
FixupKind = RISCV::fixup_riscv_tlsdesc_call;
558558
break;
559559
}
560-
} else if ((Kind == MCExpr::SymbolRef &&
561-
getSpecifier(cast<MCSymbolRefExpr>(Expr)) ==
562-
RISCVMCExpr::VK_None) ||
563-
Kind == MCExpr::Binary) {
560+
} else if (Kind == MCExpr::SymbolRef || Kind == MCExpr::Binary) {
564561
// FIXME: Sub kind binary exprs have chance of underflow.
565562
if (MIFrm == RISCVII::InstFormatJ) {
566563
FixupKind = RISCV::fixup_riscv_jal;

llvm/lib/Target/RISCV/MCTargetDesc/RISCVMCExpr.h

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -49,8 +49,6 @@ class RISCVMCExpr : public MCTargetExpr {
4949
const MCExpr *Expr;
5050
const Specifier specifier;
5151

52-
int64_t evaluateAsInt64(int64_t Value) const;
53-
5452
explicit RISCVMCExpr(const MCExpr *Expr, Specifier S)
5553
: Expr(Expr), specifier(S) {}
5654

@@ -77,19 +75,13 @@ class RISCVMCExpr : public MCTargetExpr {
7775
return getSubExpr()->findAssociatedFragment();
7876
}
7977

80-
bool evaluateAsConstant(int64_t &Res) const;
81-
8278
static bool classof(const MCExpr *E) {
8379
return E->getKind() == MCExpr::Target;
8480
}
8581

8682
static std::optional<Specifier> getSpecifierForName(StringRef name);
8783
static StringRef getSpecifierName(Specifier Kind);
8884
};
89-
90-
static inline RISCVMCExpr::Specifier getSpecifier(const MCSymbolRefExpr *SRE) {
91-
return RISCVMCExpr::Specifier(SRE->getKind());
92-
}
9385
} // end namespace llvm.
9486

9587
#endif

0 commit comments

Comments
 (0)