@@ -12,10 +12,7 @@ use rustc::mir::interpret::{
12
12
InterpResult , InterpError , InboundsCheck ,
13
13
sign_extend, truncate,
14
14
} ;
15
- use super :: {
16
- InterpretCx , Machine ,
17
- MemPlace , MPlaceTy , PlaceTy , Place ,
18
- } ;
15
+ use super :: { InterpretCx , Machine , MemPlace , MPlaceTy , PlaceTy , Place } ;
19
16
pub use rustc:: mir:: interpret:: ScalarMaybeUndef ;
20
17
21
18
/// A `Value` represents a single immediate self-contained Rust value.
@@ -190,6 +187,19 @@ impl<'tcx, Tag: Copy> ImmTy<'tcx, Tag>
190
187
}
191
188
}
192
189
190
+ impl < ' tcx , Tag > OpTy < ' tcx , Tag >
191
+ {
192
+ /// This is used by [priroda](https://github.com/oli-obk/priroda) to create an `OpTy`.
193
+ ///
194
+ /// Do not use this from inside rustc.
195
+ pub fn from_op_and_layout_unchecked ( op : Operand < Tag > , layout : TyLayout < ' tcx > ) -> Self {
196
+ OpTy {
197
+ op,
198
+ layout,
199
+ }
200
+ }
201
+ }
202
+
193
203
// Use the existing layout if given (but sanity check in debug mode),
194
204
// or compute the layout.
195
205
#[ inline( always) ]
@@ -395,7 +405,6 @@ impl<'a, 'mir, 'tcx, M: Machine<'a, 'mir, 'tcx>> InterpretCx<'a, 'mir, 'tcx, M>
395
405
} )
396
406
}
397
407
398
- /// This is used by [priroda](https://github.com/oli-obk/priroda) to get an OpTy from a local
399
408
pub fn access_local (
400
409
& self ,
401
410
frame : & super :: Frame < ' mir , ' tcx , M :: PointerTag , M :: FrameExtra > ,
0 commit comments