[llvm] r253441 - Replace dyn_cast with isa in places that weren't using the returned value for more than a boolean check. NFC.
Craig Topper via llvm-commits
llvm-commits at lists.llvm.org
Tue Nov 17 23:07:59 PST 2015
Author: ctopper
Date: Wed Nov 18 01:07:59 2015
New Revision: 253441
URL: http://llvm.org/viewvc/llvm-project?rev=253441&view=rev
Log:
Replace dyn_cast with isa in places that weren't using the returned value for more than a boolean check. NFC.
Modified:
llvm/trunk/lib/DebugInfo/DWARF/DWARFContext.cpp
llvm/trunk/lib/Linker/LinkModules.cpp
llvm/trunk/lib/Target/Hexagon/HexagonISelLowering.cpp
llvm/trunk/lib/Target/Mips/AsmParser/MipsAsmParser.cpp
llvm/trunk/lib/Transforms/Scalar/SeparateConstOffsetFromGEP.cpp
Modified: llvm/trunk/lib/DebugInfo/DWARF/DWARFContext.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/DebugInfo/DWARF/DWARFContext.cpp?rev=253441&r1=253440&r2=253441&view=diff
==============================================================================
--- llvm/trunk/lib/DebugInfo/DWARF/DWARFContext.cpp (original)
+++ llvm/trunk/lib/DebugInfo/DWARF/DWARFContext.cpp Wed Nov 18 01:07:59 2015
@@ -704,7 +704,7 @@ DWARFContextInMemory::DWARFContextInMemo
// 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(
Modified: llvm/trunk/lib/Linker/LinkModules.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Linker/LinkModules.cpp?rev=253441&r1=253440&r2=253441&view=diff
==============================================================================
--- llvm/trunk/lib/Linker/LinkModules.cpp (original)
+++ llvm/trunk/lib/Linker/LinkModules.cpp Wed Nov 18 01:07:59 2015
@@ -664,7 +664,7 @@ bool ModuleLinker::doImportAsDefinition(
// 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.
Modified: llvm/trunk/lib/Target/Hexagon/HexagonISelLowering.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/Hexagon/HexagonISelLowering.cpp?rev=253441&r1=253440&r2=253441&view=diff
==============================================================================
--- llvm/trunk/lib/Target/Hexagon/HexagonISelLowering.cpp (original)
+++ llvm/trunk/lib/Target/Hexagon/HexagonISelLowering.cpp Wed Nov 18 01:07:59 2015
@@ -2430,8 +2430,8 @@ bool HexagonTargetLowering::IsEligibleFo
// ***************************************************************************
// 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;
}
Modified: llvm/trunk/lib/Target/Mips/AsmParser/MipsAsmParser.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/Mips/AsmParser/MipsAsmParser.cpp?rev=253441&r1=253440&r2=253441&view=diff
==============================================================================
--- llvm/trunk/lib/Target/Mips/AsmParser/MipsAsmParser.cpp (original)
+++ llvm/trunk/lib/Target/Mips/AsmParser/MipsAsmParser.cpp Wed Nov 18 01:07:59 2015
@@ -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())
Modified: llvm/trunk/lib/Transforms/Scalar/SeparateConstOffsetFromGEP.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Scalar/SeparateConstOffsetFromGEP.cpp?rev=253441&r1=253440&r2=253441&view=diff
==============================================================================
--- llvm/trunk/lib/Transforms/Scalar/SeparateConstOffsetFromGEP.cpp (original)
+++ llvm/trunk/lib/Transforms/Scalar/SeparateConstOffsetFromGEP.cpp Wed Nov 18 01:07:59 2015
@@ -1214,7 +1214,7 @@ bool SeparateConstOffsetFromGEP::isLegal
// 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::isLegal
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;
More information about the llvm-commits
mailing list