@@ -116,9 +116,6 @@ class AnnotatingPrinter : public StreamPrinter {
116116 // synthesize target to the original USR.
117117 std::string TargetUSR;
118118
119- // A separator between the target usr and the real usr.
120- std::string Separator = " ::SYNTHESIZED::" ;
121-
122119public:
123120 AnnotatingPrinter (SourceTextInfo &Info, llvm::raw_ostream &OS)
124121 : StreamPrinter(OS), Info(Info) { }
@@ -160,7 +157,7 @@ class AnnotatingPrinter : public StreamPrinter {
160157
161158 // Append target's USR if this is a member of a synthesized extension.
162159 if (!TargetUSR.empty ()) {
163- OS << Separator ;
160+ OS << LangSupport::SynthesizedUSRSeparator ;
164161 OS << TargetUSR;
165162 }
166163 StringRef USR = OS.str ();
@@ -275,7 +272,8 @@ static bool getModuleInterfaceInfo(ASTContext &Ctx,
275272 StringRef ModuleName,
276273 Optional<StringRef> Group,
277274 SwiftInterfaceGenContext::Implementation &Impl,
278- std::string &ErrMsg) {
275+ std::string &ErrMsg,
276+ bool SynthesizedExtensions) {
279277 Module *&Mod = Impl.Mod ;
280278 SourceTextInfo &Info = Impl.Info ;
281279
@@ -318,7 +316,7 @@ static bool getModuleInterfaceInfo(ASTContext &Ctx,
318316 AnnotatingPrinter Printer (Info, OS);
319317 printSubmoduleInterface (Mod, SplitModuleName, Group,
320318 TraversalOptions,
321- Printer, Options, false );
319+ Printer, Options, SynthesizedExtensions );
322320
323321 Info.Text = OS.str ();
324322 return false ;
@@ -374,7 +372,8 @@ SwiftInterfaceGenContext::create(StringRef DocumentName,
374372 StringRef ModuleOrHeaderName,
375373 Optional<StringRef> Group,
376374 CompilerInvocation Invocation,
377- std::string &ErrMsg) {
375+ std::string &ErrMsg,
376+ bool SynthesizedExtensions) {
378377 SwiftInterfaceGenContextRef IFaceGenCtx{ new SwiftInterfaceGenContext () };
379378 IFaceGenCtx->Impl .DocumentName = DocumentName;
380379 IFaceGenCtx->Impl .IsModule = IsModule;
@@ -403,7 +402,7 @@ SwiftInterfaceGenContext::create(StringRef DocumentName,
403402
404403 if (IsModule) {
405404 if (getModuleInterfaceInfo (Ctx, ModuleOrHeaderName, Group, IFaceGenCtx->Impl ,
406- ErrMsg))
405+ ErrMsg, SynthesizedExtensions ))
407406 return nullptr ;
408407 } else {
409408 auto &FEOpts = Invocation.getFrontendOptions ();
@@ -582,7 +581,8 @@ void SwiftLangSupport::editorOpenInterface(EditorConsumer &Consumer,
582581 StringRef Name,
583582 StringRef ModuleName,
584583 Optional<StringRef> Group,
585- ArrayRef<const char *> Args) {
584+ ArrayRef<const char *> Args,
585+ bool SynthesizedExtensions) {
586586 CompilerInstance CI;
587587 // Display diagnostics to stderr.
588588 PrintingDiagnosticConsumer PrintDiags;
@@ -615,7 +615,8 @@ void SwiftLangSupport::editorOpenInterface(EditorConsumer &Consumer,
615615 ModuleName,
616616 Group,
617617 Invocation,
618- ErrMsg);
618+ ErrMsg,
619+ SynthesizedExtensions);
619620 if (!IFaceGenRef) {
620621 Consumer.handleRequestError (ErrMsg.c_str ());
621622 return ;
@@ -683,7 +684,8 @@ void SwiftLangSupport::editorOpenSwiftSourceInterface(StringRef Name,
683684void SwiftLangSupport::editorOpenHeaderInterface (EditorConsumer &Consumer,
684685 StringRef Name,
685686 StringRef HeaderName,
686- ArrayRef<const char *> Args) {
687+ ArrayRef<const char *> Args,
688+ bool SynthesizedExtensions) {
687689 CompilerInstance CI;
688690 // Display diagnostics to stderr.
689691 PrintingDiagnosticConsumer PrintDiags;
@@ -719,7 +721,8 @@ void SwiftLangSupport::editorOpenHeaderInterface(EditorConsumer &Consumer,
719721 HeaderName,
720722 None,
721723 Invocation,
722- Error);
724+ Error,
725+ SynthesizedExtensions);
723726 if (!IFaceGenRef) {
724727 Consumer.handleRequestError (Error.c_str ());
725728 return ;
0 commit comments