Trim CGObjCRuntime::GenerateMessageSend[Super]
- Returns an RValue.
- Reduced to only taking the CodeGenFunction, Expr, and Receiver.
- Becomes responsible for emitting the arguments.
Add CodeGenFunction::EmitCallExprExt
- Takes optional extra arguments to insert at the head of the call.
- This allows the Obj-C runtimes to call into this and isolates the
argument and call instruction generation code to one place. Upshot
is that we now pass structures (more) correctly.
Also, fix one aspect of generating methods which take structure
arguments (for NeXT). This probably needs to be merged with the
SetFunctionAttributes code in CodeGenModule.cpp
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@55223 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/CodeGen/CGObjCRuntime.h b/lib/CodeGen/CGObjCRuntime.h
index 368e5ae..4a1acda 100644
--- a/lib/CodeGen/CGObjCRuntime.h
+++ b/lib/CodeGen/CGObjCRuntime.h
@@ -20,6 +20,8 @@
#include "llvm/Support/IRBuilder.h"
#include <string>
+#include "CGValue.h"
+
namespace llvm {
class Constant;
class Type;
@@ -29,9 +31,14 @@
}
namespace clang {
+ namespace CodeGen {
+ class CodeGenFunction;
+ }
+
class ObjCCategoryImplDecl;
class ObjCImplementationDecl;
class ObjCInterfaceDecl;
+ class ObjCMessageExpr;
class ObjCMethodDecl;
class ObjCProtocolDecl;
class Selector;
@@ -70,23 +77,18 @@
virtual void GenerateClass(const ObjCImplementationDecl *OID) = 0;
/// Generate an Objective-C message send operation.
- virtual llvm::Value *GenerateMessageSend(BuilderType &Builder,
- const llvm::Type *ReturnTy,
- llvm::Value *Receiver,
- Selector Sel,
- llvm::Value** ArgV,
- unsigned ArgC) = 0;
+ virtual CodeGen::RValue
+ GenerateMessageSend(CodeGen::CodeGenFunction &CGF,
+ const ObjCMessageExpr *E,
+ llvm::Value *Receiver) = 0;
/// Generate an Objective-C message send operation to the super
/// class.
- virtual llvm::Value *
- GenerateMessageSendSuper(llvm::IRBuilder<true> &Builder,
- const llvm::Type *ReturnTy,
- const ObjCInterfaceDecl *SuperClassName,
- llvm::Value *Receiver,
- Selector Sel,
- llvm::Value** ArgV,
- unsigned ArgC) = 0;
+ virtual CodeGen::RValue
+ GenerateMessageSendSuper(CodeGen::CodeGenFunction &CGF,
+ const ObjCMessageExpr *E,
+ const ObjCInterfaceDecl *SuperClass,
+ llvm::Value *Receiver) = 0;
/// Emit the code to return the named protocol as an object, as in a
/// @protocol expression.