mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
Sema: Add request to compute if an AccessorDecl is transparent
Implicit accessors are sometimes transparent for performance reasons. Previously this was done in Sema by maybeMarkTransparent(), which would add a TransparentAttr. Replace this with a request.
This commit is contained in:
@@ -2984,7 +2984,7 @@ public:
|
||||
DeclID associatedDeclID;
|
||||
DeclID overriddenID;
|
||||
DeclID accessorStorageDeclID;
|
||||
bool needsNewVTableEntry;
|
||||
bool needsNewVTableEntry, isTransparent;
|
||||
DeclID opaqueResultTypeDeclID;
|
||||
ArrayRef<uint64_t> nameAndDependencyIDs;
|
||||
|
||||
@@ -3013,6 +3013,7 @@ public:
|
||||
rawAccessorKind,
|
||||
rawAccessLevel,
|
||||
needsNewVTableEntry,
|
||||
isTransparent,
|
||||
nameAndDependencyIDs);
|
||||
}
|
||||
|
||||
@@ -3128,12 +3129,15 @@ public:
|
||||
/*Throws=*/throws, /*ThrowsLoc=*/SourceLoc(),
|
||||
genericParams, DC);
|
||||
} else {
|
||||
fn = AccessorDecl::createDeserialized(
|
||||
auto *accessor = AccessorDecl::createDeserialized(
|
||||
ctx, /*FuncLoc=*/SourceLoc(), /*AccessorKeywordLoc=*/SourceLoc(),
|
||||
accessorKind, storage,
|
||||
/*StaticLoc=*/SourceLoc(), staticSpelling.getValue(),
|
||||
/*Throws=*/throws, /*ThrowsLoc=*/SourceLoc(),
|
||||
genericParams, DC);
|
||||
accessor->setIsTransparent(isTransparent);
|
||||
|
||||
fn = accessor;
|
||||
}
|
||||
fn->setEarlyAttrValidation();
|
||||
declOrOffset = fn;
|
||||
|
||||
Reference in New Issue
Block a user