Changeset 15f5c5e


Ignore:
Timestamp:
Jun 28, 2018, 2:39:21 PM (3 years ago)
Author:
Rob Schluntz <rschlunt@…>
Branches:
aaron-thesis, arm-eh, cleanup-dtors, deferred_resn, demangler, jacob/cs343-translation, jenkins-sandbox, master, new-ast, new-ast-unique-expr, no_list, persistent-indexer
Children:
d419d8e
Parents:
e73becf
git-author:
Rob Schluntz <rschlunt@…> (06/28/18 14:36:35)
git-committer:
Rob Schluntz <rschlunt@…> (06/28/18 14:39:21)
Message:

Rename LinkNestedTypes? to HoistTypeDecls?

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/SymTab/Validate.cc

    re73becf r15f5c5e  
    8080
    8181namespace SymTab {
    82         struct LinkNestedTypes final : public WithDeclsToAdd {
    83                 void previsit( AggregateDecl * aggr );
    84 
     82        /// hoists declarations that are difficult to hoist while parsing
     83        struct HoistTypeDecls final : public WithDeclsToAdd {
    8584                void previsit( SizeofExpr * );
    8685                void previsit( AlignofExpr * );
     
    269268                PassVisitor<FindSpecialDeclarations> finder;
    270269                PassVisitor<LabelAddressFixer> labelAddrFixer;
    271                 PassVisitor<LinkNestedTypes> nestedTypes;
    272 
    273                 acceptAll( translationUnit, nestedTypes );
     270                PassVisitor<HoistTypeDecls> hoistDecls;
     271
     272                acceptAll( translationUnit, hoistDecls );
    274273                EliminateTypedef::eliminateTypedef( translationUnit );
    275274                ReturnTypeFixer::fix( translationUnit ); // must happen before autogen
     
    303302
    304303
    305         void LinkNestedTypes::previsit( AggregateDecl * aggr ) {
    306                 for ( auto it = aggr->members.begin(); it != aggr->members.end(); ) {
    307                         auto current = it++;
    308                         Declaration * member = *current;
    309                         if ( AggregateDecl * child = dynamic_cast<AggregateDecl *>( member ) ) {
    310                                 child->parent = aggr;
    311                         }
    312                 }
    313         }
    314 
    315         void LinkNestedTypes::handleType( Type * type ) {
     304        void HoistTypeDecls::handleType( Type * type ) {
    316305                // some type declarations are buried in expressions and not easy to hoist during parsing; hoist them here
    317306                AggregateDecl * aggr = nullptr;
     
    328317        }
    329318
    330         void LinkNestedTypes::previsit( SizeofExpr * expr ) {
     319        void HoistTypeDecls::previsit( SizeofExpr * expr ) {
    331320                handleType( expr->type );
    332321        }
    333322
    334         void LinkNestedTypes::previsit( AlignofExpr * expr ) {
     323        void HoistTypeDecls::previsit( AlignofExpr * expr ) {
    335324                handleType( expr->type );
    336325        }
    337326
    338         void LinkNestedTypes::previsit( UntypedOffsetofExpr * expr ) {
     327        void HoistTypeDecls::previsit( UntypedOffsetofExpr * expr ) {
    339328                handleType( expr->type );
    340329        }
Note: See TracChangeset for help on using the changeset viewer.