[llvm-branch-commits] [llvm] 9a90c4e - [llvm] Use isa instead of dyn_cast (NFC)

Kazu Hirata via llvm-branch-commits llvm-branch-commits at lists.llvm.org
Fri Jan 1 12:49:57 PST 2021


Author: Kazu Hirata
Date: 2021-01-01T12:44:56-08:00
New Revision: 9a90c4ea8a05959a08109cb876397447d7cd9c2d

URL: https://github.com/llvm/llvm-project/commit/9a90c4ea8a05959a08109cb876397447d7cd9c2d
DIFF: https://github.com/llvm/llvm-project/commit/9a90c4ea8a05959a08109cb876397447d7cd9c2d.diff

LOG: [llvm] Use isa instead of dyn_cast (NFC)

Added: 
    

Modified: 
    llvm/tools/llvm-nm/llvm-nm.cpp
    llvm/utils/TableGen/FixedLenDecoderEmitter.cpp

Removed: 
    


################################################################################
diff  --git a/llvm/tools/llvm-nm/llvm-nm.cpp b/llvm/tools/llvm-nm/llvm-nm.cpp
index d9dc1f1b419c..bbbf90db26f5 100644
--- a/llvm/tools/llvm-nm/llvm-nm.cpp
+++ b/llvm/tools/llvm-nm/llvm-nm.cpp
@@ -1095,9 +1095,8 @@ static char getSymbolNMTypeChar(IRObjectFile &Obj, basic_symbol_iterator I) {
 }
 
 static bool isObject(SymbolicFile &Obj, basic_symbol_iterator I) {
-  return !dyn_cast<ELFObjectFileBase>(&Obj)
-             ? false
-             : elf_symbol_iterator(I)->getELFType() == ELF::STT_OBJECT;
+  return isa<ELFObjectFileBase>(&Obj) &&
+         elf_symbol_iterator(I)->getELFType() == ELF::STT_OBJECT;
 }
 
 // For ELF object files, Set TypeName to the symbol typename, to be printed

diff  --git a/llvm/utils/TableGen/FixedLenDecoderEmitter.cpp b/llvm/utils/TableGen/FixedLenDecoderEmitter.cpp
index ca071fb79901..6a7db45c6bde 100644
--- a/llvm/utils/TableGen/FixedLenDecoderEmitter.cpp
+++ b/llvm/utils/TableGen/FixedLenDecoderEmitter.cpp
@@ -1193,7 +1193,7 @@ bool FilterChooser::emitPredicateMatch(raw_ostream &o, unsigned &Indentation,
     if (!Pred->getValue("AssemblerMatcherPredicate"))
       continue;
 
-    if (!dyn_cast<DagInit>(Pred->getValue("AssemblerCondDag")->getValue()))
+    if (!isa<DagInit>(Pred->getValue("AssemblerCondDag")->getValue()))
       continue;
 
     const DagInit *D = Pred->getValueAsDag("AssemblerCondDag");


        


More information about the llvm-branch-commits mailing list