Remove unnecessary option type

Summary:
See title

update-submodule: facebook-clang-plugins

Reviewed By: dulmarod

Differential Revision: D7215311

fbshipit-source-id: 3af047a
master
Daiva Naudziuniene 7 years ago committed by Facebook Github Bot
parent 89a6d7e20d
commit 12be484431

@ -1 +1 @@
Subproject commit a77526452b10339b3580d58b02c9c8f534b79589
Subproject commit b639c067dbad75be0f0fb92bc8d1bd0732d453de

@ -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 =

@ -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

@ -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 \

Loading…
Cancel
Save