Changeset b5629d8


Ignore:
Timestamp:
Dec 3, 2020, 1:49:01 PM (4 years ago)
Author:
Thierry Delisle <tdelisle@…>
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.
Message:

Merge branch 'master' of plg.uwaterloo.ca:software/cfa/cfa-cc

Files:
5 added
38 edited
4 moved

Legend:

Unmodified
Added
Removed
  • libcfa/src/bits/collection.hfa

    rf0d67e5 rb5629d8  
    1313        // return true iff *this is an element of a collection
    1414        bool listed( Colable & co ) with( co ) {                        // pre: this != 0
    15                 return next != 0;
     15                return next != 0p;
    1616        }
    1717
     
    2323                return cp->next;
    2424        }
     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
    2535} // distribution
     36
    2637
    2738struct Collection {
     
    4152                return root == 0p;
    4253        }
     54
    4355        void * head( Collection & collection ) with( collection ) {
    4456                return root;
     
    5567                curr = 0p;
    5668        } // post: elts = null
     69
     70        forall( dtype T ) {
     71                T * Curr( ColIter & ci ) with( ci ) {
     72                        return (T *)curr;
     73                }
     74        } // distribution
    5775} // distribution
  • libcfa/src/bits/queue.hfa

    rf0d67e5 rb5629d8  
    1414                        return (T *)head( (Collection &)q );
    1515                } // post: empty() & head() == 0 | !empty() & head() in *q
    16 
    17                 bool empty( Queue(T) & q ) with( q ) {                  // 0 <=> *q contains no elements
    18                         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                 }
    3216
    3317                void ?{}( Queue(T) &, const Queue(T) & ) = void; // no copy
     
    5539#endif // __CFA_DEBUG__
    5640                        if ( last ) {
    57                                 Next( n ) = Root( q );
     41                                Next( n ) = head( q );
    5842                                q.root = n;
    5943                        } else {
     
    8165                        if ( root ) {
    8266                                root = Next( root );
    83                                 if ( Root( q ) == t ) {
     67                                if ( head( q ) == t ) {
    8468                                        root = last = 0p;                                       // only one element
    8569                                }
     
    132116                                root = from.root;
    133117                        } else {                                                                        // "to" list not empty
    134                                 Next( last ) = Root( from );
     118                                Next( last ) = head( from );
    135119                        }
    136120                        last = from.last;
     
    148132                        to.last = n;                                                            // end of "to" list
    149133                        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 ?
    151135                                from.root = from.last = 0p;                             // mark "from" list empty
    152136                        } else {
     
    164148
    165149        inline {
    166                 // wrappers to make ColIter have T
    167                 T * Curr( QueueIter(T) & qi ) with( qi ) {
    168                         return (T *)curr;
    169                 }
    170 
    171150                void ?{}( QueueIter(T) & qi ) with( qi ) {
    172151                        ((ColIter &)qi){};
     
    187166                } // post: curr = {e in q}
    188167
    189                 bool ?>>?( QueueIter(T) & qi, T *& tp ) with( qi ) {
     168                bool ?>>?( QueueIter(T) & qi, T && tp ) with( qi ) {
    190169                        if ( curr ) {
    191                                 tp = Curr( qi );
     170                                &tp = Curr( qi );
    192171                                T * n = Next( Curr( qi ) );
    193172                                curr = (n == Curr( qi ) ) ? 0p : n;
    194                         } else tp = 0p;
    195                         return tp != 0p;
     173                        } else &tp = 0p;
     174                        return &tp != 0p;
    196175                }
    197176                // post: elts == null & !operator>>(tp) | elts != null & *tp' in elts & elts' == elts - *tp & operator>>(tp)
  • libcfa/src/bits/queue_example.cfa

    rf0d67e5 rb5629d8  
    1717        Queue(Fred) fred;
    1818        QueueIter(Fred) fredIter = { fred };
    19         Fred * f;
    20         int i;
     19        Fred & f;
    2120
    2221        sout | nlOff;                                                                           // turn off auto newline
    2322
    2423        for ( ; fredIter >> f; ) {                                                      // empty list
    25                 sout | f->i | ' ';
     24                sout | f.i | ' ';
    2625        }
    2726        sout | "empty" | nl;
    2827       
    29         for ( i = 0; i < 10; i += 1 ) {
     28        for ( i; 10 ) {
    3029                add( fred, new( 2 * i ) );
    3130        }
    3231
    33         for ( over( fredIter, fred ); fredIter >> f; ) {
    34                 sout | f->i | ' ';
     32        for ( QueueIter(Fred) iter = { fred }; iter >> f; ) {
     33                sout | f.i | ' ';
    3534        }
    3635        sout | nl;
    3736
    38         for ( i = 0; i < 9; i += 1 ) {
     37        for ( i; 9 ) {
    3938                delete( drop( fred ) );
    4039        }
    4140
    4241        for ( over( fredIter, fred ); fredIter >> f; ) {
    43                 sout | f->i | ' ';
     42                sout | f.i | ' ';
    4443        }
    4544        sout | nl;
    4645       
    47         for ( i = 0; i < 10; i += 1 ) {
     46        for ( i; 10 ) {
    4847                add( fred, new( 2 * i + 1 ) );
    4948        }
    5049        for ( over( fredIter, fred ); fredIter >> f; ) {
    51                 sout | f->i | ' ';
     50                sout | f.i | ' ';
    5251        }
    5352        sout | nl;
    5453
    5554        for ( over( fredIter, fred ); fredIter >> f; ) {
    56                 delete( f );
     55                delete( &f );
    5756        }
    5857
     
    7170        Queue(Mary) mary;
    7271        QueueIter(Mary) maryIter = { mary };
    73         Mary * m;
     72        Mary & m;
    7473
    7574        for ( ; maryIter >> m; ) {                                                      // empty list
    76                 sout | m->i | m->j | ' ';
     75                sout | m.i | m.j | ' ';
    7776        }
    7877        sout | "empty" | nl;
    7978       
    80         for ( i = 0; i < 10; i += 1 ) {
     79        for ( i; 10 ) {
    8180                add( mary, new( 2 * i ) );
    8281        }
    8382
    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 | ' ';
    8685        }
    8786        sout | nl;
    8887       
    89         for ( i = 0; i < 9; i += 1 ) {
     88        for ( i; 9 ) {
    9089                delete( drop( mary ) );
    9190        }
    9291
    9392        for ( over( maryIter, mary ); maryIter >> m; ) {
    94                 sout | m->i | m->j | ' ';
     93                sout | m.i | m.j | ' ';
    9594        }
    9695        sout | nl;
    9796       
    98         for ( i = 0; i < 10; i += 1 ) {
     97        for ( i; 10 ) {
    9998                add( mary, new( 2 * i + 1 ) );
    10099        }
    101100        for ( over( maryIter, mary ); maryIter >> m; ) {
    102                 sout | m->i | m->j | ' ';
     101                sout | m.i | m.j | ' ';
    103102        }
    104103        sout | nl;
    105104
    106105        for ( over( maryIter, mary ); maryIter >> m; ) {
    107                 delete( m );
     106                delete( &m );
    108107        }
    109108}
  • libcfa/src/bits/sequence.hfa

    rf0d67e5 rb5629d8  
    1010inline {
    1111        void ?{}( Seqable & sq ) with( sq ) {
    12                 ((Colable & ) sq){};
     12                ((Colable &) sq){};
    1313                back = 0p;
    1414        } // post: ! listed()
     
    3434                } // post: empty() & head() == 0 | !empty() & head() in *s
    3535
    36                 bool empty( Sequence(T) & s ) with( s ) {               // 0 <=> *s contains no elements
    37                         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 
    4836                T *& Back( T * n ) {
    4937                        return (T *)Back( (Seqable *)n );
    50                 }
    51 
    52                 T * Root( Sequence(T) & s ) with( s ) {
    53                         return (T *)root;
    5438                }
    5539
     
    6246
    6347                // 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?
    6650                }       // post: empty() & tail() == 0 | !empty() & tail() in *s
    6751
     
    7155                        if ( ! listed( n ) ) abort( "(Sequence &)%p.succ( %p ) : Node is not on a list.", &s, n );
    7256#endif // __CFA_DEBUG__
    73                         return Next( n ) == Root( s ) ? 0p : Next( n );
     57                        return Next( n ) == head( s ) ? 0p : Next( n );
    7458                }       // post: n == tail() & succ(n) == 0 | n != tail() & *succ(n) in *s
    7559
     
    7963                        if ( ! listed( n ) ) abort( "(Sequence &)%p.pred( %p ) : Node is not on a list.", &s, n );
    8064#endif // __CFA_DEBUG__
    81                         return n == Root( s ) ? 0p : Back( n );
     65                        return n == head( s ) ? 0p : Back( n );
    8266                }       // post: n == head() & head(n) == 0 | n != head() & *pred(n) in *s
    8367
    8468
    8569                // 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 *s
    87 #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 root
     70                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
    9175                                if ( root ) {
    92                                         Next( n ) = Root( s );
    93                                         Back( n ) = Back( Root( s ) );
     76                                        Next( &n ) = head( s );
     77                                        Back( &n ) = Back( head( s ) );
    9478                                        // inserted node must be consistent before it is seen
    9579                                        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;
    9882                                } else {
    99                                         Next( n ) = n;
    100                                         Back( n ) = n;
     83                                        Next( &n ) = &n;
     84                                        Back( &n ) = &n;
    10185                                } // if
    10286                                // inserted node must be consistent before it is seen
    10387                                asm( "" : : : "memory" );                               // prevent code movement across barrier
    104                                 root = n;
     88                                root = &n;
    10589                        } 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 );
    10993                                // inserted node must be consistent before it is seen
    11094                                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;
    11397                        } // if
    11498                }       // post: n->listed() & *n in *s & succ(n) == bef
     
    116100
    117101                // 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 *s
    119 #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 root
     102                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
    123107                                if ( root ) {
    124                                         Next( n ) = Root( s );
    125                                         Back( n ) = Back( Root( s ) );
     108                                        Next( &n ) = head( s );
     109                                        Back( &n ) = Back( head( s ) );
    126110                                        // inserted node must be consistent before it is seen
    127111                                        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;
    130114                                } else {
    131                                         Next( n ) = n;
    132                                         Back( n ) = n;
     115                                        Next( &n ) = &n;
     116                                        Back( &n ) = &n;
    133117                                } // if
    134118                                asm( "" : : : "memory" );                               // prevent code movement across barrier
    135                                 root = n;
     119                                root = &n;
    136120                        } else {
    137                                 Next( n ) = Next( aft );
    138                                 Back( n ) = aft;
     121                                Next( &n ) = Next( &aft );
     122                                Back( &n ) = &aft;
    139123                                // inserted node must be consistent before it is seen
    140124                                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;
    143127                        } // if
    144128                }         // post: n->listed() & *n in *s & succ(n) == bef
    145129               
    146130                // 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;
    158142                }                                                       // post: !n->listed().
    159143
    160144                // Add an element to the head of the sequence.
    161                 void addHead( Sequence(T) & s, T *n ) {                 // pre: !n->listed(); post: n->listed() & head() == n
    162                         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 );
    163147                }
    164148                // Add an element to the tail of the sequence.
    165                 void addTail( Sequence(T) & s, T *n ) {                 // pre: !n->listed(); post: n->listed() & head() == n
    166                         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 );
    167151                }
    168152                // Add an element to the tail of the sequence.
    169                 void add( Sequence(T) & s, T *n ) {                             // pre: !n->listed(); post: n->listed() & head() == n
     153                void add( Sequence(T) & s, T & n ) {                    // pre: !n->listed(); post: n->listed() & head() == n
    170154                        addTail( s, n );
    171155                }
    172156                // Remove and return the head element in the sequence.
    173                 T * dropHead( Sequence(T) & s ) {
     157                T & dropHead( Sequence(T) & s ) {
    174158                        T * n = head( s );
    175                         return n ? remove( s, n ), n : 0p;
     159                        return n ? remove( s, *n ), *n : *0p;
    176160                }
    177161                // Remove and return the head element in the sequence.
    178                 T * drop( Sequence(T) & s ) {
     162                T & drop( Sequence(T) & s ) {
    179163                        return dropHead( s );
    180164                }
    181165                // 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;
    185169                }
    186170
     
    191175                                root = from.root;
    192176                        } 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 ) );
    195179                                Back( root ) = fromEnd;
    196                                 Next( fromEnd ) = Root( s );
     180                                Next( fromEnd ) = head( s );
    197181                                Back( from.root ) = toEnd;
    198                                 Next( toEnd ) = Root( from );
     182                                Next( toEnd ) = head( from );
    199183                        } // if
    200184                        from.root = 0p;                                                         // mark "from" list empty
     
    213197                                from.root = 0p;                                                 // mark "from" list empty
    214198                        } else {
    215                                 Back( Root( from ) ) = Back( Root( to ) ); // fix "from" list
    216                                 Next( Back( Root( to ) ) ) = Root( from );
    217                                 Next( n ) = Root( to );                                 // fix "to" list
    218                                 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;
    219203                        } // if
    220204                        transfer( s, to );
     
    231215
    232216        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){};
    240219                        seq = 0p;
    241220                } // post: elts = null.
     
    244223                        ((ColIter &) si){};
    245224                        seq = &s;
     225                        curr = head( s );
    246226                } // post: elts = null.
    247227               
     
    251231                } // post: elts = {e in s}.
    252232
    253                 bool ?>>?( SeqIter(T) & si, T *& tp ) with( si ) {
     233                bool ?>>?( SeqIter(T) & si, T && tp ) with( si ) {
    254234                        if ( curr ) {
    255                                 tp = Curr( si );
    256                                 T *n = succ( *seq, Curr( si ) );
     235                                &tp = Curr( si );
     236                                T * n = succ( *seq, Curr( si ) );
    257237                                curr = n == head( *seq ) ? 0p : n;
    258                         } else tp = 0p;
    259                         return tp != 0p;
     238                        } else &tp = 0p;
     239                        return &tp != 0p;
    260240                }
    261241        } // distribution
     
    269249
    270250        inline {
    271                 // wrappers to make ColIter have T
    272                 T * Curr( SeqIterRev(T) & si ) with( si ) {
    273                         return (T *)curr;
    274                 }
    275 
    276251                void ?{}( SeqIterRev(T) & si ) with( si ) {     
    277252                        ((ColIter &) si){};
     
    282257                        ((ColIter &) si){};
    283258                        seq = &s;
     259                        curr = &tail( s );
    284260                } // post: elts = null.
    285261               
    286262                void over( SeqIterRev(T) & si, Sequence(T) & s ) with( si ) {
    287263                        seq = &s;
    288                         curr = tail( s );
     264                        curr = &tail( s );
    289265                } // post: elts = {e in s}.
    290266
    291                 bool ?>>?( SeqIterRev(T) & si, T *&tp ) with( si ) {
     267                bool ?>>?( SeqIterRev(T) & si, T && tp ) with( si ) {
    292268                        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;
    298274                }
    299275        } // distribution
  • libcfa/src/bits/sequence_example.cfa

    rf0d67e5 rb5629d8  
    1717        Sequence(Fred) fred;
    1818        SeqIter(Fred) fredIter = { fred };
    19         Fred * f;
    20         int i;
     19        Fred & f;
    2120
    2221        sout | nlOff;                                                                           // turn off auto newline
    2322
    2423        for ( ; fredIter >> f; ) {                                                      // empty list
    25                 sout | f->i | ' ';
     24                sout | f.i | ' ';
    2625        }
    2726        sout | "empty" | nl;
    2827       
    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 ) );
    3139        }
    3240
    3341        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 | ' ';
    3551        }
    3652        sout | nl;
    3753
    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 ) );
    4956        }
    5057        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 | ' ';
    6059        }
    6160        sout | nl;
    6261
    6362        for ( over( fredIter, fred ); fredIter >> f; ) {
    64                 delete( f );
     63                delete( &f );
    6564        }
    6665
     
    8079        Sequence(Mary) baz;
    8180        SeqIter(Mary) maryIter = { mary };
    82         Mary * m;
     81        Mary & m;
    8382
    8483        for ( ; maryIter >> m; ) {                                                      // empty list
    85                 sout | m->i | m->j | ' ';
     84                sout | m.i | m.j | ' ';
    8685        }
    8786        sout | "empty" | nl;
    8887       
    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 ) );
    92100        }
    93101
    94102        for ( over( maryIter, mary ); maryIter >> m; ) {
    95                 sout | m->i | m->j | ' ';
     103                sout | m.i | m.j | ' ';
    96104        }
    97105        sout | nl;
    98106       
    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 ) );
    110109        }
    111110        for ( over( maryIter, mary ); maryIter >> m; ) {
    112                 sout | m->i | m->j | ' ';
     111                sout | m.i | m.j | ' ';
    113112        }
    114113        sout | nl;
    115114
    116         for ( i = 0; i < 9; i += 1 ) {
    117                 delete( dropTail( mary ) );
     115        for ( i; 9 ) {
     116                delete( &dropTail( mary ) );
    118117        }
    119118        for ( over( maryIter, mary ); maryIter >> m; ) {
    120                 sout | m->i | m->j | ' ';
     119                sout | m.i | m.j | ' ';
    121120        }
    122121        sout | nl;
     
    125124
    126125        for ( over( maryIter, baz ); maryIter >> m; ) {
    127                 sout | m->i | m->j | ' ';
     126                sout | m.i | m.j | ' ';
    128127        }
    129128        sout | "empty" | nl;
    130129
    131130        for ( over( maryIter, mary ); maryIter >> m; ) {
    132                 sout | m->i | m->j | ' ';
     131                sout | m.i | m.j | ' ';
    133132        }
    134133        sout | nl;
    135134
    136135        for ( over( maryIter, mary ); maryIter >> m; ) {
    137                 delete( m );
     136                delete( &m );
    138137        }
    139138}
    140139
    141140// Local Variables: //
    142 // compile-command: "cfa sequence_example.cc" //
     141// compile-command: "cfa sequence_example.cfa" //
    143142// End: //
  • libcfa/src/bits/stack.hfa

    rf0d67e5 rb5629d8  
    1414                } // post: empty() & head() == 0 | !empty() & head() in *this
    1515
    16                 bool empty( Stack(T) & s ) with( s ) {                  // 0 <=> *this contains no elements
    17                         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 
    2816                void ?{}( Stack(T) &, const Stack(T) & ) = void; // no copy
    2917                Stack(T) & ?=?( const Stack(T) & ) = void;              // no assignment
     
    3321                } // post: empty()
    3422
    35                 T * top( Stack(T) & s ) with( s ) {
    36                         return head( s );
     23                T & top( Stack(T) & s ) with( s ) {
     24                        return *head( s );
    3725                }
    3826
    39                 void addHead( Stack(T) & s, T * n ) with( s ) {
     27                void addHead( Stack(T) & s, T & n ) with( s ) {
    4028#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 );
    4230#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;
    4533                }
    4634
    47                 void add( Stack(T) & s, T * n ) with( s ) {
     35                void add( Stack(T) & s, T & n ) with( s ) {
    4836                        addHead( s, n );
    4937                }
    5038
    51                 void push( Stack(T) & s, T * n ) with( s ) {
     39                void push( Stack(T) & s, T & n ) with( s ) {
    5240                        addHead( s, n );
    5341                }
    5442
    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 );
    5745                        if ( root ) {
    5846                                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;
    6149                        } // if
    6250                        return t;
    6351                }
    6452
    65                 T * pop( Stack(T) & s ) with( s ) {
     53                T & pop( Stack(T) & s ) with( s ) {
    6654                        return drop( s );
    6755                }
     
    7664
    7765        inline {
    78                 // wrappers to make ColIter have T
    79                 T * Curr( StackIter(T) & si ) with( si ) {
    80                         return (T *)curr;
    81                 }
    82 
    8366                void ?{}( StackIter(T) & si ) with( si ) {
    8467                        ((ColIter &)si){};
     
    9073                } // post: curr = {e in s}
    9174
    92                 void ?{}( StackIter(T) & si, T * start ) with( si ) {
    93                         curr = start;
     75                void ?{}( StackIter(T) & si, T & start ) with( si ) {
     76                        curr = &start;
    9477                } // post: curr = {e in s}
    9578
     
    9982                } // post: curr = {e in s}
    10083
    101                 bool ?>>?( StackIter(T) & si, T *& tp ) with( si ) {
     84                bool ?>>?( StackIter(T) & si, T && tp ) with( si ) {
    10285                        if ( curr ) {
    103                                 tp = Curr( si );
     86                                &tp = Curr( si );
    10487                                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;
    10891                }
    10992        } // distribution
  • libcfa/src/bits/stack_example.cfa

    rf0d67e5 rb5629d8  
    1717        Stack(Fred) fred;
    1818        StackIter(Fred) fredIter = { fred };
    19         Fred * f;
    20         int i;
     19        Fred & f;
    2120
    2221        sout | nlOff;                                                                           // turn off auto newline
    2322
    2423        for ( ; fredIter >> f; ) {                                                      // empty list
    25                 sout | f->i | ' ';
     24                sout | f.i | ' ';
    2625        }
    2726        sout | "empty" | nl;
    2827       
    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 ) );
    3139        }
    3240
    3341        for ( over( fredIter, fred ); fredIter >> f; ) {
    34                 sout | f->i | ' ';
     42                sout | f.i | ' ';
    3543        }
    3644        sout | nl;
    3745       
    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 ) );
    4948        }
    5049        for ( over( fredIter, fred ); fredIter >> f; ) {
    51                 sout | f->i | ' ';
     50                sout | f.i | ' ';
    5251        }
    5352        sout | nl;
    5453
    5554        for ( over( fredIter, fred ); fredIter >> f; ) {
    56                 delete( f );
     55                delete( &f );
    5756        }
    5857
     
    7170        Stack(Mary) mary;
    7271        StackIter(Mary) maryIter = { mary };
    73         Mary * m;
     72        Mary & m;
    7473
    7574        for ( ; maryIter >> m; ) {                                                      // empty list
    76                 sout | m->i | m->j | ' ';
     75                sout | m.i | m.j | ' ';
    7776        }
    7877        sout | "empty" | nl;
    7978       
    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 ) );
    8290        }
    8391
    8492        for ( over( maryIter, mary ); maryIter >> m; ) {
    85                 sout | m->i | m->j | ' ';
     93                sout | m.i | m.j | ' ';
    8694        }
    8795        sout | nl;
    8896       
    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 ) );
    10099        }
    101100        for ( over( maryIter, mary ); maryIter >> m; ) {
    102                 sout | m->i | m->j | ' ';
     101                sout | m.i | m.j | ' ';
    103102        }
    104103        sout | nl;
    105104
    106105        for ( over( maryIter, mary ); maryIter >> m; ) {
    107                 delete( m );
     106                delete( &m );
    108107        }
    109108}
  • src/AST/Print.cpp

    rf0d67e5 rb5629d8  
    205205
    206206        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                }
    208211
    209212                if ( ! short_mode && node->linkage != Linkage::Cforall ) {
     
    240243
    241244                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;
    249250                }
    250251
     
    13821383        virtual const ast::Type * visit( const ast::TypeInstType * node ) override final {
    13831384                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
    13851387                   << " (" << (node->kind == ast::TypeDecl::Ftype ? "" : "not ") << "function type)";
    13861388                print( node->params );
  • src/AST/Type.cpp

    rf0d67e5 rb5629d8  
    133133
    134134BaseInstType::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 ),
    136136  hoistType( o.hoistType ) {
    137137        Pass< ForallSubstitutor > sub;
     
    222222                // TODO: once TypeInstType representation is updated, it should properly check
    223223                // 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
     229bool 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;
    227236        }
    228237        return false;
  • src/AST/Type.hpp

    rf0d67e5 rb5629d8  
    536536
    537537bool isUnboundType(const Type * type);
     538bool isUnboundType(const std::string & tname);
    538539
    539540}
  • src/AST/TypeEnvironment.cpp

    rf0d67e5 rb5629d8  
    3434#include "ResolvExpr/Unify.h"      // for unifyInexact
    3535#include "Tuples/Tuples.h"         // for isTtype
     36#include "CompilationState.h"
    3637
    3738using ResolvExpr::WidenMode;
     
    5657
    5758void 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        }
    6067        out << ")";
    6168
  • src/Common/CodeLocation.h

    rf0d67e5 rb5629d8  
    4242        }
    4343
    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 {
    4556                return (first_line + seperation == other.first_line &&
    4657                        filename == other.filename);
    4758        }
    4859
    49         bool operator==( CodeLocation const & other ) {
     60        bool operator==( CodeLocation const & other ) const {
    5061                return followedBy( other, 0 );
    5162        }
    5263
    53         bool operator!=( CodeLocation const & other ) {
     64        bool operator!=( CodeLocation const & other ) const {
    5465                return !(*this == other);
    5566        }
  • src/Common/SemanticError.cc

    rf0d67e5 rb5629d8  
    9090void SemanticErrorException::print() {
    9191        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
    92100        for( auto err : errors ) {
    93101                std::cerr << ErrorHelpers::bold() << err.location << ErrorHelpers::error_str() << ErrorHelpers::reset_font() << err.description << std::endl;
  • src/ResolvExpr/AlternativeFinder.cc

    rf0d67e5 rb5629d8  
    132132        void printAlts( const AltList &list, std::ostream &os, unsigned int indentAmt ) {
    133133                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
    134157                for ( AltList::const_iterator i = list.begin(); i != list.end(); ++i ) {
    135158                        i->print( os, indent );
     
    17181741                                        std::cerr << std::endl;
    17191742                                )
    1720                                
     1743
    17211744                                if ( thisCost != Cost::infinity ) {
    17221745                                        // count one safe conversion for each value that is thrown away
  • src/ResolvExpr/TypeEnvironment.cc

    rf0d67e5 rb5629d8  
    107107
    108108        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 << ")";
    114118                if ( type ) {
    115119                        os << " -> ";
  • src/ResolvExpr/TypeEnvironment.h

    rf0d67e5 rb5629d8  
    149149                iterator end() const { return env.end(); }
    150150
     151                auto size() const { return env.size(); }
     152
    151153          private:
    152154                ClassList env;
  • src/SynTree/Expression.cc

    rf0d67e5 rb5629d8  
    7272
    7373        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 );
    7977        }
    8078
  • src/SynTree/NamedTypeDecl.cc

    rf0d67e5 rb5629d8  
    2222#include "LinkageSpec.h"         // for Spec, Cforall, linkageName
    2323#include "Type.h"                // for Type, Type::StorageClasses
     24#include "CompilationState.h"
    2425
    2526NamedTypeDecl::NamedTypeDecl( const std::string &name, Type::StorageClasses scs, Type *base )
     
    4142        using namespace std;
    4243
    43         if ( name != "" ) os << name << ": ";
     44        if ( ! name.empty() ) {
     45                if( deterministic_output && isUnboundType(name) ) os << "[unbound]:";
     46                else os << name << ": ";
     47        }
    4448
    4549        if ( linkage != LinkageSpec::Cforall ) {
  • src/SynTree/ReferenceToType.cc

    rf0d67e5 rb5629d8  
    2424#include "Type.h"             // for TypeInstType, StructInstType, UnionInstType
    2525#include "TypeSubstitution.h" // for TypeSubstitution
     26#include "CompilationState.h"
    2627
    2728class Attribute;
     
    205206
    206207        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)";
    208213        if ( ! parameters.empty() ) {
    209214                os << endl << indent << "... with parameters" << endl;
  • src/SynTree/Type.cc

    rf0d67e5 rb5629d8  
    156156const Type::Qualifiers noQualifiers;
    157157
     158bool 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
     169bool 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
    158180// Local Variables: //
    159181// tab-width: 4 //
  • src/SynTree/Type.h

    rf0d67e5 rb5629d8  
    733733};
    734734
     735
     736bool isUnboundType(const Type * type);
     737bool isUnboundType(const std::string & tname);
     738
    735739// Local Variables: //
    736740// tab-width: 4 //
  • tests/.expect/alloc-ERROR.nast.txt

    rf0d67e5 rb5629d8  
    1616          Name: stp
    1717
     18      ... with resolved type:
     19        unsigned long int
    1820
    1921
     
    2830    Name: stp
    2931    Constant Expression (10: signed int)
     32    ... with resolved type:
     33      signed int
    3034
    3135
  • tests/.expect/alloc-ERROR.oast.txt

    rf0d67e5 rb5629d8  
    1616          Name: stp
    1717
     18      with resolved type:
     19        unsigned long int
    1820
    1921
     
    2830    Name: stp
    2931    constant expression (10 10: signed int)
     32    with resolved type:
     33      signed int
    3034
    3135
  • tests/.expect/castError.oast.txt

    rf0d67e5 rb5629d8  
    33  Name: f
    44... to:
     5  char
     6with resolved type:
    57  char Alternatives are:
    68Cost ( 1, 0, 0, 0, 0, 0, 0 ): Explicit Cast of:
     
    911      ... returning nothing
    1012
     13      with resolved type:
     14        pointer to function
     15          accepting unspecified arguments
     16        ... returning nothing
     17
    1118    ... to:
     19      char
     20    with resolved type:
    1221      char
    1322  (types:
     
    1827Cost ( 1, 0, 0, 0, 0, 0, 0 ): Explicit Cast of:
    1928      Variable Expression: f: double
     29      with resolved type:
     30        double
    2031    ... to:
     32      char
     33    with resolved type:
    2134      char
    2235  (types:
     
    2740Cost ( 1, 0, 0, 0, 0, 0, 0 ): Explicit Cast of:
    2841      Variable Expression: f: signed int
     42      with resolved type:
     43        signed int
    2944    ... to:
     45      char
     46    with resolved type:
    3047      char
    3148  (types:
     
    3956  Comma Expression:
    4057    constant expression (3 3: signed int)
     58    with resolved type:
     59      signed int
    4160    Name: v
    42 ... to: nothing Alternatives are:
     61... to: nothing
     62with resolved type:
     63  void  Alternatives are:
    4364Cost ( 0, 0, 2, 0, 0, 0, 0 ): Generated Cast of:
    4465      Comma Expression:
    4566        constant expression (3 3: signed int)
     67        with resolved type:
     68          signed int
    4669        Variable Expression: v: unsigned char
     70        with resolved type:
     71          unsigned char
     72      with resolved type:
     73        unsigned char
    4774    ... to: nothing
     75    with resolved type:
     76      void
    4877  (types:
    4978    void
     
    5483      Comma Expression:
    5584        constant expression (3 3: signed int)
     85        with resolved type:
     86          signed int
    5687        Variable Expression: v: signed short int
     88        with resolved type:
     89          signed short int
     90      with resolved type:
     91        signed short int
    5792    ... to: nothing
     93    with resolved type:
     94      void
    5895  (types:
    5996    void
     
    69106    char
    70107
     108with resolved type:
     109  instance of struct S with body 1
     110  ... with parameters
     111    char
     112
  • tests/.expect/init1-ERROR.nast.txt

    rf0d67e5 rb5629d8  
    1111... to:
    1212  reference to signed int
     13... with resolved type:
     14  reference to signed int
    1315init1.cfa:107:1 error: Invalid application of existing declaration(s) in expression Applying untyped:
    1416  Name: ?{}
     
    1618  Generated Cast of:
    1719    Variable Expression: _retval_f_py: pointer to signed int
     20    ... with resolved type:
     21      pointer to signed int
    1822  ... to:
     23    reference to pointer to signed int
     24  ... with resolved type:
    1925    reference to pointer to signed int
    2026  Name: px
     
    2430... to:
    2531  reference to float
     32... with resolved type:
     33  reference to float
    2634init1.cfa:117:1 error: Invalid application of existing declaration(s) in expression Applying untyped:
    2735  Name: ?{}
     
    2937  Generated Cast of:
    3038    Variable Expression: _retval_f_py2: pointer to float
     39    ... with resolved type:
     40      pointer to float
    3141  ... to:
     42    reference to pointer to float
     43  ... with resolved type:
    3244    reference to pointer to float
    3345  Name: cpx
     
    3749... to:
    3850  reference to instance of type T (not function type)
     51... with resolved type:
     52  reference to instance of type T (not function type)
    3953init1.cfa:128:1 error: Invalid application of existing declaration(s) in expression Applying untyped:
    4054  Name: ?{}
     
    4256  Generated Cast of:
    4357    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)
    4460  ... to:
     61    reference to pointer to instance of type T (not function type)
     62  ... with resolved type:
    4563    reference to pointer to instance of type T (not function type)
    4664  Name: s
  • tests/.expect/init1-ERROR.oast.txt

    rf0d67e5 rb5629d8  
    11error: No reasonable alternatives for expression Untyped Init Expression
    2   Name: rx  InitAlternative: reference to signed int
     2  Name: cpx  InitAlternative: pointer to float
     3error: No reasonable alternatives for expression Untyped Init Expression
     4  Name: crx  InitAlternative: reference to float
    35error: No reasonable alternatives for expression Untyped Init Expression
    46  Name: px  InitAlternative: pointer to signed int
    57error: 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
    99init1.cfa:104:1 error: No reasonable alternatives for expression Generated Cast of:
    1010  Name: rx
    1111... to:
     12  reference to signed int
     13with resolved type:
    1214  reference to signed int
    1315init1.cfa:107:1 error: No reasonable alternatives for expression Applying untyped:
     
    1618  Generated Cast of:
    1719    Variable Expression: _retval_f_py: pointer to signed int
     20    with resolved type:
     21      pointer to signed int
    1822  ... to:
     23    reference to pointer to signed int
     24  with resolved type:
    1925    reference to pointer to signed int
    2026  Name: px
     
    2430... to:
    2531  reference to float
     32with resolved type:
     33  reference to float
    2634init1.cfa:117:1 error: No reasonable alternatives for expression Applying untyped:
    2735  Name: ?{}
     
    2937  Generated Cast of:
    3038    Variable Expression: _retval_f_py2: pointer to float
     39    with resolved type:
     40      pointer to float
    3141  ... to:
     42    reference to pointer to float
     43  with resolved type:
    3244    reference to pointer to float
    3345  Name: cpx
     
    3749... to:
    3850  reference to instance of type T (not function type)
     51with resolved type:
     52  reference to instance of type T (not function type)
    3953init1.cfa:128:1 error: No reasonable alternatives for expression Applying untyped:
    4054  Name: ?{}
     
    4256  Generated Cast of:
    4357    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)
    4460  ... to:
     61    reference to pointer to instance of type T (not function type)
     62  with resolved type:
    4563    reference to pointer to instance of type T (not function type)
    4664  Name: s
  • tests/errors/.expect/completeType.nast.x64.txt

    rf0d67e5 rb5629d8  
    66    Name: x
    77
    8 ... to: nothing Alternatives are:
     8... to: nothing
     9... with resolved type:
     10  void Alternatives are:
    911Cost ( 0, 1, 2, 0, 1, -1, 0 ): Generated Cast of:
    1012      Application of
     
    1719          reference to instance of type DT (not function type)
    1820
     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
    1930        ... to arguments
    2031        Variable Expression: x: pointer to instance of struct B with body
     32        ... with resolved type:
     33          pointer to instance of struct B with body
    2134
     35      ... with resolved type:
     36        reference to instance of struct B with body
    2237    ... to: nothing
     38    ... with resolved type:
     39      void
    2340  (types:
    2441    void
    2542  )
    26   Environment:( _99_2_DT ) -> instance of struct B with body (no widening)
     43  Environment:([unbound]) -> instance of struct B with body (no widening)
    2744
    2845
     
    3754          reference to instance of type DT (not function type)
    3855
     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
    3965        ... to arguments
    4066        Variable Expression: x: pointer to instance of struct A without body
     67        ... with resolved type:
     68          pointer to instance of struct A without body
    4169
     70      ... with resolved type:
     71        reference to instance of struct A without body
    4272    ... to: nothing
     73    ... with resolved type:
     74      void
    4375  (types:
    4476    void
    4577  )
    46   Environment:( _99_2_DT ) -> instance of struct A without body (no widening)
     78  Environment:([unbound]) -> instance of struct A without body (no widening)
    4779
    4880
     
    112144            ... returning nothing
    113145
     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
    114179            ... to arguments
    115180            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)
    116183          with 1 pending inference slots
    117184
     185          ... with resolved type:
     186            void
    118187        (types:
    119188          void
    120189        )
    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)
    122191
    123192      Could not satisfy assertion:
    124193?=?: pointer to function
    125194        ... 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)
    128197        ... returning
    129           instance of type _118_0_T (not function type)
     198          instance of type [unbound] (not function type)
    130199
  • tests/errors/.expect/completeType.oast.arm64.txt

    rf0d67e5 rb5629d8  
    66    Name: x
    77
    8 ... to: nothing Alternatives are:
     8... to: nothing
     9with resolved type:
     10  void  Alternatives are:
    911Cost ( 0, 1, 2, 0, 1, -1, 0 ): Generated Cast of:
    1012      Application of
     
    2022
    2123
     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
    2236      ... to arguments
    2337        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
    2543    ... to: nothing
     44    with resolved type:
     45      void
    2646  (types:
    2747    void
    2848  )
    29   Environment: -> instance of struct A with body 0 (no widening)
     49  Environment:([unbound]) -> instance of struct A with body 0 (no widening)
    3050
    3151
     
    4363
    4464
     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
    4577      ... to arguments
    4678        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
    4884    ... to: nothing
     85    with resolved type:
     86      void
    4987  (types:
    5088    void
    5189  )
    52   Environment: -> instance of struct B with body 1 (no widening)
     90  Environment:([unbound]) -> instance of struct B with body 1 (no widening)
    5391
    5492
     
    121159            ... returning nothing
    122160
     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
    123197          ... to arguments
    124198            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
    126204        (types:
    127205          void
    128206        )
    129         Environment: -> instance of type T (not function type) (no widening)
     207        Environment:([unbound]) -> instance of type T (not function type) (no widening)
    130208
    131209      Could not satisfy assertion:
    132210?=?: pointer to function
    133211        ... 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)
    136214        ... 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)
    138216          ... with attributes:
    139217            Attribute with name: unused
  • tests/errors/.expect/completeType.oast.x64.txt

    rf0d67e5 rb5629d8  
    66    Name: x
    77
    8 ... to: nothing Alternatives are:
     8... to: nothing
     9with resolved type:
     10  void  Alternatives are:
    911Cost ( 0, 1, 2, 0, 1, -1, 0 ): Generated Cast of:
    1012      Application of
     
    2022
    2123
     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
    2236      ... to arguments
    2337        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
    2543    ... to: nothing
     44    with resolved type:
     45      void
    2646  (types:
    2747    void
    2848  )
    29   Environment: -> instance of struct A with body 0 (no widening)
     49  Environment:([unbound]) -> instance of struct A with body 0 (no widening)
    3050
    3151
     
    4363
    4464
     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
    4577      ... to arguments
    4678        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
    4884    ... to: nothing
     85    with resolved type:
     86      void
    4987  (types:
    5088    void
    5189  )
    52   Environment: -> instance of struct B with body 1 (no widening)
     90  Environment:([unbound]) -> instance of struct B with body 1 (no widening)
    5391
    5492
     
    121159            ... returning nothing
    122160
     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
    123197          ... to arguments
    124198            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
    126204        (types:
    127205          void
    128206        )
    129         Environment: -> instance of type T (not function type) (no widening)
     207        Environment:([unbound]) -> instance of type T (not function type) (no widening)
    130208
    131209      Could not satisfy assertion:
    132210?=?: pointer to function
    133211        ... 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)
    136214        ... 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)
    138216          ... with attributes:
    139217            Attribute with name: unused
  • tests/meta/.expect/archVast.nast.arm64.txt

    rf0d67e5 rb5629d8  
    33  Name: FA64
    44... to:
     5  char
     6... with resolved type:
    57  char Alternatives are:
    68Cost ( 1, 0, 0, 0, 0, 0, 0 ): Explicit Cast of:
    79      Variable Expression: FA64: signed int
     10      ... with resolved type:
     11        signed int
    812    ... to:
     13      char
     14    ... with resolved type:
    915      char
    1016  (types:
     
    1824      ... returning nothing
    1925
     26      ... with resolved type:
     27        pointer to function
     28          accepting unspecified arguments
     29        ... returning nothing
     30
    2031    ... to:
     32      char
     33    ... with resolved type:
    2134      char
    2235  (types:
     
    2740Cost ( 1, 0, 0, 0, 0, 0, 0 ): Explicit Cast of:
    2841      Variable Expression: FA64: double
     42      ... with resolved type:
     43        double
    2944    ... to:
     45      char
     46    ... with resolved type:
    3047      char
    3148  (types:
  • tests/meta/.expect/archVast.nast.x64.txt

    rf0d67e5 rb5629d8  
    33  Name: FX64
    44... to:
     5  char
     6... with resolved type:
    57  char Alternatives are:
    68Cost ( 1, 0, 0, 0, 0, 0, 0 ): Explicit Cast of:
    79      Variable Expression: FX64: signed int
     10      ... with resolved type:
     11        signed int
    812    ... to:
     13      char
     14    ... with resolved type:
    915      char
    1016  (types:
     
    1824      ... returning nothing
    1925
     26      ... with resolved type:
     27        pointer to function
     28          accepting unspecified arguments
     29        ... returning nothing
     30
    2031    ... to:
     32      char
     33    ... with resolved type:
    2134      char
    2235  (types:
     
    2740Cost ( 1, 0, 0, 0, 0, 0, 0 ): Explicit Cast of:
    2841      Variable Expression: FX64: double
     42      ... with resolved type:
     43        double
    2944    ... to:
     45      char
     46    ... with resolved type:
    3047      char
    3148  (types:
  • tests/meta/.expect/archVast.nast.x86.txt

    rf0d67e5 rb5629d8  
    33  Name: FX86
    44... to:
     5  char
     6... with resolved type:
    57  char Alternatives are:
    68Cost ( 1, 0, 0, 0, 0, 0, 0 ): Explicit Cast of:
    79      Variable Expression: FX86: signed int
     10      ... with resolved type:
     11        signed int
    812    ... to:
     13      char
     14    ... with resolved type:
    915      char
    1016  (types:
     
    1824      ... returning nothing
    1925
     26      ... with resolved type:
     27        pointer to function
     28          accepting unspecified arguments
     29        ... returning nothing
     30
    2031    ... to:
     32      char
     33    ... with resolved type:
    2134      char
    2235  (types:
     
    2740Cost ( 1, 0, 0, 0, 0, 0, 0 ): Explicit Cast of:
    2841      Variable Expression: FX86: double
     42      ... with resolved type:
     43        double
    2944    ... to:
     45      char
     46    ... with resolved type:
    3047      char
    3148  (types:
  • tests/meta/.expect/archVast.oast.arm64.txt

    rf0d67e5 rb5629d8  
    33  Name: FA64
    44... to:
     5  char
     6with resolved type:
    57  char Alternatives are:
    68Cost ( 1, 0, 0, 0, 0, 0, 0 ): Explicit Cast of:
     
    911      ... returning nothing
    1012
     13      with resolved type:
     14        pointer to function
     15          accepting unspecified arguments
     16        ... returning nothing
     17
    1118    ... to:
     19      char
     20    with resolved type:
    1221      char
    1322  (types:
     
    1827Cost ( 1, 0, 0, 0, 0, 0, 0 ): Explicit Cast of:
    1928      Variable Expression: FA64: double
     29      with resolved type:
     30        double
    2031    ... to:
     32      char
     33    with resolved type:
    2134      char
    2235  (types:
     
    2740Cost ( 1, 0, 0, 0, 0, 0, 0 ): Explicit Cast of:
    2841      Variable Expression: FA64: signed int
     42      with resolved type:
     43        signed int
    2944    ... to:
     45      char
     46    with resolved type:
    3047      char
    3148  (types:
  • tests/meta/.expect/archVast.oast.x64.txt

    rf0d67e5 rb5629d8  
    33  Name: FX64
    44... to:
     5  char
     6with resolved type:
    57  char Alternatives are:
    68Cost ( 1, 0, 0, 0, 0, 0, 0 ): Explicit Cast of:
     
    911      ... returning nothing
    1012
     13      with resolved type:
     14        pointer to function
     15          accepting unspecified arguments
     16        ... returning nothing
     17
    1118    ... to:
     19      char
     20    with resolved type:
    1221      char
    1322  (types:
     
    1827Cost ( 1, 0, 0, 0, 0, 0, 0 ): Explicit Cast of:
    1928      Variable Expression: FX64: double
     29      with resolved type:
     30        double
    2031    ... to:
     32      char
     33    with resolved type:
    2134      char
    2235  (types:
     
    2740Cost ( 1, 0, 0, 0, 0, 0, 0 ): Explicit Cast of:
    2841      Variable Expression: FX64: signed int
     42      with resolved type:
     43        signed int
    2944    ... to:
     45      char
     46    with resolved type:
    3047      char
    3148  (types:
  • tests/meta/.expect/archVast.oast.x86.txt

    rf0d67e5 rb5629d8  
    33  Name: FX86
    44... to:
     5  char
     6with resolved type:
    57  char Alternatives are:
    68Cost ( 1, 0, 0, 0, 0, 0, 0 ): Explicit Cast of:
     
    911      ... returning nothing
    1012
     13      with resolved type:
     14        pointer to function
     15          accepting unspecified arguments
     16        ... returning nothing
     17
    1118    ... to:
     19      char
     20    with resolved type:
    1221      char
    1322  (types:
     
    1827Cost ( 1, 0, 0, 0, 0, 0, 0 ): Explicit Cast of:
    1928      Variable Expression: FX86: double
     29      with resolved type:
     30        double
    2031    ... to:
     32      char
     33    with resolved type:
    2134      char
    2235  (types:
     
    2740Cost ( 1, 0, 0, 0, 0, 0, 0 ): Explicit Cast of:
    2841      Variable Expression: FX86: signed int
     42      with resolved type:
     43        signed int
    2944    ... to:
     45      char
     46    with resolved type:
    3047      char
    3148  (types:
  • tests/raii/.expect/ctor-autogen-ERR1.nast.txt

    rf0d67e5 rb5629d8  
    77        signed int
    88      ... 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
    916
    1017      ... deleted by: ?{}: function
     
    2330                signed int
    2431
     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
    2540              ... to arguments
    2641              Generated Cast of:
     
    3045                  Generated Cast of:
    3146                    Variable Expression: m: reference to instance of struct Managed with body
     47                    ... with resolved type:
     48                      reference to instance of struct Managed with body
    3249                  ... to:
    3350                    instance of struct Managed with body
     51                  ... with resolved type:
     52                    instance of struct Managed with body
     53                ... with resolved type:
     54                  signed int
    3455              ... to:
     56                reference to signed int
     57              ... with resolved type:
    3558                reference to signed int
    3659              Generated Cast of:
    3760                Constant Expression (0: zero_t)
     61                ... with resolved type:
     62                  zero_t
    3863              ... to:
    3964                signed int
     65              ... with resolved type:
     66                signed int
    4067
     68            ... with resolved type:
     69              signed int
    4170            ... with environment:
    4271              Types:
     
    4776    Generated Cast of:
    4877      Variable Expression: x: instance of struct Managed with body
     78      ... with resolved type:
     79        instance of struct Managed with body
    4980    ... to:
    5081      reference to instance of struct Managed with body
     82    ... with resolved type:
     83      reference to instance of struct Managed with body
    5184    Constant Expression (123: signed int)
     85    ... with resolved type:
     86      signed int
    5287
     88  ... with resolved type:
     89    void
    5390... to: nothing
     91... with resolved type:
     92  void
  • tests/raii/.expect/ctor-autogen-ERR1.oast.txt

    rf0d67e5 rb5629d8  
    77        x: signed int
    88      ... 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
    916
    1017      ... deleted by: ?{}: function
     
    2633
    2734
     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
    2846            ... to arguments
    2947              Generated Cast of:
     
    3351                  Generated Cast of:
    3452                    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
    3555                  ... to:
    3656                    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
    3761              ... to:
     62                reference to signed int
     63              with resolved type:
    3864                reference to signed int
    3965              Generated Cast of:
    4066                constant expression (0 0: zero_t)
     67                with resolved type:
     68                  zero_t
    4169              ... to:
    4270                signed int
     71              with resolved type:
     72                signed int
    4373
     74            with resolved type:
     75              signed int
    4476            ... with environment:
    4577              Types:
     
    5082    Generated Cast of:
    5183      Variable Expression: x: instance of struct Managed with body 1
     84      with resolved type:
     85        instance of struct Managed with body 1
    5286    ... to:
    5387      reference to instance of struct Managed with body 1
     88    with resolved type:
     89      reference to instance of struct Managed with body 1
    5490    constant expression (123 123: signed int)
     91    with resolved type:
     92      signed int
    5593
     94  with resolved type:
     95    void
    5696... to: nothing
     97with resolved type:
     98  void
  • tests/warnings/.expect/self-assignment.nast.txt

    rf0d67e5 rb5629d8  
    11warnings/self-assignment.cfa:29:1 warning: self assignment of expression: Generated Cast of:
    22  Variable Expression: j: signed int
     3  ... with resolved type:
     4    signed int
    35... to:
     6  reference to signed int
     7... with resolved type:
    48  reference to signed int
    59warnings/self-assignment.cfa:30:1 warning: self assignment of expression: Generated Cast of:
    610  Variable Expression: s: instance of struct S with body
     11  ... with resolved type:
     12    instance of struct S with body
    713... to:
     14  reference to instance of struct S with body
     15... with resolved type:
    816  reference to instance of struct S with body
    917warnings/self-assignment.cfa:31:1 warning: self assignment of expression: Generated Cast of:
     
    1220  ... from aggregate:
    1321    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
    1426... to:
     27  reference to signed int
     28... with resolved type:
    1529  reference to signed int
    1630warnings/self-assignment.cfa:32:1 warning: self assignment of expression: Generated Cast of:
     
    2236    ... from aggregate:
    2337      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
    2444... to:
     45  reference to signed int
     46... with resolved type:
    2547  reference to signed int
    2648warnings/self-assignment.cfa: In function '_X4mainFi___1':
  • tests/warnings/.expect/self-assignment.oast.txt

    rf0d67e5 rb5629d8  
    11warnings/self-assignment.cfa:29:1 warning: self assignment of expression: Generated Cast of:
    22  Variable Expression: j: signed int
     3  with resolved type:
     4    signed int
    35... to:
     6  reference to signed int
     7with resolved type:
    48  reference to signed int
    59warnings/self-assignment.cfa:30:1 warning: self assignment of expression: Generated Cast of:
    610  Variable Expression: s: instance of struct S with body 1
     11  with resolved type:
     12    instance of struct S with body 1
    713... to:
     14  reference to instance of struct S with body 1
     15with resolved type:
    816  reference to instance of struct S with body 1
    917warnings/self-assignment.cfa:31:1 warning: self assignment of expression: Generated Cast of:
     
    1220  ... from aggregate:
    1321    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
    1426... to:
     27  reference to signed int
     28with resolved type:
    1529  reference to signed int
    1630warnings/self-assignment.cfa:32:1 warning: self assignment of expression: Generated Cast of:
     
    2236    ... from aggregate:
    2337      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
    2444... to:
     45  reference to signed int
     46with resolved type:
    2547  reference to signed int
    2648warnings/self-assignment.cfa: In function '_X4mainFi___1':
Note: See TracChangeset for help on using the changeset viewer.