Minor ASTUnit cleanups:
  - Rename "Diagnostics" and related to "StoredDiagnostics", to better
  capture what we're actually storing.
  - Move SourceManager and FileManager to the heap.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@100441 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/tools/CIndex/CIndex.cpp b/tools/CIndex/CIndex.cpp
index 2d9b2cb..9db5ba7 100644
--- a/tools/CIndex/CIndex.cpp
+++ b/tools/CIndex/CIndex.cpp
@@ -1064,8 +1064,8 @@
     if (NumErrors != Diags->getNumErrors()) {
       // Make sure to check that 'Unit' is non-NULL.
       if (CXXIdx->getDisplayDiagnostics() && Unit.get()) {
-        for (ASTUnit::diag_iterator D = Unit->diag_begin(), 
-                                 DEnd = Unit->diag_end();
+        for (ASTUnit::stored_diag_iterator D = Unit->stored_diag_begin(), 
+                                        DEnd = Unit->stored_diag_end();
              D != DEnd; ++D) {
           CXStoredDiagnostic Diag(*D, Unit->getASTContext().getLangOptions());
           CXString Msg = clang_formatDiagnostic(&Diag,
@@ -1179,7 +1179,7 @@
                               num_unsaved_files, unsaved_files,
                               ATU->getFileManager(),
                               ATU->getSourceManager(),
-                              ATU->getDiagnostics());
+                              ATU->getStoredDiagnostics());
   } else if (CXXIdx->getDisplayDiagnostics()) {
     // We failed to load the ASTUnit, but we can still deserialize the
     // diagnostics and emit them.