Changes in / [aea7168:e80ebe5]
- Location:
- src
- Files:
-
- 2 edited
-
GenPoly/Box.cc (modified) (9 diffs)
-
SymTab/Validate.cc (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
src/GenPoly/Box.cc
raea7168 re80ebe5 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...1474 1473 ObjectDecl *functionObj = new ObjectDecl( functionDecl->get_name(), functionDecl->get_storageClass(), functionDecl->get_linkage(), 0, 1475 1474 new PointerType( Type::Qualifiers(), functionDecl->get_type()->clone() ), 0 ); 1476 1475 functionObj->set_mangleName( functionDecl->get_mangleName() ); 1477 functionObj->set_scopeLevel( functionDecl->get_scopeLevel() );1478 1476 return new VariableExpr( functionObj ); 1479 1477 } … … 1494 1492 = ParamEntry( assertOp->get_uniqueId(), assertOp->get_type()->clone(), actualDecl->get_type()->clone(), wrapFunctionDecl( assertOp ) ); 1495 1493 } 1496 1494 1497 1495 Statement * Pass1::mutate( ReturnStmt *returnStmt ) { 1498 1496 if ( retval && returnStmt->get_expr() ) { … … 1556 1554 DeclarationWithType *assertDtor = findOpForType( formalType, dtorOps, scopedDtorOps ); 1557 1555 if ( ! assertDtor ) throw SemanticError( "No destructor found for ", formalType ); 1558 1556 1559 1557 // add inferred parameters for otype operators to assignment expression 1560 1558 // NOTE: Code here assumes that first four assertions are assign op, ctor, copy ctor, dtor, in that order … … 1570 1568 ++actualIt; 1571 1569 addAssertionFor( assignExpr, *actualIt, assertDtor ); 1572 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 ) ); 1573 1574 } 1574 1575 } … … 2180 2181 bool PolyGenericCalculator::findGeneric( Type *ty ) { 2181 2182 ty = replaceTypeInst( ty, env ); 2182 2183 2183 2184 if ( TypeInstType *typeInst = dynamic_cast< TypeInstType* >( ty ) ) { 2184 2185 if ( scopeTyVars.find( typeInst->get_name() ) != scopeTyVars.end() ) { -
src/SymTab/Validate.cc
raea7168 re80ebe5 541 541 if ( StructInstType *aggDecl = dynamic_cast< StructInstType * >( tyDecl->get_base() ) ) { 542 542 return new StructDecl( aggDecl->get_name() ); 543 // return aggDecl->get_baseStruct(); 543 544 } else if ( UnionInstType *aggDecl = dynamic_cast< UnionInstType * >( tyDecl->get_base() ) ) { 544 545 return new UnionDecl( aggDecl->get_name() ); 545 } else if ( EnumInstType *enumDecl = dynamic_cast< EnumInstType * >( tyDecl->get_base() ) ) {546 return new EnumDecl( enumDecl->get_name() );547 546 } else { 548 547 return ret;
Note:
See TracChangeset
for help on using the changeset viewer.