-
Notifications
You must be signed in to change notification settings - Fork 14.3k
[SPIRV] Use StringRef instead of std::string (NFC) #138408
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[SPIRV] Use StringRef instead of std::string (NFC) #138408
Conversation
We can use StringRef for PassPrefix because it is used only with StringRef::starts_with.
@llvm/pr-subscribers-backend-spir-v Author: Kazu Hirata (kazutakahirata) ChangesWe can use StringRef for PassPrefix because it is used only with Full diff: https://github.com/llvm/llvm-project/pull/138408.diff 1 Files Affected:
diff --git a/llvm/lib/Target/SPIRV/SPIRVBuiltins.cpp b/llvm/lib/Target/SPIRV/SPIRVBuiltins.cpp
index 78c0d252cb834..c516be0297e66 100644
--- a/llvm/lib/Target/SPIRV/SPIRVBuiltins.cpp
+++ b/llvm/lib/Target/SPIRV/SPIRVBuiltins.cpp
@@ -184,11 +184,11 @@ namespace SPIRV {
/// Parses the name part of the demangled builtin call.
std::string lookupBuiltinNameHelper(StringRef DemangledCall,
FPDecorationId *DecorationId) {
- const static std::string PassPrefix = "(anonymous namespace)::";
+ StringRef PassPrefix = "(anonymous namespace)::";
std::string BuiltinName;
// Itanium Demangler result may have "(anonymous namespace)::" prefix
- if (DemangledCall.starts_with(PassPrefix.c_str()))
- BuiltinName = DemangledCall.substr(PassPrefix.length());
+ if (DemangledCall.starts_with(PassPrefix))
+ BuiltinName = DemangledCall.substr(PassPrefix.size());
else
BuiltinName = DemangledCall;
// Extract the builtin function name and types of arguments from the call
|
LLVM Buildbot has detected a new failure on builder Full details are available at: https://lab.llvm.org/buildbot/#/builders/88/builds/11199 Here is the relevant piece of the build log for the reference
|
LLVM Buildbot has detected a new failure on builder Full details are available at: https://lab.llvm.org/buildbot/#/builders/18/builds/15443 Here is the relevant piece of the build log for the reference
|
LLVM Buildbot has detected a new failure on builder Full details are available at: https://lab.llvm.org/buildbot/#/builders/42/builds/4399 Here is the relevant piece of the build log for the reference
|
We can use StringRef for PassPrefix because it is used only with StringRef::starts_with.
We can use StringRef for PassPrefix because it is used only with StringRef::starts_with.
We can use StringRef for PassPrefix because it is used only with StringRef::starts_with.
We can use StringRef for PassPrefix because it is used only with StringRef::starts_with.
We can use StringRef for PassPrefix because it is used only with
StringRef::starts_with.