clang 22.0.0git
|
#include "clang/CIR/CIRGenerator.h"
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 () |
![]() | |
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 ASTMutationListener * | GetASTMutationListener () |
If the consumer is interested in entities getting modified after their initial creation, it should return a pointer to an ASTMutationListener here. | |
virtual ASTDeserializationListener * | GetASTDeserializationListener () |
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::CIRGenModule > | cgm |
Definition at line 37 of file CIRGenerator.h.
CIRGenerator::CIRGenerator | ( | clang::DiagnosticsEngine & | diags, |
llvm::IntrusiveRefCntPtr< llvm::vfs::FileSystem > | fs, | ||
const clang::CodeGenOptions & | cgo | ||
) |
Definition at line 30 of file CIRGenerator.cpp.
|
override |
Definition at line 35 of file CIRGenerator.cpp.
References clang::DiagnosticsEngine::hasErrorOccurred().
|
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().
void CIRGenerator::emitDeferredDecls | ( | ) |
Definition at line 117 of file CIRGenerator.cpp.
References cgm.
|
inline |
Definition at line 88 of file CIRGenerator.h.
References mlirContext.
|
inline |
Definition at line 89 of file CIRGenerator.h.
References mlirContext.
mlir::ModuleOp CIRGenerator::getModule | ( | ) | const |
Definition at line 72 of file CIRGenerator.cpp.
References cgm.
|
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().
|
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().
|
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().
|
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().
|
overridevirtual |
HandleTopLevelDecl - Handle the specified top-level declaration.
This is called by the parser to process every top-level Decl*.
Reimplemented from clang::ASTConsumer.
Definition at line 74 of file CIRGenerator.cpp.
References cgm, clang::ast_matchers::decl, and clang::DiagnosticsEngine::hasUnrecoverableErrorOccurred().
|
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().
|
overridevirtual |
Callback involved at the end of a translation unit to notify the consumer that a vtable for the given C++ class is required.
RD | The class whose vtable was used. |
Reimplemented from clang::ASTConsumer.
Definition at line 176 of file CIRGenerator.cpp.
References cgm, and clang::DiagnosticsEngine::hasErrorOccurred().
|
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().
bool CIRGenerator::verifyModule | ( | ) | const |
Definition at line 70 of file CIRGenerator.cpp.
References cgm.
|
protected |
Definition at line 67 of file CIRGenerator.h.
Referenced by CompleteTentativeDefinition(), emitDeferredDecls(), getModule(), HandleCXXStaticMemberVarInstantiation(), HandleTagDeclDefinition(), HandleTopLevelDecl(), HandleTranslationUnit(), HandleVTable(), Initialize(), and verifyModule().
|
protected |
Definition at line 66 of file CIRGenerator.h.
Referenced by getMLIRContext(), and Initialize().