method vexpr e =
let do_change iosh vi =
let ido = RD.iosh_singleton_lookup iosh vi in
(match ido with
Some id ->
let riviho = getDefRhs id in
(match riviho with
Some(RD.RDCall(i) as r, dsid, defiosh) ->
if !debug then Cilmsg.debug "Can I replace %s with %a?" vi.vname d_instr i;
if ok_to_replace vi iosh sid defiosh dsid fd r
then (if !debug then (Cilmsg.debug "Yes.");
IH.add iioh vi.vid (Some(i));
DoChildren)
else (if !debug then (Cilmsg.debug "No.");
DoChildren)
| _ -> DoChildren)
| _ -> DoChildren)
in
match e.enode with
Lval (Var vi,NoOffset) ->
(if check_forms vi.vname forms then
if IH.mem iioh vi.vid
then (IH.replace iioh vi.vid None; DoChildren)
else
(match cur_rd_dat with
Some(_,_s,iosh) -> do_change iosh vi
| None -> let iviho = RD.getRDs sid in
match iviho with
Some(_,_s,iosh) ->
(if !debug then (Cilmsg.debug "Try to change %s:%d outside of instruction." vi.vname vi.vid);
do_change iosh vi)
| None ->
(if !debug then (Cilmsg.debug "%s in statement w/o RD info" vi.vname);
DoChildren))
else DoChildren)
| _ -> DoChildren