llvm.org GIT mirror llvm / 766278e
Replace dyn_cast with isa in places that weren't using the returned value for more than a boolean check. NFC. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@253441 91177308-0d34-0410-b5e6-96231b3b80d8 Craig Topper 4 years ago
5 changed file(s) with 9 addition(s) and 9 deletion(s). Raw diff Collapse all Expand all
703703 // relocation point already factors in the section address
704704 // (actually applying the relocations will produce wrong results
705705 // as the section address will be added twice).
706 if (!L && dyn_cast(&Obj))
706 if (!L && isa(&Obj))
707707 continue;
708708
709709 RelSecName = RelSecName.substr(
663663 // global variables with external linkage are transformed to
664664 // available_externally definitions, which are ultimately turned into
665665 // declarations after the EliminateAvailableExternally pass).
666 if (dyn_cast(SGV) && !SGV->isDeclaration() &&
666 if (isa(SGV) && !SGV->isDeclaration() &&
667667 !SGV->hasWeakAnyLinkage())
668668 return true;
669669 // Only import the function requested for importing.
24292429 // ***************************************************************************
24302430
24312431 // If this is a tail call via a function pointer, then don't do it!
2432 if (!(dyn_cast(Callee))
2433 && !(dyn_cast(Callee))) {
2432 if (!(isa(Callee)) &&
2433 !(isa(Callee))) {
24342434 return false;
24352435 }
24362436
984984 bool isRegIdx() const { return Kind == k_RegisterIndex; }
985985 bool isImm() const override { return Kind == k_Immediate; }
986986 bool isConstantImm() const {
987 return isImm() && dyn_cast(getImm());
987 return isImm() && isa(getImm());
988988 }
989989 bool isConstantImmz() const {
990990 return isConstantImm() && getConstantImm() == 0;
10021002 }
10031003 bool isMem() const override { return Kind == k_Memory; }
10041004 bool isConstantMemOff() const {
1005 return isMem() && dyn_cast(getMemOff());
1005 return isMem() && isa(getMemOff());
10061006 }
10071007 template bool isMemWithSimmOffset() const {
10081008 return isMem() && isConstantMemOff() && isInt(getConstantMemOff())
12131213
12141214 // Skip constant shift instruction which may be generated by Splitting GEPs.
12151215 if (FirstOffsetDef && FirstOffsetDef->isShift() &&
1216 dyn_cast(FirstOffsetDef->getOperand(1)))
1216 isa(FirstOffsetDef->getOperand(1)))
12171217 FirstOffsetDef = dyn_cast(FirstOffsetDef->getOperand(0));
12181218
12191219 // Give up if FirstOffsetDef is an Add or Sub with constant.
12221222 if (BinaryOperator *BO = dyn_cast(FirstOffsetDef)) {
12231223 unsigned opc = BO->getOpcode();
12241224 if ((opc == Instruction::Add || opc == Instruction::Sub) &&
1225 (dyn_cast(BO->getOperand(0)) ||
1226 dyn_cast(BO->getOperand(1))))
1225 (isa(BO->getOperand(0)) ||
1226 isa(BO->getOperand(1))))
12271227 return false;
12281228 }
12291229 return true;