Changes in / [463cb33:519f11c]
- Files:
-
- 1 added
- 4 deleted
- 8 edited
-
libcfa/src/iostream.cfa (modified) (2 diffs)
-
libcfa/src/iostream.hfa (modified) (2 diffs)
-
src/GenPoly/InstantiateGeneric.cc (modified) (4 diffs)
-
src/Parser/ExpressionNode.cc (modified) (7 diffs)
-
tests/.expect/functions.x64.txt (modified) (4 diffs)
-
tests/.expect/functions.x86.txt (modified) (4 diffs)
-
tests/.expect/manipulatorsInput.txt (added)
-
tests/.expect/manipulatorsInput.x64.txt (deleted)
-
tests/.expect/manipulatorsInput.x86.txt (deleted)
-
tests/.expect/poly-cycle.txt (deleted)
-
tests/.in/manipulatorsInput.txt (modified) (1 diff)
-
tests/manipulatorsInput.cfa (modified) (2 diffs)
-
tests/poly-cycle.cfa (deleted)
Legend:
- Unmodified
- Added
- Removed
-
libcfa/src/iostream.cfa
r463cb33 r519f11c 10 10 // Created On : Wed May 27 17:56:53 2015 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Thu Jul 16 07:43:31202013 // Update Count : 1 10212 // Last Modified On : Wed Jul 8 22:14:20 2020 13 // Update Count : 1069 14 14 // 15 15 … … 970 970 } // ?|? 971 971 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 returned983 if ( fmt( is, "%39[0-9]%*[0-9]", s ) == 1 ) { // take first 39 characters, ignore remaining984 ui128 = 0;985 for ( unsigned int i = 0; s[i] != '\0'; i += 1 ) {986 ui128 = ui128 * 10 + s[i] - '0';987 } // for988 if ( sign ) ui128 = -ui128;989 } else if ( sign ) ungetc( is, '-' ); // return minus when no digits990 return is;991 } // ?|?992 #endif // __SIZEOF_INT128__993 972 994 973 istype & ?|?( istype & is, float & f ) { -
libcfa/src/iostream.hfa
r463cb33 r519f11c 10 10 // Created On : Wed May 27 17:56:53 2015 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Thu Jul 16 07:43:32202013 // Update Count : 34 812 // Last Modified On : Mon Jul 13 22:11:41 2020 13 // Update Count : 344 14 14 // 15 15 … … 315 315 istype & ?|?( istype &, unsigned int & ); 316 316 istype & ?|?( istype &, long int & ); 317 istype & ?|?( istype &, long long int & ); 317 318 istype & ?|?( istype &, unsigned long int & ); 318 istype & ?|?( istype &, long long int & );319 319 istype & ?|?( istype &, unsigned long long int & ); 320 #if defined( __SIZEOF_INT128__ )321 istype & ?|?( istype &, int128 & );322 istype & ?|?( istype &, unsigned int128 & );323 #endif // __SIZEOF_INT128__324 320 325 321 istype & ?|?( istype &, float & ); -
src/GenPoly/InstantiateGeneric.cc
r463cb33 r519f11c 9 9 // Author : Aaron B. Moss 10 10 // Created On : Thu Aug 04 18:33:00 2016 11 // Last Modified By : A ndrew Beach12 // Last Modified On : Wed Jul 16 10:17:00 202013 // Update Count : 211 // Last Modified By : Aaron B. Moss 12 // Last Modified On : Thu Aug 04 18:33:00 2016 13 // Update Count : 1 14 14 // 15 15 #include "InstantiateGeneric.h" … … 297 297 } 298 298 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 311 299 void GenericInstantiator::stripDtypeParams( AggregateDecl *base, std::list< TypeDecl* >& baseParams, const std::list< TypeExpr* >& typeSubs ) { 312 300 substituteMembers( base->get_members(), baseParams, typeSubs ); … … 385 373 concDecl->set_body( inst->get_baseStruct()->has_body() ); 386 374 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 392 376 concDecl->acceptMutator( *visitor ); // recursively instantiate members 393 377 declsToAddBefore.push_back( concDecl ); // must occur before declaration is added so that member instantiations appear first … … 439 423 concDecl->set_body( inst->get_baseUnion()->has_body() ); 440 424 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 446 426 concDecl->acceptMutator( *visitor ); // recursively instantiate members 447 427 declsToAddBefore.push_back( concDecl ); // must occur before declaration is added so that member instantiations appear first -
src/Parser/ExpressionNode.cc
r463cb33 r519f11c 10 10 // Created On : Sat May 16 13:17:07 2015 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Wed Jul 15 08:24:08202013 // Update Count : 104 612 // Last Modified On : Mon Jul 13 21:12:02 2020 13 // Update Count : 1043 14 14 // 15 15 … … 222 222 } else { // octal int128 constant 223 223 unsigned int len = str.length(); 224 char buf[32]; 225 __int128 val = v; 226 224 227 if ( len > 1 + 43 || (len == 1 + 43 && str[0] > '3') ) SemanticError( yylloc, "128-bit octal constant to large " + str ); 225 228 if ( len <= 1 + 21 ) { // value < 21 octal digitis … … 227 230 } else { 228 231 sscanf( &str[len - 21], "%llo", &v ); 229 __int128 val = v; // accumulate bits232 val = v; // store bits 230 233 str[len - 21] ='\0'; // shorten string 231 234 sscanf( &str[len == 43 ? 1 : 0], "%llo", &v ); … … 237 240 } // if 238 241 v = val >> 64; v2 = (uint64_t)val; // replace octal constant with 2 hex constants 239 char buf[32];240 242 sprintf( buf, "%#llx", v2 ); 241 243 str2 = buf; … … 254 256 #define P10_UINT64 10'000'000'000'000'000'000ULL // 19 zeroes 255 257 unsigned int len = str.length(); 258 char buf[32]; 259 __int128 val = v; 260 256 261 if ( str.length() == 39 && str > (Unsigned ? "340282366920938463463374607431768211455" : "170141183460469231731687303715884105727") ) 257 262 SemanticError( yylloc, "128-bit decimal constant to large " + str ); … … 260 265 } else { 261 266 sscanf( &str[len - 19], "%llu", &v ); 262 __int128 val = v; // accumulate bits267 val = v; // store bits 263 268 str[len - 19] ='\0'; // shorten string 264 269 sscanf( &str[len == 39 ? 1 : 0], "%llu", &v ); … … 270 275 } // if 271 276 v = val >> 64; v2 = (uint64_t)val; // replace decimal constant with 2 hex constants 272 char buf[32];273 277 sprintf( buf, "%#llx", v2 ); 274 278 str2 = buf; -
tests/.expect/functions.x64.txt
r463cb33 r519f11c 121 121 122 122 } 123 struct _conc__tuple2_0;124 123 struct _conc__tuple2_0 { 125 124 signed int field_0; … … 158 157 159 158 } 160 struct _conc__tuple3_1;161 159 struct _conc__tuple3_1 { 162 160 signed int field_0; … … 172 170 __attribute__ ((unused)) struct _conc__tuple3_1 _X9_retval_fT3iii_1 = { }; 173 171 } 174 struct _conc__tuple3_2;175 172 struct _conc__tuple3_2 { 176 173 signed int field_0; … … 263 260 __attribute__ ((unused)) signed int *const _X10_retval_f3KPi_1; 264 261 } 265 struct _conc__tuple2_3;266 262 struct _conc__tuple2_3 { 267 263 signed int *field_0; -
tests/.expect/functions.x86.txt
r463cb33 r519f11c 121 121 122 122 } 123 struct _conc__tuple2_0;124 123 struct _conc__tuple2_0 { 125 124 signed int field_0; … … 158 157 159 158 } 160 struct _conc__tuple3_1;161 159 struct _conc__tuple3_1 { 162 160 signed int field_0; … … 172 170 __attribute__ ((unused)) struct _conc__tuple3_1 _X9_retval_fT3iii_1 = { }; 173 171 } 174 struct _conc__tuple3_2;175 172 struct _conc__tuple3_2 { 176 173 signed int field_0; … … 263 260 __attribute__ ((unused)) signed int *const _X10_retval_f3KPi_1; 264 261 } 265 struct _conc__tuple2_3;266 262 struct _conc__tuple2_3 { 267 263 signed int *field_0; -
tests/.in/manipulatorsInput.txt
r463cb33 r519f11c 27 27 3.5 3.5 3.456E+23.456E+2 -0x1.2p-3 3.5 0X1.23p3 3.5 28 28 3.5 3.5 3.456E+23.456E+2 -0x1.2p-3 3.5 0X1.23p3 3.5 29 25 -25 4279830 1402432282 150585019699324451531 39474975866324913551134232 1293515469620470611239183439433 34 42385914912841041439537283499455135 36 37 1388901659863974706323493549705763158738 17014118346046923173168730371588410572739 34028236692093846346337460743176821145540 -34028236692093846346337460743176821145541 34028236692093846346337460743176821145599942 1234567890123456789 -1234567890123456789 -
tests/manipulatorsInput.cfa
r463cb33 r519f11c 7 7 // Created On : Sat Jun 8 17:58:54 2019 8 8 // Last Modified By : Peter A. Buhr 9 // Last Modified On : Wed Jul 15 15:56:03 202010 // Update Count : 479 // Last Modified On : Thu Jun 13 17:41:43 2019 10 // Update Count : 37 11 11 // 12 12 … … 152 152 sin | ignore( wdi( 8, ldc ) ); sout | ldc; 153 153 } 154 #if defined( __SIZEOF_INT128__ )155 {156 int128 val;157 for ( 15 ) {158 sin | val;159 sout | val;160 }161 }162 #endif // __SIZEOF_INT128__163 154 } // main 164 155
Note:
See TracChangeset
for help on using the changeset viewer.