[llvm] 7f2db4d - [MC] Remove redundant classof definitions for MCTargetDesc's derived classes
Fangrui Song via llvm-commits
llvm-commits at lists.llvm.org
Sun May 14 11:59:08 PDT 2023
Author: Fangrui Song
Date: 2023-05-14T11:59:02-07:00
New Revision: 7f2db4dbbaeb5a3387ebc9776b5e8e3b4beff528
URL: https://github.com/llvm/llvm-project/commit/7f2db4dbbaeb5a3387ebc9776b5e8e3b4beff528
DIFF: https://github.com/llvm/llvm-project/commit/7f2db4dbbaeb5a3387ebc9776b5e8e3b4beff528.diff
LOG: [MC] Remove redundant classof definitions for MCTargetDesc's derived classes
Added:
Modified:
llvm/lib/Target/AArch64/MCTargetDesc/AArch64MCExpr.h
llvm/lib/Target/Hexagon/MCTargetDesc/HexagonMCExpr.cpp
llvm/lib/Target/Hexagon/MCTargetDesc/HexagonMCExpr.h
llvm/lib/Target/RISCV/MCTargetDesc/RISCVMCExpr.h
llvm/lib/Target/Sparc/MCTargetDesc/SparcMCExpr.h
llvm/lib/Target/VE/MCTargetDesc/VEMCExpr.h
Removed:
################################################################################
diff --git a/llvm/lib/Target/AArch64/MCTargetDesc/AArch64MCExpr.h b/llvm/lib/Target/AArch64/MCTargetDesc/AArch64MCExpr.h
index d3e834a140b21..f8938cdbbec30 100644
--- a/llvm/lib/Target/AArch64/MCTargetDesc/AArch64MCExpr.h
+++ b/llvm/lib/Target/AArch64/MCTargetDesc/AArch64MCExpr.h
@@ -170,8 +170,6 @@ class AArch64MCExpr : public MCTargetExpr {
static bool classof(const MCExpr *E) {
return E->getKind() == MCExpr::Target;
}
-
- static bool classof(const AArch64MCExpr *) { return true; }
};
} // end namespace llvm
diff --git a/llvm/lib/Target/Hexagon/MCTargetDesc/HexagonMCExpr.cpp b/llvm/lib/Target/Hexagon/MCTargetDesc/HexagonMCExpr.cpp
index ab5e9eb4eca66..0cfea7749aa8f 100644
--- a/llvm/lib/Target/Hexagon/MCTargetDesc/HexagonMCExpr.cpp
+++ b/llvm/lib/Target/Hexagon/MCTargetDesc/HexagonMCExpr.cpp
@@ -99,10 +99,6 @@ void HexagonMCExpr::setS27_2_reloc(bool Val) {
S27_2_reloc = Val;
}
-bool HexagonMCExpr::classof(MCExpr const *E) {
- return E->getKind() == MCExpr::Target;
-}
-
HexagonMCExpr::HexagonMCExpr(MCExpr const *Expr)
: Expr(Expr), MustNotExtend(false), MustExtend(false), S27_2_reloc(false),
SignMismatch(false) {}
diff --git a/llvm/lib/Target/Hexagon/MCTargetDesc/HexagonMCExpr.h b/llvm/lib/Target/Hexagon/MCTargetDesc/HexagonMCExpr.h
index e88f46a04dae4..6438ac98e38db 100644
--- a/llvm/lib/Target/Hexagon/MCTargetDesc/HexagonMCExpr.h
+++ b/llvm/lib/Target/Hexagon/MCTargetDesc/HexagonMCExpr.h
@@ -21,7 +21,6 @@ class HexagonMCExpr : public MCTargetExpr {
void visitUsedExpr(MCStreamer &Streamer) const override;
MCFragment *findAssociatedFragment() const override;
void fixELFSymbolsInTLSFixups(MCAssembler &Asm) const override;
- static bool classof(MCExpr const *E);
MCExpr const *getExpr() const;
void setMustExtend(bool Val = true);
bool mustExtend() const;
diff --git a/llvm/lib/Target/RISCV/MCTargetDesc/RISCVMCExpr.h b/llvm/lib/Target/RISCV/MCTargetDesc/RISCVMCExpr.h
index 4c0e12960e35c..ee83bf0208ef4 100644
--- a/llvm/lib/Target/RISCV/MCTargetDesc/RISCVMCExpr.h
+++ b/llvm/lib/Target/RISCV/MCTargetDesc/RISCVMCExpr.h
@@ -80,8 +80,6 @@ class RISCVMCExpr : public MCTargetExpr {
return E->getKind() == MCExpr::Target;
}
- static bool classof(const RISCVMCExpr *) { return true; }
-
static VariantKind getVariantKindForName(StringRef name);
static StringRef getVariantKindName(VariantKind Kind);
};
diff --git a/llvm/lib/Target/Sparc/MCTargetDesc/SparcMCExpr.h b/llvm/lib/Target/Sparc/MCTargetDesc/SparcMCExpr.h
index d98ad26c96a96..d26a748b6e53a 100644
--- a/llvm/lib/Target/Sparc/MCTargetDesc/SparcMCExpr.h
+++ b/llvm/lib/Target/Sparc/MCTargetDesc/SparcMCExpr.h
@@ -108,8 +108,6 @@ class SparcMCExpr : public MCTargetExpr {
return E->getKind() == MCExpr::Target;
}
- static bool classof(const SparcMCExpr *) { return true; }
-
static VariantKind parseVariantKind(StringRef name);
static bool printVariantKind(raw_ostream &OS, VariantKind Kind);
static Sparc::Fixups getFixupKind(VariantKind Kind);
diff --git a/llvm/lib/Target/VE/MCTargetDesc/VEMCExpr.h b/llvm/lib/Target/VE/MCTargetDesc/VEMCExpr.h
index 2b0c44576099d..2da956d739a67 100644
--- a/llvm/lib/Target/VE/MCTargetDesc/VEMCExpr.h
+++ b/llvm/lib/Target/VE/MCTargetDesc/VEMCExpr.h
@@ -82,8 +82,6 @@ class VEMCExpr : public MCTargetExpr {
return E->getKind() == MCExpr::Target;
}
- static bool classof(const VEMCExpr *) { return true; }
-
static VariantKind parseVariantKind(StringRef name);
static bool printVariantKind(raw_ostream &OS, VariantKind Kind);
static void printVariantKindSuffix(raw_ostream &OS, VariantKind Kind);
More information about the llvm-commits
mailing list