Add a CC1 option -verify-pch
This option will:
- load the given pch file
- verify it is not out of date by stat'ing dependencies, and
- return 0 on success and non-zero on error
llvm-svn: 200884
diff --git a/clang/lib/Frontend/FrontendActions.cpp b/clang/lib/Frontend/FrontendActions.cpp
index 0d78bf0..8b17460 100644
--- a/clang/lib/Frontend/FrontendActions.cpp
+++ b/clang/lib/Frontend/FrontendActions.cpp
@@ -320,6 +320,19 @@
return new ASTConsumer();
}
+ASTConsumer *VerifyPCHAction::CreateASTConsumer(CompilerInstance &CI,
+ StringRef InFile) {
+ return new ASTConsumer();
+}
+
+void VerifyPCHAction::ExecuteAction() {
+ getCompilerInstance().
+ createPCHExternalASTSource(getCurrentFile(), /*DisablePCHValidation*/false,
+ /*AllowPCHWithCompilerErrors*/false,
+ /*AllowConfigurationMismatch*/true,
+ /*DeserializationListener*/0);
+}
+
namespace {
/// \brief AST reader listener that dumps module information for a module
/// file.