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/lib/Frontend/ASTUnit.cpp b/lib/Frontend/ASTUnit.cpp
index 7243f70..38aeedc 100644
--- a/lib/Frontend/ASTUnit.cpp
+++ b/lib/Frontend/ASTUnit.cpp
@@ -36,8 +36,10 @@
using namespace clang;
ASTUnit::ASTUnit(Diagnostic &Diag, bool _MainFileIsAST)
- : SourceMgr(Diag), MainFileIsAST(_MainFileIsAST),
+ : MainFileIsAST(_MainFileIsAST),
ConcurrencyCheckValue(CheckUnlocked) {
+ FileMgr.reset(new FileManager);
+ SourceMgr.reset(new SourceManager(Diag));
}
ASTUnit::~ASTUnit() {
ConcurrencyCheckValue = CheckLocked;
@@ -153,7 +155,7 @@
// If requested, capture diagnostics in the ASTUnit.
CaptureDroppedDiagnostics Capture(CaptureDiagnostics, Diags,
- AST->Diagnostics);
+ AST->StoredDiagnostics);
for (unsigned I = 0; I != NumRemappedFiles; ++I) {
// Create the file entry for the file that we're mapping from.
@@ -317,7 +319,7 @@
// Capture any diagnostics that would otherwise be dropped.
CaptureDroppedDiagnostics Capture(CaptureDiagnostics,
Clang.getDiagnostics(),
- AST->Diagnostics);
+ AST->StoredDiagnostics);
// Create a file manager object to provide access to and cache the filesystem.
Clang.setFileManager(&AST->getFileManager());