Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/SynTree/Visitor.cc

    r630a82a r1e1e15b  
    55// file "LICENCE" distributed with Cforall.
    66//
    7 // Visitor.cc -- 
     7// Visitor.cc --
    88//
    99// Author           : Richard C. Bilson
    1010// Created On       : Mon May 18 07:44:20 2015
    11 // Last Modified By : Peter A. Buhr
    12 // Last Modified On : Fri Apr  1 18:05:13 2016
     11// Last Modified By : Rob Schluntz
     12// Last Modified On : Wed Apr 27 17:07:40 2016
    1313// Update Count     : 18
    1414//
     
    3939}
    4040
    41 void Visitor::visit( AggregateDecl *aggregateDecl ) {
     41void Visitor::handleAggregateDecl( AggregateDecl *aggregateDecl ) {
    4242        acceptAll( aggregateDecl->get_parameters(), *this );
    4343        acceptAll( aggregateDecl->get_members(), *this );
     
    4545
    4646void Visitor::visit( StructDecl *aggregateDecl ) {
    47         visit( static_cast< AggregateDecl* >( aggregateDecl ) );
     47        handleAggregateDecl( static_cast< AggregateDecl* >( aggregateDecl ) );
    4848}
    4949
    5050void Visitor::visit( UnionDecl *aggregateDecl ) {
    51         visit( static_cast< AggregateDecl* >( aggregateDecl ) );
     51        handleAggregateDecl( static_cast< AggregateDecl* >( aggregateDecl ) );
    5252}
    5353
    5454void Visitor::visit( EnumDecl *aggregateDecl ) {
    55         visit( static_cast< AggregateDecl* >( aggregateDecl ) );
     55        handleAggregateDecl( static_cast< AggregateDecl* >( aggregateDecl ) );
    5656}
    5757
    5858void Visitor::visit( TraitDecl *aggregateDecl ) {
    59         visit( static_cast< AggregateDecl* >( aggregateDecl ) );
    60 }
    61 
    62 void Visitor::visit( NamedTypeDecl *typeDecl ) {
     59        handleAggregateDecl( static_cast< AggregateDecl* >( aggregateDecl ) );
     60}
     61
     62void Visitor::handleNamedTypeDecl( NamedTypeDecl *typeDecl ) {
    6363        acceptAll( typeDecl->get_parameters(), *this );
    6464        acceptAll( typeDecl->get_assertions(), *this );
     
    6767
    6868void Visitor::visit( TypeDecl *typeDecl ) {
    69         visit( static_cast< NamedTypeDecl* >( typeDecl ) );
     69        handleNamedTypeDecl( static_cast< NamedTypeDecl* >( typeDecl ) );
    7070}
    7171
    7272void Visitor::visit( TypedefDecl *typeDecl ) {
    73         visit( static_cast< NamedTypeDecl* >( typeDecl ) );
     73        handleNamedTypeDecl( static_cast< NamedTypeDecl* >( typeDecl ) );
    7474}
    7575
     
    150150void Visitor::visit( DeclStmt *declStmt ) {
    151151        maybeAccept( declStmt->get_decl(), *this );
     152}
     153
     154void Visitor::visit( ImplicitCtorDtorStmt *impCtorDtorStmt ) {
     155        maybeAccept( impCtorDtorStmt->get_callStmt(), *this );
    152156}
    153157
     
    230234}
    231235
     236void Visitor::visit( OffsetPackExpr *offsetPackExpr ) {
     237        acceptAll( offsetPackExpr->get_results(), *this );
     238        maybeAccept( offsetPackExpr->get_type(), *this );
     239}
     240
    232241void Visitor::visit( AttrExpr *attrExpr ) {
    233242        acceptAll( attrExpr->get_results(), *this );
     
    279288}
    280289
     290void Visitor::visit( ImplicitCopyCtorExpr *impCpCtorExpr ) {
     291        maybeAccept( impCpCtorExpr->get_callExpr(), *this );
     292        acceptAll( impCpCtorExpr->get_tempDecls(), *this );
     293        acceptAll( impCpCtorExpr->get_returnDecls(), *this );
     294}
     295
    281296void Visitor::visit( UntypedValofExpr *valofExpr ) {
    282297        acceptAll( valofExpr->get_results(), *this );
     
    315330}
    316331
    317 void Visitor::visit( ReferenceToType *aggregateUseType ) {
     332void Visitor::handleReferenceToType( ReferenceToType *aggregateUseType ) {
    318333        acceptAll( aggregateUseType->get_forall(), *this );
    319334        acceptAll( aggregateUseType->get_parameters(), *this );
     
    321336
    322337void Visitor::visit( StructInstType *aggregateUseType ) {
    323         visit( static_cast< ReferenceToType * >( aggregateUseType ) );
     338        handleReferenceToType( static_cast< ReferenceToType * >( aggregateUseType ) );
    324339}
    325340
    326341void Visitor::visit( UnionInstType *aggregateUseType ) {
    327         visit( static_cast< ReferenceToType * >( aggregateUseType ) );
     342        handleReferenceToType( static_cast< ReferenceToType * >( aggregateUseType ) );
    328343}
    329344
    330345void Visitor::visit( EnumInstType *aggregateUseType ) {
    331         visit( static_cast< ReferenceToType * >( aggregateUseType ) );
     346        handleReferenceToType( static_cast< ReferenceToType * >( aggregateUseType ) );
    332347}
    333348
    334349void Visitor::visit( TraitInstType *aggregateUseType ) {
    335         visit( static_cast< ReferenceToType * >( aggregateUseType ) );
     350        handleReferenceToType( static_cast< ReferenceToType * >( aggregateUseType ) );
    336351        acceptAll( aggregateUseType->get_members(), *this );
    337352}
    338353
    339354void Visitor::visit( TypeInstType *aggregateUseType ) {
    340         visit( static_cast< ReferenceToType * >( aggregateUseType ) );
     355        handleReferenceToType( static_cast< ReferenceToType * >( aggregateUseType ) );
    341356}
    342357
     
    374389}
    375390
     391void Visitor::visit( ConstructorInit *ctorInit ) {
     392        maybeAccept( ctorInit->get_ctor(), *this );
     393        maybeAccept( ctorInit->get_init(), *this );
     394}
     395
    376396void Visitor::visit( Subrange *subrange ) {}
    377397
Note: See TracChangeset for help on using the changeset viewer.