From b51ff2705fe15a214ba234dae221c39b105fa57c Mon Sep 17 00:00:00 2001 From: Fangrui Song Date: Sun, 3 Aug 2025 16:05:34 -0700 Subject: 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. --- llvm/lib/CodeGen/TargetLoweringObjectFileImpl.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'llvm/lib/CodeGen/TargetLoweringObjectFileImpl.cpp') diff --git a/llvm/lib/CodeGen/TargetLoweringObjectFileImpl.cpp b/llvm/lib/CodeGen/TargetLoweringObjectFileImpl.cpp index 37c6dc9..8ca1bb1 100644 --- a/llvm/lib/CodeGen/TargetLoweringObjectFileImpl.cpp +++ b/llvm/lib/CodeGen/TargetLoweringObjectFileImpl.cpp @@ -581,7 +581,8 @@ static const MCSymbolELF *getLinkedToSymbol(const GlobalObject *GO, auto *VM = cast(MD->getOperand(0).get()); auto *OtherGV = dyn_cast(VM->getValue()); - return OtherGV ? dyn_cast(TM.getSymbol(OtherGV)) : nullptr; + return OtherGV ? static_cast(TM.getSymbol(OtherGV)) + : nullptr; } static unsigned getEntrySizeForKind(SectionKind Kind) { @@ -1011,7 +1012,7 @@ MCSection *TargetLoweringObjectFileELF::getSectionForLSDA( (getContext().getAsmInfo()->useIntegratedAssembler() && getContext().getAsmInfo()->binutilsIsAtLeast(2, 36))) { Flags |= ELF::SHF_LINK_ORDER; - LinkedToSym = cast(&FnSym); + LinkedToSym = static_cast(&FnSym); } // Append the function name as the suffix like GCC, assuming -- cgit v1.1