diff options
| author | Craig Topper <craig.topper@gmail.com> | 2015-11-18 07:07:59 +0000 |
|---|---|---|
| committer | Craig Topper <craig.topper@gmail.com> | 2015-11-18 07:07:59 +0000 |
| commit | 66059c9f4d40893b24195663c711c4fa7a35cf6a (patch) | |
| tree | cc4d2a2ee394200dc06fab658a333aabfda0ab36 /llvm/lib | |
| parent | cd67662ad950f12c8c383e23b6b9b5bcfcc7b232 (diff) | |
| download | bcm5719-llvm-66059c9f4d40893b24195663c711c4fa7a35cf6a.tar.gz bcm5719-llvm-66059c9f4d40893b24195663c711c4fa7a35cf6a.zip | |
Replace dyn_cast with isa in places that weren't using the returned value for more than a boolean check. NFC.
llvm-svn: 253441
Diffstat (limited to 'llvm/lib')
| -rw-r--r-- | llvm/lib/DebugInfo/DWARF/DWARFContext.cpp | 2 | ||||
| -rw-r--r-- | llvm/lib/Linker/LinkModules.cpp | 2 | ||||
| -rw-r--r-- | llvm/lib/Target/Hexagon/HexagonISelLowering.cpp | 4 | ||||
| -rw-r--r-- | llvm/lib/Target/Mips/AsmParser/MipsAsmParser.cpp | 4 | ||||
| -rw-r--r-- | llvm/lib/Transforms/Scalar/SeparateConstOffsetFromGEP.cpp | 6 |
5 files changed, 9 insertions, 9 deletions
diff --git a/llvm/lib/DebugInfo/DWARF/DWARFContext.cpp b/llvm/lib/DebugInfo/DWARF/DWARFContext.cpp index 18c4e8e4caf..2165d353ba0 100644 --- a/llvm/lib/DebugInfo/DWARF/DWARFContext.cpp +++ b/llvm/lib/DebugInfo/DWARF/DWARFContext.cpp @@ -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( diff --git a/llvm/lib/Linker/LinkModules.cpp b/llvm/lib/Linker/LinkModules.cpp index 5419c22fbf7..7649d13929f 100644 --- a/llvm/lib/Linker/LinkModules.cpp +++ b/llvm/lib/Linker/LinkModules.cpp @@ -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. diff --git a/llvm/lib/Target/Hexagon/HexagonISelLowering.cpp b/llvm/lib/Target/Hexagon/HexagonISelLowering.cpp index 564eb1fa6fa..26807e25008 100644 --- a/llvm/lib/Target/Hexagon/HexagonISelLowering.cpp +++ b/llvm/lib/Target/Hexagon/HexagonISelLowering.cpp @@ -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; } diff --git a/llvm/lib/Target/Mips/AsmParser/MipsAsmParser.cpp b/llvm/lib/Target/Mips/AsmParser/MipsAsmParser.cpp index 0512ebc4d41..132b5f354e3 100644 --- a/llvm/lib/Target/Mips/AsmParser/MipsAsmParser.cpp +++ b/llvm/lib/Target/Mips/AsmParser/MipsAsmParser.cpp @@ -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()) diff --git a/llvm/lib/Transforms/Scalar/SeparateConstOffsetFromGEP.cpp b/llvm/lib/Transforms/Scalar/SeparateConstOffsetFromGEP.cpp index d024bc05f38..86a10d2a161 100644 --- a/llvm/lib/Transforms/Scalar/SeparateConstOffsetFromGEP.cpp +++ b/llvm/lib/Transforms/Scalar/SeparateConstOffsetFromGEP.cpp @@ -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; |

