CGOpenCLRuntime.h 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  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. #ifndef LLVM_CLANG_LIB_CODEGEN_CGOPENCLRUNTIME_H
  16. #define LLVM_CLANG_LIB_CODEGEN_CGOPENCLRUNTIME_H
  17. #include "clang/AST/Type.h"
  18. #include "llvm/IR/Type.h"
  19. #include "llvm/IR/Value.h"
  20. namespace clang {
  21. class VarDecl;
  22. namespace CodeGen {
  23. class CodeGenFunction;
  24. class CodeGenModule;
  25. class CGOpenCLRuntime {
  26. protected:
  27. CodeGenModule &CGM;
  28. public:
  29. CGOpenCLRuntime(CodeGenModule &CGM) : CGM(CGM) {}
  30. virtual ~CGOpenCLRuntime();
  31. /// Emit the IR required for a work-group-local variable declaration, and add
  32. /// an entry to CGF's LocalDeclMap for D. The base class does this using
  33. /// CodeGenFunction::EmitStaticVarDecl to emit an internal global for D.
  34. virtual void EmitWorkGroupLocalVarDecl(CodeGenFunction &CGF,
  35. const VarDecl &D);
  36. virtual llvm::Type *convertOpenCLSpecificType(const Type *T);
  37. };
  38. }
  39. }
  40. #endif