Changeset 330d933 for src/BasicTypes-gen.cc
- Timestamp:
- Aug 25, 2019, 8:48:51 AM (5 years ago)
- Branches:
- ADT, arm-eh, ast-experimental, enum, forall-pointer-decay, jacob/cs343-translation, jenkins-sandbox, master, new-ast, new-ast-unique-expr, pthread-emulation, qualifiedEnum
- Children:
- 2aab69b, 5a43ab8
- Parents:
- f9bf142 (diff), bbb1b35 (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. - File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/BasicTypes-gen.cc
rf9bf142 r330d933 295 295 // cout << code.str(); 296 296 297 297 298 // TEMPORARY DURING CHANGE OVER 299 #define TypeAST TOP_SRCDIR "src/AST/Type.hpp" 300 resetInput( file, TypeAST, buffer, code, str ); 301 302 if ( (start = str.find( STARTMK )) == string::npos ) Abort( "start", TypeAST ); 303 start += sizeof( STARTMK ); // includes newline 304 code << str.substr( 0, start ); 305 306 code << "\t" << BYMK << endl; 307 code << "\tenum Kind {" << endl; 308 for ( int r = 0; r < NUMBER_OF_BASIC_TYPES; r += 1 ) { 309 code << "\t\t" << graph[r].name << "," << endl; 310 } // for 311 code << "\t\tNUMBER_OF_BASIC_TYPES" << endl; 312 code << "\t} kind;" << endl; 313 code << "\t"; // indentation for end marker 314 315 if ( (start = str.find( ENDMK, start + 1 )) == string::npos ) Abort( "end", TypeAST ); 316 code << str.substr( start ); 317 318 output( file, TypeAST, code ); 319 // cout << code.str(); 320 321 298 322 #define ConversionCost TOP_SRCDIR "src/ResolvExpr/ConversionCost.cc" 299 323 resetInput( file, ConversionCost, buffer, code, str ); … … 310 334 code << right << setw(30) << graph[c].type << left; 311 335 } else if ( graph[c].rank != graph[c + 2].rank ) { 312 code << string( 10, ' ' ) << setw(25) << graph[c].type << setw(25) <<graph[c + 1].type;336 code << string( 10, ' ' ) << setw(25) << graph[c].type << graph[c + 1].type; 313 337 c += 1; 314 338 } else { 315 code << setw(20) << graph[c].type << setw(20) << graph[c + 1].type << setw(20) <<graph[c + 2].type;339 code << setw(20) << graph[c].type << setw(20) << graph[c + 1].type << graph[c + 2].type; 316 340 c += 2; 317 341 } // if … … 328 352 code << "\t" << BYMK << endl; 329 353 code << "\tstatic const int costMatrix[BasicType::NUMBER_OF_BASIC_TYPES][BasicType::NUMBER_OF_BASIC_TYPES] = { // path length from root to node" << endl 330 << "\t\t/* ";354 << "\t\t/* "; 331 355 for ( int r = 0; r < NUMBER_OF_BASIC_TYPES; r += 1 ) { // titles 332 356 code << setw(5) << graph[r].abbrev; … … 334 358 code << " */" << endl; 335 359 for ( int r = 0; r < NUMBER_OF_BASIC_TYPES; r += 1 ) { // costs 336 code << "\t\t/* " << setw(6) << graph[r].abbrev << "*/ {";360 code << "\t\t/* " << setw(6) << graph[r].abbrev << " */ {"; 337 361 for ( int c = 0; c < NUMBER_OF_BASIC_TYPES; c += 1 ) { 338 362 code << setw(4) << costMatrix[r][c] << ","; … … 353 377 code << "\t" << BYMK << endl; 354 378 code << "\tstatic const int signMatrix[BasicType::NUMBER_OF_BASIC_TYPES][BasicType::NUMBER_OF_BASIC_TYPES] = { // number of sign changes in safe conversion" << endl 355 << "\t\t/* ";379 << "\t\t/* "; 356 380 for ( int r = 0; r < NUMBER_OF_BASIC_TYPES; r += 1 ) { // titles 357 381 code << setw(5) << graph[r].abbrev; … … 359 383 code << " */" << endl; 360 384 for ( int r = 0; r < NUMBER_OF_BASIC_TYPES; r += 1 ) { // costs 361 code << "\t\t/* " << setw(6) << graph[r].abbrev << "*/ {";385 code << "\t\t/* " << setw(6) << graph[r].abbrev << " */ {"; 362 386 for ( int c = 0; c < NUMBER_OF_BASIC_TYPES; c += 1 ) { 363 387 code << setw(4) << signMatrix[r][c] << ","; … … 395 419 code << "*/" << endl; 396 420 for ( int r = 0; r < NUMBER_OF_BASIC_TYPES; r += 1 ) { // costs 397 code << "\t\t\t\t {\n\t\t/* " << setw(6) << graph[r].abbrev << "*/";421 code << "\t\t\t\t {\n\t\t/* " << setw(6) << graph[r].abbrev << " */"; 398 422 for ( int c = 0; c < NUMBER_OF_BASIC_TYPES; c += 1 ) { 399 423 string s = string{"BT "} + graph[commonTypeMatrix[r][c]].name;
Note: See TracChangeset
for help on using the changeset viewer.