[ASTGEn] Handle _ identifier as the empty identifier

This commit is contained in:
Doug Gregor
2023-05-21 22:31:00 -07:00
parent 4188dca07a
commit fb8f71e8ce
2 changed files with 7 additions and 0 deletions

View File

@@ -119,6 +119,9 @@ void SwiftDiagnostic_finish(BridgedDiagnostic diagPtr) {
BridgedIdentifier
SwiftASTContext_getIdentifier(void *ctx, const unsigned char *_Nullable str,
long len) {
if (len == 1 && str[0] == '_')
return BridgedIdentifier();
// If this was a back-ticked identifier, drop the back-ticks.
if (len >= 2 && str[0] == '`' && str[len-1] == '`') {
++str;