Ignore:
Timestamp:
Jun 29, 2021, 5:35:19 PM (3 years ago)
Author:
caparsons <caparson@…>
Branches:
ADT, ast-experimental, enum, forall-pointer-decay, jacob/cs343-translation, master, new-ast-unique-expr, pthread-emulation, qualifiedEnum
Children:
dcad80a
Parents:
5a46e09 (diff), d02e547 (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

File:
1 edited

Legend:

Unmodified
Added
Removed
  • libcfa/src/containers/array.hfa

    r5a46e09 r660665f  
    11
    22
    3 // a type whose size is n
    4 #define Z(n) char[n]
    5 
    6 // the inverse of Z(-)
    7 #define z(N) sizeof(N)
    8 
    9 forall( T & ) struct tag {};
     3forall( __CFA_tysys_id_only_X & ) struct tag {};
    104#define ttag(T) ((tag(T)){})
    11 #define ztag(n) ttag(Z(n))
     5#define ztag(n) ttag(n)
    126
    137
     
    1812forall( [N], S & | sized(S), Timmed &, Tbase & ) {
    1913    struct arpk {
    20         S strides[z(N)];
     14        S strides[N];
    2115    };
    2216
     
    5650
    5751    static inline size_t ?`len( arpk(N, S, Timmed, Tbase) & a ) {
    58         return z(N);
     52        return N;
    5953    }
    6054
    6155    // workaround #226 (and array relevance thereof demonstrated in mike102/otype-slow-ndims.cfa)
    6256    static inline void ?{}( arpk(N, S, Timmed, Tbase) & this ) {
    63         void ?{}( S (&inner)[z(N)] ) {}
     57        void ?{}( S (&inner)[N] ) {}
    6458        ?{}(this.strides);
    6559    }
    6660    static inline void ^?{}( arpk(N, S, Timmed, Tbase) & this ) {
    67         void ^?{}( S (&inner)[z(N)] ) {}
     61        void ^?{}( S (&inner)[N] ) {}
    6862        ^?{}(this.strides);
    6963    }
     
    143137// Base
    144138forall( [Nq], Sq & | sized(Sq), Tbase & )
    145 static inline tag(arpk(Nq, Sq, Tbase, Tbase)) enq_( tag(Tbase), tag(Nq), tag(Sq), tag(Tbase) ) {}
     139static inline tag(arpk(Nq, Sq, Tbase, Tbase)) enq_( tag(Tbase), tag(Nq), tag(Sq), tag(Tbase) ) {
     140    tag(arpk(Nq, Sq, Tbase, Tbase)) ret;
     141    return ret;
     142}
    146143
    147144// Rec
    148145forall( [Nq], Sq & | sized(Sq), [N], S & | sized(S), recq &, recr &, Tbase & | { tag(recr) enq_( tag(Tbase), tag(Nq), tag(Sq), tag(recq) ); } )
    149 static inline tag(arpk(N, S, recr, Tbase)) enq_( tag(Tbase), tag(Nq), tag(Sq), tag(arpk(N, S, recq, Tbase)) ) {}
     146static inline tag(arpk(N, S, recr, Tbase)) enq_( tag(Tbase), tag(Nq), tag(Sq), tag(arpk(N, S, recq, Tbase)) ) {
     147    tag(arpk(N, S, recr, Tbase)) ret;
     148    return ret;
     149}
    150150
    151151// Wrapper
Note: See TracChangeset for help on using the changeset viewer.