InstrNode: abstract instruction index

Summary:
Now that the cost analysis doesn't hackily compute the instruction index, we can make this an abstract type to ensure `List.nth_exn` in `OneInstrPerNode` will not fail.

Depends on D7618320

Reviewed By: sblackshear

Differential Revision: D7628908

fbshipit-source-id: 89e8618
master
Mehdi Bouaziz 7 years ago committed by Facebook Github Bot
parent 094eb9dcc7
commit 7f1b4e0a2b

@ -74,9 +74,11 @@ module DefaultNode = struct
end end
module InstrNode = struct module InstrNode = struct
type t = Procdesc.Node.t * int type instr_index = int [@@deriving compare]
type id = Procdesc.Node.id * int [@@deriving compare] type t = Procdesc.Node.t * instr_index
type id = Procdesc.Node.id * instr_index [@@deriving compare]
let kind (t, _) = Procdesc.Node.get_kind t let kind (t, _) = Procdesc.Node.get_kind t

@ -82,7 +82,13 @@ end
module DefaultNode : Node with type t = Procdesc.Node.t and type id = Procdesc.Node.id module DefaultNode : Node with type t = Procdesc.Node.t and type id = Procdesc.Node.id
module InstrNode : Node with type t = Procdesc.Node.t * int and type id = Procdesc.Node.id * int module InstrNode : sig
type instr_index
include Node
with type t = Procdesc.Node.t * instr_index
and type id = Procdesc.Node.id * instr_index
end
(** Forward CFG with no exceptional control-flow *) (** Forward CFG with no exceptional control-flow *)
module Normal : module Normal :

Loading…
Cancel
Save