| effect (T.UNOP (_, a)) = effect a
| effect (T.MEMORY _) = true
| effect (T.ALLOC _) = true
| effect (T.UNOP (_, a)) = effect a
| effect (T.MEMORY _) = true
| effect (T.ALLOC _) = true
| effect (T.COND (a, b, c)) = (effect a) orelse (effect b) orelse (effect c)
| effect (T.STMVAR (sl, e)) = true (* Has to be, to be safe <--- jwise is an assclown, he was too lazy to write a effect_stm *)
| effect (T.NULLPTR) = false
fun effect_stm (T.MOVE (e1,e2)) = effect e1 orelse effect e2
| effect (T.COND (a, b, c)) = (effect a) orelse (effect b) orelse (effect c)
| effect (T.STMVAR (sl, e)) = true (* Has to be, to be safe <--- jwise is an assclown, he was too lazy to write a effect_stm *)
| effect (T.NULLPTR) = false
fun effect_stm (T.MOVE (e1,e2)) = effect e1 orelse effect e2
| effect_stm (T.EFFECT e) = effect e
| effect_stm (T.JUMPIFN (e,_)) = effect e
| effect_stm _ = false
| effect_stm (T.EFFECT e) = effect e
| effect_stm (T.JUMPIFN (e,_)) = effect e
| effect_stm _ = false
| pp_exp (T.BINOP (binop, e1, e2)) =
"(" ^ pp_exp e1 ^ " " ^ pp_binop binop ^ " " ^ pp_exp e2 ^ ")"
| pp_exp (T.UNOP (unop, e1)) =
pp_unop unop ^ "(" ^ pp_exp e1 ^ ")"
| pp_exp (T.BINOP (binop, e1, e2)) =
"(" ^ pp_exp e1 ^ " " ^ pp_binop binop ^ " " ^ pp_exp e2 ^ ")"
| pp_exp (T.UNOP (unop, e1)) =
pp_unop unop ^ "(" ^ pp_exp e1 ^ ")"
- | pp_exp (T.CALL (f, l, sz)) =
- Symbol.name f ^ "(" ^ (String.concatWith ", " (List.map (fn (e, _) => pp_exp e) l)) ^ ")"
- | pp_exp (T.MEMORY (exp, sz)) = "M(" ^ Temp.sfx sz ^ ")[" ^ pp_exp exp ^ "]"
+ | pp_exp (T.CALL (f, l)) =
+ Symbol.name f ^ "(" ^ (String.concatWith ", " (List.map (fn e => pp_exp e) l)) ^ ")"
+ | pp_exp (T.MEMORY (exp)) = "M[" ^ pp_exp exp ^ "]"
| pp_exp (T.COND(c,e1,e2)) = "(" ^ pp_exp c ^ ") ? (" ^ pp_exp e1 ^ ") : (" ^ pp_exp e2 ^ ")"
| pp_exp (T.STMVAR(sl,v)) = "({" ^ (foldr (fn (st,s) => (pp_stm st) ^ "; " ^ s) "" sl) ^ (pp_exp v) ^ "})"
| pp_exp (T.NULLPTR) = "NULL"
and pp_stm (T.MOVE (e1,e2)) =
pp_exp e1 ^ " <-- " ^ pp_exp e2
| pp_exp (T.COND(c,e1,e2)) = "(" ^ pp_exp c ^ ") ? (" ^ pp_exp e1 ^ ") : (" ^ pp_exp e2 ^ ")"
| pp_exp (T.STMVAR(sl,v)) = "({" ^ (foldr (fn (st,s) => (pp_stm st) ^ "; " ^ s) "" sl) ^ (pp_exp v) ^ "})"
| pp_exp (T.NULLPTR) = "NULL"
and pp_stm (T.MOVE (e1,e2)) =
pp_exp e1 ^ " <-- " ^ pp_exp e2