clang 20.0.0git
|
This class organizes the cross-function state that is used while generating CIR code. More...
#include "/home/buildbot/as-worker-4/publish-doxygen-docs/llvm-project/clang/lib/CIR/CodeGen/CIRGenModule.h"
Public Member Functions | |
CIRGenModule (mlir::MLIRContext &mlirContext, clang::ASTContext &astContext, const clang::CodeGenOptions &cgo, clang::DiagnosticsEngine &diags) | |
~CIRGenModule ()=default | |
mlir::ModuleOp | getModule () const |
CIRGenBuilderTy & | getBuilder () |
clang::ASTContext & | getASTContext () const |
CIRGenTypes & | getTypes () |
mlir::MLIRContext & | getMLIRContext () |
mlir::Location | getLoc (clang::SourceLocation cLoc) |
Helpers to convert the presumed location of Clang's SourceLocation to an MLIR Location. | |
mlir::Location | getLoc (clang::SourceRange cRange) |
void | emitTopLevelDecl (clang::Decl *decl) |
void | emitGlobal (clang::GlobalDecl gd) |
Emit code for a single global function or variable declaration. | |
void | emitGlobalDefinition (clang::GlobalDecl gd, mlir::Operation *op=nullptr) |
void | emitGlobalFunctionDefinition (clang::GlobalDecl gd, mlir::Operation *op) |
void | emitGlobalVarDefinition (const clang::VarDecl *vd, bool isTentative=false) |
DiagnosticBuilder | errorNYI (SourceLocation, llvm::StringRef) |
Helpers to emit "not yet implemented" error diagnostics. | |
template<typename T > | |
DiagnosticBuilder | errorNYI (SourceLocation loc, llvm::StringRef feature, const T &name) |
DiagnosticBuilder | errorNYI (SourceRange, llvm::StringRef) |
template<typename T > | |
DiagnosticBuilder | errorNYI (SourceRange loc, llvm::StringRef feature, const T &name) |
Public Member Functions inherited from clang::CIRGen::CIRGenTypeCache | |
CIRGenTypeCache ()=default | |
Additional Inherited Members | |
Public Attributes inherited from clang::CIRGen::CIRGenTypeCache | |
cir::VoidType | VoidTy |
cir::IntType | SInt8Ty |
cir::IntType | SInt16Ty |
cir::IntType | SInt32Ty |
cir::IntType | SInt64Ty |
cir::IntType | SInt128Ty |
cir::IntType | UInt8Ty |
cir::IntType | UInt16Ty |
cir::IntType | UInt32Ty |
cir::IntType | UInt64Ty |
cir::IntType | UInt128Ty |
cir::FP16Type | FP16Ty |
cir::BF16Type | BFloat16Ty |
cir::SingleType | FloatTy |
cir::DoubleType | DoubleTy |
cir::FP80Type | FP80Ty |
cir::FP128Type | FP128Ty |
This class organizes the cross-function state that is used while generating CIR code.
Definition at line 39 of file CIRGenModule.h.
CIRGenModule::CIRGenModule | ( | mlir::MLIRContext & | mlirContext, |
clang::ASTContext & | astContext, | ||
const clang::CodeGenOptions & | cgo, | ||
clang::DiagnosticsEngine & | diags | ||
) |
Definition at line 28 of file CIRGenModule.cpp.
References clang::CIRGen::CIRGenTypeCache::BFloat16Ty, clang::CIRGen::CIRGenTypeCache::DoubleTy, clang::CIRGen::CIRGenTypeCache::FloatTy, clang::CIRGen::CIRGenTypeCache::FP128Ty, clang::CIRGen::CIRGenTypeCache::FP16Ty, clang::CIRGen::CIRGenTypeCache::FP80Ty, getMLIRContext(), clang::CIRGen::CIRGenTypeCache::SInt128Ty, clang::CIRGen::CIRGenTypeCache::SInt16Ty, clang::CIRGen::CIRGenTypeCache::SInt32Ty, clang::CIRGen::CIRGenTypeCache::SInt64Ty, clang::CIRGen::CIRGenTypeCache::SInt8Ty, clang::CIRGen::CIRGenTypeCache::UInt128Ty, clang::CIRGen::CIRGenTypeCache::UInt16Ty, clang::CIRGen::CIRGenTypeCache::UInt32Ty, clang::CIRGen::CIRGenTypeCache::UInt64Ty, clang::CIRGen::CIRGenTypeCache::UInt8Ty, and clang::CIRGen::CIRGenTypeCache::VoidTy.
|
default |
void CIRGenModule::emitGlobal | ( | clang::GlobalDecl | gd | ) |
Emit code for a single global function or variable declaration.
Forward declarations are emitted lazily.
Definition at line 74 of file CIRGenModule.cpp.
References emitGlobalDefinition(), errorNYI(), and clang::GlobalDecl::getDecl().
Referenced by emitTopLevelDecl().
void CIRGenModule::emitGlobalDefinition | ( | clang::GlobalDecl | gd, |
mlir::Operation * | op = nullptr |
||
) |
Definition at line 125 of file CIRGenModule.cpp.
References clang::ast_matchers::decl, emitGlobalFunctionDefinition(), emitGlobalVarDefinition(), errorNYI(), and clang::GlobalDecl::getDecl().
Referenced by emitGlobal().
void CIRGenModule::emitGlobalFunctionDefinition | ( | clang::GlobalDecl | gd, |
mlir::Operation * | op | ||
) |
Definition at line 99 of file CIRGenModule.cpp.
References errorNYI(), clang::GlobalDecl::getDecl(), and getLoc().
Referenced by emitGlobalDefinition().
void CIRGenModule::emitGlobalVarDefinition | ( | const clang::VarDecl * | vd, |
bool | isTentative = false |
||
) |
Definition at line 112 of file CIRGenModule.cpp.
References clang::CIRGen::CIRGenTypes::convertType(), errorNYI(), clang::SourceRange::getBegin(), clang::NamedDecl::getIdentifier(), getLoc(), clang::VarDecl::getSourceRange(), clang::ValueDecl::getType(), getTypes(), and clang::ast_matchers::type.
Referenced by emitGlobalDefinition().
void CIRGenModule::emitTopLevelDecl | ( | clang::Decl * | decl | ) |
Definition at line 153 of file CIRGenModule.cpp.
References clang::ast_matchers::decl, emitGlobal(), and errorNYI().
|
inline |
Definition at line 95 of file CIRGenModule.h.
References clang::DiagnosticsEngine::Error, clang::DiagnosticsEngine::getCustomDiagID(), and clang::DiagnosticsEngine::Report().
DiagnosticBuilder CIRGenModule::errorNYI | ( | SourceLocation | loc, |
llvm::StringRef | feature | ||
) |
Helpers to emit "not yet implemented" error diagnostics.
Definition at line 181 of file CIRGenModule.cpp.
References clang::DiagnosticsEngine::Error, clang::DiagnosticsEngine::getCustomDiagID(), and clang::DiagnosticsEngine::Report().
Referenced by clang::CIRGen::CIRGenTypes::convertType(), emitGlobal(), emitGlobalDefinition(), emitGlobalFunctionDefinition(), emitGlobalVarDefinition(), emitTopLevelDecl(), and errorNYI().
|
inline |
Definition at line 106 of file CIRGenModule.h.
References errorNYI(), and clang::SourceRange::getBegin().
DiagnosticBuilder CIRGenModule::errorNYI | ( | SourceRange | loc, |
llvm::StringRef | feature | ||
) |
Definition at line 188 of file CIRGenModule.cpp.
References errorNYI(), and clang::SourceRange::getBegin().
|
inline |
Definition at line 70 of file CIRGenModule.h.
|
inline |
Definition at line 69 of file CIRGenModule.h.
mlir::Location CIRGenModule::getLoc | ( | clang::SourceLocation | cLoc | ) |
Helpers to convert the presumed location of Clang's SourceLocation to an MLIR Location.
Definition at line 57 of file CIRGenModule.cpp.
References clang::PresumedLoc::getColumn(), clang::PresumedLoc::getFilename(), clang::PresumedLoc::getLine(), clang::SourceManager::getPresumedLoc(), clang::ASTContext::getSourceManager(), and clang::SourceLocation::isValid().
Referenced by emitGlobalFunctionDefinition(), emitGlobalVarDefinition(), and getLoc().
mlir::Location CIRGenModule::getLoc | ( | clang::SourceRange | cRange | ) |
Definition at line 66 of file CIRGenModule.cpp.
References clang::SourceRange::getBegin(), clang::SourceRange::getEnd(), getLoc(), and clang::SourceRange::isValid().
|
inline |
Definition at line 72 of file CIRGenModule.h.
Referenced by CIRGenModule().
|
inline |
Definition at line 68 of file CIRGenModule.h.
|
inline |
Definition at line 71 of file CIRGenModule.h.
Referenced by emitGlobalVarDefinition().