[clang] Generating procedures only if there isn't a spec for them already.

Summary:
Generating procedures only if there isn't a spec for them already.
This is important for incremental analysis.
master
Dulma Rodriguez 10 years ago
parent 9643bdb1c6
commit c6b550d5f0

@ -147,23 +147,27 @@ struct
list_iter (process_one_method_decl tenv cg cfg curr_class namespace) decl_list list_iter (process_one_method_decl tenv cg cfg curr_class namespace) decl_list
let process_getter_setter context procname = let process_getter_setter context procname =
let class_name = Procname.c_get_class procname in (*If there is already a spec for the method we want to generate (in incremental analysis) *)
let open CContext in (* we don't need to generate it again. *)
let cls = CContext.create_curr_class context.tenv class_name in if Specs.summary_exists procname then false
let method_name = Procname.c_get_method procname in else
match ObjcProperty_decl.method_is_property_accesor cls method_name with let class_name = Procname.c_get_class procname in
| Some (property_name, property_type, is_getter) when let open CContext in
CMethod_trans.should_create_procdesc context.cfg procname true true -> let cls = CContext.create_curr_class context.tenv class_name in
(match property_type with qt, atts, decl_info, _, _, ivar_opt -> let method_name = Procname.c_get_method procname in
let ivar_name = ObjcProperty_decl.get_ivar_name property_name ivar_opt in match ObjcProperty_decl.method_is_property_accesor cls method_name with
let field = CField_decl.build_sil_field_property cls context.tenv ivar_name qt (Some atts) in | Some (property_name, property_type, is_getter) when
ignore (CField_decl.add_missing_fields context.tenv class_name [field]); CMethod_trans.should_create_procdesc context.cfg procname true true ->
let accessor = (match property_type with qt, atts, decl_info, _, _, ivar_opt ->
if is_getter then let ivar_name = ObjcProperty_decl.get_ivar_name property_name ivar_opt in
ObjcProperty_decl.make_getter cls property_name property_type let field = CField_decl.build_sil_field_property cls context.tenv ivar_name qt (Some atts) in
else ObjcProperty_decl.make_setter cls property_name property_type in ignore (CField_decl.add_missing_fields context.tenv class_name [field]);
list_iter (process_one_method_decl context.tenv context.cg context.cfg cls context.namespace) accessor; let accessor =
true) if is_getter then
| _ -> false ObjcProperty_decl.make_getter cls property_name property_type
else ObjcProperty_decl.make_setter cls property_name property_type in
list_iter (process_one_method_decl context.tenv context.cg context.cfg cls context.namespace) accessor;
true)
| _ -> false
end end

Loading…
Cancel
Save