aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/CodeGen/TargetLoweringBase.cpp
diff options
context:
space:
mode:
authorKazu Hirata <kazu@google.com>2024-05-07 10:20:10 -0700
committerGitHub <noreply@github.com>2024-05-07 10:20:10 -0700
commit026a29e8b38aad79568de033d0e8e5d2e6bb4250 (patch)
treead7765dcbbaa3c2586e694dc5d5f0bb2668d7cea /llvm/lib/CodeGen/TargetLoweringBase.cpp
parent72085698a244e10780a6f115269a2f88455c8cab (diff)
downloadllvm-026a29e8b38aad79568de033d0e8e5d2e6bb4250.zip
llvm-026a29e8b38aad79568de033d0e8e5d2e6bb4250.tar.gz
llvm-026a29e8b38aad79568de033d0e8e5d2e6bb4250.tar.bz2
[Analysis, CodeGen, DebugInfo] Use StringRef::operator== instead of StringRef::equals (NFC) (#91304)
I'm planning to remove StringRef::equals in favor of StringRef::operator==. - StringRef::operator==/!= outnumber StringRef::equals by a factor of 53 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/CodeGen/TargetLoweringBase.cpp')
-rw-r--r--llvm/lib/CodeGen/TargetLoweringBase.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/llvm/lib/CodeGen/TargetLoweringBase.cpp b/llvm/lib/CodeGen/TargetLoweringBase.cpp
index 6e7b67d..75b3f14 100644
--- a/llvm/lib/CodeGen/TargetLoweringBase.cpp
+++ b/llvm/lib/CodeGen/TargetLoweringBase.cpp
@@ -2249,7 +2249,7 @@ static int getOpEnabled(bool IsSqrt, EVT VT, StringRef Override) {
if (IsDisabled)
RecipType = RecipType.substr(1);
- if (RecipType.equals(VTName) || RecipType.equals(VTNameNoSize))
+ if (RecipType == VTName || RecipType == VTNameNoSize)
return IsDisabled ? TargetLoweringBase::ReciprocalEstimate::Disabled
: TargetLoweringBase::ReciprocalEstimate::Enabled;
}
@@ -2299,7 +2299,7 @@ static int getOpRefinementSteps(bool IsSqrt, EVT VT, StringRef Override) {
continue;
RecipType = RecipType.substr(0, RefPos);
- if (RecipType.equals(VTName) || RecipType.equals(VTNameNoSize))
+ if (RecipType == VTName || RecipType == VTNameNoSize)
return RefSteps;
}