fn codegen_atomic_store(
        &mut self,
        intrinsic: &str,
        mut fargs: Vec<Expr>,
        p: &Place<'tcx>,
        loc: Location,
    ) -> Stmt {
        emit_concurrency_warning!(intrinsic, loc);
        let var1_ref = fargs.remove(0);
        let var1 = var1_ref.dereference().with_location(loc.clone());
        let tmp = self.gen_temp_variable(var1.typ().clone(), loc.clone()).to_expr();
        let decl_stmt = Stmt::decl(tmp.clone(), Some(var1.to_owned()), loc.clone());
        let var2 = fargs.remove(0).with_location(loc.clone());
        let assign_stmt = (var1.clone()).assign(var2, loc.clone());
        let res_stmt = self.codegen_expr_to_place(p, tmp.clone());
        Stmt::atomic_block(vec![decl_stmt, assign_stmt, res_stmt], loc)
    }
/// An atomic store updates the value referenced in
/// its primary argument and returns its previous value
/// -------------------------
/// var = atomic_store(var1, var2)
/// -------------------------
/// unsigned char tmp;
/// tmp = *var1;
/// *var1 = var2;
/// var = tmp;
/// -------------------------
An atomic store updates the value referenced in
its primary argument and returns its previous value




An atomic store updates the value referenced in its primary argument and returns its previous value
fn codegen_atomic_store(
        &mut self,
        intrinsic: &str,
        mut fargs: Vec<Expr>,
        p: &Place<'tcx>,
        loc: Location,
    ) -> Stmt {
        emit_concurrency_warning!(intrinsic, loc);
        let var1_ref = fargs.remove(0);
        let var1 = var1_ref.dereference().with_location(loc.clone());
        let tmp = self.gen_temp_variable(var1.typ().clone(), loc.clone()).to_expr();
        let decl_stmt = Stmt::decl(tmp.clone(), Some(var1.to_owned()), loc.clone());
        let var2 = fargs.remove(0).with_location(loc.clone());
        let assign_stmt = (var1.clone()).assign(var2, loc.clone());
        let res_stmt = self.codegen_expr_to_place(p, tmp.clone());
        Stmt::atomic_block(vec![decl_stmt, assign_stmt, res_stmt], loc)
    }
fn codegen_atomic_store ( & mut self , intrinsic : & str , mut fargs : Vec < Expr > , p : & Place < ' tcx > , loc : Location , ) -> Stmt { emit_concurrency_warning ! ( intrinsic loc ) ; let var1_ref = fargs . remove ( 0 ) ; let var1 = var1_ref . dereference ( ) . with_location ( loc . clone ( ) ) ; let tmp = self . gen_temp_variable ( var1 . typ ( ) . clone ( ) , loc . clone ( ) ) . to_expr ( ) ; let decl_stmt = Stmt :: decl ( tmp . clone ( ) , Some ( var1 . to_owned ( ) ) , loc . clone ( ) ) ; let var2 = fargs . remove ( 0 ) . with_location ( loc . clone ( ) ) ; let assign_stmt = ( var1 . clone ( ) ) . assign ( var2 , loc . clone ( ) ) ; let res_stmt = self . codegen_expr_to_place ( p , tmp . clone ( ) ) ; Stmt :: atomic_block ( vec ! [ decl_stmt assign_stmt res_stmt ] , loc ) }
An atomic store updates the value referenced in
its primary argument and returns its previous value
An atomic store updates the value referenced in its primary argument and returns its previous value
&mut self
intrinsic
&str
fargs
Vec<Expr>
p
&Place<'tcx>
loc
Location