Changeset d9a0e76 for translator/SynTree/Mutator.cc
- Timestamp:
- Dec 16, 2014, 9:41:50 PM (10 years ago)
- 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:
- 17cd4eb
- Parents:
- 3848e0e
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
translator/SynTree/Mutator.cc
r3848e0e rd9a0e76 1 /*2 * This file is part of the Cforall project3 *4 * $Id: Mutator.cc,v 1.30 2005/08/29 20:59:25 rcbilson Exp $5 *6 */7 8 1 #include <cassert> 9 2 #include "Mutator.h" … … 16 9 #include "utility.h" 17 10 18 Mutator::Mutator() 19 { 20 } 21 22 Mutator::~Mutator() 23 { 24 } 25 26 ObjectDecl* 27 Mutator::mutate(ObjectDecl *objectDecl) 28 { 11 Mutator::Mutator() {} 12 13 Mutator::~Mutator() {} 14 15 ObjectDecl *Mutator::mutate( ObjectDecl *objectDecl ) { 29 16 objectDecl->set_type( maybeMutate( objectDecl->get_type(), *this ) ); 30 17 objectDecl->set_init( maybeMutate( objectDecl->get_init(), *this ) ); … … 33 20 } 34 21 35 DeclarationWithType* 36 Mutator::mutate(FunctionDecl *functionDecl) 37 { 22 DeclarationWithType *Mutator::mutate( FunctionDecl *functionDecl ) { 38 23 functionDecl->set_functionType( maybeMutate( functionDecl->get_functionType(), *this ) ); 39 24 mutateAll( functionDecl->get_oldDecls(), *this ); … … 42 27 } 43 28 44 Declaration* 45 Mutator::handleAggregateDecl(AggregateDecl *aggregateDecl) 46 { 29 Declaration *Mutator::handleAggregateDecl( AggregateDecl *aggregateDecl ) { 47 30 mutateAll( aggregateDecl->get_parameters(), *this ); 48 31 mutateAll( aggregateDecl->get_members(), *this ); … … 50 33 } 51 34 52 Declaration* 53 Mutator::mutate(StructDecl *aggregateDecl) 54 { 35 Declaration *Mutator::mutate( StructDecl *aggregateDecl ) { 55 36 handleAggregateDecl( aggregateDecl ); 56 37 return aggregateDecl; 57 38 } 58 39 59 Declaration* 60 Mutator::mutate(UnionDecl *aggregateDecl) 61 { 40 Declaration *Mutator::mutate( UnionDecl *aggregateDecl ) { 62 41 handleAggregateDecl( aggregateDecl ); 63 42 return aggregateDecl; 64 43 } 65 44 66 Declaration* 67 Mutator::mutate(EnumDecl *aggregateDecl) 68 { 45 Declaration *Mutator::mutate( EnumDecl *aggregateDecl ) { 69 46 handleAggregateDecl( aggregateDecl ); 70 47 return aggregateDecl; 71 48 } 72 49 73 Declaration* 74 Mutator::mutate(ContextDecl *aggregateDecl) 75 { 50 Declaration *Mutator::mutate( ContextDecl *aggregateDecl ) { 76 51 handleAggregateDecl( aggregateDecl ); 77 52 return aggregateDecl; 78 53 } 79 54 80 Declaration* 81 Mutator::handleNamedTypeDecl(NamedTypeDecl *typeDecl) 82 { 55 Declaration *Mutator::handleNamedTypeDecl( NamedTypeDecl *typeDecl ) { 83 56 mutateAll( typeDecl->get_parameters(), *this ); 84 57 mutateAll( typeDecl->get_assertions(), *this ); … … 87 60 } 88 61 89 TypeDecl* 90 Mutator::mutate(TypeDecl *typeDecl) 91 { 62 TypeDecl *Mutator::mutate( TypeDecl *typeDecl ) { 92 63 handleNamedTypeDecl( typeDecl ); 93 64 return typeDecl; 94 65 } 95 66 96 Declaration* 97 Mutator::mutate(TypedefDecl *typeDecl) 98 { 67 Declaration *Mutator::mutate( TypedefDecl *typeDecl ) { 99 68 handleNamedTypeDecl( typeDecl ); 100 69 return typeDecl; 101 70 } 102 71 103 CompoundStmt* 104 Mutator::mutate(CompoundStmt *compoundStmt) 105 { 72 CompoundStmt *Mutator::mutate( CompoundStmt *compoundStmt ) { 106 73 mutateAll( compoundStmt->get_kids(), *this ); 107 74 return compoundStmt; 108 75 } 109 76 110 Statement* 111 Mutator::mutate(ExprStmt *exprStmt) 112 { 77 Statement *Mutator::mutate( ExprStmt *exprStmt ) { 113 78 exprStmt->set_expr( maybeMutate( exprStmt->get_expr(), *this ) ); 114 79 return exprStmt; 115 80 } 116 81 117 Statement* 118 Mutator::mutate(IfStmt *ifStmt) 119 { 120 ifStmt->set_condition( maybeMutate( ifStmt->get_condition(), *this ) ); 121 ifStmt->set_thenPart( maybeMutate( ifStmt->get_thenPart(), *this ) ); 122 ifStmt->set_elsePart( maybeMutate( ifStmt->get_elsePart(), *this ) ); 82 Statement *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 ) ); 123 86 return ifStmt; 124 87 } 125 88 126 Statement* 127 Mutator::mutate(WhileStmt *whileStmt) 128 { 129 whileStmt->set_condition( maybeMutate( whileStmt->get_condition(), *this ) ); 130 whileStmt->set_body( maybeMutate( whileStmt->get_body(), *this ) ); 89 Statement *Mutator::mutate( WhileStmt *whileStmt ) { 90 whileStmt->set_condition( maybeMutate( whileStmt->get_condition(), *this ) ); 91 whileStmt->set_body( maybeMutate( whileStmt->get_body(), *this ) ); 131 92 return whileStmt; 132 93 } 133 94 134 Statement* 135 Mutator::mutate(ForStmt *forStmt) 136 { 137 forStmt->set_initialization( maybeMutate( forStmt->get_initialization(), *this ) ); 138 forStmt->set_condition( maybeMutate( forStmt->get_condition(), *this ) ); 139 forStmt->set_increment( maybeMutate( forStmt->get_increment(), *this ) ); 140 forStmt->set_body( maybeMutate( forStmt->get_body(), *this ) ); 95 Statement *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 ) ); 141 100 return forStmt; 142 101 } 143 102 144 Statement* 145 Mutator::mutate(SwitchStmt *switchStmt) 146 { 103 Statement *Mutator::mutate( SwitchStmt *switchStmt ) { 147 104 switchStmt->set_condition( maybeMutate( switchStmt->get_condition(), *this ) ); 148 105 mutateAll( switchStmt->get_branches(), *this ); … … 150 107 } 151 108 152 Statement* 153 Mutator::mutate(ChooseStmt *switchStmt) 154 { 155 switchStmt->set_condition( maybeMutate( switchStmt->get_condition(), *this ) ); 109 Statement *Mutator::mutate( ChooseStmt *switchStmt ) { 110 switchStmt->set_condition( maybeMutate( switchStmt->get_condition(), *this ) ); 156 111 mutateAll( switchStmt->get_branches(), *this ); 157 112 return switchStmt; 158 113 } 159 114 160 Statement* 161 Mutator::mutate(FallthruStmt *fallthruStmt) 162 { 115 Statement *Mutator::mutate( FallthruStmt *fallthruStmt ) { 163 116 return fallthruStmt; 164 117 } 165 118 166 Statement* 167 Mutator::mutate(CaseStmt *caseStmt) 168 { 169 caseStmt->set_condition( maybeMutate( caseStmt->get_condition(), *this ) ); 119 Statement *Mutator::mutate( CaseStmt *caseStmt ) { 120 caseStmt->set_condition( maybeMutate( caseStmt->get_condition(), *this ) ); 170 121 mutateAll (caseStmt->get_statements(), *this ); 171 122 … … 173 124 } 174 125 175 Statement* 176 Mutator::mutate(BranchStmt *branchStmt) 177 { 126 Statement *Mutator::mutate( BranchStmt *branchStmt ) { 178 127 return branchStmt; 179 128 } 180 129 181 Statement* 182 Mutator::mutate(ReturnStmt *returnStmt) 183 { 184 returnStmt->set_expr( maybeMutate( returnStmt->get_expr(), *this ) ); 130 Statement *Mutator::mutate( ReturnStmt *returnStmt ) { 131 returnStmt->set_expr( maybeMutate( returnStmt->get_expr(), *this ) ); 185 132 return returnStmt; 186 133 } 187 134 188 Statement* 189 Mutator::mutate(TryStmt *tryStmt) 190 { 135 Statement *Mutator::mutate( TryStmt *tryStmt ) { 191 136 tryStmt->set_block( maybeMutate( tryStmt->get_block(), *this ) ); 192 137 mutateAll( tryStmt->get_catchers(), *this ); … … 194 139 } 195 140 196 Statement* 197 Mutator::mutate(CatchStmt *catchStmt) 198 { 141 Statement *Mutator::mutate( CatchStmt *catchStmt ) { 199 142 catchStmt->set_decl( maybeMutate( catchStmt->get_decl(), *this ) ); 200 143 catchStmt->set_body( maybeMutate( catchStmt->get_body(), *this ) ); … … 202 145 } 203 146 204 Statement* 205 Mutator::mutate(FinallyStmt *finalStmt) 206 { 147 Statement *Mutator::mutate( FinallyStmt *finalStmt ) { 207 148 finalStmt->set_block( maybeMutate( finalStmt->get_block(), *this ) ); 208 149 return finalStmt; 209 150 } 210 151 211 NullStmt* 212 Mutator::mutate(NullStmt *nullStmt) 213 { 152 NullStmt *Mutator::mutate( NullStmt *nullStmt ) { 214 153 return nullStmt; 215 154 } 216 155 217 Statement* 218 Mutator::mutate(DeclStmt *declStmt) 219 { 156 Statement *Mutator::mutate( DeclStmt *declStmt ) { 220 157 declStmt->set_decl( maybeMutate( declStmt->get_decl(), *this ) ); 221 158 return declStmt; 222 159 } 223 160 224 Expression* 225 Mutator::mutate(ApplicationExpr *applicationExpr) 226 { 161 Expression *Mutator::mutate( ApplicationExpr *applicationExpr ) { 227 162 mutateAll( applicationExpr->get_results(), *this ); 228 applicationExpr->set_function( 163 applicationExpr->set_function( maybeMutate( applicationExpr->get_function(), *this ) ); 229 164 mutateAll( applicationExpr->get_args(), *this ); 230 165 return applicationExpr; 231 166 } 232 167 233 Expression* 234 Mutator::mutate(UntypedExpr *untypedExpr) 235 { 168 Expression *Mutator::mutate( UntypedExpr *untypedExpr ) { 236 169 mutateAll( untypedExpr->get_results(), *this ); 237 170 mutateAll( untypedExpr->get_args(), *this ); … … 239 172 } 240 173 241 Expression* 242 Mutator::mutate(NameExpr *nameExpr) 243 { 174 Expression *Mutator::mutate( NameExpr *nameExpr ) { 244 175 mutateAll( nameExpr->get_results(), *this ); 245 176 return nameExpr; 246 177 } 247 178 248 Expression* 249 Mutator::mutate(AddressExpr *addressExpr) 250 { 179 Expression *Mutator::mutate( AddressExpr *addressExpr ) { 251 180 mutateAll( addressExpr->get_results(), *this ); 252 addressExpr->set_arg( 181 addressExpr->set_arg( maybeMutate( addressExpr->get_arg(), *this ) ); 253 182 return addressExpr; 254 183 } 255 184 256 Expression* 257 Mutator::mutate(LabelAddressExpr *labelAddressExpr) 258 { 185 Expression *Mutator::mutate( LabelAddressExpr *labelAddressExpr ) { 259 186 mutateAll( labelAddressExpr->get_results(), *this ); 260 labelAddressExpr->set_arg( 187 labelAddressExpr->set_arg( maybeMutate( labelAddressExpr->get_arg(), *this ) ); 261 188 return labelAddressExpr; 262 189 } 263 190 264 Expression* 265 Mutator::mutate(CastExpr *castExpr) 266 { 191 Expression *Mutator::mutate( CastExpr *castExpr ) { 267 192 mutateAll( castExpr->get_results(), *this ); 268 castExpr->set_arg( 193 castExpr->set_arg( maybeMutate( castExpr->get_arg(), *this ) ); 269 194 return castExpr; 270 195 } 271 196 272 Expression* 273 Mutator::mutate(UntypedMemberExpr *memberExpr) 274 { 197 Expression *Mutator::mutate( UntypedMemberExpr *memberExpr ) { 275 198 mutateAll( memberExpr->get_results(), *this ); 276 memberExpr->set_aggregate( 199 memberExpr->set_aggregate( maybeMutate( memberExpr->get_aggregate(), *this ) ); 277 200 return memberExpr; 278 201 } 279 202 280 Expression* 281 Mutator::mutate(MemberExpr *memberExpr) 282 { 203 Expression *Mutator::mutate( MemberExpr *memberExpr ) { 283 204 mutateAll( memberExpr->get_results(), *this ); 284 memberExpr->set_aggregate( 205 memberExpr->set_aggregate( maybeMutate( memberExpr->get_aggregate(), *this ) ); 285 206 return memberExpr; 286 207 } 287 208 288 Expression* 289 Mutator::mutate(VariableExpr *variableExpr) 290 { 209 Expression *Mutator::mutate( VariableExpr *variableExpr ) { 291 210 mutateAll( variableExpr->get_results(), *this ); 292 211 return variableExpr; 293 212 } 294 213 295 Expression* 296 Mutator::mutate(ConstantExpr *constantExpr) 297 { 214 Expression *Mutator::mutate( ConstantExpr *constantExpr ) { 298 215 mutateAll( constantExpr->get_results(), *this ); 299 216 // maybeMutate( constantExpr->get_constant(), *this ) … … 301 218 } 302 219 303 Expression* 304 Mutator::mutate(SizeofExpr *sizeofExpr) 305 { 220 Expression *Mutator::mutate( SizeofExpr *sizeofExpr ) { 306 221 mutateAll( sizeofExpr->get_results(), *this ); 307 if ( sizeofExpr->get_isType() ) {308 sizeofExpr->set_type( 222 if ( sizeofExpr->get_isType() ) { 223 sizeofExpr->set_type( maybeMutate( sizeofExpr->get_type(), *this ) ); 309 224 } else { 310 sizeofExpr->set_expr( 225 sizeofExpr->set_expr( maybeMutate( sizeofExpr->get_expr(), *this ) ); 311 226 } 312 227 return sizeofExpr; 313 228 } 314 229 315 Expression* 316 Mutator::mutate(AttrExpr *attrExpr) 317 { 230 Expression *Mutator::mutate( AttrExpr *attrExpr ) { 318 231 mutateAll( attrExpr->get_results(), *this ); 319 if ( attrExpr->get_isType() ) {320 attrExpr->set_type( 232 if ( attrExpr->get_isType() ) { 233 attrExpr->set_type( maybeMutate( attrExpr->get_type(), *this ) ); 321 234 } else { 322 attrExpr->set_expr( 235 attrExpr->set_expr( maybeMutate( attrExpr->get_expr(), *this ) ); 323 236 } 324 237 return attrExpr; 325 238 } 326 239 327 Expression* 328 Mutator::mutate(LogicalExpr *logicalExpr) 329 { 240 Expression *Mutator::mutate( LogicalExpr *logicalExpr ) { 330 241 mutateAll( logicalExpr->get_results(), *this ); 331 logicalExpr->set_arg1( 332 logicalExpr->set_arg2( 242 logicalExpr->set_arg1( maybeMutate( logicalExpr->get_arg1(), *this ) ); 243 logicalExpr->set_arg2( maybeMutate( logicalExpr->get_arg2(), *this ) ); 333 244 return logicalExpr; 334 245 } 335 246 336 Expression* 337 Mutator::mutate(ConditionalExpr *conditionalExpr) 338 { 247 Expression *Mutator::mutate( ConditionalExpr *conditionalExpr ) { 339 248 mutateAll( conditionalExpr->get_results(), *this ); 340 conditionalExpr->set_arg1( 341 conditionalExpr->set_arg2( 342 conditionalExpr->set_arg3( 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 ) ); 343 252 return conditionalExpr; 344 253 } 345 254 346 Expression* 347 Mutator::mutate(CommaExpr *commaExpr) 348 { 255 Expression *Mutator::mutate( CommaExpr *commaExpr ) { 349 256 mutateAll( commaExpr->get_results(), *this ); 350 commaExpr->set_arg1( 351 commaExpr->set_arg2( 257 commaExpr->set_arg1( maybeMutate( commaExpr->get_arg1(), *this ) ); 258 commaExpr->set_arg2( maybeMutate( commaExpr->get_arg2(), *this ) ); 352 259 return commaExpr; 353 260 } 354 261 355 Expression* 356 Mutator::mutate(TupleExpr *tupleExpr) 357 { 262 Expression *Mutator::mutate( TupleExpr *tupleExpr ) { 358 263 mutateAll( tupleExpr->get_results(), *this ); 359 264 mutateAll( tupleExpr->get_exprs(), *this ); … … 361 266 } 362 267 363 Expression* 364 Mutator::mutate(SolvedTupleExpr *tupleExpr) 365 { 268 Expression *Mutator::mutate( SolvedTupleExpr *tupleExpr ) { 366 269 mutateAll( tupleExpr->get_results(), *this ); 367 270 mutateAll( tupleExpr->get_exprs(), *this ); … … 369 272 } 370 273 371 Expression* 372 Mutator::mutate(TypeExpr *typeExpr) 373 { 274 Expression *Mutator::mutate( TypeExpr *typeExpr ) { 374 275 mutateAll( typeExpr->get_results(), *this ); 375 276 typeExpr->set_type( maybeMutate( typeExpr->get_type(), *this ) ); … … 377 278 } 378 279 379 Expression* 380 Mutator::mutate(UntypedValofExpr *valofExpr) 381 { 280 Expression *Mutator::mutate( UntypedValofExpr *valofExpr ) { 382 281 mutateAll( valofExpr->get_results(), *this ); 383 282 return valofExpr; 384 283 } 385 284 386 Type* 387 Mutator::mutate(VoidType *voidType) 388 { 285 Type *Mutator::mutate( VoidType *voidType ) { 389 286 mutateAll( voidType->get_forall(), *this ); 390 287 return voidType; 391 288 } 392 289 393 Type* 394 Mutator::mutate(BasicType *basicType) 395 { 290 Type *Mutator::mutate( BasicType *basicType ) { 396 291 mutateAll( basicType->get_forall(), *this ); 397 292 return basicType; 398 293 } 399 294 400 Type* 401 Mutator::mutate(PointerType *pointerType) 402 { 295 Type *Mutator::mutate( PointerType *pointerType ) { 403 296 mutateAll( pointerType->get_forall(), *this ); 404 297 pointerType->set_base( maybeMutate( pointerType->get_base(), *this ) ); … … 406 299 } 407 300 408 Type* 409 Mutator::mutate(ArrayType *arrayType) 410 { 301 Type *Mutator::mutate( ArrayType *arrayType ) { 411 302 mutateAll( arrayType->get_forall(), *this ); 412 303 arrayType->set_dimension( maybeMutate( arrayType->get_dimension(), *this ) ); … … 415 306 } 416 307 417 Type* 418 Mutator::mutate(FunctionType *functionType) 419 { 308 Type *Mutator::mutate( FunctionType *functionType ) { 420 309 mutateAll( functionType->get_forall(), *this ); 421 310 mutateAll( functionType->get_returnVals(), *this ); … … 424 313 } 425 314 426 Type* 427 Mutator::handleReferenceToType(ReferenceToType *aggregateUseType) 428 { 315 Type *Mutator::handleReferenceToType( ReferenceToType *aggregateUseType ) { 429 316 mutateAll( aggregateUseType->get_forall(), *this ); 430 317 mutateAll( aggregateUseType->get_parameters(), *this ); … … 432 319 } 433 320 434 Type* 435 Mutator::mutate(StructInstType *aggregateUseType) 436 { 437 handleReferenceToType( aggregateUseType ); 438 return aggregateUseType; 439 } 440 441 Type* 442 Mutator::mutate(UnionInstType *aggregateUseType) 443 { 444 handleReferenceToType( aggregateUseType ); 445 return aggregateUseType; 446 } 447 448 Type* 449 Mutator::mutate(EnumInstType *aggregateUseType) 450 { 451 handleReferenceToType( aggregateUseType ); 452 return aggregateUseType; 453 } 454 455 Type* 456 Mutator::mutate(ContextInstType *aggregateUseType) 457 { 321 Type *Mutator::mutate( StructInstType *aggregateUseType ) { 322 handleReferenceToType( aggregateUseType ); 323 return aggregateUseType; 324 } 325 326 Type *Mutator::mutate( UnionInstType *aggregateUseType ) { 327 handleReferenceToType( aggregateUseType ); 328 return aggregateUseType; 329 } 330 331 Type *Mutator::mutate( EnumInstType *aggregateUseType ) { 332 handleReferenceToType( aggregateUseType ); 333 return aggregateUseType; 334 } 335 336 Type *Mutator::mutate( ContextInstType *aggregateUseType ) { 458 337 handleReferenceToType( aggregateUseType ); 459 338 mutateAll( aggregateUseType->get_members(), *this ); … … 461 340 } 462 341 463 Type* 464 Mutator::mutate(TypeInstType *aggregateUseType) 465 { 466 handleReferenceToType( aggregateUseType ); 467 return aggregateUseType; 468 } 469 470 Type* 471 Mutator::mutate(TupleType *tupleType) 472 { 342 Type *Mutator::mutate( TypeInstType *aggregateUseType ) { 343 handleReferenceToType( aggregateUseType ); 344 return aggregateUseType; 345 } 346 347 Type *Mutator::mutate( TupleType *tupleType ) { 473 348 mutateAll( tupleType->get_forall(), *this ); 474 349 mutateAll( tupleType->get_types(), *this ); … … 476 351 } 477 352 478 Type* 479 Mutator::mutate(TypeofType *typeofType) 480 { 353 Type *Mutator::mutate( TypeofType *typeofType ) { 481 354 assert( typeofType->get_expr() ); 482 355 typeofType->set_expr( typeofType->get_expr()->acceptMutator( *this ) ); … … 484 357 } 485 358 486 Type* 487 Mutator::mutate(AttrType *attrType) 488 { 489 if( attrType->get_isType() ) { 359 Type *Mutator::mutate( AttrType *attrType ) { 360 if ( attrType->get_isType() ) { 490 361 assert( attrType->get_type() ); 491 362 attrType->set_type( attrType->get_type()->acceptMutator( *this ) ); … … 497 368 } 498 369 499 Initializer* 500 Mutator::mutate(MemberInit *memberInit) 501 { 370 Initializer *Mutator::mutate( MemberInit *memberInit ) { 502 371 memberInit->set_value( memberInit->get_value()->acceptMutator( *this ) ); 503 372 return memberInit; 504 373 } 505 374 506 Initializer* 507 Mutator::mutate(ElementInit *elementInit) 508 { 375 Initializer *Mutator::mutate( ElementInit *elementInit ) { 509 376 elementInit->set_value( elementInit->get_value()->acceptMutator( *this ) ); 510 377 return elementInit; 511 378 } 512 379 513 Initializer* 514 Mutator::mutate(SingleInit *singleInit) 515 { 380 Initializer *Mutator::mutate( SingleInit *singleInit ) { 516 381 singleInit->set_value( singleInit->get_value()->acceptMutator( *this ) ); 517 382 return singleInit; 518 383 } 519 384 520 Initializer* 521 Mutator::mutate(ListInit *listInit) 522 { 385 Initializer *Mutator::mutate( ListInit *listInit ) { 523 386 mutateAll( listInit->get_designators(), *this ); 524 387 mutateAll( listInit->get_initializers(), *this ); … … 526 389 } 527 390 528 Subrange * 529 Mutator::mutate(Subrange *subrange) 530 { 391 Subrange *Mutator::mutate( Subrange *subrange ) { 531 392 return subrange; 532 393 } 533 394 534 Constant * 535 Mutator::mutate(Constant *constant) 536 { 395 Constant *Mutator::mutate( Constant *constant ) { 537 396 return constant; 538 397 } 539
Note: See TracChangeset
for help on using the changeset viewer.