================
@@ -157,32 +159,15 @@ ModuleManager::AddModuleResult ModuleManager::addModule(
time_t ModTime = ExpectedModTime;
llvm::MemoryBuffer *ModuleBuffer = nullptr;
std::unique_ptr<llvm::MemoryBuffer> NewFileBuffer = nullptr;
- if (std::unique_ptr<llvm::MemoryBuffer> Buffer = lookupBuffer(FileName)) {
+ if (std::unique_ptr<llvm::MemoryBuffer> Buffer =
+ lookupBuffer(FileName, Size, ModTime)) {
// The buffer was already provided for us.
ModuleBuffer = &getModuleCache().getInMemoryModuleCache().addBuiltPCM(
- FileName, std::move(Buffer));
+ FileName, std::move(Buffer), Size, ModTime);
} else if (llvm::MemoryBuffer *Buffer =
getModuleCache().getInMemoryModuleCache().lookupPCM(
- FileName)) {
+ FileName, Size, ModTime)) {
ModuleBuffer = Buffer;
- if (!FileName.getImplicitModuleSuffixLength()) {
- // Explicitly-built PCM files maintain consistency via mtime/size
- // expectations on their imports. Even if we've previously successfully
- // loaded a PCM file and stored it in the in-memory module cache, that
- // does not mean its mtime/size matches current importer's expectations.
- // Get that information so that it can be checked below.
- // FIXME: Even though this FileManager access is likely already cached,
we
- // should store this directly in the in-memory module cache.
----------------
jansvoboda11 wrote:
This is the main point of the PR.
https://github.com/llvm/llvm-project/pull/190207
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits