Ignore:
Timestamp:
Nov 29, 2016, 3:30:59 PM (9 years ago)
Author:
Peter A. Buhr <pabuhr@…>
Branches:
ADT, aaron-thesis, arm-eh, ast-experimental, cleanup-dtors, deferred_resn, demangler, enum, forall-pointer-decay, jacob/cs343-translation, jenkins-sandbox, master, new-ast, new-ast-unique-expr, new-env, no_list, persistent-indexer, pthread-emulation, qualifiedEnum, resolv-new, with_gc
Children:
8e5724e
Parents:
3a2128f (diff), 9129a84 (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent.
Message:

Merge branch 'master' of plg2:software/cfa/cfa-cc

Conflicts:

src/Parser/parser.cc

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/SynTree/Mutator.cc

    r3a2128f r1f44196  
    178178
    179179Expression *Mutator::mutate( ApplicationExpr *applicationExpr ) {
    180         mutateAll( applicationExpr->get_results(), *this );
     180        applicationExpr->set_result( maybeMutate( applicationExpr->get_result(), *this ) );
    181181        applicationExpr->set_function( maybeMutate( applicationExpr->get_function(), *this ) );
    182182        mutateAll( applicationExpr->get_args(), *this );
     
    185185
    186186Expression *Mutator::mutate( UntypedExpr *untypedExpr ) {
    187         mutateAll( untypedExpr->get_results(), *this );
     187        untypedExpr->set_result( maybeMutate( untypedExpr->get_result(), *this ) );
    188188        mutateAll( untypedExpr->get_args(), *this );
    189189        return untypedExpr;
     
    191191
    192192Expression *Mutator::mutate( NameExpr *nameExpr ) {
    193         mutateAll( nameExpr->get_results(), *this );
     193        nameExpr->set_result( maybeMutate( nameExpr->get_result(), *this ) );
    194194        return nameExpr;
    195195}
    196196
    197197Expression *Mutator::mutate( AddressExpr *addressExpr ) {
    198         mutateAll( addressExpr->get_results(), *this );
     198        addressExpr->set_result( maybeMutate( addressExpr->get_result(), *this ) );
    199199        addressExpr->set_arg( maybeMutate( addressExpr->get_arg(), *this ) );
    200200        return addressExpr;
     
    202202
    203203Expression *Mutator::mutate( LabelAddressExpr *labelAddressExpr ) {
    204         mutateAll( labelAddressExpr->get_results(), *this );
     204        labelAddressExpr->set_result( maybeMutate( labelAddressExpr->get_result(), *this ) );
    205205        labelAddressExpr->set_arg( maybeMutate( labelAddressExpr->get_arg(), *this ) );
    206206        return labelAddressExpr;
     
    208208
    209209Expression *Mutator::mutate( CastExpr *castExpr ) {
    210         mutateAll( castExpr->get_results(), *this );
     210        castExpr->set_result( maybeMutate( castExpr->get_result(), *this ) );
    211211        castExpr->set_arg( maybeMutate( castExpr->get_arg(), *this ) );
    212212        return castExpr;
     
    214214
    215215Expression *Mutator::mutate( UntypedMemberExpr *memberExpr ) {
    216         mutateAll( memberExpr->get_results(), *this );
     216        memberExpr->set_result( maybeMutate( memberExpr->get_result(), *this ) );
     217        memberExpr->set_aggregate( maybeMutate( memberExpr->get_aggregate(), *this ) );
     218        memberExpr->set_member( maybeMutate( memberExpr->get_member(), *this ) );
     219        return memberExpr;
     220}
     221
     222Expression *Mutator::mutate( MemberExpr *memberExpr ) {
     223        memberExpr->set_result( maybeMutate( memberExpr->get_result(), *this ) );
    217224        memberExpr->set_aggregate( maybeMutate( memberExpr->get_aggregate(), *this ) );
    218225        return memberExpr;
    219226}
    220227
    221 Expression *Mutator::mutate( MemberExpr *memberExpr ) {
    222         mutateAll( memberExpr->get_results(), *this );
    223         memberExpr->set_aggregate( maybeMutate( memberExpr->get_aggregate(), *this ) );
    224         return memberExpr;
    225 }
    226 
    227228Expression *Mutator::mutate( VariableExpr *variableExpr ) {
    228         mutateAll( variableExpr->get_results(), *this );
     229        variableExpr->set_result( maybeMutate( variableExpr->get_result(), *this ) );
    229230        return variableExpr;
    230231}
    231232
    232233Expression *Mutator::mutate( ConstantExpr *constantExpr ) {
    233         mutateAll( constantExpr->get_results(), *this );
     234        constantExpr->set_result( maybeMutate( constantExpr->get_result(), *this ) );
    234235//  maybeMutate( constantExpr->get_constant(), *this )
    235236        return constantExpr;
     
    237238
    238239Expression *Mutator::mutate( SizeofExpr *sizeofExpr ) {
    239         mutateAll( sizeofExpr->get_results(), *this );
     240        sizeofExpr->set_result( maybeMutate( sizeofExpr->get_result(), *this ) );
    240241        if ( sizeofExpr->get_isType() ) {
    241242                sizeofExpr->set_type( maybeMutate( sizeofExpr->get_type(), *this ) );
     
    247248
    248249Expression *Mutator::mutate( AlignofExpr *alignofExpr ) {
    249         mutateAll( alignofExpr->get_results(), *this );
     250        alignofExpr->set_result( maybeMutate( alignofExpr->get_result(), *this ) );
    250251        if ( alignofExpr->get_isType() ) {
    251252                alignofExpr->set_type( maybeMutate( alignofExpr->get_type(), *this ) );
     
    257258
    258259Expression *Mutator::mutate( UntypedOffsetofExpr *offsetofExpr ) {
    259         mutateAll( offsetofExpr->get_results(), *this );
     260        offsetofExpr->set_result( maybeMutate( offsetofExpr->get_result(), *this ) );
    260261        offsetofExpr->set_type( maybeMutate( offsetofExpr->get_type(), *this ) );
    261262        return offsetofExpr;
     
    263264
    264265Expression *Mutator::mutate( OffsetofExpr *offsetofExpr ) {
    265         mutateAll( offsetofExpr->get_results(), *this );
     266        offsetofExpr->set_result( maybeMutate( offsetofExpr->get_result(), *this ) );
    266267        offsetofExpr->set_type( maybeMutate( offsetofExpr->get_type(), *this ) );
    267268        offsetofExpr->set_member( maybeMutate( offsetofExpr->get_member(), *this ) );
     
    270271
    271272Expression *Mutator::mutate( OffsetPackExpr *offsetPackExpr ) {
    272         mutateAll( offsetPackExpr->get_results(), *this );
     273        offsetPackExpr->set_result( maybeMutate( offsetPackExpr->get_result(), *this ) );
    273274        offsetPackExpr->set_type( maybeMutate( offsetPackExpr->get_type(), *this ) );
    274275        return offsetPackExpr;
     
    276277
    277278Expression *Mutator::mutate( AttrExpr *attrExpr ) {
    278         mutateAll( attrExpr->get_results(), *this );
     279        attrExpr->set_result( maybeMutate( attrExpr->get_result(), *this ) );
    279280        if ( attrExpr->get_isType() ) {
    280281                attrExpr->set_type( maybeMutate( attrExpr->get_type(), *this ) );
     
    286287
    287288Expression *Mutator::mutate( LogicalExpr *logicalExpr ) {
    288         mutateAll( logicalExpr->get_results(), *this );
     289        logicalExpr->set_result( maybeMutate( logicalExpr->get_result(), *this ) );
    289290        logicalExpr->set_arg1( maybeMutate( logicalExpr->get_arg1(), *this ) );
    290291        logicalExpr->set_arg2( maybeMutate( logicalExpr->get_arg2(), *this ) );
     
    293294
    294295Expression *Mutator::mutate( ConditionalExpr *conditionalExpr ) {
    295         mutateAll( conditionalExpr->get_results(), *this );
     296        conditionalExpr->set_result( maybeMutate( conditionalExpr->get_result(), *this ) );
    296297        conditionalExpr->set_arg1( maybeMutate( conditionalExpr->get_arg1(), *this ) );
    297298        conditionalExpr->set_arg2( maybeMutate( conditionalExpr->get_arg2(), *this ) );
     
    301302
    302303Expression *Mutator::mutate( CommaExpr *commaExpr ) {
    303         mutateAll( commaExpr->get_results(), *this );
     304        commaExpr->set_result( maybeMutate( commaExpr->get_result(), *this ) );
    304305        commaExpr->set_arg1( maybeMutate( commaExpr->get_arg1(), *this ) );
    305306        commaExpr->set_arg2( maybeMutate( commaExpr->get_arg2(), *this ) );
     
    307308}
    308309
    309 Expression *Mutator::mutate( TupleExpr *tupleExpr ) {
    310         mutateAll( tupleExpr->get_results(), *this );
    311         mutateAll( tupleExpr->get_exprs(), *this );
    312         return tupleExpr;
    313 }
    314 
    315 Expression *Mutator::mutate( SolvedTupleExpr *tupleExpr ) {
    316         mutateAll( tupleExpr->get_results(), *this );
    317         mutateAll( tupleExpr->get_exprs(), *this );
    318         return tupleExpr;
    319 }
    320 
    321310Expression *Mutator::mutate( TypeExpr *typeExpr ) {
    322         mutateAll( typeExpr->get_results(), *this );
     311        typeExpr->set_result( maybeMutate( typeExpr->get_result(), *this ) );
    323312        typeExpr->set_type( maybeMutate( typeExpr->get_type(), *this ) );
    324313        return typeExpr;
     
    340329
    341330Expression* Mutator::mutate( ConstructorExpr *ctorExpr ) {
    342         mutateAll( ctorExpr->get_results(), *this );
     331        ctorExpr->set_result( maybeMutate( ctorExpr->get_result(), *this ) );
    343332        ctorExpr->set_callExpr( maybeMutate( ctorExpr->get_callExpr(), *this ) );
    344333        return ctorExpr;
     
    346335
    347336Expression *Mutator::mutate( CompoundLiteralExpr *compLitExpr ) {
    348         mutateAll( compLitExpr->get_results(), *this );
     337        compLitExpr->set_result( maybeMutate( compLitExpr->get_result(), *this ) );
    349338        compLitExpr->set_type( maybeMutate( compLitExpr->get_type(), *this ) );
    350339        compLitExpr->set_initializer( maybeMutate( compLitExpr->get_initializer(), *this ) );
     
    353342
    354343Expression *Mutator::mutate( UntypedValofExpr *valofExpr ) {
    355         mutateAll( valofExpr->get_results(), *this );
     344        valofExpr->set_result( maybeMutate( valofExpr->get_result(), *this ) );
    356345        return valofExpr;
    357346}
     
    361350        rangeExpr->set_high( maybeMutate( rangeExpr->get_high(), *this ) );
    362351        return rangeExpr;
     352}
     353
     354Expression *Mutator::mutate( TupleExpr *tupleExpr ) {
     355        tupleExpr->set_result( maybeMutate( tupleExpr->get_result(), *this ) );
     356        mutateAll( tupleExpr->get_exprs(), *this );
     357        return tupleExpr;
     358}
     359
     360Expression *Mutator::mutate( TupleIndexExpr *tupleExpr ) {
     361        tupleExpr->set_result( maybeMutate( tupleExpr->get_result(), *this ) );
     362        tupleExpr->set_tuple( maybeMutate( tupleExpr->get_tuple(), *this ) );
     363        return tupleExpr;
     364}
     365
     366Expression *Mutator::mutate( MemberTupleExpr *tupleExpr ) {
     367        tupleExpr->set_result( maybeMutate( tupleExpr->get_result(), *this ) );
     368        tupleExpr->set_member( maybeMutate( tupleExpr->get_member(), *this ) );
     369        tupleExpr->set_aggregate( maybeMutate( tupleExpr->get_aggregate(), *this ) );
     370        return tupleExpr;
     371}
     372
     373Expression *Mutator::mutate( TupleAssignExpr *assignExpr ) {
     374        assignExpr->set_result( maybeMutate( assignExpr->get_result(), *this ) );
     375        mutateAll( assignExpr->get_tempDecls(), *this );
     376        mutateAll( assignExpr->get_assigns(), *this );
     377        return assignExpr;
     378}
     379
     380Expression *Mutator::mutate( StmtExpr *stmtExpr ) {
     381        stmtExpr->set_result( maybeMutate( stmtExpr->get_result(), *this ) );
     382        stmtExpr->set_statements( maybeMutate( stmtExpr->get_statements(), *this ) );
     383        return stmtExpr;
     384}
     385
     386Expression *Mutator::mutate( UniqueExpr *uniqueExpr ) {
     387        uniqueExpr->set_result( maybeMutate( uniqueExpr->get_result(), *this ) );
     388        uniqueExpr->set_expr( maybeMutate( uniqueExpr->get_expr(), *this ) );
     389        return uniqueExpr;
    363390}
    364391
Note: See TracChangeset for help on using the changeset viewer.