summaryrefslogtreecommitdiff
path: root/src/ast_util.ml
diff options
context:
space:
mode:
authorAlasdair Armstrong2018-01-12 17:27:37 +0000
committerAlasdair Armstrong2018-01-12 17:27:37 +0000
commite56eafdb87f3f4e362cca7d0a6ca3d8a0e849b44 (patch)
tree4b19d06dd6a234c5524c88e8aeceefce41ca8864 /src/ast_util.ml
parentebc33211b0a3a6c14bbe4106b9a618b8ac594f52 (diff)
parentffcf8a814cdd23eaff9286835478afb66fbb0029 (diff)
Merge remote-tracking branch 'origin/experiments' into sail2
Diffstat (limited to 'src/ast_util.ml')
-rw-r--r--src/ast_util.ml8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/ast_util.ml b/src/ast_util.ml
index e502f86f..206515c5 100644
--- a/src/ast_util.ml
+++ b/src/ast_util.ml
@@ -692,6 +692,14 @@ let id_of_fundef (FD_aux (FD_function (_, _, _, funcls), (l, _))) =
| Some id -> id
| None -> raise (Reporting_basic.err_typ l "funcl list is empty")
+let id_of_type_def_aux = function
+ | TD_abbrev (id, _, _)
+ | TD_record (id, _, _, _, _)
+ | TD_variant (id, _, _, _, _)
+ | TD_enum (id, _, _, _)
+ | TD_bitfield (id, _, _) -> id
+let id_of_type_def (TD_aux (td_aux, _)) = id_of_type_def_aux td_aux
+
module BE = struct
type t = base_effect
let compare be1 be2 = String.compare (string_of_base_effect be1) (string_of_base_effect be2)