clang 10.0.0git

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