diff --git a/infer/src/IR/Procdesc.ml b/infer/src/IR/Procdesc.ml index 1a92d3a16..d7bd8c4e4 100644 --- a/infer/src/IR/Procdesc.ml +++ b/infer/src/IR/Procdesc.ml @@ -771,7 +771,7 @@ let get_loop_heads pdesc = let is_loop_head pdesc (node : Node.t) = NodeSet.mem node (get_loop_heads pdesc) let pp_modify_in_block fmt modify_in_block = - if modify_in_block then Format.pp_print_string fmt "(__block)" else () + if modify_in_block then Format.pp_print_string fmt "(__block)" let pp_local fmt (var_data : ProcAttributes.var_data) = diff --git a/infer/src/IR/Typ.ml b/infer/src/IR/Typ.ml index 17f56d07b..c3f04cfe8 100644 --- a/infer/src/IR/Typ.ml +++ b/infer/src/IR/Typ.ml @@ -346,7 +346,7 @@ and pp_protocols pe f protocols = (** Pretty print a type. Do nothing by default. *) -let pp pe f te = if Config.print_types then pp_full pe f te else () +let pp pe f te = if Config.print_types then pp_full pe f te let to_string typ = let pp fmt = pp_full Pp.text fmt typ in diff --git a/infer/src/absint/IssueLog.ml b/infer/src/absint/IssueLog.ml index 15f26e83d..dfdb0daf2 100644 --- a/infer/src/absint/IssueLog.ml +++ b/infer/src/absint/IssueLog.ml @@ -38,7 +38,6 @@ let store ~entry ~file m = DB.filename_from_string (Filename.concat issues_dir (abbrev_source_file ^ ".issue")) in Serialization.write_to_file issues_serializer filename ~data:m ) - else () (** Load issues from the given file *) diff --git a/infer/src/biabduction/Dom.ml b/infer/src/biabduction/Dom.ml index 7139cd9a7..d357bc3f5 100644 --- a/infer/src/biabduction/Dom.ml +++ b/infer/src/biabduction/Dom.ml @@ -172,7 +172,6 @@ end = struct if not (Exp.equal e e') then ( L.d_strln "failure reason 8" ; raise Predicates.JoinFail ) - else () let check side es = diff --git a/infer/src/biabduction/DotBiabduction.ml b/infer/src/biabduction/DotBiabduction.ml index 476b4e159..a2e51075a 100644 --- a/infer/src/biabduction/DotBiabduction.ml +++ b/infer/src/biabduction/DotBiabduction.ml @@ -139,7 +139,7 @@ let rec strexp_to_string pe coo f se = | Eexp (Exp.Lvar pvar, _) -> (Pvar.pp pe) f pvar | Eexp (Exp.Var id, _) -> - if !print_full_prop then Ident.pp f id else () + if !print_full_prop then Ident.pp f id | Eexp (e, _) -> if !print_full_prop then (Exp.pp_diff pe) f e else F.pp_print_char f '_' | Estruct (ls, _) -> @@ -414,7 +414,7 @@ let compute_fields_struct sigma = let rec do_strexp se in_struct = match (se : Predicates.strexp) with | Eexp (e, _) -> - if in_struct then fields_structs := e :: !fields_structs else () + if in_struct then fields_structs := e :: !fields_structs | Estruct (l, _) -> List.iter ~f:(fun e -> do_strexp e true) (snd (List.unzip l)) | Earray (_, l, _) -> @@ -759,7 +759,6 @@ let dotty_pp_link f link = | _, _ -> if !print_full_prop then F.fprintf f "state%iL%i -> state%iL%i[label=\"%s\"];@\n" n1 lambda1 n2 lambda2 src_fld - else () (* given the list of nodes and links get rid of spec nodes that are not pointed to by anybody*) diff --git a/infer/src/biabduction/interproc.ml b/infer/src/biabduction/interproc.ml index 247002bcf..1c5f9c4db 100644 --- a/infer/src/biabduction/interproc.ml +++ b/infer/src/biabduction/interproc.ml @@ -946,7 +946,6 @@ let update_specs analysis_data prev_summary_opt phase then ( changed := true ; current_specs := SpecMap.remove old_spec.BiabductionSummary.pre !current_specs ) - else () in let add_spec spec = (* add a new spec by doing union of the posts *) diff --git a/infer/src/bufferoverrun/bounds.ml b/infer/src/bufferoverrun/bounds.ml index a205d68a2..aaf4d1ec2 100644 --- a/infer/src/bufferoverrun/bounds.ml +++ b/infer/src/bufferoverrun/bounds.ml @@ -88,7 +88,7 @@ module SymLinear = struct let pp : markup:bool -> is_beginning:bool -> F.formatter -> t -> unit = fun ~markup ~is_beginning f x -> - if M.is_empty x then if is_beginning then F.pp_print_string f "0" else () + if M.is_empty x then (if is_beginning then F.pp_print_string f "0") else ( M.fold (fun s c is_beginning -> diff --git a/infer/src/clang/CAddImplicitDeallocImpl.ml b/infer/src/clang/CAddImplicitDeallocImpl.ml index 6573a3274..30d5c818d 100644 --- a/infer/src/clang/CAddImplicitDeallocImpl.ml +++ b/infer/src/clang/CAddImplicitDeallocImpl.ml @@ -62,20 +62,13 @@ let process_procdesc tenv proc_name proc_desc = None in if Procdesc.is_defined proc_desc && Procname.is_objc_dealloc proc_name then - let struct_opt = get_struct_procname tenv proc_name in - match struct_opt with - | Some {fields} -> ( - let formals = Procdesc.get_formals proc_desc in - let self = List.find ~f:(fun (var, _) -> Mangled.equal var Mangled.self) formals in - match self with - | Some (self, typ) -> - let self_var = Pvar.mk self proc_name in - process_dealloc proc_desc fields (self_var, typ) - | None -> - () ) - | _ -> - () - else () + get_struct_procname tenv proc_name + |> Option.iter ~f:(fun Struct.{fields} -> + let formals = Procdesc.get_formals proc_desc in + let self = List.find ~f:(fun (var, _) -> Mangled.equal var Mangled.self) formals in + Option.iter self ~f:(fun (self, typ) -> + let self_var = Pvar.mk self proc_name in + process_dealloc proc_desc fields (self_var, typ) ) ) let process cfg tenv = Procname.Hash.iter (process_procdesc tenv) cfg diff --git a/infer/src/clang/cAst_utils.ml b/infer/src/clang/cAst_utils.ml index c70e701a3..f83c10e91 100644 --- a/infer/src/clang/cAst_utils.ml +++ b/infer/src/clang/cAst_utils.ml @@ -252,7 +252,7 @@ let add_type_from_decl_ref_opt qual_type_to_sil_type tenv decl_ref_opt fail_if_n | Some dr -> add_type_from_decl_ref qual_type_to_sil_type tenv dr | _ -> - if fail_if_not_found then assert false else () + if fail_if_not_found then assert false let add_type_from_decl_ref_list qual_type_to_sil_type tenv decl_ref_list =