- Timestamp:
- Sep 9, 2021, 3:56:32 PM (4 years ago)
- Branches:
- ADT, ast-experimental, enum, forall-pointer-decay, master, pthread-emulation, qualifiedEnum, stuck-waitfor-destruct
- Children:
- d0b9247
- Parents:
- dd1cc02 (diff), d8d512e (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the(diff)links above to see all the changes relative to each parent. - Location:
- src
- Files:
-
- 2 added
- 28 edited
-
AST/Convert.cpp (modified) (2 diffs)
-
AST/Fwd.hpp (modified) (1 diff)
-
AST/Node.cpp (modified) (1 diff)
-
AST/Pass.hpp (modified) (1 diff)
-
AST/Pass.impl.hpp (modified) (1 diff)
-
AST/Print.cpp (modified) (1 diff)
-
AST/Stmt.hpp (modified) (1 diff)
-
AST/Visitor.hpp (modified) (1 diff)
-
CodeGen/CodeGenerator.cc (modified) (1 diff)
-
CodeGen/CodeGenerator.h (modified) (1 diff)
-
Common/CodeLocationTools.cpp (modified) (1 diff)
-
Common/PassVisitor.h (modified) (2 diffs)
-
Common/PassVisitor.impl.h (modified) (1 diff)
-
Concurrency/Keywords.cc (modified) (11 diffs)
-
MakeLibCfa.h (modified) (1 diff)
-
MakeLibCfaNew.cpp (added)
-
Makefile.am (modified) (1 diff)
-
Parser/ExpressionNode.cc (modified) (2 diffs)
-
Parser/ParseNode.h (modified) (1 diff)
-
Parser/StatementNode.cc (modified) (1 diff)
-
Parser/parser.yy (modified) (3 diffs)
-
SynTree/Mutator.h (modified) (1 diff)
-
SynTree/Statement.cc (modified) (1 diff)
-
SynTree/Statement.h (modified) (1 diff)
-
SynTree/SynTree.h (modified) (1 diff)
-
SynTree/Visitor.h (modified) (1 diff)
-
Tuples/TupleExpansionNew.cpp (added)
-
Tuples/Tuples.h (modified) (2 diffs)
-
Tuples/module.mk (modified) (2 diffs)
-
main.cc (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
src/AST/Convert.cpp
rdd1cc02 r5a40e4e 606 606 } 607 607 608 const ast::Stmt * visit( const ast::MutexStmt * node ) override final { 609 if ( inCache( node ) ) return nullptr; 610 auto stmt = new MutexStmt( 611 get<Statement>().accept1( node->stmt ), 612 get<Expression>().acceptL( node->mutexObjs ) 613 ); 614 return stmtPostamble( stmt, node ); 615 } 616 608 617 TypeSubstitution * convertTypeSubstitution(const ast::TypeSubstitution * src) { 609 618 … … 2124 2133 } 2125 2134 2135 virtual void visit( const MutexStmt * old ) override final { 2136 if ( inCache( old ) ) return; 2137 this->node = new ast::MutexStmt( 2138 old->location, 2139 GET_ACCEPT_1(stmt, Stmt), 2140 GET_ACCEPT_V(mutexObjs, Expr) 2141 ); 2142 cache.emplace( old, this->node ); 2143 } 2144 2126 2145 // TypeSubstitution shouldn't exist yet in old. 2127 2146 ast::TypeSubstitution * convertTypeSubstitution(const TypeSubstitution * old) { -
src/AST/Fwd.hpp
rdd1cc02 r5a40e4e 60 60 class NullStmt; 61 61 class ImplicitCtorDtorStmt; 62 class MutexStmt; 62 63 63 64 class Expr; -
src/AST/Node.cpp
rdd1cc02 r5a40e4e 176 176 template class ast::ptr_base< ast::ImplicitCtorDtorStmt, ast::Node::ref_type::weak >; 177 177 template class ast::ptr_base< ast::ImplicitCtorDtorStmt, ast::Node::ref_type::strong >; 178 template class ast::ptr_base< ast::MutexStmt, ast::Node::ref_type::weak >; 179 template class ast::ptr_base< ast::MutexStmt, ast::Node::ref_type::strong >; 178 180 template class ast::ptr_base< ast::Expr, ast::Node::ref_type::weak >; 179 181 template class ast::ptr_base< ast::Expr, ast::Node::ref_type::strong >; -
src/AST/Pass.hpp
rdd1cc02 r5a40e4e 162 162 const ast::Stmt * visit( const ast::DeclStmt * ) override final; 163 163 const ast::Stmt * visit( const ast::ImplicitCtorDtorStmt * ) override final; 164 const ast::Stmt * visit( const ast::MutexStmt * ) override final; 164 165 const ast::Expr * visit( const ast::ApplicationExpr * ) override final; 165 166 const ast::Expr * visit( const ast::UntypedExpr * ) override final; -
src/AST/Pass.impl.hpp
rdd1cc02 r5a40e4e 1039 1039 1040 1040 //-------------------------------------------------------------------------- 1041 // MutexStmt 1042 template< typename core_t > 1043 const ast::Stmt * ast::Pass< core_t >::visit( const ast::MutexStmt * node ) { 1044 VISIT_START( node ); 1045 1046 VISIT({ 1047 // mutex statements introduce a level of scope (for the initialization) 1048 guard_symtab guard { *this }; 1049 maybe_accept( node, &MutexStmt::stmt ); 1050 maybe_accept( node, &MutexStmt::mutexObjs ); 1051 }) 1052 1053 VISIT_END( Stmt, node ); 1054 } 1055 1056 //-------------------------------------------------------------------------- 1041 1057 // ApplicationExpr 1042 1058 template< typename core_t > -
src/AST/Print.cpp
rdd1cc02 r5a40e4e 794 794 ++indent; 795 795 safe_print( node->callStmt ); 796 --indent; 797 os << endl; 798 799 return node; 800 } 801 802 virtual const ast::Stmt * visit( const ast::MutexStmt * node ) override final { 803 os << "Mutex Statement" << endl; 804 os << indent << "... with Mutex Parameters: "; 805 ++indent; 806 printAll( node->mutexObjs ); 807 --indent; 808 os << indent << "... with Statement: "; 809 ++indent; 810 safe_print( node->stmt ); 796 811 --indent; 797 812 os << endl; -
src/AST/Stmt.hpp
rdd1cc02 r5a40e4e 426 426 }; 427 427 428 /// Mutex Statement 429 class MutexStmt final : public Stmt { 430 public: 431 ptr<Stmt> stmt; 432 std::vector<ptr<Expr>> mutexObjs; 433 434 MutexStmt( const CodeLocation & loc, const Stmt * stmt, 435 std::vector<ptr<Expr>> && mutexes, std::vector<Label> && labels = {} ) 436 : Stmt(loc, std::move(labels)), stmt(stmt), mutexObjs(std::move(mutexes)) {} 437 438 const Stmt * accept( Visitor & v ) const override { return v.visit( this ); } 439 private: 440 MutexStmt * clone() const override { return new MutexStmt{ *this }; } 441 MUTATE_FRIEND 442 }; 443 428 444 } 429 445 -
src/AST/Visitor.hpp
rdd1cc02 r5a40e4e 54 54 virtual const ast::Stmt * visit( const ast::DeclStmt * ) = 0; 55 55 virtual const ast::Stmt * visit( const ast::ImplicitCtorDtorStmt * ) = 0; 56 virtual const ast::Stmt * visit( const ast::MutexStmt * ) = 0; 56 57 virtual const ast::Expr * visit( const ast::ApplicationExpr * ) = 0; 57 58 virtual const ast::Expr * visit( const ast::UntypedExpr * ) = 0; -
src/CodeGen/CodeGenerator.cc
rdd1cc02 r5a40e4e 1187 1187 } 1188 1188 1189 void CodeGenerator::postvisit( MutexStmt * stmt ) { 1190 assertf( ! options.genC, "ImplicitCtorDtorStmts should not reach code generation." ); 1191 stmt->stmt->accept( *visitor ); 1192 } 1193 1189 1194 void CodeGenerator::handleStorageClass( DeclarationWithType * decl ) { 1190 1195 if ( decl->get_storageClasses().any() ) { -
src/CodeGen/CodeGenerator.h
rdd1cc02 r5a40e4e 121 121 void postvisit( DeclStmt * ); 122 122 void postvisit( ImplicitCtorDtorStmt * ); 123 void postvisit( MutexStmt * stmt ); 123 124 124 125 void genAttributes( std::list< Attribute * > & attributes ); -
src/Common/CodeLocationTools.cpp
rdd1cc02 r5a40e4e 125 125 macro(DeclStmt, Stmt) \ 126 126 macro(ImplicitCtorDtorStmt, Stmt) \ 127 macro(MutexStmt, Stmt) \ 127 128 macro(ApplicationExpr, Expr) \ 128 129 macro(UntypedExpr, Expr) \ -
src/Common/PassVisitor.h
rdd1cc02 r5a40e4e 124 124 virtual void visit( ImplicitCtorDtorStmt * impCtorDtorStmt ) override final; 125 125 virtual void visit( const ImplicitCtorDtorStmt * impCtorDtorStmt ) override final; 126 virtual void visit( MutexStmt * mutexStmt ) override final; 127 virtual void visit( const MutexStmt * mutexStmt ) override final; 126 128 127 129 virtual void visit( ApplicationExpr * applicationExpr ) override final; … … 291 293 virtual Statement * mutate( DeclStmt * declStmt ) override final; 292 294 virtual Statement * mutate( ImplicitCtorDtorStmt * impCtorDtorStmt ) override final; 295 virtual Statement * mutate( MutexStmt * mutexStmt ) override final; 293 296 294 297 virtual Expression * mutate( ApplicationExpr * applicationExpr ) override final; -
src/Common/PassVisitor.impl.h
rdd1cc02 r5a40e4e 1781 1781 1782 1782 //-------------------------------------------------------------------------- 1783 // MutexStmt 1784 template< typename pass_type > 1785 void PassVisitor< pass_type >::visit( MutexStmt * node ) { 1786 VISIT_START( node ); 1787 // mutex statements introduce a level of scope (for the initialization) 1788 maybeAccept_impl( node->mutexObjs, *this ); 1789 { 1790 auto guard = makeFuncGuard( [this]() { indexerScopeEnter(); }, [this]() { indexerScopeLeave(); } ); 1791 node->stmt = visitStatement( node->stmt ); 1792 } 1793 VISIT_END( node ); 1794 } 1795 1796 template< typename pass_type > 1797 void PassVisitor< pass_type >::visit( const MutexStmt * node ) { 1798 VISIT_START( node ); 1799 maybeAccept_impl( node->mutexObjs, *this ); 1800 { 1801 auto guard = makeFuncGuard( [this]() { indexerScopeEnter(); }, [this]() { indexerScopeLeave(); } ); 1802 visitStatement( node->stmt ); 1803 } 1804 VISIT_END( node ); 1805 } 1806 1807 template< typename pass_type > 1808 Statement * PassVisitor< pass_type >::mutate( MutexStmt * node ) { 1809 MUTATE_START( node ); 1810 maybeMutate_impl( node->mutexObjs, *this ); 1811 { 1812 auto guard = makeFuncGuard( [this]() { indexerScopeEnter(); }, [this]() { indexerScopeLeave(); } ); 1813 node->stmt = mutateStatement( node->stmt ); 1814 } 1815 MUTATE_END( Statement, node ); 1816 } 1817 1818 //-------------------------------------------------------------------------- 1783 1819 // ApplicationExpr 1784 1820 template< typename pass_type > -
src/Concurrency/Keywords.cc
rdd1cc02 r5a40e4e 93 93 ObjectDecl * addField( StructDecl * ); 94 94 void addRoutines( ObjectDecl *, FunctionDecl * ); 95 void addLockUnlockRoutines( StructDecl * ); 95 96 96 97 virtual bool is_target( StructDecl * decl ) = 0; … … 302 303 void postvisit( FunctionDecl * decl ); 303 304 void postvisit( StructDecl * decl ); 305 Statement * postmutate( MutexStmt * stmt ); 304 306 305 307 std::list<DeclarationWithType*> findMutexArgs( FunctionDecl*, bool & first ); … … 307 309 void addDtorStatements( FunctionDecl* func, CompoundStmt *, const std::list<DeclarationWithType * > &); 308 310 void addStatements( FunctionDecl* func, CompoundStmt *, const std::list<DeclarationWithType * > &); 311 void addStatements( CompoundStmt * body, const std::list<Expression * > & args ); 309 312 void addThreadDtorStatements( FunctionDecl* func, CompoundStmt * body, const std::list<DeclarationWithType * > & args ); 310 313 … … 312 315 PassVisitor< MutexKeyword > impl; 313 316 acceptAll( translationUnit, impl ); 317 mutateAll( translationUnit, impl ); 314 318 } 315 319 … … 319 323 StructDecl* dtor_guard_decl = nullptr; 320 324 StructDecl* thread_guard_decl = nullptr; 325 StructDecl* lock_guard_decl = nullptr; 321 326 322 327 static std::unique_ptr< Type > generic_func; … … 460 465 } 461 466 462 463 467 void ConcurrentSueKeyword::handle( StructDecl * decl ) { 464 468 if( ! decl->body ) return; … … 476 480 FunctionDecl * func = forwardDeclare( decl ); 477 481 ObjectDecl * field = addField( decl ); 482 483 // add get_.* routine 478 484 addRoutines( field, func ); 485 // add lock/unlock routines to monitors for use by mutex stmt 486 addLockUnlockRoutines( decl ); 479 487 } 480 488 … … 609 617 } 610 618 619 // This function adds the get_.* routine body for coroutines, monitors etc 620 // after their corresponding struct has been made 611 621 void ConcurrentSueKeyword::addRoutines( ObjectDecl * field, FunctionDecl * func ) { 612 622 CompoundStmt * statement = new CompoundStmt(); … … 631 641 632 642 declsToAddAfter.push_back( get_decl ); 643 } 644 645 // Generates lock/unlock routines for monitors to be used by mutex stmts 646 void ConcurrentSueKeyword::addLockUnlockRoutines( StructDecl * decl ) { 647 // this routine will be called for all ConcurrentSueKeyword children so only continue if we are a monitor 648 if ( !decl->is_monitor() ) return; 649 650 FunctionType * lock_fn_type = new FunctionType( noQualifiers, false ); 651 FunctionType * unlock_fn_type = new FunctionType( noQualifiers, false ); 652 653 // create this ptr parameter for both routines 654 ObjectDecl * this_decl = new ObjectDecl( 655 "this", 656 noStorageClasses, 657 LinkageSpec::Cforall, 658 nullptr, 659 new ReferenceType( 660 noQualifiers, 661 new StructInstType( 662 noQualifiers, 663 decl 664 ) 665 ), 666 nullptr 667 ); 668 669 lock_fn_type->get_parameters().push_back( this_decl->clone() ); 670 unlock_fn_type->get_parameters().push_back( this_decl->clone() ); 671 fixupGenerics(lock_fn_type, decl); 672 fixupGenerics(unlock_fn_type, decl); 673 674 delete this_decl; 675 676 677 ////////////////////////////////////////////////////////////////////// 678 // The following generates this lock routine for all monitors 679 /* 680 void lock (monitor_t & this) { 681 lock(get_monitor(this)); 682 } 683 */ 684 FunctionDecl * lock_decl = new FunctionDecl( 685 "lock", 686 Type::Static, 687 LinkageSpec::Cforall, 688 lock_fn_type, 689 nullptr, 690 { }, 691 Type::Inline 692 ); 693 694 UntypedExpr * get_monitor_lock = new UntypedExpr ( 695 new NameExpr( "get_monitor" ), 696 { new VariableExpr( lock_fn_type->get_parameters().front() ) } 697 ); 698 699 CompoundStmt * lock_statement = new CompoundStmt(); 700 lock_statement->push_back( 701 new ExprStmt( 702 new UntypedExpr ( 703 new NameExpr( "lock" ), 704 { 705 get_monitor_lock 706 } 707 ) 708 ) 709 ); 710 lock_decl->set_statements( lock_statement ); 711 712 ////////////////////////////////////////////////////////////////// 713 // The following generates this routine for all monitors 714 /* 715 void unlock (monitor_t & this) { 716 unlock(get_monitor(this)); 717 } 718 */ 719 FunctionDecl * unlock_decl = new FunctionDecl( 720 "unlock", 721 Type::Static, 722 LinkageSpec::Cforall, 723 unlock_fn_type, 724 nullptr, 725 { }, 726 Type::Inline 727 ); 728 729 CompoundStmt * unlock_statement = new CompoundStmt(); 730 731 UntypedExpr * get_monitor_unlock = new UntypedExpr ( 732 new NameExpr( "get_monitor" ), 733 { new VariableExpr( unlock_fn_type->get_parameters().front() ) } 734 ); 735 736 unlock_statement->push_back( 737 new ExprStmt( 738 new UntypedExpr( 739 new NameExpr( "unlock" ), 740 { 741 get_monitor_unlock 742 } 743 ) 744 ) 745 ); 746 unlock_decl->set_statements( unlock_statement ); 747 748 // pushes routines to declsToAddAfter to add at a later time 749 declsToAddAfter.push_back( lock_decl ); 750 declsToAddAfter.push_back( unlock_decl ); 633 751 } 634 752 … … 934 1052 assert( !thread_guard_decl ); 935 1053 thread_guard_decl = decl; 936 } 1054 } 1055 else if ( decl->name == "__mutex_stmt_lock_guard" && decl->body ) { 1056 assert( !lock_guard_decl ); 1057 lock_guard_decl = decl; 1058 } 1059 } 1060 1061 Statement * MutexKeyword::postmutate( MutexStmt * stmt ) { 1062 std::list<Statement *> stmtsForCtor; 1063 stmtsForCtor.push_back(stmt->stmt); 1064 CompoundStmt * body = new CompoundStmt( stmtsForCtor ); 1065 addStatements( body, stmt->mutexObjs); 1066 return body; 937 1067 } 938 1068 … … 1058 1188 )) 1059 1189 ); 1190 } 1191 1192 void MutexKeyword::addStatements( CompoundStmt * body, const std::list<Expression * > & args ) { 1193 ObjectDecl * monitors = new ObjectDecl( 1194 "__monitors", 1195 noStorageClasses, 1196 LinkageSpec::Cforall, 1197 nullptr, 1198 new ArrayType( 1199 noQualifiers, 1200 new PointerType( 1201 noQualifiers, 1202 new TypeofType( noQualifiers, args.front()->clone() ) 1203 ), 1204 new ConstantExpr( Constant::from_ulong( args.size() ) ), 1205 false, 1206 false 1207 ), 1208 new ListInit( 1209 map_range < std::list<Initializer*> > ( args, [](Expression * var ){ 1210 return new SingleInit( new AddressExpr( var ) ); 1211 }) 1212 ) 1213 ); 1214 1215 StructInstType * lock_guard_struct = new StructInstType( noQualifiers, lock_guard_decl ); 1216 TypeExpr * lock_type_expr = new TypeExpr( new TypeofType( noQualifiers, args.front()->clone() ) ); 1217 1218 lock_guard_struct->parameters.push_back( lock_type_expr ) ; 1219 1220 // in reverse order : 1221 // monitor_guard_t __guard = { __monitors, # }; 1222 body->push_front( 1223 new DeclStmt( new ObjectDecl( 1224 "__guard", 1225 noStorageClasses, 1226 LinkageSpec::Cforall, 1227 nullptr, 1228 lock_guard_struct, 1229 new ListInit( 1230 { 1231 new SingleInit( new VariableExpr( monitors ) ), 1232 new SingleInit( new ConstantExpr( Constant::from_ulong( args.size() ) ) ) 1233 }, 1234 noDesignators, 1235 true 1236 ) 1237 )) 1238 ); 1239 1240 //monitor$ * __monitors[] = { get_monitor(a), get_monitor(b) }; 1241 body->push_front( new DeclStmt( monitors) ); 1060 1242 } 1061 1243 -
src/MakeLibCfa.h
rdd1cc02 r5a40e4e 19 19 20 20 class Declaration; 21 namespace ast { 22 struct TranslationUnit; 23 } 21 24 22 25 namespace LibCfa { 23 26 void makeLibCfa( std::list< Declaration* > &prelude ); 27 void makeLibCfa( ast::TranslationUnit & translationUnit ); 24 28 } // namespace LibCfa 25 29 -
src/Makefile.am
rdd1cc02 r5a40e4e 23 23 CompilationState.h \ 24 24 MakeLibCfa.cc \ 25 MakeLibCfaNew.cpp \ 25 26 MakeLibCfa.h 26 27 -
src/Parser/ExpressionNode.cc
rdd1cc02 r5a40e4e 10 10 // Created On : Sat May 16 13:17:07 2015 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Thu Aug 20 14:01:46 202013 // Update Count : 107 612 // Last Modified On : Sat Aug 7 09:18:56 2021 13 // Update Count : 1077 14 14 // 15 15 … … 514 514 return expr; 515 515 } // build_varref 516 516 517 // TODO: get rid of this and OperKinds and reuse code from OperatorTable 517 518 static const char * OperName[] = { // must harmonize with OperKinds -
src/Parser/ParseNode.h
rdd1cc02 r5a40e4e 437 437 WaitForStmt * build_waitfor_timeout( ExpressionNode * timeout, StatementNode * stmt, ExpressionNode * when, StatementNode * else_stmt, ExpressionNode * else_when ); 438 438 Statement * build_with( ExpressionNode * exprs, StatementNode * stmt ); 439 Statement * build_mutex( ExpressionNode * exprs, StatementNode * stmt ); 439 440 440 441 //############################################################################## -
src/Parser/StatementNode.cc
rdd1cc02 r5a40e4e 374 374 } // build_directive 375 375 376 Statement * build_mutex( ExpressionNode * exprs, StatementNode * stmt ) { 377 std::list< Expression * > expList; 378 buildMoveList( exprs, expList ); 379 Statement * body = maybeMoveBuild<Statement>( stmt ); 380 return new MutexStmt( body, expList ); 381 } // build_mutex 382 376 383 // Local Variables: // 377 384 // tab-width: 4 // -
src/Parser/parser.yy
rdd1cc02 r5a40e4e 10 10 // Created On : Sat Sep 1 20:22:55 2001 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Tue Jul 20 22:03:04 202113 // Update Count : 503 112 // Last Modified On : Sun Aug 8 09:14:44 2021 13 // Update Count : 5038 14 14 // 15 15 … … 185 185 type = new ExpressionNode( new CastExpr( maybeMoveBuild<Expression>(type), new BasicType( Type::Qualifiers(), BasicType::SignedInt ) ) ); 186 186 } // if 187 // type = new ExpressionNode( build_func( new ExpressionNode( build_varref( new string( "__for_control_index_constraints__" ) ) ), type ) ); 187 188 return new ForCtrl( 188 189 distAttr( DeclarationNode::newTypeof( type, true ), DeclarationNode::newName( index )->addInitializer( new InitializerNode( start ) ) ), … … 1346 1347 mutex_statement: 1347 1348 MUTEX '(' argument_expression_list_opt ')' statement 1348 { SemanticError( yylloc, "Mutex statement is currently unimplemented." ); $$ = nullptr; }1349 { $$ = new StatementNode( build_mutex( $3, $5 ) ); } 1349 1350 ; 1350 1351 -
src/SynTree/Mutator.h
rdd1cc02 r5a40e4e 58 58 virtual Statement * mutate( DeclStmt * declStmt ) = 0; 59 59 virtual Statement * mutate( ImplicitCtorDtorStmt * impCtorDtorStmt ) = 0; 60 virtual Statement * mutate( MutexStmt * mutexStmt ) = 0; 60 61 61 62 virtual Expression * mutate( ApplicationExpr * applicationExpr ) = 0; -
src/SynTree/Statement.cc
rdd1cc02 r5a40e4e 565 565 } 566 566 567 MutexStmt::MutexStmt( Statement * stmt, std::list<Expression *> mutexObjs ) 568 : Statement(), stmt( stmt ), mutexObjs( mutexObjs ) { } 569 570 MutexStmt::MutexStmt( const MutexStmt & other ) : Statement( other ), stmt( maybeClone( other.stmt ) ) { 571 cloneAll( other.mutexObjs, mutexObjs ); 572 } 573 574 MutexStmt::~MutexStmt() { 575 deleteAll( mutexObjs ); 576 delete stmt; 577 } 578 579 void MutexStmt::print( std::ostream & os, Indenter indent ) const { 580 os << "Mutex Statement" << endl; 581 os << indent << "... with Expressions: " << endl; 582 for (auto * obj : mutexObjs) { 583 os << indent+1; 584 obj->print( os, indent+1); 585 os << endl; 586 } 587 os << indent << "... with Statement: " << endl << indent+1; 588 stmt->print( os, indent+1 ); 589 } 590 567 591 // Local Variables: // 568 592 // tab-width: 4 // -
src/SynTree/Statement.h
rdd1cc02 r5a40e4e 535 535 }; 536 536 537 class MutexStmt : public Statement { 538 public: 539 Statement * stmt; 540 std::list<Expression *> mutexObjs; // list of mutex objects to acquire 541 542 MutexStmt( Statement * stmt, std::list<Expression *> mutexObjs ); 543 MutexStmt( const MutexStmt & other ); 544 virtual ~MutexStmt(); 545 546 virtual MutexStmt * clone() const override { return new MutexStmt( *this ); } 547 virtual void accept( Visitor & v ) override { v.visit( this ); } 548 virtual void accept( Visitor & v ) const override { v.visit( this ); } 549 virtual Statement * acceptMutator( Mutator & m ) override { return m.mutate( this ); } 550 virtual void print( std::ostream & os, Indenter indent = {} ) const override; 551 }; 552 537 553 // Local Variables: // 538 554 // tab-width: 4 // -
src/SynTree/SynTree.h
rdd1cc02 r5a40e4e 62 62 class NullStmt; 63 63 class ImplicitCtorDtorStmt; 64 class MutexStmt; 64 65 65 66 class Expression; -
src/SynTree/Visitor.h
rdd1cc02 r5a40e4e 92 92 virtual void visit( ImplicitCtorDtorStmt * node ) { visit( const_cast<const ImplicitCtorDtorStmt *>(node) ); } 93 93 virtual void visit( const ImplicitCtorDtorStmt * impCtorDtorStmt ) = 0; 94 virtual void visit( MutexStmt * node ) { visit( const_cast<const MutexStmt *>(node) ); } 95 virtual void visit( const MutexStmt * mutexStmt ) = 0; 94 96 95 97 virtual void visit( ApplicationExpr * node ) { visit( const_cast<const ApplicationExpr *>(node) ); } -
src/Tuples/Tuples.h
rdd1cc02 r5a40e4e 9 9 // Author : Rodolfo G. Esteves 10 10 // Created On : Mon May 18 07:44:20 2015 11 // Last Modified By : Andrew Beach12 // Last Modified On : Tue Jun 18 09:36:00 201913 // Update Count : 1 811 // Last Modified By : Henry Xue 12 // Last Modified On : Mon Aug 23 15:36:09 2021 13 // Update Count : 19 14 14 // 15 15 … … 39 39 /// expands z.[a, b.[x, y], c] into [z.a, z.b.x, z.b.y, z.c], inserting UniqueExprs as appropriate 40 40 void expandMemberTuples( std::list< Declaration * > & translationUnit ); 41 void expandMemberTuples( ast::TranslationUnit & translationUnit ); 41 42 42 43 /// replaces tuple-related elements, such as TupleType, TupleExpr, TupleAssignExpr, etc. -
src/Tuples/module.mk
rdd1cc02 r5a40e4e 10 10 ## Author : Richard C. Bilson 11 11 ## Created On : Mon Jun 1 17:49:17 2015 12 ## Last Modified By : Peter A. Buhr13 ## Last Modified On : Mon Jun 1 17:54:33 201514 ## Update Count : 112 ## Last Modified By : Henry Xue 13 ## Last Modified On : Mon Aug 23 15:36:09 2021 14 ## Update Count : 2 15 15 ############################################################################### 16 16 … … 20 20 Tuples/TupleAssignment.cc \ 21 21 Tuples/TupleExpansion.cc \ 22 Tuples/TupleExpansionNew.cpp \ 22 23 Tuples/Tuples.cc \ 23 24 Tuples/Tuples.h -
src/main.cc
rdd1cc02 r5a40e4e 10 10 // Created On : Fri May 15 23:12:02 2015 11 11 // Last Modified By : Henry Xue 12 // Last Modified On : Tue Jul 20 04:27:35202113 // Update Count : 65 812 // Last Modified On : Mon Aug 23 15:42:08 2021 13 // Update Count : 650 14 14 // 15 15 … … 335 335 PASS( "Fix Names", CodeGen::fixNames( translationUnit ) ); 336 336 PASS( "Gen Init", InitTweak::genInit( translationUnit ) ); 337 PASS( "Expand Member Tuples" , Tuples::expandMemberTuples( translationUnit ) ); 337 338 338 if ( libcfap ) { 339 339 // generate the bodies of cfa library functions … … 365 365 } 366 366 auto transUnit = convert( move( translationUnit ) ); 367 368 PASS( "Expand Member Tuples" , Tuples::expandMemberTuples( transUnit ) ); 369 367 370 PASS( "Resolve", ResolvExpr::resolve( transUnit ) ); 368 371 if ( exprp ) { … … 376 379 translationUnit = convert( move( transUnit ) ); 377 380 } else { 381 PASS( "Expand Member Tuples" , Tuples::expandMemberTuples( translationUnit ) ); 382 378 383 PASS( "Resolve", ResolvExpr::resolve( translationUnit ) ); 379 384 if ( exprp ) {
Note:
See TracChangeset
for help on using the changeset viewer.