Get the number of errors reported from the diagnostic client, in clang_parseTranslationUnit_Impl.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@119745 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/tools/libclang/CIndex.cpp b/tools/libclang/CIndex.cpp
index 0080760..9137172 100644
--- a/tools/libclang/CIndex.cpp
+++ b/tools/libclang/CIndex.cpp
@@ -2219,7 +2219,7 @@
     Args.push_back("-detailed-preprocessing-record");
   }
   
-  unsigned NumErrors = Diags->getNumErrors();
+  unsigned NumErrors = Diags->getClient()->getNumErrors();
   llvm::OwningPtr<ASTUnit> Unit(
     ASTUnit::LoadFromCommandLine(Args.data(), Args.data() + Args.size(),
                                  Diags,
@@ -2234,7 +2234,7 @@
                                  CXXPrecompilePreamble,
                                  CXXChainedPCH));
 
-  if (NumErrors != Diags->getNumErrors()) {
+  if (NumErrors != Diags->getClient()->getNumErrors()) {
     // Make sure to check that 'Unit' is non-NULL.
     if (CXXIdx->getDisplayDiagnostics() && Unit.get()) {
       for (ASTUnit::stored_diag_iterator D = Unit->stored_diag_begin(),