aboutsummaryrefslogtreecommitdiff
path: root/include/clang/Frontend/CompilerInstance.h
diff options
context:
space:
mode:
authorDaniel Dunbar <daniel@zuster.org>2009-11-14 02:47:17 +0000
committerDaniel Dunbar <daniel@zuster.org>2009-11-14 02:47:17 +0000
commit12ce6943aae499225708ecf364c5a8b0a3269c87 (patch)
tree10f58d33b29ac62af08b1a54de81a42a49358348 /include/clang/Frontend/CompilerInstance.h
parent182f2681e75565c9ec3099c90bbc4fcc7782140c (diff)
Add ASTConsumer to CompilerInstance.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@88743 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/clang/Frontend/CompilerInstance.h')
-rw-r--r--include/clang/Frontend/CompilerInstance.h23
1 files changed, 23 insertions, 0 deletions
diff --git a/include/clang/Frontend/CompilerInstance.h b/include/clang/Frontend/CompilerInstance.h
index ee0c3c02f2..5e347061cc 100644
--- a/include/clang/Frontend/CompilerInstance.h
+++ b/include/clang/Frontend/CompilerInstance.h
@@ -25,6 +25,7 @@ class raw_fd_ostream;
namespace clang {
class ASTContext;
+class ASTConsumer;
class CodeCompleteConsumer;
class Diagnostic;
class DiagnosticClient;
@@ -82,6 +83,9 @@ class CompilerInstance {
/// The AST context.
llvm::OwningPtr<ASTContext> Context;
+ /// The AST consumer.
+ llvm::OwningPtr<ASTConsumer> Consumer;
+
/// The code completion consumer.
llvm::OwningPtr<CodeCompleteConsumer> CompletionConsumer;
@@ -312,6 +316,25 @@ public:
void setASTContext(ASTContext *Value);
/// }
+ /// @name ASTConsumer
+ /// {
+
+ bool hasASTConsumer() const { return Consumer != 0; }
+
+ ASTConsumer &getASTConsumer() const {
+ assert(Consumer && "Compiler instance has no AST consumer!");
+ return *Consumer;
+ }
+
+ /// takeASTConsumer - Remove the current AST consumer and give ownership to
+ /// the caller.
+ ASTConsumer *takeASTConsumer() { return Consumer.take(); }
+
+ /// setASTConsumer - Replace the current AST consumer; the compiler instance
+ /// takes ownership of \arg Value.
+ void setASTConsumer(ASTConsumer *Value);
+
+ /// }
/// @name Code Completion
/// {