[Concurrency] Add support for @GlobalActor(unsafe).

Allow us to tag declarations that are meant to be in a global actor, but
for which we don't yet want to enforce everything. This will be used for
better staging-in of global actor annotations, but for now it's a fancy
way to document @actorIndependent(unsafe).

Stages in the syntax for rdar://74241687 without really implementing it.
This commit is contained in:
Doug Gregor
2021-02-25 22:41:32 -08:00
parent 62a5d1c2ce
commit 451e6cc1f5
12 changed files with 115 additions and 12 deletions

View File

@@ -4396,9 +4396,10 @@ llvm::Error DeclDeserializer::deserializeDeclAttributes() {
case decls_block::Custom_DECL_ATTR: {
bool isImplicit;
bool isArgUnsafe;
TypeID typeID;
serialization::decls_block::CustomDeclAttrLayout::readRecord(
scratch, isImplicit, typeID);
scratch, isImplicit, typeID, isArgUnsafe);
Expected<Type> deserialized = MF.getTypeChecked(typeID);
if (!deserialized) {
@@ -4412,7 +4413,9 @@ llvm::Error DeclDeserializer::deserializeDeclAttributes() {
return deserialized.takeError();
} else {
auto *TE = TypeExpr::createImplicit(deserialized.get(), ctx);
Attr = CustomAttr::create(ctx, SourceLoc(), TE, isImplicit);
auto custom = CustomAttr::create(ctx, SourceLoc(), TE, isImplicit);
custom->setArgIsUnsafe(isArgUnsafe);
Attr = custom;
}
break;
}