Changes in src/InitTweak/InitTweak.cc [d180746:62a05d1]
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/InitTweak/InitTweak.cc
rd180746 r62a05d1 187 187 188 188 UntypedExpr * increment = new UntypedExpr( new NameExpr( "++?" ) ); 189 increment->get_args().push_back( new AddressExpr( index->clone()) );189 increment->get_args().push_back( index->clone() ); 190 190 *out++ = new ExprStmt( noLabels, increment ); 191 191 } … … 397 397 template<typename CallExpr> 398 398 Expression *& callArg( CallExpr * callExpr, unsigned int pos ) { 399 if ( pos >= callExpr->get_args().size() ) assertf( false, " asking for argument that doesn't exist. Return NULL/throw exception?");399 if ( pos >= callExpr->get_args().size() ) assertf( false, "getCallArg for argument that doesn't exist: (%u); %s.", pos, toString( callExpr ).c_str() ); 400 400 for ( Expression *& arg : callExpr->get_args() ) { 401 401 if ( pos == 0 ) return arg; … … 418 418 assertf( ! tuple->get_exprs().empty(), "TupleAssignExpr somehow has empty tuple expr." ); 419 419 return getCallArg( tuple->get_exprs().front(), pos ); 420 } else if ( ImplicitCopyCtorExpr * copyCtor = dynamic_cast< ImplicitCopyCtorExpr * >( callExpr ) ) { 421 return getCallArg( copyCtor->callExpr, pos ); 420 422 } else { 421 423 assertf( false, "Unexpected expression type passed to getCallArg: %s", toString( callExpr ).c_str() ); … … 450 452 } else if ( ApplicationExpr * appExpr = dynamic_cast< ApplicationExpr * >( func ) ) { 451 453 return handleDerefName( appExpr ); 454 } else if ( ConstructorExpr * ctorExpr = dynamic_cast< ConstructorExpr * >( func ) ) { 455 return funcName( getCallArg( ctorExpr->get_callExpr(), 0 ) ); 452 456 } else { 453 assertf( false, "Unexpected expression type being called as a function in call expression ");457 assertf( false, "Unexpected expression type being called as a function in call expression: %s", toString( func ).c_str() ); 454 458 } 455 459 } … … 475 479 } else if ( ArrayType * arrayType = dynamic_cast< ArrayType * >( type ) ) { 476 480 return arrayType->get_base(); 481 } else if ( ReferenceType * refType = dynamic_cast< ReferenceType * >( type ) ) { 482 return refType->get_base(); 477 483 } else { 478 484 return NULL; … … 560 566 if ( ftype->get_parameters().size() != 2 ) return 0; 561 567 562 Type * t1 = ftype->get_parameters().front()->get_type();568 Type * t1 = getPointerBase( ftype->get_parameters().front()->get_type() ); 563 569 Type * t2 = ftype->get_parameters().back()->get_type(); 564 PointerType * ptrType = dynamic_cast< PointerType * > ( t1 ); 565 assert( ptrType ); 566 567 if ( ResolvExpr::typesCompatibleIgnoreQualifiers( ptrType->get_base(), t2, SymTab::Indexer() ) ) { 570 assert( t1 ); 571 572 if ( ResolvExpr::typesCompatibleIgnoreQualifiers( t1, t2, SymTab::Indexer() ) ) { 568 573 return function; 569 574 } else {
Note: See TracChangeset
for help on using the changeset viewer.