@@ -25,7 +25,6 @@ use type_of;
25
25
use tvec;
26
26
use value:: Value ;
27
27
use Disr ;
28
- use glue;
29
28
30
29
use super :: MirContext ;
31
30
use super :: operand:: { OperandRef , OperandValue } ;
@@ -48,7 +47,6 @@ impl<'bcx, 'tcx> MirContext<'bcx, 'tcx> {
48
47
// FIXME: consider not copying constants through stack. (fixable by translating
49
48
// constants into OperandValue::Ref, why don’t we do that yet if we don’t?)
50
49
self . store_operand ( & bcx, dest. llval , tr_operand) ;
51
- self . set_operand_dropped ( & bcx, operand) ;
52
50
bcx
53
51
}
54
52
@@ -92,7 +90,6 @@ impl<'bcx, 'tcx> MirContext<'bcx, 'tcx> {
92
90
}
93
91
}
94
92
} ) ;
95
- self . set_operand_dropped ( & bcx, source) ;
96
93
bcx
97
94
}
98
95
@@ -107,7 +104,6 @@ impl<'bcx, 'tcx> MirContext<'bcx, 'tcx> {
107
104
block
108
105
} )
109
106
} ) ;
110
- self . set_operand_dropped ( & bcx, elem) ;
111
107
bcx
112
108
}
113
109
@@ -128,7 +124,6 @@ impl<'bcx, 'tcx> MirContext<'bcx, 'tcx> {
128
124
val, disr, i) ;
129
125
self . store_operand ( & bcx, lldest_i, op) ;
130
126
}
131
- self . set_operand_dropped ( & bcx, operand) ;
132
127
}
133
128
} ,
134
129
_ => {
@@ -167,7 +162,6 @@ impl<'bcx, 'tcx> MirContext<'bcx, 'tcx> {
167
162
let dest = bcx. gepi ( dest. llval , & [ 0 , i] ) ;
168
163
self . store_operand ( & bcx, dest, op) ;
169
164
}
170
- self . set_operand_dropped ( & bcx, operand) ;
171
165
}
172
166
}
173
167
}
@@ -209,9 +203,6 @@ impl<'bcx, 'tcx> MirContext<'bcx, 'tcx> {
209
203
asm:: trans_inline_asm ( bcx, asm, outputs, input_vals) ;
210
204
} ) ;
211
205
212
- for input in inputs {
213
- self . set_operand_dropped ( & bcx, input) ;
214
- }
215
206
bcx
216
207
}
217
208
@@ -269,7 +260,6 @@ impl<'bcx, 'tcx> MirContext<'bcx, 'tcx> {
269
260
// &'a fmt::Debug+Send => &'a fmt::Debug,
270
261
// So we need to pointercast the base to ensure
271
262
// the types match up.
272
- self . set_operand_dropped ( & bcx, source) ;
273
263
let llcast_ty = type_of:: fat_ptr_base_ty ( bcx. ccx ( ) , cast_ty) ;
274
264
let lldata = bcx. pointercast ( lldata, llcast_ty) ;
275
265
OperandValue :: FatPtr ( lldata, llextra)
@@ -280,7 +270,6 @@ impl<'bcx, 'tcx> MirContext<'bcx, 'tcx> {
280
270
base:: unsize_thin_ptr ( bcx, lldata,
281
271
operand. ty , cast_ty)
282
272
} ) ;
283
- self . set_operand_dropped ( & bcx, source) ;
284
273
OperandValue :: FatPtr ( lldata, llextra)
285
274
}
286
275
OperandValue :: Ref ( _) => {
@@ -569,30 +558,23 @@ impl<'bcx, 'tcx> MirContext<'bcx, 'tcx> {
569
558
}
570
559
}
571
560
572
- pub fn rvalue_creates_operand < ' bcx , ' tcx > ( mir : & mir:: Mir < ' tcx > ,
573
- bcx : & BlockAndBuilder < ' bcx , ' tcx > ,
561
+ pub fn rvalue_creates_operand < ' bcx , ' tcx > ( _mir : & mir:: Mir < ' tcx > ,
562
+ _bcx : & BlockAndBuilder < ' bcx , ' tcx > ,
574
563
rvalue : & mir:: Rvalue < ' tcx > ) -> bool {
575
564
match * rvalue {
576
565
mir:: Rvalue :: Ref ( ..) |
577
566
mir:: Rvalue :: Len ( ..) |
578
567
mir:: Rvalue :: Cast ( ..) | // (*)
579
568
mir:: Rvalue :: BinaryOp ( ..) |
580
569
mir:: Rvalue :: UnaryOp ( ..) |
581
- mir:: Rvalue :: Box ( ..) =>
570
+ mir:: Rvalue :: Box ( ..) |
571
+ mir:: Rvalue :: Use ( ..) =>
582
572
true ,
583
573
mir:: Rvalue :: Repeat ( ..) |
584
574
mir:: Rvalue :: Aggregate ( ..) |
585
575
mir:: Rvalue :: Slice { .. } |
586
576
mir:: Rvalue :: InlineAsm { .. } =>
587
577
false ,
588
- mir:: Rvalue :: Use ( ref operand) => {
589
- let ty = mir. operand_ty ( bcx. tcx ( ) , operand) ;
590
- let ty = bcx. monomorphize ( & ty) ;
591
- // Types that don't need dropping can just be an operand,
592
- // this allows temporary lvalues, used as rvalues, to
593
- // avoid a stack slot when it's unnecessary
594
- !glue:: type_needs_drop ( bcx. tcx ( ) , ty)
595
- }
596
578
}
597
579
598
580
// (*) this is only true if the type is suitable
0 commit comments