[cfe-commits] r102711 - /cfe/trunk/lib/CodeGen/CGObjCGNU.cpp
David Chisnall
csdavec at swan.ac.uk
Fri Apr 30 06:36:13 PDT 2010
Author: theraven
Date: Fri Apr 30 08:36:12 2010
New Revision: 102711
URL: http://llvm.org/viewvc/llvm-project?rev=102711&view=rev
Log:
Fixed incorrect type of alloca (GNU runtime).
Modified:
cfe/trunk/lib/CodeGen/CGObjCGNU.cpp
Modified: cfe/trunk/lib/CodeGen/CGObjCGNU.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/CGObjCGNU.cpp?rev=102711&r1=102710&r2=102711&view=diff
==============================================================================
--- cfe/trunk/lib/CodeGen/CGObjCGNU.cpp (original)
+++ cfe/trunk/lib/CodeGen/CGObjCGNU.cpp Fri Apr 30 08:36:12 2010
@@ -648,8 +648,10 @@
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 @@
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);
More information about the cfe-commits
mailing list