diff options
author | Douglas Gregor <dgregor@apple.com> | 2010-04-05 23:52:57 +0000 |
---|---|---|
committer | Douglas Gregor <dgregor@apple.com> | 2010-04-05 23:52:57 +0000 |
commit | 28019772db70d4547be05a042eb950bc910f134f (patch) | |
tree | 45835536240a6d2138eeabd8036ad956ce091b95 /include/clang/Frontend/CompilerInstance.h | |
parent | e9686572f17968048a5e097254f85c202ea44aec (diff) |
Make Diagnostic reference-counted, which is simpler than juggling
maybe-ownership vs. ownership.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@100498 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/clang/Frontend/CompilerInstance.h')
-rw-r--r-- | include/clang/Frontend/CompilerInstance.h | 11 |
1 files changed, 4 insertions, 7 deletions
diff --git a/include/clang/Frontend/CompilerInstance.h b/include/clang/Frontend/CompilerInstance.h index 3444b640f0..36720c9d14 100644 --- a/include/clang/Frontend/CompilerInstance.h +++ b/include/clang/Frontend/CompilerInstance.h @@ -11,6 +11,7 @@ #define LLVM_CLANG_FRONTEND_COMPILERINSTANCE_H_ #include "clang/Frontend/CompilerInvocation.h" +#include "llvm/ADT/IntrusiveRefCntPtr.h" #include "llvm/ADT/StringRef.h" #include "llvm/ADT/OwningPtr.h" #include <cassert> @@ -63,7 +64,7 @@ class CompilerInstance { llvm::OwningPtr<CompilerInvocation> Invocation; /// The diagnostics engine instance. - llvm::OwningPtr<Diagnostic> Diagnostics; + llvm::IntrusiveRefCntPtr<Diagnostic> Diagnostics; /// The diagnostics client instance. llvm::OwningPtr<DiagnosticClient> DiagClient; @@ -255,10 +256,6 @@ public: return *Diagnostics; } - /// takeDiagnostics - Remove the current diagnostics engine and give ownership - /// to the caller. - Diagnostic *takeDiagnostics() { return Diagnostics.take(); } - /// setDiagnostics - Replace the current diagnostics engine; the compiler /// instance takes ownership of \arg Value. void setDiagnostics(Diagnostic *Value); @@ -469,8 +466,8 @@ public: /// must extend past that of the diagnostic engine. /// /// \return The new object on success, or null on failure. - static Diagnostic *createDiagnostics(const DiagnosticOptions &Opts, - int Argc, char **Argv); + static llvm::IntrusiveRefCntPtr<Diagnostic> + createDiagnostics(const DiagnosticOptions &Opts, int Argc, char **Argv); /// Create the file manager and replace any existing one with it. void createFileManager(); |