Changeset ae7014e for src/GenPoly
- Timestamp:
- Apr 6, 2016, 3:09:26 PM (9 years ago)
- Branches:
- ADT, aaron-thesis, arm-eh, ast-experimental, cleanup-dtors, ctor, deferred_resn, demangler, enum, forall-pointer-decay, gc_noraii, jacob/cs343-translation, jenkins-sandbox, master, memory, new-ast, new-ast-unique-expr, new-env, no_list, persistent-indexer, pthread-emulation, qualifiedEnum, resolv-new, string, with_gc
- Children:
- 2a76297
- Parents:
- d75038c
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/GenPoly/Box.cc
rd75038c rae7014e 1401 1401 std::list< TypeDecl* >::const_iterator forallIt = forallParams.begin(); 1402 1402 for ( ; tyIt != tyParams.end() && forallIt != forallParams.end(); ++tyIt, ++forallIt ) { 1403 if ( (*forallIt)->get_kind() != TypeDecl::Any ) continue; // skip types with no assign op (ftype/dtype) 1404 1405 std::list< DeclarationWithType* > &asserts = (*forallIt)->get_assertions(); 1406 assert( ! asserts.empty() && "Type param needs assignment operator assertion" ); 1407 DeclarationWithType *actualDecl = asserts.front(); 1408 TypeInstType *actualType = isTypeInstAssignment( actualDecl ); 1409 assert( actualType && "First assertion of type with assertions should be assignment operator" ); 1403 // Add appropriate mapping to assignment expression environment 1410 1404 TypeExpr *formalTypeExpr = dynamic_cast< TypeExpr* >( *tyIt ); 1411 1405 assert( formalTypeExpr && "type parameters must be type expressions" ); 1412 1406 Type *formalType = formalTypeExpr->get_type(); 1413 assignExpr->get_env()->add( actualType->get_name(), formalType ); 1414 1407 assignExpr->get_env()->add( (*forallIt)->get_name(), formalType ); 1408 1409 // skip types with no assign op (ftype/dtype) 1410 if ( (*forallIt)->get_kind() != TypeDecl::Any ) continue; 1411 1412 // find assignment operator for formal type 1415 1413 DeclarationWithType *assertAssign = 0; 1416 1414 if ( TypeInstType *formalTypeInstType = dynamic_cast< TypeInstType* >( formalType ) ) { … … 1426 1424 } 1427 1425 } 1428 1429 1426 1427 // add inferred parameter for field assignment operator to assignment expression 1428 std::list< DeclarationWithType* > &asserts = (*forallIt)->get_assertions(); 1429 assert( ! asserts.empty() && "Type param needs assignment operator assertion" ); 1430 DeclarationWithType *actualDecl = asserts.front(); 1430 1431 assignExpr->get_inferParams()[ actualDecl->get_uniqueId() ] 1431 1432 = ParamEntry( assertAssign->get_uniqueId(), assertAssign->get_type()->clone(), actualDecl->get_type()->clone(), wrapFunctionDecl( assertAssign ) );
Note: See TracChangeset
for help on using the changeset viewer.