Ignore:
Timestamp:
Aug 25, 2019, 8:48:51 AM (5 years ago)
Author:
Peter A. Buhr <pabuhr@…>
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.
Message:

Merge branch 'master' of plg.uwaterloo.ca:software/cfa/cfa-cc

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/BasicTypes-gen.cc

    rf9bf142 r330d933  
    295295        // cout << code.str();
    296296
    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
    298322        #define ConversionCost TOP_SRCDIR "src/ResolvExpr/ConversionCost.cc"
    299323        resetInput( file, ConversionCost, buffer, code, str );
     
    310334                        code << right << setw(30) << graph[c].type << left;
    311335                } 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;
    313337                        c += 1;
    314338                } 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;
    316340                        c += 2;
    317341                } // if
     
    328352        code << "\t" << BYMK << endl;
    329353        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/*           ";
    331355        for ( int r = 0; r < NUMBER_OF_BASIC_TYPES; r += 1 ) { // titles
    332356                code << setw(5) << graph[r].abbrev;
     
    334358        code << " */" << endl;
    335359        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 << " */ {";
    337361                for ( int c = 0; c < NUMBER_OF_BASIC_TYPES; c += 1 ) {
    338362                        code << setw(4) << costMatrix[r][c] << ",";
     
    353377        code << "\t" << BYMK << endl;
    354378        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/*           ";
    356380        for ( int r = 0; r < NUMBER_OF_BASIC_TYPES; r += 1 ) { // titles
    357381                code << setw(5) << graph[r].abbrev;
     
    359383        code << " */" << endl;
    360384        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 << " */ {";
    362386                for ( int c = 0; c < NUMBER_OF_BASIC_TYPES; c += 1 ) {
    363387                        code << setw(4) << signMatrix[r][c] << ",";
     
    395419        code << "*/" << endl;
    396420        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 << " */";
    398422                for ( int c = 0; c < NUMBER_OF_BASIC_TYPES; c += 1 ) {
    399423                        string s = string{"BT "} + graph[commonTypeMatrix[r][c]].name;
Note: See TracChangeset for help on using the changeset viewer.