Translating structs and C++ classes only on demand

Summary: public
	 Translating structs and C++ classes only on demand. This reduces the size of the tenv and
	 saves analysis time.

Reviewed By: ddino

Differential Revision: D2575008

fb-gh-sync-id: b29da2a
master
Dulma Rodriguez 9 years ago committed by facebook-github-bot-7
parent 1371ca96e9
commit 56f3fb4f4b

@ -38,7 +38,6 @@ let rec translate_one_declaration tenv cg cfg namespace parent_dec dec =
(* Currently C/C++ record decl treated in the same way *)
| CXXRecordDecl (_, _, _, _, decl_list, _, _, _)
| RecordDecl (_, _, _, _, decl_list, _, _) ->
ignore (CTypes_decl.add_types_from_decl_to_tenv tenv namespace dec);
let method_decls = CTypes_decl.get_method_decls dec decl_list in
let tranlate_method (parent, decl) =
translate_one_declaration tenv cg cfg namespace parent decl in

@ -29,7 +29,11 @@ let add_predefined_objc_types tenv =
Sil.TN_csu (Sil.Struct, Mangled.from_string CFrontend_config.objc_object) in
let id_typedef = Sil.Tvar (typename_objc_object) in
let id_typename = CType_to_sil_type.get_builtin_objc_typename `ObjCId in
Sil.tenv_add tenv id_typename id_typedef
Sil.tenv_add tenv id_typename id_typedef;
let objc_object_type_info =
Sil.Tstruct ([], [], Sil.Struct,
Some (Mangled.from_string CFrontend_config.objc_object), [], [], []) in
Sil.tenv_add tenv typename_objc_object objc_object_type_info
(* Whenever new type are added manually to the translation in ast_expressions, *)
(* they should be added here too!! *)

Loading…
Cancel
Save