]> granicus.if.org Git - clang/commitdiff
"This patch fixes message sends to super in class methods for the GNU runtime (curren...
authorChris Lattner <sabre@nondot.org>
Sat, 18 Apr 2009 23:12:40 +0000 (23:12 +0000)
committerChris Lattner <sabre@nondot.org>
Sat, 18 Apr 2009 23:12:40 +0000 (23:12 +0000)
Patch by David Chisnall!

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69493 91177308-0d34-0410-b5e6-96231b3b80d8

lib/CodeGen/CGObjCGNU.cpp

index cd94290000d734b5e6bddb5ad007edf122671285..c5e2538ca0a98c51a42c2f44afb5e9410537e370 100644 (file)
@@ -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);