Skip to content

Commit e139a2f

Browse files
committed
[rebranch] Rename various functions to match new names in LLVM
llvm-project 601102d282d5e9a1429fea52ee17303aec8a7c10 renamed various functions in `CharInfo.h` and `Lexer.h`. Rename uses in Swift.
1 parent c676dfc commit e139a2f

File tree

3 files changed

+11
-11
lines changed

3 files changed

+11
-11
lines changed

lib/IDE/SyntaxModel.cpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -1599,10 +1599,10 @@ class DocFieldParser {
15991599
if (!advanceIf('-') || !advanceIf(' '))
16001600
return None;
16011601

1602-
if (ptr == end || !clang::isIdentifierBody(*ptr))
1602+
if (ptr == end || !clang::isAsciiIdentifierContinue(*ptr))
16031603
return None;
16041604
const char *identStart = ptr++;
1605-
while (advanceIf([](char c) { return clang::isIdentifierBody(c); }))
1605+
while (advanceIf([](char c) { return clang::isAsciiIdentifierContinue(c); }))
16061606
;
16071607
StringRef ident(identStart, ptr - identStart);
16081608

lib/IRGen/IRGenModule.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -1246,7 +1246,7 @@ llvm::Constant *IRGenModule::getOpaquePtr(llvm::Constant *ptr) {
12461246
}
12471247

12481248
static void appendEncodedName(raw_ostream &os, StringRef name) {
1249-
if (clang::isValidIdentifier(name)) {
1249+
if (clang::isValidAsciiIdentifier(name)) {
12501250
os << "_" << name;
12511251
} else {
12521252
for (auto c : name)

lib/Parse/Lexer.cpp

+8-8
Original file line numberDiff line numberDiff line change
@@ -35,9 +35,9 @@
3535
using namespace swift;
3636
using namespace swift::syntax;
3737

38-
// clang::isIdentifierHead and clang::isIdentifierBody are deliberately not in
39-
// this list as a reminder that they are using C rules for identifiers.
40-
// (Admittedly these are the same as Swift's right now.)
38+
// clang::isAsciiIdentifierStart and clang::isAsciiIdentifierContinue are
39+
// deliberately not in this list as a reminder that they are using C rules for
40+
// identifiers. (Admittedly these are the same as Swift's right now.)
4141
using clang::isAlphanumeric;
4242
using clang::isDigit;
4343
using clang::isHexDigit;
@@ -514,7 +514,7 @@ void Lexer::skipSlashStarComment() {
514514

515515
static bool isValidIdentifierContinuationCodePoint(uint32_t c) {
516516
if (c < 0x80)
517-
return clang::isIdentifierBody(c, /*dollar*/true);
517+
return clang::isAsciiIdentifierContinue(c, /*dollar*/true);
518518

519519
// N1518: Recommendations for extended identifier characters for C and C++
520520
// Proposed Annex X.1: Ranges of characters allowed
@@ -672,10 +672,10 @@ void Lexer::lexHash() {
672672

673673
// Scan for [a-zA-Z]+ to see what we match.
674674
const char *tmpPtr = CurPtr;
675-
if (clang::isIdentifierHead(*tmpPtr)) {
675+
if (clang::isAsciiIdentifierStart(*tmpPtr)) {
676676
do {
677677
++tmpPtr;
678-
} while (clang::isIdentifierBody(*tmpPtr));
678+
} while (clang::isAsciiIdentifierContinue(*tmpPtr));
679679
}
680680

681681
// Map the character sequence onto
@@ -2442,10 +2442,10 @@ void Lexer::lexImpl() {
24422442
return lexOperatorIdentifier();
24432443
case '%':
24442444
// Lex %[0-9a-zA-Z_]+ as a local SIL value
2445-
if (InSILBody && clang::isIdentifierBody(CurPtr[0])) {
2445+
if (InSILBody && clang::isAsciiIdentifierContinue(CurPtr[0])) {
24462446
do {
24472447
++CurPtr;
2448-
} while (clang::isIdentifierBody(CurPtr[0]));
2448+
} while (clang::isAsciiIdentifierContinue(CurPtr[0]));
24492449

24502450
return formToken(tok::sil_local_name, TokStart);
24512451
}

0 commit comments

Comments
 (0)