clang  6.0.0svn
SemaConsumer.h
Go to the documentation of this file.
1 //===--- SemaConsumer.h - Abstract interface for AST semantics --*- C++ -*-===//
2 //
3 // The LLVM Compiler Infrastructure
4 //
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
7 //
8 //===----------------------------------------------------------------------===//
9 //
10 // This file defines the SemaConsumer class, a subclass of
11 // ASTConsumer that is used by AST clients that also require
12 // additional semantic analysis.
13 //
14 //===----------------------------------------------------------------------===//
15 #ifndef LLVM_CLANG_SEMA_SEMACONSUMER_H
16 #define LLVM_CLANG_SEMA_SEMACONSUMER_H
17 
18 #include "clang/AST/ASTConsumer.h"
19 
20 namespace clang {
21  class Sema;
22 
23  /// \brief An abstract interface that should be implemented by
24  /// clients that read ASTs and then require further semantic
25  /// analysis of the entities in those ASTs.
26  class SemaConsumer : public ASTConsumer {
27  virtual void anchor();
28  public:
30  ASTConsumer::SemaConsumer = true;
31  }
32 
33  /// \brief Initialize the semantic consumer with the Sema instance
34  /// being used to perform semantic analysis on the abstract syntax
35  /// tree.
36  virtual void InitializeSema(Sema &S) {}
37 
38  /// \brief Inform the semantic consumer that Sema is no longer available.
39  virtual void ForgetSema() {}
40 
41  // isa/cast/dyn_cast support
42  static bool classof(const ASTConsumer *Consumer) {
43  return Consumer->SemaConsumer;
44  }
45  };
46 }
47 
48 #endif
static bool classof(const ASTConsumer *Consumer)
Definition: SemaConsumer.h:42
ASTConsumer - This is an abstract interface that should be implemented by clients that read ASTs...
Definition: ASTConsumer.h:34
An abstract interface that should be implemented by clients that read ASTs and then require further s...
Definition: SemaConsumer.h:26
virtual void ForgetSema()
Inform the semantic consumer that Sema is no longer available.
Definition: SemaConsumer.h:39
Sema - This implements semantic analysis and AST building for C.
Definition: Sema.h:274
virtual void InitializeSema(Sema &S)
Initialize the semantic consumer with the Sema instance being used to perform semantic analysis on th...
Definition: SemaConsumer.h:36
Dataflow Directional Tag Classes.