This addresses post commit review comments for r300039.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@300188
91177308-0d34-0410-b5e6-
96231b3b80d8
static bool isRelocScattered(const object::ObjectFile &Obj,
const RelocationRef &Reloc) {
- if (!isa<MachOObjectFile>(&Obj))
+ const MachOObjectFile *MachObj = dyn_cast<MachOObjectFile>(&Obj);
+ if (!MachObj)
return false;
// MachO also has relocations that point to sections and
// scattered relocations.
- const MachOObjectFile *MachObj = cast<MachOObjectFile>(&Obj);
auto RelocInfo = MachObj->getRelocation(Reloc.getRawDataRefImpl());
return MachObj->isRelocationScattered(RelocInfo);
}