clang 19.0.0git
Classes | Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
clang::CodeGen::CGOpenCLRuntime Class Reference

#include "/home/buildbot/as-worker-4/publish-doxygen-docs/llvm-project/clang/lib/CodeGen/CGOpenCLRuntime.h"

Classes

struct  EnqueuedBlockInfo
 Structure for enqueued block information. More...
 

Public Member Functions

 CGOpenCLRuntime (CodeGenModule &CGM)
 
virtual ~CGOpenCLRuntime ()
 
virtual void EmitWorkGroupLocalVarDecl (CodeGenFunction &CGF, const VarDecl &D)
 Emit the IR required for a work-group-local variable declaration, and add an entry to CGF's LocalDeclMap for D.
 
virtual llvm::Type * convertOpenCLSpecificType (const Type *T)
 
virtual llvm::Type * getPipeType (const PipeType *T)
 
llvm::Type * getSamplerType (const Type *T)
 
virtual llvm::Value * getPipeElemSize (const Expr *PipeArg)
 
virtual llvm::Value * getPipeElemAlign (const Expr *PipeArg)
 
llvm::PointerType * getGenericVoidPointerType ()
 
EnqueuedBlockInfo emitOpenCLEnqueuedBlock (CodeGenFunction &CGF, const Expr *E)
 
void recordBlockInfo (const BlockExpr *E, llvm::Function *InvokeF, llvm::Value *Block, llvm::Type *BlockTy)
 Record invoke function and block literal emitted during normal codegen for a block expression.
 
llvm::Function * getInvokeFunction (const Expr *E)
 

Protected Member Functions

virtual llvm::Type * getPipeType (const PipeType *T, StringRef Name, llvm::Type *&PipeTy)
 
llvm::PointerType * getPointerType (const Type *T)
 

Protected Attributes

CodeGenModuleCGM
 
llvm::Type * PipeROTy
 
llvm::Type * PipeWOTy
 
llvm::Type * SamplerTy
 
llvm::DenseMap< const Expr *, EnqueuedBlockInfoEnqueuedBlockMap
 Maps block expression to block information.
 

Detailed Description

Definition at line 36 of file CGOpenCLRuntime.h.

Constructor & Destructor Documentation

◆ CGOpenCLRuntime()

clang::CodeGen::CGOpenCLRuntime::CGOpenCLRuntime ( CodeGenModule CGM)
inline

Definition at line 58 of file CGOpenCLRuntime.h.

◆ ~CGOpenCLRuntime()

CGOpenCLRuntime::~CGOpenCLRuntime ( )
virtual

Definition at line 26 of file CGOpenCLRuntime.cpp.

Member Function Documentation

◆ convertOpenCLSpecificType()

llvm::Type * CGOpenCLRuntime::convertOpenCLSpecificType ( const Type T)
virtual

◆ emitOpenCLEnqueuedBlock()

CGOpenCLRuntime::EnqueuedBlockInfo CGOpenCLRuntime::emitOpenCLEnqueuedBlock ( CodeGenFunction CGF,
const Expr E 
)

◆ EmitWorkGroupLocalVarDecl()

void CGOpenCLRuntime::EmitWorkGroupLocalVarDecl ( CodeGenFunction CGF,
const VarDecl D 
)
virtual

Emit the IR required for a work-group-local variable declaration, and add an entry to CGF's LocalDeclMap for D.

The base class does this using CodeGenFunction::EmitStaticVarDecl to emit an internal global for D.

Definition at line 28 of file CGOpenCLRuntime.cpp.

References clang::CodeGen::CodeGenFunction::EmitStaticVarDecl().

◆ getGenericVoidPointerType()

llvm::PointerType * CGOpenCLRuntime::getGenericVoidPointerType ( )

◆ getInvokeFunction()

llvm::Function * CGOpenCLRuntime::getInvokeFunction ( const Expr E)
Returns
LLVM block invoke function emitted for an expression derived from the block expression.

Definition at line 139 of file CGOpenCLRuntime.cpp.

References EnqueuedBlockMap, and getBlockExpr().

◆ getPipeElemAlign()

llvm::Value * CGOpenCLRuntime::getPipeElemAlign ( const Expr PipeArg)
virtual

◆ getPipeElemSize()

llvm::Value * CGOpenCLRuntime::getPipeElemSize ( const Expr PipeArg)
virtual

◆ getPipeType() [1/2]

llvm::Type * CGOpenCLRuntime::getPipeType ( const PipeType T)
virtual

◆ getPipeType() [2/2]

llvm::Type * CGOpenCLRuntime::getPipeType ( const PipeType T,
StringRef  Name,
llvm::Type *&  PipeTy 
)
protectedvirtual

Definition at line 62 of file CGOpenCLRuntime.cpp.

References getPointerType(), and clang::T.

Referenced by clang::CodeGen::CodeGenTypes::ConvertType(), and getPipeType().

◆ getPointerType()

llvm::PointerType * CGOpenCLRuntime::getPointerType ( const Type T)
protected

◆ getSamplerType()

llvm::Type * CGOpenCLRuntime::getSamplerType ( const Type T)

◆ recordBlockInfo()

void CGOpenCLRuntime::recordBlockInfo ( const BlockExpr E,
llvm::Function *  InvokeF,
llvm::Value *  Block,
llvm::Type *  BlockTy 
)

Record invoke function and block literal emitted during normal codegen for a block expression.

Record emitted llvm invoke function and llvm block literal for the corresponding block expression.

The information is used by emitOpenCLEnqueuedBlock to emit wrapper kernel.

Parameters
InvokeFinvoke function emitted for the block expression.
Blockblock literal emitted for the block expression.

Definition at line 127 of file CGOpenCLRuntime.cpp.

References clang::Block, and EnqueuedBlockMap.

Referenced by buildGlobalBlock().

Member Data Documentation

◆ CGM

CodeGenModule& clang::CodeGen::CGOpenCLRuntime::CGM
protected

◆ EnqueuedBlockMap

llvm::DenseMap<const Expr *, EnqueuedBlockInfo> clang::CodeGen::CGOpenCLRuntime::EnqueuedBlockMap
protected

Maps block expression to block information.

Definition at line 51 of file CGOpenCLRuntime.h.

Referenced by emitOpenCLEnqueuedBlock(), getInvokeFunction(), and recordBlockInfo().

◆ PipeROTy

llvm::Type* clang::CodeGen::CGOpenCLRuntime::PipeROTy
protected

Definition at line 39 of file CGOpenCLRuntime.h.

Referenced by getPipeType().

◆ PipeWOTy

llvm::Type* clang::CodeGen::CGOpenCLRuntime::PipeWOTy
protected

Definition at line 40 of file CGOpenCLRuntime.h.

Referenced by getPipeType().

◆ SamplerTy

llvm::Type* clang::CodeGen::CGOpenCLRuntime::SamplerTy
protected

Definition at line 41 of file CGOpenCLRuntime.h.

Referenced by getSamplerType().


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