aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/MC/MCContext.cpp
diff options
context:
space:
mode:
authorFangrui Song <i@maskray.me>2025-08-03 16:05:34 -0700
committerFangrui Song <i@maskray.me>2025-08-03 16:05:35 -0700
commitb51ff2705fe15a214ba234dae221c39b105fa57c (patch)
treee8dc459d165d7cddcd3180505af1f14933d7b7a9 /llvm/lib/MC/MCContext.cpp
parente640ca8b9adc390325e2c0406b0032dd24563c75 (diff)
downloadllvm-b51ff2705fe15a214ba234dae221c39b105fa57c.zip
llvm-b51ff2705fe15a214ba234dae221c39b105fa57c.tar.gz
llvm-b51ff2705fe15a214ba234dae221c39b105fa57c.tar.bz2
MCSymbolELF: Migrate away from classof
The object file format specific derived classes are used in context where the type is statically known. We don't use isa/dyn_cast and we want to eliminate MCSymbol::Kind in the base class.
Diffstat (limited to 'llvm/lib/MC/MCContext.cpp')
-rw-r--r--llvm/lib/MC/MCContext.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/llvm/lib/MC/MCContext.cpp b/llvm/lib/MC/MCContext.cpp
index ce5edc5..dc14736 100644
--- a/llvm/lib/MC/MCContext.cpp
+++ b/llvm/lib/MC/MCContext.cpp
@@ -446,7 +446,7 @@ Symbol *MCContext::getOrCreateSectionSymbol(StringRef Section) {
// Use the symbol's index to track if it has been used as a section symbol.
// Set to -1 to catch potential bugs if misused as a symbol index.
if (Sym && Sym->getIndex() != -1u) {
- R = cast<Symbol>(Sym);
+ R = static_cast<Symbol *>(Sym);
} else {
SymEntry.second.Used = true;
R = new (&SymEntry, *this) Symbol(&SymEntry, /*isTemporary=*/false);
@@ -586,7 +586,7 @@ MCContext::createELFRelSection(const Twine &Name, unsigned Type, unsigned Flags,
return createELFSectionImpl(
I->getKey(), Type, Flags, EntrySize, Group, true, true,
- cast<MCSymbolELF>(RelInfoSection->getBeginSymbol()));
+ static_cast<const MCSymbolELF *>(RelInfoSection->getBeginSymbol()));
}
MCSectionELF *MCContext::getELFNamedSection(const Twine &Prefix,