Ignore:
Timestamp:
Dec 17, 2020, 4:18:23 PM (3 years ago)
Author:
Thierry Delisle <tdelisle@…>
Branches:
ADT, arm-eh, ast-experimental, enum, forall-pointer-decay, jacob/cs343-translation, master, new-ast-unique-expr, pthread-emulation, qualifiedEnum
Children:
089b1a9, f4f79dd
Parents:
c5a98f3 (diff), 68a867ee (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

    rc5a98f3 r41cde266  
    986986                };
    987987        } // anonymous namespace
    988 
    989988        /// Check if this expression is or includes a deleted expression
    990989        const ast::DeletedExpr * findDeletedExpr( const ast::Expr * expr ) {
     
    13751374                        }
    13761375
    1377                         // handle assertions. (seems deep)
     1376                        // handle assertions
    13781377
    13791378                        symtab.enterScope();
    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;
     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));
    13881389                        }
    13891390
     
    14071408                        mutType->returns = std::move(returnTypes);
    14081409
     1410                        auto renamedType = strict_dynamic_cast<const ast::FunctionType *>(renameTyVars(mutType, RenameMode::GEN_EXPR_ID));
     1411
    14091412                        std::list<ast::ptr<ast::Stmt>> newStmts;
    14101413                        resolveWithExprs (mutDecl->withExprs, newStmts);
     
    14181421                        symtab.leaveScope();
    14191422
     1423                        mutDecl->type = renamedType;
    14201424                        mutDecl->mangleName = Mangle::mangle(mutDecl);
    14211425                        mutDecl->isTypeFixed = true;
     
    15341538        const PtrType * handlePtrType( const PtrType * type, const ast::SymbolTable & symtab ) {
    15351539                if ( type->dimension ) {
    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 };
     1540                        ast::ptr< ast::Type > sizeType = ast::sizeType;
    15381541                        ast::mutate_field(
    15391542                                type, &PtrType::dimension,
Note: See TracChangeset for help on using the changeset viewer.