Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/Concurrency/Waitfor.cc

    rba3706f r0cf5b79  
    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
    102110        //=============================================================================================
    103111        // Pass declarations
     
    195203                        ResolvExpr::findVoidExpression( expr, indexer );
    196204
    197                         return new ExprStmt( expr );
     205                        return new ExprStmt( noLabels, expr );
    198206                }
    199207
     
    251259                if( !decl_monitor || !decl_acceptable || !decl_mask ) throw SemanticError( "waitfor keyword requires monitors to be in scope, add #include <monitor>", waitfor );
    252260
    253                 CompoundStmt * stmt = new CompoundStmt();
     261                CompoundStmt * stmt = new CompoundStmt( noLabels );
    254262
    255263                ObjectDecl * acceptables = declare( waitfor->clauses.size(), stmt );
     
    273281                );
    274282
    275                 CompoundStmt * compound = new CompoundStmt();
     283                CompoundStmt * compound = new CompoundStmt( noLabels );
    276284                stmt->push_back( new IfStmt(
     285                        noLabels,
    277286                        safeCond( new VariableExpr( flag ) ),
    278287                        compound,
     
    304313                );
    305314
    306                 stmt->push_back( new DeclStmt( acceptables) );
     315                stmt->push_back( new DeclStmt( noLabels, acceptables) );
    307316
    308317                Expression * set = new UntypedExpr(
     
    317326                ResolvExpr::findVoidExpression( set, indexer );
    318327
    319                 stmt->push_back( new ExprStmt( set ) );
     328                stmt->push_back( new ExprStmt( noLabels, set ) );
    320329
    321330                return acceptables;
     
    332341                );
    333342
    334                 stmt->push_back( new DeclStmt( flag) );
     343                stmt->push_back( new DeclStmt( noLabels, flag) );
    335344
    336345                return flag;
     
    348357                ResolvExpr::findVoidExpression( expr, indexer );
    349358
    350                 return new ExprStmt( expr );
     359                return new ExprStmt( noLabels, expr );
    351360        }
    352361
     
    390399                );
    391400
    392                 stmt->push_back( new DeclStmt( mon) );
     401                stmt->push_back( new DeclStmt( noLabels, mon) );
    393402
    394403                return mon;
     
    402411
    403412                stmt->push_back( new IfStmt(
     413                        noLabels,
    404414                        safeCond( clause.condition ),
    405415                        new CompoundStmt({
     
    437447                );
    438448
    439                 stmt->push_back( new DeclStmt( timeout ) );
     449                stmt->push_back( new DeclStmt( noLabels, timeout ) );
    440450
    441451                if( time ) {
    442452                        stmt->push_back( new IfStmt(
     453                                noLabels,
    443454                                safeCond( time_cond ),
    444455                                new CompoundStmt({
    445456                                        new ExprStmt(
     457                                                noLabels,
    446458                                                makeOpAssign(
    447459                                                        new VariableExpr( timeout ),
     
    459471                if( has_else ) {
    460472                        stmt->push_back( new IfStmt(
     473                                noLabels,
    461474                                safeCond( else_cond ),
    462475                                new CompoundStmt({
    463476                                        new ExprStmt(
     477                                                noLabels,
    464478                                                makeOpAssign(
    465479                                                        new VariableExpr( timeout ),
     
    497511                );
    498512
    499                 stmt->push_back( new DeclStmt( index ) );
     513                stmt->push_back( new DeclStmt( noLabels, index ) );
    500514
    501515                ObjectDecl * mask = ObjectDecl::newObject(
     
    512526                );
    513527
    514                 stmt->push_back( new DeclStmt( mask ) );
     528                stmt->push_back( new DeclStmt( noLabels, mask ) );
    515529
    516530                stmt->push_back( new ExprStmt(
     531                        noLabels,
    517532                        new ApplicationExpr(
    518533                                VariableExpr::functionPointer( decl_waitfor ),
     
    542557        ) {
    543558                SwitchStmt * swtch = new SwitchStmt(
     559                        noLabels,
    544560                        result,
    545561                        std::list<Statement *>()
     
    550566                        swtch->statements.push_back(
    551567                                new CaseStmt(
     568                                        noLabels,
    552569                                        new ConstantExpr( Constant::from_ulong( i++ ) ),
    553570                                        {
    554571                                                clause.statement,
    555572                                                new BranchStmt(
     573                                                        noLabels,
    556574                                                        "",
    557575                                                        BranchStmt::Break
     
    565583                        swtch->statements.push_back(
    566584                                new CaseStmt(
     585                                        noLabels,
    567586                                        new ConstantExpr( Constant::from_int( -2 ) ),
    568587                                        {
    569588                                                waitfor->timeout.statement,
    570589                                                new BranchStmt(
     590                                                        noLabels,
    571591                                                        "",
    572592                                                        BranchStmt::Break
     
    580600                        swtch->statements.push_back(
    581601                                new CaseStmt(
     602                                        noLabels,
    582603                                        new ConstantExpr( Constant::from_int( -1 ) ),
    583604                                        {
    584605                                                waitfor->orelse.statement,
    585606                                                new BranchStmt(
     607                                                        noLabels,
    586608                                                        "",
    587609                                                        BranchStmt::Break
Note: See TracChangeset for help on using the changeset viewer.