Changeset 8f31be6
- Timestamp:
- Jul 6, 2023, 11:07:27 AM (20 months ago)
- Branches:
- master
- Children:
- b4d2b3b
- Parents:
- c8bf1b5
- Location:
- src
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
TabularUnified src/AST/SymbolTable.cpp ¶
rc8bf1b5 r8f31be6 19 19 20 20 #include "Copy.hpp" 21 #include <iostream>22 #include <algorithm>23 24 21 #include "Decl.hpp" 25 22 #include "Expr.hpp" … … 206 203 out.push_back(decl.second); 207 204 } 208 209 // std::cerr << otypeKey << ' ' << out.size() << std::endl;210 205 } 211 206 -
TabularUnified src/GenPoly/SpecializeNew.cpp ¶
rc8bf1b5 r8f31be6 104 104 105 105 bool needsPolySpecialization( 106 const ast::Type * formalType,106 const ast::Type * /*formalType*/, 107 107 const ast::Type * actualType, 108 108 const ast::TypeSubstitution * subs ) { … … 126 126 if ( closedVars.find( *inst ) == closedVars.end() ) { 127 127 return true; 128 } 129 else { 128 } else { 130 129 assertf(false, "closed: %s", inst->name.c_str()); 131 130 } -
TabularUnified src/ResolvExpr/CommonType.cc ¶
rc8bf1b5 r8f31be6 696 696 void postvisit( const ast::BasicType * basic ) { 697 697 if ( auto basic2 = dynamic_cast< const ast::BasicType * >( type2 ) ) { 698 #warning remove casts when `commonTypes` moved to new AST699 700 /*701 ast::BasicType::Kind kind = (ast::BasicType::Kind)(int)commonTypes[ (BasicType::Kind)(int)basic->kind ][ (BasicType::Kind)(int)basic2->kind ];702 if (703 ( ( kind == basic->kind && basic->qualifiers >= basic2->qualifiers )704 || widen.first )705 && ( ( kind == basic2->kind && basic->qualifiers <= basic2->qualifiers )706 || widen.second )707 ) {708 result = new ast::BasicType{ kind, basic->qualifiers | basic2->qualifiers };709 }710 */711 698 ast::BasicType::Kind kind; 712 699 if (basic->kind != basic2->kind && !widen.first && !widen.second) return; … … 719 706 result = new ast::BasicType{ kind, basic->qualifiers | basic2->qualifiers }; 720 707 } 721 722 708 } else if ( 723 709 dynamic_cast< const ast::ZeroType * >( type2 ) 724 710 || dynamic_cast< const ast::OneType * >( type2 ) 725 711 ) { 726 #warning remove casts when `commonTypes` moved to new AST727 ast::BasicType::Kind kind = (ast::BasicType::Kind)(int)commonTypes[ (BasicType::Kind)(int)basic->kind ][ (BasicType::Kind)(int)ast::BasicType::SignedInt ];728 /*729 if ( // xxx - what does qualifier even do here??730 ( ( basic->qualifiers >= type2->qualifiers )731 || widen.first )732 && ( ( /* kind != basic->kind && basic->qualifiers <= type2->qualifiers )733 || widen.second )734 )735 */736 712 if (widen.second) { 737 713 result = new ast::BasicType{ basic->kind, basic->qualifiers | type2->qualifiers }; 738 714 } 739 715 } else if ( const ast::EnumInstType * enumInst = dynamic_cast< const ast::EnumInstType * >( type2 ) ) { 740 #warning remove casts when `commonTypes` moved to new AST741 716 const ast::EnumDecl* enumDecl = enumInst->base; 742 717 if ( enumDecl->base ) { 743 718 result = enumDecl->base.get(); 744 719 } else { 720 #warning remove casts when `commonTypes` moved to new AST 745 721 ast::BasicType::Kind kind = (ast::BasicType::Kind)(int)commonTypes[ (BasicType::Kind)(int)basic->kind ][ (BasicType::Kind)(int)ast::BasicType::SignedInt ]; 746 722 if ( … … 763 739 auto entry = open.find( *var ); 764 740 if ( entry != open.end() ) { 765 // if (tenv.lookup(*var)) {766 741 ast::AssertionSet need, have; 767 742 if ( ! tenv.bindVar( -
TabularUnified src/ResolvExpr/Unify.cc ¶
rc8bf1b5 r8f31be6 1298 1298 auto var1 = dynamic_cast< const ast::TypeInstType * >( type1 ); 1299 1299 auto var2 = dynamic_cast< const ast::TypeInstType * >( type2 ); 1300 ast::OpenVarSet::const_iterator1301 entry1 = var1 ? open.find( *var1 ) : open.end(),1302 entry2 = var2 ? open.find( *var2 ) : open.end();1303 // bool isopen1 = entry1 != open.end();1304 // bool isopen2 = entry2 != open.end();1305 1300 bool isopen1 = var1 && env.lookup(*var1); 1306 1301 bool isopen2 = var2 && env.lookup(*var2); 1307 1302 1308 /*1309 if ( isopen1 && isopen2 ) {1310 if ( entry1->second.kind != entry2->second.kind ) return false;1311 return env.bindVarToVar(1312 var1, var2, ast::TypeData{ entry1->second, entry2->second }, need, have,1313 open, widen );1314 } else if ( isopen1 ) {1315 return env.bindVar( var1, type2, entry1->second, need, have, open, widen );1316 } else if ( isopen2 ) {1317 return env.bindVar( var2, type1, entry2->second, need, have, open, widen, symtab );1318 } */1319 1303 if ( isopen1 && isopen2 ) { 1320 1304 if ( var1->base->kind != var2->base->kind ) return false; … … 1326 1310 } else if ( isopen2 ) { 1327 1311 return env.bindVar( var2, type1, ast::TypeData{var2->base}, need, have, open, widen ); 1328 } else {1312 } else { 1329 1313 return ast::Pass<Unify_new>::read( 1330 1314 type1, type2, env, need, have, open, widen ); 1331 1315 } 1332 1333 1316 } 1334 1317
Note: See TracChangeset
for help on using the changeset viewer.