Summary: absint/ is its own dune library. There was one last obstacle: we need callbacks to `NodePrinter`. We'll add more to `AnalysisCallbacks` in future diffs. Reviewed By: ngorogiannis Differential Revision: D21257476 fbshipit-source-id: 3a2ddef14master
parent
be101b6bb4
commit
0d4b57a625
@ -0,0 +1,29 @@
|
||||
(*
|
||||
* Copyright (c) Facebook, Inc. and its affiliates.
|
||||
*
|
||||
* This source code is licensed under the MIT license found in the
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*)
|
||||
|
||||
open! IStd
|
||||
module L = Logging
|
||||
|
||||
type callbacks =
|
||||
{ html_debug_new_node_session_f:
|
||||
'a. ?kind:[`ComputePre | `ExecNode | `ExecNodeNarrowing | `WTO]
|
||||
-> pp_name:(Format.formatter -> unit) -> Procdesc.Node.t -> f:(unit -> 'a) -> 'a }
|
||||
|
||||
let callbacks_ref : callbacks option ref = ref None
|
||||
|
||||
let set_callbacks callbacks = callbacks_ref := Some callbacks
|
||||
|
||||
let get_callbacks () =
|
||||
match !callbacks_ref with
|
||||
| Some callbacks ->
|
||||
callbacks
|
||||
| None ->
|
||||
L.die InternalError "Callbacks not set"
|
||||
|
||||
|
||||
let html_debug_new_node_session ?kind ~pp_name node ~f =
|
||||
(get_callbacks ()).html_debug_new_node_session_f ?kind ~pp_name node ~f
|
@ -0,0 +1,31 @@
|
||||
(*
|
||||
* Copyright (c) Facebook, Inc. and its affiliates.
|
||||
*
|
||||
* This source code is licensed under the MIT license found in the
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*)
|
||||
|
||||
open! IStd
|
||||
|
||||
(** {2 Analysis API} *)
|
||||
|
||||
val html_debug_new_node_session :
|
||||
?kind:[`ComputePre | `ExecNode | `ExecNodeNarrowing | `WTO]
|
||||
-> pp_name:(Format.formatter -> unit)
|
||||
-> Procdesc.Node.t
|
||||
-> f:(unit -> 'a)
|
||||
-> 'a
|
||||
(** set to {!NodePrinter.with_session} *)
|
||||
|
||||
(** {2 Callbacks management}*)
|
||||
|
||||
(** These callbacks are used to break the dependency cycles between some modules. Specifically, we
|
||||
put here functions needed for the analysis that depend on modules higher up the dependency graph
|
||||
than this library but whose type does not. *)
|
||||
type callbacks =
|
||||
{ html_debug_new_node_session_f:
|
||||
'a. ?kind:[`ComputePre | `ExecNode | `ExecNodeNarrowing | `WTO]
|
||||
-> pp_name:(Format.formatter -> unit) -> Procdesc.Node.t -> f:(unit -> 'a) -> 'a }
|
||||
|
||||
val set_callbacks : callbacks -> unit
|
||||
(** make sure this is called before starting any actual analysis *)
|
@ -0,0 +1,14 @@
|
||||
; Copyright (c) Facebook, Inc. and its affiliates.
|
||||
;
|
||||
; This source code is licensed under the MIT license found in the
|
||||
; LICENSE file in the root directory of this source tree.
|
||||
|
||||
(library
|
||||
(name absint)
|
||||
(public_name infer.absint)
|
||||
(flags
|
||||
(:standard -open Core -open InferIR -open InferStdlib -open IStd -open InferGenerated
|
||||
-open InferBase))
|
||||
(libraries core InferStdlib InferGenerated InferBase InferIR)
|
||||
(preprocess (pps ppx_compare))
|
||||
)
|
Loading…
Reference in new issue