Changeset ca9d65e for src/Concurrency
- Timestamp:
- Dec 14, 2023, 9:05:55 PM (12 months ago)
- Branches:
- master
- Children:
- 19a2890
- Parents:
- 21ad568
- Location:
- src/Concurrency
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
src/Concurrency/Corun.cpp
r21ad568 rca9d65e 9 9 // Author : Colby Parsons 10 10 // Created On : Monday October 9 15:16:42 2023 11 // Last Modified By : Colby Parsons12 // Last Modified On : Monday October 9 15:16:42202313 // Update Count : 011 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Thu Dec 14 17:32:17 2023 13 // Update Count : 1 14 14 // 15 15 … … 57 57 Stmt * postvisit( const CoforStmt * stmt ) { 58 58 if ( !runnerBlockDecl || !coforRunnerDecl ) 59 SemanticError( stmt->location, "To use cofor statements add #include <cofor.hfa> \n" );59 SemanticError( stmt->location, "To use cofor statements add #include <cofor.hfa>" ); 60 60 61 61 if ( stmt->inits.size() != 1 ) 62 SemanticError( stmt->location, "Cofor statements must have a single initializer in the loop control \n" );62 SemanticError( stmt->location, "Cofor statements must have a single initializer in the loop control" ); 63 63 64 64 if ( !stmt->body ) … … 77 77 const DeclStmt * declStmtPtr = dynamic_cast<const DeclStmt *>(stmt->inits.at(0).get()); 78 78 if ( ! declStmtPtr ) 79 SemanticError( stmt->location, "Cofor statement initializer is somehow not a decl statement? \n" );79 SemanticError( stmt->location, "Cofor statement initializer is somehow not a decl statement?" ); 80 80 81 81 const Decl * declPtr = dynamic_cast<const Decl *>(declStmtPtr->decl.get()); 82 82 if ( ! declPtr ) 83 SemanticError( stmt->location, "Cofor statement initializer is somehow not a decl? \n" );83 SemanticError( stmt->location, "Cofor statement initializer is somehow not a decl?" ); 84 84 85 85 Type * initType = new TypeofType( new NameExpr( loc, declPtr->name ) ); … … 246 246 Stmt * postvisit( const CorunStmt * stmt ) { 247 247 if ( !runnerBlockDecl || !coforRunnerDecl ) 248 SemanticError( stmt->location, "To use corun statements add #include <cofor.hfa> \n" );248 SemanticError( stmt->location, "To use corun statements add #include <cofor.hfa>" ); 249 249 250 250 if ( !stmt->stmt ) -
src/Concurrency/Keywords.cpp
r21ad568 rca9d65e 9 9 // Author : Andrew Beach 10 10 // Created On : Tue Nov 16 9:53:00 2021 11 // Last Modified By : Andrew Beach12 // Last Modified On : Fri Mar 11 10:40:00 202213 // Update Count : 211 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Thu Dec 14 18:02:25 2023 13 // Update Count : 6 14 14 // 15 15 … … 682 682 683 683 if ( 0 != decl->returns.size() ) { 684 SemanticError( decl->location, "Generator main must return void " );684 SemanticError( decl->location, "Generator main must return void." ); 685 685 } 686 686 … … 789 789 case ast::SuspendStmt::Generator: 790 790 // Generator suspends must be directly in a generator. 791 if ( !in_generator ) SemanticError( stmt->location, " 'suspend generator'must be used inside main of generator type." );791 if ( !in_generator ) SemanticError( stmt->location, "\"suspend generator\" must be used inside main of generator type." ); 792 792 return make_generator_suspend( stmt ); 793 793 } … … 847 847 848 848 if ( !decl_suspend ) { 849 SemanticError( location, "suspend keyword applied to coroutines requires coroutines to be in scope, add #include <coroutine.hfa> \n" );849 SemanticError( location, "suspend keyword applied to coroutines requires coroutines to be in scope, add #include <coroutine.hfa>." ); 850 850 } 851 851 if ( stmt->then ) { … … 918 918 // If it is a monitor, then it is a monitor. 919 919 if( baseStruct->base->is_monitor() || baseStruct->base->is_thread() ) { 920 SemanticError( decl, "destructors for structures declared as \"monitor\" must use mutex parameters \n" );920 SemanticError( decl, "destructors for structures declared as \"monitor\" must use mutex parameters " ); 921 921 } 922 922 } … … 926 926 // Monitors can't be constructed with mutual exclusion. 927 927 if ( CodeGen::isConstructor( decl->name ) && is_first_argument_mutex ) { 928 SemanticError( decl, "constructors cannot have mutex parameters \n" );928 SemanticError( decl, "constructors cannot have mutex parameters " ); 929 929 } 930 930 931 931 // It makes no sense to have multiple mutex parameters for the destructor. 932 932 if ( isDtor && mutexArgs.size() != 1 ) { 933 SemanticError( decl, "destructors can only have 1 mutex argument \n" );933 SemanticError( decl, "destructors can only have 1 mutex argument " ); 934 934 } 935 935 … … 945 945 // Check to if the required headers have been seen. 946 946 if ( !monitor_decl || !guard_decl || !dtor_guard_decl ) { 947 SemanticError( decl, "mutex keyword requires monitors to be in scope, add #include <monitor.hfa> \n" );947 SemanticError( decl, "mutex keyword requires monitors to be in scope, add #include <monitor.hfa>." ); 948 948 } 949 949 … … 952 952 if ( isDtor && isThread( mutexArgs.front() ) ) { 953 953 if ( !thread_guard_decl ) { 954 SemanticError( decl, "thread destructor requires threads to be in scope, add #include <thread.hfa> \n" );954 SemanticError( decl, "thread destructor requires threads to be in scope, add #include <thread.hfa>." ); 955 955 } 956 956 newBody = addThreadDtorStatements( decl, body, mutexArgs ); … … 987 987 const ast::Stmt * MutexKeyword::postvisit( const ast::MutexStmt * stmt ) { 988 988 if ( !lock_guard_decl ) { 989 SemanticError( stmt->location, "mutex stmt requires a header, add #include <mutex_stmt.hfa> \n" );989 SemanticError( stmt->location, "mutex stmt requires a header, add #include <mutex_stmt.hfa>." ); 990 990 } 991 991 ast::CompoundStmt * body = … … 1547 1547 if ( !type->base->is_thread() ) return decl; 1548 1548 if ( !thread_decl || !thread_ctor_seen ) { 1549 SemanticError( type->base->location, "thread keyword requires threads to be in scope, add #include <thread.hfa> " );1549 SemanticError( type->base->location, "thread keyword requires threads to be in scope, add #include <thread.hfa>." ); 1550 1550 } 1551 1551 const ast::CompoundStmt * stmt = decl->stmts;
Note: See TracChangeset
for help on using the changeset viewer.