let lvalXformClass action data sid fd nofrm = object
inherit nopCilVisitor
method vexpr e =
let castrm e =
stripCastsDeepForPtrArith e
in
match e.enode with
| Lval((Mem e', off) as lv)-> begin
match action data sid lv fd nofrm with
| None ->
let post e =
match e.enode with
| Lval(Mem({enode = Const _}),off') ->
new_exp (Lval(Mem e', off'))
| _ -> stripCastsDeepForPtrArith e
in
ChangeDoChildrenPost(new_exp (Lval(Mem e', off)), post)
| Some e ->
let newt = typeOf(new_exp(Lval lv)) in
let e'' = mkCast ~e ~newt in
ChangeDoChildrenPost(e'', castrm)
end
| Lval lv -> begin
match action data sid lv fd nofrm with
| None -> DoChildren
| Some e' -> begin
let e'' = mkCast ~e:e' ~newt:(typeOf(dummy_exp(Lval lv))) in
ChangeDoChildrenPost(e'', castrm)
end
end
| _ -> ChangeDoChildrenPost(castrm e, castrm)
end