Changeset aa8f9df for src/SymTab
- Timestamp:
- Sep 15, 2016, 3:22:50 PM (8 years ago)
- Branches:
- ADT, aaron-thesis, arm-eh, ast-experimental, cleanup-dtors, deferred_resn, demangler, enum, forall-pointer-decay, jacob/cs343-translation, jenkins-sandbox, master, new-ast, new-ast-unique-expr, new-env, no_list, persistent-indexer, pthread-emulation, qualifiedEnum, resolv-new, with_gc
- Children:
- 4ab9536
- Parents:
- fd782b2 (diff), 906e24d (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the(diff)
links above to see all the changes relative to each parent. - Location:
- src/SymTab
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
src/SymTab/Autogen.cc
rfd782b2 raa8f9df 116 116 // This happens before function pointer type conversion, so need to do it manually here 117 117 VariableExpr * assignVarExpr = new VariableExpr( assignDecl ); 118 Type * & assignVarExprType = assignVarExpr->get_results().front();118 Type * assignVarExprType = assignVarExpr->get_result(); 119 119 assignVarExprType = new PointerType( Type::Qualifiers(), assignVarExprType ); 120 assignVarExpr->set_result( assignVarExprType ); 120 121 ApplicationExpr * assignExpr = new ApplicationExpr( assignVarExpr ); 121 122 assignExpr->get_args().push_back( new VariableExpr( dstParam ) ); -
src/SymTab/Indexer.cc
rfd782b2 raa8f9df 40 40 41 41 namespace SymTab { 42 template< typename Container, typename VisitorType >43 inline void accept AllNewScope( Container &container, VisitorType &visitor ) {42 template< typename TreeType, typename VisitorType > 43 inline void acceptNewScope( TreeType *tree, VisitorType &visitor ) { 44 44 visitor.enterScope(); 45 acceptAll( container, visitor );45 maybeAccept( tree, visitor ); 46 46 visitor.leaveScope(); 47 47 } … … 337 337 338 338 void Indexer::visit( ApplicationExpr *applicationExpr ) { 339 accept AllNewScope( applicationExpr->get_results(), *this );339 acceptNewScope( applicationExpr->get_result(), *this ); 340 340 maybeAccept( applicationExpr->get_function(), *this ); 341 341 acceptAll( applicationExpr->get_args(), *this ); … … 343 343 344 344 void Indexer::visit( UntypedExpr *untypedExpr ) { 345 accept AllNewScope( untypedExpr->get_results(), *this );345 acceptNewScope( untypedExpr->get_result(), *this ); 346 346 acceptAll( untypedExpr->get_args(), *this ); 347 347 } 348 348 349 349 void Indexer::visit( NameExpr *nameExpr ) { 350 accept AllNewScope( nameExpr->get_results(), *this );350 acceptNewScope( nameExpr->get_result(), *this ); 351 351 } 352 352 353 353 void Indexer::visit( AddressExpr *addressExpr ) { 354 accept AllNewScope( addressExpr->get_results(), *this );354 acceptNewScope( addressExpr->get_result(), *this ); 355 355 maybeAccept( addressExpr->get_arg(), *this ); 356 356 } 357 357 358 358 void Indexer::visit( LabelAddressExpr *labAddressExpr ) { 359 accept AllNewScope( labAddressExpr->get_results(), *this );359 acceptNewScope( labAddressExpr->get_result(), *this ); 360 360 maybeAccept( labAddressExpr->get_arg(), *this ); 361 361 } 362 362 363 363 void Indexer::visit( CastExpr *castExpr ) { 364 accept AllNewScope( castExpr->get_results(), *this );364 acceptNewScope( castExpr->get_result(), *this ); 365 365 maybeAccept( castExpr->get_arg(), *this ); 366 366 } 367 367 368 368 void Indexer::visit( UntypedMemberExpr *memberExpr ) { 369 accept AllNewScope( memberExpr->get_results(), *this );369 acceptNewScope( memberExpr->get_result(), *this ); 370 370 maybeAccept( memberExpr->get_aggregate(), *this ); 371 371 } 372 372 373 373 void Indexer::visit( MemberExpr *memberExpr ) { 374 accept AllNewScope( memberExpr->get_results(), *this );374 acceptNewScope( memberExpr->get_result(), *this ); 375 375 maybeAccept( memberExpr->get_aggregate(), *this ); 376 376 } 377 377 378 378 void Indexer::visit( VariableExpr *variableExpr ) { 379 accept AllNewScope( variableExpr->get_results(), *this );379 acceptNewScope( variableExpr->get_result(), *this ); 380 380 } 381 381 382 382 void Indexer::visit( ConstantExpr *constantExpr ) { 383 accept AllNewScope( constantExpr->get_results(), *this );383 acceptNewScope( constantExpr->get_result(), *this ); 384 384 maybeAccept( constantExpr->get_constant(), *this ); 385 385 } 386 386 387 387 void Indexer::visit( SizeofExpr *sizeofExpr ) { 388 accept AllNewScope( sizeofExpr->get_results(), *this );388 acceptNewScope( sizeofExpr->get_result(), *this ); 389 389 if ( sizeofExpr->get_isType() ) { 390 390 maybeAccept( sizeofExpr->get_type(), *this ); … … 395 395 396 396 void Indexer::visit( AlignofExpr *alignofExpr ) { 397 accept AllNewScope( alignofExpr->get_results(), *this );397 acceptNewScope( alignofExpr->get_result(), *this ); 398 398 if ( alignofExpr->get_isType() ) { 399 399 maybeAccept( alignofExpr->get_type(), *this ); … … 404 404 405 405 void Indexer::visit( UntypedOffsetofExpr *offsetofExpr ) { 406 accept AllNewScope( offsetofExpr->get_results(), *this );406 acceptNewScope( offsetofExpr->get_result(), *this ); 407 407 maybeAccept( offsetofExpr->get_type(), *this ); 408 408 } 409 409 410 410 void Indexer::visit( OffsetofExpr *offsetofExpr ) { 411 accept AllNewScope( offsetofExpr->get_results(), *this );411 acceptNewScope( offsetofExpr->get_result(), *this ); 412 412 maybeAccept( offsetofExpr->get_type(), *this ); 413 413 maybeAccept( offsetofExpr->get_member(), *this ); … … 415 415 416 416 void Indexer::visit( OffsetPackExpr *offsetPackExpr ) { 417 accept AllNewScope( offsetPackExpr->get_results(), *this );417 acceptNewScope( offsetPackExpr->get_result(), *this ); 418 418 maybeAccept( offsetPackExpr->get_type(), *this ); 419 419 } 420 420 421 421 void Indexer::visit( AttrExpr *attrExpr ) { 422 accept AllNewScope( attrExpr->get_results(), *this );422 acceptNewScope( attrExpr->get_result(), *this ); 423 423 if ( attrExpr->get_isType() ) { 424 424 maybeAccept( attrExpr->get_type(), *this ); … … 429 429 430 430 void Indexer::visit( LogicalExpr *logicalExpr ) { 431 accept AllNewScope( logicalExpr->get_results(), *this );431 acceptNewScope( logicalExpr->get_result(), *this ); 432 432 maybeAccept( logicalExpr->get_arg1(), *this ); 433 433 maybeAccept( logicalExpr->get_arg2(), *this ); … … 435 435 436 436 void Indexer::visit( ConditionalExpr *conditionalExpr ) { 437 accept AllNewScope( conditionalExpr->get_results(), *this );437 acceptNewScope( conditionalExpr->get_result(), *this ); 438 438 maybeAccept( conditionalExpr->get_arg1(), *this ); 439 439 maybeAccept( conditionalExpr->get_arg2(), *this ); … … 442 442 443 443 void Indexer::visit( CommaExpr *commaExpr ) { 444 accept AllNewScope( commaExpr->get_results(), *this );444 acceptNewScope( commaExpr->get_result(), *this ); 445 445 maybeAccept( commaExpr->get_arg1(), *this ); 446 446 maybeAccept( commaExpr->get_arg2(), *this ); … … 448 448 449 449 void Indexer::visit( TupleExpr *tupleExpr ) { 450 accept AllNewScope( tupleExpr->get_results(), *this );450 acceptNewScope( tupleExpr->get_result(), *this ); 451 451 acceptAll( tupleExpr->get_exprs(), *this ); 452 452 } 453 453 454 454 void Indexer::visit( TupleAssignExpr *tupleExpr ) { 455 accept AllNewScope( tupleExpr->get_results(), *this );455 acceptNewScope( tupleExpr->get_result(), *this ); 456 456 enterScope(); 457 457 acceptAll( tupleExpr->get_tempDecls(), *this ); … … 461 461 462 462 void Indexer::visit( TypeExpr *typeExpr ) { 463 accept AllNewScope( typeExpr->get_results(), *this );463 acceptNewScope( typeExpr->get_result(), *this ); 464 464 maybeAccept( typeExpr->get_type(), *this ); 465 465 } … … 472 472 473 473 void Indexer::visit( UntypedValofExpr *valofExpr ) { 474 accept AllNewScope( valofExpr->get_results(), *this );474 acceptNewScope( valofExpr->get_result(), *this ); 475 475 maybeAccept( valofExpr->get_body(), *this ); 476 476 }
Note: See TracChangeset
for help on using the changeset viewer.