source: src/SynTree/Mutator.cc @ f006f01

ADTaaron-thesisarm-ehast-experimentalcleanup-dtorsdeferred_resndemanglerenumforall-pointer-decayjacob/cs343-translationjenkins-sandboxnew-astnew-ast-unique-exprnew-envno_listpersistent-indexerpthread-emulationqualifiedEnumresolv-newwith_gc
Last change on this file since f006f01 was 6eb8948, checked in by Rob Schluntz <rschlunt@…>, 8 years ago

make TupleAssignment? generate temporaries, add StmtExpr? for GCC statement expressions, expand tuple assignment expressions, collapse SolvedTupleExpr?, MassAssignExpr?, and MultipleAssignExpr? into TupleAssignExpr?

  • Property mode set to 100644
File size: 15.8 KB
RevLine 
[0dd3a2f]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//
[71f4e4f]7// Mutator.cc --
[0dd3a2f]8//
9// Author           : Richard C. Bilson
10// Created On       : Mon May 18 07:44:20 2015
[4e06c1e]11// Last Modified By : Peter A. Buhr
[8688ce1]12// Last Modified On : Thu Aug  4 11:23:21 2016
13// Update Count     : 19
[0dd3a2f]14//
15
[51b7345]16#include <cassert>
17#include "Mutator.h"
18#include "Initializer.h"
19#include "Statement.h"
20#include "Type.h"
21#include "Declaration.h"
22#include "Expression.h"
23#include "Constant.h"
[d3b7937]24#include "Common/utility.h"
[51b7345]25
[d9a0e76]26Mutator::Mutator() {}
[51b7345]27
[d9a0e76]28Mutator::~Mutator() {}
[51b7345]29
[1db21619]30DeclarationWithType *Mutator::mutate( ObjectDecl *objectDecl ) {
[0dd3a2f]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;
[51b7345]35}
36
[d9a0e76]37DeclarationWithType *Mutator::mutate( FunctionDecl *functionDecl ) {
[0dd3a2f]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;
[51b7345]42}
43
[d9a0e76]44Declaration *Mutator::handleAggregateDecl( AggregateDecl *aggregateDecl ) {
[0dd3a2f]45        mutateAll( aggregateDecl->get_parameters(), *this );
46        mutateAll( aggregateDecl->get_members(), *this );
47        return aggregateDecl;
[51b7345]48}
49
[d9a0e76]50Declaration *Mutator::mutate( StructDecl *aggregateDecl ) {
[0dd3a2f]51        handleAggregateDecl( aggregateDecl );
52        return aggregateDecl;
[51b7345]53}
54
[d9a0e76]55Declaration *Mutator::mutate( UnionDecl *aggregateDecl ) {
[0dd3a2f]56        handleAggregateDecl( aggregateDecl );
57        return aggregateDecl;
[51b7345]58}
59
[d9a0e76]60Declaration *Mutator::mutate( EnumDecl *aggregateDecl ) {
[0dd3a2f]61        handleAggregateDecl( aggregateDecl );
62        return aggregateDecl;
[51b7345]63}
64
[4040425]65Declaration *Mutator::mutate( TraitDecl *aggregateDecl ) {
[0dd3a2f]66        handleAggregateDecl( aggregateDecl );
67        return aggregateDecl;
[51b7345]68}
69
[d9a0e76]70Declaration *Mutator::handleNamedTypeDecl( NamedTypeDecl *typeDecl ) {
[0dd3a2f]71        mutateAll( typeDecl->get_parameters(), *this );
72        mutateAll( typeDecl->get_assertions(), *this );
73        typeDecl->set_base( maybeMutate( typeDecl->get_base(), *this ) );
74        return typeDecl;
[51b7345]75}
76
[d9a0e76]77TypeDecl *Mutator::mutate( TypeDecl *typeDecl ) {
[0dd3a2f]78        handleNamedTypeDecl( typeDecl );
79        return typeDecl;
[51b7345]80}
81
[d9a0e76]82Declaration *Mutator::mutate( TypedefDecl *typeDecl ) {
[0dd3a2f]83        handleNamedTypeDecl( typeDecl );
84        return typeDecl;
[51b7345]85}
86
[d9a0e76]87CompoundStmt *Mutator::mutate( CompoundStmt *compoundStmt ) {
[0dd3a2f]88        mutateAll( compoundStmt->get_kids(), *this );
89        return compoundStmt;
[51b7345]90}
91
[d9a0e76]92Statement *Mutator::mutate( ExprStmt *exprStmt ) {
[0dd3a2f]93        exprStmt->set_expr( maybeMutate( exprStmt->get_expr(), *this ) );
94        return exprStmt;
[51b7345]95}
96
[7f5566b]97Statement *Mutator::mutate( AsmStmt *asmStmt ) {
98        asmStmt->set_instruction( maybeMutate( asmStmt->get_instruction(), *this ) );
99        mutateAll( asmStmt->get_output(), *this );
100        mutateAll( asmStmt->get_input(), *this );
101        mutateAll( asmStmt->get_clobber(), *this );
102        return asmStmt;
103}
104
[d9a0e76]105Statement *Mutator::mutate( IfStmt *ifStmt ) {
[0dd3a2f]106        ifStmt->set_condition( maybeMutate( ifStmt->get_condition(), *this ) );
107        ifStmt->set_thenPart( maybeMutate( ifStmt->get_thenPart(), *this ) );
108        ifStmt->set_elsePart( maybeMutate( ifStmt->get_elsePart(), *this ) );
109        return ifStmt;
[51b7345]110}
111
[d9a0e76]112Statement *Mutator::mutate( WhileStmt *whileStmt ) {
[0dd3a2f]113        whileStmt->set_condition( maybeMutate( whileStmt->get_condition(), *this ) );
114        whileStmt->set_body( maybeMutate( whileStmt->get_body(), *this ) );
115        return whileStmt;
[51b7345]116}
117
[d9a0e76]118Statement *Mutator::mutate( ForStmt *forStmt ) {
[145f1fc]119        mutateAll( forStmt->get_initialization(), *this );
[0dd3a2f]120        forStmt->set_condition( maybeMutate( forStmt->get_condition(), *this ) );
121        forStmt->set_increment( maybeMutate( forStmt->get_increment(), *this ) );
122        forStmt->set_body( maybeMutate( forStmt->get_body(), *this ) );
123        return forStmt;
[51b7345]124}
125
[d9a0e76]126Statement *Mutator::mutate( SwitchStmt *switchStmt ) {
[0dd3a2f]127        switchStmt->set_condition( maybeMutate( switchStmt->get_condition(), *this ) );
[8688ce1]128        mutateAll( switchStmt->get_statements(), *this );
[0dd3a2f]129        return switchStmt;
[51b7345]130}
131
[d9a0e76]132Statement *Mutator::mutate( CaseStmt *caseStmt ) {
[0dd3a2f]133        caseStmt->set_condition( maybeMutate( caseStmt->get_condition(), *this ) );
134        mutateAll (caseStmt->get_statements(), *this );
[51b7345]135
[0dd3a2f]136        return caseStmt;
[51b7345]137}
138
[d9a0e76]139Statement *Mutator::mutate( BranchStmt *branchStmt ) {
[0dd3a2f]140        return branchStmt;
[51b7345]141}
142
[d9a0e76]143Statement *Mutator::mutate( ReturnStmt *returnStmt ) {
[0dd3a2f]144        returnStmt->set_expr( maybeMutate( returnStmt->get_expr(), *this ) );
145        return returnStmt;
[51b7345]146}
147
[d9a0e76]148Statement *Mutator::mutate( TryStmt *tryStmt ) {
[0dd3a2f]149        tryStmt->set_block( maybeMutate( tryStmt->get_block(), *this ) );
150        mutateAll( tryStmt->get_catchers(), *this );
151        return tryStmt;
[51b7345]152}
153
[d9a0e76]154Statement *Mutator::mutate( CatchStmt *catchStmt ) {
[0dd3a2f]155        catchStmt->set_decl( maybeMutate( catchStmt->get_decl(), *this ) );
156        catchStmt->set_body( maybeMutate( catchStmt->get_body(), *this ) );
157        return catchStmt;
[51b7345]158}
159
[d9a0e76]160Statement *Mutator::mutate( FinallyStmt *finalStmt ) {
[0dd3a2f]161        finalStmt->set_block( maybeMutate( finalStmt->get_block(), *this ) );
162        return finalStmt;
[51b7345]163}
164
[d9a0e76]165NullStmt *Mutator::mutate( NullStmt *nullStmt ) {
[0dd3a2f]166        return nullStmt;
[51b7345]167}
168
[d9a0e76]169Statement *Mutator::mutate( DeclStmt *declStmt ) {
[0dd3a2f]170        declStmt->set_decl( maybeMutate( declStmt->get_decl(), *this ) );
171        return declStmt;
[51b7345]172}
173
[f1b1e4c]174Statement *Mutator::mutate( ImplicitCtorDtorStmt *impCtorDtorStmt ) {
175        impCtorDtorStmt->set_callStmt( maybeMutate( impCtorDtorStmt->get_callStmt(), *this ) );
176        return impCtorDtorStmt;
177}
178
[d9a0e76]179Expression *Mutator::mutate( ApplicationExpr *applicationExpr ) {
[0dd3a2f]180        mutateAll( applicationExpr->get_results(), *this );
181        applicationExpr->set_function( maybeMutate( applicationExpr->get_function(), *this ) );
182        mutateAll( applicationExpr->get_args(), *this );
183        return applicationExpr;
[51b7345]184}
185
[d9a0e76]186Expression *Mutator::mutate( UntypedExpr *untypedExpr ) {
[0dd3a2f]187        mutateAll( untypedExpr->get_results(), *this );
188        mutateAll( untypedExpr->get_args(), *this );
189        return untypedExpr;
[51b7345]190}
191
[d9a0e76]192Expression *Mutator::mutate( NameExpr *nameExpr ) {
[0dd3a2f]193        mutateAll( nameExpr->get_results(), *this );
194        return nameExpr;
[51b7345]195}
196
[d9a0e76]197Expression *Mutator::mutate( AddressExpr *addressExpr ) {
[0dd3a2f]198        mutateAll( addressExpr->get_results(), *this );
199        addressExpr->set_arg( maybeMutate( addressExpr->get_arg(), *this ) );
200        return addressExpr;
[51b7345]201}
202
[d9a0e76]203Expression *Mutator::mutate( LabelAddressExpr *labelAddressExpr ) {
[0dd3a2f]204        mutateAll( labelAddressExpr->get_results(), *this );
205        labelAddressExpr->set_arg( maybeMutate( labelAddressExpr->get_arg(), *this ) );
206        return labelAddressExpr;
[51b7345]207}
208
[d9a0e76]209Expression *Mutator::mutate( CastExpr *castExpr ) {
[0dd3a2f]210        mutateAll( castExpr->get_results(), *this );
211        castExpr->set_arg( maybeMutate( castExpr->get_arg(), *this ) );
212        return castExpr;
[51b7345]213}
214
[d9a0e76]215Expression *Mutator::mutate( UntypedMemberExpr *memberExpr ) {
[0dd3a2f]216        mutateAll( memberExpr->get_results(), *this );
217        memberExpr->set_aggregate( maybeMutate( memberExpr->get_aggregate(), *this ) );
[3b58d91]218        memberExpr->set_member( maybeMutate( memberExpr->get_member(), *this ) );
[0dd3a2f]219        return memberExpr;
[51b7345]220}
221
[d9a0e76]222Expression *Mutator::mutate( MemberExpr *memberExpr ) {
[0dd3a2f]223        mutateAll( memberExpr->get_results(), *this );
224        memberExpr->set_aggregate( maybeMutate( memberExpr->get_aggregate(), *this ) );
225        return memberExpr;
[51b7345]226}
227
[d9a0e76]228Expression *Mutator::mutate( VariableExpr *variableExpr ) {
[0dd3a2f]229        mutateAll( variableExpr->get_results(), *this );
230        return variableExpr;
[51b7345]231}
232
[d9a0e76]233Expression *Mutator::mutate( ConstantExpr *constantExpr ) {
[0dd3a2f]234        mutateAll( constantExpr->get_results(), *this );
[51b7345]235//  maybeMutate( constantExpr->get_constant(), *this )
[0dd3a2f]236        return constantExpr;
[51b7345]237}
238
[d9a0e76]239Expression *Mutator::mutate( SizeofExpr *sizeofExpr ) {
[0dd3a2f]240        mutateAll( sizeofExpr->get_results(), *this );
241        if ( sizeofExpr->get_isType() ) {
242                sizeofExpr->set_type( maybeMutate( sizeofExpr->get_type(), *this ) );
243        } else {
244                sizeofExpr->set_expr( maybeMutate( sizeofExpr->get_expr(), *this ) );
245        }
246        return sizeofExpr;
[51b7345]247}
248
[47534159]249Expression *Mutator::mutate( AlignofExpr *alignofExpr ) {
250        mutateAll( alignofExpr->get_results(), *this );
251        if ( alignofExpr->get_isType() ) {
252                alignofExpr->set_type( maybeMutate( alignofExpr->get_type(), *this ) );
253        } else {
254                alignofExpr->set_expr( maybeMutate( alignofExpr->get_expr(), *this ) );
255        }
256        return alignofExpr;
257}
258
[2a4b088]259Expression *Mutator::mutate( UntypedOffsetofExpr *offsetofExpr ) {
260        mutateAll( offsetofExpr->get_results(), *this );
261        offsetofExpr->set_type( maybeMutate( offsetofExpr->get_type(), *this ) );
262        return offsetofExpr;
263}
264
[25a054f]265Expression *Mutator::mutate( OffsetofExpr *offsetofExpr ) {
266        mutateAll( offsetofExpr->get_results(), *this );
267        offsetofExpr->set_type( maybeMutate( offsetofExpr->get_type(), *this ) );
268        offsetofExpr->set_member( maybeMutate( offsetofExpr->get_member(), *this ) );
269        return offsetofExpr;
270}
271
[afc1045]272Expression *Mutator::mutate( OffsetPackExpr *offsetPackExpr ) {
273        mutateAll( offsetPackExpr->get_results(), *this );
274        offsetPackExpr->set_type( maybeMutate( offsetPackExpr->get_type(), *this ) );
275        return offsetPackExpr;
276}
277
[d9a0e76]278Expression *Mutator::mutate( AttrExpr *attrExpr ) {
[0dd3a2f]279        mutateAll( attrExpr->get_results(), *this );
280        if ( attrExpr->get_isType() ) {
281                attrExpr->set_type( maybeMutate( attrExpr->get_type(), *this ) );
282        } else {
283                attrExpr->set_expr( maybeMutate( attrExpr->get_expr(), *this ) );
284        }
285        return attrExpr;
[51b7345]286}
287
[d9a0e76]288Expression *Mutator::mutate( LogicalExpr *logicalExpr ) {
[0dd3a2f]289        mutateAll( logicalExpr->get_results(), *this );
290        logicalExpr->set_arg1( maybeMutate( logicalExpr->get_arg1(), *this ) );
291        logicalExpr->set_arg2( maybeMutate( logicalExpr->get_arg2(), *this ) );
292        return logicalExpr;
[51b7345]293}
294
[d9a0e76]295Expression *Mutator::mutate( ConditionalExpr *conditionalExpr ) {
[0dd3a2f]296        mutateAll( conditionalExpr->get_results(), *this );
297        conditionalExpr->set_arg1( maybeMutate( conditionalExpr->get_arg1(), *this ) );
298        conditionalExpr->set_arg2( maybeMutate( conditionalExpr->get_arg2(), *this ) );
299        conditionalExpr->set_arg3( maybeMutate( conditionalExpr->get_arg3(), *this ) );
300        return conditionalExpr;
[51b7345]301}
302
[d9a0e76]303Expression *Mutator::mutate( CommaExpr *commaExpr ) {
[0dd3a2f]304        mutateAll( commaExpr->get_results(), *this );
305        commaExpr->set_arg1( maybeMutate( commaExpr->get_arg1(), *this ) );
306        commaExpr->set_arg2( maybeMutate( commaExpr->get_arg2(), *this ) );
307        return commaExpr;
[51b7345]308}
309
[d9a0e76]310Expression *Mutator::mutate( TypeExpr *typeExpr ) {
[0dd3a2f]311        mutateAll( typeExpr->get_results(), *this );
312        typeExpr->set_type( maybeMutate( typeExpr->get_type(), *this ) );
313        return typeExpr;
[51b7345]314}
315
[7f5566b]316Expression *Mutator::mutate( AsmExpr *asmExpr ) {
317        asmExpr->set_inout( maybeMutate( asmExpr->get_inout(), *this ) );
318        asmExpr->set_constraint( maybeMutate( asmExpr->get_constraint(), *this ) );
319        asmExpr->set_operand( maybeMutate( asmExpr->get_operand(), *this ) );
320        return asmExpr;
321}
322
[db4ecc5]323Expression* Mutator::mutate( ImplicitCopyCtorExpr *impCpCtorExpr ) {
324        impCpCtorExpr->set_callExpr( maybeMutate( impCpCtorExpr->get_callExpr(), *this ) );
325        mutateAll( impCpCtorExpr->get_tempDecls(), *this );
[dc2e7e0]326        mutateAll( impCpCtorExpr->get_returnDecls(), *this );
[db4ecc5]327        return impCpCtorExpr;
328}
329
[b6fe7e6]330Expression* Mutator::mutate( ConstructorExpr *ctorExpr ) {
331        mutateAll( ctorExpr->get_results(), *this );
332        ctorExpr->set_callExpr( maybeMutate( ctorExpr->get_callExpr(), *this ) );
333        return ctorExpr;
[51b7345]334}
335
[630a82a]336Expression *Mutator::mutate( CompoundLiteralExpr *compLitExpr ) {
337        mutateAll( compLitExpr->get_results(), *this );
338        compLitExpr->set_type( maybeMutate( compLitExpr->get_type(), *this ) );
339        compLitExpr->set_initializer( maybeMutate( compLitExpr->get_initializer(), *this ) );
340        return compLitExpr;
341}
342
[b6fe7e6]343Expression *Mutator::mutate( UntypedValofExpr *valofExpr ) {
344        mutateAll( valofExpr->get_results(), *this );
345        return valofExpr;
346}
347
[8688ce1]348Expression *Mutator::mutate( RangeExpr *rangeExpr ) {
349        rangeExpr->set_low( maybeMutate( rangeExpr->get_low(), *this ) );
350        rangeExpr->set_high( maybeMutate( rangeExpr->get_high(), *this ) );
351        return rangeExpr;
352}
353
[6eb8948]354Expression *Mutator::mutate( TupleExpr *tupleExpr ) {
355        mutateAll( tupleExpr->get_results(), *this );
356        mutateAll( tupleExpr->get_exprs(), *this );
357        return tupleExpr;
358}
359
[3b58d91]360Expression *Mutator::mutate( TupleIndexExpr *tupleExpr ) {
361        mutateAll( tupleExpr->get_results(), *this );
362        tupleExpr->set_tuple( maybeMutate( tupleExpr->get_tuple(), *this ) );
363        return tupleExpr;
364}
365
366Expression *Mutator::mutate( MemberTupleExpr *tupleExpr ) {
367        mutateAll( tupleExpr->get_results(), *this );
368        tupleExpr->set_member( maybeMutate( tupleExpr->get_member(), *this ) );
369        tupleExpr->set_aggregate( maybeMutate( tupleExpr->get_aggregate(), *this ) );
370        return tupleExpr;
371}
372
[6eb8948]373Expression *Mutator::mutate( TupleAssignExpr *assignExpr ) {
[3b58d91]374        mutateAll( assignExpr->get_results(), *this );
[6eb8948]375        mutateAll( assignExpr->get_tempDecls(), *this );
376        mutateAll( assignExpr->get_assigns(), *this );
[3b58d91]377        return assignExpr;
378}
379
[6eb8948]380Expression *Mutator::mutate( StmtExpr *stmtExpr ) {
381        mutateAll( stmtExpr->get_results(), *this );
382        stmtExpr->set_statements( maybeMutate( stmtExpr->get_statements(), *this ) );
383        return stmtExpr;
[3b58d91]384}
385
[d9a0e76]386Type *Mutator::mutate( VoidType *voidType ) {
[0dd3a2f]387        mutateAll( voidType->get_forall(), *this );
388        return voidType;
[51b7345]389}
390
[d9a0e76]391Type *Mutator::mutate( BasicType *basicType ) {
[0dd3a2f]392        mutateAll( basicType->get_forall(), *this );
393        return basicType;
[51b7345]394}
395
[d9a0e76]396Type *Mutator::mutate( PointerType *pointerType ) {
[0dd3a2f]397        mutateAll( pointerType->get_forall(), *this );
398        pointerType->set_base( maybeMutate( pointerType->get_base(), *this ) );
399        return pointerType;
[51b7345]400}
401
[d9a0e76]402Type *Mutator::mutate( ArrayType *arrayType ) {
[0dd3a2f]403        mutateAll( arrayType->get_forall(), *this );
404        arrayType->set_dimension( maybeMutate( arrayType->get_dimension(), *this ) );
405        arrayType->set_base( maybeMutate( arrayType->get_base(), *this ) );
406        return arrayType;
[51b7345]407}
408
[d9a0e76]409Type *Mutator::mutate( FunctionType *functionType ) {
[0dd3a2f]410        mutateAll( functionType->get_forall(), *this );
411        mutateAll( functionType->get_returnVals(), *this );
412        mutateAll( functionType->get_parameters(), *this );
413        return functionType;
[51b7345]414}
415
[d9a0e76]416Type *Mutator::handleReferenceToType( ReferenceToType *aggregateUseType ) {
[0dd3a2f]417        mutateAll( aggregateUseType->get_forall(), *this );
418        mutateAll( aggregateUseType->get_parameters(), *this );
419        return aggregateUseType;
[51b7345]420}
421
[d9a0e76]422Type *Mutator::mutate( StructInstType *aggregateUseType ) {
[0dd3a2f]423        handleReferenceToType( aggregateUseType );
424        return aggregateUseType;
[51b7345]425}
426
[d9a0e76]427Type *Mutator::mutate( UnionInstType *aggregateUseType ) {
[0dd3a2f]428        handleReferenceToType( aggregateUseType );
429        return aggregateUseType;
[51b7345]430}
431
[d9a0e76]432Type *Mutator::mutate( EnumInstType *aggregateUseType ) {
[0dd3a2f]433        handleReferenceToType( aggregateUseType );
434        return aggregateUseType;
[51b7345]435}
436
[4040425]437Type *Mutator::mutate( TraitInstType *aggregateUseType ) {
[0dd3a2f]438        handleReferenceToType( aggregateUseType );
439        mutateAll( aggregateUseType->get_members(), *this );
440        return aggregateUseType;
[51b7345]441}
442
[d9a0e76]443Type *Mutator::mutate( TypeInstType *aggregateUseType ) {
[0dd3a2f]444        handleReferenceToType( aggregateUseType );
445        return aggregateUseType;
[51b7345]446}
447
[d9a0e76]448Type *Mutator::mutate( TupleType *tupleType ) {
[0dd3a2f]449        mutateAll( tupleType->get_forall(), *this );
450        mutateAll( tupleType->get_types(), *this );
451        return tupleType;
[51b7345]452}
453
[d9a0e76]454Type *Mutator::mutate( TypeofType *typeofType ) {
[0dd3a2f]455        assert( typeofType->get_expr() );
456        typeofType->set_expr( typeofType->get_expr()->acceptMutator( *this ) );
457        return typeofType;
[51b7345]458}
459
[d9a0e76]460Type *Mutator::mutate( AttrType *attrType ) {
[0dd3a2f]461        if ( attrType->get_isType() ) {
462                assert( attrType->get_type() );
463                attrType->set_type( attrType->get_type()->acceptMutator( *this ) );
464        } else {
465                assert( attrType->get_expr() );
466                attrType->set_expr( attrType->get_expr()->acceptMutator( *this ) );
467        }
468        return attrType;
[51b7345]469}
470
[44b7088]471Type *Mutator::mutate( VarArgsType *varArgsType ) {
472        mutateAll( varArgsType->get_forall(), *this );
473        return varArgsType;
474}
475
[d9a0e76]476Initializer *Mutator::mutate( SingleInit *singleInit ) {
[0dd3a2f]477        singleInit->set_value( singleInit->get_value()->acceptMutator( *this ) );
478        return singleInit;
[51b7345]479}
480
[d9a0e76]481Initializer *Mutator::mutate( ListInit *listInit ) {
[0dd3a2f]482        mutateAll( listInit->get_designators(), *this );
483        mutateAll( listInit->get_initializers(), *this );
484        return listInit;
[51b7345]485}
486
[71f4e4f]487Initializer *Mutator::mutate( ConstructorInit *ctorInit ) {
488        ctorInit->set_ctor( maybeMutate( ctorInit->get_ctor(), *this ) );
489        ctorInit->set_init( maybeMutate( ctorInit->get_init(), *this ) );
490        return ctorInit;
491}
492
[d9a0e76]493Subrange *Mutator::mutate( Subrange *subrange ) {
[0dd3a2f]494        return subrange;
[51b7345]495}
496
[d9a0e76]497Constant *Mutator::mutate( Constant *constant ) {
[0dd3a2f]498        return constant;
[51b7345]499}
[0dd3a2f]500
501// Local Variables: //
502// tab-width: 4 //
503// mode: c++ //
504// compile-command: "make install" //
505// End: //
Note: See TracBrowser for help on using the repository browser.