diff options
author | Corentin Jabot <corentin.jabot@gmail.com> | 2021-09-14 09:11:23 -0400 |
---|---|---|
committer | Aaron Ballman <aaron@aaronballman.com> | 2021-09-14 09:12:22 -0400 |
commit | 601102d282d5e9a1429fea52ee17303aec8a7c10 (patch) | |
tree | 524c34d1746fc2a62524f8ec2650c7f912196810 /clang/lib/Lex/ModuleMap.cpp | |
parent | 9bbc0c1ffb47f9cf4c9d8e9a0e8100002fe5aafb (diff) | |
download | llvm-601102d282d5e9a1429fea52ee17303aec8a7c10.zip llvm-601102d282d5e9a1429fea52ee17303aec8a7c10.tar.gz llvm-601102d282d5e9a1429fea52ee17303aec8a7c10.tar.bz2 |
Cleanup identifier parsing; NFC
Rename methods to clearly signal when they only deal with ASCII,
simplify the parsing of identifier, and use start/continue instead of
head/body for consistency with Unicode terminology.
Diffstat (limited to 'clang/lib/Lex/ModuleMap.cpp')
-rw-r--r-- | clang/lib/Lex/ModuleMap.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/clang/lib/Lex/ModuleMap.cpp b/clang/lib/Lex/ModuleMap.cpp index f9af7c2..8475417 100644 --- a/clang/lib/Lex/ModuleMap.cpp +++ b/clang/lib/Lex/ModuleMap.cpp @@ -338,7 +338,7 @@ static StringRef sanitizeFilenameAsIdentifier(StringRef Name, if (Name.empty()) return Name; - if (!isValidIdentifier(Name)) { + if (!isValidAsciiIdentifier(Name)) { // If we don't already have something with the form of an identifier, // create a buffer with the sanitized name. Buffer.clear(); @@ -346,7 +346,7 @@ static StringRef sanitizeFilenameAsIdentifier(StringRef Name, Buffer.push_back('_'); Buffer.reserve(Buffer.size() + Name.size()); for (unsigned I = 0, N = Name.size(); I != N; ++I) { - if (isIdentifierBody(Name[I])) + if (isAsciiIdentifierContinue(Name[I])) Buffer.push_back(Name[I]); else Buffer.push_back('_'); |