Changeset 7d55e4d for src/ResolvExpr
- Timestamp:
- Oct 30, 2023, 4:59:34 PM (16 months ago)
- Branches:
- master
- Children:
- 4ac402d
- Parents:
- 36e6f10
- Location:
- src/ResolvExpr
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
src/ResolvExpr/CommonType.cc
r36e6f10 r7d55e4d 184 184 // GENERATED START, DO NOT EDIT 185 185 // GENERATED BY BasicTypes-gen.cc 186 #define BT BasicType::187 static const B asicType::Kind commonTypes[BasicType::NUMBER_OF_BASIC_TYPES][BasicType::NUMBER_OF_BASIC_TYPES] = { // nearest common ancestor186 #define BT ast::BasicType:: 187 static const BT Kind commonTypes[BT NUMBER_OF_BASIC_TYPES][BT NUMBER_OF_BASIC_TYPES] = { // nearest common ancestor 188 188 /* B C SC UC SI SUI 189 189 I UI LI LUI LLI LLUI … … 497 497 void CommonType_old::postvisit( BasicType * basicType ) { 498 498 if ( BasicType * otherBasic = dynamic_cast< BasicType * >( type2 ) ) { 499 BasicType::Kind newType = commonTypes[ basicType->get_kind() ][otherBasic->get_kind() ];499 BasicType::Kind newType = (BasicType::Kind)(int)commonTypes[ (ast::BasicType::Kind)(int)basicType->get_kind() ][ (ast::BasicType::Kind)(int)otherBasic->get_kind() ]; 500 500 if ( ( ( newType == basicType->get_kind() && basicType->tq >= otherBasic->tq ) || widenFirst ) && ( ( newType == otherBasic->get_kind() && basicType->tq <= otherBasic->tq ) || widenSecond ) ) { 501 501 result = new BasicType( basicType->tq | otherBasic->tq, newType ); … … 503 503 } else if ( dynamic_cast< ZeroType * >( type2 ) || dynamic_cast< OneType * >( type2 ) ) { 504 504 // use signed int in lieu of the enum/zero/one type 505 BasicType::Kind newType = commonTypes[ basicType->get_kind() ][BasicType::SignedInt ];505 BasicType::Kind newType = (BasicType::Kind)(int)commonTypes[ (ast::BasicType::Kind)(int)basicType->get_kind() ][ ast::BasicType::SignedInt ]; 506 506 if ( ( ( newType == basicType->get_kind() && basicType->tq >= type2->tq ) || widenFirst ) && ( ( newType != basicType->get_kind() && basicType->tq <= type2->tq ) || widenSecond ) ) { 507 507 result = new BasicType( basicType->tq | type2->tq, newType ); … … 512 512 result = baseType->clone(); 513 513 } else { 514 BasicType::Kind newType = commonTypes[ basicType->get_kind() ][BasicType::SignedInt ];514 BasicType::Kind newType = (BasicType::Kind)(int)commonTypes[ (ast::BasicType::Kind)(int)basicType->get_kind() ][ ast::BasicType::SignedInt ]; 515 515 if ( ( ( newType == basicType->get_kind() && basicType->tq >= type2->tq ) || widenFirst ) && ( ( newType != basicType->get_kind() && basicType->tq <= type2->tq ) || widenSecond ) ) { 516 516 result = new BasicType( basicType->tq | type2->tq, newType ); … … 700 700 else if (!widen.first) kind = basic->kind; // widen.second 701 701 else if (!widen.second) kind = basic2->kind; 702 else kind = (ast::BasicType::Kind)(int)commonTypes[ (BasicType::Kind)(int)basic->kind ][ (BasicType::Kind)(int)basic2->kind ];702 else kind = commonTypes[ basic->kind ][ basic2->kind ]; 703 703 // xxx - what does qualifiers even do here?? 704 704 if ( (basic->qualifiers >= basic2->qualifiers || widen.first) … … 719 719 } else { 720 720 #warning remove casts when `commonTypes` moved to new AST 721 ast::BasicType::Kind kind = (ast::BasicType::Kind)(int)commonTypes[ (BasicType::Kind)(int)basic->kind ][ (BasicType::Kind)(int)ast::BasicType::SignedInt ];721 ast::BasicType::Kind kind = commonTypes[ basic->kind ][ ast::BasicType::SignedInt ]; 722 722 if ( 723 723 ( ( kind == basic->kind && basic->qualifiers >= type2->qualifiers ) -
src/ResolvExpr/ConversionCost.cc
r36e6f10 r7d55e4d 226 226 // GENERATED START, DO NOT EDIT 227 227 // GENERATED BY BasicTypes-gen.cc 228 static const int costMatrix[ BasicType::NUMBER_OF_BASIC_TYPES][BasicType::NUMBER_OF_BASIC_TYPES] = { // path length from root to node228 static const int costMatrix[ast::BasicType::NUMBER_OF_BASIC_TYPES][ast::BasicType::NUMBER_OF_BASIC_TYPES] = { // path length from root to node 229 229 /* B C SC UC SI SUI I UI LI LUI LLI LLUI IB UIB _FH _FH _F _FC F FC _FX _FXC FD _FDC D DC F80X_FDXC F80 _FB_FLDC FB LD LDC _FBX_FLDXC */ 230 230 /* B */ { 0, 1, 1, 2, 2, 3, 3, 4, 4, 5, 5, 6, 6, 7, 7, 8, 8, 9, 9, 10, 10, 11, 11, 12, 12, 13, 13, 14, 14, 15, 15, 16, 17, 16, 18, 17, }, … … 274 274 // GENERATED START, DO NOT EDIT 275 275 // GENERATED BY BasicTypes-gen.cc 276 static const int signMatrix[ BasicType::NUMBER_OF_BASIC_TYPES][BasicType::NUMBER_OF_BASIC_TYPES] = { // number of sign changes in safe conversion276 static const int signMatrix[ast::BasicType::NUMBER_OF_BASIC_TYPES][ast::BasicType::NUMBER_OF_BASIC_TYPES] = { // number of sign changes in safe conversion 277 277 /* B C SC UC SI SUI I UI LI LUI LLI LLUI IB UIB _FH _FH _F _FC F FC _FX _FXC FD _FDC D DC F80X_FDXC F80 _FB_FLDC FB LD LDC _FBX_FLDXC */ 278 278 /* B */ { 0, 0, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, },
Note: See TracChangeset
for help on using the changeset viewer.