Project

General

Profile

Revision 58a463e7 src/compiler_common.ml

View differences:

src/compiler_common.ml
188 188
      Stateless.pp_error err;
189 189
    raise exc
190 190

  
191
let is_stateful topdecl =
192
  match topdecl.top_decl_desc with
193
  | Node nd -> (match nd.node_stateless with Some b -> not b | None -> not nd.node_dec_stateless)
194
  | ImportedNode nd -> not nd.nodei_stateless 
195
  | _ -> false
191 196

  
192 197

  
193 198
let import_dependencies prog =
......
202 207
      let lusic = Modules.import_dependency dep.top_decl_loc (local, s) in
203 208
      Log.report ~level:1 (fun fmt -> Format.fprintf fmt "@]@ ");
204 209
      let (lusi_type_env, lusi_clock_env) = get_envs_from_top_decls lusic.Lusic.contents in
205
      (local, s, lusic.Lusic.contents)::compilation_dep,
210
      let is_stateful = List.exists is_stateful lusic.Lusic.contents in
211
      let new_dep = Dep (local, s, lusic.Lusic.contents, is_stateful ) in
212
      new_dep::compilation_dep,
206 213
      Env.overwrite type_env lusi_type_env,
207 214
      Env.overwrite clock_env lusi_clock_env)
208 215
    ([], Basic_library.type_env, Basic_library.clock_env)

Also available in: Unified diff