[AST] Add new declaration - using

Initially this declaration is going to be used to determine
per-file default actor isolation i.e. `using @MainActor` and
`using nonisolated` but it could be extended to support other
file-global settings in the future.

(cherry picked from commit aabfebec03)
This commit is contained in:
Pavel Yaskevich
2025-05-27 17:02:10 -07:00
parent 3e79e5e8de
commit d057429e9a
21 changed files with 122 additions and 1 deletions

View File

@@ -2151,6 +2151,7 @@ static bool shouldSerializeMember(Decl *D) {
case DeclKind::Extension:
case DeclKind::Module:
case DeclKind::PrecedenceGroup:
case DeclKind::Using:
if (D->getASTContext().LangOpts.AllowModuleWithCompilerErrors)
return false;
llvm_unreachable("decl should never be a member");
@@ -5269,6 +5270,10 @@ public:
llvm_unreachable("import decls should not be serialized");
}
void visitUsingDecl(const UsingDecl *) {
llvm_unreachable("using decls should not be serialized");
}
void visitEnumCaseDecl(const EnumCaseDecl *) {
llvm_unreachable("enum case decls should not be serialized");
}