Revision b3f91fdb
Added by Xavier Thirioux almost 8 years ago
src/dimension.ml | ||
---|---|---|
339 | 339 |
in unif dim1 dim2 |
340 | 340 |
|
341 | 341 |
let rec expr_replace_var fvar e = |
342 |
{ e with dim_desc = expr_replace_desc fvar e.dim_desc } |
|
343 |
and expr_replace_desc fvar e = |
|
342 |
{ e with dim_desc = expr_replace_var_desc fvar e.dim_desc }
|
|
343 |
and expr_replace_var_desc fvar e =
|
|
344 | 344 |
let re = expr_replace_var fvar in |
345 | 345 |
match e with |
346 | 346 |
| Dvar |
... | ... | |
351 | 351 |
| Dappl (id, el) -> Dappl (id, List.map re el) |
352 | 352 |
| Dite (g,t,e) -> Dite (re g, re t, re e) |
353 | 353 |
| Dlink e -> Dlink (re e) |
354 |
|
|
355 |
let rec expr_replace_expr fvar e = |
|
356 |
{ e with dim_desc = expr_replace_expr_desc fvar e.dim_desc } |
|
357 |
and expr_replace_expr_desc fvar e = |
|
358 |
let re = expr_replace_expr fvar in |
|
359 |
match e with |
|
360 |
| Dvar |
|
361 |
| Dunivar |
|
362 |
| Dbool _ |
|
363 |
| Dint _ -> e |
|
364 |
| Dident v -> (fvar v).dim_desc |
|
365 |
| Dappl (id, el) -> Dappl (id, List.map re el) |
|
366 |
| Dite (g,t,e) -> Dite (re g, re t, re e) |
|
367 |
| Dlink e -> Dlink (re e) |
Also available in: Unified diff
LOTS of bug correction wrt inlining, still a work in progress...
- global constants were not accounted for
- no good avoidance of name capture when inlining
- static parameters (array sizes and clocks) not handled
- ill-typed generated expressions, when inlining array expressions