aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/Transforms/Utils/LoopUnroll.cpp
diff options
context:
space:
mode:
authorKazu Hirata <kazu@google.com>2024-05-04 12:33:12 -0700
committerGitHub <noreply@github.com>2024-05-04 12:33:12 -0700
commit677dddebae77a93e080a98617aa2714be4a46fd0 (patch)
tree3c9f6de6a0904eded90f4f94f13fc1fec62e297b /llvm/lib/Transforms/Utils/LoopUnroll.cpp
parent24f5fc77d43f4ae2dc1cb0c0902c5e22cbadf09e (diff)
downloadllvm-677dddebae77a93e080a98617aa2714be4a46fd0.zip
llvm-677dddebae77a93e080a98617aa2714be4a46fd0.tar.gz
llvm-677dddebae77a93e080a98617aa2714be4a46fd0.tar.bz2
[Transforms] Use StringRef::operator== instead of StringRef::equals (NFC) (#91072)
I'm planning to remove StringRef::equals in favor of StringRef::operator==. - StringRef::operator==/!= outnumber StringRef::equals by a factor of 31 under llvm/ in terms of their usage. - The elimination of StringRef::equals brings StringRef closer to std::string_view, which has operator== but not equals. - S == "foo" is more readable than S.equals("foo"), especially for !Long.Expression.equals("str") vs Long.Expression != "str".
Diffstat (limited to 'llvm/lib/Transforms/Utils/LoopUnroll.cpp')
-rw-r--r--llvm/lib/Transforms/Utils/LoopUnroll.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/llvm/lib/Transforms/Utils/LoopUnroll.cpp b/llvm/lib/Transforms/Utils/LoopUnroll.cpp
index e9969ae..20978cf 100644
--- a/llvm/lib/Transforms/Utils/LoopUnroll.cpp
+++ b/llvm/lib/Transforms/Utils/LoopUnroll.cpp
@@ -1077,7 +1077,7 @@ MDNode *llvm::GetUnrollMetadata(MDNode *LoopID, StringRef Name) {
if (!S)
continue;
- if (Name.equals(S->getString()))
+ if (Name == S->getString())
return MD;
}
return nullptr;