Skip to content

Commit c04e57d

Browse files
[llvm] Use StringRef::contains (NFC) (#165397)
Identified with readability-container-contains
1 parent 817aff6 commit c04e57d

File tree

3 files changed

+3
-5
lines changed

3 files changed

+3
-5
lines changed

llvm/include/llvm/IR/Mangler.h

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -80,8 +80,7 @@ getArm64ECDemangledFunctionName(StringRef Name);
8080

8181
/// Check if an ARM64EC function name is mangled.
8282
bool inline isArm64ECMangledFunctionName(StringRef Name) {
83-
return Name[0] == '#' ||
84-
(Name[0] == '?' && Name.find("@$$h") != StringRef::npos);
83+
return Name[0] == '#' || (Name[0] == '?' && Name.contains("@$$h"));
8584
}
8685

8786
} // End llvm namespace

llvm/lib/Target/NVPTX/NVPTXTargetTransformInfo.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -493,7 +493,7 @@ NVPTXTTIImpl::getInstructionCost(const User *U,
493493
// predicate ("@").
494494
return !AsmInst.empty() &&
495495
(AsmInst[0] == '@' || isAlpha(AsmInst[0]) ||
496-
AsmInst.find(".pragma") != StringRef::npos);
496+
AsmInst.contains(".pragma"));
497497
});
498498
return InstCount * TargetTransformInfo::TCC_Basic;
499499
}

llvm/lib/Target/SystemZ/SystemZISelLowering.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8973,8 +8973,7 @@ SystemZTargetLowering::getJumpConditionMergingParams(Instruction::BinaryOps Opc,
89738973
if (const auto *CB = dyn_cast<CallBase>(RHSVal)) {
89748974
if (CB->isInlineAsm()) {
89758975
const InlineAsm *IA = cast<InlineAsm>(CB->getCalledOperand());
8976-
return IA &&
8977-
IA->getConstraintString().find("{@cc}") != std::string::npos;
8976+
return IA && IA->getConstraintString().contains("{@cc}");
89788977
}
89798978
}
89808979
}

0 commit comments

Comments
 (0)