Changeset 8e90fd6


Ignore:
Timestamp:
Jan 18, 2025, 3:46:06 PM (8 months ago)
Author:
Peter A. Buhr <pabuhr@…>
Branches:
master
Children:
d0b6712
Parents:
fa59c40 (diff), df56e25 (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.
Message:

Merge branch 'master' of plg.uwaterloo.ca:software/cfa/cfa-cc

Files:
2 added
1 deleted
35 edited

Legend:

Unmodified
Added
Removed
  • doc/LaTeXmacros/lstlang.sty

    rfa59c40 r8e90fd6  
    88%% Created On       : Sat May 13 16:34:42 2017
    99%% Last Modified By : Peter A. Buhr
    10 %% Last Modified On : Wed Jul 24 07:40:11 2024
    11 %% Update Count     : 45
     10%% Last Modified On : Fri Jan 17 14:29:52 2025
     11%% Update Count     : 46
    1212%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
    1313
     
    117117                __auto_type, basetypeof, _Bool, bool, catch, catchResume, choose, coerce, cofor, corun, countof, _Complex, __complex, __complex__,
    118118                __const, __const__, continue, coroutine, _Decimal32, _Decimal64, _Decimal128, disable, dtype, enable, exception, __extension__,
    119                 fallthrough, fallthru, finally, fixup, __float80, float80, __float128, float128, _Float16, _Float32, _Float32x, _Float64,
     119                fallthrough, finally, fixup, __float80, float80, __float128, float128, _Float16, _Float32, _Float32x, _Float64,
    120120                _Float64x, _Float128, _Float128x, forall, fortran, ftype, generator, _Generic, _Imaginary, __imag, __imag__, inline,
    121121                __inline, __inline__, int128, __int128, __int128_t, __label__, monitor, mutex, _Noreturn, __builtin_offsetof, one_t, or,
  • doc/papers/OOPSLA17/generic_types.tex

    rfa59c40 r8e90fd6  
    6666        morekeywords={_Alignas,_Alignof,__alignof,__alignof__,asm,__asm,__asm__,_At,_Atomic,__attribute,__attribute__,auto,
    6767                _Bool,catch,catchResume,choose,_Complex,__complex,__complex__,__const,__const__,disable,dtype,enable,__extension__,
    68                 fallthrough,fallthru,finally,forall,ftype,_Generic,_Imaginary,inline,__label__,lvalue,_Noreturn,one_t,otype,restrict,_Static_assert,
     68                fallthrough,finally,forall,ftype,_Generic,_Imaginary,inline,__label__,lvalue,_Noreturn,one_t,otype,restrict,_Static_assert,
    6969                _Thread_local,throw,throwResume,trait,try,ttype,typeof,__typeof,__typeof__,zero_t},
    7070}%
  • doc/papers/concurrency/Paper.tex

    rfa59c40 r8e90fd6  
    162162                _Alignas, _Alignof, __alignof, __alignof__, asm, __asm, __asm__, __attribute, __attribute__,
    163163                auto, _Bool, catch, catchResume, choose, _Complex, __complex, __complex__, __const, __const__,
    164                 coroutine, disable, dtype, enable, exception, __extension__, fallthrough, fallthru, finally,
     164                coroutine, disable, dtype, enable, exception, __extension__, fallthrough, finally,
    165165                __float80, float80, __float128, float128, forall, ftype, generator, _Generic, _Imaginary, __imag, __imag__,
    166166                inline, __inline, __inline__, __int128, int128, __label__, monitor, mutex, _Noreturn, one_t, or,
  • doc/papers/general/Paper.tex

    rfa59c40 r8e90fd6  
    143143                _Alignas, _Alignof, __alignof, __alignof__, asm, __asm, __asm__, __attribute, __attribute__,
    144144                auto, _Bool, catch, catchResume, choose, _Complex, __complex, __complex__, __const, __const__,
    145                 coroutine, disable, dtype, enable, exception, __extension__, fallthrough, fallthru, finally,
     145                coroutine, disable, dtype, enable, exception, __extension__, fallthrough, finally,
    146146                __float80, float80, __float128, float128, forall, ftype, _Generic, _Imaginary, __imag, __imag__,
    147147                inline, __inline, __inline__, __int128, int128, __label__, monitor, mutex, _Noreturn, one_t, or,
  • doc/papers/llheap/Paper.tex

    rfa59c40 r8e90fd6  
    108108                _Alignas, _Alignof, __alignof, __alignof__, and, asm, __asm, __asm__, _Atomic, __attribute, __attribute__,
    109109                __auto_type, basetypeof, _Bool, catch, catchResume, choose, coerce, _Complex, __complex, __complex__, __const, __const__,
    110                 coroutine, _Decimal32, _Decimal64, _Decimal128, disable, enable, exception, __extension__, fallthrough, fallthru, finally, fixup,
     110                coroutine, _Decimal32, _Decimal64, _Decimal128, disable, enable, exception, __extension__, fallthrough, finally, fixup,
    111111                __float80, float80, __float128, float128, _Float16, _Float32, _Float32x, _Float64, _Float64x, _Float128, _Float128x,
    112112                forall, fortran, generator, _Generic, _Imaginary, __imag, __imag__, inline, __inline, __inline__, int128, __int128, __int128_t,
  • doc/refrat/keywords.tex

    rfa59c40 r8e90fd6  
    1111%% Created On       : Sun Aug  6 08:17:27 2017
    1212%% Last Modified By : Peter A. Buhr
    13 %% Last Modified On : Fri Apr  6 15:16:11 2018
    14 %% Update Count     : 7
     13%% Last Modified On : Fri Jan 17 14:45:13 2025
     14%% Update Count     : 8
    1515%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
    1616\begin{tabular}{@{}llllll@{}}
     
    2828©exception©             \\
    2929©fallthrough©   \\
    30 ©fallthru©              \\
    3130\end{tabular}
    3231&
  • doc/refrat/refrat.tex

    rfa59c40 r8e90fd6  
    1111%% Created On       : Wed Apr  6 14:52:25 2016
    1212%% Last Modified By : Peter A. Buhr
    13 %% Last Modified On : Mon Oct  5 09:02:53 2020
    14 %% Update Count     : 110
     13%% Last Modified On : Fri Jan 17 14:45:04 2025
     14%% Update Count     : 111
    1515%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
    1616
     
    33483348
    33493349The ©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 ©fallthru© statement is used to fall through to the next ©case© or ©default© labeled statement.
     3350The ©fallthrough© statement is used to fall through to the next ©case© or ©default© labeled statement.
    33513351The following have identical meaning:
    33523352\begin{flushleft}
     
    33663366  case 1: ... ; // exit
    33673367  case 2: ... ; // exit
    3368   case 3: ... ; fallthru;
    3369   case 4: ... ; fallthru;
     3368  case 3: ... ; fallthrough;
     3369  case 4: ... ; fallthrough;
    33703370  default: ... ; // exit
    33713371}
  • doc/theses/aaron_moss_PhD/phd/cfa-macros.tex

    rfa59c40 r8e90fd6  
    2727                _Alignas, _Alignof, __alignof, __alignof__, asm, __asm, __asm__, __attribute, __attribute__,
    2828                auto, bool, _Bool, catch, catchResume, choose, _Complex, __complex, __complex__, __const, __const__,
    29                 coroutine, disable, dtype, enable, exception, __extension__, fallthrough, fallthru, finally,
     29                coroutine, disable, dtype, enable, exception, __extension__, fallthrough, finally,
    3030                __float80, float80, __float128, float128, forall, ftype, _Generic, _Imaginary, __imag, __imag__,
    3131                inline, __inline, __inline__, __int128, int128, __label__, monitor, mutex, _Noreturn, one_t, or,
  • doc/theses/andrew_beach_MMath/cfalab.sty

    rfa59c40 r8e90fd6  
    7676        choose, _Complex, __complex, __complex__, __const, __const__,
    7777        coroutine, disable, dtype, enable, exception, __extension__,
    78         fallthrough, fallthru, finally, __float80, float80, __float128,
     78        fallthrough, finally, __float80, float80, __float128,
    7979        float128, forall, ftype, generator, _Generic, _Imaginary, __imag,
    8080        __imag__, inline, __inline, __inline__, __int128, int128, __label__,
  • doc/theses/andrew_beach_MMath/features.tex

    rfa59c40 r8e90fd6  
    822822control flow.
    823823Because of this requirement, local control flow out of the finally block
    824 is forbidden. The compiler precludes any @break@, @continue@, @fallthru@ or
     824is forbidden. The compiler precludes any @break@, @continue@, @fallthrough@ or
    825825@return@ that causes control to leave the finally block. Other ways to leave
    826826the finally block, such as a @longjmp@ or termination are much harder to check,
  • doc/theses/fangren_yu_MMath/intro.tex

    rfa59c40 r8e90fd6  
    518518
    519519\begin{enumerate}
    520 \item
    521 \item
    522 \item
     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.
    523523\end{enumerate}
    524524
  • doc/uC++toCFA/uC++toCFA.tex

    rfa59c40 r8e90fd6  
    1111%% Created On       : Wed Apr  6 14:53:29 2016
    1212%% Last Modified By : Peter A. Buhr
    13 %% Last Modified On : Fri Nov 15 09:55:34 2024
    14 %% Update Count     : 6249
     13%% Last Modified On : Fri Jan 17 07:39:09 2025
     14%% Update Count     : 6284
    1515%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
    1616
     
    197197
    198198
    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 
    223199\section{Looping}
    224200
     
    240216for ( i; 0 @-@~ 10 ) { ... }
    241217\end{cfa}
    242 \\
    243 \hline
     218\end{tabular}
     219\end{cquote}
     220
     221\begin{cquote}
     222\begin{tabular}{@{}l|l@{}}
    244223\begin{uC++}
    245224int i = 0
     
    253232@else@ { ... } // i == 10
    254233\end{cfa}
    255 \\
    256 \hline
     234\end{tabular}
     235\end{cquote}
     236
     237\begin{cquote}
     238\begin{tabular}{@{}l|l@{}}
    257239\begin{uC++}
    258240@L1:@ for ( ;; ) {
     
    271253        }
    272254}
     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@>
     267using namespace std;
     268int i;   double d;   char c;
     269cin >> i >> d >> c;
     270cout << i << ' ' << d << ' ' << c << endl;
     271\end{uC++}
     272&
     273\begin{cfa}
     274#include <@fstream.hfa@>
     275
     276int i;   double d;   char c;
     277sin | i | d | c;
     278sout | i | d | c
     279\end{cfa}
     280\end{tabular}
     281\end{cquote}
     282To 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
     287for ( int i = 0; i < 5; i += 1 ) cout << i << ' ';
     288cout << @endl@;
     289
     2900 1 2 3 4
     291\end{uC++}
     292&
     293\begin{cfa}
     294sout | @nlOff@; // disable auto nl
     295for ( i; 5 ) sout | i;
     296sout | @nl@;
     297sout | @nlOn@;  // reenable auto nl
     2980 1 2 3 4
     299\end{cfa}
     300\end{tabular}
     301\end{cquote}
     302Floating-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++}
     306cout << 3.0 << ' ' << showpoint << setprecision(0) << 3.0 << endl;
     3073 3.
     308\end{uC++}
     309&
     310\begin{cfa}
     311sout | @nodp( 3.0 )@ | 3.0;
     3123 3.
    273313\end{cfa}
    274314\end{tabular}
     
    291331        if ( ... ) @_Throw@ E( /* initialization */ );
    292332                ...
    293 } @_CatchResume@( E & ) { ... // reference
    294 } catch( E & ) { ...
    295 } catch( ... ) { ... // catch any
    296 } _Finally { ...
    297 }
     333} @_CatchResume@( E & /* reference */ ) { ... }
     334  catch( E & ) { ... }
     335  catch( ... /* catch any */ ) { ... }
     336  _Finally { ... }
    298337\end{uC++}
    299338&
     
    308347        if ( ... ) @throw@ @ExceptionInst@( E, /* intialization */ );
    309348        ...
    310 } @catchResume@( E * ) { ... // pointer
    311 } catch( E * ) { ...
    312 } catch( exception_t * ) { ... // catch any
    313 } finally { ...
    314 }
     349} @catchResume@( E @*@ /* pointer */ ) { ... }
     350  catch( E * ) { ... }
     351  catch( exception_t @*@ /* catch any */ ) { ... }
     352  finally { ... }
    315353\end{cfa}
    316354\end{tabular}
     
    330368                        ... suspend(); ...
    331369                }
    332         } @_CatchResume@( E & ) { // reference
    333                 ...
    334         } catch( E & ) {
    335                 ...
    336         }
     370        } @_CatchResume@( E & /* reference */ ) { ... }
     371          catch( E & ) { ... }
    337372}
    338373\end{uC++}
     
    346381                ... suspendPoll ...
    347382                disable_ehm();
    348         } @catchResume@( E * ) { // pointer
    349                 ...
    350         } catch( E & ) {
    351                 ...
    352         }
     383        } @catchResume@( E * ) { ... }
     384          catch( E & ) { ... }
    353385}
    354386\end{cfa}
     
    556588
    557589
    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 
    591590\section{\lstinline{COBEGIN}/\lstinline{COFOR}}
    592591
     
    602601                BEGIN osacquire( cout ) << "C" << endl; END
    603602                BEGIN osacquire( cout ) << "D" << endl; END
    604                 BEGIN osacquire( cout ) << "E" << endl; END
    605603        @COEND@
    606604        @COFOR@( i, 1, 10,
     
    619617                corun { mutex( sout ) sout | "C"; }
    620618                corun { mutex( sout ) sout | "D"; }
    621                 corun { mutex( sout ) sout | "E"; }
    622619        }
    623620        @cofor@( i; 10 ) {
     
    703700}
    704701\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 fields
     714        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 fields
     726
     727};
     728void 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}}
    705735\end{tabular}
    706736\end{cquote}
  • doc/user/user.tex

    rfa59c40 r8e90fd6  
    1111%% Created On       : Wed Apr  6 14:53:29 2016
    1212%% Last Modified By : Peter A. Buhr
    13 %% Last Modified On : Sat Dec  7 16:53:37 2024
    14 %% Update Count     : 6970
     13%% Last Modified On : Fri Jan 17 14:20:39 2025
     14%% Update Count     : 6971
    1515%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
    1616
     
    893893still works.
    894894Nevertheless, 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}/\-\Indexc{fallthru}, \eg:
     895Therefore, 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:
    896896\begin{cfa}
    897897®choose® ( i ) {
     
    901901  case 5:
    902902        ...
    903         ®fallthru®; §\C{// explicit fall through}§
     903        ®fallthrough®; §\C{// explicit fall through}§
    904904  case 7:
    905905        ...
     
    911911Like the ©switch© statement, the ©choose© statement retains the fall-through semantics for a list of ©case© clauses.
    912912An implicit ©break© is applied only at the end of the \emph{statements} following a ©case© clause.
    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.
     913An explicit ©fallthrough© is retained because it is a C-idiom most C programmers expect, and its absence might discourage programmers from using the ©choose© statement.
    914914As well, allowing an explicit ©break© from the ©choose© is a carry over from the ©switch© statement, and expected by C programmers.
    915915\item
     
    950950  case 3:
    951951        if ( ... ) {
    952                 ... ®fallthru;® // goto case 4
     952                ... ®fallthrough;® // goto case 4
    953953        } else {
    954954                ...
     
    985985                for ( ... ) {
    986986                        // multi-level transfer
    987                         ... ®fallthru common;®
     987                        ... ®fallthrough common;®
    988988                }
    989989                ...
     
    80538053\begin{cquote}
    80548054\Indexc{basetypeof}, \Indexc{choose}, \Indexc{coroutine}, \Indexc{disable},
    8055 \Indexc{enable}, \Indexc{exception}, \Indexc{fallthrough}, \Indexc{fallthru},
     8055\Indexc{enable}, \Indexc{exception}, \Indexc{fallthrough}, \Indexc{fallthrough},
    80568056\Indexc{finally}, \Indexc{fixup}, \Indexc{forall},\Indexc{generator},
    80578057\Indexc{int128}, \Indexc{monitor}, \Indexc{mutex}, \Indexc{one_t},
     
    80798079\Indexc{exception}              \\
    80808080\Indexc{fallthrough}    \\
    8081 \Indexc{fallthru}               \\
     8081\Indexc{fallthrough}    \\
    80828082\end{tabular}
    80838083&
  • libcfa/src/concurrency/monitor.cfa

    rfa59c40 r8e90fd6  
    99// Author           : Thierry Delisle
    1010// Created On       : Thd Feb 23 12:27:26 2017
    11 // Last Modified By : Peter A. Buhr
    12 // Last Modified On : Wed Nov 27 12:13:14 2024
    13 // Update Count     : 72
     11// Last Modified By : Kyoung Seo
     12// Last Modified On : Thd Jan 16 12:59:00 2025
     13// Update Count     : 73
    1414//
    1515
     
    922922static inline [thread$ *, int] search_entry_queue( const __waitfor_mask_t & mask, monitor$ * monitors [], __lock_size_t count ) {
    923923        __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
    954924        // For each acceptable (respect lexical priority in waitfor statement)
    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-- ) {
     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++ ) {
    957929                #if defined( __CFA_WITH_VERIFY__ )
    958930                thread$ * last = 0p;
     
    977949                } // for
    978950        } // for
    979 #endif
    980951        return [0, -1];
    981952}
  • src/AST/Expr.cpp

    rfa59c40 r8e90fd6  
    122122
    123123bool VariableExpr::get_lvalue() const {
    124         // It isn't always an lvalue, but it is never an rvalue.
     124        // Special case for enumeration labels (more literals than variables):
    125125        if(dynamic_cast<const ast::EnumInstType *>(var->get_type())) return !var->isMember;
     126        // The remaining uses are either actual variables (lvalues) or function
     127        // names which are a special value catagory that can be treated as
     128        // lvalues in the places we are worried about.
    126129        return true;
    127130}
  • src/AST/Stmt.hpp

    rfa59c40 r8e90fd6  
    99// Author           : Aaron B. Moss
    1010// Created On       : Wed May  8 13:00:00 2019
    11 // Last Modified By : Andrew Beach
    12 // Last Modified On : Wed Apr  5 10:34:00 2023
    13 // Update Count     : 37
     11// Last Modified By : Peter A. Buhr
     12// Last Modified On : Fri Jan 17 14:18:56 2025
     13// Update Count     : 38
    1414//
    1515
     
    280280};
    281281
    282 // Branch control flow statement: goto ... or break or continue or fallthru
     282// Branch control flow statement: goto ... or break or continue or fallthrough
    283283class BranchStmt final : public Stmt {
    284284  public:
  • src/CodeGen/CodeGenerator.cpp

    rfa59c40 r8e90fd6  
    99// Author           : Andrew Beach
    1010// Created On       : Tue Oct 17 15:54:00 2023
    11 // Last Modified By : Andrew Beach
    12 // Last Modified On : Wed Oct 25 18:28:00 2023
    13 // Update Count     : 0
     11// Last Modified By : Peter A. Buhr
     12// Last Modified On : Fri Jan 17 14:19:22 2025
     13// Update Count     : 1
    1414//
    1515
     
    10921092        case ast::BranchStmt::FallThrough:
    10931093        case ast::BranchStmt::FallThroughDefault:
    1094                 assertf( !options.genC, "fallthru should not reach code generation." );
    1095                 output << "fallthru";
     1094                assertf( !options.genC, "fallthrough should not reach code generation." );
     1095                output << "fallthrough";
    10961096                break;
    10971097        default:
    10981098                assertf( false, "Bad BranchStmt value." );
    10991099        }
    1100         // Print branch target for labelled break/continue/fallthru in debug mode.
     1100        // Print branch target for labelled break/continue/fallthrough in debug mode.
    11011101        if ( !options.genC && stmt->kind != ast::BranchStmt::Goto ) {
    11021102                if ( !stmt->target.empty() ) {
  • src/Parser/StatementNode.cpp

    rfa59c40 r8e90fd6  
    1010// Author           : Rodolfo G. Esteves
    1111// Created On       : Sat May 16 14:59:41 2015
    12 // Last Modified By : Peter A. Buhr
    13 // Last Modified On : Mon Sep 23 22:50:35 2024
    14 // Update Count     : 432
     12// Last Modified By : Kyoung Seo
     13// Last Modified On : Thd Jan 16 13:05:00 2025
     14// Update Count     : 433
    1515//
    1616
     
    351351        delete targetExpr;
    352352
    353         existing->clauses.insert( existing->clauses.begin(), clause );
     353        existing->clauses.insert( existing->clauses.end(), clause );
    354354
    355355        return existing;
  • src/Parser/lex.ll

    rfa59c40 r8e90fd6  
    1010 * Created On       : Sat Sep 22 08:58:10 2001
    1111 * Last Modified By : Peter A. Buhr
    12  * Last Modified On : Sun Dec 15 17:23:46 2024
    13  * Update Count     : 877
     12 * Last Modified On : Fri Jan 17 14:36:16 2025
     13 * Update Count     : 878
    1414 */
    1515
     
    273273extern                  { KEYWORD_RETURN(EXTERN); }
    274274fallthrough             { KEYWORD_RETURN(FALLTHROUGH); }                // CFA
    275 fallthru                { KEYWORD_RETURN(FALLTHRU); }                   // CFA
    276275finally                 { QKEYWORD_RETURN(FINALLY); }                   // CFA
    277276fixup                   { QKEYWORD_RETURN(FIXUP); }                             // CFA
  • src/Parser/parser.yy

    rfa59c40 r8e90fd6  
    1010// Created On       : Sat Sep  1 20:22:55 2001
    1111// Last Modified By : Peter A. Buhr
    12 // Last Modified On : Sun Dec 15 21:30:38 2024
    13 // Update Count     : 6933
     12// Last Modified On : Fri Jan 17 14:35:08 2025
     13// Update Count     : 6935
    1414//
    1515
     
    377377%token ATTRIBUTE EXTENSION                                                              // GCC
    378378%token IF ELSE SWITCH CASE DEFAULT DO WHILE FOR BREAK CONTINUE GOTO RETURN
    379 %token CHOOSE FALLTHRU FALLTHROUGH WITH WHEN WAITFOR WAITUNTIL // CFA
     379%token CHOOSE FALLTHROUGH WITH WHEN WAITFOR WAITUNTIL   // CFA
    380380%token CORUN COFOR
    381381%token DISABLE ENABLE TRY THROW THROWRESUME AT                  // CFA
     
    16801680                // whereas normal operator precedence yields goto (*i)+3;
    16811681                { $$ = new StatementNode( build_computedgoto( $3 ) ); }
    1682                 // A semantic check is required to ensure fallthru appears only in the body of a choose statement.
    1683         | fall_through_name ';'                                                         // CFA
     1682                // A semantic check is required to ensure fallthrough appears only in the body of a choose statement.
     1683        | FALLTHROUGH ';'                                                                       // CFA
    16841684                { $$ = new StatementNode( build_branch( yylloc, ast::BranchStmt::FallThrough ) ); }
    1685         | fall_through_name identifier_or_type_name ';'         // CFA
     1685        | FALLTHROUGH identifier_or_type_name ';'                       // CFA
    16861686                { $$ = new StatementNode( build_branch( yylloc, $2, ast::BranchStmt::FallThrough ) ); }
    1687         | fall_through_name DEFAULT ';'                                         // CFA
     1687        | FALLTHROUGH DEFAULT ';'                                                       // CFA
    16881688                { $$ = new StatementNode( build_branch( yylloc, ast::BranchStmt::FallThroughDefault ) ); }
    16891689        | CONTINUE ';'
     
    17231723        | THROWRESUME assignment_expression_opt AT assignment_expression ';' // handles reresume
    17241724                { $$ = new StatementNode( build_resume_at( $2, $4 ) ); }
    1725         ;
    1726 
    1727 fall_through_name:                                                                              // CFA
    1728         FALLTHRU
    1729         | FALLTHROUGH
    17301725        ;
    17311726
  • tests/concurrency/actors/dynamic.cfa

    rfa59c40 r8e90fd6  
    3737                if ( strcmp( argv[1], "d" ) != 0 ) {                    // default ?
    3838                        Times = ato( argv[1] );
    39                         if ( Times < 1 ) fallthru default;
     39                        if ( Times < 1 ) fallthrough default;
    4040                } // if
    4141          case 1:                                                                                       // use defaults
  • tests/concurrency/actors/executor.cfa

    rfa59c40 r8e90fd6  
    4141                if ( strcmp( argv[6], "d" ) != 0 ) {                    // default ?
    4242                        BufSize = ato( argv[6] );
    43                         if ( BufSize < 0 ) fallthru default;
     43                        if ( BufSize < 0 ) fallthrough default;
    4444                } // if
    4545          case 6:
    4646                if ( strcmp( argv[5], "d" ) != 0 ) {                    // default ?
    4747                        Batch = ato( argv[5] );
    48                         if ( Batch < 1 ) fallthru default;
     48                        if ( Batch < 1 ) fallthrough default;
    4949                } // if
    5050          case 5:
    5151                if ( strcmp( argv[4], "d" ) != 0 ) {                    // default ?
    5252                        Processors = ato( argv[4] );
    53                         if ( Processors < 1 ) fallthru default;
     53                        if ( Processors < 1 ) fallthrough default;
    5454                } // if
    5555          case 4:
    5656                if ( strcmp( argv[3], "d" ) != 0 ) {                    // default ?
    5757                        Rounds = ato( argv[3] );
    58                         if ( Rounds < 1 ) fallthru default;
     58                        if ( Rounds < 1 ) fallthrough default;
    5959                } // if
    6060          case 3:
    6161                if ( strcmp( argv[2], "d" ) != 0 ) {                    // default ?
    6262                        Set = ato( argv[2] );
    63                         if ( Set < 1 ) fallthru default;
     63                        if ( Set < 1 ) fallthrough default;
    6464                } // if
    6565          case 2:
    6666                if ( strcmp( argv[1], "d" ) != 0 ) {                    // default ?
    6767                        Actors = ato( argv[1] );
    68                         if ( Actors < 1 || Actors <= Set || Actors % Set != 0 ) fallthru default;
     68                        if ( Actors < 1 || Actors <= Set || Actors % Set != 0 ) fallthrough default;
    6969                } // if
    7070          case 1:                                                                                       // use defaults
  • tests/concurrency/actors/matrixMultiply.cfa

    rfa59c40 r8e90fd6  
    3939                if ( strcmp( argv[4], "d" ) != 0 ) {                    // default ?
    4040                        Processors = ato( argv[4] );
    41                         if ( Processors < 1 ) fallthru default;
     41                        if ( Processors < 1 ) fallthrough default;
    4242                } // if
    4343          case 4:
    4444                if ( strcmp( argv[3], "d" ) != 0 ) {                    // default ?
    4545                        xr = ato( argv[3] );
    46                         if ( xr < 1 ) fallthru default;
     46                        if ( xr < 1 ) fallthrough default;
    4747                } // if
    4848          case 3:
    4949                if ( strcmp( argv[2], "d" ) != 0 ) {                    // default ?
    5050                        xc = ato( argv[2] );
    51                         if ( xc < 1 ) fallthru default;
     51                        if ( xc < 1 ) fallthrough default;
    5252                } // if
    5353          case 2:
    5454                if ( strcmp( argv[1], "d" ) != 0 ) {                    // default ?
    5555                        yc = ato( argv[1] );
    56                         if ( yc < 1 ) fallthru default;
     56                        if ( yc < 1 ) fallthrough default;
    5757                } // if
    5858          case 1:                                                                                       // use defaults
  • tests/concurrency/actors/static.cfa

    rfa59c40 r8e90fd6  
    3434                if ( strcmp( argv[1], "d" ) != 0 ) {                    // default ?
    3535                        Times = ato( argv[1] );
    36                         if ( Times < 1 ) fallthru default;
     36                        if ( Times < 1 ) fallthrough default;
    3737                } // if
    3838          case 1:                                                                                       // use defaults
  • tests/concurrency/channels/barrier.cfa

    rfa59c40 r8e90fd6  
    6666                if ( strcmp( argv[2], "d" ) != 0 ) {                    // default ?
    6767                        BarrierSize = ato( argv[2] );
    68             if ( Processors < 1 ) fallthru default;
     68            if ( Processors < 1 ) fallthrough default;
    6969                } // if
    7070          case 2:
    7171                if ( strcmp( argv[1], "d" ) != 0 ) {                    // default ?
    7272                        Processors = ato( argv[1] );
    73                         if ( Processors < 1 ) fallthru default;
     73                        if ( Processors < 1 ) fallthrough default;
    7474                } // if
    7575          case 1:                                                                                       // use defaults
  • tests/concurrency/channels/churn.cfa

    rfa59c40 r8e90fd6  
    9191                if ( strcmp( argv[3], "d" ) != 0 ) {                    // default ?
    9292                        ChannelSize = ato( argv[3] );
    93                         if ( ChannelSize < 1 ) fallthru default;
     93                        if ( ChannelSize < 1 ) fallthrough default;
    9494                } // if
    9595      case 3:
    9696                if ( strcmp( argv[2], "d" ) != 0 ) {                    // default ?
    9797                        Channels = ato( argv[2] );
    98                         if ( Channels < 1 ) fallthru default;
     98                        if ( Channels < 1 ) fallthrough default;
    9999                } // if
    100100      case 2:
    101101                if ( strcmp( argv[1], "d" ) != 0 ) {                    // default ?
    102102                        Processors = ato( argv[1] );
    103                         if ( Processors < 1 ) fallthru default;
     103                        if ( Processors < 1 ) fallthrough default;
    104104                } // if
    105105          case 1:                                                                                       // use defaults
  • tests/concurrency/channels/contend.cfa

    rfa59c40 r8e90fd6  
    128128                if ( strcmp( argv[2], "d" ) != 0 ) {                    // default ?
    129129                        ChannelSize = ato( argv[2] );
    130                         if ( ChannelSize < 1 ) fallthru default;
     130                        if ( ChannelSize < 1 ) fallthrough default;
    131131                } // if
    132132          case 2:
    133133                if ( strcmp( argv[1], "d" ) != 0 ) {                    // default ?
    134134                        Processors = ato( argv[1] );
    135                         if ( Processors < 1 ) fallthru default;
     135                        if ( Processors < 1 ) fallthrough default;
    136136                } // if
    137137          case 1:                                                                                       // use defaults
  • tests/concurrency/channels/daisy_chain.cfa

    rfa59c40 r8e90fd6  
    3838                if ( strcmp( argv[2], "d" ) != 0 ) {                    // default ?
    3939                        Tasks = ato( argv[2] );
    40             if ( Tasks < 1 ) fallthru default;
     40            if ( Tasks < 1 ) fallthrough default;
    4141                } // if
    4242          case 2:
    4343                if ( strcmp( argv[1], "d" ) != 0 ) {                    // default ?
    4444                        Processors = ato( argv[1] );
    45                         if ( Processors < 1 ) fallthru default;
     45                        if ( Processors < 1 ) fallthrough default;
    4646                } // if
    4747          case 1:                                                                                       // use defaults
  • tests/concurrency/channels/hot_potato.cfa

    rfa59c40 r8e90fd6  
    4343                if ( strcmp( argv[2], "d" ) != 0 ) {                    // default ?
    4444                        Tasks = ato( argv[2] );
    45             if ( Tasks < 1 ) fallthru default;
     45            if ( Tasks < 1 ) fallthrough default;
    4646                } // if
    4747          case 2:
    4848                if ( strcmp( argv[1], "d" ) != 0 ) {                    // default ?
    4949                        Processors = ato( argv[1] );
    50                         if ( Processors < 1 ) fallthru default;
     50                        if ( Processors < 1 ) fallthrough default;
    5151                } // if
    5252          case 1:                                                                                       // use defaults
  • tests/concurrency/channels/pub_sub.cfa

    rfa59c40 r8e90fd6  
    8888                if ( strcmp( argv[2], "d" ) != 0 ) {                    // default ?
    8989                        Tasks = ato( argv[2] );
    90             if ( Tasks < 1 ) fallthru default;
     90            if ( Tasks < 1 ) fallthrough default;
    9191                } // if
    9292          case 2:
    9393                if ( strcmp( argv[1], "d" ) != 0 ) {                    // default ?
    9494                        Processors = ato( argv[1] );
    95                         if ( Processors < 1 ) fallthru default;
     95                        if ( Processors < 1 ) fallthrough default;
    9696                } // if
    9797          case 1:                                                                                       // use defaults
  • tests/ctrl-flow/fallthrough.cfa

    rfa59c40 r8e90fd6  
    1010// Created On       : Wed Mar 14 10:06:25 2018
    1111// Last Modified By : Peter A. Buhr
    12 // Last Modified On : Mon Dec 24 11:24:35 2018
    13 // Update Count     : 22
     12// Last Modified On : Fri Jan 17 14:09:49 2025
     13// Update Count     : 23
    1414//
    1515
     
    2020          case 1:
    2121                sout | "case 1";
    22                 fallthru;
     22                fallthrough;
    2323          case 2:
    2424                sout | "case 2";
    25                 fallthru;
    26                 sout | "did not fallthru";
    27                 if ( 7 ) fallthru common2;
    28                 fallthru common1;
     25                fallthrough;
     26                sout | "did not fallthrough";
     27                if ( 7 ) fallthrough common2;
     28                fallthrough common1;
    2929          case 3:
    3030                sout | "case 3";
    31                 fallthru default;
    32                 fallthru common1;
     31                fallthrough default;
     32                fallthrough common1;
    3333          common1:
    3434                sout | "common1";
     
    3636          case 4:
    3737                sout | "case 4";
    38                 fallthru common2;
     38                fallthrough common2;
    3939          case 5:
    4040                sout | "case 5";
    41                 fallthru common2;
    42                 fallthru default;
     41                fallthrough common2;
     42                fallthrough default;
    4343          case 6:
    4444                sout | "case 6";
    45                 fallthru common2;
     45                fallthrough common2;
    4646          common2:
    4747                sout | "common2";
     
    4949          default:
    5050                sout | "default";
    51                 fallthru;
     51                fallthrough;
    5252        } // choose
    5353
     
    6262                        for ( int i = 0; i < 4; i += 1 ) {
    6363                                sout | i;
    64                                 if ( i == 2 ) fallthru common;
     64                                if ( i == 2 ) fallthrough common;
    6565                        } // for
    6666                } // switch
     
    7373                        } else {
    7474                                sout | "check";
    75                                 fallthru common;
     75                                fallthrough common;
    7676                        } // if
    7777                } // if
    7878          common:
    7979                sout | "common";
    80                 fallthru;
     80                fallthrough;
    8181                break;
    8282          default:
    8383                sout | "default";
    84                 fallthru;
     84                fallthrough;
    8585        } // switch
    8686
    8787#if ERR1
    8888        // ERROR: fallthrough must be enclosed in switch or choose
    89         fallthru;
     89        fallthrough;
    9090        // ERROR: fallthrough must be enclosed in switch or choose
    91         fallthru common4;
     91        fallthrough common4;
    9292        // ERROR: fallthrough must be enclosed in switch or choose
    93         fallthru default;
     93        fallthrough default;
    9494        choose ( 3 ) {
    9595          case 2:
     
    9898                          case 1:
    9999                                // ERROR: default is later, but in a different switch
    100                                 fallthru default;
     100                                fallthrough default;
    101101                                // ERROR: common3 is later, but not at the same level as a case clause
    102                                 fallthru common3;
     102                                fallthrough common3;
    103103                        }
    104104                  common3: ;
     
    108108          common4:
    109109                // ERROR: attempt to jump up with fallthrough
    110                 if ( 7 ) fallthru common4;
     110                if ( 7 ) fallthrough common4;
    111111                // ERROR: attempt to jump up with fallthrough
    112                 fallthru default;
     112                fallthrough default;
    113113        } // choose
    114114#endif
  • tests/ctrl-flow/labelledExit.cfa

    rfa59c40 r8e90fd6  
    1010// Created On       : Wed Aug 10 07:29:39 2016
    1111// Last Modified By : Peter A. Buhr
    12 // Last Modified On : Sat Jun  5 10:07:34 2021
    13 // Update Count     : 13
     12// Last Modified On : Fri Jan 17 14:18:15 2025
     13// Update Count     : 14
    1414//
    1515
     
    131131                        break Choose;
    132132                }
    133                 fallthru;
     133                fallthrough;
    134134          case 2:
    135135                i += 1;
  • tests/exceptions/try-ctrl-flow.cfa

    rfa59c40 r8e90fd6  
    8181}
    8282
    83 void choose_fallthru_in_finally() {
     83void choose_fallthrough_in_finally() {
    8484        choose (1) {
    8585        case 1:
    8686                try {} finally {
    87                         fallthru;
     87                        fallthrough;
    8888                }
    8989        default:
     
    105105}
    106106
    107 void labelled_choose_fallthru_in_finally() {
     107void labelled_choose_fallthrough_in_finally() {
    108108        mainBlock: choose (1) {
    109109        case 1:
    110110                try {} finally {
    111                         fallthru mainBlock;
     111                        fallthrough mainBlock;
    112112                }
    113113        case 2:
     
    118118}
    119119
    120 void choose_fallthru_default_in_finally() {
     120void choose_fallthrough_default_in_finally() {
    121121        choose (1) {
    122122        case 1:
    123123                try {} finally {
    124                         fallthru default;
     124                        fallthrough default;
    125125                }
    126126        default:
  • tests/quotedKeyword.cfa

    rfa59c40 r8e90fd6  
    1010// Created On       : Wed May 27 17:56:53 2015
    1111// Last Modified By : Peter A. Buhr
    12 // Last Modified On : Thu Feb 23 20:31:05 2023
    13 // Update Count     : 26
     12// Last Modified On : Fri Jan 17 14:10:32 2025
     13// Update Count     : 27
    1414//
    1515
     
    2929        ``__attribute__, ``auto, ``_Bool, ``break, ``case, ``catch, ``catchResume, ``char, ``choose, ``_Complex, ``__complex,
    3030        ``__complex__, ``const, ``__const, ``__const__, ``continue, ``default, ``disable, ``do, ``double, ``dtype, ``else,
    31         ``enable, ``enum, ``__extension__, ``extern, ``fallthru, ``finally, ``float, ``__float128, ``for, ``forall, ``fortran,
     31        ``enable, ``enum, ``__extension__, ``extern, ``fallthrough, ``finally, ``float, ``__float128, ``for, ``forall, ``fortran,
    3232        ``ftype, ``_Generic, ``goto, ``if, ``_Imaginary, ``__imag, ``__imag__, ``inline, ``__inline, ``__inline__, ``int,
    3333        ``__int128, ``__label__, ``long, ``lvalue, ``_Noreturn, ``__builtin_offsetof, ``otype, ``register, ``restrict,
  • tests/switch.cfa

    rfa59c40 r8e90fd6  
    1010// Created On       : Tue Jul 12 06:50:22 2016
    1111// Last Modified By : Peter A. Buhr
    12 // Last Modified On : Sat Jun  5 10:08:20 2021
    13 // Update Count     : 44
     12// Last Modified On : Fri Jan 17 14:10:12 2025
     13// Update Count     : 45
    1414//
    1515
     
    9696          case 8~10:
    9797                f( 3 );
    98                 fallthru;
     98                fallthrough;
    9999          case 'd':
    100100                j = 5;
Note: See TracChangeset for help on using the changeset viewer.