Changeset 0788b739


Ignore:
Timestamp:
Feb 22, 2017, 2:41:49 PM (7 years ago)
Author:
Aaron Moss <a3moss@…>
Branches:
ADT, aaron-thesis, arm-eh, ast-experimental, cleanup-dtors, deferred_resn, demangler, enum, forall-pointer-decay, jacob/cs343-translation, jenkins-sandbox, master, new-ast, new-ast-unique-expr, new-env, no_list, persistent-indexer, pthread-emulation, qualifiedEnum, resolv-new, with_gc
Children:
396ee0a
Parents:
eed5e48
Message:

Pointer operations in prelude now polymorphic over sized dtype rather than otype

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/prelude/prelude.cf

    reed5e48 r0788b739  
    5858long double _Complex    ?--( long double _Complex * ),          ?--( volatile long double _Complex * );
    5959
    60 forall( otype T ) T *                    ?++(                T ** );
    61 forall( otype T ) const T *              ?++( const          T ** );
    62 forall( otype T ) volatile T *           ?++(       volatile T ** );
    63 forall( otype T ) const volatile T *     ?++( const volatile T ** );
    64 forall( otype T ) T *                    ?--(                T ** );
    65 forall( otype T ) const T *              ?--( const          T ** );
    66 forall( otype T ) volatile T *           ?--(       volatile T ** );
    67 forall( otype T ) const volatile T *     ?--( const volatile T ** );
    68 
    69 forall( otype T ) lvalue T               ?[?](                T *,          ptrdiff_t );
    70 forall( otype T ) const lvalue T         ?[?]( const          T *,          ptrdiff_t );
    71 forall( otype T ) volatile lvalue T      ?[?](       volatile T *,          ptrdiff_t );
    72 forall( otype T ) const volatile lvalue T ?[?]( const volatile T *,         ptrdiff_t );
    73 forall( otype T ) lvalue T               ?[?](          ptrdiff_t,                T * );
    74 forall( otype T ) const lvalue T         ?[?](          ptrdiff_t, const          T * );
    75 forall( otype T ) volatile lvalue T      ?[?](          ptrdiff_t,       volatile T * );
    76 forall( otype T ) const volatile lvalue T ?[?](         ptrdiff_t, const volatile T * );
     60forall( dtype T | sized(T) ) T *                         ?++(                T ** );
     61forall( dtype T | sized(T) ) const T *           ?++( const          T ** );
     62forall( dtype T | sized(T) ) volatile T *                ?++(       volatile T ** );
     63forall( dtype T | sized(T) ) const volatile T *  ?++( const volatile T ** );
     64forall( dtype T | sized(T) ) T *                         ?--(                T ** );
     65forall( dtype T | sized(T) ) const T *           ?--( const          T ** );
     66forall( dtype T | sized(T) ) volatile T *                ?--(       volatile T ** );
     67forall( dtype T | sized(T) ) const volatile T *  ?--( const volatile T ** );
     68
     69forall( dtype T | sized(T) ) lvalue T            ?[?](                T *,          ptrdiff_t );
     70forall( dtype T | sized(T) ) const lvalue T      ?[?]( const          T *,          ptrdiff_t );
     71forall( dtype T | sized(T) ) volatile lvalue T   ?[?](       volatile T *,          ptrdiff_t );
     72forall( dtype T | sized(T) ) const volatile lvalue T ?[?]( const volatile T *,      ptrdiff_t );
     73forall( dtype T | sized(T) ) lvalue T            ?[?](          ptrdiff_t,                T * );
     74forall( dtype T | sized(T) ) const lvalue T      ?[?](          ptrdiff_t, const          T * );
     75forall( dtype T | sized(T) ) volatile lvalue T   ?[?](          ptrdiff_t,       volatile T * );
     76forall( dtype T | sized(T) ) const volatile lvalue T ?[?](              ptrdiff_t, const volatile T * );
    7777
    7878// ------------------------------------------------------------
     
    9696long double _Complex    ++?( long double _Complex * ),          --?( long double _Complex * );
    9797
    98 forall( otype T ) T *                    ++?(                T ** );
    99 forall( otype T ) const T *              ++?( const          T ** );
    100 forall( otype T ) volatile T *           ++?(       volatile T ** );
    101 forall( otype T ) const volatile T *     ++?( const volatile T ** );
    102 forall( otype T ) T *                    --?(                T ** );
    103 forall( otype T ) const T *              --?( const          T ** );
    104 forall( otype T ) volatile T *           --?(       volatile T ** );
    105 forall( otype T ) const volatile T *     --?( const volatile T ** );
     98forall( dtype T | sized(T) ) T *                         ++?(                T ** );
     99forall( dtype T | sized(T) ) const T *           ++?( const          T ** );
     100forall( dtype T | sized(T) ) volatile T *                ++?(       volatile T ** );
     101forall( dtype T | sized(T) ) const volatile T *  ++?( const volatile T ** );
     102forall( dtype T | sized(T) ) T *                         --?(                T ** );
     103forall( dtype T | sized(T) ) const T *           --?( const          T ** );
     104forall( dtype T | sized(T) ) volatile T *                --?(       volatile T ** );
     105forall( dtype T | sized(T) ) const volatile T *  --?( const volatile T ** );
    106106
    107107forall( dtype T | sized(T) ) lvalue T            *?(                 T * );
     
    178178long double _Complex    ?+?( long double _Complex, long double _Complex ),      ?-?( long double _Complex, long double _Complex );
    179179
    180 forall( otype T ) T *                   ?+?(                T *,          ptrdiff_t );
    181 forall( otype T ) T *                   ?+?(          ptrdiff_t,                T * );
    182 forall( otype T ) const T *             ?+?( const          T *,          ptrdiff_t );
    183 forall( otype T ) const T *             ?+?(          ptrdiff_t, const          T * );
    184 forall( otype T ) volatile T *          ?+?(       volatile T *,          ptrdiff_t );
    185 forall( otype T ) volatile T *          ?+?(          ptrdiff_t,       volatile T * );
    186 forall( otype T ) const volatile T *    ?+?( const volatile T *,          ptrdiff_t );
    187 forall( otype T ) const volatile T *    ?+?(          ptrdiff_t, const volatile T * );
    188 forall( otype T ) T *                   ?-?(                T *,          ptrdiff_t );
    189 forall( otype T ) const T *             ?-?( const          T *,          ptrdiff_t );
    190 forall( otype T ) volatile T *          ?-?(       volatile T *,          ptrdiff_t );
    191 forall( otype T ) const volatile T *    ?-?( const volatile T *,          ptrdiff_t );
    192 forall( otype T ) ptrdiff_t             ?-?( const volatile T *, const volatile T * );
     180forall( dtype T | sized(T) ) T *                        ?+?(                T *,          ptrdiff_t );
     181forall( dtype T | sized(T) ) T *                        ?+?(          ptrdiff_t,                T * );
     182forall( dtype T | sized(T) ) const T *          ?+?( const          T *,          ptrdiff_t );
     183forall( dtype T | sized(T) ) const T *          ?+?(          ptrdiff_t, const          T * );
     184forall( dtype T | sized(T) ) volatile T *               ?+?(       volatile T *,          ptrdiff_t );
     185forall( dtype T | sized(T) ) volatile T *               ?+?(          ptrdiff_t,       volatile T * );
     186forall( dtype T | sized(T) ) const volatile T * ?+?( const volatile T *,          ptrdiff_t );
     187forall( dtype T | sized(T) ) const volatile T * ?+?(          ptrdiff_t, const volatile T * );
     188forall( dtype T | sized(T) ) T *                        ?-?(                T *,          ptrdiff_t );
     189forall( dtype T | sized(T) ) const T *          ?-?( const          T *,          ptrdiff_t );
     190forall( dtype T | sized(T) ) volatile T *               ?-?(       volatile T *,          ptrdiff_t );
     191forall( dtype T | sized(T) ) const volatile T * ?-?( const volatile T *,          ptrdiff_t );
     192forall( dtype T | sized(T) ) ptrdiff_t          ?-?( const volatile T *, const volatile T * );
    193193
    194194// ------------------------------------------------------------
     
    428428forall( ftype FT ) FT *                 ?=?( FT * volatile *, forall( ftype FT2 ) FT2 * );
    429429
    430 forall( otype T ) T *                   ?+=?(                T *          *, ptrdiff_t );
    431 forall( otype T ) T *                   ?+=?(                T * volatile *, ptrdiff_t );
    432 forall( otype T ) const T *             ?+=?( const          T *          *, ptrdiff_t );
    433 forall( otype T ) const T *             ?+=?( const          T * volatile *, ptrdiff_t );
    434 forall( otype T ) volatile T *          ?+=?(       volatile T *          *, ptrdiff_t );
    435 forall( otype T ) volatile T *          ?+=?(       volatile T * volatile *, ptrdiff_t );
    436 forall( otype T ) const volatile T *    ?+=?( const volatile T *          *, ptrdiff_t );
    437 forall( otype T ) const volatile T *    ?+=?( const volatile T * volatile *, ptrdiff_t );
    438 forall( otype T ) T *                   ?-=?(                T *          *, ptrdiff_t );
    439 forall( otype T ) T *                   ?-=?(                T * volatile *, ptrdiff_t );
    440 forall( otype T ) const T *             ?-=?( const          T *          *, ptrdiff_t );
    441 forall( otype T ) const T *             ?-=?( const          T * volatile *, ptrdiff_t );
    442 forall( otype T ) volatile T *          ?-=?(       volatile T *          *, ptrdiff_t );
    443 forall( otype T ) volatile T *          ?-=?(       volatile T * volatile *, ptrdiff_t );
    444 forall( otype T ) const volatile T *    ?-=?( const volatile T *          *, ptrdiff_t );
    445 forall( otype T ) const volatile T *    ?-=?( const volatile T * volatile *, ptrdiff_t );
     430forall( dtype T | sized(T) ) T *                        ?+=?(                T *          *, ptrdiff_t );
     431forall( dtype T | sized(T) ) T *                        ?+=?(                T * volatile *, ptrdiff_t );
     432forall( dtype T | sized(T) ) const T *          ?+=?( const          T *          *, ptrdiff_t );
     433forall( dtype T | sized(T) ) const T *          ?+=?( const          T * volatile *, ptrdiff_t );
     434forall( dtype T | sized(T) ) volatile T *               ?+=?(       volatile T *          *, ptrdiff_t );
     435forall( dtype T | sized(T) ) volatile T *               ?+=?(       volatile T * volatile *, ptrdiff_t );
     436forall( dtype T | sized(T) ) const volatile T * ?+=?( const volatile T *          *, ptrdiff_t );
     437forall( dtype T | sized(T) ) const volatile T * ?+=?( const volatile T * volatile *, ptrdiff_t );
     438forall( dtype T | sized(T) ) T *                        ?-=?(                T *          *, ptrdiff_t );
     439forall( dtype T | sized(T) ) T *                        ?-=?(                T * volatile *, ptrdiff_t );
     440forall( dtype T | sized(T) ) const T *          ?-=?( const          T *          *, ptrdiff_t );
     441forall( dtype T | sized(T) ) const T *          ?-=?( const          T * volatile *, ptrdiff_t );
     442forall( dtype T | sized(T) ) volatile T *               ?-=?(       volatile T *          *, ptrdiff_t );
     443forall( dtype T | sized(T) ) volatile T *               ?-=?(       volatile T * volatile *, ptrdiff_t );
     444forall( dtype T | sized(T) ) const volatile T * ?-=?( const volatile T *          *, ptrdiff_t );
     445forall( dtype T | sized(T) ) const volatile T * ?-=?( const volatile T * volatile *, ptrdiff_t );
    446446
    447447_Bool                   ?=?( _Bool *, _Bool ),                                  ?=?( volatile _Bool *, _Bool );
Note: See TracChangeset for help on using the changeset viewer.