diff options
-rw-r--r-- | bolt/lib/Rewrite/RewriteInstance.cpp | 18 |
1 files changed, 2 insertions, 16 deletions
diff --git a/bolt/lib/Rewrite/RewriteInstance.cpp b/bolt/lib/Rewrite/RewriteInstance.cpp index 9a58968e5d20..b06c4a64ba52 100644 --- a/bolt/lib/Rewrite/RewriteInstance.cpp +++ b/bolt/lib/Rewrite/RewriteInstance.cpp @@ -1919,14 +1919,7 @@ int64_t getRelocationAddend(const ELFObjectFile<ELFT> *Obj, int64_t getRelocationAddend(const ELFObjectFileBase *Obj, const RelocationRef &Rel) { - if (auto *ELF32LE = dyn_cast<ELF32LEObjectFile>(Obj)) - return getRelocationAddend(ELF32LE, Rel); - if (auto *ELF64LE = dyn_cast<ELF64LEObjectFile>(Obj)) - return getRelocationAddend(ELF64LE, Rel); - if (auto *ELF32BE = dyn_cast<ELF32BEObjectFile>(Obj)) - return getRelocationAddend(ELF32BE, Rel); - auto *ELF64BE = cast<ELF64BEObjectFile>(Obj); - return getRelocationAddend(ELF64BE, Rel); + return getRelocationAddend(cast<ELF64LEObjectFile>(Obj), Rel); } template <typename ELFT> @@ -1953,14 +1946,7 @@ uint32_t getRelocationSymbol(const ELFObjectFile<ELFT> *Obj, uint32_t getRelocationSymbol(const ELFObjectFileBase *Obj, const RelocationRef &Rel) { - if (auto *ELF32LE = dyn_cast<ELF32LEObjectFile>(Obj)) - return getRelocationSymbol(ELF32LE, Rel); - if (auto *ELF64LE = dyn_cast<ELF64LEObjectFile>(Obj)) - return getRelocationSymbol(ELF64LE, Rel); - if (auto *ELF32BE = dyn_cast<ELF32BEObjectFile>(Obj)) - return getRelocationSymbol(ELF32BE, Rel); - auto *ELF64BE = cast<ELF64BEObjectFile>(Obj); - return getRelocationSymbol(ELF64BE, Rel); + return getRelocationSymbol(cast<ELF64LEObjectFile>(Obj), Rel); } } // anonymous namespace |