struct ConstAnalysis<'tcx> {
map: Map,
tcx: TyCtxt<'tcx>,
ecx: InterpCx<'tcx, 'tcx, DummyMachine>,
param_env: ParamEnv<'tcx>,
}Fields
map: Maptcx: TyCtxt<'tcx>ecx: InterpCx<'tcx, 'tcx, DummyMachine>param_env: ParamEnv<'tcx>Implementations
sourceimpl<'tcx> ConstAnalysis<'tcx>
impl<'tcx> ConstAnalysis<'tcx>
pub fn new(tcx: TyCtxt<'tcx>, body: &Body<'tcx>, map: Map) -> Self
fn binary_op(
&self,
state: &mut State<FlatSet<ScalarTy<'tcx>>>,
op: BinOp,
left: &Operand<'tcx>,
right: &Operand<'tcx>
) -> (FlatSet<ScalarTy<'tcx>>, FlatSet<bool>)
fn eval_operand(
&self,
op: &Operand<'tcx>,
state: &mut State<FlatSet<ScalarTy<'tcx>>>
) -> FlatSet<ImmTy<'tcx>>
fn wrap_scalar(&self, scalar: Scalar, ty: Ty<'tcx>) -> FlatSet<ScalarTy<'tcx>>
fn wrap_immediate(&self, imm: Immediate, ty: Ty<'tcx>) -> FlatSet<ScalarTy<'tcx>>
fn wrap_immty(&self, val: ImmTy<'tcx>) -> FlatSet<ScalarTy<'tcx>>
Trait Implementations
sourceimpl<'tcx> ValueAnalysis<'tcx> for ConstAnalysis<'tcx>
impl<'tcx> ValueAnalysis<'tcx> for ConstAnalysis<'tcx>
type Value = FlatSet<ScalarTy<'tcx>>
type Value = FlatSet<ScalarTy<'tcx>>
For each place of interest, the analysis tracks a value of the given type.
const NAME: &'static str = "ConstAnalysis"
fn map(&self) -> &Map
fn handle_assign(
&self,
target: Place<'tcx>,
rvalue: &Rvalue<'tcx>,
state: &mut State<Self::Value>
)
fn handle_rvalue(
&self,
rvalue: &Rvalue<'tcx>,
state: &mut State<Self::Value>
) -> ValueOrPlace<Self::Value>
fn handle_constant(
&self,
constant: &Constant<'tcx>,
_state: &mut State<Self::Value>
) -> Self::Value
fn handle_switch_int(
&self,
discr: &Operand<'tcx>,
apply_edge_effects: &mut impl SwitchIntEdgeEffects<State<Self::Value>>
)
fn handle_statement(
&self,
statement: &Statement<'tcx>,
state: &mut State<Self::Value>
)
fn super_statement(
&self,
statement: &Statement<'tcx>,
state: &mut State<Self::Value>
)
fn handle_intrinsic(
&self,
intrinsic: &NonDivergingIntrinsic<'tcx>,
state: &mut State<Self::Value>
)
fn super_intrinsic(
&self,
intrinsic: &NonDivergingIntrinsic<'tcx>,
state: &mut State<Self::Value>
)
fn super_assign(
&self,
target: Place<'tcx>,
rvalue: &Rvalue<'tcx>,
state: &mut State<Self::Value>
)
fn super_rvalue(
&self,
rvalue: &Rvalue<'tcx>,
state: &mut State<Self::Value>
) -> ValueOrPlace<Self::Value>
fn handle_operand(
&self,
operand: &Operand<'tcx>,
state: &mut State<Self::Value>
) -> ValueOrPlace<Self::Value>
fn super_operand(
&self,
operand: &Operand<'tcx>,
state: &mut State<Self::Value>
) -> ValueOrPlace<Self::Value>
fn super_constant(
&self,
_constant: &Constant<'tcx>,
_state: &mut State<Self::Value>
) -> Self::Value
sourcefn handle_terminator(
&self,
terminator: &Terminator<'tcx>,
state: &mut State<Self::Value>
)
fn handle_terminator(
&self,
terminator: &Terminator<'tcx>,
state: &mut State<Self::Value>
)
The effect of a successful function call return should not be
applied here, see
Analysis::apply_terminator_effect. Read morefn super_terminator(
&self,
terminator: &Terminator<'tcx>,
_state: &mut State<Self::Value>
)
fn handle_call_return(
&self,
return_places: CallReturnPlaces<'_, 'tcx>,
state: &mut State<Self::Value>
)
fn super_call_return(
&self,
return_places: CallReturnPlaces<'_, 'tcx>,
state: &mut State<Self::Value>
)
fn super_switch_int(
&self,
_discr: &Operand<'tcx>,
_apply_edge_effects: &mut impl SwitchIntEdgeEffects<State<Self::Value>>
)
fn wrap(self) -> ValueAnalysisWrapper<Self>where
Self: Sized,
Auto Trait Implementations
impl<'tcx> !RefUnwindSafe for ConstAnalysis<'tcx>
impl<'tcx> !Send for ConstAnalysis<'tcx>
impl<'tcx> !Sync for ConstAnalysis<'tcx>
impl<'tcx> Unpin for ConstAnalysis<'tcx>
impl<'tcx> !UnwindSafe for ConstAnalysis<'tcx>
Blanket Implementations
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Layout
Note: Most layout information is completely unstable and may even differ between compilations. The only exception is types with certain repr(...) attributes. Please see the Rust Reference’s “Type Layout” chapter for details on type layout guarantees.
Size: 256 bytes