Change ASTUnit to take the Diagnostic as an argument, the client should have control of this.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@82430 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/tools/wpa/clang-wpa.cpp b/tools/wpa/clang-wpa.cpp
index 2cdc1c6..fa2326d 100644
--- a/tools/wpa/clang-wpa.cpp
+++ b/tools/wpa/clang-wpa.cpp
@@ -15,6 +15,8 @@
#include "clang/Analysis/CallGraph.h"
#include "clang/Basic/FileManager.h"
+#include "clang/Basic/SourceManager.h"
+#include "clang/Frontend/TextDiagnosticBuffer.h"
#include "llvm/Support/CommandLine.h"
#include "llvm/Support/raw_ostream.h"
using namespace clang;
@@ -31,13 +33,16 @@
if (InputFilenames.empty())
return 0;
+ TextDiagnosticBuffer DiagClient;
+ Diagnostic Diags(&DiagClient);
+
for (unsigned i = 0, e = InputFilenames.size(); i != e; ++i) {
const std::string &InFile = InputFilenames[i];
std::string ErrMsg;
llvm::OwningPtr<ASTUnit> AST;
- AST.reset(ASTUnit::LoadFromPCHFile(InFile, FileMgr, &ErrMsg));
+ AST.reset(ASTUnit::LoadFromPCHFile(InFile, Diags, FileMgr, &ErrMsg));
if (!AST) {
llvm::errs() << "[" << InFile << "] error: " << ErrMsg << '\n';