mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
[AST] Add 'initializes' and 'accesses' attributes for init accessor
definite initialization dependencies.
This commit is contained in:
committed by
Pavel Yaskevich
parent
df69020eca
commit
e5f75029de
@@ -2906,6 +2906,34 @@ class Serializer::DeclSerializer : public DeclVisitor<DeclSerializer> {
|
||||
return;
|
||||
}
|
||||
|
||||
case DAK_Initializes: {
|
||||
auto abbrCode = S.DeclTypeAbbrCodes[InitializesDeclAttrLayout::Code];
|
||||
auto attr = cast<InitializesAttr>(DA);
|
||||
|
||||
SmallVector<IdentifierID, 4> properties;
|
||||
for (auto identifier : attr->getProperties()) {
|
||||
properties.push_back(S.addDeclBaseNameRef(identifier));
|
||||
}
|
||||
|
||||
InitializesDeclAttrLayout::emitRecord(
|
||||
S.Out, S.ScratchRecord, abbrCode, properties);
|
||||
return;
|
||||
}
|
||||
|
||||
case DAK_Accesses: {
|
||||
auto abbrCode = S.DeclTypeAbbrCodes[AccessesDeclAttrLayout::Code];
|
||||
auto attr = cast<InitializesAttr>(DA);
|
||||
|
||||
SmallVector<IdentifierID, 4> properties;
|
||||
for (auto identifier : attr->getProperties()) {
|
||||
properties.push_back(S.addDeclBaseNameRef(identifier));
|
||||
}
|
||||
|
||||
AccessesDeclAttrLayout::emitRecord(
|
||||
S.Out, S.ScratchRecord, abbrCode, properties);
|
||||
return;
|
||||
}
|
||||
|
||||
case DAK_DynamicReplacement: {
|
||||
auto abbrCode =
|
||||
S.DeclTypeAbbrCodes[DynamicReplacementDeclAttrLayout::Code];
|
||||
|
||||
Reference in New Issue
Block a user