Skip to content
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
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 2 additions & 4 deletions clang-tools-extra/modularize/ModularizeUtilities.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -435,11 +435,9 @@ 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 == "..")
llvm::sys::path::remove_filename(Buffer);
else
else if (*B != ".")
llvm::sys::path::append(Buffer, *B);
++B;
}
Expand Down
2 changes: 1 addition & 1 deletion clang/lib/Driver/ToolChains/Clang.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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))
Expand Down
2 changes: 1 addition & 1 deletion clang/utils/TableGen/ClangAttrEmitter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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) +
Expand Down
Loading