18 #include "llvm/IR/DerivedTypes.h"
19 #include "llvm/IR/GlobalValue.h"
22 using namespace clang;
23 using namespace CodeGen;
34 "Not an OpenCL specific type!");
39 switch (cast<BuiltinType>(T)->
getKind()) {
41 llvm_unreachable(
"Unexpected opencl builtin type!");
43 #define IMAGE_TYPE(ImgType, Id, SingletonId, Access, Suffix) \
44 case BuiltinType::Id: \
45 return llvm::PointerType::get( \
46 llvm::StructType::create(Ctx, "opencl." #ImgType "_" #Suffix "_t"), \
48 #include "clang/Basic/OpenCLImageTypes.def"
49 case BuiltinType::OCLSampler:
50 return llvm::IntegerType::get(Ctx, 32);
51 case BuiltinType::OCLEvent:
53 Ctx,
"opencl.event_t"), 0);
54 case BuiltinType::OCLClkEvent:
55 return llvm::PointerType::get(
57 case BuiltinType::OCLQueue:
58 return llvm::PointerType::get(
60 case BuiltinType::OCLNDRange:
61 return llvm::PointerType::get(
63 case BuiltinType::OCLReserveID:
64 return llvm::PointerType::get(
71 uint32_t PipeAddrSpc =
void EmitStaticVarDecl(const VarDecl &D, llvm::GlobalValue::LinkageTypes Linkage)
llvm::LLVMContext & getLLVMContext()
The base class of the type hierarchy.
VarDecl - An instance of this class is created to represent a variable declaration or definition...
bool isOpenCLSpecificType() const
CodeGenFunction - This class organizes the per-function state that is used while generating LLVM code...
virtual ~CGOpenCLRuntime()
virtual llvm::Type * convertOpenCLSpecificType(const Type *T)
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...
ASTContext & getContext() const
The l-value was considered opaque, so the alignment was determined from a type.
std::unique_ptr< DiagnosticConsumer > create(StringRef OutputFile, DiagnosticOptions *Diags, bool MergeChildRecords=false)
Returns a DiagnosticConsumer that serializes diagnostics to a bitcode file.
Internal linkage, which indicates that the entity can be referred to from within the translation unit...
virtual llvm::Type * getPipeType()
static Decl::Kind getKind(const Decl *D)
unsigned getTargetAddressSpace(QualType T) const