diff --git a/llvm/tools/llvm-objdump/llvm-objdump.cpp b/llvm/tools/llvm-objdump/llvm-objdump.cpp --- a/llvm/tools/llvm-objdump/llvm-objdump.cpp +++ b/llvm/tools/llvm-objdump/llvm-objdump.cpp @@ -1051,7 +1051,7 @@ // TODO: implement for other file formats. static bool shouldAdjustVA(const SectionRef &Section) { const ObjectFile *Obj = Section.getObject(); - if (isa(Obj)) + if (Obj->isELF()) return ELFSectionRef(Section).getFlags() & ELF::SHF_ALLOC; return false; } @@ -1928,8 +1928,7 @@ } else if (Section == O->section_end()) { outs() << "*UND*"; } else { - if (const MachOObjectFile *MachO = - dyn_cast(O)) { + if (MachO) { DataRefImpl DR = Section->getRawDataRefImpl(); StringRef SegmentName = MachO->getSectionFinalSegmentName(DR); outs() << SegmentName << ","; @@ -1939,13 +1938,13 @@ outs() << SectionName; } - if (Common || isa(O)) { + if (Common || O->isELF()) { uint64_t Val = Common ? Symbol.getAlignment() : ELFSymbolRef(Symbol).getSize(); outs() << '\t' << format(Fmt, Val); } - if (isa(O)) { + if (O->isELF()) { uint8_t Other = ELFSymbolRef(Symbol).getOther(); switch (Other) { case ELF::STV_DEFAULT: @@ -2001,7 +2000,7 @@ } StringRef ClangASTSectionName("__clangast"); - if (isa(Obj)) { + if (Obj->isCOFF()) { ClangASTSectionName = "clangast"; } @@ -2029,9 +2028,9 @@ static void printFaultMaps(const ObjectFile *Obj) { StringRef FaultMapSectionName; - if (isa(Obj)) { + if (Obj->isELF()) { FaultMapSectionName = ".llvm_faultmaps"; - } else if (isa(Obj)) { + } else if (Obj->isMachO()) { FaultMapSectionName = "__llvm_faultmaps"; } else { WithColor::error(errs(), ToolName)