[PCH/Modules] Check that the specific module cache path the PCH was built with, is the same as

the one in the current compiler invocation. If they differ reject the PCH.

This protects against the badness occurring from getting modules loaded from different module caches (see crashes).

rdar://19889860

llvm-svn: 229909
This commit is contained in:
Argyrios Kyrtzidis
2015-02-19 20:12:20 +00:00
parent dfedfeb298
commit bd0b651bd2
14 changed files with 100 additions and 21 deletions

View File

@@ -501,9 +501,11 @@ namespace {
}
bool ReadHeaderSearchOptions(const HeaderSearchOptions &HSOpts,
StringRef SpecificModuleCachePath,
bool Complain) override {
Out.indent(2) << "Header search options:\n";
Out.indent(4) << "System root [-isysroot=]: '" << HSOpts.Sysroot << "'\n";
Out.indent(4) << "Module Cache: '" << SpecificModuleCachePath << "'\n";
DUMP_BOOLEAN(HSOpts.UseBuiltinIncludes,
"Use builtin include directories [-nobuiltininc]");
DUMP_BOOLEAN(HSOpts.UseStandardSystemIncludes,