diff --git a/lldb/source/Plugins/ObjectFile/ELF/ObjectFileELF.cpp b/lldb/source/Plugins/ObjectFile/ELF/ObjectFileELF.cpp index b16cb114bec88..6452baa4f84af 100644 --- a/lldb/source/Plugins/ObjectFile/ELF/ObjectFileELF.cpp +++ b/lldb/source/Plugins/ObjectFile/ELF/ObjectFileELF.cpp @@ -123,7 +123,7 @@ class ELFRelocation { static elf_sxword RelocAddend64(const ELFRelocation &rel); - bool IsRela() { return (reloc.is()); } + bool IsRela() { return (llvm::isa(reloc)); } private: typedef llvm::PointerUnion RelocUnion; @@ -144,74 +144,74 @@ ELFRelocation::ELFRelocation(unsigned type) { } ELFRelocation::~ELFRelocation() { - if (reloc.is()) - delete reloc.get(); + if (auto *elfrel = llvm::dyn_cast(reloc)) + delete elfrel; else - delete reloc.get(); + delete llvm::cast(reloc); } bool ELFRelocation::Parse(const lldb_private::DataExtractor &data, lldb::offset_t *offset) { - if (reloc.is()) - return reloc.get()->Parse(data, offset); + if (auto *elfrel = llvm::dyn_cast(reloc)) + return elfrel->Parse(data, offset); else - return reloc.get()->Parse(data, offset); + return llvm::cast(reloc)->Parse(data, offset); } unsigned ELFRelocation::RelocType32(const ELFRelocation &rel) { - if (rel.reloc.is()) - return ELFRel::RelocType32(*rel.reloc.get()); + if (auto *elfrel = llvm::dyn_cast(rel.reloc)) + return ELFRel::RelocType32(*elfrel); else - return ELFRela::RelocType32(*rel.reloc.get()); + return ELFRela::RelocType32(*llvm::cast(rel.reloc)); } unsigned ELFRelocation::RelocType64(const ELFRelocation &rel) { - if (rel.reloc.is()) - return ELFRel::RelocType64(*rel.reloc.get()); + if (auto *elfrel = llvm::dyn_cast(rel.reloc)) + return ELFRel::RelocType64(*elfrel); else - return ELFRela::RelocType64(*rel.reloc.get()); + return ELFRela::RelocType64(*llvm::cast(rel.reloc)); } unsigned ELFRelocation::RelocSymbol32(const ELFRelocation &rel) { - if (rel.reloc.is()) - return ELFRel::RelocSymbol32(*rel.reloc.get()); + if (auto *elfrel = llvm::dyn_cast(rel.reloc)) + return ELFRel::RelocSymbol32(*elfrel); else - return ELFRela::RelocSymbol32(*rel.reloc.get()); + return ELFRela::RelocSymbol32(*llvm::cast(rel.reloc)); } unsigned ELFRelocation::RelocSymbol64(const ELFRelocation &rel) { - if (rel.reloc.is()) - return ELFRel::RelocSymbol64(*rel.reloc.get()); + if (auto *elfrel = llvm::dyn_cast(rel.reloc)) + return ELFRel::RelocSymbol64(*elfrel); else - return ELFRela::RelocSymbol64(*rel.reloc.get()); + return ELFRela::RelocSymbol64(*llvm::cast(rel.reloc)); } elf_addr ELFRelocation::RelocOffset32(const ELFRelocation &rel) { - if (rel.reloc.is()) - return rel.reloc.get()->r_offset; + if (auto *elfrel = llvm::dyn_cast(rel.reloc)) + return elfrel->r_offset; else - return rel.reloc.get()->r_offset; + return llvm::cast(rel.reloc)->r_offset; } elf_addr ELFRelocation::RelocOffset64(const ELFRelocation &rel) { - if (rel.reloc.is()) - return rel.reloc.get()->r_offset; + if (auto *elfrel = llvm::dyn_cast(rel.reloc)) + return elfrel->r_offset; else - return rel.reloc.get()->r_offset; + return llvm::cast(rel.reloc)->r_offset; } elf_sxword ELFRelocation::RelocAddend32(const ELFRelocation &rel) { - if (rel.reloc.is()) + if (llvm::isa(rel.reloc)) return 0; else - return rel.reloc.get()->r_addend; + return llvm::cast(rel.reloc)->r_addend; } elf_sxword ELFRelocation::RelocAddend64(const ELFRelocation &rel) { - if (rel.reloc.is()) + if (llvm::isa(rel.reloc)) return 0; else - return rel.reloc.get()->r_addend; + return llvm::cast(rel.reloc)->r_addend; } static user_id_t SegmentID(size_t PHdrIndex) {