From fa57d8d9d51c93ccefefb0951c67475970e97879 Mon Sep 17 00:00:00 2001 From: Nadrieril Date: Mon, 8 Apr 2024 15:18:58 +0200 Subject: item_meta --- compiler/ExtractBase.ml | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'compiler/ExtractBase.ml') diff --git a/compiler/ExtractBase.ml b/compiler/ExtractBase.ml index 656d2f27..8080e08c 100644 --- a/compiler/ExtractBase.ml +++ b/compiler/ExtractBase.ml @@ -1932,10 +1932,11 @@ let ctx_add_global_decl_and_body (def : A.global_decl) (ctx : extraction_ctx) : match match_name_find_opt ctx.trans_ctx def.name builtin_globals_map with | Some name -> (* Yes: register the custom binding *) - ctx_add def.meta decl name ctx + ctx_add def.item_meta.meta decl name ctx | None -> (* Not the case: "standard" registration *) - let name = ctx_compute_global_name def.meta ctx def.name in + let name = ctx_compute_global_name def.item_meta.meta ctx def.name in + let body = FunId (FromLlbc (FunId (FRegular def.body), None)) in (* If this is a provided constant (i.e., the default value for a constant in a trait declaration) we add a suffix. Otherwise there is a clash @@ -1944,8 +1945,8 @@ let ctx_add_global_decl_and_body (def : A.global_decl) (ctx : extraction_ctx) : let suffix = match def.kind with TraitItemProvided _ -> "_default" | _ -> "" in - let ctx = ctx_add def.meta decl (name ^ suffix) ctx in - let ctx = ctx_add def.meta body (name ^ suffix ^ "_body") ctx in + let ctx = ctx_add def.item_meta.meta decl (name ^ suffix) ctx in + let ctx = ctx_add def.item_meta.meta body (name ^ suffix ^ "_body") ctx in ctx let ctx_compute_fun_name (def : fun_decl) (ctx : extraction_ctx) : string = -- cgit v1.2.3