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
master
Andrzej Kotulski 8 years ago committed by Facebook Github Bot 5
parent 4637bf877e
commit 41e51bc28c

@ -2,4 +2,3 @@
#define shared_ptr std__shared_ptr #define shared_ptr std__shared_ptr
#define unique_ptr std__unique_ptr #define unique_ptr std__unique_ptr
#define make_unique std__make_unique #define make_unique std__make_unique
#define private public

@ -2,4 +2,3 @@
#undef shared_ptr #undef shared_ptr
#undef unique_ptr #undef unique_ptr
#undef make_unique #undef make_unique
#undef private

@ -15,3 +15,6 @@ namespace infer_traits {
template <class T> template <class T>
class TranslateAsType {}; class TranslateAsType {};
} // namespace infer_traits } // namespace infer_traits
#define INFER_MODEL_AS_DEREF_FIRST_ARG \
__attribute__((deprecated("__infer_replace_with_deref_first_arg"))) {}

@ -240,18 +240,12 @@ class shared_ptr : public std__shared_ptr<T> {
} }
// observers: // observers:
T* get() const noexcept __attribute__((deprecated( T* get() const noexcept INFER_MODEL_AS_DEREF_FIRST_ARG;
"__infer_replace_with_deref_first_arg"))) { /* return
model_get(__cast_to_infer_ptr(this)); */ typename std::add_lvalue_reference<T>::type operator*() const
} noexcept INFER_MODEL_AS_DEREF_FIRST_ARG;
typename std::add_lvalue_reference<T>::type operator*() const noexcept
__attribute__((deprecated("__infer_replace_with_deref_first_arg"))) { T* operator->() const noexcept INFER_MODEL_AS_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));*/
}
long use_count() const noexcept { return 2; /* FIXME */ } long use_count() const noexcept { return 2; /* FIXME */ }
bool unique() const noexcept { return use_count() == 1; /* FIXME */ } bool unique() const noexcept { return use_count() == 1; /* FIXME */ }
explicit operator bool() const noexcept { explicit operator bool() const noexcept {

@ -142,13 +142,11 @@ struct unique_ptr {
return *this; return *this;
} }
typename add_lvalue_reference<_Tp>::type operator*() const 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 pointer operator->() const INFER_MODEL_AS_DEREF_FIRST_ARG;
__attribute__((deprecated("__infer_replace_with_deref_first_arg"))) {}
pointer get() const pointer get() const INFER_MODEL_AS_DEREF_FIRST_ARG;
__attribute__((deprecated("__infer_replace_with_deref_first_arg"))) {}
typedef typename remove_reference<deleter_type>::type& _Dp_reference; typedef typename remove_reference<deleter_type>::type& _Dp_reference;
typedef const typename remove_reference<deleter_type>::type& typedef const typename remove_reference<deleter_type>::type&
@ -159,8 +157,7 @@ struct unique_ptr {
explicit operator bool() const { explicit operator bool() const {
return !!(bool)(model_get(__cast_to_infer_ptr(this))); return !!(bool)(model_get(__cast_to_infer_ptr(this)));
} }
pointer release() pointer release() INFER_MODEL_AS_DEREF_FIRST_ARG;
__attribute__((deprecated("__infer_replace_with_deref_first_arg"))) {}
void reset(pointer p = nullptr) { model_set(__cast_to_infer_ptr(this), p); } 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 typename add_lvalue_reference<_Tp>::type operator[](size_t i) const
__attribute__((deprecated("__infer_replace_with_deref_first_arg"))) {} 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<deleter_type>::type& _Dp_reference; typedef typename remove_reference<deleter_type>::type& _Dp_reference;
typedef const typename remove_reference<deleter_type>::type& typedef const typename remove_reference<deleter_type>::type&
_Dp_const_reference; _Dp_const_reference;
@ -302,8 +297,7 @@ struct unique_ptr<_Tp[], _Dp> {
explicit operator bool() const { explicit operator bool() const {
return !!(bool)(model_get(__cast_to_infer_ptr(this))); return !!(bool)(model_get(__cast_to_infer_ptr(this)));
} }
pointer release() pointer release() INFER_MODEL_AS_DEREF_FIRST_ARG;
__attribute__((deprecated("__infer_replace_with_deref_first_arg"))) {}
void reset(pointer p = nullptr) { model_set(__cast_to_infer_ptr(this), p); } void reset(pointer p = nullptr) { model_set(__cast_to_infer_ptr(this), p); }

@ -16,12 +16,9 @@
/* Test for passing function attributes to infer via __deprecated__ attribute */ /* Test for passing function attributes to infer via __deprecated__ attribute */
// basic test of C function with __infer_replace_with_deref_first_arg attribute // basic test of C function with __infer_replace_with_deref_first_arg attribute
int derefFirstArg(int* a, int* b) int derefFirstArg(int* a, int* b) INFER_MODEL_AS_DEREF_FIRST_ARG;
__attribute__((deprecated("__infer_replace_with_deref_first_arg"))) {
/* equivalent in real code:
return *a; */
}
// test directly with deprecated attribute
int derefFirstArg2(int* a, int* b) int derefFirstArg2(int* a, int* b)
__attribute__((deprecated("__infer_replace_with_deref_first_arg"))) { __attribute__((deprecated("__infer_replace_with_deref_first_arg"))) {
/* equivalent in real code: /* equivalent in real code:
@ -30,6 +27,7 @@ int derefFirstArg2(int* a, int* b)
// should be used // should be used
} }
// test with wrong deprecated attribute
int derefFirstArg3(int* a, int* b) __attribute__((deprecated("__infer_typo"))) { int derefFirstArg3(int* a, int* b) __attribute__((deprecated("__infer_typo"))) {
/* equivalent in real code: */ /* equivalent in real code: */
return *b; // there isn't any known attribute with this name, use semantics return *b; // there isn't any known attribute with this name, use semantics
@ -77,17 +75,12 @@ struct TranslateAsPtr {
friend class infer_traits::TranslateAsType<T*>; friend class infer_traits::TranslateAsType<T*>;
TranslateAsPtr(T* t = nullptr) { setPtr(t); } TranslateAsPtr(T* t = nullptr) { setPtr(t); }
/* calls to those functions are supposed to be translated as `*this` */ /* calls to those functions are supposed to be translated as `*this` */
T* getPtr() T* getPtr() INFER_MODEL_AS_DEREF_FIRST_ARG;
__attribute__((deprecated("__infer_replace_with_deref_first_arg"))) {} T* getPtr(int a, int b) INFER_MODEL_AS_DEREF_FIRST_ARG;
T* getPtr(int a, int b)
__attribute__((deprecated("__infer_replace_with_deref_first_arg"))) {}
/* calls to those functions are supposed to be translated as `**this` */ /* calls to those functions are supposed to be translated as `**this` */
T& operator*() T& operator*() INFER_MODEL_AS_DEREF_FIRST_ARG;
__attribute__((deprecated("__infer_replace_with_deref_first_arg"))) {} T& getRef() INFER_MODEL_AS_DEREF_FIRST_ARG;
T& getRef() T& getRef(int a, int b) INFER_MODEL_AS_DEREF_FIRST_ARG;
__attribute__((deprecated("__infer_replace_with_deref_first_arg"))) {}
T& getRef(int a, int b)
__attribute__((deprecated("__infer_replace_with_deref_first_arg"))) {}
// same trick we do for setting value of shared_ptr, look there for details // same trick we do for setting value of shared_ptr, look there for details
void setPtr(T* v) { *((void**)(this)) = v; } void setPtr(T* v) { *((void**)(this)) = v; }

@ -1,350 +1,350 @@
/* @generated */ /* @generated */
digraph iCFG { 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 ; 95 -> 94 ;
94 [label="94: DeclStmt \n _fun_TranslateAsPtr<int>_TranslateAsPtr(&t:int **,null:int *) [line 148]\n n$4=*&t:int * [line 148]\n " shape="box"] 94 [label="94: DeclStmt \n _fun_TranslateAsPtr<int>_TranslateAsPtr(&t:int **,null:int *) [line 141]\n n$4=*&t:int * [line 141]\n " shape="box"]
94 -> 93 ; 94 -> 93 ;
93 [label="93: Call _fun_TranslateAsPtr<int>_setPtr \n _=*&t:int * [line 149]\n _fun_TranslateAsPtr<int>_setPtr(&t:int *&,&a:int *) [line 149]\n " shape="box"] 93 [label="93: Call _fun_TranslateAsPtr<int>_setPtr \n _=*&t:int * [line 142]\n _fun_TranslateAsPtr<int>_setPtr(&t:int *&,&a:int *) [line 142]\n " shape="box"]
93 -> 92 ; 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 ; 92 -> 91 ;
91 [label="91: Exit getRef_ok_deref \n " color=yellow style=filled] 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 ; 90 -> 95 ;
89 [label="89: DeclStmt \n _fun_TranslateAsPtr<int>_TranslateAsPtr(&t:int **,null:int *) [line 141]\n n$4=*&t:int * [line 141]\n " shape="box"] 89 [label="89: DeclStmt \n _fun_TranslateAsPtr<int>_TranslateAsPtr(&t:int **,null:int *) [line 134]\n n$4=*&t:int * [line 134]\n " shape="box"]
89 -> 88 ; 89 -> 88 ;
88 [label="88: Call _fun_TranslateAsPtr<int>_setPtr \n _=*&t:int * [line 142]\n _fun_TranslateAsPtr<int>_setPtr(&t:int *&,null:int *) [line 142]\n " shape="box"] 88 [label="88: Call _fun_TranslateAsPtr<int>_setPtr \n _=*&t:int * [line 135]\n _fun_TranslateAsPtr<int>_setPtr(&t:int *&,null:int *) [line 135]\n " shape="box"]
88 -> 87 ; 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 ; 87 -> 86 ;
86 [label="86: Exit getRef_null_deref2 \n " color=yellow style=filled] 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 ; 85 -> 89 ;
84 [label="84: DeclStmt \n _fun_TranslateAsPtr<int>_TranslateAsPtr(&t:int **,null:int *) [line 135]\n n$4=*&t:int * [line 135]\n " shape="box"] 84 [label="84: DeclStmt \n _fun_TranslateAsPtr<int>_TranslateAsPtr(&t:int **,null:int *) [line 128]\n n$4=*&t:int * [line 128]\n " shape="box"]
84 -> 83 ; 84 -> 83 ;
83 [label="83: Call _fun_TranslateAsPtr<int>_setPtr \n _=*&t:int * [line 136]\n _fun_TranslateAsPtr<int>_setPtr(&t:int *&,null:int *) [line 136]\n " shape="box"] 83 [label="83: Call _fun_TranslateAsPtr<int>_setPtr \n _=*&t:int * [line 129]\n _fun_TranslateAsPtr<int>_setPtr(&t:int *&,null:int *) [line 129]\n " shape="box"]
83 -> 82 ; 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 ; 82 -> 81 ;
81 [label="81: Exit getRef_null_deref1 \n " color=yellow style=filled] 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 ; 80 -> 84 ;
79 [label="79: DeclStmt \n _fun_TranslateAsPtr<int>_TranslateAsPtr(&t:int **,null:int *) [line 129]\n n$4=*&t:int * [line 129]\n " shape="box"] 79 [label="79: DeclStmt \n _fun_TranslateAsPtr<int>_TranslateAsPtr(&t:int **,null:int *) [line 122]\n n$4=*&t:int * [line 122]\n " shape="box"]
79 -> 78 ; 79 -> 78 ;
78 [label="78: Call _fun_TranslateAsPtr<int>_setPtr \n _=*&t:int * [line 130]\n _fun_TranslateAsPtr<int>_setPtr(&t:int *&,&a:int *) [line 130]\n " shape="box"] 78 [label="78: Call _fun_TranslateAsPtr<int>_setPtr \n _=*&t:int * [line 123]\n _fun_TranslateAsPtr<int>_setPtr(&t:int *&,&a:int *) [line 123]\n " shape="box"]
78 -> 77 ; 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 ; 77 -> 76 ;
76 [label="76: Exit operator_star_ok_deref \n " color=yellow style=filled] 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 ; 75 -> 79 ;
74 [label="74: DeclStmt \n _fun_TranslateAsPtr<int>_TranslateAsPtr(&t:int **,null:int *) [line 122]\n n$4=*&t:int * [line 122]\n " shape="box"] 74 [label="74: DeclStmt \n _fun_TranslateAsPtr<int>_TranslateAsPtr(&t:int **,null:int *) [line 115]\n n$4=*&t:int * [line 115]\n " shape="box"]
74 -> 73 ; 74 -> 73 ;
73 [label="73: Call _fun_TranslateAsPtr<int>_setPtr \n _=*&t:int * [line 123]\n _fun_TranslateAsPtr<int>_setPtr(&t:int *&,null:int *) [line 123]\n " shape="box"] 73 [label="73: Call _fun_TranslateAsPtr<int>_setPtr \n _=*&t:int * [line 116]\n _fun_TranslateAsPtr<int>_setPtr(&t:int *&,null:int *) [line 116]\n " shape="box"]
73 -> 72 ; 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 ; 72 -> 71 ;
71 [label="71: Exit operator_star_null_deref2 \n " color=yellow style=filled] 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 ; 70 -> 74 ;
69 [label="69: DeclStmt \n _fun_TranslateAsPtr<int>_TranslateAsPtr(&t:int **,null:int *) [line 116]\n n$3=*&t:int * [line 116]\n " shape="box"] 69 [label="69: DeclStmt \n _fun_TranslateAsPtr<int>_TranslateAsPtr(&t:int **,null:int *) [line 109]\n n$3=*&t:int * [line 109]\n " shape="box"]
69 -> 68 ; 69 -> 68 ;
68 [label="68: Call _fun_TranslateAsPtr<int>_setPtr \n _=*&t:int * [line 117]\n _fun_TranslateAsPtr<int>_setPtr(&t:int *&,null:int *) [line 117]\n " shape="box"] 68 [label="68: Call _fun_TranslateAsPtr<int>_setPtr \n _=*&t:int * [line 110]\n _fun_TranslateAsPtr<int>_setPtr(&t:int *&,null:int *) [line 110]\n " shape="box"]
68 -> 67 ; 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 ; 67 -> 66 ;
66 [label="66: Exit operator_star_null_deref1 \n " color=yellow style=filled] 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 ; 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 ; 64 -> 63 ;
63 [label="63: DeclStmt \n _fun_TranslateAsPtr<int>_TranslateAsPtr(&t:int **,null:int *) [line 110]\n n$4=*&t:int * [line 110]\n " shape="box"] 63 [label="63: DeclStmt \n _fun_TranslateAsPtr<int>_TranslateAsPtr(&t:int **,null:int *) [line 103]\n n$4=*&t:int * [line 103]\n " shape="box"]
63 -> 62 ; 63 -> 62 ;
62 [label="62: Call _fun_TranslateAsPtr<int>_setPtr \n _=*&t:int * [line 111]\n _fun_TranslateAsPtr<int>_setPtr(&t:int *&,&a:int *) [line 111]\n " shape="box"] 62 [label="62: Call _fun_TranslateAsPtr<int>_setPtr \n _=*&t:int * [line 104]\n _fun_TranslateAsPtr<int>_setPtr(&t:int *&,&a:int *) [line 104]\n " shape="box"]
62 -> 61 ; 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 ; 61 -> 60 ;
60 [label="60: Exit getPtr_ok_deref \n " color=yellow style=filled] 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 ; 59 -> 64 ;
58 [label="58: DeclStmt \n _fun_TranslateAsPtr<int>_TranslateAsPtr(&t:int **,null:int *) [line 103]\n n$4=*&t:int * [line 103]\n " shape="box"] 58 [label="58: DeclStmt \n _fun_TranslateAsPtr<int>_TranslateAsPtr(&t:int **,null:int *) [line 96]\n n$4=*&t:int * [line 96]\n " shape="box"]
58 -> 57 ; 58 -> 57 ;
57 [label="57: Call _fun_TranslateAsPtr<int>_setPtr \n _=*&t:int * [line 104]\n _fun_TranslateAsPtr<int>_setPtr(&t:int *&,null:int *) [line 104]\n " shape="box"] 57 [label="57: Call _fun_TranslateAsPtr<int>_setPtr \n _=*&t:int * [line 97]\n _fun_TranslateAsPtr<int>_setPtr(&t:int *&,null:int *) [line 97]\n " shape="box"]
57 -> 56 ; 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 ; 56 -> 55 ;
55 [label="55: Exit getPtr_null_deref2 \n " color=yellow style=filled] 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 ; 54 -> 58 ;
53 [label="53: DeclStmt \n _fun_TranslateAsPtr<int>_TranslateAsPtr(&t:int **,null:int *) [line 97]\n n$4=*&t:int * [line 97]\n " shape="box"] 53 [label="53: DeclStmt \n _fun_TranslateAsPtr<int>_TranslateAsPtr(&t:int **,null:int *) [line 90]\n n$4=*&t:int * [line 90]\n " shape="box"]
53 -> 52 ; 53 -> 52 ;
52 [label="52: Call _fun_TranslateAsPtr<int>_setPtr \n _=*&t:int * [line 98]\n _fun_TranslateAsPtr<int>_setPtr(&t:int *&,null:int *) [line 98]\n " shape="box"] 52 [label="52: Call _fun_TranslateAsPtr<int>_setPtr \n _=*&t:int * [line 91]\n _fun_TranslateAsPtr<int>_setPtr(&t:int *&,null:int *) [line 91]\n " shape="box"]
52 -> 51 ; 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 ; 51 -> 50 ;
50 [label="50: Exit getPtr_null_deref1 \n " color=yellow style=filled] 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 ; 49 -> 53 ;
48 [label="48: Exit TranslateAsPtr<int>_getRef \n " color=yellow style=filled] 48 [label="48: Exit TranslateAsPtr<int>_getRef \n " color=yellow style=filled]
47 [label="47: Start TranslateAsPtr<int>_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<int>_getRef\nFormals: this:int ** a:int b:int \nLocals: \n DECLARE_LOCALS(&return); [line 83]\n " color=yellow style=filled]
47 -> 48 ; 47 -> 48 ;
46 [label="46: Exit TranslateAsPtr<int>_getRef \n " color=yellow style=filled] 46 [label="46: Exit TranslateAsPtr<int>_getRef \n " color=yellow style=filled]
45 [label="45: Start TranslateAsPtr<int>_getRef\nFormals: this:int **\nLocals: \n DECLARE_LOCALS(&return); [line 87]\n " color=yellow style=filled] 45 [label="45: Start TranslateAsPtr<int>_getRef\nFormals: this:int **\nLocals: \n DECLARE_LOCALS(&return); [line 82]\n " color=yellow style=filled]
45 -> 46 ; 45 -> 46 ;
44 [label="44: Exit TranslateAsPtr<int>_operator* \n " color=yellow style=filled] 44 [label="44: Exit TranslateAsPtr<int>_operator* \n " color=yellow style=filled]
43 [label="43: Start TranslateAsPtr<int>_operator*\nFormals: this:int **\nLocals: \n DECLARE_LOCALS(&return); [line 85]\n " color=yellow style=filled] 43 [label="43: Start TranslateAsPtr<int>_operator*\nFormals: this:int **\nLocals: \n DECLARE_LOCALS(&return); [line 81]\n " color=yellow style=filled]
43 -> 44 ; 43 -> 44 ;
42 [label="42: Exit TranslateAsPtr<int>_getPtr \n " color=yellow style=filled] 42 [label="42: Exit TranslateAsPtr<int>_getPtr \n " color=yellow style=filled]
41 [label="41: Start TranslateAsPtr<int>_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<int>_getPtr\nFormals: this:int ** a:int b:int \nLocals: \n DECLARE_LOCALS(&return); [line 79]\n " color=yellow style=filled]
41 -> 42 ; 41 -> 42 ;
40 [label="40: Exit TranslateAsPtr<int>_getPtr \n " color=yellow style=filled] 40 [label="40: Exit TranslateAsPtr<int>_getPtr \n " color=yellow style=filled]
39 [label="39: Start TranslateAsPtr<int>_getPtr\nFormals: this:int **\nLocals: \n DECLARE_LOCALS(&return); [line 80]\n " color=yellow style=filled] 39 [label="39: Start TranslateAsPtr<int>_getPtr\nFormals: this:int **\nLocals: \n DECLARE_LOCALS(&return); [line 78]\n " color=yellow style=filled]
39 -> 40 ; 39 -> 40 ;
38 [label="38: Call _fun_TranslateAsPtr<int>_setPtr \n n$0=*&this:int ** [line 78]\n _=*n$0:int * [line 78]\n n$2=*&t:int * [line 78]\n _fun_TranslateAsPtr<int>_setPtr(n$0:int **,n$2:int *) [line 78]\n " shape="box"] 38 [label="38: Call _fun_TranslateAsPtr<int>_setPtr \n n$0=*&this:int ** [line 76]\n _=*n$0:int * [line 76]\n n$2=*&t:int * [line 76]\n _fun_TranslateAsPtr<int>_setPtr(n$0:int **,n$2:int *) [line 76]\n " shape="box"]
38 -> 34 ; 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 ; 37 -> 36 ;
36 [label="36: Exit TranslateAsPtr<int>_setPtr \n " color=yellow style=filled] 36 [label="36: Exit TranslateAsPtr<int>_setPtr \n " color=yellow style=filled]
35 [label="35: Start TranslateAsPtr<int>_setPtr\nFormals: this:int ** v:int *\nLocals: \n DECLARE_LOCALS(&return); [line 93]\n " color=yellow style=filled] 35 [label="35: Start TranslateAsPtr<int>_setPtr\nFormals: this:int ** v:int *\nLocals: \n DECLARE_LOCALS(&return); [line 86]\n " color=yellow style=filled]
35 -> 37 ; 35 -> 37 ;
34 [label="34: Exit TranslateAsPtr<int>_TranslateAsPtr \n " color=yellow style=filled] 34 [label="34: Exit TranslateAsPtr<int>_TranslateAsPtr \n " color=yellow style=filled]
33 [label="33: Start TranslateAsPtr<int>_TranslateAsPtr\nFormals: this:int ** t:int *\nLocals: \n DECLARE_LOCALS(&return); [line 78]\n " color=yellow style=filled] 33 [label="33: Start TranslateAsPtr<int>_TranslateAsPtr\nFormals: this:int ** t:int *\nLocals: \n DECLARE_LOCALS(&return); [line 76]\n " color=yellow style=filled]
33 -> 38 ; 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 ; 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 ; 31 -> 30 ;
30 [label="30: Exit derefFirstArg3_null_deref \n " color=yellow style=filled] 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 ; 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 ; 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 ; 27 -> 26 ;
26 [label="26: Exit derefFirstArg3_ok_deref \n " color=yellow style=filled] 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 ; 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 ; 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 ; 23 -> 22 ;
22 [label="22: Exit derefFirstArg2_ok_deref \n " color=yellow style=filled] 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 ; 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 ; 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 ; 19 -> 18 ;
18 [label="18: Exit derefFirstArg2_null_deref \n " color=yellow style=filled] 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 ; 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 ; 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 ; 15 -> 14 ;
14 [label="14: Exit derefFirstArg_ok_deref \n " color=yellow style=filled] 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 ; 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 ; 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 ; 11 -> 10 ;
10 [label="10: Exit derefFirstArg_null_deref \n " color=yellow style=filled] 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 ; 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 ; 8 -> 7 ;
7 [label="7: Exit derefFirstArg3 \n " color=yellow style=filled] 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 ; 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 ; 5 -> 4 ;
4 [label="4: Exit derefFirstArg2 \n " color=yellow style=filled] 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 ; 3 -> 5 ;

Loading…
Cancel
Save