mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
[ModulePrint] Add the initial implementation for printing synthesized extensions.
For a concrete type, members from its conforming protocols' extensions can be hard to manually surface. In this commit, when printing Swift modules, we start to replicate these extensions and synthesize them as if they are the concrete type's native extensions. Credit to Doug for suggesting this practice.
This commit is contained in:
@@ -40,13 +40,15 @@ typedef OptionSet<ModuleTraversal> ModuleTraversalOptions;
|
||||
|
||||
void printModuleInterface(ModuleDecl *M,
|
||||
ModuleTraversalOptions TraversalOptions,
|
||||
ASTPrinter &Printer, const PrintOptions &Options);
|
||||
ASTPrinter &Printer, const PrintOptions &Options,
|
||||
const bool PrintSynthesizedExtensions);
|
||||
|
||||
// FIXME: this API should go away when Swift can represent Clang submodules as
|
||||
// 'swift::Module *' objects.
|
||||
void printSubmoduleInterface(ModuleDecl *M, ArrayRef<StringRef> FullModuleName,
|
||||
ModuleTraversalOptions TraversalOptions,
|
||||
ASTPrinter &Printer, const PrintOptions &Options);
|
||||
ASTPrinter &Printer, const PrintOptions &Options,
|
||||
const bool PrintSynthesizedExtensions);
|
||||
|
||||
/// Print the interface for a header that has been imported via the implicit
|
||||
/// objc header importing feature.
|
||||
|
||||
Reference in New Issue
Block a user