Changeset 8f98b78 for src/Concurrency
- Timestamp:
- Sep 19, 2017, 3:55:54 PM (7 years ago)
- Branches:
- ADT, aaron-thesis, arm-eh, ast-experimental, cleanup-dtors, deferred_resn, demangler, enum, forall-pointer-decay, jacob/cs343-translation, jenkins-sandbox, master, new-ast, new-ast-unique-expr, new-env, no_list, persistent-indexer, pthread-emulation, qualifiedEnum, resolv-new, with_gc
- Children:
- 764e009
- Parents:
- 695e00d
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/Concurrency/Waitfor.cc
r695e00d r8f98b78 214 214 } 215 215 216 Expression * betterIsDtor( Expression * func ) {216 Expression * detectIsDtor( Expression * func ) { 217 217 VariableExpr * typed_func = extractVariable( func ); 218 218 bool is_dtor = InitTweak::isDestructor( typed_func->var ); … … 302 302 new ArrayType( 303 303 noQualifiers, 304 new StructInstType(304 new PointerType( 305 305 noQualifiers, 306 decl_monitor 306 new StructInstType( 307 noQualifiers, 308 decl_monitor 309 ) 307 310 ), 308 311 new ConstantExpr( Constant::from_ulong( clause.target.arguments.size() ) ), … … 312 315 new ListInit( 313 316 map_range < std::list<Initializer*> > ( clause.target.arguments, [this](Expression * expr ){ 314 return new SingleInit( expr ); 317 Expression * untyped = new CastExpr( 318 new UntypedExpr( 319 new NameExpr( "get_monitor" ), 320 { expr } 321 ), 322 new PointerType( 323 noQualifiers, 324 new StructInstType( 325 noQualifiers, 326 decl_monitor 327 ) 328 ) 329 ); 330 331 Expression * init = ResolvExpr::findSingleExpression( untyped, indexer ); 332 delete untyped; 333 return new SingleInit( init ); 315 334 }) 316 335 ) … … 328 347 Type * fptr_t = new PointerType( noQualifiers, new FunctionType( noQualifiers, true ) ); 329 348 330 Expression * is_dtor = betterIsDtor( clause.target.function );331 349 CompoundStmt * compound = new CompoundStmt( noLabels ); 350 compound->push_back( makeAccStatement( acceptables, index, "is_dtor" , detectIsDtor( clause.target.function ) , indexer ) ); 332 351 compound->push_back( makeAccStatement( acceptables, index, "func" , new CastExpr( clause.target.function, fptr_t ) , indexer ) ); 352 compound->push_back( makeAccStatement( acceptables, index, "monitors", new VariableExpr( monitors ) , indexer ) ); 333 353 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 ) );336 354 337 355 stmt->push_back( new IfStmt(
Note: See TracChangeset
for help on using the changeset viewer.