Revision 0f36882c
Added by Xavier Thirioux over 6 years ago
src/compiler_common.ml | ||
---|---|---|
216 | 216 |
|
217 | 217 |
|
218 | 218 |
let import_dependencies prog = |
219 |
Log.report ~level:1 (fun fmt -> fprintf fmt "@[<v 2>.. extracting dependencies@,");
|
|
219 |
Log.report ~level:1 (fun fmt -> fprintf fmt "@[<v 0>.. extracting dependencies@ ");
|
|
220 | 220 |
let dependencies = Corelang.get_dependencies prog in |
221 | 221 |
let deps = |
222 | 222 |
List.fold_left |
223 | 223 |
(fun (compilation_dep, type_env, clock_env) dep -> |
224 | 224 |
let (local, s) = Corelang.dependency_of_top dep in |
225 | 225 |
let basename = Modules.name_dependency (local, s) in |
226 |
Log.report ~level:1 (fun fmt -> Format.fprintf fmt "@[<v 0>Library %s@," basename);
|
|
226 |
Log.report ~level:1 (fun fmt -> Format.fprintf fmt " Library %s@ " basename);
|
|
227 | 227 |
let lusic = Modules.import_dependency dep.top_decl_loc (local, s) in |
228 |
Log.report ~level:1 (fun fmt -> Format.fprintf fmt "@]@ ");
|
|
228 |
(*Log.report ~level:1 (fun fmt -> Format.fprintf fmt "");*)
|
|
229 | 229 |
let (lusi_type_env, lusi_clock_env) = get_envs_from_top_decls lusic.Lusic.contents in |
230 | 230 |
let is_stateful = List.exists is_stateful lusic.Lusic.contents in |
231 | 231 |
let new_dep = Dep (local, s, lusic.Lusic.contents, is_stateful ) in |
src/modules.ml | ||
---|---|---|
154 | 154 |
) |
155 | 155 |
|
156 | 156 |
let rec load_header_rec imported header = |
157 |
List.fold_left (fun imp decl -> |
|
157 |
List.fold_left (fun imported decl ->
|
|
158 | 158 |
match decl.top_decl_desc with |
159 | 159 |
| Node nd -> assert false |
160 |
| ImportedNode ind -> (add_imported_node ind.nodei_id decl; imp) |
|
161 |
| Const c -> (add_const true c.const_id decl; imp) |
|
162 |
| TypeDef tdef -> (add_type true tdef.tydef_id decl; imp) |
|
160 |
| ImportedNode ind -> (add_imported_node ind.nodei_id decl; imported)
|
|
161 |
| Const c -> (add_const true c.const_id decl; imported)
|
|
162 |
| TypeDef tdef -> (add_type true tdef.tydef_id decl; imported)
|
|
163 | 163 |
| Open (local, dep) -> |
164 | 164 |
let basename = name_dependency (local, dep) in |
165 |
if ISet.mem basename imported then imp else |
|
165 |
if ISet.mem basename imported then imported else
|
|
166 | 166 |
let lusic = import_dependency_aux decl.top_decl_loc (local, dep) |
167 | 167 |
in load_header_rec (ISet.add basename imported) lusic.Lusic.contents |
168 | 168 |
) imported header |
... | ... | |
179 | 179 |
);; |
180 | 180 |
|
181 | 181 |
let rec load_program_rec imported program = |
182 |
List.fold_left (fun imp decl -> |
|
182 |
List.fold_left (fun imported decl ->
|
|
183 | 183 |
match decl.top_decl_desc with |
184 |
| Node nd -> (add_node nd.node_id decl; imp) |
|
184 |
| Node nd -> (add_node nd.node_id decl; imported)
|
|
185 | 185 |
| ImportedNode ind -> assert false |
186 |
| Const c -> (add_const false c.const_id decl; imp) |
|
187 |
| TypeDef tdef -> (add_type false tdef.tydef_id decl; imp) |
|
186 |
| Const c -> (add_const false c.const_id decl; imported)
|
|
187 |
| TypeDef tdef -> (add_type false tdef.tydef_id decl; imported)
|
|
188 | 188 |
| Open (local, dep) -> |
189 | 189 |
let basename = name_dependency (local, dep) in |
190 |
if ISet.mem basename imported then imp else |
|
190 |
if ISet.mem basename imported then imported else
|
|
191 | 191 |
let lusic = import_dependency_aux decl.top_decl_loc (local, dep) |
192 | 192 |
in load_header_rec (ISet.add basename imported) lusic.Lusic.contents |
193 | 193 |
) imported program |
src/plugins/scopes/scopes.ml | ||
---|---|---|
313 | 313 |
|
314 | 314 |
let pp fmt = pp_scopes fmt !scopes_map |
315 | 315 |
|
316 |
let check_force_stateful () = true
|
|
316 |
let check_force_stateful () = !option_scopes
|
|
317 | 317 |
|
318 | 318 |
let refine_machine_code prog machine_code = |
319 | 319 |
if show_scopes () then |
src/utils.ml | ||
---|---|---|
326 | 326 |
pp_list lid pp_fun "" "." "." |
327 | 327 |
|
328 | 328 |
let pp_date fmt tm = |
329 |
Format.fprintf fmt "%i/%i/%i, %i:%i:%i"
|
|
329 |
Format.fprintf fmt "%i/%i/%i, %02i:%02i:%02i"
|
|
330 | 330 |
(tm.Unix.tm_year + 1900) |
331 | 331 |
tm.Unix.tm_mon |
332 | 332 |
tm.Unix.tm_mday |
Also available in: Unified diff
several bugs/oddities corrected:
- bizarre date stamping (when generating .lusi files)
- bug in loading libraries, forbidding several (transitive) imports of the same library.
- plugin scopes was wrongly always activated