Index: bolt/lib/Rewrite/RewriteInstance.cpp =================================================================== --- bolt/lib/Rewrite/RewriteInstance.cpp +++ bolt/lib/Rewrite/RewriteInstance.cpp @@ -1919,14 +1919,7 @@ int64_t getRelocationAddend(const ELFObjectFileBase *Obj, const RelocationRef &Rel) { - if (auto *ELF32LE = dyn_cast(Obj)) - return getRelocationAddend(ELF32LE, Rel); - if (auto *ELF64LE = dyn_cast(Obj)) - return getRelocationAddend(ELF64LE, Rel); - if (auto *ELF32BE = dyn_cast(Obj)) - return getRelocationAddend(ELF32BE, Rel); - auto *ELF64BE = cast(Obj); - return getRelocationAddend(ELF64BE, Rel); + return getRelocationAddend(cast(Obj), Rel); } template @@ -1953,14 +1946,7 @@ uint32_t getRelocationSymbol(const ELFObjectFileBase *Obj, const RelocationRef &Rel) { - if (auto *ELF32LE = dyn_cast(Obj)) - return getRelocationSymbol(ELF32LE, Rel); - if (auto *ELF64LE = dyn_cast(Obj)) - return getRelocationSymbol(ELF64LE, Rel); - if (auto *ELF32BE = dyn_cast(Obj)) - return getRelocationSymbol(ELF32BE, Rel); - auto *ELF64BE = cast(Obj); - return getRelocationSymbol(ELF64BE, Rel); + return getRelocationSymbol(cast(Obj), Rel); } } // anonymous namespace