Changes in src/SynTree/Mutator.cc [907eccb:d5556a3]
- File:
-
- 1 edited
-
src/SynTree/Mutator.cc (modified) (33 diffs)
Legend:
- Unmodified
- Added
- Removed
-
src/SynTree/Mutator.cc
r907eccb rd5556a3 23 23 #include "Constant.h" 24 24 #include "Common/utility.h" 25 #include "TypeSubstitution.h"26 25 27 26 Mutator::Mutator() {} … … 179 178 180 179 Expression *Mutator::mutate( ApplicationExpr *applicationExpr ) { 181 applicationExpr->set_env( maybeMutate( applicationExpr->get_env(), *this ) );182 180 applicationExpr->set_result( maybeMutate( applicationExpr->get_result(), *this ) ); 183 181 applicationExpr->set_function( maybeMutate( applicationExpr->get_function(), *this ) ); … … 187 185 188 186 Expression *Mutator::mutate( UntypedExpr *untypedExpr ) { 189 untypedExpr->set_env( maybeMutate( untypedExpr->get_env(), *this ) );190 187 untypedExpr->set_result( maybeMutate( untypedExpr->get_result(), *this ) ); 191 188 mutateAll( untypedExpr->get_args(), *this ); … … 194 191 195 192 Expression *Mutator::mutate( NameExpr *nameExpr ) { 196 nameExpr->set_env( maybeMutate( nameExpr->get_env(), *this ) );197 193 nameExpr->set_result( maybeMutate( nameExpr->get_result(), *this ) ); 198 194 return nameExpr; … … 200 196 201 197 Expression *Mutator::mutate( AddressExpr *addressExpr ) { 202 addressExpr->set_env( maybeMutate( addressExpr->get_env(), *this ) );203 198 addressExpr->set_result( maybeMutate( addressExpr->get_result(), *this ) ); 204 199 addressExpr->set_arg( maybeMutate( addressExpr->get_arg(), *this ) ); … … 207 202 208 203 Expression *Mutator::mutate( LabelAddressExpr *labelAddressExpr ) { 209 labelAddressExpr->set_env( maybeMutate( labelAddressExpr->get_env(), *this ) );210 204 labelAddressExpr->set_result( maybeMutate( labelAddressExpr->get_result(), *this ) ); 211 205 labelAddressExpr->set_arg( maybeMutate( labelAddressExpr->get_arg(), *this ) ); … … 214 208 215 209 Expression *Mutator::mutate( CastExpr *castExpr ) { 216 castExpr->set_env( maybeMutate( castExpr->get_env(), *this ) );217 210 castExpr->set_result( maybeMutate( castExpr->get_result(), *this ) ); 218 211 castExpr->set_arg( maybeMutate( castExpr->get_arg(), *this ) ); … … 221 214 222 215 Expression *Mutator::mutate( UntypedMemberExpr *memberExpr ) { 223 memberExpr->set_env( maybeMutate( memberExpr->get_env(), *this ) );224 216 memberExpr->set_result( maybeMutate( memberExpr->get_result(), *this ) ); 225 217 memberExpr->set_aggregate( maybeMutate( memberExpr->get_aggregate(), *this ) ); … … 229 221 230 222 Expression *Mutator::mutate( MemberExpr *memberExpr ) { 231 memberExpr->set_env( maybeMutate( memberExpr->get_env(), *this ) );232 223 memberExpr->set_result( maybeMutate( memberExpr->get_result(), *this ) ); 233 224 memberExpr->set_aggregate( maybeMutate( memberExpr->get_aggregate(), *this ) ); … … 236 227 237 228 Expression *Mutator::mutate( VariableExpr *variableExpr ) { 238 variableExpr->set_env( maybeMutate( variableExpr->get_env(), *this ) );239 229 variableExpr->set_result( maybeMutate( variableExpr->get_result(), *this ) ); 240 230 return variableExpr; … … 242 232 243 233 Expression *Mutator::mutate( ConstantExpr *constantExpr ) { 244 constantExpr->set_env( maybeMutate( constantExpr->get_env(), *this ) );245 234 constantExpr->set_result( maybeMutate( constantExpr->get_result(), *this ) ); 246 235 // maybeMutate( constantExpr->get_constant(), *this ) … … 249 238 250 239 Expression *Mutator::mutate( SizeofExpr *sizeofExpr ) { 251 sizeofExpr->set_env( maybeMutate( sizeofExpr->get_env(), *this ) );252 240 sizeofExpr->set_result( maybeMutate( sizeofExpr->get_result(), *this ) ); 253 241 if ( sizeofExpr->get_isType() ) { … … 260 248 261 249 Expression *Mutator::mutate( AlignofExpr *alignofExpr ) { 262 alignofExpr->set_env( maybeMutate( alignofExpr->get_env(), *this ) );263 250 alignofExpr->set_result( maybeMutate( alignofExpr->get_result(), *this ) ); 264 251 if ( alignofExpr->get_isType() ) { … … 271 258 272 259 Expression *Mutator::mutate( UntypedOffsetofExpr *offsetofExpr ) { 273 offsetofExpr->set_env( maybeMutate( offsetofExpr->get_env(), *this ) );274 260 offsetofExpr->set_result( maybeMutate( offsetofExpr->get_result(), *this ) ); 275 261 offsetofExpr->set_type( maybeMutate( offsetofExpr->get_type(), *this ) ); … … 278 264 279 265 Expression *Mutator::mutate( OffsetofExpr *offsetofExpr ) { 280 offsetofExpr->set_env( maybeMutate( offsetofExpr->get_env(), *this ) );281 266 offsetofExpr->set_result( maybeMutate( offsetofExpr->get_result(), *this ) ); 282 267 offsetofExpr->set_type( maybeMutate( offsetofExpr->get_type(), *this ) ); … … 286 271 287 272 Expression *Mutator::mutate( OffsetPackExpr *offsetPackExpr ) { 288 offsetPackExpr->set_env( maybeMutate( offsetPackExpr->get_env(), *this ) );289 273 offsetPackExpr->set_result( maybeMutate( offsetPackExpr->get_result(), *this ) ); 290 274 offsetPackExpr->set_type( maybeMutate( offsetPackExpr->get_type(), *this ) ); … … 293 277 294 278 Expression *Mutator::mutate( AttrExpr *attrExpr ) { 295 attrExpr->set_env( maybeMutate( attrExpr->get_env(), *this ) );296 279 attrExpr->set_result( maybeMutate( attrExpr->get_result(), *this ) ); 297 280 if ( attrExpr->get_isType() ) { … … 304 287 305 288 Expression *Mutator::mutate( LogicalExpr *logicalExpr ) { 306 logicalExpr->set_env( maybeMutate( logicalExpr->get_env(), *this ) );307 289 logicalExpr->set_result( maybeMutate( logicalExpr->get_result(), *this ) ); 308 290 logicalExpr->set_arg1( maybeMutate( logicalExpr->get_arg1(), *this ) ); … … 312 294 313 295 Expression *Mutator::mutate( ConditionalExpr *conditionalExpr ) { 314 conditionalExpr->set_env( maybeMutate( conditionalExpr->get_env(), *this ) );315 296 conditionalExpr->set_result( maybeMutate( conditionalExpr->get_result(), *this ) ); 316 297 conditionalExpr->set_arg1( maybeMutate( conditionalExpr->get_arg1(), *this ) ); … … 321 302 322 303 Expression *Mutator::mutate( CommaExpr *commaExpr ) { 323 commaExpr->set_env( maybeMutate( commaExpr->get_env(), *this ) );324 304 commaExpr->set_result( maybeMutate( commaExpr->get_result(), *this ) ); 325 305 commaExpr->set_arg1( maybeMutate( commaExpr->get_arg1(), *this ) ); … … 329 309 330 310 Expression *Mutator::mutate( TypeExpr *typeExpr ) { 331 typeExpr->set_env( maybeMutate( typeExpr->get_env(), *this ) );332 311 typeExpr->set_result( maybeMutate( typeExpr->get_result(), *this ) ); 333 312 typeExpr->set_type( maybeMutate( typeExpr->get_type(), *this ) ); … … 336 315 337 316 Expression *Mutator::mutate( AsmExpr *asmExpr ) { 338 asmExpr->set_env( maybeMutate( asmExpr->get_env(), *this ) );339 317 asmExpr->set_inout( maybeMutate( asmExpr->get_inout(), *this ) ); 340 318 asmExpr->set_constraint( maybeMutate( asmExpr->get_constraint(), *this ) ); … … 344 322 345 323 Expression* Mutator::mutate( ImplicitCopyCtorExpr *impCpCtorExpr ) { 346 impCpCtorExpr->set_env( maybeMutate( impCpCtorExpr->get_env(), *this ) );347 impCpCtorExpr->set_result( maybeMutate( impCpCtorExpr->get_result(), *this ) );348 324 impCpCtorExpr->set_callExpr( maybeMutate( impCpCtorExpr->get_callExpr(), *this ) ); 349 325 mutateAll( impCpCtorExpr->get_tempDecls(), *this ); … … 354 330 355 331 Expression* Mutator::mutate( ConstructorExpr *ctorExpr ) { 356 ctorExpr->set_env( maybeMutate( ctorExpr->get_env(), *this ) );357 332 ctorExpr->set_result( maybeMutate( ctorExpr->get_result(), *this ) ); 358 333 ctorExpr->set_callExpr( maybeMutate( ctorExpr->get_callExpr(), *this ) ); … … 361 336 362 337 Expression *Mutator::mutate( CompoundLiteralExpr *compLitExpr ) { 363 compLitExpr->set_env( maybeMutate( compLitExpr->get_env(), *this ) );364 338 compLitExpr->set_result( maybeMutate( compLitExpr->get_result(), *this ) ); 365 339 compLitExpr->set_type( maybeMutate( compLitExpr->get_type(), *this ) ); … … 369 343 370 344 Expression *Mutator::mutate( UntypedValofExpr *valofExpr ) { 371 valofExpr->set_env( maybeMutate( valofExpr->get_env(), *this ) );372 345 valofExpr->set_result( maybeMutate( valofExpr->get_result(), *this ) ); 373 346 return valofExpr; … … 375 348 376 349 Expression *Mutator::mutate( RangeExpr *rangeExpr ) { 377 rangeExpr->set_env( maybeMutate( rangeExpr->get_env(), *this ) );378 350 rangeExpr->set_low( maybeMutate( rangeExpr->get_low(), *this ) ); 379 351 rangeExpr->set_high( maybeMutate( rangeExpr->get_high(), *this ) ); … … 381 353 } 382 354 383 Expression *Mutator::mutate( UntypedTupleExpr *tupleExpr ) { 384 tupleExpr->set_env( maybeMutate( tupleExpr->get_env(), *this ) ); 355 Expression *Mutator::mutate( TupleExpr *tupleExpr ) { 385 356 tupleExpr->set_result( maybeMutate( tupleExpr->get_result(), *this ) ); 386 357 mutateAll( tupleExpr->get_exprs(), *this ); … … 388 359 } 389 360 390 Expression *Mutator::mutate( TupleExpr *tupleExpr ) {391 tupleExpr->set_env( maybeMutate( tupleExpr->get_env(), *this ) );392 tupleExpr->set_result( maybeMutate( tupleExpr->get_result(), *this ) );393 mutateAll( tupleExpr->get_exprs(), *this );394 return tupleExpr;395 }396 397 361 Expression *Mutator::mutate( TupleIndexExpr *tupleExpr ) { 398 tupleExpr->set_env( maybeMutate( tupleExpr->get_env(), *this ) );399 362 tupleExpr->set_result( maybeMutate( tupleExpr->get_result(), *this ) ); 400 363 tupleExpr->set_tuple( maybeMutate( tupleExpr->get_tuple(), *this ) ); … … 403 366 404 367 Expression *Mutator::mutate( MemberTupleExpr *tupleExpr ) { 405 tupleExpr->set_env( maybeMutate( tupleExpr->get_env(), *this ) );406 368 tupleExpr->set_result( maybeMutate( tupleExpr->get_result(), *this ) ); 407 369 tupleExpr->set_member( maybeMutate( tupleExpr->get_member(), *this ) ); … … 411 373 412 374 Expression *Mutator::mutate( TupleAssignExpr *assignExpr ) { 413 assignExpr->set_env( maybeMutate( assignExpr->get_env(), *this ) );414 375 assignExpr->set_result( maybeMutate( assignExpr->get_result(), *this ) ); 415 376 assignExpr->set_stmtExpr( maybeMutate( assignExpr->get_stmtExpr(), *this ) ); … … 418 379 419 380 Expression *Mutator::mutate( StmtExpr *stmtExpr ) { 420 stmtExpr->set_env( maybeMutate( stmtExpr->get_env(), *this ) );421 381 stmtExpr->set_result( maybeMutate( stmtExpr->get_result(), *this ) ); 422 382 stmtExpr->set_statements( maybeMutate( stmtExpr->get_statements(), *this ) ); … … 427 387 428 388 Expression *Mutator::mutate( UniqueExpr *uniqueExpr ) { 429 uniqueExpr->set_env( maybeMutate( uniqueExpr->get_env(), *this ) );430 389 uniqueExpr->set_result( maybeMutate( uniqueExpr->get_result(), *this ) ); 431 390 uniqueExpr->set_expr( maybeMutate( uniqueExpr->get_expr(), *this ) );
Note:
See TracChangeset
for help on using the changeset viewer.