mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
Merge branch 'main' into elsh/pkg-sil-verify
This commit is contained in:
@@ -1327,21 +1327,25 @@ void Serializer::writeInputBlock() {
|
||||
time_t importedHeaderModTime = 0;
|
||||
std::string contents;
|
||||
auto importedHeaderPath = Options.ImportedHeader;
|
||||
std::string pchIncludeTree;
|
||||
// We do not want to serialize the explicitly-specified .pch path if one was
|
||||
// provided. Instead we write out the path to the original header source so
|
||||
// that clients can consume it.
|
||||
if (Options.ExplicitModuleBuild &&
|
||||
llvm::sys::path::extension(importedHeaderPath)
|
||||
.ends_with(file_types::getExtension(file_types::TY_PCH)))
|
||||
importedHeaderPath = clangImporter->getClangInstance()
|
||||
.getASTReader()
|
||||
->getModuleManager()
|
||||
.lookupByFileName(importedHeaderPath)
|
||||
->OriginalSourceFileName;
|
||||
.ends_with(file_types::getExtension(file_types::TY_PCH))) {
|
||||
auto *pch = clangImporter->getClangInstance()
|
||||
.getASTReader()
|
||||
->getModuleManager()
|
||||
.lookupByFileName(importedHeaderPath);
|
||||
pchIncludeTree = pch->IncludeTreeID;
|
||||
importedHeaderPath = pch->OriginalSourceFileName;
|
||||
}
|
||||
|
||||
if (!importedHeaderPath.empty()) {
|
||||
contents = clangImporter->getBridgingHeaderContents(
|
||||
importedHeaderPath, importedHeaderSize, importedHeaderModTime);
|
||||
importedHeaderPath, importedHeaderSize, importedHeaderModTime,
|
||||
pchIncludeTree);
|
||||
}
|
||||
assert(publicImportSet.count(bridgingHeaderImport));
|
||||
ImportedHeader.emit(ScratchRecord,
|
||||
|
||||
Reference in New Issue
Block a user