clang-tools 19.0.0git
Public Member Functions | List of all members
clang::clangd::FeatureModule::ASTListener Struct Reference

Extension point that allows modules to observe and modify an AST build. More...

#include <FeatureModule.h>

Public Member Functions

virtual ~ASTListener ()=default
 Listeners are destroyed once the AST is built.
 
virtual void beforeExecute (CompilerInstance &CI)
 Called before every AST build, both for main file and preamble.
 
virtual void sawDiagnostic (const clang::Diagnostic &, clangd::Diag &)
 Called everytime a diagnostic is encountered.
 

Detailed Description

Extension point that allows modules to observe and modify an AST build.

One instance is created each time clangd produces a ParsedAST or PrecompiledPreamble. For a given instance, lifecycle methods are always called on a single thread.

Definition at line 106 of file FeatureModule.h.

Constructor & Destructor Documentation

◆ ~ASTListener()

virtual clang::clangd::FeatureModule::ASTListener::~ASTListener ( )
virtualdefault

Listeners are destroyed once the AST is built.

Member Function Documentation

◆ beforeExecute()

virtual void clang::clangd::FeatureModule::ASTListener::beforeExecute ( CompilerInstance &  CI)
inlinevirtual

Called before every AST build, both for main file and preamble.

The call happens immediately before FrontendAction::Execute(), with Preprocessor set up already and after BeginSourceFile() on main file was called.

Definition at line 113 of file FeatureModule.h.

◆ sawDiagnostic()

virtual void clang::clangd::FeatureModule::ASTListener::sawDiagnostic ( const clang::Diagnostic &  ,
clangd::Diag  
)
inlinevirtual

Called everytime a diagnostic is encountered.

Modules can use this modify the final diagnostic, or store some information to surface code actions later on.

Definition at line 118 of file FeatureModule.h.


The documentation for this struct was generated from the following file: