CGObjCRuntime.h revision bda0b626e74513950405c27525af87e214e605e2
1//===----- CGObjCRuntime.h - Emit LLVM Code from ASTs for a Module --------===//
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 Objective-C code generation.  Concrete
11// subclasses of this implement code generation for specific Objective-C
12// runtime libraries.
13//
14//===----------------------------------------------------------------------===//
15
16#ifndef CLANG_CODEGEN_OBCJRUNTIME_H
17#define CLANG_CODEGEN_OBCJRUNTIME_H
18
19namespace llvm {
20  class LLVMFoldingBuilder;
21  class Constant;
22  class Type;
23  class Value;
24  class Module;
25}
26
27namespace clang {
28namespace CodeGen {
29
30// Implements runtime-specific code generation functions
31class CGObjCRuntime {
32public:
33  virtual ~CGObjCRuntime();
34
35  // Generate an Objective-C message send operation
36  virtual llvm::Value *generateMessageSend(llvm::LLVMFoldingBuilder &Builder,
37                                           const llvm::Type *ReturnTy,
38                                           llvm::Value *Receiver,
39                                           llvm::Constant *Selector,
40                                           llvm::Value** ArgV,
41                                           unsigned ArgC) = 0;
42};
43
44CGObjCRuntime *CreateObjCRuntime(llvm::Module &M);
45}
46}
47#endif
48