Skip to content

Commit 764cd74

Browse files
MaskRaymahesh-attarde
authored andcommitted
MCSectionGOFF: 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.
1 parent b7ce558 commit 764cd74

File tree

2 files changed

+1
-3
lines changed

2 files changed

+1
-3
lines changed

llvm/include/llvm/MC/MCSectionGOFF.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -123,8 +123,6 @@ class LLVM_ABI MCSectionGOFF final : public MCSection {
123123
bool requiresNonZeroLength() const { return RequiresNonZeroLength; }
124124

125125
void setName(StringRef SectionName) { Name = SectionName; }
126-
127-
static bool classof(const MCSection *S) { return S->getVariant() == SV_GOFF; }
128126
};
129127
} // end namespace llvm
130128

llvm/lib/MC/GOFFObjectWriter.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -336,7 +336,7 @@ void GOFFWriter::defineSymbols() {
336336
unsigned Ordinal = 0;
337337
// Process all sections.
338338
for (MCSection &S : Asm) {
339-
auto &Section = cast<MCSectionGOFF>(S);
339+
auto &Section = static_cast<MCSectionGOFF &>(S);
340340
Section.setOrdinal(++Ordinal);
341341
defineSectionSymbols(Section);
342342
}

0 commit comments

Comments
 (0)