diff --git a/facebook-clang-plugins b/facebook-clang-plugins index a77526452..b639c067d 160000 --- a/facebook-clang-plugins +++ b/facebook-clang-plugins @@ -1 +1 @@ -Subproject commit a77526452b10339b3580d58b02c9c8f534b79589 +Subproject commit b639c067dbad75be0f0fb92bc8d1bd0732d453de diff --git a/infer/src/clang/cAst_utils.ml b/infer/src/clang/cAst_utils.ml index f538a5104..c68de1c6f 100644 --- a/infer/src/clang/cAst_utils.ml +++ b/infer/src/clang/cAst_utils.ml @@ -77,10 +77,6 @@ let dummy_stmt () = Clang_ast_t.NullStmt ({Clang_ast_t.si_pointer= pointer; si_source_range= source_range}, []) -let type_from_unary_expr_or_type_trait_expr_info info = - match info.Clang_ast_t.uttei_qual_type with Some tp -> Some tp | None -> None - - let get_decl decl_ptr = Int.Table.find ClangPointers.pointer_decl_table decl_ptr let get_decl_opt decl_ptr_opt = diff --git a/infer/src/clang/cAst_utils.mli b/infer/src/clang/cAst_utils.mli index e8c692c01..e11b1425b 100644 --- a/infer/src/clang/cAst_utils.mli +++ b/infer/src/clang/cAst_utils.mli @@ -19,9 +19,6 @@ val dummy_stmt_info : unit -> Clang_ast_t.stmt_info val get_fresh_pointer : unit -> Clang_ast_t.pointer -val type_from_unary_expr_or_type_trait_expr_info : - Clang_ast_t.unary_expr_or_type_trait_expr_info -> Clang_ast_t.qual_type option - val get_decl : Clang_ast_t.pointer -> Clang_ast_t.decl option val get_decl_opt : Clang_ast_t.pointer option -> Clang_ast_t.decl option diff --git a/infer/src/clang/cTrans.ml b/infer/src/clang/cTrans.ml index 5b5fd202d..fb05f852c 100644 --- a/infer/src/clang/cTrans.ml +++ b/infer/src/clang/cTrans.ml @@ -432,23 +432,17 @@ module CTrans_funct (F : CModule_type.CFrontend) : CModule_type.CTranslation = s (* The stmt seems to be always empty *) let unaryExprOrTypeTraitExpr_trans trans_state expr_info unary_expr_or_type_trait_expr_info = let tenv = trans_state.context.CContext.tenv in - let typ = CType_decl.qual_type_to_sil_type tenv expr_info.Clang_ast_t.ei_qual_type in match unary_expr_or_type_trait_expr_info.Clang_ast_t.uttei_kind with | (`SizeOf | `SizeOfWithSize _) as size -> - let qt_opt = - CAst_utils.type_from_unary_expr_or_type_trait_expr_info - unary_expr_or_type_trait_expr_info - in - let sizeof_typ = - match qt_opt with Some qt -> CType_decl.qual_type_to_sil_type tenv qt | None -> typ - (* Some default type since the type is missing *) - in + let qt = unary_expr_or_type_trait_expr_info.Clang_ast_t.uttei_qual_type in + let sizeof_typ = CType_decl.qual_type_to_sil_type tenv qt in let nbytes = match size with `SizeOfWithSize nbytes -> Some nbytes | _ -> None in let sizeof_data = {Exp.typ= sizeof_typ; nbytes; dynamic_length= None; subtype= Subtype.exact} in {empty_res_trans with exps= [(Exp.Sizeof sizeof_data, sizeof_typ)]} | k -> + let typ = CType_decl.qual_type_to_sil_type tenv expr_info.Clang_ast_t.ei_qual_type in L.(debug Capture Medium) "@\n\ WARNING: Missing translation of Uniry_Expression_Or_Trait of kind: %s . Expression \