[ModuleInterface] Add printing for new attributes

Specially print @_hasMissingDesignatedInitializers and @_inheritsConvenienceInitializers in module interfaces

Fixes rdar://51249311
This commit is contained in:
Harlan Haskins
2019-11-19 16:53:43 -08:00
committed by Robert Widmann
parent 283854a012
commit 511db0c90a
8 changed files with 176 additions and 12 deletions

View File

@@ -990,6 +990,22 @@ void PrintAST::printAttributes(const Decl *D) {
Printer << " ";
}
}
// If the declaration has designated inits that won't be visible to
// clients, or if it inherits superclass convenience initializers,
// then print those attributes specially.
if (auto CD = dyn_cast<ClassDecl>(D)) {
if (Options.PrintImplicitAttrs) {
if (CD->inheritsSuperclassInitializers()) {
Printer.printAttrName("@_inheritsConvenienceInitializers");
Printer << " ";
}
if (CD->hasMissingDesignatedInitializers()) {
Printer.printAttrName("@_hasMissingDesignatedInitializers");
Printer << " ";
}
}
}
}
D->getAttrs().print(Printer, Options, D);