From 053d16138eb575a2055859dcc32c776581767b30 Mon Sep 17 00:00:00 2001 From: Martin Trojer Date: Mon, 11 Feb 2019 03:52:01 -0800 Subject: [PATCH] always report human readable polys in costs-report.json Reviewed By: mbouaziz, ddino Differential Revision: D14004939 fbshipit-source-id: a6dd5552d --- infer/src/atd/jsonbug.atd | 3 ++- infer/src/backend/InferPrint.ml | 13 ++++++------- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/infer/src/atd/jsonbug.atd b/infer/src/atd/jsonbug.atd index a4c0b9595..3e2fa23d7 100644 --- a/infer/src/atd/jsonbug.atd +++ b/infer/src/atd/jsonbug.atd @@ -58,6 +58,7 @@ type json_trace = { type hum_info = { hum_polynomial : string; hum_degree : string; + big_o : string; } type cost_item = { @@ -65,7 +66,7 @@ type cost_item = { loc : loc; procedure_id : string; polynomial : string; - ?hum : hum_info option; + hum : hum_info; } type costs_report = cost_item list diff --git a/infer/src/backend/InferPrint.ml b/infer/src/backend/InferPrint.ml index f22848289..c968ab9ae 100644 --- a/infer/src/backend/InferPrint.ml +++ b/infer/src/backend/InferPrint.ml @@ -344,13 +344,12 @@ module JsonCostsPrinter = MakeJsonListPrinter (struct match cost_opt with | Some {post} -> let hum = - if Config.developer_mode then - Some - { Jsonbug_t.hum_polynomial= - Format.asprintf "%a" CostDomain.BasicCost.pp post.basic_operation_cost - ; hum_degree= - Format.asprintf "%a" CostDomain.BasicCost.pp_degree post.basic_operation_cost } - else None + { Jsonbug_t.hum_polynomial= + Format.asprintf "%a" CostDomain.BasicCost.pp post.basic_operation_cost + ; hum_degree= + Format.asprintf "%a" CostDomain.BasicCost.pp_degree post.basic_operation_cost + ; big_o= + Format.asprintf "%a" CostDomain.BasicCost.pp_degree_hum post.basic_operation_cost } in let cost_item = let file = SourceFile.to_rel_path loc.Location.file in