diff options
author | Steve Naroff <snaroff@apple.com> | 2009-10-19 14:34:22 +0000 |
---|---|---|
committer | Steve Naroff <snaroff@apple.com> | 2009-10-19 14:34:22 +0000 |
commit | 36c4464ba6cfc2a63dc67c493ef2f5ab2aea09cc (patch) | |
tree | 1c632799acfc9070271462b1425237f4820957a8 /include/clang/Frontend | |
parent | bade7de59dff22fdb6a53291366da1973a919f10 (diff) |
Move Diagnostic/DiagClient/FileManager from Indexer => ASTUnit.
Removing this shared data should enable clang_createTranslationUnit/clang_createTranslationUnitFromSourceFile to be run from multiple threads (related to <rdar://problem/7303432>).
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@84499 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/clang/Frontend')
-rw-r--r-- | include/clang/Frontend/ASTUnit.h | 16 |
1 files changed, 11 insertions, 5 deletions
diff --git a/include/clang/Frontend/ASTUnit.h b/include/clang/Frontend/ASTUnit.h index dd3db39343..9a0ede6ca3 100644 --- a/include/clang/Frontend/ASTUnit.h +++ b/include/clang/Frontend/ASTUnit.h @@ -16,6 +16,8 @@ #include "clang/Basic/SourceManager.h" #include "llvm/ADT/OwningPtr.h" +#include "clang/Frontend/TextDiagnosticBuffer.h" +#include "clang/Basic/FileManager.h" #include <string> namespace clang { @@ -23,6 +25,7 @@ namespace clang { class FileEntry; class SourceManager; class Diagnostic; + class TextDiagnosticBuffer; class HeaderSearch; class TargetInfo; class Preprocessor; @@ -32,7 +35,10 @@ namespace clang { /// \brief Utility class for loading a ASTContext from a PCH file. /// class ASTUnit { - Diagnostic &Diags; + TextDiagnosticBuffer DiagClient; + Diagnostic Diags; + FileManager FileMgr; + SourceManager SourceMgr; llvm::OwningPtr<HeaderSearch> HeaderInfo; llvm::OwningPtr<TargetInfo> Target; @@ -47,7 +53,7 @@ class ASTUnit { ASTUnit(const ASTUnit&); // DO NOT IMPLEMENT ASTUnit &operator=(const ASTUnit &); // DO NOT IMPLEMENT - ASTUnit(Diagnostic &_Diag); + ASTUnit(); public: ~ASTUnit(); @@ -64,7 +70,9 @@ public: const Diagnostic &getDiagnostic() const { return Diags; } Diagnostic &getDiagnostic() { return Diags; } - FileManager &getFileManager(); + const FileManager &getFileManager() const { return FileMgr; } + FileManager &getFileManager() { return FileMgr; } + const std::string &getOriginalSourceFileName(); const std::string &getPCHFileName(); @@ -85,8 +93,6 @@ public: /// /// \returns - The initialized ASTUnit or null if the PCH failed to load. static ASTUnit *LoadFromPCHFile(const std::string &Filename, - Diagnostic &Diags, - FileManager &FileMgr, std::string *ErrMsg = 0, bool OnlyLocalDecls = false, bool UseBumpAllocator = false); |