Changes in src/SynTree/Mutator.cc [135b431:6d49ea3]
- File:
-
- 1 edited
-
src/SynTree/Mutator.cc (modified) (60 diffs)
Legend:
- Unmodified
- Added
- Removed
-
src/SynTree/Mutator.cc
r135b431 r6d49ea3 32 32 Mutator::~Mutator() {} 33 33 34 DeclarationWithType * Mutator::mutate( ObjectDecl *objectDecl ) {34 DeclarationWithType *Mutator::mutate( ObjectDecl *objectDecl ) { 35 35 objectDecl->set_type( maybeMutate( objectDecl->get_type(), *this ) ); 36 36 objectDecl->set_init( maybeMutate( objectDecl->get_init(), *this ) ); … … 39 39 } 40 40 41 DeclarationWithType * Mutator::mutate( FunctionDecl *functionDecl ) {41 DeclarationWithType *Mutator::mutate( FunctionDecl *functionDecl ) { 42 42 functionDecl->set_functionType( maybeMutate( functionDecl->get_functionType(), *this ) ); 43 43 functionDecl->set_statements( maybeMutate( functionDecl->get_statements(), *this ) ); … … 45 45 } 46 46 47 Declaration * Mutator::handleAggregateDecl( AggregateDecl *aggregateDecl ) {47 Declaration *Mutator::handleAggregateDecl( AggregateDecl *aggregateDecl ) { 48 48 mutateAll( aggregateDecl->get_parameters(), *this ); 49 49 mutateAll( aggregateDecl->get_members(), *this ); … … 51 51 } 52 52 53 Declaration * Mutator::mutate( StructDecl *aggregateDecl ) {53 Declaration *Mutator::mutate( StructDecl *aggregateDecl ) { 54 54 handleAggregateDecl( aggregateDecl ); 55 55 return aggregateDecl; 56 56 } 57 57 58 Declaration * Mutator::mutate( UnionDecl *aggregateDecl ) {58 Declaration *Mutator::mutate( UnionDecl *aggregateDecl ) { 59 59 handleAggregateDecl( aggregateDecl ); 60 60 return aggregateDecl; 61 61 } 62 62 63 Declaration * Mutator::mutate( EnumDecl *aggregateDecl ) {63 Declaration *Mutator::mutate( EnumDecl *aggregateDecl ) { 64 64 handleAggregateDecl( aggregateDecl ); 65 65 return aggregateDecl; 66 66 } 67 67 68 Declaration * Mutator::mutate( TraitDecl *aggregateDecl ) {68 Declaration *Mutator::mutate( TraitDecl *aggregateDecl ) { 69 69 handleAggregateDecl( aggregateDecl ); 70 70 return aggregateDecl; 71 71 } 72 72 73 Declaration * Mutator::handleNamedTypeDecl( NamedTypeDecl *typeDecl ) {73 Declaration *Mutator::handleNamedTypeDecl( NamedTypeDecl *typeDecl ) { 74 74 mutateAll( typeDecl->get_parameters(), *this ); 75 75 mutateAll( typeDecl->get_assertions(), *this ); … … 78 78 } 79 79 80 TypeDecl * Mutator::mutate( TypeDecl *typeDecl ) {80 TypeDecl *Mutator::mutate( TypeDecl *typeDecl ) { 81 81 handleNamedTypeDecl( typeDecl ); 82 82 typeDecl->set_init( maybeMutate( typeDecl->get_init(), *this ) ); … … 84 84 } 85 85 86 Declaration * Mutator::mutate( TypedefDecl *typeDecl ) {86 Declaration *Mutator::mutate( TypedefDecl *typeDecl ) { 87 87 handleNamedTypeDecl( typeDecl ); 88 88 return typeDecl; 89 89 } 90 90 91 AsmDecl * Mutator::mutate( AsmDecl *asmDecl ) {91 AsmDecl *Mutator::mutate( AsmDecl *asmDecl ) { 92 92 asmDecl->set_stmt( maybeMutate( asmDecl->get_stmt(), *this ) ); 93 93 return asmDecl; … … 95 95 96 96 97 CompoundStmt * Mutator::mutate( CompoundStmt *compoundStmt ) {97 CompoundStmt *Mutator::mutate( CompoundStmt *compoundStmt ) { 98 98 mutateAll( compoundStmt->get_kids(), *this ); 99 99 return compoundStmt; 100 100 } 101 101 102 Statement * Mutator::mutate( ExprStmt *exprStmt ) {102 Statement *Mutator::mutate( ExprStmt *exprStmt ) { 103 103 exprStmt->set_expr( maybeMutate( exprStmt->get_expr(), *this ) ); 104 104 return exprStmt; 105 105 } 106 106 107 Statement * Mutator::mutate( AsmStmt *asmStmt ) {107 Statement *Mutator::mutate( AsmStmt *asmStmt ) { 108 108 asmStmt->set_instruction( maybeMutate( asmStmt->get_instruction(), *this ) ); 109 109 mutateAll( asmStmt->get_output(), *this ); … … 113 113 } 114 114 115 Statement * Mutator::mutate( IfStmt *ifStmt ) {115 Statement *Mutator::mutate( IfStmt *ifStmt ) { 116 116 mutateAll( ifStmt->get_initialization(), *this ); 117 117 ifStmt->set_condition( maybeMutate( ifStmt->get_condition(), *this ) ); … … 121 121 } 122 122 123 Statement * Mutator::mutate( WhileStmt *whileStmt ) {123 Statement *Mutator::mutate( WhileStmt *whileStmt ) { 124 124 whileStmt->set_condition( maybeMutate( whileStmt->get_condition(), *this ) ); 125 125 whileStmt->set_body( maybeMutate( whileStmt->get_body(), *this ) ); … … 127 127 } 128 128 129 Statement * Mutator::mutate( ForStmt *forStmt ) {129 Statement *Mutator::mutate( ForStmt *forStmt ) { 130 130 mutateAll( forStmt->get_initialization(), *this ); 131 131 forStmt->set_condition( maybeMutate( forStmt->get_condition(), *this ) ); … … 135 135 } 136 136 137 Statement * Mutator::mutate( SwitchStmt *switchStmt ) {137 Statement *Mutator::mutate( SwitchStmt *switchStmt ) { 138 138 switchStmt->set_condition( maybeMutate( switchStmt->get_condition(), *this ) ); 139 139 mutateAll( switchStmt->get_statements(), *this ); … … 141 141 } 142 142 143 Statement * Mutator::mutate( CaseStmt *caseStmt ) {143 Statement *Mutator::mutate( CaseStmt *caseStmt ) { 144 144 caseStmt->set_condition( maybeMutate( caseStmt->get_condition(), *this ) ); 145 145 mutateAll (caseStmt->get_statements(), *this ); … … 148 148 } 149 149 150 Statement * Mutator::mutate( BranchStmt *branchStmt ) {150 Statement *Mutator::mutate( BranchStmt *branchStmt ) { 151 151 return branchStmt; 152 152 } 153 153 154 Statement * Mutator::mutate( ReturnStmt *returnStmt ) {154 Statement *Mutator::mutate( ReturnStmt *returnStmt ) { 155 155 returnStmt->set_expr( maybeMutate( returnStmt->get_expr(), *this ) ); 156 156 return returnStmt; 157 157 } 158 158 159 Statement * Mutator::mutate( ThrowStmt *throwStmt ) {159 Statement *Mutator::mutate( ThrowStmt *throwStmt ) { 160 160 throwStmt->set_expr( maybeMutate( throwStmt->get_expr(), *this ) ); 161 161 throwStmt->set_target( maybeMutate( throwStmt->get_target(), *this ) ); … … 163 163 } 164 164 165 Statement * Mutator::mutate( TryStmt *tryStmt ) {165 Statement *Mutator::mutate( TryStmt *tryStmt ) { 166 166 tryStmt->set_block( maybeMutate( tryStmt->get_block(), *this ) ); 167 167 mutateAll( tryStmt->get_catchers(), *this ); … … 170 170 } 171 171 172 Statement * Mutator::mutate( CatchStmt *catchStmt ) {172 Statement *Mutator::mutate( CatchStmt *catchStmt ) { 173 173 catchStmt->set_decl( maybeMutate( catchStmt->get_decl(), *this ) ); 174 174 catchStmt->set_cond( maybeMutate( catchStmt->get_cond(), *this ) ); … … 177 177 } 178 178 179 Statement * Mutator::mutate( FinallyStmt *finalStmt ) {179 Statement *Mutator::mutate( FinallyStmt *finalStmt ) { 180 180 finalStmt->set_block( maybeMutate( finalStmt->get_block(), *this ) ); 181 181 return finalStmt; 182 182 } 183 183 184 Statement * Mutator::mutate( WaitForStmt *waitforStmt ) { 185 for( auto & clause : waitforStmt->clauses ) { 186 clause.target.function = maybeMutate( clause.target.function, *this ); 187 mutateAll( clause.target.arguments, *this ); 188 189 clause.statement = maybeMutate( clause.statement, *this ); 190 clause.condition = maybeMutate( clause.condition, *this ); 191 } 192 193 waitforStmt->timeout.time = maybeMutate( waitforStmt->timeout.time, *this ); 194 waitforStmt->timeout.statement = maybeMutate( waitforStmt->timeout.statement, *this ); 195 waitforStmt->timeout.condition = maybeMutate( waitforStmt->timeout.condition, *this ); 196 waitforStmt->orelse.statement = maybeMutate( waitforStmt->orelse.statement, *this ); 197 waitforStmt->orelse.condition = maybeMutate( waitforStmt->orelse.condition, *this ); 198 199 return waitforStmt; 200 } 201 202 NullStmt * Mutator::mutate( NullStmt *nullStmt ) { 184 NullStmt *Mutator::mutate( NullStmt *nullStmt ) { 203 185 return nullStmt; 204 186 } 205 187 206 Statement * Mutator::mutate( DeclStmt *declStmt ) {188 Statement *Mutator::mutate( DeclStmt *declStmt ) { 207 189 declStmt->set_decl( maybeMutate( declStmt->get_decl(), *this ) ); 208 190 return declStmt; 209 191 } 210 192 211 Statement * Mutator::mutate( ImplicitCtorDtorStmt *impCtorDtorStmt ) {193 Statement *Mutator::mutate( ImplicitCtorDtorStmt *impCtorDtorStmt ) { 212 194 impCtorDtorStmt->set_callStmt( maybeMutate( impCtorDtorStmt->get_callStmt(), *this ) ); 213 195 return impCtorDtorStmt; … … 215 197 216 198 217 Expression * Mutator::mutate( ApplicationExpr *applicationExpr ) {199 Expression *Mutator::mutate( ApplicationExpr *applicationExpr ) { 218 200 applicationExpr->set_env( maybeMutate( applicationExpr->get_env(), *this ) ); 219 201 applicationExpr->set_result( maybeMutate( applicationExpr->get_result(), *this ) ); … … 223 205 } 224 206 225 Expression * Mutator::mutate( UntypedExpr *untypedExpr ) {207 Expression *Mutator::mutate( UntypedExpr *untypedExpr ) { 226 208 untypedExpr->set_env( maybeMutate( untypedExpr->get_env(), *this ) ); 227 209 untypedExpr->set_result( maybeMutate( untypedExpr->get_result(), *this ) ); … … 230 212 } 231 213 232 Expression * Mutator::mutate( NameExpr *nameExpr ) {214 Expression *Mutator::mutate( NameExpr *nameExpr ) { 233 215 nameExpr->set_env( maybeMutate( nameExpr->get_env(), *this ) ); 234 216 nameExpr->set_result( maybeMutate( nameExpr->get_result(), *this ) ); … … 236 218 } 237 219 238 Expression * Mutator::mutate( AddressExpr *addressExpr ) {220 Expression *Mutator::mutate( AddressExpr *addressExpr ) { 239 221 addressExpr->set_env( maybeMutate( addressExpr->get_env(), *this ) ); 240 222 addressExpr->set_result( maybeMutate( addressExpr->get_result(), *this ) ); … … 243 225 } 244 226 245 Expression * Mutator::mutate( LabelAddressExpr *labelAddressExpr ) {227 Expression *Mutator::mutate( LabelAddressExpr *labelAddressExpr ) { 246 228 labelAddressExpr->set_env( maybeMutate( labelAddressExpr->get_env(), *this ) ); 247 229 labelAddressExpr->set_result( maybeMutate( labelAddressExpr->get_result(), *this ) ); … … 250 232 } 251 233 252 Expression * Mutator::mutate( CastExpr *castExpr ) {234 Expression *Mutator::mutate( CastExpr *castExpr ) { 253 235 castExpr->set_env( maybeMutate( castExpr->get_env(), *this ) ); 254 236 castExpr->set_result( maybeMutate( castExpr->get_result(), *this ) ); … … 257 239 } 258 240 259 Expression * Mutator::mutate( VirtualCastExpr *castExpr ) {241 Expression *Mutator::mutate( VirtualCastExpr *castExpr ) { 260 242 castExpr->set_env( maybeMutate( castExpr->get_env(), *this ) ); 261 243 castExpr->set_result( maybeMutate( castExpr->get_result(), *this ) ); … … 264 246 } 265 247 266 Expression * Mutator::mutate( UntypedMemberExpr *memberExpr ) {248 Expression *Mutator::mutate( UntypedMemberExpr *memberExpr ) { 267 249 memberExpr->set_env( maybeMutate( memberExpr->get_env(), *this ) ); 268 250 memberExpr->set_result( maybeMutate( memberExpr->get_result(), *this ) ); … … 272 254 } 273 255 274 Expression * Mutator::mutate( MemberExpr *memberExpr ) {256 Expression *Mutator::mutate( MemberExpr *memberExpr ) { 275 257 memberExpr->set_env( maybeMutate( memberExpr->get_env(), *this ) ); 276 258 memberExpr->set_result( maybeMutate( memberExpr->get_result(), *this ) ); … … 279 261 } 280 262 281 Expression * Mutator::mutate( VariableExpr *variableExpr ) {263 Expression *Mutator::mutate( VariableExpr *variableExpr ) { 282 264 variableExpr->set_env( maybeMutate( variableExpr->get_env(), *this ) ); 283 265 variableExpr->set_result( maybeMutate( variableExpr->get_result(), *this ) ); … … 285 267 } 286 268 287 Expression * Mutator::mutate( ConstantExpr *constantExpr ) {269 Expression *Mutator::mutate( ConstantExpr *constantExpr ) { 288 270 constantExpr->set_env( maybeMutate( constantExpr->get_env(), *this ) ); 289 271 constantExpr->set_result( maybeMutate( constantExpr->get_result(), *this ) ); … … 292 274 } 293 275 294 Expression * Mutator::mutate( SizeofExpr *sizeofExpr ) {276 Expression *Mutator::mutate( SizeofExpr *sizeofExpr ) { 295 277 sizeofExpr->set_env( maybeMutate( sizeofExpr->get_env(), *this ) ); 296 278 sizeofExpr->set_result( maybeMutate( sizeofExpr->get_result(), *this ) ); … … 303 285 } 304 286 305 Expression * Mutator::mutate( AlignofExpr *alignofExpr ) {287 Expression *Mutator::mutate( AlignofExpr *alignofExpr ) { 306 288 alignofExpr->set_env( maybeMutate( alignofExpr->get_env(), *this ) ); 307 289 alignofExpr->set_result( maybeMutate( alignofExpr->get_result(), *this ) ); … … 314 296 } 315 297 316 Expression * Mutator::mutate( UntypedOffsetofExpr *offsetofExpr ) {298 Expression *Mutator::mutate( UntypedOffsetofExpr *offsetofExpr ) { 317 299 offsetofExpr->set_env( maybeMutate( offsetofExpr->get_env(), *this ) ); 318 300 offsetofExpr->set_result( maybeMutate( offsetofExpr->get_result(), *this ) ); … … 321 303 } 322 304 323 Expression * Mutator::mutate( OffsetofExpr *offsetofExpr ) {305 Expression *Mutator::mutate( OffsetofExpr *offsetofExpr ) { 324 306 offsetofExpr->set_env( maybeMutate( offsetofExpr->get_env(), *this ) ); 325 307 offsetofExpr->set_result( maybeMutate( offsetofExpr->get_result(), *this ) ); … … 329 311 } 330 312 331 Expression * Mutator::mutate( OffsetPackExpr *offsetPackExpr ) {313 Expression *Mutator::mutate( OffsetPackExpr *offsetPackExpr ) { 332 314 offsetPackExpr->set_env( maybeMutate( offsetPackExpr->get_env(), *this ) ); 333 315 offsetPackExpr->set_result( maybeMutate( offsetPackExpr->get_result(), *this ) ); … … 336 318 } 337 319 338 Expression * Mutator::mutate( AttrExpr *attrExpr ) {320 Expression *Mutator::mutate( AttrExpr *attrExpr ) { 339 321 attrExpr->set_env( maybeMutate( attrExpr->get_env(), *this ) ); 340 322 attrExpr->set_result( maybeMutate( attrExpr->get_result(), *this ) ); … … 347 329 } 348 330 349 Expression * Mutator::mutate( LogicalExpr *logicalExpr ) {331 Expression *Mutator::mutate( LogicalExpr *logicalExpr ) { 350 332 logicalExpr->set_env( maybeMutate( logicalExpr->get_env(), *this ) ); 351 333 logicalExpr->set_result( maybeMutate( logicalExpr->get_result(), *this ) ); … … 355 337 } 356 338 357 Expression * Mutator::mutate( ConditionalExpr *conditionalExpr ) {339 Expression *Mutator::mutate( ConditionalExpr *conditionalExpr ) { 358 340 conditionalExpr->set_env( maybeMutate( conditionalExpr->get_env(), *this ) ); 359 341 conditionalExpr->set_result( maybeMutate( conditionalExpr->get_result(), *this ) ); … … 364 346 } 365 347 366 Expression * Mutator::mutate( CommaExpr *commaExpr ) {348 Expression *Mutator::mutate( CommaExpr *commaExpr ) { 367 349 commaExpr->set_env( maybeMutate( commaExpr->get_env(), *this ) ); 368 350 commaExpr->set_result( maybeMutate( commaExpr->get_result(), *this ) ); … … 372 354 } 373 355 374 Expression * Mutator::mutate( TypeExpr *typeExpr ) {356 Expression *Mutator::mutate( TypeExpr *typeExpr ) { 375 357 typeExpr->set_env( maybeMutate( typeExpr->get_env(), *this ) ); 376 358 typeExpr->set_result( maybeMutate( typeExpr->get_result(), *this ) ); … … 379 361 } 380 362 381 Expression * Mutator::mutate( AsmExpr *asmExpr ) {363 Expression *Mutator::mutate( AsmExpr *asmExpr ) { 382 364 asmExpr->set_env( maybeMutate( asmExpr->get_env(), *this ) ); 383 365 asmExpr->set_inout( maybeMutate( asmExpr->get_inout(), *this ) ); … … 404 386 } 405 387 406 Expression * Mutator::mutate( CompoundLiteralExpr *compLitExpr ) {388 Expression *Mutator::mutate( CompoundLiteralExpr *compLitExpr ) { 407 389 compLitExpr->set_env( maybeMutate( compLitExpr->get_env(), *this ) ); 408 390 compLitExpr->set_result( maybeMutate( compLitExpr->get_result(), *this ) ); … … 411 393 } 412 394 413 Expression * Mutator::mutate( RangeExpr *rangeExpr ) {395 Expression *Mutator::mutate( RangeExpr *rangeExpr ) { 414 396 rangeExpr->set_env( maybeMutate( rangeExpr->get_env(), *this ) ); 415 397 rangeExpr->set_low( maybeMutate( rangeExpr->get_low(), *this ) ); … … 418 400 } 419 401 420 Expression * Mutator::mutate( UntypedTupleExpr *tupleExpr ) {402 Expression *Mutator::mutate( UntypedTupleExpr *tupleExpr ) { 421 403 tupleExpr->set_env( maybeMutate( tupleExpr->get_env(), *this ) ); 422 404 tupleExpr->set_result( maybeMutate( tupleExpr->get_result(), *this ) ); … … 425 407 } 426 408 427 Expression * Mutator::mutate( TupleExpr *tupleExpr ) {409 Expression *Mutator::mutate( TupleExpr *tupleExpr ) { 428 410 tupleExpr->set_env( maybeMutate( tupleExpr->get_env(), *this ) ); 429 411 tupleExpr->set_result( maybeMutate( tupleExpr->get_result(), *this ) ); … … 432 414 } 433 415 434 Expression * Mutator::mutate( TupleIndexExpr *tupleExpr ) {416 Expression *Mutator::mutate( TupleIndexExpr *tupleExpr ) { 435 417 tupleExpr->set_env( maybeMutate( tupleExpr->get_env(), *this ) ); 436 418 tupleExpr->set_result( maybeMutate( tupleExpr->get_result(), *this ) ); … … 439 421 } 440 422 441 Expression * Mutator::mutate( TupleAssignExpr *assignExpr ) {423 Expression *Mutator::mutate( TupleAssignExpr *assignExpr ) { 442 424 assignExpr->set_env( maybeMutate( assignExpr->get_env(), *this ) ); 443 425 assignExpr->set_result( maybeMutate( assignExpr->get_result(), *this ) ); … … 446 428 } 447 429 448 Expression * Mutator::mutate( StmtExpr *stmtExpr ) {430 Expression *Mutator::mutate( StmtExpr *stmtExpr ) { 449 431 stmtExpr->set_env( maybeMutate( stmtExpr->get_env(), *this ) ); 450 432 stmtExpr->set_result( maybeMutate( stmtExpr->get_result(), *this ) ); … … 455 437 } 456 438 457 Expression * Mutator::mutate( UniqueExpr *uniqueExpr ) {439 Expression *Mutator::mutate( UniqueExpr *uniqueExpr ) { 458 440 uniqueExpr->set_env( maybeMutate( uniqueExpr->get_env(), *this ) ); 459 441 uniqueExpr->set_result( maybeMutate( uniqueExpr->get_result(), *this ) ); … … 462 444 } 463 445 464 Expression * Mutator::mutate( UntypedInitExpr * initExpr ) {446 Expression *Mutator::mutate( UntypedInitExpr * initExpr ) { 465 447 initExpr->set_env( maybeMutate( initExpr->get_env(), *this ) ); 466 448 initExpr->set_result( maybeMutate( initExpr->get_result(), *this ) ); … … 470 452 } 471 453 472 Expression * Mutator::mutate( InitExpr * initExpr ) {454 Expression *Mutator::mutate( InitExpr * initExpr ) { 473 455 initExpr->set_env( maybeMutate( initExpr->get_env(), *this ) ); 474 456 initExpr->set_result( maybeMutate( initExpr->get_result(), *this ) ); … … 479 461 480 462 481 Type * Mutator::mutate( VoidType *voidType ) {463 Type *Mutator::mutate( VoidType *voidType ) { 482 464 mutateAll( voidType->get_forall(), *this ); 483 465 return voidType; 484 466 } 485 467 486 Type * Mutator::mutate( BasicType *basicType ) {468 Type *Mutator::mutate( BasicType *basicType ) { 487 469 mutateAll( basicType->get_forall(), *this ); 488 470 return basicType; 489 471 } 490 472 491 Type * Mutator::mutate( PointerType *pointerType ) {473 Type *Mutator::mutate( PointerType *pointerType ) { 492 474 mutateAll( pointerType->get_forall(), *this ); 493 475 pointerType->set_base( maybeMutate( pointerType->get_base(), *this ) ); … … 495 477 } 496 478 497 Type * Mutator::mutate( ArrayType *arrayType ) {479 Type *Mutator::mutate( ArrayType *arrayType ) { 498 480 mutateAll( arrayType->get_forall(), *this ); 499 481 arrayType->set_dimension( maybeMutate( arrayType->get_dimension(), *this ) ); … … 502 484 } 503 485 504 Type * Mutator::mutate( FunctionType *functionType ) {486 Type *Mutator::mutate( FunctionType *functionType ) { 505 487 mutateAll( functionType->get_forall(), *this ); 506 488 mutateAll( functionType->get_returnVals(), *this ); … … 509 491 } 510 492 511 Type * Mutator::handleReferenceToType( ReferenceToType *aggregateUseType ) {493 Type *Mutator::handleReferenceToType( ReferenceToType *aggregateUseType ) { 512 494 mutateAll( aggregateUseType->get_forall(), *this ); 513 495 mutateAll( aggregateUseType->get_parameters(), *this ); … … 515 497 } 516 498 517 Type * Mutator::mutate( StructInstType *aggregateUseType ) {499 Type *Mutator::mutate( StructInstType *aggregateUseType ) { 518 500 handleReferenceToType( aggregateUseType ); 519 501 return aggregateUseType; 520 502 } 521 503 522 Type * Mutator::mutate( UnionInstType *aggregateUseType ) {504 Type *Mutator::mutate( UnionInstType *aggregateUseType ) { 523 505 handleReferenceToType( aggregateUseType ); 524 506 return aggregateUseType; 525 507 } 526 508 527 Type * Mutator::mutate( EnumInstType *aggregateUseType ) {509 Type *Mutator::mutate( EnumInstType *aggregateUseType ) { 528 510 handleReferenceToType( aggregateUseType ); 529 511 return aggregateUseType; 530 512 } 531 513 532 Type * Mutator::mutate( TraitInstType *aggregateUseType ) {514 Type *Mutator::mutate( TraitInstType *aggregateUseType ) { 533 515 handleReferenceToType( aggregateUseType ); 534 516 mutateAll( aggregateUseType->get_members(), *this ); … … 536 518 } 537 519 538 Type * Mutator::mutate( TypeInstType *aggregateUseType ) {520 Type *Mutator::mutate( TypeInstType *aggregateUseType ) { 539 521 handleReferenceToType( aggregateUseType ); 540 522 return aggregateUseType; 541 523 } 542 524 543 Type * Mutator::mutate( TupleType *tupleType ) {525 Type *Mutator::mutate( TupleType *tupleType ) { 544 526 mutateAll( tupleType->get_forall(), *this ); 545 527 mutateAll( tupleType->get_types(), *this ); … … 548 530 } 549 531 550 Type * Mutator::mutate( TypeofType *typeofType ) {532 Type *Mutator::mutate( TypeofType *typeofType ) { 551 533 assert( typeofType->get_expr() ); 552 534 typeofType->set_expr( typeofType->get_expr()->acceptMutator( *this ) ); … … 554 536 } 555 537 556 Type * Mutator::mutate( AttrType *attrType ) {538 Type *Mutator::mutate( AttrType *attrType ) { 557 539 if ( attrType->get_isType() ) { 558 540 assert( attrType->get_type() ); … … 565 547 } 566 548 567 Type * Mutator::mutate( VarArgsType *varArgsType ) {549 Type *Mutator::mutate( VarArgsType *varArgsType ) { 568 550 mutateAll( varArgsType->get_forall(), *this ); 569 551 return varArgsType; 570 552 } 571 553 572 Type * Mutator::mutate( ZeroType *zeroType ) {554 Type *Mutator::mutate( ZeroType *zeroType ) { 573 555 mutateAll( zeroType->get_forall(), *this ); 574 556 return zeroType; 575 557 } 576 558 577 Type * Mutator::mutate( OneType *oneType ) {559 Type *Mutator::mutate( OneType *oneType ) { 578 560 mutateAll( oneType->get_forall(), *this ); 579 561 return oneType; … … 581 563 582 564 583 Designation * Mutator::mutate( Designation * designation ) {565 Designation *Mutator::mutate( Designation * designation ) { 584 566 mutateAll( designation->get_designators(), *this ); 585 567 return designation; 586 568 } 587 569 588 Initializer * Mutator::mutate( SingleInit *singleInit ) {570 Initializer *Mutator::mutate( SingleInit *singleInit ) { 589 571 singleInit->set_value( singleInit->get_value()->acceptMutator( *this ) ); 590 572 return singleInit; 591 573 } 592 574 593 Initializer * Mutator::mutate( ListInit *listInit ) {575 Initializer *Mutator::mutate( ListInit *listInit ) { 594 576 mutateAll( listInit->get_designations(), *this ); 595 577 mutateAll( listInit->get_initializers(), *this ); … … 597 579 } 598 580 599 Initializer * Mutator::mutate( ConstructorInit *ctorInit ) {581 Initializer *Mutator::mutate( ConstructorInit *ctorInit ) { 600 582 ctorInit->set_ctor( maybeMutate( ctorInit->get_ctor(), *this ) ); 601 583 ctorInit->set_dtor( maybeMutate( ctorInit->get_dtor(), *this ) ); … … 605 587 606 588 607 Subrange * Mutator::mutate( Subrange *subrange ) {589 Subrange *Mutator::mutate( Subrange *subrange ) { 608 590 return subrange; 609 591 } 610 592 611 593 612 Constant * Mutator::mutate( Constant *constant ) {594 Constant *Mutator::mutate( Constant *constant ) { 613 595 return constant; 614 596 }
Note:
See TracChangeset
for help on using the changeset viewer.