Changeset 7a780ad for src/ResolvExpr/CommonType.cc
- Timestamp:
- Apr 18, 2024, 5:19:17 PM (4 months ago)
- Branches:
- master
- Children:
- 38093ae
- Parents:
- 60c5b6d
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/ResolvExpr/CommonType.cc
r60c5b6d r7a780ad 38 38 // GENERATED START, DO NOT EDIT 39 39 // GENERATED BY BasicTypes-gen.cc 40 #define BT ast::Basic Type::41 static const BTKind commonTypes[BT NUMBER_OF_BASIC_TYPES][BT NUMBER_OF_BASIC_TYPES] = { // nearest common ancestor40 #define BT ast::BasicKind:: 41 static const ast::BasicKind commonTypes[BT NUMBER_OF_BASIC_TYPES][BT NUMBER_OF_BASIC_TYPES] = { // nearest common ancestor 42 42 /* B C SC UC SI SUI 43 43 I UI LI LUI LLI LLUI … … 339 339 // GENERATED END 340 340 static_assert( 341 sizeof(commonTypes)/sizeof(commonTypes[0][0]) == ast::Basic Type::NUMBER_OF_BASIC_TYPES * ast::BasicType::NUMBER_OF_BASIC_TYPES,341 sizeof(commonTypes)/sizeof(commonTypes[0][0]) == ast::BasicKind::NUMBER_OF_BASIC_TYPES * ast::BasicKind::NUMBER_OF_BASIC_TYPES, 342 342 "Each basic type kind should have a corresponding row in the combined type matrix" 343 343 ); … … 366 366 void postvisit( const ast::BasicType * basic ) { 367 367 if ( auto basic2 = dynamic_cast< const ast::BasicType * >( type2 ) ) { 368 ast::Basic Type::Kind kind;368 ast::BasicKind kind; 369 369 if (basic->kind != basic2->kind && !widen.first && !widen.second) return; 370 370 else if (!widen.first) kind = basic->kind; // widen.second … … 386 386 const ast::EnumDecl* enumDecl = enumInst->base; 387 387 if ( !enumDecl->base ) { 388 ast::Basic Type::Kind kind = commonTypes[ basic->kind ][ ast::BasicType::SignedInt ];388 ast::BasicKind kind = commonTypes[ basic->kind ][ ast::BasicKind::SignedInt ]; 389 389 if ( 390 390 ( ( kind == basic->kind && basic->qualifiers >= type2->qualifiers ) … … 398 398 } else if ( auto type2AsAttr = dynamic_cast< const ast::EnumAttrType * >( type2 ) ) { 399 399 if ( type2AsAttr->attr == ast::EnumAttribute::Posn ) { 400 ast::Basic Type::Kind kind = commonTypes[ basic->kind ][ ast::BasicType::SignedInt ];400 ast::BasicKind kind = commonTypes[ basic->kind ][ ast::BasicKind::SignedInt ]; 401 401 if ( 402 402 ( ( kind == basic->kind && basic->qualifiers >= type2->qualifiers ) … … 649 649 void postvisit( const ast::EnumInstType * enumInst ) { 650 650 if ( enumInst->base && !enumInst->base->base ) { 651 auto basicType = new ast::BasicType( ast::Basic Type::UnsignedInt );651 auto basicType = new ast::BasicType( ast::BasicKind::UnsignedInt ); 652 652 result = commonType( basicType, type2, tenv, need, have, open, widen); 653 653 } … … 674 674 } else if ( widen.second && dynamic_cast< const ast::OneType * >( type2 ) ) { 675 675 result = new ast::BasicType{ 676 ast::Basic Type::SignedInt, zero->qualifiers | type2->qualifiers };676 ast::BasicKind::SignedInt, zero->qualifiers | type2->qualifiers }; 677 677 } else if ( const ast::EnumInstType * enumInst = dynamic_cast< const ast::EnumInstType * >( type2 ) ) { 678 678 const ast::EnumDecl * enumDecl = enumInst->base; … … 695 695 } else if ( widen.second && dynamic_cast< const ast::ZeroType * >( type2 ) ) { 696 696 result = new ast::BasicType{ 697 ast::Basic Type::SignedInt, one->qualifiers | type2->qualifiers };697 ast::BasicKind::SignedInt, one->qualifiers | type2->qualifiers }; 698 698 } else if ( const ast::EnumInstType * enumInst = dynamic_cast< const ast::EnumInstType * >( type2 ) ) { 699 699 const ast::EnumDecl * enumDecl = enumInst->base;
Note: See TracChangeset
for help on using the changeset viewer.