From 77e3110adce7f8d59a4893dab8564f721c781aae Mon Sep 17 00:00:00 2001 From: Daiva Naudziuniene Date: Wed, 28 Jun 2017 05:02:20 -0700 Subject: [PATCH] Propagating access of Decl from clang plugin to ProcAttributes. Reviewed By: jberdine Differential Revision: D5329307 Tags: infer fbshipit-source-id: fdd114e --- facebook-clang-plugins | 2 +- infer/src/clang/ast_expressions.ml | 1 + infer/src/clang/cFrontend_decl.ml | 2 +- infer/src/clang/cMethod_signature.ml | 7 +- infer/src/clang/cMethod_signature.mli | 4 +- infer/src/clang/cMethod_trans.ml | 9 ++- infer/src/clang/cTrans_models.ml | 2 +- .../destructors/call_on_delete.cpp.dot | 14 ++-- .../constructors/constructor_new.cpp.dot | 22 ++--- .../cpp/shared/methods/static.cpp.dot | 20 ++--- .../cpp/shared/npe/method_call.cpp.dot | 22 ++--- .../shared/reference/member_access.cpp.dot | 22 ++--- .../reference/reference_struct_e2e.cpp.dot | 80 +++++++++---------- .../cpp/shared/templates/function.cpp.dot | 44 +++++----- .../cpp/shared/templates/sizeof_pack.cpp.dot | 22 ++--- .../shared/types/inheritance_casts.cpp.dot | 22 ++--- .../shared/types/operator_overload.cpp.dot | 22 ++--- .../types/struct_forward_declare.cpp.dot | 70 ++++++++-------- .../shared/types/struct_pass_by_value.cpp.dot | 44 +++++----- .../cpp/shared/types/typeid_expr.cpp.dot | 30 +++---- 20 files changed, 238 insertions(+), 223 deletions(-) diff --git a/facebook-clang-plugins b/facebook-clang-plugins index 71ada2c99..430d64ea6 160000 --- a/facebook-clang-plugins +++ b/facebook-clang-plugins @@ -1 +1 @@ -Subproject commit 71ada2c9994be2af8e8915e45d1c61c9d6a53d62 +Subproject commit 430d64ea675c3c3291b09339c633f81bf4448aa7 diff --git a/infer/src/clang/ast_expressions.ml b/infer/src/clang/ast_expressions.ml index 4cd2af84e..3ada54197 100644 --- a/infer/src/clang/ast_expressions.ml +++ b/infer/src/clang/ast_expressions.ml @@ -46,6 +46,7 @@ let empty_decl_info = { di_is_invalid_decl = false; di_attributes = []; di_full_comment = None; + di_access = `None; } let empty_var_decl_info = { diff --git a/infer/src/clang/cFrontend_decl.ml b/infer/src/clang/cFrontend_decl.ml index d86172768..42cf8c25e 100644 --- a/infer/src/clang/cFrontend_decl.ml +++ b/infer/src/clang/cFrontend_decl.ml @@ -238,7 +238,7 @@ struct Option.value_exn (Pvar.get_initializer_pname global) in let ms = CMethod_signature.make_ms procname [] Ast_expressions.create_void_type [] decl_info.Clang_ast_t.di_source_range false trans_unit_ctx.CFrontend_config.lang - None None None in + None None None `None in let stmt_info = { si_pointer = CAst_utils.get_fresh_pointer (); si_source_range = decl_info.di_source_range } in let body = Clang_ast_t.DeclStmt (stmt_info, [], [dec]) in diff --git a/infer/src/clang/cMethod_signature.ml b/infer/src/clang/cMethod_signature.ml index be606e672..699e95574 100644 --- a/infer/src/clang/cMethod_signature.ml +++ b/infer/src/clang/cMethod_signature.ml @@ -14,6 +14,7 @@ open! IStd type method_signature = { mutable name : Typ.Procname.t; + access : Clang_ast_t.access_specifier; args : (Mangled.t * Clang_ast_t.qual_type) list; ret_type : Clang_ast_t.qual_type; attributes : Clang_ast_t.attribute list; @@ -33,6 +34,9 @@ let ms_get_name { name } = let ms_set_name ms name = ms.name <- name +let ms_get_access { access } = + access + let ms_get_args { args } = args @@ -79,7 +83,7 @@ let ms_is_setter { pointer_to_property_opt; args } = Int.equal (List.length args) 2 let make_ms name args ret_type attributes loc is_instance ?is_cpp_virtual ?is_cpp_nothrow - language pointer_to_parent pointer_to_property_opt return_param_typ = + language pointer_to_parent pointer_to_property_opt return_param_typ access = let booloption_to_bool = function | Some b -> b | None -> false in @@ -87,6 +91,7 @@ let make_ms name args ret_type attributes loc is_instance ?is_cpp_virtual ?is_cp let is_cpp_nothrow = booloption_to_bool is_cpp_nothrow in { name; + access; args; ret_type; attributes; diff --git a/infer/src/clang/cMethod_signature.mli b/infer/src/clang/cMethod_signature.mli index d3e2c7cf7..aed4c6e01 100644 --- a/infer/src/clang/cMethod_signature.mli +++ b/infer/src/clang/cMethod_signature.mli @@ -18,6 +18,8 @@ val ms_get_name : method_signature -> Typ.Procname.t val ms_set_name : method_signature -> Typ.Procname.t -> unit +val ms_get_access : method_signature -> Clang_ast_t.access_specifier + val ms_get_args : method_signature -> (Mangled.t * Clang_ast_t.qual_type) list @@ -49,7 +51,7 @@ val make_ms : Typ.Procname.t -> (Mangled.t * Clang_ast_t.qual_type) list -> Clan -> Clang_ast_t.attribute list -> Clang_ast_t.source_range -> bool -> ?is_cpp_virtual:bool -> ?is_cpp_nothrow:bool -> CFrontend_config.clang_lang -> Clang_ast_t.pointer option -> Clang_ast_t.pointer option - -> Typ.t option -> method_signature + -> Typ.t option -> Clang_ast_t.access_specifier -> method_signature val replace_name_ms : method_signature -> Typ.Procname.t -> method_signature diff --git a/infer/src/clang/cMethod_trans.ml b/infer/src/clang/cMethod_trans.ml index c2e8a0c82..7dee218fb 100644 --- a/infer/src/clang/cMethod_trans.ml +++ b/infer/src/clang/cMethod_trans.ml @@ -147,9 +147,10 @@ let build_method_signature trans_unit_ctx tenv decl_info procname function_metho let lang = get_language trans_unit_ctx function_method_decl_info in let is_cpp_virtual = is_cpp_virtual function_method_decl_info in let is_cpp_nothrow = is_cpp_nothrow function_method_decl_info in + let access = decl_info.Clang_ast_t.di_access in CMethod_signature.make_ms procname parameters tp attributes source_range is_instance_method ~is_cpp_virtual - ~is_cpp_nothrow lang parent_pointer pointer_to_property_opt return_param_type_opt + ~is_cpp_nothrow lang parent_pointer pointer_to_property_opt return_param_type_opt access let get_init_list_instrs method_decl_info = let create_custom_instr construct_instr = `CXXConstructorInit construct_instr in @@ -400,6 +401,11 @@ let create_local_procdesc ?(set_objc_accessor_attr=false) trans_unit_ctx cfg ten CMethod_signature.ms_is_instance ms && CFrontend_config.equal_clang_lang (CMethod_signature.ms_get_lang ms) CFrontend_config.CPP in let is_cpp_nothrow = CMethod_signature.ms_is_cpp_nothrow ms in + let access = match CMethod_signature.ms_get_access ms with + | `None -> PredSymb.Default + | `Private -> PredSymb.Private + | `Protected -> PredSymb.Protected + | `Public -> PredSymb.Protected in let create_new_procdesc () = let formals = get_formal_parameters tenv ms in let captured_mangled = List.map ~f:(fun (var, t) -> (Pvar.get_name var), t) captured in @@ -423,6 +429,7 @@ let create_local_procdesc ?(set_objc_accessor_attr=false) trans_unit_ctx cfg ten ProcAttributes.captured = captured_mangled; formals; const_formals; + access = access; func_attributes = attributes; is_defined = defined; is_objc_instance_method = is_objc_inst_method; diff --git a/infer/src/clang/cTrans_models.ml b/infer/src/clang/cTrans_models.ml index 6f0efbb68..22ff854f8 100644 --- a/infer/src/clang/cTrans_models.ml +++ b/infer/src/clang/cTrans_models.ml @@ -140,7 +140,7 @@ let get_predefined_ms_method condition class_name method_name method_kind mk_pro | Some procname -> procname | None -> mk_procname class_name method_name method_kind in let ms = CMethod_signature.make_ms procname arguments return_type attributes - (Ast_expressions.dummy_source_range ()) false lang None None None in + (Ast_expressions.dummy_source_range ()) false lang None None None `None in Some ms else None diff --git a/infer/tests/codetoanalyze/cpp/frontend/destructors/call_on_delete.cpp.dot b/infer/tests/codetoanalyze/cpp/frontend/destructors/call_on_delete.cpp.dot index 697fa7bdd..cbdd93a9f 100644 --- a/infer/tests/codetoanalyze/cpp/frontend/destructors/call_on_delete.cpp.dot +++ b/infer/tests/codetoanalyze/cpp/frontend/destructors/call_on_delete.cpp.dot @@ -1,12 +1,5 @@ /* @generated */ digraph iCFG { -"~X#X#(_ZN1XD0Ev).570f4e582c393d8fb931d72cddd28836_1" [label="1: Start X_~X\nFormals: this:X*\nLocals: \n DECLARE_LOCALS(&return); [line 11]\n " color=yellow style=filled] - - - "~X#X#(_ZN1XD0Ev).570f4e582c393d8fb931d72cddd28836_1" -> "~X#X#(_ZN1XD0Ev).570f4e582c393d8fb931d72cddd28836_2" ; -"~X#X#(_ZN1XD0Ev).570f4e582c393d8fb931d72cddd28836_2" [label="2: Exit X_~X \n " color=yellow style=filled] - - "deleteInt#_Z9deleteIntPi.1290a142cb905da33c4edc8a99e3d74e_1" [label="1: Start deleteInt\nFormals: x:int*\nLocals: \n DECLARE_LOCALS(&return); [line 16]\n " color=yellow style=filled] @@ -29,4 +22,11 @@ digraph iCFG { "deleteX#_Z7deleteXP1X.ddffb30c0ee6370177b08414b2c6d138_3" -> "deleteX#_Z7deleteXP1X.ddffb30c0ee6370177b08414b2c6d138_2" ; +"~X#X#(_ZN1XD0Ev).570f4e582c393d8fb931d72cddd28836_1" [label="1: Start X_~X\nFormals: this:X*\nLocals: \n DECLARE_LOCALS(&return); [line 11]\n " color=yellow style=filled] + + + "~X#X#(_ZN1XD0Ev).570f4e582c393d8fb931d72cddd28836_1" -> "~X#X#(_ZN1XD0Ev).570f4e582c393d8fb931d72cddd28836_2" ; +"~X#X#(_ZN1XD0Ev).570f4e582c393d8fb931d72cddd28836_2" [label="2: Exit X_~X \n " color=yellow style=filled] + + } diff --git a/infer/tests/codetoanalyze/cpp/shared/constructors/constructor_new.cpp.dot b/infer/tests/codetoanalyze/cpp/shared/constructors/constructor_new.cpp.dot index 1c7afed98..8fb37cb11 100644 --- a/infer/tests/codetoanalyze/cpp/shared/constructors/constructor_new.cpp.dot +++ b/infer/tests/codetoanalyze/cpp/shared/constructors/constructor_new.cpp.dot @@ -322,6 +322,17 @@ digraph iCFG { "matrix_of_person#constructor_new#_ZN15constructor_new16matrix_of_personEv.6eca49c294523e3080fbda7d175061b6_4" -> "matrix_of_person#constructor_new#_ZN15constructor_new16matrix_of_personEv.6eca49c294523e3080fbda7d175061b6_3" ; +"getValue#constructor_new#_ZN15constructor_new8getValueEi.3307eb22ab3b29d5e31ce28120319511_1" [label="1: Start constructor_new::getValue\nFormals: x:int\nLocals: \n DECLARE_LOCALS(&return); [line 27]\n " color=yellow style=filled] + + + "getValue#constructor_new#_ZN15constructor_new8getValueEi.3307eb22ab3b29d5e31ce28120319511_1" -> "getValue#constructor_new#_ZN15constructor_new8getValueEi.3307eb22ab3b29d5e31ce28120319511_3" ; +"getValue#constructor_new#_ZN15constructor_new8getValueEi.3307eb22ab3b29d5e31ce28120319511_2" [label="2: Exit constructor_new::getValue \n " color=yellow style=filled] + + +"getValue#constructor_new#_ZN15constructor_new8getValueEi.3307eb22ab3b29d5e31ce28120319511_3" [label="3: Return Stmt \n n$0=*&x:int [line 27]\n *&return:int=n$0 [line 27]\n " shape="box"] + + + "getValue#constructor_new#_ZN15constructor_new8getValueEi.3307eb22ab3b29d5e31ce28120319511_3" -> "getValue#constructor_new#_ZN15constructor_new8getValueEi.3307eb22ab3b29d5e31ce28120319511_2" ; "Person#Person#constructor_new#{_ZN15constructor_new6PersonC1Ev}.a245d93147833a3874d3c1656409b60a_1" [label="1: Start constructor_new::Person_Person\nFormals: this:constructor_new::Person*\nLocals: \n DECLARE_LOCALS(&return); [line 14]\n " color=yellow style=filled] @@ -363,15 +374,4 @@ digraph iCFG { "Person#Person#constructor_new#{_ZN15constructor_new6PersonC1Eiii}.744f98a8f96fa3cd08edd4eddc2a829d_5" -> "Person#Person#constructor_new#{_ZN15constructor_new6PersonC1Eiii}.744f98a8f96fa3cd08edd4eddc2a829d_4" ; -"getValue#constructor_new#_ZN15constructor_new8getValueEi.3307eb22ab3b29d5e31ce28120319511_1" [label="1: Start constructor_new::getValue\nFormals: x:int\nLocals: \n DECLARE_LOCALS(&return); [line 27]\n " color=yellow style=filled] - - - "getValue#constructor_new#_ZN15constructor_new8getValueEi.3307eb22ab3b29d5e31ce28120319511_1" -> "getValue#constructor_new#_ZN15constructor_new8getValueEi.3307eb22ab3b29d5e31ce28120319511_3" ; -"getValue#constructor_new#_ZN15constructor_new8getValueEi.3307eb22ab3b29d5e31ce28120319511_2" [label="2: Exit constructor_new::getValue \n " color=yellow style=filled] - - -"getValue#constructor_new#_ZN15constructor_new8getValueEi.3307eb22ab3b29d5e31ce28120319511_3" [label="3: Return Stmt \n n$0=*&x:int [line 27]\n *&return:int=n$0 [line 27]\n " shape="box"] - - - "getValue#constructor_new#_ZN15constructor_new8getValueEi.3307eb22ab3b29d5e31ce28120319511_3" -> "getValue#constructor_new#_ZN15constructor_new8getValueEi.3307eb22ab3b29d5e31ce28120319511_2" ; } diff --git a/infer/tests/codetoanalyze/cpp/shared/methods/static.cpp.dot b/infer/tests/codetoanalyze/cpp/shared/methods/static.cpp.dot index d9aae262b..d4d8f5bf5 100644 --- a/infer/tests/codetoanalyze/cpp/shared/methods/static.cpp.dot +++ b/infer/tests/codetoanalyze/cpp/shared/methods/static.cpp.dot @@ -11,26 +11,26 @@ digraph iCFG { "div0_class#_Z10div0_classv.fd725c6ecd145e6f806a63d5b7a6247c_3" -> "div0_class#_Z10div0_classv.fd725c6ecd145e6f806a63d5b7a6247c_2" ; -"fun#A#(_ZN1A3funEi).1217ae18adb247c2e3f6f070a6805a4b_1" [label="1: Start A_fun\nFormals: a:int\nLocals: \n DECLARE_LOCALS(&return); [line 15]\n " color=yellow style=filled] +"div0_instance#_Z13div0_instanceP1A.2638ef2378ffe4d2937fb96f33a5a0b4_1" [label="1: Start div0_instance\nFormals: a:A*\nLocals: \n DECLARE_LOCALS(&return); [line 19]\n " color=yellow style=filled] - "fun#A#(_ZN1A3funEi).1217ae18adb247c2e3f6f070a6805a4b_1" -> "fun#A#(_ZN1A3funEi).1217ae18adb247c2e3f6f070a6805a4b_3" ; -"fun#A#(_ZN1A3funEi).1217ae18adb247c2e3f6f070a6805a4b_2" [label="2: Exit A_fun \n " color=yellow style=filled] + "div0_instance#_Z13div0_instanceP1A.2638ef2378ffe4d2937fb96f33a5a0b4_1" -> "div0_instance#_Z13div0_instanceP1A.2638ef2378ffe4d2937fb96f33a5a0b4_3" ; +"div0_instance#_Z13div0_instanceP1A.2638ef2378ffe4d2937fb96f33a5a0b4_2" [label="2: Exit div0_instance \n " color=yellow style=filled] -"fun#A#(_ZN1A3funEi).1217ae18adb247c2e3f6f070a6805a4b_3" [label="3: Return Stmt \n n$0=*&a:int [line 15]\n *&return:int=(1 / n$0) [line 15]\n " shape="box"] +"div0_instance#_Z13div0_instanceP1A.2638ef2378ffe4d2937fb96f33a5a0b4_3" [label="3: Call _fun_A_fun \n n$0=*&a:A* [line 21]\n n$1=_fun_A_fun(0:int) [line 21]\n " shape="box"] - "fun#A#(_ZN1A3funEi).1217ae18adb247c2e3f6f070a6805a4b_3" -> "fun#A#(_ZN1A3funEi).1217ae18adb247c2e3f6f070a6805a4b_2" ; -"div0_instance#_Z13div0_instanceP1A.2638ef2378ffe4d2937fb96f33a5a0b4_1" [label="1: Start div0_instance\nFormals: a:A*\nLocals: \n DECLARE_LOCALS(&return); [line 19]\n " color=yellow style=filled] + "div0_instance#_Z13div0_instanceP1A.2638ef2378ffe4d2937fb96f33a5a0b4_3" -> "div0_instance#_Z13div0_instanceP1A.2638ef2378ffe4d2937fb96f33a5a0b4_2" ; +"fun#A#(_ZN1A3funEi).1217ae18adb247c2e3f6f070a6805a4b_1" [label="1: Start A_fun\nFormals: a:int\nLocals: \n DECLARE_LOCALS(&return); [line 15]\n " color=yellow style=filled] - "div0_instance#_Z13div0_instanceP1A.2638ef2378ffe4d2937fb96f33a5a0b4_1" -> "div0_instance#_Z13div0_instanceP1A.2638ef2378ffe4d2937fb96f33a5a0b4_3" ; -"div0_instance#_Z13div0_instanceP1A.2638ef2378ffe4d2937fb96f33a5a0b4_2" [label="2: Exit div0_instance \n " color=yellow style=filled] + "fun#A#(_ZN1A3funEi).1217ae18adb247c2e3f6f070a6805a4b_1" -> "fun#A#(_ZN1A3funEi).1217ae18adb247c2e3f6f070a6805a4b_3" ; +"fun#A#(_ZN1A3funEi).1217ae18adb247c2e3f6f070a6805a4b_2" [label="2: Exit A_fun \n " color=yellow style=filled] -"div0_instance#_Z13div0_instanceP1A.2638ef2378ffe4d2937fb96f33a5a0b4_3" [label="3: Call _fun_A_fun \n n$0=*&a:A* [line 21]\n n$1=_fun_A_fun(0:int) [line 21]\n " shape="box"] +"fun#A#(_ZN1A3funEi).1217ae18adb247c2e3f6f070a6805a4b_3" [label="3: Return Stmt \n n$0=*&a:int [line 15]\n *&return:int=(1 / n$0) [line 15]\n " shape="box"] - "div0_instance#_Z13div0_instanceP1A.2638ef2378ffe4d2937fb96f33a5a0b4_3" -> "div0_instance#_Z13div0_instanceP1A.2638ef2378ffe4d2937fb96f33a5a0b4_2" ; + "fun#A#(_ZN1A3funEi).1217ae18adb247c2e3f6f070a6805a4b_3" -> "fun#A#(_ZN1A3funEi).1217ae18adb247c2e3f6f070a6805a4b_2" ; } diff --git a/infer/tests/codetoanalyze/cpp/shared/npe/method_call.cpp.dot b/infer/tests/codetoanalyze/cpp/shared/npe/method_call.cpp.dot index 312cba433..9167b2f3a 100644 --- a/infer/tests/codetoanalyze/cpp/shared/npe/method_call.cpp.dot +++ b/infer/tests/codetoanalyze/cpp/shared/npe/method_call.cpp.dot @@ -48,6 +48,17 @@ digraph iCFG { "npe_call_with_forward_declaration#_Z33npe_call_with_forward_declarationv.ad7fd394481920cd97c78fc355441a32_3" -> "npe_call_with_forward_declaration#_Z33npe_call_with_forward_declarationv.ad7fd394481920cd97c78fc355441a32_2" ; +"call_with_forward_declaration#_Z29call_with_forward_declarationP8XForward.bbdb4d104caed29f8898a86f2a4a6f01_1" [label="1: Start call_with_forward_declaration\nFormals: x:XForward*\nLocals: \n DECLARE_LOCALS(&return); [line 35]\n " color=yellow style=filled] + + + "call_with_forward_declaration#_Z29call_with_forward_declarationP8XForward.bbdb4d104caed29f8898a86f2a4a6f01_1" -> "call_with_forward_declaration#_Z29call_with_forward_declarationP8XForward.bbdb4d104caed29f8898a86f2a4a6f01_3" ; +"call_with_forward_declaration#_Z29call_with_forward_declarationP8XForward.bbdb4d104caed29f8898a86f2a4a6f01_2" [label="2: Exit call_with_forward_declaration \n " color=yellow style=filled] + + +"call_with_forward_declaration#_Z29call_with_forward_declarationP8XForward.bbdb4d104caed29f8898a86f2a4a6f01_3" [label="3: Call _fun_XForward_call \n n$0=*&x:XForward* [line 35]\n _=*n$0:XForward [line 35]\n n$2=_fun_XForward_call(n$0:XForward*) [line 35]\n " shape="box"] + + + "call_with_forward_declaration#_Z29call_with_forward_declarationP8XForward.bbdb4d104caed29f8898a86f2a4a6f01_3" -> "call_with_forward_declaration#_Z29call_with_forward_declarationP8XForward.bbdb4d104caed29f8898a86f2a4a6f01_2" ; "call#X#(_ZN1X4callEv).6850f213fac2fabbb652507f2d371b31_1" [label="1: Start X_call\nFormals: this:X*\nLocals: \n DECLARE_LOCALS(&return); [line 12]\n " color=yellow style=filled] @@ -70,15 +81,4 @@ digraph iCFG { "call#XForward#(_ZN8XForward4callEv).6e2d73601523a55b813cc82c5e49ca70_3" -> "call#XForward#(_ZN8XForward4callEv).6e2d73601523a55b813cc82c5e49ca70_2" ; -"call_with_forward_declaration#_Z29call_with_forward_declarationP8XForward.bbdb4d104caed29f8898a86f2a4a6f01_1" [label="1: Start call_with_forward_declaration\nFormals: x:XForward*\nLocals: \n DECLARE_LOCALS(&return); [line 35]\n " color=yellow style=filled] - - - "call_with_forward_declaration#_Z29call_with_forward_declarationP8XForward.bbdb4d104caed29f8898a86f2a4a6f01_1" -> "call_with_forward_declaration#_Z29call_with_forward_declarationP8XForward.bbdb4d104caed29f8898a86f2a4a6f01_3" ; -"call_with_forward_declaration#_Z29call_with_forward_declarationP8XForward.bbdb4d104caed29f8898a86f2a4a6f01_2" [label="2: Exit call_with_forward_declaration \n " color=yellow style=filled] - - -"call_with_forward_declaration#_Z29call_with_forward_declarationP8XForward.bbdb4d104caed29f8898a86f2a4a6f01_3" [label="3: Call _fun_XForward_call \n n$0=*&x:XForward* [line 35]\n _=*n$0:XForward [line 35]\n n$2=_fun_XForward_call(n$0:XForward*) [line 35]\n " shape="box"] - - - "call_with_forward_declaration#_Z29call_with_forward_declarationP8XForward.bbdb4d104caed29f8898a86f2a4a6f01_3" -> "call_with_forward_declaration#_Z29call_with_forward_declarationP8XForward.bbdb4d104caed29f8898a86f2a4a6f01_2" ; } diff --git a/infer/tests/codetoanalyze/cpp/shared/reference/member_access.cpp.dot b/infer/tests/codetoanalyze/cpp/shared/reference/member_access.cpp.dot index c758bea13..1a4b2fb93 100644 --- a/infer/tests/codetoanalyze/cpp/shared/reference/member_access.cpp.dot +++ b/infer/tests/codetoanalyze/cpp/shared/reference/member_access.cpp.dot @@ -1,16 +1,5 @@ /* @generated */ digraph iCFG { -"call#X#(_ZN1X4callEv).6850f213fac2fabbb652507f2d371b31_1" [label="1: Start X_call\nFormals: this:X*\nLocals: \n DECLARE_LOCALS(&return); [line 12]\n " color=yellow style=filled] - - - "call#X#(_ZN1X4callEv).6850f213fac2fabbb652507f2d371b31_1" -> "call#X#(_ZN1X4callEv).6850f213fac2fabbb652507f2d371b31_3" ; -"call#X#(_ZN1X4callEv).6850f213fac2fabbb652507f2d371b31_2" [label="2: Exit X_call \n " color=yellow style=filled] - - -"call#X#(_ZN1X4callEv).6850f213fac2fabbb652507f2d371b31_3" [label="3: Return Stmt \n n$0=*&this:X* [line 12]\n n$1=*n$0.f:int [line 12]\n *&return:int=n$1 [line 12]\n " shape="box"] - - - "call#X#(_ZN1X4callEv).6850f213fac2fabbb652507f2d371b31_3" -> "call#X#(_ZN1X4callEv).6850f213fac2fabbb652507f2d371b31_2" ; "access_ptr#_Z10access_ptrP1X.d92da761037ff62981b797569043086d_1" [label="1: Start access_ptr\nFormals: x:X*\nLocals: c:int f:int \n DECLARE_LOCALS(&return,&c,&f); [line 20]\n " color=yellow style=filled] @@ -41,4 +30,15 @@ digraph iCFG { "access_ref#_Z10access_refR1X.fe108dde015a2c821663ca99df26a44e_4" -> "access_ref#_Z10access_refR1X.fe108dde015a2c821663ca99df26a44e_3" ; +"call#X#(_ZN1X4callEv).6850f213fac2fabbb652507f2d371b31_1" [label="1: Start X_call\nFormals: this:X*\nLocals: \n DECLARE_LOCALS(&return); [line 12]\n " color=yellow style=filled] + + + "call#X#(_ZN1X4callEv).6850f213fac2fabbb652507f2d371b31_1" -> "call#X#(_ZN1X4callEv).6850f213fac2fabbb652507f2d371b31_3" ; +"call#X#(_ZN1X4callEv).6850f213fac2fabbb652507f2d371b31_2" [label="2: Exit X_call \n " color=yellow style=filled] + + +"call#X#(_ZN1X4callEv).6850f213fac2fabbb652507f2d371b31_3" [label="3: Return Stmt \n n$0=*&this:X* [line 12]\n n$1=*n$0.f:int [line 12]\n *&return:int=n$1 [line 12]\n " shape="box"] + + + "call#X#(_ZN1X4callEv).6850f213fac2fabbb652507f2d371b31_3" -> "call#X#(_ZN1X4callEv).6850f213fac2fabbb652507f2d371b31_2" ; } diff --git a/infer/tests/codetoanalyze/cpp/shared/reference/reference_struct_e2e.cpp.dot b/infer/tests/codetoanalyze/cpp/shared/reference/reference_struct_e2e.cpp.dot index 069466fbf..046f51e5c 100644 --- a/infer/tests/codetoanalyze/cpp/shared/reference/reference_struct_e2e.cpp.dot +++ b/infer/tests/codetoanalyze/cpp/shared/reference/reference_struct_e2e.cpp.dot @@ -185,46 +185,6 @@ digraph iCFG { "get_global_ref_div1_field#_Z25get_global_ref_div1_fieldv.d1cf014a8a7594c25502e7467036db43_5" -> "get_global_ref_div1_field#_Z25get_global_ref_div1_fieldv.d1cf014a8a7594c25502e7467036db43_4" ; -"nonzero#X#(_ZN1X7nonzeroEv).2573fca1bed3ac1e33f8f506c6474b44_1" [label="1: Start X_nonzero\nFormals: this:X*\nLocals: \n DECLARE_LOCALS(&return); [line 12]\n " color=yellow style=filled] - - - "nonzero#X#(_ZN1X7nonzeroEv).2573fca1bed3ac1e33f8f506c6474b44_1" -> "nonzero#X#(_ZN1X7nonzeroEv).2573fca1bed3ac1e33f8f506c6474b44_3" ; -"nonzero#X#(_ZN1X7nonzeroEv).2573fca1bed3ac1e33f8f506c6474b44_2" [label="2: Exit X_nonzero \n " color=yellow style=filled] - - -"nonzero#X#(_ZN1X7nonzeroEv).2573fca1bed3ac1e33f8f506c6474b44_3" [label="3: BinaryOperatorStmt: Assign \n n$0=*&this:X* [line 12]\n *n$0.f:int=1 [line 12]\n " shape="box"] - - - "nonzero#X#(_ZN1X7nonzeroEv).2573fca1bed3ac1e33f8f506c6474b44_3" -> "nonzero#X#(_ZN1X7nonzeroEv).2573fca1bed3ac1e33f8f506c6474b44_2" ; -"zero#X#(_ZN1X4zeroEv).c444db103f7b307f02ac43a6a304dbe1_1" [label="1: Start X_zero\nFormals: this:X*\nLocals: \n DECLARE_LOCALS(&return); [line 13]\n " color=yellow style=filled] - - - "zero#X#(_ZN1X4zeroEv).c444db103f7b307f02ac43a6a304dbe1_1" -> "zero#X#(_ZN1X4zeroEv).c444db103f7b307f02ac43a6a304dbe1_3" ; -"zero#X#(_ZN1X4zeroEv).c444db103f7b307f02ac43a6a304dbe1_2" [label="2: Exit X_zero \n " color=yellow style=filled] - - -"zero#X#(_ZN1X4zeroEv).c444db103f7b307f02ac43a6a304dbe1_3" [label="3: BinaryOperatorStmt: Assign \n n$0=*&this:X* [line 13]\n *n$0.f:int=0 [line 13]\n " shape="box"] - - - "zero#X#(_ZN1X4zeroEv).c444db103f7b307f02ac43a6a304dbe1_3" -> "zero#X#(_ZN1X4zeroEv).c444db103f7b307f02ac43a6a304dbe1_2" ; -"div#X#(_ZN1X3divEv).fae6613d1bfa8e05808cbca4d87359bf_1" [label="1: Start X_div\nFormals: this:X*\nLocals: \n DECLARE_LOCALS(&return); [line 14]\n " color=yellow style=filled] - - - "div#X#(_ZN1X3divEv).fae6613d1bfa8e05808cbca4d87359bf_1" -> "div#X#(_ZN1X3divEv).fae6613d1bfa8e05808cbca4d87359bf_3" ; -"div#X#(_ZN1X3divEv).fae6613d1bfa8e05808cbca4d87359bf_2" [label="2: Exit X_div \n " color=yellow style=filled] - - -"div#X#(_ZN1X3divEv).fae6613d1bfa8e05808cbca4d87359bf_3" [label="3: Return Stmt \n n$0=*&this:X* [line 14]\n n$1=*n$0.f:int [line 14]\n *&return:int=(1 / n$1) [line 14]\n " shape="box"] - - - "div#X#(_ZN1X3divEv).fae6613d1bfa8e05808cbca4d87359bf_3" -> "div#X#(_ZN1X3divEv).fae6613d1bfa8e05808cbca4d87359bf_2" ; -"X#X#{_ZN1XC1Ev}.de3838d93566ad3a73011188ff48af20_1" [label="1: Start X_X\nFormals: this:X*\nLocals: \n DECLARE_LOCALS(&return); [line 10]\n " color=yellow style=filled] - - - "X#X#{_ZN1XC1Ev}.de3838d93566ad3a73011188ff48af20_1" -> "X#X#{_ZN1XC1Ev}.de3838d93566ad3a73011188ff48af20_2" ; -"X#X#{_ZN1XC1Ev}.de3838d93566ad3a73011188ff48af20_2" [label="2: Exit X_X \n " color=yellow style=filled] - - "zero_ptr#_Z8zero_ptrP1X.116c76a845da4635b8015868b6f88148_1" [label="1: Start zero_ptr\nFormals: x:X*\nLocals: \n DECLARE_LOCALS(&return); [line 17]\n " color=yellow style=filled] @@ -479,4 +439,44 @@ digraph iCFG { "set_field_ref#_Z13set_field_refR1Xi.9462d74c213d319726fe99c7c846fa01_3" -> "set_field_ref#_Z13set_field_refR1Xi.9462d74c213d319726fe99c7c846fa01_2" ; +"nonzero#X#(_ZN1X7nonzeroEv).2573fca1bed3ac1e33f8f506c6474b44_1" [label="1: Start X_nonzero\nFormals: this:X*\nLocals: \n DECLARE_LOCALS(&return); [line 12]\n " color=yellow style=filled] + + + "nonzero#X#(_ZN1X7nonzeroEv).2573fca1bed3ac1e33f8f506c6474b44_1" -> "nonzero#X#(_ZN1X7nonzeroEv).2573fca1bed3ac1e33f8f506c6474b44_3" ; +"nonzero#X#(_ZN1X7nonzeroEv).2573fca1bed3ac1e33f8f506c6474b44_2" [label="2: Exit X_nonzero \n " color=yellow style=filled] + + +"nonzero#X#(_ZN1X7nonzeroEv).2573fca1bed3ac1e33f8f506c6474b44_3" [label="3: BinaryOperatorStmt: Assign \n n$0=*&this:X* [line 12]\n *n$0.f:int=1 [line 12]\n " shape="box"] + + + "nonzero#X#(_ZN1X7nonzeroEv).2573fca1bed3ac1e33f8f506c6474b44_3" -> "nonzero#X#(_ZN1X7nonzeroEv).2573fca1bed3ac1e33f8f506c6474b44_2" ; +"zero#X#(_ZN1X4zeroEv).c444db103f7b307f02ac43a6a304dbe1_1" [label="1: Start X_zero\nFormals: this:X*\nLocals: \n DECLARE_LOCALS(&return); [line 13]\n " color=yellow style=filled] + + + "zero#X#(_ZN1X4zeroEv).c444db103f7b307f02ac43a6a304dbe1_1" -> "zero#X#(_ZN1X4zeroEv).c444db103f7b307f02ac43a6a304dbe1_3" ; +"zero#X#(_ZN1X4zeroEv).c444db103f7b307f02ac43a6a304dbe1_2" [label="2: Exit X_zero \n " color=yellow style=filled] + + +"zero#X#(_ZN1X4zeroEv).c444db103f7b307f02ac43a6a304dbe1_3" [label="3: BinaryOperatorStmt: Assign \n n$0=*&this:X* [line 13]\n *n$0.f:int=0 [line 13]\n " shape="box"] + + + "zero#X#(_ZN1X4zeroEv).c444db103f7b307f02ac43a6a304dbe1_3" -> "zero#X#(_ZN1X4zeroEv).c444db103f7b307f02ac43a6a304dbe1_2" ; +"div#X#(_ZN1X3divEv).fae6613d1bfa8e05808cbca4d87359bf_1" [label="1: Start X_div\nFormals: this:X*\nLocals: \n DECLARE_LOCALS(&return); [line 14]\n " color=yellow style=filled] + + + "div#X#(_ZN1X3divEv).fae6613d1bfa8e05808cbca4d87359bf_1" -> "div#X#(_ZN1X3divEv).fae6613d1bfa8e05808cbca4d87359bf_3" ; +"div#X#(_ZN1X3divEv).fae6613d1bfa8e05808cbca4d87359bf_2" [label="2: Exit X_div \n " color=yellow style=filled] + + +"div#X#(_ZN1X3divEv).fae6613d1bfa8e05808cbca4d87359bf_3" [label="3: Return Stmt \n n$0=*&this:X* [line 14]\n n$1=*n$0.f:int [line 14]\n *&return:int=(1 / n$1) [line 14]\n " shape="box"] + + + "div#X#(_ZN1X3divEv).fae6613d1bfa8e05808cbca4d87359bf_3" -> "div#X#(_ZN1X3divEv).fae6613d1bfa8e05808cbca4d87359bf_2" ; +"X#X#{_ZN1XC1Ev}.de3838d93566ad3a73011188ff48af20_1" [label="1: Start X_X\nFormals: this:X*\nLocals: \n DECLARE_LOCALS(&return); [line 10]\n " color=yellow style=filled] + + + "X#X#{_ZN1XC1Ev}.de3838d93566ad3a73011188ff48af20_1" -> "X#X#{_ZN1XC1Ev}.de3838d93566ad3a73011188ff48af20_2" ; +"X#X#{_ZN1XC1Ev}.de3838d93566ad3a73011188ff48af20_2" [label="2: Exit X_X \n " color=yellow style=filled] + + } diff --git a/infer/tests/codetoanalyze/cpp/shared/templates/function.cpp.dot b/infer/tests/codetoanalyze/cpp/shared/templates/function.cpp.dot index 01458379a..99f34610b 100644 --- a/infer/tests/codetoanalyze/cpp/shared/templates/function.cpp.dot +++ b/infer/tests/codetoanalyze/cpp/shared/templates/function.cpp.dot @@ -112,6 +112,28 @@ digraph iCFG { "div1_create_and_get_val#function#_ZN8function23div1_create_and_get_valEv.94dff1e803b66aea8e36148ceb174417_3" -> "div1_create_and_get_val#function#_ZN8function23div1_create_and_get_valEv.94dff1e803b66aea8e36148ceb174417_2" ; +"getVal#function#_ZN8function6getValINS_2X1EEEiRT_.4276809d8e79ffc18c519ad85c9e825e_1" [label="1: Start function::getVal\nFormals: x:function::X1&\nLocals: \n DECLARE_LOCALS(&return); [line 25]\n " color=yellow style=filled] + + + "getVal#function#_ZN8function6getValINS_2X1EEEiRT_.4276809d8e79ffc18c519ad85c9e825e_1" -> "getVal#function#_ZN8function6getValINS_2X1EEEiRT_.4276809d8e79ffc18c519ad85c9e825e_3" ; +"getVal#function#_ZN8function6getValINS_2X1EEEiRT_.4276809d8e79ffc18c519ad85c9e825e_2" [label="2: Exit function::getVal \n " color=yellow style=filled] + + +"getVal#function#_ZN8function6getValINS_2X1EEEiRT_.4276809d8e79ffc18c519ad85c9e825e_3" [label="3: Return Stmt \n n$0=*&x:function::X1& [line 26]\n _=*n$0:function::X1 [line 26]\n n$2=_fun_function::X1_getVal(n$0:function::X1&) [line 26]\n *&return:int=n$2 [line 26]\n " shape="box"] + + + "getVal#function#_ZN8function6getValINS_2X1EEEiRT_.4276809d8e79ffc18c519ad85c9e825e_3" -> "getVal#function#_ZN8function6getValINS_2X1EEEiRT_.4276809d8e79ffc18c519ad85c9e825e_2" ; +"getVal#function#_ZN8function6getValINS_2X3EEEiRT_.4f3d136dded8bcc8ebefbf11d77e9d06_1" [label="1: Start function::getVal\nFormals: x:function::X3&\nLocals: \n DECLARE_LOCALS(&return); [line 30]\n " color=yellow style=filled] + + + "getVal#function#_ZN8function6getValINS_2X3EEEiRT_.4f3d136dded8bcc8ebefbf11d77e9d06_1" -> "getVal#function#_ZN8function6getValINS_2X3EEEiRT_.4f3d136dded8bcc8ebefbf11d77e9d06_3" ; +"getVal#function#_ZN8function6getValINS_2X3EEEiRT_.4f3d136dded8bcc8ebefbf11d77e9d06_2" [label="2: Exit function::getVal \n " color=yellow style=filled] + + +"getVal#function#_ZN8function6getValINS_2X3EEEiRT_.4f3d136dded8bcc8ebefbf11d77e9d06_3" [label="3: Return Stmt \n n$0=*&x:function::X3& [line 32]\n _=*n$0:function::X3 [line 32]\n n$2=_fun_function::X3_get(n$0:function::X3&) [line 32]\n *&return:int=n$2 [line 32]\n " shape="box"] + + + "getVal#function#_ZN8function6getValINS_2X3EEEiRT_.4f3d136dded8bcc8ebefbf11d77e9d06_3" -> "getVal#function#_ZN8function6getValINS_2X3EEEiRT_.4f3d136dded8bcc8ebefbf11d77e9d06_2" ; "getVal#X1#function#(_ZN8function2X16getValEv).bb0ae63addee293bc0dd7065b769992f_1" [label="1: Start function::X1_getVal\nFormals: this:function::X1*\nLocals: \n DECLARE_LOCALS(&return); [line 13]\n " color=yellow style=filled] @@ -159,26 +181,4 @@ digraph iCFG { "X3#X3#function#{_ZN8function2X3C1Ev|constexpr}.798f1471dcf2568095e45da7bfc54c33_2" [label="2: Exit function::X3_X3 \n " color=yellow style=filled] -"getVal#function#_ZN8function6getValINS_2X1EEEiRT_.4276809d8e79ffc18c519ad85c9e825e_1" [label="1: Start function::getVal\nFormals: x:function::X1&\nLocals: \n DECLARE_LOCALS(&return); [line 25]\n " color=yellow style=filled] - - - "getVal#function#_ZN8function6getValINS_2X1EEEiRT_.4276809d8e79ffc18c519ad85c9e825e_1" -> "getVal#function#_ZN8function6getValINS_2X1EEEiRT_.4276809d8e79ffc18c519ad85c9e825e_3" ; -"getVal#function#_ZN8function6getValINS_2X1EEEiRT_.4276809d8e79ffc18c519ad85c9e825e_2" [label="2: Exit function::getVal \n " color=yellow style=filled] - - -"getVal#function#_ZN8function6getValINS_2X1EEEiRT_.4276809d8e79ffc18c519ad85c9e825e_3" [label="3: Return Stmt \n n$0=*&x:function::X1& [line 26]\n _=*n$0:function::X1 [line 26]\n n$2=_fun_function::X1_getVal(n$0:function::X1&) [line 26]\n *&return:int=n$2 [line 26]\n " shape="box"] - - - "getVal#function#_ZN8function6getValINS_2X1EEEiRT_.4276809d8e79ffc18c519ad85c9e825e_3" -> "getVal#function#_ZN8function6getValINS_2X1EEEiRT_.4276809d8e79ffc18c519ad85c9e825e_2" ; -"getVal#function#_ZN8function6getValINS_2X3EEEiRT_.4f3d136dded8bcc8ebefbf11d77e9d06_1" [label="1: Start function::getVal\nFormals: x:function::X3&\nLocals: \n DECLARE_LOCALS(&return); [line 30]\n " color=yellow style=filled] - - - "getVal#function#_ZN8function6getValINS_2X3EEEiRT_.4f3d136dded8bcc8ebefbf11d77e9d06_1" -> "getVal#function#_ZN8function6getValINS_2X3EEEiRT_.4f3d136dded8bcc8ebefbf11d77e9d06_3" ; -"getVal#function#_ZN8function6getValINS_2X3EEEiRT_.4f3d136dded8bcc8ebefbf11d77e9d06_2" [label="2: Exit function::getVal \n " color=yellow style=filled] - - -"getVal#function#_ZN8function6getValINS_2X3EEEiRT_.4f3d136dded8bcc8ebefbf11d77e9d06_3" [label="3: Return Stmt \n n$0=*&x:function::X3& [line 32]\n _=*n$0:function::X3 [line 32]\n n$2=_fun_function::X3_get(n$0:function::X3&) [line 32]\n *&return:int=n$2 [line 32]\n " shape="box"] - - - "getVal#function#_ZN8function6getValINS_2X3EEEiRT_.4f3d136dded8bcc8ebefbf11d77e9d06_3" -> "getVal#function#_ZN8function6getValINS_2X3EEEiRT_.4f3d136dded8bcc8ebefbf11d77e9d06_2" ; } diff --git a/infer/tests/codetoanalyze/cpp/shared/templates/sizeof_pack.cpp.dot b/infer/tests/codetoanalyze/cpp/shared/templates/sizeof_pack.cpp.dot index e5ae36e44..5377556e2 100644 --- a/infer/tests/codetoanalyze/cpp/shared/templates/sizeof_pack.cpp.dot +++ b/infer/tests/codetoanalyze/cpp/shared/templates/sizeof_pack.cpp.dot @@ -11,17 +11,6 @@ digraph iCFG { "__infer_globals_initializer_test.19c6153ea70b713d8d2a1a0fd4ae91e3_3" -> "__infer_globals_initializer_test.19c6153ea70b713d8d2a1a0fd4ae91e3_2" ; -"hash#MyHasher#(_ZN8MyHasher4hashEi).1eea369da12a365223bc03beb7f7b901_1" [label="1: Start MyHasher_hash\nFormals: t:int\nLocals: \n DECLARE_LOCALS(&return); [line 11]\n " color=yellow style=filled] - - - "hash#MyHasher#(_ZN8MyHasher4hashEi).1eea369da12a365223bc03beb7f7b901_1" -> "hash#MyHasher#(_ZN8MyHasher4hashEi).1eea369da12a365223bc03beb7f7b901_3" ; -"hash#MyHasher#(_ZN8MyHasher4hashEi).1eea369da12a365223bc03beb7f7b901_2" [label="2: Exit MyHasher_hash \n " color=yellow style=filled] - - -"hash#MyHasher#(_ZN8MyHasher4hashEi).1eea369da12a365223bc03beb7f7b901_3" [label="3: Return Stmt \n *&return:int=1 [line 11]\n " shape="box"] - - - "hash#MyHasher#(_ZN8MyHasher4hashEi).1eea369da12a365223bc03beb7f7b901_3" -> "hash#MyHasher#(_ZN8MyHasher4hashEi).1eea369da12a365223bc03beb7f7b901_2" ; "hash_combine_generic#_Z20hash_combine_genericI8MyHasheriJiiEEiRKT0_DpRKT1_.3a83fee393c73f136d3b23cd9979468e_1" [label="1: Start hash_combine_generic\nFormals: t:int const & ts:int const & ts:int const &\nLocals: seed:int \n DECLARE_LOCALS(&return,&seed); [line 15]\n " color=yellow style=filled] @@ -54,4 +43,15 @@ digraph iCFG { "hash_combine_generic#_Z20hash_combine_genericI8MyHasheriJiiEEiRKT0_DpRKT1_.3a83fee393c73f136d3b23cd9979468e_8" -> "hash_combine_generic#_Z20hash_combine_genericI8MyHasheriJiiEEiRKT0_DpRKT1_.3a83fee393c73f136d3b23cd9979468e_5" ; "hash_combine_generic#_Z20hash_combine_genericI8MyHasheriJiiEEiRKT0_DpRKT1_.3a83fee393c73f136d3b23cd9979468e_8" -> "hash_combine_generic#_Z20hash_combine_genericI8MyHasheriJiiEEiRKT0_DpRKT1_.3a83fee393c73f136d3b23cd9979468e_6" ; +"hash#MyHasher#(_ZN8MyHasher4hashEi).1eea369da12a365223bc03beb7f7b901_1" [label="1: Start MyHasher_hash\nFormals: t:int\nLocals: \n DECLARE_LOCALS(&return); [line 11]\n " color=yellow style=filled] + + + "hash#MyHasher#(_ZN8MyHasher4hashEi).1eea369da12a365223bc03beb7f7b901_1" -> "hash#MyHasher#(_ZN8MyHasher4hashEi).1eea369da12a365223bc03beb7f7b901_3" ; +"hash#MyHasher#(_ZN8MyHasher4hashEi).1eea369da12a365223bc03beb7f7b901_2" [label="2: Exit MyHasher_hash \n " color=yellow style=filled] + + +"hash#MyHasher#(_ZN8MyHasher4hashEi).1eea369da12a365223bc03beb7f7b901_3" [label="3: Return Stmt \n *&return:int=1 [line 11]\n " shape="box"] + + + "hash#MyHasher#(_ZN8MyHasher4hashEi).1eea369da12a365223bc03beb7f7b901_3" -> "hash#MyHasher#(_ZN8MyHasher4hashEi).1eea369da12a365223bc03beb7f7b901_2" ; } diff --git a/infer/tests/codetoanalyze/cpp/shared/types/inheritance_casts.cpp.dot b/infer/tests/codetoanalyze/cpp/shared/types/inheritance_casts.cpp.dot index 48543b79b..c6c563dbd 100644 --- a/infer/tests/codetoanalyze/cpp/shared/types/inheritance_casts.cpp.dot +++ b/infer/tests/codetoanalyze/cpp/shared/types/inheritance_casts.cpp.dot @@ -82,6 +82,17 @@ digraph iCFG { "getB#inheritance_casts#_ZN17inheritance_casts4getBEi.3a3dc8645898c5027aae99e05025494c_5" -> "getB#inheritance_casts#_ZN17inheritance_casts4getBEi.3a3dc8645898c5027aae99e05025494c_4" ; +"div#inheritance_casts#_ZN17inheritance_casts3divERKNS_1AE.2add4c23f8184f07027ccb32fe3cee6d_1" [label="1: Start inheritance_casts::div\nFormals: x:inheritance_casts::A const &\nLocals: \n DECLARE_LOCALS(&return); [line 26]\n " color=yellow style=filled] + + + "div#inheritance_casts#_ZN17inheritance_casts3divERKNS_1AE.2add4c23f8184f07027ccb32fe3cee6d_1" -> "div#inheritance_casts#_ZN17inheritance_casts3divERKNS_1AE.2add4c23f8184f07027ccb32fe3cee6d_3" ; +"div#inheritance_casts#_ZN17inheritance_casts3divERKNS_1AE.2add4c23f8184f07027ccb32fe3cee6d_2" [label="2: Exit inheritance_casts::div \n " color=yellow style=filled] + + +"div#inheritance_casts#_ZN17inheritance_casts3divERKNS_1AE.2add4c23f8184f07027ccb32fe3cee6d_3" [label="3: Return Stmt \n n$0=*&x:inheritance_casts::A const & [line 26]\n n$1=*n$0.f:int [line 26]\n *&return:int=(1 / n$1) [line 26]\n " shape="box"] + + + "div#inheritance_casts#_ZN17inheritance_casts3divERKNS_1AE.2add4c23f8184f07027ccb32fe3cee6d_3" -> "div#inheritance_casts#_ZN17inheritance_casts3divERKNS_1AE.2add4c23f8184f07027ccb32fe3cee6d_2" ; "A#A#inheritance_casts#{_ZN17inheritance_casts1AC1Ev}.a3d1803b12cc04cbb5260c678862cdba_1" [label="1: Start inheritance_casts::A_A\nFormals: this:inheritance_casts::A*\nLocals: \n DECLARE_LOCALS(&return); [line 10]\n " color=yellow style=filled] @@ -122,15 +133,4 @@ digraph iCFG { "B#B#inheritance_casts#{_ZN17inheritance_casts1BC1EOS0_|constexpr}.e38b8f435b929838652bf1e8572853f3_3" -> "B#B#inheritance_casts#{_ZN17inheritance_casts1BC1EOS0_|constexpr}.e38b8f435b929838652bf1e8572853f3_2" ; -"div#inheritance_casts#_ZN17inheritance_casts3divERKNS_1AE.2add4c23f8184f07027ccb32fe3cee6d_1" [label="1: Start inheritance_casts::div\nFormals: x:inheritance_casts::A const &\nLocals: \n DECLARE_LOCALS(&return); [line 26]\n " color=yellow style=filled] - - - "div#inheritance_casts#_ZN17inheritance_casts3divERKNS_1AE.2add4c23f8184f07027ccb32fe3cee6d_1" -> "div#inheritance_casts#_ZN17inheritance_casts3divERKNS_1AE.2add4c23f8184f07027ccb32fe3cee6d_3" ; -"div#inheritance_casts#_ZN17inheritance_casts3divERKNS_1AE.2add4c23f8184f07027ccb32fe3cee6d_2" [label="2: Exit inheritance_casts::div \n " color=yellow style=filled] - - -"div#inheritance_casts#_ZN17inheritance_casts3divERKNS_1AE.2add4c23f8184f07027ccb32fe3cee6d_3" [label="3: Return Stmt \n n$0=*&x:inheritance_casts::A const & [line 26]\n n$1=*n$0.f:int [line 26]\n *&return:int=(1 / n$1) [line 26]\n " shape="box"] - - - "div#inheritance_casts#_ZN17inheritance_casts3divERKNS_1AE.2add4c23f8184f07027ccb32fe3cee6d_3" -> "div#inheritance_casts#_ZN17inheritance_casts3divERKNS_1AE.2add4c23f8184f07027ccb32fe3cee6d_2" ; } diff --git a/infer/tests/codetoanalyze/cpp/shared/types/operator_overload.cpp.dot b/infer/tests/codetoanalyze/cpp/shared/types/operator_overload.cpp.dot index c27433300..126215a81 100644 --- a/infer/tests/codetoanalyze/cpp/shared/types/operator_overload.cpp.dot +++ b/infer/tests/codetoanalyze/cpp/shared/types/operator_overload.cpp.dot @@ -1,16 +1,5 @@ /* @generated */ digraph iCFG { -"operator[]#X#(_ZN1XixEi).06c2ebd179efd21996b7e7592333f283_1" [label="1: Start X_operator[]\nFormals: this:X* x:int\nLocals: \n DECLARE_LOCALS(&return); [line 12]\n " color=yellow style=filled] - - - "operator[]#X#(_ZN1XixEi).06c2ebd179efd21996b7e7592333f283_1" -> "operator[]#X#(_ZN1XixEi).06c2ebd179efd21996b7e7592333f283_3" ; -"operator[]#X#(_ZN1XixEi).06c2ebd179efd21996b7e7592333f283_2" [label="2: Exit X_operator[] \n " color=yellow style=filled] - - -"operator[]#X#(_ZN1XixEi).06c2ebd179efd21996b7e7592333f283_3" [label="3: Return Stmt \n n$0=*&x:int [line 12]\n *&return:int=n$0 [line 12]\n " shape="box"] - - - "operator[]#X#(_ZN1XixEi).06c2ebd179efd21996b7e7592333f283_3" -> "operator[]#X#(_ZN1XixEi).06c2ebd179efd21996b7e7592333f283_2" ; "div0_method_op_ptr#_Z18div0_method_op_ptrP1X.9f859b8dfbff4649a66713bba3a306b6_1" [label="1: Start div0_method_op_ptr\nFormals: x:X*\nLocals: \n DECLARE_LOCALS(&return); [line 26]\n " color=yellow style=filled] @@ -100,4 +89,15 @@ digraph iCFG { "div0_inheritted_op#_Z18div0_inheritted_opR1Y.b14e6f1cfc9721bb55e18550b46b4910_3" -> "div0_inheritted_op#_Z18div0_inheritted_opR1Y.b14e6f1cfc9721bb55e18550b46b4910_2" ; +"operator[]#X#(_ZN1XixEi).06c2ebd179efd21996b7e7592333f283_1" [label="1: Start X_operator[]\nFormals: this:X* x:int\nLocals: \n DECLARE_LOCALS(&return); [line 12]\n " color=yellow style=filled] + + + "operator[]#X#(_ZN1XixEi).06c2ebd179efd21996b7e7592333f283_1" -> "operator[]#X#(_ZN1XixEi).06c2ebd179efd21996b7e7592333f283_3" ; +"operator[]#X#(_ZN1XixEi).06c2ebd179efd21996b7e7592333f283_2" [label="2: Exit X_operator[] \n " color=yellow style=filled] + + +"operator[]#X#(_ZN1XixEi).06c2ebd179efd21996b7e7592333f283_3" [label="3: Return Stmt \n n$0=*&x:int [line 12]\n *&return:int=n$0 [line 12]\n " shape="box"] + + + "operator[]#X#(_ZN1XixEi).06c2ebd179efd21996b7e7592333f283_3" -> "operator[]#X#(_ZN1XixEi).06c2ebd179efd21996b7e7592333f283_2" ; } diff --git a/infer/tests/codetoanalyze/cpp/shared/types/struct_forward_declare.cpp.dot b/infer/tests/codetoanalyze/cpp/shared/types/struct_forward_declare.cpp.dot index da7f5a9ff..8629c4e04 100644 --- a/infer/tests/codetoanalyze/cpp/shared/types/struct_forward_declare.cpp.dot +++ b/infer/tests/codetoanalyze/cpp/shared/types/struct_forward_declare.cpp.dot @@ -78,81 +78,81 @@ digraph iCFG { "Z_div0#struct_forward_declare#_ZN22struct_forward_declare6Z_div0Ev.a505b34806619878f3b8e521270dcf65_5" -> "Z_div0#struct_forward_declare#_ZN22struct_forward_declare6Z_div0Ev.a505b34806619878f3b8e521270dcf65_4" ; -"getF#X#struct_forward_declare#(_ZN22struct_forward_declare1X4getFEv).1e9b3699cbb3e16aa40f3c70fd848d39_1" [label="1: Start struct_forward_declare::X_getF\nFormals: this:struct_forward_declare::X*\nLocals: \n DECLARE_LOCALS(&return); [line 21]\n " color=yellow style=filled] +"X_ptr_div0#struct_forward_declare#_ZN22struct_forward_declare10X_ptr_div0EPNS_1XE.1092a9e506b6aa3a84ea78a4be5595fa_1" [label="1: Start struct_forward_declare::X_ptr_div0\nFormals: x:struct_forward_declare::X*\nLocals: \n DECLARE_LOCALS(&return); [line 42]\n " color=yellow style=filled] - "getF#X#struct_forward_declare#(_ZN22struct_forward_declare1X4getFEv).1e9b3699cbb3e16aa40f3c70fd848d39_1" -> "getF#X#struct_forward_declare#(_ZN22struct_forward_declare1X4getFEv).1e9b3699cbb3e16aa40f3c70fd848d39_3" ; -"getF#X#struct_forward_declare#(_ZN22struct_forward_declare1X4getFEv).1e9b3699cbb3e16aa40f3c70fd848d39_2" [label="2: Exit struct_forward_declare::X_getF \n " color=yellow style=filled] + "X_ptr_div0#struct_forward_declare#_ZN22struct_forward_declare10X_ptr_div0EPNS_1XE.1092a9e506b6aa3a84ea78a4be5595fa_1" -> "X_ptr_div0#struct_forward_declare#_ZN22struct_forward_declare10X_ptr_div0EPNS_1XE.1092a9e506b6aa3a84ea78a4be5595fa_4" ; +"X_ptr_div0#struct_forward_declare#_ZN22struct_forward_declare10X_ptr_div0EPNS_1XE.1092a9e506b6aa3a84ea78a4be5595fa_2" [label="2: Exit struct_forward_declare::X_ptr_div0 \n " color=yellow style=filled] -"getF#X#struct_forward_declare#(_ZN22struct_forward_declare1X4getFEv).1e9b3699cbb3e16aa40f3c70fd848d39_3" [label="3: Return Stmt \n n$0=*&this:struct_forward_declare::X* [line 21]\n n$1=*n$0.f:int [line 21]\n *&return:int=n$1 [line 21]\n " shape="box"] +"X_ptr_div0#struct_forward_declare#_ZN22struct_forward_declare10X_ptr_div0EPNS_1XE.1092a9e506b6aa3a84ea78a4be5595fa_3" [label="3: Return Stmt \n n$0=*&x:struct_forward_declare::X* [line 44]\n _=*n$0:struct_forward_declare::X [line 44]\n n$2=_fun_struct_forward_declare::X_getF(n$0:struct_forward_declare::X*) [line 44]\n *&return:int=(1 / n$2) [line 44]\n " shape="box"] - "getF#X#struct_forward_declare#(_ZN22struct_forward_declare1X4getFEv).1e9b3699cbb3e16aa40f3c70fd848d39_3" -> "getF#X#struct_forward_declare#(_ZN22struct_forward_declare1X4getFEv).1e9b3699cbb3e16aa40f3c70fd848d39_2" ; -"X#X#struct_forward_declare#{_ZN22struct_forward_declare1XC1Ev}.1134af3db0d0d9b85dd903e2f9d96998_1" [label="1: Start struct_forward_declare::X_X\nFormals: this:struct_forward_declare::X*\nLocals: \n DECLARE_LOCALS(&return); [line 19]\n " color=yellow style=filled] + "X_ptr_div0#struct_forward_declare#_ZN22struct_forward_declare10X_ptr_div0EPNS_1XE.1092a9e506b6aa3a84ea78a4be5595fa_3" -> "X_ptr_div0#struct_forward_declare#_ZN22struct_forward_declare10X_ptr_div0EPNS_1XE.1092a9e506b6aa3a84ea78a4be5595fa_2" ; +"X_ptr_div0#struct_forward_declare#_ZN22struct_forward_declare10X_ptr_div0EPNS_1XE.1092a9e506b6aa3a84ea78a4be5595fa_4" [label="4: BinaryOperatorStmt: Assign \n n$3=*&x:struct_forward_declare::X* [line 43]\n *n$3.f:int=0 [line 43]\n " shape="box"] - "X#X#struct_forward_declare#{_ZN22struct_forward_declare1XC1Ev}.1134af3db0d0d9b85dd903e2f9d96998_1" -> "X#X#struct_forward_declare#{_ZN22struct_forward_declare1XC1Ev}.1134af3db0d0d9b85dd903e2f9d96998_2" ; -"X#X#struct_forward_declare#{_ZN22struct_forward_declare1XC1Ev}.1134af3db0d0d9b85dd903e2f9d96998_2" [label="2: Exit struct_forward_declare::X_X \n " color=yellow style=filled] + "X_ptr_div0#struct_forward_declare#_ZN22struct_forward_declare10X_ptr_div0EPNS_1XE.1092a9e506b6aa3a84ea78a4be5595fa_4" -> "X_ptr_div0#struct_forward_declare#_ZN22struct_forward_declare10X_ptr_div0EPNS_1XE.1092a9e506b6aa3a84ea78a4be5595fa_3" ; +"Z_ptr_div0#struct_forward_declare#_ZN22struct_forward_declare10Z_ptr_div0EPNS_1ZE.ae82532ef25a8098cdd32061d5136f50_1" [label="1: Start struct_forward_declare::Z_ptr_div0\nFormals: z:struct_forward_declare::Z*\nLocals: \n DECLARE_LOCALS(&return); [line 63]\n " color=yellow style=filled] -"getF#Z#struct_forward_declare#(_ZN22struct_forward_declare1Z4getFEv).972609c8e19c27c5beb0f97c0f754d03_1" [label="1: Start struct_forward_declare::Z_getF\nFormals: this:struct_forward_declare::Z*\nLocals: \n DECLARE_LOCALS(&return); [line 30]\n " color=yellow style=filled] + "Z_ptr_div0#struct_forward_declare#_ZN22struct_forward_declare10Z_ptr_div0EPNS_1ZE.ae82532ef25a8098cdd32061d5136f50_1" -> "Z_ptr_div0#struct_forward_declare#_ZN22struct_forward_declare10Z_ptr_div0EPNS_1ZE.ae82532ef25a8098cdd32061d5136f50_4" ; +"Z_ptr_div0#struct_forward_declare#_ZN22struct_forward_declare10Z_ptr_div0EPNS_1ZE.ae82532ef25a8098cdd32061d5136f50_2" [label="2: Exit struct_forward_declare::Z_ptr_div0 \n " color=yellow style=filled] - "getF#Z#struct_forward_declare#(_ZN22struct_forward_declare1Z4getFEv).972609c8e19c27c5beb0f97c0f754d03_1" -> "getF#Z#struct_forward_declare#(_ZN22struct_forward_declare1Z4getFEv).972609c8e19c27c5beb0f97c0f754d03_3" ; -"getF#Z#struct_forward_declare#(_ZN22struct_forward_declare1Z4getFEv).972609c8e19c27c5beb0f97c0f754d03_2" [label="2: Exit struct_forward_declare::Z_getF \n " color=yellow style=filled] +"Z_ptr_div0#struct_forward_declare#_ZN22struct_forward_declare10Z_ptr_div0EPNS_1ZE.ae82532ef25a8098cdd32061d5136f50_3" [label="3: Return Stmt \n n$0=*&z:struct_forward_declare::Z* [line 68]\n _=*n$0:struct_forward_declare::Z [line 68]\n n$2=_fun_struct_forward_declare::Z_getF(n$0:struct_forward_declare::Z*) [line 68]\n *&return:int=(1 / n$2) [line 68]\n " shape="box"] -"getF#Z#struct_forward_declare#(_ZN22struct_forward_declare1Z4getFEv).972609c8e19c27c5beb0f97c0f754d03_3" [label="3: Return Stmt \n n$0=*&this:struct_forward_declare::Z* [line 30]\n n$1=*n$0.f:int [line 30]\n *&return:int=n$1 [line 30]\n " shape="box"] + "Z_ptr_div0#struct_forward_declare#_ZN22struct_forward_declare10Z_ptr_div0EPNS_1ZE.ae82532ef25a8098cdd32061d5136f50_3" -> "Z_ptr_div0#struct_forward_declare#_ZN22struct_forward_declare10Z_ptr_div0EPNS_1ZE.ae82532ef25a8098cdd32061d5136f50_2" ; +"Z_ptr_div0#struct_forward_declare#_ZN22struct_forward_declare10Z_ptr_div0EPNS_1ZE.ae82532ef25a8098cdd32061d5136f50_4" [label="4: BinaryOperatorStmt: Assign \n n$3=*&z:struct_forward_declare::Z* [line 67]\n *n$3.f:int=0 [line 67]\n " shape="box"] - "getF#Z#struct_forward_declare#(_ZN22struct_forward_declare1Z4getFEv).972609c8e19c27c5beb0f97c0f754d03_3" -> "getF#Z#struct_forward_declare#(_ZN22struct_forward_declare1Z4getFEv).972609c8e19c27c5beb0f97c0f754d03_2" ; -"Z#Z#struct_forward_declare#{_ZN22struct_forward_declare1ZC1Ev}.9060e5ac1040e8306d6f2997af8106e2_1" [label="1: Start struct_forward_declare::Z_Z\nFormals: this:struct_forward_declare::Z*\nLocals: \n DECLARE_LOCALS(&return); [line 28]\n " color=yellow style=filled] + "Z_ptr_div0#struct_forward_declare#_ZN22struct_forward_declare10Z_ptr_div0EPNS_1ZE.ae82532ef25a8098cdd32061d5136f50_4" -> "Z_ptr_div0#struct_forward_declare#_ZN22struct_forward_declare10Z_ptr_div0EPNS_1ZE.ae82532ef25a8098cdd32061d5136f50_3" ; +"fun_with_Z#struct_forward_declare#_ZN22struct_forward_declare10fun_with_ZEPNS_1ZE.fdd3616744230972b67d3807049d141e_1" [label="1: Start struct_forward_declare::fun_with_Z\nFormals: z1:struct_forward_declare::Z*\nLocals: z2:struct_forward_declare::Z* \n DECLARE_LOCALS(&return,&z2); [line 26]\n " color=yellow style=filled] - "Z#Z#struct_forward_declare#{_ZN22struct_forward_declare1ZC1Ev}.9060e5ac1040e8306d6f2997af8106e2_1" -> "Z#Z#struct_forward_declare#{_ZN22struct_forward_declare1ZC1Ev}.9060e5ac1040e8306d6f2997af8106e2_2" ; -"Z#Z#struct_forward_declare#{_ZN22struct_forward_declare1ZC1Ev}.9060e5ac1040e8306d6f2997af8106e2_2" [label="2: Exit struct_forward_declare::Z_Z \n " color=yellow style=filled] + "fun_with_Z#struct_forward_declare#_ZN22struct_forward_declare10fun_with_ZEPNS_1ZE.fdd3616744230972b67d3807049d141e_1" -> "fun_with_Z#struct_forward_declare#_ZN22struct_forward_declare10fun_with_ZEPNS_1ZE.fdd3616744230972b67d3807049d141e_3" ; +"fun_with_Z#struct_forward_declare#_ZN22struct_forward_declare10fun_with_ZEPNS_1ZE.fdd3616744230972b67d3807049d141e_2" [label="2: Exit struct_forward_declare::fun_with_Z \n " color=yellow style=filled] -"X_ptr_div0#struct_forward_declare#_ZN22struct_forward_declare10X_ptr_div0EPNS_1XE.1092a9e506b6aa3a84ea78a4be5595fa_1" [label="1: Start struct_forward_declare::X_ptr_div0\nFormals: x:struct_forward_declare::X*\nLocals: \n DECLARE_LOCALS(&return); [line 42]\n " color=yellow style=filled] +"fun_with_Z#struct_forward_declare#_ZN22struct_forward_declare10fun_with_ZEPNS_1ZE.fdd3616744230972b67d3807049d141e_3" [label="3: DeclStmt \n n$0=*&z1:struct_forward_declare::Z* [line 26]\n *&z2:struct_forward_declare::Z*=n$0 [line 26]\n " shape="box"] - "X_ptr_div0#struct_forward_declare#_ZN22struct_forward_declare10X_ptr_div0EPNS_1XE.1092a9e506b6aa3a84ea78a4be5595fa_1" -> "X_ptr_div0#struct_forward_declare#_ZN22struct_forward_declare10X_ptr_div0EPNS_1XE.1092a9e506b6aa3a84ea78a4be5595fa_4" ; -"X_ptr_div0#struct_forward_declare#_ZN22struct_forward_declare10X_ptr_div0EPNS_1XE.1092a9e506b6aa3a84ea78a4be5595fa_2" [label="2: Exit struct_forward_declare::X_ptr_div0 \n " color=yellow style=filled] + "fun_with_Z#struct_forward_declare#_ZN22struct_forward_declare10fun_with_ZEPNS_1ZE.fdd3616744230972b67d3807049d141e_3" -> "fun_with_Z#struct_forward_declare#_ZN22struct_forward_declare10fun_with_ZEPNS_1ZE.fdd3616744230972b67d3807049d141e_2" ; +"getF#X#struct_forward_declare#(_ZN22struct_forward_declare1X4getFEv).1e9b3699cbb3e16aa40f3c70fd848d39_1" [label="1: Start struct_forward_declare::X_getF\nFormals: this:struct_forward_declare::X*\nLocals: \n DECLARE_LOCALS(&return); [line 21]\n " color=yellow style=filled] -"X_ptr_div0#struct_forward_declare#_ZN22struct_forward_declare10X_ptr_div0EPNS_1XE.1092a9e506b6aa3a84ea78a4be5595fa_3" [label="3: Return Stmt \n n$0=*&x:struct_forward_declare::X* [line 44]\n _=*n$0:struct_forward_declare::X [line 44]\n n$2=_fun_struct_forward_declare::X_getF(n$0:struct_forward_declare::X*) [line 44]\n *&return:int=(1 / n$2) [line 44]\n " shape="box"] + "getF#X#struct_forward_declare#(_ZN22struct_forward_declare1X4getFEv).1e9b3699cbb3e16aa40f3c70fd848d39_1" -> "getF#X#struct_forward_declare#(_ZN22struct_forward_declare1X4getFEv).1e9b3699cbb3e16aa40f3c70fd848d39_3" ; +"getF#X#struct_forward_declare#(_ZN22struct_forward_declare1X4getFEv).1e9b3699cbb3e16aa40f3c70fd848d39_2" [label="2: Exit struct_forward_declare::X_getF \n " color=yellow style=filled] - "X_ptr_div0#struct_forward_declare#_ZN22struct_forward_declare10X_ptr_div0EPNS_1XE.1092a9e506b6aa3a84ea78a4be5595fa_3" -> "X_ptr_div0#struct_forward_declare#_ZN22struct_forward_declare10X_ptr_div0EPNS_1XE.1092a9e506b6aa3a84ea78a4be5595fa_2" ; -"X_ptr_div0#struct_forward_declare#_ZN22struct_forward_declare10X_ptr_div0EPNS_1XE.1092a9e506b6aa3a84ea78a4be5595fa_4" [label="4: BinaryOperatorStmt: Assign \n n$3=*&x:struct_forward_declare::X* [line 43]\n *n$3.f:int=0 [line 43]\n " shape="box"] +"getF#X#struct_forward_declare#(_ZN22struct_forward_declare1X4getFEv).1e9b3699cbb3e16aa40f3c70fd848d39_3" [label="3: Return Stmt \n n$0=*&this:struct_forward_declare::X* [line 21]\n n$1=*n$0.f:int [line 21]\n *&return:int=n$1 [line 21]\n " shape="box"] - "X_ptr_div0#struct_forward_declare#_ZN22struct_forward_declare10X_ptr_div0EPNS_1XE.1092a9e506b6aa3a84ea78a4be5595fa_4" -> "X_ptr_div0#struct_forward_declare#_ZN22struct_forward_declare10X_ptr_div0EPNS_1XE.1092a9e506b6aa3a84ea78a4be5595fa_3" ; -"Z_ptr_div0#struct_forward_declare#_ZN22struct_forward_declare10Z_ptr_div0EPNS_1ZE.ae82532ef25a8098cdd32061d5136f50_1" [label="1: Start struct_forward_declare::Z_ptr_div0\nFormals: z:struct_forward_declare::Z*\nLocals: \n DECLARE_LOCALS(&return); [line 63]\n " color=yellow style=filled] + "getF#X#struct_forward_declare#(_ZN22struct_forward_declare1X4getFEv).1e9b3699cbb3e16aa40f3c70fd848d39_3" -> "getF#X#struct_forward_declare#(_ZN22struct_forward_declare1X4getFEv).1e9b3699cbb3e16aa40f3c70fd848d39_2" ; +"X#X#struct_forward_declare#{_ZN22struct_forward_declare1XC1Ev}.1134af3db0d0d9b85dd903e2f9d96998_1" [label="1: Start struct_forward_declare::X_X\nFormals: this:struct_forward_declare::X*\nLocals: \n DECLARE_LOCALS(&return); [line 19]\n " color=yellow style=filled] - "Z_ptr_div0#struct_forward_declare#_ZN22struct_forward_declare10Z_ptr_div0EPNS_1ZE.ae82532ef25a8098cdd32061d5136f50_1" -> "Z_ptr_div0#struct_forward_declare#_ZN22struct_forward_declare10Z_ptr_div0EPNS_1ZE.ae82532ef25a8098cdd32061d5136f50_4" ; -"Z_ptr_div0#struct_forward_declare#_ZN22struct_forward_declare10Z_ptr_div0EPNS_1ZE.ae82532ef25a8098cdd32061d5136f50_2" [label="2: Exit struct_forward_declare::Z_ptr_div0 \n " color=yellow style=filled] + "X#X#struct_forward_declare#{_ZN22struct_forward_declare1XC1Ev}.1134af3db0d0d9b85dd903e2f9d96998_1" -> "X#X#struct_forward_declare#{_ZN22struct_forward_declare1XC1Ev}.1134af3db0d0d9b85dd903e2f9d96998_2" ; +"X#X#struct_forward_declare#{_ZN22struct_forward_declare1XC1Ev}.1134af3db0d0d9b85dd903e2f9d96998_2" [label="2: Exit struct_forward_declare::X_X \n " color=yellow style=filled] -"Z_ptr_div0#struct_forward_declare#_ZN22struct_forward_declare10Z_ptr_div0EPNS_1ZE.ae82532ef25a8098cdd32061d5136f50_3" [label="3: Return Stmt \n n$0=*&z:struct_forward_declare::Z* [line 68]\n _=*n$0:struct_forward_declare::Z [line 68]\n n$2=_fun_struct_forward_declare::Z_getF(n$0:struct_forward_declare::Z*) [line 68]\n *&return:int=(1 / n$2) [line 68]\n " shape="box"] +"getF#Z#struct_forward_declare#(_ZN22struct_forward_declare1Z4getFEv).972609c8e19c27c5beb0f97c0f754d03_1" [label="1: Start struct_forward_declare::Z_getF\nFormals: this:struct_forward_declare::Z*\nLocals: \n DECLARE_LOCALS(&return); [line 30]\n " color=yellow style=filled] - "Z_ptr_div0#struct_forward_declare#_ZN22struct_forward_declare10Z_ptr_div0EPNS_1ZE.ae82532ef25a8098cdd32061d5136f50_3" -> "Z_ptr_div0#struct_forward_declare#_ZN22struct_forward_declare10Z_ptr_div0EPNS_1ZE.ae82532ef25a8098cdd32061d5136f50_2" ; -"Z_ptr_div0#struct_forward_declare#_ZN22struct_forward_declare10Z_ptr_div0EPNS_1ZE.ae82532ef25a8098cdd32061d5136f50_4" [label="4: BinaryOperatorStmt: Assign \n n$3=*&z:struct_forward_declare::Z* [line 67]\n *n$3.f:int=0 [line 67]\n " shape="box"] + "getF#Z#struct_forward_declare#(_ZN22struct_forward_declare1Z4getFEv).972609c8e19c27c5beb0f97c0f754d03_1" -> "getF#Z#struct_forward_declare#(_ZN22struct_forward_declare1Z4getFEv).972609c8e19c27c5beb0f97c0f754d03_3" ; +"getF#Z#struct_forward_declare#(_ZN22struct_forward_declare1Z4getFEv).972609c8e19c27c5beb0f97c0f754d03_2" [label="2: Exit struct_forward_declare::Z_getF \n " color=yellow style=filled] - "Z_ptr_div0#struct_forward_declare#_ZN22struct_forward_declare10Z_ptr_div0EPNS_1ZE.ae82532ef25a8098cdd32061d5136f50_4" -> "Z_ptr_div0#struct_forward_declare#_ZN22struct_forward_declare10Z_ptr_div0EPNS_1ZE.ae82532ef25a8098cdd32061d5136f50_3" ; -"fun_with_Z#struct_forward_declare#_ZN22struct_forward_declare10fun_with_ZEPNS_1ZE.fdd3616744230972b67d3807049d141e_1" [label="1: Start struct_forward_declare::fun_with_Z\nFormals: z1:struct_forward_declare::Z*\nLocals: z2:struct_forward_declare::Z* \n DECLARE_LOCALS(&return,&z2); [line 26]\n " color=yellow style=filled] +"getF#Z#struct_forward_declare#(_ZN22struct_forward_declare1Z4getFEv).972609c8e19c27c5beb0f97c0f754d03_3" [label="3: Return Stmt \n n$0=*&this:struct_forward_declare::Z* [line 30]\n n$1=*n$0.f:int [line 30]\n *&return:int=n$1 [line 30]\n " shape="box"] - "fun_with_Z#struct_forward_declare#_ZN22struct_forward_declare10fun_with_ZEPNS_1ZE.fdd3616744230972b67d3807049d141e_1" -> "fun_with_Z#struct_forward_declare#_ZN22struct_forward_declare10fun_with_ZEPNS_1ZE.fdd3616744230972b67d3807049d141e_3" ; -"fun_with_Z#struct_forward_declare#_ZN22struct_forward_declare10fun_with_ZEPNS_1ZE.fdd3616744230972b67d3807049d141e_2" [label="2: Exit struct_forward_declare::fun_with_Z \n " color=yellow style=filled] + "getF#Z#struct_forward_declare#(_ZN22struct_forward_declare1Z4getFEv).972609c8e19c27c5beb0f97c0f754d03_3" -> "getF#Z#struct_forward_declare#(_ZN22struct_forward_declare1Z4getFEv).972609c8e19c27c5beb0f97c0f754d03_2" ; +"Z#Z#struct_forward_declare#{_ZN22struct_forward_declare1ZC1Ev}.9060e5ac1040e8306d6f2997af8106e2_1" [label="1: Start struct_forward_declare::Z_Z\nFormals: this:struct_forward_declare::Z*\nLocals: \n DECLARE_LOCALS(&return); [line 28]\n " color=yellow style=filled] -"fun_with_Z#struct_forward_declare#_ZN22struct_forward_declare10fun_with_ZEPNS_1ZE.fdd3616744230972b67d3807049d141e_3" [label="3: DeclStmt \n n$0=*&z1:struct_forward_declare::Z* [line 26]\n *&z2:struct_forward_declare::Z*=n$0 [line 26]\n " shape="box"] + "Z#Z#struct_forward_declare#{_ZN22struct_forward_declare1ZC1Ev}.9060e5ac1040e8306d6f2997af8106e2_1" -> "Z#Z#struct_forward_declare#{_ZN22struct_forward_declare1ZC1Ev}.9060e5ac1040e8306d6f2997af8106e2_2" ; +"Z#Z#struct_forward_declare#{_ZN22struct_forward_declare1ZC1Ev}.9060e5ac1040e8306d6f2997af8106e2_2" [label="2: Exit struct_forward_declare::Z_Z \n " color=yellow style=filled] - "fun_with_Z#struct_forward_declare#_ZN22struct_forward_declare10fun_with_ZEPNS_1ZE.fdd3616744230972b67d3807049d141e_3" -> "fun_with_Z#struct_forward_declare#_ZN22struct_forward_declare10fun_with_ZEPNS_1ZE.fdd3616744230972b67d3807049d141e_2" ; } diff --git a/infer/tests/codetoanalyze/cpp/shared/types/struct_pass_by_value.cpp.dot b/infer/tests/codetoanalyze/cpp/shared/types/struct_pass_by_value.cpp.dot index 06830a618..f352627fe 100644 --- a/infer/tests/codetoanalyze/cpp/shared/types/struct_pass_by_value.cpp.dot +++ b/infer/tests/codetoanalyze/cpp/shared/types/struct_pass_by_value.cpp.dot @@ -109,6 +109,28 @@ digraph iCFG { "param_get_copied_div1#struct_pass_by_value#_ZN20struct_pass_by_value21param_get_copied_div1Ev.a478d92732cbfd3143baded8caa93a88_5" -> "param_get_copied_div1#struct_pass_by_value#_ZN20struct_pass_by_value21param_get_copied_div1Ev.a478d92732cbfd3143baded8caa93a88_4" ; +"get_f#struct_pass_by_value#_ZN20struct_pass_by_value5get_fENS_1XE.d9eb5656addf74c4646b11cf2d3f3307_1" [label="1: Start struct_pass_by_value::get_f\nFormals: val:struct_pass_by_value::X&\nLocals: \n DECLARE_LOCALS(&return); [line 22]\n " color=yellow style=filled] + + + "get_f#struct_pass_by_value#_ZN20struct_pass_by_value5get_fENS_1XE.d9eb5656addf74c4646b11cf2d3f3307_1" -> "get_f#struct_pass_by_value#_ZN20struct_pass_by_value5get_fENS_1XE.d9eb5656addf74c4646b11cf2d3f3307_3" ; +"get_f#struct_pass_by_value#_ZN20struct_pass_by_value5get_fENS_1XE.d9eb5656addf74c4646b11cf2d3f3307_2" [label="2: Exit struct_pass_by_value::get_f \n " color=yellow style=filled] + + +"get_f#struct_pass_by_value#_ZN20struct_pass_by_value5get_fENS_1XE.d9eb5656addf74c4646b11cf2d3f3307_3" [label="3: Return Stmt \n n$0=*&val:struct_pass_by_value::X& [line 22]\n n$1=*n$0.f:int [line 22]\n *&return:int=n$1 [line 22]\n " shape="box"] + + + "get_f#struct_pass_by_value#_ZN20struct_pass_by_value5get_fENS_1XE.d9eb5656addf74c4646b11cf2d3f3307_3" -> "get_f#struct_pass_by_value#_ZN20struct_pass_by_value5get_fENS_1XE.d9eb5656addf74c4646b11cf2d3f3307_2" ; +"set_f#struct_pass_by_value#_ZN20struct_pass_by_value5set_fENS_1XEi.f10cea3478ded77d2dcefbe25a6546ca_1" [label="1: Start struct_pass_by_value::set_f\nFormals: val:struct_pass_by_value::X& f:int\nLocals: \n DECLARE_LOCALS(&return); [line 25]\n " color=yellow style=filled] + + + "set_f#struct_pass_by_value#_ZN20struct_pass_by_value5set_fENS_1XEi.f10cea3478ded77d2dcefbe25a6546ca_1" -> "set_f#struct_pass_by_value#_ZN20struct_pass_by_value5set_fENS_1XEi.f10cea3478ded77d2dcefbe25a6546ca_3" ; +"set_f#struct_pass_by_value#_ZN20struct_pass_by_value5set_fENS_1XEi.f10cea3478ded77d2dcefbe25a6546ca_2" [label="2: Exit struct_pass_by_value::set_f \n " color=yellow style=filled] + + +"set_f#struct_pass_by_value#_ZN20struct_pass_by_value5set_fENS_1XEi.f10cea3478ded77d2dcefbe25a6546ca_3" [label="3: BinaryOperatorStmt: Assign \n n$0=*&val:struct_pass_by_value::X& [line 25]\n n$1=*&f:int [line 25]\n *n$0.f:int=n$1 [line 25]\n " shape="box"] + + + "set_f#struct_pass_by_value#_ZN20struct_pass_by_value5set_fENS_1XEi.f10cea3478ded77d2dcefbe25a6546ca_3" -> "set_f#struct_pass_by_value#_ZN20struct_pass_by_value5set_fENS_1XEi.f10cea3478ded77d2dcefbe25a6546ca_2" ; "X#X#struct_pass_by_value#{_ZN20struct_pass_by_value1XC1EOS0_|constexpr}.38a71213b4829bbfe72ae0107ed450f0_1" [label="1: Start struct_pass_by_value::X_X\nFormals: this:struct_pass_by_value::X* __param_0:struct_pass_by_value::X&\nLocals: \n DECLARE_LOCALS(&return); [line 12]\n " color=yellow style=filled] @@ -153,26 +175,4 @@ digraph iCFG { "Y#Y#struct_pass_by_value#{_ZN20struct_pass_by_value1YC1ERKNS_1XE}.8a81f6f538ade21c1d4ebc1a51bad9e6_3" -> "Y#Y#struct_pass_by_value#{_ZN20struct_pass_by_value1YC1ERKNS_1XE}.8a81f6f538ade21c1d4ebc1a51bad9e6_2" ; -"get_f#struct_pass_by_value#_ZN20struct_pass_by_value5get_fENS_1XE.d9eb5656addf74c4646b11cf2d3f3307_1" [label="1: Start struct_pass_by_value::get_f\nFormals: val:struct_pass_by_value::X&\nLocals: \n DECLARE_LOCALS(&return); [line 22]\n " color=yellow style=filled] - - - "get_f#struct_pass_by_value#_ZN20struct_pass_by_value5get_fENS_1XE.d9eb5656addf74c4646b11cf2d3f3307_1" -> "get_f#struct_pass_by_value#_ZN20struct_pass_by_value5get_fENS_1XE.d9eb5656addf74c4646b11cf2d3f3307_3" ; -"get_f#struct_pass_by_value#_ZN20struct_pass_by_value5get_fENS_1XE.d9eb5656addf74c4646b11cf2d3f3307_2" [label="2: Exit struct_pass_by_value::get_f \n " color=yellow style=filled] - - -"get_f#struct_pass_by_value#_ZN20struct_pass_by_value5get_fENS_1XE.d9eb5656addf74c4646b11cf2d3f3307_3" [label="3: Return Stmt \n n$0=*&val:struct_pass_by_value::X& [line 22]\n n$1=*n$0.f:int [line 22]\n *&return:int=n$1 [line 22]\n " shape="box"] - - - "get_f#struct_pass_by_value#_ZN20struct_pass_by_value5get_fENS_1XE.d9eb5656addf74c4646b11cf2d3f3307_3" -> "get_f#struct_pass_by_value#_ZN20struct_pass_by_value5get_fENS_1XE.d9eb5656addf74c4646b11cf2d3f3307_2" ; -"set_f#struct_pass_by_value#_ZN20struct_pass_by_value5set_fENS_1XEi.f10cea3478ded77d2dcefbe25a6546ca_1" [label="1: Start struct_pass_by_value::set_f\nFormals: val:struct_pass_by_value::X& f:int\nLocals: \n DECLARE_LOCALS(&return); [line 25]\n " color=yellow style=filled] - - - "set_f#struct_pass_by_value#_ZN20struct_pass_by_value5set_fENS_1XEi.f10cea3478ded77d2dcefbe25a6546ca_1" -> "set_f#struct_pass_by_value#_ZN20struct_pass_by_value5set_fENS_1XEi.f10cea3478ded77d2dcefbe25a6546ca_3" ; -"set_f#struct_pass_by_value#_ZN20struct_pass_by_value5set_fENS_1XEi.f10cea3478ded77d2dcefbe25a6546ca_2" [label="2: Exit struct_pass_by_value::set_f \n " color=yellow style=filled] - - -"set_f#struct_pass_by_value#_ZN20struct_pass_by_value5set_fENS_1XEi.f10cea3478ded77d2dcefbe25a6546ca_3" [label="3: BinaryOperatorStmt: Assign \n n$0=*&val:struct_pass_by_value::X& [line 25]\n n$1=*&f:int [line 25]\n *n$0.f:int=n$1 [line 25]\n " shape="box"] - - - "set_f#struct_pass_by_value#_ZN20struct_pass_by_value5set_fENS_1XEi.f10cea3478ded77d2dcefbe25a6546ca_3" -> "set_f#struct_pass_by_value#_ZN20struct_pass_by_value5set_fENS_1XEi.f10cea3478ded77d2dcefbe25a6546ca_2" ; } diff --git a/infer/tests/codetoanalyze/cpp/shared/types/typeid_expr.cpp.dot b/infer/tests/codetoanalyze/cpp/shared/types/typeid_expr.cpp.dot index 5aea38127..fc98bbc1c 100644 --- a/infer/tests/codetoanalyze/cpp/shared/types/typeid_expr.cpp.dot +++ b/infer/tests/codetoanalyze/cpp/shared/types/typeid_expr.cpp.dot @@ -319,6 +319,21 @@ digraph iCFG { "person_ptr_typeid#_Z17person_ptr_typeidP6Person.d9adfc6b86c71441019a0fdc03c35fa6_10" -> "person_ptr_typeid#_Z17person_ptr_typeidP6Person.d9adfc6b86c71441019a0fdc03c35fa6_5" ; +"template_typeid#_Z15template_typeidI6PersonEPKcRKT_.a1cb4d870e3df2f09bf7a22e0fc6e5c6_1" [label="1: Start template_typeid\nFormals: value:Person const &\nLocals: result:Person 0$?%__sil_tmpSIL_materialize_temp__n$3:Person \n DECLARE_LOCALS(&return,&result,&0$?%__sil_tmpSIL_materialize_temp__n$3); [line 57]\n " color=yellow style=filled] + + + "template_typeid#_Z15template_typeidI6PersonEPKcRKT_.a1cb4d870e3df2f09bf7a22e0fc6e5c6_1" -> "template_typeid#_Z15template_typeidI6PersonEPKcRKT_.a1cb4d870e3df2f09bf7a22e0fc6e5c6_4" ; +"template_typeid#_Z15template_typeidI6PersonEPKcRKT_.a1cb4d870e3df2f09bf7a22e0fc6e5c6_2" [label="2: Exit template_typeid \n " color=yellow style=filled] + + +"template_typeid#_Z15template_typeidI6PersonEPKcRKT_.a1cb4d870e3df2f09bf7a22e0fc6e5c6_3" [label="3: Return Stmt \n n$0=_fun___cxx_typeid(sizeof(std::type_info const ):void,n$0.__type_name:void) [line 59]\n _=*n$0:std::type_info const [line 59]\n n$2=_fun_std::type_info_name(n$0:std::type_info const &) [line 59]\n *&return:char const *=n$2 [line 59]\n " shape="box"] + + + "template_typeid#_Z15template_typeidI6PersonEPKcRKT_.a1cb4d870e3df2f09bf7a22e0fc6e5c6_3" -> "template_typeid#_Z15template_typeidI6PersonEPKcRKT_.a1cb4d870e3df2f09bf7a22e0fc6e5c6_2" ; +"template_typeid#_Z15template_typeidI6PersonEPKcRKT_.a1cb4d870e3df2f09bf7a22e0fc6e5c6_4" [label="4: DeclStmt \n n$4=*&value:Person const & [line 58]\n _fun_Person_Person(&0$?%__sil_tmpSIL_materialize_temp__n$3:Person const *,n$4:Person const &) [line 58]\n _fun_Person_Person(&result:Person*,&0$?%__sil_tmpSIL_materialize_temp__n$3:Person&) [line 58]\n " shape="box"] + + + "template_typeid#_Z15template_typeidI6PersonEPKcRKT_.a1cb4d870e3df2f09bf7a22e0fc6e5c6_4" -> "template_typeid#_Z15template_typeidI6PersonEPKcRKT_.a1cb4d870e3df2f09bf7a22e0fc6e5c6_3" ; "Employee#Employee#{_ZN8EmployeeC1Ev|constexpr}.16759caee496fa04cbb5c95e71252949_1" [label="1: Start Employee_Employee\nFormals: this:Employee*\nLocals: \n DECLARE_LOCALS(&return); [line 17]\n " color=yellow style=filled] @@ -510,19 +525,4 @@ digraph iCFG { "type_info#type_info#std#{_ZNSt9type_infoC1EPKc}.95293c2b692be68318d378f77a5be8af_2" [label="2: Exit std::type_info_type_info \n " color=yellow style=filled] -"template_typeid#_Z15template_typeidI6PersonEPKcRKT_.a1cb4d870e3df2f09bf7a22e0fc6e5c6_1" [label="1: Start template_typeid\nFormals: value:Person const &\nLocals: result:Person 0$?%__sil_tmpSIL_materialize_temp__n$3:Person \n DECLARE_LOCALS(&return,&result,&0$?%__sil_tmpSIL_materialize_temp__n$3); [line 57]\n " color=yellow style=filled] - - - "template_typeid#_Z15template_typeidI6PersonEPKcRKT_.a1cb4d870e3df2f09bf7a22e0fc6e5c6_1" -> "template_typeid#_Z15template_typeidI6PersonEPKcRKT_.a1cb4d870e3df2f09bf7a22e0fc6e5c6_4" ; -"template_typeid#_Z15template_typeidI6PersonEPKcRKT_.a1cb4d870e3df2f09bf7a22e0fc6e5c6_2" [label="2: Exit template_typeid \n " color=yellow style=filled] - - -"template_typeid#_Z15template_typeidI6PersonEPKcRKT_.a1cb4d870e3df2f09bf7a22e0fc6e5c6_3" [label="3: Return Stmt \n n$0=_fun___cxx_typeid(sizeof(std::type_info const ):void,n$0.__type_name:void) [line 59]\n _=*n$0:std::type_info const [line 59]\n n$2=_fun_std::type_info_name(n$0:std::type_info const &) [line 59]\n *&return:char const *=n$2 [line 59]\n " shape="box"] - - - "template_typeid#_Z15template_typeidI6PersonEPKcRKT_.a1cb4d870e3df2f09bf7a22e0fc6e5c6_3" -> "template_typeid#_Z15template_typeidI6PersonEPKcRKT_.a1cb4d870e3df2f09bf7a22e0fc6e5c6_2" ; -"template_typeid#_Z15template_typeidI6PersonEPKcRKT_.a1cb4d870e3df2f09bf7a22e0fc6e5c6_4" [label="4: DeclStmt \n n$4=*&value:Person const & [line 58]\n _fun_Person_Person(&0$?%__sil_tmpSIL_materialize_temp__n$3:Person const *,n$4:Person const &) [line 58]\n _fun_Person_Person(&result:Person*,&0$?%__sil_tmpSIL_materialize_temp__n$3:Person&) [line 58]\n " shape="box"] - - - "template_typeid#_Z15template_typeidI6PersonEPKcRKT_.a1cb4d870e3df2f09bf7a22e0fc6e5c6_4" -> "template_typeid#_Z15template_typeidI6PersonEPKcRKT_.a1cb4d870e3df2f09bf7a22e0fc6e5c6_3" ; }