From 40dd0e1c952a64f8b7be10a140c06b4cab97a945 Mon Sep 17 00:00:00 2001 From: Dulma Churchill Date: Fri, 16 Mar 2018 09:29:41 -0700 Subject: [PATCH] [objc] Add only the main part of ObjC method names in reports Reviewed By: mbouaziz Differential Revision: D7292361 fbshipit-source-id: 9d7adf8 --- infer/src/IR/DecompiledExp.ml | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/infer/src/IR/DecompiledExp.ml b/infer/src/IR/DecompiledExp.ml index a5743371f..85ac7e5c5 100644 --- a/infer/src/IR/DecompiledExp.ml +++ b/infer/src/IR/DecompiledExp.ml @@ -42,8 +42,19 @@ let rec to_string = function to_string de1 ^ "[" ^ to_string de2 ^ "]" | Dbinop (op, de1, de2) -> "(" ^ to_string de1 ^ Binop.str Pp.text op ^ to_string de2 ^ ")" - | Dconst Cfun pn -> - Typ.Procname.to_simplified_string pn + | Dconst Cfun pn + -> ( + let procname_str = Typ.Procname.to_simplified_string pn in + match pn with + | Typ.Procname.ObjC_Cpp {kind= ObjCInstanceMethod} + | Typ.Procname.ObjC_Cpp {kind= ObjCClassMethod} -> ( + match String.lsplit2 ~on:':' procname_str with + | Some (base_name, _) -> + base_name + | None -> + procname_str ) + | _ -> + procname_str ) | Dconst c -> Const.to_string c | Dderef de ->