Ignore:
Timestamp:
Jan 19, 2016, 1:28:25 PM (9 years ago)
Author:
Rob Schluntz <rschlunt@…>
Branches:
ADT, aaron-thesis, arm-eh, ast-experimental, cleanup-dtors, ctor, deferred_resn, demangler, enum, forall-pointer-decay, gc_noraii, jacob/cs343-translation, jenkins-sandbox, master, memory, new-ast, new-ast-unique-expr, new-env, no_list, persistent-indexer, pthread-emulation, qualifiedEnum, resolv-new, with_gc
Children:
ca1c11f
Parents:
71f4e4f
Message:

added intrinsic ctor/dtors to prelude, modified MakeLibCfa? to build prelude ctor/dtors, added ctor/dtor to polymorphic object type constraints, rudimentary fallback on initializer nodes if chosen ctor is intrinsic, remove intrinsic destructor statements to reduce output pollution

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/libcfa/prelude.cf

    r71f4e4f rf1e012b  
    1 //                               -*- Mode: C -*- 
    2 // 
     1//                               -*- Mode: C -*-
     2//
    33// Copyright (C) Glen Ditchfield 1994, 1999
    4 // 
     4//
    55// prelude.cf -- Standard Cforall Preample for C99
    6 // 
     6//
    77// Author           : Glen Ditchfield
    88// Created On       : Sat Nov 29 07:23:41 2014
     
    116116forall( ftype FT ) lvalue FT             *?( FT * );
    117117
    118 _Bool                   +?( _Bool ),                    -?( _Bool ),                    ~?( _Bool );         
    119 signed int              +?( signed int ),               -?( signed int ),               ~?( signed int );           
    120 unsigned int            +?( unsigned int ),             -?( unsigned int ),             ~?( unsigned int );         
    121 signed long int         +?( signed long int ),          -?( signed long int ),          ~?( signed long int );       
    122 unsigned long int       +?( unsigned long int ),        -?( unsigned long int ),        ~?( unsigned long int );             
    123 signed long long int    +?( signed long long int ),     -?( signed long long int ),     ~?( signed long long int );   
    124 unsigned long long int  +?( unsigned long long int ),   -?( unsigned long long int ),   ~?( unsigned long long int ); 
     118_Bool                   +?( _Bool ),                    -?( _Bool ),                    ~?( _Bool );
     119signed int              +?( signed int ),               -?( signed int ),               ~?( signed int );
     120unsigned int            +?( unsigned int ),             -?( unsigned int ),             ~?( unsigned int );
     121signed long int         +?( signed long int ),          -?( signed long int ),          ~?( signed long int );
     122unsigned long int       +?( unsigned long int ),        -?( unsigned long int ),        ~?( unsigned long int );
     123signed long long int    +?( signed long long int ),     -?( signed long long int ),     ~?( signed long long int );
     124unsigned long long int  +?( unsigned long long int ),   -?( unsigned long long int ),   ~?( unsigned long long int );
    125125float                   +?( float ),                    -?( float );
    126126double                  +?( double ),                   -?( double );
     
    626626                        ?+=?( long double _Complex *, long double _Complex ), ?+=?( volatile long double _Complex *, long double _Complex ),
    627627                        ?-=?( long double _Complex *, long double _Complex ), ?-=?( volatile long double _Complex *, long double _Complex );
     628
     629
     630
     631
     632
     633// ------------------------------------------------------------
     634//
     635// Section ??? Constructors and Destructors
     636//
     637// ------------------------------------------------------------
     638
     639// default ctor
     640void    ?{}( _Bool * ),                         ?{}( volatile _Bool * );
     641void    ?{}( unsigned char * ),                 ?{}( volatile unsigned char * );
     642void    ?{}( signed int * ),                    ?{}( volatile signed int * );
     643void    ?{}( unsigned int * ),                  ?{}( volatile unsigned int * );
     644void    ?{}( signed long int * ),               ?{}( volatile signed long int * );
     645void    ?{}( unsigned long int * ),             ?{}( volatile unsigned long int * );
     646void    ?{}( signed long long int * ),          ?{}( volatile signed long long int * );
     647void    ?{}( unsigned long long int * ),        ?{}( volatile unsigned long long int * );
     648void    ?{}( float * ),                         ?{}( volatile float * );
     649void    ?{}( double * ),                        ?{}( volatile double * );
     650void    ?{}( long double * ),                   ?{}( volatile long double * );
     651void    ?{}( float _Complex * ),                ?{}( volatile float _Complex * );
     652void    ?{}( double _Complex * ),               ?{}( volatile double _Complex * );
     653void    ?{}( long double _Complex * ),          ?{}( volatile long double _Complex * );
     654
     655// copy ctor
     656void    ?{}( _Bool *, _Bool ),                                  ?{}( volatile _Bool *, _Bool );
     657void    ?{}( unsigned char *, unsigned char ),                  ?{}( volatile unsigned char *, unsigned char );
     658void    ?{}( signed int *, signed int),                         ?{}( volatile signed int *, signed int );
     659void    ?{}( unsigned int *, unsigned int),                     ?{}( volatile unsigned int *, unsigned int );
     660void    ?{}( signed long int *, signed long int),               ?{}( volatile signed long int *, signed long int );
     661void    ?{}( unsigned long int *, unsigned long int),           ?{}( volatile unsigned long int *, unsigned long int );
     662void    ?{}( signed long long int *, signed long long int),     ?{}( volatile signed long long int *, signed long long int );
     663void    ?{}( unsigned long long int *, unsigned long long int), ?{}( volatile unsigned long long int *, unsigned long long int );
     664void    ?{}( float *, float),                                   ?{}( volatile float *, float );
     665void    ?{}( double *, double),                                 ?{}( volatile double *, double );
     666void    ?{}( long double *, long double),                       ?{}( volatile long double *, long double );
     667void    ?{}( float _Complex *, float _Complex),                 ?{}( volatile float _Complex *, float _Complex );
     668void    ?{}( double _Complex *, double _Complex),               ?{}( volatile double _Complex *, double _Complex );
     669void    ?{}( long double _Complex *, long double _Complex),     ?{}( volatile long double _Complex *, long double _Complex );
     670
     671// dtor
     672void    ^?{}( _Bool * ),                        ^?{}( volatile _Bool * );
     673void    ^?{}( signed int * ),                   ^?{}( volatile signed int * );
     674void    ^?{}( unsigned int * ),                 ^?{}( volatile unsigned int * );
     675void    ^?{}( signed long int * ),              ^?{}( volatile signed long int * );
     676void    ^?{}( unsigned long int * ),            ^?{}( volatile unsigned long int * );
     677void    ^?{}( signed long long int * ),         ^?{}( volatile signed long long int * );
     678void    ^?{}( unsigned long long int * ),       ^?{}( volatile unsigned long long int * );
     679void    ^?{}( float * ),                        ^?{}( volatile float * );
     680void    ^?{}( double * ),                       ^?{}( volatile double * );
     681void    ^?{}( long double * ),                  ^?{}( volatile long double * );
     682void    ^?{}( float _Complex * ),               ^?{}( volatile float _Complex * );
     683void    ^?{}( double _Complex * ),              ^?{}( volatile double _Complex * );
     684void    ^?{}( long double _Complex * ),         ^?{}( volatile long double _Complex * );
     685
     686// // default ctor
     687// forall( dtype DT ) void       ?{}(                DT ** );
     688// forall( dtype DT ) void       ?{}( const          DT ** );
     689// forall( dtype DT ) void       ?{}(       volatile DT ** );
     690// forall( dtype DT ) void       ?{}( const volatile DT ** );
     691
     692// // copy ctor
     693// forall( dtype DT ) void       ?{}(                DT **, DT* );
     694// forall( dtype DT ) void       ?{}( const          DT **, DT* );
     695// forall( dtype DT ) void       ?{}(       volatile DT **, DT* );
     696// forall( dtype DT ) void       ?{}( const volatile DT **, DT* );
     697
     698// // dtor
     699// forall( dtype DT ) void      ^?{}(                DT ** );
     700// forall( dtype DT ) void      ^?{}( const          DT ** );
     701// forall( dtype DT ) void      ^?{}(       volatile DT ** );
     702// forall( dtype DT ) void      ^?{}( const volatile DT ** );
     703
     704// copied from assignment section
     705// copy constructors
     706forall( ftype FT ) void ?{}( FT **, FT * );
     707forall( ftype FT ) void ?{}( FT * volatile *, FT * );
     708
     709forall( dtype DT ) void ?{}(                 DT *          *,                   DT * );
     710forall( dtype DT ) void ?{}(                 DT * volatile *,                   DT * );
     711forall( dtype DT ) void ?{}( const           DT *          *,                   DT * );
     712forall( dtype DT ) void ?{}( const           DT * volatile *,                   DT * );
     713forall( dtype DT ) void ?{}( const           DT *          *, const             DT * );
     714forall( dtype DT ) void ?{}( const           DT * volatile *, const             DT * );
     715forall( dtype DT ) void ?{}(       volatile  DT *          *,                   DT * );
     716forall( dtype DT ) void ?{}(       volatile  DT * volatile *,                   DT * );
     717forall( dtype DT ) void ?{}(       volatile  DT *          *,       volatile    DT * );
     718forall( dtype DT ) void ?{}(       volatile  DT * volatile *,       volatile    DT * );
     719
     720forall( dtype DT ) void ?{}( const volatile  DT *          *,                   DT * );
     721forall( dtype DT ) void ?{}( const volatile  DT * volatile *,                   DT * );
     722forall( dtype DT ) void ?{}( const volatile  DT *          *, const             DT * );
     723forall( dtype DT ) void ?{}( const volatile  DT * volatile *, const             DT * );
     724forall( dtype DT ) void ?{}( const volatile  DT *          *,       volatile    DT * );
     725forall( dtype DT ) void ?{}( const volatile  DT * volatile *,       volatile    DT * );
     726forall( dtype DT ) void ?{}( const volatile  DT *          *, const volatile    DT * );
     727forall( dtype DT ) void ?{}( const volatile  DT * volatile *, const volatile    DT * );
     728
     729forall( dtype DT ) void ?{}(                 DT *          *,                   void * );
     730forall( dtype DT ) void ?{}(                 DT * volatile *,                   void * );
     731forall( dtype DT ) void ?{}( const           DT *          *,                   void * );
     732forall( dtype DT ) void ?{}( const           DT * volatile *,                   void * );
     733forall( dtype DT ) void ?{}( const           DT *          *, const             void * );
     734forall( dtype DT ) void ?{}( const           DT * volatile *, const             void * );
     735forall( dtype DT ) void ?{}(       volatile  DT *          *,                   void * );
     736forall( dtype DT ) void ?{}(       volatile  DT * volatile *,                   void * );
     737forall( dtype DT ) void ?{}(       volatile  DT *          *,       volatile    void * );
     738forall( dtype DT ) void ?{}(       volatile  DT * volatile *,       volatile    void * );
     739
     740forall( dtype DT ) void ?{}( const volatile  DT *          *,                   void * );
     741forall( dtype DT ) void ?{}( const volatile  DT * volatile *,                   void * );
     742forall( dtype DT ) void ?{}( const volatile  DT *          *, const             void * );
     743forall( dtype DT ) void ?{}( const volatile  DT * volatile *, const             void * );
     744forall( dtype DT ) void ?{}( const volatile  DT *          *,       volatile    void * );
     745forall( dtype DT ) void ?{}( const volatile  DT * volatile *,       volatile    void * );
     746forall( dtype DT ) void ?{}( const volatile  DT *          *, const volatile    void * );
     747forall( dtype DT ) void ?{}( const volatile  DT * volatile *, const volatile    void * );
     748
     749forall( dtype DT ) void ?{}(                 void *          *,                 DT * );
     750forall( dtype DT ) void ?{}(                 void * volatile *,                 DT * );
     751forall( dtype DT ) void ?{}( const           void *          *,                 DT * );
     752forall( dtype DT ) void ?{}( const           void * volatile *,                 DT * );
     753forall( dtype DT ) void ?{}( const           void *          *, const           DT * );
     754forall( dtype DT ) void ?{}( const           void * volatile *, const           DT * );
     755forall( dtype DT ) void ?{}(        volatile void *          *,                 DT * );
     756forall( dtype DT ) void ?{}(        volatile void * volatile *,                 DT * );
     757forall( dtype DT ) void ?{}(        volatile void *          *,       volatile  DT * );
     758forall( dtype DT ) void ?{}(        volatile void * volatile *,       volatile  DT * );
     759forall( dtype DT ) void ?{}( const volatile void *           *,                 DT * );
     760forall( dtype DT ) void ?{}( const volatile void * volatile *,                  DT * );
     761forall( dtype DT ) void ?{}( const volatile void *           *, const           DT * );
     762forall( dtype DT ) void ?{}( const volatile void * volatile *, const            DT * );
     763forall( dtype DT ) void ?{}( const volatile void *           *,       volatile  DT * );
     764forall( dtype DT ) void ?{}( const volatile void * volatile *,        volatile  DT * );
     765forall( dtype DT ) void ?{}( const volatile void *           *, const volatile  DT * );
     766forall( dtype DT ) void ?{}( const volatile void * volatile *, const volatile   DT * );
     767
     768void    ?{}(                void *          *,                void * );
     769void    ?{}(                void * volatile *,                void * );
     770void    ?{}( const          void *          *,                void * );
     771void    ?{}( const          void * volatile *,                void * );
     772void    ?{}( const          void *          *, const          void * );
     773void    ?{}( const          void * volatile *, const          void * );
     774void    ?{}(       volatile void *          *,                void * );
     775void    ?{}(       volatile void * volatile *,                void * );
     776void    ?{}(       volatile void *          *,       volatile void * );
     777void    ?{}(       volatile void * volatile *,       volatile void * );
     778void    ?{}( const volatile void *          *,                void * );
     779void    ?{}( const volatile void * volatile *,                void * );
     780void    ?{}( const volatile void *          *, const          void * );
     781void    ?{}( const volatile void * volatile *, const          void * );
     782void    ?{}( const volatile void *          *,       volatile void * );
     783void    ?{}( const volatile void * volatile *,       volatile void * );
     784void    ?{}( const volatile void *          *, const volatile void * );
     785void    ?{}( const volatile void * volatile *, const volatile void * );
     786
     787//forall( dtype DT ) void ?{}(              DT *          *, forall( dtype DT2 ) const DT2 * );
     788//forall( dtype DT ) void ?{}(              DT * volatile *, forall( dtype DT2 ) const DT2 * );
     789forall( dtype DT ) void ?{}( const          DT *          *, forall( dtype DT2 ) const DT2 * );
     790forall( dtype DT ) void ?{}( const          DT * volatile *, forall( dtype DT2 ) const DT2 * );
     791//forall( dtype DT ) void ?{}( volatile     DT *          *, forall( dtype DT2 ) const DT2 * );
     792//forall( dtype DT ) void ?{}( volatile     DT * volatile *, forall( dtype DT2 ) const DT2 * );
     793forall( dtype DT ) void ?{}( const volatile DT *          *, forall( dtype DT2 ) const DT2 * );
     794forall( dtype DT ) void ?{}( const volatile DT * volatile *, forall( dtype DT2 ) const DT2 * );
     795
     796forall( ftype FT ) void ?{}( FT *          *, forall( ftype FT2 ) FT2 * );
     797forall( ftype FT ) void ?{}( FT * volatile *, forall( ftype FT2 ) FT2 * );
     798
     799// default ctors
     800forall( ftype FT ) void ?{}( FT *          * );
     801forall( ftype FT ) void ?{}( FT * volatile * );
     802
     803forall( dtype DT ) void ?{}(                 DT *          *);
     804forall( dtype DT ) void ?{}(                 DT * volatile *);
     805forall( dtype DT ) void ?{}( const           DT *          *);
     806forall( dtype DT ) void ?{}( const           DT * volatile *);
     807forall( dtype DT ) void ?{}(       volatile  DT *          *);
     808forall( dtype DT ) void ?{}(       volatile  DT * volatile *);
     809forall( dtype DT ) void ?{}( const volatile  DT *          *);
     810forall( dtype DT ) void ?{}( const volatile  DT * volatile *);
     811
     812void    ?{}(                void *          *);
     813void    ?{}(                void * volatile *);
     814void    ?{}( const          void *          *);
     815void    ?{}( const          void * volatile *);
     816void    ?{}(       volatile void *          *);
     817void    ?{}(       volatile void * volatile *);
     818void    ?{}( const volatile void *          *);
     819void    ?{}( const volatile void * volatile *);
     820
     821// dtors
     822forall( ftype FT ) void ^?{}( FT *         * );
     823forall( ftype FT ) void ^?{}( FT * volatile * );
     824
     825forall( dtype DT ) void ^?{}(                DT *          *);
     826forall( dtype DT ) void ^?{}(                DT * volatile *);
     827forall( dtype DT ) void ^?{}( const          DT *          *);
     828forall( dtype DT ) void ^?{}( const          DT * volatile *);
     829forall( dtype DT ) void ^?{}(      volatile  DT *          *);
     830forall( dtype DT ) void ^?{}(      volatile  DT * volatile *);
     831forall( dtype DT ) void ^?{}( const volatile  DT *         *);
     832forall( dtype DT ) void ^?{}( const volatile  DT * volatile *);
     833
     834void    ^?{}(               void *          *);
     835void    ^?{}(               void * volatile *);
     836void    ^?{}( const         void *          *);
     837void    ^?{}( const         void * volatile *);
     838void    ^?{}(      volatile void *          *);
     839void    ^?{}(      volatile void * volatile *);
     840void    ^?{}( const volatile void *         *);
     841void    ^?{}( const volatile void * volatile *);
Note: See TracChangeset for help on using the changeset viewer.