Skip to content

Commit

Permalink
[llvm] Use StringRef::contains (NFC) (llvm#92710)
Browse files Browse the repository at this point in the history
  • Loading branch information
kazutakahirata authored May 20, 2024
1 parent 0bced10 commit 89d0937
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion llvm/lib/IR/Mangler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -292,7 +292,7 @@ void llvm::emitLinkerFlagsForUsedCOFF(raw_ostream &OS, const GlobalValue *GV,

std::optional<std::string> llvm::getArm64ECMangledFunctionName(StringRef Name) {
bool IsCppFn = Name[0] == '?';
if (IsCppFn && Name.find("$$h") != std::string::npos)
if (IsCppFn && Name.contains("$$h"))
return std::nullopt;
if (!IsCppFn && Name[0] == '#')
return std::nullopt;
Expand Down
2 changes: 1 addition & 1 deletion llvm/lib/Target/SPIRV/SPIRVBuiltins.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1886,7 +1886,7 @@ static bool buildEnqueueKernel(const SPIRV::IncomingCall *Call,
// Local sizes arguments: Sizes of block invoke arguments. Clang generates
// local size operands as an array, so we need to unpack them.
SmallVector<Register, 16> LocalSizes;
if (Call->Builtin->Name.find("_varargs") != StringRef::npos || IsSpirvOp) {
if (Call->Builtin->Name.contains("_varargs") || IsSpirvOp) {
const unsigned LocalSizeArrayIdx = HasEvents ? 9 : 6;
Register GepReg = Call->Arguments[LocalSizeArrayIdx];
MachineInstr *GepMI = MRI->getUniqueVRegDef(GepReg);
Expand Down
2 changes: 1 addition & 1 deletion llvm/lib/TextAPI/Utils.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,7 @@ llvm::Expected<Regex> llvm::MachO::createRegexFromGlob(StringRef Glob) {
break;
}
default:
if (RegexMetachars.find(C) != StringRef::npos)
if (RegexMetachars.contains(C))
RegexString.push_back('\\');
RegexString.push_back(C);
}
Expand Down

0 comments on commit 89d0937

Please sign in to comment.