aboutsummaryrefslogtreecommitdiff
path: root/lib/CodeGen/CGObjCGNU.cpp
diff options
context:
space:
mode:
authorDavid Chisnall <csdavec@swan.ac.uk>2010-04-30 13:36:12 +0000
committerDavid Chisnall <csdavec@swan.ac.uk>2010-04-30 13:36:12 +0000
commit866163bf6c66211a9b4d5ba160ac02de04ce4be6 (patch)
tree1635bf20e715f43c839e3faa5e9863a2fe95296b /lib/CodeGen/CGObjCGNU.cpp
parente215f7232dd4aa65ebf2a1ecd07cd95fe1ce3481 (diff)
Fixed incorrect type of alloca (GNU runtime).
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@102711 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/CGObjCGNU.cpp')
-rw-r--r--lib/CodeGen/CGObjCGNU.cpp7
1 files changed, 5 insertions, 2 deletions
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<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);