Changeset 9799ec8
- Timestamp:
- Aug 3, 2016, 11:21:47 AM (8 years ago)
- Branches:
- ADT, aaron-thesis, arm-eh, ast-experimental, cleanup-dtors, ctor, deferred_resn, demangler, enum, forall-pointer-decay, jacob/cs343-translation, jenkins-sandbox, master, memory, new-ast, new-ast-unique-expr, new-env, no_list, persistent-indexer, pthread-emulation, qualifiedEnum, resolv-new, with_gc
- Children:
- aea7168
- Parents:
- becba789
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/GenPoly/Box.cc
rbecba789 r9799ec8 619 619 return 0; 620 620 } 621 621 622 622 /// Returns T if the given declaration is a function with parameters (T*, T) for some TypeInstType T, NULL otherwise 623 623 TypeInstType *isTypeInstPtrValFn( DeclarationWithType *decl ) { … … 637 637 return 0; 638 638 } 639 639 640 640 /// Returns T if the given declaration is (*?=?)(T *, T) for some TypeInstType T (return not checked, but maybe should be), NULL otherwise 641 641 TypeInstType *isTypeInstAssignment( DeclarationWithType *decl ) { … … 677 677 return 0; 678 678 } 679 679 680 680 /// Returns T if the given declaration is a function with parameters (T*, T) for some type T, where neither parameter is cv-qualified, 681 681 /// NULL otherwise … … 772 772 copyOps.beginScope(); 773 773 dtorOps.beginScope(); 774 774 775 775 DeclarationWithType *oldRetval = retval; 776 776 bool oldUseRetval = useRetval; … … 1471 1471 VariableExpr *wrapFunctionDecl( DeclarationWithType *functionDecl ) { 1472 1472 // line below cloned from FixFunction.cc 1473 // xxx - functionObj is never added to a list of declarations... 1473 1474 ObjectDecl *functionObj = new ObjectDecl( functionDecl->get_name(), functionDecl->get_storageClass(), functionDecl->get_linkage(), 0, 1474 1475 new PointerType( Type::Qualifiers(), functionDecl->get_type()->clone() ), 0 ); 1475 1476 functionObj->set_mangleName( functionDecl->get_mangleName() ); 1477 functionObj->set_scopeLevel( functionDecl->get_scopeLevel() ); 1476 1478 return new VariableExpr( functionObj ); 1477 1479 } … … 1492 1494 = ParamEntry( assertOp->get_uniqueId(), assertOp->get_type()->clone(), actualDecl->get_type()->clone(), wrapFunctionDecl( assertOp ) ); 1493 1495 } 1494 1496 1495 1497 Statement * Pass1::mutate( ReturnStmt *returnStmt ) { 1496 1498 if ( retval && returnStmt->get_expr() ) { … … 1554 1556 DeclarationWithType *assertDtor = findOpForType( formalType, dtorOps, scopedDtorOps ); 1555 1557 if ( ! assertDtor ) throw SemanticError( "No destructor found for ", formalType ); 1556 1558 1557 1559 // add inferred parameters for otype operators to assignment expression 1558 1560 // NOTE: Code here assumes that first four assertions are assign op, ctor, copy ctor, dtor, in that order … … 1568 1570 ++actualIt; 1569 1571 addAssertionFor( assignExpr, *actualIt, assertDtor ); 1570 1571 //DeclarationWithType *actualDecl = asserts.front(); 1572 //assignExpr->get_inferParams()[ actualDecl->get_uniqueId() ] 1573 // = ParamEntry( assertAssign->get_uniqueId(), assertAssign->get_type()->clone(), actualDecl->get_type()->clone(), wrapFunctionDecl( assertAssign ) ); 1572 1574 1573 } 1575 1574 } … … 2181 2180 bool PolyGenericCalculator::findGeneric( Type *ty ) { 2182 2181 ty = replaceTypeInst( ty, env ); 2183 2182 2184 2183 if ( TypeInstType *typeInst = dynamic_cast< TypeInstType* >( ty ) ) { 2185 2184 if ( scopeTyVars.find( typeInst->get_name() ) != scopeTyVars.end() ) {
Note: See TracChangeset
for help on using the changeset viewer.