blob: 0c50b92914b828823a5cf0a9742c1b001dffaece [file] [log] [blame]
Guy Benyei11169dd2012-12-18 14:30:41 +00001//===----- CGOpenCLRuntime.h - Interface to OpenCL Runtimes -----*- C++ -*-===//
2//
3// The LLVM Compiler Infrastructure
4//
5// This file is distributed under the University of Illinois Open Source
6// License. See LICENSE.TXT for details.
7//
8//===----------------------------------------------------------------------===//
9//
10// This provides an abstract class for OpenCL code generation. Concrete
11// subclasses of this implement code generation for specific OpenCL
12// runtime libraries.
13//
14//===----------------------------------------------------------------------===//
15
Benjamin Kramer2f5db8b2014-08-13 16:25:19 +000016#ifndef LLVM_CLANG_LIB_CODEGEN_CGOPENCLRUNTIME_H
17#define LLVM_CLANG_LIB_CODEGEN_CGOPENCLRUNTIME_H
Guy Benyei11169dd2012-12-18 14:30:41 +000018
Guy Benyeid8a08ea2012-12-18 14:38:23 +000019#include "clang/AST/Type.h"
Chandler Carruthffd55512013-01-02 11:45:17 +000020#include "llvm/IR/Type.h"
21#include "llvm/IR/Value.h"
Guy Benyeid8a08ea2012-12-18 14:38:23 +000022
Guy Benyei11169dd2012-12-18 14:30:41 +000023namespace clang {
24
25class VarDecl;
26
27namespace CodeGen {
28
29class CodeGenFunction;
30class CodeGenModule;
31
32class CGOpenCLRuntime {
33protected:
34 CodeGenModule &CGM;
35
36public:
37 CGOpenCLRuntime(CodeGenModule &CGM) : CGM(CGM) {}
38 virtual ~CGOpenCLRuntime();
39
40 /// Emit the IR required for a work-group-local variable declaration, and add
41 /// an entry to CGF's LocalDeclMap for D. The base class does this using
42 /// CodeGenFunction::EmitStaticVarDecl to emit an internal global for D.
43 virtual void EmitWorkGroupLocalVarDecl(CodeGenFunction &CGF,
44 const VarDecl &D);
Guy Benyeid8a08ea2012-12-18 14:38:23 +000045
46 virtual llvm::Type *convertOpenCLSpecificType(const Type *T);
Guy Benyei11169dd2012-12-18 14:30:41 +000047};
48
Alexander Kornienkoab9db512015-06-22 23:07:51 +000049}
50}
Guy Benyei11169dd2012-12-18 14:30:41 +000051
52#endif