@@ -195,24 +195,18 @@ pub fn immediate_rvalue_bcx<'blk, 'tcx>(bcx: Block<'blk, 'tcx>,
195
195
196
196
/// Allocates temporary space on the stack using alloca() and returns a by-ref Datum pointing to
197
197
/// it. The memory will be dropped upon exit from `scope`. The callback `populate` should
198
- /// initialize the memory. If `zero` is true, the space will be zeroed when it is allocated; this
199
- /// is not necessary unless `bcx` does not dominate the end of `scope`.
198
+ /// initialize the memory.
200
199
pub fn lvalue_scratch_datum < ' blk , ' tcx , A , F > ( bcx : Block < ' blk , ' tcx > ,
201
200
ty : Ty < ' tcx > ,
202
201
name : & str ,
203
- zero : bool ,
204
202
scope : cleanup:: ScopeId ,
205
203
arg : A ,
206
204
populate : F )
207
205
-> DatumBlock < ' blk , ' tcx , Lvalue > where
208
206
F : FnOnce ( A , Block < ' blk , ' tcx > , ValueRef ) -> Block < ' blk , ' tcx > ,
209
207
{
210
- let scratch = if zero {
211
- alloca_zeroed ( bcx, ty, name)
212
- } else {
213
- let llty = type_of:: type_of ( bcx. ccx ( ) , ty) ;
214
- alloca ( bcx, llty, name)
215
- } ;
208
+ let llty = type_of:: type_of ( bcx. ccx ( ) , ty) ;
209
+ let scratch = alloca ( bcx, llty, name) ;
216
210
217
211
// Subtle. Populate the scratch memory *before* scheduling cleanup.
218
212
let bcx = populate ( arg, bcx, scratch) ;
@@ -383,7 +377,7 @@ impl<'tcx> Datum<'tcx, Rvalue> {
383
377
384
378
ByValue => {
385
379
lvalue_scratch_datum (
386
- bcx, self . ty , name, false , scope, self ,
380
+ bcx, self . ty , name, scope, self ,
387
381
|this, bcx, llval| this. store_to ( bcx, llval) )
388
382
}
389
383
}
0 commit comments