1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-11-23 03:02:36 +01:00

[DWARF] - Simplify (use dyn_cast instead of isa + cast).

This addresses post commit review comments for r300039.

llvm-svn: 300188
This commit is contained in:
George Rimar 2017-04-13 09:52:50 +00:00
parent c9386fd824
commit a5494eb7c7

View File

@ -667,11 +667,11 @@ static Expected<uint64_t> getSymbolAddress(const object::ObjectFile &Obj,
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);
}