From d805a0ddba88794bac6588e6183deee2ca3ab9ad Mon Sep 17 00:00:00 2001 From: Katie Ots Date: Wed, 3 Apr 2019 05:07:17 -0700 Subject: [PATCH] [CostReport] Add procedure name to cost report items Reviewed By: ezgicicek Differential Revision: D14703597 fbshipit-source-id: 5bfeb29c8 --- infer/src/atd/jsonbug.atd | 1 + infer/src/backend/InferPrint.ml | 1 + 2 files changed, 2 insertions(+) diff --git a/infer/src/atd/jsonbug.atd b/infer/src/atd/jsonbug.atd index 3e2fa23d7..be65e96e7 100644 --- a/infer/src/atd/jsonbug.atd +++ b/infer/src/atd/jsonbug.atd @@ -64,6 +64,7 @@ type hum_info = { type cost_item = { hash : string; loc : loc; + procedure_name : string; procedure_id : string; polynomial : string; hum : hum_info; diff --git a/infer/src/backend/InferPrint.ml b/infer/src/backend/InferPrint.ml index 9720b9f96..63b71286a 100644 --- a/infer/src/backend/InferPrint.ml +++ b/infer/src/backend/InferPrint.ml @@ -361,6 +361,7 @@ module JsonCostsPrinter = MakeJsonListPrinter (struct let file = SourceFile.to_rel_path loc.Location.file in { Jsonbug_t.hash= compute_hash ~severity:"" ~bug_type:"" ~proc_name ~file ~qualifier:"" ; loc= {file; lnum= loc.Location.line; cnum= loc.Location.col; enum= -1} + ; procedure_name= Typ.Procname.get_method proc_name ; procedure_id= procedure_id_of_procname proc_name ; polynomial= CostDomain.BasicCost.encode basic_operation_cost ; hum }