Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/InitTweak/InitTweak.cc

    r207c7e1d r907eccb  
    327327                        } else if ( ApplicationExpr * appExpr = dynamic_cast< ApplicationExpr * > ( expr ) ) {
    328328                                return handleDerefCalledFunction( appExpr );
    329                         } else if ( AddressExpr * addrExpr = dynamic_cast< AddressExpr * >( expr ) ) {
    330                                 return getCalledFunction( addrExpr->get_arg() );
    331329                        }
    332330                        return nullptr;
     
    338336                if ( ! appExpr ) return NULL;
    339337                DeclarationWithType * function = getCalledFunction( appExpr->get_function() );
    340                 assertf( function, "getCalledFunction returned nullptr: %s", toString( appExpr->get_function() ).c_str() );
     338                assert( function );
    341339                // check for Intrinsic only - don't want to remove all overridable ctor/dtors because autogenerated ctor/dtor
    342340                // will call all member dtors, and some members may have a user defined dtor.
     
    388386                } else if ( UntypedExpr * untypedExpr = dynamic_cast< UntypedExpr * >( callExpr ) ) {
    389387                        return callArg( untypedExpr, pos );
    390                 } else if ( TupleAssignExpr * tupleExpr = dynamic_cast< TupleAssignExpr * > ( callExpr ) ) {
    391                         std::list< Statement * > & stmts = tupleExpr->get_stmtExpr()->get_statements()->get_kids();
    392                         assertf( ! stmts.empty(), "TupleAssignExpr somehow has no statements." );
    393                         ExprStmt * stmt = safe_dynamic_cast< ExprStmt * >( stmts.back() );
    394                         TupleExpr * tuple = safe_dynamic_cast< TupleExpr * >( stmt->get_expr() );
    395                         assertf( ! tuple->get_exprs().empty(), "TupleAssignExpr somehow has empty tuple expr." );
    396                         return getCallArg( tuple->get_exprs().front(), pos );
    397388                } else {
    398                         assertf( false, "Unexpected expression type passed to getCallArg: %s", toString( callExpr ).c_str() );
     389                        assertf( false, "Unexpected expression type passed to getCallArg" );
    399390                }
    400391        }
     
    547538        }
    548539
    549         FunctionDecl * isAssignment( Declaration * decl ) {
    550                 return isCopyFunction( decl, "?=?" );
    551         }
    552         FunctionDecl * isDestructor( Declaration * decl ) {
    553                 if ( isDestructor( decl->get_name() ) ) {
    554                         return dynamic_cast< FunctionDecl * >( decl );
    555                 }
    556                 return nullptr;
    557         }
    558         FunctionDecl * isDefaultConstructor( Declaration * decl ) {
    559                 if ( isConstructor( decl->get_name() ) ) {
    560                         if ( FunctionDecl * func = dynamic_cast< FunctionDecl * >( decl ) ) {
    561                                 if ( func->get_functionType()->get_parameters().size() == 1 ) {
    562                                         return func;
    563                                 }
    564                         }
    565                 }
    566                 return nullptr;
    567         }
    568540        FunctionDecl * isCopyConstructor( Declaration * decl ) {
    569541                return isCopyFunction( decl, "?{}" );
Note: See TracChangeset for help on using the changeset viewer.