Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/SynTree/Mutator.cc

    r906e24d rb6fe7e6  
    178178
    179179Expression *Mutator::mutate( ApplicationExpr *applicationExpr ) {
    180         applicationExpr->set_result( maybeMutate( applicationExpr->get_result(), *this ) );
     180        mutateAll( applicationExpr->get_results(), *this );
    181181        applicationExpr->set_function( maybeMutate( applicationExpr->get_function(), *this ) );
    182182        mutateAll( applicationExpr->get_args(), *this );
     
    185185
    186186Expression *Mutator::mutate( UntypedExpr *untypedExpr ) {
    187         untypedExpr->set_result( maybeMutate( untypedExpr->get_result(), *this ) );
     187        mutateAll( untypedExpr->get_results(), *this );
    188188        mutateAll( untypedExpr->get_args(), *this );
    189189        return untypedExpr;
     
    191191
    192192Expression *Mutator::mutate( NameExpr *nameExpr ) {
    193         nameExpr->set_result( maybeMutate( nameExpr->get_result(), *this ) );
     193        mutateAll( nameExpr->get_results(), *this );
    194194        return nameExpr;
    195195}
    196196
    197197Expression *Mutator::mutate( AddressExpr *addressExpr ) {
    198         addressExpr->set_result( maybeMutate( addressExpr->get_result(), *this ) );
     198        mutateAll( addressExpr->get_results(), *this );
    199199        addressExpr->set_arg( maybeMutate( addressExpr->get_arg(), *this ) );
    200200        return addressExpr;
     
    202202
    203203Expression *Mutator::mutate( LabelAddressExpr *labelAddressExpr ) {
    204         labelAddressExpr->set_result( maybeMutate( labelAddressExpr->get_result(), *this ) );
     204        mutateAll( labelAddressExpr->get_results(), *this );
    205205        labelAddressExpr->set_arg( maybeMutate( labelAddressExpr->get_arg(), *this ) );
    206206        return labelAddressExpr;
     
    208208
    209209Expression *Mutator::mutate( CastExpr *castExpr ) {
    210         castExpr->set_result( maybeMutate( castExpr->get_result(), *this ) );
     210        mutateAll( castExpr->get_results(), *this );
    211211        castExpr->set_arg( maybeMutate( castExpr->get_arg(), *this ) );
    212212        return castExpr;
     
    214214
    215215Expression *Mutator::mutate( UntypedMemberExpr *memberExpr ) {
    216         memberExpr->set_result( maybeMutate( memberExpr->get_result(), *this ) );
     216        mutateAll( memberExpr->get_results(), *this );
    217217        memberExpr->set_aggregate( maybeMutate( memberExpr->get_aggregate(), *this ) );
    218218        return memberExpr;
     
    220220
    221221Expression *Mutator::mutate( MemberExpr *memberExpr ) {
    222         memberExpr->set_result( maybeMutate( memberExpr->get_result(), *this ) );
     222        mutateAll( memberExpr->get_results(), *this );
    223223        memberExpr->set_aggregate( maybeMutate( memberExpr->get_aggregate(), *this ) );
    224224        return memberExpr;
     
    226226
    227227Expression *Mutator::mutate( VariableExpr *variableExpr ) {
    228         variableExpr->set_result( maybeMutate( variableExpr->get_result(), *this ) );
     228        mutateAll( variableExpr->get_results(), *this );
    229229        return variableExpr;
    230230}
    231231
    232232Expression *Mutator::mutate( ConstantExpr *constantExpr ) {
    233         constantExpr->set_result( maybeMutate( constantExpr->get_result(), *this ) );
     233        mutateAll( constantExpr->get_results(), *this );
    234234//  maybeMutate( constantExpr->get_constant(), *this )
    235235        return constantExpr;
     
    237237
    238238Expression *Mutator::mutate( SizeofExpr *sizeofExpr ) {
    239         sizeofExpr->set_result( maybeMutate( sizeofExpr->get_result(), *this ) );
     239        mutateAll( sizeofExpr->get_results(), *this );
    240240        if ( sizeofExpr->get_isType() ) {
    241241                sizeofExpr->set_type( maybeMutate( sizeofExpr->get_type(), *this ) );
     
    247247
    248248Expression *Mutator::mutate( AlignofExpr *alignofExpr ) {
    249         alignofExpr->set_result( maybeMutate( alignofExpr->get_result(), *this ) );
     249        mutateAll( alignofExpr->get_results(), *this );
    250250        if ( alignofExpr->get_isType() ) {
    251251                alignofExpr->set_type( maybeMutate( alignofExpr->get_type(), *this ) );
     
    257257
    258258Expression *Mutator::mutate( UntypedOffsetofExpr *offsetofExpr ) {
    259         offsetofExpr->set_result( maybeMutate( offsetofExpr->get_result(), *this ) );
     259        mutateAll( offsetofExpr->get_results(), *this );
    260260        offsetofExpr->set_type( maybeMutate( offsetofExpr->get_type(), *this ) );
    261261        return offsetofExpr;
     
    263263
    264264Expression *Mutator::mutate( OffsetofExpr *offsetofExpr ) {
    265         offsetofExpr->set_result( maybeMutate( offsetofExpr->get_result(), *this ) );
     265        mutateAll( offsetofExpr->get_results(), *this );
    266266        offsetofExpr->set_type( maybeMutate( offsetofExpr->get_type(), *this ) );
    267267        offsetofExpr->set_member( maybeMutate( offsetofExpr->get_member(), *this ) );
     
    270270
    271271Expression *Mutator::mutate( OffsetPackExpr *offsetPackExpr ) {
    272         offsetPackExpr->set_result( maybeMutate( offsetPackExpr->get_result(), *this ) );
     272        mutateAll( offsetPackExpr->get_results(), *this );
    273273        offsetPackExpr->set_type( maybeMutate( offsetPackExpr->get_type(), *this ) );
    274274        return offsetPackExpr;
     
    276276
    277277Expression *Mutator::mutate( AttrExpr *attrExpr ) {
    278         attrExpr->set_result( maybeMutate( attrExpr->get_result(), *this ) );
     278        mutateAll( attrExpr->get_results(), *this );
    279279        if ( attrExpr->get_isType() ) {
    280280                attrExpr->set_type( maybeMutate( attrExpr->get_type(), *this ) );
     
    286286
    287287Expression *Mutator::mutate( LogicalExpr *logicalExpr ) {
    288         logicalExpr->set_result( maybeMutate( logicalExpr->get_result(), *this ) );
     288        mutateAll( logicalExpr->get_results(), *this );
    289289        logicalExpr->set_arg1( maybeMutate( logicalExpr->get_arg1(), *this ) );
    290290        logicalExpr->set_arg2( maybeMutate( logicalExpr->get_arg2(), *this ) );
     
    293293
    294294Expression *Mutator::mutate( ConditionalExpr *conditionalExpr ) {
    295         conditionalExpr->set_result( maybeMutate( conditionalExpr->get_result(), *this ) );
     295        mutateAll( conditionalExpr->get_results(), *this );
    296296        conditionalExpr->set_arg1( maybeMutate( conditionalExpr->get_arg1(), *this ) );
    297297        conditionalExpr->set_arg2( maybeMutate( conditionalExpr->get_arg2(), *this ) );
     
    301301
    302302Expression *Mutator::mutate( CommaExpr *commaExpr ) {
    303         commaExpr->set_result( maybeMutate( commaExpr->get_result(), *this ) );
     303        mutateAll( commaExpr->get_results(), *this );
    304304        commaExpr->set_arg1( maybeMutate( commaExpr->get_arg1(), *this ) );
    305305        commaExpr->set_arg2( maybeMutate( commaExpr->get_arg2(), *this ) );
     
    308308
    309309Expression *Mutator::mutate( TupleExpr *tupleExpr ) {
    310         tupleExpr->set_result( maybeMutate( tupleExpr->get_result(), *this ) );
     310        mutateAll( tupleExpr->get_results(), *this );
    311311        mutateAll( tupleExpr->get_exprs(), *this );
    312312        return tupleExpr;
     
    314314
    315315Expression *Mutator::mutate( SolvedTupleExpr *tupleExpr ) {
    316         tupleExpr->set_result( maybeMutate( tupleExpr->get_result(), *this ) );
     316        mutateAll( tupleExpr->get_results(), *this );
    317317        mutateAll( tupleExpr->get_exprs(), *this );
    318318        return tupleExpr;
     
    320320
    321321Expression *Mutator::mutate( TypeExpr *typeExpr ) {
    322         typeExpr->set_result( maybeMutate( typeExpr->get_result(), *this ) );
     322        mutateAll( typeExpr->get_results(), *this );
    323323        typeExpr->set_type( maybeMutate( typeExpr->get_type(), *this ) );
    324324        return typeExpr;
     
    340340
    341341Expression* Mutator::mutate( ConstructorExpr *ctorExpr ) {
    342         ctorExpr->set_result( maybeMutate( ctorExpr->get_result(), *this ) );
     342        mutateAll( ctorExpr->get_results(), *this );
    343343        ctorExpr->set_callExpr( maybeMutate( ctorExpr->get_callExpr(), *this ) );
    344344        return ctorExpr;
     
    346346
    347347Expression *Mutator::mutate( CompoundLiteralExpr *compLitExpr ) {
    348         compLitExpr->set_result( maybeMutate( compLitExpr->get_result(), *this ) );
     348        mutateAll( compLitExpr->get_results(), *this );
    349349        compLitExpr->set_type( maybeMutate( compLitExpr->get_type(), *this ) );
    350350        compLitExpr->set_initializer( maybeMutate( compLitExpr->get_initializer(), *this ) );
     
    353353
    354354Expression *Mutator::mutate( UntypedValofExpr *valofExpr ) {
    355         valofExpr->set_result( maybeMutate( valofExpr->get_result(), *this ) );
     355        mutateAll( valofExpr->get_results(), *this );
    356356        return valofExpr;
    357357}
Note: See TracChangeset for help on using the changeset viewer.