[ELF] Simplify with dyn_cast_or_null. NFC
authorFangrui Song <maskray@google.com>
Fri, 26 Jul 2019 16:29:15 +0000 (16:29 +0000)
committerFangrui Song <maskray@google.com>
Fri, 26 Jul 2019 16:29:15 +0000 (16:29 +0000)
llvm-svn: 367126

lld/ELF/Symbols.cpp

index 2267730..a9bc613 100644 (file)
@@ -560,7 +560,7 @@ int Symbol::compare(const Symbol *other) const {
   auto *oldSym = cast<Defined>(this);
   auto *newSym = cast<Defined>(other);
 
-  if (other->file && isa<BitcodeFile>(other->file))
+  if (dyn_cast_or_null<BitcodeFile>(other->file))
     return 0;
 
   if (!oldSym->section && !newSym->section && oldSym->value == newSym->value &&