Changes in / [cef7430:6b2d444]


Ignore:
Files:
4 deleted
14 edited

Legend:

Unmodified
Added
Removed
  • libcfa/src/concurrency/io.cfa

    rcef7430 r6b2d444  
    306306                ctx->proc->io.pending = true;
    307307                ctx->proc->io.dirty   = true;
    308                 if(sq.to_submit > 30) {
    309                         __tls_stats()->io.flush.full++;
    310                         __cfa_io_flush( ctx->proc, 0 );
    311                 }
    312                 if(!lazy) {
    313                         __tls_stats()->io.flush.eager++;
     308                if(sq.to_submit > 30 || !lazy) {
    314309                        __cfa_io_flush( ctx->proc, 0 );
    315310                }
  • libcfa/src/concurrency/kernel.cfa

    rcef7430 r6b2d444  
    196196
    197197                        if( !readyThread ) {
    198                                 __tls_stats()->io.flush.idle++;
    199198                                __cfa_io_flush( this, 0 );
    200199
     
    245244
    246245                        if(this->io.pending && !this->io.dirty) {
    247                                 __tls_stats()->io.flush.dirty++;
    248246                                __cfa_io_flush( this, 0 );
    249247                        }
  • libcfa/src/concurrency/stats.cfa

    rcef7430 r6b2d444  
    4545                        stats->io.submit.slow       = 0;
    4646                        stats->io.flush.external    = 0;
    47                         stats->io.flush.dirty       = 0;
    48                         stats->io.flush.full        = 0;
    49                         stats->io.flush.idle        = 0;
    50                         stats->io.flush.eager       = 0;
    5147                        stats->io.calls.flush       = 0;
    5248                        stats->io.calls.submitted   = 0;
     
    111107                        tally_one( &cltr->io.submit.slow      , &proc->io.submit.slow       );
    112108                        tally_one( &cltr->io.flush.external   , &proc->io.flush.external    );
    113                         tally_one( &cltr->io.flush.dirty      , &proc->io.flush.dirty       );
    114                         tally_one( &cltr->io.flush.full       , &proc->io.flush.full        );
    115                         tally_one( &cltr->io.flush.idle       , &proc->io.flush.idle        );
    116                         tally_one( &cltr->io.flush.eager      , &proc->io.flush.eager       );
    117109                        tally_one( &cltr->io.calls.flush      , &proc->io.calls.flush       );
    118110                        tally_one( &cltr->io.calls.submitted  , &proc->io.calls.submitted   );
     
    192184                                if(io.alloc.fail || io.alloc.revoke || io.alloc.block)
    193185                                        sstr | "-     failures      : " | eng3(io.alloc.fail) | "oom, " | eng3(io.alloc.revoke) | "rvk, " | eng3(io.alloc.block) | "blk";
    194                                 // if(io.flush.external)
    195                                 //      sstr | "- flush external    : " | eng3(io.flush.external);
     186                                if(io.flush.external)
     187                                        sstr | "- flush external    : " | eng3(io.flush.external);
    196188
    197189                                double avgsubs = ((double)io.calls.submitted) / io.calls.flush;
    198190                                double avgcomp = ((double)io.calls.completed) / io.calls.drain;
    199191                                sstr | "- syscll : "
    200                                      |   " sub " | eng3(io.calls.submitted) | "/" | eng3(io.calls.flush) | "(" | ws(3, 3, avgsubs) | "/flush)"
    201                                      | " - cmp " | eng3(io.calls.completed) | "/" | eng3(io.calls.drain) | "(" | ws(3, 3, avgcomp) | "/drain)"
     192                                     |   " sub " | eng3(io.calls.flush) | "/" | eng3(io.calls.submitted) | "(" | ws(3, 3, avgsubs) | "/flush)"
     193                                     | " - cmp " | eng3(io.calls.drain) | "/" | eng3(io.calls.completed) | "(" | ws(3, 3, avgcomp) | "/drain)"
    202194                                     | " - " | eng3(io.calls.errors.busy) | " EBUSY";
    203                                 sstr | " - sub: " | eng3(io.flush.full) | "full, " | eng3(io.flush.dirty) | "drty, " | eng3(io.flush.idle) | "idle, " | eng3(io.flush.eager) | "eagr, " | eng3(io.flush.external) | "ext";
    204195                                sstr | "- ops blk: "
    205196                                     |   " sk rd: " | eng3(io.ops.sockread)  | "epll: " | eng3(io.ops.epllread)
  • libcfa/src/concurrency/stats.hfa

    rcef7430 r6b2d444  
    9191                        struct {
    9292                                volatile uint64_t external;
    93                                 volatile uint64_t dirty;
    94                                 volatile uint64_t full;
    95                                 volatile uint64_t idle;
    96                                 volatile uint64_t eager;
    9793                        } flush;
    9894                        struct {
  • src/AST/Copy.hpp

    rcef7430 r6b2d444  
    1010// Created On       : Wed Jul 10 16:13:00 2019
    1111// Last Modified By : Andrew Beach
    12 // Last Modified On : Wed Dec 15 11:07:00 2021
    13 // Update Count     : 3
     12// Last Modified On : Thr Nov 11  9:22:00 2021
     13// Update Count     : 2
    1414//
    1515
     
    5252Node * deepCopy<Node>( const Node * localRoot );
    5353
    54 template<typename node_t, enum Node::ref_type ref_t>
    55 node_t * shallowCopy( const ptr_base<node_t, ref_t> & localRoot ) {
    56         return shallowCopy( localRoot.get() );
    57 }
    58 
    59 template<typename node_t, enum Node::ref_type ref_t>
    60 node_t * deepCopy( const ptr_base<node_t, ref_t> & localRoot ) {
    61         return deepCopy( localRoot.get() );
    62 }
    63 
    6454}
    6555
  • src/AST/Node.hpp

    rcef7430 r6b2d444  
    188188        }
    189189
    190         ptr_base & operator=( const node_t * node ) {
    191                 assign( node );
    192                 return *this;
    193         }
    194 
    195190        template<typename o_node_t>
    196191        ptr_base & operator=( const o_node_t * node ) {
  • src/AST/Pass.impl.hpp

    rcef7430 r6b2d444  
    3333        /* call the implementation of the previsit of this pass */ \
    3434        __pass::previsit( core, node, 0 );
     35
     36#define VISIT( code... ) \
     37        /* if this node should visit its children */ \
     38        if ( __visit_children() ) { \
     39                /* visit the children */ \
     40                code \
     41        }
    3542
    3643#define VISIT_END( type, node ) \
     
    445452        VISIT_START( node );
    446453
    447         if ( __visit_children() ) {
     454        VISIT(
    448455                {
    449456                        guard_symtab guard { *this };
     
    453460                maybe_accept( node, &ObjectDecl::bitfieldWidth );
    454461                maybe_accept( node, &ObjectDecl::attributes    );
    455         }
     462        )
    456463
    457464        __pass::symtab::addId( core, 0, node );
     
    468475        __pass::symtab::addId( core, 0, node );
    469476
    470         if ( __visit_children() ) {
    471                 maybe_accept( node, &FunctionDecl::withExprs );
    472         }
     477        VISIT(maybe_accept( node, &FunctionDecl::withExprs );)
    473478        {
    474479                // with clause introduces a level of scope (for the with expression members).
     
    488493                        } };
    489494                        __pass::symtab::addId( core, 0, func );
    490                         if ( __visit_children() ) {
     495                        VISIT(
    491496                                // parameter declarations
    492497                                maybe_accept( node, &FunctionDecl::params );
     
    504509                                maybe_accept( node, &FunctionDecl::stmts );
    505510                                maybe_accept( node, &FunctionDecl::attributes );
    506                         }
     511                        )
    507512                }
    508513        }
     
    521526        __pass::symtab::addStructFwd( core, 0, node );
    522527
    523         if ( __visit_children() ) {
     528        VISIT({
    524529                guard_symtab guard { * this };
    525530                maybe_accept( node, &StructDecl::params     );
    526531                maybe_accept( node, &StructDecl::members    );
    527532                maybe_accept( node, &StructDecl::attributes );
    528         }
     533        })
    529534
    530535        // this addition replaces the forward declaration
     
    543548        __pass::symtab::addUnionFwd( core, 0, node );
    544549
    545         if ( __visit_children() ) {
     550        VISIT({
    546551                guard_symtab guard { * this };
    547552                maybe_accept( node, &UnionDecl::params     );
    548553                maybe_accept( node, &UnionDecl::members    );
    549554                maybe_accept( node, &UnionDecl::attributes );
    550         }
     555        })
    551556
    552557        __pass::symtab::addUnion( core, 0, node );
     
    563568        __pass::symtab::addEnum( core, 0, node );
    564569
    565         if ( __visit_children() ) {
     570        VISIT(
    566571                // unlike structs, traits, and unions, enums inject their members into the global scope
    567572                maybe_accept( node, &EnumDecl::params     );
    568573                maybe_accept( node, &EnumDecl::members    );
    569574                maybe_accept( node, &EnumDecl::attributes );
    570         }
     575        )
    571576
    572577        VISIT_END( Decl, node );
     
    579584        VISIT_START( node );
    580585
    581         if ( __visit_children() ) {
     586        VISIT({
    582587                guard_symtab guard { *this };
    583588                maybe_accept( node, &TraitDecl::params     );
    584589                maybe_accept( node, &TraitDecl::members    );
    585590                maybe_accept( node, &TraitDecl::attributes );
    586         }
     591        })
    587592
    588593        __pass::symtab::addTrait( core, 0, node );
     
    597602        VISIT_START( node );
    598603
    599         if ( __visit_children() ) {
     604        VISIT({
    600605                guard_symtab guard { *this };
    601606                maybe_accept( node, &TypeDecl::base   );
    602         }
     607        })
    603608
    604609        // see A NOTE ON THE ORDER OF TRAVERSAL, above
     
    607612        __pass::symtab::addType( core, 0, node );
    608613
    609         if ( __visit_children() ) {
     614        VISIT(
    610615                maybe_accept( node, &TypeDecl::assertions );
    611616
     
    614619                        maybe_accept( node, &TypeDecl::init );
    615620                }
    616         }
     621        )
    617622
    618623        VISIT_END( Decl, node );
     
    625630        VISIT_START( node );
    626631
    627         if ( __visit_children() ) {
     632        VISIT({
    628633                guard_symtab guard { *this };
    629634                maybe_accept( node, &TypedefDecl::base   );
    630         }
     635        })
    631636
    632637        __pass::symtab::addType( core, 0, node );
    633638
    634         if ( __visit_children() ) {
    635                 maybe_accept( node, &TypedefDecl::assertions );
    636         }
     639        VISIT( maybe_accept( node, &TypedefDecl::assertions ); )
    637640
    638641        VISIT_END( Decl, node );
     
    645648        VISIT_START( node );
    646649
    647         if ( __visit_children() ) {
     650        VISIT(
    648651                maybe_accept( node, &AsmDecl::stmt );
    649         }
     652        )
    650653
    651654        VISIT_END( AsmDecl, node );
     
    658661        VISIT_START( node );
    659662
    660         if ( __visit_children() ) {
     663        VISIT(
    661664                maybe_accept( node, &DirectiveDecl::stmt );
    662         }
     665        )
    663666
    664667        VISIT_END( DirectiveDecl, node );
     
    671674        VISIT_START( node );
    672675
    673         if ( __visit_children() ) {
     676        VISIT(
    674677                maybe_accept( node, &StaticAssertDecl::cond );
    675678                maybe_accept( node, &StaticAssertDecl::msg  );
    676         }
     679        )
    677680
    678681        VISIT_END( StaticAssertDecl, node );
     
    684687const ast::CompoundStmt * ast::Pass< core_t >::visit( const ast::CompoundStmt * node ) {
    685688        VISIT_START( node );
    686 
    687         if ( __visit_children() ) {
     689        VISIT(
    688690                // Do not enter (or leave) a new scope if atFunctionTop. Remember to save the result.
    689691                auto guard1 = makeFuncGuard( [this, enterScope = !this->atFunctionTop]() {
     
    702704                guard_scope guard3 { *this };
    703705                maybe_accept( node, &CompoundStmt::kids );
    704         }
    705 
     706        )
    706707        VISIT_END( CompoundStmt, node );
    707708}
     
    713714        VISIT_START( node );
    714715
    715         if ( __visit_children() ) {
     716        VISIT(
    716717                maybe_accept( node, &ExprStmt::expr );
    717         }
     718        )
    718719
    719720        VISIT_END( Stmt, node );
     
    726727        VISIT_START( node )
    727728
    728         if ( __visit_children() ) {
     729        VISIT(
    729730                maybe_accept( node, &AsmStmt::instruction );
    730731                maybe_accept( node, &AsmStmt::output      );
    731732                maybe_accept( node, &AsmStmt::input       );
    732733                maybe_accept( node, &AsmStmt::clobber     );
    733         }
     734        )
    734735
    735736        VISIT_END( Stmt, node );
     
    751752        VISIT_START( node );
    752753
    753         if ( __visit_children() ) {
     754        VISIT({
    754755                // if statements introduce a level of scope (for the initialization)
    755756                guard_symtab guard { *this };
     
    758759                maybe_accept_as_compound( node, &IfStmt::thenPart );
    759760                maybe_accept_as_compound( node, &IfStmt::elsePart );
    760         }
     761        })
    761762
    762763        VISIT_END( Stmt, node );
     
    769770        VISIT_START( node );
    770771
    771         if ( __visit_children() ) {
     772        VISIT({
    772773                // while statements introduce a level of scope (for the initialization)
    773774                guard_symtab guard { *this };
     
    775776                maybe_accept( node, &WhileStmt::cond  );
    776777                maybe_accept_as_compound( node, &WhileStmt::body  );
    777         }
     778        })
    778779
    779780        VISIT_END( Stmt, node );
     
    786787        VISIT_START( node );
    787788
    788         if ( __visit_children() ) {
     789        VISIT({
    789790                // for statements introduce a level of scope (for the initialization)
    790791                guard_symtab guard { *this };
     
    794795                maybe_accept( node, &ForStmt::inc   );
    795796                maybe_accept_as_compound( node, &ForStmt::body  );
    796         }
     797        })
    797798
    798799        VISIT_END( Stmt, node );
     
    805806        VISIT_START( node );
    806807
    807         if ( __visit_children() ) {
     808        VISIT(
    808809                maybe_accept( node, &SwitchStmt::cond  );
    809810                maybe_accept( node, &SwitchStmt::stmts );
    810         }
     811        )
    811812
    812813        VISIT_END( Stmt, node );
     
    819820        VISIT_START( node );
    820821
    821         if ( __visit_children() ) {
     822        VISIT(
    822823                maybe_accept( node, &CaseStmt::cond  );
    823824                maybe_accept( node, &CaseStmt::stmts );
    824         }
     825        )
    825826
    826827        VISIT_END( Stmt, node );
     
    841842        VISIT_START( node );
    842843
    843         if ( __visit_children() ) {
     844        VISIT(
    844845                maybe_accept( node, &ReturnStmt::expr );
    845         }
     846        )
    846847
    847848        VISIT_END( Stmt, node );
     
    854855        VISIT_START( node );
    855856
    856         if ( __visit_children() ) {
     857        VISIT(
    857858                maybe_accept( node, &ThrowStmt::expr   );
    858859                maybe_accept( node, &ThrowStmt::target );
    859         }
     860        )
    860861
    861862        VISIT_END( Stmt, node );
     
    868869        VISIT_START( node );
    869870
    870         if ( __visit_children() ) {
     871        VISIT(
    871872                maybe_accept( node, &TryStmt::body     );
    872873                maybe_accept( node, &TryStmt::handlers );
    873874                maybe_accept( node, &TryStmt::finally  );
    874         }
     875        )
    875876
    876877        VISIT_END( Stmt, node );
     
    883884        VISIT_START( node );
    884885
    885         if ( __visit_children() ) {
     886        VISIT({
    886887                // catch statements introduce a level of scope (for the caught exception)
    887888                guard_symtab guard { *this };
     
    889890                maybe_accept( node, &CatchStmt::cond );
    890891                maybe_accept_as_compound( node, &CatchStmt::body );
    891         }
     892        })
    892893
    893894        VISIT_END( Stmt, node );
     
    900901        VISIT_START( node );
    901902
    902         if ( __visit_children() ) {
     903        VISIT(
    903904                maybe_accept( node, &FinallyStmt::body );
    904         }
     905        )
    905906
    906907        VISIT_END( Stmt, node );
     
    913914        VISIT_START( node );
    914915
    915         if ( __visit_children() ) {
     916        VISIT(
    916917                maybe_accept( node, &SuspendStmt::then   );
    917         }
     918        )
    918919
    919920        VISIT_END( Stmt, node );
     
    933934                // }
    934935
    935         if ( __visit_children() ) {
     936        VISIT({
    936937                std::vector<WaitForStmt::Clause> new_clauses;
    937938                new_clauses.reserve( node->clauses.size() );
     
    964965                        node = n;
    965966                }
    966         }
     967        })
    967968
    968969        #define maybe_accept(field) \
     
    976977                }
    977978
    978         if ( __visit_children() ) {
     979        VISIT(
    979980                maybe_accept( timeout.time );
    980981                maybe_accept( timeout.stmt );
     
    982983                maybe_accept( orElse.stmt  );
    983984                maybe_accept( orElse.cond  );
    984         }
     985        )
    985986
    986987        #undef maybe_accept
     
    995996        VISIT_START( node );
    996997
    997         if ( __visit_children() ) {
     998        VISIT(
    998999                maybe_accept( node, &WithStmt::exprs );
    9991000                {
     
    10031004                        maybe_accept( node, &WithStmt::stmt );
    10041005                }
    1005         }
    1006 
     1006        )
    10071007        VISIT_END( Stmt, node );
    10081008}
     
    10221022        VISIT_START( node );
    10231023
    1024         if ( __visit_children() ) {
     1024        VISIT(
    10251025                maybe_accept( node, &DeclStmt::decl );
    1026         }
     1026        )
    10271027
    10281028        VISIT_END( Stmt, node );
     
    10371037        // For now this isn't visited, it is unclear if this causes problem
    10381038        // if all tests are known to pass, remove this code
    1039         if ( __visit_children() ) {
     1039        VISIT(
    10401040                maybe_accept( node, &ImplicitCtorDtorStmt::callStmt );
    1041         }
     1041        )
    10421042
    10431043        VISIT_END( Stmt, node );
     
    10501050        VISIT_START( node );
    10511051
    1052 <<<<<<< HEAD
    10531052        VISIT(
    10541053                maybe_accept( node, &MutexStmt::mutexObjs );
     
    10601059                }
    10611060        )
    1062 =======
    1063         if ( __visit_children() ) {
    1064                 // mutex statements introduce a level of scope (for the initialization)
    1065                 guard_symtab guard { *this };
    1066                 maybe_accept( node, &MutexStmt::stmt );
    1067                 maybe_accept( node, &MutexStmt::mutexObjs );
    1068         }
    1069 >>>>>>> e21f2536b7495654ded040259b42b7e2325b8360
    10701061
    10711062        VISIT_END( Stmt, node );
     
    10781069        VISIT_START( node );
    10791070
    1080         if ( __visit_children() ) {
     1071        VISIT(
    10811072                {
    10821073                        guard_symtab guard { *this };
     
    10851076                maybe_accept( node, &ApplicationExpr::func );
    10861077                maybe_accept( node, &ApplicationExpr::args );
    1087         }
     1078        )
    10881079
    10891080        VISIT_END( Expr, node );
     
    10961087        VISIT_START( node );
    10971088
    1098         if ( __visit_children() ) {
     1089        VISIT(
    10991090                {
    11001091                        guard_symtab guard { *this };
     
    11031094
    11041095                maybe_accept( node, &UntypedExpr::args );
    1105         }
     1096        )
    11061097
    11071098        VISIT_END( Expr, node );
     
    11141105        VISIT_START( node );
    11151106
    1116         if ( __visit_children() ) {
     1107        VISIT({
    11171108                guard_symtab guard { *this };
    11181109                maybe_accept( node, &NameExpr::result );
    1119         }
     1110        })
    11201111
    11211112        VISIT_END( Expr, node );
     
    11281119        VISIT_START( node );
    11291120
    1130         if ( __visit_children() ) {
    1131                 {
     1121        VISIT({
    11321122                        guard_symtab guard { *this };
    11331123                        maybe_accept( node, &CastExpr::result );
    11341124                }
    11351125                maybe_accept( node, &CastExpr::arg );
    1136         }
     1126        )
    11371127
    11381128        VISIT_END( Expr, node );
     
    11451135        VISIT_START( node );
    11461136
    1147         if ( __visit_children() ) {
    1148                 {
     1137        VISIT({
    11491138                        guard_symtab guard { *this };
    11501139                        maybe_accept( node, &KeywordCastExpr::result );
    11511140                }
    11521141                maybe_accept( node, &KeywordCastExpr::arg );
    1153         }
     1142        )
    11541143
    11551144        VISIT_END( Expr, node );
     
    11621151        VISIT_START( node );
    11631152
    1164         if ( __visit_children() ) {
    1165                 {
     1153        VISIT({
    11661154                        guard_symtab guard { *this };
    11671155                        maybe_accept( node, &VirtualCastExpr::result );
    11681156                }
    11691157                maybe_accept( node, &VirtualCastExpr::arg );
    1170         }
     1158        )
    11711159
    11721160        VISIT_END( Expr, node );
     
    11791167        VISIT_START( node );
    11801168
    1181         if ( __visit_children() ) {
    1182                 {
     1169        VISIT({
    11831170                        guard_symtab guard { *this };
    11841171                        maybe_accept( node, &AddressExpr::result );
    11851172                }
    11861173                maybe_accept( node, &AddressExpr::arg );
    1187         }
     1174        )
    11881175
    11891176        VISIT_END( Expr, node );
     
    11961183        VISIT_START( node );
    11971184
    1198         if ( __visit_children() ) {
     1185        VISIT({
    11991186                guard_symtab guard { *this };
    12001187                maybe_accept( node, &LabelAddressExpr::result );
    1201         }
     1188        })
    12021189
    12031190        VISIT_END( Expr, node );
     
    12101197        VISIT_START( node );
    12111198
    1212         if ( __visit_children() ) {
    1213                 {
     1199        VISIT({
    12141200                        guard_symtab guard { *this };
    12151201                        maybe_accept( node, &UntypedMemberExpr::result );
     
    12171203                maybe_accept( node, &UntypedMemberExpr::aggregate );
    12181204                maybe_accept( node, &UntypedMemberExpr::member    );
    1219         }
     1205        )
    12201206
    12211207        VISIT_END( Expr, node );
     
    12281214        VISIT_START( node );
    12291215
    1230         if ( __visit_children() ) {
    1231                 {
     1216        VISIT({
    12321217                        guard_symtab guard { *this };
    12331218                        maybe_accept( node, &MemberExpr::result );
    12341219                }
    12351220                maybe_accept( node, &MemberExpr::aggregate );
    1236         }
     1221        )
    12371222
    12381223        VISIT_END( Expr, node );
     
    12451230        VISIT_START( node );
    12461231
    1247         if ( __visit_children() ) {
     1232        VISIT({
    12481233                guard_symtab guard { *this };
    12491234                maybe_accept( node, &VariableExpr::result );
    1250         }
     1235        })
    12511236
    12521237        VISIT_END( Expr, node );
     
    12591244        VISIT_START( node );
    12601245
    1261         if ( __visit_children() ) {
     1246        VISIT({
    12621247                guard_symtab guard { *this };
    12631248                maybe_accept( node, &ConstantExpr::result );
    1264         }
     1249        })
    12651250
    12661251        VISIT_END( Expr, node );
     
    12731258        VISIT_START( node );
    12741259
    1275         if ( __visit_children() ) {
    1276                 {
     1260        VISIT({
    12771261                        guard_symtab guard { *this };
    12781262                        maybe_accept( node, &SizeofExpr::result );
     
    12831267                        maybe_accept( node, &SizeofExpr::expr );
    12841268                }
    1285         }
     1269        )
    12861270
    12871271        VISIT_END( Expr, node );
     
    12941278        VISIT_START( node );
    12951279
    1296         if ( __visit_children() ) {
    1297                 {
     1280        VISIT({
    12981281                        guard_symtab guard { *this };
    12991282                        maybe_accept( node, &AlignofExpr::result );
     
    13041287                        maybe_accept( node, &AlignofExpr::expr );
    13051288                }
    1306         }
     1289        )
    13071290
    13081291        VISIT_END( Expr, node );
     
    13151298        VISIT_START( node );
    13161299
    1317         if ( __visit_children() ) {
    1318                 {
     1300        VISIT({
    13191301                        guard_symtab guard { *this };
    13201302                        maybe_accept( node, &UntypedOffsetofExpr::result );
    13211303                }
    13221304                maybe_accept( node, &UntypedOffsetofExpr::type   );
    1323         }
     1305        )
    13241306
    13251307        VISIT_END( Expr, node );
     
    13321314        VISIT_START( node );
    13331315
    1334         if ( __visit_children() ) {
    1335                 {
     1316        VISIT({
    13361317                        guard_symtab guard { *this };
    13371318                        maybe_accept( node, &OffsetofExpr::result );
    13381319                }
    13391320                maybe_accept( node, &OffsetofExpr::type   );
    1340         }
     1321        )
    13411322
    13421323        VISIT_END( Expr, node );
     
    13491330        VISIT_START( node );
    13501331
    1351         if ( __visit_children() ) {
    1352                 {
     1332        VISIT({
    13531333                        guard_symtab guard { *this };
    13541334                        maybe_accept( node, &OffsetPackExpr::result );
    13551335                }
    13561336                maybe_accept( node, &OffsetPackExpr::type   );
    1357         }
     1337        )
    13581338
    13591339        VISIT_END( Expr, node );
     
    13661346        VISIT_START( node );
    13671347
    1368         if ( __visit_children() ) {
    1369                 {
     1348        VISIT({
    13701349                        guard_symtab guard { *this };
    13711350                        maybe_accept( node, &LogicalExpr::result );
     
    13731352                maybe_accept( node, &LogicalExpr::arg1 );
    13741353                maybe_accept( node, &LogicalExpr::arg2 );
    1375         }
     1354        )
    13761355
    13771356        VISIT_END( Expr, node );
     
    13841363        VISIT_START( node );
    13851364
    1386         if ( __visit_children() ) {
    1387                 {
     1365        VISIT({
    13881366                        guard_symtab guard { *this };
    13891367                        maybe_accept( node, &ConditionalExpr::result );
     
    13921370                maybe_accept( node, &ConditionalExpr::arg2 );
    13931371                maybe_accept( node, &ConditionalExpr::arg3 );
    1394         }
     1372        )
    13951373
    13961374        VISIT_END( Expr, node );
     
    14031381        VISIT_START( node );
    14041382
    1405         if ( __visit_children() ) {
    1406                 {
     1383        VISIT({
    14071384                        guard_symtab guard { *this };
    14081385                        maybe_accept( node, &CommaExpr::result );
     
    14101387                maybe_accept( node, &CommaExpr::arg1 );
    14111388                maybe_accept( node, &CommaExpr::arg2 );
    1412         }
     1389        )
    14131390
    14141391        VISIT_END( Expr, node );
     
    14211398        VISIT_START( node );
    14221399
    1423         if ( __visit_children() ) {
    1424                 {
     1400        VISIT({
    14251401                        guard_symtab guard { *this };
    14261402                        maybe_accept( node, &TypeExpr::result );
    14271403                }
    14281404                maybe_accept( node, &TypeExpr::type );
    1429         }
     1405        )
    14301406
    14311407        VISIT_END( Expr, node );
     
    14381414        VISIT_START( node );
    14391415
    1440         if ( __visit_children() ) {
    1441                 {
     1416        VISIT({
    14421417                        guard_symtab guard { *this };
    14431418                        maybe_accept( node, &AsmExpr::result );
     
    14451420                maybe_accept( node, &AsmExpr::constraint );
    14461421                maybe_accept( node, &AsmExpr::operand    );
    1447         }
     1422        )
    14481423
    14491424        VISIT_END( Expr, node );
     
    14561431        VISIT_START( node );
    14571432
    1458         if ( __visit_children() ) {
    1459                 {
     1433        VISIT({
    14601434                        guard_symtab guard { *this };
    14611435                        maybe_accept( node, &ImplicitCopyCtorExpr::result );
    14621436                }
    14631437                maybe_accept( node, &ImplicitCopyCtorExpr::callExpr    );
    1464         }
     1438        )
    14651439
    14661440        VISIT_END( Expr, node );
     
    14731447        VISIT_START( node );
    14741448
    1475         if ( __visit_children() ) {
    1476                 {
     1449        VISIT({
    14771450                        guard_symtab guard { *this };
    14781451                        maybe_accept( node, &ConstructorExpr::result );
    14791452                }
    14801453                maybe_accept( node, &ConstructorExpr::callExpr );
    1481         }
     1454        )
    14821455
    14831456        VISIT_END( Expr, node );
     
    14901463        VISIT_START( node );
    14911464
    1492         if ( __visit_children() ) {
    1493                 {
     1465        VISIT({
    14941466                        guard_symtab guard { *this };
    14951467                        maybe_accept( node, &CompoundLiteralExpr::result );
    14961468                }
    14971469                maybe_accept( node, &CompoundLiteralExpr::init );
    1498         }
     1470        )
    14991471
    15001472        VISIT_END( Expr, node );
     
    15071479        VISIT_START( node );
    15081480
    1509         if ( __visit_children() ) {
    1510                 {
     1481        VISIT({
    15111482                        guard_symtab guard { *this };
    15121483                        maybe_accept( node, &RangeExpr::result );
     
    15141485                maybe_accept( node, &RangeExpr::low    );
    15151486                maybe_accept( node, &RangeExpr::high   );
    1516         }
     1487        )
    15171488
    15181489        VISIT_END( Expr, node );
     
    15251496        VISIT_START( node );
    15261497
    1527         if ( __visit_children() ) {
    1528                 {
     1498        VISIT({
    15291499                        guard_symtab guard { *this };
    15301500                        maybe_accept( node, &UntypedTupleExpr::result );
    15311501                }
    15321502                maybe_accept( node, &UntypedTupleExpr::exprs  );
    1533         }
     1503        )
    15341504
    15351505        VISIT_END( Expr, node );
     
    15421512        VISIT_START( node );
    15431513
    1544         if ( __visit_children() ) {
    1545                 {
     1514        VISIT({
    15461515                        guard_symtab guard { *this };
    15471516                        maybe_accept( node, &TupleExpr::result );
    15481517                }
    15491518                maybe_accept( node, &TupleExpr::exprs  );
    1550         }
     1519        )
    15511520
    15521521        VISIT_END( Expr, node );
     
    15591528        VISIT_START( node );
    15601529
    1561         if ( __visit_children() ) {
    1562                 {
     1530        VISIT({
    15631531                        guard_symtab guard { *this };
    15641532                        maybe_accept( node, &TupleIndexExpr::result );
    15651533                }
    15661534                maybe_accept( node, &TupleIndexExpr::tuple  );
    1567         }
     1535        )
    15681536
    15691537        VISIT_END( Expr, node );
     
    15761544        VISIT_START( node );
    15771545
    1578         if ( __visit_children() ) {
    1579                 {
     1546        VISIT({
    15801547                        guard_symtab guard { *this };
    15811548                        maybe_accept( node, &TupleAssignExpr::result );
    15821549                }
    15831550                maybe_accept( node, &TupleAssignExpr::stmtExpr );
    1584         }
     1551        )
    15851552
    15861553        VISIT_END( Expr, node );
     
    15931560        VISIT_START( node );
    15941561
    1595         if ( __visit_children() ) {
    1596                 // don't want statements from outer CompoundStmts to be added to this StmtExpr
     1562        VISIT(// don't want statements from outer CompoundStmts to be added to this StmtExpr
    15971563                // get the stmts that will need to be spliced in
    15981564                auto stmts_before = __pass::stmtsToAddBefore( core, 0);
     
    16111577                maybe_accept( node, &StmtExpr::returnDecls );
    16121578                maybe_accept( node, &StmtExpr::dtors       );
    1613         }
     1579        )
    16141580
    16151581        VISIT_END( Expr, node );
     
    16221588        VISIT_START( node );
    16231589
    1624         if ( __visit_children() ) {
    1625                 {
     1590        VISIT({
    16261591                        guard_symtab guard { *this };
    16271592                        maybe_accept( node, &UniqueExpr::result );
    16281593                }
    16291594                maybe_accept( node, &UniqueExpr::expr   );
    1630         }
     1595        )
    16311596
    16321597        VISIT_END( Expr, node );
     
    16391604        VISIT_START( node );
    16401605
    1641         if ( __visit_children() ) {
    1642                 {
     1606        VISIT({
    16431607                        guard_symtab guard { *this };
    16441608                        maybe_accept( node, &UntypedInitExpr::result );
     
    16461610                maybe_accept( node, &UntypedInitExpr::expr   );
    16471611                // not currently visiting initAlts, but this doesn't matter since this node is only used in the resolver.
    1648         }
     1612        )
    16491613
    16501614        VISIT_END( Expr, node );
     
    16571621        VISIT_START( node );
    16581622
    1659         if ( __visit_children() ) {
    1660                 {
     1623        VISIT({
    16611624                        guard_symtab guard { *this };
    16621625                        maybe_accept( node, &InitExpr::result );
     
    16641627                maybe_accept( node, &InitExpr::expr   );
    16651628                maybe_accept( node, &InitExpr::designation );
    1666         }
     1629        )
    16671630
    16681631        VISIT_END( Expr, node );
     
    16751638        VISIT_START( node );
    16761639
    1677         if ( __visit_children() ) {
    1678                 {
     1640        VISIT({
    16791641                        guard_symtab guard { *this };
    16801642                        maybe_accept( node, &DeletedExpr::result );
     
    16821644                maybe_accept( node, &DeletedExpr::expr );
    16831645                // don't visit deleteStmt, because it is a pointer to somewhere else in the tree.
    1684         }
     1646        )
    16851647
    16861648        VISIT_END( Expr, node );
     
    16931655        VISIT_START( node );
    16941656
    1695         if ( __visit_children() ) {
    1696                 {
     1657        VISIT({
    16971658                        guard_symtab guard { *this };
    16981659                        maybe_accept( node, &DefaultArgExpr::result );
    16991660                }
    17001661                maybe_accept( node, &DefaultArgExpr::expr );
    1701         }
     1662        )
    17021663
    17031664        VISIT_END( Expr, node );
     
    17101671        VISIT_START( node );
    17111672
    1712         if ( __visit_children() ) {
    1713                 {
     1673        VISIT({
    17141674                        guard_symtab guard { *this };
    17151675                        maybe_accept( node, &GenericExpr::result );
     
    17401700                        node = n;
    17411701                }
    1742         }
     1702        )
    17431703
    17441704        VISIT_END( Expr, node );
     
    17691729        VISIT_START( node );
    17701730
    1771         if ( __visit_children() ) {
     1731        VISIT(
    17721732                // xxx - should PointerType visit/mutate dimension?
    17731733                maybe_accept( node, &PointerType::base );
    1774         }
     1734        )
    17751735
    17761736        VISIT_END( Type, node );
     
    17831743        VISIT_START( node );
    17841744
    1785         if ( __visit_children() ) {
     1745        VISIT(
    17861746                maybe_accept( node, &ArrayType::dimension );
    17871747                maybe_accept( node, &ArrayType::base );
    1788         }
     1748        )
    17891749
    17901750        VISIT_END( Type, node );
     
    17971757        VISIT_START( node );
    17981758
    1799         if ( __visit_children() ) {
     1759        VISIT(
    18001760                maybe_accept( node, &ReferenceType::base );
    1801         }
     1761        )
    18021762
    18031763        VISIT_END( Type, node );
     
    18101770        VISIT_START( node );
    18111771
    1812         if ( __visit_children() ) {
     1772        VISIT(
    18131773                maybe_accept( node, &QualifiedType::parent );
    18141774                maybe_accept( node, &QualifiedType::child );
    1815         }
     1775        )
    18161776
    18171777        VISIT_END( Type, node );
     
    18241784        VISIT_START( node );
    18251785
    1826         if ( __visit_children() ) {
     1786        VISIT({
    18271787                // guard_forall_subs forall_guard { *this, node };
    18281788                // mutate_forall( node );
     
    18301790                maybe_accept( node, &FunctionType::returns );
    18311791                maybe_accept( node, &FunctionType::params  );
    1832         }
     1792        })
    18331793
    18341794        VISIT_END( Type, node );
     
    18431803        __pass::symtab::addStruct( core, 0, node->name );
    18441804
    1845         if ( __visit_children() ) {
     1805        VISIT({
    18461806                guard_symtab guard { *this };
    18471807                maybe_accept( node, &StructInstType::params );
    1848         }
     1808        })
    18491809
    18501810        VISIT_END( Type, node );
     
    18591819        __pass::symtab::addUnion( core, 0, node->name );
    18601820
    1861         if ( __visit_children() ) {
     1821        VISIT({
    18621822                guard_symtab guard { *this };
    18631823                maybe_accept( node, &UnionInstType::params );
    1864         }
     1824        })
    18651825
    18661826        VISIT_END( Type, node );
     
    18731833        VISIT_START( node );
    18741834
    1875         if ( __visit_children() ) {
     1835        VISIT({
    18761836                maybe_accept( node, &EnumInstType::params );
    1877         }
     1837        })
    18781838
    18791839        VISIT_END( Type, node );
     
    18861846        VISIT_START( node );
    18871847
    1888         if ( __visit_children() ) {
     1848        VISIT({
    18891849                maybe_accept( node, &TraitInstType::params );
    1890         }
     1850        })
    18911851
    18921852        VISIT_END( Type, node );
     
    18991859        VISIT_START( node );
    19001860
    1901         if ( __visit_children() ) {
     1861        VISIT(
    19021862                {
    19031863                        maybe_accept( node, &TypeInstType::params );
     
    19051865                // ensure that base re-bound if doing substitution
    19061866                __pass::forall::replace( core, 0, node );
    1907         }
     1867        )
    19081868
    19091869        VISIT_END( Type, node );
     
    19161876        VISIT_START( node );
    19171877
    1918         if ( __visit_children() ) {
     1878        VISIT(
    19191879                maybe_accept( node, &TupleType::types );
    19201880                maybe_accept( node, &TupleType::members );
    1921         }
     1881        )
    19221882
    19231883        VISIT_END( Type, node );
     
    19301890        VISIT_START( node );
    19311891
    1932         if ( __visit_children() ) {
     1892        VISIT(
    19331893                maybe_accept( node, &TypeofType::expr );
    1934         }
     1894        )
    19351895
    19361896        VISIT_END( Type, node );
     
    19431903        VISIT_START( node );
    19441904
    1945         if ( __visit_children() ) {
     1905        VISIT(
    19461906                maybe_accept( node, &VTableType::base );
    1947         }
     1907        )
    19481908
    19491909        VISIT_END( Type, node );
     
    19931953        VISIT_START( node );
    19941954
    1995         if ( __visit_children() ) {
    1996                 maybe_accept( node, &Designation::designators );
    1997         }
     1955        VISIT( maybe_accept( node, &Designation::designators ); )
    19981956
    19991957        VISIT_END( Designation, node );
     
    20061964        VISIT_START( node );
    20071965
    2008         if ( __visit_children() ) {
     1966        VISIT(
    20091967                maybe_accept( node, &SingleInit::value );
    2010         }
     1968        )
    20111969
    20121970        VISIT_END( Init, node );
     
    20191977        VISIT_START( node );
    20201978
    2021         if ( __visit_children() ) {
     1979        VISIT(
    20221980                maybe_accept( node, &ListInit::designations );
    20231981                maybe_accept( node, &ListInit::initializers );
    2024         }
     1982        )
    20251983
    20261984        VISIT_END( Init, node );
     
    20331991        VISIT_START( node );
    20341992
    2035         if ( __visit_children() ) {
     1993        VISIT(
    20361994                maybe_accept( node, &ConstructorInit::ctor );
    20371995                maybe_accept( node, &ConstructorInit::dtor );
    20381996                maybe_accept( node, &ConstructorInit::init );
    2039         }
     1997        )
    20401998
    20411999        VISIT_END( Init, node );
     
    20482006        VISIT_START( node );
    20492007
    2050         if ( __visit_children() ) {
     2008        VISIT(
    20512009                maybe_accept( node, &Attribute::params );
    2052         }
     2010        )
    20532011
    20542012        VISIT_END( Attribute, node );
     
    20612019        VISIT_START( node );
    20622020
    2063         if ( __visit_children() ) {
     2021        VISIT(
    20642022                {
    20652023                        bool mutated = false;
     
    20772035                        }
    20782036                }
    2079         }
     2037        )
    20802038
    20812039        VISIT_END( TypeSubstitution, node );
     
    20832041
    20842042#undef VISIT_START
     2043#undef VISIT
    20852044#undef VISIT_END
  • src/ControlStruct/module.mk

    rcef7430 r6b2d444  
    2222        ControlStruct/ForExprMutator.cc \
    2323        ControlStruct/ForExprMutator.h \
    24         ControlStruct/HoistControlDecls.cpp \
    25         ControlStruct/HoistControlDecls.hpp \
    2624        ControlStruct/LabelFixer.cc \
    2725        ControlStruct/LabelFixer.h \
  • src/InitTweak/InitTweak.cc

    rcef7430 r6b2d444  
    1010// Created On       : Fri May 13 11:26:36 2016
    1111// Last Modified By : Andrew Beach
    12 // Last Modified On : Mon Dec  6 13:21:00 2021
    13 // Update Count     : 20
     12// Last Modified On : Fri Nov 19 19:22:00 2021
     13// Update Count     : 19
    1414//
    1515
     
    11911191        }
    11921192
    1193 bool isAssignment( const ast::FunctionDecl * decl ) {
    1194         return isAssignment( decl->name ) && isCopyFunction( decl );
    1195 }
    1196 
    1197 bool isDestructor( const ast::FunctionDecl * decl ) {
    1198         return isDestructor( decl->name );
    1199 }
    1200 
    1201 bool isDefaultConstructor( const ast::FunctionDecl * decl ) {
    1202         return isConstructor( decl->name ) && 1 == decl->params.size();
    1203 }
    1204 
    1205 bool isCopyConstructor( const ast::FunctionDecl * decl ) {
    1206         return isConstructor( decl->name ) && 2 == decl->params.size();
    1207 }
    1208 
    1209 bool isCopyFunction( const ast::FunctionDecl * decl ) {
    1210         const ast::FunctionType * ftype = decl->type;
    1211         if ( ftype->params.size() != 2 ) return false;
    1212 
    1213         const ast::Type * t1 = getPointerBase( ftype->params.front() );
    1214         if ( ! t1 ) return false;
    1215         const ast::Type * t2 = ftype->params.back();
    1216 
    1217         return ResolvExpr::typesCompatibleIgnoreQualifiers( t1, t2, ast::SymbolTable{} );
    1218 }
     1193        bool isCopyFunction( const ast::FunctionDecl * decl ) {
     1194                const ast::FunctionType * ftype = decl->type;
     1195                if ( ftype->params.size() != 2 ) return false;
     1196
     1197                const ast::Type * t1 = getPointerBase( ftype->params.front() );
     1198                if ( ! t1 ) return false;
     1199                const ast::Type * t2 = ftype->params.back();
     1200
     1201                return ResolvExpr::typesCompatibleIgnoreQualifiers( t1, t2, ast::SymbolTable{} );
     1202        }
    12191203
    12201204        const FunctionDecl * isAssignment( const Declaration * decl ) {
  • src/InitTweak/InitTweak.h

    rcef7430 r6b2d444  
    1010// Created On       : Fri May 13 11:26:36 2016
    1111// Last Modified By : Andrew Beach
    12 // Last Modified On : Mon Dec  6 13:20:00 2021
    13 // Update Count     : 8
     12// Last Modified On : Fri Nov 19 14:18:00 2021
     13// Update Count     : 7
    1414//
    1515
     
    3131        const FunctionDecl * isCopyConstructor( const Declaration * decl );
    3232        const FunctionDecl * isCopyFunction( const Declaration * decl, const std::string & fname );
    33         bool isAssignment( const ast::FunctionDecl * decl );
    34         bool isDestructor( const ast::FunctionDecl * decl );
    35         bool isDefaultConstructor( const ast::FunctionDecl * decl );
    36         bool isCopyConstructor( const ast::FunctionDecl * decl );
    3733        bool isCopyFunction( const ast::FunctionDecl * decl );
    3834
  • src/SymTab/Validate.cc

    rcef7430 r6b2d444  
    453453        }
    454454
    455         void decayForallPointers( std::list< Declaration * > & translationUnit ) {
    456                 PassVisitor<ForallPointerDecay_old> fpd;
    457                 acceptAll( translationUnit, fpd );
    458         }
    459 
    460455        void validate( std::list< Declaration * > &translationUnit, __attribute__((unused)) bool doDebug ) {
    461456                validate_A( translationUnit );
     
    475470                type->accept( fpd );
    476471        }
     472
    477473
    478474        void HoistTypeDecls::handleType( Type * type ) {
  • src/SymTab/Validate.h

    rcef7430 r6b2d444  
    4242        void validate_E( std::list< Declaration * > &translationUnit );
    4343        void validate_F( std::list< Declaration * > &translationUnit );
    44         void decayForallPointers( std::list< Declaration * > & translationUnit );
    4544
    4645        const ast::Type * validateType(
  • src/Validate/module.mk

    rcef7430 r6b2d444  
    1616
    1717SRC_VALIDATE = \
    18         Validate/Autogen.cpp \
    19         Validate/Autogen.hpp \
    2018        Validate/CompoundLiteral.cpp \
    2119        Validate/CompoundLiteral.hpp \
  • src/main.cc

    rcef7430 r6b2d444  
    1010// Created On       : Fri May 15 23:12:02 2015
    1111// Last Modified By : Andrew Beach
    12 // Last Modified On : Wed Jan 26 14:09:00 2022
    13 // Update Count     : 670
     12// Last Modified On : Tue Nov 30 10:25:00 2021
     13// Update Count     : 659
    1414//
    1515
     
    5555#include "ControlStruct/ExceptTranslate.h"  // for translateEHM
    5656#include "ControlStruct/FixLabels.hpp"      // for fixLabels
    57 #include "ControlStruct/HoistControlDecls.hpp" //  hoistControlDecls
    5857#include "ControlStruct/Mutate.h"           // for mutate
    5958#include "GenPoly/Box.h"                    // for box
     
    7473#include "SynTree/Visitor.h"                // for acceptAll
    7574#include "Tuples/Tuples.h"                  // for expandMemberTuples, expan...
    76 #include "Validate/Autogen.hpp"             // for autogenerateRoutines
    7775#include "Validate/FindSpecialDecls.h"      // for findGlobalDecls
    7876#include "Validate/CompoundLiteral.hpp"     // for handleCompoundLiterals
     
    8078#include "Validate/LabelAddressFixer.hpp"   // for fixLabelAddresses
    8179#include "Virtual/ExpandCasts.h"            // for expandCasts
     80
    8281
    8382static void NewPass( const char * const name ) {
     
    327326                PASS( "Validate-B", SymTab::validate_B( translationUnit ) );
    328327                PASS( "Validate-C", SymTab::validate_C( translationUnit ) );
     328                PASS( "Validate-D", SymTab::validate_D( translationUnit ) );
    329329
    330330                CodeTools::fillLocations( translationUnit );
    331331
    332332                if( useNewAST ) {
    333                         PASS( "Apply Concurrent Keywords", Concurrency::applyKeywords( translationUnit ) );
    334                         PASS( "Forall Pointer Decay", SymTab::decayForallPointers( translationUnit ) );
    335                         CodeTools::fillLocations( translationUnit );
    336 
    337333                        if (Stats::Counters::enabled) {
    338334                                ast::pass_visitor_stats.avg = Stats::Counters::build<Stats::Counters::AverageCounter<double>>("Average Depth - New");
     
    342338
    343339                        forceFillCodeLocations( transUnit );
    344 
    345                         // Must happen before autogen routines are added.
    346                         PASS( "Hoist Control Declarations", ControlStruct::hoistControlDecls( transUnit ) );
    347 
    348                         // Must be after enum and pointer decay.
    349                         // Must be before compound literals.
    350                         PASS( "Generate Autogen Routines", Validate::autogenerateRoutines( transUnit ) );
    351340
    352341                        PASS( "Implement Mutex", Concurrency::implementMutex( transUnit ) );
     
    417406                        translationUnit = convert( move( transUnit ) );
    418407                } else {
    419                         PASS( "Validate-D", SymTab::validate_D( translationUnit ) );
    420408                        PASS( "Validate-E", SymTab::validate_E( translationUnit ) );
    421409                        PASS( "Validate-F", SymTab::validate_F( translationUnit ) );
Note: See TracChangeset for help on using the changeset viewer.