Changeset 53449a4 for src/ResolvExpr/Resolver.cc
- Timestamp:
- Dec 16, 2020, 4:01:57 PM (3 years ago)
- Branches:
- ADT, arm-eh, ast-experimental, enum, forall-pointer-decay, jacob/cs343-translation, master, new-ast-unique-expr, pthread-emulation, qualifiedEnum
- Children:
- 8ba363e, c8025a21
- Parents:
- b3c8496 (diff), 3e5dd913 (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. - File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/ResolvExpr/Resolver.cc
rb3c8496 r53449a4 968 968 namespace { 969 969 /// Finds deleted expressions in an expression tree 970 struct DeleteFinder_new final : public ast::WithShortCircuiting {970 struct DeleteFinder_new final : public ast::WithShortCircuiting, public ast::WithVisitorRef<DeleteFinder_new> { 971 971 const ast::DeletedExpr * result = nullptr; 972 972 … … 976 976 } 977 977 978 void previsit( const ast::Expr * ) {978 void previsit( const ast::Expr * expr ) { 979 979 if ( result ) { visit_children = false; } 980 if (expr->inferred.hasParams()) { 981 for (auto & imp : expr->inferred.inferParams() ) { 982 imp.second.expr->accept(*visitor); 983 } 984 } 980 985 } 981 986 }; 982 987 } // anonymous namespace 983 984 988 /// Check if this expression is or includes a deleted expression 985 989 const ast::DeletedExpr * findDeletedExpr( const ast::Expr * expr ) { … … 1370 1374 } 1371 1375 1372 // handle assertions . (seems deep)1376 // handle assertions 1373 1377 1374 1378 symtab.enterScope(); 1375 for (auto & typeParam : mutType->forall) { 1376 auto mutParam = typeParam.get_and_mutate(); 1377 symtab.addType(mutParam); 1378 for (auto & asst : mutParam->assertions) { 1379 asst = fixObjectType(asst.strict_as<ast::ObjectDecl>(), symtab); 1380 symtab.addId(asst); 1381 } 1382 typeParam = mutParam; 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)); 1383 1389 } 1384 1390 … … 1402 1408 mutType->returns = std::move(returnTypes); 1403 1409 1410 auto renamedType = strict_dynamic_cast<const ast::FunctionType *>(renameTyVars(mutType, RenameMode::GEN_EXPR_ID)); 1411 1404 1412 std::list<ast::ptr<ast::Stmt>> newStmts; 1405 1413 resolveWithExprs (mutDecl->withExprs, newStmts); … … 1413 1421 symtab.leaveScope(); 1414 1422 1423 mutDecl->type = renamedType; 1415 1424 mutDecl->mangleName = Mangle::mangle(mutDecl); 1416 1425 mutDecl->isTypeFixed = true;
Note: See TracChangeset
for help on using the changeset viewer.