clang 20.0.0git
Public Member Functions | List of all members
clang::CIRGen::CIRGenModule Class Reference

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"

Inheritance diagram for clang::CIRGen::CIRGenModule:
Inheritance graph
[legend]

Public Member Functions

 CIRGenModule (mlir::MLIRContext &mlirContext, clang::ASTContext &astContext, const clang::CodeGenOptions &cgo, clang::DiagnosticsEngine &diags)
 
 ~CIRGenModule ()=default
 
mlir::ModuleOp getModule () const
 
CIRGenBuilderTygetBuilder ()
 
clang::ASTContextgetASTContext () const
 
CIRGenTypesgetTypes ()
 
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
 

Detailed Description

This class organizes the cross-function state that is used while generating CIR code.

Definition at line 39 of file CIRGenModule.h.

Constructor & Destructor Documentation

◆ CIRGenModule()

CIRGenModule::CIRGenModule ( mlir::MLIRContext &  mlirContext,
clang::ASTContext astContext,
const clang::CodeGenOptions cgo,
clang::DiagnosticsEngine diags 
)

◆ ~CIRGenModule()

clang::CIRGen::CIRGenModule::~CIRGenModule ( )
default

Member Function Documentation

◆ emitGlobal()

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().

◆ emitGlobalDefinition()

void CIRGenModule::emitGlobalDefinition ( clang::GlobalDecl  gd,
mlir::Operation *  op = nullptr 
)

◆ emitGlobalFunctionDefinition()

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().

◆ emitGlobalVarDefinition()

void CIRGenModule::emitGlobalVarDefinition ( const clang::VarDecl vd,
bool  isTentative = false 
)

◆ emitTopLevelDecl()

void CIRGenModule::emitTopLevelDecl ( clang::Decl decl)

Definition at line 153 of file CIRGenModule.cpp.

References clang::ast_matchers::decl, emitGlobal(), and errorNYI().

◆ errorNYI() [1/4]

template<typename T >
DiagnosticBuilder clang::CIRGen::CIRGenModule::errorNYI ( SourceLocation  loc,
llvm::StringRef  feature,
const T name 
)
inline

◆ errorNYI() [2/4]

DiagnosticBuilder CIRGenModule::errorNYI ( SourceLocation  loc,
llvm::StringRef  feature 
)

◆ errorNYI() [3/4]

template<typename T >
DiagnosticBuilder clang::CIRGen::CIRGenModule::errorNYI ( SourceRange  loc,
llvm::StringRef  feature,
const T name 
)
inline

Definition at line 106 of file CIRGenModule.h.

References errorNYI(), and clang::SourceRange::getBegin().

◆ errorNYI() [4/4]

DiagnosticBuilder CIRGenModule::errorNYI ( SourceRange  loc,
llvm::StringRef  feature 
)

Definition at line 188 of file CIRGenModule.cpp.

References errorNYI(), and clang::SourceRange::getBegin().

◆ getASTContext()

clang::ASTContext & clang::CIRGen::CIRGenModule::getASTContext ( ) const
inline

Definition at line 70 of file CIRGenModule.h.

◆ getBuilder()

CIRGenBuilderTy & clang::CIRGen::CIRGenModule::getBuilder ( )
inline

Definition at line 69 of file CIRGenModule.h.

◆ getLoc() [1/2]

mlir::Location CIRGenModule::getLoc ( clang::SourceLocation  cLoc)

◆ getLoc() [2/2]

mlir::Location CIRGenModule::getLoc ( clang::SourceRange  cRange)

◆ getMLIRContext()

mlir::MLIRContext & clang::CIRGen::CIRGenModule::getMLIRContext ( )
inline

Definition at line 72 of file CIRGenModule.h.

Referenced by CIRGenModule().

◆ getModule()

mlir::ModuleOp clang::CIRGen::CIRGenModule::getModule ( ) const
inline

Definition at line 68 of file CIRGenModule.h.

◆ getTypes()

CIRGenTypes & clang::CIRGen::CIRGenModule::getTypes ( )
inline

Definition at line 71 of file CIRGenModule.h.

Referenced by emitGlobalVarDefinition().


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