Ignore:
Timestamp:
Sep 15, 2016, 10:17:16 AM (8 years ago)
Author:
Rob Schluntz <rschlunt@…>
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:
aa8f9df
Parents:
96a10cd
git-author:
Rob Schluntz <rschlunt@…> (09/14/16 22:32:34)
git-committer:
Rob Schluntz <rschlunt@…> (09/15/16 10:17:16)
Message:

replace results list on Expressions with a single Type field

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/SymTab/Indexer.cc

    r96a10cd r906e24d  
    4040
    4141namespace SymTab {
    42         template< typename Container, typename VisitorType >
    43         inline void acceptAllNewScope( Container &container, VisitorType &visitor ) {
     42        template< typename TreeType, typename VisitorType >
     43        inline void acceptNewScope( TreeType *tree, VisitorType &visitor ) {
    4444                visitor.enterScope();
    45                 acceptAll( container, visitor );
     45                maybeAccept( tree, visitor );
    4646                visitor.leaveScope();
    4747        }
     
    337337
    338338        void Indexer::visit( ApplicationExpr *applicationExpr ) {
    339                 acceptAllNewScope( applicationExpr->get_results(), *this );
     339                acceptNewScope( applicationExpr->get_result(), *this );
    340340                maybeAccept( applicationExpr->get_function(), *this );
    341341                acceptAll( applicationExpr->get_args(), *this );
     
    343343
    344344        void Indexer::visit( UntypedExpr *untypedExpr ) {
    345                 acceptAllNewScope( untypedExpr->get_results(), *this );
     345                acceptNewScope( untypedExpr->get_result(), *this );
    346346                acceptAll( untypedExpr->get_args(), *this );
    347347        }
    348348
    349349        void Indexer::visit( NameExpr *nameExpr ) {
    350                 acceptAllNewScope( nameExpr->get_results(), *this );
     350                acceptNewScope( nameExpr->get_result(), *this );
    351351        }
    352352
    353353        void Indexer::visit( AddressExpr *addressExpr ) {
    354                 acceptAllNewScope( addressExpr->get_results(), *this );
     354                acceptNewScope( addressExpr->get_result(), *this );
    355355                maybeAccept( addressExpr->get_arg(), *this );
    356356        }
    357357
    358358        void Indexer::visit( LabelAddressExpr *labAddressExpr ) {
    359                 acceptAllNewScope( labAddressExpr->get_results(), *this );
     359                acceptNewScope( labAddressExpr->get_result(), *this );
    360360                maybeAccept( labAddressExpr->get_arg(), *this );
    361361        }
    362362
    363363        void Indexer::visit( CastExpr *castExpr ) {
    364                 acceptAllNewScope( castExpr->get_results(), *this );
     364                acceptNewScope( castExpr->get_result(), *this );
    365365                maybeAccept( castExpr->get_arg(), *this );
    366366        }
    367367
    368368        void Indexer::visit( UntypedMemberExpr *memberExpr ) {
    369                 acceptAllNewScope( memberExpr->get_results(), *this );
     369                acceptNewScope( memberExpr->get_result(), *this );
    370370                maybeAccept( memberExpr->get_aggregate(), *this );
    371371        }
    372372
    373373        void Indexer::visit( MemberExpr *memberExpr ) {
    374                 acceptAllNewScope( memberExpr->get_results(), *this );
     374                acceptNewScope( memberExpr->get_result(), *this );
    375375                maybeAccept( memberExpr->get_aggregate(), *this );
    376376        }
    377377
    378378        void Indexer::visit( VariableExpr *variableExpr ) {
    379                 acceptAllNewScope( variableExpr->get_results(), *this );
     379                acceptNewScope( variableExpr->get_result(), *this );
    380380        }
    381381
    382382        void Indexer::visit( ConstantExpr *constantExpr ) {
    383                 acceptAllNewScope( constantExpr->get_results(), *this );
     383                acceptNewScope( constantExpr->get_result(), *this );
    384384                maybeAccept( constantExpr->get_constant(), *this );
    385385        }
    386386
    387387        void Indexer::visit( SizeofExpr *sizeofExpr ) {
    388                 acceptAllNewScope( sizeofExpr->get_results(), *this );
     388                acceptNewScope( sizeofExpr->get_result(), *this );
    389389                if ( sizeofExpr->get_isType() ) {
    390390                        maybeAccept( sizeofExpr->get_type(), *this );
     
    395395
    396396        void Indexer::visit( AlignofExpr *alignofExpr ) {
    397                 acceptAllNewScope( alignofExpr->get_results(), *this );
     397                acceptNewScope( alignofExpr->get_result(), *this );
    398398                if ( alignofExpr->get_isType() ) {
    399399                        maybeAccept( alignofExpr->get_type(), *this );
     
    404404
    405405        void Indexer::visit( UntypedOffsetofExpr *offsetofExpr ) {
    406                 acceptAllNewScope( offsetofExpr->get_results(), *this );
     406                acceptNewScope( offsetofExpr->get_result(), *this );
    407407                maybeAccept( offsetofExpr->get_type(), *this );
    408408        }
    409409
    410410        void Indexer::visit( OffsetofExpr *offsetofExpr ) {
    411                 acceptAllNewScope( offsetofExpr->get_results(), *this );
     411                acceptNewScope( offsetofExpr->get_result(), *this );
    412412                maybeAccept( offsetofExpr->get_type(), *this );
    413413                maybeAccept( offsetofExpr->get_member(), *this );
     
    415415
    416416        void Indexer::visit( OffsetPackExpr *offsetPackExpr ) {
    417                 acceptAllNewScope( offsetPackExpr->get_results(), *this );
     417                acceptNewScope( offsetPackExpr->get_result(), *this );
    418418                maybeAccept( offsetPackExpr->get_type(), *this );
    419419        }
    420420
    421421        void Indexer::visit( AttrExpr *attrExpr ) {
    422                 acceptAllNewScope( attrExpr->get_results(), *this );
     422                acceptNewScope( attrExpr->get_result(), *this );
    423423                if ( attrExpr->get_isType() ) {
    424424                        maybeAccept( attrExpr->get_type(), *this );
     
    429429
    430430        void Indexer::visit( LogicalExpr *logicalExpr ) {
    431                 acceptAllNewScope( logicalExpr->get_results(), *this );
     431                acceptNewScope( logicalExpr->get_result(), *this );
    432432                maybeAccept( logicalExpr->get_arg1(), *this );
    433433                maybeAccept( logicalExpr->get_arg2(), *this );
     
    435435
    436436        void Indexer::visit( ConditionalExpr *conditionalExpr ) {
    437                 acceptAllNewScope( conditionalExpr->get_results(), *this );
     437                acceptNewScope( conditionalExpr->get_result(), *this );
    438438                maybeAccept( conditionalExpr->get_arg1(), *this );
    439439                maybeAccept( conditionalExpr->get_arg2(), *this );
     
    442442
    443443        void Indexer::visit( CommaExpr *commaExpr ) {
    444                 acceptAllNewScope( commaExpr->get_results(), *this );
     444                acceptNewScope( commaExpr->get_result(), *this );
    445445                maybeAccept( commaExpr->get_arg1(), *this );
    446446                maybeAccept( commaExpr->get_arg2(), *this );
     
    448448
    449449        void Indexer::visit( TupleExpr *tupleExpr ) {
    450                 acceptAllNewScope( tupleExpr->get_results(), *this );
     450                acceptNewScope( tupleExpr->get_result(), *this );
    451451                acceptAll( tupleExpr->get_exprs(), *this );
    452452        }
    453453
    454454        void Indexer::visit( SolvedTupleExpr *tupleExpr ) {
    455                 acceptAllNewScope( tupleExpr->get_results(), *this );
     455                acceptNewScope( tupleExpr->get_result(), *this );
    456456                acceptAll( tupleExpr->get_exprs(), *this );
    457457        }
    458458
    459459        void Indexer::visit( TypeExpr *typeExpr ) {
    460                 acceptAllNewScope( typeExpr->get_results(), *this );
     460                acceptNewScope( typeExpr->get_result(), *this );
    461461                maybeAccept( typeExpr->get_type(), *this );
    462462        }
     
    469469
    470470        void Indexer::visit( UntypedValofExpr *valofExpr ) {
    471                 acceptAllNewScope( valofExpr->get_results(), *this );
     471                acceptNewScope( valofExpr->get_result(), *this );
    472472                maybeAccept( valofExpr->get_body(), *this );
    473473        }
Note: See TracChangeset for help on using the changeset viewer.