r205773 - Have validate-system-headers override validate-once-per-build-session

Ben Langmuir blangmuir at apple.com
Tue Apr 8 08:36:28 PDT 2014


Author: benlangmuir
Date: Tue Apr  8 10:36:28 2014
New Revision: 205773

URL: http://llvm.org/viewvc/llvm-project?rev=205773&view=rev
Log:
Have validate-system-headers override validate-once-per-build-session

Modified:
    cfe/trunk/lib/Serialization/ASTReader.cpp
    cfe/trunk/test/Modules/validate-system-headers.m

Modified: cfe/trunk/lib/Serialization/ASTReader.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Serialization/ASTReader.cpp?rev=205773&r1=205772&r2=205773&view=diff
==============================================================================
--- cfe/trunk/lib/Serialization/ASTReader.cpp (original)
+++ cfe/trunk/lib/Serialization/ASTReader.cpp Tue Apr  8 10:36:28 2014
@@ -2117,7 +2117,7 @@ ASTReader::ReadControlBlock(ModuleFile &
       unsigned NumUserInputs = Record[1];
 
       if (!DisableValidation &&
-          (!HSOpts.ModulesValidateOncePerBuildSession ||
+          (ValidateSystemInputs || !HSOpts.ModulesValidateOncePerBuildSession ||
            F.InputFilesValidationTimestamp <= HSOpts.BuildSessionTimestamp)) {
         bool Complain = (ClientLoadCapabilities & ARR_OutOfDate) == 0;
 

Modified: cfe/trunk/test/Modules/validate-system-headers.m
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Modules/validate-system-headers.m?rev=205773&r1=205772&r2=205773&view=diff
==============================================================================
--- cfe/trunk/test/Modules/validate-system-headers.m (original)
+++ cfe/trunk/test/Modules/validate-system-headers.m Tue Apr  8 10:36:28 2014
@@ -20,6 +20,24 @@
 // RUN: %clang_cc1 -triple x86_64-apple-darwin10 -isysroot %t/Inputs -fmodules -fmodules-validate-system-headers -fmodules-cache-path=%t/ModuleCache -fdisable-module-hash -x objective-c-header -fsyntax-only %s
 // RUN: not diff %t/ModuleCache/Foo.pcm %t/Foo.pcm.saved
 
+
+////
+// This should override -fmodules-validate-once-per-build-session
+// RUN: cp %t/ModuleCache/Foo.pcm %t/Foo.pcm.saved
+// RUN: %clang_cc1 -triple x86_64-apple-darwin10 -isysroot %t/Inputs -fmodules -fmodules-cache-path=%t/ModuleCache -fdisable-module-hash -x objective-c-header -fsyntax-only %s -fbuild-session-timestamp=1390000000 -fmodules-validate-once-per-build-session
+// RUN: diff %t/ModuleCache/Foo.pcm %t/Foo.pcm.saved
+
+// Modify the system header...
+// RUN: echo ' ' >> %t/Inputs/usr/include/foo.h
+
+// Don't recompile due to -fmodules-validate-once-per-build-session
+// RUN: %clang_cc1 -triple x86_64-apple-darwin10 -isysroot %t/Inputs -fmodules -fmodules-cache-path=%t/ModuleCache -fdisable-module-hash -x objective-c-header -fsyntax-only %s -fbuild-session-timestamp=1390000000 -fmodules-validate-once-per-build-session
+// RUN: diff %t/ModuleCache/Foo.pcm %t/Foo.pcm.saved
+
+// Now add -fmodules-validate-system-headers and rebuild
+// RUN: %clang_cc1 -triple x86_64-apple-darwin10 -isysroot %t/Inputs -fmodules -fmodules-validate-system-headers -fmodules-cache-path=%t/ModuleCache -fdisable-module-hash -x objective-c-header -fsyntax-only %s -fbuild-session-timestamp=1390000000 -fmodules-validate-once-per-build-session
+// RUN: not diff %t/ModuleCache/Foo.pcm %t/Foo.pcm.saved
+
 // REQUIRES: shell
 
 @import Foo;





More information about the cfe-commits mailing list