mirror of
https://github.com/intel/llvm.git
synced 2026-01-25 19:44:38 +08:00
[llvm] Use StringRef::contains (NFC) (#165397)
Identified with readability-container-contains
This commit is contained in:
@@ -80,8 +80,7 @@ getArm64ECDemangledFunctionName(StringRef Name);
|
||||
|
||||
/// Check if an ARM64EC function name is mangled.
|
||||
bool inline isArm64ECMangledFunctionName(StringRef Name) {
|
||||
return Name[0] == '#' ||
|
||||
(Name[0] == '?' && Name.find("@$$h") != StringRef::npos);
|
||||
return Name[0] == '#' || (Name[0] == '?' && Name.contains("@$$h"));
|
||||
}
|
||||
|
||||
} // End llvm namespace
|
||||
|
||||
@@ -493,7 +493,7 @@ NVPTXTTIImpl::getInstructionCost(const User *U,
|
||||
// predicate ("@").
|
||||
return !AsmInst.empty() &&
|
||||
(AsmInst[0] == '@' || isAlpha(AsmInst[0]) ||
|
||||
AsmInst.find(".pragma") != StringRef::npos);
|
||||
AsmInst.contains(".pragma"));
|
||||
});
|
||||
return InstCount * TargetTransformInfo::TCC_Basic;
|
||||
}
|
||||
|
||||
@@ -8973,8 +8973,7 @@ SystemZTargetLowering::getJumpConditionMergingParams(Instruction::BinaryOps Opc,
|
||||
if (const auto *CB = dyn_cast<CallBase>(RHSVal)) {
|
||||
if (CB->isInlineAsm()) {
|
||||
const InlineAsm *IA = cast<InlineAsm>(CB->getCalledOperand());
|
||||
return IA &&
|
||||
IA->getConstraintString().find("{@cc}") != std::string::npos;
|
||||
return IA && IA->getConstraintString().contains("{@cc}");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user