Changeset ba3706f for src/Concurrency


Ignore:
Timestamp:
Nov 30, 2017, 4:43:59 PM (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:
c50d54d
Parents:
4429b04
Message:

Remove label lists from various Statement constructors

Location:
src/Concurrency
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • src/Concurrency/Keywords.cc

    r4429b04 rba3706f  
    3838
    3939namespace Concurrency {
    40 
    41         namespace {
    42                 const std::list<Label> noLabels;
    43                 const std::list< Attribute * > noAttributes;
    44                 Type::StorageClasses noStorage;
    45                 Type::Qualifiers noQualifiers;
    46         }
    47 
    4840        //=============================================================================================
    4941        // Pass declarations
     
    296288                ObjectDecl * this_decl = new ObjectDecl(
    297289                        "this",
    298                         noStorage,
     290                        noStorageClasses,
    299291                        LinkageSpec::Cforall,
    300292                        nullptr,
     
    313305                        new ObjectDecl(
    314306                                "ret",
    315                                 noStorage,
     307                                noStorageClasses,
    316308                                LinkageSpec::Cforall,
    317309                                nullptr,
     
    346338                        main_decl = new FunctionDecl(
    347339                                "main",
    348                                 noStorage,
     340                                noStorageClasses,
    349341                                LinkageSpec::Cforall,
    350342                                main_type,
     
    363355                ObjectDecl * field = new ObjectDecl(
    364356                        field_name,
    365                         noStorage,
     357                        noStorageClasses,
    366358                        LinkageSpec::Cforall,
    367359                        nullptr,
     
    379371
    380372        void ConcurrentSueKeyword::addRoutines( ObjectDecl * field, FunctionDecl * func ) {
    381                 CompoundStmt * statement = new CompoundStmt( noLabels );
     373                CompoundStmt * statement = new CompoundStmt();
    382374                statement->push_back(
    383375                        new ReturnStmt(
    384                                 noLabels,
    385376                                new AddressExpr(
    386377                                        new MemberExpr(
     
    488479                ObjectDecl * monitors = new ObjectDecl(
    489480                        "__monitor",
    490                         noStorage,
     481                        noStorageClasses,
    491482                        LinkageSpec::Cforall,
    492483                        nullptr,
     
    509500                // monitor_guard_t __guard = { __monitors, #, func };
    510501                body->push_front(
    511                         new DeclStmt( noLabels, new ObjectDecl(
     502                        new DeclStmt( new ObjectDecl(
    512503                                "__guard",
    513                                 noStorage,
     504                                noStorageClasses,
    514505                                LinkageSpec::Cforall,
    515506                                nullptr,
     
    530521
    531522                //monitor_desc * __monitors[] = { get_monitor(a), get_monitor(b) };
    532                 body->push_front( new DeclStmt( noLabels, monitors) );
     523                body->push_front( new DeclStmt( monitors) );
    533524        }
    534525
     
    536527                ObjectDecl * monitors = new ObjectDecl(
    537528                        "__monitors",
    538                         noStorage,
     529                        noStorageClasses,
    539530                        LinkageSpec::Cforall,
    540531                        nullptr,
     
    569560                // monitor_guard_t __guard = { __monitors, #, func };
    570561                body->push_front(
    571                         new DeclStmt( noLabels, new ObjectDecl(
     562                        new DeclStmt( new ObjectDecl(
    572563                                "__guard",
    573                                 noStorage,
     564                                noStorageClasses,
    574565                                LinkageSpec::Cforall,
    575566                                nullptr,
     
    591582
    592583                //monitor_desc * __monitors[] = { get_monitor(a), get_monitor(b) };
    593                 body->push_front( new DeclStmt( noLabels, monitors) );
     584                body->push_front( new DeclStmt( monitors) );
    594585        }
    595586
     
    631622                stmt->push_back(
    632623                        new ExprStmt(
    633                                 noLabels,
    634624                                new UntypedExpr(
    635625                                        new NameExpr( "__thrd_start" ),
  • src/Concurrency/Waitfor.cc

    r4429b04 rba3706f  
    100100
    101101namespace Concurrency {
    102 
    103         namespace {
    104                 const std::list<Label> noLabels;
    105                 const std::list< Attribute * > noAttributes;
    106                 Type::StorageClasses noStorage;
    107                 Type::Qualifiers noQualifiers;
    108         }
    109 
    110102        //=============================================================================================
    111103        // Pass declarations
     
    203195                        ResolvExpr::findVoidExpression( expr, indexer );
    204196
    205                         return new ExprStmt( noLabels, expr );
     197                        return new ExprStmt( expr );
    206198                }
    207199
     
    259251                if( !decl_monitor || !decl_acceptable || !decl_mask ) throw SemanticError( "waitfor keyword requires monitors to be in scope, add #include <monitor>", waitfor );
    260252
    261                 CompoundStmt * stmt = new CompoundStmt( noLabels );
     253                CompoundStmt * stmt = new CompoundStmt();
    262254
    263255                ObjectDecl * acceptables = declare( waitfor->clauses.size(), stmt );
     
    281273                );
    282274
    283                 CompoundStmt * compound = new CompoundStmt( noLabels );
     275                CompoundStmt * compound = new CompoundStmt();
    284276                stmt->push_back( new IfStmt(
    285                         noLabels,
    286277                        safeCond( new VariableExpr( flag ) ),
    287278                        compound,
     
    313304                );
    314305
    315                 stmt->push_back( new DeclStmt( noLabels, acceptables) );
     306                stmt->push_back( new DeclStmt( acceptables) );
    316307
    317308                Expression * set = new UntypedExpr(
     
    326317                ResolvExpr::findVoidExpression( set, indexer );
    327318
    328                 stmt->push_back( new ExprStmt( noLabels, set ) );
     319                stmt->push_back( new ExprStmt( set ) );
    329320
    330321                return acceptables;
     
    341332                );
    342333
    343                 stmt->push_back( new DeclStmt( noLabels, flag) );
     334                stmt->push_back( new DeclStmt( flag) );
    344335
    345336                return flag;
     
    357348                ResolvExpr::findVoidExpression( expr, indexer );
    358349
    359                 return new ExprStmt( noLabels, expr );
     350                return new ExprStmt( expr );
    360351        }
    361352
     
    399390                );
    400391
    401                 stmt->push_back( new DeclStmt( noLabels, mon) );
     392                stmt->push_back( new DeclStmt( mon) );
    402393
    403394                return mon;
     
    411402
    412403                stmt->push_back( new IfStmt(
    413                         noLabels,
    414404                        safeCond( clause.condition ),
    415405                        new CompoundStmt({
     
    447437                );
    448438
    449                 stmt->push_back( new DeclStmt( noLabels, timeout ) );
     439                stmt->push_back( new DeclStmt( timeout ) );
    450440
    451441                if( time ) {
    452442                        stmt->push_back( new IfStmt(
    453                                 noLabels,
    454443                                safeCond( time_cond ),
    455444                                new CompoundStmt({
    456445                                        new ExprStmt(
    457                                                 noLabels,
    458446                                                makeOpAssign(
    459447                                                        new VariableExpr( timeout ),
     
    471459                if( has_else ) {
    472460                        stmt->push_back( new IfStmt(
    473                                 noLabels,
    474461                                safeCond( else_cond ),
    475462                                new CompoundStmt({
    476463                                        new ExprStmt(
    477                                                 noLabels,
    478464                                                makeOpAssign(
    479465                                                        new VariableExpr( timeout ),
     
    511497                );
    512498
    513                 stmt->push_back( new DeclStmt( noLabels, index ) );
     499                stmt->push_back( new DeclStmt( index ) );
    514500
    515501                ObjectDecl * mask = ObjectDecl::newObject(
     
    526512                );
    527513
    528                 stmt->push_back( new DeclStmt( noLabels, mask ) );
     514                stmt->push_back( new DeclStmt( mask ) );
    529515
    530516                stmt->push_back( new ExprStmt(
    531                         noLabels,
    532517                        new ApplicationExpr(
    533518                                VariableExpr::functionPointer( decl_waitfor ),
     
    557542        ) {
    558543                SwitchStmt * swtch = new SwitchStmt(
    559                         noLabels,
    560544                        result,
    561545                        std::list<Statement *>()
     
    566550                        swtch->statements.push_back(
    567551                                new CaseStmt(
    568                                         noLabels,
    569552                                        new ConstantExpr( Constant::from_ulong( i++ ) ),
    570553                                        {
    571554                                                clause.statement,
    572555                                                new BranchStmt(
    573                                                         noLabels,
    574556                                                        "",
    575557                                                        BranchStmt::Break
     
    583565                        swtch->statements.push_back(
    584566                                new CaseStmt(
    585                                         noLabels,
    586567                                        new ConstantExpr( Constant::from_int( -2 ) ),
    587568                                        {
    588569                                                waitfor->timeout.statement,
    589570                                                new BranchStmt(
    590                                                         noLabels,
    591571                                                        "",
    592572                                                        BranchStmt::Break
     
    600580                        swtch->statements.push_back(
    601581                                new CaseStmt(
    602                                         noLabels,
    603582                                        new ConstantExpr( Constant::from_int( -1 ) ),
    604583                                        {
    605584                                                waitfor->orelse.statement,
    606585                                                new BranchStmt(
    607                                                         noLabels,
    608586                                                        "",
    609587                                                        BranchStmt::Break
Note: See TracChangeset for help on using the changeset viewer.