Replace dyn_cast with isa in places that weren't using the returned value for more...
authorCraig Topper <craig.topper@gmail.com>
Wed, 18 Nov 2015 07:07:59 +0000 (07:07 +0000)
committerCraig Topper <craig.topper@gmail.com>
Wed, 18 Nov 2015 07:07:59 +0000 (07:07 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@253441 91177308-0d34-0410-b5e6-96231b3b80d8

lib/DebugInfo/DWARF/DWARFContext.cpp
lib/Linker/LinkModules.cpp
lib/Target/Hexagon/HexagonISelLowering.cpp
lib/Target/Mips/AsmParser/MipsAsmParser.cpp
lib/Transforms/Scalar/SeparateConstOffsetFromGEP.cpp

index 18c4e8e4cafdbf44635f5dae65db454251fcc436..2165d353ba0968b348b3ced9b956679a90046dcd 100644 (file)
@@ -704,7 +704,7 @@ DWARFContextInMemory::DWARFContextInMemory(const object::ObjectFile &Obj,
     // relocation point already factors in the section address
     // (actually applying the relocations will produce wrong results
     // as the section address will be added twice).
-    if (!L && dyn_cast<MachOObjectFile>(&Obj))
+    if (!L && isa<MachOObjectFile>(&Obj))
       continue;
 
     RelSecName = RelSecName.substr(
index 5419c22fbf7b69dea916910eccf7cb98eb8bc4fb..7649d13929f442fa07914a40c6738b991eca48f8 100644 (file)
@@ -664,7 +664,7 @@ bool ModuleLinker::doImportAsDefinition(const GlobalValue *SGV) {
   // global variables with external linkage are transformed to
   // available_externally definitions, which are ultimately turned into
   // declarations after the EliminateAvailableExternally pass).
-  if (dyn_cast<GlobalVariable>(SGV) && !SGV->isDeclaration() &&
+  if (isa<GlobalVariable>(SGV) && !SGV->isDeclaration() &&
       !SGV->hasWeakAnyLinkage())
     return true;
   // Only import the function requested for importing.
index 564eb1fa6fad392e71ddbe06f3a420821baf84b1..26807e25008d859e5da5fbb7b6c5f59673ad6024 100644 (file)
@@ -2430,8 +2430,8 @@ bool HexagonTargetLowering::IsEligibleForTailCallOptimization(
   // ***************************************************************************
 
   // If this is a tail call via a function pointer, then don't do it!
-  if (!(dyn_cast<GlobalAddressSDNode>(Callee))
-      && !(dyn_cast<ExternalSymbolSDNode>(Callee))) {
+  if (!(isa<GlobalAddressSDNode>(Callee)) &&
+      !(isa<ExternalSymbolSDNode>(Callee))) {
     return false;
   }
 
index 0512ebc4d41c04bba7599097054e44bdc437baab..132b5f354e3bb72c0b57353583548969483b6bce 100644 (file)
@@ -985,7 +985,7 @@ public:
   bool isRegIdx() const { return Kind == k_RegisterIndex; }
   bool isImm() const override { return Kind == k_Immediate; }
   bool isConstantImm() const {
-    return isImm() && dyn_cast<MCConstantExpr>(getImm());
+    return isImm() && isa<MCConstantExpr>(getImm());
   }
   bool isConstantImmz() const {
     return isConstantImm() && getConstantImm() == 0;
@@ -1003,7 +1003,7 @@ public:
   }
   bool isMem() const override { return Kind == k_Memory; }
   bool isConstantMemOff() const {
-    return isMem() && dyn_cast<MCConstantExpr>(getMemOff());
+    return isMem() && isa<MCConstantExpr>(getMemOff());
   }
   template <unsigned Bits> bool isMemWithSimmOffset() const {
     return isMem() && isConstantMemOff() && isInt<Bits>(getConstantMemOff())
index d024bc05f384b784af65bafd979cbb30c44f99ca..86a10d2a16122866da0ff6043c5c382cd04cad53 100644 (file)
@@ -1214,7 +1214,7 @@ bool SeparateConstOffsetFromGEP::isLegalToSwapOperand(
 
   // Skip constant shift instruction which may be generated by Splitting GEPs.
   if (FirstOffsetDef && FirstOffsetDef->isShift() &&
-      dyn_cast<ConstantInt>(FirstOffsetDef->getOperand(1)))
+      isa<ConstantInt>(FirstOffsetDef->getOperand(1)))
     FirstOffsetDef = dyn_cast<Instruction>(FirstOffsetDef->getOperand(0));
 
   // Give up if FirstOffsetDef is an Add or Sub with constant.
@@ -1223,8 +1223,8 @@ bool SeparateConstOffsetFromGEP::isLegalToSwapOperand(
     if (BinaryOperator *BO = dyn_cast<BinaryOperator>(FirstOffsetDef)) {
       unsigned opc = BO->getOpcode();
       if ((opc == Instruction::Add || opc == Instruction::Sub) &&
-          (dyn_cast<ConstantInt>(BO->getOperand(0)) ||
-           dyn_cast<ConstantInt>(BO->getOperand(1))))
+          (isa<ConstantInt>(BO->getOperand(0)) ||
+           isa<ConstantInt>(BO->getOperand(1))))
         return false;
     }
   return true;