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.
diff --git a/tools/CIndex/CIndexDiagnostic.cpp b/tools/CIndex/CIndexDiagnostic.cpp
index 0314a67..bcf066d 100644
--- a/tools/CIndex/CIndexDiagnostic.cpp
+++ b/tools/CIndex/CIndexDiagnostic.cpp
@@ -32,15 +32,15 @@
unsigned clang_getNumDiagnostics(CXTranslationUnit Unit) {
ASTUnit *CXXUnit = static_cast<ASTUnit *>(Unit);
- return CXXUnit? CXXUnit->diag_size() : 0;
+ return CXXUnit? CXXUnit->stored_diag_size() : 0;
}
CXDiagnostic clang_getDiagnostic(CXTranslationUnit Unit, unsigned Index) {
ASTUnit *CXXUnit = static_cast<ASTUnit *>(Unit);
- if (!CXXUnit || Index >= CXXUnit->diag_size())
+ if (!CXXUnit || Index >= CXXUnit->stored_diag_size())
return 0;
- return new CXStoredDiagnostic(CXXUnit->diag_begin()[Index],
+ return new CXStoredDiagnostic(CXXUnit->stored_diag_begin()[Index],
CXXUnit->getASTContext().getLangOptions());
}