let lvh_combine lvh1 lvh2 =
if !debug then Cilmsg.debug ~level:2 "lvh_combine: combining %a\n and\n %a"
lvh_pretty lvh1 lvh_pretty lvh2;
let lvh' = LvExpHash.copy lvh1 in
LvExpHash.iter (fun lv e1 ->
try let e2l = LvExpHash.find_all lvh2 lv in
if not(List.exists (fun e2 -> compareExpStripCasts e1 e2) e2l)
then let e1l = LvExpHash.find_all lvh' lv in
let e1l' = List.filter (fun e -> not(compareExpStripCasts e e1)) e1l in
LvExpHash.remove lvh' lv;
List.iter (fun e -> LvExpHash.add lvh' lv e) e1l'
with Not_found ->
LvExpHash.remove lvh' lv) lvh1;
if !debug then Cilmsg.debug "with result %a" lvh_pretty lvh';
lvh'