Changes in / [3f7e12cb:78315272]


Ignore:
Files:
23 added
70 deleted
187 edited

Legend:

Unmodified
Added
Removed
  • .gitignore

    r3f7e12cb r78315272  
    5252tools/prettyprinter/pretty
    5353tools/pretty
    54 tools/catchsig
    55 tools/repeat
    5654
    5755# generated by xfig for user manual
  • configure

    r3f7e12cb r78315272  
    62816281
    62826282
    6283 ac_config_files="$ac_config_files Makefile src/driver/Makefile src/Makefile src/benchmark/Makefile src/examples/Makefile src/tests/Makefile src/tests/preempt_longrun/Makefile src/prelude/Makefile src/libcfa/Makefile tools/Makefile tools/prettyprinter/Makefile"
     6283ac_config_files="$ac_config_files Makefile src/driver/Makefile src/Makefile src/benchmark/Makefile src/examples/Makefile src/tests/Makefile src/tests/preempt_longrun/Makefile src/prelude/Makefile src/libcfa/Makefile tools/prettyprinter/Makefile"
    62846284
    62856285
     
    70487048    "src/prelude/Makefile") CONFIG_FILES="$CONFIG_FILES src/prelude/Makefile" ;;
    70497049    "src/libcfa/Makefile") CONFIG_FILES="$CONFIG_FILES src/libcfa/Makefile" ;;
    7050     "tools/Makefile") CONFIG_FILES="$CONFIG_FILES tools/Makefile" ;;
    70517050    "tools/prettyprinter/Makefile") CONFIG_FILES="$CONFIG_FILES tools/prettyprinter/Makefile" ;;
    70527051
  • configure.ac

    r3f7e12cb r78315272  
    238238        src/prelude/Makefile
    239239        src/libcfa/Makefile
    240         tools/Makefile
    241240        tools/prettyprinter/Makefile
    242241        ])
  • doc/LaTeXmacros/lstlang.sty

    r3f7e12cb r78315272  
    22%%
    33%% Cforall Version 1.0.0 Copyright (C) 2016 University of Waterloo
    4 %%
    5 %% lstlang.sty --
    6 %%
     4%% 
     5%% lstlang.sty -- 
     6%% 
    77%% Author           : Peter A. Buhr
    88%% Created On       : Sat May 13 16:34:42 2017
     
    110110                __attribute__, auto, _Bool, catch, catchResume, choose, _Complex, __complex, __complex__,
    111111                __const, __const__, disable, dtype, enable, __extension__, fallthrough, fallthru,
    112                 finally, forall, ftype, _Generic, _Imaginary, inline, __label__, lvalue, _Noreturn, one_t,
    113                 otype, restrict, _Static_assert, throw, throwResume, trait, try, ttype, typeof, __typeof,
    114                 __typeof__, virtual, with, zero_t},
     112                finally, forall, ftype, _Generic, _Imaginary, inline, __label__, lvalue, _Noreturn, one_t, 
     113                otype, restrict, _Static_assert, throw, throwResume, trait, try, ttype, typeof, __typeof, 
     114                __typeof__, virtual, waitfor, when, with, zero_t},
    115115        morekeywords=[2]{
    116                 _Atomic, coroutine, is_coroutine, is_monitor, is_thread, monitor, mutex, nomutex, or,
    117                 resume, suspend, thread, _Thread_local, waitfor, when, yield},
     116                _Atomic, coroutine, is_coroutine, is_monitor, is_thread, monitor, mutex, nomutex,
     117                resume, suspend, thread, _Thread_local, yield},
    118118        moredirectives={defined,include_next}%
    119119}
  • doc/proposals/concurrency/.gitignore

    r3f7e12cb r78315272  
    1616build/*.out
    1717build/*.ps
    18 build/*.pstex
    19 build/*.pstex_t
    2018build/*.tex
    2119build/*.toc
  • doc/proposals/concurrency/Makefile

    r3f7e12cb r78315272  
    1313annex/glossary \
    1414text/intro \
     15text/cforall \
    1516text/basics \
    16 text/cforall \
    1717text/concurrency \
    18 text/internals \
    1918text/parallelism \
    20 text/results \
    21 text/together \
    22 text/future \
    2319}
    2420
     
    2723        ext_monitor \
    2824        int_monitor \
    29         dependency \
    3025}}
    3126
    32 PICTURES = ${addprefix build/, ${addsuffix .pstex, \
    33         system \
    34 }}
     27PICTURES = ${addsuffix .pstex, \
     28}
    3529
    3630PROGRAMS = ${addsuffix .tex, \
     
    6963        build/*.out     \
    7064        build/*.ps      \
    71         build/*.pstex   \
    7265        build/*.pstex_t \
    7366        build/*.tex     \
  • doc/proposals/concurrency/annex/glossary.tex

    r3f7e12cb r78315272  
    1313}
    1414
    15 \longnewglossaryentry{bulk-acq}
    16 {name={bulk-acquiring}}
     15\longnewglossaryentry{group-acquire}
     16{name={bulk acquiring}}
    1717{
    1818Implicitly acquiring several monitors when entering a monitor.
    19 }
    20 
    21 \longnewglossaryentry{multi-acq}
    22 {name={multiple-acquisition}}
    23 {
    24 Any locking technique which allow any single thread to acquire a lock multiple times.
    2519}
    2620
     
    107101\newacronym{api}{API}{Application Program Interface}
    108102\newacronym{raii}{RAII}{Ressource Acquisition Is Initialization}
    109 \newacronym{numa}{NUMA}{Non-Uniform Memory Access}
  • doc/proposals/concurrency/figures/ext_monitor.fig

    r3f7e12cb r78315272  
    14144 1 -1 0 0 0 10 0.0000 2 105 90 6000 2160 d\001
    1515-6
    16 6 5100 2100 5400 2400
    17 1 3 0 1 -1 -1 1 0 4 0.000 1 0.0000 5250 2250 105 105 5250 2250 5355 2250
    18 4 1 -1 0 0 0 10 0.0000 2 105 120 5250 2295 X\001
     166 5850 1650 6150 1950
     171 3 0 1 -1 -1 0 0 -1 0.000 1 0.0000 6000 1800 105 105 6000 1800 6105 1905
     184 1 -1 0 0 0 10 0.0000 2 105 90 6000 1860 b\001
    1919-6
    20206 5100 1800 5400 2100
     
    22224 1 -1 0 0 0 10 0.0000 2 105 120 5250 2010 Y\001
    2323-6
    24 6 5850 1650 6150 1950
    25 1 3 0 1 -1 -1 0 0 -1 0.000 1 0.0000 6000 1800 105 105 6000 1800 6105 1905
    26 4 1 -1 0 0 0 10 0.0000 2 105 90 6000 1860 b\001
     246 5100 2100 5400 2400
     251 3 0 1 -1 -1 1 0 4 0.000 1 0.0000 5250 2250 105 105 5250 2250 5355 2250
     264 1 -1 0 0 0 10 0.0000 2 105 120 5250 2295 X\001
    2727-6
    28 6 3070 5445 7275 5655
     286 3000 5400 7200 5700
    29291 3 0 1 -1 -1 0 0 20 0.000 1 0.0000 3150 5550 80 80 3150 5550 3230 5630
    30301 3 0 1 -1 -1 0 0 -1 0.000 1 0.0000 4500 5550 105 105 4500 5550 4605 5655
     
    32324 0 -1 0 0 0 12 0.0000 2 135 1035 4725 5625 blocked task\001
    33334 0 -1 0 0 0 12 0.0000 2 135 870 3300 5625 active task\001
    34 4 0 -1 0 0 0 12 0.0000 2 135 1050 6225 5625 routine mask\001
     344 0 -1 0 0 0 12 0.0000 2 180 930 6225 5625 routine ptrs\001
    3535-6
    36361 3 0 1 -1 -1 0 0 -1 0.000 1 0.0000 3300 3600 105 105 3300 3600 3405 3705
     
    43432 2 0 1 0 7 50 -1 -1 0.000 0 0 -1 0 0 5
    4444         4050 2925 5475 2925 5475 3225 4050 3225 4050 2925
     452 1 0 1 -1 -1 0 0 -1 0.000 0 0 -1 0 0 2
     46         5850 2850 6075 3000
    45472 1 0 1 -1 -1 0 0 -1 0.000 0 0 -1 0 0 4
    4648         3150 3750 3750 3750 3750 4050 3150 4050
     
    64662 2 1 1 -1 -1 0 0 -1 4.000 0 0 0 0 0 5
    6567         5850 4200 5850 3300 4350 3300 4350 4200 5850 4200
     682 1 0 1 -1 -1 0 0 -1 0.000 0 0 -1 0 0 3
     69         5250 2850 5850 2850 5850 1650
     702 1 0 1 -1 -1 0 0 -1 0.000 0 0 -1 0 0 4
     71         3150 3150 3750 3150 3750 2850 5325 2850
    66722 1 0 1 0 7 50 -1 -1 0.000 0 0 -1 1 1 2
    6773        1 1 1.00 60.00 120.00
    6874        7 1 1.00 60.00 120.00
    6975         5250 3150 5250 2400
    70 2 1 0 1 0 7 50 -1 -1 0.000 0 0 -1 0 0 5
    71          3150 3150 3750 3150 3750 2850 5850 2850 5850 1650
    72 2 1 0 1 0 7 50 -1 -1 0.000 0 0 -1 0 0 2
    73          5850 2850 6150 3000
    74762 2 0 1 0 7 50 -1 -1 0.000 0 0 -1 0 0 5
    7577         5100 1800 5400 1800 5400 2400 5100 2400 5100 1800
  • doc/proposals/concurrency/style/cfa-format.tex

    r3f7e12cb r78315272  
    108108  belowskip=3pt,
    109109  keepspaces=true,
    110   tabsize=4,
    111110  % frame=lines,
    112111  literate=,
     
    134133  belowskip=3pt,
    135134  keepspaces=true,
    136   tabsize=4,
    137135  % frame=lines,
    138136  literate=,
     
    152150  keywordstyle=\bfseries\color{blue},
    153151  keywordstyle=[2]\bfseries\color{Plum},
    154   commentstyle=\sf\itshape\color{OliveGreen},             % green and italic comments
     152  commentstyle=\itshape\color{OliveGreen},                  % green and italic comments
    155153  identifierstyle=\color{identifierCol},
    156154  stringstyle=\sf\color{Mahogany},                                % use sanserif font
     
    160158  belowskip=3pt,
    161159  keepspaces=true,
    162   tabsize=4,
    163160  % frame=lines,
    164161  literate=,
     
    254251}{}
    255252
    256 \lstnewenvironment{gocode}[1][]{
    257   \lstset{
    258     language = Golang,
    259     style=defaultStyle,
    260     #1
    261   }
    262 }{}
    263 
    264253\newcommand{\zero}{\lstinline{zero_t}\xspace}
    265254\newcommand{\one}{\lstinline{one_t}\xspace}
  • doc/proposals/concurrency/text/basics.tex

    r3f7e12cb r78315272  
    11% ======================================================================
    22% ======================================================================
    3 \chapter{Concurrency Basics}\label{basics}
     3\chapter{Basics}\label{basics}
    44% ======================================================================
    55% ======================================================================
    6 Before any detailed discussion of the concurrency and parallelism in \CFA, it is important to describe the basics of concurrency and how they are expressed in \CFA user-code.
     6Before any detailed discussion of the concurrency and parallelism in \CFA, it is important to describe the basics of concurrency and how they are expressed in \CFA user code.
    77
    88\section{Basics of concurrency}
    9 At its core, concurrency is based on having multiple call-stacks and scheduling among threads of execution executing on these stacks. Concurrency without parallelism only requires having multiple call stacks (or contexts) for a single thread of execution.
    10 
    11 Execution with a single thread and multiple stacks where the thread is self-scheduling deterministically across the stacks is called coroutining. Execution with a single and multiple stacks but where the thread is scheduled by an oracle (non-deterministic from the thread perspective) across the stacks is called concurrency.
    12 
    13 Therefore, a minimal concurrency system can be achieved by creating coroutines, which instead of context switching among each other, always ask an oracle where to context switch next. While coroutines can execute on the caller's stack-frame, stackfull coroutines allow full generality and are sufficient as the basis for concurrency. The aforementioned oracle is a scheduler and the whole system now follows a cooperative threading-model \cit. The oracle/scheduler can either be a stackless or stackfull entity and correspondingly require one or two context switches to run a different coroutine. In any case, a subset of concurrency related challenges start to appear. For the complete set of concurrency challenges to occur, the only feature missing is preemption.
    14 
    15 A scheduler introduces order of execution uncertainty, while preemption introduces uncertainty about where context-switches occur. Mutual-exclusion and synchronisation are ways of limiting non-determinism in a concurrent system. Now it is important to understand that uncertainty is desireable; uncertainty can be used by runtime systems to significantly increase performance and is often the basis of giving a user the illusion that tasks are running in parallel. Optimal performance in concurrent applications is often obtained by having as much non-determinism as correctness allows\cit.
     9At its core, concurrency is based on having call-stacks and potentially multiple threads of execution for these stacks. Concurrency without parallelism only requires having multiple call stacks (or contexts) for a single thread of execution, and switching between these call stacks on a regular basis. A minimal concurrency product can be achieved by creating coroutines, which instead of context switching between each other, always ask an oracle where to context switch next. While coroutines do not technically require a stack, stackfull coroutines are the closest abstraction to a practical "naked"" call stack. When writing concurrency in terms of coroutines, the oracle effectively becomes a scheduler and the whole system now follows a cooperative threading-model \cit. The oracle/scheduler can either be a stackless or stackfull entity and correspondingly require one or two context switches to run a different coroutine. In any case, a subset of concurrency related challenges start to appear. For the complete set of concurrency challenges to occur, the only feature missing is preemption. Indeed, concurrency challenges appear with non-determinism. Guaranteeing mutual-exclusion or synchronisation are simply ways of limiting the lack of determinism in a system. A scheduler introduces order of execution uncertainty, while preemption introduces incertainty about where context-switches occur. Now it is important to understand that uncertainty is not necessarily undesireable; uncertainty can often be used by systems to significantly increase performance and is often the basis of giving a user the illusion that tasks are running in parallel. Optimal performance in concurrent applications is often obtained by having as much non-determinism as correctness allows\cit.
    1610
    1711\section{\protect\CFA 's Thread Building Blocks}
    18 One of the important features that is missing in C is threading. On modern architectures, a lack of threading is unacceptable\cite{Sutter05, Sutter05b}, and therefore modern programming languages must have the proper tools to allow users to write performant concurrent programs to take advantage of parallelism. As an extension of C, \CFA needs to express these concepts in a way that is as natural as possible to programmers familiar with imperative languages. And being a system-level language means programmers expect to choose precisely which features they need and which cost they are willing to pay.
     12One of the important features that is missing in C is threading. On modern architectures, a lack of threading is becoming less and less forgivable\cite{Sutter05, Sutter05b}, and therefore modern programming languages must have the proper tools to allow users to write performant concurrent and/or parallel programs. As an extension of C, \CFA needs to express these concepts in a way that is as natural as possible to programmers used to imperative languages. And being a system-level language means programmers expect to choose precisely which features they need and which cost they are willing to pay.
    1913
    2014\section{Coroutines: A stepping stone}\label{coroutine}
    21 While the main focus of this proposal is concurrency and parallelism, it is important to address coroutines, which are actually a significant building block of a concurrency system. Coroutines need to deal with context-switches and other context-management operations. Therefore, this proposal includes coroutines both as an intermediate step for the implementation of threads, and a first class feature of \CFA. Furthermore, many design challenges of threads are at least partially present in designing coroutines, which makes the design effort that much more relevant. The core \acrshort{api} of coroutines revolve around two features: independent call stacks and \code{suspend}/\code{resume}.
    22 
    23 \begin{figure}
    24 \begin{center}
    25 \begin{tabular}{c @{\hskip 0.025in}|@{\hskip 0.025in} c @{\hskip 0.025in}|@{\hskip 0.025in} c}
    26 \begin{ccode}[tabsize=2]
    27 //Using callbacks
    28 void fibonacci_func(
    29         int n,
    30         void (*callback)(int)
    31 ) {
    32         int first = 0;
    33         int second = 1;
    34         int next, i;
    35         for(i = 0; i < n; i++)
    36         {
    37                 if(i <= 1)
    38                         next = i;
    39                 else {
    40                         next = f1 + f2;
    41                         f1 = f2;
    42                         f2 = next;
     15While the main focus of this proposal is concurrency and parallelism, as mentionned above it is important to adress coroutines, which are actually a significant underlying aspect of a concurrency system. Indeed, while having nothing to do with parallelism and arguably little to do with concurrency, coroutines need to deal with context-switchs and other context-management operations. Therefore, this proposal includes coroutines both as an intermediate step for the implementation of threads, and a first class feature of \CFA. Furthermore, many design challenges of threads are at least partially present in designing coroutines, which makes the design effort that much more relevant. The core API of coroutines revolve around two features: independent call stacks and \code{suspend}/\code{resume}.
     16
     17Here is an example of a solution to the fibonnaci problem using \CFA coroutines:
     18\begin{cfacode}
     19        coroutine Fibonacci {
     20              int fn; // used for communication
     21        };
     22
     23        void ?{}(Fibonacci & this) { // constructor
     24              this.fn = 0;
     25        }
     26
     27        // main automacically called on first resume
     28        void main(Fibonacci & this) {
     29                int fn1, fn2;           // retained between resumes
     30                this.fn = 0;
     31                fn1 = this.fn;
     32                suspend(this);          // return to last resume
     33
     34                this.fn = 1;
     35                fn2 = fn1;
     36                fn1 = this.fn;
     37                suspend(this);          // return to last resume
     38
     39                for ( ;; ) {
     40                        this.fn = fn1 + fn2;
     41                        fn2 = fn1;
     42                        fn1 = this.fn;
     43                        suspend(this);  // return to last resume
    4344                }
    44                 callback(next);
    45         }
    46 }
    47 
    48 int main() {
    49         void print_fib(int n) {
    50                 printf("%d\n", n);
    51         }
    52 
    53         fibonacci_func(
    54                 10, print_fib
    55         );
    56 
    57 
    58 
    59 }
    60 \end{ccode}&\begin{ccode}[tabsize=2]
    61 //Using output array
    62 void fibonacci_array(
    63         int n,
    64         int * array
    65 ) {
    66         int f1 = 0; int f2 = 1;
    67         int next, i;
    68         for(i = 0; i < n; i++)
    69         {
    70                 if(i <= 1)
    71                         next = i;
    72                 else {
    73                         next = f1 + f2;
    74                         f1 = f2;
    75                         f2 = next;
     45        }
     46
     47        int next(Fibonacci & this) {
     48                resume(this); // transfer to last suspend
     49                return this.fn;
     50        }
     51
     52        void main() { // regular program main
     53                Fibonacci f1, f2;
     54                for ( int i = 1; i <= 10; i += 1 ) {
     55                        sout | next( f1 ) | next( f2 ) | endl;
    7656                }
    77                 array[i] = next;
    78         }
    79 }
    80 
    81 
    82 int main() {
    83         int a[10];
    84 
    85         fibonacci_func(
    86                 10, a
    87         );
    88 
    89         for(int i=0;i<10;i++){
    90                 printf("%d\n", a[i]);
    91         }
    92 
    93 }
    94 \end{ccode}&\begin{ccode}[tabsize=2]
    95 //Using external state
    96 typedef struct {
    97         int f1, f2;
    98 } Iterator_t;
    99 
    100 int fibonacci_state(
    101         Iterator_t * it
    102 ) {
    103         int f;
    104         f = it->f1 + it->f2;
    105         it->f2 = it->f1;
    106         it->f1 = max(f,1);
    107         return f;
    108 }
    109 
    110 
    111 
    112 
    113 
    114 
    115 
    116 int main() {
    117         Iterator_t it={0,0};
    118 
    119         for(int i=0;i<10;i++){
    120                 printf("%d\n",
    121                         fibonacci_state(
    122                                 &it
    123                         );
    124                 );
    125         }
    126 
    127 }
    128 \end{ccode}
    129 \end{tabular}
    130 \end{center}
    131 \caption{Different implementations of a fibonacci sequence generator in C.}
    132 \label{lst:fibonacci-c}
    133 \end{figure}
    134 
    135 A good example of a problem made easier with coroutines is generators, like the fibonacci sequence. This problem comes with the challenge of decoupling how a sequence is generated and how it is used. Figure \ref{lst:fibonacci-c} shows conventional approaches to writing generators in C. All three of these approach suffer from strong coupling. The left and center approaches require that the generator have knowledge of how the sequence is used, while the rightmost approach requires holding internal state between calls on behalf of the generator and makes it much harder to handle corner cases like the Fibonacci seed.
    136 
    137 Figure \ref{lst:fibonacci-cfa} is an example of a solution to the fibonnaci problem using \CFA coroutines, where the coroutine stack holds sufficient state for the generation. This solution has the advantage of having very strong decoupling between how the sequence is generated and how it is used. Indeed, this version is as easy to use as the \code{fibonacci_state} solution, while the imlpementation is very similar to the \code{fibonacci_func} example.
    138 
    139 \begin{figure}
    140 \begin{cfacode}
    141 coroutine Fibonacci {
    142         int fn; //used for communication
    143 };
    144 
    145 void ?{}(Fibonacci & this) { //constructor
    146         this.fn = 0;
    147 }
    148 
    149 //main automacically called on first resume
    150 void main(Fibonacci & this) with (this) {
    151         int fn1, fn2;           //retained between resumes
    152         fn  = 0;
    153         fn1 = fn;
    154         suspend(this);          //return to last resume
    155 
    156         fn  = 1;
    157         fn2 = fn1;
    158         fn1 = fn;
    159         suspend(this);          //return to last resume
    160 
    161         for ( ;; ) {
    162                 fn  = fn1 + fn2;
    163                 fn2 = fn1;
    164                 fn1 = fn;
    165                 suspend(this);  //return to last resume
    166         }
    167 }
    168 
    169 int next(Fibonacci & this) {
    170         resume(this); //transfer to last suspend
    171         return this.fn;
    172 }
    173 
    174 void main() { //regular program main
    175         Fibonacci f1, f2;
    176         for ( int i = 1; i <= 10; i += 1 ) {
    177                 sout | next( f1 ) | next( f2 ) | endl;
    178         }
    179 }
    180 \end{cfacode}
    181 \caption{Implementation of fibonacci using coroutines}
    182 \label{lst:fibonacci-cfa}
    183 \end{figure}
    184 
    185 Figure \ref{lst:fmt-line} shows the \code{Format} coroutine which rearranges text in order to group characters into blocks of fixed size. The example takes advantage of resuming coroutines in the constructor to simplify the code and highlights the idea that interesting control flow can occur in the constructor.
    186 
    187 \begin{figure}
    188 \begin{cfacode}[tabsize=3]
    189 //format characters into blocks of 4 and groups of 5 blocks per line
    190 coroutine Format {
    191         char ch;                                                                        //used for communication
    192         int g, b;                                                               //global because used in destructor
    193 };
    194 
    195 void  ?{}(Format & fmt) {
    196         resume( fmt );                                                  //prime (start) coroutine
    197 }
    198 
    199 void ^?{}(Format & fmt) with fmt {
    200         if ( fmt.g != 0 || fmt.b != 0 )
    201         sout | endl;
    202 }
    203 
    204 void main(Format & fmt) with fmt {
    205         for ( ;; ) {                                                    //for as many characters
    206                 for(g = 0; g < 5; g++) {                //groups of 5 blocks
    207                         for(b = 0; b < 4; fb++) {       //blocks of 4 characters
    208                                 suspend();
    209                                 sout | ch;                                      //print character
    210                         }
    211                         sout | "  ";                                    //print block separator
    212                 }
    213                 sout | endl;                                            //print group separator
    214         }
    215 }
    216 
    217 void prt(Format & fmt, char ch) {
    218         fmt.ch = ch;
    219         resume(fmt);
    220 }
    221 
    222 int main() {
    223         Format fmt;
    224         char ch;
    225         Eof: for ( ;; ) {                                               //read until end of file
    226                 sin | ch;                                                       //read one character
    227                 if(eof(sin)) break Eof;                 //eof ?
    228                 prt(fmt, ch);                                           //push character for formatting
    229         }
    230 }
    231 \end{cfacode}
    232 \caption{Formatting text into lines of 5 blocks of 4 characters.}
    233 \label{lst:fmt-line}
    234 \end{figure}
     57        }
     58\end{cfacode}
    23559
    23660\subsection{Construction}
    237 One important design challenge for coroutines and threads (shown in section \ref{threads}) is that the runtime system needs to run code after the user-constructor runs to connect the fully constructed object into the system. In the case of coroutines, this challenge is simpler since there is no non-determinism from preemption or scheduling. However, the underlying challenge remains the same for coroutines and threads.
    238 
    239 The runtime system needs to create the coroutine's stack and more importantly prepare it for the first resumption. The timing of the creation is non-trivial since users both expect to have fully constructed objects once execution enters the coroutine main and to be able to resume the coroutine from the constructor. As regular objects, constructors can leak coroutines before they are ready. There are several solutions to this problem but the chosen options effectively forces the design of the coroutine.
     61One important design challenge for coroutines and threads (shown in section \ref{threads}) is that the runtime system needs to run code after the user-constructor runs. In the case of coroutines, this challenge is simpler since there is no non-determinism from preemption or scheduling. However, the underlying challenge remains the same for coroutines and threads.
     62
     63The runtime system needs to create the coroutine's stack and more importantly prepare it for the first resumption. The timing of the creation is non-trivial since users both expect to have fully constructed objects once execution enters the coroutine main and to be able to resume the coroutine from the constructor. Like for regular objects, constructors can still leak coroutines before they are ready. There are several solutions to this problem but the chosen options effectively forces the design of the coroutine.
    24064
    24165Furthermore, \CFA faces an extra challenge as polymorphic routines create invisible thunks when casted to non-polymorphic routines and these thunks have function scope. For example, the following code, while looking benign, can run into undefined behaviour because of thunks:
     
    24771
    24872forall(otype T)
    249 void noop(T*) {}
     73void noop(T *) {}
    25074
    25175void bar() {
    25276        int a;
    253         async(noop, &a); //start thread running noop with argument a
    254 }
    255 \end{cfacode}
    256 
     77        async(noop, &a);
     78}
     79\end{cfacode}
    25780The generated C code\footnote{Code trimmed down for brevity} creates a local thunk to hold type information:
    25881
     
    27295}
    27396\end{ccode}
    274 The problem in this example is a storage management issue, the function pointer \code{_thunk0} is only valid until the end of the block, which limits the viable solutions because storing the function pointer for too long causes undefined behavior; i.e., the stack-based thunk being destroyed before it can be used. This challenge is an extension of challenges that come with second-class routines. Indeed, GCC nested routines also have the limitation that nested routine cannot be passed outside of the declaration scope. The case of coroutines and threads is simply an extension of this problem to multiple call-stacks.
     97The problem in this example is a race condition between the start of the execution of \code{noop} on the other thread and the stack frame of \code{bar} being destroyed. This extra challenge limits which solutions are viable because storing the function pointer for too long only increases the chances that the race will end in undefined behavior; i.e. the stack based thunk being destroyed before it was used. This challenge is an extension of challenges that come with second-class routines. Indeed, GCC nested routines also have the limitation that the routines cannot be passed outside of the scope of the functions these were declared in. The case of coroutines and threads is simply an extension of this problem to multiple call-stacks.
    27598
    27699\subsection{Alternative: Composition}
    277 One solution to this challenge is to use composition/containement, where coroutine fields are added to manage the coroutine.
    278 
    279 \begin{cfacode}
    280 struct Fibonacci {
    281         int fn; //used for communication
    282         coroutine c; //composition
    283 };
    284 
    285 void FibMain(void *) {
    286         //...
    287 }
    288 
    289 void ?{}(Fibonacci & this) {
    290         this.fn = 0;
    291         //Call constructor to initialize coroutine
    292         (this.c){myMain};
    293 }
    294 \end{cfacode}
    295 The downside of this approach is that users need to correctly construct the coroutine handle before using it. Like any other objects, doing so the users carefully choose construction order to prevent usage of unconstructed objects. However, in the case of coroutines, users must also pass to the coroutine information about the coroutine main, like in the previous example. This opens the door for user errors and requires extra runtime storage to pass at runtime information that can be known statically.
     100One solution to this challenge would be to use composition/containement,
     101
     102\begin{cfacode}
     103        struct Fibonacci {
     104              int fn; // used for communication
     105              coroutine c; //composition
     106        };
     107
     108        void ?{}(Fibonacci & this) {
     109              this.fn = 0;
     110                (this.c){};
     111        }
     112\end{cfacode}
     113There are two downsides to this approach. The first, which is relatively minor, is that the base class needs to be made aware of the main routine pointer, regardless of whether a parameter or a virtual pointer is used, this means the coroutine data must be made larger to store a value that is actually a compile time constant (address of the main routine). The second problem, which is both subtle and significant, is that now users can get the initialisation order of there coroutines wrong. Indeed, every field of a \CFA struct is constructed but in declaration order, unless users explicitly write otherwise. This semantics means that users who forget to initialize a the coroutine may resume the coroutine with an uninitilized object. For coroutines, this is unlikely to be a problem, for threads however, this is a significant problem.
    296114
    297115\subsection{Alternative: Reserved keyword}
     
    299117
    300118\begin{cfacode}
    301 coroutine Fibonacci {
    302         int fn; //used for communication
    303 };
    304 \end{cfacode}
    305 The \code{coroutine} keyword means the compiler can find and inject code where needed. The downside of this approach is that it makes coroutine a special case in the language. Users wantint to extend coroutines or build their own for various reasons can only do so in ways offered by the language. Furthermore, implementing coroutines without language supports also displays the power of the programming language used. While this is ultimately the option used for idiomatic \CFA code, coroutines and threads can still be constructed by users without using the language support. The reserved keywords are only present to improve ease of use for the common cases.
     119        coroutine Fibonacci {
     120              int fn; // used for communication
     121        };
     122\end{cfacode}
     123This mean the compiler can solve problems by injecting code where needed. The downside of this approach is that it makes coroutine a special case in the language. Users who would want to extend coroutines or build their own for various reasons can only do so in ways offered by the language. Furthermore, implementing coroutines without language supports also displays the power of \CFA.
     124While this is ultimately the option used for idiomatic \CFA code, coroutines and threads can both be constructed by users without using the language support. The reserved keywords are only present to improve ease of use for the common cases.
    306125
    307126\subsection{Alternative: Lamda Objects}
     
    316135Often, the canonical threading paradigm in languages is based on function pointers, pthread being one of the most well known examples. The main problem of this approach is that the thread usage is limited to a generic handle that must otherwise be wrapped in a custom type. Since the custom type is simple to write in \CFA and solves several issues, added support for routine/lambda based coroutines adds very little.
    317136
    318 A variation of this would be to use a simple function pointer in the same way pthread does for threads :
     137A variation of this would be to use an simple function pointer in the same way pthread does for threads :
    319138\begin{cfacode}
    320139void foo( coroutine_t cid, void * arg ) {
     
    329148}
    330149\end{cfacode}
    331 This semantics is more common for thread interfaces than coroutines works equally well. As discussed in section \ref{threads}, this approach is superseeded by static approaches in terms of expressivity.
     150This semantic is more common for thread interfaces than coroutines but would work equally well. As discussed in section \ref{threads}, this approach is superseeded by static approaches in terms of expressivity.
    332151
    333152\subsection{Alternative: Trait-based coroutines}
     
    340159      coroutine_desc * get_coroutine(T & this);
    341160};
    342 
    343 forall( dtype T | is_coroutine(T) ) void suspend(T &);
    344 forall( dtype T | is_coroutine(T) ) void resume (T &);
    345 \end{cfacode}
    346 This ensures an object is not a coroutine until \code{resume} is called on the object. Correspondingly, any object that is passed to \code{resume} is a coroutine since it must satisfy the \code{is_coroutine} trait to compile. The advantage of this approach is that users can easily create different types of coroutines, for example, changing the memory layout of a coroutine is trivial when implementing the \code{get_coroutine} routine. The \CFA keyword \code{coroutine} only has the effect of implementing the getter and forward declarations required for users to only have to implement the main routine.
     161\end{cfacode}
     162This ensures an object is not a coroutine until \code{resume} (or \code{prime}) is called on the object. Correspondingly, any object that is passed to \code{resume} is a coroutine since it must satisfy the \code{is_coroutine} trait to compile. The advantage of this approach is that users can easily create different types of coroutines, for example, changing the memory foot print of a coroutine is trivial when implementing the \code{get_coroutine} routine. The \CFA keyword \code{coroutine} only has the effect of implementing the getter and forward declarations required for users to only have to implement the main routine.
    347163
    348164\begin{center}
     
    370186\end{center}
    371187
    372 The combination of these two approaches allows users new to coroutinning and concurrency to have an easy and concise specification, while more advanced users have tighter control on memory layout and initialization.
     188The combination of these two approaches allows users new to concurrency to have a easy and concise method while more advanced users can expose themselves to otherwise hidden pitfalls at the benefit of tighter control on memory layout and initialization.
    373189
    374190\section{Thread Interface}\label{threads}
     
    376192
    377193\begin{cfacode}
    378 thread foo {};
     194        thread foo {};
    379195\end{cfacode}
    380196
     
    389205\end{cfacode}
    390206
    391 Obviously, for this thread implementation to be usefull it must run some user code. Several other threading interfaces use a function-pointer representation as the interface of threads (for example \Csharp~\cite{Csharp} and Scala~\cite{Scala}). However, this proposal considers that statically tying a \code{main} routine to a thread superseeds this approach. Since the \code{main} routine is already a special routine in \CFA (where the program begins), it is a natural extension of the semantics using overloading to declare mains for different threads (the normal main being the main of the initial thread). As such the \code{main} routine of a thread can be defined as
    392 \begin{cfacode}
    393 thread foo {};
    394 
    395 void main(foo & this) {
    396         sout | "Hello World!" | endl;
    397 }
    398 \end{cfacode}
    399 
    400 In this example, threads of type \code{foo} start execution in the \code{void main(foo &)} routine, which prints \code{"Hello World!"}. While this thesis encourages this approach to enforce strongly-typed programming, users may prefer to use the routine-based thread semantics for the sake of simplicity. With the static semantics it is trivial to write a thread type that takes a function pointer as a parameter and executes it on its stack asynchronously.
    401 \begin{cfacode}
    402 typedef void (*voidFunc)(int);
    403 
    404 thread FuncRunner {
    405         voidFunc func;
    406         int arg;
    407 };
    408 
    409 void ?{}(FuncRunner & this, voidFunc inFunc, int arg) {
    410         this.func = inFunc;
    411         this.arg  = arg;
    412 }
    413 
    414 void main(FuncRunner & this) {
    415         //thread starts here and runs the function
    416         this.func( this.arg );
    417 }
    418 \end{cfacode}
    419 
    420 A consequence of the strongly-typed approach to main is that memory layout of parameters and return values to/from a thread are now explicitly specified in the \acrshort{api}.
    421 
    422 Of course for threads to be useful, it must be possible to start and stop threads and wait for them to complete execution. While using an \acrshort{api} such as \code{fork} and \code{join} is relatively common in the literature, such an interface is unnecessary. Indeed, the simplest approach is to use \acrshort{raii} principles and have threads \code{fork} after the constructor has completed and \code{join} before the destructor runs.
     207Obviously, for this thread implementation to be usefull it must run some user code. Several other threading interfaces use a function-pointer representation as the interface of threads (for example \Csharp~\cite{Csharp} and Scala~\cite{Scala}). However, this proposal considers that statically tying a \code{main} routine to a thread superseeds this approach. Since the \code{main} routine is already a special routine in \CFA (where the program begins), it is possible naturally extend the semantics using overloading to declare mains for different threads (the normal main being the main of the initial thread). As such the \code{main} routine of a thread can be defined as
     208\begin{cfacode}
     209        thread foo {};
     210
     211        void main(foo & this) {
     212                sout | "Hello World!" | endl;
     213        }
     214\end{cfacode}
     215
     216In this example, threads of type \code{foo} start execution in the \code{void main(foo*)} routine which prints \code{"Hello World!"}. While this proposoal encourages this approach to enforce strongly-typed programming, users may prefer to use the routine based thread semantics for the sake of simplicity. With these semantics it is trivial to write a thread type that takes a function pointer as parameter and executes it on its stack asynchronously
     217\begin{cfacode}
     218        typedef void (*voidFunc)(void);
     219
     220        thread FuncRunner {
     221                voidFunc func;
     222        };
     223
     224        //ctor
     225        void ?{}(FuncRunner & this, voidFunc inFunc) {
     226                this.func = inFunc;
     227        }
     228
     229        //main
     230        void main(FuncRunner & this) {
     231                this.func();
     232        }
     233\end{cfacode}
     234
     235An advantage of the overloading approach to main is to clearly highlight where and what memory is required to pass parameters and return values to/from a thread.
     236
     237Of course for threads to be useful, it must be possible to start and stop threads and wait for them to complete execution. While using an \acrshort{api} such as \code{fork} and \code{join} is relatively common in the literature, such an interface is unnecessary. Indeed, the simplest approach is to use \acrshort{raii} principles and have threads \code{fork} once the constructor has completed and \code{join} before the destructor runs.
    423238\begin{cfacode}
    424239thread World;
     
    439254\end{cfacode}
    440255
    441 This semantic has several advantages over explicit semantics: a thread is always started and stopped exaclty once, users cannot make any progamming errors, and it naturally scales to multiple threads meaning basic synchronisation is very simple.
     256This semantic has several advantages over explicit semantics typesafety is guaranteed, a thread is always started and stopped exaclty once and users cannot make any progamming errors. Another advantage of this semantic is that it naturally scale to multiple threads meaning basic synchronisation is very simple
    442257
    443258\begin{cfacode}
     
    461276\end{cfacode}
    462277
    463 However, one of the drawbacks of this approach is that threads now always form a lattice, that is they are always destroyed in the opposite order of construction because of block structure. This restriction is relaxed by using dynamic allocation, so threads can outlive the scope in which they are created, much like dynamically allocating memory lets objects outlive the scope in which they are created.
     278However, one of the apparent drawbacks of this system is that threads now always form a lattice, that is they are always destroyed in opposite order of construction because of block structure. However, storage allocation is not limited to blocks; dynamic allocation can create threads that outlive the scope in which the thread is created much like dynamically allocating memory lets objects outlive the scope in which they are created
    464279
    465280\begin{cfacode}
     
    468283};
    469284
     285//main
    470286void main(MyThread & this) {
    471287        //...
     
    475291        MyThread * long_lived;
    476292        {
     293                MyThread short_lived;
    477294                //Start a thread at the beginning of the scope
    478                 MyThread short_lived;
     295
     296                DoStuff();
    479297
    480298                //create another thread that will outlive the thread in this scope
    481299                long_lived = new MyThread;
    482300
    483                 DoStuff();
    484 
    485301                //Wait for the thread short_lived to finish
    486302        }
    487303        DoMoreStuff();
    488304
    489         //Now wait for the long_lived to finish
     305        //Now wait for the short_lived to finish
    490306        delete long_lived;
    491307}
  • doc/proposals/concurrency/text/cforall.tex

    r3f7e12cb r78315272  
    11% ======================================================================
    22% ======================================================================
    3 \chapter{Cforall Overview}
     3\chapter{Cforall crash course}
    44% ======================================================================
    55% ======================================================================
    66
    7 The following is a quick introduction to the \CFA language, specifically tailored to the features needed to support concurrency.
     7As mentionned in the introduction, the document presents the design for the concurrency features in \CFA. Since it is a new language here is a quick review of the language specifically tailored to the features needed to support concurrency.
    88
    9 \CFA is a extension of ISO-C and therefore supports all of the same paradigms as C. It is a non-object oriented system language, meaning most of the major abstractions have either no runtime overhead or can be opt-out easily. Like C, the basics of \CFA revolve around structures and routines, which are thin abstractions over machine code. The vast majority of the code produced by the \CFA translator respects memory-layouts and calling-conventions laid out by C. Interestingly, while \CFA is not an object-oriented language, lacking the concept of a receiver (e.g., this), it does have some notion of objects\footnote{C defines the term objects as : ``region of data storage in the execution environment, the contents of which can represent
    10 values''\cite[3.15]{C11}}, most importantly construction and destruction of objects. Most of the following code examples can be found on the \CFA website \cite{www-cfa}
     9\CFA is a extension of ISO C and therefore supports much of the same paradigms as C. It is a non-object oriented system level language, meaning it has very most of the major abstractions have either no runtime cost or can be opt-out easily. Like C, the basics of \CFA revolve around structures and routines, which are thin abstractions over assembly. The vast majority of the code produced by a \CFA compiler respects memory-layouts and calling-conventions laid out by C. However, while \CFA is not an object-oriented language according to a strict definition. It does have some notion of objects, most importantly construction and destruction of objects. Most of the following pieces of code can be found as is on the \CFA website : \cite{www-cfa}
    1110
    1211\section{References}
    1312
    14 Like \CC, \CFA introduces rebindable references providing multiple dereferecing as an alternative to pointers. In regards to concurrency, the semantic difference between pointers and references are not particularly relevant, but since this document uses mostly references, here is a quick overview of the semantics:
     13Like \CC, \CFA introduces references as an alternative to pointers. In regards to concurrency, the semantics difference between pointers and references aren't particularly relevant but since this document uses mostly references here is a quick overview of the semantics :
    1514\begin{cfacode}
    1615int x, *p1 = &x, **p2 = &p1, ***p3 = &p2,
    17         &r1 = x,    &&r2 = r1,   &&&r3 = r2;
    18 ***p3 = 3;                                                      //change x
    19 r3    = 3;                                                      //change x, ***r3
    20 **p3  = ...;                                            //change p1
    21 *p3   = ...;                                            //change p2
    22 int y, z, & ar[3] = {x, y, z};          //initialize array of references
    23 typeof( ar[1]) p;                                       //is int, i.e., the type of referenced object
    24 typeof(&ar[1]) q;                                       //is int &, i.e., the type of reference
    25 sizeof( ar[1]) == sizeof(int);          //is true, i.e., the size of referenced object
    26 sizeof(&ar[1]) == sizeof(int *);        //is true, i.e., the size of a reference
     16&r1 = x,    &&r2 = r1,   &&&r3 = r2;
     17***p3 = 3;                                      // change x
     18r3 = 3;                                         // change x, ***r3
     19**p3 = ...;                                     // change p1
     20&r3 = ...;                                      // change r1, (&*)**r3
     21*p3 = ...;                                      // change p2
     22&&r3 = ...;                                     // change r2, (&(&*)*)*r3
     23&&&r3 = p3;                                     // change r3 to p3, (&(&(&*)*)*)r3
     24int y, z, & ar[3] = { x, y, z };                // initialize array of references
     25&ar[1] = &z;                                    // change reference array element
     26typeof( ar[1] ) p;                              // is int, i.e., the type of referenced object
     27typeof( &ar[1] ) q;                             // is int &, i.e., the type of reference
     28sizeof( ar[1] ) == sizeof( int );               // is true, i.e., the size of referenced object
     29sizeof( &ar[1] ) == sizeof( int *);             // is true, i.e., the size of a reference
    2730\end{cfacode}
    28 The important take away from this code example is that references offer a handle to an object, much like pointers, but which is automatically dereferenced for convinience.
     31The important thing to take away from this code snippet is that references offer a handle to an object much like pointers but which is automatically derefferenced when convinient.
    2932
    3033\section{Overloading}
    3134
    32 Another important feature of \CFA is function overloading as in Java and \CC, where routines with the same name are selected based on the number and type of the arguments. As well, \CFA uses the return type as part of the selection criteria, as in Ada\cite{Ada}. For routines with multiple parameters and returns, the selection is complex.
     35Another important feature \CFA has in common with \CC is function overloading :
    3336\begin{cfacode}
    34 //selection based on type and number of parameters
    35 void f(void);                   //(1)
    36 void f(char);                   //(2)
    37 void f(int, double);    //(3)
    38 f();                                    //select (1)
    39 f('a');                                 //select (2)
    40 f(3, 5.2);                              //select (3)
     37// selection based on type and number of parameters
     38void f( void );                                 // (1)
     39void f( char );                                 // (2)
     40void f( int, double );                          // (3)
     41f();                                            // select (1)
     42f( 'a' );                                       // select (2)
     43f( 3, 5.2 );                                    // select (3)
    4144
    42 //selection based on  type and number of returns
    43 char   f(int);                  //(1)
    44 double f(int);                  //(2)
    45 char   c = f(3);                //select (1)
    46 double d = f(4);                //select (2)
     45// selection based on  type and number of returns
     46char f( int );                                  // (1)
     47double f( int );                                // (2)
     48[ int, double ] f( int );                       // (3)
     49char c = f( 3 );                                // select (1)
     50double d = f( 4 );                              // select (2)
     51[ int, double ] t = f( 5 );                     // select (3)
    4752\end{cfacode}
    48 This feature is particularly important for concurrency since the runtime system relies on creating different types to represent concurrency objects. Therefore, overloading is necessary to prevent the need for long prefixes and other naming conventions that prevent name clashes. As seen in chapter \ref{basics}, routine \code{main} is an example that benefits from overloading.
     53This feature is particularly important for concurrency since the runtime system relies on creating different types do represent concurrency objects. Therefore, overloading is necessary to prevent the need for long prefixes and other naming conventions that prevent clashes. As seen in chapter \ref{basics}, the main is an example of routine that benefits from overloading when concurrency in introduced.
    4954
    5055\section{Operators}
    51 Overloading also extends to operators. The syntax for denoting operator-overloading is to name a routine with the symbol of the operator and question marks where the arguments of the operation occur, e.g.:
     56Overloading also extends to operators. The syntax for denoting operator-overloading is to name a routine with the symbol of the operator and question marks where the arguments of the operation would be, like so :
    5257\begin{cfacode}
    53 int ++? (int op);                       //unary prefix increment
    54 int ?++ (int op);                       //unary postfix increment
    55 int ?+? (int op1, int op2);             //binary plus
    56 int ?<=?(int op1, int op2);             //binary less than
    57 int ?=? (int & op1, int op2);           //binary assignment
    58 int ?+=?(int & op1, int op2);           //binary plus-assignment
     58int ++?( int op );                              // unary prefix increment
     59int ?++( int op );                              // unary postfix increment
     60int ?+?( int op1, int op2 );                    // binary plus
     61int ?<=?( int op1, int op2 );                   // binary less than
     62int ?=?( int & op1, int op2 );                  // binary assignment
     63int ?+=?( int & op1, int op2 );                 // binary plus-assignment
    5964
    60 struct S {int i, j;};
    61 S ?+?(S op1, S op2) {                           //add two structures
    62         return (S){op1.i + op2.i, op1.j + op2.j};
     65struct S { int i, j; };
     66S ?+?( S op1, S op2 ) {                         // add two structures
     67        return (S){ op1.i + op2.i, op1.j + op2.j };
    6368}
    64 S s1 = {1, 2}, s2 = {2, 3}, s3;
    65 s3 = s1 + s2;                                           //compute sum: s3 == {2, 5}
     69S s1 = { 1, 2 }, s2 = { 2, 3 }, s3;
     70s3 = s1 + s2;                                   // compute sum: s3 == { 2, 5 }
    6671\end{cfacode}
    67 While concurrency does not use operator overloading directly, this feature is more important as an introduction for the syntax of constructors.
     72
     73Since concurrency does not use operator overloading, this feature is more important as an introduction for the syntax of constructors.
    6874
    6975\section{Constructors/Destructors}
    70 Object life-time is often a challenge in concurrency. \CFA uses the approach of giving concurrent meaning to object life-time as a mean of synchronization and/or mutual exclusion. Since \CFA relies heavily on the life time of objects, constructors and destructors are a core feature required for concurrency and parallelism. \CFA uses the following syntax for constructors and destructors :
     76\CFA uses the following syntax for constructors and destructors :
    7177\begin{cfacode}
    7278struct S {
     
    7480        int * ia;
    7581};
    76 void ?{}(S & s, int asize) {    //constructor operator
    77         s.size = asize;                         //initialize fields
    78         s.ia = calloc(size, sizeof(S));
     82void ?{}( S & s, int asize ) with s {           // constructor operator
     83        size = asize;                           // initialize fields
     84        ia = calloc( size, sizeof( S ) );
    7985}
    80 void ^?{}(S & s) {                              //destructor operator
    81         free(ia);                                       //de-initialization fields
     86void ^?{}( S & s ) with s {                     // destructor operator
     87        free( ia );                             // de-initialization fields
    8288}
    8389int main() {
    84         S x = {10}, y = {100};          //implict calls: ?{}(x, 10), ?{}(y, 100)
    85         ...                                                     //use x and y
    86         ^x{};  ^y{};                            //explicit calls to de-initialize
    87         x{20};  y{200};                         //explicit calls to reinitialize
    88         ...                                                     //reuse x and y
    89 }                                                               //implict calls: ^?{}(y), ^?{}(x)
     90        S x = { 10 }, y = { 100 };              // implict calls: ?{}( x, 10 ), ?{}( y, 100 )
     91        ...                                     // use x and y
     92        ^x{};  ^y{};                            // explicit calls to de-initialize
     93        x{ 20 };  y{ 200 };                     // explicit calls to reinitialize
     94        ...                                     // reuse x and y
     95}                                               // implict calls: ^?{}( y ), ^?{}( x )
    9096\end{cfacode}
    91 The language guarantees that every object and all their fields are constructed. Like \CC, construction of an object is automatically done on allocation and destruction of the object is done on deallocation. Allocation and deallocation can occur on the stack or on the heap.
    92 \begin{cfacode}
    93 {
    94         struct S s = {10};      //allocation, call constructor
    95         ...
    96 }                                               //deallocation, call destructor
    97 struct S * s = new();   //allocation, call constructor
    98 ...
    99 delete(s);                              //deallocation, call destructor
    100 \end{cfacode}
    101 Note that like \CC, \CFA introduces \code{new} and \code{delete}, which behave like \code{malloc} and \code{free} in addition to constructing and destructing objects, after calling \code{malloc} and before calling \code{free} respectively.
     97The language guarantees that every object and all their fields are constructed. Like \CC construction is automatically done on declaration and destruction done when the declared variables reach the end of its scope.
    10298
    103 \section{Parametric Polymorphism}
    104 Routines in \CFA can also be reused for multiple types. This capability is done using the \code{forall} clause which gives \CFA its name. \code{forall} clauses allow separately compiled routines to support generic usage over multiple types. For example, the following sum function works for any type that supports construction from 0 and addition :
    105 \begin{cfacode}
    106 //constraint type, 0 and +
    107 forall(otype T | { void ?{}(T *, zero_t); T ?+?(T, T); })
    108 T sum(T a[ ], size_t size) {
    109         T total = 0;                            //construct T from 0
    110         for(size_t i = 0; i < size; i++)
    111                 total = total + a[i];   //select appropriate +
    112         return total;
    113 }
    114 
    115 S sa[5];
    116 int i = sum(sa, 5);                             //use S's 0 construction and +
    117 \end{cfacode}
    118 
    119 Since writing constraints on types can become cumbersome for more constrained functions, \CFA also has the concept of traits. Traits are named collection of constraints that can be used both instead and in addition to regular constraints:
    120 \begin{cfacode}
    121 trait sumable( otype T ) {
    122         void ?{}(T *, zero_t);          //constructor from 0 literal
    123         T ?+?(T, T);                            //assortment of additions
    124         T ?+=?(T *, T);
    125         T ++?(T *);
    126         T ?++(T *);
    127 };
    128 forall( otype T | sumable(T) )  //use trait
    129 T sum(T a[], size_t size);
    130 \end{cfacode}
    131 
    132 \section{with Clause/Statement}
    133 Since \CFA lacks the concept of a receiver, certain functions end-up needing to repeat variable names often. To remove this inconvenience, \CFA provides the \code{with} statement, which opens an aggregate scope making its fields directly accessible (like Pascal).
    134 \begin{cfacode}
    135 struct S { int i, j; };
    136 int mem(S & this) with (this)           //with clause
    137         i = 1;                                          //this->i
    138         j = 2;                                          //this->j
    139 }
    140 int foo() {
    141         struct S1 { ... } s1;
    142         struct S2 { ... } s2;
    143         with (s1)                                       //with statement
    144         {
    145                 //access fields of s1
    146                 //without qualification
    147                 with (s2)                                       //nesting
    148                 {
    149                         //access fields of s1 and s2
    150                         //without qualification
    151                 }
    152         }
    153         with (s1, s2)                           //scopes open in parallel
    154         {
    155                 //access fields of s1 and s2
    156                 //without qualification
    157         }
    158 }
    159 \end{cfacode}
    160 
    161 For more information on \CFA see \cite{cforall-ug,rob-thesis,www-cfa}.
     99For more information see \cite{cforall-ug,rob-thesis,www-cfa}.
  • doc/proposals/concurrency/text/concurrency.tex

    r3f7e12cb r78315272  
    44% ======================================================================
    55% ======================================================================
    6 Several tool can be used to solve concurrency challenges. Since many of these challenges appear with the use of mutable shared-state, some languages and libraries simply disallow mutable shared-state (Erlang~\cite{Erlang}, Haskell~\cite{Haskell}, Akka (Scala)~\cite{Akka}). In these paradigms, interaction among concurrent objects relies on message passing~\cite{Thoth,Harmony,V-Kernel} or other paradigms closely relate to networking concepts (channels\cite{CSP,Go} for example). However, in languages that use routine calls as their core abstraction-mechanism, these approaches force a clear distinction between concurrent and non-concurrent paradigms (i.e., message passing versus routine call). This distinction in turn means that, in order to be effective, programmers need to learn two sets of designs patterns. While this distinction can be hidden away in library code, effective use of the librairy still has to take both paradigms into account.
     6Several tool can be used to solve concurrency challenges. Since many of these challenges appear with the use of mutable shared-state, some languages and libraries simply disallow mutable shared-state (Erlang~\cite{Erlang}, Haskell~\cite{Haskell}, Akka (Scala)~\cite{Akka}). In these paradigms, interaction among concurrent objects relies on message passing~\cite{Thoth,Harmony,V-Kernel} or other paradigms that closely relate to networking concepts (channels\cit for example). However, in languages that use routine calls as their core abstraction-mechanism, these approaches force a clear distinction between concurrent and non-concurrent paradigms (i.e., message passing versus routine call). This distinction in turn means that, in order to be effective, programmers need to learn two sets of designs patterns. While this distinction can be hidden away in library code, effective use of the librairy still has to take both paradigms into account.
    77
    88Approaches based on shared memory are more closely related to non-concurrent paradigms since they often rely on basic constructs like routine calls and shared objects. At the lowest level, concurrent paradigms are implemented as atomic operations and locks. Many such mechanisms have been proposed, including semaphores~\cite{Dijkstra68b} and path expressions~\cite{Campbell74}. However, for productivity reasons it is desireable to have a higher-level construct be the core concurrency paradigm~\cite{HPP:Study}.
    99
    10 An approach that is worth mentioning because it is gaining in popularity is transactionnal memory~\cite{Dice10}[Check citation]. While this approach is even pursued by system languages like \CC\cit, the performance and feature set is currently too restrictive to be the main concurrency paradigm for systems language, which is why it was rejected as the core paradigm for concurrency in \CFA.
    11 
    12 One of the most natural, elegant, and efficient mechanisms for synchronization and communication, especially for shared-memory systems, is the \emph{monitor}. Monitors were first proposed by Brinch Hansen~\cite{Hansen73} and later described and extended by C.A.R.~Hoare~\cite{Hoare74}. Many programming languages---e.g., Concurrent Pascal~\cite{ConcurrentPascal}, Mesa~\cite{Mesa}, Modula~\cite{Modula-2}, Turing~\cite{Turing:old}, Modula-3~\cite{Modula-3}, NeWS~\cite{NeWS}, Emerald~\cite{Emerald}, \uC~\cite{Buhr92a} and Java~\cite{Java}---provide monitors as explicit language constructs. In addition, operating-system kernels and device drivers have a monitor-like structure, although they often use lower-level primitives such as semaphores or locks to simulate monitors. For these reasons, this project proposes monitors as the core concurrency-construct.
     10An approach that is worth mentionning because it is gaining in popularity is transactionnal memory~\cite{Dice10}[Check citation]. While this approach is even pursued by system languages like \CC\cit, the performance and feature set is currently too restrictive to be the main concurrency paradigm for general purpose language, which is why it was rejected as the core paradigm for concurrency in \CFA.
     11
     12One of the most natural, elegant, and efficient mechanisms for synchronization and communication, especially for shared memory systems, is the \emph{monitor}. Monitors were first proposed by Brinch Hansen~\cite{Hansen73} and later described and extended by C.A.R.~Hoare~\cite{Hoare74}. Many programming languages---e.g., Concurrent Pascal~\cite{ConcurrentPascal}, Mesa~\cite{Mesa}, Modula~\cite{Modula-2}, Turing~\cite{Turing:old}, Modula-3~\cite{Modula-3}, NeWS~\cite{NeWS}, Emerald~\cite{Emerald}, \uC~\cite{Buhr92a} and Java~\cite{Java}---provide monitors as explicit language constructs. In addition, operating-system kernels and device drivers have a monitor-like structure, although they often use lower-level primitives such as semaphores or locks to simulate monitors. For these reasons, this project proposes monitors as the core concurrency-construct.
    1313
    1414\section{Basics}
    15 Non-determinism requires concurrent systems to offer support for mutual-exclusion and synchronisation. Mutual-exclusion is the concept that only a fixed number of threads can access a critical section at any given time, where a critical section is a group of instructions on an associated portion of data that requires the restricted access. On the other hand, synchronization enforces relative ordering of execution and synchronization tools provide numerous mechanisms to establish timing relationships among threads.
     15Non-determinism requires concurrent systems to offer support for mutual-exclusion and synchronisation. Mutual-exclusion is the concept that only a fixed number of threads can access a critical section at any given time, where a critical section is a group of instructions on an associated portion of data that requires the restricted access. On the other hand, synchronization enforces relative ordering of execution and synchronization tools numerous mechanisms to establish timing relationships among threads.
    1616
    1717\subsection{Mutual-Exclusion}
    18 As mentionned above, mutual-exclusion is the guarantee that only a fix number of threads can enter a critical section at once. However, many solutions exist for mutual exclusion, which vary in terms of performance, flexibility and ease of use. Methods range from low-level locks, which are fast and flexible but require significant attention to be correct, to  higher-level mutual-exclusion methods, which sacrifice some performance in order to improve ease of use. Ease of use comes by either guaranteeing some problems cannot occur (e.g., being deadlock free) or by offering a more explicit coupling between data and corresponding critical section. For example, the \CC \code{std::atomic<T>} offers an easy way to express mutual-exclusion on a restricted set of operations (e.g.: reading/writing large types atomically). Another challenge with low-level locks is composability. Locks have restricted composability because it takes careful organising for multiple locks to be used while preventing deadlocks. Easing composability is another feature higher-level mutual-exclusion mechanisms often offer.
     18As mentionned above, mutual-exclusion is the guarantee that only a fix number of threads can enter a critical section at once. However, many solution exists for mutual exclusion which vary in terms of performance, flexibility and ease of use. Methods range from low-level locks, which are fast and flexible but require significant attention to be correct, to  higher-level mutual-exclusion methods, which sacrifice some performance in order to improve ease of use. Ease of use comes by either guaranteeing some problems cannot occur (e.g., being deadlock free) or by offering a more explicit coupling between data and corresponding critical section. For example, the \CC \code{std::atomic<T>} which offer an easy way to express mutual-exclusion on a restricted set of operations (.e.g: reading/writing large types atomically). Another challenge with low-level locks is composability. Locks are not composable because it takes careful organising for multiple locks to be used while preventing deadlocks. Easing composability is another feature higher-level mutual-exclusion mechanisms often offer.
    1919
    2020\subsection{Synchronization}
    21 As for mutual-exclusion, low-level synchronisation primitives often offer good performance and good flexibility at the cost of ease of use. Again, higher-level mechanism often simplify usage by adding better coupling between synchronization and data, e.g.: message passing, or offering simpler solution to otherwise involved challenges. As mentioned above, synchronization can be expressed as guaranteeing that event \textit{X} always happens before \textit{Y}. Most of the time, synchronisation happens within a critical section, where threads must acquire mutual-exclusion in a certain order. However, it may also be desirable to guarantee that event \textit{Z} does not occur between \textit{X} and \textit{Y}. Not satisfying this property called barging. For example, where event \textit{X} tries to effect event \textit{Y} but another thread acquires the critical section and emits \textit{Z} before \textit{Y}. The classic exmaple is the thread that finishes using a ressource and unblocks a thread waiting to use the resource, but the unblocked thread must compete again to acquire the resource. Preventing or detecting barging is an involved challenge with low-level locks, which can be made much easier by higher-level constructs. This challenge is often split into two different methods, barging avoidance and barging prevention. Algorithms that use status flags and other flag variables to detect barging threads are said to be using barging avoidance while algorithms that baton-passing locks between threads instead of releasing the locks are said to be using barging prevention.
     21As for mutual-exclusion, low level synchronisation primitive often offer good performance and good flexibility at the cost of ease of use. Again, higher-level mechanism often simplify usage by adding better coupling between synchronization and data, .eg., message passing, or offering simple solution to otherwise involved challenges. An example of this is barging. As mentionned above synchronization can be expressed as guaranteeing that event \textit{X} always happens before \textit{Y}. Most of the time synchronisation happens around a critical section, where threads most acquire said critical section in a certain order. However, it may also be desired to be able to guarantee that event \textit{Z} does not occur between \textit{X} and \textit{Y}. This is called barging, where event \textit{X} tries to effect event \textit{Y} but anoter thread races to grab the critical section and emits \textit{Z} before \textit{Y}. Preventing or detecting barging is an involved challenge with low-level locks, which can be made much easier by higher-level constructs.
    2222
    2323% ======================================================================
     
    2828A monitor is a set of routines that ensure mutual exclusion when accessing shared state. This concept is generally associated with Object-Oriented Languages like Java~\cite{Java} or \uC~\cite{uC++book} but does not strictly require OO semantics. The only requirements is the ability to declare a handle to a shared object and a set of routines that act on it :
    2929\begin{cfacode}
    30 typedef /*some monitor type*/ monitor;
    31 int f(monitor & m);
    32 
    33 int main() {
    34         monitor m;  //Handle m
    35         f(m);       //Routine using handle
    36 }
     30        typedef /*some monitor type*/ monitor;
     31        int f(monitor & m);
     32
     33        int main() {
     34                monitor m;  //Handle m
     35                f(m);       //Routine using handle
     36        }
    3737\end{cfacode}
    3838
     
    4747
    4848\begin{cfacode}
    49 monitor counter_t { /*...see section $\ref{data}$...*/ };
    50 
    51 void ?{}(counter_t & nomutex this); //constructor
    52 size_t ++?(counter_t & mutex this); //increment
    53 
    54 //need for mutex is platform dependent
    55 void ?{}(size_t * this, counter_t & mutex cnt); //conversion
    56 \end{cfacode}
     49        monitor counter_t { /*...see section $\ref{data}$...*/ };
     50
     51        void ?{}(counter_t & nomutex this); //constructor
     52        size_t ++?(counter_t & mutex this); //increment
     53
     54        //need for mutex is platform dependent
     55        void ?{}(size_t * this, counter_t & mutex cnt); //conversion
     56\end{cfacode}
     57
     58Here, the constructor(\code{?\{\}}) uses the \code{nomutex} keyword to signify that it does not acquire the monitor mutual-exclusion when constructing. This semantics is because an object not yet constructed should never be shared and therefore does not require mutual exclusion. The prefix increment operator uses \code{mutex} to protect the incrementing process from race conditions. Finally, there is a conversion operator from \code{counter_t} to \code{size_t}. This conversion may or may not require the \code{mutex} keyword depending on whether or not reading an \code{size_t} is an atomic operation.
     59
     60Having both \code{mutex} and \code{nomutex} keywords is redundant based on the meaning of a routine having neither of these keywords. For example, given a routine without qualifiers \code{void foo(counter_t & this)}, then it is reasonable that it should default to the safest option \code{mutex}, whereas assuming \code{nomutex} is unsafe and may cause subtle errors. In fact, \code{nomutex} is the "normal" parameter behaviour, with the \code{nomutex} keyword effectively stating explicitly that "this routine is not special". Another alternative is to make having exactly one of these keywords mandatory, which would provide the same semantics but without the ambiguity of supporting routines neither keyword. Mandatory keywords would also have the added benefit of being self-documented but at the cost of extra typing. While there are several benefits to mandatory keywords, they do bring a few challenges. Mandatory keywords in \CFA would imply that the compiler must know without a doubt wheter or not a parameter is a monitor or not. Since \CFA relies heavily on traits as an abstraction mechanism, the distinction between a type that is a monitor and a type that looks like a monitor can become blurred. For this reason, \CFA only has the \code{mutex} keyword.
     61
     62
     63The next semantic decision is to establish when \code{mutex} may be used as a type qualifier. Consider the following declarations:
     64\begin{cfacode}
     65int f1(monitor & mutex m);
     66int f2(const monitor & mutex m);
     67int f3(monitor ** mutex m);
     68int f4(monitor * mutex m []);
     69int f5(graph(monitor*) & mutex m);
     70\end{cfacode}
     71The problem is to indentify which object(s) should be acquired. Furthermore, each object needs to be acquired only once. In the case of simple routines like \code{f1} and \code{f2} it is easy to identify an exhaustive list of objects to acquire on entry. Adding indirections (\code{f3}) still allows the compiler and programmer to indentify which object is acquired. However, adding in arrays (\code{f4}) makes it much harder. Array lengths are not necessarily known in C, and even then making sure objects are only acquired once becomes none-trivial. This can be extended to absurd limits like \code{f5}, which uses a graph of monitors. To keep everyone as sane as possible~\cite{Chicken}, this projects imposes the requirement that a routine may only acquire one monitor per parameter and it must be the type of the parameter with one level of indirection (ignoring potential qualifiers). Also note that while routine \code{f3} can be supported, meaning that monitor \code{**m} is be acquired, passing an array to this routine would be type safe and yet result in undefined behavior because only the first element of the array is acquired. This is specially true for non-copyable objects like monitors, where an array of pointers is simplest way to express a group of monitors. However, this ambiguity is part of the C type-system with respects to arrays. For this reason, \code{mutex} is disallowed in the context where arrays may be passed:
     72
     73\begin{cfacode}
     74int f1(monitor & mutex m);   //Okay : recommanded case
     75int f2(monitor * mutex m);   //Okay : could be an array but probably not
     76int f3(monitor mutex m []);  //Not Okay : Array of unkown length
     77int f4(monitor ** mutex m);  //Not Okay : Could be an array
     78int f5(monitor * mutex m []); //Not Okay : Array of unkown length
     79\end{cfacode}
     80
     81Unlike object-oriented monitors, where calling a mutex member \emph{implicitly} acquires mutual-exclusion, \CFA uses an explicit mechanism to acquire mutual-exclusion. A consequence of this approach is that it extends naturally to multi-monitor calls.
     82\begin{cfacode}
     83int f(MonitorA & mutex a, MonitorB & mutex b);
     84
     85MonitorA a;
     86MonitorB b;
     87f(a,b);
     88\end{cfacode}
     89The capacity to acquire multiple locks before entering a critical section is called \emph{\gls{group-acquire}}. In practice, writing multi-locking routines that do not lead to deadlocks is tricky. Having language support for such a feature is therefore a significant asset for \CFA. In the case presented above, \CFA guarantees that the order of aquisition is consistent across calls to routines using the same monitors as arguments. However, since \CFA monitors use multi-acquisition locks, users can effectively force the acquiring order. For example, notice which routines use \code{mutex}/\code{nomutex} and how this affects aquiring order:
     90\begin{cfacode}
     91        void foo(A & mutex a, B & mutex b) { //acquire a & b
     92                ...
     93        }
     94
     95        void bar(A & mutex a, B & /*nomutex*/ b) { //acquire a
     96                ... foo(a, b); ... //acquire b
     97        }
     98
     99        void baz(A & /*nomutex*/ a, B & mutex b) { //acquire b
     100                ... foo(a, b); ... //acquire a
     101        }
     102\end{cfacode}
     103The multi-acquisition monitor lock allows a monitor lock to be acquired by both \code{bar} or \code{baz} and acquired again in \code{foo}. In the calls to \code{bar} and \code{baz} the monitors are acquired in opposite order.
     104
     105However, such use leads the lock acquiring order problem. In the example above, the user uses implicit ordering in the case of function \code{foo} but explicit ordering in the case of \code{bar} and \code{baz}. This subtle mistake means that calling these routines concurrently may lead to deadlock and is therefore undefined behavior. As shown on several occasion\cit, solving this problem requires:
     106\begin{enumerate}
     107        \item Dynamically tracking of the monitor-call order.
     108        \item Implement rollback semantics.
     109\end{enumerate}
     110While the first requirement is already a significant constraint on the system, implementing a general rollback semantics in a C-like language is prohibitively complex \cit. In \CFA, users simply need to be carefull when acquiring multiple monitors at the same time.
     111
     112Finally, for convenience, monitors support multiple acquiring, that is acquiring a monitor while already holding it does not cause a deadlock. It simply increments an internal counter which is then used to release the monitor after the number of acquires and releases match up. This is particularly usefull when monitor routines use other monitor routines as helpers or for recursions. For example:
     113\begin{cfacode}
     114monitor bank {
     115        int money;
     116        log_t usr_log;
     117};
     118
     119void deposit( bank & mutex b, int deposit ) {
     120        b.money += deposit;
     121        b.usr_log | "Adding" | deposit | endl;
     122}
     123
     124void transfer( bank & mutex mybank, bank & mutex yourbank, int me2you) {
     125        deposit( mybank, -me2you );
     126        deposit( yourbank, me2you );
     127}
     128\end{cfacode}
     129
     130% ======================================================================
     131% ======================================================================
     132\subsection{Data semantics} \label{data}
     133% ======================================================================
     134% ======================================================================
     135Once the call semantics are established, the next step is to establish data semantics. Indeed, until now a monitor is used simply as a generic handle but in most cases monitors contain shared data. This data should be intrinsic to the monitor declaration to prevent any accidental use of data without its appropriate protection. For example, here is a complete version of the counter showed in section \ref{call}:
     136\begin{cfacode}
     137monitor counter_t {
     138        int value;
     139};
     140
     141void ?{}(counter_t & this) {
     142        this.cnt = 0;
     143}
     144
     145int ?++(counter_t & mutex this) {
     146        return ++this.value;
     147}
     148
     149//need for mutex is platform dependent here
     150void ?{}(int * this, counter_t & mutex cnt) {
     151        *this = (int)cnt;
     152}
     153\end{cfacode}
     154
    57155This counter is used as follows:
    58156\begin{center}
     
    71169\end{tabular}
    72170\end{center}
    73 Notice how the counter is used without any explicit synchronisation and yet supports thread-safe semantics for both reading and writting, which is similar in usage to \CC \code{atomic} template.
    74 
    75 Here, the constructor(\code{?\{\}}) uses the \code{nomutex} keyword to signify that it does not acquire the monitor mutual-exclusion when constructing. This semantics is because an object not yet con\-structed should never be shared and therefore does not require mutual exclusion. The prefix increment operator uses \code{mutex} to protect the incrementing process from race conditions. Finally, there is a conversion operator from \code{counter_t} to \code{size_t}. This conversion may or may not require the \code{mutex} keyword depending on whether or not reading a \code{size_t} is an atomic operation.
    76 
    77 For maximum usability, monitors use \gls{multi-acq} semantics, which means a single thread can acquire the same monitor multiple times without deadlock. For example, figure \ref{fig:search} uses recursion and \gls{multi-acq} to print values inside a binary tree.
    78 \begin{figure}
    79 \label{fig:search}
    80 \begin{cfacode}
    81 monitor printer { ... };
    82 struct tree {
    83         tree * left, right;
    84         char * value;
    85 };
    86 void print(printer & mutex p, char * v);
    87 
    88 void print(printer & mutex p, tree * t) {
    89         print(p, t->value);
    90         print(p, t->left );
    91         print(p, t->right);
    92 }
    93 \end{cfacode}
    94 \caption{Recursive printing algorithm using \gls{multi-acq}.}
    95 \end{figure}
    96 
    97 Having both \code{mutex} and \code{nomutex} keywords is redundant based on the meaning of a routine having neither of these keywords. For example, given a routine without qualifiers \code{void foo(counter_t & this)}, then it is reasonable that it should default to the safest option \code{mutex}, whereas assuming \code{nomutex} is unsafe and may cause subtle errors. In fact, \code{nomutex} is the ``normal'' parameter behaviour, with the \code{nomutex} keyword effectively stating explicitly that ``this routine is not special''. Another alternative is making exactly one of these keywords mandatory, which provides the same semantics but without the ambiguity of supporting routines with neither keyword. Mandatory keywords would also have the added benefit of being self-documented but at the cost of extra typing. While there are several benefits to mandatory keywords, they do bring a few challenges. Mandatory keywords in \CFA would imply that the compiler must know without doubt whether or not a parameter is a monitor or not. Since \CFA relies heavily on traits as an abstraction mechanism, the distinction between a type that is a monitor and a type that looks like a monitor can become blurred. For this reason, \CFA only has the \code{mutex} keyword and uses no keyword to mean \code{nomutex}.
    98 
    99 The next semantic decision is to establish when \code{mutex} may be used as a type qualifier. Consider the following declarations:
    100 \begin{cfacode}
    101 int f1(monitor & mutex m);
    102 int f2(const monitor & mutex m);
    103 int f3(monitor ** mutex m);
    104 int f4(monitor * mutex m []);
    105 int f5(graph(monitor*) & mutex m);
    106 \end{cfacode}
    107 The problem is to indentify which object(s) should be acquired. Furthermore, each object needs to be acquired only once. In the case of simple routines like \code{f1} and \code{f2} it is easy to identify an exhaustive list of objects to acquire on entry. Adding indirections (\code{f3}) still allows the compiler and programmer to indentify which object is acquired. However, adding in arrays (\code{f4}) makes it much harder. Array lengths are not necessarily known in C, and even then making sure objects are only acquired once becomes none-trivial. This problem can be extended to absurd limits like \code{f5}, which uses a graph of monitors. To make the issue tractable, this project imposes the requirement that a routine may only acquire one monitor per parameter and it must be the type of the parameter with at most one level of indirection (ignoring potential qualifiers). Also note that while routine \code{f3} can be supported, meaning that monitor \code{**m} is be acquired, passing an array to this routine would be type safe and yet result in undefined behavior because only the first element of the array is acquired. However, this ambiguity is part of the C type-system with respects to arrays. For this reason, \code{mutex} is disallowed in the context where arrays may be passed:
    108 \begin{cfacode}
    109 int f1(monitor & mutex m);   //Okay : recommanded case
    110 int f2(monitor * mutex m);   //Okay : could be an array but probably not
    111 int f3(monitor mutex m []);  //Not Okay : Array of unkown length
    112 int f4(monitor ** mutex m);  //Not Okay : Could be an array
    113 int f5(monitor * mutex m []); //Not Okay : Array of unkown length
    114 \end{cfacode}
    115 Note that not all array functions are actually distinct in the type system. However, even if the code generation could tell the difference, the extra information is still not sufficient to extend meaningfully the monitor call semantic.
    116 
    117 Unlike object-oriented monitors, where calling a mutex member \emph{implicitly} acquires mutual-exclusion of the receiver object, \CFA uses an explicit mechanism to acquire mutual-exclusion. A consequence of this approach is that it extends naturally to multi-monitor calls.
    118 \begin{cfacode}
    119 int f(MonitorA & mutex a, MonitorB & mutex b);
    120 
    121 MonitorA a;
    122 MonitorB b;
    123 f(a,b);
    124 \end{cfacode}
    125 While OO monitors could be extended with a mutex qualifier for multiple-monitor calls, no example of this feature could be found. The capacity to acquire multiple locks before entering a critical section is called \emph{\gls{bulk-acq}}. In practice, writing multi-locking routines that do not lead to deadlocks is tricky. Having language support for such a feature is therefore a significant asset for \CFA. In the case presented above, \CFA guarantees that the order of aquisition is consistent across calls to different routines using the same monitors as arguments. This consistent ordering means acquiring multiple monitors in the way is safe from deadlock. However, users can still force the acquiring order. For example, notice which routines use \code{mutex}/\code{nomutex} and how this affects aquiring order:
    126 \begin{cfacode}
    127 void foo(A & mutex a, B & mutex b) { //acquire a & b
    128         ...
    129 }
    130 
    131 void bar(A & mutex a, B & /*nomutex*/ b) { //acquire a
    132         ... foo(a, b); ... //acquire b
    133 }
    134 
    135 void baz(A & /*nomutex*/ a, B & mutex b) { //acquire b
    136         ... foo(a, b); ... //acquire a
    137 }
    138 \end{cfacode}
    139 The \gls{multi-acq} monitor lock allows a monitor lock to be acquired by both \code{bar} or \code{baz} and acquired again in \code{foo}. In the calls to \code{bar} and \code{baz} the monitors are acquired in opposite order.
    140 
    141 However, such use leads to the lock acquiring order problem. In the example above, the user uses implicit ordering in the case of function \code{foo} but explicit ordering in the case of \code{bar} and \code{baz}. This subtle mistake means that calling these routines concurrently may lead to deadlock and is therefore undefined behavior. As shown\cit, solving this problem requires:
    142 \begin{enumerate}
    143         \item Dynamically tracking of the monitor-call order.
    144         \item Implement rollback semantics.
    145 \end{enumerate}
    146 While the first requirement is already a significant constraint on the system, implementing a general rollback semantics in a C-like language is prohibitively complex \cit. In \CFA, users simply need to be carefull when acquiring multiple monitors at the same time or only use \gls{bulk-acq} of all the monitors. While \CFA provides only a partial solution, many system provide no solution and the \CFA partial solution handles many useful cases.
    147 
    148 For example, \gls{multi-acq} and \gls{bulk-acq} can be used together in interesting ways:
    149 \begin{cfacode}
    150 monitor bank { ... };
    151 
    152 void deposit( bank & mutex b, int deposit );
    153 
    154 void transfer( bank & mutex mybank, bank & mutex yourbank, int me2you) {
    155         deposit( mybank, -me2you );
    156         deposit( yourbank, me2you );
    157 }
    158 \end{cfacode}
    159 This example shows a trivial solution to the bank-account transfer-problem\cit. Without \gls{multi-acq} and \gls{bulk-acq}, the solution to this problem is much more involved and requires carefull engineering.
    160 
    161 \subsection{\code{mutex} statement} \label{mutex-stmt}
    162 
    163 The call semantics discussed aboved have one software engineering issue, only a named routine can acquire the mutual-exclusion of a set of monitor. \CFA offers the \code{mutex} statement to workaround the need for unnecessary names, avoiding a major software engineering problem\cit. Listing \ref{lst:mutex-stmt} shows an example of the \code{mutex} statement, which introduces a new scope in which the mutual-exclusion of a set of monitor is acquired. Beyond naming, the \code{mutex} statement has no semantic difference from a routine call with \code{mutex} parameters.
    164 
    165 \begin{figure}
    166 \begin{center}
    167 \begin{tabular}{|c|c|}
    168 function call & \code{mutex} statement \\
     171Notice how the counter is used without any explicit synchronisation and yet supports thread-safe semantics for both reading and writting.
     172
     173% ======================================================================
     174% ======================================================================
     175\subsection{Implementation Details: Interaction with polymorphism}
     176% ======================================================================
     177% ======================================================================
     178Depending on the choice of semantics for when monitor locks are acquired, interaction between monitors and \CFA's concept of polymorphism can be complex to support. However, it is shown that entry-point locking solves most of the issues.
     179
     180First of all, interaction between \code{otype} polymorphism and monitors is impossible since monitors do not support copying. Therefore, the main question is how to support \code{dtype} polymorphism. Since a monitor's main purpose is to ensure mutual exclusion when accessing shared data, this implies that mutual exclusion is only required for routines that do in fact access shared data. However, since \code{dtype} polymorphism always handles incomplete types (by definition), no \code{dtype} polymorphic routine can access shared data since the data requires knowledge about the type. Therefore, the only concern when combining \code{dtype} polymorphism and monitors is to protect access to routines.
     181
     182Before looking into complex control-flow, it is important to present the difference between the two acquiring options : callsite and entry-point locking, i.e. acquiring the monitors before making a mutex routine call or as the first operation of the mutex routine-call. For example:
     183\begin{center}
     184\setlength\tabcolsep{1.5pt}
     185\begin{tabular}{|c|c|c|}
     186Code & \gls{callsite-locking} & \gls{entry-point-locking} \\
     187\CFA & pseudo-code & pseudo-code \\
    169188\hline
    170189\begin{cfacode}[tabsize=3]
    171 monitor M {};
    172 void foo( M & mutex m ) {
    173         //critical section
    174 }
    175 
    176 void bar( M & m ) {
    177         foo( m );
    178 }
    179 \end{cfacode}&\begin{cfacode}[tabsize=3]
    180 monitor M {};
    181 void bar( M & m ) {
    182         mutex(m) {
    183                 //critical section
    184         }
    185 }
    186 
    187 
    188 \end{cfacode}
     190void foo(monitor& mutex a){
     191
     192
     193
     194        //Do Work
     195        //...
     196
     197}
     198
     199void main() {
     200        monitor a;
     201
     202
     203
     204        foo(a);
     205
     206}
     207\end{cfacode} & \begin{pseudo}[tabsize=3]
     208foo(& a) {
     209
     210
     211
     212        //Do Work
     213        //...
     214
     215}
     216
     217main() {
     218        monitor a;
     219        //calling routine
     220        //handles concurrency
     221        acquire(a);
     222        foo(a);
     223        release(a);
     224}
     225\end{pseudo} & \begin{pseudo}[tabsize=3]
     226foo(& a) {
     227        //called routine
     228        //handles concurrency
     229        acquire(a);
     230        //Do Work
     231        //...
     232        release(a);
     233}
     234
     235main() {
     236        monitor a;
     237
     238
     239
     240        foo(a);
     241
     242}
     243\end{pseudo}
    189244\end{tabular}
    190245\end{center}
    191 \caption{Regular call semantics vs. \code{mutex} statement}
    192 \label{lst:mutex-stmt}
    193 \end{figure}
    194 
    195 % ======================================================================
    196 % ======================================================================
    197 \subsection{Data semantics} \label{data}
    198 % ======================================================================
    199 % ======================================================================
    200 Once the call semantics are established, the next step is to establish data semantics. Indeed, until now a monitor is used simply as a generic handle but in most cases monitors contain shared data. This data should be intrinsic to the monitor declaration to prevent any accidental use of data without its appropriate protection. For example, here is a complete version of the counter showed in section \ref{call}:
    201 \begin{cfacode}
    202 monitor counter_t {
    203         int value;
    204 };
    205 
    206 void ?{}(counter_t & this) {
    207         this.cnt = 0;
    208 }
    209 
    210 int ?++(counter_t & mutex this) {
    211         return ++this.value;
    212 }
    213 
    214 //need for mutex is platform dependent here
    215 void ?{}(int * this, counter_t & mutex cnt) {
    216         *this = (int)cnt;
    217 }
    218 \end{cfacode}
    219 
    220 Like threads and coroutines, monitors are defined in terms of traits with some additional language support in the form of the \code{monitor} keyword. The monitor trait is :
    221 \begin{cfacode}
    222 trait is_monitor(dtype T) {
    223         monitor_desc * get_monitor( T & );
    224         void ^?{}( T & mutex );
    225 };
    226 \end{cfacode}
    227 Note that the destructor of a monitor must be a \code{mutex} routine. This requirement ensures that the destructor has mutual-exclusion. As with any object, any call to a monitor, using \code{mutex} or otherwise, is Undefined Behaviour after the destructor has run.
    228 
    229 % ======================================================================
    230 % ======================================================================
    231 \section{Internal scheduling} \label{intsched}
    232 % ======================================================================
    233 % ======================================================================
    234 In addition to mutual exclusion, the monitors at the core of \CFA's concurrency can also be used to achieve synchronisation. With monitors, this capability is generally achieved with internal or external scheduling as in\cit. Since internal scheduling within a single monitor is mostly a solved problem, this thesis concentrates on extending internal scheduling to multiple monitors. Indeed, like the \gls{bulk-acq} semantics, internal scheduling extends to multiple monitors in a way that is natural to the user but requires additional complexity on the implementation side.
     246
     247\Gls{callsite-locking} is inefficient, since any \code{dtype} routine may have to obtain some lock before calling a routine, depending on whether or not the type passed is a monitor. However, with \gls{entry-point-locking} calling a monitor routine becomes exactly the same as calling it from anywhere else.
     248
     249Note the \code{mutex} keyword relies on the resolver, which means that in cases where a generic monitor routine is actually desired, writing a mutex routine is possible with the proper trait. This is possible because monitors are designed in terms a trait. For example:
     250\begin{cfacode}
     251//Incorrect
     252//T is not a monitor
     253forall(dtype T)
     254void foo(T * mutex t);
     255
     256//Correct
     257//this function only works on monitors
     258//(any monitor)
     259forall(dtype T | is_monitor(T))
     260void bar(T * mutex t));
     261\end{cfacode}
     262
     263
     264% ======================================================================
     265% ======================================================================
     266\section{Internal scheduling} \label{insched}
     267% ======================================================================
     268% ======================================================================
     269In addition to mutual exclusion, the monitors at the core of \CFA's concurrency can also be used to achieve synchronisation. With monitors, this is generally achieved with internal or external scheduling as in\cit. Since internal scheduling of single monitors is mostly a solved problem, this proposal concentraits on extending internal scheduling to multiple monitors at once. Indeed, like the \gls{group-acquire} semantics, internal scheduling extends to multiple monitors at once in a way that is natural to the user but requires additional complexity on the implementation side.
    235270
    236271First, here is a simple example of such a technique:
    237272
    238273\begin{cfacode}
    239 monitor A {
    240         condition e;
    241 }
    242 
    243 void foo(A & mutex a) {
    244         ...
    245         //Wait for cooperation from bar()
    246         wait(a.e);
    247         ...
    248 }
    249 
    250 void bar(A & mutex a) {
    251         //Provide cooperation for foo()
    252         ...
    253         //Unblock foo
    254         signal(a.e);
    255 }
    256 \end{cfacode}
    257 
    258 There are two details to note here. First, the \code{signal} is a delayed operation, it only unblocks the waiting thread when it reaches the end of the critical section. This semantic is needed to respect mutual-exclusion. The alternative is to return immediately after the call to \code{signal}, which is significantly more restrictive. Second, in \CFA, while it is common to store a \code{condition} as a field of the monitor, a \code{condition} variable can be stored/created independently of a monitor. Here routine \code{foo} waits for the \code{signal} from \code{bar} before making further progress, effectively ensuring a basic ordering.
    259 
    260 An important aspect of the implementation is that \CFA does not allow barging, which means that once function \code{bar} releases the monitor, \code{foo} is guaranteed to resume immediately after (unless some other thread waited on the same condition). This guarantees offers the benefit of not having to loop arount waits in order to guarantee that a condition is still met. The main reason \CFA offers this guarantee is that users can easily introduce barging if it becomes a necessity but adding barging prevention or barging avoidance is more involved without language support. Supporting barging prevention as well as extending internal scheduling to multiple monitors is the main source of complexity in the design of \CFA concurrency.
     274        monitor A {
     275                condition e;
     276        }
     277
     278        void foo(A & mutex a) {
     279                ...
     280                // Wait for cooperation from bar()
     281                wait(a.e);
     282                ...
     283        }
     284
     285        void bar(A & mutex a) {
     286                // Provide cooperation for foo()
     287                ...
     288                // Unblock foo at scope exit
     289                signal(a.e);
     290        }
     291\end{cfacode}
     292
     293There are two details to note here. First, there \code{signal} is a delayed operation, it only unblocks the waiting thread when it reaches the end of the critical section. This is needed to respect mutual-exclusion. Second, in \CFA, \code{condition} have no particular need to be stored inside a monitor, beyond any software engineering reasons. Here routine \code{foo} waits for the \code{signal} from \code{bar} before making further progress, effectively ensuring a basic ordering.
     294
     295An important aspect to take into account here is that \CFA does not allow barging, which means that once function \code{bar} releases the monitor, foo is guaranteed to resume immediately after (unless some other thread waited on the same condition). This guarantees offers the benefit of not having to loop arount waits in order to guarantee that a condition is still met. The main reason \CFA offers this guarantee is that users can easily introduce barging if it becomes a necessity but adding barging prevention or barging avoidance is more involved without language support. Supporting barging prevention as well as extending internal scheduling to multiple monitors is the main source of complexity in the design of \CFA concurrency.
    261296
    262297% ======================================================================
     
    265300% ======================================================================
    266301% ======================================================================
    267 It is easier to understand the problem of multi-monitor scheduling using a series of pseudo-code. Note that for simplicity in the following snippets of pseudo-code, waiting and signalling is done using an implicit condition variable, like Java built-in monitors. Indeed, \code{wait} statements always use the implicit condition as paremeter and explicitly names the monitors (A and B) associated with the condition. Note that in \CFA, condition variables are tied to a set of monitors on first use (called branding) which means that using internal scheduling with distinct sets of monitors requires one condition variable per set of monitors.
     302It is easier to understand the problem of multi-monitor scheduling using a series of pseudo-code. Note that for simplicity in the following snippets of pseudo-code, waiting and signalling is done using an implicit condition variable, like Java built-in monitors.
    268303
    269304\begin{multicols}{2}
     
    284319\end{pseudo}
    285320\end{multicols}
    286 The example shows the simple case of having two threads (one for each column) and a single monitor A. One thread acquires before waiting (atomically blocking and releasing A) and the other acquires before signalling. It is important to note here that both \code{wait} and \code{signal} must be called with the proper monitor(s) already acquired. This semantic is a logical requirement for barging prevention.
    287 
    288 A direct extension of the previous example is a \gls{bulk-acq} version:
     321The example shows the simple case of having two threads (one for each column) and a single monitor A. One thread acquires before waiting (atomically blocking and releasing A) and the other acquires before signalling. There is an important thing to note here, both \code{wait} and \code{signal} must be called with the proper monitor(s) already acquired. This restriction is hidden on the user side in \uC, as it is a logical requirement for barging prevention.
     322
     323A direct extension of the previous example is the \gls{group-acquire} version:
    289324
    290325\begin{multicols}{2}
     
    303338\end{pseudo}
    304339\end{multicols}
    305 This version uses \gls{bulk-acq} (denoted using the {\sf\&} symbol), but the presence of multiple monitors does not add a particularly new meaning. Synchronization happens between the two threads in exactly the same way and order. The only difference is that mutual exclusion covers more monitors. On the implementation side, handling multiple monitors does add a degree of complexity as the next few examples demonstrate.
    306 
    307 While deadlock issues can occur when nesting monitors, these issues are only a symptom of the fact that locks, and by extension monitors, are not perfectly composable. For monitors, a well known deadlock problem is the Nested Monitor Problem\cit, which occurs when a \code{wait} is made by a thread that holds more than one monitor. For example, the following pseudo-code runs into the nested-monitor problem :
     340This version uses \gls{group-acquire} (denoted using the \& symbol), but the presence of multiple monitors does not add a particularly new meaning. Synchronization happens between the two threads in exactly the same way and order. The only difference is that mutual exclusion covers more monitors. On the implementation side, handling multiple monitors does add a degree of complexity as the next few examples demonstrate.
     341
     342While deadlock issues can occur when nesting monitors, these issues are only a symptom of the fact that locks, and by extension monitors, are not perfectly composable. However, for monitors as for locks, it is possible to write a program using nesting without encountering any problems if nested is done correctly. For example, the next pseudo-code snippet acquires monitors A then B before waiting while only acquiring B when signalling, effectively avoiding the nested monitor problem.
     343
    308344\begin{multicols}{2}
    309345\begin{pseudo}
     
    318354
    319355\begin{pseudo}
    320 acquire A
    321         acquire B
    322                 signal B
    323         release B
    324 release A
    325 \end{pseudo}
    326 \end{multicols}
    327 
    328 The \code{wait} only releases monitor \code{B} so the signalling thread cannot acquire monitor \code{A} to get to the \code{signal}. Attempting release of all acquired monitors at the \code{wait} results in another set of problems such as releasing monitor \code{C}, which has nothing to do with the \code{signal}.
    329 
    330 However, for monitors as for locks, it is possible to write a program using nesting without encountering any problems if nesting is done correctly. For example, the next pseudo-code snippet acquires monitors {\sf A} then {\sf B} before waiting, while only acquiring {\sf B} when signalling, effectively avoiding the nested monitor problem.
    331 
    332 \begin{multicols}{2}
    333 \begin{pseudo}
    334 acquire A
    335         acquire B
    336                 wait B
    337         release B
    338 release A
    339 \end{pseudo}
    340 
    341 \columnbreak
    342 
    343 \begin{pseudo}
    344356
    345357acquire B
     
    350362\end{multicols}
    351363
    352 % ======================================================================
    353 % ======================================================================
    354 \subsection{Internal Scheduling - in depth}
    355 % ======================================================================
    356 % ======================================================================
    357 
    358 A larger example is presented to show complex issuesfor \gls{bulk-acq} and all the implementation options are analyzed. Listing \ref{lst:int-bulk-pseudo} shows an example where \gls{bulk-acq} adds a significant layer of complexity to the internal signalling semantics, and listing \ref{lst:int-bulk-cfa} shows the corresponding \CFA code which implements the pseudo-code in listing \ref{lst:int-bulk-pseudo}. For the purpose of translating the given pseudo-code into \CFA-code any method of introducing monitor into context, other than a \code{mutex} parameter, is acceptable, e.g., global variables, pointer parameters or using locals with the \code{mutex}-statement.
    359 
    360 \begin{figure}[!b]
     364The next example is where \gls{group-acquire} adds a significant layer of complexity to the internal signalling semantics.
     365
    361366\begin{multicols}{2}
    362367Waiting thread
    363368\begin{pseudo}[numbers=left]
    364369acquire A
    365         //Code Section 1
     370        // Code Section 1
    366371        acquire A & B
    367                 //Code Section 2
     372                // Code Section 2
    368373                wait A & B
    369                 //Code Section 3
     374                // Code Section 3
    370375        release A & B
    371         //Code Section 4
     376        // Code Section 4
    372377release A
    373378\end{pseudo}
     
    378383\begin{pseudo}[numbers=left, firstnumber=10]
    379384acquire A
    380         //Code Section 5
     385        // Code Section 5
    381386        acquire A & B
    382                 //Code Section 6
     387                // Code Section 6
    383388                signal A & B
    384                 //Code Section 7
     389                // Code Section 7
    385390        release A & B
    386         //Code Section 8
     391        // Code Section 8
    387392release A
    388393\end{pseudo}
    389394\end{multicols}
    390 \caption{Internal scheduling with \gls{bulk-acq}}
    391 \label{lst:int-bulk-pseudo}
    392 \end{figure}
    393 
    394 \begin{figure}[!b]
    395 \begin{center}
    396 \begin{cfacode}[xleftmargin=.4\textwidth]
    397 monitor A a;
    398 monitor B b;
    399 condition c;
    400 \end{cfacode}
    401 \end{center}
    402 \begin{multicols}{2}
    403 Waiting thread
    404 \begin{cfacode}
    405 mutex(a) {
    406         //Code Section 1
    407         mutex(a, b) {
    408                 //Code Section 2
    409                 wait(c);
    410                 //Code Section 3
    411         }
    412         //Code Section 4
    413 }
    414 \end{cfacode}
    415 
    416 \columnbreak
    417 
    418 Signalling thread
    419 \begin{cfacode}
    420 mutex(a) {
    421         //Code Section 5
    422         mutex(a, b) {
    423                 //Code Section 6
    424                 signal(c);
    425                 //Code Section 7
    426         }
    427         //Code Section 8
    428 }
    429 \end{cfacode}
    430 \end{multicols}
    431 \caption{Equivalent \CFA code for listing \ref{lst:int-bulk-pseudo}}
    432 \label{lst:int-bulk-cfa}
    433 \end{figure}
    434 
    435 The complexity begins at code sections 4 and 8, which are where the existing semantics of internal scheduling need to be extended for multiple monitors. The root of the problem is that \gls{bulk-acq} is used in a context where one of the monitors is already acquired and is why it is important to define the behaviour of the previous pseudo-code. When the signaller thread reaches the location where it should ``release \code{A & B}'' (line 16), it must actually transfer ownership of monitor \code{B} to the waiting thread. This ownership trasnfer is required in order to prevent barging. Since the signalling thread still needs monitor \code{A}, simply waking up the waiting thread is not an option because it violates mutual exclusion. There are three options.
     395\begin{center}
     396Listing 1
     397\end{center}
     398
     399It is particularly important to pay attention to code sections 8 and 4, which are where the existing semantics of internal scheduling need to be extended for multiple monitors. The root of the problem is that \gls{group-acquire} is used in a context where one of the monitors is already acquired and is why it is important to define the behaviour of the previous pseudo-code. When the signaller thread reaches the location where it should "release A \& B" (line 16), it must actually transfer ownership of monitor B to the waiting thread. This ownership trasnfer is required in order to prevent barging. Since the signalling thread still needs the monitor A, simply waking up the waiting thread is not an option because it would violate mutual exclusion. There are three options:
    436400
    437401\subsubsection{Delaying signals}
    438 The obvious solution to solve the problem of multi-monitor scheduling is to keep ownership of all locks until the last lock is ready to be transferred. It can be argued that that moment is when the last lock is no longer needed because this semantics fits most closely to the behaviour of single-monitor scheduling. This solution has the main benefit of transferring ownership of groups of monitors, which simplifies the semantics from mutiple objects to a single group of objects, effectively making the existing single-monitor semantic viable by simply changing monitors to monitor groups.
     402The first more obvious solution to solve the problem of multi-monitor scheduling is to keep ownership of all locks until the last lock is ready to be transferred. It can be argued that that moment is the correct time to transfer ownership when the last lock is no longer needed because this semantics fits most closely to the behaviour of single monitor scheduling. This solution has the main benefit of transferring ownership of groups of monitors, which simplifies the semantics from mutiple objects to a single group of object, effectively making the existing single monitor semantic viable by simply changing monitors to monitor collections.
    439403\begin{multicols}{2}
    440404Waiter
     
    460424\end{pseudo}
    461425\end{multicols}
    462 However, this solution can become much more complicated depending on what is executed while secretly holding B (at line 10). Indeed, nothing prevents signalling monitor A on a different condition variable:
    463 \begin{figure}
    464 \begin{multicols}{3}
    465 Thread $\alpha$
     426However, this solution can become much more complicated depending on what is executed while secretly holding B (at line 10). Indeed, nothing prevents a user from signalling monitor A on a different condition variable:
     427\newpage
     428\begin{multicols}{2}
     429Thread 1
    466430\begin{pseudo}[numbers=left, firstnumber=1]
    467431acquire A
     
    472436\end{pseudo}
    473437
     438Thread 2
     439\begin{pseudo}[numbers=left, firstnumber=6]
     440acquire A
     441        wait A
     442release A
     443\end{pseudo}
     444
    474445\columnbreak
    475446
    476 Thread $\gamma$
    477 \begin{pseudo}[numbers=left, firstnumber=1]
     447Thread 3
     448\begin{pseudo}[numbers=left, firstnumber=10]
    478449acquire A
    479450        acquire A & B
    480451                signal A & B
    481452        release A & B
     453        //Secretly keep B here
    482454        signal A
    483455release A
    484 \end{pseudo}
    485 
    486 \columnbreak
    487 
    488 Thread $\beta$
    489 \begin{pseudo}[numbers=left, firstnumber=1]
    490 acquire A
    491         wait A
    492 release A
    493 \end{pseudo}
    494 
     456//Wakeup thread 1 or 2?
     457//Who wakes up the other thread?
     458\end{pseudo}
    495459\end{multicols}
    496 \caption{Dependency graph}
    497 \label{lst:dependency}
    498 \end{figure}
    499460
    500461The goal in this solution is to avoid the need to transfer ownership of a subset of the condition monitors. However, this goal is unreacheable in the previous example. Depending on the order of signals (line 12 and 15) two cases can happen.
     
    506467Note that ordering is not determined by a race condition but by whether signalled threads are enqueued in FIFO or FILO order. However, regardless of the answer, users can move line 15 before line 11 and get the reverse effect.
    507468
    508 In both cases, the threads need to be able to distinguish, on a per monitor basis, which ones need to be released and which ones need to be transferred, which means monitors cannot be handled as a single homogenous group and therefore effectively precludes this approach.
     469In both cases, the threads need to be able to distinguish on a per monitor basis which ones need to be released and which ones need to be transferred. Which means monitors cannot be handled as a single homogenous group.
    509470
    510471\subsubsection{Dependency graphs}
    511 In the listing \ref{lst:int-bulk-pseudo} pseudo-code, there is a solution which statisfies both barging prevention and mutual exclusion. If ownership of both monitors is transferred to the waiter when the signaller releases \code{A & B} and then the waiter transfers back ownership of \code{A} when it releases it, then the problem is solved (\code{B} is no longer in use at this point). Dynamically finding the correct order is therefore the second possible solution. The problem it encounters is that it effectively boils down to resolving a dependency graph of ownership requirements. Here even the simplest of code snippets requires two transfers and it seems to increase in a manner closer to polynomial. For example, the following code, which is just a direct extension to three monitors, requires at least three ownership transfer and has multiple solutions:
     472In the Listing 1 pseudo-code, there is a solution which statisfies both barging prevention and mutual exclusion. If ownership of both monitors is transferred to the waiter when the signaller releases A and then the waiter transfers back ownership of A when it releases it then the problem is solved. Dynamically finding the correct order is therefore the second possible solution. The problem it encounters is that it effectively boils down to resolving a dependency graph of ownership requirements. Here even the simplest of code snippets requires two transfers and it seems to increase in a manner closer to polynomial. For example, the following code, which is just a direct extension to three monitors, requires at least three ownership transfer and has multiple solutions:
    512473
    513474\begin{multicols}{2}
     
    534495\end{pseudo}
    535496\end{multicols}
    536 
    537 \begin{figure}
    538 \begin{center}
    539 \input{dependency}
    540 \end{center}
    541 \caption{Dependency graph of the statements in listing \ref{lst:dependency}}
    542 \label{fig:dependency}
    543 \end{figure}
    544 
    545 Listing \ref{lst:dependency} is the three thread example rewritten for dependency graphs. Figure \ref{fig:dependency} shows the corresponding dependency graph that results, where every node is a statement of one of the three threads, and the arrows the dependency of that statement (e.g., $\alpha1$ must happen before $\alpha2$). The extra challenge is that this dependency graph is effectively post-mortem, but the runtime system needs to be able to build and solve these graphs as the dependency unfolds. Resolving dependency graph being a complex and expensive endeavour, this solution is not the preffered one.
     497Resolving dependency graph being a complex and expensive endeavour, this solution is not the preffered one.
    546498
    547499\subsubsection{Partial signalling} \label{partial-sig}
    548 Finally, the solution that is chosen for \CFA is to use partial signalling. Again using listing \ref{lst:int-bulk-pseudo}, the partial signalling solution transfers ownership of monitor B at lines 10 but does not wake the waiting thread since it is still using monitor A. Only when it reaches line 11 does it actually wakeup the waiting thread. This solution has the benefit that complexity is encapsulated into only two actions, passing monitors to the next owner when they should be release and conditionally waking threads if all conditions are met. This solution has a much simpler implementation than a dependency graph solving algorithm which is why it was chosen. Furthermore, after being fully implemented, this solution does not appear to have any downsides worth mentionning.
     500Finally, the solution that is chosen for \CFA is to use partial signalling. Consider the following case:
     501
     502\begin{multicols}{2}
     503\begin{pseudo}[numbers=left]
     504acquire A
     505        acquire A & B
     506                wait A & B
     507        release A & B
     508release A
     509\end{pseudo}
     510
     511\columnbreak
     512
     513\begin{pseudo}[numbers=left, firstnumber=6]
     514acquire A
     515        acquire A & B
     516                signal A & B
     517        release A & B
     518        // ... More code
     519release A
     520\end{pseudo}
     521\end{multicols}
     522The partial signalling solution transfers ownership of monitor B at lines 10 but does not wake the waiting thread since it is still using monitor A. Only when it reaches line 11 does it actually wakeup the waiting thread. This solution has the benefit that complexity is encapsulated into only two actions, passing monitors to the next owner when they should be release and conditionnaly waking threads if all conditions are met. Contrary to the other solutions, this solution quickly hits an upper bound on complexity of implementation.
    549523
    550524% ======================================================================
     
    553527% ======================================================================
    554528% ======================================================================
    555 \begin{figure}
     529An important note is that, until now, signalling a monitor was a delayed operation. The ownership of the monitor is transferred only when the monitor would have otherwise been released, not at the point of the \code{signal} statement. However, in some cases, it may be more convenient for users to immediately transfer ownership to the thread that is waiting for cooperation, which is achieved using the \code{signal_block} routine\footnote{name to be discussed}.
     530
     531For example here is an example highlighting the difference in behaviour:
     532\begin{center}
    556533\begin{tabular}{|c|c|}
    557534\code{signal} & \code{signal_block} \\
    558535\hline
    559 \begin{cfacode}[tabsize=3]
    560 monitor DatingService
    561 {
    562         //compatibility codes
    563         enum{ CCodes = 20 };
    564 
    565         int girlPhoneNo
    566         int boyPhoneNo;
    567 };
    568 
    569 condition girls[CCodes];
    570 condition boys [CCodes];
    571 condition exchange;
    572 
    573 int girl(int phoneNo, int ccode)
    574 {
    575         //no compatible boy ?
    576         if(empty(boys[ccode]))
    577         {
    578                 //wait for boy
    579                 wait(girls[ccode]);
    580 
    581                 //make phone number available
    582                 girlPhoneNo = phoneNo;
    583 
    584                 //wake boy from chair
    585                 signal(exchange);
    586         }
    587         else
    588         {
    589                 //make phone number available
    590                 girlPhoneNo = phoneNo;
    591 
    592                 //wake boy
    593                 signal(boys[ccode]);
    594 
    595                 //sit in chair
    596                 wait(exchange);
    597         }
    598         return boyPhoneNo;
    599 }
    600 
    601 int boy(int phoneNo, int ccode)
    602 {
    603         //same as above
    604         //with boy/girl interchanged
    605 }
    606 \end{cfacode}&\begin{cfacode}[tabsize=3]
    607 monitor DatingService
    608 {
    609         //compatibility codes
    610         enum{ CCodes = 20 };
    611 
    612         int girlPhoneNo;
    613         int boyPhoneNo;
    614 };
    615 
    616 condition girls[CCodes];
    617 condition boys [CCodes];
    618 //exchange is not needed
    619 
    620 int girl(int phoneNo, int ccode)
    621 {
    622         //no compatible boy ?
    623         if(empty(boys[ccode]))
    624         {
    625                 //wait for boy
    626                 wait(girls[ccode]);
    627 
    628                 //make phone number available
    629                 girlPhoneNo = phoneNo;
    630 
    631                 //wake boy from chair
    632                 signal(exchange);
    633         }
    634         else
    635         {
    636                 //make phone number available
    637                 girlPhoneNo = phoneNo;
    638 
    639                 //wake boy
    640                 signal_block(boys[ccode]);
    641 
    642                 //second handshake unnecessary
    643 
    644         }
    645         return boyPhoneNo;
    646 }
    647 
    648 int boy(int phoneNo, int ccode)
    649 {
    650         //same as above
    651         //with boy/girl interchanged
     536\begin{cfacode}
     537monitor M { int val; };
     538
     539void foo(M & mutex m ) {
     540        m.val++;
     541        sout| "Foo:" | m.val |endl;
     542
     543        wait( c );
     544
     545        m.val++;
     546        sout| "Foo:" | m.val |endl;
     547}
     548
     549void bar(M & mutex m ) {
     550        m.val++;
     551        sout| "Bar:" | m.val |endl;
     552
     553        signal( c );
     554
     555        m.val++;
     556        sout| "Bar:" | m.val |endl;
     557}
     558\end{cfacode}&\begin{cfacode}
     559monitor M { int val; };
     560
     561void foo(M & mutex m ) {
     562        m.val++;
     563        sout| "Foo:" | m.val |endl;
     564
     565        wait( c );
     566
     567        m.val++;
     568        sout| "Foo:" | m.val |endl;
     569}
     570
     571void bar(M & mutex m ) {
     572        m.val++;
     573        sout| "Bar:" | m.val |endl;
     574
     575        signal_block( c );
     576
     577        m.val++;
     578        sout| "Bar:" | m.val |endl;
    652579}
    653580\end{cfacode}
    654581\end{tabular}
    655 \caption{Dating service example using \code{signal} and \code{signal_block}. }
    656 \label{lst:datingservice}
    657 \end{figure}
    658 An important note is that, until now, signalling a monitor was a delayed operation. The ownership of the monitor is transferred only when the monitor would have otherwise been released, not at the point of the \code{signal} statement. However, in some cases, it may be more convenient for users to immediately transfer ownership to the thread that is waiting for cooperation, which is achieved using the \code{signal_block} routine\footnote{name to be discussed}.
    659 
    660 The example in listing \ref{lst:datingservice} highlights the difference in behaviour. As mentioned, \code{signal} only transfers ownership once the current critical section exits, this behaviour requires additional synchronisation when a two-way handshake is needed. To avoid this extraneous synchronisation, the \code{condition} type offers the \code{signal_block} routine, which handles the two-way handshake as shown in the example. This removes the need for a second condition variables and simplifies programming. Like every other monitor semantic, \code{signal_block} uses barging prevention, which means mutual-exclusion is baton-passed both on the frond-end and the back-end of the call to \code{signal_block}, meaning no other thread can acquire the monitor neither before nor after the call.
     582\end{center}
     583Assuming that \code{val} is initialized at 0, that each routine are called from seperate thread and that \code{foo} is always called first. The previous code would yield the following output:
     584
     585\begin{center}
     586\begin{tabular}{|c|c|}
     587\code{signal} & \code{signal_block} \\
     588\hline
     589\begin{pseudo}
     590Foo: 0
     591Bar: 1
     592Bar: 2
     593Foo: 3
     594\end{pseudo}&\begin{pseudo}
     595Foo: 0
     596Bar: 1
     597Foo: 2
     598Bar: 3
     599\end{pseudo}
     600\end{tabular}
     601\end{center}
     602
     603As mentionned, \code{signal} only transfers ownership once the current critical section exits, resulting in the second "Bar" line to be printed before the second "Foo" line. On the other hand, \code{signal_block} immediately transfers ownership to \code{bar}, causing an inversion of output. Obviously this means that \code{signal_block} is a blocking call, which will only be resumed once the signalled function exits the critical section.
     604
     605% ======================================================================
     606% ======================================================================
     607\subsection{Internal scheduling: Implementation} \label{inschedimpl}
     608% ======================================================================
     609% ======================================================================
     610There are several challenges specific to \CFA when implementing internal scheduling. These challenges are direct results of \gls{group-acquire} and loose object definitions. These two constraints are to root cause of most design decisions in the implementation of internal scheduling. Furthermore, to avoid the head-aches of dynamically allocating memory in a concurrent environment, the internal-scheduling design is entirely free of mallocs and other dynamic memory allocation scheme. This is to avoid the chicken and egg problem of having a memory allocator that relies on the threading system and a threading system that relies on the runtime. This extra goal, means that memory management is a constant concern in the design of the system.
     611
     612The main memory concern for concurrency is queues. All blocking operations are made by parking threads onto queues. These queues need to be intrinsic\cit to avoid the need memory allocation. This entails that all the fields needed to keep track of all needed information. Since internal scheduling can use an unbound amount of memory (depending on \gls{group-acquire}) statically defining information information in the intrusive fields of threads is insufficient. The only variable sized container that does not require memory allocation is the callstack, which is heavily used in the implementation of internal scheduling. Particularly the GCC extension variable length arrays which is used extensively.
     613
     614Since stack allocation is based around scope, the first step of the implementation is to identify the scopes that are available to store the information, and which of these can have a variable length. In the case of external scheduling, the threads and the condition both allow a fixed amount of memory to be stored, while mutex-routines and the actual blocking call allow for an unbound amount (though adding too much to the mutex routine stack size can become expansive faster).
     615
     616The following figure is the traditionnal illustration of a monitor :
     617
     618\begin{center}
     619{\resizebox{0.4\textwidth}{!}{\input{monitor}}}
     620\end{center}
     621
     622For \CFA, the previous picture does not have support for blocking multiple monitors on a single condition. To support \gls{group-acquire} two changes to this picture are required. First, it doesn't make sense to tie the condition to a single monitor since blocking two monitors as one would require arbitrarily picking a monitor to hold the condition. Secondly, the object waiting on the conditions and AS-stack cannot simply contain the waiting thread since a single thread can potentially wait on multiple monitors. As mentionned in section \ref{inschedimpl}, the handling in multiple monitors is done by partially passing, which entails that each concerned monitor needs to have a node object. However, for waiting on the condition, since all threads need to wait together, a single object needs to be queued in the condition. Moving out the condition and updating the node types yields :
     623
     624\begin{center}
     625{\resizebox{0.8\textwidth}{!}{\input{int_monitor}}}
     626\end{center}
     627
     628\newpage
     629
     630This picture and the proper entry and leave algorithms is the fundamental implementation of internal scheduling.
     631
     632\begin{multicols}{2}
     633Entry
     634\begin{pseudo}[numbers=left]
     635if monitor is free
     636        enter
     637elif I already own the monitor
     638        continue
     639else
     640        block
     641increment recursion
     642
     643\end{pseudo}
     644\columnbreak
     645Exit
     646\begin{pseudo}[numbers=left, firstnumber=8]
     647decrement recursion
     648if recursion == 0
     649        if signal_stack not empty
     650                set_owner to thread
     651                if all monitors ready
     652                        wake-up thread
     653
     654        if entry queue not empty
     655                wake-up thread
     656\end{pseudo}
     657\end{multicols}
     658
     659Some important things to notice about the exit routine. The solution discussed in \ref{inschedimpl} can be seen on line 11 of the previous pseudo code. Basically, the solution boils down to having a seperate data structure for the condition queue and the AS-stack, and unconditionally transferring ownership of the monitors but only unblocking the thread when the last monitor has trasnferred ownership. This solution is safe as well as preventing any potential barging.
    661660
    662661% ======================================================================
     
    665664% ======================================================================
    666665% ======================================================================
    667 An alternative to internal scheduling is external scheduling, e.g., in \uC.
    668 \begin{center}
    669 \begin{tabular}{|c|c|c|}
    670 Internal Scheduling & External Scheduling & Go\\
     666An alternative to internal scheduling is to use external scheduling.
     667\begin{center}
     668\begin{tabular}{|c|c|}
     669Internal Scheduling & External Scheduling \\
    671670\hline
    672 \begin{ucppcode}[tabsize=3]
     671\begin{ucppcode}
    673672_Monitor Semaphore {
    674673        condition c;
     
    676675public:
    677676        void P() {
    678                 if(inUse)
    679                         wait(c);
     677                if(inUse) wait(c);
    680678                inUse = true;
    681679        }
     
    685683        }
    686684}
    687 \end{ucppcode}&\begin{ucppcode}[tabsize=3]
     685\end{ucppcode}&\begin{ucppcode}
    688686_Monitor Semaphore {
    689687
     
    691689public:
    692690        void P() {
    693                 if(inUse)
    694                         _Accept(V);
     691                if(inUse) _Accept(V);
    695692                inUse = true;
    696693        }
     
    700697        }
    701698}
    702 \end{ucppcode}&\begin{gocode}[tabsize=3]
    703 type MySem struct {
    704         inUse bool
    705         c     chan bool
    706 }
    707 
    708 // acquire
    709 func (s MySem) P() {
    710         if s.inUse {
    711                 select {
    712                 case <-s.c:
    713                 }
    714         }
    715         s.inUse = true
    716 }
    717 
    718 // release
    719 func (s MySem) V() {
    720         s.inUse = false
    721 
    722         //This actually deadlocks
    723         //when single thread
    724         s.c <- false
    725 }
    726 \end{gocode}
     699\end{ucppcode}
    727700\end{tabular}
    728701\end{center}
    729 This method is more constrained and explicit, which helps users tone down the undeterministic nature of concurrency. Indeed, as the following examples demonstrates, external scheduling allows users to wait for events from other threads without the concern of unrelated events occuring. External scheduling can generally be done either in terms of control flow (e.g., \uC with \code{_Accept}) or in terms of data (e.g., Go with channels). Of course, both of these paradigms have their own strenghts and weaknesses but for this project control-flow semantics were chosen to stay consistent with the rest of the languages semantics. Two challenges specific to \CFA arise when trying to add external scheduling with loose object definitions and multi-monitor routines. The previous example shows a simple use \code{_Accept} versus \code{wait}/\code{signal} and its advantages. Note that while other languages often use \code{accept}/\code{select} as the core external scheduling keyword, \CFA uses \code{waitfor} to prevent name collisions with existing socket \acrshort{api}s.
    730 
    731 For the \code{P} member above using internal scheduling, the call to \code{wait} only guarantees that \code{V} is the last routine to access the monitor, allowing a third routine, say \code{isInUse()}, acquire mutual exclusion several times while routine \code{P} is waiting. On the other hand, external scheduling guarantees that while routine \code{P} is waiting, no routine other than \code{V} can acquire the monitor.
     702This method is more constrained and explicit, which may help users tone down the undeterministic nature of concurrency. Indeed, as the following examples demonstrates, external scheduling allows users to wait for events from other threads without the concern of unrelated events occuring. External scheduling can generally be done either in terms of control flow (e.g., \uC) or in terms of data (e.g. Go). Of course, both of these paradigms have their own strenghts and weaknesses but for this project control-flow semantics were chosen to stay consistent with the rest of the languages semantics. Two challenges specific to \CFA arise when trying to add external scheduling with loose object definitions and multi-monitor routines. The previous example shows a simple use \code{_Accept} versus \code{wait}/\code{signal} and its advantages. Note that while other languages often use \code{accept} as the core external scheduling keyword, \CFA uses \code{waitfor} to prevent name collisions with existing socket APIs.
     703
     704In the case of internal scheduling, the call to \code{wait} only guarantees that \code{V} is the last routine to access the monitor. This entails that the routine \code{V} may have acquired mutual exclusion several times while routine \code{P} was waiting. On the other hand, external scheduling guarantees that while routine \code{P} was waiting, no routine other than \code{V} could acquire the monitor.
    732705
    733706% ======================================================================
     
    736709% ======================================================================
    737710% ======================================================================
    738 In \uC, monitor declarations include an exhaustive list of monitor operations. Since \CFA is not object oriented, monitors become both more difficult to implement and less clear for a user:
    739 
    740 \begin{cfacode}
    741 monitor A {};
    742 
    743 void f(A & mutex a);
    744 void g(A & mutex a) {
    745         waitfor(f); //Obvious which f() to wait for
    746 }
    747 
    748 void f(A & mutex a, int); //New different F added in scope
    749 void h(A & mutex a) {
    750         waitfor(f); //Less obvious which f() to wait for
    751 }
     711In \uC, monitor declarations include an exhaustive list of monitor operations. Since \CFA is not object oriented it becomes both more difficult to implement but also less clear for the user:
     712
     713\begin{cfacode}
     714        monitor A {};
     715
     716        void f(A & mutex a);
     717        void f(int a, float b);
     718        void g(A & mutex a) {
     719                waitfor(f); // Less obvious which f() to wait for
     720        }
    752721\end{cfacode}
    753722
     
    759728        if monitor is free
    760729                enter
    761         elif already own the monitor
     730        elif I already own the monitor
    762731                continue
    763732        elif monitor accepts me
     
    769738\end{center}
    770739
    771 For the first two conditions, it is easy to implement a check that can evaluate the condition in a few instruction. However, a fast check for \pscode{monitor accepts me} is much harder to implement depending on the constraints put on the monitors. Indeed, monitors are often expressed as an entry queue and some acceptor queue as in the following figure:
     740For the fist two conditions, it is easy to implement a check that can evaluate the condition in a few instruction. However, a fast check for \pscode{monitor accepts me} is much harder to implement depending on the constraints put on the monitors. Indeed, monitors are often expressed as an entry queue and some acceptor queue as in the following figure:
    772741
    773742\begin{center}
     
    775744\end{center}
    776745
    777 There are other alternatives to these pictures, but in the case of this picture, implementing a fast accept check is relatively easy. Restricted to a fixed number of mutex members, N, the accept check reduces to updating a bitmask when the acceptor queue changes, a check that executes in a single instruction even with a fairly large number (e.g., 128) of mutex members. This technique cannot be used in \CFA because it relies on the fact that the monitor type enumerates (declares) all the acceptable routines. For OO languages this does not compromise much since monitors already have an exhaustive list of member routines. However, for \CFA this is not the case; routines can be added to a type anywhere after its declaration. It is important to note that the bitmask approach does not actually require an exhaustive list of routines, but it requires a dense unique ordering of routines with an upper-bound and that ordering must be consistent across translation units.
    778 The alternative is to alter the implementeation like this:
     746There are other alternatives to these pictures but in the case of this picture implementing a fast accept check is relatively easy. Indeed simply updating a bitmask when the acceptor queue changes is enough to have a check that executes in a single instruction, even with a fairly large number (e.g. 128) of mutex members. This technique cannot be used in \CFA because it relies on the fact that the monitor type declares all the acceptable routines. For OO languages this does not compromise much since monitors already have an exhaustive list of member routines. However, for \CFA this is not the case; routines can be added to a type anywhere after its declaration. Its important to note that the bitmask approach does not actually require an exhaustive list of routines, but it requires a dense unique ordering of routines with an upper-bound and that ordering must be consistent across translation units.
     747The alternative would be to have a picture more like this one:
    779748
    780749\begin{center}
     
    782751\end{center}
    783752
    784 Generating a mask dynamically means that the storage for the mask information can vary between calls to \code{waitfor}, allowing for more flexibility and extensions. Storing an array of accepted function-pointers replaces the single instruction bitmask compare with dereferencing a pointer followed by a linear search. Furthermore, supporting nested external scheduling (e.g., listing \ref{lst:nest-ext}) may now require additionnal searches on calls to \code{waitfor} statement to check if a routine is already queued in.
    785 
    786 \begin{figure}
    787 \begin{cfacode}
    788 monitor M {};
    789 void foo( M & mutex a ) {}
    790 void bar( M & mutex b ) {
    791         //Nested in the waitfor(bar, c) call
    792         waitfor(foo, b);
    793 }
    794 void baz( M & mutex c ) {
    795         waitfor(bar, c);
    796 }
    797 
    798 \end{cfacode}
    799 \caption{Example of nested external scheduling}
    800 \label{lst:nest-ext}
    801 \end{figure}
    802 
    803 Note that in the second picture, tasks need to always keep track of which routine they are attempting to acquire the monitor and the routine mask needs to have both a function pointer and a set of monitors, as will be discussed in the next section. These details where omitted from the picture for the sake of simplifying the representation.
    804 
    805 At this point, a decision must be made between flexibility and performance. Many design decisions in \CFA achieve both flexibility and performance, for example polymorphic routines add significant flexibility but inlining them means the optimizer can easily remove any runtime cost. Here however, the cost of flexibility cannot be trivially removed. In the end, the most flexible approach has been chosen since it allows users to write programs that would otherwise be prohibitively hard to write. This decision is based on the assumption that writing fast but inflexible locks is closer to a solved problems than writing locks that are as flexible as external scheduling in \CFA.
     753Not storing the queues inside the monitor means that the storage can vary between routines, allowing for more flexibility and extensions. Storing an array of function-pointers would solve the issue of uniquely identifying acceptable routines. However, the single instruction bitmask compare has been replaced by dereferencing a pointer followed by a linear search. Furthermore, supporting nested external scheduling may now require additionnal searches on calls to waitfor to check if a routine is already queued in.
     754
     755At this point we must make a decision between flexibility and performance. Many design decisions in \CFA achieve both flexibility and performance, for example polymorphic routines add significant flexibility but inlining them means the optimizer can easily remove any runtime cost. Here however, the cost of flexibility cannot be trivially removed. In the end, the most flexible approach has been chosen since it allows users to write programs that would otherwise be prohibitively hard to write. This is based on the assumption that writing fast but inflexible locks is closer to a solved problems than writing locks that are as flexible as external scheduling in \CFA.
     756
     757Another aspect to consider is what happens if multiple overloads of the same routine are used. For the time being it is assumed that multiple overloads of the same routine are considered as distinct routines. However, this could easily be extended in the future.
    806758
    807759% ======================================================================
     
    811763% ======================================================================
    812764
    813 External scheduling, like internal scheduling, becomes significantly more complex when introducing multi-monitor syntax. Even in the simplest possible case, some new semantics need to be established:
    814 \begin{cfacode}
    815 monitor M {};
    816 
    817 void f(M & mutex a);
    818 
    819 void g(M & mutex b, M & mutex c) {
    820         waitfor(f); //two monitors M => unkown which to pass to f(M & mutex)
    821 }
     765External scheduling, like internal scheduling, becomes orders of magnitude more complex when we start introducing multi-monitor syntax. Even in the simplest possible case some new semantics need to be established:
     766\begin{cfacode}
     767        mutex struct A {};
     768
     769        mutex struct B {};
     770
     771        void g(A & mutex a, B & mutex b) {
     772                waitfor(f); //ambiguous, which monitor
     773        }
    822774\end{cfacode}
    823775
     
    825777
    826778\begin{cfacode}
    827 monitor M {};
    828 
    829 void f(M & mutex a);
    830 
    831 void g(M & mutex a, M & mutex b) {
    832         waitfor( f, b );
    833 }
    834 \end{cfacode}
    835 
    836 This syntax is unambiguous. Both locks are acquired and kept by \code{g}. When routine \code{f} is called, the lock for monitor \code{b} is temporarily transferred from \code{g} to \code{f} (while \code{g} still holds lock \code{a}). This behavior can be extended to multi-monitor \code{waitfor} statement as follows.
    837 
    838 \begin{cfacode}
    839 monitor M {};
    840 
    841 void f(M & mutex a, M & mutex b);
    842 
    843 void g(M & mutex a, M & mutex b) {
    844         waitfor( f, a, b);
    845 }
    846 \end{cfacode}
    847 
    848 Note that the set of monitors passed to the \code{waitfor} statement must be entirely contained in the set of monitors already acquired in the routine. \code{waitfor} used in any other context is Undefined Behaviour.
    849 
    850 An important behavior to note is when a set of monitors only match partially :
    851 
    852 \begin{cfacode}
    853 mutex struct A {};
    854 
    855 mutex struct B {};
    856 
    857 void g(A & mutex a, B & mutex b) {
    858         waitfor(f, a, b);
    859 }
    860 
    861 A a1, a2;
    862 B b;
    863 
    864 void foo() {
    865         g(a1, b); //block on accept
    866 }
    867 
    868 void bar() {
    869         f(a2, b); //fufill cooperation
    870 }
    871 \end{cfacode}
    872 
    873 While the equivalent can happen when using internal scheduling, the fact that conditions are specific to a set of monitors means that users have to use two different condition variables. In both cases, partially matching monitor sets does not wake-up the waiting thread. It is also important to note that in the case of external scheduling, as for routine calls, the order of parameters is irrelevant; \code{waitfor(f,a,b)} and \code{waitfor(f,b,a)} are indistinguishable waiting condition.
    874 
    875 % ======================================================================
    876 % ======================================================================
    877 \subsection{\code{waitfor} semantics}
    878 % ======================================================================
    879 % ======================================================================
    880 
    881 Syntactically, the \code{waitfor} statement takes a function identifier and a set of monitors. While the set of monitors can be any list of expression, the function name is more restricted because the compiler validates at compile time the validity of the function type and the parameters used with the \code{waitfor} statement. It checks that the set of monitor passed in matches the requirements for a function call. Listing \ref{lst:waitfor} shows various usage of the waitfor statement and which are acceptable. The choice of the function type is made ignoring any non-\code{mutex} parameter. One limitation of the current implementation is that it does not handle overloading.
    882 \begin{figure}
    883 \begin{cfacode}
    884 monitor A{};
    885 monitor B{};
    886 
    887 void f1( A & mutex );
    888 void f2( A & mutex, B & mutex );
    889 void f3( A & mutex, int );
    890 void f4( A & mutex, int );
    891 void f4( A & mutex, double );
    892 
    893 void foo( A & mutex a1, A & mutex a2, B & mutex b1, B & b2 ) {
    894         A * ap = & a1;
    895         void (*fp)( A & mutex ) = f1;
    896 
    897         waitfor(f1, a1);     //Correct : 1 monitor case
    898         waitfor(f2, a1, b1); //Correct : 2 monitor case
    899         waitfor(f3, a1);     //Correct : non-mutex arguments are ignored
    900         waitfor(f1, *ap);    //Correct : expression as argument
    901 
    902         waitfor(f1, a1, b1); //Incorrect : Too many mutex arguments
    903         waitfor(f2, a1);     //Incorrect : Too few mutex arguments
    904         waitfor(f2, a1, a2); //Incorrect : Mutex arguments don't match
    905         waitfor(f1, 1);      //Incorrect : 1 not a mutex argument
    906         waitfor(f9, a1);     //Incorrect : f9 function does not exist
    907         waitfor(*fp, a1 );   //Incorrect : fp not an identifier
    908         waitfor(f4, a1);     //Incorrect : f4 ambiguous
    909 
    910         waitfor(f2, a1, b2); //Undefined Behaviour : b2 may not acquired
    911 }
    912 \end{cfacode}
    913 \caption{Various correct and incorrect uses of the waitfor statement}
    914 \label{lst:waitfor}
    915 \end{figure}
    916 
    917 Finally, for added flexibility, \CFA supports constructing complex \code{waitfor} mask using the \code{or}, \code{timeout} and \code{else}. Indeed, multiple \code{waitfor} can be chained together using \code{or}; this chain forms a single statement that uses baton-pass to any one function that fits one of the function+monitor set passed in. To eanble users to tell which accepted function is accepted, \code{waitfor}s are followed by a statement (including the null statement \code{;}) or a compound statement. When multiple \code{waitfor} are chained together, only the statement corresponding to the accepted function is executed. A \code{waitfor} chain can also be followed by a \code{timeout}, to signify an upper bound on the wait, or an \code{else}, to signify that the call should be non-blocking, that is only check of a matching function call already arrived and return immediately otherwise. Any and all of these clauses can be preceded by a \code{when} condition to dynamically construct the mask based on some current state. Listing \ref{lst:waitfor2}, demonstrates several complex masks and some incorrect ones.
    918 
    919 \begin{figure}
    920 \begin{cfacode}
    921 monitor A{};
    922 
    923 void f1( A & mutex );
    924 void f2( A & mutex );
    925 
    926 void foo( A & mutex a, bool b, int t ) {
    927         //Correct : blocking case
    928         waitfor(f1, a);
    929 
    930         //Correct : block with statement
    931         waitfor(f1, a) {
    932                 sout | "f1" | endl;
    933         }
    934 
    935         //Correct : block waiting for f1 or f2
    936         waitfor(f1, a) {
    937                 sout | "f1" | endl;
    938         } or waitfor(f2, a) {
    939                 sout | "f2" | endl;
    940         }
    941 
    942         //Correct : non-blocking case
    943         waitfor(f1, a); or else;
    944 
    945         //Correct : non-blocking case
    946         waitfor(f1, a) {
    947                 sout | "blocked" | endl;
    948         } or else {
    949                 sout | "didn't block" | endl;
    950         }
    951 
    952         //Correct : block at most 10 seconds
    953         waitfor(f1, a) {
    954                 sout | "blocked" | endl;
    955         } or timeout( 10`s) {
    956                 sout | "didn't block" | endl;
    957         }
    958 
    959         //Correct : block only if b == true
    960         //if b == false, don't even make the call
    961         when(b) waitfor(f1, a);
    962 
    963         //Correct : block only if b == true
    964         //if b == false, make non-blocking call
    965         waitfor(f1, a); or when(!b) else;
    966 
    967         //Correct : block only of t > 1
    968         waitfor(f1, a); or when(t > 1) timeout(t); or else;
    969 
    970         //Incorrect : timeout clause is dead code
    971         waitfor(f1, a); or timeout(t); or else;
    972 
    973         //Incorrect : order must be
    974         //waitfor [or waitfor... [or timeout] [or else]]
    975         timeout(t); or waitfor(f1, a); or else;
    976 }
    977 \end{cfacode}
    978 \caption{Various correct and incorrect uses of the or, else, and timeout clause around a waitfor statement}
    979 \label{lst:waitfor2}
    980 \end{figure}
    981 
    982 % ======================================================================
    983 % ======================================================================
    984 \subsection{Waiting for the destructor}
    985 % ======================================================================
    986 % ======================================================================
    987 An interesting use for the \code{waitfor} statement is destructor semantics. Indeed, the \code{waitfor} statement can accept any \code{mutex} routine, which includes the destructor (see section \ref{data}). However, with the semantics discussed until now, waiting for the destructor does not make any sense since using an object after its destructor is called is undefined behaviour. The simplest approach is to disallow \code{waitfor} on a destructor. However, a more expressive approach is to flip execution ordering when waiting for the destructor, meaning that waiting for the destructor allows the destructor to run after the current \code{mutex} routine, similarly to how a condition is signalled.
    988 \begin{figure}
    989 \begin{cfacode}
    990 monitor Executer {};
    991 struct  Action;
    992 
    993 void ^?{}   (Executer & mutex this);
    994 void execute(Executer & mutex this, const Action & );
    995 void run    (Executer & mutex this) {
    996         while(true) {
    997                    waitfor(execute, this);
    998                 or waitfor(^?{}   , this) {
    999                         break;
    1000                 }
    1001         }
    1002 }
    1003 \end{cfacode}
    1004 \caption{Example of an executor which executes action in series until the destructor is called.}
    1005 \label{lst:dtor-order}
    1006 \end{figure}
    1007 For example, listing \ref{lst:dtor-order} shows an example of an executor with an infinite loop, which waits for the destructor to break out of this loop. Switching the semantic meaning introduces an idiomatic way to terminate a task and/or wait for its termination via destruction.
     779        mutex struct A {};
     780
     781        mutex struct B {};
     782
     783        void g(A & mutex a, B & mutex b) {
     784                waitfor( f, b );
     785        }
     786\end{cfacode}
     787
     788This is unambiguous. Both locks will be acquired and kept, when routine \code{f} is called the lock for monitor \code{b} will be temporarily transferred from \code{g} to \code{f} (while \code{g} still holds lock \code{a}). This behavior can be extended to multi-monitor waitfor statment as follows.
     789
     790\begin{cfacode}
     791        mutex struct A {};
     792
     793        mutex struct B {};
     794
     795        void g(A & mutex a, B & mutex b) {
     796                waitfor( f, a, b);
     797        }
     798\end{cfacode}
     799
     800Note that the set of monitors passed to the \code{waitfor} statement must be entirely contained in the set of monitor already acquired in the routine. \code{waitfor} used in any other context is Undefined Behaviour.
     801
     802An important behavior to note is that what happens when set of monitors only match partially :
     803
     804\begin{cfacode}
     805        mutex struct A {};
     806
     807        mutex struct B {};
     808
     809        void g(A & mutex a, B & mutex b) {
     810                waitfor(f, a, b);
     811        }
     812
     813        A a1, a2;
     814        B b;
     815
     816        void foo() {
     817                g(a1, b);
     818        }
     819
     820        void bar() {
     821                f(a2, b);
     822        }
     823\end{cfacode}
     824
     825While the equivalent can happen when using internal scheduling, the fact that conditions are branded on first use means that users have to use two different condition variables. In both cases, partially matching monitor sets will not wake-up the waiting thread. It is also important to note that in the case of external scheduling, as for routine calls, the order of parameters is important; \code{waitfor(f,a,b)} and \code{waitfor(f,b,a)} are to distinct waiting condition.
     826
     827% ======================================================================
     828% ======================================================================
     829\subsection{Implementation Details: External scheduling queues}
     830% ======================================================================
     831% ======================================================================
     832To support multi-monitor external scheduling means that some kind of entry-queues must be used that is aware of both monitors. However, acceptable routines must be aware of the entry queues which means they must be stored inside at least one of the monitors that will be acquired. This in turn adds the requirement a systematic algorithm of disambiguating which queue is relavant regardless of user ordering. The proposed algorithm is to fall back on monitors lock ordering and specify that the monitor that is acquired first is the lock with the relevant entry queue. This assumes that the lock acquiring order is static for the lifetime of all concerned objects but that is a reasonable constraint. This algorithm choice has two consequences, the entry queue of the highest priority monitor is no longer a true FIFO queue and the queue of the lowest priority monitor is both required and probably unused. The queue can no longer be a FIFO queue because instead of simply containing the waiting threads in order arrival, they also contain the second mutex. Therefore, another thread with the same highest priority monitor but a different lowest priority monitor may arrive first but enter the critical section after a thread with the correct pairing. Secondly, since it may not be known at compile time which monitor will be the lowest priority monitor, every monitor needs to have the correct queues even though it is probable that half the multi-monitor queues will go unused for the entire duration of the program.
     833
     834% ======================================================================
     835% ======================================================================
     836\section{Other concurrency tools}
     837% ======================================================================
     838% ======================================================================
     839% \TODO
  • doc/proposals/concurrency/text/intro.tex

    r3f7e12cb r78315272  
    33% ======================================================================
    44
    5 This thesis provides a minimal concurrency \acrshort{api} that is simple, efficient and can be reused to build higher-level features. The simplest possible concurrency system is a thread and a lock but this low-level approach is hard to master. An easier approach for users is to support higher-level constructs as the basis of concurrency. Indeed, for highly productive concurrent programming, high-level approaches are much more popular~\cite{HPP:Study}. Examples are task based, message passing and implicit threading. The high-level approach and its minimal \acrshort{api} are tested in a dialect of C, call \CFA. Furthermore, the proposed \acrshort{api} doubles as an early definition of the \CFA language and library. This thesis also comes with an implementation of the concurrency library for \CFA as well as all the required language features added to the source-to-source translator.
     5This proposal provides a minimal concurrency API that is simple, efficient and can be reused to build higher-level features. The simplest possible concurrency system is a thread and a lock but this low-level approach is hard to master. An easier approach for users is to support higher-level constructs as the basis of the concurrency, in \CFA. Indeed, for highly productive parallel programming, high-level approaches are much more popular~\cite{HPP:Study}. Examples are task based, message passing and implicit threading. Therefore a high-level approach is adapted in \CFA
    66
    7 There are actually two problems that need to be solved in the design of concurrency for a programming language: which concurrency and which parallelism tools are available to the programmer. While these two concepts are often combined, they are in fact distinct, requiring different tools~\cite{Buhr05a}. Concurrency tools need to handle mutual exclusion and synchronization, while parallelism tools are about performance, cost and resource utilization.
     7There are actually two problems that need to be solved in the design of concurrency for a programming language: which concurrency and which parallelism tools are available to the users. While these two concepts are often combined, they are in fact distinct concepts that require different tools~\cite{Buhr05a}. Concurrency tools need to handle mutual exclusion and synchronization, while parallelism tools are about performance, cost and resource utilization.
  • doc/proposals/concurrency/text/parallelism.tex

    r3f7e12cb r78315272  
    1111\section{Paradigm}
    1212\subsection{User-level threads}
    13 A direct improvement on the \gls{kthread} approach is to use \glspl{uthread}. These threads offer most of the same features that the operating system already provide but can be used on a much larger scale. This approach is the most powerfull solution as it allows all the features of multi-threading, while removing several of the more expensive costs of kernel threads. The down side is that almost none of the low-level threading problems are hidden; users still have to think about data races, deadlocks and synchronization issues. These issues can be somewhat alleviated by a concurrency toolkit with strong garantees but the parallelism toolkit offers very little to reduce complexity in itself.
     13A direct improvement on the \gls{kthread} approach is to use \glspl{uthread}. These threads offer most of the same features that the operating system already provide but can be used on a much larger scale. This approach is the most powerfull solution as it allows all the features of multi-threading, while removing several of the more expensives costs of using kernel threads. The down side is that almost none of the low-level threading problems are hidden, users still have to think about data races, deadlocks and synchronization issues. These issues can be somewhat alleviated by a concurrency toolkit with strong garantees but the parallelism toolkit offers very little to reduce complexity in itself.
    1414
    1515Examples of languages that support \glspl{uthread} are Erlang~\cite{Erlang} and \uC~\cite{uC++book}.
    1616
    1717\subsection{Fibers : user-level threads without preemption}
    18 A popular varient of \glspl{uthread} is what is often refered to as \glspl{fiber}. However, \glspl{fiber} do not present meaningful semantical differences with \glspl{uthread}. The significant difference between \glspl{uthread} and \glspl{fiber} is the lack of \gls{preemption} in the later one. Advocates of \glspl{fiber} list their high performance and ease of implementation as majors strenghts of \glspl{fiber} but the performance difference between \glspl{uthread} and \glspl{fiber} is controversial, and the ease of implementation, while true, is a weak argument in the context of language design. Therefore this proposal largely ignores fibers.
     18A popular varient of \glspl{uthread} is what is often reffered to as \glspl{fiber}. However, \glspl{fiber} do not present meaningful semantical differences with \glspl{uthread}. Advocates of \glspl{fiber} list their high performance and ease of implementation as majors strenghts of \glspl{fiber} but the performance difference between \glspl{uthread} and \glspl{fiber} is controversial and the ease of implementation, while true, is a weak argument in the context of language design. Therefore this proposal largely ignore fibers.
    1919
    2020An example of a language that uses fibers is Go~\cite{Go}
    2121
    2222\subsection{Jobs and thread pools}
    23 An approach on the opposite end of the spectrum is to base parallelism on \glspl{pool}. Indeed, \glspl{pool} offer limited flexibility but at the benefit of a simpler user interface. In \gls{pool} based systems, users express parallelism as units of work, called jobs, and a dependency graph (either explicit or implicit) that tie them together. This approach means users need not worry about concurrency but significantly limit the interaction that can occur among jobs. Indeed, any \gls{job} that blocks also blocks the underlying worker, which effectively means the CPU utilization, and therefore throughput, suffers noticeably. It can be argued that a solution to this problem is to use more workers than available cores. However, unless the number of jobs and the number of workers are comparable, having a significant amount of blocked jobs always results in idles cores.
     23The approach on the opposite end of the spectrum is to base parallelism on \glspl{pool}. Indeed, \glspl{pool} offer limited flexibility but at the benefit of a simpler user interface. In \gls{pool} based systems, users express parallelism as units of work and a dependency graph (either explicit or implicit) that tie them together. This approach means users need not worry about concurrency but significantly limits the interaction that can occur among jobs. Indeed, any \gls{job} that blocks also blocks the underlying worker, which effectively means the CPU utilization, and therefore throughput, suffers noticeably. It can be argued that a solution to this problem is to use more workers than available cores. However, unless the number of jobs and the number of workers are comparable, having a significant amount of blocked jobs always results in idles cores.
    2424
    2525The gold standard of this implementation is Intel's TBB library~\cite{TBB}.
    2626
    2727\subsection{Paradigm performance}
    28 While the choice between the three paradigms listed above may have significant performance implication, it is difficult to pindown the performance implications of chosing a model at the language level. Indeed, in many situations one of these paradigms may show better performance but it all strongly depends on the workload. Having a large amount of mostly independent units of work to execute almost guarantess that the \gls{pool} based system has the best performance thanks to the lower memory overhead (i.e., no thread stack per job). However, interactions among jobs can easily exacerbate contention. User-level threads allow fine-grain context switching, which results in better resource utilisation, but a context switch is more expensive and the extra control means users need to tweak more variables to get the desired performance. Finally, if the units of uninterrupted work are large enough the paradigm choice is largely amortised by the actual work done.
     28While the choice between the three paradigms listed above may have significant performance implication, it is difficult to pindown the performance implications of chosing a model at the language level. Indeed, in many situations one of these paradigms may show better performance but it all strongly depends on the workload. Having a large amount of mostly independent units of work to execute almost guarantess that the \gls{pool} based system has the best performance thanks to the lower memory overhead. However, interactions between jobs can easily exacerbate contention. User-level threads allow fine-grain context switching, which results in better resource utilisation, but context switches will be more expansive and the extra control means users need to tweak more variables to get the desired performance. Furthermore, if the units of uninterrupted work are large enough the paradigm choice is largely amorticised by the actual work done.
    2929
    30 \section{The \protect\CFA\ Kernel : Processors, Clusters and Threads}\label{kernel}
     30\newpage
     31\TODO
     32\subsection{The \protect\CFA\ Kernel : Processors, Clusters and Threads}\label{kernel}
    3133
    32 \Glspl{cfacluster} have not been fully implmented in the context of this thesis, currently \CFA only supports one \gls{cfacluster}, the initial one. The objective of \gls{cfacluster} is to group \gls{kthread} with identical settings together. \Glspl{uthread} can be scheduled on a \glspl{kthread} of a given \gls{cfacluster}, allowing organization between \glspl{kthread} and \glspl{uthread}. It is important that \glspl{kthread} belonging to a same \glspl{cfacluster} have homogenous settings, otherwise migrating a \gls{uthread} from one \gls{kthread} to the other can cause issues.
    33 
    34 \subsection{Future Work: Machine setup}\label{machine}
    35 While this was not done in the context of this thesis, another important aspect of clusters is affinity. While many common desktop and laptop PCs have homogeneous CPUs, other devices often have more heteregenous setups. For example, system using \acrshort{numa} configurations may benefit from users being able to tie clusters and/or kernel threads to certains CPU cores. OS support for CPU affinity is now common \cit, which means it is both possible and desirable for \CFA to offer an abstraction mechanism for portable CPU affinity.
    3634
    3735\subsection{Paradigms}\label{cfaparadigms}
    38 Given these building blocks, it is possible to reproduce all three of the popular paradigms. Indeed, \glspl{uthread} is the default paradigm in \CFA. However, disabling \gls{preemption} on the \gls{cfacluster} means \glspl{cfathread} effectively become \glspl{fiber}. Since several \glspl{cfacluster} with different scheduling policy can coexist in the same application, this allows \glspl{fiber} and \glspl{uthread} to coexist in the runtime of an application. Finally, it is possible to build executors for thread pools from \glspl{uthread} or \glspl{fiber}.
     36Given these building blocks we can then reproduce the all three of the popular paradigms. Indeed, we get \glspl{uthread} as the default paradigm in \CFA. However, disabling \glspl{preemption} on the \gls{cfacluster} means \glspl{cfathread} effectively become \glspl{fiber}. Since several \glspl{cfacluster} with different scheduling policy can coexist in the same application, this allows \glspl{fiber} and \glspl{uthread} to coexist in the runtime of an application.
     37
     38% \subsection{High-level options}\label{tasks}
     39%
     40% \subsubsection{Thread interface}
     41% constructors destructors
     42%       initializer lists
     43% monitors
     44%
     45% \subsubsection{Futures}
     46%
     47% \subsubsection{Implicit threading}
     48% Finally, simpler applications can benefit greatly from having implicit parallelism. That is, parallelism that does not rely on the user to write concurrency. This type of parallelism can be achieved both at the language level and at the system level.
     49%
     50% \begin{center}
     51% \begin{tabular}[t]{|c|c|c|}
     52% Sequential & System Parallel & Language Parallel \\
     53% \begin{lstlisting}
     54% void big_sum(int* a, int* b,
     55%                int* out,
     56%                size_t length)
     57% {
     58%       for(int i = 0; i < length; ++i ) {
     59%               out[i] = a[i] + b[i];
     60%       }
     61% }
     62%
     63%
     64%
     65%
     66%
     67% int* a[10000];
     68% int* b[10000];
     69% int* c[10000];
     70% //... fill in a and b ...
     71% big_sum(a, b, c, 10000);
     72% \end{lstlisting} &\begin{lstlisting}
     73% void big_sum(int* a, int* b,
     74%                int* out,
     75%                size_t length)
     76% {
     77%       range ar(a, a + length);
     78%       range br(b, b + length);
     79%       range or(out, out + length);
     80%       parfor( ai, bi, oi,
     81%       [](int* ai, int* bi, int* oi) {
     82%               oi = ai + bi;
     83%       });
     84% }
     85%
     86% int* a[10000];
     87% int* b[10000];
     88% int* c[10000];
     89% //... fill in a and b ...
     90% big_sum(a, b, c, 10000);
     91% \end{lstlisting}&\begin{lstlisting}
     92% void big_sum(int* a, int* b,
     93%                int* out,
     94%                size_t length)
     95% {
     96%       for (ai, bi, oi) in (a, b, out) {
     97%               oi = ai + bi;
     98%       }
     99% }
     100%
     101%
     102%
     103%
     104%
     105% int* a[10000];
     106% int* b[10000];
     107% int* c[10000];
     108% //... fill in a and b ...
     109% big_sum(a, b, c, 10000);
     110% \end{lstlisting}
     111% \end{tabular}
     112% \end{center}
     113%
     114% \subsection{Machine setup}\label{machine}
     115% Threads are all good and well but wee still some OS support to fully utilize available hardware.
     116%
     117% \textbf{\large{Work in progress...}} Do wee need something beyond specifying the number of kernel threads?
  • doc/proposals/concurrency/thesis.tex

    r3f7e12cb r78315272  
    11% requires tex packages: texlive-base texlive-latex-base tex-common texlive-humanities texlive-latex-extra texlive-fonts-recommended
    22
    3 % inline code �...� (copyright symbol) emacs: C-q M-)
    4 % red highlighting �...� (registered trademark symbol) emacs: C-q M-.
    5 % blue highlighting �...� (sharp s symbol) emacs: C-q M-_
    6 % green highlighting �...� (cent symbol) emacs: C-q M-"
    7 % LaTex escape �...� (section symbol) emacs: C-q M-'
    8 % keyword escape �...� (pilcrow symbol) emacs: C-q M-^
     3% inline code ©...© (copyright symbol) emacs: C-q M-)
     4% red highlighting ®...® (registered trademark symbol) emacs: C-q M-.
     5% blue highlighting ß...ß (sharp s symbol) emacs: C-q M-_
     6% green highlighting ¢...¢ (cent symbol) emacs: C-q M-"
     7% LaTex escape §...§ (section symbol) emacs: C-q M-'
     8% keyword escape ¶...¶ (pilcrow symbol) emacs: C-q M-^
    99% math escape $...$ (dollar symbol)
    1010
     
    2727\usepackage{multicol}
    2828\usepackage[acronym]{glossaries}
    29 \usepackage{varioref}
     29\usepackage{varioref}   
    3030\usepackage{listings}                                           % format program code
    3131\usepackage[flushmargin]{footmisc}                              % support label/reference in footnote
     
    3535\usepackage[pagewise]{lineno}
    3636\usepackage{fancyhdr}
    37 \usepackage{float}
    3837\renewcommand{\linenumberfont}{\scriptsize\sffamily}
    39 \usepackage{siunitx}
    40 \sisetup{ binary-units=true }
    4138\input{style}                                                   % bespoke macros used in the document
    4239\usepackage[dvips,plainpages=false,pdfpagelabels,pdfpagemode=UseNone,colorlinks=true,pagebackref=true,linkcolor=blue,citecolor=blue,urlcolor=blue,pagebackref=true,breaklinks=true]{hyperref}
     
    7370%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
    7471
    75 \setcounter{secnumdepth}{2}                           % number subsubsections
    76 \setcounter{tocdepth}{2}                              % subsubsections in table of contents
     72\setcounter{secnumdepth}{3}                           % number subsubsections
     73\setcounter{tocdepth}{3}                              % subsubsections in table of contents
    7774% \linenumbers                                          % comment out to turn off line numbering
    7875\makeindex
     
    106103\input{parallelism}
    107104
    108 \input{internals}
    109 
    110 \input{together}
    111 
    112 \input{results}
    113 
    114 \input{future}
     105\chapter{Putting it all together}
    115106
    116107\chapter{Conclusion}
     108
     109\chapter{Future work}
     110Concurrency and parallelism is still a very active field that strongly benefits from hardware advances. As such certain features that aren't necessarily mature enough in their current state could become relevant in the lifetime of \CFA.
     111\subsection{Transactions}
    117112
    118113\section*{Acknowledgements}
  • doc/proposals/concurrency/version

    r3f7e12cb r78315272  
    1 0.11.47
     10.9.180
  • src/CodeGen/CodeGenerator.cc

    r3f7e12cb r78315272  
    287287        void CodeGenerator::postvisit( TypeDecl * typeDecl ) {
    288288                assertf( ! genC, "TypeDecls should not reach code generation." );
    289                 output << typeDecl->genTypeString() << " " << typeDecl->name;
    290                 if ( typeDecl->sized ) {
    291                         output << " | sized(" << typeDecl->name << ")";
    292                 }
    293                 if ( ! typeDecl->assertions.empty() ) {
     289                output << typeDecl->genTypeString() << " " << typeDecl->get_name();
     290                if ( typeDecl->get_kind() != TypeDecl::Any && typeDecl->get_sized() ) {
     291                        output << " | sized(" << typeDecl->get_name() << ")";
     292                }
     293                if ( ! typeDecl->get_assertions().empty() ) {
    294294                        output << " | { ";
    295                         for ( DeclarationWithType * assert :  typeDecl->assertions ) {
    296                                 assert->accept( *visitor );
    297                                 output << "; ";
    298                         }
     295                        genCommaList( typeDecl->get_assertions().begin(), typeDecl->get_assertions().end() );
    299296                        output << " }";
    300297                }
     
    446443        void CodeGenerator::postvisit( UntypedExpr * untypedExpr ) {
    447444                extension( untypedExpr );
    448                 if ( NameExpr * nameExpr = dynamic_cast< NameExpr* >( untypedExpr->function ) ) {
     445                if ( NameExpr * nameExpr = dynamic_cast< NameExpr* >( untypedExpr->get_function() ) ) {
    449446                        OperatorInfo opInfo;
    450                         if ( operatorLookup( nameExpr->name, opInfo ) ) {
    451                                 std::list< Expression* >::iterator arg = untypedExpr->args.begin();
     447                        if ( operatorLookup( nameExpr->get_name(), opInfo ) ) {
     448                                std::list< Expression* >::iterator arg = untypedExpr->get_args().begin();
    452449                                switch ( opInfo.type ) {
    453450                                  case OT_INDEX:
    454                                         assert( untypedExpr->args.size() == 2 );
     451                                        assert( untypedExpr->get_args().size() == 2 );
    455452                                        (*arg++)->accept( *visitor );
    456453                                        output << "[";
     
    464461                                  case OT_CTOR:
    465462                                  case OT_DTOR:
    466                                         if ( untypedExpr->args.size() == 1 ) {
     463                                        if ( untypedExpr->get_args().size() == 1 ) {
    467464                                                // the expression fed into a single parameter constructor or destructor may contain side
    468465                                                // effects, so must still output this expression
     
    483480                                                (*arg++)->accept( *visitor );
    484481                                                output << opInfo.symbol << "{ ";
    485                                                 genCommaList( arg, untypedExpr->args.end() );
     482                                                genCommaList( arg, untypedExpr->get_args().end() );
    486483                                                output << "}) /* " << opInfo.inputName << " */";
    487484                                        } // if
     
    491488                                  case OT_PREFIXASSIGN:
    492489                                  case OT_LABELADDRESS:
    493                                         assert( untypedExpr->args.size() == 1 );
     490                                        assert( untypedExpr->get_args().size() == 1 );
    494491                                        output << "(";
    495492                                        output << opInfo.symbol;
     
    500497                                  case OT_POSTFIX:
    501498                                  case OT_POSTFIXASSIGN:
    502                                         assert( untypedExpr->args.size() == 1 );
     499                                        assert( untypedExpr->get_args().size() == 1 );
    503500                                        (*arg)->accept( *visitor );
    504501                                        output << opInfo.symbol;
     
    507504                                  case OT_INFIX:
    508505                                  case OT_INFIXASSIGN:
    509                                         assert( untypedExpr->args.size() == 2 );
     506                                        assert( untypedExpr->get_args().size() == 2 );
    510507                                        output << "(";
    511508                                        (*arg++)->accept( *visitor );
     
    520517                                } // switch
    521518                        } else {
    522                                 // builtin routines
    523                                 nameExpr->accept( *visitor );
    524                                 output << "(";
    525                                 genCommaList( untypedExpr->args.begin(), untypedExpr->args.end() );
    526                                 output << ")";
     519                                if ( nameExpr->get_name() == "..." ) { // case V1 ... V2 or case V1~V2
     520                                        assert( untypedExpr->get_args().size() == 2 );
     521                                        (*untypedExpr->get_args().begin())->accept( *visitor );
     522                                        output << " ... ";
     523                                        (*--untypedExpr->get_args().end())->accept( *visitor );
     524                                } else {                                                                // builtin routines
     525                                        nameExpr->accept( *visitor );
     526                                        output << "(";
     527                                        genCommaList( untypedExpr->get_args().begin(), untypedExpr->get_args().end() );
     528                                        output << ")";
     529                                } // if
    527530                        } // if
    528531                } else {
    529                         untypedExpr->function->accept( *visitor );
     532                        untypedExpr->get_function()->accept( *visitor );
    530533                        output << "(";
    531                         genCommaList( untypedExpr->args.begin(), untypedExpr->args.end() );
     534                        genCommaList( untypedExpr->get_args().begin(), untypedExpr->get_args().end() );
    532535                        output << ")";
    533536                } // if
     
    535538
    536539        void CodeGenerator::postvisit( RangeExpr * rangeExpr ) {
    537                 rangeExpr->low->accept( *visitor );
     540                rangeExpr->get_low()->accept( *visitor );
    538541                output << " ... ";
    539                 rangeExpr->high->accept( *visitor );
     542                rangeExpr->get_high()->accept( *visitor );
    540543        }
    541544
     
    543546                extension( nameExpr );
    544547                OperatorInfo opInfo;
    545                 if ( operatorLookup( nameExpr->name, opInfo ) ) {
    546                         if ( opInfo.type == OT_CONSTANT ) {
    547                                 output << opInfo.symbol;
    548                         } else {
    549                                 output << opInfo.outputName;
    550                         }
     548                if ( operatorLookup( nameExpr->get_name(), opInfo ) ) {
     549                        assert( opInfo.type == OT_CONSTANT );
     550                        output << opInfo.symbol;
    551551                } else {
    552552                        output << nameExpr->get_name();
     
    885885
    886886        void CodeGenerator::postvisit( CaseStmt * caseStmt ) {
    887                 updateLocation( caseStmt );
    888                 output << indent;
    889887                if ( caseStmt->isDefault()) {
    890888                        output << "default";
     
    949947                output << ";";
    950948        }
    951         void CodeGenerator::postvisit( CatchStmt * stmt ) {
    952                 assertf( ! genC, "Catch statements should not reach code generation." );
    953 
    954                 output << ((stmt->get_kind() == CatchStmt::Terminate) ?
    955                 "catch" : "catchResume");
    956                 output << "( ";
    957                 stmt->decl->accept( *visitor );
    958                 output << " ) ";
    959 
    960                 if( stmt->cond ) {
    961                         output << "if/when(?) (";
    962                         stmt->cond->accept( *visitor );
    963                         output << ") ";
    964                 }
    965                 stmt->body->accept( *visitor );
    966         }
    967 
    968         void CodeGenerator::postvisit( WaitForStmt * stmt ) {
    969                 assertf( ! genC, "Waitfor statements should not reach code generation." );
    970 
    971                 bool first = true;
    972                 for( auto & clause : stmt->clauses ) {
    973                         if(first) { output << "or "; first = false; }
    974                         if( clause.condition ) {
    975                                 output << "when(";
    976                                 stmt->timeout.condition->accept( *visitor );
    977                                 output << ") ";
    978                         }
    979                         output << "waitfor(";
    980                         clause.target.function->accept( *visitor );
    981                         for( Expression * expr : clause.target.arguments ) {
    982                                 output << ",";
    983                                 expr->accept( *visitor );
    984                         }
    985                         output << ") ";
    986                         clause.statement->accept( *visitor );
    987                 }
    988 
    989                 if( stmt->timeout.statement ) {
    990                         output << "or ";
    991                         if( stmt->timeout.condition ) {
    992                                 output << "when(";
    993                                 stmt->timeout.condition->accept( *visitor );
    994                                 output << ") ";
    995                         }
    996                         output << "timeout(";
    997                         stmt->timeout.time->accept( *visitor );
    998                         output << ") ";
    999                         stmt->timeout.statement->accept( *visitor );
    1000                 }
    1001 
    1002                 if( stmt->orelse.statement ) {
    1003                         output << "or ";
    1004                         if( stmt->orelse.condition ) {
    1005                                 output << "when(";
    1006                                 stmt->orelse.condition->accept( *visitor );
    1007                                 output << ")";
    1008                         }
    1009                         output << "else ";
    1010                         stmt->orelse.statement->accept( *visitor );
    1011                 }
    1012         }
    1013 
    1014949
    1015950        void CodeGenerator::postvisit( WhileStmt * whileStmt ) {
     
    10901025        }
    10911026} // namespace CodeGen
    1092 
    1093 
    1094 unsigned Indenter::tabsize = 2;
    1095 
    1096 std::ostream & operator<<( std::ostream & out, const BaseSyntaxNode * node ) {
    1097         if ( node ) {
    1098                 node->print( out );
    1099         } else {
    1100                 out << "nullptr";
    1101         }
    1102         return out;
    1103 }
    11041027
    11051028// Local Variables: //
  • src/CodeGen/CodeGenerator.h

    r3f7e12cb r78315272  
    100100                void postvisit( ReturnStmt * );
    101101                void postvisit( ThrowStmt * );
    102                 void postvisit( CatchStmt * );
    103                 void postvisit( WaitForStmt * );
    104102                void postvisit( WhileStmt * );
    105103                void postvisit( ForStmt * );
  • src/CodeGen/FixNames.cc

    r3f7e12cb r78315272  
    6666                );
    6767
    68                 main_type->get_parameters().push_back(
     68                mainDecl->get_functionType()->get_parameters().push_back(
    6969                        new ObjectDecl( "", Type::StorageClasses(), LinkageSpec::Cforall, 0, new BasicType( Type::Qualifiers(), BasicType::SignedInt ), nullptr )
    7070                );
    7171
    72                 main_type->get_parameters().push_back(
     72                mainDecl->get_functionType()->get_parameters().push_back(
    7373                        new ObjectDecl( "", Type::StorageClasses(), LinkageSpec::Cforall, 0,
    7474                        new PointerType( Type::Qualifiers(), new PointerType( Type::Qualifiers(), new BasicType( Type::Qualifiers(), BasicType::Char ) ) ),
  • src/CodeGen/GenType.cc

    r3f7e12cb r78315272  
    210210
    211211        std::string GenType::handleGeneric( ReferenceToType * refType ) {
    212                 if ( ! refType->parameters.empty() ) {
     212                if ( ! refType->get_parameters().empty() ) {
    213213                        std::ostringstream os;
    214214                        PassVisitor<CodeGenerator> cg( os, pretty, genC, lineMarks );
    215215                        os << "(";
    216                         cg.pass.genCommaList( refType->parameters.begin(), refType->parameters.end() );
     216                        cg.pass.genCommaList( refType->get_parameters().begin(), refType->get_parameters().end() );
    217217                        os << ") ";
    218218                        return os.str();
  • src/Common/Indenter.h

    r3f7e12cb r78315272  
    1818
    1919struct Indenter {
    20         static unsigned tabsize;
    21 
    22         Indenter( unsigned int amt = tabsize, unsigned int indent = 0 ) : amt( amt ), indent( indent ) {}
    23         unsigned int amt;  // amount 1 level increases indent by (i.e. how much to increase by in operator++)
    24         unsigned int indent;
     20        Indenter( unsigned int amt = 2 ) : amt( amt ) {}
     21        unsigned int amt = 2;  // amount 1 level increases indent by (i.e. how much to increase by in operator++)
     22        unsigned int indent = 0;
    2523
    2624        Indenter & operator+=(int nlevels) { indent += amt*nlevels; return *this; }
     
    3230};
    3331
    34 inline std::ostream & operator<<( std::ostream & out, const Indenter & indent ) {
     32inline std::ostream & operator<<( std::ostream & out, Indenter & indent ) {
    3533        return out << std::string(indent.indent, ' ');
    3634}
  • src/Common/PassVisitor.h

    r3f7e12cb r78315272  
    44
    55#include <stack>
    6 
    7 #include "Common/utility.h"
    86
    97#include "SynTree/Mutator.h"
     
    1210#include "SymTab/Indexer.h"
    1311
    14 #include "SynTree/Attribute.h"
    1512#include "SynTree/Initializer.h"
    1613#include "SynTree/Statement.h"
     
    5653        pass_type pass;
    5754
    58         virtual void visit( ObjectDecl * objectDecl ) override final;
    59         virtual void visit( FunctionDecl * functionDecl ) override final;
    60         virtual void visit( StructDecl * aggregateDecl ) override final;
    61         virtual void visit( UnionDecl * aggregateDecl ) override final;
    62         virtual void visit( EnumDecl * aggregateDecl ) override final;
    63         virtual void visit( TraitDecl * aggregateDecl ) override final;
    64         virtual void visit( TypeDecl * typeDecl ) override final;
    65         virtual void visit( TypedefDecl * typeDecl ) override final;
    66         virtual void visit( AsmDecl * asmDecl ) override final;
    67 
    68         virtual void visit( CompoundStmt * compoundStmt ) override final;
    69         virtual void visit( ExprStmt * exprStmt ) override final;
    70         virtual void visit( AsmStmt * asmStmt ) override final;
    71         virtual void visit( IfStmt * ifStmt ) override final;
    72         virtual void visit( WhileStmt * whileStmt ) override final;
    73         virtual void visit( ForStmt * forStmt ) override final;
    74         virtual void visit( SwitchStmt * switchStmt ) override final;
    75         virtual void visit( CaseStmt * caseStmt ) override final;
    76         virtual void visit( BranchStmt * branchStmt ) override final;
    77         virtual void visit( ReturnStmt * returnStmt ) override final;
    78         virtual void visit( ThrowStmt * throwStmt ) override final;
    79         virtual void visit( TryStmt * tryStmt ) override final;
    80         virtual void visit( CatchStmt * catchStmt ) override final;
    81         virtual void visit( FinallyStmt * finallyStmt ) override final;
    82         virtual void visit( WaitForStmt * waitforStmt ) override final;
    83         virtual void visit( NullStmt * nullStmt ) override final;
    84         virtual void visit( DeclStmt * declStmt ) override final;
    85         virtual void visit( ImplicitCtorDtorStmt * impCtorDtorStmt ) override final;
    86 
    87         virtual void visit( ApplicationExpr * applicationExpr ) override final;
    88         virtual void visit( UntypedExpr * untypedExpr ) override final;
    89         virtual void visit( NameExpr * nameExpr ) override final;
    90         virtual void visit( CastExpr * castExpr ) override final;
    91         virtual void visit( VirtualCastExpr * castExpr ) override final;
    92         virtual void visit( AddressExpr * addressExpr ) override final;
    93         virtual void visit( LabelAddressExpr * labAddressExpr ) override final;
    94         virtual void visit( UntypedMemberExpr * memberExpr ) override final;
    95         virtual void visit( MemberExpr * memberExpr ) override final;
    96         virtual void visit( VariableExpr * variableExpr ) override final;
    97         virtual void visit( ConstantExpr * constantExpr ) override final;
    98         virtual void visit( SizeofExpr * sizeofExpr ) override final;
    99         virtual void visit( AlignofExpr * alignofExpr ) override final;
    100         virtual void visit( UntypedOffsetofExpr * offsetofExpr ) override final;
    101         virtual void visit( OffsetofExpr * offsetofExpr ) override final;
    102         virtual void visit( OffsetPackExpr * offsetPackExpr ) override final;
    103         virtual void visit( AttrExpr * attrExpr ) override final;
    104         virtual void visit( LogicalExpr * logicalExpr ) override final;
    105         virtual void visit( ConditionalExpr * conditionalExpr ) override final;
    106         virtual void visit( CommaExpr * commaExpr ) override final;
    107         virtual void visit( TypeExpr * typeExpr ) override final;
    108         virtual void visit( AsmExpr * asmExpr ) override final;
    109         virtual void visit( ImplicitCopyCtorExpr * impCpCtorExpr ) override final;
    110         virtual void visit( ConstructorExpr *  ctorExpr ) override final;
    111         virtual void visit( CompoundLiteralExpr * compLitExpr ) override final;
    112         virtual void visit( RangeExpr * rangeExpr ) override final;
    113         virtual void visit( UntypedTupleExpr * tupleExpr ) override final;
    114         virtual void visit( TupleExpr * tupleExpr ) override final;
    115         virtual void visit( TupleIndexExpr * tupleExpr ) override final;
    116         virtual void visit( TupleAssignExpr * assignExpr ) override final;
    117         virtual void visit( StmtExpr *  stmtExpr ) override final;
    118         virtual void visit( UniqueExpr *  uniqueExpr ) override final;
    119 
    120         virtual void visit( VoidType * basicType ) override final;
    121         virtual void visit( BasicType * basicType ) override final;
    122         virtual void visit( PointerType * pointerType ) override final;
    123         virtual void visit( ArrayType * arrayType ) override final;
    124         virtual void visit( ReferenceType * referenceType ) override final;
    125         virtual void visit( FunctionType * functionType ) override final;
    126         virtual void visit( StructInstType * aggregateUseType ) override final;
    127         virtual void visit( UnionInstType * aggregateUseType ) override final;
    128         virtual void visit( EnumInstType * aggregateUseType ) override final;
    129         virtual void visit( TraitInstType * aggregateUseType ) override final;
    130         virtual void visit( TypeInstType * aggregateUseType ) override final;
    131         virtual void visit( TupleType * tupleType ) override final;
    132         virtual void visit( TypeofType * typeofType ) override final;
    133         virtual void visit( AttrType * attrType ) override final;
    134         virtual void visit( VarArgsType * varArgsType ) override final;
    135         virtual void visit( ZeroType * zeroType ) override final;
    136         virtual void visit( OneType * oneType ) override final;
    137 
    138         virtual void visit( Designation * designation ) override final;
    139         virtual void visit( SingleInit * singleInit ) override final;
    140         virtual void visit( ListInit * listInit ) override final;
    141         virtual void visit( ConstructorInit * ctorInit ) override final;
    142 
    143         virtual void visit( Subrange * subrange ) override final;
    144 
    145         virtual void visit( Constant * constant ) override final;
    146 
    147         virtual void visit( Attribute * attribute ) override final;
    148 
    149         virtual DeclarationWithType * mutate( ObjectDecl * objectDecl ) override final;
    150         virtual DeclarationWithType * mutate( FunctionDecl * functionDecl ) override final;
    151         virtual Declaration * mutate( StructDecl * aggregateDecl ) override final;
    152         virtual Declaration * mutate( UnionDecl * aggregateDecl ) override final;
    153         virtual Declaration * mutate( EnumDecl * aggregateDecl ) override final;
    154         virtual Declaration * mutate( TraitDecl * aggregateDecl ) override final;
    155         virtual Declaration * mutate( TypeDecl * typeDecl ) override final;
    156         virtual Declaration * mutate( TypedefDecl * typeDecl ) override final;
    157         virtual AsmDecl * mutate( AsmDecl * asmDecl ) override final;
    158 
    159         virtual CompoundStmt * mutate( CompoundStmt * compoundStmt ) override final;
    160         virtual Statement * mutate( ExprStmt * exprStmt ) override final;
    161         virtual Statement * mutate( AsmStmt * asmStmt ) override final;
    162         virtual Statement * mutate( IfStmt * ifStmt ) override final;
    163         virtual Statement * mutate( WhileStmt * whileStmt ) override final;
    164         virtual Statement * mutate( ForStmt * forStmt ) override final;
    165         virtual Statement * mutate( SwitchStmt * switchStmt ) override final;
    166         virtual Statement * mutate( CaseStmt * caseStmt ) override final;
    167         virtual Statement * mutate( BranchStmt * branchStmt ) override final;
    168         virtual Statement * mutate( ReturnStmt * returnStmt ) override final;
    169         virtual Statement * mutate( ThrowStmt * throwStmt ) override final;
    170         virtual Statement * mutate( TryStmt * tryStmt ) override final;
    171         virtual Statement * mutate( CatchStmt * catchStmt ) override final;
    172         virtual Statement * mutate( FinallyStmt * finallyStmt ) override final;
    173         virtual Statement * mutate( WaitForStmt * waitforStmt ) override final;
    174         virtual NullStmt * mutate( NullStmt * nullStmt ) override final;
    175         virtual Statement * mutate( DeclStmt * declStmt ) override final;
    176         virtual Statement * mutate( ImplicitCtorDtorStmt * impCtorDtorStmt ) override final;
    177 
    178         virtual Expression * mutate( ApplicationExpr * applicationExpr ) override final;
    179         virtual Expression * mutate( UntypedExpr * untypedExpr ) override final;
    180         virtual Expression * mutate( NameExpr * nameExpr ) override final;
    181         virtual Expression * mutate( AddressExpr * castExpr ) override final;
    182         virtual Expression * mutate( LabelAddressExpr * labAddressExpr ) override final;
    183         virtual Expression * mutate( CastExpr * castExpr ) override final;
    184         virtual Expression * mutate( VirtualCastExpr * castExpr ) override final;
    185         virtual Expression * mutate( UntypedMemberExpr * memberExpr ) override final;
    186         virtual Expression * mutate( MemberExpr * memberExpr ) override final;
    187         virtual Expression * mutate( VariableExpr * variableExpr ) override final;
    188         virtual Expression * mutate( ConstantExpr * constantExpr ) override final;
    189         virtual Expression * mutate( SizeofExpr * sizeofExpr ) override final;
    190         virtual Expression * mutate( AlignofExpr * alignofExpr ) override final;
    191         virtual Expression * mutate( UntypedOffsetofExpr * offsetofExpr ) override final;
    192         virtual Expression * mutate( OffsetofExpr * offsetofExpr ) override final;
    193         virtual Expression * mutate( OffsetPackExpr * offsetPackExpr ) override final;
    194         virtual Expression * mutate( AttrExpr * attrExpr ) override final;
    195         virtual Expression * mutate( LogicalExpr * logicalExpr ) override final;
    196         virtual Expression * mutate( ConditionalExpr * conditionalExpr ) override final;
    197         virtual Expression * mutate( CommaExpr * commaExpr ) override final;
    198         virtual Expression * mutate( TypeExpr * typeExpr ) override final;
    199         virtual Expression * mutate( AsmExpr * asmExpr ) override final;
    200         virtual Expression * mutate( ImplicitCopyCtorExpr * impCpCtorExpr ) override final;
    201         virtual Expression * mutate( ConstructorExpr * ctorExpr ) override final;
    202         virtual Expression * mutate( CompoundLiteralExpr * compLitExpr ) override final;
    203         virtual Expression * mutate( RangeExpr * rangeExpr ) override final;
    204         virtual Expression * mutate( UntypedTupleExpr * tupleExpr ) override final;
    205         virtual Expression * mutate( TupleExpr * tupleExpr ) override final;
    206         virtual Expression * mutate( TupleIndexExpr * tupleExpr ) override final;
    207         virtual Expression * mutate( TupleAssignExpr * assignExpr ) override final;
    208         virtual Expression * mutate( StmtExpr *  stmtExpr ) override final;
    209         virtual Expression * mutate( UniqueExpr *  uniqueExpr ) override final;
    210 
    211         virtual Type * mutate( VoidType * basicType ) override final;
    212         virtual Type * mutate( BasicType * basicType ) override final;
    213         virtual Type * mutate( PointerType * pointerType ) override final;
    214         virtual Type * mutate( ArrayType * arrayType ) override final;
    215         virtual Type * mutate( ReferenceType * referenceType ) override final;
    216         virtual Type * mutate( FunctionType * functionType ) override final;
    217         virtual Type * mutate( StructInstType * aggregateUseType ) override final;
    218         virtual Type * mutate( UnionInstType * aggregateUseType ) override final;
    219         virtual Type * mutate( EnumInstType * aggregateUseType ) override final;
    220         virtual Type * mutate( TraitInstType * aggregateUseType ) override final;
    221         virtual Type * mutate( TypeInstType * aggregateUseType ) override final;
    222         virtual Type * mutate( TupleType * tupleType ) override final;
    223         virtual Type * mutate( TypeofType * typeofType ) override final;
    224         virtual Type * mutate( AttrType * attrType ) override final;
    225         virtual Type * mutate( VarArgsType * varArgsType ) override final;
    226         virtual Type * mutate( ZeroType * zeroType ) override final;
    227         virtual Type * mutate( OneType * oneType ) override final;
    228 
    229         virtual Designation * mutate( Designation * designation ) override final;
    230         virtual Initializer * mutate( SingleInit * singleInit ) override final;
    231         virtual Initializer * mutate( ListInit * listInit ) override final;
    232         virtual Initializer * mutate( ConstructorInit * ctorInit ) override final;
    233 
    234         virtual Subrange * mutate( Subrange * subrange ) override final;
    235 
    236         virtual Constant * mutate( Constant * constant ) override final;
    237 
    238         virtual Attribute * mutate( Attribute * attribute ) override final;
    239 
    240         virtual TypeSubstitution * mutate( TypeSubstitution * sub ) final;
     55        virtual void visit( ObjectDecl *objectDecl ) override final;
     56        virtual void visit( FunctionDecl *functionDecl ) override final;
     57        virtual void visit( StructDecl *aggregateDecl ) override final;
     58        virtual void visit( UnionDecl *aggregateDecl ) override final;
     59        virtual void visit( EnumDecl *aggregateDecl ) override final;
     60        virtual void visit( TraitDecl *aggregateDecl ) override final;
     61        virtual void visit( TypeDecl *typeDecl ) override final;
     62        virtual void visit( TypedefDecl *typeDecl ) override final;
     63        virtual void visit( AsmDecl *asmDecl ) override final;
     64
     65        virtual void visit( CompoundStmt *compoundStmt ) override final;
     66        virtual void visit( ExprStmt *exprStmt ) override final;
     67        virtual void visit( AsmStmt *asmStmt ) override final;
     68        virtual void visit( IfStmt *ifStmt ) override final;
     69        virtual void visit( WhileStmt *whileStmt ) override final;
     70        virtual void visit( ForStmt *forStmt ) override final;
     71        virtual void visit( SwitchStmt *switchStmt ) override final;
     72        virtual void visit( CaseStmt *caseStmt ) override final;
     73        virtual void visit( BranchStmt *branchStmt ) override final;
     74        virtual void visit( ReturnStmt *returnStmt ) override final;
     75        virtual void visit( ThrowStmt *throwStmt ) override final;
     76        virtual void visit( TryStmt *tryStmt ) override final;
     77        virtual void visit( CatchStmt *catchStmt ) override final;
     78        virtual void visit( FinallyStmt *finallyStmt ) override final;
     79        virtual void visit( WaitForStmt *waitforStmt ) override final;
     80        virtual void visit( NullStmt *nullStmt ) override final;
     81        virtual void visit( DeclStmt *declStmt ) override final;
     82        virtual void visit( ImplicitCtorDtorStmt *impCtorDtorStmt ) override final;
     83
     84        virtual void visit( ApplicationExpr *applicationExpr ) override final;
     85        virtual void visit( UntypedExpr *untypedExpr ) override final;
     86        virtual void visit( NameExpr *nameExpr ) override final;
     87        virtual void visit( CastExpr *castExpr ) override final;
     88        virtual void visit( VirtualCastExpr *castExpr ) override final;
     89        virtual void visit( AddressExpr *addressExpr ) override final;
     90        virtual void visit( LabelAddressExpr *labAddressExpr ) override final;
     91        virtual void visit( UntypedMemberExpr *memberExpr ) override final;
     92        virtual void visit( MemberExpr *memberExpr ) override final;
     93        virtual void visit( VariableExpr *variableExpr ) override final;
     94        virtual void visit( ConstantExpr *constantExpr ) override final;
     95        virtual void visit( SizeofExpr *sizeofExpr ) override final;
     96        virtual void visit( AlignofExpr *alignofExpr ) override final;
     97        virtual void visit( UntypedOffsetofExpr *offsetofExpr ) override final;
     98        virtual void visit( OffsetofExpr *offsetofExpr ) override final;
     99        virtual void visit( OffsetPackExpr *offsetPackExpr ) override final;
     100        virtual void visit( AttrExpr *attrExpr ) override final;
     101        virtual void visit( LogicalExpr *logicalExpr ) override final;
     102        virtual void visit( ConditionalExpr *conditionalExpr ) override final;
     103        virtual void visit( CommaExpr *commaExpr ) override final;
     104        virtual void visit( TypeExpr *typeExpr ) override final;
     105        virtual void visit( AsmExpr *asmExpr ) override final;
     106        virtual void visit( ImplicitCopyCtorExpr *impCpCtorExpr ) override final;
     107        virtual void visit( ConstructorExpr * ctorExpr ) override final;
     108        virtual void visit( CompoundLiteralExpr *compLitExpr ) override final;
     109        virtual void visit( RangeExpr *rangeExpr ) override final;
     110        virtual void visit( UntypedTupleExpr *tupleExpr ) override final;
     111        virtual void visit( TupleExpr *tupleExpr ) override final;
     112        virtual void visit( TupleIndexExpr *tupleExpr ) override final;
     113        virtual void visit( TupleAssignExpr *assignExpr ) override final;
     114        virtual void visit( StmtExpr * stmtExpr ) override final;
     115        virtual void visit( UniqueExpr * uniqueExpr ) override final;
     116
     117        virtual void visit( VoidType *basicType ) override final;
     118        virtual void visit( BasicType *basicType ) override final;
     119        virtual void visit( PointerType *pointerType ) override final;
     120        virtual void visit( ArrayType *arrayType ) override final;
     121        virtual void visit( ReferenceType *referenceType ) override final;
     122        virtual void visit( FunctionType *functionType ) override final;
     123        virtual void visit( StructInstType *aggregateUseType ) override final;
     124        virtual void visit( UnionInstType *aggregateUseType ) override final;
     125        virtual void visit( EnumInstType *aggregateUseType ) override final;
     126        virtual void visit( TraitInstType *aggregateUseType ) override final;
     127        virtual void visit( TypeInstType *aggregateUseType ) override final;
     128        virtual void visit( TupleType *tupleType ) override final;
     129        virtual void visit( TypeofType *typeofType ) override final;
     130        virtual void visit( AttrType *attrType ) override final;
     131        virtual void visit( VarArgsType *varArgsType ) override final;
     132        virtual void visit( ZeroType *zeroType ) override final;
     133        virtual void visit( OneType *oneType ) override final;
     134
     135        virtual void visit( Designation *designation ) override final;
     136        virtual void visit( SingleInit *singleInit ) override final;
     137        virtual void visit( ListInit *listInit ) override final;
     138        virtual void visit( ConstructorInit *ctorInit ) override final;
     139
     140        virtual void visit( Subrange *subrange ) override final;
     141
     142        virtual void visit( Constant *constant ) override final;
     143
     144        virtual DeclarationWithType* mutate( ObjectDecl *objectDecl ) override final;
     145        virtual DeclarationWithType* mutate( FunctionDecl *functionDecl ) override final;
     146        virtual Declaration* mutate( StructDecl *aggregateDecl ) override final;
     147        virtual Declaration* mutate( UnionDecl *aggregateDecl ) override final;
     148        virtual Declaration* mutate( EnumDecl *aggregateDecl ) override final;
     149        virtual Declaration* mutate( TraitDecl *aggregateDecl ) override final;
     150        virtual Declaration* mutate( TypeDecl *typeDecl ) override final;
     151        virtual Declaration* mutate( TypedefDecl *typeDecl ) override final;
     152        virtual AsmDecl* mutate( AsmDecl *asmDecl ) override final;
     153
     154        virtual CompoundStmt* mutate( CompoundStmt *compoundStmt ) override final;
     155        virtual Statement* mutate( ExprStmt *exprStmt ) override final;
     156        virtual Statement* mutate( AsmStmt *asmStmt ) override final;
     157        virtual Statement* mutate( IfStmt *ifStmt ) override final;
     158        virtual Statement* mutate( WhileStmt *whileStmt ) override final;
     159        virtual Statement* mutate( ForStmt *forStmt ) override final;
     160        virtual Statement* mutate( SwitchStmt *switchStmt ) override final;
     161        virtual Statement* mutate( CaseStmt *caseStmt ) override final;
     162        virtual Statement* mutate( BranchStmt *branchStmt ) override final;
     163        virtual Statement* mutate( ReturnStmt *returnStmt ) override final;
     164        virtual Statement* mutate( ThrowStmt *throwStmt ) override final;
     165        virtual Statement* mutate( TryStmt *tryStmt ) override final;
     166        virtual Statement* mutate( CatchStmt *catchStmt ) override final;
     167        virtual Statement* mutate( FinallyStmt *finallyStmt ) override final;
     168        virtual Statement* mutate( WaitForStmt *waitforStmt ) override final;
     169        virtual NullStmt* mutate( NullStmt *nullStmt ) override final;
     170        virtual Statement* mutate( DeclStmt *declStmt ) override final;
     171        virtual Statement* mutate( ImplicitCtorDtorStmt *impCtorDtorStmt ) override final;
     172
     173        virtual Expression* mutate( ApplicationExpr *applicationExpr ) override final;
     174        virtual Expression* mutate( UntypedExpr *untypedExpr ) override final;
     175        virtual Expression* mutate( NameExpr *nameExpr ) override final;
     176        virtual Expression* mutate( AddressExpr *castExpr ) override final;
     177        virtual Expression* mutate( LabelAddressExpr *labAddressExpr ) override final;
     178        virtual Expression* mutate( CastExpr *castExpr ) override final;
     179        virtual Expression* mutate( VirtualCastExpr *castExpr ) override final;
     180        virtual Expression* mutate( UntypedMemberExpr *memberExpr ) override final;
     181        virtual Expression* mutate( MemberExpr *memberExpr ) override final;
     182        virtual Expression* mutate( VariableExpr *variableExpr ) override final;
     183        virtual Expression* mutate( ConstantExpr *constantExpr ) override final;
     184        virtual Expression* mutate( SizeofExpr *sizeofExpr ) override final;
     185        virtual Expression* mutate( AlignofExpr *alignofExpr ) override final;
     186        virtual Expression* mutate( UntypedOffsetofExpr *offsetofExpr ) override final;
     187        virtual Expression* mutate( OffsetofExpr *offsetofExpr ) override final;
     188        virtual Expression* mutate( OffsetPackExpr *offsetPackExpr ) override final;
     189        virtual Expression* mutate( AttrExpr *attrExpr ) override final;
     190        virtual Expression* mutate( LogicalExpr *logicalExpr ) override final;
     191        virtual Expression* mutate( ConditionalExpr *conditionalExpr ) override final;
     192        virtual Expression* mutate( CommaExpr *commaExpr ) override final;
     193        virtual Expression* mutate( TypeExpr *typeExpr ) override final;
     194        virtual Expression* mutate( AsmExpr *asmExpr ) override final;
     195        virtual Expression* mutate( ImplicitCopyCtorExpr *impCpCtorExpr ) override final;
     196        virtual Expression* mutate( ConstructorExpr *ctorExpr ) override final;
     197        virtual Expression* mutate( CompoundLiteralExpr *compLitExpr ) override final;
     198        virtual Expression* mutate( RangeExpr *rangeExpr ) override final;
     199        virtual Expression* mutate( UntypedTupleExpr *tupleExpr ) override final;
     200        virtual Expression* mutate( TupleExpr *tupleExpr ) override final;
     201        virtual Expression* mutate( TupleIndexExpr *tupleExpr ) override final;
     202        virtual Expression* mutate( TupleAssignExpr *assignExpr ) override final;
     203        virtual Expression* mutate( StmtExpr * stmtExpr ) override final;
     204        virtual Expression* mutate( UniqueExpr * uniqueExpr ) override final;
     205
     206        virtual Type* mutate( VoidType *basicType ) override final;
     207        virtual Type* mutate( BasicType *basicType ) override final;
     208        virtual Type* mutate( PointerType *pointerType ) override final;
     209        virtual Type* mutate( ArrayType *arrayType ) override final;
     210        virtual Type* mutate( ReferenceType *referenceType ) override final;
     211        virtual Type* mutate( FunctionType *functionType ) override final;
     212        virtual Type* mutate( StructInstType *aggregateUseType ) override final;
     213        virtual Type* mutate( UnionInstType *aggregateUseType ) override final;
     214        virtual Type* mutate( EnumInstType *aggregateUseType ) override final;
     215        virtual Type* mutate( TraitInstType *aggregateUseType ) override final;
     216        virtual Type* mutate( TypeInstType *aggregateUseType ) override final;
     217        virtual Type* mutate( TupleType *tupleType ) override final;
     218        virtual Type* mutate( TypeofType *typeofType ) override final;
     219        virtual Type* mutate( AttrType *attrType ) override final;
     220        virtual Type* mutate( VarArgsType *varArgsType ) override final;
     221        virtual Type* mutate( ZeroType *zeroType ) override final;
     222        virtual Type* mutate( OneType *oneType ) override final;
     223
     224        virtual Designation* mutate( Designation *designation ) override final;
     225        virtual Initializer* mutate( SingleInit *singleInit ) override final;
     226        virtual Initializer* mutate( ListInit *listInit ) override final;
     227        virtual Initializer* mutate( ConstructorInit *ctorInit ) override final;
     228
     229        virtual Subrange *mutate( Subrange *subrange ) override final;
     230
     231        virtual Constant *mutate( Constant *constant ) override final;
    241232
    242233private:
    243234        template<typename pass_t> friend void acceptAll( std::list< Declaration* > &decls, PassVisitor< pass_t >& visitor );
    244235        template<typename pass_t> friend void mutateAll( std::list< Declaration* > &decls, PassVisitor< pass_t >& visitor );
    245         template< typename TreeType, typename pass_t > friend void maybeAccept_impl( TreeType * tree, PassVisitor< pass_t > & visitor );
    246         template< typename TreeType, typename pass_t > friend void maybeMutate_impl( TreeType *& tree, PassVisitor< pass_t > & mutator );
    247         template< typename Container, typename pass_t > friend void maybeAccept_impl( Container & container, PassVisitor< pass_t > & visitor );
    248         template< typename Container, typename pass_t > friend void maybeMutate_impl( Container & container, PassVisitor< pass_t > & mutator );
    249236
    250237        template<typename node_type> void call_previsit ( node_type * node ) { previsit_impl ( pass, node, 0 ); }
     
    281268        std::list< Declaration* > *     get_afterDecls () { return declsToAddAfter_impl ( pass, 0); }
    282269
    283         bool       get_visit_children    () { bool_ref * ptr = visit_children_impl(pass, 0); return ptr ? *ptr : true; }
    284         bool_ref * get_visit_children_ptr() { return visit_children_impl(pass, 0); }
     270        void set_visit_children( bool& ref ) { bool_ref * ptr = visit_children_impl(pass, 0); if(ptr) ptr->set( ref ); }
    285271
    286272        void indexerScopeEnter  ()                             { indexer_impl_enterScope  ( pass, 0       ); }
  • src/Common/PassVisitor.impl.h

    r3f7e12cb r78315272  
    22// IWYU pragma: private, include "PassVisitor.h"
    33
    4 #define VISIT_START( node )                                     \
    5         __attribute__((unused))                                   \
    6         ChildrenGuard children_guard( get_visit_children_ptr() ); \
    7         __attribute__((unused))                                   \
     4#define VISIT_START( node )                     \
     5        __attribute__((unused))                   \
    86        guard_value_impl guard( at_cleanup_impl(pass, 0) );       \
    9         call_previsit( node );                                    \
     7        bool visit_children = true;               \
     8        set_visit_children( visit_children );   \
     9        call_previsit( node );                    \
     10        if( visit_children ) {                    \
    1011
    1112#define VISIT_END( node )                       \
     13        }                                         \
    1214        call_postvisit( node );                   \
    1315
    14 #define MUTATE_START( node )                                    \
    15         __attribute__((unused))                                   \
    16         ChildrenGuard children_guard( get_visit_children_ptr() ); \
    17         __attribute__((unused))                                   \
     16#define MUTATE_START( node )                    \
     17        __attribute__((unused))                   \
    1818        guard_value_impl guard( at_cleanup_impl(pass, 0) );       \
    19         call_premutate( node );                                   \
     19        bool visit_children = true;               \
     20        set_visit_children( visit_children );   \
     21        call_premutate( node );                   \
     22        if( visit_children ) {                    \
    2023
    2124#define MUTATE_END( type, node )                \
     25        }                                         \
    2226        return call_postmutate< type * >( node ); \
    2327
    2428
    25 #define VISIT_BODY( node )          \
    26         VISIT_START( node );          \
    27         if( children_guard ) {        \
    28                 Visitor::visit( node ); \
    29         }                             \
    30         VISIT_END( node );            \
    31 
    32 
    33 #define MUTATE_BODY( type, node )    \
    34         MUTATE_START( node );          \
    35         if( children_guard ) {         \
    36                 Mutator::mutate( node ); \
    37         }                              \
    38         MUTATE_END( type, node );      \
     29#define VISIT_BODY( node )        \
     30        VISIT_START( node );        \
     31        Visitor::visit( node );     \
     32        VISIT_END( node );          \
     33
     34
     35#define MUTATE_BODY( type, node ) \
     36        MUTATE_START( node );       \
     37        Mutator::mutate( node );    \
     38        MUTATE_END( type, node );   \
    3939
    4040
     
    6363template< typename pass_type >
    6464static inline void acceptAll( std::list< Declaration* > &decls, PassVisitor< pass_type >& visitor ) {
     65
    6566        DeclList_t* beforeDecls = visitor.get_beforeDecls();
    6667        DeclList_t* afterDecls  = visitor.get_afterDecls();
     
    7576                try {
    7677                        // run visitor on declaration
    77                         maybeAccept_impl( *i, visitor );
     78                        maybeAccept( *i, visitor );
    7879                } catch( SemanticError &e ) {
    7980                        e.set_location( (*i)->location );
     
    9192template< typename pass_type >
    9293static inline void mutateAll( std::list< Declaration* > &decls, PassVisitor< pass_type >& mutator ) {
     94
    9395        DeclList_t* beforeDecls = mutator.get_beforeDecls();
    9496        DeclList_t* afterDecls  = mutator.get_afterDecls();
     
    102104                try {
    103105                        // run mutator on declaration
    104                         maybeMutate_impl( *i, mutator );
     106                        *i = maybeMutate( *i, mutator );
    105107                } catch( SemanticError &e ) {
    106108                        e.set_location( (*i)->location );
     
    116118}
    117119
    118 template< typename TreeType, typename pass_type >
    119 inline void maybeAccept_impl( TreeType * tree, PassVisitor< pass_type > & visitor ) {
    120         if ( ! visitor.get_visit_children() ) return;
    121         if ( tree ) {
    122                 tree->accept( visitor );
    123         }
    124 }
    125 
    126 template< typename Container, typename pass_type >
    127 inline void maybeAccept_impl( Container & container, PassVisitor< pass_type > & visitor ) {
    128         if ( ! visitor.get_visit_children() ) return;
     120template< typename Container, typename VisitorType >
     121inline void maybeAccept( Container &container, VisitorType &visitor ) {
    129122        SemanticError errors;
    130123        for ( typename Container::iterator i = container.begin(); i != container.end(); ++i ) {
     
    143136}
    144137
    145 template< typename TreeType, typename pass_type >
    146 inline void maybeMutate_impl( TreeType *& tree, PassVisitor< pass_type > & mutator ) {
    147         if ( ! mutator.get_visit_children() ) return;
    148 
    149         if ( tree ) {
    150                 tree = strict_dynamic_cast< TreeType * >( tree->acceptMutator( mutator ) );
    151         }
    152 }
    153 
    154 template< typename Container, typename pass_type >
    155 inline void maybeMutate_impl( Container & container, PassVisitor< pass_type > & mutator ) {
    156         if ( ! mutator.get_visit_children() ) return;
     138template< typename Container, typename MutatorType >
     139inline void maybeMutateRef( Container &container, MutatorType &mutator ) {
    157140        SemanticError errors;
    158141        for ( typename Container::iterator i = container.begin(); i != container.end(); ++i ) {
    159142                try {
    160143                        if ( *i ) {
     144///                 *i = (*i)->acceptMutator( mutator );
    161145                                *i = dynamic_cast< typename Container::value_type >( (*i)->acceptMutator( mutator ) );
    162146                                assert( *i );
     
    175159template< typename func_t >
    176160void PassVisitor< pass_type >::handleStatementList( std::list< Statement * > & statements, func_t func ) {
    177         if ( ! get_visit_children() ) return;
    178161        SemanticError errors;
    179162
     
    216199void PassVisitor< pass_type >::visitStatementList( std::list< Statement * > & statements ) {
    217200        handleStatementList( statements, [this]( Statement * stmt) {
    218                 maybeAccept_impl( stmt, *this );
     201                stmt->accept( *this );
    219202        });
    220203}
     
    223206void PassVisitor< pass_type >::mutateStatementList( std::list< Statement * > & statements ) {
    224207        handleStatementList( statements, [this]( Statement *& stmt) {
    225                 maybeMutate_impl( stmt, *this );
     208                stmt = stmt->acceptMutator( *this );
    226209        });
    227210}
     
    231214template< typename func_t >
    232215Statement * PassVisitor< pass_type >::handleStatement( Statement * stmt, func_t func ) {
    233         if ( ! get_visit_children() ) return stmt;
    234 
    235216        // don't want statements from outer CompoundStmts to be added to this CompoundStmt
    236217        ValueGuardPtr< TypeSubstitution * >  oldEnv        ( get_env_ptr    () );
     
    263244Statement * PassVisitor< pass_type >::visitStatement( Statement * stmt ) {
    264245        return handleStatement( stmt, [this]( Statement * stmt ) {
    265                 maybeAccept_impl( stmt, *this );
     246                maybeAccept( stmt, *this );
    266247                return stmt;
    267248        });
     
    271252Statement * PassVisitor< pass_type >::mutateStatement( Statement * stmt ) {
    272253        return handleStatement( stmt, [this]( Statement * stmt ) {
    273                 maybeMutate_impl( stmt, *this );
    274                 return stmt;
     254                return maybeMutate( stmt, *this );
    275255        });
    276256}
     
    279259template< typename func_t >
    280260Expression * PassVisitor< pass_type >::handleExpression( Expression * expr, func_t func ) {
    281         if ( ! get_visit_children() ) return expr;
    282261        if( !expr ) return nullptr;
    283262
     
    287266        }
    288267
    289         // should env be moved onto the result of the mutate?
     268        // should env be cloned (or moved) onto the result of the mutate?
    290269        return func( expr );
    291270}
     
    294273Expression * PassVisitor< pass_type >::visitExpression( Expression * expr ) {
    295274        return handleExpression(expr, [this]( Expression * expr ) {
    296                 maybeAccept_impl( expr, *this );
     275                expr->accept( *this );
    297276                return expr;
    298277        });
     
    302281Expression * PassVisitor< pass_type >::mutateExpression( Expression * expr ) {
    303282        return handleExpression(expr, [this]( Expression * expr ) {
    304                 maybeMutate_impl( expr, *this );
    305                 return expr;
     283                return expr->acceptMutator( *this );
    306284        });
    307 }
    308 
    309 template< typename TreeType, typename VisitorType >
    310 inline void indexerScopedAccept( TreeType * tree, VisitorType & visitor ) {
    311         if ( ! visitor.get_visit_children() ) return;
    312         auto guard = makeFuncGuard(
    313                 [&visitor]() { visitor.indexerScopeEnter(); },
    314                 [&visitor]() { visitor.indexerScopeLeave(); }
    315         );
    316         maybeAccept_impl( tree, visitor );
    317 }
    318 
    319 template< typename TreeType, typename MutatorType >
    320 inline void indexerScopedMutate( TreeType *& tree, MutatorType & mutator ) {
    321         if ( ! mutator.get_visit_children() ) return;
    322         auto guard = makeFuncGuard(
    323                 [&mutator]() { mutator.indexerScopeEnter(); },
    324                 [&mutator]() { mutator.indexerScopeLeave(); }
    325         );
    326         maybeMutate_impl( tree, mutator );
    327285}
    328286
     
    361319
    362320        indexerScopedAccept( node->type         , *this );
    363         maybeAccept_impl   ( node->init         , *this );
    364         maybeAccept_impl   ( node->bitfieldWidth, *this );
    365         maybeAccept_impl   ( node->attributes   , *this );
     321        maybeAccept        ( node->init         , *this );
     322        maybeAccept        ( node->bitfieldWidth, *this );
    366323
    367324        if ( node->name != "" ) {
     
    377334
    378335        indexerScopedMutate( node->type         , *this );
    379         maybeMutate_impl   ( node->init         , *this );
    380         maybeMutate_impl   ( node->bitfieldWidth, *this );
    381         maybeMutate_impl   ( node->attributes   , *this );
     336        maybeMutateRef     ( node->init         , *this );
     337        maybeMutateRef     ( node->bitfieldWidth, *this );
    382338
    383339        if ( node->name != "" ) {
     
    400356        {
    401357                auto guard = makeFuncGuard( [this]() { indexerScopeEnter(); }, [this]() { indexerScopeLeave(); } );
    402                 maybeAccept_impl( node->type, *this );
    403                 maybeAccept_impl( node->statements, *this );
    404                 maybeAccept_impl( node->attributes, *this );
     358                maybeAccept( node->type, *this );
     359                maybeAccept( node->statements, *this );
    405360        }
    406361
     
    418373        {
    419374                auto guard = makeFuncGuard( [this]() { indexerScopeEnter(); }, [this]() { indexerScopeLeave(); } );
    420                 maybeMutate_impl( node->type, *this );
    421                 maybeMutate_impl( node->statements, *this );
    422                 maybeMutate_impl( node->attributes, *this );
     375                maybeMutateRef( node->type, *this );
     376                maybeMutateRef( node->statements, *this );
    423377        }
    424378
     
    438392        {
    439393                auto guard = makeFuncGuard( [this]() { indexerScopeEnter(); }, [this]() { indexerScopeLeave(); } );
    440                 maybeAccept_impl( node->parameters, *this );
    441                 maybeAccept_impl( node->members   , *this );
     394                maybeAccept( node->parameters, *this );
     395                maybeAccept( node->members   , *this );
    442396        }
    443397
     
    458412        {
    459413                auto guard = makeFuncGuard( [this]() { indexerScopeEnter(); }, [this]() { indexerScopeLeave(); } );
    460                 maybeMutate_impl( node->parameters, *this );
    461                 maybeMutate_impl( node->members   , *this );
     414                maybeMutateRef( node->parameters, *this );
     415                maybeMutateRef( node->members   , *this );
    462416        }
    463417
     
    479433        {
    480434                auto guard = makeFuncGuard( [this]() { indexerScopeEnter(); }, [this]() { indexerScopeLeave(); } );
    481                 maybeAccept_impl( node->parameters, *this );
    482                 maybeAccept_impl( node->members   , *this );
     435                maybeAccept( node->parameters, *this );
     436                maybeAccept( node->members   , *this );
    483437        }
    484438
     
    497451        {
    498452                auto guard = makeFuncGuard( [this]() { indexerScopeEnter(); }, [this]() { indexerScopeLeave(); } );
    499                 maybeMutate_impl( node->parameters, *this );
    500                 maybeMutate_impl( node->members   , *this );
     453                maybeMutateRef( node->parameters, *this );
     454                maybeMutateRef( node->members   , *this );
    501455        }
    502456
     
    515469
    516470        // unlike structs, traits, and unions, enums inject their members into the global scope
    517         maybeAccept_impl( node->parameters, *this );
    518         maybeAccept_impl( node->members   , *this );
     471        maybeAccept( node->parameters, *this );
     472        maybeAccept( node->members   , *this );
    519473
    520474        VISIT_END( node );
     
    528482
    529483        // unlike structs, traits, and unions, enums inject their members into the global scope
    530         maybeMutate_impl( node->parameters, *this );
    531         maybeMutate_impl( node->members   , *this );
     484        maybeMutateRef( node->parameters, *this );
     485        maybeMutateRef( node->members   , *this );
    532486
    533487        MUTATE_END( Declaration, node );
     
    542496        {
    543497                auto guard = makeFuncGuard( [this]() { indexerScopeEnter(); }, [this]() { indexerScopeLeave(); } );
    544                 maybeAccept_impl( node->parameters, *this );
    545                 maybeAccept_impl( node->members   , *this );
     498                maybeAccept( node->parameters, *this );
     499                maybeAccept( node->members   , *this );
    546500        }
    547501
     
    557511        {
    558512                auto guard = makeFuncGuard( [this]() { indexerScopeEnter(); }, [this]() { indexerScopeLeave(); } );
    559                 maybeMutate_impl( node->parameters, *this );
    560                 maybeMutate_impl( node->members   , *this );
     513                maybeMutateRef( node->parameters, *this );
     514                maybeMutateRef( node->members   , *this );
    561515        }
    562516
     
    574528        {
    575529                auto guard = makeFuncGuard( [this]() { indexerScopeEnter(); }, [this]() { indexerScopeLeave(); } );
    576                 maybeAccept_impl( node->parameters, *this );
    577                 maybeAccept_impl( node->base      , *this );
     530                maybeAccept( node->parameters, *this );
     531                maybeAccept( node->base      , *this );
    578532        }
    579533
     
    583537        indexerAddType( node );
    584538
    585         maybeAccept_impl( node->assertions, *this );
     539        maybeAccept( node->assertions, *this );
    586540
    587541        indexerScopedAccept( node->init, *this );
     
    596550        {
    597551                auto guard = makeFuncGuard( [this]() { indexerScopeEnter(); }, [this]() { indexerScopeLeave(); } );
    598                 maybeMutate_impl( node->parameters, *this );
    599                 maybeMutate_impl( node->base      , *this );
     552                maybeMutateRef( node->parameters, *this );
     553                maybeMutateRef( node->base      , *this );
    600554        }
    601555
     
    605559        indexerAddType( node );
    606560
    607         maybeMutate_impl( node->assertions, *this );
     561        maybeMutateRef( node->assertions, *this );
    608562
    609563        indexerScopedMutate( node->init, *this );
     
    620574        {
    621575                auto guard = makeFuncGuard( [this]() { indexerScopeEnter(); }, [this]() { indexerScopeLeave(); } );
    622                 maybeAccept_impl( node->parameters, *this );
    623                 maybeAccept_impl( node->base      , *this );
     576                maybeAccept( node->parameters, *this );
     577                maybeAccept( node->base      , *this );
    624578        }
    625579
    626580        indexerAddType( node );
    627581
    628         maybeAccept_impl( node->assertions, *this );
     582        maybeAccept( node->assertions, *this );
    629583
    630584        VISIT_END( node );
     
    637591        {
    638592                auto guard = makeFuncGuard( [this]() { indexerScopeEnter(); }, [this]() { indexerScopeLeave(); } );
    639                 maybeMutate_impl( node->parameters, *this );
    640                 maybeMutate_impl( node->base      , *this );
     593                maybeMutateRef     ( node->parameters, *this );
     594                maybeMutateRef( node->base      , *this );
    641595        }
    642596
    643597        indexerAddType( node );
    644598
    645         maybeMutate_impl( node->assertions, *this );
     599        maybeMutateRef( node->assertions, *this );
    646600
    647601        MUTATE_END( Declaration, node );
     
    654608        VISIT_START( node );
    655609
    656         maybeAccept_impl( node->stmt, *this );
     610        maybeAccept( node->stmt, *this );
    657611
    658612        VISIT_END( node );
     
    663617        MUTATE_START( node );
    664618
    665         maybeMutate_impl( node->stmt, *this );
     619        maybeMutateRef( node->stmt, *this );
    666620
    667621        MUTATE_END( AsmDecl, node );
     
    732686                // if statements introduce a level of scope (for the initialization)
    733687                auto guard = makeFuncGuard( [this]() { indexerScopeEnter(); }, [this]() { indexerScopeLeave(); } );
    734                 maybeAccept_impl( node->get_initialization(), *this );
    735                 visitExpression ( node->condition );
     688                acceptAll( node->get_initialization(), *this );
     689                visitExpression( node->condition );
    736690                node->thenPart = visitStatement( node->thenPart );
    737691                node->elsePart = visitStatement( node->elsePart );
     
    746700                // if statements introduce a level of scope (for the initialization)
    747701                auto guard = makeFuncGuard( [this]() { indexerScopeEnter(); }, [this]() { indexerScopeLeave(); } );
    748                 maybeMutate_impl( node->get_initialization(), *this );
     702                maybeMutateRef( node->get_initialization(), *this );
    749703                node->condition = mutateExpression( node->condition );
    750704                node->thenPart  = mutateStatement ( node->thenPart  );
     
    784738                // for statements introduce a level of scope (for the initialization)
    785739                auto guard = makeFuncGuard( [this]() { indexerScopeEnter(); }, [this]() { indexerScopeLeave(); } );
    786                 maybeAccept_impl( node->initialization, *this );
     740                maybeAccept( node->initialization, *this );
    787741                visitExpression( node->condition );
    788742                visitExpression( node->increment );
     
    798752                // for statements introduce a level of scope (for the initialization)
    799753                auto guard = makeFuncGuard( [this]() { indexerScopeEnter(); }, [this]() { indexerScopeLeave(); } );
    800                 maybeMutate_impl( node->initialization, *this );
     754                maybeMutateRef( node->initialization, *this );
    801755                node->condition = mutateExpression( node->condition );
    802756                node->increment = mutateExpression( node->increment );
     
    901855        VISIT_START( node );
    902856
    903         maybeAccept_impl( node->block       , *this );
    904         maybeAccept_impl( node->handlers    , *this );
    905         maybeAccept_impl( node->finallyBlock, *this );
     857        maybeAccept( node->block       , *this );
     858        maybeAccept( node->handlers    , *this );
     859        maybeAccept( node->finallyBlock, *this );
    906860
    907861        VISIT_END( node );
     
    912866        MUTATE_START( node );
    913867
    914         maybeMutate_impl( node->block       , *this );
    915         maybeMutate_impl( node->handlers    , *this );
    916         maybeMutate_impl( node->finallyBlock, *this );
     868        maybeMutateRef( node->block       , *this );
     869        maybeMutateRef( node->handlers    , *this );
     870        maybeMutateRef( node->finallyBlock, *this );
    917871
    918872        MUTATE_END( Statement, node );
     
    927881                // catch statements introduce a level of scope (for the caught exception)
    928882                auto guard = makeFuncGuard( [this]() { indexerScopeEnter(); }, [this]() { indexerScopeLeave(); } );
    929                 maybeAccept_impl( node->decl, *this );
     883                maybeAccept( node->decl, *this );
    930884                node->cond = visitExpression( node->cond );
    931885                node->body = visitStatement ( node->body );
     
    940894                // catch statements introduce a level of scope (for the caught exception)
    941895                auto guard = makeFuncGuard( [this]() { indexerScopeEnter(); }, [this]() { indexerScopeLeave(); } );
    942                 maybeMutate_impl( node->decl, *this );
     896                maybeMutateRef( node->decl, *this );
    943897                node->cond = mutateExpression( node->cond );
    944898                node->body = mutateStatement ( node->body );
     
    1014968
    1015969        indexerScopedAccept( node->result  , *this );
    1016         maybeAccept_impl        ( node->function, *this );
    1017         maybeAccept_impl        ( node->args    , *this );
     970        maybeAccept        ( node->function, *this );
     971        maybeAccept        ( node->args    , *this );
    1018972
    1019973        VISIT_END( node );
     
    1026980        indexerScopedMutate( node->env     , *this );
    1027981        indexerScopedMutate( node->result  , *this );
    1028         maybeMutate_impl   ( node->function, *this );
    1029         maybeMutate_impl   ( node->args    , *this );
     982        maybeMutateRef     ( node->function, *this );
     983        maybeMutateRef     ( node->args    , *this );
    1030984
    1031985        MUTATE_END( Expression, node );
     
    1038992        VISIT_START( node );
    1039993
    1040         // maybeAccept_impl( node->get_env(), *this );
     994        // maybeAccept( node->get_env(), *this );
    1041995        indexerScopedAccept( node->result, *this );
    1042996
     
    10901044
    10911045        indexerScopedAccept( node->result, *this );
    1092         maybeAccept_impl        ( node->arg   , *this );
     1046        maybeAccept        ( node->arg   , *this );
    10931047
    10941048        VISIT_END( node );
     
    11011055        indexerScopedMutate( node->env   , *this );
    11021056        indexerScopedMutate( node->result, *this );
    1103         maybeMutate_impl   ( node->arg   , *this );
     1057        maybeMutateRef     ( node->arg   , *this );
    11041058
    11051059        MUTATE_END( Expression, node );
     
    11131067
    11141068        indexerScopedAccept( node->result, *this );
    1115         maybeAccept_impl( node->arg, *this );
     1069        maybeAccept( node->arg, *this );
    11161070
    11171071        VISIT_END( node );
     
    11241078        indexerScopedMutate( node->env   , *this );
    11251079        indexerScopedMutate( node->result, *this );
    1126         maybeMutate_impl   ( node->arg   , *this );
     1080        maybeMutateRef     ( node->arg   , *this );
    11271081
    11281082        MUTATE_END( Expression, node );
     
    11361090
    11371091        indexerScopedAccept( node->result, *this );
    1138         maybeAccept_impl   ( node->arg   , *this );
     1092        maybeAccept        ( node->arg   , *this );
    11391093
    11401094        VISIT_END( node );
     
    11471101        indexerScopedMutate( node->env   , *this );
    11481102        indexerScopedMutate( node->result, *this );
    1149         maybeMutate_impl   ( node->arg   , *this );
     1103        maybeMutateRef     ( node->arg   , *this );
    11501104
    11511105        MUTATE_END( Expression, node );
     
    11801134
    11811135        indexerScopedAccept( node->result   , *this );
    1182         maybeAccept_impl   ( node->aggregate, *this );
    1183         maybeAccept_impl   ( node->member   , *this );
     1136        maybeAccept        ( node->aggregate, *this );
     1137        maybeAccept        ( node->member   , *this );
    11841138
    11851139        VISIT_END( node );
     
    11921146        indexerScopedMutate( node->env      , *this );
    11931147        indexerScopedMutate( node->result   , *this );
    1194         maybeMutate_impl   ( node->aggregate, *this );
    1195         maybeMutate_impl   ( node->member   , *this );
     1148        maybeMutateRef     ( node->aggregate, *this );
     1149        maybeMutateRef     ( node->member   , *this );
    11961150
    11971151        MUTATE_END( Expression, node );
     
    12051159
    12061160        indexerScopedAccept( node->result   , *this );
    1207         maybeAccept_impl   ( node->aggregate, *this );
     1161        maybeAccept        ( node->aggregate, *this );
    12081162
    12091163        VISIT_END( node );
     
    12161170        indexerScopedMutate( node->env      , *this );
    12171171        indexerScopedMutate( node->result   , *this );
    1218         maybeMutate_impl   ( node->aggregate, *this );
     1172        maybeMutateRef     ( node->aggregate, *this );
    12191173
    12201174        MUTATE_END( Expression, node );
     
    12491203
    12501204        indexerScopedAccept( node->result   , *this );
    1251         maybeAccept_impl   ( &node->constant, *this );
     1205        maybeAccept        ( &node->constant, *this );
    12521206
    12531207        VISIT_END( node );
     
    12601214        indexerScopedMutate( node->env   , *this );
    12611215        indexerScopedMutate( node->result, *this );
    1262         Constant * ptr = &node->constant;
    1263         maybeMutate_impl( ptr, *this );
    1264         node->constant = *ptr;
     1216        node->constant = *maybeMutate( &node->constant, *this );
    12651217
    12661218        MUTATE_END( Expression, node );
     
    12751227        indexerScopedAccept( node->result, *this );
    12761228        if ( node->get_isType() ) {
    1277                 maybeAccept_impl( node->type, *this );
     1229                maybeAccept( node->type, *this );
    12781230        } else {
    1279                 maybeAccept_impl( node->expr, *this );
     1231                maybeAccept( node->expr, *this );
    12801232        }
    12811233
     
    12901242        indexerScopedMutate( node->result, *this );
    12911243        if ( node->get_isType() ) {
    1292                 maybeMutate_impl( node->type, *this );
     1244                maybeMutateRef( node->type, *this );
    12931245        } else {
    1294                 maybeMutate_impl( node->expr, *this );
     1246                maybeMutateRef( node->expr, *this );
    12951247        }
    12961248
     
    13061258        indexerScopedAccept( node->result, *this );
    13071259        if ( node->get_isType() ) {
    1308                 maybeAccept_impl( node->type, *this );
     1260                maybeAccept( node->type, *this );
    13091261        } else {
    1310                 maybeAccept_impl( node->expr, *this );
     1262                maybeAccept( node->expr, *this );
    13111263        }
    13121264
     
    13211273        indexerScopedMutate( node->result, *this );
    13221274        if ( node->get_isType() ) {
    1323                 maybeMutate_impl( node->type, *this );
     1275                maybeMutateRef( node->type, *this );
    13241276        } else {
    1325                 maybeMutate_impl( node->expr, *this );
     1277                maybeMutateRef( node->expr, *this );
    13261278        }
    13271279
     
    13361288
    13371289        indexerScopedAccept( node->result, *this );
    1338         maybeAccept_impl   ( node->type  , *this );
     1290        maybeAccept        ( node->type  , *this );
    13391291
    13401292        VISIT_END( node );
     
    13471299        indexerScopedMutate( node->env   , *this );
    13481300        indexerScopedMutate( node->result, *this );
    1349         maybeMutate_impl   ( node->type  , *this );
     1301        maybeMutateRef     ( node->type  , *this );
    13501302
    13511303        MUTATE_END( Expression, node );
     
    13591311
    13601312        indexerScopedAccept( node->result, *this );
    1361         maybeAccept_impl   ( node->type  , *this );
    1362         maybeAccept_impl   ( node->member, *this );
     1313        maybeAccept        ( node->type  , *this );
     1314        maybeAccept        ( node->member, *this );
    13631315
    13641316        VISIT_END( node );
     
    13711323        indexerScopedMutate( node->env   , *this );
    13721324        indexerScopedMutate( node->result, *this );
    1373         maybeMutate_impl   ( node->type  , *this );
    1374         maybeMutate_impl   ( node->member, *this );
     1325        maybeMutateRef     ( node->type  , *this );
     1326        maybeMutateRef     ( node->member, *this );
    13751327
    13761328        MUTATE_END( Expression, node );
     
    13841336
    13851337        indexerScopedAccept( node->result, *this );
    1386         maybeAccept_impl   ( node->type  , *this );
     1338        maybeAccept        ( node->type  , *this );
    13871339
    13881340        VISIT_END( node );
     
    13951347        indexerScopedMutate( node->env   , *this );
    13961348        indexerScopedMutate( node->result, *this );
    1397         maybeMutate_impl   ( node->type  , *this );
     1349        maybeMutateRef     ( node->type  , *this );
    13981350
    13991351        MUTATE_END( Expression, node );
     
    14081360        indexerScopedAccept( node->result, *this );
    14091361        if ( node->get_isType() ) {
    1410                 maybeAccept_impl( node->type, *this );
     1362                maybeAccept( node->type, *this );
    14111363        } else {
    1412                 maybeAccept_impl( node->expr, *this );
     1364                maybeAccept( node->expr, *this );
    14131365        }
    14141366
     
    14231375        indexerScopedMutate( node->result, *this );
    14241376        if ( node->get_isType() ) {
    1425                 maybeMutate_impl( node->type, *this );
     1377                maybeMutateRef( node->type, *this );
    14261378        } else {
    1427                 maybeMutate_impl( node->expr, *this );
     1379                maybeMutateRef( node->expr, *this );
    14281380        }
    14291381
     
    14381390
    14391391        indexerScopedAccept( node->result, *this );
    1440         maybeAccept_impl   ( node->arg1  , *this );
    1441         maybeAccept_impl   ( node->arg2  , *this );
     1392        maybeAccept        ( node->arg1  , *this );
     1393        maybeAccept        ( node->arg2  , *this );
    14421394
    14431395        VISIT_END( node );
     
    14501402        indexerScopedMutate( node->env   , *this );
    14511403        indexerScopedMutate( node->result, *this );
    1452         maybeMutate_impl   ( node->arg1  , *this );
    1453         maybeMutate_impl   ( node->arg2  , *this );
     1404        maybeMutateRef     ( node->arg1  , *this );
     1405        maybeMutateRef     ( node->arg2  , *this );
    14541406
    14551407        MUTATE_END( Expression, node );
     
    14631415
    14641416        indexerScopedAccept( node->result, *this );
    1465         maybeAccept_impl        ( node->arg1  , *this );
    1466         maybeAccept_impl        ( node->arg2  , *this );
    1467         maybeAccept_impl        ( node->arg3  , *this );
     1417        maybeAccept        ( node->arg1  , *this );
     1418        maybeAccept        ( node->arg2  , *this );
     1419        maybeAccept        ( node->arg3  , *this );
    14681420
    14691421        VISIT_END( node );
     
    14761428        indexerScopedMutate( node->env   , *this );
    14771429        indexerScopedMutate( node->result, *this );
    1478         maybeMutate_impl   ( node->arg1  , *this );
    1479         maybeMutate_impl   ( node->arg2  , *this );
    1480         maybeMutate_impl   ( node->arg3  , *this );
     1430        maybeMutateRef     ( node->arg1  , *this );
     1431        maybeMutateRef     ( node->arg2  , *this );
     1432        maybeMutateRef     ( node->arg3  , *this );
    14811433
    14821434        MUTATE_END( Expression, node );
     
    14901442
    14911443        indexerScopedAccept( node->result, *this );
    1492         maybeAccept_impl   ( node->arg1  , *this );
    1493         maybeAccept_impl   ( node->arg2  , *this );
     1444        maybeAccept        ( node->arg1  , *this );
     1445        maybeAccept        ( node->arg2  , *this );
    14941446
    14951447        VISIT_END( node );
     
    15021454        indexerScopedMutate( node->env   , *this );
    15031455        indexerScopedMutate( node->result, *this );
    1504         maybeMutate_impl   ( node->arg1  , *this );
    1505         maybeMutate_impl   ( node->arg2  , *this );
     1456        maybeMutateRef     ( node->arg1  , *this );
     1457        maybeMutateRef     ( node->arg2  , *this );
    15061458
    15071459        MUTATE_END( Expression, node );
     
    15151467
    15161468        indexerScopedAccept( node->result, *this );
    1517         maybeAccept_impl   ( node->type, *this );
     1469        maybeAccept        ( node->type, *this );
    15181470
    15191471        VISIT_END( node );
     
    15261478        indexerScopedMutate( node->env   , *this );
    15271479        indexerScopedMutate( node->result, *this );
    1528         maybeMutate_impl   ( node->type  , *this );
     1480        maybeMutateRef     ( node->type  , *this );
    15291481
    15301482        MUTATE_END( Expression, node );
     
    15381490
    15391491        indexerScopedAccept( node->result    , *this );
    1540         maybeAccept_impl   ( node->inout     , *this );
    1541         maybeAccept_impl   ( node->constraint, *this );
    1542         maybeAccept_impl   ( node->operand   , *this );
     1492        maybeAccept        ( node->inout     , *this );
     1493        maybeAccept        ( node->constraint, *this );
     1494        maybeAccept        ( node->operand   , *this );
    15431495
    15441496        VISIT_END( node );
     
    15511503        indexerScopedMutate( node->env       , *this );
    15521504        indexerScopedMutate( node->result    , *this );
    1553         maybeMutate_impl   ( node->inout     , *this );
    1554         maybeMutate_impl   ( node->constraint, *this );
    1555         maybeMutate_impl   ( node->operand   , *this );
     1505        maybeMutateRef     ( node->inout     , *this );
     1506        maybeMutateRef     ( node->constraint, *this );
     1507        maybeMutateRef     ( node->operand   , *this );
    15561508
    15571509        MUTATE_END( Expression, node );
     
    15651517
    15661518        indexerScopedAccept( node->result     , *this );
    1567         maybeAccept_impl   ( node->callExpr   , *this );
    1568         maybeAccept_impl   ( node->tempDecls  , *this );
    1569         maybeAccept_impl   ( node->returnDecls, *this );
    1570         maybeAccept_impl   ( node->dtors      , *this );
     1519        maybeAccept        ( node->callExpr   , *this );
     1520        maybeAccept        ( node->tempDecls  , *this );
     1521        maybeAccept        ( node->returnDecls, *this );
     1522        maybeAccept        ( node->dtors      , *this );
    15711523
    15721524        VISIT_END( node );
     
    15791531        indexerScopedMutate( node->env        , *this );
    15801532        indexerScopedMutate( node->result     , *this );
    1581         maybeMutate_impl   ( node->callExpr   , *this );
    1582         maybeMutate_impl   ( node->tempDecls  , *this );
    1583         maybeMutate_impl   ( node->returnDecls, *this );
    1584         maybeMutate_impl   ( node->dtors      , *this );
     1533        maybeMutateRef     ( node->callExpr   , *this );
     1534        maybeMutateRef     ( node->tempDecls  , *this );
     1535        maybeMutateRef     ( node->returnDecls, *this );
     1536        maybeMutateRef     ( node->dtors      , *this );
    15851537
    15861538        MUTATE_END( Expression, node );
     
    15941546
    15951547        indexerScopedAccept( node->result  , *this );
    1596         maybeAccept_impl   ( node->callExpr, *this );
     1548        maybeAccept        ( node->callExpr, *this );
    15971549
    15981550        VISIT_END( node );
     
    16051557        indexerScopedMutate( node->env     , *this );
    16061558        indexerScopedMutate( node->result  , *this );
    1607         maybeMutate_impl   ( node->callExpr, *this );
     1559        maybeMutateRef     ( node->callExpr, *this );
    16081560
    16091561        MUTATE_END( Expression, node );
     
    16171569
    16181570        indexerScopedAccept( node->result     , *this );
    1619         maybeAccept_impl   ( node->initializer, *this );
     1571        maybeAccept        ( node->initializer, *this );
    16201572
    16211573        VISIT_END( node );
     
    16281580        indexerScopedMutate( node->env        , *this );
    16291581        indexerScopedMutate( node->result     , *this );
    1630         maybeMutate_impl     ( node->initializer, *this );
     1582        maybeMutateRef     ( node->initializer, *this );
    16311583
    16321584        MUTATE_END( Expression, node );
     
    16401592
    16411593        indexerScopedAccept( node->result, *this );
    1642         maybeAccept_impl   ( node->low   , *this );
    1643         maybeAccept_impl   ( node->high  , *this );
     1594        maybeAccept        ( node->low   , *this );
     1595        maybeAccept        ( node->high  , *this );
    16441596
    16451597        VISIT_END( node );
     
    16521604        indexerScopedMutate( node->env   , *this );
    16531605        indexerScopedMutate( node->result, *this );
    1654         maybeMutate_impl   ( node->low   , *this );
    1655         maybeMutate_impl   ( node->high  , *this );
     1606        maybeMutateRef     ( node->low   , *this );
     1607        maybeMutateRef     ( node->high  , *this );
    16561608
    16571609        MUTATE_END( Expression, node );
     
    16651617
    16661618        indexerScopedAccept( node->result, *this );
    1667         maybeAccept_impl   ( node->exprs , *this );
     1619        maybeAccept        ( node->exprs , *this );
    16681620
    16691621        VISIT_END( node );
     
    16761628        indexerScopedMutate( node->env   , *this );
    16771629        indexerScopedMutate( node->result, *this );
    1678         maybeMutate_impl   ( node->exprs , *this );
     1630        maybeMutateRef     ( node->exprs , *this );
    16791631
    16801632        MUTATE_END( Expression, node );
     
    16881640
    16891641        indexerScopedAccept( node->result, *this );
    1690         maybeAccept_impl   ( node->exprs , *this );
     1642        maybeAccept          ( node->exprs , *this );
    16911643
    16921644        VISIT_END( node );
     
    16991651        indexerScopedMutate( node->env   , *this );
    17001652        indexerScopedMutate( node->result, *this );
    1701         maybeMutate_impl   ( node->exprs , *this );
     1653        maybeMutateRef     ( node->exprs , *this );
    17021654
    17031655        MUTATE_END( Expression, node );
     
    17111663
    17121664        indexerScopedAccept( node->result, *this );
    1713         maybeAccept_impl   ( node->tuple , *this );
     1665        maybeAccept        ( node->tuple , *this );
    17141666
    17151667        VISIT_END( node );
     
    17221674        indexerScopedMutate( node->env   , *this );
    17231675        indexerScopedMutate( node->result, *this );
    1724         maybeMutate_impl   ( node->tuple , *this );
     1676        maybeMutateRef     ( node->tuple , *this );
    17251677
    17261678        MUTATE_END( Expression, node );
     
    17341686
    17351687        indexerScopedAccept( node->result  , *this );
    1736         maybeAccept_impl   ( node->stmtExpr, *this );
     1688        maybeAccept        ( node->stmtExpr, *this );
    17371689
    17381690        VISIT_END( node );
     
    17451697        indexerScopedMutate( node->env     , *this );
    17461698        indexerScopedMutate( node->result  , *this );
    1747         maybeMutate_impl   ( node->stmtExpr, *this );
     1699        maybeMutateRef     ( node->stmtExpr, *this );
    17481700
    17491701        MUTATE_END( Expression, node );
     
    17621714
    17631715        indexerScopedAccept( node->result     , *this );
    1764         maybeAccept_impl   ( node->statements , *this );
    1765         maybeAccept_impl   ( node->returnDecls, *this );
    1766         maybeAccept_impl   ( node->dtors      , *this );
     1716        maybeAccept        ( node->statements , *this );
     1717        maybeAccept        ( node->returnDecls, *this );
     1718        maybeAccept        ( node->dtors      , *this );
    17671719
    17681720        VISIT_END( node );
     
    17791731
    17801732        indexerScopedMutate( node->result     , *this );
    1781         maybeMutate_impl   ( node->statements , *this );
    1782         maybeMutate_impl   ( node->returnDecls, *this );
    1783         maybeMutate_impl   ( node->dtors      , *this );
     1733        maybeMutateRef     ( node->statements , *this );
     1734        maybeMutateRef     ( node->returnDecls, *this );
     1735        maybeMutateRef     ( node->dtors      , *this );
    17841736
    17851737        MUTATE_END( Expression, node );
     
    17931745
    17941746        indexerScopedAccept( node->result, *this );
    1795         maybeAccept_impl   ( node->expr  , *this );
     1747        maybeAccept        ( node->expr  , *this );
    17961748
    17971749        VISIT_END( node );
     
    18041756        indexerScopedMutate( node->env   , *this );
    18051757        indexerScopedMutate( node->result, *this );
    1806         maybeMutate_impl   ( node->expr  , *this );
     1758        maybeMutateRef     ( node->expr  , *this );
    18071759
    18081760        MUTATE_END( Expression, node );
     
    18491801        {
    18501802                auto guard = makeFuncGuard( [this]() { indexerScopeEnter(); }, [this]() { indexerScopeLeave(); } );
    1851                 maybeAccept_impl( node->forall    , *this );
    1852                 maybeAccept_impl( node->parameters, *this );
     1803                maybeAccept( node->forall    , *this );
     1804                maybeAccept( node->parameters, *this );
    18531805        }
    18541806
     
    18641816        {
    18651817                auto guard = makeFuncGuard( [this]() { indexerScopeEnter(); }, [this]() { indexerScopeLeave(); } );
    1866                 maybeMutate_impl( node->forall    , *this );
    1867                 maybeMutate_impl( node->parameters, *this );
     1818                maybeMutateRef( node->forall    , *this );
     1819                maybeMutateRef( node->parameters, *this );
    18681820        }
    18691821
     
    18811833        {
    18821834                auto guard = makeFuncGuard( [this]() { indexerScopeEnter(); }, [this]() { indexerScopeLeave(); } );
    1883                 maybeAccept_impl( node->forall    , *this );
    1884                 maybeAccept_impl( node->parameters, *this );
     1835                maybeAccept( node->forall    , *this );
     1836                maybeAccept( node->parameters, *this );
    18851837        }
    18861838
     
    18961848        {
    18971849                auto guard = makeFuncGuard( [this]() { indexerScopeEnter(); }, [this]() { indexerScopeLeave(); } );
    1898                 maybeMutate_impl( node->forall    , *this );
    1899                 maybeMutate_impl( node->parameters, *this );
     1850                maybeMutateRef( node->forall    , *this );
     1851                maybeMutateRef( node->parameters, *this );
    19001852        }
    19011853
     
    19211873        VISIT_START( node );
    19221874
    1923         maybeAccept_impl( node->forall    , *this );
    1924         maybeAccept_impl( node->parameters, *this );
     1875        maybeAccept( node->forall    , *this );
     1876        maybeAccept( node->parameters, *this );
    19251877
    19261878        VISIT_END( node );
     
    19311883        MUTATE_START( node );
    19321884
    1933         maybeMutate_impl( node->forall    , *this );
    1934         maybeMutate_impl( node->parameters, *this );
     1885        maybeMutateRef( node->forall    , *this );
     1886        maybeMutateRef( node->parameters, *this );
    19351887
    19361888        MUTATE_END( Type, node );
     
    19781930        VISIT_START( node );
    19791931
    1980         maybeAccept_impl( node->get_designators(), *this );
     1932        maybeAccept( node->get_designators(), *this );
    19811933
    19821934        VISIT_END( node );
     
    19871939        MUTATE_START( node );
    19881940
    1989         maybeMutate_impl( node->get_designators(), *this );
     1941        maybeMutateRef( node->get_designators(), *this );
    19901942
    19911943        MUTATE_END( Designation, node );
     
    20291981template< typename pass_type >
    20301982void PassVisitor< pass_type >::visit( Constant * node ) {
    2031         VISIT_BODY( node );
    2032 }
    2033 
    2034 template< typename pass_type >
    2035 void PassVisitor< pass_type >::visit( Attribute * node ) {
    20361983        VISIT_BODY( node );
    20371984}
     
    21222069        MUTATE_BODY( Constant, node );
    21232070}
    2124 
    2125 template< typename pass_type >
    2126 Attribute * PassVisitor< pass_type >::mutate( Attribute * node  )  {
    2127         MUTATE_BODY( Attribute, node );
    2128 }
    2129 
    2130 template< typename pass_type >
    2131 TypeSubstitution * PassVisitor< pass_type >::mutate( TypeSubstitution * node ) {
    2132         MUTATE_START( node );
    2133 
    2134         for ( auto & p : node->typeEnv ) {
    2135                 indexerScopedMutate( p.second, *this );
    2136         }
    2137         for ( auto & p : node->varEnv ) {
    2138                 indexerScopedMutate( p.second, *this );
    2139         }
    2140 
    2141         MUTATE_END( TypeSubstitution, node );
    2142 }
  • src/Common/PassVisitor.proto.h

    r3f7e12cb r78315272  
    4646        ~bool_ref() = default;
    4747
    48         operator bool() { return m_ref ? *m_ref : true; }
     48        operator bool() { return *m_ref; }
    4949        bool operator=( bool val ) { return *m_ref = val; }
    5050
    5151private:
    5252
    53         friend class ChildrenGuard;
    54 
    55         bool * set( bool & val ) {
    56                 bool * prev = m_ref;
    57                 m_ref = &val;
    58                 return prev;
    59         }
    60 
    61         bool * m_ref = nullptr;
     53        template<typename pass>
     54        friend class PassVisitor;
     55
     56        void set( bool & val ) { m_ref = &val; };
     57
     58        bool * m_ref;
    6259};
    6360
    64 class ChildrenGuard {
    65 public:
    66 
    67         ChildrenGuard( bool_ref * ref )
    68                 : m_val ( true )
    69                 , m_prev( ref ? ref->set( m_val ) : nullptr )
    70                 , m_ref ( ref )
    71         {}
    72 
    73         ~ChildrenGuard() {
    74                 if( m_ref ) {
    75                         m_ref->set( *m_prev );
    76                 }
    77         }
    78 
    79         operator bool() { return m_val; }
    80 
    81 private:
    82         bool       m_val;
    83         bool     * m_prev;
    84         bool_ref * m_ref;
    85 };
     61template< typename TreeType, typename VisitorType >
     62inline void indexerScopedAccept( TreeType * tree, VisitorType & visitor ) {
     63        auto guard = makeFuncGuard(
     64                [&visitor]() { visitor.indexerScopeEnter(); },
     65                [&visitor]() { visitor.indexerScopeLeave(); }
     66        );
     67        maybeAccept( tree, visitor );
     68}
     69
     70template< typename TreeType, typename MutatorType >
     71inline void indexerScopedMutate( TreeType *& tree, MutatorType & mutator ) {
     72        auto guard = makeFuncGuard(
     73                [&mutator]() { mutator.indexerScopeEnter(); },
     74                [&mutator]() { mutator.indexerScopeLeave(); }
     75        );
     76        tree = maybeMutate( tree, mutator );
     77}
     78
     79template< typename TreeType, typename MutatorType >
     80inline void maybeMutateRef( TreeType *& tree, MutatorType & mutator ) {
     81        tree = maybeMutate( tree, mutator );
     82}
    8683
    8784//-------------------------------------------------------------------------------------------------------------------------------------------------------------------------
  • src/Common/utility.h

    r3f7e12cb r78315272  
    1818#include <cctype>
    1919#include <algorithm>
    20 #include <functional>
    2120#include <iostream>
    2221#include <iterator>
     
    2827
    2928#include <cassert>
    30 
    31 #include "Common/Indenter.h"
    3229
    3330template< typename T >
     
    7875
    7976template< typename Container >
    80 void printAll( const Container &container, std::ostream &os, Indenter indent = {} ) {
     77void printAll( const Container &container, std::ostream &os, int indent = 0 ) {
    8178        for ( typename Container::const_iterator i = container.begin(); i != container.end(); ++i ) {
    8279                if ( *i ) {
    83                         os << indent;
    84                         (*i)->print( os, indent );
     80                        os << std::string( indent,  ' ' );
     81                        (*i)->print( os, indent + 2 );
    8582                        // need an endl after each element because it's not easy to know when each individual item should end
    8683                        os << std::endl;
     
    354351template< typename T1, typename T2 >
    355352struct group_iterate_t {
    356 private:
    357         std::tuple<T1, T2> args;
    358 public:
    359353        group_iterate_t( bool skipBoundsCheck, const T1 & v1, const T2 & v2 ) : args(v1, v2) {
    360354                assertf(skipBoundsCheck || v1.size() == v2.size(), "group iteration requires containers of the same size: <%zd, %zd>.", v1.size(), v2.size());
    361355        };
    362356
    363         typedef std::tuple<decltype(*std::get<0>(args).begin()), decltype(*std::get<1>(args).begin())> value_type;
    364         typedef decltype(std::get<0>(args).begin()) T1Iter;
    365         typedef decltype(std::get<1>(args).begin()) T2Iter;
    366 
    367357        struct iterator {
     358                typedef typename std::remove_reference<T1>::type T1val;
     359                typedef typename std::remove_reference<T2>::type T2val;
     360                typedef std::tuple<typename T1val::value_type &, typename T2val::value_type &> value_type;
     361                typedef typename T1val::iterator T1Iter;
     362                typedef typename T2val::iterator T2Iter;
    368363                typedef std::tuple<T1Iter, T2Iter> IterTuple;
    369364                IterTuple it;
     
    375370                value_type operator*() const { return std::tie( *std::get<0>(it), *std::get<1>(it) ); }
    376371        };
    377 
    378372        iterator begin() { return iterator( std::get<0>(args).begin(), std::get<1>(args).begin() ); }
    379373        iterator end() { return iterator( std::get<0>(args).end(), std::get<1>(args).end() ); }
     374
     375private:
     376        std::tuple<T1, T2> args;
    380377};
    381378
  • src/Concurrency/Keywords.cc

    r3f7e12cb r78315272  
    196196                std::list<DeclarationWithType*> findMutexArgs( FunctionDecl* );
    197197                void validate( DeclarationWithType * );
    198                 void addDtorStatments( FunctionDecl* func, CompoundStmt *, const std::list<DeclarationWithType * > &);
    199198                void addStatments( FunctionDecl* func, CompoundStmt *, const std::list<DeclarationWithType * > &);
    200199
     
    207206                StructDecl* monitor_decl = nullptr;
    208207                StructDecl* guard_decl = nullptr;
    209                 StructDecl* dtor_guard_decl = nullptr;
    210208
    211209                static std::unique_ptr< Type > generic_func;
     
    231229
    232230                void postvisit( FunctionDecl * decl );
    233                 void previsit ( StructDecl   * decl );
    234231
    235232                void addStartStatement( FunctionDecl * decl, DeclarationWithType * param );
     
    239236                        acceptAll( translationUnit, impl );
    240237                }
    241 
    242           private :
    243                 bool thread_ctor_seen = false;
    244                 StructDecl * thread_decl = nullptr;
    245238        };
    246239
     
    410403                if( mutexArgs.empty() ) return;
    411404
    412                 if( CodeGen::isConstructor(decl->name) ) throw SemanticError( "constructors cannot have mutex parameters", decl );
    413 
    414                 bool isDtor = CodeGen::isDestructor( decl->name );
    415 
    416                 if( isDtor && mutexArgs.size() != 1 ) throw SemanticError( "destructors can only have 1 mutex argument", decl );
    417 
    418405                for(auto arg : mutexArgs) {
    419406                        validate( arg );
     
    425412                if( !monitor_decl ) throw SemanticError( "mutex keyword requires monitors to be in scope, add #include <monitor>", decl );
    426413                if( !guard_decl ) throw SemanticError( "mutex keyword requires monitors to be in scope, add #include <monitor>", decl );
    427                 if( !dtor_guard_decl ) throw SemanticError( "mutex keyword requires monitors to be in scope, add #include <monitor>", decl );
    428 
    429                 if( isDtor ) {
    430                         addDtorStatments( decl, body, mutexArgs );
    431                 }
    432                 else {
    433                         addStatments( decl, body, mutexArgs );
    434                 }
     414
     415                addStatments( decl, body, mutexArgs );
    435416        }
    436417
     
    444425                        assert( !guard_decl );
    445426                        guard_decl = decl;
    446                 }
    447                 else if( decl->name == "monitor_dtor_guard_t" ) {
    448                         assert( !dtor_guard_decl );
    449                         dtor_guard_decl = decl;
    450427                }
    451428        }
     
    480457                //Make sure that typed isn't mutex
    481458                if( base->get_mutex() ) throw SemanticError( "mutex keyword may only appear once per argument ", arg );
    482         }
    483 
    484         void MutexKeyword::addDtorStatments( FunctionDecl* func, CompoundStmt * body, const std::list<DeclarationWithType * > & args ) {
    485                 Type * arg_type = args.front()->get_type()->clone();
    486                 arg_type->set_mutex( false );
    487 
    488                 ObjectDecl * monitors = new ObjectDecl(
    489                         "__monitor",
    490                         noStorage,
    491                         LinkageSpec::Cforall,
    492                         nullptr,
    493                         new PointerType(
    494                                 noQualifiers,
    495                                 new StructInstType(
    496                                         noQualifiers,
    497                                         monitor_decl
    498                                 )
    499                         ),
    500                         new SingleInit( new UntypedExpr(
    501                                 new NameExpr( "get_monitor" ),
    502                                 {  new CastExpr( new VariableExpr( args.front() ), arg_type ) }
    503                         ))
    504                 );
    505 
    506                 assert(generic_func);
    507 
    508                 //in reverse order :
    509                 // monitor_guard_t __guard = { __monitors, #, func };
    510                 body->push_front(
    511                         new DeclStmt( noLabels, new ObjectDecl(
    512                                 "__guard",
    513                                 noStorage,
    514                                 LinkageSpec::Cforall,
    515                                 nullptr,
    516                                 new StructInstType(
    517                                         noQualifiers,
    518                                         dtor_guard_decl
    519                                 ),
    520                                 new ListInit(
    521                                         {
    522                                                 new SingleInit( new AddressExpr( new VariableExpr( monitors ) ) ),
    523                                                 new SingleInit( new CastExpr( new VariableExpr( func ), generic_func->clone() ) )
    524                                         },
    525                                         noDesignators,
    526                                         true
    527                                 )
    528                         ))
    529                 );
    530 
    531                 //monitor_desc * __monitors[] = { get_monitor(a), get_monitor(b) };
    532                 body->push_front( new DeclStmt( noLabels, monitors) );
    533459        }
    534460
     
    597523        // General entry routine
    598524        //=============================================================================================
    599         void ThreadStarter::previsit( StructDecl * decl ) {
    600                 if( decl->name == "thread_desc" && decl->body ) {
    601                         assert( !thread_decl );
    602                         thread_decl = decl;
    603                 }
    604         }
    605 
    606525        void ThreadStarter::postvisit(FunctionDecl * decl) {
    607526                if( ! CodeGen::isConstructor(decl->name) ) return;
    608527
    609                 Type * typeof_this = InitTweak::getTypeofThis(decl->type);
    610                 StructInstType * ctored_type = dynamic_cast< StructInstType * >( typeof_this );
    611                 if( ctored_type && ctored_type->baseStruct == thread_decl ) {
    612                         thread_ctor_seen = true;
    613                 }
    614 
    615528                DeclarationWithType * param = decl->get_functionType()->get_parameters().front();
    616529                auto type  = dynamic_cast< StructInstType * >( InitTweak::getPointerBase( param->get_type() ) );
     530                // if( type ) std::cerr << "FRED2" << std::endl;
    617531                if( type && type->get_baseStruct()->is_thread() ) {
    618                         if( !thread_decl || !thread_ctor_seen ) {
    619                                 throw SemanticError("thread keyword requires threads to be in scope, add #include <thread>");
    620                         }
    621 
    622532                        addStartStatement( decl, param );
    623533                }
  • src/Concurrency/Waitfor.cc

    r3f7e12cb r78315272  
    2727#include "InitTweak/InitTweak.h"   // for getPointerBase
    2828#include "Parser/LinkageSpec.h"    // for Cforall
    29 #include "ResolvExpr/Resolver.h"   // for findVoidExpression
     29#include "SymTab/AddVisit.h"       // for acceptAndAdd
    3030#include "SynTree/Constant.h"      // for Constant
    3131#include "SynTree/Declaration.h"   // for StructDecl, FunctionDecl, ObjectDecl
     
    112112        //=============================================================================================
    113113
    114         class GenerateWaitForPass final : public WithIndexer {
     114        class GenerateWaitForPass final : public WithStmtsToAdd {
    115115          public:
    116116
     
    126126
    127127                ObjectDecl * declare( unsigned long count, CompoundStmt * stmt );
    128                 ObjectDecl * declareFlag( CompoundStmt * stmt );
    129                 Statement  * makeSetter( ObjectDecl * flag );
    130128                ObjectDecl * declMon( WaitForStmt::Clause & clause, CompoundStmt * stmt );
    131                 void         init( ObjectDecl * acceptables, int index, WaitForStmt::Clause & clause, Statement * settter, CompoundStmt * stmt );
    132                 Expression * init_timeout( Expression *& time, Expression *& time_cond, bool has_else, Expression *& else_cond, Statement * settter, CompoundStmt * stmt );
    133                 Expression * call(size_t count, ObjectDecl * acceptables, Expression * timeout, CompoundStmt * stmt);
    134                 void         choose( WaitForStmt * waitfor, Expression  * result, CompoundStmt * stmt );
     129                void         init( ObjectDecl * acceptables, int index, WaitForStmt::Clause & clause, CompoundStmt * stmt );
     130                Expression * init_timeout( Expression *& time, Expression *& time_cond, bool has_else, Expression *& else_cond, CompoundStmt * stmt );
     131                Expression * call();
     132                void choose();
    135133
    136134                static void implement( std::list< Declaration * > & translationUnit ) {
     
    142140          private:
    143141                FunctionDecl        * decl_waitfor    = nullptr;
    144                 StructDecl          * decl_mask       = nullptr;
    145142                StructDecl          * decl_acceptable = nullptr;
    146143                StructDecl          * decl_monitor    = nullptr;
     144                DeclarationWithType * decl_m_func     = nullptr;
     145                DeclarationWithType * decl_m_count    = nullptr;
     146                DeclarationWithType * decl_m_monitors = nullptr;
     147                DeclarationWithType * decl_m_isdtor   = nullptr;
    147148
    148149                static std::unique_ptr< Type > generic_func;
    149150
     151                UniqueName namer_mon = "__monitors_"s;
    150152                UniqueName namer_acc = "__acceptables_"s;
    151                 UniqueName namer_idx = "__index_"s;
    152                 UniqueName namer_flg = "__do_run_"s;
    153                 UniqueName namer_msk = "__mask_"s;
    154                 UniqueName namer_mon = "__monitors_"s;
    155153                UniqueName namer_tim = "__timeout_"s;
    156154        };
     
    169167        namespace {
    170168                Expression * makeOpIndex( DeclarationWithType * array, unsigned long index ) {
    171                         return new UntypedExpr(
     169                        return new ApplicationExpr(
    172170                                new NameExpr( "?[?]" ),
    173171                                {
     
    179177
    180178                Expression * makeOpAssign( Expression * lhs, Expression * rhs ) {
    181                         return new UntypedExpr(
     179                        return new ApplicationExpr(
    182180                                        new NameExpr( "?=?" ),
    183181                                        { lhs, rhs }
     
    185183                }
    186184
    187                 Expression * makeOpMember( Expression * sue, const std::string & mem ) {
    188                         return new UntypedMemberExpr( new NameExpr( mem ), sue );
    189                 }
    190 
    191                 Statement * makeAccStatement( DeclarationWithType * object, unsigned long index, const std::string & member, Expression * value, const SymTab::Indexer & indexer ) {
    192                         Expression * expr = makeOpAssign(
    193                                 makeOpMember(
    194                                         makeOpIndex(
    195                                                 object,
    196                                                 index
     185                Expression * makeOpMember( Expression * sue, DeclarationWithType * mem ) {
     186                        return new MemberExpr( mem, sue );
     187                }
     188
     189                Statement * makeAccStatement( DeclarationWithType * object, unsigned long index, DeclarationWithType * member, Expression * value ) {
     190                        return new ExprStmt(
     191                                noLabels,
     192                                makeOpAssign(
     193                                        makeOpMember(
     194                                                makeOpIndex(
     195                                                        object,
     196                                                        index
     197                                                ),
     198                                                member
    197199                                        ),
    198                                         member
    199                                 ),
    200                                 value
     200                                        value
     201                                )
    201202                        );
    202 
    203                         ResolvExpr::findVoidExpression( expr, indexer );
    204 
    205                         return new ExprStmt( noLabels, expr );
    206203                }
    207204
     
    211208                        return new ConstantExpr( Constant::from_bool( ifnull ) );
    212209                }
    213 
    214                 VariableExpr * extractVariable( Expression * func ) {
    215                         if( VariableExpr * var = dynamic_cast< VariableExpr * >( func ) ) {
    216                                 return var;
    217                         }
    218 
    219                         CastExpr * cast = strict_dynamic_cast< CastExpr * >( func );
    220                         return strict_dynamic_cast< VariableExpr * >( cast->arg );
    221                 }
    222 
    223                 Expression * detectIsDtor( Expression * func ) {
    224                         VariableExpr * typed_func = extractVariable( func );
    225                         bool is_dtor = InitTweak::isDestructor( typed_func->var );
    226                         return new ConstantExpr( Constant::from_bool( is_dtor ) );
    227                 }
    228210        };
    229211
     
    234216
    235217        void GenerateWaitForPass::premutate( FunctionDecl * decl) {
    236                 if( decl->name != "__waitfor_internal" ) return;
     218                if( decl->name != "__accept_internal" ) return;
    237219
    238220                decl_waitfor = decl;
     
    245227                        assert( !decl_acceptable );
    246228                        decl_acceptable = decl;
    247                 }
    248                 else if( decl->name == "__waitfor_mask_t" ) {
    249                         assert( !decl_mask );
    250                         decl_mask = decl;
     229                        for( Declaration * field : decl_acceptable->members ) {
     230                                     if( field->name == "func"    ) decl_m_func     = strict_dynamic_cast< DeclarationWithType * >( field );
     231                                else if( field->name == "count"   ) decl_m_count    = strict_dynamic_cast< DeclarationWithType * >( field );
     232                                else if( field->name == "monitor" ) decl_m_monitors = strict_dynamic_cast< DeclarationWithType * >( field );
     233                                else if( field->name == "is_dtor" ) decl_m_isdtor   = strict_dynamic_cast< DeclarationWithType * >( field );
     234                        }
     235
    251236                }
    252237                else if( decl->name == "monitor_desc" ) {
     
    257242
    258243        Statement * GenerateWaitForPass::postmutate( WaitForStmt * waitfor ) {
    259                 if( !decl_monitor || !decl_acceptable || !decl_mask ) throw SemanticError( "waitfor keyword requires monitors to be in scope, add #include <monitor>", waitfor );
     244                return waitfor;
     245
     246                if( !decl_monitor || !decl_acceptable ) throw SemanticError( "waitfor keyword requires monitors to be in scope, add #include <monitor>", waitfor );
    260247
    261248                CompoundStmt * stmt = new CompoundStmt( noLabels );
    262249
    263250                ObjectDecl * acceptables = declare( waitfor->clauses.size(), stmt );
    264                 ObjectDecl * flag        = declareFlag( stmt );
    265                 Statement  * setter      = makeSetter( flag );
    266251
    267252                int index = 0;
    268253                for( auto & clause : waitfor->clauses ) {
    269                         init( acceptables, index, clause, setter, stmt );
     254                        init( acceptables, index, clause, stmt );
    270255
    271256                        index++;
     
    277262                        waitfor->orelse .statement,
    278263                        waitfor->orelse .condition,
    279                         setter,
    280264                        stmt
    281265                );
    282266
    283                 CompoundStmt * compound = new CompoundStmt( noLabels );
    284                 stmt->push_back( new IfStmt(
    285                         noLabels,
    286                         safeCond( new VariableExpr( flag ) ),
    287                         compound,
    288                         nullptr
    289                 ));
    290 
    291                 Expression * result = call( waitfor->clauses.size(), acceptables, timeout, compound );
    292 
    293                 choose( waitfor, result, compound );
     267                // Expression * result  = call( acceptables, timeout, orelse, stmt );
     268
     269                // choose( waitfor, result );
    294270
    295271                return stmt;
     
    298274        ObjectDecl * GenerateWaitForPass::declare( unsigned long count, CompoundStmt * stmt )
    299275        {
    300                 ObjectDecl * acceptables = ObjectDecl::newObject(
     276                ObjectDecl * acceptables = new ObjectDecl(
    301277                        namer_acc.newName(),
     278                        noStorage,
     279                        LinkageSpec::Cforall,
     280                        nullptr,
    302281                        new ArrayType(
    303282                                noQualifiers,
     
    315294                stmt->push_back( new DeclStmt( noLabels, acceptables) );
    316295
    317                 Expression * set = new UntypedExpr(
    318                         new NameExpr( "__builtin_memset" ),
    319                         {
    320                                 new VariableExpr( acceptables ),
    321                                 new ConstantExpr( Constant::from_int( 0 ) ),
    322                                 new SizeofExpr( new VariableExpr( acceptables ) )
    323                         }
    324                 );
    325 
    326                 ResolvExpr::findVoidExpression( set, indexer );
    327 
    328                 stmt->push_back( new ExprStmt( noLabels, set ) );
    329 
    330296                return acceptables;
    331297        }
    332298
    333         ObjectDecl * GenerateWaitForPass::declareFlag( CompoundStmt * stmt ) {
    334                 ObjectDecl * flag = ObjectDecl::newObject(
    335                         namer_flg.newName(),
    336                         new BasicType(
    337                                 noQualifiers,
    338                                 BasicType::Bool
    339                         ),
    340                         new SingleInit( new ConstantExpr( Constant::from_ulong( 0 ) ) )
    341                 );
    342 
    343                 stmt->push_back( new DeclStmt( noLabels, flag) );
    344 
    345                 return flag;
    346         }
    347 
    348         Statement * GenerateWaitForPass::makeSetter( ObjectDecl * flag ) {
    349                 Expression * expr = new UntypedExpr(
    350                         new NameExpr( "?=?" ),
    351                         {
    352                                 new VariableExpr( flag ),
    353                                 new ConstantExpr( Constant::from_ulong( 1 ) )
    354                         }
    355                 );
    356 
    357                 ResolvExpr::findVoidExpression( expr, indexer );
    358 
    359                 return new ExprStmt( noLabels, expr );
    360         }
    361 
    362299        ObjectDecl * GenerateWaitForPass::declMon( WaitForStmt::Clause & clause, CompoundStmt * stmt ) {
    363300
    364                 ObjectDecl * mon = ObjectDecl::newObject(
     301                ObjectDecl * mon = new ObjectDecl(
    365302                        namer_mon.newName(),
     303                        noStorage,
     304                        LinkageSpec::Cforall,
     305                        nullptr,
    366306                        new ArrayType(
    367307                                noQualifiers,
    368                                 new PointerType(
     308                                new StructInstType(
    369309                                        noQualifiers,
    370                                         new StructInstType(
    371                                                 noQualifiers,
    372                                                 decl_monitor
    373                                         )
     310                                        decl_monitor
    374311                                ),
    375312                                new ConstantExpr( Constant::from_ulong( clause.target.arguments.size() ) ),
     
    379316                        new ListInit(
    380317                                map_range < std::list<Initializer*> > ( clause.target.arguments, [this](Expression * expr ){
    381                                         Expression * init = new CastExpr(
    382                                                 new UntypedExpr(
    383                                                         new NameExpr( "get_monitor" ),
    384                                                         { expr }
    385                                                 ),
    386                                                 new PointerType(
    387                                                         noQualifiers,
    388                                                         new StructInstType(
    389                                                                 noQualifiers,
    390                                                                 decl_monitor
    391                                                         )
    392                                                 )
    393                                         );
    394 
    395                                         ResolvExpr::findSingleExpression( init, indexer );
    396                                         return new SingleInit( init );
     318                                        return new SingleInit( expr );
    397319                                })
    398320                        )
     
    404326        }
    405327
    406         void GenerateWaitForPass::init( ObjectDecl * acceptables, int index, WaitForStmt::Clause & clause, Statement * setter, CompoundStmt * stmt ) {
     328        void GenerateWaitForPass::init( ObjectDecl * acceptables, int index, WaitForStmt::Clause & clause, CompoundStmt * stmt ) {
    407329
    408330                ObjectDecl * monitors = declMon( clause, stmt );
    409331
    410                 Type * fptr_t = new PointerType( noQualifiers, new FunctionType( noQualifiers, true ) );
     332                CompoundStmt * compound = new CompoundStmt( noLabels );
     333                compound->push_back( makeAccStatement( acceptables, index, decl_m_func    , clause.target.function ) );
     334                compound->push_back( makeAccStatement( acceptables, index, decl_m_count   , new ConstantExpr( Constant::from_ulong( clause.target.arguments.size() ) ) ) );
     335                compound->push_back( makeAccStatement( acceptables, index, decl_m_monitors, new VariableExpr( monitors ) ) );
     336                compound->push_back( makeAccStatement( acceptables, index, decl_m_isdtor  , new ConstantExpr( Constant::from_bool( true ) ) ) );
    411337
    412338                stmt->push_back( new IfStmt(
    413339                        noLabels,
    414340                        safeCond( clause.condition ),
    415                         new CompoundStmt({
    416                                 makeAccStatement( acceptables, index, "is_dtor", detectIsDtor( clause.target.function )                                    , indexer ),
    417                                 makeAccStatement( acceptables, index, "func"   , new CastExpr( clause.target.function, fptr_t )                            , indexer ),
    418                                 makeAccStatement( acceptables, index, "list"   , new VariableExpr( monitors )                                              , indexer ),
    419                                 makeAccStatement( acceptables, index, "size"   , new ConstantExpr( Constant::from_ulong( clause.target.arguments.size() ) ), indexer ),
    420                                 setter->clone()
    421                         }),
     341                        compound,
    422342                        nullptr
    423343                ));
     
    433353                bool has_else,
    434354                Expression *& else_cond,
    435                 Statement * setter,
    436355                CompoundStmt * stmt
    437356        ) {
    438                 ObjectDecl * timeout = ObjectDecl::newObject(
     357                ObjectDecl * timeout = new ObjectDecl(
    439358                        namer_tim.newName(),
     359                        noStorage,
     360                        LinkageSpec::Cforall,
     361                        nullptr,
    440362                        new BasicType(
    441363                                noQualifiers,
     
    452374                        stmt->push_back( new IfStmt(
    453375                                noLabels,
    454                                 safeCond( time_cond ),
    455                                 new CompoundStmt({
    456                                         new ExprStmt(
    457                                                 noLabels,
    458                                                 makeOpAssign(
    459                                                         new VariableExpr( timeout ),
    460                                                         time
    461                                                 )
    462                                         ),
    463                                         setter->clone()
    464                                 }),
     376                                safeCond( else_cond ),
     377                                new ExprStmt(
     378                                        noLabels,
     379                                        makeOpAssign(
     380                                                new VariableExpr( timeout ),
     381                                                time
     382                                        )
     383                                ),
    465384                                nullptr
    466385                        ));
     
    473392                                noLabels,
    474393                                safeCond( else_cond ),
    475                                 new CompoundStmt({
    476                                         new ExprStmt(
    477                                                 noLabels,
    478                                                 makeOpAssign(
    479                                                         new VariableExpr( timeout ),
    480                                                         new ConstantExpr( Constant::from_ulong( 0 ) )
    481                                                 )
    482                                         ),
    483                                         setter->clone()
    484                                 }),
     394                                new ExprStmt(
     395                                        noLabels,
     396                                        makeOpAssign(
     397                                                new VariableExpr( timeout ),
     398                                                new ConstantExpr( Constant::from_ulong( 0 ) )
     399                                        )
     400                                ),
    485401                                nullptr
    486402                        ));
     
    489405                }
    490406
    491                 delete setter;
    492 
    493407                return new VariableExpr( timeout );
    494         }
    495 
    496         Expression * GenerateWaitForPass::call(
    497                 size_t count,
    498                 ObjectDecl * acceptables,
    499                 Expression * timeout,
    500                 CompoundStmt * stmt
    501         ) {
    502                 ObjectDecl * index = ObjectDecl::newObject(
    503                         namer_idx.newName(),
    504                         new BasicType(
    505                                 noQualifiers,
    506                                 BasicType::ShortSignedInt
    507                         ),
    508                         new SingleInit(
    509                                 new ConstantExpr( Constant::from_int( -1 ) )
    510                         )
    511                 );
    512 
    513                 stmt->push_back( new DeclStmt( noLabels, index ) );
    514 
    515                 ObjectDecl * mask = ObjectDecl::newObject(
    516                         namer_msk.newName(),
    517                         new StructInstType(
    518                                 noQualifiers,
    519                                 decl_mask
    520                         ),
    521                         new ListInit({
    522                                 new SingleInit( new AddressExpr( new VariableExpr( index ) ) ),
    523                                 new SingleInit( new VariableExpr( acceptables ) ),
    524                                 new SingleInit( new ConstantExpr( Constant::from_ulong( count ) ) )
    525                         })
    526                 );
    527 
    528                 stmt->push_back( new DeclStmt( noLabels, mask ) );
    529 
    530                 stmt->push_back( new ExprStmt(
    531                         noLabels,
    532                         new ApplicationExpr(
    533                                 VariableExpr::functionPointer( decl_waitfor ),
    534                                 {
    535                                         new CastExpr(
    536                                                 new VariableExpr( mask ),
    537                                                 new ReferenceType(
    538                                                         noQualifiers,
    539                                                         new StructInstType(
    540                                                                 noQualifiers,
    541                                                                 decl_mask
    542                                                         )
    543                                                 )
    544                                         ),
    545                                         timeout
    546                                 }
    547                         )
    548                 ));
    549 
    550                 return new VariableExpr( index );
    551         }
    552 
    553         void GenerateWaitForPass::choose(
    554                 WaitForStmt * waitfor,
    555                 Expression  * result,
    556                 CompoundStmt * stmt
    557         ) {
    558                 SwitchStmt * swtch = new SwitchStmt(
    559                         noLabels,
    560                         result,
    561                         std::list<Statement *>()
    562                 );
    563 
    564                 unsigned long i = 0;
    565                 for( auto & clause : waitfor->clauses ) {
    566                         swtch->statements.push_back(
    567                                 new CaseStmt(
    568                                         noLabels,
    569                                         new ConstantExpr( Constant::from_ulong( i++ ) ),
    570                                         {
    571                                                 clause.statement,
    572                                                 new BranchStmt(
    573                                                         noLabels,
    574                                                         "",
    575                                                         BranchStmt::Break
    576                                                 )
    577                                         }
    578                                 )
    579                         );
    580                 }
    581 
    582                 if(waitfor->timeout.statement) {
    583                         swtch->statements.push_back(
    584                                 new CaseStmt(
    585                                         noLabels,
    586                                         new ConstantExpr( Constant::from_int( -2 ) ),
    587                                         {
    588                                                 waitfor->timeout.statement,
    589                                                 new BranchStmt(
    590                                                         noLabels,
    591                                                         "",
    592                                                         BranchStmt::Break
    593                                                 )
    594                                         }
    595                                 )
    596                         );
    597                 }
    598 
    599                 if(waitfor->orelse.statement) {
    600                         swtch->statements.push_back(
    601                                 new CaseStmt(
    602                                         noLabels,
    603                                         new ConstantExpr( Constant::from_int( -1 ) ),
    604                                         {
    605                                                 waitfor->orelse.statement,
    606                                                 new BranchStmt(
    607                                                         noLabels,
    608                                                         "",
    609                                                         BranchStmt::Break
    610                                                 )
    611                                         }
    612                                 )
    613                         );
    614                 }
    615 
    616                 stmt->push_back( swtch );
    617408        }
    618409};
  • src/GenPoly/Box.cc

    r3f7e12cb r78315272  
    3232#include "Common/UniqueName.h"           // for UniqueName
    3333#include "Common/utility.h"              // for toString
     34#include "DeclMutator.h"                 // for DeclMutator
    3435#include "FindFunction.h"                // for findFunction, findAndReplace...
    3536#include "GenPoly/ErasableScopedMap.h"   // for ErasableScopedMap<>::const_i...
     
    3839#include "Lvalue.h"                      // for generalizedLvalue
    3940#include "Parser/LinkageSpec.h"          // for C, Spec, Cforall, Intrinsic
     41#include "PolyMutator.h"                 // for PolyMutator
    4042#include "ResolvExpr/TypeEnvironment.h"  // for EqvClass
    4143#include "ResolvExpr/typeops.h"          // for typesCompatible
     
    6062                FunctionType *makeAdapterType( FunctionType *adaptee, const TyVarMap &tyVars );
    6163
    62                 class BoxPass {
    63                 protected:
    64                         BoxPass() : scopeTyVars( TypeDecl::Data{} ) {}
    65                         TyVarMap scopeTyVars;
     64                /// Adds layout-generation functions to polymorphic types
     65                class LayoutFunctionBuilder final : public DeclMutator {
     66                        unsigned int functionNesting;  // current level of nested functions
     67                public:
     68                        LayoutFunctionBuilder() : functionNesting( 0 ) {}
     69
     70                        using DeclMutator::mutate;
     71                        virtual DeclarationWithType *mutate( FunctionDecl *functionDecl ) override;
     72                        virtual Declaration *mutate( StructDecl *structDecl ) override;
     73                        virtual Declaration *mutate( UnionDecl *unionDecl ) override;
    6674                };
    6775
    68                 /// Adds layout-generation functions to polymorphic types
    69                 class LayoutFunctionBuilder final : public WithDeclsToAdd, public WithVisitorRef<LayoutFunctionBuilder>, public WithShortCircuiting {
    70                         unsigned int functionNesting = 0;  // current level of nested functions
    71                 public:
    72                         void previsit( FunctionDecl *functionDecl );
    73                         void previsit( StructDecl *structDecl );
    74                         void previsit( UnionDecl *unionDecl );
    75                 };
    76 
    7776                /// Replaces polymorphic return types with out-parameters, replaces calls to polymorphic functions with adapter calls as needed, and adds appropriate type variables to the function call
    78                 class Pass1 final : public BoxPass, public WithTypeSubstitution, public WithStmtsToAdd, public WithGuards, public WithVisitorRef<Pass1>, public WithShortCircuiting {
     77                class Pass1 final : public PolyMutator {
    7978                  public:
    8079                        Pass1();
    8180
    82                         void premutate( FunctionDecl * functionDecl );
    83                         void premutate( TypeDecl * typeDecl );
    84                         void premutate( CommaExpr * commaExpr );
    85                         Expression * postmutate( ApplicationExpr * appExpr );
    86                         Expression * postmutate( UntypedExpr *expr );
    87                         void premutate( AddressExpr * addrExpr );
    88                         Expression * postmutate( AddressExpr * addrExpr );
    89                         void premutate( ReturnStmt * returnStmt );
    90                         void premutate( PointerType * pointerType );
    91                         void premutate( FunctionType * functionType );
    92 
    93                         void beginScope();
    94                         void endScope();
     81                        using PolyMutator::mutate;
     82                        virtual Expression *mutate( ApplicationExpr *appExpr ) override;
     83                        virtual Expression *mutate( AddressExpr *addrExpr ) override;
     84                        virtual Expression *mutate( UntypedExpr *expr ) override;
     85                        virtual DeclarationWithType* mutate( FunctionDecl *functionDecl ) override;
     86                        virtual TypeDecl *mutate( TypeDecl *typeDecl ) override;
     87                        virtual Expression *mutate( CommaExpr *commaExpr ) override;
     88                        virtual Expression *mutate( ConditionalExpr *condExpr ) override;
     89                        virtual Statement * mutate( ReturnStmt *returnStmt ) override;
     90                        virtual Type *mutate( PointerType *pointerType ) override;
     91                        virtual Type * mutate( FunctionType *functionType ) override;
     92
     93                        virtual void doBeginScope() override;
     94                        virtual void doEndScope() override;
    9595                  private:
    9696                        /// Pass the extra type parameters from polymorphic generic arguments or return types into a function application
     
    129129                /// * Moves polymorphic returns in function types to pointer-type parameters
    130130                /// * adds type size and assertion parameters to parameter lists
    131                 struct Pass2 final : public BoxPass, public WithGuards {
    132                         void handleAggDecl();
    133 
    134                         DeclarationWithType * postmutate( FunctionDecl *functionDecl );
    135                         void premutate( StructDecl *structDecl );
    136                         void premutate( UnionDecl *unionDecl );
    137                         void premutate( TraitDecl *unionDecl );
    138                         void premutate( TypeDecl *typeDecl );
    139                         void premutate( PointerType *pointerType );
    140                         void premutate( FunctionType *funcType );
     131                class Pass2 final : public PolyMutator {
     132                  public:
     133                        template< typename DeclClass >
     134                        DeclClass *handleDecl( DeclClass *decl );
     135                        template< typename AggDecl >
     136                        AggDecl * handleAggDecl( AggDecl * aggDecl );
     137
     138                        typedef PolyMutator Parent;
     139                        using Parent::mutate;
     140                        virtual DeclarationWithType *mutate( FunctionDecl *functionDecl ) override;
     141                        virtual ObjectDecl *mutate( ObjectDecl *objectDecl ) override;
     142                        virtual StructDecl *mutate( StructDecl *structDecl ) override;
     143                        virtual UnionDecl *mutate( UnionDecl *unionDecl ) override;
     144                        virtual TraitDecl *mutate( TraitDecl *unionDecl ) override;
     145                        virtual TypeDecl *mutate( TypeDecl *typeDecl ) override;
     146                        virtual TypedefDecl *mutate( TypedefDecl *typedefDecl ) override;
     147                        virtual Type *mutate( PointerType *pointerType ) override;
     148                        virtual Type *mutate( FunctionType *funcType ) override;
    141149
    142150                  private:
     
    150158                /// * Calculates polymorphic offsetof expressions from offset array
    151159                /// * Inserts dynamic calculation of polymorphic type layouts where needed
    152                 class PolyGenericCalculator final : public BoxPass, public WithGuards, public WithVisitorRef<PolyGenericCalculator>, public WithStmtsToAdd, public WithDeclsToAdd, public WithTypeSubstitution {
     160                class PolyGenericCalculator final : public WithGuards, public WithVisitorRef<PolyGenericCalculator>, public WithStmtsToAdd, public WithDeclsToAdd, public WithTypeSubstitution {
    153161                public:
    154162                        PolyGenericCalculator();
     
    189197                        ScopedSet< std::string > knownOffsets;          ///< Set of non-generic types for which the offset array exists in the current scope, indexed by offsetofName
    190198                        UniqueName bufNamer;                           ///< Namer for VLA buffers
     199                        TyVarMap scopeTyVars;
    191200                };
    192201
    193202                /// Replaces initialization of polymorphic values with alloca, declaration of dtype/ftype with appropriate void expression, sizeof expressions of polymorphic types with the proper variable, and strips fields from generic struct declarations.
    194                 struct Pass3 final : public BoxPass, public WithGuards {
     203                class Pass3 final : public PolyMutator {
     204                  public:
    195205                        template< typename DeclClass >
    196                         void handleDecl( DeclClass * decl, Type * type );
    197 
    198                         void premutate( ObjectDecl * objectDecl );
    199                         void premutate( FunctionDecl * functionDecl );
    200                         void premutate( TypedefDecl * typedefDecl );
    201                         void premutate( StructDecl * structDecl );
    202                         void premutate( UnionDecl * unionDecl );
    203                         void premutate( TypeDecl * typeDecl );
    204                         void premutate( PointerType * pointerType );
    205                         void premutate( FunctionType * funcType );
     206                        DeclClass *handleDecl( DeclClass *decl, Type *type );
     207
     208                        using PolyMutator::mutate;
     209                        virtual DeclarationWithType *mutate( FunctionDecl *functionDecl ) override;
     210                        virtual Declaration *mutate( StructDecl *structDecl ) override;
     211                        virtual Declaration *mutate( UnionDecl *unionDecl ) override;
     212                        virtual ObjectDecl *mutate( ObjectDecl *objectDecl ) override;
     213                        virtual TypedefDecl *mutate( TypedefDecl *objectDecl ) override;
     214                        virtual TypeDecl *mutate( TypeDecl *objectDecl ) override;
     215                        virtual Type *mutate( PointerType *pointerType ) override;
     216                        virtual Type *mutate( FunctionType *funcType ) override;
     217                  private:
    206218                };
    207219        } // anonymous namespace
     
    235247
    236248        void box( std::list< Declaration *>& translationUnit ) {
    237                 PassVisitor<LayoutFunctionBuilder> layoutBuilder;
    238                 PassVisitor<Pass1> pass1;
    239                 PassVisitor<Pass2> pass2;
     249                LayoutFunctionBuilder layoutBuilder;
     250                Pass1 pass1;
     251                Pass2 pass2;
    240252                PassVisitor<PolyGenericCalculator> polyCalculator;
    241                 PassVisitor<Pass3> pass3;
    242 
    243                 acceptAll( translationUnit, layoutBuilder );
    244                 mutateAll( translationUnit, pass1 );
    245                 mutateAll( translationUnit, pass2 );
     253                Pass3 pass3;
     254
     255                layoutBuilder.mutateDeclarationList( translationUnit );
     256                mutateTranslationUnit/*All*/( translationUnit, pass1 );
     257                mutateTranslationUnit/*All*/( translationUnit, pass2 );
    246258                mutateAll( translationUnit, polyCalculator );
    247                 mutateAll( translationUnit, pass3 );
     259                mutateTranslationUnit/*All*/( translationUnit, pass3 );
    248260        }
    249261
    250262        ////////////////////////////////// LayoutFunctionBuilder ////////////////////////////////////////////
    251263
    252         void LayoutFunctionBuilder::previsit( FunctionDecl *functionDecl ) {
    253                 visit_children = false;
    254                 maybeAccept( functionDecl->get_functionType(), *visitor );
     264        DeclarationWithType *LayoutFunctionBuilder::mutate( FunctionDecl *functionDecl ) {
     265                functionDecl->set_functionType( maybeMutate( functionDecl->get_functionType(), *this ) );
    255266                ++functionNesting;
    256                 maybeAccept( functionDecl->get_statements(), *visitor );
     267                functionDecl->set_statements( maybeMutate( functionDecl->get_statements(), *this ) );
    257268                --functionNesting;
     269                return functionDecl;
    258270        }
    259271
     
    344356        }
    345357
    346         void LayoutFunctionBuilder::previsit( StructDecl *structDecl ) {
     358        Declaration *LayoutFunctionBuilder::mutate( StructDecl *structDecl ) {
    347359                // do not generate layout function for "empty" tag structs
    348                 visit_children = false;
    349                 if ( structDecl->get_members().empty() ) return;
     360                if ( structDecl->get_members().empty() ) return structDecl;
    350361
    351362                // get parameters that can change layout, exiting early if none
    352363                std::list< TypeDecl* > otypeParams = takeOtypeOnly( structDecl->get_parameters() );
    353                 if ( otypeParams.empty() ) return;
     364                if ( otypeParams.empty() ) return structDecl;
    354365
    355366                // build layout function signature
     
    402413                addStmt( layoutDecl->get_statements(), makeAlignTo( derefVar( sizeParam ), derefVar( alignParam ) ) );
    403414
    404                 declsToAddAfter.push_back( layoutDecl );
     415                addDeclarationAfter( layoutDecl );
     416                return structDecl;
    405417        }
    406418
    407         void LayoutFunctionBuilder::previsit( UnionDecl *unionDecl ) {
     419        Declaration *LayoutFunctionBuilder::mutate( UnionDecl *unionDecl ) {
    408420                // do not generate layout function for "empty" tag unions
    409                 visit_children = false;
    410                 if ( unionDecl->get_members().empty() ) return;
     421                if ( unionDecl->get_members().empty() ) return unionDecl;
    411422
    412423                // get parameters that can change layout, exiting early if none
    413424                std::list< TypeDecl* > otypeParams = takeOtypeOnly( unionDecl->get_parameters() );
    414                 if ( otypeParams.empty() ) return;
     425                if ( otypeParams.empty() ) return unionDecl;
    415426
    416427                // build layout function signature
     
    445456                addStmt( layoutDecl->get_statements(), makeAlignTo( derefVar( sizeParam ), derefVar( alignParam ) ) );
    446457
    447                 declsToAddAfter.push_back( layoutDecl );
     458                addDeclarationAfter( layoutDecl );
     459                return unionDecl;
    448460        }
    449461
     
    489501                Pass1::Pass1() : tempNamer( "_temp" ) {}
    490502
    491                 void Pass1::premutate( FunctionDecl *functionDecl ) {
     503                DeclarationWithType *Pass1::mutate( FunctionDecl *functionDecl ) {
    492504                        if ( functionDecl->get_statements() ) {         // empty routine body ?
    493505                                // std::cerr << "mutating function: " << functionDecl->get_mangleName() << std::endl;
    494                                 GuardScope( scopeTyVars );
    495                                 GuardValue( retval );
     506                                doBeginScope();
     507                                scopeTyVars.beginScope();
     508
     509                                DeclarationWithType *oldRetval = retval;
    496510
    497511                                // process polymorphic return value
    498512                                retval = nullptr;
    499                                 FunctionType *functionType = functionDecl->type;
    500                                 if ( isDynRet( functionType ) && functionDecl->linkage != LinkageSpec::C ) {
    501                                         retval = functionType->returnVals.front();
     513                                if ( isDynRet( functionDecl->get_functionType() ) && functionDecl->get_linkage() != LinkageSpec::C ) {
     514                                        retval = functionDecl->get_functionType()->get_returnVals().front();
    502515
    503516                                        // give names to unnamed return values
    504                                         if ( retval->name == "" ) {
    505                                                 retval->name = "_retparm";
    506                                                 retval->linkage = LinkageSpec::C;
     517                                        if ( retval->get_name() == "" ) {
     518                                                retval->set_name( "_retparm" );
     519                                                retval->set_linkage( LinkageSpec::C );
    507520                                        } // if
    508521                                } // if
    509522
    510                                 makeTyVarMap( functionType, scopeTyVars );
    511 
    512                                 std::list< DeclarationWithType *> &paramList = functionType->parameters;
     523                                FunctionType *functionType = functionDecl->get_functionType();
     524                                makeTyVarMap( functionDecl->get_functionType(), scopeTyVars );
     525
     526                                std::list< DeclarationWithType *> &paramList = functionType->get_parameters();
    513527                                std::list< FunctionType *> functions;
    514                                 for ( Type::ForallList::iterator tyVar = functionType->forall.begin(); tyVar != functionType->forall.end(); ++tyVar ) {
    515                                         for ( std::list< DeclarationWithType *>::iterator assert = (*tyVar)->assertions.begin(); assert != (*tyVar)->assertions.end(); ++assert ) {
     528                                for ( Type::ForallList::iterator tyVar = functionType->get_forall().begin(); tyVar != functionType->get_forall().end(); ++tyVar ) {
     529                                        for ( std::list< DeclarationWithType *>::iterator assert = (*tyVar)->get_assertions().begin(); assert != (*tyVar)->get_assertions().end(); ++assert ) {
    516530                                                findFunction( (*assert)->get_type(), functions, scopeTyVars, needsAdapter );
    517531                                        } // for
     
    528542                                        } // if
    529543                                } // for
     544
     545                                functionDecl->set_statements( functionDecl->get_statements()->acceptMutator( *this ) );
     546
     547                                scopeTyVars.endScope();
     548                                retval = oldRetval;
     549                                doEndScope();
    530550                                // std::cerr << "end function: " << functionDecl->get_mangleName() << std::endl;
    531551                        } // if
    532                 }
    533 
    534                 void Pass1::premutate( TypeDecl *typeDecl ) {
     552                        return functionDecl;
     553                }
     554
     555                TypeDecl *Pass1::mutate( TypeDecl *typeDecl ) {
    535556                        addToTyVarMap( typeDecl, scopeTyVars );
    536                 }
    537 
    538                 void Pass1::premutate( CommaExpr *commaExpr ) {
     557                        return dynamic_cast<TypeDecl*>( Mutator::mutate( typeDecl ) );
     558                }
     559
     560                Expression *Pass1::mutate( CommaExpr *commaExpr ) {
    539561                        // Attempting to find application expressions that were mutated by the copy constructor passes
    540562                        // to use an explicit return variable, so that the variable can be reused as a parameter to the
     
    552574                                }
    553575                        }
     576
     577                        commaExpr->set_arg1( maybeMutate( commaExpr->get_arg1(), *this ) );
     578                        commaExpr->set_arg2( maybeMutate( commaExpr->get_arg2(), *this ) );
     579                        return commaExpr;
     580                }
     581
     582                Expression *Pass1::mutate( ConditionalExpr *condExpr ) {
     583                        condExpr->set_arg1( maybeMutate( condExpr->get_arg1(), *this ) );
     584                        condExpr->set_arg2( maybeMutate( condExpr->get_arg2(), *this ) );
     585                        condExpr->set_arg3( maybeMutate( condExpr->get_arg3(), *this ) );
     586                        return condExpr;
     587
    554588                }
    555589
     
    600634
    601635                        // add size/align for generic types to parameter list
    602                         if ( ! appExpr->get_function()->result ) return;
     636                        if ( ! appExpr->get_function()->has_result() ) return;
    603637                        FunctionType *funcType = getFunctionType( appExpr->get_function()->get_result() );
    604638                        assert( funcType );
     
    625659                ObjectDecl *Pass1::makeTemporary( Type *type ) {
    626660                        ObjectDecl *newObj = new ObjectDecl( tempNamer.newName(), Type::StorageClasses(), LinkageSpec::C, 0, type, 0 );
    627                         stmtsToAddBefore.push_back( new DeclStmt( noLabels, newObj ) );
     661                        stmtsToAdd.push_back( new DeclStmt( noLabels, newObj ) );
    628662                        return newObj;
    629663                }
     
    714748
    715749                void Pass1::boxParam( Type *param, Expression *&arg, const TyVarMap &exprTyVars ) {
    716                         assertf( arg->result, "arg does not have result: %s", toString( arg ).c_str() );
    717                         if ( ! needsBoxing( param, arg->result, exprTyVars, env ) ) return;
    718 
    719                         if ( arg->result->get_lvalue() ) {
    720                                 // argument expression may be CFA lvalue, but not C lvalue -- apply generalizedLvalue transformations.
    721                                 // if ( VariableExpr * varExpr = dynamic_cast< VariableExpr * >( arg ) ) {
    722                                 //      if ( dynamic_cast<ArrayType *>( varExpr->var->get_type() ) ){
    723                                 //              // temporary hack - don't box arrays, because &arr is not the same as &arr[0]
    724                                 //              return;
    725                                 //      }
    726                                 // }
    727                                 arg =  generalizedLvalue( new AddressExpr( arg ) );
    728                                 if ( ! ResolvExpr::typesCompatible( param, arg->get_result(), SymTab::Indexer() ) ) {
    729                                         // silence warnings by casting boxed parameters when the actual type does not match up with the formal type.
    730                                         arg = new CastExpr( arg, param->clone() );
    731                                 }
    732                         } else {
    733                                 // use type computed in unification to declare boxed variables
    734                                 Type * newType = param->clone();
     750                        assertf( arg->has_result(), "arg does not have result: %s", toString( arg ).c_str() );
     751                        if ( isPolyType( param, exprTyVars ) ) {
     752                                Type * newType = arg->get_result()->clone();
    735753                                if ( env ) env->apply( newType );
    736                                 ObjectDecl *newObj = ObjectDecl::newObject( tempNamer.newName(), newType, nullptr );
    737                                 newObj->get_type()->get_qualifiers() = Type::Qualifiers(); // TODO: is this right???
    738                                 stmtsToAddBefore.push_back( new DeclStmt( noLabels, newObj ) );
    739                                 UntypedExpr *assign = new UntypedExpr( new NameExpr( "?=?" ) ); // TODO: why doesn't this just use initialization syntax?
    740                                 assign->get_args().push_back( new VariableExpr( newObj ) );
    741                                 assign->get_args().push_back( arg );
    742                                 stmtsToAddBefore.push_back( new ExprStmt( noLabels, assign ) );
    743                                 arg = new AddressExpr( new VariableExpr( newObj ) );
     754                                std::unique_ptr<Type> manager( newType );
     755                                if ( isPolyType( newType ) ) {
     756                                        // if the argument's type is polymorphic, we don't need to box again!
     757                                        return;
     758                                } else if ( arg->get_result()->get_lvalue() ) {
     759                                        // argument expression may be CFA lvalue, but not C lvalue -- apply generalizedLvalue transformations.
     760                                        // if ( VariableExpr * varExpr = dynamic_cast< VariableExpr * >( arg ) ) {
     761                                        //      if ( dynamic_cast<ArrayType *>( varExpr->var->get_type() ) ){
     762                                        //              // temporary hack - don't box arrays, because &arr is not the same as &arr[0]
     763                                        //              return;
     764                                        //      }
     765                                        // }
     766                                        arg =  generalizedLvalue( new AddressExpr( arg ) );
     767                                        if ( ! ResolvExpr::typesCompatible( param, arg->get_result(), SymTab::Indexer() ) ) {
     768                                                // silence warnings by casting boxed parameters when the actual type does not match up with the formal type.
     769                                                arg = new CastExpr( arg, param->clone() );
     770                                        }
     771                                } else {
     772                                        // use type computed in unification to declare boxed variables
     773                                        Type * newType = param->clone();
     774                                        if ( env ) env->apply( newType );
     775                                        ObjectDecl *newObj = new ObjectDecl( tempNamer.newName(), Type::StorageClasses(), LinkageSpec::C, 0, newType, 0 );
     776                                        newObj->get_type()->get_qualifiers() = Type::Qualifiers(); // TODO: is this right???
     777                                        stmtsToAdd.push_back( new DeclStmt( noLabels, newObj ) );
     778                                        UntypedExpr *assign = new UntypedExpr( new NameExpr( "?=?" ) ); // TODO: why doesn't this just use initialization syntax?
     779                                        assign->get_args().push_back( new VariableExpr( newObj ) );
     780                                        assign->get_args().push_back( arg );
     781                                        stmtsToAdd.push_back( new ExprStmt( noLabels, assign ) );
     782                                        arg = new AddressExpr( new VariableExpr( newObj ) );
     783                                } // if
    744784                        } // if
    745                 }
    746 
    747                 // find instances of polymorphic type parameters
    748                 struct PolyFinder {
    749                         const TyVarMap * tyVars = nullptr;
    750                         bool found = false;
    751 
    752                         void previsit( TypeInstType * t ) {
    753                                 if ( isPolyType( t, *tyVars ) ) {
    754                                         found = true;
    755                                 }
    756                         }
    757                 };
    758 
    759                 // true if there is an instance of a polymorphic type parameter in t
    760                 bool hasPolymorphism( Type * t, const TyVarMap &tyVars ) {
    761                         PassVisitor<PolyFinder> finder;
    762                         finder.pass.tyVars = &tyVars;
    763                         maybeAccept( t, finder );
    764                         return finder.pass.found;
    765785                }
    766786
     
    769789                /// this gets rid of warnings from gcc.
    770790                void addCast( Expression *&actual, Type *formal, const TyVarMap &tyVars ) {
    771                         // type contains polymorphism, but isn't exactly a polytype, in which case it
    772                         // has some real actual type (e.g. unsigned int) and casting to void * is wrong
    773                         if ( hasPolymorphism( formal, tyVars ) && ! isPolyType( formal, tyVars ) ) {
     791                        if ( getFunctionType( formal ) ) {
    774792                                Type * newType = formal->clone();
    775793                                newType = ScrubTyVars::scrub( newType, tyVars );
     
    779797
    780798                void Pass1::boxParams( ApplicationExpr *appExpr, FunctionType *function, std::list< Expression *>::iterator &arg, const TyVarMap &exprTyVars ) {
    781                         for ( std::list< DeclarationWithType *>::const_iterator param = function->get_parameters().begin(); param != function->parameters.end(); ++param, ++arg ) {
    782                                 assertf( arg != appExpr->args.end(), "boxParams: missing argument for param %s to %s in %s", toString( *param ).c_str(), toString( function ).c_str(), toString( appExpr ).c_str() );
     799                        for ( std::list< DeclarationWithType *>::const_iterator param = function->get_parameters().begin(); param != function->get_parameters().end(); ++param, ++arg ) {
     800                                assertf( arg != appExpr->get_args().end(), "boxParams: missing argument for param %s to %s in %s", toString( *param ).c_str(), toString( function ).c_str(), toString( appExpr ).c_str() );
    783801                                addCast( *arg, (*param)->get_type(), exprTyVars );
    784802                                boxParam( (*param)->get_type(), *arg, exprTyVars );
     
    789807                        std::list< Expression *>::iterator cur = arg;
    790808                        for ( Type::ForallList::iterator tyVar = functionType->get_forall().begin(); tyVar != functionType->get_forall().end(); ++tyVar ) {
    791                                 for ( std::list< DeclarationWithType *>::iterator assert = (*tyVar)->assertions.begin(); assert != (*tyVar)->assertions.end(); ++assert ) {
     809                                for ( std::list< DeclarationWithType *>::iterator assert = (*tyVar)->get_assertions().begin(); assert != (*tyVar)->get_assertions().end(); ++assert ) {
    792810                                        InferredParams::const_iterator inferParam = appExpr->get_inferParams().find( (*assert)->get_uniqueId() );
    793                                         assertf( inferParam != appExpr->get_inferParams().end(), "addInferredParams missing inferred parameter: %s in: %s", toString( *assert ).c_str(), toString( appExpr ).c_str() );
     811                                        if ( inferParam == appExpr->get_inferParams().end() ) {
     812                                                std::cerr << "looking for assertion: " << (*assert) << std::endl << appExpr << std::endl;
     813                                        }
     814                                        assertf( inferParam != appExpr->get_inferParams().end(), "NOTE: Explicit casts of polymorphic functions to compatible monomorphic functions are currently unsupported" );
    794815                                        Expression *newExpr = inferParam->second.expr->clone();
    795816                                        addCast( newExpr, (*assert)->get_type(), tyVars );
     
    801822
    802823                void makeRetParm( FunctionType *funcType ) {
    803                         DeclarationWithType *retParm = funcType->returnVals.front();
     824                        DeclarationWithType *retParm = funcType->get_returnVals().front();
    804825
    805826                        // make a new parameter that is a pointer to the type of the old return value
     
    814835                        // actually make the adapter type
    815836                        FunctionType *adapter = adaptee->clone();
     837//                      if ( ! adapter->get_returnVals().empty() && isPolyType( adapter->get_returnVals().front()->get_type(), tyVars ) ) {
    816838                        if ( isDynRet( adapter, tyVars ) ) {
    817839                                makeRetParm( adapter );
     
    939961                                                std::pair< AdapterIter, bool > answer = adapters.insert( std::pair< std::string, DeclarationWithType *>( mangleName, newAdapter ) );
    940962                                                adapter = answer.first;
    941                                                 stmtsToAddBefore.push_back( new DeclStmt( noLabels, newAdapter ) );
     963                                                stmtsToAdd.push_back( new DeclStmt( noLabels, newAdapter ) );
    942964                                        } // if
    943965                                        assert( adapter != adapters.end() );
     
    977999                                if ( varExpr->get_var()->get_linkage() == LinkageSpec::Intrinsic ) {
    9781000                                        if ( varExpr->get_var()->get_name() == "?[?]" ) {
    979                                                 assert( appExpr->result );
     1001                                                assert( appExpr->has_result() );
    9801002                                                assert( appExpr->get_args().size() == 2 );
    9811003                                                Type *baseType1 = isPolyPtr( appExpr->get_args().front()->get_result(), scopeTyVars, env );
     
    10111033                                                } // if
    10121034                                        } else if ( varExpr->get_var()->get_name() == "*?" ) {
    1013                                                 assert( appExpr->result );
     1035                                                assert( appExpr->has_result() );
    10141036                                                assert( ! appExpr->get_args().empty() );
    10151037                                                if ( isPolyType( appExpr->get_result(), scopeTyVars, env ) ) {
     
    10281050                                                } // if
    10291051                                        } else if ( varExpr->get_var()->get_name() == "?++" || varExpr->get_var()->get_name() == "?--" ) {
    1030                                                 assert( appExpr->result );
     1052                                                assert( appExpr->has_result() );
    10311053                                                assert( appExpr->get_args().size() == 1 );
    10321054                                                if ( Type *baseType = isPolyPtr( appExpr->get_result(), scopeTyVars, env ) ) {
     
    10481070                                                } // if
    10491071                                        } else if ( varExpr->get_var()->get_name() == "++?" || varExpr->get_var()->get_name() == "--?" ) {
    1050                                                 assert( appExpr->result );
     1072                                                assert( appExpr->has_result() );
    10511073                                                assert( appExpr->get_args().size() == 1 );
    10521074                                                if ( Type *baseType = isPolyPtr( appExpr->get_result(), scopeTyVars, env ) ) {
     
    10541076                                                } // if
    10551077                                        } else if ( varExpr->get_var()->get_name() == "?+?" || varExpr->get_var()->get_name() == "?-?" ) {
    1056                                                 assert( appExpr->result );
     1078                                                assert( appExpr->has_result() );
    10571079                                                assert( appExpr->get_args().size() == 2 );
    10581080                                                Type *baseType1 = isPolyPtr( appExpr->get_args().front()->get_result(), scopeTyVars, env );
     
    10801102                                                } // if
    10811103                                        } else if ( varExpr->get_var()->get_name() == "?+=?" || varExpr->get_var()->get_name() == "?-=?" ) {
    1082                                                 assert( appExpr->result );
     1104                                                assert( appExpr->has_result() );
    10831105                                                assert( appExpr->get_args().size() == 2 );
    10841106                                                Type *baseType = isPolyPtr( appExpr->get_result(), scopeTyVars, env );
     
    10961118                }
    10971119
    1098                 Expression *Pass1::postmutate( ApplicationExpr *appExpr ) {
     1120                Expression *Pass1::mutate( ApplicationExpr *appExpr ) {
    10991121                        // std::cerr << "mutate appExpr: " << InitTweak::getFunctionName( appExpr ) << std::endl;
    11001122                        // for ( TyVarMap::iterator i = scopeTyVars.begin(); i != scopeTyVars.end(); ++i ) {
     
    11021124                        // }
    11031125                        // std::cerr << "\n";
    1104 
    1105                         assert( appExpr->function->result );
    1106                         FunctionType * function = getFunctionType( appExpr->function->result );
    1107                         assertf( function, "ApplicationExpr has non-function type: %s", toString( appExpr->function->result ).c_str() );
     1126                        appExpr->get_function()->acceptMutator( *this );
     1127                        mutateAll( appExpr->get_args(), *this );
     1128
     1129                        assert( appExpr->get_function()->has_result() );
     1130                        FunctionType * function = getFunctionType( appExpr->get_function()->get_result() );
     1131                        assertf( function, "ApplicationExpr has non-function type: %s", toString( appExpr->get_function()->get_result() ).c_str() );
    11081132
    11091133                        if ( Expression *newExpr = handleIntrinsics( appExpr ) ) {
     
    11581182                }
    11591183
    1160                 Expression * Pass1::postmutate( UntypedExpr *expr ) {
    1161                         if ( expr->result && isPolyType( expr->result, scopeTyVars, env ) ) {
    1162                                 if ( NameExpr *name = dynamic_cast< NameExpr *>( expr->function ) ) {
     1184                Expression *Pass1::mutate( UntypedExpr *expr ) {
     1185                        if ( expr->has_result() && isPolyType( expr->get_result(), scopeTyVars, env ) ) {
     1186                                if ( NameExpr *name = dynamic_cast< NameExpr *>( expr->get_function() ) ) {
    11631187                                        if ( name->get_name() == "*?" ) {
    1164                                                 Expression *ret = expr->args.front();
    1165                                                 expr->args.clear();
     1188                                                Expression *ret = expr->get_args().front();
     1189                                                expr->get_args().clear();
    11661190                                                delete expr;
    1167                                                 return ret;
     1191                                                return ret->acceptMutator( *this );
    11681192                                        } // if
    11691193                                } // if
    11701194                        } // if
    1171                         return expr;
    1172                 }
    1173 
    1174                 void Pass1::premutate( AddressExpr * ) { visit_children = false; }
    1175                 Expression * Pass1::postmutate( AddressExpr * addrExpr ) {
    1176                         assert( addrExpr->get_arg()->result && ! addrExpr->get_arg()->get_result()->isVoid() );
     1195                        return PolyMutator::mutate( expr );
     1196                }
     1197
     1198                Expression *Pass1::mutate( AddressExpr *addrExpr ) {
     1199                        assert( addrExpr->get_arg()->has_result() && ! addrExpr->get_arg()->get_result()->isVoid() );
    11771200
    11781201                        bool needs = false;
    11791202                        if ( UntypedExpr *expr = dynamic_cast< UntypedExpr *>( addrExpr->get_arg() ) ) {
    1180                                 if ( expr->result && isPolyType( expr->get_result(), scopeTyVars, env ) ) {
     1203                                if ( expr->has_result() && isPolyType( expr->get_result(), scopeTyVars, env ) ) {
    11811204                                        if ( NameExpr *name = dynamic_cast< NameExpr *>( expr->get_function() ) ) {
    11821205                                                if ( name->get_name() == "*?" ) {
    11831206                                                        if ( ApplicationExpr * appExpr = dynamic_cast< ApplicationExpr * >( expr->get_args().front() ) ) {
    1184                                                                 assert( appExpr->get_function()->result );
     1207                                                                assert( appExpr->get_function()->has_result() );
    11851208                                                                FunctionType *function = getFunctionType( appExpr->get_function()->get_result() );
    11861209                                                                assert( function );
     
    11931216                        // isPolyType check needs to happen before mutating addrExpr arg, so pull it forward
    11941217                        // out of the if condition.
    1195                         addrExpr->arg = addrExpr->get_arg()->acceptMutator( *visitor );
     1218                        addrExpr->set_arg( mutateExpression( addrExpr->get_arg() ) );
    11961219                        // ... but must happen after mutate, since argument might change (e.g. intrinsic *?, ?[?]) - re-evaluate above comment
    11971220                        bool polytype = isPolyType( addrExpr->get_arg()->get_result(), scopeTyVars, env );
     
    12081231                }
    12091232
    1210                 void Pass1::premutate( ReturnStmt *returnStmt ) {
    1211                         if ( retval && returnStmt->expr ) {
    1212                                 assert( returnStmt->expr->result && ! returnStmt->expr->result->isVoid() );
    1213                                 delete returnStmt->expr;
    1214                                 returnStmt->expr = nullptr;
     1233                Statement * Pass1::mutate( ReturnStmt *returnStmt ) {
     1234                        if ( retval && returnStmt->get_expr() ) {
     1235                                assert( returnStmt->get_expr()->has_result() && ! returnStmt->get_expr()->get_result()->isVoid() );
     1236                                delete returnStmt->get_expr();
     1237                                returnStmt->set_expr( 0 );
     1238                        } else {
     1239                                returnStmt->set_expr( mutateExpression( returnStmt->get_expr() ) );
    12151240                        } // if
    1216                 }
    1217 
    1218                 void Pass1::premutate( PointerType *pointerType ) {
    1219                         GuardScope( scopeTyVars );
     1241                        return returnStmt;
     1242                }
     1243
     1244                Type * Pass1::mutate( PointerType *pointerType ) {
     1245                        scopeTyVars.beginScope();
    12201246                        makeTyVarMap( pointerType, scopeTyVars );
    1221                 }
    1222 
    1223                 void Pass1::premutate( FunctionType *functionType ) {
    1224                         GuardScope( scopeTyVars );
     1247
     1248                        Type *ret = Mutator::mutate( pointerType );
     1249
     1250                        scopeTyVars.endScope();
     1251                        return ret;
     1252                }
     1253
     1254                Type * Pass1::mutate( FunctionType *functionType ) {
     1255                        scopeTyVars.beginScope();
    12251256                        makeTyVarMap( functionType, scopeTyVars );
    1226                 }
    1227 
    1228                 void Pass1::beginScope() {
     1257
     1258                        Type *ret = Mutator::mutate( functionType );
     1259
     1260                        scopeTyVars.endScope();
     1261                        return ret;
     1262                }
     1263
     1264                void Pass1::doBeginScope() {
    12291265                        adapters.beginScope();
    12301266                }
    12311267
    1232                 void Pass1::endScope() {
     1268                void Pass1::doEndScope() {
    12331269                        adapters.endScope();
    12341270                }
     
    12571293                }
    12581294
    1259                 DeclarationWithType * Pass2::postmutate( FunctionDecl *functionDecl ) {
     1295                template< typename DeclClass >
     1296                DeclClass * Pass2::handleDecl( DeclClass *decl ) {
     1297                        DeclClass *ret = static_cast< DeclClass *>( Parent::mutate( decl ) );
     1298
     1299                        return ret;
     1300                }
     1301
     1302                DeclarationWithType * Pass2::mutate( FunctionDecl *functionDecl ) {
     1303                        functionDecl = strict_dynamic_cast< FunctionDecl * > ( handleDecl( functionDecl ) );
    12601304                        FunctionType * ftype = functionDecl->get_functionType();
    12611305                        if ( ! ftype->get_returnVals().empty() && functionDecl->get_statements() ) {
     
    12811325                }
    12821326
    1283                 void Pass2::premutate( StructDecl * ) {
     1327                ObjectDecl * Pass2::mutate( ObjectDecl *objectDecl ) {
     1328                        return handleDecl( objectDecl );
     1329                }
     1330
     1331                template< typename AggDecl >
     1332                AggDecl * Pass2::handleAggDecl( AggDecl * aggDecl ) {
    12841333                        // prevent tyVars from leaking into containing scope
    1285                         GuardScope( scopeTyVars );
    1286                 }
    1287 
    1288                 void Pass2::premutate( UnionDecl * ) {
    1289                         // prevent tyVars from leaking into containing scope
    1290                         GuardScope( scopeTyVars );
    1291                 }
    1292 
    1293                 void Pass2::premutate( TraitDecl * ) {
    1294                         // prevent tyVars from leaking into containing scope
    1295                         GuardScope( scopeTyVars );
    1296                 }
    1297 
    1298                 void Pass2::premutate( TypeDecl *typeDecl ) {
     1334                        scopeTyVars.beginScope();
     1335                        Parent::mutate( aggDecl );
     1336                        scopeTyVars.endScope();
     1337                        return aggDecl;
     1338                }
     1339
     1340                StructDecl * Pass2::mutate( StructDecl *aggDecl ) {
     1341                        return handleAggDecl( aggDecl );
     1342                }
     1343
     1344                UnionDecl * Pass2::mutate( UnionDecl *aggDecl ) {
     1345                        return handleAggDecl( aggDecl );
     1346                }
     1347
     1348                TraitDecl * Pass2::mutate( TraitDecl *aggDecl ) {
     1349                        return handleAggDecl( aggDecl );
     1350                }
     1351
     1352                TypeDecl * Pass2::mutate( TypeDecl *typeDecl ) {
    12991353                        addToTyVarMap( typeDecl, scopeTyVars );
    1300                 }
    1301 
    1302                 void Pass2::premutate( PointerType *pointerType ) {
    1303                         GuardScope( scopeTyVars );
     1354                        if ( typeDecl->get_base() ) {
     1355                                return handleDecl( typeDecl );
     1356                        } else {
     1357                                return dynamic_cast<TypeDecl*>( Parent::mutate( typeDecl ) );
     1358                        }
     1359                }
     1360
     1361                TypedefDecl * Pass2::mutate( TypedefDecl *typedefDecl ) {
     1362                        return handleDecl( typedefDecl );
     1363                }
     1364
     1365                Type * Pass2::mutate( PointerType *pointerType ) {
     1366                        scopeTyVars.beginScope();
    13041367                        makeTyVarMap( pointerType, scopeTyVars );
    1305                 }
    1306 
    1307                 void Pass2::premutate( FunctionType *funcType ) {
    1308                         GuardScope( scopeTyVars );
     1368
     1369                        Type *ret = Parent::mutate( pointerType );
     1370
     1371                        scopeTyVars.endScope();
     1372                        return ret;
     1373                }
     1374
     1375                Type *Pass2::mutate( FunctionType *funcType ) {
     1376                        scopeTyVars.beginScope();
     1377
    13091378                        makeTyVarMap( funcType, scopeTyVars );
    13101379
     
    13451414                                // move all assertions into parameter list
    13461415                                for ( std::list< DeclarationWithType *>::iterator assert = (*tyParm)->get_assertions().begin(); assert != (*tyParm)->get_assertions().end(); ++assert ) {
     1416//      *assert = (*assert)->acceptMutator( *this );
    13471417                                        // assertion parameters may not be used in body, pass along with unused attribute.
    13481418                                        (*assert)->get_attributes().push_back( new Attribute( "unused" ) );
     
    13801450                                                }
    13811451                                        }
     1452
    13821453                                        seenTypes.insert( typeName );
    13831454                                }
     
    13871458                        funcType->get_parameters().splice( last, inferredParams );
    13881459                        addAdapters( funcType );
     1460                        mutateAll( funcType->get_returnVals(), *this );
     1461                        mutateAll( funcType->get_parameters(), *this );
     1462
     1463                        scopeTyVars.endScope();
     1464                        return funcType;
    13891465                }
    13901466
     
    13921468
    13931469                PolyGenericCalculator::PolyGenericCalculator()
    1394                         : knownLayouts(), knownOffsets(), bufNamer( "_buf" ) {}
     1470                        : knownLayouts(), knownOffsets(), bufNamer( "_buf" ), scopeTyVars( TypeDecl::Data{} ) {}
    13951471
    13961472                void PolyGenericCalculator::beginTypeScope( Type *ty ) {
     
    17531829
    17541830                template< typename DeclClass >
    1755                 void Pass3::handleDecl( DeclClass * decl, Type * type ) {
    1756                         GuardScope( scopeTyVars );
     1831                DeclClass * Pass3::handleDecl( DeclClass *decl, Type *type ) {
     1832                        scopeTyVars.beginScope();
    17571833                        makeTyVarMap( type, scopeTyVars );
     1834
     1835                        DeclClass *ret = static_cast< DeclClass *>( Mutator::mutate( decl ) );
     1836                        // ScrubTyVars::scrub( decl, scopeTyVars );
    17581837                        ScrubTyVars::scrubAll( decl );
    1759                 }
    1760 
    1761                 void Pass3::premutate( ObjectDecl * objectDecl ) {
    1762                         handleDecl( objectDecl, objectDecl->type );
    1763                 }
    1764 
    1765                 void Pass3::premutate( FunctionDecl * functionDecl ) {
    1766                         handleDecl( functionDecl, functionDecl->type );
    1767                 }
    1768 
    1769                 void Pass3::premutate( TypedefDecl * typedefDecl ) {
    1770                         handleDecl( typedefDecl, typedefDecl->base );
     1838
     1839                        scopeTyVars.endScope();
     1840                        return ret;
     1841                }
     1842
     1843                ObjectDecl * Pass3::mutate( ObjectDecl *objectDecl ) {
     1844                        return handleDecl( objectDecl, objectDecl->get_type() );
     1845                }
     1846
     1847                DeclarationWithType * Pass3::mutate( FunctionDecl *functionDecl ) {
     1848                        return handleDecl( functionDecl, functionDecl->get_functionType() );
     1849                }
     1850
     1851                TypedefDecl * Pass3::mutate( TypedefDecl *typedefDecl ) {
     1852                        return handleDecl( typedefDecl, typedefDecl->get_base() );
    17711853                }
    17721854
    17731855                /// Strips the members from a generic aggregate
    1774                 void stripGenericMembers(AggregateDecl * decl) {
    1775                         if ( ! decl->parameters.empty() ) decl->members.clear();
    1776                 }
    1777 
    1778                 void Pass3::premutate( StructDecl * structDecl ) {
     1856                void stripGenericMembers(AggregateDecl* decl) {
     1857                        if ( ! decl->get_parameters().empty() ) decl->get_members().clear();
     1858                }
     1859
     1860                Declaration *Pass3::mutate( StructDecl *structDecl ) {
    17791861                        stripGenericMembers( structDecl );
    1780                 }
    1781 
    1782                 void Pass3::premutate( UnionDecl * unionDecl ) {
     1862                        return structDecl;
     1863                }
     1864
     1865                Declaration *Pass3::mutate( UnionDecl *unionDecl ) {
    17831866                        stripGenericMembers( unionDecl );
    1784                 }
    1785 
    1786                 void Pass3::premutate( TypeDecl * typeDecl ) {
     1867                        return unionDecl;
     1868                }
     1869
     1870                TypeDecl * Pass3::mutate( TypeDecl *typeDecl ) {
     1871//   Initializer *init = 0;
     1872//   std::list< Expression *> designators;
     1873//   addToTyVarMap( typeDecl, scopeTyVars );
     1874//   if ( typeDecl->get_base() ) {
     1875//     init = new SimpleInit( new SizeofExpr( handleDecl( typeDecl, typeDecl->get_base() ) ), designators );
     1876//   }
     1877//   return new ObjectDecl( typeDecl->get_name(), Declaration::Extern, LinkageSpec::C, 0, new BasicType( Type::Qualifiers(), BasicType::UnsignedInt ), init );
     1878
    17871879                        addToTyVarMap( typeDecl, scopeTyVars );
    1788                 }
    1789 
    1790                 void Pass3::premutate( PointerType * pointerType ) {
    1791                         GuardScope( scopeTyVars );
     1880                        return dynamic_cast<TypeDecl*>( Mutator::mutate( typeDecl ) );
     1881                }
     1882
     1883                Type * Pass3::mutate( PointerType *pointerType ) {
     1884                        scopeTyVars.beginScope();
    17921885                        makeTyVarMap( pointerType, scopeTyVars );
    1793                 }
    1794 
    1795                 void Pass3::premutate( FunctionType * functionType ) {
    1796                         GuardScope( scopeTyVars );
     1886
     1887                        Type *ret = Mutator::mutate( pointerType );
     1888
     1889                        scopeTyVars.endScope();
     1890                        return ret;
     1891                }
     1892
     1893                Type * Pass3::mutate( FunctionType *functionType ) {
     1894                        scopeTyVars.beginScope();
    17971895                        makeTyVarMap( functionType, scopeTyVars );
     1896
     1897                        Type *ret = Mutator::mutate( functionType );
     1898
     1899                        scopeTyVars.endScope();
     1900                        return ret;
    17981901                }
    17991902        } // anonymous namespace
  • src/GenPoly/FindFunction.cc

    r3f7e12cb r78315272  
    1818#include <utility>                      // for pair
    1919
    20 #include "Common/PassVisitor.h"         // for PassVisitor
    2120#include "Common/SemanticError.h"       // for SemanticError
    2221#include "GenPoly/ErasableScopedMap.h"  // for ErasableScopedMap<>::iterator
     
    2827
    2928namespace GenPoly {
    30         class FindFunction : public WithGuards, public WithVisitorRef<FindFunction>, public WithShortCircuiting {
     29        class FindFunction : public Mutator {
    3130          public:
    3231                FindFunction( std::list< FunctionType* > &functions, const TyVarMap &tyVars, bool replaceMode, FindFunctionPredicate predicate );
    3332
    34                 void premutate( FunctionType * functionType );
    35                 Type * postmutate( FunctionType * functionType );
    36                 void premutate( PointerType * pointerType );
     33                virtual Type *mutate( FunctionType *functionType );
     34                virtual Type *mutate( PointerType *pointerType );
    3735          private:
    3836                void handleForall( const Type::ForallList &forall );
     
    4543
    4644        void findFunction( Type *type, std::list< FunctionType* > &functions, const TyVarMap &tyVars, FindFunctionPredicate predicate ) {
    47                 PassVisitor<FindFunction> finder( functions, tyVars, false, predicate );
     45                FindFunction finder( functions, tyVars, false, predicate );
    4846                type->acceptMutator( finder );
    4947        }
    5048
    5149        void findAndReplaceFunction( Type *&type, std::list< FunctionType* > &functions, const TyVarMap &tyVars, FindFunctionPredicate predicate ) {
    52                 PassVisitor<FindFunction> finder( functions, tyVars, true, predicate );
     50                FindFunction finder( functions, tyVars, true, predicate );
    5351                type = type->acceptMutator( finder );
    5452        }
     
    5957
    6058        void FindFunction::handleForall( const Type::ForallList &forall ) {
    61                 for ( const Declaration * td : forall ) {
    62                         TyVarMap::iterator var = tyVars.find( td->name );
     59                for ( Type::ForallList::const_iterator i = forall.begin(); i != forall.end(); ++i ) {
     60                        TyVarMap::iterator var = tyVars.find( (*i)->get_name() );
    6361                        if ( var != tyVars.end() ) {
    6462                                tyVars.erase( var->first );
     
    6765        }
    6866
    69         void FindFunction::premutate( FunctionType * functionType ) {
    70                 visit_children = false;
    71                 GuardScope( tyVars );
     67        Type * FindFunction::mutate( FunctionType *functionType ) {
     68                tyVars.beginScope();
    7269                handleForall( functionType->get_forall() );
    73                 mutateAll( functionType->get_returnVals(), *visitor );
    74         }
    75 
    76         Type * FindFunction::postmutate( FunctionType * functionType ) {
     70                mutateAll( functionType->get_returnVals(), *this );
    7771                Type *ret = functionType;
    7872                if ( predicate( functionType, tyVars ) ) {
     
    8377                        } // if
    8478                } // if
     79                tyVars.endScope();
    8580                return ret;
    8681        }
    8782
    88         void FindFunction::premutate( PointerType * pointerType ) {
    89                 GuardScope( tyVars );
     83        Type * FindFunction::mutate( PointerType *pointerType ) {
     84                tyVars.beginScope();
    9085                handleForall( pointerType->get_forall() );
     86                Type *ret = Mutator::mutate( pointerType );
     87                tyVars.endScope();
     88                return ret;
    9189        }
    9290} // namespace GenPoly
  • src/GenPoly/GenPoly.cc

    r3f7e12cb r78315272  
    432432        }
    433433
    434         bool needsBoxing( Type * param, Type * arg, const TyVarMap &exprTyVars, TypeSubstitution * env ) {
    435                 // is parameter is not polymorphic, don't need to box
    436                 if ( ! isPolyType( param, exprTyVars ) ) return false;
    437                 Type * newType = arg->clone();
    438                 if ( env ) env->apply( newType );
    439                 std::unique_ptr<Type> manager( newType );
    440                 // if the argument's type is polymorphic, we don't need to box again!
    441                 return ! isPolyType( newType );
    442         }
    443 
    444         bool needsBoxing( Type * param, Type * arg, ApplicationExpr * appExpr, TypeSubstitution * env ) {
    445                 FunctionType * function = getFunctionType( appExpr->function->result );
    446                 assertf( function, "ApplicationExpr has non-function type: %s", toString( appExpr->function->result ).c_str() );
    447                 TyVarMap exprTyVars( TypeDecl::Data{} );
    448                 makeTyVarMap( function, exprTyVars );
    449                 return needsBoxing( param, arg, exprTyVars, env );
    450         }
    451 
    452434        void addToTyVarMap( TypeDecl * tyVar, TyVarMap &tyVarMap ) {
    453435                // xxx - should this actually be insert?
  • src/GenPoly/GenPoly.h

    r3f7e12cb r78315272  
    8080        bool typesPolyCompatible( Type *aty, Type *bty );
    8181
    82         /// true if arg requires boxing given exprTyVars
    83         bool needsBoxing( Type * param, Type * arg, const TyVarMap &exprTyVars, TypeSubstitution * env );
    84 
    85         /// true if arg requires boxing in the call to appExpr
    86         bool needsBoxing( Type * param, Type * arg, ApplicationExpr * appExpr, TypeSubstitution * env );
    87 
    8882        /// Adds the type variable `tyVar` to `tyVarMap`
    8983        void addToTyVarMap( TypeDecl * tyVar, TyVarMap &tyVarMap );
  • src/GenPoly/InstantiateGeneric.cc

    r3f7e12cb r78315272  
    238238                                        assertf( false, "Ttype parameters are not currently allowed as parameters to generic types." );
    239239                                        break;
    240                                 default:
    241                                         assertf( false, "Unhandled type parameter kind" );
     240                                case TypeDecl::Any:
     241                                        assertf( false, "otype parameters handled by baseParam->isComplete()." );
    242242                                        break;
    243243                        }
     
    278278                substituteMembers( base->get_members(), baseParams, typeSubs );
    279279
    280                 // xxx - can't delete type parameters because they may have assertions that are used
    281                 // deleteAll( baseParams );
     280                deleteAll( baseParams );
    282281                baseParams.clear();
    283282
  • src/GenPoly/ScrubTyVars.cc

    r3f7e12cb r78315272  
    4040                if ( tyVar != tyVars->end() ) {
    4141                        switch ( tyVar->second.kind ) {
     42                          case TypeDecl::Any:
    4243                          case TypeDecl::Dtype:
    4344                          case TypeDecl::Ttype:
  • src/GenPoly/Specialize.cc

    r3f7e12cb r78315272  
    2222#include <utility>                       // for pair
    2323
    24 #include "Common/PassVisitor.h"
    2524#include "Common/SemanticError.h"        // for SemanticError
    2625#include "Common/UniqueName.h"           // for UniqueName
     
    2928#include "InitTweak/InitTweak.h"         // for isIntrinsicCallExpr
    3029#include "Parser/LinkageSpec.h"          // for C
     30#include "PolyMutator.h"                 // for PolyMutator
    3131#include "ResolvExpr/FindOpenVars.h"     // for findOpenVars
    3232#include "ResolvExpr/TypeEnvironment.h"  // for OpenVarSet, AssertionSet
     
    4343
    4444namespace GenPoly {
    45         struct Specialize final : public WithTypeSubstitution, public WithStmtsToAdd, public WithVisitorRef<Specialize> {
    46                 Expression * postmutate( ApplicationExpr *applicationExpr );
    47                 Expression * postmutate( CastExpr *castExpr );
     45        class Specialize final : public PolyMutator {
     46          public:
     47                using PolyMutator::mutate;
     48                virtual Expression * mutate( ApplicationExpr *applicationExpr ) override;
     49                virtual Expression * mutate( AddressExpr *castExpr ) override;
     50                virtual Expression * mutate( CastExpr *castExpr ) override;
     51                // virtual Expression * mutate( LogicalExpr *logicalExpr );
     52                // virtual Expression * mutate( ConditionalExpr *conditionalExpr );
     53                // virtual Expression * mutate( CommaExpr *commaExpr );
    4854
    4955                void handleExplicitParams( ApplicationExpr *appExpr );
    5056                Expression * createThunkFunction( FunctionType *funType, Expression *actual, InferredParams *inferParams );
    51                 Expression * doSpecialization( Type *formalType, Expression *actual, InferredParams *inferParams );
     57                Expression * doSpecialization( Type *formalType, Expression *actual, InferredParams *inferParams = nullptr );
    5258
    5359                std::string paramPrefix = "_p";
     
    6672                                if ( ! boundType ) continue;
    6773                                if ( TypeInstType *typeInst = dynamic_cast< TypeInstType* >( boundType ) ) {
    68                                         // bound to another type variable
    6974                                        if ( closedVars.find( typeInst->get_name() ) == closedVars.end() ) {
    70                                                 // bound to a closed variable => must specialize
    7175                                                return true;
    7276                                        } // if
    7377                                } else {
    74                                         // variable is bound to a concrete type => must specialize
    7578                                        return true;
    7679                                } // if
    7780                        } // for
    78                         // none of the type variables are bound
    7981                        return false;
    8082                } else {
    81                         // no env
    8283                        return false;
    8384                } // if
     
    135136                        if ( functionParameterSize( fftype ) != functionParameterSize( aftype ) ) return false;
    136137                        // tuple-parameter sizes are the same, but actual parameter sizes differ - must tuple specialize
    137                         if ( fftype->parameters.size() != aftype->parameters.size() ) return true;
     138                        if ( fftype->get_parameters().size() != aftype->get_parameters().size() ) return true;
    138139                        // total parameter size can be the same, while individual parameters can have different structure
    139                         for ( auto params : group_iterate( fftype->parameters, aftype->parameters ) ) {
     140                        for ( auto params : group_iterate( fftype->get_parameters(), aftype->get_parameters() ) ) {
    140141                                DeclarationWithType * formal = std::get<0>(params);
    141142                                DeclarationWithType * actual = std::get<1>(params);
     
    151152
    152153        Expression * Specialize::doSpecialization( Type *formalType, Expression *actual, InferredParams *inferParams ) {
    153                 assertf( actual->result, "attempting to specialize an untyped expression" );
     154                assertf( actual->has_result(), "attempting to specialize an untyped expression" );
    154155                if ( needsSpecialization( formalType, actual->get_result(), env ) ) {
    155156                        if ( FunctionType *funType = getFunctionType( formalType ) ) {
    156                                 if ( ApplicationExpr * appExpr = dynamic_cast<ApplicationExpr*>( actual ) ) {
     157                                ApplicationExpr *appExpr;
     158                                VariableExpr *varExpr;
     159                                if ( ( appExpr = dynamic_cast<ApplicationExpr*>( actual ) ) ) {
    157160                                        return createThunkFunction( funType, appExpr->get_function(), inferParams );
    158                                 } else if ( VariableExpr * varExpr = dynamic_cast<VariableExpr*>( actual ) ) {
     161                                } else if ( ( varExpr = dynamic_cast<VariableExpr*>( actual ) ) ) {
    159162                                        return createThunkFunction( funType, varExpr, inferParams );
    160163                                } else {
     
    201204        }
    202205
    203         struct EnvTrimmer {
     206        struct EnvTrimmer : public Visitor {
    204207                TypeSubstitution * env, * newEnv;
    205208                EnvTrimmer( TypeSubstitution * env, TypeSubstitution * newEnv ) : env( env ), newEnv( newEnv ){}
    206                 void previsit( TypeDecl * tyDecl ) {
     209                virtual void visit( TypeDecl * tyDecl ) {
    207210                        // transfer known bindings for seen type variables
    208                         if ( Type * t = env->lookup( tyDecl->name ) ) {
    209                                 newEnv->add( tyDecl->name, t );
     211                        if ( Type * t = env->lookup( tyDecl->get_name() ) ) {
     212                                newEnv->add( tyDecl->get_name(), t );
    210213                        }
    211214                }
     
    216219                if ( env ) {
    217220                        TypeSubstitution * newEnv = new TypeSubstitution();
    218                         PassVisitor<EnvTrimmer> trimmer( env, newEnv );
     221                        EnvTrimmer trimmer( env, newEnv );
    219222                        expr->accept( trimmer );
    220223                        return newEnv;
     
    274277                std::string oldParamPrefix = paramPrefix;
    275278                paramPrefix += "p";
    276                 // save stmtsToAddBefore in oldStmts
     279                // save stmtsToAdd in oldStmts
    277280                std::list< Statement* > oldStmts;
    278                 oldStmts.splice( oldStmts.end(), stmtsToAddBefore );
    279                 appExpr->acceptMutator( *visitor );
     281                oldStmts.splice( oldStmts.end(), stmtsToAdd );
     282                mutate( appExpr );
    280283                paramPrefix = oldParamPrefix;
    281284                // write any statements added for recursive specializations into the thunk body
    282                 thunkFunc->statements->kids.splice( thunkFunc->statements->kids.end(), stmtsToAddBefore );
    283                 // restore oldStmts into stmtsToAddBefore
    284                 stmtsToAddBefore.splice( stmtsToAddBefore.end(), oldStmts );
     285                thunkFunc->get_statements()->get_kids().splice( thunkFunc->get_statements()->get_kids().end(), stmtsToAdd );
     286                // restore oldStmts into stmtsToAdd
     287                stmtsToAdd.splice( stmtsToAdd.end(), oldStmts );
    285288
    286289                // add return (or valueless expression) to the thunk
    287290                Statement *appStmt;
    288                 if ( funType->returnVals.empty() ) {
     291                if ( funType->get_returnVals().empty() ) {
    289292                        appStmt = new ExprStmt( noLabels, appExpr );
    290293                } else {
    291294                        appStmt = new ReturnStmt( noLabels, appExpr );
    292295                } // if
    293                 thunkFunc->statements->kids.push_back( appStmt );
     296                thunkFunc->get_statements()->get_kids().push_back( appStmt );
    294297
    295298                // add thunk definition to queue of statements to add
    296                 stmtsToAddBefore.push_back( new DeclStmt( noLabels, thunkFunc ) );
     299                stmtsToAdd.push_back( new DeclStmt( noLabels, thunkFunc ) );
    297300                // return address of thunk function as replacement expression
    298301                return new AddressExpr( new VariableExpr( thunkFunc ) );
     
    301304        void Specialize::handleExplicitParams( ApplicationExpr *appExpr ) {
    302305                // create thunks for the explicit parameters
    303                 assert( appExpr->function->result );
    304                 FunctionType *function = getFunctionType( appExpr->function->result );
     306                assert( appExpr->get_function()->has_result() );
     307                FunctionType *function = getFunctionType( appExpr->get_function()->get_result() );
    305308                assert( function );
    306309                std::list< DeclarationWithType* >::iterator formal;
    307310                std::list< Expression* >::iterator actual;
    308311                for ( formal = function->get_parameters().begin(), actual = appExpr->get_args().begin(); formal != function->get_parameters().end() && actual != appExpr->get_args().end(); ++formal, ++actual ) {
    309                         *actual = doSpecialization( (*formal)->get_type(), *actual, &appExpr->get_inferParams() );
    310                 }
    311         }
    312 
    313         Expression * Specialize::postmutate( ApplicationExpr *appExpr ) {
     312                        *actual = doSpecialization( (*formal )->get_type(), *actual, &appExpr->get_inferParams() );
     313                }
     314        }
     315
     316        Expression * Specialize::mutate( ApplicationExpr *appExpr ) {
     317                appExpr->get_function()->acceptMutator( *this );
     318                mutateAll( appExpr->get_args(), *this );
     319
    314320                if ( ! InitTweak::isIntrinsicCallExpr( appExpr ) ) {
    315321                        // create thunks for the inferred parameters
     
    325331        }
    326332
    327         Expression * Specialize::postmutate( CastExpr *castExpr ) {
    328                 if ( castExpr->result->isVoid() ) {
     333        Expression * Specialize::mutate( AddressExpr *addrExpr ) {
     334                addrExpr->get_arg()->acceptMutator( *this );
     335                assert( addrExpr->has_result() );
     336                addrExpr->set_arg( doSpecialization( addrExpr->get_result(), addrExpr->get_arg() ) );
     337                return addrExpr;
     338        }
     339
     340        Expression * Specialize::mutate( CastExpr *castExpr ) {
     341                castExpr->get_arg()->acceptMutator( *this );
     342                if ( castExpr->get_result()->isVoid() ) {
    329343                        // can't specialize if we don't have a return value
    330344                        return castExpr;
    331345                }
    332                 Expression *specialized = doSpecialization( castExpr->result, castExpr->arg, &castExpr->inferParams );
    333                 if ( specialized != castExpr->arg ) {
     346                Expression *specialized = doSpecialization( castExpr->get_result(), castExpr->get_arg() );
     347                if ( specialized != castExpr->get_arg() ) {
    334348                        // assume here that the specialization incorporates the cast
    335349                        return specialized;
     
    339353        }
    340354
     355        // Removing these for now. Richard put these in for some reason, but it's not clear why.
     356        // In particular, copy constructors produce a comma expression, and with this code the parts
     357        // of that comma expression are not specialized, which causes problems.
     358
     359        // Expression * Specialize::mutate( LogicalExpr *logicalExpr ) {
     360        //      return logicalExpr;
     361        // }
     362
     363        // Expression * Specialize::mutate( ConditionalExpr *condExpr ) {
     364        //      return condExpr;
     365        // }
     366
     367        // Expression * Specialize::mutate( CommaExpr *commaExpr ) {
     368        //      return commaExpr;
     369        // }
     370
    341371        void convertSpecializations( std::list< Declaration* >& translationUnit ) {
    342                 PassVisitor<Specialize> spec;
     372                Specialize spec;
    343373                mutateAll( translationUnit, spec );
    344374        }
  • src/GenPoly/module.mk

    r3f7e12cb r78315272  
    66## file "LICENCE" distributed with Cforall.
    77##
    8 ## module.mk --
     8## module.mk -- 
    99##
    1010## Author           : Richard C. Bilson
     
    1717SRC += GenPoly/Box.cc \
    1818       GenPoly/GenPoly.cc \
     19       GenPoly/PolyMutator.cc \
    1920       GenPoly/ScrubTyVars.cc \
    2021       GenPoly/Lvalue.cc \
    2122       GenPoly/Specialize.cc \
     23       GenPoly/CopyParams.cc \
    2224       GenPoly/FindFunction.cc \
     25       GenPoly/DeclMutator.cc \
    2326       GenPoly/InstantiateGeneric.cc
  • src/InitTweak/FixInit.cc

    r3f7e12cb r78315272  
    3636#include "FixGlobalInit.h"             // for fixGlobalInit
    3737#include "GenInit.h"                   // for genCtorDtor
     38#include "GenPoly/DeclMutator.h"       // for DeclMutator
    3839#include "GenPoly/GenPoly.h"           // for getFunctionType
     40#include "GenPoly/PolyMutator.h"       // for PolyMutator
    3941#include "InitTweak.h"                 // for getFunctionName, getCallArg
    4042#include "Parser/LinkageSpec.h"        // for C, Spec, Cforall, isBuiltin
     
    4446#include "SymTab/Indexer.h"            // for Indexer
    4547#include "SymTab/Mangler.h"            // for Mangler
     48#include "SynTree/AddStmtVisitor.h"    // for AddStmtVisitor
    4649#include "SynTree/Attribute.h"         // for Attribute
    4750#include "SynTree/Constant.h"          // for Constant
     
    5558#include "SynTree/TypeSubstitution.h"  // for TypeSubstitution, operator<<
    5659#include "SynTree/Visitor.h"           // for acceptAll, maybeAccept
     60#include "Tuples/Tuples.h"             // for isTtype
    5761
    5862bool ctordtorp = false; // print all debug
     
    9397                        /// true if type does not need to be copy constructed to ensure correctness
    9498                        bool skipCopyConstruct( Type * type );
    95                         void copyConstructArg( Expression *& arg, ImplicitCopyCtorExpr * impCpCtorExpr, Type * formal );
     99                        void copyConstructArg( Expression *& arg, ImplicitCopyCtorExpr * impCpCtorExpr );
    96100                        void destructRet( ObjectDecl * ret, ImplicitCopyCtorExpr * impCpCtorExpr );
    97101
     
    183187                };
    184188
    185                 class FixCopyCtors final : public WithStmtsToAdd, public WithShortCircuiting, public WithVisitorRef<FixCopyCtors> {
     189                class FixCopyCtors final : public GenPoly::PolyMutator {
    186190                  public:
    187191                        FixCopyCtors( UnqCount & unqCount ) : unqCount( unqCount ){}
     
    190194                        static void fixCopyCtors( std::list< Declaration * > &translationUnit, UnqCount & unqCount );
    191195
    192                         Expression * postmutate( ImplicitCopyCtorExpr * impCpCtorExpr );
    193                         void premutate( StmtExpr * stmtExpr );
    194                         void premutate( UniqueExpr * unqExpr );
     196                        typedef GenPoly::PolyMutator Parent;
     197                        using Parent::mutate;
     198                        virtual Expression * mutate( ImplicitCopyCtorExpr * impCpCtorExpr ) override;
     199                        virtual Expression * mutate( UniqueExpr * unqExpr ) override;
     200                        virtual Expression * mutate( StmtExpr * stmtExpr ) override;
    195201
    196202                        UnqCount & unqCount;
     
    214220                        void emit( CodeLocation, const Params &... params );
    215221
    216                         FunctionDecl * function = nullptr;
     222                        FunctionDecl * function = 0;
    217223                        std::set< DeclarationWithType * > unhandled;
    218224                        std::map< DeclarationWithType *, CodeLocation > usedUninit;
    219                         ObjectDecl * thisParam = nullptr;
     225                        ObjectDecl * thisParam = 0;
    220226                        bool isCtor = false; // true if current function is a constructor
    221                         StructDecl * structDecl = nullptr;
     227                        StructDecl * structDecl = 0;
    222228                };
    223229
     
    237243                };
    238244
    239                 struct FixCtorExprs final : public WithDeclsToAdd, public WithIndexer {
     245                class FixCtorExprs final : public GenPoly::DeclMutator {
     246                  public:
    240247                        /// expands ConstructorExpr nodes into comma expressions, using a temporary for the first argument
    241248                        static void fix( std::list< Declaration * > & translationUnit );
    242249
    243                         Expression * postmutate( ConstructorExpr * ctorExpr );
     250                        using GenPoly::DeclMutator::mutate;
     251                        virtual Expression * mutate( ConstructorExpr * ctorExpr ) override;
    244252                };
    245253        } // namespace
     
    260268
    261269                GenStructMemberCalls::generate( translationUnit );
    262 
    263270                // xxx - ctor expansion currently has to be after FixCopyCtors, because there is currently a
    264271                // hack in the way untyped assignments are generated, where the first argument cannot have
     
    290297                        for ( std::list< Declaration * >::iterator i = translationUnit.begin(); i != translationUnit.end(); ++i ) {
    291298                                try {
    292                                         maybeMutate( *i, fixer );
     299                                        *i = maybeMutate( *i, fixer );
    293300                                        translationUnit.splice( i, fixer.pass.staticDtorDecls );
    294301                                } catch( SemanticError &e ) {
     
    309316
    310317                void FixCopyCtors::fixCopyCtors( std::list< Declaration * > & translationUnit, UnqCount & unqCount ) {
    311                         PassVisitor<FixCopyCtors> fixer( unqCount );
     318                        FixCopyCtors fixer( unqCount );
    312319                        mutateAll( translationUnit, fixer );
    313320                }
     
    319326
    320327                void FixCtorExprs::fix( std::list< Declaration * > & translationUnit ) {
    321                         PassVisitor<FixCtorExprs> fixer;
    322                         mutateAll( translationUnit, fixer );
     328                        FixCtorExprs fixer;
     329                        fixer.mutateDeclarationList( translationUnit );
    323330                }
    324331
    325332                Expression * InsertImplicitCalls::postmutate( ApplicationExpr * appExpr ) {
     333                        assert( appExpr );
     334
    326335                        if ( VariableExpr * function = dynamic_cast< VariableExpr * > ( appExpr->get_function() ) ) {
    327                                 if ( function->var->linkage.is_builtin ) {
     336                                if ( LinkageSpec::isBuiltin( function->get_var()->get_linkage() ) ) {
    328337                                        // optimization: don't need to copy construct in order to call intrinsic functions
    329338                                        return appExpr;
    330339                                } else if ( DeclarationWithType * funcDecl = dynamic_cast< DeclarationWithType * > ( function->get_var() ) ) {
    331340                                        FunctionType * ftype = dynamic_cast< FunctionType * >( GenPoly::getFunctionType( funcDecl->get_type() ) );
    332                                         assertf( ftype, "Function call without function type: %s", toString( funcDecl ).c_str() );
    333                                         if ( CodeGen::isConstructor( funcDecl->get_name() ) && ftype->parameters.size() == 2 ) {
    334                                                 Type * t1 = getPointerBase( ftype->parameters.front()->get_type() );
    335                                                 Type * t2 = ftype->parameters.back()->get_type();
     341                                        assert( ftype );
     342                                        if ( CodeGen::isConstructor( funcDecl->get_name() ) && ftype->get_parameters().size() == 2 ) {
     343                                                Type * t1 = getPointerBase( ftype->get_parameters().front()->get_type() );
     344                                                Type * t2 = ftype->get_parameters().back()->get_type();
    336345                                                assert( t1 );
    337346
     
    359368                }
    360369
    361                 bool ResolveCopyCtors::skipCopyConstruct( Type * type ) { return ! isConstructable( type ); }
     370                bool ResolveCopyCtors::skipCopyConstruct( Type * type ) {
     371                        return dynamic_cast< VarArgsType * >( type ) || dynamic_cast< ReferenceType * >( type ) || GenPoly::getFunctionType( type ) || Tuples::isTtype( type );
     372                }
    362373
    363374                Expression * ResolveCopyCtors::makeCtorDtor( const std::string & fname, ObjectDecl * var, Expression * cpArg ) {
     
    366377                        ImplicitCtorDtorStmt * stmt = genCtorDtor( fname, var, cpArg );
    367378                        ExprStmt * exprStmt = strict_dynamic_cast< ExprStmt * >( stmt->get_callStmt() );
    368                         Expression * resolved = exprStmt->expr;
    369                         exprStmt->expr = nullptr; // take ownership of expr
     379                        Expression * untyped = exprStmt->get_expr();
    370380
    371381                        // resolve copy constructor
    372382                        // should only be one alternative for copy ctor and dtor expressions, since all arguments are fixed
    373383                        // (VariableExpr and already resolved expression)
    374                         CP_CTOR_PRINT( std::cerr << "ResolvingCtorDtor " << resolved << std::endl; )
    375                         ResolvExpr::findVoidExpression( resolved, indexer );
     384                        CP_CTOR_PRINT( std::cerr << "ResolvingCtorDtor " << untyped << std::endl; )
     385                        Expression * resolved = ResolvExpr::findVoidExpression( untyped, indexer );
    376386                        assert( resolved );
    377387                        if ( resolved->get_env() ) {
     
    381391                                resolved->set_env( nullptr );
    382392                        } // if
     393
    383394                        delete stmt;
    384395                        return resolved;
    385396                }
    386397
    387                 void ResolveCopyCtors::copyConstructArg( Expression *& arg, ImplicitCopyCtorExpr * impCpCtorExpr, Type * formal ) {
     398                void ResolveCopyCtors::copyConstructArg( Expression *& arg, ImplicitCopyCtorExpr * impCpCtorExpr ) {
    388399                        static UniqueName tempNamer("_tmp_cp");
    389400                        assert( env );
    390401                        CP_CTOR_PRINT( std::cerr << "Type Substitution: " << *env << std::endl; )
    391                         assert( arg->result );
    392                         Type * result = arg->result;
     402                        assert( arg->has_result() );
     403                        Type * result = arg->get_result();
    393404                        if ( skipCopyConstruct( result ) ) return; // skip certain non-copyable types
    394405
    395                         // type may involve type variables, so apply type substitution to get temporary variable's actual type.
    396                         // Use applyFree so that types bound in function pointers are not substituted, e.g. in forall(dtype T) void (*)(T).
     406                        // type may involve type variables, so apply type substitution to get temporary variable's actual type
    397407                        result = result->clone();
    398                         env->applyFree( result );
    399                         ObjectDecl * tmp = ObjectDecl::newObject( "__tmp", result, nullptr );
     408                        env->apply( result );
     409                        ObjectDecl * tmp = new ObjectDecl( tempNamer.newName(), Type::StorageClasses(), LinkageSpec::C, 0, result, 0 );
    400410                        tmp->get_type()->set_const( false );
    401411
     
    407417                                // if the chosen constructor is intrinsic, the copy is unnecessary, so
    408418                                // don't create the temporary and don't call the copy constructor
    409                                 VariableExpr * function = strict_dynamic_cast< VariableExpr * >( appExpr->function );
    410                                 if ( function->var->linkage == LinkageSpec::Intrinsic ) {
    411                                         // arguments that need to be boxed need a temporary regardless of whether the copy constructor is intrinsic,
    412                                         // so that the object isn't changed inside of the polymorphic function
    413                                         if ( ! GenPoly::needsBoxing( formal, result, impCpCtorExpr->callExpr, env ) ) return;
    414                                 }
    415                         }
    416 
    417                         // set a unique name for the temporary once it's certain the call is necessary
    418                         tmp->name = tempNamer.newName();
     419                                VariableExpr * function = dynamic_cast< VariableExpr * >( appExpr->get_function() );
     420                                assert( function );
     421                                if ( function->get_var()->get_linkage() == LinkageSpec::Intrinsic ) return;
     422                        }
    419423
    420424                        // replace argument to function call with temporary
    421425                        arg = new CommaExpr( cpCtor, new VariableExpr( tmp ) );
    422                         impCpCtorExpr->tempDecls.push_back( tmp );
    423                         impCpCtorExpr->dtors.push_front( makeCtorDtor( "^?{}", tmp ) );
     426                        impCpCtorExpr->get_tempDecls().push_back( tmp );
     427                        impCpCtorExpr->get_dtors().push_front( makeCtorDtor( "^?{}", tmp ) );
    424428                }
    425429
     
    431435                        CP_CTOR_PRINT( std::cerr << "ResolveCopyCtors: " << impCpCtorExpr << std::endl; )
    432436
    433                         ApplicationExpr * appExpr = impCpCtorExpr->callExpr;
     437                        ApplicationExpr * appExpr = impCpCtorExpr->get_callExpr();
    434438
    435439                        // take each argument and attempt to copy construct it.
    436                         FunctionType * ftype = GenPoly::getFunctionType( appExpr->function->result );
    437                         assert( ftype );
    438                         auto & params = ftype->parameters;
    439                         auto iter = params.begin();
    440                         for ( Expression * & arg : appExpr->args ) {
    441                                 Type * formal = nullptr;
    442                                 if ( iter != params.end() ) {
    443                                         DeclarationWithType * param = *iter++;
    444                                         formal = param->get_type();
    445                                 }
    446 
    447                                 copyConstructArg( arg, impCpCtorExpr, formal );
     440                        for ( Expression * & arg : appExpr->get_args() ) {
     441                                copyConstructArg( arg, impCpCtorExpr );
    448442                        } // for
    449443
     
    451445                        // initialized with the return value and is destructed later
    452446                        // xxx - handle named return values?
    453                         Type * result = appExpr->result;
     447                        Type * result = appExpr->get_result();
    454448                        if ( ! result->isVoid() ) {
    455449                                static UniqueName retNamer("_tmp_cp_ret");
    456450                                result = result->clone();
    457451                                env->apply( result );
    458                                 ObjectDecl * ret = ObjectDecl::newObject( retNamer.newName(), result, nullptr );
    459                                 ret->type->set_const( false );
    460                                 impCpCtorExpr->returnDecls.push_back( ret );
     452                                ObjectDecl * ret = new ObjectDecl( retNamer.newName(), Type::StorageClasses(), LinkageSpec::C, 0, result, 0 );
     453                                ret->get_type()->set_const( false );
     454                                impCpCtorExpr->get_returnDecls().push_back( ret );
    461455                                CP_CTOR_PRINT( std::cerr << "makeCtorDtor for a return" << std::endl; )
    462456                                if ( ! dynamic_cast< ReferenceType * >( result ) ) {
    463                                         // destructing reference returns is bad because it can cause multiple destructor calls to the same object - the returned object is not a temporary
     457                                        // destructing lvalue returns is bad because it can cause multiple destructor calls to the same object - the returned object is not a temporary
    464458                                        destructRet( ret, impCpCtorExpr );
    465459                                }
     
    478472                                result = result->clone();
    479473                                env->apply( result );
    480                                 ObjectDecl * ret = ObjectDecl::newObject( retNamer.newName(), result, nullptr );
     474                                ObjectDecl * ret = new ObjectDecl( retNamer.newName(), Type::StorageClasses(), LinkageSpec::C, 0, result, 0 );
    481475                                ret->get_type()->set_const( false );
    482476                                stmtExpr->get_returnDecls().push_front( ret );
     
    499493                                visit_children = false;
    500494                        }
    501                 }
    502 
    503                 // to prevent warnings (‘_unq0’ may be used uninitialized in this function),
    504                 // insert an appropriate zero initializer for UniqueExpr temporaries.
    505                 Initializer * makeInit( Type * t ) {
    506                         if ( StructInstType * inst = dynamic_cast< StructInstType * >( t ) ) {
    507                                 // initizer for empty struct must be empty
    508                                 if ( inst->baseStruct->members.empty() ) return new ListInit({});
    509                         } else if ( UnionInstType * inst = dynamic_cast< UnionInstType * >( t ) ) {
    510                                 // initizer for empty union must be empty
    511                                 if ( inst->baseUnion->members.empty() ) return new ListInit({});
    512                         }
    513 
    514                         return new ListInit( { new SingleInit( new ConstantExpr( Constant::from_int( 0 ) ) ) } );
    515495                }
    516496
     
    529509                        } else {
    530510                                // expr isn't a call expr, so create a new temporary variable to use to hold the value of the unique expression
    531                                 unqExpr->set_object( ObjectDecl::newObject( toString("_unq", unqExpr->get_id()), unqExpr->get_result()->clone(), makeInit( unqExpr->get_result() ) ) );
     511                                unqExpr->set_object( new ObjectDecl( toString("_unq", unqExpr->get_id()), Type::StorageClasses(), LinkageSpec::C, nullptr, unqExpr->get_result()->clone(), nullptr ) );
    532512                                unqExpr->set_var( new VariableExpr( unqExpr->get_object() ) );
    533513                        }
     
    535515                }
    536516
    537                 Expression * FixCopyCtors::postmutate( ImplicitCopyCtorExpr * impCpCtorExpr ) {
     517                Expression * FixCopyCtors::mutate( ImplicitCopyCtorExpr * impCpCtorExpr ) {
    538518                        CP_CTOR_PRINT( std::cerr << "FixCopyCtors: " << impCpCtorExpr << std::endl; )
    539519
     520                        impCpCtorExpr = strict_dynamic_cast< ImplicitCopyCtorExpr * >( Parent::mutate( impCpCtorExpr ) );
    540521                        std::list< ObjectDecl * > & tempDecls = impCpCtorExpr->get_tempDecls();
    541522                        std::list< ObjectDecl * > & returnDecls = impCpCtorExpr->get_returnDecls();
     
    544525                        // add all temporary declarations and their constructors
    545526                        for ( ObjectDecl * obj : tempDecls ) {
    546                                 stmtsToAddBefore.push_back( new DeclStmt( noLabels, obj ) );
     527                                stmtsToAdd.push_back( new DeclStmt( noLabels, obj ) );
    547528                        } // for
    548529                        for ( ObjectDecl * obj : returnDecls ) {
    549                                 stmtsToAddBefore.push_back( new DeclStmt( noLabels, obj ) );
     530                                stmtsToAdd.push_back( new DeclStmt( noLabels, obj ) );
    550531                        } // for
    551532
     
    555536                        } // for
    556537
     538                        // xxx - update to work with multiple return values
    557539                        ObjectDecl * returnDecl = returnDecls.empty() ? nullptr : returnDecls.front();
    558540                        Expression * callExpr = impCpCtorExpr->get_callExpr();
     
    579561                                Expression * retExpr = new CommaExpr( assign, new VariableExpr( returnDecl ) );
    580562                                // move env from callExpr to retExpr
    581                                 std::swap( retExpr->env, callExpr->env );
     563                                retExpr->set_env( callExpr->get_env() );
     564                                callExpr->set_env( nullptr );
    582565                                return retExpr;
    583566                        } else {
     
    586569                }
    587570
    588                 void FixCopyCtors::premutate( StmtExpr * stmtExpr ) {
     571                Expression * FixCopyCtors::mutate( StmtExpr * stmtExpr ) {
    589572                        // function call temporaries should be placed at statement-level, rather than nested inside of a new statement expression,
    590573                        // since temporaries can be shared across sub-expressions, e.g.
    591574                        //   [A, A] f();
    592575                        //   g([A] x, [A] y);
    593                         //   g(f());
     576                        //   f(g());
    594577                        // f is executed once, so the return temporary is shared across the tuple constructors for x and y.
    595                         // Explicitly mutating children instead of mutating the inner compound statment forces the temporaries to be added
    596                         // to the outer context, rather than inside of the statement expression.
    597                         visit_children = false;
    598578                        std::list< Statement * > & stmts = stmtExpr->get_statements()->get_kids();
    599579                        for ( Statement *& stmt : stmts ) {
    600                                 stmt = stmt->acceptMutator( *visitor );
     580                                stmt = stmt->acceptMutator( *this );
    601581                        } // for
     582                        // stmtExpr = strict_dynamic_cast< StmtExpr * >( Parent::mutate( stmtExpr ) );
    602583                        assert( stmtExpr->get_result() );
    603584                        Type * result = stmtExpr->get_result();
    604585                        if ( ! result->isVoid() ) {
    605586                                for ( ObjectDecl * obj : stmtExpr->get_returnDecls() ) {
    606                                         stmtsToAddBefore.push_back( new DeclStmt( noLabels, obj ) );
     587                                        stmtsToAdd.push_back( new DeclStmt( noLabels, obj ) );
    607588                                } // for
    608589                                // add destructors after current statement
     
    611592                                } // for
    612593                                // must have a non-empty body, otherwise it wouldn't have a result
    613                                 assert( ! stmts.empty() );
     594                                CompoundStmt * body = stmtExpr->get_statements();
     595                                assert( ! body->get_kids().empty() );
    614596                                assert( ! stmtExpr->get_returnDecls().empty() );
    615                                 stmts.push_back( new ExprStmt( noLabels, new VariableExpr( stmtExpr->get_returnDecls().front() ) ) );
     597                                body->get_kids().push_back( new ExprStmt( noLabels, new VariableExpr( stmtExpr->get_returnDecls().front() ) ) );
    616598                                stmtExpr->get_returnDecls().clear();
    617599                                stmtExpr->get_dtors().clear();
     
    619601                        assert( stmtExpr->get_returnDecls().empty() );
    620602                        assert( stmtExpr->get_dtors().empty() );
    621                 }
    622 
    623                 void FixCopyCtors::premutate( UniqueExpr * unqExpr ) {
    624                         visit_children = false;
     603                        return stmtExpr;
     604                }
     605
     606                Expression * FixCopyCtors::mutate( UniqueExpr * unqExpr ) {
    625607                        unqCount[ unqExpr->get_id() ]--;
    626608                        static std::unordered_map< int, std::list< Statement * > > dtors;
    627609                        static std::unordered_map< int, UniqueExpr * > unqMap;
     610                        static std::unordered_set< int > addDeref;
    628611                        // has to be done to clean up ImplicitCopyCtorExpr nodes, even when this node was skipped in previous passes
    629612                        if ( unqMap.count( unqExpr->get_id() ) ) {
     
    636619                                        stmtsToAddAfter.splice( stmtsToAddAfter.end(), dtors[ unqExpr->get_id() ] );
    637620                                }
    638                                 return;
    639                         }
    640                         PassVisitor<FixCopyCtors> fixer( unqCount );
     621                                if ( addDeref.count( unqExpr->get_id() ) ) {
     622                                        // other UniqueExpr was dereferenced because it was an lvalue return, so this one should be too
     623                                        return UntypedExpr::createDeref( unqExpr );
     624                                }
     625                                return unqExpr;
     626                        }
     627                        FixCopyCtors fixer( unqCount );
    641628                        unqExpr->set_expr( unqExpr->get_expr()->acceptMutator( fixer ) ); // stmtexprs contained should not be separately fixed, so this must occur after the lookup
    642                         stmtsToAddBefore.splice( stmtsToAddBefore.end(), fixer.pass.stmtsToAddBefore );
     629                        stmtsToAdd.splice( stmtsToAdd.end(), fixer.stmtsToAdd );
    643630                        unqMap[unqExpr->get_id()] = unqExpr;
    644631                        if ( unqCount[ unqExpr->get_id() ] == 0 ) {  // insert destructor after the last use of the unique expression
    645632                                stmtsToAddAfter.splice( stmtsToAddAfter.end(), dtors[ unqExpr->get_id() ] );
    646633                        } else { // remember dtors for last instance of unique expr
    647                                 dtors[ unqExpr->get_id() ] = fixer.pass.stmtsToAddAfter;
    648                         }
    649                         return;
    650                 }
    651 
    652                 DeclarationWithType * FixInit::postmutate( ObjectDecl *objDecl ) {
     634                                dtors[ unqExpr->get_id() ] = fixer.stmtsToAddAfter;
     635                        }
     636                        if ( UntypedExpr * deref = dynamic_cast< UntypedExpr * >( unqExpr->get_expr() ) ) {
     637                                // unique expression is now a dereference, because the inner expression is an lvalue returning function call.
     638                                // Normalize the expression by dereferencing the unique expression, rather than the inner expression
     639                                // (i.e. move the dereference out a level)
     640                                assert( getFunctionName( deref ) == "*?" );
     641                                unqExpr->set_expr( getCallArg( deref, 0 ) );
     642                                getCallArg( deref, 0 ) = unqExpr;
     643                                addDeref.insert( unqExpr->get_id() );
     644                                return deref;
     645                        }
     646                        return unqExpr;
     647                }
     648
     649                DeclarationWithType *FixInit::postmutate( ObjectDecl *objDecl ) {
    653650                        // since this removes the init field from objDecl, it must occur after children are mutated (i.e. postmutate)
    654651                        if ( ConstructorInit * ctorInit = dynamic_cast< ConstructorInit * >( objDecl->get_init() ) ) {
     
    748745                                        } else {
    749746                                                ImplicitCtorDtorStmt * implicit = strict_dynamic_cast< ImplicitCtorDtorStmt * > ( ctor );
    750                                                 ExprStmt * ctorStmt = dynamic_cast< ExprStmt * >( implicit->callStmt );
     747                                                ExprStmt * ctorStmt = dynamic_cast< ExprStmt * >( implicit->get_callStmt() );
    751748                                                ApplicationExpr * ctorCall = nullptr;
    752                                                 if ( ctorStmt && (ctorCall = isIntrinsicCallExpr( ctorStmt->expr )) && ctorCall->get_args().size() == 2 ) {
     749                                                if ( ctorStmt && (ctorCall = isIntrinsicCallExpr( ctorStmt->get_expr() )) && ctorCall->get_args().size() == 2 ) {
    753750                                                        // clean up intrinsic copy constructor calls by making them into SingleInits
    754                                                         Expression * ctorArg = ctorCall->args.back();
    755                                                         std::swap( ctorArg->env, ctorCall->env );
    756                                                         objDecl->init = new SingleInit( ctorArg );
    757 
    758                                                         ctorCall->args.pop_back();
     751                                                        objDecl->set_init( new SingleInit( ctorCall->get_args().back() ) );
     752                                                        ctorCall->get_args().pop_back();
    759753                                                } else {
    760754                                                        stmtsToAddAfter.push_back( ctor );
    761                                                         objDecl->init = nullptr;
    762                                                         ctorInit->ctor = nullptr;
     755                                                        objDecl->set_init( nullptr );
     756                                                        ctorInit->set_ctor( nullptr );
    763757                                                }
    764758                                        } // if
    765                                 } else if ( Initializer * init = ctorInit->init ) {
    766                                         objDecl->init = init;
    767                                         ctorInit->init = nullptr;
     759                                } else if ( Initializer * init = ctorInit->get_init() ) {
     760                                        objDecl->set_init( init );
     761                                        ctorInit->set_init( nullptr );
    768762                                } else {
    769763                                        // no constructor and no initializer, which is okay
    770                                         objDecl->init = nullptr;
     764                                        objDecl->set_init( nullptr );
    771765                                } // if
    772766                                delete ctorInit;
     
    825819                                        assert( ! ctorInit->get_ctor() || ! ctorInit->get_init() );
    826820                                        Statement * dtor = ctorInit->get_dtor();
    827                                         // don't need to call intrinsic dtor, because it does nothing, but
    828                                         // non-intrinsic dtors must be called
    829821                                        if ( dtor && ! isIntrinsicSingleArgCallStmt( dtor ) ) {
    830                                                 // set dtor location to the object's location for error messages
    831                                                 ctorInit->dtor->location = objDecl->location;
     822                                                // don't need to call intrinsic dtor, because it does nothing, but
     823                                                // non-intrinsic dtors must be called
    832824                                                reverseDeclOrder.front().push_front( objDecl );
    833825                                        } // if
     
    840832                        GuardValue( labelVars );
    841833                        labelVars.clear();
    842                         // LabelFinder does not recurse into FunctionDecl, so need to visit
    843                         // its children manually.
    844834                        maybeAccept( funcDecl->type, finder );
    845835                        maybeAccept( funcDecl->statements, finder );
     
    943933                }
    944934
    945                 void addIds( SymTab::Indexer & indexer, const std::list< DeclarationWithType * > & decls ) {
    946                         for ( auto d : decls ) {
    947                                 indexer.addId( d );
    948                         }
    949                 }
    950 
    951                 void addTypes( SymTab::Indexer & indexer, const std::list< TypeDecl * > & tds ) {
    952                         for ( auto td : tds ) {
    953                                 indexer.addType( td );
    954                                 addIds( indexer, td->assertions );
    955                         }
    956                 }
    957 
    958935                void GenStructMemberCalls::previsit( FunctionDecl * funcDecl ) {
    959                         GuardValue( function );
     936                        GuardValue( funcDecl );
    960937                        GuardValue( unhandled );
    961938                        GuardValue( usedUninit );
     
    990967                }
    991968
     969                void addIds( SymTab::Indexer & indexer, const std::list< DeclarationWithType * > & decls ) {
     970                        for ( auto d : decls ) {
     971                                indexer.addId( d );
     972                        }
     973                }
     974
     975                void addTypes( SymTab::Indexer & indexer, const std::list< TypeDecl * > & tds ) {
     976                        for ( auto td : tds ) {
     977                                indexer.addType( td );
     978                                addIds( indexer, td->assertions );
     979                        }
     980                }
     981
    992982                void GenStructMemberCalls::postvisit( FunctionDecl * funcDecl ) {
    993983                        // remove the unhandled objects from usedUninit, because a call is inserted
     
    10221012                                        // skip non-DWT members
    10231013                                        if ( ! field ) continue;
    1024                                         // skip non-constructable members
    1025                                         if ( ! tryConstruct( field ) ) continue;
    10261014                                        // skip handled members
    10271015                                        if ( ! unhandled.count( field ) ) continue;
     
    11421130                }
    11431131
    1144                 DeclarationWithType * MutatingResolver::mutate( ObjectDecl * objectDecl ) {
     1132                DeclarationWithType * MutatingResolver::mutate( ObjectDecl *objectDecl ) {
    11451133                        // add object to the indexer assumes that there will be no name collisions
    11461134                        // in generated code. If this changes, add mutate methods for entities with
     
    11501138                }
    11511139
    1152                 Expression * MutatingResolver::mutate( UntypedExpr * untypedExpr ) {
    1153                         Expression * newExpr = untypedExpr;
    1154                         ResolvExpr::findVoidExpression( newExpr, indexer );
    1155                         return newExpr;
    1156                 }
    1157 
    1158                 Expression * FixCtorExprs::postmutate( ConstructorExpr * ctorExpr ) {
     1140                Expression* MutatingResolver::mutate( UntypedExpr *untypedExpr ) {
     1141                        return strict_dynamic_cast< ApplicationExpr * >( ResolvExpr::findVoidExpression( untypedExpr, indexer ) );
     1142                }
     1143
     1144                Expression * FixCtorExprs::mutate( ConstructorExpr * ctorExpr ) {
    11591145                        static UniqueName tempNamer( "_tmp_ctor_expr" );
    11601146                        // xxx - is the size check necessary?
    1161                         assert( ctorExpr->result && ctorExpr->get_result()->size() == 1 );
     1147                        assert( ctorExpr->has_result() && ctorExpr->get_result()->size() == 1 );
    11621148
    11631149                        // xxx - ideally we would reuse the temporary generated from the copy constructor passes from within firstArg if it exists and not generate a temporary if it's unnecessary.
    1164                         ObjectDecl * tmp = ObjectDecl::newObject( tempNamer.newName(), ctorExpr->get_result()->clone(), nullptr );
    1165                         declsToAddBefore.push_back( tmp );
     1150                        ObjectDecl * tmp = new ObjectDecl( tempNamer.newName(), Type::StorageClasses(), LinkageSpec::C, nullptr, ctorExpr->get_result()->clone(), nullptr );
     1151                        addDeclaration( tmp );
    11661152
    11671153                        // xxx - this can be TupleAssignExpr now. Need to properly handle this case.
     
    11721158                        delete ctorExpr;
    11731159
    1174                         // build assignment and replace constructor's first argument with new temporary
    11751160                        Expression *& firstArg = callExpr->get_args().front();
    1176                         Expression * assign = new UntypedExpr( new NameExpr( "?=?" ), { new AddressExpr( new VariableExpr( tmp ) ), new AddressExpr( firstArg ) } );
     1161
     1162                        // xxx - hack in 'fake' assignment operator until resolver can easily be called in this pass. Once the resolver can be used in PassVisitor, this hack goes away.
     1163
     1164                        // generate the type of assignment operator using the type of tmp minus any reference types
     1165                        Type * type = tmp->get_type()->stripReferences();
     1166                        FunctionType * ftype = SymTab::genAssignType( type );
     1167
     1168                        // generate fake assignment decl and call it using &tmp and &firstArg
     1169                        // since tmp is guaranteed to be a reference and we want to assign pointers
     1170                        FunctionDecl * assignDecl = new FunctionDecl( "?=?", Type::StorageClasses(), LinkageSpec::Intrinsic, ftype, nullptr );
     1171                        ApplicationExpr * assign = new ApplicationExpr( VariableExpr::functionPointer( assignDecl ) );
     1172                        assign->get_args().push_back( new AddressExpr( new VariableExpr( tmp ) ) );
     1173                        Expression * addrArg = new AddressExpr( firstArg );
     1174                        // if firstArg has type T&&, then &firstArg has type T*&.
     1175                        // Cast away the reference to a value type so that the argument
     1176                        // matches the assignment's parameter types
     1177                        if ( dynamic_cast<ReferenceType *>( addrArg->get_result() ) ) {
     1178                                addrArg = new CastExpr( addrArg, addrArg->get_result()->stripReferences()->clone() );
     1179                        }
     1180                        assign->get_args().push_back( addrArg );
    11771181                        firstArg = new VariableExpr( tmp );
    1178 
    1179                         // resolve assignment and dispose of new env
    1180                         ResolvExpr::findVoidExpression( assign, indexer );
    1181                         delete assign->env;
    1182                         assign->env = nullptr;
    11831182
    11841183                        // for constructor expr:
  • src/InitTweak/GenInit.cc

    r3f7e12cb r78315272  
    2626#include "Common/UniqueName.h"     // for UniqueName
    2727#include "Common/utility.h"        // for ValueGuard, maybeClone
     28#include "GenPoly/DeclMutator.h"   // for DeclMutator
    2829#include "GenPoly/GenPoly.h"       // for getFunctionType, isPolyType
    2930#include "GenPoly/ScopedSet.h"     // for ScopedSet, ScopedSet<>::const_iter...
     
    6162        };
    6263
    63         struct CtorDtor : public WithGuards, public WithShortCircuiting, public WithVisitorRef<CtorDtor>  {
     64        struct CtorDtor : public WithGuards, public WithShortCircuiting  {
    6465                /// create constructor and destructor statements for object declarations.
    6566                /// the actual call statements will be added in after the resolver has run
     
    7475                // that need to be constructed or destructed
    7576                void previsit( StructDecl *aggregateDecl );
    76                 void previsit( AggregateDecl * ) { visit_children = false; }
    77                 void previsit( NamedTypeDecl * ) { visit_children = false; }
    78                 void previsit( FunctionType * ) { visit_children = false; }
     77                void previsit( __attribute__((unused)) UnionDecl    * aggregateDecl ) { visit_children = false; }
     78                void previsit( __attribute__((unused)) EnumDecl     * aggregateDecl ) { visit_children = false; }
     79                void previsit( __attribute__((unused)) TraitDecl    * aggregateDecl ) { visit_children = false; }
     80                void previsit( __attribute__((unused)) TypeDecl     * typeDecl )      { visit_children = false; }
     81                void previsit( __attribute__((unused)) TypedefDecl  * typeDecl )      { visit_children = false; }
     82                void previsit( __attribute__((unused)) FunctionType * funcType )      { visit_children = false; }
    7983
    8084                void previsit( CompoundStmt * compoundStmt );
     
    8589                // should not have a ConstructorInit generated.
    8690
    87                 ManagedTypes managedTypes;
     91                bool isManaged( ObjectDecl * objDecl ) const ; // determine if object is managed
     92                bool isManaged( Type * type ) const; // determine if type is managed
     93                void handleDWT( DeclarationWithType * dwt ); // add type to managed if ctor/dtor
     94                GenPoly::ScopedSet< std::string > managedTypes;
    8895                bool inFunction = false;
    8996        };
    9097
    91         struct HoistArrayDimension final : public WithDeclsToAdd, public WithShortCircuiting, public WithGuards {
     98        class HoistArrayDimension final : public GenPoly::DeclMutator {
     99          public:
     100                typedef GenPoly::DeclMutator Parent;
     101
    92102                /// hoist dimension from array types in object declaration so that it uses a single
    93103                /// const variable of type size_t, so that side effecting array dimensions are only
     
    95105                static void hoistArrayDimension( std::list< Declaration * > & translationUnit );
    96106
    97                 void premutate( ObjectDecl * objectDecl );
    98                 DeclarationWithType * postmutate( ObjectDecl * objectDecl );
    99                 void premutate( FunctionDecl *functionDecl );
     107          private:
     108                using Parent::mutate;
     109
     110                virtual DeclarationWithType * mutate( ObjectDecl * objectDecl ) override;
     111                virtual DeclarationWithType * mutate( FunctionDecl *functionDecl ) override;
    100112                // should not traverse into any of these declarations to find objects
    101113                // that need to be constructed or destructed
    102                 void premutate( AggregateDecl * ) { visit_children = false; }
    103                 void premutate( NamedTypeDecl * ) { visit_children = false; }
    104                 void premutate( FunctionType * ) { visit_children = false; }
     114                virtual Declaration* mutate( StructDecl *aggregateDecl ) override { return aggregateDecl; }
     115                virtual Declaration* mutate( UnionDecl *aggregateDecl ) override { return aggregateDecl; }
     116                virtual Declaration* mutate( EnumDecl *aggregateDecl ) override { return aggregateDecl; }
     117                virtual Declaration* mutate( TraitDecl *aggregateDecl ) override { return aggregateDecl; }
     118                virtual TypeDecl* mutate( TypeDecl *typeDecl ) override { return typeDecl; }
     119                virtual Declaration* mutate( TypedefDecl *typeDecl ) override { return typeDecl; }
     120
     121                virtual Type* mutate( FunctionType *funcType ) override { return funcType; }
    105122
    106123                void hoist( Type * type );
     
    111128
    112129        void genInit( std::list< Declaration * > & translationUnit ) {
    113                 fixReturnStatements( translationUnit );
     130                ReturnFixer::makeReturnTemp( translationUnit );
    114131                HoistArrayDimension::hoistArrayDimension( translationUnit );
    115132                CtorDtor::generateCtorDtor( translationUnit );
    116133        }
    117134
    118         void fixReturnStatements( std::list< Declaration * > & translationUnit ) {
     135        void ReturnFixer::makeReturnTemp( std::list< Declaration * > & translationUnit ) {
    119136                PassVisitor<ReturnFixer> fixer;
    120137                mutateAll( translationUnit, fixer );
     
    126143                // hands off if the function returns a reference - we don't want to allocate a temporary if a variable's address
    127144                // is being returned
    128                 if ( returnStmt->expr && returnVals.size() == 1 && isConstructable( returnVals.front()->get_type() ) ) {
     145                if ( returnStmt->get_expr() && returnVals.size() == 1 && ! dynamic_cast< ReferenceType * >( returnVals.front()->get_type() ) ) {
    129146                        // explicitly construct the return value using the return expression and the retVal object
    130                         assertf( returnVals.front()->name != "", "Function %s has unnamed return value\n", funcName.c_str() );
    131 
    132                         ObjectDecl * retVal = strict_dynamic_cast< ObjectDecl * >( returnVals.front() );
    133                         if ( VariableExpr * varExpr = dynamic_cast< VariableExpr * >( returnStmt->expr ) ) {
    134                                 // return statement has already been mutated - don't need to do it again
    135                                 if ( varExpr->var == retVal ) return;
    136                         }
    137                         stmtsToAddBefore.push_back( genCtorDtor( "?{}", retVal, returnStmt->get_expr() ) );
     147                        assertf( returnVals.front()->get_name() != "", "Function %s has unnamed return value\n", funcName.c_str() );
     148
     149                        stmtsToAddBefore.push_back( genCtorDtor( "?{}", dynamic_cast< ObjectDecl *>( returnVals.front() ), returnStmt->get_expr() ) );
    138150
    139151                        // return the retVal object
    140                         returnStmt->expr = new VariableExpr( returnVals.front() );
     152                        returnStmt->set_expr( new VariableExpr( returnVals.front() ) );
    141153                } // if
    142154        }
     
    146158                GuardValue( funcName );
    147159
    148                 ftype = functionDecl->type;
    149                 funcName = functionDecl->name;
     160                ftype = functionDecl->get_functionType();
     161                funcName = functionDecl->get_name();
    150162        }
    151163
     
    153165        // which would be incorrect if it is a side-effecting computation.
    154166        void HoistArrayDimension::hoistArrayDimension( std::list< Declaration * > & translationUnit ) {
    155                 PassVisitor<HoistArrayDimension> hoister;
    156                 mutateAll( translationUnit, hoister );
    157         }
    158 
    159         void HoistArrayDimension::premutate( ObjectDecl * objectDecl ) {
    160                 GuardValue( storageClasses );
     167                HoistArrayDimension hoister;
     168                hoister.mutateDeclarationList( translationUnit );
     169        }
     170
     171        DeclarationWithType * HoistArrayDimension::mutate( ObjectDecl * objectDecl ) {
    161172                storageClasses = objectDecl->get_storageClasses();
    162         }
    163 
    164         DeclarationWithType * HoistArrayDimension::postmutate( ObjectDecl * objectDecl ) {
     173                DeclarationWithType * temp = Parent::mutate( objectDecl );
    165174                hoist( objectDecl->get_type() );
    166                 return objectDecl;
     175                return temp;
    167176        }
    168177
     
    185194
    186195                        arrayType->set_dimension( new VariableExpr( arrayDimension ) );
    187                         declsToAddBefore.push_back( arrayDimension );
     196                        addDeclaration( arrayDimension );
    188197
    189198                        hoist( arrayType->get_base() );
     
    192201        }
    193202
    194         void HoistArrayDimension::premutate( FunctionDecl * ) {
    195                 GuardValue( inFunction );
     203        DeclarationWithType * HoistArrayDimension::mutate( FunctionDecl *functionDecl ) {
     204                ValueGuard< bool > oldInFunc( inFunction );
     205                inFunction = true;
     206                DeclarationWithType * decl = Parent::mutate( functionDecl );
     207                return decl;
    196208        }
    197209
     
    201213        }
    202214
    203         bool ManagedTypes::isManaged( Type * type ) const {
    204                 // references are never constructed
     215        bool CtorDtor::isManaged( Type * type ) const {
     216                // at least for now, references are never constructed
    205217                if ( dynamic_cast< ReferenceType * >( type ) ) return false;
    206218                // need to clear and reset qualifiers when determining if a type is managed
     
    209221                if ( TupleType * tupleType = dynamic_cast< TupleType * > ( type ) ) {
    210222                        // tuple is also managed if any of its components are managed
    211                         if ( std::any_of( tupleType->types.begin(), tupleType->types.end(), [&](Type * type) { return isManaged( type ); }) ) {
     223                        if ( std::any_of( tupleType->get_types().begin(), tupleType->get_types().end(), [&](Type * type) { return isManaged( type ); }) ) {
    212224                                return true;
    213225                        }
    214226                }
    215227                // a type is managed if it appears in the map of known managed types, or if it contains any polymorphism (is a type variable or generic type containing a type variable)
    216                 return managedTypes.find( SymTab::Mangler::mangleConcrete( type ) ) != managedTypes.end() || GenPoly::isPolyType( type );
    217         }
    218 
    219         bool ManagedTypes::isManaged( ObjectDecl * objDecl ) const {
     228                return managedTypes.find( SymTab::Mangler::mangle( type ) ) != managedTypes.end() || GenPoly::isPolyType( type );
     229        }
     230
     231        bool CtorDtor::isManaged( ObjectDecl * objDecl ) const {
    220232                Type * type = objDecl->get_type();
    221233                while ( ArrayType * at = dynamic_cast< ArrayType * >( type ) ) {
     
    225237        }
    226238
    227         void ManagedTypes::handleDWT( DeclarationWithType * dwt ) {
     239        void CtorDtor::handleDWT( DeclarationWithType * dwt ) {
    228240                // if this function is a user-defined constructor or destructor, mark down the type as "managed"
    229241                if ( ! LinkageSpec::isOverridable( dwt->get_linkage() ) && CodeGen::isCtorDtor( dwt->get_name() ) ) {
     
    232244                        Type * type = InitTweak::getPointerBase( params.front()->get_type() );
    233245                        assert( type );
    234                         managedTypes.insert( SymTab::Mangler::mangleConcrete( type ) );
    235                 }
    236         }
    237 
    238         void ManagedTypes::handleStruct( StructDecl * aggregateDecl ) {
    239                 // don't construct members, but need to take note if there is a managed member,
    240                 // because that means that this type is also managed
    241                 for ( Declaration * member : aggregateDecl->get_members() ) {
    242                         if ( ObjectDecl * field = dynamic_cast< ObjectDecl * >( member ) ) {
    243                                 if ( isManaged( field ) ) {
    244                                         // generic parameters should not play a role in determining whether a generic type is constructed - construct all generic types, so that
    245                                         // polymorphic constructors make generic types managed types
    246                                         StructInstType inst( Type::Qualifiers(), aggregateDecl );
    247                                         managedTypes.insert( SymTab::Mangler::mangleConcrete( &inst ) );
    248                                         break;
    249                                 }
    250                         }
    251                 }
    252         }
    253 
    254         void ManagedTypes::beginScope() { managedTypes.beginScope(); }
    255         void ManagedTypes::endScope() { managedTypes.endScope(); }
     246                        managedTypes.insert( SymTab::Mangler::mangle( type ) );
     247                }
     248        }
    256249
    257250        ImplicitCtorDtorStmt * genCtorDtor( const std::string & fname, ObjectDecl * objDecl, Expression * arg ) {
     
    298291
    299292        void CtorDtor::previsit( ObjectDecl * objDecl ) {
    300                 managedTypes.handleDWT( objDecl );
     293                handleDWT( objDecl );
    301294                // hands off if @=, extern, builtin, etc.
    302295                // even if unmanaged, try to construct global or static if initializer is not constexpr, since this is not legal C
    303                 if ( tryConstruct( objDecl ) && ( managedTypes.isManaged( objDecl ) || ((! inFunction || objDecl->get_storageClasses().is_static ) && ! isConstExpr( objDecl->get_init() ) ) ) ) {
     296                if ( tryConstruct( objDecl ) && ( isManaged( objDecl ) || ((! inFunction || objDecl->get_storageClasses().is_static ) && ! isConstExpr( objDecl->get_init() ) ) ) ) {
    304297                        // constructed objects cannot be designated
    305298                        if ( isDesignated( objDecl->get_init() ) ) throw SemanticError( "Cannot include designations in the initializer for a managed Object. If this is really what you want, then initialize with @=.\n", objDecl );
     
    312305
    313306        void CtorDtor::previsit( FunctionDecl *functionDecl ) {
    314                 visit_children = false;  // do not try and construct parameters or forall parameters
    315307                GuardValue( inFunction );
    316308                inFunction = true;
    317309
    318                 managedTypes.handleDWT( functionDecl );
     310                handleDWT( functionDecl );
    319311
    320312                GuardScope( managedTypes );
     
    322314                for ( auto & tyDecl : functionDecl->get_functionType()->get_forall() ) {
    323315                        for ( DeclarationWithType *& assertion : tyDecl->get_assertions() ) {
    324                                 managedTypes.handleDWT( assertion );
     316                                handleDWT( assertion );
    325317                        }
    326318                }
    327319
    328                 maybeAccept( functionDecl->get_statements(), *visitor );
     320                PassVisitor<CtorDtor> newCtorDtor;
     321                newCtorDtor.pass = *this;
     322                maybeAccept( functionDecl->get_statements(), newCtorDtor );
     323                visit_children = false;  // do not try and construct parameters or forall parameters - must happen after maybeAccept
    329324        }
    330325
     
    332327                visit_children = false; // do not try to construct and destruct aggregate members
    333328
    334                 managedTypes.handleStruct( aggregateDecl );
    335         }
    336 
    337         void CtorDtor::previsit( CompoundStmt * ) {
     329                // don't construct members, but need to take note if there is a managed member,
     330                // because that means that this type is also managed
     331                for ( Declaration * member : aggregateDecl->get_members() ) {
     332                        if ( ObjectDecl * field = dynamic_cast< ObjectDecl * >( member ) ) {
     333                                if ( isManaged( field ) ) {
     334                                        StructInstType inst( Type::Qualifiers(), aggregateDecl );
     335                                        managedTypes.insert( SymTab::Mangler::mangle( &inst ) );
     336                                        break;
     337                                }
     338                        }
     339                }
     340        }
     341
     342        void CtorDtor::previsit( __attribute__((unused)) CompoundStmt * compoundStmt ) {
    338343                GuardScope( managedTypes );
    339344        }
  • src/InitTweak/GenInit.h

    r3f7e12cb r78315272  
    1616#pragma once
    1717
    18 #include <list>                // for list
    19 #include <string>              // for string
     18#include <list>               // for list
     19#include <string>             // for string
    2020
    21 #include "SynTree/SynTree.h"   // for Visitor Nodes
    22 
    23 #include "GenPoly/ScopedSet.h" // for ScopedSet
     21#include "SynTree/SynTree.h"  // for Visitor Nodes
    2422
    2523namespace InitTweak {
     
    2725        void genInit( std::list< Declaration * > & translationUnit );
    2826
    29         /// Converts return statements into copy constructor calls on the hidden return variable
    30         void fixReturnStatements( std::list< Declaration * > & translationUnit );
    31 
    32         /// generates a single ctor/dtor statement using objDecl as the 'this' parameter and arg as the optional argument
    33         ImplicitCtorDtorStmt * genCtorDtor( const std::string & fname, ObjectDecl * objDecl, Expression * arg = nullptr );
     27  /// generates a single ctor/dtor statement using objDecl as the 'this' parameter and arg as the optional argument
     28  ImplicitCtorDtorStmt * genCtorDtor( const std::string & fname, ObjectDecl * objDecl, Expression * arg = nullptr );
    3429
    3530        /// creates an appropriate ConstructorInit node which contains a constructor, destructor, and C-initializer
    3631        ConstructorInit * genCtorInit( ObjectDecl * objDecl );
    37 
    38         class ManagedTypes {
    39         public:
    40                 bool isManaged( ObjectDecl * objDecl ) const ; // determine if object is managed
    41                 bool isManaged( Type * type ) const; // determine if type is managed
    42 
    43                 void handleDWT( DeclarationWithType * dwt ); // add type to managed if ctor/dtor
    44                 void handleStruct( StructDecl * aggregateDecl ); // add type to managed if child is managed
    45 
    46                 void beginScope();
    47                 void endScope();
    48         private:
    49                 GenPoly::ScopedSet< std::string > managedTypes;
    50         };
    5132} // namespace
    5233
  • src/InitTweak/InitTweak.cc

    r3f7e12cb r78315272  
     1#include <stddef.h>                // for NULL
    12#include <algorithm>               // for find, all_of
    23#include <cassert>                 // for assertf, assert, strict_dynamic_cast
     
    2223#include "SynTree/Type.h"          // for FunctionType, ArrayType, PointerType
    2324#include "SynTree/Visitor.h"       // for Visitor, maybeAccept
    24 #include "Tuples/Tuples.h"         // for Tuples::isTtype
    2525
    2626class UntypedValofExpr;
     
    170170        }
    171171
    172         bool InitExpander::addReference() {
    173                 bool added = false;
    174                 for ( Expression *& expr : cur ) {
    175                         expr = new AddressExpr( expr );
    176                         added = true;
    177                 }
    178                 return added;
    179         }
    180 
    181172        namespace {
    182173                /// given index i, dimension d, initializer init, and callExpr f, generates
     
    193184                        callExpr->get_args().splice( callExpr->get_args().end(), args );
    194185
    195                         *out++ = new IfStmt( noLabels, cond, new ExprStmt( noLabels, callExpr ), nullptr );
     186                        *out++ = new IfStmt( noLabels, cond, new ExprStmt( noLabels, callExpr ), NULL );
    196187
    197188                        UntypedExpr * increment = new UntypedExpr( new NameExpr( "++?" ) );
     
    259250        // To accomplish this, generate switch statement, consuming all of expander's elements
    260251        Statement * InitImpl::buildListInit( UntypedExpr * dst, std::list< Expression * > & indices ) {
    261                 if ( ! init ) return nullptr;
     252                if ( ! init ) return NULL;
    262253                CompoundStmt * block = new CompoundStmt( noLabels );
    263254                build( dst, indices.begin(), indices.end(), init, back_inserter( block->get_kids() ) );
    264255                if ( block->get_kids().empty() ) {
    265256                        delete block;
    266                         return nullptr;
     257                        return NULL;
    267258                } else {
    268                         init = nullptr; // init was consumed in creating the list init
     259                        init = NULL; // init was consumed in creating the list init
    269260                        return block;
    270261                }
    271262        }
    272263
    273         Statement * ExprImpl::buildListInit( UntypedExpr *, std::list< Expression * > & ) {
    274                 return nullptr;
     264        Statement * ExprImpl::buildListInit( __attribute((unused)) UntypedExpr * dst, __attribute((unused)) std::list< Expression * > & indices ) {
     265                return NULL;
    275266        }
    276267
     
    279270        }
    280271
    281         Type * getTypeofThis( FunctionType * ftype ) {
    282                 assertf( ftype, "getTypeofThis: nullptr ftype" );
    283                 ObjectDecl * thisParam = getParamThis( ftype );
    284                 ReferenceType * refType = strict_dynamic_cast< ReferenceType * >( thisParam->type );
    285                 return refType->base;
    286         }
    287 
    288         ObjectDecl * getParamThis( FunctionType * ftype ) {
    289                 assertf( ftype, "getParamThis: nullptr ftype" );
    290                 auto & params = ftype->parameters;
    291                 assertf( ! params.empty(), "getParamThis: ftype with 0 parameters: %s", toString( ftype ).c_str() );
    292                 return strict_dynamic_cast< ObjectDecl * >( params.front() );
    293         }
    294 
    295         bool tryConstruct( DeclarationWithType * dwt ) {
    296                 ObjectDecl * objDecl = dynamic_cast< ObjectDecl * >( dwt );
    297                 if ( ! objDecl ) return false;
     272        bool tryConstruct( ObjectDecl * objDecl ) {
    298273                return ! LinkageSpec::isBuiltin( objDecl->get_linkage() ) &&
    299                         (objDecl->get_init() == nullptr ||
    300                                 ( objDecl->get_init() != nullptr && objDecl->get_init()->get_maybeConstructed() ))
    301                         && ! objDecl->get_storageClasses().is_extern
    302                         && isConstructable( objDecl->type );
    303         }
    304 
    305         bool isConstructable( Type * type ) {
    306                 return ! dynamic_cast< VarArgsType * >( type ) && ! dynamic_cast< ReferenceType * >( type ) && ! dynamic_cast< FunctionType * >( type ) && ! Tuples::isTtype( type );
     274                        (objDecl->get_init() == NULL ||
     275                                ( objDecl->get_init() != NULL && objDecl->get_init()->get_maybeConstructed() ))
     276                        && ! objDecl->get_storageClasses().is_extern;
    307277        }
    308278
     
    344314                collectCtorDtorCalls( stmt, matches );
    345315                assert( matches.size() <= 1 );
    346                 return matches.size() == 1 ? matches.front() : nullptr;
     316                return matches.size() == 1 ? matches.front() : NULL;
    347317        }
    348318
     
    362332                        assert( expr );
    363333                        if ( VariableExpr * varExpr = dynamic_cast< VariableExpr * >( expr ) ) {
    364                                 return varExpr->var;
     334                                return varExpr->get_var();
    365335                        } else if ( MemberExpr * memberExpr = dynamic_cast< MemberExpr * >( expr ) ) {
    366                                 return memberExpr->member;
     336                                return memberExpr->get_member();
    367337                        } else if ( CastExpr * castExpr = dynamic_cast< CastExpr * >( expr ) ) {
    368                                 return getCalledFunction( castExpr->arg );
     338                                return getCalledFunction( castExpr->get_arg() );
    369339                        } else if ( UntypedExpr * untypedExpr = dynamic_cast< UntypedExpr * >( expr ) ) {
    370340                                return handleDerefCalledFunction( untypedExpr );
     
    372342                                return handleDerefCalledFunction( appExpr );
    373343                        } else if ( AddressExpr * addrExpr = dynamic_cast< AddressExpr * >( expr ) ) {
    374                                 return getCalledFunction( addrExpr->arg );
    375                         } else if ( CommaExpr * commaExpr = dynamic_cast< CommaExpr * >( expr ) ) {
    376                                 return getCalledFunction( commaExpr->arg2 );
     344                                return getCalledFunction( addrExpr->get_arg() );
    377345                        }
    378346                        return nullptr;
     
    391359        ApplicationExpr * isIntrinsicCallExpr( Expression * expr ) {
    392360                ApplicationExpr * appExpr = dynamic_cast< ApplicationExpr * >( expr );
    393                 if ( ! appExpr ) return nullptr;
     361                if ( ! appExpr ) return NULL;
    394362                DeclarationWithType * function = getCalledFunction( appExpr->get_function() );
    395363                assertf( function, "getCalledFunction returned nullptr: %s", toString( appExpr->get_function() ).c_str() );
    396364                // check for Intrinsic only - don't want to remove all overridable ctor/dtors because autogenerated ctor/dtor
    397365                // will call all member dtors, and some members may have a user defined dtor.
    398                 return function->get_linkage() == LinkageSpec::Intrinsic ? appExpr : nullptr;
     366                return function->get_linkage() == LinkageSpec::Intrinsic ? appExpr : NULL;
    399367        }
    400368
     
    514482                        return refType->get_base();
    515483                } else {
    516                         return nullptr;
     484                        return NULL;
    517485                }
    518486        }
     
    520488        Type * isPointerType( Type * type ) {
    521489                if ( getPointerBase( type ) ) return type;
    522                 else return nullptr;
     490                else return NULL;
    523491        }
    524492
     
    589557        FunctionDecl * isCopyFunction( Declaration * decl, const std::string & fname ) {
    590558                FunctionDecl * function = dynamic_cast< FunctionDecl * >( decl );
    591                 if ( ! function ) return nullptr;
    592                 if ( function->name != fname ) return nullptr;
    593                 FunctionType * ftype = function->type;
    594                 if ( ftype->parameters.size() != 2 ) return nullptr;
     559                if ( ! function ) return 0;
     560                if ( function->get_name() != fname ) return 0;
     561                FunctionType * ftype = function->get_functionType();
     562                if ( ftype->get_parameters().size() != 2 ) return 0;
    595563
    596564                Type * t1 = getPointerBase( ftype->get_parameters().front()->get_type() );
    597                 Type * t2 = ftype->parameters.back()->get_type();
     565                Type * t2 = ftype->get_parameters().back()->get_type();
    598566                assert( t1 );
    599567
     
    615583        }
    616584        FunctionDecl * isDefaultConstructor( Declaration * decl ) {
    617                 if ( isConstructor( decl->name ) ) {
     585                if ( isConstructor( decl->get_name() ) ) {
    618586                        if ( FunctionDecl * func = dynamic_cast< FunctionDecl * >( decl ) ) {
    619                                 if ( func->type->parameters.size() == 1 ) {
     587                                if ( func->get_functionType()->get_parameters().size() == 1 ) {
    620588                                        return func;
    621589                                }
  • src/InitTweak/InitTweak.h

    r3f7e12cb r78315272  
    3030        FunctionDecl * isCopyFunction( Declaration * decl, const std::string & fname );
    3131
    32         /// returns the base type of the first parameter to a constructor/destructor/assignment function
    33         Type * getTypeofThis( FunctionType * ftype );
    34 
    35         /// returns the first parameter of a constructor/destructor/assignment function
    36         ObjectDecl * getParamThis( FunctionType * ftype );
    37 
    3832        /// transform Initializer into an argument list that can be passed to a call expression
    3933        std::list< Expression * > makeInitList( Initializer * init );
    4034
    41         /// True if the resolver should try to construct dwt
    42         bool tryConstruct( DeclarationWithType * dwt );
    43 
    44         /// True if the type can have a user-defined constructor
    45         bool isConstructable( Type * t );
     35        /// True if the resolver should try to construct objDecl
     36        bool tryConstruct( ObjectDecl * objDecl );
    4637
    4738        /// True if the Initializer contains designations
     
    10596                void addArrayIndex( Expression * index, Expression * dimension );
    10697                void clearArrayIndices();
    107                 bool addReference();
    10898
    10999                class ExpanderImpl;
  • src/MakeLibCfa.cc

    r3f7e12cb r78315272  
    119119                        newDecls.push_back( funcDecl );
    120120
    121                         Statement * stmt = nullptr;
    122121                        switch ( opInfo.type ) {
    123122                          case CodeGen::OT_INDEX:
     
    129128                          case CodeGen::OT_POSTFIXASSIGN:
    130129                          case CodeGen::OT_INFIXASSIGN:
    131                                         // return the recursive call
    132                                         stmt = new ReturnStmt( noLabels, newExpr );
    133                                         break;
    134130                          case CodeGen::OT_CTOR:
    135131                          case CodeGen::OT_DTOR:
    136                                         // execute the recursive call
    137                                         stmt = new ExprStmt( noLabels, newExpr );
     132                                // return the recursive call
     133                                        funcDecl->get_statements()->get_kids().push_back( new ReturnStmt( std::list< Label >(), newExpr ) );
    138134                                        break;
    139135                          case CodeGen::OT_CONSTANT:
     
    142138                                assert( false );
    143139                        } // switch
    144                         funcDecl->get_statements()->push_back( stmt );
    145140                }
    146141        } // namespace
  • src/Makefile.in

    r3f7e12cb r78315272  
    172172        GenPoly/driver_cfa_cpp-Box.$(OBJEXT) \
    173173        GenPoly/driver_cfa_cpp-GenPoly.$(OBJEXT) \
     174        GenPoly/driver_cfa_cpp-PolyMutator.$(OBJEXT) \
    174175        GenPoly/driver_cfa_cpp-ScrubTyVars.$(OBJEXT) \
    175176        GenPoly/driver_cfa_cpp-Lvalue.$(OBJEXT) \
    176177        GenPoly/driver_cfa_cpp-Specialize.$(OBJEXT) \
     178        GenPoly/driver_cfa_cpp-CopyParams.$(OBJEXT) \
    177179        GenPoly/driver_cfa_cpp-FindFunction.$(OBJEXT) \
     180        GenPoly/driver_cfa_cpp-DeclMutator.$(OBJEXT) \
    178181        GenPoly/driver_cfa_cpp-InstantiateGeneric.$(OBJEXT) \
    179182        InitTweak/driver_cfa_cpp-GenInit.$(OBJEXT) \
     
    250253        SynTree/driver_cfa_cpp-Visitor.$(OBJEXT) \
    251254        SynTree/driver_cfa_cpp-Mutator.$(OBJEXT) \
     255        SynTree/driver_cfa_cpp-AddStmtVisitor.$(OBJEXT) \
    252256        SynTree/driver_cfa_cpp-TypeSubstitution.$(OBJEXT) \
    253257        SynTree/driver_cfa_cpp-Attribute.$(OBJEXT) \
     
    493497        ControlStruct/ForExprMutator.cc \
    494498        ControlStruct/ExceptTranslate.cc GenPoly/Box.cc \
    495         GenPoly/GenPoly.cc GenPoly/ScrubTyVars.cc GenPoly/Lvalue.cc \
    496         GenPoly/Specialize.cc GenPoly/FindFunction.cc \
    497         GenPoly/InstantiateGeneric.cc InitTweak/GenInit.cc \
    498         InitTweak/FixInit.cc InitTweak/FixGlobalInit.cc \
    499         InitTweak/InitTweak.cc Parser/parser.yy Parser/lex.ll \
    500         Parser/TypedefTable.cc Parser/ParseNode.cc \
    501         Parser/DeclarationNode.cc Parser/ExpressionNode.cc \
    502         Parser/StatementNode.cc Parser/InitializerNode.cc \
    503         Parser/TypeData.cc Parser/LinkageSpec.cc \
    504         Parser/parserutility.cc ResolvExpr/AlternativeFinder.cc \
    505         ResolvExpr/Alternative.cc ResolvExpr/Unify.cc \
    506         ResolvExpr/PtrsAssignable.cc ResolvExpr/CommonType.cc \
    507         ResolvExpr/ConversionCost.cc ResolvExpr/CastCost.cc \
    508         ResolvExpr/PtrsCastable.cc ResolvExpr/AdjustExprType.cc \
    509         ResolvExpr/AlternativePrinter.cc ResolvExpr/Resolver.cc \
    510         ResolvExpr/ResolveTypeof.cc ResolvExpr/RenameVars.cc \
    511         ResolvExpr/FindOpenVars.cc ResolvExpr/PolyCost.cc \
    512         ResolvExpr/Occurs.cc ResolvExpr/TypeEnvironment.cc \
    513         ResolvExpr/CurrentObject.cc SymTab/Indexer.cc \
    514         SymTab/Mangler.cc SymTab/Validate.cc SymTab/FixFunction.cc \
    515         SymTab/ImplementationType.cc SymTab/TypeEquality.cc \
    516         SymTab/Autogen.cc SynTree/Type.cc SynTree/VoidType.cc \
    517         SynTree/BasicType.cc SynTree/PointerType.cc \
    518         SynTree/ArrayType.cc SynTree/ReferenceType.cc \
    519         SynTree/FunctionType.cc SynTree/ReferenceToType.cc \
    520         SynTree/TupleType.cc SynTree/TypeofType.cc SynTree/AttrType.cc \
     499        GenPoly/GenPoly.cc GenPoly/PolyMutator.cc \
     500        GenPoly/ScrubTyVars.cc GenPoly/Lvalue.cc GenPoly/Specialize.cc \
     501        GenPoly/CopyParams.cc GenPoly/FindFunction.cc \
     502        GenPoly/DeclMutator.cc GenPoly/InstantiateGeneric.cc \
     503        InitTweak/GenInit.cc InitTweak/FixInit.cc \
     504        InitTweak/FixGlobalInit.cc InitTweak/InitTweak.cc \
     505        Parser/parser.yy Parser/lex.ll Parser/TypedefTable.cc \
     506        Parser/ParseNode.cc Parser/DeclarationNode.cc \
     507        Parser/ExpressionNode.cc Parser/StatementNode.cc \
     508        Parser/InitializerNode.cc Parser/TypeData.cc \
     509        Parser/LinkageSpec.cc Parser/parserutility.cc \
     510        ResolvExpr/AlternativeFinder.cc ResolvExpr/Alternative.cc \
     511        ResolvExpr/Unify.cc ResolvExpr/PtrsAssignable.cc \
     512        ResolvExpr/CommonType.cc ResolvExpr/ConversionCost.cc \
     513        ResolvExpr/CastCost.cc ResolvExpr/PtrsCastable.cc \
     514        ResolvExpr/AdjustExprType.cc ResolvExpr/AlternativePrinter.cc \
     515        ResolvExpr/Resolver.cc ResolvExpr/ResolveTypeof.cc \
     516        ResolvExpr/RenameVars.cc ResolvExpr/FindOpenVars.cc \
     517        ResolvExpr/PolyCost.cc ResolvExpr/Occurs.cc \
     518        ResolvExpr/TypeEnvironment.cc ResolvExpr/CurrentObject.cc \
     519        SymTab/Indexer.cc SymTab/Mangler.cc SymTab/Validate.cc \
     520        SymTab/FixFunction.cc SymTab/ImplementationType.cc \
     521        SymTab/TypeEquality.cc SymTab/Autogen.cc SynTree/Type.cc \
     522        SynTree/VoidType.cc SynTree/BasicType.cc \
     523        SynTree/PointerType.cc SynTree/ArrayType.cc \
     524        SynTree/ReferenceType.cc SynTree/FunctionType.cc \
     525        SynTree/ReferenceToType.cc SynTree/TupleType.cc \
     526        SynTree/TypeofType.cc SynTree/AttrType.cc \
    521527        SynTree/VarArgsType.cc SynTree/ZeroOneType.cc \
    522528        SynTree/Constant.cc SynTree/Expression.cc SynTree/TupleExpr.cc \
     
    529535        SynTree/NamedTypeDecl.cc SynTree/TypeDecl.cc \
    530536        SynTree/Initializer.cc SynTree/Visitor.cc SynTree/Mutator.cc \
    531         SynTree/TypeSubstitution.cc SynTree/Attribute.cc \
    532         SynTree/VarExprReplacer.cc Tuples/TupleAssignment.cc \
    533         Tuples/TupleExpansion.cc Tuples/Explode.cc \
    534         Virtual/ExpandCasts.cc
     537        SynTree/AddStmtVisitor.cc SynTree/TypeSubstitution.cc \
     538        SynTree/Attribute.cc SynTree/VarExprReplacer.cc \
     539        Tuples/TupleAssignment.cc Tuples/TupleExpansion.cc \
     540        Tuples/Explode.cc Virtual/ExpandCasts.cc
    535541MAINTAINERCLEANFILES = Parser/parser.output ${libdir}/${notdir \
    536542        ${cfa_cpplib_PROGRAMS}}
     
    711717GenPoly/driver_cfa_cpp-GenPoly.$(OBJEXT): GenPoly/$(am__dirstamp) \
    712718        GenPoly/$(DEPDIR)/$(am__dirstamp)
     719GenPoly/driver_cfa_cpp-PolyMutator.$(OBJEXT): GenPoly/$(am__dirstamp) \
     720        GenPoly/$(DEPDIR)/$(am__dirstamp)
    713721GenPoly/driver_cfa_cpp-ScrubTyVars.$(OBJEXT): GenPoly/$(am__dirstamp) \
    714722        GenPoly/$(DEPDIR)/$(am__dirstamp)
     
    717725GenPoly/driver_cfa_cpp-Specialize.$(OBJEXT): GenPoly/$(am__dirstamp) \
    718726        GenPoly/$(DEPDIR)/$(am__dirstamp)
     727GenPoly/driver_cfa_cpp-CopyParams.$(OBJEXT): GenPoly/$(am__dirstamp) \
     728        GenPoly/$(DEPDIR)/$(am__dirstamp)
    719729GenPoly/driver_cfa_cpp-FindFunction.$(OBJEXT):  \
    720730        GenPoly/$(am__dirstamp) GenPoly/$(DEPDIR)/$(am__dirstamp)
     731GenPoly/driver_cfa_cpp-DeclMutator.$(OBJEXT): GenPoly/$(am__dirstamp) \
     732        GenPoly/$(DEPDIR)/$(am__dirstamp)
    721733GenPoly/driver_cfa_cpp-InstantiateGeneric.$(OBJEXT):  \
    722734        GenPoly/$(am__dirstamp) GenPoly/$(DEPDIR)/$(am__dirstamp)
     
    917929SynTree/driver_cfa_cpp-Mutator.$(OBJEXT): SynTree/$(am__dirstamp) \
    918930        SynTree/$(DEPDIR)/$(am__dirstamp)
     931SynTree/driver_cfa_cpp-AddStmtVisitor.$(OBJEXT):  \
     932        SynTree/$(am__dirstamp) SynTree/$(DEPDIR)/$(am__dirstamp)
    919933SynTree/driver_cfa_cpp-TypeSubstitution.$(OBJEXT):  \
    920934        SynTree/$(am__dirstamp) SynTree/$(DEPDIR)/$(am__dirstamp)
     
    9931007@AMDEP_TRUE@@am__include@ @am__quote@ControlStruct/$(DEPDIR)/driver_cfa_cpp-Mutate.Po@am__quote@
    9941008@AMDEP_TRUE@@am__include@ @am__quote@GenPoly/$(DEPDIR)/driver_cfa_cpp-Box.Po@am__quote@
     1009@AMDEP_TRUE@@am__include@ @am__quote@GenPoly/$(DEPDIR)/driver_cfa_cpp-CopyParams.Po@am__quote@
     1010@AMDEP_TRUE@@am__include@ @am__quote@GenPoly/$(DEPDIR)/driver_cfa_cpp-DeclMutator.Po@am__quote@
    9951011@AMDEP_TRUE@@am__include@ @am__quote@GenPoly/$(DEPDIR)/driver_cfa_cpp-FindFunction.Po@am__quote@
    9961012@AMDEP_TRUE@@am__include@ @am__quote@GenPoly/$(DEPDIR)/driver_cfa_cpp-GenPoly.Po@am__quote@
    9971013@AMDEP_TRUE@@am__include@ @am__quote@GenPoly/$(DEPDIR)/driver_cfa_cpp-InstantiateGeneric.Po@am__quote@
    9981014@AMDEP_TRUE@@am__include@ @am__quote@GenPoly/$(DEPDIR)/driver_cfa_cpp-Lvalue.Po@am__quote@
     1015@AMDEP_TRUE@@am__include@ @am__quote@GenPoly/$(DEPDIR)/driver_cfa_cpp-PolyMutator.Po@am__quote@
    9991016@AMDEP_TRUE@@am__include@ @am__quote@GenPoly/$(DEPDIR)/driver_cfa_cpp-ScrubTyVars.Po@am__quote@
    10001017@AMDEP_TRUE@@am__include@ @am__quote@GenPoly/$(DEPDIR)/driver_cfa_cpp-Specialize.Po@am__quote@
     
    10391056@AMDEP_TRUE@@am__include@ @am__quote@SymTab/$(DEPDIR)/driver_cfa_cpp-TypeEquality.Po@am__quote@
    10401057@AMDEP_TRUE@@am__include@ @am__quote@SymTab/$(DEPDIR)/driver_cfa_cpp-Validate.Po@am__quote@
     1058@AMDEP_TRUE@@am__include@ @am__quote@SynTree/$(DEPDIR)/driver_cfa_cpp-AddStmtVisitor.Po@am__quote@
    10411059@AMDEP_TRUE@@am__include@ @am__quote@SynTree/$(DEPDIR)/driver_cfa_cpp-AddressExpr.Po@am__quote@
    10421060@AMDEP_TRUE@@am__include@ @am__quote@SynTree/$(DEPDIR)/driver_cfa_cpp-AggregateDecl.Po@am__quote@
     
    14321450@am__fastdepCXX_FALSE@  $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -c -o GenPoly/driver_cfa_cpp-GenPoly.obj `if test -f 'GenPoly/GenPoly.cc'; then $(CYGPATH_W) 'GenPoly/GenPoly.cc'; else $(CYGPATH_W) '$(srcdir)/GenPoly/GenPoly.cc'; fi`
    14331451
     1452GenPoly/driver_cfa_cpp-PolyMutator.o: GenPoly/PolyMutator.cc
     1453@am__fastdepCXX_TRUE@   $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -MT GenPoly/driver_cfa_cpp-PolyMutator.o -MD -MP -MF GenPoly/$(DEPDIR)/driver_cfa_cpp-PolyMutator.Tpo -c -o GenPoly/driver_cfa_cpp-PolyMutator.o `test -f 'GenPoly/PolyMutator.cc' || echo '$(srcdir)/'`GenPoly/PolyMutator.cc
     1454@am__fastdepCXX_TRUE@   $(AM_V_at)$(am__mv) GenPoly/$(DEPDIR)/driver_cfa_cpp-PolyMutator.Tpo GenPoly/$(DEPDIR)/driver_cfa_cpp-PolyMutator.Po
     1455@AMDEP_TRUE@@am__fastdepCXX_FALSE@      $(AM_V_CXX)source='GenPoly/PolyMutator.cc' object='GenPoly/driver_cfa_cpp-PolyMutator.o' libtool=no @AMDEPBACKSLASH@
     1456@AMDEP_TRUE@@am__fastdepCXX_FALSE@      DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
     1457@am__fastdepCXX_FALSE@  $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -c -o GenPoly/driver_cfa_cpp-PolyMutator.o `test -f 'GenPoly/PolyMutator.cc' || echo '$(srcdir)/'`GenPoly/PolyMutator.cc
     1458
     1459GenPoly/driver_cfa_cpp-PolyMutator.obj: GenPoly/PolyMutator.cc
     1460@am__fastdepCXX_TRUE@   $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -MT GenPoly/driver_cfa_cpp-PolyMutator.obj -MD -MP -MF GenPoly/$(DEPDIR)/driver_cfa_cpp-PolyMutator.Tpo -c -o GenPoly/driver_cfa_cpp-PolyMutator.obj `if test -f 'GenPoly/PolyMutator.cc'; then $(CYGPATH_W) 'GenPoly/PolyMutator.cc'; else $(CYGPATH_W) '$(srcdir)/GenPoly/PolyMutator.cc'; fi`
     1461@am__fastdepCXX_TRUE@   $(AM_V_at)$(am__mv) GenPoly/$(DEPDIR)/driver_cfa_cpp-PolyMutator.Tpo GenPoly/$(DEPDIR)/driver_cfa_cpp-PolyMutator.Po
     1462@AMDEP_TRUE@@am__fastdepCXX_FALSE@      $(AM_V_CXX)source='GenPoly/PolyMutator.cc' object='GenPoly/driver_cfa_cpp-PolyMutator.obj' libtool=no @AMDEPBACKSLASH@
     1463@AMDEP_TRUE@@am__fastdepCXX_FALSE@      DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
     1464@am__fastdepCXX_FALSE@  $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -c -o GenPoly/driver_cfa_cpp-PolyMutator.obj `if test -f 'GenPoly/PolyMutator.cc'; then $(CYGPATH_W) 'GenPoly/PolyMutator.cc'; else $(CYGPATH_W) '$(srcdir)/GenPoly/PolyMutator.cc'; fi`
     1465
    14341466GenPoly/driver_cfa_cpp-ScrubTyVars.o: GenPoly/ScrubTyVars.cc
    14351467@am__fastdepCXX_TRUE@   $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -MT GenPoly/driver_cfa_cpp-ScrubTyVars.o -MD -MP -MF GenPoly/$(DEPDIR)/driver_cfa_cpp-ScrubTyVars.Tpo -c -o GenPoly/driver_cfa_cpp-ScrubTyVars.o `test -f 'GenPoly/ScrubTyVars.cc' || echo '$(srcdir)/'`GenPoly/ScrubTyVars.cc
     
    14741506@am__fastdepCXX_FALSE@  $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -c -o GenPoly/driver_cfa_cpp-Specialize.obj `if test -f 'GenPoly/Specialize.cc'; then $(CYGPATH_W) 'GenPoly/Specialize.cc'; else $(CYGPATH_W) '$(srcdir)/GenPoly/Specialize.cc'; fi`
    14751507
     1508GenPoly/driver_cfa_cpp-CopyParams.o: GenPoly/CopyParams.cc
     1509@am__fastdepCXX_TRUE@   $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -MT GenPoly/driver_cfa_cpp-CopyParams.o -MD -MP -MF GenPoly/$(DEPDIR)/driver_cfa_cpp-CopyParams.Tpo -c -o GenPoly/driver_cfa_cpp-CopyParams.o `test -f 'GenPoly/CopyParams.cc' || echo '$(srcdir)/'`GenPoly/CopyParams.cc
     1510@am__fastdepCXX_TRUE@   $(AM_V_at)$(am__mv) GenPoly/$(DEPDIR)/driver_cfa_cpp-CopyParams.Tpo GenPoly/$(DEPDIR)/driver_cfa_cpp-CopyParams.Po
     1511@AMDEP_TRUE@@am__fastdepCXX_FALSE@      $(AM_V_CXX)source='GenPoly/CopyParams.cc' object='GenPoly/driver_cfa_cpp-CopyParams.o' libtool=no @AMDEPBACKSLASH@
     1512@AMDEP_TRUE@@am__fastdepCXX_FALSE@      DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
     1513@am__fastdepCXX_FALSE@  $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -c -o GenPoly/driver_cfa_cpp-CopyParams.o `test -f 'GenPoly/CopyParams.cc' || echo '$(srcdir)/'`GenPoly/CopyParams.cc
     1514
     1515GenPoly/driver_cfa_cpp-CopyParams.obj: GenPoly/CopyParams.cc
     1516@am__fastdepCXX_TRUE@   $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -MT GenPoly/driver_cfa_cpp-CopyParams.obj -MD -MP -MF GenPoly/$(DEPDIR)/driver_cfa_cpp-CopyParams.Tpo -c -o GenPoly/driver_cfa_cpp-CopyParams.obj `if test -f 'GenPoly/CopyParams.cc'; then $(CYGPATH_W) 'GenPoly/CopyParams.cc'; else $(CYGPATH_W) '$(srcdir)/GenPoly/CopyParams.cc'; fi`
     1517@am__fastdepCXX_TRUE@   $(AM_V_at)$(am__mv) GenPoly/$(DEPDIR)/driver_cfa_cpp-CopyParams.Tpo GenPoly/$(DEPDIR)/driver_cfa_cpp-CopyParams.Po
     1518@AMDEP_TRUE@@am__fastdepCXX_FALSE@      $(AM_V_CXX)source='GenPoly/CopyParams.cc' object='GenPoly/driver_cfa_cpp-CopyParams.obj' libtool=no @AMDEPBACKSLASH@
     1519@AMDEP_TRUE@@am__fastdepCXX_FALSE@      DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
     1520@am__fastdepCXX_FALSE@  $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -c -o GenPoly/driver_cfa_cpp-CopyParams.obj `if test -f 'GenPoly/CopyParams.cc'; then $(CYGPATH_W) 'GenPoly/CopyParams.cc'; else $(CYGPATH_W) '$(srcdir)/GenPoly/CopyParams.cc'; fi`
     1521
    14761522GenPoly/driver_cfa_cpp-FindFunction.o: GenPoly/FindFunction.cc
    14771523@am__fastdepCXX_TRUE@   $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -MT GenPoly/driver_cfa_cpp-FindFunction.o -MD -MP -MF GenPoly/$(DEPDIR)/driver_cfa_cpp-FindFunction.Tpo -c -o GenPoly/driver_cfa_cpp-FindFunction.o `test -f 'GenPoly/FindFunction.cc' || echo '$(srcdir)/'`GenPoly/FindFunction.cc
     
    14881534@am__fastdepCXX_FALSE@  $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -c -o GenPoly/driver_cfa_cpp-FindFunction.obj `if test -f 'GenPoly/FindFunction.cc'; then $(CYGPATH_W) 'GenPoly/FindFunction.cc'; else $(CYGPATH_W) '$(srcdir)/GenPoly/FindFunction.cc'; fi`
    14891535
     1536GenPoly/driver_cfa_cpp-DeclMutator.o: GenPoly/DeclMutator.cc
     1537@am__fastdepCXX_TRUE@   $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -MT GenPoly/driver_cfa_cpp-DeclMutator.o -MD -MP -MF GenPoly/$(DEPDIR)/driver_cfa_cpp-DeclMutator.Tpo -c -o GenPoly/driver_cfa_cpp-DeclMutator.o `test -f 'GenPoly/DeclMutator.cc' || echo '$(srcdir)/'`GenPoly/DeclMutator.cc
     1538@am__fastdepCXX_TRUE@   $(AM_V_at)$(am__mv) GenPoly/$(DEPDIR)/driver_cfa_cpp-DeclMutator.Tpo GenPoly/$(DEPDIR)/driver_cfa_cpp-DeclMutator.Po
     1539@AMDEP_TRUE@@am__fastdepCXX_FALSE@      $(AM_V_CXX)source='GenPoly/DeclMutator.cc' object='GenPoly/driver_cfa_cpp-DeclMutator.o' libtool=no @AMDEPBACKSLASH@
     1540@AMDEP_TRUE@@am__fastdepCXX_FALSE@      DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
     1541@am__fastdepCXX_FALSE@  $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -c -o GenPoly/driver_cfa_cpp-DeclMutator.o `test -f 'GenPoly/DeclMutator.cc' || echo '$(srcdir)/'`GenPoly/DeclMutator.cc
     1542
     1543GenPoly/driver_cfa_cpp-DeclMutator.obj: GenPoly/DeclMutator.cc
     1544@am__fastdepCXX_TRUE@   $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -MT GenPoly/driver_cfa_cpp-DeclMutator.obj -MD -MP -MF GenPoly/$(DEPDIR)/driver_cfa_cpp-DeclMutator.Tpo -c -o GenPoly/driver_cfa_cpp-DeclMutator.obj `if test -f 'GenPoly/DeclMutator.cc'; then $(CYGPATH_W) 'GenPoly/DeclMutator.cc'; else $(CYGPATH_W) '$(srcdir)/GenPoly/DeclMutator.cc'; fi`
     1545@am__fastdepCXX_TRUE@   $(AM_V_at)$(am__mv) GenPoly/$(DEPDIR)/driver_cfa_cpp-DeclMutator.Tpo GenPoly/$(DEPDIR)/driver_cfa_cpp-DeclMutator.Po
     1546@AMDEP_TRUE@@am__fastdepCXX_FALSE@      $(AM_V_CXX)source='GenPoly/DeclMutator.cc' object='GenPoly/driver_cfa_cpp-DeclMutator.obj' libtool=no @AMDEPBACKSLASH@
     1547@AMDEP_TRUE@@am__fastdepCXX_FALSE@      DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
     1548@am__fastdepCXX_FALSE@  $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -c -o GenPoly/driver_cfa_cpp-DeclMutator.obj `if test -f 'GenPoly/DeclMutator.cc'; then $(CYGPATH_W) 'GenPoly/DeclMutator.cc'; else $(CYGPATH_W) '$(srcdir)/GenPoly/DeclMutator.cc'; fi`
     1549
    14901550GenPoly/driver_cfa_cpp-InstantiateGeneric.o: GenPoly/InstantiateGeneric.cc
    14911551@am__fastdepCXX_TRUE@   $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -MT GenPoly/driver_cfa_cpp-InstantiateGeneric.o -MD -MP -MF GenPoly/$(DEPDIR)/driver_cfa_cpp-InstantiateGeneric.Tpo -c -o GenPoly/driver_cfa_cpp-InstantiateGeneric.o `test -f 'GenPoly/InstantiateGeneric.cc' || echo '$(srcdir)/'`GenPoly/InstantiateGeneric.cc
     
    25232583@AMDEP_TRUE@@am__fastdepCXX_FALSE@      DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
    25242584@am__fastdepCXX_FALSE@  $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -c -o SynTree/driver_cfa_cpp-Mutator.obj `if test -f 'SynTree/Mutator.cc'; then $(CYGPATH_W) 'SynTree/Mutator.cc'; else $(CYGPATH_W) '$(srcdir)/SynTree/Mutator.cc'; fi`
     2585
     2586SynTree/driver_cfa_cpp-AddStmtVisitor.o: SynTree/AddStmtVisitor.cc
     2587@am__fastdepCXX_TRUE@   $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -MT SynTree/driver_cfa_cpp-AddStmtVisitor.o -MD -MP -MF SynTree/$(DEPDIR)/driver_cfa_cpp-AddStmtVisitor.Tpo -c -o SynTree/driver_cfa_cpp-AddStmtVisitor.o `test -f 'SynTree/AddStmtVisitor.cc' || echo '$(srcdir)/'`SynTree/AddStmtVisitor.cc
     2588@am__fastdepCXX_TRUE@   $(AM_V_at)$(am__mv) SynTree/$(DEPDIR)/driver_cfa_cpp-AddStmtVisitor.Tpo SynTree/$(DEPDIR)/driver_cfa_cpp-AddStmtVisitor.Po
     2589@AMDEP_TRUE@@am__fastdepCXX_FALSE@      $(AM_V_CXX)source='SynTree/AddStmtVisitor.cc' object='SynTree/driver_cfa_cpp-AddStmtVisitor.o' libtool=no @AMDEPBACKSLASH@
     2590@AMDEP_TRUE@@am__fastdepCXX_FALSE@      DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
     2591@am__fastdepCXX_FALSE@  $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -c -o SynTree/driver_cfa_cpp-AddStmtVisitor.o `test -f 'SynTree/AddStmtVisitor.cc' || echo '$(srcdir)/'`SynTree/AddStmtVisitor.cc
     2592
     2593SynTree/driver_cfa_cpp-AddStmtVisitor.obj: SynTree/AddStmtVisitor.cc
     2594@am__fastdepCXX_TRUE@   $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -MT SynTree/driver_cfa_cpp-AddStmtVisitor.obj -MD -MP -MF SynTree/$(DEPDIR)/driver_cfa_cpp-AddStmtVisitor.Tpo -c -o SynTree/driver_cfa_cpp-AddStmtVisitor.obj `if test -f 'SynTree/AddStmtVisitor.cc'; then $(CYGPATH_W) 'SynTree/AddStmtVisitor.cc'; else $(CYGPATH_W) '$(srcdir)/SynTree/AddStmtVisitor.cc'; fi`
     2595@am__fastdepCXX_TRUE@   $(AM_V_at)$(am__mv) SynTree/$(DEPDIR)/driver_cfa_cpp-AddStmtVisitor.Tpo SynTree/$(DEPDIR)/driver_cfa_cpp-AddStmtVisitor.Po
     2596@AMDEP_TRUE@@am__fastdepCXX_FALSE@      $(AM_V_CXX)source='SynTree/AddStmtVisitor.cc' object='SynTree/driver_cfa_cpp-AddStmtVisitor.obj' libtool=no @AMDEPBACKSLASH@
     2597@AMDEP_TRUE@@am__fastdepCXX_FALSE@      DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
     2598@am__fastdepCXX_FALSE@  $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -c -o SynTree/driver_cfa_cpp-AddStmtVisitor.obj `if test -f 'SynTree/AddStmtVisitor.cc'; then $(CYGPATH_W) 'SynTree/AddStmtVisitor.cc'; else $(CYGPATH_W) '$(srcdir)/SynTree/AddStmtVisitor.cc'; fi`
    25252599
    25262600SynTree/driver_cfa_cpp-TypeSubstitution.o: SynTree/TypeSubstitution.cc
  • src/Parser/DeclarationNode.cc

    r3f7e12cb r78315272  
    99// Author           : Rodolfo G. Esteves
    1010// Created On       : Sat May 16 12:34:05 2015
    11 // Last Modified By : Peter A. Buhr
    12 // Last Modified On : Sat Sep 23 18:16:48 2017
    13 // Update Count     : 1024
     11// Last Modified By : Andrew Beach
     12// Last Modified On : Thr Aug 10 17:02:00 2017
     13// Update Count     : 1021
    1414//
    1515
     
    4040using namespace std;
    4141
    42 // These must harmonize with the corresponding DeclarationNode enumerations.
    43 const char * DeclarationNode::basicTypeNames[] = { "void", "_Bool", "char", "int", "float", "double", "long double", "int128", "float80", "float128", "NoBasicTypeNames" };
     42// These must remain in the same order as the corresponding DeclarationNode enumerations.
     43const char * DeclarationNode::basicTypeNames[] = { "void", "_Bool", "char", "int", "float", "double", "long double", "NoBasicTypeNames" };
    4444const char * DeclarationNode::complexTypeNames[] = { "_Complex", "_Imaginary", "NoComplexTypeNames" };
    4545const char * DeclarationNode::signednessNames[] = { "signed", "unsigned", "NoSignednessNames" };
     
    10311031
    10321032        if ( variable.tyClass != NoTypeClass ) {
    1033                 // otype is internally converted to dtype + otype parameters
    1034                 static const TypeDecl::Kind kindMap[] = { TypeDecl::Dtype, TypeDecl::Dtype, TypeDecl::Ftype, TypeDecl::Ttype };
    1035                 assertf( sizeof(kindMap)/sizeof(kindMap[0]) == NoTypeClass, "DeclarationNode::build: kindMap is out of sync." );
     1033                static const TypeDecl::Kind kindMap[] = { TypeDecl::Any, TypeDecl::Dtype, TypeDecl::Ftype, TypeDecl::Ttype };
     1034                assertf( sizeof(kindMap)/sizeof(kindMap[0] == NoTypeClass-1), "DeclarationNode::build: kindMap is out of sync." );
    10361035                assertf( variable.tyClass < sizeof(kindMap)/sizeof(kindMap[0]), "Variable's tyClass is out of bounds." );
    1037                 TypeDecl * ret = new TypeDecl( *name, Type::StorageClasses(), nullptr, kindMap[ variable.tyClass ], variable.tyClass == Otype, variable.initializer ? variable.initializer->buildType() : nullptr );
     1036                TypeDecl * ret = new TypeDecl( *name, Type::StorageClasses(), nullptr, kindMap[ variable.tyClass ], variable.initializer ? variable.initializer->buildType() : nullptr );
    10381037                buildList( variable.assertions, ret->get_assertions() );
    10391038                return ret;
  • src/Parser/ExpressionNode.cc

    r3f7e12cb r78315272  
    1010// Created On       : Sat May 16 13:17:07 2015
    1111// Last Modified By : Peter A. Buhr
    12 // Last Modified On : Wed Sep 27 22:51:55 2017
    13 // Update Count     : 781
     12// Last Modified On : Thu Sep 14 23:09:34 2017
     13// Update Count     : 690
    1414//
    1515
     
    6060static inline bool checkX( char c ) { return c == 'x' || c == 'X'; }
    6161
    62 static const char * lnthsInt[2][6] = {
    63         { "int8_t", "int16_t", "int32_t", "int64_t", "size_t", },
    64         { "uint8_t", "uint16_t", "uint32_t", "uint64_t", "size_t", }
    65 }; // lnthsInt
    66 
    67 static inline void checkLNInt( string & str, int & lnth, int & size ) {
    68         string::size_type posn = str.find_first_of( "lL" ), start = posn;
    69   if ( posn == string::npos ) return;
    70         size = 4;                                                                                       // assume largest size
    71         posn += 1;                                                                                      // advance to size
    72         if ( str[posn] == '8' ) {                                                       // 8
    73                 lnth = 0;
    74         } else if ( str[posn] == '1' ) {
    75                 posn += 1;
    76                 if ( str[posn] == '6' ) {                                               // 16
    77                         lnth = 1;
    78                 } else {                                                                                // 128
    79                         posn += 1;
    80                         lnth = 5;
    81                 } // if
    82         } else {
    83                 if ( str[posn] == '3' ) {                                               // 32
    84                         lnth = 2;
    85                 } else if ( str[posn] == '6' ) {                                // 64
    86                         lnth = 3;
    87                 } else {
    88                         assertf( false, "internal error, bad integral length %s", str.c_str() );
    89                 } // if
    90                 posn += 1;
    91         } // if
    92         str.erase( start, posn - start + 1 );                           // remove length suffix
    93 } // checkLNInt
    94 
    9562static void sepNumeric( string & str, string & units ) {
    9663        string::size_type posn = str.find_first_of( "`" );
     
    10269
    10370Expression * build_constantInteger( string & str ) {
    104         static const BasicType::Kind kind[2][6] = {
     71        static const BasicType::Kind kind[2][5] = {
    10572                // short (h) must be before char (hh)
    106                 { BasicType::ShortSignedInt, BasicType::SignedChar, BasicType::SignedInt, BasicType::LongSignedInt, BasicType::LongLongSignedInt, BasicType::SignedInt128, },
    107                 { BasicType::ShortUnsignedInt, BasicType::UnsignedChar, BasicType::UnsignedInt, BasicType::LongUnsignedInt, BasicType::LongLongUnsignedInt, BasicType::UnsignedInt128, },
     73                { BasicType::ShortSignedInt, BasicType::SignedChar, BasicType::SignedInt, BasicType::LongSignedInt, BasicType::LongLongSignedInt },
     74                { BasicType::ShortUnsignedInt, BasicType::UnsignedChar, BasicType::UnsignedInt, BasicType::LongUnsignedInt, BasicType::LongLongUnsignedInt },
    10875        };
    10976
    110         string units;
     77        string units;                                                                           // units
    11178        sepNumeric( str, units );                                                       // separate constant from units
    11279
    11380        bool dec = true, Unsigned = false;                                      // decimal, unsigned constant
    114         int size;                                                                                       // 0 => short, 1 => char, 2 => int, 3 => long int, 4 => long long int, 5 => int128
    115         int lnth = -1;                                                                          // literal length
    116 
     81        int size;                                                                                       // 0 => short, 1 => char, 2 => int, 3 => long int, 4 => long long int, 5 => size_t
    11782        unsigned long long int v;                                                       // converted integral value
    11883        size_t last = str.length() - 1;                                         // last character of constant
     
    175140                        } // if
    176141                        str.erase( last - size - 1, size + 1 );         // remove 'h'/"hh"
    177                 } else {                                                                                // suffix "ln" ?
    178                         checkLNInt( str, lnth, size );
    179142                } // if
    180143        } else if ( checkL( str[ last ] ) ) {                           // suffix 'l' ?
     
    200163                str.erase( last - size, size + 1 );                             // remove 'h'/"hh"
    201164        } else if ( checkZ( str[last] ) ) {                                     // suffix 'z' ?
    202                 lnth = 4;
     165                size = 5;
    203166                str.erase( last, 1 );                                                   // remove 'z'
    204         } else {                                                                                        // suffix "ln" ?
    205                 checkLNInt( str, lnth, size );
    206         } // if
    207 
    208         assert( 0 <= size && size < 6 );
    209         // Constant type is correct for overload resolving.
     167        } // if
     168
    210169        ret = new ConstantExpr( Constant( new BasicType( noQualifiers, kind[Unsigned][size] ), str, v ) );
    211         if ( Unsigned && size < 2 ) {                                           // hh or h, less than int ?
    212                 // int i = -1uh => 65535 not -1, so cast is necessary for unsigned, which unfortunately eliminates warnings for large values.
     170        if ( Unsigned && size < 2 ) {                                           // less than int ?
     171                // int i = -1uh => 65535 not -1, so cast is necessary for unsigned, which eliminates warnings for large values.
    213172                ret = new CastExpr( ret, new BasicType( Type::Qualifiers(), kind[Unsigned][size] ) );
    214         } else if ( lnth != -1 ) {                                                      // explicit length ?
    215                 if ( lnth == 5 ) {                                                              // int128 ?
    216                         size = 5;
    217                         ret = new CastExpr( ret, new BasicType( Type::Qualifiers(), kind[Unsigned][size] ) );
    218                 } else {
    219                         ret = new CastExpr( ret, new TypeInstType( Type::Qualifiers(), lnthsInt[Unsigned][lnth], false ) );
    220                 } // if
     173        } else if ( size == 5 ) {                                                       // explicit cast to size_t
     174                ret = new CastExpr( ret, new TypeInstType( Type::Qualifiers(), "size_t", false ) );
    221175        } // if
    222176  CLEANUP:
     
    228182        return ret;
    229183} // build_constantInteger
    230 
    231 
    232 static inline void checkLNFloat( string & str, int & lnth, int & size ) {
    233         string::size_type posn = str.find_first_of( "lL" ), start = posn;
    234   if ( posn == string::npos ) return;
    235         size = 2;                                                                                       // assume largest size
    236         lnth = 0;
    237         posn += 1;                                                                                      // advance to size
    238         if ( str[posn] == '3' ) {                                                       // 32
    239                 size = 0;
    240         } else if ( str[posn] == '6' ) {                                        // 64
    241                 size = 1;
    242         } else if ( str[posn] == '8' || str[posn] == '1' ) { // 80, 128
    243                 size = 2;
    244                 if ( str[posn] == '1' ) posn += 1;
    245         } else {
    246                 assertf( false, "internal error, bad floating point length %s", str.c_str() );
    247         } // if
    248         posn += 1;
    249         str.erase( start, posn - start + 1 );                           // remove length suffix
    250 } // checkLNFloat
    251 
    252184
    253185Expression * build_constantFloat( string & str ) {
     
    257189        };
    258190
    259         string units;
     191        string units;                                                                           // units
    260192        sepNumeric( str, units );                                                       // separate constant from units
    261193
    262194        bool complx = false;                                                            // real, complex
    263         int size = 1;                                                                           // 0 => float, 1 => double, 2 => long double
    264         int lnth = -1;                                                                          // literal length
     195        int size = 1;                                                                           // 0 => float, 1 => double (default), 2 => long double
    265196        // floating-point constant has minimum of 2 characters: 1. or .1
    266197        size_t last = str.length() - 1;
     
    280211        } else if ( checkL( str[last] ) ) {                                     // long double ?
    281212                size = 2;
    282         } else {
    283                 size = 1;                                                                               // double (default)
    284                 checkLNFloat( str, lnth, size );
    285213        } // if
    286214        if ( ! complx && checkI( str[last - 1] ) ) {            // imaginary ?
     
    288216        } // if
    289217
    290         assert( 0 <= size && size < 3 );
    291218        Expression * ret = new ConstantExpr( Constant( new BasicType( noQualifiers, kind[complx][size] ), str, v ) );
    292         if ( lnth != -1 ) {                                                                     // explicit length ?
    293                 ret = new CastExpr( ret, new BasicType( Type::Qualifiers(), kind[complx][size] ) );
    294         } // if
    295219        if ( units.length() != 0 ) {
    296220                ret = new UntypedExpr( new NameExpr( units ), { ret } );
     
    397321
    398322NameExpr * build_varref( const string * name ) {
    399         NameExpr * expr = new NameExpr( *name );
     323        NameExpr * expr = new NameExpr( *name, nullptr );
    400324        delete name;
    401325        return expr;
     
    488412        list< Expression * > args;
    489413        buildMoveList( expr_node, args );
    490         return new UntypedExpr( maybeMoveBuild< Expression >(function), args );
     414        return new UntypedExpr( maybeMoveBuild< Expression >(function), args, nullptr );
    491415} // build_func
    492416
  • src/Parser/ParseNode.h

    r3f7e12cb r78315272  
    1010// Created On       : Sat May 16 13:28:16 2015
    1111// Last Modified By : Peter A. Buhr
    12 // Last Modified On : Sat Sep 23 18:11:22 2017
    13 // Update Count     : 821
     12// Last Modified On : Thu Sep 14 23:09:39 2017
     13// Update Count     : 815
    1414//
    1515
     
    4747#define YYLTYPE_IS_DECLARED 1 /* alert the parser that we have our own definition */
    4848
     49extern char * yyfilename;
     50extern int yylineno;
    4951extern YYLTYPE yylloc;
    5052
     
    195197class DeclarationNode : public ParseNode {
    196198  public:
    197         // These enumerations must harmonize with their names.
    198         enum BasicType { Void, Bool, Char, Int, Float, Double, LongDouble, Int128, Float80, Float128, NoBasicType };
     199        enum BasicType { Void, Bool, Char, Int, Float, Double, LongDouble, NoBasicType };
     200        enum ComplexType { Complex, Imaginary, NoComplexType };
     201        enum Signedness { Signed, Unsigned, NoSignedness };
     202        enum Length { Short, Long, LongLong, NoLength };
     203        enum Aggregate { Struct, Union, Trait, Coroutine, Monitor, Thread, NoAggregate };
     204        enum TypeClass { Otype, Dtype, Ftype, Ttype, NoTypeClass };
     205        enum BuiltinType { Valist, Zero, One, NoBuiltinType };
     206
    199207        static const char * basicTypeNames[];
    200         enum ComplexType { Complex, Imaginary, NoComplexType };
    201208        static const char * complexTypeNames[];
    202         enum Signedness { Signed, Unsigned, NoSignedness };
    203209        static const char * signednessNames[];
    204         enum Length { Short, Long, LongLong, NoLength };
    205210        static const char * lengthNames[];
    206         enum Aggregate { Struct, Union, Trait, Coroutine, Monitor, Thread, NoAggregate };
    207211        static const char * aggregateNames[];
    208         enum TypeClass { Otype, Dtype, Ftype, Ttype, NoTypeClass };
    209212        static const char * typeClassNames[];
    210         enum BuiltinType { Valist, Zero, One, NoBuiltinType };
    211213        static const char * builtinTypeNames[];
    212214
  • src/Parser/StatementNode.cc

    r3f7e12cb r78315272  
    234234                target,
    235235                maybeMoveBuild<Statement >( stmt ),
    236                 notZeroExpr( maybeMoveBuild<Expression>( when ) )
     236                maybeMoveBuild<Expression>( when )
    237237        });
    238238
     
    250250        delete targetExpr;
    251251
    252         node->clauses.insert( node->clauses.begin(), WaitForStmt::Clause{
     252        node->clauses.push_back( WaitForStmt::Clause{
    253253                std::move( target ),
    254254                maybeMoveBuild<Statement >( stmt ),
    255                 notZeroExpr( maybeMoveBuild<Expression>( when ) )
     255                maybeMoveBuild<Expression>( when )
    256256        });
    257257
     
    265265                node->timeout.time      = maybeMoveBuild<Expression>( timeout );
    266266                node->timeout.statement = maybeMoveBuild<Statement >( stmt    );
    267                 node->timeout.condition = notZeroExpr( maybeMoveBuild<Expression>( when ) );
     267                node->timeout.condition = maybeMoveBuild<Expression>( when    );
    268268        }
    269269        else {
    270                 node->orelse.statement  = maybeMoveBuild<Statement >( stmt );
    271                 node->orelse.condition  = notZeroExpr( maybeMoveBuild<Expression>( when ) );
     270                node->orelse.statement  = maybeMoveBuild<Statement >( stmt    );
     271                node->orelse.condition  = maybeMoveBuild<Expression>( when    );
    272272        }
    273273
     
    280280        node->timeout.time      = maybeMoveBuild<Expression>( timeout );
    281281        node->timeout.statement = maybeMoveBuild<Statement >( stmt    );
    282         node->timeout.condition = notZeroExpr( maybeMoveBuild<Expression>( when ) );
     282        node->timeout.condition = maybeMoveBuild<Expression>( when    );
    283283
    284284        node->orelse.statement = maybeMoveBuild<Statement >( else_stmt );
    285         node->orelse.condition  = notZeroExpr( maybeMoveBuild<Expression>( else_when ) );
     285        node->orelse.condition = maybeMoveBuild<Expression>( else_when );
    286286
    287287        return node;
    288288}
     289
     290// WaitForStmt::Target build_waitfor( const std::string * name, ExpressionNode * arguments ) {
     291//       return WaitForStmt::Clause{
     292
     293//       };
     294// }
    289295
    290296Statement *build_compound( StatementNode *first ) {
  • src/Parser/TypeData.cc

    r3f7e12cb r78315272  
    1010// Created On       : Sat May 16 15:12:51 2015
    1111// Last Modified By : Peter A. Buhr
    12 // Last Modified On : Mon Sep 25 18:33:41 2017
    13 // Update Count     : 587
     12// Last Modified On : Fri Sep  1 23:13:38 2017
     13// Update Count     : 569
    1414//
    1515
     
    9898} // TypeData::TypeData
    9999
    100 
    101100TypeData::~TypeData() {
    102101        delete base;
     
    162161        } // switch
    163162} // TypeData::~TypeData
    164 
    165163
    166164TypeData * TypeData::clone() const {
     
    237235} // TypeData::clone
    238236
    239 
    240237void TypeData::print( ostream &os, int indent ) const {
    241238        for ( int i = 0; i < Type::NumTypeQualifier; i += 1 ) {
     
    402399} // TypeData::print
    403400
    404 
    405401template< typename ForallList >
    406402void buildForall( const DeclarationNode * firstNode, ForallList &outputList ) {
    407403        buildList( firstNode, outputList );
    408         auto n = firstNode;
    409         for ( typename ForallList::iterator i = outputList.begin(); i != outputList.end(); ++i, n = (DeclarationNode*)n->get_next() ) {
     404        for ( typename ForallList::iterator i = outputList.begin(); i != outputList.end(); ++i ) {
    410405                TypeDecl * td = static_cast<TypeDecl *>(*i);
    411                 if ( n->variable.tyClass == DeclarationNode::Otype ) {
     406                if ( td->get_kind() == TypeDecl::Any ) {
    412407                        // add assertion parameters to `type' tyvars in reverse order
    413408                        // add dtor:  void ^?{}(T *)
     
    435430                } // if
    436431        } // for
    437 } // buildForall
    438 
     432}
    439433
    440434Type * typebuild( const TypeData * td ) {
     
    483477} // typebuild
    484478
    485 
    486479TypeData * typeextractAggregate( const TypeData * td, bool toplevel ) {
    487480        TypeData * ret = nullptr;
     
    511504} // typeextractAggregate
    512505
    513 
    514506Type::Qualifiers buildQualifiers( const TypeData * td ) {
    515507        return td->qualifiers;
    516508} // buildQualifiers
    517509
    518 
    519 static string genTSError( string msg, DeclarationNode::BasicType basictype ) {
    520         throw SemanticError( string( "invalid type specifier \"" ) + msg + "\" for type \"" + DeclarationNode::basicTypeNames[basictype] + "\"." );
    521 } // genTSError
    522 
    523510Type * buildBasicType( const TypeData * td ) {
    524511        BasicType::Kind ret;
     
    526513        switch ( td->basictype ) {
    527514          case DeclarationNode::Void:
    528                 if ( td->signedness != DeclarationNode::NoSignedness ) {
    529                         genTSError( DeclarationNode::signednessNames[ td->signedness ], td->basictype );
    530                 } // if
    531                 if ( td->length != DeclarationNode::NoLength ) {
    532                         genTSError( DeclarationNode::lengthNames[ td->length ], td->basictype );
    533                 } // if
     515                if ( td->signedness != DeclarationNode::NoSignedness && td->length != DeclarationNode::NoLength ) {
     516                        throw SemanticError( "invalid type specifier \"void\" in type: ", td );
     517                } // if
     518
    534519                return new VoidType( buildQualifiers( td ) );
    535520                break;
     
    537522          case DeclarationNode::Bool:
    538523                if ( td->signedness != DeclarationNode::NoSignedness ) {
    539                         genTSError( DeclarationNode::signednessNames[ td->signedness ], td->basictype );
     524                        throw SemanticError( string( "invalid type specifier " ) + DeclarationNode::signednessNames[ td->signedness ] + " in type: ", td );
    540525                } // if
    541526                if ( td->length != DeclarationNode::NoLength ) {
    542                         genTSError( DeclarationNode::lengthNames[ td->length ], td->basictype );
     527                        throw SemanticError( string( "invalid type specifier " ) + DeclarationNode::lengthNames[ td->length ] + " in type: ", td );
    543528                } // if
    544529
     
    553538
    554539                if ( td->length != DeclarationNode::NoLength ) {
    555                         genTSError( DeclarationNode::lengthNames[ td->length ], td->basictype );
     540                        throw SemanticError( string( "invalid type specifier " ) + DeclarationNode::lengthNames[ td->length ] + " in type: ", td );
    556541                } // if
    557542
     
    572557                break;
    573558
    574           case DeclarationNode::Int128:
    575                 ret = td->signedness == 1 ? BasicType::UnsignedInt128 : BasicType::SignedInt128;
    576                 if ( td->length != DeclarationNode::NoLength ) {
    577                         genTSError( DeclarationNode::lengthNames[ td->length ], td->basictype );
    578                 } // if
    579                 break;
    580 
    581559          case DeclarationNode::Float:
    582           case DeclarationNode::Float80:
    583           case DeclarationNode::Float128:
    584560          case DeclarationNode::Double:
    585561          case DeclarationNode::LongDouble:                                     // not set until below
     
    592568          FloatingPoint: ;
    593569                if ( td->signedness != DeclarationNode::NoSignedness ) {
    594                         genTSError( DeclarationNode::signednessNames[ td->signedness ], td->basictype );
     570                        throw SemanticError( string( "invalid type specifier " ) + DeclarationNode::signednessNames[ td->signedness ] + " in type: ", td );
    595571                } // if
    596572                if ( td->length == DeclarationNode::Short || td->length == DeclarationNode::LongLong ) {
    597                         genTSError( DeclarationNode::lengthNames[ td->length ], td->basictype );
     573                        throw SemanticError( string( "invalid type specifier " ) + DeclarationNode::lengthNames[ td->length ] + " in type: ", td );
    598574                } // if
    599575                if ( td->basictype == DeclarationNode::Float && td->length == DeclarationNode::Long ) {
    600                         genTSError( DeclarationNode::lengthNames[ td->length ], td->basictype );
     576                        throw SemanticError( "invalid type specifier \"long\" in type: ", td );
    601577                } // if
    602578                if ( td->length == DeclarationNode::Long ) {
     
    617593                goto Integral;
    618594          default:
    619                 assertf( false, "unknown basic type" );
     595                assert(false);
    620596                return nullptr;
    621597        } // switch
     
    625601        return bt;
    626602} // buildBasicType
    627 
    628603
    629604PointerType * buildPointer( const TypeData * td ) {
     
    637612        return pt;
    638613} // buildPointer
    639 
    640614
    641615ArrayType * buildArray( const TypeData * td ) {
     
    652626} // buildArray
    653627
    654 
    655628ReferenceType * buildReference( const TypeData * td ) {
    656629        ReferenceType * rt;
     
    664637} // buildReference
    665638
    666 
    667639AggregateDecl * buildAggregate( const TypeData * td, std::list< Attribute * > attributes, LinkageSpec::Spec linkage ) {
    668640        assert( td->kind == TypeData::Aggregate );
     
    693665        return at;
    694666} // buildAggregate
    695 
    696667
    697668ReferenceToType * buildComAggInst( const TypeData * type, std::list< Attribute * > attributes, LinkageSpec::Spec linkage ) {
     
    751722} // buildAggInst
    752723
    753 
    754724ReferenceToType * buildAggInst( const TypeData * td ) {
    755725        assert( td->kind == TypeData::AggregateInst );
     
    791761} // buildAggInst
    792762
    793 
    794763NamedTypeDecl * buildSymbolic( const TypeData * td, const string & name, Type::StorageClasses scs, LinkageSpec::Spec linkage ) {
    795764        assert( td->kind == TypeData::Symbolic );
     
    799768                ret = new TypedefDecl( name, scs, typebuild( td->base ), linkage );
    800769        } else {
    801                 ret = new TypeDecl( name, scs, typebuild( td->base ), TypeDecl::Dtype, true );
     770                ret = new TypeDecl( name, scs, typebuild( td->base ), TypeDecl::Any );
    802771        } // if
    803772        buildList( td->symbolic.params, ret->get_parameters() );
     
    805774        return ret;
    806775} // buildSymbolic
    807 
    808776
    809777EnumDecl * buildEnum( const TypeData * td, std::list< Attribute * > attributes, LinkageSpec::Spec linkage ) {
     
    822790} // buildEnum
    823791
    824 
    825792TypeInstType * buildSymbolicInst( const TypeData * td ) {
    826793        assert( td->kind == TypeData::SymbolicInst );
     
    830797        return ret;
    831798} // buildSymbolicInst
    832 
    833799
    834800TupleType * buildTuple( const TypeData * td ) {
     
    841807} // buildTuple
    842808
    843 
    844809TypeofType * buildTypeof( const TypeData * td ) {
    845810        assert( td->kind == TypeData::Typeof );
     
    848813        return new TypeofType( buildQualifiers( td ), td->typeexpr->build() );
    849814} // buildTypeof
    850 
    851815
    852816Declaration * buildDecl( const TypeData * td, const string &name, Type::StorageClasses scs, Expression * bitfieldWidth, Type::FuncSpecifiers funcSpec, LinkageSpec::Spec linkage, Expression *asmName, Initializer * init, std::list< Attribute * > attributes ) {
     
    872836        return nullptr;
    873837} // buildDecl
    874 
    875838
    876839FunctionType * buildFunction( const TypeData * td ) {
     
    894857        return ft;
    895858} // buildFunction
    896 
    897859
    898860// Transform KR routine declarations into C99 routine declarations:
  • src/Parser/lex.ll

    r3f7e12cb r78315272  
    1010 * Created On       : Sat Sep 22 08:58:10 2001
    1111 * Last Modified By : Peter A. Buhr
    12  * Last Modified On : Wed Oct 25 13:53:56 2017
    13  * Update Count     : 634
     12 * Last Modified On : Sun Sep 10 22:29:15 2017
     13 * Update Count     : 620
    1414 */
    1515
     
    9393                                // numeric constants, CFA: '_' in constant
    9494hex_quad {hex}("_"?{hex}){3}
    95 size_opt (8|16|32|64|128)?
    96 length ("ll"|"LL"|[lL]{size_opt})|("hh"|"HH"|[hH])
     95length ("ll"|"LL"|[lL])|("hh"|"HH"|[hH])
    9796integer_suffix_opt ("_"?(([uU]({length}?[iI]?)|([iI]{length}))|([iI]({length}?[uU]?)|([uU]{length}))|({length}([iI]?[uU]?)|([uU][iI]))|[zZ]))?{user_suffix_opt}
    9897
     
    110109                                // GCC: D (double) and iI (imaginary) suffixes, and DL (long double)
    111110exponent "_"?[eE]"_"?[+-]?{decimal_digits}
    112 floating_size 32|64|80|128
    113 floating_length ([fFdDlL]|[lL]{floating_size})
    114 floating_suffix ({floating_length}?[iI]?)|([iI]{floating_length})
     111floating_suffix ([fFdDlL]?[iI]?)|([iI][lLfFdD])
    115112floating_suffix_opt ("_"?({floating_suffix}|"DL"))?{user_suffix_opt}
    116113decimal_digits ({decimal})|({decimal}({decimal}|"_")*{decimal})
     
    233230__extension__   { KEYWORD_RETURN(EXTENSION); }                  // GCC
    234231extern                  { KEYWORD_RETURN(EXTERN); }
     232fallthrough             { KEYWORD_RETURN(FALLTHRU); }                   // CFA
    235233fallthru                { KEYWORD_RETURN(FALLTHRU); }                   // CFA
    236 fallthrough             { KEYWORD_RETURN(FALLTHROUGH); }                // CFA
    237234finally                 { KEYWORD_RETURN(FINALLY); }                    // CFA
    238235float                   { KEYWORD_RETURN(FLOAT); }
    239 __float80               { KEYWORD_RETURN(FLOAT80); }                    // GCC
    240 float80                 { KEYWORD_RETURN(FLOAT80); }                    // GCC
    241 __float128              { KEYWORD_RETURN(FLOAT128); }                   // GCC
    242 float128                { KEYWORD_RETURN(FLOAT128); }                   // GCC
     236__float128              { KEYWORD_RETURN(FLOAT); }                              // GCC
    243237for                             { KEYWORD_RETURN(FOR); }
    244238forall                  { KEYWORD_RETURN(FORALL); }                             // CFA
     
    255249__inline__              { KEYWORD_RETURN(INLINE); }                             // GCC
    256250int                             { KEYWORD_RETURN(INT); }
    257 __int128                { KEYWORD_RETURN(INT128); }                             // GCC
    258 int128                  { KEYWORD_RETURN(INT128); }                             // GCC
     251__int128                { KEYWORD_RETURN(INT); }                                // GCC
     252__int128_t              { KEYWORD_RETURN(INT); }                                // GCC
    259253__label__               { KEYWORD_RETURN(LABEL); }                              // GCC
    260254long                    { KEYWORD_RETURN(LONG); }
     
    291285__typeof                { KEYWORD_RETURN(TYPEOF); }                             // GCC
    292286__typeof__              { KEYWORD_RETURN(TYPEOF); }                             // GCC
     287__uint128_t             { KEYWORD_RETURN(INT); }                                // GCC
    293288union                   { KEYWORD_RETURN(UNION); }
    294289unsigned                { KEYWORD_RETURN(UNSIGNED); }
  • src/Parser/parser.yy

    r3f7e12cb r78315272  
    1010// Created On       : Sat Sep  1 20:22:55 2001
    1111// Last Modified By : Peter A. Buhr
    12 // Last Modified On : Wed Oct 25 12:28:54 2017
    13 // Update Count     : 2893
     12// Last Modified On : Thu Sep 14 23:07:12 2017
     13// Update Count     : 2815
    1414//
    1515
     
    4343#define YYDEBUG_LEXER_TEXT (yylval)                                             // lexer loads this up each time
    4444#define YYDEBUG 1                                                                               // get the pretty debugging code to compile
    45 #define YYERROR_VERBOSE                                                                 // more information in syntax errors
     45#define YYERROR_VERBOSE
    4646
    4747#undef __GNUC_MINOR__
     
    117117bool forall = false;                                                                    // aggregate have one or more forall qualifiers ?
    118118
    119 // https://www.gnu.org/software/bison/manual/bison.html#Location-Type
    120 #define YYLLOC_DEFAULT(Cur, Rhs, N)                                                                                             \
    121 if ( N ) {                                                                                                                                              \
    122         (Cur).first_line   = YYRHSLOC( Rhs, 1 ).first_line;                                                     \
    123         (Cur).first_column = YYRHSLOC( Rhs, 1 ).first_column;                                           \
    124         (Cur).last_line    = YYRHSLOC( Rhs, N ).last_line;                                                      \
    125         (Cur).last_column  = YYRHSLOC( Rhs, N ).last_column;                                            \
    126         (Cur).filename     = YYRHSLOC( Rhs, 1 ).filename;                                                       \
    127 } else {                                                                                                                                                \
    128         (Cur).first_line   = (Cur).last_line = YYRHSLOC( Rhs, 0 ).last_line;            \
    129         (Cur).first_column = (Cur).last_column = YYRHSLOC( Rhs, 0 ).last_column;        \
    130         (Cur).filename     = YYRHSLOC( Rhs, 0 ).filename;                                                       \
    131 }
     119# define YYLLOC_DEFAULT(Cur, Rhs, N)                            \
     120do                                                              \
     121        if (N) {                                                      \
     122                (Cur).first_line   = YYRHSLOC(Rhs, 1).first_line;           \
     123                (Cur).first_column = YYRHSLOC(Rhs, 1).first_column;         \
     124                (Cur).last_line    = YYRHSLOC(Rhs, N).last_line;            \
     125                (Cur).last_column  = YYRHSLOC(Rhs, N).last_column;          \
     126                (Cur).filename     = YYRHSLOC(Rhs, 1).filename;             \
     127        } else {                                                      \
     128                (Cur).first_line   = (Cur).last_line   =                    \
     129                        YYRHSLOC(Rhs, 0).last_line;                               \
     130                (Cur).first_column = (Cur).last_column =                    \
     131                        YYRHSLOC(Rhs, 0).last_column;                             \
     132                (Cur).filename     = YYRHSLOC(Rhs, 0).filename;             \
     133        }                                                             \
     134while (0)
    132135%}
    133136
    134137%define parse.error verbose
    135138
    136 // Types declaration for productions
     139// Types declaration
    137140%union
    138141{
     
    170173%token VOID CHAR SHORT INT LONG FLOAT DOUBLE SIGNED UNSIGNED
    171174%token BOOL COMPLEX IMAGINARY                                                   // C99
    172 %token INT128 FLOAT80 FLOAT128                                                  // GCC
    173175%token ZERO_T ONE_T                                                                             // CFA
    174176%token VALIST                                                                                   // GCC
     
    180182%token ATTRIBUTE EXTENSION                                                              // GCC
    181183%token IF ELSE SWITCH CASE DEFAULT DO WHILE FOR BREAK CONTINUE GOTO RETURN
    182 %token CHOOSE DISABLE ENABLE FALLTHRU FALLTHROUGH TRY CATCH CATCHRESUME FINALLY THROW THROWRESUME AT WITH WHEN WAITFOR // CFA
     184%token CHOOSE DISABLE ENABLE FALLTHRU TRY CATCH CATCHRESUME FINALLY THROW THROWRESUME AT WITH WHEN WAITFOR // CFA
    183185%token ASM                                                                                              // C99, extension ISO/IEC 9899:1999 Section J.5.10(1)
    184186%token ALIGNAS ALIGNOF GENERIC STATICASSERT                             // C11
     
    250252%type<sn> exception_statement                   handler_clause                          finally_clause
    251253%type<catch_kind> handler_key
    252 %type<sn> mutex_statement
    253254%type<en> when_clause                                   when_clause_opt                         waitfor                                         timeout
    254255%type<sn> waitfor_statement
     
    362363%precedence ELSE        // token precedence for start of else clause in IF/WAITFOR statement
    363364
    364 %locations                      // support location tracking for error messages
     365%locations
    365366
    366367%start translation_unit                                                                 // parse-tree root
     
    457458        | '(' compound_statement ')'                                            // GCC, lambda expression
    458459                { $$ = new ExpressionNode( new StmtExpr( dynamic_cast< CompoundStmt * >(maybeMoveBuild< Statement >($2) ) ) ); }
     460        | primary_expression '{' argument_expression_list '}' // CFA, constructor call
     461                {
     462                        Token fn;
     463                        fn.str = new std::string( "?{}" );                      // location undefined - use location of '{'?
     464                        $$ = new ExpressionNode( new ConstructorExpr( build_func( new ExpressionNode( build_varref( fn ) ), (ExpressionNode *)( $1 )->set_last( $3 ) ) ) );
     465                }
    459466        | type_name '.' no_attr_identifier                                      // CFA, nested type
    460                 { throw SemanticError("Qualified names are currently unimplemented."); $$ = nullptr; }                                                          // FIX ME
     467                { $$ = nullptr; }                                                               // FIX ME
    461468        | type_name '.' '[' push field_list pop ']'                     // CFA, nested type / tuple field selector
    462                 { throw SemanticError("Qualified names are currently unimplemented."); $$ = nullptr; }                                                          // FIX ME
     469                { $$ = nullptr; }                                                               // FIX ME
    463470        ;
    464471
     
    471478                // equivalent to the old x[i,j].
    472479                { $$ = new ExpressionNode( build_binary_val( OperKinds::Index, $1, $4 ) ); }
    473         | postfix_expression '{' argument_expression_list '}' // CFA, constructor call
    474                 {
    475                         Token fn;
    476                         fn.str = new std::string( "?{}" );                      // location undefined - use location of '{'?
    477                         $$ = new ExpressionNode( new ConstructorExpr( build_func( new ExpressionNode( build_varref( fn ) ), (ExpressionNode *)( $1 )->set_last( $3 ) ) ) );
    478                 }
    479480        | postfix_expression '(' argument_expression_list ')'
    480481                { $$ = new ExpressionNode( build_func( $1, $3 ) ); }
     
    808809        | jump_statement
    809810        | with_statement
    810         | mutex_statement
    811811        | waitfor_statement
    812812        | exception_statement
     
    974974        ;
    975975
    976 fall_through_name:                                                                              // CFA
     976fall_through:                                                                                   // CFA
    977977        FALLTHRU
    978         | FALLTHROUGH
    979         ;
    980 
    981 fall_through:                                                                                   // CFA
    982         fall_through_name
    983978                { $$ = nullptr; }
    984         | fall_through_name ';'
     979        | FALLTHRU ';'
    985980                { $$ = nullptr; }
    986981        ;
     
    10381033        ;
    10391034
    1040 // If MUTEX becomes a general qualifier, there are shift/reduce conflicts, so change syntax to "with mutex".
    1041 mutex_statement:
    1042         MUTEX '(' argument_expression_list ')' statement
    1043                 { $$ = nullptr; }                                                               // FIX ME
    1044         ;
    1045 
    10461035when_clause:
    10471036        WHEN '(' comma_expression ')'
     
    15621551        | VOLATILE
    15631552                { $$ = DeclarationNode::newTypeQualifier( Type::Volatile ); }
     1553        | MUTEX
     1554                { $$ = DeclarationNode::newTypeQualifier( Type::Mutex ); }
    15641555        | ATOMIC
    15651556                { $$ = DeclarationNode::newTypeQualifier( Type::Atomic ); }
     
    16151606
    16161607basic_type_name:
    1617         VOID
     1608        CHAR
     1609                { $$ = DeclarationNode::newBasicType( DeclarationNode::Char ); }
     1610        | DOUBLE
     1611                { $$ = DeclarationNode::newBasicType( DeclarationNode::Double ); }
     1612        | FLOAT
     1613                { $$ = DeclarationNode::newBasicType( DeclarationNode::Float ); }
     1614        | INT
     1615                { $$ = DeclarationNode::newBasicType( DeclarationNode::Int ); }
     1616        | LONG
     1617                { $$ = DeclarationNode::newLength( DeclarationNode::Long ); }
     1618        | SHORT
     1619                { $$ = DeclarationNode::newLength( DeclarationNode::Short ); }
     1620        | SIGNED
     1621                { $$ = DeclarationNode::newSignedNess( DeclarationNode::Signed ); }
     1622        | UNSIGNED
     1623                { $$ = DeclarationNode::newSignedNess( DeclarationNode::Unsigned ); }
     1624        | VOID
    16181625                { $$ = DeclarationNode::newBasicType( DeclarationNode::Void ); }
    16191626        | BOOL                                                                                          // C99
    16201627                { $$ = DeclarationNode::newBasicType( DeclarationNode::Bool ); }
    1621         | CHAR
    1622                 { $$ = DeclarationNode::newBasicType( DeclarationNode::Char ); }
    1623         | INT
    1624                 { $$ = DeclarationNode::newBasicType( DeclarationNode::Int ); }
    1625         | INT128
    1626                 { $$ = DeclarationNode::newBasicType( DeclarationNode::Int128 ); }
    1627         | FLOAT
    1628                 { $$ = DeclarationNode::newBasicType( DeclarationNode::Float ); }
    1629         | FLOAT80
    1630                 { $$ = DeclarationNode::newBasicType( DeclarationNode::Float80 ); }
    1631         | FLOAT128
    1632                 { $$ = DeclarationNode::newBasicType( DeclarationNode::Float128 ); }
    1633         | DOUBLE
    1634                 { $$ = DeclarationNode::newBasicType( DeclarationNode::Double ); }
    16351628        | COMPLEX                                                                                       // C99
    16361629                { $$ = DeclarationNode::newComplexType( DeclarationNode::Complex ); }
    16371630        | IMAGINARY                                                                                     // C99
    16381631                { $$ = DeclarationNode::newComplexType( DeclarationNode::Imaginary ); }
    1639         | SIGNED
    1640                 { $$ = DeclarationNode::newSignedNess( DeclarationNode::Signed ); }
    1641         | UNSIGNED
    1642                 { $$ = DeclarationNode::newSignedNess( DeclarationNode::Unsigned ); }
    1643         | SHORT
    1644                 { $$ = DeclarationNode::newLength( DeclarationNode::Short ); }
    1645         | LONG
    1646                 { $$ = DeclarationNode::newLength( DeclarationNode::Long ); }
    16471632        | ZERO_T
    16481633                { $$ = DeclarationNode::newBuiltinType( DeclarationNode::Zero ); }
     
    24912476        | TYPEDEFname
    24922477        | TYPEGENname
    2493         | FALLTHROUGH
    2494                 { $$ = Token{ new string( "fallthrough" ), { nullptr, -1 } }; }
    24952478        | CONST
    24962479                { $$ = Token{ new string( "__const__" ), { nullptr, -1 } }; }
     
    27162699        paren_identifier attribute_list_opt
    27172700                { $$ = $1->addQualifiers( $2 ); }
    2718         | '&' MUTEX paren_identifier attribute_list_opt
    2719                 { $$ = $3->addPointer( DeclarationNode::newPointer( DeclarationNode::newTypeQualifier( Type::Mutex ), OperKinds::AddressOf ) )->addQualifiers( $4 ); }
    27202701        | identifier_parameter_ptr
    27212702        | identifier_parameter_array attribute_list_opt
     
    27582739//
    27592740//              typedef int foo;
    2760 //              forall( otype T ) struct foo;
    27612741//              int f( int foo ); // redefine typedef name in new scope
    27622742//
     
    27662746        typedef attribute_list_opt
    27672747                { $$ = $1->addQualifiers( $2 ); }
    2768         | '&' MUTEX typedef attribute_list_opt
    2769                 { $$ = $3->addPointer( DeclarationNode::newPointer( DeclarationNode::newTypeQualifier( Type::Mutex ), OperKinds::AddressOf ) )->addQualifiers( $4 ); }
    27702748        | type_parameter_ptr
    27712749        | type_parameter_array attribute_list_opt
     
    29142892abstract_parameter_declarator:
    29152893        abstract_parameter_ptr
    2916         | '&' MUTEX attribute_list_opt
    2917                 { $$ = DeclarationNode::newPointer( DeclarationNode::newTypeQualifier( Type::Mutex ), OperKinds::AddressOf )->addQualifiers( $3 ); }
    29182894        | abstract_parameter_array attribute_list_opt
    29192895                { $$ = $1->addQualifiers( $2 ); }
  • src/Parser/parserutility.cc

    r3f7e12cb r78315272  
    2929
    3030Expression *notZeroExpr( Expression *orig ) {
    31         if( !orig ) return nullptr;
    3231        UntypedExpr *comparison = new UntypedExpr( new NameExpr( "?!=?" ) );
    3332        comparison->get_args().push_back( orig );
  • src/ResolvExpr/AdjustExprType.cc

    r3f7e12cb r78315272  
    1414//
    1515
    16 #include "Common/PassVisitor.h"
    1716#include "SymTab/Indexer.h"       // for Indexer
    1817#include "SynTree/Declaration.h"  // for TypeDecl, TypeDecl::Kind::Ftype
     
    2221
    2322namespace ResolvExpr {
    24         class AdjustExprType : public WithShortCircuiting {
     23        class AdjustExprType : public Mutator {
     24                typedef Mutator Parent;
     25                using Parent::mutate;
    2526          public:
    2627                AdjustExprType( const TypeEnvironment &env, const SymTab::Indexer &indexer );
    27                 void premutate( VoidType * ) { visit_children = false; }
    28                 void premutate( BasicType * ) { visit_children = false; }
    29                 void premutate( PointerType * ) { visit_children = false; }
    30                 void premutate( ArrayType * ) { visit_children = false; }
    31                 void premutate( FunctionType * ) { visit_children = false; }
    32                 void premutate( StructInstType * ) { visit_children = false; }
    33                 void premutate( UnionInstType * ) { visit_children = false; }
    34                 void premutate( EnumInstType * ) { visit_children = false; }
    35                 void premutate( TraitInstType * ) { visit_children = false; }
    36                 void premutate( TypeInstType * ) { visit_children = false; }
    37                 void premutate( TupleType * ) { visit_children = false; }
    38                 void premutate( VarArgsType * ) { visit_children = false; }
    39                 void premutate( ZeroType * ) { visit_children = false; }
    40                 void premutate( OneType * ) { visit_children = false; }
     28          private:
     29                virtual Type* mutate( VoidType *voidType );
     30                virtual Type* mutate( BasicType *basicType );
     31                virtual Type* mutate( PointerType *pointerType );
     32                virtual Type* mutate( ArrayType *arrayType );
     33                virtual Type* mutate( FunctionType *functionType );
     34                virtual Type* mutate( StructInstType *aggregateUseType );
     35                virtual Type* mutate( UnionInstType *aggregateUseType );
     36                virtual Type* mutate( EnumInstType *aggregateUseType );
     37                virtual Type* mutate( TraitInstType *aggregateUseType );
     38                virtual Type* mutate( TypeInstType *aggregateUseType );
     39                virtual Type* mutate( TupleType *tupleType );
     40                virtual Type* mutate( VarArgsType *varArgsType );
     41                virtual Type* mutate( ZeroType *zeroType );
     42                virtual Type* mutate( OneType *oneType );
    4143
    42                 Type * postmutate( ArrayType *arrayType );
    43                 Type * postmutate( FunctionType *functionType );
    44                 Type * postmutate( TypeInstType *aggregateUseType );
    45 
    46           private:
    4744                const TypeEnvironment &env;
    4845                const SymTab::Indexer &indexer;
     
    5047
    5148        void adjustExprType( Type *&type, const TypeEnvironment &env, const SymTab::Indexer &indexer ) {
    52                 PassVisitor<AdjustExprType> adjuster( env, indexer );
     49                AdjustExprType adjuster( env, indexer );
    5350                Type *newType = type->acceptMutator( adjuster );
    5451                type = newType;
     
    5956        }
    6057
    61         Type * AdjustExprType::postmutate( ArrayType * arrayType ) {
    62                 PointerType *pointerType = new PointerType( arrayType->get_qualifiers(), arrayType->base );
    63                 arrayType->base = nullptr;
     58        Type *AdjustExprType::mutate( VoidType *voidType ) {
     59                return voidType;
     60        }
     61
     62        Type *AdjustExprType::mutate( BasicType *basicType ) {
     63                return basicType;
     64        }
     65
     66        Type *AdjustExprType::mutate( PointerType *pointerType ) {
     67                return pointerType;
     68        }
     69
     70        Type *AdjustExprType::mutate( ArrayType *arrayType ) {
     71                // need to recursively mutate the base type in order for multi-dimensional arrays to work.
     72                PointerType *pointerType = new PointerType( arrayType->get_qualifiers(), arrayType->get_base()->clone()->acceptMutator( *this ) );
    6473                delete arrayType;
    6574                return pointerType;
    6675        }
    6776
    68         Type * AdjustExprType::postmutate( FunctionType * functionType ) {
    69                 return new PointerType( Type::Qualifiers(), functionType );
     77        Type *AdjustExprType::mutate( FunctionType *functionType ) {
     78                PointerType *pointerType = new PointerType( Type::Qualifiers(), functionType );
     79                return pointerType;
    7080        }
    7181
    72         Type * AdjustExprType::postmutate( TypeInstType * typeInst ) {
     82        Type *AdjustExprType::mutate( StructInstType *aggregateUseType ) {
     83                return aggregateUseType;
     84        }
     85
     86        Type *AdjustExprType::mutate( UnionInstType *aggregateUseType ) {
     87                return aggregateUseType;
     88        }
     89
     90        Type *AdjustExprType::mutate( EnumInstType *aggregateUseType ) {
     91                return aggregateUseType;
     92        }
     93
     94        Type *AdjustExprType::mutate( TraitInstType *aggregateUseType ) {
     95                return aggregateUseType;
     96        }
     97
     98        Type *AdjustExprType::mutate( TypeInstType *typeInst ) {
    7399                EqvClass eqvClass;
    74100                if ( env.lookup( typeInst->get_name(), eqvClass ) ) {
     
    87113                return typeInst;
    88114        }
     115
     116        Type *AdjustExprType::mutate( TupleType *tupleType ) {
     117                return tupleType;
     118        }
     119
     120        Type *AdjustExprType::mutate( VarArgsType *varArgsType ) {
     121                return varArgsType;
     122        }
     123
     124        Type *AdjustExprType::mutate( ZeroType *zeroType ) {
     125                return zeroType;
     126        }
     127
     128        Type *AdjustExprType::mutate( OneType *oneType ) {
     129                return oneType;
     130        }
    89131} // namespace ResolvExpr
    90132
  • src/ResolvExpr/Alternative.cc

    r3f7e12cb r78315272  
    6666        }
    6767
    68         void Alternative::print( std::ostream &os, Indenter indent ) const {
    69                 os << "Cost " << cost << ": ";
     68        void Alternative::print( std::ostream &os, int indent ) const {
     69                os << std::string( indent, ' ' ) << "Cost " << cost << ": ";
    7070                if ( expr ) {
    71                         expr->print( os, indent+1 );
    72                         os << std::endl << indent << "(types:" << std::endl;
    73                         os << indent+1;
    74                         expr->result->print( os, indent+1 );
    75                         os << std::endl << indent << ")" << std::endl;
     71                        expr->print( os, indent );
     72                        os << "(types:" << std::endl;
     73                        os << std::string( indent+4, ' ' );
     74                        expr->get_result()->print( os, indent + 4 );
     75                        os << std::endl << ")" << std::endl;
    7676                } else {
    7777                        os << "Null expression!" << std::endl;
    7878                } // if
    79                 os << indent << "Environment: ";
    80                 env.print( os, indent+1 );
     79                os << std::string( indent, ' ' ) << "Environment: ";
     80                env.print( os, indent+2 );
    8181                os << std::endl;
    8282        }
  • src/ResolvExpr/Alternative.h

    r3f7e12cb r78315272  
    3939                ~Alternative();
    4040
    41                 void print( std::ostream &os, Indenter indent = {} ) const;
     41                void print( std::ostream &os, int indent = 0 ) const;
    4242
    4343                Cost cost;
  • src/ResolvExpr/AlternativeFinder.cc

    r3f7e12cb r78315272  
    7676
    7777        namespace {
    78                 void printAlts( const AltList &list, std::ostream &os, unsigned int indentAmt = 0 ) {
    79                         Indenter indent = { Indenter::tabsize, indentAmt };
     78                void printAlts( const AltList &list, std::ostream &os, int indent = 0 ) {
    8079                        for ( AltList::const_iterator i = list.begin(); i != list.end(); ++i ) {
    8180                                i->print( os, indent );
     
    123122                                                )
    124123                                                mapPlace->second.isAmbiguous = true;
    125                                         } else {
    126                                                 PRINT(
    127                                                         std::cerr << "cost " << candidate->cost << " loses to " << mapPlace->second.candidate->cost << std::endl;
    128                                                 )
    129124                                        }
    130125                                } else {
     
    132127                                }
    133128                        }
     129
     130                        PRINT(
     131                                std::cerr << "there are " << selected.size() << " alternatives before elimination" << std::endl;
     132                        )
    134133
    135134                        // accept the alternatives that were unambiguous
     
    146145                        expr->get_result()->accept( global_renamer );
    147146                }
     147
     148                void referenceToRvalueConversion( Expression *& expr ) {
     149                        if ( dynamic_cast< ReferenceType * >( expr->get_result() ) ) {
     150                                // cast away reference from expr
     151                                expr = new CastExpr( expr, expr->get_result()->stripReferences()->clone() );
     152                        }
     153                }
    148154        } // namespace
    149 
    150         void referenceToRvalueConversion( Expression *& expr ) {
    151                 if ( dynamic_cast< ReferenceType * >( expr->get_result() ) ) {
    152                         // cast away reference from expr
    153                         expr = new CastExpr( expr, expr->get_result()->stripReferences()->clone() );
    154                 }
    155         }
    156155
    157156        template< typename InputIterator, typename OutputIterator >
     
    176175        }
    177176
    178         void AlternativeFinder::find( Expression *expr, bool adjust, bool prune, bool failFast ) {
     177        void AlternativeFinder::find( Expression *expr, bool adjust, bool prune ) {
    179178                expr->accept( *this );
    180                 if ( failFast && alternatives.empty() ) {
     179                if ( alternatives.empty() ) {
    181180                        throw SemanticError( "No reasonable alternatives for expression ", expr );
    182181                }
     182                for ( AltList::iterator i = alternatives.begin(); i != alternatives.end(); ++i ) {
     183                        if ( adjust ) {
     184                                adjustExprType( i->expr->get_result(), i->env, indexer );
     185                        }
     186                }
    183187                if ( prune ) {
    184                         auto oldsize = alternatives.size();
    185188                        PRINT(
    186189                                std::cerr << "alternatives before prune:" << std::endl;
     
    189192                        AltList::iterator oldBegin = alternatives.begin();
    190193                        pruneAlternatives( alternatives.begin(), alternatives.end(), front_inserter( alternatives ) );
    191                         if ( failFast && alternatives.begin() == oldBegin ) {
     194                        if ( alternatives.begin() == oldBegin ) {
    192195                                std::ostringstream stream;
    193196                                AltList winners;
    194197                                findMinCost( alternatives.begin(), alternatives.end(), back_inserter( winners ) );
    195                                 stream << "Cannot choose between " << winners.size() << " alternatives for expression\n";
     198                                stream << "Cannot choose between " << winners.size() << " alternatives for expression ";
    196199                                expr->print( stream );
    197                                 stream << "Alternatives are:\n";
    198                                 printAlts( winners, stream, 1 );
     200                                stream << "Alternatives are:";
     201                                printAlts( winners, stream, 8 );
    199202                                throw SemanticError( stream.str() );
    200203                        }
    201204                        alternatives.erase( oldBegin, alternatives.end() );
    202                         PRINT(
    203                                 std::cerr << "there are " << oldsize << " alternatives before elimination" << std::endl;
    204                         )
    205205                        PRINT(
    206206                                std::cerr << "there are " << alternatives.size() << " alternatives after elimination" << std::endl;
    207207                        )
    208                 }
    209                 // adjust types after pruning so that types substituted by pruneAlternatives are correctly adjusted
    210                 for ( AltList::iterator i = alternatives.begin(); i != alternatives.end(); ++i ) {
    211                         if ( adjust ) {
    212                                 adjustExprType( i->expr->get_result(), i->env, indexer );
    213                         }
    214208                }
    215209
     
    221215        }
    222216
    223         void AlternativeFinder::findWithAdjustment( Expression *expr ) {
    224                 find( expr, true );
    225         }
    226 
    227         void AlternativeFinder::findWithoutPrune( Expression * expr ) {
    228                 find( expr, true, false );
    229         }
    230 
    231         void AlternativeFinder::maybeFind( Expression * expr ) {
    232                 find( expr, true, true, false );
     217        void AlternativeFinder::findWithAdjustment( Expression *expr, bool prune ) {
     218                find( expr, true, prune );
    233219        }
    234220
     
    313299                Cost convCost = conversionCost( actualType, formalType, indexer, env );
    314300                PRINT(
    315                         std::cerr << std::endl << "cost is " << convCost << std::endl;
     301                        std::cerr << std::endl << "cost is" << convCost << std::endl;
    316302                )
    317303                if ( convCost == Cost::infinity ) {
     
    319305                }
    320306                convCost.incPoly( polyCost( formalType, env, indexer ) + polyCost( actualType, env, indexer ) );
    321                 PRINT(
    322                         std::cerr << "cost with polycost is " << convCost << std::endl;
    323                 )
    324307                return convCost;
    325308        }
     
    327310        Cost computeExpressionConversionCost( Expression *& actualExpr, Type * formalType, const SymTab::Indexer &indexer, const TypeEnvironment & env ) {
    328311                Cost convCost = computeConversionCost( actualExpr->result, formalType, indexer, env );
    329 
    330                 // if there is a non-zero conversion cost, ignoring poly cost, then the expression requires conversion.
    331                 // ignore poly cost for now, since this requires resolution of the cast to infer parameters and this
    332                 // does not currently work for the reason stated below.
     312                // if ( convCost != Cost::zero ) {
     313
     314                // xxx - temporary -- ignore poly cost, since this causes some polymorphic functions to be cast, which causes the specialize
     315                // pass to try to specialize them, which currently does not work. Once that is fixed, remove the next 3 lines and uncomment the
     316                // previous line.
    333317                Cost tmpCost = convCost;
    334318                tmpCost.incPoly( -tmpCost.get_polyCost() );
     
    373357                                if ( function->get_isVarArgs() ) {
    374358                                        convCost.incUnsafe();
    375                                         PRINT( std::cerr << "end of formals with varargs function: inc unsafe: " << convCost << std::endl; ; )
    376359                                        // convert reference-typed expressions to value-typed expressions
    377360                                        referenceToRvalueConversion( *actualExpr );
     
    382365                        }
    383366                        Type * formalType = (*formal)->get_type();
     367                        PRINT(
     368                                std::cerr << std::endl << "converting ";
     369                                actualType->print( std::cerr, 8 );
     370                                std::cerr << std::endl << " to ";
     371                                formalType->print( std::cerr, 8 );
     372                                std::cerr << std::endl << "environment is: ";
     373                                alt.env.print( std::cerr, 8 );
     374                                std::cerr << std::endl;
     375                        )
    384376                        convCost += computeExpressionConversionCost( *actualExpr, formalType, indexer, alt.env );
    385377                        ++formal; // can't be in for-loop update because of the continue
     
    489481                                Alternative newerAlt( newAlt );
    490482                                newerAlt.env = newEnv;
    491                                 assertf( (*candidate)->get_uniqueId(), "Assertion candidate does not have a unique ID: %s", toString( *candidate ).c_str() );
     483                                assert( (*candidate)->get_uniqueId() );
    492484                                DeclarationWithType *candDecl = static_cast< DeclarationWithType* >( Declaration::declFromId( (*candidate)->get_uniqueId() ) );
    493485
     
    515507                                        std::cerr << std::endl;
    516508                                )
     509                                ApplicationExpr *appExpr = static_cast< ApplicationExpr* >( newerAlt.expr );
    517510                                // follow the current assertion's ID chain to find the correct set of inferred parameters to add the candidate to (i.e. the set of inferred parameters belonging to the entity which requested the assertion parameter).
    518                                 InferredParams * inferParameters = &newerAlt.expr->get_inferParams();
     511                                InferredParams * inferParameters = &appExpr->get_inferParams();
    519512                                for ( UniqueId id : cur->second.idChain ) {
    520513                                        inferParameters = (*inferParameters)[ id ].inferParams.get();
     
    793786               
    794787                return ! results.empty();
    795         }       
     788        }
    796789
    797790        template<typename OutputIterator>
    798         void AlternativeFinder::makeFunctionAlternatives( const Alternative &func,
    799                         FunctionType *funcType, const std::vector< AlternativeFinder > &args,
     791        void AlternativeFinder::makeFunctionAlternatives( const Alternative& func,
     792                        FunctionType* funcType, const std::vector< AlternativeFinder >& args,
    800793                        OutputIterator out ) {
    801794                OpenVarSet funcOpenVars;
    802795                AssertionSet funcNeed, funcHave;
    803                 TypeEnvironment funcEnv( func.env );
     796                TypeEnvironment funcEnv;
    804797                makeUnifiableVars( funcType, funcOpenVars, funcNeed );
    805798                // add all type variables as open variables now so that those not used in the parameter
    806799                // list are still considered open.
    807800                funcEnv.add( funcType->get_forall() );
    808                
     801
    809802                if ( targetType && ! targetType->isVoid() && ! funcType->get_returnVals().empty() ) {
    810803                        // attempt to narrow based on expected target type
    811                         Type * returnType = funcType->get_returnVals().front()->get_type();
     804                        Type* returnType = funcType->get_returnVals().front()->get_type();
    812805                        if ( ! unify( returnType, targetType, funcEnv, funcNeed, funcHave, funcOpenVars,
    813806                                        indexer ) ) {
     
    912905
    913906                // find function operators
    914                 static NameExpr *opExpr = new NameExpr( "?()" );
    915907                AlternativeFinder funcOpFinder( indexer, env );
    916                 // it's ok if there aren't any defined function ops
    917                 funcOpFinder.maybeFind( opExpr);
     908                NameExpr *opExpr = new NameExpr( "?()" );
     909                try {
     910                        funcOpFinder.findWithAdjustment( opExpr );
     911                } catch( SemanticError &e ) {
     912                        // it's ok if there aren't any defined function ops
     913                }
    918914                PRINT(
    919915                        std::cerr << "known function ops:" << std::endl;
    920                         printAlts( funcOpFinder.alternatives, std::cerr, 1 );
     916                        printAlts( funcOpFinder.alternatives, std::cerr, 8 );
    921917                )
    922918
     
    10321028        bool isLvalue( Expression *expr ) {
    10331029                // xxx - recurse into tuples?
    1034                 return expr->result && ( expr->get_result()->get_lvalue() || dynamic_cast< ReferenceType * >( expr->get_result() ) );
     1030                return expr->has_result() && ( expr->get_result()->get_lvalue() || dynamic_cast< ReferenceType * >( expr->get_result() ) );
    10351031        }
    10361032
     
    11071103                                thisCost.incSafe( discardedValues );
    11081104                                Alternative newAlt( restructureCast( i->expr->clone(), toType ), i->env, i->cost, thisCost );
    1109                                 inferParameters( needAssertions, haveAssertions, newAlt, openVars, back_inserter( candidates ) );
     1105                                // xxx - this doesn't work at the moment, since inferParameters requires an ApplicationExpr as the alternative.
     1106                                // Once this works, it should be possible to infer parameters on a cast expression and specialize any function.
     1107
     1108                                // inferParameters( needAssertions, haveAssertions, newAlt, openVars, back_inserter( candidates ) );
     1109                                candidates.emplace_back( std::move( newAlt ) );
    11101110                        } // if
    11111111                } // for
     
    11231123                AlternativeFinder finder( indexer, env );
    11241124                // don't prune here, since it's guaranteed all alternatives will have the same type
    1125                 finder.findWithoutPrune( castExpr->get_arg() );
     1125                // (giving the alternatives different types is half of the point of ConstructorExpr nodes)
     1126                finder.findWithAdjustment( castExpr->get_arg(), false );
    11261127                for ( Alternative & alt : finder.alternatives ) {
    11271128                        alternatives.push_back( Alternative(
     
    11621163                PRINT( std::cerr << "nameExpr is " << nameExpr->get_name() << std::endl; )
    11631164                for ( std::list< DeclarationWithType* >::iterator i = declList.begin(); i != declList.end(); ++i ) {
    1164                         VariableExpr newExpr( *i );
     1165                        VariableExpr newExpr( *i, nameExpr->get_argName() );
    11651166                        alternatives.push_back( Alternative( newExpr.clone(), env, Cost::zero ) );
    11661167                        PRINT(
     
    13971398                findSubExprs( tupleExpr->get_exprs().begin(), tupleExpr->get_exprs().end(), back_inserter( subExprAlternatives ) );
    13981399                std::list< AltList > possibilities;
     1400                // TODO re-write to use iterative method
    13991401                combos( subExprAlternatives.begin(), subExprAlternatives.end(), back_inserter( possibilities ) );
    14001402                for ( std::list< AltList >::const_iterator i = possibilities.begin(); i != possibilities.end(); ++i ) {
     
    14201422                // don't prune here, since it's guaranteed all alternatives will have the same type
    14211423                // (giving the alternatives different types is half of the point of ConstructorExpr nodes)
    1422                 finder.findWithoutPrune( ctorExpr->get_callExpr() );
     1424                finder.findWithAdjustment( ctorExpr->get_callExpr(), false );
    14231425                for ( Alternative & alt : finder.alternatives ) {
    14241426                        alternatives.push_back( Alternative( new ConstructorExpr( alt.expr->clone() ), alt.env, alt.cost ) );
     
    14571459                // O(N^2) checks of d-types with e-types
    14581460                for ( InitAlternative & initAlt : initExpr->get_initAlts() ) {
    1459                         Type * toType = resolveTypeof( initAlt.type->clone(), indexer );
     1461                        Type * toType = resolveTypeof( initAlt.type, indexer );
    14601462                        SymTab::validateType( toType, &indexer );
    14611463                        adjustExprType( toType, env, indexer );
     
    14861488                                        // count one safe conversion for each value that is thrown away
    14871489                                        thisCost.incSafe( discardedValues );
    1488                                         Alternative newAlt( new InitExpr( restructureCast( alt.expr->clone(), toType ), initAlt.designation->clone() ), newEnv, alt.cost, thisCost );
    1489                                         inferParameters( needAssertions, haveAssertions, newAlt, openVars, back_inserter( candidates ) );
     1490                                        candidates.push_back( Alternative( new InitExpr( restructureCast( alt.expr->clone(), toType ), initAlt.designation->clone() ), newEnv, alt.cost, thisCost ) );
    14901491                                }
    14911492                        }
  • src/ResolvExpr/AlternativeFinder.h

    r3f7e12cb r78315272  
    6161                }
    6262
    63                 void find( Expression *expr, bool adjust = false, bool prune = true, bool failFast = true );
     63                void find( Expression *expr, bool adjust = false, bool prune = true );
    6464                /// Calls find with the adjust flag set; adjustment turns array and function types into equivalent pointer types
    65                 void findWithAdjustment( Expression *expr );
    66                 /// Calls find with the adjust flag set and prune flag unset; pruning ensures there is at most one alternative per result type
    67                 void findWithoutPrune( Expression *expr );
    68                 /// Calls find with the adjust and prune flags set, failFast flags unset; fail fast ensures that there is at least one resulting alternative
    69                 void maybeFind( Expression *expr );
     65                void findWithAdjustment( Expression *expr, bool prune = true );
    7066                AltList &get_alternatives() { return alternatives; }
    7167
     
    8177                const SymTab::Indexer &get_indexer() const { return indexer; }
    8278                const TypeEnvironment &get_environ() const { return env; }
    83 
    84                 /// Runs a new alternative finder on each element in [begin, end)
    85                 /// and writes each alternative finder to out.
    86                 template< typename InputIterator, typename OutputIterator >
    87                 void findSubExprs( InputIterator begin, InputIterator end, OutputIterator out );
    8879          private:
    8980                virtual void visit( ApplicationExpr *applicationExpr );
     
    117108                virtual void visit( StmtExpr *stmtExpr );
    118109                virtual void visit( UntypedInitExpr *initExpr );
     110                /// Runs a new alternative finder on each element in [begin, end)
     111                /// and writes each alternative finder to out.
     112                template< typename InputIterator, typename OutputIterator >
     113                void findSubExprs( InputIterator begin, InputIterator end, OutputIterator out );
    119114
    120115                /// Adds alternatives for anonymous members
     
    139134
    140135        Expression *resolveInVoidContext( Expression *expr, const SymTab::Indexer &indexer, TypeEnvironment &env );
    141         void referenceToRvalueConversion( Expression *& expr );
    142136
    143137        template< typename InputIterator, typename OutputIterator >
  • src/ResolvExpr/CastCost.cc

    r3f7e12cb r78315272  
    2424#include "typeops.h"                     // for typesCompatibleIgnoreQualifiers
    2525
    26 #if 0
    27 #define PRINT(x) x
    28 #else
    29 #define PRINT(x)
    30 #endif
    3126
    3227namespace ResolvExpr {
     
    5752                        } // if
    5853                } // if
    59 
    60                 PRINT(
    61                         std::cerr << "castCost ::: src is ";
    62                         src->print( std::cerr );
    63                         std::cerr << std::endl << "dest is ";
    64                         dest->print( std::cerr );
    65                         std::cerr << std::endl << "env is" << std::endl;
    66                         env.print( std::cerr, 8 );
    67                 )
    68 
    6954                if ( typesCompatibleIgnoreQualifiers( src, dest, indexer, env ) ) {
    70                         PRINT( std::cerr << "compatible!" << std::endl; )
    7155                        return Cost::zero;
    7256                } else if ( dynamic_cast< VoidType* >( dest ) ) {
    7357                        return Cost::safe;
    7458                } else if ( ReferenceType * refType = dynamic_cast< ReferenceType * > ( dest ) ) {
    75                         PRINT( std::cerr << "conversionCost: dest is reference" << std::endl; )
    7659                        return convertToReferenceCost( src, refType, indexer, env, [](Type * t1, Type * t2, const TypeEnvironment & env, const SymTab::Indexer & indexer) {
    7760                                return ptrsCastable( t1, t2, env, indexer );
  • src/ResolvExpr/CommonType.cc

    r3f7e12cb r78315272  
    1010// Created On       : Sun May 17 06:59:27 2015
    1111// Last Modified By : Peter A. Buhr
    12 // Last Modified On : Mon Sep 25 15:18:17 2017
    13 // Update Count     : 9
     12// Last Modified On : Thu Mar 16 16:24:31 2017
     13// Update Count     : 7
    1414//
    1515
     
    6161        };
    6262
    63         Type * handleReference( Type * t1, Type * t2, bool widenFirst, bool widenSecond, const SymTab::Indexer &indexer, TypeEnvironment & env, const OpenVarSet &openVars ) {
    64                 Type * common = nullptr;
     63        Type * handleReference( ReferenceType * refType, Type * other, bool widenFirst, bool widenSecond, const SymTab::Indexer &indexer, TypeEnvironment & env, const OpenVarSet &openVars ) {
     64                Type * result = nullptr, * common = nullptr;
    6565                AssertionSet have, need;
    6666                OpenVarSet newOpen( openVars );
    6767                // need unify to bind type variables
    68                 if ( unify( t1, t2, env, have, need, newOpen, indexer, common ) ) {
    69                         // std::cerr << "unify success: " << widenFirst << " " << widenSecond << std::endl;
    70                         if ( (widenFirst || t2->get_qualifiers() <= t1->get_qualifiers()) && (widenSecond || t1->get_qualifiers() <= t2->get_qualifiers()) ) {
    71                                 // std::cerr << "widen okay" << std::endl;
    72                                 common->get_qualifiers() |= t1->get_qualifiers();
    73                                 common->get_qualifiers() |= t2->get_qualifiers();
    74                                 return common;
    75                         }
    76                 }
    77                 // std::cerr << "exact unify failed: " << t1 << " " << t2 << std::endl;
    78                 return nullptr;
     68                if ( unify( refType->get_base(), other, env, have, need, newOpen, indexer, common ) ) {
     69                        // std::cerr << "unify success" << std::endl;
     70                        if ( widenSecond ) {
     71                                // std::cerr << "widen second" << std::endl;
     72                                if ( widenFirst || other->get_qualifiers() <= refType->get_qualifiers() ) {
     73                                        result = new ReferenceType( refType->get_qualifiers(), common ); // refType->clone();
     74                                        result->get_qualifiers() |= other->get_qualifiers();
     75                                }
     76                        } else if ( widenFirst ) {
     77                                // std::cerr << "widen first" << std::endl;
     78                                if ( widenSecond || refType->get_qualifiers() <= other->get_qualifiers() ) {
     79                                        result = common;
     80                                        result->get_qualifiers() |= refType->get_qualifiers();
     81                                }
     82                        }
     83                } else {
     84                        // std::cerr << "exact unify failed: " << refType << " " << other << std::endl;
     85                }
     86                // std::cerr << "common type of reference [" << refType << "] and non-reference [" << other << "] is [" << result << "]" << std::endl;
     87                return result;
    7988        }
    8089
     
    9099
    91100                        // special case where one type has a reference depth of 1 larger than the other
    92                         if ( diff > 0 || diff < 0 ) {
    93                                 Type * result = nullptr;
    94                                 if ( ReferenceType * ref1 = dynamic_cast< ReferenceType * >( type1 ) ) {
    95                                         // formal is reference, so result should be reference
    96                                         result = handleReference( ref1->base, type2, widenFirst, widenSecond, indexer, env, openVars );
    97                                         if ( result ) result = new ReferenceType( ref1->get_qualifiers(), result );
    98                                 } else {
    99                                         // formal is value, so result should be value
    100                                         ReferenceType * ref2 = strict_dynamic_cast< ReferenceType * > ( type2 );
    101                                         result = handleReference( type1, ref2->base, widenFirst, widenSecond, indexer, env, openVars );
    102                                 }
    103                                 // std::cerr << "common type of reference [" << type1 << "] and [" << type2 << "] is [" << result << "]" << std::endl;
    104                                 return result;
     101                        if ( diff > 0 ) {
     102                                return handleReference( strict_dynamic_cast<ReferenceType *>( type1 ), type2, widenFirst, widenSecond, indexer, env, openVars );
     103                        } else if ( diff < 0 ) {
     104                                return handleReference( strict_dynamic_cast<ReferenceType *>( type2 ), type1, widenSecond, widenFirst, indexer, env, openVars );
    105105                        }
    106106                        // otherwise, both are reference types of the same depth and this is handled by the CommonType visitor.
     
    150150        static const BasicType::Kind combinedType[ BasicType::NUMBER_OF_BASIC_TYPES ][ BasicType::NUMBER_OF_BASIC_TYPES ] =
    151151        {
    152 /*              Bool            Char    SignedChar      UnsignedChar    ShortSignedInt  ShortUnsignedInt        SignedInt       UnsignedInt     LongSignedInt   LongUnsignedInt LongLongSignedInt       LongLongUnsignedInt     Float   Double  LongDouble      FloatComplex    DoubleComplex   LongDoubleComplex       FloatImaginary  DoubleImaginary LongDoubleImaginary   SignedInt128   UnsignedInt128 */
    153                 /* Bool */      { BasicType::Bool,              BasicType::Char,        BasicType::SignedChar,  BasicType::UnsignedChar,        BasicType::ShortSignedInt,      BasicType::ShortUnsignedInt,    BasicType::SignedInt,   BasicType::UnsignedInt, BasicType::LongSignedInt,       BasicType::LongUnsignedInt,     BasicType::LongLongSignedInt,   BasicType::LongLongUnsignedInt, BasicType::Float,       BasicType::Double,      BasicType::LongDouble,  BasicType::FloatComplex,        BasicType::DoubleComplex,       BasicType::LongDoubleComplex,   BasicType::FloatComplex,        BasicType::DoubleComplex,       BasicType::LongDoubleComplex,   BasicType::SignedInt128,        BasicType::UnsignedInt128, },
    154                 /* Char */      { BasicType::Char,              BasicType::Char,        BasicType::UnsignedChar,        BasicType::UnsignedChar,        BasicType::ShortSignedInt,      BasicType::ShortUnsignedInt,    BasicType::SignedInt,   BasicType::UnsignedInt, BasicType::LongSignedInt,       BasicType::LongUnsignedInt,     BasicType::LongLongSignedInt,   BasicType::LongLongUnsignedInt, BasicType::Float,       BasicType::Double,      BasicType::LongDouble,  BasicType::FloatComplex,        BasicType::DoubleComplex,       BasicType::LongDoubleComplex,   BasicType::FloatComplex,        BasicType::DoubleComplex,       BasicType::LongDoubleComplex,   BasicType::SignedInt128,        BasicType::UnsignedInt128, },
    155                 /* SignedChar */        { BasicType::SignedChar,        BasicType::UnsignedChar,        BasicType::SignedChar,  BasicType::UnsignedChar,        BasicType::ShortSignedInt,      BasicType::ShortUnsignedInt,    BasicType::SignedInt,   BasicType::UnsignedInt, BasicType::LongSignedInt,       BasicType::LongUnsignedInt,     BasicType::LongLongSignedInt,   BasicType::LongLongUnsignedInt, BasicType::Float,       BasicType::Double,      BasicType::LongDouble,  BasicType::FloatComplex,        BasicType::DoubleComplex,       BasicType::LongDoubleComplex,   BasicType::FloatComplex,        BasicType::DoubleComplex,       BasicType::LongDoubleComplex,   BasicType::SignedInt128,        BasicType::UnsignedInt128, },
    156                 /* UnsignedChar */      { BasicType::UnsignedChar,      BasicType::UnsignedChar,        BasicType::UnsignedChar,        BasicType::UnsignedChar,        BasicType::ShortSignedInt,      BasicType::ShortUnsignedInt,    BasicType::SignedInt,   BasicType::UnsignedInt, BasicType::LongSignedInt,       BasicType::LongUnsignedInt,     BasicType::LongLongSignedInt,   BasicType::LongLongUnsignedInt, BasicType::Float,       BasicType::Double,      BasicType::LongDouble,  BasicType::FloatComplex,        BasicType::DoubleComplex,       BasicType::LongDoubleComplex,   BasicType::FloatComplex,        BasicType::DoubleComplex,       BasicType::LongDoubleComplex,   BasicType::SignedInt128,        BasicType::UnsignedInt128, },
    157                 /* ShortSignedInt */    { BasicType::ShortSignedInt,    BasicType::ShortSignedInt,      BasicType::ShortSignedInt,      BasicType::ShortSignedInt,      BasicType::ShortSignedInt,      BasicType::ShortUnsignedInt,    BasicType::SignedInt,   BasicType::UnsignedInt, BasicType::LongSignedInt,       BasicType::LongUnsignedInt,     BasicType::LongLongSignedInt,   BasicType::LongLongUnsignedInt, BasicType::Float,       BasicType::Double,      BasicType::LongDouble,  BasicType::FloatComplex,        BasicType::DoubleComplex,       BasicType::LongDoubleComplex,   BasicType::FloatComplex,        BasicType::DoubleComplex,       BasicType::LongDoubleComplex,   BasicType::SignedInt128,        BasicType::UnsignedInt128, },
    158                 /* ShortUnsignedInt */  { BasicType::ShortUnsignedInt,  BasicType::ShortUnsignedInt,    BasicType::ShortUnsignedInt,    BasicType::ShortUnsignedInt,    BasicType::ShortUnsignedInt,    BasicType::ShortUnsignedInt,    BasicType::SignedInt,   BasicType::UnsignedInt, BasicType::LongSignedInt,       BasicType::LongUnsignedInt,     BasicType::LongLongSignedInt,   BasicType::LongLongUnsignedInt, BasicType::Float,       BasicType::Double,      BasicType::LongDouble,  BasicType::FloatComplex,        BasicType::DoubleComplex,       BasicType::LongDoubleComplex,   BasicType::FloatComplex,        BasicType::DoubleComplex,       BasicType::LongDoubleComplex,   BasicType::SignedInt128,        BasicType::UnsignedInt128, },
    159                 /* SignedInt */         { BasicType::SignedInt,         BasicType::SignedInt,   BasicType::SignedInt,   BasicType::SignedInt,   BasicType::SignedInt,   BasicType::SignedInt,   BasicType::SignedInt,   BasicType::UnsignedInt, BasicType::LongSignedInt,       BasicType::LongUnsignedInt,     BasicType::LongLongSignedInt,   BasicType::LongLongUnsignedInt, BasicType::Float,       BasicType::Double,      BasicType::LongDouble,  BasicType::FloatComplex,        BasicType::DoubleComplex,       BasicType::LongDoubleComplex,   BasicType::FloatComplex,        BasicType::DoubleComplex,       BasicType::LongDoubleComplex,   BasicType::SignedInt128,        BasicType::UnsignedInt128, },
    160                 /* UnsignedInt */       { BasicType::UnsignedInt,               BasicType::UnsignedInt, BasicType::UnsignedInt, BasicType::UnsignedInt, BasicType::UnsignedInt, BasicType::UnsignedInt, BasicType::UnsignedInt, BasicType::UnsignedInt, BasicType::LongUnsignedInt,     BasicType::LongUnsignedInt,     BasicType::LongLongSignedInt,   BasicType::LongLongUnsignedInt, BasicType::Float,       BasicType::Double,      BasicType::LongDouble,  BasicType::FloatComplex,        BasicType::DoubleComplex,       BasicType::LongDoubleComplex,   BasicType::FloatComplex,        BasicType::DoubleComplex,       BasicType::LongDoubleComplex,   BasicType::SignedInt128,        BasicType::UnsignedInt128, },
    161                 /* LongSignedInt */     { BasicType::LongSignedInt,             BasicType::LongSignedInt,       BasicType::LongSignedInt,       BasicType::LongSignedInt,       BasicType::LongSignedInt,       BasicType::LongSignedInt,       BasicType::LongSignedInt,       BasicType::LongUnsignedInt,     BasicType::LongSignedInt,       BasicType::LongUnsignedInt,     BasicType::LongLongSignedInt,   BasicType::LongLongUnsignedInt, BasicType::Float,       BasicType::Double,      BasicType::LongDouble,  BasicType::FloatComplex,        BasicType::DoubleComplex,       BasicType::LongDoubleComplex,   BasicType::FloatComplex,        BasicType::DoubleComplex,       BasicType::LongDoubleComplex,   BasicType::SignedInt128,        BasicType::UnsignedInt128, },
    162                 /* LongUnsignedInt */   { BasicType::LongUnsignedInt,   BasicType::LongUnsignedInt,     BasicType::LongUnsignedInt,     BasicType::LongUnsignedInt,     BasicType::LongUnsignedInt,     BasicType::LongUnsignedInt,     BasicType::LongUnsignedInt,     BasicType::LongUnsignedInt,     BasicType::LongUnsignedInt,     BasicType::LongUnsignedInt,     BasicType::LongLongSignedInt,   BasicType::LongLongUnsignedInt, BasicType::Float,       BasicType::Double,      BasicType::LongDouble,  BasicType::FloatComplex,        BasicType::DoubleComplex,       BasicType::LongDoubleComplex,   BasicType::FloatComplex,        BasicType::DoubleComplex,       BasicType::LongDoubleComplex,   BasicType::SignedInt128,        BasicType::UnsignedInt128, },
    163                 /* LongLongSignedInt */         { BasicType::LongLongSignedInt, BasicType::LongLongSignedInt,   BasicType::LongLongSignedInt,   BasicType::LongLongSignedInt,   BasicType::LongLongSignedInt,   BasicType::LongLongSignedInt,   BasicType::LongLongSignedInt,   BasicType::LongLongSignedInt,   BasicType::LongLongSignedInt,   BasicType::LongLongSignedInt,   BasicType::LongLongSignedInt,   BasicType::LongLongUnsignedInt, BasicType::Float,       BasicType::Double,      BasicType::LongDouble,  BasicType::FloatComplex,        BasicType::DoubleComplex,       BasicType::LongDoubleComplex,   BasicType::FloatComplex,        BasicType::DoubleComplex,       BasicType::LongDoubleComplex,   BasicType::SignedInt128,        BasicType::UnsignedInt128, },
    164                 /* LongLongUnsignedInt */       { BasicType::LongLongUnsignedInt,       BasicType::LongLongUnsignedInt, BasicType::LongLongUnsignedInt, BasicType::LongLongUnsignedInt, BasicType::LongLongUnsignedInt, BasicType::LongLongUnsignedInt, BasicType::LongLongUnsignedInt, BasicType::LongLongUnsignedInt, BasicType::LongLongUnsignedInt, BasicType::LongLongUnsignedInt, BasicType::LongLongUnsignedInt, BasicType::LongLongUnsignedInt, BasicType::Float,       BasicType::Double,      BasicType::LongDouble,  BasicType::FloatComplex,        BasicType::DoubleComplex,       BasicType::LongDoubleComplex,   BasicType::FloatComplex,        BasicType::DoubleComplex,       BasicType::LongDoubleComplex,   BasicType::SignedInt128,        BasicType::UnsignedInt128, },
    165                 /* Float */     { BasicType::Float,     BasicType::Float,       BasicType::Float,       BasicType::Float,       BasicType::Float,       BasicType::Float,       BasicType::Float,       BasicType::Float,       BasicType::Float,       BasicType::Float,       BasicType::Float,       BasicType::Float,       BasicType::Float,       BasicType::Double,      BasicType::LongDouble,  BasicType::FloatComplex,        BasicType::DoubleComplex,       BasicType::LongDoubleComplex,   BasicType::FloatComplex,        BasicType::DoubleComplex,       BasicType::LongDoubleComplex,   BasicType::Float,       BasicType::Float, },
    166                 /* Double */    { BasicType::Double,    BasicType::Double,      BasicType::Double,      BasicType::Double,      BasicType::Double,      BasicType::Double,      BasicType::Double,      BasicType::Double,      BasicType::Double,      BasicType::Double,      BasicType::Double,      BasicType::Double,      BasicType::Double,      BasicType::Double,      BasicType::LongDouble,  BasicType::DoubleComplex,       BasicType::DoubleComplex,       BasicType::LongDoubleComplex,   BasicType::DoubleComplex,       BasicType::DoubleComplex,       BasicType::LongDoubleComplex,   BasicType::Double,      BasicType::Double, },
    167                 /* LongDouble */        { BasicType::LongDouble,                BasicType::LongDouble,  BasicType::LongDouble,  BasicType::LongDouble,  BasicType::LongDouble,  BasicType::LongDouble,  BasicType::LongDouble,  BasicType::LongDouble,  BasicType::LongDouble,  BasicType::LongDouble,  BasicType::LongDouble,  BasicType::LongDouble,  BasicType::LongDouble,  BasicType::LongDouble,  BasicType::LongDouble,  BasicType::LongDoubleComplex,   BasicType::LongDoubleComplex,   BasicType::LongDoubleComplex,   BasicType::LongDoubleComplex,   BasicType::LongDoubleComplex,   BasicType::LongDoubleComplex,   BasicType::LongDouble,  BasicType::LongDouble, },
    168                 /* FloatComplex */      { BasicType::FloatComplex,      BasicType::FloatComplex,        BasicType::FloatComplex,        BasicType::FloatComplex,        BasicType::FloatComplex,        BasicType::FloatComplex,        BasicType::FloatComplex,        BasicType::FloatComplex,        BasicType::FloatComplex,        BasicType::FloatComplex,        BasicType::FloatComplex,        BasicType::FloatComplex,        BasicType::FloatComplex,        BasicType::DoubleComplex,       BasicType::LongDoubleComplex,   BasicType::FloatComplex,        BasicType::DoubleComplex,       BasicType::LongDoubleComplex,   BasicType::FloatComplex,        BasicType::DoubleComplex,       BasicType::LongDoubleComplex,   BasicType::FloatComplex,        BasicType::FloatComplex, },
    169                 /* DoubleComplex */     { BasicType::DoubleComplex,     BasicType::DoubleComplex,       BasicType::DoubleComplex,       BasicType::DoubleComplex,       BasicType::DoubleComplex,       BasicType::DoubleComplex,       BasicType::DoubleComplex,       BasicType::DoubleComplex,       BasicType::DoubleComplex,       BasicType::DoubleComplex,       BasicType::DoubleComplex,       BasicType::DoubleComplex,       BasicType::DoubleComplex,       BasicType::DoubleComplex,       BasicType::LongDoubleComplex,   BasicType::DoubleComplex,       BasicType::DoubleComplex,       BasicType::LongDoubleComplex,   BasicType::DoubleComplex,       BasicType::DoubleComplex,       BasicType::LongDoubleComplex,   BasicType::DoubleComplex,       BasicType::DoubleComplex, },
    170                 /* LongDoubleComplex */         { BasicType::LongDoubleComplex, BasicType::LongDoubleComplex,   BasicType::LongDoubleComplex,   BasicType::LongDoubleComplex,   BasicType::LongDoubleComplex,   BasicType::LongDoubleComplex,   BasicType::LongDoubleComplex,   BasicType::LongDoubleComplex,   BasicType::LongDoubleComplex,   BasicType::LongDoubleComplex,   BasicType::LongDoubleComplex,   BasicType::LongDoubleComplex,   BasicType::LongDoubleComplex,   BasicType::LongDoubleComplex,   BasicType::LongDoubleComplex,   BasicType::LongDoubleComplex,   BasicType::LongDoubleComplex,   BasicType::LongDoubleComplex,   BasicType::LongDoubleComplex,   BasicType::LongDoubleComplex,   BasicType::LongDoubleComplex,   BasicType::LongDoubleComplex,   BasicType::LongDoubleComplex, },
    171                 /* FloatImaginary */    { BasicType::FloatComplex,      BasicType::FloatComplex,        BasicType::FloatComplex,        BasicType::FloatComplex,        BasicType::FloatComplex,        BasicType::FloatComplex,        BasicType::FloatComplex,        BasicType::FloatComplex,        BasicType::FloatComplex,        BasicType::FloatComplex,        BasicType::FloatComplex,        BasicType::FloatComplex,        BasicType::FloatComplex,        BasicType::DoubleComplex,       BasicType::LongDoubleComplex,   BasicType::FloatComplex,        BasicType::DoubleComplex,       BasicType::LongDoubleComplex,   BasicType::FloatImaginary,      BasicType::DoubleImaginary,     BasicType::LongDoubleImaginary, BasicType::FloatImaginary,      BasicType::FloatImaginary, },
    172                 /* DoubleImaginary */   { BasicType::DoubleComplex,     BasicType::DoubleComplex,       BasicType::DoubleComplex,       BasicType::DoubleComplex,       BasicType::DoubleComplex,       BasicType::DoubleComplex,       BasicType::DoubleComplex,       BasicType::DoubleComplex,       BasicType::DoubleComplex,       BasicType::DoubleComplex,       BasicType::DoubleComplex,       BasicType::DoubleComplex,       BasicType::DoubleComplex,       BasicType::DoubleComplex,       BasicType::LongDoubleComplex,   BasicType::DoubleComplex,       BasicType::DoubleComplex,       BasicType::LongDoubleComplex,   BasicType::DoubleImaginary,     BasicType::DoubleImaginary,     BasicType::LongDoubleImaginary, BasicType::DoubleImaginary,     BasicType::DoubleImaginary, },
    173                 /* LongDoubleImaginary */       { BasicType::LongDoubleComplex, BasicType::LongDoubleComplex,   BasicType::LongDoubleComplex,   BasicType::LongDoubleComplex,   BasicType::LongDoubleComplex,   BasicType::LongDoubleComplex,   BasicType::LongDoubleComplex,   BasicType::LongDoubleComplex,   BasicType::LongDoubleComplex,   BasicType::LongDoubleComplex,   BasicType::LongDoubleComplex,   BasicType::LongDoubleComplex,   BasicType::LongDoubleComplex,   BasicType::LongDoubleComplex,   BasicType::LongDoubleComplex,   BasicType::LongDoubleComplex,   BasicType::LongDoubleComplex,   BasicType::LongDoubleComplex,   BasicType::LongDoubleImaginary, BasicType::LongDoubleImaginary, BasicType::LongDoubleImaginary },
    174                 /* SignedInt128 */      { BasicType::SignedInt128,      BasicType::SignedInt128,        BasicType::SignedInt128,        BasicType::SignedInt128,        BasicType::SignedInt128,        BasicType::SignedInt128,        BasicType::SignedInt128,        BasicType::SignedInt128,        BasicType::SignedInt128,        BasicType::SignedInt128,        BasicType::SignedInt128,        BasicType::SignedInt128,        BasicType::Float,       BasicType::Double,      BasicType::LongDouble,  BasicType::FloatComplex,        BasicType::DoubleComplex,       BasicType::LongDoubleComplex,   BasicType::FloatComplex,        BasicType::DoubleComplex,       BasicType::LongDoubleComplex,   BasicType::SignedInt128,        BasicType::UnsignedInt128, },
    175                 /* UnsignedInt128 */    { BasicType::UnsignedInt128,    BasicType::UnsignedInt128,      BasicType::UnsignedInt128,      BasicType::UnsignedInt128,      BasicType::UnsignedInt128,      BasicType::UnsignedInt128,      BasicType::UnsignedInt128,      BasicType::UnsignedInt128,      BasicType::UnsignedInt128,      BasicType::UnsignedInt128,      BasicType::UnsignedInt128,      BasicType::UnsignedInt128,      BasicType::Float,       BasicType::Double,      BasicType::LongDouble,  BasicType::FloatComplex,        BasicType::DoubleComplex,       BasicType::LongDoubleComplex,   BasicType::FloatComplex,        BasicType::DoubleComplex,       BasicType::LongDoubleComplex,   BasicType::UnsignedInt128,      BasicType::UnsignedInt128, },
     152/*              Bool            Char    SignedChar      UnsignedChar    ShortSignedInt  ShortUnsignedInt        SignedInt       UnsignedInt     LongSignedInt   LongUnsignedInt LongLongSignedInt       LongLongUnsignedInt     Float   Double  LongDouble      FloatComplex    DoubleComplex   LongDoubleComplex       FloatImaginary  DoubleImaginary LongDoubleImaginary */
     153                /* Bool */      { BasicType::Bool,              BasicType::Char,        BasicType::SignedChar,  BasicType::UnsignedChar,        BasicType::ShortSignedInt,      BasicType::ShortUnsignedInt,    BasicType::SignedInt,   BasicType::UnsignedInt, BasicType::LongSignedInt,       BasicType::LongUnsignedInt,     BasicType::LongLongSignedInt,   BasicType::LongLongUnsignedInt, BasicType::Float,       BasicType::Double,      BasicType::LongDouble,  BasicType::FloatComplex,        BasicType::DoubleComplex,       BasicType::LongDoubleComplex,   BasicType::FloatComplex,        BasicType::DoubleComplex,       BasicType::LongDoubleComplex },
     154                /* Char */      { BasicType::Char,              BasicType::Char,        BasicType::UnsignedChar,        BasicType::UnsignedChar,        BasicType::ShortSignedInt,      BasicType::ShortUnsignedInt,    BasicType::SignedInt,   BasicType::UnsignedInt, BasicType::LongSignedInt,       BasicType::LongUnsignedInt,     BasicType::LongLongSignedInt,   BasicType::LongLongUnsignedInt, BasicType::Float,       BasicType::Double,      BasicType::LongDouble,  BasicType::FloatComplex,        BasicType::DoubleComplex,       BasicType::LongDoubleComplex,   BasicType::FloatComplex,        BasicType::DoubleComplex,       BasicType::LongDoubleComplex },
     155                /* SignedChar */        { BasicType::SignedChar,        BasicType::UnsignedChar,        BasicType::SignedChar,  BasicType::UnsignedChar,        BasicType::ShortSignedInt,      BasicType::ShortUnsignedInt,    BasicType::SignedInt,   BasicType::UnsignedInt, BasicType::LongSignedInt,       BasicType::LongUnsignedInt,     BasicType::LongLongSignedInt,   BasicType::LongLongUnsignedInt, BasicType::Float,       BasicType::Double,      BasicType::LongDouble,  BasicType::FloatComplex,        BasicType::DoubleComplex,       BasicType::LongDoubleComplex,   BasicType::FloatComplex,        BasicType::DoubleComplex,       BasicType::LongDoubleComplex },
     156                /* UnsignedChar */      { BasicType::UnsignedChar,      BasicType::UnsignedChar,        BasicType::UnsignedChar,        BasicType::UnsignedChar,        BasicType::ShortSignedInt,      BasicType::ShortUnsignedInt,    BasicType::SignedInt,   BasicType::UnsignedInt, BasicType::LongSignedInt,       BasicType::LongUnsignedInt,     BasicType::LongLongSignedInt,   BasicType::LongLongUnsignedInt, BasicType::Float,       BasicType::Double,      BasicType::LongDouble,  BasicType::FloatComplex,        BasicType::DoubleComplex,       BasicType::LongDoubleComplex,   BasicType::FloatComplex,        BasicType::DoubleComplex,       BasicType::LongDoubleComplex },
     157                /* ShortSignedInt */    { BasicType::ShortSignedInt,    BasicType::ShortSignedInt,      BasicType::ShortSignedInt,      BasicType::ShortSignedInt,      BasicType::ShortSignedInt,      BasicType::ShortUnsignedInt,    BasicType::SignedInt,   BasicType::UnsignedInt, BasicType::LongSignedInt,       BasicType::LongUnsignedInt,     BasicType::LongLongSignedInt,   BasicType::LongLongUnsignedInt, BasicType::Float,       BasicType::Double,      BasicType::LongDouble,  BasicType::FloatComplex,        BasicType::DoubleComplex,       BasicType::LongDoubleComplex,   BasicType::FloatComplex,        BasicType::DoubleComplex,       BasicType::LongDoubleComplex },
     158                /* ShortUnsignedInt */  { BasicType::ShortUnsignedInt,  BasicType::ShortUnsignedInt,    BasicType::ShortUnsignedInt,    BasicType::ShortUnsignedInt,    BasicType::ShortUnsignedInt,    BasicType::ShortUnsignedInt,    BasicType::SignedInt,   BasicType::UnsignedInt, BasicType::LongSignedInt,       BasicType::LongUnsignedInt,     BasicType::LongLongSignedInt,   BasicType::LongLongUnsignedInt, BasicType::Float,       BasicType::Double,      BasicType::LongDouble,  BasicType::FloatComplex,        BasicType::DoubleComplex,       BasicType::LongDoubleComplex,   BasicType::FloatComplex,        BasicType::DoubleComplex,       BasicType::LongDoubleComplex },
     159                /* SignedInt */         { BasicType::SignedInt,         BasicType::SignedInt,   BasicType::SignedInt,   BasicType::SignedInt,   BasicType::SignedInt,   BasicType::SignedInt,   BasicType::SignedInt,   BasicType::UnsignedInt, BasicType::LongSignedInt,       BasicType::LongUnsignedInt,     BasicType::LongLongSignedInt,   BasicType::LongLongUnsignedInt, BasicType::Float,       BasicType::Double,      BasicType::LongDouble,  BasicType::FloatComplex,        BasicType::DoubleComplex,       BasicType::LongDoubleComplex,   BasicType::FloatComplex,        BasicType::DoubleComplex,       BasicType::LongDoubleComplex },
     160                /* UnsignedInt */       { BasicType::UnsignedInt,               BasicType::UnsignedInt, BasicType::UnsignedInt, BasicType::UnsignedInt, BasicType::UnsignedInt, BasicType::UnsignedInt, BasicType::UnsignedInt, BasicType::UnsignedInt, BasicType::LongUnsignedInt,     BasicType::LongUnsignedInt,     BasicType::LongLongSignedInt,   BasicType::LongLongUnsignedInt, BasicType::Float,       BasicType::Double,      BasicType::LongDouble,  BasicType::FloatComplex,        BasicType::DoubleComplex,       BasicType::LongDoubleComplex,   BasicType::FloatComplex,        BasicType::DoubleComplex,       BasicType::LongDoubleComplex },
     161                /* LongSignedInt */     { BasicType::LongSignedInt,             BasicType::LongSignedInt,       BasicType::LongSignedInt,       BasicType::LongSignedInt,       BasicType::LongSignedInt,       BasicType::LongSignedInt,       BasicType::LongSignedInt,       BasicType::LongUnsignedInt,     BasicType::LongSignedInt,       BasicType::LongUnsignedInt,     BasicType::LongLongSignedInt,   BasicType::LongLongUnsignedInt, BasicType::Float,       BasicType::Double,      BasicType::LongDouble,  BasicType::FloatComplex,        BasicType::DoubleComplex,       BasicType::LongDoubleComplex,   BasicType::FloatComplex,        BasicType::DoubleComplex,       BasicType::LongDoubleComplex },
     162                /* LongUnsignedInt */   { BasicType::LongUnsignedInt,   BasicType::LongUnsignedInt,     BasicType::LongUnsignedInt,     BasicType::LongUnsignedInt,     BasicType::LongUnsignedInt,     BasicType::LongUnsignedInt,     BasicType::LongUnsignedInt,     BasicType::LongUnsignedInt,     BasicType::LongUnsignedInt,     BasicType::LongUnsignedInt,     BasicType::LongLongSignedInt,   BasicType::LongLongUnsignedInt, BasicType::Float,       BasicType::Double,      BasicType::LongDouble,  BasicType::FloatComplex,        BasicType::DoubleComplex,       BasicType::LongDoubleComplex,   BasicType::FloatComplex,        BasicType::DoubleComplex,       BasicType::LongDoubleComplex },
     163                /* LongLongSignedInt */         { BasicType::LongLongSignedInt, BasicType::LongLongSignedInt,   BasicType::LongLongSignedInt,   BasicType::LongLongSignedInt,   BasicType::LongLongSignedInt,   BasicType::LongLongSignedInt,   BasicType::LongLongSignedInt,   BasicType::LongLongSignedInt,   BasicType::LongLongSignedInt,   BasicType::LongLongSignedInt,   BasicType::LongLongSignedInt,   BasicType::LongLongUnsignedInt, BasicType::Float,       BasicType::Double,      BasicType::LongDouble,  BasicType::FloatComplex,        BasicType::DoubleComplex,       BasicType::LongDoubleComplex,   BasicType::FloatComplex,        BasicType::DoubleComplex,       BasicType::LongDoubleComplex },
     164                /* LongLongUnsignedInt */       { BasicType::LongLongUnsignedInt,       BasicType::LongLongUnsignedInt, BasicType::LongLongUnsignedInt, BasicType::LongLongUnsignedInt, BasicType::LongLongUnsignedInt, BasicType::LongLongUnsignedInt, BasicType::LongLongUnsignedInt, BasicType::LongLongUnsignedInt, BasicType::LongLongUnsignedInt, BasicType::LongLongUnsignedInt, BasicType::LongLongUnsignedInt, BasicType::LongLongUnsignedInt, BasicType::Float,       BasicType::Double,      BasicType::LongDouble,  BasicType::FloatComplex,        BasicType::DoubleComplex,       BasicType::LongDoubleComplex,   BasicType::FloatComplex,        BasicType::DoubleComplex,       BasicType::LongDoubleComplex },
     165                /* Float */     { BasicType::Float,     BasicType::Float,       BasicType::Float,       BasicType::Float,       BasicType::Float,       BasicType::Float,       BasicType::Float,       BasicType::Float,       BasicType::Float,       BasicType::Float,       BasicType::Float,       BasicType::Float,       BasicType::Float,       BasicType::Double,      BasicType::LongDouble,  BasicType::FloatComplex,        BasicType::DoubleComplex,       BasicType::LongDoubleComplex,   BasicType::FloatComplex,        BasicType::DoubleComplex,       BasicType::LongDoubleComplex },
     166                /* Double */    { BasicType::Double,    BasicType::Double,      BasicType::Double,      BasicType::Double,      BasicType::Double,      BasicType::Double,      BasicType::Double,      BasicType::Double,      BasicType::Double,      BasicType::Double,      BasicType::Double,      BasicType::Double,      BasicType::Double,      BasicType::Double,      BasicType::LongDouble,  BasicType::DoubleComplex,       BasicType::DoubleComplex,       BasicType::LongDoubleComplex,   BasicType::DoubleComplex,       BasicType::DoubleComplex,       BasicType::LongDoubleComplex },
     167                /* LongDouble */        { BasicType::LongDouble,                BasicType::LongDouble,  BasicType::LongDouble,  BasicType::LongDouble,  BasicType::LongDouble,  BasicType::LongDouble,  BasicType::LongDouble,  BasicType::LongDouble,  BasicType::LongDouble,  BasicType::LongDouble,  BasicType::LongDouble,  BasicType::LongDouble,  BasicType::LongDouble,  BasicType::LongDouble,  BasicType::LongDouble,  BasicType::LongDoubleComplex,   BasicType::LongDoubleComplex,   BasicType::LongDoubleComplex,   BasicType::LongDoubleComplex,   BasicType::LongDoubleComplex,   BasicType::LongDoubleComplex },
     168                /* FloatComplex */      { BasicType::FloatComplex,      BasicType::FloatComplex,        BasicType::FloatComplex,        BasicType::FloatComplex,        BasicType::FloatComplex,        BasicType::FloatComplex,        BasicType::FloatComplex,        BasicType::FloatComplex,        BasicType::FloatComplex,        BasicType::FloatComplex,        BasicType::FloatComplex,        BasicType::FloatComplex,        BasicType::FloatComplex,        BasicType::DoubleComplex,       BasicType::LongDoubleComplex,   BasicType::FloatComplex,        BasicType::DoubleComplex,       BasicType::LongDoubleComplex,   BasicType::FloatComplex,        BasicType::DoubleComplex,       BasicType::LongDoubleComplex },
     169                /* DoubleComplex */     { BasicType::DoubleComplex,     BasicType::DoubleComplex,       BasicType::DoubleComplex,       BasicType::DoubleComplex,       BasicType::DoubleComplex,       BasicType::DoubleComplex,       BasicType::DoubleComplex,       BasicType::DoubleComplex,       BasicType::DoubleComplex,       BasicType::DoubleComplex,       BasicType::DoubleComplex,       BasicType::DoubleComplex,       BasicType::DoubleComplex,       BasicType::DoubleComplex,       BasicType::LongDoubleComplex,   BasicType::DoubleComplex,       BasicType::DoubleComplex,       BasicType::LongDoubleComplex,   BasicType::DoubleComplex,       BasicType::DoubleComplex,       BasicType::LongDoubleComplex },
     170                /* LongDoubleComplex */         { BasicType::LongDoubleComplex, BasicType::LongDoubleComplex,   BasicType::LongDoubleComplex,   BasicType::LongDoubleComplex,   BasicType::LongDoubleComplex,   BasicType::LongDoubleComplex,   BasicType::LongDoubleComplex,   BasicType::LongDoubleComplex,   BasicType::LongDoubleComplex,   BasicType::LongDoubleComplex,   BasicType::LongDoubleComplex,   BasicType::LongDoubleComplex,   BasicType::LongDoubleComplex,   BasicType::LongDoubleComplex,   BasicType::LongDoubleComplex,   BasicType::LongDoubleComplex,   BasicType::LongDoubleComplex,   BasicType::LongDoubleComplex,   BasicType::LongDoubleComplex,   BasicType::LongDoubleComplex,   BasicType::LongDoubleComplex },
     171                /* FloatImaginary */    { BasicType::FloatComplex,      BasicType::FloatComplex,        BasicType::FloatComplex,        BasicType::FloatComplex,        BasicType::FloatComplex,        BasicType::FloatComplex,        BasicType::FloatComplex,        BasicType::FloatComplex,        BasicType::FloatComplex,        BasicType::FloatComplex,        BasicType::FloatComplex,        BasicType::FloatComplex,        BasicType::FloatComplex,        BasicType::DoubleComplex,       BasicType::LongDoubleComplex,   BasicType::FloatComplex,        BasicType::DoubleComplex,       BasicType::LongDoubleComplex,   BasicType::FloatImaginary,      BasicType::DoubleImaginary,     BasicType::LongDoubleImaginary },
     172                /* DoubleImaginary */   { BasicType::DoubleComplex,     BasicType::DoubleComplex,       BasicType::DoubleComplex,       BasicType::DoubleComplex,       BasicType::DoubleComplex,       BasicType::DoubleComplex,       BasicType::DoubleComplex,       BasicType::DoubleComplex,       BasicType::DoubleComplex,       BasicType::DoubleComplex,       BasicType::DoubleComplex,       BasicType::DoubleComplex,       BasicType::DoubleComplex,       BasicType::DoubleComplex,       BasicType::LongDoubleComplex,   BasicType::DoubleComplex,       BasicType::DoubleComplex,       BasicType::LongDoubleComplex,   BasicType::DoubleImaginary,     BasicType::DoubleImaginary,     BasicType::LongDoubleImaginary },
     173                /* LongDoubleImaginary */       { BasicType::LongDoubleComplex, BasicType::LongDoubleComplex,   BasicType::LongDoubleComplex,   BasicType::LongDoubleComplex,   BasicType::LongDoubleComplex,   BasicType::LongDoubleComplex,   BasicType::LongDoubleComplex,   BasicType::LongDoubleComplex,   BasicType::LongDoubleComplex,   BasicType::LongDoubleComplex,   BasicType::LongDoubleComplex,   BasicType::LongDoubleComplex,   BasicType::LongDoubleComplex,   BasicType::LongDoubleComplex,   BasicType::LongDoubleComplex,   BasicType::LongDoubleComplex,   BasicType::LongDoubleComplex,   BasicType::LongDoubleComplex,   BasicType::LongDoubleImaginary, BasicType::LongDoubleImaginary, BasicType::LongDoubleImaginary }
    176174        };
    177175
  • src/ResolvExpr/ConversionCost.cc

    r3f7e12cb r78315272  
    1010// Created On       : Sun May 17 07:06:19 2015
    1111// Last Modified By : Peter A. Buhr
    12 // Last Modified On : Mon Sep 25 15:43:34 2017
    13 // Update Count     : 10
     12// Last Modified On : Wed Mar  2 17:35:46 2016
     13// Update Count     : 6
    1414//
    1515
     
    2828
    2929namespace ResolvExpr {
    30         const Cost Cost::zero =      Cost(  0,  0,  0, 0 );
    31         const Cost Cost::infinity =  Cost( -1, -1, -1, -1 );
    32         const Cost Cost::unsafe =    Cost(  1,  0,  0, 0 );
    33         const Cost Cost::poly =      Cost(  0,  1,  0, 0 );
    34         const Cost Cost::safe =      Cost(  0,  0,  1, 0 );
    35         const Cost Cost::reference = Cost(  0,  0,  0, 1 );
     30        const Cost Cost::zero = Cost( 0, 0, 0, 0 );
     31        const Cost Cost::infinity = Cost( -1, -1, -1, -1 );
     32        const Cost Cost::unsafe = Cost( 1, 0, 0, 0 );
     33        const Cost Cost::poly = Cost( 0, 1, 0, 0 );
     34        const Cost Cost::safe = Cost( 0, 0, 1, 0 );
     35        const Cost Cost::reference = Cost( 0, 0, 0, 1 );
    3636
    3737#if 0
     
    113113                                        int assignResult = func( srcAsRef->get_base(), destAsRef->get_base(), env, indexer );
    114114                                        PRINT( std::cerr << "comparing references: " << assignResult << " " << srcAsRef << " " << destAsRef << std::endl; )
    115                                         if ( assignResult > 0 ) {
     115                                        if ( assignResult < 0 ) {
    116116                                                return Cost::safe;
    117                                         } else if ( assignResult < 0 ) {
     117                                        } else if ( assignResult > 0 ) {
    118118                                                return Cost::unsafe;
    119119                                        } // if
     
    219219*/
    220220
    221         static const int costMatrix[ BasicType::NUMBER_OF_BASIC_TYPES ][ BasicType::NUMBER_OF_BASIC_TYPES ] = {
    222         /* Src \ Dest:  Bool    Char    SChar   UChar   Short   UShort  Int     UInt    Long    ULong   LLong   ULLong  Float   Double  LDbl    FCplex  DCplex  LDCplex FImag   DImag   LDImag  I128,   U128 */
    223                 /* Bool */      { 0,    1,              1,              2,              3,              4,              5,              6,              6,              7,              8,              9,              12,             13,             14,             12,             13,             14,             -1,             -1,             -1,             10,             11,     },
    224                 /* Char */      { -1,   0,              -1,             1,              2,              3,              4,              5,              5,              6,              7,              8,              11,             12,             13,             11,             12,             13,             -1,             -1,             -1,             9,              10,     },
    225                 /* SChar */ { -1,       -1,             0,              1,              2,              3,              4,              5,              5,              6,              7,              8,              11,             12,             13,             11,             12,             13,             -1,             -1,             -1,             9,              10,     },
    226                 /* UChar */ { -1,       -1,             -1,             0,              1,              2,              3,              4,              4,              5,              6,              7,              10,             11,             12,             10,             11,             12,             -1,             -1,             -1,             8,              9,      },
    227                 /* Short */ { -1,       -1,             -1,             -1,             0,              1,              2,              3,              3,              4,              5,              6,              9,              10,             11,             9,              10,             11,             -1,             -1,             -1,             7,              8,      },
    228                 /* UShort */{ -1,       -1,             -1,             -1,             -1,             0,              1,              2,              2,              3,              4,              5,              8,              9,              10,             8,              9,              10,             -1,             -1,             -1,             6,              7,      },
    229                 /* Int */       { -1,   -1,             -1,             -1,             -1,             -1,             0,              1,              1,              2,              3,              4,              7,              8,              9,              7,              8,              9,              -1,             -1,             -1,             5,              6,      },
    230                 /* UInt */      { -1,   -1,             -1,             -1,             -1,             -1,             -1,             0,              -1,             1,              2,              3,              6,              7,              8,              6,              7,              8,              -1,             -1,             -1,             4,              5,      },
    231                 /* Long */      { -1,   -1,             -1,             -1,             -1,             -1,             -1,             -1,             0,              1,              2,              3,              6,              7,              8,              6,              7,              8,              -1,             -1,             -1,             4,              5,      },
    232                 /* ULong */ { -1,       -1,             -1,             -1,             -1,             -1,             -1,             -1,             -1,             0,              1,              2,              5,              6,              7,              5,              6,              7,              -1,             -1,             -1,             3,              4,      },
    233                 /* LLong */ { -1,       -1,             -1,             -1,             -1,             -1,             -1,             -1,             -1,             -1,             0,              1,              4,              5,              6,              4,              5,              6,              -1,             -1,             -1,             2,              3,      },
    234                 /* ULLong */{ -1,       -1,             -1,             -1,             -1,             -1,             -1,             -1,             -1,             -1,             -1,             0,              3,              4,              5,              3,              4,              5,              -1,             -1,             -1,             1,              2,      },
    235 
    236                 /* Float */ { -1,       -1,             -1,             -1,             -1,             -1,             -1,             -1,             -1,             -1,             -1,             -1,             0,              1,              2,              1,              2,              3,              -1,             -1,             -1,             -1,             -1,     },
    237                 /* Double */{ -1,       -1,             -1,             -1,             -1,             -1,             -1,             -1,             -1,             -1,             -1,             -1,             -1,             0,              1,              -1,             1,              2,              -1,             -1,             -1,             -1,             -1,     },
    238                 /* LDbl */      { -1,   -1,             -1,             -1,             -1,             -1,             -1,             -1,             -1,             -1,             -1,             -1,             -1,             -1,             0,              -1,             -1,             1,              -1,             -1,             -1,             -1,             -1,     },
    239                 /* FCplex */{ -1,       -1,             -1,             -1,             -1,             -1,             -1,             -1,             -1,             -1,             -1,             -1,             -1,             -1,             -1,             0,              1,              2,              -1,             -1,             -1,             -1,             -1,     },
    240                 /* DCplex */{ -1,       -1,             -1,             -1,             -1,             -1,             -1,             -1,             -1,             -1,             -1,             -1,             -1,             -1,             -1,             -1,             0,              1,              -1,             -1,             -1,             -1,             -1,     },
    241                 /* LDCplex */{ -1,      -1,             -1,             -1,             -1,             -1,             -1,             -1,             -1,             -1,             -1,             -1,             -1,             -1,             -1,             -1,             -1,             0,              -1,             -1,             -1,             -1,             -1,     },
    242                 /* FImag */ { -1,       -1,             -1,             -1,             -1,             -1,             -1,             -1,             -1,             -1,             -1,             -1,             -1,             -1,             -1,             1,              2,              3,              0,              1,              2,              -1,             -1,     },
    243                 /* DImag */ { -1,       -1,             -1,             -1,             -1,             -1,             -1,             -1,             -1,             -1,             -1,             -1,             -1,             -1,             -1,             -1,             1,              2,              -1,             0,              1,              -1,             -1,     },
    244                 /* LDImag */{ -1,       -1,             -1,             -1,             -1,             -1,             -1,             -1,             -1,             -1,             -1,             -1,             -1,             -1,             -1,             -1,             -1,             1,              -1,             -1,             0,              -1,             -1,     },
    245 
    246                 /* I128 */  { -1,       -1,             -1,             -1,             -1,             -1,             -1,             -1,             -1,             -1,             -1,             -1,             2,              3,              4,              3,              4,              5,              -1,             -1,             -1,             0,              1,      },
    247                 /* U128 */  { -1,       -1,             -1,             -1,             -1,             -1,             -1,             -1,             -1,             -1,             -1,             -1,             1,              2,              3,              2,              3,              4,              -1,             -1,             -1,             -1,             0,      },
     221        static const int costMatrix[ BasicType::NUMBER_OF_BASIC_TYPES ][ BasicType::NUMBER_OF_BASIC_TYPES ] =
     222        {
     223        /* Src \ Dest:  Bool    Char    SChar   UChar   Short   UShort  Int     UInt    Long    ULong   LLong   ULLong  Float   Double  LDbl    FCplex  DCplex  LDCplex FImag   DImag   LDImag */
     224                /* Bool */      { 0,    1,              1,              2,              3,              4,              5,              6,              6,              7,              8,              9,              10,             11,             12,             11,             12,             13,             -1,             -1,             -1 },
     225                /* Char */      { -1,   0,              -1,             1,              2,              3,              4,              5,              5,              6,              7,              8,              9,              10,             11,             10,             11,             12,             -1,             -1,             -1 },
     226                /* SChar */ { -1,       -1,             0,              1,              2,              3,              4,              5,              5,              6,              7,              8,              9,              10,             11,             10,             11,             12,             -1,             -1,             -1 },
     227                /* UChar */ { -1,       -1,             -1,             0,              1,              2,              3,              4,              4,              5,              6,              7,              8,              9,              10,             9,              10,             11,             -1,             -1,             -1 },
     228                /* Short */ { -1,       -1,             -1,             -1,             0,              1,              2,              3,              3,              4,              5,              6,              7,              8,              9,              8,              9,              10,             -1,             -1,             -1 },
     229                /* UShort */{ -1,       -1,             -1,             -1,             -1,             0,              1,              2,              2,              3,              4,              5,              6,              7,              8,              7,              8,              9,              -1,             -1,             -1 },
     230                /* Int */       { -1,   -1,             -1,             -1,             -1,             -1,             0,              1,              1,              2,              3,              4,              5,              6,              7,              6,              7,              8,              -1,             -1,             -1 },
     231                /* UInt */      { -1,   -1,             -1,             -1,             -1,             -1,             -1,             0,              -1,             1,              2,              3,              4,              5,              6,              5,              6,              7,              -1,             -1,             -1 },
     232                /* Long */      { -1,   -1,             -1,             -1,             -1,             -1,             -1,             -1,             0,              1,              2,              3,              4,              5,              6,              5,              6,              7,              -1,             -1,             -1 },
     233                /* ULong */ { -1,       -1,             -1,             -1,             -1,             -1,             -1,             -1,             -1,             0,              1,              2,              3,              4,              5,              4,              5,              6,              -1,             -1,             -1 },
     234                /* LLong */ { -1,       -1,             -1,             -1,             -1,             -1,             -1,             -1,             -1,             -1,             0,              1,              2,              3,              4,              3,              4,              5,              -1,             -1,             -1 },
     235                /* ULLong */{ -1,       -1,             -1,             -1,             -1,             -1,             -1,             -1,             -1,             -1,             -1,             0,              1,              2,              3,              2,              3,              4,              -1,             -1,             -1 },
     236                /* Float */ { -1,       -1,             -1,             -1,             -1,             -1,             -1,             -1,             -1,             -1,             -1,             -1,             0,              1,              2,              1,              2,              3,              -1,             -1,             -1 },
     237                /* Double */{ -1,       -1,             -1,             -1,             -1,             -1,             -1,             -1,             -1,             -1,             -1,             -1,             -1,             0,              1,              -1,             1,              2,              -1,             -1,             -1 },
     238                /* LDbl */      { -1,   -1,             -1,             -1,             -1,             -1,             -1,             -1,             -1,             -1,             -1,             -1,             -1,             -1,             0,              -1,             -1,             1,              -1,             -1,             -1 },
     239                /* FCplex */{ -1,       -1,             -1,             -1,             -1,             -1,             -1,             -1,             -1,             -1,             -1,             -1,             -1,             -1,             -1,             0,              1,              2,              -1,             -1,             -1 },
     240                /* DCplex */{ -1,       -1,             -1,             -1,             -1,             -1,             -1,             -1,             -1,             -1,             -1,             -1,             -1,             -1,             -1,             -1,             0,              1,              -1,             -1,             -1 },
     241                /* LDCplex */{ -1,      -1,             -1,             -1,             -1,             -1,             -1,             -1,             -1,             -1,             -1,             -1,             -1,             -1,             -1,             -1,             -1,             0,              -1,             -1,             -1 },
     242                /* FImag */ { -1,       -1,             -1,             -1,             -1,             -1,             -1,             -1,             -1,             -1,             -1,             -1,             -1,             -1,             -1,             1,              2,              3,              0,              1,              2 },
     243                /* DImag */ { -1,       -1,             -1,             -1,             -1,             -1,             -1,             -1,             -1,             -1,             -1,             -1,             -1,             -1,             -1,             -1,             1,              2,              -1,             0,              1 },
     244                /* LDImag */{ -1,       -1,             -1,             -1,             -1,             -1,             -1,             -1,             -1,             -1,             -1,             -1,             -1,             -1,             -1,             -1,             -1,             1,              -1,             -1,             0 }
    248245        };
    249246
     
    269266        }
    270267
    271         void ConversionCost::visit( PointerType * pointerType ) {
     268        void ConversionCost::visit(PointerType *pointerType) {
    272269                if ( PointerType *destAsPtr = dynamic_cast< PointerType* >( dest ) ) {
    273270                        PRINT( std::cerr << pointerType << " ===> " << destAsPtr; )
     
    284281                                }
    285282                        } else {  // xxx - this discards qualifiers from consideration -- reducing qualifiers is a safe conversion; is this right?
    286                                 int assignResult = ptrsAssignable( pointerType->base, destAsPtr->base, env );
     283                                int assignResult = ptrsAssignable( pointerType->get_base(), destAsPtr->get_base(), env );
    287284                                PRINT( std::cerr << " :: " << assignResult << std::endl; )
    288                                 if ( assignResult > 0 && pointerType->get_base()->get_qualifiers() <= destAsPtr->get_qualifiers() ) {
     285                                if ( assignResult < 0 && pointerType->get_base()->get_qualifiers() <= destAsPtr->get_qualifiers() ) {
    289286                                        cost = Cost::safe;
    290                                 } else if ( assignResult < 0 ) {
     287                                } else if ( assignResult > 0 ) {
    291288                                        cost = Cost::unsafe;
    292289                                } // if
    293290                                // assignResult == 0 means Cost::Infinity
    294291                        } // if
    295                 } else if ( dynamic_cast< ZeroType * >( dest ) ) {
     292                } else if ( dynamic_cast< ZeroType* >( dest ) != nullptr || dynamic_cast< OneType* >( dest ) != nullptr ) {
    296293                        cost = Cost::unsafe;
    297294                } // if
    298295        }
    299296
    300         void ConversionCost::visit( ArrayType * ) {}
    301 
    302         void ConversionCost::visit( ReferenceType * refType ) {
     297        void ConversionCost::visit(__attribute((unused)) ArrayType *arrayType) {}
     298
     299        void ConversionCost::visit(ReferenceType *refType) {
    303300                // Note: dest can never be a reference, since it would have been caught in an earlier check
    304301                assert( ! dynamic_cast< ReferenceType * >( dest ) );
     
    306303                // recursively compute conversion cost from T1 to T2.
    307304                // cv can be safely dropped because of 'implicit dereference' behavior.
    308                 refType->base->accept( *this );
    309                 if ( refType->base->get_qualifiers() == dest->get_qualifiers() ) {
     305                refType->get_base()->accept( *this );
     306                if ( refType->get_base()->get_qualifiers() == dest->get_qualifiers() ) {
    310307                        cost.incReference();  // prefer exact qualifiers
    311                 } else if ( refType->base->get_qualifiers() < dest->get_qualifiers() ) {
     308                } else if ( refType->get_base()->get_qualifiers() < dest->get_qualifiers() ) {
    312309                        cost.incSafe(); // then gaining qualifiers
    313310                } else {
     
    317314        }
    318315
    319         void ConversionCost::visit( FunctionType * ) {}
    320 
    321         void ConversionCost::visit( StructInstType * inst ) {
     316        void ConversionCost::visit(__attribute((unused)) FunctionType *functionType) {}
     317
     318        void ConversionCost::visit(StructInstType *inst) {
    322319                if ( StructInstType *destAsInst = dynamic_cast< StructInstType* >( dest ) ) {
    323                         if ( inst->name == destAsInst->name ) {
    324                                 cost = Cost::zero;
    325                         } // if
    326                 } // if
    327         }
    328 
    329         void ConversionCost::visit( UnionInstType * inst ) {
    330                 if ( UnionInstType *destAsInst = dynamic_cast< UnionInstType* >( dest ) ) {
    331                         if ( inst->name == destAsInst->name ) {
    332                                 cost = Cost::zero;
    333                         } // if
    334                 } // if
    335         }
    336 
    337         void ConversionCost::visit( EnumInstType * ) {
     320                        if ( inst->get_name() == destAsInst->get_name() ) {
     321                                cost = Cost::zero;
     322                        } // if
     323                } // if
     324        }
     325
     326        void ConversionCost::visit(UnionInstType *inst) {
     327                if ( StructInstType *destAsInst = dynamic_cast< StructInstType* >( dest ) ) {
     328                        if ( inst->get_name() == destAsInst->get_name() ) {
     329                                cost = Cost::zero;
     330                        } // if
     331                } // if
     332        }
     333
     334        void ConversionCost::visit( __attribute((unused)) EnumInstType *inst ) {
    338335                static Type::Qualifiers q;
    339336                static BasicType integer( q, BasicType::SignedInt );
     
    344341        }
    345342
    346         void ConversionCost::visit( TraitInstType * ) {}
    347 
    348         void ConversionCost::visit( TypeInstType *inst ) {
     343        void ConversionCost::visit( __attribute((unused)) TraitInstType *inst) {
     344        }
     345
     346        void ConversionCost::visit(TypeInstType *inst) {
    349347                EqvClass eqvClass;
    350348                NamedTypeDecl *namedType;
     
    365363        }
    366364
    367         void ConversionCost::visit( TupleType * tupleType ) {
     365        void ConversionCost::visit( __attribute((unused)) TupleType *tupleType) {
    368366                Cost c = Cost::zero;
    369                 if ( TupleType * destAsTuple = dynamic_cast< TupleType * >( dest ) ) {
    370                         std::list< Type * >::const_iterator srcIt = tupleType->get_types().begin();
    371                         std::list< Type * >::const_iterator destIt = destAsTuple->get_types().begin();
     367                if ( TupleType *destAsTuple = dynamic_cast< TupleType* >( dest ) ) {
     368                        std::list< Type* >::const_iterator srcIt = tupleType->get_types().begin();
     369                        std::list< Type* >::const_iterator destIt = destAsTuple->get_types().begin();
    372370                        while ( srcIt != tupleType->get_types().end() && destIt != destAsTuple->get_types().end() ) {
    373371                                Cost newCost = conversionCost( *srcIt++, *destIt++, indexer, env );
     
    385383        }
    386384
    387         void ConversionCost::visit( VarArgsType * ) {
     385        void ConversionCost::visit( __attribute((unused)) VarArgsType *varArgsType) {
    388386                if ( dynamic_cast< VarArgsType* >( dest ) ) {
    389387                        cost = Cost::zero;
     
    391389        }
    392390
    393         void ConversionCost::visit( ZeroType * ) {
    394                 if ( dynamic_cast< ZeroType * >( dest ) ) {
     391        void ConversionCost::visit( __attribute((unused)) ZeroType *zeroType) {
     392                if ( dynamic_cast< ZeroType* >( dest ) ) {
    395393                        cost = Cost::zero;
    396394                } else if ( BasicType *destAsBasic = dynamic_cast< BasicType* >( dest ) ) {
     
    408406        }
    409407
    410         void ConversionCost::visit( OneType * ) {
    411                 if ( dynamic_cast< OneType * >( dest ) ) {
     408        void ConversionCost::visit( __attribute((unused)) OneType *oneType) {
     409                if ( dynamic_cast< OneType* >( dest ) ) {
    412410                        cost = Cost::zero;
    413411                } else if ( BasicType *destAsBasic = dynamic_cast< BasicType* >( dest ) ) {
  • src/ResolvExpr/CurrentObject.cc

    r3f7e12cb r78315272  
    260260
    261261                AggregateIterator( const std::string & kind, const std::string & name, Type * inst, const MemberList & members ) : kind( kind ), name( name ), inst( inst ), members( members ), curMember( members.begin() ), sub( makeGenericSubstitution( inst ) ) {
    262                         PRINT( std::cerr << "Creating " << kind << "(" << name << ")"; )
    263262                        init();
    264263                }
  • src/ResolvExpr/PolyCost.cc

    r3f7e12cb r78315272  
    55// file "LICENCE" distributed with Cforall.
    66//
    7 // PolyCost.cc --
     7// PolyCost.cc -- 
    88//
    99// Author           : Richard C. Bilson
     
    3131        };
    3232
    33         int polyCost( Type *type, const TypeEnvironment & env, const SymTab::Indexer &indexer ) {
     33        int polyCost( Type *type, const TypeEnvironment &env, const SymTab::Indexer &indexer ) {
    3434                PolyCost coster( env, indexer );
    3535                type->accept( coster );
     
    3737        }
    3838
    39         PolyCost::PolyCost( const TypeEnvironment & env, const SymTab::Indexer & indexer ) : result( 0 ), env( env ), indexer( indexer ) {
     39        PolyCost::PolyCost( const TypeEnvironment &env, const SymTab::Indexer &indexer ) : result( 0 ), env( env ), indexer( indexer ) {
    4040        }
    4141
    42         void PolyCost::visit(TypeInstType * typeInst) {
     42        void PolyCost::visit(TypeInstType *typeInst) {
    4343                EqvClass eqvClass;
    44                 if ( env.lookup( typeInst->name, eqvClass ) ) {
     44                if ( env.lookup( typeInst->get_name(), eqvClass ) ) {
    4545                        if ( eqvClass.type ) {
    46                                 if ( TypeInstType * otherTypeInst = dynamic_cast< TypeInstType* >( eqvClass.type ) ) {
    47                                         if ( indexer.lookupType( otherTypeInst->name ) ) {
    48                                                 // bound to opaque type
     46                                if ( TypeInstType *otherTypeInst = dynamic_cast< TypeInstType* >( eqvClass.type ) ) {
     47                                        if ( indexer.lookupType( otherTypeInst->get_name() ) ) {
    4948                                                result += 1;
    5049                                        } // if
    5150                                } else {
    52                                         // bound to concrete type
    5351                                        result += 1;
    5452                                } // if
  • src/ResolvExpr/PtrsAssignable.cc

    r3f7e12cb r78315272  
    4747
    4848        int ptrsAssignable( Type *src, Type *dest, const TypeEnvironment &env ) {
    49                 // std::cerr << "assignable: " << src << " | " << dest << std::endl;
    5049                if ( TypeInstType *destAsTypeInst = dynamic_cast< TypeInstType* >( dest ) ) {
    5150                        EqvClass eqvClass;
     
    5554                } // if
    5655                if ( dynamic_cast< VoidType* >( dest ) ) {
    57                         // void * = T * for any T is unsafe
    58                         // xxx - this should be safe, but that currently breaks the build
    59                         return -1;
     56                        return 1;
    6057                } else {
    6158                        PtrsAssignable ptrs( dest, env );
     
    6865
    6966        void PtrsAssignable::visit( __attribute((unused)) VoidType *voidType ) {
    70                 if ( ! dynamic_cast< FunctionType* >( dest ) ) {
    71                         // T * = void * is safe for any T that is not a function type.
    72                         // xxx - this should be unsafe...
    73                         result = 1;
     67                if ( dynamic_cast< FunctionType* >( dest ) ) {
     68                        result = 0;
     69                } else {
     70                        result = -1;
    7471                } // if
    7572        }
     
    7875        void PtrsAssignable::visit( __attribute__((unused)) PointerType *pointerType ) {}
    7976        void PtrsAssignable::visit( __attribute__((unused)) ArrayType *arrayType ) {}
    80         void PtrsAssignable::visit( __attribute__((unused)) FunctionType *functionType ) {}
     77        void PtrsAssignable::visit( __attribute__((unused)) FunctionType *functionType ) {
     78                result = -1;
     79        }
    8180
    8281        void PtrsAssignable::visit(  __attribute__((unused)) StructInstType *inst ) {}
     
    8483
    8584        void PtrsAssignable::visit( EnumInstType * ) {
    86                 if ( dynamic_cast< BasicType* >( dest ) ) {
    87                         // int * = E *, etc. is safe. This isn't technically correct, as each
    88                         // enum has one basic type that it is compatible with, an that type can
    89                         // differ from enum to enum. Without replicating GCC's internal logic,
    90                         // there is no way to know which type this particular enum is compatible
    91                         // with, so punt on this for now.
     85                if ( dynamic_cast< EnumInstType* >( dest ) ) {
    9286                        result = 1;
     87                } else if ( BasicType *bt = dynamic_cast< BasicType* >( dest ) ) {
     88                        result = bt->get_kind() == BasicType::SignedInt;
    9389                }
    9490        }
     
    9894                EqvClass eqvClass;
    9995                if ( env.lookup( inst->get_name(), eqvClass ) && eqvClass.type ) {
    100                         // T * = S * for any S depends on the type bound to T
    10196                        result = ptrsAssignable( eqvClass.type, dest, env );
     97                } else {
     98                        result = 0;
    10299                } // if
    103100        }
  • src/ResolvExpr/PtrsCastable.cc

    r3f7e12cb r78315272  
    5050        };
    5151
    52         namespace {
    53                 int objectCast( Type *src, const TypeEnvironment &env, const SymTab::Indexer &indexer ) {
    54                         if ( dynamic_cast< FunctionType* >( src ) ) {
    55                                 return -1;
    56                         } else if ( TypeInstType *typeInst = dynamic_cast< TypeInstType* >( src ) ) {
    57                                 EqvClass eqvClass;
    58                                 if ( NamedTypeDecl *ntDecl = indexer.lookupType( typeInst->get_name() ) ) {
    59                                         if ( TypeDecl *tyDecl = dynamic_cast< TypeDecl* >( ntDecl ) ) {
    60                                                 if ( tyDecl->get_kind() == TypeDecl::Ftype ) {
    61                                                         return -1;
    62                                                 } // if
    63                                         } //if
    64                                 } else if ( env.lookup( typeInst->get_name(), eqvClass ) ) {
    65                                         if ( eqvClass.data.kind == TypeDecl::Ftype ) {
     52        int objectCast( Type *src, const TypeEnvironment &env, const SymTab::Indexer &indexer ) {
     53                if ( dynamic_cast< FunctionType* >( src ) ) {
     54                        return -1;
     55                } else if ( TypeInstType *typeInst = dynamic_cast< TypeInstType* >( src ) ) {
     56                        EqvClass eqvClass;
     57                        if ( NamedTypeDecl *ntDecl = indexer.lookupType( typeInst->get_name() ) ) {
     58                                if ( TypeDecl *tyDecl = dynamic_cast< TypeDecl* >( ntDecl ) ) {
     59                                        if ( tyDecl->get_kind() == TypeDecl::Ftype ) {
    6660                                                return -1;
    6761                                        } // if
     62                                } //if
     63                        } else if ( env.lookup( typeInst->get_name(), eqvClass ) ) {
     64                                if ( eqvClass.data.kind == TypeDecl::Ftype ) {
     65                                        return -1;
    6866                                } // if
    69                         } //if
    70                         return 1;
    71                 }
    72                 int functionCast( Type *src, const TypeEnvironment &env, const SymTab::Indexer &indexer ) {
    73                         return -1 * objectCast( src, env, indexer );  // reverse the sense of objectCast
    74                 }
     67                        } // if
     68                } //if
     69                return 1;
     70        }
     71        int functionCast( Type *src, const TypeEnvironment &env, const SymTab::Indexer &indexer ) {
     72                return -1 * objectCast( src, env, indexer );  // reverse the sense of objectCast
    7573        }
    7674
     
    9593        }
    9694
    97         void PtrsCastable::visit( VoidType * ) {
     95        void PtrsCastable::visit( __attribute__((unused)) VoidType *voidType) {
    9896                result = objectCast( dest, env, indexer );
    9997        }
    10098
    101         void PtrsCastable::visit( BasicType * ) {
     99        void PtrsCastable::visit( __attribute__((unused)) BasicType *basicType) {
    102100                result = objectCast( dest, env, indexer );
    103101        }
    104102
    105         void PtrsCastable::visit( PointerType * ) {
     103        void PtrsCastable::visit( __attribute__((unused)) PointerType *pointerType) {
    106104                result = objectCast( dest, env, indexer );
    107105        }
    108106
    109         void PtrsCastable::visit( ArrayType * ) {
     107        void PtrsCastable::visit( __attribute__((unused)) ArrayType *arrayType) {
    110108                result = objectCast( dest, env, indexer );
    111109        }
    112110
    113         void PtrsCastable::visit( FunctionType * ) {
     111        void PtrsCastable::visit( __attribute__((unused)) FunctionType *functionType) {
    114112                // result = -1;
    115113                result = functionCast( dest, env, indexer );
    116114        }
    117115
    118         void PtrsCastable::visit( StructInstType * ) {
     116        void PtrsCastable::visit( __attribute__((unused)) StructInstType *inst) {
    119117                result = objectCast( dest, env, indexer );
    120118        }
    121119
    122         void PtrsCastable::visit( UnionInstType * ) {
     120        void PtrsCastable::visit( __attribute__((unused)) UnionInstType *inst) {
    123121                result = objectCast( dest, env, indexer );
    124122        }
    125123
    126         void PtrsCastable::visit( EnumInstType * ) {
     124        void PtrsCastable::visit( __attribute__((unused)) EnumInstType *inst) {
    127125                if ( dynamic_cast< EnumInstType* >( dest ) ) {
    128126                        result = 1;
     
    138136        }
    139137
    140         void PtrsCastable::visit( TraitInstType * ) {}
     138        void PtrsCastable::visit( __attribute__((unused)) TraitInstType *inst ) {}
    141139
    142140        void PtrsCastable::visit(TypeInstType *inst) {
     
    145143        }
    146144
    147         void PtrsCastable::visit( TupleType * ) {
     145        void PtrsCastable::visit( __attribute__((unused)) TupleType *tupleType) {
    148146                result = objectCast( dest, env, indexer );
    149147        }
    150148
    151         void PtrsCastable::visit( VarArgsType * ) {
     149        void PtrsCastable::visit( __attribute__((unused)) VarArgsType *varArgsType) {
    152150                result = objectCast( dest, env, indexer );
    153151        }
    154152
    155         void PtrsCastable::visit( ZeroType * ) {
     153        void PtrsCastable::visit( __attribute__((unused)) ZeroType *zeroType) {
    156154                result = objectCast( dest, env, indexer );
    157155        }
    158156
    159         void PtrsCastable::visit( OneType * ) {
     157        void PtrsCastable::visit( __attribute__((unused)) OneType *oneType) {
    160158                result = objectCast( dest, env, indexer );
    161159        }
  • src/ResolvExpr/ResolveTypeof.cc

    r3f7e12cb r78315272  
    1818#include <cassert>               // for assert
    1919
    20 #include "Common/PassVisitor.h"  // for PassVisitor
    2120#include "Resolver.h"            // for resolveInVoidContext
    2221#include "SynTree/Expression.h"  // for Expression
     
    4241        }
    4342
    44         class ResolveTypeof : public WithShortCircuiting {
     43        class ResolveTypeof : public Mutator {
    4544          public:
    4645                ResolveTypeof( const SymTab::Indexer &indexer ) : indexer( indexer ) {}
    47                 void premutate( TypeofType *typeofType );
    48                 Type * postmutate( TypeofType *typeofType );
     46                Type *mutate( TypeofType *typeofType );
    4947
    5048          private:
     
    5250        };
    5351
    54         Type * resolveTypeof( Type *type, const SymTab::Indexer &indexer ) {
    55                 PassVisitor<ResolveTypeof> mutator( indexer );
     52        Type *resolveTypeof( Type *type, const SymTab::Indexer &indexer ) {
     53                ResolveTypeof mutator( indexer );
    5654                return type->acceptMutator( mutator );
    5755        }
    5856
    59         void ResolveTypeof::premutate( TypeofType * ) {
    60                 visit_children = false;
    61         }
    62 
    63         Type * ResolveTypeof::postmutate( TypeofType *typeofType ) {
     57        Type *ResolveTypeof::mutate( TypeofType *typeofType ) {
    6458#if 0
    65                 std::cerr << "resolving typeof: ";
    66                 typeofType->print( std::cerr );
    67                 std::cerr << std::endl;
     59                std::cout << "resolving typeof: ";
     60                typeofType->print( std::cout );
     61                std::cout << std::endl;
    6862#endif
    69                 if ( typeofType->expr ) {
    70                         Expression * newExpr = resolveInVoidContext( typeofType->expr, indexer );
    71                         assert( newExpr->result && ! newExpr->result->isVoid() );
    72                         Type * newType = newExpr->result;
    73                         newExpr->result = nullptr;
     63                if ( typeofType->get_expr() ) {
     64                        Expression *newExpr = resolveInVoidContext( typeofType->get_expr(), indexer );
     65                        assert( newExpr->has_result() && ! newExpr->get_result()->isVoid() );
     66                        Type *newType = newExpr->get_result();
     67                        newExpr->set_result( nullptr );
    7468                        delete typeofType;
    7569                        delete newExpr;
  • src/ResolvExpr/Resolver.cc

    r3f7e12cb r78315272  
    4040#include "SynTree/Visitor.h"             // for acceptAll, maybeAccept
    4141#include "typeops.h"                     // for extractResultType
    42 #include "Unify.h"                       // for unify
    4342
    4443using namespace std;
     
    5352                void previsit( FunctionDecl *functionDecl );
    5453                void postvisit( FunctionDecl *functionDecl );
    55                 void previsit( ObjectDecl *objectDecll );
     54                void previsit( ObjectDecl *functionDecl );
    5655                void previsit( TypeDecl *typeDecl );
    5756                void previsit( EnumDecl * enumDecl );
     
    7271                void previsit( ThrowStmt *throwStmt );
    7372                void previsit( CatchStmt *catchStmt );
    74                 void previsit( WaitForStmt * stmt );
    7573
    7674                void previsit( SingleInit *singleInit );
     
    9795        }
    9896
    99         void resolveDecl( Declaration * decl, const SymTab::Indexer &indexer ) {
    100                 PassVisitor<Resolver> resolver( indexer );
    101                 maybeAccept( decl, resolver );
    102         }
    103 
    10497        // used in resolveTypeof
    10598        Expression *resolveInVoidContext( Expression *expr, const SymTab::Indexer &indexer ) {
     
    109102
    110103        namespace {
    111                 void finishExpr( Expression *expr, const TypeEnvironment &env, TypeSubstitution * oldenv = nullptr ) {
    112                         expr->env = oldenv ? oldenv->clone() : new TypeSubstitution;
     104                void finishExpr( Expression *expr, const TypeEnvironment &env ) {
     105                        expr->set_env( new TypeSubstitution );
    113106                        env.makeSubstitution( *expr->get_env() );
    114107                }
    115 
    116                 void removeExtraneousCast( Expression *& expr, const SymTab::Indexer & indexer ) {
    117                         if ( CastExpr * castExpr = dynamic_cast< CastExpr * >( expr ) ) {
    118                                 if ( ResolvExpr::typesCompatible( castExpr->arg->result, castExpr->result, indexer ) ) {
    119                                         // cast is to the same type as its argument, so it's unnecessary -- remove it
    120                                         expr = castExpr->arg;
    121                                         castExpr->arg = nullptr;
    122                                         std::swap( expr->env, castExpr->env );
    123                                         delete castExpr;
    124                                 }
    125                         }
    126                 }
    127108        } // namespace
    128109
    129         void findVoidExpression( Expression *& untyped, const SymTab::Indexer &indexer ) {
     110        Expression *findVoidExpression( Expression *untyped, const SymTab::Indexer &indexer ) {
    130111                global_renamer.reset();
    131112                TypeEnvironment env;
    132113                Expression *newExpr = resolveInVoidContext( untyped, indexer, env );
    133                 finishExpr( newExpr, env, untyped->env );
    134                 delete untyped;
    135                 untyped = newExpr;
    136         }
    137 
    138         void findSingleExpression( Expression *&untyped, const SymTab::Indexer &indexer ) {
    139                 if ( ! untyped ) return;
    140                 TypeEnvironment env;
    141                 AlternativeFinder finder( indexer, env );
    142                 finder.find( untyped );
    143                 #if 0
    144                 if ( finder.get_alternatives().size() != 1 ) {
    145                         std::cerr << "untyped expr is ";
    146                         untyped->print( std::cerr );
    147                         std::cerr << std::endl << "alternatives are:";
    148                         for ( const Alternative & alt : finder.get_alternatives() ) {
    149                                 alt.print( std::cerr );
    150                         } // for
    151                 } // if
    152                 #endif
    153                 assertf( finder.get_alternatives().size() == 1, "findSingleExpression: must have exactly one alternative at the end." );
    154                 Alternative &choice = finder.get_alternatives().front();
    155                 Expression *newExpr = choice.expr->clone();
    156                 finishExpr( newExpr, choice.env, untyped->env );
    157                 delete untyped;
    158                 untyped = newExpr;
    159         }
    160 
    161         void findSingleExpression( Expression *& untyped, Type * type, const SymTab::Indexer & indexer ) {
    162                 assert( untyped && type );
    163                 untyped = new CastExpr( untyped, type );
    164                 findSingleExpression( untyped, indexer );
    165                 removeExtraneousCast( untyped, indexer );
     114                finishExpr( newExpr, env );
     115                return newExpr;
    166116        }
    167117
    168118        namespace {
     119                Expression *findSingleExpression( Expression *untyped, const SymTab::Indexer &indexer ) {
     120                        TypeEnvironment env;
     121                        AlternativeFinder finder( indexer, env );
     122                        finder.find( untyped );
     123#if 0
     124                        if ( finder.get_alternatives().size() != 1 ) {
     125                                std::cout << "untyped expr is ";
     126                                untyped->print( std::cout );
     127                                std::cout << std::endl << "alternatives are:";
     128                                for ( std::list< Alternative >::const_iterator i = finder.get_alternatives().begin(); i != finder.get_alternatives().end(); ++i ) {
     129                                        i->print( std::cout );
     130                                } // for
     131                        } // if
     132#endif
     133                        assertf( finder.get_alternatives().size() == 1, "findSingleExpression: must have exactly one alternative at the end." );
     134                        Alternative &choice = finder.get_alternatives().front();
     135                        Expression *newExpr = choice.expr->clone();
     136                        finishExpr( newExpr, choice.env );
     137                        return newExpr;
     138                }
     139
    169140                bool isIntegralType( Type *type ) {
    170141                        if ( dynamic_cast< EnumInstType * >( type ) ) {
     
    179150                }
    180151
    181                 void findIntegralExpression( Expression *& untyped, const SymTab::Indexer &indexer ) {
     152                Expression *findIntegralExpression( Expression *untyped, const SymTab::Indexer &indexer ) {
    182153                        TypeEnvironment env;
    183154                        AlternativeFinder finder( indexer, env );
     
    208179                                throw SemanticError( "No interpretations for case control expression", untyped );
    209180                        } // if
    210                         finishExpr( newExpr, *newEnv, untyped->env );
    211                         delete untyped;
    212                         untyped = newExpr;
     181                        finishExpr( newExpr, *newEnv );
     182                        return newExpr;
    213183                }
    214184
     
    235205        void Resolver::handlePtrType( PtrType * type ) {
    236206                if ( type->get_dimension() ) {
    237                         findSingleExpression( type->dimension, SymTab::SizeType->clone(), indexer );
     207                        CastExpr *castExpr = new CastExpr( type->get_dimension(), SymTab::SizeType->clone() );
     208                        Expression *newExpr = findSingleExpression( castExpr, indexer );
     209                        delete type->get_dimension();
     210                        type->set_dimension( newExpr );
    238211                }
    239212        }
     
    265238                functionReturn = ResolvExpr::extractResultType( functionDecl->get_functionType() );
    266239        }
     240
    267241
    268242        void Resolver::postvisit( FunctionDecl *functionDecl ) {
     
    288262        void Resolver::previsit( ExprStmt *exprStmt ) {
    289263                visit_children = false;
    290                 assertf( exprStmt->expr, "ExprStmt has null Expression in resolver" );
    291                 findVoidExpression( exprStmt->expr, indexer );
     264                assertf( exprStmt->get_expr(), "ExprStmt has null Expression in resolver" );
     265                Expression *newExpr = findVoidExpression( exprStmt->get_expr(), indexer );
     266                delete exprStmt->get_expr();
     267                exprStmt->set_expr( newExpr );
    292268        }
    293269
    294270        void Resolver::previsit( AsmExpr *asmExpr ) {
    295271                visit_children = false;
    296                 findVoidExpression( asmExpr->operand, indexer );
     272                Expression *newExpr = findVoidExpression( asmExpr->get_operand(), indexer );
     273                delete asmExpr->get_operand();
     274                asmExpr->set_operand( newExpr );
    297275                if ( asmExpr->get_inout() ) {
    298                         findVoidExpression( asmExpr->inout, indexer );
     276                        newExpr = findVoidExpression( asmExpr->get_inout(), indexer );
     277                        delete asmExpr->get_inout();
     278                        asmExpr->set_inout( newExpr );
    299279                } // if
    300280        }
     
    307287
    308288        void Resolver::previsit( IfStmt *ifStmt ) {
    309                 findSingleExpression( ifStmt->condition, indexer );
     289                Expression *newExpr = findSingleExpression( ifStmt->get_condition(), indexer );
     290                delete ifStmt->get_condition();
     291                ifStmt->set_condition( newExpr );
    310292        }
    311293
    312294        void Resolver::previsit( WhileStmt *whileStmt ) {
    313                 findSingleExpression( whileStmt->condition, indexer );
     295                Expression *newExpr = findSingleExpression( whileStmt->get_condition(), indexer );
     296                delete whileStmt->get_condition();
     297                whileStmt->set_condition( newExpr );
    314298        }
    315299
    316300        void Resolver::previsit( ForStmt *forStmt ) {
    317                 if ( forStmt->condition ) {
    318                         findSingleExpression( forStmt->condition, indexer );
     301                if ( forStmt->get_condition() ) {
     302                        Expression * newExpr = findSingleExpression( forStmt->get_condition(), indexer );
     303                        delete forStmt->get_condition();
     304                        forStmt->set_condition( newExpr );
    319305                } // if
    320306
    321                 if ( forStmt->increment ) {
    322                         findVoidExpression( forStmt->increment, indexer );
     307                if ( forStmt->get_increment() ) {
     308                        Expression * newExpr = findVoidExpression( forStmt->get_increment(), indexer );
     309                        delete forStmt->get_increment();
     310                        forStmt->set_increment( newExpr );
    323311                } // if
    324312        }
     
    326314        void Resolver::previsit( SwitchStmt *switchStmt ) {
    327315                GuardValue( currentObject );
    328                 findIntegralExpression( switchStmt->condition, indexer );
    329 
    330                 currentObject = CurrentObject( switchStmt->condition->result );
     316                Expression *newExpr;
     317                newExpr = findIntegralExpression( switchStmt->get_condition(), indexer );
     318                delete switchStmt->get_condition();
     319                switchStmt->set_condition( newExpr );
     320
     321                currentObject = CurrentObject( newExpr->get_result() );
    331322        }
    332323
     
    335326                        std::list< InitAlternative > initAlts = currentObject.getOptions();
    336327                        assertf( initAlts.size() == 1, "SwitchStmt did not correctly resolve an integral expression." );
    337                         // must remove cast from case statement because RangeExpr cannot be cast.
    338                         Expression * newExpr = new CastExpr( caseStmt->condition, initAlts.front().type->clone() );
    339                         findSingleExpression( newExpr, indexer );
    340                         CastExpr * castExpr = strict_dynamic_cast< CastExpr * >( newExpr );
    341                         caseStmt->condition = castExpr->arg;
    342                         castExpr->arg = nullptr;
     328                        CastExpr * castExpr = new CastExpr( caseStmt->get_condition(), initAlts.front().type->clone() );
     329                        Expression * newExpr = findSingleExpression( castExpr, indexer );
     330                        castExpr = strict_dynamic_cast< CastExpr * >( newExpr );
     331                        caseStmt->set_condition( castExpr->get_arg() );
     332                        castExpr->set_arg( nullptr );
    343333                        delete castExpr;
    344334                }
     
    349339                // must resolve the argument for a computed goto
    350340                if ( branchStmt->get_type() == BranchStmt::Goto ) { // check for computed goto statement
    351                         if ( branchStmt->computedTarget ) {
    352                                 // computed goto argument is void *
    353                                 findSingleExpression( branchStmt->computedTarget, new PointerType( Type::Qualifiers(), new VoidType( Type::Qualifiers() ) ), indexer );
     341                        if ( Expression * arg = branchStmt->get_computedTarget() ) {
     342                                VoidType v = Type::Qualifiers();                // cast to void * for the alternative finder
     343                                PointerType pt( Type::Qualifiers(), v.clone() );
     344                                CastExpr * castExpr = new CastExpr( arg, pt.clone() );
     345                                Expression * newExpr = findSingleExpression( castExpr, indexer ); // find best expression
     346                                branchStmt->set_target( newExpr );
    354347                        } // if
    355348                } // if
     
    358351        void Resolver::previsit( ReturnStmt *returnStmt ) {
    359352                visit_children = false;
    360                 if ( returnStmt->expr ) {
    361                         findSingleExpression( returnStmt->expr, functionReturn->clone(), indexer );
     353                if ( returnStmt->get_expr() ) {
     354                        CastExpr *castExpr = new CastExpr( returnStmt->get_expr(), functionReturn->clone() );
     355                        Expression *newExpr = findSingleExpression( castExpr, indexer );
     356                        delete castExpr;
     357                        returnStmt->set_expr( newExpr );
    362358                } // if
    363359        }
     
    370366                                indexer.lookupStruct( "__cfaehm__base_exception_t" );
    371367                        assert( exception_decl );
    372                         Type * exceptType = new PointerType( noQualifiers, new StructInstType( noQualifiers, exception_decl ) );
    373                         findSingleExpression( throwStmt->expr, exceptType, indexer );
     368                        Expression * wrapped = new CastExpr(
     369                                throwStmt->get_expr(),
     370                                new PointerType(
     371                                        noQualifiers,
     372                                        new StructInstType(
     373                                                noQualifiers,
     374                                                exception_decl
     375                                                )
     376                                        )
     377                                );
     378                        Expression * newExpr = findSingleExpression( wrapped, indexer );
     379                        throwStmt->set_expr( newExpr );
    374380                }
    375381        }
    376382
    377383        void Resolver::previsit( CatchStmt *catchStmt ) {
    378                 if ( catchStmt->cond ) {
    379                         findSingleExpression( catchStmt->cond, new BasicType( noQualifiers, BasicType::Bool ), indexer );
    380                 }
    381         }
    382 
    383         template< typename iterator_t >
    384         inline bool advance_to_mutex( iterator_t & it, const iterator_t & end ) {
    385                 while( it != end && !(*it)->get_type()->get_mutex() ) {
    386                         it++;
    387                 }
    388 
    389                 return it != end;
    390         }
    391 
    392         void Resolver::previsit( WaitForStmt * stmt ) {
    393                 visit_children = false;
    394 
    395                 // Resolve all clauses first
    396                 for( auto& clause : stmt->clauses ) {
    397 
    398                         TypeEnvironment env;
    399                         AlternativeFinder funcFinder( indexer, env );
    400 
    401                         // Find all alternatives for a function in canonical form
    402                         funcFinder.findWithAdjustment( clause.target.function );
    403 
    404                         if ( funcFinder.get_alternatives().empty() ) {
    405                                 stringstream ss;
    406                                 ss << "Use of undeclared indentifier '";
    407                                 ss << strict_dynamic_cast<NameExpr*>( clause.target.function )->name;
    408                                 ss << "' in call to waitfor";
    409                                 throw SemanticError( ss.str() );
    410                         }
    411 
    412                         // Find all alternatives for all arguments in canonical form
    413                         std::list< AlternativeFinder > argAlternatives;
    414                         funcFinder.findSubExprs( clause.target.arguments.begin(), clause.target.arguments.end(), back_inserter( argAlternatives ) );
    415 
    416                         // List all combinations of arguments
    417                         std::list< AltList > possibilities;
    418                         combos( argAlternatives.begin(), argAlternatives.end(), back_inserter( possibilities ) );
    419 
    420                         AltList                func_candidates;
    421                         std::vector< AltList > args_candidates;
    422 
    423                         // For every possible function :
    424                         //      try matching the arguments to the parameters
    425                         //      not the other way around because we have more arguments than parameters
    426                         SemanticError errors;
    427                         for ( Alternative & func : funcFinder.get_alternatives() ) {
    428                                 try {
    429                                         PointerType * pointer = dynamic_cast< PointerType* >( func.expr->get_result()->stripReferences() );
    430                                         if( !pointer ) {
    431                                                 throw SemanticError( "candidate not viable: not a pointer type\n", func.expr->get_result() );
    432                                         }
    433 
    434                                         FunctionType * function = dynamic_cast< FunctionType* >( pointer->get_base() );
    435                                         if( !function ) {
    436                                                 throw SemanticError( "candidate not viable: not a function type\n", pointer->get_base() );
    437                                         }
    438 
    439 
    440                                         {
    441                                                 auto param     = function->parameters.begin();
    442                                                 auto param_end = function->parameters.end();
    443 
    444                                                 if( !advance_to_mutex( param, param_end ) ) {
    445                                                         throw SemanticError("candidate function not viable: no mutex parameters\n", function);
    446                                                 }
    447                                         }
    448 
    449                                         Alternative newFunc( func );
    450                                         // Strip reference from function
    451                                         referenceToRvalueConversion( newFunc.expr );
    452 
    453                                         // For all the set of arguments we have try to match it with the parameter of the current function alternative
    454                                         for ( auto & argsList : possibilities ) {
    455 
    456                                                 try {
    457                                                         // Declare data structures need for resolution
    458                                                         OpenVarSet openVars;
    459                                                         AssertionSet resultNeed, resultHave;
    460                                                         TypeEnvironment resultEnv;
    461 
    462                                                         // Load type variables from arguemnts into one shared space
    463                                                         simpleCombineEnvironments( argsList.begin(), argsList.end(), resultEnv );
    464 
    465                                                         // Make sure we don't widen any existing bindings
    466                                                         for ( auto & i : resultEnv ) {
    467                                                                 i.allowWidening = false;
    468                                                         }
    469 
    470                                                         // Find any unbound type variables
    471                                                         resultEnv.extractOpenVars( openVars );
    472 
    473                                                         auto param     = function->parameters.begin();
    474                                                         auto param_end = function->parameters.end();
    475 
    476                                                         // For every arguments of its set, check if it matches one of the parameter
    477                                                         // The order is important
    478                                                         for( auto & arg : argsList ) {
    479 
    480                                                                 // Ignore non-mutex arguments
    481                                                                 if( !advance_to_mutex( param, param_end ) ) {
    482                                                                         // We ran out of parameters but still have arguments
    483                                                                         // this function doesn't match
    484                                                                         throw SemanticError("candidate function not viable: too many mutex arguments\n", function);
    485                                                                 }
    486 
    487                                                                 // Check if the argument matches the parameter type in the current scope
    488                                                                 if( ! unify( (*param)->get_type(), arg.expr->get_result(), resultEnv, resultNeed, resultHave, openVars, this->indexer ) ) {
    489                                                                         // Type doesn't match
    490                                                                         stringstream ss;
    491                                                                         ss << "candidate function not viable: no known convertion from '";
    492                                                                         arg.expr->get_result()->print( ss );
    493                                                                         ss << "' to '";
    494                                                                         (*param)->get_type()->print( ss );
    495                                                                         ss << "'\n";
    496                                                                         throw SemanticError(ss.str(), function);
    497                                                                 }
    498 
    499                                                                 param++;
    500                                                         }
    501 
    502                                                         // All arguments match !
    503 
    504                                                         // Check if parameters are missing
    505                                                         if( advance_to_mutex( param, param_end ) ) {
    506                                                                 // We ran out of arguments but still have parameters left
    507                                                                 // this function doesn't match
    508                                                                 throw SemanticError("candidate function not viable: too few mutex arguments\n", function);
    509                                                         }
    510 
    511                                                         // All parameters match !
    512 
    513                                                         // Finish the expressions to tie in the proper environments
    514                                                         finishExpr( newFunc.expr, resultEnv );
    515                                                         for( Alternative & alt : argsList ) {
    516                                                                 finishExpr( alt.expr, resultEnv );
    517                                                         }
    518 
    519                                                         // This is a match store it and save it for later
    520                                                         func_candidates.push_back( newFunc );
    521                                                         args_candidates.push_back( argsList );
    522 
    523                                                 }
    524                                                 catch( SemanticError &e ) {
    525                                                         errors.append( e );
    526                                                 }
    527                                         }
    528                                 }
    529                                 catch( SemanticError &e ) {
    530                                         errors.append( e );
    531                                 }
    532                         }
    533 
    534                         // Make sure we got the right number of arguments
    535                         if( func_candidates.empty() )    { SemanticError top( "No alternatives for function in call to waitfor"  ); top.append( errors ); throw top; }
    536                         if( args_candidates.empty() )    { SemanticError top( "No alternatives for arguments in call to waitfor" ); top.append( errors ); throw top; }
    537                         if( func_candidates.size() > 1 ) { SemanticError top( "Ambiguous function in call to waitfor"            ); top.append( errors ); throw top; }
    538                         if( args_candidates.size() > 1 ) { SemanticError top( "Ambiguous arguments in call to waitfor"           ); top.append( errors ); throw top; }
    539 
    540 
    541                         // Swap the results from the alternative with the unresolved values.
    542                         // Alternatives will handle deletion on destruction
    543                         std::swap( clause.target.function, func_candidates.front().expr );
    544                         for( auto arg_pair : group_iterate( clause.target.arguments, args_candidates.front() ) ) {
    545                                 std::swap ( std::get<0>( arg_pair), std::get<1>( arg_pair).expr );
    546                         }
    547 
    548                         // Resolve the conditions as if it were an IfStmt
    549                         // Resolve the statments normally
    550                         findSingleExpression( clause.condition, this->indexer );
    551                         clause.statement->accept( *visitor );
    552                 }
    553 
    554 
    555                 if( stmt->timeout.statement ) {
    556                         // Resolve the timeout as an size_t for now
    557                         // Resolve the conditions as if it were an IfStmt
    558                         // Resolve the statments normally
    559                         findSingleExpression( stmt->timeout.time, new BasicType( noQualifiers, BasicType::LongLongUnsignedInt ), this->indexer );
    560                         findSingleExpression( stmt->timeout.condition, this->indexer );
    561                         stmt->timeout.statement->accept( *visitor );
    562                 }
    563 
    564                 if( stmt->orelse.statement ) {
    565                         // Resolve the conditions as if it were an IfStmt
    566                         // Resolve the statments normally
    567                         findSingleExpression( stmt->orelse.condition, this->indexer );
    568                         stmt->orelse.statement->accept( *visitor );
     384                if ( catchStmt->get_cond() ) {
     385                        Expression * wrapped = new CastExpr(
     386                                catchStmt->get_cond(),
     387                                new BasicType( noQualifiers, BasicType::Bool )
     388                                );
     389                        catchStmt->set_cond( findSingleExpression( wrapped, indexer ) );
    569390                }
    570391        }
     
    582403                visit_children = false;
    583404                // resolve initialization using the possibilities as determined by the currentObject cursor
    584                 Expression * newExpr = new UntypedInitExpr( singleInit->value, currentObject.getOptions() );
    585                 findSingleExpression( newExpr, indexer );
     405                UntypedInitExpr * untyped = new UntypedInitExpr( singleInit->get_value(), currentObject.getOptions() );
     406                Expression * newExpr = findSingleExpression( untyped, indexer );
    586407                InitExpr * initExpr = strict_dynamic_cast< InitExpr * >( newExpr );
    587408
     
    590411
    591412                // discard InitExpr wrapper and retain relevant pieces
    592                 newExpr = initExpr->expr;
    593                 initExpr->expr = nullptr;
    594                 std::swap( initExpr->env, newExpr->env );
    595                 std::swap( initExpr->inferParams, newExpr->inferParams ) ;
     413                newExpr = initExpr->get_expr();
     414                newExpr->set_env( initExpr->get_env() );
     415                initExpr->set_expr( nullptr );
     416                initExpr->set_env( nullptr );
    596417                delete initExpr;
    597418
    598419                // get the actual object's type (may not exactly match what comes back from the resolver due to conversions)
    599420                Type * initContext = currentObject.getCurrentType();
    600 
    601                 removeExtraneousCast( newExpr, indexer );
    602421
    603422                // check if actual object's type is char[]
     
    607426                                if ( PointerType * pt = dynamic_cast< PointerType *>( newExpr->get_result() ) ) {
    608427                                        if ( isCharType( pt->get_base() ) ) {
    609                                                 if ( CastExpr *ce = dynamic_cast< CastExpr * >( newExpr ) ) {
    610                                                         // strip cast if we're initializing a char[] with a char *, e.g.  char x[] = "hello";
    611                                                         newExpr = ce->get_arg();
    612                                                         ce->set_arg( nullptr );
    613                                                         std::swap( ce->env, newExpr->env );
    614                                                         delete ce;
    615                                                 }
     428                                                // strip cast if we're initializing a char[] with a char *, e.g.  char x[] = "hello";
     429                                                CastExpr *ce = strict_dynamic_cast< CastExpr * >( newExpr );
     430                                                newExpr = ce->get_arg();
     431                                                ce->set_arg( nullptr );
     432                                                delete ce;
    616433                                        }
    617434                                }
     
    620437
    621438                // set initializer expr to resolved express
    622                 singleInit->value = newExpr;
     439                singleInit->set_value( newExpr );
    623440
    624441                // move cursor to next object in preparation for next initializer
  • src/ResolvExpr/Resolver.h

    r3f7e12cb r78315272  
    2929        /// Checks types and binds syntactic constructs to typed representations
    3030        void resolve( std::list< Declaration * > translationUnit );
    31         void resolveDecl( Declaration *, const SymTab::Indexer &indexer );
    32         Expression *resolveInVoidContext( Expression * expr, const SymTab::Indexer &indexer );
    33         void findVoidExpression( Expression *& untyped, const SymTab::Indexer &indexer );
    34         void findSingleExpression( Expression *& untyped, const SymTab::Indexer &indexer );
     31        Expression *resolveInVoidContext( Expression *expr, const SymTab::Indexer &indexer );
     32        Expression *findVoidExpression( Expression *untyped, const SymTab::Indexer &indexer );
    3533        void resolveCtorInit( ConstructorInit * ctorInit, const SymTab::Indexer & indexer );
    3634        void resolveStmtExpr( StmtExpr * stmtExpr, const SymTab::Indexer & indexer );
  • src/ResolvExpr/TypeEnvironment.cc

    r3f7e12cb r78315272  
    6868        }
    6969
    70         void EqvClass::print( std::ostream &os, Indenter indent ) const {
    71                 os << "( ";
     70        void EqvClass::print( std::ostream &os, int indent ) const {
     71                os << std::string( indent, ' ' ) << "( ";
    7272                std::copy( vars.begin(), vars.end(), std::ostream_iterator< std::string >( os, " " ) );
    7373                os << ")";
    7474                if ( type ) {
    7575                        os << " -> ";
    76                         type->print( os, indent+1 );
     76                        type->print( os, indent );
    7777                } // if
    7878                if ( ! allowWidening ) {
     
    123123                for ( std::list< EqvClass >::const_iterator theClass = env.begin(); theClass != env.end(); ++theClass ) {
    124124                        for ( std::set< std::string >::const_iterator theVar = theClass->vars.begin(); theVar != theClass->vars.end(); ++theVar ) {
    125 ///       std::cerr << "adding " << *theVar;
     125///       std::cout << "adding " << *theVar;
    126126                                if ( theClass->type ) {
    127 ///         std::cerr << " bound to ";
    128 ///         theClass->type->print( std::cerr );
    129 ///         std::cerr << std::endl;
     127///         std::cout << " bound to ";
     128///         theClass->type->print( std::cout );
     129///         std::cout << std::endl;
    130130                                        sub.add( *theVar, theClass->type );
    131131                                } else if ( theVar != theClass->vars.begin() ) {
    132132                                        TypeInstType *newTypeInst = new TypeInstType( Type::Qualifiers(), *theClass->vars.begin(), theClass->data.kind == TypeDecl::Ftype );
    133 ///         std::cerr << " bound to variable " << *theClass->vars.begin() << std::endl;
     133///         std::cout << " bound to variable " << *theClass->vars.begin() << std::endl;
    134134                                        sub.add( *theVar, newTypeInst );
    135135                                        delete newTypeInst;
     
    144144        }
    145145
    146         void TypeEnvironment::print( std::ostream &os, Indenter indent ) const {
     146        void TypeEnvironment::print( std::ostream &os, int indent ) const {
    147147                for ( std::list< EqvClass >::const_iterator i = env.begin(); i != env.end(); ++i ) {
    148148                        i->print( os, indent );
  • src/ResolvExpr/TypeEnvironment.h

    r3f7e12cb r78315272  
    6868                EqvClass &operator=( const EqvClass &other );
    6969                ~EqvClass();
    70                 void print( std::ostream &os, Indenter indent = {} ) const;
     70                void print( std::ostream &os, int indent = 0 ) const;
    7171        };
    7272
     
    8080                void makeSubstitution( TypeSubstitution &result ) const;
    8181                bool isEmpty() const { return env.empty(); }
    82                 void print( std::ostream &os, Indenter indent = {} ) const;
     82                void print( std::ostream &os, int indent = 0 ) const;
    8383                void combine( const TypeEnvironment &second, Type *(*combineFunc)( Type*, Type* ) );
    8484                void simpleCombine( const TypeEnvironment &second );
  • src/ResolvExpr/Unify.cc

    r3f7e12cb r78315272  
    1717#include <iterator>               // for back_insert_iterator, back_inserter
    1818#include <map>                    // for _Rb_tree_const_iterator, _Rb_tree_i...
    19 #include <memory>                 // for unique_ptr
     19#include <memory>                 // for unique_ptr, auto_ptr
    2020#include <set>                    // for set
    2121#include <string>                 // for string, operator==, operator!=, bas...
    2222#include <utility>                // for pair
    2323
    24 #include "Common/PassVisitor.h"   // for PassVisitor
    2524#include "FindOpenVars.h"         // for findOpenVars
    2625#include "Parser/LinkageSpec.h"   // for C
     
    138137        bool tyVarCompatible( const TypeDecl::Data & data, Type *type ) {
    139138                switch ( data.kind ) {
     139                  case TypeDecl::Any:
    140140                  case TypeDecl::Dtype:
    141141                        // to bind to an object type variable, the type must not be a function type.
     
    169169                                Type *common = 0;
    170170                                // attempt to unify equivalence class type (which has qualifiers stripped, so they must be restored) with the type to bind to
    171                                 std::unique_ptr< Type > newType( curClass.type->clone() );
     171                                std::auto_ptr< Type > newType( curClass.type->clone() );
    172172                                newType->get_qualifiers() = typeInst->get_qualifiers();
    173173                                if ( unifyInexact( newType.get(), other, env, needAssertions, haveAssertions, openVars, widenMode & WidenMode( curClass.allowWidening, true ), indexer, common ) ) {
     
    458458                if ( otherArray && arrayType->get_isVarLen() == otherArray->get_isVarLen() ) {
    459459
     460                        // not positive this is correct in all cases, but it's needed for typedefs
     461                        if ( arrayType->get_isVarLen() || otherArray->get_isVarLen() ) {
     462                                return;
     463                        }
     464
    460465                        if ( ! arrayType->get_isVarLen() && ! otherArray->get_isVarLen() &&
    461466                                arrayType->get_dimension() != 0 && otherArray->get_dimension() != 0 ) {
     
    532537        /// If this isn't done then argument lists can have wildly different
    533538        /// size and structure, when they should be compatible.
    534         struct TtypeExpander : public WithShortCircuiting {
    535                 TypeEnvironment & tenv;
    536                 TtypeExpander( TypeEnvironment & tenv ) : tenv( tenv ) {}
    537                 void premutate( TypeInstType * ) { visit_children = false; }
    538                 Type * postmutate( TypeInstType * typeInst ) {
     539        struct TtypeExpander : public Mutator {
     540                TypeEnvironment & env;
     541                TtypeExpander( TypeEnvironment & env ) : env( env ) {}
     542                Type * mutate( TypeInstType * typeInst ) {
    539543                        EqvClass eqvClass;
    540                         if ( tenv.lookup( typeInst->get_name(), eqvClass ) ) {
     544                        if ( env.lookup( typeInst->get_name(), eqvClass ) ) {
    541545                                if ( eqvClass.data.kind == TypeDecl::Ttype ) {
    542546                                        // expand ttype parameter into its actual type
     
    556560                dst.clear();
    557561                for ( DeclarationWithType * dcl : src ) {
    558                         PassVisitor<TtypeExpander> expander( env );
     562                        TtypeExpander expander( env );
    559563                        dcl->acceptMutator( expander );
    560564                        std::list< Type * > types;
     
    746750                        std::list<Type *> types1, types2;
    747751
    748                         PassVisitor<TtypeExpander> expander( env );
     752                        TtypeExpander expander( env );
    749753                        flat1->acceptMutator( expander );
    750754                        flat2->acceptMutator( expander );
  • src/SymTab/Autogen.cc

    r3f7e12cb r78315272  
    1616#include "Autogen.h"
    1717
     18#include <cstddef>                 // for NULL
    1819#include <algorithm>               // for count_if
    1920#include <cassert>                 // for strict_dynamic_cast, assert, assertf
     
    2627#include "AddVisit.h"              // for addVisit
    2728#include "CodeGen/OperatorTable.h" // for isCtorDtor, isCtorDtorAssign
    28 #include "Common/PassVisitor.h"    // for PassVisitor
    2929#include "Common/ScopedMap.h"      // for ScopedMap<>::const_iterator, Scope...
    3030#include "Common/utility.h"        // for cloneAll, operator+
     31#include "GenPoly/DeclMutator.h"   // for DeclMutator
    3132#include "GenPoly/ScopedSet.h"     // for ScopedSet, ScopedSet<>::iterator
    32 #include "InitTweak/GenInit.h"     // for fixReturnStatements
    33 #include "ResolvExpr/Resolver.h"   // for resolveDecl
    3433#include "SymTab/Mangler.h"        // for Mangler
    3534#include "SynTree/Attribute.h"     // For Attribute
     
    4342namespace SymTab {
    4443        Type * SizeType = 0;
    45 
    46         /// Data used to generate functions generically. Specifically, the name of the generated function and a function which generates the routine protoype
     44        typedef ScopedMap< std::string, bool > TypeMap;
     45
     46        /// Data used to generate functions generically. Specifically, the name of the generated function, a function which generates the routine protoype, and a map which contains data to determine whether a function should be generated.
    4747        struct FuncData {
    4848                typedef FunctionType * (*TypeGen)( Type * );
    49                 FuncData( const std::string & fname, const TypeGen & genType ) : fname( fname ), genType( genType ) {}
     49                FuncData( const std::string & fname, const TypeGen & genType, TypeMap & map ) : fname( fname ), genType( genType ), map( map ) {}
    5050                std::string fname;
    5151                TypeGen genType;
     52                TypeMap & map;
    5253        };
    5354
    54         struct AutogenerateRoutines final : public WithDeclsToAdd, public WithVisitorRef<AutogenerateRoutines>, public WithGuards, public WithShortCircuiting, public WithIndexer {
     55        class AutogenerateRoutines final : public Visitor {
     56            template< typename Visitor >
     57            friend void acceptAndAdd( std::list< Declaration * > &translationUnit, Visitor &visitor );
     58            template< typename Visitor >
     59            friend void addVisitStatementList( std::list< Statement* > &stmts, Visitor &visitor );
     60          public:
     61                std::list< Declaration * > &get_declsToAdd() { return declsToAdd; }
     62
     63                typedef Visitor Parent;
     64                using Parent::visit;
     65
    5566                AutogenerateRoutines();
    5667
    57                 void previsit( EnumDecl * enumDecl );
    58                 void previsit( StructDecl * structDecl );
    59                 void previsit( UnionDecl * structDecl );
    60                 void previsit( TypeDecl * typeDecl );
    61                 void previsit( TraitDecl * traitDecl );
    62                 void previsit( FunctionDecl * functionDecl );
    63 
    64                 void previsit( FunctionType * ftype );
    65                 void previsit( PointerType * ptype );
    66 
    67                 void previsit( CompoundStmt * compoundStmt );
     68                virtual void visit( EnumDecl *enumDecl );
     69                virtual void visit( StructDecl *structDecl );
     70                virtual void visit( UnionDecl *structDecl );
     71                virtual void visit( TypeDecl *typeDecl );
     72                virtual void visit( TraitDecl *ctxDecl );
     73                virtual void visit( FunctionDecl *functionDecl );
     74
     75                virtual void visit( FunctionType *ftype );
     76                virtual void visit( PointerType *ftype );
     77
     78                virtual void visit( CompoundStmt *compoundStmt );
     79                virtual void visit( SwitchStmt *switchStmt );
    6880
    6981          private:
    70 
    71                 GenPoly::ScopedSet< std::string > structsDone;
     82                template< typename StmtClass > void visitStatement( StmtClass *stmt );
     83
     84                std::list< Declaration * > declsToAdd, declsToAddAfter;
     85                std::set< std::string > structsDone;
    7286                unsigned int functionNesting = 0;     // current level of nested functions
    73 
    74                 InitTweak::ManagedTypes managedTypes;
     87                /// Note: the following maps could be ScopedSets, but it should be easier to work
     88                /// deleted functions in if they are maps, since the value false can be inserted
     89                /// at the current scope without affecting outer scopes or requiring copies.
     90                TypeMap copyable, assignable, constructable, destructable;
    7591                std::vector< FuncData > data;
    7692        };
    7793
    7894        /// generates routines for tuple types.
    79         struct AutogenTupleRoutines : public WithDeclsToAdd, public WithVisitorRef<AutogenTupleRoutines>, public WithGuards, public WithShortCircuiting {
    80                 void previsit( FunctionDecl * functionDecl );
    81 
    82                 void postvisit( TupleType * tupleType );
    83 
    84                 void previsit( CompoundStmt * compoundStmt );
     95        /// Doesn't really need to be a mutator, but it's easier to reuse DeclMutator than it is to use AddVisit
     96        /// or anything we currently have that supports adding new declarations for visitors
     97        class AutogenTupleRoutines : public GenPoly::DeclMutator {
     98          public:
     99                typedef GenPoly::DeclMutator Parent;
     100                using Parent::mutate;
     101
     102                virtual DeclarationWithType * mutate( FunctionDecl *functionDecl );
     103
     104                virtual Type * mutate( TupleType *tupleType );
     105
     106                virtual CompoundStmt * mutate( CompoundStmt *compoundStmt );
    85107
    86108          private:
     
    90112
    91113        void autogenerateRoutines( std::list< Declaration * > &translationUnit ) {
    92                 PassVisitor<AutogenerateRoutines> generator;
    93                 acceptAll( translationUnit, generator );
     114                AutogenerateRoutines generator;
     115                acceptAndAdd( translationUnit, generator );
    94116
    95117                // needs to be done separately because AutogenerateRoutines skips types that appear as function arguments, etc.
    96118                // AutogenTupleRoutines tupleGenerator;
    97                 // acceptAll( translationUnit, tupleGenerator );
    98         }
    99 
    100         //=============================================================================================
    101         // FuncGenerator definitions
    102         //=============================================================================================
    103         class FuncGenerator {
    104         public:
    105                 std::list< Declaration * > definitions, forwards;
    106 
    107                 FuncGenerator( Type * type, const std::vector< FuncData > & data, unsigned int functionNesting, SymTab::Indexer & indexer ) : type( type ), data( data ), functionNesting( functionNesting ), indexer( indexer ) {}
    108 
    109                 virtual bool shouldAutogen() const = 0;
    110                 void genStandardFuncs();
    111                 virtual void genFieldCtors() = 0;
    112         protected:
    113                 Type * type;
    114                 const std::vector< FuncData > & data;
    115                 unsigned int functionNesting;
    116                 SymTab::Indexer & indexer;
    117 
    118                 virtual void genFuncBody( FunctionDecl * dcl ) = 0;
    119                 virtual bool isConcurrentType() const = 0;
    120 
    121                 void resolve( FunctionDecl * dcl );
    122                 void generatePrototypes( std::list< FunctionDecl * > & newFuncs );
    123         };
    124 
    125         class StructFuncGenerator : public FuncGenerator {
    126                 StructDecl * aggregateDecl;
    127         public:
    128                 StructFuncGenerator( StructDecl * aggregateDecl, StructInstType * refType, const std::vector< FuncData > & data,  unsigned int functionNesting, SymTab::Indexer & indexer ) : FuncGenerator( refType, data, functionNesting, indexer ), aggregateDecl( aggregateDecl) {}
    129 
    130                 virtual bool shouldAutogen() const override;
    131                 virtual bool isConcurrentType() const override;
    132 
    133                 virtual void genFuncBody( FunctionDecl * dcl ) override;
    134                 virtual void genFieldCtors() override;
    135 
    136         private:
    137                 /// generates a single struct member operation (constructor call, destructor call, assignment call)
    138                 void makeMemberOp( ObjectDecl * dstParam, Expression * src, DeclarationWithType * field, FunctionDecl * func, bool forward = true );
    139 
    140                 /// generates the body of a struct function by iterating the struct members (via parameters) - generates default ctor, copy ctor, assignment, and dtor bodies, but NOT field ctor bodies
    141                 template<typename Iterator>
    142                 void makeFunctionBody( Iterator member, Iterator end, FunctionDecl * func, bool forward = true );
    143 
    144                 /// generate the body of a constructor which takes parameters that match fields, e.g.
    145                 /// void ?{}(A *, int) and void?{}(A *, int, int) for a struct A which has two int fields.
    146                 template<typename Iterator>
    147                 void makeFieldCtorBody( Iterator member, Iterator end, FunctionDecl * func );
    148         };
    149 
    150         class UnionFuncGenerator : public FuncGenerator {
    151                 UnionDecl * aggregateDecl;
    152         public:
    153                 UnionFuncGenerator( UnionDecl * aggregateDecl, UnionInstType * refType, const std::vector< FuncData > & data,  unsigned int functionNesting, SymTab::Indexer & indexer ) : FuncGenerator( refType, data, functionNesting, indexer ), aggregateDecl( aggregateDecl) {}
    154 
    155                 virtual bool shouldAutogen() const override;
    156                 virtual bool isConcurrentType() const override;
    157 
    158                 virtual void genFuncBody( FunctionDecl * dcl ) override;
    159                 virtual void genFieldCtors() override;
    160 
    161         private:
    162                 /// generates a single struct member operation (constructor call, destructor call, assignment call)
    163                 template<typename OutputIterator>
    164                 void makeMemberOp( ObjectDecl * srcParam, ObjectDecl * dstParam, OutputIterator out );
    165 
    166                 /// generates the body of a struct function by iterating the struct members (via parameters) - generates default ctor, copy ctor, assignment, and dtor bodies, but NOT field ctor bodies
    167                 template<typename Iterator>
    168                 void makeFunctionBody( Iterator member, Iterator end, FunctionDecl * func, bool forward = true );
    169 
    170                 /// generate the body of a constructor which takes parameters that match fields, e.g.
    171                 /// void ?{}(A *, int) and void?{}(A *, int, int) for a struct A which has two int fields.
    172                 template<typename Iterator>
    173                 void makeFieldCtorBody( Iterator member, Iterator end, FunctionDecl * func );
    174         };
    175 
    176         class EnumFuncGenerator : public FuncGenerator {
    177         public:
    178                 EnumFuncGenerator( EnumInstType * refType, const std::vector< FuncData > & data,  unsigned int functionNesting, SymTab::Indexer & indexer ) : FuncGenerator( refType, data, functionNesting, indexer ) {}
    179 
    180                 virtual bool shouldAutogen() const override;
    181                 virtual bool isConcurrentType() const override;
    182 
    183                 virtual void genFuncBody( FunctionDecl * dcl ) override;
    184                 virtual void genFieldCtors() override;
    185 
    186         private:
    187         };
    188 
    189         class TypeFuncGenerator : public FuncGenerator {
    190                 TypeDecl * typeDecl;
    191         public:
    192                 TypeFuncGenerator( TypeDecl * typeDecl, TypeInstType * refType, const std::vector<FuncData> & data, unsigned int functionNesting, SymTab::Indexer & indexer ) : FuncGenerator( refType, data, functionNesting, indexer ), typeDecl( typeDecl ) {}
    193 
    194                 virtual bool shouldAutogen() const override;
    195                 virtual void genFuncBody( FunctionDecl * dcl ) override;
    196                 virtual bool isConcurrentType() const override;
    197                 virtual void genFieldCtors() override;
    198         };
    199 
    200         //=============================================================================================
    201         // helper functions
    202         //=============================================================================================
    203         void generateFunctions( FuncGenerator & gen, std::list< Declaration * > & declsToAdd ) {
    204                 if ( ! gen.shouldAutogen() ) return;
    205 
    206                 // generate each of the functions based on the supplied FuncData objects
    207                 gen.genStandardFuncs();
    208                 gen.genFieldCtors();
    209 
    210                 declsToAdd.splice( declsToAdd.end(), gen.forwards );
    211                 declsToAdd.splice( declsToAdd.end(), gen.definitions );
     119                // tupleGenerator.mutateDeclarationList( translationUnit );
    212120        }
    213121
    214122        bool isUnnamedBitfield( ObjectDecl * obj ) {
    215                 return obj != nullptr && obj->name == "" && obj->bitfieldWidth != nullptr;
     123                return obj != NULL && obj->get_name() == "" && obj->get_bitfieldWidth() != NULL;
    216124        }
    217125
     
    219127        void addForwardDecl( FunctionDecl * functionDecl, std::list< Declaration * > & declsToAdd ) {
    220128                FunctionDecl * decl = functionDecl->clone();
    221                 delete decl->statements;
    222                 decl->statements = nullptr;
     129                delete decl->get_statements();
     130                decl->set_statements( NULL );
    223131                declsToAdd.push_back( decl );
    224132                decl->fixUniqueId();
    225133        }
    226134
    227         const std::list< TypeDecl * > getGenericParams( Type * t ) {
    228                 std::list< TypeDecl * > * ret = nullptr;
    229                 if ( StructInstType * inst = dynamic_cast< StructInstType * > ( t ) ) {
    230                         ret = inst->get_baseParameters();
    231                 } else if ( UnionInstType * inst = dynamic_cast< UnionInstType * >( t ) ) {
    232                         ret = inst->get_baseParameters();
    233                 }
    234                 return ret ? *ret : std::list< TypeDecl * >();
    235         }
    236 
    237135        /// given type T, generate type of default ctor/dtor, i.e. function type void (*) (T *)
    238136        FunctionType * genDefaultType( Type * paramType ) {
    239                 const auto & typeParams = getGenericParams( paramType );
    240137                FunctionType *ftype = new FunctionType( Type::Qualifiers(), false );
    241                 cloneAll( typeParams, ftype->forall );
    242138                ObjectDecl *dstParam = new ObjectDecl( "_dst", Type::StorageClasses(), LinkageSpec::Cforall, nullptr, new ReferenceType( Type::Qualifiers(), paramType->clone() ), nullptr );
    243                 ftype->parameters.push_back( dstParam );
     139                ftype->get_parameters().push_back( dstParam );
     140
    244141                return ftype;
    245142        }
     
    249146                FunctionType *ftype = genDefaultType( paramType );
    250147                ObjectDecl *srcParam = new ObjectDecl( "_src", Type::StorageClasses(), LinkageSpec::Cforall, nullptr, paramType->clone(), nullptr );
    251                 ftype->parameters.push_back( srcParam );
     148                ftype->get_parameters().push_back( srcParam );
    252149                return ftype;
    253150        }
     
    257154                FunctionType *ftype = genCopyType( paramType );
    258155                ObjectDecl *returnVal = new ObjectDecl( "_ret", Type::StorageClasses(), LinkageSpec::Cforall, nullptr, paramType->clone(), nullptr );
    259                 ftype->returnVals.push_back( returnVal );
     156                ftype->get_returnVals().push_back( returnVal );
    260157                return ftype;
    261158        }
     
    274171        }
    275172
    276         Type * declToType( Declaration * decl ) {
    277                 if ( DeclarationWithType * dwt = dynamic_cast< DeclarationWithType * >( decl ) ) {
    278                         return dwt->get_type();
    279                 }
    280                 return nullptr;
    281         }
    282 
    283         Type * declToTypeDeclBase( Declaration * decl ) {
    284                 if ( TypeDecl * td = dynamic_cast< TypeDecl * >( decl ) ) {
    285                         return td->base;
    286                 }
    287                 return nullptr;
    288         }
    289 
    290         //=============================================================================================
    291         // FuncGenerator member definitions
    292         //=============================================================================================
    293         void FuncGenerator::genStandardFuncs() {
    294                 std::list< FunctionDecl * > newFuncs;
    295                 generatePrototypes( newFuncs );
    296 
    297                 for ( FunctionDecl * dcl : newFuncs ) {
    298                         genFuncBody( dcl );
    299                         if ( CodeGen::isAssignment( dcl->name ) ) {
    300                                 // assignment needs to return a value
    301                                 FunctionType * assignType = dcl->type;
    302                                 assert( assignType->parameters.size() == 2 );
    303                                 assert( assignType->returnVals.size() == 1 );
    304                                 ObjectDecl * dstParam = strict_dynamic_cast< ObjectDecl * >( assignType->parameters.front() );
    305                                 dcl->statements->push_back( new ReturnStmt( noLabels, new VariableExpr( dstParam ) ) );
    306                         }
    307                         resolve( dcl );
    308                 }
    309         }
    310 
    311         void FuncGenerator::generatePrototypes( std::list< FunctionDecl * > & newFuncs ) {
    312                 bool concurrent_type = isConcurrentType();
    313                 for ( const FuncData & d : data ) {
    314                         // generate a function (?{}, ?=?, ^?{}) based on the current FuncData.
    315                         FunctionType * ftype = d.genType( type );
    316 
    317                         // destructor for concurrent type must be mutex
    318                         if ( concurrent_type && CodeGen::isDestructor( d.fname ) ) {
     173        /// inserts base type of first argument into map if pred(funcDecl) is true
     174        void insert( FunctionDecl *funcDecl, TypeMap & map, FunctionDecl * (*pred)(Declaration *) ) {
     175                // insert type into constructable, etc. map if appropriate
     176                if ( pred( funcDecl ) ) {
     177                        FunctionType * ftype = funcDecl->get_functionType();
     178                        assert( ! ftype->get_parameters().empty() );
     179                        Type * t = InitTweak::getPointerBase( ftype->get_parameters().front()->get_type() );
     180                        assert( t );
     181                        map.insert( Mangler::mangleType( t ), true );
     182                }
     183        }
     184
     185        /// using map and t, determines if is constructable, etc.
     186        bool lookup( const TypeMap & map, Type * t ) {
     187                assertf( t, "Autogenerate lookup was given non-type: %s", toString( t ).c_str() );
     188                if ( dynamic_cast< PointerType * >( t ) ) {
     189                        // will need more complicated checking if we want this to work with pointer types, since currently
     190                        return true;
     191                } else if ( ArrayType * at = dynamic_cast< ArrayType * >( t ) ) {
     192                        // an array's constructor, etc. is generated on the fly based on the base type's constructor, etc.
     193                        return lookup( map, at->get_base() );
     194                }
     195                TypeMap::const_iterator it = map.find( Mangler::mangleType( t ) );
     196                if ( it != map.end() ) return it->second;
     197                // something that does not appear in the map is by default not constructable, etc.
     198                return false;
     199        }
     200
     201        /// using map and aggr, examines each member to determine if constructor, etc. should be generated
     202        template<typename Container>
     203        bool shouldGenerate( const TypeMap & map, const Container & container ) {
     204                for ( Type * t : container ) {
     205                        if ( ! lookup( map, t ) ) return false;
     206                }
     207                return true;
     208        }
     209
     210        /// data structure for abstracting the generation of special functions
     211        template< typename OutputIterator, typename Container >
     212        struct FuncGenerator {
     213                const Container & container;
     214                Type *refType;
     215                unsigned int functionNesting;
     216                const std::list< TypeDecl* > & typeParams;
     217                OutputIterator out;
     218                FuncGenerator( const Container & container, Type *refType, unsigned int functionNesting, const std::list< TypeDecl* > & typeParams, OutputIterator out ) : container( container ), refType( refType ), functionNesting( functionNesting ), typeParams( typeParams ), out( out ) {}
     219
     220                /// generates a function (?{}, ?=?, ^?{}) based on the data argument and members. If function is generated, inserts the type into the map.
     221                void gen( const FuncData & data, bool concurrent_type ) {
     222                        if ( ! shouldGenerate( data.map, container ) ) return;
     223                        FunctionType * ftype = data.genType( refType );
     224
     225                        if ( concurrent_type && CodeGen::isDestructor( data.fname ) ) {
    319226                                ftype->parameters.front()->get_type()->set_mutex( true );
    320227                        }
    321228
    322                         newFuncs.push_back( genFunc( d.fname, ftype, functionNesting ) );
    323                 }
    324         }
    325 
    326         void FuncGenerator::resolve( FunctionDecl * dcl ) {
    327                 try {
    328                         ResolvExpr::resolveDecl( dcl, indexer );
    329                         if ( functionNesting == 0 ) {
    330                                 // forward declare if top-level struct, so that
    331                                 // type is complete as soon as its body ends
    332                                 // Note: this is necessary if we want structs which contain
    333                                 // generic (otype) structs as members.
    334                                 addForwardDecl( dcl, forwards );
    335                         }
    336                         definitions.push_back( dcl );
    337                         indexer.addId( dcl );
    338                 } catch ( SemanticError err ) {
    339                         // okay if decl does not resolve - that means the function should not be generated
    340                         delete dcl;
    341                 }
    342         }
    343 
    344         bool StructFuncGenerator::shouldAutogen() const {
    345                 // Builtins do not use autogeneration.
    346                 return ! aggregateDecl->linkage.is_builtin;
    347         }
    348         bool StructFuncGenerator::isConcurrentType() const { return aggregateDecl->is_thread() || aggregateDecl->is_monitor(); }
    349 
    350         void StructFuncGenerator::genFuncBody( FunctionDecl * dcl ) {
    351                 // generate appropriate calls to member ctor, assignment
    352                 // destructor needs to do everything in reverse, so pass "forward" based on whether the function is a destructor
    353                 if ( ! CodeGen::isDestructor( dcl->name ) ) {
    354                         makeFunctionBody( aggregateDecl->members.begin(), aggregateDecl->members.end(), dcl );
    355                 } else {
    356                         makeFunctionBody( aggregateDecl->members.rbegin(), aggregateDecl->members.rend(), dcl, false );
    357                 }
    358         }
    359 
    360         void StructFuncGenerator::genFieldCtors() {
    361                 // field ctors are only generated if default constructor and copy constructor are both generated
    362                 unsigned numCtors = std::count_if( definitions.begin(), definitions.end(), [](Declaration * dcl) { return CodeGen::isConstructor( dcl->name ); } );
    363 
    364                 // Field constructors are only generated if default and copy constructor
    365                 // are generated, since they need access to both
    366                 if ( numCtors != 2 ) return;
    367 
    368                 // create constructors which take each member type as a parameter.
    369                 // for example, for struct A { int x, y; }; generate
    370                 //   void ?{}(A *, int) and void ?{}(A *, int, int)
    371                 FunctionType * memCtorType = genDefaultType( type );
    372                 for ( Declaration * member : aggregateDecl->members ) {
    373                         DeclarationWithType * field = strict_dynamic_cast<DeclarationWithType *>( member );
    374                         if ( isUnnamedBitfield( dynamic_cast< ObjectDecl * > ( field ) ) ) {
    375                                 // don't make a function whose parameter is an unnamed bitfield
    376                                 continue;
    377                         }
    378                         memCtorType->parameters.push_back( new ObjectDecl( field->name, Type::StorageClasses(), LinkageSpec::Cforall, 0, field->get_type()->clone(), 0 ) );
    379                         FunctionDecl * ctor = genFunc( "?{}", memCtorType->clone(), functionNesting );
    380                         makeFieldCtorBody( aggregateDecl->members.begin(), aggregateDecl->members.end(), ctor );
    381                         resolve( ctor );
    382                 }
    383                 delete memCtorType;
    384         }
    385 
    386         void StructFuncGenerator::makeMemberOp( ObjectDecl * dstParam, Expression * src, DeclarationWithType * field, FunctionDecl * func, bool forward ) {
     229                        cloneAll( typeParams, ftype->forall );
     230                        *out++ = genFunc( data.fname, ftype, functionNesting );
     231                        data.map.insert( Mangler::mangleType( refType ), true );
     232                }
     233        };
     234
     235        template< typename OutputIterator, typename Container >
     236        FuncGenerator<OutputIterator, Container> makeFuncGenerator( const Container & container, Type *refType, unsigned int functionNesting, const std::list< TypeDecl* > & typeParams, OutputIterator out ) {
     237                return FuncGenerator<OutputIterator, Container>( container, refType, functionNesting, typeParams, out );
     238        }
     239
     240        /// generates a single enumeration assignment expression
     241        ApplicationExpr * genEnumAssign( FunctionType * ftype, FunctionDecl * assignDecl ) {
     242                // enum copy construct and assignment is just C-style assignment.
     243                // this looks like a bad recursive call, but code gen will turn it into
     244                // a C-style assignment.
     245                // This happens before function pointer type conversion, so need to do it manually here
     246                // NOTE: ftype is not necessarily the functionType belonging to assignDecl - ftype is the
     247                // type of the function that this expression is being generated for (so that the correct
     248                // parameters) are using in the variable exprs
     249                assert( ftype->get_parameters().size() == 2 );
     250                ObjectDecl * dstParam = strict_dynamic_cast< ObjectDecl * >( ftype->get_parameters().front() );
     251                ObjectDecl * srcParam = strict_dynamic_cast< ObjectDecl * >( ftype->get_parameters().back() );
     252
     253                VariableExpr * assignVarExpr = new VariableExpr( assignDecl );
     254                Type * assignVarExprType = assignVarExpr->get_result();
     255                assignVarExprType = new PointerType( Type::Qualifiers(), assignVarExprType );
     256                assignVarExpr->set_result( assignVarExprType );
     257                ApplicationExpr * assignExpr = new ApplicationExpr( assignVarExpr );
     258                assignExpr->get_args().push_back( new VariableExpr( dstParam ) );
     259                assignExpr->get_args().push_back( new VariableExpr( srcParam ) );
     260                return assignExpr;
     261        }
     262
     263        // E ?=?(E volatile*, int),
     264        //   ?=?(E _Atomic volatile*, int);
     265        void makeEnumFunctions( EnumInstType *refType, unsigned int functionNesting, std::list< Declaration * > &declsToAdd ) {
     266
     267                // T ?=?(E *, E);
     268                FunctionType *assignType = genAssignType( refType );
     269
     270                // void ?{}(E *); void ^?{}(E *);
     271                FunctionType * ctorType = genDefaultType( refType->clone() );
     272                FunctionType * dtorType = genDefaultType( refType->clone() );
     273
     274                // void ?{}(E *, E);
     275                FunctionType *copyCtorType = genCopyType( refType->clone() );
     276
     277                // add unused attribute to parameters of default constructor and destructor
     278                ctorType->get_parameters().front()->get_attributes().push_back( new Attribute( "unused" ) );
     279                dtorType->get_parameters().front()->get_attributes().push_back( new Attribute( "unused" ) );
     280
     281                // xxx - should we also generate void ?{}(E *, int) and E ?{}(E *, E)?
     282                // right now these cases work, but that might change.
     283
     284                // xxx - Temporary: make these functions intrinsic so they codegen as C assignment.
     285                // Really they're something of a cross between instrinsic and autogen, so should
     286                // probably make a new linkage type
     287                FunctionDecl *assignDecl = genFunc( "?=?", assignType, functionNesting, true );
     288                FunctionDecl *ctorDecl = genFunc( "?{}", ctorType, functionNesting, true );
     289                FunctionDecl *copyCtorDecl = genFunc( "?{}", copyCtorType, functionNesting, true );
     290                FunctionDecl *dtorDecl = genFunc( "^?{}", dtorType, functionNesting, true );
     291
     292                // body is either return stmt or expr stmt
     293                assignDecl->get_statements()->get_kids().push_back( new ReturnStmt( noLabels, genEnumAssign( assignType, assignDecl ) ) );
     294                copyCtorDecl->get_statements()->get_kids().push_back( new ExprStmt( noLabels, genEnumAssign( copyCtorType, assignDecl ) ) );
     295
     296                declsToAdd.push_back( ctorDecl );
     297                declsToAdd.push_back( copyCtorDecl );
     298                declsToAdd.push_back( dtorDecl );
     299                declsToAdd.push_back( assignDecl ); // assignment should come last since it uses copy constructor in return
     300        }
     301
     302        /// generates a single struct member operation (constructor call, destructor call, assignment call)
     303        void makeStructMemberOp( ObjectDecl * dstParam, Expression * src, DeclarationWithType * field, FunctionDecl * func, bool forward = true ) {
    387304                InitTweak::InitExpander srcParam( src );
    388305
    389306                // assign to destination
    390                 Expression *dstselect = new MemberExpr( field, new CastExpr( new VariableExpr( dstParam ), strict_dynamic_cast< ReferenceType* >( dstParam->get_type() )->base->clone() ) );
    391                 genImplicitCall( srcParam, dstselect, func->name, back_inserter( func->statements->kids ), field, forward );
    392         }
    393 
     307                Expression *dstselect = new MemberExpr( field, new CastExpr( new VariableExpr( dstParam ), strict_dynamic_cast< ReferenceType* >( dstParam->get_type() )->get_base()->clone() ) );
     308                genImplicitCall( srcParam, dstselect, func->get_name(), back_inserter( func->get_statements()->get_kids() ), field, forward );
     309        }
     310
     311        /// generates the body of a struct function by iterating the struct members (via parameters) - generates default ctor, copy ctor, assignment, and dtor bodies, but NOT field ctor bodies
    394312        template<typename Iterator>
    395         void StructFuncGenerator::makeFunctionBody( Iterator member, Iterator end, FunctionDecl * func, bool forward ) {
     313        void makeStructFunctionBody( Iterator member, Iterator end, FunctionDecl * func, bool forward = true ) {
    396314                for ( ; member != end; ++member ) {
    397315                        if ( DeclarationWithType *field = dynamic_cast< DeclarationWithType * >( *member ) ) { // otherwise some form of type declaration, e.g. Aggregate
     
    403321                                }
    404322
    405                                 if ( type->get_const() && CodeGen::isAssignment( func->name ) ) {
     323                                if ( type->get_const() && func->get_name() == "?=?" ) {
    406324                                        // don't assign const members, but do construct/destruct
    407325                                        continue;
    408326                                }
    409327
     328                                if ( field->get_name() == "" ) {
     329                                        // don't assign to anonymous members
     330                                        // xxx - this is a temporary fix. Anonymous members tie into
     331                                        // our inheritance model. I think the correct way to handle this is to
     332                                        // cast the structure to the type of the member and let the resolver
     333                                        // figure out whether it's valid and have a pass afterwards that fixes
     334                                        // the assignment to use pointer arithmetic with the offset of the
     335                                        // member, much like how generic type members are handled.
     336                                        continue;
     337                                }
     338
    410339                                assert( ! func->get_functionType()->get_parameters().empty() );
    411340                                ObjectDecl * dstParam = dynamic_cast<ObjectDecl*>( func->get_functionType()->get_parameters().front() );
    412                                 ObjectDecl * srcParam = nullptr;
     341                                ObjectDecl * srcParam = NULL;
    413342                                if ( func->get_functionType()->get_parameters().size() == 2 ) {
    414343                                        srcParam = dynamic_cast<ObjectDecl*>( func->get_functionType()->get_parameters().back() );
    415344                                }
    416 
    417345                                // srcParam may be NULL, in which case we have default ctor/dtor
    418346                                assert( dstParam );
    419347
    420                                 Expression *srcselect = srcParam ? new MemberExpr( field, new VariableExpr( srcParam ) ) : nullptr;
    421                                 makeMemberOp( dstParam, srcselect, field, func, forward );
     348                                Expression *srcselect = srcParam ? new MemberExpr( field, new VariableExpr( srcParam ) ) : NULL;
     349                                makeStructMemberOp( dstParam, srcselect, field, func, forward );
    422350                        } // if
    423351                } // for
    424         } // makeFunctionBody
    425 
     352        } // makeStructFunctionBody
     353
     354        /// generate the body of a constructor which takes parameters that match fields, e.g.
     355        /// void ?{}(A *, int) and void?{}(A *, int, int) for a struct A which has two int fields.
    426356        template<typename Iterator>
    427         void StructFuncGenerator::makeFieldCtorBody( Iterator member, Iterator end, FunctionDecl * func ) {
    428                 FunctionType * ftype = func->type;
    429                 std::list<DeclarationWithType*> & params = ftype->parameters;
     357        void makeStructFieldCtorBody( Iterator member, Iterator end, FunctionDecl * func ) {
     358                FunctionType * ftype = func->get_functionType();
     359                std::list<DeclarationWithType*> & params = ftype->get_parameters();
    430360                assert( params.size() >= 2 );  // should not call this function for default ctor, etc.
    431361
     
    439369                                        // don't make a function whose parameter is an unnamed bitfield
    440370                                        continue;
     371                                } else if ( field->get_name() == "" ) {
     372                                        // don't assign to anonymous members
     373                                        // xxx - this is a temporary fix. Anonymous members tie into
     374                                        // our inheritance model. I think the correct way to handle this is to
     375                                        // cast the structure to the type of the member and let the resolver
     376                                        // figure out whether it's valid and have a pass afterwards that fixes
     377                                        // the assignment to use pointer arithmetic with the offset of the
     378                                        // member, much like how generic type members are handled.
     379                                        continue;
    441380                                } else if ( parameter != params.end() ) {
    442381                                        // matching parameter, initialize field with copy ctor
    443382                                        Expression *srcselect = new VariableExpr(*parameter);
    444                                         makeMemberOp( dstParam, srcselect, field, func );
     383                                        makeStructMemberOp( dstParam, srcselect, field, func );
    445384                                        ++parameter;
    446385                                } else {
    447386                                        // no matching parameter, initialize field with default ctor
    448                                         makeMemberOp( dstParam, nullptr, field, func );
     387                                        makeStructMemberOp( dstParam, NULL, field, func );
    449388                                }
    450389                        }
     
    452391        }
    453392
    454         bool UnionFuncGenerator::shouldAutogen() const {
     393        Type * declToType( Declaration * decl ) {
     394                if ( DeclarationWithType * dwt = dynamic_cast< DeclarationWithType * >( decl ) ) {
     395                        return dwt->get_type();
     396                }
     397                return nullptr;
     398        }
     399
     400        /// generates struct constructors, destructor, and assignment functions
     401        void makeStructFunctions( StructDecl *aggregateDecl, StructInstType *refType, unsigned int functionNesting, std::list< Declaration * > & declsToAdd, const std::vector< FuncData > & data ) {
    455402                // Builtins do not use autogeneration.
    456                 return ! aggregateDecl->linkage.is_builtin;
    457         }
    458 
    459         // xxx - is this right?
    460         bool UnionFuncGenerator::isConcurrentType() const { return false; };
     403                if ( aggregateDecl->get_linkage() == LinkageSpec::BuiltinCFA ||
     404                         aggregateDecl->get_linkage() == LinkageSpec::BuiltinC ) {
     405                        return;
     406                }
     407
     408                // Make function polymorphic in same parameters as generic struct, if applicable
     409                const std::list< TypeDecl* > & typeParams = aggregateDecl->get_parameters(); // List of type variables to be placed on the generated functions
     410
     411                // generate each of the functions based on the supplied FuncData objects
     412                std::list< FunctionDecl * > newFuncs;
     413                // structure that iterates aggregate decl members, returning their types
     414                auto generator = makeFuncGenerator( lazy_map( aggregateDecl->members, declToType ), refType, functionNesting, typeParams, back_inserter( newFuncs ) );
     415                for ( const FuncData & d : data ) {
     416                        generator.gen( d, aggregateDecl->is_thread() || aggregateDecl->is_monitor() );
     417                }
     418
     419                // field ctors are only generated if default constructor and copy constructor are both generated
     420                unsigned numCtors = std::count_if( newFuncs.begin(), newFuncs.end(), [](FunctionDecl * dcl) { return CodeGen::isConstructor( dcl->get_name() ); } );
     421
     422                if ( functionNesting == 0 ) {
     423                        // forward declare if top-level struct, so that
     424                        // type is complete as soon as its body ends
     425                        // Note: this is necessary if we want structs which contain
     426                        // generic (otype) structs as members.
     427                        for ( FunctionDecl * dcl : newFuncs ) {
     428                                addForwardDecl( dcl, declsToAdd );
     429                        }
     430                }
     431
     432                for ( FunctionDecl * dcl : newFuncs ) {
     433                        // generate appropriate calls to member ctor, assignment
     434                        // destructor needs to do everything in reverse, so pass "forward" based on whether the function is a destructor
     435                        if ( ! CodeGen::isDestructor( dcl->get_name() ) ) {
     436                                makeStructFunctionBody( aggregateDecl->get_members().begin(), aggregateDecl->get_members().end(), dcl );
     437                        } else {
     438                                makeStructFunctionBody( aggregateDecl->get_members().rbegin(), aggregateDecl->get_members().rend(), dcl, false );
     439                        }
     440                        if ( CodeGen::isAssignment( dcl->get_name() ) ) {
     441                                // assignment needs to return a value
     442                                FunctionType * assignType = dcl->get_functionType();
     443                                assert( assignType->get_parameters().size() == 2 );
     444                                ObjectDecl * srcParam = strict_dynamic_cast< ObjectDecl * >( assignType->get_parameters().back() );
     445                                dcl->get_statements()->get_kids().push_back( new ReturnStmt( noLabels, new VariableExpr( srcParam ) ) );
     446                        }
     447                        declsToAdd.push_back( dcl );
     448                }
     449
     450                // create constructors which take each member type as a parameter.
     451                // for example, for struct A { int x, y; }; generate
     452                //   void ?{}(A *, int) and void ?{}(A *, int, int)
     453                // Field constructors are only generated if default and copy constructor
     454                // are generated, since they need access to both
     455                if ( numCtors == 2 ) {
     456                        FunctionType * memCtorType = genDefaultType( refType );
     457                        cloneAll( typeParams, memCtorType->get_forall() );
     458                        for ( std::list<Declaration *>::iterator i = aggregateDecl->get_members().begin(); i != aggregateDecl->get_members().end(); ++i ) {
     459                                DeclarationWithType * member = dynamic_cast<DeclarationWithType *>( *i );
     460                                assert( member );
     461                                if ( isUnnamedBitfield( dynamic_cast< ObjectDecl * > ( member ) ) ) {
     462                                        // don't make a function whose parameter is an unnamed bitfield
     463                                        continue;
     464                                } else if ( member->get_name() == "" ) {
     465                                        // don't assign to anonymous members
     466                                        // xxx - this is a temporary fix. Anonymous members tie into
     467                                        // our inheritance model. I think the correct way to handle this is to
     468                                        // cast the structure to the type of the member and let the resolver
     469                                        // figure out whether it's valid/choose the correct unnamed member
     470                                        continue;
     471                                }
     472                                memCtorType->get_parameters().push_back( new ObjectDecl( member->get_name(), Type::StorageClasses(), LinkageSpec::Cforall, 0, member->get_type()->clone(), 0 ) );
     473                                FunctionDecl * ctor = genFunc( "?{}", memCtorType->clone(), functionNesting );
     474                                makeStructFieldCtorBody( aggregateDecl->get_members().begin(), aggregateDecl->get_members().end(), ctor );
     475                                declsToAdd.push_back( ctor );
     476                        }
     477                        delete memCtorType;
     478                }
     479        }
    461480
    462481        /// generate a single union assignment expression (using memcpy)
    463482        template< typename OutputIterator >
    464         void UnionFuncGenerator::makeMemberOp( ObjectDecl * srcParam, ObjectDecl * dstParam, OutputIterator out ) {
     483        void makeUnionFieldsAssignment( ObjectDecl * srcParam, ObjectDecl * dstParam, OutputIterator out ) {
    465484                UntypedExpr *copy = new UntypedExpr( new NameExpr( "__builtin_memcpy" ) );
    466                 copy->args.push_back( new AddressExpr( new VariableExpr( dstParam ) ) );
    467                 copy->args.push_back( new AddressExpr( new VariableExpr( srcParam ) ) );
    468                 copy->args.push_back( new SizeofExpr( srcParam->get_type()->clone() ) );
     485                copy->get_args().push_back( new AddressExpr( new VariableExpr( dstParam ) ) );
     486                copy->get_args().push_back( new AddressExpr( new VariableExpr( srcParam ) ) );
     487                copy->get_args().push_back( new SizeofExpr( srcParam->get_type()->clone() ) );
    469488                *out++ = new ExprStmt( noLabels, copy );
    470489        }
    471490
    472491        /// generates the body of a union assignment/copy constructor/field constructor
    473         void UnionFuncGenerator::genFuncBody( FunctionDecl * funcDecl ) {
    474                 FunctionType * ftype = funcDecl->type;
    475                 if ( InitTweak::isCopyConstructor( funcDecl ) || InitTweak::isAssignment( funcDecl ) ) {
    476                         assert( ftype->parameters.size() == 2 );
    477                         ObjectDecl * dstParam = strict_dynamic_cast< ObjectDecl * >( ftype->parameters.front() );
    478                         ObjectDecl * srcParam = strict_dynamic_cast< ObjectDecl * >( ftype->parameters.back() );
    479                         makeMemberOp( srcParam, dstParam, back_inserter( funcDecl->statements->kids ) );
    480                 } else {
    481                         // default ctor/dtor body is empty - add unused attribute to parameter to silence warnings
    482                         assert( ftype->parameters.size() == 1 );
    483                         ObjectDecl * dstParam = strict_dynamic_cast< ObjectDecl * >( ftype->parameters.front() );
    484                         dstParam->attributes.push_back( new Attribute( "unused" ) );
    485                 }
    486         }
    487 
    488         /// generate the body of a constructor which takes parameters that match fields, e.g.
    489         /// void ?{}(A *, int) and void?{}(A *, int, int) for a struct A which has two int fields.
    490         void UnionFuncGenerator::genFieldCtors() {
    491                 // field ctors are only generated if default constructor and copy constructor are both generated
    492                 unsigned numCtors = std::count_if( definitions.begin(), definitions.end(), [](Declaration * dcl) { return CodeGen::isConstructor( dcl->get_name() ); } );
    493 
    494                 // Field constructors are only generated if default and copy constructor
    495                 // are generated, since they need access to both
    496                 if ( numCtors != 2 ) return;
     492        void makeUnionAssignBody( FunctionDecl * funcDecl ) {
     493                FunctionType * ftype = funcDecl->get_functionType();
     494                assert( ftype->get_parameters().size() == 2 );
     495                ObjectDecl * dstParam = strict_dynamic_cast< ObjectDecl * >( ftype->get_parameters().front() );
     496                ObjectDecl * srcParam = strict_dynamic_cast< ObjectDecl * >( ftype->get_parameters().back() );
     497
     498                makeUnionFieldsAssignment( srcParam, dstParam, back_inserter( funcDecl->get_statements()->get_kids() ) );
     499                if ( CodeGen::isAssignment( funcDecl->get_name() ) ) {
     500                        // also generate return statement in assignment
     501                        funcDecl->get_statements()->get_kids().push_back( new ReturnStmt( noLabels, new VariableExpr( srcParam ) ) );
     502                }
     503        }
     504
     505        /// generates union constructors, destructors, and assignment operator
     506        void makeUnionFunctions( UnionDecl *aggregateDecl, UnionInstType *refType, unsigned int functionNesting, std::list< Declaration * > & declsToAdd ) {
     507                // Make function polymorphic in same parameters as generic union, if applicable
     508                const std::list< TypeDecl* > & typeParams = aggregateDecl->get_parameters(); // List of type variables to be placed on the generated functions
     509
     510                // default ctor/dtor need only first parameter
     511                // void ?{}(T *); void ^?{}(T *);
     512                FunctionType *ctorType = genDefaultType( refType );
     513                FunctionType *dtorType = genDefaultType( refType );
     514
     515                // copy ctor needs both parameters
     516                // void ?{}(T *, T);
     517                FunctionType *copyCtorType = genCopyType( refType );
     518
     519                // assignment needs both and return value
     520                // T ?=?(T *, T);
     521                FunctionType *assignType = genAssignType( refType );
     522
     523                cloneAll( typeParams, ctorType->get_forall() );
     524                cloneAll( typeParams, dtorType->get_forall() );
     525                cloneAll( typeParams, copyCtorType->get_forall() );
     526                cloneAll( typeParams, assignType->get_forall() );
     527
     528                // add unused attribute to parameters of default constructor and destructor
     529                ctorType->get_parameters().front()->get_attributes().push_back( new Attribute( "unused" ) );
     530                dtorType->get_parameters().front()->get_attributes().push_back( new Attribute( "unused" ) );
     531
     532                // Routines at global scope marked "static" to prevent multiple definitions is separate translation units
     533                // because each unit generates copies of the default routines for each aggregate.
     534                FunctionDecl *assignDecl = genFunc( "?=?", assignType, functionNesting );
     535                FunctionDecl *ctorDecl = genFunc( "?{}",  ctorType, functionNesting );
     536                FunctionDecl *copyCtorDecl = genFunc( "?{}", copyCtorType, functionNesting );
     537                FunctionDecl *dtorDecl = genFunc( "^?{}", dtorType, functionNesting );
     538
     539                makeUnionAssignBody( assignDecl );
     540
     541                // body of assignment and copy ctor is the same
     542                makeUnionAssignBody( copyCtorDecl );
    497543
    498544                // create a constructor which takes the first member type as a parameter.
     
    500546                // void ?{}(A *, int)
    501547                // This is to mimic C's behaviour which initializes the first member of the union.
    502                 FunctionType * memCtorType = genDefaultType( type );
    503                 for ( Declaration * member : aggregateDecl->members ) {
    504                         DeclarationWithType * field = strict_dynamic_cast<DeclarationWithType *>( member );
    505                         if ( isUnnamedBitfield( dynamic_cast< ObjectDecl * > ( field ) ) ) {
    506                                 // don't make a function whose parameter is an unnamed bitfield
     548                std::list<Declaration *> memCtors;
     549                for ( Declaration * member : aggregateDecl->get_members() ) {
     550                        if ( DeclarationWithType * field = dynamic_cast< DeclarationWithType * >( member ) ) {
     551                                ObjectDecl * srcParam = new ObjectDecl( "src", Type::StorageClasses(), LinkageSpec::Cforall, 0, field->get_type()->clone(), 0 );
     552
     553                                FunctionType * memCtorType = ctorType->clone();
     554                                memCtorType->get_parameters().push_back( srcParam );
     555                                FunctionDecl * ctor = genFunc( "?{}", memCtorType, functionNesting );
     556
     557                                makeUnionAssignBody( ctor );
     558                                memCtors.push_back( ctor );
     559                                // only generate a ctor for the first field
    507560                                break;
    508561                        }
    509                         memCtorType->parameters.push_back( new ObjectDecl( field->name, Type::StorageClasses(), LinkageSpec::Cforall, nullptr, field->get_type()->clone(), nullptr ) );
    510                         FunctionDecl * ctor = genFunc( "?{}", memCtorType->clone(), functionNesting );
    511                         ObjectDecl * srcParam = strict_dynamic_cast<ObjectDecl *>( ctor->type->parameters.back() );
    512                         srcParam->fixUniqueId();
    513                         ObjectDecl * dstParam = InitTweak::getParamThis( ctor->type );
    514                         makeMemberOp( srcParam, dstParam, back_inserter( ctor->statements->kids ) );
    515                         resolve( ctor );
    516                         // only generate one field ctor for unions
    517                         break;
    518                 }
    519                 delete memCtorType;
    520         }
    521 
    522         void EnumFuncGenerator::genFuncBody( FunctionDecl * funcDecl ) {
    523                 // xxx - Temporary: make these functions intrinsic so they codegen as C assignment.
    524                 // Really they're something of a cross between instrinsic and autogen, so should
    525                 // probably make a new linkage type
    526                 funcDecl->linkage = LinkageSpec::Intrinsic;
    527                 FunctionType * ftype = funcDecl->type;
    528                 if ( InitTweak::isCopyConstructor( funcDecl ) || InitTweak::isAssignment( funcDecl ) ) {
    529                         assert( ftype->parameters.size() == 2 );
    530                         ObjectDecl * dstParam = strict_dynamic_cast< ObjectDecl * >( ftype->parameters.front() );
    531                         ObjectDecl * srcParam = strict_dynamic_cast< ObjectDecl * >( ftype->parameters.back() );
    532 
    533                         // enum copy construct and assignment is just C-style assignment.
    534                         // this looks like a bad recursive call, but code gen will turn it into
    535                         // a C-style assignment.
    536                         // This happens before function pointer type conversion, so need to do it manually here
    537                         ApplicationExpr * callExpr = new ApplicationExpr( VariableExpr::functionPointer( funcDecl ) );
    538                         callExpr->get_args().push_back( new VariableExpr( dstParam ) );
    539                         callExpr->get_args().push_back( new VariableExpr( srcParam ) );
    540                         funcDecl->statements->push_back( new ExprStmt( noLabels, callExpr ) );
    541                 } else {
    542                         // default ctor/dtor body is empty - add unused attribute to parameter to silence warnings
    543                         assert( ftype->parameters.size() == 1 );
    544                         ObjectDecl * dstParam = strict_dynamic_cast< ObjectDecl * >( ftype->parameters.front() );
    545                         dstParam->attributes.push_back( new Attribute( "unused" ) );
    546                 }
    547         }
    548 
    549         bool EnumFuncGenerator::shouldAutogen() const { return true; }
    550         bool EnumFuncGenerator::isConcurrentType() const { return false; }
    551         // enums do not have field constructors
    552         void EnumFuncGenerator::genFieldCtors() {}
    553 
    554         bool TypeFuncGenerator::shouldAutogen() const { return true; };
    555 
    556         void TypeFuncGenerator::genFuncBody( FunctionDecl * dcl ) {
    557                 FunctionType * ftype = dcl->type;
    558                 assertf( ftype->parameters.size() == 1 || ftype->parameters.size() == 2, "Incorrect number of parameters in autogenerated typedecl function: %zd", ftype->parameters.size() );
    559                 DeclarationWithType * dst = ftype->parameters.front();
    560                 DeclarationWithType * src = ftype->parameters.size() == 2 ? ftype->parameters.back() : nullptr;
    561                 // generate appropriate calls to member ctor, assignment
    562                 UntypedExpr * expr = new UntypedExpr( new NameExpr( dcl->name ) );
    563                 expr->args.push_back( new CastExpr( new VariableExpr( dst ), new ReferenceType( Type::Qualifiers(), typeDecl->base->clone() ) ) );
    564                 if ( src ) expr->args.push_back( new CastExpr( new VariableExpr( src ), typeDecl->base->clone() ) );
    565                 dcl->statements->kids.push_back( new ExprStmt( noLabels, expr ) );
    566         };
    567 
    568         // xxx - should reach in and determine if base type is concurrent?
    569         bool TypeFuncGenerator::isConcurrentType() const { return false; };
    570 
    571         // opaque types do not have field constructors
    572         void TypeFuncGenerator::genFieldCtors() {};
    573 
    574         //=============================================================================================
    575         // Visitor definitions
    576         //=============================================================================================
     562                }
     563
     564                declsToAdd.push_back( ctorDecl );
     565                declsToAdd.push_back( copyCtorDecl );
     566                declsToAdd.push_back( dtorDecl );
     567                declsToAdd.push_back( assignDecl ); // assignment should come last since it uses copy constructor in return
     568                declsToAdd.splice( declsToAdd.end(), memCtors );
     569        }
     570
    577571        AutogenerateRoutines::AutogenerateRoutines() {
    578572                // the order here determines the order that these functions are generated.
    579573                // assignment should come last since it uses copy constructor in return.
    580                 data.emplace_back( "?{}", genDefaultType );
    581                 data.emplace_back( "?{}", genCopyType );
    582                 data.emplace_back( "^?{}", genDefaultType );
    583                 data.emplace_back( "?=?", genAssignType );
    584         }
    585 
    586         void AutogenerateRoutines::previsit( EnumDecl * enumDecl ) {
    587                 // must visit children (enum constants) to add them to the indexer
    588                 if ( enumDecl->has_body() ) {
    589                         EnumInstType enumInst( Type::Qualifiers(), enumDecl->get_name() );
    590                         enumInst.set_baseEnum( enumDecl );
    591                         EnumFuncGenerator gen( &enumInst, data, functionNesting, indexer );
    592                         generateFunctions( gen, declsToAddAfter );
    593                 }
    594         }
    595 
    596         void AutogenerateRoutines::previsit( StructDecl * structDecl ) {
    597                 visit_children = false;
    598                 if ( structDecl->has_body() ) {
    599                         StructInstType structInst( Type::Qualifiers(), structDecl->name );
     574                data.push_back( FuncData( "?{}", genDefaultType, constructable ) );
     575                data.push_back( FuncData( "?{}", genCopyType, copyable ) );
     576                data.push_back( FuncData( "^?{}", genDefaultType, destructable ) );
     577                data.push_back( FuncData( "?=?", genAssignType, assignable ) );
     578        }
     579
     580        void AutogenerateRoutines::visit( EnumDecl *enumDecl ) {
     581                if ( ! enumDecl->get_members().empty() ) {
     582                        EnumInstType *enumInst = new EnumInstType( Type::Qualifiers(), enumDecl->get_name() );
     583                        // enumInst->set_baseEnum( enumDecl );
     584                        makeEnumFunctions( enumInst, functionNesting, declsToAddAfter );
     585                }
     586        }
     587
     588        void AutogenerateRoutines::visit( StructDecl *structDecl ) {
     589                if ( structDecl->has_body() && structsDone.find( structDecl->get_name() ) == structsDone.end() ) {
     590                        StructInstType structInst( Type::Qualifiers(), structDecl->get_name() );
     591                        for ( TypeDecl * typeDecl : structDecl->get_parameters() ) {
     592                                // need to visit assertions so that they are added to the appropriate maps
     593                                acceptAll( typeDecl->get_assertions(), *this );
     594                                structInst.get_parameters().push_back( new TypeExpr( new TypeInstType( Type::Qualifiers(), typeDecl->get_name(), typeDecl ) ) );
     595                        }
    600596                        structInst.set_baseStruct( structDecl );
    601                         for ( TypeDecl * typeDecl : structDecl->parameters ) {
    602                                 structInst.parameters.push_back( new TypeExpr( new TypeInstType( Type::Qualifiers(), typeDecl->name, typeDecl ) ) );
    603                         }
    604                         StructFuncGenerator gen( structDecl, &structInst, data, functionNesting, indexer );
    605                         generateFunctions( gen, declsToAddAfter );
     597                        makeStructFunctions( structDecl, &structInst, functionNesting, declsToAddAfter, data );
     598                        structsDone.insert( structDecl->get_name() );
    606599                } // if
    607600        }
    608601
    609         void AutogenerateRoutines::previsit( UnionDecl * unionDecl ) {
    610                 visit_children = false;
    611                 if ( unionDecl->has_body()  ) {
     602        void AutogenerateRoutines::visit( UnionDecl *unionDecl ) {
     603                if ( ! unionDecl->get_members().empty() ) {
    612604                        UnionInstType unionInst( Type::Qualifiers(), unionDecl->get_name() );
    613605                        unionInst.set_baseUnion( unionDecl );
     
    615607                                unionInst.get_parameters().push_back( new TypeExpr( new TypeInstType( Type::Qualifiers(), typeDecl->get_name(), typeDecl ) ) );
    616608                        }
    617                         UnionFuncGenerator gen( unionDecl, &unionInst, data, functionNesting, indexer );
    618                         generateFunctions( gen, declsToAddAfter );
     609                        makeUnionFunctions( unionDecl, &unionInst, functionNesting, declsToAddAfter );
    619610                } // if
    620611        }
    621612
     613        Type * declToTypeDeclBase( Declaration * decl ) {
     614                if ( TypeDecl * td = dynamic_cast< TypeDecl * >( decl ) ) {
     615                        return td->base;
     616                }
     617                return nullptr;
     618        }
     619
    622620        // generate ctor/dtors/assign for typedecls, e.g., otype T = int *;
    623         void AutogenerateRoutines::previsit( TypeDecl * typeDecl ) {
    624                 visit_children = false;
     621        void AutogenerateRoutines::visit( TypeDecl *typeDecl ) {
    625622                if ( ! typeDecl->base ) return;
    626623
     624                // generate each of the functions based on the supplied FuncData objects
     625                std::list< FunctionDecl * > newFuncs;
     626                std::list< Declaration * > tds { typeDecl };
     627                std::list< TypeDecl * > typeParams;
    627628                TypeInstType refType( Type::Qualifiers(), typeDecl->name, typeDecl );
    628                 TypeFuncGenerator gen( typeDecl, &refType, data, functionNesting, indexer );
    629                 generateFunctions( gen, declsToAddAfter );
    630         }
    631 
    632         void AutogenerateRoutines::previsit( FunctionType *) {
     629                auto generator = makeFuncGenerator( lazy_map( tds, declToTypeDeclBase ), &refType, functionNesting, typeParams, back_inserter( newFuncs ) );
     630                for ( const FuncData & d : data ) {
     631                        generator.gen( d, false );
     632                }
     633
     634                if ( functionNesting == 0 ) {
     635                        // forward declare if top-level struct, so that
     636                        // type is complete as soon as its body ends
     637                        // Note: this is necessary if we want structs which contain
     638                        // generic (otype) structs as members.
     639                        for ( FunctionDecl * dcl : newFuncs ) {
     640                                addForwardDecl( dcl, declsToAddAfter );
     641                        }
     642                }
     643
     644                for ( FunctionDecl * dcl : newFuncs ) {
     645                        FunctionType * ftype = dcl->type;
     646                        assertf( ftype->parameters.size() == 1 || ftype->parameters.size() == 2, "Incorrect number of parameters in autogenerated typedecl function: %zd", ftype->parameters.size() );
     647                        DeclarationWithType * dst = ftype->parameters.front();
     648                        DeclarationWithType * src = ftype->parameters.size() == 2 ? ftype->parameters.back() : nullptr;
     649                        // generate appropriate calls to member ctor, assignment
     650                        // destructor needs to do everything in reverse, so pass "forward" based on whether the function is a destructor
     651                        UntypedExpr * expr = new UntypedExpr( new NameExpr( dcl->name ) );
     652                        expr->args.push_back( new CastExpr( new VariableExpr( dst ), new ReferenceType( Type::Qualifiers(), typeDecl->base->clone() ) ) );
     653                        if ( src ) expr->args.push_back( new CastExpr( new VariableExpr( src ), typeDecl->base->clone() ) );
     654                        dcl->statements->kids.push_back( new ExprStmt( noLabels, expr ) );
     655                        if ( CodeGen::isAssignment( dcl->get_name() ) ) {
     656                                // assignment needs to return a value
     657                                FunctionType * assignType = dcl->type;
     658                                assert( assignType->parameters.size() == 2 );
     659                                ObjectDecl * srcParam = strict_dynamic_cast< ObjectDecl * >( assignType->parameters.back() );
     660                                dcl->statements->kids.push_back( new ReturnStmt( noLabels, new VariableExpr( srcParam ) ) );
     661                        }
     662                        declsToAddAfter.push_back( dcl );
     663                }
     664        }
     665
     666        void addDecls( std::list< Declaration * > &declsToAdd, std::list< Statement * > &statements, std::list< Statement * >::iterator i ) {
     667                for ( std::list< Declaration * >::iterator decl = declsToAdd.begin(); decl != declsToAdd.end(); ++decl ) {
     668                        statements.insert( i, new DeclStmt( noLabels, *decl ) );
     669                } // for
     670                declsToAdd.clear();
     671        }
     672
     673        void AutogenerateRoutines::visit( FunctionType *) {
    633674                // ensure that we don't add assignment ops for types defined as part of the function
    634                 visit_children = false;
    635         }
    636 
    637         void AutogenerateRoutines::previsit( PointerType *) {
     675        }
     676
     677        void AutogenerateRoutines::visit( PointerType *) {
    638678                // ensure that we don't add assignment ops for types defined as part of the pointer
    639                 visit_children = false;
    640         }
    641 
    642         void AutogenerateRoutines::previsit( TraitDecl * ) {
     679        }
     680
     681        void AutogenerateRoutines::visit( TraitDecl *) {
    643682                // ensure that we don't add assignment ops for types defined as part of the trait
    644                 visit_children = false;
    645         }
    646 
    647         void AutogenerateRoutines::previsit( FunctionDecl * functionDecl ) {
    648                 visit_children = false;
     683        }
     684
     685        template< typename StmtClass >
     686        inline void AutogenerateRoutines::visitStatement( StmtClass *stmt ) {
     687                std::set< std::string > oldStructs = structsDone;
     688                addVisit( stmt, *this );
     689                structsDone = oldStructs;
     690        }
     691
     692        void AutogenerateRoutines::visit( FunctionDecl *functionDecl ) {
    649693                // record the existence of this function as appropriate
    650                 managedTypes.handleDWT( functionDecl );
    651 
    652                 maybeAccept( functionDecl->type, *visitor );
     694                insert( functionDecl, constructable, InitTweak::isDefaultConstructor );
     695                insert( functionDecl, assignable, InitTweak::isAssignment );
     696                insert( functionDecl, copyable, InitTweak::isCopyConstructor );
     697                insert( functionDecl, destructable, InitTweak::isDestructor );
     698
     699                maybeAccept( functionDecl->get_functionType(), *this );
    653700                functionNesting += 1;
    654                 maybeAccept( functionDecl->statements, *visitor );
     701                maybeAccept( functionDecl->get_statements(), *this );
    655702                functionNesting -= 1;
    656703        }
    657704
    658         void AutogenerateRoutines::previsit( CompoundStmt * ) {
    659                 GuardScope( managedTypes );
    660                 GuardScope( structsDone );
     705        void AutogenerateRoutines::visit( CompoundStmt *compoundStmt ) {
     706                constructable.beginScope();
     707                assignable.beginScope();
     708                copyable.beginScope();
     709                destructable.beginScope();
     710                visitStatement( compoundStmt );
     711                constructable.endScope();
     712                assignable.endScope();
     713                copyable.endScope();
     714                destructable.endScope();
     715        }
     716
     717        void AutogenerateRoutines::visit( SwitchStmt *switchStmt ) {
     718                visitStatement( switchStmt );
    661719        }
    662720
     
    676734        }
    677735
    678         void AutogenTupleRoutines::postvisit( TupleType * tupleType ) {
     736        Type * AutogenTupleRoutines::mutate( TupleType * tupleType ) {
     737                tupleType = strict_dynamic_cast< TupleType * >( Parent::mutate( tupleType ) );
    679738                std::string mangleName = SymTab::Mangler::mangleType( tupleType );
    680                 if ( seenTuples.find( mangleName ) != seenTuples.end() ) return;
     739                if ( seenTuples.find( mangleName ) != seenTuples.end() ) return tupleType;
    681740                seenTuples.insert( mangleName );
    682741
     
    696755                        if ( TypeInstType * ty = dynamic_cast< TypeInstType * >( t ) ) {
    697756                                if ( ! done.count( ty->get_baseType() ) ) {
    698                                         TypeDecl * newDecl = new TypeDecl( ty->get_baseType()->get_name(), Type::StorageClasses(), nullptr, TypeDecl::Dtype, true );
     757                                        TypeDecl * newDecl = new TypeDecl( ty->get_baseType()->get_name(), Type::StorageClasses(), nullptr, TypeDecl::Any );
    699758                                        TypeInstType * inst = new TypeInstType( Type::Qualifiers(), newDecl->get_name(), newDecl );
    700759                                        newDecl->get_assertions().push_back( new FunctionDecl( "?=?", Type::StorageClasses(), LinkageSpec::Cforall, genAssignType( inst ), nullptr,
     
    726785                makeTupleFunctionBody( dtorDecl );
    727786
    728                 declsToAddBefore.push_back( ctorDecl );
    729                 declsToAddBefore.push_back( copyCtorDecl );
    730                 declsToAddBefore.push_back( dtorDecl );
    731                 declsToAddBefore.push_back( assignDecl ); // assignment should come last since it uses copy constructor in return
    732         }
    733 
    734         void AutogenTupleRoutines::previsit( FunctionDecl *functionDecl ) {
    735                 visit_children = false;
    736                 maybeAccept( functionDecl->type, *visitor );
     787                addDeclaration( ctorDecl );
     788                addDeclaration( copyCtorDecl );
     789                addDeclaration( dtorDecl );
     790                addDeclaration( assignDecl ); // assignment should come last since it uses copy constructor in return
     791
     792                return tupleType;
     793        }
     794
     795        DeclarationWithType * AutogenTupleRoutines::mutate( FunctionDecl *functionDecl ) {
     796                functionDecl->set_functionType( maybeMutate( functionDecl->get_functionType(), *this ) );
    737797                functionNesting += 1;
    738                 maybeAccept( functionDecl->statements, *visitor );
     798                functionDecl->set_statements( maybeMutate( functionDecl->get_statements(), *this ) );
    739799                functionNesting -= 1;
    740         }
    741 
    742         void AutogenTupleRoutines::previsit( CompoundStmt * ) {
    743                 GuardScope( seenTuples );
     800                return functionDecl;
     801        }
     802
     803        CompoundStmt * AutogenTupleRoutines::mutate( CompoundStmt *compoundStmt ) {
     804                seenTuples.beginScope();
     805                compoundStmt = strict_dynamic_cast< CompoundStmt * >( Parent::mutate( compoundStmt ) );
     806                seenTuples.endScope();
     807                return compoundStmt;
    744808        }
    745809} // SymTab
  • src/SymTab/Autogen.h

    r3f7e12cb r78315272  
    1919#include <string>                 // for string
    2020
    21 #include "CodeGen/OperatorTable.h"
    2221#include "Common/UniqueName.h"    // for UniqueName
    2322#include "InitTweak/InitTweak.h"  // for InitExpander
     
    4544        extern FunctionDecl * dereferenceOperator;
    4645
    47         // generate the type of an assignment function for paramType
     46        // temporary
    4847        FunctionType * genAssignType( Type * paramType );
    49 
    50         // generate the type of a default constructor or destructor for paramType
    51         FunctionType * genDefaultType( Type * paramType );
    52 
    53         // generate the type of a copy constructor for paramType
    54         FunctionType * genCopyType( Type * paramType );
    5548
    5649        /// inserts into out a generated call expression to function fname with arguments dstParam and srcParam. Intended to be used with generated ?=?, ?{}, and ^?{} calls.
     
    6154        /// optionally returns a statement which must be inserted prior to the containing loop, if there is one
    6255        template< typename OutputIterator >
    63         Statement * genScalarCall( InitTweak::InitExpander & srcParam, Expression * dstParam, std::string fname, OutputIterator out, Type * type, bool addCast = false ) {
    64                 bool isReferenceCtorDtor = false;
    65                 if ( dynamic_cast< ReferenceType * >( type ) && CodeGen::isCtorDtor( fname ) ) {
    66                         // reference constructors are essentially application of the rebind operator.
    67                         // apply & to both arguments, do not need a cast
    68                         fname = "?=?";
    69                         dstParam = new AddressExpr( dstParam );
    70                         addCast = false;
    71                         isReferenceCtorDtor = true;
    72                 }
    73 
     56        Statement * genScalarCall( InitTweak::InitExpander & srcParam, Expression *dstParam, const std::string & fname, OutputIterator out, Type * type, bool addCast = false ) {
    7457                // want to be able to generate assignment, ctor, and dtor generically,
    7558                // so fname is either ?=?, ?{}, or ^?{}
    76                 UntypedExpr * fExpr = new UntypedExpr( new NameExpr( fname ) );
     59                UntypedExpr *fExpr = new UntypedExpr( new NameExpr( fname ) );
    7760
    7861                if ( addCast ) {
     
    8972                        dstParam = new CastExpr( dstParam, new ReferenceType( Type::Qualifiers(), castType ) );
    9073                }
    91                 fExpr->args.push_back( dstParam );
     74                fExpr->get_args().push_back( dstParam );
    9275
    9376                Statement * listInit = srcParam.buildListInit( fExpr );
    9477
    95                 // fetch next set of arguments
    96                 ++srcParam;
    97 
    98                 // return if adding reference fails - will happen on default constructor and destructor
    99                 if ( isReferenceCtorDtor && ! srcParam.addReference() ) {
    100                         delete fExpr;
    101                         return listInit;
    102                 }
    103 
    104                 std::list< Expression * > args = *srcParam;
    105                 fExpr->args.splice( fExpr->args.end(), args );
     78                std::list< Expression * > args = *++srcParam;
     79                fExpr->get_args().splice( fExpr->get_args().end(), args );
    10680
    10781                *out++ = new ExprStmt( noLabels, fExpr );
     
    12599                        // generate: for ( int i = 0; i < N; ++i )
    126100                        begin = new ConstantExpr( Constant::from_int( 0 ) );
    127                         end = array->dimension->clone();
     101                        end = array->get_dimension()->clone();
    128102                        cmp = new NameExpr( "?<?" );
    129103                        update = new NameExpr( "++?" );
     
    131105                        // generate: for ( int i = N-1; i >= 0; --i )
    132106                        begin = new UntypedExpr( new NameExpr( "?-?" ) );
    133                         ((UntypedExpr*)begin)->args.push_back( array->dimension->clone() );
    134                         ((UntypedExpr*)begin)->args.push_back( new ConstantExpr( Constant::from_int( 1 ) ) );
     107                        ((UntypedExpr*)begin)->get_args().push_back( array->get_dimension()->clone() );
     108                        ((UntypedExpr*)begin)->get_args().push_back( new ConstantExpr( Constant::from_int( 1 ) ) );
    135109                        end = new ConstantExpr( Constant::from_int( 0 ) );
    136110                        cmp = new NameExpr( "?>=?" );
     
    141115
    142116                UntypedExpr *cond = new UntypedExpr( cmp );
    143                 cond->args.push_back( new VariableExpr( index ) );
    144                 cond->args.push_back( end );
     117                cond->get_args().push_back( new VariableExpr( index ) );
     118                cond->get_args().push_back( end );
    145119
    146120                UntypedExpr *inc = new UntypedExpr( update );
    147                 inc->args.push_back( new VariableExpr( index ) );
     121                inc->get_args().push_back( new VariableExpr( index ) );
    148122
    149123                UntypedExpr *dstIndex = new UntypedExpr( new NameExpr( "?[?]" ) );
    150                 dstIndex->args.push_back( dstParam );
    151                 dstIndex->args.push_back( new VariableExpr( index ) );
     124                dstIndex->get_args().push_back( dstParam );
     125                dstIndex->get_args().push_back( new VariableExpr( index ) );
    152126                dstParam = dstIndex;
    153127
    154128                // srcParam must keep track of the array indices to build the
    155129                // source parameter and/or array list initializer
    156                 srcParam.addArrayIndex( new VariableExpr( index ), array->dimension->clone() );
     130                srcParam.addArrayIndex( new VariableExpr( index ), array->get_dimension()->clone() );
    157131
    158132                // for stmt's body, eventually containing call
    159133                CompoundStmt * body = new CompoundStmt( noLabels );
    160                 Statement * listInit = genCall( srcParam, dstParam, fname, back_inserter( body->kids ), array->base, addCast, forward );
     134                Statement * listInit = genCall( srcParam, dstParam, fname, back_inserter( body->get_kids() ), array->get_base(), addCast, forward );
    161135
    162136                // block containing for stmt and index variable
    163137                std::list<Statement *> initList;
    164138                CompoundStmt * block = new CompoundStmt( noLabels );
    165                 block->push_back( new DeclStmt( noLabels, index ) );
     139                block->get_kids().push_back( new DeclStmt( noLabels, index ) );
    166140                if ( listInit ) block->get_kids().push_back( listInit );
    167                 block->push_back( new ForStmt( noLabels, initList, cond, inc, body ) );
     141                block->get_kids().push_back( new ForStmt( noLabels, initList, cond, inc, body ) );
    168142
    169143                *out++ = block;
     
    171145
    172146        template< typename OutputIterator >
    173         Statement * genCall( InitTweak::InitExpander & srcParam, Expression * dstParam, const std::string & fname, OutputIterator out, Type * type, bool addCast, bool forward ) {
     147        Statement * genCall( InitTweak::InitExpander &  srcParam, Expression * dstParam, const std::string & fname, OutputIterator out, Type * type, bool addCast, bool forward ) {
    174148                if ( ArrayType * at = dynamic_cast< ArrayType * >( type ) ) {
    175149                        genArrayCall( srcParam, dstParam, fname, out, at, addCast, forward );
     
    185159        /// ImplicitCtorDtorStmt node.
    186160        template< typename OutputIterator >
    187         void genImplicitCall( InitTweak::InitExpander & srcParam, Expression * dstParam, const std::string & fname, OutputIterator out, DeclarationWithType * decl, bool forward = true ) {
     161        void genImplicitCall( InitTweak::InitExpander &  srcParam, Expression * dstParam, const std::string & fname, OutputIterator out, DeclarationWithType * decl, bool forward = true ) {
    188162                ObjectDecl *obj = dynamic_cast<ObjectDecl *>( decl );
    189163                assert( obj );
     
    193167                bool addCast = (fname == "?{}" || fname == "^?{}") && ( !obj || ( obj && ! obj->get_bitfieldWidth() ) );
    194168                std::list< Statement * > stmts;
    195                 genCall( srcParam, dstParam, fname, back_inserter( stmts ), obj->type, addCast, forward );
     169                genCall( srcParam, dstParam, fname, back_inserter( stmts ), obj->get_type(), addCast, forward );
    196170
    197171                // currently genCall should produce at most one element, but if that changes then the next line needs to be updated to grab the statement which contains the call
  • src/SymTab/FixFunction.cc

    r3f7e12cb r78315272  
    2626        FixFunction::FixFunction() : isVoid( false ) {}
    2727
    28 
    29         DeclarationWithType * FixFunction::postmutate(FunctionDecl *functionDecl) {
    30                 // can't delete function type because it may contain assertions, so transfer ownership to new object
    31                 ObjectDecl *pointer = new ObjectDecl( functionDecl->name, functionDecl->get_storageClasses(), functionDecl->linkage, nullptr, new PointerType( Type::Qualifiers(), functionDecl->type ), nullptr, functionDecl->attributes );
    32                 functionDecl->attributes.clear();
    33                 functionDecl->type = nullptr;
     28        DeclarationWithType * FixFunction::mutate(FunctionDecl *functionDecl) {
     29                ObjectDecl *pointer = new ObjectDecl( functionDecl->get_name(), functionDecl->get_storageClasses(), functionDecl->get_linkage(), 0, new PointerType( Type::Qualifiers(), functionDecl->get_type() ), 0, functionDecl->get_attributes() );
     30                functionDecl->get_attributes().clear();
     31                // can't delete function type because it may contain assertions, but can't transfer ownership without a clone since set_type checks for nullptr
     32                functionDecl->set_type( functionDecl->get_type()->clone() );
    3433                delete functionDecl;
    3534                return pointer;
    3635        }
    3736
    38         Type * FixFunction::postmutate(ArrayType *arrayType) {
     37        Type * FixFunction::mutate(VoidType *voidType) {
     38                isVoid = true;
     39                return voidType;
     40        }
     41
     42        Type * FixFunction::mutate(BasicType *basicType) {
     43                return basicType;
     44        }
     45
     46        Type * FixFunction::mutate(PointerType *pointerType) {
     47                return pointerType;
     48        }
     49
     50        Type * FixFunction::mutate(ArrayType *arrayType) {
    3951                // need to recursively mutate the base type in order for multi-dimensional arrays to work.
    40                 PointerType *pointerType = new PointerType( arrayType->get_qualifiers(), arrayType->base, arrayType->dimension, arrayType->isVarLen, arrayType->isStatic );
    41                 arrayType->base = nullptr;
    42                 arrayType->dimension = nullptr;
     52                PointerType *pointerType = new PointerType( arrayType->get_qualifiers(), arrayType->get_base()->clone()->acceptMutator( *this ), maybeClone( arrayType->get_dimension() ), arrayType->get_isVarLen(), arrayType->get_isStatic() );
    4353                delete arrayType;
    4454                return pointerType;
    4555        }
    4656
    47         void FixFunction::premutate(VoidType *) {
    48                 isVoid = true;
     57        Type * FixFunction::mutate(StructInstType *aggregateUseType) {
     58                return aggregateUseType;
    4959        }
    5060
    51         void FixFunction::premutate(FunctionDecl *) { visit_children = false; }
    52         void FixFunction::premutate(ArrayType *) { visit_children = false; }
    53         void FixFunction::premutate(BasicType *) { visit_children = false; }
    54         void FixFunction::premutate(PointerType *) { visit_children = false; }
    55         void FixFunction::premutate(StructInstType *) { visit_children = false; }
    56         void FixFunction::premutate(UnionInstType *) { visit_children = false; }
    57         void FixFunction::premutate(EnumInstType *) { visit_children = false; }
    58         void FixFunction::premutate(TraitInstType *) { visit_children = false; }
    59         void FixFunction::premutate(TypeInstType *) { visit_children = false; }
    60         void FixFunction::premutate(TupleType *) { visit_children = false; }
    61         void FixFunction::premutate(VarArgsType *) { visit_children = false; }
    62         void FixFunction::premutate(ZeroType *) { visit_children = false; }
    63         void FixFunction::premutate(OneType *) { visit_children = false; }
     61        Type * FixFunction::mutate(UnionInstType *aggregateUseType) {
     62                return aggregateUseType;
     63        }
     64
     65        Type * FixFunction::mutate(EnumInstType *aggregateUseType) {
     66                return aggregateUseType;
     67        }
     68
     69        Type * FixFunction::mutate(TraitInstType *aggregateUseType) {
     70                return aggregateUseType;
     71        }
     72
     73        Type * FixFunction::mutate(TypeInstType *aggregateUseType) {
     74                return aggregateUseType;
     75        }
     76
     77        Type * FixFunction::mutate(TupleType *tupleType) {
     78                return tupleType;
     79        }
     80
     81        Type * FixFunction::mutate(VarArgsType *varArgsType) {
     82                return varArgsType;
     83        }
     84
     85        Type * FixFunction::mutate(ZeroType *zeroType) {
     86                return zeroType;
     87        }
     88
     89        Type * FixFunction::mutate(OneType *oneType) {
     90                return oneType;
     91        }
    6492} // namespace SymTab
    6593
  • src/SymTab/FixFunction.h

    r3f7e12cb r78315272  
    1616#pragma once
    1717
    18 #include "Common/PassVisitor.h" // for PassVisitor
    19 #include "SynTree/SynTree.h"    // for Types
     18#include "SynTree/Mutator.h"  // for Mutator
     19#include "SynTree/SynTree.h"  // for Types
    2020
    2121namespace SymTab {
    2222        /// Replaces function and array types by equivalent pointer types.
    23         class FixFunction : public WithShortCircuiting {
     23        class FixFunction : public Mutator {
    2424                typedef Mutator Parent;
    2525          public:
    2626                FixFunction();
    2727
    28                 void premutate(FunctionDecl *functionDecl);
    29                 DeclarationWithType* postmutate(FunctionDecl *functionDecl);
     28                bool get_isVoid() const { return isVoid; }
     29                void set_isVoid( bool newValue ) { isVoid = newValue; }
     30          private:
     31                virtual DeclarationWithType* mutate(FunctionDecl *functionDecl);
    3032
    31                 Type * postmutate(ArrayType * arrayType);
    32 
    33                 void premutate(ArrayType * arrayType);
    34                 void premutate(VoidType * voidType);
    35                 void premutate(BasicType * basicType);
    36                 void premutate(PointerType * pointerType);
    37                 void premutate(StructInstType * aggregateUseType);
    38                 void premutate(UnionInstType * aggregateUseType);
    39                 void premutate(EnumInstType * aggregateUseType);
    40                 void premutate(TraitInstType * aggregateUseType);
    41                 void premutate(TypeInstType * aggregateUseType);
    42                 void premutate(TupleType * tupleType);
    43                 void premutate(VarArgsType * varArgsType);
    44                 void premutate(ZeroType * zeroType);
    45                 void premutate(OneType * oneType);
     33                virtual Type* mutate(VoidType *voidType);
     34                virtual Type* mutate(BasicType *basicType);
     35                virtual Type* mutate(PointerType *pointerType);
     36                virtual Type* mutate(ArrayType *arrayType);
     37                virtual Type* mutate(StructInstType *aggregateUseType);
     38                virtual Type* mutate(UnionInstType *aggregateUseType);
     39                virtual Type* mutate(EnumInstType *aggregateUseType);
     40                virtual Type* mutate(TraitInstType *aggregateUseType);
     41                virtual Type* mutate(TypeInstType *aggregateUseType);
     42                virtual Type* mutate(TupleType *tupleType);
     43                virtual Type* mutate(VarArgsType *varArgsType);
     44                virtual Type* mutate(ZeroType *zeroType);
     45                virtual Type* mutate(OneType *oneType);
    4646
    4747                bool isVoid;
  • src/SymTab/Indexer.cc

    r3f7e12cb r78315272  
    4040
    4141namespace SymTab {
     42        struct NewScope {
     43                NewScope( SymTab::Indexer & indexer ) : indexer( indexer ) { indexer.enterScope(); }
     44                ~NewScope() { indexer.leaveScope(); }
     45                SymTab::Indexer & indexer;
     46        };
     47
     48        template< typename TreeType, typename VisitorType >
     49        inline void acceptNewScope( TreeType *tree, VisitorType &visitor ) {
     50                visitor.enterScope();
     51                maybeAccept( tree, visitor );
     52                visitor.leaveScope();
     53        }
     54
    4255        typedef std::unordered_map< std::string, DeclarationWithType* > MangleTable;
    4356        typedef std::unordered_map< std::string, MangleTable > IdTable;
     
    185198        }
    186199
    187         Indexer::Indexer() : tables( 0 ), scope( 0 ) {}
    188 
    189         Indexer::Indexer( const Indexer &that ) : doDebug( that.doDebug ), tables( newRef( that.tables ) ), scope( that.scope ) {}
    190 
    191         Indexer::Indexer( Indexer &&that ) : doDebug( that.doDebug ), tables( that.tables ), scope( that.scope ) {
     200        Indexer::Indexer( bool _doDebug ) : tables( 0 ), scope( 0 ), doDebug( _doDebug ) {}
     201
     202        Indexer::Indexer( const Indexer &that ) : tables( newRef( that.tables ) ), scope( that.scope ), doDebug( that.doDebug ) {}
     203
     204        Indexer::Indexer( Indexer &&that ) : tables( that.tables ), scope( that.scope ), doDebug( that.doDebug ) {
    192205                that.tables = 0;
    193206        }
     
    407420                makeWritable();
    408421
    409                 const std::string &name = decl->name;
     422                const std::string &name = decl->get_name();
    410423                std::string mangleName;
    411                 if ( LinkageSpec::isOverridable( decl->linkage ) ) {
     424                if ( LinkageSpec::isOverridable( decl->get_linkage() ) ) {
    412425                        // mangle the name without including the appropriate suffix, so overridable routines are placed into the
    413426                        // same "bucket" as their user defined versions.
     
    418431
    419432                // this ensures that no two declarations with the same unmangled name at the same scope both have C linkage
    420                 if ( ! LinkageSpec::isMangled( decl->linkage ) ) {
     433                if ( ! LinkageSpec::isMangled( decl->get_linkage() ) ) {
    421434                        // NOTE this is broken in Richard's original code in such a way that it never triggers (it
    422435                        // doesn't check decls that have the same manglename, and all C-linkage decls are defined to
     
    571584
    572585                if ( doDebug ) {
    573                         std::cerr << "--- Entering scope " << scope << std::endl;
     586                        std::cout << "--- Entering scope " << scope << std::endl;
    574587                }
    575588        }
    576589
    577590        void Indexer::leaveScope() {
    578                 using std::cerr;
     591                using std::cout;
    579592
    580593                assert( scope > 0 && "cannot leave initial scope" );
    581                 if ( doDebug ) {
    582                         cerr << "--- Leaving scope " << scope << " containing" << std::endl;
    583                 }
    584594                --scope;
    585595
    586596                while ( tables && tables->scope > scope ) {
    587597                        if ( doDebug ) {
    588                                 dump( tables->idTable, cerr );
    589                                 dump( tables->typeTable, cerr );
    590                                 dump( tables->structTable, cerr );
    591                                 dump( tables->enumTable, cerr );
    592                                 dump( tables->unionTable, cerr );
    593                                 dump( tables->traitTable, cerr );
     598                                cout << "--- Leaving scope " << tables->scope << " containing" << std::endl;
     599                                dump( tables->idTable, cout );
     600                                dump( tables->typeTable, cout );
     601                                dump( tables->structTable, cout );
     602                                dump( tables->enumTable, cout );
     603                                dump( tables->unionTable, cout );
     604                                dump( tables->traitTable, cout );
    594605                        }
    595606
  • src/SymTab/Indexer.h

    r3f7e12cb r78315272  
    2626        class Indexer {
    2727          public:
    28                 explicit Indexer();
     28                explicit Indexer( bool useDebug = false );
    2929
    3030                Indexer( const Indexer &that );
     
    7676                void addTrait( TraitDecl *decl );
    7777
    78                 bool doDebug = false; ///< Display debugging trace?
    7978          private:
    8079                struct Impl;
     
    8281                Impl *tables;         ///< Copy-on-write instance of table data structure
    8382                unsigned long scope;  ///< Scope index of this pointer
     83                bool doDebug;         ///< Display debugging trace?
    8484
    8585                /// Takes a new ref to a table (returns null if null)
  • src/SymTab/Mangler.cc

    r3f7e12cb r78315272  
    99// Author           : Richard C. Bilson
    1010// Created On       : Sun May 17 21:40:29 2015
    11 // Last Modified By : Peter A. Buhr
    12 // Last Modified On : Mon Sep 25 15:49:26 2017
    13 // Update Count     : 23
     11// Last Modified By : Andrew Beach
     12// Last Modified On : Wed Jun 28 15:31:00 2017
     13// Update Count     : 21
    1414//
    1515#include "Mangler.h"
     
    3131
    3232namespace SymTab {
    33         std::string Mangler::mangleType( Type * ty ) {
    34                 Mangler mangler( false, true, true );
     33        std::string Mangler::mangleType( Type *ty ) {
     34                Mangler mangler( false, true );
    3535                maybeAccept( ty, mangler );
    3636                return mangler.get_mangleName();
    3737        }
    3838
    39         std::string Mangler::mangleConcrete( Type* ty ) {
    40                 Mangler mangler( false, false, false );
    41                 maybeAccept( ty, mangler );
    42                 return mangler.get_mangleName();
    43         }
    44 
    45         Mangler::Mangler( bool mangleOverridable, bool typeMode, bool mangleGenericParams )
    46                 : nextVarNum( 0 ), isTopLevel( true ), mangleOverridable( mangleOverridable ), typeMode( typeMode ), mangleGenericParams( mangleGenericParams ) {}
     39        Mangler::Mangler( bool mangleOverridable, bool typeMode )
     40                : nextVarNum( 0 ), isTopLevel( true ), mangleOverridable( mangleOverridable ), typeMode( typeMode ) {}
    4741
    4842        Mangler::Mangler( const Mangler &rhs ) : mangleName() {
     
    5448        }
    5549
    56         void Mangler::mangleDecl( DeclarationWithType * declaration ) {
     50        void Mangler::mangleDecl( DeclarationWithType *declaration ) {
    5751                bool wasTopLevel = isTopLevel;
    5852                if ( isTopLevel ) {
     
    8579        }
    8680
    87         void Mangler::visit( ObjectDecl * declaration ) {
     81        void Mangler::visit( ObjectDecl *declaration ) {
    8882                mangleDecl( declaration );
    8983        }
    9084
    91         void Mangler::visit( FunctionDecl * declaration ) {
     85        void Mangler::visit( FunctionDecl *declaration ) {
    9286                mangleDecl( declaration );
    9387        }
    9488
    95         void Mangler::visit( VoidType * voidType ) {
     89        void Mangler::visit( VoidType *voidType ) {
    9690                printQualifiers( voidType );
    9791                mangleName << "v";
    9892        }
    9993
    100         void Mangler::visit( BasicType * basicType ) {
     94        void Mangler::visit( BasicType *basicType ) {
    10195                static const char *btLetter[] = {
    10296                        "b",    // Bool
     
    121115                        "Id",   // DoubleImaginary
    122116                        "Ir",   // LongDoubleImaginary
    123                         "w",    // SignedInt128
    124                         "Uw",   // UnsignedInt128
    125117                };
    126118
     
    129121        }
    130122
    131         void Mangler::visit( PointerType * pointerType ) {
     123        void Mangler::visit( PointerType *pointerType ) {
    132124                printQualifiers( pointerType );
    133125                mangleName << "P";
     
    135127        }
    136128
    137         void Mangler::visit( ArrayType * arrayType ) {
     129        void Mangler::visit( ArrayType *arrayType ) {
    138130                // TODO: encode dimension
    139131                printQualifiers( arrayType );
     
    142134        }
    143135
    144         void Mangler::visit( ReferenceType * refType ) {
     136        void Mangler::visit( ReferenceType *refType ) {
    145137                printQualifiers( refType );
    146138                mangleName << "R";
     
    157149        }
    158150
    159         void Mangler::visit( FunctionType * functionType ) {
     151        void Mangler::visit( FunctionType *functionType ) {
    160152                printQualifiers( functionType );
    161153                mangleName << "F";
     
    168160        }
    169161
    170         void Mangler::mangleRef( ReferenceToType * refType, std::string prefix ) {
     162        void Mangler::mangleRef( ReferenceToType *refType, std::string prefix ) {
    171163                printQualifiers( refType );
    172164
    173165                mangleName << ( refType->get_name().length() + prefix.length() ) << prefix << refType->get_name();
    174 
    175                 if ( mangleGenericParams ) {
    176                         std::list< Expression* >& params = refType->get_parameters();
    177                         if ( ! params.empty() ) {
    178                                 mangleName << "_";
    179                                 for ( std::list< Expression* >::const_iterator param = params.begin(); param != params.end(); ++param ) {
    180                                         TypeExpr *paramType = dynamic_cast< TypeExpr* >( *param );
    181                                         assertf(paramType, "Aggregate parameters should be type expressions: %s", toString(*param).c_str());
    182                                         maybeAccept( paramType->get_type(), *this );
    183                                 }
    184                                 mangleName << "_";
     166        }
     167
     168        void Mangler::mangleGenericRef( ReferenceToType *refType, std::string prefix ) {
     169                printQualifiers( refType );
     170
     171                std::ostringstream oldName( mangleName.str() );
     172                mangleName.clear();
     173
     174                mangleName << prefix << refType->get_name();
     175
     176                std::list< Expression* >& params = refType->get_parameters();
     177                if ( ! params.empty() ) {
     178                        mangleName << "_";
     179                        for ( std::list< Expression* >::const_iterator param = params.begin(); param != params.end(); ++param ) {
     180                                TypeExpr *paramType = dynamic_cast< TypeExpr* >( *param );
     181                                assertf(paramType, "Aggregate parameters should be type expressions: %s", toString(*param).c_str());
     182                                maybeAccept( paramType->get_type(), *this );
    185183                        }
     184                        mangleName << "_";
    186185                }
    187         }
    188 
    189         void Mangler::visit( StructInstType * aggregateUseType ) {
    190                 mangleRef( aggregateUseType, "s" );
    191         }
    192 
    193         void Mangler::visit( UnionInstType * aggregateUseType ) {
    194                 mangleRef( aggregateUseType, "u" );
    195         }
    196 
    197         void Mangler::visit( EnumInstType * aggregateUseType ) {
     186
     187                oldName << mangleName.str().length() << mangleName.str();
     188                mangleName.str( oldName.str() );
     189        }
     190
     191        void Mangler::visit( StructInstType *aggregateUseType ) {
     192                if ( typeMode ) mangleGenericRef( aggregateUseType, "s" );
     193                else mangleRef( aggregateUseType, "s" );
     194        }
     195
     196        void Mangler::visit( UnionInstType *aggregateUseType ) {
     197                if ( typeMode ) mangleGenericRef( aggregateUseType, "u" );
     198                else mangleRef( aggregateUseType, "u" );
     199        }
     200
     201        void Mangler::visit( EnumInstType *aggregateUseType ) {
    198202                mangleRef( aggregateUseType, "e" );
    199203        }
    200204
    201         void Mangler::visit( TypeInstType * typeInst ) {
     205        void Mangler::visit( TypeInstType *typeInst ) {
    202206                VarMapType::iterator varNum = varNums.find( typeInst->get_name() );
    203207                if ( varNum == varNums.end() ) {
     
    208212                        numStream << varNum->second.first;
    209213                        switch ( (TypeDecl::Kind )varNum->second.second ) {
     214                          case TypeDecl::Any:
     215                                mangleName << "t";
     216                                break;
    210217                          case TypeDecl::Dtype:
    211218                                mangleName << "d";
     
    224231        }
    225232
    226         void Mangler::visit( TupleType * tupleType ) {
     233        void Mangler::visit( TupleType *tupleType ) {
    227234                printQualifiers( tupleType );
    228235                mangleName << "T";
    229                 acceptAll( tupleType->types, *this );
     236                acceptAll( tupleType->get_types(), *this );
    230237                mangleName << "_";
    231238        }
    232239
    233         void Mangler::visit( VarArgsType * varArgsType ) {
     240        void Mangler::visit( VarArgsType *varArgsType ) {
    234241                printQualifiers( varArgsType );
    235242                mangleName << "VARGS";
    236243        }
    237244
    238         void Mangler::visit( ZeroType * ) {
     245        void Mangler::visit( __attribute__((unused)) ZeroType *zeroType ) {
    239246                mangleName << "Z";
    240247        }
    241248
    242         void Mangler::visit( OneType * ) {
     249        void Mangler::visit( __attribute__((unused)) OneType *oneType ) {
    243250                mangleName << "O";
    244251        }
    245252
    246         void Mangler::visit( TypeDecl * decl ) {
     253        void Mangler::visit( TypeDecl *decl ) {
    247254                static const char *typePrefix[] = { "BT", "BD", "BF" };
    248                 mangleName << typePrefix[ decl->get_kind() ] << ( decl->name.length() + 1 ) << decl->name;
     255                mangleName << typePrefix[ decl->get_kind() ] << ( decl->get_name().length() + 1 ) << decl->get_name();
    249256        }
    250257
     
    255262        }
    256263
    257         void Mangler::printQualifiers( Type * type ) {
     264        void Mangler::printQualifiers( Type *type ) {
    258265                // skip if not including qualifiers
    259266                if ( typeMode ) return;
     
    263270                        int tcount = 0, dcount = 0, fcount = 0, vcount = 0;
    264271                        mangleName << "A";
    265                         for ( Type::ForallList::iterator i = type->forall.begin(); i != type->forall.end(); ++i ) {
     272                        for ( Type::ForallList::iterator i = type->get_forall().begin(); i != type->get_forall().end(); ++i ) {
    266273                                switch ( (*i)->get_kind() ) {
     274                                  case TypeDecl::Any:
     275                                        tcount++;
     276                                        break;
    267277                                  case TypeDecl::Dtype:
    268278                                        dcount++;
     
    277287                                        assert( false );
    278288                                } // switch
    279                                 varNums[ (*i)->name ] = std::pair< int, int >( nextVarNum++, (int)(*i)->get_kind() );
    280                                 for ( std::list< DeclarationWithType* >::iterator assert = (*i)->assertions.begin(); assert != (*i)->assertions.end(); ++assert ) {
    281                                         Mangler sub_mangler( mangleOverridable, typeMode, mangleGenericParams );
     289                                varNums[ (*i )->get_name() ] = std::pair< int, int >( nextVarNum++, (int )(*i )->get_kind() );
     290                                for ( std::list< DeclarationWithType* >::iterator assert = (*i )->get_assertions().begin(); assert != (*i )->get_assertions().end(); ++assert ) {
     291                                        Mangler sub_mangler( mangleOverridable, typeMode );
    282292                                        sub_mangler.nextVarNum = nextVarNum;
    283293                                        sub_mangler.isTopLevel = false;
     
    297307                        mangleName << "V";
    298308                } // if
    299                 if ( type->get_mutex() ) {
    300                         mangleName << "M";
    301                 } // if
    302309                // Removed due to restrict not affecting function compatibility in GCC
    303310//              if ( type->get_isRestrict() ) {
     
    305312//              } // if
    306313                if ( type->get_lvalue() ) {
    307                         // mangle based on whether the type is lvalue, so that the resolver can differentiate lvalues and rvalues
    308314                        mangleName << "L";
    309                 }
     315                } // if
    310316                if ( type->get_atomic() ) {
    311317                        mangleName << "A";
  • src/SymTab/Mangler.h

    r3f7e12cb r78315272  
    3030                /// Mangle syntax tree object; primary interface to clients
    3131                template< typename SynTreeClass >
    32             static std::string mangle( SynTreeClass *decl, bool mangleOverridable = true, bool typeMode = false, bool mangleGenericParams = true );
     32            static std::string mangle( SynTreeClass *decl, bool mangleOverridable = true, bool typeMode = false );
    3333                /// Mangle a type name; secondary interface
    3434                static std::string mangleType( Type* ty );
    35                 /// Mangle ignoring generic type parameters
    36                 static std::string mangleConcrete( Type* ty );
    37 
    3835
    3936                virtual void visit( ObjectDecl *declaration );
     
    6562                bool mangleOverridable;         ///< Specially mangle overridable built-in methods
    6663                bool typeMode;                  ///< Produce a unique mangled name for a type
    67                 bool mangleGenericParams;       ///< Include generic parameters in name mangling if true
    6864
    69                 Mangler( bool mangleOverridable, bool typeMode, bool mangleGenericParams );
     65                Mangler( bool mangleOverridable, bool typeMode );
    7066                Mangler( const Mangler & );
    7167
    7268                void mangleDecl( DeclarationWithType *declaration );
    7369                void mangleRef( ReferenceToType *refType, std::string prefix );
     70                void mangleGenericRef( ReferenceToType *refType, std::string prefix );
    7471
    7572                void printQualifiers( Type *type );
     
    7774
    7875        template< typename SynTreeClass >
    79         std::string Mangler::mangle( SynTreeClass *decl, bool mangleOverridable, bool typeMode, bool mangleGenericParams ) {
    80                 Mangler mangler( mangleOverridable, typeMode, mangleGenericParams );
     76        std::string Mangler::mangle( SynTreeClass *decl, bool mangleOverridable, bool typeMode ) {
     77                Mangler mangler( mangleOverridable, typeMode );
    8178                maybeAccept( decl, mangler );
    8279                return mangler.get_mangleName();
  • src/SymTab/Validate.cc

    r3f7e12cb r78315272  
    5656#include "FixFunction.h"               // for FixFunction
    5757#include "Indexer.h"                   // for Indexer
    58 #include "InitTweak/GenInit.h"         // for fixReturnStatements
    5958#include "InitTweak/InitTweak.h"       // for isCtorDtorAssign
    6059#include "Parser/LinkageSpec.h"        // for C
     
    151150        /// Replaces array and function types in forall lists by appropriate pointer type and assigns each Object and Function declaration a unique ID.
    152151        struct ForallPointerDecay final {
    153                 void previsit( ObjectDecl * object );
    154                 void previsit( FunctionDecl * func );
    155                 void previsit( StructDecl * aggrDecl );
    156                 void previsit( UnionDecl * aggrDecl );
     152                void previsit( ObjectDecl *object );
     153                void previsit( FunctionDecl *func );
    157154        };
    158155
     
    268265                HoistStruct::hoistStruct( translationUnit ); // must happen after EliminateTypedef, so that aggregate typedefs occur in the correct order
    269266                ReturnTypeFixer::fix( translationUnit ); // must happen before autogen
    270                 acceptAll( translationUnit, epc ); // must happen before VerifyCtorDtorAssign, because void return objects should not exist; before LinkReferenceToTypes because it is an indexer and needs correct types for mangling
    271267                acceptAll( translationUnit, lrt ); // must happen before autogen, because sized flag needs to propagate to generated functions
    272268                acceptAll( translationUnit, genericParams );  // check as early as possible - can't happen before LinkReferenceToTypes
     269                acceptAll( translationUnit, epc ); // must happen before VerifyCtorDtorAssign, because void return objects should not exist
    273270                VerifyCtorDtorAssign::verify( translationUnit );  // must happen before autogen, because autogen examines existing ctor/dtors
    274                 ReturnChecker::checkFunctionReturns( translationUnit );
    275                 InitTweak::fixReturnStatements( translationUnit ); // must happen before autogen
    276271                Concurrency::applyKeywords( translationUnit );
    277                 acceptAll( translationUnit, fpd ); // must happen before autogenerateRoutines, after Concurrency::applyKeywords because uniqueIds must be set on declaration before resolution
    278272                autogenerateRoutines( translationUnit ); // moved up, used to be below compoundLiteral - currently needs EnumAndPointerDecay
    279273                Concurrency::implementMutexFuncs( translationUnit );
    280274                Concurrency::implementThreadStarter( translationUnit );
     275                ReturnChecker::checkFunctionReturns( translationUnit );
    281276                mutateAll( translationUnit, compoundliteral );
     277                acceptAll( translationUnit, fpd );
    282278                ArrayLength::computeLength( translationUnit );
    283                 acceptAll( translationUnit, finder ); // xxx - remove this pass soon
     279                acceptAll( translationUnit, finder );
    284280                mutateAll( translationUnit, labelAddrFixer );
    285281        }
     
    372368                        DWTIterator begin( dwts.begin() ), end( dwts.end() );
    373369                        if ( begin == end ) return;
    374                         PassVisitor<FixFunction> fixer;
     370                        FixFunction fixer;
    375371                        DWTIterator i = begin;
    376372                        *i = (*i)->acceptMutator( fixer );
    377                         if ( fixer.pass.isVoid ) {
     373                        if ( fixer.get_isVoid() ) {
    378374                                DWTIterator j = i;
    379375                                ++i;
     
    386382                                ++i;
    387383                                for ( ; i != end; ++i ) {
    388                                         PassVisitor<FixFunction> fixer;
     384                                        FixFunction fixer;
    389385                                        *i = (*i)->acceptMutator( fixer );
    390                                         if ( fixer.pass.isVoid ) {
     386                                        if ( fixer.get_isVoid() ) {
    391387                                                throw SemanticError( "invalid type void in function type ", func );
    392388                                        } // if
     
    583579
    584580        /// Fix up assertions - flattens assertion lists, removing all trait instances
    585         void forallFixer( std::list< TypeDecl * > & forall, BaseSyntaxNode * node ) {
    586                 for ( TypeDecl * type : forall ) {
     581        void forallFixer( Type * func ) {
     582                for ( TypeDecl * type : func->get_forall() ) {
    587583                        std::list< DeclarationWithType * > asserts;
    588584                        asserts.splice( asserts.end(), type->assertions );
     
    600596                        // apply FixFunction to every assertion to check for invalid void type
    601597                        for ( DeclarationWithType *& assertion : type->assertions ) {
    602                                 PassVisitor<FixFunction> fixer;
     598                                FixFunction fixer;
    603599                                assertion = assertion->acceptMutator( fixer );
    604                                 if ( fixer.pass.isVoid ) {
    605                                         throw SemanticError( "invalid type void in assertion of function ", node );
     600                                if ( fixer.get_isVoid() ) {
     601                                        throw SemanticError( "invalid type void in assertion of function ", func );
    606602                                } // if
    607603                        } // for
     
    611607
    612608        void ForallPointerDecay::previsit( ObjectDecl *object ) {
    613                 forallFixer( object->type->forall, object );
    614                 if ( PointerType *pointer = dynamic_cast< PointerType * >( object->type ) ) {
    615                         forallFixer( pointer->base->forall, object );
     609                forallFixer( object->get_type() );
     610                if ( PointerType *pointer = dynamic_cast< PointerType * >( object->get_type() ) ) {
     611                        forallFixer( pointer->get_base() );
    616612                } // if
    617613                object->fixUniqueId();
     
    619615
    620616        void ForallPointerDecay::previsit( FunctionDecl *func ) {
    621                 forallFixer( func->type->forall, func );
     617                forallFixer( func->get_type() );
    622618                func->fixUniqueId();
    623         }
    624 
    625         void ForallPointerDecay::previsit( StructDecl * aggrDecl ) {
    626                 forallFixer( aggrDecl->parameters, aggrDecl );
    627         }
    628 
    629         void ForallPointerDecay::previsit( UnionDecl * aggrDecl ) {
    630                 forallFixer( aggrDecl->parameters, aggrDecl );
    631619        }
    632620
     
    668656                }
    669657                filter( translationUnit, isTypedef, true );
     658
    670659        }
    671660
     
    675664                TypedefMap::const_iterator def = typedefNames.find( typeInst->get_name() );
    676665                if ( def != typedefNames.end() ) {
    677                         Type *ret = def->second.first->base->clone();
     666                        Type *ret = def->second.first->get_base()->clone();
    678667                        ret->get_qualifiers() |= typeInst->get_qualifiers();
    679668                        // place instance parameters on the typedef'd type
    680                         if ( ! typeInst->parameters.empty() ) {
     669                        if ( ! typeInst->get_parameters().empty() ) {
    681670                                ReferenceToType *rtt = dynamic_cast<ReferenceToType*>(ret);
    682671                                if ( ! rtt ) {
    683                                         throw SemanticError("Cannot apply type parameters to base type of " + typeInst->name);
     672                                        throw SemanticError("cannot apply type parameters to base type of " + typeInst->get_name());
    684673                                }
    685674                                rtt->get_parameters().clear();
    686                                 cloneAll( typeInst->parameters, rtt->parameters );
    687                                 mutateAll( rtt->parameters, *visitor );  // recursively fix typedefs on parameters
     675                                cloneAll( typeInst->get_parameters(), rtt->get_parameters() );
     676                                mutateAll( rtt->get_parameters(), *visitor );  // recursively fix typedefs on parameters
    688677                        } // if
    689678                        delete typeInst;
     
    691680                } else {
    692681                        TypeDeclMap::const_iterator base = typedeclNames.find( typeInst->get_name() );
    693                         assertf( base != typedeclNames.end(), "Cannot find typedecl name %s", typeInst->name.c_str() );
     682                        assertf( base != typedeclNames.end(), "Cannot find typedecl name %s", typeInst->get_name().c_str() );
    694683                        typeInst->set_baseType( base->second );
    695684                } // if
    696685                return typeInst;
    697         }
    698 
    699         struct VarLenChecker : WithShortCircuiting {
    700                 void previsit( FunctionType * ) { visit_children = false; }
    701                 void previsit( ArrayType * at ) {
    702                         isVarLen |= at->isVarLen;
    703                 }
    704                 bool isVarLen = false;
    705         };
    706 
    707         bool isVariableLength( Type * t ) {
    708                 PassVisitor<VarLenChecker> varLenChecker;
    709                 maybeAccept( t, varLenChecker );
    710                 return varLenChecker.pass.isVarLen;
    711686        }
    712687
     
    719694                        Type * t2 = typedefNames[ tyDecl->get_name() ].first->get_base();
    720695                        if ( ! ResolvExpr::typesCompatible( t1, t2, Indexer() ) ) {
    721                                 throw SemanticError( "Cannot redefine typedef: " + tyDecl->name );
    722                         }
    723                         // cannot redefine VLA typedefs
    724                         if ( isVariableLength( t1 ) || isVariableLength( t2 ) ) {
    725                                 throw SemanticError( "Cannot redefine typedef: " + tyDecl->name );
     696                                throw SemanticError( "cannot redefine typedef: " + tyDecl->get_name() );
    726697                        }
    727698                } else {
  • src/SynTree/AddressExpr.cc

    r3f7e12cb r78315272  
    3333        Type * addrType( Type * type ) {
    3434                if ( ReferenceType * refType = dynamic_cast< ReferenceType * >( type ) ) {
    35                         return new ReferenceType( refType->get_qualifiers(), addrType( refType->base ) );
     35                        return new ReferenceType( refType->get_qualifiers(), addrType( refType->get_base() ) );
    3636                } else {
    3737                        return new PointerType( Type::Qualifiers(), type->clone() );
     
    4040}
    4141
    42 AddressExpr::AddressExpr( Expression *arg ) : Expression(), arg( arg ) {
    43         if ( arg->result ) {
    44                 if ( arg->result->get_lvalue() ) {
     42AddressExpr::AddressExpr( Expression *arg, Expression *_aname ) : Expression( _aname ), arg( arg ) {
     43        if ( arg->has_result() ) {
     44                if ( arg->get_result()->get_lvalue() ) {
    4545                        // lvalue, retains all layers of reference and gains a pointer inside the references
    46                         set_result( addrType( arg->result ) );
     46                        set_result( addrType( arg->get_result() ) );
    4747                } else {
    4848                        // taking address of non-lvalue -- must be a reference, loses one layer of reference
    49                         ReferenceType * refType = strict_dynamic_cast< ReferenceType * >( arg->result );
    50                         set_result( addrType( refType->base ) );
     49                        ReferenceType * refType = strict_dynamic_cast< ReferenceType * >( arg->get_result() );
     50                        set_result( addrType( refType->get_base() ) );
    5151                }
    5252                // result of & is never an lvalue
     
    6262}
    6363
    64 void AddressExpr::print( std::ostream &os, Indenter indent ) const {
     64void AddressExpr::print( std::ostream &os, int indent ) const {
    6565        os << "Address of:" << std::endl;
    6666        if ( arg ) {
    67                 os << indent+1;
    68                 arg->print( os, indent+1 );
     67                os << std::string( indent+2, ' ' );
     68                arg->print( os, indent+2 );
    6969        } // if
    7070}
     
    7777LabelAddressExpr::~LabelAddressExpr() {}
    7878
    79 void LabelAddressExpr::print( std::ostream & os, Indenter ) const {
    80         os << "Address of label:" << arg;
     79void LabelAddressExpr::print( std::ostream & os, int indent ) const {
     80        os << "Address of label:" << std::endl << std::string( indent+2, ' ' ) << arg;
    8181}
    8282
  • src/SynTree/AggregateDecl.cc

    r3f7e12cb r78315272  
    4141}
    4242
    43 void AggregateDecl::print( std::ostream &os, Indenter indent ) const {
     43void AggregateDecl::print( std::ostream &os, int indent ) const {
    4444        using std::string;
    4545        using std::endl;
    4646
    47         os << typeString() << " " << name << ":";
     47        os << typeString() << " " << get_name() << ":";
    4848        if ( get_linkage() != LinkageSpec::Cforall ) {
    49                 os << " " << LinkageSpec::linkageName( linkage );
     49                os << " " << LinkageSpec::linkageName( get_linkage() );
    5050        } // if
    51         os << " with body " << has_body();
     51        os << " with body " << has_body() << endl;
    5252
    5353        if ( ! parameters.empty() ) {
    54                 os << endl << indent << "... with parameters" << endl;
    55                 printAll( parameters, os, indent+1 );
     54                os << endl << string( indent+2, ' ' ) << "with parameters" << endl;
     55                printAll( parameters, os, indent+4 );
    5656        } // if
    5757        if ( ! members.empty() ) {
    58                 os << endl << indent << "... with members" << endl;
    59                 printAll( members, os, indent+1 );
     58                os << endl << string( indent+2, ' ' ) << "with members" << endl;
     59                printAll( members, os, indent+4 );
    6060        } // if
    6161        if ( ! attributes.empty() ) {
    62                 os << endl << indent << "... with attributes" << endl;
    63                 printAll( attributes, os, indent+1 );
     62                os << endl << string( indent+2, ' ' ) << "with attributes" << endl;
     63                printAll( attributes, os, indent+4 );
    6464        } // if
    65         os << endl;
    6665}
    6766
    68 void AggregateDecl::printShort( std::ostream &os, Indenter indent ) const {
     67void AggregateDecl::printShort( std::ostream &os, int indent ) const {
    6968        using std::string;
    7069        using std::endl;
    7170
    72         os << typeString() << " " << name << " with body " << has_body() << endl;
     71        os << typeString() << " " << get_name();
     72        os << string( indent+2, ' ' ) << "with body " << has_body() << endl;
    7373
    7474        if ( ! parameters.empty() ) {
    75                 os << indent << "... with parameters" << endl;
    76                 printAll( parameters, os, indent+1 );
     75                os << endl << string( indent+2, ' ' ) << "with parameters" << endl;
     76                printAll( parameters, os, indent+4 );
    7777        } // if
    7878}
  • src/SynTree/ApplicationExpr.cc

    r3f7e12cb r78315272  
    5555        set_result( ResolvExpr::extractResultType( function ) );
    5656
    57         assert( result );
     57        assert( has_result() );
    5858}
    5959
    6060ApplicationExpr::ApplicationExpr( const ApplicationExpr &other ) :
    61                 Expression( other ), function( maybeClone( other.function ) ) {
     61                Expression( other ), function( maybeClone( other.function ) ), inferParams( other.inferParams ) {
    6262        cloneAll( other.args, args );
    6363}
     
    6868}
    6969
    70 void ApplicationExpr::print( std::ostream &os, Indenter indent ) const {
    71         os << "Application of" << std::endl << indent+1;
    72         function->print( os, indent+1 );
    73         os << std::endl;
     70void printInferParams( const InferredParams & inferParams, std::ostream &os, int indent, int level ) {
     71        if ( ! inferParams.empty() ) {
     72                os << std::string(indent, ' ') << "with inferred parameters " << level << ":" << std::endl;
     73                for ( InferredParams::const_iterator i = inferParams.begin(); i != inferParams.end(); ++i ) {
     74                        os << std::string(indent+2, ' ');
     75                        Declaration::declFromId( i->second.decl )->printShort( os, indent+2 );
     76                        os << std::endl;
     77                        printInferParams( *i->second.inferParams, os, indent+2, level+1 );
     78                } // for
     79        } // if
     80}
     81
     82void ApplicationExpr::print( std::ostream &os, int indent ) const {
     83        os << "Application of" << std::endl << std::string(indent+2, ' ');
     84        function->print( os, indent+2 );
    7485        if ( ! args.empty() ) {
    75                 os << indent << "... to arguments" << std::endl;
    76                 printAll( args, os, indent+1 );
     86                os << std::string( indent, ' ' ) << "to arguments" << std::endl;
     87                printAll( args, os, indent+2 );
    7788        } // if
     89        printInferParams( inferParams, os, indent+2, 0 );
    7890        Expression::print( os, indent );
    7991}
  • src/SynTree/ArrayType.cc

    r3f7e12cb r78315272  
    3939}
    4040
    41 void ArrayType::print( std::ostream &os, Indenter indent ) const {
     41void ArrayType::print( std::ostream &os, int indent ) const {
    4242        Type::print( os, indent );
    4343        if ( isStatic ) {
  • src/SynTree/AttrType.cc

    r3f7e12cb r78315272  
    55// file "LICENCE" distributed with Cforall.
    66//
    7 // AttrType.cc.cc --
     7// AttrType.cc.cc -- 
    88//
    99// Author           : Richard C. Bilson
     
    4242}
    4343
    44 void AttrType::print( std::ostream &os, Indenter indent ) const {
     44void AttrType::print( std::ostream &os, int indent ) const {
    4545        Type::print( os, indent );
    4646        os << "attribute " << name << " applied to ";
  • src/SynTree/Attribute.cc

    r3f7e12cb r78315272  
    2828}
    2929
    30 void Attribute::print( std::ostream &os, Indenter indent ) const {
     30void Attribute::print( std::ostream &os, int indent ) const {
    3131  using std::endl;
    3232  using std::string;
     
    3636    if ( ! parameters.empty() ) {
    3737      os << " with parameters: " << endl;
    38       printAll( parameters, os, indent+1 );
     38      printAll( parameters, os, indent );
    3939    }
    4040  }
  • src/SynTree/Attribute.h

    r3f7e12cb r78315272  
    2020#include <string>  // for string, operator==
    2121
    22 #include "BaseSyntaxNode.h"
    23 #include "Mutator.h"
    24 #include "Visitor.h"
    25 
    2622class Expression;
    2723
    2824// GCC attribute
    2925// https://gcc.gnu.org/onlinedocs/gcc-6.1.0/gcc/Attribute-Syntax.html#Attribute-Syntax
    30 class Attribute : public BaseSyntaxNode {
     26class Attribute {
    3127  public:
    32         std::string name;
    33         // to keep things nice and tight, use NameExpr for special identifier parameters
    34         std::list< Expression * > parameters;
    35 
    3628        Attribute( std::string name = "", const std::list< Expression * > & parameters = std::list< Expression * >() ) : name( name ), parameters( parameters ) {}
    3729        Attribute( const Attribute &other );
     
    4335        bool empty() const { return name == ""; }
    4436
    45         Attribute * clone() const override { return new Attribute( *this ); }
    46         virtual void accept( Visitor & v ) override { v.visit( this ); }
    47         virtual Attribute * acceptMutator( Mutator & m ) override { return m.mutate( this ); }
    48         virtual void print( std::ostream & os, Indenter indent = {} ) const override;
     37        Attribute * clone() const { return new Attribute( *this ); }
     38        void print( std:: ostream &os, int indent = 0 ) const;
     39  private:
     40        std::string name;
     41        // to keep things nice and tight, use NameExpr for special identifier parameters
     42        std::list< Expression * > parameters;
    4943};
    5044
  • src/SynTree/BaseSyntaxNode.h

    r3f7e12cb r78315272  
    1717
    1818#include "Common/CodeLocation.h"
    19 #include "Common/Indenter.h"
    2019class Visitor;
    21 class Mutator;
    2220
    2321class BaseSyntaxNode {
     
    2725        virtual ~BaseSyntaxNode() {}
    2826
    29         virtual BaseSyntaxNode * clone() const = 0;
    3027        virtual void accept( Visitor & v ) = 0;
    31         virtual BaseSyntaxNode * acceptMutator( Mutator & m ) = 0;
    32   /// Notes:
    33   /// * each node is responsible for indenting its children.
    34   /// * Expressions should not finish with a newline, since the expression's parent has better information.
    35         virtual void print( std::ostream & os, Indenter indent = {} ) const = 0;
    36   void print( std::ostream & os, unsigned int indent ) {
    37     print( os, Indenter{ Indenter::tabsize, indent });
    38   }
     28  virtual void print( std::ostream & os, int indent = 0 ) const = 0;
    3929};
    40 
    41 std::ostream & operator<<( std::ostream & out, const BaseSyntaxNode * node );
    4230
    4331// Local Variables: //
  • src/SynTree/BasicType.cc

    r3f7e12cb r78315272  
    55// file "LICENCE" distributed with Cforall.
    66//
    7 // BasicType.cc --
     7// BasicType.cc -- 
    88//
    99// Author           : Richard C. Bilson
    1010// Created On       : Mon May 18 07:44:20 2015
    1111// Last Modified By : Peter A. Buhr
    12 // Last Modified On : Mon Sep 25 14:14:03 2017
    13 // Update Count     : 11
     12// Last Modified On : Mon Sep 11 12:52:05 2017
     13// Update Count     : 9
    1414//
    1515
     
    2424BasicType::BasicType( const Type::Qualifiers &tq, Kind bt, const std::list< Attribute * > & attributes ) : Type( tq, attributes ), kind( bt ) {}
    2525
    26 void BasicType::print( std::ostream &os, Indenter indent ) const {
     26void BasicType::print( std::ostream &os, int indent ) const {
    2727        Type::print( os, indent );
    2828        os << BasicType::typeNames[ kind ];
     
    4343          case LongLongSignedInt:
    4444          case LongLongUnsignedInt:
    45           case SignedInt128:
    46           case UnsignedInt128:
    4745                return true;
    4846          case Float:
  • src/SynTree/CommaExpr.cc

    r3f7e12cb r78315272  
    2121#include "Type.h"            // for Type
    2222
    23 CommaExpr::CommaExpr( Expression *arg1, Expression *arg2 )
    24                 : Expression(), arg1( arg1 ), arg2( arg2 ) {
     23CommaExpr::CommaExpr( Expression *arg1, Expression *arg2, Expression *_aname )
     24                : Expression( _aname ), arg1( arg1 ), arg2( arg2 ) {
    2525        // xxx - result of a comma expression is never an lvalue, so should set lvalue
    2626        // to false on all result types. Actually doing this causes some strange things
     
    3939}
    4040
    41 void CommaExpr::print( std::ostream &os, Indenter indent ) const {
     41void CommaExpr::print( std::ostream &os, int indent ) const {
    4242        os << "Comma Expression:" << std::endl;
    43         os << (indent+1);
    44         arg1->print( os, indent+1 );
     43        os << std::string( indent+2, ' ' );
     44        arg1->print( os, indent+2 );
    4545        os << std::endl;
    46         os << (indent+1);
    47         arg2->print( os, indent+1 );
     46        os << std::string( indent+2, ' ' );
     47        arg2->print( os, indent+2 );
    4848        Expression::print( os, indent );
    4949}
  • src/SynTree/CompoundStmt.cc

    r3f7e12cb r78315272  
    2929
    3030CompoundStmt::CompoundStmt( std::list<Label> labels ) : Statement( labels ) {
    31 }
    32 
    33 CompoundStmt::CompoundStmt( std::list<Statement *> stmts ) : Statement( noLabels ), kids( stmts ) {
    3431}
    3532
     
    7370}
    7471
    75 void CompoundStmt::print( std::ostream &os, Indenter indent ) const {
    76         os << "CompoundStmt" << endl;
    77         printAll( kids, os, indent+1 );
     72void CompoundStmt::print( std::ostream &os, int indent ) const {
     73        os << "CompoundStmt" << endl ;
     74        printAll( kids, os, indent + 2 );
    7875}
    7976
  • src/SynTree/Constant.cc

    r3f7e12cb r78315272  
    3434}
    3535
    36 Constant Constant::from_char( char c ) {
    37         return Constant( new BasicType( Type::Qualifiers(), BasicType::Char ), std::to_string( c ), (unsigned long long int)c );
    38 }
    39 
    4036Constant Constant::from_int( int i ) {
    4137        return Constant( new BasicType( Type::Qualifiers(), BasicType::SignedInt ), std::to_string( i ), (unsigned long long int)i );
     
    7167}
    7268
    73 void Constant::print( std::ostream &os, Indenter ) const {
     69void Constant::print( std::ostream &os ) const {
    7470        os << "(" << rep << " " << val.ival;
    7571        if ( type ) {
  • src/SynTree/Constant.h

    r3f7e12cb r78315272  
    1919#include <string>     // for string
    2020
    21 #include "BaseSyntaxNode.h"
    2221#include "Mutator.h"  // for Mutator
    2322#include "Visitor.h"  // for Visitor
     
    2524class Type;
    2625
    27 class Constant : public BaseSyntaxNode {
     26class Constant {
    2827  public:
    2928        Constant( Type * type, std::string rep, unsigned long long val );
     
    3130        Constant( const Constant & other );
    3231        virtual ~Constant();
    33 
    34         virtual Constant * clone() const { return new Constant( *this ); }
    3532
    3633        Type * get_type() { return type; }
     
    4340        /// generates a boolean constant of the given bool
    4441        static Constant from_bool( bool b );
    45         /// generates a char constant of the given char
    46         static Constant from_char( char c );
    4742        /// generates an integer constant of the given int
    4843        static Constant from_int( int i );
     
    5752        virtual void accept( Visitor & v ) { v.visit( this ); }
    5853        virtual Constant * acceptMutator( Mutator & m ) { return m.mutate( this ); }
    59         virtual void print( std::ostream & os, Indenter indent = 0 ) const;
     54        virtual void print( std::ostream & os ) const;
    6055  private:
    6156        Type * type;
  • src/SynTree/DeclStmt.cc

    r3f7e12cb r78315272  
    3333}
    3434
    35 void DeclStmt::print( std::ostream &os, Indenter indent ) const {
     35void DeclStmt::print( std::ostream &os, int indent ) const {
    3636        assert( decl != 0 );
    3737        os << "Declaration of ";
  • src/SynTree/Declaration.cc

    r3f7e12cb r78315272  
    4242
    4343void Declaration::fixUniqueId() {
    44         // don't need to set unique ID twice
    45         if ( uniqueId ) return;
    4644        uniqueId = ++lastUniqueId;
    4745        idMap[ uniqueId ] = this;
     
    6159}
    6260
     61std::ostream & operator<<( std::ostream & out, const Declaration * decl ) {
     62        if ( decl ){
     63                decl->print( out );
     64        } else {
     65                out << "nullptr";
     66        }
     67        return out;
     68}
     69
    6370
    6471AsmDecl::AsmDecl( AsmStmt *stmt ) : Declaration( "", Type::StorageClasses(), LinkageSpec::C ), stmt( stmt ) {
     
    7279}
    7380
    74 void AsmDecl::print( std::ostream &os, Indenter indent ) const {
     81void AsmDecl::print( std::ostream &os, int indent ) const {
    7582        stmt->print( os, indent );
    7683}
    7784
    78 void AsmDecl::printShort( std::ostream &os, Indenter indent ) const {
     85void AsmDecl::printShort( std::ostream &os, int indent ) const {
    7986        stmt->print( os, indent );
    8087}
  • src/SynTree/Declaration.h

    r3f7e12cb r78315272  
    6161
    6262        void fixUniqueId( void );
    63         virtual Declaration *clone() const override = 0;
    64         virtual void accept( Visitor &v ) override = 0;
    65         virtual Declaration *acceptMutator( Mutator &m ) override = 0;
    66         virtual void print( std::ostream &os, Indenter indent = {} ) const override = 0;
    67         virtual void printShort( std::ostream &os, Indenter indent = {} ) const = 0;
     63        virtual Declaration *clone() const = 0;
     64        virtual void accept( Visitor &v ) = 0;
     65        virtual Declaration *acceptMutator( Mutator &m ) = 0;
     66        virtual void print( std::ostream &os, int indent = 0 ) const = 0;
     67        virtual void printShort( std::ostream &os, int indent = 0 ) const = 0;
    6868
    6969        static void dumpIds( std::ostream &os );
     
    106106        //void set_functionSpecifiers( Type::FuncSpecifiers newValue ) { fs = newValue; }
    107107
    108         virtual DeclarationWithType *clone() const override = 0;
    109         virtual DeclarationWithType *acceptMutator( Mutator &m )  override = 0;
     108        virtual DeclarationWithType *clone() const = 0;
     109        virtual DeclarationWithType *acceptMutator( Mutator &m ) = 0;
    110110
    111111        virtual Type * get_type() const = 0;
     
    128128        virtual ~ObjectDecl();
    129129
    130         virtual Type * get_type() const override { return type; }
    131         virtual void set_type(Type *newType) override { type = newType; }
     130        virtual Type * get_type() const { return type; }
     131        virtual void set_type(Type *newType) { type = newType; }
    132132
    133133        Initializer *get_init() const { return init; }
     
    139139        static ObjectDecl * newObject( const std::string & name, Type * type, Initializer * init );
    140140
    141         virtual ObjectDecl *clone() const override { return new ObjectDecl( *this ); }
    142         virtual void accept( Visitor &v ) override { v.visit( this ); }
    143         virtual DeclarationWithType *acceptMutator( Mutator &m )  override { return m.mutate( this ); }
    144         virtual void print( std::ostream &os, Indenter indent = {} ) const override;
    145         virtual void printShort( std::ostream &os, Indenter indent = {} ) const override;
     141        virtual ObjectDecl *clone() const { return new ObjectDecl( *this ); }
     142        virtual void accept( Visitor &v ) { v.visit( this ); }
     143        virtual DeclarationWithType *acceptMutator( Mutator &m ) { return m.mutate( this ); }
     144        virtual void print( std::ostream &os, int indent = 0 ) const;
     145        virtual void printShort( std::ostream &os, int indent = 0 ) const;
    146146};
    147147
     
    157157        virtual ~FunctionDecl();
    158158
    159         virtual Type * get_type() const override { return type; }
    160         virtual void set_type(Type * t) override { type = strict_dynamic_cast< FunctionType* >( t ); }
     159        Type * get_type() const { return type; }
     160        virtual void set_type(Type * t) { type = strict_dynamic_cast< FunctionType* >( t ); }
    161161
    162162        FunctionType * get_functionType() const { return type; }
     
    165165        void set_statements( CompoundStmt *newValue ) { statements = newValue; }
    166166
    167         static FunctionDecl * newFunction( const std::string & name, FunctionType * type, CompoundStmt * statements );
    168 
    169         virtual FunctionDecl *clone() const override { return new FunctionDecl( *this ); }
    170         virtual void accept( Visitor &v ) override { v.visit( this ); }
    171         virtual DeclarationWithType *acceptMutator( Mutator &m )  override { return m.mutate( this ); }
    172         virtual void print( std::ostream &os, Indenter indent = {} ) const override;
    173         virtual void printShort( std::ostream &os, Indenter indent = {} ) const override;
     167        virtual FunctionDecl *clone() const { return new FunctionDecl( *this ); }
     168        virtual void accept( Visitor &v ) { v.visit( this ); }
     169        virtual DeclarationWithType *acceptMutator( Mutator &m ) { return m.mutate( this ); }
     170        virtual void print( std::ostream &os, int indent = 0 ) const;
     171        virtual void printShort( std::ostream &os, int indent = 0 ) const;
    174172};
    175173
     
    192190        virtual std::string typeString() const = 0;
    193191
    194         virtual NamedTypeDecl *clone() const override = 0;
    195         virtual void print( std::ostream &os, Indenter indent = {} ) const override;
    196         virtual void printShort( std::ostream &os, Indenter indent = {} ) const override;
     192        virtual NamedTypeDecl *clone() const = 0;
     193        virtual void print( std::ostream &os, int indent = 0 ) const;
     194        virtual void printShort( std::ostream &os, int indent = 0 ) const;
    197195};
    198196
     
    200198        typedef NamedTypeDecl Parent;
    201199  public:
    202         enum Kind { Dtype, Ftype, Ttype };
     200        enum Kind { Any, Dtype, Ftype, Ttype };
    203201
    204202        Type * init;
     
    216214        };
    217215
    218         TypeDecl( const std::string &name, Type::StorageClasses scs, Type *type, Kind kind, bool sized, Type * init = nullptr );
     216        TypeDecl( const std::string &name, Type::StorageClasses scs, Type *type, Kind kind, Type * init = nullptr );
    219217        TypeDecl( const TypeDecl &other );
    220218        virtual ~TypeDecl();
     
    225223        TypeDecl * set_init( Type * newValue ) { init = newValue; return this; }
    226224
    227         bool isComplete() const { return sized; }
     225        bool isComplete() const { return kind == Any || sized; }
    228226        bool get_sized() const { return sized; }
    229227        TypeDecl * set_sized( bool newValue ) { sized = newValue; return this; }
    230228
    231         virtual std::string typeString() const override;
     229        virtual std::string typeString() const;
    232230        virtual std::string genTypeString() const;
    233231
    234         virtual TypeDecl *clone() const override { return new TypeDecl( *this ); }
    235         virtual void accept( Visitor &v ) override { v.visit( this ); }
    236         virtual Declaration *acceptMutator( Mutator &m )  override { return m.mutate( this ); }
    237         virtual void print( std::ostream &os, Indenter indent = {} ) const override;
     232        virtual TypeDecl *clone() const { return new TypeDecl( *this ); }
     233        virtual void accept( Visitor &v ) { v.visit( this ); }
     234        virtual Declaration *acceptMutator( Mutator &m ) { return m.mutate( this ); }
     235        virtual void print( std::ostream &os, int indent = 0 ) const;
    238236
    239237  private:
     
    247245        TypedefDecl( const TypedefDecl &other ) : Parent( other ) {}
    248246
    249         virtual std::string typeString() const override;
    250 
    251         virtual TypedefDecl *clone() const override { return new TypedefDecl( *this ); }
    252         virtual void accept( Visitor &v ) override { v.visit( this ); }
    253         virtual Declaration *acceptMutator( Mutator &m )  override { return m.mutate( this ); }
     247        virtual std::string typeString() const;
     248
     249        virtual TypedefDecl *clone() const { return new TypedefDecl( *this ); }
     250        virtual void accept( Visitor &v ) { v.visit( this ); }
     251        virtual Declaration *acceptMutator( Mutator &m ) { return m.mutate( this ); }
    254252  private:
    255253};
     
    276274        AggregateDecl * set_body( bool body ) { AggregateDecl::body = body; return this; }
    277275
    278         virtual void print( std::ostream &os, Indenter indent = {} ) const override;
    279         virtual void printShort( std::ostream &os, Indenter indent = {} ) const override;
     276        virtual void print( std::ostream &os, int indent = 0 ) const;
     277        virtual void printShort( std::ostream &os, int indent = 0 ) const;
    280278  protected:
    281279        virtual std::string typeString() const = 0;
     
    292290        bool is_thread() { return kind == DeclarationNode::Thread; }
    293291
    294         virtual StructDecl *clone() const override { return new StructDecl( *this ); }
    295         virtual void accept( Visitor &v ) override { v.visit( this ); }
    296         virtual Declaration *acceptMutator( Mutator &m )  override { return m.mutate( this ); }
     292        virtual StructDecl *clone() const { return new StructDecl( *this ); }
     293        virtual void accept( Visitor &v ) { v.visit( this ); }
     294        virtual Declaration *acceptMutator( Mutator &m ) { return m.mutate( this ); }
    297295  private:
    298296        DeclarationNode::Aggregate kind;
    299         virtual std::string typeString() const override;
     297        virtual std::string typeString() const;
    300298};
    301299
     
    306304        UnionDecl( const UnionDecl &other ) : Parent( other ) {}
    307305
    308         virtual UnionDecl *clone() const override { return new UnionDecl( *this ); }
    309         virtual void accept( Visitor &v ) override { v.visit( this ); }
    310         virtual Declaration *acceptMutator( Mutator &m )  override { return m.mutate( this ); }
    311   private:
    312         virtual std::string typeString() const override;
     306        virtual UnionDecl *clone() const { return new UnionDecl( *this ); }
     307        virtual void accept( Visitor &v ) { v.visit( this ); }
     308        virtual Declaration *acceptMutator( Mutator &m ) { return m.mutate( this ); }
     309  private:
     310        virtual std::string typeString() const;
    313311};
    314312
     
    319317        EnumDecl( const EnumDecl &other ) : Parent( other ) {}
    320318
    321         virtual EnumDecl *clone() const override { return new EnumDecl( *this ); }
    322         virtual void accept( Visitor &v ) override { v.visit( this ); }
    323         virtual Declaration *acceptMutator( Mutator &m )  override { return m.mutate( this ); }
    324   private:
    325         virtual std::string typeString() const override;
     319        virtual EnumDecl *clone() const { return new EnumDecl( *this ); }
     320        virtual void accept( Visitor &v ) { v.visit( this ); }
     321        virtual Declaration *acceptMutator( Mutator &m ) { return m.mutate( this ); }
     322  private:
     323        virtual std::string typeString() const;
    326324};
    327325
     
    334332        TraitDecl( const TraitDecl &other ) : Parent( other ) {}
    335333
    336         virtual TraitDecl *clone() const override { return new TraitDecl( *this ); }
    337         virtual void accept( Visitor &v ) override { v.visit( this ); }
    338         virtual Declaration *acceptMutator( Mutator &m )  override { return m.mutate( this ); }
    339   private:
    340         virtual std::string typeString() const override;
     334        virtual TraitDecl *clone() const { return new TraitDecl( *this ); }
     335        virtual void accept( Visitor &v ) { v.visit( this ); }
     336        virtual Declaration *acceptMutator( Mutator &m ) { return m.mutate( this ); }
     337  private:
     338        virtual std::string typeString() const;
    341339};
    342340
     
    352350        void set_stmt( AsmStmt *newValue ) { stmt = newValue; }
    353351
    354         virtual AsmDecl *clone() const override { return new AsmDecl( *this ); }
    355         virtual void accept( Visitor &v ) override { v.visit( this ); }
    356         virtual AsmDecl *acceptMutator( Mutator &m )  override { return m.mutate( this ); }
    357         virtual void print( std::ostream &os, Indenter indent = {} ) const override;
    358         virtual void printShort( std::ostream &os, Indenter indent = {} ) const override;
    359 };
    360 
     352        virtual AsmDecl *clone() const { return new AsmDecl( *this ); }
     353        virtual void accept( Visitor &v ) { v.visit( this ); }
     354        virtual AsmDecl *acceptMutator( Mutator &m ) { return m.mutate( this ); }
     355        virtual void print( std::ostream &os, int indent = 0 ) const;
     356        virtual void printShort( std::ostream &os, int indent = 0 ) const;
     357};
     358
     359std::ostream & operator<<( std::ostream & out, const Declaration * decl );
    361360std::ostream & operator<<( std::ostream & os, const TypeDecl::Data & data );
    362361
  • src/SynTree/Expression.cc

    r3f7e12cb r78315272  
    3333#include "GenPoly/Lvalue.h"
    3434
    35 void printInferParams( const InferredParams & inferParams, std::ostream &os, Indenter indent, int level ) {
    36         if ( ! inferParams.empty() ) {
    37                 os << indent << "with inferred parameters " << level << ":" << std::endl;
    38                 for ( InferredParams::const_iterator i = inferParams.begin(); i != inferParams.end(); ++i ) {
    39                         os << indent+1;
    40                         Declaration::declFromId( i->second.decl )->printShort( os, indent+1 );
    41                         os << std::endl;
    42                         printInferParams( *i->second.inferParams, os, indent+1, level+1 );
    43                 } // for
    44         } // if
    45 }
    46 
    47 Expression::Expression() : result( 0 ), env( 0 ) {}
    48 
    49 Expression::Expression( const Expression &other ) : BaseSyntaxNode( other ), result( maybeClone( other.result ) ), env( maybeClone( other.env ) ), extension( other.extension ), inferParams( other.inferParams ) {
     35Expression::Expression( Expression *_aname ) : result( 0 ), env( 0 ), argName( _aname ) {}
     36
     37Expression::Expression( const Expression &other ) : BaseSyntaxNode( other ), result( maybeClone( other.result ) ), env( maybeClone( other.env ) ), argName( maybeClone( other.get_argName() ) ), extension( other.extension ) {
    5038}
    5139
    5240Expression::~Expression() {
    5341        delete env;
     42        delete argName; // xxx -- there's a problem in cloning ConstantExpr I still don't know how to fix
    5443        delete result;
    5544}
    5645
    57 void Expression::print( std::ostream &os, Indenter indent ) const {
    58         printInferParams( inferParams, os, indent+1, 0 );
    59 
     46void Expression::print( std::ostream &os, int indent ) const {
    6047        if ( env ) {
    61                 os << std::endl << indent << "... with environment:" << std::endl;
    62                 env->print( os, indent+1 );
     48                os << std::string( indent, ' ' ) << "with environment:" << std::endl;
     49                env->print( os, indent+2 );
    6350        } // if
    6451
     52        if ( argName ) {
     53                os << std::string( indent, ' ' ) << "with designator:";
     54                argName->print( os, indent+2 );
     55        } // if
     56
    6557        if ( extension ) {
    66                 os << std::endl << indent << "... with extension:";
     58                os << std::string( indent, ' ' ) << "with extension:";
    6759        } // if
    6860}
    6961
    70 ConstantExpr::ConstantExpr( Constant _c ) : Expression(), constant( _c ) {
     62ConstantExpr::ConstantExpr( Constant _c, Expression *_aname ) : Expression( _aname ), constant( _c ) {
    7163        set_result( constant.get_type()->clone() );
    7264}
     
    7769ConstantExpr::~ConstantExpr() {}
    7870
    79 void ConstantExpr::print( std::ostream &os, Indenter indent ) const {
     71void ConstantExpr::print( std::ostream &os, int indent ) const {
    8072        os << "constant expression " ;
    8173        constant.print( os );
     
    8375}
    8476
    85 VariableExpr::VariableExpr( DeclarationWithType *_var ) : Expression(), var( _var ) {
     77VariableExpr::VariableExpr( DeclarationWithType *_var, Expression *_aname ) : Expression( _aname ), var( _var ) {
    8678        assert( var );
    8779        assert( var->get_type() );
     
    10496}
    10597
    106 void VariableExpr::print( std::ostream &os, Indenter indent ) const {
     98void VariableExpr::print( std::ostream &os, int indent ) const {
    10799        os << "Variable Expression: ";
    108         var->printShort(os, indent);
    109         Expression::print( os, indent );
    110 }
    111 
    112 SizeofExpr::SizeofExpr( Expression *expr_ ) :
    113                 Expression(), expr(expr_), type(0), isType(false) {
     100
     101        Declaration *decl = get_var();
     102        if ( decl != 0) decl->printShort(os, indent + 2);
     103        os << std::endl;
     104        Expression::print( os, indent );
     105}
     106
     107SizeofExpr::SizeofExpr( Expression *expr_, Expression *_aname ) :
     108                Expression( _aname ), expr(expr_), type(0), isType(false) {
    114109        set_result( new BasicType( Type::Qualifiers(), BasicType::LongUnsignedInt ) );
    115110}
    116111
    117 SizeofExpr::SizeofExpr( Type *type_ ) :
    118                 Expression(), expr(0), type(type_), isType(true) {
     112SizeofExpr::SizeofExpr( Type *type_, Expression *_aname ) :
     113                Expression( _aname ), expr(0), type(type_), isType(true) {
    119114        set_result( new BasicType( Type::Qualifiers(), BasicType::LongUnsignedInt ) );
    120115}
     
    129124}
    130125
    131 void SizeofExpr::print( std::ostream &os, Indenter indent) const {
     126void SizeofExpr::print( std::ostream &os, int indent) const {
    132127        os << "Sizeof Expression on: ";
    133         if (isType) type->print(os, indent+1);
    134         else expr->print(os, indent+1);
    135         Expression::print( os, indent );
    136 }
    137 
    138 AlignofExpr::AlignofExpr( Expression *expr_ ) :
    139                 Expression(), expr(expr_), type(0), isType(false) {
     128
     129        if (isType)
     130                type->print(os, indent + 2);
     131        else
     132                expr->print(os, indent + 2);
     133
     134        os << std::endl;
     135        Expression::print( os, indent );
     136}
     137
     138AlignofExpr::AlignofExpr( Expression *expr_, Expression *_aname ) :
     139                Expression( _aname ), expr(expr_), type(0), isType(false) {
    140140        set_result( new BasicType( Type::Qualifiers(), BasicType::LongUnsignedInt ) );
    141141}
    142142
    143 AlignofExpr::AlignofExpr( Type *type_ ) :
    144                 Expression(), expr(0), type(type_), isType(true) {
     143AlignofExpr::AlignofExpr( Type *type_, Expression *_aname ) :
     144                Expression( _aname ), expr(0), type(type_), isType(true) {
    145145        set_result( new BasicType( Type::Qualifiers(), BasicType::LongUnsignedInt ) );
    146146}
     
    155155}
    156156
    157 void AlignofExpr::print( std::ostream &os, Indenter indent) const {
     157void AlignofExpr::print( std::ostream &os, int indent) const {
    158158        os << "Alignof Expression on: ";
    159         if (isType) type->print(os, indent+1);
    160         else expr->print(os, indent+1);
    161         Expression::print( os, indent );
    162 }
    163 
    164 UntypedOffsetofExpr::UntypedOffsetofExpr( Type *type, const std::string &member ) :
    165                 Expression(), type(type), member(member) {
    166         assert( type );
     159
     160        if (isType)
     161                type->print(os, indent + 2);
     162        else
     163                expr->print(os, indent + 2);
     164
     165        os << std::endl;
     166        Expression::print( os, indent );
     167}
     168
     169UntypedOffsetofExpr::UntypedOffsetofExpr( Type *type_, const std::string &member_, Expression *_aname ) :
     170                Expression( _aname ), type(type_), member(member_) {
    167171        set_result( new BasicType( Type::Qualifiers(), BasicType::LongUnsignedInt ) );
    168172}
     
    175179}
    176180
    177 void UntypedOffsetofExpr::print( std::ostream &os, Indenter indent) const {
    178         os << "Untyped Offsetof Expression on member " << member << " of ";
    179         type->print(os, indent+1);
    180         Expression::print( os, indent );
    181 }
    182 
    183 OffsetofExpr::OffsetofExpr( Type *type, DeclarationWithType *member ) :
    184                 Expression(), type(type), member(member) {
    185         assert( member );
    186         assert( type );
     181void UntypedOffsetofExpr::print( std::ostream &os, int indent) const {
     182        os << std::string( indent, ' ' ) << "Untyped Offsetof Expression on member " << member << " of ";
     183
     184        if ( type ) {
     185                type->print(os, indent + 2);
     186        } else {
     187                os << "<NULL>";
     188        }
     189
     190        os << std::endl;
     191        Expression::print( os, indent );
     192}
     193
     194OffsetofExpr::OffsetofExpr( Type *type_, DeclarationWithType *member_, Expression *_aname ) :
     195                Expression( _aname ), type(type_), member(member_) {
    187196        set_result( new BasicType( Type::Qualifiers(), BasicType::LongUnsignedInt ) );
    188197}
     
    195204}
    196205
    197 void OffsetofExpr::print( std::ostream &os, Indenter indent) const {
    198         os << "Offsetof Expression on member " << member->name << " of ";
    199         type->print(os, indent+1);
    200         Expression::print( os, indent );
    201 }
    202 
    203 OffsetPackExpr::OffsetPackExpr( StructInstType *type ) : Expression(), type( type ) {
    204         assert( type );
     206void OffsetofExpr::print( std::ostream &os, int indent) const {
     207        os << std::string( indent, ' ' ) << "Offsetof Expression on member ";
     208
     209        if ( member ) {
     210                os << member->get_name();
     211        } else {
     212                os << "<NULL>";
     213        }
     214
     215        os << " of ";
     216
     217        if ( type ) {
     218                type->print(os, indent + 2);
     219        } else {
     220                os << "<NULL>";
     221        }
     222
     223        os << std::endl;
     224        Expression::print( os, indent );
     225}
     226
     227OffsetPackExpr::OffsetPackExpr( StructInstType *type_, Expression *aname_ ) : Expression( aname_ ), type( type_ ) {
    205228        set_result( new ArrayType( Type::Qualifiers(), new BasicType( Type::Qualifiers(), BasicType::LongUnsignedInt ), 0, false, false ) );
    206229}
     
    210233OffsetPackExpr::~OffsetPackExpr() { delete type; }
    211234
    212 void OffsetPackExpr::print( std::ostream &os, Indenter indent ) const {
    213         os << "Offset pack expression on ";
    214         type->print(os, indent+1);
    215         Expression::print( os, indent );
    216 }
    217 
    218 AttrExpr::AttrExpr( Expression *attr, Expression *expr_ ) :
    219                 Expression(), attr( attr ), expr(expr_), type(0), isType(false) {
    220 }
    221 
    222 AttrExpr::AttrExpr( Expression *attr, Type *type_ ) :
    223                 Expression(), attr( attr ), expr(0), type(type_), isType(true) {
     235void OffsetPackExpr::print( std::ostream &os, int indent ) const {
     236        os << std::string( indent, ' ' ) << "Offset pack expression on ";
     237
     238        if ( type ) {
     239                type->print(os, indent + 2);
     240        } else {
     241                os << "<NULL>";
     242        }
     243
     244        os << std::endl;
     245        Expression::print( os, indent );
     246}
     247
     248AttrExpr::AttrExpr( Expression *attr, Expression *expr_, Expression *_aname ) :
     249                Expression( _aname ), attr( attr ), expr(expr_), type(0), isType(false) {
     250}
     251
     252AttrExpr::AttrExpr( Expression *attr, Type *type_, Expression *_aname ) :
     253                Expression( _aname ), attr( attr ), expr(0), type(type_), isType(true) {
    224254}
    225255
     
    234264}
    235265
    236 void AttrExpr::print( std::ostream &os, Indenter indent) const {
     266void AttrExpr::print( std::ostream &os, int indent) const {
    237267        os << "Attr ";
    238         attr->print( os, indent+1);
     268        attr->print( os, indent + 2 );
    239269        if ( isType || expr ) {
    240270                os << "applied to: ";
    241                 if (isType) type->print(os, indent+1);
    242                 else expr->print(os, indent+1);
     271
     272                if (isType)
     273                        type->print(os, indent + 2);
     274                else
     275                        expr->print(os, indent + 2);
    243276        } // if
    244         Expression::print( os, indent );
    245 }
    246 
    247 CastExpr::CastExpr( Expression *arg_, Type *toType ) : Expression(), arg(arg_) {
     277
     278        os << std::endl;
     279        Expression::print( os, indent );
     280}
     281
     282CastExpr::CastExpr( Expression *arg_, Type *toType, Expression *_aname ) : Expression( _aname ), arg(arg_) {
    248283        set_result(toType);
    249284}
    250285
    251 CastExpr::CastExpr( Expression *arg_ ) : Expression(), arg(arg_) {
     286CastExpr::CastExpr( Expression *arg_, Expression *_aname ) : Expression( _aname ), arg(arg_) {
    252287        set_result( new VoidType( Type::Qualifiers() ) );
    253288}
     
    260295}
    261296
    262 void CastExpr::print( std::ostream &os, Indenter indent ) const {
    263         os << "Cast of:" << std::endl << indent+1;
    264         arg->print(os, indent+1);
    265         os << std::endl << indent << "... to:";
     297void CastExpr::print( std::ostream &os, int indent ) const {
     298        os << "Cast of:" << std::endl << std::string( indent+2, ' ' );
     299        arg->print(os, indent+2);
     300        os << std::endl << std::string( indent, ' ' ) << "to:" << std::endl;
     301        os << std::string( indent+2, ' ' );
    266302        if ( result->isVoid() ) {
    267                 os << " nothing";
     303                os << "nothing";
    268304        } else {
    269                 os << std::endl << indent+1;
    270                 result->print( os, indent+1 );
     305                result->print( os, indent+2 );
    271306        } // if
     307        os << std::endl;
    272308        Expression::print( os, indent );
    273309}
     
    284320}
    285321
    286 void VirtualCastExpr::print( std::ostream &os, Indenter indent ) const {
    287         os << "Virtual Cast of:" << std::endl << indent+1;
    288         arg->print(os, indent+1);
    289         os << std::endl << indent << "... to:";
     322void VirtualCastExpr::print( std::ostream &os, int indent ) const {
     323        os << "Virtual Cast of:" << std::endl << std::string( indent+2, ' ' );
     324        arg->print(os, indent+2);
     325        os << std::endl << std::string( indent, ' ' ) << "to:" << std::endl;
     326        os << std::string( indent+2, ' ' );
    290327        if ( ! result ) {
    291                 os << " unknown";
     328                os << "unknown";
    292329        } else {
    293                 os << std::endl << indent+1;
    294                 result->print( os, indent+1 );
     330                result->print( os, indent+2 );
    295331        } // if
    296         Expression::print( os, indent );
    297 }
    298 
    299 UntypedMemberExpr::UntypedMemberExpr( Expression * member, Expression *aggregate ) :
    300                 Expression(), member(member), aggregate(aggregate) {
    301         assert( aggregate );
    302 }
     332        os << std::endl;
     333        Expression::print( os, indent );
     334}
     335
     336UntypedMemberExpr::UntypedMemberExpr( Expression * _member, Expression *_aggregate, Expression *_aname ) :
     337                Expression( _aname ), member(_member), aggregate(_aggregate) {}
    303338
    304339UntypedMemberExpr::UntypedMemberExpr( const UntypedMemberExpr &other ) :
     
    311346}
    312347
    313 void UntypedMemberExpr::print( std::ostream &os, Indenter indent ) const {
    314         os << "Untyped Member Expression, with field: " << std::endl << indent+1;
    315         member->print(os, indent+1 );
    316         os << indent << "... from aggregate: " << std::endl << indent+1;
    317         aggregate->print(os, indent+1);
     348void UntypedMemberExpr::print( std::ostream &os, int indent ) const {
     349        os << "Untyped Member Expression, with field: " << std::endl;
     350        os << std::string( indent+2, ' ' );
     351        get_member()->print(os, indent+4);
     352        os << std::string( indent+2, ' ' );
     353
     354        Expression *agg = get_aggregate();
     355        os << "from aggregate: " << std::endl;
     356        if (agg != 0) {
     357                os << std::string( indent + 4, ' ' );
     358                agg->print(os, indent + 4);
     359        }
     360        os << std::string( indent+2, ' ' );
    318361        Expression::print( os, indent );
    319362}
     
    334377
    335378
    336 MemberExpr::MemberExpr( DeclarationWithType *member, Expression *aggregate ) :
    337                 Expression(), member(member), aggregate(aggregate) {
    338         assert( member );
    339         assert( aggregate );
     379MemberExpr::MemberExpr( DeclarationWithType *_member, Expression *_aggregate, Expression *_aname ) :
     380                Expression( _aname ), member(_member), aggregate(_aggregate) {
    340381
    341382        TypeSubstitution sub( makeSub( aggregate->get_result() ) );
     
    355396}
    356397
    357 void MemberExpr::print( std::ostream &os, Indenter indent ) const {
     398void MemberExpr::print( std::ostream &os, int indent ) const {
    358399        os << "Member Expression, with field: " << std::endl;
    359         os << indent+1;
    360         member->print( os, indent+1 );
    361         os << std::endl << indent << "... from aggregate: " << std::endl << indent+1;
    362         aggregate->print(os, indent + 1);
    363         Expression::print( os, indent );
    364 }
    365 
    366 UntypedExpr::UntypedExpr( Expression *function, const std::list<Expression *> &args ) :
    367                 Expression(), function(function), args(args) {}
     400
     401        assert( member );
     402        os << std::string( indent + 2, ' ' );
     403        member->print( os, indent + 2 );
     404        os << std::endl;
     405
     406        Expression *agg = get_aggregate();
     407        os << std::string( indent, ' ' ) << "from aggregate: " << std::endl;
     408        if (agg != 0) {
     409                os << std::string( indent + 2, ' ' );
     410                agg->print(os, indent + 2);
     411        }
     412        os << std::string( indent+2, ' ' );
     413        Expression::print( os, indent );
     414}
     415
     416UntypedExpr::UntypedExpr( Expression *_function, const std::list<Expression *> &_args, Expression *_aname ) :
     417                Expression( _aname ), function(_function), args(_args) {}
    368418
    369419UntypedExpr::UntypedExpr( const UntypedExpr &other ) :
     
    406456
    407457
    408 void UntypedExpr::print( std::ostream &os, Indenter indent ) const {
     458void UntypedExpr::print( std::ostream &os, int indent ) const {
    409459        os << "Applying untyped: " << std::endl;
    410         os << indent+1;
    411         function->print(os, indent+1);
    412         os << std::endl << indent << "...to: " << std::endl;
    413         printAll(args, os, indent+1);
    414         Expression::print( os, indent );
    415 }
    416 
    417 NameExpr::NameExpr( std::string name ) : Expression(), name(name) {
    418         assertf(name != "0", "Zero is not a valid name");
    419         assertf(name != "1", "One is not a valid name");
     460        os << std::string( indent+2, ' ' );
     461        function->print(os, indent + 2);
     462        os << std::string( indent, ' ' ) << "...to: " << std::endl;
     463        printAll(args, os, indent + 2);
     464        Expression::print( os, indent );
     465}
     466
     467void UntypedExpr::printArgs( std::ostream &os, int indent ) const {
     468        std::list<Expression *>::const_iterator i;
     469        for (i = args.begin(); i != args.end(); i++) {
     470                os << std::string(indent, ' ' );
     471                (*i)->print(os, indent);
     472        }
     473}
     474
     475NameExpr::NameExpr( std::string _name, Expression *_aname ) : Expression( _aname ), name(_name) {
     476        assertf(_name != "0", "Zero is not a valid name\n");
     477        assertf(_name != "1", "One is not a valid name\n");
    420478}
    421479
     
    425483NameExpr::~NameExpr() {}
    426484
    427 void NameExpr::print( std::ostream &os, Indenter indent ) const {
    428         os << "Name: " << get_name();
    429         Expression::print( os, indent );
    430 }
    431 
    432 LogicalExpr::LogicalExpr( Expression *arg1_, Expression *arg2_, bool andp ) :
    433                 Expression(), arg1(arg1_), arg2(arg2_), isAnd(andp) {
     485void NameExpr::print( std::ostream &os, int indent ) const {
     486        os << "Name: " << get_name() << std::endl;
     487        Expression::print( os, indent );
     488}
     489
     490LogicalExpr::LogicalExpr( Expression *arg1_, Expression *arg2_, bool andp, Expression *_aname ) :
     491                Expression( _aname ), arg1(arg1_), arg2(arg2_), isAnd(andp) {
    434492        set_result( new BasicType( Type::Qualifiers(), BasicType::SignedInt ) );
    435493}
     
    444502}
    445503
    446 void LogicalExpr::print( std::ostream &os, Indenter indent )const {
    447         os << "Short-circuited operation (" << (isAnd ? "and" : "or") << ") on: ";
     504void LogicalExpr::print( std::ostream &os, int indent )const {
     505        os << "Short-circuited operation (" << (isAnd?"and":"or") << ") on: ";
    448506        arg1->print(os);
    449507        os << " and ";
    450508        arg2->print(os);
    451         Expression::print( os, indent );
    452 }
    453 
    454 ConditionalExpr::ConditionalExpr( Expression * arg1, Expression * arg2, Expression * arg3 ) :
    455                 Expression(), arg1(arg1), arg2(arg2), arg3(arg3) {}
     509        os << std::endl;
     510        Expression::print( os, indent );
     511}
     512
     513ConditionalExpr::ConditionalExpr( Expression *arg1_, Expression *arg2_, Expression *arg3_, Expression *_aname ) :
     514                Expression( _aname ), arg1(arg1_), arg2(arg2_), arg3(arg3_) {}
    456515
    457516ConditionalExpr::ConditionalExpr( const ConditionalExpr &other ) :
     
    465524}
    466525
    467 void ConditionalExpr::print( std::ostream &os, Indenter indent ) const {
    468         os << "Conditional expression on: " << std::endl << indent+1;
    469         arg1->print( os, indent+1 );
    470         os << indent << "First alternative:" << std::endl << indent+1;
    471         arg2->print( os, indent+1 );
    472         os << indent << "Second alternative:" << std::endl << indent+1;
    473         arg3->print( os, indent+1 );
     526void ConditionalExpr::print( std::ostream &os, int indent ) const {
     527        os << "Conditional expression on: " << std::endl;
     528        os << std::string( indent+2, ' ' );
     529        arg1->print( os, indent+2 );
     530        os << std::string( indent, ' ' ) << "First alternative:" << std::endl;
     531        os << std::string( indent+2, ' ' );
     532        arg2->print( os, indent+2 );
     533        os << std::string( indent, ' ' ) << "Second alternative:" << std::endl;
     534        os << std::string( indent+2, ' ' );
     535        arg3->print( os, indent+2 );
     536        os << std::endl;
    474537        Expression::print( os, indent );
    475538}
     
    478541
    479542
    480 void AsmExpr::print( std::ostream &os, Indenter indent ) const {
     543void AsmExpr::print( std::ostream &os, int indent ) const {
    481544        os << "Asm Expression: " << std::endl;
    482         if ( inout ) inout->print( os, indent+1 );
    483         if ( constraint ) constraint->print( os, indent+1 );
    484         if ( operand ) operand->print( os, indent+1 );
     545        if ( inout ) inout->print( os, indent + 2 );
     546        if ( constraint ) constraint->print( os, indent + 2 );
     547        if ( operand ) operand->print( os, indent + 2 );
    485548}
    486549
     
    488551ImplicitCopyCtorExpr::ImplicitCopyCtorExpr( ApplicationExpr * callExpr ) : callExpr( callExpr ) {
    489552        assert( callExpr );
    490         assert( callExpr->result );
     553        assert( callExpr->has_result() );
    491554        set_result( callExpr->get_result()->clone() );
    492555}
     
    506569}
    507570
    508 void ImplicitCopyCtorExpr::print( std::ostream &os, Indenter indent ) const {
    509         os <<  "Implicit Copy Constructor Expression: " << std::endl << indent+1;
    510         callExpr->print( os, indent+1 );
    511         os << std::endl << indent << "... with temporaries:" << std::endl;
    512         printAll( tempDecls, os, indent+1 );
    513         os << std::endl << indent << "... with return temporaries:" << std::endl;
    514         printAll( returnDecls, os, indent+1 );
     571void ImplicitCopyCtorExpr::print( std::ostream &os, int indent ) const {
     572        os <<  "Implicit Copy Constructor Expression: " << std::endl;
     573        assert( callExpr );
     574        os << std::string( indent+2, ' ' );
     575        callExpr->print( os, indent + 2 );
     576        os << std::endl << std::string( indent, ' ' ) << "with temporaries:" << std::endl;
     577        printAll(tempDecls, os, indent+2);
     578        os << std::endl << std::string( indent, ' ' ) << "with return temporaries:" << std::endl;
     579        printAll(returnDecls, os, indent+2);
    515580        Expression::print( os, indent );
    516581}
     
    522587        Expression * arg = InitTweak::getCallArg( callExpr, 0 );
    523588        assert( arg );
    524         set_result( maybeClone( arg->result ) );
     589        set_result( maybeClone( arg->get_result() ) );
    525590}
    526591
     
    532597}
    533598
    534 void ConstructorExpr::print( std::ostream &os, Indenter indent ) const {
    535         os <<  "Constructor Expression: " << std::endl << indent+1;
     599void ConstructorExpr::print( std::ostream &os, int indent ) const {
     600        os <<  "Constructor Expression: " << std::endl;
     601        assert( callExpr );
     602        os << std::string( indent+2, ' ' );
    536603        callExpr->print( os, indent + 2 );
    537604        Expression::print( os, indent );
     
    551618}
    552619
    553 void CompoundLiteralExpr::print( std::ostream &os, Indenter indent ) const {
    554         os << "Compound Literal Expression: " << std::endl << indent+1;
    555         result->print( os, indent+1 );
    556         os << indent+1;
    557         initializer->print( os, indent+1 );
     620void CompoundLiteralExpr::print( std::ostream &os, int indent ) const {
     621        os << "Compound Literal Expression: " << std::endl;
     622        os << std::string( indent+2, ' ' );
     623        get_result()->print( os, indent + 2 );
     624        os << std::string( indent+2, ' ' );
     625        initializer->print( os, indent + 2 );
    558626        Expression::print( os, indent );
    559627}
     
    561629RangeExpr::RangeExpr( Expression *low, Expression *high ) : low( low ), high( high ) {}
    562630RangeExpr::RangeExpr( const RangeExpr &other ) : Expression( other ), low( other.low->clone() ), high( other.high->clone() ) {}
    563 void RangeExpr::print( std::ostream &os, Indenter indent ) const {
     631void RangeExpr::print( std::ostream &os, int indent ) const {
    564632        os << "Range Expression: ";
    565633        low->print( os, indent );
     
    591659        deleteAll( returnDecls );
    592660}
    593 void StmtExpr::print( std::ostream &os, Indenter indent ) const {
    594         os << "Statement Expression: " << std::endl << indent+1;
    595         statements->print( os, indent+1 );
     661void StmtExpr::print( std::ostream &os, int indent ) const {
     662        os << "Statement Expression: " << std::endl << std::string( indent, ' ' );
     663        statements->print( os, indent+2 );
    596664        if ( ! returnDecls.empty() ) {
    597                 os << indent+1 << "... with returnDecls: ";
    598                 printAll( returnDecls, os, indent+1 );
     665                os << std::string( indent+2, ' ' ) << "with returnDecls: ";
     666                printAll( returnDecls, os, indent+2 );
    599667        }
    600668        if ( ! dtors.empty() ) {
    601                 os << indent+1 << "... with dtors: ";
    602                 printAll( dtors, os, indent+1 );
     669                os << std::string( indent+2, ' ' ) << "with dtors: ";
     670                printAll( dtors, os, indent+2 );
    603671        }
    604672        Expression::print( os, indent );
     
    622690        delete var;
    623691}
    624 void UniqueExpr::print( std::ostream &os, Indenter indent ) const {
    625         os << "Unique Expression with id:" << id << std::endl << indent+1;
    626         expr->print( os, indent+1 );
    627         if ( object ) {
    628                 os << indent << "... with decl: ";
    629                 get_object()->printShort( os, indent+1 );
     692void UniqueExpr::print( std::ostream &os, int indent ) const {
     693        os << "Unique Expression with id:" << id << std::endl << std::string( indent+2, ' ' );
     694        get_expr()->print( os, indent+2 );
     695        if ( get_object() ) {
     696                os << std::string( indent+2, ' ' ) << "with decl: ";
     697                get_object()->printShort( os, indent+2 );
    630698        }
    631699        Expression::print( os, indent );
     
    645713}
    646714
    647 void UntypedInitExpr::print( std::ostream & os, Indenter indent ) const {
    648         os << "Untyped Init Expression" << std::endl << indent+1;
    649         expr->print( os, indent+1 );
     715void UntypedInitExpr::print( std::ostream & os, int indent ) const {
     716        os << "Untyped Init Expression" << std::endl << std::string( indent+2, ' ' );
     717        expr->print( os, indent+2 );
    650718        if ( ! initAlts.empty() ) {
    651719                for ( const InitAlternative & alt : initAlts ) {
    652                         os << indent+1 <<  "InitAlternative: ";
    653                         alt.type->print( os, indent+1 );
    654                         alt.designation->print( os, indent+1 );
     720                        os << std::string( indent+2, ' ' ) <<  "InitAlternative: ";
     721                        alt.type->print( os, indent+2 );
     722                        alt.designation->print( os, indent+2 );
    655723                }
    656724        }
     
    666734}
    667735
    668 void InitExpr::print( std::ostream & os, Indenter indent ) const {
    669         os << "Init Expression" << std::endl << indent+1;
    670         expr->print( os, indent+1 );
    671         os << indent+1 << "... with designation: ";
    672         designation->print( os, indent+1 );
     736void InitExpr::print( std::ostream & os, int indent ) const {
     737        os << "Init Expression" << std::endl << std::string( indent+2, ' ' );
     738        expr->print( os, indent+2 );
     739        os << std::string( indent+2, ' ' ) << "with designation: ";
     740        designation->print( os, indent+2 );
     741}
     742
     743
     744std::ostream & operator<<( std::ostream & out, const Expression * expr ) {
     745        if ( expr ) {
     746                expr->print( out );
     747        } else {
     748                out << "nullptr";
     749        }
     750        return out;
    673751}
    674752
  • src/SynTree/Expression.h

    r3f7e12cb r78315272  
    3131
    3232
     33/// Expression is the root type for all expressions
     34class Expression : public BaseSyntaxNode{
     35  public:
     36        Type * result;
     37        TypeSubstitution * env;
     38        Expression * argName; // if expression is used as an argument, it can be "designated" by this name
     39        bool extension = false;
     40
     41        Expression( Expression * _aname = nullptr );
     42        Expression( const Expression & other );
     43        virtual ~Expression();
     44
     45        Type *& get_result() { return result; }
     46        const Type * get_result() const { return result; }
     47        void set_result( Type * newValue ) { result = newValue; }
     48        bool has_result() const { return result != nullptr; }
     49
     50        TypeSubstitution * get_env() const { return env; }
     51        void set_env( TypeSubstitution * newValue ) { env = newValue; }
     52        Expression * get_argName() const { return argName; }
     53        void set_argName( Expression * name ) { argName = name; }
     54        bool get_extension() const { return extension; }
     55        Expression * set_extension( bool exten ) { extension = exten; return this; }
     56
     57        virtual Expression * clone() const = 0;
     58        virtual void accept( Visitor & v ) = 0;
     59        virtual Expression * acceptMutator( Mutator & m ) = 0;
     60        virtual void print( std::ostream & os, int indent = 0 ) const;
     61};
     62
    3363struct ParamEntry;
    3464
     
    4777        Type * actualType;
    4878        Type * formalType;
    49         Expression * expr;
     79        Expression* expr;
    5080        std::unique_ptr< InferredParams > inferParams;
    51 };
    52 
    53 /// Expression is the root type for all expressions
    54 class Expression : public BaseSyntaxNode {
    55   public:
    56         Type * result;
    57         TypeSubstitution * env;
    58         bool extension = false;
    59         InferredParams inferParams;
    60 
    61         Expression();
    62         Expression( const Expression & other );
    63         virtual ~Expression();
    64 
    65         Type *& get_result() { return result; }
    66         const Type * get_result() const { return result; }
    67         void set_result( Type * newValue ) { result = newValue; }
    68 
    69         TypeSubstitution * get_env() const { return env; }
    70         void set_env( TypeSubstitution * newValue ) { env = newValue; }
    71         bool get_extension() const { return extension; }
    72         Expression * set_extension( bool exten ) { extension = exten; return this; }
    73 
    74         InferredParams & get_inferParams() { return inferParams; }
    75 
    76         virtual Expression * clone() const override = 0;
    77         virtual void accept( Visitor & v ) override = 0;
    78         virtual Expression * acceptMutator( Mutator & m ) override = 0;
    79         virtual void print( std::ostream & os, Indenter indent = {} ) const override;
    8081};
    8182
     
    8687        Expression * function;
    8788        std::list<Expression *> args;
     89        InferredParams inferParams;
    8890
    8991        ApplicationExpr( Expression * function, const std::list<Expression *> & args = std::list< Expression * >() );
     
    9496        void set_function( Expression * newValue ) { function = newValue; }
    9597        std::list<Expression *>& get_args() { return args; }
     98        InferredParams & get_inferParams() { return inferParams; }
    9699
    97100        virtual ApplicationExpr * clone() const { return new ApplicationExpr( * this ); }
    98101        virtual void accept( Visitor & v ) { v.visit( this ); }
    99102        virtual Expression * acceptMutator( Mutator & m ) { return m.mutate( this ); }
    100         virtual void print( std::ostream & os, Indenter indent = {} ) const;
     103        virtual void print( std::ostream & os, int indent = 0 ) const;
    101104};
    102105
     
    109112        std::list<Expression*> args;
    110113
    111         UntypedExpr( Expression * function, const std::list<Expression *> & args = std::list< Expression * >() );
     114        UntypedExpr( Expression * function, const std::list<Expression *> & args = std::list< Expression * >(), Expression *_aname = nullptr );
    112115        UntypedExpr( const UntypedExpr & other );
    113116        virtual ~UntypedExpr();
     
    116119        void set_function( Expression * newValue ) { function = newValue; }
    117120
     121        void set_args( std::list<Expression *> & listArgs ) { args = listArgs; }
    118122        std::list<Expression*>::iterator begin_args() { return args.begin(); }
    119123        std::list<Expression*>::iterator end_args() { return args.end(); }
     
    126130        virtual void accept( Visitor & v ) { v.visit( this ); }
    127131        virtual Expression * acceptMutator( Mutator & m ) { return m.mutate( this ); }
    128         virtual void print( std::ostream & os, Indenter indent = {} ) const;
     132        virtual void print( std::ostream & os, int indent = 0 ) const;
     133        virtual void printArgs(std::ostream & os, int indent = 0) const;
    129134};
    130135
     
    134139        std::string name;
    135140
    136         NameExpr( std::string name );
     141        NameExpr( std::string name, Expression *_aname = nullptr );
    137142        NameExpr( const NameExpr & other );
    138143        virtual ~NameExpr();
     
    144149        virtual void accept( Visitor & v ) { v.visit( this ); }
    145150        virtual Expression * acceptMutator( Mutator & m ) { return m.mutate( this ); }
    146         virtual void print( std::ostream & os, Indenter indent = {} ) const;
     151        virtual void print( std::ostream & os, int indent = 0 ) const;
    147152};
    148153
     
    155160        Expression * arg;
    156161
    157         AddressExpr( Expression * arg );
     162        AddressExpr( Expression * arg, Expression *_aname = nullptr );
    158163        AddressExpr( const AddressExpr & other );
    159164        virtual ~AddressExpr();
     
    165170        virtual void accept( Visitor & v ) { v.visit( this ); }
    166171        virtual Expression * acceptMutator( Mutator & m ) { return m.mutate( this ); }
    167         virtual void print( std::ostream & os, Indenter indent = {} ) const;
     172        virtual void print( std::ostream & os, int indent = 0 ) const;
    168173};
    169174
     
    181186        virtual void accept( Visitor & v ) { v.visit( this ); }
    182187        virtual Expression * acceptMutator( Mutator & m ) { return m.mutate( this ); }
    183         virtual void print( std::ostream & os, Indenter indent = {} ) const;
     188        virtual void print( std::ostream & os, int indent = 0 ) const;
    184189};
    185190
     
    189194        Expression * arg;
    190195
    191         CastExpr( Expression * arg );
    192         CastExpr( Expression * arg, Type * toType );
     196        CastExpr( Expression * arg, Expression *_aname = nullptr );
     197        CastExpr( Expression * arg, Type * toType, Expression *_aname = nullptr );
    193198        CastExpr( const CastExpr & other );
    194199        virtual ~CastExpr();
     
    200205        virtual void accept( Visitor & v ) { v.visit( this ); }
    201206        virtual Expression * acceptMutator( Mutator & m ) { return m.mutate( this ); }
    202         virtual void print( std::ostream & os, Indenter indent = {} ) const;
     207        virtual void print( std::ostream & os, int indent = 0 ) const;
    203208};
    204209
     
    218223        virtual void accept( Visitor & v ) { v.visit( this ); }
    219224        virtual Expression * acceptMutator( Mutator & m ) { return m.mutate( this ); }
    220         virtual void print( std::ostream & os, Indenter indent = {} ) const;
     225        virtual void print( std::ostream & os, int indent = 0 ) const;
    221226};
    222227
     
    227232        Expression * aggregate;
    228233
    229         UntypedMemberExpr( Expression * member, Expression * aggregate );
     234        UntypedMemberExpr( Expression * member, Expression * aggregate, Expression *_aname = nullptr );
    230235        UntypedMemberExpr( const UntypedMemberExpr & other );
    231236        virtual ~UntypedMemberExpr();
     
    239244        virtual void accept( Visitor & v ) { v.visit( this ); }
    240245        virtual Expression * acceptMutator( Mutator & m ) { return m.mutate( this ); }
    241         virtual void print( std::ostream & os, Indenter indent = {} ) const;
     246        virtual void print( std::ostream & os, int indent = 0 ) const;
    242247};
    243248
     
    249254        Expression * aggregate;
    250255
    251         MemberExpr( DeclarationWithType * member, Expression * aggregate );
     256        MemberExpr( DeclarationWithType * member, Expression * aggregate, Expression *_aname = nullptr );
    252257        MemberExpr( const MemberExpr & other );
    253258        virtual ~MemberExpr();
     
    261266        virtual void accept( Visitor & v ) { v.visit( this ); }
    262267        virtual Expression * acceptMutator( Mutator & m ) { return m.mutate( this ); }
    263         virtual void print( std::ostream & os, Indenter indent = {} ) const;
     268        virtual void print( std::ostream & os, int indent = 0 ) const;
    264269};
    265270
     
    270275        DeclarationWithType * var;
    271276
    272         VariableExpr( DeclarationWithType * var );
     277        VariableExpr( DeclarationWithType * var, Expression *_aname = nullptr );
    273278        VariableExpr( const VariableExpr & other );
    274279        virtual ~VariableExpr();
     
    282287        virtual void accept( Visitor & v ) { v.visit( this ); }
    283288        virtual Expression * acceptMutator( Mutator & m ) { return m.mutate( this ); }
    284         virtual void print( std::ostream & os, Indenter indent = {} ) const;
     289        virtual void print( std::ostream & os, int indent = 0 ) const;
    285290};
    286291
     
    290295        Constant constant;
    291296
    292         ConstantExpr( Constant constant );
     297        ConstantExpr( Constant constant, Expression *_aname = nullptr );
    293298        ConstantExpr( const ConstantExpr & other );
    294299        virtual ~ConstantExpr();
     
    300305        virtual void accept( Visitor & v ) { v.visit( this ); }
    301306        virtual Expression * acceptMutator( Mutator & m ) { return m.mutate( this ); }
    302         virtual void print( std::ostream & os, Indenter indent = {} ) const;
     307        virtual void print( std::ostream & os, int indent = 0 ) const;
    303308};
    304309
     
    310315        bool isType;
    311316
    312         SizeofExpr( Expression * expr );
     317        SizeofExpr( Expression * expr, Expression *_aname = nullptr );
    313318        SizeofExpr( const SizeofExpr & other );
    314         SizeofExpr( Type * type );
     319        SizeofExpr( Type * type, Expression *_aname = nullptr );
    315320        virtual ~SizeofExpr();
    316321
     
    325330        virtual void accept( Visitor & v ) { v.visit( this ); }
    326331        virtual Expression * acceptMutator( Mutator & m ) { return m.mutate( this ); }
    327         virtual void print( std::ostream & os, Indenter indent = {} ) const;
     332        virtual void print( std::ostream & os, int indent = 0 ) const;
    328333};
    329334
     
    335340        bool isType;
    336341
    337         AlignofExpr( Expression * expr );
     342        AlignofExpr( Expression * expr, Expression *_aname = nullptr );
    338343        AlignofExpr( const AlignofExpr & other );
    339         AlignofExpr( Type * type );
     344        AlignofExpr( Type * type, Expression *_aname = nullptr );
    340345        virtual ~AlignofExpr();
    341346
     
    350355        virtual void accept( Visitor & v ) { v.visit( this ); }
    351356        virtual Expression * acceptMutator( Mutator & m ) { return m.mutate( this ); }
    352         virtual void print( std::ostream & os, Indenter indent = {} ) const;
     357        virtual void print( std::ostream & os, int indent = 0 ) const;
    353358};
    354359
     
    359364        std::string member;
    360365
    361         UntypedOffsetofExpr( Type * type, const std::string & member );
     366        UntypedOffsetofExpr( Type * type, const std::string & member, Expression *_aname = nullptr );
    362367        UntypedOffsetofExpr( const UntypedOffsetofExpr & other );
    363368        virtual ~UntypedOffsetofExpr();
     
    371376        virtual void accept( Visitor & v ) { v.visit( this ); }
    372377        virtual Expression * acceptMutator( Mutator & m ) { return m.mutate( this ); }
    373         virtual void print( std::ostream & os, Indenter indent = {} ) const;
     378        virtual void print( std::ostream & os, int indent = 0 ) const;
    374379};
    375380
     
    380385        DeclarationWithType * member;
    381386
    382         OffsetofExpr( Type * type, DeclarationWithType * member );
     387        OffsetofExpr( Type * type, DeclarationWithType * member, Expression *_aname = nullptr );
    383388        OffsetofExpr( const OffsetofExpr & other );
    384389        virtual ~OffsetofExpr();
     
    392397        virtual void accept( Visitor & v ) { v.visit( this ); }
    393398        virtual Expression * acceptMutator( Mutator & m ) { return m.mutate( this ); }
    394         virtual void print( std::ostream & os, Indenter indent = {} ) const;
     399        virtual void print( std::ostream & os, int indent = 0 ) const;
    395400};
    396401
     
    400405        StructInstType * type;
    401406
    402         OffsetPackExpr( StructInstType * type );
     407        OffsetPackExpr( StructInstType * type_, Expression * aname_ = 0 );
    403408        OffsetPackExpr( const OffsetPackExpr & other );
    404409        virtual ~OffsetPackExpr();
     
    410415        virtual void accept( Visitor & v ) { v.visit( this ); }
    411416        virtual Expression * acceptMutator( Mutator & m ) { return m.mutate( this ); }
    412         virtual void print( std::ostream & os, Indenter indent = {} ) const;
     417        virtual void print( std::ostream & os, int indent = 0 ) const;
    413418};
    414419
     
    421426        bool isType;
    422427
    423         AttrExpr(Expression * attr, Expression * expr );
     428        AttrExpr(Expression * attr, Expression * expr, Expression *_aname = nullptr );
    424429        AttrExpr( const AttrExpr & other );
    425         AttrExpr( Expression * attr, Type * type );
     430        AttrExpr( Expression * attr, Type * type, Expression *_aname = nullptr );
    426431        virtual ~AttrExpr();
    427432
     
    438443        virtual void accept( Visitor & v ) { v.visit( this ); }
    439444        virtual Expression * acceptMutator( Mutator & m ) { return m.mutate( this ); }
    440         virtual void print( std::ostream & os, Indenter indent = {} ) const;
     445        virtual void print( std::ostream & os, int indent = 0 ) const;
    441446};
    442447
     
    447452        Expression * arg2;
    448453
    449         LogicalExpr( Expression * arg1, Expression * arg2, bool andp = true );
     454        LogicalExpr( Expression * arg1, Expression * arg2, bool andp = true, Expression *_aname = nullptr );
    450455        LogicalExpr( const LogicalExpr & other );
    451456        virtual ~LogicalExpr();
     
    460465        virtual void accept( Visitor & v ) { v.visit( this ); }
    461466        virtual Expression * acceptMutator( Mutator & m ) { return m.mutate( this ); }
    462         virtual void print( std::ostream & os, Indenter indent = {} ) const;
     467        virtual void print( std::ostream & os, int indent = 0 ) const;
    463468
    464469  private:
     
    473478        Expression * arg3;
    474479
    475         ConditionalExpr( Expression * arg1, Expression * arg2, Expression * arg3 );
     480        ConditionalExpr( Expression * arg1, Expression * arg2, Expression * arg3, Expression *_aname = nullptr );
    476481        ConditionalExpr( const ConditionalExpr & other );
    477482        virtual ~ConditionalExpr();
     
    487492        virtual void accept( Visitor & v ) { v.visit( this ); }
    488493        virtual Expression * acceptMutator( Mutator & m ) { return m.mutate( this ); }
    489         virtual void print( std::ostream & os, Indenter indent = {} ) const;
     494        virtual void print( std::ostream & os, int indent = 0 ) const;
    490495};
    491496
     
    496501        Expression * arg2;
    497502
    498         CommaExpr( Expression * arg1, Expression * arg2 );
     503        CommaExpr( Expression * arg1, Expression * arg2, Expression *_aname = nullptr );
    499504        CommaExpr( const CommaExpr & other );
    500505        virtual ~CommaExpr();
     
    508513        virtual void accept( Visitor & v ) { v.visit( this ); }
    509514        virtual Expression * acceptMutator( Mutator & m ) { return m.mutate( this ); }
    510         virtual void print( std::ostream & os, Indenter indent = {} ) const;
     515        virtual void print( std::ostream & os, int indent = 0 ) const;
    511516};
    512517
     
    526531        virtual void accept( Visitor & v ) { v.visit( this ); }
    527532        virtual Expression * acceptMutator( Mutator & m ) { return m.mutate( this ); }
    528         virtual void print( std::ostream & os, Indenter indent = {} ) const;
     533        virtual void print( std::ostream & os, int indent = 0 ) const;
    529534};
    530535
     
    552557        virtual void accept( Visitor & v ) { v.visit( this ); }
    553558        virtual Expression * acceptMutator( Mutator & m ) { return m.mutate( this ); }
    554         virtual void print( std::ostream & os, Indenter indent = {} ) const;
     559        virtual void print( std::ostream & os, int indent = 0 ) const;
    555560
    556561        // https://gcc.gnu.org/onlinedocs/gcc-4.7.1/gcc/Machine-Constraints.html#Machine-Constraints
     
    580585        virtual void accept( Visitor & v ) { v.visit( this ); }
    581586        virtual Expression * acceptMutator( Mutator & m ) { return m.mutate( this ); }
    582         virtual void print( std::ostream & os, Indenter indent = {} ) const;
     587        virtual void print( std::ostream & os, int indent = 0 ) const;
    583588};
    584589
     
    598603        virtual void accept( Visitor & v ) { v.visit( this ); }
    599604        virtual Expression * acceptMutator( Mutator & m ) { return m.mutate( this ); }
    600         virtual void print( std::ostream & os, Indenter indent = {} ) const;
     605        virtual void print( std::ostream & os, int indent = 0 ) const;
    601606};
    602607
     
    616621        virtual void accept( Visitor & v ) { v.visit( this ); }
    617622        virtual Expression * acceptMutator( Mutator & m ) { return m.mutate( this ); }
    618         virtual void print( std::ostream & os, Indenter indent = {} ) const;
     623        virtual void print( std::ostream & os, int indent = 0 ) const;
    619624};
    620625
     
    635640        virtual void accept( Visitor & v ) { v.visit( this ); }
    636641        virtual Expression * acceptMutator( Mutator & m ) { return m.mutate( this ); }
    637         virtual void print( std::ostream & os, Indenter indent = {} ) const;
     642        virtual void print( std::ostream & os, int indent = 0 ) const;
    638643};
    639644
     
    643648        std::list<Expression*> exprs;
    644649
    645         UntypedTupleExpr( const std::list< Expression * > & exprs );
     650        UntypedTupleExpr( const std::list< Expression * > & exprs, Expression *_aname = nullptr );
    646651        UntypedTupleExpr( const UntypedTupleExpr & other );
    647652        virtual ~UntypedTupleExpr();
     
    652657        virtual void accept( Visitor & v ) { v.visit( this ); }
    653658        virtual Expression * acceptMutator( Mutator & m ) { return m.mutate( this ); }
    654         virtual void print( std::ostream & os, Indenter indent = {} ) const;
     659        virtual void print( std::ostream & os, int indent = 0 ) const;
    655660};
    656661
     
    660665        std::list<Expression*> exprs;
    661666
    662         TupleExpr( const std::list< Expression * > & exprs );
     667        TupleExpr( const std::list< Expression * > & exprs, Expression *_aname = nullptr );
    663668        TupleExpr( const TupleExpr & other );
    664669        virtual ~TupleExpr();
     
    669674        virtual void accept( Visitor & v ) { v.visit( this ); }
    670675        virtual Expression * acceptMutator( Mutator & m ) { return m.mutate( this ); }
    671         virtual void print( std::ostream & os, Indenter indent = {} ) const;
     676        virtual void print( std::ostream & os, int indent = 0 ) const;
    672677};
    673678
     
    690695        virtual void accept( Visitor & v ) { v.visit( this ); }
    691696        virtual Expression * acceptMutator( Mutator & m ) { return m.mutate( this ); }
    692         virtual void print( std::ostream & os, Indenter indent = {} ) const;
     697        virtual void print( std::ostream & os, int indent = 0 ) const;
    693698};
    694699
     
    698703        StmtExpr * stmtExpr = nullptr;
    699704
    700         TupleAssignExpr( const std::list< Expression * > & assigns, const std::list< ObjectDecl * > & tempDecls );
     705        TupleAssignExpr( const std::list< Expression * > & assigns, const std::list< ObjectDecl * > & tempDecls, Expression * _aname = nullptr );
    701706        TupleAssignExpr( const TupleAssignExpr & other );
    702707        virtual ~TupleAssignExpr();
     
    708713        virtual void accept( Visitor & v ) { v.visit( this ); }
    709714        virtual Expression * acceptMutator( Mutator & m ) { return m.mutate( this ); }
    710         virtual void print( std::ostream & os, Indenter indent = {} ) const;
     715        virtual void print( std::ostream & os, int indent = 0 ) const;
    711716};
    712717
     
    731736        virtual void accept( Visitor & v ) { v.visit( this ); }
    732737        virtual Expression * acceptMutator( Mutator & m ) { return m.mutate( this ); }
    733         virtual void print( std::ostream & os, Indenter indent = {} ) const;
     738        virtual void print( std::ostream & os, int indent = 0 ) const;
    734739};
    735740
     
    758763        virtual void accept( Visitor & v ) { v.visit( this ); }
    759764        virtual Expression * acceptMutator( Mutator & m ) { return m.mutate( this ); }
    760         virtual void print( std::ostream & os, Indenter indent = {} ) const;
     765        virtual void print( std::ostream & os, int indent = 0 ) const;
    761766
    762767private:
     
    792797        virtual void accept( Visitor & v ) { v.visit( this ); }
    793798        virtual Expression * acceptMutator( Mutator & m ) { return m.mutate( this ); }
    794         virtual void print( std::ostream & os, Indenter indent = {} ) const;
     799        virtual void print( std::ostream & os, int indent = 0 ) const;
    795800};
    796801
     
    813818        virtual void accept( Visitor & v ) { v.visit( this ); }
    814819        virtual Expression * acceptMutator( Mutator & m ) { return m.mutate( this ); }
    815         virtual void print( std::ostream & os, Indenter indent = {} ) const;
    816 };
     820        virtual void print( std::ostream & os, int indent = 0 ) const;
     821};
     822
     823
     824std::ostream & operator<<( std::ostream & out, const Expression * expr );
    817825
    818826// Local Variables: //
  • src/SynTree/FunctionDecl.cc

    r3f7e12cb r78315272  
    2626#include "Statement.h"           // for CompoundStmt
    2727#include "Type.h"                // for Type, FunctionType, Type::FuncSpecif...
    28 #include "VarExprReplacer.h"
    2928
    3029extern bool translation_unit_nomain;
     
    4039FunctionDecl::FunctionDecl( const FunctionDecl &other )
    4140                : Parent( other ), type( maybeClone( other.type ) ), statements( maybeClone( other.statements ) ) {
    42 
    43         VarExprReplacer::DeclMap declMap;
    44         for ( auto p : group_iterate( other.type->parameters, type->parameters ) ) {
    45                 declMap[ std::get<0>(p) ] = std::get<1>(p);
    46         }
    47         for ( auto p : group_iterate( other.type->returnVals, type->returnVals ) ) {
    48                 declMap[ std::get<0>(p) ] = std::get<1>(p);
    49         }
    50         if ( ! declMap.empty() ) {
    51                 VarExprReplacer replacer( declMap );
    52                 accept( replacer );
    53         }
    5441}
    5542
     
    5946}
    6047
    61 FunctionDecl * FunctionDecl::newFunction( const std::string & name, FunctionType * type, CompoundStmt * statements ) {
    62         return new FunctionDecl( name, Type::StorageClasses(), LinkageSpec::C, type, statements );
    63 }
    64 
    65 void FunctionDecl::print( std::ostream &os, Indenter indent ) const {
     48void FunctionDecl::print( std::ostream &os, int indent ) const {
    6649        using std::endl;
    6750        using std::string;
    6851
    69         if ( name != "" ) {
    70                 os << name << ": ";
     52        if ( get_name() != "" ) {
     53                os << get_name() << ": ";
    7154        } // if
    72         if ( linkage != LinkageSpec::Cforall ) {
    73                 os << LinkageSpec::linkageName( linkage ) << " ";
     55        if ( get_linkage() != LinkageSpec::Cforall ) {
     56                os << LinkageSpec::linkageName( get_linkage() ) << " ";
    7457        } // if
    7558
    76         printAll( attributes, os, indent );
     59        printAll( get_attributes(), os, indent );
    7760
    7861        get_storageClasses().print( os );
    7962        get_funcSpec().print( os );
    8063
    81         if ( type ) {
    82                 type->print( os, indent );
     64        if ( get_type() ) {
     65                get_type()->print( os, indent );
    8366        } else {
    8467                os << "untyped entity ";
     
    8669
    8770        if ( statements ) {
    88                 os << indent << "... with body " << endl << indent+1;
    89                 statements->print( os, indent+1 );
     71                os << string( indent + 2, ' ' ) << "with body " << endl;
     72                os << string( indent + 4, ' ' );
     73                statements->print( os, indent + 4 );
    9074        } // if
    9175}
    9276
    93 void FunctionDecl::printShort( std::ostream &os, Indenter indent ) const {
     77void FunctionDecl::printShort( std::ostream &os, int indent ) const {
    9478        using std::endl;
    9579        using std::string;
    9680
    97         if ( name != "" ) {
    98                 os << name << ": ";
     81        if ( get_name() != "" ) {
     82                os << get_name() << ": ";
    9983        } // if
     84
     85        // xxx - should printShort print attributes?
    10086
    10187        get_storageClasses().print( os );
    10288        get_funcSpec().print( os );
    10389
    104         if ( type ) {
    105                 type->print( os, indent );
     90        if ( get_type() ) {
     91                get_type()->print( os, indent );
    10692        } else {
    10793                os << "untyped entity ";
  • src/SynTree/FunctionType.cc

    r3f7e12cb r78315272  
    5151}
    5252
    53 void FunctionType::print( std::ostream &os, Indenter indent ) const {
     53void FunctionType::print( std::ostream &os, int indent ) const {
    5454        using std::string;
    5555        using std::endl;
     
    5858        os << "function" << endl;
    5959        if ( ! parameters.empty() ) {
    60                 os << indent << "... with parameters" << endl;
    61                 printAll( parameters, os, indent+1 );
     60                os << string( indent + 2, ' ' ) << "with parameters" << endl;
     61                printAll( parameters, os, indent + 4 );
    6262                if ( isVarArgs ) {
    63                         os << indent+1 << "and a variable number of other arguments" << endl;
     63                        os << string( indent + 4, ' ' ) << "and a variable number of other arguments" << endl;
    6464                } // if
    6565        } else if ( isVarArgs ) {
    66                 os << indent+1 << "accepting unspecified arguments" << endl;
     66                os << string( indent + 4, ' ' ) << "accepting unspecified arguments" << endl;
    6767        } // if
    68         os << indent << "... returning ";
     68        os << string( indent + 2, ' ' ) << "returning ";
    6969        if ( returnVals.empty() ) {
    70                 os << "nothing " << endl;
     70                os << endl << string( indent + 4, ' ' ) << "nothing " << endl;
    7171        } else {
    7272                os << endl;
    73                 printAll( returnVals, os, indent+1 );
     73                printAll( returnVals, os, indent + 4 );
    7474        } // if
    7575}
  • src/SynTree/Initializer.cc

    r3f7e12cb r78315272  
    3838}
    3939
    40 void Designation::print( std::ostream &os, Indenter indent ) const {
     40void Designation::print( std::ostream &os, int indent ) const {
    4141        if ( ! designators.empty() ) {
    42                 os << "... designated by: " << std::endl;
    43                 for ( const Expression * d : designators ) {
    44                         os << indent+1;
    45                         d->print(os, indent+1 );
    46                         os << std::endl;
     42                os << std::string(indent + 2, ' ' ) << "designated by: " << std::endl;
     43                for ( std::list < Expression * >::const_iterator i = designators.begin(); i != designators.end(); i++ ) {
     44                        os << std::string(indent + 4, ' ' );
     45                        ( *i )->print(os, indent + 4 );
    4746                }
     47                os << std::endl;
    4848        } // if
    4949}
     
    6464}
    6565
    66 void SingleInit::print( std::ostream &os, Indenter indent ) const {
    67         os << "Simple Initializer: ";
    68         value->print( os, indent );
     66void SingleInit::print( std::ostream &os, int indent ) const {
     67        os << std::string(indent, ' ' ) << "Simple Initializer: " << std::endl;
     68        os << std::string(indent+4, ' ' );
     69        value->print( os, indent+4 );
    6970}
    7071
     
    9293}
    9394
    94 void ListInit::print( std::ostream &os, Indenter indent ) const {
    95         os << "Compound initializer: " << std::endl;
    96         for ( auto p : group_iterate( designations, initializers ) ) {
    97                 const Designation * d = std::get<0>(p);
    98                 const Initializer * init = std::get<1>(p);
    99                 os << indent+1;
    100                 init->print( os, indent+1 );
     95void ListInit::print( std::ostream &os, int indent ) const {
     96        os << std::string(indent, ' ') << "Compound initializer:  " << std::endl;
     97        for ( Designation * d : designations ) {
     98                d->print( os, indent + 2 );
     99        }
     100
     101        for ( const Initializer * init : initializers ) {
     102                init->print( os, indent + 2 );
    101103                os << std::endl;
    102                 if ( ! d->designators.empty() ) {
    103                         os << indent+1;
    104                         d->print( os, indent+1 );
    105                 }
    106104        }
    107105}
     
    118116}
    119117
    120 void ConstructorInit::print( std::ostream &os, Indenter indent ) const {
    121         os << "Constructor initializer: " << std::endl;
     118void ConstructorInit::print( std::ostream &os, int indent ) const {
     119        os << std::endl << std::string(indent, ' ') << "Constructor initializer: " << std::endl;
    122120        if ( ctor ) {
    123                 os << indent << "... initially constructed with ";
    124                 ctor->print( os, indent+1 );
     121                os << std::string(indent+2, ' ');
     122                os << "initially constructed with ";
     123                ctor->print( os, indent+4 );
    125124        } // if
    126125
    127126        if ( dtor ) {
    128                 os << indent << "... destructed with ";
    129                 dtor->print( os, indent+1 );
     127                os << std::string(indent+2, ' ');
     128                os << "destructed with ";
     129                dtor->print( os, indent+4 );
    130130        }
    131131
    132132        if ( init ) {
    133                 os << indent << "... with fallback C-style initializer: ";
    134                 init->print( os, indent+1 );
     133                os << std::string(indent+2, ' ');
     134                os << "with fallback C-style initializer: ";
     135                init->print( os, indent+4 );
    135136        }
     137}
     138
     139std::ostream & operator<<( std::ostream & out, const Initializer * init ) {
     140        if ( init ) {
     141                init->print( out );
     142        } else {
     143                out << "nullptr";
     144        }
     145        return out;
     146}
     147
     148std::ostream & operator<<( std::ostream & out, const Designation * des ) {
     149        if ( des ) {
     150                des->print( out );
     151        } else {
     152                out << "nullptr";
     153        }
     154        return out;
    136155}
    137156
  • src/SynTree/Initializer.h

    r3f7e12cb r78315272  
    3737        std::list< Expression * > & get_designators() { return designators; }
    3838
    39         virtual Designation * clone() const override { return new Designation( *this ); };
    40         virtual void accept( Visitor &v ) override { v.visit( this ); }
    41         virtual Designation * acceptMutator( Mutator &m ) override { return m.mutate( this ); }
    42         virtual void print( std::ostream &os, Indenter indent = {} ) const override;
     39        virtual Designation * clone() const { return new Designation( *this ); };
     40        virtual void accept( Visitor &v ) { v.visit( this ); }
     41        virtual Designation * acceptMutator( Mutator &m ) { return m.mutate( this ); }
     42        virtual void print( std::ostream &os, int indent = 0 ) const;
    4343};
    4444
     
    5454        bool get_maybeConstructed() { return maybeConstructed; }
    5555
    56         virtual Initializer *clone() const override = 0;
    57         virtual void accept( Visitor &v ) override = 0;
    58         virtual Initializer *acceptMutator( Mutator &m ) override = 0;
    59         virtual void print( std::ostream &os, Indenter indent = {} ) const override = 0;
     56        virtual Initializer *clone() const = 0;
     57        virtual void accept( Visitor &v ) = 0;
     58        virtual Initializer *acceptMutator( Mutator &m ) = 0;
     59        virtual void print( std::ostream &os, int indent = 0 ) const = 0;
    6060  private:
    6161        bool maybeConstructed;
     
    7575        void set_value( Expression *newValue ) { value = newValue; }
    7676
    77         virtual SingleInit *clone() const override { return new SingleInit( *this); }
    78         virtual void accept( Visitor &v ) override { v.visit( this ); }
    79         virtual Initializer *acceptMutator( Mutator &m )  override { return m.mutate( this ); }
    80         virtual void print( std::ostream &os, Indenter indent = {} ) const override;
     77        virtual SingleInit *clone() const { return new SingleInit( *this); }
     78        virtual void accept( Visitor &v ) { v.visit( this ); }
     79        virtual Initializer *acceptMutator( Mutator &m ) { return m.mutate( this ); }
     80        virtual void print( std::ostream &os, int indent = 0 ) const;
    8181};
    8282
     
    103103        const_iterator end() const { return initializers.end(); }
    104104
    105         virtual ListInit *clone() const override { return new ListInit( *this ); }
    106         virtual void accept( Visitor &v ) override { v.visit( this ); }
    107         virtual Initializer *acceptMutator( Mutator &m )  override { return m.mutate( this ); }
    108         virtual void print( std::ostream &os, Indenter indent = {} ) const override;
     105        virtual ListInit *clone() const { return new ListInit( *this ); }
     106        virtual void accept( Visitor &v ) { v.visit( this ); }
     107        virtual Initializer *acceptMutator( Mutator &m ) { return m.mutate( this ); }
     108        virtual void print( std::ostream &os, int indent = 0 ) const;
    109109};
    110110
     
    117117        Statement * ctor;
    118118        Statement * dtor;
    119         // C-style initializer made up of SingleInit and ListInit nodes to use as a fallback
    120         // if an appropriate constructor definition is not found by the resolver
    121         Initializer * init;
    122119
    123120        ConstructorInit( Statement * ctor, Statement * dtor, Initializer * init );
     
    132129        Initializer * get_init() const { return init; }
    133130
    134         ConstructorInit *clone() const override { return new ConstructorInit( *this ); }
    135         virtual void accept( Visitor &v ) override { v.visit( this ); }
    136         virtual Initializer *acceptMutator( Mutator &m )  override { return m.mutate( this ); }
    137         virtual void print( std::ostream &os, Indenter indent = {} ) const override;
     131        ConstructorInit *clone() const { return new ConstructorInit( *this ); }
     132        virtual void accept( Visitor &v ) { v.visit( this ); }
     133        virtual Initializer *acceptMutator( Mutator &m ) { return m.mutate( this ); }
     134        virtual void print( std::ostream &os, int indent = 0 ) const;
    138135
    139136  private:
     137        // C-style initializer made up of SingleInit and ListInit nodes to use as a fallback
     138        // if an appropriate constructor definition is not found by the resolver
     139        Initializer * init;
    140140};
     141
     142std::ostream & operator<<( std::ostream & out, const Initializer * init );
     143std::ostream & operator<<( std::ostream & out, const Designation * des );
    141144
    142145// Local Variables: //
  • src/SynTree/Mutator.cc

    r3f7e12cb r78315272  
    1717#include <list>                // for list
    1818
    19 #include "Attribute.h"         // for Attribute
    2019#include "Declaration.h"       // for ObjectDecl, Declaration, DeclarationWi...
    2120#include "Expression.h"        // for Expression, ConstantExpr, ConditionalExpr
     
    3736        objectDecl->set_init( maybeMutate( objectDecl->get_init(), *this ) );
    3837        objectDecl->set_bitfieldWidth( maybeMutate( objectDecl->get_bitfieldWidth(), *this ) );
    39         mutateAll( objectDecl->attributes, *this );
    4038        return objectDecl;
    4139}
     
    4442        functionDecl->set_functionType( maybeMutate( functionDecl->get_functionType(), *this ) );
    4543        functionDecl->set_statements( maybeMutate( functionDecl->get_statements(), *this ) );
    46         mutateAll( functionDecl->attributes, *this );
    4744        return functionDecl;
    4845}
     
    621618}
    622619
    623 Attribute * Mutator::mutate( Attribute * attribute ) {
    624         mutateAll( attribute->parameters, *this );
    625         return attribute;
    626 }
    627 
    628 TypeSubstitution * Mutator::mutate( TypeSubstitution * sub ) {
    629         for ( auto & p : sub->typeEnv ) {
    630                 p.second = maybeMutate( p.second, *this );
    631         }
    632         for ( auto & p : sub->varEnv ) {
    633                 p.second = maybeMutate( p.second, *this );
    634         }
    635         return sub;
    636 }
    637 
    638620// Local Variables: //
    639621// tab-width: 4 //
  • src/SynTree/Mutator.h

    r3f7e12cb r78315272  
    2525        virtual ~Mutator();
    2626  public:
    27         virtual DeclarationWithType * mutate( ObjectDecl * objectDecl );
    28         virtual DeclarationWithType * mutate( FunctionDecl * functionDecl );
    29         virtual Declaration * mutate( StructDecl * aggregateDecl );
    30         virtual Declaration * mutate( UnionDecl * aggregateDecl );
    31         virtual Declaration * mutate( EnumDecl * aggregateDecl );
    32         virtual Declaration * mutate( TraitDecl * aggregateDecl );
    33         virtual Declaration * mutate( TypeDecl * typeDecl );
    34         virtual Declaration * mutate( TypedefDecl * typeDecl );
    35         virtual AsmDecl * mutate( AsmDecl * asmDecl );
     27        virtual DeclarationWithType* mutate( ObjectDecl *objectDecl );
     28        virtual DeclarationWithType* mutate( FunctionDecl *functionDecl );
     29        virtual Declaration* mutate( StructDecl *aggregateDecl );
     30        virtual Declaration* mutate( UnionDecl *aggregateDecl );
     31        virtual Declaration* mutate( EnumDecl *aggregateDecl );
     32        virtual Declaration* mutate( TraitDecl *aggregateDecl );
     33        virtual Declaration* mutate( TypeDecl *typeDecl );
     34        virtual Declaration* mutate( TypedefDecl *typeDecl );
     35        virtual AsmDecl* mutate( AsmDecl *asmDecl );
    3636
    37         virtual CompoundStmt * mutate( CompoundStmt * compoundStmt );
    38         virtual Statement * mutate( ExprStmt * exprStmt );
    39         virtual Statement * mutate( AsmStmt * asmStmt );
    40         virtual Statement * mutate( IfStmt * ifStmt );
    41         virtual Statement * mutate( WhileStmt * whileStmt );
    42         virtual Statement * mutate( ForStmt * forStmt );
    43         virtual Statement * mutate( SwitchStmt * switchStmt );
    44         virtual Statement * mutate( CaseStmt * caseStmt );
    45         virtual Statement * mutate( BranchStmt * branchStmt );
    46         virtual Statement * mutate( ReturnStmt * returnStmt );
    47         virtual Statement * mutate( ThrowStmt * throwStmt );
    48         virtual Statement * mutate( TryStmt * tryStmt );
    49         virtual Statement * mutate( CatchStmt * catchStmt );
    50         virtual Statement * mutate( FinallyStmt * catchStmt );
    51         virtual Statement * mutate( WaitForStmt * waitforStmt );
    52         virtual NullStmt * mutate( NullStmt * nullStmt );
    53         virtual Statement * mutate( DeclStmt * declStmt );
    54         virtual Statement * mutate( ImplicitCtorDtorStmt * impCtorDtorStmt );
     37        virtual CompoundStmt* mutate( CompoundStmt *compoundStmt );
     38        virtual Statement* mutate( ExprStmt *exprStmt );
     39        virtual Statement* mutate( AsmStmt *asmStmt );
     40        virtual Statement* mutate( IfStmt *ifStmt );
     41        virtual Statement* mutate( WhileStmt *whileStmt );
     42        virtual Statement* mutate( ForStmt *forStmt );
     43        virtual Statement* mutate( SwitchStmt *switchStmt );
     44        virtual Statement* mutate( CaseStmt *caseStmt );
     45        virtual Statement* mutate( BranchStmt *branchStmt );
     46        virtual Statement* mutate( ReturnStmt *returnStmt );
     47        virtual Statement* mutate( ThrowStmt *throwStmt );
     48        virtual Statement* mutate( TryStmt *tryStmt );
     49        virtual Statement* mutate( CatchStmt *catchStmt );
     50        virtual Statement* mutate( FinallyStmt *catchStmt );
     51        virtual Statement* mutate( WaitForStmt *waitforStmt );
     52        virtual NullStmt* mutate( NullStmt *nullStmt );
     53        virtual Statement* mutate( DeclStmt *declStmt );
     54        virtual Statement* mutate( ImplicitCtorDtorStmt *impCtorDtorStmt );
    5555
    56         virtual Expression* mutate( ApplicationExpr * applicationExpr );
    57         virtual Expression* mutate( UntypedExpr * untypedExpr );
    58         virtual Expression* mutate( NameExpr * nameExpr );
    59         virtual Expression* mutate( AddressExpr * castExpr );
    60         virtual Expression* mutate( LabelAddressExpr * labAddressExpr );
    61         virtual Expression* mutate( CastExpr * castExpr );
    62         virtual Expression* mutate( VirtualCastExpr * castExpr );
    63         virtual Expression* mutate( UntypedMemberExpr * memberExpr );
    64         virtual Expression* mutate( MemberExpr * memberExpr );
    65         virtual Expression* mutate( VariableExpr * variableExpr );
    66         virtual Expression* mutate( ConstantExpr * constantExpr );
    67         virtual Expression* mutate( SizeofExpr * sizeofExpr );
    68         virtual Expression* mutate( AlignofExpr * alignofExpr );
    69         virtual Expression* mutate( UntypedOffsetofExpr * offsetofExpr );
    70         virtual Expression* mutate( OffsetofExpr * offsetofExpr );
    71         virtual Expression* mutate( OffsetPackExpr * offsetPackExpr );
    72         virtual Expression* mutate( AttrExpr * attrExpr );
    73         virtual Expression* mutate( LogicalExpr * logicalExpr );
    74         virtual Expression* mutate( ConditionalExpr * conditionalExpr );
    75         virtual Expression* mutate( CommaExpr * commaExpr );
    76         virtual Expression* mutate( TypeExpr * typeExpr );
    77         virtual Expression* mutate( AsmExpr * asmExpr );
    78         virtual Expression* mutate( ImplicitCopyCtorExpr * impCpCtorExpr );
    79         virtual Expression* mutate( ConstructorExpr * ctorExpr );
    80         virtual Expression* mutate( CompoundLiteralExpr * compLitExpr );
    81         virtual Expression* mutate( RangeExpr * rangeExpr );
    82         virtual Expression* mutate( UntypedTupleExpr * tupleExpr );
    83         virtual Expression* mutate( TupleExpr * tupleExpr );
    84         virtual Expression* mutate( TupleIndexExpr * tupleExpr );
    85         virtual Expression* mutate( TupleAssignExpr * assignExpr );
    86         virtual Expression* mutate( StmtExpr  * stmtExpr );
    87         virtual Expression* mutate( UniqueExpr  * uniqueExpr );
    88         virtual Expression* mutate( UntypedInitExpr  * initExpr );
    89         virtual Expression* mutate( InitExpr  * initExpr );
     56        virtual Expression* mutate( ApplicationExpr *applicationExpr );
     57        virtual Expression* mutate( UntypedExpr *untypedExpr );
     58        virtual Expression* mutate( NameExpr *nameExpr );
     59        virtual Expression* mutate( AddressExpr *castExpr );
     60        virtual Expression* mutate( LabelAddressExpr *labAddressExpr );
     61        virtual Expression* mutate( CastExpr *castExpr );
     62        virtual Expression* mutate( VirtualCastExpr *castExpr );
     63        virtual Expression* mutate( UntypedMemberExpr *memberExpr );
     64        virtual Expression* mutate( MemberExpr *memberExpr );
     65        virtual Expression* mutate( VariableExpr *variableExpr );
     66        virtual Expression* mutate( ConstantExpr *constantExpr );
     67        virtual Expression* mutate( SizeofExpr *sizeofExpr );
     68        virtual Expression* mutate( AlignofExpr *alignofExpr );
     69        virtual Expression* mutate( UntypedOffsetofExpr *offsetofExpr );
     70        virtual Expression* mutate( OffsetofExpr *offsetofExpr );
     71        virtual Expression* mutate( OffsetPackExpr *offsetPackExpr );
     72        virtual Expression* mutate( AttrExpr *attrExpr );
     73        virtual Expression* mutate( LogicalExpr *logicalExpr );
     74        virtual Expression* mutate( ConditionalExpr *conditionalExpr );
     75        virtual Expression* mutate( CommaExpr *commaExpr );
     76        virtual Expression* mutate( TypeExpr *typeExpr );
     77        virtual Expression* mutate( AsmExpr *asmExpr );
     78        virtual Expression* mutate( ImplicitCopyCtorExpr *impCpCtorExpr );
     79        virtual Expression* mutate( ConstructorExpr *ctorExpr );
     80        virtual Expression* mutate( CompoundLiteralExpr *compLitExpr );
     81        virtual Expression* mutate( RangeExpr *rangeExpr );
     82        virtual Expression* mutate( UntypedTupleExpr *tupleExpr );
     83        virtual Expression* mutate( TupleExpr *tupleExpr );
     84        virtual Expression* mutate( TupleIndexExpr *tupleExpr );
     85        virtual Expression* mutate( TupleAssignExpr *assignExpr );
     86        virtual Expression* mutate( StmtExpr * stmtExpr );
     87        virtual Expression* mutate( UniqueExpr * uniqueExpr );
     88        virtual Expression* mutate( UntypedInitExpr * initExpr );
     89        virtual Expression* mutate( InitExpr * initExpr );
    9090
    91         virtual Type * mutate( VoidType * basicType );
    92         virtual Type * mutate( BasicType * basicType );
    93         virtual Type * mutate( PointerType * pointerType );
    94         virtual Type * mutate( ArrayType * arrayType );
    95         virtual Type * mutate( ReferenceType * refType );
    96         virtual Type * mutate( FunctionType * functionType );
    97         virtual Type * mutate( StructInstType * aggregateUseType );
    98         virtual Type * mutate( UnionInstType * aggregateUseType );
    99         virtual Type * mutate( EnumInstType * aggregateUseType );
    100         virtual Type * mutate( TraitInstType * aggregateUseType );
    101         virtual Type * mutate( TypeInstType * aggregateUseType );
    102         virtual Type * mutate( TupleType * tupleType );
    103         virtual Type * mutate( TypeofType * typeofType );
    104         virtual Type * mutate( AttrType * attrType );
    105         virtual Type * mutate( VarArgsType * varArgsType );
    106         virtual Type * mutate( ZeroType * zeroType );
    107         virtual Type * mutate( OneType * oneType );
     91        virtual Type* mutate( VoidType *basicType );
     92        virtual Type* mutate( BasicType *basicType );
     93        virtual Type* mutate( PointerType *pointerType );
     94        virtual Type* mutate( ArrayType *arrayType );
     95        virtual Type* mutate( ReferenceType *refType );
     96        virtual Type* mutate( FunctionType *functionType );
     97        virtual Type* mutate( StructInstType *aggregateUseType );
     98        virtual Type* mutate( UnionInstType *aggregateUseType );
     99        virtual Type* mutate( EnumInstType *aggregateUseType );
     100        virtual Type* mutate( TraitInstType *aggregateUseType );
     101        virtual Type* mutate( TypeInstType *aggregateUseType );
     102        virtual Type* mutate( TupleType *tupleType );
     103        virtual Type* mutate( TypeofType *typeofType );
     104        virtual Type* mutate( AttrType *attrType );
     105        virtual Type* mutate( VarArgsType *varArgsType );
     106        virtual Type* mutate( ZeroType *zeroType );
     107        virtual Type* mutate( OneType *oneType );
    108108
    109         virtual Designation * mutate( Designation * designation );
    110         virtual Initializer * mutate( SingleInit * singleInit );
    111         virtual Initializer * mutate( ListInit * listInit );
    112         virtual Initializer * mutate( ConstructorInit * ctorInit );
     109        virtual Designation* mutate( Designation *designation );
     110        virtual Initializer* mutate( SingleInit *singleInit );
     111        virtual Initializer* mutate( ListInit *listInit );
     112        virtual Initializer* mutate( ConstructorInit *ctorInit );
    113113
    114         virtual Subrange * mutate( Subrange * subrange );
     114        virtual Subrange *mutate( Subrange *subrange );
    115115
    116         virtual Constant * mutate( Constant * constant );
    117 
    118         virtual Attribute * mutate( Attribute * attribute );
    119 
    120         virtual TypeSubstitution * mutate( TypeSubstitution * sub );
     116        virtual Constant *mutate( Constant *constant );
    121117  private:
    122         virtual Declaration * handleAggregateDecl(AggregateDecl * aggregateDecl );
    123         virtual Declaration * handleNamedTypeDecl(NamedTypeDecl * typeDecl );
    124         virtual Type * handleReferenceToType(ReferenceToType * aggregateUseType );
     118        virtual Declaration* handleAggregateDecl(AggregateDecl *aggregateDecl );
     119        virtual Declaration* handleNamedTypeDecl(NamedTypeDecl *typeDecl );
     120        virtual Type* handleReferenceToType(ReferenceToType *aggregateUseType );
    125121};
    126122
  • src/SynTree/NamedTypeDecl.cc

    r3f7e12cb r78315272  
    3838}
    3939
    40 void NamedTypeDecl::print( std::ostream &os, Indenter indent ) const {
     40void NamedTypeDecl::print( std::ostream &os, int indent ) const {
    4141        using namespace std;
    4242
    43         if ( name != "" ) os << name << ": ";
    44 
    45         if ( linkage != LinkageSpec::Cforall ) {
    46                 os << LinkageSpec::linkageName( linkage ) << " ";
     43        if ( get_name() != "" ) {
     44                os << get_name() << ": ";
     45        } // if
     46        if ( get_linkage() != LinkageSpec::Cforall ) {
     47                os << LinkageSpec::linkageName( get_linkage() ) << " ";
    4748        } // if
    4849        get_storageClasses().print( os );
     
    5051        if ( base ) {
    5152                os << " for ";
    52                 base->print( os, indent+1 );
     53                base->print( os, indent );
    5354        } // if
    5455        if ( ! parameters.empty() ) {
    55                 os << endl << indent << "... with parameters" << endl;
    56                 printAll( parameters, os, indent+1 );
     56                os << endl << string( indent, ' ' ) << "with parameters" << endl;
     57                printAll( parameters, os, indent+2 );
    5758        } // if
    5859        if ( ! assertions.empty() ) {
    59                 os << endl << indent << "... with assertions" << endl;
    60                 printAll( assertions, os, indent+1 );
     60                os << endl << string( indent, ' ' ) << "with assertions" << endl;
     61                printAll( assertions, os, indent+2 );
    6162        } // if
    6263}
    6364
    64 void NamedTypeDecl::printShort( std::ostream &os, Indenter indent ) const {
     65void NamedTypeDecl::printShort( std::ostream &os, int indent ) const {
    6566        using namespace std;
    6667
    67         if ( name != "" ) os << name << ": ";
     68        if ( get_name() != "" ) {
     69                os << get_name() << ": ";
     70        } // if
    6871        get_storageClasses().print( os );
    6972        os << typeString();
    7073        if ( base ) {
    7174                os << " for ";
    72                 base->print( os, indent+1 );
     75                base->print( os, indent );
    7376        } // if
    7477        if ( ! parameters.empty() ) {
    75                 os << endl << indent << "... with parameters" << endl;
    76                 printAll( parameters, os, indent+1 );
     78                os << endl << string( indent, ' ' ) << "with parameters" << endl;
     79                printAll( parameters, os, indent+2 );
    7780        } // if
    7881}
  • src/SynTree/ObjectDecl.cc

    r3f7e12cb r78315272  
    4444}
    4545
    46 void ObjectDecl::print( std::ostream &os, Indenter indent ) const {
    47         if ( name != "" ) os << name << ": ";
     46void ObjectDecl::print( std::ostream &os, int indent ) const {
     47        if ( get_name() != "" ) {
     48                os << get_name() << ": ";
     49        } // if
    4850
    49         if ( linkage != LinkageSpec::Cforall ) {
    50                 os << LinkageSpec::linkageName( linkage ) << " ";
     51        if ( get_linkage() != LinkageSpec::Cforall ) {
     52                os << LinkageSpec::linkageName( get_linkage() ) << " ";
    5153        } // if
     54
     55        printAll( get_attributes(), os, indent );
    5256
    5357        get_storageClasses().print( os );
    5458
    55         if ( type ) {
    56                 type->print( os, indent );
     59        if ( get_type() ) {
     60                get_type()->print( os, indent );
    5761        } else {
    5862                os << " untyped entity ";
     
    6064
    6165        if ( init ) {
    62                 os << " with initializer (" << (init->get_maybeConstructed() ? "maybe constructed" : "not constructed") << ")" << std::endl << indent+1;
    63                 init->print( os, indent+1 );
    64                 os << std::endl;
     66                os << " with initializer " << std::endl;
     67                init->print( os, indent+2 );
     68                os << std::endl << std::string(indent+2, ' ');
     69                os << "maybeConstructed? " << init->get_maybeConstructed();
    6570        } // if
    6671
    67         if ( ! attributes.empty() ) {
    68                 os << std::endl << indent << "... with attributes: " << std::endl;
    69                 printAll( attributes, os, indent+1 );
    70         }
    71 
    7272        if ( bitfieldWidth ) {
    73                 os << indent << " with bitfield width ";
     73                os << std::string(indent, ' ');
     74                os << " with bitfield width ";
    7475                bitfieldWidth->print( os );
    7576        } // if
    7677}
    7778
    78 void ObjectDecl::printShort( std::ostream &os, Indenter indent ) const {
     79void ObjectDecl::printShort( std::ostream &os, int indent ) const {
    7980#if 0
    8081        if ( get_mangleName() != "") {
     
    8283        } else
    8384#endif
    84         if ( name != "" ) os << name << ": ";
     85        if ( get_name() != "" ) {
     86                os << get_name() << ": ";
     87        } // if
     88
     89        // xxx - should printShort print attributes?
    8590
    8691        get_storageClasses().print( os );
    8792
    88         if ( type ) {
    89                 type->print( os, indent );
     93        if ( get_type() ) {
     94                get_type()->print( os, indent );
    9095        } else {
    9196                os << "untyped entity ";
  • src/SynTree/PointerType.cc

    r3f7e12cb r78315272  
    4141}
    4242
    43 void PointerType::print( std::ostream &os, Indenter indent ) const {
     43void PointerType::print( std::ostream &os, int indent ) const {
    4444        Type::print( os, indent );
    4545        if ( ! is_array() ) {
  • src/SynTree/ReferenceToType.cc

    r3f7e12cb r78315272  
    1414//
    1515
     16#include <stddef.h>          // for NULL
    1617#include <cassert>           // for assert
    1718#include <list>              // for list, _List_const_iterator, list<>::cons...
     
    3738}
    3839
    39 void ReferenceToType::print( std::ostream &os, Indenter indent ) const {
     40void ReferenceToType::print( std::ostream &os, int indent ) const {
    4041        using std::endl;
    4142
     
    4344        os << "instance of " << typeString() << " " << name << " ";
    4445        if ( ! parameters.empty() ) {
    45                 os << endl << indent << "... with parameters" << endl;
    46                 printAll( parameters, os, indent+1 );
     46                os << endl << std::string( indent, ' ' ) << "with parameters" << endl;
     47                printAll( parameters, os, indent+2 );
    4748        } // if
    4849}
     
    6465
    6566std::list<TypeDecl*>* StructInstType::get_baseParameters() {
    66         if ( ! baseStruct ) return nullptr;
     67        if ( ! baseStruct ) return NULL;
    6768        return &baseStruct->get_parameters();
    6869}
     
    7576}
    7677
    77 void StructInstType::print( std::ostream &os, Indenter indent ) const {
     78void StructInstType::print( std::ostream &os, int indent ) const {
    7879        using std::endl;
    7980
    80         if ( baseStruct == nullptr ) ReferenceToType::print( os, indent );
     81        if ( baseStruct == NULL ) ReferenceToType::print( os, indent );
    8182        else {
    8283                Type::print( os, indent );
    8384                os << "instance of " << typeString() << " " << name << " with body " << baseStruct->has_body() << " ";
    8485                if ( ! parameters.empty() ) {
    85                         os << endl << indent << "... with parameters" << endl;
    86                         printAll( parameters, os, indent+1 );
     86                        os << endl << std::string( indent, ' ' ) << "with parameters" << endl;
     87                        printAll( parameters, os, indent+2 );
    8788                } // if
    8889        } // if
     
    9697
    9798std::list< TypeDecl * > * UnionInstType::get_baseParameters() {
    98         if ( ! baseUnion ) return nullptr;
     99        if ( ! baseUnion ) return NULL;
    99100        return &baseUnion->get_parameters();
    100101}
     
    107108}
    108109
    109 void UnionInstType::print( std::ostream &os, Indenter indent ) const {
     110void UnionInstType::print( std::ostream &os, int indent ) const {
    110111        using std::endl;
    111112
    112         if ( baseUnion == nullptr ) ReferenceToType::print( os, indent );
     113        if ( baseUnion == NULL ) ReferenceToType::print( os, indent );
    113114        else {
    114115                Type::print( os, indent );
    115116                os << "instance of " << typeString() << " " << name << " with body " << baseUnion->has_body() << " ";
    116117                if ( ! parameters.empty() ) {
    117                         os << endl << indent << "... with parameters" << endl;
    118                         printAll( parameters, os, indent+1 );
     118                        os << endl << std::string( indent, ' ' ) << "with parameters" << endl;
     119                        printAll( parameters, os, indent+2 );
    119120                } // if
    120121        } // if
     
    128129
    129130bool EnumInstType::isComplete() const { return baseEnum ? baseEnum->has_body() : false; }
    130 
    131 void EnumInstType::print( std::ostream &os, Indenter indent ) const {
    132         using std::endl;
    133 
    134         if ( baseEnum == nullptr ) ReferenceToType::print( os, indent );
    135         else {
    136                 Type::print( os, indent );
    137                 os << "instance of " << typeString() << " " << name << " with body " << baseEnum->has_body() << " ";
    138         } // if
    139 }
    140 
    141131
    142132std::string TraitInstType::typeString() const { return "trait"; }
     
    176166bool TypeInstType::isComplete() const { return baseType->isComplete(); }
    177167
    178 void TypeInstType::print( std::ostream &os, Indenter indent ) const {
     168void TypeInstType::print( std::ostream &os, int indent ) const {
    179169        using std::endl;
    180170
     
    182172        os << "instance of " << typeString() << " " << get_name() << " (" << ( isFtype ? "" : "not" ) << " function type) ";
    183173        if ( ! parameters.empty() ) {
    184                 os << endl << indent << "... with parameters" << endl;
    185                 printAll( parameters, os, indent+1 );
     174                os << endl << std::string( indent, ' ' ) << "with parameters" << endl;
     175                printAll( parameters, os, indent+2 );
    186176        } // if
    187177}
  • src/SynTree/ReferenceType.cc

    r3f7e12cb r78315272  
    3535}
    3636
    37 void ReferenceType::print( std::ostream &os, Indenter indent ) const {
     37void ReferenceType::print( std::ostream &os, int indent ) const {
    3838        Type::print( os, indent );
    3939        os << "reference to ";
  • src/SynTree/Statement.cc

    r3f7e12cb r78315272  
    3434Statement::Statement( std::list<Label> labels ) : labels( labels ) {}
    3535
    36 void Statement::print( std::ostream & os, Indenter ) const {
    37         if ( ! labels.empty() ) {
    38                 os << "Labels: {";
    39                 for ( const Label & l : labels ) {
    40                         os << l << ",";
    41                 }
    42                 os << "}" << endl;
    43         }
    44 }
     36void Statement::print( __attribute__((unused)) std::ostream &, __attribute__((unused)) int indent ) const {}
    4537
    4638Statement::~Statement() {}
     
    5446}
    5547
    56 void ExprStmt::print( std::ostream &os, Indenter indent ) const {
    57         os << "Expression Statement:" << endl << indent+1;
    58         expr->print( os, indent+1 );
     48void ExprStmt::print( std::ostream &os, int indent ) const {
     49        os << "Expression Statement:" << endl << std::string( indent + 2, ' ' );
     50        expr->print( os, indent + 2 );
    5951}
    6052
     
    7567}
    7668
    77 void AsmStmt::print( std::ostream &os, Indenter indent ) const {
     69void AsmStmt::print( std::ostream &os, int indent ) const {
    7870        os << "Assembler Statement:" << endl;
    79         os << indent+1 << "instruction: " << endl << indent;
    80         instruction->print( os, indent+1 );
     71        os << std::string( indent, ' ' ) << "instruction: " << endl << std::string( indent, ' ' );
     72        instruction->print( os, indent + 2 );
    8173        if ( ! output.empty() ) {
    82                 os << endl << indent+1 << "output: " << endl;
    83                 printAll( output, os, indent+1 );
     74                os << endl << std::string( indent, ' ' ) << "output: " << endl;
     75                printAll( output, os, indent + 2 );
    8476        } // if
    8577        if ( ! input.empty() ) {
    86                 os << indent+1 << "input: " << endl;
    87                 printAll( input, os, indent+1 );
     78                os << std::string( indent, ' ' ) << "input: " << endl << std::string( indent, ' ' );
     79                printAll( input, os, indent + 2 );
    8880        } // if
    8981        if ( ! clobber.empty() ) {
    90                 os << indent+1 << "clobber: " << endl;
    91                 printAll( clobber, os, indent+1 );
     82                os << std::string( indent, ' ' ) << "clobber: " << endl;
     83                printAll( clobber, os, indent + 2 );
    9284        } // if
    9385}
     
    111103}
    112104
    113 void BranchStmt::print( std::ostream &os, Indenter indent ) const {
    114         os << "Branch (" << brType[type] << ")" << endl ;
    115         if ( target != "" ) os << indent+1 << "with target: " << target << endl;
    116         if ( originalTarget != "" ) os << indent+1 << "with original target: " << originalTarget << endl;
    117         if ( computedTarget != nullptr ) os << indent+1 << "with computed target: " << computedTarget << endl;
     105void BranchStmt::print( std::ostream &os, int indent ) const {
     106        os << string( indent, ' ' ) << "Branch (" << brType[type] << ")" << endl ;
     107        if ( target != "" ) os << string( indent+2, ' ' ) << "with target: " << target << endl;
     108        if ( originalTarget != "" ) os << string( indent+2, ' ' ) << "with original target: " << originalTarget << endl;
     109        if ( computedTarget != nullptr ) os << string( indent+2, ' ' ) << "with computed target: " << computedTarget << endl;
    118110}
    119111
     
    126118}
    127119
    128 void ReturnStmt::print( std::ostream &os, Indenter indent ) const {
    129         os << "Return Statement, returning: ";
    130         if ( expr != nullptr ) {
    131                 os << endl << indent+1;
    132                 expr->print( os, indent+1 );
     120void ReturnStmt::print( std::ostream &os, int indent ) const {
     121        os <<  "Return Statement, returning: ";
     122        if ( expr != 0 ) {
     123                os << endl << string( indent+2, ' ' );
     124                expr->print( os, indent + 2 );
    133125        }
    134126        os << endl;
     
    150142}
    151143
    152 void IfStmt::print( std::ostream &os, Indenter indent ) const {
    153         os << "If on condition: " << endl;
    154         os << indent+1;
    155         condition->print( os, indent+1 );
     144void IfStmt::print( std::ostream &os, int indent ) const {
     145        os << "If on condition: " << endl ;
     146        os << string( indent+4, ' ' );
     147        condition->print( os, indent + 4 );
    156148
    157149        if ( !initialization.empty() ) {
    158                 os << indent << "... with initialization: \n";
    159                 for ( const Statement * stmt : initialization ) {
    160                         os << indent+1;
    161                         stmt->print( os, indent+1 );
     150                os << string( indent + 2, ' ' ) << "initialization: \n";
     151                for ( std::list<Statement *>::const_iterator it = initialization.begin(); it != initialization.end(); ++it ) {
     152                        os << string( indent + 4, ' ' );
     153                        (*it)->print( os, indent + 4 );
    162154                }
    163155                os << endl;
    164156        }
    165157
    166         os << indent << "... then: " << endl;
    167 
    168         os << indent+1;
    169         thenPart->print( os, indent+1 );
     158        os << string( indent+2, ' ' ) << "... then: " << endl;
     159
     160        os << string( indent+4, ' ' );
     161        thenPart->print( os, indent + 4 );
    170162
    171163        if ( elsePart != 0 ) {
    172                 os << indent << "... else: " << endl;
    173                 os << indent+1;
    174                 elsePart->print( os, indent+1 );
     164                os << string( indent+2, ' ' ) << "... else: " << endl;
     165                os << string( indent+4, ' ' );
     166                elsePart->print( os, indent + 4 );
    175167        } // if
    176168}
    177169
    178 SwitchStmt::SwitchStmt( std::list<Label> labels, Expression * condition, const std::list<Statement *> &statements ):
     170SwitchStmt::SwitchStmt( std::list<Label> labels, Expression * condition, std::list<Statement *> &statements ):
    179171        Statement( labels ), condition( condition ), statements( statements ) {
    180172}
     
    191183}
    192184
    193 void SwitchStmt::print( std::ostream &os, Indenter indent ) const {
     185void SwitchStmt::print( std::ostream &os, int indent ) const {
    194186        os << "Switch on condition: ";
    195187        condition->print( os );
    196188        os << endl;
    197189
    198         for ( const Statement * stmt : statements ) {
    199                 stmt->print( os, indent+1 );
    200         }
    201 }
    202 
    203 CaseStmt::CaseStmt( std::list<Label> labels, Expression *condition, const std::list<Statement *> &statements, bool deflt ) throw ( SemanticError ) :
     190        // statements
     191        std::list<Statement *>::const_iterator i;
     192        for ( i = statements.begin(); i != statements.end(); i++)
     193                (*i)->print( os, indent + 4 );
     194
     195        //for_each( statements.begin(), statements.end(), mem_fun( bind1st(&Statement::print ), os ));
     196}
     197
     198CaseStmt::CaseStmt( std::list<Label> labels, Expression *condition, std::list<Statement *> &statements, bool deflt ) throw ( SemanticError ) :
    204199        Statement( labels ), condition( condition ), stmts( statements ), _isDefault( deflt ) {
    205         if ( isDefault() && condition != 0 ) throw SemanticError("default case with condition: ", condition);
     200        if ( isDefault() && condition != 0 )
     201                throw SemanticError("default with conditions");
    206202}
    207203
     
    220216}
    221217
    222 void CaseStmt::print( std::ostream &os, Indenter indent ) const {
    223         if ( isDefault() ) os << "Default ";
     218void CaseStmt::print( std::ostream &os, int indent ) const {
     219        os << string( indent, ' ' );
     220
     221        if ( isDefault() )
     222                os << "Default ";
    224223        else {
    225224                os << "Case ";
    226                 condition->print( os, indent );
     225                condition->print( os );
    227226        } // if
     227
    228228        os << endl;
    229229
    230         for ( Statement * stmt : stmts ) {
    231                 stmt->print( os, indent+1 );
    232         }
     230        std::list<Statement *>::const_iterator i;
     231        for ( i = stmts.begin(); i != stmts.end(); i++)
     232                (*i )->print( os, indent + 4 );
    233233}
    234234
     
    246246}
    247247
    248 void WhileStmt::print( std::ostream &os, Indenter indent ) const {
     248void WhileStmt::print( std::ostream &os, int indent ) const {
    249249        os << "While on condition: " << endl ;
    250         condition->print( os, indent+1 );
    251 
    252         os << indent << "... with body: " << endl;
    253 
    254         if ( body != 0 ) body->print( os, indent+1 );
     250        condition->print( os, indent + 4 );
     251
     252        os << string( indent, ' ' ) << ".... with body: " << endl;
     253
     254        if ( body != 0 ) body->print( os, indent + 4 );
    255255}
    256256
     
    272272}
    273273
    274 void ForStmt::print( std::ostream &os, Indenter indent ) const {
    275         Statement::print( os, indent ); // print labels
    276 
    277         os << "For Statement" << endl;
    278 
    279         if ( ! initialization.empty() ) {
    280                 os << indent << "... initialization: \n";
    281                 for ( Statement * stmt : initialization ) {
    282                         os << indent+1;
    283                         stmt->print( os, indent+1 );
    284                 }
    285         }
    286 
    287         if ( condition != nullptr ) {
    288                 os << indent << "... condition: \n" << indent+1;
    289                 condition->print( os, indent+1 );
    290         }
    291 
    292         if ( increment != nullptr ) {
    293                 os << "\n" << indent << "... increment: \n" << indent+1;
    294                 increment->print( os, indent+1 );
    295         }
    296 
     274void ForStmt::print( std::ostream &os, int indent ) const {
     275        os << "Labels: {";
     276        for ( std::list<Label>::const_iterator it = get_labels().begin(); it != get_labels().end(); ++it) {
     277                os << *it << ",";
     278        }
     279        os << "}" << endl;
     280
     281        os << string( indent, ' ' ) << "For Statement" << endl ;
     282
     283        os << string( indent + 2, ' ' ) << "initialization: \n";
     284        for ( std::list<Statement *>::const_iterator it = initialization.begin(); it != initialization.end(); ++it ) {
     285                os << string( indent + 4, ' ' );
     286                (*it)->print( os, indent + 4 );
     287        }
     288
     289        os << "\n" << string( indent + 2, ' ' ) << "condition: \n";
     290        if ( condition != 0 ) {
     291                os << string( indent + 4, ' ' );
     292                condition->print( os, indent + 4 );
     293        }
     294
     295        os << "\n" << string( indent + 2, ' ' ) << "increment: \n";
     296        if ( increment != 0 ) {
     297                os << string( indent + 4, ' ' );
     298                increment->print( os, indent + 4 );
     299        }
     300
     301        os << "\n" << string( indent + 2, ' ' ) << "statement block: \n";
    297302        if ( body != 0 ) {
    298                 os << "\n" << indent << "... with body: \n" << indent+1;
    299                 body->print( os, indent+1 );
    300         }
     303                os << string( indent + 4, ' ' );
     304                body->print( os, indent + 4 );
     305        }
     306
    301307        os << endl;
    302308}
     
    316322}
    317323
    318 void ThrowStmt::print( std::ostream &os, Indenter indent) const {
    319         if ( target ) os << "Non-Local ";
     324void ThrowStmt::print( std::ostream &os, int indent) const {
     325        if ( target ) {
     326                os << "Non-Local ";
     327        }
    320328        os << "Throw Statement, raising: ";
    321         expr->print(os, indent+1);
     329        expr->print(os, indent + 4);
    322330        if ( target ) {
    323                 os << "... at: ";
    324                 target->print(os, indent+1);
     331                os << "At: ";
     332                target->print(os, indent + 4);
    325333        }
    326334}
     
    340348}
    341349
    342 void TryStmt::print( std::ostream &os, Indenter indent ) const {
     350void TryStmt::print( std::ostream &os, int indent ) const {
    343351        os << "Try Statement" << endl;
    344         os << indent << "... with block:" << endl << indent+1;
    345         block->print( os, indent+1 );
     352        os << string( indent + 2, ' ' ) << "with block:" << endl;
     353        os << string( indent + 4, ' ' );
     354        block->print( os, indent + 4 );
    346355
    347356        // handlers
    348         os << indent << "... and handlers:" << endl;
    349         for ( const CatchStmt * stmt : handlers ) {
    350                 os << indent+1;
    351                 stmt->print( os, indent+1 );
     357        os << string( indent + 2, ' ' ) << "and handlers:" << endl;
     358        for ( std::list<CatchStmt *>::const_iterator i = handlers.begin(); i != handlers.end(); i++) {
     359                os << string( indent + 4, ' ' );
     360                (*i )->print( os, indent + 4 );
    352361        }
    353362
    354363        // finally block
    355364        if ( finallyBlock != 0 ) {
    356                 os << indent << "... and finally:" << endl << indent+1;
    357                 finallyBlock->print( os, indent+1 );
     365                os << string( indent + 2, ' ' ) << "and finally:" << endl;
     366                finallyBlock->print( os, indent + 4 );
    358367        } // if
    359368}
     
    361370CatchStmt::CatchStmt( std::list<Label> labels, Kind kind, Declaration *decl, Expression *cond, Statement *body ) :
    362371        Statement( labels ), kind ( kind ), decl ( decl ), cond ( cond ), body( body ) {
    363                 assertf( decl, "Catch clause must have a declaration." );
    364372}
    365373
     
    373381}
    374382
    375 void CatchStmt::print( std::ostream &os, Indenter indent ) const {
     383void CatchStmt::print( std::ostream &os, int indent ) const {
    376384        os << "Catch " << ((Terminate == kind) ? "Terminate" : "Resume") << " Statement" << endl;
    377385
    378         os << indent << "... catching: ";
    379         decl->printShort( os, indent+1 );
    380         os << endl;
     386        os << string( indent + 2, ' ' ) << "... catching: ";
     387        if ( decl ) {
     388                decl->printShort( os, indent + 4 );
     389                os << endl;
     390        }
     391        else
     392                os << string( indent + 4 , ' ' ) << ">>> Error:  this catch clause must have a declaration <<<" << endl;
    381393
    382394        if ( cond ) {
    383                 os << indent << "... with conditional:" << endl << indent+1;
    384                 cond->print( os, indent+1 );
    385         }
    386 
    387         os << indent << "... with block:" << endl;
    388         os << indent+1;
    389         body->print( os, indent+1 );
     395                os << string( indent + 2, ' ' ) << "with conditional:" << endl;
     396                os << string( indent + 4, ' ' );
     397                cond->print( os, indent + 4 );
     398        }
     399        else
     400                os << string( indent + 2, ' ' ) << "with no conditional" << endl;
     401
     402        os << string( indent + 2, ' ' ) << "with block:" << endl;
     403        os << string( indent + 4, ' ' );
     404        body->print( os, indent + 4 );
    390405}
    391406
     
    402417}
    403418
    404 void FinallyStmt::print( std::ostream &os, Indenter indent ) const {
     419void FinallyStmt::print( std::ostream &os, int indent ) const {
    405420        os << "Finally Statement" << endl;
    406         os << indent << "... with block:" << endl << indent+1;
    407         block->print( os, indent+1 );
     421        os << string( indent + 2, ' ' ) << "with block:" << endl;
     422        os << string( indent + 4, ' ' );
     423        block->print( os, indent + 4 );
    408424}
    409425
     
    449465}
    450466
    451 void WaitForStmt::print( std::ostream &os, Indenter indent ) const {
     467void WaitForStmt::print( std::ostream &os, int indent ) const {
    452468        os << "Waitfor Statement" << endl;
    453         os << indent << "... with block:" << endl << indent+1;
     469        os << string( indent + 2, ' ' ) << "with block:" << endl;
     470        os << string( indent + 4, ' ' );
    454471        // block->print( os, indent + 4 );
    455472}
     
    458475NullStmt::NullStmt() : Statement( std::list<Label>() ) {}
    459476
    460 void NullStmt::print( std::ostream &os, Indenter ) const {
    461         os << "Null Statement" << endl;
     477void NullStmt::print( std::ostream &os, __attribute__((unused)) int indent ) const {
     478        os << "Null Statement" << endl ;
    462479}
    463480
     
    473490}
    474491
    475 void ImplicitCtorDtorStmt::print( std::ostream &os, Indenter indent ) const {
     492void ImplicitCtorDtorStmt::print( std::ostream &os, int indent ) const {
    476493        os << "Implicit Ctor Dtor Statement" << endl;
    477         os << indent << "... with Ctor/Dtor: ";
    478         callStmt->print( os, indent+1);
     494        os << string( indent + 2, ' ' ) << "with Ctor/Dtor: ";
     495        callStmt->print( os, indent + 2);
    479496        os << endl;
     497}
     498
     499std::ostream & operator<<( std::ostream & out, const Statement * statement ) {
     500        if ( statement ) {
     501                statement->print( out );
     502        } else {
     503                out << "nullptr";
     504        }
     505        return out;
    480506}
    481507
  • src/SynTree/Statement.h

    r3f7e12cb r78315272  
    4343        const std::list<Label> & get_labels() const { return labels; }
    4444
    45         virtual Statement *clone() const override = 0;
    46         virtual void accept( Visitor &v ) override = 0;
    47         virtual Statement *acceptMutator( Mutator &m ) override = 0;
    48         virtual void print( std::ostream &os, Indenter indent = {} ) const override;
     45        virtual Statement *clone() const = 0;
     46        virtual void accept( Visitor &v ) = 0;
     47        virtual Statement *acceptMutator( Mutator &m ) = 0;
     48        virtual void print( std::ostream &os, int indent = 0 ) const;
    4949};
    5050
     
    5454
    5555        CompoundStmt( std::list<Label> labels );
    56         CompoundStmt( std::list<Statement *> stmts );
    5756        CompoundStmt( const CompoundStmt &other );
    5857        virtual ~CompoundStmt();
     
    6261        void push_front( Statement * stmt ) { kids.push_front( stmt ); }
    6362
    64         virtual CompoundStmt *clone() const override { return new CompoundStmt( *this ); }
    65         virtual void accept( Visitor &v ) override { v.visit( this ); }
    66         virtual CompoundStmt *acceptMutator( Mutator &m )  override { return m.mutate( this ); }
    67         virtual void print( std::ostream &os, Indenter indent = {} ) const override;
     63        virtual CompoundStmt *clone() const { return new CompoundStmt( *this ); }
     64        virtual void accept( Visitor &v ) { v.visit( this ); }
     65        virtual CompoundStmt *acceptMutator( Mutator &m ) { return m.mutate( this ); }
     66        virtual void print( std::ostream &os, int indent = 0 ) const;
    6867};
    6968
     
    7372        NullStmt( std::list<Label> labels );
    7473
    75         virtual NullStmt *clone() const override { return new NullStmt( *this ); }
    76         virtual void accept( Visitor &v ) override { v.visit( this ); }
    77         virtual NullStmt *acceptMutator( Mutator &m )  override { return m.mutate( this ); }
    78         virtual void print( std::ostream &os, Indenter indent = {} ) const override;
     74        virtual NullStmt *clone() const { return new NullStmt( *this ); }
     75        virtual void accept( Visitor &v ) { v.visit( this ); }
     76        virtual NullStmt *acceptMutator( Mutator &m ) { return m.mutate( this ); }
     77        virtual void print( std::ostream &os, int indent = 0 ) const;
    7978};
    8079
     
    9089        void set_expr( Expression *newValue ) { expr = newValue; }
    9190
    92         virtual ExprStmt *clone() const override { return new ExprStmt( *this ); }
    93         virtual void accept( Visitor &v ) override { v.visit( this ); }
    94         virtual Statement *acceptMutator( Mutator &m )  override { return m.mutate( this ); }
    95         virtual void print( std::ostream &os, Indenter indent = {} ) const override;
     91        virtual ExprStmt *clone() const { return new ExprStmt( *this ); }
     92        virtual void accept( Visitor &v ) { v.visit( this ); }
     93        virtual Statement *acceptMutator( Mutator &m ) { return m.mutate( this ); }
     94        virtual void print( std::ostream &os, int indent = 0 ) const;
    9695};
    9796
     
    124123        virtual void accept( Visitor & v ) { v.visit( this ); }
    125124        virtual Statement * acceptMutator( Mutator & m ) { return m.mutate( this ); }
    126         virtual void print( std::ostream & os, Indenter indent = {} ) const;
     125        virtual void print( std::ostream & os, int indent = 0 ) const;
    127126};
    128127
     
    147146        void set_elsePart( Statement *newValue ) { elsePart = newValue; }
    148147
    149         virtual IfStmt *clone() const override { return new IfStmt( *this ); }
    150         virtual void accept( Visitor &v ) override { v.visit( this ); }
    151         virtual Statement *acceptMutator( Mutator &m )  override { return m.mutate( this ); }
    152         virtual void print( std::ostream &os, Indenter indent = {} ) const override;
     148        virtual IfStmt *clone() const { return new IfStmt( *this ); }
     149        virtual void accept( Visitor &v ) { v.visit( this ); }
     150        virtual Statement *acceptMutator( Mutator &m ) { return m.mutate( this ); }
     151        virtual void print( std::ostream &os, int indent = 0 ) const;
    153152};
    154153
     
    158157        std::list<Statement *> statements;
    159158
    160         SwitchStmt( std::list<Label> labels, Expression *condition, const std::list<Statement *> &statements );
     159        SwitchStmt( std::list<Label> labels, Expression *condition, std::list<Statement *> &statements );
    161160        SwitchStmt( const SwitchStmt &other );
    162161        virtual ~SwitchStmt();
     
    167166        std::list<Statement *> & get_statements() { return statements; }
    168167
    169         virtual void accept( Visitor &v ) override { v.visit( this ); }
    170         virtual Statement *acceptMutator( Mutator &m )  override { return m.mutate( this ); }
    171 
    172         virtual SwitchStmt *clone() const override { return new SwitchStmt( *this ); }
    173         virtual void print( std::ostream &os, Indenter indent = {} ) const override;
     168        virtual void accept( Visitor &v ) { v.visit( this ); }
     169        virtual Statement *acceptMutator( Mutator &m ) { return m.mutate( this ); }
     170
     171        virtual SwitchStmt *clone() const { return new SwitchStmt( *this ); }
     172        virtual void print( std::ostream &os, int indent = 0 ) const;
    174173
    175174};
     
    180179        std::list<Statement *> stmts;
    181180
    182         CaseStmt( std::list<Label> labels, Expression *conditions, const std::list<Statement *> &stmts, bool isdef = false ) throw(SemanticError);
     181        CaseStmt( std::list<Label> labels, Expression *conditions, std::list<Statement *> &stmts, bool isdef = false ) throw(SemanticError);
    183182        CaseStmt( const CaseStmt &other );
    184183        virtual ~CaseStmt();
     
    195194        void set_statements( std::list<Statement *> &newValue ) { stmts = newValue; }
    196195
    197         virtual void accept( Visitor &v ) override { v.visit( this ); }
    198         virtual Statement *acceptMutator( Mutator &m )  override { return m.mutate( this ); }
    199 
    200         virtual CaseStmt *clone() const override { return new CaseStmt( *this ); }
    201         virtual void print( std::ostream &os, Indenter indent = {} ) const override;
     196        virtual void accept( Visitor &v ) { v.visit( this ); }
     197        virtual Statement *acceptMutator( Mutator &m ) { return m.mutate( this ); }
     198
     199        virtual CaseStmt *clone() const { return new CaseStmt( *this ); }
     200        virtual void print( std::ostream &os, int indent = 0 ) const;
    202201  private:
    203202        bool _isDefault;
     
    222221        void set_isDoWhile( bool newValue ) { isDoWhile = newValue; }
    223222
    224         virtual WhileStmt *clone() const override { return new WhileStmt( *this ); }
    225         virtual void accept( Visitor &v ) override { v.visit( this ); }
    226         virtual Statement *acceptMutator( Mutator &m )  override { return m.mutate( this ); }
    227         virtual void print( std::ostream &os, Indenter indent = {} ) const override;
     223        virtual WhileStmt *clone() const { return new WhileStmt( *this ); }
     224        virtual void accept( Visitor &v ) { v.visit( this ); }
     225        virtual Statement *acceptMutator( Mutator &m ) { return m.mutate( this ); }
     226        virtual void print( std::ostream &os, int indent = 0 ) const;
    228227};
    229228
     
    248247        void set_body( Statement *newValue ) { body = newValue; }
    249248
    250         virtual ForStmt *clone() const override { return new ForStmt( *this ); }
    251         virtual void accept( Visitor &v ) override { v.visit( this ); }
    252         virtual Statement *acceptMutator( Mutator &m )  override { return m.mutate( this ); }
    253         virtual void print( std::ostream &os, Indenter indent = {} ) const override;
     249        virtual ForStmt *clone() const { return new ForStmt( *this ); }
     250        virtual void accept( Visitor &v ) { v.visit( this ); }
     251        virtual Statement *acceptMutator( Mutator &m ) { return m.mutate( this ); }
     252        virtual void print( std::ostream &os, int indent = 0 ) const;
    254253};
    255254
     
    277276        const char *get_typename() { return brType[ type ]; }
    278277
    279         virtual BranchStmt *clone() const override { return new BranchStmt( *this ); }
    280         virtual void accept( Visitor &v ) override { v.visit( this ); }
    281         virtual Statement *acceptMutator( Mutator &m )  override { return m.mutate( this ); }
    282         virtual void print( std::ostream &os, Indenter indent = {} ) const override;
     278        virtual BranchStmt *clone() const { return new BranchStmt( *this ); }
     279        virtual void accept( Visitor &v ) { v.visit( this ); }
     280        virtual Statement *acceptMutator( Mutator &m ) { return m.mutate( this ); }
     281        virtual void print( std::ostream &os, int indent = 0 ) const;
    283282  private:
    284283        static const char *brType[];
     
    296295        void set_expr( Expression *newValue ) { expr = newValue; }
    297296
    298         virtual ReturnStmt *clone() const override { return new ReturnStmt( *this ); }
    299         virtual void accept( Visitor &v ) override { v.visit( this ); }
    300         virtual Statement *acceptMutator( Mutator &m )  override { return m.mutate( this ); }
    301         virtual void print( std::ostream &os, Indenter indent = {} ) const override;
     297        virtual ReturnStmt *clone() const { return new ReturnStmt( *this ); }
     298        virtual void accept( Visitor &v ) { v.visit( this ); }
     299        virtual Statement *acceptMutator( Mutator &m ) { return m.mutate( this ); }
     300        virtual void print( std::ostream &os, int indent = 0 ) const;
    302301};
    303302
     
    320319        void set_target( Expression * newTarget ) { target = newTarget; }
    321320
    322         virtual ThrowStmt *clone() const override { return new ThrowStmt( *this ); }
    323         virtual void accept( Visitor &v ) override { v.visit( this ); }
    324         virtual Statement *acceptMutator( Mutator &m )  override { return m.mutate( this ); }
    325         virtual void print( std::ostream &os, Indenter indent = {} ) const override;
     321        virtual ThrowStmt *clone() const { return new ThrowStmt( *this ); }
     322        virtual void accept( Visitor &v ) { v.visit( this ); }
     323        virtual Statement *acceptMutator( Mutator &m ) { return m.mutate( this ); }
     324        virtual void print( std::ostream &os, int indent = 0 ) const;
    326325};
    327326
     
    343342        void set_finally( FinallyStmt *newValue ) { finallyBlock = newValue; }
    344343
    345         virtual TryStmt *clone() const override { return new TryStmt( *this ); }
    346         virtual void accept( Visitor &v ) override { v.visit( this ); }
    347         virtual Statement *acceptMutator( Mutator &m )  override { return m.mutate( this ); }
    348         virtual void print( std::ostream &os, Indenter indent = {} ) const override;
     344        virtual TryStmt *clone() const { return new TryStmt( *this ); }
     345        virtual void accept( Visitor &v ) { v.visit( this ); }
     346        virtual Statement *acceptMutator( Mutator &m ) { return m.mutate( this ); }
     347        virtual void print( std::ostream &os, int indent = 0 ) const;
    349348};
    350349
     
    371370        void set_body( Statement *newValue ) { body = newValue; }
    372371
    373         virtual CatchStmt *clone() const override { return new CatchStmt( *this ); }
    374         virtual void accept( Visitor &v ) override { v.visit( this ); }
    375         virtual Statement *acceptMutator( Mutator &m )  override { return m.mutate( this ); }
    376         virtual void print( std::ostream &os, Indenter indent = {} ) const override;
     372        virtual CatchStmt *clone() const { return new CatchStmt( *this ); }
     373        virtual void accept( Visitor &v ) { v.visit( this ); }
     374        virtual Statement *acceptMutator( Mutator &m ) { return m.mutate( this ); }
     375        virtual void print( std::ostream &os, int indent = 0 ) const;
    377376};
    378377
     
    388387        void set_block( CompoundStmt *newValue ) { block = newValue; }
    389388
    390         virtual FinallyStmt *clone() const override { return new FinallyStmt( *this ); }
    391         virtual void accept( Visitor &v ) override { v.visit( this ); }
    392         virtual Statement *acceptMutator( Mutator &m )  override { return m.mutate( this ); }
    393         virtual void print( std::ostream &os, Indenter indent = {} ) const override;
     389        virtual FinallyStmt *clone() const { return new FinallyStmt( *this ); }
     390        virtual void accept( Visitor &v ) { v.visit( this ); }
     391        virtual Statement *acceptMutator( Mutator &m ) { return m.mutate( this ); }
     392        virtual void print( std::ostream &os, int indent = 0 ) const;
    394393};
    395394
     
    425424        } orelse;
    426425
    427         virtual WaitForStmt *clone() const override { return new WaitForStmt( *this ); }
    428         virtual void accept( Visitor &v ) override { v.visit( this ); }
    429         virtual Statement *acceptMutator( Mutator &m )  override { return m.mutate( this ); }
    430         virtual void print( std::ostream &os, Indenter indent = {} ) const override;
     426        virtual WaitForStmt *clone() const { return new WaitForStmt( *this ); }
     427        virtual void accept( Visitor &v ) { v.visit( this ); }
     428        virtual Statement *acceptMutator( Mutator &m ) { return m.mutate( this ); }
     429        virtual void print( std::ostream &os, int indent = 0 ) const;
    431430
    432431};
     
    445444        void set_decl( Declaration *newValue ) { decl = newValue; }
    446445
    447         virtual DeclStmt *clone() const override { return new DeclStmt( *this ); }
    448         virtual void accept( Visitor &v ) override { v.visit( this ); }
    449         virtual Statement *acceptMutator( Mutator &m )  override { return m.mutate( this ); }
    450         virtual void print( std::ostream &os, Indenter indent = {} ) const override;
     446        virtual DeclStmt *clone() const { return new DeclStmt( *this ); }
     447        virtual void accept( Visitor &v ) { v.visit( this ); }
     448        virtual Statement *acceptMutator( Mutator &m ) { return m.mutate( this ); }
     449        virtual void print( std::ostream &os, int indent = 0 ) const;
    451450};
    452451
     
    467466        void set_callStmt( Statement * newValue ) { callStmt = newValue; }
    468467
    469         virtual ImplicitCtorDtorStmt *clone() const override { return new ImplicitCtorDtorStmt( *this ); }
    470         virtual void accept( Visitor &v ) override { v.visit( this ); }
    471         virtual Statement *acceptMutator( Mutator &m )  override { return m.mutate( this ); }
    472         virtual void print( std::ostream &os, Indenter indent = {} ) const override;
    473 };
     468        virtual ImplicitCtorDtorStmt *clone() const { return new ImplicitCtorDtorStmt( *this ); }
     469        virtual void accept( Visitor &v ) { v.visit( this ); }
     470        virtual Statement *acceptMutator( Mutator &m ) { return m.mutate( this ); }
     471        virtual void print( std::ostream &os, int indent = 0 ) const;
     472};
     473
     474
     475std::ostream & operator<<( std::ostream & out, const Statement * statement );
    474476
    475477// Local Variables: //
  • src/SynTree/TupleExpr.cc

    r3f7e12cb r78315272  
    2828#include "Type.h"               // for TupleType, Type
    2929
    30 UntypedTupleExpr::UntypedTupleExpr( const std::list< Expression * > & exprs ) : Expression(), exprs( exprs ) {
     30UntypedTupleExpr::UntypedTupleExpr( const std::list< Expression * > & exprs, Expression *_aname ) : Expression( _aname ), exprs( exprs ) {
    3131}
    3232
     
    3939}
    4040
    41 void UntypedTupleExpr::print( std::ostream &os, Indenter indent ) const {
     41void UntypedTupleExpr::print( std::ostream &os, int indent ) const {
    4242        os << "Untyped Tuple:" << std::endl;
    43         printAll( exprs, os, indent+1 );
     43        printAll( exprs, os, indent+2 );
    4444        Expression::print( os, indent );
    4545}
    4646
    47 TupleExpr::TupleExpr( const std::list< Expression * > & exprs ) : Expression(), exprs( exprs ) {
     47TupleExpr::TupleExpr( const std::list< Expression * > & exprs, Expression *_aname ) : Expression( _aname ), exprs( exprs ) {
    4848        set_result( Tuples::makeTupleType( exprs ) );
    4949}
     
    5757}
    5858
    59 void TupleExpr::print( std::ostream &os, Indenter indent ) const {
     59void TupleExpr::print( std::ostream &os, int indent ) const {
    6060        os << "Tuple:" << std::endl;
    61         printAll( exprs, os, indent+1 );
     61        printAll( exprs, os, indent+2 );
    6262        Expression::print( os, indent );
    6363}
     
    7878}
    7979
    80 void TupleIndexExpr::print( std::ostream &os, Indenter indent ) const {
     80void TupleIndexExpr::print( std::ostream &os, int indent ) const {
    8181        os << "Tuple Index Expression, with tuple:" << std::endl;
    82         os << indent+1;
    83         tuple->print( os, indent+1 );
    84         os << indent+1 << "with index: " << index << std::endl;
     82        os << std::string( indent+2, ' ' );
     83        tuple->print( os, indent+2 );
     84        os << std::string( indent+2, ' ' ) << "with index: " << index << std::endl;
    8585        Expression::print( os, indent );
    8686}
    8787
    88 TupleAssignExpr::TupleAssignExpr( const std::list< Expression * > & assigns, const std::list< ObjectDecl * > & tempDecls ) : Expression() {
     88TupleAssignExpr::TupleAssignExpr( const std::list< Expression * > & assigns, const std::list< ObjectDecl * > & tempDecls, Expression * _aname ) : Expression( _aname ) {
    8989        // convert internally into a StmtExpr which contains the declarations and produces the tuple of the assignments
    9090        set_result( Tuples::makeTupleType( assigns ) );
     
    109109}
    110110
    111 void TupleAssignExpr::print( std::ostream &os, Indenter indent ) const {
     111void TupleAssignExpr::print( std::ostream &os, int indent ) const {
    112112        os << "Tuple Assignment Expression, with stmt expr:" << std::endl;
    113         os << indent+1;
    114         stmtExpr->print( os, indent+1 );
     113        os << std::string( indent+2, ' ' );
     114        stmtExpr->print( os, indent+4 );
    115115        Expression::print( os, indent );
    116116}
  • src/SynTree/TupleType.cc

    r3f7e12cb r78315272  
    4848}
    4949
    50 void TupleType::print( std::ostream &os, Indenter indent ) const {
     50void TupleType::print( std::ostream &os, int indent ) const {
    5151        Type::print( os, indent );
    5252        os << "tuple of types" << std::endl;
    53         printAll( types, os, indent+1 );
     53        printAll( types, os, indent+2 );
    5454}
    5555
  • src/SynTree/Type.cc

    r3f7e12cb r78315272  
    1010// Created On       : Mon May 18 07:44:20 2015
    1111// Last Modified By : Peter A. Buhr
    12 // Last Modified On : Mon Sep 25 15:16:32 2017
    13 // Update Count     : 38
     12// Last Modified On : Mon Sep 11 13:21:25 2017
     13// Update Count     : 37
    1414//
    1515#include "Type.h"
     
    4545        "double _Imaginary",
    4646        "long double _Imaginary",
    47         "__int128",
    48         "unsigned __int128",
    4947};
    5048
     
    7573        Type * type;
    7674        ReferenceType * ref;
    77         for ( type = this; (ref = dynamic_cast<ReferenceType *>( type )); type = ref->base );
     75        for ( type = this; (ref = dynamic_cast<ReferenceType *>( type )); type = ref->get_base() );
    7876        return type;
    7977}
     
    8179int Type::referenceDepth() const { return 0; }
    8280
    83 void Type::print( std::ostream &os, Indenter indent ) const {
     81void Type::print( std::ostream &os, int indent ) const {
    8482        if ( ! forall.empty() ) {
    8583                os << "forall" << std::endl;
    86                 printAll( forall, os, indent+1 );
    87                 os << ++indent;
     84                printAll( forall, os, indent + 4 );
     85                os << std::string( indent+2, ' ' );
    8886        } // if
    8987
    9088        if ( ! attributes.empty() ) {
    91                 os << "with attributes" << endl;
    92                 printAll( attributes, os, indent+1 );
     89                os << endl << string( indent+2, ' ' ) << "with attributes" << endl;
     90                printAll( attributes, os, indent+4 );
    9391        } // if
    9492
     
    10199const Type::Qualifiers noQualifiers;
    102100
     101std::ostream & operator<<( std::ostream & out, const Type * type ) {
     102        if ( type ) {
     103                type->print( out );
     104        } else {
     105                out << "nullptr";
     106        } // if
     107        return out;
     108}
     109
    103110// Local Variables: //
    104111// tab-width: 4 //
  • src/SynTree/Type.h

    r3f7e12cb r78315272  
    99// Author           : Richard C. Bilson
    1010// Created On       : Mon May 18 07:44:20 2015
    11 // Last Modified By : Peter A. Buhr
    12 // Last Modified On : Mon Sep 25 14:14:01 2017
    13 // Update Count     : 154
     11// Last Modified By : Andrew Beach
     12// Last Modified On : Wed Aug  9 14:25:00 2017
     13// Update Count     : 152
    1414//
    1515
     
    181181        virtual void accept( Visitor & v ) = 0;
    182182        virtual Type *acceptMutator( Mutator & m ) = 0;
    183         virtual void print( std::ostream & os, Indenter indent = {} ) const;
     183        virtual void print( std::ostream & os, int indent = 0 ) const;
    184184};
    185185
     
    192192        VoidType( const Type::Qualifiers & tq, const std::list< Attribute * > & attributes = std::list< Attribute * >() );
    193193
    194         virtual unsigned size() const override { return 0; };
    195         virtual bool isComplete() const override { return false; }
    196 
    197         virtual VoidType *clone() const override { return new VoidType( *this ); }
    198         virtual void accept( Visitor & v ) override { v.visit( this ); }
    199         virtual Type *acceptMutator( Mutator & m ) override { return m.mutate( this ); }
    200         virtual void print( std::ostream & os, Indenter indent = {} ) const override;
     194        virtual unsigned size() const { return 0; };
     195        virtual bool isComplete() const { return false; }
     196
     197        virtual VoidType *clone() const { return new VoidType( *this ); }
     198        virtual void accept( Visitor & v ) { v.visit( this ); }
     199        virtual Type *acceptMutator( Mutator & m ) { return m.mutate( this ); }
     200        virtual void print( std::ostream & os, int indent = 0 ) const;
    201201};
    202202
     
    225225                DoubleImaginary,
    226226                LongDoubleImaginary,
    227                 SignedInt128,
    228                 UnsignedInt128,
    229227                NUMBER_OF_BASIC_TYPES
    230228        } kind;
     
    237235        void set_kind( Kind newValue ) { kind = newValue; }
    238236
    239         virtual BasicType *clone() const override { return new BasicType( *this ); }
    240         virtual void accept( Visitor & v ) override { v.visit( this ); }
    241         virtual Type *acceptMutator( Mutator & m ) override { return m.mutate( this ); }
    242         virtual void print( std::ostream & os, Indenter indent = {} ) const override;
     237        virtual BasicType *clone() const { return new BasicType( *this ); }
     238        virtual void accept( Visitor & v ) { v.visit( this ); }
     239        virtual Type *acceptMutator( Mutator & m ) { return m.mutate( this ); }
     240        virtual void print( std::ostream & os, int indent = 0 ) const;
    243241
    244242        bool isInteger() const;
     
    270268        bool is_array() const { return isStatic || isVarLen || dimension; }
    271269
    272         virtual bool isComplete() const override { return ! isVarLen; }
    273 
    274         virtual PointerType *clone() const override { return new PointerType( *this ); }
    275         virtual void accept( Visitor & v ) override { v.visit( this ); }
    276         virtual Type *acceptMutator( Mutator & m ) override { return m.mutate( this ); }
    277         virtual void print( std::ostream & os, Indenter indent = {} ) const override;
     270        virtual bool isComplete() const { return ! isVarLen; }
     271
     272        virtual PointerType *clone() const { return new PointerType( *this ); }
     273        virtual void accept( Visitor & v ) { v.visit( this ); }
     274        virtual Type *acceptMutator( Mutator & m ) { return m.mutate( this ); }
     275        virtual void print( std::ostream & os, int indent = 0 ) const;
    278276};
    279277
     
    298296        void set_isStatic( bool newValue ) { isStatic = newValue; }
    299297
    300         // array types are complete if they have a dimension expression or are
    301         // VLAs ('*' in parameter declaration), and incomplete otherwise.
    302         // See 6.7.6.2
    303         virtual bool isComplete() const override { return dimension || isVarLen; }
    304 
    305         virtual ArrayType *clone() const override { return new ArrayType( *this ); }
    306         virtual void accept( Visitor & v ) override { v.visit( this ); }
    307         virtual Type *acceptMutator( Mutator & m ) override { return m.mutate( this ); }
    308         virtual void print( std::ostream & os, Indenter indent = {} ) const override;
     298        virtual bool isComplete() const { return ! isVarLen; }
     299
     300        virtual ArrayType *clone() const { return new ArrayType( *this ); }
     301        virtual void accept( Visitor & v ) { v.visit( this ); }
     302        virtual Type *acceptMutator( Mutator & m ) { return m.mutate( this ); }
     303        virtual void print( std::ostream & os, int indent = 0 ) const;
    309304};
    310305
     
    320315        void set_base( Type *newValue ) { base = newValue; }
    321316
    322         virtual int referenceDepth() const override;
     317        virtual int referenceDepth() const;
    323318
    324319        // Since reference types act like value types, their size is the size of the base.
    325320        // This makes it simple to cast the empty tuple to a reference type, since casts that increase
    326321        // the number of values are disallowed.
    327         virtual unsigned size() const override { return base->size(); }
    328 
    329         virtual ReferenceType *clone() const override { return new ReferenceType( *this ); }
    330         virtual void accept( Visitor & v ) override { v.visit( this ); }
    331         virtual Type *acceptMutator( Mutator & m ) override { return m.mutate( this ); }
    332         virtual void print( std::ostream & os, Indenter indent = {} ) const override;
     322        virtual unsigned size() const { return base->size(); }
     323
     324        virtual ReferenceType *clone() const { return new ReferenceType( *this ); }
     325        virtual void accept( Visitor & v ) { v.visit( this ); }
     326        virtual Type *acceptMutator( Mutator & m ) { return m.mutate( this ); }
     327        virtual void print( std::ostream & os, int indent = 0 ) const;
    333328};
    334329
     
    354349        bool isTtype() const;
    355350
    356         virtual FunctionType *clone() const override { return new FunctionType( *this ); }
    357         virtual void accept( Visitor & v ) override { v.visit( this ); }
    358         virtual Type *acceptMutator( Mutator & m ) override { return m.mutate( this ); }
    359         virtual void print( std::ostream & os, Indenter indent = {} ) const override;
     351        virtual FunctionType *clone() const { return new FunctionType( *this ); }
     352        virtual void accept( Visitor & v ) { v.visit( this ); }
     353        virtual Type *acceptMutator( Mutator & m ) { return m.mutate( this ); }
     354        virtual void print( std::ostream & os, int indent = 0 ) const;
    360355};
    361356
     
    376371        void set_hoistType( bool newValue ) { hoistType = newValue; }
    377372
    378         virtual ReferenceToType *clone() const override = 0;
    379         virtual void accept( Visitor & v ) override = 0;
    380         virtual Type *acceptMutator( Mutator & m ) override = 0;
    381         virtual void print( std::ostream & os, Indenter indent = {} ) const override;
     373        virtual ReferenceToType *clone() const = 0;
     374        virtual void accept( Visitor & v ) = 0;
     375        virtual Type *acceptMutator( Mutator & m ) = 0;
     376        virtual void print( std::ostream & os, int indent = 0 ) const;
    382377
    383378        virtual void lookup( __attribute__((unused)) const std::string & name, __attribute__((unused)) std::list< Declaration* > & foundDecls ) const {}
     
    403398        std::list<TypeDecl*> * get_baseParameters();
    404399
    405         virtual bool isComplete() const override;
     400        virtual bool isComplete() const;
    406401
    407402        /// Looks up the members of this struct named "name" and places them into "foundDecls".
    408403        /// Clones declarations into "foundDecls", caller responsible for freeing
    409         void lookup( const std::string & name, std::list< Declaration* > & foundDecls ) const override;
    410 
    411         virtual StructInstType *clone() const override { return new StructInstType( *this ); }
    412         virtual void accept( Visitor & v ) override { v.visit( this ); }
    413         virtual Type *acceptMutator( Mutator & m ) override { return m.mutate( this ); }
    414 
    415         virtual void print( std::ostream & os, Indenter indent = {} ) const override;
     404        void lookup( const std::string & name, std::list< Declaration* > & foundDecls ) const;
     405
     406        virtual StructInstType *clone() const { return new StructInstType( *this ); }
     407        virtual void accept( Visitor & v ) { v.visit( this ); }
     408        virtual Type *acceptMutator( Mutator & m ) { return m.mutate( this ); }
     409
     410        virtual void print( std::ostream & os, int indent = 0 ) const;
    416411  private:
    417         virtual std::string typeString() const override;
     412        virtual std::string typeString() const;
    418413};
    419414
     
    435430        std::list< TypeDecl * > * get_baseParameters();
    436431
    437         virtual bool isComplete() const override;
     432        virtual bool isComplete() const;
    438433
    439434        /// looks up the members of this union named "name" and places them into "foundDecls"
    440435        /// Clones declarations into "foundDecls", caller responsible for freeing
    441         void lookup( const std::string & name, std::list< Declaration* > & foundDecls ) const override;
    442 
    443         virtual UnionInstType *clone() const override { return new UnionInstType( *this ); }
    444         virtual void accept( Visitor & v ) override { v.visit( this ); }
    445         virtual Type *acceptMutator( Mutator & m ) override { return m.mutate( this ); }
    446 
    447         virtual void print( std::ostream & os, Indenter indent = {} ) const override;
     436        void lookup( const std::string & name, std::list< Declaration* > & foundDecls ) const;
     437
     438        virtual UnionInstType *clone() const { return new UnionInstType( *this ); }
     439        virtual void accept( Visitor & v ) { v.visit( this ); }
     440        virtual Type *acceptMutator( Mutator & m ) { return m.mutate( this ); }
     441
     442        virtual void print( std::ostream & os, int indent = 0 ) const;
    448443  private:
    449         virtual std::string typeString() const override;
     444        virtual std::string typeString() const;
    450445};
    451446
     
    464459        void set_baseEnum( EnumDecl *newValue ) { baseEnum = newValue; }
    465460
    466         virtual bool isComplete() const override;
    467 
    468         virtual EnumInstType *clone() const override { return new EnumInstType( *this ); }
    469         virtual void accept( Visitor & v ) override { v.visit( this ); }
    470         virtual Type *acceptMutator( Mutator & m ) override { return m.mutate( this ); }
    471 
    472         virtual void print( std::ostream & os, Indenter indent = {} ) const override;
     461        virtual bool isComplete() const;
     462
     463        virtual EnumInstType *clone() const { return new EnumInstType( *this ); }
     464        virtual void accept( Visitor & v ) { v.visit( this ); }
     465        virtual Type *acceptMutator( Mutator & m ) { return m.mutate( this ); }
    473466  private:
    474         virtual std::string typeString() const override;
     467        virtual std::string typeString() const;
    475468};
    476469
     
    487480        ~TraitInstType();
    488481
    489         virtual bool isComplete() const override;
    490 
    491         virtual TraitInstType *clone() const override { return new TraitInstType( *this ); }
    492         virtual void accept( Visitor & v ) override { v.visit( this ); }
    493         virtual Type *acceptMutator( Mutator & m ) override { return m.mutate( this ); }
     482        virtual bool isComplete() const;
     483
     484        virtual TraitInstType *clone() const { return new TraitInstType( *this ); }
     485        virtual void accept( Visitor & v ) { v.visit( this ); }
     486        virtual Type *acceptMutator( Mutator & m ) { return m.mutate( this ); }
    494487  private:
    495         virtual std::string typeString() const override;
     488        virtual std::string typeString() const;
    496489};
    497490
     
    514507        void set_isFtype( bool newValue ) { isFtype = newValue; }
    515508
    516         virtual bool isComplete() const override;
    517 
    518         virtual TypeInstType *clone() const override { return new TypeInstType( *this ); }
    519         virtual void accept( Visitor & v ) override { v.visit( this ); }
    520         virtual Type *acceptMutator( Mutator & m ) override { return m.mutate( this ); }
    521         virtual void print( std::ostream & os, Indenter indent = {} ) const override;
     509        virtual bool isComplete() const;
     510
     511        virtual TypeInstType *clone() const { return new TypeInstType( *this ); }
     512        virtual void accept( Visitor & v ) { v.visit( this ); }
     513        virtual Type *acceptMutator( Mutator & m ) { return m.mutate( this ); }
     514        virtual void print( std::ostream & os, int indent = 0 ) const;
    522515  private:
    523         virtual std::string typeString() const override;
     516        virtual std::string typeString() const;
    524517};
    525518
     
    537530
    538531        std::list<Type *> & get_types() { return types; }
    539         virtual unsigned size() const override { return types.size(); };
     532        virtual unsigned size() const { return types.size(); };
    540533
    541534        // For now, this is entirely synthetic -- tuple types always have unnamed members.
     
    546539        iterator end() { return types.end(); }
    547540
    548         virtual Type * getComponent( unsigned i ) override {
     541        virtual Type * getComponent( unsigned i ) {
    549542                assertf( i < size(), "TupleType::getComponent: index %d must be less than size %d", i, size() );
    550543                return *(begin()+i);
    551544        }
    552545
    553         // virtual bool isComplete() const override { return true; } // xxx - not sure if this is right, might need to recursively check complete-ness
    554 
    555         virtual TupleType *clone() const override { return new TupleType( *this ); }
    556         virtual void accept( Visitor & v ) override { v.visit( this ); }
    557         virtual Type *acceptMutator( Mutator & m ) override { return m.mutate( this ); }
    558         virtual void print( std::ostream & os, Indenter indent = {} ) const override;
     546        // virtual bool isComplete() const { return true; } // xxx - not sure if this is right, might need to recursively check complete-ness
     547
     548        virtual TupleType *clone() const { return new TupleType( *this ); }
     549        virtual void accept( Visitor & v ) { v.visit( this ); }
     550        virtual Type *acceptMutator( Mutator & m ) { return m.mutate( this ); }
     551        virtual void print( std::ostream & os, int indent = 0 ) const;
    559552};
    560553
     
    570563        void set_expr( Expression *newValue ) { expr = newValue; }
    571564
    572         virtual bool isComplete() const override { assert( false ); return false; }
    573 
    574         virtual TypeofType *clone() const override { return new TypeofType( *this ); }
    575         virtual void accept( Visitor & v ) override { v.visit( this ); }
    576         virtual Type *acceptMutator( Mutator & m ) override { return m.mutate( this ); }
    577         virtual void print( std::ostream & os, Indenter indent = {} ) const override;
     565        virtual bool isComplete() const { assert( false ); return false; }
     566
     567        virtual TypeofType *clone() const { return new TypeofType( *this ); }
     568        virtual void accept( Visitor & v ) { v.visit( this ); }
     569        virtual Type *acceptMutator( Mutator & m ) { return m.mutate( this ); }
     570        virtual void print( std::ostream & os, int indent = 0 ) const;
    578571};
    579572
     
    599592        void set_isType( bool newValue ) { isType = newValue; }
    600593
    601         virtual bool isComplete() const override { assert( false ); } // xxx - not sure what to do here
    602 
    603         virtual AttrType *clone() const override { return new AttrType( *this ); }
    604         virtual void accept( Visitor & v ) override { v.visit( this ); }
    605         virtual Type *acceptMutator( Mutator & m ) override { return m.mutate( this ); }
    606         virtual void print( std::ostream & os, Indenter indent = {} ) const override;
     594        virtual bool isComplete() const { assert( false ); } // xxx - not sure what to do here
     595
     596        virtual AttrType *clone() const { return new AttrType( *this ); }
     597        virtual void accept( Visitor & v ) { v.visit( this ); }
     598        virtual Type *acceptMutator( Mutator & m ) { return m.mutate( this ); }
     599        virtual void print( std::ostream & os, int indent = 0 ) const;
    607600};
    608601
     
    613606        VarArgsType( Type::Qualifiers tq, const std::list< Attribute * > & attributes = std::list< Attribute * >()  );
    614607
    615         virtual bool isComplete() const override{ return true; } // xxx - is this right?
    616 
    617         virtual VarArgsType *clone() const override { return new VarArgsType( *this ); }
    618         virtual void accept( Visitor & v ) override { v.visit( this ); }
    619         virtual Type *acceptMutator( Mutator & m ) override { return m.mutate( this ); }
    620         virtual void print( std::ostream & os, Indenter indent = {} ) const override;
     608        virtual bool isComplete() const{ return true; } // xxx - is this right?
     609
     610        virtual VarArgsType *clone() const { return new VarArgsType( *this ); }
     611        virtual void accept( Visitor & v ) { v.visit( this ); }
     612        virtual Type *acceptMutator( Mutator & m ) { return m.mutate( this ); }
     613        virtual void print( std::ostream & os, int indent = 0 ) const;
    621614};
    622615
     
    627620        ZeroType( Type::Qualifiers tq, const std::list< Attribute * > & attributes = std::list< Attribute * >()  );
    628621
    629         virtual ZeroType *clone() const override { return new ZeroType( *this ); }
    630         virtual void accept( Visitor & v ) override { v.visit( this ); }
    631         virtual Type *acceptMutator( Mutator & m ) override { return m.mutate( this ); }
    632         virtual void print( std::ostream & os, Indenter indent = {} ) const override;
     622        virtual ZeroType *clone() const { return new ZeroType( *this ); }
     623        virtual void accept( Visitor & v ) { v.visit( this ); }
     624        virtual Type *acceptMutator( Mutator & m ) { return m.mutate( this ); }
     625        virtual void print( std::ostream & os, int indent = 0 ) const;
    633626};
    634627
     
    639632        OneType( Type::Qualifiers tq, const std::list< Attribute * > & attributes = std::list< Attribute * >()  );
    640633
    641         virtual OneType *clone() const override { return new OneType( *this ); }
    642         virtual void accept( Visitor & v ) override { v.visit( this ); }
    643         virtual Type *acceptMutator( Mutator & m ) override { return m.mutate( this ); }
    644         virtual void print( std::ostream & os, Indenter indent = {} ) const override;
    645 };
     634        virtual OneType *clone() const { return new OneType( *this ); }
     635        virtual void accept( Visitor & v ) { v.visit( this ); }
     636        virtual Type *acceptMutator( Mutator & m ) { return m.mutate( this ); }
     637        virtual void print( std::ostream & os, int indent = 0 ) const;
     638};
     639
     640std::ostream & operator<<( std::ostream & out, const Type * type );
    646641
    647642// Local Variables: //
  • src/SynTree/TypeDecl.cc

    r3f7e12cb r78315272  
    2121#include "Type.h"            // for Type, Type::StorageClasses
    2222
    23 TypeDecl::TypeDecl( const std::string &name, Type::StorageClasses scs, Type *type, Kind kind, bool sized, Type * init ) : Parent( name, scs, type ), init( init ), sized( kind == Ttype || sized ), kind( kind ) {
     23TypeDecl::TypeDecl( const std::string &name, Type::StorageClasses scs, Type *type, Kind kind, Type * init ) : Parent( name, scs, type ), init( init ), sized( kind == Any || kind == Ttype ), kind( kind ) {
    2424}
    2525
     
    3232
    3333std::string TypeDecl::typeString() const {
    34         static const std::string kindNames[] = { "object type", "function type", "tuple type" };
    35         assertf( sizeof(kindNames)/sizeof(kindNames[0]) == DeclarationNode::NoTypeClass-1, "typeString: kindNames is out of sync." );
    36         assertf( kind < sizeof(kindNames)/sizeof(kindNames[0]), "TypeDecl's kind is out of bounds." );
    37         return (isComplete() ? "sized " : "") + kindNames[ kind ];
     34        static const std::string kindNames[] = { "type", "incomplete type", "function type", "tuple type" };
     35        return (kind != Any && isComplete() ? "sized " : "") + kindNames[ kind ];
    3836}
    3937
    4038std::string TypeDecl::genTypeString() const {
    41         static const std::string kindNames[] = { "dtype", "ftype", "ttype" };
    42         assertf( sizeof(kindNames)/sizeof(kindNames[0]) == DeclarationNode::NoTypeClass-1, "genTypeString: kindNames is out of sync." );
    43         assertf( kind < sizeof(kindNames)/sizeof(kindNames[0]), "TypeDecl's kind is out of bounds." );
     39        static const std::string kindNames[] = { "otype", "dtype", "ftype", "ttype" };
    4440        return kindNames[ kind ];
    4541}
    4642
    47 void TypeDecl::print( std::ostream &os, Indenter indent ) const {
     43void TypeDecl::print( std::ostream &os, int indent ) const {
    4844  NamedTypeDecl::print( os, indent );
    4945  if ( init ) {
    50     os << std::endl << indent << "with type initializer: ";
    51     init->print( os, indent + 1 );
     46    os << std::endl << std::string( indent, ' ' ) << "with type initializer: ";
     47    init->print( os, indent + 2 );
    5248  }
    5349}
  • src/SynTree/TypeExpr.cc

    r3f7e12cb r78315272  
    3030}
    3131
    32 void TypeExpr::print( std::ostream &os, Indenter indent ) const {
     32void TypeExpr::print( std::ostream &os, int indent ) const {
    3333        if ( type ) type->print( os, indent );
    3434        Expression::print( os, indent );
  • src/SynTree/TypeSubstitution.cc

    r3f7e12cb r78315272  
    148148template< typename TypeClass >
    149149Type *TypeSubstitution::handleType( TypeClass *type ) {
    150         ValueGuard<BoundVarsType> oldBoundVars( boundVars );
     150        BoundVarsType oldBoundVars( boundVars );
    151151        // bind type variables from forall-qualifiers
    152152        if ( freeOnly ) {
     
    156156        } // if
    157157        Type *ret = Mutator::mutate( type );
     158        boundVars = oldBoundVars;
    158159        return ret;
    159160}
     
    161162template< typename TypeClass >
    162163Type *TypeSubstitution::handleAggregateType( TypeClass *type ) {
    163         ValueGuard<BoundVarsType> oldBoundVars( boundVars );
     164        BoundVarsType oldBoundVars( boundVars );
    164165        // bind type variables from forall-qualifiers
    165166        if ( freeOnly ) {
     
    176177        } // if
    177178        Type *ret = Mutator::mutate( type );
     179        boundVars = oldBoundVars;
    178180        return ret;
    179181}
     
    231233}
    232234
    233 void TypeSubstitution::print( std::ostream &os, Indenter indent ) const {
    234         os << indent << "Types:" << std::endl;
     235TypeSubstitution * TypeSubstitution::acceptMutator( Mutator & mutator ) {
     236        for ( auto & p : typeEnv ) {
     237                p.second = maybeMutate( p.second, mutator );
     238        }
     239        for ( auto & p : varEnv ) {
     240                p.second = maybeMutate( p.second, mutator );
     241        }
     242        return this;
     243}
     244
     245void TypeSubstitution::print( std::ostream &os, int indent ) const {
     246        os << std::string( indent, ' ' ) << "Types:" << std::endl;
    235247        for ( TypeEnvType::const_iterator i = typeEnv.begin(); i != typeEnv.end(); ++i ) {
    236                 os << indent+1 << i->first << " -> ";
    237                 i->second->print( os, indent+2 );
     248                os << std::string( indent+2, ' ' ) << i->first << " -> ";
     249                i->second->print( os, indent+4 );
    238250                os << std::endl;
    239251        } // for
    240         os << indent << "Non-types:" << std::endl;
     252        os << std::string( indent, ' ' ) << "Non-types:" << std::endl;
    241253        for ( VarEnvType::const_iterator i = varEnv.begin(); i != varEnv.end(); ++i ) {
    242                 os << indent+1 << i->first << " -> ";
    243                 i->second->print( os, indent+2 );
     254                os << std::string( indent+2, ' ' ) << i->first << " -> ";
     255                i->second->print( os, indent+4 );
    244256                os << std::endl;
    245257        } // for
  • src/SynTree/TypeSubstitution.h

    r3f7e12cb r78315272  
    5959        void normalize();
    6060
    61         TypeSubstitution * acceptMutator( Mutator & m ) { return m.mutate( this ); }
     61        TypeSubstitution * acceptMutator( Mutator & mutator );
    6262
    63         void print( std::ostream &os, Indenter indent = {} ) const;
     63        void print( std::ostream &os, int indent = 0 ) const;
    6464        TypeSubstitution *clone() const { return new TypeSubstitution( *this ); }
    6565  private:
     
    8989
    9090        void initialize( const TypeSubstitution &src, TypeSubstitution &dest );
    91 
    92         friend class Mutator;
    93 
    94         template<typename pass_type>
    95         friend class PassVisitor;
    9691
    9792        typedef std::map< std::string, Type* > TypeEnvType;
  • src/SynTree/TypeofType.cc

    r3f7e12cb r78315272  
    55// file "LICENCE" distributed with Cforall.
    66//
    7 // TypeofType.cc --
     7// TypeofType.cc -- 
    88//
    99// Author           : Richard C. Bilson
     
    3333}
    3434
    35 void TypeofType::print( std::ostream &os, Indenter indent ) const {
     35void TypeofType::print( std::ostream &os, int indent ) const {
    3636        Type::print( os, indent );
    3737        os << "type-of expression ";
  • src/SynTree/VarArgsType.cc

    r3f7e12cb r78315272  
    2525VarArgsType::VarArgsType( Type::Qualifiers tq, const std::list< Attribute * > & attributes ) : Type( tq, attributes ) {}
    2626
    27 void VarArgsType::print( std::ostream &os, Indenter indent ) const {
     27void VarArgsType::print( std::ostream &os, int indent ) const {
    2828        Type::print( os, indent );
    2929        os << "builtin var args pack";
  • src/SynTree/VarExprReplacer.h

    r3f7e12cb r78315272  
    2929private:
    3030        const DeclMap & declMap;
    31         bool debug;
     31  bool debug;
    3232public:
    3333        VarExprReplacer( const DeclMap & declMap, bool debug = false );
     
    3535        // replace variable with new node from decl map
    3636        virtual void visit( VariableExpr * varExpr );
    37 
    38         static void replace( BaseSyntaxNode * node, const DeclMap & declMap, bool debug = false ) {
    39                 VarExprReplacer replacer( declMap, debug );
    40                 maybeAccept( node, replacer );
    41         }
    4237};
    4338
  • src/SynTree/Visitor.cc

    r3f7e12cb r78315272  
    1717#include <list>           // for list
    1818
    19 #include "Attribute.h"    // for Attribute
    2019#include "Constant.h"     // for Constant
    2120#include "Declaration.h"  // for DeclarationWithType, ObjectDecl, Declaration
     
    3635        maybeAccept( objectDecl->get_init(), *this );
    3736        maybeAccept( objectDecl->get_bitfieldWidth(), *this );
    38         acceptAll( objectDecl->attributes, *this );
    3937}
    4038
     
    4240        maybeAccept( functionDecl->get_functionType(), *this );
    4341        maybeAccept( functionDecl->get_statements(), *this );
    44         acceptAll( functionDecl->attributes, *this );
    4542}
    4643
     
    490487
    491488
    492 void Visitor::visit( Subrange * ) {}
    493 
    494 
    495 void Visitor::visit( Constant * ) {}
    496 
    497 void Visitor::visit( Attribute * attribute ) {
    498         acceptAll( attribute->parameters, *this );
    499 }
    500 
     489void Visitor::visit( __attribute__((unused)) Subrange *subrange ) {}
     490
     491
     492void Visitor::visit( __attribute__((unused)) Constant *constant ) {}
    501493// Local Variables: //
    502494// tab-width: 4 //
  • src/SynTree/Visitor.h

    r3f7e12cb r78315272  
    2525  public:
    2626        // visit: Default implementation of all functions visits the children
    27         // of the given syntax node, but performs no other action.
     27    // of the given syntax node, but performs no other action.
    2828
    29         virtual void visit( ObjectDecl * objectDecl );
    30         virtual void visit( FunctionDecl * functionDecl );
    31         virtual void visit( StructDecl * aggregateDecl );
    32         virtual void visit( UnionDecl * aggregateDecl );
    33         virtual void visit( EnumDecl * aggregateDecl );
    34         virtual void visit( TraitDecl * aggregateDecl );
    35         virtual void visit( TypeDecl * typeDecl );
    36         virtual void visit( TypedefDecl * typeDecl );
    37         virtual void visit( AsmDecl * asmDecl );
     29        virtual void visit( ObjectDecl *objectDecl );
     30        virtual void visit( FunctionDecl *functionDecl );
     31        virtual void visit( StructDecl *aggregateDecl );
     32        virtual void visit( UnionDecl *aggregateDecl );
     33        virtual void visit( EnumDecl *aggregateDecl );
     34        virtual void visit( TraitDecl *aggregateDecl );
     35        virtual void visit( TypeDecl *typeDecl );
     36        virtual void visit( TypedefDecl *typeDecl );
     37        virtual void visit( AsmDecl *asmDecl );
    3838
    39         virtual void visit( CompoundStmt * compoundStmt );
    40         virtual void visit( ExprStmt * exprStmt );
    41         virtual void visit( AsmStmt * asmStmt );
    42         virtual void visit( IfStmt * ifStmt );
    43         virtual void visit( WhileStmt * whileStmt );
    44         virtual void visit( ForStmt * forStmt );
    45         virtual void visit( SwitchStmt * switchStmt );
    46         virtual void visit( CaseStmt * caseStmt );
    47         virtual void visit( BranchStmt * branchStmt );
    48         virtual void visit( ReturnStmt * returnStmt );
    49         virtual void visit( ThrowStmt * throwStmt );
    50         virtual void visit( TryStmt * tryStmt );
    51         virtual void visit( CatchStmt * catchStmt );
    52         virtual void visit( FinallyStmt * finallyStmt );
    53         virtual void visit( WaitForStmt * waitforStmt );
    54         virtual void visit( NullStmt * nullStmt );
    55         virtual void visit( DeclStmt * declStmt );
    56         virtual void visit( ImplicitCtorDtorStmt * impCtorDtorStmt );
     39        virtual void visit( CompoundStmt *compoundStmt );
     40        virtual void visit( ExprStmt *exprStmt );
     41        virtual void visit( AsmStmt *asmStmt );
     42        virtual void visit( IfStmt *ifStmt );
     43        virtual void visit( WhileStmt *whileStmt );
     44        virtual void visit( ForStmt *forStmt );
     45        virtual void visit( SwitchStmt *switchStmt );
     46        virtual void visit( CaseStmt *caseStmt );
     47        virtual void visit( BranchStmt *branchStmt );
     48        virtual void visit( ReturnStmt *returnStmt );
     49        virtual void visit( ThrowStmt *throwStmt );
     50        virtual void visit( TryStmt *tryStmt );
     51        virtual void visit( CatchStmt *catchStmt );
     52        virtual void visit( FinallyStmt *finallyStmt );
     53        virtual void visit( WaitForStmt *waitforStmt );
     54        virtual void visit( NullStmt *nullStmt );
     55        virtual void visit( DeclStmt *declStmt );
     56        virtual void visit( ImplicitCtorDtorStmt *impCtorDtorStmt );
    5757
    58         virtual void visit( ApplicationExpr * applicationExpr );
    59         virtual void visit( UntypedExpr * untypedExpr );
    60         virtual void visit( NameExpr * nameExpr );
    61         virtual void visit( CastExpr * castExpr );
    62         virtual void visit( VirtualCastExpr * castExpr );
    63         virtual void visit( AddressExpr * addressExpr );
    64         virtual void visit( LabelAddressExpr * labAddressExpr );
    65         virtual void visit( UntypedMemberExpr * memberExpr );
    66         virtual void visit( MemberExpr * memberExpr );
    67         virtual void visit( VariableExpr * variableExpr );
    68         virtual void visit( ConstantExpr * constantExpr );
    69         virtual void visit( SizeofExpr * sizeofExpr );
    70         virtual void visit( AlignofExpr * alignofExpr );
    71         virtual void visit( UntypedOffsetofExpr * offsetofExpr );
    72         virtual void visit( OffsetofExpr * offsetofExpr );
    73         virtual void visit( OffsetPackExpr * offsetPackExpr );
    74         virtual void visit( AttrExpr * attrExpr );
    75         virtual void visit( LogicalExpr * logicalExpr );
    76         virtual void visit( ConditionalExpr * conditionalExpr );
    77         virtual void visit( CommaExpr * commaExpr );
    78         virtual void visit( TypeExpr * typeExpr );
    79         virtual void visit( AsmExpr * asmExpr );
    80         virtual void visit( ImplicitCopyCtorExpr * impCpCtorExpr );
    81         virtual void visit( ConstructorExpr *  ctorExpr );
    82         virtual void visit( CompoundLiteralExpr * compLitExpr );
    83         virtual void visit( RangeExpr * rangeExpr );
    84         virtual void visit( UntypedTupleExpr * tupleExpr );
    85         virtual void visit( TupleExpr * tupleExpr );
    86         virtual void visit( TupleIndexExpr * tupleExpr );
    87         virtual void visit( TupleAssignExpr * assignExpr );
    88         virtual void visit( StmtExpr *  stmtExpr );
    89         virtual void visit( UniqueExpr *  uniqueExpr );
    90         virtual void visit( UntypedInitExpr *  initExpr );
    91         virtual void visit( InitExpr *  initExpr );
     58        virtual void visit( ApplicationExpr *applicationExpr );
     59        virtual void visit( UntypedExpr *untypedExpr );
     60        virtual void visit( NameExpr *nameExpr );
     61        virtual void visit( CastExpr *castExpr );
     62        virtual void visit( VirtualCastExpr *castExpr );
     63        virtual void visit( AddressExpr *addressExpr );
     64        virtual void visit( LabelAddressExpr *labAddressExpr );
     65        virtual void visit( UntypedMemberExpr *memberExpr );
     66        virtual void visit( MemberExpr *memberExpr );
     67        virtual void visit( VariableExpr *variableExpr );
     68        virtual void visit( ConstantExpr *constantExpr );
     69        virtual void visit( SizeofExpr *sizeofExpr );
     70        virtual void visit( AlignofExpr *alignofExpr );
     71        virtual void visit( UntypedOffsetofExpr *offsetofExpr );
     72        virtual void visit( OffsetofExpr *offsetofExpr );
     73        virtual void visit( OffsetPackExpr *offsetPackExpr );
     74        virtual void visit( AttrExpr *attrExpr );
     75        virtual void visit( LogicalExpr *logicalExpr );
     76        virtual void visit( ConditionalExpr *conditionalExpr );
     77        virtual void visit( CommaExpr *commaExpr );
     78        virtual void visit( TypeExpr *typeExpr );
     79        virtual void visit( AsmExpr *asmExpr );
     80        virtual void visit( ImplicitCopyCtorExpr *impCpCtorExpr );
     81        virtual void visit( ConstructorExpr * ctorExpr );
     82        virtual void visit( CompoundLiteralExpr *compLitExpr );
     83        virtual void visit( RangeExpr *rangeExpr );
     84        virtual void visit( UntypedTupleExpr *tupleExpr );
     85        virtual void visit( TupleExpr *tupleExpr );
     86        virtual void visit( TupleIndexExpr *tupleExpr );
     87        virtual void visit( TupleAssignExpr *assignExpr );
     88        virtual void visit( StmtExpr * stmtExpr );
     89        virtual void visit( UniqueExpr * uniqueExpr );
     90        virtual void visit( UntypedInitExpr * initExpr );
     91        virtual void visit( InitExpr * initExpr );
    9292
    93         virtual void visit( VoidType * basicType );
    94         virtual void visit( BasicType * basicType );
    95         virtual void visit( PointerType * pointerType );
    96         virtual void visit( ArrayType * arrayType );
    97         virtual void visit( ReferenceType * refType );
    98         virtual void visit( FunctionType * functionType );
    99         virtual void visit( StructInstType * aggregateUseType );
    100         virtual void visit( UnionInstType * aggregateUseType );
    101         virtual void visit( EnumInstType * aggregateUseType );
    102         virtual void visit( TraitInstType * aggregateUseType );
    103         virtual void visit( TypeInstType * aggregateUseType );
    104         virtual void visit( TupleType * tupleType );
    105         virtual void visit( TypeofType * typeofType );
    106         virtual void visit( AttrType * attrType );
    107         virtual void visit( VarArgsType * varArgsType );
    108         virtual void visit( ZeroType * zeroType );
    109         virtual void visit( OneType * oneType );
     93        virtual void visit( VoidType *basicType );
     94        virtual void visit( BasicType *basicType );
     95        virtual void visit( PointerType *pointerType );
     96        virtual void visit( ArrayType *arrayType );
     97        virtual void visit( ReferenceType *refType );
     98        virtual void visit( FunctionType *functionType );
     99        virtual void visit( StructInstType *aggregateUseType );
     100        virtual void visit( UnionInstType *aggregateUseType );
     101        virtual void visit( EnumInstType *aggregateUseType );
     102        virtual void visit( TraitInstType *aggregateUseType );
     103        virtual void visit( TypeInstType *aggregateUseType );
     104        virtual void visit( TupleType *tupleType );
     105        virtual void visit( TypeofType *typeofType );
     106        virtual void visit( AttrType *attrType );
     107        virtual void visit( VarArgsType *varArgsType );
     108        virtual void visit( ZeroType *zeroType );
     109        virtual void visit( OneType *oneType );
    110110
    111         virtual void visit( Designation * designation );
    112         virtual void visit( SingleInit * singleInit );
    113         virtual void visit( ListInit * listInit );
    114         virtual void visit( ConstructorInit * ctorInit );
     111        virtual void visit( Designation *designation );
     112        virtual void visit( SingleInit *singleInit );
     113        virtual void visit( ListInit *listInit );
     114        virtual void visit( ConstructorInit *ctorInit );
    115115
    116         virtual void visit( Subrange * subrange );
     116        virtual void visit( Subrange *subrange );
    117117
    118         virtual void visit( Constant * constant );
    119 
    120         virtual void visit( Attribute * attribute );
     118        virtual void visit( Constant *constant );
    121119  private:
    122120        virtual void handleAggregateDecl( AggregateDecl *aggregateDecl );
  • src/SynTree/VoidType.cc

    r3f7e12cb r78315272  
    55// file "LICENCE" distributed with Cforall.
    66//
    7 // VoidType.cc --
     7// VoidType.cc -- 
    88//
    99// Author           : Richard C. Bilson
     
    2424}
    2525
    26 void VoidType::print( std::ostream &os, Indenter indent ) const {
     26void VoidType::print( std::ostream &os, int indent ) const {
    2727        Type::print( os, indent );
    2828        os << "void ";
  • src/SynTree/ZeroOneType.cc

    r3f7e12cb r78315272  
    2525ZeroType::ZeroType( Type::Qualifiers tq, const std::list< Attribute * > & attributes ) : Type( tq, attributes ) {}
    2626
    27 void ZeroType::print( std::ostream &os, Indenter ) const {
     27void ZeroType::print( std::ostream &os, __attribute__((unused)) int indent ) const {
    2828        os << "zero_t";
    2929}
     
    3333OneType::OneType( Type::Qualifiers tq, const std::list< Attribute * > & attributes ) : Type( tq, attributes ) {}
    3434
    35 void OneType::print( std::ostream &os, Indenter ) const {
     35void OneType::print( std::ostream &os, __attribute__((unused)) int indent ) const {
    3636        os << "one_t";
    3737}
  • src/SynTree/module.mk

    r3f7e12cb r78315272  
    4848       SynTree/Visitor.cc \
    4949       SynTree/Mutator.cc \
     50       SynTree/AddStmtVisitor.cc \
    5051       SynTree/TypeSubstitution.cc \
    5152       SynTree/Attribute.cc \
  • src/Tuples/TupleAssignment.cc

    r3f7e12cb r78315272  
    9595        bool isTuple( Expression *expr ) {
    9696                if ( ! expr ) return false;
    97                 assert( expr->result );
     97                assert( expr->has_result() );
    9898                return dynamic_cast< TupleType * >( expr->get_result()->stripReferences() );
    9999        }
     
    285285
    286286        ObjectDecl * TupleAssignSpotter::Matcher::newObject( UniqueName & namer, Expression * expr ) {
    287                 assert( expr->result && ! expr->get_result()->isVoid() );
     287                assert( expr->has_result() && ! expr->get_result()->isVoid() );
    288288                ObjectDecl * ret = new ObjectDecl( namer.newName(), Type::StorageClasses(), LinkageSpec::Cforall, nullptr, expr->get_result()->clone(), new SingleInit( expr->clone() ) );
    289289                // if expression type is a reference, don't need to construct anything, a simple initializer is sufficient.
     
    295295                        ctorInit->accept( rm );
    296296                }
    297                 PRINT( std::cerr << "new object: " << ret << std::endl; )
    298297                return ret;
    299298        }
  • src/Tuples/TupleExpansion.cc

    r3f7e12cb r78315272  
    2121#include "Common/ScopedMap.h"     // for ScopedMap
    2222#include "Common/utility.h"       // for CodeLocation
     23#include "GenPoly/DeclMutator.h"  // for DeclMutator
    2324#include "InitTweak/InitTweak.h"  // for getFunction
    2425#include "Parser/LinkageSpec.h"   // for Spec, C, Intrinsic
     
    204205                        decl->set_body( true );
    205206                        for ( size_t i = 0; i < tupleSize; ++i ) {
    206                                 TypeDecl * tyParam = new TypeDecl( toString( "tuple_param_", tupleSize, "_", i ), Type::StorageClasses(), nullptr, TypeDecl::Dtype, true );
     207                                TypeDecl * tyParam = new TypeDecl( toString( "tuple_param_", tupleSize, "_", i ), Type::StorageClasses(), nullptr, TypeDecl::Any );
    207208                                decl->get_members().push_back( new ObjectDecl( toString("field_", i ), Type::StorageClasses(), LinkageSpec::C, nullptr, new TypeInstType( Type::Qualifiers(), tyParam->get_name(), tyParam ), nullptr ) );
    208209                                decl->get_parameters().push_back( tyParam );
  • src/benchmark/Makefile.am

    r3f7e12cb r78315272  
    1919AM_CFLAGS = -g -Wall -Wno-unused-function -O2
    2020CC = @CFA_BINDIR@/@CFA_NAME@
    21 TOOLSDIR = ${abs_top_srcdir}/tools/
    22 REPEAT   = ${TOOLSDIR}repeat
    23 STATS    = ${TOOLSDIR}stat.py
    24 repeats  = 30
    2521
    26 .NOTPARALLEL:
    27 
    28 noinst_PROGRAMS =
    29 
    30 all : ctxswitch$(EXEEXT) mutex$(EXEEXT) signal$(EXEEXT) waitfor$(EXEEXT) creation$(EXEEXT)
     22noinst_PROGRAMS = bench$(EXEEXT) ctxswitch-coroutine$(EXEEXT) ctxswitch-thread$(EXEEXT) sched-int$(EXEEXT) monitor$(EXEEXT) csv-data$(EXEEXT)
    3123
    3224bench$(EXEEXT) :
     
    3830        rm -f ./a.out ;
    3931
     32ctxswitch-coroutine$(EXEEXT):
     33        ${CC} ${AM_CFLAGS} ${CFLAGS} ${ccflags} @CFA_FLAGS@ -nodebug -lrt -DN=50000000 CorCtxSwitch.c
     34        @rm -f .result.log
     35        @for number in 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20; do \
     36                ./a.out | tee -a .result.log ; \
     37        done
     38        @./stat.py .result.log
     39        @rm -f a.out .result.log
     40
     41ctxswitch-thread$(EXEEXT):
     42        ${CC} ${AM_CFLAGS} ${CFLAGS} ${ccflags} @CFA_FLAGS@ -nodebug -lrt -DN=50000000 ThrdCtxSwitch.c
     43        @rm -f .result.log
     44        @for number in 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20; do \
     45                ./a.out | tee -a .result.log ; \
     46        done
     47        @./stat.py .result.log
     48        @rm -f a.out .result.log
     49
     50sched-int$(EXEEXT):
     51        ${CC} ${AM_CFLAGS} ${CFLAGS} ${ccflags} @CFA_FLAGS@ -nodebug -lrt -DN=50000000 SchedInt.c
     52        @rm -f .result.log
     53        @for number in 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20; do \
     54                ./a.out | tee -a .result.log ; \
     55        done
     56        @./stat.py .result.log
     57        @rm -f a.out .result.log
     58
     59monitor$(EXEEXT):
     60        ${CC} ${AM_CFLAGS} ${CFLAGS} ${ccflags} @CFA_FLAGS@ -nodebug -lrt -DN=50000000 Monitor.c
     61        @rm -f .result.log
     62        @for number in 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20; do \
     63                ./a.out | tee -a .result.log ; \
     64        done
     65        @./stat.py .result.log
     66        @rm -f a.out .result.log
     67
    4068csv-data$(EXEEXT):
    4169        @${CC} ${AM_CFLAGS} ${CFLAGS} ${ccflags} @CFA_FLAGS@ -nodebug -lrt -quiet -DN=50000000 csv-data.c
    4270        @./a.out
    4371        @rm -f ./a.out
    44 
    45 ## =========================================================================================================
    46 ctxswitch$(EXEEXT): \
    47         ctxswitch-pthread.run           \
    48         ctxswitch-cfa_coroutine.run     \
    49         ctxswitch-cfa_thread.run        \
    50         ctxswitch-upp_coroutine.run     \
    51         ctxswitch-upp_thread.run
    52 
    53 ctxswitch-cfa_coroutine$(EXEEXT):
    54         ${CC}        ctxswitch/cfa_cor.c   -DBENCH_N=50000000  -I. -nodebug -lrt -quiet @CFA_FLAGS@ ${AM_CFLAGS} ${CFLAGS} ${ccflags}
    55 
    56 ctxswitch-cfa_thread$(EXEEXT):
    57         ${CC}        ctxswitch/cfa_thrd.c  -DBENCH_N=50000000  -I. -nodebug -lrt -quiet @CFA_FLAGS@ ${AM_CFLAGS} ${CFLAGS} ${ccflags}
    58 
    59 ctxswitch-upp_coroutine$(EXEEXT):
    60         u++          ctxswitch/upp_cor.cc  -DBENCH_N=50000000  -I. -nodebug -lrt -quiet             ${AM_CFLAGS} ${CFLAGS} ${ccflags}
    61 
    62 ctxswitch-upp_thread$(EXEEXT):
    63         u++          ctxswitch/upp_thrd.cc -DBENCH_N=50000000  -I. -nodebug -lrt -quiet             ${AM_CFLAGS} ${CFLAGS} ${ccflags}
    64 
    65 ctxswitch-pthread$(EXEEXT):
    66         @BACKEND_CC@ ctxswitch/pthreads.c  -DBENCH_N=50000000  -I. -lrt -pthread                    ${AM_CFLAGS} ${CFLAGS} ${ccflags}
    67 
    68 ## =========================================================================================================
    69 mutex$(EXEEXT) :\
    70         mutex-function.run      \
    71         mutex-pthread_lock.run  \
    72         mutex-upp.run           \
    73         mutex-cfa1.run          \
    74         mutex-cfa2.run          \
    75         mutex-cfa4.run
    76 
    77 mutex-function$(EXEEXT):
    78         @BACKEND_CC@ mutex/function.c    -DBENCH_N=500000000   -I. -lrt -pthread                    ${AM_CFLAGS} ${CFLAGS} ${ccflags}
    79 
    80 mutex-pthread_lock$(EXEEXT):
    81         @BACKEND_CC@ mutex/pthreads.c    -DBENCH_N=50000000    -I. -lrt -pthread                    ${AM_CFLAGS} ${CFLAGS} ${ccflags}
    82 
    83 mutex-upp$(EXEEXT):
    84         u++          mutex/upp.cc        -DBENCH_N=50000000    -I. -nodebug -lrt -quiet             ${AM_CFLAGS} ${CFLAGS} ${ccflags}
    85 
    86 mutex-cfa1$(EXEEXT):
    87         ${CC}        mutex/cfa1.c        -DBENCH_N=5000000     -I. -nodebug -lrt -quiet @CFA_FLAGS@ ${AM_CFLAGS} ${CFLAGS} ${ccflags}
    88 
    89 mutex-cfa2$(EXEEXT):
    90         ${CC}        mutex/cfa2.c        -DBENCH_N=5000000     -I. -nodebug -lrt -quiet @CFA_FLAGS@ ${AM_CFLAGS} ${CFLAGS} ${ccflags}
    91 
    92 mutex-cfa4$(EXEEXT):
    93         ${CC}        mutex/cfa4.c        -DBENCH_N=5000000     -I. -nodebug -lrt -quiet @CFA_FLAGS@ ${AM_CFLAGS} ${CFLAGS} ${ccflags}
    94 
    95 ## =========================================================================================================
    96 signal$(EXEEXT) :\
    97         signal-upp.run          \
    98         signal-cfa1.run         \
    99         signal-cfa2.run         \
    100         signal-cfa4.run
    101 
    102 signal-upp$(EXEEXT):
    103         u++          schedint/upp.cc     -DBENCH_N=5000000     -I. -nodebug -lrt -quiet             ${AM_CFLAGS} ${CFLAGS} ${ccflags}
    104 
    105 signal-cfa1$(EXEEXT):
    106         ${CC}        schedint/cfa1.c     -DBENCH_N=500000      -I. -nodebug -lrt -quiet @CFA_FLAGS@ ${AM_CFLAGS} ${CFLAGS} ${ccflags}
    107 
    108 signal-cfa2$(EXEEXT):
    109         ${CC}        schedint/cfa2.c     -DBENCH_N=500000      -I. -nodebug -lrt -quiet @CFA_FLAGS@ ${AM_CFLAGS} ${CFLAGS} ${ccflags}
    110 
    111 signal-cfa4$(EXEEXT):
    112         ${CC}        schedint/cfa4.c     -DBENCH_N=500000      -I. -nodebug -lrt -quiet @CFA_FLAGS@ ${AM_CFLAGS} ${CFLAGS} ${ccflags}
    113 
    114 ## =========================================================================================================
    115 waitfor$(EXEEXT) :\
    116         waitfor-upp.run         \
    117         waitfor-cfa1.run                \
    118         waitfor-cfa2.run                \
    119         waitfor-cfa4.run
    120 
    121 waitfor-upp$(EXEEXT):
    122         u++          schedext/upp.cc     -DBENCH_N=5000000     -I. -nodebug -lrt -quiet             ${AM_CFLAGS} ${CFLAGS} ${ccflags}
    123 
    124 waitfor-cfa1$(EXEEXT):
    125         ${CC}        schedext/cfa1.c     -DBENCH_N=500000      -I. -nodebug -lrt -quiet @CFA_FLAGS@ ${AM_CFLAGS} ${CFLAGS} ${ccflags}
    126 
    127 waitfor-cfa2$(EXEEXT):
    128         ${CC}        schedext/cfa2.c     -DBENCH_N=500000      -I. -nodebug -lrt -quiet @CFA_FLAGS@ ${AM_CFLAGS} ${CFLAGS} ${ccflags}
    129 
    130 waitfor-cfa4$(EXEEXT):
    131         ${CC}        schedext/cfa4.c     -DBENCH_N=500000      -I. -nodebug -lrt -quiet @CFA_FLAGS@ ${AM_CFLAGS} ${CFLAGS} ${ccflags}
    132 
    133 ## =========================================================================================================
    134 creation$(EXEEXT) :\
    135         creation-pthread.run            \
    136         creation-cfa_coroutine.run      \
    137         creation-cfa_thread.run         \
    138         creation-upp_coroutine.run      \
    139         creation-upp_thread.run
    140 
    141 creation-cfa_coroutine$(EXEEXT):
    142         ${CC}        creation/cfa_cor.c   -DBENCH_N=10000000   -I. -nodebug -lrt -quiet @CFA_FLAGS@ ${AM_CFLAGS} ${CFLAGS} ${ccflags}
    143 
    144 creation-cfa_thread$(EXEEXT):
    145         ${CC}        creation/cfa_thrd.c  -DBENCH_N=10000000   -I. -nodebug -lrt -quiet @CFA_FLAGS@ ${AM_CFLAGS} ${CFLAGS} ${ccflags}
    146 
    147 creation-upp_coroutine$(EXEEXT):
    148         u++          creation/upp_cor.cc  -DBENCH_N=50000000   -I. -nodebug -lrt -quiet             ${AM_CFLAGS} ${CFLAGS} ${ccflags}
    149 
    150 creation-upp_thread$(EXEEXT):
    151         u++          creation/upp_thrd.cc -DBENCH_N=50000000   -I. -nodebug -lrt -quiet             ${AM_CFLAGS} ${CFLAGS} ${ccflags}
    152 
    153 creation-pthread$(EXEEXT):
    154         @BACKEND_CC@ creation/pthreads.c  -DBENCH_N=250000     -I. -lrt -pthread                    ${AM_CFLAGS} ${CFLAGS} ${ccflags}
    155 
    156 ## =========================================================================================================
    157 
    158 %.run : %$(EXEEXT) ${REPEAT}
    159         @rm -f .result.log
    160         @echo "------------------------------------------------------"
    161         @echo $<
    162         @${REPEAT} ${repeats} ./a.out | tee -a .result.log
    163         @${STATS} .result.log
    164         @echo "------------------------------------------------------"
    165         @rm -f a.out .result.log
    166 
    167 ${REPEAT} :
    168         @+make -C ${TOOLSDIR} repeat
  • src/benchmark/Makefile.in

    r3f7e12cb r78315272  
    9292build_triplet = @build@
    9393host_triplet = @host@
    94 noinst_PROGRAMS =
    9594subdir = src/benchmark
    9695ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
     
    104103CONFIG_CLEAN_VPATH_FILES =
    105104PROGRAMS = $(noinst_PROGRAMS)
     105bench_SOURCES = bench.c
     106bench_OBJECTS = bench.$(OBJEXT)
     107bench_LDADD = $(LDADD)
     108csv_data_SOURCES = csv-data.c
     109csv_data_OBJECTS = csv-data.$(OBJEXT)
     110csv_data_LDADD = $(LDADD)
     111ctxswitch_coroutine_SOURCES = ctxswitch-coroutine.c
     112ctxswitch_coroutine_OBJECTS = ctxswitch-coroutine.$(OBJEXT)
     113ctxswitch_coroutine_LDADD = $(LDADD)
     114ctxswitch_thread_SOURCES = ctxswitch-thread.c
     115ctxswitch_thread_OBJECTS = ctxswitch-thread.$(OBJEXT)
     116ctxswitch_thread_LDADD = $(LDADD)
     117monitor_SOURCES = monitor.c
     118monitor_OBJECTS = monitor.$(OBJEXT)
     119monitor_LDADD = $(LDADD)
     120sched_int_SOURCES = sched-int.c
     121sched_int_OBJECTS = sched-int.$(OBJEXT)
     122sched_int_LDADD = $(LDADD)
    106123AM_V_P = $(am__v_P_@AM_V@)
    107124am__v_P_ = $(am__v_P_@AM_DEFAULT_V@)
     
    116133am__v_at_0 = @
    117134am__v_at_1 =
    118 SOURCES =
    119 DIST_SOURCES =
     135DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir)
     136depcomp = $(SHELL) $(top_srcdir)/automake/depcomp
     137am__depfiles_maybe = depfiles
     138am__mv = mv -f
     139COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
     140        $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
     141AM_V_CC = $(am__v_CC_@AM_V@)
     142am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@)
     143am__v_CC_0 = @echo "  CC      " $@;
     144am__v_CC_1 =
     145CCLD = $(CC)
     146LINK = $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@
     147AM_V_CCLD = $(am__v_CCLD_@AM_V@)
     148am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@)
     149am__v_CCLD_0 = @echo "  CCLD    " $@;
     150am__v_CCLD_1 =
     151SOURCES = bench.c csv-data.c ctxswitch-coroutine.c ctxswitch-thread.c \
     152        monitor.c sched-int.c
     153DIST_SOURCES = bench.c csv-data.c ctxswitch-coroutine.c \
     154        ctxswitch-thread.c monitor.c sched-int.c
    120155am__can_run_installinfo = \
    121156  case $$AM_UPDATE_INFO_DIR in \
     
    124159  esac
    125160am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP)
    126 am__DIST_COMMON = $(srcdir)/Makefile.in
     161# Read a list of newline-separated strings from the standard input,
     162# and print each of them once, without duplicates.  Input order is
     163# *not* preserved.
     164am__uniquify_input = $(AWK) '\
     165  BEGIN { nonempty = 0; } \
     166  { items[$$0] = 1; nonempty = 1; } \
     167  END { if (nonempty) { for (i in items) print i; }; } \
     168'
     169# Make sure the list of sources is unique.  This is necessary because,
     170# e.g., the same source file might be shared among _SOURCES variables
     171# for different programs/libraries.
     172am__define_uniq_tagged_files = \
     173  list='$(am__tagged_files)'; \
     174  unique=`for i in $$list; do \
     175    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
     176  done | $(am__uniquify_input)`
     177ETAGS = etags
     178CTAGS = ctags
     179am__DIST_COMMON = $(srcdir)/Makefile.in $(top_srcdir)/automake/depcomp
    127180DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
    128181ACLOCAL = @ACLOCAL@
     
    249302top_srcdir = @top_srcdir@
    250303AM_CFLAGS = -g -Wall -Wno-unused-function -O2
    251 TOOLSDIR = ${abs_top_srcdir}/tools/
    252 REPEAT = ${TOOLSDIR}repeat
    253 STATS = ${TOOLSDIR}stat.py
    254 repeats = 30
     304noinst_PROGRAMS = bench$(EXEEXT) ctxswitch-coroutine$(EXEEXT) ctxswitch-thread$(EXEEXT) sched-int$(EXEEXT) monitor$(EXEEXT) csv-data$(EXEEXT)
    255305all: all-am
    256306
    257307.SUFFIXES:
     308.SUFFIXES: .c .o .obj
    258309$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am  $(am__configure_deps)
    259310        @for dep in $?; do \
     
    288339clean-noinstPROGRAMS:
    289340        -test -z "$(noinst_PROGRAMS)" || rm -f $(noinst_PROGRAMS)
    290 tags TAGS:
    291 
    292 ctags CTAGS:
    293 
    294 cscope cscopelist:
    295 
     341
     342mostlyclean-compile:
     343        -rm -f *.$(OBJEXT)
     344
     345distclean-compile:
     346        -rm -f *.tab.c
     347
     348@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/bench.Po@am__quote@
     349@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/csv-data.Po@am__quote@
     350@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ctxswitch-coroutine.Po@am__quote@
     351@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ctxswitch-thread.Po@am__quote@
     352@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/monitor.Po@am__quote@
     353@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sched-int.Po@am__quote@
     354
     355.c.o:
     356@am__fastdepCC_TRUE@    $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.o$$||'`;\
     357@am__fastdepCC_TRUE@    $(COMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\
     358@am__fastdepCC_TRUE@    $(am__mv) $$depbase.Tpo $$depbase.Po
     359@AMDEP_TRUE@@am__fastdepCC_FALSE@       $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
     360@AMDEP_TRUE@@am__fastdepCC_FALSE@       DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
     361@am__fastdepCC_FALSE@   $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ $<
     362
     363.c.obj:
     364@am__fastdepCC_TRUE@    $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.obj$$||'`;\
     365@am__fastdepCC_TRUE@    $(COMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ `$(CYGPATH_W) '$<'` &&\
     366@am__fastdepCC_TRUE@    $(am__mv) $$depbase.Tpo $$depbase.Po
     367@AMDEP_TRUE@@am__fastdepCC_FALSE@       $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
     368@AMDEP_TRUE@@am__fastdepCC_FALSE@       DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
     369@am__fastdepCC_FALSE@   $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'`
     370
     371ID: $(am__tagged_files)
     372        $(am__define_uniq_tagged_files); mkid -fID $$unique
     373tags: tags-am
     374TAGS: tags
     375
     376tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files)
     377        set x; \
     378        here=`pwd`; \
     379        $(am__define_uniq_tagged_files); \
     380        shift; \
     381        if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \
     382          test -n "$$unique" || unique=$$empty_fix; \
     383          if test $$# -gt 0; then \
     384            $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
     385              "$$@" $$unique; \
     386          else \
     387            $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
     388              $$unique; \
     389          fi; \
     390        fi
     391ctags: ctags-am
     392
     393CTAGS: ctags
     394ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files)
     395        $(am__define_uniq_tagged_files); \
     396        test -z "$(CTAGS_ARGS)$$unique" \
     397          || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
     398             $$unique
     399
     400GTAGS:
     401        here=`$(am__cd) $(top_builddir) && pwd` \
     402          && $(am__cd) $(top_srcdir) \
     403          && gtags -i $(GTAGS_ARGS) "$$here"
     404cscopelist: cscopelist-am
     405
     406cscopelist-am: $(am__tagged_files)
     407        list='$(am__tagged_files)'; \
     408        case "$(srcdir)" in \
     409          [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \
     410          *) sdir=$(subdir)/$(srcdir) ;; \
     411        esac; \
     412        for i in $$list; do \
     413          if test -f "$$i"; then \
     414            echo "$(subdir)/$$i"; \
     415          else \
     416            echo "$$sdir/$$i"; \
     417          fi; \
     418        done >> $(top_builddir)/cscope.files
     419
     420distclean-tags:
     421        -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
    296422
    297423distdir: $(DISTFILES)
     
    364490
    365491distclean: distclean-am
     492        -rm -rf ./$(DEPDIR)
    366493        -rm -f Makefile
    367 distclean-am: clean-am distclean-generic
     494distclean-am: clean-am distclean-compile distclean-generic \
     495        distclean-tags
    368496
    369497dvi: dvi-am
     
    408536
    409537maintainer-clean: maintainer-clean-am
     538        -rm -rf ./$(DEPDIR)
    410539        -rm -f Makefile
    411540maintainer-clean-am: distclean-am maintainer-clean-generic
     
    413542mostlyclean: mostlyclean-am
    414543
    415 mostlyclean-am: mostlyclean-generic
     544mostlyclean-am: mostlyclean-compile mostlyclean-generic
    416545
    417546pdf: pdf-am
     
    427556.MAKE: install-am install-strip
    428557
    429 .PHONY: all all-am check check-am clean clean-generic \
    430         clean-noinstPROGRAMS cscopelist-am ctags-am distclean \
    431         distclean-generic distdir dvi dvi-am html html-am info info-am \
    432         install install-am install-data install-data-am install-dvi \
    433         install-dvi-am install-exec install-exec-am install-html \
    434         install-html-am install-info install-info-am install-man \
    435         install-pdf install-pdf-am install-ps install-ps-am \
    436         install-strip installcheck installcheck-am installdirs \
    437         maintainer-clean maintainer-clean-generic mostlyclean \
    438         mostlyclean-generic pdf pdf-am ps ps-am tags-am uninstall \
     558.PHONY: CTAGS GTAGS TAGS all all-am check check-am clean clean-generic \
     559        clean-noinstPROGRAMS cscopelist-am ctags ctags-am distclean \
     560        distclean-compile distclean-generic distclean-tags distdir dvi \
     561        dvi-am html html-am info info-am install install-am \
     562        install-data install-data-am install-dvi install-dvi-am \
     563        install-exec install-exec-am install-html install-html-am \
     564        install-info install-info-am install-man install-pdf \
     565        install-pdf-am install-ps install-ps-am install-strip \
     566        installcheck installcheck-am installdirs maintainer-clean \
     567        maintainer-clean-generic mostlyclean mostlyclean-compile \
     568        mostlyclean-generic pdf pdf-am ps ps-am tags tags-am uninstall \
    439569        uninstall-am
    440570
    441571.PRECIOUS: Makefile
    442572
    443 
    444 .NOTPARALLEL:
    445 
    446 all : ctxswitch$(EXEEXT) mutex$(EXEEXT) signal$(EXEEXT) waitfor$(EXEEXT) creation$(EXEEXT)
    447573
    448574bench$(EXEEXT) :
     
    454580        rm -f ./a.out ;
    455581
     582ctxswitch-coroutine$(EXEEXT):
     583        ${CC} ${AM_CFLAGS} ${CFLAGS} ${ccflags} @CFA_FLAGS@ -nodebug -lrt -DN=50000000 CorCtxSwitch.c
     584        @rm -f .result.log
     585        @for number in 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20; do \
     586                ./a.out | tee -a .result.log ; \
     587        done
     588        @./stat.py .result.log
     589        @rm -f a.out .result.log
     590
     591ctxswitch-thread$(EXEEXT):
     592        ${CC} ${AM_CFLAGS} ${CFLAGS} ${ccflags} @CFA_FLAGS@ -nodebug -lrt -DN=50000000 ThrdCtxSwitch.c
     593        @rm -f .result.log
     594        @for number in 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20; do \
     595                ./a.out | tee -a .result.log ; \
     596        done
     597        @./stat.py .result.log
     598        @rm -f a.out .result.log
     599
     600sched-int$(EXEEXT):
     601        ${CC} ${AM_CFLAGS} ${CFLAGS} ${ccflags} @CFA_FLAGS@ -nodebug -lrt -DN=50000000 SchedInt.c
     602        @rm -f .result.log
     603        @for number in 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20; do \
     604                ./a.out | tee -a .result.log ; \
     605        done
     606        @./stat.py .result.log
     607        @rm -f a.out .result.log
     608
     609monitor$(EXEEXT):
     610        ${CC} ${AM_CFLAGS} ${CFLAGS} ${ccflags} @CFA_FLAGS@ -nodebug -lrt -DN=50000000 Monitor.c
     611        @rm -f .result.log
     612        @for number in 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20; do \
     613                ./a.out | tee -a .result.log ; \
     614        done
     615        @./stat.py .result.log
     616        @rm -f a.out .result.log
     617
    456618csv-data$(EXEEXT):
    457619        @${CC} ${AM_CFLAGS} ${CFLAGS} ${ccflags} @CFA_FLAGS@ -nodebug -lrt -quiet -DN=50000000 csv-data.c
     
    459621        @rm -f ./a.out
    460622
    461 ctxswitch$(EXEEXT): \
    462         ctxswitch-pthread.run           \
    463         ctxswitch-cfa_coroutine.run     \
    464         ctxswitch-cfa_thread.run        \
    465         ctxswitch-upp_coroutine.run     \
    466         ctxswitch-upp_thread.run
    467 
    468 ctxswitch-cfa_coroutine$(EXEEXT):
    469         ${CC}        ctxswitch/cfa_cor.c   -DBENCH_N=50000000  -I. -nodebug -lrt -quiet @CFA_FLAGS@ ${AM_CFLAGS} ${CFLAGS} ${ccflags}
    470 
    471 ctxswitch-cfa_thread$(EXEEXT):
    472         ${CC}        ctxswitch/cfa_thrd.c  -DBENCH_N=50000000  -I. -nodebug -lrt -quiet @CFA_FLAGS@ ${AM_CFLAGS} ${CFLAGS} ${ccflags}
    473 
    474 ctxswitch-upp_coroutine$(EXEEXT):
    475         u++          ctxswitch/upp_cor.cc  -DBENCH_N=50000000  -I. -nodebug -lrt -quiet             ${AM_CFLAGS} ${CFLAGS} ${ccflags}
    476 
    477 ctxswitch-upp_thread$(EXEEXT):
    478         u++          ctxswitch/upp_thrd.cc -DBENCH_N=50000000  -I. -nodebug -lrt -quiet             ${AM_CFLAGS} ${CFLAGS} ${ccflags}
    479 
    480 ctxswitch-pthread$(EXEEXT):
    481         @BACKEND_CC@ ctxswitch/pthreads.c  -DBENCH_N=50000000  -I. -lrt -pthread                    ${AM_CFLAGS} ${CFLAGS} ${ccflags}
    482 
    483 mutex$(EXEEXT) :\
    484         mutex-function.run      \
    485         mutex-pthread_lock.run  \
    486         mutex-upp.run           \
    487         mutex-cfa1.run          \
    488         mutex-cfa2.run          \
    489         mutex-cfa4.run
    490 
    491 mutex-function$(EXEEXT):
    492         @BACKEND_CC@ mutex/function.c    -DBENCH_N=500000000   -I. -lrt -pthread                    ${AM_CFLAGS} ${CFLAGS} ${ccflags}
    493 
    494 mutex-pthread_lock$(EXEEXT):
    495         @BACKEND_CC@ mutex/pthreads.c    -DBENCH_N=50000000    -I. -lrt -pthread                    ${AM_CFLAGS} ${CFLAGS} ${ccflags}
    496 
    497 mutex-upp$(EXEEXT):
    498         u++          mutex/upp.cc        -DBENCH_N=50000000    -I. -nodebug -lrt -quiet             ${AM_CFLAGS} ${CFLAGS} ${ccflags}
    499 
    500 mutex-cfa1$(EXEEXT):
    501         ${CC}        mutex/cfa1.c        -DBENCH_N=5000000     -I. -nodebug -lrt -quiet @CFA_FLAGS@ ${AM_CFLAGS} ${CFLAGS} ${ccflags}
    502 
    503 mutex-cfa2$(EXEEXT):
    504         ${CC}        mutex/cfa2.c        -DBENCH_N=5000000     -I. -nodebug -lrt -quiet @CFA_FLAGS@ ${AM_CFLAGS} ${CFLAGS} ${ccflags}
    505 
    506 mutex-cfa4$(EXEEXT):
    507         ${CC}        mutex/cfa4.c        -DBENCH_N=5000000     -I. -nodebug -lrt -quiet @CFA_FLAGS@ ${AM_CFLAGS} ${CFLAGS} ${ccflags}
    508 
    509 signal$(EXEEXT) :\
    510         signal-upp.run          \
    511         signal-cfa1.run         \
    512         signal-cfa2.run         \
    513         signal-cfa4.run
    514 
    515 signal-upp$(EXEEXT):
    516         u++          schedint/upp.cc     -DBENCH_N=5000000     -I. -nodebug -lrt -quiet             ${AM_CFLAGS} ${CFLAGS} ${ccflags}
    517 
    518 signal-cfa1$(EXEEXT):
    519         ${CC}        schedint/cfa1.c     -DBENCH_N=500000      -I. -nodebug -lrt -quiet @CFA_FLAGS@ ${AM_CFLAGS} ${CFLAGS} ${ccflags}
    520 
    521 signal-cfa2$(EXEEXT):
    522         ${CC}        schedint/cfa2.c     -DBENCH_N=500000      -I. -nodebug -lrt -quiet @CFA_FLAGS@ ${AM_CFLAGS} ${CFLAGS} ${ccflags}
    523 
    524 signal-cfa4$(EXEEXT):
    525         ${CC}        schedint/cfa4.c     -DBENCH_N=500000      -I. -nodebug -lrt -quiet @CFA_FLAGS@ ${AM_CFLAGS} ${CFLAGS} ${ccflags}
    526 
    527 waitfor$(EXEEXT) :\
    528         waitfor-upp.run         \
    529         waitfor-cfa1.run                \
    530         waitfor-cfa2.run                \
    531         waitfor-cfa4.run
    532 
    533 waitfor-upp$(EXEEXT):
    534         u++          schedext/upp.cc     -DBENCH_N=5000000     -I. -nodebug -lrt -quiet             ${AM_CFLAGS} ${CFLAGS} ${ccflags}
    535 
    536 waitfor-cfa1$(EXEEXT):
    537         ${CC}        schedext/cfa1.c     -DBENCH_N=500000      -I. -nodebug -lrt -quiet @CFA_FLAGS@ ${AM_CFLAGS} ${CFLAGS} ${ccflags}
    538 
    539 waitfor-cfa2$(EXEEXT):
    540         ${CC}        schedext/cfa2.c     -DBENCH_N=500000      -I. -nodebug -lrt -quiet @CFA_FLAGS@ ${AM_CFLAGS} ${CFLAGS} ${ccflags}
    541 
    542 waitfor-cfa4$(EXEEXT):
    543         ${CC}        schedext/cfa4.c     -DBENCH_N=500000      -I. -nodebug -lrt -quiet @CFA_FLAGS@ ${AM_CFLAGS} ${CFLAGS} ${ccflags}
    544 
    545 creation$(EXEEXT) :\
    546         creation-pthread.run            \
    547         creation-cfa_coroutine.run      \
    548         creation-cfa_thread.run         \
    549         creation-upp_coroutine.run      \
    550         creation-upp_thread.run
    551 
    552 creation-cfa_coroutine$(EXEEXT):
    553         ${CC}        creation/cfa_cor.c   -DBENCH_N=10000000   -I. -nodebug -lrt -quiet @CFA_FLAGS@ ${AM_CFLAGS} ${CFLAGS} ${ccflags}
    554 
    555 creation-cfa_thread$(EXEEXT):
    556         ${CC}        creation/cfa_thrd.c  -DBENCH_N=10000000   -I. -nodebug -lrt -quiet @CFA_FLAGS@ ${AM_CFLAGS} ${CFLAGS} ${ccflags}
    557 
    558 creation-upp_coroutine$(EXEEXT):
    559         u++          creation/upp_cor.cc  -DBENCH_N=50000000   -I. -nodebug -lrt -quiet             ${AM_CFLAGS} ${CFLAGS} ${ccflags}
    560 
    561 creation-upp_thread$(EXEEXT):
    562         u++          creation/upp_thrd.cc -DBENCH_N=50000000   -I. -nodebug -lrt -quiet             ${AM_CFLAGS} ${CFLAGS} ${ccflags}
    563 
    564 creation-pthread$(EXEEXT):
    565         @BACKEND_CC@ creation/pthreads.c  -DBENCH_N=250000     -I. -lrt -pthread                    ${AM_CFLAGS} ${CFLAGS} ${ccflags}
    566 
    567 %.run : %$(EXEEXT) ${REPEAT}
    568         @rm -f .result.log
    569         @echo "------------------------------------------------------"
    570         @echo $<
    571         @${REPEAT} ${repeats} ./a.out | tee -a .result.log
    572         @${STATS} .result.log
    573         @echo "------------------------------------------------------"
    574         @rm -f a.out .result.log
    575 
    576 ${REPEAT} :
    577         @+make -C ${TOOLSDIR} repeat
    578 
    579623# Tell versions [3.59,3.63) of GNU make to not export all variables.
    580624# Otherwise a system limit (for SysV at least) may be exceeded.
  • src/benchmark/bench.h

    r3f7e12cb r78315272  
    11#pragma once
    22
    3 #if defined(__CFORALL__)
    43extern "C" {
    5 #endif
    6         #include <stdlib.h>
    74        #include <unistd.h>                                     // sysconf
    85        #include <sys/times.h>                                  // times
    96        #include <time.h>
    10 #if defined(__CFORALL__)
    117}
    12 #endif
    138
    14 static inline unsigned long long int Time() {
    15     struct timespec ts;
     9inline unsigned long long int Time() {
     10    timespec ts;
    1611    clock_gettime(
    1712#if defined( __linux__ )
     
    2823} // Time
    2924
    30 #ifndef BENCH_N
    31 #define BENCH_N 500 //10000000
     25#ifndef N
     26#define N 10000000
    3227#endif
    33 
    34 #define BENCH(statement, output)                \
    35         size_t n = BENCH_N;                     \
    36         if( argc > 2 ) return 1;                \
    37         if( argc == 2 ) {                               \
    38                 n = atoi(argv[1]);              \
    39         }                                               \
    40         long long int StartTime, EndTime;       \
    41         StartTime = Time();                     \
    42         statement;                                      \
    43         EndTime = Time();                               \
    44         unsigned long long int output =         \
    45         ( EndTime - StartTime ) / n;
    4628
    4729unsigned int default_preemption() {
  • src/benchmark/csv-data.c

    r3f7e12cb r78315272  
    111111        StartTime = Time();
    112112        for( int i = 0;; i++ ) {
    113                 signal(cond1a);
    114                 if( i > N ) break;
    115                 wait(cond1b);
     113                signal(&cond1a);
     114                if( i > N ) break;
     115                wait(&cond1b);
    116116        }
    117117        EndTime = Time();
     
    122122void side1B( mon_t & mutex a ) {
    123123        for( int i = 0;; i++ ) {
    124                 signal(cond1b);
    125                 if( i > N ) break;
    126                 wait(cond1a);
     124                signal(&cond1b);
     125                if( i > N ) break;
     126                wait(&cond1a);
    127127        }
    128128}
     
    159159        StartTime = Time();
    160160        for( int i = 0;; i++ ) {
    161                 signal(cond2a);
    162                 if( i > N ) break;
    163                 wait(cond2b);
     161                signal(&cond2a);
     162                if( i > N ) break;
     163                wait(&cond2b);
    164164        }
    165165        EndTime = Time();
     
    170170void side2B( mon_t & mutex a, mon_t & mutex b ) {
    171171        for( int i = 0;; i++ ) {
    172                 signal(cond2b);
    173                 if( i > N ) break;
    174                 wait(cond2a);
     172                signal(&cond2b);
     173                if( i > N ) break;
     174                wait(&cond2a);
    175175        }
    176176}
  • src/driver/cfa.cc

    r3f7e12cb r78315272  
    99// Author           : Peter A. Buhr
    1010// Created On       : Tue Aug 20 13:44:49 2002
    11 // Last Modified By : Peter A. Buhr
    12 // Last Modified On : Tue Oct 31 11:40:44 2017
    13 // Update Count     : 160
     11// Last Modified By : Andrew Beach
     12// Last Modified On : Thr Aug 17 15:24:00 2017
     13// Update Count     : 156
    1414//
    1515
     
    305305        } // if
    306306
    307         shuffle( args, sargs, nargs, 1 );                                       // make room at front of argument list
    308         nargs += 1;
    309307        if ( CFA_flag ) {
    310                 args[sargs] = "-D__CFA_FLAG__=-N";
    311308                args[nargs] = "-D__CFA_PREPROCESS_";
    312309                nargs += 1;
    313         } else {
    314                 args[sargs] = "-D__CFA_FLAG__=-L";
    315         } // if
    316         sargs += 1;
     310        } // if
    317311
    318312        if ( debug ) {
     
    351345                } // if
    352346                args[nargs] = "-fgnu89-inline";
    353                 nargs += 1;
    354                 args[nargs] = "-D__int8_t_defined";                             // prevent gcc type-size attributes
    355347                nargs += 1;
    356348                args[nargs] = ( *new string( string("-B") + Bprefix + "/" ) ).c_str();
  • src/include/cassert

    r3f7e12cb r78315272  
    4141static inline T strict_dynamic_cast( const U & src ) {
    4242        T ret = dynamic_cast<T>(src);
    43         assertf(ret, "%s", toString(src).c_str());
     43        assert(ret);
    4444        return ret;
    4545}
  • src/libcfa/Makefile.am

    r3f7e12cb r78315272  
    3131
    3232libcfa_a-libcfa-prelude.o : libcfa-prelude.c
    33          ${AM_V_GEN}@BACKEND_CC@ @CFA_FLAGS@ -Wall -O2 -c -o $@ $<
     33         ${AM_V_GEN}@BACKEND_CC@ @CFA_FLAGS@ -O2 -c -o $@ $<
    3434
    3535libcfa_d_a-libcfa-prelude.o : libcfa-prelude.c
    36          ${AM_V_GEN}@BACKEND_CC@ @CFA_FLAGS@ -D__CFA_DEBUG__ -Wall -O0 -c -o $@ $<
     36         ${AM_V_GEN}@BACKEND_CC@ @CFA_FLAGS@ -D__CFA_DEBUG__ -O0 -c -o $@ $<
    3737
    38 EXTRA_FLAGS = -g -Wall -Wno-unused-function -imacros libcfa-prelude.c @CFA_FLAGS@
     38EXTRA_FLAGS = -g -Wall -Werror -Wno-unused-function -imacros libcfa-prelude.c @CFA_FLAGS@
    3939
    4040AM_CCASFLAGS = @CFA_FLAGS@
  • src/libcfa/Makefile.in

    r3f7e12cb r78315272  
    416416ARFLAGS = cr
    417417lib_LIBRARIES = $(am__append_1) $(am__append_2)
    418 EXTRA_FLAGS = -g -Wall -Wno-unused-function -imacros libcfa-prelude.c @CFA_FLAGS@
     418EXTRA_FLAGS = -g -Wall -Werror -Wno-unused-function -imacros libcfa-prelude.c @CFA_FLAGS@
    419419AM_CCASFLAGS = @CFA_FLAGS@
    420420headers = fstream iostream iterator limits rational stdlib \
     
    14981498
    14991499libcfa_a-libcfa-prelude.o : libcfa-prelude.c
    1500          ${AM_V_GEN}@BACKEND_CC@ @CFA_FLAGS@ -Wall -O2 -c -o $@ $<
     1500         ${AM_V_GEN}@BACKEND_CC@ @CFA_FLAGS@ -O2 -c -o $@ $<
    15011501
    15021502libcfa_d_a-libcfa-prelude.o : libcfa-prelude.c
    1503          ${AM_V_GEN}@BACKEND_CC@ @CFA_FLAGS@ -D__CFA_DEBUG__ -Wall -O0 -c -o $@ $<
     1503         ${AM_V_GEN}@BACKEND_CC@ @CFA_FLAGS@ -D__CFA_DEBUG__ -O0 -c -o $@ $<
    15041504
    15051505# extensionless header files are overridden by -o flag in default makerule => explicitly override default rule to silently do nothing
  • src/libcfa/concurrency/coroutine.c

    r3f7e12cb r78315272  
    123123        if(pageSize == 0ul) pageSize = sysconf( _SC_PAGESIZE );
    124124
     125        LIB_DEBUG_PRINT_SAFE("FRED");
     126
    125127        size_t cxtSize = libCeiling( sizeof(machine_context_t), 8 ); // minimum alignment
    126128
     
    156158                this->limit = (char *)libCeiling( (unsigned long)this->storage, 16 ); // minimum alignment
    157159        } // if
    158         assertf( this->size >= MinStackSize, "Stack size %zd provides less than minimum of %d bytes for a stack.", this->size, MinStackSize );
     160        assertf( this->size >= MinStackSize, "Stack size %d provides less than minimum of %d bytes for a stack.", this->size, MinStackSize );
    159161
    160162        this->base = (char *)this->limit + this->size;
  • src/libcfa/concurrency/invoke.h

    r3f7e12cb r78315272  
    2525#define _INVOKE_H_
    2626
    27         #define unlikely(x)    __builtin_expect(!!(x), 0)
    28         #define thread_local _Thread_local
     27      #define unlikely(x)    __builtin_expect(!!(x), 0)
     28      #define thread_local _Thread_local
    2929
    30         typedef void (*fptr_t)();
    31         typedef int_fast16_t __lock_size_t;
     30      typedef void (*fptr_t)();
    3231
    33         struct spinlock {
    34                 volatile int lock;
    35                 #ifdef __CFA_DEBUG__
    36                         const char * prev_name;
    37                         void* prev_thrd;
    38                 #endif
    39         };
     32      struct spinlock {
     33            volatile int lock;
     34            #ifdef __CFA_DEBUG__
     35                  const char * prev_name;
     36                  void* prev_thrd;
     37            #endif
     38      };
    4039
    41         struct __thread_queue_t {
    42                 struct thread_desc * head;
    43                 struct thread_desc ** tail;
    44         };
     40      struct __thread_queue_t {
     41            struct thread_desc * head;
     42            struct thread_desc ** tail;
     43      };
    4544
    46         struct __condition_stack_t {
    47                 struct __condition_criterion_t * top;
    48         };
     45      struct __condition_stack_t {
     46            struct __condition_criterion_t * top;
     47      };
    4948
    50         #ifdef __CFORALL__
    51         extern "Cforall" {
    52                 void ?{}( struct __thread_queue_t & );
    53                 void append( struct __thread_queue_t &, struct thread_desc * );
    54                 struct thread_desc * pop_head( struct __thread_queue_t & );
    55                 struct thread_desc * remove( struct __thread_queue_t &, struct thread_desc ** );
     49      #ifdef __CFORALL__
     50      extern "Cforall" {
     51            void ?{}( struct __thread_queue_t & );
     52            void append( struct __thread_queue_t *, struct thread_desc * );
     53            struct thread_desc * pop_head( struct __thread_queue_t * );
     54            struct thread_desc * remove( struct __thread_queue_t *, struct thread_desc ** );
    5655
    57                 void ?{}( struct __condition_stack_t & );
    58                 void push( struct __condition_stack_t &, struct __condition_criterion_t * );
    59                 struct __condition_criterion_t * pop( struct __condition_stack_t & );
     56            void ?{}( struct __condition_stack_t & );
     57            void push( struct __condition_stack_t *, struct __condition_criterion_t * );
     58            struct __condition_criterion_t * pop( struct __condition_stack_t * );
    6059
    61                 void ?{}(spinlock & this);
    62                 void ^?{}(spinlock & this);
    63         }
    64         #endif
     60            void ?{}(spinlock & this);
     61            void ^?{}(spinlock & this);
     62      }
     63      #endif
    6564
    66         struct coStack_t {
    67                 // size of stack
    68                 size_t size;
     65      struct coStack_t {
     66            unsigned int size;                        // size of stack
     67            void *storage;                            // pointer to stack
     68            void *limit;                              // stack grows towards stack limit
     69            void *base;                               // base of stack
     70            void *context;                            // address of cfa_context_t
     71            void *top;                                // address of top of storage
     72            bool userStack;                           // whether or not the user allocated the stack
     73      };
    6974
    70                 // pointer to stack
    71                 void *storage;
     75      enum coroutine_state { Halted, Start, Inactive, Active, Primed };
    7276
    73                 // stack grows towards stack limit
    74                 void *limit;
     77      struct coroutine_desc {
     78            struct coStack_t stack;                   // stack information of the coroutine
     79            const char *name;                         // textual name for coroutine/task, initialized by uC++ generated code
     80            int errno_;                               // copy of global UNIX variable errno
     81            enum coroutine_state state;               // current execution status for coroutine
     82            struct coroutine_desc * starter;          // first coroutine to resume this one
     83            struct coroutine_desc * last;             // last coroutine to resume this one
     84      };
    7585
    76                 // base of stack
    77                 void *base;
     86      struct monitor_desc {
     87            struct spinlock lock;                     // spinlock to protect internal data
     88            struct thread_desc * owner;               // current owner of the monitor
     89            struct __thread_queue_t entry_queue;      // queue of threads that are blocked waiting for the monitor
     90            struct __condition_stack_t signal_stack;  // stack of conditions to run next once we exit the monitor
     91            unsigned int recursion;                   // monitor routines can be called recursively, we need to keep track of that
    7892
    79                 // address of cfa_context_t
    80                 void *context;
     93            struct __acceptable_t * acceptables;      // list of acceptable functions, null if any
     94            unsigned short acceptable_count;          // number of acceptable functions
     95            short accepted_index;                     // the index of the accepted function, -1 if none
     96       };
    8197
    82                 // address of top of storage
    83                 void *top;
     98      struct thread_desc {
     99            // Core threading fields
     100            struct coroutine_desc cor;                // coroutine body used to store context
     101            struct monitor_desc mon;                  // monitor body used for mutual exclusion
    84102
    85                 // whether or not the user allocated the stack
    86                 bool userStack;
    87         };
     103            // Link lists fields
     104            struct thread_desc * next;                // instrusive link field for threads
    88105
    89         enum coroutine_state { Halted, Start, Inactive, Active, Primed };
    90 
    91         struct coroutine_desc {
    92                 // stack information of the coroutine
    93                 struct coStack_t stack;
    94 
    95                 // textual name for coroutine/task, initialized by uC++ generated code
    96                 const char *name;
    97 
    98                 // copy of global UNIX variable errno
    99                 int errno_;
    100 
    101                 // current execution status for coroutine
    102                 enum coroutine_state state;
    103 
    104                 // first coroutine to resume this one
    105                 struct coroutine_desc * starter;
    106 
    107                 // last coroutine to resume this one
    108                 struct coroutine_desc * last;
    109         };
    110 
    111         struct __waitfor_mask_t {
    112                 // the index of the accepted function, -1 if none
    113                 short * accepted;
    114 
    115                 // list of acceptable functions, null if any
    116                 struct __acceptable_t * clauses;
    117 
    118                 // number of acceptable functions
    119                 __lock_size_t size;
    120         };
    121 
    122         struct monitor_desc {
    123                 // spinlock to protect internal data
    124                 struct spinlock lock;
    125 
    126                 // current owner of the monitor
    127                 struct thread_desc * owner;
    128 
    129                 // queue of threads that are blocked waiting for the monitor
    130                 struct __thread_queue_t entry_queue;
    131 
    132                 // stack of conditions to run next once we exit the monitor
    133                 struct __condition_stack_t signal_stack;
    134 
    135                 // monitor routines can be called recursively, we need to keep track of that
    136                 unsigned int recursion;
    137 
    138                 // mask used to know if some thread is waiting for something while holding the monitor
    139                 struct __waitfor_mask_t mask;
    140 
    141                 // node used to signal the dtor in a waitfor dtor
    142                 struct __condition_node_t * dtor_node;
    143         };
    144 
    145         struct __monitor_group_t {
    146                 // currently held monitors
    147                 struct monitor_desc ** list;
    148 
    149                 // number of currently held monitors
    150                 __lock_size_t size;
    151 
    152                 // last function that acquired monitors
    153                 fptr_t func;
    154         };
    155 
    156         struct thread_desc {
    157                 // Core threading fields
    158                 // coroutine body used to store context
    159                 struct coroutine_desc  self_cor;
    160 
    161                 // monitor body used for mutual exclusion
    162                 struct monitor_desc    self_mon;
    163 
    164                 // pointer to monitor with sufficient lifetime for current monitors
    165                 struct monitor_desc *  self_mon_p;
    166 
    167                 // monitors currently held by this thread
    168                 struct __monitor_group_t monitors;
    169 
    170                 // Link lists fields
    171                 // instrusive link field for threads
    172                 struct thread_desc * next;
     106            // Current status related to monitors
     107            struct monitor_desc ** current_monitors;  // currently held monitors
     108            unsigned short current_monitor_count;     // number of currently held monitors
     109            fptr_t current_monitor_func;              // last function that acquired monitors
    173110     };
    174 
    175      #ifdef __CFORALL__
    176      extern "Cforall" {
    177                 static inline monitor_desc * ?[?]( const __monitor_group_t & this, ptrdiff_t index ) {
    178                         return this.list[index];
    179                 }
    180 
    181                 static inline bool ?==?( const __monitor_group_t & lhs, const __monitor_group_t & rhs ) {
    182                         if( (lhs.list != 0) != (rhs.list != 0) ) return false;
    183                         if( lhs.size != rhs.size ) return false;
    184                         if( lhs.func != rhs.func ) return false;
    185 
    186                         // Check that all the monitors match
    187                         for( int i = 0; i < lhs.size; i++ ) {
    188                                 // If not a match, check next function
    189                                 if( lhs[i] != rhs[i] ) return false;
    190                         }
    191 
    192                         return true;
    193                 }
    194         }
    195         #endif
    196111
    197112#endif //_INVOKE_H_
     
    200115#define _INVOKE_PRIVATE_H_
    201116
    202         struct machine_context_t {
    203                 void *SP;
    204                 void *FP;
    205                 void *PC;
    206         };
     117      struct machine_context_t {
     118            void *SP;
     119            void *FP;
     120            void *PC;
     121      };
    207122
    208         // assembler routines that performs the context switch
    209         extern void CtxInvokeStub( void );
    210         void CtxSwitch( void * from, void * to ) asm ("CtxSwitch");
     123      // assembler routines that performs the context switch
     124      extern void CtxInvokeStub( void );
     125      void CtxSwitch( void * from, void * to ) asm ("CtxSwitch");
    211126
    212         #if   defined( __x86_64__ )
    213         #define CtxGet( ctx ) __asm__ ( \
    214                         "movq %%rsp,%0\n"   \
    215                         "movq %%rbp,%1\n"   \
    216                 : "=rm" (ctx.SP), "=rm" (ctx.FP) )
    217         #elif defined( __i386__ )
    218         #define CtxGet( ctx ) __asm__ ( \
    219                         "movl %%esp,%0\n"   \
    220                         "movl %%ebp,%1\n"   \
    221                 : "=rm" (ctx.SP), "=rm" (ctx.FP) )
    222         #endif
     127      #if   defined( __x86_64__ )
     128      #define CtxGet( ctx ) __asm__ ( \
     129                  "movq %%rsp,%0\n"   \
     130                  "movq %%rbp,%1\n"   \
     131            : "=rm" (ctx.SP), "=rm" (ctx.FP) )
     132      #elif defined( __i386__ )
     133      #define CtxGet( ctx ) __asm__ ( \
     134                  "movl %%esp,%0\n"   \
     135                  "movl %%ebp,%1\n"   \
     136            : "=rm" (ctx.SP), "=rm" (ctx.FP) )
     137      #endif
    223138
    224139#endif //_INVOKE_PRIVATE_H_
  • src/libcfa/concurrency/kernel

    r3f7e12cb r78315272  
    2626//-----------------------------------------------------------------------------
    2727// Locks
    28 // Lock the spinlock, spin if already acquired
    29 void lock      ( spinlock * DEBUG_CTX_PARAM2 );
    30 
    31 // Lock the spinlock, yield repeatedly if already acquired
    32 void lock_yield( spinlock * DEBUG_CTX_PARAM2 );
    33 
    34 // Lock the spinlock, return false if already acquired
    35 bool try_lock  ( spinlock * DEBUG_CTX_PARAM2 );
    36 
    37 // Unlock the spinlock
    38 void unlock    ( spinlock * );
     28void lock      ( spinlock * DEBUG_CTX_PARAM2 );       // Lock the spinlock, spin if already acquired
     29void lock_yield( spinlock * DEBUG_CTX_PARAM2 );       // Lock the spinlock, yield repeatedly if already acquired
     30bool try_lock  ( spinlock * DEBUG_CTX_PARAM2 );       // Lock the spinlock, return false if already acquired
     31void unlock    ( spinlock * );                        // Unlock the spinlock
    3932
    4033struct semaphore {
     
    4639void  ?{}(semaphore & this, int count = 1);
    4740void ^?{}(semaphore & this);
    48 void   P (semaphore & this);
    49 void   V (semaphore & this);
     41void P(semaphore * this);
     42void V(semaphore * this);
    5043
    5144
     
    5346// Cluster
    5447struct cluster {
    55         // Ready queue locks
    56         spinlock ready_queue_lock;
    57 
    58         // Ready queue for threads
    59         __thread_queue_t ready_queue;
    60 
    61         // Preemption rate on this cluster
    62         unsigned long long int preemption;
     48        spinlock ready_queue_lock;                      // Ready queue locks
     49        __thread_queue_t ready_queue;                   // Ready queue for threads
     50        unsigned long long int preemption;              // Preemption rate on this cluster
    6351};
    6452
    65 void ?{} (cluster & this);
     53void ?{}(cluster & this);
    6654void ^?{}(cluster & this);
    6755
     
    9179struct processor {
    9280        // Main state
    93         // Coroutine ctx who does keeps the state of the processor
    94         struct processorCtx_t * runner;
    95 
    96         // Cluster from which to get threads
    97         cluster * cltr;
    98 
    99         // Handle to pthreads
    100         pthread_t kernel_thread;
     81        struct processorCtx_t * runner;                 // Coroutine ctx who does keeps the state of the processor
     82        cluster * cltr;                                 // Cluster from which to get threads
     83        pthread_t kernel_thread;                        // Handle to pthreads
    10184
    10285        // Termination
    103         // Set to true to notify the processor should terminate
    104         volatile bool do_terminate;
    105 
    106         // Termination synchronisation
    107         semaphore terminated;
     86        volatile bool do_terminate;                     // Set to true to notify the processor should terminate
     87        semaphore terminated;                           // Termination synchronisation
    10888
    10989        // RunThread data
    110         // Action to do after a thread is ran
    111         struct FinishAction finish;
     90        struct FinishAction finish;                     // Action to do after a thread is ran
    11291
    11392        // Preemption data
    114         // Node which is added in the discrete event simulaiton
    115         struct alarm_node_t * preemption_alarm;
    116 
    117         // If true, a preemption was triggered in an unsafe region, the processor must preempt as soon as possible
    118         bool pending_preemption;
     93        struct alarm_node_t * preemption_alarm;         // Node which is added in the discrete event simulaiton
     94        bool pending_preemption;                        // If true, a preemption was triggered in an unsafe region, the processor must preempt as soon as possible
    11995
    12096#ifdef __CFA_DEBUG__
    121         // Last function to enable preemption on this processor
    122         char * last_enable;
     97        char * last_enable;                             // Last function to enable preemption on this processor
    12398#endif
    12499};
    125100
    126 void  ?{}(processor & this);
    127 void  ?{}(processor & this, cluster * cltr);
     101void ?{}(processor & this);
     102void ?{}(processor & this, cluster * cltr);
    128103void ^?{}(processor & this);
    129104
  • src/libcfa/concurrency/kernel.c

    r3f7e12cb r78315272  
    106106
    107107void ?{}( thread_desc & this, current_stack_info_t * info) {
    108         (this.self_cor){ info };
     108        (this.cor){ info };
    109109}
    110110
     
    158158                LIB_DEBUG_PRINT_SAFE("Kernel : core %p signaling termination\n", &this);
    159159                this.do_terminate = true;
    160                 P( this.terminated );
     160                P( &this.terminated );
    161161                pthread_join( this.kernel_thread, NULL );
    162162        }
     
    216216        }
    217217
    218         V( this->terminated );
     218        V( &this->terminated );
    219219
    220220        LIB_DEBUG_PRINT_SAFE("Kernel : core %p terminated\n", this);
     
    328328        // if( !thrd ) return;
    329329        verify( thrd );
    330         verify( thrd->self_cor.state != Halted );
     330        verify( thrd->cor.state != Halted );
    331331
    332332        verify( disable_preempt_count > 0 );
     
    335335
    336336        lock(   &this_processor->cltr->ready_queue_lock DEBUG_CTX2 );
    337         append( this_processor->cltr->ready_queue, thrd );
     337        append( &this_processor->cltr->ready_queue, thrd );
    338338        unlock( &this_processor->cltr->ready_queue_lock );
    339339
     
    344344        verify( disable_preempt_count > 0 );
    345345        lock( &this->ready_queue_lock DEBUG_CTX2 );
    346         thread_desc * head = pop_head( this->ready_queue );
     346        thread_desc * head = pop_head( &this->ready_queue );
    347347        unlock( &this->ready_queue_lock );
    348348        verify( disable_preempt_count > 0 );
     
    373373        assert(thrd);
    374374        disable_interrupts();
    375         assert( thrd->self_cor.state != Halted );
     375        assert( thrd->cor.state != Halted );
    376376        this_processor->finish.action_code = Schedule;
    377377        this_processor->finish.thrd = thrd;
     
    398398}
    399399
    400 void BlockInternal(spinlock * locks [], unsigned short count) {
     400void BlockInternal(spinlock ** locks, unsigned short count) {
    401401        disable_interrupts();
    402402        this_processor->finish.action_code = Release_Multi;
     
    411411}
    412412
    413 void BlockInternal(spinlock * locks [], unsigned short lock_count, thread_desc * thrds [], unsigned short thrd_count) {
     413void BlockInternal(spinlock ** locks, unsigned short lock_count, thread_desc ** thrds, unsigned short thrd_count) {
    414414        disable_interrupts();
    415415        this_processor->finish.action_code = Release_Multi_Schedule;
     
    466466        this_processor = mainProcessor;
    467467        this_thread = mainThread;
    468         this_coroutine = &mainThread->self_cor;
     468        this_coroutine = &mainThread->cor;
    469469
    470470        // Enable preemption
     
    547547        thread_desc * thrd = kernel_data;
    548548
    549         int len = snprintf( abort_text, abort_text_size, "Error occurred while executing task %.256s (%p)", thrd->self_cor.name, thrd );
    550         __lib_debug_write( abort_text, len );
     549        int len = snprintf( abort_text, abort_text_size, "Error occurred while executing task %.256s (%p)", thrd->cor.name, thrd );
     550        __lib_debug_write( STDERR_FILENO, abort_text, len );
    551551
    552552        if ( thrd != this_coroutine ) {
    553553                len = snprintf( abort_text, abort_text_size, " in coroutine %.256s (%p).\n", this_coroutine->name, this_coroutine );
    554                 __lib_debug_write( abort_text, len );
     554                __lib_debug_write( STDERR_FILENO, abort_text, len );
    555555        }
    556556        else {
    557                 __lib_debug_write( ".\n", 2 );
     557                __lib_debug_write( STDERR_FILENO, ".\n", 2 );
    558558        }
    559559}
     
    618618void ^?{}(semaphore & this) {}
    619619
    620 void P(semaphore & this) {
    621         lock( &this.lock DEBUG_CTX2 );
    622         this.count -= 1;
    623         if ( this.count < 0 ) {
     620void P(semaphore * this) {
     621        lock( &this->lock DEBUG_CTX2 );
     622        this->count -= 1;
     623        if ( this->count < 0 ) {
    624624                // queue current task
    625                 append( this.waiting, (thread_desc *)this_thread );
     625                append( &this->waiting, (thread_desc *)this_thread );
    626626
    627627                // atomically release spin lock and block
    628                 BlockInternal( &this.lock );
     628                BlockInternal( &this->lock );
    629629        }
    630630        else {
    631             unlock( &this.lock );
    632         }
    633 }
    634 
    635 void V(semaphore & this) {
     631            unlock( &this->lock );
     632        }
     633}
     634
     635void V(semaphore * this) {
    636636        thread_desc * thrd = NULL;
    637         lock( &this.lock DEBUG_CTX2 );
    638         this.count += 1;
    639         if ( this.count <= 0 ) {
     637        lock( &this->lock DEBUG_CTX2 );
     638        this->count += 1;
     639        if ( this->count <= 0 ) {
    640640                // remove task at head of waiting list
    641                 thrd = pop_head( this.waiting );
    642         }
    643 
    644         unlock( &this.lock );
     641                thrd = pop_head( &this->waiting );
     642        }
     643
     644        unlock( &this->lock );
    645645
    646646        // make new owner
     
    655655}
    656656
    657 void append( __thread_queue_t & this, thread_desc * t ) {
    658         verify(this.tail != NULL);
    659         *this.tail = t;
    660         this.tail = &t->next;
    661 }
    662 
    663 thread_desc * pop_head( __thread_queue_t & this ) {
    664         thread_desc * head = this.head;
     657void append( __thread_queue_t * this, thread_desc * t ) {
     658        verify(this->tail != NULL);
     659        *this->tail = t;
     660        this->tail = &t->next;
     661}
     662
     663thread_desc * pop_head( __thread_queue_t * this ) {
     664        thread_desc * head = this->head;
    665665        if( head ) {
    666                 this.head = head->next;
     666                this->head = head->next;
    667667                if( !head->next ) {
    668                         this.tail = &this.head;
     668                        this->tail = &this->head;
    669669                }
    670670                head->next = NULL;
     
    673673}
    674674
    675 thread_desc * remove( __thread_queue_t & this, thread_desc ** it ) {
     675thread_desc * remove( __thread_queue_t * this, thread_desc ** it ) {
    676676        thread_desc * thrd = *it;
    677677        verify( thrd );
     
    679679        (*it) = thrd->next;
    680680
    681         if( this.tail == &thrd->next ) {
    682                 this.tail = it;
     681        if( this->tail == &thrd->next ) {
     682                this->tail = it;
    683683        }
    684684
    685685        thrd->next = NULL;
    686686
    687         verify( (this.head == NULL) == (&this.head == this.tail) );
    688         verify( *this.tail == NULL );
     687        verify( (this->head == NULL) == (&this->head == this->tail) );
     688        verify( *this->tail == NULL );
    689689        return thrd;
    690690}
     
    694694}
    695695
    696 void push( __condition_stack_t & this, __condition_criterion_t * t ) {
     696void push( __condition_stack_t * this, __condition_criterion_t * t ) {
    697697        verify( !t->next );
    698         t->next = this.top;
    699         this.top = t;
    700 }
    701 
    702 __condition_criterion_t * pop( __condition_stack_t & this ) {
    703         __condition_criterion_t * top = this.top;
     698        t->next = this->top;
     699        this->top = t;
     700}
     701
     702__condition_criterion_t * pop( __condition_stack_t * this ) {
     703        __condition_criterion_t * top = this->top;
    704704        if( top ) {
    705                 this.top = top->next;
     705                this->top = top->next;
    706706                top->next = NULL;
    707707        }
  • src/libcfa/concurrency/kernel_private.h

    r3f7e12cb r78315272  
    4848void BlockInternal(thread_desc * thrd);
    4949void BlockInternal(spinlock * lock, thread_desc * thrd);
    50 void BlockInternal(spinlock * locks [], unsigned short count);
    51 void BlockInternal(spinlock * locks [], unsigned short count, thread_desc * thrds [], unsigned short thrd_count);
     50void BlockInternal(spinlock ** locks, unsigned short count);
     51void BlockInternal(spinlock ** locks, unsigned short count, thread_desc ** thrds, unsigned short thrd_count);
    5252void LeaveThread(spinlock * lock, thread_desc * thrd);
    5353
  • src/libcfa/concurrency/monitor

    r3f7e12cb r78315272  
    1010// Created On       : Thd Feb 23 12:27:26 2017
    1111// Last Modified By : Peter A. Buhr
    12 // Last Modified On : Sat Oct  7 18:06:45 2017
    13 // Update Count     : 10
     12// Last Modified On : Sat Jul 22 09:59:01 2017
     13// Update Count     : 3
    1414//
    1515
     
    2222#include "stdlib"
    2323
    24 trait is_monitor(dtype T) {
    25         monitor_desc * get_monitor( T & );
    26         void ^?{}( T & mutex );
    27 };
    28 
    2924static inline void ?{}(monitor_desc & this) {
    3025        (this.lock){};
     26        this.owner = NULL;
    3127        (this.entry_queue){};
    3228        (this.signal_stack){};
    33         this.owner         = NULL;
    34         this.recursion     = 0;
    35         this.mask.accepted = NULL;
    36         this.mask.clauses  = NULL;
    37         this.mask.size     = 0;
    38         this.dtor_node     = NULL;
     29        this.recursion = 0;
     30        this.acceptables = NULL;
     31        this.acceptable_count = 0;
     32        this.accepted_index = -1;
    3933}
    4034
    4135struct monitor_guard_t {
    4236        monitor_desc ** m;
    43         __lock_size_t  count;
     37        int count;
    4438        monitor_desc ** prev_mntrs;
    45         __lock_size_t   prev_count;
     39        unsigned short  prev_count;
    4640        fptr_t          prev_func;
    4741};
    4842
    49 void ?{}( monitor_guard_t & this, monitor_desc ** m, __lock_size_t count, void (*func)() );
     43static inline int ?<?(monitor_desc* lhs, monitor_desc* rhs) {
     44        return ((intptr_t)lhs) < ((intptr_t)rhs);
     45}
     46
     47void ?{}( monitor_guard_t & this, monitor_desc ** m, int count, void (*func)() );
    5048void ^?{}( monitor_guard_t & this );
    51 
    52 struct monitor_dtor_guard_t {
    53         monitor_desc * m;
    54         monitor_desc ** prev_mntrs;
    55         __lock_size_t   prev_count;
    56         fptr_t          prev_func;
    57 };
    58 
    59 void ?{}( monitor_dtor_guard_t & this, monitor_desc ** m, void (*func)() );
    60 void ^?{}( monitor_dtor_guard_t & this );
    61 
    62 static inline forall( dtype T | sized(T) | { void ^?{}( T & mutex ); } )
    63 void delete( T * th ) {
    64         ^(*th){};
    65         free( th );
    66 }
    6749
    6850//-----------------------------------------------------------------------------
     
    7052
    7153struct __condition_criterion_t {
    72         // Whether or not the criterion is met (True if met)
    73         bool ready;
    74 
    75         // The monitor this criterion concerns
    76         monitor_desc * target;
    77 
    78         // The parent node to which this criterion belongs
    79         struct __condition_node_t * owner;
    80 
    81         // Intrusive linked list Next field
    82         __condition_criterion_t * next;
     54        bool ready;                                             //Whether or not the criterion is met (True if met)
     55        monitor_desc * target;                          //The monitor this criterion concerns
     56        struct __condition_node_t * owner;              //The parent node to which this criterion belongs
     57        __condition_criterion_t * next;         //Intrusive linked list Next field
    8358};
    8459
    8560struct __condition_node_t {
    86         // Thread that needs to be woken when all criteria are met
    87         thread_desc * waiting_thread;
    88 
    89         // Array of criteria (Criterions are contiguous in memory)
    90         __condition_criterion_t * criteria;
    91 
    92         // Number of criterions in the criteria
    93         __lock_size_t count;
    94 
    95         // Intrusive linked list Next field
    96         __condition_node_t * next;
    97 
    98         // Custom user info accessible before signalling
    99         uintptr_t user_info;
     61        thread_desc * waiting_thread;                   //Thread that needs to be woken when all criteria are met
     62        __condition_criterion_t * criteria;     //Array of criteria (Criterions are contiguous in memory)
     63        unsigned short count;                           //Number of criterions in the criteria
     64        __condition_node_t * next;                      //Intrusive linked list Next field
     65        uintptr_t user_info;                            //Custom user info accessible before signalling
    10066};
    10167
     
    10571};
    10672
    107 void ?{}(__condition_node_t & this, thread_desc * waiting_thread, __lock_size_t count, uintptr_t user_info );
    108 void ?{}(__condition_criterion_t & this );
    109 void ?{}(__condition_criterion_t & this, monitor_desc * target, __condition_node_t * owner );
    110 
    11173void ?{}( __condition_blocked_queue_t & );
    112 void append( __condition_blocked_queue_t &, __condition_node_t * );
    113 __condition_node_t * pop_head( __condition_blocked_queue_t & );
     74void append( __condition_blocked_queue_t *, __condition_node_t * );
     75__condition_node_t * pop_head( __condition_blocked_queue_t * );
    11476
    11577struct condition {
    116         // Link list which contains the blocked threads as-well as the information needed to unblock them
    117         __condition_blocked_queue_t blocked;
    118 
    119         // Array of monitor pointers (Monitors are NOT contiguous in memory)
    120         monitor_desc ** monitors;
    121 
    122         // Number of monitors in the array
    123         __lock_size_t monitor_count;
     78        __condition_blocked_queue_t blocked;    //Link list which contains the blocked threads as-well as the information needed to unblock them
     79        monitor_desc ** monitors;                       //Array of monitor pointers (Monitors are NOT contiguous in memory)
     80        unsigned short monitor_count;                   //Number of monitors in the array
    12481};
    12582
     
    13390}
    13491
    135               void wait        ( condition & this, uintptr_t user_info = 0 );
    136               bool signal      ( condition & this );
    137               bool signal_block( condition & this );
    138 static inline bool is_empty    ( condition & this ) { return !this.blocked.head; }
    139          uintptr_t front       ( condition & this );
     92void wait( condition * this, uintptr_t user_info = 0 );
     93bool signal( condition * this );
     94bool signal_block( condition * this );
     95static inline bool is_empty( condition * this ) { return !this->blocked.head; }
     96uintptr_t front( condition * this );
    14097
    14198//-----------------------------------------------------------------------------
     
    143100
    144101struct __acceptable_t {
    145         __monitor_group_t;
     102        fptr_t func;
     103        unsigned short count;
     104        monitor_desc ** monitors;
    146105        bool is_dtor;
    147106};
    148107
    149 void __waitfor_internal( const __waitfor_mask_t & mask, int duration );
     108int __accept_internal( unsigned short count, __acceptable_t * acceptables );
    150109
    151110// Local Variables: //
  • src/libcfa/concurrency/monitor.c

    r3f7e12cb r78315272  
    1717
    1818#include <stdlib>
    19 #include <inttypes.h>
    2019
    2120#include "libhdr.h"
    2221#include "kernel_private.h"
    2322
    24 #include "bits/algorithms.h"
    25 
    2623//-----------------------------------------------------------------------------
    2724// Forward declarations
    28 static inline void set_owner ( monitor_desc * this, thread_desc * owner );
    29 static inline void set_owner ( monitor_desc * storage [], __lock_size_t count, thread_desc * owner );
    30 static inline void set_mask  ( monitor_desc * storage [], __lock_size_t count, const __waitfor_mask_t & mask );
    31 static inline void reset_mask( monitor_desc * this );
    32 
     25static inline void set_owner( monitor_desc * this, thread_desc * owner );
    3326static inline thread_desc * next_thread( monitor_desc * this );
    34 static inline bool is_accepted( monitor_desc * this, const __monitor_group_t & monitors );
    35 
    36 static inline void lock_all  ( spinlock * locks [], __lock_size_t count );
    37 static inline void lock_all  ( monitor_desc * source [], spinlock * /*out*/ locks [], __lock_size_t count );
    38 static inline void unlock_all( spinlock * locks [], __lock_size_t count );
    39 static inline void unlock_all( monitor_desc * locks [], __lock_size_t count );
    40 
    41 static inline void save   ( monitor_desc * ctx [], __lock_size_t count, spinlock * locks [], unsigned int /*out*/ recursions [], __waitfor_mask_t /*out*/ masks [] );
    42 static inline void restore( monitor_desc * ctx [], __lock_size_t count, spinlock * locks [], unsigned int /*in */ recursions [], __waitfor_mask_t /*in */ masks [] );
    43 
    44 static inline void init     ( __lock_size_t count, monitor_desc * monitors [], __condition_node_t & waiter, __condition_criterion_t criteria [] );
    45 static inline void init_push( __lock_size_t count, monitor_desc * monitors [], __condition_node_t & waiter, __condition_criterion_t criteria [] );
    46 
    47 static inline thread_desc *        check_condition   ( __condition_criterion_t * );
    48 static inline void                 brand_condition   ( condition & );
    49 static inline [thread_desc *, int] search_entry_queue( const __waitfor_mask_t &, monitor_desc * monitors [], __lock_size_t count );
    50 
    51 forall(dtype T | sized( T ))
    52 static inline __lock_size_t insert_unique( T * array [], __lock_size_t & size, T * val );
    53 static inline __lock_size_t count_max    ( const __waitfor_mask_t & mask );
    54 static inline __lock_size_t aggregate    ( monitor_desc * storage [], const __waitfor_mask_t & mask );
     27static inline int is_accepted( thread_desc * owner, monitor_desc * this, monitor_desc ** group, int group_cnt, void (*func)() );
     28
     29static inline void lock_all( spinlock ** locks, unsigned short count );
     30static inline void lock_all( monitor_desc ** source, spinlock ** /*out*/ locks, unsigned short count );
     31static inline void unlock_all( spinlock ** locks, unsigned short count );
     32static inline void unlock_all( monitor_desc ** locks, unsigned short count );
     33
     34static inline void save_recursion   ( monitor_desc ** ctx, unsigned int * /*out*/ recursions, unsigned short count );
     35static inline void restore_recursion( monitor_desc ** ctx, unsigned int * /*in */ recursions, unsigned short count );
     36
     37static inline void init     ( int count, monitor_desc ** monitors, __condition_node_t * waiter, __condition_criterion_t * criteria );
     38static inline void init_push( int count, monitor_desc ** monitors, __condition_node_t * waiter, __condition_criterion_t * criteria );
     39
     40static inline thread_desc * check_condition( __condition_criterion_t * );
     41static inline void brand_condition( condition * );
     42static inline unsigned short insert_unique( thread_desc ** thrds, unsigned short end, thread_desc * val );
     43
     44static inline thread_desc * search_entry_queue( __acceptable_t * acceptables, int acc_count, monitor_desc ** monitors, int count );
    5545
    5646//-----------------------------------------------------------------------------
    5747// Useful defines
    58 #define wait_ctx(thrd, user_info)                               /* Create the necessary information to use the signaller stack                         */ \
    59         __condition_node_t waiter = { thrd, count, user_info };   /* Create the node specific to this wait operation                                     */ \
    60         __condition_criterion_t criteria[count];                  /* Create the creteria this wait operation needs to wake up                            */ \
    61         init( count, monitors, waiter, criteria );                /* Link everything together                                                            */ \
    62 
    63 #define wait_ctx_primed(thrd, user_info)                        /* Create the necessary information to use the signaller stack                         */ \
    64         __condition_node_t waiter = { thrd, count, user_info };   /* Create the node specific to this wait operation                                     */ \
    65         __condition_criterion_t criteria[count];                  /* Create the creteria this wait operation needs to wake up                            */ \
    66         init_push( count, monitors, waiter, criteria );           /* Link everything together and push it to the AS-Stack                                */ \
    67 
    68 #define monitor_ctx( mons, cnt )                                /* Define that create the necessary struct for internal/external scheduling operations */ \
    69         monitor_desc ** monitors = mons;                          /* Save the targeted monitors                                                          */ \
    70         __lock_size_t count = cnt;                                /* Save the count to a local variable                                                  */ \
    71         unsigned int recursions[ count ];                         /* Save the current recursion levels to restore them later                             */ \
    72         __waitfor_mask_t masks [ count ];                         /* Save the current waitfor masks to restore them later                                */ \
    73         spinlock *   locks     [ count ];                         /* We need to pass-in an array of locks to BlockInternal                               */ \
    74 
    75 #define monitor_save    save   ( monitors, count, locks, recursions, masks )
    76 #define monitor_restore restore( monitors, count, locks, recursions, masks )
    77 
     48#define wait_ctx(thrd, user_info)                               /* Create the necessary information to use the signaller stack       */ \
     49        __condition_node_t waiter = { thrd, count, user_info };   /* Create the node specific to this wait operation                   */ \
     50        __condition_criterion_t criteria[count];                  /* Create the creteria this wait operation needs to wake up          */ \
     51        init( count, monitors, &waiter, criteria );               /* Link everything together                                          */ \
     52
     53#define wait_ctx_primed(thrd, user_info)                        /* Create the necessary information to use the signaller stack       */ \
     54        __condition_node_t waiter = { thrd, count, user_info };   /* Create the node specific to this wait operation                   */ \
     55        __condition_criterion_t criteria[count];                  /* Create the creteria this wait operation needs to wake up          */ \
     56        init_push( count, monitors, &waiter, criteria );          /* Link everything together and push it to the AS-Stack              */ \
     57
     58#define monitor_ctx( mons, cnt )              /* Define that create the necessary struct for internal/external scheduling operations */ \
     59        monitor_desc ** monitors = mons;        /* Save the targeted monitors                                                          */ \
     60        unsigned short count = cnt;             /* Save the count to a local variable                                                  */ \
     61        unsigned int recursions[ count ];       /* Save the current recursion levels to restore them later                             */ \
     62        spinlock *   locks     [ count ];       /* We need to pass-in an array of locks to BlockInternal                               */ \
    7863
    7964//-----------------------------------------------------------------------------
     
    8368extern "C" {
    8469        // Enter single monitor
    85         static void __enter_monitor_desc( monitor_desc * this, const __monitor_group_t & group ) {
     70        static void __enter_monitor_desc( monitor_desc * this, monitor_desc ** group, int group_cnt, void (*func)() ) {
    8671                // Lock the monitor spinlock, lock_yield to reduce contention
    8772                lock_yield( &this->lock DEBUG_CTX2 );
     
    9075                LIB_DEBUG_PRINT_SAFE("Kernel : %10p Entering mon %p (%p)\n", thrd, this, this->owner);
    9176
     77                this->accepted_index = -1;
    9278                if( !this->owner ) {
    9379                        // No one has the monitor, just take it
     
    9783                }
    9884                else if( this->owner == thrd) {
    99                         // We already have the monitor, just note how many times we took it
     85                        // We already have the monitor, just not how many times we took it
     86                        verify( this->recursion > 0 );
    10087                        this->recursion += 1;
    10188
    10289                        LIB_DEBUG_PRINT_SAFE("Kernel :  mon already owned \n");
    10390                }
    104                 else if( is_accepted( this, group) ) {
     91                else if( (this->accepted_index = is_accepted( thrd, this, group, group_cnt, func)) >= 0 ) {
    10592                        // Some one was waiting for us, enter
    10693                        set_owner( this, thrd );
    10794
    108                         // Reset mask
    109                         reset_mask( this );
    110 
    11195                        LIB_DEBUG_PRINT_SAFE("Kernel :  mon accepts \n");
    11296                }
     
    11599
    116100                        // Some one else has the monitor, wait in line for it
    117                         append( this->entry_queue, thrd );
     101                        append( &this->entry_queue, thrd );
    118102                        BlockInternal( &this->lock );
    119103
     
    129113                unlock( &this->lock );
    130114                return;
    131         }
    132 
    133         static void __enter_monitor_dtor( monitor_desc * this, fptr_t func ) {
    134                 // Lock the monitor spinlock, lock_yield to reduce contention
    135                 lock_yield( &this->lock DEBUG_CTX2 );
    136                 thread_desc * thrd = this_thread;
    137 
    138                 LIB_DEBUG_PRINT_SAFE("Kernel : %10p Entering dtor for mon %p (%p)\n", thrd, this, this->owner);
    139 
    140 
    141                 if( !this->owner ) {
    142                         LIB_DEBUG_PRINT_SAFE("Kernel : Destroying free mon %p\n", this);
    143 
    144                         // No one has the monitor, just take it
    145                         set_owner( this, thrd );
    146 
    147                         unlock( &this->lock );
    148                         return;
    149                 }
    150                 else if( this->owner == thrd) {
    151                         // We already have the monitor... but where about to destroy it so the nesting will fail
    152                         // Abort!
    153                         abortf("Attempt to destroy monitor %p by thread \"%.256s\" (%p) in nested mutex.");
    154                 }
    155 
    156                 __lock_size_t count = 1;
    157                 monitor_desc ** monitors = &this;
    158                 __monitor_group_t group = { &this, 1, func };
    159                 if( is_accepted( this, group) ) {
    160                         LIB_DEBUG_PRINT_SAFE("Kernel :  mon accepts dtor, block and signal it \n");
    161 
    162                         // Wake the thread that is waiting for this
    163                         __condition_criterion_t * urgent = pop( this->signal_stack );
    164                         verify( urgent );
    165 
    166                         // Reset mask
    167                         reset_mask( this );
    168 
    169                         // Create the node specific to this wait operation
    170                         wait_ctx_primed( this_thread, 0 )
    171 
    172                         // Some one else has the monitor, wait for him to finish and then run
    173                         BlockInternal( &this->lock, urgent->owner->waiting_thread );
    174 
    175                         // Some one was waiting for us, enter
    176                         set_owner( this, thrd );
    177                 }
    178                 else {
    179                         LIB_DEBUG_PRINT_SAFE("Kernel :  blocking \n");
    180 
    181                         wait_ctx( this_thread, 0 )
    182                         this->dtor_node = &waiter;
    183 
    184                         // Some one else has the monitor, wait in line for it
    185                         append( this->entry_queue, thrd );
    186                         BlockInternal( &this->lock );
    187 
    188                         // BlockInternal will unlock spinlock, no need to unlock ourselves
    189                         return;
    190                 }
    191 
    192                 LIB_DEBUG_PRINT_SAFE("Kernel : Destroying %p\n", this);
    193 
    194115        }
    195116
     
    199120                lock_yield( &this->lock DEBUG_CTX2 );
    200121
    201                 LIB_DEBUG_PRINT_SAFE("Kernel : %10p Leaving mon %p (%p)\n", this_thread, this, this->owner);
    202 
    203                 verifyf( this_thread == this->owner, "Expected owner to be %p, got %p (r: %i, m: %p)", this_thread, this->owner, this->recursion, this );
     122                verifyf( this_thread == this->owner, "Expected owner to be %p, got %p (r: %i)", this_thread, this->owner, this->recursion );
    204123
    205124                // Leaving a recursion level, decrement the counter
     
    209128                // it means we don't need to do anything
    210129                if( this->recursion != 0) {
    211                         LIB_DEBUG_PRINT_SAFE("Kernel :  recursion still %d\n", this->recursion);
    212130                        unlock( &this->lock );
    213131                        return;
     
    222140                //We need to wake-up the thread
    223141                WakeThread( new_owner );
    224         }
    225 
    226         // Leave single monitor for the last time
    227         void __leave_dtor_monitor_desc( monitor_desc * this ) {
    228                 LIB_DEBUG_DO(
    229                         if( this_thread != this->owner ) {
    230                                 abortf("Destroyed monitor %p has inconsistent owner, expected %p got %p.\n", this, this_thread, this->owner);
    231                         }
    232                         if( this->recursion != 1 ) {
    233                                 abortf("Destroyed monitor %p has %d outstanding nested calls.\n", this, this->recursion - 1);
    234                         }
    235                 )
    236142        }
    237143
     
    240146        // Should never return
    241147        void __leave_thread_monitor( thread_desc * thrd ) {
    242                 monitor_desc * this = &thrd->self_mon;
     148                monitor_desc * this = &thrd->mon;
    243149
    244150                // Lock the monitor now
     
    247153                disable_interrupts();
    248154
    249                 thrd->self_cor.state = Halted;
    250 
    251                 verifyf( thrd == this->owner, "Expected owner to be %p, got %p (r: %i, m: %p)", thrd, this->owner, this->recursion, this );
     155                thrd->cor.state = Halted;
     156
     157                verifyf( thrd == this->owner, "Expected owner to be %p, got %p (r: %i)", thrd, this->owner, this->recursion );
    252158
    253159                // Leaving a recursion level, decrement the counter
     
    272178// Enter multiple monitor
    273179// relies on the monitor array being sorted
    274 static inline void enter( __monitor_group_t monitors ) {
    275         for( __lock_size_t i = 0; i < monitors.size; i++) {
    276                 __enter_monitor_desc( monitors.list[i], monitors );
     180static inline void enter(monitor_desc ** monitors, int count, void (*func)() ) {
     181        for(int i = 0; i < count; i++) {
     182                __enter_monitor_desc( monitors[i], monitors, count, func );
    277183        }
    278184}
     
    280186// Leave multiple monitor
    281187// relies on the monitor array being sorted
    282 static inline void leave(monitor_desc * monitors [], __lock_size_t count) {
    283         for( __lock_size_t i = count - 1; i >= 0; i--) {
     188static inline void leave(monitor_desc ** monitors, int count) {
     189        for(int i = count - 1; i >= 0; i--) {
    284190                __leave_monitor_desc( monitors[i] );
    285191        }
     
    288194// Ctor for monitor guard
    289195// Sorts monitors before entering
    290 void ?{}( monitor_guard_t & this, monitor_desc * m [], __lock_size_t count, fptr_t func ) {
     196void ?{}( monitor_guard_t & this, monitor_desc ** m, int count, void (*func)() ) {
    291197        // Store current array
    292198        this.m = m;
     
    294200
    295201        // Sort monitors based on address -> TODO use a sort specialized for small numbers
    296         __libcfa_small_sort(this.m, count);
     202        qsort(this.m, count);
    297203
    298204        // Save previous thread context
    299         this.[prev_mntrs, prev_count, prev_func] = this_thread->monitors.[list, size, func];
     205        this.prev_mntrs = this_thread->current_monitors;
     206        this.prev_count = this_thread->current_monitor_count;
     207        this.prev_func  = this_thread->current_monitor_func;
    300208
    301209        // Update thread context (needed for conditions)
    302         this_thread->monitors.[list, size, func] = [m, count, func];
    303 
    304         // LIB_DEBUG_PRINT_SAFE("MGUARD : enter %d\n", count);
     210        this_thread->current_monitors      = m;
     211        this_thread->current_monitor_count = count;
     212        this_thread->current_monitor_func  = func;
    305213
    306214        // Enter the monitors in order
    307         __monitor_group_t group = {this.m, this.count, func};
    308         enter( group );
    309 
    310         // LIB_DEBUG_PRINT_SAFE("MGUARD : entered\n");
     215        enter( this.m, this.count, func );
    311216}
    312217
     
    314219// Dtor for monitor guard
    315220void ^?{}( monitor_guard_t & this ) {
    316         // LIB_DEBUG_PRINT_SAFE("MGUARD : leaving %d\n", this.count);
    317 
    318221        // Leave the monitors in order
    319222        leave( this.m, this.count );
    320223
    321         // LIB_DEBUG_PRINT_SAFE("MGUARD : left\n");
    322 
    323224        // Restore thread context
    324         this_thread->monitors.[list, size, func] = this.[prev_mntrs, prev_count, prev_func];
    325 }
    326 
    327 // Ctor for monitor guard
    328 // Sorts monitors before entering
    329 void ?{}( monitor_dtor_guard_t & this, monitor_desc * m [], fptr_t func ) {
    330         // Store current array
    331         this.m = *m;
    332 
    333         // Save previous thread context
    334         this.[prev_mntrs, prev_count, prev_func] = this_thread->monitors.[list, size, func];
    335 
    336         // Update thread context (needed for conditions)
    337         this_thread->monitors.[list, size, func] = [m, 1, func];
    338 
    339         __enter_monitor_dtor( this.m, func );
    340 }
    341 
    342 // Dtor for monitor guard
    343 void ^?{}( monitor_dtor_guard_t & this ) {
    344         // Leave the monitors in order
    345         __leave_dtor_monitor_desc( this.m );
    346 
    347         // Restore thread context
    348         this_thread->monitors.[list, size, func] = this.[prev_mntrs, prev_count, prev_func];
     225        this_thread->current_monitors      = this.prev_mntrs;
     226        this_thread->current_monitor_count = this.prev_count;
     227        this_thread->current_monitor_func  = this.prev_func;
    349228}
    350229
    351230//-----------------------------------------------------------------------------
    352231// Internal scheduling types
    353 void ?{}(__condition_node_t & this, thread_desc * waiting_thread, __lock_size_t count, uintptr_t user_info ) {
     232void ?{}(__condition_node_t & this, thread_desc * waiting_thread, unsigned short count, uintptr_t user_info ) {
    354233        this.waiting_thread = waiting_thread;
    355234        this.count = count;
     
    365244}
    366245
    367 void ?{}(__condition_criterion_t & this, monitor_desc * target, __condition_node_t & owner ) {
     246void ?{}(__condition_criterion_t & this, monitor_desc * target, __condition_node_t * owner ) {
    368247        this.ready  = false;
    369248        this.target = target;
    370         this.owner  = &owner;
     249        this.owner  = owner;
    371250        this.next   = NULL;
    372251}
     
    374253//-----------------------------------------------------------------------------
    375254// Internal scheduling
    376 void wait( condition & this, uintptr_t user_info = 0 ) {
     255void wait( condition * this, uintptr_t user_info = 0 ) {
    377256        brand_condition( this );
    378257
    379258        // Check that everything is as expected
    380         assertf( this.monitors != NULL, "Waiting with no monitors (%p)", this.monitors );
    381         verifyf( this.monitor_count != 0, "Waiting with 0 monitors (%"PRIiFAST16")", this.monitor_count );
    382         verifyf( this.monitor_count < 32u, "Excessive monitor count (%"PRIiFAST16")", this.monitor_count );
     259        assertf( this->monitors != NULL, "Waiting with no monitors (%p)", this->monitors );
     260        verifyf( this->monitor_count != 0, "Waiting with 0 monitors (%i)", this->monitor_count );
     261        verifyf( this->monitor_count < 32u, "Excessive monitor count (%i)", this->monitor_count );
    383262
    384263        // Create storage for monitor context
    385         monitor_ctx( this.monitors, this.monitor_count );
     264        monitor_ctx( this->monitors, this->monitor_count );
    386265
    387266        // Create the node specific to this wait operation
     
    390269        // Append the current wait operation to the ones already queued on the condition
    391270        // We don't need locks for that since conditions must always be waited on inside monitor mutual exclusion
    392         append( this.blocked, &waiter );
    393 
    394         // Lock all monitors (aggregates the locks as well)
     271        append( &this->blocked, &waiter );
     272
     273        // Lock all monitors (aggregates the lock them as well)
    395274        lock_all( monitors, locks, count );
    396275
     276        // DON'T unlock, ask the kernel to do it
     277
     278        // Save monitor state
     279        save_recursion( monitors, recursions, count );
     280
    397281        // Find the next thread(s) to run
    398         __lock_size_t thread_count = 0;
     282        unsigned short thread_count = 0;
    399283        thread_desc * threads[ count ];
    400         __builtin_memset( threads, 0, sizeof( threads ) );
    401 
    402         // Save monitor states
    403         monitor_save;
     284        for(int i = 0; i < count; i++) {
     285                threads[i] = 0;
     286        }
    404287
    405288        // Remove any duplicate threads
    406         for( __lock_size_t i = 0; i < count; i++) {
     289        for( int i = 0; i < count; i++) {
    407290                thread_desc * new_owner = next_thread( monitors[i] );
    408                 insert_unique( threads, thread_count, new_owner );
     291                thread_count = insert_unique( threads, thread_count, new_owner );
    409292        }
    410293
     
    412295        BlockInternal( locks, count, threads, thread_count );
    413296
     297
     298        // WE WOKE UP
     299
     300
    414301        // We are back, restore the owners and recursions
    415         monitor_restore;
    416 }
    417 
    418 bool signal( condition & this ) {
     302        lock_all( locks, count );
     303        restore_recursion( monitors, recursions, count );
     304        unlock_all( locks, count );
     305}
     306
     307bool signal( condition * this ) {
    419308        if( is_empty( this ) ) { return false; }
    420309
    421310        //Check that everything is as expected
    422         verify( this.monitors );
    423         verify( this.monitor_count != 0 );
     311        verify( this->monitors );
     312        verify( this->monitor_count != 0 );
    424313
    425314        //Some more checking in debug
    426315        LIB_DEBUG_DO(
    427316                thread_desc * this_thrd = this_thread;
    428                 if ( this.monitor_count != this_thrd->monitors.size ) {
    429                         abortf( "Signal on condition %p made with different number of monitor(s), expected %i got %i", &this, this.monitor_count, this_thrd->monitors.size );
    430                 }
    431 
    432                 for(int i = 0; i < this.monitor_count; i++) {
    433                         if ( this.monitors[i] != this_thrd->monitors.list[i] ) {
    434                                 abortf( "Signal on condition %p made with different monitor, expected %p got %i", &this, this.monitors[i], this_thrd->monitors.list[i] );
     317                if ( this->monitor_count != this_thrd->current_monitor_count ) {
     318                        abortf( "Signal on condition %p made with different number of monitor(s), expected %i got %i", this, this->monitor_count, this_thrd->current_monitor_count );
     319                }
     320
     321                for(int i = 0; i < this->monitor_count; i++) {
     322                        if ( this->monitors[i] != this_thrd->current_monitors[i] ) {
     323                                abortf( "Signal on condition %p made with different monitor, expected %p got %i", this, this->monitors[i], this_thrd->current_monitors[i] );
    435324                        }
    436325                }
    437326        );
    438327
    439         __lock_size_t count = this.monitor_count;
     328        unsigned short count = this->monitor_count;
    440329
    441330        // Lock all monitors
    442         lock_all( this.monitors, NULL, count );
     331        lock_all( this->monitors, NULL, count );
    443332
    444333        //Pop the head of the waiting queue
    445         __condition_node_t * node = pop_head( this.blocked );
     334        __condition_node_t * node = pop_head( &this->blocked );
    446335
    447336        //Add the thread to the proper AS stack
     
    449338                __condition_criterion_t * crit = &node->criteria[i];
    450339                assert( !crit->ready );
    451                 push( crit->target->signal_stack, crit );
     340                push( &crit->target->signal_stack, crit );
    452341        }
    453342
    454343        //Release
    455         unlock_all( this.monitors, count );
     344        unlock_all( this->monitors, count );
    456345
    457346        return true;
    458347}
    459348
    460 bool signal_block( condition & this ) {
    461         if( !this.blocked.head ) { return false; }
     349bool signal_block( condition * this ) {
     350        if( !this->blocked.head ) { return false; }
    462351
    463352        //Check that everything is as expected
    464         verifyf( this.monitors != NULL, "Waiting with no monitors (%p)", this.monitors );
    465         verifyf( this.monitor_count != 0, "Waiting with 0 monitors (%"PRIiFAST16")", this.monitor_count );
     353        verifyf( this->monitors != NULL, "Waiting with no monitors (%p)", this->monitors );
     354        verifyf( this->monitor_count != 0, "Waiting with 0 monitors (%i)", this->monitor_count );
    466355
    467356        // Create storage for monitor context
    468         monitor_ctx( this.monitors, this.monitor_count );
     357        monitor_ctx( this->monitors, this->monitor_count );
    469358
    470359        // Lock all monitors (aggregates the locks them as well)
     
    475364
    476365        //save contexts
    477         monitor_save;
     366        save_recursion( monitors, recursions, count );
    478367
    479368        //Find the thread to run
    480         thread_desc * signallee = pop_head( this.blocked )->waiting_thread;
    481         set_owner( monitors, count, signallee );
    482 
    483         LIB_DEBUG_PRINT_BUFFER_DECL( "Kernel : signal_block condition %p (s: %p)\n", &this, signallee );
     369        thread_desc * signallee = pop_head( &this->blocked )->waiting_thread;
     370        for(int i = 0; i < count; i++) {
     371                set_owner( monitors[i], signallee );
     372        }
    484373
    485374        //Everything is ready to go to sleep
     
    490379
    491380
    492         LIB_DEBUG_PRINT_BUFFER_LOCAL( "Kernel :   signal_block returned\n" );
    493 
    494         //We are back, restore the masks and recursions
    495         monitor_restore;
     381        //We are back, restore the owners and recursions
     382        lock_all( locks, count );
     383        restore_recursion( monitors, recursions, count );
     384        unlock_all( locks, count );
    496385
    497386        return true;
     
    499388
    500389// Access the user_info of the thread waiting at the front of the queue
    501 uintptr_t front( condition & this ) {
     390uintptr_t front( condition * this ) {
    502391        verifyf( !is_empty(this),
    503392                "Attempt to access user data on an empty condition.\n"
    504393                "Possible cause is not checking if the condition is empty before reading stored data."
    505394        );
    506         return this.blocked.head->user_info;
     395        return this->blocked.head->user_info;
    507396}
    508397
    509398//-----------------------------------------------------------------------------
    510 // External scheduling
    511 // cases to handle :
    512 //      - target already there :
    513 //              block and wake
    514 //      - dtor already there
    515 //              put thread on signaller stack
    516 //      - non-blocking
    517 //              return else
    518 //      - timeout
    519 //              return timeout
    520 //      - block
    521 //              setup mask
    522 //              block
    523 void __waitfor_internal( const __waitfor_mask_t & mask, int duration ) {
    524         // This statment doesn't have a contiguous list of monitors...
    525         // Create one!
    526         __lock_size_t max = count_max( mask );
    527         monitor_desc * mon_storage[max];
    528         __builtin_memset( mon_storage, 0, sizeof( mon_storage ) );
    529         __lock_size_t actual_count = aggregate( mon_storage, mask );
    530 
    531         LIB_DEBUG_PRINT_BUFFER_DECL( "Kernel : waitfor %d (s: %d, m: %d)\n", actual_count, mask.size, (__lock_size_t)max);
    532 
    533         if(actual_count == 0) return;
    534 
    535         LIB_DEBUG_PRINT_BUFFER_LOCAL( "Kernel : waitfor internal proceeding\n");
     399// Internal scheduling
     400int __accept_internal( unsigned short acc_count, __acceptable_t * acceptables ) {
     401        thread_desc * thrd = this_thread;
    536402
    537403        // Create storage for monitor context
    538         monitor_ctx( mon_storage, actual_count );
    539 
    540         // Lock all monitors (aggregates the locks as well)
     404        monitor_ctx( acceptables->monitors, acceptables->count );
     405
     406        // Lock all monitors (aggregates the lock them as well)
    541407        lock_all( monitors, locks, count );
    542408
    543         {
    544                 // Check if the entry queue
    545                 thread_desc * next; int index;
    546                 [next, index] = search_entry_queue( mask, monitors, count );
    547 
    548                 if( next ) {
    549                         *mask.accepted = index;
    550                         if( mask.clauses[index].is_dtor ) {
    551                                 LIB_DEBUG_PRINT_BUFFER_LOCAL( "Kernel : dtor already there\n");
    552                                 verifyf( mask.clauses[index].size == 1        , "ERROR: Accepted dtor has more than 1 mutex parameter." );
    553 
    554                                 monitor_desc * mon2dtor = mask.clauses[index].list[0];
    555                                 verifyf( mon2dtor->dtor_node, "ERROR: Accepted monitor has no dtor_node." );
    556 
    557                                 __condition_criterion_t * dtor_crit = mon2dtor->dtor_node->criteria;
    558                                 push( mon2dtor->signal_stack, dtor_crit );
    559 
    560                                 unlock_all( locks, count );
    561                         }
    562                         else {
    563                                 LIB_DEBUG_PRINT_BUFFER_LOCAL( "Kernel : thread present, baton-passing\n");
    564 
    565                                 // Create the node specific to this wait operation
    566                                 wait_ctx_primed( this_thread, 0 );
    567 
    568                                 // Save monitor states
    569                                 monitor_save;
    570 
    571                                 LIB_DEBUG_PRINT_BUFFER_LOCAL( "Kernel :  baton of %d monitors : ", count );
    572                                 #ifdef __CFA_DEBUG_PRINT__
    573                                         for( int i = 0; i < count; i++) {
    574                                                 LIB_DEBUG_PRINT_BUFFER_LOCAL( "%p %p ", monitors[i], monitors[i]->signal_stack.top );
    575                                         }
    576                                 #endif
    577                                 LIB_DEBUG_PRINT_BUFFER_LOCAL( "\n");
    578 
    579                                 // Set the owners to be the next thread
    580                                 set_owner( monitors, count, next );
    581 
    582                                 // Everything is ready to go to sleep
    583                                 BlockInternal( locks, count, &next, 1 );
    584 
    585                                 // We are back, restore the owners and recursions
    586                                 monitor_restore;
    587 
    588                                 LIB_DEBUG_PRINT_BUFFER_LOCAL( "Kernel : thread present, returned\n");
    589                         }
    590 
    591                         LIB_DEBUG_PRINT_BUFFER_LOCAL( "Kernel : accepted %d\n", *mask.accepted);
    592 
    593                         return;
    594                 }
    595         }
    596 
    597 
    598         if( duration == 0 ) {
    599                 LIB_DEBUG_PRINT_BUFFER_LOCAL( "Kernel : non-blocking, exiting\n");
    600 
    601                 unlock_all( locks, count );
    602 
    603                 LIB_DEBUG_PRINT_BUFFER_LOCAL( "Kernel : accepted %d\n", *mask.accepted);
    604                 return;
    605         }
    606 
    607 
    608         verifyf( duration < 0, "Timeout on waitfor statments not supported yet.");
    609 
    610         LIB_DEBUG_PRINT_BUFFER_LOCAL( "Kernel : blocking waitfor\n");
    611 
    612409        // Create the node specific to this wait operation
    613         wait_ctx_primed( this_thread, 0 );
    614 
    615         monitor_save;
    616         set_mask( monitors, count, mask );
    617 
    618         for( __lock_size_t i = 0; i < count; i++) {
    619                 verify( monitors[i]->owner == this_thread );
    620         }
    621 
    622         //Everything is ready to go to sleep
    623         BlockInternal( locks, count );
    624 
    625 
    626         // WE WOKE UP
    627 
    628 
    629         //We are back, restore the masks and recursions
    630         monitor_restore;
    631 
    632         LIB_DEBUG_PRINT_BUFFER_LOCAL( "Kernel : exiting\n");
    633 
    634         LIB_DEBUG_PRINT_BUFFER_LOCAL( "Kernel : accepted %d\n", *mask.accepted);
     410        wait_ctx_primed( thrd, 0 );
     411
     412        // Check if the entry queue
     413        thread_desc * next = search_entry_queue( acceptables, acc_count, monitors, count );
     414
     415        LIB_DEBUG_PRINT_SAFE("Owner(s) :");
     416        for(int i = 0; i < count; i++) {
     417                LIB_DEBUG_PRINT_SAFE(" %p", monitors[i]->owner );
     418        }
     419        LIB_DEBUG_PRINT_SAFE("\n");
     420
     421        LIB_DEBUG_PRINT_SAFE("Passing mon to %p\n", next);
     422
     423        if( !next ) {
     424                // Update acceptables on the current monitors
     425                for(int i = 0; i < count; i++) {
     426                        monitors[i]->acceptables = acceptables;
     427                        monitors[i]->acceptable_count = acc_count;
     428                }
     429        }
     430        else {
     431                for(int i = 0; i < count; i++) {
     432                        set_owner( monitors[i], next );
     433                }
     434        }
     435
     436
     437        save_recursion( monitors, recursions, count );
     438
     439
     440        // Everything is ready to go to sleep
     441        BlockInternal( locks, count, &next, next ? 1 : 0 );
     442
     443
     444        //WE WOKE UP
     445
     446
     447        //We are back, restore the owners and recursions
     448        lock_all( locks, count );
     449        restore_recursion( monitors, recursions, count );
     450        int acc_idx = monitors[0]->accepted_index;
     451        unlock_all( locks, count );
     452
     453        return acc_idx;
    635454}
    636455
     
    639458
    640459static inline void set_owner( monitor_desc * this, thread_desc * owner ) {
    641         // LIB_DEBUG_PRINT_SAFE("Kernal :   Setting owner of %p to %p ( was %p)\n", this, owner, this->owner );
    642 
    643460        //Pass the monitor appropriately
    644461        this->owner = owner;
     
    648465}
    649466
    650 static inline void set_owner( monitor_desc * monitors [], __lock_size_t count, thread_desc * owner ) {
    651         monitors[0]->owner     = owner;
    652         monitors[0]->recursion = 1;
    653         for( __lock_size_t i = 1; i < count; i++ ) {
    654                 monitors[i]->owner     = owner;
    655                 monitors[i]->recursion = 0;
    656         }
    657 }
    658 
    659 static inline void set_mask( monitor_desc * storage [], __lock_size_t count, const __waitfor_mask_t & mask ) {
    660         for( __lock_size_t i = 0; i < count; i++) {
    661                 storage[i]->mask = mask;
    662         }
    663 }
    664 
    665 static inline void reset_mask( monitor_desc * this ) {
    666         this->mask.accepted = NULL;
    667         this->mask.clauses = NULL;
    668         this->mask.size = 0;
    669 }
    670 
    671467static inline thread_desc * next_thread( monitor_desc * this ) {
    672468        //Check the signaller stack
    673         LIB_DEBUG_PRINT_SAFE("Kernel :  mon %p AS-stack top %p\n", this, this->signal_stack.top);
    674         __condition_criterion_t * urgent = pop( this->signal_stack );
     469        __condition_criterion_t * urgent = pop( &this->signal_stack );
    675470        if( urgent ) {
    676471                //The signaller stack is not empty,
     
    684479        // No signaller thread
    685480        // Get the next thread in the entry_queue
    686         thread_desc * new_owner = pop_head( this->entry_queue );
     481        thread_desc * new_owner = pop_head( &this->entry_queue );
    687482        set_owner( this, new_owner );
    688483
     
    690485}
    691486
    692 static inline bool is_accepted( monitor_desc * this, const __monitor_group_t & group ) {
    693         __acceptable_t * it = this->mask.clauses; // Optim
    694         __lock_size_t count = this->mask.size;
     487static inline int is_accepted( thread_desc * owner, monitor_desc * this, monitor_desc ** group, int group_cnt, void (*func)() ) {
     488        __acceptable_t* accs = this->acceptables; // Optim
     489        int acc_cnt = this->acceptable_count;
    695490
    696491        // Check if there are any acceptable functions
    697         if( !it ) return false;
     492        if( !accs ) return -1;
    698493
    699494        // If this isn't the first monitor to test this, there is no reason to repeat the test.
    700         if( this != group[0] ) return group[0]->mask.accepted >= 0;
     495        if( this != group[0] ) return group[0]->accepted_index;
    701496
    702497        // For all acceptable functions check if this is the current function.
    703         for( __lock_size_t i = 0; i < count; i++, it++ ) {
    704                 if( *it == group ) {
    705                         *this->mask.accepted = i;
    706                         return true;
     498        OUT_LOOP:
     499        for( int i = 0; i < acc_cnt; i++ ) {
     500                __acceptable_t * acc = &accs[i];
     501
     502                // if function matches, check the monitors
     503                if( acc->func == func ) {
     504
     505                        // If the group count is different then it can't be a match
     506                        if( acc->count != group_cnt ) return -1;
     507
     508                        // Check that all the monitors match
     509                        for( int j = 0; j < group_cnt; j++ ) {
     510                                // If not a match, check next function
     511                                if( acc->monitors[j] != group[j] ) continue OUT_LOOP;
     512                        }
     513
     514                        // It's a complete match, accept the call
     515                        return i;
    707516                }
    708517        }
    709518
    710519        // No function matched
    711         return false;
    712 }
    713 
    714 static inline void init( __lock_size_t count, monitor_desc * monitors [], __condition_node_t & waiter, __condition_criterion_t criteria [] ) {
    715         for( __lock_size_t i = 0; i < count; i++) {
     520        return -1;
     521}
     522
     523static inline void init( int count, monitor_desc ** monitors, __condition_node_t * waiter, __condition_criterion_t * criteria ) {
     524        for(int i = 0; i < count; i++) {
    716525                (criteria[i]){ monitors[i], waiter };
    717526        }
    718527
    719         waiter.criteria = criteria;
    720 }
    721 
    722 static inline void init_push( __lock_size_t count, monitor_desc * monitors [], __condition_node_t & waiter, __condition_criterion_t criteria [] ) {
    723         for( __lock_size_t i = 0; i < count; i++) {
     528        waiter->criteria = criteria;
     529}
     530
     531static inline void init_push( int count, monitor_desc ** monitors, __condition_node_t * waiter, __condition_criterion_t * criteria ) {
     532        for(int i = 0; i < count; i++) {
    724533                (criteria[i]){ monitors[i], waiter };
    725                 LIB_DEBUG_PRINT_SAFE( "Kernel :  target %p = %p\n", criteria[i].target, &criteria[i] );
    726                 push( criteria[i].target->signal_stack, &criteria[i] );
    727         }
    728 
    729         waiter.criteria = criteria;
    730 }
    731 
    732 static inline void lock_all( spinlock * locks [], __lock_size_t count ) {
    733         for( __lock_size_t i = 0; i < count; i++ ) {
     534                push( &criteria[i].target->signal_stack, &criteria[i] );
     535        }
     536
     537        waiter->criteria = criteria;
     538}
     539
     540static inline void lock_all( spinlock ** locks, unsigned short count ) {
     541        for( int i = 0; i < count; i++ ) {
    734542                lock_yield( locks[i] DEBUG_CTX2 );
    735543        }
    736544}
    737545
    738 static inline void lock_all( monitor_desc * source [], spinlock * /*out*/ locks [], __lock_size_t count ) {
    739         for( __lock_size_t i = 0; i < count; i++ ) {
     546static inline void lock_all( monitor_desc ** source, spinlock ** /*out*/ locks, unsigned short count ) {
     547        for( int i = 0; i < count; i++ ) {
    740548                spinlock * l = &source[i]->lock;
    741549                lock_yield( l DEBUG_CTX2 );
     
    744552}
    745553
    746 static inline void unlock_all( spinlock * locks [], __lock_size_t count ) {
    747         for( __lock_size_t i = 0; i < count; i++ ) {
     554static inline void unlock_all( spinlock ** locks, unsigned short count ) {
     555        for( int i = 0; i < count; i++ ) {
    748556                unlock( locks[i] );
    749557        }
    750558}
    751559
    752 static inline void unlock_all( monitor_desc * locks [], __lock_size_t count ) {
    753         for( __lock_size_t i = 0; i < count; i++ ) {
     560static inline void unlock_all( monitor_desc ** locks, unsigned short count ) {
     561        for( int i = 0; i < count; i++ ) {
    754562                unlock( &locks[i]->lock );
    755563        }
    756564}
    757565
    758 static inline void save(
    759         monitor_desc * ctx [],
    760         __lock_size_t count,
    761         __attribute((unused)) spinlock * locks [],
    762         unsigned int /*out*/ recursions [],
    763         __waitfor_mask_t /*out*/ masks []
    764 ) {
    765         for( __lock_size_t i = 0; i < count; i++ ) {
     566
     567static inline void save_recursion   ( monitor_desc ** ctx, unsigned int * /*out*/ recursions, unsigned short count ) {
     568        for( int i = 0; i < count; i++ ) {
    766569                recursions[i] = ctx[i]->recursion;
    767                 masks[i]      = ctx[i]->mask;
    768         }
    769 }
    770 
    771 static inline void restore(
    772         monitor_desc * ctx [],
    773         __lock_size_t count,
    774         spinlock * locks [],
    775         unsigned int /*out*/ recursions [],
    776         __waitfor_mask_t /*out*/ masks []
    777 ) {
    778         lock_all( locks, count );
    779         for( __lock_size_t i = 0; i < count; i++ ) {
     570        }
     571}
     572
     573static inline void restore_recursion( monitor_desc ** ctx, unsigned int * /*in */ recursions, unsigned short count ) {
     574        for( int i = 0; i < count; i++ ) {
    780575                ctx[i]->recursion = recursions[i];
    781                 ctx[i]->mask      = masks[i];
    782         }
    783         unlock_all( locks, count );
     576        }
    784577}
    785578
     
    806599        }
    807600
    808         LIB_DEBUG_PRINT_SAFE( "Kernel :  Runing %i (%p)\n", ready2run, ready2run ? node->waiting_thread : NULL );
     601        // LIB_DEBUG_PRINT_SAFE( "Runing %i\n", ready2run );
    809602        return ready2run ? node->waiting_thread : NULL;
    810603}
    811604
    812 static inline void brand_condition( condition & this ) {
     605static inline void brand_condition( condition * this ) {
    813606        thread_desc * thrd = this_thread;
    814         if( !this.monitors ) {
     607        if( !this->monitors ) {
    815608                // LIB_DEBUG_PRINT_SAFE("Branding\n");
    816                 assertf( thrd->monitors.list != NULL, "No current monitor to brand condition %p", thrd->monitors.list );
    817                 this.monitor_count = thrd->monitors.size;
    818 
    819                 this.monitors = malloc( this.monitor_count * sizeof( *this.monitors ) );
    820                 for( int i = 0; i < this.monitor_count; i++ ) {
    821                         this.monitors[i] = thrd->monitors.list[i];
    822                 }
    823         }
    824 }
    825 
    826 static inline [thread_desc *, int] search_entry_queue( const __waitfor_mask_t & mask, monitor_desc * monitors [], __lock_size_t count ) {
    827 
    828         __thread_queue_t & entry_queue = monitors[0]->entry_queue;
     609                assertf( thrd->current_monitors != NULL, "No current monitor to brand condition %p", thrd->current_monitors );
     610                this->monitor_count = thrd->current_monitor_count;
     611
     612                this->monitors = malloc( this->monitor_count * sizeof( *this->monitors ) );
     613                for( int i = 0; i < this->monitor_count; i++ ) {
     614                        this->monitors[i] = thrd->current_monitors[i];
     615                }
     616        }
     617}
     618
     619static inline unsigned short insert_unique( thread_desc ** thrds, unsigned short end, thread_desc * val ) {
     620        if( !val ) return end;
     621
     622        for(int i = 0; i <= end; i++) {
     623                if( thrds[i] == val ) return end;
     624        }
     625
     626        thrds[end] = val;
     627        return end + 1;
     628}
     629
     630
     631static inline bool match( __acceptable_t * acc, thread_desc * thrd ) {
     632        verify( thrd );
     633        verify( acc );
     634        if( acc->func != thrd->current_monitor_func ) return false;
     635
     636        return true;
     637}
     638
     639static inline thread_desc * search_entry_queue( __acceptable_t * acceptables, int acc_count, monitor_desc ** monitors, int count ) {
     640
     641        __thread_queue_t * entry_queue = &monitors[0]->entry_queue;
    829642
    830643        // For each thread in the entry-queue
    831         for(    thread_desc ** thrd_it = &entry_queue.head;
     644        for(    thread_desc ** thrd_it = &entry_queue->head;
    832645                *thrd_it;
    833                 thrd_it = &(*thrd_it)->next
    834         ) {
     646                thrd_it = &(*thrd_it)->next)
     647        {
    835648                // For each acceptable check if it matches
    836                 int i = 0;
    837                 __acceptable_t * end = mask.clauses + mask.size;
    838                 for( __acceptable_t * it = mask.clauses; it != end; it++, i++ ) {
     649                __acceptable_t * acc_end = acceptables + acc_count;
     650                for( __acceptable_t * acc_it = acceptables; acc_it != acc_end; acc_it++ ) {
    839651                        // Check if we have a match
    840                         if( *it == (*thrd_it)->monitors ) {
     652                        if( match( acc_it, *thrd_it ) ) {
    841653
    842654                                // If we have a match return it
    843655                                // after removeing it from the entry queue
    844                                 return [remove( entry_queue, thrd_it ), i];
     656                                return remove( entry_queue, thrd_it );
    845657                        }
    846658                }
    847659        }
    848660
    849         return [0, -1];
    850 }
    851 
    852 forall(dtype T | sized( T ))
    853 static inline __lock_size_t insert_unique( T * array [], __lock_size_t & size, T * val ) {
    854         if( !val ) return size;
    855 
    856         for( __lock_size_t i = 0; i <= size; i++) {
    857                 if( array[i] == val ) return size;
    858         }
    859 
    860         array[size] = val;
    861         size = size + 1;
    862         return size;
    863 }
    864 
    865 static inline __lock_size_t count_max( const __waitfor_mask_t & mask ) {
    866         __lock_size_t max = 0;
    867         for( __lock_size_t i = 0; i < mask.size; i++ ) {
    868                 max += mask.clauses[i].size;
    869         }
    870         return max;
    871 }
    872 
    873 static inline __lock_size_t aggregate( monitor_desc * storage [], const __waitfor_mask_t & mask ) {
    874         __lock_size_t size = 0;
    875         for( __lock_size_t i = 0; i < mask.size; i++ ) {
    876                 __libcfa_small_sort( mask.clauses[i].list, mask.clauses[i].size );
    877                 for( __lock_size_t j = 0; j < mask.clauses[i].size; j++) {
    878                         insert_unique( storage, size, mask.clauses[i].list[j] );
    879                 }
    880         }
    881         // TODO insertion sort instead of this
    882         __libcfa_small_sort( storage, size );
    883         return size;
    884 }
    885 
     661        return NULL;
     662}
    886663void ?{}( __condition_blocked_queue_t & this ) {
    887664        this.head = NULL;
     
    889666}
    890667
    891 void append( __condition_blocked_queue_t & this, __condition_node_t * c ) {
    892         verify(this.tail != NULL);
    893         *this.tail = c;
    894         this.tail = &c->next;
    895 }
    896 
    897 __condition_node_t * pop_head( __condition_blocked_queue_t & this ) {
    898         __condition_node_t * head = this.head;
     668void append( __condition_blocked_queue_t * this, __condition_node_t * c ) {
     669        verify(this->tail != NULL);
     670        *this->tail = c;
     671        this->tail = &c->next;
     672}
     673
     674__condition_node_t * pop_head( __condition_blocked_queue_t * this ) {
     675        __condition_node_t * head = this->head;
    899676        if( head ) {
    900                 this.head = head->next;
     677                this->head = head->next;
    901678                if( !head->next ) {
    902                         this.tail = &this.head;
     679                        this->tail = &this->head;
    903680                }
    904681                head->next = NULL;
  • src/libcfa/concurrency/preemption.c

    r3f7e12cb r78315272  
    328328                siginfo_t info;
    329329                int sig = sigwaitinfo( &mask, &info );
    330 
    331                 if( sig < 0 ) {
    332                         //Error!
    333                         int err = errno;
    334                         switch( err ) {
    335                                 case EAGAIN :
    336                                 case EINTR :
    337                                         continue;
    338                         case EINVAL :
    339                                         abortf("Timeout was invalid.");
    340                                 default:
    341                                         abortf("Unhandled error %d", err);
    342                         }
    343                 }
    344330
    345331                // If another signal arrived something went wrong
     
    380366
    381367        if ( sigaction( sig, &act, NULL ) == -1 ) {
    382                 LIB_DEBUG_PRINT_BUFFER_DECL(
     368                LIB_DEBUG_PRINT_BUFFER_DECL( STDERR_FILENO,
    383369                        " __kernel_sigaction( sig:%d, handler:%p, flags:%d ), problem installing signal handler, error(%d) %s.\n",
    384370                        sig, handler, flags, errno, strerror( errno )
     
    397383
    398384        if ( sigaction( sig, &act, NULL ) == -1 ) {
    399                 LIB_DEBUG_PRINT_BUFFER_DECL(
     385                LIB_DEBUG_PRINT_BUFFER_DECL( STDERR_FILENO,
    400386                        " __kernel_sigdefault( sig:%d ), problem reseting signal handler, error(%d) %s.\n",
    401387                        sig, errno, strerror( errno )
  • src/libcfa/concurrency/thread

    r3f7e12cb r78315272  
    3636forall( dtype T | is_thread(T) )
    3737static inline coroutine_desc* get_coroutine(T & this) {
    38         return &get_thread(this)->self_cor;
     38        return &get_thread(this)->cor;
    3939}
    4040
    4141forall( dtype T | is_thread(T) )
    4242static inline monitor_desc* get_monitor(T & this) {
    43         return &get_thread(this)->self_mon;
     43        return &get_thread(this)->mon;
    4444}
    4545
    4646static inline coroutine_desc* get_coroutine(thread_desc * this) {
    47         return &this->self_cor;
     47        return &this->cor;
    4848}
    4949
    5050static inline monitor_desc* get_monitor(thread_desc * this) {
    51         return &this->self_mon;
     51        return &this->mon;
    5252}
    5353
  • src/libcfa/concurrency/thread.c

    r3f7e12cb r78315272  
    3333
    3434void ?{}(thread_desc& this) {
    35         (this.self_cor){};
    36         this.self_cor.name = "Anonymous Coroutine";
    37         this.self_mon.owner = &this;
    38         this.self_mon.recursion = 1;
    39         this.self_mon_p = &this.self_mon;
     35        (this.cor){};
     36        this.cor.name = "Anonymous Coroutine";
     37        this.mon.owner = &this;
     38        this.mon.recursion = 1;
    4039        this.next = NULL;
    4140
    42         (this.monitors){ &this.self_mon_p, 1, (fptr_t)0 };
     41        this.current_monitors      = &this.mon;
     42        this.current_monitor_count = 1;
    4343}
    4444
    4545void ^?{}(thread_desc& this) {
    46         ^(this.self_cor){};
     46        ^(this.cor){};
    4747}
    4848
  • src/libcfa/interpose.c

    r3f7e12cb r78315272  
    127127                        va_end( args );
    128128
    129                         __lib_debug_write( abort_text, len );
    130                         __lib_debug_write( "\n", 1 );
     129                        __lib_debug_write( STDERR_FILENO, abort_text, len );
     130                        __lib_debug_write( STDERR_FILENO, "\n", 1 );
    131131                }
    132132
    133133                len = snprintf( abort_text, abort_text_size, "Cforall Runtime error (UNIX pid:%ld)\n", (long int)getpid() ); // use UNIX pid (versus getPid)
    134                 __lib_debug_write( abort_text, len );
     134                __lib_debug_write( STDERR_FILENO, abort_text, len );
    135135
    136136
  • src/libcfa/iostream

    r3f7e12cb r78315272  
    1010// Created On       : Wed May 27 17:56:53 2015
    1111// Last Modified By : Peter A. Buhr
    12 // Last Modified On : Tue Oct 10 14:51:10 2017
    13 // Update Count     : 140
     12// Last Modified On : Wed Sep 13 12:53:46 2017
     13// Update Count     : 138
    1414//
    1515
     
    7979forall( dtype ostype | ostream( ostype ) ) ostype * ?|?( ostype *, const char * );
    8080forall( dtype ostype | ostream( ostype ) ) ostype * ?|?( ostype *, const char16_t * );
    81 #if ! ( __ARM_ARCH_ISA_ARM == 1 && __ARM_32BIT_STATE == 1 ) // char32_t == wchar_t => ambiguous
    8281forall( dtype ostype | ostream( ostype ) ) ostype * ?|?( ostype *, const char32_t * );
    83 #endif // ! ( __ARM_ARCH_ISA_ARM == 1 && __ARM_32BIT_STATE == 1 )
    8482forall( dtype ostype | ostream( ostype ) ) ostype * ?|?( ostype *, const wchar_t * );
    8583forall( dtype ostype | ostream( ostype ) ) ostype * ?|?( ostype *, const void * );
  • src/libcfa/iostream.c

    r3f7e12cb r78315272  
    1010// Created On       : Wed May 27 17:56:53 2015
    1111// Last Modified By : Peter A. Buhr
    12 // Last Modified On : Tue Oct 10 14:51:09 2017
    13 // Update Count     : 424
     12// Last Modified On : Sun Sep 17 23:24:25 2017
     13// Update Count     : 422
    1414//
    1515
     
    191191} // ?|?
    192192
    193 #if ! ( __ARM_ARCH_ISA_ARM == 1 && __ARM_32BIT_STATE == 1 ) // char32_t == wchar_t => ambiguous
    194193forall( dtype ostype | ostream( ostype ) )
    195194ostype * ?|?( ostype * os, const char32_t * str ) {
     
    198197        return os;
    199198} // ?|?
    200 #endif // ! ( __ARM_ARCH_ISA_ARM == 1 && __ARM_32BIT_STATE == 1 )
    201199
    202200forall( dtype ostype | ostream( ostype ) )
  • src/libcfa/libhdr/libdebug.c

    r3f7e12cb r78315272  
    99// Author           : Thierry Delisle
    1010// Created On       : Thu Mar 30 12:30:01 2017
    11 // Last Modified By :
    12 // Last Modified On :
     11// Last Modified By : 
     12// Last Modified On : 
    1313// Update Count     : 0
    1414//
     
    2828extern "C" {
    2929
    30         void __lib_debug_write( const char *in_buffer, int len ) {
     30        void __lib_debug_write( int fd, const char *in_buffer, int len ) {
    3131                // ensure all data is written
    32                 for ( int count = 0, retcode; count < len; count += retcode ) {
     32                for ( int count = 0, retcode; count < len; count += retcode ) { 
    3333                        in_buffer += count;
    3434
    3535                        for ( ;; ) {
    36                                 retcode = write( STDERR_FILENO, in_buffer, len - count );
     36                                retcode = write( fd, in_buffer, len - count );
    3737
    3838                                // not a timer interrupt ?
    39                                 if ( retcode != -1 || errno != EINTR ) break;
     39                                if ( retcode != -1 || errno != EINTR ) break; 
    4040                        }
    4141
     
    5252                va_start( args, fmt );
    5353                __lib_debug_acquire();
    54 
     54               
    5555                int len = vsnprintf( buffer, buffer_size, fmt, args );
    56                 __lib_debug_write( buffer, len );
     56                __lib_debug_write( STDERR_FILENO, buffer, len );
    5757
    5858                __lib_debug_release();
     
    6464
    6565                va_start( args, fmt );
    66 
     66               
    6767                int len = vsnprintf( buffer, buffer_size, fmt, args );
    68                 __lib_debug_write( buffer, len );
     68                __lib_debug_write( STDERR_FILENO, buffer, len );
    6969
    7070                va_end( args );
     
    7373        void __lib_debug_print_vararg( const char fmt[], va_list args ) {
    7474                int len = vsnprintf( buffer, buffer_size, fmt, args );
    75                 __lib_debug_write( buffer, len );
     75                __lib_debug_write( STDERR_FILENO, buffer, len );
    7676        }
    7777
     
    8080
    8181                va_start( args, fmt );
    82 
     82               
    8383                int len = vsnprintf( in_buffer, in_buffer_size, fmt, args );
    84                 __lib_debug_write( in_buffer, len );
     84                __lib_debug_write( STDERR_FILENO, in_buffer, len );
    8585
    8686                va_end( args );
  • src/libcfa/libhdr/libdebug.h

    r3f7e12cb r78315272  
    4444extern "C" {
    4545#endif
    46         #include <stdarg.h>
    47         #include <stdio.h>
     46      #include <stdarg.h>
    4847
    49       extern void __lib_debug_write( const char *buffer, int len );
     48      extern void __lib_debug_write( int fd, const char *buffer, int len );
    5049      extern void __lib_debug_acquire();
    5150      extern void __lib_debug_release();
     
    5958
    6059#ifdef __CFA_DEBUG_PRINT__
    61         #define LIB_DEBUG_WRITE( buffer, len )         __lib_debug_write( buffer, len )
     60        #define LIB_DEBUG_WRITE( fd, buffer, len )     __lib_debug_write( fd, buffer, len )
    6261        #define LIB_DEBUG_ACQUIRE()                    __lib_debug_acquire()
    6362        #define LIB_DEBUG_RELEASE()                    __lib_debug_release()
     
    6564        #define LIB_DEBUG_PRINT_NOLOCK(...)            __lib_debug_print_nolock (__VA_ARGS__)
    6665        #define LIB_DEBUG_PRINT_BUFFER(...)            __lib_debug_print_buffer (__VA_ARGS__)
    67         #define LIB_DEBUG_PRINT_BUFFER_DECL(...)       char __dbg_text[256]; int __dbg_len = snprintf( __dbg_text, 256, __VA_ARGS__ ); __lib_debug_write( __dbg_text, __dbg_len );
    68         #define LIB_DEBUG_PRINT_BUFFER_LOCAL(...)      __dbg_len = snprintf( __dbg_text, 256, __VA_ARGS__ ); __lib_debug_write( __dbg_text, __dbg_len );
     66        #define LIB_DEBUG_PRINT_BUFFER_DECL(fd, ...)   char text[256]; int len = snprintf( text, 256, __VA_ARGS__ ); __lib_debug_write( fd, text, len );
     67        #define LIB_DEBUG_PRINT_BUFFER_LOCAL(fd, ...)  len = snprintf( text, 256, __VA_ARGS__ ); __lib_debug_write( fd, text, len );
    6968#else
    7069        #define LIB_DEBUG_WRITE(...)               ((void)0)
  • src/libcfa/stdlib

    r3f7e12cb r78315272  
    1010// Created On       : Thu Jan 28 17:12:35 2016
    1111// Last Modified By : Peter A. Buhr
    12 // Last Modified On : Tue Oct 31 13:47:24 2017
    13 // Update Count     : 245
     12// Last Modified On : Wed Aug 23 20:29:47 2017
     13// Update Count     : 224
    1414//
    1515
     
    2727// allocation, non-array types
    2828static inline forall( dtype T | sized(T) ) T * malloc( void ) {
    29         // printf( "* malloc\n" );
     29        //printf( "X1\n" );
    3030        return (T *)(void *)malloc( (size_t)sizeof(T) );        // C malloc
    3131} // malloc
    32 
    33 // static inline forall( dtype T | sized(T) ) T & malloc( void ) {
    34 //      int & p = *(T *)(void *)malloc( (size_t)sizeof(T) ); // C malloc
    35 //      printf( "& malloc %p\n", &p );
    36 //      return p;
    37 // //   return (T &)*(T *)(void *)malloc( (size_t)sizeof(T) ); // C malloc
    38 // } // malloc
    3932
    4033extern "C" { void * calloc( size_t dim, size_t size ); } // default C routine
     
    213206//---------------------------------------
    214207
    215 void random_seed( long int s );
    216 char random( void );
    217 char random( char l, char u );
    218 int random( void );
    219 unsigned int random( void );
    220 unsigned int random( unsigned int u );
    221 unsigned int random( unsigned int l, unsigned int u );
    222 //long int random( void );
    223 unsigned long int random( void );
    224 unsigned long int random( unsigned long int u );
    225 unsigned long int random( unsigned long int l, unsigned long int u );
    226 float random( void );
    227 double random( void );
    228 float _Complex random( void );
    229 double _Complex random( void );
    230 long double _Complex random( void );
     208void rand48seed( long int s );
     209char rand48( void );
     210int rand48( void );
     211unsigned int rand48( void );
     212long int rand48( void );
     213unsigned long int rand48( void );
     214float rand48( void );
     215double rand48( void );
     216float _Complex rand48( void );
     217double _Complex rand48( void );
     218long double _Complex rand48( void );
    231219
    232220//---------------------------------------
  • src/libcfa/stdlib.c

    r3f7e12cb r78315272  
    1010// Created On       : Thu Jan 28 17:10:29 2016
    1111// Last Modified By : Peter A. Buhr
    12 // Last Modified On : Mon Oct 30 22:43:02 2017
    13 // Update Count     : 297
     12// Last Modified On : Wed Aug 23 20:30:44 2017
     13// Update Count     : 292
    1414//
    1515
     
    275275//---------------------------------------
    276276
    277 void random_seed( long int s ) { srand48( s ); }
    278 char random( void ) { return mrand48(); }
    279 char random( char l, char u ) { return lrand48() % (u - l) + l; }
    280 int random( void ) { return mrand48(); }
    281 unsigned int random( void ) { return lrand48(); }
    282 unsigned int random( unsigned int u ) { return lrand48() % u; }
    283 unsigned int random( unsigned int l, unsigned int u ) { return lrand48() % (u - l) + l; }
    284 //long int random( void ) { return mrand48(); }
    285 unsigned long int random( void ) { return lrand48(); }
    286 unsigned long int random( unsigned long int u ) { return lrand48() % u; }
    287 unsigned long int random( unsigned long int l, unsigned long int u ) { return lrand48() % (u - l) + l; }
    288 float random( void ) { return (float)drand48(); }               // otherwise float uses lrand48
    289 double random( void ) { return drand48(); }
    290 float _Complex random( void ) { return (float)drand48() + (float _Complex)(drand48() * _Complex_I); }
    291 double _Complex random( void ) { return drand48() + (double _Complex)(drand48() * _Complex_I); }
    292 long double _Complex random( void) { return (long double)drand48() + (long double _Complex)(drand48() * _Complex_I); }
     277void rand48seed( long int s ) { srand48( s ); }
     278char rand48( void ) { return mrand48(); }
     279int rand48( void ) { return mrand48(); }
     280unsigned int rand48( void ) { return lrand48(); }
     281long int rand48( void ) { return mrand48(); }
     282unsigned long int rand48( void ) { return lrand48(); }
     283float rand48( void ) { return (float)drand48(); }               // otherwise float uses lrand48
     284double rand48( void ) { return drand48(); }
     285float _Complex rand48( void ) { return (float)drand48() + (float _Complex)(drand48() * _Complex_I); }
     286double _Complex rand48( void ) { return drand48() + (double _Complex)(drand48() * _Complex_I); }
     287long double _Complex rand48( void) { return (long double)drand48() + (long double _Complex)(drand48() * _Complex_I); }
    293288
    294289//---------------------------------------
  • src/main.cc

    r3f7e12cb r78315272  
    1010// Author           : Richard C. Bilson
    1111// Created On       : Fri May 15 23:12:02 2015
    12 // Last Modified By : Peter A. Buhr
    13 // Last Modified On : Tue Oct 31 12:22:40 2017
    14 // Update Count     : 445
     12// Last Modified By : Andrew Beach
     13// Last Modified On : Wed Jul 26 14:38:00 2017
     14// Update Count     : 443
    1515//
    1616
     
    4444#include "ControlStruct/Mutate.h"           // for mutate
    4545#include "GenPoly/Box.h"                    // for box
     46#include "GenPoly/CopyParams.h"             // for copyParams
    4647#include "GenPoly/InstantiateGeneric.h"     // for instantiateGeneric
    4748#include "GenPoly/Lvalue.h"                 // for convertLvalue
     
    9394        codegenp = false,
    9495        prettycodegenp = false,
    95         linemarks = false;
     96        nolinemarks = false;
    9697
    9798static void parse_cmdline( int argc, char *argv[], const char *& filename );
     
    238239                } // if
    239240
     241                // OPTPRINT( "Concurrency" )
     242                // Concurrency::applyKeywords( translationUnit );
     243
    240244                // add the assignment statement after the initialization of a type parameter
    241245                OPTPRINT( "validate" )
     
    320324                OPTPRINT("instantiateGenerics")
    321325                GenPoly::instantiateGeneric( translationUnit );
     326                OPTPRINT( "copyParams" );
     327                GenPoly::copyParams( translationUnit );
    322328                OPTPRINT( "convertLvalue" )
    323329                GenPoly::convertLvalue( translationUnit );
     
    340346
    341347                CodeTools::fillLocations( translationUnit );
    342                 CodeGen::generate( translationUnit, *output, ! noprotop, prettycodegenp, true, linemarks );
     348                CodeGen::generate( translationUnit, *output, ! noprotop, prettycodegenp, true, ! nolinemarks );
    343349
    344350                CodeGen::FixMain::fix( *output, treep ? "../prelude/bootloader.c" : CFA_LIBDIR "/bootloader.c" );
     
    378384
    379385void parse_cmdline( int argc, char * argv[], const char *& filename ) {
    380         enum { Ast, Bbox, Bresolver, CtorInitFix, DeclStats, Expr, ExprAlt, Grammar, LibCFA, Linemarks, Nolinemarks, Nopreamble, Parse, Prototypes, Resolver, Symbol, Tree, TupleExpansion, Validate, };
     386        enum { Ast, Bbox, Bresolver, CtorInitFix, DeclStats, Expr, ExprAlt, Grammar, LibCFA, Nopreamble, Parse, Prototypes, Resolver, Symbol, Tree, TupleExpansion, Validate, };
    381387
    382388        static struct option long_opts[] = {
     
    390396                { "grammar", no_argument, 0, Grammar },
    391397                { "libcfa", no_argument, 0, LibCFA },
    392                 { "line-marks", no_argument, 0, Linemarks },
    393                 { "no-line-marks", no_argument, 0, Nolinemarks },
    394398                { "no-preamble", no_argument, 0, Nopreamble },
    395399                { "parse", no_argument, 0, Parse },
     
    407411
    408412        int c;
    409         while ( (c = getopt_long( argc, argv, "abBcCdefglLmnNpqrstTvyzZD:F:", long_opts, &long_index )) != -1 ) {
     413        while ( (c = getopt_long( argc, argv, "abBcCdefglLmnpqrstTvyzZD:F:", long_opts, &long_index )) != -1 ) {
    410414                switch ( c ) {
    411415                  case Ast:
     
    447451                        libcfap = true;
    448452                        break;
    449                   case Linemarks:
    450                   case 'L':                                                                             // print lines marks
    451                         linemarks = true;
     453                  case 'L':                                                                             // surpress lines marks
     454                        nolinemarks = true;
    452455                        break;
    453456                  case Nopreamble:
    454457                  case 'n':                                                                             // do not read preamble
    455458                        nopreludep = true;
    456                         break;
    457                   case Nolinemarks:
    458                   case 'N':                                                                             // suppress line marks
    459                         linemarks = false;
    460459                        break;
    461460                  case Prototypes:
     
    509508                                assertf( false, "Unknown option: %s\n", argv[optind - 1] );
    510509                        } // if
    511                         #if __GNUC__ < 7
    512                         #else
    513                                 __attribute__((fallthrough));
    514                         #endif
    515510                  default:
    516511                        abort();
  • src/prelude/Makefile.am

    r3f7e12cb r78315272  
    5757
    5858bootloader.c : bootloader.cf prelude.cf extras.cf gcc-builtins.cf builtins.cf ${abs_top_srcdir}/src/driver/cfa-cpp
    59         ${AM_V_GEN}${abs_top_srcdir}/src/driver/cfa-cpp -tpm bootloader.cf $@  # use src/cfa-cpp as not in lib until after install
     59        ${AM_V_GEN}${abs_top_srcdir}/src/driver/cfa-cpp -tpmL bootloader.cf $@  # use src/cfa-cpp as not in lib until after install
    6060
    6161maintainer-clean-local :
  • src/prelude/Makefile.in

    r3f7e12cb r78315272  
    526526
    527527bootloader.c : bootloader.cf prelude.cf extras.cf gcc-builtins.cf builtins.cf ${abs_top_srcdir}/src/driver/cfa-cpp
    528         ${AM_V_GEN}${abs_top_srcdir}/src/driver/cfa-cpp -tpm bootloader.cf $@  # use src/cfa-cpp as not in lib until after install
     528        ${AM_V_GEN}${abs_top_srcdir}/src/driver/cfa-cpp -tpmL bootloader.cf $@  # use src/cfa-cpp as not in lib until after install
    529529
    530530maintainer-clean-local :
  • src/prelude/extras.c

    r3f7e12cb r78315272  
    11#include <stddef.h>                                     // size_t, ptrdiff_t
    2 #include <stdint.h>                                     // intX_t, uintX_t, where X is 8, 16, 32, 64
    32#include <uchar.h>                                      // char16_t, char32_t
    43#include <wchar.h>                                      // wchar_t
  • src/prelude/extras.regx

    r3f7e12cb r78315272  
    11typedef.* size_t;
    22typedef.* ptrdiff_t;
    3 typedef.* int8_t;
    4 typedef.* int16_t;
    5 typedef.* int32_t;
    6 typedef.* int64_t;
    7 typedef.* uint8_t;
    8 typedef.* uint16_t;
    9 typedef.* uint32_t;
    10 typedef.* uint64_t;
    113typedef.* char16_t;
    124typedef.* char32_t;
  • src/prelude/prelude.cf

    r3f7e12cb r78315272  
    77// Created On       : Sat Nov 29 07:23:41 2014
    88// Last Modified By : Peter A. Buhr
    9 // Last Modified On : Sat Oct 28 16:33:09 2017
    10 // Update Count     : 102
     9// Last Modified On : Wed Aug 30 07:56:07 2017
     10// Update Count     : 93
    1111//
    1212
     
    4141_Bool                   ?++( _Bool & ),                         ?++( volatile _Bool & );
    4242_Bool                   ?--( _Bool & ),                         ?--( volatile _Bool & );
    43 signed short            ?++( signed short & ),                  ?++( volatile signed short & );
    44 signed short            ?--( signed short & ),                  ?--( volatile signed short & );
    45 unsigned short          ?++( unsigned short & ),                ?++( volatile unsigned short & );
    46 unsigned short          ?--( unsigned short & ),                ?--( volatile unsigned short & );
     43unsigned char           ?++( unsigned char & ),                 ?++( volatile unsigned char & );
    4744signed int              ?++( signed int & ),                    ?++( volatile signed int & );
    4845signed int              ?--( signed int & ),                    ?--( volatile signed int & );
     
    9592
    9693_Bool                   ++?( _Bool & ),                         --?( _Bool & );
    97 signed short    ++?( signed short & ),                  --?( signed short & );
    9894signed int              ++?( signed int & ),                    --?( signed int & );
    99 unsigned short          ++?( unsigned int & ),                  --?( unsigned int & );
    100 unsigned int            ++?( unsigned short & ),                --?( unsigned short & );
     95unsigned int            ++?( unsigned int & ),                  --?( unsigned int & );
    10196signed long int         ++?( signed long int & ),               --?( signed long int & );
    10297unsigned long int       ++?( unsigned long int & ),             --?( unsigned long int & );
     
    195190long double _Complex    ?+?( long double _Complex, long double _Complex ),      ?-?( long double _Complex, long double _Complex );
    196191
    197 forall( dtype T | sized(T) ) T *                ?+?(                T *,          ptrdiff_t );
    198 forall( dtype T | sized(T) ) T *                ?+?(          ptrdiff_t,                T * );
     192forall( dtype T | sized(T) ) T *                        ?+?(                T *,          ptrdiff_t );
     193forall( dtype T | sized(T) ) T *                        ?+?(          ptrdiff_t,                T * );
    199194forall( dtype T | sized(T) ) const T *          ?+?( const          T *,          ptrdiff_t );
    200195forall( dtype T | sized(T) ) const T *          ?+?(          ptrdiff_t, const          T * );
    201 forall( dtype T | sized(T) ) volatile T *       ?+?(       volatile T *,          ptrdiff_t );
    202 forall( dtype T | sized(T) ) volatile T *       ?+?(          ptrdiff_t,       volatile T * );
     196forall( dtype T | sized(T) ) volatile T *               ?+?(       volatile T *,          ptrdiff_t );
     197forall( dtype T | sized(T) ) volatile T *               ?+?(          ptrdiff_t,       volatile T * );
    203198forall( dtype T | sized(T) ) const volatile T * ?+?( const volatile T *,          ptrdiff_t );
    204199forall( dtype T | sized(T) ) const volatile T * ?+?(          ptrdiff_t, const volatile T * );
    205 forall( dtype T | sized(T) ) T *                ?-?(                T *,          ptrdiff_t );
     200forall( dtype T | sized(T) ) T *                        ?-?(                T *,          ptrdiff_t );
    206201forall( dtype T | sized(T) ) const T *          ?-?( const          T *,          ptrdiff_t );
    207 forall( dtype T | sized(T) ) volatile T *       ?-?(       volatile T *,          ptrdiff_t );
     202forall( dtype T | sized(T) ) volatile T *               ?-?(       volatile T *,          ptrdiff_t );
    208203forall( dtype T | sized(T) ) const volatile T * ?-?( const volatile T *,          ptrdiff_t );
    209204forall( dtype T | sized(T) ) ptrdiff_t          ?-?( const volatile T *, const volatile T * );
     
    231226signed int ?<?( _Bool, _Bool ),                                         ?<=?( _Bool, _Bool ),
    232227           ?>?( _Bool, _Bool ),                                         ?>=?( _Bool, _Bool );
    233 signed int ?<?( char, char ),                                           ?<=?( char, char ),
    234            ?>?( char, char ),                                           ?>=?( char, char );
     228signed int ?<?( char, char ),                           ?<=?( char, char ),
     229           ?>?( char, char ),                           ?>=?( char, char );
    235230signed int ?<?( signed char, signed char ),                             ?<=?( signed char, signed char ),
    236231           ?>?( signed char, signed char ),                             ?>=?( signed char, signed char );
     
    240235           ?>?( signed short, signed short ),                           ?>=?( signed short, signed short );
    241236signed int ?<?( unsigned short, unsigned short ),                       ?<=?( unsigned short, unsigned short ),
    242            ?>?( unsigned short, unsigned short ),                       ?>=?( unsigned short, unsigned short );
     237           ?>?( unsigned short, unsigned short ),                               ?>=?( unsigned short, unsigned short );
    243238signed int ?<?( signed int, signed int ),                               ?<=?( signed int, signed int ),
    244239           ?>?( signed int, signed int ),                               ?>=?( signed int, signed int );
     
    473468forall( ftype FT ) FT *                 ?=?( FT * volatile &, zero_t );
    474469
    475 forall( dtype T | sized(T) ) T *                ?+=?(                T *          &, ptrdiff_t );
    476 forall( dtype T | sized(T) ) T *                ?+=?(                T * volatile &, ptrdiff_t );
     470forall( dtype T | sized(T) ) T *                        ?+=?(                T *          &, ptrdiff_t );
     471forall( dtype T | sized(T) ) T *                        ?+=?(                T * volatile &, ptrdiff_t );
    477472forall( dtype T | sized(T) ) const T *          ?+=?( const          T *          &, ptrdiff_t );
    478473forall( dtype T | sized(T) ) const T *          ?+=?( const          T * volatile &, ptrdiff_t );
    479 forall( dtype T | sized(T) ) volatile T *       ?+=?(       volatile T *          &, ptrdiff_t );
    480 forall( dtype T | sized(T) ) volatile T *       ?+=?(       volatile T * volatile &, ptrdiff_t );
     474forall( dtype T | sized(T) ) volatile T *               ?+=?(       volatile T *          &, ptrdiff_t );
     475forall( dtype T | sized(T) ) volatile T *               ?+=?(       volatile T * volatile &, ptrdiff_t );
    481476forall( dtype T | sized(T) ) const volatile T * ?+=?( const volatile T *          &, ptrdiff_t );
    482477forall( dtype T | sized(T) ) const volatile T * ?+=?( const volatile T * volatile &, ptrdiff_t );
    483 forall( dtype T | sized(T) ) T *                ?-=?(                T *          &, ptrdiff_t );
    484 forall( dtype T | sized(T) ) T *                ?-=?(                T * volatile &, ptrdiff_t );
     478forall( dtype T | sized(T) ) T *                        ?-=?(                T *          &, ptrdiff_t );
     479forall( dtype T | sized(T) ) T *                        ?-=?(                T * volatile &, ptrdiff_t );
    485480forall( dtype T | sized(T) ) const T *          ?-=?( const          T *          &, ptrdiff_t );
    486481forall( dtype T | sized(T) ) const T *          ?-=?( const          T * volatile &, ptrdiff_t );
    487 forall( dtype T | sized(T) ) volatile T *       ?-=?(       volatile T *          &, ptrdiff_t );
    488 forall( dtype T | sized(T) ) volatile T *       ?-=?(       volatile T * volatile &, ptrdiff_t );
     482forall( dtype T | sized(T) ) volatile T *               ?-=?(       volatile T *          &, ptrdiff_t );
     483forall( dtype T | sized(T) ) volatile T *               ?-=?(       volatile T * volatile &, ptrdiff_t );
    489484forall( dtype T | sized(T) ) const volatile T * ?-=?( const volatile T *          &, ptrdiff_t );
    490485forall( dtype T | sized(T) ) const volatile T * ?-=?( const volatile T * volatile &, ptrdiff_t );
     
    502497signed long long int    ?=?( signed long long int &, signed long long int ),    ?=?( volatile signed long long int &, signed long long int );
    503498unsigned long long int  ?=?( unsigned long long int &, unsigned long long int ), ?=?( volatile unsigned long long int &, unsigned long long int );
    504 zero_t                  ?=?( zero_t &, zero_t );
     499zero_t          ?=?( zero_t &, zero_t );
    505500one_t                   ?=?( one_t &, one_t );
    506501
     
    557552signed long long int    ?+=?( signed long long int &, signed long long int ),   ?+=?( volatile signed long long int &, signed long long int );
    558553unsigned long long int  ?+=?( unsigned long long int &, unsigned long long int ), ?+=?( volatile unsigned long long int &, unsigned long long int );
    559 //signed int128         ?+=?( signed int128 &, signed int128 ),                 ?+=?( volatile signed int128 &, signed int128 );
    560 //unsigned int128               ?+=?( unsigned int128 &, unsigned int128 ),             ?+=?( volatile unsigned int128 &, unsigned int128 );
    561554
    562555_Bool                   ?-=?( _Bool &, _Bool ),                                 ?-=?( volatile _Bool &, _Bool );
     
    673666                        ?+=?( long double _Complex &, long double _Complex ), ?+=?( volatile long double _Complex &, long double _Complex ),
    674667                        ?-=?( long double _Complex &, long double _Complex ), ?-=?( volatile long double _Complex &, long double _Complex );
     668
     669
     670
    675671
    676672
     
    842838forall( dtype DT ) void ^?{}( const volatile  DT *         &);
    843839
    844 void ^?{}(                  void *          &);
    845 void ^?{}( const            void *          &);
    846 void ^?{}(         volatile void *          &);
    847 void ^?{}( const  volatile void *          &);
     840void    ^?{}(               void *          &);
     841void    ^?{}( const         void *          &);
     842void    ^?{}(      volatile void *          &);
     843void    ^?{}( const volatile void *         &);
    848844
    849845// Local Variables: //
  • src/tests/.expect/32/KRfunctions.txt

    r3f7e12cb r78315272  
    2121static inline void ___destructor__F_R2sS_autogen___1(struct S *___dst__R2sS_1);
    2222static inline struct S ___operator_assign__F2sS_R2sS2sS_autogen___1(struct S *___dst__R2sS_1, struct S ___src__2sS_1);
    23 static inline void ___constructor__F_R2sSi_autogen___1(struct S *___dst__R2sS_1, signed int __i__i_1);
    2423static inline void ___constructor__F_R2sS_autogen___1(struct S *___dst__R2sS_1){
    2524    ((void)((*___dst__R2sS_1).__i__i_1) /* ?{} */);
     
    3433    struct S ___ret__2sS_1;
    3534    ((void)((*___dst__R2sS_1).__i__i_1=___src__2sS_1.__i__i_1));
    36     ((void)___constructor__F_R2sS2sS_autogen___1((&___ret__2sS_1), (*___dst__R2sS_1)));
    37     return ___ret__2sS_1;
     35    ((void)___constructor__F_R2sS2sS_autogen___1((&___ret__2sS_1), ___src__2sS_1));
     36    return ((struct S )___ret__2sS_1);
    3837}
    3938static inline void ___constructor__F_R2sSi_autogen___1(struct S *___dst__R2sS_1, signed int __i__i_1){
     
    6665    signed int *__x__FPi_ii__2(signed int __anonymous_object2, signed int __anonymous_object3);
    6766    ((void)(___retval_f10__PFPi_ii__1=__x__FPi_ii__2) /* ?{} */);
    68     return ___retval_f10__PFPi_ii__1;
     67    return ((signed int *(*)(signed int __x__i_1, signed int __y__i_1))___retval_f10__PFPi_ii__1);
    6968}
    7069signed int (*__f11__FPA0i_iPiPi__1(signed int __a__i_1, signed int *__b__Pi_1, signed int *__c__Pi_1))[]{
  • src/tests/.expect/32/attributes.txt

    r3f7e12cb r78315272  
    2323static inline struct __anonymous0 ___operator_assign__F13s__anonymous0_R13s__anonymous013s__anonymous0_autogen___1(struct __anonymous0 *___dst__R13s__anonymous0_1, struct __anonymous0 ___src__13s__anonymous0_1){
    2424    struct __anonymous0 ___ret__13s__anonymous0_1;
    25     ((void)___constructor__F_R13s__anonymous013s__anonymous0_autogen___1((&___ret__13s__anonymous0_1), (*___dst__R13s__anonymous0_1)));
    26     return ___ret__13s__anonymous0_1;
     25    ((void)___constructor__F_R13s__anonymous013s__anonymous0_autogen___1((&___ret__13s__anonymous0_1), ___src__13s__anonymous0_1));
     26    return ((struct __anonymous0 )___ret__13s__anonymous0_1);
    2727}
    2828__attribute__ ((unused)) struct Agn1;
     
    4141static inline struct Agn2 ___operator_assign__F5sAgn2_R5sAgn25sAgn2_autogen___1(struct Agn2 *___dst__R5sAgn2_1, struct Agn2 ___src__5sAgn2_1){
    4242    struct Agn2 ___ret__5sAgn2_1;
    43     ((void)___constructor__F_R5sAgn25sAgn2_autogen___1((&___ret__5sAgn2_1), (*___dst__R5sAgn2_1)));
    44     return ___ret__5sAgn2_1;
     43    ((void)___constructor__F_R5sAgn25sAgn2_autogen___1((&___ret__5sAgn2_1), ___src__5sAgn2_1));
     44    return ((struct Agn2 )___ret__5sAgn2_1);
    4545}
    4646enum __attribute__ ((unused)) __anonymous1 {
     
    6969static inline void ___destructor__F_R4sFdl_autogen___1(struct Fdl *___dst__R4sFdl_1);
    7070static inline struct Fdl ___operator_assign__F4sFdl_R4sFdl4sFdl_autogen___1(struct Fdl *___dst__R4sFdl_1, struct Fdl ___src__4sFdl_1);
    71 static inline void ___constructor__F_R4sFdli_autogen___1(struct Fdl *___dst__R4sFdl_1, signed int __f1__i_1);
    72 static inline void ___constructor__F_R4sFdlii_autogen___1(struct Fdl *___dst__R4sFdl_1, signed int __f1__i_1, signed int __f2__i_1);
    73 static inline void ___constructor__F_R4sFdliii_autogen___1(struct Fdl *___dst__R4sFdl_1, signed int __f1__i_1, signed int __f2__i_1, signed int __f3__i_1);
    74 static inline void ___constructor__F_R4sFdliiii_autogen___1(struct Fdl *___dst__R4sFdl_1, signed int __f1__i_1, signed int __f2__i_1, signed int __f3__i_1, signed int __f4__i_1);
    75 static inline void ___constructor__F_R4sFdliiiii_autogen___1(struct Fdl *___dst__R4sFdl_1, signed int __f1__i_1, signed int __f2__i_1, signed int __f3__i_1, signed int __f4__i_1, signed int __f5__i_1);
    76 static inline void ___constructor__F_R4sFdliiiiii_autogen___1(struct Fdl *___dst__R4sFdl_1, signed int __f1__i_1, signed int __f2__i_1, signed int __f3__i_1, signed int __f4__i_1, signed int __f5__i_1, signed int __f6__i_1);
    77 static inline void ___constructor__F_R4sFdliiiiiii_autogen___1(struct Fdl *___dst__R4sFdl_1, signed int __f1__i_1, signed int __f2__i_1, signed int __f3__i_1, signed int __f4__i_1, signed int __f5__i_1, signed int __f6__i_1, signed int __f7__i_1);
    78 static inline void ___constructor__F_R4sFdliiiiiiii_autogen___1(struct Fdl *___dst__R4sFdl_1, signed int __f1__i_1, signed int __f2__i_1, signed int __f3__i_1, signed int __f4__i_1, signed int __f5__i_1, signed int __f6__i_1, signed int __f7__i_1, signed int __f8__i_1);
    79 static inline void ___constructor__F_R4sFdliiiiiiiii_autogen___1(struct Fdl *___dst__R4sFdl_1, signed int __f1__i_1, signed int __f2__i_1, signed int __f3__i_1, signed int __f4__i_1, signed int __f5__i_1, signed int __f6__i_1, signed int __f7__i_1, signed int __f8__i_1, signed int __anonymous_object1);
    80 static inline void ___constructor__F_R4sFdliiiiiiiiiPi_autogen___1(struct Fdl *___dst__R4sFdl_1, signed int __f1__i_1, signed int __f2__i_1, signed int __f3__i_1, signed int __f4__i_1, signed int __f5__i_1, signed int __f6__i_1, signed int __f7__i_1, signed int __f8__i_1, signed int __anonymous_object2, signed int *__f9__Pi_1);
    8171static inline void ___constructor__F_R4sFdl_autogen___1(struct Fdl *___dst__R4sFdl_1){
    8272    ((void)((*___dst__R4sFdl_1).__f1__i_1) /* ?{} */);
     
    8878    ((void)((*___dst__R4sFdl_1).__f7__i_1) /* ?{} */);
    8979    ((void)((*___dst__R4sFdl_1).__f8__i_1) /* ?{} */);
    90     ((void)((*___dst__R4sFdl_1).__anonymous_object0) /* ?{} */);
    9180    ((void)((*___dst__R4sFdl_1).__f9__Pi_1) /* ?{} */);
    9281}
     
    10089    ((void)((*___dst__R4sFdl_1).__f7__i_1=___src__4sFdl_1.__f7__i_1) /* ?{} */);
    10190    ((void)((*___dst__R4sFdl_1).__f8__i_1=___src__4sFdl_1.__f8__i_1) /* ?{} */);
    102     ((void)((*___dst__R4sFdl_1).__anonymous_object0=___src__4sFdl_1.__anonymous_object0) /* ?{} */);
    10391    ((void)((*___dst__R4sFdl_1).__f9__Pi_1=___src__4sFdl_1.__f9__Pi_1) /* ?{} */);
    10492}
    10593static inline void ___destructor__F_R4sFdl_autogen___1(struct Fdl *___dst__R4sFdl_1){
    10694    ((void)((*___dst__R4sFdl_1).__f9__Pi_1) /* ^?{} */);
    107     ((void)((*___dst__R4sFdl_1).__anonymous_object0) /* ^?{} */);
    10895    ((void)((*___dst__R4sFdl_1).__f8__i_1) /* ^?{} */);
    10996    ((void)((*___dst__R4sFdl_1).__f7__i_1) /* ^?{} */);
     
    125112    ((void)((*___dst__R4sFdl_1).__f7__i_1=___src__4sFdl_1.__f7__i_1));
    126113    ((void)((*___dst__R4sFdl_1).__f8__i_1=___src__4sFdl_1.__f8__i_1));
    127     ((void)((*___dst__R4sFdl_1).__anonymous_object0=___src__4sFdl_1.__anonymous_object0));
    128114    ((void)((*___dst__R4sFdl_1).__f9__Pi_1=___src__4sFdl_1.__f9__Pi_1));
    129     ((void)___constructor__F_R4sFdl4sFdl_autogen___1((&___ret__4sFdl_1), (*___dst__R4sFdl_1)));
    130     return ___ret__4sFdl_1;
     115    ((void)___constructor__F_R4sFdl4sFdl_autogen___1((&___ret__4sFdl_1), ___src__4sFdl_1));
     116    return ((struct Fdl )___ret__4sFdl_1);
    131117}
    132118static inline void ___constructor__F_R4sFdli_autogen___1(struct Fdl *___dst__R4sFdl_1, signed int __f1__i_1){
     
    139125    ((void)((*___dst__R4sFdl_1).__f7__i_1) /* ?{} */);
    140126    ((void)((*___dst__R4sFdl_1).__f8__i_1) /* ?{} */);
    141     ((void)((*___dst__R4sFdl_1).__anonymous_object0) /* ?{} */);
    142127    ((void)((*___dst__R4sFdl_1).__f9__Pi_1) /* ?{} */);
    143128}
     
    151136    ((void)((*___dst__R4sFdl_1).__f7__i_1) /* ?{} */);
    152137    ((void)((*___dst__R4sFdl_1).__f8__i_1) /* ?{} */);
    153     ((void)((*___dst__R4sFdl_1).__anonymous_object0) /* ?{} */);
    154138    ((void)((*___dst__R4sFdl_1).__f9__Pi_1) /* ?{} */);
    155139}
     
    163147    ((void)((*___dst__R4sFdl_1).__f7__i_1) /* ?{} */);
    164148    ((void)((*___dst__R4sFdl_1).__f8__i_1) /* ?{} */);
    165     ((void)((*___dst__R4sFdl_1).__anonymous_object0) /* ?{} */);
    166149    ((void)((*___dst__R4sFdl_1).__f9__Pi_1) /* ?{} */);
    167150}
     
    175158    ((void)((*___dst__R4sFdl_1).__f7__i_1) /* ?{} */);
    176159    ((void)((*___dst__R4sFdl_1).__f8__i_1) /* ?{} */);
    177     ((void)((*___dst__R4sFdl_1).__anonymous_object0) /* ?{} */);
    178160    ((void)((*___dst__R4sFdl_1).__f9__Pi_1) /* ?{} */);
    179161}
     
    187169    ((void)((*___dst__R4sFdl_1).__f7__i_1) /* ?{} */);
    188170    ((void)((*___dst__R4sFdl_1).__f8__i_1) /* ?{} */);
    189     ((void)((*___dst__R4sFdl_1).__anonymous_object0) /* ?{} */);
    190171    ((void)((*___dst__R4sFdl_1).__f9__Pi_1) /* ?{} */);
    191172}
     
    199180    ((void)((*___dst__R4sFdl_1).__f7__i_1) /* ?{} */);
    200181    ((void)((*___dst__R4sFdl_1).__f8__i_1) /* ?{} */);
    201     ((void)((*___dst__R4sFdl_1).__anonymous_object0) /* ?{} */);
    202182    ((void)((*___dst__R4sFdl_1).__f9__Pi_1) /* ?{} */);
    203183}
     
    211191    ((void)((*___dst__R4sFdl_1).__f7__i_1=__f7__i_1) /* ?{} */);
    212192    ((void)((*___dst__R4sFdl_1).__f8__i_1) /* ?{} */);
    213     ((void)((*___dst__R4sFdl_1).__anonymous_object0) /* ?{} */);
    214193    ((void)((*___dst__R4sFdl_1).__f9__Pi_1) /* ?{} */);
    215194}
     
    223202    ((void)((*___dst__R4sFdl_1).__f7__i_1=__f7__i_1) /* ?{} */);
    224203    ((void)((*___dst__R4sFdl_1).__f8__i_1=__f8__i_1) /* ?{} */);
    225     ((void)((*___dst__R4sFdl_1).__anonymous_object0) /* ?{} */);
    226     ((void)((*___dst__R4sFdl_1).__f9__Pi_1) /* ?{} */);
    227 }
    228 static inline void ___constructor__F_R4sFdliiiiiiiii_autogen___1(struct Fdl *___dst__R4sFdl_1, signed int __f1__i_1, signed int __f2__i_1, signed int __f3__i_1, signed int __f4__i_1, signed int __f5__i_1, signed int __f6__i_1, signed int __f7__i_1, signed int __f8__i_1, signed int __anonymous_object3){
     204    ((void)((*___dst__R4sFdl_1).__f9__Pi_1) /* ?{} */);
     205}
     206static inline void ___constructor__F_R4sFdliiiiiiiiPi_autogen___1(struct Fdl *___dst__R4sFdl_1, signed int __f1__i_1, signed int __f2__i_1, signed int __f3__i_1, signed int __f4__i_1, signed int __f5__i_1, signed int __f6__i_1, signed int __f7__i_1, signed int __f8__i_1, signed int *__f9__Pi_1){
    229207    ((void)((*___dst__R4sFdl_1).__f1__i_1=__f1__i_1) /* ?{} */);
    230208    ((void)((*___dst__R4sFdl_1).__f2__i_1=__f2__i_1) /* ?{} */);
     
    235213    ((void)((*___dst__R4sFdl_1).__f7__i_1=__f7__i_1) /* ?{} */);
    236214    ((void)((*___dst__R4sFdl_1).__f8__i_1=__f8__i_1) /* ?{} */);
    237     ((void)((*___dst__R4sFdl_1).__anonymous_object0=__anonymous_object3) /* ?{} */);
    238     ((void)((*___dst__R4sFdl_1).__f9__Pi_1) /* ?{} */);
    239 }
    240 static inline void ___constructor__F_R4sFdliiiiiiiiiPi_autogen___1(struct Fdl *___dst__R4sFdl_1, signed int __f1__i_1, signed int __f2__i_1, signed int __f3__i_1, signed int __f4__i_1, signed int __f5__i_1, signed int __f6__i_1, signed int __f7__i_1, signed int __f8__i_1, signed int __anonymous_object4, signed int *__f9__Pi_1){
    241     ((void)((*___dst__R4sFdl_1).__f1__i_1=__f1__i_1) /* ?{} */);
    242     ((void)((*___dst__R4sFdl_1).__f2__i_1=__f2__i_1) /* ?{} */);
    243     ((void)((*___dst__R4sFdl_1).__f3__i_1=__f3__i_1) /* ?{} */);
    244     ((void)((*___dst__R4sFdl_1).__f4__i_1=__f4__i_1) /* ?{} */);
    245     ((void)((*___dst__R4sFdl_1).__f5__i_1=__f5__i_1) /* ?{} */);
    246     ((void)((*___dst__R4sFdl_1).__f6__i_1=__f6__i_1) /* ?{} */);
    247     ((void)((*___dst__R4sFdl_1).__f7__i_1=__f7__i_1) /* ?{} */);
    248     ((void)((*___dst__R4sFdl_1).__f8__i_1=__f8__i_1) /* ?{} */);
    249     ((void)((*___dst__R4sFdl_1).__anonymous_object0=__anonymous_object4) /* ?{} */);
    250215    ((void)((*___dst__R4sFdl_1).__f9__Pi_1=__f9__Pi_1) /* ?{} */);
    251216}
     
    267232    __attribute__ ((unused)) signed int **const ___retval_f2__CPPi_1;
    268233}
    269 __attribute__ ((unused,used,unused)) signed int (*__f3__FPA0i_i__1(signed int __anonymous_object5))[];
     234__attribute__ ((unused,used,unused)) signed int (*__f3__FPA0i_i__1(signed int __anonymous_object1))[];
    270235__attribute__ ((unused,unused)) signed int (*__f3__FPA0i_i__1(signed int __p__i_1))[]{
    271236    __attribute__ ((unused)) signed int (*___retval_f3__PA0i_1)[];
    272237}
    273 __attribute__ ((unused,used,unused)) signed int (*__f4__FPFi_i____1())(signed int __anonymous_object6);
    274 __attribute__ ((unused,unused)) signed int (*__f4__FPFi_i____1())(signed int __anonymous_object7){
    275     __attribute__ ((unused)) signed int (*___retval_f4__PFi_i__1)(signed int __anonymous_object8);
     238__attribute__ ((unused,used,unused)) signed int (*__f4__FPFi_i____1())(signed int __anonymous_object2);
     239__attribute__ ((unused,unused)) signed int (*__f4__FPFi_i____1())(signed int __anonymous_object3){
     240    __attribute__ ((unused)) signed int (*___retval_f4__PFi_i__1)(signed int __anonymous_object4);
    276241}
    277242signed int __vtr__Fi___1(){
     
    303268signed int __tpr2__Fi_PPi__1(__attribute__ ((unused,unused,unused,unused,unused,unused)) signed int **__Foo__PPi_1);
    304269signed int __tpr3__Fi_Pi__1(__attribute__ ((unused,unused,unused)) signed int *__Foo__Pi_1);
    305 signed int __tpr4__Fi_PFi_Pi___1(__attribute__ ((unused,unused)) signed int (*__anonymous_object9)(__attribute__ ((unused,unused)) signed int __anonymous_object10[((unsigned int )5)]));
     270signed int __tpr4__Fi_PFi_Pi___1(__attribute__ ((unused,unused)) signed int (*__anonymous_object5)(__attribute__ ((unused,unused)) signed int __anonymous_object6[((unsigned int )5)]));
    306271signed int __tpr5__Fi_PFi____1(__attribute__ ((unused,unused,unused)) signed int (*__Foo__PFi___1)());
    307272signed int __tpr6__Fi_PFi____1(__attribute__ ((unused,unused,unused)) signed int (*__Foo__PFi___1)());
    308 signed int __tpr7__Fi_PFi_PFi_i____1(__attribute__ ((unused,unused)) signed int (*__anonymous_object11)(__attribute__ ((unused)) signed int (*__anonymous_object12)(__attribute__ ((unused,unused)) signed int __anonymous_object13)));
     273signed int __tpr7__Fi_PFi_PFi_i____1(__attribute__ ((unused,unused)) signed int (*__anonymous_object7)(__attribute__ ((unused)) signed int (*__anonymous_object8)(__attribute__ ((unused,unused)) signed int __anonymous_object9)));
    309274signed int __ad__Fi___1(){
    310275    __attribute__ ((unused)) signed int ___retval_ad__i_1;
     
    335300        struct __anonymous4 ___ret__13s__anonymous4_2;
    336301        ((void)((*___dst__R13s__anonymous4_2).__i__i_2=___src__13s__anonymous4_2.__i__i_2));
    337         ((void)___constructor__F_R13s__anonymous413s__anonymous4_autogen___2((&___ret__13s__anonymous4_2), (*___dst__R13s__anonymous4_2)));
    338         return ___ret__13s__anonymous4_2;
     302        ((void)___constructor__F_R13s__anonymous413s__anonymous4_autogen___2((&___ret__13s__anonymous4_2), ___src__13s__anonymous4_2));
     303        return ((struct __anonymous4 )___ret__13s__anonymous4_2);
    339304    }
    340305    inline void ___constructor__F_R13s__anonymous4i_autogen___2(struct __anonymous4 *___dst__R13s__anonymous4_2, signed int __i__i_2){
     
    348313    }
    349314    inline void ___constructor__F_R13e__anonymous513e__anonymous5_intrinsic___2(enum __anonymous5 *___dst__R13e__anonymous5_2, enum __anonymous5 ___src__13e__anonymous5_2){
    350         ((void)((*___dst__R13e__anonymous5_2)=___src__13e__anonymous5_2) /* ?{} */);
     315        ((void)((*___dst__R13e__anonymous5_2)=___src__13e__anonymous5_2));
    351316    }
    352317    inline void ___destructor__F_R13e__anonymous5_intrinsic___2(__attribute__ ((unused)) enum __anonymous5 *___dst__R13e__anonymous5_2){
     
    354319    inline enum __anonymous5 ___operator_assign__F13e__anonymous5_R13e__anonymous513e__anonymous5_intrinsic___2(enum __anonymous5 *___dst__R13e__anonymous5_2, enum __anonymous5 ___src__13e__anonymous5_2){
    355320        enum __anonymous5 ___ret__13e__anonymous5_2;
    356         ((void)((*___dst__R13e__anonymous5_2)=___src__13e__anonymous5_2));
    357         ((void)(___ret__13e__anonymous5_2=(*___dst__R13e__anonymous5_2)) /* ?{} */);
    358         return ___ret__13e__anonymous5_2;
     321        ((void)(___ret__13e__anonymous5_2=((*___dst__R13e__anonymous5_2)=___src__13e__anonymous5_2)) /* ?{} */);
     322        return ((enum __anonymous5 )___ret__13e__anonymous5_2);
    359323    }
    360324    ((void)sizeof(enum __anonymous5 ));
    361325}
    362 signed int __apd1__Fi_PiPi__1(__attribute__ ((unused,unused,unused)) signed int *__anonymous_object14, __attribute__ ((unused,unused,unused)) signed int *__anonymous_object15);
    363 signed int __apd2__Fi_PPiPPi__1(__attribute__ ((unused,unused,unused,unused)) signed int **__anonymous_object16, __attribute__ ((unused,unused,unused,unused)) signed int **__anonymous_object17);
    364 signed int __apd3__Fi_PiPi__1(__attribute__ ((unused,unused,unused)) signed int *__anonymous_object18, __attribute__ ((unused,unused,unused)) signed int *__anonymous_object19);
    365 signed int __apd4__Fi_PFi__PFi____1(__attribute__ ((unused,unused,unused)) signed int (*__anonymous_object20)(), __attribute__ ((unused,unused,unused)) signed int (*__anonymous_object21)());
    366 signed int __apd5__Fi_PFi_i_PFi_i___1(__attribute__ ((unused,unused,unused)) signed int (*__anonymous_object22)(__attribute__ ((unused)) signed int __anonymous_object23), __attribute__ ((unused,unused,unused)) signed int (*__anonymous_object24)(__attribute__ ((unused)) signed int __anonymous_object25));
    367 signed int __apd6__Fi_PFi__PFi____1(__attribute__ ((unused,unused,unused)) signed int (*__anonymous_object26)(), __attribute__ ((unused,unused,unused)) signed int (*__anonymous_object27)());
    368 signed int __apd7__Fi_PFi_i_PFi_i___1(__attribute__ ((unused,unused,unused)) signed int (*__anonymous_object28)(__attribute__ ((unused)) signed int __anonymous_object29), __attribute__ ((unused,unused,unused)) signed int (*__anonymous_object30)(__attribute__ ((unused)) signed int __anonymous_object31));
     326signed int __apd1__Fi_PiPi__1(__attribute__ ((unused,unused,unused)) signed int *__anonymous_object10, __attribute__ ((unused,unused,unused)) signed int *__anonymous_object11);
     327signed int __apd2__Fi_PPiPPi__1(__attribute__ ((unused,unused,unused,unused)) signed int **__anonymous_object12, __attribute__ ((unused,unused,unused,unused)) signed int **__anonymous_object13);
     328signed int __apd3__Fi_PiPi__1(__attribute__ ((unused,unused,unused)) signed int *__anonymous_object14, __attribute__ ((unused,unused,unused)) signed int *__anonymous_object15);
     329signed int __apd4__Fi_PFi__PFi____1(__attribute__ ((unused,unused,unused)) signed int (*__anonymous_object16)(), __attribute__ ((unused,unused,unused)) signed int (*__anonymous_object17)());
     330signed int __apd5__Fi_PFi_i_PFi_i___1(__attribute__ ((unused,unused,unused)) signed int (*__anonymous_object18)(__attribute__ ((unused)) signed int __anonymous_object19), __attribute__ ((unused,unused,unused)) signed int (*__anonymous_object20)(__attribute__ ((unused)) signed int __anonymous_object21));
     331signed int __apd6__Fi_PFi__PFi____1(__attribute__ ((unused,unused,unused)) signed int (*__anonymous_object22)(), __attribute__ ((unused,unused,unused)) signed int (*__anonymous_object23)());
     332signed int __apd7__Fi_PFi_i_PFi_i___1(__attribute__ ((unused,unused,unused)) signed int (*__anonymous_object24)(__attribute__ ((unused)) signed int __anonymous_object25), __attribute__ ((unused,unused,unused)) signed int (*__anonymous_object26)(__attribute__ ((unused)) signed int __anonymous_object27));
    369333struct Vad {
    370     __attribute__ ((unused)) signed int __anonymous_object32;
    371     __attribute__ ((unused,unused)) signed int *__anonymous_object33;
    372     __attribute__ ((unused,unused)) signed int __anonymous_object34[((unsigned int )10)];
    373     __attribute__ ((unused,unused)) signed int (*__anonymous_object35)();
     334    __attribute__ ((unused)) signed int __anonymous_object28;
     335    __attribute__ ((unused,unused)) signed int *__anonymous_object29;
     336    __attribute__ ((unused,unused)) signed int __anonymous_object30[((unsigned int )10)];
     337    __attribute__ ((unused,unused)) signed int (*__anonymous_object31)();
    374338};
    375339static inline void ___constructor__F_R4sVad_autogen___1(struct Vad *___dst__R4sVad_1);
     
    377341static inline void ___destructor__F_R4sVad_autogen___1(struct Vad *___dst__R4sVad_1);
    378342static inline struct Vad ___operator_assign__F4sVad_R4sVad4sVad_autogen___1(struct Vad *___dst__R4sVad_1, struct Vad ___src__4sVad_1);
    379 static inline void ___constructor__F_R4sVadi_autogen___1(struct Vad *___dst__R4sVad_1, signed int __anonymous_object36);
    380 static inline void ___constructor__F_R4sVadiPi_autogen___1(struct Vad *___dst__R4sVad_1, signed int __anonymous_object37, signed int *__anonymous_object38);
    381 static inline void ___constructor__F_R4sVadiPiA0i_autogen___1(struct Vad *___dst__R4sVad_1, signed int __anonymous_object39, signed int *__anonymous_object40, signed int __anonymous_object41[((unsigned int )10)]);
    382 static inline void ___constructor__F_R4sVadiPiA0iPFi___autogen___1(struct Vad *___dst__R4sVad_1, signed int __anonymous_object42, signed int *__anonymous_object43, signed int __anonymous_object44[((unsigned int )10)], signed int (*__anonymous_object45)());
    383343static inline void ___constructor__F_R4sVad_autogen___1(struct Vad *___dst__R4sVad_1){
    384     ((void)((*___dst__R4sVad_1).__anonymous_object32) /* ?{} */);
    385     ((void)((*___dst__R4sVad_1).__anonymous_object33) /* ?{} */);
    386     {
    387         signed int _index0 = 0;
    388         for (;(_index0<10);((void)(++_index0))) {
    389             ((void)((*((signed int *)(&(*___dst__R4sVad_1).__anonymous_object34[_index0])))) /* ?{} */);
    390         }
    391 
    392     }
    393 
    394     ((void)((*___dst__R4sVad_1).__anonymous_object35) /* ?{} */);
    395344}
    396345static inline void ___constructor__F_R4sVad4sVad_autogen___1(struct Vad *___dst__R4sVad_1, struct Vad ___src__4sVad_1){
    397     ((void)((*___dst__R4sVad_1).__anonymous_object32=___src__4sVad_1.__anonymous_object32) /* ?{} */);
    398     ((void)((*___dst__R4sVad_1).__anonymous_object33=___src__4sVad_1.__anonymous_object33) /* ?{} */);
    399     {
    400         signed int _index1 = 0;
    401         for (;(_index1<10);((void)(++_index1))) {
    402             ((void)((*((signed int *)(&(*___dst__R4sVad_1).__anonymous_object34[_index1])))=___src__4sVad_1.__anonymous_object34[_index1]) /* ?{} */);
    403         }
    404 
    405     }
    406 
    407     ((void)((*___dst__R4sVad_1).__anonymous_object35=___src__4sVad_1.__anonymous_object35) /* ?{} */);
    408346}
    409347static inline void ___destructor__F_R4sVad_autogen___1(struct Vad *___dst__R4sVad_1){
    410     ((void)((*___dst__R4sVad_1).__anonymous_object35) /* ^?{} */);
    411     {
    412         signed int _index2 = (10-1);
    413         for (;(_index2>=0);((void)(--_index2))) {
    414             ((void)((*((signed int *)(&(*___dst__R4sVad_1).__anonymous_object34[_index2])))) /* ^?{} */);
    415         }
    416 
    417     }
    418 
    419     ((void)((*___dst__R4sVad_1).__anonymous_object33) /* ^?{} */);
    420     ((void)((*___dst__R4sVad_1).__anonymous_object32) /* ^?{} */);
    421348}
    422349static inline struct Vad ___operator_assign__F4sVad_R4sVad4sVad_autogen___1(struct Vad *___dst__R4sVad_1, struct Vad ___src__4sVad_1){
    423350    struct Vad ___ret__4sVad_1;
    424     ((void)((*___dst__R4sVad_1).__anonymous_object32=___src__4sVad_1.__anonymous_object32));
    425     ((void)((*___dst__R4sVad_1).__anonymous_object33=___src__4sVad_1.__anonymous_object33));
    426     {
    427         signed int _index3 = 0;
    428         for (;(_index3<10);((void)(++_index3))) {
    429             ((void)((*___dst__R4sVad_1).__anonymous_object34[_index3]=___src__4sVad_1.__anonymous_object34[_index3]));
    430         }
    431 
    432     }
    433 
    434     ((void)((*___dst__R4sVad_1).__anonymous_object35=___src__4sVad_1.__anonymous_object35));
    435     ((void)___constructor__F_R4sVad4sVad_autogen___1((&___ret__4sVad_1), (*___dst__R4sVad_1)));
    436     return ___ret__4sVad_1;
    437 }
    438 static inline void ___constructor__F_R4sVadi_autogen___1(struct Vad *___dst__R4sVad_1, signed int __anonymous_object46){
    439     ((void)((*___dst__R4sVad_1).__anonymous_object32=__anonymous_object46) /* ?{} */);
    440     ((void)((*___dst__R4sVad_1).__anonymous_object33) /* ?{} */);
    441     {
    442         signed int _index4 = 0;
    443         for (;(_index4<10);((void)(++_index4))) {
    444             ((void)((*((signed int *)(&(*___dst__R4sVad_1).__anonymous_object34[_index4])))) /* ?{} */);
    445         }
    446 
    447     }
    448 
    449     ((void)((*___dst__R4sVad_1).__anonymous_object35) /* ?{} */);
    450 }
    451 static inline void ___constructor__F_R4sVadiPi_autogen___1(struct Vad *___dst__R4sVad_1, signed int __anonymous_object47, signed int *__anonymous_object48){
    452     ((void)((*___dst__R4sVad_1).__anonymous_object32=__anonymous_object47) /* ?{} */);
    453     ((void)((*___dst__R4sVad_1).__anonymous_object33=__anonymous_object48) /* ?{} */);
    454     {
    455         signed int _index5 = 0;
    456         for (;(_index5<10);((void)(++_index5))) {
    457             ((void)((*((signed int *)(&(*___dst__R4sVad_1).__anonymous_object34[_index5])))) /* ?{} */);
    458         }
    459 
    460     }
    461 
    462     ((void)((*___dst__R4sVad_1).__anonymous_object35) /* ?{} */);
    463 }
    464 static inline void ___constructor__F_R4sVadiPiA0i_autogen___1(struct Vad *___dst__R4sVad_1, signed int __anonymous_object49, signed int *__anonymous_object50, signed int __anonymous_object51[((unsigned int )10)]){
    465     ((void)((*___dst__R4sVad_1).__anonymous_object32=__anonymous_object49) /* ?{} */);
    466     ((void)((*___dst__R4sVad_1).__anonymous_object33=__anonymous_object50) /* ?{} */);
    467     {
    468         signed int _index6 = 0;
    469         for (;(_index6<10);((void)(++_index6))) {
    470             ((void)((*((signed int *)(&(*___dst__R4sVad_1).__anonymous_object34[_index6])))=__anonymous_object51[_index6]) /* ?{} */);
    471         }
    472 
    473     }
    474 
    475     ((void)((*___dst__R4sVad_1).__anonymous_object35) /* ?{} */);
    476 }
    477 static inline void ___constructor__F_R4sVadiPiA0iPFi___autogen___1(struct Vad *___dst__R4sVad_1, signed int __anonymous_object52, signed int *__anonymous_object53, signed int __anonymous_object54[((unsigned int )10)], signed int (*__anonymous_object55)()){
    478     ((void)((*___dst__R4sVad_1).__anonymous_object32=__anonymous_object52) /* ?{} */);
    479     ((void)((*___dst__R4sVad_1).__anonymous_object33=__anonymous_object53) /* ?{} */);
    480     {
    481         signed int _index7 = 0;
    482         for (;(_index7<10);((void)(++_index7))) {
    483             ((void)((*((signed int *)(&(*___dst__R4sVad_1).__anonymous_object34[_index7])))=__anonymous_object54[_index7]) /* ?{} */);
    484         }
    485 
    486     }
    487 
    488     ((void)((*___dst__R4sVad_1).__anonymous_object35=__anonymous_object55) /* ?{} */);
    489 }
     351    ((void)___constructor__F_R4sVad4sVad_autogen___1((&___ret__4sVad_1), ___src__4sVad_1));
     352    return ((struct Vad )___ret__4sVad_1);
     353}
  • src/tests/.expect/32/declarationSpecifier.txt

    r3f7e12cb r78315272  
    2020static inline void ___destructor__F_R13s__anonymous0_autogen___1(struct __anonymous0 *___dst__R13s__anonymous0_1);
    2121static inline struct __anonymous0 ___operator_assign__F13s__anonymous0_R13s__anonymous013s__anonymous0_autogen___1(struct __anonymous0 *___dst__R13s__anonymous0_1, struct __anonymous0 ___src__13s__anonymous0_1);
    22 static inline void ___constructor__F_R13s__anonymous0i_autogen___1(struct __anonymous0 *___dst__R13s__anonymous0_1, signed int __i__i_1);
    2322static inline void ___constructor__F_R13s__anonymous0_autogen___1(struct __anonymous0 *___dst__R13s__anonymous0_1){
    2423    ((void)((*___dst__R13s__anonymous0_1).__i__i_1) /* ?{} */);
     
    3332    struct __anonymous0 ___ret__13s__anonymous0_1;
    3433    ((void)((*___dst__R13s__anonymous0_1).__i__i_1=___src__13s__anonymous0_1.__i__i_1));
    35     ((void)___constructor__F_R13s__anonymous013s__anonymous0_autogen___1((&___ret__13s__anonymous0_1), (*___dst__R13s__anonymous0_1)));
    36     return ___ret__13s__anonymous0_1;
     34    ((void)___constructor__F_R13s__anonymous013s__anonymous0_autogen___1((&___ret__13s__anonymous0_1), ___src__13s__anonymous0_1));
     35    return ((struct __anonymous0 )___ret__13s__anonymous0_1);
    3736}
    3837static inline void ___constructor__F_R13s__anonymous0i_autogen___1(struct __anonymous0 *___dst__R13s__anonymous0_1, signed int __i__i_1){
     
    4746static inline void ___destructor__F_R13s__anonymous1_autogen___1(struct __anonymous1 *___dst__R13s__anonymous1_1);
    4847static inline struct __anonymous1 ___operator_assign__F13s__anonymous1_R13s__anonymous113s__anonymous1_autogen___1(struct __anonymous1 *___dst__R13s__anonymous1_1, struct __anonymous1 ___src__13s__anonymous1_1);
    49 static inline void ___constructor__F_R13s__anonymous1i_autogen___1(struct __anonymous1 *___dst__R13s__anonymous1_1, signed int __i__i_1);
    5048static inline void ___constructor__F_R13s__anonymous1_autogen___1(struct __anonymous1 *___dst__R13s__anonymous1_1){
    5149    ((void)((*___dst__R13s__anonymous1_1).__i__i_1) /* ?{} */);
     
    6058    struct __anonymous1 ___ret__13s__anonymous1_1;
    6159    ((void)((*___dst__R13s__anonymous1_1).__i__i_1=___src__13s__anonymous1_1.__i__i_1));
    62     ((void)___constructor__F_R13s__anonymous113s__anonymous1_autogen___1((&___ret__13s__anonymous1_1), (*___dst__R13s__anonymous1_1)));
    63     return ___ret__13s__anonymous1_1;
     60    ((void)___constructor__F_R13s__anonymous113s__anonymous1_autogen___1((&___ret__13s__anonymous1_1), ___src__13s__anonymous1_1));
     61    return ((struct __anonymous1 )___ret__13s__anonymous1_1);
    6462}
    6563static inline void ___constructor__F_R13s__anonymous1i_autogen___1(struct __anonymous1 *___dst__R13s__anonymous1_1, signed int __i__i_1){
     
    7472static inline void ___destructor__F_R13s__anonymous2_autogen___1(struct __anonymous2 *___dst__R13s__anonymous2_1);
    7573static inline struct __anonymous2 ___operator_assign__F13s__anonymous2_R13s__anonymous213s__anonymous2_autogen___1(struct __anonymous2 *___dst__R13s__anonymous2_1, struct __anonymous2 ___src__13s__anonymous2_1);
    76 static inline void ___constructor__F_R13s__anonymous2i_autogen___1(struct __anonymous2 *___dst__R13s__anonymous2_1, signed int __i__i_1);
    7774static inline void ___constructor__F_R13s__anonymous2_autogen___1(struct __anonymous2 *___dst__R13s__anonymous2_1){
    7875    ((void)((*___dst__R13s__anonymous2_1).__i__i_1) /* ?{} */);
     
    8784    struct __anonymous2 ___ret__13s__anonymous2_1;
    8885    ((void)((*___dst__R13s__anonymous2_1).__i__i_1=___src__13s__anonymous2_1.__i__i_1));
    89     ((void)___constructor__F_R13s__anonymous213s__anonymous2_autogen___1((&___ret__13s__anonymous2_1), (*___dst__R13s__anonymous2_1)));
    90     return ___ret__13s__anonymous2_1;
     86    ((void)___constructor__F_R13s__anonymous213s__anonymous2_autogen___1((&___ret__13s__anonymous2_1), ___src__13s__anonymous2_1));
     87    return ((struct __anonymous2 )___ret__13s__anonymous2_1);
    9188}
    9289static inline void ___constructor__F_R13s__anonymous2i_autogen___1(struct __anonymous2 *___dst__R13s__anonymous2_1, signed int __i__i_1){
     
    10198static inline void ___destructor__F_R13s__anonymous3_autogen___1(struct __anonymous3 *___dst__R13s__anonymous3_1);
    10299static inline struct __anonymous3 ___operator_assign__F13s__anonymous3_R13s__anonymous313s__anonymous3_autogen___1(struct __anonymous3 *___dst__R13s__anonymous3_1, struct __anonymous3 ___src__13s__anonymous3_1);
    103 static inline void ___constructor__F_R13s__anonymous3i_autogen___1(struct __anonymous3 *___dst__R13s__anonymous3_1, signed int __i__i_1);
    104100static inline void ___constructor__F_R13s__anonymous3_autogen___1(struct __anonymous3 *___dst__R13s__anonymous3_1){
    105101    ((void)((*___dst__R13s__anonymous3_1).__i__i_1) /* ?{} */);
     
    114110    struct __anonymous3 ___ret__13s__anonymous3_1;
    115111    ((void)((*___dst__R13s__anonymous3_1).__i__i_1=___src__13s__anonymous3_1.__i__i_1));
    116     ((void)___constructor__F_R13s__anonymous313s__anonymous3_autogen___1((&___ret__13s__anonymous3_1), (*___dst__R13s__anonymous3_1)));
    117     return ___ret__13s__anonymous3_1;
     112    ((void)___constructor__F_R13s__anonymous313s__anonymous3_autogen___1((&___ret__13s__anonymous3_1), ___src__13s__anonymous3_1));
     113    return ((struct __anonymous3 )___ret__13s__anonymous3_1);
    118114}
    119115static inline void ___constructor__F_R13s__anonymous3i_autogen___1(struct __anonymous3 *___dst__R13s__anonymous3_1, signed int __i__i_1){
     
    128124static inline void ___destructor__F_R13s__anonymous4_autogen___1(struct __anonymous4 *___dst__R13s__anonymous4_1);
    129125static inline struct __anonymous4 ___operator_assign__F13s__anonymous4_R13s__anonymous413s__anonymous4_autogen___1(struct __anonymous4 *___dst__R13s__anonymous4_1, struct __anonymous4 ___src__13s__anonymous4_1);
    130 static inline void ___constructor__F_R13s__anonymous4i_autogen___1(struct __anonymous4 *___dst__R13s__anonymous4_1, signed int __i__i_1);
    131126static inline void ___constructor__F_R13s__anonymous4_autogen___1(struct __anonymous4 *___dst__R13s__anonymous4_1){
    132127    ((void)((*___dst__R13s__anonymous4_1).__i__i_1) /* ?{} */);
     
    141136    struct __anonymous4 ___ret__13s__anonymous4_1;
    142137    ((void)((*___dst__R13s__anonymous4_1).__i__i_1=___src__13s__anonymous4_1.__i__i_1));
    143     ((void)___constructor__F_R13s__anonymous413s__anonymous4_autogen___1((&___ret__13s__anonymous4_1), (*___dst__R13s__anonymous4_1)));
    144     return ___ret__13s__anonymous4_1;
     138    ((void)___constructor__F_R13s__anonymous413s__anonymous4_autogen___1((&___ret__13s__anonymous4_1), ___src__13s__anonymous4_1));
     139    return ((struct __anonymous4 )___ret__13s__anonymous4_1);
    145140}
    146141static inline void ___constructor__F_R13s__anonymous4i_autogen___1(struct __anonymous4 *___dst__R13s__anonymous4_1, signed int __i__i_1){
     
    155150static inline void ___destructor__F_R13s__anonymous5_autogen___1(struct __anonymous5 *___dst__R13s__anonymous5_1);
    156151static inline struct __anonymous5 ___operator_assign__F13s__anonymous5_R13s__anonymous513s__anonymous5_autogen___1(struct __anonymous5 *___dst__R13s__anonymous5_1, struct __anonymous5 ___src__13s__anonymous5_1);
    157 static inline void ___constructor__F_R13s__anonymous5i_autogen___1(struct __anonymous5 *___dst__R13s__anonymous5_1, signed int __i__i_1);
    158152static inline void ___constructor__F_R13s__anonymous5_autogen___1(struct __anonymous5 *___dst__R13s__anonymous5_1){
    159153    ((void)((*___dst__R13s__anonymous5_1).__i__i_1) /* ?{} */);
     
    168162    struct __anonymous5 ___ret__13s__anonymous5_1;
    169163    ((void)((*___dst__R13s__anonymous5_1).__i__i_1=___src__13s__anonymous5_1.__i__i_1));
    170     ((void)___constructor__F_R13s__anonymous513s__anonymous5_autogen___1((&___ret__13s__anonymous5_1), (*___dst__R13s__anonymous5_1)));
    171     return ___ret__13s__anonymous5_1;
     164    ((void)___constructor__F_R13s__anonymous513s__anonymous5_autogen___1((&___ret__13s__anonymous5_1), ___src__13s__anonymous5_1));
     165    return ((struct __anonymous5 )___ret__13s__anonymous5_1);
    172166}
    173167static inline void ___constructor__F_R13s__anonymous5i_autogen___1(struct __anonymous5 *___dst__R13s__anonymous5_1, signed int __i__i_1){
     
    182176static inline void ___destructor__F_R13s__anonymous6_autogen___1(struct __anonymous6 *___dst__R13s__anonymous6_1);
    183177static inline struct __anonymous6 ___operator_assign__F13s__anonymous6_R13s__anonymous613s__anonymous6_autogen___1(struct __anonymous6 *___dst__R13s__anonymous6_1, struct __anonymous6 ___src__13s__anonymous6_1);
    184 static inline void ___constructor__F_R13s__anonymous6i_autogen___1(struct __anonymous6 *___dst__R13s__anonymous6_1, signed int __i__i_1);
    185178static inline void ___constructor__F_R13s__anonymous6_autogen___1(struct __anonymous6 *___dst__R13s__anonymous6_1){
    186179    ((void)((*___dst__R13s__anonymous6_1).__i__i_1) /* ?{} */);
     
    195188    struct __anonymous6 ___ret__13s__anonymous6_1;
    196189    ((void)((*___dst__R13s__anonymous6_1).__i__i_1=___src__13s__anonymous6_1.__i__i_1));
    197     ((void)___constructor__F_R13s__anonymous613s__anonymous6_autogen___1((&___ret__13s__anonymous6_1), (*___dst__R13s__anonymous6_1)));
    198     return ___ret__13s__anonymous6_1;
     190    ((void)___constructor__F_R13s__anonymous613s__anonymous6_autogen___1((&___ret__13s__anonymous6_1), ___src__13s__anonymous6_1));
     191    return ((struct __anonymous6 )___ret__13s__anonymous6_1);
    199192}
    200193static inline void ___constructor__F_R13s__anonymous6i_autogen___1(struct __anonymous6 *___dst__R13s__anonymous6_1, signed int __i__i_1){
     
    209202static inline void ___destructor__F_R13s__anonymous7_autogen___1(struct __anonymous7 *___dst__R13s__anonymous7_1);
    210203static inline struct __anonymous7 ___operator_assign__F13s__anonymous7_R13s__anonymous713s__anonymous7_autogen___1(struct __anonymous7 *___dst__R13s__anonymous7_1, struct __anonymous7 ___src__13s__anonymous7_1);
    211 static inline void ___constructor__F_R13s__anonymous7i_autogen___1(struct __anonymous7 *___dst__R13s__anonymous7_1, signed int __i__i_1);
    212204static inline void ___constructor__F_R13s__anonymous7_autogen___1(struct __anonymous7 *___dst__R13s__anonymous7_1){
    213205    ((void)((*___dst__R13s__anonymous7_1).__i__i_1) /* ?{} */);
     
    222214    struct __anonymous7 ___ret__13s__anonymous7_1;
    223215    ((void)((*___dst__R13s__anonymous7_1).__i__i_1=___src__13s__anonymous7_1.__i__i_1));
    224     ((void)___constructor__F_R13s__anonymous713s__anonymous7_autogen___1((&___ret__13s__anonymous7_1), (*___dst__R13s__anonymous7_1)));
    225     return ___ret__13s__anonymous7_1;
     216    ((void)___constructor__F_R13s__anonymous713s__anonymous7_autogen___1((&___ret__13s__anonymous7_1), ___src__13s__anonymous7_1));
     217    return ((struct __anonymous7 )___ret__13s__anonymous7_1);
    226218}
    227219static inline void ___constructor__F_R13s__anonymous7i_autogen___1(struct __anonymous7 *___dst__R13s__anonymous7_1, signed int __i__i_1){
     
    244236static inline void ___destructor__F_R13s__anonymous8_autogen___1(struct __anonymous8 *___dst__R13s__anonymous8_1);
    245237static inline struct __anonymous8 ___operator_assign__F13s__anonymous8_R13s__anonymous813s__anonymous8_autogen___1(struct __anonymous8 *___dst__R13s__anonymous8_1, struct __anonymous8 ___src__13s__anonymous8_1);
    246 static inline void ___constructor__F_R13s__anonymous8s_autogen___1(struct __anonymous8 *___dst__R13s__anonymous8_1, signed short int __i__s_1);
    247238static inline void ___constructor__F_R13s__anonymous8_autogen___1(struct __anonymous8 *___dst__R13s__anonymous8_1){
    248239    ((void)((*___dst__R13s__anonymous8_1).__i__s_1) /* ?{} */);
     
    257248    struct __anonymous8 ___ret__13s__anonymous8_1;
    258249    ((void)((*___dst__R13s__anonymous8_1).__i__s_1=___src__13s__anonymous8_1.__i__s_1));
    259     ((void)___constructor__F_R13s__anonymous813s__anonymous8_autogen___1((&___ret__13s__anonymous8_1), (*___dst__R13s__anonymous8_1)));
    260     return ___ret__13s__anonymous8_1;
     250    ((void)___constructor__F_R13s__anonymous813s__anonymous8_autogen___1((&___ret__13s__anonymous8_1), ___src__13s__anonymous8_1));
     251    return ((struct __anonymous8 )___ret__13s__anonymous8_1);
    261252}
    262253static inline void ___constructor__F_R13s__anonymous8s_autogen___1(struct __anonymous8 *___dst__R13s__anonymous8_1, signed short int __i__s_1){
     
    271262static inline void ___destructor__F_R13s__anonymous9_autogen___1(struct __anonymous9 *___dst__R13s__anonymous9_1);
    272263static inline struct __anonymous9 ___operator_assign__F13s__anonymous9_R13s__anonymous913s__anonymous9_autogen___1(struct __anonymous9 *___dst__R13s__anonymous9_1, struct __anonymous9 ___src__13s__anonymous9_1);
    273 static inline void ___constructor__F_R13s__anonymous9s_autogen___1(struct __anonymous9 *___dst__R13s__anonymous9_1, signed short int __i__s_1);
    274264static inline void ___constructor__F_R13s__anonymous9_autogen___1(struct __anonymous9 *___dst__R13s__anonymous9_1){
    275265    ((void)((*___dst__R13s__anonymous9_1).__i__s_1) /* ?{} */);
     
    284274    struct __anonymous9 ___ret__13s__anonymous9_1;
    285275    ((void)((*___dst__R13s__anonymous9_1).__i__s_1=___src__13s__anonymous9_1.__i__s_1));
    286     ((void)___constructor__F_R13s__anonymous913s__anonymous9_autogen___1((&___ret__13s__anonymous9_1), (*___dst__R13s__anonymous9_1)));
    287     return ___ret__13s__anonymous9_1;
     276    ((void)___constructor__F_R13s__anonymous913s__anonymous9_autogen___1((&___ret__13s__anonymous9_1), ___src__13s__anonymous9_1));
     277    return ((struct __anonymous9 )___ret__13s__anonymous9_1);
    288278}
    289279static inline void ___constructor__F_R13s__anonymous9s_autogen___1(struct __anonymous9 *___dst__R13s__anonymous9_1, signed short int __i__s_1){
     
    298288static inline void ___destructor__F_R14s__anonymous10_autogen___1(struct __anonymous10 *___dst__R14s__anonymous10_1);
    299289static inline struct __anonymous10 ___operator_assign__F14s__anonymous10_R14s__anonymous1014s__anonymous10_autogen___1(struct __anonymous10 *___dst__R14s__anonymous10_1, struct __anonymous10 ___src__14s__anonymous10_1);
    300 static inline void ___constructor__F_R14s__anonymous10s_autogen___1(struct __anonymous10 *___dst__R14s__anonymous10_1, signed short int __i__s_1);
    301290static inline void ___constructor__F_R14s__anonymous10_autogen___1(struct __anonymous10 *___dst__R14s__anonymous10_1){
    302291    ((void)((*___dst__R14s__anonymous10_1).__i__s_1) /* ?{} */);
     
    311300    struct __anonymous10 ___ret__14s__anonymous10_1;
    312301    ((void)((*___dst__R14s__anonymous10_1).__i__s_1=___src__14s__anonymous10_1.__i__s_1));
    313     ((void)___constructor__F_R14s__anonymous1014s__anonymous10_autogen___1((&___ret__14s__anonymous10_1), (*___dst__R14s__anonymous10_1)));
    314     return ___ret__14s__anonymous10_1;
     302    ((void)___constructor__F_R14s__anonymous1014s__anonymous10_autogen___1((&___ret__14s__anonymous10_1), ___src__14s__anonymous10_1));
     303    return ((struct __anonymous10 )___ret__14s__anonymous10_1);
    315304}
    316305static inline void ___constructor__F_R14s__anonymous10s_autogen___1(struct __anonymous10 *___dst__R14s__anonymous10_1, signed short int __i__s_1){
     
    325314static inline void ___destructor__F_R14s__anonymous11_autogen___1(struct __anonymous11 *___dst__R14s__anonymous11_1);
    326315static inline struct __anonymous11 ___operator_assign__F14s__anonymous11_R14s__anonymous1114s__anonymous11_autogen___1(struct __anonymous11 *___dst__R14s__anonymous11_1, struct __anonymous11 ___src__14s__anonymous11_1);
    327 static inline void ___constructor__F_R14s__anonymous11s_autogen___1(struct __anonymous11 *___dst__R14s__anonymous11_1, signed short int __i__s_1);
    328316static inline void ___constructor__F_R14s__anonymous11_autogen___1(struct __anonymous11 *___dst__R14s__anonymous11_1){
    329317    ((void)((*___dst__R14s__anonymous11_1).__i__s_1) /* ?{} */);
     
    338326    struct __anonymous11 ___ret__14s__anonymous11_1;
    339327    ((void)((*___dst__R14s__anonymous11_1).__i__s_1=___src__14s__anonymous11_1.__i__s_1));
    340     ((void)___constructor__F_R14s__anonymous1114s__anonymous11_autogen___1((&___ret__14s__anonymous11_1), (*___dst__R14s__anonymous11_1)));
    341     return ___ret__14s__anonymous11_1;
     328    ((void)___constructor__F_R14s__anonymous1114s__anonymous11_autogen___1((&___ret__14s__anonymous11_1), ___src__14s__anonymous11_1));
     329    return ((struct __anonymous11 )___ret__14s__anonymous11_1);
    342330}
    343331static inline void ___constructor__F_R14s__anonymous11s_autogen___1(struct __anonymous11 *___dst__R14s__anonymous11_1, signed short int __i__s_1){
     
    352340static inline void ___destructor__F_R14s__anonymous12_autogen___1(struct __anonymous12 *___dst__R14s__anonymous12_1);
    353341static inline struct __anonymous12 ___operator_assign__F14s__anonymous12_R14s__anonymous1214s__anonymous12_autogen___1(struct __anonymous12 *___dst__R14s__anonymous12_1, struct __anonymous12 ___src__14s__anonymous12_1);
    354 static inline void ___constructor__F_R14s__anonymous12s_autogen___1(struct __anonymous12 *___dst__R14s__anonymous12_1, signed short int __i__s_1);
    355342static inline void ___constructor__F_R14s__anonymous12_autogen___1(struct __anonymous12 *___dst__R14s__anonymous12_1){
    356343    ((void)((*___dst__R14s__anonymous12_1).__i__s_1) /* ?{} */);
     
    365352    struct __anonymous12 ___ret__14s__anonymous12_1;
    366353    ((void)((*___dst__R14s__anonymous12_1).__i__s_1=___src__14s__anonymous12_1.__i__s_1));
    367     ((void)___constructor__F_R14s__anonymous1214s__anonymous12_autogen___1((&___ret__14s__anonymous12_1), (*___dst__R14s__anonymous12_1)));
    368     return ___ret__14s__anonymous12_1;
     354    ((void)___constructor__F_R14s__anonymous1214s__anonymous12_autogen___1((&___ret__14s__anonymous12_1), ___src__14s__anonymous12_1));
     355    return ((struct __anonymous12 )___ret__14s__anonymous12_1);
    369356}
    370357static inline void ___constructor__F_R14s__anonymous12s_autogen___1(struct __anonymous12 *___dst__R14s__anonymous12_1, signed short int __i__s_1){
     
    379366static inline void ___destructor__F_R14s__anonymous13_autogen___1(struct __anonymous13 *___dst__R14s__anonymous13_1);
    380367static inline struct __anonymous13 ___operator_assign__F14s__anonymous13_R14s__anonymous1314s__anonymous13_autogen___1(struct __anonymous13 *___dst__R14s__anonymous13_1, struct __anonymous13 ___src__14s__anonymous13_1);
    381 static inline void ___constructor__F_R14s__anonymous13s_autogen___1(struct __anonymous13 *___dst__R14s__anonymous13_1, signed short int __i__s_1);
    382368static inline void ___constructor__F_R14s__anonymous13_autogen___1(struct __anonymous13 *___dst__R14s__anonymous13_1){
    383369    ((void)((*___dst__R14s__anonymous13_1).__i__s_1) /* ?{} */);
     
    392378    struct __anonymous13 ___ret__14s__anonymous13_1;
    393379    ((void)((*___dst__R14s__anonymous13_1).__i__s_1=___src__14s__anonymous13_1.__i__s_1));
    394     ((void)___constructor__F_R14s__anonymous1314s__anonymous13_autogen___1((&___ret__14s__anonymous13_1), (*___dst__R14s__anonymous13_1)));
    395     return ___ret__14s__anonymous13_1;
     380    ((void)___constructor__F_R14s__anonymous1314s__anonymous13_autogen___1((&___ret__14s__anonymous13_1), ___src__14s__anonymous13_1));
     381    return ((struct __anonymous13 )___ret__14s__anonymous13_1);
    396382}
    397383static inline void ___constructor__F_R14s__anonymous13s_autogen___1(struct __anonymous13 *___dst__R14s__anonymous13_1, signed short int __i__s_1){
     
    406392static inline void ___destructor__F_R14s__anonymous14_autogen___1(struct __anonymous14 *___dst__R14s__anonymous14_1);
    407393static inline struct __anonymous14 ___operator_assign__F14s__anonymous14_R14s__anonymous1414s__anonymous14_autogen___1(struct __anonymous14 *___dst__R14s__anonymous14_1, struct __anonymous14 ___src__14s__anonymous14_1);
    408 static inline void ___constructor__F_R14s__anonymous14s_autogen___1(struct __anonymous14 *___dst__R14s__anonymous14_1, signed short int __i__s_1);
    409394static inline void ___constructor__F_R14s__anonymous14_autogen___1(struct __anonymous14 *___dst__R14s__anonymous14_1){
    410395    ((void)((*___dst__R14s__anonymous14_1).__i__s_1) /* ?{} */);
     
    419404    struct __anonymous14 ___ret__14s__anonymous14_1;
    420405    ((void)((*___dst__R14s__anonymous14_1).__i__s_1=___src__14s__anonymous14_1.__i__s_1));
    421     ((void)___constructor__F_R14s__anonymous1414s__anonymous14_autogen___1((&___ret__14s__anonymous14_1), (*___dst__R14s__anonymous14_1)));
    422     return ___ret__14s__anonymous14_1;
     406    ((void)___constructor__F_R14s__anonymous1414s__anonymous14_autogen___1((&___ret__14s__anonymous14_1), ___src__14s__anonymous14_1));
     407    return ((struct __anonymous14 )___ret__14s__anonymous14_1);
    423408}
    424409static inline void ___constructor__F_R14s__anonymous14s_autogen___1(struct __anonymous14 *___dst__R14s__anonymous14_1, signed short int __i__s_1){
     
    433418static inline void ___destructor__F_R14s__anonymous15_autogen___1(struct __anonymous15 *___dst__R14s__anonymous15_1);
    434419static inline struct __anonymous15 ___operator_assign__F14s__anonymous15_R14s__anonymous1514s__anonymous15_autogen___1(struct __anonymous15 *___dst__R14s__anonymous15_1, struct __anonymous15 ___src__14s__anonymous15_1);
    435 static inline void ___constructor__F_R14s__anonymous15s_autogen___1(struct __anonymous15 *___dst__R14s__anonymous15_1, signed short int __i__s_1);
    436420static inline void ___constructor__F_R14s__anonymous15_autogen___1(struct __anonymous15 *___dst__R14s__anonymous15_1){
    437421    ((void)((*___dst__R14s__anonymous15_1).__i__s_1) /* ?{} */);
     
    446430    struct __anonymous15 ___ret__14s__anonymous15_1;
    447431    ((void)((*___dst__R14s__anonymous15_1).__i__s_1=___src__14s__anonymous15_1.__i__s_1));
    448     ((void)___constructor__F_R14s__anonymous1514s__anonymous15_autogen___1((&___ret__14s__anonymous15_1), (*___dst__R14s__anonymous15_1)));
    449     return ___ret__14s__anonymous15_1;
     432    ((void)___constructor__F_R14s__anonymous1514s__anonymous15_autogen___1((&___ret__14s__anonymous15_1), ___src__14s__anonymous15_1));
     433    return ((struct __anonymous15 )___ret__14s__anonymous15_1);
    450434}
    451435static inline void ___constructor__F_R14s__anonymous15s_autogen___1(struct __anonymous15 *___dst__R14s__anonymous15_1, signed short int __i__s_1){
     
    476460static inline void ___destructor__F_R14s__anonymous16_autogen___1(struct __anonymous16 *___dst__R14s__anonymous16_1);
    477461static inline struct __anonymous16 ___operator_assign__F14s__anonymous16_R14s__anonymous1614s__anonymous16_autogen___1(struct __anonymous16 *___dst__R14s__anonymous16_1, struct __anonymous16 ___src__14s__anonymous16_1);
    478 static inline void ___constructor__F_R14s__anonymous16i_autogen___1(struct __anonymous16 *___dst__R14s__anonymous16_1, signed int __i__i_1);
    479462static inline void ___constructor__F_R14s__anonymous16_autogen___1(struct __anonymous16 *___dst__R14s__anonymous16_1){
    480463    ((void)((*___dst__R14s__anonymous16_1).__i__i_1) /* ?{} */);
     
    489472    struct __anonymous16 ___ret__14s__anonymous16_1;
    490473    ((void)((*___dst__R14s__anonymous16_1).__i__i_1=___src__14s__anonymous16_1.__i__i_1));
    491     ((void)___constructor__F_R14s__anonymous1614s__anonymous16_autogen___1((&___ret__14s__anonymous16_1), (*___dst__R14s__anonymous16_1)));
    492     return ___ret__14s__anonymous16_1;
     474    ((void)___constructor__F_R14s__anonymous1614s__anonymous16_autogen___1((&___ret__14s__anonymous16_1), ___src__14s__anonymous16_1));
     475    return ((struct __anonymous16 )___ret__14s__anonymous16_1);
    493476}
    494477static inline void ___constructor__F_R14s__anonymous16i_autogen___1(struct __anonymous16 *___dst__R14s__anonymous16_1, signed int __i__i_1){
     
    503486static inline void ___destructor__F_R14s__anonymous17_autogen___1(struct __anonymous17 *___dst__R14s__anonymous17_1);
    504487static inline struct __anonymous17 ___operator_assign__F14s__anonymous17_R14s__anonymous1714s__anonymous17_autogen___1(struct __anonymous17 *___dst__R14s__anonymous17_1, struct __anonymous17 ___src__14s__anonymous17_1);
    505 static inline void ___constructor__F_R14s__anonymous17i_autogen___1(struct __anonymous17 *___dst__R14s__anonymous17_1, signed int __i__i_1);
    506488static inline void ___constructor__F_R14s__anonymous17_autogen___1(struct __anonymous17 *___dst__R14s__anonymous17_1){
    507489    ((void)((*___dst__R14s__anonymous17_1).__i__i_1) /* ?{} */);
     
    516498    struct __anonymous17 ___ret__14s__anonymous17_1;
    517499    ((void)((*___dst__R14s__anonymous17_1).__i__i_1=___src__14s__anonymous17_1.__i__i_1));
    518     ((void)___constructor__F_R14s__anonymous1714s__anonymous17_autogen___1((&___ret__14s__anonymous17_1), (*___dst__R14s__anonymous17_1)));
    519     return ___ret__14s__anonymous17_1;
     500    ((void)___constructor__F_R14s__anonymous1714s__anonymous17_autogen___1((&___ret__14s__anonymous17_1), ___src__14s__anonymous17_1));
     501    return ((struct __anonymous17 )___ret__14s__anonymous17_1);
    520502}
    521503static inline void ___constructor__F_R14s__anonymous17i_autogen___1(struct __anonymous17 *___dst__R14s__anonymous17_1, signed int __i__i_1){
     
    530512static inline void ___destructor__F_R14s__anonymous18_autogen___1(struct __anonymous18 *___dst__R14s__anonymous18_1);
    531513static inline struct __anonymous18 ___operator_assign__F14s__anonymous18_R14s__anonymous1814s__anonymous18_autogen___1(struct __anonymous18 *___dst__R14s__anonymous18_1, struct __anonymous18 ___src__14s__anonymous18_1);
    532 static inline void ___constructor__F_R14s__anonymous18i_autogen___1(struct __anonymous18 *___dst__R14s__anonymous18_1, signed int __i__i_1);
    533514static inline void ___constructor__F_R14s__anonymous18_autogen___1(struct __anonymous18 *___dst__R14s__anonymous18_1){
    534515    ((void)((*___dst__R14s__anonymous18_1).__i__i_1) /* ?{} */);
     
    543524    struct __anonymous18 ___ret__14s__anonymous18_1;
    544525    ((void)((*___dst__R14s__anonymous18_1).__i__i_1=___src__14s__anonymous18_1.__i__i_1));
    545     ((void)___constructor__F_R14s__anonymous1814s__anonymous18_autogen___1((&___ret__14s__anonymous18_1), (*___dst__R14s__anonymous18_1)));
    546     return ___ret__14s__anonymous18_1;
     526    ((void)___constructor__F_R14s__anonymous1814s__anonymous18_autogen___1((&___ret__14s__anonymous18_1), ___src__14s__anonymous18_1));
     527    return ((struct __anonymous18 )___ret__14s__anonymous18_1);
    547528}
    548529static inline void ___constructor__F_R14s__anonymous18i_autogen___1(struct __anonymous18 *___dst__R14s__anonymous18_1, signed int __i__i_1){
     
    557538static inline void ___destructor__F_R14s__anonymous19_autogen___1(struct __anonymous19 *___dst__R14s__anonymous19_1);
    558539static inline struct __anonymous19 ___operator_assign__F14s__anonymous19_R14s__anonymous1914s__anonymous19_autogen___1(struct __anonymous19 *___dst__R14s__anonymous19_1, struct __anonymous19 ___src__14s__anonymous19_1);
    559 static inline void ___constructor__F_R14s__anonymous19i_autogen___1(struct __anonymous19 *___dst__R14s__anonymous19_1, signed int __i__i_1);
    560540static inline void ___constructor__F_R14s__anonymous19_autogen___1(struct __anonymous19 *___dst__R14s__anonymous19_1){
    561541    ((void)((*___dst__R14s__anonymous19_1).__i__i_1) /* ?{} */);
     
    570550    struct __anonymous19 ___ret__14s__anonymous19_1;
    571551    ((void)((*___dst__R14s__anonymous19_1).__i__i_1=___src__14s__anonymous19_1.__i__i_1));
    572     ((void)___constructor__F_R14s__anonymous1914s__anonymous19_autogen___1((&___ret__14s__anonymous19_1), (*___dst__R14s__anonymous19_1)));
    573     return ___ret__14s__anonymous19_1;
     552    ((void)___constructor__F_R14s__anonymous1914s__anonymous19_autogen___1((&___ret__14s__anonymous19_1), ___src__14s__anonymous19_1));
     553    return ((struct __anonymous19 )___ret__14s__anonymous19_1);
    574554}
    575555static inline void ___constructor__F_R14s__anonymous19i_autogen___1(struct __anonymous19 *___dst__R14s__anonymous19_1, signed int __i__i_1){
     
    584564static inline void ___destructor__F_R14s__anonymous20_autogen___1(struct __anonymous20 *___dst__R14s__anonymous20_1);
    585565static inline struct __anonymous20 ___operator_assign__F14s__anonymous20_R14s__anonymous2014s__anonymous20_autogen___1(struct __anonymous20 *___dst__R14s__anonymous20_1, struct __anonymous20 ___src__14s__anonymous20_1);
    586 static inline void ___constructor__F_R14s__anonymous20i_autogen___1(struct __anonymous20 *___dst__R14s__anonymous20_1, signed int __i__i_1);
    587566static inline void ___constructor__F_R14s__anonymous20_autogen___1(struct __anonymous20 *___dst__R14s__anonymous20_1){
    588567    ((void)((*___dst__R14s__anonymous20_1).__i__i_1) /* ?{} */);
     
    597576    struct __anonymous20 ___ret__14s__anonymous20_1;
    598577    ((void)((*___dst__R14s__anonymous20_1).__i__i_1=___src__14s__anonymous20_1.__i__i_1));
    599     ((void)___constructor__F_R14s__anonymous2014s__anonymous20_autogen___1((&___ret__14s__anonymous20_1), (*___dst__R14s__anonymous20_1)));
    600     return ___ret__14s__anonymous20_1;
     578    ((void)___constructor__F_R14s__anonymous2014s__anonymous20_autogen___1((&___ret__14s__anonymous20_1), ___src__14s__anonymous20_1));
     579    return ((struct __anonymous20 )___ret__14s__anonymous20_1);
    601580}
    602581static inline void ___constructor__F_R14s__anonymous20i_autogen___1(struct __anonymous20 *___dst__R14s__anonymous20_1, signed int __i__i_1){
     
    611590static inline void ___destructor__F_R14s__anonymous21_autogen___1(struct __anonymous21 *___dst__R14s__anonymous21_1);
    612591static inline struct __anonymous21 ___operator_assign__F14s__anonymous21_R14s__anonymous2114s__anonymous21_autogen___1(struct __anonymous21 *___dst__R14s__anonymous21_1, struct __anonymous21 ___src__14s__anonymous21_1);
    613 static inline void ___constructor__F_R14s__anonymous21i_autogen___1(struct __anonymous21 *___dst__R14s__anonymous21_1, signed int __i__i_1);
    614592static inline void ___constructor__F_R14s__anonymous21_autogen___1(struct __anonymous21 *___dst__R14s__anonymous21_1){
    615593    ((void)((*___dst__R14s__anonymous21_1).__i__i_1) /* ?{} */);
     
    624602    struct __anonymous21 ___ret__14s__anonymous21_1;
    625603    ((void)((*___dst__R14s__anonymous21_1).__i__i_1=___src__14s__anonymous21_1.__i__i_1));
    626     ((void)___constructor__F_R14s__anonymous2114s__anonymous21_autogen___1((&___ret__14s__anonymous21_1), (*___dst__R14s__anonymous21_1)));
    627     return ___ret__14s__anonymous21_1;
     604    ((void)___constructor__F_R14s__anonymous2114s__anonymous21_autogen___1((&___ret__14s__anonymous21_1), ___src__14s__anonymous21_1));
     605    return ((struct __anonymous21 )___ret__14s__anonymous21_1);
    628606}
    629607static inline void ___constructor__F_R14s__anonymous21i_autogen___1(struct __anonymous21 *___dst__R14s__anonymous21_1, signed int __i__i_1){
     
    638616static inline void ___destructor__F_R14s__anonymous22_autogen___1(struct __anonymous22 *___dst__R14s__anonymous22_1);
    639617static inline struct __anonymous22 ___operator_assign__F14s__anonymous22_R14s__anonymous2214s__anonymous22_autogen___1(struct __anonymous22 *___dst__R14s__anonymous22_1, struct __anonymous22 ___src__14s__anonymous22_1);
    640 static inline void ___constructor__F_R14s__anonymous22i_autogen___1(struct __anonymous22 *___dst__R14s__anonymous22_1, signed int __i__i_1);
    641618static inline void ___constructor__F_R14s__anonymous22_autogen___1(struct __anonymous22 *___dst__R14s__anonymous22_1){
    642619    ((void)((*___dst__R14s__anonymous22_1).__i__i_1) /* ?{} */);
     
    651628    struct __anonymous22 ___ret__14s__anonymous22_1;
    652629    ((void)((*___dst__R14s__anonymous22_1).__i__i_1=___src__14s__anonymous22_1.__i__i_1));
    653     ((void)___constructor__F_R14s__anonymous2214s__anonymous22_autogen___1((&___ret__14s__anonymous22_1), (*___dst__R14s__anonymous22_1)));
    654     return ___ret__14s__anonymous22_1;
     630    ((void)___constructor__F_R14s__anonymous2214s__anonymous22_autogen___1((&___ret__14s__anonymous22_1), ___src__14s__anonymous22_1));
     631    return ((struct __anonymous22 )___ret__14s__anonymous22_1);
    655632}
    656633static inline void ___constructor__F_R14s__anonymous22i_autogen___1(struct __anonymous22 *___dst__R14s__anonymous22_1, signed int __i__i_1){
     
    665642static inline void ___destructor__F_R14s__anonymous23_autogen___1(struct __anonymous23 *___dst__R14s__anonymous23_1);
    666643static inline struct __anonymous23 ___operator_assign__F14s__anonymous23_R14s__anonymous2314s__anonymous23_autogen___1(struct __anonymous23 *___dst__R14s__anonymous23_1, struct __anonymous23 ___src__14s__anonymous23_1);
    667 static inline void ___constructor__F_R14s__anonymous23i_autogen___1(struct __anonymous23 *___dst__R14s__anonymous23_1, signed int __i__i_1);
    668644static inline void ___constructor__F_R14s__anonymous23_autogen___1(struct __anonymous23 *___dst__R14s__anonymous23_1){
    669645    ((void)((*___dst__R14s__anonymous23_1).__i__i_1) /* ?{} */);
     
    678654    struct __anonymous23 ___ret__14s__anonymous23_1;
    679655    ((void)((*___dst__R14s__anonymous23_1).__i__i_1=___src__14s__anonymous23_1.__i__i_1));
    680     ((void)___constructor__F_R14s__anonymous2314s__anonymous23_autogen___1((&___ret__14s__anonymous23_1), (*___dst__R14s__anonymous23_1)));
    681     return ___ret__14s__anonymous23_1;
     656    ((void)___constructor__F_R14s__anonymous2314s__anonymous23_autogen___1((&___ret__14s__anonymous23_1), ___src__14s__anonymous23_1));
     657    return ((struct __anonymous23 )___ret__14s__anonymous23_1);
    682658}
    683659static inline void ___constructor__F_R14s__anonymous23i_autogen___1(struct __anonymous23 *___dst__R14s__anonymous23_1, signed int __i__i_1){
     
    696672    __attribute__ ((unused)) signed int ___retval_main__i_1;
    697673    ((void)(___retval_main__i_1=((signed int )0)) /* ?{} */);
    698     return ___retval_main__i_1;
     674    return ((signed int )___retval_main__i_1);
    699675    ((void)(___retval_main__i_1=0) /* ?{} */);
    700     return ___retval_main__i_1;
     676    return ((signed int )___retval_main__i_1);
    701677}
    702678static inline int invoke_main(int argc, char* argv[], char* envp[]) { (void)argc; (void)argv; (void)envp; return __main__Fi_iPPCc__1(argc, argv); }
     
    713689    ((void)(___retval_main__i_1=(((void)(_tmp_cp_ret0=invoke_main(__argc__i_1, __argv__PPc_1, __envp__PPc_1))) , _tmp_cp_ret0)) /* ?{} */);
    714690    ((void)(_tmp_cp_ret0) /* ^?{} */);
    715     return ___retval_main__i_1;
    716 }
     691    return ((signed int )___retval_main__i_1);
     692}
  • src/tests/.expect/32/extension.txt

    r3f7e12cb r78315272  
    1717static inline void ___destructor__F_R2sS_autogen___1(struct S *___dst__R2sS_1);
    1818static inline struct S ___operator_assign__F2sS_R2sS2sS_autogen___1(struct S *___dst__R2sS_1, struct S ___src__2sS_1);
    19 static inline void ___constructor__F_R2sSi_autogen___1(struct S *___dst__R2sS_1, signed int __a__i_1);
    20 static inline void ___constructor__F_R2sSii_autogen___1(struct S *___dst__R2sS_1, signed int __a__i_1, signed int __b__i_1);
    21 static inline void ___constructor__F_R2sSiii_autogen___1(struct S *___dst__R2sS_1, signed int __a__i_1, signed int __b__i_1, signed int __c__i_1);
    2219static inline void ___constructor__F_R2sS_autogen___1(struct S *___dst__R2sS_1){
    2320    ((void)((*___dst__R2sS_1).__a__i_1) /* ?{} */);
     
    4037    ((void)((*___dst__R2sS_1).__b__i_1=___src__2sS_1.__b__i_1));
    4138    ((void)((*___dst__R2sS_1).__c__i_1=___src__2sS_1.__c__i_1));
    42     ((void)___constructor__F_R2sS2sS_autogen___1((&___ret__2sS_1), (*___dst__R2sS_1)));
    43     return ___ret__2sS_1;
     39    ((void)___constructor__F_R2sS2sS_autogen___1((&___ret__2sS_1), ___src__2sS_1));
     40    return ((struct S )___ret__2sS_1);
    4441}
    4542static inline void ___constructor__F_R2sSi_autogen___1(struct S *___dst__R2sS_1, signed int __a__i_1){
     
    6360    __extension__ signed int __c__i_1;
    6461};
    65 static inline void ___constructor__F_R2uU_autogen___1(__attribute__ ((unused)) union U *___dst__R2uU_1);
    66 static inline void ___constructor__F_R2uU2uU_autogen___1(union U *___dst__R2uU_1, union U ___src__2uU_1);
    67 static inline void ___destructor__F_R2uU_autogen___1(__attribute__ ((unused)) union U *___dst__R2uU_1);
    68 static inline union U ___operator_assign__F2uU_R2uU2uU_autogen___1(union U *___dst__R2uU_1, union U ___src__2uU_1);
    69 static inline void ___constructor__F_R2uUi_autogen___1(union U *___dst__R2uU_1, signed int __a__i_1);
    7062static inline void ___constructor__F_R2uU_autogen___1(__attribute__ ((unused)) union U *___dst__R2uU_1){
    7163}
     
    7870    union U ___ret__2uU_1;
    7971    ((void)__builtin_memcpy(((void *)___dst__R2uU_1), ((const void *)(&___src__2uU_1)), sizeof(union U )));
    80     ((void)___constructor__F_R2uU2uU_autogen___1((&___ret__2uU_1), (*___dst__R2uU_1)));
    81     return ___ret__2uU_1;
     72    ((void)___constructor__F_R2uU2uU_autogen___1((&___ret__2uU_1), ___src__2uU_1));
     73    return ((union U )___ret__2uU_1);
    8274}
    83 static inline void ___constructor__F_R2uUi_autogen___1(union U *___dst__R2uU_1, signed int __a__i_1){
    84     ((void)__builtin_memcpy(((void *)___dst__R2uU_1), ((const void *)(&__a__i_1)), sizeof(signed int )));
     75static inline void ___constructor__F_R2uUi_autogen___1(__attribute__ ((unused)) union U *___dst__R2uU_1, signed int __src__i_1){
     76    ((void)__builtin_memcpy(((void *)___dst__R2uU_1), ((const void *)(&__src__i_1)), sizeof(signed int )));
    8577}
    8678__extension__ enum E {
     
    10294        __extension__ signed int *__z__Pi_2;
    10395    };
    104     inline void ___constructor__F_R2sS_autogen___2(struct S *___dst__R2sS_2){
    105         ((void)((*___dst__R2sS_2).__a__i_2) /* ?{} */);
    106         ((void)((*___dst__R2sS_2).__b__i_2) /* ?{} */);
    107         ((void)((*___dst__R2sS_2).__c__i_2) /* ?{} */);
    108         ((void)((*___dst__R2sS_2).__x__Pi_2) /* ?{} */);
    109         ((void)((*___dst__R2sS_2).__y__Pi_2) /* ?{} */);
    110         ((void)((*___dst__R2sS_2).__z__Pi_2) /* ?{} */);
    111     }
    112     inline void ___constructor__F_R2sS2sS_autogen___2(struct S *___dst__R2sS_2, struct S ___src__2sS_2){
    113         ((void)((*___dst__R2sS_2).__a__i_2=___src__2sS_2.__a__i_2) /* ?{} */);
    114         ((void)((*___dst__R2sS_2).__b__i_2=___src__2sS_2.__b__i_2) /* ?{} */);
    115         ((void)((*___dst__R2sS_2).__c__i_2=___src__2sS_2.__c__i_2) /* ?{} */);
    116         ((void)((*___dst__R2sS_2).__x__Pi_2=___src__2sS_2.__x__Pi_2) /* ?{} */);
    117         ((void)((*___dst__R2sS_2).__y__Pi_2=___src__2sS_2.__y__Pi_2) /* ?{} */);
    118         ((void)((*___dst__R2sS_2).__z__Pi_2=___src__2sS_2.__z__Pi_2) /* ?{} */);
    119     }
    120     inline void ___destructor__F_R2sS_autogen___2(struct S *___dst__R2sS_2){
    121         ((void)((*___dst__R2sS_2).__z__Pi_2) /* ^?{} */);
    122         ((void)((*___dst__R2sS_2).__y__Pi_2) /* ^?{} */);
    123         ((void)((*___dst__R2sS_2).__x__Pi_2) /* ^?{} */);
    124         ((void)((*___dst__R2sS_2).__c__i_2) /* ^?{} */);
    125         ((void)((*___dst__R2sS_2).__b__i_2) /* ^?{} */);
    126         ((void)((*___dst__R2sS_2).__a__i_2) /* ^?{} */);
    127     }
    128     inline struct S ___operator_assign__F2sS_R2sS2sS_autogen___2(struct S *___dst__R2sS_2, struct S ___src__2sS_2){
    129         struct S ___ret__2sS_2;
    130         ((void)((*___dst__R2sS_2).__a__i_2=___src__2sS_2.__a__i_2));
    131         ((void)((*___dst__R2sS_2).__b__i_2=___src__2sS_2.__b__i_2));
    132         ((void)((*___dst__R2sS_2).__c__i_2=___src__2sS_2.__c__i_2));
    133         ((void)((*___dst__R2sS_2).__x__Pi_2=___src__2sS_2.__x__Pi_2));
    134         ((void)((*___dst__R2sS_2).__y__Pi_2=___src__2sS_2.__y__Pi_2));
    135         ((void)((*___dst__R2sS_2).__z__Pi_2=___src__2sS_2.__z__Pi_2));
    136         ((void)___constructor__F_R2sS2sS_autogen___2((&___ret__2sS_2), (*___dst__R2sS_2)));
    137         return ___ret__2sS_2;
    138     }
    139     inline void ___constructor__F_R2sSi_autogen___2(struct S *___dst__R2sS_2, signed int __a__i_2){
    140         ((void)((*___dst__R2sS_2).__a__i_2=__a__i_2) /* ?{} */);
    141         ((void)((*___dst__R2sS_2).__b__i_2) /* ?{} */);
    142         ((void)((*___dst__R2sS_2).__c__i_2) /* ?{} */);
    143         ((void)((*___dst__R2sS_2).__x__Pi_2) /* ?{} */);
    144         ((void)((*___dst__R2sS_2).__y__Pi_2) /* ?{} */);
    145         ((void)((*___dst__R2sS_2).__z__Pi_2) /* ?{} */);
    146     }
    147     inline void ___constructor__F_R2sSii_autogen___2(struct S *___dst__R2sS_2, signed int __a__i_2, signed int __b__i_2){
    148         ((void)((*___dst__R2sS_2).__a__i_2=__a__i_2) /* ?{} */);
    149         ((void)((*___dst__R2sS_2).__b__i_2=__b__i_2) /* ?{} */);
    150         ((void)((*___dst__R2sS_2).__c__i_2) /* ?{} */);
    151         ((void)((*___dst__R2sS_2).__x__Pi_2) /* ?{} */);
    152         ((void)((*___dst__R2sS_2).__y__Pi_2) /* ?{} */);
    153         ((void)((*___dst__R2sS_2).__z__Pi_2) /* ?{} */);
    154     }
    155     inline void ___constructor__F_R2sSiii_autogen___2(struct S *___dst__R2sS_2, signed int __a__i_2, signed int __b__i_2, signed int __c__i_2){
    156         ((void)((*___dst__R2sS_2).__a__i_2=__a__i_2) /* ?{} */);
    157         ((void)((*___dst__R2sS_2).__b__i_2=__b__i_2) /* ?{} */);
    158         ((void)((*___dst__R2sS_2).__c__i_2=__c__i_2) /* ?{} */);
    159         ((void)((*___dst__R2sS_2).__x__Pi_2) /* ?{} */);
    160         ((void)((*___dst__R2sS_2).__y__Pi_2) /* ?{} */);
    161         ((void)((*___dst__R2sS_2).__z__Pi_2) /* ?{} */);
    162     }
    163     inline void ___constructor__F_R2sSiiiPi_autogen___2(struct S *___dst__R2sS_2, signed int __a__i_2, signed int __b__i_2, signed int __c__i_2, signed int *__x__Pi_2){
    164         ((void)((*___dst__R2sS_2).__a__i_2=__a__i_2) /* ?{} */);
    165         ((void)((*___dst__R2sS_2).__b__i_2=__b__i_2) /* ?{} */);
    166         ((void)((*___dst__R2sS_2).__c__i_2=__c__i_2) /* ?{} */);
    167         ((void)((*___dst__R2sS_2).__x__Pi_2=__x__Pi_2) /* ?{} */);
    168         ((void)((*___dst__R2sS_2).__y__Pi_2) /* ?{} */);
    169         ((void)((*___dst__R2sS_2).__z__Pi_2) /* ?{} */);
    170     }
    171     inline void ___constructor__F_R2sSiiiPiPi_autogen___2(struct S *___dst__R2sS_2, signed int __a__i_2, signed int __b__i_2, signed int __c__i_2, signed int *__x__Pi_2, signed int *__y__Pi_2){
    172         ((void)((*___dst__R2sS_2).__a__i_2=__a__i_2) /* ?{} */);
    173         ((void)((*___dst__R2sS_2).__b__i_2=__b__i_2) /* ?{} */);
    174         ((void)((*___dst__R2sS_2).__c__i_2=__c__i_2) /* ?{} */);
    175         ((void)((*___dst__R2sS_2).__x__Pi_2=__x__Pi_2) /* ?{} */);
    176         ((void)((*___dst__R2sS_2).__y__Pi_2=__y__Pi_2) /* ?{} */);
    177         ((void)((*___dst__R2sS_2).__z__Pi_2) /* ?{} */);
    178     }
    179     inline void ___constructor__F_R2sSiiiPiPiPi_autogen___2(struct S *___dst__R2sS_2, signed int __a__i_2, signed int __b__i_2, signed int __c__i_2, signed int *__x__Pi_2, signed int *__y__Pi_2, signed int *__z__Pi_2){
    180         ((void)((*___dst__R2sS_2).__a__i_2=__a__i_2) /* ?{} */);
    181         ((void)((*___dst__R2sS_2).__b__i_2=__b__i_2) /* ?{} */);
    182         ((void)((*___dst__R2sS_2).__c__i_2=__c__i_2) /* ?{} */);
    183         ((void)((*___dst__R2sS_2).__x__Pi_2=__x__Pi_2) /* ?{} */);
    184         ((void)((*___dst__R2sS_2).__y__Pi_2=__y__Pi_2) /* ?{} */);
    185         ((void)((*___dst__R2sS_2).__z__Pi_2=__z__Pi_2) /* ?{} */);
    186     }
    187     signed int __i__i_2 = (__extension__ __a__i_1+__extension__ 3);
     96    signed int __i__i_2 = ((signed int )(__extension__ __a__i_1+__extension__ 3));
    18897    ((void)__extension__ 3);
    18998    ((void)__extension__ __a__i_1);
  • src/tests/.expect/32/gccExtensions.txt

    r3f7e12cb r78315272  
    6363        ((void)((*___dst__R2sS_2).__b__i_2=___src__2sS_2.__b__i_2));
    6464        ((void)((*___dst__R2sS_2).__c__i_2=___src__2sS_2.__c__i_2));
    65         ((void)___constructor__F_R2sS2sS_autogen___2((&___ret__2sS_2), (*___dst__R2sS_2)));
    66         return ___ret__2sS_2;
     65        ((void)___constructor__F_R2sS2sS_autogen___2((&___ret__2sS_2), ___src__2sS_2));
     66        return ((struct S )___ret__2sS_2);
    6767    }
    6868    inline void ___constructor__F_R2sSi_autogen___2(struct S *___dst__R2sS_2, signed int __a__i_2){
     
    8181        ((void)((*___dst__R2sS_2).__c__i_2=__c__i_2) /* ?{} */);
    8282    }
    83     signed int __i__i_2 = __extension__ 3;
     83    signed int __i__i_2 = ((signed int )__extension__ 3);
    8484    __extension__ signed int __a__i_2;
    8585    __extension__ signed int __b__i_2;
     
    113113        struct s2 ___ret__3ss2_2;
    114114        ((void)((*___dst__R3ss2_2).__i__i_2=___src__3ss2_2.__i__i_2));
    115         ((void)___constructor__F_R3ss23ss2_autogen___2((&___ret__3ss2_2), (*___dst__R3ss2_2)));
    116         return ___ret__3ss2_2;
     115        ((void)___constructor__F_R3ss23ss2_autogen___2((&___ret__3ss2_2), ___src__3ss2_2));
     116        return ((struct s2 )___ret__3ss2_2);
    117117    }
    118118    inline void ___constructor__F_R3ss2i_autogen___2(struct s2 *___dst__R3ss2_2, signed int __i__i_2){
     
    134134        struct s3 ___ret__3ss3_2;
    135135        ((void)((*___dst__R3ss3_2).__i__i_2=___src__3ss3_2.__i__i_2));
    136         ((void)___constructor__F_R3ss33ss3_autogen___2((&___ret__3ss3_2), (*___dst__R3ss3_2)));
    137         return ___ret__3ss3_2;
     136        ((void)___constructor__F_R3ss33ss3_autogen___2((&___ret__3ss3_2), ___src__3ss3_2));
     137        return ((struct s3 )___ret__3ss3_2);
    138138    }
    139139    inline void ___constructor__F_R3ss3i_autogen___2(struct s3 *___dst__R3ss3_2, signed int __i__i_2){
     
    157157        struct s4 ___ret__3ss4_2;
    158158        ((void)((*___dst__R3ss4_2).__i__i_2=___src__3ss4_2.__i__i_2));
    159         ((void)___constructor__F_R3ss43ss4_autogen___2((&___ret__3ss4_2), (*___dst__R3ss4_2)));
    160         return ___ret__3ss4_2;
     159        ((void)___constructor__F_R3ss43ss4_autogen___2((&___ret__3ss4_2), ___src__3ss4_2));
     160        return ((struct s4 )___ret__3ss4_2);
    161161    }
    162162    inline void ___constructor__F_R3ss4i_autogen___2(struct s4 *___dst__R3ss4_2, signed int __i__i_2){
     
    169169    signed int __m3__A0A0i_2[((unsigned int )10)][((unsigned int )10)];
    170170    ((void)(___retval_main__i_1=((signed int )0)) /* ?{} */);
    171     return ___retval_main__i_1;
     171    return ((signed int )___retval_main__i_1);
    172172    ((void)(___retval_main__i_1=0) /* ?{} */);
    173     return ___retval_main__i_1;
     173    return ((signed int )___retval_main__i_1);
    174174}
    175175static inline int invoke_main(int argc, char* argv[], char* envp[]) { (void)argc; (void)argv; (void)envp; return __main__Fi_iPPCc__1(argc, argv); }
     
    186186    ((void)(___retval_main__i_1=(((void)(_tmp_cp_ret0=invoke_main(__argc__i_1, __argv__PPc_1, __envp__PPc_1))) , _tmp_cp_ret0)) /* ?{} */);
    187187    ((void)(_tmp_cp_ret0) /* ^?{} */);
    188     return ___retval_main__i_1;
     188    return ((signed int )___retval_main__i_1);
    189189}
  • src/tests/.expect/32/literals.txt

    r3f7e12cb r78315272  
    55__attribute__ ((__nothrow__,__leaf__,__noreturn__)) extern void exit(signed int __status);
    66extern signed int printf(const char *__restrict __format, ...);
    7 void __for_each__A0_2_0_0____operator_assign__PFd0_Rd0d0____constructor__PF_Rd0____constructor__PF_Rd0d0____destructor__PF_Rd0____operator_assign__PFd1_Rd1d1____constructor__PF_Rd1____constructor__PF_Rd1d1____destructor__PF_Rd1____operator_preincr__PFd0_Rd0____operator_predecr__PFd0_Rd0____operator_equal__PFi_d0d0____operator_notequal__PFi_d0d0____operator_deref__PFRd1_d0__F_d0d0PF_d1___1(__attribute__ ((unused)) void (*_adapterF_9telt_type__P)(void (*__anonymous_object0)(), void *__anonymous_object1), __attribute__ ((unused)) void *(*_adapterFP9telt_type_14titerator_type_M_P)(void (*__anonymous_object2)(), void *__anonymous_object3), __attribute__ ((unused)) signed int (*_adapterFi_14titerator_type14titerator_type_M_PP)(void (*__anonymous_object4)(), void *__anonymous_object5, void *__anonymous_object6), __attribute__ ((unused)) void (*_adapterF14titerator_type_P14titerator_type_P_M)(void (*__anonymous_object7)(), __attribute__ ((unused)) void *___retval__operator_preincr__14titerator_type_1, void *__anonymous_object8), __attribute__ ((unused)) void (*_adapterF_P9telt_type9telt_type__MP)(void (*__anonymous_object9)(), void *__anonymous_object10, void *__anonymous_object11), __attribute__ ((unused)) void (*_adapterF9telt_type_P9telt_type9telt_type_P_MP)(void (*__anonymous_object12)(), __attribute__ ((unused)) void *___retval__operator_assign__9telt_type_1, void *__anonymous_object13, void *__anonymous_object14), __attribute__ ((unused)) void (*_adapterF_P14titerator_type14titerator_type__MP)(void (*__anonymous_object15)(), void *__anonymous_object16, void *__anonymous_object17), __attribute__ ((unused)) void (*_adapterF14titerator_type_P14titerator_type14titerator_type_P_MP)(void (*__anonymous_object18)(), __attribute__ ((unused)) void *___retval__operator_assign__14titerator_type_1, void *__anonymous_object19, void *__anonymous_object20), __attribute__ ((unused)) unsigned long int _sizeof_14titerator_type, __attribute__ ((unused)) unsigned long int _alignof_14titerator_type, __attribute__ ((unused)) unsigned long int _sizeof_9telt_type, __attribute__ ((unused)) unsigned long int _alignof_9telt_type, __attribute__ ((unused)) void *(*___operator_assign__PF14titerator_type_R14titerator_type14titerator_type__1)(void *__anonymous_object21, void *__anonymous_object22), __attribute__ ((unused)) void (*___constructor__PF_R14titerator_type__1)(void *__anonymous_object23), __attribute__ ((unused)) void (*___constructor__PF_R14titerator_type14titerator_type__1)(void *__anonymous_object24, void *__anonymous_object25), __attribute__ ((unused)) void (*___destructor__PF_R14titerator_type__1)(void *__anonymous_object26), __attribute__ ((unused)) void *(*___operator_assign__PF9telt_type_R9telt_type9telt_type__1)(void *__anonymous_object27, void *__anonymous_object28), __attribute__ ((unused)) void (*___constructor__PF_R9telt_type__1)(void *__anonymous_object29), __attribute__ ((unused)) void (*___constructor__PF_R9telt_type9telt_type__1)(void *__anonymous_object30, void *__anonymous_object31), __attribute__ ((unused)) void (*___destructor__PF_R9telt_type__1)(void *__anonymous_object32), __attribute__ ((unused)) void *(*___operator_preincr__PF14titerator_type_R14titerator_type__1)(void *__anonymous_object33), __attribute__ ((unused)) void *(*___operator_predecr__PF14titerator_type_R14titerator_type__1)(void *__anonymous_object34), __attribute__ ((unused)) signed int (*___operator_equal__PFi_14titerator_type14titerator_type__1)(void *__anonymous_object35, void *__anonymous_object36), __attribute__ ((unused)) signed int (*___operator_notequal__PFi_14titerator_type14titerator_type__1)(void *__anonymous_object37, void *__anonymous_object38), __attribute__ ((unused)) void *(*___operator_deref__PFR9telt_type_14titerator_type__1)(void *__anonymous_object39), void *__begin__14titerator_type_1, void *__end__14titerator_type_1, void (*__func__PF_9telt_type__1)(void *__anonymous_object40));
    8 void __for_each_reverse__A0_2_0_0____operator_assign__PFd0_Rd0d0____constructor__PF_Rd0____constructor__PF_Rd0d0____destructor__PF_Rd0____operator_assign__PFd1_Rd1d1____constructor__PF_Rd1____constructor__PF_Rd1d1____destructor__PF_Rd1____operator_preincr__PFd0_Rd0____operator_predecr__PFd0_Rd0____operator_equal__PFi_d0d0____operator_notequal__PFi_d0d0____operator_deref__PFRd1_d0__F_d0d0PF_d1___1(__attribute__ ((unused)) void (*_adapterF_9telt_type__P)(void (*__anonymous_object41)(), void *__anonymous_object42), __attribute__ ((unused)) void *(*_adapterFP9telt_type_14titerator_type_M_P)(void (*__anonymous_object43)(), void *__anonymous_object44), __attribute__ ((unused)) signed int (*_adapterFi_14titerator_type14titerator_type_M_PP)(void (*__anonymous_object45)(), void *__anonymous_object46, void *__anonymous_object47), __attribute__ ((unused)) void (*_adapterF14titerator_type_P14titerator_type_P_M)(void (*__anonymous_object48)(), __attribute__ ((unused)) void *___retval__operator_preincr__14titerator_type_1, void *__anonymous_object49), __attribute__ ((unused)) void (*_adapterF_P9telt_type9telt_type__MP)(void (*__anonymous_object50)(), void *__anonymous_object51, void *__anonymous_object52), __attribute__ ((unused)) void (*_adapterF9telt_type_P9telt_type9telt_type_P_MP)(void (*__anonymous_object53)(), __attribute__ ((unused)) void *___retval__operator_assign__9telt_type_1, void *__anonymous_object54, void *__anonymous_object55), __attribute__ ((unused)) void (*_adapterF_P14titerator_type14titerator_type__MP)(void (*__anonymous_object56)(), void *__anonymous_object57, void *__anonymous_object58), __attribute__ ((unused)) void (*_adapterF14titerator_type_P14titerator_type14titerator_type_P_MP)(void (*__anonymous_object59)(), __attribute__ ((unused)) void *___retval__operator_assign__14titerator_type_1, void *__anonymous_object60, void *__anonymous_object61), __attribute__ ((unused)) unsigned long int _sizeof_14titerator_type, __attribute__ ((unused)) unsigned long int _alignof_14titerator_type, __attribute__ ((unused)) unsigned long int _sizeof_9telt_type, __attribute__ ((unused)) unsigned long int _alignof_9telt_type, __attribute__ ((unused)) void *(*___operator_assign__PF14titerator_type_R14titerator_type14titerator_type__1)(void *__anonymous_object62, void *__anonymous_object63), __attribute__ ((unused)) void (*___constructor__PF_R14titerator_type__1)(void *__anonymous_object64), __attribute__ ((unused)) void (*___constructor__PF_R14titerator_type14titerator_type__1)(void *__anonymous_object65, void *__anonymous_object66), __attribute__ ((unused)) void (*___destructor__PF_R14titerator_type__1)(void *__anonymous_object67), __attribute__ ((unused)) void *(*___operator_assign__PF9telt_type_R9telt_type9telt_type__1)(void *__anonymous_object68, void *__anonymous_object69), __attribute__ ((unused)) void (*___constructor__PF_R9telt_type__1)(void *__anonymous_object70), __attribute__ ((unused)) void (*___constructor__PF_R9telt_type9telt_type__1)(void *__anonymous_object71, void *__anonymous_object72), __attribute__ ((unused)) void (*___destructor__PF_R9telt_type__1)(void *__anonymous_object73), __attribute__ ((unused)) void *(*___operator_preincr__PF14titerator_type_R14titerator_type__1)(void *__anonymous_object74), __attribute__ ((unused)) void *(*___operator_predecr__PF14titerator_type_R14titerator_type__1)(void *__anonymous_object75), __attribute__ ((unused)) signed int (*___operator_equal__PFi_14titerator_type14titerator_type__1)(void *__anonymous_object76, void *__anonymous_object77), __attribute__ ((unused)) signed int (*___operator_notequal__PFi_14titerator_type14titerator_type__1)(void *__anonymous_object78, void *__anonymous_object79), __attribute__ ((unused)) void *(*___operator_deref__PFR9telt_type_14titerator_type__1)(void *__anonymous_object80), void *__begin__14titerator_type_1, void *__end__14titerator_type_1, void (*__func__PF_9telt_type__1)(void *__anonymous_object81));
     7void __for_each__A2_0_0_0____operator_assign__PFt0_Rt0t0____constructor__PF_Rt0____constructor__PF_Rt0t0____destructor__PF_Rt0____operator_assign__PFt1_Rt1t1____constructor__PF_Rt1____constructor__PF_Rt1t1____destructor__PF_Rt1____operator_preincr__PFt0_Rt0____operator_predecr__PFt0_Rt0____operator_equal__PFi_t0t0____operator_notequal__PFi_t0t0____operator_deref__PFRt1_t0__F_t0t0PF_t1___1(__attribute__ ((unused)) void (*_adapterF_9telt_type__P)(void (*__anonymous_object0)(), void *__anonymous_object1), __attribute__ ((unused)) void *(*_adapterFP9telt_type_14titerator_type_M_P)(void (*__anonymous_object2)(), void *__anonymous_object3), __attribute__ ((unused)) signed int (*_adapterFi_14titerator_type14titerator_type_M_PP)(void (*__anonymous_object4)(), void *__anonymous_object5, void *__anonymous_object6), __attribute__ ((unused)) void (*_adapterF14titerator_type_P14titerator_type_P_M)(void (*__anonymous_object7)(), __attribute__ ((unused)) void *___retval__operator_preincr__14titerator_type_1, void *__anonymous_object8), __attribute__ ((unused)) void (*_adapterF_P9telt_type9telt_type__MP)(void (*__anonymous_object9)(), void *__anonymous_object10, void *__anonymous_object11), __attribute__ ((unused)) void (*_adapterF9telt_type_P9telt_type9telt_type_P_MP)(void (*__anonymous_object12)(), __attribute__ ((unused)) void *___retval__operator_assign__9telt_type_1, void *__anonymous_object13, void *__anonymous_object14), __attribute__ ((unused)) void (*_adapterF_P14titerator_type14titerator_type__MP)(void (*__anonymous_object15)(), void *__anonymous_object16, void *__anonymous_object17), __attribute__ ((unused)) void (*_adapterF14titerator_type_P14titerator_type14titerator_type_P_MP)(void (*__anonymous_object18)(), __attribute__ ((unused)) void *___retval__operator_assign__14titerator_type_1, void *__anonymous_object19, void *__anonymous_object20), __attribute__ ((unused)) unsigned long int _sizeof_14titerator_type, __attribute__ ((unused)) unsigned long int _alignof_14titerator_type, __attribute__ ((unused)) unsigned long int _sizeof_9telt_type, __attribute__ ((unused)) unsigned long int _alignof_9telt_type, __attribute__ ((unused)) void *(*___operator_assign__PF14titerator_type_R14titerator_type14titerator_type__1)(void *__anonymous_object21, void *__anonymous_object22), __attribute__ ((unused)) void (*___constructor__PF_R14titerator_type__1)(void *__anonymous_object23), __attribute__ ((unused)) void (*___constructor__PF_R14titerator_type14titerator_type__1)(void *__anonymous_object24, void *__anonymous_object25), __attribute__ ((unused)) void (*___destructor__PF_R14titerator_type__1)(void *__anonymous_object26), __attribute__ ((unused)) void *(*___operator_assign__PF9telt_type_R9telt_type9telt_type__1)(void *__anonymous_object27, void *__anonymous_object28), __attribute__ ((unused)) void (*___constructor__PF_R9telt_type__1)(void *__anonymous_object29), __attribute__ ((unused)) void (*___constructor__PF_R9telt_type9telt_type__1)(void *__anonymous_object30, void *__anonymous_object31), __attribute__ ((unused)) void (*___destructor__PF_R9telt_type__1)(void *__anonymous_object32), __attribute__ ((unused)) void *(*___operator_preincr__PF14titerator_type_R14titerator_type__1)(void *__anonymous_object33), __attribute__ ((unused)) void *(*___operator_predecr__PF14titerator_type_R14titerator_type__1)(void *__anonymous_object34), __attribute__ ((unused)) signed int (*___operator_equal__PFi_14titerator_type14titerator_type__1)(void *__anonymous_object35, void *__anonymous_object36), __attribute__ ((unused)) signed int (*___operator_notequal__PFi_14titerator_type14titerator_type__1)(void *__anonymous_object37, void *__anonymous_object38), __attribute__ ((unused)) void *(*___operator_deref__PFR9telt_type_14titerator_type__1)(void *__anonymous_object39), void *__begin__14titerator_type_1, void *__end__14titerator_type_1, void (*__func__PF_9telt_type__1)(void *__anonymous_object40));
     8void __for_each_reverse__A2_0_0_0____operator_assign__PFt0_Rt0t0____constructor__PF_Rt0____constructor__PF_Rt0t0____destructor__PF_Rt0____operator_assign__PFt1_Rt1t1____constructor__PF_Rt1____constructor__PF_Rt1t1____destructor__PF_Rt1____operator_preincr__PFt0_Rt0____operator_predecr__PFt0_Rt0____operator_equal__PFi_t0t0____operator_notequal__PFi_t0t0____operator_deref__PFRt1_t0__F_t0t0PF_t1___1(__attribute__ ((unused)) void (*_adapterF_9telt_type__P)(void (*__anonymous_object41)(), void *__anonymous_object42), __attribute__ ((unused)) void *(*_adapterFP9telt_type_14titerator_type_M_P)(void (*__anonymous_object43)(), void *__anonymous_object44), __attribute__ ((unused)) signed int (*_adapterFi_14titerator_type14titerator_type_M_PP)(void (*__anonymous_object45)(), void *__anonymous_object46, void *__anonymous_object47), __attribute__ ((unused)) void (*_adapterF14titerator_type_P14titerator_type_P_M)(void (*__anonymous_object48)(), __attribute__ ((unused)) void *___retval__operator_preincr__14titerator_type_1, void *__anonymous_object49), __attribute__ ((unused)) void (*_adapterF_P9telt_type9telt_type__MP)(void (*__anonymous_object50)(), void *__anonymous_object51, void *__anonymous_object52), __attribute__ ((unused)) void (*_adapterF9telt_type_P9telt_type9telt_type_P_MP)(void (*__anonymous_object53)(), __attribute__ ((unused)) void *___retval__operator_assign__9telt_type_1, void *__anonymous_object54, void *__anonymous_object55), __attribute__ ((unused)) void (*_adapterF_P14titerator_type14titerator_type__MP)(void (*__anonymous_object56)(), void *__anonymous_object57, void *__anonymous_object58), __attribute__ ((unused)) void (*_adapterF14titerator_type_P14titerator_type14titerator_type_P_MP)(void (*__anonymous_object59)(), __attribute__ ((unused)) void *___retval__operator_assign__14titerator_type_1, void *__anonymous_object60, void *__anonymous_object61), __attribute__ ((unused)) unsigned long int _sizeof_14titerator_type, __attribute__ ((unused)) unsigned long int _alignof_14titerator_type, __attribute__ ((unused)) unsigned long int _sizeof_9telt_type, __attribute__ ((unused)) unsigned long int _alignof_9telt_type, __attribute__ ((unused)) void *(*___operator_assign__PF14titerator_type_R14titerator_type14titerator_type__1)(void *__anonymous_object62, void *__anonymous_object63), __attribute__ ((unused)) void (*___constructor__PF_R14titerator_type__1)(void *__anonymous_object64), __attribute__ ((unused)) void (*___constructor__PF_R14titerator_type14titerator_type__1)(void *__anonymous_object65, void *__anonymous_object66), __attribute__ ((unused)) void (*___destructor__PF_R14titerator_type__1)(void *__anonymous_object67), __attribute__ ((unused)) void *(*___operator_assign__PF9telt_type_R9telt_type9telt_type__1)(void *__anonymous_object68, void *__anonymous_object69), __attribute__ ((unused)) void (*___constructor__PF_R9telt_type__1)(void *__anonymous_object70), __attribute__ ((unused)) void (*___constructor__PF_R9telt_type9telt_type__1)(void *__anonymous_object71, void *__anonymous_object72), __attribute__ ((unused)) void (*___destructor__PF_R9telt_type__1)(void *__anonymous_object73), __attribute__ ((unused)) void *(*___operator_preincr__PF14titerator_type_R14titerator_type__1)(void *__anonymous_object74), __attribute__ ((unused)) void *(*___operator_predecr__PF14titerator_type_R14titerator_type__1)(void *__anonymous_object75), __attribute__ ((unused)) signed int (*___operator_equal__PFi_14titerator_type14titerator_type__1)(void *__anonymous_object76, void *__anonymous_object77), __attribute__ ((unused)) signed int (*___operator_notequal__PFi_14titerator_type14titerator_type__1)(void *__anonymous_object78, void *__anonymous_object79), __attribute__ ((unused)) void *(*___operator_deref__PFR9telt_type_14titerator_type__1)(void *__anonymous_object80), void *__begin__14titerator_type_1, void *__end__14titerator_type_1, void (*__func__PF_9telt_type__1)(void *__anonymous_object81));
    99void *___operator_bitor__A0_1_0_0___sepPrt__PFb_Pd0___sepReset__PF_Pd0___sepReset__PF_Pd0b___sepGetCur__PFPCc_Pd0___sepSetCur__PF_Pd0PCc___getNL__PFb_Pd0___setNL__PF_Pd0b___sepOn__PF_Pd0___sepOff__PF_Pd0___sepDisable__PFb_Pd0___sepEnable__PFb_Pd0___sepGet__PFPCc_Pd0___sepSet__PF_Pd0PCc___sepGetTuple__PFPCc_Pd0___sepSetTuple__PF_Pd0PCc___fail__PFi_Pd0___flush__PFi_Pd0___open__PF_Pd0PCcPCc___close__PF_Pd0___write__PFPd0_Pd0PCcUl___fmt__PFi_Pd0PCc__FPd0_Pd0c__1(__attribute__ ((unused)) _Bool (*__sepPrt__PFb_P7tostype__1)(void *__anonymous_object82), __attribute__ ((unused)) void (*__sepReset__PF_P7tostype__1)(void *__anonymous_object83), __attribute__ ((unused)) void (*__sepReset__PF_P7tostypeb__1)(void *__anonymous_object84, _Bool __anonymous_object85), __attribute__ ((unused)) const char *(*__sepGetCur__PFPCc_P7tostype__1)(void *__anonymous_object86), __attribute__ ((unused)) void (*__sepSetCur__PF_P7tostypePCc__1)(void *__anonymous_object87, const char *__anonymous_object88), __attribute__ ((unused)) _Bool (*__getNL__PFb_P7tostype__1)(void *__anonymous_object89), __attribute__ ((unused)) void (*__setNL__PF_P7tostypeb__1)(void *__anonymous_object90, _Bool __anonymous_object91), __attribute__ ((unused)) void (*__sepOn__PF_P7tostype__1)(void *__anonymous_object92), __attribute__ ((unused)) void (*__sepOff__PF_P7tostype__1)(void *__anonymous_object93), __attribute__ ((unused)) _Bool (*__sepDisable__PFb_P7tostype__1)(void *__anonymous_object94), __attribute__ ((unused)) _Bool (*__sepEnable__PFb_P7tostype__1)(void *__anonymous_object95), __attribute__ ((unused)) const char *(*__sepGet__PFPCc_P7tostype__1)(void *__anonymous_object96), __attribute__ ((unused)) void (*__sepSet__PF_P7tostypePCc__1)(void *__anonymous_object97, const char *__anonymous_object98), __attribute__ ((unused)) const char *(*__sepGetTuple__PFPCc_P7tostype__1)(void *__anonymous_object99), __attribute__ ((unused)) void (*__sepSetTuple__PF_P7tostypePCc__1)(void *__anonymous_object100, const char *__anonymous_object101), __attribute__ ((unused)) signed int (*__fail__PFi_P7tostype__1)(void *__anonymous_object102), __attribute__ ((unused)) signed int (*__flush__PFi_P7tostype__1)(void *__anonymous_object103), __attribute__ ((unused)) void (*__open__PF_P7tostypePCcPCc__1)(void *__os__P7tostype_1, const char *__name__PCc_1, const char *__mode__PCc_1), __attribute__ ((unused)) void (*__close__PF_P7tostype__1)(void *__os__P7tostype_1), __attribute__ ((unused)) void *(*__write__PFP7tostype_P7tostypePCcUl__1)(void *__anonymous_object104, const char *__anonymous_object105, unsigned long int __anonymous_object106), __attribute__ ((unused)) signed int (*__fmt__PFi_P7tostypePCc__1)(void *__anonymous_object107, const char *__fmt__PCc_1, ...), void *__anonymous_object108, char __anonymous_object109);
    1010void *___operator_bitor__A0_1_0_0___sepPrt__PFb_Pd0___sepReset__PF_Pd0___sepReset__PF_Pd0b___sepGetCur__PFPCc_Pd0___sepSetCur__PF_Pd0PCc___getNL__PFb_Pd0___setNL__PF_Pd0b___sepOn__PF_Pd0___sepOff__PF_Pd0___sepDisable__PFb_Pd0___sepEnable__PFb_Pd0___sepGet__PFPCc_Pd0___sepSet__PF_Pd0PCc___sepGetTuple__PFPCc_Pd0___sepSetTuple__PF_Pd0PCc___fail__PFi_Pd0___flush__PFi_Pd0___open__PF_Pd0PCcPCc___close__PF_Pd0___write__PFPd0_Pd0PCcUl___fmt__PFi_Pd0PCc__FPd0_Pd0Sc__1(__attribute__ ((unused)) _Bool (*__sepPrt__PFb_P7tostype__1)(void *__anonymous_object110), __attribute__ ((unused)) void (*__sepReset__PF_P7tostype__1)(void *__anonymous_object111), __attribute__ ((unused)) void (*__sepReset__PF_P7tostypeb__1)(void *__anonymous_object112, _Bool __anonymous_object113), __attribute__ ((unused)) const char *(*__sepGetCur__PFPCc_P7tostype__1)(void *__anonymous_object114), __attribute__ ((unused)) void (*__sepSetCur__PF_P7tostypePCc__1)(void *__anonymous_object115, const char *__anonymous_object116), __attribute__ ((unused)) _Bool (*__getNL__PFb_P7tostype__1)(void *__anonymous_object117), __attribute__ ((unused)) void (*__setNL__PF_P7tostypeb__1)(void *__anonymous_object118, _Bool __anonymous_object119), __attribute__ ((unused)) void (*__sepOn__PF_P7tostype__1)(void *__anonymous_object120), __attribute__ ((unused)) void (*__sepOff__PF_P7tostype__1)(void *__anonymous_object121), __attribute__ ((unused)) _Bool (*__sepDisable__PFb_P7tostype__1)(void *__anonymous_object122), __attribute__ ((unused)) _Bool (*__sepEnable__PFb_P7tostype__1)(void *__anonymous_object123), __attribute__ ((unused)) const char *(*__sepGet__PFPCc_P7tostype__1)(void *__anonymous_object124), __attribute__ ((unused)) void (*__sepSet__PF_P7tostypePCc__1)(void *__anonymous_object125, const char *__anonymous_object126), __attribute__ ((unused)) const char *(*__sepGetTuple__PFPCc_P7tostype__1)(void *__anonymous_object127), __attribute__ ((unused)) void (*__sepSetTuple__PF_P7tostypePCc__1)(void *__anonymous_object128, const char *__anonymous_object129), __attribute__ ((unused)) signed int (*__fail__PFi_P7tostype__1)(void *__anonymous_object130), __attribute__ ((unused)) signed int (*__flush__PFi_P7tostype__1)(void *__anonymous_object131), __attribute__ ((unused)) void (*__open__PF_P7tostypePCcPCc__1)(void *__os__P7tostype_1, const char *__name__PCc_1, const char *__mode__PCc_1), __attribute__ ((unused)) void (*__close__PF_P7tostype__1)(void *__os__P7tostype_1), __attribute__ ((unused)) void *(*__write__PFP7tostype_P7tostypePCcUl__1)(void *__anonymous_object132, const char *__anonymous_object133, unsigned long int __anonymous_object134), __attribute__ ((unused)) signed int (*__fmt__PFi_P7tostypePCc__1)(void *__anonymous_object135, const char *__fmt__PCc_1, ...), void *__anonymous_object136, signed char __anonymous_object137);
     
    2929void *___operator_bitor__A0_1_0_0___sepPrt__PFb_Pd0___sepReset__PF_Pd0___sepReset__PF_Pd0b___sepGetCur__PFPCc_Pd0___sepSetCur__PF_Pd0PCc___getNL__PFb_Pd0___setNL__PF_Pd0b___sepOn__PF_Pd0___sepOff__PF_Pd0___sepDisable__PFb_Pd0___sepEnable__PFb_Pd0___sepGet__PFPCc_Pd0___sepSet__PF_Pd0PCc___sepGetTuple__PFPCc_Pd0___sepSetTuple__PF_Pd0PCc___fail__PFi_Pd0___flush__PFi_Pd0___open__PF_Pd0PCcPCc___close__PF_Pd0___write__PFPd0_Pd0PCcUl___fmt__PFi_Pd0PCc__FPd0_Pd0PCl__1(__attribute__ ((unused)) _Bool (*__sepPrt__PFb_P7tostype__1)(void *__anonymous_object642), __attribute__ ((unused)) void (*__sepReset__PF_P7tostype__1)(void *__anonymous_object643), __attribute__ ((unused)) void (*__sepReset__PF_P7tostypeb__1)(void *__anonymous_object644, _Bool __anonymous_object645), __attribute__ ((unused)) const char *(*__sepGetCur__PFPCc_P7tostype__1)(void *__anonymous_object646), __attribute__ ((unused)) void (*__sepSetCur__PF_P7tostypePCc__1)(void *__anonymous_object647, const char *__anonymous_object648), __attribute__ ((unused)) _Bool (*__getNL__PFb_P7tostype__1)(void *__anonymous_object649), __attribute__ ((unused)) void (*__setNL__PF_P7tostypeb__1)(void *__anonymous_object650, _Bool __anonymous_object651), __attribute__ ((unused)) void (*__sepOn__PF_P7tostype__1)(void *__anonymous_object652), __attribute__ ((unused)) void (*__sepOff__PF_P7tostype__1)(void *__anonymous_object653), __attribute__ ((unused)) _Bool (*__sepDisable__PFb_P7tostype__1)(void *__anonymous_object654), __attribute__ ((unused)) _Bool (*__sepEnable__PFb_P7tostype__1)(void *__anonymous_object655), __attribute__ ((unused)) const char *(*__sepGet__PFPCc_P7tostype__1)(void *__anonymous_object656), __attribute__ ((unused)) void (*__sepSet__PF_P7tostypePCc__1)(void *__anonymous_object657, const char *__anonymous_object658), __attribute__ ((unused)) const char *(*__sepGetTuple__PFPCc_P7tostype__1)(void *__anonymous_object659), __attribute__ ((unused)) void (*__sepSetTuple__PF_P7tostypePCc__1)(void *__anonymous_object660, const char *__anonymous_object661), __attribute__ ((unused)) signed int (*__fail__PFi_P7tostype__1)(void *__anonymous_object662), __attribute__ ((unused)) signed int (*__flush__PFi_P7tostype__1)(void *__anonymous_object663), __attribute__ ((unused)) void (*__open__PF_P7tostypePCcPCc__1)(void *__os__P7tostype_1, const char *__name__PCc_1, const char *__mode__PCc_1), __attribute__ ((unused)) void (*__close__PF_P7tostype__1)(void *__os__P7tostype_1), __attribute__ ((unused)) void *(*__write__PFP7tostype_P7tostypePCcUl__1)(void *__anonymous_object664, const char *__anonymous_object665, unsigned long int __anonymous_object666), __attribute__ ((unused)) signed int (*__fmt__PFi_P7tostypePCc__1)(void *__anonymous_object667, const char *__fmt__PCc_1, ...), void *__anonymous_object668, const signed long int *__anonymous_object669);
    3030void *___operator_bitor__A0_1_0_0___sepPrt__PFb_Pd0___sepReset__PF_Pd0___sepReset__PF_Pd0b___sepGetCur__PFPCc_Pd0___sepSetCur__PF_Pd0PCc___getNL__PFb_Pd0___setNL__PF_Pd0b___sepOn__PF_Pd0___sepOff__PF_Pd0___sepDisable__PFb_Pd0___sepEnable__PFb_Pd0___sepGet__PFPCc_Pd0___sepSet__PF_Pd0PCc___sepGetTuple__PFPCc_Pd0___sepSetTuple__PF_Pd0PCc___fail__PFi_Pd0___flush__PFi_Pd0___open__PF_Pd0PCcPCc___close__PF_Pd0___write__PFPd0_Pd0PCcUl___fmt__PFi_Pd0PCc__FPd0_Pd0PCv__1(__attribute__ ((unused)) _Bool (*__sepPrt__PFb_P7tostype__1)(void *__anonymous_object670), __attribute__ ((unused)) void (*__sepReset__PF_P7tostype__1)(void *__anonymous_object671), __attribute__ ((unused)) void (*__sepReset__PF_P7tostypeb__1)(void *__anonymous_object672, _Bool __anonymous_object673), __attribute__ ((unused)) const char *(*__sepGetCur__PFPCc_P7tostype__1)(void *__anonymous_object674), __attribute__ ((unused)) void (*__sepSetCur__PF_P7tostypePCc__1)(void *__anonymous_object675, const char *__anonymous_object676), __attribute__ ((unused)) _Bool (*__getNL__PFb_P7tostype__1)(void *__anonymous_object677), __attribute__ ((unused)) void (*__setNL__PF_P7tostypeb__1)(void *__anonymous_object678, _Bool __anonymous_object679), __attribute__ ((unused)) void (*__sepOn__PF_P7tostype__1)(void *__anonymous_object680), __attribute__ ((unused)) void (*__sepOff__PF_P7tostype__1)(void *__anonymous_object681), __attribute__ ((unused)) _Bool (*__sepDisable__PFb_P7tostype__1)(void *__anonymous_object682), __attribute__ ((unused)) _Bool (*__sepEnable__PFb_P7tostype__1)(void *__anonymous_object683), __attribute__ ((unused)) const char *(*__sepGet__PFPCc_P7tostype__1)(void *__anonymous_object684), __attribute__ ((unused)) void (*__sepSet__PF_P7tostypePCc__1)(void *__anonymous_object685, const char *__anonymous_object686), __attribute__ ((unused)) const char *(*__sepGetTuple__PFPCc_P7tostype__1)(void *__anonymous_object687), __attribute__ ((unused)) void (*__sepSetTuple__PF_P7tostypePCc__1)(void *__anonymous_object688, const char *__anonymous_object689), __attribute__ ((unused)) signed int (*__fail__PFi_P7tostype__1)(void *__anonymous_object690), __attribute__ ((unused)) signed int (*__flush__PFi_P7tostype__1)(void *__anonymous_object691), __attribute__ ((unused)) void (*__open__PF_P7tostypePCcPCc__1)(void *__os__P7tostype_1, const char *__name__PCc_1, const char *__mode__PCc_1), __attribute__ ((unused)) void (*__close__PF_P7tostype__1)(void *__os__P7tostype_1), __attribute__ ((unused)) void *(*__write__PFP7tostype_P7tostypePCcUl__1)(void *__anonymous_object692, const char *__anonymous_object693, unsigned long int __anonymous_object694), __attribute__ ((unused)) signed int (*__fmt__PFi_P7tostypePCc__1)(void *__anonymous_object695, const char *__fmt__PCc_1, ...), void *__anonymous_object696, const void *__anonymous_object697);
    31 void *___operator_bitor__A0_2_0_1____operator_assign__PFd1_Rd1d1____constructor__PF_Rd1____constructor__PF_Rd1d1____destructor__PF_Rd1____operator_bitor__PFPd0_Pd0d1___sepPrt__PFb_Pd0___sepReset__PF_Pd0___sepReset__PF_Pd0b___sepGetCur__PFPCc_Pd0___sepSetCur__PF_Pd0PCc___getNL__PFb_Pd0___setNL__PF_Pd0b___sepOn__PF_Pd0___sepOff__PF_Pd0___sepDisable__PFb_Pd0___sepEnable__PFb_Pd0___sepGet__PFPCc_Pd0___sepSet__PF_Pd0PCc___sepGetTuple__PFPCc_Pd0___sepSetTuple__PF_Pd0PCc___fail__PFi_Pd0___flush__PFi_Pd0___open__PF_Pd0PCcPCc___close__PF_Pd0___write__PFPd0_Pd0PCcUl___fmt__PFi_Pd0PCc____operator_bitor__PFPd0_Pd0tVARGS2__FPd0_Pd0d1tVARGS2__1(__attribute__ ((unused)) void *(*_adapterFP7tostype_P7tostype7tParams_M_MP)(void (*__anonymous_object698)(), void *__anonymous_object699, void *__anonymous_object700), __attribute__ ((unused)) void *(*_adapterFP7tostype_P7tostype2tT_M_MP)(void (*__anonymous_object701)(), void *__anonymous_object702, void *__anonymous_object703), __attribute__ ((unused)) void (*_adapterF_P2tT2tT__MP)(void (*__anonymous_object704)(), void *__anonymous_object705, void *__anonymous_object706), __attribute__ ((unused)) void (*_adapterF2tT_P2tT2tT_P_MP)(void (*__anonymous_object707)(), __attribute__ ((unused)) void *___retval__operator_assign__2tT_1, void *__anonymous_object708, void *__anonymous_object709), __attribute__ ((unused)) unsigned long int _sizeof_2tT, __attribute__ ((unused)) unsigned long int _alignof_2tT, __attribute__ ((unused)) unsigned long int _sizeof_7tParams, __attribute__ ((unused)) unsigned long int _alignof_7tParams, __attribute__ ((unused)) void *(*___operator_assign__PF2tT_R2tT2tT__1)(void *__anonymous_object710, void *__anonymous_object711), __attribute__ ((unused)) void (*___constructor__PF_R2tT__1)(void *__anonymous_object712), __attribute__ ((unused)) void (*___constructor__PF_R2tT2tT__1)(void *__anonymous_object713, void *__anonymous_object714), __attribute__ ((unused)) void (*___destructor__PF_R2tT__1)(void *__anonymous_object715), __attribute__ ((unused)) void *(*___operator_bitor__PFP7tostype_P7tostype2tT__1)(void *__anonymous_object716, void *__anonymous_object717), __attribute__ ((unused)) _Bool (*__sepPrt__PFb_P7tostype__1)(void *__anonymous_object718), __attribute__ ((unused)) void (*__sepReset__PF_P7tostype__1)(void *__anonymous_object719), __attribute__ ((unused)) void (*__sepReset__PF_P7tostypeb__1)(void *__anonymous_object720, _Bool __anonymous_object721), __attribute__ ((unused)) const char *(*__sepGetCur__PFPCc_P7tostype__1)(void *__anonymous_object722), __attribute__ ((unused)) void (*__sepSetCur__PF_P7tostypePCc__1)(void *__anonymous_object723, const char *__anonymous_object724), __attribute__ ((unused)) _Bool (*__getNL__PFb_P7tostype__1)(void *__anonymous_object725), __attribute__ ((unused)) void (*__setNL__PF_P7tostypeb__1)(void *__anonymous_object726, _Bool __anonymous_object727), __attribute__ ((unused)) void (*__sepOn__PF_P7tostype__1)(void *__anonymous_object728), __attribute__ ((unused)) void (*__sepOff__PF_P7tostype__1)(void *__anonymous_object729), __attribute__ ((unused)) _Bool (*__sepDisable__PFb_P7tostype__1)(void *__anonymous_object730), __attribute__ ((unused)) _Bool (*__sepEnable__PFb_P7tostype__1)(void *__anonymous_object731), __attribute__ ((unused)) const char *(*__sepGet__PFPCc_P7tostype__1)(void *__anonymous_object732), __attribute__ ((unused)) void (*__sepSet__PF_P7tostypePCc__1)(void *__anonymous_object733, const char *__anonymous_object734), __attribute__ ((unused)) const char *(*__sepGetTuple__PFPCc_P7tostype__1)(void *__anonymous_object735), __attribute__ ((unused)) void (*__sepSetTuple__PF_P7tostypePCc__1)(void *__anonymous_object736, const char *__anonymous_object737), __attribute__ ((unused)) signed int (*__fail__PFi_P7tostype__1)(void *__anonymous_object738), __attribute__ ((unused)) signed int (*__flush__PFi_P7tostype__1)(void *__anonymous_object739), __attribute__ ((unused)) void (*__open__PF_P7tostypePCcPCc__1)(void *__os__P7tostype_1, const char *__name__PCc_1, const char *__mode__PCc_1), __attribute__ ((unused)) void (*__close__PF_P7tostype__1)(void *__os__P7tostype_1), __attribute__ ((unused)) void *(*__write__PFP7tostype_P7tostypePCcUl__1)(void *__anonymous_object740, const char *__anonymous_object741, unsigned long int __anonymous_object742), __attribute__ ((unused)) signed int (*__fmt__PFi_P7tostypePCc__1)(void *__anonymous_object743, const char *__fmt__PCc_1, ...), __attribute__ ((unused)) void *(*___operator_bitor__PFP7tostype_P7tostype7tParams__1)(void *__anonymous_object744, void *__anonymous_object745), void *__os__P7tostype_1, void *__arg__2tT_1, void *__rest__7tParams_1);
     31void *___operator_bitor__A1_1_0_1____operator_assign__PFt1_Rt1t1____constructor__PF_Rt1____constructor__PF_Rt1t1____destructor__PF_Rt1____operator_bitor__PFPd0_Pd0t1___sepPrt__PFb_Pd0___sepReset__PF_Pd0___sepReset__PF_Pd0b___sepGetCur__PFPCc_Pd0___sepSetCur__PF_Pd0PCc___getNL__PFb_Pd0___setNL__PF_Pd0b___sepOn__PF_Pd0___sepOff__PF_Pd0___sepDisable__PFb_Pd0___sepEnable__PFb_Pd0___sepGet__PFPCc_Pd0___sepSet__PF_Pd0PCc___sepGetTuple__PFPCc_Pd0___sepSetTuple__PF_Pd0PCc___fail__PFi_Pd0___flush__PFi_Pd0___open__PF_Pd0PCcPCc___close__PF_Pd0___write__PFPd0_Pd0PCcUl___fmt__PFi_Pd0PCc____operator_bitor__PFPd0_Pd0tVARGS2__FPd0_Pd0t1tVARGS2__1(__attribute__ ((unused)) void *(*_adapterFP7tostype_P7tostype7tParams_M_MP)(void (*__anonymous_object698)(), void *__anonymous_object699, void *__anonymous_object700), __attribute__ ((unused)) void *(*_adapterFP7tostype_P7tostype2tT_M_MP)(void (*__anonymous_object701)(), void *__anonymous_object702, void *__anonymous_object703), __attribute__ ((unused)) void (*_adapterF_P2tT2tT__MP)(void (*__anonymous_object704)(), void *__anonymous_object705, void *__anonymous_object706), __attribute__ ((unused)) void (*_adapterF2tT_P2tT2tT_P_MP)(void (*__anonymous_object707)(), __attribute__ ((unused)) void *___retval__operator_assign__2tT_1, void *__anonymous_object708, void *__anonymous_object709), __attribute__ ((unused)) unsigned long int _sizeof_2tT, __attribute__ ((unused)) unsigned long int _alignof_2tT, __attribute__ ((unused)) unsigned long int _sizeof_7tParams, __attribute__ ((unused)) unsigned long int _alignof_7tParams, __attribute__ ((unused)) void *(*___operator_assign__PF2tT_R2tT2tT__1)(void *__anonymous_object710, void *__anonymous_object711), __attribute__ ((unused)) void (*___constructor__PF_R2tT__1)(void *__anonymous_object712), __attribute__ ((unused)) void (*___constructor__PF_R2tT2tT__1)(void *__anonymous_object713, void *__anonymous_object714), __attribute__ ((unused)) void (*___destructor__PF_R2tT__1)(void *__anonymous_object715), __attribute__ ((unused)) void *(*___operator_bitor__PFP7tostype_P7tostype2tT__1)(void *__anonymous_object716, void *__anonymous_object717), __attribute__ ((unused)) _Bool (*__sepPrt__PFb_P7tostype__1)(void *__anonymous_object718), __attribute__ ((unused)) void (*__sepReset__PF_P7tostype__1)(void *__anonymous_object719), __attribute__ ((unused)) void (*__sepReset__PF_P7tostypeb__1)(void *__anonymous_object720, _Bool __anonymous_object721), __attribute__ ((unused)) const char *(*__sepGetCur__PFPCc_P7tostype__1)(void *__anonymous_object722), __attribute__ ((unused)) void (*__sepSetCur__PF_P7tostypePCc__1)(void *__anonymous_object723, const char *__anonymous_object724), __attribute__ ((unused)) _Bool (*__getNL__PFb_P7tostype__1)(void *__anonymous_object725), __attribute__ ((unused)) void (*__setNL__PF_P7tostypeb__1)(void *__anonymous_object726, _Bool __anonymous_object727), __attribute__ ((unused)) void (*__sepOn__PF_P7tostype__1)(void *__anonymous_object728), __attribute__ ((unused)) void (*__sepOff__PF_P7tostype__1)(void *__anonymous_object729), __attribute__ ((unused)) _Bool (*__sepDisable__PFb_P7tostype__1)(void *__anonymous_object730), __attribute__ ((unused)) _Bool (*__sepEnable__PFb_P7tostype__1)(void *__anonymous_object731), __attribute__ ((unused)) const char *(*__sepGet__PFPCc_P7tostype__1)(void *__anonymous_object732), __attribute__ ((unused)) void (*__sepSet__PF_P7tostypePCc__1)(void *__anonymous_object733, const char *__anonymous_object734), __attribute__ ((unused)) const char *(*__sepGetTuple__PFPCc_P7tostype__1)(void *__anonymous_object735), __attribute__ ((unused)) void (*__sepSetTuple__PF_P7tostypePCc__1)(void *__anonymous_object736, const char *__anonymous_object737), __attribute__ ((unused)) signed int (*__fail__PFi_P7tostype__1)(void *__anonymous_object738), __attribute__ ((unused)) signed int (*__flush__PFi_P7tostype__1)(void *__anonymous_object739), __attribute__ ((unused)) void (*__open__PF_P7tostypePCcPCc__1)(void *__os__P7tostype_1, const char *__name__PCc_1, const char *__mode__PCc_1), __attribute__ ((unused)) void (*__close__PF_P7tostype__1)(void *__os__P7tostype_1), __attribute__ ((unused)) void *(*__write__PFP7tostype_P7tostypePCcUl__1)(void *__anonymous_object740, const char *__anonymous_object741, unsigned long int __anonymous_object742), __attribute__ ((unused)) signed int (*__fmt__PFi_P7tostypePCc__1)(void *__anonymous_object743, const char *__fmt__PCc_1, ...), __attribute__ ((unused)) void *(*___operator_bitor__PFP7tostype_P7tostype7tParams__1)(void *__anonymous_object744, void *__anonymous_object745), void *__os__P7tostype_1, void *__arg__2tT_1, void *__rest__7tParams_1);
    3232void *___operator_bitor__A0_1_0_0___sepPrt__PFb_Pd0___sepReset__PF_Pd0___sepReset__PF_Pd0b___sepGetCur__PFPCc_Pd0___sepSetCur__PF_Pd0PCc___getNL__PFb_Pd0___setNL__PF_Pd0b___sepOn__PF_Pd0___sepOff__PF_Pd0___sepDisable__PFb_Pd0___sepEnable__PFb_Pd0___sepGet__PFPCc_Pd0___sepSet__PF_Pd0PCc___sepGetTuple__PFPCc_Pd0___sepSetTuple__PF_Pd0PCc___fail__PFi_Pd0___flush__PFi_Pd0___open__PF_Pd0PCcPCc___close__PF_Pd0___write__PFPd0_Pd0PCcUl___fmt__PFi_Pd0PCc__FPd0_Pd0PFPd0_Pd0___1(__attribute__ ((unused)) _Bool (*__sepPrt__PFb_P7tostype__1)(void *__anonymous_object746), __attribute__ ((unused)) void (*__sepReset__PF_P7tostype__1)(void *__anonymous_object747), __attribute__ ((unused)) void (*__sepReset__PF_P7tostypeb__1)(void *__anonymous_object748, _Bool __anonymous_object749), __attribute__ ((unused)) const char *(*__sepGetCur__PFPCc_P7tostype__1)(void *__anonymous_object750), __attribute__ ((unused)) void (*__sepSetCur__PF_P7tostypePCc__1)(void *__anonymous_object751, const char *__anonymous_object752), __attribute__ ((unused)) _Bool (*__getNL__PFb_P7tostype__1)(void *__anonymous_object753), __attribute__ ((unused)) void (*__setNL__PF_P7tostypeb__1)(void *__anonymous_object754, _Bool __anonymous_object755), __attribute__ ((unused)) void (*__sepOn__PF_P7tostype__1)(void *__anonymous_object756), __attribute__ ((unused)) void (*__sepOff__PF_P7tostype__1)(void *__anonymous_object757), __attribute__ ((unused)) _Bool (*__sepDisable__PFb_P7tostype__1)(void *__anonymous_object758), __attribute__ ((unused)) _Bool (*__sepEnable__PFb_P7tostype__1)(void *__anonymous_object759), __attribute__ ((unused)) const char *(*__sepGet__PFPCc_P7tostype__1)(void *__anonymous_object760), __attribute__ ((unused)) void (*__sepSet__PF_P7tostypePCc__1)(void *__anonymous_object761, const char *__anonymous_object762), __attribute__ ((unused)) const char *(*__sepGetTuple__PFPCc_P7tostype__1)(void *__anonymous_object763), __attribute__ ((unused)) void (*__sepSetTuple__PF_P7tostypePCc__1)(void *__anonymous_object764, const char *__anonymous_object765), __attribute__ ((unused)) signed int (*__fail__PFi_P7tostype__1)(void *__anonymous_object766), __attribute__ ((unused)) signed int (*__flush__PFi_P7tostype__1)(void *__anonymous_object767), __attribute__ ((unused)) void (*__open__PF_P7tostypePCcPCc__1)(void *__os__P7tostype_1, const char *__name__PCc_1, const char *__mode__PCc_1), __attribute__ ((unused)) void (*__close__PF_P7tostype__1)(void *__os__P7tostype_1), __attribute__ ((unused)) void *(*__write__PFP7tostype_P7tostypePCcUl__1)(void *__anonymous_object768, const char *__anonymous_object769, unsigned long int __anonymous_object770), __attribute__ ((unused)) signed int (*__fmt__PFi_P7tostypePCc__1)(void *__anonymous_object771, const char *__fmt__PCc_1, ...), void *__anonymous_object772, void *(*__anonymous_object773)(void *__anonymous_object774));
    3333void *__endl__A0_1_0_0___sepPrt__PFb_Pd0___sepReset__PF_Pd0___sepReset__PF_Pd0b___sepGetCur__PFPCc_Pd0___sepSetCur__PF_Pd0PCc___getNL__PFb_Pd0___setNL__PF_Pd0b___sepOn__PF_Pd0___sepOff__PF_Pd0___sepDisable__PFb_Pd0___sepEnable__PFb_Pd0___sepGet__PFPCc_Pd0___sepSet__PF_Pd0PCc___sepGetTuple__PFPCc_Pd0___sepSetTuple__PF_Pd0PCc___fail__PFi_Pd0___flush__PFi_Pd0___open__PF_Pd0PCcPCc___close__PF_Pd0___write__PFPd0_Pd0PCcUl___fmt__PFi_Pd0PCc__FPd0_Pd0__1(__attribute__ ((unused)) _Bool (*__sepPrt__PFb_P7tostype__1)(void *__anonymous_object775), __attribute__ ((unused)) void (*__sepReset__PF_P7tostype__1)(void *__anonymous_object776), __attribute__ ((unused)) void (*__sepReset__PF_P7tostypeb__1)(void *__anonymous_object777, _Bool __anonymous_object778), __attribute__ ((unused)) const char *(*__sepGetCur__PFPCc_P7tostype__1)(void *__anonymous_object779), __attribute__ ((unused)) void (*__sepSetCur__PF_P7tostypePCc__1)(void *__anonymous_object780, const char *__anonymous_object781), __attribute__ ((unused)) _Bool (*__getNL__PFb_P7tostype__1)(void *__anonymous_object782), __attribute__ ((unused)) void (*__setNL__PF_P7tostypeb__1)(void *__anonymous_object783, _Bool __anonymous_object784), __attribute__ ((unused)) void (*__sepOn__PF_P7tostype__1)(void *__anonymous_object785), __attribute__ ((unused)) void (*__sepOff__PF_P7tostype__1)(void *__anonymous_object786), __attribute__ ((unused)) _Bool (*__sepDisable__PFb_P7tostype__1)(void *__anonymous_object787), __attribute__ ((unused)) _Bool (*__sepEnable__PFb_P7tostype__1)(void *__anonymous_object788), __attribute__ ((unused)) const char *(*__sepGet__PFPCc_P7tostype__1)(void *__anonymous_object789), __attribute__ ((unused)) void (*__sepSet__PF_P7tostypePCc__1)(void *__anonymous_object790, const char *__anonymous_object791), __attribute__ ((unused)) const char *(*__sepGetTuple__PFPCc_P7tostype__1)(void *__anonymous_object792), __attribute__ ((unused)) void (*__sepSetTuple__PF_P7tostypePCc__1)(void *__anonymous_object793, const char *__anonymous_object794), __attribute__ ((unused)) signed int (*__fail__PFi_P7tostype__1)(void *__anonymous_object795), __attribute__ ((unused)) signed int (*__flush__PFi_P7tostype__1)(void *__anonymous_object796), __attribute__ ((unused)) void (*__open__PF_P7tostypePCcPCc__1)(void *__os__P7tostype_1, const char *__name__PCc_1, const char *__mode__PCc_1), __attribute__ ((unused)) void (*__close__PF_P7tostype__1)(void *__os__P7tostype_1), __attribute__ ((unused)) void *(*__write__PFP7tostype_P7tostypePCcUl__1)(void *__anonymous_object797, const char *__anonymous_object798, unsigned long int __anonymous_object799), __attribute__ ((unused)) signed int (*__fmt__PFi_P7tostypePCc__1)(void *__anonymous_object800, const char *__fmt__PCc_1, ...), void *__anonymous_object801);
     
    3838void *__sepDisable__A0_1_0_0___sepPrt__PFb_Pd0___sepReset__PF_Pd0___sepReset__PF_Pd0b___sepGetCur__PFPCc_Pd0___sepSetCur__PF_Pd0PCc___getNL__PFb_Pd0___setNL__PF_Pd0b___sepOn__PF_Pd0___sepOff__PF_Pd0___sepDisable__PFb_Pd0___sepEnable__PFb_Pd0___sepGet__PFPCc_Pd0___sepSet__PF_Pd0PCc___sepGetTuple__PFPCc_Pd0___sepSetTuple__PF_Pd0PCc___fail__PFi_Pd0___flush__PFi_Pd0___open__PF_Pd0PCcPCc___close__PF_Pd0___write__PFPd0_Pd0PCcUl___fmt__PFi_Pd0PCc__FPd0_Pd0__1(__attribute__ ((unused)) _Bool (*__sepPrt__PFb_P7tostype__1)(void *__anonymous_object910), __attribute__ ((unused)) void (*__sepReset__PF_P7tostype__1)(void *__anonymous_object911), __attribute__ ((unused)) void (*__sepReset__PF_P7tostypeb__1)(void *__anonymous_object912, _Bool __anonymous_object913), __attribute__ ((unused)) const char *(*__sepGetCur__PFPCc_P7tostype__1)(void *__anonymous_object914), __attribute__ ((unused)) void (*__sepSetCur__PF_P7tostypePCc__1)(void *__anonymous_object915, const char *__anonymous_object916), __attribute__ ((unused)) _Bool (*__getNL__PFb_P7tostype__1)(void *__anonymous_object917), __attribute__ ((unused)) void (*__setNL__PF_P7tostypeb__1)(void *__anonymous_object918, _Bool __anonymous_object919), __attribute__ ((unused)) void (*__sepOn__PF_P7tostype__1)(void *__anonymous_object920), __attribute__ ((unused)) void (*__sepOff__PF_P7tostype__1)(void *__anonymous_object921), __attribute__ ((unused)) _Bool (*__sepDisable__PFb_P7tostype__1)(void *__anonymous_object922), __attribute__ ((unused)) _Bool (*__sepEnable__PFb_P7tostype__1)(void *__anonymous_object923), __attribute__ ((unused)) const char *(*__sepGet__PFPCc_P7tostype__1)(void *__anonymous_object924), __attribute__ ((unused)) void (*__sepSet__PF_P7tostypePCc__1)(void *__anonymous_object925, const char *__anonymous_object926), __attribute__ ((unused)) const char *(*__sepGetTuple__PFPCc_P7tostype__1)(void *__anonymous_object927), __attribute__ ((unused)) void (*__sepSetTuple__PF_P7tostypePCc__1)(void *__anonymous_object928, const char *__anonymous_object929), __attribute__ ((unused)) signed int (*__fail__PFi_P7tostype__1)(void *__anonymous_object930), __attribute__ ((unused)) signed int (*__flush__PFi_P7tostype__1)(void *__anonymous_object931), __attribute__ ((unused)) void (*__open__PF_P7tostypePCcPCc__1)(void *__os__P7tostype_1, const char *__name__PCc_1, const char *__mode__PCc_1), __attribute__ ((unused)) void (*__close__PF_P7tostype__1)(void *__os__P7tostype_1), __attribute__ ((unused)) void *(*__write__PFP7tostype_P7tostypePCcUl__1)(void *__anonymous_object932, const char *__anonymous_object933, unsigned long int __anonymous_object934), __attribute__ ((unused)) signed int (*__fmt__PFi_P7tostypePCc__1)(void *__anonymous_object935, const char *__fmt__PCc_1, ...), void *__anonymous_object936);
    3939void *__sepEnable__A0_1_0_0___sepPrt__PFb_Pd0___sepReset__PF_Pd0___sepReset__PF_Pd0b___sepGetCur__PFPCc_Pd0___sepSetCur__PF_Pd0PCc___getNL__PFb_Pd0___setNL__PF_Pd0b___sepOn__PF_Pd0___sepOff__PF_Pd0___sepDisable__PFb_Pd0___sepEnable__PFb_Pd0___sepGet__PFPCc_Pd0___sepSet__PF_Pd0PCc___sepGetTuple__PFPCc_Pd0___sepSetTuple__PF_Pd0PCc___fail__PFi_Pd0___flush__PFi_Pd0___open__PF_Pd0PCcPCc___close__PF_Pd0___write__PFPd0_Pd0PCcUl___fmt__PFi_Pd0PCc__FPd0_Pd0__1(__attribute__ ((unused)) _Bool (*__sepPrt__PFb_P7tostype__1)(void *__anonymous_object937), __attribute__ ((unused)) void (*__sepReset__PF_P7tostype__1)(void *__anonymous_object938), __attribute__ ((unused)) void (*__sepReset__PF_P7tostypeb__1)(void *__anonymous_object939, _Bool __anonymous_object940), __attribute__ ((unused)) const char *(*__sepGetCur__PFPCc_P7tostype__1)(void *__anonymous_object941), __attribute__ ((unused)) void (*__sepSetCur__PF_P7tostypePCc__1)(void *__anonymous_object942, const char *__anonymous_object943), __attribute__ ((unused)) _Bool (*__getNL__PFb_P7tostype__1)(void *__anonymous_object944), __attribute__ ((unused)) void (*__setNL__PF_P7tostypeb__1)(void *__anonymous_object945, _Bool __anonymous_object946), __attribute__ ((unused)) void (*__sepOn__PF_P7tostype__1)(void *__anonymous_object947), __attribute__ ((unused)) void (*__sepOff__PF_P7tostype__1)(void *__anonymous_object948), __attribute__ ((unused)) _Bool (*__sepDisable__PFb_P7tostype__1)(void *__anonymous_object949), __attribute__ ((unused)) _Bool (*__sepEnable__PFb_P7tostype__1)(void *__anonymous_object950), __attribute__ ((unused)) const char *(*__sepGet__PFPCc_P7tostype__1)(void *__anonymous_object951), __attribute__ ((unused)) void (*__sepSet__PF_P7tostypePCc__1)(void *__anonymous_object952, const char *__anonymous_object953), __attribute__ ((unused)) const char *(*__sepGetTuple__PFPCc_P7tostype__1)(void *__anonymous_object954), __attribute__ ((unused)) void (*__sepSetTuple__PF_P7tostypePCc__1)(void *__anonymous_object955, const char *__anonymous_object956), __attribute__ ((unused)) signed int (*__fail__PFi_P7tostype__1)(void *__anonymous_object957), __attribute__ ((unused)) signed int (*__flush__PFi_P7tostype__1)(void *__anonymous_object958), __attribute__ ((unused)) void (*__open__PF_P7tostypePCcPCc__1)(void *__os__P7tostype_1, const char *__name__PCc_1, const char *__mode__PCc_1), __attribute__ ((unused)) void (*__close__PF_P7tostype__1)(void *__os__P7tostype_1), __attribute__ ((unused)) void *(*__write__PFP7tostype_P7tostypePCcUl__1)(void *__anonymous_object959, const char *__anonymous_object960, unsigned long int __anonymous_object961), __attribute__ ((unused)) signed int (*__fmt__PFi_P7tostypePCc__1)(void *__anonymous_object962, const char *__fmt__PCc_1, ...), void *__anonymous_object963);
    40 void __write__A0_3_0_0____operator_assign__PFd1_Rd1d1____constructor__PF_Rd1____constructor__PF_Rd1d1____destructor__PF_Rd1____operator_bitor__PFPd0_Pd0d1___sepPrt__PFb_Pd0___sepReset__PF_Pd0___sepReset__PF_Pd0b___sepGetCur__PFPCc_Pd0___sepSetCur__PF_Pd0PCc___getNL__PFb_Pd0___setNL__PF_Pd0b___sepOn__PF_Pd0___sepOff__PF_Pd0___sepDisable__PFb_Pd0___sepEnable__PFb_Pd0___sepGet__PFPCc_Pd0___sepSet__PF_Pd0PCc___sepGetTuple__PFPCc_Pd0___sepSetTuple__PF_Pd0PCc___fail__PFi_Pd0___flush__PFi_Pd0___open__PF_Pd0PCcPCc___close__PF_Pd0___write__PFPd0_Pd0PCcUl___fmt__PFi_Pd0PCc____operator_assign__PFd2_Rd2d2____constructor__PF_Rd2____constructor__PF_Rd2d2____destructor__PF_Rd2____operator_preincr__PFd2_Rd2____operator_predecr__PFd2_Rd2____operator_equal__PFi_d2d2____operator_notequal__PFi_d2d2____operator_deref__PFRd1_d2__F_d2d2Pd0__1(__attribute__ ((unused)) void *(*_adapterFP9telt_type_14titerator_type_M_P)(void (*__anonymous_object964)(), void *__anonymous_object965), __attribute__ ((unused)) signed int (*_adapterFi_14titerator_type14titerator_type_M_PP)(void (*__anonymous_object966)(), void *__anonymous_object967, void *__anonymous_object968), __attribute__ ((unused)) void (*_adapterF14titerator_type_P14titerator_type_P_M)(void (*__anonymous_object969)(), __attribute__ ((unused)) void *___retval__operator_preincr__14titerator_type_1, void *__anonymous_object970), __attribute__ ((unused)) void (*_adapterF_P14titerator_type14titerator_type__MP)(void (*__anonymous_object971)(), void *__anonymous_object972, void *__anonymous_object973), __attribute__ ((unused)) void (*_adapterF14titerator_type_P14titerator_type14titerator_type_P_MP)(void (*__anonymous_object974)(), __attribute__ ((unused)) void *___retval__operator_assign__14titerator_type_1, void *__anonymous_object975, void *__anonymous_object976), __attribute__ ((unused)) void *(*_adapterFP7tostype_P7tostype9telt_type_M_MP)(void (*__anonymous_object977)(), void *__anonymous_object978, void *__anonymous_object979), __attribute__ ((unused)) void (*_adapterF_P9telt_type9telt_type__MP)(void (*__anonymous_object980)(), void *__anonymous_object981, void *__anonymous_object982), __attribute__ ((unused)) void (*_adapterF9telt_type_P9telt_type9telt_type_P_MP)(void (*__anonymous_object983)(), __attribute__ ((unused)) void *___retval__operator_assign__9telt_type_1, void *__anonymous_object984, void *__anonymous_object985), __attribute__ ((unused)) unsigned long int _sizeof_9telt_type, __attribute__ ((unused)) unsigned long int _alignof_9telt_type, __attribute__ ((unused)) unsigned long int _sizeof_14titerator_type, __attribute__ ((unused)) unsigned long int _alignof_14titerator_type, __attribute__ ((unused)) void *(*___operator_assign__PF9telt_type_R9telt_type9telt_type__1)(void *__anonymous_object986, void *__anonymous_object987), __attribute__ ((unused)) void (*___constructor__PF_R9telt_type__1)(void *__anonymous_object988), __attribute__ ((unused)) void (*___constructor__PF_R9telt_type9telt_type__1)(void *__anonymous_object989, void *__anonymous_object990), __attribute__ ((unused)) void (*___destructor__PF_R9telt_type__1)(void *__anonymous_object991), __attribute__ ((unused)) void *(*___operator_bitor__PFP7tostype_P7tostype9telt_type__1)(void *__anonymous_object992, void *__anonymous_object993), __attribute__ ((unused)) _Bool (*__sepPrt__PFb_P7tostype__1)(void *__anonymous_object994), __attribute__ ((unused)) void (*__sepReset__PF_P7tostype__1)(void *__anonymous_object995), __attribute__ ((unused)) void (*__sepReset__PF_P7tostypeb__1)(void *__anonymous_object996, _Bool __anonymous_object997), __attribute__ ((unused)) const char *(*__sepGetCur__PFPCc_P7tostype__1)(void *__anonymous_object998), __attribute__ ((unused)) void (*__sepSetCur__PF_P7tostypePCc__1)(void *__anonymous_object999, const char *__anonymous_object1000), __attribute__ ((unused)) _Bool (*__getNL__PFb_P7tostype__1)(void *__anonymous_object1001), __attribute__ ((unused)) void (*__setNL__PF_P7tostypeb__1)(void *__anonymous_object1002, _Bool __anonymous_object1003), __attribute__ ((unused)) void (*__sepOn__PF_P7tostype__1)(void *__anonymous_object1004), __attribute__ ((unused)) void (*__sepOff__PF_P7tostype__1)(void *__anonymous_object1005), __attribute__ ((unused)) _Bool (*__sepDisable__PFb_P7tostype__1)(void *__anonymous_object1006), __attribute__ ((unused)) _Bool (*__sepEnable__PFb_P7tostype__1)(void *__anonymous_object1007), __attribute__ ((unused)) const char *(*__sepGet__PFPCc_P7tostype__1)(void *__anonymous_object1008), __attribute__ ((unused)) void (*__sepSet__PF_P7tostypePCc__1)(void *__anonymous_object1009, const char *__anonymous_object1010), __attribute__ ((unused)) const char *(*__sepGetTuple__PFPCc_P7tostype__1)(void *__anonymous_object1011), __attribute__ ((unused)) void (*__sepSetTuple__PF_P7tostypePCc__1)(void *__anonymous_object1012, const char *__anonymous_object1013), __attribute__ ((unused)) signed int (*__fail__PFi_P7tostype__1)(void *__anonymous_object1014), __attribute__ ((unused)) signed int (*__flush__PFi_P7tostype__1)(void *__anonymous_object1015), __attribute__ ((unused)) void (*__open__PF_P7tostypePCcPCc__1)(void *__os__P7tostype_1, const char *__name__PCc_1, const char *__mode__PCc_1), __attribute__ ((unused)) void (*__close__PF_P7tostype__1)(void *__os__P7tostype_1), __attribute__ ((unused)) void *(*__write__PFP7tostype_P7tostypePCcUl__1)(void *__anonymous_object1016, const char *__anonymous_object1017, unsigned long int __anonymous_object1018), __attribute__ ((unused)) signed int (*__fmt__PFi_P7tostypePCc__1)(void *__anonymous_object1019, const char *__fmt__PCc_1, ...), __attribute__ ((unused)) void *(*___operator_assign__PF14titerator_type_R14titerator_type14titerator_type__1)(void *__anonymous_object1020, void *__anonymous_object1021), __attribute__ ((unused)) void (*___constructor__PF_R14titerator_type__1)(void *__anonymous_object1022), __attribute__ ((unused)) void (*___constructor__PF_R14titerator_type14titerator_type__1)(void *__anonymous_object1023, void *__anonymous_object1024), __attribute__ ((unused)) void (*___destructor__PF_R14titerator_type__1)(void *__anonymous_object1025), __attribute__ ((unused)) void *(*___operator_preincr__PF14titerator_type_R14titerator_type__1)(void *__anonymous_object1026), __attribute__ ((unused)) void *(*___operator_predecr__PF14titerator_type_R14titerator_type__1)(void *__anonymous_object1027), __attribute__ ((unused)) signed int (*___operator_equal__PFi_14titerator_type14titerator_type__1)(void *__anonymous_object1028, void *__anonymous_object1029), __attribute__ ((unused)) signed int (*___operator_notequal__PFi_14titerator_type14titerator_type__1)(void *__anonymous_object1030, void *__anonymous_object1031), __attribute__ ((unused)) void *(*___operator_deref__PFR9telt_type_14titerator_type__1)(void *__anonymous_object1032), void *__begin__14titerator_type_1, void *__end__14titerator_type_1, void *__os__P7tostype_1);
    41 void __write_reverse__A0_3_0_0____operator_assign__PFd1_Rd1d1____constructor__PF_Rd1____constructor__PF_Rd1d1____destructor__PF_Rd1____operator_bitor__PFPd0_Pd0d1___sepPrt__PFb_Pd0___sepReset__PF_Pd0___sepReset__PF_Pd0b___sepGetCur__PFPCc_Pd0___sepSetCur__PF_Pd0PCc___getNL__PFb_Pd0___setNL__PF_Pd0b___sepOn__PF_Pd0___sepOff__PF_Pd0___sepDisable__PFb_Pd0___sepEnable__PFb_Pd0___sepGet__PFPCc_Pd0___sepSet__PF_Pd0PCc___sepGetTuple__PFPCc_Pd0___sepSetTuple__PF_Pd0PCc___fail__PFi_Pd0___flush__PFi_Pd0___open__PF_Pd0PCcPCc___close__PF_Pd0___write__PFPd0_Pd0PCcUl___fmt__PFi_Pd0PCc____operator_assign__PFd2_Rd2d2____constructor__PF_Rd2____constructor__PF_Rd2d2____destructor__PF_Rd2____operator_preincr__PFd2_Rd2____operator_predecr__PFd2_Rd2____operator_equal__PFi_d2d2____operator_notequal__PFi_d2d2____operator_deref__PFRd1_d2__F_d2d2Pd0__1(__attribute__ ((unused)) void *(*_adapterFP9telt_type_14titerator_type_M_P)(void (*__anonymous_object1033)(), void *__anonymous_object1034), __attribute__ ((unused)) signed int (*_adapterFi_14titerator_type14titerator_type_M_PP)(void (*__anonymous_object1035)(), void *__anonymous_object1036, void *__anonymous_object1037), __attribute__ ((unused)) void (*_adapterF14titerator_type_P14titerator_type_P_M)(void (*__anonymous_object1038)(), __attribute__ ((unused)) void *___retval__operator_preincr__14titerator_type_1, void *__anonymous_object1039), __attribute__ ((unused)) void (*_adapterF_P14titerator_type14titerator_type__MP)(void (*__anonymous_object1040)(), void *__anonymous_object1041, void *__anonymous_object1042), __attribute__ ((unused)) void (*_adapterF14titerator_type_P14titerator_type14titerator_type_P_MP)(void (*__anonymous_object1043)(), __attribute__ ((unused)) void *___retval__operator_assign__14titerator_type_1, void *__anonymous_object1044, void *__anonymous_object1045), __attribute__ ((unused)) void *(*_adapterFP7tostype_P7tostype9telt_type_M_MP)(void (*__anonymous_object1046)(), void *__anonymous_object1047, void *__anonymous_object1048), __attribute__ ((unused)) void (*_adapterF_P9telt_type9telt_type__MP)(void (*__anonymous_object1049)(), void *__anonymous_object1050, void *__anonymous_object1051), __attribute__ ((unused)) void (*_adapterF9telt_type_P9telt_type9telt_type_P_MP)(void (*__anonymous_object1052)(), __attribute__ ((unused)) void *___retval__operator_assign__9telt_type_1, void *__anonymous_object1053, void *__anonymous_object1054), __attribute__ ((unused)) unsigned long int _sizeof_9telt_type, __attribute__ ((unused)) unsigned long int _alignof_9telt_type, __attribute__ ((unused)) unsigned long int _sizeof_14titerator_type, __attribute__ ((unused)) unsigned long int _alignof_14titerator_type, __attribute__ ((unused)) void *(*___operator_assign__PF9telt_type_R9telt_type9telt_type__1)(void *__anonymous_object1055, void *__anonymous_object1056), __attribute__ ((unused)) void (*___constructor__PF_R9telt_type__1)(void *__anonymous_object1057), __attribute__ ((unused)) void (*___constructor__PF_R9telt_type9telt_type__1)(void *__anonymous_object1058, void *__anonymous_object1059), __attribute__ ((unused)) void (*___destructor__PF_R9telt_type__1)(void *__anonymous_object1060), __attribute__ ((unused)) void *(*___operator_bitor__PFP7tostype_P7tostype9telt_type__1)(void *__anonymous_object1061, void *__anonymous_object1062), __attribute__ ((unused)) _Bool (*__sepPrt__PFb_P7tostype__1)(void *__anonymous_object1063), __attribute__ ((unused)) void (*__sepReset__PF_P7tostype__1)(void *__anonymous_object1064), __attribute__ ((unused)) void (*__sepReset__PF_P7tostypeb__1)(void *__anonymous_object1065, _Bool __anonymous_object1066), __attribute__ ((unused)) const char *(*__sepGetCur__PFPCc_P7tostype__1)(void *__anonymous_object1067), __attribute__ ((unused)) void (*__sepSetCur__PF_P7tostypePCc__1)(void *__anonymous_object1068, const char *__anonymous_object1069), __attribute__ ((unused)) _Bool (*__getNL__PFb_P7tostype__1)(void *__anonymous_object1070), __attribute__ ((unused)) void (*__setNL__PF_P7tostypeb__1)(void *__anonymous_object1071, _Bool __anonymous_object1072), __attribute__ ((unused)) void (*__sepOn__PF_P7tostype__1)(void *__anonymous_object1073), __attribute__ ((unused)) void (*__sepOff__PF_P7tostype__1)(void *__anonymous_object1074), __attribute__ ((unused)) _Bool (*__sepDisable__PFb_P7tostype__1)(void *__anonymous_object1075), __attribute__ ((unused)) _Bool (*__sepEnable__PFb_P7tostype__1)(void *__anonymous_object1076), __attribute__ ((unused)) const char *(*__sepGet__PFPCc_P7tostype__1)(void *__anonymous_object1077), __attribute__ ((unused)) void (*__sepSet__PF_P7tostypePCc__1)(void *__anonymous_object1078, const char *__anonymous_object1079), __attribute__ ((unused)) const char *(*__sepGetTuple__PFPCc_P7tostype__1)(void *__anonymous_object1080), __attribute__ ((unused)) void (*__sepSetTuple__PF_P7tostypePCc__1)(void *__anonymous_object1081, const char *__anonymous_object1082), __attribute__ ((unused)) signed int (*__fail__PFi_P7tostype__1)(void *__anonymous_object1083), __attribute__ ((unused)) signed int (*__flush__PFi_P7tostype__1)(void *__anonymous_object1084), __attribute__ ((unused)) void (*__open__PF_P7tostypePCcPCc__1)(void *__os__P7tostype_1, const char *__name__PCc_1, const char *__mode__PCc_1), __attribute__ ((unused)) void (*__close__PF_P7tostype__1)(void *__os__P7tostype_1), __attribute__ ((unused)) void *(*__write__PFP7tostype_P7tostypePCcUl__1)(void *__anonymous_object1085, const char *__anonymous_object1086, unsigned long int __anonymous_object1087), __attribute__ ((unused)) signed int (*__fmt__PFi_P7tostypePCc__1)(void *__anonymous_object1088, const char *__fmt__PCc_1, ...), __attribute__ ((unused)) void *(*___operator_assign__PF14titerator_type_R14titerator_type14titerator_type__1)(void *__anonymous_object1089, void *__anonymous_object1090), __attribute__ ((unused)) void (*___constructor__PF_R14titerator_type__1)(void *__anonymous_object1091), __attribute__ ((unused)) void (*___constructor__PF_R14titerator_type14titerator_type__1)(void *__anonymous_object1092, void *__anonymous_object1093), __attribute__ ((unused)) void (*___destructor__PF_R14titerator_type__1)(void *__anonymous_object1094), __attribute__ ((unused)) void *(*___operator_preincr__PF14titerator_type_R14titerator_type__1)(void *__anonymous_object1095), __attribute__ ((unused)) void *(*___operator_predecr__PF14titerator_type_R14titerator_type__1)(void *__anonymous_object1096), __attribute__ ((unused)) signed int (*___operator_equal__PFi_14titerator_type14titerator_type__1)(void *__anonymous_object1097, void *__anonymous_object1098), __attribute__ ((unused)) signed int (*___operator_notequal__PFi_14titerator_type14titerator_type__1)(void *__anonymous_object1099, void *__anonymous_object1100), __attribute__ ((unused)) void *(*___operator_deref__PFR9telt_type_14titerator_type__1)(void *__anonymous_object1101), void *__begin__14titerator_type_1, void *__end__14titerator_type_1, void *__os__P7tostype_1);
     40void __write__A2_1_0_0____operator_assign__PFt1_Rt1t1____constructor__PF_Rt1____constructor__PF_Rt1t1____destructor__PF_Rt1____operator_bitor__PFPd0_Pd0t1___sepPrt__PFb_Pd0___sepReset__PF_Pd0___sepReset__PF_Pd0b___sepGetCur__PFPCc_Pd0___sepSetCur__PF_Pd0PCc___getNL__PFb_Pd0___setNL__PF_Pd0b___sepOn__PF_Pd0___sepOff__PF_Pd0___sepDisable__PFb_Pd0___sepEnable__PFb_Pd0___sepGet__PFPCc_Pd0___sepSet__PF_Pd0PCc___sepGetTuple__PFPCc_Pd0___sepSetTuple__PF_Pd0PCc___fail__PFi_Pd0___flush__PFi_Pd0___open__PF_Pd0PCcPCc___close__PF_Pd0___write__PFPd0_Pd0PCcUl___fmt__PFi_Pd0PCc____operator_assign__PFt2_Rt2t2____constructor__PF_Rt2____constructor__PF_Rt2t2____destructor__PF_Rt2____operator_preincr__PFt2_Rt2____operator_predecr__PFt2_Rt2____operator_equal__PFi_t2t2____operator_notequal__PFi_t2t2____operator_deref__PFRt1_t2__F_t2t2Pd0__1(__attribute__ ((unused)) void *(*_adapterFP9telt_type_14titerator_type_M_P)(void (*__anonymous_object964)(), void *__anonymous_object965), __attribute__ ((unused)) signed int (*_adapterFi_14titerator_type14titerator_type_M_PP)(void (*__anonymous_object966)(), void *__anonymous_object967, void *__anonymous_object968), __attribute__ ((unused)) void (*_adapterF14titerator_type_P14titerator_type_P_M)(void (*__anonymous_object969)(), __attribute__ ((unused)) void *___retval__operator_preincr__14titerator_type_1, void *__anonymous_object970), __attribute__ ((unused)) void (*_adapterF_P14titerator_type14titerator_type__MP)(void (*__anonymous_object971)(), void *__anonymous_object972, void *__anonymous_object973), __attribute__ ((unused)) void (*_adapterF14titerator_type_P14titerator_type14titerator_type_P_MP)(void (*__anonymous_object974)(), __attribute__ ((unused)) void *___retval__operator_assign__14titerator_type_1, void *__anonymous_object975, void *__anonymous_object976), __attribute__ ((unused)) void *(*_adapterFP7tostype_P7tostype9telt_type_M_MP)(void (*__anonymous_object977)(), void *__anonymous_object978, void *__anonymous_object979), __attribute__ ((unused)) void (*_adapterF_P9telt_type9telt_type__MP)(void (*__anonymous_object980)(), void *__anonymous_object981, void *__anonymous_object982), __attribute__ ((unused)) void (*_adapterF9telt_type_P9telt_type9telt_type_P_MP)(void (*__anonymous_object983)(), __attribute__ ((unused)) void *___retval__operator_assign__9telt_type_1, void *__anonymous_object984, void *__anonymous_object985), __attribute__ ((unused)) unsigned long int _sizeof_9telt_type, __attribute__ ((unused)) unsigned long int _alignof_9telt_type, __attribute__ ((unused)) unsigned long int _sizeof_14titerator_type, __attribute__ ((unused)) unsigned long int _alignof_14titerator_type, __attribute__ ((unused)) void *(*___operator_assign__PF9telt_type_R9telt_type9telt_type__1)(void *__anonymous_object986, void *__anonymous_object987), __attribute__ ((unused)) void (*___constructor__PF_R9telt_type__1)(void *__anonymous_object988), __attribute__ ((unused)) void (*___constructor__PF_R9telt_type9telt_type__1)(void *__anonymous_object989, void *__anonymous_object990), __attribute__ ((unused)) void (*___destructor__PF_R9telt_type__1)(void *__anonymous_object991), __attribute__ ((unused)) void *(*___operator_bitor__PFP7tostype_P7tostype9telt_type__1)(void *__anonymous_object992, void *__anonymous_object993), __attribute__ ((unused)) _Bool (*__sepPrt__PFb_P7tostype__1)(void *__anonymous_object994), __attribute__ ((unused)) void (*__sepReset__PF_P7tostype__1)(void *__anonymous_object995), __attribute__ ((unused)) void (*__sepReset__PF_P7tostypeb__1)(void *__anonymous_object996, _Bool __anonymous_object997), __attribute__ ((unused)) const char *(*__sepGetCur__PFPCc_P7tostype__1)(void *__anonymous_object998), __attribute__ ((unused)) void (*__sepSetCur__PF_P7tostypePCc__1)(void *__anonymous_object999, const char *__anonymous_object1000), __attribute__ ((unused)) _Bool (*__getNL__PFb_P7tostype__1)(void *__anonymous_object1001), __attribute__ ((unused)) void (*__setNL__PF_P7tostypeb__1)(void *__anonymous_object1002, _Bool __anonymous_object1003), __attribute__ ((unused)) void (*__sepOn__PF_P7tostype__1)(void *__anonymous_object1004), __attribute__ ((unused)) void (*__sepOff__PF_P7tostype__1)(void *__anonymous_object1005), __attribute__ ((unused)) _Bool (*__sepDisable__PFb_P7tostype__1)(void *__anonymous_object1006), __attribute__ ((unused)) _Bool (*__sepEnable__PFb_P7tostype__1)(void *__anonymous_object1007), __attribute__ ((unused)) const char *(*__sepGet__PFPCc_P7tostype__1)(void *__anonymous_object1008), __attribute__ ((unused)) void (*__sepSet__PF_P7tostypePCc__1)(void *__anonymous_object1009, const char *__anonymous_object1010), __attribute__ ((unused)) const char *(*__sepGetTuple__PFPCc_P7tostype__1)(void *__anonymous_object1011), __attribute__ ((unused)) void (*__sepSetTuple__PF_P7tostypePCc__1)(void *__anonymous_object1012, const char *__anonymous_object1013), __attribute__ ((unused)) signed int (*__fail__PFi_P7tostype__1)(void *__anonymous_object1014), __attribute__ ((unused)) signed int (*__flush__PFi_P7tostype__1)(void *__anonymous_object1015), __attribute__ ((unused)) void (*__open__PF_P7tostypePCcPCc__1)(void *__os__P7tostype_1, const char *__name__PCc_1, const char *__mode__PCc_1), __attribute__ ((unused)) void (*__close__PF_P7tostype__1)(void *__os__P7tostype_1), __attribute__ ((unused)) void *(*__write__PFP7tostype_P7tostypePCcUl__1)(void *__anonymous_object1016, const char *__anonymous_object1017, unsigned long int __anonymous_object1018), __attribute__ ((unused)) signed int (*__fmt__PFi_P7tostypePCc__1)(void *__anonymous_object1019, const char *__fmt__PCc_1, ...), __attribute__ ((unused)) void *(*___operator_assign__PF14titerator_type_R14titerator_type14titerator_type__1)(void *__anonymous_object1020, void *__anonymous_object1021), __attribute__ ((unused)) void (*___constructor__PF_R14titerator_type__1)(void *__anonymous_object1022), __attribute__ ((unused)) void (*___constructor__PF_R14titerator_type14titerator_type__1)(void *__anonymous_object1023, void *__anonymous_object1024), __attribute__ ((unused)) void (*___destructor__PF_R14titerator_type__1)(void *__anonymous_object1025), __attribute__ ((unused)) void *(*___operator_preincr__PF14titerator_type_R14titerator_type__1)(void *__anonymous_object1026), __attribute__ ((unused)) void *(*___operator_predecr__PF14titerator_type_R14titerator_type__1)(void *__anonymous_object1027), __attribute__ ((unused)) signed int (*___operator_equal__PFi_14titerator_type14titerator_type__1)(void *__anonymous_object1028, void *__anonymous_object1029), __attribute__ ((unused)) signed int (*___operator_notequal__PFi_14titerator_type14titerator_type__1)(void *__anonymous_object1030, void *__anonymous_object1031), __attribute__ ((unused)) void *(*___operator_deref__PFR9telt_type_14titerator_type__1)(void *__anonymous_object1032), void *__begin__14titerator_type_1, void *__end__14titerator_type_1, void *__os__P7tostype_1);
     41void __write_reverse__A2_1_0_0____operator_assign__PFt1_Rt1t1____constructor__PF_Rt1____constructor__PF_Rt1t1____destructor__PF_Rt1____operator_bitor__PFPd0_Pd0t1___sepPrt__PFb_Pd0___sepReset__PF_Pd0___sepReset__PF_Pd0b___sepGetCur__PFPCc_Pd0___sepSetCur__PF_Pd0PCc___getNL__PFb_Pd0___setNL__PF_Pd0b___sepOn__PF_Pd0___sepOff__PF_Pd0___sepDisable__PFb_Pd0___sepEnable__PFb_Pd0___sepGet__PFPCc_Pd0___sepSet__PF_Pd0PCc___sepGetTuple__PFPCc_Pd0___sepSetTuple__PF_Pd0PCc___fail__PFi_Pd0___flush__PFi_Pd0___open__PF_Pd0PCcPCc___close__PF_Pd0___write__PFPd0_Pd0PCcUl___fmt__PFi_Pd0PCc____operator_assign__PFt2_Rt2t2____constructor__PF_Rt2____constructor__PF_Rt2t2____destructor__PF_Rt2____operator_preincr__PFt2_Rt2____operator_predecr__PFt2_Rt2____operator_equal__PFi_t2t2____operator_notequal__PFi_t2t2____operator_deref__PFRt1_t2__F_t2t2Pd0__1(__attribute__ ((unused)) void *(*_adapterFP9telt_type_14titerator_type_M_P)(void (*__anonymous_object1033)(), void *__anonymous_object1034), __attribute__ ((unused)) signed int (*_adapterFi_14titerator_type14titerator_type_M_PP)(void (*__anonymous_object1035)(), void *__anonymous_object1036, void *__anonymous_object1037), __attribute__ ((unused)) void (*_adapterF14titerator_type_P14titerator_type_P_M)(void (*__anonymous_object1038)(), __attribute__ ((unused)) void *___retval__operator_preincr__14titerator_type_1, void *__anonymous_object1039), __attribute__ ((unused)) void (*_adapterF_P14titerator_type14titerator_type__MP)(void (*__anonymous_object1040)(), void *__anonymous_object1041, void *__anonymous_object1042), __attribute__ ((unused)) void (*_adapterF14titerator_type_P14titerator_type14titerator_type_P_MP)(void (*__anonymous_object1043)(), __attribute__ ((unused)) void *___retval__operator_assign__14titerator_type_1, void *__anonymous_object1044, void *__anonymous_object1045), __attribute__ ((unused)) void *(*_adapterFP7tostype_P7tostype9telt_type_M_MP)(void (*__anonymous_object1046)(), void *__anonymous_object1047, void *__anonymous_object1048), __attribute__ ((unused)) void (*_adapterF_P9telt_type9telt_type__MP)(void (*__anonymous_object1049)(), void *__anonymous_object1050, void *__anonymous_object1051), __attribute__ ((unused)) void (*_adapterF9telt_type_P9telt_type9telt_type_P_MP)(void (*__anonymous_object1052)(), __attribute__ ((unused)) void *___retval__operator_assign__9telt_type_1, void *__anonymous_object1053, void *__anonymous_object1054), __attribute__ ((unused)) unsigned long int _sizeof_9telt_type, __attribute__ ((unused)) unsigned long int _alignof_9telt_type, __attribute__ ((unused)) unsigned long int _sizeof_14titerator_type, __attribute__ ((unused)) unsigned long int _alignof_14titerator_type, __attribute__ ((unused)) void *(*___operator_assign__PF9telt_type_R9telt_type9telt_type__1)(void *__anonymous_object1055, void *__anonymous_object1056), __attribute__ ((unused)) void (*___constructor__PF_R9telt_type__1)(void *__anonymous_object1057), __attribute__ ((unused)) void (*___constructor__PF_R9telt_type9telt_type__1)(void *__anonymous_object1058, void *__anonymous_object1059), __attribute__ ((unused)) void (*___destructor__PF_R9telt_type__1)(void *__anonymous_object1060), __attribute__ ((unused)) void *(*___operator_bitor__PFP7tostype_P7tostype9telt_type__1)(void *__anonymous_object1061, void *__anonymous_object1062), __attribute__ ((unused)) _Bool (*__sepPrt__PFb_P7tostype__1)(void *__anonymous_object1063), __attribute__ ((unused)) void (*__sepReset__PF_P7tostype__1)(void *__anonymous_object1064), __attribute__ ((unused)) void (*__sepReset__PF_P7tostypeb__1)(void *__anonymous_object1065, _Bool __anonymous_object1066), __attribute__ ((unused)) const char *(*__sepGetCur__PFPCc_P7tostype__1)(void *__anonymous_object1067), __attribute__ ((unused)) void (*__sepSetCur__PF_P7tostypePCc__1)(void *__anonymous_object1068, const char *__anonymous_object1069), __attribute__ ((unused)) _Bool (*__getNL__PFb_P7tostype__1)(void *__anonymous_object1070), __attribute__ ((unused)) void (*__setNL__PF_P7tostypeb__1)(void *__anonymous_object1071, _Bool __anonymous_object1072), __attribute__ ((unused)) void (*__sepOn__PF_P7tostype__1)(void *__anonymous_object1073), __attribute__ ((unused)) void (*__sepOff__PF_P7tostype__1)(void *__anonymous_object1074), __attribute__ ((unused)) _Bool (*__sepDisable__PFb_P7tostype__1)(void *__anonymous_object1075), __attribute__ ((unused)) _Bool (*__sepEnable__PFb_P7tostype__1)(void *__anonymous_object1076), __attribute__ ((unused)) const char *(*__sepGet__PFPCc_P7tostype__1)(void *__anonymous_object1077), __attribute__ ((unused)) void (*__sepSet__PF_P7tostypePCc__1)(void *__anonymous_object1078, const char *__anonymous_object1079), __attribute__ ((unused)) const char *(*__sepGetTuple__PFPCc_P7tostype__1)(void *__anonymous_object1080), __attribute__ ((unused)) void (*__sepSetTuple__PF_P7tostypePCc__1)(void *__anonymous_object1081, const char *__anonymous_object1082), __attribute__ ((unused)) signed int (*__fail__PFi_P7tostype__1)(void *__anonymous_object1083), __attribute__ ((unused)) signed int (*__flush__PFi_P7tostype__1)(void *__anonymous_object1084), __attribute__ ((unused)) void (*__open__PF_P7tostypePCcPCc__1)(void *__os__P7tostype_1, const char *__name__PCc_1, const char *__mode__PCc_1), __attribute__ ((unused)) void (*__close__PF_P7tostype__1)(void *__os__P7tostype_1), __attribute__ ((unused)) void *(*__write__PFP7tostype_P7tostypePCcUl__1)(void *__anonymous_object1085, const char *__anonymous_object1086, unsigned long int __anonymous_object1087), __attribute__ ((unused)) signed int (*__fmt__PFi_P7tostypePCc__1)(void *__anonymous_object1088, const char *__fmt__PCc_1, ...), __attribute__ ((unused)) void *(*___operator_assign__PF14titerator_type_R14titerator_type14titerator_type__1)(void *__anonymous_object1089, void *__anonymous_object1090), __attribute__ ((unused)) void (*___constructor__PF_R14titerator_type__1)(void *__anonymous_object1091), __attribute__ ((unused)) void (*___constructor__PF_R14titerator_type14titerator_type__1)(void *__anonymous_object1092, void *__anonymous_object1093), __attribute__ ((unused)) void (*___destructor__PF_R14titerator_type__1)(void *__anonymous_object1094), __attribute__ ((unused)) void *(*___operator_preincr__PF14titerator_type_R14titerator_type__1)(void *__anonymous_object1095), __attribute__ ((unused)) void *(*___operator_predecr__PF14titerator_type_R14titerator_type__1)(void *__anonymous_object1096), __attribute__ ((unused)) signed int (*___operator_equal__PFi_14titerator_type14titerator_type__1)(void *__anonymous_object1097, void *__anonymous_object1098), __attribute__ ((unused)) signed int (*___operator_notequal__PFi_14titerator_type14titerator_type__1)(void *__anonymous_object1099, void *__anonymous_object1100), __attribute__ ((unused)) void *(*___operator_deref__PFR9telt_type_14titerator_type__1)(void *__anonymous_object1101), void *__begin__14titerator_type_1, void *__end__14titerator_type_1, void *__os__P7tostype_1);
    4242void *___operator_bitor__A0_1_0_0___fail__PFi_Pd0___eof__PFi_Pd0___open__PF_Pd0PCcPCc___close__PF_Pd0___read__PFPd0_Pd0PcUl___ungetc__PFPd0_Pd0c___fmt__PFi_Pd0PCc__FPd0_Pd0Rc__1(__attribute__ ((unused)) signed int (*__fail__PFi_P7tistype__1)(void *__anonymous_object1102), __attribute__ ((unused)) signed int (*__eof__PFi_P7tistype__1)(void *__anonymous_object1103), __attribute__ ((unused)) void (*__open__PF_P7tistypePCcPCc__1)(void *__is__P7tistype_1, const char *__name__PCc_1, const char *__mode__PCc_1), __attribute__ ((unused)) void (*__close__PF_P7tistype__1)(void *__is__P7tistype_1), __attribute__ ((unused)) void *(*__read__PFP7tistype_P7tistypePcUl__1)(void *__anonymous_object1104, char *__anonymous_object1105, unsigned long int __anonymous_object1106), __attribute__ ((unused)) void *(*__ungetc__PFP7tistype_P7tistypec__1)(void *__anonymous_object1107, char __anonymous_object1108), __attribute__ ((unused)) signed int (*__fmt__PFi_P7tistypePCc__1)(void *__anonymous_object1109, const char *__fmt__PCc_1, ...), void *__anonymous_object1110, char *__anonymous_object1111);
    4343void *___operator_bitor__A0_1_0_0___fail__PFi_Pd0___eof__PFi_Pd0___open__PF_Pd0PCcPCc___close__PF_Pd0___read__PFPd0_Pd0PcUl___ungetc__PFPd0_Pd0c___fmt__PFi_Pd0PCc__FPd0_Pd0RSc__1(__attribute__ ((unused)) signed int (*__fail__PFi_P7tistype__1)(void *__anonymous_object1112), __attribute__ ((unused)) signed int (*__eof__PFi_P7tistype__1)(void *__anonymous_object1113), __attribute__ ((unused)) void (*__open__PF_P7tistypePCcPCc__1)(void *__is__P7tistype_1, const char *__name__PCc_1, const char *__mode__PCc_1), __attribute__ ((unused)) void (*__close__PF_P7tistype__1)(void *__is__P7tistype_1), __attribute__ ((unused)) void *(*__read__PFP7tistype_P7tistypePcUl__1)(void *__anonymous_object1114, char *__anonymous_object1115, unsigned long int __anonymous_object1116), __attribute__ ((unused)) void *(*__ungetc__PFP7tistype_P7tistypec__1)(void *__anonymous_object1117, char __anonymous_object1118), __attribute__ ((unused)) signed int (*__fmt__PFi_P7tistypePCc__1)(void *__anonymous_object1119, const char *__fmt__PCc_1, ...), void *__anonymous_object1120, signed char *__anonymous_object1121);
     
    6464static inline void ___destructor__F_R16s_Istream_cstrUC_autogen___1(struct _Istream_cstrUC *___dst__R16s_Istream_cstrUC_1);
    6565static inline struct _Istream_cstrUC ___operator_assign__F16s_Istream_cstrUC_R16s_Istream_cstrUC16s_Istream_cstrUC_autogen___1(struct _Istream_cstrUC *___dst__R16s_Istream_cstrUC_1, struct _Istream_cstrUC ___src__16s_Istream_cstrUC_1);
    66 static inline void ___constructor__F_R16s_Istream_cstrUCPc_autogen___1(struct _Istream_cstrUC *___dst__R16s_Istream_cstrUC_1, char *__s__Pc_1);
    6766static inline void ___constructor__F_R16s_Istream_cstrUC_autogen___1(struct _Istream_cstrUC *___dst__R16s_Istream_cstrUC_1){
    6867    ((void)((*___dst__R16s_Istream_cstrUC_1).__s__Pc_1) /* ?{} */);
     
    7776    struct _Istream_cstrUC ___ret__16s_Istream_cstrUC_1;
    7877    ((void)((*___dst__R16s_Istream_cstrUC_1).__s__Pc_1=___src__16s_Istream_cstrUC_1.__s__Pc_1));
    79     ((void)___constructor__F_R16s_Istream_cstrUC16s_Istream_cstrUC_autogen___1((&___ret__16s_Istream_cstrUC_1), (*___dst__R16s_Istream_cstrUC_1)));
    80     return ___ret__16s_Istream_cstrUC_1;
     78    ((void)___constructor__F_R16s_Istream_cstrUC16s_Istream_cstrUC_autogen___1((&___ret__16s_Istream_cstrUC_1), ___src__16s_Istream_cstrUC_1));
     79    return ((struct _Istream_cstrUC )___ret__16s_Istream_cstrUC_1);
    8180}
    8281static inline void ___constructor__F_R16s_Istream_cstrUCPc_autogen___1(struct _Istream_cstrUC *___dst__R16s_Istream_cstrUC_1, char *__s__Pc_1){
     
    9392static inline void ___destructor__F_R15s_Istream_cstrC_autogen___1(struct _Istream_cstrC *___dst__R15s_Istream_cstrC_1);
    9493static inline struct _Istream_cstrC ___operator_assign__F15s_Istream_cstrC_R15s_Istream_cstrC15s_Istream_cstrC_autogen___1(struct _Istream_cstrC *___dst__R15s_Istream_cstrC_1, struct _Istream_cstrC ___src__15s_Istream_cstrC_1);
    95 static inline void ___constructor__F_R15s_Istream_cstrCPc_autogen___1(struct _Istream_cstrC *___dst__R15s_Istream_cstrC_1, char *__s__Pc_1);
    96 static inline void ___constructor__F_R15s_Istream_cstrCPci_autogen___1(struct _Istream_cstrC *___dst__R15s_Istream_cstrC_1, char *__s__Pc_1, signed int __size__i_1);
    9794static inline void ___constructor__F_R15s_Istream_cstrC_autogen___1(struct _Istream_cstrC *___dst__R15s_Istream_cstrC_1){
    9895    ((void)((*___dst__R15s_Istream_cstrC_1).__s__Pc_1) /* ?{} */);
     
    111108    ((void)((*___dst__R15s_Istream_cstrC_1).__s__Pc_1=___src__15s_Istream_cstrC_1.__s__Pc_1));
    112109    ((void)((*___dst__R15s_Istream_cstrC_1).__size__i_1=___src__15s_Istream_cstrC_1.__size__i_1));
    113     ((void)___constructor__F_R15s_Istream_cstrC15s_Istream_cstrC_autogen___1((&___ret__15s_Istream_cstrC_1), (*___dst__R15s_Istream_cstrC_1)));
    114     return ___ret__15s_Istream_cstrC_1;
     110    ((void)___constructor__F_R15s_Istream_cstrC15s_Istream_cstrC_autogen___1((&___ret__15s_Istream_cstrC_1), ___src__15s_Istream_cstrC_1));
     111    return ((struct _Istream_cstrC )___ret__15s_Istream_cstrC_1);
    115112}
    116113static inline void ___constructor__F_R15s_Istream_cstrCPc_autogen___1(struct _Istream_cstrC *___dst__R15s_Istream_cstrC_1, char *__s__Pc_1){
     
    125122void *___operator_bitor__A0_1_0_0___fail__PFi_Pd0___eof__PFi_Pd0___open__PF_Pd0PCcPCc___close__PF_Pd0___read__PFPd0_Pd0PcUl___ungetc__PFPd0_Pd0c___fmt__PFi_Pd0PCc__FPd0_Pd015s_Istream_cstrC__1(__attribute__ ((unused)) signed int (*__fail__PFi_P7tistype__1)(void *__anonymous_object1284), __attribute__ ((unused)) signed int (*__eof__PFi_P7tistype__1)(void *__anonymous_object1285), __attribute__ ((unused)) void (*__open__PF_P7tistypePCcPCc__1)(void *__is__P7tistype_1, const char *__name__PCc_1, const char *__mode__PCc_1), __attribute__ ((unused)) void (*__close__PF_P7tistype__1)(void *__is__P7tistype_1), __attribute__ ((unused)) void *(*__read__PFP7tistype_P7tistypePcUl__1)(void *__anonymous_object1286, char *__anonymous_object1287, unsigned long int __anonymous_object1288), __attribute__ ((unused)) void *(*__ungetc__PFP7tistype_P7tistypec__1)(void *__anonymous_object1289, char __anonymous_object1290), __attribute__ ((unused)) signed int (*__fmt__PFi_P7tistypePCc__1)(void *__anonymous_object1291, const char *__fmt__PCc_1, ...), void *__anonymous_object1292, struct _Istream_cstrC __anonymous_object1293);
    126123enum __anonymous0 {
    127     __sepSize__C13e__anonymous0_1 = 16,
     124    __sepSize__C13e__anonymous0_1 = ((signed int )16),
    128125};
    129126struct ofstream {
     
    140137static inline void ___destructor__F_R9sofstream_autogen___1(struct ofstream *___dst__R9sofstream_1);
    141138static inline struct ofstream ___operator_assign__F9sofstream_R9sofstream9sofstream_autogen___1(struct ofstream *___dst__R9sofstream_1, struct ofstream ___src__9sofstream_1);
    142 static inline void ___constructor__F_R9sofstreamPv_autogen___1(struct ofstream *___dst__R9sofstream_1, void *__file__Pv_1);
    143 static inline void ___constructor__F_R9sofstreamPvb_autogen___1(struct ofstream *___dst__R9sofstream_1, void *__file__Pv_1, _Bool __sepDefault__b_1);
    144 static inline void ___constructor__F_R9sofstreamPvbb_autogen___1(struct ofstream *___dst__R9sofstream_1, void *__file__Pv_1, _Bool __sepDefault__b_1, _Bool __sepOnOff__b_1);
    145 static inline void ___constructor__F_R9sofstreamPvbbb_autogen___1(struct ofstream *___dst__R9sofstream_1, void *__file__Pv_1, _Bool __sepDefault__b_1, _Bool __sepOnOff__b_1, _Bool __sawNL__b_1);
    146 static inline void ___constructor__F_R9sofstreamPvbbbPCc_autogen___1(struct ofstream *___dst__R9sofstream_1, void *__file__Pv_1, _Bool __sepDefault__b_1, _Bool __sepOnOff__b_1, _Bool __sawNL__b_1, const char *__sepCur__PCc_1);
    147 static inline void ___constructor__F_R9sofstreamPvbbbPCcA0c_autogen___1(struct ofstream *___dst__R9sofstream_1, void *__file__Pv_1, _Bool __sepDefault__b_1, _Bool __sepOnOff__b_1, _Bool __sawNL__b_1, const char *__sepCur__PCc_1, char __separator__A0c_1[((unsigned int )__sepSize__C13e__anonymous0_1)]);
    148 static inline void ___constructor__F_R9sofstreamPvbbbPCcA0cA0c_autogen___1(struct ofstream *___dst__R9sofstream_1, void *__file__Pv_1, _Bool __sepDefault__b_1, _Bool __sepOnOff__b_1, _Bool __sawNL__b_1, const char *__sepCur__PCc_1, char __separator__A0c_1[((unsigned int )__sepSize__C13e__anonymous0_1)], char __tupleSeparator__A0c_1[((unsigned int )__sepSize__C13e__anonymous0_1)]);
    149139static inline void ___constructor__F_R9sofstream_autogen___1(struct ofstream *___dst__R9sofstream_1){
    150140    ((void)((*___dst__R9sofstream_1).__file__Pv_1) /* ?{} */);
     
    154144    ((void)((*___dst__R9sofstream_1).__sepCur__PCc_1) /* ?{} */);
    155145    {
    156         signed int _index0 = 0;
     146        signed int _index0 = ((signed int )0);
    157147        for (;(_index0<((signed int )__sepSize__C13e__anonymous0_1));((void)(++_index0))) {
    158148            ((void)((*((char *)(&(*___dst__R9sofstream_1).__separator__A0c_1[_index0])))) /* ?{} */);
     
    160150
    161151    }
    162 
    163     {
    164         signed int _index1 = 0;
     152    {
     153        signed int _index1 = ((signed int )0);
    165154        for (;(_index1<((signed int )__sepSize__C13e__anonymous0_1));((void)(++_index1))) {
    166155            ((void)((*((char *)(&(*___dst__R9sofstream_1).__tupleSeparator__A0c_1[_index1])))) /* ?{} */);
     
    168157
    169158    }
    170 
    171159}
    172160static inline void ___constructor__F_R9sofstream9sofstream_autogen___1(struct ofstream *___dst__R9sofstream_1, struct ofstream ___src__9sofstream_1){
     
    177165    ((void)((*___dst__R9sofstream_1).__sepCur__PCc_1=___src__9sofstream_1.__sepCur__PCc_1) /* ?{} */);
    178166    {
    179         signed int _index2 = 0;
     167        signed int _index2 = ((signed int )0);
    180168        for (;(_index2<((signed int )__sepSize__C13e__anonymous0_1));((void)(++_index2))) {
    181169            ((void)((*((char *)(&(*___dst__R9sofstream_1).__separator__A0c_1[_index2])))=___src__9sofstream_1.__separator__A0c_1[_index2]) /* ?{} */);
     
    183171
    184172    }
    185 
    186     {
    187         signed int _index3 = 0;
     173    {
     174        signed int _index3 = ((signed int )0);
    188175        for (;(_index3<((signed int )__sepSize__C13e__anonymous0_1));((void)(++_index3))) {
    189176            ((void)((*((char *)(&(*___dst__R9sofstream_1).__tupleSeparator__A0c_1[_index3])))=___src__9sofstream_1.__tupleSeparator__A0c_1[_index3]) /* ?{} */);
     
    191178
    192179    }
    193 
    194180}
    195181static inline void ___destructor__F_R9sofstream_autogen___1(struct ofstream *___dst__R9sofstream_1){
    196182    {
    197         signed int _index4 = (((signed int )__sepSize__C13e__anonymous0_1)-1);
     183        signed int _index4 = ((signed int )(((signed int )__sepSize__C13e__anonymous0_1)-1));
    198184        for (;(_index4>=0);((void)(--_index4))) {
    199185            ((void)((*((char *)(&(*___dst__R9sofstream_1).__tupleSeparator__A0c_1[_index4])))) /* ^?{} */);
     
    201187
    202188    }
    203 
    204     {
    205         signed int _index5 = (((signed int )__sepSize__C13e__anonymous0_1)-1);
     189    {
     190        signed int _index5 = ((signed int )(((signed int )__sepSize__C13e__anonymous0_1)-1));
    206191        for (;(_index5>=0);((void)(--_index5))) {
    207192            ((void)((*((char *)(&(*___dst__R9sofstream_1).__separator__A0c_1[_index5])))) /* ^?{} */);
     
    209194
    210195    }
    211 
    212196    ((void)((*___dst__R9sofstream_1).__sepCur__PCc_1) /* ^?{} */);
    213197    ((void)((*___dst__R9sofstream_1).__sawNL__b_1) /* ^?{} */);
     
    224208    ((void)((*___dst__R9sofstream_1).__sepCur__PCc_1=___src__9sofstream_1.__sepCur__PCc_1));
    225209    {
    226         signed int _index6 = 0;
     210        signed int _index6 = ((signed int )0);
    227211        for (;(_index6<((signed int )__sepSize__C13e__anonymous0_1));((void)(++_index6))) {
    228212            ((void)((*___dst__R9sofstream_1).__separator__A0c_1[_index6]=___src__9sofstream_1.__separator__A0c_1[_index6]));
     
    232216
    233217    {
    234         signed int _index7 = 0;
     218        signed int _index7 = ((signed int )0);
    235219        for (;(_index7<((signed int )__sepSize__C13e__anonymous0_1));((void)(++_index7))) {
    236220            ((void)((*___dst__R9sofstream_1).__tupleSeparator__A0c_1[_index7]=___src__9sofstream_1.__tupleSeparator__A0c_1[_index7]));
     
    239223    }
    240224
    241     ((void)___constructor__F_R9sofstream9sofstream_autogen___1((&___ret__9sofstream_1), (*___dst__R9sofstream_1)));
    242     return ___ret__9sofstream_1;
     225    ((void)___constructor__F_R9sofstream9sofstream_autogen___1((&___ret__9sofstream_1), ___src__9sofstream_1));
     226    return ((struct ofstream )___ret__9sofstream_1);
    243227}
    244228static inline void ___constructor__F_R9sofstreamPv_autogen___1(struct ofstream *___dst__R9sofstream_1, void *__file__Pv_1){
     
    249233    ((void)((*___dst__R9sofstream_1).__sepCur__PCc_1) /* ?{} */);
    250234    {
    251         signed int _index8 = 0;
     235        signed int _index8 = ((signed int )0);
    252236        for (;(_index8<((signed int )__sepSize__C13e__anonymous0_1));((void)(++_index8))) {
    253237            ((void)((*((char *)(&(*___dst__R9sofstream_1).__separator__A0c_1[_index8])))) /* ?{} */);
     
    255239
    256240    }
    257 
    258     {
    259         signed int _index9 = 0;
     241    {
     242        signed int _index9 = ((signed int )0);
    260243        for (;(_index9<((signed int )__sepSize__C13e__anonymous0_1));((void)(++_index9))) {
    261244            ((void)((*((char *)(&(*___dst__R9sofstream_1).__tupleSeparator__A0c_1[_index9])))) /* ?{} */);
     
    263246
    264247    }
    265 
    266248}
    267249static inline void ___constructor__F_R9sofstreamPvb_autogen___1(struct ofstream *___dst__R9sofstream_1, void *__file__Pv_1, _Bool __sepDefault__b_1){
     
    272254    ((void)((*___dst__R9sofstream_1).__sepCur__PCc_1) /* ?{} */);
    273255    {
    274         signed int _index10 = 0;
     256        signed int _index10 = ((signed int )0);
    275257        for (;(_index10<((signed int )__sepSize__C13e__anonymous0_1));((void)(++_index10))) {
    276258            ((void)((*((char *)(&(*___dst__R9sofstream_1).__separator__A0c_1[_index10])))) /* ?{} */);
     
    278260
    279261    }
    280 
    281     {
    282         signed int _index11 = 0;
     262    {
     263        signed int _index11 = ((signed int )0);
    283264        for (;(_index11<((signed int )__sepSize__C13e__anonymous0_1));((void)(++_index11))) {
    284265            ((void)((*((char *)(&(*___dst__R9sofstream_1).__tupleSeparator__A0c_1[_index11])))) /* ?{} */);
     
    286267
    287268    }
    288 
    289269}
    290270static inline void ___constructor__F_R9sofstreamPvbb_autogen___1(struct ofstream *___dst__R9sofstream_1, void *__file__Pv_1, _Bool __sepDefault__b_1, _Bool __sepOnOff__b_1){
     
    295275    ((void)((*___dst__R9sofstream_1).__sepCur__PCc_1) /* ?{} */);
    296276    {
    297         signed int _index12 = 0;
     277        signed int _index12 = ((signed int )0);
    298278        for (;(_index12<((signed int )__sepSize__C13e__anonymous0_1));((void)(++_index12))) {
    299279            ((void)((*((char *)(&(*___dst__R9sofstream_1).__separator__A0c_1[_index12])))) /* ?{} */);
     
    301281
    302282    }
    303 
    304     {
    305         signed int _index13 = 0;
     283    {
     284        signed int _index13 = ((signed int )0);
    306285        for (;(_index13<((signed int )__sepSize__C13e__anonymous0_1));((void)(++_index13))) {
    307286            ((void)((*((char *)(&(*___dst__R9sofstream_1).__tupleSeparator__A0c_1[_index13])))) /* ?{} */);
     
    309288
    310289    }
    311 
    312290}
    313291static inline void ___constructor__F_R9sofstreamPvbbb_autogen___1(struct ofstream *___dst__R9sofstream_1, void *__file__Pv_1, _Bool __sepDefault__b_1, _Bool __sepOnOff__b_1, _Bool __sawNL__b_1){
     
    318296    ((void)((*___dst__R9sofstream_1).__sepCur__PCc_1) /* ?{} */);
    319297    {
    320         signed int _index14 = 0;
     298        signed int _index14 = ((signed int )0);
    321299        for (;(_index14<((signed int )__sepSize__C13e__anonymous0_1));((void)(++_index14))) {
    322300            ((void)((*((char *)(&(*___dst__R9sofstream_1).__separator__A0c_1[_index14])))) /* ?{} */);
     
    324302
    325303    }
    326 
    327     {
    328         signed int _index15 = 0;
     304    {
     305        signed int _index15 = ((signed int )0);
    329306        for (;(_index15<((signed int )__sepSize__C13e__anonymous0_1));((void)(++_index15))) {
    330307            ((void)((*((char *)(&(*___dst__R9sofstream_1).__tupleSeparator__A0c_1[_index15])))) /* ?{} */);
     
    332309
    333310    }
    334 
    335311}
    336312static inline void ___constructor__F_R9sofstreamPvbbbPCc_autogen___1(struct ofstream *___dst__R9sofstream_1, void *__file__Pv_1, _Bool __sepDefault__b_1, _Bool __sepOnOff__b_1, _Bool __sawNL__b_1, const char *__sepCur__PCc_1){
     
    341317    ((void)((*___dst__R9sofstream_1).__sepCur__PCc_1=__sepCur__PCc_1) /* ?{} */);
    342318    {
    343         signed int _index16 = 0;
     319        signed int _index16 = ((signed int )0);
    344320        for (;(_index16<((signed int )__sepSize__C13e__anonymous0_1));((void)(++_index16))) {
    345321            ((void)((*((char *)(&(*___dst__R9sofstream_1).__separator__A0c_1[_index16])))) /* ?{} */);
     
    347323
    348324    }
    349 
    350     {
    351         signed int _index17 = 0;
     325    {
     326        signed int _index17 = ((signed int )0);
    352327        for (;(_index17<((signed int )__sepSize__C13e__anonymous0_1));((void)(++_index17))) {
    353328            ((void)((*((char *)(&(*___dst__R9sofstream_1).__tupleSeparator__A0c_1[_index17])))) /* ?{} */);
     
    355330
    356331    }
    357 
    358332}
    359333static inline void ___constructor__F_R9sofstreamPvbbbPCcA0c_autogen___1(struct ofstream *___dst__R9sofstream_1, void *__file__Pv_1, _Bool __sepDefault__b_1, _Bool __sepOnOff__b_1, _Bool __sawNL__b_1, const char *__sepCur__PCc_1, char __separator__A0c_1[((unsigned int )__sepSize__C13e__anonymous0_1)]){
     
    364338    ((void)((*___dst__R9sofstream_1).__sepCur__PCc_1=__sepCur__PCc_1) /* ?{} */);
    365339    {
    366         signed int _index18 = 0;
     340        signed int _index18 = ((signed int )0);
    367341        for (;(_index18<((signed int )__sepSize__C13e__anonymous0_1));((void)(++_index18))) {
    368342            ((void)((*((char *)(&(*___dst__R9sofstream_1).__separator__A0c_1[_index18])))=__separator__A0c_1[_index18]) /* ?{} */);
     
    370344
    371345    }
    372 
    373     {
    374         signed int _index19 = 0;
     346    {
     347        signed int _index19 = ((signed int )0);
    375348        for (;(_index19<((signed int )__sepSize__C13e__anonymous0_1));((void)(++_index19))) {
    376349            ((void)((*((char *)(&(*___dst__R9sofstream_1).__tupleSeparator__A0c_1[_index19])))) /* ?{} */);
     
    378351
    379352    }
    380 
    381353}
    382354static inline void ___constructor__F_R9sofstreamPvbbbPCcA0cA0c_autogen___1(struct ofstream *___dst__R9sofstream_1, void *__file__Pv_1, _Bool __sepDefault__b_1, _Bool __sepOnOff__b_1, _Bool __sawNL__b_1, const char *__sepCur__PCc_1, char __separator__A0c_1[((unsigned int )__sepSize__C13e__anonymous0_1)], char __tupleSeparator__A0c_1[((unsigned int )__sepSize__C13e__anonymous0_1)]){
     
    387359    ((void)((*___dst__R9sofstream_1).__sepCur__PCc_1=__sepCur__PCc_1) /* ?{} */);
    388360    {
    389         signed int _index20 = 0;
     361        signed int _index20 = ((signed int )0);
    390362        for (;(_index20<((signed int )__sepSize__C13e__anonymous0_1));((void)(++_index20))) {
    391363            ((void)((*((char *)(&(*___dst__R9sofstream_1).__separator__A0c_1[_index20])))=__separator__A0c_1[_index20]) /* ?{} */);
     
    393365
    394366    }
    395 
    396     {
    397         signed int _index21 = 0;
     367    {
     368        signed int _index21 = ((signed int )0);
    398369        for (;(_index21<((signed int )__sepSize__C13e__anonymous0_1));((void)(++_index21))) {
    399370            ((void)((*((char *)(&(*___dst__R9sofstream_1).__tupleSeparator__A0c_1[_index21])))=__tupleSeparator__A0c_1[_index21]) /* ?{} */);
     
    401372
    402373    }
    403 
    404374}
    405375_Bool __sepPrt__Fb_P9sofstream__1(struct ofstream *__anonymous_object1294);
     
    434404static inline void ___destructor__F_R9sifstream_autogen___1(struct ifstream *___dst__R9sifstream_1);
    435405static inline struct ifstream ___operator_assign__F9sifstream_R9sifstream9sifstream_autogen___1(struct ifstream *___dst__R9sifstream_1, struct ifstream ___src__9sifstream_1);
    436 static inline void ___constructor__F_R9sifstreamPv_autogen___1(struct ifstream *___dst__R9sifstream_1, void *__file__Pv_1);
    437406static inline void ___constructor__F_R9sifstream_autogen___1(struct ifstream *___dst__R9sifstream_1){
    438407    ((void)((*___dst__R9sifstream_1).__file__Pv_1) /* ?{} */);
     
    447416    struct ifstream ___ret__9sifstream_1;
    448417    ((void)((*___dst__R9sifstream_1).__file__Pv_1=___src__9sifstream_1.__file__Pv_1));
    449     ((void)___constructor__F_R9sifstream9sifstream_autogen___1((&___ret__9sifstream_1), (*___dst__R9sifstream_1)));
    450     return ___ret__9sifstream_1;
     418    ((void)___constructor__F_R9sifstream9sifstream_autogen___1((&___ret__9sifstream_1), ___src__9sifstream_1));
     419    return ((struct ifstream )___ret__9sifstream_1);
    451420}
    452421static inline void ___constructor__F_R9sifstreamPv_autogen___1(struct ifstream *___dst__R9sifstream_1, void *__file__Pv_1){
     
    466435    struct ofstream *_tmp_cp_ret2;
    467436    __attribute__ ((unused)) struct ofstream *_thunk0(struct ofstream *_p0){
    468         return __endl__A0_1_0_0___sepPrt__PFb_Pd0___sepReset__PF_Pd0___sepReset__PF_Pd0b___sepGetCur__PFPCc_Pd0___sepSetCur__PF_Pd0PCc___getNL__PFb_Pd0___setNL__PF_Pd0b___sepOn__PF_Pd0___sepOff__PF_Pd0___sepDisable__PFb_Pd0___sepEnable__PFb_Pd0___sepGet__PFPCc_Pd0___sepSet__PF_Pd0PCc___sepGetTuple__PFPCc_Pd0___sepSetTuple__PF_Pd0PCc___fail__PFi_Pd0___flush__PFi_Pd0___open__PF_Pd0PCcPCc___close__PF_Pd0___write__PFPd0_Pd0PCcUl___fmt__PFi_Pd0PCc__FPd0_Pd0__1(((_Bool (*)(void *__anonymous_object1322))__sepPrt__Fb_P9sofstream__1), ((void (*)(void *__anonymous_object1323))__sepReset__F_P9sofstream__1), ((void (*)(void *__anonymous_object1324, _Bool __anonymous_object1325))__sepReset__F_P9sofstreamb__1), ((const char *(*)(void *__anonymous_object1326))__sepGetCur__FPCc_P9sofstream__1), ((void (*)(void *__anonymous_object1327, const char *__anonymous_object1328))__sepSetCur__F_P9sofstreamPCc__1), ((_Bool (*)(void *__anonymous_object1329))__getNL__Fb_P9sofstream__1), ((void (*)(void *__anonymous_object1330, _Bool __anonymous_object1331))__setNL__F_P9sofstreamb__1), ((void (*)(void *__anonymous_object1332))__sepOn__F_P9sofstream__1), ((void (*)(void *__anonymous_object1333))__sepOff__F_P9sofstream__1), ((_Bool (*)(void *__anonymous_object1334))__sepDisable__Fb_P9sofstream__1), ((_Bool (*)(void *__anonymous_object1335))__sepEnable__Fb_P9sofstream__1), ((const char *(*)(void *__anonymous_object1336))__sepGet__FPCc_P9sofstream__1), ((void (*)(void *__anonymous_object1337, const char *__anonymous_object1338))__sepSet__F_P9sofstreamPCc__1), ((const char *(*)(void *__anonymous_object1339))__sepGetTuple__FPCc_P9sofstream__1), ((void (*)(void *__anonymous_object1340, const char *__anonymous_object1341))__sepSetTuple__F_P9sofstreamPCc__1), ((signed int (*)(void *__anonymous_object1342))__fail__Fi_P9sofstream__1), ((signed int (*)(void *__anonymous_object1343))__flush__Fi_P9sofstream__1), ((void (*)(void *__os__P7tostype_1, const char *__name__PCc_1, const char *__mode__PCc_1))__open__F_P9sofstreamPCcPCc__1), ((void (*)(void *__os__P7tostype_1))__close__F_P9sofstream__1), ((void *(*)(void *__anonymous_object1344, const char *__anonymous_object1345, unsigned long int __anonymous_object1346))__write__FP9sofstream_P9sofstreamPCcUl__1), ((signed int (*)(void *__anonymous_object1347, const char *__fmt__PCc_1, ...))__fmt__Fi_P9sofstreamPCc__1), ((void *)_p0));
    469     }
    470     ((void)(((void)(_tmp_cp_ret2=___operator_bitor__A0_1_0_0___sepPrt__PFb_Pd0___sepReset__PF_Pd0___sepReset__PF_Pd0b___sepGetCur__PFPCc_Pd0___sepSetCur__PF_Pd0PCc___getNL__PFb_Pd0___setNL__PF_Pd0b___sepOn__PF_Pd0___sepOff__PF_Pd0___sepDisable__PFb_Pd0___sepEnable__PFb_Pd0___sepGet__PFPCc_Pd0___sepSet__PF_Pd0PCc___sepGetTuple__PFPCc_Pd0___sepSetTuple__PF_Pd0PCc___fail__PFi_Pd0___flush__PFi_Pd0___open__PF_Pd0PCcPCc___close__PF_Pd0___write__PFPd0_Pd0PCcUl___fmt__PFi_Pd0PCc__FPd0_Pd0PFPd0_Pd0___1(((_Bool (*)(void *__anonymous_object1348))__sepPrt__Fb_P9sofstream__1), ((void (*)(void *__anonymous_object1349))__sepReset__F_P9sofstream__1), ((void (*)(void *__anonymous_object1350, _Bool __anonymous_object1351))__sepReset__F_P9sofstreamb__1), ((const char *(*)(void *__anonymous_object1352))__sepGetCur__FPCc_P9sofstream__1), ((void (*)(void *__anonymous_object1353, const char *__anonymous_object1354))__sepSetCur__F_P9sofstreamPCc__1), ((_Bool (*)(void *__anonymous_object1355))__getNL__Fb_P9sofstream__1), ((void (*)(void *__anonymous_object1356, _Bool __anonymous_object1357))__setNL__F_P9sofstreamb__1), ((void (*)(void *__anonymous_object1358))__sepOn__F_P9sofstream__1), ((void (*)(void *__anonymous_object1359))__sepOff__F_P9sofstream__1), ((_Bool (*)(void *__anonymous_object1360))__sepDisable__Fb_P9sofstream__1), ((_Bool (*)(void *__anonymous_object1361))__sepEnable__Fb_P9sofstream__1), ((const char *(*)(void *__anonymous_object1362))__sepGet__FPCc_P9sofstream__1), ((void (*)(void *__anonymous_object1363, const char *__anonymous_object1364))__sepSet__F_P9sofstreamPCc__1), ((const char *(*)(void *__anonymous_object1365))__sepGetTuple__FPCc_P9sofstream__1), ((void (*)(void *__anonymous_object1366, const char *__anonymous_object1367))__sepSetTuple__F_P9sofstreamPCc__1), ((signed int (*)(void *__anonymous_object1368))__fail__Fi_P9sofstream__1), ((signed int (*)(void *__anonymous_object1369))__flush__Fi_P9sofstream__1), ((void (*)(void *__os__P7tostype_1, const char *__name__PCc_1, const char *__mode__PCc_1))__open__F_P9sofstreamPCcPCc__1), ((void (*)(void *__os__P7tostype_1))__close__F_P9sofstream__1), ((void *(*)(void *__anonymous_object1370, const char *__anonymous_object1371, unsigned long int __anonymous_object1372))__write__FP9sofstream_P9sofstreamPCcUl__1), ((signed int (*)(void *__anonymous_object1373, const char *__fmt__PCc_1, ...))__fmt__Fi_P9sofstreamPCc__1), ((void *)(((void)(_tmp_cp_ret1=___operator_bitor__A0_1_0_0___sepPrt__PFb_Pd0___sepReset__PF_Pd0___sepReset__PF_Pd0b___sepGetCur__PFPCc_Pd0___sepSetCur__PF_Pd0PCc___getNL__PFb_Pd0___setNL__PF_Pd0b___sepOn__PF_Pd0___sepOff__PF_Pd0___sepDisable__PFb_Pd0___sepEnable__PFb_Pd0___sepGet__PFPCc_Pd0___sepSet__PF_Pd0PCc___sepGetTuple__PFPCc_Pd0___sepSetTuple__PF_Pd0PCc___fail__PFi_Pd0___flush__PFi_Pd0___open__PF_Pd0PCcPCc___close__PF_Pd0___write__PFPd0_Pd0PCcUl___fmt__PFi_Pd0PCc__FPd0_Pd0c__1(((_Bool (*)(void *__anonymous_object1374))__sepPrt__Fb_P9sofstream__1), ((void (*)(void *__anonymous_object1375))__sepReset__F_P9sofstream__1), ((void (*)(void *__anonymous_object1376, _Bool __anonymous_object1377))__sepReset__F_P9sofstreamb__1), ((const char *(*)(void *__anonymous_object1378))__sepGetCur__FPCc_P9sofstream__1), ((void (*)(void *__anonymous_object1379, const char *__anonymous_object1380))__sepSetCur__F_P9sofstreamPCc__1), ((_Bool (*)(void *__anonymous_object1381))__getNL__Fb_P9sofstream__1), ((void (*)(void *__anonymous_object1382, _Bool __anonymous_object1383))__setNL__F_P9sofstreamb__1), ((void (*)(void *__anonymous_object1384))__sepOn__F_P9sofstream__1), ((void (*)(void *__anonymous_object1385))__sepOff__F_P9sofstream__1), ((_Bool (*)(void *__anonymous_object1386))__sepDisable__Fb_P9sofstream__1), ((_Bool (*)(void *__anonymous_object1387))__sepEnable__Fb_P9sofstream__1), ((const char *(*)(void *__anonymous_object1388))__sepGet__FPCc_P9sofstream__1), ((void (*)(void *__anonymous_object1389, const char *__anonymous_object1390))__sepSet__F_P9sofstreamPCc__1), ((const char *(*)(void *__anonymous_object1391))__sepGetTuple__FPCc_P9sofstream__1), ((void (*)(void *__anonymous_object1392, const char *__anonymous_object1393))__sepSetTuple__F_P9sofstreamPCc__1), ((signed int (*)(void *__anonymous_object1394))__fail__Fi_P9sofstream__1), ((signed int (*)(void *__anonymous_object1395))__flush__Fi_P9sofstream__1), ((void (*)(void *__os__P7tostype_1, const char *__name__PCc_1, const char *__mode__PCc_1))__open__F_P9sofstreamPCcPCc__1), ((void (*)(void *__os__P7tostype_1))__close__F_P9sofstream__1), ((void *(*)(void *__anonymous_object1396, const char *__anonymous_object1397, unsigned long int __anonymous_object1398))__write__FP9sofstream_P9sofstreamPCcUl__1), ((signed int (*)(void *__anonymous_object1399, const char *__fmt__PCc_1, ...))__fmt__Fi_P9sofstreamPCc__1), ((void *)(((void)(_tmp_cp_ret0=___operator_bitor__A0_1_0_0___sepPrt__PFb_Pd0___sepReset__PF_Pd0___sepReset__PF_Pd0b___sepGetCur__PFPCc_Pd0___sepSetCur__PF_Pd0PCc___getNL__PFb_Pd0___setNL__PF_Pd0b___sepOn__PF_Pd0___sepOff__PF_Pd0___sepDisable__PFb_Pd0___sepEnable__PFb_Pd0___sepGet__PFPCc_Pd0___sepSet__PF_Pd0PCc___sepGetTuple__PFPCc_Pd0___sepSetTuple__PF_Pd0PCc___fail__PFi_Pd0___flush__PFi_Pd0___open__PF_Pd0PCcPCc___close__PF_Pd0___write__PFPd0_Pd0PCcUl___fmt__PFi_Pd0PCc__FPd0_Pd0PCc__1(((_Bool (*)(void *__anonymous_object1400))__sepPrt__Fb_P9sofstream__1), ((void (*)(void *__anonymous_object1401))__sepReset__F_P9sofstream__1), ((void (*)(void *__anonymous_object1402, _Bool __anonymous_object1403))__sepReset__F_P9sofstreamb__1), ((const char *(*)(void *__anonymous_object1404))__sepGetCur__FPCc_P9sofstream__1), ((void (*)(void *__anonymous_object1405, const char *__anonymous_object1406))__sepSetCur__F_P9sofstreamPCc__1), ((_Bool (*)(void *__anonymous_object1407))__getNL__Fb_P9sofstream__1), ((void (*)(void *__anonymous_object1408, _Bool __anonymous_object1409))__setNL__F_P9sofstreamb__1), ((void (*)(void *__anonymous_object1410))__sepOn__F_P9sofstream__1), ((void (*)(void *__anonymous_object1411))__sepOff__F_P9sofstream__1), ((_Bool (*)(void *__anonymous_object1412))__sepDisable__Fb_P9sofstream__1), ((_Bool (*)(void *__anonymous_object1413))__sepEnable__Fb_P9sofstream__1), ((const char *(*)(void *__anonymous_object1414))__sepGet__FPCc_P9sofstream__1), ((void (*)(void *__anonymous_object1415, const char *__anonymous_object1416))__sepSet__F_P9sofstreamPCc__1), ((const char *(*)(void *__anonymous_object1417))__sepGetTuple__FPCc_P9sofstream__1), ((void (*)(void *__anonymous_object1418, const char *__anonymous_object1419))__sepSetTuple__F_P9sofstreamPCc__1), ((signed int (*)(void *__anonymous_object1420))__fail__Fi_P9sofstream__1), ((signed int (*)(void *__anonymous_object1421))__flush__Fi_P9sofstream__1), ((void (*)(void *__os__P7tostype_1, const char *__name__PCc_1, const char *__mode__PCc_1))__open__F_P9sofstreamPCcPCc__1), ((void (*)(void *__os__P7tostype_1))__close__F_P9sofstream__1), ((void *(*)(void *__anonymous_object1422, const char *__anonymous_object1423, unsigned long int __anonymous_object1424))__write__FP9sofstream_P9sofstreamPCcUl__1), ((signed int (*)(void *__anonymous_object1425, const char *__fmt__PCc_1, ...))__fmt__Fi_P9sofstreamPCc__1), ((void *)__sout__P9sofstream_1), "char "))) , _tmp_cp_ret0)), __v__c_1))) , _tmp_cp_ret1)), ((void *(*)(void *__anonymous_object1426))(&_thunk0))))) , _tmp_cp_ret2));
     437        return __endl__A0_1_0_0___sepPrt__PFb_Pd0___sepReset__PF_Pd0___sepReset__PF_Pd0b___sepGetCur__PFPCc_Pd0___sepSetCur__PF_Pd0PCc___getNL__PFb_Pd0___setNL__PF_Pd0b___sepOn__PF_Pd0___sepOff__PF_Pd0___sepDisable__PFb_Pd0___sepEnable__PFb_Pd0___sepGet__PFPCc_Pd0___sepSet__PF_Pd0PCc___sepGetTuple__PFPCc_Pd0___sepSetTuple__PF_Pd0PCc___fail__PFi_Pd0___flush__PFi_Pd0___open__PF_Pd0PCcPCc___close__PF_Pd0___write__PFPd0_Pd0PCcUl___fmt__PFi_Pd0PCc__FPd0_Pd0__1(((_Bool (*)(void *__anonymous_object1322))__sepPrt__Fb_P9sofstream__1), ((void (*)(void *__anonymous_object1323))__sepReset__F_P9sofstream__1), ((void (*)(void *__anonymous_object1324, _Bool __anonymous_object1325))__sepReset__F_P9sofstreamb__1), ((const char *(*)(void *__anonymous_object1326))__sepGetCur__FPCc_P9sofstream__1), ((void (*)(void *__anonymous_object1327, const char *__anonymous_object1328))__sepSetCur__F_P9sofstreamPCc__1), ((_Bool (*)(void *__anonymous_object1329))__getNL__Fb_P9sofstream__1), ((void (*)(void *__anonymous_object1330, _Bool __anonymous_object1331))__setNL__F_P9sofstreamb__1), ((void (*)(void *__anonymous_object1332))__sepOn__F_P9sofstream__1), ((void (*)(void *__anonymous_object1333))__sepOff__F_P9sofstream__1), ((_Bool (*)(void *__anonymous_object1334))__sepDisable__Fb_P9sofstream__1), ((_Bool (*)(void *__anonymous_object1335))__sepEnable__Fb_P9sofstream__1), ((const char *(*)(void *__anonymous_object1336))__sepGet__FPCc_P9sofstream__1), ((void (*)(void *__anonymous_object1337, const char *__anonymous_object1338))__sepSet__F_P9sofstreamPCc__1), ((const char *(*)(void *__anonymous_object1339))__sepGetTuple__FPCc_P9sofstream__1), ((void (*)(void *__anonymous_object1340, const char *__anonymous_object1341))__sepSetTuple__F_P9sofstreamPCc__1), ((signed int (*)(void *__anonymous_object1342))__fail__Fi_P9sofstream__1), ((signed int (*)(void *__anonymous_object1343))__flush__Fi_P9sofstream__1), ((void (*)(void *__os__P7tostype_1, const char *__name__PCc_1, const char *__mode__PCc_1))__open__F_P9sofstreamPCcPCc__1), ((void (*)(void *__os__P7tostype_1))__close__F_P9sofstream__1), ((void *(*)(void *__anonymous_object1344, const char *__anonymous_object1345, unsigned long int __anonymous_object1346))__write__FP9sofstream_P9sofstreamPCcUl__1), ((signed int (*)(void *__anonymous_object1347, const char *__fmt__PCc_1, ...))__fmt__Fi_P9sofstreamPCc__1), _p0);
     438    }
     439    ((void)(((void)(_tmp_cp_ret2=___operator_bitor__A0_1_0_0___sepPrt__PFb_Pd0___sepReset__PF_Pd0___sepReset__PF_Pd0b___sepGetCur__PFPCc_Pd0___sepSetCur__PF_Pd0PCc___getNL__PFb_Pd0___setNL__PF_Pd0b___sepOn__PF_Pd0___sepOff__PF_Pd0___sepDisable__PFb_Pd0___sepEnable__PFb_Pd0___sepGet__PFPCc_Pd0___sepSet__PF_Pd0PCc___sepGetTuple__PFPCc_Pd0___sepSetTuple__PF_Pd0PCc___fail__PFi_Pd0___flush__PFi_Pd0___open__PF_Pd0PCcPCc___close__PF_Pd0___write__PFPd0_Pd0PCcUl___fmt__PFi_Pd0PCc__FPd0_Pd0PFPd0_Pd0___1(((_Bool (*)(void *__anonymous_object1348))__sepPrt__Fb_P9sofstream__1), ((void (*)(void *__anonymous_object1349))__sepReset__F_P9sofstream__1), ((void (*)(void *__anonymous_object1350, _Bool __anonymous_object1351))__sepReset__F_P9sofstreamb__1), ((const char *(*)(void *__anonymous_object1352))__sepGetCur__FPCc_P9sofstream__1), ((void (*)(void *__anonymous_object1353, const char *__anonymous_object1354))__sepSetCur__F_P9sofstreamPCc__1), ((_Bool (*)(void *__anonymous_object1355))__getNL__Fb_P9sofstream__1), ((void (*)(void *__anonymous_object1356, _Bool __anonymous_object1357))__setNL__F_P9sofstreamb__1), ((void (*)(void *__anonymous_object1358))__sepOn__F_P9sofstream__1), ((void (*)(void *__anonymous_object1359))__sepOff__F_P9sofstream__1), ((_Bool (*)(void *__anonymous_object1360))__sepDisable__Fb_P9sofstream__1), ((_Bool (*)(void *__anonymous_object1361))__sepEnable__Fb_P9sofstream__1), ((const char *(*)(void *__anonymous_object1362))__sepGet__FPCc_P9sofstream__1), ((void (*)(void *__anonymous_object1363, const char *__anonymous_object1364))__sepSet__F_P9sofstreamPCc__1), ((const char *(*)(void *__anonymous_object1365))__sepGetTuple__FPCc_P9sofstream__1), ((void (*)(void *__anonymous_object1366, const char *__anonymous_object1367))__sepSetTuple__F_P9sofstreamPCc__1), ((signed int (*)(void *__anonymous_object1368))__fail__Fi_P9sofstream__1), ((signed int (*)(void *__anonymous_object1369))__flush__Fi_P9sofstream__1), ((void (*)(void *__os__P7tostype_1, const char *__name__PCc_1, const char *__mode__PCc_1))__open__F_P9sofstreamPCcPCc__1), ((void (*)(void *__os__P7tostype_1))__close__F_P9sofstream__1), ((void *(*)(void *__anonymous_object1370, const char *__anonymous_object1371, unsigned long int __anonymous_object1372))__write__FP9sofstream_P9sofstreamPCcUl__1), ((signed int (*)(void *__anonymous_object1373, const char *__fmt__PCc_1, ...))__fmt__Fi_P9sofstreamPCc__1), (((void)(_tmp_cp_ret1=___operator_bitor__A0_1_0_0___sepPrt__PFb_Pd0___sepReset__PF_Pd0___sepReset__PF_Pd0b___sepGetCur__PFPCc_Pd0___sepSetCur__PF_Pd0PCc___getNL__PFb_Pd0___setNL__PF_Pd0b___sepOn__PF_Pd0___sepOff__PF_Pd0___sepDisable__PFb_Pd0___sepEnable__PFb_Pd0___sepGet__PFPCc_Pd0___sepSet__PF_Pd0PCc___sepGetTuple__PFPCc_Pd0___sepSetTuple__PF_Pd0PCc___fail__PFi_Pd0___flush__PFi_Pd0___open__PF_Pd0PCcPCc___close__PF_Pd0___write__PFPd0_Pd0PCcUl___fmt__PFi_Pd0PCc__FPd0_Pd0c__1(((_Bool (*)(void *__anonymous_object1374))__sepPrt__Fb_P9sofstream__1), ((void (*)(void *__anonymous_object1375))__sepReset__F_P9sofstream__1), ((void (*)(void *__anonymous_object1376, _Bool __anonymous_object1377))__sepReset__F_P9sofstreamb__1), ((const char *(*)(void *__anonymous_object1378))__sepGetCur__FPCc_P9sofstream__1), ((void (*)(void *__anonymous_object1379, const char *__anonymous_object1380))__sepSetCur__F_P9sofstreamPCc__1), ((_Bool (*)(void *__anonymous_object1381))__getNL__Fb_P9sofstream__1), ((void (*)(void *__anonymous_object1382, _Bool __anonymous_object1383))__setNL__F_P9sofstreamb__1), ((void (*)(void *__anonymous_object1384))__sepOn__F_P9sofstream__1), ((void (*)(void *__anonymous_object1385))__sepOff__F_P9sofstream__1), ((_Bool (*)(void *__anonymous_object1386))__sepDisable__Fb_P9sofstream__1), ((_Bool (*)(void *__anonymous_object1387))__sepEnable__Fb_P9sofstream__1), ((const char *(*)(void *__anonymous_object1388))__sepGet__FPCc_P9sofstream__1), ((void (*)(void *__anonymous_object1389, const char *__anonymous_object1390))__sepSet__F_P9sofstreamPCc__1), ((const char *(*)(void *__anonymous_object1391))__sepGetTuple__FPCc_P9sofstream__1), ((void (*)(void *__anonymous_object1392, const char *__anonymous_object1393))__sepSetTuple__F_P9sofstreamPCc__1), ((signed int (*)(void *__anonymous_object1394))__fail__Fi_P9sofstream__1), ((signed int (*)(void *__anonymous_object1395))__flush__Fi_P9sofstream__1), ((void (*)(void *__os__P7tostype_1, const char *__name__PCc_1, const char *__mode__PCc_1))__open__F_P9sofstreamPCcPCc__1), ((void (*)(void *__os__P7tostype_1))__close__F_P9sofstream__1), ((void *(*)(void *__anonymous_object1396, const char *__anonymous_object1397, unsigned long int __anonymous_object1398))__write__FP9sofstream_P9sofstreamPCcUl__1), ((signed int (*)(void *__anonymous_object1399, const char *__fmt__PCc_1, ...))__fmt__Fi_P9sofstreamPCc__1), (((void)(_tmp_cp_ret0=___operator_bitor__A0_1_0_0___sepPrt__PFb_Pd0___sepReset__PF_Pd0___sepReset__PF_Pd0b___sepGetCur__PFPCc_Pd0___sepSetCur__PF_Pd0PCc___getNL__PFb_Pd0___setNL__PF_Pd0b___sepOn__PF_Pd0___sepOff__PF_Pd0___sepDisable__PFb_Pd0___sepEnable__PFb_Pd0___sepGet__PFPCc_Pd0___sepSet__PF_Pd0PCc___sepGetTuple__PFPCc_Pd0___sepSetTuple__PF_Pd0PCc___fail__PFi_Pd0___flush__PFi_Pd0___open__PF_Pd0PCcPCc___close__PF_Pd0___write__PFPd0_Pd0PCcUl___fmt__PFi_Pd0PCc__FPd0_Pd0PCc__1(((_Bool (*)(void *__anonymous_object1400))__sepPrt__Fb_P9sofstream__1), ((void (*)(void *__anonymous_object1401))__sepReset__F_P9sofstream__1), ((void (*)(void *__anonymous_object1402, _Bool __anonymous_object1403))__sepReset__F_P9sofstreamb__1), ((const char *(*)(void *__anonymous_object1404))__sepGetCur__FPCc_P9sofstream__1), ((void (*)(void *__anonymous_object1405, const char *__anonymous_object1406))__sepSetCur__F_P9sofstreamPCc__1), ((_Bool (*)(void *__anonymous_object1407))__getNL__Fb_P9sofstream__1), ((void (*)(void *__anonymous_object1408, _Bool __anonymous_object1409))__setNL__F_P9sofstreamb__1), ((void (*)(void *__anonymous_object1410))__sepOn__F_P9sofstream__1), ((void (*)(void *__anonymous_object1411))__sepOff__F_P9sofstream__1), ((_Bool (*)(void *__anonymous_object1412))__sepDisable__Fb_P9sofstream__1), ((_Bool (*)(void *__anonymous_object1413))__sepEnable__Fb_P9sofstream__1), ((const char *(*)(void *__anonymous_object1414))__sepGet__FPCc_P9sofstream__1), ((void (*)(void *__anonymous_object1415, const char *__anonymous_object1416))__sepSet__F_P9sofstreamPCc__1), ((const char *(*)(void *__anonymous_object1417))__sepGetTuple__FPCc_P9sofstream__1), ((void (*)(void *__anonymous_object1418, const char *__anonymous_object1419))__sepSetTuple__F_P9sofstreamPCc__1), ((signed int (*)(void *__anonymous_object1420))__fail__Fi_P9sofstream__1), ((signed int (*)(void *__anonymous_object1421))__flush__Fi_P9sofstream__1), ((void (*)(void *__os__P7tostype_1, const char *__name__PCc_1, const char *__mode__PCc_1))__open__F_P9sofstreamPCcPCc__1), ((void (*)(void *__os__P7tostype_1))__close__F_P9sofstream__1), ((void *(*)(void *__anonymous_object1422, const char *__anonymous_object1423, unsigned long int __anonymous_object1424))__write__FP9sofstream_P9sofstreamPCcUl__1), ((signed int (*)(void *__anonymous_object1425, const char *__fmt__PCc_1, ...))__fmt__Fi_P9sofstreamPCc__1), __sout__P9sofstream_1, "char "))) , _tmp_cp_ret0), __v__c_1))) , _tmp_cp_ret1), ((void *(*)(void *__anonymous_object1426))(&_thunk0))))) , _tmp_cp_ret2));
    471440    ((void)(_tmp_cp_ret0) /* ^?{} */);
    472441    ((void)(_tmp_cp_ret1) /* ^?{} */);
     
    478447    struct ofstream *_tmp_cp_ret5;
    479448    __attribute__ ((unused)) struct ofstream *_thunk1(struct ofstream *_p0){
    480         return __endl__A0_1_0_0___sepPrt__PFb_Pd0___sepReset__PF_Pd0___sepReset__PF_Pd0b___sepGetCur__PFPCc_Pd0___sepSetCur__PF_Pd0PCc___getNL__PFb_Pd0___setNL__PF_Pd0b___sepOn__PF_Pd0___sepOff__PF_Pd0___sepDisable__PFb_Pd0___sepEnable__PFb_Pd0___sepGet__PFPCc_Pd0___sepSet__PF_Pd0PCc___sepGetTuple__PFPCc_Pd0___sepSetTuple__PF_Pd0PCc___fail__PFi_Pd0___flush__PFi_Pd0___open__PF_Pd0PCcPCc___close__PF_Pd0___write__PFPd0_Pd0PCcUl___fmt__PFi_Pd0PCc__FPd0_Pd0__1(((_Bool (*)(void *__anonymous_object1427))__sepPrt__Fb_P9sofstream__1), ((void (*)(void *__anonymous_object1428))__sepReset__F_P9sofstream__1), ((void (*)(void *__anonymous_object1429, _Bool __anonymous_object1430))__sepReset__F_P9sofstreamb__1), ((const char *(*)(void *__anonymous_object1431))__sepGetCur__FPCc_P9sofstream__1), ((void (*)(void *__anonymous_object1432, const char *__anonymous_object1433))__sepSetCur__F_P9sofstreamPCc__1), ((_Bool (*)(void *__anonymous_object1434))__getNL__Fb_P9sofstream__1), ((void (*)(void *__anonymous_object1435, _Bool __anonymous_object1436))__setNL__F_P9sofstreamb__1), ((void (*)(void *__anonymous_object1437))__sepOn__F_P9sofstream__1), ((void (*)(void *__anonymous_object1438))__sepOff__F_P9sofstream__1), ((_Bool (*)(void *__anonymous_object1439))__sepDisable__Fb_P9sofstream__1), ((_Bool (*)(void *__anonymous_object1440))__sepEnable__Fb_P9sofstream__1), ((const char *(*)(void *__anonymous_object1441))__sepGet__FPCc_P9sofstream__1), ((void (*)(void *__anonymous_object1442, const char *__anonymous_object1443))__sepSet__F_P9sofstreamPCc__1), ((const char *(*)(void *__anonymous_object1444))__sepGetTuple__FPCc_P9sofstream__1), ((void (*)(void *__anonymous_object1445, const char *__anonymous_object1446))__sepSetTuple__F_P9sofstreamPCc__1), ((signed int (*)(void *__anonymous_object1447))__fail__Fi_P9sofstream__1), ((signed int (*)(void *__anonymous_object1448))__flush__Fi_P9sofstream__1), ((void (*)(void *__os__P7tostype_1, const char *__name__PCc_1, const char *__mode__PCc_1))__open__F_P9sofstreamPCcPCc__1), ((void (*)(void *__os__P7tostype_1))__close__F_P9sofstream__1), ((void *(*)(void *__anonymous_object1449, const char *__anonymous_object1450, unsigned long int __anonymous_object1451))__write__FP9sofstream_P9sofstreamPCcUl__1), ((signed int (*)(void *__anonymous_object1452, const char *__fmt__PCc_1, ...))__fmt__Fi_P9sofstreamPCc__1), ((void *)_p0));
    481     }
    482     ((void)(((void)(_tmp_cp_ret5=___operator_bitor__A0_1_0_0___sepPrt__PFb_Pd0___sepReset__PF_Pd0___sepReset__PF_Pd0b___sepGetCur__PFPCc_Pd0___sepSetCur__PF_Pd0PCc___getNL__PFb_Pd0___setNL__PF_Pd0b___sepOn__PF_Pd0___sepOff__PF_Pd0___sepDisable__PFb_Pd0___sepEnable__PFb_Pd0___sepGet__PFPCc_Pd0___sepSet__PF_Pd0PCc___sepGetTuple__PFPCc_Pd0___sepSetTuple__PF_Pd0PCc___fail__PFi_Pd0___flush__PFi_Pd0___open__PF_Pd0PCcPCc___close__PF_Pd0___write__PFPd0_Pd0PCcUl___fmt__PFi_Pd0PCc__FPd0_Pd0PFPd0_Pd0___1(((_Bool (*)(void *__anonymous_object1453))__sepPrt__Fb_P9sofstream__1), ((void (*)(void *__anonymous_object1454))__sepReset__F_P9sofstream__1), ((void (*)(void *__anonymous_object1455, _Bool __anonymous_object1456))__sepReset__F_P9sofstreamb__1), ((const char *(*)(void *__anonymous_object1457))__sepGetCur__FPCc_P9sofstream__1), ((void (*)(void *__anonymous_object1458, const char *__anonymous_object1459))__sepSetCur__F_P9sofstreamPCc__1), ((_Bool (*)(void *__anonymous_object1460))__getNL__Fb_P9sofstream__1), ((void (*)(void *__anonymous_object1461, _Bool __anonymous_object1462))__setNL__F_P9sofstreamb__1), ((void (*)(void *__anonymous_object1463))__sepOn__F_P9sofstream__1), ((void (*)(void *__anonymous_object1464))__sepOff__F_P9sofstream__1), ((_Bool (*)(void *__anonymous_object1465))__sepDisable__Fb_P9sofstream__1), ((_Bool (*)(void *__anonymous_object1466))__sepEnable__Fb_P9sofstream__1), ((const char *(*)(void *__anonymous_object1467))__sepGet__FPCc_P9sofstream__1), ((void (*)(void *__anonymous_object1468, const char *__anonymous_object1469))__sepSet__F_P9sofstreamPCc__1), ((const char *(*)(void *__anonymous_object1470))__sepGetTuple__FPCc_P9sofstream__1), ((void (*)(void *__anonymous_object1471, const char *__anonymous_object1472))__sepSetTuple__F_P9sofstreamPCc__1), ((signed int (*)(void *__anonymous_object1473))__fail__Fi_P9sofstream__1), ((signed int (*)(void *__anonymous_object1474))__flush__Fi_P9sofstream__1), ((void (*)(void *__os__P7tostype_1, const char *__name__PCc_1, const char *__mode__PCc_1))__open__F_P9sofstreamPCcPCc__1), ((void (*)(void *__os__P7tostype_1))__close__F_P9sofstream__1), ((void *(*)(void *__anonymous_object1475, const char *__anonymous_object1476, unsigned long int __anonymous_object1477))__write__FP9sofstream_P9sofstreamPCcUl__1), ((signed int (*)(void *__anonymous_object1478, const char *__fmt__PCc_1, ...))__fmt__Fi_P9sofstreamPCc__1), ((void *)(((void)(_tmp_cp_ret4=___operator_bitor__A0_1_0_0___sepPrt__PFb_Pd0___sepReset__PF_Pd0___sepReset__PF_Pd0b___sepGetCur__PFPCc_Pd0___sepSetCur__PF_Pd0PCc___getNL__PFb_Pd0___setNL__PF_Pd0b___sepOn__PF_Pd0___sepOff__PF_Pd0___sepDisable__PFb_Pd0___sepEnable__PFb_Pd0___sepGet__PFPCc_Pd0___sepSet__PF_Pd0PCc___sepGetTuple__PFPCc_Pd0___sepSetTuple__PF_Pd0PCc___fail__PFi_Pd0___flush__PFi_Pd0___open__PF_Pd0PCcPCc___close__PF_Pd0___write__PFPd0_Pd0PCcUl___fmt__PFi_Pd0PCc__FPd0_Pd0Sc__1(((_Bool (*)(void *__anonymous_object1479))__sepPrt__Fb_P9sofstream__1), ((void (*)(void *__anonymous_object1480))__sepReset__F_P9sofstream__1), ((void (*)(void *__anonymous_object1481, _Bool __anonymous_object1482))__sepReset__F_P9sofstreamb__1), ((const char *(*)(void *__anonymous_object1483))__sepGetCur__FPCc_P9sofstream__1), ((void (*)(void *__anonymous_object1484, const char *__anonymous_object1485))__sepSetCur__F_P9sofstreamPCc__1), ((_Bool (*)(void *__anonymous_object1486))__getNL__Fb_P9sofstream__1), ((void (*)(void *__anonymous_object1487, _Bool __anonymous_object1488))__setNL__F_P9sofstreamb__1), ((void (*)(void *__anonymous_object1489))__sepOn__F_P9sofstream__1), ((void (*)(void *__anonymous_object1490))__sepOff__F_P9sofstream__1), ((_Bool (*)(void *__anonymous_object1491))__sepDisable__Fb_P9sofstream__1), ((_Bool (*)(void *__anonymous_object1492))__sepEnable__Fb_P9sofstream__1), ((const char *(*)(void *__anonymous_object1493))__sepGet__FPCc_P9sofstream__1), ((void (*)(void *__anonymous_object1494, const char *__anonymous_object1495))__sepSet__F_P9sofstreamPCc__1), ((const char *(*)(void *__anonymous_object1496))__sepGetTuple__FPCc_P9sofstream__1), ((void (*)(void *__anonymous_object1497, const char *__anonymous_object1498))__sepSetTuple__F_P9sofstreamPCc__1), ((signed int (*)(void *__anonymous_object1499))__fail__Fi_P9sofstream__1), ((signed int (*)(void *__anonymous_object1500))__flush__Fi_P9sofstream__1), ((void (*)(void *__os__P7tostype_1, const char *__name__PCc_1, const char *__mode__PCc_1))__open__F_P9sofstreamPCcPCc__1), ((void (*)(void *__os__P7tostype_1))__close__F_P9sofstream__1), ((void *(*)(void *__anonymous_object1501, const char *__anonymous_object1502, unsigned long int __anonymous_object1503))__write__FP9sofstream_P9sofstreamPCcUl__1), ((signed int (*)(void *__anonymous_object1504, const char *__fmt__PCc_1, ...))__fmt__Fi_P9sofstreamPCc__1), ((void *)(((void)(_tmp_cp_ret3=___operator_bitor__A0_1_0_0___sepPrt__PFb_Pd0___sepReset__PF_Pd0___sepReset__PF_Pd0b___sepGetCur__PFPCc_Pd0___sepSetCur__PF_Pd0PCc___getNL__PFb_Pd0___setNL__PF_Pd0b___sepOn__PF_Pd0___sepOff__PF_Pd0___sepDisable__PFb_Pd0___sepEnable__PFb_Pd0___sepGet__PFPCc_Pd0___sepSet__PF_Pd0PCc___sepGetTuple__PFPCc_Pd0___sepSetTuple__PF_Pd0PCc___fail__PFi_Pd0___flush__PFi_Pd0___open__PF_Pd0PCcPCc___close__PF_Pd0___write__PFPd0_Pd0PCcUl___fmt__PFi_Pd0PCc__FPd0_Pd0PCc__1(((_Bool (*)(void *__anonymous_object1505))__sepPrt__Fb_P9sofstream__1), ((void (*)(void *__anonymous_object1506))__sepReset__F_P9sofstream__1), ((void (*)(void *__anonymous_object1507, _Bool __anonymous_object1508))__sepReset__F_P9sofstreamb__1), ((const char *(*)(void *__anonymous_object1509))__sepGetCur__FPCc_P9sofstream__1), ((void (*)(void *__anonymous_object1510, const char *__anonymous_object1511))__sepSetCur__F_P9sofstreamPCc__1), ((_Bool (*)(void *__anonymous_object1512))__getNL__Fb_P9sofstream__1), ((void (*)(void *__anonymous_object1513, _Bool __anonymous_object1514))__setNL__F_P9sofstreamb__1), ((void (*)(void *__anonymous_object1515))__sepOn__F_P9sofstream__1), ((void (*)(void *__anonymous_object1516))__sepOff__F_P9sofstream__1), ((_Bool (*)(void *__anonymous_object1517))__sepDisable__Fb_P9sofstream__1), ((_Bool (*)(void *__anonymous_object1518))__sepEnable__Fb_P9sofstream__1), ((const char *(*)(void *__anonymous_object1519))__sepGet__FPCc_P9sofstream__1), ((void (*)(void *__anonymous_object1520, const char *__anonymous_object1521))__sepSet__F_P9sofstreamPCc__1), ((const char *(*)(void *__anonymous_object1522))__sepGetTuple__FPCc_P9sofstream__1), ((void (*)(void *__anonymous_object1523, const char *__anonymous_object1524))__sepSetTuple__F_P9sofstreamPCc__1), ((signed int (*)(void *__anonymous_object1525))__fail__Fi_P9sofstream__1), ((signed int (*)(void *__anonymous_object1526))__flush__Fi_P9sofstream__1), ((void (*)(void *__os__P7tostype_1, const char *__name__PCc_1, const char *__mode__PCc_1))__open__F_P9sofstreamPCcPCc__1), ((void (*)(void *__os__P7tostype_1))__close__F_P9sofstream__1), ((void *(*)(void *__anonymous_object1527, const char *__anonymous_object1528, unsigned long int __anonymous_object1529))__write__FP9sofstream_P9sofstreamPCcUl__1), ((signed int (*)(void *__anonymous_object1530, const char *__fmt__PCc_1, ...))__fmt__Fi_P9sofstreamPCc__1), ((void *)__sout__P9sofstream_1), "signed char "))) , _tmp_cp_ret3)), __v__Sc_1))) , _tmp_cp_ret4)), ((void *(*)(void *__anonymous_object1531))(&_thunk1))))) , _tmp_cp_ret5));
     449        return __endl__A0_1_0_0___sepPrt__PFb_Pd0___sepReset__PF_Pd0___sepReset__PF_Pd0b___sepGetCur__PFPCc_Pd0___sepSetCur__PF_Pd0PCc___getNL__PFb_Pd0___setNL__PF_Pd0b___sepOn__PF_Pd0___sepOff__PF_Pd0___sepDisable__PFb_Pd0___sepEnable__PFb_Pd0___sepGet__PFPCc_Pd0___sepSet__PF_Pd0PCc___sepGetTuple__PFPCc_Pd0___sepSetTuple__PF_Pd0PCc___fail__PFi_Pd0___flush__PFi_Pd0___open__PF_Pd0PCcPCc___close__PF_Pd0___write__PFPd0_Pd0PCcUl___fmt__PFi_Pd0PCc__FPd0_Pd0__1(((_Bool (*)(void *__anonymous_object1427))__sepPrt__Fb_P9sofstream__1), ((void (*)(void *__anonymous_object1428))__sepReset__F_P9sofstream__1), ((void (*)(void *__anonymous_object1429, _Bool __anonymous_object1430))__sepReset__F_P9sofstreamb__1), ((const char *(*)(void *__anonymous_object1431))__sepGetCur__FPCc_P9sofstream__1), ((void (*)(void *__anonymous_object1432, const char *__anonymous_object1433))__sepSetCur__F_P9sofstreamPCc__1), ((_Bool (*)(void *__anonymous_object1434))__getNL__Fb_P9sofstream__1), ((void (*)(void *__anonymous_object1435, _Bool __anonymous_object1436))__setNL__F_P9sofstreamb__1), ((void (*)(void *__anonymous_object1437))__sepOn__F_P9sofstream__1), ((void (*)(void *__anonymous_object1438))__sepOff__F_P9sofstream__1), ((_Bool (*)(void *__anonymous_object1439))__sepDisable__Fb_P9sofstream__1), ((_Bool (*)(void *__anonymous_object1440))__sepEnable__Fb_P9sofstream__1), ((const char *(*)(void *__anonymous_object1441))__sepGet__FPCc_P9sofstream__1), ((void (*)(void *__anonymous_object1442, const char *__anonymous_object1443))__sepSet__F_P9sofstreamPCc__1), ((const char *(*)(void *__anonymous_object1444))__sepGetTuple__FPCc_P9sofstream__1), ((void (*)(void *__anonymous_object1445, const char *__anonymous_object1446))__sepSetTuple__F_P9sofstreamPCc__1), ((signed int (*)(void *__anonymous_object1447))__fail__Fi_P9sofstream__1), ((signed int (*)(void *__anonymous_object1448))__flush__Fi_P9sofstream__1), ((void (*)(void *__os__P7tostype_1, const char *__name__PCc_1, const char *__mode__PCc_1))__open__F_P9sofstreamPCcPCc__1), ((void (*)(void *__os__P7tostype_1))__close__F_P9sofstream__1), ((void *(*)(void *__anonymous_object1449, const char *__anonymous_object1450, unsigned long int __anonymous_object1451))__write__FP9sofstream_P9sofstreamPCcUl__1), ((signed int (*)(void *__anonymous_object1452, const char *__fmt__PCc_1, ...))__fmt__Fi_P9sofstreamPCc__1), _p0);
     450    }
     451    ((void)(((void)(_tmp_cp_ret5=___operator_bitor__A0_1_0_0___sepPrt__PFb_Pd0___sepReset__PF_Pd0___sepReset__PF_Pd0b___sepGetCur__PFPCc_Pd0___sepSetCur__PF_Pd0PCc___getNL__PFb_Pd0___setNL__PF_Pd0b___sepOn__PF_Pd0___sepOff__PF_Pd0___sepDisable__PFb_Pd0___sepEnable__PFb_Pd0___sepGet__PFPCc_Pd0___sepSet__PF_Pd0PCc___sepGetTuple__PFPCc_Pd0___sepSetTuple__PF_Pd0PCc___fail__PFi_Pd0___flush__PFi_Pd0___open__PF_Pd0PCcPCc___close__PF_Pd0___write__PFPd0_Pd0PCcUl___fmt__PFi_Pd0PCc__FPd0_Pd0PFPd0_Pd0___1(((_Bool (*)(void *__anonymous_object1453))__sepPrt__Fb_P9sofstream__1), ((void (*)(void *__anonymous_object1454))__sepReset__F_P9sofstream__1), ((void (*)(void *__anonymous_object1455, _Bool __anonymous_object1456))__sepReset__F_P9sofstreamb__1), ((const char *(*)(void *__anonymous_object1457))__sepGetCur__FPCc_P9sofstream__1), ((void (*)(void *__anonymous_object1458, const char *__anonymous_object1459))__sepSetCur__F_P9sofstreamPCc__1), ((_Bool (*)(void *__anonymous_object1460))__getNL__Fb_P9sofstream__1), ((void (*)(void *__anonymous_object1461, _Bool __anonymous_object1462))__setNL__F_P9sofstreamb__1), ((void (*)(void *__anonymous_object1463))__sepOn__F_P9sofstream__1), ((void (*)(void *__anonymous_object1464))__sepOff__F_P9sofstream__1), ((_Bool (*)(void *__anonymous_object1465))__sepDisable__Fb_P9sofstream__1), ((_Bool (*)(void *__anonymous_object1466))__sepEnable__Fb_P9sofstream__1), ((const char *(*)(void *__anonymous_object1467))__sepGet__FPCc_P9sofstream__1), ((void (*)(void *__anonymous_object1468, const char *__anonymous_object1469))__sepSet__F_P9sofstreamPCc__1), ((const char *(*)(void *__anonymous_object1470))__sepGetTuple__FPCc_P9sofstream__1), ((void (*)(void *__anonymous_object1471, const char *__anonymous_object1472))__sepSetTuple__F_P9sofstreamPCc__1), ((signed int (*)(void *__anonymous_object1473))__fail__Fi_P9sofstream__1), ((signed int (*)(void *__anonymous_object1474))__flush__Fi_P9sofstream__1), ((void (*)(void *__os__P7tostype_1, const char *__name__PCc_1, const char *__mode__PCc_1))__open__F_P9sofstreamPCcPCc__1), ((void (*)(void *__os__P7tostype_1))__close__F_P9sofstream__1), ((void *(*)(void *__anonymous_object1475, const char *__anonymous_object1476, unsigned long int __anonymous_object1477))__write__FP9sofstream_P9sofstreamPCcUl__1), ((signed int (*)(void *__anonymous_object1478, const char *__fmt__PCc_1, ...))__fmt__Fi_P9sofstreamPCc__1), (((void)(_tmp_cp_ret4=___operator_bitor__A0_1_0_0___sepPrt__PFb_Pd0___sepReset__PF_Pd0___sepReset__PF_Pd0b___sepGetCur__PFPCc_Pd0___sepSetCur__PF_Pd0PCc___getNL__PFb_Pd0___setNL__PF_Pd0b___sepOn__PF_Pd0___sepOff__PF_Pd0___sepDisable__PFb_Pd0___sepEnable__PFb_Pd0___sepGet__PFPCc_Pd0___sepSet__PF_Pd0PCc___sepGetTuple__PFPCc_Pd0___sepSetTuple__PF_Pd0PCc___fail__PFi_Pd0___flush__PFi_Pd0___open__PF_Pd0PCcPCc___close__PF_Pd0___write__PFPd0_Pd0PCcUl___fmt__PFi_Pd0PCc__FPd0_Pd0Sc__1(((_Bool (*)(void *__anonymous_object1479))__sepPrt__Fb_P9sofstream__1), ((void (*)(void *__anonymous_object1480))__sepReset__F_P9sofstream__1), ((void (*)(void *__anonymous_object1481, _Bool __anonymous_object1482))__sepReset__F_P9sofstreamb__1), ((const char *(*)(void *__anonymous_object1483))__sepGetCur__FPCc_P9sofstream__1), ((void (*)(void *__anonymous_object1484, const char *__anonymous_object1485))__sepSetCur__F_P9sofstreamPCc__1), ((_Bool (*)(void *__anonymous_object1486))__getNL__Fb_P9sofstream__1), ((void (*)(void *__anonymous_object1487, _Bool __anonymous_object1488))__setNL__F_P9sofstreamb__1), ((void (*)(void *__anonymous_object1489))__sepOn__F_P9sofstream__1), ((void (*)(void *__anonymous_object1490))__sepOff__F_P9sofstream__1), ((_Bool (*)(void *__anonymous_object1491))__sepDisable__Fb_P9sofstream__1), ((_Bool (*)(void *__anonymous_object1492))__sepEnable__Fb_P9sofstream__1), ((const char *(*)(void *__anonymous_object1493))__sepGet__FPCc_P9sofstream__1), ((void (*)(void *__anonymous_object1494, const char *__anonymous_object1495))__sepSet__F_P9sofstreamPCc__1), ((const char *(*)(void *__anonymous_object1496))__sepGetTuple__FPCc_P9sofstream__1), ((void (*)(void *__anonymous_object1497, const char *__anonymous_object1498))__sepSetTuple__F_P9sofstreamPCc__1), ((signed int (*)(void *__anonymous_object1499))__fail__Fi_P9sofstream__1), ((signed int (*)(void *__anonymous_object1500))__flush__Fi_P9sofstream__1), ((void (*)(void *__os__P7tostype_1, const char *__name__PCc_1, const char *__mode__PCc_1))__open__F_P9sofstreamPCcPCc__1), ((void (*)(void *__os__P7tostype_1))__close__F_P9sofstream__1), ((void *(*)(void *__anonymous_object1501, const char *__anonymous_object1502, unsigned long int __anonymous_object1503))__write__FP9sofstream_P9sofstreamPCcUl__1), ((signed int (*)(void *__anonymous_object1504, const char *__fmt__PCc_1, ...))__fmt__Fi_P9sofstreamPCc__1), (((void)(_tmp_cp_ret3=___operator_bitor__A0_1_0_0___sepPrt__PFb_Pd0___sepReset__PF_Pd0___sepReset__PF_Pd0b___sepGetCur__PFPCc_Pd0___sepSetCur__PF_Pd0PCc___getNL__PFb_Pd0___setNL__PF_Pd0b___sepOn__PF_Pd0___sepOff__PF_Pd0___sepDisable__PFb_Pd0___sepEnable__PFb_Pd0___sepGet__PFPCc_Pd0___sepSet__PF_Pd0PCc___sepGetTuple__PFPCc_Pd0___sepSetTuple__PF_Pd0PCc___fail__PFi_Pd0___flush__PFi_Pd0___open__PF_Pd0PCcPCc___close__PF_Pd0___write__PFPd0_Pd0PCcUl___fmt__PFi_Pd0PCc__FPd0_Pd0PCc__1(((_Bool (*)(void *__anonymous_object1505))__sepPrt__Fb_P9sofstream__1), ((void (*)(void *__anonymous_object1506))__sepReset__F_P9sofstream__1), ((void (*)(void *__anonymous_object1507, _Bool __anonymous_object1508))__sepReset__F_P9sofstreamb__1), ((const char *(*)(void *__anonymous_object1509))__sepGetCur__FPCc_P9sofstream__1), ((void (*)(void *__anonymous_object1510, const char *__anonymous_object1511))__sepSetCur__F_P9sofstreamPCc__1), ((_Bool (*)(void *__anonymous_object1512))__getNL__Fb_P9sofstream__1), ((void (*)(void *__anonymous_object1513, _Bool __anonymous_object1514))__setNL__F_P9sofstreamb__1), ((void (*)(void *__anonymous_object1515))__sepOn__F_P9sofstream__1), ((void (*)(void *__anonymous_object1516))__sepOff__F_P9sofstream__1), ((_Bool (*)(void *__anonymous_object1517))__sepDisable__Fb_P9sofstream__1), ((_Bool (*)(void *__anonymous_object1518))__sepEnable__Fb_P9sofstream__1), ((const char *(*)(void *__anonymous_object1519))__sepGet__FPCc_P9sofstream__1), ((void (*)(void *__anonymous_object1520, const char *__anonymous_object1521))__sepSet__F_P9sofstreamPCc__1), ((const char *(*)(void *__anonymous_object1522))__sepGetTuple__FPCc_P9sofstream__1), ((void (*)(void *__anonymous_object1523, const char *__anonymous_object1524))__sepSetTuple__F_P9sofstreamPCc__1), ((signed int (*)(void *__anonymous_object1525))__fail__Fi_P9sofstream__1), ((signed int (*)(void *__anonymous_object1526))__flush__Fi_P9sofstream__1), ((void (*)(void *__os__P7tostype_1, const char *__name__PCc_1, const char *__mode__PCc_1))__open__F_P9sofstreamPCcPCc__1), ((void (*)(void *__os__P7tostype_1))__close__F_P9sofstream__1), ((void *(*)(void *__anonymous_object1527, const char *__anonymous_object1528, unsigned long int __anonymous_object1529))__write__FP9sofstream_P9sofstreamPCcUl__1), ((signed int (*)(void *__anonymous_object1530, const char *__fmt__PCc_1, ...))__fmt__Fi_P9sofstreamPCc__1), __sout__P9sofstream_1, "signed char "))) , _tmp_cp_ret3), __v__Sc_1))) , _tmp_cp_ret4), ((void *(*)(void *__anonymous_object1531))(&_thunk1))))) , _tmp_cp_ret5));
    483452    ((void)(_tmp_cp_ret3) /* ^?{} */);
    484453    ((void)(_tmp_cp_ret4) /* ^?{} */);
     
    490459    struct ofstream *_tmp_cp_ret8;
    491460    __attribute__ ((unused)) struct ofstream *_thunk2(struct ofstream *_p0){
    492         return __endl__A0_1_0_0___sepPrt__PFb_Pd0___sepReset__PF_Pd0___sepReset__PF_Pd0b___sepGetCur__PFPCc_Pd0___sepSetCur__PF_Pd0PCc___getNL__PFb_Pd0___setNL__PF_Pd0b___sepOn__PF_Pd0___sepOff__PF_Pd0___sepDisable__PFb_Pd0___sepEnable__PFb_Pd0___sepGet__PFPCc_Pd0___sepSet__PF_Pd0PCc___sepGetTuple__PFPCc_Pd0___sepSetTuple__PF_Pd0PCc___fail__PFi_Pd0___flush__PFi_Pd0___open__PF_Pd0PCcPCc___close__PF_Pd0___write__PFPd0_Pd0PCcUl___fmt__PFi_Pd0PCc__FPd0_Pd0__1(((_Bool (*)(void *__anonymous_object1532))__sepPrt__Fb_P9sofstream__1), ((void (*)(void *__anonymous_object1533))__sepReset__F_P9sofstream__1), ((void (*)(void *__anonymous_object1534, _Bool __anonymous_object1535))__sepReset__F_P9sofstreamb__1), ((const char *(*)(void *__anonymous_object1536))__sepGetCur__FPCc_P9sofstream__1), ((void (*)(void *__anonymous_object1537, const char *__anonymous_object1538))__sepSetCur__F_P9sofstreamPCc__1), ((_Bool (*)(void *__anonymous_object1539))__getNL__Fb_P9sofstream__1), ((void (*)(void *__anonymous_object1540, _Bool __anonymous_object1541))__setNL__F_P9sofstreamb__1), ((void (*)(void *__anonymous_object1542))__sepOn__F_P9sofstream__1), ((void (*)(void *__anonymous_object1543))__sepOff__F_P9sofstream__1), ((_Bool (*)(void *__anonymous_object1544))__sepDisable__Fb_P9sofstream__1), ((_Bool (*)(void *__anonymous_object1545))__sepEnable__Fb_P9sofstream__1), ((const char *(*)(void *__anonymous_object1546))__sepGet__FPCc_P9sofstream__1), ((void (*)(void *__anonymous_object1547, const char *__anonymous_object1548))__sepSet__F_P9sofstreamPCc__1), ((const char *(*)(void *__anonymous_object1549))__sepGetTuple__FPCc_P9sofstream__1), ((void (*)(void *__anonymous_object1550, const char *__anonymous_object1551))__sepSetTuple__F_P9sofstreamPCc__1), ((signed int (*)(void *__anonymous_object1552))__fail__Fi_P9sofstream__1), ((signed int (*)(void *__anonymous_object1553))__flush__Fi_P9sofstream__1), ((void (*)(void *__os__P7tostype_1, const char *__name__PCc_1, const char *__mode__PCc_1))__open__F_P9sofstreamPCcPCc__1), ((void (*)(void *__os__P7tostype_1))__close__F_P9sofstream__1), ((void *(*)(void *__anonymous_object1554, const char *__anonymous_object1555, unsigned long int __anonymous_object1556))__write__FP9sofstream_P9sofstreamPCcUl__1), ((signed int (*)(void *__anonymous_object1557, const char *__fmt__PCc_1, ...))__fmt__Fi_P9sofstreamPCc__1), ((void *)_p0));
    493     }
    494     ((void)(((void)(_tmp_cp_ret8=___operator_bitor__A0_1_0_0___sepPrt__PFb_Pd0___sepReset__PF_Pd0___sepReset__PF_Pd0b___sepGetCur__PFPCc_Pd0___sepSetCur__PF_Pd0PCc___getNL__PFb_Pd0___setNL__PF_Pd0b___sepOn__PF_Pd0___sepOff__PF_Pd0___sepDisable__PFb_Pd0___sepEnable__PFb_Pd0___sepGet__PFPCc_Pd0___sepSet__PF_Pd0PCc___sepGetTuple__PFPCc_Pd0___sepSetTuple__PF_Pd0PCc___fail__PFi_Pd0___flush__PFi_Pd0___open__PF_Pd0PCcPCc___close__PF_Pd0___write__PFPd0_Pd0PCcUl___fmt__PFi_Pd0PCc__FPd0_Pd0PFPd0_Pd0___1(((_Bool (*)(void *__anonymous_object1558))__sepPrt__Fb_P9sofstream__1), ((void (*)(void *__anonymous_object1559))__sepReset__F_P9sofstream__1), ((void (*)(void *__anonymous_object1560, _Bool __anonymous_object1561))__sepReset__F_P9sofstreamb__1), ((const char *(*)(void *__anonymous_object1562))__sepGetCur__FPCc_P9sofstream__1), ((void (*)(void *__anonymous_object1563, const char *__anonymous_object1564))__sepSetCur__F_P9sofstreamPCc__1), ((_Bool (*)(void *__anonymous_object1565))__getNL__Fb_P9sofstream__1), ((void (*)(void *__anonymous_object1566, _Bool __anonymous_object1567))__setNL__F_P9sofstreamb__1), ((void (*)(void *__anonymous_object1568))__sepOn__F_P9sofstream__1), ((void (*)(void *__anonymous_object1569))__sepOff__F_P9sofstream__1), ((_Bool (*)(void *__anonymous_object1570))__sepDisable__Fb_P9sofstream__1), ((_Bool (*)(void *__anonymous_object1571))__sepEnable__Fb_P9sofstream__1), ((const char *(*)(void *__anonymous_object1572))__sepGet__FPCc_P9sofstream__1), ((void (*)(void *__anonymous_object1573, const char *__anonymous_object1574))__sepSet__F_P9sofstreamPCc__1), ((const char *(*)(void *__anonymous_object1575))__sepGetTuple__FPCc_P9sofstream__1), ((void (*)(void *__anonymous_object1576, const char *__anonymous_object1577))__sepSetTuple__F_P9sofstreamPCc__1), ((signed int (*)(void *__anonymous_object1578))__fail__Fi_P9sofstream__1), ((signed int (*)(void *__anonymous_object1579))__flush__Fi_P9sofstream__1), ((void (*)(void *__os__P7tostype_1, const char *__name__PCc_1, const char *__mode__PCc_1))__open__F_P9sofstreamPCcPCc__1), ((void (*)(void *__os__P7tostype_1))__close__F_P9sofstream__1), ((void *(*)(void *__anonymous_object1580, const char *__anonymous_object1581, unsigned long int __anonymous_object1582))__write__FP9sofstream_P9sofstreamPCcUl__1), ((signed int (*)(void *__anonymous_object1583, const char *__fmt__PCc_1, ...))__fmt__Fi_P9sofstreamPCc__1), ((void *)(((void)(_tmp_cp_ret7=___operator_bitor__A0_1_0_0___sepPrt__PFb_Pd0___sepReset__PF_Pd0___sepReset__PF_Pd0b___sepGetCur__PFPCc_Pd0___sepSetCur__PF_Pd0PCc___getNL__PFb_Pd0___setNL__PF_Pd0b___sepOn__PF_Pd0___sepOff__PF_Pd0___sepDisable__PFb_Pd0___sepEnable__PFb_Pd0___sepGet__PFPCc_Pd0___sepSet__PF_Pd0PCc___sepGetTuple__PFPCc_Pd0___sepSetTuple__PF_Pd0PCc___fail__PFi_Pd0___flush__PFi_Pd0___open__PF_Pd0PCcPCc___close__PF_Pd0___write__PFPd0_Pd0PCcUl___fmt__PFi_Pd0PCc__FPd0_Pd0Uc__1(((_Bool (*)(void *__anonymous_object1584))__sepPrt__Fb_P9sofstream__1), ((void (*)(void *__anonymous_object1585))__sepReset__F_P9sofstream__1), ((void (*)(void *__anonymous_object1586, _Bool __anonymous_object1587))__sepReset__F_P9sofstreamb__1), ((const char *(*)(void *__anonymous_object1588))__sepGetCur__FPCc_P9sofstream__1), ((void (*)(void *__anonymous_object1589, const char *__anonymous_object1590))__sepSetCur__F_P9sofstreamPCc__1), ((_Bool (*)(void *__anonymous_object1591))__getNL__Fb_P9sofstream__1), ((void (*)(void *__anonymous_object1592, _Bool __anonymous_object1593))__setNL__F_P9sofstreamb__1), ((void (*)(void *__anonymous_object1594))__sepOn__F_P9sofstream__1), ((void (*)(void *__anonymous_object1595))__sepOff__F_P9sofstream__1), ((_Bool (*)(void *__anonymous_object1596))__sepDisable__Fb_P9sofstream__1), ((_Bool (*)(void *__anonymous_object1597))__sepEnable__Fb_P9sofstream__1), ((const char *(*)(void *__anonymous_object1598))__sepGet__FPCc_P9sofstream__1), ((void (*)(void *__anonymous_object1599, const char *__anonymous_object1600))__sepSet__F_P9sofstreamPCc__1), ((const char *(*)(void *__anonymous_object1601))__sepGetTuple__FPCc_P9sofstream__1), ((void (*)(void *__anonymous_object1602, const char *__anonymous_object1603))__sepSetTuple__F_P9sofstreamPCc__1), ((signed int (*)(void *__anonymous_object1604))__fail__Fi_P9sofstream__1), ((signed int (*)(void *__anonymous_object1605))__flush__Fi_P9sofstream__1), ((void (*)(void *__os__P7tostype_1, const char *__name__PCc_1, const char *__mode__PCc_1))__open__F_P9sofstreamPCcPCc__1), ((void (*)(void *__os__P7tostype_1))__close__F_P9sofstream__1), ((void *(*)(void *__anonymous_object1606, const char *__anonymous_object1607, unsigned long int __anonymous_object1608))__write__FP9sofstream_P9sofstreamPCcUl__1), ((signed int (*)(void *__anonymous_object1609, const char *__fmt__PCc_1, ...))__fmt__Fi_P9sofstreamPCc__1), ((void *)(((void)(_tmp_cp_ret6=___operator_bitor__A0_1_0_0___sepPrt__PFb_Pd0___sepReset__PF_Pd0___sepReset__PF_Pd0b___sepGetCur__PFPCc_Pd0___sepSetCur__PF_Pd0PCc___getNL__PFb_Pd0___setNL__PF_Pd0b___sepOn__PF_Pd0___sepOff__PF_Pd0___sepDisable__PFb_Pd0___sepEnable__PFb_Pd0___sepGet__PFPCc_Pd0___sepSet__PF_Pd0PCc___sepGetTuple__PFPCc_Pd0___sepSetTuple__PF_Pd0PCc___fail__PFi_Pd0___flush__PFi_Pd0___open__PF_Pd0PCcPCc___close__PF_Pd0___write__PFPd0_Pd0PCcUl___fmt__PFi_Pd0PCc__FPd0_Pd0PCc__1(((_Bool (*)(void *__anonymous_object1610))__sepPrt__Fb_P9sofstream__1), ((void (*)(void *__anonymous_object1611))__sepReset__F_P9sofstream__1), ((void (*)(void *__anonymous_object1612, _Bool __anonymous_object1613))__sepReset__F_P9sofstreamb__1), ((const char *(*)(void *__anonymous_object1614))__sepGetCur__FPCc_P9sofstream__1), ((void (*)(void *__anonymous_object1615, const char *__anonymous_object1616))__sepSetCur__F_P9sofstreamPCc__1), ((_Bool (*)(void *__anonymous_object1617))__getNL__Fb_P9sofstream__1), ((void (*)(void *__anonymous_object1618, _Bool __anonymous_object1619))__setNL__F_P9sofstreamb__1), ((void (*)(void *__anonymous_object1620))__sepOn__F_P9sofstream__1), ((void (*)(void *__anonymous_object1621))__sepOff__F_P9sofstream__1), ((_Bool (*)(void *__anonymous_object1622))__sepDisable__Fb_P9sofstream__1), ((_Bool (*)(void *__anonymous_object1623))__sepEnable__Fb_P9sofstream__1), ((const char *(*)(void *__anonymous_object1624))__sepGet__FPCc_P9sofstream__1), ((void (*)(void *__anonymous_object1625, const char *__anonymous_object1626))__sepSet__F_P9sofstreamPCc__1), ((const char *(*)(void *__anonymous_object1627))__sepGetTuple__FPCc_P9sofstream__1), ((void (*)(void *__anonymous_object1628, const char *__anonymous_object1629))__sepSetTuple__F_P9sofstreamPCc__1), ((signed int (*)(void *__anonymous_object1630))__fail__Fi_P9sofstream__1), ((signed int (*)(void *__anonymous_object1631))__flush__Fi_P9sofstream__1), ((void (*)(void *__os__P7tostype_1, const char *__name__PCc_1, const char *__mode__PCc_1))__open__F_P9sofstreamPCcPCc__1), ((void (*)(void *__os__P7tostype_1))__close__F_P9sofstream__1), ((void *(*)(void *__anonymous_object1632, const char *__anonymous_object1633, unsigned long int __anonymous_object1634))__write__FP9sofstream_P9sofstreamPCcUl__1), ((signed int (*)(void *__anonymous_object1635, const char *__fmt__PCc_1, ...))__fmt__Fi_P9sofstreamPCc__1), ((void *)__sout__P9sofstream_1), "unsigned char "))) , _tmp_cp_ret6)), __v__Uc_1))) , _tmp_cp_ret7)), ((void *(*)(void *__anonymous_object1636))(&_thunk2))))) , _tmp_cp_ret8));
     461        return __endl__A0_1_0_0___sepPrt__PFb_Pd0___sepReset__PF_Pd0___sepReset__PF_Pd0b___sepGetCur__PFPCc_Pd0___sepSetCur__PF_Pd0PCc___getNL__PFb_Pd0___setNL__PF_Pd0b___sepOn__PF_Pd0___sepOff__PF_Pd0___sepDisable__PFb_Pd0___sepEnable__PFb_Pd0___sepGet__PFPCc_Pd0___sepSet__PF_Pd0PCc___sepGetTuple__PFPCc_Pd0___sepSetTuple__PF_Pd0PCc___fail__PFi_Pd0___flush__PFi_Pd0___open__PF_Pd0PCcPCc___close__PF_Pd0___write__PFPd0_Pd0PCcUl___fmt__PFi_Pd0PCc__FPd0_Pd0__1(((_Bool (*)(void *__anonymous_object1532))__sepPrt__Fb_P9sofstream__1), ((void (*)(void *__anonymous_object1533))__sepReset__F_P9sofstream__1), ((void (*)(void *__anonymous_object1534, _Bool __anonymous_object1535))__sepReset__F_P9sofstreamb__1), ((const char *(*)(void *__anonymous_object1536))__sepGetCur__FPCc_P9sofstream__1), ((void (*)(void *__anonymous_object1537, const char *__anonymous_object1538))__sepSetCur__F_P9sofstreamPCc__1), ((_Bool (*)(void *__anonymous_object1539))__getNL__Fb_P9sofstream__1), ((void (*)(void *__anonymous_object1540, _Bool __anonymous_object1541))__setNL__F_P9sofstreamb__1), ((void (*)(void *__anonymous_object1542))__sepOn__F_P9sofstream__1), ((void (*)(void *__anonymous_object1543))__sepOff__F_P9sofstream__1), ((_Bool (*)(void *__anonymous_object1544))__sepDisable__Fb_P9sofstream__1), ((_Bool (*)(void *__anonymous_object1545))__sepEnable__Fb_P9sofstream__1), ((const char *(*)(void *__anonymous_object1546))__sepGet__FPCc_P9sofstream__1), ((void (*)(void *__anonymous_object1547, const char *__anonymous_object1548))__sepSet__F_P9sofstreamPCc__1), ((const char *(*)(void *__anonymous_object1549))__sepGetTuple__FPCc_P9sofstream__1), ((void (*)(void *__anonymous_object1550, const char *__anonymous_object1551))__sepSetTuple__F_P9sofstreamPCc__1), ((signed int (*)(void *__anonymous_object1552))__fail__Fi_P9sofstream__1), ((signed int (*)(void *__anonymous_object1553))__flush__Fi_P9sofstream__1), ((void (*)(void *__os__P7tostype_1, const char *__name__PCc_1, const char *__mode__PCc_1))__open__F_P9sofstreamPCcPCc__1), ((void (*)(void *__os__P7tostype_1))__close__F_P9sofstream__1), ((void *(*)(void *__anonymous_object1554, const char *__anonymous_object1555, unsigned long int __anonymous_object1556))__write__FP9sofstream_P9sofstreamPCcUl__1), ((signed int (*)(void *__anonymous_object1557, const char *__fmt__PCc_1, ...))__fmt__Fi_P9sofstreamPCc__1), _p0);
     462    }
     463    ((void)(((void)(_tmp_cp_ret8=___operator_bitor__A0_1_0_0___sepPrt__PFb_Pd0___sepReset__PF_Pd0___sepReset__PF_Pd0b___sepGetCur__PFPCc_Pd0___sepSetCur__PF_Pd0PCc___getNL__PFb_Pd0___setNL__PF_Pd0b___sepOn__PF_Pd0___sepOff__PF_Pd0___sepDisable__PFb_Pd0___sepEnable__PFb_Pd0___sepGet__PFPCc_Pd0___sepSet__PF_Pd0PCc___sepGetTuple__PFPCc_Pd0___sepSetTuple__PF_Pd0PCc___fail__PFi_Pd0___flush__PFi_Pd0___open__PF_Pd0PCcPCc___close__PF_Pd0___write__PFPd0_Pd0PCcUl___fmt__PFi_Pd0PCc__FPd0_Pd0PFPd0_Pd0___1(((_Bool (*)(void *__anonymous_object1558))__sepPrt__Fb_P9sofstream__1), ((void (*)(void *__anonymous_object1559))__sepReset__F_P9sofstream__1), ((void (*)(void *__anonymous_object1560, _Bool __anonymous_object1561))__sepReset__F_P9sofstreamb__1), ((const char *(*)(void *__anonymous_object1562))__sepGetCur__FPCc_P9sofstream__1), ((void (*)(void *__anonymous_object1563, const char *__anonymous_object1564))__sepSetCur__F_P9sofstreamPCc__1), ((_Bool (*)(void *__anonymous_object1565))__getNL__Fb_P9sofstream__1), ((void (*)(void *__anonymous_object1566, _Bool __anonymous_object1567))__setNL__F_P9sofstreamb__1), ((void (*)(void *__anonymous_object1568))__sepOn__F_P9sofstream__1), ((void (*)(void *__anonymous_object1569))__sepOff__F_P9sofstream__1), ((_Bool (*)(void *__anonymous_object1570))__sepDisable__Fb_P9sofstream__1), ((_Bool (*)(void *__anonymous_object1571))__sepEnable__Fb_P9sofstream__1), ((const char *(*)(void *__anonymous_object1572))__sepGet__FPCc_P9sofstream__1), ((void (*)(void *__anonymous_object1573, const char *__anonymous_object1574))__sepSet__F_P9sofstreamPCc__1), ((const char *(*)(void *__anonymous_object1575))__sepGetTuple__FPCc_P9sofstream__1), ((void (*)(void *__anonymous_object1576, const char *__anonymous_object1577))__sepSetTuple__F_P9sofstreamPCc__1), ((signed int (*)(void *__anonymous_object1578))__fail__Fi_P9sofstream__1), ((signed int (*)(void *__anonymous_object1579))__flush__Fi_P9sofstream__1), ((void (*)(void *__os__P7tostype_1, const char *__name__PCc_1, const char *__mode__PCc_1))__open__F_P9sofstreamPCcPCc__1), ((void (*)(void *__os__P7tostype_1))__close__F_P9sofstream__1), ((void *(*)(void *__anonymous_object1580, const char *__anonymous_object1581, unsigned long int __anonymous_object1582))__write__FP9sofstream_P9sofstreamPCcUl__1), ((signed int (*)(void *__anonymous_object1583, const char *__fmt__PCc_1, ...))__fmt__Fi_P9sofstreamPCc__1), (((void)(_tmp_cp_ret7=___operator_bitor__A0_1_0_0___sepPrt__PFb_Pd0___sepReset__PF_Pd0___sepReset__PF_Pd0b___sepGetCur__PFPCc_Pd0___sepSetCur__PF_Pd0PCc___getNL__PFb_Pd0___setNL__PF_Pd0b___sepOn__PF_Pd0___sepOff__PF_Pd0___sepDisable__PFb_Pd0___sepEnable__PFb_Pd0___sepGet__PFPCc_Pd0___sepSet__PF_Pd0PCc___sepGetTuple__PFPCc_Pd0___sepSetTuple__PF_Pd0PCc___fail__PFi_Pd0___flush__PFi_Pd0___open__PF_Pd0PCcPCc___close__PF_Pd0___write__PFPd0_Pd0PCcUl___fmt__PFi_Pd0PCc__FPd0_Pd0Uc__1(((_Bool (*)(void *__anonymous_object1584))__sepPrt__Fb_P9sofstream__1), ((void (*)(void *__anonymous_object1585))__sepReset__F_P9sofstream__1), ((void (*)(void *__anonymous_object1586, _Bool __anonymous_object1587))__sepReset__F_P9sofstreamb__1), ((const char *(*)(void *__anonymous_object1588))__sepGetCur__FPCc_P9sofstream__1), ((void (*)(void *__anonymous_object1589, const char *__anonymous_object1590))__sepSetCur__F_P9sofstreamPCc__1), ((_Bool (*)(void *__anonymous_object1591))__getNL__Fb_P9sofstream__1), ((void (*)(void *__anonymous_object1592, _Bool __anonymous_object1593))__setNL__F_P9sofstreamb__1), ((void (*)(void *__anonymous_object1594))__sepOn__F_P9sofstream__1), ((void (*)(void *__anonymous_object1595))__sepOff__F_P9sofstream__1), ((_Bool (*)(void *__anonymous_object1596))__sepDisable__Fb_P9sofstream__1), ((_Bool (*)(void *__anonymous_object1597))__sepEnable__Fb_P9sofstream__1), ((const char *(*)(void *__anonymous_object1598))__sepGet__FPCc_P9sofstream__1), ((void (*)(void *__anonymous_object1599, const char *__anonymous_object1600))__sepSet__F_P9sofstreamPCc__1), ((const char *(*)(void *__anonymous_object1601))__sepGetTuple__FPCc_P9sofstream__1), ((void (*)(void *__anonymous_object1602, const char *__anonymous_object1603))__sepSetTuple__F_P9sofstreamPCc__1), ((signed int (*)(void *__anonymous_object1604))__fail__Fi_P9sofstream__1), ((signed int (*)(void *__anonymous_object1605))__flush__Fi_P9sofstream__1), ((void (*)(void *__os__P7tostype_1, const char *__name__PCc_1, const char *__mode__PCc_1))__open__F_P9sofstreamPCcPCc__1), ((void (*)(void *__os__P7tostype_1))__close__F_P9sofstream__1), ((void *(*)(void *__anonymous_object1606, const char *__anonymous_object1607, unsigned long int __anonymous_object1608))__write__FP9sofstream_P9sofstreamPCcUl__1), ((signed int (*)(void *__anonymous_object1609, const char *__fmt__PCc_1, ...))__fmt__Fi_P9sofstreamPCc__1), (((void)(_tmp_cp_ret6=___operator_bitor__A0_1_0_0___sepPrt__PFb_Pd0___sepReset__PF_Pd0___sepReset__PF_Pd0b___sepGetCur__PFPCc_Pd0___sepSetCur__PF_Pd0PCc___getNL__PFb_Pd0___setNL__PF_Pd0b___sepOn__PF_Pd0___sepOff__PF_Pd0___sepDisable__PFb_Pd0___sepEnable__PFb_Pd0___sepGet__PFPCc_Pd0___sepSet__PF_Pd0PCc___sepGetTuple__PFPCc_Pd0___sepSetTuple__PF_Pd0PCc___fail__PFi_Pd0___flush__PFi_Pd0___open__PF_Pd0PCcPCc___close__PF_Pd0___write__PFPd0_Pd0PCcUl___fmt__PFi_Pd0PCc__FPd0_Pd0PCc__1(((_Bool (*)(void *__anonymous_object1610))__sepPrt__Fb_P9sofstream__1), ((void (*)(void *__anonymous_object1611))__sepReset__F_P9sofstream__1), ((void (*)(void *__anonymous_object1612, _Bool __anonymous_object1613))__sepReset__F_P9sofstreamb__1), ((const char *(*)(void *__anonymous_object1614))__sepGetCur__FPCc_P9sofstream__1), ((void (*)(void *__anonymous_object1615, const char *__anonymous_object1616))__sepSetCur__F_P9sofstreamPCc__1), ((_Bool (*)(void *__anonymous_object1617))__getNL__Fb_P9sofstream__1), ((void (*)(void *__anonymous_object1618, _Bool __anonymous_object1619))__setNL__F_P9sofstreamb__1), ((void (*)(void *__anonymous_object1620))__sepOn__F_P9sofstream__1), ((void (*)(void *__anonymous_object1621))__sepOff__F_P9sofstream__1), ((_Bool (*)(void *__anonymous_object1622))__sepDisable__Fb_P9sofstream__1), ((_Bool (*)(void *__anonymous_object1623))__sepEnable__Fb_P9sofstream__1), ((const char *(*)(void *__anonymous_object1624))__sepGet__FPCc_P9sofstream__1), ((void (*)(void *__anonymous_object1625, const char *__anonymous_object1626))__sepSet__F_P9sofstreamPCc__1), ((const char *(*)(void *__anonymous_object1627))__sepGetTuple__FPCc_P9sofstream__1), ((void (*)(void *__anonymous_object1628, const char *__anonymous_object1629))__sepSetTuple__F_P9sofstreamPCc__1), ((signed int (*)(void *__anonymous_object1630))__fail__Fi_P9sofstream__1), ((signed int (*)(void *__anonymous_object1631))__flush__Fi_P9sofstream__1), ((void (*)(void *__os__P7tostype_1, const char *__name__PCc_1, const char *__mode__PCc_1))__open__F_P9sofstreamPCcPCc__1), ((void (*)(void *__os__P7tostype_1))__close__F_P9sofstream__1), ((void *(*)(void *__anonymous_object1632, const char *__anonymous_object1633, unsigned long int __anonymous_object1634))__write__FP9sofstream_P9sofstreamPCcUl__1), ((signed int (*)(void *__anonymous_object1635, const char *__fmt__PCc_1, ...))__fmt__Fi_P9sofstreamPCc__1), __sout__P9sofstream_1, "unsigned char "))) , _tmp_cp_ret6), __v__Uc_1))) , _tmp_cp_ret7), ((void *(*)(void *__anonymous_object1636))(&_thunk2))))) , _tmp_cp_ret8));
    495464    ((void)(_tmp_cp_ret6) /* ^?{} */);
    496465    ((void)(_tmp_cp_ret7) /* ^?{} */);
     
    502471    struct ofstream *_tmp_cp_ret11;
    503472    __attribute__ ((unused)) struct ofstream *_thunk3(struct ofstream *_p0){
    504         return __endl__A0_1_0_0___sepPrt__PFb_Pd0___sepReset__PF_Pd0___sepReset__PF_Pd0b___sepGetCur__PFPCc_Pd0___sepSetCur__PF_Pd0PCc___getNL__PFb_Pd0___setNL__PF_Pd0b___sepOn__PF_Pd0___sepOff__PF_Pd0___sepDisable__PFb_Pd0___sepEnable__PFb_Pd0___sepGet__PFPCc_Pd0___sepSet__PF_Pd0PCc___sepGetTuple__PFPCc_Pd0___sepSetTuple__PF_Pd0PCc___fail__PFi_Pd0___flush__PFi_Pd0___open__PF_Pd0PCcPCc___close__PF_Pd0___write__PFPd0_Pd0PCcUl___fmt__PFi_Pd0PCc__FPd0_Pd0__1(((_Bool (*)(void *__anonymous_object1637))__sepPrt__Fb_P9sofstream__1), ((void (*)(void *__anonymous_object1638))__sepReset__F_P9sofstream__1), ((void (*)(void *__anonymous_object1639, _Bool __anonymous_object1640))__sepReset__F_P9sofstreamb__1), ((const char *(*)(void *__anonymous_object1641))__sepGetCur__FPCc_P9sofstream__1), ((void (*)(void *__anonymous_object1642, const char *__anonymous_object1643))__sepSetCur__F_P9sofstreamPCc__1), ((_Bool (*)(void *__anonymous_object1644))__getNL__Fb_P9sofstream__1), ((void (*)(void *__anonymous_object1645, _Bool __anonymous_object1646))__setNL__F_P9sofstreamb__1), ((void (*)(void *__anonymous_object1647))__sepOn__F_P9sofstream__1), ((void (*)(void *__anonymous_object1648))__sepOff__F_P9sofstream__1), ((_Bool (*)(void *__anonymous_object1649))__sepDisable__Fb_P9sofstream__1), ((_Bool (*)(void *__anonymous_object1650))__sepEnable__Fb_P9sofstream__1), ((const char *(*)(void *__anonymous_object1651))__sepGet__FPCc_P9sofstream__1), ((void (*)(void *__anonymous_object1652, const char *__anonymous_object1653))__sepSet__F_P9sofstreamPCc__1), ((const char *(*)(void *__anonymous_object1654))__sepGetTuple__FPCc_P9sofstream__1), ((void (*)(void *__anonymous_object1655, const char *__anonymous_object1656))__sepSetTuple__F_P9sofstreamPCc__1), ((signed int (*)(void *__anonymous_object1657))__fail__Fi_P9sofstream__1), ((signed int (*)(void *__anonymous_object1658))__flush__Fi_P9sofstream__1), ((void (*)(void *__os__P7tostype_1, const char *__name__PCc_1, const char *__mode__PCc_1))__open__F_P9sofstreamPCcPCc__1), ((void (*)(void *__os__P7tostype_1))__close__F_P9sofstream__1), ((void *(*)(void *__anonymous_object1659, const char *__anonymous_object1660, unsigned long int __anonymous_object1661))__write__FP9sofstream_P9sofstreamPCcUl__1), ((signed int (*)(void *__anonymous_object1662, const char *__fmt__PCc_1, ...))__fmt__Fi_P9sofstreamPCc__1), ((void *)_p0));
    505     }
    506     ((void)(((void)(_tmp_cp_ret11=___operator_bitor__A0_1_0_0___sepPrt__PFb_Pd0___sepReset__PF_Pd0___sepReset__PF_Pd0b___sepGetCur__PFPCc_Pd0___sepSetCur__PF_Pd0PCc___getNL__PFb_Pd0___setNL__PF_Pd0b___sepOn__PF_Pd0___sepOff__PF_Pd0___sepDisable__PFb_Pd0___sepEnable__PFb_Pd0___sepGet__PFPCc_Pd0___sepSet__PF_Pd0PCc___sepGetTuple__PFPCc_Pd0___sepSetTuple__PF_Pd0PCc___fail__PFi_Pd0___flush__PFi_Pd0___open__PF_Pd0PCcPCc___close__PF_Pd0___write__PFPd0_Pd0PCcUl___fmt__PFi_Pd0PCc__FPd0_Pd0PFPd0_Pd0___1(((_Bool (*)(void *__anonymous_object1663))__sepPrt__Fb_P9sofstream__1), ((void (*)(void *__anonymous_object1664))__sepReset__F_P9sofstream__1), ((void (*)(void *__anonymous_object1665, _Bool __anonymous_object1666))__sepReset__F_P9sofstreamb__1), ((const char *(*)(void *__anonymous_object1667))__sepGetCur__FPCc_P9sofstream__1), ((void (*)(void *__anonymous_object1668, const char *__anonymous_object1669))__sepSetCur__F_P9sofstreamPCc__1), ((_Bool (*)(void *__anonymous_object1670))__getNL__Fb_P9sofstream__1), ((void (*)(void *__anonymous_object1671, _Bool __anonymous_object1672))__setNL__F_P9sofstreamb__1), ((void (*)(void *__anonymous_object1673))__sepOn__F_P9sofstream__1), ((void (*)(void *__anonymous_object1674))__sepOff__F_P9sofstream__1), ((_Bool (*)(void *__anonymous_object1675))__sepDisable__Fb_P9sofstream__1), ((_Bool (*)(void *__anonymous_object1676))__sepEnable__Fb_P9sofstream__1), ((const char *(*)(void *__anonymous_object1677))__sepGet__FPCc_P9sofstream__1), ((void (*)(void *__anonymous_object1678, const char *__anonymous_object1679))__sepSet__F_P9sofstreamPCc__1), ((const char *(*)(void *__anonymous_object1680))__sepGetTuple__FPCc_P9sofstream__1), ((void (*)(void *__anonymous_object1681, const char *__anonymous_object1682))__sepSetTuple__F_P9sofstreamPCc__1), ((signed int (*)(void *__anonymous_object1683))__fail__Fi_P9sofstream__1), ((signed int (*)(void *__anonymous_object1684))__flush__Fi_P9sofstream__1), ((void (*)(void *__os__P7tostype_1, const char *__name__PCc_1, const char *__mode__PCc_1))__open__F_P9sofstreamPCcPCc__1), ((void (*)(void *__os__P7tostype_1))__close__F_P9sofstream__1), ((void *(*)(void *__anonymous_object1685, const char *__anonymous_object1686, unsigned long int __anonymous_object1687))__write__FP9sofstream_P9sofstreamPCcUl__1), ((signed int (*)(void *__anonymous_object1688, const char *__fmt__PCc_1, ...))__fmt__Fi_P9sofstreamPCc__1), ((void *)(((void)(_tmp_cp_ret10=___operator_bitor__A0_1_0_0___sepPrt__PFb_Pd0___sepReset__PF_Pd0___sepReset__PF_Pd0b___sepGetCur__PFPCc_Pd0___sepSetCur__PF_Pd0PCc___getNL__PFb_Pd0___setNL__PF_Pd0b___sepOn__PF_Pd0___sepOff__PF_Pd0___sepDisable__PFb_Pd0___sepEnable__PFb_Pd0___sepGet__PFPCc_Pd0___sepSet__PF_Pd0PCc___sepGetTuple__PFPCc_Pd0___sepSetTuple__PF_Pd0PCc___fail__PFi_Pd0___flush__PFi_Pd0___open__PF_Pd0PCcPCc___close__PF_Pd0___write__PFPd0_Pd0PCcUl___fmt__PFi_Pd0PCc__FPd0_Pd0s__1(((_Bool (*)(void *__anonymous_object1689))__sepPrt__Fb_P9sofstream__1), ((void (*)(void *__anonymous_object1690))__sepReset__F_P9sofstream__1), ((void (*)(void *__anonymous_object1691, _Bool __anonymous_object1692))__sepReset__F_P9sofstreamb__1), ((const char *(*)(void *__anonymous_object1693))__sepGetCur__FPCc_P9sofstream__1), ((void (*)(void *__anonymous_object1694, const char *__anonymous_object1695))__sepSetCur__F_P9sofstreamPCc__1), ((_Bool (*)(void *__anonymous_object1696))__getNL__Fb_P9sofstream__1), ((void (*)(void *__anonymous_object1697, _Bool __anonymous_object1698))__setNL__F_P9sofstreamb__1), ((void (*)(void *__anonymous_object1699))__sepOn__F_P9sofstream__1), ((void (*)(void *__anonymous_object1700))__sepOff__F_P9sofstream__1), ((_Bool (*)(void *__anonymous_object1701))__sepDisable__Fb_P9sofstream__1), ((_Bool (*)(void *__anonymous_object1702))__sepEnable__Fb_P9sofstream__1), ((const char *(*)(void *__anonymous_object1703))__sepGet__FPCc_P9sofstream__1), ((void (*)(void *__anonymous_object1704, const char *__anonymous_object1705))__sepSet__F_P9sofstreamPCc__1), ((const char *(*)(void *__anonymous_object1706))__sepGetTuple__FPCc_P9sofstream__1), ((void (*)(void *__anonymous_object1707, const char *__anonymous_object1708))__sepSetTuple__F_P9sofstreamPCc__1), ((signed int (*)(void *__anonymous_object1709))__fail__Fi_P9sofstream__1), ((signed int (*)(void *__anonymous_object1710))__flush__Fi_P9sofstream__1), ((void (*)(void *__os__P7tostype_1, const char *__name__PCc_1, const char *__mode__PCc_1))__open__F_P9sofstreamPCcPCc__1), ((void (*)(void *__os__P7tostype_1))__close__F_P9sofstream__1), ((void *(*)(void *__anonymous_object1711, const char *__anonymous_object1712, unsigned long int __anonymous_object1713))__write__FP9sofstream_P9sofstreamPCcUl__1), ((signed int (*)(void *__anonymous_object1714, const char *__fmt__PCc_1, ...))__fmt__Fi_P9sofstreamPCc__1), ((void *)(((void)(_tmp_cp_ret9=___operator_bitor__A0_1_0_0___sepPrt__PFb_Pd0___sepReset__PF_Pd0___sepReset__PF_Pd0b___sepGetCur__PFPCc_Pd0___sepSetCur__PF_Pd0PCc___getNL__PFb_Pd0___setNL__PF_Pd0b___sepOn__PF_Pd0___sepOff__PF_Pd0___sepDisable__PFb_Pd0___sepEnable__PFb_Pd0___sepGet__PFPCc_Pd0___sepSet__PF_Pd0PCc___sepGetTuple__PFPCc_Pd0___sepSetTuple__PF_Pd0PCc___fail__PFi_Pd0___flush__PFi_Pd0___open__PF_Pd0PCcPCc___close__PF_Pd0___write__PFPd0_Pd0PCcUl___fmt__PFi_Pd0PCc__FPd0_Pd0PCc__1(((_Bool (*)(void *__anonymous_object1715))__sepPrt__Fb_P9sofstream__1), ((void (*)(void *__anonymous_object1716))__sepReset__F_P9sofstream__1), ((void (*)(void *__anonymous_object1717, _Bool __anonymous_object1718))__sepReset__F_P9sofstreamb__1), ((const char *(*)(void *__anonymous_object1719))__sepGetCur__FPCc_P9sofstream__1), ((void (*)(void *__anonymous_object1720, const char *__anonymous_object1721))__sepSetCur__F_P9sofstreamPCc__1), ((_Bool (*)(void *__anonymous_object1722))__getNL__Fb_P9sofstream__1), ((void (*)(void *__anonymous_object1723, _Bool __anonymous_object1724))__setNL__F_P9sofstreamb__1), ((void (*)(void *__anonymous_object1725))__sepOn__F_P9sofstream__1), ((void (*)(void *__anonymous_object1726))__sepOff__F_P9sofstream__1), ((_Bool (*)(void *__anonymous_object1727))__sepDisable__Fb_P9sofstream__1), ((_Bool (*)(void *__anonymous_object1728))__sepEnable__Fb_P9sofstream__1), ((const char *(*)(void *__anonymous_object1729))__sepGet__FPCc_P9sofstream__1), ((void (*)(void *__anonymous_object1730, const char *__anonymous_object1731))__sepSet__F_P9sofstreamPCc__1), ((const char *(*)(void *__anonymous_object1732))__sepGetTuple__FPCc_P9sofstream__1), ((void (*)(void *__anonymous_object1733, const char *__anonymous_object1734))__sepSetTuple__F_P9sofstreamPCc__1), ((signed int (*)(void *__anonymous_object1735))__fail__Fi_P9sofstream__1), ((signed int (*)(void *__anonymous_object1736))__flush__Fi_P9sofstream__1), ((void (*)(void *__os__P7tostype_1, const char *__name__PCc_1, const char *__mode__PCc_1))__open__F_P9sofstreamPCcPCc__1), ((void (*)(void *__os__P7tostype_1))__close__F_P9sofstream__1), ((void *(*)(void *__anonymous_object1737, const char *__anonymous_object1738, unsigned long int __anonymous_object1739))__write__FP9sofstream_P9sofstreamPCcUl__1), ((signed int (*)(void *__anonymous_object1740, const char *__fmt__PCc_1, ...))__fmt__Fi_P9sofstreamPCc__1), ((void *)__sout__P9sofstream_1), "signed short int"))) , _tmp_cp_ret9)), __v__s_1))) , _tmp_cp_ret10)), ((void *(*)(void *__anonymous_object1741))(&_thunk3))))) , _tmp_cp_ret11));
     473        return __endl__A0_1_0_0___sepPrt__PFb_Pd0___sepReset__PF_Pd0___sepReset__PF_Pd0b___sepGetCur__PFPCc_Pd0___sepSetCur__PF_Pd0PCc___getNL__PFb_Pd0___setNL__PF_Pd0b___sepOn__PF_Pd0___sepOff__PF_Pd0___sepDisable__PFb_Pd0___sepEnable__PFb_Pd0___sepGet__PFPCc_Pd0___sepSet__PF_Pd0PCc___sepGetTuple__PFPCc_Pd0___sepSetTuple__PF_Pd0PCc___fail__PFi_Pd0___flush__PFi_Pd0___open__PF_Pd0PCcPCc___close__PF_Pd0___write__PFPd0_Pd0PCcUl___fmt__PFi_Pd0PCc__FPd0_Pd0__1(((_Bool (*)(void *__anonymous_object1637))__sepPrt__Fb_P9sofstream__1), ((void (*)(void *__anonymous_object1638))__sepReset__F_P9sofstream__1), ((void (*)(void *__anonymous_object1639, _Bool __anonymous_object1640))__sepReset__F_P9sofstreamb__1), ((const char *(*)(void *__anonymous_object1641))__sepGetCur__FPCc_P9sofstream__1), ((void (*)(void *__anonymous_object1642, const char *__anonymous_object1643))__sepSetCur__F_P9sofstreamPCc__1), ((_Bool (*)(void *__anonymous_object1644))__getNL__Fb_P9sofstream__1), ((void (*)(void *__anonymous_object1645, _Bool __anonymous_object1646))__setNL__F_P9sofstreamb__1), ((void (*)(void *__anonymous_object1647))__sepOn__F_P9sofstream__1), ((void (*)(void *__anonymous_object1648))__sepOff__F_P9sofstream__1), ((_Bool (*)(void *__anonymous_object1649))__sepDisable__Fb_P9sofstream__1), ((_Bool (*)(void *__anonymous_object1650))__sepEnable__Fb_P9sofstream__1), ((const char *(*)(void *__anonymous_object1651))__sepGet__FPCc_P9sofstream__1), ((void (*)(void *__anonymous_object1652, const char *__anonymous_object1653))__sepSet__F_P9sofstreamPCc__1), ((const char *(*)(void *__anonymous_object1654))__sepGetTuple__FPCc_P9sofstream__1), ((void (*)(void *__anonymous_object1655, const char *__anonymous_object1656))__sepSetTuple__F_P9sofstreamPCc__1), ((signed int (*)(void *__anonymous_object1657))__fail__Fi_P9sofstream__1), ((signed int (*)(void *__anonymous_object1658))__flush__Fi_P9sofstream__1), ((void (*)(void *__os__P7tostype_1, const char *__name__PCc_1, const char *__mode__PCc_1))__open__F_P9sofstreamPCcPCc__1), ((void (*)(void *__os__P7tostype_1))__close__F_P9sofstream__1), ((void *(*)(void *__anonymous_object1659, const char *__anonymous_object1660, unsigned long int __anonymous_object1661))__write__FP9sofstream_P9sofstreamPCcUl__1), ((signed int (*)(void *__anonymous_object1662, const char *__fmt__PCc_1, ...))__fmt__Fi_P9sofstreamPCc__1), _p0);
     474    }
     475    ((void)(((void)(_tmp_cp_ret11=___operator_bitor__A0_1_0_0___sepPrt__PFb_Pd0___sepReset__PF_Pd0___sepReset__PF_Pd0b___sepGetCur__PFPCc_Pd0___sepSetCur__PF_Pd0PCc___getNL__PFb_Pd0___setNL__PF_Pd0b___sepOn__PF_Pd0___sepOff__PF_Pd0___sepDisable__PFb_Pd0___sepEnable__PFb_Pd0___sepGet__PFPCc_Pd0___sepSet__PF_Pd0PCc___sepGetTuple__PFPCc_Pd0___sepSetTuple__PF_Pd0PCc___fail__PFi_Pd0___flush__PFi_Pd0___open__PF_Pd0PCcPCc___close__PF_Pd0___write__PFPd0_Pd0PCcUl___fmt__PFi_Pd0PCc__FPd0_Pd0PFPd0_Pd0___1(((_Bool (*)(void *__anonymous_object1663))__sepPrt__Fb_P9sofstream__1), ((void (*)(void *__anonymous_object1664))__sepReset__F_P9sofstream__1), ((void (*)(void *__anonymous_object1665, _Bool __anonymous_object1666))__sepReset__F_P9sofstreamb__1), ((const char *(*)(void *__anonymous_object1667))__sepGetCur__FPCc_P9sofstream__1), ((void (*)(void *__anonymous_object1668, const char *__anonymous_object1669))__sepSetCur__F_P9sofstreamPCc__1), ((_Bool (*)(void *__anonymous_object1670))__getNL__Fb_P9sofstream__1), ((void (*)(void *__anonymous_object1671, _Bool __anonymous_object1672))__setNL__F_P9sofstreamb__1), ((void (*)(void *__anonymous_object1673))__sepOn__F_P9sofstream__1), ((void (*)(void *__anonymous_object1674))__sepOff__F_P9sofstream__1), ((_Bool (*)(void *__anonymous_object1675))__sepDisable__Fb_P9sofstream__1), ((_Bool (*)(void *__anonymous_object1676))__sepEnable__Fb_P9sofstream__1), ((const char *(*)(void *__anonymous_object1677))__sepGet__FPCc_P9sofstream__1), ((void (*)(void *__anonymous_object1678, const char *__anonymous_object1679))__sepSet__F_P9sofstreamPCc__1), ((const char *(*)(void *__anonymous_object1680))__sepGetTuple__FPCc_P9sofstream__1), ((void (*)(void *__anonymous_object1681, const char *__anonymous_object1682))__sepSetTuple__F_P9sofstreamPCc__1), ((signed int (*)(void *__anonymous_object1683))__fail__Fi_P9sofstream__1), ((signed int (*)(void *__anonymous_object1684))__flush__Fi_P9sofstream__1), ((void (*)(void *__os__P7tostype_1, const char *__name__PCc_1, const char *__mode__PCc_1))__open__F_P9sofstreamPCcPCc__1), ((void (*)(void *__os__P7tostype_1))__close__F_P9sofstream__1), ((void *(*)(void *__anonymous_object1685, const char *__anonymous_object1686, unsigned long int __anonymous_object1687))__write__FP9sofstream_P9sofstreamPCcUl__1), ((signed int (*)(void *__anonymous_object1688, const char *__fmt__PCc_1, ...))__fmt__Fi_P9sofstreamPCc__1), (((void)(_tmp_cp_ret10=___operator_bitor__A0_1_0_0___sepPrt__PFb_Pd0___sepReset__PF_Pd0___sepReset__PF_Pd0b___sepGetCur__PFPCc_Pd0___sepSetCur__PF_Pd0PCc___getNL__PFb_Pd0___setNL__PF_Pd0b___sepOn__PF_Pd0___sepOff__PF_Pd0___sepDisable__PFb_Pd0___sepEnable__PFb_Pd0___sepGet__PFPCc_Pd0___sepSet__PF_Pd0PCc___sepGetTuple__PFPCc_Pd0___sepSetTuple__PF_Pd0PCc___fail__PFi_Pd0___flush__PFi_Pd0___open__PF_Pd0PCcPCc___close__PF_Pd0___write__PFPd0_Pd0PCcUl___fmt__PFi_Pd0PCc__FPd0_Pd0s__1(((_Bool (*)(void *__anonymous_object1689))__sepPrt__Fb_P9sofstream__1), ((void (*)(void *__anonymous_object1690))__sepReset__F_P9sofstream__1), ((void (*)(void *__anonymous_object1691, _Bool __anonymous_object1692))__sepReset__F_P9sofstreamb__1), ((const char *(*)(void *__anonymous_object1693))__sepGetCur__FPCc_P9sofstream__1), ((void (*)(void *__anonymous_object1694, const char *__anonymous_object1695))__sepSetCur__F_P9sofstreamPCc__1), ((_Bool (*)(void *__anonymous_object1696))__getNL__Fb_P9sofstream__1), ((void (*)(void *__anonymous_object1697, _Bool __anonymous_object1698))__setNL__F_P9sofstreamb__1), ((void (*)(void *__anonymous_object1699))__sepOn__F_P9sofstream__1), ((void (*)(void *__anonymous_object1700))__sepOff__F_P9sofstream__1), ((_Bool (*)(void *__anonymous_object1701))__sepDisable__Fb_P9sofstream__1), ((_Bool (*)(void *__anonymous_object1702))__sepEnable__Fb_P9sofstream__1), ((const char *(*)(void *__anonymous_object1703))__sepGet__FPCc_P9sofstream__1), ((void (*)(void *__anonymous_object1704, const char *__anonymous_object1705))__sepSet__F_P9sofstreamPCc__1), ((const char *(*)(void *__anonymous_object1706))__sepGetTuple__FPCc_P9sofstream__1), ((void (*)(void *__anonymous_object1707, const char *__anonymous_object1708))__sepSetTuple__F_P9sofstreamPCc__1), ((signed int (*)(void *__anonymous_object1709))__fail__Fi_P9sofstream__1), ((signed int (*)(void *__anonymous_object1710))__flush__Fi_P9sofstream__1), ((void (*)(void *__os__P7tostype_1, const char *__name__PCc_1, const char *__mode__PCc_1))__open__F_P9sofstreamPCcPCc__1), ((void (*)(void *__os__P7tostype_1))__close__F_P9sofstream__1), ((void *(*)(void *__anonymous_object1711, const char *__anonymous_object1712, unsigned long int __anonymous_object1713))__write__FP9sofstream_P9sofstreamPCcUl__1), ((signed int (*)(void *__anonymous_object1714, const char *__fmt__PCc_1, ...))__fmt__Fi_P9sofstreamPCc__1), (((void)(_tmp_cp_ret9=___operator_bitor__A0_1_0_0___sepPrt__PFb_Pd0___sepReset__PF_Pd0___sepReset__PF_Pd0b___sepGetCur__PFPCc_Pd0___sepSetCur__PF_Pd0PCc___getNL__PFb_Pd0___setNL__PF_Pd0b___sepOn__PF_Pd0___sepOff__PF_Pd0___sepDisable__PFb_Pd0___sepEnable__PFb_Pd0___sepGet__PFPCc_Pd0___sepSet__PF_Pd0PCc___sepGetTuple__PFPCc_Pd0___sepSetTuple__PF_Pd0PCc___fail__PFi_Pd0___flush__PFi_Pd0___open__PF_Pd0PCcPCc___close__PF_Pd0___write__PFPd0_Pd0PCcUl___fmt__PFi_Pd0PCc__FPd0_Pd0PCc__1(((_Bool (*)(void *__anonymous_object1715))__sepPrt__Fb_P9sofstream__1), ((void (*)(void *__anonymous_object1716))__sepReset__F_P9sofstream__1), ((void (*)(void *__anonymous_object1717, _Bool __anonymous_object1718))__sepReset__F_P9sofstreamb__1), ((const char *(*)(void *__anonymous_object1719))__sepGetCur__FPCc_P9sofstream__1), ((void (*)(void *__anonymous_object1720, const char *__anonymous_object1721))__sepSetCur__F_P9sofstreamPCc__1), ((_Bool (*)(void *__anonymous_object1722))__getNL__Fb_P9sofstream__1), ((void (*)(void *__anonymous_object1723, _Bool __anonymous_object1724))__setNL__F_P9sofstreamb__1), ((void (*)(void *__anonymous_object1725))__sepOn__F_P9sofstream__1), ((void (*)(void *__anonymous_object1726))__sepOff__F_P9sofstream__1), ((_Bool (*)(void *__anonymous_object1727))__sepDisable__Fb_P9sofstream__1), ((_Bool (*)(void *__anonymous_object1728))__sepEnable__Fb_P9sofstream__1), ((const char *(*)(void *__anonymous_object1729))__sepGet__FPCc_P9sofstream__1), ((void (*)(void *__anonymous_object1730, const char *__anonymous_object1731))__sepSet__F_P9sofstreamPCc__1), ((const char *(*)(void *__anonymous_object1732))__sepGetTuple__FPCc_P9sofstream__1), ((void (*)(void *__anonymous_object1733, const char *__anonymous_object1734))__sepSetTuple__F_P9sofstreamPCc__1), ((signed int (*)(void *__anonymous_object1735))__fail__Fi_P9sofstream__1), ((signed int (*)(void *__anonymous_object1736))__flush__Fi_P9sofstream__1), ((void (*)(void *__os__P7tostype_1, const char *__name__PCc_1, const char *__mode__PCc_1))__open__F_P9sofstreamPCcPCc__1), ((void (*)(void *__os__P7tostype_1))__close__F_P9sofstream__1), ((void *(*)(void *__anonymous_object1737, const char *__anonymous_object1738, unsigned long int __anonymous_object1739))__write__FP9sofstream_P9sofstreamPCcUl__1), ((signed int (*)(void *__anonymous_object1740, const char *__fmt__PCc_1, ...))__fmt__Fi_P9sofstreamPCc__1), __sout__P9sofstream_1, "signed short int"))) , _tmp_cp_ret9), __v__s_1))) , _tmp_cp_ret10), ((void *(*)(void *__anonymous_object1741))(&_thunk3))))) , _tmp_cp_ret11));
    507476    ((void)(_tmp_cp_ret9) /* ^?{} */);
    508477    ((void)(_tmp_cp_ret10) /* ^?{} */);
     
    514483    struct ofstream *_tmp_cp_ret14;
    515484    __attribute__ ((unused)) struct ofstream *_thunk4(struct ofstream *_p0){
    516         return __endl__A0_1_0_0___sepPrt__PFb_Pd0___sepReset__PF_Pd0___sepReset__PF_Pd0b___sepGetCur__PFPCc_Pd0___sepSetCur__PF_Pd0PCc___getNL__PFb_Pd0___setNL__PF_Pd0b___sepOn__PF_Pd0___sepOff__PF_Pd0___sepDisable__PFb_Pd0___sepEnable__PFb_Pd0___sepGet__PFPCc_Pd0___sepSet__PF_Pd0PCc___sepGetTuple__PFPCc_Pd0___sepSetTuple__PF_Pd0PCc___fail__PFi_Pd0___flush__PFi_Pd0___open__PF_Pd0PCcPCc___close__PF_Pd0___write__PFPd0_Pd0PCcUl___fmt__PFi_Pd0PCc__FPd0_Pd0__1(((_Bool (*)(void *__anonymous_object1742))__sepPrt__Fb_P9sofstream__1), ((void (*)(void *__anonymous_object1743))__sepReset__F_P9sofstream__1), ((void (*)(void *__anonymous_object1744, _Bool __anonymous_object1745))__sepReset__F_P9sofstreamb__1), ((const char *(*)(void *__anonymous_object1746))__sepGetCur__FPCc_P9sofstream__1), ((void (*)(void *__anonymous_object1747, const char *__anonymous_object1748))__sepSetCur__F_P9sofstreamPCc__1), ((_Bool (*)(void *__anonymous_object1749))__getNL__Fb_P9sofstream__1), ((void (*)(void *__anonymous_object1750, _Bool __anonymous_object1751))__setNL__F_P9sofstreamb__1), ((void (*)(void *__anonymous_object1752))__sepOn__F_P9sofstream__1), ((void (*)(void *__anonymous_object1753))__sepOff__F_P9sofstream__1), ((_Bool (*)(void *__anonymous_object1754))__sepDisable__Fb_P9sofstream__1), ((_Bool (*)(void *__anonymous_object1755))__sepEnable__Fb_P9sofstream__1), ((const char *(*)(void *__anonymous_object1756))__sepGet__FPCc_P9sofstream__1), ((void (*)(void *__anonymous_object1757, const char *__anonymous_object1758))__sepSet__F_P9sofstreamPCc__1), ((const char *(*)(void *__anonymous_object1759))__sepGetTuple__FPCc_P9sofstream__1), ((void (*)(void *__anonymous_object1760, const char *__anonymous_object1761))__sepSetTuple__F_P9sofstreamPCc__1), ((signed int (*)(void *__anonymous_object1762))__fail__Fi_P9sofstream__1), ((signed int (*)(void *__anonymous_object1763))__flush__Fi_P9sofstream__1), ((void (*)(void *__os__P7tostype_1, const char *__name__PCc_1, const char *__mode__PCc_1))__open__F_P9sofstreamPCcPCc__1), ((void (*)(void *__os__P7tostype_1))__close__F_P9sofstream__1), ((void *(*)(void *__anonymous_object1764, const char *__anonymous_object1765, unsigned long int __anonymous_object1766))__write__FP9sofstream_P9sofstreamPCcUl__1), ((signed int (*)(void *__anonymous_object1767, const char *__fmt__PCc_1, ...))__fmt__Fi_P9sofstreamPCc__1), ((void *)_p0));
    517     }
    518     ((void)(((void)(_tmp_cp_ret14=___operator_bitor__A0_1_0_0___sepPrt__PFb_Pd0___sepReset__PF_Pd0___sepReset__PF_Pd0b___sepGetCur__PFPCc_Pd0___sepSetCur__PF_Pd0PCc___getNL__PFb_Pd0___setNL__PF_Pd0b___sepOn__PF_Pd0___sepOff__PF_Pd0___sepDisable__PFb_Pd0___sepEnable__PFb_Pd0___sepGet__PFPCc_Pd0___sepSet__PF_Pd0PCc___sepGetTuple__PFPCc_Pd0___sepSetTuple__PF_Pd0PCc___fail__PFi_Pd0___flush__PFi_Pd0___open__PF_Pd0PCcPCc___close__PF_Pd0___write__PFPd0_Pd0PCcUl___fmt__PFi_Pd0PCc__FPd0_Pd0PFPd0_Pd0___1(((_Bool (*)(void *__anonymous_object1768))__sepPrt__Fb_P9sofstream__1), ((void (*)(void *__anonymous_object1769))__sepReset__F_P9sofstream__1), ((void (*)(void *__anonymous_object1770, _Bool __anonymous_object1771))__sepReset__F_P9sofstreamb__1), ((const char *(*)(void *__anonymous_object1772))__sepGetCur__FPCc_P9sofstream__1), ((void (*)(void *__anonymous_object1773, const char *__anonymous_object1774))__sepSetCur__F_P9sofstreamPCc__1), ((_Bool (*)(void *__anonymous_object1775))__getNL__Fb_P9sofstream__1), ((void (*)(void *__anonymous_object1776, _Bool __anonymous_object1777))__setNL__F_P9sofstreamb__1), ((void (*)(void *__anonymous_object1778))__sepOn__F_P9sofstream__1), ((void (*)(void *__anonymous_object1779))__sepOff__F_P9sofstream__1), ((_Bool (*)(void *__anonymous_object1780))__sepDisable__Fb_P9sofstream__1), ((_Bool (*)(void *__anonymous_object1781))__sepEnable__Fb_P9sofstream__1), ((const char *(*)(void *__anonymous_object1782))__sepGet__FPCc_P9sofstream__1), ((void (*)(void *__anonymous_object1783, const char *__anonymous_object1784))__sepSet__F_P9sofstreamPCc__1), ((const char *(*)(void *__anonymous_object1785))__sepGetTuple__FPCc_P9sofstream__1), ((void (*)(void *__anonymous_object1786, const char *__anonymous_object1787))__sepSetTuple__F_P9sofstreamPCc__1), ((signed int (*)(void *__anonymous_object1788))__fail__Fi_P9sofstream__1), ((signed int (*)(void *__anonymous_object1789))__flush__Fi_P9sofstream__1), ((void (*)(void *__os__P7tostype_1, const char *__name__PCc_1, const char *__mode__PCc_1))__open__F_P9sofstreamPCcPCc__1), ((void (*)(void *__os__P7tostype_1))__close__F_P9sofstream__1), ((void *(*)(void *__anonymous_object1790, const char *__anonymous_object1791, unsigned long int __anonymous_object1792))__write__FP9sofstream_P9sofstreamPCcUl__1), ((signed int (*)(void *__anonymous_object1793, const char *__fmt__PCc_1, ...))__fmt__Fi_P9sofstreamPCc__1), ((void *)(((void)(_tmp_cp_ret13=___operator_bitor__A0_1_0_0___sepPrt__PFb_Pd0___sepReset__PF_Pd0___sepReset__PF_Pd0b___sepGetCur__PFPCc_Pd0___sepSetCur__PF_Pd0PCc___getNL__PFb_Pd0___setNL__PF_Pd0b___sepOn__PF_Pd0___sepOff__PF_Pd0___sepDisable__PFb_Pd0___sepEnable__PFb_Pd0___sepGet__PFPCc_Pd0___sepSet__PF_Pd0PCc___sepGetTuple__PFPCc_Pd0___sepSetTuple__PF_Pd0PCc___fail__PFi_Pd0___flush__PFi_Pd0___open__PF_Pd0PCcPCc___close__PF_Pd0___write__PFPd0_Pd0PCcUl___fmt__PFi_Pd0PCc__FPd0_Pd0Us__1(((_Bool (*)(void *__anonymous_object1794))__sepPrt__Fb_P9sofstream__1), ((void (*)(void *__anonymous_object1795))__sepReset__F_P9sofstream__1), ((void (*)(void *__anonymous_object1796, _Bool __anonymous_object1797))__sepReset__F_P9sofstreamb__1), ((const char *(*)(void *__anonymous_object1798))__sepGetCur__FPCc_P9sofstream__1), ((void (*)(void *__anonymous_object1799, const char *__anonymous_object1800))__sepSetCur__F_P9sofstreamPCc__1), ((_Bool (*)(void *__anonymous_object1801))__getNL__Fb_P9sofstream__1), ((void (*)(void *__anonymous_object1802, _Bool __anonymous_object1803))__setNL__F_P9sofstreamb__1), ((void (*)(void *__anonymous_object1804))__sepOn__F_P9sofstream__1), ((void (*)(void *__anonymous_object1805))__sepOff__F_P9sofstream__1), ((_Bool (*)(void *__anonymous_object1806))__sepDisable__Fb_P9sofstream__1), ((_Bool (*)(void *__anonymous_object1807))__sepEnable__Fb_P9sofstream__1), ((const char *(*)(void *__anonymous_object1808))__sepGet__FPCc_P9sofstream__1), ((void (*)(void *__anonymous_object1809, const char *__anonymous_object1810))__sepSet__F_P9sofstreamPCc__1), ((const char *(*)(void *__anonymous_object1811))__sepGetTuple__FPCc_P9sofstream__1), ((void (*)(void *__anonymous_object1812, const char *__anonymous_object1813))__sepSetTuple__F_P9sofstreamPCc__1), ((signed int (*)(void *__anonymous_object1814))__fail__Fi_P9sofstream__1), ((signed int (*)(void *__anonymous_object1815))__flush__Fi_P9sofstream__1), ((void (*)(void *__os__P7tostype_1, const char *__name__PCc_1, const char *__mode__PCc_1))__open__F_P9sofstreamPCcPCc__1), ((void (*)(void *__os__P7tostype_1))__close__F_P9sofstream__1), ((void *(*)(void *__anonymous_object1816, const char *__anonymous_object1817, unsigned long int __anonymous_object1818))__write__FP9sofstream_P9sofstreamPCcUl__1), ((signed int (*)(void *__anonymous_object1819, const char *__fmt__PCc_1, ...))__fmt__Fi_P9sofstreamPCc__1), ((void *)(((void)(_tmp_cp_ret12=___operator_bitor__A0_1_0_0___sepPrt__PFb_Pd0___sepReset__PF_Pd0___sepReset__PF_Pd0b___sepGetCur__PFPCc_Pd0___sepSetCur__PF_Pd0PCc___getNL__PFb_Pd0___setNL__PF_Pd0b___sepOn__PF_Pd0___sepOff__PF_Pd0___sepDisable__PFb_Pd0___sepEnable__PFb_Pd0___sepGet__PFPCc_Pd0___sepSet__PF_Pd0PCc___sepGetTuple__PFPCc_Pd0___sepSetTuple__PF_Pd0PCc___fail__PFi_Pd0___flush__PFi_Pd0___open__PF_Pd0PCcPCc___close__PF_Pd0___write__PFPd0_Pd0PCcUl___fmt__PFi_Pd0PCc__FPd0_Pd0PCc__1(((_Bool (*)(void *__anonymous_object1820))__sepPrt__Fb_P9sofstream__1), ((void (*)(void *__anonymous_object1821))__sepReset__F_P9sofstream__1), ((void (*)(void *__anonymous_object1822, _Bool __anonymous_object1823))__sepReset__F_P9sofstreamb__1), ((const char *(*)(void *__anonymous_object1824))__sepGetCur__FPCc_P9sofstream__1), ((void (*)(void *__anonymous_object1825, const char *__anonymous_object1826))__sepSetCur__F_P9sofstreamPCc__1), ((_Bool (*)(void *__anonymous_object1827))__getNL__Fb_P9sofstream__1), ((void (*)(void *__anonymous_object1828, _Bool __anonymous_object1829))__setNL__F_P9sofstreamb__1), ((void (*)(void *__anonymous_object1830))__sepOn__F_P9sofstream__1), ((void (*)(void *__anonymous_object1831))__sepOff__F_P9sofstream__1), ((_Bool (*)(void *__anonymous_object1832))__sepDisable__Fb_P9sofstream__1), ((_Bool (*)(void *__anonymous_object1833))__sepEnable__Fb_P9sofstream__1), ((const char *(*)(void *__anonymous_object1834))__sepGet__FPCc_P9sofstream__1), ((void (*)(void *__anonymous_object1835, const char *__anonymous_object1836))__sepSet__F_P9sofstreamPCc__1), ((const char *(*)(void *__anonymous_object1837))__sepGetTuple__FPCc_P9sofstream__1), ((void (*)(void *__anonymous_object1838, const char *__anonymous_object1839))__sepSetTuple__F_P9sofstreamPCc__1), ((signed int (*)(void *__anonymous_object1840))__fail__Fi_P9sofstream__1), ((signed int (*)(void *__anonymous_object1841))__flush__Fi_P9sofstream__1), ((void (*)(void *__os__P7tostype_1, const char *__name__PCc_1, const char *__mode__PCc_1))__open__F_P9sofstreamPCcPCc__1), ((void (*)(void *__os__P7tostype_1))__close__F_P9sofstream__1), ((void *(*)(void *__anonymous_object1842, const char *__anonymous_object1843, unsigned long int __anonymous_object1844))__write__FP9sofstream_P9sofstreamPCcUl__1), ((signed int (*)(void *__anonymous_object1845, const char *__fmt__PCc_1, ...))__fmt__Fi_P9sofstreamPCc__1), ((void *)__sout__P9sofstream_1), "unsigned short int"))) , _tmp_cp_ret12)), __v__Us_1))) , _tmp_cp_ret13)), ((void *(*)(void *__anonymous_object1846))(&_thunk4))))) , _tmp_cp_ret14));
     485        return __endl__A0_1_0_0___sepPrt__PFb_Pd0___sepReset__PF_Pd0___sepReset__PF_Pd0b___sepGetCur__PFPCc_Pd0___sepSetCur__PF_Pd0PCc___getNL__PFb_Pd0___setNL__PF_Pd0b___sepOn__PF_Pd0___sepOff__PF_Pd0___sepDisable__PFb_Pd0___sepEnable__PFb_Pd0___sepGet__PFPCc_Pd0___sepSet__PF_Pd0PCc___sepGetTuple__PFPCc_Pd0___sepSetTuple__PF_Pd0PCc___fail__PFi_Pd0___flush__PFi_Pd0___open__PF_Pd0PCcPCc___close__PF_Pd0___write__PFPd0_Pd0PCcUl___fmt__PFi_Pd0PCc__FPd0_Pd0__1(((_Bool (*)(void *__anonymous_object1742))__sepPrt__Fb_P9sofstream__1), ((void (*)(void *__anonymous_object1743))__sepReset__F_P9sofstream__1), ((void (*)(void *__anonymous_object1744, _Bool __anonymous_object1745))__sepReset__F_P9sofstreamb__1), ((const char *(*)(void *__anonymous_object1746))__sepGetCur__FPCc_P9sofstream__1), ((void (*)(void *__anonymous_object1747, const char *__anonymous_object1748))__sepSetCur__F_P9sofstreamPCc__1), ((_Bool (*)(void *__anonymous_object1749))__getNL__Fb_P9sofstream__1), ((void (*)(void *__anonymous_object1750, _Bool __anonymous_object1751))__setNL__F_P9sofstreamb__1), ((void (*)(void *__anonymous_object1752))__sepOn__F_P9sofstream__1), ((void (*)(void *__anonymous_object1753))__sepOff__F_P9sofstream__1), ((_Bool (*)(void *__anonymous_object1754))__sepDisable__Fb_P9sofstream__1), ((_Bool (*)(void *__anonymous_object1755))__sepEnable__Fb_P9sofstream__1), ((const char *(*)(void *__anonymous_object1756))__sepGet__FPCc_P9sofstream__1), ((void (*)(void *__anonymous_object1757, const char *__anonymous_object1758))__sepSet__F_P9sofstreamPCc__1), ((const char *(*)(void *__anonymous_object1759))__sepGetTuple__FPCc_P9sofstream__1), ((void (*)(void *__anonymous_object1760, const char *__anonymous_object1761))__sepSetTuple__F_P9sofstreamPCc__1), ((signed int (*)(void *__anonymous_object1762))__fail__Fi_P9sofstream__1), ((signed int (*)(void *__anonymous_object1763))__flush__Fi_P9sofstream__1), ((void (*)(void *__os__P7tostype_1, const char *__name__PCc_1, const char *__mode__PCc_1))__open__F_P9sofstreamPCcPCc__1), ((void (*)(void *__os__P7tostype_1))__close__F_P9sofstream__1), ((void *(*)(void *__anonymous_object1764, const char *__anonymous_object1765, unsigned long int __anonymous_object1766))__write__FP9sofstream_P9sofstreamPCcUl__1), ((signed int (*)(void *__anonymous_object1767, const char *__fmt__PCc_1, ...))__fmt__Fi_P9sofstreamPCc__1), _p0);
     486    }
     487    ((void)(((void)(_tmp_cp_ret14=___operator_bitor__A0_1_0_0___sepPrt__PFb_Pd0___sepReset__PF_Pd0___sepReset__PF_Pd0b___sepGetCur__PFPCc_Pd0___sepSetCur__PF_Pd0PCc___getNL__PFb_Pd0___setNL__PF_Pd0b___sepOn__PF_Pd0___sepOff__PF_Pd0___sepDisable__PFb_Pd0___sepEnable__PFb_Pd0___sepGet__PFPCc_Pd0___sepSet__PF_Pd0PCc___sepGetTuple__PFPCc_Pd0___sepSetTuple__PF_Pd0PCc___fail__PFi_Pd0___flush__PFi_Pd0___open__PF_Pd0PCcPCc___close__PF_Pd0___write__PFPd0_Pd0PCcUl___fmt__PFi_Pd0PCc__FPd0_Pd0PFPd0_Pd0___1(((_Bool (*)(void *__anonymous_object1768))__sepPrt__Fb_P9sofstream__1), ((void (*)(void *__anonymous_object1769))__sepReset__F_P9sofstream__1), ((void (*)(void *__anonymous_object1770, _Bool __anonymous_object1771))__sepReset__F_P9sofstreamb__1), ((const char *(*)(void *__anonymous_object1772))__sepGetCur__FPCc_P9sofstream__1), ((void (*)(void *__anonymous_object1773, const char *__anonymous_object1774))__sepSetCur__F_P9sofstreamPCc__1), ((_Bool (*)(void *__anonymous_object1775))__getNL__Fb_P9sofstream__1), ((void (*)(void *__anonymous_object1776, _Bool __anonymous_object1777))__setNL__F_P9sofstreamb__1), ((void (*)(void *__anonymous_object1778))__sepOn__F_P9sofstream__1), ((void (*)(void *__anonymous_object1779))__sepOff__F_P9sofstream__1), ((_Bool (*)(void *__anonymous_object1780))__sepDisable__Fb_P9sofstream__1), ((_Bool (*)(void *__anonymous_object1781))__sepEnable__Fb_P9sofstream__1), ((const char *(*)(void *__anonymous_object1782))__sepGet__FPCc_P9sofstream__1), ((void (*)(void *__anonymous_object1783, const char *__anonymous_object1784))__sepSet__F_P9sofstreamPCc__1), ((const char *(*)(void *__anonymous_object1785))__sepGetTuple__FPCc_P9sofstream__1), ((void (*)(void *__anonymous_object1786, const char *__anonymous_object1787))__sepSetTuple__F_P9sofstreamPCc__1), ((signed int (*)(void *__anonymous_object1788))__fail__Fi_P9sofstream__1), ((signed int (*)(void *__anonymous_object1789))__flush__Fi_P9sofstream__1), ((void (*)(void *__os__P7tostype_1, const char *__name__PCc_1, const char *__mode__PCc_1))__open__F_P9sofstreamPCcPCc__1), ((void (*)(void *__os__P7tostype_1))__close__F_P9sofstream__1), ((void *(*)(void *__anonymous_object1790, const char *__anonymous_object1791, unsigned long int __anonymous_object1792))__write__FP9sofstream_P9sofstreamPCcUl__1), ((signed int (*)(void *__anonymous_object1793, const char *__fmt__PCc_1, ...))__fmt__Fi_P9sofstreamPCc__1), (((void)(_tmp_cp_ret13=___operator_bitor__A0_1_0_0___sepPrt__PFb_Pd0___sepReset__PF_Pd0___sepReset__PF_Pd0b___sepGetCur__PFPCc_Pd0___sepSetCur__PF_Pd0PCc___getNL__PFb_Pd0___setNL__PF_Pd0b___sepOn__PF_Pd0___sepOff__PF_Pd0___sepDisable__PFb_Pd0___sepEnable__PFb_Pd0___sepGet__PFPCc_Pd0___sepSet__PF_Pd0PCc___sepGetTuple__PFPCc_Pd0___sepSetTuple__PF_Pd0PCc___fail__PFi_Pd0___flush__PFi_Pd0___open__PF_Pd0PCcPCc___close__PF_Pd0___write__PFPd0_Pd0PCcUl___fmt__PFi_Pd0PCc__FPd0_Pd0Us__1(((_Bool (*)(void *__anonymous_object1794))__sepPrt__Fb_P9sofstream__1), ((void (*)(void *__anonymous_object1795))__sepReset__F_P9sofstream__1), ((void (*)(void *__anonymous_object1796, _Bool __anonymous_object1797))__sepReset__F_P9sofstreamb__1), ((const char *(*)(void *__anonymous_object1798))__sepGetCur__FPCc_P9sofstream__1), ((void (*)(void *__anonymous_object1799, const char *__anonymous_object1800))__sepSetCur__F_P9sofstreamPCc__1), ((_Bool (*)(void *__anonymous_object1801))__getNL__Fb_P9sofstream__1), ((void (*)(void *__anonymous_object1802, _Bool __anonymous_object1803))__setNL__F_P9sofstreamb__1), ((void (*)(void *__anonymous_object1804))__sepOn__F_P9sofstream__1), ((void (*)(void *__anonymous_object1805))__sepOff__F_P9sofstream__1), ((_Bool (*)(void *__anonymous_object1806))__sepDisable__Fb_P9sofstream__1), ((_Bool (*)(void *__anonymous_object1807))__sepEnable__Fb_P9sofstream__1), ((const char *(*)(void *__anonymous_object1808))__sepGet__FPCc_P9sofstream__1), ((void (*)(void *__anonymous_object1809, const char *__anonymous_object1810))__sepSet__F_P9sofstreamPCc__1), ((const char *(*)(void *__anonymous_object1811))__sepGetTuple__FPCc_P9sofstream__1), ((void (*)(void *__anonymous_object1812, const char *__anonymous_object1813))__sepSetTuple__F_P9sofstreamPCc__1), ((signed int (*)(void *__anonymous_object1814))__fail__Fi_P9sofstream__1), ((signed int (*)(void *__anonymous_object1815))__flush__Fi_P9sofstream__1), ((void (*)(void *__os__P7tostype_1, const char *__name__PCc_1, const char *__mode__PCc_1))__open__F_P9sofstreamPCcPCc__1), ((void (*)(void *__os__P7tostype_1))__close__F_P9sofstream__1), ((void *(*)(void *__anonymous_object1816, const char *__anonymous_object1817, unsigned long int __anonymous_object1818))__write__FP9sofstream_P9sofstreamPCcUl__1), ((signed int (*)(void *__anonymous_object1819, const char *__fmt__PCc_1, ...))__fmt__Fi_P9sofstreamPCc__1), (((void)(_tmp_cp_ret12=___operator_bitor__A0_1_0_0___sepPrt__PFb_Pd0___sepReset__PF_Pd0___sepReset__PF_Pd0b___sepGetCur__PFPCc_Pd0___sepSetCur__PF_Pd0PCc___getNL__PFb_Pd0___setNL__PF_Pd0b___sepOn__PF_Pd0___sepOff__PF_Pd0___sepDisable__PFb_Pd0___sepEnable__PFb_Pd0___sepGet__PFPCc_Pd0___sepSet__PF_Pd0PCc___sepGetTuple__PFPCc_Pd0___sepSetTuple__PF_Pd0PCc___fail__PFi_Pd0___flush__PFi_Pd0___open__PF_Pd0PCcPCc___close__PF_Pd0___write__PFPd0_Pd0PCcUl___fmt__PFi_Pd0PCc__FPd0_Pd0PCc__1(((_Bool (*)(void *__anonymous_object1820))__sepPrt__Fb_P9sofstream__1), ((void (*)(void *__anonymous_object1821))__sepReset__F_P9sofstream__1), ((void (*)(void *__anonymous_object1822, _Bool __anonymous_object1823))__sepReset__F_P9sofstreamb__1), ((const char *(*)(void *__anonymous_object1824))__sepGetCur__FPCc_P9sofstream__1), ((void (*)(void *__anonymous_object1825, const char *__anonymous_object1826))__sepSetCur__F_P9sofstreamPCc__1), ((_Bool (*)(void *__anonymous_object1827))__getNL__Fb_P9sofstream__1), ((void (*)(void *__anonymous_object1828, _Bool __anonymous_object1829))__setNL__F_P9sofstreamb__1), ((void (*)(void *__anonymous_object1830))__sepOn__F_P9sofstream__1), ((void (*)(void *__anonymous_object1831))__sepOff__F_P9sofstream__1), ((_Bool (*)(void *__anonymous_object1832))__sepDisable__Fb_P9sofstream__1), ((_Bool (*)(void *__anonymous_object1833))__sepEnable__Fb_P9sofstream__1), ((const char *(*)(void *__anonymous_object1834))__sepGet__FPCc_P9sofstream__1), ((void (*)(void *__anonymous_object1835, const char *__anonymous_object1836))__sepSet__F_P9sofstreamPCc__1), ((const char *(*)(void *__anonymous_object1837))__sepGetTuple__FPCc_P9sofstream__1), ((void (*)(void *__anonymous_object1838, const char *__anonymous_object1839))__sepSetTuple__F_P9sofstreamPCc__1), ((signed int (*)(void *__anonymous_object1840))__fail__Fi_P9sofstream__1), ((signed int (*)(void *__anonymous_object1841))__flush__Fi_P9sofstream__1), ((void (*)(void *__os__P7tostype_1, const char *__name__PCc_1, const char *__mode__PCc_1))__open__F_P9sofstreamPCcPCc__1), ((void (*)(void *__os__P7tostype_1))__close__F_P9sofstream__1), ((void *(*)(void *__anonymous_object1842, const char *__anonymous_object1843, unsigned long int __anonymous_object1844))__write__FP9sofstream_P9sofstreamPCcUl__1), ((signed int (*)(void *__anonymous_object1845, const char *__fmt__PCc_1, ...))__fmt__Fi_P9sofstreamPCc__1), __sout__P9sofstream_1, "unsigned short int"))) , _tmp_cp_ret12), __v__Us_1))) , _tmp_cp_ret13), ((void *(*)(void *__anonymous_object1846))(&_thunk4))))) , _tmp_cp_ret14));
    519488    ((void)(_tmp_cp_ret12) /* ^?{} */);
    520489    ((void)(_tmp_cp_ret13) /* ^?{} */);
     
    526495    struct ofstream *_tmp_cp_ret17;
    527496    __attribute__ ((unused)) struct ofstream *_thunk5(struct ofstream *_p0){
    528         return __endl__A0_1_0_0___sepPrt__PFb_Pd0___sepReset__PF_Pd0___sepReset__PF_Pd0b___sepGetCur__PFPCc_Pd0___sepSetCur__PF_Pd0PCc___getNL__PFb_Pd0___setNL__PF_Pd0b___sepOn__PF_Pd0___sepOff__PF_Pd0___sepDisable__PFb_Pd0___sepEnable__PFb_Pd0___sepGet__PFPCc_Pd0___sepSet__PF_Pd0PCc___sepGetTuple__PFPCc_Pd0___sepSetTuple__PF_Pd0PCc___fail__PFi_Pd0___flush__PFi_Pd0___open__PF_Pd0PCcPCc___close__PF_Pd0___write__PFPd0_Pd0PCcUl___fmt__PFi_Pd0PCc__FPd0_Pd0__1(((_Bool (*)(void *__anonymous_object1847))__sepPrt__Fb_P9sofstream__1), ((void (*)(void *__anonymous_object1848))__sepReset__F_P9sofstream__1), ((void (*)(void *__anonymous_object1849, _Bool __anonymous_object1850))__sepReset__F_P9sofstreamb__1), ((const char *(*)(void *__anonymous_object1851))__sepGetCur__FPCc_P9sofstream__1), ((void (*)(void *__anonymous_object1852, const char *__anonymous_object1853))__sepSetCur__F_P9sofstreamPCc__1), ((_Bool (*)(void *__anonymous_object1854))__getNL__Fb_P9sofstream__1), ((void (*)(void *__anonymous_object1855, _Bool __anonymous_object1856))__setNL__F_P9sofstreamb__1), ((void (*)(void *__anonymous_object1857))__sepOn__F_P9sofstream__1), ((void (*)(void *__anonymous_object1858))__sepOff__F_P9sofstream__1), ((_Bool (*)(void *__anonymous_object1859))__sepDisable__Fb_P9sofstream__1), ((_Bool (*)(void *__anonymous_object1860))__sepEnable__Fb_P9sofstream__1), ((const char *(*)(void *__anonymous_object1861))__sepGet__FPCc_P9sofstream__1), ((void (*)(void *__anonymous_object1862, const char *__anonymous_object1863))__sepSet__F_P9sofstreamPCc__1), ((const char *(*)(void *__anonymous_object1864))__sepGetTuple__FPCc_P9sofstream__1), ((void (*)(void *__anonymous_object1865, const char *__anonymous_object1866))__sepSetTuple__F_P9sofstreamPCc__1), ((signed int (*)(void *__anonymous_object1867))__fail__Fi_P9sofstream__1), ((signed int (*)(void *__anonymous_object1868))__flush__Fi_P9sofstream__1), ((void (*)(void *__os__P7tostype_1, const char *__name__PCc_1, const char *__mode__PCc_1))__open__F_P9sofstreamPCcPCc__1), ((void (*)(void *__os__P7tostype_1))__close__F_P9sofstream__1), ((void *(*)(void *__anonymous_object1869, const char *__anonymous_object1870, unsigned long int __anonymous_object1871))__write__FP9sofstream_P9sofstreamPCcUl__1), ((signed int (*)(void *__anonymous_object1872, const char *__fmt__PCc_1, ...))__fmt__Fi_P9sofstreamPCc__1), ((void *)_p0));
    529     }
    530     ((void)(((void)(_tmp_cp_ret17=___operator_bitor__A0_1_0_0___sepPrt__PFb_Pd0___sepReset__PF_Pd0___sepReset__PF_Pd0b___sepGetCur__PFPCc_Pd0___sepSetCur__PF_Pd0PCc___getNL__PFb_Pd0___setNL__PF_Pd0b___sepOn__PF_Pd0___sepOff__PF_Pd0___sepDisable__PFb_Pd0___sepEnable__PFb_Pd0___sepGet__PFPCc_Pd0___sepSet__PF_Pd0PCc___sepGetTuple__PFPCc_Pd0___sepSetTuple__PF_Pd0PCc___fail__PFi_Pd0___flush__PFi_Pd0___open__PF_Pd0PCcPCc___close__PF_Pd0___write__PFPd0_Pd0PCcUl___fmt__PFi_Pd0PCc__FPd0_Pd0PFPd0_Pd0___1(((_Bool (*)(void *__anonymous_object1873))__sepPrt__Fb_P9sofstream__1), ((void (*)(void *__anonymous_object1874))__sepReset__F_P9sofstream__1), ((void (*)(void *__anonymous_object1875, _Bool __anonymous_object1876))__sepReset__F_P9sofstreamb__1), ((const char *(*)(void *__anonymous_object1877))__sepGetCur__FPCc_P9sofstream__1), ((void (*)(void *__anonymous_object1878, const char *__anonymous_object1879))__sepSetCur__F_P9sofstreamPCc__1), ((_Bool (*)(void *__anonymous_object1880))__getNL__Fb_P9sofstream__1), ((void (*)(void *__anonymous_object1881, _Bool __anonymous_object1882))__setNL__F_P9sofstreamb__1), ((void (*)(void *__anonymous_object1883))__sepOn__F_P9sofstream__1), ((void (*)(void *__anonymous_object1884))__sepOff__F_P9sofstream__1), ((_Bool (*)(void *__anonymous_object1885))__sepDisable__Fb_P9sofstream__1), ((_Bool (*)(void *__anonymous_object1886))__sepEnable__Fb_P9sofstream__1), ((const char *(*)(void *__anonymous_object1887))__sepGet__FPCc_P9sofstream__1), ((void (*)(void *__anonymous_object1888, const char *__anonymous_object1889))__sepSet__F_P9sofstreamPCc__1), ((const char *(*)(void *__anonymous_object1890))__sepGetTuple__FPCc_P9sofstream__1), ((void (*)(void *__anonymous_object1891, const char *__anonymous_object1892))__sepSetTuple__F_P9sofstreamPCc__1), ((signed int (*)(void *__anonymous_object1893))__fail__Fi_P9sofstream__1), ((signed int (*)(void *__anonymous_object1894))__flush__Fi_P9sofstream__1), ((void (*)(void *__os__P7tostype_1, const char *__name__PCc_1, const char *__mode__PCc_1))__open__F_P9sofstreamPCcPCc__1), ((void (*)(void *__os__P7tostype_1))__close__F_P9sofstream__1), ((void *(*)(void *__anonymous_object1895, const char *__anonymous_object1896, unsigned long int __anonymous_object1897))__write__FP9sofstream_P9sofstreamPCcUl__1), ((signed int (*)(void *__anonymous_object1898, const char *__fmt__PCc_1, ...))__fmt__Fi_P9sofstreamPCc__1), ((void *)(((void)(_tmp_cp_ret16=___operator_bitor__A0_1_0_0___sepPrt__PFb_Pd0___sepReset__PF_Pd0___sepReset__PF_Pd0b___sepGetCur__PFPCc_Pd0___sepSetCur__PF_Pd0PCc___getNL__PFb_Pd0___setNL__PF_Pd0b___sepOn__PF_Pd0___sepOff__PF_Pd0___sepDisable__PFb_Pd0___sepEnable__PFb_Pd0___sepGet__PFPCc_Pd0___sepSet__PF_Pd0PCc___sepGetTuple__PFPCc_Pd0___sepSetTuple__PF_Pd0PCc___fail__PFi_Pd0___flush__PFi_Pd0___open__PF_Pd0PCcPCc___close__PF_Pd0___write__PFPd0_Pd0PCcUl___fmt__PFi_Pd0PCc__FPd0_Pd0Ui__1(((_Bool (*)(void *__anonymous_object1899))__sepPrt__Fb_P9sofstream__1), ((void (*)(void *__anonymous_object1900))__sepReset__F_P9sofstream__1), ((void (*)(void *__anonymous_object1901, _Bool __anonymous_object1902))__sepReset__F_P9sofstreamb__1), ((const char *(*)(void *__anonymous_object1903))__sepGetCur__FPCc_P9sofstream__1), ((void (*)(void *__anonymous_object1904, const char *__anonymous_object1905))__sepSetCur__F_P9sofstreamPCc__1), ((_Bool (*)(void *__anonymous_object1906))__getNL__Fb_P9sofstream__1), ((void (*)(void *__anonymous_object1907, _Bool __anonymous_object1908))__setNL__F_P9sofstreamb__1), ((void (*)(void *__anonymous_object1909))__sepOn__F_P9sofstream__1), ((void (*)(void *__anonymous_object1910))__sepOff__F_P9sofstream__1), ((_Bool (*)(void *__anonymous_object1911))__sepDisable__Fb_P9sofstream__1), ((_Bool (*)(void *__anonymous_object1912))__sepEnable__Fb_P9sofstream__1), ((const char *(*)(void *__anonymous_object1913))__sepGet__FPCc_P9sofstream__1), ((void (*)(void *__anonymous_object1914, const char *__anonymous_object1915))__sepSet__F_P9sofstreamPCc__1), ((const char *(*)(void *__anonymous_object1916))__sepGetTuple__FPCc_P9sofstream__1), ((void (*)(void *__anonymous_object1917, const char *__anonymous_object1918))__sepSetTuple__F_P9sofstreamPCc__1), ((signed int (*)(void *__anonymous_object1919))__fail__Fi_P9sofstream__1), ((signed int (*)(void *__anonymous_object1920))__flush__Fi_P9sofstream__1), ((void (*)(void *__os__P7tostype_1, const char *__name__PCc_1, const char *__mode__PCc_1))__open__F_P9sofstreamPCcPCc__1), ((void (*)(void *__os__P7tostype_1))__close__F_P9sofstream__1), ((void *(*)(void *__anonymous_object1921, const char *__anonymous_object1922, unsigned long int __anonymous_object1923))__write__FP9sofstream_P9sofstreamPCcUl__1), ((signed int (*)(void *__anonymous_object1924, const char *__fmt__PCc_1, ...))__fmt__Fi_P9sofstreamPCc__1), ((void *)(((void)(_tmp_cp_ret15=___operator_bitor__A0_1_0_0___sepPrt__PFb_Pd0___sepReset__PF_Pd0___sepReset__PF_Pd0b___sepGetCur__PFPCc_Pd0___sepSetCur__PF_Pd0PCc___getNL__PFb_Pd0___setNL__PF_Pd0b___sepOn__PF_Pd0___sepOff__PF_Pd0___sepDisable__PFb_Pd0___sepEnable__PFb_Pd0___sepGet__PFPCc_Pd0___sepSet__PF_Pd0PCc___sepGetTuple__PFPCc_Pd0___sepSetTuple__PF_Pd0PCc___fail__PFi_Pd0___flush__PFi_Pd0___open__PF_Pd0PCcPCc___close__PF_Pd0___write__PFPd0_Pd0PCcUl___fmt__PFi_Pd0PCc__FPd0_Pd0PCc__1(((_Bool (*)(void *__anonymous_object1925))__sepPrt__Fb_P9sofstream__1), ((void (*)(void *__anonymous_object1926))__sepReset__F_P9sofstream__1), ((void (*)(void *__anonymous_object1927, _Bool __anonymous_object1928))__sepReset__F_P9sofstreamb__1), ((const char *(*)(void *__anonymous_object1929))__sepGetCur__FPCc_P9sofstream__1), ((void (*)(void *__anonymous_object1930, const char *__anonymous_object1931))__sepSetCur__F_P9sofstreamPCc__1), ((_Bool (*)(void *__anonymous_object1932))__getNL__Fb_P9sofstream__1), ((void (*)(void *__anonymous_object1933, _Bool __anonymous_object1934))__setNL__F_P9sofstreamb__1), ((void (*)(void *__anonymous_object1935))__sepOn__F_P9sofstream__1), ((void (*)(void *__anonymous_object1936))__sepOff__F_P9sofstream__1), ((_Bool (*)(void *__anonymous_object1937))__sepDisable__Fb_P9sofstream__1), ((_Bool (*)(void *__anonymous_object1938))__sepEnable__Fb_P9sofstream__1), ((const char *(*)(void *__anonymous_object1939))__sepGet__FPCc_P9sofstream__1), ((void (*)(void *__anonymous_object1940, const char *__anonymous_object1941))__sepSet__F_P9sofstreamPCc__1), ((const char *(*)(void *__anonymous_object1942))__sepGetTuple__FPCc_P9sofstream__1), ((void (*)(void *__anonymous_object1943, const char *__anonymous_object1944))__sepSetTuple__F_P9sofstreamPCc__1), ((signed int (*)(void *__anonymous_object1945))__fail__Fi_P9sofstream__1), ((signed int (*)(void *__anonymous_object1946))__flush__Fi_P9sofstream__1), ((void (*)(void *__os__P7tostype_1, const char *__name__PCc_1, const char *__mode__PCc_1))__open__F_P9sofstreamPCcPCc__1), ((void (*)(void *__os__P7tostype_1))__close__F_P9sofstream__1), ((void *(*)(void *__anonymous_object1947, const char *__anonymous_object1948, unsigned long int __anonymous_object1949))__write__FP9sofstream_P9sofstreamPCcUl__1), ((signed int (*)(void *__anonymous_object1950, const char *__fmt__PCc_1, ...))__fmt__Fi_P9sofstreamPCc__1), ((void *)__sout__P9sofstream_1), "size_t"))) , _tmp_cp_ret15)), __v__Ui_1))) , _tmp_cp_ret16)), ((void *(*)(void *__anonymous_object1951))(&_thunk5))))) , _tmp_cp_ret17));
     497        return __endl__A0_1_0_0___sepPrt__PFb_Pd0___sepReset__PF_Pd0___sepReset__PF_Pd0b___sepGetCur__PFPCc_Pd0___sepSetCur__PF_Pd0PCc___getNL__PFb_Pd0___setNL__PF_Pd0b___sepOn__PF_Pd0___sepOff__PF_Pd0___sepDisable__PFb_Pd0___sepEnable__PFb_Pd0___sepGet__PFPCc_Pd0___sepSet__PF_Pd0PCc___sepGetTuple__PFPCc_Pd0___sepSetTuple__PF_Pd0PCc___fail__PFi_Pd0___flush__PFi_Pd0___open__PF_Pd0PCcPCc___close__PF_Pd0___write__PFPd0_Pd0PCcUl___fmt__PFi_Pd0PCc__FPd0_Pd0__1(((_Bool (*)(void *__anonymous_object1847))__sepPrt__Fb_P9sofstream__1), ((void (*)(void *__anonymous_object1848))__sepReset__F_P9sofstream__1), ((void (*)(void *__anonymous_object1849, _Bool __anonymous_object1850))__sepReset__F_P9sofstreamb__1), ((const char *(*)(void *__anonymous_object1851))__sepGetCur__FPCc_P9sofstream__1), ((void (*)(void *__anonymous_object1852, const char *__anonymous_object1853))__sepSetCur__F_P9sofstreamPCc__1), ((_Bool (*)(void *__anonymous_object1854))__getNL__Fb_P9sofstream__1), ((void (*)(void *__anonymous_object1855, _Bool __anonymous_object1856))__setNL__F_P9sofstreamb__1), ((void (*)(void *__anonymous_object1857))__sepOn__F_P9sofstream__1), ((void (*)(void *__anonymous_object1858))__sepOff__F_P9sofstream__1), ((_Bool (*)(void *__anonymous_object1859))__sepDisable__Fb_P9sofstream__1), ((_Bool (*)(void *__anonymous_object1860))__sepEnable__Fb_P9sofstream__1), ((const char *(*)(void *__anonymous_object1861))__sepGet__FPCc_P9sofstream__1), ((void (*)(void *__anonymous_object1862, const char *__anonymous_object1863))__sepSet__F_P9sofstreamPCc__1), ((const char *(*)(void *__anonymous_object1864))__sepGetTuple__FPCc_P9sofstream__1), ((void (*)(void *__anonymous_object1865, const char *__anonymous_object1866))__sepSetTuple__F_P9sofstreamPCc__1), ((signed int (*)(void *__anonymous_object1867))__fail__Fi_P9sofstream__1), ((signed int (*)(void *__anonymous_object1868))__flush__Fi_P9sofstream__1), ((void (*)(void *__os__P7tostype_1, const char *__name__PCc_1, const char *__mode__PCc_1))__open__F_P9sofstreamPCcPCc__1), ((void (*)(void *__os__P7tostype_1))__close__F_P9sofstream__1), ((void *(*)(void *__anonymous_object1869, const char *__anonymous_object1870, unsigned long int __anonymous_object1871))__write__FP9sofstream_P9sofstreamPCcUl__1), ((signed int (*)(void *__anonymous_object1872, const char *__fmt__PCc_1, ...))__fmt__Fi_P9sofstreamPCc__1), _p0);
     498    }
     499    ((void)(((void)(_tmp_cp_ret17=___operator_bitor__A0_1_0_0___sepPrt__PFb_Pd0___sepReset__PF_Pd0___sepReset__PF_Pd0b___sepGetCur__PFPCc_Pd0___sepSetCur__PF_Pd0PCc___getNL__PFb_Pd0___setNL__PF_Pd0b___sepOn__PF_Pd0___sepOff__PF_Pd0___sepDisable__PFb_Pd0___sepEnable__PFb_Pd0___sepGet__PFPCc_Pd0___sepSet__PF_Pd0PCc___sepGetTuple__PFPCc_Pd0___sepSetTuple__PF_Pd0PCc___fail__PFi_Pd0___flush__PFi_Pd0___open__PF_Pd0PCcPCc___close__PF_Pd0___write__PFPd0_Pd0PCcUl___fmt__PFi_Pd0PCc__FPd0_Pd0PFPd0_Pd0___1(((_Bool (*)(void *__anonymous_object1873))__sepPrt__Fb_P9sofstream__1), ((void (*)(void *__anonymous_object1874))__sepReset__F_P9sofstream__1), ((void (*)(void *__anonymous_object1875, _Bool __anonymous_object1876))__sepReset__F_P9sofstreamb__1), ((const char *(*)(void *__anonymous_object1877))__sepGetCur__FPCc_P9sofstream__1), ((void (*)(void *__anonymous_object1878, const char *__anonymous_object1879))__sepSetCur__F_P9sofstreamPCc__1), ((_Bool (*)(void *__anonymous_object1880))__getNL__Fb_P9sofstream__1), ((void (*)(void *__anonymous_object1881, _Bool __anonymous_object1882))__setNL__F_P9sofstreamb__1), ((void (*)(void *__anonymous_object1883))__sepOn__F_P9sofstream__1), ((void (*)(void *__anonymous_object1884))__sepOff__F_P9sofstream__1), ((_Bool (*)(void *__anonymous_object1885))__sepDisable__Fb_P9sofstream__1), ((_Bool (*)(void *__anonymous_object1886))__sepEnable__Fb_P9sofstream__1), ((const char *(*)(void *__anonymous_object1887))__sepGet__FPCc_P9sofstream__1), ((void (*)(void *__anonymous_object1888, const char *__anonymous_object1889))__sepSet__F_P9sofstreamPCc__1), ((const char *(*)(void *__anonymous_object1890))__sepGetTuple__FPCc_P9sofstream__1), ((void (*)(void *__anonymous_object1891, const char *__anonymous_object1892))__sepSetTuple__F_P9sofstreamPCc__1), ((signed int (*)(void *__anonymous_object1893))__fail__Fi_P9sofstream__1), ((signed int (*)(void *__anonymous_object1894))__flush__Fi_P9sofstream__1), ((void (*)(void *__os__P7tostype_1, const char *__name__PCc_1, const char *__mode__PCc_1))__open__F_P9sofstreamPCcPCc__1), ((void (*)(void *__os__P7tostype_1))__close__F_P9sofstream__1), ((void *(*)(void *__anonymous_object1895, const char *__anonymous_object1896, unsigned long int __anonymous_object1897))__write__FP9sofstream_P9sofstreamPCcUl__1), ((signed int (*)(void *__anonymous_object1898, const char *__fmt__PCc_1, ...))__fmt__Fi_P9sofstreamPCc__1), (((void)(_tmp_cp_ret16=___operator_bitor__A0_1_0_0___sepPrt__PFb_Pd0___sepReset__PF_Pd0___sepReset__PF_Pd0b___sepGetCur__PFPCc_Pd0___sepSetCur__PF_Pd0PCc___getNL__PFb_Pd0___setNL__PF_Pd0b___sepOn__PF_Pd0___sepOff__PF_Pd0___sepDisable__PFb_Pd0___sepEnable__PFb_Pd0___sepGet__PFPCc_Pd0___sepSet__PF_Pd0PCc___sepGetTuple__PFPCc_Pd0___sepSetTuple__PF_Pd0PCc___fail__PFi_Pd0___flush__PFi_Pd0___open__PF_Pd0PCcPCc___close__PF_Pd0___write__PFPd0_Pd0PCcUl___fmt__PFi_Pd0PCc__FPd0_Pd0Ui__1(((_Bool (*)(void *__anonymous_object1899))__sepPrt__Fb_P9sofstream__1), ((void (*)(void *__anonymous_object1900))__sepReset__F_P9sofstream__1), ((void (*)(void *__anonymous_object1901, _Bool __anonymous_object1902))__sepReset__F_P9sofstreamb__1), ((const char *(*)(void *__anonymous_object1903))__sepGetCur__FPCc_P9sofstream__1), ((void (*)(void *__anonymous_object1904, const char *__anonymous_object1905))__sepSetCur__F_P9sofstreamPCc__1), ((_Bool (*)(void *__anonymous_object1906))__getNL__Fb_P9sofstream__1), ((void (*)(void *__anonymous_object1907, _Bool __anonymous_object1908))__setNL__F_P9sofstreamb__1), ((void (*)(void *__anonymous_object1909))__sepOn__F_P9sofstream__1), ((void (*)(void *__anonymous_object1910))__sepOff__F_P9sofstream__1), ((_Bool (*)(void *__anonymous_object1911))__sepDisable__Fb_P9sofstream__1), ((_Bool (*)(void *__anonymous_object1912))__sepEnable__Fb_P9sofstream__1), ((const char *(*)(void *__anonymous_object1913))__sepGet__FPCc_P9sofstream__1), ((void (*)(void *__anonymous_object1914, const char *__anonymous_object1915))__sepSet__F_P9sofstreamPCc__1), ((const char *(*)(void *__anonymous_object1916))__sepGetTuple__FPCc_P9sofstream__1), ((void (*)(void *__anonymous_object1917, const char *__anonymous_object1918))__sepSetTuple__F_P9sofstreamPCc__1), ((signed int (*)(void *__anonymous_object1919))__fail__Fi_P9sofstream__1), ((signed int (*)(void *__anonymous_object1920))__flush__Fi_P9sofstream__1), ((void (*)(void *__os__P7tostype_1, const char *__name__PCc_1, const char *__mode__PCc_1))__open__F_P9sofstreamPCcPCc__1), ((void (*)(void *__os__P7tostype_1))__close__F_P9sofstream__1), ((void *(*)(void *__anonymous_object1921, const char *__anonymous_object1922, unsigned long int __anonymous_object1923))__write__FP9sofstream_P9sofstreamPCcUl__1), ((signed int (*)(void *__anonymous_object1924, const char *__fmt__PCc_1, ...))__fmt__Fi_P9sofstreamPCc__1), (((void)(_tmp_cp_ret15=___operator_bitor__A0_1_0_0___sepPrt__PFb_Pd0___sepReset__PF_Pd0___sepReset__PF_Pd0b___sepGetCur__PFPCc_Pd0___sepSetCur__PF_Pd0PCc___getNL__PFb_Pd0___setNL__PF_Pd0b___sepOn__PF_Pd0___sepOff__PF_Pd0___sepDisable__PFb_Pd0___sepEnable__PFb_Pd0___sepGet__PFPCc_Pd0___sepSet__PF_Pd0PCc___sepGetTuple__PFPCc_Pd0___sepSetTuple__PF_Pd0PCc___fail__PFi_Pd0___flush__PFi_Pd0___open__PF_Pd0PCcPCc___close__PF_Pd0___write__PFPd0_Pd0PCcUl___fmt__PFi_Pd0PCc__FPd0_Pd0PCc__1(((_Bool (*)(void *__anonymous_object1925))__sepPrt__Fb_P9sofstream__1), ((void (*)(void *__anonymous_object1926))__sepReset__F_P9sofstream__1), ((void (*)(void *__anonymous_object1927, _Bool __anonymous_object1928))__sepReset__F_P9sofstreamb__1), ((const char *(*)(void *__anonymous_object1929))__sepGetCur__FPCc_P9sofstream__1), ((void (*)(void *__anonymous_object1930, const char *__anonymous_object1931))__sepSetCur__F_P9sofstreamPCc__1), ((_Bool (*)(void *__anonymous_object1932))__getNL__Fb_P9sofstream__1), ((void (*)(void *__anonymous_object1933, _Bool __anonymous_object1934))__setNL__F_P9sofstreamb__1), ((void (*)(void *__anonymous_object1935))__sepOn__F_P9sofstream__1), ((void (*)(void *__anonymous_object1936))__sepOff__F_P9sofstream__1), ((_Bool (*)(void *__anonymous_object1937))__sepDisable__Fb_P9sofstream__1), ((_Bool (*)(void *__anonymous_object1938))__sepEnable__Fb_P9sofstream__1), ((const char *(*)(void *__anonymous_object1939))__sepGet__FPCc_P9sofstream__1), ((void (*)(void *__anonymous_object1940, const char *__anonymous_object1941))__sepSet__F_P9sofstreamPCc__1), ((const char *(*)(void *__anonymous_object1942))__sepGetTuple__FPCc_P9sofstream__1), ((void (*)(void *__anonymous_object1943, const char *__anonymous_object1944))__sepSetTuple__F_P9sofstreamPCc__1), ((signed int (*)(void *__anonymous_object1945))__fail__Fi_P9sofstream__1), ((signed int (*)(void *__anonymous_object1946))__flush__Fi_P9sofstream__1), ((void (*)(void *__os__P7tostype_1, const char *__name__PCc_1, const char *__mode__PCc_1))__open__F_P9sofstreamPCcPCc__1), ((void (*)(void *__os__P7tostype_1))__close__F_P9sofstream__1), ((void *(*)(void *__anonymous_object1947, const char *__anonymous_object1948, unsigned long int __anonymous_object1949))__write__FP9sofstream_P9sofstreamPCcUl__1), ((signed int (*)(void *__anonymous_object1950, const char *__fmt__PCc_1, ...))__fmt__Fi_P9sofstreamPCc__1), __sout__P9sofstream_1, "size_t"))) , _tmp_cp_ret15), __v__Ui_1))) , _tmp_cp_ret16), ((void *(*)(void *__anonymous_object1951))(&_thunk5))))) , _tmp_cp_ret17));
    531500    ((void)(_tmp_cp_ret15) /* ^?{} */);
    532501    ((void)(_tmp_cp_ret16) /* ^?{} */);
     
    739708    ((void)0123456789.e-09L);
    740709    ((void)0123456789.e-09DL);
    741     ((void)(+0123456789.e-09));
    742     ((void)(+0123456789.e-09f));
    743     ((void)(+0123456789.e-09l));
    744     ((void)(+0123456789.e-09F));
    745     ((void)(+0123456789.e-09L));
    746     ((void)(+0123456789.e-09DL));
     710    ((void)(-0123456789.e-09));
     711    ((void)(-0123456789.e-09f));
     712    ((void)(-0123456789.e-09l));
     713    ((void)(-0123456789.e-09F));
     714    ((void)(-0123456789.e-09L));
     715    ((void)(-0123456789.e-09DL));
    747716    ((void)(-0123456789.e-09));
    748717    ((void)(-0123456789.e-09f));
     
    883852    ((void)0123456789.0123456789E-09L);
    884853    ((void)0123456789.0123456789E-09DL);
    885     ((void)(+0123456789.0123456789E-09));
    886     ((void)(+0123456789.0123456789E-09f));
    887     ((void)(+0123456789.0123456789E-09l));
    888     ((void)(+0123456789.0123456789E-09F));
    889     ((void)(+0123456789.0123456789E-09L));
    890     ((void)(+0123456789.0123456789E-09DL));
     854    ((void)(-0123456789.0123456789E-09));
     855    ((void)(-0123456789.0123456789E-09f));
     856    ((void)(-0123456789.0123456789E-09l));
     857    ((void)(-0123456789.0123456789E-09F));
     858    ((void)(-0123456789.0123456789E-09L));
     859    ((void)(-0123456789.0123456789E-09DL));
    891860    ((void)(-0123456789.0123456789E-09));
    892861    ((void)(-0123456789.0123456789E-09f));
     
    930899    ((void)0x0123456789.p-09F);
    931900    ((void)0x0123456789.p-09L);
    932     ((void)(+0x0123456789.p-09));
    933     ((void)(+0x0123456789.p-09f));
    934     ((void)(+0x0123456789.p-09l));
    935     ((void)(+0x0123456789.p-09F));
    936     ((void)(+0x0123456789.p-09L));
     901    ((void)(-0x0123456789.p-09));
     902    ((void)(-0x0123456789.p-09f));
     903    ((void)(-0x0123456789.p-09l));
     904    ((void)(-0x0123456789.p-09F));
     905    ((void)(-0x0123456789.p-09L));
    937906    ((void)(-0x0123456789.p-09));
    938907    ((void)(-0x0123456789.p-09f));
     
    975944    ((void)0x.0123456789P-09F);
    976945    ((void)0x.0123456789P-09L);
    977     ((void)(+0x.0123456789P-09));
    978     ((void)(+0x.0123456789P-09f));
    979     ((void)(+0x.0123456789P-09l));
    980     ((void)(+0x.0123456789P-09F));
    981     ((void)(+0x.0123456789P-09L));
     946    ((void)(-0x.0123456789P-09));
     947    ((void)(-0x.0123456789P-09f));
     948    ((void)(-0x.0123456789P-09l));
     949    ((void)(-0x.0123456789P-09F));
     950    ((void)(-0x.0123456789P-09L));
    982951    ((void)(-0x.0123456789P-09));
    983952    ((void)(-0x.0123456789P-09f));
     
    1020989    ((void)0X0123456789.0123456789P-09F);
    1021990    ((void)0X0123456789.0123456789P-09L);
    1022     ((void)(+0X0123456789.0123456789P-09));
    1023     ((void)(+0X0123456789.0123456789P-09f));
    1024     ((void)(+0X0123456789.0123456789P-09l));
    1025     ((void)(+0X0123456789.0123456789P-09F));
    1026     ((void)(+0X0123456789.0123456789P-09L));
    1027991    ((void)(-0X0123456789.0123456789P-09));
    1028992    ((void)(-0X0123456789.0123456789P-09f));
     
    1030994    ((void)(-0X0123456789.0123456789P-09F));
    1031995    ((void)(-0X0123456789.0123456789P-09L));
    1032     ((void)((signed char )01234567));
    1033     ((void)((signed short int )01234567));
    1034     ((void)((signed int )01234567));
    1035     ((void)((signed long long int )01234567));
    1036     ((void)((__int128 )01234567));
    1037     ((void)((unsigned char )01234567u));
    1038     ((void)((signed short int )01234567u));
    1039     ((void)((unsigned int )01234567u));
    1040     ((void)((signed long long int )01234567u));
    1041     ((void)((__int128 )01234567u));
    1042     ((void)(+((signed int )((signed char )01234567))));
    1043     ((void)(+((signed int )((signed short int )01234567))));
    1044     ((void)(+((signed int )01234567)));
    1045     ((void)(+((signed long long int )01234567)));
    1046     ((void)(+((float )((__int128 )01234567))));
    1047     ((void)(+((signed int )((unsigned char )01234567u))));
    1048     ((void)(+((signed int )((signed short int )01234567u))));
    1049     ((void)(+((unsigned int )01234567u)));
    1050     ((void)(+((signed long long int )01234567u)));
    1051     ((void)(+((float )((__int128 )01234567u))));
    1052     ((void)(-((signed int )((signed char )01234567))));
    1053     ((void)(-((signed int )((signed short int )01234567))));
    1054     ((void)(-((signed int )01234567)));
    1055     ((void)(-((signed long long int )01234567)));
    1056     ((void)(-((float )((__int128 )01234567))));
    1057     ((void)(-((signed int )((unsigned char )01234567u))));
    1058     ((void)(-((signed int )((signed short int )01234567u))));
    1059     ((void)(-((unsigned int )01234567u)));
    1060     ((void)(-((signed long long int )01234567u)));
    1061     ((void)(-((float )((__int128 )01234567u))));
    1062     ((void)((signed char )1234567890));
    1063     ((void)((signed short int )1234567890));
    1064     ((void)((signed int )1234567890));
    1065     ((void)((signed long long int )1234567890));
    1066     ((void)((__int128 )1234567890));
    1067     ((void)((signed char )1234567890U));
    1068     ((void)((unsigned short int )1234567890U));
    1069     ((void)((signed int )1234567890U));
    1070     ((void)((unsigned long long int )1234567890u));
    1071     ((void)((unsigned __int128 )1234567890u));
    1072     ((void)(+((signed int )((signed char )1234567890))));
    1073     ((void)(+((signed int )((signed short int )1234567890))));
    1074     ((void)(+((signed int )1234567890)));
    1075     ((void)(+((signed long long int )1234567890)));
    1076     ((void)(+((float )((__int128 )1234567890))));
    1077     ((void)(+((signed int )((signed char )1234567890U))));
    1078     ((void)(+((signed int )((unsigned short int )1234567890U))));
    1079     ((void)(+((signed int )1234567890U)));
    1080     ((void)(+((unsigned long long int )1234567890u)));
    1081     ((void)(+((float )((unsigned __int128 )1234567890u))));
    1082     ((void)(-((signed int )((signed char )1234567890))));
    1083     ((void)(-((signed int )((signed short int )1234567890))));
    1084     ((void)(-((signed int )1234567890)));
    1085     ((void)(-((signed long long int )1234567890)));
    1086     ((void)(-((float )((__int128 )1234567890))));
    1087     ((void)(-((signed int )((signed char )1234567890U))));
    1088     ((void)(-((signed int )((unsigned short int )1234567890U))));
    1089     ((void)(-((signed int )1234567890U)));
    1090     ((void)(-((unsigned long long int )1234567890u)));
    1091     ((void)(-((float )((unsigned __int128 )1234567890u))));
    1092     ((void)((signed char )0x0123456789abcdef));
    1093     ((void)((signed short int )0x0123456789abcdef));
    1094     ((void)((signed int )0x0123456789abcdef));
    1095     ((void)((signed long long int )0x0123456789abcdef));
    1096     ((void)((signed char )0x0123456789abcdefu));
    1097     ((void)((unsigned short int )0x0123456789abcdefu));
    1098     ((void)((signed int )0x0123456789abcdefu));
    1099     ((void)((unsigned long long int )0x0123456789abcdefu));
    1100     ((void)(+((signed int )((signed char )0x0123456789abcdef))));
    1101     ((void)(+((signed int )((signed short int )0x0123456789abcdef))));
    1102     ((void)(+((signed int )0x0123456789abcdef)));
    1103     ((void)(+((signed long long int )0x0123456789abcdef)));
    1104     ((void)(+((signed int )((signed char )0x0123456789abcdefu))));
    1105     ((void)(+((signed int )((unsigned short int )0x0123456789abcdefu))));
    1106     ((void)(+((signed int )0x0123456789abcdefu)));
    1107     ((void)(+((unsigned long long int )0x0123456789abcdefu)));
    1108     ((void)(-((signed int )((signed char )0x0123456789abcdef))));
    1109     ((void)(-((signed int )((signed short int )0x0123456789abcdef))));
    1110     ((void)(-((signed int )0x0123456789abcdef)));
    1111     ((void)(-((signed long long int )0x0123456789abcdef)));
    1112     ((void)(-((signed int )((signed char )0x0123456789abcdefu))));
    1113     ((void)(-((signed int )((unsigned short int )0x0123456789abcdefu))));
    1114     ((void)(-((signed int )0x0123456789abcdefu)));
    1115     ((void)(-((unsigned long long int )0x0123456789abcdefu)));
    1116     ((void)((signed char )0x0123456789ABCDEF));
    1117     ((void)((signed short int )0x0123456789ABCDEF));
    1118     ((void)((signed int )0x0123456789ABCDEF));
    1119     ((void)((signed long long int )0x0123456789ABCDEF));
    1120     ((void)((signed char )0x0123456789ABCDEFu));
    1121     ((void)((unsigned short int )0x0123456789ABCDEFu));
    1122     ((void)((signed int )0x0123456789ABCDEFu));
    1123     ((void)((unsigned long long int )0x0123456789ABCDEFu));
    1124     ((void)(+((signed int )((signed char )0x0123456789ABCDEF))));
    1125     ((void)(+((signed int )((signed short int )0x0123456789ABCDEF))));
    1126     ((void)(+((signed int )0x0123456789ABCDEF)));
    1127     ((void)(+((signed long long int )0x0123456789ABCDEF)));
    1128     ((void)(+((signed int )((signed char )0x0123456789ABCDEFu))));
    1129     ((void)(+((signed int )((unsigned short int )0x0123456789ABCDEFu))));
    1130     ((void)(+((signed int )0x0123456789ABCDEFu)));
    1131     ((void)(+((unsigned long long int )0x0123456789ABCDEFu)));
    1132     ((void)(-((signed int )((signed char )0x0123456789ABCDEF))));
    1133     ((void)(-((signed int )((signed short int )0x0123456789ABCDEF))));
    1134     ((void)(-((signed int )0x0123456789ABCDEF)));
    1135     ((void)(-((signed long long int )0x0123456789ABCDEF)));
    1136     ((void)(-((signed int )((signed char )0x0123456789ABCDEFu))));
    1137     ((void)(-((signed int )((unsigned short int )0x0123456789ABCDEFu))));
    1138     ((void)(-((signed int )0x0123456789ABCDEFu)));
    1139     ((void)(-((unsigned long long int )0x0123456789ABCDEFu)));
    1140     ((void)((signed char )0X0123456789abcdef));
    1141     ((void)((signed short int )0X0123456789abcdef));
    1142     ((void)((signed int )0X0123456789abcdef));
    1143     ((void)((signed long long int )0X0123456789abcdef));
    1144     ((void)((signed char )0X0123456789abcdefu));
    1145     ((void)((unsigned short int )0X0123456789abcdefu));
    1146     ((void)((signed int )0X0123456789abcdefu));
    1147     ((void)((unsigned long long int )0X0123456789abcdefu));
    1148     ((void)(+((signed int )((signed char )0X0123456789abcdef))));
    1149     ((void)(+((signed int )((signed short int )0X0123456789abcdef))));
    1150     ((void)(+((signed int )0X0123456789abcdef)));
    1151     ((void)(+((signed long long int )0X0123456789abcdef)));
    1152     ((void)(+((signed int )((signed char )0X0123456789abcdefu))));
    1153     ((void)(+((signed int )((unsigned short int )0X0123456789abcdefu))));
    1154     ((void)(+((signed int )0X0123456789abcdefu)));
    1155     ((void)(+((unsigned long long int )0X0123456789abcdefu)));
    1156     ((void)(-((signed int )((signed char )0X0123456789abcdef))));
    1157     ((void)(-((signed int )((signed short int )0X0123456789abcdef))));
    1158     ((void)(-((signed int )0X0123456789abcdef)));
    1159     ((void)(-((signed long long int )0X0123456789abcdef)));
    1160     ((void)(-((signed int )((signed char )0X0123456789abcdefu))));
    1161     ((void)(-((signed int )((unsigned short int )0X0123456789abcdefu))));
    1162     ((void)(-((signed int )0X0123456789abcdefu)));
    1163     ((void)(-((unsigned long long int )0X0123456789abcdefu)));
    1164     ((void)((signed char )0X0123456789ABCDEF));
    1165     ((void)((signed short int )0X0123456789ABCDEF));
    1166     ((void)((signed int )0X0123456789ABCDEF));
    1167     ((void)((signed long long int )0X0123456789ABCDEF));
    1168     ((void)((signed char )0X0123456789ABCDEFu));
    1169     ((void)((unsigned short int )0X0123456789ABCDEFu));
    1170     ((void)((signed int )0X0123456789ABCDEFu));
    1171     ((void)((unsigned long long int )0X0123456789ABCDEFu));
    1172     ((void)(+((signed int )((signed char )0X0123456789ABCDEF))));
    1173     ((void)(+((signed int )((signed short int )0X0123456789ABCDEF))));
    1174     ((void)(+((signed int )0X0123456789ABCDEF)));
    1175     ((void)(+((signed long long int )0X0123456789ABCDEF)));
    1176     ((void)(+((signed int )((signed char )0X0123456789ABCDEFu))));
    1177     ((void)(+((signed int )((unsigned short int )0X0123456789ABCDEFu))));
    1178     ((void)(+((signed int )0X0123456789ABCDEFu)));
    1179     ((void)(+((unsigned long long int )0X0123456789ABCDEFu)));
    1180     ((void)(-((signed int )((signed char )0X0123456789ABCDEF))));
    1181     ((void)(-((signed int )((signed short int )0X0123456789ABCDEF))));
    1182     ((void)(-((signed int )0X0123456789ABCDEF)));
    1183     ((void)(-((signed long long int )0X0123456789ABCDEF)));
    1184     ((void)(-((signed int )((signed char )0X0123456789ABCDEFu))));
    1185     ((void)(-((signed int )((unsigned short int )0X0123456789ABCDEFu))));
    1186     ((void)(-((signed int )0X0123456789ABCDEFu)));
    1187     ((void)(-((unsigned long long int )0X0123456789ABCDEFu)));
    1188     ((void)((float )0123456789.));
    1189     ((void)((double )0123456789.));
    1190     ((void)((long double )0123456789.));
    1191     ((void)((long double )0123456789.));
    1192     ((void)(+((float )0123456789.)));
    1193     ((void)(+((double )0123456789.)));
    1194     ((void)(+((long double )0123456789.)));
    1195     ((void)(+((long double )0123456789.)));
    1196     ((void)(-((float )0123456789.)));
    1197     ((void)(-((double )0123456789.)));
    1198     ((void)(-((long double )0123456789.)));
    1199     ((void)(-((long double )0123456789.)));
    1200     ((void)((float )0123456789.e09));
    1201     ((void)((double )0123456789.e09));
    1202     ((void)((long double )0123456789.e09));
    1203     ((void)((long double )0123456789.e09));
    1204     ((void)(+((float )0123456789.e+09)));
    1205     ((void)(+((double )0123456789.e+09)));
    1206     ((void)(+((long double )0123456789.e+09)));
    1207     ((void)(+((long double )0123456789.e+09)));
    1208     ((void)(-((float )0123456789.e-09)));
    1209     ((void)(-((double )0123456789.e-09)));
    1210     ((void)(-((long double )0123456789.e-09)));
    1211     ((void)(-((long double )0123456789.e-09)));
    1212     ((void)((float ).0123456789e09));
    1213     ((void)((double ).0123456789e09));
    1214     ((void)((long double ).0123456789e09));
    1215     ((void)((long double ).0123456789e09));
    1216     ((void)(+((float ).0123456789E+09)));
    1217     ((void)(+((double ).0123456789E+09)));
    1218     ((void)(+((long double ).0123456789E+09)));
    1219     ((void)(+((long double ).0123456789E+09)));
    1220     ((void)(-((float ).0123456789E-09)));
    1221     ((void)(-((double ).0123456789E-09)));
    1222     ((void)(-((long double ).0123456789E-09)));
    1223     ((void)(-((long double ).0123456789E-09)));
    1224     ((void)((float )0123456789.0123456789));
    1225     ((void)((double )0123456789.0123456789));
    1226     ((void)((long double )0123456789.0123456789));
    1227     ((void)((long double )0123456789.0123456789));
    1228     ((void)(+((float )0123456789.0123456789E09)));
    1229     ((void)(+((double )0123456789.0123456789E09)));
    1230     ((void)(+((long double )0123456789.0123456789E09)));
    1231     ((void)(+((long double )0123456789.0123456789E09)));
    1232     ((void)(-((float )0123456789.0123456789E+09)));
    1233     ((void)(-((double )0123456789.0123456789E+09)));
    1234     ((void)(-((long double )0123456789.0123456789E+09)));
    1235     ((void)(-((long double )0123456789.0123456789E+09)));
    1236     ((void)((float )0123456789.0123456789E-09));
    1237     ((void)((double )0123456789.0123456789E-09));
    1238     ((void)((long double )0123456789.0123456789E-09));
    1239     ((void)((long double )0123456789.0123456789E-09));
    1240     ((void)((float )0x0123456789.p09));
    1241     ((void)((double )0x0123456789.p09));
    1242     ((void)((long double )0x0123456789.p09));
    1243     ((void)((long double )0x0123456789.p09));
    1244     ((void)(+((float )0x0123456789.p09)));
    1245     ((void)(+((double )0x0123456789.p09)));
    1246     ((void)(+((long double )0x0123456789.p09)));
    1247     ((void)(+((long double )0x0123456789.p09)));
    1248     ((void)(-((float )0x0123456789.p09)));
    1249     ((void)(-((double )0x0123456789.p09)));
    1250     ((void)(-((long double )0x0123456789.p09)));
    1251     ((void)(-((long double )0x0123456789.p09)));
    1252     ((void)((float )0x0123456789.p+09));
    1253     ((void)((double )0x0123456789.p+09));
    1254     ((void)((long double )0x0123456789.p+09));
    1255     ((void)((long double )0x0123456789.p+09));
    1256     ((void)(+((float )0x0123456789.p-09)));
    1257     ((void)(+((double )0x0123456789.p-09)));
    1258     ((void)(+((long double )0x0123456789.p-09)));
    1259     ((void)(+((long double )0x0123456789.p-09)));
    1260     ((void)(-((float )0x.0123456789p09)));
    1261     ((void)(-((double )0x.0123456789p09)));
    1262     ((void)(-((long double )0x.0123456789p09)));
    1263     ((void)(-((long double )0x.0123456789p09)));
     996    ((void)(-0X0123456789.0123456789P-09));
     997    ((void)(-0X0123456789.0123456789P-09f));
     998    ((void)(-0X0123456789.0123456789P-09l));
     999    ((void)(-0X0123456789.0123456789P-09F));
     1000    ((void)(-0X0123456789.0123456789P-09L));
    12641001    ((void)__f__F_c__1('a'));
    12651002    ((void)__f__F_Sc__1(20));
     
    13741111    ((void)L"a" "b" "c");
    13751112    ((void)(___retval_main__i_1=0) /* ?{} */);
    1376     return ___retval_main__i_1;
     1113    return ((signed int )___retval_main__i_1);
    13771114}
    13781115static inline int invoke_main(int argc, char* argv[], char* envp[]) { (void)argc; (void)argv; (void)envp; return __main__Fi___1(); }
     
    13891126    ((void)(___retval_main__i_1=(((void)(_tmp_cp_ret0=invoke_main(__argc__i_1, __argv__PPc_1, __envp__PPc_1))) , _tmp_cp_ret0)) /* ?{} */);
    13901127    ((void)(_tmp_cp_ret0) /* ^?{} */);
    1391     return ___retval_main__i_1;
    1392 }
     1128    return ((signed int )___retval_main__i_1);
     1129}
  • src/tests/.expect/64/KRfunctions.txt

    r3f7e12cb r78315272  
    2121static inline void ___destructor__F_R2sS_autogen___1(struct S *___dst__R2sS_1);
    2222static inline struct S ___operator_assign__F2sS_R2sS2sS_autogen___1(struct S *___dst__R2sS_1, struct S ___src__2sS_1);
    23 static inline void ___constructor__F_R2sSi_autogen___1(struct S *___dst__R2sS_1, signed int __i__i_1);
    2423static inline void ___constructor__F_R2sS_autogen___1(struct S *___dst__R2sS_1){
    2524    ((void)((*___dst__R2sS_1).__i__i_1) /* ?{} */);
     
    3433    struct S ___ret__2sS_1;
    3534    ((void)((*___dst__R2sS_1).__i__i_1=___src__2sS_1.__i__i_1));
    36     ((void)___constructor__F_R2sS2sS_autogen___1((&___ret__2sS_1), (*___dst__R2sS_1)));
    37     return ___ret__2sS_1;
     35    ((void)___constructor__F_R2sS2sS_autogen___1((&___ret__2sS_1), ___src__2sS_1));
     36    return ((struct S )___ret__2sS_1);
    3837}
    3938static inline void ___constructor__F_R2sSi_autogen___1(struct S *___dst__R2sS_1, signed int __i__i_1){
     
    6665    signed int *__x__FPi_ii__2(signed int __anonymous_object2, signed int __anonymous_object3);
    6766    ((void)(___retval_f10__PFPi_ii__1=__x__FPi_ii__2) /* ?{} */);
    68     return ___retval_f10__PFPi_ii__1;
     67    return ((signed int *(*)(signed int __x__i_1, signed int __y__i_1))___retval_f10__PFPi_ii__1);
    6968}
    7069signed int (*__f11__FPA0i_iPiPi__1(signed int __a__i_1, signed int *__b__Pi_1, signed int *__c__Pi_1))[]{
  • src/tests/.expect/64/attributes.txt

    r3f7e12cb r78315272  
    2323static inline struct __anonymous0 ___operator_assign__F13s__anonymous0_R13s__anonymous013s__anonymous0_autogen___1(struct __anonymous0 *___dst__R13s__anonymous0_1, struct __anonymous0 ___src__13s__anonymous0_1){
    2424    struct __anonymous0 ___ret__13s__anonymous0_1;
    25     ((void)___constructor__F_R13s__anonymous013s__anonymous0_autogen___1((&___ret__13s__anonymous0_1), (*___dst__R13s__anonymous0_1)));
    26     return ___ret__13s__anonymous0_1;
     25    ((void)___constructor__F_R13s__anonymous013s__anonymous0_autogen___1((&___ret__13s__anonymous0_1), ___src__13s__anonymous0_1));
     26    return ((struct __anonymous0 )___ret__13s__anonymous0_1);
    2727}
    2828__attribute__ ((unused)) struct Agn1;
     
    4141static inline struct Agn2 ___operator_assign__F5sAgn2_R5sAgn25sAgn2_autogen___1(struct Agn2 *___dst__R5sAgn2_1, struct Agn2 ___src__5sAgn2_1){
    4242    struct Agn2 ___ret__5sAgn2_1;
    43     ((void)___constructor__F_R5sAgn25sAgn2_autogen___1((&___ret__5sAgn2_1), (*___dst__R5sAgn2_1)));
    44     return ___ret__5sAgn2_1;
     43    ((void)___constructor__F_R5sAgn25sAgn2_autogen___1((&___ret__5sAgn2_1), ___src__5sAgn2_1));
     44    return ((struct Agn2 )___ret__5sAgn2_1);
    4545}
    4646enum __attribute__ ((unused)) __anonymous1 {
     
    6969static inline void ___destructor__F_R4sFdl_autogen___1(struct Fdl *___dst__R4sFdl_1);
    7070static inline struct Fdl ___operator_assign__F4sFdl_R4sFdl4sFdl_autogen___1(struct Fdl *___dst__R4sFdl_1, struct Fdl ___src__4sFdl_1);
    71 static inline void ___constructor__F_R4sFdli_autogen___1(struct Fdl *___dst__R4sFdl_1, signed int __f1__i_1);
    72 static inline void ___constructor__F_R4sFdlii_autogen___1(struct Fdl *___dst__R4sFdl_1, signed int __f1__i_1, signed int __f2__i_1);
    73 static inline void ___constructor__F_R4sFdliii_autogen___1(struct Fdl *___dst__R4sFdl_1, signed int __f1__i_1, signed int __f2__i_1, signed int __f3__i_1);
    74 static inline void ___constructor__F_R4sFdliiii_autogen___1(struct Fdl *___dst__R4sFdl_1, signed int __f1__i_1, signed int __f2__i_1, signed int __f3__i_1, signed int __f4__i_1);
    75 static inline void ___constructor__F_R4sFdliiiii_autogen___1(struct Fdl *___dst__R4sFdl_1, signed int __f1__i_1, signed int __f2__i_1, signed int __f3__i_1, signed int __f4__i_1, signed int __f5__i_1);
    76 static inline void ___constructor__F_R4sFdliiiiii_autogen___1(struct Fdl *___dst__R4sFdl_1, signed int __f1__i_1, signed int __f2__i_1, signed int __f3__i_1, signed int __f4__i_1, signed int __f5__i_1, signed int __f6__i_1);
    77 static inline void ___constructor__F_R4sFdliiiiiii_autogen___1(struct Fdl *___dst__R4sFdl_1, signed int __f1__i_1, signed int __f2__i_1, signed int __f3__i_1, signed int __f4__i_1, signed int __f5__i_1, signed int __f6__i_1, signed int __f7__i_1);
    78 static inline void ___constructor__F_R4sFdliiiiiiii_autogen___1(struct Fdl *___dst__R4sFdl_1, signed int __f1__i_1, signed int __f2__i_1, signed int __f3__i_1, signed int __f4__i_1, signed int __f5__i_1, signed int __f6__i_1, signed int __f7__i_1, signed int __f8__i_1);
    79 static inline void ___constructor__F_R4sFdliiiiiiiii_autogen___1(struct Fdl *___dst__R4sFdl_1, signed int __f1__i_1, signed int __f2__i_1, signed int __f3__i_1, signed int __f4__i_1, signed int __f5__i_1, signed int __f6__i_1, signed int __f7__i_1, signed int __f8__i_1, signed int __anonymous_object1);
    80 static inline void ___constructor__F_R4sFdliiiiiiiiiPi_autogen___1(struct Fdl *___dst__R4sFdl_1, signed int __f1__i_1, signed int __f2__i_1, signed int __f3__i_1, signed int __f4__i_1, signed int __f5__i_1, signed int __f6__i_1, signed int __f7__i_1, signed int __f8__i_1, signed int __anonymous_object2, signed int *__f9__Pi_1);
    8171static inline void ___constructor__F_R4sFdl_autogen___1(struct Fdl *___dst__R4sFdl_1){
    8272    ((void)((*___dst__R4sFdl_1).__f1__i_1) /* ?{} */);
     
    8878    ((void)((*___dst__R4sFdl_1).__f7__i_1) /* ?{} */);
    8979    ((void)((*___dst__R4sFdl_1).__f8__i_1) /* ?{} */);
    90     ((void)((*___dst__R4sFdl_1).__anonymous_object0) /* ?{} */);
    9180    ((void)((*___dst__R4sFdl_1).__f9__Pi_1) /* ?{} */);
    9281}
     
    10089    ((void)((*___dst__R4sFdl_1).__f7__i_1=___src__4sFdl_1.__f7__i_1) /* ?{} */);
    10190    ((void)((*___dst__R4sFdl_1).__f8__i_1=___src__4sFdl_1.__f8__i_1) /* ?{} */);
    102     ((void)((*___dst__R4sFdl_1).__anonymous_object0=___src__4sFdl_1.__anonymous_object0) /* ?{} */);
    10391    ((void)((*___dst__R4sFdl_1).__f9__Pi_1=___src__4sFdl_1.__f9__Pi_1) /* ?{} */);
    10492}
    10593static inline void ___destructor__F_R4sFdl_autogen___1(struct Fdl *___dst__R4sFdl_1){
    10694    ((void)((*___dst__R4sFdl_1).__f9__Pi_1) /* ^?{} */);
    107     ((void)((*___dst__R4sFdl_1).__anonymous_object0) /* ^?{} */);
    10895    ((void)((*___dst__R4sFdl_1).__f8__i_1) /* ^?{} */);
    10996    ((void)((*___dst__R4sFdl_1).__f7__i_1) /* ^?{} */);
     
    125112    ((void)((*___dst__R4sFdl_1).__f7__i_1=___src__4sFdl_1.__f7__i_1));
    126113    ((void)((*___dst__R4sFdl_1).__f8__i_1=___src__4sFdl_1.__f8__i_1));
    127     ((void)((*___dst__R4sFdl_1).__anonymous_object0=___src__4sFdl_1.__anonymous_object0));
    128114    ((void)((*___dst__R4sFdl_1).__f9__Pi_1=___src__4sFdl_1.__f9__Pi_1));
    129     ((void)___constructor__F_R4sFdl4sFdl_autogen___1((&___ret__4sFdl_1), (*___dst__R4sFdl_1)));
    130     return ___ret__4sFdl_1;
     115    ((void)___constructor__F_R4sFdl4sFdl_autogen___1((&___ret__4sFdl_1), ___src__4sFdl_1));
     116    return ((struct Fdl )___ret__4sFdl_1);
    131117}
    132118static inline void ___constructor__F_R4sFdli_autogen___1(struct Fdl *___dst__R4sFdl_1, signed int __f1__i_1){
     
    139125    ((void)((*___dst__R4sFdl_1).__f7__i_1) /* ?{} */);
    140126    ((void)((*___dst__R4sFdl_1).__f8__i_1) /* ?{} */);
    141     ((void)((*___dst__R4sFdl_1).__anonymous_object0) /* ?{} */);
    142127    ((void)((*___dst__R4sFdl_1).__f9__Pi_1) /* ?{} */);
    143128}
     
    151136    ((void)((*___dst__R4sFdl_1).__f7__i_1) /* ?{} */);
    152137    ((void)((*___dst__R4sFdl_1).__f8__i_1) /* ?{} */);
    153     ((void)((*___dst__R4sFdl_1).__anonymous_object0) /* ?{} */);
    154138    ((void)((*___dst__R4sFdl_1).__f9__Pi_1) /* ?{} */);
    155139}
     
    163147    ((void)((*___dst__R4sFdl_1).__f7__i_1) /* ?{} */);
    164148    ((void)((*___dst__R4sFdl_1).__f8__i_1) /* ?{} */);
    165     ((void)((*___dst__R4sFdl_1).__anonymous_object0) /* ?{} */);
    166149    ((void)((*___dst__R4sFdl_1).__f9__Pi_1) /* ?{} */);
    167150}
     
    175158    ((void)((*___dst__R4sFdl_1).__f7__i_1) /* ?{} */);
    176159    ((void)((*___dst__R4sFdl_1).__f8__i_1) /* ?{} */);
    177     ((void)((*___dst__R4sFdl_1).__anonymous_object0) /* ?{} */);
    178160    ((void)((*___dst__R4sFdl_1).__f9__Pi_1) /* ?{} */);
    179161}
     
    187169    ((void)((*___dst__R4sFdl_1).__f7__i_1) /* ?{} */);
    188170    ((void)((*___dst__R4sFdl_1).__f8__i_1) /* ?{} */);
    189     ((void)((*___dst__R4sFdl_1).__anonymous_object0) /* ?{} */);
    190171    ((void)((*___dst__R4sFdl_1).__f9__Pi_1) /* ?{} */);
    191172}
     
    199180    ((void)((*___dst__R4sFdl_1).__f7__i_1) /* ?{} */);
    200181    ((void)((*___dst__R4sFdl_1).__f8__i_1) /* ?{} */);
    201     ((void)((*___dst__R4sFdl_1).__anonymous_object0) /* ?{} */);
    202182    ((void)((*___dst__R4sFdl_1).__f9__Pi_1) /* ?{} */);
    203183}
     
    211191    ((void)((*___dst__R4sFdl_1).__f7__i_1=__f7__i_1) /* ?{} */);
    212192    ((void)((*___dst__R4sFdl_1).__f8__i_1) /* ?{} */);
    213     ((void)((*___dst__R4sFdl_1).__anonymous_object0) /* ?{} */);
    214193    ((void)((*___dst__R4sFdl_1).__f9__Pi_1) /* ?{} */);
    215194}
     
    223202    ((void)((*___dst__R4sFdl_1).__f7__i_1=__f7__i_1) /* ?{} */);
    224203    ((void)((*___dst__R4sFdl_1).__f8__i_1=__f8__i_1) /* ?{} */);
    225     ((void)((*___dst__R4sFdl_1).__anonymous_object0) /* ?{} */);
    226     ((void)((*___dst__R4sFdl_1).__f9__Pi_1) /* ?{} */);
    227 }
    228 static inline void ___constructor__F_R4sFdliiiiiiiii_autogen___1(struct Fdl *___dst__R4sFdl_1, signed int __f1__i_1, signed int __f2__i_1, signed int __f3__i_1, signed int __f4__i_1, signed int __f5__i_1, signed int __f6__i_1, signed int __f7__i_1, signed int __f8__i_1, signed int __anonymous_object3){
     204    ((void)((*___dst__R4sFdl_1).__f9__Pi_1) /* ?{} */);
     205}
     206static inline void ___constructor__F_R4sFdliiiiiiiiPi_autogen___1(struct Fdl *___dst__R4sFdl_1, signed int __f1__i_1, signed int __f2__i_1, signed int __f3__i_1, signed int __f4__i_1, signed int __f5__i_1, signed int __f6__i_1, signed int __f7__i_1, signed int __f8__i_1, signed int *__f9__Pi_1){
    229207    ((void)((*___dst__R4sFdl_1).__f1__i_1=__f1__i_1) /* ?{} */);
    230208    ((void)((*___dst__R4sFdl_1).__f2__i_1=__f2__i_1) /* ?{} */);
     
    235213    ((void)((*___dst__R4sFdl_1).__f7__i_1=__f7__i_1) /* ?{} */);
    236214    ((void)((*___dst__R4sFdl_1).__f8__i_1=__f8__i_1) /* ?{} */);
    237     ((void)((*___dst__R4sFdl_1).__anonymous_object0=__anonymous_object3) /* ?{} */);
    238     ((void)((*___dst__R4sFdl_1).__f9__Pi_1) /* ?{} */);
    239 }
    240 static inline void ___constructor__F_R4sFdliiiiiiiiiPi_autogen___1(struct Fdl *___dst__R4sFdl_1, signed int __f1__i_1, signed int __f2__i_1, signed int __f3__i_1, signed int __f4__i_1, signed int __f5__i_1, signed int __f6__i_1, signed int __f7__i_1, signed int __f8__i_1, signed int __anonymous_object4, signed int *__f9__Pi_1){
    241     ((void)((*___dst__R4sFdl_1).__f1__i_1=__f1__i_1) /* ?{} */);
    242     ((void)((*___dst__R4sFdl_1).__f2__i_1=__f2__i_1) /* ?{} */);
    243     ((void)((*___dst__R4sFdl_1).__f3__i_1=__f3__i_1) /* ?{} */);
    244     ((void)((*___dst__R4sFdl_1).__f4__i_1=__f4__i_1) /* ?{} */);
    245     ((void)((*___dst__R4sFdl_1).__f5__i_1=__f5__i_1) /* ?{} */);
    246     ((void)((*___dst__R4sFdl_1).__f6__i_1=__f6__i_1) /* ?{} */);
    247     ((void)((*___dst__R4sFdl_1).__f7__i_1=__f7__i_1) /* ?{} */);
    248     ((void)((*___dst__R4sFdl_1).__f8__i_1=__f8__i_1) /* ?{} */);
    249     ((void)((*___dst__R4sFdl_1).__anonymous_object0=__anonymous_object4) /* ?{} */);
    250215    ((void)((*___dst__R4sFdl_1).__f9__Pi_1=__f9__Pi_1) /* ?{} */);
    251216}
     
    267232    __attribute__ ((unused)) signed int **const ___retval_f2__CPPi_1;
    268233}
    269 __attribute__ ((unused,used,unused)) signed int (*__f3__FPA0i_i__1(signed int __anonymous_object5))[];
     234__attribute__ ((unused,used,unused)) signed int (*__f3__FPA0i_i__1(signed int __anonymous_object1))[];
    270235__attribute__ ((unused,unused)) signed int (*__f3__FPA0i_i__1(signed int __p__i_1))[]{
    271236    __attribute__ ((unused)) signed int (*___retval_f3__PA0i_1)[];
    272237}
    273 __attribute__ ((unused,used,unused)) signed int (*__f4__FPFi_i____1())(signed int __anonymous_object6);
    274 __attribute__ ((unused,unused)) signed int (*__f4__FPFi_i____1())(signed int __anonymous_object7){
    275     __attribute__ ((unused)) signed int (*___retval_f4__PFi_i__1)(signed int __anonymous_object8);
     238__attribute__ ((unused,used,unused)) signed int (*__f4__FPFi_i____1())(signed int __anonymous_object2);
     239__attribute__ ((unused,unused)) signed int (*__f4__FPFi_i____1())(signed int __anonymous_object3){
     240    __attribute__ ((unused)) signed int (*___retval_f4__PFi_i__1)(signed int __anonymous_object4);
    276241}
    277242signed int __vtr__Fi___1(){
     
    303268signed int __tpr2__Fi_PPi__1(__attribute__ ((unused,unused,unused,unused,unused,unused)) signed int **__Foo__PPi_1);
    304269signed int __tpr3__Fi_Pi__1(__attribute__ ((unused,unused,unused)) signed int *__Foo__Pi_1);
    305 signed int __tpr4__Fi_PFi_Pi___1(__attribute__ ((unused,unused)) signed int (*__anonymous_object9)(__attribute__ ((unused,unused)) signed int __anonymous_object10[((unsigned long int )5)]));
     270signed int __tpr4__Fi_PFi_Pi___1(__attribute__ ((unused,unused)) signed int (*__anonymous_object5)(__attribute__ ((unused,unused)) signed int __anonymous_object6[((unsigned long int )5)]));
    306271signed int __tpr5__Fi_PFi____1(__attribute__ ((unused,unused,unused)) signed int (*__Foo__PFi___1)());
    307272signed int __tpr6__Fi_PFi____1(__attribute__ ((unused,unused,unused)) signed int (*__Foo__PFi___1)());
    308 signed int __tpr7__Fi_PFi_PFi_i____1(__attribute__ ((unused,unused)) signed int (*__anonymous_object11)(__attribute__ ((unused)) signed int (*__anonymous_object12)(__attribute__ ((unused,unused)) signed int __anonymous_object13)));
     273signed int __tpr7__Fi_PFi_PFi_i____1(__attribute__ ((unused,unused)) signed int (*__anonymous_object7)(__attribute__ ((unused)) signed int (*__anonymous_object8)(__attribute__ ((unused,unused)) signed int __anonymous_object9)));
    309274signed int __ad__Fi___1(){
    310275    __attribute__ ((unused)) signed int ___retval_ad__i_1;
     
    335300        struct __anonymous4 ___ret__13s__anonymous4_2;
    336301        ((void)((*___dst__R13s__anonymous4_2).__i__i_2=___src__13s__anonymous4_2.__i__i_2));
    337         ((void)___constructor__F_R13s__anonymous413s__anonymous4_autogen___2((&___ret__13s__anonymous4_2), (*___dst__R13s__anonymous4_2)));
    338         return ___ret__13s__anonymous4_2;
     302        ((void)___constructor__F_R13s__anonymous413s__anonymous4_autogen___2((&___ret__13s__anonymous4_2), ___src__13s__anonymous4_2));
     303        return ((struct __anonymous4 )___ret__13s__anonymous4_2);
    339304    }
    340305    inline void ___constructor__F_R13s__anonymous4i_autogen___2(struct __anonymous4 *___dst__R13s__anonymous4_2, signed int __i__i_2){
     
    348313    }
    349314    inline void ___constructor__F_R13e__anonymous513e__anonymous5_intrinsic___2(enum __anonymous5 *___dst__R13e__anonymous5_2, enum __anonymous5 ___src__13e__anonymous5_2){
    350         ((void)((*___dst__R13e__anonymous5_2)=___src__13e__anonymous5_2) /* ?{} */);
     315        ((void)((*___dst__R13e__anonymous5_2)=___src__13e__anonymous5_2));
    351316    }
    352317    inline void ___destructor__F_R13e__anonymous5_intrinsic___2(__attribute__ ((unused)) enum __anonymous5 *___dst__R13e__anonymous5_2){
     
    354319    inline enum __anonymous5 ___operator_assign__F13e__anonymous5_R13e__anonymous513e__anonymous5_intrinsic___2(enum __anonymous5 *___dst__R13e__anonymous5_2, enum __anonymous5 ___src__13e__anonymous5_2){
    355320        enum __anonymous5 ___ret__13e__anonymous5_2;
    356         ((void)((*___dst__R13e__anonymous5_2)=___src__13e__anonymous5_2));
    357         ((void)(___ret__13e__anonymous5_2=(*___dst__R13e__anonymous5_2)) /* ?{} */);
    358         return ___ret__13e__anonymous5_2;
     321        ((void)(___ret__13e__anonymous5_2=((*___dst__R13e__anonymous5_2)=___src__13e__anonymous5_2)) /* ?{} */);
     322        return ((enum __anonymous5 )___ret__13e__anonymous5_2);
    359323    }
    360324    ((void)sizeof(enum __anonymous5 ));
    361325}
    362 signed int __apd1__Fi_PiPi__1(__attribute__ ((unused,unused,unused)) signed int *__anonymous_object14, __attribute__ ((unused,unused,unused)) signed int *__anonymous_object15);
    363 signed int __apd2__Fi_PPiPPi__1(__attribute__ ((unused,unused,unused,unused)) signed int **__anonymous_object16, __attribute__ ((unused,unused,unused,unused)) signed int **__anonymous_object17);
    364 signed int __apd3__Fi_PiPi__1(__attribute__ ((unused,unused,unused)) signed int *__anonymous_object18, __attribute__ ((unused,unused,unused)) signed int *__anonymous_object19);
    365 signed int __apd4__Fi_PFi__PFi____1(__attribute__ ((unused,unused,unused)) signed int (*__anonymous_object20)(), __attribute__ ((unused,unused,unused)) signed int (*__anonymous_object21)());
    366 signed int __apd5__Fi_PFi_i_PFi_i___1(__attribute__ ((unused,unused,unused)) signed int (*__anonymous_object22)(__attribute__ ((unused)) signed int __anonymous_object23), __attribute__ ((unused,unused,unused)) signed int (*__anonymous_object24)(__attribute__ ((unused)) signed int __anonymous_object25));
    367 signed int __apd6__Fi_PFi__PFi____1(__attribute__ ((unused,unused,unused)) signed int (*__anonymous_object26)(), __attribute__ ((unused,unused,unused)) signed int (*__anonymous_object27)());
    368 signed int __apd7__Fi_PFi_i_PFi_i___1(__attribute__ ((unused,unused,unused)) signed int (*__anonymous_object28)(__attribute__ ((unused)) signed int __anonymous_object29), __attribute__ ((unused,unused,unused)) signed int (*__anonymous_object30)(__attribute__ ((unused)) signed int __anonymous_object31));
     326signed int __apd1__Fi_PiPi__1(__attribute__ ((unused,unused,unused)) signed int *__anonymous_object10, __attribute__ ((unused,unused,unused)) signed int *__anonymous_object11);
     327signed int __apd2__Fi_PPiPPi__1(__attribute__ ((unused,unused,unused,unused)) signed int **__anonymous_object12, __attribute__ ((unused,unused,unused,unused)) signed int **__anonymous_object13);
     328signed int __apd3__Fi_PiPi__1(__attribute__ ((unused,unused,unused)) signed int *__anonymous_object14, __attribute__ ((unused,unused,unused)) signed int *__anonymous_object15);
     329signed int __apd4__Fi_PFi__PFi____1(__attribute__ ((unused,unused,unused)) signed int (*__anonymous_object16)(), __attribute__ ((unused,unused,unused)) signed int (*__anonymous_object17)());
     330signed int __apd5__Fi_PFi_i_PFi_i___1(__attribute__ ((unused,unused,unused)) signed int (*__anonymous_object18)(__attribute__ ((unused)) signed int __anonymous_object19), __attribute__ ((unused,unused,unused)) signed int (*__anonymous_object20)(__attribute__ ((unused)) signed int __anonymous_object21));
     331signed int __apd6__Fi_PFi__PFi____1(__attribute__ ((unused,unused,unused)) signed int (*__anonymous_object22)(), __attribute__ ((unused,unused,unused)) signed int (*__anonymous_object23)());
     332signed int __apd7__Fi_PFi_i_PFi_i___1(__attribute__ ((unused,unused,unused)) signed int (*__anonymous_object24)(__attribute__ ((unused)) signed int __anonymous_object25), __attribute__ ((unused,unused,unused)) signed int (*__anonymous_object26)(__attribute__ ((unused)) signed int __anonymous_object27));
    369333struct Vad {
    370     __attribute__ ((unused)) signed int __anonymous_object32;
    371     __attribute__ ((unused,unused)) signed int *__anonymous_object33;
    372     __attribute__ ((unused,unused)) signed int __anonymous_object34[((unsigned long int )10)];
    373     __attribute__ ((unused,unused)) signed int (*__anonymous_object35)();
     334    __attribute__ ((unused)) signed int __anonymous_object28;
     335    __attribute__ ((unused,unused)) signed int *__anonymous_object29;
     336    __attribute__ ((unused,unused)) signed int __anonymous_object30[((unsigned long int )10)];
     337    __attribute__ ((unused,unused)) signed int (*__anonymous_object31)();
    374338};
    375339static inline void ___constructor__F_R4sVad_autogen___1(struct Vad *___dst__R4sVad_1);
     
    377341static inline void ___destructor__F_R4sVad_autogen___1(struct Vad *___dst__R4sVad_1);
    378342static inline struct Vad ___operator_assign__F4sVad_R4sVad4sVad_autogen___1(struct Vad *___dst__R4sVad_1, struct Vad ___src__4sVad_1);
    379 static inline void ___constructor__F_R4sVadi_autogen___1(struct Vad *___dst__R4sVad_1, signed int __anonymous_object36);
    380 static inline void ___constructor__F_R4sVadiPi_autogen___1(struct Vad *___dst__R4sVad_1, signed int __anonymous_object37, signed int *__anonymous_object38);
    381 static inline void ___constructor__F_R4sVadiPiA0i_autogen___1(struct Vad *___dst__R4sVad_1, signed int __anonymous_object39, signed int *__anonymous_object40, signed int __anonymous_object41[((unsigned long int )10)]);
    382 static inline void ___constructor__F_R4sVadiPiA0iPFi___autogen___1(struct Vad *___dst__R4sVad_1, signed int __anonymous_object42, signed int *__anonymous_object43, signed int __anonymous_object44[((unsigned long int )10)], signed int (*__anonymous_object45)());
    383343static inline void ___constructor__F_R4sVad_autogen___1(struct Vad *___dst__R4sVad_1){
    384     ((void)((*___dst__R4sVad_1).__anonymous_object32) /* ?{} */);
    385     ((void)((*___dst__R4sVad_1).__anonymous_object33) /* ?{} */);
    386     {
    387         signed int _index0 = 0;
    388         for (;(_index0<10);((void)(++_index0))) {
    389             ((void)((*((signed int *)(&(*___dst__R4sVad_1).__anonymous_object34[((signed long int )_index0)])))) /* ?{} */);
    390         }
    391 
    392     }
    393 
    394     ((void)((*___dst__R4sVad_1).__anonymous_object35) /* ?{} */);
    395344}
    396345static inline void ___constructor__F_R4sVad4sVad_autogen___1(struct Vad *___dst__R4sVad_1, struct Vad ___src__4sVad_1){
    397     ((void)((*___dst__R4sVad_1).__anonymous_object32=___src__4sVad_1.__anonymous_object32) /* ?{} */);
    398     ((void)((*___dst__R4sVad_1).__anonymous_object33=___src__4sVad_1.__anonymous_object33) /* ?{} */);
    399     {
    400         signed int _index1 = 0;
    401         for (;(_index1<10);((void)(++_index1))) {
    402             ((void)((*((signed int *)(&(*___dst__R4sVad_1).__anonymous_object34[((signed long int )_index1)])))=___src__4sVad_1.__anonymous_object34[((signed long int )_index1)]) /* ?{} */);
    403         }
    404 
    405     }
    406 
    407     ((void)((*___dst__R4sVad_1).__anonymous_object35=___src__4sVad_1.__anonymous_object35) /* ?{} */);
    408346}
    409347static inline void ___destructor__F_R4sVad_autogen___1(struct Vad *___dst__R4sVad_1){
    410     ((void)((*___dst__R4sVad_1).__anonymous_object35) /* ^?{} */);
    411     {
    412         signed int _index2 = (10-1);
    413         for (;(_index2>=0);((void)(--_index2))) {
    414             ((void)((*((signed int *)(&(*___dst__R4sVad_1).__anonymous_object34[((signed long int )_index2)])))) /* ^?{} */);
    415         }
    416 
    417     }
    418 
    419     ((void)((*___dst__R4sVad_1).__anonymous_object33) /* ^?{} */);
    420     ((void)((*___dst__R4sVad_1).__anonymous_object32) /* ^?{} */);
    421348}
    422349static inline struct Vad ___operator_assign__F4sVad_R4sVad4sVad_autogen___1(struct Vad *___dst__R4sVad_1, struct Vad ___src__4sVad_1){
    423350    struct Vad ___ret__4sVad_1;
    424     ((void)((*___dst__R4sVad_1).__anonymous_object32=___src__4sVad_1.__anonymous_object32));
    425     ((void)((*___dst__R4sVad_1).__anonymous_object33=___src__4sVad_1.__anonymous_object33));
    426     {
    427         signed int _index3 = 0;
    428         for (;(_index3<10);((void)(++_index3))) {
    429             ((void)((*___dst__R4sVad_1).__anonymous_object34[((signed long int )_index3)]=___src__4sVad_1.__anonymous_object34[((signed long int )_index3)]));
    430         }
    431 
    432     }
    433 
    434     ((void)((*___dst__R4sVad_1).__anonymous_object35=___src__4sVad_1.__anonymous_object35));
    435     ((void)___constructor__F_R4sVad4sVad_autogen___1((&___ret__4sVad_1), (*___dst__R4sVad_1)));
    436     return ___ret__4sVad_1;
    437 }
    438 static inline void ___constructor__F_R4sVadi_autogen___1(struct Vad *___dst__R4sVad_1, signed int __anonymous_object46){
    439     ((void)((*___dst__R4sVad_1).__anonymous_object32=__anonymous_object46) /* ?{} */);
    440     ((void)((*___dst__R4sVad_1).__anonymous_object33) /* ?{} */);
    441     {
    442         signed int _index4 = 0;
    443         for (;(_index4<10);((void)(++_index4))) {
    444             ((void)((*((signed int *)(&(*___dst__R4sVad_1).__anonymous_object34[((signed long int )_index4)])))) /* ?{} */);
    445         }
    446 
    447     }
    448 
    449     ((void)((*___dst__R4sVad_1).__anonymous_object35) /* ?{} */);
    450 }
    451 static inline void ___constructor__F_R4sVadiPi_autogen___1(struct Vad *___dst__R4sVad_1, signed int __anonymous_object47, signed int *__anonymous_object48){
    452     ((void)((*___dst__R4sVad_1).__anonymous_object32=__anonymous_object47) /* ?{} */);
    453     ((void)((*___dst__R4sVad_1).__anonymous_object33=__anonymous_object48) /* ?{} */);
    454     {
    455         signed int _index5 = 0;
    456         for (;(_index5<10);((void)(++_index5))) {
    457             ((void)((*((signed int *)(&(*___dst__R4sVad_1).__anonymous_object34[((signed long int )_index5)])))) /* ?{} */);
    458         }
    459 
    460     }
    461 
    462     ((void)((*___dst__R4sVad_1).__anonymous_object35) /* ?{} */);
    463 }
    464 static inline void ___constructor__F_R4sVadiPiA0i_autogen___1(struct Vad *___dst__R4sVad_1, signed int __anonymous_object49, signed int *__anonymous_object50, signed int __anonymous_object51[((unsigned long int )10)]){
    465     ((void)((*___dst__R4sVad_1).__anonymous_object32=__anonymous_object49) /* ?{} */);
    466     ((void)((*___dst__R4sVad_1).__anonymous_object33=__anonymous_object50) /* ?{} */);
    467     {
    468         signed int _index6 = 0;
    469         for (;(_index6<10);((void)(++_index6))) {
    470             ((void)((*((signed int *)(&(*___dst__R4sVad_1).__anonymous_object34[((signed long int )_index6)])))=__anonymous_object51[((signed long int )_index6)]) /* ?{} */);
    471         }
    472 
    473     }
    474 
    475     ((void)((*___dst__R4sVad_1).__anonymous_object35) /* ?{} */);
    476 }
    477 static inline void ___constructor__F_R4sVadiPiA0iPFi___autogen___1(struct Vad *___dst__R4sVad_1, signed int __anonymous_object52, signed int *__anonymous_object53, signed int __anonymous_object54[((unsigned long int )10)], signed int (*__anonymous_object55)()){
    478     ((void)((*___dst__R4sVad_1).__anonymous_object32=__anonymous_object52) /* ?{} */);
    479     ((void)((*___dst__R4sVad_1).__anonymous_object33=__anonymous_object53) /* ?{} */);
    480     {
    481         signed int _index7 = 0;
    482         for (;(_index7<10);((void)(++_index7))) {
    483             ((void)((*((signed int *)(&(*___dst__R4sVad_1).__anonymous_object34[((signed long int )_index7)])))=__anonymous_object54[((signed long int )_index7)]) /* ?{} */);
    484         }
    485 
    486     }
    487 
    488     ((void)((*___dst__R4sVad_1).__anonymous_object35=__anonymous_object55) /* ?{} */);
    489 }
     351    ((void)___constructor__F_R4sVad4sVad_autogen___1((&___ret__4sVad_1), ___src__4sVad_1));
     352    return ((struct Vad )___ret__4sVad_1);
     353}
  • src/tests/.expect/64/declarationSpecifier.txt

    r3f7e12cb r78315272  
    2020static inline void ___destructor__F_R13s__anonymous0_autogen___1(struct __anonymous0 *___dst__R13s__anonymous0_1);
    2121static inline struct __anonymous0 ___operator_assign__F13s__anonymous0_R13s__anonymous013s__anonymous0_autogen___1(struct __anonymous0 *___dst__R13s__anonymous0_1, struct __anonymous0 ___src__13s__anonymous0_1);
    22 static inline void ___constructor__F_R13s__anonymous0i_autogen___1(struct __anonymous0 *___dst__R13s__anonymous0_1, signed int __i__i_1);
    2322static inline void ___constructor__F_R13s__anonymous0_autogen___1(struct __anonymous0 *___dst__R13s__anonymous0_1){
    2423    ((void)((*___dst__R13s__anonymous0_1).__i__i_1) /* ?{} */);
     
    3332    struct __anonymous0 ___ret__13s__anonymous0_1;
    3433    ((void)((*___dst__R13s__anonymous0_1).__i__i_1=___src__13s__anonymous0_1.__i__i_1));
    35     ((void)___constructor__F_R13s__anonymous013s__anonymous0_autogen___1((&___ret__13s__anonymous0_1), (*___dst__R13s__anonymous0_1)));
    36     return ___ret__13s__anonymous0_1;
     34    ((void)___constructor__F_R13s__anonymous013s__anonymous0_autogen___1((&___ret__13s__anonymous0_1), ___src__13s__anonymous0_1));
     35    return ((struct __anonymous0 )___ret__13s__anonymous0_1);
    3736}
    3837static inline void ___constructor__F_R13s__anonymous0i_autogen___1(struct __anonymous0 *___dst__R13s__anonymous0_1, signed int __i__i_1){
     
    4746static inline void ___destructor__F_R13s__anonymous1_autogen___1(struct __anonymous1 *___dst__R13s__anonymous1_1);
    4847static inline struct __anonymous1 ___operator_assign__F13s__anonymous1_R13s__anonymous113s__anonymous1_autogen___1(struct __anonymous1 *___dst__R13s__anonymous1_1, struct __anonymous1 ___src__13s__anonymous1_1);
    49 static inline void ___constructor__F_R13s__anonymous1i_autogen___1(struct __anonymous1 *___dst__R13s__anonymous1_1, signed int __i__i_1);
    5048static inline void ___constructor__F_R13s__anonymous1_autogen___1(struct __anonymous1 *___dst__R13s__anonymous1_1){
    5149    ((void)((*___dst__R13s__anonymous1_1).__i__i_1) /* ?{} */);
     
    6058    struct __anonymous1 ___ret__13s__anonymous1_1;
    6159    ((void)((*___dst__R13s__anonymous1_1).__i__i_1=___src__13s__anonymous1_1.__i__i_1));
    62     ((void)___constructor__F_R13s__anonymous113s__anonymous1_autogen___1((&___ret__13s__anonymous1_1), (*___dst__R13s__anonymous1_1)));
    63     return ___ret__13s__anonymous1_1;
     60    ((void)___constructor__F_R13s__anonymous113s__anonymous1_autogen___1((&___ret__13s__anonymous1_1), ___src__13s__anonymous1_1));
     61    return ((struct __anonymous1 )___ret__13s__anonymous1_1);
    6462}
    6563static inline void ___constructor__F_R13s__anonymous1i_autogen___1(struct __anonymous1 *___dst__R13s__anonymous1_1, signed int __i__i_1){
     
    7472static inline void ___destructor__F_R13s__anonymous2_autogen___1(struct __anonymous2 *___dst__R13s__anonymous2_1);
    7573static inline struct __anonymous2 ___operator_assign__F13s__anonymous2_R13s__anonymous213s__anonymous2_autogen___1(struct __anonymous2 *___dst__R13s__anonymous2_1, struct __anonymous2 ___src__13s__anonymous2_1);
    76 static inline void ___constructor__F_R13s__anonymous2i_autogen___1(struct __anonymous2 *___dst__R13s__anonymous2_1, signed int __i__i_1);
    7774static inline void ___constructor__F_R13s__anonymous2_autogen___1(struct __anonymous2 *___dst__R13s__anonymous2_1){
    7875    ((void)((*___dst__R13s__anonymous2_1).__i__i_1) /* ?{} */);
     
    8784    struct __anonymous2 ___ret__13s__anonymous2_1;
    8885    ((void)((*___dst__R13s__anonymous2_1).__i__i_1=___src__13s__anonymous2_1.__i__i_1));
    89     ((void)___constructor__F_R13s__anonymous213s__anonymous2_autogen___1((&___ret__13s__anonymous2_1), (*___dst__R13s__anonymous2_1)));
    90     return ___ret__13s__anonymous2_1;
     86    ((void)___constructor__F_R13s__anonymous213s__anonymous2_autogen___1((&___ret__13s__anonymous2_1), ___src__13s__anonymous2_1));
     87    return ((struct __anonymous2 )___ret__13s__anonymous2_1);
    9188}
    9289static inline void ___constructor__F_R13s__anonymous2i_autogen___1(struct __anonymous2 *___dst__R13s__anonymous2_1, signed int __i__i_1){
     
    10198static inline void ___destructor__F_R13s__anonymous3_autogen___1(struct __anonymous3 *___dst__R13s__anonymous3_1);
    10299static inline struct __anonymous3 ___operator_assign__F13s__anonymous3_R13s__anonymous313s__anonymous3_autogen___1(struct __anonymous3 *___dst__R13s__anonymous3_1, struct __anonymous3 ___src__13s__anonymous3_1);
    103 static inline void ___constructor__F_R13s__anonymous3i_autogen___1(struct __anonymous3 *___dst__R13s__anonymous3_1, signed int __i__i_1);
    104100static inline void ___constructor__F_R13s__anonymous3_autogen___1(struct __anonymous3 *___dst__R13s__anonymous3_1){
    105101    ((void)((*___dst__R13s__anonymous3_1).__i__i_1) /* ?{} */);
     
    114110    struct __anonymous3 ___ret__13s__anonymous3_1;
    115111    ((void)((*___dst__R13s__anonymous3_1).__i__i_1=___src__13s__anonymous3_1.__i__i_1));
    116     ((void)___constructor__F_R13s__anonymous313s__anonymous3_autogen___1((&___ret__13s__anonymous3_1), (*___dst__R13s__anonymous3_1)));
    117     return ___ret__13s__anonymous3_1;
     112    ((void)___constructor__F_R13s__anonymous313s__anonymous3_autogen___1((&___ret__13s__anonymous3_1), ___src__13s__anonymous3_1));
     113    return ((struct __anonymous3 )___ret__13s__anonymous3_1);
    118114}
    119115static inline void ___constructor__F_R13s__anonymous3i_autogen___1(struct __anonymous3 *___dst__R13s__anonymous3_1, signed int __i__i_1){
     
    128124static inline void ___destructor__F_R13s__anonymous4_autogen___1(struct __anonymous4 *___dst__R13s__anonymous4_1);
    129125static inline struct __anonymous4 ___operator_assign__F13s__anonymous4_R13s__anonymous413s__anonymous4_autogen___1(struct __anonymous4 *___dst__R13s__anonymous4_1, struct __anonymous4 ___src__13s__anonymous4_1);
    130 static inline void ___constructor__F_R13s__anonymous4i_autogen___1(struct __anonymous4 *___dst__R13s__anonymous4_1, signed int __i__i_1);
    131126static inline void ___constructor__F_R13s__anonymous4_autogen___1(struct __anonymous4 *___dst__R13s__anonymous4_1){
    132127    ((void)((*___dst__R13s__anonymous4_1).__i__i_1) /* ?{} */);
     
    141136    struct __anonymous4 ___ret__13s__anonymous4_1;
    142137    ((void)((*___dst__R13s__anonymous4_1).__i__i_1=___src__13s__anonymous4_1.__i__i_1));
    143     ((void)___constructor__F_R13s__anonymous413s__anonymous4_autogen___1((&___ret__13s__anonymous4_1), (*___dst__R13s__anonymous4_1)));
    144     return ___ret__13s__anonymous4_1;
     138    ((void)___constructor__F_R13s__anonymous413s__anonymous4_autogen___1((&___ret__13s__anonymous4_1), ___src__13s__anonymous4_1));
     139    return ((struct __anonymous4 )___ret__13s__anonymous4_1);
    145140}
    146141static inline void ___constructor__F_R13s__anonymous4i_autogen___1(struct __anonymous4 *___dst__R13s__anonymous4_1, signed int __i__i_1){
     
    155150static inline void ___destructor__F_R13s__anonymous5_autogen___1(struct __anonymous5 *___dst__R13s__anonymous5_1);
    156151static inline struct __anonymous5 ___operator_assign__F13s__anonymous5_R13s__anonymous513s__anonymous5_autogen___1(struct __anonymous5 *___dst__R13s__anonymous5_1, struct __anonymous5 ___src__13s__anonymous5_1);
    157 static inline void ___constructor__F_R13s__anonymous5i_autogen___1(struct __anonymous5 *___dst__R13s__anonymous5_1, signed int __i__i_1);
    158152static inline void ___constructor__F_R13s__anonymous5_autogen___1(struct __anonymous5 *___dst__R13s__anonymous5_1){
    159153    ((void)((*___dst__R13s__anonymous5_1).__i__i_1) /* ?{} */);
     
    168162    struct __anonymous5 ___ret__13s__anonymous5_1;
    169163    ((void)((*___dst__R13s__anonymous5_1).__i__i_1=___src__13s__anonymous5_1.__i__i_1));
    170     ((void)___constructor__F_R13s__anonymous513s__anonymous5_autogen___1((&___ret__13s__anonymous5_1), (*___dst__R13s__anonymous5_1)));
    171     return ___ret__13s__anonymous5_1;
     164    ((void)___constructor__F_R13s__anonymous513s__anonymous5_autogen___1((&___ret__13s__anonymous5_1), ___src__13s__anonymous5_1));
     165    return ((struct __anonymous5 )___ret__13s__anonymous5_1);
    172166}
    173167static inline void ___constructor__F_R13s__anonymous5i_autogen___1(struct __anonymous5 *___dst__R13s__anonymous5_1, signed int __i__i_1){
     
    182176static inline void ___destructor__F_R13s__anonymous6_autogen___1(struct __anonymous6 *___dst__R13s__anonymous6_1);
    183177static inline struct __anonymous6 ___operator_assign__F13s__anonymous6_R13s__anonymous613s__anonymous6_autogen___1(struct __anonymous6 *___dst__R13s__anonymous6_1, struct __anonymous6 ___src__13s__anonymous6_1);
    184 static inline void ___constructor__F_R13s__anonymous6i_autogen___1(struct __anonymous6 *___dst__R13s__anonymous6_1, signed int __i__i_1);
    185178static inline void ___constructor__F_R13s__anonymous6_autogen___1(struct __anonymous6 *___dst__R13s__anonymous6_1){
    186179    ((void)((*___dst__R13s__anonymous6_1).__i__i_1) /* ?{} */);
     
    195188    struct __anonymous6 ___ret__13s__anonymous6_1;
    196189    ((void)((*___dst__R13s__anonymous6_1).__i__i_1=___src__13s__anonymous6_1.__i__i_1));
    197     ((void)___constructor__F_R13s__anonymous613s__anonymous6_autogen___1((&___ret__13s__anonymous6_1), (*___dst__R13s__anonymous6_1)));
    198     return ___ret__13s__anonymous6_1;
     190    ((void)___constructor__F_R13s__anonymous613s__anonymous6_autogen___1((&___ret__13s__anonymous6_1), ___src__13s__anonymous6_1));
     191    return ((struct __anonymous6 )___ret__13s__anonymous6_1);
    199192}
    200193static inline void ___constructor__F_R13s__anonymous6i_autogen___1(struct __anonymous6 *___dst__R13s__anonymous6_1, signed int __i__i_1){
     
    209202static inline void ___destructor__F_R13s__anonymous7_autogen___1(struct __anonymous7 *___dst__R13s__anonymous7_1);
    210203static inline struct __anonymous7 ___operator_assign__F13s__anonymous7_R13s__anonymous713s__anonymous7_autogen___1(struct __anonymous7 *___dst__R13s__anonymous7_1, struct __anonymous7 ___src__13s__anonymous7_1);
    211 static inline void ___constructor__F_R13s__anonymous7i_autogen___1(struct __anonymous7 *___dst__R13s__anonymous7_1, signed int __i__i_1);
    212204static inline void ___constructor__F_R13s__anonymous7_autogen___1(struct __anonymous7 *___dst__R13s__anonymous7_1){
    213205    ((void)((*___dst__R13s__anonymous7_1).__i__i_1) /* ?{} */);
     
    222214    struct __anonymous7 ___ret__13s__anonymous7_1;
    223215    ((void)((*___dst__R13s__anonymous7_1).__i__i_1=___src__13s__anonymous7_1.__i__i_1));
    224     ((void)___constructor__F_R13s__anonymous713s__anonymous7_autogen___1((&___ret__13s__anonymous7_1), (*___dst__R13s__anonymous7_1)));
    225     return ___ret__13s__anonymous7_1;
     216    ((void)___constructor__F_R13s__anonymous713s__anonymous7_autogen___1((&___ret__13s__anonymous7_1), ___src__13s__anonymous7_1));
     217    return ((struct __anonymous7 )___ret__13s__anonymous7_1);
    226218}
    227219static inline void ___constructor__F_R13s__anonymous7i_autogen___1(struct __anonymous7 *___dst__R13s__anonymous7_1, signed int __i__i_1){
     
    244236static inline void ___destructor__F_R13s__anonymous8_autogen___1(struct __anonymous8 *___dst__R13s__anonymous8_1);
    245237static inline struct __anonymous8 ___operator_assign__F13s__anonymous8_R13s__anonymous813s__anonymous8_autogen___1(struct __anonymous8 *___dst__R13s__anonymous8_1, struct __anonymous8 ___src__13s__anonymous8_1);
    246 static inline void ___constructor__F_R13s__anonymous8s_autogen___1(struct __anonymous8 *___dst__R13s__anonymous8_1, signed short int __i__s_1);
    247238static inline void ___constructor__F_R13s__anonymous8_autogen___1(struct __anonymous8 *___dst__R13s__anonymous8_1){
    248239    ((void)((*___dst__R13s__anonymous8_1).__i__s_1) /* ?{} */);
     
    257248    struct __anonymous8 ___ret__13s__anonymous8_1;
    258249    ((void)((*___dst__R13s__anonymous8_1).__i__s_1=___src__13s__anonymous8_1.__i__s_1));
    259     ((void)___constructor__F_R13s__anonymous813s__anonymous8_autogen___1((&___ret__13s__anonymous8_1), (*___dst__R13s__anonymous8_1)));
    260     return ___ret__13s__anonymous8_1;
     250    ((void)___constructor__F_R13s__anonymous813s__anonymous8_autogen___1((&___ret__13s__anonymous8_1), ___src__13s__anonymous8_1));
     251    return ((struct __anonymous8 )___ret__13s__anonymous8_1);
    261252}
    262253static inline void ___constructor__F_R13s__anonymous8s_autogen___1(struct __anonymous8 *___dst__R13s__anonymous8_1, signed short int __i__s_1){
     
    271262static inline void ___destructor__F_R13s__anonymous9_autogen___1(struct __anonymous9 *___dst__R13s__anonymous9_1);
    272263static inline struct __anonymous9 ___operator_assign__F13s__anonymous9_R13s__anonymous913s__anonymous9_autogen___1(struct __anonymous9 *___dst__R13s__anonymous9_1, struct __anonymous9 ___src__13s__anonymous9_1);
    273 static inline void ___constructor__F_R13s__anonymous9s_autogen___1(struct __anonymous9 *___dst__R13s__anonymous9_1, signed short int __i__s_1);
    274264static inline void ___constructor__F_R13s__anonymous9_autogen___1(struct __anonymous9 *___dst__R13s__anonymous9_1){
    275265    ((void)((*___dst__R13s__anonymous9_1).__i__s_1) /* ?{} */);
     
    284274    struct __anonymous9 ___ret__13s__anonymous9_1;
    285275    ((void)((*___dst__R13s__anonymous9_1).__i__s_1=___src__13s__anonymous9_1.__i__s_1));
    286     ((void)___constructor__F_R13s__anonymous913s__anonymous9_autogen___1((&___ret__13s__anonymous9_1), (*___dst__R13s__anonymous9_1)));
    287     return ___ret__13s__anonymous9_1;
     276    ((void)___constructor__F_R13s__anonymous913s__anonymous9_autogen___1((&___ret__13s__anonymous9_1), ___src__13s__anonymous9_1));
     277    return ((struct __anonymous9 )___ret__13s__anonymous9_1);
    288278}
    289279static inline void ___constructor__F_R13s__anonymous9s_autogen___1(struct __anonymous9 *___dst__R13s__anonymous9_1, signed short int __i__s_1){
     
    298288static inline void ___destructor__F_R14s__anonymous10_autogen___1(struct __anonymous10 *___dst__R14s__anonymous10_1);
    299289static inline struct __anonymous10 ___operator_assign__F14s__anonymous10_R14s__anonymous1014s__anonymous10_autogen___1(struct __anonymous10 *___dst__R14s__anonymous10_1, struct __anonymous10 ___src__14s__anonymous10_1);
    300 static inline void ___constructor__F_R14s__anonymous10s_autogen___1(struct __anonymous10 *___dst__R14s__anonymous10_1, signed short int __i__s_1);
    301290static inline void ___constructor__F_R14s__anonymous10_autogen___1(struct __anonymous10 *___dst__R14s__anonymous10_1){
    302291    ((void)((*___dst__R14s__anonymous10_1).__i__s_1) /* ?{} */);
     
    311300    struct __anonymous10 ___ret__14s__anonymous10_1;
    312301    ((void)((*___dst__R14s__anonymous10_1).__i__s_1=___src__14s__anonymous10_1.__i__s_1));
    313     ((void)___constructor__F_R14s__anonymous1014s__anonymous10_autogen___1((&___ret__14s__anonymous10_1), (*___dst__R14s__anonymous10_1)));
    314     return ___ret__14s__anonymous10_1;
     302    ((void)___constructor__F_R14s__anonymous1014s__anonymous10_autogen___1((&___ret__14s__anonymous10_1), ___src__14s__anonymous10_1));
     303    return ((struct __anonymous10 )___ret__14s__anonymous10_1);
    315304}
    316305static inline void ___constructor__F_R14s__anonymous10s_autogen___1(struct __anonymous10 *___dst__R14s__anonymous10_1, signed short int __i__s_1){
     
    325314static inline void ___destructor__F_R14s__anonymous11_autogen___1(struct __anonymous11 *___dst__R14s__anonymous11_1);
    326315static inline struct __anonymous11 ___operator_assign__F14s__anonymous11_R14s__anonymous1114s__anonymous11_autogen___1(struct __anonymous11 *___dst__R14s__anonymous11_1, struct __anonymous11 ___src__14s__anonymous11_1);
    327 static inline void ___constructor__F_R14s__anonymous11s_autogen___1(struct __anonymous11 *___dst__R14s__anonymous11_1, signed short int __i__s_1);
    328316static inline void ___constructor__F_R14s__anonymous11_autogen___1(struct __anonymous11 *___dst__R14s__anonymous11_1){
    329317    ((void)((*___dst__R14s__anonymous11_1).__i__s_1) /* ?{} */);
     
    338326    struct __anonymous11 ___ret__14s__anonymous11_1;
    339327    ((void)((*___dst__R14s__anonymous11_1).__i__s_1=___src__14s__anonymous11_1.__i__s_1));
    340     ((void)___constructor__F_R14s__anonymous1114s__anonymous11_autogen___1((&___ret__14s__anonymous11_1), (*___dst__R14s__anonymous11_1)));
    341     return ___ret__14s__anonymous11_1;
     328    ((void)___constructor__F_R14s__anonymous1114s__anonymous11_autogen___1((&___ret__14s__anonymous11_1), ___src__14s__anonymous11_1));
     329    return ((struct __anonymous11 )___ret__14s__anonymous11_1);
    342330}
    343331static inline void ___constructor__F_R14s__anonymous11s_autogen___1(struct __anonymous11 *___dst__R14s__anonymous11_1, signed short int __i__s_1){
     
    352340static inline void ___destructor__F_R14s__anonymous12_autogen___1(struct __anonymous12 *___dst__R14s__anonymous12_1);
    353341static inline struct __anonymous12 ___operator_assign__F14s__anonymous12_R14s__anonymous1214s__anonymous12_autogen___1(struct __anonymous12 *___dst__R14s__anonymous12_1, struct __anonymous12 ___src__14s__anonymous12_1);
    354 static inline void ___constructor__F_R14s__anonymous12s_autogen___1(struct __anonymous12 *___dst__R14s__anonymous12_1, signed short int __i__s_1);
    355342static inline void ___constructor__F_R14s__anonymous12_autogen___1(struct __anonymous12 *___dst__R14s__anonymous12_1){
    356343    ((void)((*___dst__R14s__anonymous12_1).__i__s_1) /* ?{} */);
     
    365352    struct __anonymous12 ___ret__14s__anonymous12_1;
    366353    ((void)((*___dst__R14s__anonymous12_1).__i__s_1=___src__14s__anonymous12_1.__i__s_1));
    367     ((void)___constructor__F_R14s__anonymous1214s__anonymous12_autogen___1((&___ret__14s__anonymous12_1), (*___dst__R14s__anonymous12_1)));
    368     return ___ret__14s__anonymous12_1;
     354    ((void)___constructor__F_R14s__anonymous1214s__anonymous12_autogen___1((&___ret__14s__anonymous12_1), ___src__14s__anonymous12_1));
     355    return ((struct __anonymous12 )___ret__14s__anonymous12_1);
    369356}
    370357static inline void ___constructor__F_R14s__anonymous12s_autogen___1(struct __anonymous12 *___dst__R14s__anonymous12_1, signed short int __i__s_1){
     
    379366static inline void ___destructor__F_R14s__anonymous13_autogen___1(struct __anonymous13 *___dst__R14s__anonymous13_1);
    380367static inline struct __anonymous13 ___operator_assign__F14s__anonymous13_R14s__anonymous1314s__anonymous13_autogen___1(struct __anonymous13 *___dst__R14s__anonymous13_1, struct __anonymous13 ___src__14s__anonymous13_1);
    381 static inline void ___constructor__F_R14s__anonymous13s_autogen___1(struct __anonymous13 *___dst__R14s__anonymous13_1, signed short int __i__s_1);
    382368static inline void ___constructor__F_R14s__anonymous13_autogen___1(struct __anonymous13 *___dst__R14s__anonymous13_1){
    383369    ((void)((*___dst__R14s__anonymous13_1).__i__s_1) /* ?{} */);
     
    392378    struct __anonymous13 ___ret__14s__anonymous13_1;
    393379    ((void)((*___dst__R14s__anonymous13_1).__i__s_1=___src__14s__anonymous13_1.__i__s_1));
    394     ((void)___constructor__F_R14s__anonymous1314s__anonymous13_autogen___1((&___ret__14s__anonymous13_1), (*___dst__R14s__anonymous13_1)));
    395     return ___ret__14s__anonymous13_1;
     380    ((void)___constructor__F_R14s__anonymous1314s__anonymous13_autogen___1((&___ret__14s__anonymous13_1), ___src__14s__anonymous13_1));
     381    return ((struct __anonymous13 )___ret__14s__anonymous13_1);
    396382}
    397383static inline void ___constructor__F_R14s__anonymous13s_autogen___1(struct __anonymous13 *___dst__R14s__anonymous13_1, signed short int __i__s_1){
     
    406392static inline void ___destructor__F_R14s__anonymous14_autogen___1(struct __anonymous14 *___dst__R14s__anonymous14_1);
    407393static inline struct __anonymous14 ___operator_assign__F14s__anonymous14_R14s__anonymous1414s__anonymous14_autogen___1(struct __anonymous14 *___dst__R14s__anonymous14_1, struct __anonymous14 ___src__14s__anonymous14_1);
    408 static inline void ___constructor__F_R14s__anonymous14s_autogen___1(struct __anonymous14 *___dst__R14s__anonymous14_1, signed short int __i__s_1);
    409394static inline void ___constructor__F_R14s__anonymous14_autogen___1(struct __anonymous14 *___dst__R14s__anonymous14_1){
    410395    ((void)((*___dst__R14s__anonymous14_1).__i__s_1) /* ?{} */);
     
    419404    struct __anonymous14 ___ret__14s__anonymous14_1;
    420405    ((void)((*___dst__R14s__anonymous14_1).__i__s_1=___src__14s__anonymous14_1.__i__s_1));
    421     ((void)___constructor__F_R14s__anonymous1414s__anonymous14_autogen___1((&___ret__14s__anonymous14_1), (*___dst__R14s__anonymous14_1)));
    422     return ___ret__14s__anonymous14_1;
     406    ((void)___constructor__F_R14s__anonymous1414s__anonymous14_autogen___1((&___ret__14s__anonymous14_1), ___src__14s__anonymous14_1));
     407    return ((struct __anonymous14 )___ret__14s__anonymous14_1);
    423408}
    424409static inline void ___constructor__F_R14s__anonymous14s_autogen___1(struct __anonymous14 *___dst__R14s__anonymous14_1, signed short int __i__s_1){
     
    433418static inline void ___destructor__F_R14s__anonymous15_autogen___1(struct __anonymous15 *___dst__R14s__anonymous15_1);
    434419static inline struct __anonymous15 ___operator_assign__F14s__anonymous15_R14s__anonymous1514s__anonymous15_autogen___1(struct __anonymous15 *___dst__R14s__anonymous15_1, struct __anonymous15 ___src__14s__anonymous15_1);
    435 static inline void ___constructor__F_R14s__anonymous15s_autogen___1(struct __anonymous15 *___dst__R14s__anonymous15_1, signed short int __i__s_1);
    436420static inline void ___constructor__F_R14s__anonymous15_autogen___1(struct __anonymous15 *___dst__R14s__anonymous15_1){
    437421    ((void)((*___dst__R14s__anonymous15_1).__i__s_1) /* ?{} */);
     
    446430    struct __anonymous15 ___ret__14s__anonymous15_1;
    447431    ((void)((*___dst__R14s__anonymous15_1).__i__s_1=___src__14s__anonymous15_1.__i__s_1));
    448     ((void)___constructor__F_R14s__anonymous1514s__anonymous15_autogen___1((&___ret__14s__anonymous15_1), (*___dst__R14s__anonymous15_1)));
    449     return ___ret__14s__anonymous15_1;
     432    ((void)___constructor__F_R14s__anonymous1514s__anonymous15_autogen___1((&___ret__14s__anonymous15_1), ___src__14s__anonymous15_1));
     433    return ((struct __anonymous15 )___ret__14s__anonymous15_1);
    450434}
    451435static inline void ___constructor__F_R14s__anonymous15s_autogen___1(struct __anonymous15 *___dst__R14s__anonymous15_1, signed short int __i__s_1){
     
    476460static inline void ___destructor__F_R14s__anonymous16_autogen___1(struct __anonymous16 *___dst__R14s__anonymous16_1);
    477461static inline struct __anonymous16 ___operator_assign__F14s__anonymous16_R14s__anonymous1614s__anonymous16_autogen___1(struct __anonymous16 *___dst__R14s__anonymous16_1, struct __anonymous16 ___src__14s__anonymous16_1);
    478 static inline void ___constructor__F_R14s__anonymous16i_autogen___1(struct __anonymous16 *___dst__R14s__anonymous16_1, signed int __i__i_1);
    479462static inline void ___constructor__F_R14s__anonymous16_autogen___1(struct __anonymous16 *___dst__R14s__anonymous16_1){
    480463    ((void)((*___dst__R14s__anonymous16_1).__i__i_1) /* ?{} */);
     
    489472    struct __anonymous16 ___ret__14s__anonymous16_1;
    490473    ((void)((*___dst__R14s__anonymous16_1).__i__i_1=___src__14s__anonymous16_1.__i__i_1));
    491     ((void)___constructor__F_R14s__anonymous1614s__anonymous16_autogen___1((&___ret__14s__anonymous16_1), (*___dst__R14s__anonymous16_1)));
    492     return ___ret__14s__anonymous16_1;
     474    ((void)___constructor__F_R14s__anonymous1614s__anonymous16_autogen___1((&___ret__14s__anonymous16_1), ___src__14s__anonymous16_1));
     475    return ((struct __anonymous16 )___ret__14s__anonymous16_1);
    493476}
    494477static inline void ___constructor__F_R14s__anonymous16i_autogen___1(struct __anonymous16 *___dst__R14s__anonymous16_1, signed int __i__i_1){
     
    503486static inline void ___destructor__F_R14s__anonymous17_autogen___1(struct __anonymous17 *___dst__R14s__anonymous17_1);
    504487static inline struct __anonymous17 ___operator_assign__F14s__anonymous17_R14s__anonymous1714s__anonymous17_autogen___1(struct __anonymous17 *___dst__R14s__anonymous17_1, struct __anonymous17 ___src__14s__anonymous17_1);
    505 static inline void ___constructor__F_R14s__anonymous17i_autogen___1(struct __anonymous17 *___dst__R14s__anonymous17_1, signed int __i__i_1);
    506488static inline void ___constructor__F_R14s__anonymous17_autogen___1(struct __anonymous17 *___dst__R14s__anonymous17_1){
    507489    ((void)((*___dst__R14s__anonymous17_1).__i__i_1) /* ?{} */);
     
    516498    struct __anonymous17 ___ret__14s__anonymous17_1;
    517499    ((void)((*___dst__R14s__anonymous17_1).__i__i_1=___src__14s__anonymous17_1.__i__i_1));
    518     ((void)___constructor__F_R14s__anonymous1714s__anonymous17_autogen___1((&___ret__14s__anonymous17_1), (*___dst__R14s__anonymous17_1)));
    519     return ___ret__14s__anonymous17_1;
     500    ((void)___constructor__F_R14s__anonymous1714s__anonymous17_autogen___1((&___ret__14s__anonymous17_1), ___src__14s__anonymous17_1));
     501    return ((struct __anonymous17 )___ret__14s__anonymous17_1);
    520502}
    521503static inline void ___constructor__F_R14s__anonymous17i_autogen___1(struct __anonymous17 *___dst__R14s__anonymous17_1, signed int __i__i_1){
     
    530512static inline void ___destructor__F_R14s__anonymous18_autogen___1(struct __anonymous18 *___dst__R14s__anonymous18_1);
    531513static inline struct __anonymous18 ___operator_assign__F14s__anonymous18_R14s__anonymous1814s__anonymous18_autogen___1(struct __anonymous18 *___dst__R14s__anonymous18_1, struct __anonymous18 ___src__14s__anonymous18_1);
    532 static inline void ___constructor__F_R14s__anonymous18i_autogen___1(struct __anonymous18 *___dst__R14s__anonymous18_1, signed int __i__i_1);
    533514static inline void ___constructor__F_R14s__anonymous18_autogen___1(struct __anonymous18 *___dst__R14s__anonymous18_1){
    534515    ((void)((*___dst__R14s__anonymous18_1).__i__i_1) /* ?{} */);
     
    543524    struct __anonymous18 ___ret__14s__anonymous18_1;
    544525    ((void)((*___dst__R14s__anonymous18_1).__i__i_1=___src__14s__anonymous18_1.__i__i_1));
    545     ((void)___constructor__F_R14s__anonymous1814s__anonymous18_autogen___1((&___ret__14s__anonymous18_1), (*___dst__R14s__anonymous18_1)));
    546     return ___ret__14s__anonymous18_1;
     526    ((void)___constructor__F_R14s__anonymous1814s__anonymous18_autogen___1((&___ret__14s__anonymous18_1), ___src__14s__anonymous18_1));
     527    return ((struct __anonymous18 )___ret__14s__anonymous18_1);
    547528}
    548529static inline void ___constructor__F_R14s__anonymous18i_autogen___1(struct __anonymous18 *___dst__R14s__anonymous18_1, signed int __i__i_1){
     
    557538static inline void ___destructor__F_R14s__anonymous19_autogen___1(struct __anonymous19 *___dst__R14s__anonymous19_1);
    558539static inline struct __anonymous19 ___operator_assign__F14s__anonymous19_R14s__anonymous1914s__anonymous19_autogen___1(struct __anonymous19 *___dst__R14s__anonymous19_1, struct __anonymous19 ___src__14s__anonymous19_1);
    559 static inline void ___constructor__F_R14s__anonymous19i_autogen___1(struct __anonymous19 *___dst__R14s__anonymous19_1, signed int __i__i_1);
    560540static inline void ___constructor__F_R14s__anonymous19_autogen___1(struct __anonymous19 *___dst__R14s__anonymous19_1){
    561541    ((void)((*___dst__R14s__anonymous19_1).__i__i_1) /* ?{} */);
     
    570550    struct __anonymous19 ___ret__14s__anonymous19_1;
    571551    ((void)((*___dst__R14s__anonymous19_1).__i__i_1=___src__14s__anonymous19_1.__i__i_1));
    572     ((void)___constructor__F_R14s__anonymous1914s__anonymous19_autogen___1((&___ret__14s__anonymous19_1), (*___dst__R14s__anonymous19_1)));
    573     return ___ret__14s__anonymous19_1;
     552    ((void)___constructor__F_R14s__anonymous1914s__anonymous19_autogen___1((&___ret__14s__anonymous19_1), ___src__14s__anonymous19_1));
     553    return ((struct __anonymous19 )___ret__14s__anonymous19_1);
    574554}
    575555static inline void ___constructor__F_R14s__anonymous19i_autogen___1(struct __anonymous19 *___dst__R14s__anonymous19_1, signed int __i__i_1){
     
    584564static inline void ___destructor__F_R14s__anonymous20_autogen___1(struct __anonymous20 *___dst__R14s__anonymous20_1);
    585565static inline struct __anonymous20 ___operator_assign__F14s__anonymous20_R14s__anonymous2014s__anonymous20_autogen___1(struct __anonymous20 *___dst__R14s__anonymous20_1, struct __anonymous20 ___src__14s__anonymous20_1);
    586 static inline void ___constructor__F_R14s__anonymous20i_autogen___1(struct __anonymous20 *___dst__R14s__anonymous20_1, signed int __i__i_1);
    587566static inline void ___constructor__F_R14s__anonymous20_autogen___1(struct __anonymous20 *___dst__R14s__anonymous20_1){
    588567    ((void)((*___dst__R14s__anonymous20_1).__i__i_1) /* ?{} */);
     
    597576    struct __anonymous20 ___ret__14s__anonymous20_1;
    598577    ((void)((*___dst__R14s__anonymous20_1).__i__i_1=___src__14s__anonymous20_1.__i__i_1));
    599     ((void)___constructor__F_R14s__anonymous2014s__anonymous20_autogen___1((&___ret__14s__anonymous20_1), (*___dst__R14s__anonymous20_1)));
    600     return ___ret__14s__anonymous20_1;
     578    ((void)___constructor__F_R14s__anonymous2014s__anonymous20_autogen___1((&___ret__14s__anonymous20_1), ___src__14s__anonymous20_1));
     579    return ((struct __anonymous20 )___ret__14s__anonymous20_1);
    601580}
    602581static inline void ___constructor__F_R14s__anonymous20i_autogen___1(struct __anonymous20 *___dst__R14s__anonymous20_1, signed int __i__i_1){
     
    611590static inline void ___destructor__F_R14s__anonymous21_autogen___1(struct __anonymous21 *___dst__R14s__anonymous21_1);
    612591static inline struct __anonymous21 ___operator_assign__F14s__anonymous21_R14s__anonymous2114s__anonymous21_autogen___1(struct __anonymous21 *___dst__R14s__anonymous21_1, struct __anonymous21 ___src__14s__anonymous21_1);
    613 static inline void ___constructor__F_R14s__anonymous21i_autogen___1(struct __anonymous21 *___dst__R14s__anonymous21_1, signed int __i__i_1);
    614592static inline void ___constructor__F_R14s__anonymous21_autogen___1(struct __anonymous21 *___dst__R14s__anonymous21_1){
    615593    ((void)((*___dst__R14s__anonymous21_1).__i__i_1) /* ?{} */);
     
    624602    struct __anonymous21 ___ret__14s__anonymous21_1;
    625603    ((void)((*___dst__R14s__anonymous21_1).__i__i_1=___src__14s__anonymous21_1.__i__i_1));
    626     ((void)___constructor__F_R14s__anonymous2114s__anonymous21_autogen___1((&___ret__14s__anonymous21_1), (*___dst__R14s__anonymous21_1)));
    627     return ___ret__14s__anonymous21_1;
     604    ((void)___constructor__F_R14s__anonymous2114s__anonymous21_autogen___1((&___ret__14s__anonymous21_1), ___src__14s__anonymous21_1));
     605    return ((struct __anonymous21 )___ret__14s__anonymous21_1);
    628606}
    629607static inline void ___constructor__F_R14s__anonymous21i_autogen___1(struct __anonymous21 *___dst__R14s__anonymous21_1, signed int __i__i_1){
     
    638616static inline void ___destructor__F_R14s__anonymous22_autogen___1(struct __anonymous22 *___dst__R14s__anonymous22_1);
    639617static inline struct __anonymous22 ___operator_assign__F14s__anonymous22_R14s__anonymous2214s__anonymous22_autogen___1(struct __anonymous22 *___dst__R14s__anonymous22_1, struct __anonymous22 ___src__14s__anonymous22_1);
    640 static inline void ___constructor__F_R14s__anonymous22i_autogen___1(struct __anonymous22 *___dst__R14s__anonymous22_1, signed int __i__i_1);
    641618static inline void ___constructor__F_R14s__anonymous22_autogen___1(struct __anonymous22 *___dst__R14s__anonymous22_1){
    642619    ((void)((*___dst__R14s__anonymous22_1).__i__i_1) /* ?{} */);
     
    651628    struct __anonymous22 ___ret__14s__anonymous22_1;
    652629    ((void)((*___dst__R14s__anonymous22_1).__i__i_1=___src__14s__anonymous22_1.__i__i_1));
    653     ((void)___constructor__F_R14s__anonymous2214s__anonymous22_autogen___1((&___ret__14s__anonymous22_1), (*___dst__R14s__anonymous22_1)));
    654     return ___ret__14s__anonymous22_1;
     630    ((void)___constructor__F_R14s__anonymous2214s__anonymous22_autogen___1((&___ret__14s__anonymous22_1), ___src__14s__anonymous22_1));
     631    return ((struct __anonymous22 )___ret__14s__anonymous22_1);
    655632}
    656633static inline void ___constructor__F_R14s__anonymous22i_autogen___1(struct __anonymous22 *___dst__R14s__anonymous22_1, signed int __i__i_1){
     
    665642static inline void ___destructor__F_R14s__anonymous23_autogen___1(struct __anonymous23 *___dst__R14s__anonymous23_1);
    666643static inline struct __anonymous23 ___operator_assign__F14s__anonymous23_R14s__anonymous2314s__anonymous23_autogen___1(struct __anonymous23 *___dst__R14s__anonymous23_1, struct __anonymous23 ___src__14s__anonymous23_1);
    667 static inline void ___constructor__F_R14s__anonymous23i_autogen___1(struct __anonymous23 *___dst__R14s__anonymous23_1, signed int __i__i_1);
    668644static inline void ___constructor__F_R14s__anonymous23_autogen___1(struct __anonymous23 *___dst__R14s__anonymous23_1){
    669645    ((void)((*___dst__R14s__anonymous23_1).__i__i_1) /* ?{} */);
     
    678654    struct __anonymous23 ___ret__14s__anonymous23_1;
    679655    ((void)((*___dst__R14s__anonymous23_1).__i__i_1=___src__14s__anonymous23_1.__i__i_1));
    680     ((void)___constructor__F_R14s__anonymous2314s__anonymous23_autogen___1((&___ret__14s__anonymous23_1), (*___dst__R14s__anonymous23_1)));
    681     return ___ret__14s__anonymous23_1;
     656    ((void)___constructor__F_R14s__anonymous2314s__anonymous23_autogen___1((&___ret__14s__anonymous23_1), ___src__14s__anonymous23_1));
     657    return ((struct __anonymous23 )___ret__14s__anonymous23_1);
    682658}
    683659static inline void ___constructor__F_R14s__anonymous23i_autogen___1(struct __anonymous23 *___dst__R14s__anonymous23_1, signed int __i__i_1){
     
    696672    __attribute__ ((unused)) signed int ___retval_main__i_1;
    697673    ((void)(___retval_main__i_1=((signed int )0)) /* ?{} */);
    698     return ___retval_main__i_1;
     674    return ((signed int )___retval_main__i_1);
    699675    ((void)(___retval_main__i_1=0) /* ?{} */);
    700     return ___retval_main__i_1;
     676    return ((signed int )___retval_main__i_1);
    701677}
    702678static inline int invoke_main(int argc, char* argv[], char* envp[]) { (void)argc; (void)argv; (void)envp; return __main__Fi_iPPCc__1(argc, argv); }
     
    713689    ((void)(___retval_main__i_1=(((void)(_tmp_cp_ret0=invoke_main(__argc__i_1, __argv__PPc_1, __envp__PPc_1))) , _tmp_cp_ret0)) /* ?{} */);
    714690    ((void)(_tmp_cp_ret0) /* ^?{} */);
    715     return ___retval_main__i_1;
    716 }
     691    return ((signed int )___retval_main__i_1);
     692}
  • src/tests/.expect/64/extension.txt

    r3f7e12cb r78315272  
    1717static inline void ___destructor__F_R2sS_autogen___1(struct S *___dst__R2sS_1);
    1818static inline struct S ___operator_assign__F2sS_R2sS2sS_autogen___1(struct S *___dst__R2sS_1, struct S ___src__2sS_1);
    19 static inline void ___constructor__F_R2sSi_autogen___1(struct S *___dst__R2sS_1, signed int __a__i_1);
    20 static inline void ___constructor__F_R2sSii_autogen___1(struct S *___dst__R2sS_1, signed int __a__i_1, signed int __b__i_1);
    21 static inline void ___constructor__F_R2sSiii_autogen___1(struct S *___dst__R2sS_1, signed int __a__i_1, signed int __b__i_1, signed int __c__i_1);
    2219static inline void ___constructor__F_R2sS_autogen___1(struct S *___dst__R2sS_1){
    2320    ((void)((*___dst__R2sS_1).__a__i_1) /* ?{} */);
     
    4037    ((void)((*___dst__R2sS_1).__b__i_1=___src__2sS_1.__b__i_1));
    4138    ((void)((*___dst__R2sS_1).__c__i_1=___src__2sS_1.__c__i_1));
    42     ((void)___constructor__F_R2sS2sS_autogen___1((&___ret__2sS_1), (*___dst__R2sS_1)));
    43     return ___ret__2sS_1;
     39    ((void)___constructor__F_R2sS2sS_autogen___1((&___ret__2sS_1), ___src__2sS_1));
     40    return ((struct S )___ret__2sS_1);
    4441}
    4542static inline void ___constructor__F_R2sSi_autogen___1(struct S *___dst__R2sS_1, signed int __a__i_1){
     
    6360    __extension__ signed int __c__i_1;
    6461};
    65 static inline void ___constructor__F_R2uU_autogen___1(__attribute__ ((unused)) union U *___dst__R2uU_1);
    66 static inline void ___constructor__F_R2uU2uU_autogen___1(union U *___dst__R2uU_1, union U ___src__2uU_1);
    67 static inline void ___destructor__F_R2uU_autogen___1(__attribute__ ((unused)) union U *___dst__R2uU_1);
    68 static inline union U ___operator_assign__F2uU_R2uU2uU_autogen___1(union U *___dst__R2uU_1, union U ___src__2uU_1);
    69 static inline void ___constructor__F_R2uUi_autogen___1(union U *___dst__R2uU_1, signed int __a__i_1);
    7062static inline void ___constructor__F_R2uU_autogen___1(__attribute__ ((unused)) union U *___dst__R2uU_1){
    7163}
     
    7870    union U ___ret__2uU_1;
    7971    ((void)__builtin_memcpy(((void *)___dst__R2uU_1), ((const void *)(&___src__2uU_1)), sizeof(union U )));
    80     ((void)___constructor__F_R2uU2uU_autogen___1((&___ret__2uU_1), (*___dst__R2uU_1)));
    81     return ___ret__2uU_1;
     72    ((void)___constructor__F_R2uU2uU_autogen___1((&___ret__2uU_1), ___src__2uU_1));
     73    return ((union U )___ret__2uU_1);
    8274}
    83 static inline void ___constructor__F_R2uUi_autogen___1(union U *___dst__R2uU_1, signed int __a__i_1){
    84     ((void)__builtin_memcpy(((void *)___dst__R2uU_1), ((const void *)(&__a__i_1)), sizeof(signed int )));
     75static inline void ___constructor__F_R2uUi_autogen___1(__attribute__ ((unused)) union U *___dst__R2uU_1, signed int __src__i_1){
     76    ((void)__builtin_memcpy(((void *)___dst__R2uU_1), ((const void *)(&__src__i_1)), sizeof(signed int )));
    8577}
    8678__extension__ enum E {
     
    10294        __extension__ signed int *__z__Pi_2;
    10395    };
    104     inline void ___constructor__F_R2sS_autogen___2(struct S *___dst__R2sS_2){
    105         ((void)((*___dst__R2sS_2).__a__i_2) /* ?{} */);
    106         ((void)((*___dst__R2sS_2).__b__i_2) /* ?{} */);
    107         ((void)((*___dst__R2sS_2).__c__i_2) /* ?{} */);
    108         ((void)((*___dst__R2sS_2).__x__Pi_2) /* ?{} */);
    109         ((void)((*___dst__R2sS_2).__y__Pi_2) /* ?{} */);
    110         ((void)((*___dst__R2sS_2).__z__Pi_2) /* ?{} */);
    111     }
    112     inline void ___constructor__F_R2sS2sS_autogen___2(struct S *___dst__R2sS_2, struct S ___src__2sS_2){
    113         ((void)((*___dst__R2sS_2).__a__i_2=___src__2sS_2.__a__i_2) /* ?{} */);
    114         ((void)((*___dst__R2sS_2).__b__i_2=___src__2sS_2.__b__i_2) /* ?{} */);
    115         ((void)((*___dst__R2sS_2).__c__i_2=___src__2sS_2.__c__i_2) /* ?{} */);
    116         ((void)((*___dst__R2sS_2).__x__Pi_2=___src__2sS_2.__x__Pi_2) /* ?{} */);
    117         ((void)((*___dst__R2sS_2).__y__Pi_2=___src__2sS_2.__y__Pi_2) /* ?{} */);
    118         ((void)((*___dst__R2sS_2).__z__Pi_2=___src__2sS_2.__z__Pi_2) /* ?{} */);
    119     }
    120     inline void ___destructor__F_R2sS_autogen___2(struct S *___dst__R2sS_2){
    121         ((void)((*___dst__R2sS_2).__z__Pi_2) /* ^?{} */);
    122         ((void)((*___dst__R2sS_2).__y__Pi_2) /* ^?{} */);
    123         ((void)((*___dst__R2sS_2).__x__Pi_2) /* ^?{} */);
    124         ((void)((*___dst__R2sS_2).__c__i_2) /* ^?{} */);
    125         ((void)((*___dst__R2sS_2).__b__i_2) /* ^?{} */);
    126         ((void)((*___dst__R2sS_2).__a__i_2) /* ^?{} */);
    127     }
    128     inline struct S ___operator_assign__F2sS_R2sS2sS_autogen___2(struct S *___dst__R2sS_2, struct S ___src__2sS_2){
    129         struct S ___ret__2sS_2;
    130         ((void)((*___dst__R2sS_2).__a__i_2=___src__2sS_2.__a__i_2));
    131         ((void)((*___dst__R2sS_2).__b__i_2=___src__2sS_2.__b__i_2));
    132         ((void)((*___dst__R2sS_2).__c__i_2=___src__2sS_2.__c__i_2));
    133         ((void)((*___dst__R2sS_2).__x__Pi_2=___src__2sS_2.__x__Pi_2));
    134         ((void)((*___dst__R2sS_2).__y__Pi_2=___src__2sS_2.__y__Pi_2));
    135         ((void)((*___dst__R2sS_2).__z__Pi_2=___src__2sS_2.__z__Pi_2));
    136         ((void)___constructor__F_R2sS2sS_autogen___2((&___ret__2sS_2), (*___dst__R2sS_2)));
    137         return ___ret__2sS_2;
    138     }
    139     inline void ___constructor__F_R2sSi_autogen___2(struct S *___dst__R2sS_2, signed int __a__i_2){
    140         ((void)((*___dst__R2sS_2).__a__i_2=__a__i_2) /* ?{} */);
    141         ((void)((*___dst__R2sS_2).__b__i_2) /* ?{} */);
    142         ((void)((*___dst__R2sS_2).__c__i_2) /* ?{} */);
    143         ((void)((*___dst__R2sS_2).__x__Pi_2) /* ?{} */);
    144         ((void)((*___dst__R2sS_2).__y__Pi_2) /* ?{} */);
    145         ((void)((*___dst__R2sS_2).__z__Pi_2) /* ?{} */);
    146     }
    147     inline void ___constructor__F_R2sSii_autogen___2(struct S *___dst__R2sS_2, signed int __a__i_2, signed int __b__i_2){
    148         ((void)((*___dst__R2sS_2).__a__i_2=__a__i_2) /* ?{} */);
    149         ((void)((*___dst__R2sS_2).__b__i_2=__b__i_2) /* ?{} */);
    150         ((void)((*___dst__R2sS_2).__c__i_2) /* ?{} */);
    151         ((void)((*___dst__R2sS_2).__x__Pi_2) /* ?{} */);
    152         ((void)((*___dst__R2sS_2).__y__Pi_2) /* ?{} */);
    153         ((void)((*___dst__R2sS_2).__z__Pi_2) /* ?{} */);
    154     }
    155     inline void ___constructor__F_R2sSiii_autogen___2(struct S *___dst__R2sS_2, signed int __a__i_2, signed int __b__i_2, signed int __c__i_2){
    156         ((void)((*___dst__R2sS_2).__a__i_2=__a__i_2) /* ?{} */);
    157         ((void)((*___dst__R2sS_2).__b__i_2=__b__i_2) /* ?{} */);
    158         ((void)((*___dst__R2sS_2).__c__i_2=__c__i_2) /* ?{} */);
    159         ((void)((*___dst__R2sS_2).__x__Pi_2) /* ?{} */);
    160         ((void)((*___dst__R2sS_2).__y__Pi_2) /* ?{} */);
    161         ((void)((*___dst__R2sS_2).__z__Pi_2) /* ?{} */);
    162     }
    163     inline void ___constructor__F_R2sSiiiPi_autogen___2(struct S *___dst__R2sS_2, signed int __a__i_2, signed int __b__i_2, signed int __c__i_2, signed int *__x__Pi_2){
    164         ((void)((*___dst__R2sS_2).__a__i_2=__a__i_2) /* ?{} */);
    165         ((void)((*___dst__R2sS_2).__b__i_2=__b__i_2) /* ?{} */);
    166         ((void)((*___dst__R2sS_2).__c__i_2=__c__i_2) /* ?{} */);
    167         ((void)((*___dst__R2sS_2).__x__Pi_2=__x__Pi_2) /* ?{} */);
    168         ((void)((*___dst__R2sS_2).__y__Pi_2) /* ?{} */);
    169         ((void)((*___dst__R2sS_2).__z__Pi_2) /* ?{} */);
    170     }
    171     inline void ___constructor__F_R2sSiiiPiPi_autogen___2(struct S *___dst__R2sS_2, signed int __a__i_2, signed int __b__i_2, signed int __c__i_2, signed int *__x__Pi_2, signed int *__y__Pi_2){
    172         ((void)((*___dst__R2sS_2).__a__i_2=__a__i_2) /* ?{} */);
    173         ((void)((*___dst__R2sS_2).__b__i_2=__b__i_2) /* ?{} */);
    174         ((void)((*___dst__R2sS_2).__c__i_2=__c__i_2) /* ?{} */);
    175         ((void)((*___dst__R2sS_2).__x__Pi_2=__x__Pi_2) /* ?{} */);
    176         ((void)((*___dst__R2sS_2).__y__Pi_2=__y__Pi_2) /* ?{} */);
    177         ((void)((*___dst__R2sS_2).__z__Pi_2) /* ?{} */);
    178     }
    179     inline void ___constructor__F_R2sSiiiPiPiPi_autogen___2(struct S *___dst__R2sS_2, signed int __a__i_2, signed int __b__i_2, signed int __c__i_2, signed int *__x__Pi_2, signed int *__y__Pi_2, signed int *__z__Pi_2){
    180         ((void)((*___dst__R2sS_2).__a__i_2=__a__i_2) /* ?{} */);
    181         ((void)((*___dst__R2sS_2).__b__i_2=__b__i_2) /* ?{} */);
    182         ((void)((*___dst__R2sS_2).__c__i_2=__c__i_2) /* ?{} */);
    183         ((void)((*___dst__R2sS_2).__x__Pi_2=__x__Pi_2) /* ?{} */);
    184         ((void)((*___dst__R2sS_2).__y__Pi_2=__y__Pi_2) /* ?{} */);
    185         ((void)((*___dst__R2sS_2).__z__Pi_2=__z__Pi_2) /* ?{} */);
    186     }
    187     signed int __i__i_2 = (__extension__ __a__i_1+__extension__ 3);
     96    signed int __i__i_2 = ((signed int )(__extension__ __a__i_1+__extension__ 3));
    18897    ((void)__extension__ 3);
    18998    ((void)__extension__ __a__i_1);
  • src/tests/.expect/64/gccExtensions.txt

    r3f7e12cb r78315272  
    6363        ((void)((*___dst__R2sS_2).__b__i_2=___src__2sS_2.__b__i_2));
    6464        ((void)((*___dst__R2sS_2).__c__i_2=___src__2sS_2.__c__i_2));
    65         ((void)___constructor__F_R2sS2sS_autogen___2((&___ret__2sS_2), (*___dst__R2sS_2)));
    66         return ___ret__2sS_2;
     65        ((void)___constructor__F_R2sS2sS_autogen___2((&___ret__2sS_2), ___src__2sS_2));
     66        return ((struct S )___ret__2sS_2);
    6767    }
    6868    inline void ___constructor__F_R2sSi_autogen___2(struct S *___dst__R2sS_2, signed int __a__i_2){
     
    8181        ((void)((*___dst__R2sS_2).__c__i_2=__c__i_2) /* ?{} */);
    8282    }
    83     signed int __i__i_2 = __extension__ 3;
     83    signed int __i__i_2 = ((signed int )__extension__ 3);
    8484    __extension__ signed int __a__i_2;
    8585    __extension__ signed int __b__i_2;
     
    113113        struct s2 ___ret__3ss2_2;
    114114        ((void)((*___dst__R3ss2_2).__i__i_2=___src__3ss2_2.__i__i_2));
    115         ((void)___constructor__F_R3ss23ss2_autogen___2((&___ret__3ss2_2), (*___dst__R3ss2_2)));
    116         return ___ret__3ss2_2;
     115        ((void)___constructor__F_R3ss23ss2_autogen___2((&___ret__3ss2_2), ___src__3ss2_2));
     116        return ((struct s2 )___ret__3ss2_2);
    117117    }
    118118    inline void ___constructor__F_R3ss2i_autogen___2(struct s2 *___dst__R3ss2_2, signed int __i__i_2){
     
    134134        struct s3 ___ret__3ss3_2;
    135135        ((void)((*___dst__R3ss3_2).__i__i_2=___src__3ss3_2.__i__i_2));
    136         ((void)___constructor__F_R3ss33ss3_autogen___2((&___ret__3ss3_2), (*___dst__R3ss3_2)));
    137         return ___ret__3ss3_2;
     136        ((void)___constructor__F_R3ss33ss3_autogen___2((&___ret__3ss3_2), ___src__3ss3_2));
     137        return ((struct s3 )___ret__3ss3_2);
    138138    }
    139139    inline void ___constructor__F_R3ss3i_autogen___2(struct s3 *___dst__R3ss3_2, signed int __i__i_2){
     
    157157        struct s4 ___ret__3ss4_2;
    158158        ((void)((*___dst__R3ss4_2).__i__i_2=___src__3ss4_2.__i__i_2));
    159         ((void)___constructor__F_R3ss43ss4_autogen___2((&___ret__3ss4_2), (*___dst__R3ss4_2)));
    160         return ___ret__3ss4_2;
     159        ((void)___constructor__F_R3ss43ss4_autogen___2((&___ret__3ss4_2), ___src__3ss4_2));
     160        return ((struct s4 )___ret__3ss4_2);
    161161    }
    162162    inline void ___constructor__F_R3ss4i_autogen___2(struct s4 *___dst__R3ss4_2, signed int __i__i_2){
     
    169169    signed int __m3__A0A0i_2[((unsigned long int )10)][((unsigned long int )10)];
    170170    ((void)(___retval_main__i_1=((signed int )0)) /* ?{} */);
    171     return ___retval_main__i_1;
     171    return ((signed int )___retval_main__i_1);
    172172    ((void)(___retval_main__i_1=0) /* ?{} */);
    173     return ___retval_main__i_1;
     173    return ((signed int )___retval_main__i_1);
    174174}
    175175static inline int invoke_main(int argc, char* argv[], char* envp[]) { (void)argc; (void)argv; (void)envp; return __main__Fi_iPPCc__1(argc, argv); }
     
    186186    ((void)(___retval_main__i_1=(((void)(_tmp_cp_ret0=invoke_main(__argc__i_1, __argv__PPc_1, __envp__PPc_1))) , _tmp_cp_ret0)) /* ?{} */);
    187187    ((void)(_tmp_cp_ret0) /* ^?{} */);
    188     return ___retval_main__i_1;
     188    return ((signed int )___retval_main__i_1);
    189189}
  • src/tests/.expect/64/literals.txt

    r3f7e12cb r78315272  
    55__attribute__ ((__nothrow__,__leaf__,__noreturn__)) extern void exit(signed int __status);
    66extern signed int printf(const char *__restrict __format, ...);
    7 void __for_each__A0_2_0_0____operator_assign__PFd0_Rd0d0____constructor__PF_Rd0____constructor__PF_Rd0d0____destructor__PF_Rd0____operator_assign__PFd1_Rd1d1____constructor__PF_Rd1____constructor__PF_Rd1d1____destructor__PF_Rd1____operator_preincr__PFd0_Rd0____operator_predecr__PFd0_Rd0____operator_equal__PFi_d0d0____operator_notequal__PFi_d0d0____operator_deref__PFRd1_d0__F_d0d0PF_d1___1(__attribute__ ((unused)) void (*_adapterF_9telt_type__P)(void (*__anonymous_object0)(), void *__anonymous_object1), __attribute__ ((unused)) void *(*_adapterFP9telt_type_14titerator_type_M_P)(void (*__anonymous_object2)(), void *__anonymous_object3), __attribute__ ((unused)) signed int (*_adapterFi_14titerator_type14titerator_type_M_PP)(void (*__anonymous_object4)(), void *__anonymous_object5, void *__anonymous_object6), __attribute__ ((unused)) void (*_adapterF14titerator_type_P14titerator_type_P_M)(void (*__anonymous_object7)(), __attribute__ ((unused)) void *___retval__operator_preincr__14titerator_type_1, void *__anonymous_object8), __attribute__ ((unused)) void (*_adapterF_P9telt_type9telt_type__MP)(void (*__anonymous_object9)(), void *__anonymous_object10, void *__anonymous_object11), __attribute__ ((unused)) void (*_adapterF9telt_type_P9telt_type9telt_type_P_MP)(void (*__anonymous_object12)(), __attribute__ ((unused)) void *___retval__operator_assign__9telt_type_1, void *__anonymous_object13, void *__anonymous_object14), __attribute__ ((unused)) void (*_adapterF_P14titerator_type14titerator_type__MP)(void (*__anonymous_object15)(), void *__anonymous_object16, void *__anonymous_object17), __attribute__ ((unused)) void (*_adapterF14titerator_type_P14titerator_type14titerator_type_P_MP)(void (*__anonymous_object18)(), __attribute__ ((unused)) void *___retval__operator_assign__14titerator_type_1, void *__anonymous_object19, void *__anonymous_object20), __attribute__ ((unused)) unsigned long int _sizeof_14titerator_type, __attribute__ ((unused)) unsigned long int _alignof_14titerator_type, __attribute__ ((unused)) unsigned long int _sizeof_9telt_type, __attribute__ ((unused)) unsigned long int _alignof_9telt_type, __attribute__ ((unused)) void *(*___operator_assign__PF14titerator_type_R14titerator_type14titerator_type__1)(void *__anonymous_object21, void *__anonymous_object22), __attribute__ ((unused)) void (*___constructor__PF_R14titerator_type__1)(void *__anonymous_object23), __attribute__ ((unused)) void (*___constructor__PF_R14titerator_type14titerator_type__1)(void *__anonymous_object24, void *__anonymous_object25), __attribute__ ((unused)) void (*___destructor__PF_R14titerator_type__1)(void *__anonymous_object26), __attribute__ ((unused)) void *(*___operator_assign__PF9telt_type_R9telt_type9telt_type__1)(void *__anonymous_object27, void *__anonymous_object28), __attribute__ ((unused)) void (*___constructor__PF_R9telt_type__1)(void *__anonymous_object29), __attribute__ ((unused)) void (*___constructor__PF_R9telt_type9telt_type__1)(void *__anonymous_object30, void *__anonymous_object31), __attribute__ ((unused)) void (*___destructor__PF_R9telt_type__1)(void *__anonymous_object32), __attribute__ ((unused)) void *(*___operator_preincr__PF14titerator_type_R14titerator_type__1)(void *__anonymous_object33), __attribute__ ((unused)) void *(*___operator_predecr__PF14titerator_type_R14titerator_type__1)(void *__anonymous_object34), __attribute__ ((unused)) signed int (*___operator_equal__PFi_14titerator_type14titerator_type__1)(void *__anonymous_object35, void *__anonymous_object36), __attribute__ ((unused)) signed int (*___operator_notequal__PFi_14titerator_type14titerator_type__1)(void *__anonymous_object37, void *__anonymous_object38), __attribute__ ((unused)) void *(*___operator_deref__PFR9telt_type_14titerator_type__1)(void *__anonymous_object39), void *__begin__14titerator_type_1, void *__end__14titerator_type_1, void (*__func__PF_9telt_type__1)(void *__anonymous_object40));
    8 void __for_each_reverse__A0_2_0_0____operator_assign__PFd0_Rd0d0____constructor__PF_Rd0____constructor__PF_Rd0d0____destructor__PF_Rd0____operator_assign__PFd1_Rd1d1____constructor__PF_Rd1____constructor__PF_Rd1d1____destructor__PF_Rd1____operator_preincr__PFd0_Rd0____operator_predecr__PFd0_Rd0____operator_equal__PFi_d0d0____operator_notequal__PFi_d0d0____operator_deref__PFRd1_d0__F_d0d0PF_d1___1(__attribute__ ((unused)) void (*_adapterF_9telt_type__P)(void (*__anonymous_object41)(), void *__anonymous_object42), __attribute__ ((unused)) void *(*_adapterFP9telt_type_14titerator_type_M_P)(void (*__anonymous_object43)(), void *__anonymous_object44), __attribute__ ((unused)) signed int (*_adapterFi_14titerator_type14titerator_type_M_PP)(void (*__anonymous_object45)(), void *__anonymous_object46, void *__anonymous_object47), __attribute__ ((unused)) void (*_adapterF14titerator_type_P14titerator_type_P_M)(void (*__anonymous_object48)(), __attribute__ ((unused)) void *___retval__operator_preincr__14titerator_type_1, void *__anonymous_object49), __attribute__ ((unused)) void (*_adapterF_P9telt_type9telt_type__MP)(void (*__anonymous_object50)(), void *__anonymous_object51, void *__anonymous_object52), __attribute__ ((unused)) void (*_adapterF9telt_type_P9telt_type9telt_type_P_MP)(void (*__anonymous_object53)(), __attribute__ ((unused)) void *___retval__operator_assign__9telt_type_1, void *__anonymous_object54, void *__anonymous_object55), __attribute__ ((unused)) void (*_adapterF_P14titerator_type14titerator_type__MP)(void (*__anonymous_object56)(), void *__anonymous_object57, void *__anonymous_object58), __attribute__ ((unused)) void (*_adapterF14titerator_type_P14titerator_type14titerator_type_P_MP)(void (*__anonymous_object59)(), __attribute__ ((unused)) void *___retval__operator_assign__14titerator_type_1, void *__anonymous_object60, void *__anonymous_object61), __attribute__ ((unused)) unsigned long int _sizeof_14titerator_type, __attribute__ ((unused)) unsigned long int _alignof_14titerator_type, __attribute__ ((unused)) unsigned long int _sizeof_9telt_type, __attribute__ ((unused)) unsigned long int _alignof_9telt_type, __attribute__ ((unused)) void *(*___operator_assign__PF14titerator_type_R14titerator_type14titerator_type__1)(void *__anonymous_object62, void *__anonymous_object63), __attribute__ ((unused)) void (*___constructor__PF_R14titerator_type__1)(void *__anonymous_object64), __attribute__ ((unused)) void (*___constructor__PF_R14titerator_type14titerator_type__1)(void *__anonymous_object65, void *__anonymous_object66), __attribute__ ((unused)) void (*___destructor__PF_R14titerator_type__1)(void *__anonymous_object67), __attribute__ ((unused)) void *(*___operator_assign__PF9telt_type_R9telt_type9telt_type__1)(void *__anonymous_object68, void *__anonymous_object69), __attribute__ ((unused)) void (*___constructor__PF_R9telt_type__1)(void *__anonymous_object70), __attribute__ ((unused)) void (*___constructor__PF_R9telt_type9telt_type__1)(void *__anonymous_object71, void *__anonymous_object72), __attribute__ ((unused)) void (*___destructor__PF_R9telt_type__1)(void *__anonymous_object73), __attribute__ ((unused)) void *(*___operator_preincr__PF14titerator_type_R14titerator_type__1)(void *__anonymous_object74), __attribute__ ((unused)) void *(*___operator_predecr__PF14titerator_type_R14titerator_type__1)(void *__anonymous_object75), __attribute__ ((unused)) signed int (*___operator_equal__PFi_14titerator_type14titerator_type__1)(void *__anonymous_object76, void *__anonymous_object77), __attribute__ ((unused)) signed int (*___operator_notequal__PFi_14titerator_type14titerator_type__1)(void *__anonymous_object78, void *__anonymous_object79), __attribute__ ((unused)) void *(*___operator_deref__PFR9telt_type_14titerator_type__1)(void *__anonymous_object80), void *__begin__14titerator_type_1, void *__end__14titerator_type_1, void (*__func__PF_9telt_type__1)(void *__anonymous_object81));
     7void __for_each__A2_0_0_0____operator_assign__PFt0_Rt0t0____constructor__PF_Rt0____constructor__PF_Rt0t0____destructor__PF_Rt0____operator_assign__PFt1_Rt1t1____constructor__PF_Rt1____constructor__PF_Rt1t1____destructor__PF_Rt1____operator_preincr__PFt0_Rt0____operator_predecr__PFt0_Rt0____operator_equal__PFi_t0t0____operator_notequal__PFi_t0t0____operator_deref__PFRt1_t0__F_t0t0PF_t1___1(__attribute__ ((unused)) void (*_adapterF_9telt_type__P)(void (*__anonymous_object0)(), void *__anonymous_object1), __attribute__ ((unused)) void *(*_adapterFP9telt_type_14titerator_type_M_P)(void (*__anonymous_object2)(), void *__anonymous_object3), __attribute__ ((unused)) signed int (*_adapterFi_14titerator_type14titerator_type_M_PP)(void (*__anonymous_object4)(), void *__anonymous_object5, void *__anonymous_object6), __attribute__ ((unused)) void (*_adapterF14titerator_type_P14titerator_type_P_M)(void (*__anonymous_object7)(), __attribute__ ((unused)) void *___retval__operator_preincr__14titerator_type_1, void *__anonymous_object8), __attribute__ ((unused)) void (*_adapterF_P9telt_type9telt_type__MP)(void (*__anonymous_object9)(), void *__anonymous_object10, void *__anonymous_object11), __attribute__ ((unused)) void (*_adapterF9telt_type_P9telt_type9telt_type_P_MP)(void (*__anonymous_object12)(), __attribute__ ((unused)) void *___retval__operator_assign__9telt_type_1, void *__anonymous_object13, void *__anonymous_object14), __attribute__ ((unused)) void (*_adapterF_P14titerator_type14titerator_type__MP)(void (*__anonymous_object15)(), void *__anonymous_object16, void *__anonymous_object17), __attribute__ ((unused)) void (*_adapterF14titerator_type_P14titerator_type14titerator_type_P_MP)(void (*__anonymous_object18)(), __attribute__ ((unused)) void *___retval__operator_assign__14titerator_type_1, void *__anonymous_object19, void *__anonymous_object20), __attribute__ ((unused)) unsigned long int _sizeof_14titerator_type, __attribute__ ((unused)) unsigned long int _alignof_14titerator_type, __attribute__ ((unused)) unsigned long int _sizeof_9telt_type, __attribute__ ((unused)) unsigned long int _alignof_9telt_type, __attribute__ ((unused)) void *(*___operator_assign__PF14titerator_type_R14titerator_type14titerator_type__1)(void *__anonymous_object21, void *__anonymous_object22), __attribute__ ((unused)) void (*___constructor__PF_R14titerator_type__1)(void *__anonymous_object23), __attribute__ ((unused)) void (*___constructor__PF_R14titerator_type14titerator_type__1)(void *__anonymous_object24, void *__anonymous_object25), __attribute__ ((unused)) void (*___destructor__PF_R14titerator_type__1)(void *__anonymous_object26), __attribute__ ((unused)) void *(*___operator_assign__PF9telt_type_R9telt_type9telt_type__1)(void *__anonymous_object27, void *__anonymous_object28), __attribute__ ((unused)) void (*___constructor__PF_R9telt_type__1)(void *__anonymous_object29), __attribute__ ((unused)) void (*___constructor__PF_R9telt_type9telt_type__1)(void *__anonymous_object30, void *__anonymous_object31), __attribute__ ((unused)) void (*___destructor__PF_R9telt_type__1)(void *__anonymous_object32), __attribute__ ((unused)) void *(*___operator_preincr__PF14titerator_type_R14titerator_type__1)(void *__anonymous_object33), __attribute__ ((unused)) void *(*___operator_predecr__PF14titerator_type_R14titerator_type__1)(void *__anonymous_object34), __attribute__ ((unused)) signed int (*___operator_equal__PFi_14titerator_type14titerator_type__1)(void *__anonymous_object35, void *__anonymous_object36), __attribute__ ((unused)) signed int (*___operator_notequal__PFi_14titerator_type14titerator_type__1)(void *__anonymous_object37, void *__anonymous_object38), __attribute__ ((unused)) void *(*___operator_deref__PFR9telt_type_14titerator_type__1)(void *__anonymous_object39), void *__begin__14titerator_type_1, void *__end__14titerator_type_1, void (*__func__PF_9telt_type__1)(void *__anonymous_object40));
     8void __for_each_reverse__A2_0_0_0____operator_assign__PFt0_Rt0t0____constructor__PF_Rt0____constructor__PF_Rt0t0____destructor__PF_Rt0____operator_assign__PFt1_Rt1t1____constructor__PF_Rt1____constructor__PF_Rt1t1____destructor__PF_Rt1____operator_preincr__PFt0_Rt0____operator_predecr__PFt0_Rt0____operator_equal__PFi_t0t0____operator_notequal__PFi_t0t0____operator_deref__PFRt1_t0__F_t0t0PF_t1___1(__attribute__ ((unused)) void (*_adapterF_9telt_type__P)(void (*__anonymous_object41)(), void *__anonymous_object42), __attribute__ ((unused)) void *(*_adapterFP9telt_type_14titerator_type_M_P)(void (*__anonymous_object43)(), void *__anonymous_object44), __attribute__ ((unused)) signed int (*_adapterFi_14titerator_type14titerator_type_M_PP)(void (*__anonymous_object45)(), void *__anonymous_object46, void *__anonymous_object47), __attribute__ ((unused)) void (*_adapterF14titerator_type_P14titerator_type_P_M)(void (*__anonymous_object48)(), __attribute__ ((unused)) void *___retval__operator_preincr__14titerator_type_1, void *__anonymous_object49), __attribute__ ((unused)) void (*_adapterF_P9telt_type9telt_type__MP)(void (*__anonymous_object50)(), void *__anonymous_object51, void *__anonymous_object52), __attribute__ ((unused)) void (*_adapterF9telt_type_P9telt_type9telt_type_P_MP)(void (*__anonymous_object53)(), __attribute__ ((unused)) void *___retval__operator_assign__9telt_type_1, void *__anonymous_object54, void *__anonymous_object55), __attribute__ ((unused)) void (*_adapterF_P14titerator_type14titerator_type__MP)(void (*__anonymous_object56)(), void *__anonymous_object57, void *__anonymous_object58), __attribute__ ((unused)) void (*_adapterF14titerator_type_P14titerator_type14titerator_type_P_MP)(void (*__anonymous_object59)(), __attribute__ ((unused)) void *___retval__operator_assign__14titerator_type_1, void *__anonymous_object60, void *__anonymous_object61), __attribute__ ((unused)) unsigned long int _sizeof_14titerator_type, __attribute__ ((unused)) unsigned long int _alignof_14titerator_type, __attribute__ ((unused)) unsigned long int _sizeof_9telt_type, __attribute__ ((unused)) unsigned long int _alignof_9telt_type, __attribute__ ((unused)) void *(*___operator_assign__PF14titerator_type_R14titerator_type14titerator_type__1)(void *__anonymous_object62, void *__anonymous_object63), __attribute__ ((unused)) void (*___constructor__PF_R14titerator_type__1)(void *__anonymous_object64), __attribute__ ((unused)) void (*___constructor__PF_R14titerator_type14titerator_type__1)(void *__anonymous_object65, void *__anonymous_object66), __attribute__ ((unused)) void (*___destructor__PF_R14titerator_type__1)(void *__anonymous_object67), __attribute__ ((unused)) void *(*___operator_assign__PF9telt_type_R9telt_type9telt_type__1)(void *__anonymous_object68, void *__anonymous_object69), __attribute__ ((unused)) void (*___constructor__PF_R9telt_type__1)(void *__anonymous_object70), __attribute__ ((unused)) void (*___constructor__PF_R9telt_type9telt_type__1)(void *__anonymous_object71, void *__anonymous_object72), __attribute__ ((unused)) void (*___destructor__PF_R9telt_type__1)(void *__anonymous_object73), __attribute__ ((unused)) void *(*___operator_preincr__PF14titerator_type_R14titerator_type__1)(void *__anonymous_object74), __attribute__ ((unused)) void *(*___operator_predecr__PF14titerator_type_R14titerator_type__1)(void *__anonymous_object75), __attribute__ ((unused)) signed int (*___operator_equal__PFi_14titerator_type14titerator_type__1)(void *__anonymous_object76, void *__anonymous_object77), __attribute__ ((unused)) signed int (*___operator_notequal__PFi_14titerator_type14titerator_type__1)(void *__anonymous_object78, void *__anonymous_object79), __attribute__ ((unused)) void *(*___operator_deref__PFR9telt_type_14titerator_type__1)(void *__anonymous_object80), void *__begin__14titerator_type_1, void *__end__14titerator_type_1, void (*__func__PF_9telt_type__1)(void *__anonymous_object81));
    99void *___operator_bitor__A0_1_0_0___sepPrt__PFb_Pd0___sepReset__PF_Pd0___sepReset__PF_Pd0b___sepGetCur__PFPCc_Pd0___sepSetCur__PF_Pd0PCc___getNL__PFb_Pd0___setNL__PF_Pd0b___sepOn__PF_Pd0___sepOff__PF_Pd0___sepDisable__PFb_Pd0___sepEnable__PFb_Pd0___sepGet__PFPCc_Pd0___sepSet__PF_Pd0PCc___sepGetTuple__PFPCc_Pd0___sepSetTuple__PF_Pd0PCc___fail__PFi_Pd0___flush__PFi_Pd0___open__PF_Pd0PCcPCc___close__PF_Pd0___write__PFPd0_Pd0PCcUl___fmt__PFi_Pd0PCc__FPd0_Pd0c__1(__attribute__ ((unused)) _Bool (*__sepPrt__PFb_P7tostype__1)(void *__anonymous_object82), __attribute__ ((unused)) void (*__sepReset__PF_P7tostype__1)(void *__anonymous_object83), __attribute__ ((unused)) void (*__sepReset__PF_P7tostypeb__1)(void *__anonymous_object84, _Bool __anonymous_object85), __attribute__ ((unused)) const char *(*__sepGetCur__PFPCc_P7tostype__1)(void *__anonymous_object86), __attribute__ ((unused)) void (*__sepSetCur__PF_P7tostypePCc__1)(void *__anonymous_object87, const char *__anonymous_object88), __attribute__ ((unused)) _Bool (*__getNL__PFb_P7tostype__1)(void *__anonymous_object89), __attribute__ ((unused)) void (*__setNL__PF_P7tostypeb__1)(void *__anonymous_object90, _Bool __anonymous_object91), __attribute__ ((unused)) void (*__sepOn__PF_P7tostype__1)(void *__anonymous_object92), __attribute__ ((unused)) void (*__sepOff__PF_P7tostype__1)(void *__anonymous_object93), __attribute__ ((unused)) _Bool (*__sepDisable__PFb_P7tostype__1)(void *__anonymous_object94), __attribute__ ((unused)) _Bool (*__sepEnable__PFb_P7tostype__1)(void *__anonymous_object95), __attribute__ ((unused)) const char *(*__sepGet__PFPCc_P7tostype__1)(void *__anonymous_object96), __attribute__ ((unused)) void (*__sepSet__PF_P7tostypePCc__1)(void *__anonymous_object97, const char *__anonymous_object98), __attribute__ ((unused)) const char *(*__sepGetTuple__PFPCc_P7tostype__1)(void *__anonymous_object99), __attribute__ ((unused)) void (*__sepSetTuple__PF_P7tostypePCc__1)(void *__anonymous_object100, const char *__anonymous_object101), __attribute__ ((unused)) signed int (*__fail__PFi_P7tostype__1)(void *__anonymous_object102), __attribute__ ((unused)) signed int (*__flush__PFi_P7tostype__1)(void *__anonymous_object103), __attribute__ ((unused)) void (*__open__PF_P7tostypePCcPCc__1)(void *__os__P7tostype_1, const char *__name__PCc_1, const char *__mode__PCc_1), __attribute__ ((unused)) void (*__close__PF_P7tostype__1)(void *__os__P7tostype_1), __attribute__ ((unused)) void *(*__write__PFP7tostype_P7tostypePCcUl__1)(void *__anonymous_object104, const char *__anonymous_object105, unsigned long int __anonymous_object106), __attribute__ ((unused)) signed int (*__fmt__PFi_P7tostypePCc__1)(void *__anonymous_object107, const char *__fmt__PCc_1, ...), void *__anonymous_object108, char __anonymous_object109);
    1010void *___operator_bitor__A0_1_0_0___sepPrt__PFb_Pd0___sepReset__PF_Pd0___sepReset__PF_Pd0b___sepGetCur__PFPCc_Pd0___sepSetCur__PF_Pd0PCc___getNL__PFb_Pd0___setNL__PF_Pd0b___sepOn__PF_Pd0___sepOff__PF_Pd0___sepDisable__PFb_Pd0___sepEnable__PFb_Pd0___sepGet__PFPCc_Pd0___sepSet__PF_Pd0PCc___sepGetTuple__PFPCc_Pd0___sepSetTuple__PF_Pd0PCc___fail__PFi_Pd0___flush__PFi_Pd0___open__PF_Pd0PCcPCc___close__PF_Pd0___write__PFPd0_Pd0PCcUl___fmt__PFi_Pd0PCc__FPd0_Pd0Sc__1(__attribute__ ((unused)) _Bool (*__sepPrt__PFb_P7tostype__1)(void *__anonymous_object110), __attribute__ ((unused)) void (*__sepReset__PF_P7tostype__1)(void *__anonymous_object111), __attribute__ ((unused)) void (*__sepReset__PF_P7tostypeb__1)(void *__anonymous_object112, _Bool __anonymous_object113), __attribute__ ((unused)) const char *(*__sepGetCur__PFPCc_P7tostype__1)(void *__anonymous_object114), __attribute__ ((unused)) void (*__sepSetCur__PF_P7tostypePCc__1)(void *__anonymous_object115, const char *__anonymous_object116), __attribute__ ((unused)) _Bool (*__getNL__PFb_P7tostype__1)(void *__anonymous_object117), __attribute__ ((unused)) void (*__setNL__PF_P7tostypeb__1)(void *__anonymous_object118, _Bool __anonymous_object119), __attribute__ ((unused)) void (*__sepOn__PF_P7tostype__1)(void *__anonymous_object120), __attribute__ ((unused)) void (*__sepOff__PF_P7tostype__1)(void *__anonymous_object121), __attribute__ ((unused)) _Bool (*__sepDisable__PFb_P7tostype__1)(void *__anonymous_object122), __attribute__ ((unused)) _Bool (*__sepEnable__PFb_P7tostype__1)(void *__anonymous_object123), __attribute__ ((unused)) const char *(*__sepGet__PFPCc_P7tostype__1)(void *__anonymous_object124), __attribute__ ((unused)) void (*__sepSet__PF_P7tostypePCc__1)(void *__anonymous_object125, const char *__anonymous_object126), __attribute__ ((unused)) const char *(*__sepGetTuple__PFPCc_P7tostype__1)(void *__anonymous_object127), __attribute__ ((unused)) void (*__sepSetTuple__PF_P7tostypePCc__1)(void *__anonymous_object128, const char *__anonymous_object129), __attribute__ ((unused)) signed int (*__fail__PFi_P7tostype__1)(void *__anonymous_object130), __attribute__ ((unused)) signed int (*__flush__PFi_P7tostype__1)(void *__anonymous_object131), __attribute__ ((unused)) void (*__open__PF_P7tostypePCcPCc__1)(void *__os__P7tostype_1, const char *__name__PCc_1, const char *__mode__PCc_1), __attribute__ ((unused)) void (*__close__PF_P7tostype__1)(void *__os__P7tostype_1), __attribute__ ((unused)) void *(*__write__PFP7tostype_P7tostypePCcUl__1)(void *__anonymous_object132, const char *__anonymous_object133, unsigned long int __anonymous_object134), __attribute__ ((unused)) signed int (*__fmt__PFi_P7tostypePCc__1)(void *__anonymous_object135, const char *__fmt__PCc_1, ...), void *__anonymous_object136, signed char __anonymous_object137);
     
    2929void *___operator_bitor__A0_1_0_0___sepPrt__PFb_Pd0___sepReset__PF_Pd0___sepReset__PF_Pd0b___sepGetCur__PFPCc_Pd0___sepSetCur__PF_Pd0PCc___getNL__PFb_Pd0___setNL__PF_Pd0b___sepOn__PF_Pd0___sepOff__PF_Pd0___sepDisable__PFb_Pd0___sepEnable__PFb_Pd0___sepGet__PFPCc_Pd0___sepSet__PF_Pd0PCc___sepGetTuple__PFPCc_Pd0___sepSetTuple__PF_Pd0PCc___fail__PFi_Pd0___flush__PFi_Pd0___open__PF_Pd0PCcPCc___close__PF_Pd0___write__PFPd0_Pd0PCcUl___fmt__PFi_Pd0PCc__FPd0_Pd0PCi__1(__attribute__ ((unused)) _Bool (*__sepPrt__PFb_P7tostype__1)(void *__anonymous_object642), __attribute__ ((unused)) void (*__sepReset__PF_P7tostype__1)(void *__anonymous_object643), __attribute__ ((unused)) void (*__sepReset__PF_P7tostypeb__1)(void *__anonymous_object644, _Bool __anonymous_object645), __attribute__ ((unused)) const char *(*__sepGetCur__PFPCc_P7tostype__1)(void *__anonymous_object646), __attribute__ ((unused)) void (*__sepSetCur__PF_P7tostypePCc__1)(void *__anonymous_object647, const char *__anonymous_object648), __attribute__ ((unused)) _Bool (*__getNL__PFb_P7tostype__1)(void *__anonymous_object649), __attribute__ ((unused)) void (*__setNL__PF_P7tostypeb__1)(void *__anonymous_object650, _Bool __anonymous_object651), __attribute__ ((unused)) void (*__sepOn__PF_P7tostype__1)(void *__anonymous_object652), __attribute__ ((unused)) void (*__sepOff__PF_P7tostype__1)(void *__anonymous_object653), __attribute__ ((unused)) _Bool (*__sepDisable__PFb_P7tostype__1)(void *__anonymous_object654), __attribute__ ((unused)) _Bool (*__sepEnable__PFb_P7tostype__1)(void *__anonymous_object655), __attribute__ ((unused)) const char *(*__sepGet__PFPCc_P7tostype__1)(void *__anonymous_object656), __attribute__ ((unused)) void (*__sepSet__PF_P7tostypePCc__1)(void *__anonymous_object657, const char *__anonymous_object658), __attribute__ ((unused)) const char *(*__sepGetTuple__PFPCc_P7tostype__1)(void *__anonymous_object659), __attribute__ ((unused)) void (*__sepSetTuple__PF_P7tostypePCc__1)(void *__anonymous_object660, const char *__anonymous_object661), __attribute__ ((unused)) signed int (*__fail__PFi_P7tostype__1)(void *__anonymous_object662), __attribute__ ((unused)) signed int (*__flush__PFi_P7tostype__1)(void *__anonymous_object663), __attribute__ ((unused)) void (*__open__PF_P7tostypePCcPCc__1)(void *__os__P7tostype_1, const char *__name__PCc_1, const char *__mode__PCc_1), __attribute__ ((unused)) void (*__close__PF_P7tostype__1)(void *__os__P7tostype_1), __attribute__ ((unused)) void *(*__write__PFP7tostype_P7tostypePCcUl__1)(void *__anonymous_object664, const char *__anonymous_object665, unsigned long int __anonymous_object666), __attribute__ ((unused)) signed int (*__fmt__PFi_P7tostypePCc__1)(void *__anonymous_object667, const char *__fmt__PCc_1, ...), void *__anonymous_object668, const signed int *__anonymous_object669);
    3030void *___operator_bitor__A0_1_0_0___sepPrt__PFb_Pd0___sepReset__PF_Pd0___sepReset__PF_Pd0b___sepGetCur__PFPCc_Pd0___sepSetCur__PF_Pd0PCc___getNL__PFb_Pd0___setNL__PF_Pd0b___sepOn__PF_Pd0___sepOff__PF_Pd0___sepDisable__PFb_Pd0___sepEnable__PFb_Pd0___sepGet__PFPCc_Pd0___sepSet__PF_Pd0PCc___sepGetTuple__PFPCc_Pd0___sepSetTuple__PF_Pd0PCc___fail__PFi_Pd0___flush__PFi_Pd0___open__PF_Pd0PCcPCc___close__PF_Pd0___write__PFPd0_Pd0PCcUl___fmt__PFi_Pd0PCc__FPd0_Pd0PCv__1(__attribute__ ((unused)) _Bool (*__sepPrt__PFb_P7tostype__1)(void *__anonymous_object670), __attribute__ ((unused)) void (*__sepReset__PF_P7tostype__1)(void *__anonymous_object671), __attribute__ ((unused)) void (*__sepReset__PF_P7tostypeb__1)(void *__anonymous_object672, _Bool __anonymous_object673), __attribute__ ((unused)) const char *(*__sepGetCur__PFPCc_P7tostype__1)(void *__anonymous_object674), __attribute__ ((unused)) void (*__sepSetCur__PF_P7tostypePCc__1)(void *__anonymous_object675, const char *__anonymous_object676), __attribute__ ((unused)) _Bool (*__getNL__PFb_P7tostype__1)(void *__anonymous_object677), __attribute__ ((unused)) void (*__setNL__PF_P7tostypeb__1)(void *__anonymous_object678, _Bool __anonymous_object679), __attribute__ ((unused)) void (*__sepOn__PF_P7tostype__1)(void *__anonymous_object680), __attribute__ ((unused)) void (*__sepOff__PF_P7tostype__1)(void *__anonymous_object681), __attribute__ ((unused)) _Bool (*__sepDisable__PFb_P7tostype__1)(void *__anonymous_object682), __attribute__ ((unused)) _Bool (*__sepEnable__PFb_P7tostype__1)(void *__anonymous_object683), __attribute__ ((unused)) const char *(*__sepGet__PFPCc_P7tostype__1)(void *__anonymous_object684), __attribute__ ((unused)) void (*__sepSet__PF_P7tostypePCc__1)(void *__anonymous_object685, const char *__anonymous_object686), __attribute__ ((unused)) const char *(*__sepGetTuple__PFPCc_P7tostype__1)(void *__anonymous_object687), __attribute__ ((unused)) void (*__sepSetTuple__PF_P7tostypePCc__1)(void *__anonymous_object688, const char *__anonymous_object689), __attribute__ ((unused)) signed int (*__fail__PFi_P7tostype__1)(void *__anonymous_object690), __attribute__ ((unused)) signed int (*__flush__PFi_P7tostype__1)(void *__anonymous_object691), __attribute__ ((unused)) void (*__open__PF_P7tostypePCcPCc__1)(void *__os__P7tostype_1, const char *__name__PCc_1, const char *__mode__PCc_1), __attribute__ ((unused)) void (*__close__PF_P7tostype__1)(void *__os__P7tostype_1), __attribute__ ((unused)) void *(*__write__PFP7tostype_P7tostypePCcUl__1)(void *__anonymous_object692, const char *__anonymous_object693, unsigned long int __anonymous_object694), __attribute__ ((unused)) signed int (*__fmt__PFi_P7tostypePCc__1)(void *__anonymous_object695, const char *__fmt__PCc_1, ...), void *__anonymous_object696, const void *__anonymous_object697);
    31 void *___operator_bitor__A0_2_0_1____operator_assign__PFd1_Rd1d1____constructor__PF_Rd1____constructor__PF_Rd1d1____destructor__PF_Rd1____operator_bitor__PFPd0_Pd0d1___sepPrt__PFb_Pd0___sepReset__PF_Pd0___sepReset__PF_Pd0b___sepGetCur__PFPCc_Pd0___sepSetCur__PF_Pd0PCc___getNL__PFb_Pd0___setNL__PF_Pd0b___sepOn__PF_Pd0___sepOff__PF_Pd0___sepDisable__PFb_Pd0___sepEnable__PFb_Pd0___sepGet__PFPCc_Pd0___sepSet__PF_Pd0PCc___sepGetTuple__PFPCc_Pd0___sepSetTuple__PF_Pd0PCc___fail__PFi_Pd0___flush__PFi_Pd0___open__PF_Pd0PCcPCc___close__PF_Pd0___write__PFPd0_Pd0PCcUl___fmt__PFi_Pd0PCc____operator_bitor__PFPd0_Pd0tVARGS2__FPd0_Pd0d1tVARGS2__1(__attribute__ ((unused)) void *(*_adapterFP7tostype_P7tostype7tParams_M_MP)(void (*__anonymous_object698)(), void *__anonymous_object699, void *__anonymous_object700), __attribute__ ((unused)) void *(*_adapterFP7tostype_P7tostype2tT_M_MP)(void (*__anonymous_object701)(), void *__anonymous_object702, void *__anonymous_object703), __attribute__ ((unused)) void (*_adapterF_P2tT2tT__MP)(void (*__anonymous_object704)(), void *__anonymous_object705, void *__anonymous_object706), __attribute__ ((unused)) void (*_adapterF2tT_P2tT2tT_P_MP)(void (*__anonymous_object707)(), __attribute__ ((unused)) void *___retval__operator_assign__2tT_1, void *__anonymous_object708, void *__anonymous_object709), __attribute__ ((unused)) unsigned long int _sizeof_2tT, __attribute__ ((unused)) unsigned long int _alignof_2tT, __attribute__ ((unused)) unsigned long int _sizeof_7tParams, __attribute__ ((unused)) unsigned long int _alignof_7tParams, __attribute__ ((unused)) void *(*___operator_assign__PF2tT_R2tT2tT__1)(void *__anonymous_object710, void *__anonymous_object711), __attribute__ ((unused)) void (*___constructor__PF_R2tT__1)(void *__anonymous_object712), __attribute__ ((unused)) void (*___constructor__PF_R2tT2tT__1)(void *__anonymous_object713, void *__anonymous_object714), __attribute__ ((unused)) void (*___destructor__PF_R2tT__1)(void *__anonymous_object715), __attribute__ ((unused)) void *(*___operator_bitor__PFP7tostype_P7tostype2tT__1)(void *__anonymous_object716, void *__anonymous_object717), __attribute__ ((unused)) _Bool (*__sepPrt__PFb_P7tostype__1)(void *__anonymous_object718), __attribute__ ((unused)) void (*__sepReset__PF_P7tostype__1)(void *__anonymous_object719), __attribute__ ((unused)) void (*__sepReset__PF_P7tostypeb__1)(void *__anonymous_object720, _Bool __anonymous_object721), __attribute__ ((unused)) const char *(*__sepGetCur__PFPCc_P7tostype__1)(void *__anonymous_object722), __attribute__ ((unused)) void (*__sepSetCur__PF_P7tostypePCc__1)(void *__anonymous_object723, const char *__anonymous_object724), __attribute__ ((unused)) _Bool (*__getNL__PFb_P7tostype__1)(void *__anonymous_object725), __attribute__ ((unused)) void (*__setNL__PF_P7tostypeb__1)(void *__anonymous_object726, _Bool __anonymous_object727), __attribute__ ((unused)) void (*__sepOn__PF_P7tostype__1)(void *__anonymous_object728), __attribute__ ((unused)) void (*__sepOff__PF_P7tostype__1)(void *__anonymous_object729), __attribute__ ((unused)) _Bool (*__sepDisable__PFb_P7tostype__1)(void *__anonymous_object730), __attribute__ ((unused)) _Bool (*__sepEnable__PFb_P7tostype__1)(void *__anonymous_object731), __attribute__ ((unused)) const char *(*__sepGet__PFPCc_P7tostype__1)(void *__anonymous_object732), __attribute__ ((unused)) void (*__sepSet__PF_P7tostypePCc__1)(void *__anonymous_object733, const char *__anonymous_object734), __attribute__ ((unused)) const char *(*__sepGetTuple__PFPCc_P7tostype__1)(void *__anonymous_object735), __attribute__ ((unused)) void (*__sepSetTuple__PF_P7tostypePCc__1)(void *__anonymous_object736, const char *__anonymous_object737), __attribute__ ((unused)) signed int (*__fail__PFi_P7tostype__1)(void *__anonymous_object738), __attribute__ ((unused)) signed int (*__flush__PFi_P7tostype__1)(void *__anonymous_object739), __attribute__ ((unused)) void (*__open__PF_P7tostypePCcPCc__1)(void *__os__P7tostype_1, const char *__name__PCc_1, const char *__mode__PCc_1), __attribute__ ((unused)) void (*__close__PF_P7tostype__1)(void *__os__P7tostype_1), __attribute__ ((unused)) void *(*__write__PFP7tostype_P7tostypePCcUl__1)(void *__anonymous_object740, const char *__anonymous_object741, unsigned long int __anonymous_object742), __attribute__ ((unused)) signed int (*__fmt__PFi_P7tostypePCc__1)(void *__anonymous_object743, const char *__fmt__PCc_1, ...), __attribute__ ((unused)) void *(*___operator_bitor__PFP7tostype_P7tostype7tParams__1)(void *__anonymous_object744, void *__anonymous_object745), void *__os__P7tostype_1, void *__arg__2tT_1, void *__rest__7tParams_1);
     31void *___operator_bitor__A1_1_0_1____operator_assign__PFt1_Rt1t1____constructor__PF_Rt1____constructor__PF_Rt1t1____destructor__PF_Rt1____operator_bitor__PFPd0_Pd0t1___sepPrt__PFb_Pd0___sepReset__PF_Pd0___sepReset__PF_Pd0b___sepGetCur__PFPCc_Pd0___sepSetCur__PF_Pd0PCc___getNL__PFb_Pd0___setNL__PF_Pd0b___sepOn__PF_Pd0___sepOff__PF_Pd0___sepDisable__PFb_Pd0___sepEnable__PFb_Pd0___sepGet__PFPCc_Pd0___sepSet__PF_Pd0PCc___sepGetTuple__PFPCc_Pd0___sepSetTuple__PF_Pd0PCc___fail__PFi_Pd0___flush__PFi_Pd0___open__PF_Pd0PCcPCc___close__PF_Pd0___write__PFPd0_Pd0PCcUl___fmt__PFi_Pd0PCc____operator_bitor__PFPd0_Pd0tVARGS2__FPd0_Pd0t1tVARGS2__1(__attribute__ ((unused)) void *(*_adapterFP7tostype_P7tostype7tParams_M_MP)(void (*__anonymous_object698)(), void *__anonymous_object699, void *__anonymous_object700), __attribute__ ((unused)) void *(*_adapterFP7tostype_P7tostype2tT_M_MP)(void (*__anonymous_object701)(), void *__anonymous_object702, void *__anonymous_object703), __attribute__ ((unused)) void (*_adapterF_P2tT2tT__MP)(void (*__anonymous_object704)(), void *__anonymous_object705, void *__anonymous_object706), __attribute__ ((unused)) void (*_adapterF2tT_P2tT2tT_P_MP)(void (*__anonymous_object707)(), __attribute__ ((unused)) void *___retval__operator_assign__2tT_1, void *__anonymous_object708, void *__anonymous_object709), __attribute__ ((unused)) unsigned long int _sizeof_2tT, __attribute__ ((unused)) unsigned long int _alignof_2tT, __attribute__ ((unused)) unsigned long int _sizeof_7tParams, __attribute__ ((unused)) unsigned long int _alignof_7tParams, __attribute__ ((unused)) void *(*___operator_assign__PF2tT_R2tT2tT__1)(void *__anonymous_object710, void *__anonymous_object711), __attribute__ ((unused)) void (*___constructor__PF_R2tT__1)(void *__anonymous_object712), __attribute__ ((unused)) void (*___constructor__PF_R2tT2tT__1)(void *__anonymous_object713, void *__anonymous_object714), __attribute__ ((unused)) void (*___destructor__PF_R2tT__1)(void *__anonymous_object715), __attribute__ ((unused)) void *(*___operator_bitor__PFP7tostype_P7tostype2tT__1)(void *__anonymous_object716, void *__anonymous_object717), __attribute__ ((unused)) _Bool (*__sepPrt__PFb_P7tostype__1)(void *__anonymous_object718), __attribute__ ((unused)) void (*__sepReset__PF_P7tostype__1)(void *__anonymous_object719), __attribute__ ((unused)) void (*__sepReset__PF_P7tostypeb__1)(void *__anonymous_object720, _Bool __anonymous_object721), __attribute__ ((unused)) const char *(*__sepGetCur__PFPCc_P7tostype__1)(void *__anonymous_object722), __attribute__ ((unused)) void (*__sepSetCur__PF_P7tostypePCc__1)(void *__anonymous_object723, const char *__anonymous_object724), __attribute__ ((unused)) _Bool (*__getNL__PFb_P7tostype__1)(void *__anonymous_object725), __attribute__ ((unused)) void (*__setNL__PF_P7tostypeb__1)(void *__anonymous_object726, _Bool __anonymous_object727), __attribute__ ((unused)) void (*__sepOn__PF_P7tostype__1)(void *__anonymous_object728), __attribute__ ((unused)) void (*__sepOff__PF_P7tostype__1)(void *__anonymous_object729), __attribute__ ((unused)) _Bool (*__sepDisable__PFb_P7tostype__1)(void *__anonymous_object730), __attribute__ ((unused)) _Bool (*__sepEnable__PFb_P7tostype__1)(void *__anonymous_object731), __attribute__ ((unused)) const char *(*__sepGet__PFPCc_P7tostype__1)(void *__anonymous_object732), __attribute__ ((unused)) void (*__sepSet__PF_P7tostypePCc__1)(void *__anonymous_object733, const char *__anonymous_object734), __attribute__ ((unused)) const char *(*__sepGetTuple__PFPCc_P7tostype__1)(void *__anonymous_object735), __attribute__ ((unused)) void (*__sepSetTuple__PF_P7tostypePCc__1)(void *__anonymous_object736, const char *__anonymous_object737), __attribute__ ((unused)) signed int (*__fail__PFi_P7tostype__1)(void *__anonymous_object738), __attribute__ ((unused)) signed int (*__flush__PFi_P7tostype__1)(void *__anonymous_object739), __attribute__ ((unused)) void (*__open__PF_P7tostypePCcPCc__1)(void *__os__P7tostype_1, const char *__name__PCc_1, const char *__mode__PCc_1), __attribute__ ((unused)) void (*__close__PF_P7tostype__1)(void *__os__P7tostype_1), __attribute__ ((unused)) void *(*__write__PFP7tostype_P7tostypePCcUl__1)(void *__anonymous_object740, const char *__anonymous_object741, unsigned long int __anonymous_object742), __attribute__ ((unused)) signed int (*__fmt__PFi_P7tostypePCc__1)(void *__anonymous_object743, const char *__fmt__PCc_1, ...), __attribute__ ((unused)) void *(*___operator_bitor__PFP7tostype_P7tostype7tParams__1)(void *__anonymous_object744, void *__anonymous_object745), void *__os__P7tostype_1, void *__arg__2tT_1, void *__rest__7tParams_1);
    3232void *___operator_bitor__A0_1_0_0___sepPrt__PFb_Pd0___sepReset__PF_Pd0___sepReset__PF_Pd0b___sepGetCur__PFPCc_Pd0___sepSetCur__PF_Pd0PCc___getNL__PFb_Pd0___setNL__PF_Pd0b___sepOn__PF_Pd0___sepOff__PF_Pd0___sepDisable__PFb_Pd0___sepEnable__PFb_Pd0___sepGet__PFPCc_Pd0___sepSet__PF_Pd0PCc___sepGetTuple__PFPCc_Pd0___sepSetTuple__PF_Pd0PCc___fail__PFi_Pd0___flush__PFi_Pd0___open__PF_Pd0PCcPCc___close__PF_Pd0___write__PFPd0_Pd0PCcUl___fmt__PFi_Pd0PCc__FPd0_Pd0PFPd0_Pd0___1(__attribute__ ((unused)) _Bool (*__sepPrt__PFb_P7tostype__1)(void *__anonymous_object746), __attribute__ ((unused)) void (*__sepReset__PF_P7tostype__1)(void *__anonymous_object747), __attribute__ ((unused)) void (*__sepReset__PF_P7tostypeb__1)(void *__anonymous_object748, _Bool __anonymous_object749), __attribute__ ((unused)) const char *(*__sepGetCur__PFPCc_P7tostype__1)(void *__anonymous_object750), __attribute__ ((unused)) void (*__sepSetCur__PF_P7tostypePCc__1)(void *__anonymous_object751, const char *__anonymous_object752), __attribute__ ((unused)) _Bool (*__getNL__PFb_P7tostype__1)(void *__anonymous_object753), __attribute__ ((unused)) void (*__setNL__PF_P7tostypeb__1)(void *__anonymous_object754, _Bool __anonymous_object755), __attribute__ ((unused)) void (*__sepOn__PF_P7tostype__1)(void *__anonymous_object756), __attribute__ ((unused)) void (*__sepOff__PF_P7tostype__1)(void *__anonymous_object757), __attribute__ ((unused)) _Bool (*__sepDisable__PFb_P7tostype__1)(void *__anonymous_object758), __attribute__ ((unused)) _Bool (*__sepEnable__PFb_P7tostype__1)(void *__anonymous_object759), __attribute__ ((unused)) const char *(*__sepGet__PFPCc_P7tostype__1)(void *__anonymous_object760), __attribute__ ((unused)) void (*__sepSet__PF_P7tostypePCc__1)(void *__anonymous_object761, const char *__anonymous_object762), __attribute__ ((unused)) const char *(*__sepGetTuple__PFPCc_P7tostype__1)(void *__anonymous_object763), __attribute__ ((unused)) void (*__sepSetTuple__PF_P7tostypePCc__1)(void *__anonymous_object764, const char *__anonymous_object765), __attribute__ ((unused)) signed int (*__fail__PFi_P7tostype__1)(void *__anonymous_object766), __attribute__ ((unused)) signed int (*__flush__PFi_P7tostype__1)(void *__anonymous_object767), __attribute__ ((unused)) void (*__open__PF_P7tostypePCcPCc__1)(void *__os__P7tostype_1, const char *__name__PCc_1, const char *__mode__PCc_1), __attribute__ ((unused)) void (*__close__PF_P7tostype__1)(void *__os__P7tostype_1), __attribute__ ((unused)) void *(*__write__PFP7tostype_P7tostypePCcUl__1)(void *__anonymous_object768, const char *__anonymous_object769, unsigned long int __anonymous_object770), __attribute__ ((unused)) signed int (*__fmt__PFi_P7tostypePCc__1)(void *__anonymous_object771, const char *__fmt__PCc_1, ...), void *__anonymous_object772, void *(*__anonymous_object773)(void *__anonymous_object774));
    3333void *__endl__A0_1_0_0___sepPrt__PFb_Pd0___sepReset__PF_Pd0___sepReset__PF_Pd0b___sepGetCur__PFPCc_Pd0___sepSetCur__PF_Pd0PCc___getNL__PFb_Pd0___setNL__PF_Pd0b___sepOn__PF_Pd0___sepOff__PF_Pd0___sepDisable__PFb_Pd0___sepEnable__PFb_Pd0___sepGet__PFPCc_Pd0___sepSet__PF_Pd0PCc___sepGetTuple__PFPCc_Pd0___sepSetTuple__PF_Pd0PCc___fail__PFi_Pd0___flush__PFi_Pd0___open__PF_Pd0PCcPCc___close__PF_Pd0___write__PFPd0_Pd0PCcUl___fmt__PFi_Pd0PCc__FPd0_Pd0__1(__attribute__ ((unused)) _Bool (*__sepPrt__PFb_P7tostype__1)(void *__anonymous_object775), __attribute__ ((unused)) void (*__sepReset__PF_P7tostype__1)(void *__anonymous_object776), __attribute__ ((unused)) void (*__sepReset__PF_P7tostypeb__1)(void *__anonymous_object777, _Bool __anonymous_object778), __attribute__ ((unused)) const char *(*__sepGetCur__PFPCc_P7tostype__1)(void *__anonymous_object779), __attribute__ ((unused)) void (*__sepSetCur__PF_P7tostypePCc__1)(void *__anonymous_object780, const char *__anonymous_object781), __attribute__ ((unused)) _Bool (*__getNL__PFb_P7tostype__1)(void *__anonymous_object782), __attribute__ ((unused)) void (*__setNL__PF_P7tostypeb__1)(void *__anonymous_object783, _Bool __anonymous_object784), __attribute__ ((unused)) void (*__sepOn__PF_P7tostype__1)(void *__anonymous_object785), __attribute__ ((unused)) void (*__sepOff__PF_P7tostype__1)(void *__anonymous_object786), __attribute__ ((unused)) _Bool (*__sepDisable__PFb_P7tostype__1)(void *__anonymous_object787), __attribute__ ((unused)) _Bool (*__sepEnable__PFb_P7tostype__1)(void *__anonymous_object788), __attribute__ ((unused)) const char *(*__sepGet__PFPCc_P7tostype__1)(void *__anonymous_object789), __attribute__ ((unused)) void (*__sepSet__PF_P7tostypePCc__1)(void *__anonymous_object790, const char *__anonymous_object791), __attribute__ ((unused)) const char *(*__sepGetTuple__PFPCc_P7tostype__1)(void *__anonymous_object792), __attribute__ ((unused)) void (*__sepSetTuple__PF_P7tostypePCc__1)(void *__anonymous_object793, const char *__anonymous_object794), __attribute__ ((unused)) signed int (*__fail__PFi_P7tostype__1)(void *__anonymous_object795), __attribute__ ((unused)) signed int (*__flush__PFi_P7tostype__1)(void *__anonymous_object796), __attribute__ ((unused)) void (*__open__PF_P7tostypePCcPCc__1)(void *__os__P7tostype_1, const char *__name__PCc_1, const char *__mode__PCc_1), __attribute__ ((unused)) void (*__close__PF_P7tostype__1)(void *__os__P7tostype_1), __attribute__ ((unused)) void *(*__write__PFP7tostype_P7tostypePCcUl__1)(void *__anonymous_object797, const char *__anonymous_object798, unsigned long int __anonymous_object799), __attribute__ ((unused)) signed int (*__fmt__PFi_P7tostypePCc__1)(void *__anonymous_object800, const char *__fmt__PCc_1, ...), void *__anonymous_object801);
     
    3838void *__sepDisable__A0_1_0_0___sepPrt__PFb_Pd0___sepReset__PF_Pd0___sepReset__PF_Pd0b___sepGetCur__PFPCc_Pd0___sepSetCur__PF_Pd0PCc___getNL__PFb_Pd0___setNL__PF_Pd0b___sepOn__PF_Pd0___sepOff__PF_Pd0___sepDisable__PFb_Pd0___sepEnable__PFb_Pd0___sepGet__PFPCc_Pd0___sepSet__PF_Pd0PCc___sepGetTuple__PFPCc_Pd0___sepSetTuple__PF_Pd0PCc___fail__PFi_Pd0___flush__PFi_Pd0___open__PF_Pd0PCcPCc___close__PF_Pd0___write__PFPd0_Pd0PCcUl___fmt__PFi_Pd0PCc__FPd0_Pd0__1(__attribute__ ((unused)) _Bool (*__sepPrt__PFb_P7tostype__1)(void *__anonymous_object910), __attribute__ ((unused)) void (*__sepReset__PF_P7tostype__1)(void *__anonymous_object911), __attribute__ ((unused)) void (*__sepReset__PF_P7tostypeb__1)(void *__anonymous_object912, _Bool __anonymous_object913), __attribute__ ((unused)) const char *(*__sepGetCur__PFPCc_P7tostype__1)(void *__anonymous_object914), __attribute__ ((unused)) void (*__sepSetCur__PF_P7tostypePCc__1)(void *__anonymous_object915, const char *__anonymous_object916), __attribute__ ((unused)) _Bool (*__getNL__PFb_P7tostype__1)(void *__anonymous_object917), __attribute__ ((unused)) void (*__setNL__PF_P7tostypeb__1)(void *__anonymous_object918, _Bool __anonymous_object919), __attribute__ ((unused)) void (*__sepOn__PF_P7tostype__1)(void *__anonymous_object920), __attribute__ ((unused)) void (*__sepOff__PF_P7tostype__1)(void *__anonymous_object921), __attribute__ ((unused)) _Bool (*__sepDisable__PFb_P7tostype__1)(void *__anonymous_object922), __attribute__ ((unused)) _Bool (*__sepEnable__PFb_P7tostype__1)(void *__anonymous_object923), __attribute__ ((unused)) const char *(*__sepGet__PFPCc_P7tostype__1)(void *__anonymous_object924), __attribute__ ((unused)) void (*__sepSet__PF_P7tostypePCc__1)(void *__anonymous_object925, const char *__anonymous_object926), __attribute__ ((unused)) const char *(*__sepGetTuple__PFPCc_P7tostype__1)(void *__anonymous_object927), __attribute__ ((unused)) void (*__sepSetTuple__PF_P7tostypePCc__1)(void *__anonymous_object928, const char *__anonymous_object929), __attribute__ ((unused)) signed int (*__fail__PFi_P7tostype__1)(void *__anonymous_object930), __attribute__ ((unused)) signed int (*__flush__PFi_P7tostype__1)(void *__anonymous_object931), __attribute__ ((unused)) void (*__open__PF_P7tostypePCcPCc__1)(void *__os__P7tostype_1, const char *__name__PCc_1, const char *__mode__PCc_1), __attribute__ ((unused)) void (*__close__PF_P7tostype__1)(void *__os__P7tostype_1), __attribute__ ((unused)) void *(*__write__PFP7tostype_P7tostypePCcUl__1)(void *__anonymous_object932, const char *__anonymous_object933, unsigned long int __anonymous_object934), __attribute__ ((unused)) signed int (*__fmt__PFi_P7tostypePCc__1)(void *__anonymous_object935, const char *__fmt__PCc_1, ...), void *__anonymous_object936);
    3939void *__sepEnable__A0_1_0_0___sepPrt__PFb_Pd0___sepReset__PF_Pd0___sepReset__PF_Pd0b___sepGetCur__PFPCc_Pd0___sepSetCur__PF_Pd0PCc___getNL__PFb_Pd0___setNL__PF_Pd0b___sepOn__PF_Pd0___sepOff__PF_Pd0___sepDisable__PFb_Pd0___sepEnable__PFb_Pd0___sepGet__PFPCc_Pd0___sepSet__PF_Pd0PCc___sepGetTuple__PFPCc_Pd0___sepSetTuple__PF_Pd0PCc___fail__PFi_Pd0___flush__PFi_Pd0___open__PF_Pd0PCcPCc___close__PF_Pd0___write__PFPd0_Pd0PCcUl___fmt__PFi_Pd0PCc__FPd0_Pd0__1(__attribute__ ((unused)) _Bool (*__sepPrt__PFb_P7tostype__1)(void *__anonymous_object937), __attribute__ ((unused)) void (*__sepReset__PF_P7tostype__1)(void *__anonymous_object938), __attribute__ ((unused)) void (*__sepReset__PF_P7tostypeb__1)(void *__anonymous_object939, _Bool __anonymous_object940), __attribute__ ((unused)) const char *(*__sepGetCur__PFPCc_P7tostype__1)(void *__anonymous_object941), __attribute__ ((unused)) void (*__sepSetCur__PF_P7tostypePCc__1)(void *__anonymous_object942, const char *__anonymous_object943), __attribute__ ((unused)) _Bool (*__getNL__PFb_P7tostype__1)(void *__anonymous_object944), __attribute__ ((unused)) void (*__setNL__PF_P7tostypeb__1)(void *__anonymous_object945, _Bool __anonymous_object946), __attribute__ ((unused)) void (*__sepOn__PF_P7tostype__1)(void *__anonymous_object947), __attribute__ ((unused)) void (*__sepOff__PF_P7tostype__1)(void *__anonymous_object948), __attribute__ ((unused)) _Bool (*__sepDisable__PFb_P7tostype__1)(void *__anonymous_object949), __attribute__ ((unused)) _Bool (*__sepEnable__PFb_P7tostype__1)(void *__anonymous_object950), __attribute__ ((unused)) const char *(*__sepGet__PFPCc_P7tostype__1)(void *__anonymous_object951), __attribute__ ((unused)) void (*__sepSet__PF_P7tostypePCc__1)(void *__anonymous_object952, const char *__anonymous_object953), __attribute__ ((unused)) const char *(*__sepGetTuple__PFPCc_P7tostype__1)(void *__anonymous_object954), __attribute__ ((unused)) void (*__sepSetTuple__PF_P7tostypePCc__1)(void *__anonymous_object955, const char *__anonymous_object956), __attribute__ ((unused)) signed int (*__fail__PFi_P7tostype__1)(void *__anonymous_object957), __attribute__ ((unused)) signed int (*__flush__PFi_P7tostype__1)(void *__anonymous_object958), __attribute__ ((unused)) void (*__open__PF_P7tostypePCcPCc__1)(void *__os__P7tostype_1, const char *__name__PCc_1, const char *__mode__PCc_1), __attribute__ ((unused)) void (*__close__PF_P7tostype__1)(void *__os__P7tostype_1), __attribute__ ((unused)) void *(*__write__PFP7tostype_P7tostypePCcUl__1)(void *__anonymous_object959, const char *__anonymous_object960, unsigned long int __anonymous_object961), __attribute__ ((unused)) signed int (*__fmt__PFi_P7tostypePCc__1)(void *__anonymous_object962, const char *__fmt__PCc_1, ...), void *__anonymous_object963);
    40 void __write__A0_3_0_0____operator_assign__PFd1_Rd1d1____constructor__PF_Rd1____constructor__PF_Rd1d1____destructor__PF_Rd1____operator_bitor__PFPd0_Pd0d1___sepPrt__PFb_Pd0___sepReset__PF_Pd0___sepReset__PF_Pd0b___sepGetCur__PFPCc_Pd0___sepSetCur__PF_Pd0PCc___getNL__PFb_Pd0___setNL__PF_Pd0b___sepOn__PF_Pd0___sepOff__PF_Pd0___sepDisable__PFb_Pd0___sepEnable__PFb_Pd0___sepGet__PFPCc_Pd0___sepSet__PF_Pd0PCc___sepGetTuple__PFPCc_Pd0___sepSetTuple__PF_Pd0PCc___fail__PFi_Pd0___flush__PFi_Pd0___open__PF_Pd0PCcPCc___close__PF_Pd0___write__PFPd0_Pd0PCcUl___fmt__PFi_Pd0PCc____operator_assign__PFd2_Rd2d2____constructor__PF_Rd2____constructor__PF_Rd2d2____destructor__PF_Rd2____operator_preincr__PFd2_Rd2____operator_predecr__PFd2_Rd2____operator_equal__PFi_d2d2____operator_notequal__PFi_d2d2____operator_deref__PFRd1_d2__F_d2d2Pd0__1(__attribute__ ((unused)) void *(*_adapterFP9telt_type_14titerator_type_M_P)(void (*__anonymous_object964)(), void *__anonymous_object965), __attribute__ ((unused)) signed int (*_adapterFi_14titerator_type14titerator_type_M_PP)(void (*__anonymous_object966)(), void *__anonymous_object967, void *__anonymous_object968), __attribute__ ((unused)) void (*_adapterF14titerator_type_P14titerator_type_P_M)(void (*__anonymous_object969)(), __attribute__ ((unused)) void *___retval__operator_preincr__14titerator_type_1, void *__anonymous_object970), __attribute__ ((unused)) void (*_adapterF_P14titerator_type14titerator_type__MP)(void (*__anonymous_object971)(), void *__anonymous_object972, void *__anonymous_object973), __attribute__ ((unused)) void (*_adapterF14titerator_type_P14titerator_type14titerator_type_P_MP)(void (*__anonymous_object974)(), __attribute__ ((unused)) void *___retval__operator_assign__14titerator_type_1, void *__anonymous_object975, void *__anonymous_object976), __attribute__ ((unused)) void *(*_adapterFP7tostype_P7tostype9telt_type_M_MP)(void (*__anonymous_object977)(), void *__anonymous_object978, void *__anonymous_object979), __attribute__ ((unused)) void (*_adapterF_P9telt_type9telt_type__MP)(void (*__anonymous_object980)(), void *__anonymous_object981, void *__anonymous_object982), __attribute__ ((unused)) void (*_adapterF9telt_type_P9telt_type9telt_type_P_MP)(void (*__anonymous_object983)(), __attribute__ ((unused)) void *___retval__operator_assign__9telt_type_1, void *__anonymous_object984, void *__anonymous_object985), __attribute__ ((unused)) unsigned long int _sizeof_9telt_type, __attribute__ ((unused)) unsigned long int _alignof_9telt_type, __attribute__ ((unused)) unsigned long int _sizeof_14titerator_type, __attribute__ ((unused)) unsigned long int _alignof_14titerator_type, __attribute__ ((unused)) void *(*___operator_assign__PF9telt_type_R9telt_type9telt_type__1)(void *__anonymous_object986, void *__anonymous_object987), __attribute__ ((unused)) void (*___constructor__PF_R9telt_type__1)(void *__anonymous_object988), __attribute__ ((unused)) void (*___constructor__PF_R9telt_type9telt_type__1)(void *__anonymous_object989, void *__anonymous_object990), __attribute__ ((unused)) void (*___destructor__PF_R9telt_type__1)(void *__anonymous_object991), __attribute__ ((unused)) void *(*___operator_bitor__PFP7tostype_P7tostype9telt_type__1)(void *__anonymous_object992, void *__anonymous_object993), __attribute__ ((unused)) _Bool (*__sepPrt__PFb_P7tostype__1)(void *__anonymous_object994), __attribute__ ((unused)) void (*__sepReset__PF_P7tostype__1)(void *__anonymous_object995), __attribute__ ((unused)) void (*__sepReset__PF_P7tostypeb__1)(void *__anonymous_object996, _Bool __anonymous_object997), __attribute__ ((unused)) const char *(*__sepGetCur__PFPCc_P7tostype__1)(void *__anonymous_object998), __attribute__ ((unused)) void (*__sepSetCur__PF_P7tostypePCc__1)(void *__anonymous_object999, const char *__anonymous_object1000), __attribute__ ((unused)) _Bool (*__getNL__PFb_P7tostype__1)(void *__anonymous_object1001), __attribute__ ((unused)) void (*__setNL__PF_P7tostypeb__1)(void *__anonymous_object1002, _Bool __anonymous_object1003), __attribute__ ((unused)) void (*__sepOn__PF_P7tostype__1)(void *__anonymous_object1004), __attribute__ ((unused)) void (*__sepOff__PF_P7tostype__1)(void *__anonymous_object1005), __attribute__ ((unused)) _Bool (*__sepDisable__PFb_P7tostype__1)(void *__anonymous_object1006), __attribute__ ((unused)) _Bool (*__sepEnable__PFb_P7tostype__1)(void *__anonymous_object1007), __attribute__ ((unused)) const char *(*__sepGet__PFPCc_P7tostype__1)(void *__anonymous_object1008), __attribute__ ((unused)) void (*__sepSet__PF_P7tostypePCc__1)(void *__anonymous_object1009, const char *__anonymous_object1010), __attribute__ ((unused)) const char *(*__sepGetTuple__PFPCc_P7tostype__1)(void *__anonymous_object1011), __attribute__ ((unused)) void (*__sepSetTuple__PF_P7tostypePCc__1)(void *__anonymous_object1012, const char *__anonymous_object1013), __attribute__ ((unused)) signed int (*__fail__PFi_P7tostype__1)(void *__anonymous_object1014), __attribute__ ((unused)) signed int (*__flush__PFi_P7tostype__1)(void *__anonymous_object1015), __attribute__ ((unused)) void (*__open__PF_P7tostypePCcPCc__1)(void *__os__P7tostype_1, const char *__name__PCc_1, const char *__mode__PCc_1), __attribute__ ((unused)) void (*__close__PF_P7tostype__1)(void *__os__P7tostype_1), __attribute__ ((unused)) void *(*__write__PFP7tostype_P7tostypePCcUl__1)(void *__anonymous_object1016, const char *__anonymous_object1017, unsigned long int __anonymous_object1018), __attribute__ ((unused)) signed int (*__fmt__PFi_P7tostypePCc__1)(void *__anonymous_object1019, const char *__fmt__PCc_1, ...), __attribute__ ((unused)) void *(*___operator_assign__PF14titerator_type_R14titerator_type14titerator_type__1)(void *__anonymous_object1020, void *__anonymous_object1021), __attribute__ ((unused)) void (*___constructor__PF_R14titerator_type__1)(void *__anonymous_object1022), __attribute__ ((unused)) void (*___constructor__PF_R14titerator_type14titerator_type__1)(void *__anonymous_object1023, void *__anonymous_object1024), __attribute__ ((unused)) void (*___destructor__PF_R14titerator_type__1)(void *__anonymous_object1025), __attribute__ ((unused)) void *(*___operator_preincr__PF14titerator_type_R14titerator_type__1)(void *__anonymous_object1026), __attribute__ ((unused)) void *(*___operator_predecr__PF14titerator_type_R14titerator_type__1)(void *__anonymous_object1027), __attribute__ ((unused)) signed int (*___operator_equal__PFi_14titerator_type14titerator_type__1)(void *__anonymous_object1028, void *__anonymous_object1029), __attribute__ ((unused)) signed int (*___operator_notequal__PFi_14titerator_type14titerator_type__1)(void *__anonymous_object1030, void *__anonymous_object1031), __attribute__ ((unused)) void *(*___operator_deref__PFR9telt_type_14titerator_type__1)(void *__anonymous_object1032), void *__begin__14titerator_type_1, void *__end__14titerator_type_1, void *__os__P7tostype_1);
    41 void __write_reverse__A0_3_0_0____operator_assign__PFd1_Rd1d1____constructor__PF_Rd1____constructor__PF_Rd1d1____destructor__PF_Rd1____operator_bitor__PFPd0_Pd0d1___sepPrt__PFb_Pd0___sepReset__PF_Pd0___sepReset__PF_Pd0b___sepGetCur__PFPCc_Pd0___sepSetCur__PF_Pd0PCc___getNL__PFb_Pd0___setNL__PF_Pd0b___sepOn__PF_Pd0___sepOff__PF_Pd0___sepDisable__PFb_Pd0___sepEnable__PFb_Pd0___sepGet__PFPCc_Pd0___sepSet__PF_Pd0PCc___sepGetTuple__PFPCc_Pd0___sepSetTuple__PF_Pd0PCc___fail__PFi_Pd0___flush__PFi_Pd0___open__PF_Pd0PCcPCc___close__PF_Pd0___write__PFPd0_Pd0PCcUl___fmt__PFi_Pd0PCc____operator_assign__PFd2_Rd2d2____constructor__PF_Rd2____constructor__PF_Rd2d2____destructor__PF_Rd2____operator_preincr__PFd2_Rd2____operator_predecr__PFd2_Rd2____operator_equal__PFi_d2d2____operator_notequal__PFi_d2d2____operator_deref__PFRd1_d2__F_d2d2Pd0__1(__attribute__ ((unused)) void *(*_adapterFP9telt_type_14titerator_type_M_P)(void (*__anonymous_object1033)(), void *__anonymous_object1034), __attribute__ ((unused)) signed int (*_adapterFi_14titerator_type14titerator_type_M_PP)(void (*__anonymous_object1035)(), void *__anonymous_object1036, void *__anonymous_object1037), __attribute__ ((unused)) void (*_adapterF14titerator_type_P14titerator_type_P_M)(void (*__anonymous_object1038)(), __attribute__ ((unused)) void *___retval__operator_preincr__14titerator_type_1, void *__anonymous_object1039), __attribute__ ((unused)) void (*_adapterF_P14titerator_type14titerator_type__MP)(void (*__anonymous_object1040)(), void *__anonymous_object1041, void *__anonymous_object1042), __attribute__ ((unused)) void (*_adapterF14titerator_type_P14titerator_type14titerator_type_P_MP)(void (*__anonymous_object1043)(), __attribute__ ((unused)) void *___retval__operator_assign__14titerator_type_1, void *__anonymous_object1044, void *__anonymous_object1045), __attribute__ ((unused)) void *(*_adapterFP7tostype_P7tostype9telt_type_M_MP)(void (*__anonymous_object1046)(), void *__anonymous_object1047, void *__anonymous_object1048), __attribute__ ((unused)) void (*_adapterF_P9telt_type9telt_type__MP)(void (*__anonymous_object1049)(), void *__anonymous_object1050, void *__anonymous_object1051), __attribute__ ((unused)) void (*_adapterF9telt_type_P9telt_type9telt_type_P_MP)(void (*__anonymous_object1052)(), __attribute__ ((unused)) void *___retval__operator_assign__9telt_type_1, void *__anonymous_object1053, void *__anonymous_object1054), __attribute__ ((unused)) unsigned long int _sizeof_9telt_type, __attribute__ ((unused)) unsigned long int _alignof_9telt_type, __attribute__ ((unused)) unsigned long int _sizeof_14titerator_type, __attribute__ ((unused)) unsigned long int _alignof_14titerator_type, __attribute__ ((unused)) void *(*___operator_assign__PF9telt_type_R9telt_type9telt_type__1)(void *__anonymous_object1055, void *__anonymous_object1056), __attribute__ ((unused)) void (*___constructor__PF_R9telt_type__1)(void *__anonymous_object1057), __attribute__ ((unused)) void (*___constructor__PF_R9telt_type9telt_type__1)(void *__anonymous_object1058, void *__anonymous_object1059), __attribute__ ((unused)) void (*___destructor__PF_R9telt_type__1)(void *__anonymous_object1060), __attribute__ ((unused)) void *(*___operator_bitor__PFP7tostype_P7tostype9telt_type__1)(void *__anonymous_object1061, void *__anonymous_object1062), __attribute__ ((unused)) _Bool (*__sepPrt__PFb_P7tostype__1)(void *__anonymous_object1063), __attribute__ ((unused)) void (*__sepReset__PF_P7tostype__1)(void *__anonymous_object1064), __attribute__ ((unused)) void (*__sepReset__PF_P7tostypeb__1)(void *__anonymous_object1065, _Bool __anonymous_object1066), __attribute__ ((unused)) const char *(*__sepGetCur__PFPCc_P7tostype__1)(void *__anonymous_object1067), __attribute__ ((unused)) void (*__sepSetCur__PF_P7tostypePCc__1)(void *__anonymous_object1068, const char *__anonymous_object1069), __attribute__ ((unused)) _Bool (*__getNL__PFb_P7tostype__1)(void *__anonymous_object1070), __attribute__ ((unused)) void (*__setNL__PF_P7tostypeb__1)(void *__anonymous_object1071, _Bool __anonymous_object1072), __attribute__ ((unused)) void (*__sepOn__PF_P7tostype__1)(void *__anonymous_object1073), __attribute__ ((unused)) void (*__sepOff__PF_P7tostype__1)(void *__anonymous_object1074), __attribute__ ((unused)) _Bool (*__sepDisable__PFb_P7tostype__1)(void *__anonymous_object1075), __attribute__ ((unused)) _Bool (*__sepEnable__PFb_P7tostype__1)(void *__anonymous_object1076), __attribute__ ((unused)) const char *(*__sepGet__PFPCc_P7tostype__1)(void *__anonymous_object1077), __attribute__ ((unused)) void (*__sepSet__PF_P7tostypePCc__1)(void *__anonymous_object1078, const char *__anonymous_object1079), __attribute__ ((unused)) const char *(*__sepGetTuple__PFPCc_P7tostype__1)(void *__anonymous_object1080), __attribute__ ((unused)) void (*__sepSetTuple__PF_P7tostypePCc__1)(void *__anonymous_object1081, const char *__anonymous_object1082), __attribute__ ((unused)) signed int (*__fail__PFi_P7tostype__1)(void *__anonymous_object1083), __attribute__ ((unused)) signed int (*__flush__PFi_P7tostype__1)(void *__anonymous_object1084), __attribute__ ((unused)) void (*__open__PF_P7tostypePCcPCc__1)(void *__os__P7tostype_1, const char *__name__PCc_1, const char *__mode__PCc_1), __attribute__ ((unused)) void (*__close__PF_P7tostype__1)(void *__os__P7tostype_1), __attribute__ ((unused)) void *(*__write__PFP7tostype_P7tostypePCcUl__1)(void *__anonymous_object1085, const char *__anonymous_object1086, unsigned long int __anonymous_object1087), __attribute__ ((unused)) signed int (*__fmt__PFi_P7tostypePCc__1)(void *__anonymous_object1088, const char *__fmt__PCc_1, ...), __attribute__ ((unused)) void *(*___operator_assign__PF14titerator_type_R14titerator_type14titerator_type__1)(void *__anonymous_object1089, void *__anonymous_object1090), __attribute__ ((unused)) void (*___constructor__PF_R14titerator_type__1)(void *__anonymous_object1091), __attribute__ ((unused)) void (*___constructor__PF_R14titerator_type14titerator_type__1)(void *__anonymous_object1092, void *__anonymous_object1093), __attribute__ ((unused)) void (*___destructor__PF_R14titerator_type__1)(void *__anonymous_object1094), __attribute__ ((unused)) void *(*___operator_preincr__PF14titerator_type_R14titerator_type__1)(void *__anonymous_object1095), __attribute__ ((unused)) void *(*___operator_predecr__PF14titerator_type_R14titerator_type__1)(void *__anonymous_object1096), __attribute__ ((unused)) signed int (*___operator_equal__PFi_14titerator_type14titerator_type__1)(void *__anonymous_object1097, void *__anonymous_object1098), __attribute__ ((unused)) signed int (*___operator_notequal__PFi_14titerator_type14titerator_type__1)(void *__anonymous_object1099, void *__anonymous_object1100), __attribute__ ((unused)) void *(*___operator_deref__PFR9telt_type_14titerator_type__1)(void *__anonymous_object1101), void *__begin__14titerator_type_1, void *__end__14titerator_type_1, void *__os__P7tostype_1);
     40void __write__A2_1_0_0____operator_assign__PFt1_Rt1t1____constructor__PF_Rt1____constructor__PF_Rt1t1____destructor__PF_Rt1____operator_bitor__PFPd0_Pd0t1___sepPrt__PFb_Pd0___sepReset__PF_Pd0___sepReset__PF_Pd0b___sepGetCur__PFPCc_Pd0___sepSetCur__PF_Pd0PCc___getNL__PFb_Pd0___setNL__PF_Pd0b___sepOn__PF_Pd0___sepOff__PF_Pd0___sepDisable__PFb_Pd0___sepEnable__PFb_Pd0___sepGet__PFPCc_Pd0___sepSet__PF_Pd0PCc___sepGetTuple__PFPCc_Pd0___sepSetTuple__PF_Pd0PCc___fail__PFi_Pd0___flush__PFi_Pd0___open__PF_Pd0PCcPCc___close__PF_Pd0___write__PFPd0_Pd0PCcUl___fmt__PFi_Pd0PCc____operator_assign__PFt2_Rt2t2____constructor__PF_Rt2____constructor__PF_Rt2t2____destructor__PF_Rt2____operator_preincr__PFt2_Rt2____operator_predecr__PFt2_Rt2____operator_equal__PFi_t2t2____operator_notequal__PFi_t2t2____operator_deref__PFRt1_t2__F_t2t2Pd0__1(__attribute__ ((unused)) void *(*_adapterFP9telt_type_14titerator_type_M_P)(void (*__anonymous_object964)(), void *__anonymous_object965), __attribute__ ((unused)) signed int (*_adapterFi_14titerator_type14titerator_type_M_PP)(void (*__anonymous_object966)(), void *__anonymous_object967, void *__anonymous_object968), __attribute__ ((unused)) void (*_adapterF14titerator_type_P14titerator_type_P_M)(void (*__anonymous_object969)(), __attribute__ ((unused)) void *___retval__operator_preincr__14titerator_type_1, void *__anonymous_object970), __attribute__ ((unused)) void (*_adapterF_P14titerator_type14titerator_type__MP)(void (*__anonymous_object971)(), void *__anonymous_object972, void *__anonymous_object973), __attribute__ ((unused)) void (*_adapterF14titerator_type_P14titerator_type14titerator_type_P_MP)(void (*__anonymous_object974)(), __attribute__ ((unused)) void *___retval__operator_assign__14titerator_type_1, void *__anonymous_object975, void *__anonymous_object976), __attribute__ ((unused)) void *(*_adapterFP7tostype_P7tostype9telt_type_M_MP)(void (*__anonymous_object977)(), void *__anonymous_object978, void *__anonymous_object979), __attribute__ ((unused)) void (*_adapterF_P9telt_type9telt_type__MP)(void (*__anonymous_object980)(), void *__anonymous_object981, void *__anonymous_object982), __attribute__ ((unused)) void (*_adapterF9telt_type_P9telt_type9telt_type_P_MP)(void (*__anonymous_object983)(), __attribute__ ((unused)) void *___retval__operator_assign__9telt_type_1, void *__anonymous_object984, void *__anonymous_object985), __attribute__ ((unused)) unsigned long int _sizeof_9telt_type, __attribute__ ((unused)) unsigned long int _alignof_9telt_type, __attribute__ ((unused)) unsigned long int _sizeof_14titerator_type, __attribute__ ((unused)) unsigned long int _alignof_14titerator_type, __attribute__ ((unused)) void *(*___operator_assign__PF9telt_type_R9telt_type9telt_type__1)(void *__anonymous_object986, void *__anonymous_object987), __attribute__ ((unused)) void (*___constructor__PF_R9telt_type__1)(void *__anonymous_object988), __attribute__ ((unused)) void (*___constructor__PF_R9telt_type9telt_type__1)(void *__anonymous_object989, void *__anonymous_object990), __attribute__ ((unused)) void (*___destructor__PF_R9telt_type__1)(void *__anonymous_object991), __attribute__ ((unused)) void *(*___operator_bitor__PFP7tostype_P7tostype9telt_type__1)(void *__anonymous_object992, void *__anonymous_object993), __attribute__ ((unused)) _Bool (*__sepPrt__PFb_P7tostype__1)(void *__anonymous_object994), __attribute__ ((unused)) void (*__sepReset__PF_P7tostype__1)(void *__anonymous_object995), __attribute__ ((unused)) void (*__sepReset__PF_P7tostypeb__1)(void *__anonymous_object996, _Bool __anonymous_object997), __attribute__ ((unused)) const char *(*__sepGetCur__PFPCc_P7tostype__1)(void *__anonymous_object998), __attribute__ ((unused)) void (*__sepSetCur__PF_P7tostypePCc__1)(void *__anonymous_object999, const char *__anonymous_object1000), __attribute__ ((unused)) _Bool (*__getNL__PFb_P7tostype__1)(void *__anonymous_object1001), __attribute__ ((unused)) void (*__setNL__PF_P7tostypeb__1)(void *__anonymous_object1002, _Bool __anonymous_object1003), __attribute__ ((unused)) void (*__sepOn__PF_P7tostype__1)(void *__anonymous_object1004), __attribute__ ((unused)) void (*__sepOff__PF_P7tostype__1)(void *__anonymous_object1005), __attribute__ ((unused)) _Bool (*__sepDisable__PFb_P7tostype__1)(void *__anonymous_object1006), __attribute__ ((unused)) _Bool (*__sepEnable__PFb_P7tostype__1)(void *__anonymous_object1007), __attribute__ ((unused)) const char *(*__sepGet__PFPCc_P7tostype__1)(void *__anonymous_object1008), __attribute__ ((unused)) void (*__sepSet__PF_P7tostypePCc__1)(void *__anonymous_object1009, const char *__anonymous_object1010), __attribute__ ((unused)) const char *(*__sepGetTuple__PFPCc_P7tostype__1)(void *__anonymous_object1011), __attribute__ ((unused)) void (*__sepSetTuple__PF_P7tostypePCc__1)(void *__anonymous_object1012, const char *__anonymous_object1013), __attribute__ ((unused)) signed int (*__fail__PFi_P7tostype__1)(void *__anonymous_object1014), __attribute__ ((unused)) signed int (*__flush__PFi_P7tostype__1)(void *__anonymous_object1015), __attribute__ ((unused)) void (*__open__PF_P7tostypePCcPCc__1)(void *__os__P7tostype_1, const char *__name__PCc_1, const char *__mode__PCc_1), __attribute__ ((unused)) void (*__close__PF_P7tostype__1)(void *__os__P7tostype_1), __attribute__ ((unused)) void *(*__write__PFP7tostype_P7tostypePCcUl__1)(void *__anonymous_object1016, const char *__anonymous_object1017, unsigned long int __anonymous_object1018), __attribute__ ((unused)) signed int (*__fmt__PFi_P7tostypePCc__1)(void *__anonymous_object1019, const char *__fmt__PCc_1, ...), __attribute__ ((unused)) void *(*___operator_assign__PF14titerator_type_R14titerator_type14titerator_type__1)(void *__anonymous_object1020, void *__anonymous_object1021), __attribute__ ((unused)) void (*___constructor__PF_R14titerator_type__1)(void *__anonymous_object1022), __attribute__ ((unused)) void (*___constructor__PF_R14titerator_type14titerator_type__1)(void *__anonymous_object1023, void *__anonymous_object1024), __attribute__ ((unused)) void (*___destructor__PF_R14titerator_type__1)(void *__anonymous_object1025), __attribute__ ((unused)) void *(*___operator_preincr__PF14titerator_type_R14titerator_type__1)(void *__anonymous_object1026), __attribute__ ((unused)) void *(*___operator_predecr__PF14titerator_type_R14titerator_type__1)(void *__anonymous_object1027), __attribute__ ((unused)) signed int (*___operator_equal__PFi_14titerator_type14titerator_type__1)(void *__anonymous_object1028, void *__anonymous_object1029), __attribute__ ((unused)) signed int (*___operator_notequal__PFi_14titerator_type14titerator_type__1)(void *__anonymous_object1030, void *__anonymous_object1031), __attribute__ ((unused)) void *(*___operator_deref__PFR9telt_type_14titerator_type__1)(void *__anonymous_object1032), void *__begin__14titerator_type_1, void *__end__14titerator_type_1, void *__os__P7tostype_1);
     41void __write_reverse__A2_1_0_0____operator_assign__PFt1_Rt1t1____constructor__PF_Rt1____constructor__PF_Rt1t1____destructor__PF_Rt1____operator_bitor__PFPd0_Pd0t1___sepPrt__PFb_Pd0___sepReset__PF_Pd0___sepReset__PF_Pd0b___sepGetCur__PFPCc_Pd0___sepSetCur__PF_Pd0PCc___getNL__PFb_Pd0___setNL__PF_Pd0b___sepOn__PF_Pd0___sepOff__PF_Pd0___sepDisable__PFb_Pd0___sepEnable__PFb_Pd0___sepGet__PFPCc_Pd0___sepSet__PF_Pd0PCc___sepGetTuple__PFPCc_Pd0___sepSetTuple__PF_Pd0PCc___fail__PFi_Pd0___flush__PFi_Pd0___open__PF_Pd0PCcPCc___close__PF_Pd0___write__PFPd0_Pd0PCcUl___fmt__PFi_Pd0PCc____operator_assign__PFt2_Rt2t2____constructor__PF_Rt2____constructor__PF_Rt2t2____destructor__PF_Rt2____operator_preincr__PFt2_Rt2____operator_predecr__PFt2_Rt2____operator_equal__PFi_t2t2____operator_notequal__PFi_t2t2____operator_deref__PFRt1_t2__F_t2t2Pd0__1(__attribute__ ((unused)) void *(*_adapterFP9telt_type_14titerator_type_M_P)(void (*__anonymous_object1033)(), void *__anonymous_object1034), __attribute__ ((unused)) signed int (*_adapterFi_14titerator_type14titerator_type_M_PP)(void (*__anonymous_object1035)(), void *__anonymous_object1036, void *__anonymous_object1037), __attribute__ ((unused)) void (*_adapterF14titerator_type_P14titerator_type_P_M)(void (*__anonymous_object1038)(), __attribute__ ((unused)) void *___retval__operator_preincr__14titerator_type_1, void *__anonymous_object1039), __attribute__ ((unused)) void (*_adapterF_P14titerator_type14titerator_type__MP)(void (*__anonymous_object1040)(), void *__anonymous_object1041, void *__anonymous_object1042), __attribute__ ((unused)) void (*_adapterF14titerator_type_P14titerator_type14titerator_type_P_MP)(void (*__anonymous_object1043)(), __attribute__ ((unused)) void *___retval__operator_assign__14titerator_type_1, void *__anonymous_object1044, void *__anonymous_object1045), __attribute__ ((unused)) void *(*_adapterFP7tostype_P7tostype9telt_type_M_MP)(void (*__anonymous_object1046)(), void *__anonymous_object1047, void *__anonymous_object1048), __attribute__ ((unused)) void (*_adapterF_P9telt_type9telt_type__MP)(void (*__anonymous_object1049)(), void *__anonymous_object1050, void *__anonymous_object1051), __attribute__ ((unused)) void (*_adapterF9telt_type_P9telt_type9telt_type_P_MP)(void (*__anonymous_object1052)(), __attribute__ ((unused)) void *___retval__operator_assign__9telt_type_1, void *__anonymous_object1053, void *__anonymous_object1054), __attribute__ ((unused)) unsigned long int _sizeof_9telt_type, __attribute__ ((unused)) unsigned long int _alignof_9telt_type, __attribute__ ((unused)) unsigned long int _sizeof_14titerator_type, __attribute__ ((unused)) unsigned long int _alignof_14titerator_type, __attribute__ ((unused)) void *(*___operator_assign__PF9telt_type_R9telt_type9telt_type__1)(void *__anonymous_object1055, void *__anonymous_object1056), __attribute__ ((unused)) void (*___constructor__PF_R9telt_type__1)(void *__anonymous_object1057), __attribute__ ((unused)) void (*___constructor__PF_R9telt_type9telt_type__1)(void *__anonymous_object1058, void *__anonymous_object1059), __attribute__ ((unused)) void (*___destructor__PF_R9telt_type__1)(void *__anonymous_object1060), __attribute__ ((unused)) void *(*___operator_bitor__PFP7tostype_P7tostype9telt_type__1)(void *__anonymous_object1061, void *__anonymous_object1062), __attribute__ ((unused)) _Bool (*__sepPrt__PFb_P7tostype__1)(void *__anonymous_object1063), __attribute__ ((unused)) void (*__sepReset__PF_P7tostype__1)(void *__anonymous_object1064), __attribute__ ((unused)) void (*__sepReset__PF_P7tostypeb__1)(void *__anonymous_object1065, _Bool __anonymous_object1066), __attribute__ ((unused)) const char *(*__sepGetCur__PFPCc_P7tostype__1)(void *__anonymous_object1067), __attribute__ ((unused)) void (*__sepSetCur__PF_P7tostypePCc__1)(void *__anonymous_object1068, const char *__anonymous_object1069), __attribute__ ((unused)) _Bool (*__getNL__PFb_P7tostype__1)(void *__anonymous_object1070), __attribute__ ((unused)) void (*__setNL__PF_P7tostypeb__1)(void *__anonymous_object1071, _Bool __anonymous_object1072), __attribute__ ((unused)) void (*__sepOn__PF_P7tostype__1)(void *__anonymous_object1073), __attribute__ ((unused)) void (*__sepOff__PF_P7tostype__1)(void *__anonymous_object1074), __attribute__ ((unused)) _Bool (*__sepDisable__PFb_P7tostype__1)(void *__anonymous_object1075), __attribute__ ((unused)) _Bool (*__sepEnable__PFb_P7tostype__1)(void *__anonymous_object1076), __attribute__ ((unused)) const char *(*__sepGet__PFPCc_P7tostype__1)(void *__anonymous_object1077), __attribute__ ((unused)) void (*__sepSet__PF_P7tostypePCc__1)(void *__anonymous_object1078, const char *__anonymous_object1079), __attribute__ ((unused)) const char *(*__sepGetTuple__PFPCc_P7tostype__1)(void *__anonymous_object1080), __attribute__ ((unused)) void (*__sepSetTuple__PF_P7tostypePCc__1)(void *__anonymous_object1081, const char *__anonymous_object1082), __attribute__ ((unused)) signed int (*__fail__PFi_P7tostype__1)(void *__anonymous_object1083), __attribute__ ((unused)) signed int (*__flush__PFi_P7tostype__1)(void *__anonymous_object1084), __attribute__ ((unused)) void (*__open__PF_P7tostypePCcPCc__1)(void *__os__P7tostype_1, const char *__name__PCc_1, const char *__mode__PCc_1), __attribute__ ((unused)) void (*__close__PF_P7tostype__1)(void *__os__P7tostype_1), __attribute__ ((unused)) void *(*__write__PFP7tostype_P7tostypePCcUl__1)(void *__anonymous_object1085, const char *__anonymous_object1086, unsigned long int __anonymous_object1087), __attribute__ ((unused)) signed int (*__fmt__PFi_P7tostypePCc__1)(void *__anonymous_object1088, const char *__fmt__PCc_1, ...), __attribute__ ((unused)) void *(*___operator_assign__PF14titerator_type_R14titerator_type14titerator_type__1)(void *__anonymous_object1089, void *__anonymous_object1090), __attribute__ ((unused)) void (*___constructor__PF_R14titerator_type__1)(void *__anonymous_object1091), __attribute__ ((unused)) void (*___constructor__PF_R14titerator_type14titerator_type__1)(void *__anonymous_object1092, void *__anonymous_object1093), __attribute__ ((unused)) void (*___destructor__PF_R14titerator_type__1)(void *__anonymous_object1094), __attribute__ ((unused)) void *(*___operator_preincr__PF14titerator_type_R14titerator_type__1)(void *__anonymous_object1095), __attribute__ ((unused)) void *(*___operator_predecr__PF14titerator_type_R14titerator_type__1)(void *__anonymous_object1096), __attribute__ ((unused)) signed int (*___operator_equal__PFi_14titerator_type14titerator_type__1)(void *__anonymous_object1097, void *__anonymous_object1098), __attribute__ ((unused)) signed int (*___operator_notequal__PFi_14titerator_type14titerator_type__1)(void *__anonymous_object1099, void *__anonymous_object1100), __attribute__ ((unused)) void *(*___operator_deref__PFR9telt_type_14titerator_type__1)(void *__anonymous_object1101), void *__begin__14titerator_type_1, void *__end__14titerator_type_1, void *__os__P7tostype_1);
    4242void *___operator_bitor__A0_1_0_0___fail__PFi_Pd0___eof__PFi_Pd0___open__PF_Pd0PCcPCc___close__PF_Pd0___read__PFPd0_Pd0PcUl___ungetc__PFPd0_Pd0c___fmt__PFi_Pd0PCc__FPd0_Pd0Rc__1(__attribute__ ((unused)) signed int (*__fail__PFi_P7tistype__1)(void *__anonymous_object1102), __attribute__ ((unused)) signed int (*__eof__PFi_P7tistype__1)(void *__anonymous_object1103), __attribute__ ((unused)) void (*__open__PF_P7tistypePCcPCc__1)(void *__is__P7tistype_1, const char *__name__PCc_1, const char *__mode__PCc_1), __attribute__ ((unused)) void (*__close__PF_P7tistype__1)(void *__is__P7tistype_1), __attribute__ ((unused)) void *(*__read__PFP7tistype_P7tistypePcUl__1)(void *__anonymous_object1104, char *__anonymous_object1105, unsigned long int __anonymous_object1106), __attribute__ ((unused)) void *(*__ungetc__PFP7tistype_P7tistypec__1)(void *__anonymous_object1107, char __anonymous_object1108), __attribute__ ((unused)) signed int (*__fmt__PFi_P7tistypePCc__1)(void *__anonymous_object1109, const char *__fmt__PCc_1, ...), void *__anonymous_object1110, char *__anonymous_object1111);
    4343void *___operator_bitor__A0_1_0_0___fail__PFi_Pd0___eof__PFi_Pd0___open__PF_Pd0PCcPCc___close__PF_Pd0___read__PFPd0_Pd0PcUl___ungetc__PFPd0_Pd0c___fmt__PFi_Pd0PCc__FPd0_Pd0RSc__1(__attribute__ ((unused)) signed int (*__fail__PFi_P7tistype__1)(void *__anonymous_object1112), __attribute__ ((unused)) signed int (*__eof__PFi_P7tistype__1)(void *__anonymous_object1113), __attribute__ ((unused)) void (*__open__PF_P7tistypePCcPCc__1)(void *__is__P7tistype_1, const char *__name__PCc_1, const char *__mode__PCc_1), __attribute__ ((unused)) void (*__close__PF_P7tistype__1)(void *__is__P7tistype_1), __attribute__ ((unused)) void *(*__read__PFP7tistype_P7tistypePcUl__1)(void *__anonymous_object1114, char *__anonymous_object1115, unsigned long int __anonymous_object1116), __attribute__ ((unused)) void *(*__ungetc__PFP7tistype_P7tistypec__1)(void *__anonymous_object1117, char __anonymous_object1118), __attribute__ ((unused)) signed int (*__fmt__PFi_P7tistypePCc__1)(void *__anonymous_object1119, const char *__fmt__PCc_1, ...), void *__anonymous_object1120, signed char *__anonymous_object1121);
     
    6464static inline void ___destructor__F_R16s_Istream_cstrUC_autogen___1(struct _Istream_cstrUC *___dst__R16s_Istream_cstrUC_1);
    6565static inline struct _Istream_cstrUC ___operator_assign__F16s_Istream_cstrUC_R16s_Istream_cstrUC16s_Istream_cstrUC_autogen___1(struct _Istream_cstrUC *___dst__R16s_Istream_cstrUC_1, struct _Istream_cstrUC ___src__16s_Istream_cstrUC_1);
    66 static inline void ___constructor__F_R16s_Istream_cstrUCPc_autogen___1(struct _Istream_cstrUC *___dst__R16s_Istream_cstrUC_1, char *__s__Pc_1);
    6766static inline void ___constructor__F_R16s_Istream_cstrUC_autogen___1(struct _Istream_cstrUC *___dst__R16s_Istream_cstrUC_1){
    6867    ((void)((*___dst__R16s_Istream_cstrUC_1).__s__Pc_1) /* ?{} */);
     
    7776    struct _Istream_cstrUC ___ret__16s_Istream_cstrUC_1;
    7877    ((void)((*___dst__R16s_Istream_cstrUC_1).__s__Pc_1=___src__16s_Istream_cstrUC_1.__s__Pc_1));
    79     ((void)___constructor__F_R16s_Istream_cstrUC16s_Istream_cstrUC_autogen___1((&___ret__16s_Istream_cstrUC_1), (*___dst__R16s_Istream_cstrUC_1)));
    80     return ___ret__16s_Istream_cstrUC_1;
     78    ((void)___constructor__F_R16s_Istream_cstrUC16s_Istream_cstrUC_autogen___1((&___ret__16s_Istream_cstrUC_1), ___src__16s_Istream_cstrUC_1));
     79    return ((struct _Istream_cstrUC )___ret__16s_Istream_cstrUC_1);
    8180}
    8281static inline void ___constructor__F_R16s_Istream_cstrUCPc_autogen___1(struct _Istream_cstrUC *___dst__R16s_Istream_cstrUC_1, char *__s__Pc_1){
     
    9392static inline void ___destructor__F_R15s_Istream_cstrC_autogen___1(struct _Istream_cstrC *___dst__R15s_Istream_cstrC_1);
    9493static inline struct _Istream_cstrC ___operator_assign__F15s_Istream_cstrC_R15s_Istream_cstrC15s_Istream_cstrC_autogen___1(struct _Istream_cstrC *___dst__R15s_Istream_cstrC_1, struct _Istream_cstrC ___src__15s_Istream_cstrC_1);
    95 static inline void ___constructor__F_R15s_Istream_cstrCPc_autogen___1(struct _Istream_cstrC *___dst__R15s_Istream_cstrC_1, char *__s__Pc_1);
    96 static inline void ___constructor__F_R15s_Istream_cstrCPci_autogen___1(struct _Istream_cstrC *___dst__R15s_Istream_cstrC_1, char *__s__Pc_1, signed int __size__i_1);
    9794static inline void ___constructor__F_R15s_Istream_cstrC_autogen___1(struct _Istream_cstrC *___dst__R15s_Istream_cstrC_1){
    9895    ((void)((*___dst__R15s_Istream_cstrC_1).__s__Pc_1) /* ?{} */);
     
    111108    ((void)((*___dst__R15s_Istream_cstrC_1).__s__Pc_1=___src__15s_Istream_cstrC_1.__s__Pc_1));
    112109    ((void)((*___dst__R15s_Istream_cstrC_1).__size__i_1=___src__15s_Istream_cstrC_1.__size__i_1));
    113     ((void)___constructor__F_R15s_Istream_cstrC15s_Istream_cstrC_autogen___1((&___ret__15s_Istream_cstrC_1), (*___dst__R15s_Istream_cstrC_1)));
    114     return ___ret__15s_Istream_cstrC_1;
     110    ((void)___constructor__F_R15s_Istream_cstrC15s_Istream_cstrC_autogen___1((&___ret__15s_Istream_cstrC_1), ___src__15s_Istream_cstrC_1));
     111    return ((struct _Istream_cstrC )___ret__15s_Istream_cstrC_1);
    115112}
    116113static inline void ___constructor__F_R15s_Istream_cstrCPc_autogen___1(struct _Istream_cstrC *___dst__R15s_Istream_cstrC_1, char *__s__Pc_1){
     
    125122void *___operator_bitor__A0_1_0_0___fail__PFi_Pd0___eof__PFi_Pd0___open__PF_Pd0PCcPCc___close__PF_Pd0___read__PFPd0_Pd0PcUl___ungetc__PFPd0_Pd0c___fmt__PFi_Pd0PCc__FPd0_Pd015s_Istream_cstrC__1(__attribute__ ((unused)) signed int (*__fail__PFi_P7tistype__1)(void *__anonymous_object1284), __attribute__ ((unused)) signed int (*__eof__PFi_P7tistype__1)(void *__anonymous_object1285), __attribute__ ((unused)) void (*__open__PF_P7tistypePCcPCc__1)(void *__is__P7tistype_1, const char *__name__PCc_1, const char *__mode__PCc_1), __attribute__ ((unused)) void (*__close__PF_P7tistype__1)(void *__is__P7tistype_1), __attribute__ ((unused)) void *(*__read__PFP7tistype_P7tistypePcUl__1)(void *__anonymous_object1286, char *__anonymous_object1287, unsigned long int __anonymous_object1288), __attribute__ ((unused)) void *(*__ungetc__PFP7tistype_P7tistypec__1)(void *__anonymous_object1289, char __anonymous_object1290), __attribute__ ((unused)) signed int (*__fmt__PFi_P7tistypePCc__1)(void *__anonymous_object1291, const char *__fmt__PCc_1, ...), void *__anonymous_object1292, struct _Istream_cstrC __anonymous_object1293);
    126123enum __anonymous0 {
    127     __sepSize__C13e__anonymous0_1 = 16,
     124    __sepSize__C13e__anonymous0_1 = ((signed int )16),
    128125};
    129126struct ofstream {
     
    140137static inline void ___destructor__F_R9sofstream_autogen___1(struct ofstream *___dst__R9sofstream_1);
    141138static inline struct ofstream ___operator_assign__F9sofstream_R9sofstream9sofstream_autogen___1(struct ofstream *___dst__R9sofstream_1, struct ofstream ___src__9sofstream_1);
    142 static inline void ___constructor__F_R9sofstreamPv_autogen___1(struct ofstream *___dst__R9sofstream_1, void *__file__Pv_1);
    143 static inline void ___constructor__F_R9sofstreamPvb_autogen___1(struct ofstream *___dst__R9sofstream_1, void *__file__Pv_1, _Bool __sepDefault__b_1);
    144 static inline void ___constructor__F_R9sofstreamPvbb_autogen___1(struct ofstream *___dst__R9sofstream_1, void *__file__Pv_1, _Bool __sepDefault__b_1, _Bool __sepOnOff__b_1);
    145 static inline void ___constructor__F_R9sofstreamPvbbb_autogen___1(struct ofstream *___dst__R9sofstream_1, void *__file__Pv_1, _Bool __sepDefault__b_1, _Bool __sepOnOff__b_1, _Bool __sawNL__b_1);
    146 static inline void ___constructor__F_R9sofstreamPvbbbPCc_autogen___1(struct ofstream *___dst__R9sofstream_1, void *__file__Pv_1, _Bool __sepDefault__b_1, _Bool __sepOnOff__b_1, _Bool __sawNL__b_1, const char *__sepCur__PCc_1);
    147 static inline void ___constructor__F_R9sofstreamPvbbbPCcA0c_autogen___1(struct ofstream *___dst__R9sofstream_1, void *__file__Pv_1, _Bool __sepDefault__b_1, _Bool __sepOnOff__b_1, _Bool __sawNL__b_1, const char *__sepCur__PCc_1, char __separator__A0c_1[((unsigned long int )__sepSize__C13e__anonymous0_1)]);
    148 static inline void ___constructor__F_R9sofstreamPvbbbPCcA0cA0c_autogen___1(struct ofstream *___dst__R9sofstream_1, void *__file__Pv_1, _Bool __sepDefault__b_1, _Bool __sepOnOff__b_1, _Bool __sawNL__b_1, const char *__sepCur__PCc_1, char __separator__A0c_1[((unsigned long int )__sepSize__C13e__anonymous0_1)], char __tupleSeparator__A0c_1[((unsigned long int )__sepSize__C13e__anonymous0_1)]);
    149139static inline void ___constructor__F_R9sofstream_autogen___1(struct ofstream *___dst__R9sofstream_1){
    150140    ((void)((*___dst__R9sofstream_1).__file__Pv_1) /* ?{} */);
     
    154144    ((void)((*___dst__R9sofstream_1).__sepCur__PCc_1) /* ?{} */);
    155145    {
    156         signed int _index0 = 0;
     146        signed int _index0 = ((signed int )0);
    157147        for (;(_index0<((signed int )__sepSize__C13e__anonymous0_1));((void)(++_index0))) {
    158148            ((void)((*((char *)(&(*___dst__R9sofstream_1).__separator__A0c_1[((signed long int )_index0)])))) /* ?{} */);
     
    160150
    161151    }
    162 
    163     {
    164         signed int _index1 = 0;
     152    {
     153        signed int _index1 = ((signed int )0);
    165154        for (;(_index1<((signed int )__sepSize__C13e__anonymous0_1));((void)(++_index1))) {
    166155            ((void)((*((char *)(&(*___dst__R9sofstream_1).__tupleSeparator__A0c_1[((signed long int )_index1)])))) /* ?{} */);
     
    168157
    169158    }
    170 
    171159}
    172160static inline void ___constructor__F_R9sofstream9sofstream_autogen___1(struct ofstream *___dst__R9sofstream_1, struct ofstream ___src__9sofstream_1){
     
    177165    ((void)((*___dst__R9sofstream_1).__sepCur__PCc_1=___src__9sofstream_1.__sepCur__PCc_1) /* ?{} */);
    178166    {
    179         signed int _index2 = 0;
     167        signed int _index2 = ((signed int )0);
    180168        for (;(_index2<((signed int )__sepSize__C13e__anonymous0_1));((void)(++_index2))) {
    181169            ((void)((*((char *)(&(*___dst__R9sofstream_1).__separator__A0c_1[((signed long int )_index2)])))=___src__9sofstream_1.__separator__A0c_1[((signed long int )_index2)]) /* ?{} */);
     
    183171
    184172    }
    185 
    186     {
    187         signed int _index3 = 0;
     173    {
     174        signed int _index3 = ((signed int )0);
    188175        for (;(_index3<((signed int )__sepSize__C13e__anonymous0_1));((void)(++_index3))) {
    189176            ((void)((*((char *)(&(*___dst__R9sofstream_1).__tupleSeparator__A0c_1[((signed long int )_index3)])))=___src__9sofstream_1.__tupleSeparator__A0c_1[((signed long int )_index3)]) /* ?{} */);
     
    191178
    192179    }
    193 
    194180}
    195181static inline void ___destructor__F_R9sofstream_autogen___1(struct ofstream *___dst__R9sofstream_1){
    196182    {
    197         signed int _index4 = (((signed int )__sepSize__C13e__anonymous0_1)-1);
     183        signed int _index4 = ((signed int )(((signed int )__sepSize__C13e__anonymous0_1)-1));
    198184        for (;(_index4>=0);((void)(--_index4))) {
    199185            ((void)((*((char *)(&(*___dst__R9sofstream_1).__tupleSeparator__A0c_1[((signed long int )_index4)])))) /* ^?{} */);
     
    201187
    202188    }
    203 
    204     {
    205         signed int _index5 = (((signed int )__sepSize__C13e__anonymous0_1)-1);
     189    {
     190        signed int _index5 = ((signed int )(((signed int )__sepSize__C13e__anonymous0_1)-1));
    206191        for (;(_index5>=0);((void)(--_index5))) {
    207192            ((void)((*((char *)(&(*___dst__R9sofstream_1).__separator__A0c_1[((signed long int )_index5)])))) /* ^?{} */);
     
    209194
    210195    }
    211 
    212196    ((void)((*___dst__R9sofstream_1).__sepCur__PCc_1) /* ^?{} */);
    213197    ((void)((*___dst__R9sofstream_1).__sawNL__b_1) /* ^?{} */);
     
    224208    ((void)((*___dst__R9sofstream_1).__sepCur__PCc_1=___src__9sofstream_1.__sepCur__PCc_1));
    225209    {
    226         signed int _index6 = 0;
     210        signed int _index6 = ((signed int )0);
    227211        for (;(_index6<((signed int )__sepSize__C13e__anonymous0_1));((void)(++_index6))) {
    228212            ((void)((*___dst__R9sofstream_1).__separator__A0c_1[((signed long int )_index6)]=___src__9sofstream_1.__separator__A0c_1[((signed long int )_index6)]));
     
    232216
    233217    {
    234         signed int _index7 = 0;
     218        signed int _index7 = ((signed int )0);
    235219        for (;(_index7<((signed int )__sepSize__C13e__anonymous0_1));((void)(++_index7))) {
    236220            ((void)((*___dst__R9sofstream_1).__tupleSeparator__A0c_1[((signed long int )_index7)]=___src__9sofstream_1.__tupleSeparator__A0c_1[((signed long int )_index7)]));
     
    239223    }
    240224
    241     ((void)___constructor__F_R9sofstream9sofstream_autogen___1((&___ret__9sofstream_1), (*___dst__R9sofstream_1)));
    242     return ___ret__9sofstream_1;
     225    ((void)___constructor__F_R9sofstream9sofstream_autogen___1((&___ret__9sofstream_1), ___src__9sofstream_1));
     226    return ((struct ofstream )___ret__9sofstream_1);
    243227}
    244228static inline void ___constructor__F_R9sofstreamPv_autogen___1(struct ofstream *___dst__R9sofstream_1, void *__file__Pv_1){
     
    249233    ((void)((*___dst__R9sofstream_1).__sepCur__PCc_1) /* ?{} */);
    250234    {
    251         signed int _index8 = 0;
     235        signed int _index8 = ((signed int )0);
    252236        for (;(_index8<((signed int )__sepSize__C13e__anonymous0_1));((void)(++_index8))) {
    253237            ((void)((*((char *)(&(*___dst__R9sofstream_1).__separator__A0c_1[((signed long int )_index8)])))) /* ?{} */);
     
    255239
    256240    }
    257 
    258     {
    259         signed int _index9 = 0;
     241    {
     242        signed int _index9 = ((signed int )0);
    260243        for (;(_index9<((signed int )__sepSize__C13e__anonymous0_1));((void)(++_index9))) {
    261244            ((void)((*((char *)(&(*___dst__R9sofstream_1).__tupleSeparator__A0c_1[((signed long int )_index9)])))) /* ?{} */);
     
    263246
    264247    }
    265 
    266248}
    267249static inline void ___constructor__F_R9sofstreamPvb_autogen___1(struct ofstream *___dst__R9sofstream_1, void *__file__Pv_1, _Bool __sepDefault__b_1){
     
    272254    ((void)((*___dst__R9sofstream_1).__sepCur__PCc_1) /* ?{} */);
    273255    {
    274         signed int _index10 = 0;
     256        signed int _index10 = ((signed int )0);
    275257        for (;(_index10<((signed int )__sepSize__C13e__anonymous0_1));((void)(++_index10))) {
    276258            ((void)((*((char *)(&(*___dst__R9sofstream_1).__separator__A0c_1[((signed long int )_index10)])))) /* ?{} */);
     
    278260
    279261    }
    280 
    281     {
    282         signed int _index11 = 0;
     262    {
     263        signed int _index11 = ((signed int )0);
    283264        for (;(_index11<((signed int )__sepSize__C13e__anonymous0_1));((void)(++_index11))) {
    284265            ((void)((*((char *)(&(*___dst__R9sofstream_1).__tupleSeparator__A0c_1[((signed long int )_index11)])))) /* ?{} */);
     
    286267
    287268    }
    288 
    289269}
    290270static inline void ___constructor__F_R9sofstreamPvbb_autogen___1(struct ofstream *___dst__R9sofstream_1, void *__file__Pv_1, _Bool __sepDefault__b_1, _Bool __sepOnOff__b_1){
     
    295275    ((void)((*___dst__R9sofstream_1).__sepCur__PCc_1) /* ?{} */);
    296276    {
    297         signed int _index12 = 0;
     277        signed int _index12 = ((signed int )0);
    298278        for (;(_index12<((signed int )__sepSize__C13e__anonymous0_1));((void)(++_index12))) {
    299279            ((void)((*((char *)(&(*___dst__R9sofstream_1).__separator__A0c_1[((signed long int )_index12)])))) /* ?{} */);
     
    301281
    302282    }
    303 
    304     {
    305         signed int _index13 = 0;
     283    {
     284        signed int _index13 = ((signed int )0);
    306285        for (;(_index13<((signed int )__sepSize__C13e__anonymous0_1));((void)(++_index13))) {
    307286            ((void)((*((char *)(&(*___dst__R9sofstream_1).__tupleSeparator__A0c_1[((signed long int )_index13)])))) /* ?{} */);
     
    309288
    310289    }
    311 
    312290}
    313291static inline void ___constructor__F_R9sofstreamPvbbb_autogen___1(struct ofstream *___dst__R9sofstream_1, void *__file__Pv_1, _Bool __sepDefault__b_1, _Bool __sepOnOff__b_1, _Bool __sawNL__b_1){
     
    318296    ((void)((*___dst__R9sofstream_1).__sepCur__PCc_1) /* ?{} */);
    319297    {
    320         signed int _index14 = 0;
     298        signed int _index14 = ((signed int )0);
    321299        for (;(_index14<((signed int )__sepSize__C13e__anonymous0_1));((void)(++_index14))) {
    322300            ((void)((*((char *)(&(*___dst__R9sofstream_1).__separator__A0c_1[((signed long int )_index14)])))) /* ?{} */);
     
    324302
    325303    }
    326 
    327     {
    328         signed int _index15 = 0;
     304    {
     305        signed int _index15 = ((signed int )0);
    329306        for (;(_index15<((signed int )__sepSize__C13e__anonymous0_1));((void)(++_index15))) {
    330307            ((void)((*((char *)(&(*___dst__R9sofstream_1).__tupleSeparator__A0c_1[((signed long int )_index15)])))) /* ?{} */);
     
    332309
    333310    }
    334 
    335311}
    336312static inline void ___constructor__F_R9sofstreamPvbbbPCc_autogen___1(struct ofstream *___dst__R9sofstream_1, void *__file__Pv_1, _Bool __sepDefault__b_1, _Bool __sepOnOff__b_1, _Bool __sawNL__b_1, const char *__sepCur__PCc_1){
     
    341317    ((void)((*___dst__R9sofstream_1).__sepCur__PCc_1=__sepCur__PCc_1) /* ?{} */);
    342318    {
    343         signed int _index16 = 0;
     319        signed int _index16 = ((signed int )0);
    344320        for (;(_index16<((signed int )__sepSize__C13e__anonymous0_1));((void)(++_index16))) {
    345321            ((void)((*((char *)(&(*___dst__R9sofstream_1).__separator__A0c_1[((signed long int )_index16)])))) /* ?{} */);
     
    347323
    348324    }
    349 
    350     {
    351         signed int _index17 = 0;
     325    {
     326        signed int _index17 = ((signed int )0);
    352327        for (;(_index17<((signed int )__sepSize__C13e__anonymous0_1));((void)(++_index17))) {
    353328            ((void)((*((char *)(&(*___dst__R9sofstream_1).__tupleSeparator__A0c_1[((signed long int )_index17)])))) /* ?{} */);
     
    355330
    356331    }
    357 
    358332}
    359333static inline void ___constructor__F_R9sofstreamPvbbbPCcA0c_autogen___1(struct ofstream *___dst__R9sofstream_1, void *__file__Pv_1, _Bool __sepDefault__b_1, _Bool __sepOnOff__b_1, _Bool __sawNL__b_1, const char *__sepCur__PCc_1, char __separator__A0c_1[((unsigned long int )__sepSize__C13e__anonymous0_1)]){
     
    364338    ((void)((*___dst__R9sofstream_1).__sepCur__PCc_1=__sepCur__PCc_1) /* ?{} */);
    365339    {
    366         signed int _index18 = 0;
     340        signed int _index18 = ((signed int )0);
    367341        for (;(_index18<((signed int )__sepSize__C13e__anonymous0_1));((void)(++_index18))) {
    368342            ((void)((*((char *)(&(*___dst__R9sofstream_1).__separator__A0c_1[((signed long int )_index18)])))=__separator__A0c_1[((signed long int )_index18)]) /* ?{} */);
     
    370344
    371345    }
    372 
    373     {
    374         signed int _index19 = 0;
     346    {
     347        signed int _index19 = ((signed int )0);
    375348        for (;(_index19<((signed int )__sepSize__C13e__anonymous0_1));((void)(++_index19))) {
    376349            ((void)((*((char *)(&(*___dst__R9sofstream_1).__tupleSeparator__A0c_1[((signed long int )_index19)])))) /* ?{} */);
     
    378351
    379352    }
    380 
    381353}
    382354static inline void ___constructor__F_R9sofstreamPvbbbPCcA0cA0c_autogen___1(struct ofstream *___dst__R9sofstream_1, void *__file__Pv_1, _Bool __sepDefault__b_1, _Bool __sepOnOff__b_1, _Bool __sawNL__b_1, const char *__sepCur__PCc_1, char __separator__A0c_1[((unsigned long int )__sepSize__C13e__anonymous0_1)], char __tupleSeparator__A0c_1[((unsigned long int )__sepSize__C13e__anonymous0_1)]){
     
    387359    ((void)((*___dst__R9sofstream_1).__sepCur__PCc_1=__sepCur__PCc_1) /* ?{} */);
    388360    {
    389         signed int _index20 = 0;
     361        signed int _index20 = ((signed int )0);
    390362        for (;(_index20<((signed int )__sepSize__C13e__anonymous0_1));((void)(++_index20))) {
    391363            ((void)((*((char *)(&(*___dst__R9sofstream_1).__separator__A0c_1[((signed long int )_index20)])))=__separator__A0c_1[((signed long int )_index20)]) /* ?{} */);
     
    393365
    394366    }
    395 
    396     {
    397         signed int _index21 = 0;
     367    {
     368        signed int _index21 = ((signed int )0);
    398369        for (;(_index21<((signed int )__sepSize__C13e__anonymous0_1));((void)(++_index21))) {
    399370            ((void)((*((char *)(&(*___dst__R9sofstream_1).__tupleSeparator__A0c_1[((signed long int )_index21)])))=__tupleSeparator__A0c_1[((signed long int )_index21)]) /* ?{} */);
     
    401372
    402373    }
    403 
    404374}
    405375_Bool __sepPrt__Fb_P9sofstream__1(struct ofstream *__anonymous_object1294);
     
    434404static inline void ___destructor__F_R9sifstream_autogen___1(struct ifstream *___dst__R9sifstream_1);
    435405static inline struct ifstream ___operator_assign__F9sifstream_R9sifstream9sifstream_autogen___1(struct ifstream *___dst__R9sifstream_1, struct ifstream ___src__9sifstream_1);
    436 static inline void ___constructor__F_R9sifstreamPv_autogen___1(struct ifstream *___dst__R9sifstream_1, void *__file__Pv_1);
    437406static inline void ___constructor__F_R9sifstream_autogen___1(struct ifstream *___dst__R9sifstream_1){
    438407    ((void)((*___dst__R9sifstream_1).__file__Pv_1) /* ?{} */);
     
    447416    struct ifstream ___ret__9sifstream_1;
    448417    ((void)((*___dst__R9sifstream_1).__file__Pv_1=___src__9sifstream_1.__file__Pv_1));
    449     ((void)___constructor__F_R9sifstream9sifstream_autogen___1((&___ret__9sifstream_1), (*___dst__R9sifstream_1)));
    450     return ___ret__9sifstream_1;
     418    ((void)___constructor__F_R9sifstream9sifstream_autogen___1((&___ret__9sifstream_1), ___src__9sifstream_1));
     419    return ((struct ifstream )___ret__9sifstream_1);
    451420}
    452421static inline void ___constructor__F_R9sifstreamPv_autogen___1(struct ifstream *___dst__R9sifstream_1, void *__file__Pv_1){
     
    466435    struct ofstream *_tmp_cp_ret2;
    467436    __attribute__ ((unused)) struct ofstream *_thunk0(struct ofstream *_p0){
    468         return __endl__A0_1_0_0___sepPrt__PFb_Pd0___sepReset__PF_Pd0___sepReset__PF_Pd0b___sepGetCur__PFPCc_Pd0___sepSetCur__PF_Pd0PCc___getNL__PFb_Pd0___setNL__PF_Pd0b___sepOn__PF_Pd0___sepOff__PF_Pd0___sepDisable__PFb_Pd0___sepEnable__PFb_Pd0___sepGet__PFPCc_Pd0___sepSet__PF_Pd0PCc___sepGetTuple__PFPCc_Pd0___sepSetTuple__PF_Pd0PCc___fail__PFi_Pd0___flush__PFi_Pd0___open__PF_Pd0PCcPCc___close__PF_Pd0___write__PFPd0_Pd0PCcUl___fmt__PFi_Pd0PCc__FPd0_Pd0__1(((_Bool (*)(void *__anonymous_object1322))__sepPrt__Fb_P9sofstream__1), ((void (*)(void *__anonymous_object1323))__sepReset__F_P9sofstream__1), ((void (*)(void *__anonymous_object1324, _Bool __anonymous_object1325))__sepReset__F_P9sofstreamb__1), ((const char *(*)(void *__anonymous_object1326))__sepGetCur__FPCc_P9sofstream__1), ((void (*)(void *__anonymous_object1327, const char *__anonymous_object1328))__sepSetCur__F_P9sofstreamPCc__1), ((_Bool (*)(void *__anonymous_object1329))__getNL__Fb_P9sofstream__1), ((void (*)(void *__anonymous_object1330, _Bool __anonymous_object1331))__setNL__F_P9sofstreamb__1), ((void (*)(void *__anonymous_object1332))__sepOn__F_P9sofstream__1), ((void (*)(void *__anonymous_object1333))__sepOff__F_P9sofstream__1), ((_Bool (*)(void *__anonymous_object1334))__sepDisable__Fb_P9sofstream__1), ((_Bool (*)(void *__anonymous_object1335))__sepEnable__Fb_P9sofstream__1), ((const char *(*)(void *__anonymous_object1336))__sepGet__FPCc_P9sofstream__1), ((void (*)(void *__anonymous_object1337, const char *__anonymous_object1338))__sepSet__F_P9sofstreamPCc__1), ((const char *(*)(void *__anonymous_object1339))__sepGetTuple__FPCc_P9sofstream__1), ((void (*)(void *__anonymous_object1340, const char *__anonymous_object1341))__sepSetTuple__F_P9sofstreamPCc__1), ((signed int (*)(void *__anonymous_object1342))__fail__Fi_P9sofstream__1), ((signed int (*)(void *__anonymous_object1343))__flush__Fi_P9sofstream__1), ((void (*)(void *__os__P7tostype_1, const char *__name__PCc_1, const char *__mode__PCc_1))__open__F_P9sofstreamPCcPCc__1), ((void (*)(void *__os__P7tostype_1))__close__F_P9sofstream__1), ((void *(*)(void *__anonymous_object1344, const char *__anonymous_object1345, unsigned long int __anonymous_object1346))__write__FP9sofstream_P9sofstreamPCcUl__1), ((signed int (*)(void *__anonymous_object1347, const char *__fmt__PCc_1, ...))__fmt__Fi_P9sofstreamPCc__1), ((void *)_p0));
    469     }
    470     ((void)(((void)(_tmp_cp_ret2=___operator_bitor__A0_1_0_0___sepPrt__PFb_Pd0___sepReset__PF_Pd0___sepReset__PF_Pd0b___sepGetCur__PFPCc_Pd0___sepSetCur__PF_Pd0PCc___getNL__PFb_Pd0___setNL__PF_Pd0b___sepOn__PF_Pd0___sepOff__PF_Pd0___sepDisable__PFb_Pd0___sepEnable__PFb_Pd0___sepGet__PFPCc_Pd0___sepSet__PF_Pd0PCc___sepGetTuple__PFPCc_Pd0___sepSetTuple__PF_Pd0PCc___fail__PFi_Pd0___flush__PFi_Pd0___open__PF_Pd0PCcPCc___close__PF_Pd0___write__PFPd0_Pd0PCcUl___fmt__PFi_Pd0PCc__FPd0_Pd0PFPd0_Pd0___1(((_Bool (*)(void *__anonymous_object1348))__sepPrt__Fb_P9sofstream__1), ((void (*)(void *__anonymous_object1349))__sepReset__F_P9sofstream__1), ((void (*)(void *__anonymous_object1350, _Bool __anonymous_object1351))__sepReset__F_P9sofstreamb__1), ((const char *(*)(void *__anonymous_object1352))__sepGetCur__FPCc_P9sofstream__1), ((void (*)(void *__anonymous_object1353, const char *__anonymous_object1354))__sepSetCur__F_P9sofstreamPCc__1), ((_Bool (*)(void *__anonymous_object1355))__getNL__Fb_P9sofstream__1), ((void (*)(void *__anonymous_object1356, _Bool __anonymous_object1357))__setNL__F_P9sofstreamb__1), ((void (*)(void *__anonymous_object1358))__sepOn__F_P9sofstream__1), ((void (*)(void *__anonymous_object1359))__sepOff__F_P9sofstream__1), ((_Bool (*)(void *__anonymous_object1360))__sepDisable__Fb_P9sofstream__1), ((_Bool (*)(void *__anonymous_object1361))__sepEnable__Fb_P9sofstream__1), ((const char *(*)(void *__anonymous_object1362))__sepGet__FPCc_P9sofstream__1), ((void (*)(void *__anonymous_object1363, const char *__anonymous_object1364))__sepSet__F_P9sofstreamPCc__1), ((const char *(*)(void *__anonymous_object1365))__sepGetTuple__FPCc_P9sofstream__1), ((void (*)(void *__anonymous_object1366, const char *__anonymous_object1367))__sepSetTuple__F_P9sofstreamPCc__1), ((signed int (*)(void *__anonymous_object1368))__fail__Fi_P9sofstream__1), ((signed int (*)(void *__anonymous_object1369))__flush__Fi_P9sofstream__1), ((void (*)(void *__os__P7tostype_1, const char *__name__PCc_1, const char *__mode__PCc_1))__open__F_P9sofstreamPCcPCc__1), ((void (*)(void *__os__P7tostype_1))__close__F_P9sofstream__1), ((void *(*)(void *__anonymous_object1370, const char *__anonymous_object1371, unsigned long int __anonymous_object1372))__write__FP9sofstream_P9sofstreamPCcUl__1), ((signed int (*)(void *__anonymous_object1373, const char *__fmt__PCc_1, ...))__fmt__Fi_P9sofstreamPCc__1), ((void *)(((void)(_tmp_cp_ret1=___operator_bitor__A0_1_0_0___sepPrt__PFb_Pd0___sepReset__PF_Pd0___sepReset__PF_Pd0b___sepGetCur__PFPCc_Pd0___sepSetCur__PF_Pd0PCc___getNL__PFb_Pd0___setNL__PF_Pd0b___sepOn__PF_Pd0___sepOff__PF_Pd0___sepDisable__PFb_Pd0___sepEnable__PFb_Pd0___sepGet__PFPCc_Pd0___sepSet__PF_Pd0PCc___sepGetTuple__PFPCc_Pd0___sepSetTuple__PF_Pd0PCc___fail__PFi_Pd0___flush__PFi_Pd0___open__PF_Pd0PCcPCc___close__PF_Pd0___write__PFPd0_Pd0PCcUl___fmt__PFi_Pd0PCc__FPd0_Pd0c__1(((_Bool (*)(void *__anonymous_object1374))__sepPrt__Fb_P9sofstream__1), ((void (*)(void *__anonymous_object1375))__sepReset__F_P9sofstream__1), ((void (*)(void *__anonymous_object1376, _Bool __anonymous_object1377))__sepReset__F_P9sofstreamb__1), ((const char *(*)(void *__anonymous_object1378))__sepGetCur__FPCc_P9sofstream__1), ((void (*)(void *__anonymous_object1379, const char *__anonymous_object1380))__sepSetCur__F_P9sofstreamPCc__1), ((_Bool (*)(void *__anonymous_object1381))__getNL__Fb_P9sofstream__1), ((void (*)(void *__anonymous_object1382, _Bool __anonymous_object1383))__setNL__F_P9sofstreamb__1), ((void (*)(void *__anonymous_object1384))__sepOn__F_P9sofstream__1), ((void (*)(void *__anonymous_object1385))__sepOff__F_P9sofstream__1), ((_Bool (*)(void *__anonymous_object1386))__sepDisable__Fb_P9sofstream__1), ((_Bool (*)(void *__anonymous_object1387))__sepEnable__Fb_P9sofstream__1), ((const char *(*)(void *__anonymous_object1388))__sepGet__FPCc_P9sofstream__1), ((void (*)(void *__anonymous_object1389, const char *__anonymous_object1390))__sepSet__F_P9sofstreamPCc__1), ((const char *(*)(void *__anonymous_object1391))__sepGetTuple__FPCc_P9sofstream__1), ((void (*)(void *__anonymous_object1392, const char *__anonymous_object1393))__sepSetTuple__F_P9sofstreamPCc__1), ((signed int (*)(void *__anonymous_object1394))__fail__Fi_P9sofstream__1), ((signed int (*)(void *__anonymous_object1395))__flush__Fi_P9sofstream__1), ((void (*)(void *__os__P7tostype_1, const char *__name__PCc_1, const char *__mode__PCc_1))__open__F_P9sofstreamPCcPCc__1), ((void (*)(void *__os__P7tostype_1))__close__F_P9sofstream__1), ((void *(*)(void *__anonymous_object1396, const char *__anonymous_object1397, unsigned long int __anonymous_object1398))__write__FP9sofstream_P9sofstreamPCcUl__1), ((signed int (*)(void *__anonymous_object1399, const char *__fmt__PCc_1, ...))__fmt__Fi_P9sofstreamPCc__1), ((void *)(((void)(_tmp_cp_ret0=___operator_bitor__A0_1_0_0___sepPrt__PFb_Pd0___sepReset__PF_Pd0___sepReset__PF_Pd0b___sepGetCur__PFPCc_Pd0___sepSetCur__PF_Pd0PCc___getNL__PFb_Pd0___setNL__PF_Pd0b___sepOn__PF_Pd0___sepOff__PF_Pd0___sepDisable__PFb_Pd0___sepEnable__PFb_Pd0___sepGet__PFPCc_Pd0___sepSet__PF_Pd0PCc___sepGetTuple__PFPCc_Pd0___sepSetTuple__PF_Pd0PCc___fail__PFi_Pd0___flush__PFi_Pd0___open__PF_Pd0PCcPCc___close__PF_Pd0___write__PFPd0_Pd0PCcUl___fmt__PFi_Pd0PCc__FPd0_Pd0PCc__1(((_Bool (*)(void *__anonymous_object1400))__sepPrt__Fb_P9sofstream__1), ((void (*)(void *__anonymous_object1401))__sepReset__F_P9sofstream__1), ((void (*)(void *__anonymous_object1402, _Bool __anonymous_object1403))__sepReset__F_P9sofstreamb__1), ((const char *(*)(void *__anonymous_object1404))__sepGetCur__FPCc_P9sofstream__1), ((void (*)(void *__anonymous_object1405, const char *__anonymous_object1406))__sepSetCur__F_P9sofstreamPCc__1), ((_Bool (*)(void *__anonymous_object1407))__getNL__Fb_P9sofstream__1), ((void (*)(void *__anonymous_object1408, _Bool __anonymous_object1409))__setNL__F_P9sofstreamb__1), ((void (*)(void *__anonymous_object1410))__sepOn__F_P9sofstream__1), ((void (*)(void *__anonymous_object1411))__sepOff__F_P9sofstream__1), ((_Bool (*)(void *__anonymous_object1412))__sepDisable__Fb_P9sofstream__1), ((_Bool (*)(void *__anonymous_object1413))__sepEnable__Fb_P9sofstream__1), ((const char *(*)(void *__anonymous_object1414))__sepGet__FPCc_P9sofstream__1), ((void (*)(void *__anonymous_object1415, const char *__anonymous_object1416))__sepSet__F_P9sofstreamPCc__1), ((const char *(*)(void *__anonymous_object1417))__sepGetTuple__FPCc_P9sofstream__1), ((void (*)(void *__anonymous_object1418, const char *__anonymous_object1419))__sepSetTuple__F_P9sofstreamPCc__1), ((signed int (*)(void *__anonymous_object1420))__fail__Fi_P9sofstream__1), ((signed int (*)(void *__anonymous_object1421))__flush__Fi_P9sofstream__1), ((void (*)(void *__os__P7tostype_1, const char *__name__PCc_1, const char *__mode__PCc_1))__open__F_P9sofstreamPCcPCc__1), ((void (*)(void *__os__P7tostype_1))__close__F_P9sofstream__1), ((void *(*)(void *__anonymous_object1422, const char *__anonymous_object1423, unsigned long int __anonymous_object1424))__write__FP9sofstream_P9sofstreamPCcUl__1), ((signed int (*)(void *__anonymous_object1425, const char *__fmt__PCc_1, ...))__fmt__Fi_P9sofstreamPCc__1), ((void *)__sout__P9sofstream_1), "char "))) , _tmp_cp_ret0)), __v__c_1))) , _tmp_cp_ret1)), ((void *(*)(void *__anonymous_object1426))(&_thunk0))))) , _tmp_cp_ret2));
     437        return __endl__A0_1_0_0___sepPrt__PFb_Pd0___sepReset__PF_Pd0___sepReset__PF_Pd0b___sepGetCur__PFPCc_Pd0___sepSetCur__PF_Pd0PCc___getNL__PFb_Pd0___setNL__PF_Pd0b___sepOn__PF_Pd0___sepOff__PF_Pd0___sepDisable__PFb_Pd0___sepEnable__PFb_Pd0___sepGet__PFPCc_Pd0___sepSet__PF_Pd0PCc___sepGetTuple__PFPCc_Pd0___sepSetTuple__PF_Pd0PCc___fail__PFi_Pd0___flush__PFi_Pd0___open__PF_Pd0PCcPCc___close__PF_Pd0___write__PFPd0_Pd0PCcUl___fmt__PFi_Pd0PCc__FPd0_Pd0__1(((_Bool (*)(void *__anonymous_object1322))__sepPrt__Fb_P9sofstream__1), ((void (*)(void *__anonymous_object1323))__sepReset__F_P9sofstream__1), ((void (*)(void *__anonymous_object1324, _Bool __anonymous_object1325))__sepReset__F_P9sofstreamb__1), ((const char *(*)(void *__anonymous_object1326))__sepGetCur__FPCc_P9sofstream__1), ((void (*)(void *__anonymous_object1327, const char *__anonymous_object1328))__sepSetCur__F_P9sofstreamPCc__1), ((_Bool (*)(void *__anonymous_object1329))__getNL__Fb_P9sofstream__1), ((void (*)(void *__anonymous_object1330, _Bool __anonymous_object1331))__setNL__F_P9sofstreamb__1), ((void (*)(void *__anonymous_object1332))__sepOn__F_P9sofstream__1), ((void (*)(void *__anonymous_object1333))__sepOff__F_P9sofstream__1), ((_Bool (*)(void *__anonymous_object1334))__sepDisable__Fb_P9sofstream__1), ((_Bool (*)(void *__anonymous_object1335))__sepEnable__Fb_P9sofstream__1), ((const char *(*)(void *__anonymous_object1336))__sepGet__FPCc_P9sofstream__1), ((void (*)(void *__anonymous_object1337, const char *__anonymous_object1338))__sepSet__F_P9sofstreamPCc__1), ((const char *(*)(void *__anonymous_object1339))__sepGetTuple__FPCc_P9sofstream__1), ((void (*)(void *__anonymous_object1340, const char *__anonymous_object1341))__sepSetTuple__F_P9sofstreamPCc__1), ((signed int (*)(void *__anonymous_object1342))__fail__Fi_P9sofstream__1), ((signed int (*)(void *__anonymous_object1343))__flush__Fi_P9sofstream__1), ((void (*)(void *__os__P7tostype_1, const char *__name__PCc_1, const char *__mode__PCc_1))__open__F_P9sofstreamPCcPCc__1), ((void (*)(void *__os__P7tostype_1))__close__F_P9sofstream__1), ((void *(*)(void *__anonymous_object1344, const char *__anonymous_object1345, unsigned long int __anonymous_object1346))__write__FP9sofstream_P9sofstreamPCcUl__1), ((signed int (*)(void *__anonymous_object1347, const char *__fmt__PCc_1, ...))__fmt__Fi_P9sofstreamPCc__1), _p0);
     438    }
     439    ((void)(((void)(_tmp_cp_ret2=___operator_bitor__A0_1_0_0___sepPrt__PFb_Pd0___sepReset__PF_Pd0___sepReset__PF_Pd0b___sepGetCur__PFPCc_Pd0___sepSetCur__PF_Pd0PCc___getNL__PFb_Pd0___setNL__PF_Pd0b___sepOn__PF_Pd0___sepOff__PF_Pd0___sepDisable__PFb_Pd0___sepEnable__PFb_Pd0___sepGet__PFPCc_Pd0___sepSet__PF_Pd0PCc___sepGetTuple__PFPCc_Pd0___sepSetTuple__PF_Pd0PCc___fail__PFi_Pd0___flush__PFi_Pd0___open__PF_Pd0PCcPCc___close__PF_Pd0___write__PFPd0_Pd0PCcUl___fmt__PFi_Pd0PCc__FPd0_Pd0PFPd0_Pd0___1(((_Bool (*)(void *__anonymous_object1348))__sepPrt__Fb_P9sofstream__1), ((void (*)(void *__anonymous_object1349))__sepReset__F_P9sofstream__1), ((void (*)(void *__anonymous_object1350, _Bool __anonymous_object1351))__sepReset__F_P9sofstreamb__1), ((const char *(*)(void *__anonymous_object1352))__sepGetCur__FPCc_P9sofstream__1), ((void (*)(void *__anonymous_object1353, const char *__anonymous_object1354))__sepSetCur__F_P9sofstreamPCc__1), ((_Bool (*)(void *__anonymous_object1355))__getNL__Fb_P9sofstream__1), ((void (*)(void *__anonymous_object1356, _Bool __anonymous_object1357))__setNL__F_P9sofstreamb__1), ((void (*)(void *__anonymous_object1358))__sepOn__F_P9sofstream__1), ((void (*)(void *__anonymous_object1359))__sepOff__F_P9sofstream__1), ((_Bool (*)(void *__anonymous_object1360))__sepDisable__Fb_P9sofstream__1), ((_Bool (*)(void *__anonymous_object1361))__sepEnable__Fb_P9sofstream__1), ((const char *(*)(void *__anonymous_object1362))__sepGet__FPCc_P9sofstream__1), ((void (*)(void *__anonymous_object1363, const char *__anonymous_object1364))__sepSet__F_P9sofstreamPCc__1), ((const char *(*)(void *__anonymous_object1365))__sepGetTuple__FPCc_P9sofstream__1), ((void (*)(void *__anonymous_object1366, const char *__anonymous_object1367))__sepSetTuple__F_P9sofstreamPCc__1), ((signed int (*)(void *__anonymous_object1368))__fail__Fi_P9sofstream__1), ((signed int (*)(void *__anonymous_object1369))__flush__Fi_P9sofstream__1), ((void (*)(void *__os__P7tostype_1, const char *__name__PCc_1, const char *__mode__PCc_1))__open__F_P9sofstreamPCcPCc__1), ((void (*)(void *__os__P7tostype_1))__close__F_P9sofstream__1), ((void *(*)(void *__anonymous_object1370, const char *__anonymous_object1371, unsigned long int __anonymous_object1372))__write__FP9sofstream_P9sofstreamPCcUl__1), ((signed int (*)(void *__anonymous_object1373, const char *__fmt__PCc_1, ...))__fmt__Fi_P9sofstreamPCc__1), (((void)(_tmp_cp_ret1=___operator_bitor__A0_1_0_0___sepPrt__PFb_Pd0___sepReset__PF_Pd0___sepReset__PF_Pd0b___sepGetCur__PFPCc_Pd0___sepSetCur__PF_Pd0PCc___getNL__PFb_Pd0___setNL__PF_Pd0b___sepOn__PF_Pd0___sepOff__PF_Pd0___sepDisable__PFb_Pd0___sepEnable__PFb_Pd0___sepGet__PFPCc_Pd0___sepSet__PF_Pd0PCc___sepGetTuple__PFPCc_Pd0___sepSetTuple__PF_Pd0PCc___fail__PFi_Pd0___flush__PFi_Pd0___open__PF_Pd0PCcPCc___close__PF_Pd0___write__PFPd0_Pd0PCcUl___fmt__PFi_Pd0PCc__FPd0_Pd0c__1(((_Bool (*)(void *__anonymous_object1374))__sepPrt__Fb_P9sofstream__1), ((void (*)(void *__anonymous_object1375))__sepReset__F_P9sofstream__1), ((void (*)(void *__anonymous_object1376, _Bool __anonymous_object1377))__sepReset__F_P9sofstreamb__1), ((const char *(*)(void *__anonymous_object1378))__sepGetCur__FPCc_P9sofstream__1), ((void (*)(void *__anonymous_object1379, const char *__anonymous_object1380))__sepSetCur__F_P9sofstreamPCc__1), ((_Bool (*)(void *__anonymous_object1381))__getNL__Fb_P9sofstream__1), ((void (*)(void *__anonymous_object1382, _Bool __anonymous_object1383))__setNL__F_P9sofstreamb__1), ((void (*)(void *__anonymous_object1384))__sepOn__F_P9sofstream__1), ((void (*)(void *__anonymous_object1385))__sepOff__F_P9sofstream__1), ((_Bool (*)(void *__anonymous_object1386))__sepDisable__Fb_P9sofstream__1), ((_Bool (*)(void *__anonymous_object1387))__sepEnable__Fb_P9sofstream__1), ((const char *(*)(void *__anonymous_object1388))__sepGet__FPCc_P9sofstream__1), ((void (*)(void *__anonymous_object1389, const char *__anonymous_object1390))__sepSet__F_P9sofstreamPCc__1), ((const char *(*)(void *__anonymous_object1391))__sepGetTuple__FPCc_P9sofstream__1), ((void (*)(void *__anonymous_object1392, const char *__anonymous_object1393))__sepSetTuple__F_P9sofstreamPCc__1), ((signed int (*)(void *__anonymous_object1394))__fail__Fi_P9sofstream__1), ((signed int (*)(void *__anonymous_object1395))__flush__Fi_P9sofstream__1), ((void (*)(void *__os__P7tostype_1, const char *__name__PCc_1, const char *__mode__PCc_1))__open__F_P9sofstreamPCcPCc__1), ((void (*)(void *__os__P7tostype_1))__close__F_P9sofstream__1), ((void *(*)(void *__anonymous_object1396, const char *__anonymous_object1397, unsigned long int __anonymous_object1398))__write__FP9sofstream_P9sofstreamPCcUl__1), ((signed int (*)(void *__anonymous_object1399, const char *__fmt__PCc_1, ...))__fmt__Fi_P9sofstreamPCc__1), (((void)(_tmp_cp_ret0=___operator_bitor__A0_1_0_0___sepPrt__PFb_Pd0___sepReset__PF_Pd0___sepReset__PF_Pd0b___sepGetCur__PFPCc_Pd0___sepSetCur__PF_Pd0PCc___getNL__PFb_Pd0___setNL__PF_Pd0b___sepOn__PF_Pd0___sepOff__PF_Pd0___sepDisable__PFb_Pd0___sepEnable__PFb_Pd0___sepGet__PFPCc_Pd0___sepSet__PF_Pd0PCc___sepGetTuple__PFPCc_Pd0___sepSetTuple__PF_Pd0PCc___fail__PFi_Pd0___flush__PFi_Pd0___open__PF_Pd0PCcPCc___close__PF_Pd0___write__PFPd0_Pd0PCcUl___fmt__PFi_Pd0PCc__FPd0_Pd0PCc__1(((_Bool (*)(void *__anonymous_object1400))__sepPrt__Fb_P9sofstream__1), ((void (*)(void *__anonymous_object1401))__sepReset__F_P9sofstream__1), ((void (*)(void *__anonymous_object1402, _Bool __anonymous_object1403))__sepReset__F_P9sofstreamb__1), ((const char *(*)(void *__anonymous_object1404))__sepGetCur__FPCc_P9sofstream__1), ((void (*)(void *__anonymous_object1405, const char *__anonymous_object1406))__sepSetCur__F_P9sofstreamPCc__1), ((_Bool (*)(void *__anonymous_object1407))__getNL__Fb_P9sofstream__1), ((void (*)(void *__anonymous_object1408, _Bool __anonymous_object1409))__setNL__F_P9sofstreamb__1), ((void (*)(void *__anonymous_object1410))__sepOn__F_P9sofstream__1), ((void (*)(void *__anonymous_object1411))__sepOff__F_P9sofstream__1), ((_Bool (*)(void *__anonymous_object1412))__sepDisable__Fb_P9sofstream__1), ((_Bool (*)(void *__anonymous_object1413))__sepEnable__Fb_P9sofstream__1), ((const char *(*)(void *__anonymous_object1414))__sepGet__FPCc_P9sofstream__1), ((void (*)(void *__anonymous_object1415, const char *__anonymous_object1416))__sepSet__F_P9sofstreamPCc__1), ((const char *(*)(void *__anonymous_object1417))__sepGetTuple__FPCc_P9sofstream__1), ((void (*)(void *__anonymous_object1418, const char *__anonymous_object1419))__sepSetTuple__F_P9sofstreamPCc__1), ((signed int (*)(void *__anonymous_object1420))__fail__Fi_P9sofstream__1), ((signed int (*)(void *__anonymous_object1421))__flush__Fi_P9sofstream__1), ((void (*)(void *__os__P7tostype_1, const char *__name__PCc_1, const char *__mode__PCc_1))__open__F_P9sofstreamPCcPCc__1), ((void (*)(void *__os__P7tostype_1))__close__F_P9sofstream__1), ((void *(*)(void *__anonymous_object1422, const char *__anonymous_object1423, unsigned long int __anonymous_object1424))__write__FP9sofstream_P9sofstreamPCcUl__1), ((signed int (*)(void *__anonymous_object1425, const char *__fmt__PCc_1, ...))__fmt__Fi_P9sofstreamPCc__1), __sout__P9sofstream_1, "char "))) , _tmp_cp_ret0), __v__c_1))) , _tmp_cp_ret1), ((void *(*)(void *__anonymous_object1426))(&_thunk0))))) , _tmp_cp_ret2));
    471440    ((void)(_tmp_cp_ret0) /* ^?{} */);
    472441    ((void)(_tmp_cp_ret1) /* ^?{} */);
     
    478447    struct ofstream *_tmp_cp_ret5;
    479448    __attribute__ ((unused)) struct ofstream *_thunk1(struct ofstream *_p0){
    480         return __endl__A0_1_0_0___sepPrt__PFb_Pd0___sepReset__PF_Pd0___sepReset__PF_Pd0b___sepGetCur__PFPCc_Pd0___sepSetCur__PF_Pd0PCc___getNL__PFb_Pd0___setNL__PF_Pd0b___sepOn__PF_Pd0___sepOff__PF_Pd0___sepDisable__PFb_Pd0___sepEnable__PFb_Pd0___sepGet__PFPCc_Pd0___sepSet__PF_Pd0PCc___sepGetTuple__PFPCc_Pd0___sepSetTuple__PF_Pd0PCc___fail__PFi_Pd0___flush__PFi_Pd0___open__PF_Pd0PCcPCc___close__PF_Pd0___write__PFPd0_Pd0PCcUl___fmt__PFi_Pd0PCc__FPd0_Pd0__1(((_Bool (*)(void *__anonymous_object1427))__sepPrt__Fb_P9sofstream__1), ((void (*)(void *__anonymous_object1428))__sepReset__F_P9sofstream__1), ((void (*)(void *__anonymous_object1429, _Bool __anonymous_object1430))__sepReset__F_P9sofstreamb__1), ((const char *(*)(void *__anonymous_object1431))__sepGetCur__FPCc_P9sofstream__1), ((void (*)(void *__anonymous_object1432, const char *__anonymous_object1433))__sepSetCur__F_P9sofstreamPCc__1), ((_Bool (*)(void *__anonymous_object1434))__getNL__Fb_P9sofstream__1), ((void (*)(void *__anonymous_object1435, _Bool __anonymous_object1436))__setNL__F_P9sofstreamb__1), ((void (*)(void *__anonymous_object1437))__sepOn__F_P9sofstream__1), ((void (*)(void *__anonymous_object1438))__sepOff__F_P9sofstream__1), ((_Bool (*)(void *__anonymous_object1439))__sepDisable__Fb_P9sofstream__1), ((_Bool (*)(void *__anonymous_object1440))__sepEnable__Fb_P9sofstream__1), ((const char *(*)(void *__anonymous_object1441))__sepGet__FPCc_P9sofstream__1), ((void (*)(void *__anonymous_object1442, const char *__anonymous_object1443))__sepSet__F_P9sofstreamPCc__1), ((const char *(*)(void *__anonymous_object1444))__sepGetTuple__FPCc_P9sofstream__1), ((void (*)(void *__anonymous_object1445, const char *__anonymous_object1446))__sepSetTuple__F_P9sofstreamPCc__1), ((signed int (*)(void *__anonymous_object1447))__fail__Fi_P9sofstream__1), ((signed int (*)(void *__anonymous_object1448))__flush__Fi_P9sofstream__1), ((void (*)(void *__os__P7tostype_1, const char *__name__PCc_1, const char *__mode__PCc_1))__open__F_P9sofstreamPCcPCc__1), ((void (*)(void *__os__P7tostype_1))__close__F_P9sofstream__1), ((void *(*)(void *__anonymous_object1449, const char *__anonymous_object1450, unsigned long int __anonymous_object1451))__write__FP9sofstream_P9sofstreamPCcUl__1), ((signed int (*)(void *__anonymous_object1452, const char *__fmt__PCc_1, ...))__fmt__Fi_P9sofstreamPCc__1), ((void *)_p0));
    481     }
    482     ((void)(((void)(_tmp_cp_ret5=___operator_bitor__A0_1_0_0___sepPrt__PFb_Pd0___sepReset__PF_Pd0___sepReset__PF_Pd0b___sepGetCur__PFPCc_Pd0___sepSetCur__PF_Pd0PCc___getNL__PFb_Pd0___setNL__PF_Pd0b___sepOn__PF_Pd0___sepOff__PF_Pd0___sepDisable__PFb_Pd0___sepEnable__PFb_Pd0___sepGet__PFPCc_Pd0___sepSet__PF_Pd0PCc___sepGetTuple__PFPCc_Pd0___sepSetTuple__PF_Pd0PCc___fail__PFi_Pd0___flush__PFi_Pd0___open__PF_Pd0PCcPCc___close__PF_Pd0___write__PFPd0_Pd0PCcUl___fmt__PFi_Pd0PCc__FPd0_Pd0PFPd0_Pd0___1(((_Bool (*)(void *__anonymous_object1453))__sepPrt__Fb_P9sofstream__1), ((void (*)(void *__anonymous_object1454))__sepReset__F_P9sofstream__1), ((void (*)(void *__anonymous_object1455, _Bool __anonymous_object1456))__sepReset__F_P9sofstreamb__1), ((const char *(*)(void *__anonymous_object1457))__sepGetCur__FPCc_P9sofstream__1), ((void (*)(void *__anonymous_object1458, const char *__anonymous_object1459))__sepSetCur__F_P9sofstreamPCc__1), ((_Bool (*)(void *__anonymous_object1460))__getNL__Fb_P9sofstream__1), ((void (*)(void *__anonymous_object1461, _Bool __anonymous_object1462))__setNL__F_P9sofstreamb__1), ((void (*)(void *__anonymous_object1463))__sepOn__F_P9sofstream__1), ((void (*)(void *__anonymous_object1464))__sepOff__F_P9sofstream__1), ((_Bool (*)(void *__anonymous_object1465))__sepDisable__Fb_P9sofstream__1), ((_Bool (*)(void *__anonymous_object1466))__sepEnable__Fb_P9sofstream__1), ((const char *(*)(void *__anonymous_object1467))__sepGet__FPCc_P9sofstream__1), ((void (*)(void *__anonymous_object1468, const char *__anonymous_object1469))__sepSet__F_P9sofstreamPCc__1), ((const char *(*)(void *__anonymous_object1470))__sepGetTuple__FPCc_P9sofstream__1), ((void (*)(void *__anonymous_object1471, const char *__anonymous_object1472))__sepSetTuple__F_P9sofstreamPCc__1), ((signed int (*)(void *__anonymous_object1473))__fail__Fi_P9sofstream__1), ((signed int (*)(void *__anonymous_object1474))__flush__Fi_P9sofstream__1), ((void (*)(void *__os__P7tostype_1, const char *__name__PCc_1, const char *__mode__PCc_1))__open__F_P9sofstreamPCcPCc__1), ((void (*)(void *__os__P7tostype_1))__close__F_P9sofstream__1), ((void *(*)(void *__anonymous_object1475, const char *__anonymous_object1476, unsigned long int __anonymous_object1477))__write__FP9sofstream_P9sofstreamPCcUl__1), ((signed int (*)(void *__anonymous_object1478, const char *__fmt__PCc_1, ...))__fmt__Fi_P9sofstreamPCc__1), ((void *)(((void)(_tmp_cp_ret4=___operator_bitor__A0_1_0_0___sepPrt__PFb_Pd0___sepReset__PF_Pd0___sepReset__PF_Pd0b___sepGetCur__PFPCc_Pd0___sepSetCur__PF_Pd0PCc___getNL__PFb_Pd0___setNL__PF_Pd0b___sepOn__PF_Pd0___sepOff__PF_Pd0___sepDisable__PFb_Pd0___sepEnable__PFb_Pd0___sepGet__PFPCc_Pd0___sepSet__PF_Pd0PCc___sepGetTuple__PFPCc_Pd0___sepSetTuple__PF_Pd0PCc___fail__PFi_Pd0___flush__PFi_Pd0___open__PF_Pd0PCcPCc___close__PF_Pd0___write__PFPd0_Pd0PCcUl___fmt__PFi_Pd0PCc__FPd0_Pd0Sc__1(((_Bool (*)(void *__anonymous_object1479))__sepPrt__Fb_P9sofstream__1), ((void (*)(void *__anonymous_object1480))__sepReset__F_P9sofstream__1), ((void (*)(void *__anonymous_object1481, _Bool __anonymous_object1482))__sepReset__F_P9sofstreamb__1), ((const char *(*)(void *__anonymous_object1483))__sepGetCur__FPCc_P9sofstream__1), ((void (*)(void *__anonymous_object1484, const char *__anonymous_object1485))__sepSetCur__F_P9sofstreamPCc__1), ((_Bool (*)(void *__anonymous_object1486))__getNL__Fb_P9sofstream__1), ((void (*)(void *__anonymous_object1487, _Bool __anonymous_object1488))__setNL__F_P9sofstreamb__1), ((void (*)(void *__anonymous_object1489))__sepOn__F_P9sofstream__1), ((void (*)(void *__anonymous_object1490))__sepOff__F_P9sofstream__1), ((_Bool (*)(void *__anonymous_object1491))__sepDisable__Fb_P9sofstream__1), ((_Bool (*)(void *__anonymous_object1492))__sepEnable__Fb_P9sofstream__1), ((const char *(*)(void *__anonymous_object1493))__sepGet__FPCc_P9sofstream__1), ((void (*)(void *__anonymous_object1494, const char *__anonymous_object1495))__sepSet__F_P9sofstreamPCc__1), ((const char *(*)(void *__anonymous_object1496))__sepGetTuple__FPCc_P9sofstream__1), ((void (*)(void *__anonymous_object1497, const char *__anonymous_object1498))__sepSetTuple__F_P9sofstreamPCc__1), ((signed int (*)(void *__anonymous_object1499))__fail__Fi_P9sofstream__1), ((signed int (*)(void *__anonymous_object1500))__flush__Fi_P9sofstream__1), ((void (*)(void *__os__P7tostype_1, const char *__name__PCc_1, const char *__mode__PCc_1))__open__F_P9sofstreamPCcPCc__1), ((void (*)(void *__os__P7tostype_1))__close__F_P9sofstream__1), ((void *(*)(void *__anonymous_object1501, const char *__anonymous_object1502, unsigned long int __anonymous_object1503))__write__FP9sofstream_P9sofstreamPCcUl__1), ((signed int (*)(void *__anonymous_object1504, const char *__fmt__PCc_1, ...))__fmt__Fi_P9sofstreamPCc__1), ((void *)(((void)(_tmp_cp_ret3=___operator_bitor__A0_1_0_0___sepPrt__PFb_Pd0___sepReset__PF_Pd0___sepReset__PF_Pd0b___sepGetCur__PFPCc_Pd0___sepSetCur__PF_Pd0PCc___getNL__PFb_Pd0___setNL__PF_Pd0b___sepOn__PF_Pd0___sepOff__PF_Pd0___sepDisable__PFb_Pd0___sepEnable__PFb_Pd0___sepGet__PFPCc_Pd0___sepSet__PF_Pd0PCc___sepGetTuple__PFPCc_Pd0___sepSetTuple__PF_Pd0PCc___fail__PFi_Pd0___flush__PFi_Pd0___open__PF_Pd0PCcPCc___close__PF_Pd0___write__PFPd0_Pd0PCcUl___fmt__PFi_Pd0PCc__FPd0_Pd0PCc__1(((_Bool (*)(void *__anonymous_object1505))__sepPrt__Fb_P9sofstream__1), ((void (*)(void *__anonymous_object1506))__sepReset__F_P9sofstream__1), ((void (*)(void *__anonymous_object1507, _Bool __anonymous_object1508))__sepReset__F_P9sofstreamb__1), ((const char *(*)(void *__anonymous_object1509))__sepGetCur__FPCc_P9sofstream__1), ((void (*)(void *__anonymous_object1510, const char *__anonymous_object1511))__sepSetCur__F_P9sofstreamPCc__1), ((_Bool (*)(void *__anonymous_object1512))__getNL__Fb_P9sofstream__1), ((void (*)(void *__anonymous_object1513, _Bool __anonymous_object1514))__setNL__F_P9sofstreamb__1), ((void (*)(void *__anonymous_object1515))__sepOn__F_P9sofstream__1), ((void (*)(void *__anonymous_object1516))__sepOff__F_P9sofstream__1), ((_Bool (*)(void *__anonymous_object1517))__sepDisable__Fb_P9sofstream__1), ((_Bool (*)(void *__anonymous_object1518))__sepEnable__Fb_P9sofstream__1), ((const char *(*)(void *__anonymous_object1519))__sepGet__FPCc_P9sofstream__1), ((void (*)(void *__anonymous_object1520, const char *__anonymous_object1521))__sepSet__F_P9sofstreamPCc__1), ((const char *(*)(void *__anonymous_object1522))__sepGetTuple__FPCc_P9sofstream__1), ((void (*)(void *__anonymous_object1523, const char *__anonymous_object1524))__sepSetTuple__F_P9sofstreamPCc__1), ((signed int (*)(void *__anonymous_object1525))__fail__Fi_P9sofstream__1), ((signed int (*)(void *__anonymous_object1526))__flush__Fi_P9sofstream__1), ((void (*)(void *__os__P7tostype_1, const char *__name__PCc_1, const char *__mode__PCc_1))__open__F_P9sofstreamPCcPCc__1), ((void (*)(void *__os__P7tostype_1))__close__F_P9sofstream__1), ((void *(*)(void *__anonymous_object1527, const char *__anonymous_object1528, unsigned long int __anonymous_object1529))__write__FP9sofstream_P9sofstreamPCcUl__1), ((signed int (*)(void *__anonymous_object1530, const char *__fmt__PCc_1, ...))__fmt__Fi_P9sofstreamPCc__1), ((void *)__sout__P9sofstream_1), "signed char "))) , _tmp_cp_ret3)), __v__Sc_1))) , _tmp_cp_ret4)), ((void *(*)(void *__anonymous_object1531))(&_thunk1))))) , _tmp_cp_ret5));
     449        return __endl__A0_1_0_0___sepPrt__PFb_Pd0___sepReset__PF_Pd0___sepReset__PF_Pd0b___sepGetCur__PFPCc_Pd0___sepSetCur__PF_Pd0PCc___getNL__PFb_Pd0___setNL__PF_Pd0b___sepOn__PF_Pd0___sepOff__PF_Pd0___sepDisable__PFb_Pd0___sepEnable__PFb_Pd0___sepGet__PFPCc_Pd0___sepSet__PF_Pd0PCc___sepGetTuple__PFPCc_Pd0___sepSetTuple__PF_Pd0PCc___fail__PFi_Pd0___flush__PFi_Pd0___open__PF_Pd0PCcPCc___close__PF_Pd0___write__PFPd0_Pd0PCcUl___fmt__PFi_Pd0PCc__FPd0_Pd0__1(((_Bool (*)(void *__anonymous_object1427))__sepPrt__Fb_P9sofstream__1), ((void (*)(void *__anonymous_object1428))__sepReset__F_P9sofstream__1), ((void (*)(void *__anonymous_object1429, _Bool __anonymous_object1430))__sepReset__F_P9sofstreamb__1), ((const char *(*)(void *__anonymous_object1431))__sepGetCur__FPCc_P9sofstream__1), ((void (*)(void *__anonymous_object1432, const char *__anonymous_object1433))__sepSetCur__F_P9sofstreamPCc__1), ((_Bool (*)(void *__anonymous_object1434))__getNL__Fb_P9sofstream__1), ((void (*)(void *__anonymous_object1435, _Bool __anonymous_object1436))__setNL__F_P9sofstreamb__1), ((void (*)(void *__anonymous_object1437))__sepOn__F_P9sofstream__1), ((void (*)(void *__anonymous_object1438))__sepOff__F_P9sofstream__1), ((_Bool (*)(void *__anonymous_object1439))__sepDisable__Fb_P9sofstream__1), ((_Bool (*)(void *__anonymous_object1440))__sepEnable__Fb_P9sofstream__1), ((const char *(*)(void *__anonymous_object1441))__sepGet__FPCc_P9sofstream__1), ((void (*)(void *__anonymous_object1442, const char *__anonymous_object1443))__sepSet__F_P9sofstreamPCc__1), ((const char *(*)(void *__anonymous_object1444))__sepGetTuple__FPCc_P9sofstream__1), ((void (*)(void *__anonymous_object1445, const char *__anonymous_object1446))__sepSetTuple__F_P9sofstreamPCc__1), ((signed int (*)(void *__anonymous_object1447))__fail__Fi_P9sofstream__1), ((signed int (*)(void *__anonymous_object1448))__flush__Fi_P9sofstream__1), ((void (*)(void *__os__P7tostype_1, const char *__name__PCc_1, const char *__mode__PCc_1))__open__F_P9sofstreamPCcPCc__1), ((void (*)(void *__os__P7tostype_1))__close__F_P9sofstream__1), ((void *(*)(void *__anonymous_object1449, const char *__anonymous_object1450, unsigned long int __anonymous_object1451))__write__FP9sofstream_P9sofstreamPCcUl__1), ((signed int (*)(void *__anonymous_object1452, const char *__fmt__PCc_1, ...))__fmt__Fi_P9sofstreamPCc__1), _p0);
     450    }
     451    ((void)(((void)(_tmp_cp_ret5=___operator_bitor__A0_1_0_0___sepPrt__PFb_Pd0___sepReset__PF_Pd0___sepReset__PF_Pd0b___sepGetCur__PFPCc_Pd0___sepSetCur__PF_Pd0PCc___getNL__PFb_Pd0___setNL__PF_Pd0b___sepOn__PF_Pd0___sepOff__PF_Pd0___sepDisable__PFb_Pd0___sepEnable__PFb_Pd0___sepGet__PFPCc_Pd0___sepSet__PF_Pd0PCc___sepGetTuple__PFPCc_Pd0___sepSetTuple__PF_Pd0PCc___fail__PFi_Pd0___flush__PFi_Pd0___open__PF_Pd0PCcPCc___close__PF_Pd0___write__PFPd0_Pd0PCcUl___fmt__PFi_Pd0PCc__FPd0_Pd0PFPd0_Pd0___1(((_Bool (*)(void *__anonymous_object1453))__sepPrt__Fb_P9sofstream__1), ((void (*)(void *__anonymous_object1454))__sepReset__F_P9sofstream__1), ((void (*)(void *__anonymous_object1455, _Bool __anonymous_object1456))__sepReset__F_P9sofstreamb__1), ((const char *(*)(void *__anonymous_object1457))__sepGetCur__FPCc_P9sofstream__1), ((void (*)(void *__anonymous_object1458, const char *__anonymous_object1459))__sepSetCur__F_P9sofstreamPCc__1), ((_Bool (*)(void *__anonymous_object1460))__getNL__Fb_P9sofstream__1), ((void (*)(void *__anonymous_object1461, _Bool __anonymous_object1462))__setNL__F_P9sofstreamb__1), ((void (*)(void *__anonymous_object1463))__sepOn__F_P9sofstream__1), ((void (*)(void *__anonymous_object1464))__sepOff__F_P9sofstream__1), ((_Bool (*)(void *__anonymous_object1465))__sepDisable__Fb_P9sofstream__1), ((_Bool (*)(void *__anonymous_object1466))__sepEnable__Fb_P9sofstream__1), ((const char *(*)(void *__anonymous_object1467))__sepGet__FPCc_P9sofstream__1), ((void (*)(void *__anonymous_object1468, const char *__anonymous_object1469))__sepSet__F_P9sofstreamPCc__1), ((const char *(*)(void *__anonymous_object1470))__sepGetTuple__FPCc_P9sofstream__1), ((void (*)(void *__anonymous_object1471, const char *__anonymous_object1472))__sepSetTuple__F_P9sofstreamPCc__1), ((signed int (*)(void *__anonymous_object1473))__fail__Fi_P9sofstream__1), ((signed int (*)(void *__anonymous_object1474))__flush__Fi_P9sofstream__1), ((void (*)(void *__os__P7tostype_1, const char *__name__PCc_1, const char *__mode__PCc_1))__open__F_P9sofstreamPCcPCc__1), ((void (*)(void *__os__P7tostype_1))__close__F_P9sofstream__1), ((void *(*)(void *__anonymous_object1475, const char *__anonymous_object1476, unsigned long int __anonymous_object1477))__write__FP9sofstream_P9sofstreamPCcUl__1), ((signed int (*)(void *__anonymous_object1478, const char *__fmt__PCc_1, ...))__fmt__Fi_P9sofstreamPCc__1), (((void)(_tmp_cp_ret4=___operator_bitor__A0_1_0_0___sepPrt__PFb_Pd0___sepReset__PF_Pd0___sepReset__PF_Pd0b___sepGetCur__PFPCc_Pd0___sepSetCur__PF_Pd0PCc___getNL__PFb_Pd0___setNL__PF_Pd0b___sepOn__PF_Pd0___sepOff__PF_Pd0___sepDisable__PFb_Pd0___sepEnable__PFb_Pd0___sepGet__PFPCc_Pd0___sepSet__PF_Pd0PCc___sepGetTuple__PFPCc_Pd0___sepSetTuple__PF_Pd0PCc___fail__PFi_Pd0___flush__PFi_Pd0___open__PF_Pd0PCcPCc___close__PF_Pd0___write__PFPd0_Pd0PCcUl___fmt__PFi_Pd0PCc__FPd0_Pd0Sc__1(((_Bool (*)(void *__anonymous_object1479))__sepPrt__Fb_P9sofstream__1), ((void (*)(void *__anonymous_object1480))__sepReset__F_P9sofstream__1), ((void (*)(void *__anonymous_object1481, _Bool __anonymous_object1482))__sepReset__F_P9sofstreamb__1), ((const char *(*)(void *__anonymous_object1483))__sepGetCur__FPCc_P9sofstream__1), ((void (*)(void *__anonymous_object1484, const char *__anonymous_object1485))__sepSetCur__F_P9sofstreamPCc__1), ((_Bool (*)(void *__anonymous_object1486))__getNL__Fb_P9sofstream__1), ((void (*)(void *__anonymous_object1487, _Bool __anonymous_object1488))__setNL__F_P9sofstreamb__1), ((void (*)(void *__anonymous_object1489))__sepOn__F_P9sofstream__1), ((void (*)(void *__anonymous_object1490))__sepOff__F_P9sofstream__1), ((_Bool (*)(void *__anonymous_object1491))__sepDisable__Fb_P9sofstream__1), ((_Bool (*)(void *__anonymous_object1492))__sepEnable__Fb_P9sofstream__1), ((const char *(*)(void *__anonymous_object1493))__sepGet__FPCc_P9sofstream__1), ((void (*)(void *__anonymous_object1494, const char *__anonymous_object1495))__sepSet__F_P9sofstreamPCc__1), ((const char *(*)(void *__anonymous_object1496))__sepGetTuple__FPCc_P9sofstream__1), ((void (*)(void *__anonymous_object1497, const char *__anonymous_object1498))__sepSetTuple__F_P9sofstreamPCc__1), ((signed int (*)(void *__anonymous_object1499))__fail__Fi_P9sofstream__1), ((signed int (*)(void *__anonymous_object1500))__flush__Fi_P9sofstream__1), ((void (*)(void *__os__P7tostype_1, const char *__name__PCc_1, const char *__mode__PCc_1))__open__F_P9sofstreamPCcPCc__1), ((void (*)(void *__os__P7tostype_1))__close__F_P9sofstream__1), ((void *(*)(void *__anonymous_object1501, const char *__anonymous_object1502, unsigned long int __anonymous_object1503))__write__FP9sofstream_P9sofstreamPCcUl__1), ((signed int (*)(void *__anonymous_object1504, const char *__fmt__PCc_1, ...))__fmt__Fi_P9sofstreamPCc__1), (((void)(_tmp_cp_ret3=___operator_bitor__A0_1_0_0___sepPrt__PFb_Pd0___sepReset__PF_Pd0___sepReset__PF_Pd0b___sepGetCur__PFPCc_Pd0___sepSetCur__PF_Pd0PCc___getNL__PFb_Pd0___setNL__PF_Pd0b___sepOn__PF_Pd0___sepOff__PF_Pd0___sepDisable__PFb_Pd0___sepEnable__PFb_Pd0___sepGet__PFPCc_Pd0___sepSet__PF_Pd0PCc___sepGetTuple__PFPCc_Pd0___sepSetTuple__PF_Pd0PCc___fail__PFi_Pd0___flush__PFi_Pd0___open__PF_Pd0PCcPCc___close__PF_Pd0___write__PFPd0_Pd0PCcUl___fmt__PFi_Pd0PCc__FPd0_Pd0PCc__1(((_Bool (*)(void *__anonymous_object1505))__sepPrt__Fb_P9sofstream__1), ((void (*)(void *__anonymous_object1506))__sepReset__F_P9sofstream__1), ((void (*)(void *__anonymous_object1507, _Bool __anonymous_object1508))__sepReset__F_P9sofstreamb__1), ((const char *(*)(void *__anonymous_object1509))__sepGetCur__FPCc_P9sofstream__1), ((void (*)(void *__anonymous_object1510, const char *__anonymous_object1511))__sepSetCur__F_P9sofstreamPCc__1), ((_Bool (*)(void *__anonymous_object1512))__getNL__Fb_P9sofstream__1), ((void (*)(void *__anonymous_object1513, _Bool __anonymous_object1514))__setNL__F_P9sofstreamb__1), ((void (*)(void *__anonymous_object1515))__sepOn__F_P9sofstream__1), ((void (*)(void *__anonymous_object1516))__sepOff__F_P9sofstream__1), ((_Bool (*)(void *__anonymous_object1517))__sepDisable__Fb_P9sofstream__1), ((_Bool (*)(void *__anonymous_object1518))__sepEnable__Fb_P9sofstream__1), ((const char *(*)(void *__anonymous_object1519))__sepGet__FPCc_P9sofstream__1), ((void (*)(void *__anonymous_object1520, const char *__anonymous_object1521))__sepSet__F_P9sofstreamPCc__1), ((const char *(*)(void *__anonymous_object1522))__sepGetTuple__FPCc_P9sofstream__1), ((void (*)(void *__anonymous_object1523, const char *__anonymous_object1524))__sepSetTuple__F_P9sofstreamPCc__1), ((signed int (*)(void *__anonymous_object1525))__fail__Fi_P9sofstream__1), ((signed int (*)(void *__anonymous_object1526))__flush__Fi_P9sofstream__1), ((void (*)(void *__os__P7tostype_1, const char *__name__PCc_1, const char *__mode__PCc_1))__open__F_P9sofstreamPCcPCc__1), ((void (*)(void *__os__P7tostype_1))__close__F_P9sofstream__1), ((void *(*)(void *__anonymous_object1527, const char *__anonymous_object1528, unsigned long int __anonymous_object1529))__write__FP9sofstream_P9sofstreamPCcUl__1), ((signed int (*)(void *__anonymous_object1530, const char *__fmt__PCc_1, ...))__fmt__Fi_P9sofstreamPCc__1), __sout__P9sofstream_1, "signed char "))) , _tmp_cp_ret3), __v__Sc_1))) , _tmp_cp_ret4), ((void *(*)(void *__anonymous_object1531))(&_thunk1))))) , _tmp_cp_ret5));
    483452    ((void)(_tmp_cp_ret3) /* ^?{} */);
    484453    ((void)(_tmp_cp_ret4) /* ^?{} */);
     
    490459    struct ofstream *_tmp_cp_ret8;
    491460    __attribute__ ((unused)) struct ofstream *_thunk2(struct ofstream *_p0){
    492         return __endl__A0_1_0_0___sepPrt__PFb_Pd0___sepReset__PF_Pd0___sepReset__PF_Pd0b___sepGetCur__PFPCc_Pd0___sepSetCur__PF_Pd0PCc___getNL__PFb_Pd0___setNL__PF_Pd0b___sepOn__PF_Pd0___sepOff__PF_Pd0___sepDisable__PFb_Pd0___sepEnable__PFb_Pd0___sepGet__PFPCc_Pd0___sepSet__PF_Pd0PCc___sepGetTuple__PFPCc_Pd0___sepSetTuple__PF_Pd0PCc___fail__PFi_Pd0___flush__PFi_Pd0___open__PF_Pd0PCcPCc___close__PF_Pd0___write__PFPd0_Pd0PCcUl___fmt__PFi_Pd0PCc__FPd0_Pd0__1(((_Bool (*)(void *__anonymous_object1532))__sepPrt__Fb_P9sofstream__1), ((void (*)(void *__anonymous_object1533))__sepReset__F_P9sofstream__1), ((void (*)(void *__anonymous_object1534, _Bool __anonymous_object1535))__sepReset__F_P9sofstreamb__1), ((const char *(*)(void *__anonymous_object1536))__sepGetCur__FPCc_P9sofstream__1), ((void (*)(void *__anonymous_object1537, const char *__anonymous_object1538))__sepSetCur__F_P9sofstreamPCc__1), ((_Bool (*)(void *__anonymous_object1539))__getNL__Fb_P9sofstream__1), ((void (*)(void *__anonymous_object1540, _Bool __anonymous_object1541))__setNL__F_P9sofstreamb__1), ((void (*)(void *__anonymous_object1542))__sepOn__F_P9sofstream__1), ((void (*)(void *__anonymous_object1543))__sepOff__F_P9sofstream__1), ((_Bool (*)(void *__anonymous_object1544))__sepDisable__Fb_P9sofstream__1), ((_Bool (*)(void *__anonymous_object1545))__sepEnable__Fb_P9sofstream__1), ((const char *(*)(void *__anonymous_object1546))__sepGet__FPCc_P9sofstream__1), ((void (*)(void *__anonymous_object1547, const char *__anonymous_object1548))__sepSet__F_P9sofstreamPCc__1), ((const char *(*)(void *__anonymous_object1549))__sepGetTuple__FPCc_P9sofstream__1), ((void (*)(void *__anonymous_object1550, const char *__anonymous_object1551))__sepSetTuple__F_P9sofstreamPCc__1), ((signed int (*)(void *__anonymous_object1552))__fail__Fi_P9sofstream__1), ((signed int (*)(void *__anonymous_object1553))__flush__Fi_P9sofstream__1), ((void (*)(void *__os__P7tostype_1, const char *__name__PCc_1, const char *__mode__PCc_1))__open__F_P9sofstreamPCcPCc__1), ((void (*)(void *__os__P7tostype_1))__close__F_P9sofstream__1), ((void *(*)(void *__anonymous_object1554, const char *__anonymous_object1555, unsigned long int __anonymous_object1556))__write__FP9sofstream_P9sofstreamPCcUl__1), ((signed int (*)(void *__anonymous_object1557, const char *__fmt__PCc_1, ...))__fmt__Fi_P9sofstreamPCc__1), ((void *)_p0));
    493     }
    494     ((void)(((void)(_tmp_cp_ret8=___operator_bitor__A0_1_0_0___sepPrt__PFb_Pd0___sepReset__PF_Pd0___sepReset__PF_Pd0b___sepGetCur__PFPCc_Pd0___sepSetCur__PF_Pd0PCc___getNL__PFb_Pd0___setNL__PF_Pd0b___sepOn__PF_Pd0___sepOff__PF_Pd0___sepDisable__PFb_Pd0___sepEnable__PFb_Pd0___sepGet__PFPCc_Pd0___sepSet__PF_Pd0PCc___sepGetTuple__PFPCc_Pd0___sepSetTuple__PF_Pd0PCc___fail__PFi_Pd0___flush__PFi_Pd0___open__PF_Pd0PCcPCc___close__PF_Pd0___write__PFPd0_Pd0PCcUl___fmt__PFi_Pd0PCc__FPd0_Pd0PFPd0_Pd0___1(((_Bool (*)(void *__anonymous_object1558))__sepPrt__Fb_P9sofstream__1), ((void (*)(void *__anonymous_object1559))__sepReset__F_P9sofstream__1), ((void (*)(void *__anonymous_object1560, _Bool __anonymous_object1561))__sepReset__F_P9sofstreamb__1), ((const char *(*)(void *__anonymous_object1562))__sepGetCur__FPCc_P9sofstream__1), ((void (*)(void *__anonymous_object1563, const char *__anonymous_object1564))__sepSetCur__F_P9sofstreamPCc__1), ((_Bool (*)(void *__anonymous_object1565))__getNL__Fb_P9sofstream__1), ((void (*)(void *__anonymous_object1566, _Bool __anonymous_object1567))__setNL__F_P9sofstreamb__1), ((void (*)(void *__anonymous_object1568))__sepOn__F_P9sofstream__1), ((void (*)(void *__anonymous_object1569))__sepOff__F_P9sofstream__1), ((_Bool (*)(void *__anonymous_object1570))__sepDisable__Fb_P9sofstream__1), ((_Bool (*)(void *__anonymous_object1571))__sepEnable__Fb_P9sofstream__1), ((const char *(*)(void *__anonymous_object1572))__sepGet__FPCc_P9sofstream__1), ((void (*)(void *__anonymous_object1573, const char *__anonymous_object1574))__sepSet__F_P9sofstreamPCc__1), ((const char *(*)(void *__anonymous_object1575))__sepGetTuple__FPCc_P9sofstream__1), ((void (*)(void *__anonymous_object1576, const char *__anonymous_object1577))__sepSetTuple__F_P9sofstreamPCc__1), ((signed int (*)(void *__anonymous_object1578))__fail__Fi_P9sofstream__1), ((signed int (*)(void *__anonymous_object1579))__flush__Fi_P9sofstream__1), ((void (*)(void *__os__P7tostype_1, const char *__name__PCc_1, const char *__mode__PCc_1))__open__F_P9sofstreamPCcPCc__1), ((void (*)(void *__os__P7tostype_1))__close__F_P9sofstream__1), ((void *(*)(void *__anonymous_object1580, const char *__anonymous_object1581, unsigned long int __anonymous_object1582))__write__FP9sofstream_P9sofstreamPCcUl__1), ((signed int (*)(void *__anonymous_object1583, const char *__fmt__PCc_1, ...))__fmt__Fi_P9sofstreamPCc__1), ((void *)(((void)(_tmp_cp_ret7=___operator_bitor__A0_1_0_0___sepPrt__PFb_Pd0___sepReset__PF_Pd0___sepReset__PF_Pd0b___sepGetCur__PFPCc_Pd0___sepSetCur__PF_Pd0PCc___getNL__PFb_Pd0___setNL__PF_Pd0b___sepOn__PF_Pd0___sepOff__PF_Pd0___sepDisable__PFb_Pd0___sepEnable__PFb_Pd0___sepGet__PFPCc_Pd0___sepSet__PF_Pd0PCc___sepGetTuple__PFPCc_Pd0___sepSetTuple__PF_Pd0PCc___fail__PFi_Pd0___flush__PFi_Pd0___open__PF_Pd0PCcPCc___close__PF_Pd0___write__PFPd0_Pd0PCcUl___fmt__PFi_Pd0PCc__FPd0_Pd0Uc__1(((_Bool (*)(void *__anonymous_object1584))__sepPrt__Fb_P9sofstream__1), ((void (*)(void *__anonymous_object1585))__sepReset__F_P9sofstream__1), ((void (*)(void *__anonymous_object1586, _Bool __anonymous_object1587))__sepReset__F_P9sofstreamb__1), ((const char *(*)(void *__anonymous_object1588))__sepGetCur__FPCc_P9sofstream__1), ((void (*)(void *__anonymous_object1589, const char *__anonymous_object1590))__sepSetCur__F_P9sofstreamPCc__1), ((_Bool (*)(void *__anonymous_object1591))__getNL__Fb_P9sofstream__1), ((void (*)(void *__anonymous_object1592, _Bool __anonymous_object1593))__setNL__F_P9sofstreamb__1), ((void (*)(void *__anonymous_object1594))__sepOn__F_P9sofstream__1), ((void (*)(void *__anonymous_object1595))__sepOff__F_P9sofstream__1), ((_Bool (*)(void *__anonymous_object1596))__sepDisable__Fb_P9sofstream__1), ((_Bool (*)(void *__anonymous_object1597))__sepEnable__Fb_P9sofstream__1), ((const char *(*)(void *__anonymous_object1598))__sepGet__FPCc_P9sofstream__1), ((void (*)(void *__anonymous_object1599, const char *__anonymous_object1600))__sepSet__F_P9sofstreamPCc__1), ((const char *(*)(void *__anonymous_object1601))__sepGetTuple__FPCc_P9sofstream__1), ((void (*)(void *__anonymous_object1602, const char *__anonymous_object1603))__sepSetTuple__F_P9sofstreamPCc__1), ((signed int (*)(void *__anonymous_object1604))__fail__Fi_P9sofstream__1), ((signed int (*)(void *__anonymous_object1605))__flush__Fi_P9sofstream__1), ((void (*)(void *__os__P7tostype_1, const char *__name__PCc_1, const char *__mode__PCc_1))__open__F_P9sofstreamPCcPCc__1), ((void (*)(void *__os__P7tostype_1))__close__F_P9sofstream__1), ((void *(*)(void *__anonymous_object1606, const char *__anonymous_object1607, unsigned long int __anonymous_object1608))__write__FP9sofstream_P9sofstreamPCcUl__1), ((signed int (*)(void *__anonymous_object1609, const char *__fmt__PCc_1, ...))__fmt__Fi_P9sofstreamPCc__1), ((void *)(((void)(_tmp_cp_ret6=___operator_bitor__A0_1_0_0___sepPrt__PFb_Pd0___sepReset__PF_Pd0___sepReset__PF_Pd0b___sepGetCur__PFPCc_Pd0___sepSetCur__PF_Pd0PCc___getNL__PFb_Pd0___setNL__PF_Pd0b___sepOn__PF_Pd0___sepOff__PF_Pd0___sepDisable__PFb_Pd0___sepEnable__PFb_Pd0___sepGet__PFPCc_Pd0___sepSet__PF_Pd0PCc___sepGetTuple__PFPCc_Pd0___sepSetTuple__PF_Pd0PCc___fail__PFi_Pd0___flush__PFi_Pd0___open__PF_Pd0PCcPCc___close__PF_Pd0___write__PFPd0_Pd0PCcUl___fmt__PFi_Pd0PCc__FPd0_Pd0PCc__1(((_Bool (*)(void *__anonymous_object1610))__sepPrt__Fb_P9sofstream__1), ((void (*)(void *__anonymous_object1611))__sepReset__F_P9sofstream__1), ((void (*)(void *__anonymous_object1612, _Bool __anonymous_object1613))__sepReset__F_P9sofstreamb__1), ((const char *(*)(void *__anonymous_object1614))__sepGetCur__FPCc_P9sofstream__1), ((void (*)(void *__anonymous_object1615, const char *__anonymous_object1616))__sepSetCur__F_P9sofstreamPCc__1), ((_Bool (*)(void *__anonymous_object1617))__getNL__Fb_P9sofstream__1), ((void (*)(void *__anonymous_object1618, _Bool __anonymous_object1619))__setNL__F_P9sofstreamb__1), ((void (*)(void *__anonymous_object1620))__sepOn__F_P9sofstream__1), ((void (*)(void *__anonymous_object1621))__sepOff__F_P9sofstream__1), ((_Bool (*)(void *__anonymous_object1622))__sepDisable__Fb_P9sofstream__1), ((_Bool (*)(void *__anonymous_object1623))__sepEnable__Fb_P9sofstream__1), ((const char *(*)(void *__anonymous_object1624))__sepGet__FPCc_P9sofstream__1), ((void (*)(void *__anonymous_object1625, const char *__anonymous_object1626))__sepSet__F_P9sofstreamPCc__1), ((const char *(*)(void *__anonymous_object1627))__sepGetTuple__FPCc_P9sofstream__1), ((void (*)(void *__anonymous_object1628, const char *__anonymous_object1629))__sepSetTuple__F_P9sofstreamPCc__1), ((signed int (*)(void *__anonymous_object1630))__fail__Fi_P9sofstream__1), ((signed int (*)(void *__anonymous_object1631))__flush__Fi_P9sofstream__1), ((void (*)(void *__os__P7tostype_1, const char *__name__PCc_1, const char *__mode__PCc_1))__open__F_P9sofstreamPCcPCc__1), ((void (*)(void *__os__P7tostype_1))__close__F_P9sofstream__1), ((void *(*)(void *__anonymous_object1632, const char *__anonymous_object1633, unsigned long int __anonymous_object1634))__write__FP9sofstream_P9sofstreamPCcUl__1), ((signed int (*)(void *__anonymous_object1635, const char *__fmt__PCc_1, ...))__fmt__Fi_P9sofstreamPCc__1), ((void *)__sout__P9sofstream_1), "unsigned char "))) , _tmp_cp_ret6)), __v__Uc_1))) , _tmp_cp_ret7)), ((void *(*)(void *__anonymous_object1636))(&_thunk2))))) , _tmp_cp_ret8));
     461        return __endl__A0_1_0_0___sepPrt__PFb_Pd0___sepReset__PF_Pd0___sepReset__PF_Pd0b___sepGetCur__PFPCc_Pd0___sepSetCur__PF_Pd0PCc___getNL__PFb_Pd0___setNL__PF_Pd0b___sepOn__PF_Pd0___sepOff__PF_Pd0___sepDisable__PFb_Pd0___sepEnable__PFb_Pd0___sepGet__PFPCc_Pd0___sepSet__PF_Pd0PCc___sepGetTuple__PFPCc_Pd0___sepSetTuple__PF_Pd0PCc___fail__PFi_Pd0___flush__PFi_Pd0___open__PF_Pd0PCcPCc___close__PF_Pd0___write__PFPd0_Pd0PCcUl___fmt__PFi_Pd0PCc__FPd0_Pd0__1(((_Bool (*)(void *__anonymous_object1532))__sepPrt__Fb_P9sofstream__1), ((void (*)(void *__anonymous_object1533))__sepReset__F_P9sofstream__1), ((void (*)(void *__anonymous_object1534, _Bool __anonymous_object1535))__sepReset__F_P9sofstreamb__1), ((const char *(*)(void *__anonymous_object1536))__sepGetCur__FPCc_P9sofstream__1), ((void (*)(void *__anonymous_object1537, const char *__anonymous_object1538))__sepSetCur__F_P9sofstreamPCc__1), ((_Bool (*)(void *__anonymous_object1539))__getNL__Fb_P9sofstream__1), ((void (*)(void *__anonymous_object1540, _Bool __anonymous_object1541))__setNL__F_P9sofstreamb__1), ((void (*)(void *__anonymous_object1542))__sepOn__F_P9sofstream__1), ((void (*)(void *__anonymous_object1543))__sepOff__F_P9sofstream__1), ((_Bool (*)(void *__anonymous_object1544))__sepDisable__Fb_P9sofstream__1), ((_Bool (*)(void *__anonymous_object1545))__sepEnable__Fb_P9sofstream__1), ((const char *(*)(void *__anonymous_object1546))__sepGet__FPCc_P9sofstream__1), ((void (*)(void *__anonymous_object1547, const char *__anonymous_object1548))__sepSet__F_P9sofstreamPCc__1), ((const char *(*)(void *__anonymous_object1549))__sepGetTuple__FPCc_P9sofstream__1), ((void (*)(void *__anonymous_object1550, const char *__anonymous_object1551))__sepSetTuple__F_P9sofstreamPCc__1), ((signed int (*)(void *__anonymous_object1552))__fail__Fi_P9sofstream__1), ((signed int (*)(void *__anonymous_object1553))__flush__Fi_P9sofstream__1), ((void (*)(void *__os__P7tostype_1, const char *__name__PCc_1, const char *__mode__PCc_1))__open__F_P9sofstreamPCcPCc__1), ((void (*)(void *__os__P7tostype_1))__close__F_P9sofstream__1), ((void *(*)(void *__anonymous_object1554, const char *__anonymous_object1555, unsigned long int __anonymous_object1556))__write__FP9sofstream_P9sofstreamPCcUl__1), ((signed int (*)(void *__anonymous_object1557, const char *__fmt__PCc_1, ...))__fmt__Fi_P9sofstreamPCc__1), _p0);
     462    }
     463    ((void)(((void)(_tmp_cp_ret8=___operator_bitor__A0_1_0_0___sepPrt__PFb_Pd0___sepReset__PF_Pd0___sepReset__PF_Pd0b___sepGetCur__PFPCc_Pd0___sepSetCur__PF_Pd0PCc___getNL__PFb_Pd0___setNL__PF_Pd0b___sepOn__PF_Pd0___sepOff__PF_Pd0___sepDisable__PFb_Pd0___sepEnable__PFb_Pd0___sepGet__PFPCc_Pd0___sepSet__PF_Pd0PCc___sepGetTuple__PFPCc_Pd0___sepSetTuple__PF_Pd0PCc___fail__PFi_Pd0___flush__PFi_Pd0___open__PF_Pd0PCcPCc___close__PF_Pd0___write__PFPd0_Pd0PCcUl___fmt__PFi_Pd0PCc__FPd0_Pd0PFPd0_Pd0___1(((_Bool (*)(void *__anonymous_object1558))__sepPrt__Fb_P9sofstream__1), ((void (*)(void *__anonymous_object1559))__sepReset__F_P9sofstream__1), ((void (*)(void *__anonymous_object1560, _Bool __anonymous_object1561))__sepReset__F_P9sofstreamb__1), ((const char *(*)(void *__anonymous_object1562))__sepGetCur__FPCc_P9sofstream__1), ((void (*)(void *__anonymous_object1563, const char *__anonymous_object1564))__sepSetCur__F_P9sofstreamPCc__1), ((_Bool (*)(void *__anonymous_object1565))__getNL__Fb_P9sofstream__1), ((void (*)(void *__anonymous_object1566, _Bool __anonymous_object1567))__setNL__F_P9sofstreamb__1), ((void (*)(void *__anonymous_object1568))__sepOn__F_P9sofstream__1), ((void (*)(void *__anonymous_object1569))__sepOff__F_P9sofstream__1), ((_Bool (*)(void *__anonymous_object1570))__sepDisable__Fb_P9sofstream__1), ((_Bool (*)(void *__anonymous_object1571))__sepEnable__Fb_P9sofstream__1), ((const char *(*)(void *__anonymous_object1572))__sepGet__FPCc_P9sofstream__1), ((void (*)(void *__anonymous_object1573, const char *__anonymous_object1574))__sepSet__F_P9sofstreamPCc__1), ((const char *(*)(void *__anonymous_object1575))__sepGetTuple__FPCc_P9sofstream__1), ((void (*)(void *__anonymous_object1576, const char *__anonymous_object1577))__sepSetTuple__F_P9sofstreamPCc__1), ((signed int (*)(void *__anonymous_object1578))__fail__Fi_P9sofstream__1), ((signed int (*)(void *__anonymous_object1579))__flush__Fi_P9sofstream__1), ((void (*)(void *__os__P7tostype_1, const char *__name__PCc_1, const char *__mode__PCc_1))__open__F_P9sofstreamPCcPCc__1), ((void (*)(void *__os__P7tostype_1))__close__F_P9sofstream__1), ((void *(*)(void *__anonymous_object1580, const char *__anonymous_object1581, unsigned long int __anonymous_object1582))__write__FP9sofstream_P9sofstreamPCcUl__1), ((signed int (*)(void *__anonymous_object1583, const char *__fmt__PCc_1, ...))__fmt__Fi_P9sofstreamPCc__1), (((void)(_tmp_cp_ret7=___operator_bitor__A0_1_0_0___sepPrt__PFb_Pd0___sepReset__PF_Pd0___sepReset__PF_Pd0b___sepGetCur__PFPCc_Pd0___sepSetCur__PF_Pd0PCc___getNL__PFb_Pd0___setNL__PF_Pd0b___sepOn__PF_Pd0___sepOff__PF_Pd0___sepDisable__PFb_Pd0___sepEnable__PFb_Pd0___sepGet__PFPCc_Pd0___sepSet__PF_Pd0PCc___sepGetTuple__PFPCc_Pd0___sepSetTuple__PF_Pd0PCc___fail__PFi_Pd0___flush__PFi_Pd0___open__PF_Pd0PCcPCc___close__PF_Pd0___write__PFPd0_Pd0PCcUl___fmt__PFi_Pd0PCc__FPd0_Pd0Uc__1(((_Bool (*)(void *__anonymous_object1584))__sepPrt__Fb_P9sofstream__1), ((void (*)(void *__anonymous_object1585))__sepReset__F_P9sofstream__1), ((void (*)(void *__anonymous_object1586, _Bool __anonymous_object1587))__sepReset__F_P9sofstreamb__1), ((const char *(*)(void *__anonymous_object1588))__sepGetCur__FPCc_P9sofstream__1), ((void (*)(void *__anonymous_object1589, const char *__anonymous_object1590))__sepSetCur__F_P9sofstreamPCc__1), ((_Bool (*)(void *__anonymous_object1591))__getNL__Fb_P9sofstream__1), ((void (*)(void *__anonymous_object1592, _Bool __anonymous_object1593))__setNL__F_P9sofstreamb__1), ((void (*)(void *__anonymous_object1594))__sepOn__F_P9sofstream__1), ((void (*)(void *__anonymous_object1595))__sepOff__F_P9sofstream__1), ((_Bool (*)(void *__anonymous_object1596))__sepDisable__Fb_P9sofstream__1), ((_Bool (*)(void *__anonymous_object1597))__sepEnable__Fb_P9sofstream__1), ((const char *(*)(void *__anonymous_object1598))__sepGet__FPCc_P9sofstream__1), ((void (*)(void *__anonymous_object1599, const char *__anonymous_object1600))__sepSet__F_P9sofstreamPCc__1), ((const char *(*)(void *__anonymous_object1601))__sepGetTuple__FPCc_P9sofstream__1), ((void (*)(void *__anonymous_object1602, const char *__anonymous_object1603))__sepSetTuple__F_P9sofstreamPCc__1), ((signed int (*)(void *__anonymous_object1604))__fail__Fi_P9sofstream__1), ((signed int (*)(void *__anonymous_object1605))__flush__Fi_P9sofstream__1), ((void (*)(void *__os__P7tostype_1, const char *__name__PCc_1, const char *__mode__PCc_1))__open__F_P9sofstreamPCcPCc__1), ((void (*)(void *__os__P7tostype_1))__close__F_P9sofstream__1), ((void *(*)(void *__anonymous_object1606, const char *__anonymous_object1607, unsigned long int __anonymous_object1608))__write__FP9sofstream_P9sofstreamPCcUl__1), ((signed int (*)(void *__anonymous_object1609, const char *__fmt__PCc_1, ...))__fmt__Fi_P9sofstreamPCc__1), (((void)(_tmp_cp_ret6=___operator_bitor__A0_1_0_0___sepPrt__PFb_Pd0___sepReset__PF_Pd0___sepReset__PF_Pd0b___sepGetCur__PFPCc_Pd0___sepSetCur__PF_Pd0PCc___getNL__PFb_Pd0___setNL__PF_Pd0b___sepOn__PF_Pd0___sepOff__PF_Pd0___sepDisable__PFb_Pd0___sepEnable__PFb_Pd0___sepGet__PFPCc_Pd0___sepSet__PF_Pd0PCc___sepGetTuple__PFPCc_Pd0___sepSetTuple__PF_Pd0PCc___fail__PFi_Pd0___flush__PFi_Pd0___open__PF_Pd0PCcPCc___close__PF_Pd0___write__PFPd0_Pd0PCcUl___fmt__PFi_Pd0PCc__FPd0_Pd0PCc__1(((_Bool (*)(void *__anonymous_object1610))__sepPrt__Fb_P9sofstream__1), ((void (*)(void *__anonymous_object1611))__sepReset__F_P9sofstream__1), ((void (*)(void *__anonymous_object1612, _Bool __anonymous_object1613))__sepReset__F_P9sofstreamb__1), ((const char *(*)(void *__anonymous_object1614))__sepGetCur__FPCc_P9sofstream__1), ((void (*)(void *__anonymous_object1615, const char *__anonymous_object1616))__sepSetCur__F_P9sofstreamPCc__1), ((_Bool (*)(void *__anonymous_object1617))__getNL__Fb_P9sofstream__1), ((void (*)(void *__anonymous_object1618, _Bool __anonymous_object1619))__setNL__F_P9sofstreamb__1), ((void (*)(void *__anonymous_object1620))__sepOn__F_P9sofstream__1), ((void (*)(void *__anonymous_object1621))__sepOff__F_P9sofstream__1), ((_Bool (*)(void *__anonymous_object1622))__sepDisable__Fb_P9sofstream__1), ((_Bool (*)(void *__anonymous_object1623))__sepEnable__Fb_P9sofstream__1), ((const char *(*)(void *__anonymous_object1624))__sepGet__FPCc_P9sofstream__1), ((void (*)(void *__anonymous_object1625, const char *__anonymous_object1626))__sepSet__F_P9sofstreamPCc__1), ((const char *(*)(void *__anonymous_object1627))__sepGetTuple__FPCc_P9sofstream__1), ((void (*)(void *__anonymous_object1628, const char *__anonymous_object1629))__sepSetTuple__F_P9sofstreamPCc__1), ((signed int (*)(void *__anonymous_object1630))__fail__Fi_P9sofstream__1), ((signed int (*)(void *__anonymous_object1631))__flush__Fi_P9sofstream__1), ((void (*)(void *__os__P7tostype_1, const char *__name__PCc_1, const char *__mode__PCc_1))__open__F_P9sofstreamPCcPCc__1), ((void (*)(void *__os__P7tostype_1))__close__F_P9sofstream__1), ((void *(*)(void *__anonymous_object1632, const char *__anonymous_object1633, unsigned long int __anonymous_object1634))__write__FP9sofstream_P9sofstreamPCcUl__1), ((signed int (*)(void *__anonymous_object1635, const char *__fmt__PCc_1, ...))__fmt__Fi_P9sofstreamPCc__1), __sout__P9sofstream_1, "unsigned char "))) , _tmp_cp_ret6), __v__Uc_1))) , _tmp_cp_ret7), ((void *(*)(void *__anonymous_object1636))(&_thunk2))))) , _tmp_cp_ret8));
    495464    ((void)(_tmp_cp_ret6) /* ^?{} */);
    496465    ((void)(_tmp_cp_ret7) /* ^?{} */);
     
    502471    struct ofstream *_tmp_cp_ret11;
    503472    __attribute__ ((unused)) struct ofstream *_thunk3(struct ofstream *_p0){
    504         return __endl__A0_1_0_0___sepPrt__PFb_Pd0___sepReset__PF_Pd0___sepReset__PF_Pd0b___sepGetCur__PFPCc_Pd0___sepSetCur__PF_Pd0PCc___getNL__PFb_Pd0___setNL__PF_Pd0b___sepOn__PF_Pd0___sepOff__PF_Pd0___sepDisable__PFb_Pd0___sepEnable__PFb_Pd0___sepGet__PFPCc_Pd0___sepSet__PF_Pd0PCc___sepGetTuple__PFPCc_Pd0___sepSetTuple__PF_Pd0PCc___fail__PFi_Pd0___flush__PFi_Pd0___open__PF_Pd0PCcPCc___close__PF_Pd0___write__PFPd0_Pd0PCcUl___fmt__PFi_Pd0PCc__FPd0_Pd0__1(((_Bool (*)(void *__anonymous_object1637))__sepPrt__Fb_P9sofstream__1), ((void (*)(void *__anonymous_object1638))__sepReset__F_P9sofstream__1), ((void (*)(void *__anonymous_object1639, _Bool __anonymous_object1640))__sepReset__F_P9sofstreamb__1), ((const char *(*)(void *__anonymous_object1641))__sepGetCur__FPCc_P9sofstream__1), ((void (*)(void *__anonymous_object1642, const char *__anonymous_object1643))__sepSetCur__F_P9sofstreamPCc__1), ((_Bool (*)(void *__anonymous_object1644))__getNL__Fb_P9sofstream__1), ((void (*)(void *__anonymous_object1645, _Bool __anonymous_object1646))__setNL__F_P9sofstreamb__1), ((void (*)(void *__anonymous_object1647))__sepOn__F_P9sofstream__1), ((void (*)(void *__anonymous_object1648))__sepOff__F_P9sofstream__1), ((_Bool (*)(void *__anonymous_object1649))__sepDisable__Fb_P9sofstream__1), ((_Bool (*)(void *__anonymous_object1650))__sepEnable__Fb_P9sofstream__1), ((const char *(*)(void *__anonymous_object1651))__sepGet__FPCc_P9sofstream__1), ((void (*)(void *__anonymous_object1652, const char *__anonymous_object1653))__sepSet__F_P9sofstreamPCc__1), ((const char *(*)(void *__anonymous_object1654))__sepGetTuple__FPCc_P9sofstream__1), ((void (*)(void *__anonymous_object1655, const char *__anonymous_object1656))__sepSetTuple__F_P9sofstreamPCc__1), ((signed int (*)(void *__anonymous_object1657))__fail__Fi_P9sofstream__1), ((signed int (*)(void *__anonymous_object1658))__flush__Fi_P9sofstream__1), ((void (*)(void *__os__P7tostype_1, const char *__name__PCc_1, const char *__mode__PCc_1))__open__F_P9sofstreamPCcPCc__1), ((void (*)(void *__os__P7tostype_1))__close__F_P9sofstream__1), ((void *(*)(void *__anonymous_object1659, const char *__anonymous_object1660, unsigned long int __anonymous_object1661))__write__FP9sofstream_P9sofstreamPCcUl__1), ((signed int (*)(void *__anonymous_object1662, const char *__fmt__PCc_1, ...))__fmt__Fi_P9sofstreamPCc__1), ((void *)_p0));
    505     }
    506     ((void)(((void)(_tmp_cp_ret11=___operator_bitor__A0_1_0_0___sepPrt__PFb_Pd0___sepReset__PF_Pd0___sepReset__PF_Pd0b___sepGetCur__PFPCc_Pd0___sepSetCur__PF_Pd0PCc___getNL__PFb_Pd0___setNL__PF_Pd0b___sepOn__PF_Pd0___sepOff__PF_Pd0___sepDisable__PFb_Pd0___sepEnable__PFb_Pd0___sepGet__PFPCc_Pd0___sepSet__PF_Pd0PCc___sepGetTuple__PFPCc_Pd0___sepSetTuple__PF_Pd0PCc___fail__PFi_Pd0___flush__PFi_Pd0___open__PF_Pd0PCcPCc___close__PF_Pd0___write__PFPd0_Pd0PCcUl___fmt__PFi_Pd0PCc__FPd0_Pd0PFPd0_Pd0___1(((_Bool (*)(void *__anonymous_object1663))__sepPrt__Fb_P9sofstream__1), ((void (*)(void *__anonymous_object1664))__sepReset__F_P9sofstream__1), ((void (*)(void *__anonymous_object1665, _Bool __anonymous_object1666))__sepReset__F_P9sofstreamb__1), ((const char *(*)(void *__anonymous_object1667))__sepGetCur__FPCc_P9sofstream__1), ((void (*)(void *__anonymous_object1668, const char *__anonymous_object1669))__sepSetCur__F_P9sofstreamPCc__1), ((_Bool (*)(void *__anonymous_object1670))__getNL__Fb_P9sofstream__1), ((void (*)(void *__anonymous_object1671, _Bool __anonymous_object1672))__setNL__F_P9sofstreamb__1), ((void (*)(void *__anonymous_object1673))__sepOn__F_P9sofstream__1), ((void (*)(void *__anonymous_object1674))__sepOff__F_P9sofstream__1), ((_Bool (*)(void *__anonymous_object1675))__sepDisable__Fb_P9sofstream__1), ((_Bool (*)(void *__anonymous_object1676))__sepEnable__Fb_P9sofstream__1), ((const char *(*)(void *__anonymous_object1677))__sepGet__FPCc_P9sofstream__1), ((void (*)(void *__anonymous_object1678, const char *__anonymous_object1679))__sepSet__F_P9sofstreamPCc__1), ((const char *(*)(void *__anonymous_object1680))__sepGetTuple__FPCc_P9sofstream__1), ((void (*)(void *__anonymous_object1681, const char *__anonymous_object1682))__sepSetTuple__F_P9sofstreamPCc__1), ((signed int (*)(void *__anonymous_object1683))__fail__Fi_P9sofstream__1), ((signed int (*)(void *__anonymous_object1684))__flush__Fi_P9sofstream__1), ((void (*)(void *__os__P7tostype_1, const char *__name__PCc_1, const char *__mode__PCc_1))__open__F_P9sofstreamPCcPCc__1), ((void (*)(void *__os__P7tostype_1))__close__F_P9sofstream__1), ((void *(*)(void *__anonymous_object1685, const char *__anonymous_object1686, unsigned long int __anonymous_object1687))__write__FP9sofstream_P9sofstreamPCcUl__1), ((signed int (*)(void *__anonymous_object1688, const char *__fmt__PCc_1, ...))__fmt__Fi_P9sofstreamPCc__1), ((void *)(((void)(_tmp_cp_ret10=___operator_bitor__A0_1_0_0___sepPrt__PFb_Pd0___sepReset__PF_Pd0___sepReset__PF_Pd0b___sepGetCur__PFPCc_Pd0___sepSetCur__PF_Pd0PCc___getNL__PFb_Pd0___setNL__PF_Pd0b___sepOn__PF_Pd0___sepOff__PF_Pd0___sepDisable__PFb_Pd0___sepEnable__PFb_Pd0___sepGet__PFPCc_Pd0___sepSet__PF_Pd0PCc___sepGetTuple__PFPCc_Pd0___sepSetTuple__PF_Pd0PCc___fail__PFi_Pd0___flush__PFi_Pd0___open__PF_Pd0PCcPCc___close__PF_Pd0___write__PFPd0_Pd0PCcUl___fmt__PFi_Pd0PCc__FPd0_Pd0s__1(((_Bool (*)(void *__anonymous_object1689))__sepPrt__Fb_P9sofstream__1), ((void (*)(void *__anonymous_object1690))__sepReset__F_P9sofstream__1), ((void (*)(void *__anonymous_object1691, _Bool __anonymous_object1692))__sepReset__F_P9sofstreamb__1), ((const char *(*)(void *__anonymous_object1693))__sepGetCur__FPCc_P9sofstream__1), ((void (*)(void *__anonymous_object1694, const char *__anonymous_object1695))__sepSetCur__F_P9sofstreamPCc__1), ((_Bool (*)(void *__anonymous_object1696))__getNL__Fb_P9sofstream__1), ((void (*)(void *__anonymous_object1697, _Bool __anonymous_object1698))__setNL__F_P9sofstreamb__1), ((void (*)(void *__anonymous_object1699))__sepOn__F_P9sofstream__1), ((void (*)(void *__anonymous_object1700))__sepOff__F_P9sofstream__1), ((_Bool (*)(void *__anonymous_object1701))__sepDisable__Fb_P9sofstream__1), ((_Bool (*)(void *__anonymous_object1702))__sepEnable__Fb_P9sofstream__1), ((const char *(*)(void *__anonymous_object1703))__sepGet__FPCc_P9sofstream__1), ((void (*)(void *__anonymous_object1704, const char *__anonymous_object1705))__sepSet__F_P9sofstreamPCc__1), ((const char *(*)(void *__anonymous_object1706))__sepGetTuple__FPCc_P9sofstream__1), ((void (*)(void *__anonymous_object1707, const char *__anonymous_object1708))__sepSetTuple__F_P9sofstreamPCc__1), ((signed int (*)(void *__anonymous_object1709))__fail__Fi_P9sofstream__1), ((signed int (*)(void *__anonymous_object1710))__flush__Fi_P9sofstream__1), ((void (*)(void *__os__P7tostype_1, const char *__name__PCc_1, const char *__mode__PCc_1))__open__F_P9sofstreamPCcPCc__1), ((void (*)(void *__os__P7tostype_1))__close__F_P9sofstream__1), ((void *(*)(void *__anonymous_object1711, const char *__anonymous_object1712, unsigned long int __anonymous_object1713))__write__FP9sofstream_P9sofstreamPCcUl__1), ((signed int (*)(void *__anonymous_object1714, const char *__fmt__PCc_1, ...))__fmt__Fi_P9sofstreamPCc__1), ((void *)(((void)(_tmp_cp_ret9=___operator_bitor__A0_1_0_0___sepPrt__PFb_Pd0___sepReset__PF_Pd0___sepReset__PF_Pd0b___sepGetCur__PFPCc_Pd0___sepSetCur__PF_Pd0PCc___getNL__PFb_Pd0___setNL__PF_Pd0b___sepOn__PF_Pd0___sepOff__PF_Pd0___sepDisable__PFb_Pd0___sepEnable__PFb_Pd0___sepGet__PFPCc_Pd0___sepSet__PF_Pd0PCc___sepGetTuple__PFPCc_Pd0___sepSetTuple__PF_Pd0PCc___fail__PFi_Pd0___flush__PFi_Pd0___open__PF_Pd0PCcPCc___close__PF_Pd0___write__PFPd0_Pd0PCcUl___fmt__PFi_Pd0PCc__FPd0_Pd0PCc__1(((_Bool (*)(void *__anonymous_object1715))__sepPrt__Fb_P9sofstream__1), ((void (*)(void *__anonymous_object1716))__sepReset__F_P9sofstream__1), ((void (*)(void *__anonymous_object1717, _Bool __anonymous_object1718))__sepReset__F_P9sofstreamb__1), ((const char *(*)(void *__anonymous_object1719))__sepGetCur__FPCc_P9sofstream__1), ((void (*)(void *__anonymous_object1720, const char *__anonymous_object1721))__sepSetCur__F_P9sofstreamPCc__1), ((_Bool (*)(void *__anonymous_object1722))__getNL__Fb_P9sofstream__1), ((void (*)(void *__anonymous_object1723, _Bool __anonymous_object1724))__setNL__F_P9sofstreamb__1), ((void (*)(void *__anonymous_object1725))__sepOn__F_P9sofstream__1), ((void (*)(void *__anonymous_object1726))__sepOff__F_P9sofstream__1), ((_Bool (*)(void *__anonymous_object1727))__sepDisable__Fb_P9sofstream__1), ((_Bool (*)(void *__anonymous_object1728))__sepEnable__Fb_P9sofstream__1), ((const char *(*)(void *__anonymous_object1729))__sepGet__FPCc_P9sofstream__1), ((void (*)(void *__anonymous_object1730, const char *__anonymous_object1731))__sepSet__F_P9sofstreamPCc__1), ((const char *(*)(void *__anonymous_object1732))__sepGetTuple__FPCc_P9sofstream__1), ((void (*)(void *__anonymous_object1733, const char *__anonymous_object1734))__sepSetTuple__F_P9sofstreamPCc__1), ((signed int (*)(void *__anonymous_object1735))__fail__Fi_P9sofstream__1), ((signed int (*)(void *__anonymous_object1736))__flush__Fi_P9sofstream__1), ((void (*)(void *__os__P7tostype_1, const char *__name__PCc_1, const char *__mode__PCc_1))__open__F_P9sofstreamPCcPCc__1), ((void (*)(void *__os__P7tostype_1))__close__F_P9sofstream__1), ((void *(*)(void *__anonymous_object1737, const char *__anonymous_object1738, unsigned long int __anonymous_object1739))__write__FP9sofstream_P9sofstreamPCcUl__1), ((signed int (*)(void *__anonymous_object1740, const char *__fmt__PCc_1, ...))__fmt__Fi_P9sofstreamPCc__1), ((void *)__sout__P9sofstream_1), "signed short int"))) , _tmp_cp_ret9)), __v__s_1))) , _tmp_cp_ret10)), ((void *(*)(void *__anonymous_object1741))(&_thunk3))))) , _tmp_cp_ret11));
     473        return __endl__A0_1_0_0___sepPrt__PFb_Pd0___sepReset__PF_Pd0___sepReset__PF_Pd0b___sepGetCur__PFPCc_Pd0___sepSetCur__PF_Pd0PCc___getNL__PFb_Pd0___setNL__PF_Pd0b___sepOn__PF_Pd0___sepOff__PF_Pd0___sepDisable__PFb_Pd0___sepEnable__PFb_Pd0___sepGet__PFPCc_Pd0___sepSet__PF_Pd0PCc___sepGetTuple__PFPCc_Pd0___sepSetTuple__PF_Pd0PCc___fail__PFi_Pd0___flush__PFi_Pd0___open__PF_Pd0PCcPCc___close__PF_Pd0___write__PFPd0_Pd0PCcUl___fmt__PFi_Pd0PCc__FPd0_Pd0__1(((_Bool (*)(void *__anonymous_object1637))__sepPrt__Fb_P9sofstream__1), ((void (*)(void *__anonymous_object1638))__sepReset__F_P9sofstream__1), ((void (*)(void *__anonymous_object1639, _Bool __anonymous_object1640))__sepReset__F_P9sofstreamb__1), ((const char *(*)(void *__anonymous_object1641))__sepGetCur__FPCc_P9sofstream__1), ((void (*)(void *__anonymous_object1642, const char *__anonymous_object1643))__sepSetCur__F_P9sofstreamPCc__1), ((_Bool (*)(void *__anonymous_object1644))__getNL__Fb_P9sofstream__1), ((void (*)(void *__anonymous_object1645, _Bool __anonymous_object1646))__setNL__F_P9sofstreamb__1), ((void (*)(void *__anonymous_object1647))__sepOn__F_P9sofstream__1), ((void (*)(void *__anonymous_object1648))__sepOff__F_P9sofstream__1), ((_Bool (*)(void *__anonymous_object1649))__sepDisable__Fb_P9sofstream__1), ((_Bool (*)(void *__anonymous_object1650))__sepEnable__Fb_P9sofstream__1), ((const char *(*)(void *__anonymous_object1651))__sepGet__FPCc_P9sofstream__1), ((void (*)(void *__anonymous_object1652, const char *__anonymous_object1653))__sepSet__F_P9sofstreamPCc__1), ((const char *(*)(void *__anonymous_object1654))__sepGetTuple__FPCc_P9sofstream__1), ((void (*)(void *__anonymous_object1655, const char *__anonymous_object1656))__sepSetTuple__F_P9sofstreamPCc__1), ((signed int (*)(void *__anonymous_object1657))__fail__Fi_P9sofstream__1), ((signed int (*)(void *__anonymous_object1658))__flush__Fi_P9sofstream__1), ((void (*)(void *__os__P7tostype_1, const char *__name__PCc_1, const char *__mode__PCc_1))__open__F_P9sofstreamPCcPCc__1), ((void (*)(void *__os__P7tostype_1))__close__F_P9sofstream__1), ((void *(*)(void *__anonymous_object1659, const char *__anonymous_object1660, unsigned long int __anonymous_object1661))__write__FP9sofstream_P9sofstreamPCcUl__1), ((signed int (*)(void *__anonymous_object1662, const char *__fmt__PCc_1, ...))__fmt__Fi_P9sofstreamPCc__1), _p0);
     474    }
     475    ((void)(((void)(_tmp_cp_ret11=___operator_bitor__A0_1_0_0___sepPrt__PFb_Pd0___sepReset__PF_Pd0___sepReset__PF_Pd0b___sepGetCur__PFPCc_Pd0___sepSetCur__PF_Pd0PCc___getNL__PFb_Pd0___setNL__PF_Pd0b___sepOn__PF_Pd0___sepOff__PF_Pd0___sepDisable__PFb_Pd0___sepEnable__PFb_Pd0___sepGet__PFPCc_Pd0___sepSet__PF_Pd0PCc___sepGetTuple__PFPCc_Pd0___sepSetTuple__PF_Pd0PCc___fail__PFi_Pd0___flush__PFi_Pd0___open__PF_Pd0PCcPCc___close__PF_Pd0___write__PFPd0_Pd0PCcUl___fmt__PFi_Pd0PCc__FPd0_Pd0PFPd0_Pd0___1(((_Bool (*)(void *__anonymous_object1663))__sepPrt__Fb_P9sofstream__1), ((void (*)(void *__anonymous_object1664))__sepReset__F_P9sofstream__1), ((void (*)(void *__anonymous_object1665, _Bool __anonymous_object1666))__sepReset__F_P9sofstreamb__1), ((const char *(*)(void *__anonymous_object1667))__sepGetCur__FPCc_P9sofstream__1), ((void (*)(void *__anonymous_object1668, const char *__anonymous_object1669))__sepSetCur__F_P9sofstreamPCc__1), ((_Bool (*)(void *__anonymous_object1670))__getNL__Fb_P9sofstream__1), ((void (*)(void *__anonymous_object1671, _Bool __anonymous_object1672))__setNL__F_P9sofstreamb__1), ((void (*)(void *__anonymous_object1673))__sepOn__F_P9sofstream__1), ((void (*)(void *__anonymous_object1674))__sepOff__F_P9sofstream__1), ((_Bool (*)(void *__anonymous_object1675))__sepDisable__Fb_P9sofstream__1), ((_Bool (*)(void *__anonymous_object1676))__sepEnable__Fb_P9sofstream__1), ((const char *(*)(void *__anonymous_object1677))__sepGet__FPCc_P9sofstream__1), ((void (*)(void *__anonymous_object1678, const char *__anonymous_object1679))__sepSet__F_P9sofstreamPCc__1), ((const char *(*)(void *__anonymous_object1680))__sepGetTuple__FPCc_P9sofstream__1), ((void (*)(void *__anonymous_object1681, const char *__anonymous_object1682))__sepSetTuple__F_P9sofstreamPCc__1), ((signed int (*)(void *__anonymous_object1683))__fail__Fi_P9sofstream__1), ((signed int (*)(void *__anonymous_object1684))__flush__Fi_P9sofstream__1), ((void (*)(void *__os__P7tostype_1, const char *__name__PCc_1, const char *__mode__PCc_1))__open__F_P9sofstreamPCcPCc__1), ((void (*)(void *__os__P7tostype_1))__close__F_P9sofstream__1), ((void *(*)(void *__anonymous_object1685, const char *__anonymous_object1686, unsigned long int __anonymous_object1687))__write__FP9sofstream_P9sofstreamPCcUl__1), ((signed int (*)(void *__anonymous_object1688, const char *__fmt__PCc_1, ...))__fmt__Fi_P9sofstreamPCc__1), (((void)(_tmp_cp_ret10=___operator_bitor__A0_1_0_0___sepPrt__PFb_Pd0___sepReset__PF_Pd0___sepReset__PF_Pd0b___sepGetCur__PFPCc_Pd0___sepSetCur__PF_Pd0PCc___getNL__PFb_Pd0___setNL__PF_Pd0b___sepOn__PF_Pd0___sepOff__PF_Pd0___sepDisable__PFb_Pd0___sepEnable__PFb_Pd0___sepGet__PFPCc_Pd0___sepSet__PF_Pd0PCc___sepGetTuple__PFPCc_Pd0___sepSetTuple__PF_Pd0PCc___fail__PFi_Pd0___flush__PFi_Pd0___open__PF_Pd0PCcPCc___close__PF_Pd0___write__PFPd0_Pd0PCcUl___fmt__PFi_Pd0PCc__FPd0_Pd0s__1(((_Bool (*)(void *__anonymous_object1689))__sepPrt__Fb_P9sofstream__1), ((void (*)(void *__anonymous_object1690))__sepReset__F_P9sofstream__1), ((void (*)(void *__anonymous_object1691, _Bool __anonymous_object1692))__sepReset__F_P9sofstreamb__1), ((const char *(*)(void *__anonymous_object1693))__sepGetCur__FPCc_P9sofstream__1), ((void (*)(void *__anonymous_object1694, const char *__anonymous_object1695))__sepSetCur__F_P9sofstreamPCc__1), ((_Bool (*)(void *__anonymous_object1696))__getNL__Fb_P9sofstream__1), ((void (*)(void *__anonymous_object1697, _Bool __anonymous_object1698))__setNL__F_P9sofstreamb__1), ((void (*)(void *__anonymous_object1699))__sepOn__F_P9sofstream__1), ((void (*)(void *__anonymous_object1700))__sepOff__F_P9sofstream__1), ((_Bool (*)(void *__anonymous_object1701))__sepDisable__Fb_P9sofstream__1), ((_Bool (*)(void *__anonymous_object1702))__sepEnable__Fb_P9sofstream__1), ((const char *(*)(void *__anonymous_object1703))__sepGet__FPCc_P9sofstream__1), ((void (*)(void *__anonymous_object1704, const char *__anonymous_object1705))__sepSet__F_P9sofstreamPCc__1), ((const char *(*)(void *__anonymous_object1706))__sepGetTuple__FPCc_P9sofstream__1), ((void (*)(void *__anonymous_object1707, const char *__anonymous_object1708))__sepSetTuple__F_P9sofstreamPCc__1), ((signed int (*)(void *__anonymous_object1709))__fail__Fi_P9sofstream__1), ((signed int (*)(void *__anonymous_object1710))__flush__Fi_P9sofstream__1), ((void (*)(void *__os__P7tostype_1, const char *__name__PCc_1, const char *__mode__PCc_1))__open__F_P9sofstreamPCcPCc__1), ((void (*)(void *__os__P7tostype_1))__close__F_P9sofstream__1), ((void *(*)(void *__anonymous_object1711, const char *__anonymous_object1712, unsigned long int __anonymous_object1713))__write__FP9sofstream_P9sofstreamPCcUl__1), ((signed int (*)(void *__anonymous_object1714, const char *__fmt__PCc_1, ...))__fmt__Fi_P9sofstreamPCc__1), (((void)(_tmp_cp_ret9=___operator_bitor__A0_1_0_0___sepPrt__PFb_Pd0___sepReset__PF_Pd0___sepReset__PF_Pd0b___sepGetCur__PFPCc_Pd0___sepSetCur__PF_Pd0PCc___getNL__PFb_Pd0___setNL__PF_Pd0b___sepOn__PF_Pd0___sepOff__PF_Pd0___sepDisable__PFb_Pd0___sepEnable__PFb_Pd0___sepGet__PFPCc_Pd0___sepSet__PF_Pd0PCc___sepGetTuple__PFPCc_Pd0___sepSetTuple__PF_Pd0PCc___fail__PFi_Pd0___flush__PFi_Pd0___open__PF_Pd0PCcPCc___close__PF_Pd0___write__PFPd0_Pd0PCcUl___fmt__PFi_Pd0PCc__FPd0_Pd0PCc__1(((_Bool (*)(void *__anonymous_object1715))__sepPrt__Fb_P9sofstream__1), ((void (*)(void *__anonymous_object1716))__sepReset__F_P9sofstream__1), ((void (*)(void *__anonymous_object1717, _Bool __anonymous_object1718))__sepReset__F_P9sofstreamb__1), ((const char *(*)(void *__anonymous_object1719))__sepGetCur__FPCc_P9sofstream__1), ((void (*)(void *__anonymous_object1720, const char *__anonymous_object1721))__sepSetCur__F_P9sofstreamPCc__1), ((_Bool (*)(void *__anonymous_object1722))__getNL__Fb_P9sofstream__1), ((void (*)(void *__anonymous_object1723, _Bool __anonymous_object1724))__setNL__F_P9sofstreamb__1), ((void (*)(void *__anonymous_object1725))__sepOn__F_P9sofstream__1), ((void (*)(void *__anonymous_object1726))__sepOff__F_P9sofstream__1), ((_Bool (*)(void *__anonymous_object1727))__sepDisable__Fb_P9sofstream__1), ((_Bool (*)(void *__anonymous_object1728))__sepEnable__Fb_P9sofstream__1), ((const char *(*)(void *__anonymous_object1729))__sepGet__FPCc_P9sofstream__1), ((void (*)(void *__anonymous_object1730, const char *__anonymous_object1731))__sepSet__F_P9sofstreamPCc__1), ((const char *(*)(void *__anonymous_object1732))__sepGetTuple__FPCc_P9sofstream__1), ((void (*)(void *__anonymous_object1733, const char *__anonymous_object1734))__sepSetTuple__F_P9sofstreamPCc__1), ((signed int (*)(void *__anonymous_object1735))__fail__Fi_P9sofstream__1), ((signed int (*)(void *__anonymous_object1736))__flush__Fi_P9sofstream__1), ((void (*)(void *__os__P7tostype_1, const char *__name__PCc_1, const char *__mode__PCc_1))__open__F_P9sofstreamPCcPCc__1), ((void (*)(void *__os__P7tostype_1))__close__F_P9sofstream__1), ((void *(*)(void *__anonymous_object1737, const char *__anonymous_object1738, unsigned long int __anonymous_object1739))__write__FP9sofstream_P9sofstreamPCcUl__1), ((signed int (*)(void *__anonymous_object1740, const char *__fmt__PCc_1, ...))__fmt__Fi_P9sofstreamPCc__1), __sout__P9sofstream_1, "signed short int"))) , _tmp_cp_ret9), __v__s_1))) , _tmp_cp_ret10), ((void *(*)(void *__anonymous_object1741))(&_thunk3))))) , _tmp_cp_ret11));
    507476    ((void)(_tmp_cp_ret9) /* ^?{} */);
    508477    ((void)(_tmp_cp_ret10) /* ^?{} */);
     
    514483    struct ofstream *_tmp_cp_ret14;
    515484    __attribute__ ((unused)) struct ofstream *_thunk4(struct ofstream *_p0){
    516         return __endl__A0_1_0_0___sepPrt__PFb_Pd0___sepReset__PF_Pd0___sepReset__PF_Pd0b___sepGetCur__PFPCc_Pd0___sepSetCur__PF_Pd0PCc___getNL__PFb_Pd0___setNL__PF_Pd0b___sepOn__PF_Pd0___sepOff__PF_Pd0___sepDisable__PFb_Pd0___sepEnable__PFb_Pd0___sepGet__PFPCc_Pd0___sepSet__PF_Pd0PCc___sepGetTuple__PFPCc_Pd0___sepSetTuple__PF_Pd0PCc___fail__PFi_Pd0___flush__PFi_Pd0___open__PF_Pd0PCcPCc___close__PF_Pd0___write__PFPd0_Pd0PCcUl___fmt__PFi_Pd0PCc__FPd0_Pd0__1(((_Bool (*)(void *__anonymous_object1742))__sepPrt__Fb_P9sofstream__1), ((void (*)(void *__anonymous_object1743))__sepReset__F_P9sofstream__1), ((void (*)(void *__anonymous_object1744, _Bool __anonymous_object1745))__sepReset__F_P9sofstreamb__1), ((const char *(*)(void *__anonymous_object1746))__sepGetCur__FPCc_P9sofstream__1), ((void (*)(void *__anonymous_object1747, const char *__anonymous_object1748))__sepSetCur__F_P9sofstreamPCc__1), ((_Bool (*)(void *__anonymous_object1749))__getNL__Fb_P9sofstream__1), ((void (*)(void *__anonymous_object1750, _Bool __anonymous_object1751))__setNL__F_P9sofstreamb__1), ((void (*)(void *__anonymous_object1752))__sepOn__F_P9sofstream__1), ((void (*)(void *__anonymous_object1753))__sepOff__F_P9sofstream__1), ((_Bool (*)(void *__anonymous_object1754))__sepDisable__Fb_P9sofstream__1), ((_Bool (*)(void *__anonymous_object1755))__sepEnable__Fb_P9sofstream__1), ((const char *(*)(void *__anonymous_object1756))__sepGet__FPCc_P9sofstream__1), ((void (*)(void *__anonymous_object1757, const char *__anonymous_object1758))__sepSet__F_P9sofstreamPCc__1), ((const char *(*)(void *__anonymous_object1759))__sepGetTuple__FPCc_P9sofstream__1), ((void (*)(void *__anonymous_object1760, const char *__anonymous_object1761))__sepSetTuple__F_P9sofstreamPCc__1), ((signed int (*)(void *__anonymous_object1762))__fail__Fi_P9sofstream__1), ((signed int (*)(void *__anonymous_object1763))__flush__Fi_P9sofstream__1), ((void (*)(void *__os__P7tostype_1, const char *__name__PCc_1, const char *__mode__PCc_1))__open__F_P9sofstreamPCcPCc__1), ((void (*)(void *__os__P7tostype_1))__close__F_P9sofstream__1), ((void *(*)(void *__anonymous_object1764, const char *__anonymous_object1765, unsigned long int __anonymous_object1766))__write__FP9sofstream_P9sofstreamPCcUl__1), ((signed int (*)(void *__anonymous_object1767, const char *__fmt__PCc_1, ...))__fmt__Fi_P9sofstreamPCc__1), ((void *)_p0));
    517     }
    518     ((void)(((void)(_tmp_cp_ret14=___operator_bitor__A0_1_0_0___sepPrt__PFb_Pd0___sepReset__PF_Pd0___sepReset__PF_Pd0b___sepGetCur__PFPCc_Pd0___sepSetCur__PF_Pd0PCc___getNL__PFb_Pd0___setNL__PF_Pd0b___sepOn__PF_Pd0___sepOff__PF_Pd0___sepDisable__PFb_Pd0___sepEnable__PFb_Pd0___sepGet__PFPCc_Pd0___sepSet__PF_Pd0PCc___sepGetTuple__PFPCc_Pd0___sepSetTuple__PF_Pd0PCc___fail__PFi_Pd0___flush__PFi_Pd0___open__PF_Pd0PCcPCc___close__PF_Pd0___write__PFPd0_Pd0PCcUl___fmt__PFi_Pd0PCc__FPd0_Pd0PFPd0_Pd0___1(((_Bool (*)(void *__anonymous_object1768))__sepPrt__Fb_P9sofstream__1), ((void (*)(void *__anonymous_object1769))__sepReset__F_P9sofstream__1), ((void (*)(void *__anonymous_object1770, _Bool __anonymous_object1771))__sepReset__F_P9sofstreamb__1), ((const char *(*)(void *__anonymous_object1772))__sepGetCur__FPCc_P9sofstream__1), ((void (*)(void *__anonymous_object1773, const char *__anonymous_object1774))__sepSetCur__F_P9sofstreamPCc__1), ((_Bool (*)(void *__anonymous_object1775))__getNL__Fb_P9sofstream__1), ((void (*)(void *__anonymous_object1776, _Bool __anonymous_object1777))__setNL__F_P9sofstreamb__1), ((void (*)(void *__anonymous_object1778))__sepOn__F_P9sofstream__1), ((void (*)(void *__anonymous_object1779))__sepOff__F_P9sofstream__1), ((_Bool (*)(void *__anonymous_object1780))__sepDisable__Fb_P9sofstream__1), ((_Bool (*)(void *__anonymous_object1781))__sepEnable__Fb_P9sofstream__1), ((const char *(*)(void *__anonymous_object1782))__sepGet__FPCc_P9sofstream__1), ((void (*)(void *__anonymous_object1783, const char *__anonymous_object1784))__sepSet__F_P9sofstreamPCc__1), ((const char *(*)(void *__anonymous_object1785))__sepGetTuple__FPCc_P9sofstream__1), ((void (*)(void *__anonymous_object1786, const char *__anonymous_object1787))__sepSetTuple__F_P9sofstreamPCc__1), ((signed int (*)(void *__anonymous_object1788))__fail__Fi_P9sofstream__1), ((signed int (*)(void *__anonymous_object1789))__flush__Fi_P9sofstream__1), ((void (*)(void *__os__P7tostype_1, const char *__name__PCc_1, const char *__mode__PCc_1))__open__F_P9sofstreamPCcPCc__1), ((void (*)(void *__os__P7tostype_1))__close__F_P9sofstream__1), ((void *(*)(void *__anonymous_object1790, const char *__anonymous_object1791, unsigned long int __anonymous_object1792))__write__FP9sofstream_P9sofstreamPCcUl__1), ((signed int (*)(void *__anonymous_object1793, const char *__fmt__PCc_1, ...))__fmt__Fi_P9sofstreamPCc__1), ((void *)(((void)(_tmp_cp_ret13=___operator_bitor__A0_1_0_0___sepPrt__PFb_Pd0___sepReset__PF_Pd0___sepReset__PF_Pd0b___sepGetCur__PFPCc_Pd0___sepSetCur__PF_Pd0PCc___getNL__PFb_Pd0___setNL__PF_Pd0b___sepOn__PF_Pd0___sepOff__PF_Pd0___sepDisable__PFb_Pd0___sepEnable__PFb_Pd0___sepGet__PFPCc_Pd0___sepSet__PF_Pd0PCc___sepGetTuple__PFPCc_Pd0___sepSetTuple__PF_Pd0PCc___fail__PFi_Pd0___flush__PFi_Pd0___open__PF_Pd0PCcPCc___close__PF_Pd0___write__PFPd0_Pd0PCcUl___fmt__PFi_Pd0PCc__FPd0_Pd0Us__1(((_Bool (*)(void *__anonymous_object1794))__sepPrt__Fb_P9sofstream__1), ((void (*)(void *__anonymous_object1795))__sepReset__F_P9sofstream__1), ((void (*)(void *__anonymous_object1796, _Bool __anonymous_object1797))__sepReset__F_P9sofstreamb__1), ((const char *(*)(void *__anonymous_object1798))__sepGetCur__FPCc_P9sofstream__1), ((void (*)(void *__anonymous_object1799, const char *__anonymous_object1800))__sepSetCur__F_P9sofstreamPCc__1), ((_Bool (*)(void *__anonymous_object1801))__getNL__Fb_P9sofstream__1), ((void (*)(void *__anonymous_object1802, _Bool __anonymous_object1803))__setNL__F_P9sofstreamb__1), ((void (*)(void *__anonymous_object1804))__sepOn__F_P9sofstream__1), ((void (*)(void *__anonymous_object1805))__sepOff__F_P9sofstream__1), ((_Bool (*)(void *__anonymous_object1806))__sepDisable__Fb_P9sofstream__1), ((_Bool (*)(void *__anonymous_object1807))__sepEnable__Fb_P9sofstream__1), ((const char *(*)(void *__anonymous_object1808))__sepGet__FPCc_P9sofstream__1), ((void (*)(void *__anonymous_object1809, const char *__anonymous_object1810))__sepSet__F_P9sofstreamPCc__1), ((const char *(*)(void *__anonymous_object1811))__sepGetTuple__FPCc_P9sofstream__1), ((void (*)(void *__anonymous_object1812, const char *__anonymous_object1813))__sepSetTuple__F_P9sofstreamPCc__1), ((signed int (*)(void *__anonymous_object1814))__fail__Fi_P9sofstream__1), ((signed int (*)(void *__anonymous_object1815))__flush__Fi_P9sofstream__1), ((void (*)(void *__os__P7tostype_1, const char *__name__PCc_1, const char *__mode__PCc_1))__open__F_P9sofstreamPCcPCc__1), ((void (*)(void *__os__P7tostype_1))__close__F_P9sofstream__1), ((void *(*)(void *__anonymous_object1816, const char *__anonymous_object1817, unsigned long int __anonymous_object1818))__write__FP9sofstream_P9sofstreamPCcUl__1), ((signed int (*)(void *__anonymous_object1819, const char *__fmt__PCc_1, ...))__fmt__Fi_P9sofstreamPCc__1), ((void *)(((void)(_tmp_cp_ret12=___operator_bitor__A0_1_0_0___sepPrt__PFb_Pd0___sepReset__PF_Pd0___sepReset__PF_Pd0b___sepGetCur__PFPCc_Pd0___sepSetCur__PF_Pd0PCc___getNL__PFb_Pd0___setNL__PF_Pd0b___sepOn__PF_Pd0___sepOff__PF_Pd0___sepDisable__PFb_Pd0___sepEnable__PFb_Pd0___sepGet__PFPCc_Pd0___sepSet__PF_Pd0PCc___sepGetTuple__PFPCc_Pd0___sepSetTuple__PF_Pd0PCc___fail__PFi_Pd0___flush__PFi_Pd0___open__PF_Pd0PCcPCc___close__PF_Pd0___write__PFPd0_Pd0PCcUl___fmt__PFi_Pd0PCc__FPd0_Pd0PCc__1(((_Bool (*)(void *__anonymous_object1820))__sepPrt__Fb_P9sofstream__1), ((void (*)(void *__anonymous_object1821))__sepReset__F_P9sofstream__1), ((void (*)(void *__anonymous_object1822, _Bool __anonymous_object1823))__sepReset__F_P9sofstreamb__1), ((const char *(*)(void *__anonymous_object1824))__sepGetCur__FPCc_P9sofstream__1), ((void (*)(void *__anonymous_object1825, const char *__anonymous_object1826))__sepSetCur__F_P9sofstreamPCc__1), ((_Bool (*)(void *__anonymous_object1827))__getNL__Fb_P9sofstream__1), ((void (*)(void *__anonymous_object1828, _Bool __anonymous_object1829))__setNL__F_P9sofstreamb__1), ((void (*)(void *__anonymous_object1830))__sepOn__F_P9sofstream__1), ((void (*)(void *__anonymous_object1831))__sepOff__F_P9sofstream__1), ((_Bool (*)(void *__anonymous_object1832))__sepDisable__Fb_P9sofstream__1), ((_Bool (*)(void *__anonymous_object1833))__sepEnable__Fb_P9sofstream__1), ((const char *(*)(void *__anonymous_object1834))__sepGet__FPCc_P9sofstream__1), ((void (*)(void *__anonymous_object1835, const char *__anonymous_object1836))__sepSet__F_P9sofstreamPCc__1), ((const char *(*)(void *__anonymous_object1837))__sepGetTuple__FPCc_P9sofstream__1), ((void (*)(void *__anonymous_object1838, const char *__anonymous_object1839))__sepSetTuple__F_P9sofstreamPCc__1), ((signed int (*)(void *__anonymous_object1840))__fail__Fi_P9sofstream__1), ((signed int (*)(void *__anonymous_object1841))__flush__Fi_P9sofstream__1), ((void (*)(void *__os__P7tostype_1, const char *__name__PCc_1, const char *__mode__PCc_1))__open__F_P9sofstreamPCcPCc__1), ((void (*)(void *__os__P7tostype_1))__close__F_P9sofstream__1), ((void *(*)(void *__anonymous_object1842, const char *__anonymous_object1843, unsigned long int __anonymous_object1844))__write__FP9sofstream_P9sofstreamPCcUl__1), ((signed int (*)(void *__anonymous_object1845, const char *__fmt__PCc_1, ...))__fmt__Fi_P9sofstreamPCc__1), ((void *)__sout__P9sofstream_1), "unsigned short int"))) , _tmp_cp_ret12)), __v__Us_1))) , _tmp_cp_ret13)), ((void *(*)(void *__anonymous_object1846))(&_thunk4))))) , _tmp_cp_ret14));
     485        return __endl__A0_1_0_0___sepPrt__PFb_Pd0___sepReset__PF_Pd0___sepReset__PF_Pd0b___sepGetCur__PFPCc_Pd0___sepSetCur__PF_Pd0PCc___getNL__PFb_Pd0___setNL__PF_Pd0b___sepOn__PF_Pd0___sepOff__PF_Pd0___sepDisable__PFb_Pd0___sepEnable__PFb_Pd0___sepGet__PFPCc_Pd0___sepSet__PF_Pd0PCc___sepGetTuple__PFPCc_Pd0___sepSetTuple__PF_Pd0PCc___fail__PFi_Pd0___flush__PFi_Pd0___open__PF_Pd0PCcPCc___close__PF_Pd0___write__PFPd0_Pd0PCcUl___fmt__PFi_Pd0PCc__FPd0_Pd0__1(((_Bool (*)(void *__anonymous_object1742))__sepPrt__Fb_P9sofstream__1), ((void (*)(void *__anonymous_object1743))__sepReset__F_P9sofstream__1), ((void (*)(void *__anonymous_object1744, _Bool __anonymous_object1745))__sepReset__F_P9sofstreamb__1), ((const char *(*)(void *__anonymous_object1746))__sepGetCur__FPCc_P9sofstream__1), ((void (*)(void *__anonymous_object1747, const char *__anonymous_object1748))__sepSetCur__F_P9sofstreamPCc__1), ((_Bool (*)(void *__anonymous_object1749))__getNL__Fb_P9sofstream__1), ((void (*)(void *__anonymous_object1750, _Bool __anonymous_object1751))__setNL__F_P9sofstreamb__1), ((void (*)(void *__anonymous_object1752))__sepOn__F_P9sofstream__1), ((void (*)(void *__anonymous_object1753))__sepOff__F_P9sofstream__1), ((_Bool (*)(void *__anonymous_object1754))__sepDisable__Fb_P9sofstream__1), ((_Bool (*)(void *__anonymous_object1755))__sepEnable__Fb_P9sofstream__1), ((const char *(*)(void *__anonymous_object1756))__sepGet__FPCc_P9sofstream__1), ((void (*)(void *__anonymous_object1757, const char *__anonymous_object1758))__sepSet__F_P9sofstreamPCc__1), ((const char *(*)(void *__anonymous_object1759))__sepGetTuple__FPCc_P9sofstream__1), ((void (*)(void *__anonymous_object1760, const char *__anonymous_object1761))__sepSetTuple__F_P9sofstreamPCc__1), ((signed int (*)(void *__anonymous_object1762))__fail__Fi_P9sofstream__1), ((signed int (*)(void *__anonymous_object1763))__flush__Fi_P9sofstream__1), ((void (*)(void *__os__P7tostype_1, const char *__name__PCc_1, const char *__mode__PCc_1))__open__F_P9sofstreamPCcPCc__1), ((void (*)(void *__os__P7tostype_1))__close__F_P9sofstream__1), ((void *(*)(void *__anonymous_object1764, const char *__anonymous_object1765, unsigned long int __anonymous_object1766))__write__FP9sofstream_P9sofstreamPCcUl__1), ((signed int (*)(void *__anonymous_object1767, const char *__fmt__PCc_1, ...))__fmt__Fi_P9sofstreamPCc__1), _p0);
     486    }
     487    ((void)(((void)(_tmp_cp_ret14=___operator_bitor__A0_1_0_0___sepPrt__PFb_Pd0___sepReset__PF_Pd0___sepReset__PF_Pd0b___sepGetCur__PFPCc_Pd0___sepSetCur__PF_Pd0PCc___getNL__PFb_Pd0___setNL__PF_Pd0b___sepOn__PF_Pd0___sepOff__PF_Pd0___sepDisable__PFb_Pd0___sepEnable__PFb_Pd0___sepGet__PFPCc_Pd0___sepSet__PF_Pd0PCc___sepGetTuple__PFPCc_Pd0___sepSetTuple__PF_Pd0PCc___fail__PFi_Pd0___flush__PFi_Pd0___open__PF_Pd0PCcPCc___close__PF_Pd0___write__PFPd0_Pd0PCcUl___fmt__PFi_Pd0PCc__FPd0_Pd0PFPd0_Pd0___1(((_Bool (*)(void *__anonymous_object1768))__sepPrt__Fb_P9sofstream__1), ((void (*)(void *__anonymous_object1769))__sepReset__F_P9sofstream__1), ((void (*)(void *__anonymous_object1770, _Bool __anonymous_object1771))__sepReset__F_P9sofstreamb__1), ((const char *(*)(void *__anonymous_object1772))__sepGetCur__FPCc_P9sofstream__1), ((void (*)(void *__anonymous_object1773, const char *__anonymous_object1774))__sepSetCur__F_P9sofstreamPCc__1), ((_Bool (*)(void *__anonymous_object1775))__getNL__Fb_P9sofstream__1), ((void (*)(void *__anonymous_object1776, _Bool __anonymous_object1777))__setNL__F_P9sofstreamb__1), ((void (*)(void *__anonymous_object1778))__sepOn__F_P9sofstream__1), ((void (*)(void *__anonymous_object1779))__sepOff__F_P9sofstream__1), ((_Bool (*)(void *__anonymous_object1780))__sepDisable__Fb_P9sofstream__1), ((_Bool (*)(void *__anonymous_object1781))__sepEnable__Fb_P9sofstream__1), ((const char *(*)(void *__anonymous_object1782))__sepGet__FPCc_P9sofstream__1), ((void (*)(void *__anonymous_object1783, const char *__anonymous_object1784))__sepSet__F_P9sofstreamPCc__1), ((const char *(*)(void *__anonymous_object1785))__sepGetTuple__FPCc_P9sofstream__1), ((void (*)(void *__anonymous_object1786, const char *__anonymous_object1787))__sepSetTuple__F_P9sofstreamPCc__1), ((signed int (*)(void *__anonymous_object1788))__fail__Fi_P9sofstream__1), ((signed int (*)(void *__anonymous_object1789))__flush__Fi_P9sofstream__1), ((void (*)(void *__os__P7tostype_1, const char *__name__PCc_1, const char *__mode__PCc_1))__open__F_P9sofstreamPCcPCc__1), ((void (*)(void *__os__P7tostype_1))__close__F_P9sofstream__1), ((void *(*)(void *__anonymous_object1790, const char *__anonymous_object1791, unsigned long int __anonymous_object1792))__write__FP9sofstream_P9sofstreamPCcUl__1), ((signed int (*)(void *__anonymous_object1793, const char *__fmt__PCc_1, ...))__fmt__Fi_P9sofstreamPCc__1), (((void)(_tmp_cp_ret13=___operator_bitor__A0_1_0_0___sepPrt__PFb_Pd0___sepReset__PF_Pd0___sepReset__PF_Pd0b___sepGetCur__PFPCc_Pd0___sepSetCur__PF_Pd0PCc___getNL__PFb_Pd0___setNL__PF_Pd0b___sepOn__PF_Pd0___sepOff__PF_Pd0___sepDisable__PFb_Pd0___sepEnable__PFb_Pd0___sepGet__PFPCc_Pd0___sepSet__PF_Pd0PCc___sepGetTuple__PFPCc_Pd0___sepSetTuple__PF_Pd0PCc___fail__PFi_Pd0___flush__PFi_Pd0___open__PF_Pd0PCcPCc___close__PF_Pd0___write__PFPd0_Pd0PCcUl___fmt__PFi_Pd0PCc__FPd0_Pd0Us__1(((_Bool (*)(void *__anonymous_object1794))__sepPrt__Fb_P9sofstream__1), ((void (*)(void *__anonymous_object1795))__sepReset__F_P9sofstream__1), ((void (*)(void *__anonymous_object1796, _Bool __anonymous_object1797))__sepReset__F_P9sofstreamb__1), ((const char *(*)(void *__anonymous_object1798))__sepGetCur__FPCc_P9sofstream__1), ((void (*)(void *__anonymous_object1799, const char *__anonymous_object1800))__sepSetCur__F_P9sofstreamPCc__1), ((_Bool (*)(void *__anonymous_object1801))__getNL__Fb_P9sofstream__1), ((void (*)(void *__anonymous_object1802, _Bool __anonymous_object1803))__setNL__F_P9sofstreamb__1), ((void (*)(void *__anonymous_object1804))__sepOn__F_P9sofstream__1), ((void (*)(void *__anonymous_object1805))__sepOff__F_P9sofstream__1), ((_Bool (*)(void *__anonymous_object1806))__sepDisable__Fb_P9sofstream__1), ((_Bool (*)(void *__anonymous_object1807))__sepEnable__Fb_P9sofstream__1), ((const char *(*)(void *__anonymous_object1808))__sepGet__FPCc_P9sofstream__1), ((void (*)(void *__anonymous_object1809, const char *__anonymous_object1810))__sepSet__F_P9sofstreamPCc__1), ((const char *(*)(void *__anonymous_object1811))__sepGetTuple__FPCc_P9sofstream__1), ((void (*)(void *__anonymous_object1812, const char *__anonymous_object1813))__sepSetTuple__F_P9sofstreamPCc__1), ((signed int (*)(void *__anonymous_object1814))__fail__Fi_P9sofstream__1), ((signed int (*)(void *__anonymous_object1815))__flush__Fi_P9sofstream__1), ((void (*)(void *__os__P7tostype_1, const char *__name__PCc_1, const char *__mode__PCc_1))__open__F_P9sofstreamPCcPCc__1), ((void (*)(void *__os__P7tostype_1))__close__F_P9sofstream__1), ((void *(*)(void *__anonymous_object1816, const char *__anonymous_object1817, unsigned long int __anonymous_object1818))__write__FP9sofstream_P9sofstreamPCcUl__1), ((signed int (*)(void *__anonymous_object1819, const char *__fmt__PCc_1, ...))__fmt__Fi_P9sofstreamPCc__1), (((void)(_tmp_cp_ret12=___operator_bitor__A0_1_0_0___sepPrt__PFb_Pd0___sepReset__PF_Pd0___sepReset__PF_Pd0b___sepGetCur__PFPCc_Pd0___sepSetCur__PF_Pd0PCc___getNL__PFb_Pd0___setNL__PF_Pd0b___sepOn__PF_Pd0___sepOff__PF_Pd0___sepDisable__PFb_Pd0___sepEnable__PFb_Pd0___sepGet__PFPCc_Pd0___sepSet__PF_Pd0PCc___sepGetTuple__PFPCc_Pd0___sepSetTuple__PF_Pd0PCc___fail__PFi_Pd0___flush__PFi_Pd0___open__PF_Pd0PCcPCc___close__PF_Pd0___write__PFPd0_Pd0PCcUl___fmt__PFi_Pd0PCc__FPd0_Pd0PCc__1(((_Bool (*)(void *__anonymous_object1820))__sepPrt__Fb_P9sofstream__1), ((void (*)(void *__anonymous_object1821))__sepReset__F_P9sofstream__1), ((void (*)(void *__anonymous_object1822, _Bool __anonymous_object1823))__sepReset__F_P9sofstreamb__1), ((const char *(*)(void *__anonymous_object1824))__sepGetCur__FPCc_P9sofstream__1), ((void (*)(void *__anonymous_object1825, const char *__anonymous_object1826))__sepSetCur__F_P9sofstreamPCc__1), ((_Bool (*)(void *__anonymous_object1827))__getNL__Fb_P9sofstream__1), ((void (*)(void *__anonymous_object1828, _Bool __anonymous_object1829))__setNL__F_P9sofstreamb__1), ((void (*)(void *__anonymous_object1830))__sepOn__F_P9sofstream__1), ((void (*)(void *__anonymous_object1831))__sepOff__F_P9sofstream__1), ((_Bool (*)(void *__anonymous_object1832))__sepDisable__Fb_P9sofstream__1), ((_Bool (*)(void *__anonymous_object1833))__sepEnable__Fb_P9sofstream__1), ((const char *(*)(void *__anonymous_object1834))__sepGet__FPCc_P9sofstream__1), ((void (*)(void *__anonymous_object1835, const char *__anonymous_object1836))__sepSet__F_P9sofstreamPCc__1), ((const char *(*)(void *__anonymous_object1837))__sepGetTuple__FPCc_P9sofstream__1), ((void (*)(void *__anonymous_object1838, const char *__anonymous_object1839))__sepSetTuple__F_P9sofstreamPCc__1), ((signed int (*)(void *__anonymous_object1840))__fail__Fi_P9sofstream__1), ((signed int (*)(void *__anonymous_object1841))__flush__Fi_P9sofstream__1), ((void (*)(void *__os__P7tostype_1, const char *__name__PCc_1, const char *__mode__PCc_1))__open__F_P9sofstreamPCcPCc__1), ((void (*)(void *__os__P7tostype_1))__close__F_P9sofstream__1), ((void *(*)(void *__anonymous_object1842, const char *__anonymous_object1843, unsigned long int __anonymous_object1844))__write__FP9sofstream_P9sofstreamPCcUl__1), ((signed int (*)(void *__anonymous_object1845, const char *__fmt__PCc_1, ...))__fmt__Fi_P9sofstreamPCc__1), __sout__P9sofstream_1, "unsigned short int"))) , _tmp_cp_ret12), __v__Us_1))) , _tmp_cp_ret13), ((void *(*)(void *__anonymous_object1846))(&_thunk4))))) , _tmp_cp_ret14));
    519488    ((void)(_tmp_cp_ret12) /* ^?{} */);
    520489    ((void)(_tmp_cp_ret13) /* ^?{} */);
     
    526495    struct ofstream *_tmp_cp_ret17;
    527496    __attribute__ ((unused)) struct ofstream *_thunk5(struct ofstream *_p0){
    528         return __endl__A0_1_0_0___sepPrt__PFb_Pd0___sepReset__PF_Pd0___sepReset__PF_Pd0b___sepGetCur__PFPCc_Pd0___sepSetCur__PF_Pd0PCc___getNL__PFb_Pd0___setNL__PF_Pd0b___sepOn__PF_Pd0___sepOff__PF_Pd0___sepDisable__PFb_Pd0___sepEnable__PFb_Pd0___sepGet__PFPCc_Pd0___sepSet__PF_Pd0PCc___sepGetTuple__PFPCc_Pd0___sepSetTuple__PF_Pd0PCc___fail__PFi_Pd0___flush__PFi_Pd0___open__PF_Pd0PCcPCc___close__PF_Pd0___write__PFPd0_Pd0PCcUl___fmt__PFi_Pd0PCc__FPd0_Pd0__1(((_Bool (*)(void *__anonymous_object1847))__sepPrt__Fb_P9sofstream__1), ((void (*)(void *__anonymous_object1848))__sepReset__F_P9sofstream__1), ((void (*)(void *__anonymous_object1849, _Bool __anonymous_object1850))__sepReset__F_P9sofstreamb__1), ((const char *(*)(void *__anonymous_object1851))__sepGetCur__FPCc_P9sofstream__1), ((void (*)(void *__anonymous_object1852, const char *__anonymous_object1853))__sepSetCur__F_P9sofstreamPCc__1), ((_Bool (*)(void *__anonymous_object1854))__getNL__Fb_P9sofstream__1), ((void (*)(void *__anonymous_object1855, _Bool __anonymous_object1856))__setNL__F_P9sofstreamb__1), ((void (*)(void *__anonymous_object1857))__sepOn__F_P9sofstream__1), ((void (*)(void *__anonymous_object1858))__sepOff__F_P9sofstream__1), ((_Bool (*)(void *__anonymous_object1859))__sepDisable__Fb_P9sofstream__1), ((_Bool (*)(void *__anonymous_object1860))__sepEnable__Fb_P9sofstream__1), ((const char *(*)(void *__anonymous_object1861))__sepGet__FPCc_P9sofstream__1), ((void (*)(void *__anonymous_object1862, const char *__anonymous_object1863))__sepSet__F_P9sofstreamPCc__1), ((const char *(*)(void *__anonymous_object1864))__sepGetTuple__FPCc_P9sofstream__1), ((void (*)(void *__anonymous_object1865, const char *__anonymous_object1866))__sepSetTuple__F_P9sofstreamPCc__1), ((signed int (*)(void *__anonymous_object1867))__fail__Fi_P9sofstream__1), ((signed int (*)(void *__anonymous_object1868))__flush__Fi_P9sofstream__1), ((void (*)(void *__os__P7tostype_1, const char *__name__PCc_1, const char *__mode__PCc_1))__open__F_P9sofstreamPCcPCc__1), ((void (*)(void *__os__P7tostype_1))__close__F_P9sofstream__1), ((void *(*)(void *__anonymous_object1869, const char *__anonymous_object1870, unsigned long int __anonymous_object1871))__write__FP9sofstream_P9sofstreamPCcUl__1), ((signed int (*)(void *__anonymous_object1872, const char *__fmt__PCc_1, ...))__fmt__Fi_P9sofstreamPCc__1), ((void *)_p0));
    529     }
    530     ((void)(((void)(_tmp_cp_ret17=___operator_bitor__A0_1_0_0___sepPrt__PFb_Pd0___sepReset__PF_Pd0___sepReset__PF_Pd0b___sepGetCur__PFPCc_Pd0___sepSetCur__PF_Pd0PCc___getNL__PFb_Pd0___setNL__PF_Pd0b___sepOn__PF_Pd0___sepOff__PF_Pd0___sepDisable__PFb_Pd0___sepEnable__PFb_Pd0___sepGet__PFPCc_Pd0___sepSet__PF_Pd0PCc___sepGetTuple__PFPCc_Pd0___sepSetTuple__PF_Pd0PCc___fail__PFi_Pd0___flush__PFi_Pd0___open__PF_Pd0PCcPCc___close__PF_Pd0___write__PFPd0_Pd0PCcUl___fmt__PFi_Pd0PCc__FPd0_Pd0PFPd0_Pd0___1(((_Bool (*)(void *__anonymous_object1873))__sepPrt__Fb_P9sofstream__1), ((void (*)(void *__anonymous_object1874))__sepReset__F_P9sofstream__1), ((void (*)(void *__anonymous_object1875, _Bool __anonymous_object1876))__sepReset__F_P9sofstreamb__1), ((const char *(*)(void *__anonymous_object1877))__sepGetCur__FPCc_P9sofstream__1), ((void (*)(void *__anonymous_object1878, const char *__anonymous_object1879))__sepSetCur__F_P9sofstreamPCc__1), ((_Bool (*)(void *__anonymous_object1880))__getNL__Fb_P9sofstream__1), ((void (*)(void *__anonymous_object1881, _Bool __anonymous_object1882))__setNL__F_P9sofstreamb__1), ((void (*)(void *__anonymous_object1883))__sepOn__F_P9sofstream__1), ((void (*)(void *__anonymous_object1884))__sepOff__F_P9sofstream__1), ((_Bool (*)(void *__anonymous_object1885))__sepDisable__Fb_P9sofstream__1), ((_Bool (*)(void *__anonymous_object1886))__sepEnable__Fb_P9sofstream__1), ((const char *(*)(void *__anonymous_object1887))__sepGet__FPCc_P9sofstream__1), ((void (*)(void *__anonymous_object1888, const char *__anonymous_object1889))__sepSet__F_P9sofstreamPCc__1), ((const char *(*)(void *__anonymous_object1890))__sepGetTuple__FPCc_P9sofstream__1), ((void (*)(void *__anonymous_object1891, const char *__anonymous_object1892))__sepSetTuple__F_P9sofstreamPCc__1), ((signed int (*)(void *__anonymous_object1893))__fail__Fi_P9sofstream__1), ((signed int (*)(void *__anonymous_object1894))__flush__Fi_P9sofstream__1), ((void (*)(void *__os__P7tostype_1, const char *__name__PCc_1, const char *__mode__PCc_1))__open__F_P9sofstreamPCcPCc__1), ((void (*)(void *__os__P7tostype_1))__close__F_P9sofstream__1), ((void *(*)(void *__anonymous_object1895, const char *__anonymous_object1896, unsigned long int __anonymous_object1897))__write__FP9sofstream_P9sofstreamPCcUl__1), ((signed int (*)(void *__anonymous_object1898, const char *__fmt__PCc_1, ...))__fmt__Fi_P9sofstreamPCc__1), ((void *)(((void)(_tmp_cp_ret16=___operator_bitor__A0_1_0_0___sepPrt__PFb_Pd0___sepReset__PF_Pd0___sepReset__PF_Pd0b___sepGetCur__PFPCc_Pd0___sepSetCur__PF_Pd0PCc___getNL__PFb_Pd0___setNL__PF_Pd0b___sepOn__PF_Pd0___sepOff__PF_Pd0___sepDisable__PFb_Pd0___sepEnable__PFb_Pd0___sepGet__PFPCc_Pd0___sepSet__PF_Pd0PCc___sepGetTuple__PFPCc_Pd0___sepSetTuple__PF_Pd0PCc___fail__PFi_Pd0___flush__PFi_Pd0___open__PF_Pd0PCcPCc___close__PF_Pd0___write__PFPd0_Pd0PCcUl___fmt__PFi_Pd0PCc__FPd0_Pd0Ul__1(((_Bool (*)(void *__anonymous_object1899))__sepPrt__Fb_P9sofstream__1), ((void (*)(void *__anonymous_object1900))__sepReset__F_P9sofstream__1), ((void (*)(void *__anonymous_object1901, _Bool __anonymous_object1902))__sepReset__F_P9sofstreamb__1), ((const char *(*)(void *__anonymous_object1903))__sepGetCur__FPCc_P9sofstream__1), ((void (*)(void *__anonymous_object1904, const char *__anonymous_object1905))__sepSetCur__F_P9sofstreamPCc__1), ((_Bool (*)(void *__anonymous_object1906))__getNL__Fb_P9sofstream__1), ((void (*)(void *__anonymous_object1907, _Bool __anonymous_object1908))__setNL__F_P9sofstreamb__1), ((void (*)(void *__anonymous_object1909))__sepOn__F_P9sofstream__1), ((void (*)(void *__anonymous_object1910))__sepOff__F_P9sofstream__1), ((_Bool (*)(void *__anonymous_object1911))__sepDisable__Fb_P9sofstream__1), ((_Bool (*)(void *__anonymous_object1912))__sepEnable__Fb_P9sofstream__1), ((const char *(*)(void *__anonymous_object1913))__sepGet__FPCc_P9sofstream__1), ((void (*)(void *__anonymous_object1914, const char *__anonymous_object1915))__sepSet__F_P9sofstreamPCc__1), ((const char *(*)(void *__anonymous_object1916))__sepGetTuple__FPCc_P9sofstream__1), ((void (*)(void *__anonymous_object1917, const char *__anonymous_object1918))__sepSetTuple__F_P9sofstreamPCc__1), ((signed int (*)(void *__anonymous_object1919))__fail__Fi_P9sofstream__1), ((signed int (*)(void *__anonymous_object1920))__flush__Fi_P9sofstream__1), ((void (*)(void *__os__P7tostype_1, const char *__name__PCc_1, const char *__mode__PCc_1))__open__F_P9sofstreamPCcPCc__1), ((void (*)(void *__os__P7tostype_1))__close__F_P9sofstream__1), ((void *(*)(void *__anonymous_object1921, const char *__anonymous_object1922, unsigned long int __anonymous_object1923))__write__FP9sofstream_P9sofstreamPCcUl__1), ((signed int (*)(void *__anonymous_object1924, const char *__fmt__PCc_1, ...))__fmt__Fi_P9sofstreamPCc__1), ((void *)(((void)(_tmp_cp_ret15=___operator_bitor__A0_1_0_0___sepPrt__PFb_Pd0___sepReset__PF_Pd0___sepReset__PF_Pd0b___sepGetCur__PFPCc_Pd0___sepSetCur__PF_Pd0PCc___getNL__PFb_Pd0___setNL__PF_Pd0b___sepOn__PF_Pd0___sepOff__PF_Pd0___sepDisable__PFb_Pd0___sepEnable__PFb_Pd0___sepGet__PFPCc_Pd0___sepSet__PF_Pd0PCc___sepGetTuple__PFPCc_Pd0___sepSetTuple__PF_Pd0PCc___fail__PFi_Pd0___flush__PFi_Pd0___open__PF_Pd0PCcPCc___close__PF_Pd0___write__PFPd0_Pd0PCcUl___fmt__PFi_Pd0PCc__FPd0_Pd0PCc__1(((_Bool (*)(void *__anonymous_object1925))__sepPrt__Fb_P9sofstream__1), ((void (*)(void *__anonymous_object1926))__sepReset__F_P9sofstream__1), ((void (*)(void *__anonymous_object1927, _Bool __anonymous_object1928))__sepReset__F_P9sofstreamb__1), ((const char *(*)(void *__anonymous_object1929))__sepGetCur__FPCc_P9sofstream__1), ((void (*)(void *__anonymous_object1930, const char *__anonymous_object1931))__sepSetCur__F_P9sofstreamPCc__1), ((_Bool (*)(void *__anonymous_object1932))__getNL__Fb_P9sofstream__1), ((void (*)(void *__anonymous_object1933, _Bool __anonymous_object1934))__setNL__F_P9sofstreamb__1), ((void (*)(void *__anonymous_object1935))__sepOn__F_P9sofstream__1), ((void (*)(void *__anonymous_object1936))__sepOff__F_P9sofstream__1), ((_Bool (*)(void *__anonymous_object1937))__sepDisable__Fb_P9sofstream__1), ((_Bool (*)(void *__anonymous_object1938))__sepEnable__Fb_P9sofstream__1), ((const char *(*)(void *__anonymous_object1939))__sepGet__FPCc_P9sofstream__1), ((void (*)(void *__anonymous_object1940, const char *__anonymous_object1941))__sepSet__F_P9sofstreamPCc__1), ((const char *(*)(void *__anonymous_object1942))__sepGetTuple__FPCc_P9sofstream__1), ((void (*)(void *__anonymous_object1943, const char *__anonymous_object1944))__sepSetTuple__F_P9sofstreamPCc__1), ((signed int (*)(void *__anonymous_object1945))__fail__Fi_P9sofstream__1), ((signed int (*)(void *__anonymous_object1946))__flush__Fi_P9sofstream__1), ((void (*)(void *__os__P7tostype_1, const char *__name__PCc_1, const char *__mode__PCc_1))__open__F_P9sofstreamPCcPCc__1), ((void (*)(void *__os__P7tostype_1))__close__F_P9sofstream__1), ((void *(*)(void *__anonymous_object1947, const char *__anonymous_object1948, unsigned long int __anonymous_object1949))__write__FP9sofstream_P9sofstreamPCcUl__1), ((signed int (*)(void *__anonymous_object1950, const char *__fmt__PCc_1, ...))__fmt__Fi_P9sofstreamPCc__1), ((void *)__sout__P9sofstream_1), "size_t"))) , _tmp_cp_ret15)), __v__Ul_1))) , _tmp_cp_ret16)), ((void *(*)(void *__anonymous_object1951))(&_thunk5))))) , _tmp_cp_ret17));
     497        return __endl__A0_1_0_0___sepPrt__PFb_Pd0___sepReset__PF_Pd0___sepReset__PF_Pd0b___sepGetCur__PFPCc_Pd0___sepSetCur__PF_Pd0PCc___getNL__PFb_Pd0___setNL__PF_Pd0b___sepOn__PF_Pd0___sepOff__PF_Pd0___sepDisable__PFb_Pd0___sepEnable__PFb_Pd0___sepGet__PFPCc_Pd0___sepSet__PF_Pd0PCc___sepGetTuple__PFPCc_Pd0___sepSetTuple__PF_Pd0PCc___fail__PFi_Pd0___flush__PFi_Pd0___open__PF_Pd0PCcPCc___close__PF_Pd0___write__PFPd0_Pd0PCcUl___fmt__PFi_Pd0PCc__FPd0_Pd0__1(((_Bool (*)(void *__anonymous_object1847))__sepPrt__Fb_P9sofstream__1), ((void (*)(void *__anonymous_object1848))__sepReset__F_P9sofstream__1), ((void (*)(void *__anonymous_object1849, _Bool __anonymous_object1850))__sepReset__F_P9sofstreamb__1), ((const char *(*)(void *__anonymous_object1851))__sepGetCur__FPCc_P9sofstream__1), ((void (*)(void *__anonymous_object1852, const char *__anonymous_object1853))__sepSetCur__F_P9sofstreamPCc__1), ((_Bool (*)(void *__anonymous_object1854))__getNL__Fb_P9sofstream__1), ((void (*)(void *__anonymous_object1855, _Bool __anonymous_object1856))__setNL__F_P9sofstreamb__1), ((void (*)(void *__anonymous_object1857))__sepOn__F_P9sofstream__1), ((void (*)(void *__anonymous_object1858))__sepOff__F_P9sofstream__1), ((_Bool (*)(void *__anonymous_object1859))__sepDisable__Fb_P9sofstream__1), ((_Bool (*)(void *__anonymous_object1860))__sepEnable__Fb_P9sofstream__1), ((const char *(*)(void *__anonymous_object1861))__sepGet__FPCc_P9sofstream__1), ((void (*)(void *__anonymous_object1862, const char *__anonymous_object1863))__sepSet__F_P9sofstreamPCc__1), ((const char *(*)(void *__anonymous_object1864))__sepGetTuple__FPCc_P9sofstream__1), ((void (*)(void *__anonymous_object1865, const char *__anonymous_object1866))__sepSetTuple__F_P9sofstreamPCc__1), ((signed int (*)(void *__anonymous_object1867))__fail__Fi_P9sofstream__1), ((signed int (*)(void *__anonymous_object1868))__flush__Fi_P9sofstream__1), ((void (*)(void *__os__P7tostype_1, const char *__name__PCc_1, const char *__mode__PCc_1))__open__F_P9sofstreamPCcPCc__1), ((void (*)(void *__os__P7tostype_1))__close__F_P9sofstream__1), ((void *(*)(void *__anonymous_object1869, const char *__anonymous_object1870, unsigned long int __anonymous_object1871))__write__FP9sofstream_P9sofstreamPCcUl__1), ((signed int (*)(void *__anonymous_object1872, const char *__fmt__PCc_1, ...))__fmt__Fi_P9sofstreamPCc__1), _p0);
     498    }
     499    ((void)(((void)(_tmp_cp_ret17=___operator_bitor__A0_1_0_0___sepPrt__PFb_Pd0___sepReset__PF_Pd0___sepReset__PF_Pd0b___sepGetCur__PFPCc_Pd0___sepSetCur__PF_Pd0PCc___getNL__PFb_Pd0___setNL__PF_Pd0b___sepOn__PF_Pd0___sepOff__PF_Pd0___sepDisable__PFb_Pd0___sepEnable__PFb_Pd0___sepGet__PFPCc_Pd0___sepSet__PF_Pd0PCc___sepGetTuple__PFPCc_Pd0___sepSetTuple__PF_Pd0PCc___fail__PFi_Pd0___flush__PFi_Pd0___open__PF_Pd0PCcPCc___close__PF_Pd0___write__PFPd0_Pd0PCcUl___fmt__PFi_Pd0PCc__FPd0_Pd0PFPd0_Pd0___1(((_Bool (*)(void *__anonymous_object1873))__sepPrt__Fb_P9sofstream__1), ((void (*)(void *__anonymous_object1874))__sepReset__F_P9sofstream__1), ((void (*)(void *__anonymous_object1875, _Bool __anonymous_object1876))__sepReset__F_P9sofstreamb__1), ((const char *(*)(void *__anonymous_object1877))__sepGetCur__FPCc_P9sofstream__1), ((void (*)(void *__anonymous_object1878, const char *__anonymous_object1879))__sepSetCur__F_P9sofstreamPCc__1), ((_Bool (*)(void *__anonymous_object1880))__getNL__Fb_P9sofstream__1), ((void (*)(void *__anonymous_object1881, _Bool __anonymous_object1882))__setNL__F_P9sofstreamb__1), ((void (*)(void *__anonymous_object1883))__sepOn__F_P9sofstream__1), ((void (*)(void *__anonymous_object1884))__sepOff__F_P9sofstream__1), ((_Bool (*)(void *__anonymous_object1885))__sepDisable__Fb_P9sofstream__1), ((_Bool (*)(void *__anonymous_object1886))__sepEnable__Fb_P9sofstream__1), ((const char *(*)(void *__anonymous_object1887))__sepGet__FPCc_P9sofstream__1), ((void (*)(void *__anonymous_object1888, const char *__anonymous_object1889))__sepSet__F_P9sofstreamPCc__1), ((const char *(*)(void *__anonymous_object1890))__sepGetTuple__FPCc_P9sofstream__1), ((void (*)(void *__anonymous_object1891, const char *__anonymous_object1892))__sepSetTuple__F_P9sofstreamPCc__1), ((signed int (*)(void *__anonymous_object1893))__fail__Fi_P9sofstream__1), ((signed int (*)(void *__anonymous_object1894))__flush__Fi_P9sofstream__1), ((void (*)(void *__os__P7tostype_1, const char *__name__PCc_1, const char *__mode__PCc_1))__open__F_P9sofstreamPCcPCc__1), ((void (*)(void *__os__P7tostype_1))__close__F_P9sofstream__1), ((void *(*)(void *__anonymous_object1895, const char *__anonymous_object1896, unsigned long int __anonymous_object1897))__write__FP9sofstream_P9sofstreamPCcUl__1), ((signed int (*)(void *__anonymous_object1898, const char *__fmt__PCc_1, ...))__fmt__Fi_P9sofstreamPCc__1), (((void)(_tmp_cp_ret16=___operator_bitor__A0_1_0_0___sepPrt__PFb_Pd0___sepReset__PF_Pd0___sepReset__PF_Pd0b___sepGetCur__PFPCc_Pd0___sepSetCur__PF_Pd0PCc___getNL__PFb_Pd0___setNL__PF_Pd0b___sepOn__PF_Pd0___sepOff__PF_Pd0___sepDisable__PFb_Pd0___sepEnable__PFb_Pd0___sepGet__PFPCc_Pd0___sepSet__PF_Pd0PCc___sepGetTuple__PFPCc_Pd0___sepSetTuple__PF_Pd0PCc___fail__PFi_Pd0___flush__PFi_Pd0___open__PF_Pd0PCcPCc___close__PF_Pd0___write__PFPd0_Pd0PCcUl___fmt__PFi_Pd0PCc__FPd0_Pd0Ul__1(((_Bool (*)(void *__anonymous_object1899))__sepPrt__Fb_P9sofstream__1), ((void (*)(void *__anonymous_object1900))__sepReset__F_P9sofstream__1), ((void (*)(void *__anonymous_object1901, _Bool __anonymous_object1902))__sepReset__F_P9sofstreamb__1), ((const char *(*)(void *__anonymous_object1903))__sepGetCur__FPCc_P9sofstream__1), ((void (*)(void *__anonymous_object1904, const char *__anonymous_object1905))__sepSetCur__F_P9sofstreamPCc__1), ((_Bool (*)(void *__anonymous_object1906))__getNL__Fb_P9sofstream__1), ((void (*)(void *__anonymous_object1907, _Bool __anonymous_object1908))__setNL__F_P9sofstreamb__1), ((void (*)(void *__anonymous_object1909))__sepOn__F_P9sofstream__1), ((void (*)(void *__anonymous_object1910))__sepOff__F_P9sofstream__1), ((_Bool (*)(void *__anonymous_object1911))__sepDisable__Fb_P9sofstream__1), ((_Bool (*)(void *__anonymous_object1912))__sepEnable__Fb_P9sofstream__1), ((const char *(*)(void *__anonymous_object1913))__sepGet__FPCc_P9sofstream__1), ((void (*)(void *__anonymous_object1914, const char *__anonymous_object1915))__sepSet__F_P9sofstreamPCc__1), ((const char *(*)(void *__anonymous_object1916))__sepGetTuple__FPCc_P9sofstream__1), ((void (*)(void *__anonymous_object1917, const char *__anonymous_object1918))__sepSetTuple__F_P9sofstreamPCc__1), ((signed int (*)(void *__anonymous_object1919))__fail__Fi_P9sofstream__1), ((signed int (*)(void *__anonymous_object1920))__flush__Fi_P9sofstream__1), ((void (*)(void *__os__P7tostype_1, const char *__name__PCc_1, const char *__mode__PCc_1))__open__F_P9sofstreamPCcPCc__1), ((void (*)(void *__os__P7tostype_1))__close__F_P9sofstream__1), ((void *(*)(void *__anonymous_object1921, const char *__anonymous_object1922, unsigned long int __anonymous_object1923))__write__FP9sofstream_P9sofstreamPCcUl__1), ((signed int (*)(void *__anonymous_object1924, const char *__fmt__PCc_1, ...))__fmt__Fi_P9sofstreamPCc__1), (((void)(_tmp_cp_ret15=___operator_bitor__A0_1_0_0___sepPrt__PFb_Pd0___sepReset__PF_Pd0___sepReset__PF_Pd0b___sepGetCur__PFPCc_Pd0___sepSetCur__PF_Pd0PCc___getNL__PFb_Pd0___setNL__PF_Pd0b___sepOn__PF_Pd0___sepOff__PF_Pd0___sepDisable__PFb_Pd0___sepEnable__PFb_Pd0___sepGet__PFPCc_Pd0___sepSet__PF_Pd0PCc___sepGetTuple__PFPCc_Pd0___sepSetTuple__PF_Pd0PCc___fail__PFi_Pd0___flush__PFi_Pd0___open__PF_Pd0PCcPCc___close__PF_Pd0___write__PFPd0_Pd0PCcUl___fmt__PFi_Pd0PCc__FPd0_Pd0PCc__1(((_Bool (*)(void *__anonymous_object1925))__sepPrt__Fb_P9sofstream__1), ((void (*)(void *__anonymous_object1926))__sepReset__F_P9sofstream__1), ((void (*)(void *__anonymous_object1927, _Bool __anonymous_object1928))__sepReset__F_P9sofstreamb__1), ((const char *(*)(void *__anonymous_object1929))__sepGetCur__FPCc_P9sofstream__1), ((void (*)(void *__anonymous_object1930, const char *__anonymous_object1931))__sepSetCur__F_P9sofstreamPCc__1), ((_Bool (*)(void *__anonymous_object1932))__getNL__Fb_P9sofstream__1), ((void (*)(void *__anonymous_object1933, _Bool __anonymous_object1934))__setNL__F_P9sofstreamb__1), ((void (*)(void *__anonymous_object1935))__sepOn__F_P9sofstream__1), ((void (*)(void *__anonymous_object1936))__sepOff__F_P9sofstream__1), ((_Bool (*)(void *__anonymous_object1937))__sepDisable__Fb_P9sofstream__1), ((_Bool (*)(void *__anonymous_object1938))__sepEnable__Fb_P9sofstream__1), ((const char *(*)(void *__anonymous_object1939))__sepGet__FPCc_P9sofstream__1), ((void (*)(void *__anonymous_object1940, const char *__anonymous_object1941))__sepSet__F_P9sofstreamPCc__1), ((const char *(*)(void *__anonymous_object1942))__sepGetTuple__FPCc_P9sofstream__1), ((void (*)(void *__anonymous_object1943, const char *__anonymous_object1944))__sepSetTuple__F_P9sofstreamPCc__1), ((signed int (*)(void *__anonymous_object1945))__fail__Fi_P9sofstream__1), ((signed int (*)(void *__anonymous_object1946))__flush__Fi_P9sofstream__1), ((void (*)(void *__os__P7tostype_1, const char *__name__PCc_1, const char *__mode__PCc_1))__open__F_P9sofstreamPCcPCc__1), ((void (*)(void *__os__P7tostype_1))__close__F_P9sofstream__1), ((void *(*)(void *__anonymous_object1947, const char *__anonymous_object1948, unsigned long int __anonymous_object1949))__write__FP9sofstream_P9sofstreamPCcUl__1), ((signed int (*)(void *__anonymous_object1950, const char *__fmt__PCc_1, ...))__fmt__Fi_P9sofstreamPCc__1), __sout__P9sofstream_1, "size_t"))) , _tmp_cp_ret15), __v__Ul_1))) , _tmp_cp_ret16), ((void *(*)(void *__anonymous_object1951))(&_thunk5))))) , _tmp_cp_ret17));
    531500    ((void)(_tmp_cp_ret15) /* ^?{} */);
    532501    ((void)(_tmp_cp_ret16) /* ^?{} */);
     
    739708    ((void)0123456789.e-09L);
    740709    ((void)0123456789.e-09DL);
    741     ((void)(+0123456789.e-09));
    742     ((void)(+0123456789.e-09f));
    743     ((void)(+0123456789.e-09l));
    744     ((void)(+0123456789.e-09F));
    745     ((void)(+0123456789.e-09L));
    746     ((void)(+0123456789.e-09DL));
     710    ((void)(-0123456789.e-09));
     711    ((void)(-0123456789.e-09f));
     712    ((void)(-0123456789.e-09l));
     713    ((void)(-0123456789.e-09F));
     714    ((void)(-0123456789.e-09L));
     715    ((void)(-0123456789.e-09DL));
    747716    ((void)(-0123456789.e-09));
    748717    ((void)(-0123456789.e-09f));
     
    883852    ((void)0123456789.0123456789E-09L);
    884853    ((void)0123456789.0123456789E-09DL);
    885     ((void)(+0123456789.0123456789E-09));
    886     ((void)(+0123456789.0123456789E-09f));
    887     ((void)(+0123456789.0123456789E-09l));
    888     ((void)(+0123456789.0123456789E-09F));
    889     ((void)(+0123456789.0123456789E-09L));
    890     ((void)(+0123456789.0123456789E-09DL));
     854    ((void)(-0123456789.0123456789E-09));
     855    ((void)(-0123456789.0123456789E-09f));
     856    ((void)(-0123456789.0123456789E-09l));
     857    ((void)(-0123456789.0123456789E-09F));
     858    ((void)(-0123456789.0123456789E-09L));
     859    ((void)(-0123456789.0123456789E-09DL));
    891860    ((void)(-0123456789.0123456789E-09));
    892861    ((void)(-0123456789.0123456789E-09f));
     
    930899    ((void)0x0123456789.p-09F);
    931900    ((void)0x0123456789.p-09L);
    932     ((void)(+0x0123456789.p-09));
    933     ((void)(+0x0123456789.p-09f));
    934     ((void)(+0x0123456789.p-09l));
    935     ((void)(+0x0123456789.p-09F));
    936     ((void)(+0x0123456789.p-09L));
     901    ((void)(-0x0123456789.p-09));
     902    ((void)(-0x0123456789.p-09f));
     903    ((void)(-0x0123456789.p-09l));
     904    ((void)(-0x0123456789.p-09F));
     905    ((void)(-0x0123456789.p-09L));
    937906    ((void)(-0x0123456789.p-09));
    938907    ((void)(-0x0123456789.p-09f));
     
    975944    ((void)0x.0123456789P-09F);
    976945    ((void)0x.0123456789P-09L);
    977     ((void)(+0x.0123456789P-09));
    978     ((void)(+0x.0123456789P-09f));
    979     ((void)(+0x.0123456789P-09l));
    980     ((void)(+0x.0123456789P-09F));
    981     ((void)(+0x.0123456789P-09L));
     946    ((void)(-0x.0123456789P-09));
     947    ((void)(-0x.0123456789P-09f));
     948    ((void)(-0x.0123456789P-09l));
     949    ((void)(-0x.0123456789P-09F));
     950    ((void)(-0x.0123456789P-09L));
    982951    ((void)(-0x.0123456789P-09));
    983952    ((void)(-0x.0123456789P-09f));
     
    1020989    ((void)0X0123456789.0123456789P-09F);
    1021990    ((void)0X0123456789.0123456789P-09L);
    1022     ((void)(+0X0123456789.0123456789P-09));
    1023     ((void)(+0X0123456789.0123456789P-09f));
    1024     ((void)(+0X0123456789.0123456789P-09l));
    1025     ((void)(+0X0123456789.0123456789P-09F));
    1026     ((void)(+0X0123456789.0123456789P-09L));
    1027991    ((void)(-0X0123456789.0123456789P-09));
    1028992    ((void)(-0X0123456789.0123456789P-09f));
     
    1030994    ((void)(-0X0123456789.0123456789P-09F));
    1031995    ((void)(-0X0123456789.0123456789P-09L));
    1032     ((void)((signed char )01234567));
    1033     ((void)((signed short int )01234567));
    1034     ((void)((signed int )01234567));
    1035     ((void)((signed long int )01234567));
    1036     ((void)((__int128 )01234567));
    1037     ((void)((unsigned char )01234567u));
    1038     ((void)((signed short int )01234567u));
    1039     ((void)((unsigned int )01234567u));
    1040     ((void)((signed long int )01234567u));
    1041     ((void)((__int128 )01234567u));
    1042     ((void)(+((signed int )((signed char )01234567))));
    1043     ((void)(+((signed int )((signed short int )01234567))));
    1044     ((void)(+((signed int )01234567)));
    1045     ((void)(+((signed long int )01234567)));
    1046     ((void)(+((float )((__int128 )01234567))));
    1047     ((void)(+((signed int )((unsigned char )01234567u))));
    1048     ((void)(+((signed int )((signed short int )01234567u))));
    1049     ((void)(+((unsigned int )01234567u)));
    1050     ((void)(+((signed long int )01234567u)));
    1051     ((void)(+((float )((__int128 )01234567u))));
    1052     ((void)(-((signed int )((signed char )01234567))));
    1053     ((void)(-((signed int )((signed short int )01234567))));
    1054     ((void)(-((signed int )01234567)));
    1055     ((void)(-((signed long int )01234567)));
    1056     ((void)(-((float )((__int128 )01234567))));
    1057     ((void)(-((signed int )((unsigned char )01234567u))));
    1058     ((void)(-((signed int )((signed short int )01234567u))));
    1059     ((void)(-((unsigned int )01234567u)));
    1060     ((void)(-((signed long int )01234567u)));
    1061     ((void)(-((float )((__int128 )01234567u))));
    1062     ((void)((signed char )1234567890));
    1063     ((void)((signed short int )1234567890));
    1064     ((void)((signed int )1234567890));
    1065     ((void)((signed long int )1234567890));
    1066     ((void)((__int128 )1234567890));
    1067     ((void)((signed char )1234567890U));
    1068     ((void)((unsigned short int )1234567890U));
    1069     ((void)((signed int )1234567890U));
    1070     ((void)((unsigned long int )1234567890u));
    1071     ((void)((unsigned __int128 )1234567890u));
    1072     ((void)(+((signed int )((signed char )1234567890))));
    1073     ((void)(+((signed int )((signed short int )1234567890))));
    1074     ((void)(+((signed int )1234567890)));
    1075     ((void)(+((signed long int )1234567890)));
    1076     ((void)(+((float )((__int128 )1234567890))));
    1077     ((void)(+((signed int )((signed char )1234567890U))));
    1078     ((void)(+((signed int )((unsigned short int )1234567890U))));
    1079     ((void)(+((signed int )1234567890U)));
    1080     ((void)(+((unsigned long int )1234567890u)));
    1081     ((void)(+((float )((unsigned __int128 )1234567890u))));
    1082     ((void)(-((signed int )((signed char )1234567890))));
    1083     ((void)(-((signed int )((signed short int )1234567890))));
    1084     ((void)(-((signed int )1234567890)));
    1085     ((void)(-((signed long int )1234567890)));
    1086     ((void)(-((float )((__int128 )1234567890))));
    1087     ((void)(-((signed int )((signed char )1234567890U))));
    1088     ((void)(-((signed int )((unsigned short int )1234567890U))));
    1089     ((void)(-((signed int )1234567890U)));
    1090     ((void)(-((unsigned long int )1234567890u)));
    1091     ((void)(-((float )((unsigned __int128 )1234567890u))));
    1092     ((void)((signed char )0x0123456789abcdef));
    1093     ((void)((signed short int )0x0123456789abcdef));
    1094     ((void)((signed int )0x0123456789abcdef));
    1095     ((void)((signed long int )0x0123456789abcdef));
    1096     ((void)((signed char )0x0123456789abcdefu));
    1097     ((void)((unsigned short int )0x0123456789abcdefu));
    1098     ((void)((signed int )0x0123456789abcdefu));
    1099     ((void)((unsigned long int )0x0123456789abcdefu));
    1100     ((void)(+((signed int )((signed char )0x0123456789abcdef))));
    1101     ((void)(+((signed int )((signed short int )0x0123456789abcdef))));
    1102     ((void)(+((signed int )0x0123456789abcdef)));
    1103     ((void)(+((signed long int )0x0123456789abcdef)));
    1104     ((void)(+((signed int )((signed char )0x0123456789abcdefu))));
    1105     ((void)(+((signed int )((unsigned short int )0x0123456789abcdefu))));
    1106     ((void)(+((signed int )0x0123456789abcdefu)));
    1107     ((void)(+((unsigned long int )0x0123456789abcdefu)));
    1108     ((void)(-((signed int )((signed char )0x0123456789abcdef))));
    1109     ((void)(-((signed int )((signed short int )0x0123456789abcdef))));
    1110     ((void)(-((signed int )0x0123456789abcdef)));
    1111     ((void)(-((signed long int )0x0123456789abcdef)));
    1112     ((void)(-((signed int )((signed char )0x0123456789abcdefu))));
    1113     ((void)(-((signed int )((unsigned short int )0x0123456789abcdefu))));
    1114     ((void)(-((signed int )0x0123456789abcdefu)));
    1115     ((void)(-((unsigned long int )0x0123456789abcdefu)));
    1116     ((void)((signed char )0x0123456789ABCDEF));
    1117     ((void)((signed short int )0x0123456789ABCDEF));
    1118     ((void)((signed int )0x0123456789ABCDEF));
    1119     ((void)((signed long int )0x0123456789ABCDEF));
    1120     ((void)((signed char )0x0123456789ABCDEFu));
    1121     ((void)((unsigned short int )0x0123456789ABCDEFu));
    1122     ((void)((signed int )0x0123456789ABCDEFu));
    1123     ((void)((unsigned long int )0x0123456789ABCDEFu));
    1124     ((void)(+((signed int )((signed char )0x0123456789ABCDEF))));
    1125     ((void)(+((signed int )((signed short int )0x0123456789ABCDEF))));
    1126     ((void)(+((signed int )0x0123456789ABCDEF)));
    1127     ((void)(+((signed long int )0x0123456789ABCDEF)));
    1128     ((void)(+((signed int )((signed char )0x0123456789ABCDEFu))));
    1129     ((void)(+((signed int )((unsigned short int )0x0123456789ABCDEFu))));
    1130     ((void)(+((signed int )0x0123456789ABCDEFu)));
    1131     ((void)(+((unsigned long int )0x0123456789ABCDEFu)));
    1132     ((void)(-((signed int )((signed char )0x0123456789ABCDEF))));
    1133     ((void)(-((signed int )((signed short int )0x0123456789ABCDEF))));
    1134     ((void)(-((signed int )0x0123456789ABCDEF)));
    1135     ((void)(-((signed long int )0x0123456789ABCDEF)));
    1136     ((void)(-((signed int )((signed char )0x0123456789ABCDEFu))));
    1137     ((void)(-((signed int )((unsigned short int )0x0123456789ABCDEFu))));
    1138     ((void)(-((signed int )0x0123456789ABCDEFu)));
    1139     ((void)(-((unsigned long int )0x0123456789ABCDEFu)));
    1140     ((void)((signed char )0X0123456789abcdef));
    1141     ((void)((signed short int )0X0123456789abcdef));
    1142     ((void)((signed int )0X0123456789abcdef));
    1143     ((void)((signed long int )0X0123456789abcdef));
    1144     ((void)((signed char )0X0123456789abcdefu));
    1145     ((void)((unsigned short int )0X0123456789abcdefu));
    1146     ((void)((signed int )0X0123456789abcdefu));
    1147     ((void)((unsigned long int )0X0123456789abcdefu));
    1148     ((void)(+((signed int )((signed char )0X0123456789abcdef))));
    1149     ((void)(+((signed int )((signed short int )0X0123456789abcdef))));
    1150     ((void)(+((signed int )0X0123456789abcdef)));
    1151     ((void)(+((signed long int )0X0123456789abcdef)));
    1152     ((void)(+((signed int )((signed char )0X0123456789abcdefu))));
    1153     ((void)(+((signed int )((unsigned short int )0X0123456789abcdefu))));
    1154     ((void)(+((signed int )0X0123456789abcdefu)));
    1155     ((void)(+((unsigned long int )0X0123456789abcdefu)));
    1156     ((void)(-((signed int )((signed char )0X0123456789abcdef))));
    1157     ((void)(-((signed int )((signed short int )0X0123456789abcdef))));
    1158     ((void)(-((signed int )0X0123456789abcdef)));
    1159     ((void)(-((signed long int )0X0123456789abcdef)));
    1160     ((void)(-((signed int )((signed char )0X0123456789abcdefu))));
    1161     ((void)(-((signed int )((unsigned short int )0X0123456789abcdefu))));
    1162     ((void)(-((signed int )0X0123456789abcdefu)));
    1163     ((void)(-((unsigned long int )0X0123456789abcdefu)));
    1164     ((void)((signed char )0X0123456789ABCDEF));
    1165     ((void)((signed short int )0X0123456789ABCDEF));
    1166     ((void)((signed int )0X0123456789ABCDEF));
    1167     ((void)((signed long int )0X0123456789ABCDEF));
    1168     ((void)((signed char )0X0123456789ABCDEFu));
    1169     ((void)((unsigned short int )0X0123456789ABCDEFu));
    1170     ((void)((signed int )0X0123456789ABCDEFu));
    1171     ((void)((unsigned long int )0X0123456789ABCDEFu));
    1172     ((void)(+((signed int )((signed char )0X0123456789ABCDEF))));
    1173     ((void)(+((signed int )((signed short int )0X0123456789ABCDEF))));
    1174     ((void)(+((signed int )0X0123456789ABCDEF)));
    1175     ((void)(+((signed long int )0X0123456789ABCDEF)));
    1176     ((void)(+((signed int )((signed char )0X0123456789ABCDEFu))));
    1177     ((void)(+((signed int )((unsigned short int )0X0123456789ABCDEFu))));
    1178     ((void)(+((signed int )0X0123456789ABCDEFu)));
    1179     ((void)(+((unsigned long int )0X0123456789ABCDEFu)));
    1180     ((void)(-((signed int )((signed char )0X0123456789ABCDEF))));
    1181     ((void)(-((signed int )((signed short int )0X0123456789ABCDEF))));
    1182     ((void)(-((signed int )0X0123456789ABCDEF)));
    1183     ((void)(-((signed long int )0X0123456789ABCDEF)));
    1184     ((void)(-((signed int )((signed char )0X0123456789ABCDEFu))));
    1185     ((void)(-((signed int )((unsigned short int )0X0123456789ABCDEFu))));
    1186     ((void)(-((signed int )0X0123456789ABCDEFu)));
    1187     ((void)(-((unsigned long int )0X0123456789ABCDEFu)));
    1188     ((void)((float )0123456789.));
    1189     ((void)((double )0123456789.));
    1190     ((void)((long double )0123456789.));
    1191     ((void)((long double )0123456789.));
    1192     ((void)(+((float )0123456789.)));
    1193     ((void)(+((double )0123456789.)));
    1194     ((void)(+((long double )0123456789.)));
    1195     ((void)(+((long double )0123456789.)));
    1196     ((void)(-((float )0123456789.)));
    1197     ((void)(-((double )0123456789.)));
    1198     ((void)(-((long double )0123456789.)));
    1199     ((void)(-((long double )0123456789.)));
    1200     ((void)((float )0123456789.e09));
    1201     ((void)((double )0123456789.e09));
    1202     ((void)((long double )0123456789.e09));
    1203     ((void)((long double )0123456789.e09));
    1204     ((void)(+((float )0123456789.e+09)));
    1205     ((void)(+((double )0123456789.e+09)));
    1206     ((void)(+((long double )0123456789.e+09)));
    1207     ((void)(+((long double )0123456789.e+09)));
    1208     ((void)(-((float )0123456789.e-09)));
    1209     ((void)(-((double )0123456789.e-09)));
    1210     ((void)(-((long double )0123456789.e-09)));
    1211     ((void)(-((long double )0123456789.e-09)));
    1212     ((void)((float ).0123456789e09));
    1213     ((void)((double ).0123456789e09));
    1214     ((void)((long double ).0123456789e09));
    1215     ((void)((long double ).0123456789e09));
    1216     ((void)(+((float ).0123456789E+09)));
    1217     ((void)(+((double ).0123456789E+09)));
    1218     ((void)(+((long double ).0123456789E+09)));
    1219     ((void)(+((long double ).0123456789E+09)));
    1220     ((void)(-((float ).0123456789E-09)));
    1221     ((void)(-((double ).0123456789E-09)));
    1222     ((void)(-((long double ).0123456789E-09)));
    1223     ((void)(-((long double ).0123456789E-09)));
    1224     ((void)((float )0123456789.0123456789));
    1225     ((void)((double )0123456789.0123456789));
    1226     ((void)((long double )0123456789.0123456789));
    1227     ((void)((long double )0123456789.0123456789));
    1228     ((void)(+((float )0123456789.0123456789E09)));
    1229     ((void)(+((double )0123456789.0123456789E09)));
    1230     ((void)(+((long double )0123456789.0123456789E09)));
    1231     ((void)(+((long double )0123456789.0123456789E09)));
    1232     ((void)(-((float )0123456789.0123456789E+09)));
    1233     ((void)(-((double )0123456789.0123456789E+09)));
    1234     ((void)(-((long double )0123456789.0123456789E+09)));
    1235     ((void)(-((long double )0123456789.0123456789E+09)));
    1236     ((void)((float )0123456789.0123456789E-09));
    1237     ((void)((double )0123456789.0123456789E-09));
    1238     ((void)((long double )0123456789.0123456789E-09));
    1239     ((void)((long double )0123456789.0123456789E-09));
    1240     ((void)((float )0x0123456789.p09));
    1241     ((void)((double )0x0123456789.p09));
    1242     ((void)((long double )0x0123456789.p09));
    1243     ((void)((long double )0x0123456789.p09));
    1244     ((void)(+((float )0x0123456789.p09)));
    1245     ((void)(+((double )0x0123456789.p09)));
    1246     ((void)(+((long double )0x0123456789.p09)));
    1247     ((void)(+((long double )0x0123456789.p09)));
    1248     ((void)(-((float )0x0123456789.p09)));
    1249     ((void)(-((double )0x0123456789.p09)));
    1250     ((void)(-((long double )0x0123456789.p09)));
    1251     ((void)(-((long double )0x0123456789.p09)));
    1252     ((void)((float )0x0123456789.p+09));
    1253     ((void)((double )0x0123456789.p+09));
    1254     ((void)((long double )0x0123456789.p+09));
    1255     ((void)((long double )0x0123456789.p+09));
    1256     ((void)(+((float )0x0123456789.p-09)));
    1257     ((void)(+((double )0x0123456789.p-09)));
    1258     ((void)(+((long double )0x0123456789.p-09)));
    1259     ((void)(+((long double )0x0123456789.p-09)));
    1260     ((void)(-((float )0x.0123456789p09)));
    1261     ((void)(-((double )0x.0123456789p09)));
    1262     ((void)(-((long double )0x.0123456789p09)));
    1263     ((void)(-((long double )0x.0123456789p09)));
     996    ((void)(-0X0123456789.0123456789P-09));
     997    ((void)(-0X0123456789.0123456789P-09f));
     998    ((void)(-0X0123456789.0123456789P-09l));
     999    ((void)(-0X0123456789.0123456789P-09F));
     1000    ((void)(-0X0123456789.0123456789P-09L));
    12641001    ((void)__f__F_c__1('a'));
    12651002    ((void)__f__F_Sc__1(20));
     
    13741111    ((void)L"a" "b" "c");
    13751112    ((void)(___retval_main__i_1=0) /* ?{} */);
    1376     return ___retval_main__i_1;
     1113    return ((signed int )___retval_main__i_1);
    13771114}
    13781115static inline int invoke_main(int argc, char* argv[], char* envp[]) { (void)argc; (void)argv; (void)envp; return __main__Fi___1(); }
     
    13891126    ((void)(___retval_main__i_1=(((void)(_tmp_cp_ret0=invoke_main(__argc__i_1, __argv__PPc_1, __envp__PPc_1))) , _tmp_cp_ret0)) /* ?{} */);
    13901127    ((void)(_tmp_cp_ret0) /* ^?{} */);
    1391     return ___retval_main__i_1;
    1392 }
     1128    return ((signed int )___retval_main__i_1);
     1129}
  • src/tests/.expect/castError.txt

    r3f7e12cb r78315272  
    1 castError.c:7:1 error: Cannot choose between 3 alternatives for expression
    2 Cast of:
     1castError.c:7:1 error: Cannot choose between 3 alternatives for expression Cast of:
    32  Name: f
    4 ... to:
    5   charAlternatives are:
    6 Cost ( 1, 0, 0, 0 ): Cast of:
    7      Variable Expression: f: signed int
    8    ... to:
    9      char
    10  (types:
    11    char
    12  )
    13  Environment:
    143
    15 Cost ( 1, 0, 0, 0 ): Cast of:
    16      Variable Expression: f: double
    17    ... to:
    18      char
    19  (types:
    20    char
    21  )
    22  Environment:
    23 
    24 Cost ( 1, 0, 0, 0 ): Cast of:
    25      Variable Expression: f: function
    26        accepting unspecified arguments
    27      ... returning nothing
    28 
    29    ... to:
    30      char
    31  (types:
    32    char
    33  )
    34  Environment:
     4to:
     5  char
     6Alternatives are:        Cost ( 1, 0, 0, 0 ): Cast of:
     7          Variable Expression: f: function
     8                accepting unspecified arguments
     9              returning
     10                nothing
    3511
    3612
     13        to:
     14          char
     15(types:
     16            char
     17)
     18        Environment:
     19
     20        Cost ( 1, 0, 0, 0 ): Cast of:
     21          Variable Expression: f: signed int
     22
     23        to:
     24          char
     25(types:
     26            char
     27)
     28        Environment:
     29
     30        Cost ( 1, 0, 0, 0 ): Cast of:
     31          Variable Expression: f: double
     32
     33        to:
     34          char
     35(types:
     36            char
     37)
     38        Environment:
     39
     40
  • src/tests/.expect/scopeErrors.txt

    r3f7e12cb r78315272  
    11scopeErrors.c:2:1 error: duplicate object definition for thisIsAnError: signed int
    22scopeErrors.c:20:1 error: duplicate function definition for butThisIsAnError: function
    3 ... with parameters
    4   double
    5 ... returning
    6   _retval_butThisIsAnError: double
    7   ... with attributes:
    8     Attribute with name: unused
     3  with parameters
     4    double
     5  returning
     6    _retval_butThisIsAnError:       Attribute with name: unused
     7double
     8  with body
     9    CompoundStmt
    910
    10 ... with body
    11   CompoundStmt
    12 
  • src/tests/Makefile.am

    r3f7e12cb r78315272  
    1111## Created On       : Sun May 31 09:08:15 2015
    1212## Last Modified By : Peter A. Buhr
    13 ## Last Modified On : Tue Oct 10 14:04:40 2017
    14 ## Update Count     : 47
     13## Last Modified On : Mon Sep 11 16:17:16 2017
     14## Update Count     : 45
    1515###############################################################################
    1616
     
    2222concurrent = yes
    2323quick_test += coroutine thread monitor
    24 concurrent_test =               \
    25         coroutine               \
    26         fmtLines                \
    27         pingpong                \
    28         prodcons                \
    29         thread                  \
    30         matrixSum               \
    31         monitor                 \
    32         multi-monitor           \
    33         boundedBuffer           \
    34         preempt                 \
    35         sched-int-block         \
    36         sched-int-disjoint      \
    37         sched-int-wait          \
    38         sched-ext-barge         \
    39         sched-ext-dtor          \
    40         sched-ext-else          \
    41         sched-ext-parse         \
    42         sched-ext-recurse       \
    43         sched-ext-statment      \
    44         sched-ext-when
     24concurrent_test = coroutine thread monitor multi-monitor sched-int-barge sched-int-block sched-int-disjoint sched-int-wait sched-ext sched-ext-multi preempt
    4525else
    4626concurrent=no
     
    10787
    10888declarationSpecifier: declarationSpecifier.c @CFA_BINDIR@/@CFA_NAME@
    109         ${CC} ${AM_CFLAGS} ${CFLAGS} -CFA -XCFA -p ${<} -o ${@}
     89        ${CC} ${AM_CFLAGS} ${CFLAGS} -CFA -XCFA -p -XCFA -L ${<} -o ${@}
    11090
    11191gccExtensions : gccExtensions.c @CFA_BINDIR@/@CFA_NAME@
    112         ${CC} ${AM_CFLAGS} ${CFLAGS} -CFA -XCFA -p ${<} -o ${@}
     92        ${CC} ${AM_CFLAGS} ${CFLAGS} -CFA -XCFA -p -XCFA -L ${<} -o ${@}
    11393
    11494extension : extension.c @CFA_BINDIR@/@CFA_NAME@
    115         ${CC} ${AM_CFLAGS} ${CFLAGS} -CFA -XCFA -p ${<} -o ${@}
     95        ${CC} ${AM_CFLAGS} ${CFLAGS} -CFA -XCFA -p -XCFA -L ${<} -o ${@}
    11696
    11797attributes : attributes.c @CFA_BINDIR@/@CFA_NAME@
    118         ${CC} ${AM_CFLAGS} ${CFLAGS} -CFA -XCFA -p ${<} -o ${@}
     98        ${CC} ${AM_CFLAGS} ${CFLAGS} -CFA -XCFA -p -XCFA -L ${<} -o ${@}
    11999
    120100KRfunctions : KRfunctions.c @CFA_BINDIR@/@CFA_NAME@
    121         ${CC} ${AM_CFLAGS} ${CFLAGS} -CFA -XCFA -p ${<} -o ${@}
     101        ${CC} ${AM_CFLAGS} ${CFLAGS} -CFA -XCFA -p -XCFA -L ${<} -o ${@}
    122102
    123103literals : literals.c @CFA_BINDIR@/@CFA_NAME@
    124         ${CC} ${AM_CFLAGS} ${CFLAGS} -CFA -XCFA -p ${<} -o ${@}
    125 
    126 sched-ext-parse : sched-ext-parse.c @CFA_BINDIR@/@CFA_NAME@
    127         ${CC} ${AM_CFLAGS} ${CFLAGS} -CFA -XCFA -p ${<} -o ${@}
     104        ${CC} ${AM_CFLAGS} ${CFLAGS} -CFA -XCFA -p -XCFA -L ${<} -o ${@}
    128105
    129106gmp : gmp.c @CFA_BINDIR@/@CFA_NAME@
     
    133110        ${CC} ${AM_CFLAGS} ${CFLAGS} -DERR1 ${<} -o ${@}
    134111
    135 ctor-autogen-ERR1: ctor-autogen.c @CFA_BINDIR@/@CFA_NAME@
    136         ${CC} ${AM_CFLAGS} ${CFLAGS} -DERR1 ${<} -o ${@}
    137 
    138112completeTypeError : completeTypeError.c @CFA_BINDIR@/@CFA_NAME@
    139113        ${CC} ${AM_CFLAGS} ${CFLAGS} -DERR1 ${<} -o ${@}
    140 
    141 typedefRedef-ERR1: typedefRedef.c @CFA_BINDIR@/@CFA_NAME@
    142         ${CC} ${AM_CFLAGS} ${CFLAGS} -DERR1 ${<} -o ${@}
  • src/tests/Makefile.in

    r3f7e12cb r78315272  
    320320@BUILD_CONCURRENCY_TRUE@concurrent = yes
    321321@BUILD_CONCURRENCY_FALSE@concurrent_test =
    322 @BUILD_CONCURRENCY_TRUE@concurrent_test = \
    323 @BUILD_CONCURRENCY_TRUE@        coroutine               \
    324 @BUILD_CONCURRENCY_TRUE@        fmtLines                \
    325 @BUILD_CONCURRENCY_TRUE@        pingpong                \
    326 @BUILD_CONCURRENCY_TRUE@        prodcons                \
    327 @BUILD_CONCURRENCY_TRUE@        thread                  \
    328 @BUILD_CONCURRENCY_TRUE@        matrixSum               \
    329 @BUILD_CONCURRENCY_TRUE@        monitor                 \
    330 @BUILD_CONCURRENCY_TRUE@        multi-monitor           \
    331 @BUILD_CONCURRENCY_TRUE@        boundedBuffer           \
    332 @BUILD_CONCURRENCY_TRUE@        preempt                 \
    333 @BUILD_CONCURRENCY_TRUE@        sched-int-block         \
    334 @BUILD_CONCURRENCY_TRUE@        sched-int-disjoint      \
    335 @BUILD_CONCURRENCY_TRUE@        sched-int-wait          \
    336 @BUILD_CONCURRENCY_TRUE@        sched-ext-barge         \
    337 @BUILD_CONCURRENCY_TRUE@        sched-ext-dtor          \
    338 @BUILD_CONCURRENCY_TRUE@        sched-ext-else          \
    339 @BUILD_CONCURRENCY_TRUE@        sched-ext-parse         \
    340 @BUILD_CONCURRENCY_TRUE@        sched-ext-recurse       \
    341 @BUILD_CONCURRENCY_TRUE@        sched-ext-statment      \
    342 @BUILD_CONCURRENCY_TRUE@        sched-ext-when
    343 
     322@BUILD_CONCURRENCY_TRUE@concurrent_test = coroutine thread monitor multi-monitor sched-int-barge sched-int-block sched-int-disjoint sched-int-wait sched-ext sched-ext-multi preempt
    344323
    345324# applies to both programs
     
    860839
    861840declarationSpecifier: declarationSpecifier.c @CFA_BINDIR@/@CFA_NAME@
    862         ${CC} ${AM_CFLAGS} ${CFLAGS} -CFA -XCFA -p ${<} -o ${@}
     841        ${CC} ${AM_CFLAGS} ${CFLAGS} -CFA -XCFA -p -XCFA -L ${<} -o ${@}
    863842
    864843gccExtensions : gccExtensions.c @CFA_BINDIR@/@CFA_NAME@
    865         ${CC} ${AM_CFLAGS} ${CFLAGS} -CFA -XCFA -p ${<} -o ${@}
     844        ${CC} ${AM_CFLAGS} ${CFLAGS} -CFA -XCFA -p -XCFA -L ${<} -o ${@}
    866845
    867846extension : extension.c @CFA_BINDIR@/@CFA_NAME@
    868         ${CC} ${AM_CFLAGS} ${CFLAGS} -CFA -XCFA -p ${<} -o ${@}
     847        ${CC} ${AM_CFLAGS} ${CFLAGS} -CFA -XCFA -p -XCFA -L ${<} -o ${@}
    869848
    870849attributes : attributes.c @CFA_BINDIR@/@CFA_NAME@
    871         ${CC} ${AM_CFLAGS} ${CFLAGS} -CFA -XCFA -p ${<} -o ${@}
     850        ${CC} ${AM_CFLAGS} ${CFLAGS} -CFA -XCFA -p -XCFA -L ${<} -o ${@}
    872851
    873852KRfunctions : KRfunctions.c @CFA_BINDIR@/@CFA_NAME@
    874         ${CC} ${AM_CFLAGS} ${CFLAGS} -CFA -XCFA -p ${<} -o ${@}
     853        ${CC} ${AM_CFLAGS} ${CFLAGS} -CFA -XCFA -p -XCFA -L ${<} -o ${@}
    875854
    876855literals : literals.c @CFA_BINDIR@/@CFA_NAME@
    877         ${CC} ${AM_CFLAGS} ${CFLAGS} -CFA -XCFA -p ${<} -o ${@}
    878 
    879 sched-ext-parse : sched-ext-parse.c @CFA_BINDIR@/@CFA_NAME@
    880         ${CC} ${AM_CFLAGS} ${CFLAGS} -CFA -XCFA -p ${<} -o ${@}
     856        ${CC} ${AM_CFLAGS} ${CFLAGS} -CFA -XCFA -p -XCFA -L ${<} -o ${@}
    881857
    882858gmp : gmp.c @CFA_BINDIR@/@CFA_NAME@
     
    886862        ${CC} ${AM_CFLAGS} ${CFLAGS} -DERR1 ${<} -o ${@}
    887863
    888 ctor-autogen-ERR1: ctor-autogen.c @CFA_BINDIR@/@CFA_NAME@
    889         ${CC} ${AM_CFLAGS} ${CFLAGS} -DERR1 ${<} -o ${@}
    890 
    891864completeTypeError : completeTypeError.c @CFA_BINDIR@/@CFA_NAME@
    892         ${CC} ${AM_CFLAGS} ${CFLAGS} -DERR1 ${<} -o ${@}
    893 
    894 typedefRedef-ERR1: typedefRedef.c @CFA_BINDIR@/@CFA_NAME@
    895865        ${CC} ${AM_CFLAGS} ${CFLAGS} -DERR1 ${<} -o ${@}
    896866
  • src/tests/coroutine.c

    r3f7e12cb r78315272  
    1010// Created On       : Thu Jun  8 07:29:37 2017
    1111// Last Modified By : Peter A. Buhr
    12 // Last Modified On : Sun Sep 17 21:38:15 2017
    13 // Update Count     : 7
     12// Last Modified On : Thu Jun  8 07:37:12 2017
     13// Update Count     : 5
    1414//
    1515
     
    1818
    1919coroutine Fibonacci {
    20         int fn;                                                                                         // used for communication
     20        int fn;                                         // used for communication
    2121};
    2222
     
    2626
    2727void main( Fibonacci & this ) {
    28         int fn1, fn2;                                                                           // retained between resumes
    29         this.fn = 0;                                                                            // case 0
     28        int fn1, fn2;                                   // retained between resumes
     29        this.fn = 0;                                    // case 0
    3030        fn1 = this.fn;
    31         suspend();                                                                                      // restart last resume
     31        suspend();                                              // return to last resume
    3232
    33         this.fn = 1;                                                                            // case 1
    34         fn2 = fn1;  fn1 = this.fn;
    35         suspend();                                                                                      // restart last resume
     33        this.fn = 1;                                    // case 1
     34        fn2 = fn1;
     35        fn1 = this.fn;
     36        suspend();                                              // return to last resume
    3637
    37         for ( ;; ) {                                                                            // general case
     38        for ( ;; ) {                                    // general case
    3839                this.fn = fn1 + fn2;
    39                 fn2 = fn1;  fn1 = this.fn;
    40                 suspend();                                                                              // restart last resume
     40                fn2 = fn1;
     41                fn1 = this.fn;
     42                suspend();                                      // return to last resume
    4143        } // for
    4244}
    4345
    4446int next( Fibonacci & this ) {
    45         resume( this );                                                                         // restart last suspend
     47        resume( this );                                 // transfer to last suspend
    4648        return this.fn;
    4749}
     
    5052        Fibonacci f1, f2;
    5153        for ( int i = 1; i <= 10; i += 1 ) {
    52                 sout | next( f1 ) | next( f2 ) | endl;
     54                sout | next( f1 ) | ' ' | next( f2 ) | endl;
    5355        } // for
    5456}
  • src/tests/fmtLines.c

    r3f7e12cb r78315272  
    1010// Created On       : Sun Sep 17 21:56:15 2017
    1111// Last Modified By : Peter A. Buhr
    12 // Last Modified On : Sun Oct  1 11:57:19 2017
    13 // Update Count     : 34
     12// Last Modified On : Mon Sep 18 11:35:57 2017
     13// Update Count     : 31
    1414//
    1515
     
    2323
    2424void ?{}( Format & fmt ) {
    25         resume( fmt );                                                                          // prime (start) coroutine
     25    resume( fmt );                                                                              // start coroutine
    2626}
    2727
    2828void ^?{}( Format & fmt ) {
    29         if ( fmt.g != 0 || fmt.b != 0 ) sout | endl;
     29    if ( fmt.g != 0 || fmt.b != 0 ) sout | endl;
    3030}
    3131
     
    4747
    4848void prt( Format & fmt, char ch ) {
    49         fmt.ch = ch;
    50         resume( fmt );
     49    fmt.ch = ch;
     50    resume( fmt );
    5151} // prt
    5252
    5353int main() {
    54         Format fmt;                                                                                     // format characters into blocks of 4 and groups of 5 blocks per line
     54        Format fmt;
    5555        char ch;
    5656
    57         Eof: for ( ;; ) {                                                                       // read until end of file
     57        for ( ;; ) {
    5858                sin | ch;                                                                               // read one character
    59           if ( eof( sin ) ) break Eof;                                          // eof ?
    60                 prt( fmt, ch );                                                                 // push character for formatting
     59          if ( eof( sin ) ) break;                                                      // eof ?
     60                prt( fmt, ch );
    6161        } // for
    6262} // main
  • src/tests/gmp.c

    r3f7e12cb r78315272  
    1010// Created On       : Tue Apr 19 08:55:51 2016
    1111// Last Modified By : Peter A. Buhr
    12 // Last Modified On : Thu Sep 28 18:33:51 2017
    13 // Update Count     : 555
     12// Last Modified On : Mon Sep  4 09:51:18 2017
     13// Update Count     : 550
    1414//
    1515
     
    9797
    9898        sout | "Factorial Numbers" | endl;
    99         Int fact = 1;                                                                           // 1st case
     99        Int fact;
     100        fact = 1;                                                                                       // 1st case
    100101        sout | (int)0 | fact | endl;
    101102        for ( unsigned int i = 1; i <= 40; i += 1 ) {
  • src/tests/literals.c

    r3f7e12cb r78315272  
    1010// Created On       : Sat Sep  9 16:34:38 2017
    1111// Last Modified By : Peter A. Buhr
    12 // Last Modified On : Mon Sep 25 20:26:00 2017
    13 // Update Count     : 132
     12// Last Modified On : Tue Sep 12 07:45:46 2017
     13// Update Count     : 88
    1414//
    1515
    1616#ifdef __CFA__
    17 #include <stdint.h>
    1817#include <fstream>
    1918
     
    7372
    7473         0123456789.e-09;   0123456789.e-09f;   0123456789.e-09l;   0123456789.e-09F;   0123456789.e-09L;   0123456789.e-09DL;
    75         +0123456789.e-09;  +0123456789.e-09f;  +0123456789.e-09l;  +0123456789.e-09F;  +0123456789.e-09L;  +0123456789.e-09DL;
     74        -0123456789.e-09;  -0123456789.e-09f;  -0123456789.e-09l;  -0123456789.e-09F;  -0123456789.e-09L;  -0123456789.e-09DL;
    7675        -0123456789.e-09;  -0123456789.e-09f;  -0123456789.e-09l;  -0123456789.e-09F;  -0123456789.e-09L;  -0123456789.e-09DL;
    7776
     
    105104
    106105         0123456789.0123456789E-09;   0123456789.0123456789E-09f;   0123456789.0123456789E-09l;   0123456789.0123456789E-09F;   0123456789.0123456789E-09L;   0123456789.0123456789E-09DL;
    107         +0123456789.0123456789E-09;  +0123456789.0123456789E-09f;  +0123456789.0123456789E-09l;  +0123456789.0123456789E-09F;  +0123456789.0123456789E-09L;  +0123456789.0123456789E-09DL;
     106        -0123456789.0123456789E-09;  -0123456789.0123456789E-09f;  -0123456789.0123456789E-09l;  -0123456789.0123456789E-09F;  -0123456789.0123456789E-09L;  -0123456789.0123456789E-09DL;
    108107        -0123456789.0123456789E-09;  -0123456789.0123456789E-09f;  -0123456789.0123456789E-09l;  -0123456789.0123456789E-09F;  -0123456789.0123456789E-09L;  -0123456789.0123456789E-09DL;
    109108
     
    119118
    120119         0x0123456789.p-09;   0x0123456789.p-09f;   0x0123456789.p-09l;   0x0123456789.p-09F;   0x0123456789.p-09L;
    121         +0x0123456789.p-09;  +0x0123456789.p-09f;  +0x0123456789.p-09l;  +0x0123456789.p-09F;  +0x0123456789.p-09L;
     120        -0x0123456789.p-09;  -0x0123456789.p-09f;  -0x0123456789.p-09l;  -0x0123456789.p-09F;  -0x0123456789.p-09L;
    122121        -0x0123456789.p-09;  -0x0123456789.p-09f;  -0x0123456789.p-09l;  -0x0123456789.p-09F;  -0x0123456789.p-09L;
    123122
     
    131130
    132131         0x.0123456789P-09;   0x.0123456789P-09f;   0x.0123456789P-09l;   0x.0123456789P-09F;   0x.0123456789P-09L;
    133         +0x.0123456789P-09;  +0x.0123456789P-09f;  +0x.0123456789P-09l;  +0x.0123456789P-09F;  +0x.0123456789P-09L;
     132        -0x.0123456789P-09;  -0x.0123456789P-09f;  -0x.0123456789P-09l;  -0x.0123456789P-09F;  -0x.0123456789P-09L;
    134133        -0x.0123456789P-09;  -0x.0123456789P-09f;  -0x.0123456789P-09l;  -0x.0123456789P-09F;  -0x.0123456789P-09L;
    135134
     
    143142
    144143         0X0123456789.0123456789P-09;   0X0123456789.0123456789P-09f;   0X0123456789.0123456789P-09l;   0X0123456789.0123456789P-09F;   0X0123456789.0123456789P-09L;
    145         +0X0123456789.0123456789P-09;  +0X0123456789.0123456789P-09f;  +0X0123456789.0123456789P-09l;  +0X0123456789.0123456789P-09F;  +0X0123456789.0123456789P-09L;
    146144        -0X0123456789.0123456789P-09;  -0X0123456789.0123456789P-09f;  -0X0123456789.0123456789P-09l;  -0X0123456789.0123456789P-09F;  -0X0123456789.0123456789P-09L;
     145        -0X0123456789.0123456789P-09;  -0X0123456789.0123456789P-09f;  -0X0123456789.0123456789P-09l;  -0X0123456789.0123456789P-09F;  -0X0123456789.0123456789P-09L;
     146
     147// char, short, int suffix overloading
    147148
    148149#ifdef __CFA__
    149 // fixed-size length
    150 
    151         // octal
    152          01234567_l8;   01234567_l16;   01234567_l32;   01234567_l64;   01234567_l128;   01234567_l8u;   01234567_ul16;   01234567_l32u;   01234567_ul64;   01234567_ul128;
    153         +01234567_l8;  +01234567_l16;  +01234567_l32;  +01234567_l64;  +01234567_l128;  +01234567_l8u;  +01234567_ul16;  +01234567_l32u;  +01234567_ul64;  +01234567_ul128;
    154         -01234567_l8;  -01234567_l16;  -01234567_l32;  -01234567_l64;  -01234567_l128;  -01234567_l8u;  -01234567_ul16;  -01234567_l32u;  -01234567_ul64;  -01234567_ul128;
    155 
    156         // decimal
    157          1234567890L8;   1234567890L16;   1234567890l32;   1234567890l64;   1234567890l128;   1234567890UL8;   1234567890L16U;   1234567890Ul32;   1234567890l64u;   1234567890l128u;
    158         +1234567890L8;  +1234567890L16;  +1234567890l32;  +1234567890l64;  +1234567890l128;  +1234567890UL8;  +1234567890L16U;  +1234567890Ul32;  +1234567890l64u;  +1234567890l128u;
    159         -1234567890L8;  -1234567890L16;  -1234567890l32;  -1234567890l64;  -1234567890l128;  -1234567890UL8;  -1234567890L16U;  -1234567890Ul32;  -1234567890l64u;  -1234567890l128u;
    160 
    161         // hexadecimal
    162          0x0123456789abcdef_l8;   0x0123456789abcdef_l16;   0x0123456789abcdefl32;   0x0123456789abcdefl64;   0x0123456789abcdef_ul8;   0x0123456789abcdef_l16u;   0x0123456789abcdeful32;   0x0123456789abcdefl64u;
    163         +0x0123456789abcdef_l8;  +0x0123456789abcdef_l16;  +0x0123456789abcdefl32;  +0x0123456789abcdefl64;  +0x0123456789abcdef_ul8;  +0x0123456789abcdef_l16u;  +0x0123456789abcdeful32;  +0x0123456789abcdefl64u;
    164         -0x0123456789abcdef_l8;  -0x0123456789abcdef_l16;  -0x0123456789abcdefl32;  -0x0123456789abcdefl64;  -0x0123456789abcdef_ul8;  -0x0123456789abcdef_l16u;  -0x0123456789abcdeful32;  -0x0123456789abcdefl64u;
    165 
    166          0x0123456789ABCDEF_l8;   0x0123456789ABCDEF_l16;   0x0123456789ABCDEFl32;   0x0123456789ABCDEFl64;   0x0123456789ABCDEF_ul8;   0x0123456789ABCDEF_l16u;   0x0123456789ABCDEFul32;   0x0123456789ABCDEFl64u;
    167         +0x0123456789ABCDEF_l8;  +0x0123456789ABCDEF_l16;  +0x0123456789ABCDEFl32;  +0x0123456789ABCDEFl64;  +0x0123456789ABCDEF_ul8;  +0x0123456789ABCDEF_l16u;  +0x0123456789ABCDEFul32;  +0x0123456789ABCDEFl64u;
    168         -0x0123456789ABCDEF_l8;  -0x0123456789ABCDEF_l16;  -0x0123456789ABCDEFl32;  -0x0123456789ABCDEFl64;  -0x0123456789ABCDEF_ul8;  -0x0123456789ABCDEF_l16u;  -0x0123456789ABCDEFul32;  -0x0123456789ABCDEFl64u;
    169 
    170          0X0123456789abcdef_l8;   0X0123456789abcdef_l16;   0X0123456789abcdefl32;   0X0123456789abcdefl64;   0X0123456789abcdef_ul8;   0X0123456789abcdef_l16u;   0X0123456789abcdeful32;   0X0123456789abcdefl64u;
    171         +0X0123456789abcdef_l8;  +0X0123456789abcdef_l16;  +0X0123456789abcdefl32;  +0X0123456789abcdefl64;  +0X0123456789abcdef_ul8;  +0X0123456789abcdef_l16u;  +0X0123456789abcdeful32;  +0X0123456789abcdefl64u;
    172         -0X0123456789abcdef_l8;  -0X0123456789abcdef_l16;  -0X0123456789abcdefl32;  -0X0123456789abcdefl64;  -0X0123456789abcdef_ul8;  -0X0123456789abcdef_l16u;  -0X0123456789abcdeful32;  -0X0123456789abcdefl64u;
    173 
    174          0X0123456789ABCDEF_l8;   0X0123456789ABCDEF_l16;   0X0123456789ABCDEFl32;   0X0123456789ABCDEFl64;   0X0123456789ABCDEF_ul8;   0X0123456789ABCDEF_l16u;   0X0123456789ABCDEFul32;   0X0123456789ABCDEFl64u;
    175         +0X0123456789ABCDEF_l8;  +0X0123456789ABCDEF_l16;  +0X0123456789ABCDEFl32;  +0X0123456789ABCDEFl64;  +0X0123456789ABCDEF_ul8;  +0X0123456789ABCDEF_l16u;  +0X0123456789ABCDEFul32;  +0X0123456789ABCDEFl64u;
    176         -0X0123456789ABCDEF_l8;  -0X0123456789ABCDEF_l16;  -0X0123456789ABCDEFl32;  -0X0123456789ABCDEFl64;  -0X0123456789ABCDEF_ul8;  -0X0123456789ABCDEF_l16u;  -0X0123456789ABCDEFul32;  -0X0123456789ABCDEFl64u;
    177 
    178         // floating
    179          0123456789.l32;   0123456789.l64;   0123456789.l80;   0123456789.l128;
    180         +0123456789.l32;  +0123456789.l64;  +0123456789.l80;  +0123456789.l128;
    181         -0123456789.l32;  -0123456789.l64;  -0123456789.l80;  -0123456789.l128;
    182 
    183          0123456789.e09L32;    0123456789.e09L64;    0123456789.e09L80;    0123456789.e09L128;
    184         +0123456789.e+09L32;  +0123456789.e+09L64;  +0123456789.e+09L80;  +0123456789.e+09L128;
    185         -0123456789.e-09L32;  -0123456789.e-09L64;  -0123456789.e-09L80;  -0123456789.e-09L128;
    186 
    187          .0123456789e09L32;    .0123456789e09L64;    .0123456789e09L80;    .0123456789e09L128;
    188         +.0123456789E+09L32;  +.0123456789E+09L64;  +.0123456789E+09L80;  +.0123456789E+09L128;
    189         -.0123456789E-09L32;  -.0123456789E-09L64;  -.0123456789E-09L80;  -.0123456789E-09L128;
    190 
    191          0123456789.0123456789L32;       0123456789.0123456789L64;       0123456789.0123456789L80;       0123456789.0123456789L128;
    192         +0123456789.0123456789E09L32;   +0123456789.0123456789E09L64;   +0123456789.0123456789E09L80;   +0123456789.0123456789E09L128;
    193         -0123456789.0123456789E+09L32;  -0123456789.0123456789E+09L64;  -0123456789.0123456789E+09L80;  -0123456789.0123456789E+09L128;
    194          0123456789.0123456789E-09L32;   0123456789.0123456789E-09L64;   0123456789.0123456789E-09L80;   0123456789.0123456789E-09L128;
    195        
    196          0x0123456789.p09l32;   0x0123456789.p09l64;   0x0123456789.p09l80;   0x0123456789.p09l128;
    197         +0x0123456789.p09l32;  +0x0123456789.p09l64;  +0x0123456789.p09l80;  +0x0123456789.p09l128;
    198         -0x0123456789.p09l32;  -0x0123456789.p09l64;  -0x0123456789.p09l80;  -0x0123456789.p09l128;
    199 
    200          0x0123456789.p+09l32;   0x0123456789.p+09L64;   0x0123456789.p+09L80;   0x0123456789.p+09L128;
    201         +0x0123456789.p-09l32;  +0x0123456789.p-09L64;  +0x0123456789.p-09L80;  +0x0123456789.p-09L128;
    202         -0x.0123456789p09l32;   -0x.0123456789p09L64;   -0x.0123456789p09L80;   -0x.0123456789p09L128;
    203 
    204 // char, short, int suffix overloading
    205 
    206150        f( 'a' );
    207151        f( 20_hh );
  • src/tests/prodcons.c

    r3f7e12cb r78315272  
    1010// Created On       : Mon Sep 18 12:23:39 2017
    1111// Last Modified By : Peter A. Buhr
    12 // Last Modified On : Mon Oct 30 23:06:05 2017
    13 // Update Count     : 42
     12// Last Modified On : Wed Sep 20 17:03:28 2017
     13// Update Count     : 40
    1414//
    1515
    1616#include <fstream>
    1717#include <coroutine>
    18 #include <stdlib>                                                                               // random
     18#include <stdlib>                                                                               // rand48
    1919#include <unistd.h>                                                                             // getpid
    2020
     
    3030        // 1st resume starts here
    3131        for ( int i = 0; i < prod.N; i += 1 ) {
    32                 int p1 = random( 100 );
    33                 int p2 = random( 100 );
     32                int p1 = (unsigned int)rand48() % 100;                  // non-negative
     33                int p2 = (unsigned int)rand48() % 100;
    3434                sout | p1 | " " | p2 | endl;
    3535                int status = delivery( *prod.c, p1, p2 );
     
    9090        Prod prod;
    9191        Cons cons = { prod };
    92         random_seed( /* getpid() */ 103 );                                      // fixed seed for testing
     92        rand48seed( /* getpid() */ 103 );                                       // fixed seed for testing
    9393        start( prod, 5, cons );
    9494        sout | "main stops" | endl;
  • src/tests/random.c

    r3f7e12cb r78315272  
    1010// Created On       : Tue Jul  5 21:29:30 2016
    1111// Last Modified By : Peter A. Buhr
    12 // Last Modified On : Mon Oct 30 23:06:49 2017
    13 // Update Count     : 6
     12// Last Modified On : Wed Jul  6 18:00:29 2016
     13// Update Count     : 3
    1414//
    1515
     
    1919
    2020int main() {
    21         //srandom( getpid() );                                                          // set random seed
    22         random_seed( 1003 );                                                            // fixed seed for repeatable tests
     21        //rand48seed( getpid() );                                                               // set random seed
     22        rand48seed( 1003 );                                                                     // fixed seed for repeatable tests
    2323
    2424        // test polymorphic calls to random and stream
    25         char c = random();
     25        char c = rand48();
    2626        sout | c | endl;
    27         int i = random();
     27        int i = rand48();
    2828    sout | i | endl;
    29         unsigned int ui = random();
     29        unsigned int ui = rand48();
    3030    sout | ui | endl;
    31         long int li = random();
     31        long int li = rand48();
    3232    sout | li | endl;
    33         unsigned long int uli = random();
     33        unsigned long int uli = rand48();
    3434    sout | uli | endl;
    35     float f = random();
     35    float f = rand48();
    3636    sout | f | endl;
    37     double d = random();
     37    double d = rand48();
    3838    sout | d | endl;
    39     float _Complex fc = random();
     39    float _Complex fc = rand48();
    4040    sout | fc | endl;
    41     double _Complex dc = random();
     41    double _Complex dc = rand48();
    4242    sout | dc | endl;
    43     long double _Complex ldc = random();
     43    long double _Complex ldc = rand48();
    4444    sout | ldc | endl;
    4545} // main
  • src/tests/rational.c

    r3f7e12cb r78315272  
    1010// Created On       : Mon Mar 28 08:43:12 2016
    1111// Last Modified By : Peter A. Buhr
    12 // Last Modified On : Tue Oct 10 23:25:04 2017
    13 // Update Count     : 67
     12// Last Modified On : Wed Aug 23 21:40:11 2017
     13// Update Count     : 66
    1414//
    1515
  • src/tests/sched-ext-parse.c

    r3f7e12cb r78315272  
    1 //----------------------------------------------------------------------------------------
    2 //----------------------------------------------------------------------------------------
    3 //
    4 //              DEPRECATED TEST
    5 //              DIFFERS BETWEEN DEBUG AND RELEASE
    6 //
    7 //----------------------------------------------------------------------------------------
    8 //----------------------------------------------------------------------------------------
    9 
    101#include <monitor>
    112
     
    8980                16;
    9081        }
    91         or waitfor( f2, a, a ) {
     82        or waitfor( f1, a, a ) {
    9283                17;
    9384        }
  • src/tests/sched-ext.c

    r3f7e12cb r78315272  
    2626volatile bool done;
    2727
     28unsigned rand10() {
     29        return (unsigned)rand48() % 10;
     30}
     31
    2832//----------------------------------------------------------------------------------------------------
    2933// Acceptor
     
    3236void do_wait( global_t * mutex a ) {
    3337        sout | "Waiting to accept" | endl;
    34         yield( random( 10 ) );
     38        yield( rand10() );
    3539
    3640        sout | "Accepting" | endl;
     
    4145        acceptable.monitors      = &a;
    4246
    43         __waitfor_internal( 1, &acceptable );
     47        __accept_internal( 1, &acceptable );
    4448
    4549        sout | "Accepted" | endl;
    46         yield( random( 10 ) );
     50        yield( rand10() );
    4751}
    4852
     
    6468void main( Acceptee* this ) {
    6569        while( !done ) {
    66                 yield( random( 10 ) );
     70                yield( rand10() );
    6771                do_notify( &globalA );
    68                 yield( random( 10 ) );
     72                yield( rand10() );
    6973        }
    7074}
     
    7478int main(int argc, char* argv[]) {
    7579        done = false;
    76         random_seed( time( NULL ) );
     80        rand48seed( time( NULL ) );
    7781        printf("%p\n", &globalA);
    7882        sout | "Starting" | endl;
  • src/tests/sched-int-barge.c

    r3f7e12cb r78315272  
    1 //----------------------------------------------------------------------------------------
    2 //----------------------------------------------------------------------------------------
    3 //
    4 //              DEPRECATED TEST
    5 //
    6 //----------------------------------------------------------------------------------------
    7 //----------------------------------------------------------------------------------------
    8 
    91#include <fstream>
    102#include <kernel>
     
    6456
    6557        if( action == 0 ) {
    66                 c.do_signal = max( random( 10 ), 1);
    67                 c.do_wait1 = random( c.do_signal );
    68                 c.do_wait2 = random( c.do_signal );
     58                c.do_signal = max( ((unsigned)rand48()) % 10, 1);
     59                c.do_wait1 = ((unsigned)rand48()) % (c.do_signal);
     60                c.do_wait2 = ((unsigned)rand48()) % (c.do_signal);
    6961
    7062                if(c.do_wait1 == c.do_wait2) sout | "Same" | endl;
     
    7365        if( action == c.do_wait1 || action == c.do_wait2 ) {
    7466                c.state = WAIT;
    75                 wait( cond );
     67                wait( &cond );
    7668
    7769                if(c.state != SIGNAL) {
     
    8375                c.state = SIGNAL;
    8476
    85                 signal( cond );
    86                 signal( cond );
     77                signal( &cond );
     78                signal( &cond );
    8779        }
    8880        else {
     
    109101
    110102int main(int argc, char* argv[]) {
    111         random_seed(0);
     103        rand48seed(0);
    112104        processor p;
    113105        {
  • src/tests/sched-int-block.c

    r3f7e12cb r78315272  
    1 //---------------------------------------------------------
    2 // Barging test
    3 // Ensures that no barging can occur between :
    4 //   - the frontend of the signal_block and the signaled thread
    5 //   - the signaled  threadand the backend of the signal_block
    6 //---------------------------------------------------------
    7 
    8 
    91#include <fstream>
    102#include <kernel>
     
    4739//------------------------------------------------------------------------------
    4840void wait_op( global_data_t & mutex a, global_data_t & mutex b, unsigned i ) {
    49         wait( cond, (uintptr_t)this_thread );
     41        wait( &cond, (uintptr_t)this_thread );
    5042
    51         yield( random( 10 ) );
     43        yield( ((unsigned)rand48()) % 10 );
    5244
    5345        if(a.last_thread != a.last_signaller || b.last_thread != b.last_signaller ) {
     
    5850        a.last_thread = b.last_thread = this_thread;
    5951
    60         yield( random( 10 ) );
     52        yield( ((unsigned)rand48()) % 10 );
    6153}
    6254
     
    7062//------------------------------------------------------------------------------
    7163void signal_op( global_data_t & mutex a, global_data_t & mutex b ) {
    72         yield( random( 10 ) );
     64        yield( ((unsigned)rand48()) % 10 );
    7365
    7466        [a.last_thread, b.last_thread, a.last_signaller, b.last_signaller] = this_thread;
    7567
    76         if( !is_empty( cond ) ) {
     68        if( !is_empty( &cond ) ) {
    7769
    78                 thread_desc * next = front( cond );
     70                thread_desc * next = front( &cond );
    7971
    80                 if( ! signal_block( cond ) ) {
     72                if( ! signal_block( &cond ) ) {
    8173                        sout | "ERROR expected to be able to signal" | endl;
    8274                        abort();
    8375                }
    8476
    85                 yield( random( 10 ) );
     77                yield( ((unsigned)rand48()) % 10 );
    8678
    8779                if(a.last_thread != next || b.last_thread != next) {
     
    118110
    119111int main(int argc, char* argv[]) {
    120         random_seed( time( NULL ) );
     112        rand48seed( time( NULL ) );
    121113        done = false;
    122114        processor p;
  • src/tests/sched-int-disjoint.c

    r3f7e12cb r78315272  
    5959// Waiting logic
    6060bool wait( global_t & mutex m, global_data_t & mutex d ) {
    61         wait( cond );
     61        wait( &cond );
    6262        if( d.state != SIGNAL ) {
    6363                sout | "ERROR barging!" | endl;
     
    8080//------------------------------------------------------------------------------
    8181// Signalling logic
    82 void signal( condition & cond, global_t & mutex a, global_data_t & mutex b ) {
     82void signal( condition * cond, global_t & mutex a, global_data_t & mutex b ) {
    8383        b.state = SIGNAL;
    8484        signal( cond );
     
    8686
    8787void logic( global_t & mutex a ) {
    88         signal( cond, a, data );
     88        signal( &cond, a, data );
    8989
    90         yield( random( 10 ) );
     90        yield( (unsigned)rand48() % 10 );
    9191
    9292        //This is technically a mutual exclusion violation but the mutex monitor protects us
     
    109109// Main loop
    110110int main(int argc, char* argv[]) {
    111         random_seed( time( NULL ) );
     111        rand48seed( time( NULL ) );
    112112        all_done = false;
    113113        processor p;
  • src/tests/sched-int-wait.c

    r3f7e12cb r78315272  
    1 //---------------------------------------------------------
    2 // Multi wait test
    3 // Ensures that no deadlock from waiting/signalling conditions
    4 //---------------------------------------------------------
    5 
    6 
    71#include <fstream>
    82#include <kernel>
     
    4135//----------------------------------------------------------------------------------------------------
    4236// Tools
    43 void signal( condition & cond, global_t & mutex a, global_t & mutex b ) {
     37void signal( condition * cond, global_t & mutex a, global_t & mutex b ) {
    4438        signal( cond );
    4539}
    4640
    47 void signal( condition & cond, global_t & mutex a, global_t & mutex b, global_t & mutex c ) {
     41void signal( condition * cond, global_t & mutex a, global_t & mutex b, global_t & mutex c ) {
    4842        signal( cond );
    4943}
    5044
    51 void wait( condition & cond, global_t & mutex a, global_t & mutex b ) {
     45void wait( condition * cond, global_t & mutex a, global_t & mutex b ) {
    5246        wait( cond );
    5347}
    5448
    55 void wait( condition & cond, global_t & mutex a, global_t & mutex b, global_t & mutex c ) {
     49void wait( condition * cond, global_t & mutex a, global_t & mutex b, global_t & mutex c ) {
    5650        wait( cond );
    5751}
     
    6256
    6357        while( waiter_left != 0 ) {
    64                 unsigned action = random( 4 );
     58                unsigned action = (unsigned)rand48() % 4;
    6559                switch( action ) {
    6660                        case 0:
    67                                 signal( condABC, globalA, globalB, globalC );
     61                                signal( &condABC, globalA, globalB, globalC );
    6862                                break;
    6963                        case 1:
    70                                 signal( condAB , globalA, globalB );
     64                                signal( &condAB , globalA, globalB );
    7165                                break;
    7266                        case 2:
    73                                 signal( condBC , globalB, globalC );
     67                                signal( &condBC , globalB, globalC );
    7468                                break;
    7569                        case 3:
    76                                 signal( condAC , globalA, globalC );
     70                                signal( &condAC , globalA, globalC );
    7771                                break;
    7872                        default:
     
    8882void main( WaiterABC & this ) {
    8983        for( int i = 0; i < N; i++ ) {
    90                 wait( condABC, globalA, globalB, globalC );
     84                wait( &condABC, globalA, globalB, globalC );
    9185        }
    9286
     
    9892void main( WaiterAB & this ) {
    9993        for( int i = 0; i < N; i++ ) {
    100                 wait( condAB , globalA, globalB );
     94                wait( &condAB , globalA, globalB );
    10195        }
    10296
     
    108102void main( WaiterAC & this ) {
    109103        for( int i = 0; i < N; i++ ) {
    110                 wait( condAC , globalA, globalC );
     104                wait( &condAC , globalA, globalC );
    111105        }
    112106
     
    118112void main( WaiterBC & this ) {
    119113        for( int i = 0; i < N; i++ ) {
    120                 wait( condBC , globalB, globalC );
     114                wait( &condBC , globalB, globalC );
    121115        }
    122116
     
    127121// Main
    128122int main(int argc, char* argv[]) {
    129         random_seed( time( NULL ) );
     123        rand48seed( time( NULL ) );
    130124        waiter_left = 4;
    131125        processor p[2];
  • src/tests/thread.c

    r3f7e12cb r78315272  
    1515                yield();
    1616        }
    17         V(*this.lock);
     17        V(this.lock);
    1818}
    1919
    2020void main(Second& this) {
    21         P(*this.lock);
     21        P(this.lock);
    2222        for(int i = 0; i < 10; i++) {
    2323                sout | "Second : Suspend No." | i + 1 | endl;
Note: See TracChangeset for help on using the changeset viewer.