From fdca86db1d50832cf4c8cb065d1ded728aa2ce0a Mon Sep 17 00:00:00 2001 From: Vassil Vassilev Date: Thu, 30 Nov 2017 12:38:38 +0100 Subject: [PATCH] Set the SourceManager flag to enable -fmodules-embed-all-files. This marks all files in the PCH/PCM transient. This allows clang to stream them back within the zip in the PCH rather than requiring the files to be physically present on disk. This should resolve an introduced regression which materializes if the files are moved/deleted after the generation of the PCH. --- lib/Interpreter/CIFactory.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/lib/Interpreter/CIFactory.cpp b/lib/Interpreter/CIFactory.cpp index 2a410ce1..b8a351f7 100644 --- a/lib/Interpreter/CIFactory.cpp +++ b/lib/Interpreter/CIFactory.cpp @@ -1043,6 +1043,9 @@ static void stringifyPreprocSetting(PreprocessorOptions& PPOpts, /*UserFilesAreVolatile*/ true); CI->setSourceManager(SM); // CI now owns SM + if (Invocation.getFrontendOpts().ModulesEmbedAllFiles) + CI->getSourceManager().setAllFilesAreTransient(true); + // As main file we want // * a virtual file that is claiming to be huge // * with an empty memory buffer attached (to bring the content)