Changes in src/Concurrency/Keywords.cpp [ca9d65e:83fd57d]
- File:
-
- 1 edited
-
src/Concurrency/Keywords.cpp (modified) (10 diffs)
Legend:
- Unmodified
- Added
- Removed
-
src/Concurrency/Keywords.cpp
rca9d65e r83fd57d 9 9 // Author : Andrew Beach 10 10 // Created On : Tue Nov 16 9:53:00 2021 11 // Last Modified By : Peter A. Buhr12 // Last Modified On : Thu Dec 14 18:02:25 202313 // Update Count : 611 // Last Modified By : Andrew Beach 12 // Last Modified On : Fri Mar 11 10:40:00 2022 13 // Update Count : 2 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> ." );849 SemanticError( location, "suspend keyword applied to coroutines requires coroutines to be in scope, add #include <coroutine.hfa>\n" ); 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 " );920 SemanticError( decl, "destructors for structures declared as \"monitor\" must use mutex parameters\n" ); 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 " );928 SemanticError( decl, "constructors cannot have mutex parameters\n" ); 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 " );933 SemanticError( decl, "destructors can only have 1 mutex argument\n" ); 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> ." );947 SemanticError( decl, "mutex keyword requires monitors to be in scope, add #include <monitor.hfa>\n" ); 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> ." );954 SemanticError( decl, "thread destructor requires threads to be in scope, add #include <thread.hfa>\n" ); 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> ." );989 SemanticError( stmt->location, "mutex stmt requires a header, add #include <mutex_stmt.hfa>\n" ); 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.