summaryrefslogtreecommitdiff
path: root/src/CfimAst.ml
diff options
context:
space:
mode:
authorSon Ho2021-12-01 13:30:36 +0100
committerSon Ho2021-12-01 13:30:36 +0100
commitd40b634c237de25574ebd1bbf64b9a7a81253f2b (patch)
tree9d3eaa96933521306a16b063253aa2978a65aaaf /src/CfimAst.ml
parent7ff46abab5b43c23a1144e9d35ed41d895406d20 (diff)
Merge statements and expressions into statements
Diffstat (limited to 'src/CfimAst.ml')
-rw-r--r--src/CfimAst.ml19
1 files changed, 7 insertions, 12 deletions
diff --git a/src/CfimAst.ml b/src/CfimAst.ml
index d2bf9181..9acf40ff 100644
--- a/src/CfimAst.ml
+++ b/src/CfimAst.ml
@@ -50,22 +50,17 @@ type statement =
(** Continue to (outer) loop. The loop identifier works
the same way as for [Break] *)
| Nop
-[@@deriving show]
-
-type expression =
- | Statement of statement
- | Sequence of expression * expression
+ | Sequence of statement * statement
| Switch of operand * switch_targets
- | Loop of expression
+ | Loop of statement
[@@deriving show]
-(* TODO: merge with statement *)
and switch_targets =
- | If of expression * expression (** Gives the "if" and "else" blocks *)
- | SwitchInt of integer_type * (scalar_value * expression) list * expression
+ | If of statement * statement (** Gives the "if" and "else" blocks *)
+ | SwitchInt of integer_type * (scalar_value * statement) list * statement
(** The targets for a switch over an integer are:
- - the list `(matched value, expression to execute)`
- - the "otherwise" expression.
+ - the list `(matched value, statement to execute)`
+ - the "otherwise" statement.
Also note that we precise the type of the integer (uint32, int64, etc.)
which we switch on. *)
[@@deriving show]
@@ -77,6 +72,6 @@ type fun_def = {
divergent : bool;
arg_count : int;
locals : var list;
- body : expression;
+ body : statement;
}
[@@deriving show]