clang 22.0.0git
Classes | Public Member Functions | Protected Attributes | List of all members
cir::CIRGenerator Class Reference

#include "clang/CIR/CIRGenerator.h"

Inheritance diagram for cir::CIRGenerator:
[legend]

Public Member Functions

 CIRGenerator (clang::DiagnosticsEngine &diags, llvm::IntrusiveRefCntPtr< llvm::vfs::FileSystem > fs, const clang::CodeGenOptions &cgo)
 
 ~CIRGenerator () override
 
void Initialize (clang::ASTContext &astContext) override
 Initialize - This is called to initialize the consumer, providing the ASTContext.
 
bool HandleTopLevelDecl (clang::DeclGroupRef group) override
 HandleTopLevelDecl - Handle the specified top-level declaration.
 
void HandleTranslationUnit (clang::ASTContext &astContext) override
 HandleTranslationUnit - This method is called when the ASTs for entire translation unit have been parsed.
 
void HandleInlineFunctionDefinition (clang::FunctionDecl *d) override
 This callback is invoked each time an inline (method or friend) function definition in a class is completed.
 
void HandleTagDeclDefinition (clang::TagDecl *d) override
 HandleTagDeclDefinition - This callback is invoked each time a TagDecl to (e.g.
 
void HandleTagDeclRequiredDefinition (const clang::TagDecl *D) override
 This callback is invoked the first time each TagDecl is required to be complete.
 
void HandleCXXStaticMemberVarInstantiation (clang::VarDecl *D) override
 HandleCXXStaticMemberVarInstantiation - Tell the consumer that this.
 
void CompleteTentativeDefinition (clang::VarDecl *d) override
 CompleteTentativeDefinition - Callback invoked at the end of a translation unit to notify the consumer that the given tentative definition should be completed.
 
void HandleVTable (clang::CXXRecordDecl *rd) override
 Callback involved at the end of a translation unit to notify the consumer that a vtable for the given C++ class is required.
 
mlir::ModuleOp getModule () const
 
mlir::MLIRContext & getMLIRContext ()
 
const mlir::MLIRContext & getMLIRContext () const
 
bool verifyModule () const
 
void emitDeferredDecls ()
 
- Public Member Functions inherited from clang::ASTConsumer
 ASTConsumer ()=default
 
virtual ~ASTConsumer ()
 
virtual void Initialize (ASTContext &Context)
 Initialize - This is called to initialize the consumer, providing the ASTContext.
 
virtual bool HandleTopLevelDecl (DeclGroupRef D)
 HandleTopLevelDecl - Handle the specified top-level declaration.
 
virtual void HandleInlineFunctionDefinition (FunctionDecl *D)
 This callback is invoked each time an inline (method or friend) function definition in a class is completed.
 
virtual void HandleInterestingDecl (DeclGroupRef D)
 HandleInterestingDecl - Handle the specified interesting declaration.
 
virtual void HandleTranslationUnit (ASTContext &Ctx)
 HandleTranslationUnit - This method is called when the ASTs for entire translation unit have been parsed.
 
virtual void HandleTagDeclDefinition (TagDecl *D)
 HandleTagDeclDefinition - This callback is invoked each time a TagDecl (e.g.
 
virtual void HandleTagDeclRequiredDefinition (const TagDecl *D)
 This callback is invoked the first time each TagDecl is required to be complete.
 
virtual void HandleCXXImplicitFunctionInstantiation (FunctionDecl *D)
 Invoked when a function is implicitly instantiated.
 
virtual void HandleTopLevelDeclInObjCContainer (DeclGroupRef D)
 Handle the specified top-level declaration that occurred inside and ObjC container.
 
virtual void HandleImplicitImportDecl (ImportDecl *D)
 Handle an ImportDecl that was implicitly created due to an inclusion directive.
 
virtual void CompleteTentativeDefinition (VarDecl *D)
 CompleteTentativeDefinition - Callback invoked at the end of a translation unit to notify the consumer that the given tentative definition should be completed.
 
virtual void CompleteExternalDeclaration (DeclaratorDecl *D)
 CompleteExternalDeclaration - Callback invoked at the end of a translation unit to notify the consumer that the given external declaration should be completed.
 
virtual void AssignInheritanceModel (CXXRecordDecl *RD)
 Callback invoked when an MSInheritanceAttr has been attached to a CXXRecordDecl.
 
virtual void HandleCXXStaticMemberVarInstantiation (VarDecl *D)
 HandleCXXStaticMemberVarInstantiation - Tell the consumer that this.
 
virtual void HandleVTable (CXXRecordDecl *RD)
 Callback involved at the end of a translation unit to notify the consumer that a vtable for the given C++ class is required.
 
virtual ASTMutationListenerGetASTMutationListener ()
 If the consumer is interested in entities getting modified after their initial creation, it should return a pointer to an ASTMutationListener here.
 
virtual ASTDeserializationListenerGetASTDeserializationListener ()
 If the consumer is interested in entities being deserialized from AST files, it should return a pointer to a ASTDeserializationListener here.
 
virtual void PrintStats ()
 PrintStats - If desired, print any statistics.
 
virtual bool shouldSkipFunctionBody (Decl *D)
 This callback is called for each function if the Parser was initialized with SkipFunctionBodies set to true.
 

Protected Attributes

std::unique_ptr< mlir::MLIRContext > mlirContext
 
std::unique_ptr< clang::CIRGen::CIRGenModulecgm
 

Detailed Description

Definition at line 37 of file CIRGenerator.h.

Constructor & Destructor Documentation

◆ CIRGenerator()

CIRGenerator::CIRGenerator ( clang::DiagnosticsEngine diags,
llvm::IntrusiveRefCntPtr< llvm::vfs::FileSystem >  fs,
const clang::CodeGenOptions cgo 
)

Definition at line 30 of file CIRGenerator.cpp.

◆ ~CIRGenerator()

CIRGenerator::~CIRGenerator ( )
override

Definition at line 35 of file CIRGenerator.cpp.

References clang::DiagnosticsEngine::hasErrorOccurred().

Member Function Documentation

◆ CompleteTentativeDefinition()

void CIRGenerator::CompleteTentativeDefinition ( clang::VarDecl D)
overridevirtual

CompleteTentativeDefinition - Callback invoked at the end of a translation unit to notify the consumer that the given tentative definition should be completed.

The variable declaration itself will be a tentative definition. If it had an incomplete array type, its type will have already been changed to an array of size 1. However, the declaration remains a tentative definition and has not been modified by the introduction of an implicit zero initializer.

Reimplemented from clang::ASTConsumer.

Definition at line 169 of file CIRGenerator.cpp.

References cgm, and clang::DiagnosticsEngine::hasErrorOccurred().

◆ emitDeferredDecls()

void CIRGenerator::emitDeferredDecls ( )

Definition at line 117 of file CIRGenerator.cpp.

References cgm.

◆ getMLIRContext() [1/2]

mlir::MLIRContext & cir::CIRGenerator::getMLIRContext ( )
inline

Definition at line 88 of file CIRGenerator.h.

References mlirContext.

◆ getMLIRContext() [2/2]

const mlir::MLIRContext & cir::CIRGenerator::getMLIRContext ( ) const
inline

Definition at line 89 of file CIRGenerator.h.

References mlirContext.

◆ getModule()

mlir::ModuleOp CIRGenerator::getModule ( ) const

Definition at line 72 of file CIRGenerator.cpp.

References cgm.

◆ HandleCXXStaticMemberVarInstantiation()

void CIRGenerator::HandleCXXStaticMemberVarInstantiation ( clang::VarDecl D)
overridevirtual

HandleCXXStaticMemberVarInstantiation - Tell the consumer that this.

Reimplemented from clang::ASTConsumer.

Definition at line 162 of file CIRGenerator.cpp.

References cgm, D, and clang::DiagnosticsEngine::hasErrorOccurred().

◆ HandleInlineFunctionDefinition()

void CIRGenerator::HandleInlineFunctionDefinition ( clang::FunctionDecl D)
overridevirtual

This callback is invoked each time an inline (method or friend) function definition in a class is completed.

Reimplemented from clang::ASTConsumer.

Definition at line 96 of file CIRGenerator.cpp.

References cir::MissingFeatures::coverageMapping(), clang::FunctionDecl::doesThisDeclarationHaveABody(), and clang::DiagnosticsEngine::hasErrorOccurred().

◆ HandleTagDeclDefinition()

void CIRGenerator::HandleTagDeclDefinition ( clang::TagDecl d)
overridevirtual

HandleTagDeclDefinition - This callback is invoked each time a TagDecl to (e.g.

struct, union, enum, class) is completed. This allows the client to hack on the type, which can occur at any point in the file (because these can be defined in declspecs).

Reimplemented from clang::ASTConsumer.

Definition at line 136 of file CIRGenerator.cpp.

References cgm, clang::TargetInfo::getCXXABI(), clang::ASTContext::getLangOpts(), clang::TagDecl::getSourceRange(), clang::ASTContext::getTargetInfo(), clang::DiagnosticsEngine::hasErrorOccurred(), and clang::TargetCXXABI::isMicrosoft().

◆ HandleTagDeclRequiredDefinition()

void CIRGenerator::HandleTagDeclRequiredDefinition ( const clang::TagDecl D)
overridevirtual

This callback is invoked the first time each TagDecl is required to be complete.

Reimplemented from clang::ASTConsumer.

Definition at line 155 of file CIRGenerator.cpp.

References cir::MissingFeatures::generateDebugInfo(), and clang::DiagnosticsEngine::hasErrorOccurred().

◆ HandleTopLevelDecl()

bool CIRGenerator::HandleTopLevelDecl ( clang::DeclGroupRef  D)
overridevirtual

HandleTopLevelDecl - Handle the specified top-level declaration.

This is called by the parser to process every top-level Decl*.

Returns
true to continue parsing, or false to abort parsing.

Reimplemented from clang::ASTConsumer.

Definition at line 74 of file CIRGenerator.cpp.

References cgm, clang::ast_matchers::decl, and clang::DiagnosticsEngine::hasUnrecoverableErrorOccurred().

◆ HandleTranslationUnit()

void CIRGenerator::HandleTranslationUnit ( clang::ASTContext Ctx)
overridevirtual

HandleTranslationUnit - This method is called when the ASTs for entire translation unit have been parsed.

Reimplemented from clang::ASTConsumer.

Definition at line 86 of file CIRGenerator.cpp.

References cgm, cir::MissingFeatures::cleanupAfterErrorDiags(), and clang::DiagnosticsEngine::hasErrorOccurred().

◆ HandleVTable()

void CIRGenerator::HandleVTable ( clang::CXXRecordDecl RD)
overridevirtual

Callback involved at the end of a translation unit to notify the consumer that a vtable for the given C++ class is required.

Parameters
RDThe class whose vtable was used.

Reimplemented from clang::ASTConsumer.

Definition at line 176 of file CIRGenerator.cpp.

References cgm, and clang::DiagnosticsEngine::hasErrorOccurred().

◆ Initialize()

void CIRGenerator::Initialize ( clang::ASTContext Context)
overridevirtual

Initialize - This is called to initialize the consumer, providing the ASTContext.

Reimplemented from clang::ASTConsumer.

Definition at line 47 of file CIRGenerator.cpp.

References cgm, clang::TargetInfo::getDataLayoutString(), clang::ASTContext::getTargetInfo(), mlirContext, cir::acc::registerOpenACCExtensions(), and setMLIRDataLayout().

◆ verifyModule()

bool CIRGenerator::verifyModule ( ) const

Definition at line 70 of file CIRGenerator.cpp.

References cgm.

Member Data Documentation

◆ cgm

std::unique_ptr<clang::CIRGen::CIRGenModule> cir::CIRGenerator::cgm
protected

◆ mlirContext

std::unique_ptr<mlir::MLIRContext> cir::CIRGenerator::mlirContext
protected

Definition at line 66 of file CIRGenerator.h.

Referenced by getMLIRContext(), and Initialize().


The documentation for this class was generated from the following files: