diff options
author | Douglas Gregor <dgregor@apple.com> | 2010-04-05 18:10:21 +0000 |
---|---|---|
committer | Douglas Gregor <dgregor@apple.com> | 2010-04-05 18:10:21 +0000 |
commit | 405634b215f19eec7183bd8005e34aa5a02f64a1 (patch) | |
tree | 015649c8730c7df88c14c68171955a1bbc1a6091 /lib/Frontend/ASTUnit.cpp | |
parent | 2eec0b2e3e931de6cefbb266a7652a0622fe95b2 (diff) |
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
Diffstat (limited to 'lib/Frontend/ASTUnit.cpp')
-rw-r--r-- | lib/Frontend/ASTUnit.cpp | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/lib/Frontend/ASTUnit.cpp b/lib/Frontend/ASTUnit.cpp index 7243f709cc..38aeedc39a 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 @@ ASTUnit *ASTUnit::LoadFromPCHFile(const std::string &Filename, // 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 @@ ASTUnit *ASTUnit::LoadFromCompilerInvocation(CompilerInvocation *CI, // 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()); |