Changeset 798a8b3


Ignore:
Timestamp:
Jun 16, 2021, 2:44:09 PM (3 years ago)
Author:
Thierry Delisle <tdelisle@…>
Branches:
ADT, ast-experimental, enum, forall-pointer-decay, jacob/cs343-translation, master, new-ast-unique-expr, pthread-emulation, qualifiedEnum
Children:
7e1cb79
Parents:
1d61b67
Message:

Attributes are now correctly visited when replacing typedefs

Location:
src
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • src/AST/Pass.impl.hpp

    r1d61b67 r798a8b3  
    479479                        guard_symtab guard { *this };
    480480                        // implicit add __func__ identifier as specified in the C manual 6.4.2.2
    481                         static ast::ptr< ast::ObjectDecl > func{ new ast::ObjectDecl{ 
     481                        static ast::ptr< ast::ObjectDecl > func{ new ast::ObjectDecl{
    482482                                CodeLocation{}, "__func__",
    483483                                new ast::ArrayType{
     
    522522        VISIT({
    523523                guard_symtab guard { * this };
    524                 maybe_accept( node, &StructDecl::params  );
    525                 maybe_accept( node, &StructDecl::members );
     524                maybe_accept( node, &StructDecl::params     );
     525                maybe_accept( node, &StructDecl::members    );
     526                maybe_accept( node, &StructDecl::attributes );
    526527        })
    527528
     
    543544        VISIT({
    544545                guard_symtab guard { * this };
    545                 maybe_accept( node, &UnionDecl::params  );
    546                 maybe_accept( node, &UnionDecl::members );
     546                maybe_accept( node, &UnionDecl::params     );
     547                maybe_accept( node, &UnionDecl::members    );
     548                maybe_accept( node, &UnionDecl::attributes );
    547549        })
    548550
     
    562564        VISIT(
    563565                // unlike structs, traits, and unions, enums inject their members into the global scope
    564                 maybe_accept( node, &EnumDecl::params  );
    565                 maybe_accept( node, &EnumDecl::members );
     566                maybe_accept( node, &EnumDecl::params     );
     567                maybe_accept( node, &EnumDecl::members    );
     568                maybe_accept( node, &EnumDecl::attributes );
    566569        )
    567570
     
    577580        VISIT({
    578581                guard_symtab guard { *this };
    579                 maybe_accept( node, &TraitDecl::params  );
    580                 maybe_accept( node, &TraitDecl::members );
     582                maybe_accept( node, &TraitDecl::params     );
     583                maybe_accept( node, &TraitDecl::members    );
     584                maybe_accept( node, &TraitDecl::attributes );
    581585        })
    582586
  • src/Common/PassVisitor.impl.h

    r1d61b67 r798a8b3  
    636636                maybeAccept_impl( node->parameters, *this );
    637637                maybeAccept_impl( node->members   , *this );
     638                maybeAccept_impl( node->attributes, *this );
    638639        }
    639640
     
    656657                maybeAccept_impl( node->parameters, *this );
    657658                maybeAccept_impl( node->members   , *this );
     659                maybeAccept_impl( node->attributes, *this );
    658660        }
    659661
     
    676678                maybeMutate_impl( node->parameters, *this );
    677679                maybeMutate_impl( node->members   , *this );
     680                maybeMutate_impl( node->attributes, *this );
    678681        }
    679682
     
    697700                maybeAccept_impl( node->parameters, *this );
    698701                maybeAccept_impl( node->members   , *this );
     702                maybeAccept_impl( node->attributes, *this );
    699703        }
    700704
     
    714718                maybeAccept_impl( node->parameters, *this );
    715719                maybeAccept_impl( node->members   , *this );
     720                maybeAccept_impl( node->attributes, *this );
    716721        }
    717722
     
    732737                maybeMutate_impl( node->parameters, *this );
    733738                maybeMutate_impl( node->members   , *this );
     739                maybeMutate_impl( node->attributes, *this );
    734740        }
    735741
     
    750756        maybeAccept_impl( node->parameters, *this );
    751757        maybeAccept_impl( node->members   , *this );
     758        maybeAccept_impl( node->attributes, *this );
    752759
    753760        VISIT_END( node );
     
    763770        maybeAccept_impl( node->parameters, *this );
    764771        maybeAccept_impl( node->members   , *this );
     772        maybeAccept_impl( node->attributes, *this );
    765773
    766774        VISIT_END( node );
     
    776784        maybeMutate_impl( node->parameters, *this );
    777785        maybeMutate_impl( node->members   , *this );
     786        maybeMutate_impl( node->attributes, *this );
    778787
    779788        MUTATE_END( Declaration, node );
     
    790799                maybeAccept_impl( node->parameters, *this );
    791800                maybeAccept_impl( node->members   , *this );
     801                maybeAccept_impl( node->attributes, *this );
    792802        }
    793803
     
    805815                maybeAccept_impl( node->parameters, *this );
    806816                maybeAccept_impl( node->members   , *this );
     817                maybeAccept_impl( node->attributes, *this );
    807818        }
    808819
     
    820831                maybeMutate_impl( node->parameters, *this );
    821832                maybeMutate_impl( node->members   , *this );
     833                maybeMutate_impl( node->attributes, *this );
    822834        }
    823835
     
    38563868
    38573869//--------------------------------------------------------------------------
    3858 // Attribute
     3870// Constant
    38593871template< typename pass_type >
    38603872void PassVisitor< pass_type >::visit( Constant * node ) {
  • src/SymTab/Validate.cc

    r1d61b67 r798a8b3  
    11521152                GuardScope( typedeclNames );
    11531153                mutateAll( aggr->parameters, * visitor );
     1154                mutateAll( aggr->attributes, * visitor );
    11541155
    11551156                // unroll mutateAll for aggr->members so that implicit typedefs for nested types are added to the aggregate body.
Note: See TracChangeset for help on using the changeset viewer.