Changes in / [e06be49:695e00d]
- Location:
- src
- Files:
-
- 23 edited
-
CodeGen/CodeGenerator.cc (modified) (2 diffs)
-
Concurrency/Waitfor.cc (modified) (19 diffs)
-
Parser/StatementNode.cc (modified) (4 diffs)
-
Parser/parserutility.cc (modified) (1 diff)
-
ResolvExpr/AlternativeFinder.cc (modified) (1 diff)
-
ResolvExpr/AlternativeFinder.h (modified) (3 diffs)
-
ResolvExpr/Resolver.cc (modified) (3 diffs)
-
SymTab/Mangler.cc (modified) (1 diff)
-
SynTree/BaseSyntaxNode.h (modified) (1 diff)
-
SynTree/Declaration.cc (modified) (1 diff)
-
SynTree/Declaration.h (modified) (15 diffs)
-
SynTree/Expression.cc (modified) (1 diff)
-
SynTree/Expression.h (modified) (1 diff)
-
SynTree/Initializer.cc (modified) (1 diff)
-
SynTree/Initializer.h (modified) (6 diffs)
-
SynTree/Statement.cc (modified) (3 diffs)
-
SynTree/Statement.h (modified) (20 diffs)
-
SynTree/Type.cc (modified) (1 diff)
-
SynTree/Type.h (modified) (19 diffs)
-
libcfa/concurrency/monitor (modified) (2 diffs)
-
libcfa/concurrency/monitor.c (modified) (1 diff)
-
tests/sched-ext-parse.c (modified) (2 diffs)
-
tests/sched-ext.c (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
src/CodeGen/CodeGenerator.cc
re06be49 r695e00d 865 865 void CodeGenerator::visit( CaseStmt * caseStmt ) { 866 866 updateLocation( caseStmt ); 867 output << indent; 867 868 if ( caseStmt->isDefault()) { 868 869 output << "default"; … … 1001 1002 } // namespace CodeGen 1002 1003 1004 std::ostream & operator<<( std::ostream & out, const BaseSyntaxNode * node ) { 1005 if ( node ) { 1006 node->print( out ); 1007 } else { 1008 out << "nullptr"; 1009 } 1010 return out; 1011 } 1012 1003 1013 // Local Variables: // 1004 1014 // tab-width: 4 // -
src/Concurrency/Waitfor.cc
re06be49 r695e00d 27 27 #include "InitTweak/InitTweak.h" // for getPointerBase 28 28 #include "Parser/LinkageSpec.h" // for Cforall 29 #include " SymTab/AddVisit.h" // for acceptAndAdd29 #include "ResolvExpr/Resolver.h" // for findVoidExpression 30 30 #include "SynTree/Constant.h" // for Constant 31 31 #include "SynTree/Declaration.h" // for StructDecl, FunctionDecl, ObjectDecl … … 112 112 //============================================================================================= 113 113 114 class GenerateWaitForPass final : public With StmtsToAdd{114 class GenerateWaitForPass final : public WithIndexer { 115 115 public: 116 116 … … 129 129 void init( ObjectDecl * acceptables, int index, WaitForStmt::Clause & clause, CompoundStmt * stmt ); 130 130 Expression * init_timeout( Expression *& time, Expression *& time_cond, bool has_else, Expression *& else_cond, CompoundStmt * stmt ); 131 Expression * call( );132 void choose();131 Expression * call(size_t count, ObjectDecl * acceptables, Expression * timeout, CompoundStmt * stmt); 132 void choose( WaitForStmt * waitfor, Expression * result, CompoundStmt * stmt ); 133 133 134 134 static void implement( std::list< Declaration * > & translationUnit ) { … … 142 142 StructDecl * decl_acceptable = nullptr; 143 143 StructDecl * decl_monitor = nullptr; 144 DeclarationWithType * decl_m_func = nullptr;145 DeclarationWithType * decl_m_count = nullptr;146 DeclarationWithType * decl_m_monitors = nullptr;147 DeclarationWithType * decl_m_isdtor = nullptr;148 144 149 145 static std::unique_ptr< Type > generic_func; … … 152 148 UniqueName namer_acc = "__acceptables_"s; 153 149 UniqueName namer_tim = "__timeout_"s; 150 UniqueName namer_ret = "__return_"s; 154 151 }; 155 152 … … 167 164 namespace { 168 165 Expression * makeOpIndex( DeclarationWithType * array, unsigned long index ) { 169 return new ApplicationExpr(166 return new UntypedExpr( 170 167 new NameExpr( "?[?]" ), 171 168 { … … 177 174 178 175 Expression * makeOpAssign( Expression * lhs, Expression * rhs ) { 179 return new ApplicationExpr(176 return new UntypedExpr( 180 177 new NameExpr( "?=?" ), 181 178 { lhs, rhs } … … 183 180 } 184 181 185 Expression * makeOpMember( Expression * sue, DeclarationWithType * mem ) { 186 return new MemberExpr( mem, sue ); 187 } 188 189 Statement * makeAccStatement( DeclarationWithType * object, unsigned long index, DeclarationWithType * member, Expression * value ) { 190 return new ExprStmt( 191 noLabels, 192 makeOpAssign( 193 makeOpMember( 194 makeOpIndex( 195 object, 196 index 197 ), 198 member 182 Expression * makeOpMember( Expression * sue, const std::string & mem ) { 183 return new UntypedMemberExpr( new NameExpr( mem ), sue ); 184 } 185 186 Statement * makeAccStatement( DeclarationWithType * object, unsigned long index, const std::string & member, Expression * value, const SymTab::Indexer & indexer ) { 187 std::unique_ptr< Expression > expr( makeOpAssign( 188 makeOpMember( 189 makeOpIndex( 190 object, 191 index 199 192 ), 200 value 201 ) 202 ); 193 member 194 ), 195 value 196 ) ); 197 198 return new ExprStmt( noLabels, ResolvExpr::findVoidExpression( expr.get(), indexer ) ); 203 199 } 204 200 … … 208 204 return new ConstantExpr( Constant::from_bool( ifnull ) ); 209 205 } 206 207 VariableExpr * extractVariable( Expression * func ) { 208 if( VariableExpr * var = dynamic_cast< VariableExpr * >( func ) ) { 209 return var; 210 } 211 212 CastExpr * cast = strict_dynamic_cast< CastExpr * >( func ); 213 return strict_dynamic_cast< VariableExpr * >( cast->arg ); 214 } 215 216 Expression * betterIsDtor( Expression * func ) { 217 VariableExpr * typed_func = extractVariable( func ); 218 bool is_dtor = InitTweak::isDestructor( typed_func->var ); 219 return new ConstantExpr( Constant::from_bool( is_dtor ) ); 220 } 210 221 }; 211 222 … … 216 227 217 228 void GenerateWaitForPass::premutate( FunctionDecl * decl) { 218 if( decl->name != "__ accept_internal" ) return;229 if( decl->name != "__waitfor_internal" ) return; 219 230 220 231 decl_waitfor = decl; … … 227 238 assert( !decl_acceptable ); 228 239 decl_acceptable = decl; 229 for( Declaration * field : decl_acceptable->members ) {230 if( field->name == "func" ) decl_m_func = strict_dynamic_cast< DeclarationWithType * >( field );231 else if( field->name == "count" ) decl_m_count = strict_dynamic_cast< DeclarationWithType * >( field );232 else if( field->name == "monitor" ) decl_m_monitors = strict_dynamic_cast< DeclarationWithType * >( field );233 else if( field->name == "is_dtor" ) decl_m_isdtor = strict_dynamic_cast< DeclarationWithType * >( field );234 }235 236 240 } 237 241 else if( decl->name == "monitor_desc" ) { … … 242 246 243 247 Statement * GenerateWaitForPass::postmutate( WaitForStmt * waitfor ) { 244 return waitfor;245 246 248 if( !decl_monitor || !decl_acceptable ) throw SemanticError( "waitfor keyword requires monitors to be in scope, add #include <monitor>", waitfor ); 247 249 … … 265 267 ); 266 268 267 // Expression * result = call( acceptables, timeout, orelse, stmt );268 269 // choose( waitfor, result );269 Expression * result = call( waitfor->clauses.size(), acceptables, timeout, stmt ); 270 271 choose( waitfor, result, stmt ); 270 272 271 273 return stmt; … … 274 276 ObjectDecl * GenerateWaitForPass::declare( unsigned long count, CompoundStmt * stmt ) 275 277 { 276 ObjectDecl * acceptables = new ObjectDecl(278 ObjectDecl * acceptables = ObjectDecl::newObject( 277 279 namer_acc.newName(), 278 noStorage,279 LinkageSpec::Cforall,280 nullptr,281 280 new ArrayType( 282 281 noQualifiers, … … 299 298 ObjectDecl * GenerateWaitForPass::declMon( WaitForStmt::Clause & clause, CompoundStmt * stmt ) { 300 299 301 ObjectDecl * mon = new ObjectDecl(300 ObjectDecl * mon = ObjectDecl::newObject( 302 301 namer_mon.newName(), 303 noStorage,304 LinkageSpec::Cforall,305 nullptr,306 302 new ArrayType( 307 303 noQualifiers, … … 330 326 ObjectDecl * monitors = declMon( clause, stmt ); 331 327 328 Type * fptr_t = new PointerType( noQualifiers, new FunctionType( noQualifiers, true ) ); 329 330 Expression * is_dtor = betterIsDtor( clause.target.function ); 332 331 CompoundStmt * compound = new CompoundStmt( noLabels ); 333 compound->push_back( makeAccStatement( acceptables, index, decl_m_func , clause.target.function) );334 compound->push_back( makeAccStatement( acceptables, index, decl_m_count , new ConstantExpr( Constant::from_ulong( clause.target.arguments.size() ) )) );335 compound->push_back( makeAccStatement( acceptables, index, decl_m_monitors, new VariableExpr( monitors )) );336 compound->push_back( makeAccStatement( acceptables, index, decl_m_isdtor , new ConstantExpr( Constant::from_bool( true ) )) );332 compound->push_back( makeAccStatement( acceptables, index, "func" , new CastExpr( clause.target.function, fptr_t ) , indexer ) ); 333 compound->push_back( makeAccStatement( acceptables, index, "count" , new ConstantExpr( Constant::from_ulong( clause.target.arguments.size() ) ), indexer ) ); 334 compound->push_back( makeAccStatement( acceptables, index, "monitors", new VariableExpr( monitors ) , indexer ) ); 335 compound->push_back( makeAccStatement( acceptables, index, "is_dtor" , is_dtor , indexer ) ); 337 336 338 337 stmt->push_back( new IfStmt( … … 355 354 CompoundStmt * stmt 356 355 ) { 357 ObjectDecl * timeout = new ObjectDecl(356 ObjectDecl * timeout = ObjectDecl::newObject( 358 357 namer_tim.newName(), 359 noStorage,360 LinkageSpec::Cforall,361 nullptr,362 358 new BasicType( 363 359 noQualifiers, … … 374 370 stmt->push_back( new IfStmt( 375 371 noLabels, 376 safeCond( else_cond ),372 safeCond( time_cond ), 377 373 new ExprStmt( 378 374 noLabels, … … 407 403 return new VariableExpr( timeout ); 408 404 } 405 406 Expression * GenerateWaitForPass::call( 407 size_t count, 408 ObjectDecl * acceptables, 409 Expression * timeout, 410 CompoundStmt * stmt 411 ) { 412 ObjectDecl * decl = ObjectDecl::newObject( 413 namer_ret.newName(), 414 new BasicType( 415 noQualifiers, 416 BasicType::LongLongUnsignedInt 417 ), 418 new SingleInit( 419 new UntypedExpr( 420 VariableExpr::functionPointer( decl_waitfor ), 421 { 422 new ConstantExpr( Constant::from_ulong( count ) ), 423 new VariableExpr( acceptables ), 424 timeout 425 } 426 ) 427 ) 428 ); 429 430 stmt->push_back( new DeclStmt( noLabels, decl ) ); 431 432 return new VariableExpr( decl ); 433 } 434 435 void GenerateWaitForPass::choose( 436 WaitForStmt * waitfor, 437 Expression * result, 438 CompoundStmt * stmt 439 ) { 440 SwitchStmt * swtch = new SwitchStmt( 441 noLabels, 442 result, 443 std::list<Statement *>() 444 ); 445 446 unsigned long i = 0; 447 for( auto & clause : waitfor->clauses ) { 448 swtch->statements.push_back( 449 new CaseStmt( 450 noLabels, 451 new ConstantExpr( Constant::from_ulong( i++ ) ), 452 { 453 clause.statement, 454 new BranchStmt( 455 noLabels, 456 "", 457 BranchStmt::Break 458 ) 459 } 460 ) 461 ); 462 } 463 464 if(waitfor->timeout.statement) { 465 swtch->statements.push_back( 466 new CaseStmt( 467 noLabels, 468 new ConstantExpr( Constant::from_ulong( i++ ) ), 469 { 470 waitfor->timeout.statement, 471 new BranchStmt( 472 noLabels, 473 "", 474 BranchStmt::Break 475 ) 476 } 477 ) 478 ); 479 } 480 481 if(waitfor->orelse.statement) { 482 swtch->statements.push_back( 483 new CaseStmt( 484 noLabels, 485 new ConstantExpr( Constant::from_ulong( i++ ) ), 486 { 487 waitfor->orelse.statement, 488 new BranchStmt( 489 noLabels, 490 "", 491 BranchStmt::Break 492 ) 493 } 494 ) 495 ); 496 } 497 498 stmt->push_back( swtch ); 499 } 409 500 }; 410 501 -
src/Parser/StatementNode.cc
re06be49 r695e00d 234 234 target, 235 235 maybeMoveBuild<Statement >( stmt ), 236 maybeMoveBuild<Expression>( when)236 notZeroExpr( maybeMoveBuild<Expression>( when ) ) 237 237 }); 238 238 … … 250 250 delete targetExpr; 251 251 252 node->clauses. push_back(WaitForStmt::Clause{252 node->clauses.insert( node->clauses.begin(), WaitForStmt::Clause{ 253 253 std::move( target ), 254 254 maybeMoveBuild<Statement >( stmt ), 255 maybeMoveBuild<Expression>( when)255 notZeroExpr( maybeMoveBuild<Expression>( when ) ) 256 256 }); 257 257 … … 265 265 node->timeout.time = maybeMoveBuild<Expression>( timeout ); 266 266 node->timeout.statement = maybeMoveBuild<Statement >( stmt ); 267 node->timeout.condition = maybeMoveBuild<Expression>( when);267 node->timeout.condition = notZeroExpr( maybeMoveBuild<Expression>( when ) ); 268 268 } 269 269 else { 270 node->orelse.statement = maybeMoveBuild<Statement >( stmt );271 node->orelse.condition = maybeMoveBuild<Expression>( when);270 node->orelse.statement = maybeMoveBuild<Statement >( stmt ); 271 node->orelse.condition = notZeroExpr( maybeMoveBuild<Expression>( when ) ); 272 272 } 273 273 … … 280 280 node->timeout.time = maybeMoveBuild<Expression>( timeout ); 281 281 node->timeout.statement = maybeMoveBuild<Statement >( stmt ); 282 node->timeout.condition = maybeMoveBuild<Expression>( when);282 node->timeout.condition = notZeroExpr( maybeMoveBuild<Expression>( when ) ); 283 283 284 284 node->orelse.statement = maybeMoveBuild<Statement >( else_stmt ); 285 node->orelse.condition = maybeMoveBuild<Expression>( else_when);285 node->orelse.condition = notZeroExpr( maybeMoveBuild<Expression>( else_when ) ); 286 286 287 287 return node; 288 288 } 289 290 // WaitForStmt::Target build_waitfor( const std::string * name, ExpressionNode * arguments ) {291 // return WaitForStmt::Clause{292 293 // };294 // }295 289 296 290 Statement *build_compound( StatementNode *first ) { -
src/Parser/parserutility.cc
re06be49 r695e00d 29 29 30 30 Expression *notZeroExpr( Expression *orig ) { 31 if( !orig ) return nullptr; 31 32 UntypedExpr *comparison = new UntypedExpr( new NameExpr( "?!=?" ) ); 32 33 comparison->get_args().push_back( orig ); -
src/ResolvExpr/AlternativeFinder.cc
re06be49 r695e00d 144 144 expr->get_result()->accept( global_renamer ); 145 145 } 146 147 void referenceToRvalueConversion( Expression *& expr ) {148 if ( dynamic_cast< ReferenceType * >( expr->get_result() ) ) {149 // cast away reference from expr150 expr = new CastExpr( expr, expr->get_result()->stripReferences()->clone() );151 }152 }153 146 } // namespace 147 148 void referenceToRvalueConversion( Expression *& expr ) { 149 if ( dynamic_cast< ReferenceType * >( expr->get_result() ) ) { 150 // cast away reference from expr 151 expr = new CastExpr( expr, expr->get_result()->stripReferences()->clone() ); 152 } 153 } 154 154 155 155 template< typename InputIterator, typename OutputIterator > -
src/ResolvExpr/AlternativeFinder.h
re06be49 r695e00d 50 50 const SymTab::Indexer &get_indexer() const { return indexer; } 51 51 const TypeEnvironment &get_environ() const { return env; } 52 53 /// Runs a new alternative finder on each element in [begin, end) 54 /// and writes each alternative finder to out. 55 template< typename InputIterator, typename OutputIterator > 56 void findSubExprs( InputIterator begin, InputIterator end, OutputIterator out ); 52 57 private: 53 58 virtual void visit( ApplicationExpr *applicationExpr ); … … 81 86 virtual void visit( StmtExpr *stmtExpr ); 82 87 virtual void visit( UntypedInitExpr *initExpr ); 83 /// Runs a new alternative finder on each element in [begin, end)84 /// and writes each alternative finder to out.85 template< typename InputIterator, typename OutputIterator >86 void findSubExprs( InputIterator begin, InputIterator end, OutputIterator out );87 88 88 89 /// Adds alternatives for anonymous members … … 108 109 109 110 Expression *resolveInVoidContext( Expression *expr, const SymTab::Indexer &indexer, TypeEnvironment &env ); 111 void referenceToRvalueConversion( Expression *& expr ); 110 112 111 113 template< typename InputIterator, typename OutputIterator > -
src/ResolvExpr/Resolver.cc
re06be49 r695e00d 40 40 #include "SynTree/Visitor.h" // for acceptAll, maybeAccept 41 41 #include "typeops.h" // for extractResultType 42 #include "Unify.h" // for unify 42 43 43 44 using namespace std; … … 71 72 void previsit( ThrowStmt *throwStmt ); 72 73 void previsit( CatchStmt *catchStmt ); 74 void previsit( WaitForStmt * stmt ); 73 75 74 76 void previsit( SingleInit *singleInit ); … … 391 393 } 392 394 395 inline void resolveAsIf( Expression *& expr, Resolver & resolver ) { 396 if( !expr ) return; 397 Expression * newExpr = findSingleExpression( expr, resolver ); 398 delete expr; 399 expr = newExpr; 400 } 401 402 inline void resolveAsType( Expression *& expr, Type * type, Resolver & resolver ) { 403 if( !expr ) return; 404 Expression * newExpr = findSingleExpression( new CastExpr( expr, type ), resolver ); 405 delete expr; 406 expr = newExpr; 407 } 408 409 template< typename iterator_t > 410 inline bool advance_to_mutex( iterator_t & it, const iterator_t & end ) { 411 while( it != end && !(*it)->get_type()->get_mutex() ) { 412 it++; 413 } 414 415 return it != end; 416 } 417 418 void Resolver::previsit( WaitForStmt * stmt ) { 419 420 // Resolve all clauses first 421 for( auto& clause : stmt->clauses ) { 422 423 TypeEnvironment env; 424 AlternativeFinder funcFinder( *this, env ); 425 426 // Find all alternatives for a function in canonical form 427 funcFinder.findWithAdjustment( clause.target.function ); 428 429 if ( funcFinder.get_alternatives().empty() ) { 430 stringstream ss; 431 ss << "Use of undeclared indentifier '"; 432 ss << strict_dynamic_cast<NameExpr*>( clause.target.function )->name; 433 ss << "' in call to waitfor"; 434 throw SemanticError( ss.str() ); 435 } 436 437 // Find all alternatives for all arguments in canonical form 438 std::list< AlternativeFinder > argAlternatives; 439 funcFinder.findSubExprs( clause.target.arguments.begin(), clause.target.arguments.end(), back_inserter( argAlternatives ) ); 440 441 // List all combinations of arguments 442 std::list< AltList > possibilities; 443 combos( argAlternatives.begin(), argAlternatives.end(), back_inserter( possibilities ) ); 444 445 AltList func_candidates; 446 std::vector< AltList > args_candidates; 447 448 // For every possible function : 449 // try matching the arguments to the parameters 450 // not the other way around because we have more arguments than parameters 451 SemanticError errors; 452 for ( Alternative & func : funcFinder.get_alternatives() ) { 453 try { 454 PointerType * pointer = dynamic_cast< PointerType* >( func.expr->get_result()->stripReferences() ); 455 if( !pointer ) { 456 throw SemanticError( "candidate not viable: not a pointer type\n", func.expr->get_result() ); 457 } 458 459 FunctionType * function = dynamic_cast< FunctionType* >( pointer->get_base() ); 460 if( !function ) { 461 throw SemanticError( "candidate not viable: not a function type\n", pointer->get_base() ); 462 } 463 464 465 { 466 auto param = function->parameters.begin(); 467 auto param_end = function->parameters.end(); 468 469 if( !advance_to_mutex( param, param_end ) ) { 470 throw SemanticError("candidate function not viable: no mutex parameters\n", function); 471 } 472 } 473 474 Alternative newFunc( func ); 475 // Strip reference from function 476 referenceToRvalueConversion( newFunc.expr ); 477 478 // For all the set of arguments we have try to match it with the parameter of the current function alternative 479 for ( auto & argsList : possibilities ) { 480 481 try { 482 // Declare data structures need for resolution 483 OpenVarSet openVars; 484 AssertionSet resultNeed, resultHave; 485 TypeEnvironment resultEnv; 486 487 // Load type variables from arguemnts into one shared space 488 simpleCombineEnvironments( argsList.begin(), argsList.end(), resultEnv ); 489 490 // Make sure we don't widen any existing bindings 491 for ( auto & i : resultEnv ) { 492 i.allowWidening = false; 493 } 494 495 // Find any unbound type variables 496 resultEnv.extractOpenVars( openVars ); 497 498 auto param = function->parameters.begin(); 499 auto param_end = function->parameters.end(); 500 501 // For every arguments of its set, check if it matches one of the parameter 502 // The order is important 503 for( auto & arg : argsList ) { 504 505 // Ignore non-mutex arguments 506 if( !advance_to_mutex( param, param_end ) ) { 507 // We ran out of parameters but still have arguments 508 // this function doesn't match 509 throw SemanticError("candidate function not viable: too many mutex arguments\n", function); 510 } 511 512 // Check if the argument matches the parameter type in the current scope 513 if( ! unify( (*param)->get_type(), arg.expr->get_result(), resultEnv, resultNeed, resultHave, openVars, *this ) ) { 514 // Type doesn't match 515 stringstream ss; 516 ss << "candidate function not viable: no known convertion from '"; 517 arg.expr->get_result()->print( ss ); 518 ss << "' to '"; 519 (*param)->get_type()->print( ss ); 520 ss << "'\n"; 521 throw SemanticError(ss.str(), function); 522 } 523 524 param++; 525 } 526 527 // All arguments match ! 528 529 // Check if parameters are missing 530 if( advance_to_mutex( param, param_end ) ) { 531 // We ran out of arguments but still have parameters left 532 // this function doesn't match 533 throw SemanticError("candidate function not viable: too few mutex arguments\n", function); 534 } 535 536 // All parameters match ! 537 538 // Finish the expressions to tie in the proper environments 539 finishExpr( newFunc.expr, resultEnv ); 540 for( Alternative & alt : argsList ) { 541 finishExpr( alt.expr, resultEnv ); 542 } 543 544 // This is a match store it and save it for later 545 func_candidates.push_back( newFunc ); 546 args_candidates.push_back( argsList ); 547 548 } 549 catch( SemanticError &e ) { 550 errors.append( e ); 551 } 552 } 553 } 554 catch( SemanticError &e ) { 555 errors.append( e ); 556 } 557 } 558 559 // Make sure we got the right number of arguments 560 if( func_candidates.empty() ) { SemanticError top( "No alternatives for function in call to waitfor" ); top.append( errors ); throw top; } 561 if( args_candidates.empty() ) { SemanticError top( "No alternatives for arguments in call to waitfor" ); top.append( errors ); throw top; } 562 if( func_candidates.size() > 1 ) { SemanticError top( "Ambiguous function in call to waitfor" ); top.append( errors ); throw top; } 563 if( args_candidates.size() > 1 ) { SemanticError top( "Ambiguous arguments in call to waitfor" ); top.append( errors ); throw top; } 564 565 566 // Swap the results from the alternative with the unresolved values. 567 // Alternatives will handle deletion on destruction 568 std::swap( clause.target.function, func_candidates.front().expr ); 569 for( auto arg_pair : group_iterate( clause.target.arguments, args_candidates.front() ) ) { 570 std::swap ( std::get<0>( arg_pair), std::get<1>( arg_pair).expr ); 571 } 572 573 // Resolve the conditions as if it were an IfStmt 574 // Resolve the statments normally 575 resolveAsIf( clause.condition, *this ); 576 clause.statement->accept( *this ); 577 } 578 579 580 if( stmt->timeout.statement ) { 581 // Resolve the timeout as an size_t for now 582 // Resolve the conditions as if it were an IfStmt 583 // Resolve the statments normally 584 resolveAsType( stmt->timeout.time, new BasicType( noQualifiers, BasicType::LongLongUnsignedInt ), *this ); 585 resolveAsIf ( stmt->timeout.condition, *this ); 586 stmt->timeout.statement->accept( *this ); 587 } 588 589 if( stmt->orelse.statement ) { 590 // Resolve the conditions as if it were an IfStmt 591 // Resolve the statments normally 592 resolveAsIf( stmt->orelse.condition, *this ); 593 stmt->orelse.statement->accept( *this ); 594 } 595 } 596 393 597 template< typename T > 394 598 bool isCharType( T t ) { -
src/SymTab/Mangler.cc
re06be49 r695e00d 307 307 mangleName << "V"; 308 308 } // if 309 if ( type->get_mutex() ) { 310 mangleName << "M"; 311 } // if 309 312 // Removed due to restrict not affecting function compatibility in GCC 310 313 // if ( type->get_isRestrict() ) { -
src/SynTree/BaseSyntaxNode.h
re06be49 r695e00d 26 26 27 27 virtual void accept( Visitor & v ) = 0; 28 29 virtual void print( std::ostream &os, int indent = 0 ) const = 0; 28 30 }; 31 32 std::ostream & operator<<( std::ostream & out, const BaseSyntaxNode * node ); 29 33 30 34 // Local Variables: // -
src/SynTree/Declaration.cc
re06be49 r695e00d 59 59 } 60 60 61 std::ostream & operator<<( std::ostream & out, const Declaration * decl ) {62 if ( decl ){63 decl->print( out );64 } else {65 out << "nullptr";66 }67 return out;68 }69 70 61 71 62 AsmDecl::AsmDecl( AsmStmt *stmt ) : Declaration( "", Type::StorageClasses(), LinkageSpec::C ), stmt( stmt ) { -
src/SynTree/Declaration.h
re06be49 r695e00d 62 62 void fixUniqueId( void ); 63 63 virtual Declaration *clone() const = 0; 64 virtual void accept( Visitor &v ) = 0;64 virtual void accept( Visitor &v ) override = 0; 65 65 virtual Declaration *acceptMutator( Mutator &m ) = 0; 66 virtual void print( std::ostream &os, int indent = 0 ) const = 0;66 virtual void print( std::ostream &os, int indent = 0 ) const override = 0; 67 67 virtual void printShort( std::ostream &os, int indent = 0 ) const = 0; 68 68 … … 106 106 //void set_functionSpecifiers( Type::FuncSpecifiers newValue ) { fs = newValue; } 107 107 108 virtual DeclarationWithType *clone() const = 0;109 virtual DeclarationWithType *acceptMutator( Mutator &m ) = 0;108 virtual DeclarationWithType *clone() const override = 0; 109 virtual DeclarationWithType *acceptMutator( Mutator &m ) override = 0; 110 110 111 111 virtual Type * get_type() const = 0; … … 128 128 virtual ~ObjectDecl(); 129 129 130 virtual Type * get_type() const { return type; }131 virtual void set_type(Type *newType) { type = newType; }130 virtual Type * get_type() const override { return type; } 131 virtual void set_type(Type *newType) override { type = newType; } 132 132 133 133 Initializer *get_init() const { return init; } … … 139 139 static ObjectDecl * newObject( const std::string & name, Type * type, Initializer * init ); 140 140 141 virtual ObjectDecl *clone() const { return new ObjectDecl( *this ); }142 virtual void accept( Visitor &v ) { v.visit( this ); }143 virtual DeclarationWithType *acceptMutator( Mutator &m ) { return m.mutate( this ); }144 virtual void print( std::ostream &os, int indent = 0 ) const ;145 virtual void printShort( std::ostream &os, int indent = 0 ) const ;141 virtual ObjectDecl *clone() const override { return new ObjectDecl( *this ); } 142 virtual void accept( Visitor &v ) override { v.visit( this ); } 143 virtual DeclarationWithType *acceptMutator( Mutator &m ) override { return m.mutate( this ); } 144 virtual void print( std::ostream &os, int indent = 0 ) const override; 145 virtual void printShort( std::ostream &os, int indent = 0 ) const override; 146 146 }; 147 147 … … 157 157 virtual ~FunctionDecl(); 158 158 159 Type * get_type() const{ return type; }160 virtual void set_type(Type * t) { type = strict_dynamic_cast< FunctionType* >( t ); }159 virtual Type * get_type() const override { return type; } 160 virtual void set_type(Type * t) override { type = strict_dynamic_cast< FunctionType* >( t ); } 161 161 162 162 FunctionType * get_functionType() const { return type; } … … 165 165 void set_statements( CompoundStmt *newValue ) { statements = newValue; } 166 166 167 virtual FunctionDecl *clone() const { return new FunctionDecl( *this ); }168 virtual void accept( Visitor &v ) { v.visit( this ); }169 virtual DeclarationWithType *acceptMutator( Mutator &m ) { return m.mutate( this ); }170 virtual void print( std::ostream &os, int indent = 0 ) const ;171 virtual void printShort( std::ostream &os, int indent = 0 ) const ;167 virtual FunctionDecl *clone() const override { return new FunctionDecl( *this ); } 168 virtual void accept( Visitor &v ) override { v.visit( this ); } 169 virtual DeclarationWithType *acceptMutator( Mutator &m ) override { return m.mutate( this ); } 170 virtual void print( std::ostream &os, int indent = 0 ) const override; 171 virtual void printShort( std::ostream &os, int indent = 0 ) const override; 172 172 }; 173 173 … … 190 190 virtual std::string typeString() const = 0; 191 191 192 virtual NamedTypeDecl *clone() const = 0;193 virtual void print( std::ostream &os, int indent = 0 ) const ;194 virtual void printShort( std::ostream &os, int indent = 0 ) const ;192 virtual NamedTypeDecl *clone() const override = 0; 193 virtual void print( std::ostream &os, int indent = 0 ) const override; 194 virtual void printShort( std::ostream &os, int indent = 0 ) const override; 195 195 }; 196 196 … … 227 227 TypeDecl * set_sized( bool newValue ) { sized = newValue; return this; } 228 228 229 virtual std::string typeString() const ;229 virtual std::string typeString() const override; 230 230 virtual std::string genTypeString() const; 231 231 232 virtual TypeDecl *clone() const { return new TypeDecl( *this ); }233 virtual void accept( Visitor &v ) { v.visit( this ); }234 virtual Declaration *acceptMutator( Mutator &m ) { return m.mutate( this ); }235 virtual void print( std::ostream &os, int indent = 0 ) const ;232 virtual TypeDecl *clone() const override { return new TypeDecl( *this ); } 233 virtual void accept( Visitor &v ) override { v.visit( this ); } 234 virtual Declaration *acceptMutator( Mutator &m ) override { return m.mutate( this ); } 235 virtual void print( std::ostream &os, int indent = 0 ) const override; 236 236 237 237 private: … … 245 245 TypedefDecl( const TypedefDecl &other ) : Parent( other ) {} 246 246 247 virtual std::string typeString() const ;248 249 virtual TypedefDecl *clone() const { return new TypedefDecl( *this ); }250 virtual void accept( Visitor &v ) { v.visit( this ); }251 virtual Declaration *acceptMutator( Mutator &m ) { return m.mutate( this ); }247 virtual std::string typeString() const override; 248 249 virtual TypedefDecl *clone() const override { return new TypedefDecl( *this ); } 250 virtual void accept( Visitor &v ) override { v.visit( this ); } 251 virtual Declaration *acceptMutator( Mutator &m ) override { return m.mutate( this ); } 252 252 private: 253 253 }; … … 274 274 AggregateDecl * set_body( bool body ) { AggregateDecl::body = body; return this; } 275 275 276 virtual void print( std::ostream &os, int indent = 0 ) const ;277 virtual void printShort( std::ostream &os, int indent = 0 ) const ;276 virtual void print( std::ostream &os, int indent = 0 ) const override; 277 virtual void printShort( std::ostream &os, int indent = 0 ) const override; 278 278 protected: 279 279 virtual std::string typeString() const = 0; … … 290 290 bool is_thread() { return kind == DeclarationNode::Thread; } 291 291 292 virtual StructDecl *clone() const { return new StructDecl( *this ); }293 virtual void accept( Visitor &v ) { v.visit( this ); }294 virtual Declaration *acceptMutator( Mutator &m ) { return m.mutate( this ); }292 virtual StructDecl *clone() const override { return new StructDecl( *this ); } 293 virtual void accept( Visitor &v ) override { v.visit( this ); } 294 virtual Declaration *acceptMutator( Mutator &m ) override { return m.mutate( this ); } 295 295 private: 296 296 DeclarationNode::Aggregate kind; 297 virtual std::string typeString() const ;297 virtual std::string typeString() const override; 298 298 }; 299 299 … … 304 304 UnionDecl( const UnionDecl &other ) : Parent( other ) {} 305 305 306 virtual UnionDecl *clone() const { return new UnionDecl( *this ); }307 virtual void accept( Visitor &v ) { v.visit( this ); }308 virtual Declaration *acceptMutator( Mutator &m ) { return m.mutate( this ); }309 private: 310 virtual std::string typeString() const ;306 virtual UnionDecl *clone() const override { return new UnionDecl( *this ); } 307 virtual void accept( Visitor &v ) override { v.visit( this ); } 308 virtual Declaration *acceptMutator( Mutator &m ) override { return m.mutate( this ); } 309 private: 310 virtual std::string typeString() const override; 311 311 }; 312 312 … … 317 317 EnumDecl( const EnumDecl &other ) : Parent( other ) {} 318 318 319 virtual EnumDecl *clone() const { return new EnumDecl( *this ); }320 virtual void accept( Visitor &v ) { v.visit( this ); }321 virtual Declaration *acceptMutator( Mutator &m ) { return m.mutate( this ); }322 private: 323 virtual std::string typeString() const ;319 virtual EnumDecl *clone() const override { return new EnumDecl( *this ); } 320 virtual void accept( Visitor &v ) override { v.visit( this ); } 321 virtual Declaration *acceptMutator( Mutator &m ) override { return m.mutate( this ); } 322 private: 323 virtual std::string typeString() const override; 324 324 }; 325 325 … … 332 332 TraitDecl( const TraitDecl &other ) : Parent( other ) {} 333 333 334 virtual TraitDecl *clone() const { return new TraitDecl( *this ); }335 virtual void accept( Visitor &v ) { v.visit( this ); }336 virtual Declaration *acceptMutator( Mutator &m ) { return m.mutate( this ); }337 private: 338 virtual std::string typeString() const ;334 virtual TraitDecl *clone() const override { return new TraitDecl( *this ); } 335 virtual void accept( Visitor &v ) override { v.visit( this ); } 336 virtual Declaration *acceptMutator( Mutator &m ) override { return m.mutate( this ); } 337 private: 338 virtual std::string typeString() const override; 339 339 }; 340 340 … … 350 350 void set_stmt( AsmStmt *newValue ) { stmt = newValue; } 351 351 352 virtual AsmDecl *clone() const { return new AsmDecl( *this ); } 353 virtual void accept( Visitor &v ) { v.visit( this ); } 354 virtual AsmDecl *acceptMutator( Mutator &m ) { return m.mutate( this ); } 355 virtual void print( std::ostream &os, int indent = 0 ) const; 356 virtual void printShort( std::ostream &os, int indent = 0 ) const; 357 }; 358 359 std::ostream & operator<<( std::ostream & out, const Declaration * decl ); 352 virtual AsmDecl *clone() const override { return new AsmDecl( *this ); } 353 virtual void accept( Visitor &v ) override { v.visit( this ); } 354 virtual AsmDecl *acceptMutator( Mutator &m ) override { return m.mutate( this ); } 355 virtual void print( std::ostream &os, int indent = 0 ) const override; 356 virtual void printShort( std::ostream &os, int indent = 0 ) const override; 357 }; 358 360 359 std::ostream & operator<<( std::ostream & os, const TypeDecl::Data & data ); 361 360 -
src/SynTree/Expression.cc
re06be49 r695e00d 741 741 } 742 742 743 744 std::ostream & operator<<( std::ostream & out, const Expression * expr ) {745 if ( expr ) {746 expr->print( out );747 } else {748 out << "nullptr";749 }750 return out;751 }752 753 743 // Local Variables: // 754 744 // tab-width: 4 // -
src/SynTree/Expression.h
re06be49 r695e00d 821 821 }; 822 822 823 824 std::ostream & operator<<( std::ostream & out, const Expression * expr );825 826 823 // Local Variables: // 827 824 // tab-width: 4 // -
src/SynTree/Initializer.cc
re06be49 r695e00d 137 137 } 138 138 139 std::ostream & operator<<( std::ostream & out, const Initializer * init ) {140 if ( init ) {141 init->print( out );142 } else {143 out << "nullptr";144 }145 return out;146 }147 148 std::ostream & operator<<( std::ostream & out, const Designation * des ) {149 if ( des ) {150 des->print( out );151 } else {152 out << "nullptr";153 }154 return out;155 }156 157 139 // Local Variables: // 158 140 // tab-width: 4 // -
src/SynTree/Initializer.h
re06be49 r695e00d 38 38 39 39 virtual Designation * clone() const { return new Designation( *this ); }; 40 virtual void accept( Visitor &v ) { v.visit( this ); }40 virtual void accept( Visitor &v ) override { v.visit( this ); } 41 41 virtual Designation * acceptMutator( Mutator &m ) { return m.mutate( this ); } 42 virtual void print( std::ostream &os, int indent = 0 ) const ;42 virtual void print( std::ostream &os, int indent = 0 ) const override; 43 43 }; 44 44 … … 55 55 56 56 virtual Initializer *clone() const = 0; 57 virtual void accept( Visitor &v ) = 0;57 virtual void accept( Visitor &v ) override = 0; 58 58 virtual Initializer *acceptMutator( Mutator &m ) = 0; 59 virtual void print( std::ostream &os, int indent = 0 ) const = 0;59 virtual void print( std::ostream &os, int indent = 0 ) const override = 0; 60 60 private: 61 61 bool maybeConstructed; … … 75 75 void set_value( Expression *newValue ) { value = newValue; } 76 76 77 virtual SingleInit *clone() const { return new SingleInit( *this); }78 virtual void accept( Visitor &v ) { v.visit( this ); }79 virtual Initializer *acceptMutator( Mutator &m ) { return m.mutate( this ); }80 virtual void print( std::ostream &os, int indent = 0 ) const ;77 virtual SingleInit *clone() const override { return new SingleInit( *this); } 78 virtual void accept( Visitor &v ) override { v.visit( this ); } 79 virtual Initializer *acceptMutator( Mutator &m ) override { return m.mutate( this ); } 80 virtual void print( std::ostream &os, int indent = 0 ) const override; 81 81 }; 82 82 … … 103 103 const_iterator end() const { return initializers.end(); } 104 104 105 virtual ListInit *clone() const { return new ListInit( *this ); }106 virtual void accept( Visitor &v ) { v.visit( this ); }107 virtual Initializer *acceptMutator( Mutator &m ) { return m.mutate( this ); }108 virtual void print( std::ostream &os, int indent = 0 ) const ;105 virtual ListInit *clone() const override { return new ListInit( *this ); } 106 virtual void accept( Visitor &v ) override { v.visit( this ); } 107 virtual Initializer *acceptMutator( Mutator &m ) override { return m.mutate( this ); } 108 virtual void print( std::ostream &os, int indent = 0 ) const override; 109 109 }; 110 110 … … 129 129 Initializer * get_init() const { return init; } 130 130 131 ConstructorInit *clone() const { return new ConstructorInit( *this ); }132 virtual void accept( Visitor &v ) { v.visit( this ); }133 virtual Initializer *acceptMutator( Mutator &m ) { return m.mutate( this ); }134 virtual void print( std::ostream &os, int indent = 0 ) const ;131 ConstructorInit *clone() const override { return new ConstructorInit( *this ); } 132 virtual void accept( Visitor &v ) override { v.visit( this ); } 133 virtual Initializer *acceptMutator( Mutator &m ) override { return m.mutate( this ); } 134 virtual void print( std::ostream &os, int indent = 0 ) const override; 135 135 136 136 private: … … 140 140 }; 141 141 142 std::ostream & operator<<( std::ostream & out, const Initializer * init );143 std::ostream & operator<<( std::ostream & out, const Designation * des );144 145 142 // Local Variables: // 146 143 // tab-width: 4 // -
src/SynTree/Statement.cc
re06be49 r695e00d 168 168 } 169 169 170 SwitchStmt::SwitchStmt( std::list<Label> labels, Expression * condition, std::list<Statement *> &statements ):170 SwitchStmt::SwitchStmt( std::list<Label> labels, Expression * condition, const std::list<Statement *> &statements ): 171 171 Statement( labels ), condition( condition ), statements( statements ) { 172 172 } … … 196 196 } 197 197 198 CaseStmt::CaseStmt( std::list<Label> labels, Expression *condition, std::list<Statement *> &statements, bool deflt ) throw ( SemanticError ) :198 CaseStmt::CaseStmt( std::list<Label> labels, Expression *condition, const std::list<Statement *> &statements, bool deflt ) throw ( SemanticError ) : 199 199 Statement( labels ), condition( condition ), stmts( statements ), _isDefault( deflt ) { 200 200 if ( isDefault() && condition != 0 ) … … 497 497 } 498 498 499 std::ostream & operator<<( std::ostream & out, const Statement * statement ) {500 if ( statement ) {501 statement->print( out );502 } else {503 out << "nullptr";504 }505 return out;506 }507 508 499 // Local Variables: // 509 500 // tab-width: 4 // -
src/SynTree/Statement.h
re06be49 r695e00d 44 44 45 45 virtual Statement *clone() const = 0; 46 virtual void accept( Visitor &v ) = 0;46 virtual void accept( Visitor &v ) override = 0; 47 47 virtual Statement *acceptMutator( Mutator &m ) = 0; 48 virtual void print( std::ostream &os, int indent = 0 ) const ;48 virtual void print( std::ostream &os, int indent = 0 ) const override; 49 49 }; 50 50 … … 61 61 void push_front( Statement * stmt ) { kids.push_front( stmt ); } 62 62 63 virtual CompoundStmt *clone() const { return new CompoundStmt( *this ); }64 virtual void accept( Visitor &v ) { v.visit( this ); }65 virtual CompoundStmt *acceptMutator( Mutator &m ) { return m.mutate( this ); }66 virtual void print( std::ostream &os, int indent = 0 ) const ;63 virtual CompoundStmt *clone() const override { return new CompoundStmt( *this ); } 64 virtual void accept( Visitor &v ) override { v.visit( this ); } 65 virtual CompoundStmt *acceptMutator( Mutator &m ) override { return m.mutate( this ); } 66 virtual void print( std::ostream &os, int indent = 0 ) const override; 67 67 }; 68 68 … … 72 72 NullStmt( std::list<Label> labels ); 73 73 74 virtual NullStmt *clone() const { return new NullStmt( *this ); }75 virtual void accept( Visitor &v ) { v.visit( this ); }76 virtual NullStmt *acceptMutator( Mutator &m ) { return m.mutate( this ); }77 virtual void print( std::ostream &os, int indent = 0 ) const ;74 virtual NullStmt *clone() const override { return new NullStmt( *this ); } 75 virtual void accept( Visitor &v ) override { v.visit( this ); } 76 virtual NullStmt *acceptMutator( Mutator &m ) override { return m.mutate( this ); } 77 virtual void print( std::ostream &os, int indent = 0 ) const override; 78 78 }; 79 79 … … 89 89 void set_expr( Expression *newValue ) { expr = newValue; } 90 90 91 virtual ExprStmt *clone() const { return new ExprStmt( *this ); }92 virtual void accept( Visitor &v ) { v.visit( this ); }93 virtual Statement *acceptMutator( Mutator &m ) { return m.mutate( this ); }94 virtual void print( std::ostream &os, int indent = 0 ) const ;91 virtual ExprStmt *clone() const override { return new ExprStmt( *this ); } 92 virtual void accept( Visitor &v ) override { v.visit( this ); } 93 virtual Statement *acceptMutator( Mutator &m ) override { return m.mutate( this ); } 94 virtual void print( std::ostream &os, int indent = 0 ) const override; 95 95 }; 96 96 … … 146 146 void set_elsePart( Statement *newValue ) { elsePart = newValue; } 147 147 148 virtual IfStmt *clone() const { return new IfStmt( *this ); }149 virtual void accept( Visitor &v ) { v.visit( this ); }150 virtual Statement *acceptMutator( Mutator &m ) { return m.mutate( this ); }151 virtual void print( std::ostream &os, int indent = 0 ) const ;148 virtual IfStmt *clone() const override { return new IfStmt( *this ); } 149 virtual void accept( Visitor &v ) override { v.visit( this ); } 150 virtual Statement *acceptMutator( Mutator &m ) override { return m.mutate( this ); } 151 virtual void print( std::ostream &os, int indent = 0 ) const override; 152 152 }; 153 153 … … 157 157 std::list<Statement *> statements; 158 158 159 SwitchStmt( std::list<Label> labels, Expression *condition, std::list<Statement *> &statements );159 SwitchStmt( std::list<Label> labels, Expression *condition, const std::list<Statement *> &statements ); 160 160 SwitchStmt( const SwitchStmt &other ); 161 161 virtual ~SwitchStmt(); … … 166 166 std::list<Statement *> & get_statements() { return statements; } 167 167 168 virtual void accept( Visitor &v ) { v.visit( this ); }169 virtual Statement *acceptMutator( Mutator &m ) { return m.mutate( this ); }170 171 virtual SwitchStmt *clone() const { return new SwitchStmt( *this ); }172 virtual void print( std::ostream &os, int indent = 0 ) const ;168 virtual void accept( Visitor &v ) override { v.visit( this ); } 169 virtual Statement *acceptMutator( Mutator &m ) override { return m.mutate( this ); } 170 171 virtual SwitchStmt *clone() const override { return new SwitchStmt( *this ); } 172 virtual void print( std::ostream &os, int indent = 0 ) const override; 173 173 174 174 }; … … 179 179 std::list<Statement *> stmts; 180 180 181 CaseStmt( std::list<Label> labels, Expression *conditions, std::list<Statement *> &stmts, bool isdef = false ) throw(SemanticError);181 CaseStmt( std::list<Label> labels, Expression *conditions, const std::list<Statement *> &stmts, bool isdef = false ) throw(SemanticError); 182 182 CaseStmt( const CaseStmt &other ); 183 183 virtual ~CaseStmt(); … … 194 194 void set_statements( std::list<Statement *> &newValue ) { stmts = newValue; } 195 195 196 virtual void accept( Visitor &v ) { v.visit( this ); }197 virtual Statement *acceptMutator( Mutator &m ) { return m.mutate( this ); }198 199 virtual CaseStmt *clone() const { return new CaseStmt( *this ); }200 virtual void print( std::ostream &os, int indent = 0 ) const ;196 virtual void accept( Visitor &v ) override { v.visit( this ); } 197 virtual Statement *acceptMutator( Mutator &m ) override { return m.mutate( this ); } 198 199 virtual CaseStmt *clone() const override { return new CaseStmt( *this ); } 200 virtual void print( std::ostream &os, int indent = 0 ) const override; 201 201 private: 202 202 bool _isDefault; … … 221 221 void set_isDoWhile( bool newValue ) { isDoWhile = newValue; } 222 222 223 virtual WhileStmt *clone() const { return new WhileStmt( *this ); }224 virtual void accept( Visitor &v ) { v.visit( this ); }225 virtual Statement *acceptMutator( Mutator &m ) { return m.mutate( this ); }226 virtual void print( std::ostream &os, int indent = 0 ) const ;223 virtual WhileStmt *clone() const override { return new WhileStmt( *this ); } 224 virtual void accept( Visitor &v ) override { v.visit( this ); } 225 virtual Statement *acceptMutator( Mutator &m ) override { return m.mutate( this ); } 226 virtual void print( std::ostream &os, int indent = 0 ) const override; 227 227 }; 228 228 … … 247 247 void set_body( Statement *newValue ) { body = newValue; } 248 248 249 virtual ForStmt *clone() const { return new ForStmt( *this ); }250 virtual void accept( Visitor &v ) { v.visit( this ); }251 virtual Statement *acceptMutator( Mutator &m ) { return m.mutate( this ); }252 virtual void print( std::ostream &os, int indent = 0 ) const ;249 virtual ForStmt *clone() const override { return new ForStmt( *this ); } 250 virtual void accept( Visitor &v ) override { v.visit( this ); } 251 virtual Statement *acceptMutator( Mutator &m ) override { return m.mutate( this ); } 252 virtual void print( std::ostream &os, int indent = 0 ) const override; 253 253 }; 254 254 … … 276 276 const char *get_typename() { return brType[ type ]; } 277 277 278 virtual BranchStmt *clone() const { return new BranchStmt( *this ); }279 virtual void accept( Visitor &v ) { v.visit( this ); }280 virtual Statement *acceptMutator( Mutator &m ) { return m.mutate( this ); }281 virtual void print( std::ostream &os, int indent = 0 ) const ;278 virtual BranchStmt *clone() const override { return new BranchStmt( *this ); } 279 virtual void accept( Visitor &v ) override { v.visit( this ); } 280 virtual Statement *acceptMutator( Mutator &m ) override { return m.mutate( this ); } 281 virtual void print( std::ostream &os, int indent = 0 ) const override; 282 282 private: 283 283 static const char *brType[]; … … 295 295 void set_expr( Expression *newValue ) { expr = newValue; } 296 296 297 virtual ReturnStmt *clone() const { return new ReturnStmt( *this ); }298 virtual void accept( Visitor &v ) { v.visit( this ); }299 virtual Statement *acceptMutator( Mutator &m ) { return m.mutate( this ); }300 virtual void print( std::ostream &os, int indent = 0 ) const ;297 virtual ReturnStmt *clone() const override { return new ReturnStmt( *this ); } 298 virtual void accept( Visitor &v ) override { v.visit( this ); } 299 virtual Statement *acceptMutator( Mutator &m ) override { return m.mutate( this ); } 300 virtual void print( std::ostream &os, int indent = 0 ) const override; 301 301 }; 302 302 … … 319 319 void set_target( Expression * newTarget ) { target = newTarget; } 320 320 321 virtual ThrowStmt *clone() const { return new ThrowStmt( *this ); }322 virtual void accept( Visitor &v ) { v.visit( this ); }323 virtual Statement *acceptMutator( Mutator &m ) { return m.mutate( this ); }324 virtual void print( std::ostream &os, int indent = 0 ) const ;321 virtual ThrowStmt *clone() const override { return new ThrowStmt( *this ); } 322 virtual void accept( Visitor &v ) override { v.visit( this ); } 323 virtual Statement *acceptMutator( Mutator &m ) override { return m.mutate( this ); } 324 virtual void print( std::ostream &os, int indent = 0 ) const override; 325 325 }; 326 326 … … 342 342 void set_finally( FinallyStmt *newValue ) { finallyBlock = newValue; } 343 343 344 virtual TryStmt *clone() const { return new TryStmt( *this ); }345 virtual void accept( Visitor &v ) { v.visit( this ); }346 virtual Statement *acceptMutator( Mutator &m ) { return m.mutate( this ); }347 virtual void print( std::ostream &os, int indent = 0 ) const ;344 virtual TryStmt *clone() const override { return new TryStmt( *this ); } 345 virtual void accept( Visitor &v ) override { v.visit( this ); } 346 virtual Statement *acceptMutator( Mutator &m ) override { return m.mutate( this ); } 347 virtual void print( std::ostream &os, int indent = 0 ) const override; 348 348 }; 349 349 … … 370 370 void set_body( Statement *newValue ) { body = newValue; } 371 371 372 virtual CatchStmt *clone() const { return new CatchStmt( *this ); }373 virtual void accept( Visitor &v ) { v.visit( this ); }374 virtual Statement *acceptMutator( Mutator &m ) { return m.mutate( this ); }375 virtual void print( std::ostream &os, int indent = 0 ) const ;372 virtual CatchStmt *clone() const override { return new CatchStmt( *this ); } 373 virtual void accept( Visitor &v ) override { v.visit( this ); } 374 virtual Statement *acceptMutator( Mutator &m ) override { return m.mutate( this ); } 375 virtual void print( std::ostream &os, int indent = 0 ) const override; 376 376 }; 377 377 … … 387 387 void set_block( CompoundStmt *newValue ) { block = newValue; } 388 388 389 virtual FinallyStmt *clone() const { return new FinallyStmt( *this ); }390 virtual void accept( Visitor &v ) { v.visit( this ); }391 virtual Statement *acceptMutator( Mutator &m ) { return m.mutate( this ); }392 virtual void print( std::ostream &os, int indent = 0 ) const ;389 virtual FinallyStmt *clone() const override { return new FinallyStmt( *this ); } 390 virtual void accept( Visitor &v ) override { v.visit( this ); } 391 virtual Statement *acceptMutator( Mutator &m ) override { return m.mutate( this ); } 392 virtual void print( std::ostream &os, int indent = 0 ) const override; 393 393 }; 394 394 … … 424 424 } orelse; 425 425 426 virtual WaitForStmt *clone() const { return new WaitForStmt( *this ); }427 virtual void accept( Visitor &v ) { v.visit( this ); }428 virtual Statement *acceptMutator( Mutator &m ) { return m.mutate( this ); }429 virtual void print( std::ostream &os, int indent = 0 ) const ;426 virtual WaitForStmt *clone() const override { return new WaitForStmt( *this ); } 427 virtual void accept( Visitor &v ) override { v.visit( this ); } 428 virtual Statement *acceptMutator( Mutator &m ) override { return m.mutate( this ); } 429 virtual void print( std::ostream &os, int indent = 0 ) const override; 430 430 431 431 }; … … 444 444 void set_decl( Declaration *newValue ) { decl = newValue; } 445 445 446 virtual DeclStmt *clone() const { return new DeclStmt( *this ); }447 virtual void accept( Visitor &v ) { v.visit( this ); }448 virtual Statement *acceptMutator( Mutator &m ) { return m.mutate( this ); }449 virtual void print( std::ostream &os, int indent = 0 ) const ;446 virtual DeclStmt *clone() const override { return new DeclStmt( *this ); } 447 virtual void accept( Visitor &v ) override { v.visit( this ); } 448 virtual Statement *acceptMutator( Mutator &m ) override { return m.mutate( this ); } 449 virtual void print( std::ostream &os, int indent = 0 ) const override; 450 450 }; 451 451 … … 466 466 void set_callStmt( Statement * newValue ) { callStmt = newValue; } 467 467 468 virtual ImplicitCtorDtorStmt *clone() const { return new ImplicitCtorDtorStmt( *this ); } 469 virtual void accept( Visitor &v ) { v.visit( this ); } 470 virtual Statement *acceptMutator( Mutator &m ) { return m.mutate( this ); } 471 virtual void print( std::ostream &os, int indent = 0 ) const; 472 }; 473 474 475 std::ostream & operator<<( std::ostream & out, const Statement * statement ); 468 virtual ImplicitCtorDtorStmt *clone() const override { return new ImplicitCtorDtorStmt( *this ); } 469 virtual void accept( Visitor &v ) override { v.visit( this ); } 470 virtual Statement *acceptMutator( Mutator &m ) override { return m.mutate( this ); } 471 virtual void print( std::ostream &os, int indent = 0 ) const override; 472 }; 476 473 477 474 // Local Variables: // -
src/SynTree/Type.cc
re06be49 r695e00d 99 99 const Type::Qualifiers noQualifiers; 100 100 101 std::ostream & operator<<( std::ostream & out, const Type * type ) {102 if ( type ) {103 type->print( out );104 } else {105 out << "nullptr";106 } // if107 return out;108 }109 110 101 // Local Variables: // 111 102 // tab-width: 4 // -
src/SynTree/Type.h
re06be49 r695e00d 192 192 VoidType( const Type::Qualifiers & tq, const std::list< Attribute * > & attributes = std::list< Attribute * >() ); 193 193 194 virtual unsigned size() const { return 0; };195 virtual bool isComplete() const { return false; }196 197 virtual VoidType *clone() const { return new VoidType( *this ); }198 virtual void accept( Visitor & v ) { v.visit( this ); }199 virtual Type *acceptMutator( Mutator & m ) { return m.mutate( this ); }200 virtual void print( std::ostream & os, int indent = 0 ) const ;194 virtual unsigned size() const override { return 0; }; 195 virtual bool isComplete() const override { return false; } 196 197 virtual VoidType *clone() const override { return new VoidType( *this ); } 198 virtual void accept( Visitor & v ) override { v.visit( this ); } 199 virtual Type *acceptMutator( Mutator & m ) override { return m.mutate( this ); } 200 virtual void print( std::ostream & os, int indent = 0 ) const override; 201 201 }; 202 202 … … 235 235 void set_kind( Kind newValue ) { kind = newValue; } 236 236 237 virtual BasicType *clone() const { return new BasicType( *this ); }238 virtual void accept( Visitor & v ) { v.visit( this ); }239 virtual Type *acceptMutator( Mutator & m ) { return m.mutate( this ); }240 virtual void print( std::ostream & os, int indent = 0 ) const ;237 virtual BasicType *clone() const override { return new BasicType( *this ); } 238 virtual void accept( Visitor & v ) override { v.visit( this ); } 239 virtual Type *acceptMutator( Mutator & m ) override { return m.mutate( this ); } 240 virtual void print( std::ostream & os, int indent = 0 ) const override; 241 241 242 242 bool isInteger() const; … … 268 268 bool is_array() const { return isStatic || isVarLen || dimension; } 269 269 270 virtual bool isComplete() const { return ! isVarLen; }271 272 virtual PointerType *clone() const { return new PointerType( *this ); }273 virtual void accept( Visitor & v ) { v.visit( this ); }274 virtual Type *acceptMutator( Mutator & m ) { return m.mutate( this ); }275 virtual void print( std::ostream & os, int indent = 0 ) const ;270 virtual bool isComplete() const override { return ! isVarLen; } 271 272 virtual PointerType *clone() const override { return new PointerType( *this ); } 273 virtual void accept( Visitor & v ) override { v.visit( this ); } 274 virtual Type *acceptMutator( Mutator & m ) override { return m.mutate( this ); } 275 virtual void print( std::ostream & os, int indent = 0 ) const override; 276 276 }; 277 277 … … 296 296 void set_isStatic( bool newValue ) { isStatic = newValue; } 297 297 298 virtual bool isComplete() const { return ! isVarLen; }299 300 virtual ArrayType *clone() const { return new ArrayType( *this ); }301 virtual void accept( Visitor & v ) { v.visit( this ); }302 virtual Type *acceptMutator( Mutator & m ) { return m.mutate( this ); }303 virtual void print( std::ostream & os, int indent = 0 ) const ;298 virtual bool isComplete() const override { return ! isVarLen; } 299 300 virtual ArrayType *clone() const override { return new ArrayType( *this ); } 301 virtual void accept( Visitor & v ) override { v.visit( this ); } 302 virtual Type *acceptMutator( Mutator & m ) override { return m.mutate( this ); } 303 virtual void print( std::ostream & os, int indent = 0 ) const override; 304 304 }; 305 305 … … 315 315 void set_base( Type *newValue ) { base = newValue; } 316 316 317 virtual int referenceDepth() const ;317 virtual int referenceDepth() const override; 318 318 319 319 // Since reference types act like value types, their size is the size of the base. 320 320 // This makes it simple to cast the empty tuple to a reference type, since casts that increase 321 321 // the number of values are disallowed. 322 virtual unsigned size() const { return base->size(); }323 324 virtual ReferenceType *clone() const { return new ReferenceType( *this ); }325 virtual void accept( Visitor & v ) { v.visit( this ); }326 virtual Type *acceptMutator( Mutator & m ) { return m.mutate( this ); }327 virtual void print( std::ostream & os, int indent = 0 ) const ;322 virtual unsigned size() const override { return base->size(); } 323 324 virtual ReferenceType *clone() const override { return new ReferenceType( *this ); } 325 virtual void accept( Visitor & v ) override { v.visit( this ); } 326 virtual Type *acceptMutator( Mutator & m ) override { return m.mutate( this ); } 327 virtual void print( std::ostream & os, int indent = 0 ) const override; 328 328 }; 329 329 … … 349 349 bool isTtype() const; 350 350 351 virtual FunctionType *clone() const { return new FunctionType( *this ); }352 virtual void accept( Visitor & v ) { v.visit( this ); }353 virtual Type *acceptMutator( Mutator & m ) { return m.mutate( this ); }354 virtual void print( std::ostream & os, int indent = 0 ) const ;351 virtual FunctionType *clone() const override { return new FunctionType( *this ); } 352 virtual void accept( Visitor & v ) override { v.visit( this ); } 353 virtual Type *acceptMutator( Mutator & m ) override { return m.mutate( this ); } 354 virtual void print( std::ostream & os, int indent = 0 ) const override; 355 355 }; 356 356 … … 371 371 void set_hoistType( bool newValue ) { hoistType = newValue; } 372 372 373 virtual ReferenceToType *clone() const = 0;374 virtual void accept( Visitor & v ) = 0;375 virtual Type *acceptMutator( Mutator & m ) = 0;376 virtual void print( std::ostream & os, int indent = 0 ) const ;373 virtual ReferenceToType *clone() const override = 0; 374 virtual void accept( Visitor & v ) override = 0; 375 virtual Type *acceptMutator( Mutator & m ) override = 0; 376 virtual void print( std::ostream & os, int indent = 0 ) const override; 377 377 378 378 virtual void lookup( __attribute__((unused)) const std::string & name, __attribute__((unused)) std::list< Declaration* > & foundDecls ) const {} … … 398 398 std::list<TypeDecl*> * get_baseParameters(); 399 399 400 virtual bool isComplete() const ;400 virtual bool isComplete() const override; 401 401 402 402 /// Looks up the members of this struct named "name" and places them into "foundDecls". 403 403 /// Clones declarations into "foundDecls", caller responsible for freeing 404 void lookup( const std::string & name, std::list< Declaration* > & foundDecls ) const ;405 406 virtual StructInstType *clone() const { return new StructInstType( *this ); }407 virtual void accept( Visitor & v ) { v.visit( this ); }408 virtual Type *acceptMutator( Mutator & m ) { return m.mutate( this ); }409 410 virtual void print( std::ostream & os, int indent = 0 ) const ;404 void lookup( const std::string & name, std::list< Declaration* > & foundDecls ) const override; 405 406 virtual StructInstType *clone() const override { return new StructInstType( *this ); } 407 virtual void accept( Visitor & v ) override { v.visit( this ); } 408 virtual Type *acceptMutator( Mutator & m ) override { return m.mutate( this ); } 409 410 virtual void print( std::ostream & os, int indent = 0 ) const override; 411 411 private: 412 virtual std::string typeString() const ;412 virtual std::string typeString() const override; 413 413 }; 414 414 … … 430 430 std::list< TypeDecl * > * get_baseParameters(); 431 431 432 virtual bool isComplete() const ;432 virtual bool isComplete() const override; 433 433 434 434 /// looks up the members of this union named "name" and places them into "foundDecls" 435 435 /// Clones declarations into "foundDecls", caller responsible for freeing 436 void lookup( const std::string & name, std::list< Declaration* > & foundDecls ) const ;437 438 virtual UnionInstType *clone() const { return new UnionInstType( *this ); }439 virtual void accept( Visitor & v ) { v.visit( this ); }440 virtual Type *acceptMutator( Mutator & m ) { return m.mutate( this ); }441 442 virtual void print( std::ostream & os, int indent = 0 ) const ;436 void lookup( const std::string & name, std::list< Declaration* > & foundDecls ) const override; 437 438 virtual UnionInstType *clone() const override { return new UnionInstType( *this ); } 439 virtual void accept( Visitor & v ) override { v.visit( this ); } 440 virtual Type *acceptMutator( Mutator & m ) override { return m.mutate( this ); } 441 442 virtual void print( std::ostream & os, int indent = 0 ) const override; 443 443 private: 444 virtual std::string typeString() const ;444 virtual std::string typeString() const override; 445 445 }; 446 446 … … 459 459 void set_baseEnum( EnumDecl *newValue ) { baseEnum = newValue; } 460 460 461 virtual bool isComplete() const ;462 463 virtual EnumInstType *clone() const { return new EnumInstType( *this ); }464 virtual void accept( Visitor & v ) { v.visit( this ); }465 virtual Type *acceptMutator( Mutator & m ) { return m.mutate( this ); }461 virtual bool isComplete() const override; 462 463 virtual EnumInstType *clone() const override { return new EnumInstType( *this ); } 464 virtual void accept( Visitor & v ) override { v.visit( this ); } 465 virtual Type *acceptMutator( Mutator & m ) override { return m.mutate( this ); } 466 466 private: 467 virtual std::string typeString() const ;467 virtual std::string typeString() const override; 468 468 }; 469 469 … … 480 480 ~TraitInstType(); 481 481 482 virtual bool isComplete() const ;483 484 virtual TraitInstType *clone() const { return new TraitInstType( *this ); }485 virtual void accept( Visitor & v ) { v.visit( this ); }486 virtual Type *acceptMutator( Mutator & m ) { return m.mutate( this ); }482 virtual bool isComplete() const override; 483 484 virtual TraitInstType *clone() const override { return new TraitInstType( *this ); } 485 virtual void accept( Visitor & v ) override { v.visit( this ); } 486 virtual Type *acceptMutator( Mutator & m ) override { return m.mutate( this ); } 487 487 private: 488 virtual std::string typeString() const ;488 virtual std::string typeString() const override; 489 489 }; 490 490 … … 507 507 void set_isFtype( bool newValue ) { isFtype = newValue; } 508 508 509 virtual bool isComplete() const ;510 511 virtual TypeInstType *clone() const { return new TypeInstType( *this ); }512 virtual void accept( Visitor & v ) { v.visit( this ); }513 virtual Type *acceptMutator( Mutator & m ) { return m.mutate( this ); }514 virtual void print( std::ostream & os, int indent = 0 ) const ;509 virtual bool isComplete() const override; 510 511 virtual TypeInstType *clone() const override { return new TypeInstType( *this ); } 512 virtual void accept( Visitor & v ) override { v.visit( this ); } 513 virtual Type *acceptMutator( Mutator & m ) override { return m.mutate( this ); } 514 virtual void print( std::ostream & os, int indent = 0 ) const override; 515 515 private: 516 virtual std::string typeString() const ;516 virtual std::string typeString() const override; 517 517 }; 518 518 … … 530 530 531 531 std::list<Type *> & get_types() { return types; } 532 virtual unsigned size() const { return types.size(); };532 virtual unsigned size() const override { return types.size(); }; 533 533 534 534 // For now, this is entirely synthetic -- tuple types always have unnamed members. … … 539 539 iterator end() { return types.end(); } 540 540 541 virtual Type * getComponent( unsigned i ) {541 virtual Type * getComponent( unsigned i ) override { 542 542 assertf( i < size(), "TupleType::getComponent: index %d must be less than size %d", i, size() ); 543 543 return *(begin()+i); 544 544 } 545 545 546 // virtual bool isComplete() const { return true; } // xxx - not sure if this is right, might need to recursively check complete-ness547 548 virtual TupleType *clone() const { return new TupleType( *this ); }549 virtual void accept( Visitor & v ) { v.visit( this ); }550 virtual Type *acceptMutator( Mutator & m ) { return m.mutate( this ); }551 virtual void print( std::ostream & os, int indent = 0 ) const ;546 // virtual bool isComplete() const override { return true; } // xxx - not sure if this is right, might need to recursively check complete-ness 547 548 virtual TupleType *clone() const override { return new TupleType( *this ); } 549 virtual void accept( Visitor & v ) override { v.visit( this ); } 550 virtual Type *acceptMutator( Mutator & m ) override { return m.mutate( this ); } 551 virtual void print( std::ostream & os, int indent = 0 ) const override; 552 552 }; 553 553 … … 563 563 void set_expr( Expression *newValue ) { expr = newValue; } 564 564 565 virtual bool isComplete() const { assert( false ); return false; }566 567 virtual TypeofType *clone() const { return new TypeofType( *this ); }568 virtual void accept( Visitor & v ) { v.visit( this ); }569 virtual Type *acceptMutator( Mutator & m ) { return m.mutate( this ); }570 virtual void print( std::ostream & os, int indent = 0 ) const ;565 virtual bool isComplete() const override { assert( false ); return false; } 566 567 virtual TypeofType *clone() const override { return new TypeofType( *this ); } 568 virtual void accept( Visitor & v ) override { v.visit( this ); } 569 virtual Type *acceptMutator( Mutator & m ) override { return m.mutate( this ); } 570 virtual void print( std::ostream & os, int indent = 0 ) const override; 571 571 }; 572 572 … … 592 592 void set_isType( bool newValue ) { isType = newValue; } 593 593 594 virtual bool isComplete() const { assert( false ); } // xxx - not sure what to do here595 596 virtual AttrType *clone() const { return new AttrType( *this ); }597 virtual void accept( Visitor & v ) { v.visit( this ); }598 virtual Type *acceptMutator( Mutator & m ) { return m.mutate( this ); }599 virtual void print( std::ostream & os, int indent = 0 ) const ;594 virtual bool isComplete() const override { assert( false ); } // xxx - not sure what to do here 595 596 virtual AttrType *clone() const override { return new AttrType( *this ); } 597 virtual void accept( Visitor & v ) override { v.visit( this ); } 598 virtual Type *acceptMutator( Mutator & m ) override { return m.mutate( this ); } 599 virtual void print( std::ostream & os, int indent = 0 ) const override; 600 600 }; 601 601 … … 606 606 VarArgsType( Type::Qualifiers tq, const std::list< Attribute * > & attributes = std::list< Attribute * >() ); 607 607 608 virtual bool isComplete() const { return true; } // xxx - is this right?609 610 virtual VarArgsType *clone() const { return new VarArgsType( *this ); }611 virtual void accept( Visitor & v ) { v.visit( this ); }612 virtual Type *acceptMutator( Mutator & m ) { return m.mutate( this ); }613 virtual void print( std::ostream & os, int indent = 0 ) const ;608 virtual bool isComplete() const override{ return true; } // xxx - is this right? 609 610 virtual VarArgsType *clone() const override { return new VarArgsType( *this ); } 611 virtual void accept( Visitor & v ) override { v.visit( this ); } 612 virtual Type *acceptMutator( Mutator & m ) override { return m.mutate( this ); } 613 virtual void print( std::ostream & os, int indent = 0 ) const override; 614 614 }; 615 615 … … 620 620 ZeroType( Type::Qualifiers tq, const std::list< Attribute * > & attributes = std::list< Attribute * >() ); 621 621 622 virtual ZeroType *clone() const { return new ZeroType( *this ); }623 virtual void accept( Visitor & v ) { v.visit( this ); }624 virtual Type *acceptMutator( Mutator & m ) { return m.mutate( this ); }625 virtual void print( std::ostream & os, int indent = 0 ) const ;622 virtual ZeroType *clone() const override { return new ZeroType( *this ); } 623 virtual void accept( Visitor & v ) override { v.visit( this ); } 624 virtual Type *acceptMutator( Mutator & m ) override { return m.mutate( this ); } 625 virtual void print( std::ostream & os, int indent = 0 ) const override; 626 626 }; 627 627 … … 632 632 OneType( Type::Qualifiers tq, const std::list< Attribute * > & attributes = std::list< Attribute * >() ); 633 633 634 virtual OneType *clone() const { return new OneType( *this ); } 635 virtual void accept( Visitor & v ) { v.visit( this ); } 636 virtual Type *acceptMutator( Mutator & m ) { return m.mutate( this ); } 637 virtual void print( std::ostream & os, int indent = 0 ) const; 638 }; 639 640 std::ostream & operator<<( std::ostream & out, const Type * type ); 634 virtual OneType *clone() const override { return new OneType( *this ); } 635 virtual void accept( Visitor & v ) override { v.visit( this ); } 636 virtual Type *acceptMutator( Mutator & m ) override { return m.mutate( this ); } 637 virtual void print( std::ostream & os, int indent = 0 ) const override; 638 }; 641 639 642 640 // Local Variables: // -
src/libcfa/concurrency/monitor
re06be49 r695e00d 21 21 #include "invoke.h" 22 22 #include "stdlib" 23 24 trait is_monitor(dtype T) { 25 monitor_desc * get_monitor( T & ); 26 void ^?{}( T & mutex ); 27 }; 23 28 24 29 static inline void ?{}(monitor_desc & this) { … … 106 111 }; 107 112 108 int __ accept_internal( unsigned short count, __acceptable_t * acceptables);113 int __waitfor_internal( unsigned short count, __acceptable_t * acceptables, int duration ); 109 114 110 115 // Local Variables: // -
src/libcfa/concurrency/monitor.c
re06be49 r695e00d 398 398 //----------------------------------------------------------------------------- 399 399 // Internal scheduling 400 int __ accept_internal( unsigned short acc_count, __acceptable_t * acceptables ) {400 int __waitfor_internal( unsigned short acc_count, __acceptable_t * acceptables ) { 401 401 thread_desc * thrd = this_thread; 402 402 -
src/tests/sched-ext-parse.c
re06be49 r695e00d 16 16 //--------------------------------------- 17 17 waitfor( f1, a ) { 18 1;18 // 1; 19 19 } 20 20 … … 80 80 16; 81 81 } 82 or waitfor( f 1, a, a ) {82 or waitfor( f2, a, a ) { 83 83 17; 84 84 } -
src/tests/sched-ext.c
re06be49 r695e00d 45 45 acceptable.monitors = &a; 46 46 47 __ accept_internal( 1, &acceptable );47 __waitfor_internal( 1, &acceptable ); 48 48 49 49 sout | "Accepted" | endl;
Note:
See TracChangeset
for help on using the changeset viewer.