Ignore:
Timestamp:
Dec 16, 2020, 4:01:57 PM (3 years ago)
Author:
Colby Alexander Parsons <caparsons@…>
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.
Message:

Merge branch 'master' of plg.uwaterloo.ca:software/cfa/cfa-cc

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/ResolvExpr/Resolver.cc

    rb3c8496 r53449a4  
    968968        namespace {
    969969                /// 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> {
    971971                        const ast::DeletedExpr * result = nullptr;
    972972
     
    976976                        }
    977977
    978                         void previsit( const ast::Expr * ) {
     978                        void previsit( const ast::Expr * expr ) {
    979979                                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                                }
    980985                        }
    981986                };
    982987        } // anonymous namespace
    983 
    984988        /// Check if this expression is or includes a deleted expression
    985989        const ast::DeletedExpr * findDeletedExpr( const ast::Expr * expr ) {
     
    13701374                        }
    13711375
    1372                         // handle assertions. (seems deep)
     1376                        // handle assertions
    13731377
    13741378                        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));
    13831389                        }
    13841390
     
    14021408                        mutType->returns = std::move(returnTypes);
    14031409
     1410                        auto renamedType = strict_dynamic_cast<const ast::FunctionType *>(renameTyVars(mutType, RenameMode::GEN_EXPR_ID));
     1411
    14041412                        std::list<ast::ptr<ast::Stmt>> newStmts;
    14051413                        resolveWithExprs (mutDecl->withExprs, newStmts);
     
    14131421                        symtab.leaveScope();
    14141422
     1423                        mutDecl->type = renamedType;
    14151424                        mutDecl->mangleName = Mangle::mangle(mutDecl);
    14161425                        mutDecl->isTypeFixed = true;
Note: See TracChangeset for help on using the changeset viewer.