summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorBrian Campbell2018-01-16 11:32:50 +0000
committerBrian Campbell2018-01-16 11:32:50 +0000
commit4d0162a5dbeea6286fbeecdc3cec3b4e55fada8c (patch)
tree1daebda2367540ff866607e941ece5e02250d3fc /src
parentb4c367435b335f6a7160ed379408425c66c39ae1 (diff)
Another useful monomorphisation rewrite
Diffstat (limited to 'src')
-rw-r--r--src/monomorphise.ml9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/monomorphise.ml b/src/monomorphise.ml
index b77b49cf..9f67e93f 100644
--- a/src/monomorphise.ml
+++ b/src/monomorphise.ml
@@ -2778,6 +2778,15 @@ let rewrite_app env typ (id,args) =
| _ -> E_app (id,args)
+ else if is_id env (Id "UInt") id then
+ let is_slice = is_id env (Id "slice") in
+ match args with
+ | [E_aux (E_app (slice1, [vector1; start1; length1]),_)]
+ when is_slice slice1 && not (is_constant length1) ->
+ E_app (mk_id "UInt_slice", [vector1; start1; length1])
+
+ | _ -> E_app (id,args)
+
else E_app (id,args)
let rewrite_aux = function