xref: /minix3/external/bsd/llvm/dist/clang/lib/CodeGen/CGOpenCLRuntime.h (revision 0a6a1f1d05b60e214de2f05a7310ddd1f0e590e7)
1f4a2713aSLionel Sambuc //===----- CGOpenCLRuntime.h - Interface to OpenCL Runtimes -----*- C++ -*-===//
2f4a2713aSLionel Sambuc //
3f4a2713aSLionel Sambuc //                     The LLVM Compiler Infrastructure
4f4a2713aSLionel Sambuc //
5f4a2713aSLionel Sambuc // This file is distributed under the University of Illinois Open Source
6f4a2713aSLionel Sambuc // License. See LICENSE.TXT for details.
7f4a2713aSLionel Sambuc //
8f4a2713aSLionel Sambuc //===----------------------------------------------------------------------===//
9f4a2713aSLionel Sambuc //
10f4a2713aSLionel Sambuc // This provides an abstract class for OpenCL code generation.  Concrete
11f4a2713aSLionel Sambuc // subclasses of this implement code generation for specific OpenCL
12f4a2713aSLionel Sambuc // runtime libraries.
13f4a2713aSLionel Sambuc //
14f4a2713aSLionel Sambuc //===----------------------------------------------------------------------===//
15f4a2713aSLionel Sambuc 
16*0a6a1f1dSLionel Sambuc #ifndef LLVM_CLANG_LIB_CODEGEN_CGOPENCLRUNTIME_H
17*0a6a1f1dSLionel Sambuc #define LLVM_CLANG_LIB_CODEGEN_CGOPENCLRUNTIME_H
18f4a2713aSLionel Sambuc 
19f4a2713aSLionel Sambuc #include "clang/AST/Type.h"
20f4a2713aSLionel Sambuc #include "llvm/IR/Type.h"
21f4a2713aSLionel Sambuc #include "llvm/IR/Value.h"
22f4a2713aSLionel Sambuc 
23f4a2713aSLionel Sambuc namespace clang {
24f4a2713aSLionel Sambuc 
25f4a2713aSLionel Sambuc class VarDecl;
26f4a2713aSLionel Sambuc 
27f4a2713aSLionel Sambuc namespace CodeGen {
28f4a2713aSLionel Sambuc 
29f4a2713aSLionel Sambuc class CodeGenFunction;
30f4a2713aSLionel Sambuc class CodeGenModule;
31f4a2713aSLionel Sambuc 
32f4a2713aSLionel Sambuc class CGOpenCLRuntime {
33f4a2713aSLionel Sambuc protected:
34f4a2713aSLionel Sambuc   CodeGenModule &CGM;
35f4a2713aSLionel Sambuc 
36f4a2713aSLionel Sambuc public:
CGOpenCLRuntime(CodeGenModule & CGM)37f4a2713aSLionel Sambuc   CGOpenCLRuntime(CodeGenModule &CGM) : CGM(CGM) {}
38f4a2713aSLionel Sambuc   virtual ~CGOpenCLRuntime();
39f4a2713aSLionel Sambuc 
40f4a2713aSLionel Sambuc   /// Emit the IR required for a work-group-local variable declaration, and add
41f4a2713aSLionel Sambuc   /// an entry to CGF's LocalDeclMap for D.  The base class does this using
42f4a2713aSLionel Sambuc   /// CodeGenFunction::EmitStaticVarDecl to emit an internal global for D.
43f4a2713aSLionel Sambuc   virtual void EmitWorkGroupLocalVarDecl(CodeGenFunction &CGF,
44f4a2713aSLionel Sambuc                                          const VarDecl &D);
45f4a2713aSLionel Sambuc 
46f4a2713aSLionel Sambuc   virtual llvm::Type *convertOpenCLSpecificType(const Type *T);
47f4a2713aSLionel Sambuc };
48f4a2713aSLionel Sambuc 
49f4a2713aSLionel Sambuc }
50f4a2713aSLionel Sambuc }
51f4a2713aSLionel Sambuc 
52f4a2713aSLionel Sambuc #endif
53