clang API Documentation

CGOpenCLRuntime.h
Go to the documentation of this file.
00001 //===----- CGOpenCLRuntime.h - Interface to OpenCL Runtimes -----*- C++ -*-===//
00002 //
00003 //                     The LLVM Compiler Infrastructure
00004 //
00005 // This file is distributed under the University of Illinois Open Source
00006 // License. See LICENSE.TXT for details.
00007 //
00008 //===----------------------------------------------------------------------===//
00009 //
00010 // This provides an abstract class for OpenCL code generation.  Concrete
00011 // subclasses of this implement code generation for specific OpenCL
00012 // runtime libraries.
00013 //
00014 //===----------------------------------------------------------------------===//
00015 
00016 #ifndef LLVM_CLANG_LIB_CODEGEN_CGOPENCLRUNTIME_H
00017 #define LLVM_CLANG_LIB_CODEGEN_CGOPENCLRUNTIME_H
00018 
00019 #include "clang/AST/Type.h"
00020 #include "llvm/IR/Type.h"
00021 #include "llvm/IR/Value.h"
00022 
00023 namespace clang {
00024 
00025 class VarDecl;
00026 
00027 namespace CodeGen {
00028 
00029 class CodeGenFunction;
00030 class CodeGenModule;
00031 
00032 class CGOpenCLRuntime {
00033 protected:
00034   CodeGenModule &CGM;
00035 
00036 public:
00037   CGOpenCLRuntime(CodeGenModule &CGM) : CGM(CGM) {}
00038   virtual ~CGOpenCLRuntime();
00039 
00040   /// Emit the IR required for a work-group-local variable declaration, and add
00041   /// an entry to CGF's LocalDeclMap for D.  The base class does this using
00042   /// CodeGenFunction::EmitStaticVarDecl to emit an internal global for D.
00043   virtual void EmitWorkGroupLocalVarDecl(CodeGenFunction &CGF,
00044                                          const VarDecl &D);
00045 
00046   virtual llvm::Type *convertOpenCLSpecificType(const Type *T);
00047 };
00048 
00049 }
00050 }
00051 
00052 #endif