mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
[ExplicitModuleBuild] Don't leak chained bridging header in objc header
When generating an objc header from the swift module when a bridging header is used, make sure to use the original bridging header, not the chained bridging header. This also avoids incorrectly generated a header include when no actual bridging header is used, just a chained bridging header that is coming from a dependency. rdar://148446465
This commit is contained in:
@@ -912,14 +912,17 @@ SourceFile *CompilerInstance::getIDEInspectionFile() const {
|
||||
|
||||
std::string CompilerInstance::getBridgingHeaderPath() const {
|
||||
const FrontendOptions &opts = Invocation.getFrontendOptions();
|
||||
if (opts.ImplicitObjCPCHPath.empty())
|
||||
if (!opts.ModuleHasBridgingHeader)
|
||||
return std::string();
|
||||
|
||||
if (!opts.ImplicitObjCHeaderPath.empty())
|
||||
return opts.ImplicitObjCHeaderPath;
|
||||
|
||||
auto clangImporter =
|
||||
static_cast<ClangImporter *>(getASTContext().getClangModuleLoader());
|
||||
|
||||
// No clang importer created. Report error?
|
||||
if (!clangImporter)
|
||||
if (!clangImporter || opts.ImplicitObjCPCHPath.empty())
|
||||
return std::string();
|
||||
|
||||
return clangImporter->getOriginalSourceFile(opts.ImplicitObjCPCHPath);
|
||||
|
||||
Reference in New Issue
Block a user