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 {
912
912
913
913
std::string CompilerInstance::getBridgingHeaderPath () const {
914
914
const FrontendOptions &opts = Invocation.getFrontendOptions ();
915
- if (opts.ImplicitObjCPCHPath .empty ())
915
+ if (!opts.ModuleHasBridgingHeader )
916
+ return std::string ();
917
+
918
+ if (!opts.ImplicitObjCHeaderPath .empty ())
916
919
return opts.ImplicitObjCHeaderPath ;
917
920
918
921
auto clangImporter =
919
922
static_cast <ClangImporter *>(getASTContext ().getClangModuleLoader ());
920
923
921
924
// No clang importer created. Report error?
922
- if (!clangImporter)
925
+ if (!clangImporter || opts. ImplicitObjCPCHPath . empty () )
923
926
return std::string ();
924
927
925
928
return clangImporter->getOriginalSourceFile (opts.ImplicitObjCPCHPath );
Original file line number Diff line number Diff line change 121
121
// RUN: %target-swift-frontend -module-name User -O \
122
122
// RUN: -disable-implicit-string-processing-module-import -disable-implicit-concurrency-module-import -disable-implicit-swift-modules \
123
123
// 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 \
124
125
// RUN: -emit-module -o %t/User2.swiftmodule
125
126
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
+
126
134
// RUN: %target-swift-frontend -scan-dependencies -module-name User -O \
127
135
// RUN: -disable-implicit-string-processing-module-import -disable-implicit-concurrency-module-import \
128
136
// RUN: -Xcc -fmodule-map-file=%t/a.modulemap -Xcc -fmodule-map-file=%t/b.modulemap \
@@ -193,6 +201,8 @@ extension Bridging2 {
193
201
public func testA( ) { }
194
202
}
195
203
204
+ public class BB : B { }
205
+ public class Foo3 : Bridging2 { }
196
206
197
207
//--- Bridging.h
198
208
#include " Foo.h "
You can’t perform that action at this time.
0 commit comments