summaryrefslogtreecommitdiff
path: root/compiler
diff options
context:
space:
mode:
authorSon Ho2023-11-21 13:55:46 +0100
committerSon Ho2023-11-21 13:55:46 +0100
commite94cd72ffa63dbc5fc40c7c1a422c1a70ba4a7e5 (patch)
tree922f6bbd6d3bdc6af2f1d351dd3d4104861cfc5c /compiler
parentf852e1a1334b7506c0baf366b9e75cd01b9c843e (diff)
Add an `is_local` field to declarations
Diffstat (limited to 'compiler')
-rw-r--r--compiler/Pure.ml4
-rw-r--r--compiler/PureMicroPasses.ml1
-rw-r--r--compiler/PureUtils.ml2
-rw-r--r--compiler/SymbolicToPure.ml8
-rw-r--r--compiler/dune4
5 files changed, 16 insertions, 3 deletions
diff --git a/compiler/Pure.ml b/compiler/Pure.ml
index 40711e53..ebcaa68d 100644
--- a/compiler/Pure.ml
+++ b/compiler/Pure.ml
@@ -381,6 +381,7 @@ type predicates = { trait_type_constraints : trait_type_constraint list }
type type_decl = {
def_id : TypeDeclId.id;
+ is_local : bool;
llbc_name : llbc_name;
(** The original name coming from the LLBC declaration *)
name : string;
@@ -991,6 +992,7 @@ type fun_kind = A.fun_kind [@@deriving show]
type fun_decl = {
def_id : FunDeclId.id;
+ is_local : bool;
kind : fun_kind;
num_loops : int;
(** The number of loops in the parent forward function (basically the number
@@ -1014,6 +1016,7 @@ type fun_decl = {
type trait_decl = {
def_id : trait_decl_id;
+ is_local : bool;
llbc_name : llbc_name;
name : string;
generics : generic_params;
@@ -1028,6 +1031,7 @@ type trait_decl = {
type trait_impl = {
def_id : trait_impl_id;
+ is_local : bool;
llbc_name : llbc_name;
name : string;
impl_trait : trait_decl_ref;
diff --git a/compiler/PureMicroPasses.ml b/compiler/PureMicroPasses.ml
index 96421925..1565f252 100644
--- a/compiler/PureMicroPasses.ml
+++ b/compiler/PureMicroPasses.ml
@@ -1427,6 +1427,7 @@ let decompose_loops (def : fun_decl) : fun_decl * fun_decl list =
let loop_def : fun_decl =
{
def_id = def.def_id;
+ is_local = def.is_local;
kind = def.kind;
num_loops;
loop_id = Some loop.loop_id;
diff --git a/compiler/PureUtils.ml b/compiler/PureUtils.ml
index 06270621..d410abdc 100644
--- a/compiler/PureUtils.ml
+++ b/compiler/PureUtils.ml
@@ -646,6 +646,7 @@ let trait_decl_get_method (trait_decl : trait_decl) (method_name : string) :
let trait_decl_is_empty (trait_decl : trait_decl) : bool =
let {
def_id = _;
+ is_local = _;
name = _;
llbc_name = _;
generics = _;
@@ -664,6 +665,7 @@ let trait_decl_is_empty (trait_decl : trait_decl) : bool =
let trait_impl_is_empty (trait_impl : trait_impl) : bool =
let {
def_id = _;
+ is_local = _;
name = _;
llbc_name = _;
impl_trait = _;
diff --git a/compiler/SymbolicToPure.ml b/compiler/SymbolicToPure.ml
index f25ff2f6..9899a0c6 100644
--- a/compiler/SymbolicToPure.ml
+++ b/compiler/SymbolicToPure.ml
@@ -495,7 +495,8 @@ let translate_type_decl (ctx : Contexts.decls_ctx) (def : T.type_decl) :
let generics = { types; const_generics; trait_clauses } in
let kind = translate_type_decl_kind def.T.kind in
let preds = translate_predicates def.preds in
- { def_id; llbc_name; name; generics; kind; preds }
+ let is_local = def.is_local in
+ { def_id; is_local; llbc_name; name; generics; kind; preds }
let translate_type_id (id : T.type_id) : type_id =
match id with
@@ -3026,6 +3027,7 @@ let translate_fun_decl (ctx : bs_ctx) (body : S.expression option) : fun_decl =
let def : fun_decl =
{
def_id;
+ is_local = def.is_local;
kind = def.kind;
num_loops;
loop_id;
@@ -3104,6 +3106,7 @@ let translate_trait_decl (ctx : Contexts.decls_ctx) (trait_decl : A.trait_decl)
: trait_decl =
let {
def_id;
+ is_local;
name = llbc_name;
generics;
preds;
@@ -3139,6 +3142,7 @@ let translate_trait_decl (ctx : Contexts.decls_ctx) (trait_decl : A.trait_decl)
in
{
def_id;
+ is_local;
llbc_name;
name;
generics;
@@ -3154,6 +3158,7 @@ let translate_trait_impl (ctx : Contexts.decls_ctx) (trait_impl : A.trait_impl)
: trait_impl =
let {
A.def_id;
+ is_local;
name = llbc_name;
impl_trait;
generics;
@@ -3193,6 +3198,7 @@ let translate_trait_impl (ctx : Contexts.decls_ctx) (trait_impl : A.trait_impl)
in
{
def_id;
+ is_local;
llbc_name;
name;
impl_trait;
diff --git a/compiler/dune b/compiler/dune
index 4bba6a08..0d0a8017 100644
--- a/compiler/dune
+++ b/compiler/dune
@@ -84,7 +84,7 @@
-g
;-dsource
-warn-error
- -5@8-9-11-14-33-20-21-26-27-39))
+ -5@8-11-14-33-20-21-26-27-39))
(release
(flags
:standard
@@ -92,4 +92,4 @@
-g
;-dsource
-warn-error
- -5@8-9-11-14-33-20-21-26-27-39)))
+ -5@8-11-14-33-20-21-26-27-39)))