19#include "llvm/IR/DerivedTypes.h"
20#include "llvm/IR/GlobalValue.h"
24using namespace CodeGen;
63 llvm::Type *&PipeTy) {
88 return llvm::ConstantInt::get(Int32Ty, TypeSize,
false);
98 return llvm::ConstantInt::get(Int32Ty, TypeSize,
false);
103 return llvm::PointerType::get(
114 const Expr *Prev =
nullptr;
115 while(!isa<BlockExpr>(
E) &&
E != Prev) {
118 if (
auto DR = dyn_cast<DeclRefExpr>(
E)) {
119 E = cast<VarDecl>(DR->getDecl())->getInit();
122 return cast<BlockExpr>(
E);
128 llvm::Function *InvokeF,
129 llvm::Value *
Block, llvm::Type *BlockTy) {
131 assert(isa<llvm::Function>(InvokeF) &&
"Invalid invoke function");
132 assert(
Block->getType()->isPointerTy() &&
"Invalid block literal type");
static const BlockExpr * getBlockExpr(const Expr *E)
LangAS getOpenCLTypeAddrSpace(const Type *T) const
Get address space for OpenCL type.
CharUnits getTypeAlignInChars(QualType T) const
Return the ABI-specified alignment of a (complete) type T, in characters.
CharUnits getTypeSizeInChars(QualType T) const
Return the size of the specified (complete) type T, in characters.
unsigned getTargetAddressSpace(LangAS AS) const
BlockExpr - Adaptor class for mixing a BlockDecl with expressions.
const T * getTypePtr() const
Retrieve the underlying type pointer, which refers to a canonical type.
QuantityType getQuantity() const
getQuantity - Get the raw integer representation of this quantity.
virtual llvm::Type * getPipeType(const PipeType *T, StringRef Name, llvm::Type *&PipeTy)
EnqueuedBlockInfo emitOpenCLEnqueuedBlock(CodeGenFunction &CGF, const Expr *E)
llvm::PointerType * getPointerType(const Type *T)
virtual llvm::Value * getPipeElemAlign(const Expr *PipeArg)
llvm::Function * getInvokeFunction(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::PointerType * getGenericVoidPointerType()
llvm::DenseMap< const Expr *, EnqueuedBlockInfo > EnqueuedBlockMap
Maps block expression to block information.
virtual llvm::Type * convertOpenCLSpecificType(const Type *T)
virtual llvm::Value * getPipeElemSize(const Expr *PipeArg)
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 LocalDecl...
llvm::Type * getSamplerType(const Type *T)
CodeGenFunction - This class organizes the per-function state that is used while generating LLVM code...
void EmitStaticVarDecl(const VarDecl &D, llvm::GlobalValue::LinkageTypes Linkage)
const TargetCodeGenInfo & getTargetHooks() const
llvm::Value * EmitScalarExpr(const Expr *E, bool IgnoreResultAssign=false)
EmitScalarExpr - Emit the computation of the specified expression of LLVM scalar type,...
const LangOptions & getLangOpts() const
ASTContext & getContext() const
const TargetCodeGenInfo & getTargetCodeGenInfo()
llvm::LLVMContext & getLLVMContext()
virtual llvm::Type * getOpenCLType(CodeGenModule &CGM, const Type *T) const
Return an LLVM type that corresponds to an OpenCL type.
virtual llvm::Value * createEnqueuedBlockKernel(CodeGenFunction &CGF, llvm::Function *BlockInvokeFunc, llvm::Type *BlockTy) const
Create an OpenCL kernel for an enqueued block.
This represents one expression.
Expr * IgnoreCasts() LLVM_READONLY
Skip past any casts which might surround this expression until reaching a fixed point.
QualType getElementType() const
The base class of the type hierarchy.
const T * castAs() const
Member-template castAs<specific type>.
bool isOpenCLSpecificType() const
Represents a variable declaration or definition.
The JSON file list parser is used to communicate input to InstallAPI.
const FunctionProtoType * T
Structure for enqueued block information.