Skip to content
Snippets Groups Projects
Commit 0c97c20f authored by Forget Julien's avatar Forget Julien
Browse files

Don't print a case: in loop_bounds(...) for symbolic loop bounds.

parent ee50ac3c
Branches
No related tags found
No related merge requests found
......@@ -23,6 +23,18 @@ type param = string
(** Symbolic integer is either a constant or a symbol *)
type symb_int = SInt of int | SParam of param
(* Returns true if sint is a symbol. *)
let is_symb sint =
match sint with
| SInt _ -> false
| SParam _ -> true
(* Returns the constant corresponding to [sint]. Fails if [sint] is a symbol. *)
let int_of_symb sint =
match sint with
| SInt i -> i
| SParam _ -> Utils.internal_error "int_of_symb" "cannot be applied to param"
open Format
let pp_param out_f p =
......
......@@ -18,13 +18,11 @@ let c_array pp_elem ty_string out_f array =
pp_elem out_f)
array
let c_symb_int out_f sint =
match sint with
| SInt i -> pp_print_int out_f i
| SParam p -> pp_print_text out_f p
let c_loop_bound out_f lname bound =
fprintf out_f "case %s: return %a;@ " lname c_symb_int bound
match bound with
| SInt i ->
fprintf out_f "case %s: return %d;@ " lname i
| SParam _ -> ()
let c_loop_bounds out_f bounds =
fprintf out_f "@[<v 2>int loop_bounds(int loop_id) {@ ";
......
......@@ -36,18 +36,6 @@ type t =
let bot_f = FConst bot_wcet
(* Returns true if sint is a symbol. *)
let is_symb sint =
match sint with
| SInt _ -> false
| SParam _ -> true
(* Returns the constant corresponding to [sint]. Fails if [sint] is a symbol. *)
let int_of_symb sint =
match sint with
| SInt i -> i
| SParam _ -> Utils.internal_error "int_of_symb" "cannot be applied to param"
(* Pretty printing *)
open Format
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment