-
Notifications
You must be signed in to change notification settings - Fork 11.9k
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
[clang] Use operator==(StringRef, StringRef) (NFC) #92708
Merged
kazutakahirata
merged 2 commits into
llvm:main
from
kazutakahirata:cleanup_StringRef_compare_clang
May 19, 2024
Merged
[clang] Use operator==(StringRef, StringRef) (NFC) #92708
kazutakahirata
merged 2 commits into
llvm:main
from
kazutakahirata:cleanup_StringRef_compare_clang
May 19, 2024
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
llvmbot
added
clang
Clang issues not falling into any other category
clang-tools-extra
clang:driver
'clang' and 'clang++' user-facing binaries. Not 'clang-cl'
labels
May 19, 2024
@llvm/pr-subscribers-clang-tools-extra @llvm/pr-subscribers-clang-driver Author: Kazu Hirata (kazutakahirata) ChangesFull diff: https://github.com/llvm/llvm-project/pull/92708.diff 3 Files Affected:
diff --git a/clang-tools-extra/modularize/ModularizeUtilities.cpp b/clang-tools-extra/modularize/ModularizeUtilities.cpp
index 53e8a49d1a548..8752946822fed 100644
--- a/clang-tools-extra/modularize/ModularizeUtilities.cpp
+++ b/clang-tools-extra/modularize/ModularizeUtilities.cpp
@@ -435,9 +435,8 @@ static std::string replaceDotDot(StringRef Path) {
llvm::sys::path::const_iterator B = llvm::sys::path::begin(Path),
E = llvm::sys::path::end(Path);
while (B != E) {
- if (B->compare(".") == 0) {
- }
- else if (B->compare("..") == 0)
+ if (*B == ".") {
+ } else if (*B == "..")
llvm::sys::path::remove_filename(Buffer);
else
llvm::sys::path::append(Buffer, *B);
diff --git a/clang/lib/Driver/ToolChains/Clang.cpp b/clang/lib/Driver/ToolChains/Clang.cpp
index c3e6d563f3bd2..6d2015b2cd156 100644
--- a/clang/lib/Driver/ToolChains/Clang.cpp
+++ b/clang/lib/Driver/ToolChains/Clang.cpp
@@ -1522,7 +1522,7 @@ static void CollectARMPACBTIOptions(const ToolChain &TC, const ArgList &Args,
auto isPAuthLR = [](const char *member) {
llvm::AArch64::ExtensionInfo pauthlr_extension =
llvm::AArch64::getExtensionByID(llvm::AArch64::AEK_PAUTHLR);
- return (pauthlr_extension.Feature.compare(member) == 0);
+ return pauthlr_extension.Feature == member;
};
if (std::any_of(CmdArgs.begin(), CmdArgs.end(), isPAuthLR))
diff --git a/clang/utils/TableGen/ClangAttrEmitter.cpp b/clang/utils/TableGen/ClangAttrEmitter.cpp
index aafbf1f40949a..ca7630adfbb7b 100644
--- a/clang/utils/TableGen/ClangAttrEmitter.cpp
+++ b/clang/utils/TableGen/ClangAttrEmitter.cpp
@@ -1845,7 +1845,7 @@ static LateAttrParseKind getLateAttrParseKind(const Record *Attr) {
PrintFatalError(Attr, "Field `" + llvm::Twine(LateParsedStr) +
"`should only have one super class");
- if (SuperClasses[0]->getName().compare(LateAttrParseKindStr) != 0)
+ if (SuperClasses[0]->getName() != LateAttrParseKindStr)
PrintFatalError(Attr, "Field `" + llvm::Twine(LateParsedStr) +
"`should only have type `" +
llvm::Twine(LateAttrParseKindStr) +
|
MaskRay
reviewed
May 19, 2024
MaskRay
approved these changes
May 19, 2024
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM with a nit
qiaojbao
pushed a commit
to GPUOpen-Drivers/llvm-project
that referenced
this pull request
Jun 5, 2024
…01c68e317 Local branch amd-gfx 4b601c6 Merged main:7273ad123850a7b44c0625d098ebb49153bf855a into amd-gfx:319b068967d9 Remote branch main d102ee6 [clang] Use operator==(StringRef, StringRef) (NFC) (llvm#92708)
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
clang:driver
'clang' and 'clang++' user-facing binaries. Not 'clang-cl'
clang
Clang issues not falling into any other category
clang-tools-extra
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
No description provided.