Skip to content

Commit

Permalink
Fixed incorrect type of alloca (GNU runtime).
Browse files Browse the repository at this point in the history
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@102711 91177308-0d34-0410-b5e6-96231b3b80d8
  • Loading branch information
David Chisnall committed Apr 30, 2010
1 parent e215f72 commit 866163b
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions lib/CodeGen/CGObjCGNU.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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()),
Expand Down Expand Up @@ -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<llvm::PointerType>(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);
Expand Down

0 comments on commit 866163b

Please sign in to comment.