From dab523f7eb9a45792cc5b4d592104f8a6a490a06 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ezgi=20=C3=87i=C3=A7ek?= Date: Thu, 3 Sep 2020 08:24:06 -0700 Subject: [PATCH] [cost] Remove unused IO Cost kind Summary: We don't report and IO Cost and are not planning to do so in the near future. Let's remove it from cost kinds. Reviewed By: ngorogiannis Differential Revision: D23499160 fbshipit-source-id: 7281da3af --- infer/src/base/costKind.ml | 23 +++-------------------- infer/src/base/costKind.mli | 2 +- infer/src/cost/costDomain.ml | 5 ++--- infer/src/cost/costDomain.mli | 8 ++++---- 4 files changed, 10 insertions(+), 28 deletions(-) diff --git a/infer/src/base/costKind.ml b/infer/src/base/costKind.ml index 58f0ea8fa..d2bb0c228 100644 --- a/infer/src/base/costKind.ml +++ b/infer/src/base/costKind.ml @@ -7,35 +7,20 @@ open! IStd module F = Format -type t = OperationCost | AllocationCost | IOCost [@@deriving compare] - -let to_issue_string = function - | OperationCost -> - "EXECUTION_TIME" - | AllocationCost -> - "ALLOCATION" - | IOCost -> - "IO" +type t = OperationCost | AllocationCost [@@deriving compare] +let to_issue_string = function OperationCost -> "EXECUTION_TIME" | AllocationCost -> "ALLOCATION" let to_complexity_string = function | AllocationCost -> "Allocation complexity" | OperationCost -> "Time complexity" - | IOCost -> - "IO complexity" let pp f k = let k_str = - match k with - | OperationCost -> - "Execution Cost" - | AllocationCost -> - "Allocation Cost" - | IOCost -> - "IO Cost" + match k with OperationCost -> "Execution Cost" | AllocationCost -> "Allocation Cost" in F.pp_print_string f k_str @@ -45,8 +30,6 @@ let to_json_cost_info c = function c.Jsonbug_t.exec_cost | AllocationCost -> assert false - | IOCost -> - assert false type kind_spec = {kind: t; (* for non-diff analysis *) top_and_unreachable: bool} diff --git a/infer/src/base/costKind.mli b/infer/src/base/costKind.mli index 208d0d6c7..b1367114f 100644 --- a/infer/src/base/costKind.mli +++ b/infer/src/base/costKind.mli @@ -7,7 +7,7 @@ open! IStd -type t = OperationCost | AllocationCost | IOCost [@@deriving compare] +type t = OperationCost | AllocationCost [@@deriving compare] type kind_spec = {kind: t; (* for non-diff analysis *) top_and_unreachable: bool} diff --git a/infer/src/cost/costDomain.ml b/infer/src/cost/costDomain.ml index 02fcee964..2c4c9a47a 100644 --- a/infer/src/cost/costDomain.ml +++ b/infer/src/cost/costDomain.ml @@ -49,9 +49,8 @@ module BasicCostWithReason = struct let pp_hum = pp end -(** Module to simulate a record - [{OperationCost:BasicCost.t; AllocationCost: BasicCost.t; IOCost:BasicCost.t}] with a map - [{OperationCost, AllocationCost, IOCost} -> BasicCost.t] *) +(** Module to simulate a record [{OperationCost:BasicCost.t; AllocationCost: BasicCost.t}] with a + map [{OperationCost, AllocationCost} -> BasicCost.t] *) module VariantCostMap = struct include PrettyPrintable.PPMonoMapOfPPMap (CostIssues.CostKindMap) (BasicCostWithReason) diff --git a/infer/src/cost/costDomain.mli b/infer/src/cost/costDomain.mli index 6b0095b8d..bf24fb833 100644 --- a/infer/src/cost/costDomain.mli +++ b/infer/src/cost/costDomain.mli @@ -65,7 +65,7 @@ val get_operation_cost : t -> BasicCostWithReason.t val map : f:(BasicCostWithReason.t -> BasicCostWithReason.t) -> t -> t val zero_record : t -(** Map representing cost record \{OperationCost:0; AllocationCost:0; IOCost:0\} *) +(** Map representing cost record \{OperationCost:0; AllocationCost:0\} *) val mult_by : t -> nb_exec:BasicCost.t -> t (** Special map where each element is multiplied by the number of executions *) @@ -74,10 +74,10 @@ val plus : t -> t -> t (** Union of two maps where common costs are added together *) val unit_cost_atomic_operation : t -(** Map representing cost record \{OperationCost:1; AllocationCost:0; IOCost:0\} *) +(** Map representing cost record \{OperationCost:1; AllocationCost:0\} *) val unit_cost_allocation : t -(** Map representing cost record \{OperationCost:0; AllocationCost:1; IOCost:0\} *) +(** Map representing cost record \{OperationCost:0; AllocationCost:1\} *) val of_operation_cost : BasicCost.t -> t -(** Map representing cost record \{OperationCost:operation_cost; AllocationCost:0; IOCost:0\} *) +(** Map representing cost record \{OperationCost:operation_cost; AllocationCost:0\} *)