diff options
author | Fangrui Song <i@maskray.me> | 2025-07-26 09:30:01 -0700 |
---|---|---|
committer | Fangrui Song <i@maskray.me> | 2025-07-26 09:30:02 -0700 |
commit | c2faf6a57fe7abb27a27e3b22c4e827a1a0c26ef (patch) | |
tree | 94dc90c0d187a0e3db779e13926e28844979d9a3 /llvm/lib/Target | |
parent | fa3ec0c17c48349e6027710d234c83e7bfeaf854 (diff) | |
download | llvm-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.cpp | 6 |
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; |