From 8b1bbeed703da7ba78dfe2728c99b0ec9088cf47 Mon Sep 17 00:00:00 2001 From: Brian Campbell Date: Tue, 24 Jul 2018 17:38:18 +0100 Subject: Move monomorphisation after mapping rewrites Fixes monomorphisation on files using mappings. Also extended constant propagation to handle pattern matches on bitvector expressions (because an earlier rewrite replaces the literals). Also moved L_undef rewriting because monomorphisation can handle them but not the replacement functions. --- test/mono/mapping.sail | 16 ++++++++++++++++ test/mono/pass/mapping | 1 + 2 files changed, 17 insertions(+) create mode 100644 test/mono/mapping.sail create mode 100644 test/mono/pass/mapping (limited to 'test') diff --git a/test/mono/mapping.sail b/test/mono/mapping.sail new file mode 100644 index 00000000..ecc06b0b --- /dev/null +++ b/test/mono/mapping.sail @@ -0,0 +1,16 @@ +$include + +/* Trivial example with mapping that doesn't really need monomorphised */ + +enum foo = {A,B} + +mapping map_foo : foo <-> bool = { + A <-> true, + B <-> false +} + +val run : unit -> unit effect {escape} + +function run() = { + assert(map_foo(A)) +} \ No newline at end of file diff --git a/test/mono/pass/mapping b/test/mono/pass/mapping new file mode 100644 index 00000000..3a95be81 --- /dev/null +++ b/test/mono/pass/mapping @@ -0,0 +1 @@ +mapping.sail -auto_mono \ No newline at end of file -- cgit v1.2.3