Changes in / [8e90fd6:fa59c40]
- Files:
-
- 1 added
- 2 deleted
- 35 edited
-
doc/LaTeXmacros/lstlang.sty (modified) (2 diffs)
-
doc/papers/OOPSLA17/generic_types.tex (modified) (1 diff)
-
doc/papers/concurrency/Paper.tex (modified) (1 diff)
-
doc/papers/general/Paper.tex (modified) (1 diff)
-
doc/papers/llheap/Paper.tex (modified) (1 diff)
-
doc/refrat/keywords.tex (modified) (2 diffs)
-
doc/refrat/refrat.tex (modified) (3 diffs)
-
doc/theses/aaron_moss_PhD/phd/cfa-macros.tex (modified) (1 diff)
-
doc/theses/andrew_beach_MMath/cfalab.sty (modified) (1 diff)
-
doc/theses/andrew_beach_MMath/features.tex (modified) (1 diff)
-
doc/theses/fangren_yu_MMath/intro.tex (modified) (1 diff)
-
doc/uC++toCFA/uC++toCFA.tex (modified) (13 diffs)
-
doc/user/user.tex (modified) (8 diffs)
-
libcfa/src/concurrency/monitor.cfa (modified) (3 diffs)
-
my_tests/floating.cfa (added)
-
src/AST/Expr.cpp (modified) (1 diff)
-
src/AST/Stmt.hpp (modified) (2 diffs)
-
src/CodeGen/CodeGenerator.cpp (modified) (2 diffs)
-
src/Parser/StatementNode.cpp (modified) (2 diffs)
-
src/Parser/lex.ll (modified) (2 diffs)
-
src/Parser/parser.yy (modified) (4 diffs)
-
tests/concurrency/actors/dynamic.cfa (modified) (1 diff)
-
tests/concurrency/actors/executor.cfa (modified) (1 diff)
-
tests/concurrency/actors/matrixMultiply.cfa (modified) (1 diff)
-
tests/concurrency/actors/static.cfa (modified) (1 diff)
-
tests/concurrency/channels/barrier.cfa (modified) (1 diff)
-
tests/concurrency/channels/churn.cfa (modified) (1 diff)
-
tests/concurrency/channels/contend.cfa (modified) (1 diff)
-
tests/concurrency/channels/daisy_chain.cfa (modified) (1 diff)
-
tests/concurrency/channels/hot_potato.cfa (modified) (1 diff)
-
tests/concurrency/channels/pub_sub.cfa (modified) (1 diff)
-
tests/concurrency/waitfor/.expect/lexical_priority.txt (deleted)
-
tests/concurrency/waitfor/lexical_priority.cfa (deleted)
-
tests/ctrl-flow/fallthrough.cfa (modified) (8 diffs)
-
tests/ctrl-flow/labelledExit.cfa (modified) (2 diffs)
-
tests/exceptions/try-ctrl-flow.cfa (modified) (3 diffs)
-
tests/quotedKeyword.cfa (modified) (2 diffs)
-
tests/switch.cfa (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
doc/LaTeXmacros/lstlang.sty
r8e90fd6 rfa59c40 8 8 %% Created On : Sat May 13 16:34:42 2017 9 9 %% Last Modified By : Peter A. Buhr 10 %% Last Modified On : Fri Jan 17 14:29:52 202511 %% Update Count : 4 610 %% Last Modified On : Wed Jul 24 07:40:11 2024 11 %% Update Count : 45 12 12 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 13 13 … … 117 117 __auto_type, basetypeof, _Bool, bool, catch, catchResume, choose, coerce, cofor, corun, countof, _Complex, __complex, __complex__, 118 118 __const, __const__, continue, coroutine, _Decimal32, _Decimal64, _Decimal128, disable, dtype, enable, exception, __extension__, 119 fallthrough, f inally, fixup, __float80, float80, __float128, float128, _Float16, _Float32, _Float32x, _Float64,119 fallthrough, fallthru, finally, fixup, __float80, float80, __float128, float128, _Float16, _Float32, _Float32x, _Float64, 120 120 _Float64x, _Float128, _Float128x, forall, fortran, ftype, generator, _Generic, _Imaginary, __imag, __imag__, inline, 121 121 __inline, __inline__, int128, __int128, __int128_t, __label__, monitor, mutex, _Noreturn, __builtin_offsetof, one_t, or, -
doc/papers/OOPSLA17/generic_types.tex
r8e90fd6 rfa59c40 66 66 morekeywords={_Alignas,_Alignof,__alignof,__alignof__,asm,__asm,__asm__,_At,_Atomic,__attribute,__attribute__,auto, 67 67 _Bool,catch,catchResume,choose,_Complex,__complex,__complex__,__const,__const__,disable,dtype,enable,__extension__, 68 fallthrough,f inally,forall,ftype,_Generic,_Imaginary,inline,__label__,lvalue,_Noreturn,one_t,otype,restrict,_Static_assert,68 fallthrough,fallthru,finally,forall,ftype,_Generic,_Imaginary,inline,__label__,lvalue,_Noreturn,one_t,otype,restrict,_Static_assert, 69 69 _Thread_local,throw,throwResume,trait,try,ttype,typeof,__typeof,__typeof__,zero_t}, 70 70 }% -
doc/papers/concurrency/Paper.tex
r8e90fd6 rfa59c40 162 162 _Alignas, _Alignof, __alignof, __alignof__, asm, __asm, __asm__, __attribute, __attribute__, 163 163 auto, _Bool, catch, catchResume, choose, _Complex, __complex, __complex__, __const, __const__, 164 coroutine, disable, dtype, enable, exception, __extension__, fallthrough, f inally,164 coroutine, disable, dtype, enable, exception, __extension__, fallthrough, fallthru, finally, 165 165 __float80, float80, __float128, float128, forall, ftype, generator, _Generic, _Imaginary, __imag, __imag__, 166 166 inline, __inline, __inline__, __int128, int128, __label__, monitor, mutex, _Noreturn, one_t, or, -
doc/papers/general/Paper.tex
r8e90fd6 rfa59c40 143 143 _Alignas, _Alignof, __alignof, __alignof__, asm, __asm, __asm__, __attribute, __attribute__, 144 144 auto, _Bool, catch, catchResume, choose, _Complex, __complex, __complex__, __const, __const__, 145 coroutine, disable, dtype, enable, exception, __extension__, fallthrough, f inally,145 coroutine, disable, dtype, enable, exception, __extension__, fallthrough, fallthru, finally, 146 146 __float80, float80, __float128, float128, forall, ftype, _Generic, _Imaginary, __imag, __imag__, 147 147 inline, __inline, __inline__, __int128, int128, __label__, monitor, mutex, _Noreturn, one_t, or, -
doc/papers/llheap/Paper.tex
r8e90fd6 rfa59c40 108 108 _Alignas, _Alignof, __alignof, __alignof__, and, asm, __asm, __asm__, _Atomic, __attribute, __attribute__, 109 109 __auto_type, basetypeof, _Bool, catch, catchResume, choose, coerce, _Complex, __complex, __complex__, __const, __const__, 110 coroutine, _Decimal32, _Decimal64, _Decimal128, disable, enable, exception, __extension__, fallthrough, f inally, fixup,110 coroutine, _Decimal32, _Decimal64, _Decimal128, disable, enable, exception, __extension__, fallthrough, fallthru, finally, fixup, 111 111 __float80, float80, __float128, float128, _Float16, _Float32, _Float32x, _Float64, _Float64x, _Float128, _Float128x, 112 112 forall, fortran, generator, _Generic, _Imaginary, __imag, __imag__, inline, __inline, __inline__, int128, __int128, __int128_t, -
doc/refrat/keywords.tex
r8e90fd6 rfa59c40 11 11 %% Created On : Sun Aug 6 08:17:27 2017 12 12 %% Last Modified By : Peter A. Buhr 13 %% Last Modified On : Fri Jan 17 14:45:13 202514 %% Update Count : 813 %% Last Modified On : Fri Apr 6 15:16:11 2018 14 %% Update Count : 7 15 15 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 16 16 \begin{tabular}{@{}llllll@{}} … … 28 28 ©exception© \\ 29 29 ©fallthrough© \\ 30 ©fallthru© \\ 30 31 \end{tabular} 31 32 & -
doc/refrat/refrat.tex
r8e90fd6 rfa59c40 11 11 %% Created On : Wed Apr 6 14:52:25 2016 12 12 %% Last Modified By : Peter A. Buhr 13 %% Last Modified On : Fri Jan 17 14:45:04 202514 %% Update Count : 11 113 %% Last Modified On : Mon Oct 5 09:02:53 2020 14 %% Update Count : 110 15 15 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 16 16 … … 3348 3348 3349 3349 The ©choose© statement is the same as the ©switch© statement except control transfers to the end of the ©choose© statement at a ©case© or ©default© labeled statement. 3350 The ©fallthr ough© statement is used to fall through to the next ©case© or ©default© labeled statement.3350 The ©fallthru© statement is used to fall through to the next ©case© or ©default© labeled statement. 3351 3351 The following have identical meaning: 3352 3352 \begin{flushleft} … … 3366 3366 case 1: ... ; // exit 3367 3367 case 2: ... ; // exit 3368 case 3: ... ; fallthr ough;3369 case 4: ... ; fallthr ough;3368 case 3: ... ; fallthru; 3369 case 4: ... ; fallthru; 3370 3370 default: ... ; // exit 3371 3371 } -
doc/theses/aaron_moss_PhD/phd/cfa-macros.tex
r8e90fd6 rfa59c40 27 27 _Alignas, _Alignof, __alignof, __alignof__, asm, __asm, __asm__, __attribute, __attribute__, 28 28 auto, bool, _Bool, catch, catchResume, choose, _Complex, __complex, __complex__, __const, __const__, 29 coroutine, disable, dtype, enable, exception, __extension__, fallthrough, f inally,29 coroutine, disable, dtype, enable, exception, __extension__, fallthrough, fallthru, finally, 30 30 __float80, float80, __float128, float128, forall, ftype, _Generic, _Imaginary, __imag, __imag__, 31 31 inline, __inline, __inline__, __int128, int128, __label__, monitor, mutex, _Noreturn, one_t, or, -
doc/theses/andrew_beach_MMath/cfalab.sty
r8e90fd6 rfa59c40 76 76 choose, _Complex, __complex, __complex__, __const, __const__, 77 77 coroutine, disable, dtype, enable, exception, __extension__, 78 fallthrough, f inally, __float80, float80, __float128,78 fallthrough, fallthru, finally, __float80, float80, __float128, 79 79 float128, forall, ftype, generator, _Generic, _Imaginary, __imag, 80 80 __imag__, inline, __inline, __inline__, __int128, int128, __label__, -
doc/theses/andrew_beach_MMath/features.tex
r8e90fd6 rfa59c40 822 822 control flow. 823 823 Because of this requirement, local control flow out of the finally block 824 is forbidden. The compiler precludes any @break@, @continue@, @fallthr ough@ or824 is forbidden. The compiler precludes any @break@, @continue@, @fallthru@ or 825 825 @return@ that causes control to leave the finally block. Other ways to leave 826 826 the finally block, such as a @longjmp@ or termination are much harder to check, -
doc/theses/fangren_yu_MMath/intro.tex
r8e90fd6 rfa59c40 518 518 519 519 \begin{enumerate} 520 \item The \CFA compiler performance and capability have been greatly improved through recent development. The compilation time of various \CFA library units and test programs have been reduced from the order of minutes down to 10-20 seconds, which made it possible to develop and test more complicated \CFA programs that utilize sophisticated type system features. The details of compiler optimization work are covered in a previous technical report.521 \item The thesis presents a systematic review of the new features that have been added to the \CFA language and its type system. Some of the more recent inclusions to \CFA such as tuples and generic structure types were not well tested when they were being developed, due to the limitation of compiler performance. Several issues coming from the interactions of various language features are identified and discussed in this thesis; some of them are now fully resolved, while others are given temporary fixes and need to be reworked in the future.522 \item Finally, this thesis provides constructive ideas of fixing the outstanding issues in \CFA language design and implementation, and gives a path for future improvements to \CFA language and compiler.520 \item 521 \item 522 \item 523 523 \end{enumerate} 524 524 -
doc/uC++toCFA/uC++toCFA.tex
r8e90fd6 rfa59c40 11 11 %% Created On : Wed Apr 6 14:53:29 2016 12 12 %% Last Modified By : Peter A. Buhr 13 %% Last Modified On : Fri Jan 17 07:39:09 202514 %% Update Count : 62 8413 %% Last Modified On : Fri Nov 15 09:55:34 2024 14 %% Update Count : 6249 15 15 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 16 16 … … 197 197 198 198 199 \section{Stream I/O} 200 201 \CFA output streams automatically separate values and insert a newline at the end of the print. 202 \begin{cquote} 203 \begin{tabular}{@{}l|l@{}} 204 \begin{uC++} 205 #include <@iostream@> 206 using namespace std; 207 int i; double d; char c; 208 cin >> i >> d >> c; 209 cout << i << ' ' << d << ' ' << c | endl; 210 \end{uC++} 211 & 212 \begin{cfa} 213 #include <@fstream.hfa@> 214 215 int i; double d; char c; 216 sin | i | d | c; 217 sout | i | d | c 218 \end{cfa} 219 \end{tabular} 220 \end{cquote} 221 222 199 223 \section{Looping} 200 224 … … 216 240 for ( i; 0 @-@~ 10 ) { ... } 217 241 \end{cfa} 218 \end{tabular} 219 \end{cquote} 220 221 \begin{cquote} 222 \begin{tabular}{@{}l|l@{}} 242 \\ 243 \hline 223 244 \begin{uC++} 224 245 int i = 0 … … 232 253 @else@ { ... } // i == 10 233 254 \end{cfa} 234 \end{tabular} 235 \end{cquote} 236 237 \begin{cquote} 238 \begin{tabular}{@{}l|l@{}} 255 \\ 256 \hline 239 257 \begin{uC++} 240 258 @L1:@ for ( ;; ) { … … 253 271 } 254 272 } 255 \end{cfa}256 \end{tabular}257 \end{cquote}258 259 260 \section{Stream I/O}261 262 \CFA output streams automatically separate values and insert a newline at the end of the print.263 \begin{cquote}264 \begin{tabular}{@{}l|l@{}}265 \begin{uC++}266 #include <@iostream@>267 using namespace std;268 int i; double d; char c;269 cin >> i >> d >> c;270 cout << i << ' ' << d << ' ' << c << endl;271 \end{uC++}272 &273 \begin{cfa}274 #include <@fstream.hfa@>275 276 int i; double d; char c;277 sin | i | d | c;278 sout | i | d | c279 \end{cfa}280 \end{tabular}281 \end{cquote}282 To disable/enable automatic newline at the end of printing, use @nlOff@/@nlOn@ and @nl@.283 \begin{cquote}284 \begin{tabular}{@{}l|l@{}}285 \begin{uC++}286 287 for ( int i = 0; i < 5; i += 1 ) cout << i << ' ';288 cout << @endl@;289 290 0 1 2 3 4291 \end{uC++}292 &293 \begin{cfa}294 sout | @nlOff@; // disable auto nl295 for ( i; 5 ) sout | i;296 sout | @nl@;297 sout | @nlOn@; // reenable auto nl298 0 1 2 3 4299 \end{cfa}300 \end{tabular}301 \end{cquote}302 Floating-point numbers without a fraction print with a decimal point, which can be disabled with @nodp@.303 \begin{cquote}304 \begin{tabular}{@{}l|l@{}}305 \begin{uC++}306 cout << 3.0 << ' ' << showpoint << setprecision(0) << 3.0 << endl;307 3 3.308 \end{uC++}309 &310 \begin{cfa}311 sout | @nodp( 3.0 )@ | 3.0;312 3 3.313 273 \end{cfa} 314 274 \end{tabular} … … 331 291 if ( ... ) @_Throw@ E( /* initialization */ ); 332 292 ... 333 } @_CatchResume@( E & /* reference */ ) { ... } 334 catch( E & ) { ... } 335 catch( ... /* catch any */ ) { ... } 336 _Finally { ... } 293 } @_CatchResume@( E & ) { ... // reference 294 } catch( E & ) { ... 295 } catch( ... ) { ... // catch any 296 } _Finally { ... 297 } 337 298 \end{uC++} 338 299 & … … 347 308 if ( ... ) @throw@ @ExceptionInst@( E, /* intialization */ ); 348 309 ... 349 } @catchResume@( E @*@ /* pointer */ ) { ... } 350 catch( E * ) { ... } 351 catch( exception_t @*@ /* catch any */ ) { ... } 352 finally { ... } 310 } @catchResume@( E * ) { ... // pointer 311 } catch( E * ) { ... 312 } catch( exception_t * ) { ... // catch any 313 } finally { ... 314 } 353 315 \end{cfa} 354 316 \end{tabular} … … 368 330 ... suspend(); ... 369 331 } 370 } @_CatchResume@( E & /* reference */ ) { ... } 371 catch( E & ) { ... } 332 } @_CatchResume@( E & ) { // reference 333 ... 334 } catch( E & ) { 335 ... 336 } 372 337 } 373 338 \end{uC++} … … 381 346 ... suspendPoll ... 382 347 disable_ehm(); 383 } @catchResume@( E * ) { ... } 384 catch( E & ) { ... } 348 } @catchResume@( E * ) { // pointer 349 ... 350 } catch( E & ) { 351 ... 352 } 385 353 } 386 354 \end{cfa} … … 588 556 589 557 558 \section{Thread} 559 560 \begin{cquote} 561 \begin{tabular}{@{}l|ll@{}} 562 \begin{uC++} 563 564 @_Task@ T { 565 // private task fields 566 void main() { 567 ... @_Resume E( ... ) _At partner@; 568 ... @uThisTask();@ ... 569 } 570 public: 571 }; 572 \end{uC++} 573 & 574 \begin{cfa} 575 #include <$thread$.hfa> 576 @thread@ T { 577 // private task fields 578 579 }; 580 void main( @T & t@ ) { 581 ... @resumeAt( partner, ExceptionInst( E, ... )@ ); 582 ... @active_thread();@ ... 583 } 584 \end{cfa} 585 \\ 586 \multicolumn{2}{@{}l@{}}{\lstinline{T t; // start thread in main routine}} 587 \end{tabular} 588 \end{cquote} 589 590 590 591 \section{\lstinline{COBEGIN}/\lstinline{COFOR}} 591 592 … … 601 602 BEGIN osacquire( cout ) << "C" << endl; END 602 603 BEGIN osacquire( cout ) << "D" << endl; END 604 BEGIN osacquire( cout ) << "E" << endl; END 603 605 @COEND@ 604 606 @COFOR@( i, 1, 10, … … 617 619 corun { mutex( sout ) sout | "C"; } 618 620 corun { mutex( sout ) sout | "D"; } 621 corun { mutex( sout ) sout | "E"; } 619 622 } 620 623 @cofor@( i; 10 ) { … … 700 703 } 701 704 \end{cfa} 702 \end{tabular}703 \end{cquote}704 705 706 \section{Thread}707 708 \begin{cquote}709 \begin{tabular}{@{}l|ll@{}}710 \begin{uC++}711 712 @_Task@ T {713 // private task fields714 void main() {715 ... @_Resume E( ... ) _At partner@;716 ... @uThisTask();@ ...717 }718 public:719 };720 \end{uC++}721 &722 \begin{cfa}723 #include <$thread$.hfa>724 @thread@ T {725 // private task fields726 727 };728 void main( @T & t@ ) {729 ... @resumeAt( partner, ExceptionInst( E, ... )@ );730 ... @active_thread();@ ...731 }732 \end{cfa}733 \\734 \multicolumn{2}{@{}l@{}}{\lstinline{T t; // start thread in main routine}}735 705 \end{tabular} 736 706 \end{cquote} -
doc/user/user.tex
r8e90fd6 rfa59c40 11 11 %% Created On : Wed Apr 6 14:53:29 2016 12 12 %% Last Modified By : Peter A. Buhr 13 %% Last Modified On : Fri Jan 17 14:20:39 202514 %% Update Count : 697 113 %% Last Modified On : Sat Dec 7 16:53:37 2024 14 %% Update Count : 6970 15 15 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 16 16 … … 893 893 still works. 894 894 Nevertheless, reversing the default action would have a non-trivial effect on case actions that compound, such as the above example of processing shell arguments. 895 Therefore, to preserve backwards compatibility, it is necessary to introduce a new kind of ©switch© statement, called \Indexc{choose}, with no implicit fall-through semantics and an explicit fall-through if the last statement of a case-clause ends with the new keyword \Indexc{fallthrough} , \eg:895 Therefore, to preserve backwards compatibility, it is necessary to introduce a new kind of ©switch© statement, called \Indexc{choose}, with no implicit fall-through semantics and an explicit fall-through if the last statement of a case-clause ends with the new keyword \Indexc{fallthrough}/\-\Indexc{fallthru}, \eg: 896 896 \begin{cfa} 897 897 ®choose® ( i ) { … … 901 901 case 5: 902 902 ... 903 ®fallthr ough®; §\C{// explicit fall through}§903 ®fallthru®; §\C{// explicit fall through}§ 904 904 case 7: 905 905 ... … … 911 911 Like the ©switch© statement, the ©choose© statement retains the fall-through semantics for a list of ©case© clauses. 912 912 An implicit ©break© is applied only at the end of the \emph{statements} following a ©case© clause. 913 An explicit ©fallthr ough© is retained because it is a C-idiom most C programmers expect, and its absence might discourage programmers from using the ©choose© statement.913 An explicit ©fallthru© is retained because it is a C-idiom most C programmers expect, and its absence might discourage programmers from using the ©choose© statement. 914 914 As well, allowing an explicit ©break© from the ©choose© is a carry over from the ©switch© statement, and expected by C programmers. 915 915 \item … … 950 950 case 3: 951 951 if ( ... ) { 952 ... ®fallthr ough;® // goto case 4952 ... ®fallthru;® // goto case 4 953 953 } else { 954 954 ... … … 985 985 for ( ... ) { 986 986 // multi-level transfer 987 ... ®fallthr oughcommon;®987 ... ®fallthru common;® 988 988 } 989 989 ... … … 8053 8053 \begin{cquote} 8054 8054 \Indexc{basetypeof}, \Indexc{choose}, \Indexc{coroutine}, \Indexc{disable}, 8055 \Indexc{enable}, \Indexc{exception}, \Indexc{fallthrough}, \Indexc{fallthr ough},8055 \Indexc{enable}, \Indexc{exception}, \Indexc{fallthrough}, \Indexc{fallthru}, 8056 8056 \Indexc{finally}, \Indexc{fixup}, \Indexc{forall},\Indexc{generator}, 8057 8057 \Indexc{int128}, \Indexc{monitor}, \Indexc{mutex}, \Indexc{one_t}, … … 8079 8079 \Indexc{exception} \\ 8080 8080 \Indexc{fallthrough} \\ 8081 \Indexc{fallthr ough}\\8081 \Indexc{fallthru} \\ 8082 8082 \end{tabular} 8083 8083 & -
libcfa/src/concurrency/monitor.cfa
r8e90fd6 rfa59c40 9 9 // Author : Thierry Delisle 10 10 // Created On : Thd Feb 23 12:27:26 2017 11 // Last Modified By : Kyoung Seo12 // Last Modified On : Thd Jan 16 12:59:00 202513 // Update Count : 7 311 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Wed Nov 27 12:13:14 2024 13 // Update Count : 72 14 14 // 15 15 … … 922 922 static inline [thread$ *, int] search_entry_queue( const __waitfor_mask_t & mask, monitor$ * monitors [], __lock_size_t count ) { 923 923 __queue_t(thread$) & entry_queue = monitors[0]->entry_queue; 924 925 #if 0 926 #if defined( __CFA_WITH_VERIFY__ ) 927 thread$ * last = 0p; 928 #endif 929 // For each thread in the entry-queue 930 for ( thread$ ** thrd_it = &entry_queue.head; (*thrd_it) != 1p; thrd_it = &get_next(**thrd_it) ) { 931 thread$ * curr = *thrd_it; 932 933 /* paranoid */ verifyf( !last || last->user_link.next == curr, "search not making progress, from %p (%p) to %p", 934 last, last->user_link.next, curr ); 935 /* paranoid */ verifyf( curr != last, "search not making progress, from %p to %p", last, curr ); 936 937 // For each acceptable check if it matches 938 int i = 0; 939 __acceptable_t * end = end(mask); 940 __acceptable_t * begin = begin(mask); 941 for ( __acceptable_t * it = begin; it != end; it++, i++ ) { 942 // Check for match 943 if ( *it == curr->monitors ) { 944 // If match, return it after removeing it from the entry queue 945 return [remove( entry_queue, thrd_it ), i]; 946 } 947 } 948 949 #if defined( __CFA_WITH_VERIFY__ ) 950 last = curr; 951 #endif 952 } 953 #else 924 954 // For each acceptable (respect lexical priority in waitfor statement) 925 int i = 0; 926 __acceptable_t * end = end(mask); 927 __acceptable_t * begin = begin(mask); 928 for ( __acceptable_t * it = begin; it != end; it++, i++ ) { 955 __acceptable_t * it = end(mask); it--; // end is passed the last node, so backup 956 for ( int i = mask.size - 1; i >= 0; i -= 1, it-- ) { 929 957 #if defined( __CFA_WITH_VERIFY__ ) 930 958 thread$ * last = 0p; … … 949 977 } // for 950 978 } // for 979 #endif 951 980 return [0, -1]; 952 981 } -
src/AST/Expr.cpp
r8e90fd6 rfa59c40 122 122 123 123 bool VariableExpr::get_lvalue() const { 124 // Special case for enumeration labels (more literals than variables):124 // It isn't always an lvalue, but it is never an rvalue. 125 125 if(dynamic_cast<const ast::EnumInstType *>(var->get_type())) return !var->isMember; 126 // The remaining uses are either actual variables (lvalues) or function127 // names which are a special value catagory that can be treated as128 // lvalues in the places we are worried about.129 126 return true; 130 127 } -
src/AST/Stmt.hpp
r8e90fd6 rfa59c40 9 9 // Author : Aaron B. Moss 10 10 // Created On : Wed May 8 13:00:00 2019 11 // Last Modified By : Peter A. Buhr12 // Last Modified On : Fri Jan 17 14:18:56 202513 // Update Count : 3 811 // Last Modified By : Andrew Beach 12 // Last Modified On : Wed Apr 5 10:34:00 2023 13 // Update Count : 37 14 14 // 15 15 … … 280 280 }; 281 281 282 // Branch control flow statement: goto ... or break or continue or fallthr ough282 // Branch control flow statement: goto ... or break or continue or fallthru 283 283 class BranchStmt final : public Stmt { 284 284 public: -
src/CodeGen/CodeGenerator.cpp
r8e90fd6 rfa59c40 9 9 // Author : Andrew Beach 10 10 // Created On : Tue Oct 17 15:54:00 2023 11 // Last Modified By : Peter A. Buhr12 // Last Modified On : Fri Jan 17 14:19:22 202513 // Update Count : 111 // Last Modified By : Andrew Beach 12 // Last Modified On : Wed Oct 25 18:28:00 2023 13 // Update Count : 0 14 14 // 15 15 … … 1092 1092 case ast::BranchStmt::FallThrough: 1093 1093 case ast::BranchStmt::FallThroughDefault: 1094 assertf( !options.genC, "fallthr oughshould not reach code generation." );1095 output << "fallthr ough";1094 assertf( !options.genC, "fallthru should not reach code generation." ); 1095 output << "fallthru"; 1096 1096 break; 1097 1097 default: 1098 1098 assertf( false, "Bad BranchStmt value." ); 1099 1099 } 1100 // Print branch target for labelled break/continue/fallthr oughin debug mode.1100 // Print branch target for labelled break/continue/fallthru in debug mode. 1101 1101 if ( !options.genC && stmt->kind != ast::BranchStmt::Goto ) { 1102 1102 if ( !stmt->target.empty() ) { -
src/Parser/StatementNode.cpp
r8e90fd6 rfa59c40 10 10 // Author : Rodolfo G. Esteves 11 11 // Created On : Sat May 16 14:59:41 2015 12 // Last Modified By : Kyoung Seo13 // Last Modified On : Thd Jan 16 13:05:00 202514 // Update Count : 43 312 // Last Modified By : Peter A. Buhr 13 // Last Modified On : Mon Sep 23 22:50:35 2024 14 // Update Count : 432 15 15 // 16 16 … … 351 351 delete targetExpr; 352 352 353 existing->clauses.insert( existing->clauses. end(), clause );353 existing->clauses.insert( existing->clauses.begin(), clause ); 354 354 355 355 return existing; -
src/Parser/lex.ll
r8e90fd6 rfa59c40 10 10 * Created On : Sat Sep 22 08:58:10 2001 11 11 * Last Modified By : Peter A. Buhr 12 * Last Modified On : Fri Jan 17 14:36:16 202513 * Update Count : 87 812 * Last Modified On : Sun Dec 15 17:23:46 2024 13 * Update Count : 877 14 14 */ 15 15 … … 273 273 extern { KEYWORD_RETURN(EXTERN); } 274 274 fallthrough { KEYWORD_RETURN(FALLTHROUGH); } // CFA 275 fallthru { KEYWORD_RETURN(FALLTHRU); } // CFA 275 276 finally { QKEYWORD_RETURN(FINALLY); } // CFA 276 277 fixup { QKEYWORD_RETURN(FIXUP); } // CFA -
src/Parser/parser.yy
r8e90fd6 rfa59c40 10 10 // Created On : Sat Sep 1 20:22:55 2001 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Fri Jan 17 14:35:08 202513 // Update Count : 693 512 // Last Modified On : Sun Dec 15 21:30:38 2024 13 // Update Count : 6933 14 14 // 15 15 … … 377 377 %token ATTRIBUTE EXTENSION // GCC 378 378 %token IF ELSE SWITCH CASE DEFAULT DO WHILE FOR BREAK CONTINUE GOTO RETURN 379 %token CHOOSE FALLTHR OUGH WITH WHEN WAITFOR WAITUNTIL// CFA379 %token CHOOSE FALLTHRU FALLTHROUGH WITH WHEN WAITFOR WAITUNTIL // CFA 380 380 %token CORUN COFOR 381 381 %token DISABLE ENABLE TRY THROW THROWRESUME AT // CFA … … 1680 1680 // whereas normal operator precedence yields goto (*i)+3; 1681 1681 { $$ = new StatementNode( build_computedgoto( $3 ) ); } 1682 // A semantic check is required to ensure fallthr oughappears only in the body of a choose statement.1683 | FALLTHROUGH ';'// CFA1682 // A semantic check is required to ensure fallthru appears only in the body of a choose statement. 1683 | fall_through_name ';' // CFA 1684 1684 { $$ = new StatementNode( build_branch( yylloc, ast::BranchStmt::FallThrough ) ); } 1685 | FALLTHROUGH identifier_or_type_name ';'// CFA1685 | fall_through_name identifier_or_type_name ';' // CFA 1686 1686 { $$ = new StatementNode( build_branch( yylloc, $2, ast::BranchStmt::FallThrough ) ); } 1687 | FALLTHROUGH DEFAULT ';'// CFA1687 | fall_through_name DEFAULT ';' // CFA 1688 1688 { $$ = new StatementNode( build_branch( yylloc, ast::BranchStmt::FallThroughDefault ) ); } 1689 1689 | CONTINUE ';' … … 1723 1723 | THROWRESUME assignment_expression_opt AT assignment_expression ';' // handles reresume 1724 1724 { $$ = new StatementNode( build_resume_at( $2, $4 ) ); } 1725 ; 1726 1727 fall_through_name: // CFA 1728 FALLTHRU 1729 | FALLTHROUGH 1725 1730 ; 1726 1731 -
tests/concurrency/actors/dynamic.cfa
r8e90fd6 rfa59c40 37 37 if ( strcmp( argv[1], "d" ) != 0 ) { // default ? 38 38 Times = ato( argv[1] ); 39 if ( Times < 1 ) fallthr oughdefault;39 if ( Times < 1 ) fallthru default; 40 40 } // if 41 41 case 1: // use defaults -
tests/concurrency/actors/executor.cfa
r8e90fd6 rfa59c40 41 41 if ( strcmp( argv[6], "d" ) != 0 ) { // default ? 42 42 BufSize = ato( argv[6] ); 43 if ( BufSize < 0 ) fallthr oughdefault;43 if ( BufSize < 0 ) fallthru default; 44 44 } // if 45 45 case 6: 46 46 if ( strcmp( argv[5], "d" ) != 0 ) { // default ? 47 47 Batch = ato( argv[5] ); 48 if ( Batch < 1 ) fallthr oughdefault;48 if ( Batch < 1 ) fallthru default; 49 49 } // if 50 50 case 5: 51 51 if ( strcmp( argv[4], "d" ) != 0 ) { // default ? 52 52 Processors = ato( argv[4] ); 53 if ( Processors < 1 ) fallthr oughdefault;53 if ( Processors < 1 ) fallthru default; 54 54 } // if 55 55 case 4: 56 56 if ( strcmp( argv[3], "d" ) != 0 ) { // default ? 57 57 Rounds = ato( argv[3] ); 58 if ( Rounds < 1 ) fallthr oughdefault;58 if ( Rounds < 1 ) fallthru default; 59 59 } // if 60 60 case 3: 61 61 if ( strcmp( argv[2], "d" ) != 0 ) { // default ? 62 62 Set = ato( argv[2] ); 63 if ( Set < 1 ) fallthr oughdefault;63 if ( Set < 1 ) fallthru default; 64 64 } // if 65 65 case 2: 66 66 if ( strcmp( argv[1], "d" ) != 0 ) { // default ? 67 67 Actors = ato( argv[1] ); 68 if ( Actors < 1 || Actors <= Set || Actors % Set != 0 ) fallthr oughdefault;68 if ( Actors < 1 || Actors <= Set || Actors % Set != 0 ) fallthru default; 69 69 } // if 70 70 case 1: // use defaults -
tests/concurrency/actors/matrixMultiply.cfa
r8e90fd6 rfa59c40 39 39 if ( strcmp( argv[4], "d" ) != 0 ) { // default ? 40 40 Processors = ato( argv[4] ); 41 if ( Processors < 1 ) fallthr oughdefault;41 if ( Processors < 1 ) fallthru default; 42 42 } // if 43 43 case 4: 44 44 if ( strcmp( argv[3], "d" ) != 0 ) { // default ? 45 45 xr = ato( argv[3] ); 46 if ( xr < 1 ) fallthr oughdefault;46 if ( xr < 1 ) fallthru default; 47 47 } // if 48 48 case 3: 49 49 if ( strcmp( argv[2], "d" ) != 0 ) { // default ? 50 50 xc = ato( argv[2] ); 51 if ( xc < 1 ) fallthr oughdefault;51 if ( xc < 1 ) fallthru default; 52 52 } // if 53 53 case 2: 54 54 if ( strcmp( argv[1], "d" ) != 0 ) { // default ? 55 55 yc = ato( argv[1] ); 56 if ( yc < 1 ) fallthr oughdefault;56 if ( yc < 1 ) fallthru default; 57 57 } // if 58 58 case 1: // use defaults -
tests/concurrency/actors/static.cfa
r8e90fd6 rfa59c40 34 34 if ( strcmp( argv[1], "d" ) != 0 ) { // default ? 35 35 Times = ato( argv[1] ); 36 if ( Times < 1 ) fallthr oughdefault;36 if ( Times < 1 ) fallthru default; 37 37 } // if 38 38 case 1: // use defaults -
tests/concurrency/channels/barrier.cfa
r8e90fd6 rfa59c40 66 66 if ( strcmp( argv[2], "d" ) != 0 ) { // default ? 67 67 BarrierSize = ato( argv[2] ); 68 if ( Processors < 1 ) fallthr oughdefault;68 if ( Processors < 1 ) fallthru default; 69 69 } // if 70 70 case 2: 71 71 if ( strcmp( argv[1], "d" ) != 0 ) { // default ? 72 72 Processors = ato( argv[1] ); 73 if ( Processors < 1 ) fallthr oughdefault;73 if ( Processors < 1 ) fallthru default; 74 74 } // if 75 75 case 1: // use defaults -
tests/concurrency/channels/churn.cfa
r8e90fd6 rfa59c40 91 91 if ( strcmp( argv[3], "d" ) != 0 ) { // default ? 92 92 ChannelSize = ato( argv[3] ); 93 if ( ChannelSize < 1 ) fallthr oughdefault;93 if ( ChannelSize < 1 ) fallthru default; 94 94 } // if 95 95 case 3: 96 96 if ( strcmp( argv[2], "d" ) != 0 ) { // default ? 97 97 Channels = ato( argv[2] ); 98 if ( Channels < 1 ) fallthr oughdefault;98 if ( Channels < 1 ) fallthru default; 99 99 } // if 100 100 case 2: 101 101 if ( strcmp( argv[1], "d" ) != 0 ) { // default ? 102 102 Processors = ato( argv[1] ); 103 if ( Processors < 1 ) fallthr oughdefault;103 if ( Processors < 1 ) fallthru default; 104 104 } // if 105 105 case 1: // use defaults -
tests/concurrency/channels/contend.cfa
r8e90fd6 rfa59c40 128 128 if ( strcmp( argv[2], "d" ) != 0 ) { // default ? 129 129 ChannelSize = ato( argv[2] ); 130 if ( ChannelSize < 1 ) fallthr oughdefault;130 if ( ChannelSize < 1 ) fallthru default; 131 131 } // if 132 132 case 2: 133 133 if ( strcmp( argv[1], "d" ) != 0 ) { // default ? 134 134 Processors = ato( argv[1] ); 135 if ( Processors < 1 ) fallthr oughdefault;135 if ( Processors < 1 ) fallthru default; 136 136 } // if 137 137 case 1: // use defaults -
tests/concurrency/channels/daisy_chain.cfa
r8e90fd6 rfa59c40 38 38 if ( strcmp( argv[2], "d" ) != 0 ) { // default ? 39 39 Tasks = ato( argv[2] ); 40 if ( Tasks < 1 ) fallthr oughdefault;40 if ( Tasks < 1 ) fallthru default; 41 41 } // if 42 42 case 2: 43 43 if ( strcmp( argv[1], "d" ) != 0 ) { // default ? 44 44 Processors = ato( argv[1] ); 45 if ( Processors < 1 ) fallthr oughdefault;45 if ( Processors < 1 ) fallthru default; 46 46 } // if 47 47 case 1: // use defaults -
tests/concurrency/channels/hot_potato.cfa
r8e90fd6 rfa59c40 43 43 if ( strcmp( argv[2], "d" ) != 0 ) { // default ? 44 44 Tasks = ato( argv[2] ); 45 if ( Tasks < 1 ) fallthr oughdefault;45 if ( Tasks < 1 ) fallthru default; 46 46 } // if 47 47 case 2: 48 48 if ( strcmp( argv[1], "d" ) != 0 ) { // default ? 49 49 Processors = ato( argv[1] ); 50 if ( Processors < 1 ) fallthr oughdefault;50 if ( Processors < 1 ) fallthru default; 51 51 } // if 52 52 case 1: // use defaults -
tests/concurrency/channels/pub_sub.cfa
r8e90fd6 rfa59c40 88 88 if ( strcmp( argv[2], "d" ) != 0 ) { // default ? 89 89 Tasks = ato( argv[2] ); 90 if ( Tasks < 1 ) fallthr oughdefault;90 if ( Tasks < 1 ) fallthru default; 91 91 } // if 92 92 case 2: 93 93 if ( strcmp( argv[1], "d" ) != 0 ) { // default ? 94 94 Processors = ato( argv[1] ); 95 if ( Processors < 1 ) fallthr oughdefault;95 if ( Processors < 1 ) fallthru default; 96 96 } // if 97 97 case 1: // use defaults -
tests/ctrl-flow/fallthrough.cfa
r8e90fd6 rfa59c40 10 10 // Created On : Wed Mar 14 10:06:25 2018 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Fri Jan 17 14:09:49 202513 // Update Count : 2 312 // Last Modified On : Mon Dec 24 11:24:35 2018 13 // Update Count : 22 14 14 // 15 15 … … 20 20 case 1: 21 21 sout | "case 1"; 22 fallthr ough;22 fallthru; 23 23 case 2: 24 24 sout | "case 2"; 25 fallthr ough;26 sout | "did not fallthr ough";27 if ( 7 ) fallthr oughcommon2;28 fallthr oughcommon1;25 fallthru; 26 sout | "did not fallthru"; 27 if ( 7 ) fallthru common2; 28 fallthru common1; 29 29 case 3: 30 30 sout | "case 3"; 31 fallthr oughdefault;32 fallthr oughcommon1;31 fallthru default; 32 fallthru common1; 33 33 common1: 34 34 sout | "common1"; … … 36 36 case 4: 37 37 sout | "case 4"; 38 fallthr oughcommon2;38 fallthru common2; 39 39 case 5: 40 40 sout | "case 5"; 41 fallthr oughcommon2;42 fallthr oughdefault;41 fallthru common2; 42 fallthru default; 43 43 case 6: 44 44 sout | "case 6"; 45 fallthr oughcommon2;45 fallthru common2; 46 46 common2: 47 47 sout | "common2"; … … 49 49 default: 50 50 sout | "default"; 51 fallthr ough;51 fallthru; 52 52 } // choose 53 53 … … 62 62 for ( int i = 0; i < 4; i += 1 ) { 63 63 sout | i; 64 if ( i == 2 ) fallthr oughcommon;64 if ( i == 2 ) fallthru common; 65 65 } // for 66 66 } // switch … … 73 73 } else { 74 74 sout | "check"; 75 fallthr oughcommon;75 fallthru common; 76 76 } // if 77 77 } // if 78 78 common: 79 79 sout | "common"; 80 fallthr ough;80 fallthru; 81 81 break; 82 82 default: 83 83 sout | "default"; 84 fallthr ough;84 fallthru; 85 85 } // switch 86 86 87 87 #if ERR1 88 88 // ERROR: fallthrough must be enclosed in switch or choose 89 fallthr ough;89 fallthru; 90 90 // ERROR: fallthrough must be enclosed in switch or choose 91 fallthr oughcommon4;91 fallthru common4; 92 92 // ERROR: fallthrough must be enclosed in switch or choose 93 fallthr oughdefault;93 fallthru default; 94 94 choose ( 3 ) { 95 95 case 2: … … 98 98 case 1: 99 99 // ERROR: default is later, but in a different switch 100 fallthr oughdefault;100 fallthru default; 101 101 // ERROR: common3 is later, but not at the same level as a case clause 102 fallthr oughcommon3;102 fallthru common3; 103 103 } 104 104 common3: ; … … 108 108 common4: 109 109 // ERROR: attempt to jump up with fallthrough 110 if ( 7 ) fallthr oughcommon4;110 if ( 7 ) fallthru common4; 111 111 // ERROR: attempt to jump up with fallthrough 112 fallthr oughdefault;112 fallthru default; 113 113 } // choose 114 114 #endif -
tests/ctrl-flow/labelledExit.cfa
r8e90fd6 rfa59c40 10 10 // Created On : Wed Aug 10 07:29:39 2016 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Fri Jan 17 14:18:15 202513 // Update Count : 1 412 // Last Modified On : Sat Jun 5 10:07:34 2021 13 // Update Count : 13 14 14 // 15 15 … … 131 131 break Choose; 132 132 } 133 fallthr ough;133 fallthru; 134 134 case 2: 135 135 i += 1; -
tests/exceptions/try-ctrl-flow.cfa
r8e90fd6 rfa59c40 81 81 } 82 82 83 void choose_fallthr ough_in_finally() {83 void choose_fallthru_in_finally() { 84 84 choose (1) { 85 85 case 1: 86 86 try {} finally { 87 fallthr ough;87 fallthru; 88 88 } 89 89 default: … … 105 105 } 106 106 107 void labelled_choose_fallthr ough_in_finally() {107 void labelled_choose_fallthru_in_finally() { 108 108 mainBlock: choose (1) { 109 109 case 1: 110 110 try {} finally { 111 fallthr oughmainBlock;111 fallthru mainBlock; 112 112 } 113 113 case 2: … … 118 118 } 119 119 120 void choose_fallthr ough_default_in_finally() {120 void choose_fallthru_default_in_finally() { 121 121 choose (1) { 122 122 case 1: 123 123 try {} finally { 124 fallthr oughdefault;124 fallthru default; 125 125 } 126 126 default: -
tests/quotedKeyword.cfa
r8e90fd6 rfa59c40 10 10 // Created On : Wed May 27 17:56:53 2015 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Fri Jan 17 14:10:32 202513 // Update Count : 2 712 // Last Modified On : Thu Feb 23 20:31:05 2023 13 // Update Count : 26 14 14 // 15 15 … … 29 29 ``__attribute__, ``auto, ``_Bool, ``break, ``case, ``catch, ``catchResume, ``char, ``choose, ``_Complex, ``__complex, 30 30 ``__complex__, ``const, ``__const, ``__const__, ``continue, ``default, ``disable, ``do, ``double, ``dtype, ``else, 31 ``enable, ``enum, ``__extension__, ``extern, ``fallthr ough, ``finally, ``float, ``__float128, ``for, ``forall, ``fortran,31 ``enable, ``enum, ``__extension__, ``extern, ``fallthru, ``finally, ``float, ``__float128, ``for, ``forall, ``fortran, 32 32 ``ftype, ``_Generic, ``goto, ``if, ``_Imaginary, ``__imag, ``__imag__, ``inline, ``__inline, ``__inline__, ``int, 33 33 ``__int128, ``__label__, ``long, ``lvalue, ``_Noreturn, ``__builtin_offsetof, ``otype, ``register, ``restrict, -
tests/switch.cfa
r8e90fd6 rfa59c40 10 10 // Created On : Tue Jul 12 06:50:22 2016 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Fri Jan 17 14:10:12 202513 // Update Count : 4 512 // Last Modified On : Sat Jun 5 10:08:20 2021 13 // Update Count : 44 14 14 // 15 15 … … 96 96 case 8~10: 97 97 f( 3 ); 98 fallthr ough;98 fallthru; 99 99 case 'd': 100 100 j = 5;
Note:
See TracChangeset
for help on using the changeset viewer.