Fix regression in Diagnostic that caused it to not register the number
of errors.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@49686 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/Basic/Diagnostic.cpp b/lib/Basic/Diagnostic.cpp
index 77984d6..5835e75 100644
--- a/lib/Basic/Diagnostic.cpp
+++ b/lib/Basic/Diagnostic.cpp
@@ -209,6 +209,9 @@
   // If the client doesn't care about this message, don't issue it.
   if (DiagLevel == Diagnostic::Ignored)
     return;
+  
+  // Set the diagnostic client if it isn't set already.
+  if (!C) C = &Client;
 
   // If this is not an error and we are in a system header, ignore it.  We have
   // to check on the original class here, because we also want to ignore
@@ -228,8 +231,6 @@
 
   // Finally, report it.
   
-  if (!C) C = &Client;
-  
   C->HandleDiagnostic(*this, DiagLevel, Pos, (diag::kind)DiagID,
                       Strs, NumStrs, Ranges, NumRanges);