@@ -448,6 +448,7 @@ writeImports(raw_ostream &out, llvm::SmallPtrSetImpl<ImportModuleTy> &imports,
448
448
bool includeUnderlying = false ;
449
449
StringRef importDirective =
450
450
useCxxImport ? " #pragma clang module import" : " @import" ;
451
+ StringRef importDirectiveLineEnd = useCxxImport ? " \n " : " ;\n " ;
451
452
for (auto import : sortedImports) {
452
453
if (auto *swiftModule = import .dyn_cast <ModuleDecl *>()) {
453
454
if (useCxxImport) {
@@ -464,7 +465,7 @@ writeImports(raw_ostream &out, llvm::SmallPtrSetImpl<ImportModuleTy> &imports,
464
465
continue ;
465
466
}
466
467
if (seenImports.insert (Name).second ) {
467
- out << importDirective << ' ' << Name.str () << " ; \n " ;
468
+ out << importDirective << ' ' << Name.str () << importDirectiveLineEnd ;
468
469
if (frontendOpts.EmitClangHeaderWithNonModularIncludes ) {
469
470
if (const clang::Module *underlyingClangModule =
470
471
swiftModule->findUnderlyingClangModule ()) {
@@ -487,8 +488,7 @@ writeImports(raw_ostream &out, llvm::SmallPtrSetImpl<ImportModuleTy> &imports,
487
488
" top-level modules should use a normal swift::ModuleDecl" );
488
489
out << importDirective << ' ' ;
489
490
ModuleDecl::ReverseFullNameIterator (clangModule).printForward (out);
490
- out << " ;\n " ;
491
-
491
+ out << importDirectiveLineEnd;
492
492
if (frontendOpts.EmitClangHeaderWithNonModularIncludes ) {
493
493
collectClangModuleHeaderIncludes (
494
494
clangModule, fileManager, requiredTextualIncludes, visitedModules,
0 commit comments