[AST] NFC: Formalize Decl validation tracking via RAII

After this change, RAII ensures that the validation state is accurate as
possible.
This commit is contained in:
David Zarzycki
2018-05-16 07:51:05 -04:00
parent 274114d4a2
commit b29d2784ed
14 changed files with 173 additions and 136 deletions

View File

@@ -373,7 +373,7 @@ deriveRawRepresentable_init(DerivedConformance &derived) {
initDecl->setInterfaceType(allocIfaceType);
initDecl->setInitializerInterfaceType(initIfaceType);
initDecl->copyFormalAccessFrom(enumDecl, /*sourceIsParentContext*/true);
initDecl->setValidationStarted();
initDecl->setValidationToChecked();
// If the containing module is not resilient, make sure clients can construct
// an instance without function call overhead.