Skip to content

Commit e21e70a

Browse files
committed
llvm::StringRef equals_lower -> equals_insensitive
The `equals_lower` API was replaced with `equals_insensitive` in llvm commit 2e4a2b8 and 3eed57e. Ran git clang-format.
1 parent aca2de9 commit e21e70a

File tree

6 files changed

+15
-14
lines changed

6 files changed

+15
-14
lines changed

lib/AST/DocComment.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@ bool extractParameterOutline(
115115
}
116116

117117
auto HeadingContent = HeadingText->getLiteralContent();
118-
if (!HeadingContent.rtrim().equals_lower("parameters:")) {
118+
if (!HeadingContent.rtrim().equals_insensitive("parameters:")) {
119119
NormalItems.push_back(Child);
120120
continue;
121121
}

lib/Basic/StringExtras.cpp

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -45,8 +45,8 @@ bool swift::canBeMemberName(StringRef identifier) {
4545
}
4646

4747
bool swift::isPreposition(StringRef word) {
48-
#define PREPOSITION(Word) \
49-
if (word.equals_lower(#Word)) \
48+
#define PREPOSITION(Word) \
49+
if (word.equals_insensitive(#Word)) \
5050
return true;
5151
#include "PartsOfSpeech.def"
5252

@@ -55,11 +55,11 @@ bool swift::isPreposition(StringRef word) {
5555

5656
PartOfSpeech swift::getPartOfSpeech(StringRef word) {
5757
// FIXME: This implementation is woefully inefficient.
58-
#define PREPOSITION(Word) \
59-
if (word.equals_lower(#Word)) \
58+
#define PREPOSITION(Word) \
59+
if (word.equals_insensitive(#Word)) \
6060
return PartOfSpeech::Preposition;
61-
#define VERB(Word) \
62-
if (word.equals_lower(#Word)) \
61+
#define VERB(Word) \
62+
if (word.equals_insensitive(#Word)) \
6363
return PartOfSpeech::Verb;
6464
#include "PartsOfSpeech.def"
6565

@@ -417,7 +417,7 @@ static bool matchNameWordToTypeWord(StringRef nameWord, StringRef typeWord) {
417417
}
418418

419419
// Check for an exact match.
420-
return nameWord.equals_lower(typeWord);
420+
return nameWord.equals_insensitive(typeWord);
421421
}
422422

423423
/// Match the beginning of the name to the given type name.

lib/IDE/SyntaxModel.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1624,7 +1624,7 @@ class DocFieldParser {
16241624
;
16251625
StringRef ident(identStart, ptr - identStart);
16261626

1627-
if (ident.equals_lower("parameter")) {
1627+
if (ident.equals_insensitive("parameter")) {
16281628
if (numSpaces > 1 || !advanceIf(' '))
16291629
return None;
16301630
while (advanceIf([](char c) { return c != ':'; }))
@@ -1634,7 +1634,7 @@ class DocFieldParser {
16341634
return ident;
16351635

16361636
} else if (advanceIf(':')) {
1637-
if (ident.equals_lower("parameters") && numSpaces > 1)
1637+
if (ident.equals_insensitive("parameters") && numSpaces > 1)
16381638
return None;
16391639
auto lowerIdent = ident.lower();
16401640
bool isField = llvm::StringSwitch<bool>(lowerIdent)

lib/Sema/CSDiagnostics.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3459,7 +3459,7 @@ DeclName MissingMemberFailure::findCorrectEnumCaseName(
34593459
auto candidate =
34603460
corrections.getUniqueCandidateMatching([&](ValueDecl *candidate) {
34613461
return (isa<EnumElementDecl>(candidate) &&
3462-
candidate->getBaseIdentifier().str().equals_lower(
3462+
candidate->getBaseIdentifier().str().equals_insensitive(
34633463
memberName.getBaseIdentifier().str()));
34643464
});
34653465
return (candidate ? candidate->getName() : DeclName());

tools/SourceKit/lib/SwiftLang/CodeCompletionOrganizer.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -544,7 +544,8 @@ void CodeCompletionOrganizer::Impl::addCompletionsWithFilter(
544544
match = completion->getName().startswith_lower(filterText);
545545
}
546546

547-
bool isExactMatch = match && completion->getName().equals_lower(filterText);
547+
bool isExactMatch =
548+
match && completion->getName().equals_insensitive(filterText);
548549

549550
if (isExactMatch) {
550551
if (!exactMatch) { // first match

tools/SourceKit/tools/sourcekitd-test/sourcekitd-test.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -302,9 +302,9 @@ static int printDiags();
302302
static void getSemanticInfo(sourcekitd_variant_t Info, StringRef Filename);
303303

304304
static Optional<int64_t> getReqOptValueAsInt(StringRef Value) {
305-
if (Value.equals_lower("true"))
305+
if (Value.equals_insensitive("true"))
306306
return 1;
307-
if (Value.equals_lower("false"))
307+
if (Value.equals_insensitive("false"))
308308
return 0;
309309
int64_t Ret;
310310
if (Value.find_first_not_of("-0123456789") != StringRef::npos ||

0 commit comments

Comments
 (0)