Changes in src/ResolvExpr/Resolver.cc [b107885:2dda05d]
- File:
-
- 1 edited
-
src/ResolvExpr/Resolver.cc (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
-
src/ResolvExpr/Resolver.cc
rb107885 r2dda05d 986 986 }; 987 987 } // anonymous namespace 988 988 989 /// Check if this expression is or includes a deleted expression 989 990 const ast::DeletedExpr * findDeletedExpr( const ast::Expr * expr ) { … … 1374 1375 } 1375 1376 1376 // handle assertions 1377 // handle assertions. (seems deep) 1377 1378 1378 1379 symtab.enterScope(); 1379 mutType->forall.clear(); 1380 mutType->assertions.clear(); 1381 for (auto & typeParam : mutDecl->type_params) { 1382 symtab.addType(typeParam); 1383 mutType->forall.emplace_back(new ast::TypeInstType(typeParam->name, typeParam)); 1384 } 1385 for (auto & asst : mutDecl->assertions) { 1386 asst = fixObjectType(asst.strict_as<ast::ObjectDecl>(), symtab); 1387 symtab.addId(asst); 1388 mutType->assertions.emplace_back(new ast::VariableExpr(functionDecl->location, asst)); 1380 for (auto & typeParam : mutType->forall) { 1381 auto mutParam = typeParam.get_and_mutate(); 1382 symtab.addType(mutParam); 1383 for (auto & asst : mutParam->assertions) { 1384 asst = fixObjectType(asst.strict_as<ast::ObjectDecl>(), symtab); 1385 symtab.addId(asst); 1386 } 1387 typeParam = mutParam; 1389 1388 } 1390 1389 … … 1408 1407 mutType->returns = std::move(returnTypes); 1409 1408 1410 auto renamedType = strict_dynamic_cast<const ast::FunctionType *>(renameTyVars(mutType, RenameMode::GEN_EXPR_ID));1411 1412 1409 std::list<ast::ptr<ast::Stmt>> newStmts; 1413 1410 resolveWithExprs (mutDecl->withExprs, newStmts); … … 1421 1418 symtab.leaveScope(); 1422 1419 1423 mutDecl->type = renamedType;1424 1420 mutDecl->mangleName = Mangle::mangle(mutDecl); 1425 1421 mutDecl->isTypeFixed = true; … … 1538 1534 const PtrType * handlePtrType( const PtrType * type, const ast::SymbolTable & symtab ) { 1539 1535 if ( type->dimension ) { 1540 ast::ptr< ast::Type > sizeType = ast::sizeType; 1536 #warning should use new equivalent to Validate::SizeType rather than sizeType here 1537 ast::ptr< ast::Type > sizeType = new ast::BasicType{ ast::BasicType::LongUnsignedInt }; 1541 1538 ast::mutate_field( 1542 1539 type, &PtrType::dimension,
Note:
See TracChangeset
for help on using the changeset viewer.