Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/Concurrency/Waituntil.cpp

    rb09ca2b rbccd70a  
    1414//
    1515
     16#include "Waituntil.hpp"
     17
    1618#include <string>
    1719
    18 #include "Waituntil.hpp"
     20#include "AST/Copy.hpp"
    1921#include "AST/Expr.hpp"
    2022#include "AST/Pass.hpp"
     
    938940        }
    939941
     942    // 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
     943    // std::vector<ptr<CaseClause>> switchCases;
     944
     945    // int idx = 0;
     946    // for ( const auto & clause: stmt->clauses ) {
     947    //     const CodeLocation & cLoc = clause->location;
     948    //     switchCases.push_back(
     949    //         new CaseClause( cLoc,
     950    //             new CastExpr( cLoc,
     951    //                 new AddressExpr( cLoc, new NameExpr( cLoc, data.at(idx)->targetName ) ),
     952    //                 new BasicType( BasicType::Kind::LongUnsignedInt ), GeneratedFlag::ExplicitCast
     953    //             ),
     954    //             {
     955    //                 new CompoundStmt( cLoc,
     956    //                     {
     957    //                         ast::deepCopy( clause->stmt ),
     958    //                         new BranchStmt( cLoc, BranchStmt::Kind::Break, Label( cLoc ) )
     959    //                     }
     960    //                 )
     961    //             }
     962    //         )
     963    //     );
     964    //     idx++;
     965    // }
     966
    940967    return new CompoundStmt( loc,
    941968        {
    942969            new ExprStmt( loc, new UntypedExpr( loc, new NameExpr( loc, "park" ) ) ),
    943970            outerIf
     971            // new SwitchStmt( loc,
     972            //     new NameExpr( loc, statusName ),
     973            //     std::move( switchCases )
     974            // )
    944975        }
    945976    );
     
    9841015    const CodeLocation & cLoc = stmt->clauses.at(idx)->location;
    9851016
    986     Expr * baseCond = genSelectTraitCall( stmt->clauses.at(idx), data.at(idx), "register_select" );
    9871017    Expr * ifCond;
    9881018
     
    9951025            ),
    9961026            new CastExpr( cLoc,
    997                 baseCond,
     1027                genSelectTraitCall( stmt->clauses.at(idx), data.at(idx), "register_select" ),
    9981028                new BasicType( BasicType::Kind::Bool ), GeneratedFlag::ExplicitCast
    9991029            ),
    10001030            LogicalFlag::AndExpr
    10011031        );
    1002     } else ifCond = baseCond;
     1032    } else ifCond = genSelectTraitCall( stmt->clauses.at(idx), data.at(idx), "register_select" );
    10031033
    10041034    return new CompoundStmt( cLoc,
Note: See TracChangeset for help on using the changeset viewer.