Skip to content

Commit

Permalink
Add a logger for TypesAnalysis.ml
Browse files Browse the repository at this point in the history
  • Loading branch information
sonmarcho committed Jan 10, 2025
1 parent f6421f6 commit 76ce2dd
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
3 changes: 3 additions & 0 deletions src/Logging.ml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,9 @@ let pre_passes_log = create_logger "PrePasses"
(** Logger for RegionsHierarchy *)
let regions_hierarchy_log = create_logger "RegionsHierarchy"

(** Logger for TypesAnalysis *)
let types_analysis_log = create_logger "TypesAnalysis"

(** Logger for Translate *)
let translate_log = create_logger "Translate"

Expand Down
5 changes: 4 additions & 1 deletion src/llbc/TypesAnalysis.ml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ open LlbcAst
open Errors
open Substitute

let log = Logging.types_analysis_log

type subtype_info = {
under_borrow : bool; (** Are we inside a borrow? *)
under_mut_borrow : bool; (** Are we inside a mut borrow? *)
Expand Down Expand Up @@ -147,7 +149,7 @@ let analyze_full_ty (span : Meta.span option) (updated : bool ref)
match mut_region with
| RStatic | RVar (Bound _) ->
mut_regions (* We can have bound vars because of arrows *)
| RErased -> craise_opt_span __FILE__ __LINE__ span "Unreachable"
| RErased -> internal_error_opt_span __FILE__ __LINE__ span
| RVar (Free rid) -> update_mut_regions_with_rid mut_regions rid
in

Expand Down Expand Up @@ -463,6 +465,7 @@ let analyze_type_declarations (type_decls : type_decl TypeDeclId.Map.t)
*)
let analyze_ty (span : Meta.span option) (infos : type_infos) (ty : ty) :
ty_info =
log#ltrace (lazy (__FUNCTION__ ^ ": ty:\n" ^ show_ty ty));
(* We don't use [updated] but need to give it as parameter *)
let updated = ref false in
(* We don't need to compute whether the type contains 'static or not *)
Expand Down

0 comments on commit 76ce2dd

Please sign in to comment.