From: Chris Lattner Date: Sat, 18 Apr 2009 23:12:40 +0000 (+0000) Subject: "This patch fixes message sends to super in class methods for the GNU runtime (curren... X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=39d462e231de8f37fffd5a32394fb7642f489d10;p=clang "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 --- 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);