diff --git a/clang/lib/CodeGen/CGObjCGNU.cpp b/clang/lib/CodeGen/CGObjCGNU.cpp --- a/clang/lib/CodeGen/CGObjCGNU.cpp +++ b/clang/lib/CodeGen/CGObjCGNU.cpp @@ -2760,7 +2760,7 @@ llvm::PHINode *phi = Builder.CreatePHI(v.getType(), 2); llvm::Type *RetTy = v.getElementType(); Address NullVal = CGF.CreateTempAlloca(RetTy, v.getAlignment(), "null"); - CGF.InitTempAlloca(NullVal, llvm::Constant::getNullValue(RetTy)); + Builder.CreateStore(llvm::Constant::getNullValue(RetTy), NullVal); phi->addIncoming(v.getPointer(), messageBB); phi->addIncoming(NullVal.getPointer(), startBB); msgRet = RValue::getAggregate(Address(phi, v.getAlignment())); diff --git a/clang/lib/CodeGen/CodeGenFunction.cpp b/clang/lib/CodeGen/CodeGenFunction.cpp --- a/clang/lib/CodeGen/CodeGenFunction.cpp +++ b/clang/lib/CodeGen/CodeGenFunction.cpp @@ -981,7 +981,8 @@ // precise source location of the checked return statement. if (requiresReturnValueCheck()) { ReturnLocation = CreateDefaultAlignTempAlloca(Int8PtrTy, "return.sloc.ptr"); - InitTempAlloca(ReturnLocation, llvm::ConstantPointerNull::get(Int8PtrTy)); + Builder.CreateStore(llvm::ConstantPointerNull::get(Int8PtrTy), + ReturnLocation); } // Emit subprogram debug descriptor.