summaryrefslogtreecommitdiff
path: root/src/rewriter.ml
diff options
context:
space:
mode:
authorKathy Gray2016-08-10 12:02:22 +0100
committerKathy Gray2016-08-10 12:02:22 +0100
commitdb68a8b79986cfa2e7e60cd7a6502a3fef858b4f (patch)
tree1b2742d816d6ad2d5d392773b5dff3072082e390 /src/rewriter.ml
parentcf2b0b1f6b37096e36707d98b4cafb6c14e64200 (diff)
Fix sizeof code generation to look at parameter bounds
Diffstat (limited to 'src/rewriter.ml')
-rw-r--r--src/rewriter.ml4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/rewriter.ml b/src/rewriter.ml
index d3d843f3..f9959814 100644
--- a/src/rewriter.ml
+++ b/src/rewriter.ml
@@ -375,9 +375,10 @@ let rewrite_exp rewriters nmap (E_aux (exp,(l,annot))) =
| E_internal_exp (l,impl) ->
(match impl with
| Base((_,t),_,_,_,_,bounds) ->
- let bounds = match nmap with | None -> bounds | Some (nm,_) -> add_map_to_bounds nm bounds in
(*let _ = Printf.eprintf "Rewriting internal expression, with type %s, and bounds %s\n"
(t_to_string t) (bounds_to_string bounds) in*)
+ let bounds = match nmap with | None -> bounds | Some (nm,_) -> add_map_to_bounds nm bounds in
+ (*let _ = Printf.eprintf "Bounds after looking at nmap %s\n" (bounds_to_string bounds) in*)
(match t.t with
(*Old case; should possibly be removed*)
| Tapp("register",[TA_typ {t= Tapp("vector",[ _; TA_nexp r;_;_])}])
@@ -406,6 +407,7 @@ let rewrite_exp rewriters nmap (E_aux (exp,(l,annot))) =
(match t.t with
| Tapp("atom",[TA_nexp n]) ->
let nexps = expand_nexp n in
+ (*let _ = Printf.eprintf "Removing sizeof_internal with type %s\n" (t_to_string t) in*)
(match (match_to_program_vars nexps bounds) with
| [] -> rewrite_nexp_to_exp None l n
| map -> rewrite_nexp_to_exp (Some map) l n)