summaryrefslogtreecommitdiffstats
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
commitc1b96c3590c914a96dfde4be32113bbe7f88890c (patch)
tree83a85818848fb67a19c420c2fb2183f329debdb0
parent19bd27f493d506798b672898b76e1d9a38f7506d (diff)
downloadbcm5719-llvm-c1b96c3590c914a96dfde4be32113bbe7f88890c.tar.gz
bcm5719-llvm-c1b96c3590c914a96dfde4be32113bbe7f88890c.zip
"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! llvm-svn: 69493
-rw-r--r--clang/lib/CodeGen/CGObjCGNU.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/clang/lib/CodeGen/CGObjCGNU.cpp b/clang/lib/CodeGen/CGObjCGNU.cpp
index cd94290000d..c5e2538ca0a 100644
--- a/clang/lib/CodeGen/CGObjCGNU.cpp
+++ b/clang/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);
OpenPOWER on IntegriCloud