Changes in / [463cb33:519f11c]


Ignore:
Files:
1 added
4 deleted
8 edited

Legend:

Unmodified
Added
Removed
  • libcfa/src/iostream.cfa

    r463cb33 r519f11c  
    1010// Created On       : Wed May 27 17:56:53 2015
    1111// Last Modified By : Peter A. Buhr
    12 // Last Modified On : Thu Jul 16 07:43:31 2020
    13 // Update Count     : 1102
     12// Last Modified On : Wed Jul  8 22:14:20 2020
     13// Update Count     : 1069
    1414//
    1515
     
    970970        } // ?|?
    971971
    972 #if defined( __SIZEOF_INT128__ )
    973         istype & ?|?( istype & is, int128 & i128 ) {
    974                 return (istype &)(is | (unsigned int128 &)i128);
    975         } // ?|?
    976 
    977         istype & ?|?( istype & is, unsigned int128 & ui128 ) {
    978                 char s[40];
    979                 bool sign = false;
    980 
    981                 if ( fmt( is, " %[-]", s ) == 1 ) sign = true;  // skip whitespace, negative sign ?
    982                 // If the input is too large, the value returned is undefined. If there is no input, no value is returned
    983                 if ( fmt( is, "%39[0-9]%*[0-9]", s ) == 1 ) {   // take first 39 characters, ignore remaining
    984                         ui128 = 0;
    985                         for ( unsigned int i = 0; s[i] != '\0'; i += 1 ) {
    986                                 ui128 = ui128 * 10 + s[i] - '0';
    987                         } // for
    988                         if ( sign ) ui128 = -ui128;
    989                 } else if ( sign ) ungetc( is, '-' );                   // return minus when no digits
    990                 return is;
    991         } // ?|?
    992 #endif // __SIZEOF_INT128__
    993972
    994973        istype & ?|?( istype & is, float & f ) {
  • libcfa/src/iostream.hfa

    r463cb33 r519f11c  
    1010// Created On       : Wed May 27 17:56:53 2015
    1111// Last Modified By : Peter A. Buhr
    12 // Last Modified On : Thu Jul 16 07:43:32 2020
    13 // Update Count     : 348
     12// Last Modified On : Mon Jul 13 22:11:41 2020
     13// Update Count     : 344
    1414//
    1515
     
    315315        istype & ?|?( istype &, unsigned int & );
    316316        istype & ?|?( istype &, long int & );
     317        istype & ?|?( istype &, long long int & );
    317318        istype & ?|?( istype &, unsigned long int & );
    318         istype & ?|?( istype &, long long int & );
    319319        istype & ?|?( istype &, unsigned long long int & );
    320 #if defined( __SIZEOF_INT128__ )
    321         istype & ?|?( istype &, int128 & );
    322         istype & ?|?( istype &, unsigned int128 & );
    323 #endif // __SIZEOF_INT128__
    324320
    325321        istype & ?|?( istype &, float & );
  • src/GenPoly/InstantiateGeneric.cc

    r463cb33 r519f11c  
    99// Author           : Aaron B. Moss
    1010// Created On       : Thu Aug 04 18:33:00 2016
    11 // Last Modified By : Andrew Beach
    12 // Last Modified On : Wed Jul 16 10:17:00 2020
    13 // Update Count     : 2
     11// Last Modified By : Aaron B. Moss
     12// Last Modified On : Thu Aug 04 18:33:00 2016
     13// Update Count     : 1
    1414//
    1515#include "InstantiateGeneric.h"
     
    297297        }
    298298
    299         template< typename AggrInst >
    300         static AggrInst * asForward( AggrInst * decl ) {
    301                 if ( !decl->body ) {
    302                         return nullptr;
    303                 }
    304                 decl = decl->clone();
    305                 decl->body = false;
    306                 deleteAll( decl->members );
    307                 decl->members.clear();
    308                 return decl;
    309         }
    310 
    311299        void GenericInstantiator::stripDtypeParams( AggregateDecl *base, std::list< TypeDecl* >& baseParams, const std::list< TypeExpr* >& typeSubs ) {
    312300                substituteMembers( base->get_members(), baseParams, typeSubs );
     
    385373                                concDecl->set_body( inst->get_baseStruct()->has_body() );
    386374                                substituteMembers( inst->get_baseStruct()->get_members(), *inst->get_baseParameters(), typeSubs, concDecl->get_members() );
    387                                 // Forward declare before recursion. (TODO: Only when needed, #199.)
    388                                 insert( inst, typeSubs, concDecl );
    389                                 if ( StructDecl *forwardDecl = asForward( concDecl ) ) {
    390                                         declsToAddBefore.push_back( forwardDecl );
    391                                 }
     375                                insert( inst, typeSubs, concDecl ); // must insert before recursion
    392376                                concDecl->acceptMutator( *visitor ); // recursively instantiate members
    393377                                declsToAddBefore.push_back( concDecl ); // must occur before declaration is added so that member instantiations appear first
     
    439423                                concDecl->set_body( inst->get_baseUnion()->has_body() );
    440424                                substituteMembers( inst->get_baseUnion()->get_members(), *inst->get_baseParameters(), typeSubs, concDecl->get_members() );
    441                                 // Forward declare before recursion. (TODO: Only when needed, #199.)
    442                                 insert( inst, typeSubs, concDecl );
    443                                 if ( UnionDecl *forwardDecl = asForward( concDecl ) ) {
    444                                         declsToAddBefore.push_back( forwardDecl );
    445                                 }
     425                                insert( inst, typeSubs, concDecl ); // must insert before recursion
    446426                                concDecl->acceptMutator( *visitor ); // recursively instantiate members
    447427                                declsToAddBefore.push_back( concDecl ); // must occur before declaration is added so that member instantiations appear first
  • src/Parser/ExpressionNode.cc

    r463cb33 r519f11c  
    1010// Created On       : Sat May 16 13:17:07 2015
    1111// Last Modified By : Peter A. Buhr
    12 // Last Modified On : Wed Jul 15 08:24:08 2020
    13 // Update Count     : 1046
     12// Last Modified On : Mon Jul 13 21:12:02 2020
     13// Update Count     : 1043
    1414//
    1515
     
    222222                        } else {                                                                        // octal int128 constant
    223223                                unsigned int len = str.length();
     224                                char buf[32];
     225                                __int128 val = v;
     226                               
    224227                                if ( len > 1 + 43 || (len == 1 + 43 && str[0] > '3') ) SemanticError( yylloc, "128-bit octal constant to large " + str );
    225228                                if ( len <= 1 + 21 ) {                                  // value < 21 octal digitis
     
    227230                                } else {
    228231                                        sscanf( &str[len - 21], "%llo", &v );
    229                                         __int128 val = v;                                       // accumulate bits
     232                                        val = v;                                                        // store bits
    230233                                        str[len - 21] ='\0';                            // shorten string
    231234                                        sscanf( &str[len == 43 ? 1 : 0], "%llo", &v );
     
    237240                                        } // if
    238241                                        v = val >> 64; v2 = (uint64_t)val;      // replace octal constant with 2 hex constants
    239                                         char buf[32];
    240242                                        sprintf( buf, "%#llx", v2 );
    241243                                        str2 = buf;
     
    254256                        #define P10_UINT64 10'000'000'000'000'000'000ULL // 19 zeroes
    255257                        unsigned int len = str.length();
     258                        char buf[32];
     259                        __int128 val = v;
     260
    256261                        if ( str.length() == 39 && str > (Unsigned ? "340282366920938463463374607431768211455" : "170141183460469231731687303715884105727") )
    257262                                SemanticError( yylloc, "128-bit decimal constant to large " + str );
     
    260265                        } else {
    261266                                sscanf( &str[len - 19], "%llu", &v );
    262                                 __int128 val = v;                                               // accumulate bits
     267                                val = v;                                                                // store bits
    263268                                str[len - 19] ='\0';                                    // shorten string
    264269                                sscanf( &str[len == 39 ? 1 : 0], "%llu", &v );
     
    270275                                } // if
    271276                                v = val >> 64; v2 = (uint64_t)val;              // replace decimal constant with 2 hex constants
    272                                 char buf[32];
    273277                                sprintf( buf, "%#llx", v2 );
    274278                                str2 = buf;
  • tests/.expect/functions.x64.txt

    r463cb33 r519f11c  
    121121
    122122}
    123 struct _conc__tuple2_0;
    124123struct _conc__tuple2_0 {
    125124    signed int field_0;
     
    158157
    159158}
    160 struct _conc__tuple3_1;
    161159struct _conc__tuple3_1 {
    162160    signed int field_0;
     
    172170    __attribute__ ((unused)) struct _conc__tuple3_1 _X9_retval_fT3iii_1 = {  };
    173171}
    174 struct _conc__tuple3_2;
    175172struct _conc__tuple3_2 {
    176173    signed int field_0;
     
    263260    __attribute__ ((unused)) signed int *const _X10_retval_f3KPi_1;
    264261}
    265 struct _conc__tuple2_3;
    266262struct _conc__tuple2_3 {
    267263    signed int *field_0;
  • tests/.expect/functions.x86.txt

    r463cb33 r519f11c  
    121121
    122122}
    123 struct _conc__tuple2_0;
    124123struct _conc__tuple2_0 {
    125124    signed int field_0;
     
    158157
    159158}
    160 struct _conc__tuple3_1;
    161159struct _conc__tuple3_1 {
    162160    signed int field_0;
     
    172170    __attribute__ ((unused)) struct _conc__tuple3_1 _X9_retval_fT3iii_1 = {  };
    173171}
    174 struct _conc__tuple3_2;
    175172struct _conc__tuple3_2 {
    176173    signed int field_0;
     
    263260    __attribute__ ((unused)) signed int *const _X10_retval_f3KPi_1;
    264261}
    265 struct _conc__tuple2_3;
    266262struct _conc__tuple2_3 {
    267263    signed int *field_0;
  • tests/.in/manipulatorsInput.txt

    r463cb33 r519f11c  
    27273.5 3.5 3.456E+23.456E+2 -0x1.2p-3 3.5 0X1.23p3     3.5
    28283.5 3.5 3.456E+23.456E+2 -0x1.2p-3 3.5 0X1.23p3     3.5
    29 25 -25 42798
    30 1402432282 1505850196993244515
    31 394749758663249135511342
    32 12935154696204706112391834394
    33 
    34 423859149128410414395372834994551
    35 
    36 
    37 13889016598639747063234935497057631587
    38 170141183460469231731687303715884105727
    39 340282366920938463463374607431768211455
    40 -340282366920938463463374607431768211455
    41 340282366920938463463374607431768211455999
    42 1234567890123456789 -1234567890123456789
  • tests/manipulatorsInput.cfa

    r463cb33 r519f11c  
    77// Created On       : Sat Jun  8 17:58:54 2019
    88// Last Modified By : Peter A. Buhr
    9 // Last Modified On : Wed Jul 15 15:56:03 2020
    10 // Update Count     : 47
     9// Last Modified On : Thu Jun 13 17:41:43 2019
     10// Update Count     : 37
    1111//
    1212
     
    152152                sin | ignore( wdi( 8, ldc ) );                  sout | ldc;
    153153        }
    154 #if defined( __SIZEOF_INT128__ )
    155         {
    156                 int128 val;
    157                 for ( 15 ) {
    158                         sin | val;
    159                         sout | val;
    160                 }
    161         }
    162 #endif // __SIZEOF_INT128__
    163154} // main
    164155
Note: See TracChangeset for help on using the changeset viewer.