Changeset 1d66a91


Ignore:
Timestamp:
Jul 17, 2023, 3:58:48 PM (16 months ago)
Author:
caparsons <caparson@…>
Branches:
master
Children:
bf55f32
Parents:
66ac416
Message:

added support for general channel operators and cleaned up some cruft

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/Concurrency/Waituntil.cpp

    r66ac416 r1d66a91  
    178178    CompoundStmt * genStmtBlock( const WhenClause * clause, const ClauseData * data );
    179179    Stmt * genElseClauseBranch( const WaitUntilStmt * stmt, string & runName, string & arrName, vector<ClauseData *> & clauseData );
    180     Stmt * genNoElseClauseBranch( const WaitUntilStmt * stmt, string & satName, string & runName, string & arrName, string & pCountName, vector<ClauseData *> & clauseData );
     180    Stmt * genNoElseClauseBranch( const WaitUntilStmt * stmt, string & runName, string & arrName, string & pCountName, vector<ClauseData *> & clauseData );
    181181    void genClauseInits( const WaitUntilStmt * stmt, vector<ClauseData *> & clauseData, CompoundStmt * body, string & statusName, string & elseWhenName );
    182182    Stmt * recursiveOrIfGen( const WaitUntilStmt * stmt, vector<ClauseData *> & data, vector<ClauseData*>::size_type idx, string & elseWhenName );
     
    625625CompoundStmt * GenerateWaitUntilCore::genStmtBlock( const WhenClause * clause, const ClauseData * data ) {
    626626    const CodeLocation & cLoc = clause->location;
    627     // return new CompoundStmt( cLoc, // OLD
    628     //     {
    629     //         new ExprStmt( cLoc,
    630     //             genSelectTraitCall( clause, data, "on_selected" )
    631     //         ),
    632     //         ast::deepCopy( clause->stmt )
    633     //     }
    634     // );
    635627    return new CompoundStmt( cLoc,
    636628        {
     
    827819    );
    828820}
    829 // C_TODO remove unused param if change kept
    830 Stmt * GenerateWaitUntilCore::genNoElseClauseBranch( const WaitUntilStmt * stmt, string & satName, string & runName, string & arrName, string & pCountName, vector<ClauseData *> & clauseData ) {
     821
     822Stmt * GenerateWaitUntilCore::genNoElseClauseBranch( const WaitUntilStmt * stmt, string & runName, string & arrName, string & pCountName, vector<ClauseData *> & clauseData ) {
    831823    CompoundStmt * whileBody = new CompoundStmt( stmt->location );
    832824    const CodeLocation & loc = stmt->location;
     
    843835
    844836    whileBody->push_back( genStatusCheckFor( stmt, clauseData, runName ) );
    845     // whileBody->push_back( genStatusCheckFor( stmt, clauseData, satName ) ); // OLD
    846837
    847838    return new CompoundStmt( loc,
     
    849840            new WhileDoStmt( loc,
    850841                genNotSatExpr( stmt, runName, arrName ),
    851                 // genNotSatExpr( stmt, satName, arrName ), // OLD
    852842                whileBody,  // body
    853843                {}          // no inits
    854844            )
    855             // , // OLD
    856             // genStatusCheckFor( stmt, clauseData, runName ) // OLD
    857845        }
    858846    );
     
    878866                new ObjectDecl( cLoc,
    879867                    currClause->targetName,
    880                     new ReferenceType( new TypeofType( ast::deepCopy( stmt->clauses.at(i)->target ) ) ),
     868                    new ReferenceType(
     869                        new TypeofType( new UntypedExpr( cLoc,
     870                            new NameExpr( cLoc, "__CFA_select_get_type" ),
     871                            { ast::deepCopy( stmt->clauses.at(i)->target ) }
     872                        ))
     873                    ),
    881874                    new SingleInit( cLoc, ast::deepCopy( stmt->clauses.at(i)->target ) )
    882875                )
     
    12901283                new NameExpr( stmt->else_cond->location, elseWhenName ),
    12911284                genElseClauseBranch( stmt, runName, statusArrName, clauseData ),
    1292                 genNoElseClauseBranch( stmt, satName, runName, statusArrName, pCountName, clauseData )
     1285                genNoElseClauseBranch( stmt, runName, statusArrName, pCountName, clauseData )
    12931286            )
    12941287        );
    12951288    } else if ( !stmt->else_stmt ) { // normal gen
    1296         tryBody->push_back( genNoElseClauseBranch( stmt, satName, runName, statusArrName, pCountName, clauseData ) );
     1289        tryBody->push_back( genNoElseClauseBranch( stmt, runName, statusArrName, pCountName, clauseData ) );
    12971290    } else { // generate just else
    12981291        tryBody->push_back( genElseClauseBranch( stmt, runName, statusArrName, clauseData ) );
Note: See TracChangeset for help on using the changeset viewer.