From 41e51bc28c49d8973f99c77e7546d566ce75e3eb Mon Sep 17 00:00:00 2001 From: Andrzej Kotulski Date: Wed, 31 Aug 2016 10:35:13 -0700 Subject: [PATCH] Clean up smart pointer header models Summary: 1. models no longer need access to private fields (shared_ptr needed that) 2. create macro for __attribute__((deprecated("__infer_replace_with_deref_first_arg"))) and use it in models Reviewed By: jberdine Differential Revision: D3791113 fbshipit-source-id: 532dd33 --- .../infer_model/begin_name_override.inc | 1 - .../include/infer_model/end_name_override.inc | 1 - .../cpp/include/infer_model/infer_traits.h | 3 + .../cpp/include/infer_model/shared_ptr.h | 18 +-- .../cpp/include/infer_model/unique_ptr.h | 20 +-- .../frontend/attributes/deprecated_hack.cpp | 23 +-- .../attributes/deprecated_hack.cpp.dot | 138 +++++++++--------- 7 files changed, 93 insertions(+), 111 deletions(-) diff --git a/infer/models/cpp/include/infer_model/begin_name_override.inc b/infer/models/cpp/include/infer_model/begin_name_override.inc index e8b3e1af2..9c48c48de 100644 --- a/infer/models/cpp/include/infer_model/begin_name_override.inc +++ b/infer/models/cpp/include/infer_model/begin_name_override.inc @@ -2,4 +2,3 @@ #define shared_ptr std__shared_ptr #define unique_ptr std__unique_ptr #define make_unique std__make_unique -#define private public diff --git a/infer/models/cpp/include/infer_model/end_name_override.inc b/infer/models/cpp/include/infer_model/end_name_override.inc index 44c9b826a..f91c269d6 100644 --- a/infer/models/cpp/include/infer_model/end_name_override.inc +++ b/infer/models/cpp/include/infer_model/end_name_override.inc @@ -2,4 +2,3 @@ #undef shared_ptr #undef unique_ptr #undef make_unique -#undef private diff --git a/infer/models/cpp/include/infer_model/infer_traits.h b/infer/models/cpp/include/infer_model/infer_traits.h index 0062fa090..734a707e3 100644 --- a/infer/models/cpp/include/infer_model/infer_traits.h +++ b/infer/models/cpp/include/infer_model/infer_traits.h @@ -15,3 +15,6 @@ namespace infer_traits { template class TranslateAsType {}; } // namespace infer_traits + +#define INFER_MODEL_AS_DEREF_FIRST_ARG \ + __attribute__((deprecated("__infer_replace_with_deref_first_arg"))) {} diff --git a/infer/models/cpp/include/infer_model/shared_ptr.h b/infer/models/cpp/include/infer_model/shared_ptr.h index 5e5b7bb3b..56c0e5906 100644 --- a/infer/models/cpp/include/infer_model/shared_ptr.h +++ b/infer/models/cpp/include/infer_model/shared_ptr.h @@ -240,18 +240,12 @@ class shared_ptr : public std__shared_ptr { } // observers: - T* get() const noexcept __attribute__((deprecated( - "__infer_replace_with_deref_first_arg"))) { /* return - model_get(__cast_to_infer_ptr(this)); */ - } - typename std::add_lvalue_reference::type operator*() const noexcept - __attribute__((deprecated("__infer_replace_with_deref_first_arg"))) { - /*return *model_get(__cast_to_infer_ptr(this));*/ - } - T* operator->() const noexcept - __attribute__((deprecated("__infer_replace_with_deref_first_arg"))) { - /*return model_get(__cast_to_infer_ptr(this));*/ - } + T* get() const noexcept INFER_MODEL_AS_DEREF_FIRST_ARG; + + typename std::add_lvalue_reference::type operator*() const + noexcept INFER_MODEL_AS_DEREF_FIRST_ARG; + + T* operator->() const noexcept INFER_MODEL_AS_DEREF_FIRST_ARG; long use_count() const noexcept { return 2; /* FIXME */ } bool unique() const noexcept { return use_count() == 1; /* FIXME */ } explicit operator bool() const noexcept { diff --git a/infer/models/cpp/include/infer_model/unique_ptr.h b/infer/models/cpp/include/infer_model/unique_ptr.h index 377c3781c..1b9c1b4f4 100644 --- a/infer/models/cpp/include/infer_model/unique_ptr.h +++ b/infer/models/cpp/include/infer_model/unique_ptr.h @@ -142,13 +142,11 @@ struct unique_ptr { return *this; } typename add_lvalue_reference<_Tp>::type operator*() const - __attribute__((deprecated("__infer_replace_with_deref_first_arg"))) {} + INFER_MODEL_AS_DEREF_FIRST_ARG; - pointer operator->() const - __attribute__((deprecated("__infer_replace_with_deref_first_arg"))) {} + pointer operator->() const INFER_MODEL_AS_DEREF_FIRST_ARG; - pointer get() const - __attribute__((deprecated("__infer_replace_with_deref_first_arg"))) {} + pointer get() const INFER_MODEL_AS_DEREF_FIRST_ARG; typedef typename remove_reference::type& _Dp_reference; typedef const typename remove_reference::type& @@ -159,8 +157,7 @@ struct unique_ptr { explicit operator bool() const { return !!(bool)(model_get(__cast_to_infer_ptr(this))); } - pointer release() - __attribute__((deprecated("__infer_replace_with_deref_first_arg"))) {} + pointer release() INFER_MODEL_AS_DEREF_FIRST_ARG; void reset(pointer p = nullptr) { model_set(__cast_to_infer_ptr(this), p); } @@ -288,11 +285,9 @@ struct unique_ptr<_Tp[], _Dp> { } typename add_lvalue_reference<_Tp>::type operator[](size_t i) const - __attribute__((deprecated("__infer_replace_with_deref_first_arg"))) {} - - pointer get() const - __attribute__((deprecated("__infer_replace_with_deref_first_arg"))) {} + INFER_MODEL_AS_DEREF_FIRST_ARG; + pointer get() const INFER_MODEL_AS_DEREF_FIRST_ARG; typedef typename remove_reference::type& _Dp_reference; typedef const typename remove_reference::type& _Dp_const_reference; @@ -302,8 +297,7 @@ struct unique_ptr<_Tp[], _Dp> { explicit operator bool() const { return !!(bool)(model_get(__cast_to_infer_ptr(this))); } - pointer release() - __attribute__((deprecated("__infer_replace_with_deref_first_arg"))) {} + pointer release() INFER_MODEL_AS_DEREF_FIRST_ARG; void reset(pointer p = nullptr) { model_set(__cast_to_infer_ptr(this), p); } diff --git a/infer/tests/codetoanalyze/cpp/frontend/attributes/deprecated_hack.cpp b/infer/tests/codetoanalyze/cpp/frontend/attributes/deprecated_hack.cpp index fd038fd78..370bd4049 100644 --- a/infer/tests/codetoanalyze/cpp/frontend/attributes/deprecated_hack.cpp +++ b/infer/tests/codetoanalyze/cpp/frontend/attributes/deprecated_hack.cpp @@ -16,12 +16,9 @@ /* Test for passing function attributes to infer via __deprecated__ attribute */ // basic test of C function with __infer_replace_with_deref_first_arg attribute -int derefFirstArg(int* a, int* b) - __attribute__((deprecated("__infer_replace_with_deref_first_arg"))) { - /* equivalent in real code: - return *a; */ -} +int derefFirstArg(int* a, int* b) INFER_MODEL_AS_DEREF_FIRST_ARG; +// test directly with deprecated attribute int derefFirstArg2(int* a, int* b) __attribute__((deprecated("__infer_replace_with_deref_first_arg"))) { /* equivalent in real code: @@ -30,6 +27,7 @@ int derefFirstArg2(int* a, int* b) // should be used } +// test with wrong deprecated attribute int derefFirstArg3(int* a, int* b) __attribute__((deprecated("__infer_typo"))) { /* equivalent in real code: */ return *b; // there isn't any known attribute with this name, use semantics @@ -77,17 +75,12 @@ struct TranslateAsPtr { friend class infer_traits::TranslateAsType; TranslateAsPtr(T* t = nullptr) { setPtr(t); } /* calls to those functions are supposed to be translated as `*this` */ - T* getPtr() - __attribute__((deprecated("__infer_replace_with_deref_first_arg"))) {} - T* getPtr(int a, int b) - __attribute__((deprecated("__infer_replace_with_deref_first_arg"))) {} + T* getPtr() INFER_MODEL_AS_DEREF_FIRST_ARG; + T* getPtr(int a, int b) INFER_MODEL_AS_DEREF_FIRST_ARG; /* calls to those functions are supposed to be translated as `**this` */ - T& operator*() - __attribute__((deprecated("__infer_replace_with_deref_first_arg"))) {} - T& getRef() - __attribute__((deprecated("__infer_replace_with_deref_first_arg"))) {} - T& getRef(int a, int b) - __attribute__((deprecated("__infer_replace_with_deref_first_arg"))) {} + T& operator*() INFER_MODEL_AS_DEREF_FIRST_ARG; + T& getRef() INFER_MODEL_AS_DEREF_FIRST_ARG; + T& getRef(int a, int b) INFER_MODEL_AS_DEREF_FIRST_ARG; // same trick we do for setting value of shared_ptr, look there for details void setPtr(T* v) { *((void**)(this)) = v; } diff --git a/infer/tests/codetoanalyze/cpp/frontend/attributes/deprecated_hack.cpp.dot b/infer/tests/codetoanalyze/cpp/frontend/attributes/deprecated_hack.cpp.dot index ded0f6c3d..87b2b87a1 100644 --- a/infer/tests/codetoanalyze/cpp/frontend/attributes/deprecated_hack.cpp.dot +++ b/infer/tests/codetoanalyze/cpp/frontend/attributes/deprecated_hack.cpp.dot @@ -1,350 +1,350 @@ /* @generated */ digraph iCFG { -95 [label="95: DeclStmt \n *&a:int =0 [line 147]\n " shape="box"] +95 [label="95: DeclStmt \n *&a:int =0 [line 140]\n " shape="box"] 95 -> 94 ; -94 [label="94: DeclStmt \n _fun_TranslateAsPtr_TranslateAsPtr(&t:int **,null:int *) [line 148]\n n$4=*&t:int * [line 148]\n " shape="box"] +94 [label="94: DeclStmt \n _fun_TranslateAsPtr_TranslateAsPtr(&t:int **,null:int *) [line 141]\n n$4=*&t:int * [line 141]\n " shape="box"] 94 -> 93 ; -93 [label="93: Call _fun_TranslateAsPtr_setPtr \n _=*&t:int * [line 149]\n _fun_TranslateAsPtr_setPtr(&t:int *&,&a:int *) [line 149]\n " shape="box"] +93 [label="93: Call _fun_TranslateAsPtr_setPtr \n _=*&t:int * [line 142]\n _fun_TranslateAsPtr_setPtr(&t:int *&,&a:int *) [line 142]\n " shape="box"] 93 -> 92 ; -92 [label="92: Return Stmt \n _=*&t:int * [line 150]\n n$1=*&t:int *& [line 150]\n n$2=*n$1:int * [line 150]\n *&return:int =n$2 [line 150]\n " shape="box"] +92 [label="92: Return Stmt \n _=*&t:int * [line 143]\n n$1=*&t:int *& [line 143]\n n$2=*n$1:int * [line 143]\n *&return:int =n$2 [line 143]\n " shape="box"] 92 -> 91 ; 91 [label="91: Exit getRef_ok_deref \n " color=yellow style=filled] -90 [label="90: Start getRef_ok_deref\nFormals: \nLocals: t:int * a:int \n DECLARE_LOCALS(&return,&t,&a); [line 146]\n " color=yellow style=filled] +90 [label="90: Start getRef_ok_deref\nFormals: \nLocals: t:int * a:int \n DECLARE_LOCALS(&return,&t,&a); [line 139]\n " color=yellow style=filled] 90 -> 95 ; -89 [label="89: DeclStmt \n _fun_TranslateAsPtr_TranslateAsPtr(&t:int **,null:int *) [line 141]\n n$4=*&t:int * [line 141]\n " shape="box"] +89 [label="89: DeclStmt \n _fun_TranslateAsPtr_TranslateAsPtr(&t:int **,null:int *) [line 134]\n n$4=*&t:int * [line 134]\n " shape="box"] 89 -> 88 ; -88 [label="88: Call _fun_TranslateAsPtr_setPtr \n _=*&t:int * [line 142]\n _fun_TranslateAsPtr_setPtr(&t:int *&,null:int *) [line 142]\n " shape="box"] +88 [label="88: Call _fun_TranslateAsPtr_setPtr \n _=*&t:int * [line 135]\n _fun_TranslateAsPtr_setPtr(&t:int *&,null:int *) [line 135]\n " shape="box"] 88 -> 87 ; -87 [label="87: Return Stmt \n _=*&t:int * [line 143]\n n$1=*&t:int *& [line 143]\n n$2=*n$1:int * [line 143]\n *&return:int =n$2 [line 143]\n " shape="box"] +87 [label="87: Return Stmt \n _=*&t:int * [line 136]\n n$1=*&t:int *& [line 136]\n n$2=*n$1:int * [line 136]\n *&return:int =n$2 [line 136]\n " shape="box"] 87 -> 86 ; 86 [label="86: Exit getRef_null_deref2 \n " color=yellow style=filled] -85 [label="85: Start getRef_null_deref2\nFormals: \nLocals: t:int * \n DECLARE_LOCALS(&return,&t); [line 140]\n " color=yellow style=filled] +85 [label="85: Start getRef_null_deref2\nFormals: \nLocals: t:int * \n DECLARE_LOCALS(&return,&t); [line 133]\n " color=yellow style=filled] 85 -> 89 ; -84 [label="84: DeclStmt \n _fun_TranslateAsPtr_TranslateAsPtr(&t:int **,null:int *) [line 135]\n n$4=*&t:int * [line 135]\n " shape="box"] +84 [label="84: DeclStmt \n _fun_TranslateAsPtr_TranslateAsPtr(&t:int **,null:int *) [line 128]\n n$4=*&t:int * [line 128]\n " shape="box"] 84 -> 83 ; -83 [label="83: Call _fun_TranslateAsPtr_setPtr \n _=*&t:int * [line 136]\n _fun_TranslateAsPtr_setPtr(&t:int *&,null:int *) [line 136]\n " shape="box"] +83 [label="83: Call _fun_TranslateAsPtr_setPtr \n _=*&t:int * [line 129]\n _fun_TranslateAsPtr_setPtr(&t:int *&,null:int *) [line 129]\n " shape="box"] 83 -> 82 ; -82 [label="82: Return Stmt \n _=*&t:int * [line 137]\n n$1=*&t:int *& [line 137]\n n$2=*n$1:int * [line 137]\n *&return:int =n$2 [line 137]\n " shape="box"] +82 [label="82: Return Stmt \n _=*&t:int * [line 130]\n n$1=*&t:int *& [line 130]\n n$2=*n$1:int * [line 130]\n *&return:int =n$2 [line 130]\n " shape="box"] 82 -> 81 ; 81 [label="81: Exit getRef_null_deref1 \n " color=yellow style=filled] -80 [label="80: Start getRef_null_deref1\nFormals: \nLocals: t:int * \n DECLARE_LOCALS(&return,&t); [line 134]\n " color=yellow style=filled] +80 [label="80: Start getRef_null_deref1\nFormals: \nLocals: t:int * \n DECLARE_LOCALS(&return,&t); [line 127]\n " color=yellow style=filled] 80 -> 84 ; -79 [label="79: DeclStmt \n _fun_TranslateAsPtr_TranslateAsPtr(&t:int **,null:int *) [line 129]\n n$4=*&t:int * [line 129]\n " shape="box"] +79 [label="79: DeclStmt \n _fun_TranslateAsPtr_TranslateAsPtr(&t:int **,null:int *) [line 122]\n n$4=*&t:int * [line 122]\n " shape="box"] 79 -> 78 ; -78 [label="78: Call _fun_TranslateAsPtr_setPtr \n _=*&t:int * [line 130]\n _fun_TranslateAsPtr_setPtr(&t:int *&,&a:int *) [line 130]\n " shape="box"] +78 [label="78: Call _fun_TranslateAsPtr_setPtr \n _=*&t:int * [line 123]\n _fun_TranslateAsPtr_setPtr(&t:int *&,&a:int *) [line 123]\n " shape="box"] 78 -> 77 ; -77 [label="77: Return Stmt \n _=*&t:int * [line 131]\n n$1=*&t:int *& [line 131]\n n$2=*n$1:int * [line 131]\n *&return:int =n$2 [line 131]\n " shape="box"] +77 [label="77: Return Stmt \n _=*&t:int * [line 124]\n n$1=*&t:int *& [line 124]\n n$2=*n$1:int * [line 124]\n *&return:int =n$2 [line 124]\n " shape="box"] 77 -> 76 ; 76 [label="76: Exit operator_star_ok_deref \n " color=yellow style=filled] -75 [label="75: Start operator_star_ok_deref\nFormals: \nLocals: t:int * a:int \n DECLARE_LOCALS(&return,&t,&a); [line 127]\n " color=yellow style=filled] +75 [label="75: Start operator_star_ok_deref\nFormals: \nLocals: t:int * a:int \n DECLARE_LOCALS(&return,&t,&a); [line 120]\n " color=yellow style=filled] 75 -> 79 ; -74 [label="74: DeclStmt \n _fun_TranslateAsPtr_TranslateAsPtr(&t:int **,null:int *) [line 122]\n n$4=*&t:int * [line 122]\n " shape="box"] +74 [label="74: DeclStmt \n _fun_TranslateAsPtr_TranslateAsPtr(&t:int **,null:int *) [line 115]\n n$4=*&t:int * [line 115]\n " shape="box"] 74 -> 73 ; -73 [label="73: Call _fun_TranslateAsPtr_setPtr \n _=*&t:int * [line 123]\n _fun_TranslateAsPtr_setPtr(&t:int *&,null:int *) [line 123]\n " shape="box"] +73 [label="73: Call _fun_TranslateAsPtr_setPtr \n _=*&t:int * [line 116]\n _fun_TranslateAsPtr_setPtr(&t:int *&,null:int *) [line 116]\n " shape="box"] 73 -> 72 ; -72 [label="72: Return Stmt \n _=*&t:int * [line 124]\n n$1=*&t:int *& [line 124]\n n$2=*n$1:int * [line 124]\n *&return:int =n$2 [line 124]\n " shape="box"] +72 [label="72: Return Stmt \n _=*&t:int * [line 117]\n n$1=*&t:int *& [line 117]\n n$2=*n$1:int * [line 117]\n *&return:int =n$2 [line 117]\n " shape="box"] 72 -> 71 ; 71 [label="71: Exit operator_star_null_deref2 \n " color=yellow style=filled] -70 [label="70: Start operator_star_null_deref2\nFormals: \nLocals: t:int * \n DECLARE_LOCALS(&return,&t); [line 121]\n " color=yellow style=filled] +70 [label="70: Start operator_star_null_deref2\nFormals: \nLocals: t:int * \n DECLARE_LOCALS(&return,&t); [line 114]\n " color=yellow style=filled] 70 -> 74 ; -69 [label="69: DeclStmt \n _fun_TranslateAsPtr_TranslateAsPtr(&t:int **,null:int *) [line 116]\n n$3=*&t:int * [line 116]\n " shape="box"] +69 [label="69: DeclStmt \n _fun_TranslateAsPtr_TranslateAsPtr(&t:int **,null:int *) [line 109]\n n$3=*&t:int * [line 109]\n " shape="box"] 69 -> 68 ; -68 [label="68: Call _fun_TranslateAsPtr_setPtr \n _=*&t:int * [line 117]\n _fun_TranslateAsPtr_setPtr(&t:int *&,null:int *) [line 117]\n " shape="box"] +68 [label="68: Call _fun_TranslateAsPtr_setPtr \n _=*&t:int * [line 110]\n _fun_TranslateAsPtr_setPtr(&t:int *&,null:int *) [line 110]\n " shape="box"] 68 -> 67 ; -67 [label="67: Return Stmt \n n$0=*&t:int *& [line 118]\n n$1=*n$0:int * [line 118]\n *&return:int =n$1 [line 118]\n " shape="box"] +67 [label="67: Return Stmt \n n$0=*&t:int *& [line 111]\n n$1=*n$0:int * [line 111]\n *&return:int =n$1 [line 111]\n " shape="box"] 67 -> 66 ; 66 [label="66: Exit operator_star_null_deref1 \n " color=yellow style=filled] -65 [label="65: Start operator_star_null_deref1\nFormals: \nLocals: t:int * \n DECLARE_LOCALS(&return,&t); [line 115]\n " color=yellow style=filled] +65 [label="65: Start operator_star_null_deref1\nFormals: \nLocals: t:int * \n DECLARE_LOCALS(&return,&t); [line 108]\n " color=yellow style=filled] 65 -> 69 ; -64 [label="64: DeclStmt \n *&a:int =0 [line 109]\n " shape="box"] +64 [label="64: DeclStmt \n *&a:int =0 [line 102]\n " shape="box"] 64 -> 63 ; -63 [label="63: DeclStmt \n _fun_TranslateAsPtr_TranslateAsPtr(&t:int **,null:int *) [line 110]\n n$4=*&t:int * [line 110]\n " shape="box"] +63 [label="63: DeclStmt \n _fun_TranslateAsPtr_TranslateAsPtr(&t:int **,null:int *) [line 103]\n n$4=*&t:int * [line 103]\n " shape="box"] 63 -> 62 ; -62 [label="62: Call _fun_TranslateAsPtr_setPtr \n _=*&t:int * [line 111]\n _fun_TranslateAsPtr_setPtr(&t:int *&,&a:int *) [line 111]\n " shape="box"] +62 [label="62: Call _fun_TranslateAsPtr_setPtr \n _=*&t:int * [line 104]\n _fun_TranslateAsPtr_setPtr(&t:int *&,&a:int *) [line 104]\n " shape="box"] 62 -> 61 ; -61 [label="61: Return Stmt \n _=*&t:int * [line 112]\n n$1=*&t:int *& [line 112]\n n$2=*n$1:int [line 112]\n *&return:int =n$2 [line 112]\n " shape="box"] +61 [label="61: Return Stmt \n _=*&t:int * [line 105]\n n$1=*&t:int *& [line 105]\n n$2=*n$1:int [line 105]\n *&return:int =n$2 [line 105]\n " shape="box"] 61 -> 60 ; 60 [label="60: Exit getPtr_ok_deref \n " color=yellow style=filled] -59 [label="59: Start getPtr_ok_deref\nFormals: \nLocals: t:int * a:int \n DECLARE_LOCALS(&return,&t,&a); [line 108]\n " color=yellow style=filled] +59 [label="59: Start getPtr_ok_deref\nFormals: \nLocals: t:int * a:int \n DECLARE_LOCALS(&return,&t,&a); [line 101]\n " color=yellow style=filled] 59 -> 64 ; -58 [label="58: DeclStmt \n _fun_TranslateAsPtr_TranslateAsPtr(&t:int **,null:int *) [line 103]\n n$4=*&t:int * [line 103]\n " shape="box"] +58 [label="58: DeclStmt \n _fun_TranslateAsPtr_TranslateAsPtr(&t:int **,null:int *) [line 96]\n n$4=*&t:int * [line 96]\n " shape="box"] 58 -> 57 ; -57 [label="57: Call _fun_TranslateAsPtr_setPtr \n _=*&t:int * [line 104]\n _fun_TranslateAsPtr_setPtr(&t:int *&,null:int *) [line 104]\n " shape="box"] +57 [label="57: Call _fun_TranslateAsPtr_setPtr \n _=*&t:int * [line 97]\n _fun_TranslateAsPtr_setPtr(&t:int *&,null:int *) [line 97]\n " shape="box"] 57 -> 56 ; -56 [label="56: Return Stmt \n _=*&t:int * [line 105]\n n$1=*&t:int *& [line 105]\n n$2=*n$1:int [line 105]\n *&return:int =n$2 [line 105]\n " shape="box"] +56 [label="56: Return Stmt \n _=*&t:int * [line 98]\n n$1=*&t:int *& [line 98]\n n$2=*n$1:int [line 98]\n *&return:int =n$2 [line 98]\n " shape="box"] 56 -> 55 ; 55 [label="55: Exit getPtr_null_deref2 \n " color=yellow style=filled] -54 [label="54: Start getPtr_null_deref2\nFormals: \nLocals: t:int * \n DECLARE_LOCALS(&return,&t); [line 102]\n " color=yellow style=filled] +54 [label="54: Start getPtr_null_deref2\nFormals: \nLocals: t:int * \n DECLARE_LOCALS(&return,&t); [line 95]\n " color=yellow style=filled] 54 -> 58 ; -53 [label="53: DeclStmt \n _fun_TranslateAsPtr_TranslateAsPtr(&t:int **,null:int *) [line 97]\n n$4=*&t:int * [line 97]\n " shape="box"] +53 [label="53: DeclStmt \n _fun_TranslateAsPtr_TranslateAsPtr(&t:int **,null:int *) [line 90]\n n$4=*&t:int * [line 90]\n " shape="box"] 53 -> 52 ; -52 [label="52: Call _fun_TranslateAsPtr_setPtr \n _=*&t:int * [line 98]\n _fun_TranslateAsPtr_setPtr(&t:int *&,null:int *) [line 98]\n " shape="box"] +52 [label="52: Call _fun_TranslateAsPtr_setPtr \n _=*&t:int * [line 91]\n _fun_TranslateAsPtr_setPtr(&t:int *&,null:int *) [line 91]\n " shape="box"] 52 -> 51 ; -51 [label="51: Return Stmt \n _=*&t:int * [line 99]\n n$1=*&t:int *& [line 99]\n n$2=*n$1:int [line 99]\n *&return:int =n$2 [line 99]\n " shape="box"] +51 [label="51: Return Stmt \n _=*&t:int * [line 92]\n n$1=*&t:int *& [line 92]\n n$2=*n$1:int [line 92]\n *&return:int =n$2 [line 92]\n " shape="box"] 51 -> 50 ; 50 [label="50: Exit getPtr_null_deref1 \n " color=yellow style=filled] -49 [label="49: Start getPtr_null_deref1\nFormals: \nLocals: t:int * \n DECLARE_LOCALS(&return,&t); [line 96]\n " color=yellow style=filled] +49 [label="49: Start getPtr_null_deref1\nFormals: \nLocals: t:int * \n DECLARE_LOCALS(&return,&t); [line 89]\n " color=yellow style=filled] 49 -> 53 ; 48 [label="48: Exit TranslateAsPtr_getRef \n " color=yellow style=filled] -47 [label="47: Start TranslateAsPtr_getRef\nFormals: this:int ** a:int b:int \nLocals: \n DECLARE_LOCALS(&return); [line 89]\n " color=yellow style=filled] +47 [label="47: Start TranslateAsPtr_getRef\nFormals: this:int ** a:int b:int \nLocals: \n DECLARE_LOCALS(&return); [line 83]\n " color=yellow style=filled] 47 -> 48 ; 46 [label="46: Exit TranslateAsPtr_getRef \n " color=yellow style=filled] -45 [label="45: Start TranslateAsPtr_getRef\nFormals: this:int **\nLocals: \n DECLARE_LOCALS(&return); [line 87]\n " color=yellow style=filled] +45 [label="45: Start TranslateAsPtr_getRef\nFormals: this:int **\nLocals: \n DECLARE_LOCALS(&return); [line 82]\n " color=yellow style=filled] 45 -> 46 ; 44 [label="44: Exit TranslateAsPtr_operator* \n " color=yellow style=filled] -43 [label="43: Start TranslateAsPtr_operator*\nFormals: this:int **\nLocals: \n DECLARE_LOCALS(&return); [line 85]\n " color=yellow style=filled] +43 [label="43: Start TranslateAsPtr_operator*\nFormals: this:int **\nLocals: \n DECLARE_LOCALS(&return); [line 81]\n " color=yellow style=filled] 43 -> 44 ; 42 [label="42: Exit TranslateAsPtr_getPtr \n " color=yellow style=filled] -41 [label="41: Start TranslateAsPtr_getPtr\nFormals: this:int ** a:int b:int \nLocals: \n DECLARE_LOCALS(&return); [line 82]\n " color=yellow style=filled] +41 [label="41: Start TranslateAsPtr_getPtr\nFormals: this:int ** a:int b:int \nLocals: \n DECLARE_LOCALS(&return); [line 79]\n " color=yellow style=filled] 41 -> 42 ; 40 [label="40: Exit TranslateAsPtr_getPtr \n " color=yellow style=filled] -39 [label="39: Start TranslateAsPtr_getPtr\nFormals: this:int **\nLocals: \n DECLARE_LOCALS(&return); [line 80]\n " color=yellow style=filled] +39 [label="39: Start TranslateAsPtr_getPtr\nFormals: this:int **\nLocals: \n DECLARE_LOCALS(&return); [line 78]\n " color=yellow style=filled] 39 -> 40 ; -38 [label="38: Call _fun_TranslateAsPtr_setPtr \n n$0=*&this:int ** [line 78]\n _=*n$0:int * [line 78]\n n$2=*&t:int * [line 78]\n _fun_TranslateAsPtr_setPtr(n$0:int **,n$2:int *) [line 78]\n " shape="box"] +38 [label="38: Call _fun_TranslateAsPtr_setPtr \n n$0=*&this:int ** [line 76]\n _=*n$0:int * [line 76]\n n$2=*&t:int * [line 76]\n _fun_TranslateAsPtr_setPtr(n$0:int **,n$2:int *) [line 76]\n " shape="box"] 38 -> 34 ; -37 [label="37: BinaryOperatorStmt: Assign \n n$0=*&this:int ** [line 93]\n n$1=*&v:int * [line 93]\n *n$0:void *=n$1 [line 93]\n " shape="box"] +37 [label="37: BinaryOperatorStmt: Assign \n n$0=*&this:int ** [line 86]\n n$1=*&v:int * [line 86]\n *n$0:void *=n$1 [line 86]\n " shape="box"] 37 -> 36 ; 36 [label="36: Exit TranslateAsPtr_setPtr \n " color=yellow style=filled] -35 [label="35: Start TranslateAsPtr_setPtr\nFormals: this:int ** v:int *\nLocals: \n DECLARE_LOCALS(&return); [line 93]\n " color=yellow style=filled] +35 [label="35: Start TranslateAsPtr_setPtr\nFormals: this:int ** v:int *\nLocals: \n DECLARE_LOCALS(&return); [line 86]\n " color=yellow style=filled] 35 -> 37 ; 34 [label="34: Exit TranslateAsPtr_TranslateAsPtr \n " color=yellow style=filled] -33 [label="33: Start TranslateAsPtr_TranslateAsPtr\nFormals: this:int ** t:int *\nLocals: \n DECLARE_LOCALS(&return); [line 78]\n " color=yellow style=filled] +33 [label="33: Start TranslateAsPtr_TranslateAsPtr\nFormals: this:int ** t:int *\nLocals: \n DECLARE_LOCALS(&return); [line 76]\n " color=yellow style=filled] 33 -> 38 ; -32 [label="32: DeclStmt \n *&a:int =0 [line 65]\n " shape="box"] +32 [label="32: DeclStmt \n *&a:int =0 [line 63]\n " shape="box"] 32 -> 31 ; -31 [label="31: Return Stmt \n n$0=_fun_derefFirstArg3(&a:int *,null:int *) [line 66]\n *&return:int =n$0 [line 66]\n " shape="box"] +31 [label="31: Return Stmt \n n$0=_fun_derefFirstArg3(&a:int *,null:int *) [line 64]\n *&return:int =n$0 [line 64]\n " shape="box"] 31 -> 30 ; 30 [label="30: Exit derefFirstArg3_null_deref \n " color=yellow style=filled] -29 [label="29: Start derefFirstArg3_null_deref\nFormals: \nLocals: a:int \n DECLARE_LOCALS(&return,&a); [line 64]\n " color=yellow style=filled] +29 [label="29: Start derefFirstArg3_null_deref\nFormals: \nLocals: a:int \n DECLARE_LOCALS(&return,&a); [line 62]\n " color=yellow style=filled] 29 -> 32 ; -28 [label="28: DeclStmt \n *&a:int =0 [line 60]\n " shape="box"] +28 [label="28: DeclStmt \n *&a:int =0 [line 58]\n " shape="box"] 28 -> 27 ; -27 [label="27: Return Stmt \n n$0=_fun_derefFirstArg3(null:int *,&a:int *) [line 61]\n *&return:int =n$0 [line 61]\n " shape="box"] +27 [label="27: Return Stmt \n n$0=_fun_derefFirstArg3(null:int *,&a:int *) [line 59]\n *&return:int =n$0 [line 59]\n " shape="box"] 27 -> 26 ; 26 [label="26: Exit derefFirstArg3_ok_deref \n " color=yellow style=filled] -25 [label="25: Start derefFirstArg3_ok_deref\nFormals: \nLocals: a:int \n DECLARE_LOCALS(&return,&a); [line 59]\n " color=yellow style=filled] +25 [label="25: Start derefFirstArg3_ok_deref\nFormals: \nLocals: a:int \n DECLARE_LOCALS(&return,&a); [line 57]\n " color=yellow style=filled] 25 -> 28 ; -24 [label="24: DeclStmt \n *&a:int =0 [line 55]\n " shape="box"] +24 [label="24: DeclStmt \n *&a:int =0 [line 53]\n " shape="box"] 24 -> 23 ; -23 [label="23: Return Stmt \n n$0=*&a:int * [line 56]\n *&return:int =n$0 [line 56]\n " shape="box"] +23 [label="23: Return Stmt \n n$0=*&a:int * [line 54]\n *&return:int =n$0 [line 54]\n " shape="box"] 23 -> 22 ; 22 [label="22: Exit derefFirstArg2_ok_deref \n " color=yellow style=filled] -21 [label="21: Start derefFirstArg2_ok_deref\nFormals: \nLocals: a:int \n DECLARE_LOCALS(&return,&a); [line 54]\n " color=yellow style=filled] +21 [label="21: Start derefFirstArg2_ok_deref\nFormals: \nLocals: a:int \n DECLARE_LOCALS(&return,&a); [line 52]\n " color=yellow style=filled] 21 -> 24 ; -20 [label="20: DeclStmt \n *&a:int =0 [line 50]\n " shape="box"] +20 [label="20: DeclStmt \n *&a:int =0 [line 48]\n " shape="box"] 20 -> 19 ; -19 [label="19: Return Stmt \n n$0=*null:int * [line 51]\n *&return:int =n$0 [line 51]\n " shape="box"] +19 [label="19: Return Stmt \n n$0=*null:int * [line 49]\n *&return:int =n$0 [line 49]\n " shape="box"] 19 -> 18 ; 18 [label="18: Exit derefFirstArg2_null_deref \n " color=yellow style=filled] -17 [label="17: Start derefFirstArg2_null_deref\nFormals: \nLocals: a:int \n DECLARE_LOCALS(&return,&a); [line 49]\n " color=yellow style=filled] +17 [label="17: Start derefFirstArg2_null_deref\nFormals: \nLocals: a:int \n DECLARE_LOCALS(&return,&a); [line 47]\n " color=yellow style=filled] 17 -> 20 ; -16 [label="16: DeclStmt \n *&a:int =0 [line 45]\n " shape="box"] +16 [label="16: DeclStmt \n *&a:int =0 [line 43]\n " shape="box"] 16 -> 15 ; -15 [label="15: Return Stmt \n n$0=*&a:int * [line 46]\n *&return:int =n$0 [line 46]\n " shape="box"] +15 [label="15: Return Stmt \n n$0=*&a:int * [line 44]\n *&return:int =n$0 [line 44]\n " shape="box"] 15 -> 14 ; 14 [label="14: Exit derefFirstArg_ok_deref \n " color=yellow style=filled] -13 [label="13: Start derefFirstArg_ok_deref\nFormals: \nLocals: a:int \n DECLARE_LOCALS(&return,&a); [line 44]\n " color=yellow style=filled] +13 [label="13: Start derefFirstArg_ok_deref\nFormals: \nLocals: a:int \n DECLARE_LOCALS(&return,&a); [line 42]\n " color=yellow style=filled] 13 -> 16 ; -12 [label="12: DeclStmt \n *&a:int =0 [line 40]\n " shape="box"] +12 [label="12: DeclStmt \n *&a:int =0 [line 38]\n " shape="box"] 12 -> 11 ; -11 [label="11: Return Stmt \n n$0=*null:int * [line 41]\n *&return:int =n$0 [line 41]\n " shape="box"] +11 [label="11: Return Stmt \n n$0=*null:int * [line 39]\n *&return:int =n$0 [line 39]\n " shape="box"] 11 -> 10 ; 10 [label="10: Exit derefFirstArg_null_deref \n " color=yellow style=filled] -9 [label="9: Start derefFirstArg_null_deref\nFormals: \nLocals: a:int \n DECLARE_LOCALS(&return,&a); [line 39]\n " color=yellow style=filled] +9 [label="9: Start derefFirstArg_null_deref\nFormals: \nLocals: a:int \n DECLARE_LOCALS(&return,&a); [line 37]\n " color=yellow style=filled] 9 -> 12 ; -8 [label="8: Return Stmt \n n$0=*&b:int * [line 35]\n n$1=*n$0:int [line 35]\n *&return:int =n$1 [line 35]\n " shape="box"] +8 [label="8: Return Stmt \n n$0=*&b:int * [line 33]\n n$1=*n$0:int [line 33]\n *&return:int =n$1 [line 33]\n " shape="box"] 8 -> 7 ; 7 [label="7: Exit derefFirstArg3 \n " color=yellow style=filled] -6 [label="6: Start derefFirstArg3\nFormals: a:int * b:int *\nLocals: \n DECLARE_LOCALS(&return); [line 33]\n " color=yellow style=filled] +6 [label="6: Start derefFirstArg3\nFormals: a:int * b:int *\nLocals: \n DECLARE_LOCALS(&return); [line 31]\n " color=yellow style=filled] 6 -> 8 ; -5 [label="5: Return Stmt \n n$0=*&b:int * [line 29]\n n$1=*n$0:int [line 29]\n *&return:int =n$1 [line 29]\n " shape="box"] +5 [label="5: Return Stmt \n n$0=*&b:int * [line 26]\n n$1=*n$0:int [line 26]\n *&return:int =n$1 [line 26]\n " shape="box"] 5 -> 4 ; 4 [label="4: Exit derefFirstArg2 \n " color=yellow style=filled] -3 [label="3: Start derefFirstArg2\nFormals: a:int * b:int *\nLocals: \n DECLARE_LOCALS(&return); [line 25]\n " color=yellow style=filled] +3 [label="3: Start derefFirstArg2\nFormals: a:int * b:int *\nLocals: \n DECLARE_LOCALS(&return); [line 22]\n " color=yellow style=filled] 3 -> 5 ;