Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/SynTree/Mutator.cc

    r907eccb rd5556a3  
    2323#include "Constant.h"
    2424#include "Common/utility.h"
    25 #include "TypeSubstitution.h"
    2625
    2726Mutator::Mutator() {}
     
    179178
    180179Expression *Mutator::mutate( ApplicationExpr *applicationExpr ) {
    181         applicationExpr->set_env( maybeMutate( applicationExpr->get_env(), *this ) );
    182180        applicationExpr->set_result( maybeMutate( applicationExpr->get_result(), *this ) );
    183181        applicationExpr->set_function( maybeMutate( applicationExpr->get_function(), *this ) );
     
    187185
    188186Expression *Mutator::mutate( UntypedExpr *untypedExpr ) {
    189         untypedExpr->set_env( maybeMutate( untypedExpr->get_env(), *this ) );
    190187        untypedExpr->set_result( maybeMutate( untypedExpr->get_result(), *this ) );
    191188        mutateAll( untypedExpr->get_args(), *this );
     
    194191
    195192Expression *Mutator::mutate( NameExpr *nameExpr ) {
    196         nameExpr->set_env( maybeMutate( nameExpr->get_env(), *this ) );
    197193        nameExpr->set_result( maybeMutate( nameExpr->get_result(), *this ) );
    198194        return nameExpr;
     
    200196
    201197Expression *Mutator::mutate( AddressExpr *addressExpr ) {
    202         addressExpr->set_env( maybeMutate( addressExpr->get_env(), *this ) );
    203198        addressExpr->set_result( maybeMutate( addressExpr->get_result(), *this ) );
    204199        addressExpr->set_arg( maybeMutate( addressExpr->get_arg(), *this ) );
     
    207202
    208203Expression *Mutator::mutate( LabelAddressExpr *labelAddressExpr ) {
    209         labelAddressExpr->set_env( maybeMutate( labelAddressExpr->get_env(), *this ) );
    210204        labelAddressExpr->set_result( maybeMutate( labelAddressExpr->get_result(), *this ) );
    211205        labelAddressExpr->set_arg( maybeMutate( labelAddressExpr->get_arg(), *this ) );
     
    214208
    215209Expression *Mutator::mutate( CastExpr *castExpr ) {
    216         castExpr->set_env( maybeMutate( castExpr->get_env(), *this ) );
    217210        castExpr->set_result( maybeMutate( castExpr->get_result(), *this ) );
    218211        castExpr->set_arg( maybeMutate( castExpr->get_arg(), *this ) );
     
    221214
    222215Expression *Mutator::mutate( UntypedMemberExpr *memberExpr ) {
    223         memberExpr->set_env( maybeMutate( memberExpr->get_env(), *this ) );
    224216        memberExpr->set_result( maybeMutate( memberExpr->get_result(), *this ) );
    225217        memberExpr->set_aggregate( maybeMutate( memberExpr->get_aggregate(), *this ) );
     
    229221
    230222Expression *Mutator::mutate( MemberExpr *memberExpr ) {
    231         memberExpr->set_env( maybeMutate( memberExpr->get_env(), *this ) );
    232223        memberExpr->set_result( maybeMutate( memberExpr->get_result(), *this ) );
    233224        memberExpr->set_aggregate( maybeMutate( memberExpr->get_aggregate(), *this ) );
     
    236227
    237228Expression *Mutator::mutate( VariableExpr *variableExpr ) {
    238         variableExpr->set_env( maybeMutate( variableExpr->get_env(), *this ) );
    239229        variableExpr->set_result( maybeMutate( variableExpr->get_result(), *this ) );
    240230        return variableExpr;
     
    242232
    243233Expression *Mutator::mutate( ConstantExpr *constantExpr ) {
    244         constantExpr->set_env( maybeMutate( constantExpr->get_env(), *this ) );
    245234        constantExpr->set_result( maybeMutate( constantExpr->get_result(), *this ) );
    246235//  maybeMutate( constantExpr->get_constant(), *this )
     
    249238
    250239Expression *Mutator::mutate( SizeofExpr *sizeofExpr ) {
    251         sizeofExpr->set_env( maybeMutate( sizeofExpr->get_env(), *this ) );
    252240        sizeofExpr->set_result( maybeMutate( sizeofExpr->get_result(), *this ) );
    253241        if ( sizeofExpr->get_isType() ) {
     
    260248
    261249Expression *Mutator::mutate( AlignofExpr *alignofExpr ) {
    262         alignofExpr->set_env( maybeMutate( alignofExpr->get_env(), *this ) );
    263250        alignofExpr->set_result( maybeMutate( alignofExpr->get_result(), *this ) );
    264251        if ( alignofExpr->get_isType() ) {
     
    271258
    272259Expression *Mutator::mutate( UntypedOffsetofExpr *offsetofExpr ) {
    273         offsetofExpr->set_env( maybeMutate( offsetofExpr->get_env(), *this ) );
    274260        offsetofExpr->set_result( maybeMutate( offsetofExpr->get_result(), *this ) );
    275261        offsetofExpr->set_type( maybeMutate( offsetofExpr->get_type(), *this ) );
     
    278264
    279265Expression *Mutator::mutate( OffsetofExpr *offsetofExpr ) {
    280         offsetofExpr->set_env( maybeMutate( offsetofExpr->get_env(), *this ) );
    281266        offsetofExpr->set_result( maybeMutate( offsetofExpr->get_result(), *this ) );
    282267        offsetofExpr->set_type( maybeMutate( offsetofExpr->get_type(), *this ) );
     
    286271
    287272Expression *Mutator::mutate( OffsetPackExpr *offsetPackExpr ) {
    288         offsetPackExpr->set_env( maybeMutate( offsetPackExpr->get_env(), *this ) );
    289273        offsetPackExpr->set_result( maybeMutate( offsetPackExpr->get_result(), *this ) );
    290274        offsetPackExpr->set_type( maybeMutate( offsetPackExpr->get_type(), *this ) );
     
    293277
    294278Expression *Mutator::mutate( AttrExpr *attrExpr ) {
    295         attrExpr->set_env( maybeMutate( attrExpr->get_env(), *this ) );
    296279        attrExpr->set_result( maybeMutate( attrExpr->get_result(), *this ) );
    297280        if ( attrExpr->get_isType() ) {
     
    304287
    305288Expression *Mutator::mutate( LogicalExpr *logicalExpr ) {
    306         logicalExpr->set_env( maybeMutate( logicalExpr->get_env(), *this ) );
    307289        logicalExpr->set_result( maybeMutate( logicalExpr->get_result(), *this ) );
    308290        logicalExpr->set_arg1( maybeMutate( logicalExpr->get_arg1(), *this ) );
     
    312294
    313295Expression *Mutator::mutate( ConditionalExpr *conditionalExpr ) {
    314         conditionalExpr->set_env( maybeMutate( conditionalExpr->get_env(), *this ) );
    315296        conditionalExpr->set_result( maybeMutate( conditionalExpr->get_result(), *this ) );
    316297        conditionalExpr->set_arg1( maybeMutate( conditionalExpr->get_arg1(), *this ) );
     
    321302
    322303Expression *Mutator::mutate( CommaExpr *commaExpr ) {
    323         commaExpr->set_env( maybeMutate( commaExpr->get_env(), *this ) );
    324304        commaExpr->set_result( maybeMutate( commaExpr->get_result(), *this ) );
    325305        commaExpr->set_arg1( maybeMutate( commaExpr->get_arg1(), *this ) );
     
    329309
    330310Expression *Mutator::mutate( TypeExpr *typeExpr ) {
    331         typeExpr->set_env( maybeMutate( typeExpr->get_env(), *this ) );
    332311        typeExpr->set_result( maybeMutate( typeExpr->get_result(), *this ) );
    333312        typeExpr->set_type( maybeMutate( typeExpr->get_type(), *this ) );
     
    336315
    337316Expression *Mutator::mutate( AsmExpr *asmExpr ) {
    338         asmExpr->set_env( maybeMutate( asmExpr->get_env(), *this ) );
    339317        asmExpr->set_inout( maybeMutate( asmExpr->get_inout(), *this ) );
    340318        asmExpr->set_constraint( maybeMutate( asmExpr->get_constraint(), *this ) );
     
    344322
    345323Expression* Mutator::mutate( ImplicitCopyCtorExpr *impCpCtorExpr ) {
    346         impCpCtorExpr->set_env( maybeMutate( impCpCtorExpr->get_env(), *this ) );
    347         impCpCtorExpr->set_result( maybeMutate( impCpCtorExpr->get_result(), *this ) );
    348324        impCpCtorExpr->set_callExpr( maybeMutate( impCpCtorExpr->get_callExpr(), *this ) );
    349325        mutateAll( impCpCtorExpr->get_tempDecls(), *this );
     
    354330
    355331Expression* Mutator::mutate( ConstructorExpr *ctorExpr ) {
    356         ctorExpr->set_env( maybeMutate( ctorExpr->get_env(), *this ) );
    357332        ctorExpr->set_result( maybeMutate( ctorExpr->get_result(), *this ) );
    358333        ctorExpr->set_callExpr( maybeMutate( ctorExpr->get_callExpr(), *this ) );
     
    361336
    362337Expression *Mutator::mutate( CompoundLiteralExpr *compLitExpr ) {
    363         compLitExpr->set_env( maybeMutate( compLitExpr->get_env(), *this ) );
    364338        compLitExpr->set_result( maybeMutate( compLitExpr->get_result(), *this ) );
    365339        compLitExpr->set_type( maybeMutate( compLitExpr->get_type(), *this ) );
     
    369343
    370344Expression *Mutator::mutate( UntypedValofExpr *valofExpr ) {
    371         valofExpr->set_env( maybeMutate( valofExpr->get_env(), *this ) );
    372345        valofExpr->set_result( maybeMutate( valofExpr->get_result(), *this ) );
    373346        return valofExpr;
     
    375348
    376349Expression *Mutator::mutate( RangeExpr *rangeExpr ) {
    377         rangeExpr->set_env( maybeMutate( rangeExpr->get_env(), *this ) );
    378350        rangeExpr->set_low( maybeMutate( rangeExpr->get_low(), *this ) );
    379351        rangeExpr->set_high( maybeMutate( rangeExpr->get_high(), *this ) );
     
    381353}
    382354
    383 Expression *Mutator::mutate( UntypedTupleExpr *tupleExpr ) {
    384         tupleExpr->set_env( maybeMutate( tupleExpr->get_env(), *this ) );
     355Expression *Mutator::mutate( TupleExpr *tupleExpr ) {
    385356        tupleExpr->set_result( maybeMutate( tupleExpr->get_result(), *this ) );
    386357        mutateAll( tupleExpr->get_exprs(), *this );
     
    388359}
    389360
    390 Expression *Mutator::mutate( TupleExpr *tupleExpr ) {
    391         tupleExpr->set_env( maybeMutate( tupleExpr->get_env(), *this ) );
    392         tupleExpr->set_result( maybeMutate( tupleExpr->get_result(), *this ) );
    393         mutateAll( tupleExpr->get_exprs(), *this );
    394         return tupleExpr;
    395 }
    396 
    397361Expression *Mutator::mutate( TupleIndexExpr *tupleExpr ) {
    398         tupleExpr->set_env( maybeMutate( tupleExpr->get_env(), *this ) );
    399362        tupleExpr->set_result( maybeMutate( tupleExpr->get_result(), *this ) );
    400363        tupleExpr->set_tuple( maybeMutate( tupleExpr->get_tuple(), *this ) );
     
    403366
    404367Expression *Mutator::mutate( MemberTupleExpr *tupleExpr ) {
    405         tupleExpr->set_env( maybeMutate( tupleExpr->get_env(), *this ) );
    406368        tupleExpr->set_result( maybeMutate( tupleExpr->get_result(), *this ) );
    407369        tupleExpr->set_member( maybeMutate( tupleExpr->get_member(), *this ) );
     
    411373
    412374Expression *Mutator::mutate( TupleAssignExpr *assignExpr ) {
    413         assignExpr->set_env( maybeMutate( assignExpr->get_env(), *this ) );
    414375        assignExpr->set_result( maybeMutate( assignExpr->get_result(), *this ) );
    415376        assignExpr->set_stmtExpr( maybeMutate( assignExpr->get_stmtExpr(), *this ) );
     
    418379
    419380Expression *Mutator::mutate( StmtExpr *stmtExpr ) {
    420         stmtExpr->set_env( maybeMutate( stmtExpr->get_env(), *this ) );
    421381        stmtExpr->set_result( maybeMutate( stmtExpr->get_result(), *this ) );
    422382        stmtExpr->set_statements( maybeMutate( stmtExpr->get_statements(), *this ) );
     
    427387
    428388Expression *Mutator::mutate( UniqueExpr *uniqueExpr ) {
    429         uniqueExpr->set_env( maybeMutate( uniqueExpr->get_env(), *this ) );
    430389        uniqueExpr->set_result( maybeMutate( uniqueExpr->get_result(), *this ) );
    431390        uniqueExpr->set_expr( maybeMutate( uniqueExpr->get_expr(), *this ) );
Note: See TracChangeset for help on using the changeset viewer.