Changeset 0a061c0 for libcfa


Ignore:
Timestamp:
Aug 4, 2021, 4:54:14 PM (4 years ago)
Author:
Thierry Delisle <tdelisle@…>
Branches:
ADT, ast-experimental, enum, forall-pointer-decay, jacob/cs343-translation, master, new-ast-unique-expr, pthread-emulation, qualifiedEnum
Children:
d2cdd4f
Parents:
d83b266 (diff), 199894e (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

Location:
libcfa
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • libcfa/prelude/sync-builtins.cf

    rd83b266 r0a061c0  
    297297
    298298_Bool __atomic_exchange_n(volatile _Bool *, _Bool, int);
    299 void __atomic_exchange(volatile _Bool *, volatile _Bool *, volatile _Bool *, int);
     299void __atomic_exchange(volatile _Bool *, _Bool *, _Bool *, int);
    300300char __atomic_exchange_n(volatile char *, char, int);
    301 void __atomic_exchange(volatile char *, volatile char *, volatile char *, int);
     301void __atomic_exchange(volatile char *, char *, char *, int);
    302302signed char __atomic_exchange_n(volatile signed char *, signed char, int);
    303 void __atomic_exchange(volatile signed char *, volatile signed char *, volatile signed char *, int);
     303void __atomic_exchange(volatile signed char *, signed char *, signed char *, int);
    304304unsigned char __atomic_exchange_n(volatile unsigned char *, unsigned char, int);
    305 void __atomic_exchange(volatile unsigned char *, volatile unsigned char *, volatile unsigned char *, int);
     305void __atomic_exchange(volatile unsigned char *, unsigned char *, unsigned char *, int);
    306306signed short __atomic_exchange_n(volatile signed short *, signed short, int);
    307 void __atomic_exchange(volatile signed short *, volatile signed short *, volatile signed short *, int);
     307void __atomic_exchange(volatile signed short *, signed short *, signed short *, int);
    308308unsigned short __atomic_exchange_n(volatile unsigned short *, unsigned short, int);
    309 void __atomic_exchange(volatile unsigned short *, volatile unsigned short *, volatile unsigned short *, int);
     309void __atomic_exchange(volatile unsigned short *, unsigned short *, unsigned short *, int);
    310310signed int __atomic_exchange_n(volatile signed int *, signed int, int);
    311 void __atomic_exchange(volatile signed int *, volatile signed int *, volatile signed int *, int);
     311void __atomic_exchange(volatile signed int *, signed int *, signed int *, int);
    312312unsigned int __atomic_exchange_n(volatile unsigned int *, unsigned int, int);
    313 void __atomic_exchange(volatile unsigned int *, volatile unsigned int *, volatile unsigned int *, int);
     313void __atomic_exchange(volatile unsigned int *, unsigned int *, unsigned int *, int);
    314314signed long int __atomic_exchange_n(volatile signed long int *, signed long int, int);
    315 void __atomic_exchange(volatile signed long int *, volatile signed long int *, volatile signed long int *, int);
     315void __atomic_exchange(volatile signed long int *, signed long int *, signed long int *, int);
    316316unsigned long int __atomic_exchange_n(volatile unsigned long int *, unsigned long int, int);
    317 void __atomic_exchange(volatile unsigned long int *, volatile unsigned long int *, volatile unsigned long int *, int);
     317void __atomic_exchange(volatile unsigned long int *, unsigned long int *, unsigned long int *, int);
    318318signed long long int __atomic_exchange_n(volatile signed long long int *, signed long long int, int);
    319 void __atomic_exchange(volatile signed long long int *, volatile signed long long int *, volatile signed long long int *, int);
     319void __atomic_exchange(volatile signed long long int *, signed long long int *, signed long long int *, int);
    320320unsigned long long int __atomic_exchange_n(volatile unsigned long long int *, unsigned long long int, int);
    321 void __atomic_exchange(volatile unsigned long long int *, volatile unsigned long long int *, volatile unsigned long long int *, int);
     321void __atomic_exchange(volatile unsigned long long int *, unsigned long long int *, unsigned long long int *, int);
    322322#if defined(__SIZEOF_INT128__)
    323323signed __int128 __atomic_exchange_n(volatile signed __int128 *, signed __int128, int);
    324 void __atomic_exchange(volatile signed __int128 *, volatile signed __int128 *, volatile signed __int128 *, int);
     324void __atomic_exchange(volatile signed __int128 *, signed __int128 *, signed __int128 *, int);
    325325unsigned __int128 __atomic_exchange_n(volatile unsigned __int128 *, unsigned __int128, int);
    326 void __atomic_exchange(volatile unsigned __int128 *, volatile unsigned __int128 *, volatile unsigned __int128 *, int);
     326void __atomic_exchange(volatile unsigned __int128 *, unsigned __int128 *, unsigned __int128 *, int);
    327327#endif
    328328forall(T &) T * __atomic_exchange_n(T * volatile *, T *, int);
    329 forall(T &) void __atomic_exchange(T * volatile *, T * volatile *, T * volatile *, int);
     329forall(T &) void __atomic_exchange(T * volatile *, T **, T **, int);
    330330
    331331_Bool __atomic_load_n(const volatile _Bool *, int);
    332 void __atomic_load(const volatile _Bool *, volatile _Bool *, int);
     332void __atomic_load(const volatile _Bool *, _Bool *, int);
    333333char __atomic_load_n(const volatile char *, int);
    334 void __atomic_load(const volatile char *, volatile char *, int);
     334void __atomic_load(const volatile char *, char *, int);
    335335signed char __atomic_load_n(const volatile signed char *, int);
    336 void __atomic_load(const volatile signed char *, volatile signed char *, int);
     336void __atomic_load(const volatile signed char *, signed char *, int);
    337337unsigned char __atomic_load_n(const volatile unsigned char *, int);
    338 void __atomic_load(const volatile unsigned char *, volatile unsigned char *, int);
     338void __atomic_load(const volatile unsigned char *, unsigned char *, int);
    339339signed short __atomic_load_n(const volatile signed short *, int);
    340 void __atomic_load(const volatile signed short *, volatile signed short *, int);
     340void __atomic_load(const volatile signed short *, signed short *, int);
    341341unsigned short __atomic_load_n(const volatile unsigned short *, int);
    342 void __atomic_load(const volatile unsigned short *, volatile unsigned short *, int);
     342void __atomic_load(const volatile unsigned short *, unsigned short *, int);
    343343signed int __atomic_load_n(const volatile signed int *, int);
    344 void __atomic_load(const volatile signed int *, volatile signed int *, int);
     344void __atomic_load(const volatile signed int *, signed int *, int);
    345345unsigned int __atomic_load_n(const volatile unsigned int *, int);
    346 void __atomic_load(const volatile unsigned int *, volatile unsigned int *, int);
     346void __atomic_load(const volatile unsigned int *, unsigned int *, int);
    347347signed long int __atomic_load_n(const volatile signed long int *, int);
    348 void __atomic_load(const volatile signed long int *, volatile signed long int *, int);
     348void __atomic_load(const volatile signed long int *, signed long int *, int);
    349349unsigned long int __atomic_load_n(const volatile unsigned long int *, int);
    350 void __atomic_load(const volatile unsigned long int *, volatile unsigned long int *, int);
     350void __atomic_load(const volatile unsigned long int *, unsigned long int *, int);
    351351signed long long int __atomic_load_n(const volatile signed long long int *, int);
    352 void __atomic_load(const volatile signed long long int *, volatile signed long long int *, int);
     352void __atomic_load(const volatile signed long long int *, signed long long int *, int);
    353353unsigned long long int __atomic_load_n(const volatile unsigned long long int *, int);
    354 void __atomic_load(const volatile unsigned long long int *, volatile unsigned long long int *, int);
     354void __atomic_load(const volatile unsigned long long int *, unsigned long long int *, int);
    355355#if defined(__SIZEOF_INT128__)
    356356signed __int128 __atomic_load_n(const volatile signed __int128 *, int);
    357 void __atomic_load(const volatile signed __int128 *, volatile signed __int128 *, int);
     357void __atomic_load(const volatile signed __int128 *, signed __int128 *, int);
    358358unsigned __int128 __atomic_load_n(const volatile unsigned __int128 *, int);
    359 void __atomic_load(const volatile unsigned __int128 *, volatile unsigned __int128 *, int);
     359void __atomic_load(const volatile unsigned __int128 *, unsigned __int128 *, int);
    360360#endif
    361361forall(T &) T * __atomic_load_n(T * const volatile *, int);
  • libcfa/src/fstream.cfa

    rd83b266 r0a061c0  
    1010// Created On       : Wed May 27 17:56:53 2015
    1111// Last Modified By : Peter A. Buhr
    12 // Last Modified On : Thu Jul 22 11:34:41 2021
    13 // Update Count     : 448
     12// Last Modified On : Thu Jul 29 22:34:10 2021
     13// Update Count     : 454
    1414//
    1515
     
    142142
    143143        if ( fclose( (FILE *)(os.file$) ) == EOF ) {
    144                 abort | IO_MSG "close output" | nl | strerror( errno );
     144                throw (Close_Failure){ os };
     145                // abort | IO_MSG "close output" | nl | strerror( errno );
    145146        } // if
    146147        os.file$ = 0p;
     
    149150ofstream & write( ofstream & os, const char data[], size_t size ) {
    150151        if ( fail( os ) ) {
    151                 abort | IO_MSG "attempt write I/O on failed stream";
     152                throw (Write_Failure){ os };
     153                // abort | IO_MSG "attempt write I/O on failed stream";
    152154        } // if
    153155
    154156        if ( fwrite( data, 1, size, (FILE *)(os.file$) ) != size ) {
    155                 abort | IO_MSG "write" | nl | strerror( errno );
     157                throw (Write_Failure){ os };
     158                // abort | IO_MSG "write" | nl | strerror( errno );
    156159        } // if
    157160        return os;
     
    277280
    278281        if ( fclose( (FILE *)(is.file$) ) == EOF ) {
    279                 abort | IO_MSG "close input" | nl | strerror( errno );
     282                throw (Close_Failure){ is };
     283                // abort | IO_MSG "close input" | nl | strerror( errno );
    280284        } // if
    281285        is.file$ = 0p;
     
    284288ifstream & read( ifstream & is, char data[], size_t size ) {
    285289        if ( fail( is ) ) {
    286                 abort | IO_MSG "attempt read I/O on failed stream";
     290                throw (Read_Failure){ is };
     291                // abort | IO_MSG "attempt read I/O on failed stream";
    287292        } // if
    288293
    289294        if ( fread( data, size, 1, (FILE *)(is.file$) ) == 0 ) {
    290                 abort | IO_MSG "read" | nl | strerror( errno );
     295                throw (Read_Failure){ is };
     296                // abort | IO_MSG "read" | nl | strerror( errno );
    291297        } // if
    292298        return is;
     
    338344
    339345
    340 //EHM_VIRTUAL_TABLE(Open_Failure, Open_Failure_main_table);
    341 static vtable(Open_Failure) Open_Failure_main_table;
     346static vtable(Open_Failure) Open_Failure_vt;
    342347
    343348// exception I/O constructors
    344349void ?{}( Open_Failure & this, ofstream & ostream ) {
    345         this.virtual_table = &Open_Failure_main_table;
     350        this.virtual_table = &Open_Failure_vt;
    346351        this.ostream = &ostream;
    347352        this.tag = 1;
     
    349354
    350355void ?{}( Open_Failure & this, ifstream & istream ) {
    351         this.virtual_table = &Open_Failure_main_table;
     356        this.virtual_table = &Open_Failure_vt;
    352357        this.istream = &istream;
    353358        this.tag = 0;
    354359} // ?{}
    355360
    356 void throwOpen_Failure( ofstream & ostream ) {
    357         Open_Failure exc = { ostream };
    358 }
    359 
    360 void throwOpen_Failure( ifstream & istream ) {
    361         Open_Failure exc = { istream };
    362 }
     361
     362static vtable(Close_Failure) Close_Failure_vt;
     363
     364// exception I/O constructors
     365void ?{}( Close_Failure & this, ofstream & ostream ) {
     366        this.virtual_table = &Close_Failure_vt;
     367        this.ostream = &ostream;
     368        this.tag = 1;
     369} // ?{}
     370
     371void ?{}( Close_Failure & this, ifstream & istream ) {
     372        this.virtual_table = &Close_Failure_vt;
     373        this.istream = &istream;
     374        this.tag = 0;
     375} // ?{}
     376
     377
     378static vtable(Write_Failure) Write_Failure_vt;
     379
     380// exception I/O constructors
     381void ?{}( Write_Failure & this, ofstream & ostream ) {
     382        this.virtual_table = &Write_Failure_vt;
     383        this.ostream = &ostream;
     384        this.tag = 1;
     385} // ?{}
     386
     387void ?{}( Write_Failure & this, ifstream & istream ) {
     388        this.virtual_table = &Write_Failure_vt;
     389        this.istream = &istream;
     390        this.tag = 0;
     391} // ?{}
     392
     393
     394static vtable(Read_Failure) Read_Failure_vt;
     395
     396// exception I/O constructors
     397void ?{}( Read_Failure & this, ofstream & ostream ) {
     398        this.virtual_table = &Read_Failure_vt;
     399        this.ostream = &ostream;
     400        this.tag = 1;
     401} // ?{}
     402
     403void ?{}( Read_Failure & this, ifstream & istream ) {
     404        this.virtual_table = &Read_Failure_vt;
     405        this.istream = &istream;
     406        this.tag = 0;
     407} // ?{}
     408
     409// void throwOpen_Failure( ofstream & ostream ) {
     410//      Open_Failure exc = { ostream };
     411// }
     412
     413// void throwOpen_Failure( ifstream & istream ) {
     414//      Open_Failure exc = { istream };
     415// }
    363416
    364417// Local Variables: //
  • libcfa/src/fstream.hfa

    rd83b266 r0a061c0  
    1010// Created On       : Wed May 27 17:56:53 2015
    1111// Last Modified By : Peter A. Buhr
    12 // Last Modified On : Tue Jul 20 21:18:03 2021
    13 // Update Count     : 232
     12// Last Modified On : Wed Jul 28 07:35:50 2021
     13// Update Count     : 234
    1414//
    1515
     
    160160void ?{}( Open_Failure & this, ifstream & );
    161161
     162exception Close_Failure {
     163        union {
     164                ofstream * ostream;
     165                ifstream * istream;
     166        };
     167        // TEMPORARY: need polymorphic exceptions
     168        int tag;                                                                                        // 1 => ostream; 0 => istream
     169};
     170
     171void ?{}( Close_Failure & this, ofstream & );
     172void ?{}( Close_Failure & this, ifstream & );
     173
     174exception Write_Failure {
     175        union {
     176                ofstream * ostream;
     177                ifstream * istream;
     178        };
     179        // TEMPORARY: need polymorphic exceptions
     180        int tag;                                                                                        // 1 => ostream; 0 => istream
     181};
     182
     183void ?{}( Write_Failure & this, ofstream & );
     184void ?{}( Write_Failure & this, ifstream & );
     185
     186exception Read_Failure {
     187        union {
     188                ofstream * ostream;
     189                ifstream * istream;
     190        };
     191        // TEMPORARY: need polymorphic exceptions
     192        int tag;                                                                                        // 1 => ostream; 0 => istream
     193};
     194
     195void ?{}( Read_Failure & this, ofstream & );
     196void ?{}( Read_Failure & this, ifstream & );
     197
    162198// Local Variables: //
    163199// mode: c //
Note: See TracChangeset for help on using the changeset viewer.