|
|
@@ -72,7 +72,7 @@ let rec array_dims node =
|
|
|
let (decs, dims) = make_dims make_dimname values make_dec in
|
|
|
Block (decs @ [GlobalDef (export, ArrayDims (ctype, dims), name, None, ann)])
|
|
|
|
|
|
- (*
|
|
|
+ (* DISABLED, this is also done in extern.ml
|
|
|
| GlobalDec (ArrayDims (ctype, values), name, ann) ->
|
|
|
(*
|
|
|
let rec make_decs = function
|
|
|
@@ -87,7 +87,7 @@ let rec array_dims node =
|
|
|
let make_dec value name = GlobalDec (Int, name, []) in
|
|
|
let (decs, dims) = make_dims name values make_dec in
|
|
|
Block (decs @ [GlobalDec (ArrayDims (ctype, dims), name, ann)])
|
|
|
- *)
|
|
|
+ *)
|
|
|
|
|
|
| node -> transform_children array_dims node
|
|
|
|
|
|
@@ -153,7 +153,8 @@ let rec move_inits = function
|
|
|
Program (init_func :: decls, ann)
|
|
|
end
|
|
|
|
|
|
- (* Split local variable initialisations in declaration and assignment *)
|
|
|
+ (* DISABLED, interleaved declarations and assignments are allowed in the
|
|
|
+ * intermediate representation
|
|
|
| FunDef (export, ret_type, name, params, Block body, ann) ->
|
|
|
let rec place_inits inits = function
|
|
|
| VarDecs lst :: tl ->
|
|
|
@@ -165,6 +166,7 @@ let rec move_inits = function
|
|
|
in
|
|
|
let body = Block (place_inits [] body) in
|
|
|
FunDef (export, ret_type, name, params, body, ann)
|
|
|
+ *)
|
|
|
|
|
|
| node -> transform_children move_inits node
|
|
|
|
|
|
@@ -218,8 +220,8 @@ let for_to_while node =
|
|
|
)), ann));
|
|
|
]
|
|
|
|
|
|
- (* DISABLED, while-loops are explicitly supported by the assembly phase
|
|
|
(* Transform while-loops to do-while loops in if-statements *)
|
|
|
+ (* DISABLED, while-loops are explicitly supported by the assembly phase
|
|
|
| While (cond, body, ann) ->
|
|
|
let cond = traverse new_vars cond in
|
|
|
let body = traverse new_vars body in
|