aboutsummaryrefslogtreecommitdiff
path: root/lib/CodeGen/CGObjCRuntime.h
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2008-03-30 23:03:07 +0000
committerChris Lattner <sabre@nondot.org>2008-03-30 23:03:07 +0000
commit391d77a26382dddf25da73e29fc1fa5aaaea4c6f (patch)
treeb842c678fe95a0feed12419eb419e091d22fff49 /lib/CodeGen/CGObjCRuntime.h
parenta7b402dc258bf38ab5e206dbf4916a69d3ee3cc8 (diff)
Add initial support for objc codegen for methods, ivars, and the
etoile runtime, patch by David Chisnall! git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@48969 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/CGObjCRuntime.h')
-rw-r--r--lib/CodeGen/CGObjCRuntime.h27
1 files changed, 24 insertions, 3 deletions
diff --git a/lib/CodeGen/CGObjCRuntime.h b/lib/CodeGen/CGObjCRuntime.h
index d8fc60f99c..749984d9f1 100644
--- a/lib/CodeGen/CGObjCRuntime.h
+++ b/lib/CodeGen/CGObjCRuntime.h
@@ -22,8 +22,10 @@ namespace llvm {
class Type;
class Value;
class Module;
+ class Function;
}
+
namespace clang {
namespace CodeGen {
@@ -32,16 +34,35 @@ class CGObjCRuntime {
public:
virtual ~CGObjCRuntime();
- // Generate an Objective-C message send operation
+ /// Generate an Objective-C message send operation
virtual llvm::Value *generateMessageSend(llvm::LLVMFoldingBuilder &Builder,
const llvm::Type *ReturnTy,
+ llvm::Value *Sender,
llvm::Value *Receiver,
- llvm::Constant *Selector,
+ llvm::Value *Selector,
llvm::Value** ArgV,
unsigned ArgC) = 0;
+ /// Generate the function required to register all Objective-C components in
+ /// this compilation unit with the runtime library.
+ virtual llvm::Function *ModuleInitFunction() { return 0; }
+ /// Generate a function preamble for a method with the specified types
+ virtual llvm::Function *MethodPreamble(const llvm::Type *ReturnTy,
+ const llvm::Type *SelfTy,
+ const llvm::Type **ArgTy,
+ unsigned ArgC,
+ bool isVarArg) = 0;
+ /// If instance variable addresses are determined at runtime then this should
+ /// return true, otherwise instance variables will be accessed directly from
+ /// the structure. If this returns true then @defs is invalid for this
+ /// runtime and a warning should be generated.
+ virtual bool LateBoundIVars() { return false; }
};
-CGObjCRuntime *CreateObjCRuntime(llvm::Module &M);
+/// Creates an instance of an Objective-C runtime class.
+//TODO: This should include some way of selecting which runtime to target.
+CGObjCRuntime *CreateObjCRuntime(llvm::Module &M,
+ const llvm::Type *LLVMIntType,
+ const llvm::Type *LLVMLongType);
}
}
#endif