Guy Benyei | 7f92f2d | 2012-12-18 14:30:41 +0000 | [diff] [blame] | 1 | //===----- 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 | |
Stephen Hines | 176edba | 2014-12-01 14:53:08 -0800 | [diff] [blame] | 16 | #ifndef LLVM_CLANG_LIB_CODEGEN_CGOPENCLRUNTIME_H |
| 17 | #define LLVM_CLANG_LIB_CODEGEN_CGOPENCLRUNTIME_H |
Guy Benyei | 7f92f2d | 2012-12-18 14:30:41 +0000 | [diff] [blame] | 18 | |
Guy Benyei | b13621d | 2012-12-18 14:38:23 +0000 | [diff] [blame] | 19 | #include "clang/AST/Type.h" |
Chandler Carruth | 3b844ba | 2013-01-02 11:45:17 +0000 | [diff] [blame] | 20 | #include "llvm/IR/Type.h" |
| 21 | #include "llvm/IR/Value.h" |
Guy Benyei | b13621d | 2012-12-18 14:38:23 +0000 | [diff] [blame] | 22 | |
Guy Benyei | 7f92f2d | 2012-12-18 14:30:41 +0000 | [diff] [blame] | 23 | namespace clang { |
| 24 | |
| 25 | class VarDecl; |
| 26 | |
| 27 | namespace CodeGen { |
| 28 | |
| 29 | class CodeGenFunction; |
| 30 | class CodeGenModule; |
| 31 | |
| 32 | class CGOpenCLRuntime { |
| 33 | protected: |
| 34 | CodeGenModule &CGM; |
| 35 | |
| 36 | public: |
| 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 Benyei | b13621d | 2012-12-18 14:38:23 +0000 | [diff] [blame] | 45 | |
| 46 | virtual llvm::Type *convertOpenCLSpecificType(const Type *T); |
Guy Benyei | 7f92f2d | 2012-12-18 14:30:41 +0000 | [diff] [blame] | 47 | }; |
| 48 | |
| 49 | } |
| 50 | } |
| 51 | |
| 52 | #endif |