diff options
author | Kazu Hirata <kazu@google.com> | 2024-05-19 18:17:53 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-05-19 18:17:53 -0700 |
commit | 89d0937348ebd4b55f17d503910be9300aa44a13 (patch) | |
tree | 8148e0d4b0aea77e53c19a737e1555b04d4d6f1c | |
parent | 0bced10f290bb96d675874a89f1b6789a2384e30 (diff) | |
download | llvm-89d0937348ebd4b55f17d503910be9300aa44a13.zip llvm-89d0937348ebd4b55f17d503910be9300aa44a13.tar.gz llvm-89d0937348ebd4b55f17d503910be9300aa44a13.tar.bz2 |
[llvm] Use StringRef::contains (NFC) (#92710)
-rw-r--r-- | llvm/lib/IR/Mangler.cpp | 2 | ||||
-rw-r--r-- | llvm/lib/Target/SPIRV/SPIRVBuiltins.cpp | 2 | ||||
-rw-r--r-- | llvm/lib/TextAPI/Utils.cpp | 2 |
3 files changed, 3 insertions, 3 deletions
diff --git a/llvm/lib/IR/Mangler.cpp b/llvm/lib/IR/Mangler.cpp index 72e2bc1..019fe84 100644 --- a/llvm/lib/IR/Mangler.cpp +++ b/llvm/lib/IR/Mangler.cpp @@ -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; diff --git a/llvm/lib/Target/SPIRV/SPIRVBuiltins.cpp b/llvm/lib/Target/SPIRV/SPIRVBuiltins.cpp index 32de8b9..9fde26c 100644 --- a/llvm/lib/Target/SPIRV/SPIRVBuiltins.cpp +++ b/llvm/lib/Target/SPIRV/SPIRVBuiltins.cpp @@ -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); diff --git a/llvm/lib/TextAPI/Utils.cpp b/llvm/lib/TextAPI/Utils.cpp index 08f14f6..01021e3 100644 --- a/llvm/lib/TextAPI/Utils.cpp +++ b/llvm/lib/TextAPI/Utils.cpp @@ -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); } |