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 case BuiltinType::OCLImage1d:
45 Ctx,
"opencl.image1d_t"), ImgAddrSpc);
46 case BuiltinType::OCLImage1dArray:
48 Ctx,
"opencl.image1d_array_t"), ImgAddrSpc);
49 case BuiltinType::OCLImage1dBuffer:
51 Ctx,
"opencl.image1d_buffer_t"), ImgAddrSpc);
52 case BuiltinType::OCLImage2d:
54 Ctx,
"opencl.image2d_t"), ImgAddrSpc);
55 case BuiltinType::OCLImage2dArray:
57 Ctx,
"opencl.image2d_array_t"), ImgAddrSpc);
58 case BuiltinType::OCLImage3d:
60 Ctx,
"opencl.image3d_t"), ImgAddrSpc);
61 case BuiltinType::OCLSampler:
62 return llvm::IntegerType::get(Ctx, 32);
63 case BuiltinType::OCLEvent:
65 Ctx,
"opencl.event_t"), 0);
void EmitStaticVarDecl(const VarDecl &D, llvm::GlobalValue::LinkageTypes Linkage)
llvm::LLVMContext & getLLVMContext()
bool isOpenCLSpecificType() const
virtual ~CGOpenCLRuntime()
virtual llvm::Type * convertOpenCLSpecificType(const Type *T)
virtual void EmitWorkGroupLocalVarDecl(CodeGenFunction &CGF, const VarDecl &D)
ASTContext & getContext() const
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...
static Decl::Kind getKind(const Decl *D)
unsigned getTargetAddressSpace(QualType T) const