From: David Chisnall Date: Fri, 30 Apr 2010 13:36:12 +0000 (+0000) Subject: Fixed incorrect type of alloca (GNU runtime). X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=866163bf6c66211a9b4d5ba160ac02de04ce4be6;p=clang Fixed incorrect type of alloca (GNU runtime). git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@102711 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/CodeGen/CGObjCGNU.cpp b/lib/CodeGen/CGObjCGNU.cpp index 0f4354c75a..9e999ace16 100644 --- a/lib/CodeGen/CGObjCGNU.cpp +++ b/lib/CodeGen/CGObjCGNU.cpp @@ -648,8 +648,10 @@ CGObjCGNU::GenerateMessageSend(CodeGen::CodeGenFunction &CGF, LookupFn->setDoesNotCapture(1); } - llvm::Instruction *slot = + llvm::CallInst *slot = Builder.CreateCall3(lookupFunction, ReceiverPtr, cmd, self); + slot->setOnlyReadsMemory(); + imp = Builder.CreateLoad(Builder.CreateStructGEP(slot, 4)); llvm::Value *impMD[] = { llvm::MDString::get(VMContext, Sel.getAsString()), @@ -688,7 +690,8 @@ CGObjCGNU::GenerateMessageSend(CodeGen::CodeGenFunction &CGF, llvm::Value *v = msgRet.getAggregateAddr(); llvm::PHINode *phi = Builder.CreatePHI(v->getType()); const llvm::PointerType *RetTy = cast(v->getType()); - llvm::AllocaInst *NullVal = CGF.CreateTempAlloca(RetTy, "null"); + llvm::AllocaInst *NullVal = + CGF.CreateTempAlloca(RetTy->getElementType(), "null"); CGF.InitTempAlloca(NullVal, llvm::Constant::getNullValue(RetTy->getElementType())); phi->addIncoming(v, messageBB);