mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
[Caching] Allow prefix mapping for generated bridging header
To allow prefix mapping of the bridging header to achieve cache hit when source files are located in different location, the generated chained bridging header should not include absolute paths of the headers. Fix the problem by concat the chained bridging header together. Fixes: https://github.com/swiftlang/swift/issues/84088
This commit is contained in:
@@ -1478,8 +1478,9 @@ swift::extractUserModuleVersionFromInterface(StringRef moduleInterfacePath) {
|
||||
return result;
|
||||
}
|
||||
|
||||
std::string swift::extractEmbeddedBridgingHeaderContent(
|
||||
std::unique_ptr<llvm::MemoryBuffer> file, ASTContext &Context) {
|
||||
std::unique_ptr<llvm::MemoryBuffer> swift::extractEmbeddedBridgingHeaderContent(
|
||||
std::unique_ptr<llvm::MemoryBuffer> file, StringRef headerPath,
|
||||
ASTContext &Context) {
|
||||
std::shared_ptr<const ModuleFileSharedCore> loadedModuleFile;
|
||||
serialization::ValidationInfo loadInfo = ModuleFileSharedCore::load(
|
||||
"", "", std::move(file), nullptr, nullptr, false,
|
||||
@@ -1489,9 +1490,10 @@ std::string swift::extractEmbeddedBridgingHeaderContent(
|
||||
loadedModuleFile);
|
||||
|
||||
if (loadInfo.status != serialization::Status::Valid)
|
||||
return {};
|
||||
return nullptr;;
|
||||
|
||||
return loadedModuleFile->getEmbeddedHeader();
|
||||
return llvm::MemoryBuffer::getMemBufferCopy(
|
||||
loadedModuleFile->getEmbeddedHeader(), headerPath);
|
||||
}
|
||||
|
||||
bool SerializedModuleLoaderBase::canImportModule(
|
||||
|
||||
Reference in New Issue
Block a user