summaryrefslogtreecommitdiffstats
path: root/clang/lib/Serialization/ASTReader.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'clang/lib/Serialization/ASTReader.cpp')
-rw-r--r--clang/lib/Serialization/ASTReader.cpp10
1 files changed, 8 insertions, 2 deletions
diff --git a/clang/lib/Serialization/ASTReader.cpp b/clang/lib/Serialization/ASTReader.cpp
index 4d2a4008888..96d40440096 100644
--- a/clang/lib/Serialization/ASTReader.cpp
+++ b/clang/lib/Serialization/ASTReader.cpp
@@ -1831,9 +1831,13 @@ ASTReader::ReadControlBlock(ModuleFile &F,
// Validate all of the non-system input files.
if (!DisableValidation) {
bool Complain = (ClientLoadCapabilities & ARR_OutOfDate) == 0;
- // All user input files reside at the index range [0, Record[1]).
+ // All user input files reside at the index range [0, Record[1]), and
+ // system input files reside at [Record[1], Record[0]).
// Record is the one from INPUT_FILE_OFFSETS.
- for (unsigned I = 0, N = Record[1]; I < N; ++I) {
+ unsigned NumInputs = Record[0];
+ unsigned NumUserInputs = Record[1];
+ unsigned N = ValidateSystemInputs ? NumInputs : NumUserInputs;
+ for (unsigned I = 0; I < N; ++I) {
InputFile IF = getInputFile(F, I+1, Complain);
if (!IF.getFile() || IF.isOutOfDate())
return OutOfDate;
@@ -7620,6 +7624,7 @@ ASTReader::ASTReader(Preprocessor &PP, ASTContext &Context,
StringRef isysroot, bool DisableValidation,
bool AllowASTWithCompilerErrors,
bool AllowConfigurationMismatch,
+ bool ValidateSystemInputs,
bool UseGlobalIndex)
: Listener(new PCHValidator(PP, *this)), DeserializationListener(0),
SourceMgr(PP.getSourceManager()), FileMgr(PP.getFileManager()),
@@ -7628,6 +7633,7 @@ ASTReader::ASTReader(Preprocessor &PP, ASTContext &Context,
isysroot(isysroot), DisableValidation(DisableValidation),
AllowASTWithCompilerErrors(AllowASTWithCompilerErrors),
AllowConfigurationMismatch(AllowConfigurationMismatch),
+ ValidateSystemInputs(ValidateSystemInputs),
UseGlobalIndex(UseGlobalIndex), TriedLoadingGlobalIndex(false),
CurrentGeneration(0), CurrSwitchCaseStmts(&SwitchCaseStmts),
NumSLocEntriesRead(0), TotalNumSLocEntries(0),
OpenPOWER on IntegriCloud