Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-05-10 08:37:04

0001 //===--- SemaConsumer.h - Abstract interface for AST semantics --*- C++ -*-===//
0002 //
0003 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
0004 // See https://llvm.org/LICENSE.txt for license information.
0005 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
0006 //
0007 //===----------------------------------------------------------------------===//
0008 //
0009 //  This file defines the SemaConsumer class, a subclass of
0010 //  ASTConsumer that is used by AST clients that also require
0011 //  additional semantic analysis.
0012 //
0013 //===----------------------------------------------------------------------===//
0014 #ifndef LLVM_CLANG_SEMA_SEMACONSUMER_H
0015 #define LLVM_CLANG_SEMA_SEMACONSUMER_H
0016 
0017 #include "clang/AST/ASTConsumer.h"
0018 
0019 namespace clang {
0020   class Sema;
0021 
0022   /// An abstract interface that should be implemented by
0023   /// clients that read ASTs and then require further semantic
0024   /// analysis of the entities in those ASTs.
0025   class SemaConsumer : public ASTConsumer {
0026     virtual void anchor();
0027   public:
0028     SemaConsumer() {
0029       ASTConsumer::SemaConsumer = true;
0030     }
0031 
0032     /// Initialize the semantic consumer with the Sema instance
0033     /// being used to perform semantic analysis on the abstract syntax
0034     /// tree.
0035     virtual void InitializeSema(Sema &S) {}
0036 
0037     /// Inform the semantic consumer that Sema is no longer available.
0038     virtual void ForgetSema() {}
0039 
0040     // isa/cast/dyn_cast support
0041     static bool classof(const ASTConsumer *Consumer) {
0042       return Consumer->SemaConsumer;
0043     }
0044   };
0045 }
0046 
0047 #endif