Changeset 41cde266 for src/ResolvExpr/Resolver.cc
- Timestamp:
- Dec 17, 2020, 4:18:23 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:
- 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. - File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/ResolvExpr/Resolver.cc
rc5a98f3 r41cde266 986 986 }; 987 987 } // anonymous namespace 988 989 988 /// Check if this expression is or includes a deleted expression 990 989 const ast::DeletedExpr * findDeletedExpr( const ast::Expr * expr ) { … … 1375 1374 } 1376 1375 1377 // handle assertions . (seems deep)1376 // handle assertions 1378 1377 1379 1378 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)); 1388 1389 } 1389 1390 … … 1407 1408 mutType->returns = std::move(returnTypes); 1408 1409 1410 auto renamedType = strict_dynamic_cast<const ast::FunctionType *>(renameTyVars(mutType, RenameMode::GEN_EXPR_ID)); 1411 1409 1412 std::list<ast::ptr<ast::Stmt>> newStmts; 1410 1413 resolveWithExprs (mutDecl->withExprs, newStmts); … … 1418 1421 symtab.leaveScope(); 1419 1422 1423 mutDecl->type = renamedType; 1420 1424 mutDecl->mangleName = Mangle::mangle(mutDecl); 1421 1425 mutDecl->isTypeFixed = true; … … 1534 1538 const PtrType * handlePtrType( const PtrType * type, const ast::SymbolTable & symtab ) { 1535 1539 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; 1538 1541 ast::mutate_field( 1539 1542 type, &PtrType::dimension,
Note: See TracChangeset
for help on using the changeset viewer.