Ignore:
Timestamp:
Jul 4, 2017, 9:40:16 AM (7 years ago)
Author:
Rob Schluntz <rschlunt@…>
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:
208e5be
Parents:
9c951e3 (diff), f7cb0bc (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' into references

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/SynTree/Mutator.cc

    r9c951e3 rb1e63ac5  
    99// Author           : Richard C. Bilson
    1010// Created On       : Mon May 18 07:44:20 2015
    11 // Last Modified By : Peter A. Buhr
    12 // Last Modified On : Thu Mar 30 16:45:19 2017
    13 // Update Count     : 22
     11// Last Modified By : Andrew Beach
     12// Last Modified On : Thu Jun 22 13:43:00 2017
     13// Update Count     : 24
    1414//
    1515
     
    7777TypeDecl *Mutator::mutate( TypeDecl *typeDecl ) {
    7878        handleNamedTypeDecl( typeDecl );
     79        typeDecl->set_init( maybeMutate( typeDecl->get_init(), *this ) );
    7980        return typeDecl;
    8081}
     
    152153}
    153154
     155Statement *Mutator::mutate( ThrowStmt *throwStmt ) {
     156        throwStmt->set_expr( maybeMutate( throwStmt->get_expr(), *this ) );
     157        throwStmt->set_target( maybeMutate( throwStmt->get_target(), *this ) );
     158        return throwStmt;
     159}
     160
    154161Statement *Mutator::mutate( TryStmt *tryStmt ) {
    155162        tryStmt->set_block( maybeMutate( tryStmt->get_block(), *this ) );
    156163        mutateAll( tryStmt->get_catchers(), *this );
     164        tryStmt->set_finally( maybeMutate( tryStmt->get_finally(), *this ) );
    157165        return tryStmt;
    158166}
     
    160168Statement *Mutator::mutate( CatchStmt *catchStmt ) {
    161169        catchStmt->set_decl( maybeMutate( catchStmt->get_decl(), *this ) );
     170        catchStmt->set_cond( maybeMutate( catchStmt->get_cond(), *this ) );
    162171        catchStmt->set_body( maybeMutate( catchStmt->get_body(), *this ) );
    163172        return catchStmt;
     
    373382}
    374383
    375 Expression *Mutator::mutate( UntypedValofExpr *valofExpr ) {
    376         valofExpr->set_env( maybeMutate( valofExpr->get_env(), *this ) );
    377         valofExpr->set_result( maybeMutate( valofExpr->get_result(), *this ) );
    378         return valofExpr;
    379 }
    380 
    381384Expression *Mutator::mutate( RangeExpr *rangeExpr ) {
    382385        rangeExpr->set_env( maybeMutate( rangeExpr->get_env(), *this ) );
     
    404407        tupleExpr->set_result( maybeMutate( tupleExpr->get_result(), *this ) );
    405408        tupleExpr->set_tuple( maybeMutate( tupleExpr->get_tuple(), *this ) );
    406         return tupleExpr;
    407 }
    408 
    409 Expression *Mutator::mutate( MemberTupleExpr *tupleExpr ) {
    410         tupleExpr->set_env( maybeMutate( tupleExpr->get_env(), *this ) );
    411         tupleExpr->set_result( maybeMutate( tupleExpr->get_result(), *this ) );
    412         tupleExpr->set_member( maybeMutate( tupleExpr->get_member(), *this ) );
    413         tupleExpr->set_aggregate( maybeMutate( tupleExpr->get_aggregate(), *this ) );
    414409        return tupleExpr;
    415410}
     
    438433}
    439434
     435Expression *Mutator::mutate( UntypedInitExpr * initExpr ) {
     436        initExpr->set_env( maybeMutate( initExpr->get_env(), *this ) );
     437        initExpr->set_result( maybeMutate( initExpr->get_result(), *this ) );
     438        initExpr->set_expr( maybeMutate( initExpr->get_expr(), *this ) );
     439        // not currently mutating initAlts, but this doesn't matter since this node is only used in the resolver.
     440        return initExpr;
     441}
     442
     443Expression *Mutator::mutate( InitExpr * initExpr ) {
     444        initExpr->set_env( maybeMutate( initExpr->get_env(), *this ) );
     445        initExpr->set_result( maybeMutate( initExpr->get_result(), *this ) );
     446        initExpr->set_expr( maybeMutate( initExpr->get_expr(), *this ) );
     447        initExpr->set_designation( maybeMutate( initExpr->get_designation(), *this ) );
     448        return initExpr;
     449}
     450
    440451
    441452Type *Mutator::mutate( VoidType *voidType ) {
     
    510521        mutateAll( tupleType->get_forall(), *this );
    511522        mutateAll( tupleType->get_types(), *this );
     523        mutateAll( tupleType->get_members(), *this );
    512524        return tupleType;
    513525}
     
    546558
    547559
     560Designation *Mutator::mutate( Designation * designation ) {
     561        mutateAll( designation->get_designators(), *this );
     562        return designation;
     563}
     564
    548565Initializer *Mutator::mutate( SingleInit *singleInit ) {
    549566        singleInit->set_value( singleInit->get_value()->acceptMutator( *this ) );
     
    552569
    553570Initializer *Mutator::mutate( ListInit *listInit ) {
    554         mutateAll( listInit->get_designators(), *this );
     571        mutateAll( listInit->get_designations(), *this );
    555572        mutateAll( listInit->get_initializers(), *this );
    556573        return listInit;
Note: See TracChangeset for help on using the changeset viewer.