mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
[SIL/Parse] InitAccessors: Implement printing and parsing of previously iniitalized properties
Properties that are marked as initialized are printed as `[assign=<index>]` where `<index>` point to the property position in `getInitializedProperties()` list.
This commit is contained in:
@@ -1270,12 +1270,17 @@ void AssignOrInitInst::markAsInitialized(VarDecl *property) {
|
||||
auto toInitProperties = getInitializedProperties();
|
||||
for (unsigned index : indices(toInitProperties)) {
|
||||
if (toInitProperties[index] == property) {
|
||||
Assignments.set(index);
|
||||
markAsInitialized(index);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void AssignOrInitInst::markAsInitialized(unsigned propertyIdx) {
|
||||
assert(propertyIdx < getNumInitializedProperties());
|
||||
Assignments.set(propertyIdx);
|
||||
}
|
||||
|
||||
bool AssignOrInitInst::isPropertyAlreadyInitialized(unsigned propertyIdx) {
|
||||
assert(propertyIdx < Assignments.size());
|
||||
return Assignments.test(propertyIdx);
|
||||
|
||||
Reference in New Issue
Block a user