diff --git a/infer/src/IR/ProcAttributes.re b/infer/src/IR/ProcAttributes.re index eb5c3166f..f75e835af 100644 --- a/infer/src/IR/ProcAttributes.re +++ b/infer/src/IR/ProcAttributes.re @@ -57,6 +57,7 @@ type t = { is_defined: bool, /** true if the procedure is defined, and not just declared */ is_objc_instance_method: bool, /** the procedure is an objective-C instance method */ is_cpp_instance_method: bool, /** the procedure is an C++ instance method */ + is_cpp_noexcept_method: bool, /** the procedure is an C++ method annotated with "noexcept" */ is_java_synchronized_method: bool, /** the procedure is a Java synchronized method */ is_model: bool, /** the procedure is a model */ is_synthetic_method: bool, /** the procedure is a synthetic method */ @@ -86,6 +87,7 @@ let default proc_name language => { is_abstract: false, is_bridge_method: false, is_cpp_instance_method: false, + is_cpp_noexcept_method: false, is_java_synchronized_method: false, is_defined: false, is_objc_instance_method: false, diff --git a/infer/src/IR/ProcAttributes.rei b/infer/src/IR/ProcAttributes.rei index 95c5f89b7..601eecec6 100644 --- a/infer/src/IR/ProcAttributes.rei +++ b/infer/src/IR/ProcAttributes.rei @@ -52,6 +52,7 @@ type t = { is_defined: bool, /** true if the procedure is defined, and not just declared */ is_objc_instance_method: bool, /** the procedure is an objective-C instance method */ is_cpp_instance_method: bool, /** the procedure is an C++ instance method */ + is_cpp_noexcept_method: bool, /** the procedure is an C++ method annotated with "noexcept" */ is_java_synchronized_method: bool, /** the procedure is a Java synchronized method */ is_model: bool, /** the procedure is a model */ is_synthetic_method: bool, /** the procedure is a synthetic method */ diff --git a/infer/src/clang/cMethod_signature.ml b/infer/src/clang/cMethod_signature.ml index e5ef1c20f..be606e672 100644 --- a/infer/src/clang/cMethod_signature.ml +++ b/infer/src/clang/cMethod_signature.ml @@ -20,6 +20,7 @@ type method_signature = { loc : Clang_ast_t.source_range; is_instance : bool; is_cpp_virtual : bool; + is_cpp_nothrow : bool; language : CFrontend_config.clang_lang; pointer_to_parent : Clang_ast_t.pointer option; pointer_to_property_opt : Clang_ast_t.pointer option; (* If set then method is a getter/setter *) @@ -50,6 +51,9 @@ let ms_is_instance { is_instance } = let ms_is_cpp_virtual { is_cpp_virtual } = is_cpp_virtual +let ms_is_cpp_nothrow { is_cpp_nothrow } = + is_cpp_nothrow + let ms_get_lang { language } = language @@ -74,11 +78,13 @@ let ms_is_setter { pointer_to_property_opt; args } = Option.is_some pointer_to_property_opt && Int.equal (List.length args) 2 -let make_ms name args ret_type attributes loc is_instance ?is_cpp_virtual language pointer_to_parent - pointer_to_property_opt return_param_typ = - let is_cpp_virtual = match is_cpp_virtual with - | Some is_cpp_virtual -> is_cpp_virtual +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 = + let booloption_to_bool = function + | Some b -> b | None -> false in + let is_cpp_virtual = booloption_to_bool is_cpp_virtual in + let is_cpp_nothrow = booloption_to_bool is_cpp_nothrow in { name; args; @@ -87,6 +93,7 @@ let make_ms name args ret_type attributes loc is_instance ?is_cpp_virtual langua loc; is_instance; is_cpp_virtual; + is_cpp_nothrow; language; pointer_to_parent; pointer_to_property_opt; diff --git a/infer/src/clang/cMethod_signature.mli b/infer/src/clang/cMethod_signature.mli index 01631bd8b..d3e2c7cf7 100644 --- a/infer/src/clang/cMethod_signature.mli +++ b/infer/src/clang/cMethod_signature.mli @@ -31,6 +31,8 @@ val ms_is_instance : method_signature -> bool val ms_is_cpp_virtual : method_signature -> bool +val ms_is_cpp_nothrow : method_signature -> bool + val ms_get_lang : method_signature -> CFrontend_config.clang_lang val ms_get_pointer_to_parent : method_signature -> Clang_ast_t.pointer option @@ -44,7 +46,8 @@ val ms_is_getter : method_signature -> bool val ms_is_setter : method_signature -> bool val make_ms : Typ.Procname.t -> (Mangled.t * Clang_ast_t.qual_type) list -> Clang_ast_t.qual_type - -> Clang_ast_t.attribute list -> Clang_ast_t.source_range -> bool -> ?is_cpp_virtual:bool + -> 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 diff --git a/infer/src/clang/cMethod_trans.ml b/infer/src/clang/cMethod_trans.ml index b0eb10132..11eba6172 100644 --- a/infer/src/clang/cMethod_trans.ml +++ b/infer/src/clang/cMethod_trans.ml @@ -101,6 +101,13 @@ let is_cpp_virtual function_method_decl_info = | Cpp_Meth_decl_info (_, mdi, _, _) -> mdi.Clang_ast_t.xmdi_is_virtual | _ -> false +let is_cpp_nothrow function_method_decl_info = + match function_method_decl_info with + | Func_decl_info (fdi, _) + | Cpp_Meth_decl_info (fdi, _, _, _) -> + fdi.Clang_ast_t.fdi_is_no_throw + | _ -> false + (** Returns parameters of a function/method. They will have following order: 1. self/this parameter (optional, only for methods) 2. normal parameters @@ -139,9 +146,10 @@ let build_method_signature trans_unit_ctx tenv decl_info procname function_metho let attributes = decl_info.Clang_ast_t.di_attributes in 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 CMethod_signature.make_ms - procname parameters tp attributes source_range is_instance_method ~is_cpp_virtual:is_cpp_virtual - lang parent_pointer pointer_to_property_opt return_param_type_opt + 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 let get_init_list_instrs method_decl_info = let create_custom_instr construct_instr = `CXXConstructorInit construct_instr in @@ -386,6 +394,7 @@ let create_local_procdesc ?(set_objc_accessor_attr=false) trans_unit_ctx cfg ten let is_cpp_inst_method = 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 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 @@ -413,6 +422,7 @@ let create_local_procdesc ?(set_objc_accessor_attr=false) trans_unit_ctx cfg ten is_defined = defined; is_objc_instance_method = is_objc_inst_method; is_cpp_instance_method = is_cpp_inst_method; + is_cpp_noexcept_method = is_cpp_nothrow; is_model = Config.models_mode; loc = loc_start; objc_accessor = objc_property_accessor; diff --git a/infer/tests/codetoanalyze/cpp/frontend/include_header/include_templ.cpp.dot b/infer/tests/codetoanalyze/cpp/frontend/include_header/include_templ.cpp.dot index 69c6a42f4..bf206f004 100644 --- a/infer/tests/codetoanalyze/cpp/frontend/include_header/include_templ.cpp.dot +++ b/infer/tests/codetoanalyze/cpp/frontend/include_header/include_templ.cpp.dot @@ -96,13 +96,6 @@ digraph iCFG { "div0#A#(_ZN1A4div0Ev).1a6f91584aabeebe049737afeb476378_3" -> "div0#A#(_ZN1A4div0Ev).1a6f91584aabeebe049737afeb476378_2" ; -"B#B#{_ZN1BIiEC1Ev|constexpr}.0a6e40da0e7d400cfcd0dfa1df7ad995_1" [label="1: Start B_B\nFormals: this:B*\nLocals: \n DECLARE_LOCALS(&return); [line 15]\n " color=yellow style=filled] - - - "B#B#{_ZN1BIiEC1Ev|constexpr}.0a6e40da0e7d400cfcd0dfa1df7ad995_1" -> "B#B#{_ZN1BIiEC1Ev|constexpr}.0a6e40da0e7d400cfcd0dfa1df7ad995_2" ; -"B#B#{_ZN1BIiEC1Ev|constexpr}.0a6e40da0e7d400cfcd0dfa1df7ad995_2" [label="2: Exit B_B \n " color=yellow style=filled] - - "div0#B#(_ZN1BIiE4div0Ev).7928d23b80a07771917a21f2f65199b6_1" [label="1: Start B_div0\nFormals: this:B*\nLocals: \n DECLARE_LOCALS(&return); [line 16]\n " color=yellow style=filled] @@ -114,11 +107,11 @@ digraph iCFG { "div0#B#(_ZN1BIiE4div0Ev).7928d23b80a07771917a21f2f65199b6_3" -> "div0#B#(_ZN1BIiE4div0Ev).7928d23b80a07771917a21f2f65199b6_2" ; -"B#B#{_ZN1BI1AEC1Ev|constexpr}.37a0dc804dbb70abe9c0cba5d0d4b75d_1" [label="1: Start B_B\nFormals: this:B*\nLocals: \n DECLARE_LOCALS(&return); [line 15]\n " color=yellow style=filled] +"B#B#{_ZN1BIiEC1Ev|constexpr}.0a6e40da0e7d400cfcd0dfa1df7ad995_1" [label="1: Start B_B\nFormals: this:B*\nLocals: \n DECLARE_LOCALS(&return); [line 15]\n " color=yellow style=filled] - "B#B#{_ZN1BI1AEC1Ev|constexpr}.37a0dc804dbb70abe9c0cba5d0d4b75d_1" -> "B#B#{_ZN1BI1AEC1Ev|constexpr}.37a0dc804dbb70abe9c0cba5d0d4b75d_2" ; -"B#B#{_ZN1BI1AEC1Ev|constexpr}.37a0dc804dbb70abe9c0cba5d0d4b75d_2" [label="2: Exit B_B \n " color=yellow style=filled] + "B#B#{_ZN1BIiEC1Ev|constexpr}.0a6e40da0e7d400cfcd0dfa1df7ad995_1" -> "B#B#{_ZN1BIiEC1Ev|constexpr}.0a6e40da0e7d400cfcd0dfa1df7ad995_2" ; +"B#B#{_ZN1BIiEC1Ev|constexpr}.0a6e40da0e7d400cfcd0dfa1df7ad995_2" [label="2: Exit B_B \n " color=yellow style=filled] "div0#B#(_ZN1BI1AE4div0Ev).95154c4eecaa5aa2388f6884c1f2eb1f_1" [label="1: Start B_div0\nFormals: this:B*\nLocals: \n DECLARE_LOCALS(&return); [line 16]\n " color=yellow style=filled] @@ -132,4 +125,11 @@ digraph iCFG { "div0#B#(_ZN1BI1AE4div0Ev).95154c4eecaa5aa2388f6884c1f2eb1f_3" -> "div0#B#(_ZN1BI1AE4div0Ev).95154c4eecaa5aa2388f6884c1f2eb1f_2" ; +"B#B#{_ZN1BI1AEC1Ev|constexpr}.37a0dc804dbb70abe9c0cba5d0d4b75d_1" [label="1: Start B_B\nFormals: this:B*\nLocals: \n DECLARE_LOCALS(&return); [line 15]\n " color=yellow style=filled] + + + "B#B#{_ZN1BI1AEC1Ev|constexpr}.37a0dc804dbb70abe9c0cba5d0d4b75d_1" -> "B#B#{_ZN1BI1AEC1Ev|constexpr}.37a0dc804dbb70abe9c0cba5d0d4b75d_2" ; +"B#B#{_ZN1BI1AEC1Ev|constexpr}.37a0dc804dbb70abe9c0cba5d0d4b75d_2" [label="2: Exit B_B \n " color=yellow style=filled] + + } diff --git a/infer/tests/codetoanalyze/cpp/frontend/loops/foreach1.cpp.dot b/infer/tests/codetoanalyze/cpp/frontend/loops/foreach1.cpp.dot index 6b3dc8bcc..eaf6eb711 100644 --- a/infer/tests/codetoanalyze/cpp/frontend/loops/foreach1.cpp.dot +++ b/infer/tests/codetoanalyze/cpp/frontend/loops/foreach1.cpp.dot @@ -63,13 +63,6 @@ digraph iCFG { "operator!=#_Zne8iteratorS_.497d6549b2907c91697671b3c62dc141_3" -> "operator!=#_Zne8iteratorS_.497d6549b2907c91697671b3c62dc141_2" ; -"iterator#iterator#{_ZN8iteratorC1Ev}.08cc564498e71f410a910c6598ac515d_1" [label="1: Start iterator_iterator\nFormals: this:iterator*\nLocals: \n DECLARE_LOCALS(&return); [line 11]\n " color=yellow style=filled] - - - "iterator#iterator#{_ZN8iteratorC1Ev}.08cc564498e71f410a910c6598ac515d_1" -> "iterator#iterator#{_ZN8iteratorC1Ev}.08cc564498e71f410a910c6598ac515d_2" ; -"iterator#iterator#{_ZN8iteratorC1Ev}.08cc564498e71f410a910c6598ac515d_2" [label="2: Exit iterator_iterator \n " color=yellow style=filled] - - "operator*#iterator#(_ZN8iteratordeEv).d1b3c4615152af7edafb600f858babe9_1" [label="1: Start iterator_operator*\nFormals: this:iterator*\nLocals: \n DECLARE_LOCALS(&return); [line 17]\n " color=yellow style=filled] @@ -81,6 +74,13 @@ digraph iCFG { "operator*#iterator#(_ZN8iteratordeEv).d1b3c4615152af7edafb600f858babe9_3" -> "operator*#iterator#(_ZN8iteratordeEv).d1b3c4615152af7edafb600f858babe9_2" ; +"iterator#iterator#{_ZN8iteratorC1Ev}.08cc564498e71f410a910c6598ac515d_1" [label="1: Start iterator_iterator\nFormals: this:iterator*\nLocals: \n DECLARE_LOCALS(&return); [line 11]\n " color=yellow style=filled] + + + "iterator#iterator#{_ZN8iteratorC1Ev}.08cc564498e71f410a910c6598ac515d_1" -> "iterator#iterator#{_ZN8iteratorC1Ev}.08cc564498e71f410a910c6598ac515d_2" ; +"iterator#iterator#{_ZN8iteratorC1Ev}.08cc564498e71f410a910c6598ac515d_2" [label="2: Exit iterator_iterator \n " color=yellow style=filled] + + "iterator#iterator#{_ZN8iteratorC1EOS_|constexpr}.a5e77b29aa9873bc624723bf9c8a9a81_1" [label="1: Start iterator_iterator\nFormals: this:iterator* __param_0:iterator&\nLocals: \n DECLARE_LOCALS(&return); [line 11]\n " color=yellow style=filled] diff --git a/infer/tests/codetoanalyze/cpp/shared/conditional/binary_conditional.cpp.dot b/infer/tests/codetoanalyze/cpp/shared/conditional/binary_conditional.cpp.dot index 1130de4d3..cbf9a914a 100644 --- a/infer/tests/codetoanalyze/cpp/shared/conditional/binary_conditional.cpp.dot +++ b/infer/tests/codetoanalyze/cpp/shared/conditional/binary_conditional.cpp.dot @@ -99,13 +99,6 @@ digraph iCFG { "getX#binary_conditional#_ZN18binary_conditional4getXEv.609193a86220282821291564eccccf29_4" -> "getX#binary_conditional#_ZN18binary_conditional4getXEv.609193a86220282821291564eccccf29_3" ; -"X#X#binary_conditional#{_ZN18binary_conditional1XC1Ev|constexpr}.36ba3ab6d91729731dc0e6b7167cac4b_1" [label="1: Start binary_conditional::X_X\nFormals: this:binary_conditional::X*\nLocals: \n DECLARE_LOCALS(&return); [line 12]\n " color=yellow style=filled] - - - "X#X#binary_conditional#{_ZN18binary_conditional1XC1Ev|constexpr}.36ba3ab6d91729731dc0e6b7167cac4b_1" -> "X#X#binary_conditional#{_ZN18binary_conditional1XC1Ev|constexpr}.36ba3ab6d91729731dc0e6b7167cac4b_2" ; -"X#X#binary_conditional#{_ZN18binary_conditional1XC1Ev|constexpr}.36ba3ab6d91729731dc0e6b7167cac4b_2" [label="2: Exit binary_conditional::X_X \n " color=yellow style=filled] - - "operator_bool#X#binary_conditional#(_ZN18binary_conditional1XcvbEv).f2edd03e5de9a5ca93d46298f568a63e_1" [label="1: Start binary_conditional::X_operator_bool\nFormals: this:binary_conditional::X*\nLocals: \n DECLARE_LOCALS(&return); [line 13]\n " color=yellow style=filled] @@ -117,6 +110,13 @@ digraph iCFG { "operator_bool#X#binary_conditional#(_ZN18binary_conditional1XcvbEv).f2edd03e5de9a5ca93d46298f568a63e_3" -> "operator_bool#X#binary_conditional#(_ZN18binary_conditional1XcvbEv).f2edd03e5de9a5ca93d46298f568a63e_2" ; +"X#X#binary_conditional#{_ZN18binary_conditional1XC1Ev|constexpr}.36ba3ab6d91729731dc0e6b7167cac4b_1" [label="1: Start binary_conditional::X_X\nFormals: this:binary_conditional::X*\nLocals: \n DECLARE_LOCALS(&return); [line 12]\n " color=yellow style=filled] + + + "X#X#binary_conditional#{_ZN18binary_conditional1XC1Ev|constexpr}.36ba3ab6d91729731dc0e6b7167cac4b_1" -> "X#X#binary_conditional#{_ZN18binary_conditional1XC1Ev|constexpr}.36ba3ab6d91729731dc0e6b7167cac4b_2" ; +"X#X#binary_conditional#{_ZN18binary_conditional1XC1Ev|constexpr}.36ba3ab6d91729731dc0e6b7167cac4b_2" [label="2: Exit binary_conditional::X_X \n " color=yellow style=filled] + + "X#X#binary_conditional#{_ZN18binary_conditional1XC1EOS0_|constexpr}.84d2bfbde693ae615a2d6db40378f4f1_1" [label="1: Start binary_conditional::X_X\nFormals: this:binary_conditional::X* __param_0:binary_conditional::X&\nLocals: \n DECLARE_LOCALS(&return); [line 12]\n " color=yellow style=filled] diff --git a/infer/tests/codetoanalyze/cpp/shared/constructors/copy_move_constructor.cpp.dot b/infer/tests/codetoanalyze/cpp/shared/constructors/copy_move_constructor.cpp.dot index 71e37cb3c..126c76d38 100644 --- a/infer/tests/codetoanalyze/cpp/shared/constructors/copy_move_constructor.cpp.dot +++ b/infer/tests/codetoanalyze/cpp/shared/constructors/copy_move_constructor.cpp.dot @@ -223,26 +223,26 @@ digraph iCFG { "Y#Y#copy_move_constructor#{_ZN21copy_move_constructor1YC1Ev}.8be5abaa7d7da1093f6291e76e59a084_2" [label="2: Exit copy_move_constructor::Y_Y \n " color=yellow style=filled] -"Y#Y#copy_move_constructor#{_ZN21copy_move_constructor1YC1ERKS0_|constexpr}.d541eaa9937cb2d89f3cb0e1be5e2194_1" [label="1: Start copy_move_constructor::Y_Y\nFormals: this:copy_move_constructor::Y* y:copy_move_constructor::Y const &\nLocals: \n DECLARE_LOCALS(&return); [line 24]\n " color=yellow style=filled] +"Y#Y#copy_move_constructor#{_ZN21copy_move_constructor1YC1EOKS0_}.ab545119d4cf8c94dafcfc9624ee52bc_1" [label="1: Start copy_move_constructor::Y_Y\nFormals: this:copy_move_constructor::Y* y:copy_move_constructor::Y const &\nLocals: \n DECLARE_LOCALS(&return); [line 26]\n " color=yellow style=filled] - "Y#Y#copy_move_constructor#{_ZN21copy_move_constructor1YC1ERKS0_|constexpr}.d541eaa9937cb2d89f3cb0e1be5e2194_1" -> "Y#Y#copy_move_constructor#{_ZN21copy_move_constructor1YC1ERKS0_|constexpr}.d541eaa9937cb2d89f3cb0e1be5e2194_3" ; -"Y#Y#copy_move_constructor#{_ZN21copy_move_constructor1YC1ERKS0_|constexpr}.d541eaa9937cb2d89f3cb0e1be5e2194_2" [label="2: Exit copy_move_constructor::Y_Y \n " color=yellow style=filled] + "Y#Y#copy_move_constructor#{_ZN21copy_move_constructor1YC1EOKS0_}.ab545119d4cf8c94dafcfc9624ee52bc_1" -> "Y#Y#copy_move_constructor#{_ZN21copy_move_constructor1YC1EOKS0_}.ab545119d4cf8c94dafcfc9624ee52bc_3" ; +"Y#Y#copy_move_constructor#{_ZN21copy_move_constructor1YC1EOKS0_}.ab545119d4cf8c94dafcfc9624ee52bc_2" [label="2: Exit copy_move_constructor::Y_Y \n " color=yellow style=filled] -"Y#Y#copy_move_constructor#{_ZN21copy_move_constructor1YC1ERKS0_|constexpr}.d541eaa9937cb2d89f3cb0e1be5e2194_3" [label="3: Constructor Init \n n$0=*&this:copy_move_constructor::Y* [line 24]\n n$1=*&y:copy_move_constructor::Y const & [line 24]\n n$2=*n$1.f:int [line 24]\n *n$0.f:int=n$2 [line 24]\n " shape="box"] +"Y#Y#copy_move_constructor#{_ZN21copy_move_constructor1YC1EOKS0_}.ab545119d4cf8c94dafcfc9624ee52bc_3" [label="3: Constructor Init \n n$0=*&this:copy_move_constructor::Y* [line 26]\n n$1=*&y:copy_move_constructor::Y const & [line 26]\n n$2=*n$1.f:int [line 26]\n *n$0.f:int=(n$2 - 1) [line 26]\n " shape="box"] - "Y#Y#copy_move_constructor#{_ZN21copy_move_constructor1YC1ERKS0_|constexpr}.d541eaa9937cb2d89f3cb0e1be5e2194_3" -> "Y#Y#copy_move_constructor#{_ZN21copy_move_constructor1YC1ERKS0_|constexpr}.d541eaa9937cb2d89f3cb0e1be5e2194_2" ; -"Y#Y#copy_move_constructor#{_ZN21copy_move_constructor1YC1EOKS0_}.ab545119d4cf8c94dafcfc9624ee52bc_1" [label="1: Start copy_move_constructor::Y_Y\nFormals: this:copy_move_constructor::Y* y:copy_move_constructor::Y const &\nLocals: \n DECLARE_LOCALS(&return); [line 26]\n " color=yellow style=filled] + "Y#Y#copy_move_constructor#{_ZN21copy_move_constructor1YC1EOKS0_}.ab545119d4cf8c94dafcfc9624ee52bc_3" -> "Y#Y#copy_move_constructor#{_ZN21copy_move_constructor1YC1EOKS0_}.ab545119d4cf8c94dafcfc9624ee52bc_2" ; +"Y#Y#copy_move_constructor#{_ZN21copy_move_constructor1YC1ERKS0_|constexpr}.d541eaa9937cb2d89f3cb0e1be5e2194_1" [label="1: Start copy_move_constructor::Y_Y\nFormals: this:copy_move_constructor::Y* y:copy_move_constructor::Y const &\nLocals: \n DECLARE_LOCALS(&return); [line 24]\n " color=yellow style=filled] - "Y#Y#copy_move_constructor#{_ZN21copy_move_constructor1YC1EOKS0_}.ab545119d4cf8c94dafcfc9624ee52bc_1" -> "Y#Y#copy_move_constructor#{_ZN21copy_move_constructor1YC1EOKS0_}.ab545119d4cf8c94dafcfc9624ee52bc_3" ; -"Y#Y#copy_move_constructor#{_ZN21copy_move_constructor1YC1EOKS0_}.ab545119d4cf8c94dafcfc9624ee52bc_2" [label="2: Exit copy_move_constructor::Y_Y \n " color=yellow style=filled] + "Y#Y#copy_move_constructor#{_ZN21copy_move_constructor1YC1ERKS0_|constexpr}.d541eaa9937cb2d89f3cb0e1be5e2194_1" -> "Y#Y#copy_move_constructor#{_ZN21copy_move_constructor1YC1ERKS0_|constexpr}.d541eaa9937cb2d89f3cb0e1be5e2194_3" ; +"Y#Y#copy_move_constructor#{_ZN21copy_move_constructor1YC1ERKS0_|constexpr}.d541eaa9937cb2d89f3cb0e1be5e2194_2" [label="2: Exit copy_move_constructor::Y_Y \n " color=yellow style=filled] -"Y#Y#copy_move_constructor#{_ZN21copy_move_constructor1YC1EOKS0_}.ab545119d4cf8c94dafcfc9624ee52bc_3" [label="3: Constructor Init \n n$0=*&this:copy_move_constructor::Y* [line 26]\n n$1=*&y:copy_move_constructor::Y const & [line 26]\n n$2=*n$1.f:int [line 26]\n *n$0.f:int=(n$2 - 1) [line 26]\n " shape="box"] +"Y#Y#copy_move_constructor#{_ZN21copy_move_constructor1YC1ERKS0_|constexpr}.d541eaa9937cb2d89f3cb0e1be5e2194_3" [label="3: Constructor Init \n n$0=*&this:copy_move_constructor::Y* [line 24]\n n$1=*&y:copy_move_constructor::Y const & [line 24]\n n$2=*n$1.f:int [line 24]\n *n$0.f:int=n$2 [line 24]\n " shape="box"] - "Y#Y#copy_move_constructor#{_ZN21copy_move_constructor1YC1EOKS0_}.ab545119d4cf8c94dafcfc9624ee52bc_3" -> "Y#Y#copy_move_constructor#{_ZN21copy_move_constructor1YC1EOKS0_}.ab545119d4cf8c94dafcfc9624ee52bc_2" ; + "Y#Y#copy_move_constructor#{_ZN21copy_move_constructor1YC1ERKS0_|constexpr}.d541eaa9937cb2d89f3cb0e1be5e2194_3" -> "Y#Y#copy_move_constructor#{_ZN21copy_move_constructor1YC1ERKS0_|constexpr}.d541eaa9937cb2d89f3cb0e1be5e2194_2" ; } diff --git a/infer/tests/codetoanalyze/cpp/shared/exceptions/noexception.cpp.dot b/infer/tests/codetoanalyze/cpp/shared/exceptions/noexception.cpp.dot index 6af78bf54..24bef715d 100644 --- a/infer/tests/codetoanalyze/cpp/shared/exceptions/noexception.cpp.dot +++ b/infer/tests/codetoanalyze/cpp/shared/exceptions/noexception.cpp.dot @@ -7,13 +7,6 @@ digraph iCFG { "throw1#_Z6throw1v.6866701d138e60b8a5c7d6f1caf824dd_2" [label="2: Exit throw1 \n " color=yellow style=filled] -"no_throw#_Z8no_throwv.028c7f4498d9c0da6ccab2140f29bd28_1" [label="1: Start no_throw\nFormals: \nLocals: \n DECLARE_LOCALS(&return); [line 12]\n " color=yellow style=filled] - - - "no_throw#_Z8no_throwv.028c7f4498d9c0da6ccab2140f29bd28_1" -> "no_throw#_Z8no_throwv.028c7f4498d9c0da6ccab2140f29bd28_2" ; -"no_throw#_Z8no_throwv.028c7f4498d9c0da6ccab2140f29bd28_2" [label="2: Exit no_throw \n " color=yellow style=filled] - - "noexcept_in_no_throw_is_true#_Z28noexcept_in_no_throw_is_truev.d0ad76874499d22dfb8ba2dbcb60ecb4_1" [label="1: Start noexcept_in_no_throw_is_true\nFormals: \nLocals: \n DECLARE_LOCALS(&return); [line 14]\n " color=yellow style=filled] @@ -36,4 +29,11 @@ digraph iCFG { "noexcept_in_throw1_is_false#_Z27noexcept_in_throw1_is_falsev.7aad7452335d36eb8634c22fdf2750b3_3" -> "noexcept_in_throw1_is_false#_Z27noexcept_in_throw1_is_falsev.7aad7452335d36eb8634c22fdf2750b3_2" ; +"no_throw#_Z8no_throwv.028c7f4498d9c0da6ccab2140f29bd28_1" [label="1: Start no_throw\nFormals: \nLocals: \n DECLARE_LOCALS(&return); [line 12]\n " color=yellow style=filled] + + + "no_throw#_Z8no_throwv.028c7f4498d9c0da6ccab2140f29bd28_1" -> "no_throw#_Z8no_throwv.028c7f4498d9c0da6ccab2140f29bd28_2" ; +"no_throw#_Z8no_throwv.028c7f4498d9c0da6ccab2140f29bd28_2" [label="2: Exit no_throw \n " color=yellow style=filled] + + } diff --git a/infer/tests/codetoanalyze/cpp/shared/methods/virtual_methods.cpp.dot b/infer/tests/codetoanalyze/cpp/shared/methods/virtual_methods.cpp.dot index 2179c2308..62b18685c 100644 --- a/infer/tests/codetoanalyze/cpp/shared/methods/virtual_methods.cpp.dot +++ b/infer/tests/codetoanalyze/cpp/shared/methods/virtual_methods.cpp.dot @@ -111,13 +111,6 @@ digraph iCFG { "call_virtual_destructor#_Z23call_virtual_destructorv.c49554769ae5a95a20567435741c5c0d_4" -> "call_virtual_destructor#_Z23call_virtual_destructorv.c49554769ae5a95a20567435741c5c0d_3" ; -"Polygon#Polygon#{_ZN7PolygonC1Ev}.421ca45184d2ec3aafd11a446e5d5d84_1" [label="1: Start Polygon_Polygon\nFormals: this:Polygon*\nLocals: \n DECLARE_LOCALS(&return); [line 10]\n " color=yellow style=filled] - - - "Polygon#Polygon#{_ZN7PolygonC1Ev}.421ca45184d2ec3aafd11a446e5d5d84_1" -> "Polygon#Polygon#{_ZN7PolygonC1Ev}.421ca45184d2ec3aafd11a446e5d5d84_2" ; -"Polygon#Polygon#{_ZN7PolygonC1Ev}.421ca45184d2ec3aafd11a446e5d5d84_2" [label="2: Exit Polygon_Polygon \n " color=yellow style=filled] - - "area#Polygon#(_ZN7Polygon4areaEv).dfba58af1eaf2d4698f598fd9ad814a5_1" [label="1: Start Polygon_area\nFormals: this:Polygon*\nLocals: \n DECLARE_LOCALS(&return); [line 20]\n " color=yellow style=filled] @@ -129,6 +122,13 @@ digraph iCFG { "area#Polygon#(_ZN7Polygon4areaEv).dfba58af1eaf2d4698f598fd9ad814a5_3" -> "area#Polygon#(_ZN7Polygon4areaEv).dfba58af1eaf2d4698f598fd9ad814a5_2" ; +"Polygon#Polygon#{_ZN7PolygonC1Ev}.421ca45184d2ec3aafd11a446e5d5d84_1" [label="1: Start Polygon_Polygon\nFormals: this:Polygon*\nLocals: \n DECLARE_LOCALS(&return); [line 10]\n " color=yellow style=filled] + + + "Polygon#Polygon#{_ZN7PolygonC1Ev}.421ca45184d2ec3aafd11a446e5d5d84_1" -> "Polygon#Polygon#{_ZN7PolygonC1Ev}.421ca45184d2ec3aafd11a446e5d5d84_2" ; +"Polygon#Polygon#{_ZN7PolygonC1Ev}.421ca45184d2ec3aafd11a446e5d5d84_2" [label="2: Exit Polygon_Polygon \n " color=yellow style=filled] + + "set_values#Polygon#(_ZN7Polygon10set_valuesEii).c6db3996e5f613cd775c9a0b4dd3d608_1" [label="1: Start Polygon_set_values\nFormals: this:Polygon* a:int b:int\nLocals: \n DECLARE_LOCALS(&return); [line 16]\n " color=yellow style=filled] @@ -144,6 +144,17 @@ digraph iCFG { "set_values#Polygon#(_ZN7Polygon10set_valuesEii).c6db3996e5f613cd775c9a0b4dd3d608_4" -> "set_values#Polygon#(_ZN7Polygon10set_valuesEii).c6db3996e5f613cd775c9a0b4dd3d608_3" ; +"area#Rectangle#(_ZN7Polygon4areaEv).fc221a4ddc1d5709875f329895d807ea_1" [label="1: Start Rectangle_area\nFormals: this:Rectangle*\nLocals: \n DECLARE_LOCALS(&return); [line 26]\n " color=yellow style=filled] + + + "area#Rectangle#(_ZN7Polygon4areaEv).fc221a4ddc1d5709875f329895d807ea_1" -> "area#Rectangle#(_ZN7Polygon4areaEv).fc221a4ddc1d5709875f329895d807ea_3" ; +"area#Rectangle#(_ZN7Polygon4areaEv).fc221a4ddc1d5709875f329895d807ea_2" [label="2: Exit Rectangle_area \n " color=yellow style=filled] + + +"area#Rectangle#(_ZN7Polygon4areaEv).fc221a4ddc1d5709875f329895d807ea_3" [label="3: Return Stmt \n n$0=*&this:Rectangle* [line 26]\n n$1=*n$0.width:int [line 26]\n n$2=*&this:Rectangle* [line 26]\n n$3=*n$2.height:int [line 26]\n *&return:int=(n$1 * n$3) [line 26]\n " shape="box"] + + + "area#Rectangle#(_ZN7Polygon4areaEv).fc221a4ddc1d5709875f329895d807ea_3" -> "area#Rectangle#(_ZN7Polygon4areaEv).fc221a4ddc1d5709875f329895d807ea_2" ; "Rectangle#Rectangle#{_ZN9RectangleC1Ev}.42e4720a0546b7f8766a90ba8bf749ed_1" [label="1: Start Rectangle_Rectangle\nFormals: this:Rectangle*\nLocals: \n DECLARE_LOCALS(&return); [line 23]\n " color=yellow style=filled] @@ -155,17 +166,21 @@ digraph iCFG { "Rectangle#Rectangle#{_ZN9RectangleC1Ev}.42e4720a0546b7f8766a90ba8bf749ed_3" -> "Rectangle#Rectangle#{_ZN9RectangleC1Ev}.42e4720a0546b7f8766a90ba8bf749ed_2" ; -"area#Rectangle#(_ZN7Polygon4areaEv).fc221a4ddc1d5709875f329895d807ea_1" [label="1: Start Rectangle_area\nFormals: this:Rectangle*\nLocals: \n DECLARE_LOCALS(&return); [line 26]\n " color=yellow style=filled] +"area#Triangle#(_ZN7Polygon4areaEv).cad7cc6f329686733353990ac33203ad_1" [label="1: Start Triangle_area\nFormals: this:Triangle*\nLocals: x:int \n DECLARE_LOCALS(&return,&x); [line 32]\n " color=yellow style=filled] - "area#Rectangle#(_ZN7Polygon4areaEv).fc221a4ddc1d5709875f329895d807ea_1" -> "area#Rectangle#(_ZN7Polygon4areaEv).fc221a4ddc1d5709875f329895d807ea_3" ; -"area#Rectangle#(_ZN7Polygon4areaEv).fc221a4ddc1d5709875f329895d807ea_2" [label="2: Exit Rectangle_area \n " color=yellow style=filled] + "area#Triangle#(_ZN7Polygon4areaEv).cad7cc6f329686733353990ac33203ad_1" -> "area#Triangle#(_ZN7Polygon4areaEv).cad7cc6f329686733353990ac33203ad_4" ; +"area#Triangle#(_ZN7Polygon4areaEv).cad7cc6f329686733353990ac33203ad_2" [label="2: Exit Triangle_area \n " color=yellow style=filled] -"area#Rectangle#(_ZN7Polygon4areaEv).fc221a4ddc1d5709875f329895d807ea_3" [label="3: Return Stmt \n n$0=*&this:Rectangle* [line 26]\n n$1=*n$0.width:int [line 26]\n n$2=*&this:Rectangle* [line 26]\n n$3=*n$2.height:int [line 26]\n *&return:int=(n$1 * n$3) [line 26]\n " shape="box"] +"area#Triangle#(_ZN7Polygon4areaEv).cad7cc6f329686733353990ac33203ad_3" [label="3: Return Stmt \n n$0=*&x:int [line 34]\n *&return:int=(n$0 - 10) [line 34]\n " shape="box"] - "area#Rectangle#(_ZN7Polygon4areaEv).fc221a4ddc1d5709875f329895d807ea_3" -> "area#Rectangle#(_ZN7Polygon4areaEv).fc221a4ddc1d5709875f329895d807ea_2" ; + "area#Triangle#(_ZN7Polygon4areaEv).cad7cc6f329686733353990ac33203ad_3" -> "area#Triangle#(_ZN7Polygon4areaEv).cad7cc6f329686733353990ac33203ad_2" ; +"area#Triangle#(_ZN7Polygon4areaEv).cad7cc6f329686733353990ac33203ad_4" [label="4: DeclStmt \n n$1=*&this:Triangle* [line 33]\n n$2=*n$1.width:int [line 33]\n n$3=*&this:Triangle* [line 33]\n n$4=*n$3.height:int [line 33]\n *&x:int=(n$2 * n$4) [line 33]\n " shape="box"] + + + "area#Triangle#(_ZN7Polygon4areaEv).cad7cc6f329686733353990ac33203ad_4" -> "area#Triangle#(_ZN7Polygon4areaEv).cad7cc6f329686733353990ac33203ad_3" ; "Triangle#Triangle#{_ZN8TriangleC1Ev}.aa76cc2cdb1a882a316a78e630da4121_1" [label="1: Start Triangle_Triangle\nFormals: this:Triangle*\nLocals: \n DECLARE_LOCALS(&return); [line 29]\n " color=yellow style=filled] @@ -184,19 +199,4 @@ digraph iCFG { "~Triangle#Triangle#(_ZN7PolygonD0Ev).a5b74549c8daf4ed9f14d2f3048b49ad_2" [label="2: Exit Triangle_~Triangle \n " color=yellow style=filled] -"area#Triangle#(_ZN7Polygon4areaEv).cad7cc6f329686733353990ac33203ad_1" [label="1: Start Triangle_area\nFormals: this:Triangle*\nLocals: x:int \n DECLARE_LOCALS(&return,&x); [line 32]\n " color=yellow style=filled] - - - "area#Triangle#(_ZN7Polygon4areaEv).cad7cc6f329686733353990ac33203ad_1" -> "area#Triangle#(_ZN7Polygon4areaEv).cad7cc6f329686733353990ac33203ad_4" ; -"area#Triangle#(_ZN7Polygon4areaEv).cad7cc6f329686733353990ac33203ad_2" [label="2: Exit Triangle_area \n " color=yellow style=filled] - - -"area#Triangle#(_ZN7Polygon4areaEv).cad7cc6f329686733353990ac33203ad_3" [label="3: Return Stmt \n n$0=*&x:int [line 34]\n *&return:int=(n$0 - 10) [line 34]\n " shape="box"] - - - "area#Triangle#(_ZN7Polygon4areaEv).cad7cc6f329686733353990ac33203ad_3" -> "area#Triangle#(_ZN7Polygon4areaEv).cad7cc6f329686733353990ac33203ad_2" ; -"area#Triangle#(_ZN7Polygon4areaEv).cad7cc6f329686733353990ac33203ad_4" [label="4: DeclStmt \n n$1=*&this:Triangle* [line 33]\n n$2=*n$1.width:int [line 33]\n n$3=*&this:Triangle* [line 33]\n n$4=*n$3.height:int [line 33]\n *&x:int=(n$2 * n$4) [line 33]\n " shape="box"] - - - "area#Triangle#(_ZN7Polygon4areaEv).cad7cc6f329686733353990ac33203ad_4" -> "area#Triangle#(_ZN7Polygon4areaEv).cad7cc6f329686733353990ac33203ad_3" ; } diff --git a/infer/tests/codetoanalyze/cpp/shared/reference/member_access_from_return.cpp.dot b/infer/tests/codetoanalyze/cpp/shared/reference/member_access_from_return.cpp.dot index 1231bfe9d..8c4aeb5e2 100644 --- a/infer/tests/codetoanalyze/cpp/shared/reference/member_access_from_return.cpp.dot +++ b/infer/tests/codetoanalyze/cpp/shared/reference/member_access_from_return.cpp.dot @@ -63,13 +63,6 @@ digraph iCFG { "test_ptr#_Z8test_ptrv.febb3878182101927d1f4015691bf435_4" -> "test_ptr#_Z8test_ptrv.febb3878182101927d1f4015691bf435_3" ; -"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] - - "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] @@ -81,4 +74,11 @@ digraph iCFG { "call#X#(_ZN1X4callEv).6850f213fac2fabbb652507f2d371b31_3" -> "call#X#(_ZN1X4callEv).6850f213fac2fabbb652507f2d371b31_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/reference/reference_struct_e2e.cpp.dot b/infer/tests/codetoanalyze/cpp/shared/reference/reference_struct_e2e.cpp.dot index bad04970f..069466fbf 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,13 +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" ; -"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] - - "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] @@ -225,6 +218,13 @@ digraph iCFG { "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] diff --git a/infer/tests/codetoanalyze/cpp/shared/templates/function.cpp.dot b/infer/tests/codetoanalyze/cpp/shared/templates/function.cpp.dot index 23f86c79e..01458379a 100644 --- a/infer/tests/codetoanalyze/cpp/shared/templates/function.cpp.dot +++ b/infer/tests/codetoanalyze/cpp/shared/templates/function.cpp.dot @@ -112,13 +112,6 @@ 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" ; -"X1#X1#function#{_ZN8function2X1C1Ev|constexpr}.90ddc18b4a9d97f118308f85d95b6a79_1" [label="1: Start function::X1_X1\nFormals: this:function::X1*\nLocals: \n DECLARE_LOCALS(&return); [line 12]\n " color=yellow style=filled] - - - "X1#X1#function#{_ZN8function2X1C1Ev|constexpr}.90ddc18b4a9d97f118308f85d95b6a79_1" -> "X1#X1#function#{_ZN8function2X1C1Ev|constexpr}.90ddc18b4a9d97f118308f85d95b6a79_2" ; -"X1#X1#function#{_ZN8function2X1C1Ev|constexpr}.90ddc18b4a9d97f118308f85d95b6a79_2" [label="2: Exit function::X1_X1 \n " color=yellow style=filled] - - "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] @@ -130,6 +123,13 @@ digraph iCFG { "getVal#X1#function#(_ZN8function2X16getValEv).bb0ae63addee293bc0dd7065b769992f_3" -> "getVal#X1#function#(_ZN8function2X16getValEv).bb0ae63addee293bc0dd7065b769992f_2" ; +"X1#X1#function#{_ZN8function2X1C1Ev|constexpr}.90ddc18b4a9d97f118308f85d95b6a79_1" [label="1: Start function::X1_X1\nFormals: this:function::X1*\nLocals: \n DECLARE_LOCALS(&return); [line 12]\n " color=yellow style=filled] + + + "X1#X1#function#{_ZN8function2X1C1Ev|constexpr}.90ddc18b4a9d97f118308f85d95b6a79_1" -> "X1#X1#function#{_ZN8function2X1C1Ev|constexpr}.90ddc18b4a9d97f118308f85d95b6a79_2" ; +"X1#X1#function#{_ZN8function2X1C1Ev|constexpr}.90ddc18b4a9d97f118308f85d95b6a79_2" [label="2: Exit function::X1_X1 \n " color=yellow style=filled] + + "getVal#X2#function#(_ZN8function2X26getValEv).fa079e1f6e962237bc7b318c9e291ccc_1" [label="1: Start function::X2_getVal\nFormals: this:function::X2*\nLocals: \n DECLARE_LOCALS(&return); [line 17]\n " color=yellow style=filled] @@ -141,13 +141,6 @@ digraph iCFG { "getVal#X2#function#(_ZN8function2X26getValEv).fa079e1f6e962237bc7b318c9e291ccc_3" -> "getVal#X2#function#(_ZN8function2X26getValEv).fa079e1f6e962237bc7b318c9e291ccc_2" ; -"X3#X3#function#{_ZN8function2X3C1Ev|constexpr}.798f1471dcf2568095e45da7bfc54c33_1" [label="1: Start function::X3_X3\nFormals: this:function::X3*\nLocals: \n DECLARE_LOCALS(&return); [line 20]\n " color=yellow style=filled] - - - "X3#X3#function#{_ZN8function2X3C1Ev|constexpr}.798f1471dcf2568095e45da7bfc54c33_1" -> "X3#X3#function#{_ZN8function2X3C1Ev|constexpr}.798f1471dcf2568095e45da7bfc54c33_2" ; -"X3#X3#function#{_ZN8function2X3C1Ev|constexpr}.798f1471dcf2568095e45da7bfc54c33_2" [label="2: Exit function::X3_X3 \n " color=yellow style=filled] - - "get#X3#function#(_ZN8function2X33getEv).77253249a2e933be4310d3447dbf1fac_1" [label="1: Start function::X3_get\nFormals: this:function::X3*\nLocals: \n DECLARE_LOCALS(&return); [line 21]\n " color=yellow style=filled] @@ -159,6 +152,13 @@ digraph iCFG { "get#X3#function#(_ZN8function2X33getEv).77253249a2e933be4310d3447dbf1fac_3" -> "get#X3#function#(_ZN8function2X33getEv).77253249a2e933be4310d3447dbf1fac_2" ; +"X3#X3#function#{_ZN8function2X3C1Ev|constexpr}.798f1471dcf2568095e45da7bfc54c33_1" [label="1: Start function::X3_X3\nFormals: this:function::X3*\nLocals: \n DECLARE_LOCALS(&return); [line 20]\n " color=yellow style=filled] + + + "X3#X3#function#{_ZN8function2X3C1Ev|constexpr}.798f1471dcf2568095e45da7bfc54c33_1" -> "X3#X3#function#{_ZN8function2X3C1Ev|constexpr}.798f1471dcf2568095e45da7bfc54c33_2" ; +"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] diff --git a/infer/tests/codetoanalyze/cpp/shared/templates/method.cpp.dot b/infer/tests/codetoanalyze/cpp/shared/templates/method.cpp.dot index 83dfe95c1..79de3d3b8 100644 --- a/infer/tests/codetoanalyze/cpp/shared/templates/method.cpp.dot +++ b/infer/tests/codetoanalyze/cpp/shared/templates/method.cpp.dot @@ -224,13 +224,6 @@ digraph iCFG { "get#GetterTempl#method#(_ZN6method11GetterTemplINS_2X3EE3getINS_2X2EEEiRS1_R.ceae0d91ab64cf89137af49826c104c8_3" -> "get#GetterTempl#method#(_ZN6method11GetterTemplINS_2X3EE3getINS_2X2EEEiRS1_R.ceae0d91ab64cf89137af49826c104c8_2" ; -"X1#X1#method#{_ZN6method2X1C1Ev|constexpr}.f45da1019e902f9d75dc180f52f3bb1d_1" [label="1: Start method::X1_X1\nFormals: this:method::X1*\nLocals: \n DECLARE_LOCALS(&return); [line 12]\n " color=yellow style=filled] - - - "X1#X1#method#{_ZN6method2X1C1Ev|constexpr}.f45da1019e902f9d75dc180f52f3bb1d_1" -> "X1#X1#method#{_ZN6method2X1C1Ev|constexpr}.f45da1019e902f9d75dc180f52f3bb1d_2" ; -"X1#X1#method#{_ZN6method2X1C1Ev|constexpr}.f45da1019e902f9d75dc180f52f3bb1d_2" [label="2: Exit method::X1_X1 \n " color=yellow style=filled] - - "get#X1#method#(_ZN6method2X13getEv).e9e7b1ee73c3351b32fa5a9846be7a29_1" [label="1: Start method::X1_get\nFormals: this:method::X1*\nLocals: \n DECLARE_LOCALS(&return); [line 13]\n " color=yellow style=filled] @@ -242,11 +235,11 @@ digraph iCFG { "get#X1#method#(_ZN6method2X13getEv).e9e7b1ee73c3351b32fa5a9846be7a29_3" -> "get#X1#method#(_ZN6method2X13getEv).e9e7b1ee73c3351b32fa5a9846be7a29_2" ; -"X2#X2#method#{_ZN6method2X2C1Ev|constexpr}.ba73200dcc8b3804486906c40bd6f711_1" [label="1: Start method::X2_X2\nFormals: this:method::X2*\nLocals: \n DECLARE_LOCALS(&return); [line 16]\n " color=yellow style=filled] +"X1#X1#method#{_ZN6method2X1C1Ev|constexpr}.f45da1019e902f9d75dc180f52f3bb1d_1" [label="1: Start method::X1_X1\nFormals: this:method::X1*\nLocals: \n DECLARE_LOCALS(&return); [line 12]\n " color=yellow style=filled] - "X2#X2#method#{_ZN6method2X2C1Ev|constexpr}.ba73200dcc8b3804486906c40bd6f711_1" -> "X2#X2#method#{_ZN6method2X2C1Ev|constexpr}.ba73200dcc8b3804486906c40bd6f711_2" ; -"X2#X2#method#{_ZN6method2X2C1Ev|constexpr}.ba73200dcc8b3804486906c40bd6f711_2" [label="2: Exit method::X2_X2 \n " color=yellow style=filled] + "X1#X1#method#{_ZN6method2X1C1Ev|constexpr}.f45da1019e902f9d75dc180f52f3bb1d_1" -> "X1#X1#method#{_ZN6method2X1C1Ev|constexpr}.f45da1019e902f9d75dc180f52f3bb1d_2" ; +"X1#X1#method#{_ZN6method2X1C1Ev|constexpr}.f45da1019e902f9d75dc180f52f3bb1d_2" [label="2: Exit method::X1_X1 \n " color=yellow style=filled] "get#X2#method#(_ZN6method2X23getEv).f24e4debb892925a67493a806a1e179f_1" [label="1: Start method::X2_get\nFormals: this:method::X2*\nLocals: \n DECLARE_LOCALS(&return); [line 17]\n " color=yellow style=filled] @@ -260,11 +253,11 @@ digraph iCFG { "get#X2#method#(_ZN6method2X23getEv).f24e4debb892925a67493a806a1e179f_3" -> "get#X2#method#(_ZN6method2X23getEv).f24e4debb892925a67493a806a1e179f_2" ; -"X3#X3#method#{_ZN6method2X3C1Ev|constexpr}.cc0986d297cbf6e33f207ffed6378b08_1" [label="1: Start method::X3_X3\nFormals: this:method::X3*\nLocals: \n DECLARE_LOCALS(&return); [line 20]\n " color=yellow style=filled] +"X2#X2#method#{_ZN6method2X2C1Ev|constexpr}.ba73200dcc8b3804486906c40bd6f711_1" [label="1: Start method::X2_X2\nFormals: this:method::X2*\nLocals: \n DECLARE_LOCALS(&return); [line 16]\n " color=yellow style=filled] - "X3#X3#method#{_ZN6method2X3C1Ev|constexpr}.cc0986d297cbf6e33f207ffed6378b08_1" -> "X3#X3#method#{_ZN6method2X3C1Ev|constexpr}.cc0986d297cbf6e33f207ffed6378b08_2" ; -"X3#X3#method#{_ZN6method2X3C1Ev|constexpr}.cc0986d297cbf6e33f207ffed6378b08_2" [label="2: Exit method::X3_X3 \n " color=yellow style=filled] + "X2#X2#method#{_ZN6method2X2C1Ev|constexpr}.ba73200dcc8b3804486906c40bd6f711_1" -> "X2#X2#method#{_ZN6method2X2C1Ev|constexpr}.ba73200dcc8b3804486906c40bd6f711_2" ; +"X2#X2#method#{_ZN6method2X2C1Ev|constexpr}.ba73200dcc8b3804486906c40bd6f711_2" [label="2: Exit method::X2_X2 \n " color=yellow style=filled] "get#X3#method#(_ZN6method2X33getEv).86ec763aa716acb9281ee7c6f3c1c477_1" [label="1: Start method::X3_get\nFormals: this:method::X3*\nLocals: \n DECLARE_LOCALS(&return); [line 21]\n " color=yellow style=filled] @@ -278,4 +271,11 @@ digraph iCFG { "get#X3#method#(_ZN6method2X33getEv).86ec763aa716acb9281ee7c6f3c1c477_3" -> "get#X3#method#(_ZN6method2X33getEv).86ec763aa716acb9281ee7c6f3c1c477_2" ; +"X3#X3#method#{_ZN6method2X3C1Ev|constexpr}.cc0986d297cbf6e33f207ffed6378b08_1" [label="1: Start method::X3_X3\nFormals: this:method::X3*\nLocals: \n DECLARE_LOCALS(&return); [line 20]\n " color=yellow style=filled] + + + "X3#X3#method#{_ZN6method2X3C1Ev|constexpr}.cc0986d297cbf6e33f207ffed6378b08_1" -> "X3#X3#method#{_ZN6method2X3C1Ev|constexpr}.cc0986d297cbf6e33f207ffed6378b08_2" ; +"X3#X3#method#{_ZN6method2X3C1Ev|constexpr}.cc0986d297cbf6e33f207ffed6378b08_2" [label="2: Exit method::X3_X3 \n " color=yellow style=filled] + + } diff --git a/infer/tests/codetoanalyze/cpp/shared/types/inheritance.cpp.dot b/infer/tests/codetoanalyze/cpp/shared/types/inheritance.cpp.dot index 25b98b3ba..6102fda20 100644 --- a/infer/tests/codetoanalyze/cpp/shared/types/inheritance.cpp.dot +++ b/infer/tests/codetoanalyze/cpp/shared/types/inheritance.cpp.dot @@ -43,13 +43,6 @@ digraph iCFG { "call_static_methods#_Z19call_static_methodsv.8f6d53f5ba8026b1f1c82b61375a3dfc_11" -> "call_static_methods#_Z19call_static_methodsv.8f6d53f5ba8026b1f1c82b61375a3dfc_10" ; -"Base#Base#{_ZN4BaseC1Ev|constexpr}.b40f1fff4dc6a0e6dfdca672253d3ca0_1" [label="1: Start Base_Base\nFormals: this:Base*\nLocals: \n DECLARE_LOCALS(&return); [line 10]\n " color=yellow style=filled] - - - "Base#Base#{_ZN4BaseC1Ev|constexpr}.b40f1fff4dc6a0e6dfdca672253d3ca0_1" -> "Base#Base#{_ZN4BaseC1Ev|constexpr}.b40f1fff4dc6a0e6dfdca672253d3ca0_2" ; -"Base#Base#{_ZN4BaseC1Ev|constexpr}.b40f1fff4dc6a0e6dfdca672253d3ca0_2" [label="2: Exit Base_Base \n " color=yellow style=filled] - - "fun#Base#(_ZN4Base3funEv).2229bfd9aa5290c00cdbb746dc981d9a_1" [label="1: Start Base_fun\nFormals: this:Base*\nLocals: \n DECLARE_LOCALS(&return); [line 12]\n " color=yellow style=filled] @@ -72,17 +65,13 @@ digraph iCFG { "fun_redefine#Base#(_ZN4Base12fun_redefineEv).c2ff930198d499360a565fea1e1cc430_3" -> "fun_redefine#Base#(_ZN4Base12fun_redefineEv).c2ff930198d499360a565fea1e1cc430_2" ; -"Sub#Sub#{_ZN3SubC1Ev|constexpr}.93e15d601751169652f5c2c5e08b3e98_1" [label="1: Start Sub_Sub\nFormals: this:Sub*\nLocals: \n DECLARE_LOCALS(&return); [line 16]\n " color=yellow style=filled] - - - "Sub#Sub#{_ZN3SubC1Ev|constexpr}.93e15d601751169652f5c2c5e08b3e98_1" -> "Sub#Sub#{_ZN3SubC1Ev|constexpr}.93e15d601751169652f5c2c5e08b3e98_3" ; -"Sub#Sub#{_ZN3SubC1Ev|constexpr}.93e15d601751169652f5c2c5e08b3e98_2" [label="2: Exit Sub_Sub \n " color=yellow style=filled] +"Base#Base#{_ZN4BaseC1Ev|constexpr}.b40f1fff4dc6a0e6dfdca672253d3ca0_1" [label="1: Start Base_Base\nFormals: this:Base*\nLocals: \n DECLARE_LOCALS(&return); [line 10]\n " color=yellow style=filled] -"Sub#Sub#{_ZN3SubC1Ev|constexpr}.93e15d601751169652f5c2c5e08b3e98_3" [label="3: Constructor Init \n n$0=*&this:Sub* [line 16]\n _fun_Base_Base(n$0:Sub*) [line 16]\n " shape="box"] + "Base#Base#{_ZN4BaseC1Ev|constexpr}.b40f1fff4dc6a0e6dfdca672253d3ca0_1" -> "Base#Base#{_ZN4BaseC1Ev|constexpr}.b40f1fff4dc6a0e6dfdca672253d3ca0_2" ; +"Base#Base#{_ZN4BaseC1Ev|constexpr}.b40f1fff4dc6a0e6dfdca672253d3ca0_2" [label="2: Exit Base_Base \n " color=yellow style=filled] - "Sub#Sub#{_ZN3SubC1Ev|constexpr}.93e15d601751169652f5c2c5e08b3e98_3" -> "Sub#Sub#{_ZN3SubC1Ev|constexpr}.93e15d601751169652f5c2c5e08b3e98_2" ; "fun_redefine#Sub#(_ZN3Sub12fun_redefineEv).75c6089c3bffa929f77b6a6a9d051bd8_1" [label="1: Start Sub_fun_redefine\nFormals: this:Sub*\nLocals: \n DECLARE_LOCALS(&return); [line 18]\n " color=yellow style=filled] @@ -94,4 +83,15 @@ digraph iCFG { "fun_redefine#Sub#(_ZN3Sub12fun_redefineEv).75c6089c3bffa929f77b6a6a9d051bd8_3" -> "fun_redefine#Sub#(_ZN3Sub12fun_redefineEv).75c6089c3bffa929f77b6a6a9d051bd8_2" ; +"Sub#Sub#{_ZN3SubC1Ev|constexpr}.93e15d601751169652f5c2c5e08b3e98_1" [label="1: Start Sub_Sub\nFormals: this:Sub*\nLocals: \n DECLARE_LOCALS(&return); [line 16]\n " color=yellow style=filled] + + + "Sub#Sub#{_ZN3SubC1Ev|constexpr}.93e15d601751169652f5c2c5e08b3e98_1" -> "Sub#Sub#{_ZN3SubC1Ev|constexpr}.93e15d601751169652f5c2c5e08b3e98_3" ; +"Sub#Sub#{_ZN3SubC1Ev|constexpr}.93e15d601751169652f5c2c5e08b3e98_2" [label="2: Exit Sub_Sub \n " color=yellow style=filled] + + +"Sub#Sub#{_ZN3SubC1Ev|constexpr}.93e15d601751169652f5c2c5e08b3e98_3" [label="3: Constructor Init \n n$0=*&this:Sub* [line 16]\n _fun_Base_Base(n$0:Sub*) [line 16]\n " shape="box"] + + + "Sub#Sub#{_ZN3SubC1Ev|constexpr}.93e15d601751169652f5c2c5e08b3e98_3" -> "Sub#Sub#{_ZN3SubC1Ev|constexpr}.93e15d601751169652f5c2c5e08b3e98_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 b80f3cd9d..da7f5a9ff 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,13 +78,6 @@ digraph iCFG { "Z_div0#struct_forward_declare#_ZN22struct_forward_declare6Z_div0Ev.a505b34806619878f3b8e521270dcf65_5" -> "Z_div0#struct_forward_declare#_ZN22struct_forward_declare6Z_div0Ev.a505b34806619878f3b8e521270dcf65_4" ; -"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#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] - - "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] @@ -96,11 +89,11 @@ digraph iCFG { "getF#X#struct_forward_declare#(_ZN22struct_forward_declare1X4getFEv).1e9b3699cbb3e16aa40f3c70fd848d39_3" -> "getF#X#struct_forward_declare#(_ZN22struct_forward_declare1X4getFEv).1e9b3699cbb3e16aa40f3c70fd848d39_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] +"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#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] + "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] "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] @@ -114,6 +107,13 @@ digraph iCFG { "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#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] + + "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]