Project

General

Profile

Revision e4edf171 src/machine_code_common.ml

View differences:

src/machine_code_common.ml
116 116
let get_stateless_status m =
117 117
 (m.mname.node_dec_stateless, try Utils.desome m.mname.node_stateless with _ -> failwith ("stateless status of machine " ^ m.mname.node_id ^ " not computed"))
118 118

  
119
let is_stateless m = m.minstances = [] && m.mmemory = []
120

  
119 121
let is_input m id =
120 122
  List.exists (fun o -> o.var_id = id.var_id) m.mstep.step_inputs
121 123

  
......
223 225
    end
224 226

  
225 227

  
226
let get_machine_opt name machines =
228
let get_machine_opt machines name =
227 229
  List.fold_left
228 230
    (fun res m ->
229 231
      match res with
......
231 233
      | None -> if m.mname.node_id = name then Some m else None)
232 234
    None machines
233 235

  
236
let get_machine machines node_name =
237
 try
238
  List.find (fun m  -> m.mname.node_id = node_name) machines
239
 with Not_found -> Format.eprintf "Unable to find machine %s in machines %a@.@?"
240
   node_name
241
   (Utils.fprintf_list ~sep:", " (fun fmt m -> Format.pp_print_string fmt m.mname.node_id)) machines
242
   ; assert false
243
     
244
    
234 245
let get_const_assign m id =
235 246
  try
236 247
    match get_instr_desc (List.find

Also available in: Unified diff