aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2009-04-18 23:12:40 +0000
committerChris Lattner <sabre@nondot.org>2009-04-18 23:12:40 +0000
commit39d462e231de8f37fffd5a32394fb7642f489d10 (patch)
treebfe75e7c9a5e0d26d9bce48b14d1b43795990f1f
parentc78476b711902757f3600d75b180e8fe299c3f33 (diff)
"This patch fixes message sends to super in class methods for the GNU runtime (currently an instance method lookup is being performed)."
Patch by David Chisnall! git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69493 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r--lib/CodeGen/CGObjCGNU.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/lib/CodeGen/CGObjCGNU.cpp b/lib/CodeGen/CGObjCGNU.cpp
index cd94290000..c5e2538ca0 100644
--- a/lib/CodeGen/CGObjCGNU.cpp
+++ b/lib/CodeGen/CGObjCGNU.cpp
@@ -299,8 +299,9 @@ CGObjCGNU::GenerateMessageSendSuper(CodeGen::CodeGenFunction &CGF,
const ObjCInterfaceDecl *SuperClass = Class->getSuperClass();
// TODO: This should be cached, not looked up every time.
llvm::Value *ReceiverClass = GetClass(CGF.Builder, SuperClass);
-
-
+ if (IsClassMessage)
+ ReceiverClass = CGF.Builder.CreateBitCast(CGF.Builder.CreateLoad(
+ CGF.Builder.CreateStructGEP(ReceiverClass, 0)), IdTy);
// Construct the structure used to look up the IMP
llvm::StructType *ObjCSuperTy = llvm::StructType::get(Receiver->getType(),
IdTy, NULL);