Ignore:
Timestamp:
May 18, 2015, 11:20:23 AM (9 years ago)
Author:
Peter A. Buhr <pabuhr@…>
Branches:
ADT, aaron-thesis, arm-eh, ast-experimental, cleanup-dtors, ctor, deferred_resn, demangler, enum, forall-pointer-decay, gc_noraii, jacob/cs343-translation, jenkins-sandbox, master, memory, new-ast, new-ast-unique-expr, new-env, no_list, persistent-indexer, pthread-emulation, qualifiedEnum, resolv-new, string, with_gc
Children:
51587aa
Parents:
a32b204
Message:

licencing: third groups of files

File:
1 edited

Legend:

Unmodified
Added
Removed
  • translator/SynTree/Mutator.cc

    ra32b204 r0dd3a2f  
     1//
     2// Cforall Version 1.0.0 Copyright (C) 2015 University of Waterloo
     3//
     4// The contents of this file are covered under the licence agreement in the
     5// file "LICENCE" distributed with Cforall.
     6//
     7// Mutator.cc --
     8//
     9// Author           : Richard C. Bilson
     10// Created On       : Mon May 18 07:44:20 2015
     11// Last Modified By : Peter A. Buhr
     12// Last Modified On : Mon May 18 10:10:46 2015
     13// Update Count     : 1
     14//
     15
    116#include <cassert>
    217#include "Mutator.h"
     
    1429
    1530ObjectDecl *Mutator::mutate( ObjectDecl *objectDecl ) {
    16     objectDecl->set_type( maybeMutate( objectDecl->get_type(), *this ) );
    17     objectDecl->set_init( maybeMutate( objectDecl->get_init(), *this ) );
    18     objectDecl->set_bitfieldWidth( maybeMutate( objectDecl->get_bitfieldWidth(), *this ) );
    19     return objectDecl;
     31        objectDecl->set_type( maybeMutate( objectDecl->get_type(), *this ) );
     32        objectDecl->set_init( maybeMutate( objectDecl->get_init(), *this ) );
     33        objectDecl->set_bitfieldWidth( maybeMutate( objectDecl->get_bitfieldWidth(), *this ) );
     34        return objectDecl;
    2035}
    2136
    2237DeclarationWithType *Mutator::mutate( FunctionDecl *functionDecl ) {
    23     functionDecl->set_functionType( maybeMutate( functionDecl->get_functionType(), *this ) );
    24     mutateAll( functionDecl->get_oldDecls(), *this );
    25     functionDecl->set_statements( maybeMutate( functionDecl->get_statements(), *this ) );
    26     return functionDecl;
     38        functionDecl->set_functionType( maybeMutate( functionDecl->get_functionType(), *this ) );
     39        mutateAll( functionDecl->get_oldDecls(), *this );
     40        functionDecl->set_statements( maybeMutate( functionDecl->get_statements(), *this ) );
     41        return functionDecl;
    2742}
    2843
    2944Declaration *Mutator::handleAggregateDecl( AggregateDecl *aggregateDecl ) {
    30     mutateAll( aggregateDecl->get_parameters(), *this );
    31     mutateAll( aggregateDecl->get_members(), *this );
    32     return aggregateDecl;
     45        mutateAll( aggregateDecl->get_parameters(), *this );
     46        mutateAll( aggregateDecl->get_members(), *this );
     47        return aggregateDecl;
    3348}
    3449
    3550Declaration *Mutator::mutate( StructDecl *aggregateDecl ) {
    36     handleAggregateDecl( aggregateDecl );
    37     return aggregateDecl;
     51        handleAggregateDecl( aggregateDecl );
     52        return aggregateDecl;
    3853}
    3954
    4055Declaration *Mutator::mutate( UnionDecl *aggregateDecl ) {
    41     handleAggregateDecl( aggregateDecl );
    42     return aggregateDecl;
     56        handleAggregateDecl( aggregateDecl );
     57        return aggregateDecl;
    4358}
    4459
    4560Declaration *Mutator::mutate( EnumDecl *aggregateDecl ) {
    46     handleAggregateDecl( aggregateDecl );
    47     return aggregateDecl;
     61        handleAggregateDecl( aggregateDecl );
     62        return aggregateDecl;
    4863}
    4964
    5065Declaration *Mutator::mutate( ContextDecl *aggregateDecl ) {
    51     handleAggregateDecl( aggregateDecl );
    52     return aggregateDecl;
     66        handleAggregateDecl( aggregateDecl );
     67        return aggregateDecl;
    5368}
    5469
    5570Declaration *Mutator::handleNamedTypeDecl( NamedTypeDecl *typeDecl ) {
    56     mutateAll( typeDecl->get_parameters(), *this );
    57     mutateAll( typeDecl->get_assertions(), *this );
    58     typeDecl->set_base( maybeMutate( typeDecl->get_base(), *this ) );
    59     return typeDecl;
     71        mutateAll( typeDecl->get_parameters(), *this );
     72        mutateAll( typeDecl->get_assertions(), *this );
     73        typeDecl->set_base( maybeMutate( typeDecl->get_base(), *this ) );
     74        return typeDecl;
    6075}
    6176
    6277TypeDecl *Mutator::mutate( TypeDecl *typeDecl ) {
    63     handleNamedTypeDecl( typeDecl );
    64     return typeDecl;
     78        handleNamedTypeDecl( typeDecl );
     79        return typeDecl;
    6580}
    6681
    6782Declaration *Mutator::mutate( TypedefDecl *typeDecl ) {
    68     handleNamedTypeDecl( typeDecl );
    69     return typeDecl;
     83        handleNamedTypeDecl( typeDecl );
     84        return typeDecl;
    7085}
    7186
    7287CompoundStmt *Mutator::mutate( CompoundStmt *compoundStmt ) {
    73     mutateAll( compoundStmt->get_kids(), *this );
    74     return compoundStmt;
     88        mutateAll( compoundStmt->get_kids(), *this );
     89        return compoundStmt;
    7590}
    7691
    7792Statement *Mutator::mutate( ExprStmt *exprStmt ) {
    78     exprStmt->set_expr( maybeMutate( exprStmt->get_expr(), *this ) );
    79     return exprStmt;
     93        exprStmt->set_expr( maybeMutate( exprStmt->get_expr(), *this ) );
     94        return exprStmt;
    8095}
    8196
    8297Statement *Mutator::mutate( IfStmt *ifStmt ) {
    83     ifStmt->set_condition( maybeMutate( ifStmt->get_condition(), *this ) );
    84     ifStmt->set_thenPart( maybeMutate( ifStmt->get_thenPart(), *this ) );
    85     ifStmt->set_elsePart( maybeMutate( ifStmt->get_elsePart(), *this ) );
    86     return ifStmt;
     98        ifStmt->set_condition( maybeMutate( ifStmt->get_condition(), *this ) );
     99        ifStmt->set_thenPart( maybeMutate( ifStmt->get_thenPart(), *this ) );
     100        ifStmt->set_elsePart( maybeMutate( ifStmt->get_elsePart(), *this ) );
     101        return ifStmt;
    87102}
    88103
    89104Statement *Mutator::mutate( WhileStmt *whileStmt ) {
    90     whileStmt->set_condition( maybeMutate( whileStmt->get_condition(), *this ) );
    91     whileStmt->set_body( maybeMutate( whileStmt->get_body(), *this ) );
    92     return whileStmt;
     105        whileStmt->set_condition( maybeMutate( whileStmt->get_condition(), *this ) );
     106        whileStmt->set_body( maybeMutate( whileStmt->get_body(), *this ) );
     107        return whileStmt;
    93108}
    94109
    95110Statement *Mutator::mutate( ForStmt *forStmt ) {
    96     forStmt->set_initialization( maybeMutate( forStmt->get_initialization(), *this ) );
    97     forStmt->set_condition( maybeMutate( forStmt->get_condition(), *this ) );
    98     forStmt->set_increment( maybeMutate( forStmt->get_increment(), *this ) );
    99     forStmt->set_body( maybeMutate( forStmt->get_body(), *this ) );
    100     return forStmt;
     111        forStmt->set_initialization( maybeMutate( forStmt->get_initialization(), *this ) );
     112        forStmt->set_condition( maybeMutate( forStmt->get_condition(), *this ) );
     113        forStmt->set_increment( maybeMutate( forStmt->get_increment(), *this ) );
     114        forStmt->set_body( maybeMutate( forStmt->get_body(), *this ) );
     115        return forStmt;
    101116}
    102117
    103118Statement *Mutator::mutate( SwitchStmt *switchStmt ) {
    104     switchStmt->set_condition( maybeMutate( switchStmt->get_condition(), *this ) );
    105     mutateAll( switchStmt->get_branches(), *this );
    106     return switchStmt;
     119        switchStmt->set_condition( maybeMutate( switchStmt->get_condition(), *this ) );
     120        mutateAll( switchStmt->get_branches(), *this );
     121        return switchStmt;
    107122}
    108123
    109124Statement *Mutator::mutate( ChooseStmt *switchStmt ) {
    110     switchStmt->set_condition( maybeMutate( switchStmt->get_condition(), *this ) );
    111     mutateAll( switchStmt->get_branches(), *this );
    112     return switchStmt;
     125        switchStmt->set_condition( maybeMutate( switchStmt->get_condition(), *this ) );
     126        mutateAll( switchStmt->get_branches(), *this );
     127        return switchStmt;
    113128}
    114129
    115130Statement *Mutator::mutate( FallthruStmt *fallthruStmt ) {
    116     return fallthruStmt;
     131        return fallthruStmt;
    117132}
    118133
    119134Statement *Mutator::mutate( CaseStmt *caseStmt ) {
    120     caseStmt->set_condition( maybeMutate( caseStmt->get_condition(), *this ) );
    121     mutateAll (caseStmt->get_statements(), *this );
    122 
    123     return caseStmt;
     135        caseStmt->set_condition( maybeMutate( caseStmt->get_condition(), *this ) );
     136        mutateAll (caseStmt->get_statements(), *this );
     137
     138        return caseStmt;
    124139}
    125140
    126141Statement *Mutator::mutate( BranchStmt *branchStmt ) {
    127     return branchStmt;
     142        return branchStmt;
    128143}
    129144
    130145Statement *Mutator::mutate( ReturnStmt *returnStmt ) {
    131     returnStmt->set_expr( maybeMutate( returnStmt->get_expr(), *this ) );
    132     return returnStmt;
     146        returnStmt->set_expr( maybeMutate( returnStmt->get_expr(), *this ) );
     147        return returnStmt;
    133148}
    134149
    135150Statement *Mutator::mutate( TryStmt *tryStmt ) {
    136     tryStmt->set_block( maybeMutate( tryStmt->get_block(), *this ) );
    137     mutateAll( tryStmt->get_catchers(), *this );
    138     return tryStmt;
     151        tryStmt->set_block( maybeMutate( tryStmt->get_block(), *this ) );
     152        mutateAll( tryStmt->get_catchers(), *this );
     153        return tryStmt;
    139154}
    140155
    141156Statement *Mutator::mutate( CatchStmt *catchStmt ) {
    142     catchStmt->set_decl( maybeMutate( catchStmt->get_decl(), *this ) );
    143     catchStmt->set_body( maybeMutate( catchStmt->get_body(), *this ) );
    144     return catchStmt;
     157        catchStmt->set_decl( maybeMutate( catchStmt->get_decl(), *this ) );
     158        catchStmt->set_body( maybeMutate( catchStmt->get_body(), *this ) );
     159        return catchStmt;
    145160}
    146161
    147162Statement *Mutator::mutate( FinallyStmt *finalStmt ) {
    148     finalStmt->set_block( maybeMutate( finalStmt->get_block(), *this ) );
    149     return finalStmt;
     163        finalStmt->set_block( maybeMutate( finalStmt->get_block(), *this ) );
     164        return finalStmt;
    150165}
    151166
    152167NullStmt *Mutator::mutate( NullStmt *nullStmt ) {
    153     return nullStmt;
     168        return nullStmt;
    154169}
    155170
    156171Statement *Mutator::mutate( DeclStmt *declStmt ) {
    157     declStmt->set_decl( maybeMutate( declStmt->get_decl(), *this ) );
    158     return declStmt;
     172        declStmt->set_decl( maybeMutate( declStmt->get_decl(), *this ) );
     173        return declStmt;
    159174}
    160175
    161176Expression *Mutator::mutate( ApplicationExpr *applicationExpr ) {
    162     mutateAll( applicationExpr->get_results(), *this );
    163     applicationExpr->set_function( maybeMutate( applicationExpr->get_function(), *this ) );
    164     mutateAll( applicationExpr->get_args(), *this );
    165     return applicationExpr;
     177        mutateAll( applicationExpr->get_results(), *this );
     178        applicationExpr->set_function( maybeMutate( applicationExpr->get_function(), *this ) );
     179        mutateAll( applicationExpr->get_args(), *this );
     180        return applicationExpr;
    166181}
    167182
    168183Expression *Mutator::mutate( UntypedExpr *untypedExpr ) {
    169     mutateAll( untypedExpr->get_results(), *this );
    170     mutateAll( untypedExpr->get_args(), *this );
    171     return untypedExpr;
     184        mutateAll( untypedExpr->get_results(), *this );
     185        mutateAll( untypedExpr->get_args(), *this );
     186        return untypedExpr;
    172187}
    173188
    174189Expression *Mutator::mutate( NameExpr *nameExpr ) {
    175     mutateAll( nameExpr->get_results(), *this );
    176     return nameExpr;
     190        mutateAll( nameExpr->get_results(), *this );
     191        return nameExpr;
    177192}
    178193
    179194Expression *Mutator::mutate( AddressExpr *addressExpr ) {
    180     mutateAll( addressExpr->get_results(), *this );
    181     addressExpr->set_arg( maybeMutate( addressExpr->get_arg(), *this ) );
    182     return addressExpr;
     195        mutateAll( addressExpr->get_results(), *this );
     196        addressExpr->set_arg( maybeMutate( addressExpr->get_arg(), *this ) );
     197        return addressExpr;
    183198}
    184199
    185200Expression *Mutator::mutate( LabelAddressExpr *labelAddressExpr ) {
    186     mutateAll( labelAddressExpr->get_results(), *this );
    187     labelAddressExpr->set_arg( maybeMutate( labelAddressExpr->get_arg(), *this ) );
    188     return labelAddressExpr;
     201        mutateAll( labelAddressExpr->get_results(), *this );
     202        labelAddressExpr->set_arg( maybeMutate( labelAddressExpr->get_arg(), *this ) );
     203        return labelAddressExpr;
    189204}
    190205
    191206Expression *Mutator::mutate( CastExpr *castExpr ) {
    192     mutateAll( castExpr->get_results(), *this );
    193     castExpr->set_arg( maybeMutate( castExpr->get_arg(), *this ) );
    194     return castExpr;
     207        mutateAll( castExpr->get_results(), *this );
     208        castExpr->set_arg( maybeMutate( castExpr->get_arg(), *this ) );
     209        return castExpr;
    195210}
    196211
    197212Expression *Mutator::mutate( UntypedMemberExpr *memberExpr ) {
    198     mutateAll( memberExpr->get_results(), *this );
    199     memberExpr->set_aggregate( maybeMutate( memberExpr->get_aggregate(), *this ) );
    200     return memberExpr;
     213        mutateAll( memberExpr->get_results(), *this );
     214        memberExpr->set_aggregate( maybeMutate( memberExpr->get_aggregate(), *this ) );
     215        return memberExpr;
    201216}
    202217
    203218Expression *Mutator::mutate( MemberExpr *memberExpr ) {
    204     mutateAll( memberExpr->get_results(), *this );
    205     memberExpr->set_aggregate( maybeMutate( memberExpr->get_aggregate(), *this ) );
    206     return memberExpr;
     219        mutateAll( memberExpr->get_results(), *this );
     220        memberExpr->set_aggregate( maybeMutate( memberExpr->get_aggregate(), *this ) );
     221        return memberExpr;
    207222}
    208223
    209224Expression *Mutator::mutate( VariableExpr *variableExpr ) {
    210     mutateAll( variableExpr->get_results(), *this );
    211     return variableExpr;
     225        mutateAll( variableExpr->get_results(), *this );
     226        return variableExpr;
    212227}
    213228
    214229Expression *Mutator::mutate( ConstantExpr *constantExpr ) {
    215     mutateAll( constantExpr->get_results(), *this );
     230        mutateAll( constantExpr->get_results(), *this );
    216231//  maybeMutate( constantExpr->get_constant(), *this )
    217     return constantExpr;
     232        return constantExpr;
    218233}
    219234
    220235Expression *Mutator::mutate( SizeofExpr *sizeofExpr ) {
    221     mutateAll( sizeofExpr->get_results(), *this );
    222     if ( sizeofExpr->get_isType() ) {
    223         sizeofExpr->set_type( maybeMutate( sizeofExpr->get_type(), *this ) );
    224     } else {
    225         sizeofExpr->set_expr( maybeMutate( sizeofExpr->get_expr(), *this ) );
    226     }
    227     return sizeofExpr;
     236        mutateAll( sizeofExpr->get_results(), *this );
     237        if ( sizeofExpr->get_isType() ) {
     238                sizeofExpr->set_type( maybeMutate( sizeofExpr->get_type(), *this ) );
     239        } else {
     240                sizeofExpr->set_expr( maybeMutate( sizeofExpr->get_expr(), *this ) );
     241        }
     242        return sizeofExpr;
    228243}
    229244
    230245Expression *Mutator::mutate( AttrExpr *attrExpr ) {
    231     mutateAll( attrExpr->get_results(), *this );
    232     if ( attrExpr->get_isType() ) {
    233         attrExpr->set_type( maybeMutate( attrExpr->get_type(), *this ) );
    234     } else {
    235         attrExpr->set_expr( maybeMutate( attrExpr->get_expr(), *this ) );
    236     }
    237     return attrExpr;
     246        mutateAll( attrExpr->get_results(), *this );
     247        if ( attrExpr->get_isType() ) {
     248                attrExpr->set_type( maybeMutate( attrExpr->get_type(), *this ) );
     249        } else {
     250                attrExpr->set_expr( maybeMutate( attrExpr->get_expr(), *this ) );
     251        }
     252        return attrExpr;
    238253}
    239254
    240255Expression *Mutator::mutate( LogicalExpr *logicalExpr ) {
    241     mutateAll( logicalExpr->get_results(), *this );
    242     logicalExpr->set_arg1( maybeMutate( logicalExpr->get_arg1(), *this ) );
    243     logicalExpr->set_arg2( maybeMutate( logicalExpr->get_arg2(), *this ) );
    244     return logicalExpr;
     256        mutateAll( logicalExpr->get_results(), *this );
     257        logicalExpr->set_arg1( maybeMutate( logicalExpr->get_arg1(), *this ) );
     258        logicalExpr->set_arg2( maybeMutate( logicalExpr->get_arg2(), *this ) );
     259        return logicalExpr;
    245260}
    246261
    247262Expression *Mutator::mutate( ConditionalExpr *conditionalExpr ) {
    248     mutateAll( conditionalExpr->get_results(), *this );
    249     conditionalExpr->set_arg1( maybeMutate( conditionalExpr->get_arg1(), *this ) );
    250     conditionalExpr->set_arg2( maybeMutate( conditionalExpr->get_arg2(), *this ) );
    251     conditionalExpr->set_arg3( maybeMutate( conditionalExpr->get_arg3(), *this ) );
    252     return conditionalExpr;
     263        mutateAll( conditionalExpr->get_results(), *this );
     264        conditionalExpr->set_arg1( maybeMutate( conditionalExpr->get_arg1(), *this ) );
     265        conditionalExpr->set_arg2( maybeMutate( conditionalExpr->get_arg2(), *this ) );
     266        conditionalExpr->set_arg3( maybeMutate( conditionalExpr->get_arg3(), *this ) );
     267        return conditionalExpr;
    253268}
    254269
    255270Expression *Mutator::mutate( CommaExpr *commaExpr ) {
    256     mutateAll( commaExpr->get_results(), *this );
    257     commaExpr->set_arg1( maybeMutate( commaExpr->get_arg1(), *this ) );
    258     commaExpr->set_arg2( maybeMutate( commaExpr->get_arg2(), *this ) );
    259     return commaExpr;
     271        mutateAll( commaExpr->get_results(), *this );
     272        commaExpr->set_arg1( maybeMutate( commaExpr->get_arg1(), *this ) );
     273        commaExpr->set_arg2( maybeMutate( commaExpr->get_arg2(), *this ) );
     274        return commaExpr;
    260275}
    261276
    262277Expression *Mutator::mutate( TupleExpr *tupleExpr ) {
    263     mutateAll( tupleExpr->get_results(), *this );
    264     mutateAll( tupleExpr->get_exprs(), *this );
    265     return tupleExpr;
     278        mutateAll( tupleExpr->get_results(), *this );
     279        mutateAll( tupleExpr->get_exprs(), *this );
     280        return tupleExpr;
    266281}
    267282
    268283Expression *Mutator::mutate( SolvedTupleExpr *tupleExpr ) {
    269     mutateAll( tupleExpr->get_results(), *this );
    270     mutateAll( tupleExpr->get_exprs(), *this );
    271     return tupleExpr;
     284        mutateAll( tupleExpr->get_results(), *this );
     285        mutateAll( tupleExpr->get_exprs(), *this );
     286        return tupleExpr;
    272287}
    273288
    274289Expression *Mutator::mutate( TypeExpr *typeExpr ) {
    275     mutateAll( typeExpr->get_results(), *this );
    276     typeExpr->set_type( maybeMutate( typeExpr->get_type(), *this ) );
    277     return typeExpr;
     290        mutateAll( typeExpr->get_results(), *this );
     291        typeExpr->set_type( maybeMutate( typeExpr->get_type(), *this ) );
     292        return typeExpr;
    278293}
    279294
    280295Expression *Mutator::mutate( UntypedValofExpr *valofExpr ) {
    281     mutateAll( valofExpr->get_results(), *this );
    282     return valofExpr;
     296        mutateAll( valofExpr->get_results(), *this );
     297        return valofExpr;
    283298}
    284299
    285300Type *Mutator::mutate( VoidType *voidType ) {
    286     mutateAll( voidType->get_forall(), *this );
    287     return voidType;
     301        mutateAll( voidType->get_forall(), *this );
     302        return voidType;
    288303}
    289304
    290305Type *Mutator::mutate( BasicType *basicType ) {
    291     mutateAll( basicType->get_forall(), *this );
    292     return basicType;
     306        mutateAll( basicType->get_forall(), *this );
     307        return basicType;
    293308}
    294309
    295310Type *Mutator::mutate( PointerType *pointerType ) {
    296     mutateAll( pointerType->get_forall(), *this );
    297     pointerType->set_base( maybeMutate( pointerType->get_base(), *this ) );
    298     return pointerType;
     311        mutateAll( pointerType->get_forall(), *this );
     312        pointerType->set_base( maybeMutate( pointerType->get_base(), *this ) );
     313        return pointerType;
    299314}
    300315
    301316Type *Mutator::mutate( ArrayType *arrayType ) {
    302     mutateAll( arrayType->get_forall(), *this );
    303     arrayType->set_dimension( maybeMutate( arrayType->get_dimension(), *this ) );
    304     arrayType->set_base( maybeMutate( arrayType->get_base(), *this ) );
    305     return arrayType;
     317        mutateAll( arrayType->get_forall(), *this );
     318        arrayType->set_dimension( maybeMutate( arrayType->get_dimension(), *this ) );
     319        arrayType->set_base( maybeMutate( arrayType->get_base(), *this ) );
     320        return arrayType;
    306321}
    307322
    308323Type *Mutator::mutate( FunctionType *functionType ) {
    309     mutateAll( functionType->get_forall(), *this );
    310     mutateAll( functionType->get_returnVals(), *this );
    311     mutateAll( functionType->get_parameters(), *this );
    312     return functionType;
     324        mutateAll( functionType->get_forall(), *this );
     325        mutateAll( functionType->get_returnVals(), *this );
     326        mutateAll( functionType->get_parameters(), *this );
     327        return functionType;
    313328}
    314329
    315330Type *Mutator::handleReferenceToType( ReferenceToType *aggregateUseType ) {
    316     mutateAll( aggregateUseType->get_forall(), *this );
    317     mutateAll( aggregateUseType->get_parameters(), *this );
    318     return aggregateUseType;
     331        mutateAll( aggregateUseType->get_forall(), *this );
     332        mutateAll( aggregateUseType->get_parameters(), *this );
     333        return aggregateUseType;
    319334}
    320335
    321336Type *Mutator::mutate( StructInstType *aggregateUseType ) {
    322     handleReferenceToType( aggregateUseType );
    323     return aggregateUseType;
     337        handleReferenceToType( aggregateUseType );
     338        return aggregateUseType;
    324339}
    325340
    326341Type *Mutator::mutate( UnionInstType *aggregateUseType ) {
    327     handleReferenceToType( aggregateUseType );
    328     return aggregateUseType;
     342        handleReferenceToType( aggregateUseType );
     343        return aggregateUseType;
    329344}
    330345
    331346Type *Mutator::mutate( EnumInstType *aggregateUseType ) {
    332     handleReferenceToType( aggregateUseType );
    333     return aggregateUseType;
     347        handleReferenceToType( aggregateUseType );
     348        return aggregateUseType;
    334349}
    335350
    336351Type *Mutator::mutate( ContextInstType *aggregateUseType ) {
    337     handleReferenceToType( aggregateUseType );
    338     mutateAll( aggregateUseType->get_members(), *this );
    339     return aggregateUseType;
     352        handleReferenceToType( aggregateUseType );
     353        mutateAll( aggregateUseType->get_members(), *this );
     354        return aggregateUseType;
    340355}
    341356
    342357Type *Mutator::mutate( TypeInstType *aggregateUseType ) {
    343     handleReferenceToType( aggregateUseType );
    344     return aggregateUseType;
     358        handleReferenceToType( aggregateUseType );
     359        return aggregateUseType;
    345360}
    346361
    347362Type *Mutator::mutate( TupleType *tupleType ) {
    348     mutateAll( tupleType->get_forall(), *this );
    349     mutateAll( tupleType->get_types(), *this );
    350     return tupleType;
     363        mutateAll( tupleType->get_forall(), *this );
     364        mutateAll( tupleType->get_types(), *this );
     365        return tupleType;
    351366}
    352367
    353368Type *Mutator::mutate( TypeofType *typeofType ) {
    354     assert( typeofType->get_expr() );
    355     typeofType->set_expr( typeofType->get_expr()->acceptMutator( *this ) );
    356     return typeofType;
     369        assert( typeofType->get_expr() );
     370        typeofType->set_expr( typeofType->get_expr()->acceptMutator( *this ) );
     371        return typeofType;
    357372}
    358373
    359374Type *Mutator::mutate( AttrType *attrType ) {
    360     if ( attrType->get_isType() ) {
    361         assert( attrType->get_type() );
    362         attrType->set_type( attrType->get_type()->acceptMutator( *this ) );
    363     } else {
    364         assert( attrType->get_expr() );
    365         attrType->set_expr( attrType->get_expr()->acceptMutator( *this ) );
    366     }
    367     return attrType;
     375        if ( attrType->get_isType() ) {
     376                assert( attrType->get_type() );
     377                attrType->set_type( attrType->get_type()->acceptMutator( *this ) );
     378        } else {
     379                assert( attrType->get_expr() );
     380                attrType->set_expr( attrType->get_expr()->acceptMutator( *this ) );
     381        }
     382        return attrType;
    368383}
    369384
    370385Initializer *Mutator::mutate( SingleInit *singleInit ) {
    371     singleInit->set_value( singleInit->get_value()->acceptMutator( *this ) );
    372     return singleInit;
     386        singleInit->set_value( singleInit->get_value()->acceptMutator( *this ) );
     387        return singleInit;
    373388}
    374389
    375390Initializer *Mutator::mutate( ListInit *listInit ) {
    376     mutateAll( listInit->get_designators(), *this );
    377     mutateAll( listInit->get_initializers(), *this );
    378     return listInit;
     391        mutateAll( listInit->get_designators(), *this );
     392        mutateAll( listInit->get_initializers(), *this );
     393        return listInit;
    379394}
    380395
    381396Subrange *Mutator::mutate( Subrange *subrange ) {
    382     return subrange;
     397        return subrange;
    383398}
    384399
    385400Constant *Mutator::mutate( Constant *constant ) {
    386     return constant;
    387 }
     401        return constant;
     402}
     403
     404// Local Variables: //
     405// tab-width: 4 //
     406// mode: c++ //
     407// compile-command: "make install" //
     408// End: //
Note: See TracChangeset for help on using the changeset viewer.