diff options
author | Kazu Hirata <kazu@google.com> | 2024-05-11 11:38:52 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-05-11 11:38:52 -0700 |
commit | deffae5da123b32098914d8346bf4358a6792bdc (patch) | |
tree | 3a630538c5cfebe966c39361c602095424c4d656 /clang/lib/CodeGen/CodeGenFunction.cpp | |
parent | 379b77773cf653352f30f8c7cca393f4df9389be (diff) | |
download | llvm-deffae5da123b32098914d8346bf4358a6792bdc.zip llvm-deffae5da123b32098914d8346bf4358a6792bdc.tar.gz llvm-deffae5da123b32098914d8346bf4358a6792bdc.tar.bz2 |
[clang] Use StringRef::operator== instead of StringRef::equals (NFC) (#91844)
I'm planning to remove StringRef::equals in favor of
StringRef::operator==.
- StringRef::operator==/!= outnumber StringRef::equals by a factor of
24 under clang/ 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 'clang/lib/CodeGen/CodeGenFunction.cpp')
-rw-r--r-- | clang/lib/CodeGen/CodeGenFunction.cpp | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/clang/lib/CodeGen/CodeGenFunction.cpp b/clang/lib/CodeGen/CodeGenFunction.cpp index 4778141..9f16fcb 100644 --- a/clang/lib/CodeGen/CodeGenFunction.cpp +++ b/clang/lib/CodeGen/CodeGenFunction.cpp @@ -2765,10 +2765,9 @@ llvm::Value *CodeGenFunction::FormAArch64ResolverCondition( // only for features that are not enabled in the target. The exception is // for features whose extension instructions are executed as NOP on targets // without extension support. - if (!getContext().getTargetInfo().hasFeature(Feature) || - Feature.equals("bti") || Feature.equals("memtag") || - Feature.equals("memtag2") || Feature.equals("memtag3") || - Feature.equals("dgh")) + if (!getContext().getTargetInfo().hasFeature(Feature) || Feature == "bti" || + Feature == "memtag" || Feature == "memtag2" || Feature == "memtag3" || + Feature == "dgh") CondFeatures.push_back(Feature); } if (!CondFeatures.empty()) { |