Changeset b5629d8
- Timestamp:
- Dec 3, 2020, 1:49:01 PM (4 years ago)
- Branches:
- ADT, arm-eh, ast-experimental, enum, forall-pointer-decay, jacob/cs343-translation, master, new-ast-unique-expr, pthread-emulation, qualifiedEnum
- Children:
- 62e456f, ab0257b9
- Parents:
- f0d67e5 (diff), fa11053 (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the(diff)
links above to see all the changes relative to each parent. - Files:
-
- 5 added
- 38 edited
- 4 moved
Legend:
- Unmodified
- Added
- Removed
-
libcfa/src/bits/collection.hfa
rf0d67e5 rb5629d8 13 13 // return true iff *this is an element of a collection 14 14 bool listed( Colable & co ) with( co ) { // pre: this != 0 15 return next != 0 ;15 return next != 0p; 16 16 } 17 17 … … 23 23 return cp->next; 24 24 } 25 26 forall( dtype T ) { 27 T *& Next( T * n ) { 28 return (T *)Next( (Colable *)n ); 29 } 30 31 bool listed( T * n ) { 32 return Next( (Colable *)n ) != 0p; 33 } 34 } // distribution 25 35 } // distribution 36 26 37 27 38 struct Collection { … … 41 52 return root == 0p; 42 53 } 54 43 55 void * head( Collection & collection ) with( collection ) { 44 56 return root; … … 55 67 curr = 0p; 56 68 } // post: elts = null 69 70 forall( dtype T ) { 71 T * Curr( ColIter & ci ) with( ci ) { 72 return (T *)curr; 73 } 74 } // distribution 57 75 } // distribution -
libcfa/src/bits/queue.hfa
rf0d67e5 rb5629d8 14 14 return (T *)head( (Collection &)q ); 15 15 } // post: empty() & head() == 0 | !empty() & head() in *q 16 17 bool empty( Queue(T) & q ) with( q ) { // 0 <=> *q contains no elements18 return empty( (Collection &)q );19 }20 21 bool listed( T * n ) {22 return Next( (Colable *)n ) != 0;23 }24 25 T *& Next( T * n ) {26 return (T *)Next( (Colable *)n );27 }28 29 T * Root( Queue(T) & q ) with( q ) {30 return (T *)root;31 }32 16 33 17 void ?{}( Queue(T) &, const Queue(T) & ) = void; // no copy … … 55 39 #endif // __CFA_DEBUG__ 56 40 if ( last ) { 57 Next( n ) = Root( q );41 Next( n ) = head( q ); 58 42 q.root = n; 59 43 } else { … … 81 65 if ( root ) { 82 66 root = Next( root ); 83 if ( Root( q ) == t ) {67 if ( head( q ) == t ) { 84 68 root = last = 0p; // only one element 85 69 } … … 132 116 root = from.root; 133 117 } else { // "to" list not empty 134 Next( last ) = Root( from );118 Next( last ) = head( from ); 135 119 } 136 120 last = from.last; … … 148 132 to.last = n; // end of "to" list 149 133 from.root = Next( n ); // start of "from" list 150 if ( n == Root( from ) ) { // last node in list ?134 if ( n == head( from ) ) { // last node in list ? 151 135 from.root = from.last = 0p; // mark "from" list empty 152 136 } else { … … 164 148 165 149 inline { 166 // wrappers to make ColIter have T167 T * Curr( QueueIter(T) & qi ) with( qi ) {168 return (T *)curr;169 }170 171 150 void ?{}( QueueIter(T) & qi ) with( qi ) { 172 151 ((ColIter &)qi){}; … … 187 166 } // post: curr = {e in q} 188 167 189 bool ?>>?( QueueIter(T) & qi, T *& tp ) with( qi ) {168 bool ?>>?( QueueIter(T) & qi, T && tp ) with( qi ) { 190 169 if ( curr ) { 191 tp = Curr( qi );170 &tp = Curr( qi ); 192 171 T * n = Next( Curr( qi ) ); 193 172 curr = (n == Curr( qi ) ) ? 0p : n; 194 } else tp = 0p;195 return tp != 0p;173 } else &tp = 0p; 174 return &tp != 0p; 196 175 } 197 176 // post: elts == null & !operator>>(tp) | elts != null & *tp' in elts & elts' == elts - *tp & operator>>(tp) -
libcfa/src/bits/queue_example.cfa
rf0d67e5 rb5629d8 17 17 Queue(Fred) fred; 18 18 QueueIter(Fred) fredIter = { fred }; 19 Fred * f; 20 int i; 19 Fred & f; 21 20 22 21 sout | nlOff; // turn off auto newline 23 22 24 23 for ( ; fredIter >> f; ) { // empty list 25 sout | f ->i | ' ';24 sout | f.i | ' '; 26 25 } 27 26 sout | "empty" | nl; 28 27 29 for ( i = 0; i < 10; i += 1) {28 for ( i; 10 ) { 30 29 add( fred, new( 2 * i ) ); 31 30 } 32 31 33 for ( over( fredIter, fred ); fredIter >> f; ) {34 sout | f ->i | ' ';32 for ( QueueIter(Fred) iter = { fred }; iter >> f; ) { 33 sout | f.i | ' '; 35 34 } 36 35 sout | nl; 37 36 38 for ( i = 0; i < 9; i += 1) {37 for ( i; 9 ) { 39 38 delete( drop( fred ) ); 40 39 } 41 40 42 41 for ( over( fredIter, fred ); fredIter >> f; ) { 43 sout | f ->i | ' ';42 sout | f.i | ' '; 44 43 } 45 44 sout | nl; 46 45 47 for ( i = 0; i < 10; i += 1) {46 for ( i; 10 ) { 48 47 add( fred, new( 2 * i + 1 ) ); 49 48 } 50 49 for ( over( fredIter, fred ); fredIter >> f; ) { 51 sout | f ->i | ' ';50 sout | f.i | ' '; 52 51 } 53 52 sout | nl; 54 53 55 54 for ( over( fredIter, fred ); fredIter >> f; ) { 56 delete( f );55 delete( &f ); 57 56 } 58 57 … … 71 70 Queue(Mary) mary; 72 71 QueueIter(Mary) maryIter = { mary }; 73 Mary *m;72 Mary & m; 74 73 75 74 for ( ; maryIter >> m; ) { // empty list 76 sout | m ->i | m->j | ' ';75 sout | m.i | m.j | ' '; 77 76 } 78 77 sout | "empty" | nl; 79 78 80 for ( i = 0; i < 10; i += 1) {79 for ( i; 10 ) { 81 80 add( mary, new( 2 * i ) ); 82 81 } 83 82 84 for ( over( maryIter, mary ); maryIter >> m; ) {85 sout | m ->i | m->j | ' ';83 for ( QueueIter(Mary) iter = { mary }; iter >> m; ) { 84 sout | m.i | m.j | ' '; 86 85 } 87 86 sout | nl; 88 87 89 for ( i = 0; i < 9; i += 1) {88 for ( i; 9 ) { 90 89 delete( drop( mary ) ); 91 90 } 92 91 93 92 for ( over( maryIter, mary ); maryIter >> m; ) { 94 sout | m ->i | m->j | ' ';93 sout | m.i | m.j | ' '; 95 94 } 96 95 sout | nl; 97 96 98 for ( i = 0; i < 10; i += 1) {97 for ( i; 10 ) { 99 98 add( mary, new( 2 * i + 1 ) ); 100 99 } 101 100 for ( over( maryIter, mary ); maryIter >> m; ) { 102 sout | m ->i | m->j | ' ';101 sout | m.i | m.j | ' '; 103 102 } 104 103 sout | nl; 105 104 106 105 for ( over( maryIter, mary ); maryIter >> m; ) { 107 delete( m );106 delete( &m ); 108 107 } 109 108 } -
libcfa/src/bits/sequence.hfa
rf0d67e5 rb5629d8 10 10 inline { 11 11 void ?{}( Seqable & sq ) with( sq ) { 12 ((Colable & 12 ((Colable &) sq){}; 13 13 back = 0p; 14 14 } // post: ! listed() … … 34 34 } // post: empty() & head() == 0 | !empty() & head() in *s 35 35 36 bool empty( Sequence(T) & s ) with( s ) { // 0 <=> *s contains no elements37 return empty( (Collection &)s );38 }39 40 bool listed( T * n ) {41 return Next( (Colable *)n ) != 0;42 }43 44 T *& Next( T * n ) {45 return (T *)Next( (Colable *)n );46 }47 48 36 T *& Back( T * n ) { 49 37 return (T *)Back( (Seqable *)n ); 50 }51 52 T * Root( Sequence(T) & s ) with( s ) {53 return (T *)root;54 38 } 55 39 … … 62 46 63 47 // Return a pointer to the last sequence element, without removing it. 64 T *tail( Sequence(T) & s ) with( s ) {65 return root ? (T *)Back( Root( s ) ) :0p; // needs cast?48 T & tail( Sequence(T) & s ) with( s ) { 49 return root ? (T &)Back( head( s ) ) : *0p; // needs cast? 66 50 } // post: empty() & tail() == 0 | !empty() & tail() in *s 67 51 … … 71 55 if ( ! listed( n ) ) abort( "(Sequence &)%p.succ( %p ) : Node is not on a list.", &s, n ); 72 56 #endif // __CFA_DEBUG__ 73 return Next( n ) == Root( s ) ? 0p : Next( n );57 return Next( n ) == head( s ) ? 0p : Next( n ); 74 58 } // post: n == tail() & succ(n) == 0 | n != tail() & *succ(n) in *s 75 59 … … 79 63 if ( ! listed( n ) ) abort( "(Sequence &)%p.pred( %p ) : Node is not on a list.", &s, n ); 80 64 #endif // __CFA_DEBUG__ 81 return n == Root( s ) ? 0p : Back( n );65 return n == head( s ) ? 0p : Back( n ); 82 66 } // post: n == head() & head(n) == 0 | n != head() & *pred(n) in *s 83 67 84 68 85 69 // Insert *n into the sequence before *bef, or at the end if bef == 0. 86 void insertBef( Sequence(T) & s, T * n, T *bef ) with( s ) { // pre: !n->listed() & *bef in *s87 #ifdef __CFA_DEBUG__ 88 if ( listed( n ) ) abort( "(Sequence &)%p.insertBef( %p, %p ) : Node is already on another list.", &s, n,bef );89 #endif // __CFA_DEBUG__ 90 if ( bef == Root( s ) ) { // must change root70 void insertBef( Sequence(T) & s, T & n, T & bef ) with( s ) { // pre: !n->listed() & *bef in *s 71 #ifdef __CFA_DEBUG__ 72 if ( listed( &n ) ) abort( "(Sequence &)%p.insertBef( %p, %p ) : Node is already on another list.", &s, n, &bef ); 73 #endif // __CFA_DEBUG__ 74 if ( &bef == head( s ) ) { // must change root 91 75 if ( root ) { 92 Next( n ) = Root( s );93 Back( n ) = Back( Root( s ) );76 Next( &n ) = head( s ); 77 Back( &n ) = Back( head( s ) ); 94 78 // inserted node must be consistent before it is seen 95 79 asm( "" : : : "memory" ); // prevent code movement across barrier 96 Back( Root( s ) ) =n;97 Next( Back( n ) ) =n;80 Back( head( s ) ) = &n; 81 Next( Back( &n ) ) = &n; 98 82 } else { 99 Next( n ) =n;100 Back( n ) =n;83 Next( &n ) = &n; 84 Back( &n ) = &n; 101 85 } // if 102 86 // inserted node must be consistent before it is seen 103 87 asm( "" : : : "memory" ); // prevent code movement across barrier 104 root = n;88 root = &n; 105 89 } else { 106 if ( ! bef ) bef = Root( s );107 Next( n ) =bef;108 Back( n ) = Back(bef );90 if ( ! &bef ) &bef = head( s ); 91 Next( &n ) = &bef; 92 Back( &n ) = Back( &bef ); 109 93 // inserted node must be consistent before it is seen 110 94 asm( "" : : : "memory" ); // prevent code movement across barrier 111 Back( bef ) =n;112 Next( Back( n ) ) =n;95 Back( &bef ) = &n; 96 Next( Back( &n ) ) = &n; 113 97 } // if 114 98 } // post: n->listed() & *n in *s & succ(n) == bef … … 116 100 117 101 // Insert *n into the sequence after *aft, or at the beginning if aft == 0. 118 void insertAft( Sequence(T) & s, T *aft, T *n ) with( s ) { // pre: !n->listed() & *aft in *s119 #ifdef __CFA_DEBUG__ 120 if ( listed( n ) ) abort( "(Sequence &)%p.insertAft( %p, %p ) : Node is already on another list.", &s, aft,n );121 #endif // __CFA_DEBUG__ 122 if ( ! aft ) { // must change root102 void insertAft( Sequence(T) & s, T & aft, T & n ) with( s ) { // pre: !n->listed() & *aft in *s 103 #ifdef __CFA_DEBUG__ 104 if ( listed( &n ) ) abort( "(Sequence &)%p.insertAft( %p, %p ) : Node is already on another list.", &s, &aft, &n ); 105 #endif // __CFA_DEBUG__ 106 if ( ! &aft ) { // must change root 123 107 if ( root ) { 124 Next( n ) = Root( s );125 Back( n ) = Back( Root( s ) );108 Next( &n ) = head( s ); 109 Back( &n ) = Back( head( s ) ); 126 110 // inserted node must be consistent before it is seen 127 111 asm( "" : : : "memory" ); // prevent code movement across barrier 128 Back( Root( s ) ) =n;129 Next( Back( n ) ) =n;112 Back( head( s ) ) = &n; 113 Next( Back( &n ) ) = &n; 130 114 } else { 131 Next( n ) =n;132 Back( n ) =n;115 Next( &n ) = &n; 116 Back( &n ) = &n; 133 117 } // if 134 118 asm( "" : : : "memory" ); // prevent code movement across barrier 135 root = n;119 root = &n; 136 120 } else { 137 Next( n ) = Next(aft );138 Back( n ) =aft;121 Next( &n ) = Next( &aft ); 122 Back( &n ) = &aft; 139 123 // inserted node must be consistent before it is seen 140 124 asm( "" : : : "memory" ); // prevent code movement across barrier 141 Back( Next( n ) ) =n;142 Next( aft ) =n;125 Back( Next( &n ) ) = &n; 126 Next( &aft ) = &n; 143 127 } // if 144 128 } // post: n->listed() & *n in *s & succ(n) == bef 145 129 146 130 // pre: n->listed() & *n in *s 147 void remove( Sequence(T) & s, T *n ) with( s ) { // O(1)148 #ifdef __CFA_DEBUG__ 149 if ( ! listed( n ) ) abort( "(Sequence &)%p.remove( %p ) : Node is not on a list.", &s,n );150 #endif // __CFA_DEBUG__ 151 if ( n == Root( s ) ) {152 if ( Next( Root( s ) ) == Root( s ) ) root = 0p;153 else root = Next( Root(s ) );154 } // if 155 Back( Next( n ) ) = Back(n );156 Next( Back( n ) ) = Next(n );157 Next( n ) = Back(n ) = 0p;131 void remove( Sequence(T) & s, T & n ) with( s ) { // O(1) 132 #ifdef __CFA_DEBUG__ 133 if ( ! listed( &n ) ) abort( "(Sequence &)%p.remove( %p ) : Node is not on a list.", &s, &n ); 134 #endif // __CFA_DEBUG__ 135 if ( &n == head( s ) ) { 136 if ( Next( head( s ) ) == head( s ) ) root = 0p; 137 else root = Next( head(s ) ); 138 } // if 139 Back( Next( &n ) ) = Back( &n ); 140 Next( Back( &n ) ) = Next( &n ); 141 Next( &n ) = Back( &n ) = 0p; 158 142 } // post: !n->listed(). 159 143 160 144 // Add an element to the head of the sequence. 161 void addHead( Sequence(T) & s, T *n ) {// pre: !n->listed(); post: n->listed() & head() == n162 insertAft( s, 0, n );145 void addHead( Sequence(T) & s, T & n ) { // pre: !n->listed(); post: n->listed() & head() == n 146 insertAft( s, *0p, n ); 163 147 } 164 148 // Add an element to the tail of the sequence. 165 void addTail( Sequence(T) & s, T *n ) {// pre: !n->listed(); post: n->listed() & head() == n166 insertBef( s, n, 0);149 void addTail( Sequence(T) & s, T & n ) { // pre: !n->listed(); post: n->listed() & head() == n 150 insertBef( s, n, *0p ); 167 151 } 168 152 // Add an element to the tail of the sequence. 169 void add( Sequence(T) & s, T *n ) {// pre: !n->listed(); post: n->listed() & head() == n153 void add( Sequence(T) & s, T & n ) { // pre: !n->listed(); post: n->listed() & head() == n 170 154 addTail( s, n ); 171 155 } 172 156 // Remove and return the head element in the sequence. 173 T *dropHead( Sequence(T) & s ) {157 T & dropHead( Sequence(T) & s ) { 174 158 T * n = head( s ); 175 return n ? remove( s, n ), n :0p;159 return n ? remove( s, *n ), *n : *0p; 176 160 } 177 161 // Remove and return the head element in the sequence. 178 T *drop( Sequence(T) & s ) {162 T & drop( Sequence(T) & s ) { 179 163 return dropHead( s ); 180 164 } 181 165 // Remove and return the tail element in the sequence. 182 T *dropTail( Sequence(T) & s ) {183 T *n = tail( s );184 return n ? remove( s, n ), n :0p;166 T & dropTail( Sequence(T) & s ) { 167 T & n = tail( s ); 168 return &n ? remove( s, n ), n : *0p; 185 169 } 186 170 … … 191 175 root = from.root; 192 176 } else { // "to" list not empty 193 T * toEnd = Back( Root( s ) );194 T * fromEnd = Back( Root( from ) );177 T * toEnd = Back( head( s ) ); 178 T * fromEnd = Back( head( from ) ); 195 179 Back( root ) = fromEnd; 196 Next( fromEnd ) = Root( s );180 Next( fromEnd ) = head( s ); 197 181 Back( from.root ) = toEnd; 198 Next( toEnd ) = Root( from );182 Next( toEnd ) = head( from ); 199 183 } // if 200 184 from.root = 0p; // mark "from" list empty … … 213 197 from.root = 0p; // mark "from" list empty 214 198 } else { 215 Back( Root( from ) ) = Back( Root( to ) ); // fix "from" list216 Next( Back( Root( to ) ) ) = Root( from );217 Next( n ) = Root( to ); // fix "to" list218 Back( Root( to ) ) = n;199 Back( head( from ) ) = Back( head( to ) ); // fix "from" list 200 Next( Back( head( to ) ) ) = head( from ); 201 Next( n ) = head( to ); // fix "to" list 202 Back( head( to ) ) = n; 219 203 } // if 220 204 transfer( s, to ); … … 231 215 232 216 inline { 233 // wrappers to make ColIter have T 234 T * Curr( SeqIter(T) & si ) with( si ) { 235 return (T *)curr; 236 } 237 238 void ?{}( SeqIter(T) & si ) with( si ) { 239 ((ColIter &) si){}; 217 void ?{}( SeqIter(T) & si ) with( si ) { 218 ((ColIter &)si){}; 240 219 seq = 0p; 241 220 } // post: elts = null. … … 244 223 ((ColIter &) si){}; 245 224 seq = &s; 225 curr = head( s ); 246 226 } // post: elts = null. 247 227 … … 251 231 } // post: elts = {e in s}. 252 232 253 bool ?>>?( SeqIter(T) & si, T *& tp ) with( si ) {233 bool ?>>?( SeqIter(T) & si, T && tp ) with( si ) { 254 234 if ( curr ) { 255 tp = Curr( si );256 T * n = succ( *seq, Curr( si ) );235 &tp = Curr( si ); 236 T * n = succ( *seq, Curr( si ) ); 257 237 curr = n == head( *seq ) ? 0p : n; 258 } else tp = 0p;259 return tp != 0p;238 } else &tp = 0p; 239 return &tp != 0p; 260 240 } 261 241 } // distribution … … 269 249 270 250 inline { 271 // wrappers to make ColIter have T272 T * Curr( SeqIterRev(T) & si ) with( si ) {273 return (T *)curr;274 }275 276 251 void ?{}( SeqIterRev(T) & si ) with( si ) { 277 252 ((ColIter &) si){}; … … 282 257 ((ColIter &) si){}; 283 258 seq = &s; 259 curr = &tail( s ); 284 260 } // post: elts = null. 285 261 286 262 void over( SeqIterRev(T) & si, Sequence(T) & s ) with( si ) { 287 263 seq = &s; 288 curr = tail( s );264 curr = &tail( s ); 289 265 } // post: elts = {e in s}. 290 266 291 bool ?>>?( SeqIterRev(T) & si, T *&tp ) with( si ) {267 bool ?>>?( SeqIterRev(T) & si, T && tp ) with( si ) { 292 268 if ( curr ) { 293 tp = Curr( si );294 T * n = pred( *seq, Curr( si ) );295 curr = n == tail( *seq ) ? 0p : n;296 } else tp = 0p;297 return tp != 0p;269 &tp = Curr( si ); 270 T * n = pred( *seq, Curr( si ) ); 271 curr = n == &tail( *seq ) ? 0p : n; 272 } else &tp = 0p; 273 return &tp != 0p; 298 274 } 299 275 } // distribution -
libcfa/src/bits/sequence_example.cfa
rf0d67e5 rb5629d8 17 17 Sequence(Fred) fred; 18 18 SeqIter(Fred) fredIter = { fred }; 19 Fred * f; 20 int i; 19 Fred & f; 21 20 22 21 sout | nlOff; // turn off auto newline 23 22 24 23 for ( ; fredIter >> f; ) { // empty list 25 sout | f ->i | ' ';24 sout | f.i | ' '; 26 25 } 27 26 sout | "empty" | nl; 28 27 29 for ( i = 0; i < 10; i += 1 ) { 30 add( fred, new( 2 * i ) ); 28 for ( i; 10 ) { 29 add( fred, *new( 2 * i ) ); 30 } 31 32 for ( SeqIter(Fred) iter = { fred }; iter >> f; ) { 33 sout | f.i | ' '; 34 } 35 sout | nl; 36 37 for ( i; 9 ) { 38 delete( &dropHead( fred ) ); 31 39 } 32 40 33 41 for ( over( fredIter, fred ); fredIter >> f; ) { 34 sout | f->i | ' '; 42 sout | f.i | ' '; 43 } 44 sout | nl; 45 46 for ( i; 10 ) { 47 addTail( fred, *new( 2 * i + 1 ) ); 48 } 49 for ( over( fredIter, fred ); fredIter >> f; ) { 50 sout | f.i | ' '; 35 51 } 36 52 sout | nl; 37 53 38 for ( i = 0; i < 9; i += 1 ) { 39 delete( dropHead( fred ) ); 40 } 41 42 for ( over( fredIter, fred ); fredIter >> f; ) { 43 sout | f->i | ' '; 44 } 45 sout | nl; 46 47 for ( i = 0; i < 10; i += 1 ) { 48 addTail( fred, new( 2 * i + 1 ) ); 54 for ( i; 9 ) { 55 delete( &dropTail( fred ) ); 49 56 } 50 57 for ( over( fredIter, fred ); fredIter >> f; ) { 51 sout | f->i | ' '; 52 } 53 sout | nl; 54 55 for ( i = 0; i < 9; i += 1 ) { 56 delete( dropTail( fred ) ); 57 } 58 for ( over( fredIter, fred ); fredIter >> f; ) { 59 sout | f->i | ' '; 58 sout | f.i | ' '; 60 59 } 61 60 sout | nl; 62 61 63 62 for ( over( fredIter, fred ); fredIter >> f; ) { 64 delete( f );63 delete( &f ); 65 64 } 66 65 … … 80 79 Sequence(Mary) baz; 81 80 SeqIter(Mary) maryIter = { mary }; 82 Mary *m;81 Mary & m; 83 82 84 83 for ( ; maryIter >> m; ) { // empty list 85 sout | m ->i | m->j | ' ';84 sout | m.i | m.j | ' '; 86 85 } 87 86 sout | "empty" | nl; 88 87 89 for ( i = 0; i < 10; i += 1 ) { 90 add( mary, new( 2 * i ) ); 91 add( baz, new( 2 * i ) ); 88 for ( i; 10 ) { 89 add( mary, *new( 2 * i ) ); 90 add( baz, *new( 2 * i ) ); 91 } 92 93 for ( SeqIter(Mary) iter = { mary }; iter >> m; ) { 94 sout | m.i | m.j | ' '; 95 } 96 sout | nl; 97 98 for ( i; 9 ) { 99 delete( &dropHead( mary ) ); 92 100 } 93 101 94 102 for ( over( maryIter, mary ); maryIter >> m; ) { 95 sout | m ->i | m->j | ' ';103 sout | m.i | m.j | ' '; 96 104 } 97 105 sout | nl; 98 106 99 for ( i = 0; i < 9; i += 1 ) { 100 delete( dropHead( mary ) ); 101 } 102 103 for ( over( maryIter, mary ); maryIter >> m; ) { 104 sout | m->i | m->j | ' '; 105 } 106 sout | nl; 107 108 for ( i = 0; i < 10; i += 1 ) { 109 addTail( mary, new( 2 * i + 1 ) ); 107 for ( i; 10 ) { 108 addTail( mary, *new( 2 * i + 1 ) ); 110 109 } 111 110 for ( over( maryIter, mary ); maryIter >> m; ) { 112 sout | m ->i | m->j | ' ';111 sout | m.i | m.j | ' '; 113 112 } 114 113 sout | nl; 115 114 116 for ( i = 0; i < 9; i += 1) {117 delete( dropTail( mary ) );115 for ( i; 9 ) { 116 delete( &dropTail( mary ) ); 118 117 } 119 118 for ( over( maryIter, mary ); maryIter >> m; ) { 120 sout | m ->i | m->j | ' ';119 sout | m.i | m.j | ' '; 121 120 } 122 121 sout | nl; … … 125 124 126 125 for ( over( maryIter, baz ); maryIter >> m; ) { 127 sout | m ->i | m->j | ' ';126 sout | m.i | m.j | ' '; 128 127 } 129 128 sout | "empty" | nl; 130 129 131 130 for ( over( maryIter, mary ); maryIter >> m; ) { 132 sout | m ->i | m->j | ' ';131 sout | m.i | m.j | ' '; 133 132 } 134 133 sout | nl; 135 134 136 135 for ( over( maryIter, mary ); maryIter >> m; ) { 137 delete( m );136 delete( &m ); 138 137 } 139 138 } 140 139 141 140 // Local Variables: // 142 // compile-command: "cfa sequence_example.c c" //141 // compile-command: "cfa sequence_example.cfa" // 143 142 // End: // -
libcfa/src/bits/stack.hfa
rf0d67e5 rb5629d8 14 14 } // post: empty() & head() == 0 | !empty() & head() in *this 15 15 16 bool empty( Stack(T) & s ) with( s ) { // 0 <=> *this contains no elements17 return empty( (Collection &)s );18 }19 20 T *& Next( T * n ) {21 return (T *)Next( (Colable *)n );22 }23 24 T * Root( Stack(T) & s ) with( s ) {25 return (T *)root;26 }27 28 16 void ?{}( Stack(T) &, const Stack(T) & ) = void; // no copy 29 17 Stack(T) & ?=?( const Stack(T) & ) = void; // no assignment … … 33 21 } // post: empty() 34 22 35 T *top( Stack(T) & s ) with( s ) {36 return head( s );23 T & top( Stack(T) & s ) with( s ) { 24 return *head( s ); 37 25 } 38 26 39 void addHead( Stack(T) & s, T *n ) with( s ) {27 void addHead( Stack(T) & s, T & n ) with( s ) { 40 28 #ifdef __CFA_DEBUG__ 41 if ( listed( (Colable &)( *n) ) ) abort( "(Stack &)%p.addHead( %p ) : Node is already on another list.", &s, n );29 if ( listed( (Colable &)(n) ) ) abort( "(Stack &)%p.addHead( %p ) : Node is already on another list.", &s, n ); 42 30 #endif // __CFA_DEBUG__ 43 Next( n ) = Root( s ) ? Root( s ) :n;44 root = n;31 Next( &n ) = head( s ) ? head( s ) : &n; 32 root = &n; 45 33 } 46 34 47 void add( Stack(T) & s, T *n ) with( s ) {35 void add( Stack(T) & s, T & n ) with( s ) { 48 36 addHead( s, n ); 49 37 } 50 38 51 void push( Stack(T) & s, T *n ) with( s ) {39 void push( Stack(T) & s, T & n ) with( s ) { 52 40 addHead( s, n ); 53 41 } 54 42 55 T *drop( Stack(T) & s ) with( s ) {56 T * t =head( s );43 T & drop( Stack(T) & s ) with( s ) { 44 T & t = *head( s ); 57 45 if ( root ) { 58 46 root = ( T *)Next(root); 59 if ( Root( s ) ==t ) root = 0p; // only one element ?60 Next( t ) = 0p;47 if ( head( s ) == &t ) root = 0p; // only one element ? 48 Next( &t ) = 0p; 61 49 } // if 62 50 return t; 63 51 } 64 52 65 T *pop( Stack(T) & s ) with( s ) {53 T & pop( Stack(T) & s ) with( s ) { 66 54 return drop( s ); 67 55 } … … 76 64 77 65 inline { 78 // wrappers to make ColIter have T79 T * Curr( StackIter(T) & si ) with( si ) {80 return (T *)curr;81 }82 83 66 void ?{}( StackIter(T) & si ) with( si ) { 84 67 ((ColIter &)si){}; … … 90 73 } // post: curr = {e in s} 91 74 92 void ?{}( StackIter(T) & si, T *start ) with( si ) {93 curr = start;75 void ?{}( StackIter(T) & si, T & start ) with( si ) { 76 curr = &start; 94 77 } // post: curr = {e in s} 95 78 … … 99 82 } // post: curr = {e in s} 100 83 101 bool ?>>?( StackIter(T) & si, T *& tp ) with( si ) {84 bool ?>>?( StackIter(T) & si, T && tp ) with( si ) { 102 85 if ( curr ) { 103 tp = Curr( si );86 &tp = Curr( si ); 104 87 T * n = Next( Curr( si ) ); 105 curr = (n == Curr( si )) ? 0p : n;106 } else tp = 0p;107 return tp != 0p;88 curr = n == Curr( si ) ? 0p : n; 89 } else &tp = 0p; 90 return &tp != 0p; 108 91 } 109 92 } // distribution -
libcfa/src/bits/stack_example.cfa
rf0d67e5 rb5629d8 17 17 Stack(Fred) fred; 18 18 StackIter(Fred) fredIter = { fred }; 19 Fred * f; 20 int i; 19 Fred & f; 21 20 22 21 sout | nlOff; // turn off auto newline 23 22 24 23 for ( ; fredIter >> f; ) { // empty list 25 sout | f ->i | ' ';24 sout | f.i | ' '; 26 25 } 27 26 sout | "empty" | nl; 28 27 29 for ( i = 0; i < 10; i += 1 ) { 30 push( fred, new( 2 * i ) ); 28 for ( i; 10 ) { 29 push( fred, *new( 2 * i ) ); 30 } 31 32 for ( StackIter(Fred) iter = { fred }; iter >> f; ) { 33 sout | f.i | ' '; 34 } 35 sout | nl; 36 37 for ( i; 9 ) { 38 delete( &pop( fred ) ); 31 39 } 32 40 33 41 for ( over( fredIter, fred ); fredIter >> f; ) { 34 sout | f ->i | ' ';42 sout | f.i | ' '; 35 43 } 36 44 sout | nl; 37 45 38 for ( i = 0; i < 9; i += 1 ) { 39 delete( pop( fred ) ); 40 } 41 42 for ( over( fredIter, fred ); fredIter >> f; ) { 43 sout | f->i | ' '; 44 } 45 sout | nl; 46 47 for ( i = 0; i < 10; i += 1 ) { 48 push( fred, new( 2 * i + 1 ) ); 46 for ( i; 10 ) { 47 push( fred, *new( 2 * i + 1 ) ); 49 48 } 50 49 for ( over( fredIter, fred ); fredIter >> f; ) { 51 sout | f ->i | ' ';50 sout | f.i | ' '; 52 51 } 53 52 sout | nl; 54 53 55 54 for ( over( fredIter, fred ); fredIter >> f; ) { 56 delete( f );55 delete( &f ); 57 56 } 58 57 … … 71 70 Stack(Mary) mary; 72 71 StackIter(Mary) maryIter = { mary }; 73 Mary *m;72 Mary & m; 74 73 75 74 for ( ; maryIter >> m; ) { // empty list 76 sout | m ->i | m->j | ' ';75 sout | m.i | m.j | ' '; 77 76 } 78 77 sout | "empty" | nl; 79 78 80 for ( i = 0; i < 10; i += 1 ) { 81 push( mary, new( 2 * i ) ); 79 for ( i; 10 ) { 80 push( mary, *new( 2 * i ) ); 81 } 82 83 for ( StackIter(Mary) iter = { mary }; iter >> m; ) { 84 sout | m.i | m.j | ' '; 85 } 86 sout | nl; 87 88 for ( i; 9 ) { 89 delete( &pop( mary ) ); 82 90 } 83 91 84 92 for ( over( maryIter, mary ); maryIter >> m; ) { 85 sout | m ->i | m->j | ' ';93 sout | m.i | m.j | ' '; 86 94 } 87 95 sout | nl; 88 96 89 for ( i = 0; i < 9; i += 1 ) { 90 delete( pop( mary ) ); 91 } 92 93 for ( over( maryIter, mary ); maryIter >> m; ) { 94 sout | m->i | m->j | ' '; 95 } 96 sout | nl; 97 98 for ( i = 0; i < 10; i += 1 ) { 99 push( mary, new( 2 * i + 1 ) ); 97 for ( i; 10 ) { 98 push( mary, *new( 2 * i + 1 ) ); 100 99 } 101 100 for ( over( maryIter, mary ); maryIter >> m; ) { 102 sout | m ->i | m->j | ' ';101 sout | m.i | m.j | ' '; 103 102 } 104 103 sout | nl; 105 104 106 105 for ( over( maryIter, mary ); maryIter >> m; ) { 107 delete( m );106 delete( &m ); 108 107 } 109 108 } -
src/AST/Print.cpp
rf0d67e5 rb5629d8 205 205 206 206 void preprint( const ast::NamedTypeDecl * node ) { 207 if ( ! node->name.empty() ) os << node->name << ": "; 207 if ( ! node->name.empty() ) { 208 if( deterministic_output && isUnboundType(node->name) ) os << "[unbound]:"; 209 else os << node->name << ": "; 210 } 208 211 209 212 if ( ! short_mode && node->linkage != Linkage::Cforall ) { … … 240 243 241 244 if ( node->result ) { 242 if (!deterministic_output) { 243 os << endl << indent << "... with resolved type:" << endl; 244 ++indent; 245 os << indent; 246 node->result->accept( *this ); 247 --indent; 248 } 245 os << endl << indent << "... with resolved type:" << endl; 246 ++indent; 247 os << indent; 248 node->result->accept( *this ); 249 --indent; 249 250 } 250 251 … … 1382 1383 virtual const ast::Type * visit( const ast::TypeInstType * node ) override final { 1383 1384 preprint( node ); 1384 os << "instance of type " << node->name 1385 const auto & _name = deterministic_output && isUnboundType(node) ? "[unbound]" : node->name; 1386 os << "instance of type " << _name 1385 1387 << " (" << (node->kind == ast::TypeDecl::Ftype ? "" : "not ") << "function type)"; 1386 1388 print( node->params ); -
src/AST/Type.cpp
rf0d67e5 rb5629d8 133 133 134 134 BaseInstType::BaseInstType( const BaseInstType & o ) 135 : ParameterizedType( o.qualifiers, copy( o.attributes ) ), params(), name( o.name ), 135 : ParameterizedType( o.qualifiers, copy( o.attributes ) ), params(), name( o.name ), 136 136 hoistType( o.hoistType ) { 137 137 Pass< ForallSubstitutor > sub; … … 222 222 // TODO: once TypeInstType representation is updated, it should properly check 223 223 // if the context id is filled. this is a temporary hack for now 224 if (std::count(typeInst->name.begin(), typeInst->name.end(), '_') >= 3) { 225 return true; 226 } 224 return isUnboundType(typeInst->name); 225 } 226 return false; 227 } 228 229 bool isUnboundType(const std::string & tname) { 230 // xxx - look for a type name produced by renameTyVars. 231 232 // TODO: once TypeInstType representation is updated, it should properly check 233 // if the context id is filled. this is a temporary hack for now 234 if (std::count(tname.begin(), tname.end(), '_') >= 3) { 235 return true; 227 236 } 228 237 return false; -
src/AST/Type.hpp
rf0d67e5 rb5629d8 536 536 537 537 bool isUnboundType(const Type * type); 538 bool isUnboundType(const std::string & tname); 538 539 539 540 } -
src/AST/TypeEnvironment.cpp
rf0d67e5 rb5629d8 34 34 #include "ResolvExpr/Unify.h" // for unifyInexact 35 35 #include "Tuples/Tuples.h" // for isTtype 36 #include "CompilationState.h" 36 37 37 38 using ResolvExpr::WidenMode; … … 56 57 57 58 void print( std::ostream & out, const EqvClass & clz, Indenter indent ) { 58 out << "( "; 59 std::copy( clz.vars.begin(), clz.vars.end(), std::ostream_iterator< std::string >( out, " " ) ); 59 out << "("; 60 bool first = true; 61 for(const auto & var : clz.vars) { 62 if(first) first = false; 63 else out << " "; 64 if( deterministic_output && isUnboundType(var) ) out << "[unbound]"; 65 else out << var; 66 } 60 67 out << ")"; 61 68 -
src/Common/CodeLocation.h
rf0d67e5 rb5629d8 42 42 } 43 43 44 bool followedBy( CodeLocation const & other, int seperation ) { 44 bool startsBefore( CodeLocation const & other ) const { 45 if( filename < other.filename ) return true; 46 if( filename > other.filename ) return false; 47 48 if( first_line < other.first_line ) return true; 49 if( first_line > other.first_line ) return false; 50 51 if( last_line < other.last_line ) return true; 52 return false; 53 } 54 55 bool followedBy( CodeLocation const & other, int seperation ) const { 45 56 return (first_line + seperation == other.first_line && 46 57 filename == other.filename); 47 58 } 48 59 49 bool operator==( CodeLocation const & other ) {60 bool operator==( CodeLocation const & other ) const { 50 61 return followedBy( other, 0 ); 51 62 } 52 63 53 bool operator!=( CodeLocation const & other ) {64 bool operator!=( CodeLocation const & other ) const { 54 65 return !(*this == other); 55 66 } -
src/Common/SemanticError.cc
rf0d67e5 rb5629d8 90 90 void SemanticErrorException::print() { 91 91 using std::to_string; 92 93 errors.sort([](const error & lhs, const error & rhs) -> bool { 94 if(lhs.location.startsBefore(rhs.location)) return true; 95 if(rhs.location.startsBefore(lhs.location)) return false; 96 97 return lhs.description < rhs.description; 98 }); 99 92 100 for( auto err : errors ) { 93 101 std::cerr << ErrorHelpers::bold() << err.location << ErrorHelpers::error_str() << ErrorHelpers::reset_font() << err.description << std::endl; -
src/ResolvExpr/AlternativeFinder.cc
rf0d67e5 rb5629d8 132 132 void printAlts( const AltList &list, std::ostream &os, unsigned int indentAmt ) { 133 133 Indenter indent = { indentAmt }; 134 135 std::vector<int> idx; 136 idx.reserve(list.size()); 137 for(int i = 0; i < list.size(); i++) { idx.push_back(i); } 138 139 std::sort(idx.begin(), idx.end(), [&list](int lhs_idx, int rhs_idx) -> bool { 140 const auto & lhs = list.at(lhs_idx); 141 const auto & rhs = list.at(rhs_idx); 142 if(lhs.expr->location.startsBefore(rhs.expr->location)) return true; 143 if(rhs.expr->location.startsBefore(lhs.expr->location)) return false; 144 145 if(lhs.env.size() < rhs.env.size()) return true; 146 if(lhs.env.size() > rhs.env.size()) return false; 147 148 if(lhs.openVars.size() < rhs.openVars.size()) return true; 149 if(lhs.openVars.size() > rhs.openVars.size()) return false; 150 151 if(lhs.need.size() < rhs.need.size()) return true; 152 if(lhs.need.size() > rhs.need.size()) return false; 153 154 return false; 155 }); 156 134 157 for ( AltList::const_iterator i = list.begin(); i != list.end(); ++i ) { 135 158 i->print( os, indent ); … … 1718 1741 std::cerr << std::endl; 1719 1742 ) 1720 1743 1721 1744 if ( thisCost != Cost::infinity ) { 1722 1745 // count one safe conversion for each value that is thrown away -
src/ResolvExpr/TypeEnvironment.cc
rf0d67e5 rb5629d8 107 107 108 108 void EqvClass::print( std::ostream &os, Indenter indent ) const { 109 if( !deterministic_output ) { 110 os << "( "; 111 std::copy( vars.begin(), vars.end(), std::ostream_iterator< std::string >( os, " " ) ); 112 os << ")"; 113 } 109 os << "("; 110 bool first = true; 111 for(const auto & var : vars) { 112 if(first) first = false; 113 else os << " "; 114 if( deterministic_output && isUnboundType(var) ) os << "[unbound]"; 115 else os << var; 116 } 117 os << ")"; 114 118 if ( type ) { 115 119 os << " -> "; -
src/ResolvExpr/TypeEnvironment.h
rf0d67e5 rb5629d8 149 149 iterator end() const { return env.end(); } 150 150 151 auto size() const { return env.size(); } 152 151 153 private: 152 154 ClassList env; -
src/SynTree/Expression.cc
rf0d67e5 rb5629d8 72 72 73 73 if ( result ) { 74 if (!deterministic_output) { 75 os << std::endl << indent << "with resolved type:" << std::endl; 76 os << (indent+1); 77 result->print( os, indent+1 ); 78 } 74 os << std::endl << indent << "with resolved type:" << std::endl; 75 os << (indent+1); 76 result->print( os, indent+1 ); 79 77 } 80 78 -
src/SynTree/NamedTypeDecl.cc
rf0d67e5 rb5629d8 22 22 #include "LinkageSpec.h" // for Spec, Cforall, linkageName 23 23 #include "Type.h" // for Type, Type::StorageClasses 24 #include "CompilationState.h" 24 25 25 26 NamedTypeDecl::NamedTypeDecl( const std::string &name, Type::StorageClasses scs, Type *base ) … … 41 42 using namespace std; 42 43 43 if ( name != "" ) os << name << ": "; 44 if ( ! name.empty() ) { 45 if( deterministic_output && isUnboundType(name) ) os << "[unbound]:"; 46 else os << name << ": "; 47 } 44 48 45 49 if ( linkage != LinkageSpec::Cforall ) { -
src/SynTree/ReferenceToType.cc
rf0d67e5 rb5629d8 24 24 #include "Type.h" // for TypeInstType, StructInstType, UnionInstType 25 25 #include "TypeSubstitution.h" // for TypeSubstitution 26 #include "CompilationState.h" 26 27 27 28 class Attribute; … … 205 206 206 207 Type::print( os, indent ); 207 os << "instance of " << typeString() << " " << get_name() << " (" << ( isFtype ? "" : "not" ) << " function type)"; 208 os << "instance of " << typeString() << " "; 209 const auto & name_ = get_name(); 210 if( deterministic_output && isUnboundType(name) ) os << "[unbound]"; 211 else os << name; 212 os << " (" << ( isFtype ? "" : "not" ) << " function type)"; 208 213 if ( ! parameters.empty() ) { 209 214 os << endl << indent << "... with parameters" << endl; -
src/SynTree/Type.cc
rf0d67e5 rb5629d8 156 156 const Type::Qualifiers noQualifiers; 157 157 158 bool isUnboundType(const Type * type) { 159 if (auto typeInst = dynamic_cast<const TypeInstType *>(type)) { 160 // xxx - look for a type name produced by renameTyVars. 161 162 // TODO: once TypeInstType representation is updated, it should properly check 163 // if the context id is filled. this is a temporary hack for now 164 return isUnboundType(typeInst->name); 165 } 166 return false; 167 } 168 169 bool isUnboundType(const std::string & tname) { 170 // xxx - look for a type name produced by renameTyVars. 171 172 // TODO: once TypeInstType representation is updated, it should properly check 173 // if the context id is filled. this is a temporary hack for now 174 if (std::count(tname.begin(), tname.end(), '_') >= 3) { 175 return true; 176 } 177 return false; 178 } 179 158 180 // Local Variables: // 159 181 // tab-width: 4 // -
src/SynTree/Type.h
rf0d67e5 rb5629d8 733 733 }; 734 734 735 736 bool isUnboundType(const Type * type); 737 bool isUnboundType(const std::string & tname); 738 735 739 // Local Variables: // 736 740 // tab-width: 4 // -
tests/.expect/alloc-ERROR.nast.txt
rf0d67e5 rb5629d8 16 16 Name: stp 17 17 18 ... with resolved type: 19 unsigned long int 18 20 19 21 … … 28 30 Name: stp 29 31 Constant Expression (10: signed int) 32 ... with resolved type: 33 signed int 30 34 31 35 -
tests/.expect/alloc-ERROR.oast.txt
rf0d67e5 rb5629d8 16 16 Name: stp 17 17 18 with resolved type: 19 unsigned long int 18 20 19 21 … … 28 30 Name: stp 29 31 constant expression (10 10: signed int) 32 with resolved type: 33 signed int 30 34 31 35 -
tests/.expect/castError.oast.txt
rf0d67e5 rb5629d8 3 3 Name: f 4 4 ... to: 5 char 6 with resolved type: 5 7 char Alternatives are: 6 8 Cost ( 1, 0, 0, 0, 0, 0, 0 ): Explicit Cast of: … … 9 11 ... returning nothing 10 12 13 with resolved type: 14 pointer to function 15 accepting unspecified arguments 16 ... returning nothing 17 11 18 ... to: 19 char 20 with resolved type: 12 21 char 13 22 (types: … … 18 27 Cost ( 1, 0, 0, 0, 0, 0, 0 ): Explicit Cast of: 19 28 Variable Expression: f: double 29 with resolved type: 30 double 20 31 ... to: 32 char 33 with resolved type: 21 34 char 22 35 (types: … … 27 40 Cost ( 1, 0, 0, 0, 0, 0, 0 ): Explicit Cast of: 28 41 Variable Expression: f: signed int 42 with resolved type: 43 signed int 29 44 ... to: 45 char 46 with resolved type: 30 47 char 31 48 (types: … … 39 56 Comma Expression: 40 57 constant expression (3 3: signed int) 58 with resolved type: 59 signed int 41 60 Name: v 42 ... to: nothing Alternatives are: 61 ... to: nothing 62 with resolved type: 63 void Alternatives are: 43 64 Cost ( 0, 0, 2, 0, 0, 0, 0 ): Generated Cast of: 44 65 Comma Expression: 45 66 constant expression (3 3: signed int) 67 with resolved type: 68 signed int 46 69 Variable Expression: v: unsigned char 70 with resolved type: 71 unsigned char 72 with resolved type: 73 unsigned char 47 74 ... to: nothing 75 with resolved type: 76 void 48 77 (types: 49 78 void … … 54 83 Comma Expression: 55 84 constant expression (3 3: signed int) 85 with resolved type: 86 signed int 56 87 Variable Expression: v: signed short int 88 with resolved type: 89 signed short int 90 with resolved type: 91 signed short int 57 92 ... to: nothing 93 with resolved type: 94 void 58 95 (types: 59 96 void … … 69 106 char 70 107 108 with resolved type: 109 instance of struct S with body 1 110 ... with parameters 111 char 112 -
tests/.expect/init1-ERROR.nast.txt
rf0d67e5 rb5629d8 11 11 ... to: 12 12 reference to signed int 13 ... with resolved type: 14 reference to signed int 13 15 init1.cfa:107:1 error: Invalid application of existing declaration(s) in expression Applying untyped: 14 16 Name: ?{} … … 16 18 Generated Cast of: 17 19 Variable Expression: _retval_f_py: pointer to signed int 20 ... with resolved type: 21 pointer to signed int 18 22 ... to: 23 reference to pointer to signed int 24 ... with resolved type: 19 25 reference to pointer to signed int 20 26 Name: px … … 24 30 ... to: 25 31 reference to float 32 ... with resolved type: 33 reference to float 26 34 init1.cfa:117:1 error: Invalid application of existing declaration(s) in expression Applying untyped: 27 35 Name: ?{} … … 29 37 Generated Cast of: 30 38 Variable Expression: _retval_f_py2: pointer to float 39 ... with resolved type: 40 pointer to float 31 41 ... to: 42 reference to pointer to float 43 ... with resolved type: 32 44 reference to pointer to float 33 45 Name: cpx … … 37 49 ... to: 38 50 reference to instance of type T (not function type) 51 ... with resolved type: 52 reference to instance of type T (not function type) 39 53 init1.cfa:128:1 error: Invalid application of existing declaration(s) in expression Applying untyped: 40 54 Name: ?{} … … 42 56 Generated Cast of: 43 57 Variable Expression: _retval_anycvt: pointer to instance of type T (not function type) 58 ... with resolved type: 59 pointer to instance of type T (not function type) 44 60 ... to: 61 reference to pointer to instance of type T (not function type) 62 ... with resolved type: 45 63 reference to pointer to instance of type T (not function type) 46 64 Name: s -
tests/.expect/init1-ERROR.oast.txt
rf0d67e5 rb5629d8 1 1 error: No reasonable alternatives for expression Untyped Init Expression 2 Name: rx InitAlternative: reference to signed int 2 Name: cpx InitAlternative: pointer to float 3 error: No reasonable alternatives for expression Untyped Init Expression 4 Name: crx InitAlternative: reference to float 3 5 error: No reasonable alternatives for expression Untyped Init Expression 4 6 Name: px InitAlternative: pointer to signed int 5 7 error: No reasonable alternatives for expression Untyped Init Expression 6 Name: crx InitAlternative: reference to float 7 error: No reasonable alternatives for expression Untyped Init Expression 8 Name: cpx InitAlternative: pointer to float 8 Name: rx InitAlternative: reference to signed int 9 9 init1.cfa:104:1 error: No reasonable alternatives for expression Generated Cast of: 10 10 Name: rx 11 11 ... to: 12 reference to signed int 13 with resolved type: 12 14 reference to signed int 13 15 init1.cfa:107:1 error: No reasonable alternatives for expression Applying untyped: … … 16 18 Generated Cast of: 17 19 Variable Expression: _retval_f_py: pointer to signed int 20 with resolved type: 21 pointer to signed int 18 22 ... to: 23 reference to pointer to signed int 24 with resolved type: 19 25 reference to pointer to signed int 20 26 Name: px … … 24 30 ... to: 25 31 reference to float 32 with resolved type: 33 reference to float 26 34 init1.cfa:117:1 error: No reasonable alternatives for expression Applying untyped: 27 35 Name: ?{} … … 29 37 Generated Cast of: 30 38 Variable Expression: _retval_f_py2: pointer to float 39 with resolved type: 40 pointer to float 31 41 ... to: 42 reference to pointer to float 43 with resolved type: 32 44 reference to pointer to float 33 45 Name: cpx … … 37 49 ... to: 38 50 reference to instance of type T (not function type) 51 with resolved type: 52 reference to instance of type T (not function type) 39 53 init1.cfa:128:1 error: No reasonable alternatives for expression Applying untyped: 40 54 Name: ?{} … … 42 56 Generated Cast of: 43 57 Variable Expression: _retval_anycvt: pointer to instance of type T (not function type) 58 with resolved type: 59 pointer to instance of type T (not function type) 44 60 ... to: 61 reference to pointer to instance of type T (not function type) 62 with resolved type: 45 63 reference to pointer to instance of type T (not function type) 46 64 Name: s -
tests/errors/.expect/completeType.nast.x64.txt
rf0d67e5 rb5629d8 6 6 Name: x 7 7 8 ... to: nothing Alternatives are: 8 ... to: nothing 9 ... with resolved type: 10 void Alternatives are: 9 11 Cost ( 0, 1, 2, 0, 1, -1, 0 ): Generated Cast of: 10 12 Application of … … 17 19 reference to instance of type DT (not function type) 18 20 21 ... with resolved type: 22 pointer to forall 23 [unbound]:data type 24 function 25 ... with parameters 26 pointer to instance of type [unbound] (not function type) 27 ... returning 28 reference to instance of type [unbound] (not function type) 29 19 30 ... to arguments 20 31 Variable Expression: x: pointer to instance of struct B with body 32 ... with resolved type: 33 pointer to instance of struct B with body 21 34 35 ... with resolved type: 36 reference to instance of struct B with body 22 37 ... to: nothing 38 ... with resolved type: 39 void 23 40 (types: 24 41 void 25 42 ) 26 Environment:( _99_2_DT) -> instance of struct B with body (no widening)43 Environment:([unbound]) -> instance of struct B with body (no widening) 27 44 28 45 … … 37 54 reference to instance of type DT (not function type) 38 55 56 ... with resolved type: 57 pointer to forall 58 [unbound]:data type 59 function 60 ... with parameters 61 pointer to instance of type [unbound] (not function type) 62 ... returning 63 reference to instance of type [unbound] (not function type) 64 39 65 ... to arguments 40 66 Variable Expression: x: pointer to instance of struct A without body 67 ... with resolved type: 68 pointer to instance of struct A without body 41 69 70 ... with resolved type: 71 reference to instance of struct A without body 42 72 ... to: nothing 73 ... with resolved type: 74 void 43 75 (types: 44 76 void 45 77 ) 46 Environment:( _99_2_DT) -> instance of struct A without body (no widening)78 Environment:([unbound]) -> instance of struct A without body (no widening) 47 79 48 80 … … 112 144 ... returning nothing 113 145 146 ... with resolved type: 147 pointer to forall 148 [unbound]:sized data type 149 ... with assertions 150 ?=?: pointer to function 151 ... with parameters 152 reference to instance of type [unbound] (not function type) 153 instance of type [unbound] (not function type) 154 ... returning 155 instance of type [unbound] (not function type) 156 157 ?{}: pointer to function 158 ... with parameters 159 reference to instance of type [unbound] (not function type) 160 ... returning nothing 161 162 ?{}: pointer to function 163 ... with parameters 164 reference to instance of type [unbound] (not function type) 165 instance of type [unbound] (not function type) 166 ... returning nothing 167 168 ^?{}: pointer to function 169 ... with parameters 170 reference to instance of type [unbound] (not function type) 171 ... returning nothing 172 173 174 function 175 ... with parameters 176 pointer to instance of type [unbound] (not function type) 177 ... returning nothing 178 114 179 ... to arguments 115 180 Variable Expression: z: pointer to instance of type T (not function type) 181 ... with resolved type: 182 pointer to instance of type T (not function type) 116 183 with 1 pending inference slots 117 184 185 ... with resolved type: 186 void 118 187 (types: 119 188 void 120 189 ) 121 Environment:( _118_0_T) -> instance of type T (not function type) (no widening)190 Environment:([unbound]) -> instance of type T (not function type) (no widening) 122 191 123 192 Could not satisfy assertion: 124 193 ?=?: pointer to function 125 194 ... with parameters 126 reference to instance of type _118_0_T(not function type)127 instance of type _118_0_T(not function type)195 reference to instance of type [unbound] (not function type) 196 instance of type [unbound] (not function type) 128 197 ... returning 129 instance of type _118_0_T(not function type)198 instance of type [unbound] (not function type) 130 199 -
tests/errors/.expect/completeType.oast.arm64.txt
rf0d67e5 rb5629d8 6 6 Name: x 7 7 8 ... to: nothing Alternatives are: 8 ... to: nothing 9 with resolved type: 10 void Alternatives are: 9 11 Cost ( 0, 1, 2, 0, 1, -1, 0 ): Generated Cast of: 10 12 Application of … … 20 22 21 23 24 with resolved type: 25 pointer to forall 26 [unbound]:data type 27 function 28 ... with parameters 29 intrinsic pointer to instance of type [unbound] (not function type) 30 ... returning 31 _retval__operator_deref: reference to instance of type [unbound] (not function type) 32 ... with attributes: 33 Attribute with name: unused 34 35 22 36 ... to arguments 23 37 Variable Expression: x: pointer to instance of struct A with body 0 24 38 with resolved type: 39 pointer to instance of struct A with body 0 40 41 with resolved type: 42 reference to instance of struct A with body 0 25 43 ... to: nothing 44 with resolved type: 45 void 26 46 (types: 27 47 void 28 48 ) 29 Environment: -> instance of struct A with body 0 (no widening)49 Environment:([unbound]) -> instance of struct A with body 0 (no widening) 30 50 31 51 … … 43 63 44 64 65 with resolved type: 66 pointer to forall 67 [unbound]:data type 68 function 69 ... with parameters 70 intrinsic pointer to instance of type [unbound] (not function type) 71 ... returning 72 _retval__operator_deref: reference to instance of type [unbound] (not function type) 73 ... with attributes: 74 Attribute with name: unused 75 76 45 77 ... to arguments 46 78 Variable Expression: x: pointer to instance of struct B with body 1 47 79 with resolved type: 80 pointer to instance of struct B with body 1 81 82 with resolved type: 83 reference to instance of struct B with body 1 48 84 ... to: nothing 85 with resolved type: 86 void 49 87 (types: 50 88 void 51 89 ) 52 Environment: -> instance of struct B with body 1 (no widening)90 Environment:([unbound]) -> instance of struct B with body 1 (no widening) 53 91 54 92 … … 121 159 ... returning nothing 122 160 161 with resolved type: 162 pointer to forall 163 [unbound]:sized data type 164 ... with assertions 165 ?=?: pointer to function 166 ... with parameters 167 reference to instance of type [unbound] (not function type) 168 instance of type [unbound] (not function type) 169 ... returning 170 _retval__operator_assign: instance of type [unbound] (not function type) 171 ... with attributes: 172 Attribute with name: unused 173 174 175 ?{}: pointer to function 176 ... with parameters 177 reference to instance of type [unbound] (not function type) 178 ... returning nothing 179 180 ?{}: pointer to function 181 ... with parameters 182 reference to instance of type [unbound] (not function type) 183 instance of type [unbound] (not function type) 184 ... returning nothing 185 186 ^?{}: pointer to function 187 ... with parameters 188 reference to instance of type [unbound] (not function type) 189 ... returning nothing 190 191 192 function 193 ... with parameters 194 pointer to instance of type [unbound] (not function type) 195 ... returning nothing 196 123 197 ... to arguments 124 198 Variable Expression: z: pointer to instance of type T (not function type) 125 199 with resolved type: 200 pointer to instance of type T (not function type) 201 202 with resolved type: 203 void 126 204 (types: 127 205 void 128 206 ) 129 Environment: -> instance of type T (not function type) (no widening)207 Environment:([unbound]) -> instance of type T (not function type) (no widening) 130 208 131 209 Could not satisfy assertion: 132 210 ?=?: pointer to function 133 211 ... with parameters 134 reference to instance of type _110_0_T(not function type)135 instance of type _110_0_T(not function type)212 reference to instance of type [unbound] (not function type) 213 instance of type [unbound] (not function type) 136 214 ... returning 137 _retval__operator_assign: instance of type _110_0_T(not function type)215 _retval__operator_assign: instance of type [unbound] (not function type) 138 216 ... with attributes: 139 217 Attribute with name: unused -
tests/errors/.expect/completeType.oast.x64.txt
rf0d67e5 rb5629d8 6 6 Name: x 7 7 8 ... to: nothing Alternatives are: 8 ... to: nothing 9 with resolved type: 10 void Alternatives are: 9 11 Cost ( 0, 1, 2, 0, 1, -1, 0 ): Generated Cast of: 10 12 Application of … … 20 22 21 23 24 with resolved type: 25 pointer to forall 26 [unbound]:data type 27 function 28 ... with parameters 29 intrinsic pointer to instance of type [unbound] (not function type) 30 ... returning 31 _retval__operator_deref: reference to instance of type [unbound] (not function type) 32 ... with attributes: 33 Attribute with name: unused 34 35 22 36 ... to arguments 23 37 Variable Expression: x: pointer to instance of struct A with body 0 24 38 with resolved type: 39 pointer to instance of struct A with body 0 40 41 with resolved type: 42 reference to instance of struct A with body 0 25 43 ... to: nothing 44 with resolved type: 45 void 26 46 (types: 27 47 void 28 48 ) 29 Environment: -> instance of struct A with body 0 (no widening)49 Environment:([unbound]) -> instance of struct A with body 0 (no widening) 30 50 31 51 … … 43 63 44 64 65 with resolved type: 66 pointer to forall 67 [unbound]:data type 68 function 69 ... with parameters 70 intrinsic pointer to instance of type [unbound] (not function type) 71 ... returning 72 _retval__operator_deref: reference to instance of type [unbound] (not function type) 73 ... with attributes: 74 Attribute with name: unused 75 76 45 77 ... to arguments 46 78 Variable Expression: x: pointer to instance of struct B with body 1 47 79 with resolved type: 80 pointer to instance of struct B with body 1 81 82 with resolved type: 83 reference to instance of struct B with body 1 48 84 ... to: nothing 85 with resolved type: 86 void 49 87 (types: 50 88 void 51 89 ) 52 Environment: -> instance of struct B with body 1 (no widening)90 Environment:([unbound]) -> instance of struct B with body 1 (no widening) 53 91 54 92 … … 121 159 ... returning nothing 122 160 161 with resolved type: 162 pointer to forall 163 [unbound]:sized data type 164 ... with assertions 165 ?=?: pointer to function 166 ... with parameters 167 reference to instance of type [unbound] (not function type) 168 instance of type [unbound] (not function type) 169 ... returning 170 _retval__operator_assign: instance of type [unbound] (not function type) 171 ... with attributes: 172 Attribute with name: unused 173 174 175 ?{}: pointer to function 176 ... with parameters 177 reference to instance of type [unbound] (not function type) 178 ... returning nothing 179 180 ?{}: pointer to function 181 ... with parameters 182 reference to instance of type [unbound] (not function type) 183 instance of type [unbound] (not function type) 184 ... returning nothing 185 186 ^?{}: pointer to function 187 ... with parameters 188 reference to instance of type [unbound] (not function type) 189 ... returning nothing 190 191 192 function 193 ... with parameters 194 pointer to instance of type [unbound] (not function type) 195 ... returning nothing 196 123 197 ... to arguments 124 198 Variable Expression: z: pointer to instance of type T (not function type) 125 199 with resolved type: 200 pointer to instance of type T (not function type) 201 202 with resolved type: 203 void 126 204 (types: 127 205 void 128 206 ) 129 Environment: -> instance of type T (not function type) (no widening)207 Environment:([unbound]) -> instance of type T (not function type) (no widening) 130 208 131 209 Could not satisfy assertion: 132 210 ?=?: pointer to function 133 211 ... with parameters 134 reference to instance of type _110_0_T(not function type)135 instance of type _110_0_T(not function type)212 reference to instance of type [unbound] (not function type) 213 instance of type [unbound] (not function type) 136 214 ... returning 137 _retval__operator_assign: instance of type _110_0_T(not function type)215 _retval__operator_assign: instance of type [unbound] (not function type) 138 216 ... with attributes: 139 217 Attribute with name: unused -
tests/meta/.expect/archVast.nast.arm64.txt
rf0d67e5 rb5629d8 3 3 Name: FA64 4 4 ... to: 5 char 6 ... with resolved type: 5 7 char Alternatives are: 6 8 Cost ( 1, 0, 0, 0, 0, 0, 0 ): Explicit Cast of: 7 9 Variable Expression: FA64: signed int 10 ... with resolved type: 11 signed int 8 12 ... to: 13 char 14 ... with resolved type: 9 15 char 10 16 (types: … … 18 24 ... returning nothing 19 25 26 ... with resolved type: 27 pointer to function 28 accepting unspecified arguments 29 ... returning nothing 30 20 31 ... to: 32 char 33 ... with resolved type: 21 34 char 22 35 (types: … … 27 40 Cost ( 1, 0, 0, 0, 0, 0, 0 ): Explicit Cast of: 28 41 Variable Expression: FA64: double 42 ... with resolved type: 43 double 29 44 ... to: 45 char 46 ... with resolved type: 30 47 char 31 48 (types: -
tests/meta/.expect/archVast.nast.x64.txt
rf0d67e5 rb5629d8 3 3 Name: FX64 4 4 ... to: 5 char 6 ... with resolved type: 5 7 char Alternatives are: 6 8 Cost ( 1, 0, 0, 0, 0, 0, 0 ): Explicit Cast of: 7 9 Variable Expression: FX64: signed int 10 ... with resolved type: 11 signed int 8 12 ... to: 13 char 14 ... with resolved type: 9 15 char 10 16 (types: … … 18 24 ... returning nothing 19 25 26 ... with resolved type: 27 pointer to function 28 accepting unspecified arguments 29 ... returning nothing 30 20 31 ... to: 32 char 33 ... with resolved type: 21 34 char 22 35 (types: … … 27 40 Cost ( 1, 0, 0, 0, 0, 0, 0 ): Explicit Cast of: 28 41 Variable Expression: FX64: double 42 ... with resolved type: 43 double 29 44 ... to: 45 char 46 ... with resolved type: 30 47 char 31 48 (types: -
tests/meta/.expect/archVast.nast.x86.txt
rf0d67e5 rb5629d8 3 3 Name: FX86 4 4 ... to: 5 char 6 ... with resolved type: 5 7 char Alternatives are: 6 8 Cost ( 1, 0, 0, 0, 0, 0, 0 ): Explicit Cast of: 7 9 Variable Expression: FX86: signed int 10 ... with resolved type: 11 signed int 8 12 ... to: 13 char 14 ... with resolved type: 9 15 char 10 16 (types: … … 18 24 ... returning nothing 19 25 26 ... with resolved type: 27 pointer to function 28 accepting unspecified arguments 29 ... returning nothing 30 20 31 ... to: 32 char 33 ... with resolved type: 21 34 char 22 35 (types: … … 27 40 Cost ( 1, 0, 0, 0, 0, 0, 0 ): Explicit Cast of: 28 41 Variable Expression: FX86: double 42 ... with resolved type: 43 double 29 44 ... to: 45 char 46 ... with resolved type: 30 47 char 31 48 (types: -
tests/meta/.expect/archVast.oast.arm64.txt
rf0d67e5 rb5629d8 3 3 Name: FA64 4 4 ... to: 5 char 6 with resolved type: 5 7 char Alternatives are: 6 8 Cost ( 1, 0, 0, 0, 0, 0, 0 ): Explicit Cast of: … … 9 11 ... returning nothing 10 12 13 with resolved type: 14 pointer to function 15 accepting unspecified arguments 16 ... returning nothing 17 11 18 ... to: 19 char 20 with resolved type: 12 21 char 13 22 (types: … … 18 27 Cost ( 1, 0, 0, 0, 0, 0, 0 ): Explicit Cast of: 19 28 Variable Expression: FA64: double 29 with resolved type: 30 double 20 31 ... to: 32 char 33 with resolved type: 21 34 char 22 35 (types: … … 27 40 Cost ( 1, 0, 0, 0, 0, 0, 0 ): Explicit Cast of: 28 41 Variable Expression: FA64: signed int 42 with resolved type: 43 signed int 29 44 ... to: 45 char 46 with resolved type: 30 47 char 31 48 (types: -
tests/meta/.expect/archVast.oast.x64.txt
rf0d67e5 rb5629d8 3 3 Name: FX64 4 4 ... to: 5 char 6 with resolved type: 5 7 char Alternatives are: 6 8 Cost ( 1, 0, 0, 0, 0, 0, 0 ): Explicit Cast of: … … 9 11 ... returning nothing 10 12 13 with resolved type: 14 pointer to function 15 accepting unspecified arguments 16 ... returning nothing 17 11 18 ... to: 19 char 20 with resolved type: 12 21 char 13 22 (types: … … 18 27 Cost ( 1, 0, 0, 0, 0, 0, 0 ): Explicit Cast of: 19 28 Variable Expression: FX64: double 29 with resolved type: 30 double 20 31 ... to: 32 char 33 with resolved type: 21 34 char 22 35 (types: … … 27 40 Cost ( 1, 0, 0, 0, 0, 0, 0 ): Explicit Cast of: 28 41 Variable Expression: FX64: signed int 42 with resolved type: 43 signed int 29 44 ... to: 45 char 46 with resolved type: 30 47 char 31 48 (types: -
tests/meta/.expect/archVast.oast.x86.txt
rf0d67e5 rb5629d8 3 3 Name: FX86 4 4 ... to: 5 char 6 with resolved type: 5 7 char Alternatives are: 6 8 Cost ( 1, 0, 0, 0, 0, 0, 0 ): Explicit Cast of: … … 9 11 ... returning nothing 10 12 13 with resolved type: 14 pointer to function 15 accepting unspecified arguments 16 ... returning nothing 17 11 18 ... to: 19 char 20 with resolved type: 12 21 char 13 22 (types: … … 18 27 Cost ( 1, 0, 0, 0, 0, 0, 0 ): Explicit Cast of: 19 28 Variable Expression: FX86: double 29 with resolved type: 30 double 20 31 ... to: 32 char 33 with resolved type: 21 34 char 22 35 (types: … … 27 40 Cost ( 1, 0, 0, 0, 0, 0, 0 ): Explicit Cast of: 28 41 Variable Expression: FX86: signed int 42 with resolved type: 43 signed int 29 44 ... to: 45 char 46 with resolved type: 30 47 char 31 48 (types: -
tests/raii/.expect/ctor-autogen-ERR1.nast.txt
rf0d67e5 rb5629d8 7 7 signed int 8 8 ... returning nothing 9 10 ... with resolved type: 11 function 12 ... with parameters 13 reference to instance of struct Managed with body 14 signed int 15 ... returning nothing 9 16 10 17 ... deleted by: ?{}: function … … 23 30 signed int 24 31 32 ... with resolved type: 33 pointer to function 34 ... with parameters 35 reference to signed int 36 signed int 37 ... returning 38 signed int 39 25 40 ... to arguments 26 41 Generated Cast of: … … 30 45 Generated Cast of: 31 46 Variable Expression: m: reference to instance of struct Managed with body 47 ... with resolved type: 48 reference to instance of struct Managed with body 32 49 ... to: 33 50 instance of struct Managed with body 51 ... with resolved type: 52 instance of struct Managed with body 53 ... with resolved type: 54 signed int 34 55 ... to: 56 reference to signed int 57 ... with resolved type: 35 58 reference to signed int 36 59 Generated Cast of: 37 60 Constant Expression (0: zero_t) 61 ... with resolved type: 62 zero_t 38 63 ... to: 39 64 signed int 65 ... with resolved type: 66 signed int 40 67 68 ... with resolved type: 69 signed int 41 70 ... with environment: 42 71 Types: … … 47 76 Generated Cast of: 48 77 Variable Expression: x: instance of struct Managed with body 78 ... with resolved type: 79 instance of struct Managed with body 49 80 ... to: 50 81 reference to instance of struct Managed with body 82 ... with resolved type: 83 reference to instance of struct Managed with body 51 84 Constant Expression (123: signed int) 85 ... with resolved type: 86 signed int 52 87 88 ... with resolved type: 89 void 53 90 ... to: nothing 91 ... with resolved type: 92 void -
tests/raii/.expect/ctor-autogen-ERR1.oast.txt
rf0d67e5 rb5629d8 7 7 x: signed int 8 8 ... returning nothing 9 10 with resolved type: 11 function 12 ... with parameters 13 _dst: reference to instance of struct Managed with body 1 14 x: signed int 15 ... returning nothing 9 16 10 17 ... deleted by: ?{}: function … … 26 33 27 34 35 with resolved type: 36 pointer to function 37 ... with parameters 38 intrinsic reference to signed int 39 intrinsic signed int 40 ... returning 41 _retval__operator_assign: signed int 42 ... with attributes: 43 Attribute with name: unused 44 45 28 46 ... to arguments 29 47 Generated Cast of: … … 33 51 Generated Cast of: 34 52 Variable Expression: m: reference to instance of struct Managed with body 1 53 with resolved type: 54 reference to instance of struct Managed with body 1 35 55 ... to: 36 56 instance of struct Managed with body 1 57 with resolved type: 58 instance of struct Managed with body 1 59 with resolved type: 60 signed int 37 61 ... to: 62 reference to signed int 63 with resolved type: 38 64 reference to signed int 39 65 Generated Cast of: 40 66 constant expression (0 0: zero_t) 67 with resolved type: 68 zero_t 41 69 ... to: 42 70 signed int 71 with resolved type: 72 signed int 43 73 74 with resolved type: 75 signed int 44 76 ... with environment: 45 77 Types: … … 50 82 Generated Cast of: 51 83 Variable Expression: x: instance of struct Managed with body 1 84 with resolved type: 85 instance of struct Managed with body 1 52 86 ... to: 53 87 reference to instance of struct Managed with body 1 88 with resolved type: 89 reference to instance of struct Managed with body 1 54 90 constant expression (123 123: signed int) 91 with resolved type: 92 signed int 55 93 94 with resolved type: 95 void 56 96 ... to: nothing 97 with resolved type: 98 void -
tests/warnings/.expect/self-assignment.nast.txt
rf0d67e5 rb5629d8 1 1 warnings/self-assignment.cfa:29:1 warning: self assignment of expression: Generated Cast of: 2 2 Variable Expression: j: signed int 3 ... with resolved type: 4 signed int 3 5 ... to: 6 reference to signed int 7 ... with resolved type: 4 8 reference to signed int 5 9 warnings/self-assignment.cfa:30:1 warning: self assignment of expression: Generated Cast of: 6 10 Variable Expression: s: instance of struct S with body 11 ... with resolved type: 12 instance of struct S with body 7 13 ... to: 14 reference to instance of struct S with body 15 ... with resolved type: 8 16 reference to instance of struct S with body 9 17 warnings/self-assignment.cfa:31:1 warning: self assignment of expression: Generated Cast of: … … 12 20 ... from aggregate: 13 21 Variable Expression: s: instance of struct S with body 22 ... with resolved type: 23 instance of struct S with body 24 ... with resolved type: 25 signed int 14 26 ... to: 27 reference to signed int 28 ... with resolved type: 15 29 reference to signed int 16 30 warnings/self-assignment.cfa:32:1 warning: self assignment of expression: Generated Cast of: … … 22 36 ... from aggregate: 23 37 Variable Expression: t: instance of struct T with body 38 ... with resolved type: 39 instance of struct T with body 40 ... with resolved type: 41 instance of struct S with body 42 ... with resolved type: 43 signed int 24 44 ... to: 45 reference to signed int 46 ... with resolved type: 25 47 reference to signed int 26 48 warnings/self-assignment.cfa: In function '_X4mainFi___1': -
tests/warnings/.expect/self-assignment.oast.txt
rf0d67e5 rb5629d8 1 1 warnings/self-assignment.cfa:29:1 warning: self assignment of expression: Generated Cast of: 2 2 Variable Expression: j: signed int 3 with resolved type: 4 signed int 3 5 ... to: 6 reference to signed int 7 with resolved type: 4 8 reference to signed int 5 9 warnings/self-assignment.cfa:30:1 warning: self assignment of expression: Generated Cast of: 6 10 Variable Expression: s: instance of struct S with body 1 11 with resolved type: 12 instance of struct S with body 1 7 13 ... to: 14 reference to instance of struct S with body 1 15 with resolved type: 8 16 reference to instance of struct S with body 1 9 17 warnings/self-assignment.cfa:31:1 warning: self assignment of expression: Generated Cast of: … … 12 20 ... from aggregate: 13 21 Variable Expression: s: instance of struct S with body 1 22 with resolved type: 23 instance of struct S with body 1 24 with resolved type: 25 signed int 14 26 ... to: 27 reference to signed int 28 with resolved type: 15 29 reference to signed int 16 30 warnings/self-assignment.cfa:32:1 warning: self assignment of expression: Generated Cast of: … … 22 36 ... from aggregate: 23 37 Variable Expression: t: instance of struct T with body 1 38 with resolved type: 39 instance of struct T with body 1 40 with resolved type: 41 instance of struct S with body 1 42 with resolved type: 43 signed int 24 44 ... to: 45 reference to signed int 46 with resolved type: 25 47 reference to signed int 26 48 warnings/self-assignment.cfa: In function '_X4mainFi___1':
Note: See TracChangeset
for help on using the changeset viewer.