aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/Target
diff options
context:
space:
mode:
authorFangrui Song <i@maskray.me>2025-07-26 09:30:01 -0700
committerFangrui Song <i@maskray.me>2025-07-26 09:30:02 -0700
commitc2faf6a57fe7abb27a27e3b22c4e827a1a0c26ef (patch)
tree94dc90c0d187a0e3db779e13926e28844979d9a3 /llvm/lib/Target
parentfa3ec0c17c48349e6027710d234c83e7bfeaf854 (diff)
downloadllvm-c2faf6a57fe7abb27a27e3b22c4e827a1a0c26ef.zip
llvm-c2faf6a57fe7abb27a27e3b22c4e827a1a0c26ef.tar.gz
llvm-c2faf6a57fe7abb27a27e3b22c4e827a1a0c26ef.tar.bz2
MCSectionWasm: Remove classof
The object file format specific derived classes are used in context like MCStreamer and MCObjectTargetWriter where the type is statically known. We don't use isa/dyn_cast and we want to eliminate MCSection::SectionVariant in the base class.
Diffstat (limited to 'llvm/lib/Target')
-rw-r--r--llvm/lib/Target/WebAssembly/AsmParser/WebAssemblyAsmParser.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/llvm/lib/Target/WebAssembly/AsmParser/WebAssemblyAsmParser.cpp b/llvm/lib/Target/WebAssembly/AsmParser/WebAssemblyAsmParser.cpp
index 19c9e9c..6ae69a4 100644
--- a/llvm/lib/Target/WebAssembly/AsmParser/WebAssemblyAsmParser.cpp
+++ b/llvm/lib/Target/WebAssembly/AsmParser/WebAssemblyAsmParser.cpp
@@ -900,7 +900,8 @@ public:
bool checkDataSection() {
if (CurrentState != DataSection) {
- auto *WS = cast<MCSectionWasm>(getStreamer().getCurrentSectionOnly());
+ auto *WS = static_cast<const MCSectionWasm *>(
+ getStreamer().getCurrentSectionOnly());
if (WS && WS->isText())
return error("data directive must occur in a data segment: ",
Lexer.getTok());
@@ -1218,7 +1219,8 @@ public:
void doBeforeLabelEmit(MCSymbol *Symbol, SMLoc IDLoc) override {
// Code below only applies to labels in text sections.
- auto *CWS = cast<MCSectionWasm>(getStreamer().getCurrentSectionOnly());
+ auto *CWS = static_cast<const MCSectionWasm *>(
+ getStreamer().getCurrentSectionOnly());
if (!CWS->isText())
return;