File tree Expand file tree Collapse file tree 2 files changed +15
-2
lines changed Expand file tree Collapse file tree 2 files changed +15
-2
lines changed Original file line number Diff line number Diff line change @@ -912,14 +912,17 @@ SourceFile *CompilerInstance::getIDEInspectionFile() const {
912912
913913std::string CompilerInstance::getBridgingHeaderPath () const {
914914 const FrontendOptions &opts = Invocation.getFrontendOptions ();
915- if (opts.ImplicitObjCPCHPath .empty ())
915+ if (!opts.ModuleHasBridgingHeader )
916+ return std::string ();
917+
918+ if (!opts.ImplicitObjCHeaderPath .empty ())
916919 return opts.ImplicitObjCHeaderPath ;
917920
918921 auto clangImporter =
919922 static_cast <ClangImporter *>(getASTContext ().getClangModuleLoader ());
920923
921924 // No clang importer created. Report error?
922- if (!clangImporter)
925+ if (!clangImporter || opts. ImplicitObjCPCHPath . empty () )
923926 return std::string ();
924927
925928 return clangImporter->getOriginalSourceFile (opts.ImplicitObjCPCHPath );
Original file line number Diff line number Diff line change 121121// RUN: %target-swift-frontend -module-name User -O \
122122// RUN: -disable-implicit-string-processing-module-import -disable-implicit-concurrency-module-import -disable-implicit-swift-modules \
123123// RUN: -explicit-swift-module-map-file %t/map3.json @%t/User2.cmd %t/user2.swift \
124+ // RUN: -emit-objc-header -emit-objc-header-path %t/User-Swift.h \
124125// RUN: -emit-module -o %t/User2.swiftmodule
125126
127+ /// Generated ObjC Header should reference original header name, not the chained bridging header.
128+ // RUN: %FileCheck %s --check-prefix OBJC-HEADER --input-file=%t/User-Swift.h
129+ // OBJC-HEADER: import B
130+ // OBJC-HEADER: import
131+ // OBJC-HEADER-SAME: Bridging2.h
132+ // OBJC-HEADER-NOT: ChainedBridgingHeader.h
133+
126134// RUN: %target-swift-frontend -scan-dependencies -module-name User -O \
127135// RUN: -disable-implicit-string-processing-module-import -disable-implicit-concurrency-module-import \
128136// RUN: -Xcc -fmodule-map-file=%t/a.modulemap -Xcc -fmodule-map-file=%t/b.modulemap \
@@ -193,6 +201,8 @@ extension Bridging2 {
193201 public func testA( ) { }
194202}
195203
204+ public class BB : B { }
205+ public class Foo3 : Bridging2 { }
196206
197207//--- Bridging.h
198208#include " Foo.h "
You can’t perform that action at this time.
0 commit comments