Ignore:
Timestamp:
May 25, 2023, 12:18:53 PM (15 months ago)
Author:
caparsons <caparson@…>
Branches:
ast-experimental, master
Children:
a01faa98
Parents:
382467f
Message:

small bit of cleanup in waituntil pass

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/Concurrency/Waituntil.cpp

    r382467f rb09ca2b  
    938938        }
    939939
    940     // C_TODO: will remove this commented code later. Currently it isn't needed but may switch to a modified version of this later if it has better performance
    941     // std::vector<ptr<CaseClause>> switchCases;
    942 
    943     // int idx = 0;
    944     // for ( const auto & clause: stmt->clauses ) {
    945     //     const CodeLocation & cLoc = clause->location;
    946     //     switchCases.push_back(
    947     //         new CaseClause( cLoc,
    948     //             new CastExpr( cLoc,
    949     //                 new AddressExpr( cLoc, new NameExpr( cLoc, data.at(idx)->targetName ) ),
    950     //                 new BasicType( BasicType::Kind::LongUnsignedInt ), GeneratedFlag::ExplicitCast
    951     //             ),
    952     //             {
    953     //                 new CompoundStmt( cLoc,
    954     //                     {
    955     //                         ast::deepCopy( clause->stmt ),
    956     //                         new BranchStmt( cLoc, BranchStmt::Kind::Break, Label( cLoc ) )
    957     //                     }
    958     //                 )
    959     //             }
    960     //         )
    961     //     );
    962     //     idx++;
    963     // }
    964 
    965940    return new CompoundStmt( loc,
    966941        {
    967942            new ExprStmt( loc, new UntypedExpr( loc, new NameExpr( loc, "park" ) ) ),
    968943            outerIf
    969             // new SwitchStmt( loc,
    970             //     new NameExpr( loc, statusName ),
    971             //     std::move( switchCases )
    972             // )
    973944        }
    974945    );
     
    1013984    const CodeLocation & cLoc = stmt->clauses.at(idx)->location;
    1014985
     986    Expr * baseCond = genSelectTraitCall( stmt->clauses.at(idx), data.at(idx), "register_select" );
    1015987    Expr * ifCond;
    1016988
     
    1023995            ),
    1024996            new CastExpr( cLoc,
    1025                 genSelectTraitCall( stmt->clauses.at(idx), data.at(idx), "register_select" ),
     997                baseCond,
    1026998                new BasicType( BasicType::Kind::Bool ), GeneratedFlag::ExplicitCast
    1027999            ),
    10281000            LogicalFlag::AndExpr
    10291001        );
    1030     } else ifCond = genSelectTraitCall( stmt->clauses.at(idx), data.at(idx), "register_select" );
     1002    } else ifCond = baseCond;
    10311003
    10321004    return new CompoundStmt( cLoc,
Note: See TracChangeset for help on using the changeset viewer.