Skip to content

Commit 89d0937

Browse files
[llvm] Use StringRef::contains (NFC) (#92710)
1 parent 0bced10 commit 89d0937

File tree

3 files changed

+3
-3
lines changed

3 files changed

+3
-3
lines changed

llvm/lib/IR/Mangler.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -292,7 +292,7 @@ void llvm::emitLinkerFlagsForUsedCOFF(raw_ostream &OS, const GlobalValue *GV,
292292

293293
std::optional<std::string> llvm::getArm64ECMangledFunctionName(StringRef Name) {
294294
bool IsCppFn = Name[0] == '?';
295-
if (IsCppFn && Name.find("$$h") != std::string::npos)
295+
if (IsCppFn && Name.contains("$$h"))
296296
return std::nullopt;
297297
if (!IsCppFn && Name[0] == '#')
298298
return std::nullopt;

llvm/lib/Target/SPIRV/SPIRVBuiltins.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1886,7 +1886,7 @@ static bool buildEnqueueKernel(const SPIRV::IncomingCall *Call,
18861886
// Local sizes arguments: Sizes of block invoke arguments. Clang generates
18871887
// local size operands as an array, so we need to unpack them.
18881888
SmallVector<Register, 16> LocalSizes;
1889-
if (Call->Builtin->Name.find("_varargs") != StringRef::npos || IsSpirvOp) {
1889+
if (Call->Builtin->Name.contains("_varargs") || IsSpirvOp) {
18901890
const unsigned LocalSizeArrayIdx = HasEvents ? 9 : 6;
18911891
Register GepReg = Call->Arguments[LocalSizeArrayIdx];
18921892
MachineInstr *GepMI = MRI->getUniqueVRegDef(GepReg);

llvm/lib/TextAPI/Utils.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -184,7 +184,7 @@ llvm::Expected<Regex> llvm::MachO::createRegexFromGlob(StringRef Glob) {
184184
break;
185185
}
186186
default:
187-
if (RegexMetachars.find(C) != StringRef::npos)
187+
if (RegexMetachars.contains(C))
188188
RegexString.push_back('\\');
189189
RegexString.push_back(C);
190190
}

0 commit comments

Comments
 (0)