Changes in / [78315272:3f7e12cb]
- Files:
-
- 70 added
- 23 deleted
- 187 edited
Legend:
- Unmodified
- Added
- Removed
-
.gitignore
r78315272 r3f7e12cb 52 52 tools/prettyprinter/pretty 53 53 tools/pretty 54 tools/catchsig 55 tools/repeat 54 56 55 57 # generated by xfig for user manual -
configure
r78315272 r3f7e12cb 6281 6281 6282 6282 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/ prettyprinter/Makefile"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" 6284 6284 6285 6285 … … 7048 7048 "src/prelude/Makefile") CONFIG_FILES="$CONFIG_FILES src/prelude/Makefile" ;; 7049 7049 "src/libcfa/Makefile") CONFIG_FILES="$CONFIG_FILES src/libcfa/Makefile" ;; 7050 "tools/Makefile") CONFIG_FILES="$CONFIG_FILES tools/Makefile" ;; 7050 7051 "tools/prettyprinter/Makefile") CONFIG_FILES="$CONFIG_FILES tools/prettyprinter/Makefile" ;; 7051 7052 -
configure.ac
r78315272 r3f7e12cb 238 238 src/prelude/Makefile 239 239 src/libcfa/Makefile 240 tools/Makefile 240 241 tools/prettyprinter/Makefile 241 242 ]) -
doc/LaTeXmacros/lstlang.sty
r78315272 r3f7e12cb 2 2 %% 3 3 %% Cforall Version 1.0.0 Copyright (C) 2016 University of Waterloo 4 %% 5 %% lstlang.sty -- 6 %% 4 %% 5 %% lstlang.sty -- 6 %% 7 7 %% Author : Peter A. Buhr 8 8 %% Created On : Sat May 13 16:34:42 2017 … … 110 110 __attribute__, auto, _Bool, catch, catchResume, choose, _Complex, __complex, __complex__, 111 111 __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, w aitfor, when, 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, with, zero_t}, 115 115 morekeywords=[2]{ 116 _Atomic, coroutine, is_coroutine, is_monitor, is_thread, monitor, mutex, nomutex, 117 resume, suspend, thread, _Thread_local, yield},116 _Atomic, coroutine, is_coroutine, is_monitor, is_thread, monitor, mutex, nomutex, or, 117 resume, suspend, thread, _Thread_local, waitfor, when, yield}, 118 118 moredirectives={defined,include_next}% 119 119 } -
doc/proposals/concurrency/.gitignore
r78315272 r3f7e12cb 16 16 build/*.out 17 17 build/*.ps 18 build/*.pstex 19 build/*.pstex_t 18 20 build/*.tex 19 21 build/*.toc -
doc/proposals/concurrency/Makefile
r78315272 r3f7e12cb 13 13 annex/glossary \ 14 14 text/intro \ 15 text/basics \ 15 16 text/cforall \ 16 text/basics \17 17 text/concurrency \ 18 text/internals \ 18 19 text/parallelism \ 20 text/results \ 21 text/together \ 22 text/future \ 19 23 } 20 24 … … 23 27 ext_monitor \ 24 28 int_monitor \ 29 dependency \ 25 30 }} 26 31 27 PICTURES = ${addsuffix .pstex, \ 28 } 32 PICTURES = ${addprefix build/, ${addsuffix .pstex, \ 33 system \ 34 }} 29 35 30 36 PROGRAMS = ${addsuffix .tex, \ … … 63 69 build/*.out \ 64 70 build/*.ps \ 71 build/*.pstex \ 65 72 build/*.pstex_t \ 66 73 build/*.tex \ -
doc/proposals/concurrency/annex/glossary.tex
r78315272 r3f7e12cb 13 13 } 14 14 15 \longnewglossaryentry{ group-acquire}16 {name={bulk 15 \longnewglossaryentry{bulk-acq} 16 {name={bulk-acquiring}} 17 17 { 18 18 Implicitly 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. 19 25 } 20 26 … … 101 107 \newacronym{api}{API}{Application Program Interface} 102 108 \newacronym{raii}{RAII}{Ressource Acquisition Is Initialization} 109 \newacronym{numa}{NUMA}{Non-Uniform Memory Access} -
doc/proposals/concurrency/figures/ext_monitor.fig
r78315272 r3f7e12cb 14 14 4 1 -1 0 0 0 10 0.0000 2 105 90 6000 2160 d\001 15 15 -6 16 6 5 850 1650 6150 195017 1 3 0 1 -1 -1 0 0 -1 0.000 1 0.0000 6000 1800 105 105 6000 1800 6105 190518 4 1 -1 0 0 0 10 0.0000 2 105 90 6000 1860 b\00116 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 19 19 -6 20 20 6 5100 1800 5400 2100 … … 22 22 4 1 -1 0 0 0 10 0.0000 2 105 120 5250 2010 Y\001 23 23 -6 24 6 5 100 2100 5400 240025 1 3 0 1 -1 -1 1 0 4 0.000 1 0.0000 5250 2250 105 105 5250 2250 5355 225026 4 1 -1 0 0 0 10 0.0000 2 105 120 5250 2295 X\00124 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 27 27 -6 28 6 30 00 5400 7200 570028 6 3070 5445 7275 5655 29 29 1 3 0 1 -1 -1 0 0 20 0.000 1 0.0000 3150 5550 80 80 3150 5550 3230 5630 30 30 1 3 0 1 -1 -1 0 0 -1 0.000 1 0.0000 4500 5550 105 105 4500 5550 4605 5655 … … 32 32 4 0 -1 0 0 0 12 0.0000 2 135 1035 4725 5625 blocked task\001 33 33 4 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 1 80 930 6225 5625 routine ptrs\00134 4 0 -1 0 0 0 12 0.0000 2 135 1050 6225 5625 routine mask\001 35 35 -6 36 36 1 3 0 1 -1 -1 0 0 -1 0.000 1 0.0000 3300 3600 105 105 3300 3600 3405 3705 … … 43 43 2 2 0 1 0 7 50 -1 -1 0.000 0 0 -1 0 0 5 44 44 4050 2925 5475 2925 5475 3225 4050 3225 4050 2925 45 2 1 0 1 -1 -1 0 0 -1 0.000 0 0 -1 0 0 246 5850 2850 6075 300047 45 2 1 0 1 -1 -1 0 0 -1 0.000 0 0 -1 0 0 4 48 46 3150 3750 3750 3750 3750 4050 3150 4050 … … 66 64 2 2 1 1 -1 -1 0 0 -1 4.000 0 0 0 0 0 5 67 65 5850 4200 5850 3300 4350 3300 4350 4200 5850 4200 68 2 1 0 1 -1 -1 0 0 -1 0.000 0 0 -1 0 0 369 5250 2850 5850 2850 5850 165070 2 1 0 1 -1 -1 0 0 -1 0.000 0 0 -1 0 0 471 3150 3150 3750 3150 3750 2850 5325 285072 66 2 1 0 1 0 7 50 -1 -1 0.000 0 0 -1 1 1 2 73 67 1 1 1.00 60.00 120.00 74 68 7 1 1.00 60.00 120.00 75 69 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 76 74 2 2 0 1 0 7 50 -1 -1 0.000 0 0 -1 0 0 5 77 75 5100 1800 5400 1800 5400 2400 5100 2400 5100 1800 -
doc/proposals/concurrency/style/cfa-format.tex
r78315272 r3f7e12cb 108 108 belowskip=3pt, 109 109 keepspaces=true, 110 tabsize=4, 110 111 % frame=lines, 111 112 literate=, … … 133 134 belowskip=3pt, 134 135 keepspaces=true, 136 tabsize=4, 135 137 % frame=lines, 136 138 literate=, … … 150 152 keywordstyle=\bfseries\color{blue}, 151 153 keywordstyle=[2]\bfseries\color{Plum}, 152 commentstyle=\ itshape\color{OliveGreen},% green and italic comments154 commentstyle=\sf\itshape\color{OliveGreen}, % green and italic comments 153 155 identifierstyle=\color{identifierCol}, 154 156 stringstyle=\sf\color{Mahogany}, % use sanserif font … … 158 160 belowskip=3pt, 159 161 keepspaces=true, 162 tabsize=4, 160 163 % frame=lines, 161 164 literate=, … … 251 254 }{} 252 255 256 \lstnewenvironment{gocode}[1][]{ 257 \lstset{ 258 language = Golang, 259 style=defaultStyle, 260 #1 261 } 262 }{} 263 253 264 \newcommand{\zero}{\lstinline{zero_t}\xspace} 254 265 \newcommand{\one}{\lstinline{one_t}\xspace} -
doc/proposals/concurrency/text/basics.tex
r78315272 r3f7e12cb 1 1 % ====================================================================== 2 2 % ====================================================================== 3 \chapter{ Basics}\label{basics}3 \chapter{Concurrency Basics}\label{basics} 4 4 % ====================================================================== 5 5 % ====================================================================== 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 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. 7 7 8 8 \section{Basics of concurrency} 9 At 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. 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. 10 16 11 17 \section{\protect\CFA 's Thread Building Blocks} 12 One 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 toimperative 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.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. 13 19 14 20 \section{Coroutines: A stepping stone}\label{coroutine} 15 While 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 17 Here 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; 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; 43 } 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; 76 } 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; 35 163 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 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 44 212 } 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; 56 } 57 } 58 \end{cfacode} 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} 59 235 60 236 \subsection{Construction} 61 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 . 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 63 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. Like for regular objects, constructors can stillleak coroutines before they are ready. There are several solutions to this problem but the chosen options effectively forces the design of the coroutine.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. 64 240 65 241 Furthermore, \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: … … 71 247 72 248 forall(otype T) 73 void noop(T 249 void noop(T*) {} 74 250 75 251 void bar() { 76 252 int a; 77 async(noop, &a); 78 } 79 \end{cfacode} 253 async(noop, &a); //start thread running noop with argument a 254 } 255 \end{cfacode} 256 80 257 The generated C code\footnote{Code trimmed down for brevity} creates a local thunk to hold type information: 81 258 … … 95 272 } 96 273 \end{ccode} 97 The 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.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. 98 275 99 276 \subsection{Alternative: Composition} 100 One 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} 113 There 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. 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. 114 296 115 297 \subsection{Alternative: Reserved keyword} … … 117 299 118 300 \begin{cfacode} 119 coroutine Fibonacci { 120 int fn; // used for communication 121 }; 122 \end{cfacode} 123 This 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. 124 While 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. 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. 125 306 126 307 \subsection{Alternative: Lamda Objects} … … 135 316 Often, 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. 136 317 137 A variation of this would be to use a nsimple function pointer in the same way pthread does for threads :318 A variation of this would be to use a simple function pointer in the same way pthread does for threads : 138 319 \begin{cfacode} 139 320 void foo( coroutine_t cid, void * arg ) { … … 148 329 } 149 330 \end{cfacode} 150 This semantic is more common for thread interfaces than coroutines but would workequally well. As discussed in section \ref{threads}, this approach is superseeded by static approaches in terms of expressivity.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. 151 332 152 333 \subsection{Alternative: Trait-based coroutines} … … 159 340 coroutine_desc * get_coroutine(T & this); 160 341 }; 161 \end{cfacode} 162 This 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. 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. 163 347 164 348 \begin{center} … … 186 370 \end{center} 187 371 188 The combination of these two approaches allows users new to co ncurrency to have a easy and concise method while more advanced users can expose themselves to otherwise hidden pitfalls at the benefit oftighter control on memory layout and initialization.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. 189 373 190 374 \section{Thread Interface}\label{threads} … … 192 376 193 377 \begin{cfacode} 194 378 thread foo {}; 195 379 \end{cfacode} 196 380 … … 205 389 \end{cfacode} 206 390 207 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 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 216 In 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 235 An 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 237 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} once the constructor has completed and \code{join} before the destructor runs. 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. 238 423 \begin{cfacode} 239 424 thread World; … … 254 439 \end{cfacode} 255 440 256 This 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 simple441 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. 257 442 258 443 \begin{cfacode} … … 276 461 \end{cfacode} 277 462 278 However, 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 created463 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. 279 464 280 465 \begin{cfacode} … … 283 468 }; 284 469 285 //main286 470 void main(MyThread & this) { 287 471 //... … … 291 475 MyThread * long_lived; 292 476 { 477 //Start a thread at the beginning of the scope 293 478 MyThread short_lived; 294 //Start a thread at the beginning of the scope295 296 DoStuff();297 479 298 480 //create another thread that will outlive the thread in this scope 299 481 long_lived = new MyThread; 300 482 483 DoStuff(); 484 301 485 //Wait for the thread short_lived to finish 302 486 } 303 487 DoMoreStuff(); 304 488 305 //Now wait for the short_lived to finish489 //Now wait for the long_lived to finish 306 490 delete long_lived; 307 491 } -
doc/proposals/concurrency/text/cforall.tex
r78315272 r3f7e12cb 1 1 % ====================================================================== 2 2 % ====================================================================== 3 \chapter{Cforall crash course}3 \chapter{Cforall Overview} 4 4 % ====================================================================== 5 5 % ====================================================================== 6 6 7 As 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 languagespecifically tailored to the features needed to support concurrency.7 The following is a quick introduction to the \CFA language, specifically tailored to the features needed to support concurrency. 8 8 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} 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} 10 11 11 12 \section{References} 12 13 13 Like \CC, \CFA introduces re ferences 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: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: 14 15 \begin{cfacode} 15 16 int x, *p1 = &x, **p2 = &p1, ***p3 = &p2, 16 &r1 = x, &&r2 = r1, &&&r3 = r2; 17 ***p3 = 3; // change x 18 r3 = 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 24 int y, z, & ar[3] = { x, y, z }; // initialize array of references 25 &ar[1] = &z; // change reference array element 26 typeof( ar[1] ) p; // is int, i.e., the type of referenced object 27 typeof( &ar[1] ) q; // is int &, i.e., the type of reference 28 sizeof( ar[1] ) == sizeof( int ); // is true, i.e., the size of referenced object 29 sizeof( &ar[1] ) == sizeof( int *); // is true, i.e., the size of a reference 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 30 27 \end{cfacode} 31 The important t hing 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.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. 32 29 33 30 \section{Overloading} 34 31 35 Another important feature \CFA has in common with \CC is function overloading :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. 36 33 \begin{cfacode} 37 // 38 void f( void ); //(1)39 void f( char ); //(2)40 void f( int, double ); //(3)41 f(); //select (1)42 f( 'a' ); //select (2)43 f( 3, 5.2 ); //select (3)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) 44 41 45 // selection based on type and number of returns 46 char f( int ); // (1) 47 double f( int ); // (2) 48 [ int, double ] f( int ); // (3) 49 char c = f( 3 ); // select (1) 50 double d = f( 4 ); // select (2) 51 [ int, double ] t = f( 5 ); // select (3) 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) 52 47 \end{cfacode} 53 This 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.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. 54 49 55 50 \section{Operators} 56 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 would be, like so: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.: 57 52 \begin{cfacode} 58 int ++? ( int op ); //unary prefix increment59 int ?++ ( int op ); //unary postfix increment60 int ?+? ( int op1, int op2 ); //binary plus61 int ?<=?( int op1, int op2 ); //binary less than62 int ?=? ( int & op1, int op2 ); //binary assignment63 int ?+=?( int & op1, int op2 ); //binary plus-assignment53 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 64 59 65 struct S { int i, j;};66 S ?+?( S op1, S op2 ) { //add two structures67 return (S){ op1.i + op2.i, op1.j + op2.j};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}; 68 63 } 69 S s1 = { 1, 2 }, s2 = { 2, 3}, s3;70 s3 = s1 + s2; // compute sum: s3 == { 2, 5}64 S s1 = {1, 2}, s2 = {2, 3}, s3; 65 s3 = s1 + s2; //compute sum: s3 == {2, 5} 71 66 \end{cfacode} 72 73 Since concurrency does not use operator overloading, this feature is more important as an introduction for the syntax of constructors. 67 While concurrency does not use operator overloading directly, this feature is more important as an introduction for the syntax of constructors. 74 68 75 69 \section{Constructors/Destructors} 76 \CFA uses the following syntax for constructors and 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 : 77 71 \begin{cfacode} 78 72 struct S { … … 80 74 int * ia; 81 75 }; 82 void ?{}( S & s, int asize ) with s { //constructor operator83 s ize = asize; //initialize fields84 ia = calloc( size, sizeof( S ));76 void ?{}(S & s, int asize) { //constructor operator 77 s.size = asize; //initialize fields 78 s.ia = calloc(size, sizeof(S)); 85 79 } 86 void ^?{}( S & s ) with s { //destructor operator87 free( ia ); //de-initialization fields80 void ^?{}(S & s) { //destructor operator 81 free(ia); //de-initialization fields 88 82 } 89 83 int main() { 90 S x = { 10 }, y = { 100 }; // implict calls: ?{}( x, 10 ), ?{}( y, 100)91 ... //use x and y92 ^x{}; ^y{}; // 93 x{ 20 }; y{ 200 }; //explicit calls to reinitialize94 ... //reuse x and y95 } // implict calls: ^?{}( y ), ^?{}( x)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) 96 90 \end{cfacode} 97 The 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. 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. 98 102 99 For more information see \cite{cforall-ug,rob-thesis,www-cfa}. 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}. -
doc/proposals/concurrency/text/concurrency.tex
r78315272 r3f7e12cb 4 4 % ====================================================================== 5 5 % ====================================================================== 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 that closely relate to networking concepts (channels\citfor 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.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. 7 7 8 8 Approaches 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}. 9 9 10 An approach that is worth mention ning 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 purposelanguage, 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 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. 13 13 14 14 \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 numerous mechanisms to establish timing relationships among threads.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. 16 16 17 17 \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 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 composablebecause 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.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. 19 19 20 20 \subsection{Synchronization} 21 As 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.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. 22 22 23 23 % ====================================================================== … … 28 28 A 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 : 29 29 \begin{cfacode} 30 31 32 33 34 35 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 } 37 37 \end{cfacode} 38 38 … … 47 47 48 48 \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} 57 58 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 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 60 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 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 63 The next semantic decision is to establish when \code{mutex} may be used as a type qualifier. Consider the following declarations: 64 \begin{cfacode} 65 int f1(monitor & mutex m); 66 int f2(const monitor & mutex m); 67 int f3(monitor ** mutex m); 68 int f4(monitor * mutex m []); 69 int f5(graph(monitor*) & mutex m); 70 \end{cfacode} 71 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 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} 74 int f1(monitor & mutex m); //Okay : recommanded case 75 int f2(monitor * mutex m); //Okay : could be an array but probably not 76 int f3(monitor mutex m []); //Not Okay : Array of unkown length 77 int f4(monitor ** mutex m); //Not Okay : Could be an array 78 int f5(monitor * mutex m []); //Not Okay : Array of unkown length 79 \end{cfacode} 80 81 Unlike 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} 83 int f(MonitorA & mutex a, MonitorB & mutex b); 84 85 MonitorA a; 86 MonitorB b; 87 f(a,b); 88 \end{cfacode} 89 The 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} 103 The 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 105 However, 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} 110 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. 111 112 Finally, 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} 114 monitor bank { 115 int money; 116 log_t usr_log; 117 }; 118 119 void deposit( bank & mutex b, int deposit ) { 120 b.money += deposit; 121 b.usr_log | "Adding" | deposit | endl; 122 } 123 124 void 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 % ====================================================================== 135 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}: 136 \begin{cfacode} 137 monitor counter_t { 138 int value; 139 }; 140 141 void ?{}(counter_t & this) { 142 this.cnt = 0; 143 } 144 145 int ?++(counter_t & mutex this) { 146 return ++this.value; 147 } 148 149 //need for mutex is platform dependent here 150 void ?{}(int * this, counter_t & mutex cnt) { 151 *this = (int)cnt; 152 } 153 \end{cfacode} 154 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} 155 57 This counter is used as follows: 156 58 \begin{center} … … 169 71 \end{tabular} 170 72 \end{center} 171 Notice 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 % ====================================================================== 178 Depending 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 180 First 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 182 Before 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: 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} 183 166 \begin{center} 184 \setlength\tabcolsep{1.5pt} 185 \begin{tabular}{|c|c|c|} 186 Code & \gls{callsite-locking} & \gls{entry-point-locking} \\ 187 \CFA & pseudo-code & pseudo-code \\ 167 \begin{tabular}{|c|c|} 168 function call & \code{mutex} statement \\ 188 169 \hline 189 170 \begin{cfacode}[tabsize=3] 190 void foo(monitor& mutex a){ 191 192 193 194 //Do Work 195 //... 196 197 } 198 199 void main() { 200 monitor a; 201 202 203 204 foo(a); 205 206 } 207 \end{cfacode} & \begin{pseudo}[tabsize=3] 208 foo(& a) { 209 210 211 212 //Do Work 213 //... 214 215 } 216 217 main() { 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] 226 foo(& a) { 227 //called routine 228 //handles concurrency 229 acquire(a); 230 //Do Work 231 //... 232 release(a); 233 } 234 235 main() { 236 monitor a; 237 238 239 240 foo(a); 241 242 } 243 \end{pseudo} 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} 244 189 \end{tabular} 245 190 \end{center} 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 249 Note 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 253 forall(dtype T) 254 void foo(T * mutex t); 255 256 //Correct 257 //this function only works on monitors 258 //(any monitor) 259 forall(dtype T | is_monitor(T)) 260 void bar(T * mutex t)); 261 \end{cfacode} 262 263 264 % ====================================================================== 265 % ====================================================================== 266 \section{Internal scheduling} \label{insched} 267 % ====================================================================== 268 % ====================================================================== 269 In 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. 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. 270 235 271 236 First, here is a simple example of such a technique: 272 237 273 238 \begin{cfacode} 274 275 276 277 278 279 280 //Wait for cooperation from bar()281 282 283 284 285 286 //Provide cooperation for foo()287 288 // Unblock foo at scope exit289 290 291 \end{cfacode} 292 293 There are two details to note here. First, the re \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 295 An important aspect to take into account here is that \CFA does not allow barging, which means that once function \code{bar} releases the monitor, foois 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.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. 296 261 297 262 % ====================================================================== … … 300 265 % ====================================================================== 301 266 % ====================================================================== 302 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. 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. 303 268 304 269 \begin{multicols}{2} … … 319 284 \end{pseudo} 320 285 \end{multicols} 321 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. 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 itis a logical requirement for barging prevention.322 323 A direct extension of the previous example is the \gls{group-acquire} version: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: 324 289 325 290 \begin{multicols}{2} … … 338 303 \end{pseudo} 339 304 \end{multicols} 340 This 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 342 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. 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 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 : 344 308 \begin{multicols}{2} 345 309 \begin{pseudo} … … 354 318 355 319 \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} 356 344 357 345 acquire B … … 362 350 \end{multicols} 363 351 364 The next example is where \gls{group-acquire} adds a significant layer of complexity to the internal signalling semantics. 365 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] 366 361 \begin{multicols}{2} 367 362 Waiting thread 368 363 \begin{pseudo}[numbers=left] 369 364 acquire A 370 // 365 //Code Section 1 371 366 acquire A & B 372 // 367 //Code Section 2 373 368 wait A & B 374 // 369 //Code Section 3 375 370 release A & B 376 // 371 //Code Section 4 377 372 release A 378 373 \end{pseudo} … … 383 378 \begin{pseudo}[numbers=left, firstnumber=10] 384 379 acquire A 385 // 380 //Code Section 5 386 381 acquire A & B 387 // 382 //Code Section 6 388 383 signal A & B 389 // 384 //Code Section 7 390 385 release A & B 391 // 386 //Code Section 8 392 387 release A 393 388 \end{pseudo} 394 389 \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 395 \begin{center} 396 Listing 1 396 \begin{cfacode}[xleftmargin=.4\textwidth] 397 monitor A a; 398 monitor B b; 399 condition c; 400 \end{cfacode} 397 401 \end{center} 398 399 It 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: 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. 400 436 401 437 \subsubsection{Delaying signals} 402 The 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.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. 403 439 \begin{multicols}{2} 404 440 Waiter … … 424 460 \end{pseudo} 425 461 \end{multicols} 426 However, this solution can become much more complicated depending on what is executed while secretly holding B (at line 10). Indeed, nothing prevents a user fromsignalling monitor A on a different condition variable:427 \ newpage428 \begin{multicols}{ 2}429 Thread 1462 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$ 430 466 \begin{pseudo}[numbers=left, firstnumber=1] 431 467 acquire A … … 436 472 \end{pseudo} 437 473 438 Thread 2439 \begin{pseudo}[numbers=left, firstnumber=6]440 acquire A441 wait A442 release A443 \end{pseudo}444 445 474 \columnbreak 446 475 447 Thread 3448 \begin{pseudo}[numbers=left, firstnumber=1 0]476 Thread $\gamma$ 477 \begin{pseudo}[numbers=left, firstnumber=1] 449 478 acquire A 450 479 acquire A & B 451 480 signal A & B 452 481 release A & B 453 //Secretly keep B here454 482 signal A 455 483 release A 456 //Wakeup thread 1 or 2? 457 //Who wakes up the other thread? 458 \end{pseudo} 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 459 495 \end{multicols} 496 \caption{Dependency graph} 497 \label{lst:dependency} 498 \end{figure} 460 499 461 500 The 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. … … 467 506 Note 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. 468 507 469 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.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. 470 509 471 510 \subsubsection{Dependency graphs} 472 In 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: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: 473 512 474 513 \begin{multicols}{2} … … 495 534 \end{pseudo} 496 535 \end{multicols} 497 Resolving dependency graph being a complex and expensive endeavour, this solution is not the preffered one. 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. 498 546 499 547 \subsubsection{Partial signalling} \label{partial-sig} 500 Finally, 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] 504 acquire A 505 acquire A & B 506 wait A & B 507 release A & B 508 release A 509 \end{pseudo} 510 511 \columnbreak 512 513 \begin{pseudo}[numbers=left, firstnumber=6] 514 acquire A 515 acquire A & B 516 signal A & B 517 release A & B 518 // ... More code 519 release A 520 \end{pseudo} 521 \end{multicols} 522 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 conditionnaly waking threads if all conditions are met. Contrary to the other solutions, this solution quickly hits an upper bound on complexity of implementation. 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. 523 549 524 550 % ====================================================================== … … 527 553 % ====================================================================== 528 554 % ====================================================================== 529 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}. 530 531 For example here is an example highlighting the difference in behaviour: 532 \begin{center} 555 \begin{figure} 533 556 \begin{tabular}{|c|c|} 534 557 \code{signal} & \code{signal_block} \\ 535 558 \hline 536 \begin{cfacode} 537 monitor M { int val; }; 538 539 void 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 549 void 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} 559 monitor M { int val; }; 560 561 void 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 571 void 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; 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 579 652 } 580 653 \end{cfacode} 581 654 \end{tabular} 582 \end{center} 583 Assuming 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 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. 661 662 % ====================================================================== 663 % ====================================================================== 664 \section{External scheduling} \label{extsched} 665 % ====================================================================== 666 % ====================================================================== 667 An alternative to internal scheduling is external scheduling, e.g., in \uC. 585 668 \begin{center} 586 \begin{tabular}{|c|c| }587 \code{signal} & \code{signal_block}\\669 \begin{tabular}{|c|c|c|} 670 Internal Scheduling & External Scheduling & Go\\ 588 671 \hline 589 \begin{pseudo} 590 Foo: 0 591 Bar: 1 592 Bar: 2 593 Foo: 3 594 \end{pseudo}&\begin{pseudo} 595 Foo: 0 596 Bar: 1 597 Foo: 2 598 Bar: 3 599 \end{pseudo} 600 \end{tabular} 601 \end{center} 602 603 As 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 % ====================================================================== 610 There 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 612 The 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 614 Since 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 616 The following figure is the traditionnal illustration of a monitor : 617 618 \begin{center} 619 {\resizebox{0.4\textwidth}{!}{\input{monitor}}} 620 \end{center} 621 622 For \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 630 This picture and the proper entry and leave algorithms is the fundamental implementation of internal scheduling. 631 632 \begin{multicols}{2} 633 Entry 634 \begin{pseudo}[numbers=left] 635 if monitor is free 636 enter 637 elif I already own the monitor 638 continue 639 else 640 block 641 increment recursion 642 643 \end{pseudo} 644 \columnbreak 645 Exit 646 \begin{pseudo}[numbers=left, firstnumber=8] 647 decrement recursion 648 if 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 659 Some 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. 660 661 % ====================================================================== 662 % ====================================================================== 663 \section{External scheduling} \label{extsched} 664 % ====================================================================== 665 % ====================================================================== 666 An alternative to internal scheduling is to use external scheduling. 667 \begin{center} 668 \begin{tabular}{|c|c|} 669 Internal Scheduling & External Scheduling \\ 670 \hline 671 \begin{ucppcode} 672 \begin{ucppcode}[tabsize=3] 672 673 _Monitor Semaphore { 673 674 condition c; … … 675 676 public: 676 677 void P() { 677 if(inUse) wait(c); 678 if(inUse) 679 wait(c); 678 680 inUse = true; 679 681 } … … 683 685 } 684 686 } 685 \end{ucppcode}&\begin{ucppcode} 687 \end{ucppcode}&\begin{ucppcode}[tabsize=3] 686 688 _Monitor Semaphore { 687 689 … … 689 691 public: 690 692 void P() { 691 if(inUse) _Accept(V); 693 if(inUse) 694 _Accept(V); 692 695 inUse = true; 693 696 } … … 697 700 } 698 701 } 699 \end{ucppcode} 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} 700 727 \end{tabular} 701 728 \end{center} 702 This 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 704 In 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} couldacquire the monitor.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. 705 732 706 733 % ====================================================================== … … 709 736 % ====================================================================== 710 737 % ====================================================================== 711 In \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 } 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 } 721 752 \end{cfacode} 722 753 … … 728 759 if monitor is free 729 760 enter 730 elif Ialready own the monitor761 elif already own the monitor 731 762 continue 732 763 elif monitor accepts me … … 738 769 \end{center} 739 770 740 For the fi st 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: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: 741 772 742 773 \begin{center} … … 744 775 \end{center} 745 776 746 There 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.747 The alternative would be to have a picture more like this one: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: 748 779 749 780 \begin{center} … … 751 782 \end{center} 752 783 753 Not 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 755 At 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 757 Another 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. 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. 758 806 759 807 % ====================================================================== … … 763 811 % ====================================================================== 764 812 765 External scheduling, like internal scheduling, becomes orders of magnitude more complex when we start introducing multi-monitor syntax. Even in the simplest possible casesome 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 monitor773 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 } 774 822 \end{cfacode} 775 823 … … 777 825 778 826 \begin{cfacode} 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 788 This 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 800 Note 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 802 An 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 825 While 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 % ====================================================================== 832 To 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 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. -
doc/proposals/concurrency/text/intro.tex
r78315272 r3f7e12cb 3 3 % ====================================================================== 4 4 5 This 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 \CFA5 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. 6 6 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 users. While these two concepts are often combined, they are in fact distinct concepts that requiredifferent tools~\cite{Buhr05a}. Concurrency tools need to handle mutual exclusion and synchronization, while parallelism tools are about performance, cost and resource utilization.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. -
doc/proposals/concurrency/text/parallelism.tex
r78315272 r3f7e12cb 11 11 \section{Paradigm} 12 12 \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 s 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.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. 14 14 15 15 Examples of languages that support \glspl{uthread} are Erlang~\cite{Erlang} and \uC~\cite{uC++book}. 16 16 17 17 \subsection{Fibers : user-level threads without preemption} 18 A popular varient of \glspl{uthread} is what is often ref fered 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 ignorefibers.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. 19 19 20 20 An example of a language that uses fibers is Go~\cite{Go} 21 21 22 22 \subsection{Jobs and thread pools} 23 The 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 limitsthe 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.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. 24 24 25 25 The gold standard of this implementation is Intel's TBB library~\cite{TBB}. 26 26 27 27 \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 . 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.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. 29 29 30 \newpage 31 \TODO 32 \subsection{The \protect\CFA\ Kernel : Processors, Clusters and Threads}\label{kernel} 30 \section{The \protect\CFA\ Kernel : Processors, Clusters and Threads}\label{kernel} 33 31 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. 34 36 35 37 \subsection{Paradigms}\label{cfaparadigms} 36 Given 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? 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}. -
doc/proposals/concurrency/thesis.tex
r78315272 r3f7e12cb 1 1 % requires tex packages: texlive-base texlive-latex-base tex-common texlive-humanities texlive-latex-extra texlive-fonts-recommended 2 2 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-^ 9 9 % math escape $...$ (dollar symbol) 10 10 … … 27 27 \usepackage{multicol} 28 28 \usepackage[acronym]{glossaries} 29 \usepackage{varioref} 29 \usepackage{varioref} 30 30 \usepackage{listings} % format program code 31 31 \usepackage[flushmargin]{footmisc} % support label/reference in footnote … … 35 35 \usepackage[pagewise]{lineno} 36 36 \usepackage{fancyhdr} 37 \usepackage{float} 37 38 \renewcommand{\linenumberfont}{\scriptsize\sffamily} 39 \usepackage{siunitx} 40 \sisetup{ binary-units=true } 38 41 \input{style} % bespoke macros used in the document 39 42 \usepackage[dvips,plainpages=false,pdfpagelabels,pdfpagemode=UseNone,colorlinks=true,pagebackref=true,linkcolor=blue,citecolor=blue,urlcolor=blue,pagebackref=true,breaklinks=true]{hyperref} … … 70 73 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 71 74 72 \setcounter{secnumdepth}{ 3} % number subsubsections73 \setcounter{tocdepth}{ 3} % subsubsections in table of contents75 \setcounter{secnumdepth}{2} % number subsubsections 76 \setcounter{tocdepth}{2} % subsubsections in table of contents 74 77 % \linenumbers % comment out to turn off line numbering 75 78 \makeindex … … 103 106 \input{parallelism} 104 107 105 \chapter{Putting it all together} 108 \input{internals} 109 110 \input{together} 111 112 \input{results} 113 114 \input{future} 106 115 107 116 \chapter{Conclusion} 108 109 \chapter{Future work}110 Concurrency 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}112 117 113 118 \section*{Acknowledgements} -
doc/proposals/concurrency/version
r78315272 r3f7e12cb 1 0. 9.1801 0.11.47 -
src/CodeGen/CodeGenerator.cc
r78315272 r3f7e12cb 287 287 void CodeGenerator::postvisit( TypeDecl * typeDecl ) { 288 288 assertf( ! genC, "TypeDecls should not reach code generation." ); 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() ) {289 output << typeDecl->genTypeString() << " " << typeDecl->name; 290 if ( typeDecl->sized ) { 291 output << " | sized(" << typeDecl->name << ")"; 292 } 293 if ( ! typeDecl->assertions.empty() ) { 294 294 output << " | { "; 295 genCommaList( typeDecl->get_assertions().begin(), typeDecl->get_assertions().end() ); 295 for ( DeclarationWithType * assert : typeDecl->assertions ) { 296 assert->accept( *visitor ); 297 output << "; "; 298 } 296 299 output << " }"; 297 300 } … … 443 446 void CodeGenerator::postvisit( UntypedExpr * untypedExpr ) { 444 447 extension( untypedExpr ); 445 if ( NameExpr * nameExpr = dynamic_cast< NameExpr* >( untypedExpr-> get_function()) ) {448 if ( NameExpr * nameExpr = dynamic_cast< NameExpr* >( untypedExpr->function ) ) { 446 449 OperatorInfo opInfo; 447 if ( operatorLookup( nameExpr-> get_name(), opInfo ) ) {448 std::list< Expression* >::iterator arg = untypedExpr-> get_args().begin();450 if ( operatorLookup( nameExpr->name, opInfo ) ) { 451 std::list< Expression* >::iterator arg = untypedExpr->args.begin(); 449 452 switch ( opInfo.type ) { 450 453 case OT_INDEX: 451 assert( untypedExpr-> get_args().size() == 2 );454 assert( untypedExpr->args.size() == 2 ); 452 455 (*arg++)->accept( *visitor ); 453 456 output << "["; … … 461 464 case OT_CTOR: 462 465 case OT_DTOR: 463 if ( untypedExpr-> get_args().size() == 1 ) {466 if ( untypedExpr->args.size() == 1 ) { 464 467 // the expression fed into a single parameter constructor or destructor may contain side 465 468 // effects, so must still output this expression … … 480 483 (*arg++)->accept( *visitor ); 481 484 output << opInfo.symbol << "{ "; 482 genCommaList( arg, untypedExpr-> get_args().end() );485 genCommaList( arg, untypedExpr->args.end() ); 483 486 output << "}) /* " << opInfo.inputName << " */"; 484 487 } // if … … 488 491 case OT_PREFIXASSIGN: 489 492 case OT_LABELADDRESS: 490 assert( untypedExpr-> get_args().size() == 1 );493 assert( untypedExpr->args.size() == 1 ); 491 494 output << "("; 492 495 output << opInfo.symbol; … … 497 500 case OT_POSTFIX: 498 501 case OT_POSTFIXASSIGN: 499 assert( untypedExpr-> get_args().size() == 1 );502 assert( untypedExpr->args.size() == 1 ); 500 503 (*arg)->accept( *visitor ); 501 504 output << opInfo.symbol; … … 504 507 case OT_INFIX: 505 508 case OT_INFIXASSIGN: 506 assert( untypedExpr-> get_args().size() == 2 );509 assert( untypedExpr->args.size() == 2 ); 507 510 output << "("; 508 511 (*arg++)->accept( *visitor ); … … 517 520 } // switch 518 521 } else { 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 522 // builtin routines 523 nameExpr->accept( *visitor ); 524 output << "("; 525 genCommaList( untypedExpr->args.begin(), untypedExpr->args.end() ); 526 output << ")"; 530 527 } // if 531 528 } else { 532 untypedExpr-> get_function()->accept( *visitor );529 untypedExpr->function->accept( *visitor ); 533 530 output << "("; 534 genCommaList( untypedExpr-> get_args().begin(), untypedExpr->get_args().end() );531 genCommaList( untypedExpr->args.begin(), untypedExpr->args.end() ); 535 532 output << ")"; 536 533 } // if … … 538 535 539 536 void CodeGenerator::postvisit( RangeExpr * rangeExpr ) { 540 rangeExpr-> get_low()->accept( *visitor );537 rangeExpr->low->accept( *visitor ); 541 538 output << " ... "; 542 rangeExpr-> get_high()->accept( *visitor );539 rangeExpr->high->accept( *visitor ); 543 540 } 544 541 … … 546 543 extension( nameExpr ); 547 544 OperatorInfo opInfo; 548 if ( operatorLookup( nameExpr->get_name(), opInfo ) ) { 549 assert( opInfo.type == OT_CONSTANT ); 550 output << opInfo.symbol; 545 if ( operatorLookup( nameExpr->name, opInfo ) ) { 546 if ( opInfo.type == OT_CONSTANT ) { 547 output << opInfo.symbol; 548 } else { 549 output << opInfo.outputName; 550 } 551 551 } else { 552 552 output << nameExpr->get_name(); … … 885 885 886 886 void CodeGenerator::postvisit( CaseStmt * caseStmt ) { 887 updateLocation( caseStmt ); 888 output << indent; 887 889 if ( caseStmt->isDefault()) { 888 890 output << "default"; … … 947 949 output << ";"; 948 950 } 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 949 1014 950 1015 void CodeGenerator::postvisit( WhileStmt * whileStmt ) { … … 1025 1090 } 1026 1091 } // 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 } 1027 1104 1028 1105 // Local Variables: // -
src/CodeGen/CodeGenerator.h
r78315272 r3f7e12cb 100 100 void postvisit( ReturnStmt * ); 101 101 void postvisit( ThrowStmt * ); 102 void postvisit( CatchStmt * ); 103 void postvisit( WaitForStmt * ); 102 104 void postvisit( WhileStmt * ); 103 105 void postvisit( ForStmt * ); -
src/CodeGen/FixNames.cc
r78315272 r3f7e12cb 66 66 ); 67 67 68 main Decl->get_functionType()->get_parameters().push_back(68 main_type->get_parameters().push_back( 69 69 new ObjectDecl( "", Type::StorageClasses(), LinkageSpec::Cforall, 0, new BasicType( Type::Qualifiers(), BasicType::SignedInt ), nullptr ) 70 70 ); 71 71 72 main Decl->get_functionType()->get_parameters().push_back(72 main_type->get_parameters().push_back( 73 73 new ObjectDecl( "", Type::StorageClasses(), LinkageSpec::Cforall, 0, 74 74 new PointerType( Type::Qualifiers(), new PointerType( Type::Qualifiers(), new BasicType( Type::Qualifiers(), BasicType::Char ) ) ), -
src/CodeGen/GenType.cc
r78315272 r3f7e12cb 210 210 211 211 std::string GenType::handleGeneric( ReferenceToType * refType ) { 212 if ( ! refType-> get_parameters().empty() ) {212 if ( ! refType->parameters.empty() ) { 213 213 std::ostringstream os; 214 214 PassVisitor<CodeGenerator> cg( os, pretty, genC, lineMarks ); 215 215 os << "("; 216 cg.pass.genCommaList( refType-> get_parameters().begin(), refType->get_parameters().end() );216 cg.pass.genCommaList( refType->parameters.begin(), refType->parameters.end() ); 217 217 os << ") "; 218 218 return os.str(); -
src/Common/Indenter.h
r78315272 r3f7e12cb 18 18 19 19 struct Indenter { 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; 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; 23 25 24 26 Indenter & operator+=(int nlevels) { indent += amt*nlevels; return *this; } … … 30 32 }; 31 33 32 inline std::ostream & operator<<( std::ostream & out, Indenter & indent ) {34 inline std::ostream & operator<<( std::ostream & out, const Indenter & indent ) { 33 35 return out << std::string(indent.indent, ' '); 34 36 } -
src/Common/PassVisitor.h
r78315272 r3f7e12cb 4 4 5 5 #include <stack> 6 7 #include "Common/utility.h" 6 8 7 9 #include "SynTree/Mutator.h" … … 10 12 #include "SymTab/Indexer.h" 11 13 14 #include "SynTree/Attribute.h" 12 15 #include "SynTree/Initializer.h" 13 16 #include "SynTree/Statement.h" … … 53 56 pass_type pass; 54 57 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; 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; 232 241 233 242 private: 234 243 template<typename pass_t> friend void acceptAll( std::list< Declaration* > &decls, PassVisitor< pass_t >& visitor ); 235 244 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 ); 236 249 237 250 template<typename node_type> void call_previsit ( node_type * node ) { previsit_impl ( pass, node, 0 ); } … … 268 281 std::list< Declaration* > * get_afterDecls () { return declsToAddAfter_impl ( pass, 0); } 269 282 270 void set_visit_children( bool& ref ) { bool_ref * ptr = visit_children_impl(pass, 0); if(ptr) ptr->set( ref ); } 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); } 271 285 272 286 void indexerScopeEnter () { indexer_impl_enterScope ( pass, 0 ); } -
src/Common/PassVisitor.impl.h
r78315272 r3f7e12cb 2 2 // IWYU pragma: private, include "PassVisitor.h" 3 3 4 #define VISIT_START( node ) \ 5 __attribute__((unused)) \ 4 #define VISIT_START( node ) \ 5 __attribute__((unused)) \ 6 ChildrenGuard children_guard( get_visit_children_ptr() ); \ 7 __attribute__((unused)) \ 6 8 guard_value_impl guard( at_cleanup_impl(pass, 0) ); \ 7 bool visit_children = true; \ 8 set_visit_children( visit_children ); \ 9 call_previsit( node ); \ 10 if( visit_children ) { \ 9 call_previsit( node ); \ 11 10 12 11 #define VISIT_END( node ) \ 13 } \14 12 call_postvisit( node ); \ 15 13 16 #define MUTATE_START( node ) \ 17 __attribute__((unused)) \ 14 #define MUTATE_START( node ) \ 15 __attribute__((unused)) \ 16 ChildrenGuard children_guard( get_visit_children_ptr() ); \ 17 __attribute__((unused)) \ 18 18 guard_value_impl guard( at_cleanup_impl(pass, 0) ); \ 19 bool visit_children = true; \ 20 set_visit_children( visit_children ); \ 21 call_premutate( node ); \ 22 if( visit_children ) { \ 19 call_premutate( node ); \ 23 20 24 21 #define MUTATE_END( type, node ) \ 25 } \26 22 return call_postmutate< type * >( node ); \ 27 23 28 24 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 ); \ 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 ); \ 39 39 40 40 … … 63 63 template< typename pass_type > 64 64 static inline void acceptAll( std::list< Declaration* > &decls, PassVisitor< pass_type >& visitor ) { 65 66 65 DeclList_t* beforeDecls = visitor.get_beforeDecls(); 67 66 DeclList_t* afterDecls = visitor.get_afterDecls(); … … 76 75 try { 77 76 // run visitor on declaration 78 maybeAccept ( *i, visitor );77 maybeAccept_impl( *i, visitor ); 79 78 } catch( SemanticError &e ) { 80 79 e.set_location( (*i)->location ); … … 92 91 template< typename pass_type > 93 92 static inline void mutateAll( std::list< Declaration* > &decls, PassVisitor< pass_type >& mutator ) { 94 95 93 DeclList_t* beforeDecls = mutator.get_beforeDecls(); 96 94 DeclList_t* afterDecls = mutator.get_afterDecls(); … … 104 102 try { 105 103 // run mutator on declaration 106 *i = maybeMutate( *i, mutator );104 maybeMutate_impl( *i, mutator ); 107 105 } catch( SemanticError &e ) { 108 106 e.set_location( (*i)->location ); … … 118 116 } 119 117 120 template< typename Container, typename VisitorType > 121 inline void maybeAccept( Container &container, VisitorType &visitor ) { 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; 122 129 SemanticError errors; 123 130 for ( typename Container::iterator i = container.begin(); i != container.end(); ++i ) { … … 136 143 } 137 144 138 template< typename Container, typename MutatorType > 139 inline void maybeMutateRef( Container &container, MutatorType &mutator ) { 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; 140 157 SemanticError errors; 141 158 for ( typename Container::iterator i = container.begin(); i != container.end(); ++i ) { 142 159 try { 143 160 if ( *i ) { 144 /// *i = (*i)->acceptMutator( mutator );145 161 *i = dynamic_cast< typename Container::value_type >( (*i)->acceptMutator( mutator ) ); 146 162 assert( *i ); … … 159 175 template< typename func_t > 160 176 void PassVisitor< pass_type >::handleStatementList( std::list< Statement * > & statements, func_t func ) { 177 if ( ! get_visit_children() ) return; 161 178 SemanticError errors; 162 179 … … 199 216 void PassVisitor< pass_type >::visitStatementList( std::list< Statement * > & statements ) { 200 217 handleStatementList( statements, [this]( Statement * stmt) { 201 stmt->accept(*this );218 maybeAccept_impl( stmt, *this ); 202 219 }); 203 220 } … … 206 223 void PassVisitor< pass_type >::mutateStatementList( std::list< Statement * > & statements ) { 207 224 handleStatementList( statements, [this]( Statement *& stmt) { 208 stmt = stmt->acceptMutator(*this );225 maybeMutate_impl( stmt, *this ); 209 226 }); 210 227 } … … 214 231 template< typename func_t > 215 232 Statement * PassVisitor< pass_type >::handleStatement( Statement * stmt, func_t func ) { 233 if ( ! get_visit_children() ) return stmt; 234 216 235 // don't want statements from outer CompoundStmts to be added to this CompoundStmt 217 236 ValueGuardPtr< TypeSubstitution * > oldEnv ( get_env_ptr () ); … … 244 263 Statement * PassVisitor< pass_type >::visitStatement( Statement * stmt ) { 245 264 return handleStatement( stmt, [this]( Statement * stmt ) { 246 maybeAccept ( stmt, *this );265 maybeAccept_impl( stmt, *this ); 247 266 return stmt; 248 267 }); … … 252 271 Statement * PassVisitor< pass_type >::mutateStatement( Statement * stmt ) { 253 272 return handleStatement( stmt, [this]( Statement * stmt ) { 254 return maybeMutate( stmt, *this ); 273 maybeMutate_impl( stmt, *this ); 274 return stmt; 255 275 }); 256 276 } … … 259 279 template< typename func_t > 260 280 Expression * PassVisitor< pass_type >::handleExpression( Expression * expr, func_t func ) { 281 if ( ! get_visit_children() ) return expr; 261 282 if( !expr ) return nullptr; 262 283 … … 266 287 } 267 288 268 // should env be cloned (or moved)onto the result of the mutate?289 // should env be moved onto the result of the mutate? 269 290 return func( expr ); 270 291 } … … 273 294 Expression * PassVisitor< pass_type >::visitExpression( Expression * expr ) { 274 295 return handleExpression(expr, [this]( Expression * expr ) { 275 expr->accept(*this );296 maybeAccept_impl( expr, *this ); 276 297 return expr; 277 298 }); … … 281 302 Expression * PassVisitor< pass_type >::mutateExpression( Expression * expr ) { 282 303 return handleExpression(expr, [this]( Expression * expr ) { 283 return expr->acceptMutator( *this ); 304 maybeMutate_impl( expr, *this ); 305 return expr; 284 306 }); 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 ); 285 327 } 286 328 … … 319 361 320 362 indexerScopedAccept( node->type , *this ); 321 maybeAccept ( node->init , *this ); 322 maybeAccept ( node->bitfieldWidth, *this ); 363 maybeAccept_impl ( node->init , *this ); 364 maybeAccept_impl ( node->bitfieldWidth, *this ); 365 maybeAccept_impl ( node->attributes , *this ); 323 366 324 367 if ( node->name != "" ) { … … 334 377 335 378 indexerScopedMutate( node->type , *this ); 336 maybeMutateRef ( node->init , *this ); 337 maybeMutateRef ( node->bitfieldWidth, *this ); 379 maybeMutate_impl ( node->init , *this ); 380 maybeMutate_impl ( node->bitfieldWidth, *this ); 381 maybeMutate_impl ( node->attributes , *this ); 338 382 339 383 if ( node->name != "" ) { … … 356 400 { 357 401 auto guard = makeFuncGuard( [this]() { indexerScopeEnter(); }, [this]() { indexerScopeLeave(); } ); 358 maybeAccept( node->type, *this ); 359 maybeAccept( node->statements, *this ); 402 maybeAccept_impl( node->type, *this ); 403 maybeAccept_impl( node->statements, *this ); 404 maybeAccept_impl( node->attributes, *this ); 360 405 } 361 406 … … 373 418 { 374 419 auto guard = makeFuncGuard( [this]() { indexerScopeEnter(); }, [this]() { indexerScopeLeave(); } ); 375 maybeMutateRef( node->type, *this ); 376 maybeMutateRef( node->statements, *this ); 420 maybeMutate_impl( node->type, *this ); 421 maybeMutate_impl( node->statements, *this ); 422 maybeMutate_impl( node->attributes, *this ); 377 423 } 378 424 … … 392 438 { 393 439 auto guard = makeFuncGuard( [this]() { indexerScopeEnter(); }, [this]() { indexerScopeLeave(); } ); 394 maybeAccept ( node->parameters, *this );395 maybeAccept ( node->members , *this );440 maybeAccept_impl( node->parameters, *this ); 441 maybeAccept_impl( node->members , *this ); 396 442 } 397 443 … … 412 458 { 413 459 auto guard = makeFuncGuard( [this]() { indexerScopeEnter(); }, [this]() { indexerScopeLeave(); } ); 414 maybeMutate Ref( node->parameters, *this );415 maybeMutate Ref( node->members , *this );460 maybeMutate_impl( node->parameters, *this ); 461 maybeMutate_impl( node->members , *this ); 416 462 } 417 463 … … 433 479 { 434 480 auto guard = makeFuncGuard( [this]() { indexerScopeEnter(); }, [this]() { indexerScopeLeave(); } ); 435 maybeAccept ( node->parameters, *this );436 maybeAccept ( node->members , *this );481 maybeAccept_impl( node->parameters, *this ); 482 maybeAccept_impl( node->members , *this ); 437 483 } 438 484 … … 451 497 { 452 498 auto guard = makeFuncGuard( [this]() { indexerScopeEnter(); }, [this]() { indexerScopeLeave(); } ); 453 maybeMutate Ref( node->parameters, *this );454 maybeMutate Ref( node->members , *this );499 maybeMutate_impl( node->parameters, *this ); 500 maybeMutate_impl( node->members , *this ); 455 501 } 456 502 … … 469 515 470 516 // unlike structs, traits, and unions, enums inject their members into the global scope 471 maybeAccept ( node->parameters, *this );472 maybeAccept ( node->members , *this );517 maybeAccept_impl( node->parameters, *this ); 518 maybeAccept_impl( node->members , *this ); 473 519 474 520 VISIT_END( node ); … … 482 528 483 529 // unlike structs, traits, and unions, enums inject their members into the global scope 484 maybeMutate Ref( node->parameters, *this );485 maybeMutate Ref( node->members , *this );530 maybeMutate_impl( node->parameters, *this ); 531 maybeMutate_impl( node->members , *this ); 486 532 487 533 MUTATE_END( Declaration, node ); … … 496 542 { 497 543 auto guard = makeFuncGuard( [this]() { indexerScopeEnter(); }, [this]() { indexerScopeLeave(); } ); 498 maybeAccept ( node->parameters, *this );499 maybeAccept ( node->members , *this );544 maybeAccept_impl( node->parameters, *this ); 545 maybeAccept_impl( node->members , *this ); 500 546 } 501 547 … … 511 557 { 512 558 auto guard = makeFuncGuard( [this]() { indexerScopeEnter(); }, [this]() { indexerScopeLeave(); } ); 513 maybeMutate Ref( node->parameters, *this );514 maybeMutate Ref( node->members , *this );559 maybeMutate_impl( node->parameters, *this ); 560 maybeMutate_impl( node->members , *this ); 515 561 } 516 562 … … 528 574 { 529 575 auto guard = makeFuncGuard( [this]() { indexerScopeEnter(); }, [this]() { indexerScopeLeave(); } ); 530 maybeAccept ( node->parameters, *this );531 maybeAccept ( node->base , *this );576 maybeAccept_impl( node->parameters, *this ); 577 maybeAccept_impl( node->base , *this ); 532 578 } 533 579 … … 537 583 indexerAddType( node ); 538 584 539 maybeAccept ( node->assertions, *this );585 maybeAccept_impl( node->assertions, *this ); 540 586 541 587 indexerScopedAccept( node->init, *this ); … … 550 596 { 551 597 auto guard = makeFuncGuard( [this]() { indexerScopeEnter(); }, [this]() { indexerScopeLeave(); } ); 552 maybeMutate Ref( node->parameters, *this );553 maybeMutate Ref( node->base , *this );598 maybeMutate_impl( node->parameters, *this ); 599 maybeMutate_impl( node->base , *this ); 554 600 } 555 601 … … 559 605 indexerAddType( node ); 560 606 561 maybeMutate Ref( node->assertions, *this );607 maybeMutate_impl( node->assertions, *this ); 562 608 563 609 indexerScopedMutate( node->init, *this ); … … 574 620 { 575 621 auto guard = makeFuncGuard( [this]() { indexerScopeEnter(); }, [this]() { indexerScopeLeave(); } ); 576 maybeAccept ( node->parameters, *this );577 maybeAccept ( node->base , *this );622 maybeAccept_impl( node->parameters, *this ); 623 maybeAccept_impl( node->base , *this ); 578 624 } 579 625 580 626 indexerAddType( node ); 581 627 582 maybeAccept ( node->assertions, *this );628 maybeAccept_impl( node->assertions, *this ); 583 629 584 630 VISIT_END( node ); … … 591 637 { 592 638 auto guard = makeFuncGuard( [this]() { indexerScopeEnter(); }, [this]() { indexerScopeLeave(); } ); 593 maybeMutate Ref( node->parameters, *this );594 maybeMutate Ref( node->base , *this );639 maybeMutate_impl( node->parameters, *this ); 640 maybeMutate_impl( node->base , *this ); 595 641 } 596 642 597 643 indexerAddType( node ); 598 644 599 maybeMutate Ref( node->assertions, *this );645 maybeMutate_impl( node->assertions, *this ); 600 646 601 647 MUTATE_END( Declaration, node ); … … 608 654 VISIT_START( node ); 609 655 610 maybeAccept ( node->stmt, *this );656 maybeAccept_impl( node->stmt, *this ); 611 657 612 658 VISIT_END( node ); … … 617 663 MUTATE_START( node ); 618 664 619 maybeMutate Ref( node->stmt, *this );665 maybeMutate_impl( node->stmt, *this ); 620 666 621 667 MUTATE_END( AsmDecl, node ); … … 686 732 // if statements introduce a level of scope (for the initialization) 687 733 auto guard = makeFuncGuard( [this]() { indexerScopeEnter(); }, [this]() { indexerScopeLeave(); } ); 688 acceptAll( node->get_initialization(), *this );689 visitExpression ( node->condition );734 maybeAccept_impl( node->get_initialization(), *this ); 735 visitExpression ( node->condition ); 690 736 node->thenPart = visitStatement( node->thenPart ); 691 737 node->elsePart = visitStatement( node->elsePart ); … … 700 746 // if statements introduce a level of scope (for the initialization) 701 747 auto guard = makeFuncGuard( [this]() { indexerScopeEnter(); }, [this]() { indexerScopeLeave(); } ); 702 maybeMutate Ref( node->get_initialization(), *this );748 maybeMutate_impl( node->get_initialization(), *this ); 703 749 node->condition = mutateExpression( node->condition ); 704 750 node->thenPart = mutateStatement ( node->thenPart ); … … 738 784 // for statements introduce a level of scope (for the initialization) 739 785 auto guard = makeFuncGuard( [this]() { indexerScopeEnter(); }, [this]() { indexerScopeLeave(); } ); 740 maybeAccept ( node->initialization, *this );786 maybeAccept_impl( node->initialization, *this ); 741 787 visitExpression( node->condition ); 742 788 visitExpression( node->increment ); … … 752 798 // for statements introduce a level of scope (for the initialization) 753 799 auto guard = makeFuncGuard( [this]() { indexerScopeEnter(); }, [this]() { indexerScopeLeave(); } ); 754 maybeMutate Ref( node->initialization, *this );800 maybeMutate_impl( node->initialization, *this ); 755 801 node->condition = mutateExpression( node->condition ); 756 802 node->increment = mutateExpression( node->increment ); … … 855 901 VISIT_START( node ); 856 902 857 maybeAccept ( node->block , *this );858 maybeAccept ( node->handlers , *this );859 maybeAccept ( node->finallyBlock, *this );903 maybeAccept_impl( node->block , *this ); 904 maybeAccept_impl( node->handlers , *this ); 905 maybeAccept_impl( node->finallyBlock, *this ); 860 906 861 907 VISIT_END( node ); … … 866 912 MUTATE_START( node ); 867 913 868 maybeMutate Ref( node->block , *this );869 maybeMutate Ref( node->handlers , *this );870 maybeMutate Ref( node->finallyBlock, *this );914 maybeMutate_impl( node->block , *this ); 915 maybeMutate_impl( node->handlers , *this ); 916 maybeMutate_impl( node->finallyBlock, *this ); 871 917 872 918 MUTATE_END( Statement, node ); … … 881 927 // catch statements introduce a level of scope (for the caught exception) 882 928 auto guard = makeFuncGuard( [this]() { indexerScopeEnter(); }, [this]() { indexerScopeLeave(); } ); 883 maybeAccept ( node->decl, *this );929 maybeAccept_impl( node->decl, *this ); 884 930 node->cond = visitExpression( node->cond ); 885 931 node->body = visitStatement ( node->body ); … … 894 940 // catch statements introduce a level of scope (for the caught exception) 895 941 auto guard = makeFuncGuard( [this]() { indexerScopeEnter(); }, [this]() { indexerScopeLeave(); } ); 896 maybeMutate Ref( node->decl, *this );942 maybeMutate_impl( node->decl, *this ); 897 943 node->cond = mutateExpression( node->cond ); 898 944 node->body = mutateStatement ( node->body ); … … 968 1014 969 1015 indexerScopedAccept( node->result , *this ); 970 maybeAccept ( node->function, *this );971 maybeAccept ( node->args , *this );1016 maybeAccept_impl ( node->function, *this ); 1017 maybeAccept_impl ( node->args , *this ); 972 1018 973 1019 VISIT_END( node ); … … 980 1026 indexerScopedMutate( node->env , *this ); 981 1027 indexerScopedMutate( node->result , *this ); 982 maybeMutate Ref( node->function, *this );983 maybeMutate Ref( node->args , *this );1028 maybeMutate_impl ( node->function, *this ); 1029 maybeMutate_impl ( node->args , *this ); 984 1030 985 1031 MUTATE_END( Expression, node ); … … 992 1038 VISIT_START( node ); 993 1039 994 // maybeAccept ( node->get_env(), *this );1040 // maybeAccept_impl( node->get_env(), *this ); 995 1041 indexerScopedAccept( node->result, *this ); 996 1042 … … 1044 1090 1045 1091 indexerScopedAccept( node->result, *this ); 1046 maybeAccept ( node->arg , *this );1092 maybeAccept_impl ( node->arg , *this ); 1047 1093 1048 1094 VISIT_END( node ); … … 1055 1101 indexerScopedMutate( node->env , *this ); 1056 1102 indexerScopedMutate( node->result, *this ); 1057 maybeMutate Ref( node->arg , *this );1103 maybeMutate_impl ( node->arg , *this ); 1058 1104 1059 1105 MUTATE_END( Expression, node ); … … 1067 1113 1068 1114 indexerScopedAccept( node->result, *this ); 1069 maybeAccept ( node->arg, *this );1115 maybeAccept_impl( node->arg, *this ); 1070 1116 1071 1117 VISIT_END( node ); … … 1078 1124 indexerScopedMutate( node->env , *this ); 1079 1125 indexerScopedMutate( node->result, *this ); 1080 maybeMutate Ref( node->arg , *this );1126 maybeMutate_impl ( node->arg , *this ); 1081 1127 1082 1128 MUTATE_END( Expression, node ); … … 1090 1136 1091 1137 indexerScopedAccept( node->result, *this ); 1092 maybeAccept 1138 maybeAccept_impl ( node->arg , *this ); 1093 1139 1094 1140 VISIT_END( node ); … … 1101 1147 indexerScopedMutate( node->env , *this ); 1102 1148 indexerScopedMutate( node->result, *this ); 1103 maybeMutate Ref( node->arg , *this );1149 maybeMutate_impl ( node->arg , *this ); 1104 1150 1105 1151 MUTATE_END( Expression, node ); … … 1134 1180 1135 1181 indexerScopedAccept( node->result , *this ); 1136 maybeAccept 1137 maybeAccept 1182 maybeAccept_impl ( node->aggregate, *this ); 1183 maybeAccept_impl ( node->member , *this ); 1138 1184 1139 1185 VISIT_END( node ); … … 1146 1192 indexerScopedMutate( node->env , *this ); 1147 1193 indexerScopedMutate( node->result , *this ); 1148 maybeMutate Ref( node->aggregate, *this );1149 maybeMutate Ref( node->member , *this );1194 maybeMutate_impl ( node->aggregate, *this ); 1195 maybeMutate_impl ( node->member , *this ); 1150 1196 1151 1197 MUTATE_END( Expression, node ); … … 1159 1205 1160 1206 indexerScopedAccept( node->result , *this ); 1161 maybeAccept 1207 maybeAccept_impl ( node->aggregate, *this ); 1162 1208 1163 1209 VISIT_END( node ); … … 1170 1216 indexerScopedMutate( node->env , *this ); 1171 1217 indexerScopedMutate( node->result , *this ); 1172 maybeMutate Ref( node->aggregate, *this );1218 maybeMutate_impl ( node->aggregate, *this ); 1173 1219 1174 1220 MUTATE_END( Expression, node ); … … 1203 1249 1204 1250 indexerScopedAccept( node->result , *this ); 1205 maybeAccept 1251 maybeAccept_impl ( &node->constant, *this ); 1206 1252 1207 1253 VISIT_END( node ); … … 1214 1260 indexerScopedMutate( node->env , *this ); 1215 1261 indexerScopedMutate( node->result, *this ); 1216 node->constant = *maybeMutate( &node->constant, *this ); 1262 Constant * ptr = &node->constant; 1263 maybeMutate_impl( ptr, *this ); 1264 node->constant = *ptr; 1217 1265 1218 1266 MUTATE_END( Expression, node ); … … 1227 1275 indexerScopedAccept( node->result, *this ); 1228 1276 if ( node->get_isType() ) { 1229 maybeAccept ( node->type, *this );1277 maybeAccept_impl( node->type, *this ); 1230 1278 } else { 1231 maybeAccept ( node->expr, *this );1279 maybeAccept_impl( node->expr, *this ); 1232 1280 } 1233 1281 … … 1242 1290 indexerScopedMutate( node->result, *this ); 1243 1291 if ( node->get_isType() ) { 1244 maybeMutate Ref( node->type, *this );1292 maybeMutate_impl( node->type, *this ); 1245 1293 } else { 1246 maybeMutate Ref( node->expr, *this );1294 maybeMutate_impl( node->expr, *this ); 1247 1295 } 1248 1296 … … 1258 1306 indexerScopedAccept( node->result, *this ); 1259 1307 if ( node->get_isType() ) { 1260 maybeAccept ( node->type, *this );1308 maybeAccept_impl( node->type, *this ); 1261 1309 } else { 1262 maybeAccept ( node->expr, *this );1310 maybeAccept_impl( node->expr, *this ); 1263 1311 } 1264 1312 … … 1273 1321 indexerScopedMutate( node->result, *this ); 1274 1322 if ( node->get_isType() ) { 1275 maybeMutate Ref( node->type, *this );1323 maybeMutate_impl( node->type, *this ); 1276 1324 } else { 1277 maybeMutate Ref( node->expr, *this );1325 maybeMutate_impl( node->expr, *this ); 1278 1326 } 1279 1327 … … 1288 1336 1289 1337 indexerScopedAccept( node->result, *this ); 1290 maybeAccept 1338 maybeAccept_impl ( node->type , *this ); 1291 1339 1292 1340 VISIT_END( node ); … … 1299 1347 indexerScopedMutate( node->env , *this ); 1300 1348 indexerScopedMutate( node->result, *this ); 1301 maybeMutate Ref( node->type , *this );1349 maybeMutate_impl ( node->type , *this ); 1302 1350 1303 1351 MUTATE_END( Expression, node ); … … 1311 1359 1312 1360 indexerScopedAccept( node->result, *this ); 1313 maybeAccept 1314 maybeAccept 1361 maybeAccept_impl ( node->type , *this ); 1362 maybeAccept_impl ( node->member, *this ); 1315 1363 1316 1364 VISIT_END( node ); … … 1323 1371 indexerScopedMutate( node->env , *this ); 1324 1372 indexerScopedMutate( node->result, *this ); 1325 maybeMutate Ref( node->type , *this );1326 maybeMutate Ref( node->member, *this );1373 maybeMutate_impl ( node->type , *this ); 1374 maybeMutate_impl ( node->member, *this ); 1327 1375 1328 1376 MUTATE_END( Expression, node ); … … 1336 1384 1337 1385 indexerScopedAccept( node->result, *this ); 1338 maybeAccept 1386 maybeAccept_impl ( node->type , *this ); 1339 1387 1340 1388 VISIT_END( node ); … … 1347 1395 indexerScopedMutate( node->env , *this ); 1348 1396 indexerScopedMutate( node->result, *this ); 1349 maybeMutate Ref( node->type , *this );1397 maybeMutate_impl ( node->type , *this ); 1350 1398 1351 1399 MUTATE_END( Expression, node ); … … 1360 1408 indexerScopedAccept( node->result, *this ); 1361 1409 if ( node->get_isType() ) { 1362 maybeAccept ( node->type, *this );1410 maybeAccept_impl( node->type, *this ); 1363 1411 } else { 1364 maybeAccept ( node->expr, *this );1412 maybeAccept_impl( node->expr, *this ); 1365 1413 } 1366 1414 … … 1375 1423 indexerScopedMutate( node->result, *this ); 1376 1424 if ( node->get_isType() ) { 1377 maybeMutate Ref( node->type, *this );1425 maybeMutate_impl( node->type, *this ); 1378 1426 } else { 1379 maybeMutate Ref( node->expr, *this );1427 maybeMutate_impl( node->expr, *this ); 1380 1428 } 1381 1429 … … 1390 1438 1391 1439 indexerScopedAccept( node->result, *this ); 1392 maybeAccept 1393 maybeAccept 1440 maybeAccept_impl ( node->arg1 , *this ); 1441 maybeAccept_impl ( node->arg2 , *this ); 1394 1442 1395 1443 VISIT_END( node ); … … 1402 1450 indexerScopedMutate( node->env , *this ); 1403 1451 indexerScopedMutate( node->result, *this ); 1404 maybeMutate Ref( node->arg1 , *this );1405 maybeMutate Ref( node->arg2 , *this );1452 maybeMutate_impl ( node->arg1 , *this ); 1453 maybeMutate_impl ( node->arg2 , *this ); 1406 1454 1407 1455 MUTATE_END( Expression, node ); … … 1415 1463 1416 1464 indexerScopedAccept( node->result, *this ); 1417 maybeAccept ( node->arg1 , *this );1418 maybeAccept ( node->arg2 , *this );1419 maybeAccept ( node->arg3 , *this );1465 maybeAccept_impl ( node->arg1 , *this ); 1466 maybeAccept_impl ( node->arg2 , *this ); 1467 maybeAccept_impl ( node->arg3 , *this ); 1420 1468 1421 1469 VISIT_END( node ); … … 1428 1476 indexerScopedMutate( node->env , *this ); 1429 1477 indexerScopedMutate( node->result, *this ); 1430 maybeMutate Ref( node->arg1 , *this );1431 maybeMutate Ref( node->arg2 , *this );1432 maybeMutate Ref( node->arg3 , *this );1478 maybeMutate_impl ( node->arg1 , *this ); 1479 maybeMutate_impl ( node->arg2 , *this ); 1480 maybeMutate_impl ( node->arg3 , *this ); 1433 1481 1434 1482 MUTATE_END( Expression, node ); … … 1442 1490 1443 1491 indexerScopedAccept( node->result, *this ); 1444 maybeAccept 1445 maybeAccept 1492 maybeAccept_impl ( node->arg1 , *this ); 1493 maybeAccept_impl ( node->arg2 , *this ); 1446 1494 1447 1495 VISIT_END( node ); … … 1454 1502 indexerScopedMutate( node->env , *this ); 1455 1503 indexerScopedMutate( node->result, *this ); 1456 maybeMutate Ref( node->arg1 , *this );1457 maybeMutate Ref( node->arg2 , *this );1504 maybeMutate_impl ( node->arg1 , *this ); 1505 maybeMutate_impl ( node->arg2 , *this ); 1458 1506 1459 1507 MUTATE_END( Expression, node ); … … 1467 1515 1468 1516 indexerScopedAccept( node->result, *this ); 1469 maybeAccept 1517 maybeAccept_impl ( node->type, *this ); 1470 1518 1471 1519 VISIT_END( node ); … … 1478 1526 indexerScopedMutate( node->env , *this ); 1479 1527 indexerScopedMutate( node->result, *this ); 1480 maybeMutate Ref( node->type , *this );1528 maybeMutate_impl ( node->type , *this ); 1481 1529 1482 1530 MUTATE_END( Expression, node ); … … 1490 1538 1491 1539 indexerScopedAccept( node->result , *this ); 1492 maybeAccept 1493 maybeAccept 1494 maybeAccept 1540 maybeAccept_impl ( node->inout , *this ); 1541 maybeAccept_impl ( node->constraint, *this ); 1542 maybeAccept_impl ( node->operand , *this ); 1495 1543 1496 1544 VISIT_END( node ); … … 1503 1551 indexerScopedMutate( node->env , *this ); 1504 1552 indexerScopedMutate( node->result , *this ); 1505 maybeMutate Ref( node->inout , *this );1506 maybeMutate Ref( node->constraint, *this );1507 maybeMutate Ref( node->operand , *this );1553 maybeMutate_impl ( node->inout , *this ); 1554 maybeMutate_impl ( node->constraint, *this ); 1555 maybeMutate_impl ( node->operand , *this ); 1508 1556 1509 1557 MUTATE_END( Expression, node ); … … 1517 1565 1518 1566 indexerScopedAccept( node->result , *this ); 1519 maybeAccept 1520 maybeAccept 1521 maybeAccept 1522 maybeAccept 1567 maybeAccept_impl ( node->callExpr , *this ); 1568 maybeAccept_impl ( node->tempDecls , *this ); 1569 maybeAccept_impl ( node->returnDecls, *this ); 1570 maybeAccept_impl ( node->dtors , *this ); 1523 1571 1524 1572 VISIT_END( node ); … … 1531 1579 indexerScopedMutate( node->env , *this ); 1532 1580 indexerScopedMutate( node->result , *this ); 1533 maybeMutate Ref( node->callExpr , *this );1534 maybeMutate Ref( node->tempDecls , *this );1535 maybeMutate Ref( node->returnDecls, *this );1536 maybeMutate Ref( node->dtors , *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 ); 1537 1585 1538 1586 MUTATE_END( Expression, node ); … … 1546 1594 1547 1595 indexerScopedAccept( node->result , *this ); 1548 maybeAccept 1596 maybeAccept_impl ( node->callExpr, *this ); 1549 1597 1550 1598 VISIT_END( node ); … … 1557 1605 indexerScopedMutate( node->env , *this ); 1558 1606 indexerScopedMutate( node->result , *this ); 1559 maybeMutate Ref( node->callExpr, *this );1607 maybeMutate_impl ( node->callExpr, *this ); 1560 1608 1561 1609 MUTATE_END( Expression, node ); … … 1569 1617 1570 1618 indexerScopedAccept( node->result , *this ); 1571 maybeAccept 1619 maybeAccept_impl ( node->initializer, *this ); 1572 1620 1573 1621 VISIT_END( node ); … … 1580 1628 indexerScopedMutate( node->env , *this ); 1581 1629 indexerScopedMutate( node->result , *this ); 1582 maybeMutate Ref( node->initializer, *this );1630 maybeMutate_impl ( node->initializer, *this ); 1583 1631 1584 1632 MUTATE_END( Expression, node ); … … 1592 1640 1593 1641 indexerScopedAccept( node->result, *this ); 1594 maybeAccept 1595 maybeAccept 1642 maybeAccept_impl ( node->low , *this ); 1643 maybeAccept_impl ( node->high , *this ); 1596 1644 1597 1645 VISIT_END( node ); … … 1604 1652 indexerScopedMutate( node->env , *this ); 1605 1653 indexerScopedMutate( node->result, *this ); 1606 maybeMutate Ref( node->low , *this );1607 maybeMutate Ref( node->high , *this );1654 maybeMutate_impl ( node->low , *this ); 1655 maybeMutate_impl ( node->high , *this ); 1608 1656 1609 1657 MUTATE_END( Expression, node ); … … 1617 1665 1618 1666 indexerScopedAccept( node->result, *this ); 1619 maybeAccept 1667 maybeAccept_impl ( node->exprs , *this ); 1620 1668 1621 1669 VISIT_END( node ); … … 1628 1676 indexerScopedMutate( node->env , *this ); 1629 1677 indexerScopedMutate( node->result, *this ); 1630 maybeMutate Ref( node->exprs , *this );1678 maybeMutate_impl ( node->exprs , *this ); 1631 1679 1632 1680 MUTATE_END( Expression, node ); … … 1640 1688 1641 1689 indexerScopedAccept( node->result, *this ); 1642 maybeAccept 1690 maybeAccept_impl ( node->exprs , *this ); 1643 1691 1644 1692 VISIT_END( node ); … … 1651 1699 indexerScopedMutate( node->env , *this ); 1652 1700 indexerScopedMutate( node->result, *this ); 1653 maybeMutate Ref( node->exprs , *this );1701 maybeMutate_impl ( node->exprs , *this ); 1654 1702 1655 1703 MUTATE_END( Expression, node ); … … 1663 1711 1664 1712 indexerScopedAccept( node->result, *this ); 1665 maybeAccept 1713 maybeAccept_impl ( node->tuple , *this ); 1666 1714 1667 1715 VISIT_END( node ); … … 1674 1722 indexerScopedMutate( node->env , *this ); 1675 1723 indexerScopedMutate( node->result, *this ); 1676 maybeMutate Ref( node->tuple , *this );1724 maybeMutate_impl ( node->tuple , *this ); 1677 1725 1678 1726 MUTATE_END( Expression, node ); … … 1686 1734 1687 1735 indexerScopedAccept( node->result , *this ); 1688 maybeAccept 1736 maybeAccept_impl ( node->stmtExpr, *this ); 1689 1737 1690 1738 VISIT_END( node ); … … 1697 1745 indexerScopedMutate( node->env , *this ); 1698 1746 indexerScopedMutate( node->result , *this ); 1699 maybeMutate Ref( node->stmtExpr, *this );1747 maybeMutate_impl ( node->stmtExpr, *this ); 1700 1748 1701 1749 MUTATE_END( Expression, node ); … … 1714 1762 1715 1763 indexerScopedAccept( node->result , *this ); 1716 maybeAccept 1717 maybeAccept 1718 maybeAccept 1764 maybeAccept_impl ( node->statements , *this ); 1765 maybeAccept_impl ( node->returnDecls, *this ); 1766 maybeAccept_impl ( node->dtors , *this ); 1719 1767 1720 1768 VISIT_END( node ); … … 1731 1779 1732 1780 indexerScopedMutate( node->result , *this ); 1733 maybeMutate Ref( node->statements , *this );1734 maybeMutate Ref( node->returnDecls, *this );1735 maybeMutate Ref( node->dtors , *this );1781 maybeMutate_impl ( node->statements , *this ); 1782 maybeMutate_impl ( node->returnDecls, *this ); 1783 maybeMutate_impl ( node->dtors , *this ); 1736 1784 1737 1785 MUTATE_END( Expression, node ); … … 1745 1793 1746 1794 indexerScopedAccept( node->result, *this ); 1747 maybeAccept 1795 maybeAccept_impl ( node->expr , *this ); 1748 1796 1749 1797 VISIT_END( node ); … … 1756 1804 indexerScopedMutate( node->env , *this ); 1757 1805 indexerScopedMutate( node->result, *this ); 1758 maybeMutate Ref( node->expr , *this );1806 maybeMutate_impl ( node->expr , *this ); 1759 1807 1760 1808 MUTATE_END( Expression, node ); … … 1801 1849 { 1802 1850 auto guard = makeFuncGuard( [this]() { indexerScopeEnter(); }, [this]() { indexerScopeLeave(); } ); 1803 maybeAccept ( node->forall , *this );1804 maybeAccept ( node->parameters, *this );1851 maybeAccept_impl( node->forall , *this ); 1852 maybeAccept_impl( node->parameters, *this ); 1805 1853 } 1806 1854 … … 1816 1864 { 1817 1865 auto guard = makeFuncGuard( [this]() { indexerScopeEnter(); }, [this]() { indexerScopeLeave(); } ); 1818 maybeMutate Ref( node->forall , *this );1819 maybeMutate Ref( node->parameters, *this );1866 maybeMutate_impl( node->forall , *this ); 1867 maybeMutate_impl( node->parameters, *this ); 1820 1868 } 1821 1869 … … 1833 1881 { 1834 1882 auto guard = makeFuncGuard( [this]() { indexerScopeEnter(); }, [this]() { indexerScopeLeave(); } ); 1835 maybeAccept ( node->forall , *this );1836 maybeAccept ( node->parameters, *this );1883 maybeAccept_impl( node->forall , *this ); 1884 maybeAccept_impl( node->parameters, *this ); 1837 1885 } 1838 1886 … … 1848 1896 { 1849 1897 auto guard = makeFuncGuard( [this]() { indexerScopeEnter(); }, [this]() { indexerScopeLeave(); } ); 1850 maybeMutate Ref( node->forall , *this );1851 maybeMutate Ref( node->parameters, *this );1898 maybeMutate_impl( node->forall , *this ); 1899 maybeMutate_impl( node->parameters, *this ); 1852 1900 } 1853 1901 … … 1873 1921 VISIT_START( node ); 1874 1922 1875 maybeAccept ( node->forall , *this );1876 maybeAccept ( node->parameters, *this );1923 maybeAccept_impl( node->forall , *this ); 1924 maybeAccept_impl( node->parameters, *this ); 1877 1925 1878 1926 VISIT_END( node ); … … 1883 1931 MUTATE_START( node ); 1884 1932 1885 maybeMutate Ref( node->forall , *this );1886 maybeMutate Ref( node->parameters, *this );1933 maybeMutate_impl( node->forall , *this ); 1934 maybeMutate_impl( node->parameters, *this ); 1887 1935 1888 1936 MUTATE_END( Type, node ); … … 1930 1978 VISIT_START( node ); 1931 1979 1932 maybeAccept ( node->get_designators(), *this );1980 maybeAccept_impl( node->get_designators(), *this ); 1933 1981 1934 1982 VISIT_END( node ); … … 1939 1987 MUTATE_START( node ); 1940 1988 1941 maybeMutate Ref( node->get_designators(), *this );1989 maybeMutate_impl( node->get_designators(), *this ); 1942 1990 1943 1991 MUTATE_END( Designation, node ); … … 1981 2029 template< typename pass_type > 1982 2030 void 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 ) { 1983 2036 VISIT_BODY( node ); 1984 2037 } … … 2069 2122 MUTATE_BODY( Constant, node ); 2070 2123 } 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
r78315272 r3f7e12cb 46 46 ~bool_ref() = default; 47 47 48 operator bool() { return *m_ref; }48 operator bool() { return m_ref ? *m_ref : true; } 49 49 bool operator=( bool val ) { return *m_ref = val; } 50 50 51 51 private: 52 52 53 template<typename pass> 54 friend class PassVisitor; 55 56 void set( bool & val ) { m_ref = &val; }; 57 58 bool * m_ref; 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; 59 62 }; 60 63 61 template< typename TreeType, typename VisitorType > 62 inline 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 70 template< typename TreeType, typename MutatorType > 71 inline 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 79 template< typename TreeType, typename MutatorType > 80 inline void maybeMutateRef( TreeType *& tree, MutatorType & mutator ) { 81 tree = maybeMutate( tree, mutator );82 } 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 }; 83 86 84 87 //------------------------------------------------------------------------------------------------------------------------------------------------------------------------- -
src/Common/utility.h
r78315272 r3f7e12cb 18 18 #include <cctype> 19 19 #include <algorithm> 20 #include <functional> 20 21 #include <iostream> 21 22 #include <iterator> … … 27 28 28 29 #include <cassert> 30 31 #include "Common/Indenter.h" 29 32 30 33 template< typename T > … … 75 78 76 79 template< typename Container > 77 void printAll( const Container &container, std::ostream &os, int indent = 0) {80 void printAll( const Container &container, std::ostream &os, Indenter indent = {} ) { 78 81 for ( typename Container::const_iterator i = container.begin(); i != container.end(); ++i ) { 79 82 if ( *i ) { 80 os << std::string( indent, ' ' );81 (*i)->print( os, indent + 2);83 os << indent; 84 (*i)->print( os, indent ); 82 85 // need an endl after each element because it's not easy to know when each individual item should end 83 86 os << std::endl; … … 351 354 template< typename T1, typename T2 > 352 355 struct group_iterate_t { 356 private: 357 std::tuple<T1, T2> args; 358 public: 353 359 group_iterate_t( bool skipBoundsCheck, const T1 & v1, const T2 & v2 ) : args(v1, v2) { 354 360 assertf(skipBoundsCheck || v1.size() == v2.size(), "group iteration requires containers of the same size: <%zd, %zd>.", v1.size(), v2.size()); 355 361 }; 356 362 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 357 367 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;363 368 typedef std::tuple<T1Iter, T2Iter> IterTuple; 364 369 IterTuple it; … … 370 375 value_type operator*() const { return std::tie( *std::get<0>(it), *std::get<1>(it) ); } 371 376 }; 377 372 378 iterator begin() { return iterator( std::get<0>(args).begin(), std::get<1>(args).begin() ); } 373 379 iterator end() { return iterator( std::get<0>(args).end(), std::get<1>(args).end() ); } 374 375 private:376 std::tuple<T1, T2> args;377 380 }; 378 381 -
src/Concurrency/Keywords.cc
r78315272 r3f7e12cb 196 196 std::list<DeclarationWithType*> findMutexArgs( FunctionDecl* ); 197 197 void validate( DeclarationWithType * ); 198 void addDtorStatments( FunctionDecl* func, CompoundStmt *, const std::list<DeclarationWithType * > &); 198 199 void addStatments( FunctionDecl* func, CompoundStmt *, const std::list<DeclarationWithType * > &); 199 200 … … 206 207 StructDecl* monitor_decl = nullptr; 207 208 StructDecl* guard_decl = nullptr; 209 StructDecl* dtor_guard_decl = nullptr; 208 210 209 211 static std::unique_ptr< Type > generic_func; … … 229 231 230 232 void postvisit( FunctionDecl * decl ); 233 void previsit ( StructDecl * decl ); 231 234 232 235 void addStartStatement( FunctionDecl * decl, DeclarationWithType * param ); … … 236 239 acceptAll( translationUnit, impl ); 237 240 } 241 242 private : 243 bool thread_ctor_seen = false; 244 StructDecl * thread_decl = nullptr; 238 245 }; 239 246 … … 403 410 if( mutexArgs.empty() ) return; 404 411 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 405 418 for(auto arg : mutexArgs) { 406 419 validate( arg ); … … 412 425 if( !monitor_decl ) throw SemanticError( "mutex keyword requires monitors to be in scope, add #include <monitor>", decl ); 413 426 if( !guard_decl ) throw SemanticError( "mutex keyword requires monitors to be in scope, add #include <monitor>", decl ); 414 415 addStatments( decl, body, mutexArgs ); 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 } 416 435 } 417 436 … … 425 444 assert( !guard_decl ); 426 445 guard_decl = decl; 446 } 447 else if( decl->name == "monitor_dtor_guard_t" ) { 448 assert( !dtor_guard_decl ); 449 dtor_guard_decl = decl; 427 450 } 428 451 } … … 457 480 //Make sure that typed isn't mutex 458 481 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) ); 459 533 } 460 534 … … 523 597 // General entry routine 524 598 //============================================================================================= 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 525 606 void ThreadStarter::postvisit(FunctionDecl * decl) { 526 607 if( ! CodeGen::isConstructor(decl->name) ) return; 527 608 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 528 615 DeclarationWithType * param = decl->get_functionType()->get_parameters().front(); 529 616 auto type = dynamic_cast< StructInstType * >( InitTweak::getPointerBase( param->get_type() ) ); 530 // if( type ) std::cerr << "FRED2" << std::endl;531 617 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 532 622 addStartStatement( decl, param ); 533 623 } -
src/Concurrency/Waitfor.cc
r78315272 r3f7e12cb 27 27 #include "InitTweak/InitTweak.h" // for getPointerBase 28 28 #include "Parser/LinkageSpec.h" // for Cforall 29 #include " SymTab/AddVisit.h" // for acceptAndAdd29 #include "ResolvExpr/Resolver.h" // for findVoidExpression 30 30 #include "SynTree/Constant.h" // for Constant 31 31 #include "SynTree/Declaration.h" // for StructDecl, FunctionDecl, ObjectDecl … … 112 112 //============================================================================================= 113 113 114 class GenerateWaitForPass final : public With StmtsToAdd{114 class GenerateWaitForPass final : public WithIndexer { 115 115 public: 116 116 … … 126 126 127 127 ObjectDecl * declare( unsigned long count, CompoundStmt * stmt ); 128 ObjectDecl * declareFlag( CompoundStmt * stmt ); 129 Statement * makeSetter( ObjectDecl * flag ); 128 130 ObjectDecl * declMon( WaitForStmt::Clause & clause, 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();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 ); 133 135 134 136 static void implement( std::list< Declaration * > & translationUnit ) { … … 140 142 private: 141 143 FunctionDecl * decl_waitfor = nullptr; 144 StructDecl * decl_mask = nullptr; 142 145 StructDecl * decl_acceptable = nullptr; 143 146 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;148 147 149 148 static std::unique_ptr< Type > generic_func; 150 149 150 UniqueName namer_acc = "__acceptables_"s; 151 UniqueName namer_idx = "__index_"s; 152 UniqueName namer_flg = "__do_run_"s; 153 UniqueName namer_msk = "__mask_"s; 151 154 UniqueName namer_mon = "__monitors_"s; 152 UniqueName namer_acc = "__acceptables_"s;153 155 UniqueName namer_tim = "__timeout_"s; 154 156 }; … … 167 169 namespace { 168 170 Expression * makeOpIndex( DeclarationWithType * array, unsigned long index ) { 169 return new ApplicationExpr(171 return new UntypedExpr( 170 172 new NameExpr( "?[?]" ), 171 173 { … … 177 179 178 180 Expression * makeOpAssign( Expression * lhs, Expression * rhs ) { 179 return new ApplicationExpr(181 return new UntypedExpr( 180 182 new NameExpr( "?=?" ), 181 183 { lhs, rhs } … … 183 185 } 184 186 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 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 199 197 ), 200 value 201 ) 198 member 199 ), 200 value 202 201 ); 202 203 ResolvExpr::findVoidExpression( expr, indexer ); 204 205 return new ExprStmt( noLabels, expr ); 203 206 } 204 207 … … 208 211 return new ConstantExpr( Constant::from_bool( ifnull ) ); 209 212 } 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 } 210 228 }; 211 229 … … 216 234 217 235 void GenerateWaitForPass::premutate( FunctionDecl * decl) { 218 if( decl->name != "__ accept_internal" ) return;236 if( decl->name != "__waitfor_internal" ) return; 219 237 220 238 decl_waitfor = decl; … … 227 245 assert( !decl_acceptable ); 228 246 decl_acceptable = 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 247 } 248 else if( decl->name == "__waitfor_mask_t" ) { 249 assert( !decl_mask ); 250 decl_mask = decl; 236 251 } 237 252 else if( decl->name == "monitor_desc" ) { … … 242 257 243 258 Statement * GenerateWaitForPass::postmutate( WaitForStmt * 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 ); 259 if( !decl_monitor || !decl_acceptable || !decl_mask ) throw SemanticError( "waitfor keyword requires monitors to be in scope, add #include <monitor>", waitfor ); 247 260 248 261 CompoundStmt * stmt = new CompoundStmt( noLabels ); 249 262 250 263 ObjectDecl * acceptables = declare( waitfor->clauses.size(), stmt ); 264 ObjectDecl * flag = declareFlag( stmt ); 265 Statement * setter = makeSetter( flag ); 251 266 252 267 int index = 0; 253 268 for( auto & clause : waitfor->clauses ) { 254 init( acceptables, index, clause, s tmt );269 init( acceptables, index, clause, setter, stmt ); 255 270 256 271 index++; … … 262 277 waitfor->orelse .statement, 263 278 waitfor->orelse .condition, 279 setter, 264 280 stmt 265 281 ); 266 282 267 // Expression * result = call( acceptables, timeout, orelse, stmt ); 268 269 // choose( waitfor, result ); 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 ); 270 294 271 295 return stmt; … … 274 298 ObjectDecl * GenerateWaitForPass::declare( unsigned long count, CompoundStmt * stmt ) 275 299 { 276 ObjectDecl * acceptables = new ObjectDecl(300 ObjectDecl * acceptables = ObjectDecl::newObject( 277 301 namer_acc.newName(), 278 noStorage,279 LinkageSpec::Cforall,280 nullptr,281 302 new ArrayType( 282 303 noQualifiers, … … 294 315 stmt->push_back( new DeclStmt( noLabels, acceptables) ); 295 316 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 296 330 return acceptables; 297 331 } 298 332 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 299 362 ObjectDecl * GenerateWaitForPass::declMon( WaitForStmt::Clause & clause, CompoundStmt * stmt ) { 300 363 301 ObjectDecl * mon = new ObjectDecl(364 ObjectDecl * mon = ObjectDecl::newObject( 302 365 namer_mon.newName(), 303 noStorage,304 LinkageSpec::Cforall,305 nullptr,306 366 new ArrayType( 307 367 noQualifiers, 308 new StructInstType(368 new PointerType( 309 369 noQualifiers, 310 decl_monitor 370 new StructInstType( 371 noQualifiers, 372 decl_monitor 373 ) 311 374 ), 312 375 new ConstantExpr( Constant::from_ulong( clause.target.arguments.size() ) ), … … 316 379 new ListInit( 317 380 map_range < std::list<Initializer*> > ( clause.target.arguments, [this](Expression * expr ){ 318 return new SingleInit( 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 ); 319 397 }) 320 398 ) … … 326 404 } 327 405 328 void GenerateWaitForPass::init( ObjectDecl * acceptables, int index, WaitForStmt::Clause & clause, CompoundStmt * stmt ) {406 void GenerateWaitForPass::init( ObjectDecl * acceptables, int index, WaitForStmt::Clause & clause, Statement * setter, CompoundStmt * stmt ) { 329 407 330 408 ObjectDecl * monitors = declMon( clause, stmt ); 331 409 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 ) ) ) ); 410 Type * fptr_t = new PointerType( noQualifiers, new FunctionType( noQualifiers, true ) ); 337 411 338 412 stmt->push_back( new IfStmt( 339 413 noLabels, 340 414 safeCond( clause.condition ), 341 compound, 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 }), 342 422 nullptr 343 423 )); … … 353 433 bool has_else, 354 434 Expression *& else_cond, 435 Statement * setter, 355 436 CompoundStmt * stmt 356 437 ) { 357 ObjectDecl * timeout = new ObjectDecl(438 ObjectDecl * timeout = ObjectDecl::newObject( 358 439 namer_tim.newName(), 359 noStorage,360 LinkageSpec::Cforall,361 nullptr,362 440 new BasicType( 363 441 noQualifiers, … … 374 452 stmt->push_back( new IfStmt( 375 453 noLabels, 376 safeCond( else_cond ), 377 new ExprStmt( 378 noLabels, 379 makeOpAssign( 380 new VariableExpr( timeout ), 381 time 382 ) 383 ), 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 }), 384 465 nullptr 385 466 )); … … 392 473 noLabels, 393 474 safeCond( else_cond ), 394 new ExprStmt( 395 noLabels, 396 makeOpAssign( 397 new VariableExpr( timeout ), 398 new ConstantExpr( Constant::from_ulong( 0 ) ) 399 ) 400 ), 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 }), 401 485 nullptr 402 486 )); … … 405 489 } 406 490 491 delete setter; 492 407 493 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 ); 408 617 } 409 618 }; -
src/GenPoly/Box.cc
r78315272 r3f7e12cb 32 32 #include "Common/UniqueName.h" // for UniqueName 33 33 #include "Common/utility.h" // for toString 34 #include "DeclMutator.h" // for DeclMutator35 34 #include "FindFunction.h" // for findFunction, findAndReplace... 36 35 #include "GenPoly/ErasableScopedMap.h" // for ErasableScopedMap<>::const_i... … … 39 38 #include "Lvalue.h" // for generalizedLvalue 40 39 #include "Parser/LinkageSpec.h" // for C, Spec, Cforall, Intrinsic 41 #include "PolyMutator.h" // for PolyMutator42 40 #include "ResolvExpr/TypeEnvironment.h" // for EqvClass 43 41 #include "ResolvExpr/typeops.h" // for typesCompatible … … 62 60 FunctionType *makeAdapterType( FunctionType *adaptee, const TyVarMap &tyVars ); 63 61 62 class BoxPass { 63 protected: 64 BoxPass() : scopeTyVars( TypeDecl::Data{} ) {} 65 TyVarMap scopeTyVars; 66 }; 67 64 68 /// Adds layout-generation functions to polymorphic types 65 class LayoutFunctionBuilder final : public DeclMutator{66 unsigned int functionNesting ; // current level of nested functions69 class LayoutFunctionBuilder final : public WithDeclsToAdd, public WithVisitorRef<LayoutFunctionBuilder>, public WithShortCircuiting { 70 unsigned int functionNesting = 0; // current level of nested functions 67 71 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; 72 void previsit( FunctionDecl *functionDecl ); 73 void previsit( StructDecl *structDecl ); 74 void previsit( UnionDecl *unionDecl ); 74 75 }; 75 76 76 77 /// 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 77 class Pass1 final : public PolyMutator{78 class Pass1 final : public BoxPass, public WithTypeSubstitution, public WithStmtsToAdd, public WithGuards, public WithVisitorRef<Pass1>, public WithShortCircuiting { 78 79 public: 79 80 Pass1(); 80 81 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; 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(); 95 95 private: 96 96 /// Pass the extra type parameters from polymorphic generic arguments or return types into a function application … … 129 129 /// * Moves polymorphic returns in function types to pointer-type parameters 130 130 /// * adds type size and assertion parameters to parameter lists 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; 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 ); 149 141 150 142 private: … … 158 150 /// * Calculates polymorphic offsetof expressions from offset array 159 151 /// * Inserts dynamic calculation of polymorphic type layouts where needed 160 class PolyGenericCalculator final : public WithGuards, public WithVisitorRef<PolyGenericCalculator>, public WithStmtsToAdd, public WithDeclsToAdd, public WithTypeSubstitution {152 class PolyGenericCalculator final : public BoxPass, public WithGuards, public WithVisitorRef<PolyGenericCalculator>, public WithStmtsToAdd, public WithDeclsToAdd, public WithTypeSubstitution { 161 153 public: 162 154 PolyGenericCalculator(); … … 197 189 ScopedSet< std::string > knownOffsets; ///< Set of non-generic types for which the offset array exists in the current scope, indexed by offsetofName 198 190 UniqueName bufNamer; ///< Namer for VLA buffers 199 TyVarMap scopeTyVars;200 191 }; 201 192 202 193 /// 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. 203 class Pass3 final : public PolyMutator { 204 public: 194 struct Pass3 final : public BoxPass, public WithGuards { 205 195 template< typename DeclClass > 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: 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 ); 218 206 }; 219 207 } // anonymous namespace … … 247 235 248 236 void box( std::list< Declaration *>& translationUnit ) { 249 LayoutFunctionBuilderlayoutBuilder;250 Pass 1pass1;251 Pass 2pass2;237 PassVisitor<LayoutFunctionBuilder> layoutBuilder; 238 PassVisitor<Pass1> pass1; 239 PassVisitor<Pass2> pass2; 252 240 PassVisitor<PolyGenericCalculator> polyCalculator; 253 Pass 3pass3;254 255 layoutBuilder.mutateDeclarationList( translationUnit);256 mutate TranslationUnit/*All*/( translationUnit, pass1 );257 mutate TranslationUnit/*All*/( translationUnit, pass2 );241 PassVisitor<Pass3> pass3; 242 243 acceptAll( translationUnit, layoutBuilder ); 244 mutateAll( translationUnit, pass1 ); 245 mutateAll( translationUnit, pass2 ); 258 246 mutateAll( translationUnit, polyCalculator ); 259 mutate TranslationUnit/*All*/( translationUnit, pass3 );247 mutateAll( translationUnit, pass3 ); 260 248 } 261 249 262 250 ////////////////////////////////// LayoutFunctionBuilder //////////////////////////////////////////// 263 251 264 DeclarationWithType *LayoutFunctionBuilder::mutate( FunctionDecl *functionDecl ) { 265 functionDecl->set_functionType( maybeMutate( functionDecl->get_functionType(), *this ) ); 252 void LayoutFunctionBuilder::previsit( FunctionDecl *functionDecl ) { 253 visit_children = false; 254 maybeAccept( functionDecl->get_functionType(), *visitor ); 266 255 ++functionNesting; 267 functionDecl->set_statements( maybeMutate( functionDecl->get_statements(), *this ));256 maybeAccept( functionDecl->get_statements(), *visitor ); 268 257 --functionNesting; 269 return functionDecl;270 258 } 271 259 … … 356 344 } 357 345 358 Declaration *LayoutFunctionBuilder::mutate( StructDecl *structDecl ) {346 void LayoutFunctionBuilder::previsit( StructDecl *structDecl ) { 359 347 // do not generate layout function for "empty" tag structs 360 if ( structDecl->get_members().empty() ) return structDecl; 348 visit_children = false; 349 if ( structDecl->get_members().empty() ) return; 361 350 362 351 // get parameters that can change layout, exiting early if none 363 352 std::list< TypeDecl* > otypeParams = takeOtypeOnly( structDecl->get_parameters() ); 364 if ( otypeParams.empty() ) return structDecl;353 if ( otypeParams.empty() ) return; 365 354 366 355 // build layout function signature … … 413 402 addStmt( layoutDecl->get_statements(), makeAlignTo( derefVar( sizeParam ), derefVar( alignParam ) ) ); 414 403 415 addDeclarationAfter( layoutDecl ); 416 return structDecl; 404 declsToAddAfter.push_back( layoutDecl ); 417 405 } 418 406 419 Declaration *LayoutFunctionBuilder::mutate( UnionDecl *unionDecl ) {407 void LayoutFunctionBuilder::previsit( UnionDecl *unionDecl ) { 420 408 // do not generate layout function for "empty" tag unions 421 if ( unionDecl->get_members().empty() ) return unionDecl; 409 visit_children = false; 410 if ( unionDecl->get_members().empty() ) return; 422 411 423 412 // get parameters that can change layout, exiting early if none 424 413 std::list< TypeDecl* > otypeParams = takeOtypeOnly( unionDecl->get_parameters() ); 425 if ( otypeParams.empty() ) return unionDecl;414 if ( otypeParams.empty() ) return; 426 415 427 416 // build layout function signature … … 456 445 addStmt( layoutDecl->get_statements(), makeAlignTo( derefVar( sizeParam ), derefVar( alignParam ) ) ); 457 446 458 addDeclarationAfter( layoutDecl ); 459 return unionDecl; 447 declsToAddAfter.push_back( layoutDecl ); 460 448 } 461 449 … … 501 489 Pass1::Pass1() : tempNamer( "_temp" ) {} 502 490 503 DeclarationWithType *Pass1::mutate( FunctionDecl *functionDecl ) {491 void Pass1::premutate( FunctionDecl *functionDecl ) { 504 492 if ( functionDecl->get_statements() ) { // empty routine body ? 505 493 // std::cerr << "mutating function: " << functionDecl->get_mangleName() << std::endl; 506 doBeginScope(); 507 scopeTyVars.beginScope(); 508 509 DeclarationWithType *oldRetval = retval; 494 GuardScope( scopeTyVars ); 495 GuardValue( retval ); 510 496 511 497 // process polymorphic return value 512 498 retval = nullptr; 513 if ( isDynRet( functionDecl->get_functionType() ) && functionDecl->get_linkage() != LinkageSpec::C ) { 514 retval = functionDecl->get_functionType()->get_returnVals().front(); 499 FunctionType *functionType = functionDecl->type; 500 if ( isDynRet( functionType ) && functionDecl->linkage != LinkageSpec::C ) { 501 retval = functionType->returnVals.front(); 515 502 516 503 // give names to unnamed return values 517 if ( retval-> get_name()== "" ) {518 retval-> set_name( "_retparm" );519 retval-> set_linkage( LinkageSpec::C );504 if ( retval->name == "" ) { 505 retval->name = "_retparm"; 506 retval->linkage = LinkageSpec::C; 520 507 } // if 521 508 } // if 522 509 523 FunctionType *functionType = functionDecl->get_functionType(); 524 makeTyVarMap( functionDecl->get_functionType(), scopeTyVars ); 525 526 std::list< DeclarationWithType *> ¶mList = functionType->get_parameters(); 510 makeTyVarMap( functionType, scopeTyVars ); 511 512 std::list< DeclarationWithType *> ¶mList = functionType->parameters; 527 513 std::list< FunctionType *> functions; 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 ) {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 ) { 530 516 findFunction( (*assert)->get_type(), functions, scopeTyVars, needsAdapter ); 531 517 } // for … … 542 528 } // if 543 529 } // for 544 545 functionDecl->set_statements( functionDecl->get_statements()->acceptMutator( *this ) );546 547 scopeTyVars.endScope();548 retval = oldRetval;549 doEndScope();550 530 // std::cerr << "end function: " << functionDecl->get_mangleName() << std::endl; 551 531 } // if 552 return functionDecl; 553 } 554 555 TypeDecl *Pass1::mutate( TypeDecl *typeDecl ) { 532 } 533 534 void Pass1::premutate( TypeDecl *typeDecl ) { 556 535 addToTyVarMap( typeDecl, scopeTyVars ); 557 return dynamic_cast<TypeDecl*>( Mutator::mutate( typeDecl ) ); 558 } 559 560 Expression *Pass1::mutate( CommaExpr *commaExpr ) { 536 } 537 538 void Pass1::premutate( CommaExpr *commaExpr ) { 561 539 // Attempting to find application expressions that were mutated by the copy constructor passes 562 540 // to use an explicit return variable, so that the variable can be reused as a parameter to the … … 574 552 } 575 553 } 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 588 554 } 589 555 … … 634 600 635 601 // add size/align for generic types to parameter list 636 if ( ! appExpr->get_function()-> has_result()) return;602 if ( ! appExpr->get_function()->result ) return; 637 603 FunctionType *funcType = getFunctionType( appExpr->get_function()->get_result() ); 638 604 assert( funcType ); … … 659 625 ObjectDecl *Pass1::makeTemporary( Type *type ) { 660 626 ObjectDecl *newObj = new ObjectDecl( tempNamer.newName(), Type::StorageClasses(), LinkageSpec::C, 0, type, 0 ); 661 stmtsToAdd .push_back( new DeclStmt( noLabels, newObj ) );627 stmtsToAddBefore.push_back( new DeclStmt( noLabels, newObj ) ); 662 628 return newObj; 663 629 } … … 748 714 749 715 void Pass1::boxParam( Type *param, Expression *&arg, const TyVarMap &exprTyVars ) { 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(); 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(); 753 735 if ( env ) env->apply( newType ); 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 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 ) ); 784 744 } // 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; 785 765 } 786 766 … … 789 769 /// this gets rid of warnings from gcc. 790 770 void addCast( Expression *&actual, Type *formal, const TyVarMap &tyVars ) { 791 if ( getFunctionType( formal ) ) { 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 ) ) { 792 774 Type * newType = formal->clone(); 793 775 newType = ScrubTyVars::scrub( newType, tyVars ); … … 797 779 798 780 void Pass1::boxParams( ApplicationExpr *appExpr, FunctionType *function, std::list< Expression *>::iterator &arg, const TyVarMap &exprTyVars ) { 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() );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() ); 801 783 addCast( *arg, (*param)->get_type(), exprTyVars ); 802 784 boxParam( (*param)->get_type(), *arg, exprTyVars ); … … 807 789 std::list< Expression *>::iterator cur = arg; 808 790 for ( Type::ForallList::iterator tyVar = functionType->get_forall().begin(); tyVar != functionType->get_forall().end(); ++tyVar ) { 809 for ( std::list< DeclarationWithType *>::iterator assert = (*tyVar)-> get_assertions().begin(); assert != (*tyVar)->get_assertions().end(); ++assert ) {791 for ( std::list< DeclarationWithType *>::iterator assert = (*tyVar)->assertions.begin(); assert != (*tyVar)->assertions.end(); ++assert ) { 810 792 InferredParams::const_iterator inferParam = appExpr->get_inferParams().find( (*assert)->get_uniqueId() ); 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" ); 793 assertf( inferParam != appExpr->get_inferParams().end(), "addInferredParams missing inferred parameter: %s in: %s", toString( *assert ).c_str(), toString( appExpr ).c_str() ); 815 794 Expression *newExpr = inferParam->second.expr->clone(); 816 795 addCast( newExpr, (*assert)->get_type(), tyVars ); … … 822 801 823 802 void makeRetParm( FunctionType *funcType ) { 824 DeclarationWithType *retParm = funcType-> get_returnVals().front();803 DeclarationWithType *retParm = funcType->returnVals.front(); 825 804 826 805 // make a new parameter that is a pointer to the type of the old return value … … 835 814 // actually make the adapter type 836 815 FunctionType *adapter = adaptee->clone(); 837 // if ( ! adapter->get_returnVals().empty() && isPolyType( adapter->get_returnVals().front()->get_type(), tyVars ) ) {838 816 if ( isDynRet( adapter, tyVars ) ) { 839 817 makeRetParm( adapter ); … … 961 939 std::pair< AdapterIter, bool > answer = adapters.insert( std::pair< std::string, DeclarationWithType *>( mangleName, newAdapter ) ); 962 940 adapter = answer.first; 963 stmtsToAdd .push_back( new DeclStmt( noLabels, newAdapter ) );941 stmtsToAddBefore.push_back( new DeclStmt( noLabels, newAdapter ) ); 964 942 } // if 965 943 assert( adapter != adapters.end() ); … … 999 977 if ( varExpr->get_var()->get_linkage() == LinkageSpec::Intrinsic ) { 1000 978 if ( varExpr->get_var()->get_name() == "?[?]" ) { 1001 assert( appExpr-> has_result());979 assert( appExpr->result ); 1002 980 assert( appExpr->get_args().size() == 2 ); 1003 981 Type *baseType1 = isPolyPtr( appExpr->get_args().front()->get_result(), scopeTyVars, env ); … … 1033 1011 } // if 1034 1012 } else if ( varExpr->get_var()->get_name() == "*?" ) { 1035 assert( appExpr-> has_result());1013 assert( appExpr->result ); 1036 1014 assert( ! appExpr->get_args().empty() ); 1037 1015 if ( isPolyType( appExpr->get_result(), scopeTyVars, env ) ) { … … 1050 1028 } // if 1051 1029 } else if ( varExpr->get_var()->get_name() == "?++" || varExpr->get_var()->get_name() == "?--" ) { 1052 assert( appExpr-> has_result());1030 assert( appExpr->result ); 1053 1031 assert( appExpr->get_args().size() == 1 ); 1054 1032 if ( Type *baseType = isPolyPtr( appExpr->get_result(), scopeTyVars, env ) ) { … … 1070 1048 } // if 1071 1049 } else if ( varExpr->get_var()->get_name() == "++?" || varExpr->get_var()->get_name() == "--?" ) { 1072 assert( appExpr-> has_result());1050 assert( appExpr->result ); 1073 1051 assert( appExpr->get_args().size() == 1 ); 1074 1052 if ( Type *baseType = isPolyPtr( appExpr->get_result(), scopeTyVars, env ) ) { … … 1076 1054 } // if 1077 1055 } else if ( varExpr->get_var()->get_name() == "?+?" || varExpr->get_var()->get_name() == "?-?" ) { 1078 assert( appExpr-> has_result());1056 assert( appExpr->result ); 1079 1057 assert( appExpr->get_args().size() == 2 ); 1080 1058 Type *baseType1 = isPolyPtr( appExpr->get_args().front()->get_result(), scopeTyVars, env ); … … 1102 1080 } // if 1103 1081 } else if ( varExpr->get_var()->get_name() == "?+=?" || varExpr->get_var()->get_name() == "?-=?" ) { 1104 assert( appExpr-> has_result());1082 assert( appExpr->result ); 1105 1083 assert( appExpr->get_args().size() == 2 ); 1106 1084 Type *baseType = isPolyPtr( appExpr->get_result(), scopeTyVars, env ); … … 1118 1096 } 1119 1097 1120 Expression *Pass1:: mutate( ApplicationExpr *appExpr ) {1098 Expression *Pass1::postmutate( ApplicationExpr *appExpr ) { 1121 1099 // std::cerr << "mutate appExpr: " << InitTweak::getFunctionName( appExpr ) << std::endl; 1122 1100 // for ( TyVarMap::iterator i = scopeTyVars.begin(); i != scopeTyVars.end(); ++i ) { … … 1124 1102 // } 1125 1103 // std::cerr << "\n"; 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() ); 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() ); 1132 1108 1133 1109 if ( Expression *newExpr = handleIntrinsics( appExpr ) ) { … … 1182 1158 } 1183 1159 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()) ) {1160 Expression * Pass1::postmutate( UntypedExpr *expr ) { 1161 if ( expr->result && isPolyType( expr->result, scopeTyVars, env ) ) { 1162 if ( NameExpr *name = dynamic_cast< NameExpr *>( expr->function ) ) { 1187 1163 if ( name->get_name() == "*?" ) { 1188 Expression *ret = expr-> get_args().front();1189 expr-> get_args().clear();1164 Expression *ret = expr->args.front(); 1165 expr->args.clear(); 1190 1166 delete expr; 1191 return ret ->acceptMutator( *this );1167 return ret; 1192 1168 } // if 1193 1169 } // if 1194 1170 } // if 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() ); 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() ); 1200 1177 1201 1178 bool needs = false; 1202 1179 if ( UntypedExpr *expr = dynamic_cast< UntypedExpr *>( addrExpr->get_arg() ) ) { 1203 if ( expr-> has_result()&& isPolyType( expr->get_result(), scopeTyVars, env ) ) {1180 if ( expr->result && isPolyType( expr->get_result(), scopeTyVars, env ) ) { 1204 1181 if ( NameExpr *name = dynamic_cast< NameExpr *>( expr->get_function() ) ) { 1205 1182 if ( name->get_name() == "*?" ) { 1206 1183 if ( ApplicationExpr * appExpr = dynamic_cast< ApplicationExpr * >( expr->get_args().front() ) ) { 1207 assert( appExpr->get_function()-> has_result());1184 assert( appExpr->get_function()->result ); 1208 1185 FunctionType *function = getFunctionType( appExpr->get_function()->get_result() ); 1209 1186 assert( function ); … … 1216 1193 // isPolyType check needs to happen before mutating addrExpr arg, so pull it forward 1217 1194 // out of the if condition. 1218 addrExpr-> set_arg( mutateExpression( addrExpr->get_arg() ));1195 addrExpr->arg = addrExpr->get_arg()->acceptMutator( *visitor ); 1219 1196 // ... but must happen after mutate, since argument might change (e.g. intrinsic *?, ?[?]) - re-evaluate above comment 1220 1197 bool polytype = isPolyType( addrExpr->get_arg()->get_result(), scopeTyVars, env ); … … 1231 1208 } 1232 1209 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() ) ); 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; 1240 1215 } // if 1241 return returnStmt; 1242 } 1243 1244 Type * Pass1::mutate( PointerType *pointerType ) { 1245 scopeTyVars.beginScope(); 1216 } 1217 1218 void Pass1::premutate( PointerType *pointerType ) { 1219 GuardScope( scopeTyVars ); 1246 1220 makeTyVarMap( pointerType, 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(); 1221 } 1222 1223 void Pass1::premutate( FunctionType *functionType ) { 1224 GuardScope( scopeTyVars ); 1256 1225 makeTyVarMap( functionType, scopeTyVars ); 1257 1258 Type *ret = Mutator::mutate( functionType ); 1259 1260 scopeTyVars.endScope(); 1261 return ret; 1262 } 1263 1264 void Pass1::doBeginScope() { 1226 } 1227 1228 void Pass1::beginScope() { 1265 1229 adapters.beginScope(); 1266 1230 } 1267 1231 1268 void Pass1:: doEndScope() {1232 void Pass1::endScope() { 1269 1233 adapters.endScope(); 1270 1234 } … … 1293 1257 } 1294 1258 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 ) ); 1259 DeclarationWithType * Pass2::postmutate( FunctionDecl *functionDecl ) { 1304 1260 FunctionType * ftype = functionDecl->get_functionType(); 1305 1261 if ( ! ftype->get_returnVals().empty() && functionDecl->get_statements() ) { … … 1325 1281 } 1326 1282 1327 ObjectDecl * Pass2::mutate( ObjectDecl *objectDecl ) { 1328 return handleDecl( objectDecl ); 1329 } 1330 1331 template< typename AggDecl > 1332 AggDecl * Pass2::handleAggDecl( AggDecl * aggDecl ) { 1283 void Pass2::premutate( StructDecl * ) { 1333 1284 // prevent tyVars from leaking into containing scope 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 ) { 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 ) { 1353 1299 addToTyVarMap( typeDecl, 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(); 1300 } 1301 1302 void Pass2::premutate( PointerType *pointerType ) { 1303 GuardScope( scopeTyVars ); 1367 1304 makeTyVarMap( pointerType, 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 1305 } 1306 1307 void Pass2::premutate( FunctionType *funcType ) { 1308 GuardScope( scopeTyVars ); 1378 1309 makeTyVarMap( funcType, scopeTyVars ); 1379 1310 … … 1414 1345 // move all assertions into parameter list 1415 1346 for ( std::list< DeclarationWithType *>::iterator assert = (*tyParm)->get_assertions().begin(); assert != (*tyParm)->get_assertions().end(); ++assert ) { 1416 // *assert = (*assert)->acceptMutator( *this );1417 1347 // assertion parameters may not be used in body, pass along with unused attribute. 1418 1348 (*assert)->get_attributes().push_back( new Attribute( "unused" ) ); … … 1450 1380 } 1451 1381 } 1452 1453 1382 seenTypes.insert( typeName ); 1454 1383 } … … 1458 1387 funcType->get_parameters().splice( last, inferredParams ); 1459 1388 addAdapters( funcType ); 1460 mutateAll( funcType->get_returnVals(), *this );1461 mutateAll( funcType->get_parameters(), *this );1462 1463 scopeTyVars.endScope();1464 return funcType;1465 1389 } 1466 1390 … … 1468 1392 1469 1393 PolyGenericCalculator::PolyGenericCalculator() 1470 : knownLayouts(), knownOffsets(), bufNamer( "_buf" ) , scopeTyVars( TypeDecl::Data{} ){}1394 : knownLayouts(), knownOffsets(), bufNamer( "_buf" ) {} 1471 1395 1472 1396 void PolyGenericCalculator::beginTypeScope( Type *ty ) { … … 1829 1753 1830 1754 template< typename DeclClass > 1831 DeclClass * Pass3::handleDecl( DeclClass *decl, Type *type ) {1832 scopeTyVars.beginScope();1755 void Pass3::handleDecl( DeclClass * decl, Type * type ) { 1756 GuardScope( scopeTyVars ); 1833 1757 makeTyVarMap( type, scopeTyVars ); 1834 1835 DeclClass *ret = static_cast< DeclClass *>( Mutator::mutate( decl ) );1836 // ScrubTyVars::scrub( decl, scopeTyVars );1837 1758 ScrubTyVars::scrubAll( decl ); 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() ); 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 ); 1853 1771 } 1854 1772 1855 1773 /// Strips the members from a generic aggregate 1856 void stripGenericMembers(AggregateDecl * decl) {1857 if ( ! decl-> get_parameters().empty() ) decl->get_members().clear();1858 } 1859 1860 Declaration *Pass3::mutate( StructDecl *structDecl ) {1774 void stripGenericMembers(AggregateDecl * decl) { 1775 if ( ! decl->parameters.empty() ) decl->members.clear(); 1776 } 1777 1778 void Pass3::premutate( StructDecl * structDecl ) { 1861 1779 stripGenericMembers( structDecl ); 1862 return structDecl; 1863 } 1864 1865 Declaration *Pass3::mutate( UnionDecl *unionDecl ) { 1780 } 1781 1782 void Pass3::premutate( UnionDecl * unionDecl ) { 1866 1783 stripGenericMembers( unionDecl ); 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 1784 } 1785 1786 void Pass3::premutate( TypeDecl * typeDecl ) { 1879 1787 addToTyVarMap( typeDecl, scopeTyVars ); 1880 return dynamic_cast<TypeDecl*>( Mutator::mutate( typeDecl ) ); 1881 } 1882 1883 Type * Pass3::mutate( PointerType *pointerType ) { 1884 scopeTyVars.beginScope(); 1788 } 1789 1790 void Pass3::premutate( PointerType * pointerType ) { 1791 GuardScope( scopeTyVars ); 1885 1792 makeTyVarMap( pointerType, 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(); 1793 } 1794 1795 void Pass3::premutate( FunctionType * functionType ) { 1796 GuardScope( scopeTyVars ); 1895 1797 makeTyVarMap( functionType, scopeTyVars ); 1896 1897 Type *ret = Mutator::mutate( functionType );1898 1899 scopeTyVars.endScope();1900 return ret;1901 1798 } 1902 1799 } // anonymous namespace -
src/GenPoly/FindFunction.cc
r78315272 r3f7e12cb 18 18 #include <utility> // for pair 19 19 20 #include "Common/PassVisitor.h" // for PassVisitor 20 21 #include "Common/SemanticError.h" // for SemanticError 21 22 #include "GenPoly/ErasableScopedMap.h" // for ErasableScopedMap<>::iterator … … 27 28 28 29 namespace GenPoly { 29 class FindFunction : public Mutator{30 class FindFunction : public WithGuards, public WithVisitorRef<FindFunction>, public WithShortCircuiting { 30 31 public: 31 32 FindFunction( std::list< FunctionType* > &functions, const TyVarMap &tyVars, bool replaceMode, FindFunctionPredicate predicate ); 32 33 33 virtual Type *mutate( FunctionType *functionType ); 34 virtual Type *mutate( PointerType *pointerType ); 34 void premutate( FunctionType * functionType ); 35 Type * postmutate( FunctionType * functionType ); 36 void premutate( PointerType * pointerType ); 35 37 private: 36 38 void handleForall( const Type::ForallList &forall ); … … 43 45 44 46 void findFunction( Type *type, std::list< FunctionType* > &functions, const TyVarMap &tyVars, FindFunctionPredicate predicate ) { 45 FindFunctionfinder( functions, tyVars, false, predicate );47 PassVisitor<FindFunction> finder( functions, tyVars, false, predicate ); 46 48 type->acceptMutator( finder ); 47 49 } 48 50 49 51 void findAndReplaceFunction( Type *&type, std::list< FunctionType* > &functions, const TyVarMap &tyVars, FindFunctionPredicate predicate ) { 50 FindFunctionfinder( functions, tyVars, true, predicate );52 PassVisitor<FindFunction> finder( functions, tyVars, true, predicate ); 51 53 type = type->acceptMutator( finder ); 52 54 } … … 57 59 58 60 void FindFunction::handleForall( const Type::ForallList &forall ) { 59 for ( Type::ForallList::const_iterator i = forall.begin(); i != forall.end(); ++i) {60 TyVarMap::iterator var = tyVars.find( (*i)->get_name());61 for ( const Declaration * td : forall ) { 62 TyVarMap::iterator var = tyVars.find( td->name ); 61 63 if ( var != tyVars.end() ) { 62 64 tyVars.erase( var->first ); … … 65 67 } 66 68 67 Type * FindFunction::mutate( FunctionType *functionType ) { 68 tyVars.beginScope(); 69 void FindFunction::premutate( FunctionType * functionType ) { 70 visit_children = false; 71 GuardScope( tyVars ); 69 72 handleForall( functionType->get_forall() ); 70 mutateAll( functionType->get_returnVals(), *this ); 73 mutateAll( functionType->get_returnVals(), *visitor ); 74 } 75 76 Type * FindFunction::postmutate( FunctionType * functionType ) { 71 77 Type *ret = functionType; 72 78 if ( predicate( functionType, tyVars ) ) { … … 77 83 } // if 78 84 } // if 79 tyVars.endScope();80 85 return ret; 81 86 } 82 87 83 Type * FindFunction::mutate( PointerType *pointerType ) {84 tyVars.beginScope();88 void FindFunction::premutate( PointerType * pointerType ) { 89 GuardScope( tyVars ); 85 90 handleForall( pointerType->get_forall() ); 86 Type *ret = Mutator::mutate( pointerType );87 tyVars.endScope();88 return ret;89 91 } 90 92 } // namespace GenPoly -
src/GenPoly/GenPoly.cc
r78315272 r3f7e12cb 432 432 } 433 433 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 434 452 void addToTyVarMap( TypeDecl * tyVar, TyVarMap &tyVarMap ) { 435 453 // xxx - should this actually be insert? -
src/GenPoly/GenPoly.h
r78315272 r3f7e12cb 80 80 bool typesPolyCompatible( Type *aty, Type *bty ); 81 81 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 82 88 /// Adds the type variable `tyVar` to `tyVarMap` 83 89 void addToTyVarMap( TypeDecl * tyVar, TyVarMap &tyVarMap ); -
src/GenPoly/InstantiateGeneric.cc
r78315272 r3f7e12cb 238 238 assertf( false, "Ttype parameters are not currently allowed as parameters to generic types." ); 239 239 break; 240 case TypeDecl::Any:241 assertf( false, " otype parameters handled by baseParam->isComplete()." );240 default: 241 assertf( false, "Unhandled type parameter kind" ); 242 242 break; 243 243 } … … 278 278 substituteMembers( base->get_members(), baseParams, typeSubs ); 279 279 280 deleteAll( baseParams ); 280 // xxx - can't delete type parameters because they may have assertions that are used 281 // deleteAll( baseParams ); 281 282 baseParams.clear(); 282 283 -
src/GenPoly/ScrubTyVars.cc
r78315272 r3f7e12cb 40 40 if ( tyVar != tyVars->end() ) { 41 41 switch ( tyVar->second.kind ) { 42 case TypeDecl::Any:43 42 case TypeDecl::Dtype: 44 43 case TypeDecl::Ttype: -
src/GenPoly/Specialize.cc
r78315272 r3f7e12cb 22 22 #include <utility> // for pair 23 23 24 #include "Common/PassVisitor.h" 24 25 #include "Common/SemanticError.h" // for SemanticError 25 26 #include "Common/UniqueName.h" // for UniqueName … … 28 29 #include "InitTweak/InitTweak.h" // for isIntrinsicCallExpr 29 30 #include "Parser/LinkageSpec.h" // for C 30 #include "PolyMutator.h" // for PolyMutator31 31 #include "ResolvExpr/FindOpenVars.h" // for findOpenVars 32 32 #include "ResolvExpr/TypeEnvironment.h" // for OpenVarSet, AssertionSet … … 43 43 44 44 namespace GenPoly { 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 ); 45 struct Specialize final : public WithTypeSubstitution, public WithStmtsToAdd, public WithVisitorRef<Specialize> { 46 Expression * postmutate( ApplicationExpr *applicationExpr ); 47 Expression * postmutate( CastExpr *castExpr ); 54 48 55 49 void handleExplicitParams( ApplicationExpr *appExpr ); 56 50 Expression * createThunkFunction( FunctionType *funType, Expression *actual, InferredParams *inferParams ); 57 Expression * doSpecialization( Type *formalType, Expression *actual, InferredParams *inferParams = nullptr);51 Expression * doSpecialization( Type *formalType, Expression *actual, InferredParams *inferParams ); 58 52 59 53 std::string paramPrefix = "_p"; … … 72 66 if ( ! boundType ) continue; 73 67 if ( TypeInstType *typeInst = dynamic_cast< TypeInstType* >( boundType ) ) { 68 // bound to another type variable 74 69 if ( closedVars.find( typeInst->get_name() ) == closedVars.end() ) { 70 // bound to a closed variable => must specialize 75 71 return true; 76 72 } // if 77 73 } else { 74 // variable is bound to a concrete type => must specialize 78 75 return true; 79 76 } // if 80 77 } // for 78 // none of the type variables are bound 81 79 return false; 82 80 } else { 81 // no env 83 82 return false; 84 83 } // if … … 136 135 if ( functionParameterSize( fftype ) != functionParameterSize( aftype ) ) return false; 137 136 // tuple-parameter sizes are the same, but actual parameter sizes differ - must tuple specialize 138 if ( fftype-> get_parameters().size() != aftype->get_parameters().size() ) return true;137 if ( fftype->parameters.size() != aftype->parameters.size() ) return true; 139 138 // total parameter size can be the same, while individual parameters can have different structure 140 for ( auto params : group_iterate( fftype-> get_parameters(), aftype->get_parameters()) ) {139 for ( auto params : group_iterate( fftype->parameters, aftype->parameters ) ) { 141 140 DeclarationWithType * formal = std::get<0>(params); 142 141 DeclarationWithType * actual = std::get<1>(params); … … 152 151 153 152 Expression * Specialize::doSpecialization( Type *formalType, Expression *actual, InferredParams *inferParams ) { 154 assertf( actual-> has_result(), "attempting to specialize an untyped expression" );153 assertf( actual->result, "attempting to specialize an untyped expression" ); 155 154 if ( needsSpecialization( formalType, actual->get_result(), env ) ) { 156 155 if ( FunctionType *funType = getFunctionType( formalType ) ) { 157 ApplicationExpr *appExpr; 158 VariableExpr *varExpr; 159 if ( ( appExpr = dynamic_cast<ApplicationExpr*>( actual ) ) ) { 156 if ( ApplicationExpr * appExpr = dynamic_cast<ApplicationExpr*>( actual ) ) { 160 157 return createThunkFunction( funType, appExpr->get_function(), inferParams ); 161 } else if ( ( varExpr = dynamic_cast<VariableExpr*>( actual )) ) {158 } else if ( VariableExpr * varExpr = dynamic_cast<VariableExpr*>( actual ) ) { 162 159 return createThunkFunction( funType, varExpr, inferParams ); 163 160 } else { … … 204 201 } 205 202 206 struct EnvTrimmer : public Visitor{203 struct EnvTrimmer { 207 204 TypeSubstitution * env, * newEnv; 208 205 EnvTrimmer( TypeSubstitution * env, TypeSubstitution * newEnv ) : env( env ), newEnv( newEnv ){} 209 v irtual voidvisit( TypeDecl * tyDecl ) {206 void previsit( TypeDecl * tyDecl ) { 210 207 // transfer known bindings for seen type variables 211 if ( Type * t = env->lookup( tyDecl-> get_name()) ) {212 newEnv->add( tyDecl-> get_name(), t );208 if ( Type * t = env->lookup( tyDecl->name ) ) { 209 newEnv->add( tyDecl->name, t ); 213 210 } 214 211 } … … 219 216 if ( env ) { 220 217 TypeSubstitution * newEnv = new TypeSubstitution(); 221 EnvTrimmertrimmer( env, newEnv );218 PassVisitor<EnvTrimmer> trimmer( env, newEnv ); 222 219 expr->accept( trimmer ); 223 220 return newEnv; … … 277 274 std::string oldParamPrefix = paramPrefix; 278 275 paramPrefix += "p"; 279 // save stmtsToAdd in oldStmts276 // save stmtsToAddBefore in oldStmts 280 277 std::list< Statement* > oldStmts; 281 oldStmts.splice( oldStmts.end(), stmtsToAdd );282 mutate( appExpr );278 oldStmts.splice( oldStmts.end(), stmtsToAddBefore ); 279 appExpr->acceptMutator( *visitor ); 283 280 paramPrefix = oldParamPrefix; 284 281 // write any statements added for recursive specializations into the thunk body 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 );282 thunkFunc->statements->kids.splice( thunkFunc->statements->kids.end(), stmtsToAddBefore ); 283 // restore oldStmts into stmtsToAddBefore 284 stmtsToAddBefore.splice( stmtsToAddBefore.end(), oldStmts ); 288 285 289 286 // add return (or valueless expression) to the thunk 290 287 Statement *appStmt; 291 if ( funType-> get_returnVals().empty() ) {288 if ( funType->returnVals.empty() ) { 292 289 appStmt = new ExprStmt( noLabels, appExpr ); 293 290 } else { 294 291 appStmt = new ReturnStmt( noLabels, appExpr ); 295 292 } // if 296 thunkFunc-> get_statements()->get_kids().push_back( appStmt );293 thunkFunc->statements->kids.push_back( appStmt ); 297 294 298 295 // add thunk definition to queue of statements to add 299 stmtsToAdd .push_back( new DeclStmt( noLabels, thunkFunc ) );296 stmtsToAddBefore.push_back( new DeclStmt( noLabels, thunkFunc ) ); 300 297 // return address of thunk function as replacement expression 301 298 return new AddressExpr( new VariableExpr( thunkFunc ) ); … … 304 301 void Specialize::handleExplicitParams( ApplicationExpr *appExpr ) { 305 302 // create thunks for the explicit parameters 306 assert( appExpr-> get_function()->has_result());307 FunctionType *function = getFunctionType( appExpr-> get_function()->get_result());303 assert( appExpr->function->result ); 304 FunctionType *function = getFunctionType( appExpr->function->result ); 308 305 assert( function ); 309 306 std::list< DeclarationWithType* >::iterator formal; 310 307 std::list< Expression* >::iterator actual; 311 308 for ( formal = function->get_parameters().begin(), actual = appExpr->get_args().begin(); formal != function->get_parameters().end() && actual != appExpr->get_args().end(); ++formal, ++actual ) { 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 309 *actual = doSpecialization( (*formal)->get_type(), *actual, &appExpr->get_inferParams() ); 310 } 311 } 312 313 Expression * Specialize::postmutate( ApplicationExpr *appExpr ) { 320 314 if ( ! InitTweak::isIntrinsicCallExpr( appExpr ) ) { 321 315 // create thunks for the inferred parameters … … 331 325 } 332 326 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() ) { 327 Expression * Specialize::postmutate( CastExpr *castExpr ) { 328 if ( castExpr->result->isVoid() ) { 343 329 // can't specialize if we don't have a return value 344 330 return castExpr; 345 331 } 346 Expression *specialized = doSpecialization( castExpr-> get_result(), castExpr->get_arg());347 if ( specialized != castExpr-> get_arg()) {332 Expression *specialized = doSpecialization( castExpr->result, castExpr->arg, &castExpr->inferParams ); 333 if ( specialized != castExpr->arg ) { 348 334 // assume here that the specialization incorporates the cast 349 335 return specialized; … … 353 339 } 354 340 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 parts357 // 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 371 341 void convertSpecializations( std::list< Declaration* >& translationUnit ) { 372 Specializespec;342 PassVisitor<Specialize> spec; 373 343 mutateAll( translationUnit, spec ); 374 344 } -
src/GenPoly/module.mk
r78315272 r3f7e12cb 6 6 ## file "LICENCE" distributed with Cforall. 7 7 ## 8 ## module.mk -- 8 ## module.mk -- 9 9 ## 10 10 ## Author : Richard C. Bilson … … 17 17 SRC += GenPoly/Box.cc \ 18 18 GenPoly/GenPoly.cc \ 19 GenPoly/PolyMutator.cc \20 19 GenPoly/ScrubTyVars.cc \ 21 20 GenPoly/Lvalue.cc \ 22 21 GenPoly/Specialize.cc \ 23 GenPoly/CopyParams.cc \24 22 GenPoly/FindFunction.cc \ 25 GenPoly/DeclMutator.cc \26 23 GenPoly/InstantiateGeneric.cc -
src/InitTweak/FixInit.cc
r78315272 r3f7e12cb 36 36 #include "FixGlobalInit.h" // for fixGlobalInit 37 37 #include "GenInit.h" // for genCtorDtor 38 #include "GenPoly/DeclMutator.h" // for DeclMutator39 38 #include "GenPoly/GenPoly.h" // for getFunctionType 40 #include "GenPoly/PolyMutator.h" // for PolyMutator41 39 #include "InitTweak.h" // for getFunctionName, getCallArg 42 40 #include "Parser/LinkageSpec.h" // for C, Spec, Cforall, isBuiltin … … 46 44 #include "SymTab/Indexer.h" // for Indexer 47 45 #include "SymTab/Mangler.h" // for Mangler 48 #include "SynTree/AddStmtVisitor.h" // for AddStmtVisitor49 46 #include "SynTree/Attribute.h" // for Attribute 50 47 #include "SynTree/Constant.h" // for Constant … … 58 55 #include "SynTree/TypeSubstitution.h" // for TypeSubstitution, operator<< 59 56 #include "SynTree/Visitor.h" // for acceptAll, maybeAccept 60 #include "Tuples/Tuples.h" // for isTtype61 57 62 58 bool ctordtorp = false; // print all debug … … 97 93 /// true if type does not need to be copy constructed to ensure correctness 98 94 bool skipCopyConstruct( Type * type ); 99 void copyConstructArg( Expression *& arg, ImplicitCopyCtorExpr * impCpCtorExpr );95 void copyConstructArg( Expression *& arg, ImplicitCopyCtorExpr * impCpCtorExpr, Type * formal ); 100 96 void destructRet( ObjectDecl * ret, ImplicitCopyCtorExpr * impCpCtorExpr ); 101 97 … … 187 183 }; 188 184 189 class FixCopyCtors final : public GenPoly::PolyMutator{185 class FixCopyCtors final : public WithStmtsToAdd, public WithShortCircuiting, public WithVisitorRef<FixCopyCtors> { 190 186 public: 191 187 FixCopyCtors( UnqCount & unqCount ) : unqCount( unqCount ){} … … 194 190 static void fixCopyCtors( std::list< Declaration * > &translationUnit, UnqCount & unqCount ); 195 191 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; 192 Expression * postmutate( ImplicitCopyCtorExpr * impCpCtorExpr ); 193 void premutate( StmtExpr * stmtExpr ); 194 void premutate( UniqueExpr * unqExpr ); 201 195 202 196 UnqCount & unqCount; … … 220 214 void emit( CodeLocation, const Params &... params ); 221 215 222 FunctionDecl * function = 0;216 FunctionDecl * function = nullptr; 223 217 std::set< DeclarationWithType * > unhandled; 224 218 std::map< DeclarationWithType *, CodeLocation > usedUninit; 225 ObjectDecl * thisParam = 0;219 ObjectDecl * thisParam = nullptr; 226 220 bool isCtor = false; // true if current function is a constructor 227 StructDecl * structDecl = 0;221 StructDecl * structDecl = nullptr; 228 222 }; 229 223 … … 243 237 }; 244 238 245 class FixCtorExprs final : public GenPoly::DeclMutator { 246 public: 239 struct FixCtorExprs final : public WithDeclsToAdd, public WithIndexer { 247 240 /// expands ConstructorExpr nodes into comma expressions, using a temporary for the first argument 248 241 static void fix( std::list< Declaration * > & translationUnit ); 249 242 250 using GenPoly::DeclMutator::mutate; 251 virtual Expression * mutate( ConstructorExpr * ctorExpr ) override; 243 Expression * postmutate( ConstructorExpr * ctorExpr ); 252 244 }; 253 245 } // namespace … … 268 260 269 261 GenStructMemberCalls::generate( translationUnit ); 262 270 263 // xxx - ctor expansion currently has to be after FixCopyCtors, because there is currently a 271 264 // hack in the way untyped assignments are generated, where the first argument cannot have … … 297 290 for ( std::list< Declaration * >::iterator i = translationUnit.begin(); i != translationUnit.end(); ++i ) { 298 291 try { 299 *i =maybeMutate( *i, fixer );292 maybeMutate( *i, fixer ); 300 293 translationUnit.splice( i, fixer.pass.staticDtorDecls ); 301 294 } catch( SemanticError &e ) { … … 316 309 317 310 void FixCopyCtors::fixCopyCtors( std::list< Declaration * > & translationUnit, UnqCount & unqCount ) { 318 FixCopyCtorsfixer( unqCount );311 PassVisitor<FixCopyCtors> fixer( unqCount ); 319 312 mutateAll( translationUnit, fixer ); 320 313 } … … 326 319 327 320 void FixCtorExprs::fix( std::list< Declaration * > & translationUnit ) { 328 FixCtorExprsfixer;329 fixer.mutateDeclarationList( translationUnit);321 PassVisitor<FixCtorExprs> fixer; 322 mutateAll( translationUnit, fixer ); 330 323 } 331 324 332 325 Expression * InsertImplicitCalls::postmutate( ApplicationExpr * appExpr ) { 333 assert( appExpr );334 335 326 if ( VariableExpr * function = dynamic_cast< VariableExpr * > ( appExpr->get_function() ) ) { 336 if ( LinkageSpec::isBuiltin( function->get_var()->get_linkage() )) {327 if ( function->var->linkage.is_builtin ) { 337 328 // optimization: don't need to copy construct in order to call intrinsic functions 338 329 return appExpr; 339 330 } else if ( DeclarationWithType * funcDecl = dynamic_cast< DeclarationWithType * > ( function->get_var() ) ) { 340 331 FunctionType * ftype = dynamic_cast< FunctionType * >( GenPoly::getFunctionType( funcDecl->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();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(); 345 336 assert( t1 ); 346 337 … … 368 359 } 369 360 370 bool ResolveCopyCtors::skipCopyConstruct( Type * type ) { 371 return dynamic_cast< VarArgsType * >( type ) || dynamic_cast< ReferenceType * >( type ) || GenPoly::getFunctionType( type ) || Tuples::isTtype( type ); 372 } 361 bool ResolveCopyCtors::skipCopyConstruct( Type * type ) { return ! isConstructable( type ); } 373 362 374 363 Expression * ResolveCopyCtors::makeCtorDtor( const std::string & fname, ObjectDecl * var, Expression * cpArg ) { … … 377 366 ImplicitCtorDtorStmt * stmt = genCtorDtor( fname, var, cpArg ); 378 367 ExprStmt * exprStmt = strict_dynamic_cast< ExprStmt * >( stmt->get_callStmt() ); 379 Expression * untyped = exprStmt->get_expr(); 368 Expression * resolved = exprStmt->expr; 369 exprStmt->expr = nullptr; // take ownership of expr 380 370 381 371 // resolve copy constructor 382 372 // should only be one alternative for copy ctor and dtor expressions, since all arguments are fixed 383 373 // (VariableExpr and already resolved expression) 384 CP_CTOR_PRINT( std::cerr << "ResolvingCtorDtor " << untyped << std::endl; )385 Expression * resolved = ResolvExpr::findVoidExpression( untyped, indexer );374 CP_CTOR_PRINT( std::cerr << "ResolvingCtorDtor " << resolved << std::endl; ) 375 ResolvExpr::findVoidExpression( resolved, indexer ); 386 376 assert( resolved ); 387 377 if ( resolved->get_env() ) { … … 391 381 resolved->set_env( nullptr ); 392 382 } // if 393 394 383 delete stmt; 395 384 return resolved; 396 385 } 397 386 398 void ResolveCopyCtors::copyConstructArg( Expression *& arg, ImplicitCopyCtorExpr * impCpCtorExpr ) {387 void ResolveCopyCtors::copyConstructArg( Expression *& arg, ImplicitCopyCtorExpr * impCpCtorExpr, Type * formal ) { 399 388 static UniqueName tempNamer("_tmp_cp"); 400 389 assert( env ); 401 390 CP_CTOR_PRINT( std::cerr << "Type Substitution: " << *env << std::endl; ) 402 assert( arg-> has_result());403 Type * result = arg-> get_result();391 assert( arg->result ); 392 Type * result = arg->result; 404 393 if ( skipCopyConstruct( result ) ) return; // skip certain non-copyable types 405 394 406 // type may involve type variables, so apply type substitution to get temporary variable's actual type 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). 407 397 result = result->clone(); 408 env->apply ( result );409 ObjectDecl * tmp = new ObjectDecl( tempNamer.newName(), Type::StorageClasses(), LinkageSpec::C, 0, result, 0);398 env->applyFree( result ); 399 ObjectDecl * tmp = ObjectDecl::newObject( "__tmp", result, nullptr ); 410 400 tmp->get_type()->set_const( false ); 411 401 … … 417 407 // if the chosen constructor is intrinsic, the copy is unnecessary, so 418 408 // don't create the temporary and don't call the copy constructor 419 VariableExpr * function = dynamic_cast< VariableExpr * >( appExpr->get_function() ); 420 assert( function ); 421 if ( function->get_var()->get_linkage() == LinkageSpec::Intrinsic ) return; 422 } 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(); 423 419 424 420 // replace argument to function call with temporary 425 421 arg = new CommaExpr( cpCtor, new VariableExpr( tmp ) ); 426 impCpCtorExpr-> get_tempDecls().push_back( tmp );427 impCpCtorExpr-> get_dtors().push_front( makeCtorDtor( "^?{}", tmp ) );422 impCpCtorExpr->tempDecls.push_back( tmp ); 423 impCpCtorExpr->dtors.push_front( makeCtorDtor( "^?{}", tmp ) ); 428 424 } 429 425 … … 435 431 CP_CTOR_PRINT( std::cerr << "ResolveCopyCtors: " << impCpCtorExpr << std::endl; ) 436 432 437 ApplicationExpr * appExpr = impCpCtorExpr-> get_callExpr();433 ApplicationExpr * appExpr = impCpCtorExpr->callExpr; 438 434 439 435 // take each argument and attempt to copy construct it. 440 for ( Expression * & arg : appExpr->get_args() ) { 441 copyConstructArg( arg, impCpCtorExpr ); 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 ); 442 448 } // for 443 449 … … 445 451 // initialized with the return value and is destructed later 446 452 // xxx - handle named return values? 447 Type * result = appExpr-> get_result();453 Type * result = appExpr->result; 448 454 if ( ! result->isVoid() ) { 449 455 static UniqueName retNamer("_tmp_cp_ret"); 450 456 result = result->clone(); 451 457 env->apply( result ); 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 );458 ObjectDecl * ret = ObjectDecl::newObject( retNamer.newName(), result, nullptr ); 459 ret->type->set_const( false ); 460 impCpCtorExpr->returnDecls.push_back( ret ); 455 461 CP_CTOR_PRINT( std::cerr << "makeCtorDtor for a return" << std::endl; ) 456 462 if ( ! dynamic_cast< ReferenceType * >( result ) ) { 457 // destructing lvalue returns is bad because it can cause multiple destructor calls to the same object - the returned object is not a temporary463 // destructing reference returns is bad because it can cause multiple destructor calls to the same object - the returned object is not a temporary 458 464 destructRet( ret, impCpCtorExpr ); 459 465 } … … 472 478 result = result->clone(); 473 479 env->apply( result ); 474 ObjectDecl * ret = new ObjectDecl( retNamer.newName(), Type::StorageClasses(), LinkageSpec::C, 0, result, 0);480 ObjectDecl * ret = ObjectDecl::newObject( retNamer.newName(), result, nullptr ); 475 481 ret->get_type()->set_const( false ); 476 482 stmtExpr->get_returnDecls().push_front( ret ); … … 493 499 visit_children = false; 494 500 } 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 ) ) ) } ); 495 515 } 496 516 … … 509 529 } else { 510 530 // expr isn't a call expr, so create a new temporary variable to use to hold the value of the unique expression 511 unqExpr->set_object( new ObjectDecl( toString("_unq", unqExpr->get_id()), Type::StorageClasses(), LinkageSpec::C, nullptr, unqExpr->get_result()->clone(), nullptr) );531 unqExpr->set_object( ObjectDecl::newObject( toString("_unq", unqExpr->get_id()), unqExpr->get_result()->clone(), makeInit( unqExpr->get_result() ) ) ); 512 532 unqExpr->set_var( new VariableExpr( unqExpr->get_object() ) ); 513 533 } … … 515 535 } 516 536 517 Expression * FixCopyCtors:: mutate( ImplicitCopyCtorExpr * impCpCtorExpr ) {537 Expression * FixCopyCtors::postmutate( ImplicitCopyCtorExpr * impCpCtorExpr ) { 518 538 CP_CTOR_PRINT( std::cerr << "FixCopyCtors: " << impCpCtorExpr << std::endl; ) 519 539 520 impCpCtorExpr = strict_dynamic_cast< ImplicitCopyCtorExpr * >( Parent::mutate( impCpCtorExpr ) );521 540 std::list< ObjectDecl * > & tempDecls = impCpCtorExpr->get_tempDecls(); 522 541 std::list< ObjectDecl * > & returnDecls = impCpCtorExpr->get_returnDecls(); … … 525 544 // add all temporary declarations and their constructors 526 545 for ( ObjectDecl * obj : tempDecls ) { 527 stmtsToAdd .push_back( new DeclStmt( noLabels, obj ) );546 stmtsToAddBefore.push_back( new DeclStmt( noLabels, obj ) ); 528 547 } // for 529 548 for ( ObjectDecl * obj : returnDecls ) { 530 stmtsToAdd .push_back( new DeclStmt( noLabels, obj ) );549 stmtsToAddBefore.push_back( new DeclStmt( noLabels, obj ) ); 531 550 } // for 532 551 … … 536 555 } // for 537 556 538 // xxx - update to work with multiple return values539 557 ObjectDecl * returnDecl = returnDecls.empty() ? nullptr : returnDecls.front(); 540 558 Expression * callExpr = impCpCtorExpr->get_callExpr(); … … 561 579 Expression * retExpr = new CommaExpr( assign, new VariableExpr( returnDecl ) ); 562 580 // move env from callExpr to retExpr 563 retExpr->set_env( callExpr->get_env() ); 564 callExpr->set_env( nullptr ); 581 std::swap( retExpr->env, callExpr->env ); 565 582 return retExpr; 566 583 } else { … … 569 586 } 570 587 571 Expression * FixCopyCtors::mutate( StmtExpr * stmtExpr ) {588 void FixCopyCtors::premutate( StmtExpr * stmtExpr ) { 572 589 // function call temporaries should be placed at statement-level, rather than nested inside of a new statement expression, 573 590 // since temporaries can be shared across sub-expressions, e.g. 574 591 // [A, A] f(); 575 592 // g([A] x, [A] y); 576 // f(g());593 // g(f()); 577 594 // 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; 578 598 std::list< Statement * > & stmts = stmtExpr->get_statements()->get_kids(); 579 599 for ( Statement *& stmt : stmts ) { 580 stmt = stmt->acceptMutator( * this);600 stmt = stmt->acceptMutator( *visitor ); 581 601 } // for 582 // stmtExpr = strict_dynamic_cast< StmtExpr * >( Parent::mutate( stmtExpr ) );583 602 assert( stmtExpr->get_result() ); 584 603 Type * result = stmtExpr->get_result(); 585 604 if ( ! result->isVoid() ) { 586 605 for ( ObjectDecl * obj : stmtExpr->get_returnDecls() ) { 587 stmtsToAdd .push_back( new DeclStmt( noLabels, obj ) );606 stmtsToAddBefore.push_back( new DeclStmt( noLabels, obj ) ); 588 607 } // for 589 608 // add destructors after current statement … … 592 611 } // for 593 612 // must have a non-empty body, otherwise it wouldn't have a result 594 CompoundStmt * body = stmtExpr->get_statements(); 595 assert( ! body->get_kids().empty() ); 613 assert( ! stmts.empty() ); 596 614 assert( ! stmtExpr->get_returnDecls().empty() ); 597 body->get_kids().push_back( new ExprStmt( noLabels, new VariableExpr( stmtExpr->get_returnDecls().front() ) ) );615 stmts.push_back( new ExprStmt( noLabels, new VariableExpr( stmtExpr->get_returnDecls().front() ) ) ); 598 616 stmtExpr->get_returnDecls().clear(); 599 617 stmtExpr->get_dtors().clear(); … … 601 619 assert( stmtExpr->get_returnDecls().empty() ); 602 620 assert( stmtExpr->get_dtors().empty() ); 603 return stmtExpr;604 } 605 606 Expression * FixCopyCtors::mutate( UniqueExpr * unqExpr ) {621 } 622 623 void FixCopyCtors::premutate( UniqueExpr * unqExpr ) { 624 visit_children = false; 607 625 unqCount[ unqExpr->get_id() ]--; 608 626 static std::unordered_map< int, std::list< Statement * > > dtors; 609 627 static std::unordered_map< int, UniqueExpr * > unqMap; 610 static std::unordered_set< int > addDeref;611 628 // has to be done to clean up ImplicitCopyCtorExpr nodes, even when this node was skipped in previous passes 612 629 if ( unqMap.count( unqExpr->get_id() ) ) { … … 619 636 stmtsToAddAfter.splice( stmtsToAddAfter.end(), dtors[ unqExpr->get_id() ] ); 620 637 } 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 ); 638 return; 639 } 640 PassVisitor<FixCopyCtors> fixer( unqCount ); 628 641 unqExpr->set_expr( unqExpr->get_expr()->acceptMutator( fixer ) ); // stmtexprs contained should not be separately fixed, so this must occur after the lookup 629 stmtsToAdd .splice( stmtsToAdd.end(), fixer.stmtsToAdd);642 stmtsToAddBefore.splice( stmtsToAddBefore.end(), fixer.pass.stmtsToAddBefore ); 630 643 unqMap[unqExpr->get_id()] = unqExpr; 631 644 if ( unqCount[ unqExpr->get_id() ] == 0 ) { // insert destructor after the last use of the unique expression 632 645 stmtsToAddAfter.splice( stmtsToAddAfter.end(), dtors[ unqExpr->get_id() ] ); 633 646 } else { // remember dtors for last instance of unique expr 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 ) { 647 dtors[ unqExpr->get_id() ] = fixer.pass.stmtsToAddAfter; 648 } 649 return; 650 } 651 652 DeclarationWithType * FixInit::postmutate( ObjectDecl *objDecl ) { 650 653 // since this removes the init field from objDecl, it must occur after children are mutated (i.e. postmutate) 651 654 if ( ConstructorInit * ctorInit = dynamic_cast< ConstructorInit * >( objDecl->get_init() ) ) { … … 745 748 } else { 746 749 ImplicitCtorDtorStmt * implicit = strict_dynamic_cast< ImplicitCtorDtorStmt * > ( ctor ); 747 ExprStmt * ctorStmt = dynamic_cast< ExprStmt * >( implicit-> get_callStmt());750 ExprStmt * ctorStmt = dynamic_cast< ExprStmt * >( implicit->callStmt ); 748 751 ApplicationExpr * ctorCall = nullptr; 749 if ( ctorStmt && (ctorCall = isIntrinsicCallExpr( ctorStmt-> get_expr())) && ctorCall->get_args().size() == 2 ) {752 if ( ctorStmt && (ctorCall = isIntrinsicCallExpr( ctorStmt->expr )) && ctorCall->get_args().size() == 2 ) { 750 753 // clean up intrinsic copy constructor calls by making them into SingleInits 751 objDecl->set_init( new SingleInit( ctorCall->get_args().back() ) ); 752 ctorCall->get_args().pop_back(); 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(); 753 759 } else { 754 760 stmtsToAddAfter.push_back( ctor ); 755 objDecl-> set_init( nullptr );756 ctorInit-> set_ctor( nullptr );761 objDecl->init = nullptr; 762 ctorInit->ctor = nullptr; 757 763 } 758 764 } // if 759 } else if ( Initializer * init = ctorInit-> get_init()) {760 objDecl-> set_init( init );761 ctorInit-> set_init( nullptr );765 } else if ( Initializer * init = ctorInit->init ) { 766 objDecl->init = init; 767 ctorInit->init = nullptr; 762 768 } else { 763 769 // no constructor and no initializer, which is okay 764 objDecl-> set_init( nullptr );770 objDecl->init = nullptr; 765 771 } // if 766 772 delete ctorInit; … … 819 825 assert( ! ctorInit->get_ctor() || ! ctorInit->get_init() ); 820 826 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 821 829 if ( dtor && ! isIntrinsicSingleArgCallStmt( dtor ) ) { 822 // don't need to call intrinsic dtor, because it does nothing, but823 // non-intrinsic dtors must be called830 // set dtor location to the object's location for error messages 831 ctorInit->dtor->location = objDecl->location; 824 832 reverseDeclOrder.front().push_front( objDecl ); 825 833 } // if … … 832 840 GuardValue( labelVars ); 833 841 labelVars.clear(); 842 // LabelFinder does not recurse into FunctionDecl, so need to visit 843 // its children manually. 834 844 maybeAccept( funcDecl->type, finder ); 835 845 maybeAccept( funcDecl->statements, finder ); … … 933 943 } 934 944 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 935 958 void GenStructMemberCalls::previsit( FunctionDecl * funcDecl ) { 936 GuardValue( func Decl);959 GuardValue( function ); 937 960 GuardValue( unhandled ); 938 961 GuardValue( usedUninit ); … … 967 990 } 968 991 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 982 992 void GenStructMemberCalls::postvisit( FunctionDecl * funcDecl ) { 983 993 // remove the unhandled objects from usedUninit, because a call is inserted … … 1012 1022 // skip non-DWT members 1013 1023 if ( ! field ) continue; 1024 // skip non-constructable members 1025 if ( ! tryConstruct( field ) ) continue; 1014 1026 // skip handled members 1015 1027 if ( ! unhandled.count( field ) ) continue; … … 1130 1142 } 1131 1143 1132 DeclarationWithType * MutatingResolver::mutate( ObjectDecl * objectDecl ) {1144 DeclarationWithType * MutatingResolver::mutate( ObjectDecl * objectDecl ) { 1133 1145 // add object to the indexer assumes that there will be no name collisions 1134 1146 // in generated code. If this changes, add mutate methods for entities with … … 1138 1150 } 1139 1151 1140 Expression* MutatingResolver::mutate( UntypedExpr *untypedExpr ) { 1141 return strict_dynamic_cast< ApplicationExpr * >( ResolvExpr::findVoidExpression( untypedExpr, indexer ) ); 1142 } 1143 1144 Expression * FixCtorExprs::mutate( ConstructorExpr * ctorExpr ) { 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 ) { 1145 1159 static UniqueName tempNamer( "_tmp_ctor_expr" ); 1146 1160 // xxx - is the size check necessary? 1147 assert( ctorExpr-> has_result()&& ctorExpr->get_result()->size() == 1 );1161 assert( ctorExpr->result && ctorExpr->get_result()->size() == 1 ); 1148 1162 1149 1163 // 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. 1150 ObjectDecl * tmp = new ObjectDecl( tempNamer.newName(), Type::StorageClasses(), LinkageSpec::C, nullptr, ctorExpr->get_result()->clone(), nullptr );1151 addDeclaration( tmp );1164 ObjectDecl * tmp = ObjectDecl::newObject( tempNamer.newName(), ctorExpr->get_result()->clone(), nullptr ); 1165 declsToAddBefore.push_back( tmp ); 1152 1166 1153 1167 // xxx - this can be TupleAssignExpr now. Need to properly handle this case. … … 1158 1172 delete ctorExpr; 1159 1173 1174 // build assignment and replace constructor's first argument with new temporary 1160 1175 Expression *& firstArg = callExpr->get_args().front(); 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 ); 1176 Expression * assign = new UntypedExpr( new NameExpr( "?=?" ), { new AddressExpr( new VariableExpr( tmp ) ), new AddressExpr( firstArg ) } ); 1181 1177 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; 1182 1183 1183 1184 // for constructor expr: -
src/InitTweak/GenInit.cc
r78315272 r3f7e12cb 26 26 #include "Common/UniqueName.h" // for UniqueName 27 27 #include "Common/utility.h" // for ValueGuard, maybeClone 28 #include "GenPoly/DeclMutator.h" // for DeclMutator29 28 #include "GenPoly/GenPoly.h" // for getFunctionType, isPolyType 30 29 #include "GenPoly/ScopedSet.h" // for ScopedSet, ScopedSet<>::const_iter... … … 62 61 }; 63 62 64 struct CtorDtor : public WithGuards, public WithShortCircuiting {63 struct CtorDtor : public WithGuards, public WithShortCircuiting, public WithVisitorRef<CtorDtor> { 65 64 /// create constructor and destructor statements for object declarations. 66 65 /// the actual call statements will be added in after the resolver has run … … 75 74 // that need to be constructed or destructed 76 75 void previsit( StructDecl *aggregateDecl ); 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; } 76 void previsit( AggregateDecl * ) { visit_children = false; } 77 void previsit( NamedTypeDecl * ) { visit_children = false; } 78 void previsit( FunctionType * ) { visit_children = false; } 83 79 84 80 void previsit( CompoundStmt * compoundStmt ); … … 89 85 // should not have a ConstructorInit generated. 90 86 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; 87 ManagedTypes managedTypes; 95 88 bool inFunction = false; 96 89 }; 97 90 98 class HoistArrayDimension final : public GenPoly::DeclMutator { 99 public: 100 typedef GenPoly::DeclMutator Parent; 101 91 struct HoistArrayDimension final : public WithDeclsToAdd, public WithShortCircuiting, public WithGuards { 102 92 /// hoist dimension from array types in object declaration so that it uses a single 103 93 /// const variable of type size_t, so that side effecting array dimensions are only … … 105 95 static void hoistArrayDimension( std::list< Declaration * > & translationUnit ); 106 96 107 private: 108 using Parent::mutate; 109 110 virtual DeclarationWithType * mutate( ObjectDecl * objectDecl ) override; 111 virtual DeclarationWithType * mutate( FunctionDecl *functionDecl ) override; 97 void premutate( ObjectDecl * objectDecl ); 98 DeclarationWithType * postmutate( ObjectDecl * objectDecl ); 99 void premutate( FunctionDecl *functionDecl ); 112 100 // should not traverse into any of these declarations to find objects 113 101 // that need to be constructed or destructed 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; } 102 void premutate( AggregateDecl * ) { visit_children = false; } 103 void premutate( NamedTypeDecl * ) { visit_children = false; } 104 void premutate( FunctionType * ) { visit_children = false; } 122 105 123 106 void hoist( Type * type ); … … 128 111 129 112 void genInit( std::list< Declaration * > & translationUnit ) { 130 ReturnFixer::makeReturnTemp( translationUnit );113 fixReturnStatements( translationUnit ); 131 114 HoistArrayDimension::hoistArrayDimension( translationUnit ); 132 115 CtorDtor::generateCtorDtor( translationUnit ); 133 116 } 134 117 135 void ReturnFixer::makeReturnTemp( std::list< Declaration * > & translationUnit ) {118 void fixReturnStatements( std::list< Declaration * > & translationUnit ) { 136 119 PassVisitor<ReturnFixer> fixer; 137 120 mutateAll( translationUnit, fixer ); … … 143 126 // hands off if the function returns a reference - we don't want to allocate a temporary if a variable's address 144 127 // is being returned 145 if ( returnStmt-> get_expr() && returnVals.size() == 1 && ! dynamic_cast< ReferenceType * >( returnVals.front()->get_type() ) ) {128 if ( returnStmt->expr && returnVals.size() == 1 && isConstructable( returnVals.front()->get_type() ) ) { 146 129 // explicitly construct the return value using the return expression and the retVal object 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() ) ); 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() ) ); 150 138 151 139 // return the retVal object 152 returnStmt-> set_expr( new VariableExpr( returnVals.front()) );140 returnStmt->expr = new VariableExpr( returnVals.front() ); 153 141 } // if 154 142 } … … 158 146 GuardValue( funcName ); 159 147 160 ftype = functionDecl-> get_functionType();161 funcName = functionDecl-> get_name();148 ftype = functionDecl->type; 149 funcName = functionDecl->name; 162 150 } 163 151 … … 165 153 // which would be incorrect if it is a side-effecting computation. 166 154 void HoistArrayDimension::hoistArrayDimension( std::list< Declaration * > & translationUnit ) { 167 HoistArrayDimension hoister; 168 hoister.mutateDeclarationList( translationUnit ); 169 } 170 171 DeclarationWithType * HoistArrayDimension::mutate( ObjectDecl * objectDecl ) { 155 PassVisitor<HoistArrayDimension> hoister; 156 mutateAll( translationUnit, hoister ); 157 } 158 159 void HoistArrayDimension::premutate( ObjectDecl * objectDecl ) { 160 GuardValue( storageClasses ); 172 161 storageClasses = objectDecl->get_storageClasses(); 173 DeclarationWithType * temp = Parent::mutate( objectDecl ); 162 } 163 164 DeclarationWithType * HoistArrayDimension::postmutate( ObjectDecl * objectDecl ) { 174 165 hoist( objectDecl->get_type() ); 175 return temp;166 return objectDecl; 176 167 } 177 168 … … 194 185 195 186 arrayType->set_dimension( new VariableExpr( arrayDimension ) ); 196 addDeclaration( arrayDimension );187 declsToAddBefore.push_back( arrayDimension ); 197 188 198 189 hoist( arrayType->get_base() ); … … 201 192 } 202 193 203 DeclarationWithType * HoistArrayDimension::mutate( FunctionDecl *functionDecl ) { 204 ValueGuard< bool > oldInFunc( inFunction ); 205 inFunction = true; 206 DeclarationWithType * decl = Parent::mutate( functionDecl ); 207 return decl; 194 void HoistArrayDimension::premutate( FunctionDecl * ) { 195 GuardValue( inFunction ); 208 196 } 209 197 … … 213 201 } 214 202 215 bool CtorDtor::isManaged( Type * type ) const {216 // at least for now,references are never constructed203 bool ManagedTypes::isManaged( Type * type ) const { 204 // references are never constructed 217 205 if ( dynamic_cast< ReferenceType * >( type ) ) return false; 218 206 // need to clear and reset qualifiers when determining if a type is managed … … 221 209 if ( TupleType * tupleType = dynamic_cast< TupleType * > ( type ) ) { 222 210 // tuple is also managed if any of its components are managed 223 if ( std::any_of( tupleType-> get_types().begin(), tupleType->get_types().end(), [&](Type * type) { return isManaged( type ); }) ) {211 if ( std::any_of( tupleType->types.begin(), tupleType->types.end(), [&](Type * type) { return isManaged( type ); }) ) { 224 212 return true; 225 213 } 226 214 } 227 215 // 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) 228 return managedTypes.find( SymTab::Mangler::mangle ( type ) ) != managedTypes.end() || GenPoly::isPolyType( type );229 } 230 231 bool CtorDtor::isManaged( ObjectDecl * objDecl ) const {216 return managedTypes.find( SymTab::Mangler::mangleConcrete( type ) ) != managedTypes.end() || GenPoly::isPolyType( type ); 217 } 218 219 bool ManagedTypes::isManaged( ObjectDecl * objDecl ) const { 232 220 Type * type = objDecl->get_type(); 233 221 while ( ArrayType * at = dynamic_cast< ArrayType * >( type ) ) { … … 237 225 } 238 226 239 void CtorDtor::handleDWT( DeclarationWithType * dwt ) {227 void ManagedTypes::handleDWT( DeclarationWithType * dwt ) { 240 228 // if this function is a user-defined constructor or destructor, mark down the type as "managed" 241 229 if ( ! LinkageSpec::isOverridable( dwt->get_linkage() ) && CodeGen::isCtorDtor( dwt->get_name() ) ) { … … 244 232 Type * type = InitTweak::getPointerBase( params.front()->get_type() ); 245 233 assert( type ); 246 managedTypes.insert( SymTab::Mangler::mangle( type ) ); 247 } 248 } 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(); } 249 256 250 257 ImplicitCtorDtorStmt * genCtorDtor( const std::string & fname, ObjectDecl * objDecl, Expression * arg ) { … … 291 298 292 299 void CtorDtor::previsit( ObjectDecl * objDecl ) { 293 handleDWT( objDecl );300 managedTypes.handleDWT( objDecl ); 294 301 // hands off if @=, extern, builtin, etc. 295 302 // even if unmanaged, try to construct global or static if initializer is not constexpr, since this is not legal C 296 if ( tryConstruct( objDecl ) && ( isManaged( objDecl ) || ((! inFunction || objDecl->get_storageClasses().is_static ) && ! isConstExpr( objDecl->get_init() ) ) ) ) {303 if ( tryConstruct( objDecl ) && ( managedTypes.isManaged( objDecl ) || ((! inFunction || objDecl->get_storageClasses().is_static ) && ! isConstExpr( objDecl->get_init() ) ) ) ) { 297 304 // constructed objects cannot be designated 298 305 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 ); … … 305 312 306 313 void CtorDtor::previsit( FunctionDecl *functionDecl ) { 314 visit_children = false; // do not try and construct parameters or forall parameters 307 315 GuardValue( inFunction ); 308 316 inFunction = true; 309 317 310 handleDWT( functionDecl );318 managedTypes.handleDWT( functionDecl ); 311 319 312 320 GuardScope( managedTypes ); … … 314 322 for ( auto & tyDecl : functionDecl->get_functionType()->get_forall() ) { 315 323 for ( DeclarationWithType *& assertion : tyDecl->get_assertions() ) { 316 handleDWT( assertion );324 managedTypes.handleDWT( assertion ); 317 325 } 318 326 } 319 327 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 328 maybeAccept( functionDecl->get_statements(), *visitor ); 324 329 } 325 330 … … 327 332 visit_children = false; // do not try to construct and destruct aggregate members 328 333 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 ) { 334 managedTypes.handleStruct( aggregateDecl ); 335 } 336 337 void CtorDtor::previsit( CompoundStmt * ) { 343 338 GuardScope( managedTypes ); 344 339 } -
src/InitTweak/GenInit.h
r78315272 r3f7e12cb 16 16 #pragma once 17 17 18 #include <list> // for list19 #include <string> // for string18 #include <list> // for list 19 #include <string> // for string 20 20 21 #include "SynTree/SynTree.h" // for Visitor Nodes 21 #include "SynTree/SynTree.h" // for Visitor Nodes 22 23 #include "GenPoly/ScopedSet.h" // for ScopedSet 22 24 23 25 namespace InitTweak { … … 25 27 void genInit( std::list< Declaration * > & translationUnit ); 26 28 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 ); 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 ); 29 34 30 35 /// creates an appropriate ConstructorInit node which contains a constructor, destructor, and C-initializer 31 36 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 }; 32 51 } // namespace 33 52 -
src/InitTweak/InitTweak.cc
r78315272 r3f7e12cb 1 #include <stddef.h> // for NULL2 1 #include <algorithm> // for find, all_of 3 2 #include <cassert> // for assertf, assert, strict_dynamic_cast … … 23 22 #include "SynTree/Type.h" // for FunctionType, ArrayType, PointerType 24 23 #include "SynTree/Visitor.h" // for Visitor, maybeAccept 24 #include "Tuples/Tuples.h" // for Tuples::isTtype 25 25 26 26 class UntypedValofExpr; … … 170 170 } 171 171 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 172 181 namespace { 173 182 /// given index i, dimension d, initializer init, and callExpr f, generates … … 184 193 callExpr->get_args().splice( callExpr->get_args().end(), args ); 185 194 186 *out++ = new IfStmt( noLabels, cond, new ExprStmt( noLabels, callExpr ), NULL);195 *out++ = new IfStmt( noLabels, cond, new ExprStmt( noLabels, callExpr ), nullptr ); 187 196 188 197 UntypedExpr * increment = new UntypedExpr( new NameExpr( "++?" ) ); … … 250 259 // To accomplish this, generate switch statement, consuming all of expander's elements 251 260 Statement * InitImpl::buildListInit( UntypedExpr * dst, std::list< Expression * > & indices ) { 252 if ( ! init ) return NULL;261 if ( ! init ) return nullptr; 253 262 CompoundStmt * block = new CompoundStmt( noLabels ); 254 263 build( dst, indices.begin(), indices.end(), init, back_inserter( block->get_kids() ) ); 255 264 if ( block->get_kids().empty() ) { 256 265 delete block; 257 return NULL;266 return nullptr; 258 267 } else { 259 init = NULL; // init was consumed in creating the list init268 init = nullptr; // init was consumed in creating the list init 260 269 return block; 261 270 } 262 271 } 263 272 264 Statement * ExprImpl::buildListInit( __attribute((unused)) UntypedExpr * dst, __attribute((unused)) std::list< Expression * > & indices) {265 return NULL;273 Statement * ExprImpl::buildListInit( UntypedExpr *, std::list< Expression * > & ) { 274 return nullptr; 266 275 } 267 276 … … 270 279 } 271 280 272 bool tryConstruct( ObjectDecl * objDecl ) { 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; 273 298 return ! LinkageSpec::isBuiltin( objDecl->get_linkage() ) && 274 (objDecl->get_init() == NULL || 275 ( objDecl->get_init() != NULL && objDecl->get_init()->get_maybeConstructed() )) 276 && ! objDecl->get_storageClasses().is_extern; 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 ); 277 307 } 278 308 … … 314 344 collectCtorDtorCalls( stmt, matches ); 315 345 assert( matches.size() <= 1 ); 316 return matches.size() == 1 ? matches.front() : NULL;346 return matches.size() == 1 ? matches.front() : nullptr; 317 347 } 318 348 … … 332 362 assert( expr ); 333 363 if ( VariableExpr * varExpr = dynamic_cast< VariableExpr * >( expr ) ) { 334 return varExpr-> get_var();364 return varExpr->var; 335 365 } else if ( MemberExpr * memberExpr = dynamic_cast< MemberExpr * >( expr ) ) { 336 return memberExpr-> get_member();366 return memberExpr->member; 337 367 } else if ( CastExpr * castExpr = dynamic_cast< CastExpr * >( expr ) ) { 338 return getCalledFunction( castExpr-> get_arg());368 return getCalledFunction( castExpr->arg ); 339 369 } else if ( UntypedExpr * untypedExpr = dynamic_cast< UntypedExpr * >( expr ) ) { 340 370 return handleDerefCalledFunction( untypedExpr ); … … 342 372 return handleDerefCalledFunction( appExpr ); 343 373 } else if ( AddressExpr * addrExpr = dynamic_cast< AddressExpr * >( expr ) ) { 344 return getCalledFunction( addrExpr->get_arg() ); 374 return getCalledFunction( addrExpr->arg ); 375 } else if ( CommaExpr * commaExpr = dynamic_cast< CommaExpr * >( expr ) ) { 376 return getCalledFunction( commaExpr->arg2 ); 345 377 } 346 378 return nullptr; … … 359 391 ApplicationExpr * isIntrinsicCallExpr( Expression * expr ) { 360 392 ApplicationExpr * appExpr = dynamic_cast< ApplicationExpr * >( expr ); 361 if ( ! appExpr ) return NULL;393 if ( ! appExpr ) return nullptr; 362 394 DeclarationWithType * function = getCalledFunction( appExpr->get_function() ); 363 395 assertf( function, "getCalledFunction returned nullptr: %s", toString( appExpr->get_function() ).c_str() ); 364 396 // check for Intrinsic only - don't want to remove all overridable ctor/dtors because autogenerated ctor/dtor 365 397 // will call all member dtors, and some members may have a user defined dtor. 366 return function->get_linkage() == LinkageSpec::Intrinsic ? appExpr : NULL;398 return function->get_linkage() == LinkageSpec::Intrinsic ? appExpr : nullptr; 367 399 } 368 400 … … 482 514 return refType->get_base(); 483 515 } else { 484 return NULL;516 return nullptr; 485 517 } 486 518 } … … 488 520 Type * isPointerType( Type * type ) { 489 521 if ( getPointerBase( type ) ) return type; 490 else return NULL;522 else return nullptr; 491 523 } 492 524 … … 557 589 FunctionDecl * isCopyFunction( Declaration * decl, const std::string & fname ) { 558 590 FunctionDecl * function = dynamic_cast< FunctionDecl * >( decl ); 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;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; 563 595 564 596 Type * t1 = getPointerBase( ftype->get_parameters().front()->get_type() ); 565 Type * t2 = ftype-> get_parameters().back()->get_type();597 Type * t2 = ftype->parameters.back()->get_type(); 566 598 assert( t1 ); 567 599 … … 583 615 } 584 616 FunctionDecl * isDefaultConstructor( Declaration * decl ) { 585 if ( isConstructor( decl-> get_name()) ) {617 if ( isConstructor( decl->name ) ) { 586 618 if ( FunctionDecl * func = dynamic_cast< FunctionDecl * >( decl ) ) { 587 if ( func-> get_functionType()->get_parameters().size() == 1 ) {619 if ( func->type->parameters.size() == 1 ) { 588 620 return func; 589 621 } -
src/InitTweak/InitTweak.h
r78315272 r3f7e12cb 30 30 FunctionDecl * isCopyFunction( Declaration * decl, const std::string & fname ); 31 31 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 32 38 /// transform Initializer into an argument list that can be passed to a call expression 33 39 std::list< Expression * > makeInitList( Initializer * init ); 34 40 35 /// True if the resolver should try to construct objDecl 36 bool tryConstruct( ObjectDecl * objDecl ); 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 ); 37 46 38 47 /// True if the Initializer contains designations … … 96 105 void addArrayIndex( Expression * index, Expression * dimension ); 97 106 void clearArrayIndices(); 107 bool addReference(); 98 108 99 109 class ExpanderImpl; -
src/MakeLibCfa.cc
r78315272 r3f7e12cb 119 119 newDecls.push_back( funcDecl ); 120 120 121 Statement * stmt = nullptr; 121 122 switch ( opInfo.type ) { 122 123 case CodeGen::OT_INDEX: … … 128 129 case CodeGen::OT_POSTFIXASSIGN: 129 130 case CodeGen::OT_INFIXASSIGN: 131 // return the recursive call 132 stmt = new ReturnStmt( noLabels, newExpr ); 133 break; 130 134 case CodeGen::OT_CTOR: 131 135 case CodeGen::OT_DTOR: 132 // returnthe recursive call133 funcDecl->get_statements()->get_kids().push_back( new ReturnStmt( std::list< Label >(), newExpr ));136 // execute the recursive call 137 stmt = new ExprStmt( noLabels, newExpr ); 134 138 break; 135 139 case CodeGen::OT_CONSTANT: … … 138 142 assert( false ); 139 143 } // switch 144 funcDecl->get_statements()->push_back( stmt ); 140 145 } 141 146 } // namespace -
src/Makefile.in
r78315272 r3f7e12cb 172 172 GenPoly/driver_cfa_cpp-Box.$(OBJEXT) \ 173 173 GenPoly/driver_cfa_cpp-GenPoly.$(OBJEXT) \ 174 GenPoly/driver_cfa_cpp-PolyMutator.$(OBJEXT) \175 174 GenPoly/driver_cfa_cpp-ScrubTyVars.$(OBJEXT) \ 176 175 GenPoly/driver_cfa_cpp-Lvalue.$(OBJEXT) \ 177 176 GenPoly/driver_cfa_cpp-Specialize.$(OBJEXT) \ 178 GenPoly/driver_cfa_cpp-CopyParams.$(OBJEXT) \179 177 GenPoly/driver_cfa_cpp-FindFunction.$(OBJEXT) \ 180 GenPoly/driver_cfa_cpp-DeclMutator.$(OBJEXT) \181 178 GenPoly/driver_cfa_cpp-InstantiateGeneric.$(OBJEXT) \ 182 179 InitTweak/driver_cfa_cpp-GenInit.$(OBJEXT) \ … … 253 250 SynTree/driver_cfa_cpp-Visitor.$(OBJEXT) \ 254 251 SynTree/driver_cfa_cpp-Mutator.$(OBJEXT) \ 255 SynTree/driver_cfa_cpp-AddStmtVisitor.$(OBJEXT) \256 252 SynTree/driver_cfa_cpp-TypeSubstitution.$(OBJEXT) \ 257 253 SynTree/driver_cfa_cpp-Attribute.$(OBJEXT) \ … … 497 493 ControlStruct/ForExprMutator.cc \ 498 494 ControlStruct/ExceptTranslate.cc GenPoly/Box.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 \ 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 \ 527 521 SynTree/VarArgsType.cc SynTree/ZeroOneType.cc \ 528 522 SynTree/Constant.cc SynTree/Expression.cc SynTree/TupleExpr.cc \ … … 535 529 SynTree/NamedTypeDecl.cc SynTree/TypeDecl.cc \ 536 530 SynTree/Initializer.cc SynTree/Visitor.cc SynTree/Mutator.cc \ 537 SynTree/ AddStmtVisitor.cc SynTree/TypeSubstitution.cc \538 SynTree/ Attribute.cc SynTree/VarExprReplacer.cc \539 Tuples/Tuple Assignment.cc Tuples/TupleExpansion.cc \540 Tuples/Explode.ccVirtual/ExpandCasts.cc531 SynTree/TypeSubstitution.cc SynTree/Attribute.cc \ 532 SynTree/VarExprReplacer.cc Tuples/TupleAssignment.cc \ 533 Tuples/TupleExpansion.cc Tuples/Explode.cc \ 534 Virtual/ExpandCasts.cc 541 535 MAINTAINERCLEANFILES = Parser/parser.output ${libdir}/${notdir \ 542 536 ${cfa_cpplib_PROGRAMS}} … … 717 711 GenPoly/driver_cfa_cpp-GenPoly.$(OBJEXT): GenPoly/$(am__dirstamp) \ 718 712 GenPoly/$(DEPDIR)/$(am__dirstamp) 719 GenPoly/driver_cfa_cpp-PolyMutator.$(OBJEXT): GenPoly/$(am__dirstamp) \720 GenPoly/$(DEPDIR)/$(am__dirstamp)721 713 GenPoly/driver_cfa_cpp-ScrubTyVars.$(OBJEXT): GenPoly/$(am__dirstamp) \ 722 714 GenPoly/$(DEPDIR)/$(am__dirstamp) … … 725 717 GenPoly/driver_cfa_cpp-Specialize.$(OBJEXT): GenPoly/$(am__dirstamp) \ 726 718 GenPoly/$(DEPDIR)/$(am__dirstamp) 727 GenPoly/driver_cfa_cpp-CopyParams.$(OBJEXT): GenPoly/$(am__dirstamp) \728 GenPoly/$(DEPDIR)/$(am__dirstamp)729 719 GenPoly/driver_cfa_cpp-FindFunction.$(OBJEXT): \ 730 720 GenPoly/$(am__dirstamp) GenPoly/$(DEPDIR)/$(am__dirstamp) 731 GenPoly/driver_cfa_cpp-DeclMutator.$(OBJEXT): GenPoly/$(am__dirstamp) \732 GenPoly/$(DEPDIR)/$(am__dirstamp)733 721 GenPoly/driver_cfa_cpp-InstantiateGeneric.$(OBJEXT): \ 734 722 GenPoly/$(am__dirstamp) GenPoly/$(DEPDIR)/$(am__dirstamp) … … 929 917 SynTree/driver_cfa_cpp-Mutator.$(OBJEXT): SynTree/$(am__dirstamp) \ 930 918 SynTree/$(DEPDIR)/$(am__dirstamp) 931 SynTree/driver_cfa_cpp-AddStmtVisitor.$(OBJEXT): \932 SynTree/$(am__dirstamp) SynTree/$(DEPDIR)/$(am__dirstamp)933 919 SynTree/driver_cfa_cpp-TypeSubstitution.$(OBJEXT): \ 934 920 SynTree/$(am__dirstamp) SynTree/$(DEPDIR)/$(am__dirstamp) … … 1007 993 @AMDEP_TRUE@@am__include@ @am__quote@ControlStruct/$(DEPDIR)/driver_cfa_cpp-Mutate.Po@am__quote@ 1008 994 @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@1011 995 @AMDEP_TRUE@@am__include@ @am__quote@GenPoly/$(DEPDIR)/driver_cfa_cpp-FindFunction.Po@am__quote@ 1012 996 @AMDEP_TRUE@@am__include@ @am__quote@GenPoly/$(DEPDIR)/driver_cfa_cpp-GenPoly.Po@am__quote@ 1013 997 @AMDEP_TRUE@@am__include@ @am__quote@GenPoly/$(DEPDIR)/driver_cfa_cpp-InstantiateGeneric.Po@am__quote@ 1014 998 @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@1016 999 @AMDEP_TRUE@@am__include@ @am__quote@GenPoly/$(DEPDIR)/driver_cfa_cpp-ScrubTyVars.Po@am__quote@ 1017 1000 @AMDEP_TRUE@@am__include@ @am__quote@GenPoly/$(DEPDIR)/driver_cfa_cpp-Specialize.Po@am__quote@ … … 1056 1039 @AMDEP_TRUE@@am__include@ @am__quote@SymTab/$(DEPDIR)/driver_cfa_cpp-TypeEquality.Po@am__quote@ 1057 1040 @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@1059 1041 @AMDEP_TRUE@@am__include@ @am__quote@SynTree/$(DEPDIR)/driver_cfa_cpp-AddressExpr.Po@am__quote@ 1060 1042 @AMDEP_TRUE@@am__include@ @am__quote@SynTree/$(DEPDIR)/driver_cfa_cpp-AggregateDecl.Po@am__quote@ … … 1450 1432 @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` 1451 1433 1452 GenPoly/driver_cfa_cpp-PolyMutator.o: GenPoly/PolyMutator.cc1453 @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.cc1454 @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) GenPoly/$(DEPDIR)/driver_cfa_cpp-PolyMutator.Tpo GenPoly/$(DEPDIR)/driver_cfa_cpp-PolyMutator.Po1455 @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.cc1458 1459 GenPoly/driver_cfa_cpp-PolyMutator.obj: GenPoly/PolyMutator.cc1460 @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.Po1462 @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 1466 1434 GenPoly/driver_cfa_cpp-ScrubTyVars.o: GenPoly/ScrubTyVars.cc 1467 1435 @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 … … 1506 1474 @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` 1507 1475 1508 GenPoly/driver_cfa_cpp-CopyParams.o: GenPoly/CopyParams.cc1509 @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.cc1510 @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) GenPoly/$(DEPDIR)/driver_cfa_cpp-CopyParams.Tpo GenPoly/$(DEPDIR)/driver_cfa_cpp-CopyParams.Po1511 @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.cc1514 1515 GenPoly/driver_cfa_cpp-CopyParams.obj: GenPoly/CopyParams.cc1516 @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.Po1518 @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 1522 1476 GenPoly/driver_cfa_cpp-FindFunction.o: GenPoly/FindFunction.cc 1523 1477 @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 … … 1534 1488 @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` 1535 1489 1536 GenPoly/driver_cfa_cpp-DeclMutator.o: GenPoly/DeclMutator.cc1537 @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.cc1538 @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) GenPoly/$(DEPDIR)/driver_cfa_cpp-DeclMutator.Tpo GenPoly/$(DEPDIR)/driver_cfa_cpp-DeclMutator.Po1539 @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.cc1542 1543 GenPoly/driver_cfa_cpp-DeclMutator.obj: GenPoly/DeclMutator.cc1544 @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.Po1546 @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 1550 1490 GenPoly/driver_cfa_cpp-InstantiateGeneric.o: GenPoly/InstantiateGeneric.cc 1551 1491 @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 … … 2583 2523 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ 2584 2524 @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 2586 SynTree/driver_cfa_cpp-AddStmtVisitor.o: SynTree/AddStmtVisitor.cc2587 @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.cc2588 @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) SynTree/$(DEPDIR)/driver_cfa_cpp-AddStmtVisitor.Tpo SynTree/$(DEPDIR)/driver_cfa_cpp-AddStmtVisitor.Po2589 @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.cc2592 2593 SynTree/driver_cfa_cpp-AddStmtVisitor.obj: SynTree/AddStmtVisitor.cc2594 @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.Po2596 @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`2599 2525 2600 2526 SynTree/driver_cfa_cpp-TypeSubstitution.o: SynTree/TypeSubstitution.cc -
src/Parser/DeclarationNode.cc
r78315272 r3f7e12cb 9 9 // Author : Rodolfo G. Esteves 10 10 // Created On : Sat May 16 12:34:05 2015 11 // Last Modified By : Andrew Beach12 // Last Modified On : Thr Aug 10 17:02:00201713 // Update Count : 102 111 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Sat Sep 23 18:16:48 2017 13 // Update Count : 1024 14 14 // 15 15 … … 40 40 using namespace std; 41 41 42 // These must remain in the same order asthe corresponding DeclarationNode enumerations.43 const char * DeclarationNode::basicTypeNames[] = { "void", "_Bool", "char", "int", "float", "double", "long double", " NoBasicTypeNames" };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" }; 44 44 const char * DeclarationNode::complexTypeNames[] = { "_Complex", "_Imaginary", "NoComplexTypeNames" }; 45 45 const char * DeclarationNode::signednessNames[] = { "signed", "unsigned", "NoSignednessNames" }; … … 1031 1031 1032 1032 if ( variable.tyClass != NoTypeClass ) { 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." ); 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." ); 1035 1036 assertf( variable.tyClass < sizeof(kindMap)/sizeof(kindMap[0]), "Variable's tyClass is out of bounds." ); 1036 TypeDecl * ret = new TypeDecl( *name, Type::StorageClasses(), nullptr, kindMap[ variable.tyClass ], variable. initializer ? variable.initializer->buildType() : nullptr );1037 TypeDecl * ret = new TypeDecl( *name, Type::StorageClasses(), nullptr, kindMap[ variable.tyClass ], variable.tyClass == Otype, variable.initializer ? variable.initializer->buildType() : nullptr ); 1037 1038 buildList( variable.assertions, ret->get_assertions() ); 1038 1039 return ret; -
src/Parser/ExpressionNode.cc
r78315272 r3f7e12cb 10 10 // Created On : Sat May 16 13:17:07 2015 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Thu Sep 14 23:09:34201713 // Update Count : 69012 // Last Modified On : Wed Sep 27 22:51:55 2017 13 // Update Count : 781 14 14 // 15 15 … … 60 60 static inline bool checkX( char c ) { return c == 'x' || c == 'X'; } 61 61 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 62 95 static void sepNumeric( string & str, string & units ) { 63 96 string::size_type posn = str.find_first_of( "`" ); … … 69 102 70 103 Expression * build_constantInteger( string & str ) { 71 static const BasicType::Kind kind[2][ 5] = {104 static const BasicType::Kind kind[2][6] = { 72 105 // short (h) must be before char (hh) 73 { BasicType::ShortSignedInt, BasicType::SignedChar, BasicType::SignedInt, BasicType::LongSignedInt, BasicType::LongLongSignedInt },74 { BasicType::ShortUnsignedInt, BasicType::UnsignedChar, BasicType::UnsignedInt, BasicType::LongUnsignedInt, BasicType::LongLongUnsignedInt },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, }, 75 108 }; 76 109 77 string units; // units110 string units; 78 111 sepNumeric( str, units ); // separate constant from units 79 112 80 113 bool dec = true, Unsigned = false; // decimal, unsigned constant 81 int size; // 0 => short, 1 => char, 2 => int, 3 => long int, 4 => long long int, 5 => size_t 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 82 117 unsigned long long int v; // converted integral value 83 118 size_t last = str.length() - 1; // last character of constant … … 140 175 } // if 141 176 str.erase( last - size - 1, size + 1 ); // remove 'h'/"hh" 177 } else { // suffix "ln" ? 178 checkLNInt( str, lnth, size ); 142 179 } // if 143 180 } else if ( checkL( str[ last ] ) ) { // suffix 'l' ? … … 163 200 str.erase( last - size, size + 1 ); // remove 'h'/"hh" 164 201 } else if ( checkZ( str[last] ) ) { // suffix 'z' ? 165 size = 5;202 lnth = 4; 166 203 str.erase( last, 1 ); // remove 'z' 167 } // if 168 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. 169 210 ret = new ConstantExpr( Constant( new BasicType( noQualifiers, kind[Unsigned][size] ), str, v ) ); 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.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. 172 213 ret = new CastExpr( ret, new BasicType( Type::Qualifiers(), kind[Unsigned][size] ) ); 173 } else if ( size == 5 ) { // explicit cast to size_t 174 ret = new CastExpr( ret, new TypeInstType( Type::Qualifiers(), "size_t", false ) ); 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 175 221 } // if 176 222 CLEANUP: … … 182 228 return ret; 183 229 } // 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 184 252 185 253 Expression * build_constantFloat( string & str ) { … … 189 257 }; 190 258 191 string units; // units259 string units; 192 260 sepNumeric( str, units ); // separate constant from units 193 261 194 262 bool complx = false; // real, complex 195 int size = 1; // 0 => float, 1 => double (default), 2 => long double 263 int size = 1; // 0 => float, 1 => double, 2 => long double 264 int lnth = -1; // literal length 196 265 // floating-point constant has minimum of 2 characters: 1. or .1 197 266 size_t last = str.length() - 1; … … 211 280 } else if ( checkL( str[last] ) ) { // long double ? 212 281 size = 2; 282 } else { 283 size = 1; // double (default) 284 checkLNFloat( str, lnth, size ); 213 285 } // if 214 286 if ( ! complx && checkI( str[last - 1] ) ) { // imaginary ? … … 216 288 } // if 217 289 290 assert( 0 <= size && size < 3 ); 218 291 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 219 295 if ( units.length() != 0 ) { 220 296 ret = new UntypedExpr( new NameExpr( units ), { ret } ); … … 321 397 322 398 NameExpr * build_varref( const string * name ) { 323 NameExpr * expr = new NameExpr( *name , nullptr);399 NameExpr * expr = new NameExpr( *name ); 324 400 delete name; 325 401 return expr; … … 412 488 list< Expression * > args; 413 489 buildMoveList( expr_node, args ); 414 return new UntypedExpr( maybeMoveBuild< Expression >(function), args , nullptr);490 return new UntypedExpr( maybeMoveBuild< Expression >(function), args ); 415 491 } // build_func 416 492 -
src/Parser/ParseNode.h
r78315272 r3f7e12cb 10 10 // Created On : Sat May 16 13:28:16 2015 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Thu Sep 14 23:09:39201713 // Update Count : 8 1512 // Last Modified On : Sat Sep 23 18:11:22 2017 13 // Update Count : 821 14 14 // 15 15 … … 47 47 #define YYLTYPE_IS_DECLARED 1 /* alert the parser that we have our own definition */ 48 48 49 extern char * yyfilename;50 extern int yylineno;51 49 extern YYLTYPE yylloc; 52 50 … … 197 195 class DeclarationNode : public ParseNode { 198 196 public: 199 enum BasicType { Void, Bool, Char, Int, Float, Double, LongDouble, NoBasicType }; 197 // These enumerations must harmonize with their names. 198 enum BasicType { Void, Bool, Char, Int, Float, Double, LongDouble, Int128, Float80, Float128, NoBasicType }; 199 static const char * basicTypeNames[]; 200 200 enum ComplexType { Complex, Imaginary, NoComplexType }; 201 static const char * complexTypeNames[]; 201 202 enum Signedness { Signed, Unsigned, NoSignedness }; 203 static const char * signednessNames[]; 202 204 enum Length { Short, Long, LongLong, NoLength }; 205 static const char * lengthNames[]; 203 206 enum Aggregate { Struct, Union, Trait, Coroutine, Monitor, Thread, NoAggregate }; 207 static const char * aggregateNames[]; 204 208 enum TypeClass { Otype, Dtype, Ftype, Ttype, NoTypeClass }; 209 static const char * typeClassNames[]; 205 210 enum BuiltinType { Valist, Zero, One, NoBuiltinType }; 206 207 static const char * basicTypeNames[];208 static const char * complexTypeNames[];209 static const char * signednessNames[];210 static const char * lengthNames[];211 static const char * aggregateNames[];212 static const char * typeClassNames[];213 211 static const char * builtinTypeNames[]; 214 212 -
src/Parser/StatementNode.cc
r78315272 r3f7e12cb 234 234 target, 235 235 maybeMoveBuild<Statement >( stmt ), 236 maybeMoveBuild<Expression>( when)236 notZeroExpr( maybeMoveBuild<Expression>( when ) ) 237 237 }); 238 238 … … 250 250 delete targetExpr; 251 251 252 node->clauses. push_back(WaitForStmt::Clause{252 node->clauses.insert( node->clauses.begin(), WaitForStmt::Clause{ 253 253 std::move( target ), 254 254 maybeMoveBuild<Statement >( stmt ), 255 maybeMoveBuild<Expression>( when)255 notZeroExpr( maybeMoveBuild<Expression>( when ) ) 256 256 }); 257 257 … … 265 265 node->timeout.time = maybeMoveBuild<Expression>( timeout ); 266 266 node->timeout.statement = maybeMoveBuild<Statement >( stmt ); 267 node->timeout.condition = maybeMoveBuild<Expression>( when);267 node->timeout.condition = notZeroExpr( maybeMoveBuild<Expression>( when ) ); 268 268 } 269 269 else { 270 node->orelse.statement = maybeMoveBuild<Statement >( stmt 271 node->orelse.condition = maybeMoveBuild<Expression>( when);270 node->orelse.statement = maybeMoveBuild<Statement >( stmt ); 271 node->orelse.condition = notZeroExpr( maybeMoveBuild<Expression>( when ) ); 272 272 } 273 273 … … 280 280 node->timeout.time = maybeMoveBuild<Expression>( timeout ); 281 281 node->timeout.statement = maybeMoveBuild<Statement >( stmt ); 282 node->timeout.condition = maybeMoveBuild<Expression>( when);282 node->timeout.condition = notZeroExpr( maybeMoveBuild<Expression>( when ) ); 283 283 284 284 node->orelse.statement = maybeMoveBuild<Statement >( else_stmt ); 285 node->orelse.condition = maybeMoveBuild<Expression>( else_when);285 node->orelse.condition = notZeroExpr( maybeMoveBuild<Expression>( else_when ) ); 286 286 287 287 return node; 288 288 } 289 290 // WaitForStmt::Target build_waitfor( const std::string * name, ExpressionNode * arguments ) {291 // return WaitForStmt::Clause{292 293 // };294 // }295 289 296 290 Statement *build_compound( StatementNode *first ) { -
src/Parser/TypeData.cc
r78315272 r3f7e12cb 10 10 // Created On : Sat May 16 15:12:51 2015 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Fri Sep 1 23:13:38201713 // Update Count : 5 6912 // Last Modified On : Mon Sep 25 18:33:41 2017 13 // Update Count : 587 14 14 // 15 15 … … 98 98 } // TypeData::TypeData 99 99 100 100 101 TypeData::~TypeData() { 101 102 delete base; … … 161 162 } // switch 162 163 } // TypeData::~TypeData 164 163 165 164 166 TypeData * TypeData::clone() const { … … 235 237 } // TypeData::clone 236 238 239 237 240 void TypeData::print( ostream &os, int indent ) const { 238 241 for ( int i = 0; i < Type::NumTypeQualifier; i += 1 ) { … … 399 402 } // TypeData::print 400 403 404 401 405 template< typename ForallList > 402 406 void buildForall( const DeclarationNode * firstNode, ForallList &outputList ) { 403 407 buildList( firstNode, outputList ); 404 for ( typename ForallList::iterator i = outputList.begin(); i != outputList.end(); ++i ) { 408 auto n = firstNode; 409 for ( typename ForallList::iterator i = outputList.begin(); i != outputList.end(); ++i, n = (DeclarationNode*)n->get_next() ) { 405 410 TypeDecl * td = static_cast<TypeDecl *>(*i); 406 if ( td->get_kind() == TypeDecl::Any) {411 if ( n->variable.tyClass == DeclarationNode::Otype ) { 407 412 // add assertion parameters to `type' tyvars in reverse order 408 413 // add dtor: void ^?{}(T *) … … 430 435 } // if 431 436 } // for 432 } 437 } // buildForall 438 433 439 434 440 Type * typebuild( const TypeData * td ) { … … 477 483 } // typebuild 478 484 485 479 486 TypeData * typeextractAggregate( const TypeData * td, bool toplevel ) { 480 487 TypeData * ret = nullptr; … … 504 511 } // typeextractAggregate 505 512 513 506 514 Type::Qualifiers buildQualifiers( const TypeData * td ) { 507 515 return td->qualifiers; 508 516 } // buildQualifiers 509 517 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 510 523 Type * buildBasicType( const TypeData * td ) { 511 524 BasicType::Kind ret; … … 513 526 switch ( td->basictype ) { 514 527 case DeclarationNode::Void: 515 if ( td->signedness != DeclarationNode::NoSignedness && td->length != DeclarationNode::NoLength ) { 516 throw SemanticError( "invalid type specifier \"void\" in type: ", td ); 517 } // if 518 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 519 534 return new VoidType( buildQualifiers( td ) ); 520 535 break; … … 522 537 case DeclarationNode::Bool: 523 538 if ( td->signedness != DeclarationNode::NoSignedness ) { 524 throw SemanticError( string( "invalid type specifier " ) + DeclarationNode::signednessNames[ td->signedness ] + " in type: ", td);539 genTSError( DeclarationNode::signednessNames[ td->signedness ], td->basictype ); 525 540 } // if 526 541 if ( td->length != DeclarationNode::NoLength ) { 527 throw SemanticError( string( "invalid type specifier " ) + DeclarationNode::lengthNames[ td->length ] + " in type: ", td);542 genTSError( DeclarationNode::lengthNames[ td->length ], td->basictype ); 528 543 } // if 529 544 … … 538 553 539 554 if ( td->length != DeclarationNode::NoLength ) { 540 throw SemanticError( string( "invalid type specifier " ) + DeclarationNode::lengthNames[ td->length ] + " in type: ", td);555 genTSError( DeclarationNode::lengthNames[ td->length ], td->basictype ); 541 556 } // if 542 557 … … 557 572 break; 558 573 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 559 581 case DeclarationNode::Float: 582 case DeclarationNode::Float80: 583 case DeclarationNode::Float128: 560 584 case DeclarationNode::Double: 561 585 case DeclarationNode::LongDouble: // not set until below … … 568 592 FloatingPoint: ; 569 593 if ( td->signedness != DeclarationNode::NoSignedness ) { 570 throw SemanticError( string( "invalid type specifier " ) + DeclarationNode::signednessNames[ td->signedness ] + " in type: ", td);594 genTSError( DeclarationNode::signednessNames[ td->signedness ], td->basictype ); 571 595 } // if 572 596 if ( td->length == DeclarationNode::Short || td->length == DeclarationNode::LongLong ) { 573 throw SemanticError( string( "invalid type specifier " ) + DeclarationNode::lengthNames[ td->length ] + " in type: ", td);597 genTSError( DeclarationNode::lengthNames[ td->length ], td->basictype ); 574 598 } // if 575 599 if ( td->basictype == DeclarationNode::Float && td->length == DeclarationNode::Long ) { 576 throw SemanticError( "invalid type specifier \"long\" in type: ", td);600 genTSError( DeclarationNode::lengthNames[ td->length ], td->basictype ); 577 601 } // if 578 602 if ( td->length == DeclarationNode::Long ) { … … 593 617 goto Integral; 594 618 default: 595 assert (false);619 assertf( false, "unknown basic type" ); 596 620 return nullptr; 597 621 } // switch … … 601 625 return bt; 602 626 } // buildBasicType 627 603 628 604 629 PointerType * buildPointer( const TypeData * td ) { … … 612 637 return pt; 613 638 } // buildPointer 639 614 640 615 641 ArrayType * buildArray( const TypeData * td ) { … … 626 652 } // buildArray 627 653 654 628 655 ReferenceType * buildReference( const TypeData * td ) { 629 656 ReferenceType * rt; … … 637 664 } // buildReference 638 665 666 639 667 AggregateDecl * buildAggregate( const TypeData * td, std::list< Attribute * > attributes, LinkageSpec::Spec linkage ) { 640 668 assert( td->kind == TypeData::Aggregate ); … … 665 693 return at; 666 694 } // buildAggregate 695 667 696 668 697 ReferenceToType * buildComAggInst( const TypeData * type, std::list< Attribute * > attributes, LinkageSpec::Spec linkage ) { … … 722 751 } // buildAggInst 723 752 753 724 754 ReferenceToType * buildAggInst( const TypeData * td ) { 725 755 assert( td->kind == TypeData::AggregateInst ); … … 761 791 } // buildAggInst 762 792 793 763 794 NamedTypeDecl * buildSymbolic( const TypeData * td, const string & name, Type::StorageClasses scs, LinkageSpec::Spec linkage ) { 764 795 assert( td->kind == TypeData::Symbolic ); … … 768 799 ret = new TypedefDecl( name, scs, typebuild( td->base ), linkage ); 769 800 } else { 770 ret = new TypeDecl( name, scs, typebuild( td->base ), TypeDecl:: Any);801 ret = new TypeDecl( name, scs, typebuild( td->base ), TypeDecl::Dtype, true ); 771 802 } // if 772 803 buildList( td->symbolic.params, ret->get_parameters() ); … … 774 805 return ret; 775 806 } // buildSymbolic 807 776 808 777 809 EnumDecl * buildEnum( const TypeData * td, std::list< Attribute * > attributes, LinkageSpec::Spec linkage ) { … … 790 822 } // buildEnum 791 823 824 792 825 TypeInstType * buildSymbolicInst( const TypeData * td ) { 793 826 assert( td->kind == TypeData::SymbolicInst ); … … 797 830 return ret; 798 831 } // buildSymbolicInst 832 799 833 800 834 TupleType * buildTuple( const TypeData * td ) { … … 807 841 } // buildTuple 808 842 843 809 844 TypeofType * buildTypeof( const TypeData * td ) { 810 845 assert( td->kind == TypeData::Typeof ); … … 813 848 return new TypeofType( buildQualifiers( td ), td->typeexpr->build() ); 814 849 } // buildTypeof 850 815 851 816 852 Declaration * 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 ) { … … 836 872 return nullptr; 837 873 } // buildDecl 874 838 875 839 876 FunctionType * buildFunction( const TypeData * td ) { … … 857 894 return ft; 858 895 } // buildFunction 896 859 897 860 898 // Transform KR routine declarations into C99 routine declarations: -
src/Parser/lex.ll
r78315272 r3f7e12cb 10 10 * Created On : Sat Sep 22 08:58:10 2001 11 11 * Last Modified By : Peter A. Buhr 12 * Last Modified On : Sun Sep 10 22:29:15201713 * Update Count : 6 2012 * Last Modified On : Wed Oct 25 13:53:56 2017 13 * Update Count : 634 14 14 */ 15 15 … … 93 93 // numeric constants, CFA: '_' in constant 94 94 hex_quad {hex}("_"?{hex}){3} 95 length ("ll"|"LL"|[lL])|("hh"|"HH"|[hH]) 95 size_opt (8|16|32|64|128)? 96 length ("ll"|"LL"|[lL]{size_opt})|("hh"|"HH"|[hH]) 96 97 integer_suffix_opt ("_"?(([uU]({length}?[iI]?)|([iI]{length}))|([iI]({length}?[uU]?)|([uU]{length}))|({length}([iI]?[uU]?)|([uU][iI]))|[zZ]))?{user_suffix_opt} 97 98 … … 109 110 // GCC: D (double) and iI (imaginary) suffixes, and DL (long double) 110 111 exponent "_"?[eE]"_"?[+-]?{decimal_digits} 111 floating_suffix ([fFdDlL]?[iI]?)|([iI][lLfFdD]) 112 floating_size 32|64|80|128 113 floating_length ([fFdDlL]|[lL]{floating_size}) 114 floating_suffix ({floating_length}?[iI]?)|([iI]{floating_length}) 112 115 floating_suffix_opt ("_"?({floating_suffix}|"DL"))?{user_suffix_opt} 113 116 decimal_digits ({decimal})|({decimal}({decimal}|"_")*{decimal}) … … 230 233 __extension__ { KEYWORD_RETURN(EXTENSION); } // GCC 231 234 extern { KEYWORD_RETURN(EXTERN); } 232 fallthrough { KEYWORD_RETURN(FALLTHRU); } // CFA233 235 fallthru { KEYWORD_RETURN(FALLTHRU); } // CFA 236 fallthrough { KEYWORD_RETURN(FALLTHROUGH); } // CFA 234 237 finally { KEYWORD_RETURN(FINALLY); } // CFA 235 238 float { KEYWORD_RETURN(FLOAT); } 236 __float128 { KEYWORD_RETURN(FLOAT); } // GCC 239 __float80 { KEYWORD_RETURN(FLOAT80); } // GCC 240 float80 { KEYWORD_RETURN(FLOAT80); } // GCC 241 __float128 { KEYWORD_RETURN(FLOAT128); } // GCC 242 float128 { KEYWORD_RETURN(FLOAT128); } // GCC 237 243 for { KEYWORD_RETURN(FOR); } 238 244 forall { KEYWORD_RETURN(FORALL); } // CFA … … 249 255 __inline__ { KEYWORD_RETURN(INLINE); } // GCC 250 256 int { KEYWORD_RETURN(INT); } 251 __int128 { KEYWORD_RETURN(INT ); } // GCC252 __int128_t { KEYWORD_RETURN(INT); } // GCC257 __int128 { KEYWORD_RETURN(INT128); } // GCC 258 int128 { KEYWORD_RETURN(INT128); } // GCC 253 259 __label__ { KEYWORD_RETURN(LABEL); } // GCC 254 260 long { KEYWORD_RETURN(LONG); } … … 285 291 __typeof { KEYWORD_RETURN(TYPEOF); } // GCC 286 292 __typeof__ { KEYWORD_RETURN(TYPEOF); } // GCC 287 __uint128_t { KEYWORD_RETURN(INT); } // GCC288 293 union { KEYWORD_RETURN(UNION); } 289 294 unsigned { KEYWORD_RETURN(UNSIGNED); } -
src/Parser/parser.yy
r78315272 r3f7e12cb 10 10 // Created On : Sat Sep 1 20:22:55 2001 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Thu Sep 14 23:07:12201713 // Update Count : 28 1512 // Last Modified On : Wed Oct 25 12:28:54 2017 13 // Update Count : 2893 14 14 // 15 15 … … 43 43 #define YYDEBUG_LEXER_TEXT (yylval) // lexer loads this up each time 44 44 #define YYDEBUG 1 // get the pretty debugging code to compile 45 #define YYERROR_VERBOSE 45 #define YYERROR_VERBOSE // more information in syntax errors 46 46 47 47 #undef __GNUC_MINOR__ … … 117 117 bool forall = false; // aggregate have one or more forall qualifiers ? 118 118 119 # define YYLLOC_DEFAULT(Cur, Rhs, N) \ 120 do \ 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 } \ 134 while (0) 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 } 135 132 %} 136 133 137 134 %define parse.error verbose 138 135 139 // Types declaration 136 // Types declaration for productions 140 137 %union 141 138 { … … 173 170 %token VOID CHAR SHORT INT LONG FLOAT DOUBLE SIGNED UNSIGNED 174 171 %token BOOL COMPLEX IMAGINARY // C99 172 %token INT128 FLOAT80 FLOAT128 // GCC 175 173 %token ZERO_T ONE_T // CFA 176 174 %token VALIST // GCC … … 182 180 %token ATTRIBUTE EXTENSION // GCC 183 181 %token IF ELSE SWITCH CASE DEFAULT DO WHILE FOR BREAK CONTINUE GOTO RETURN 184 %token CHOOSE DISABLE ENABLE FALLTHRU TRY CATCH CATCHRESUME FINALLY THROW THROWRESUME AT WITH WHEN WAITFOR // CFA182 %token CHOOSE DISABLE ENABLE FALLTHRU FALLTHROUGH TRY CATCH CATCHRESUME FINALLY THROW THROWRESUME AT WITH WHEN WAITFOR // CFA 185 183 %token ASM // C99, extension ISO/IEC 9899:1999 Section J.5.10(1) 186 184 %token ALIGNAS ALIGNOF GENERIC STATICASSERT // C11 … … 252 250 %type<sn> exception_statement handler_clause finally_clause 253 251 %type<catch_kind> handler_key 252 %type<sn> mutex_statement 254 253 %type<en> when_clause when_clause_opt waitfor timeout 255 254 %type<sn> waitfor_statement … … 363 362 %precedence ELSE // token precedence for start of else clause in IF/WAITFOR statement 364 363 365 %locations 364 %locations // support location tracking for error messages 366 365 367 366 %start translation_unit // parse-tree root … … 458 457 | '(' compound_statement ')' // GCC, lambda expression 459 458 { $$ = new ExpressionNode( new StmtExpr( dynamic_cast< CompoundStmt * >(maybeMoveBuild< Statement >($2) ) ) ); } 460 | primary_expression '{' argument_expression_list '}' // CFA, constructor call461 {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 }466 459 | type_name '.' no_attr_identifier // CFA, nested type 467 { $$ = nullptr; } // FIX ME460 { throw SemanticError("Qualified names are currently unimplemented."); $$ = nullptr; } // FIX ME 468 461 | type_name '.' '[' push field_list pop ']' // CFA, nested type / tuple field selector 469 { $$ = nullptr; } // FIX ME462 { throw SemanticError("Qualified names are currently unimplemented."); $$ = nullptr; } // FIX ME 470 463 ; 471 464 … … 478 471 // equivalent to the old x[i,j]. 479 472 { $$ = 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 } 480 479 | postfix_expression '(' argument_expression_list ')' 481 480 { $$ = new ExpressionNode( build_func( $1, $3 ) ); } … … 809 808 | jump_statement 810 809 | with_statement 810 | mutex_statement 811 811 | waitfor_statement 812 812 | exception_statement … … 974 974 ; 975 975 976 fall_through_name: // CFA 977 FALLTHRU 978 | FALLTHROUGH 979 ; 980 976 981 fall_through: // CFA 977 FALLTHRU982 fall_through_name 978 983 { $$ = nullptr; } 979 | FALLTHRU';'984 | fall_through_name ';' 980 985 { $$ = nullptr; } 981 986 ; … … 1033 1038 ; 1034 1039 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 1035 1046 when_clause: 1036 1047 WHEN '(' comma_expression ')' … … 1551 1562 | VOLATILE 1552 1563 { $$ = DeclarationNode::newTypeQualifier( Type::Volatile ); } 1553 | MUTEX1554 { $$ = DeclarationNode::newTypeQualifier( Type::Mutex ); }1555 1564 | ATOMIC 1556 1565 { $$ = DeclarationNode::newTypeQualifier( Type::Atomic ); } … … 1606 1615 1607 1616 basic_type_name: 1608 CHAR 1617 VOID 1618 { $$ = DeclarationNode::newBasicType( DeclarationNode::Void ); } 1619 | BOOL // C99 1620 { $$ = DeclarationNode::newBasicType( DeclarationNode::Bool ); } 1621 | CHAR 1609 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 ); } 1610 1633 | DOUBLE 1611 1634 { $$ = 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 ); } 1635 | COMPLEX // C99 1636 { $$ = DeclarationNode::newComplexType( DeclarationNode::Complex ); } 1637 | IMAGINARY // C99 1638 { $$ = DeclarationNode::newComplexType( DeclarationNode::Imaginary ); } 1620 1639 | SIGNED 1621 1640 { $$ = DeclarationNode::newSignedNess( DeclarationNode::Signed ); } 1622 1641 | UNSIGNED 1623 1642 { $$ = DeclarationNode::newSignedNess( DeclarationNode::Unsigned ); } 1624 | VOID 1625 { $$ = DeclarationNode::newBasicType( DeclarationNode::Void ); } 1626 | BOOL // C99 1627 { $$ = DeclarationNode::newBasicType( DeclarationNode::Bool ); } 1628 | COMPLEX // C99 1629 { $$ = DeclarationNode::newComplexType( DeclarationNode::Complex ); } 1630 | IMAGINARY // C99 1631 { $$ = DeclarationNode::newComplexType( DeclarationNode::Imaginary ); } 1643 | SHORT 1644 { $$ = DeclarationNode::newLength( DeclarationNode::Short ); } 1645 | LONG 1646 { $$ = DeclarationNode::newLength( DeclarationNode::Long ); } 1632 1647 | ZERO_T 1633 1648 { $$ = DeclarationNode::newBuiltinType( DeclarationNode::Zero ); } … … 2476 2491 | TYPEDEFname 2477 2492 | TYPEGENname 2493 | FALLTHROUGH 2494 { $$ = Token{ new string( "fallthrough" ), { nullptr, -1 } }; } 2478 2495 | CONST 2479 2496 { $$ = Token{ new string( "__const__" ), { nullptr, -1 } }; } … … 2699 2716 paren_identifier attribute_list_opt 2700 2717 { $$ = $1->addQualifiers( $2 ); } 2718 | '&' MUTEX paren_identifier attribute_list_opt 2719 { $$ = $3->addPointer( DeclarationNode::newPointer( DeclarationNode::newTypeQualifier( Type::Mutex ), OperKinds::AddressOf ) )->addQualifiers( $4 ); } 2701 2720 | identifier_parameter_ptr 2702 2721 | identifier_parameter_array attribute_list_opt … … 2739 2758 // 2740 2759 // typedef int foo; 2760 // forall( otype T ) struct foo; 2741 2761 // int f( int foo ); // redefine typedef name in new scope 2742 2762 // … … 2746 2766 typedef attribute_list_opt 2747 2767 { $$ = $1->addQualifiers( $2 ); } 2768 | '&' MUTEX typedef attribute_list_opt 2769 { $$ = $3->addPointer( DeclarationNode::newPointer( DeclarationNode::newTypeQualifier( Type::Mutex ), OperKinds::AddressOf ) )->addQualifiers( $4 ); } 2748 2770 | type_parameter_ptr 2749 2771 | type_parameter_array attribute_list_opt … … 2892 2914 abstract_parameter_declarator: 2893 2915 abstract_parameter_ptr 2916 | '&' MUTEX attribute_list_opt 2917 { $$ = DeclarationNode::newPointer( DeclarationNode::newTypeQualifier( Type::Mutex ), OperKinds::AddressOf )->addQualifiers( $3 ); } 2894 2918 | abstract_parameter_array attribute_list_opt 2895 2919 { $$ = $1->addQualifiers( $2 ); } -
src/Parser/parserutility.cc
r78315272 r3f7e12cb 29 29 30 30 Expression *notZeroExpr( Expression *orig ) { 31 if( !orig ) return nullptr; 31 32 UntypedExpr *comparison = new UntypedExpr( new NameExpr( "?!=?" ) ); 32 33 comparison->get_args().push_back( orig ); -
src/ResolvExpr/AdjustExprType.cc
r78315272 r3f7e12cb 14 14 // 15 15 16 #include "Common/PassVisitor.h" 16 17 #include "SymTab/Indexer.h" // for Indexer 17 18 #include "SynTree/Declaration.h" // for TypeDecl, TypeDecl::Kind::Ftype … … 21 22 22 23 namespace ResolvExpr { 23 class AdjustExprType : public Mutator { 24 typedef Mutator Parent; 25 using Parent::mutate; 24 class AdjustExprType : public WithShortCircuiting { 26 25 public: 27 26 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; } 41 42 Type * postmutate( ArrayType *arrayType ); 43 Type * postmutate( FunctionType *functionType ); 44 Type * postmutate( TypeInstType *aggregateUseType ); 45 28 46 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 );43 44 47 const TypeEnvironment &env; 45 48 const SymTab::Indexer &indexer; … … 47 50 48 51 void adjustExprType( Type *&type, const TypeEnvironment &env, const SymTab::Indexer &indexer ) { 49 AdjustExprTypeadjuster( env, indexer );52 PassVisitor<AdjustExprType> adjuster( env, indexer ); 50 53 Type *newType = type->acceptMutator( adjuster ); 51 54 type = newType; … … 56 59 } 57 60 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 ) ); 61 Type * AdjustExprType::postmutate( ArrayType * arrayType ) { 62 PointerType *pointerType = new PointerType( arrayType->get_qualifiers(), arrayType->base ); 63 arrayType->base = nullptr; 73 64 delete arrayType; 74 65 return pointerType; 75 66 } 76 67 77 Type *AdjustExprType::mutate( FunctionType *functionType ) { 78 PointerType *pointerType = new PointerType( Type::Qualifiers(), functionType ); 79 return pointerType; 68 Type * AdjustExprType::postmutate( FunctionType * functionType ) { 69 return new PointerType( Type::Qualifiers(), functionType ); 80 70 } 81 71 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 ) { 72 Type * AdjustExprType::postmutate( TypeInstType * typeInst ) { 99 73 EqvClass eqvClass; 100 74 if ( env.lookup( typeInst->get_name(), eqvClass ) ) { … … 113 87 return typeInst; 114 88 } 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 }131 89 } // namespace ResolvExpr 132 90 -
src/ResolvExpr/Alternative.cc
r78315272 r3f7e12cb 66 66 } 67 67 68 void Alternative::print( std::ostream &os, intindent ) const {69 os << std::string( indent, ' ' ) <<"Cost " << cost << ": ";68 void Alternative::print( std::ostream &os, Indenter indent ) const { 69 os << "Cost " << cost << ": "; 70 70 if ( expr ) { 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;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; 76 76 } else { 77 77 os << "Null expression!" << std::endl; 78 78 } // if 79 os << std::string( indent, ' ' )<< "Environment: ";80 env.print( os, indent+ 2);79 os << indent << "Environment: "; 80 env.print( os, indent+1 ); 81 81 os << std::endl; 82 82 } -
src/ResolvExpr/Alternative.h
r78315272 r3f7e12cb 39 39 ~Alternative(); 40 40 41 void print( std::ostream &os, int indent = 0) const;41 void print( std::ostream &os, Indenter indent = {} ) const; 42 42 43 43 Cost cost; -
src/ResolvExpr/AlternativeFinder.cc
r78315272 r3f7e12cb 76 76 77 77 namespace { 78 void printAlts( const AltList &list, std::ostream &os, int indent = 0 ) { 78 void printAlts( const AltList &list, std::ostream &os, unsigned int indentAmt = 0 ) { 79 Indenter indent = { Indenter::tabsize, indentAmt }; 79 80 for ( AltList::const_iterator i = list.begin(); i != list.end(); ++i ) { 80 81 i->print( os, indent ); … … 122 123 ) 123 124 mapPlace->second.isAmbiguous = true; 125 } else { 126 PRINT( 127 std::cerr << "cost " << candidate->cost << " loses to " << mapPlace->second.candidate->cost << std::endl; 128 ) 124 129 } 125 130 } else { … … 127 132 } 128 133 } 129 130 PRINT(131 std::cerr << "there are " << selected.size() << " alternatives before elimination" << std::endl;132 )133 134 134 135 // accept the alternatives that were unambiguous … … 145 146 expr->get_result()->accept( global_renamer ); 146 147 } 147 148 void referenceToRvalueConversion( Expression *& expr ) {149 if ( dynamic_cast< ReferenceType * >( expr->get_result() ) ) {150 // cast away reference from expr151 expr = new CastExpr( expr, expr->get_result()->stripReferences()->clone() );152 }153 }154 148 } // 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 } 155 156 156 157 template< typename InputIterator, typename OutputIterator > … … 175 176 } 176 177 177 void AlternativeFinder::find( Expression *expr, bool adjust, bool prune ) {178 void AlternativeFinder::find( Expression *expr, bool adjust, bool prune, bool failFast ) { 178 179 expr->accept( *this ); 179 if ( alternatives.empty() ) {180 if ( failFast && alternatives.empty() ) { 180 181 throw SemanticError( "No reasonable alternatives for expression ", expr ); 181 182 } 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 }187 183 if ( prune ) { 184 auto oldsize = alternatives.size(); 188 185 PRINT( 189 186 std::cerr << "alternatives before prune:" << std::endl; … … 192 189 AltList::iterator oldBegin = alternatives.begin(); 193 190 pruneAlternatives( alternatives.begin(), alternatives.end(), front_inserter( alternatives ) ); 194 if ( alternatives.begin() == oldBegin ) {191 if ( failFast && alternatives.begin() == oldBegin ) { 195 192 std::ostringstream stream; 196 193 AltList winners; 197 194 findMinCost( alternatives.begin(), alternatives.end(), back_inserter( winners ) ); 198 stream << "Cannot choose between " << winners.size() << " alternatives for expression 195 stream << "Cannot choose between " << winners.size() << " alternatives for expression\n"; 199 196 expr->print( stream ); 200 stream << "Alternatives are: ";201 printAlts( winners, stream, 8);197 stream << "Alternatives are:\n"; 198 printAlts( winners, stream, 1 ); 202 199 throw SemanticError( stream.str() ); 203 200 } 204 201 alternatives.erase( oldBegin, alternatives.end() ); 202 PRINT( 203 std::cerr << "there are " << oldsize << " alternatives before elimination" << std::endl; 204 ) 205 205 PRINT( 206 206 std::cerr << "there are " << alternatives.size() << " alternatives after elimination" << std::endl; 207 207 ) 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 } 208 214 } 209 215 … … 215 221 } 216 222 217 void AlternativeFinder::findWithAdjustment( Expression *expr, bool prune ) { 218 find( expr, true, prune ); 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 ); 219 233 } 220 234 … … 299 313 Cost convCost = conversionCost( actualType, formalType, indexer, env ); 300 314 PRINT( 301 std::cerr << std::endl << "cost is " << convCost << std::endl;315 std::cerr << std::endl << "cost is " << convCost << std::endl; 302 316 ) 303 317 if ( convCost == Cost::infinity ) { … … 305 319 } 306 320 convCost.incPoly( polyCost( formalType, env, indexer ) + polyCost( actualType, env, indexer ) ); 321 PRINT( 322 std::cerr << "cost with polycost is " << convCost << std::endl; 323 ) 307 324 return convCost; 308 325 } … … 310 327 Cost computeExpressionConversionCost( Expression *& actualExpr, Type * formalType, const SymTab::Indexer &indexer, const TypeEnvironment & env ) { 311 328 Cost convCost = computeConversionCost( actualExpr->result, formalType, indexer, env ); 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. 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. 317 333 Cost tmpCost = convCost; 318 334 tmpCost.incPoly( -tmpCost.get_polyCost() ); … … 357 373 if ( function->get_isVarArgs() ) { 358 374 convCost.incUnsafe(); 375 PRINT( std::cerr << "end of formals with varargs function: inc unsafe: " << convCost << std::endl; ; ) 359 376 // convert reference-typed expressions to value-typed expressions 360 377 referenceToRvalueConversion( *actualExpr ); … … 365 382 } 366 383 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 )376 384 convCost += computeExpressionConversionCost( *actualExpr, formalType, indexer, alt.env ); 377 385 ++formal; // can't be in for-loop update because of the continue … … 481 489 Alternative newerAlt( newAlt ); 482 490 newerAlt.env = newEnv; 483 assert ( (*candidate)->get_uniqueId() );491 assertf( (*candidate)->get_uniqueId(), "Assertion candidate does not have a unique ID: %s", toString( *candidate ).c_str() ); 484 492 DeclarationWithType *candDecl = static_cast< DeclarationWithType* >( Declaration::declFromId( (*candidate)->get_uniqueId() ) ); 485 493 … … 507 515 std::cerr << std::endl; 508 516 ) 509 ApplicationExpr *appExpr = static_cast< ApplicationExpr* >( newerAlt.expr );510 517 // 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). 511 InferredParams * inferParameters = & appExpr->get_inferParams();518 InferredParams * inferParameters = &newerAlt.expr->get_inferParams(); 512 519 for ( UniqueId id : cur->second.idChain ) { 513 520 inferParameters = (*inferParameters)[ id ].inferParams.get(); … … 786 793 787 794 return ! results.empty(); 788 } 795 } 789 796 790 797 template<typename OutputIterator> 791 void AlternativeFinder::makeFunctionAlternatives( const Alternative &func,792 FunctionType * funcType, const std::vector< AlternativeFinder >&args,798 void AlternativeFinder::makeFunctionAlternatives( const Alternative &func, 799 FunctionType *funcType, const std::vector< AlternativeFinder > &args, 793 800 OutputIterator out ) { 794 801 OpenVarSet funcOpenVars; 795 802 AssertionSet funcNeed, funcHave; 796 TypeEnvironment funcEnv ;803 TypeEnvironment funcEnv( func.env ); 797 804 makeUnifiableVars( funcType, funcOpenVars, funcNeed ); 798 805 // add all type variables as open variables now so that those not used in the parameter 799 806 // list are still considered open. 800 807 funcEnv.add( funcType->get_forall() ); 801 808 802 809 if ( targetType && ! targetType->isVoid() && ! funcType->get_returnVals().empty() ) { 803 810 // attempt to narrow based on expected target type 804 Type * returnType = funcType->get_returnVals().front()->get_type();811 Type * returnType = funcType->get_returnVals().front()->get_type(); 805 812 if ( ! unify( returnType, targetType, funcEnv, funcNeed, funcHave, funcOpenVars, 806 813 indexer ) ) { … … 905 912 906 913 // find function operators 914 static NameExpr *opExpr = new NameExpr( "?()" ); 907 915 AlternativeFinder funcOpFinder( indexer, env ); 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 } 916 // it's ok if there aren't any defined function ops 917 funcOpFinder.maybeFind( opExpr); 914 918 PRINT( 915 919 std::cerr << "known function ops:" << std::endl; 916 printAlts( funcOpFinder.alternatives, std::cerr, 8);920 printAlts( funcOpFinder.alternatives, std::cerr, 1 ); 917 921 ) 918 922 … … 1028 1032 bool isLvalue( Expression *expr ) { 1029 1033 // xxx - recurse into tuples? 1030 return expr-> has_result()&& ( expr->get_result()->get_lvalue() || dynamic_cast< ReferenceType * >( expr->get_result() ) );1034 return expr->result && ( expr->get_result()->get_lvalue() || dynamic_cast< ReferenceType * >( expr->get_result() ) ); 1031 1035 } 1032 1036 … … 1103 1107 thisCost.incSafe( discardedValues ); 1104 1108 Alternative newAlt( restructureCast( i->expr->clone(), toType ), i->env, i->cost, thisCost ); 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 ) ); 1109 inferParameters( needAssertions, haveAssertions, newAlt, openVars, back_inserter( candidates ) ); 1110 1110 } // if 1111 1111 } // for … … 1123 1123 AlternativeFinder finder( indexer, env ); 1124 1124 // don't prune here, since it's guaranteed all alternatives will have the same type 1125 // (giving the alternatives different types is half of the point of ConstructorExpr nodes) 1126 finder.findWithAdjustment( castExpr->get_arg(), false ); 1125 finder.findWithoutPrune( castExpr->get_arg() ); 1127 1126 for ( Alternative & alt : finder.alternatives ) { 1128 1127 alternatives.push_back( Alternative( … … 1163 1162 PRINT( std::cerr << "nameExpr is " << nameExpr->get_name() << std::endl; ) 1164 1163 for ( std::list< DeclarationWithType* >::iterator i = declList.begin(); i != declList.end(); ++i ) { 1165 VariableExpr newExpr( *i , nameExpr->get_argName());1164 VariableExpr newExpr( *i ); 1166 1165 alternatives.push_back( Alternative( newExpr.clone(), env, Cost::zero ) ); 1167 1166 PRINT( … … 1398 1397 findSubExprs( tupleExpr->get_exprs().begin(), tupleExpr->get_exprs().end(), back_inserter( subExprAlternatives ) ); 1399 1398 std::list< AltList > possibilities; 1400 // TODO re-write to use iterative method1401 1399 combos( subExprAlternatives.begin(), subExprAlternatives.end(), back_inserter( possibilities ) ); 1402 1400 for ( std::list< AltList >::const_iterator i = possibilities.begin(); i != possibilities.end(); ++i ) { … … 1422 1420 // don't prune here, since it's guaranteed all alternatives will have the same type 1423 1421 // (giving the alternatives different types is half of the point of ConstructorExpr nodes) 1424 finder.findWith Adjustment( ctorExpr->get_callExpr(), false);1422 finder.findWithoutPrune( ctorExpr->get_callExpr() ); 1425 1423 for ( Alternative & alt : finder.alternatives ) { 1426 1424 alternatives.push_back( Alternative( new ConstructorExpr( alt.expr->clone() ), alt.env, alt.cost ) ); … … 1459 1457 // O(N^2) checks of d-types with e-types 1460 1458 for ( InitAlternative & initAlt : initExpr->get_initAlts() ) { 1461 Type * toType = resolveTypeof( initAlt.type , indexer );1459 Type * toType = resolveTypeof( initAlt.type->clone(), indexer ); 1462 1460 SymTab::validateType( toType, &indexer ); 1463 1461 adjustExprType( toType, env, indexer ); … … 1488 1486 // count one safe conversion for each value that is thrown away 1489 1487 thisCost.incSafe( discardedValues ); 1490 candidates.push_back( Alternative( new InitExpr( restructureCast( alt.expr->clone(), toType ), initAlt.designation->clone() ), newEnv, alt.cost, thisCost ) ); 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 ) ); 1491 1490 } 1492 1491 } -
src/ResolvExpr/AlternativeFinder.h
r78315272 r3f7e12cb 61 61 } 62 62 63 void find( Expression *expr, bool adjust = false, bool prune = true );63 void find( Expression *expr, bool adjust = false, bool prune = true, bool failFast = true ); 64 64 /// Calls find with the adjust flag set; adjustment turns array and function types into equivalent pointer types 65 void findWithAdjustment( Expression *expr, bool prune = true ); 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 ); 66 70 AltList &get_alternatives() { return alternatives; } 67 71 … … 77 81 const SymTab::Indexer &get_indexer() const { return indexer; } 78 82 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 ); 79 88 private: 80 89 virtual void visit( ApplicationExpr *applicationExpr ); … … 108 117 virtual void visit( StmtExpr *stmtExpr ); 109 118 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 );114 119 115 120 /// Adds alternatives for anonymous members … … 134 139 135 140 Expression *resolveInVoidContext( Expression *expr, const SymTab::Indexer &indexer, TypeEnvironment &env ); 141 void referenceToRvalueConversion( Expression *& expr ); 136 142 137 143 template< typename InputIterator, typename OutputIterator > -
src/ResolvExpr/CastCost.cc
r78315272 r3f7e12cb 24 24 #include "typeops.h" // for typesCompatibleIgnoreQualifiers 25 25 26 #if 0 27 #define PRINT(x) x 28 #else 29 #define PRINT(x) 30 #endif 26 31 27 32 namespace ResolvExpr { … … 52 57 } // if 53 58 } // 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 54 69 if ( typesCompatibleIgnoreQualifiers( src, dest, indexer, env ) ) { 70 PRINT( std::cerr << "compatible!" << std::endl; ) 55 71 return Cost::zero; 56 72 } else if ( dynamic_cast< VoidType* >( dest ) ) { 57 73 return Cost::safe; 58 74 } else if ( ReferenceType * refType = dynamic_cast< ReferenceType * > ( dest ) ) { 75 PRINT( std::cerr << "conversionCost: dest is reference" << std::endl; ) 59 76 return convertToReferenceCost( src, refType, indexer, env, [](Type * t1, Type * t2, const TypeEnvironment & env, const SymTab::Indexer & indexer) { 60 77 return ptrsCastable( t1, t2, env, indexer ); -
src/ResolvExpr/CommonType.cc
r78315272 r3f7e12cb 10 10 // Created On : Sun May 17 06:59:27 2015 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Thu Mar 16 16:24:31201713 // Update Count : 712 // Last Modified On : Mon Sep 25 15:18:17 2017 13 // Update Count : 9 14 14 // 15 15 … … 61 61 }; 62 62 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;63 Type * handleReference( Type * t1, Type * t2, bool widenFirst, bool widenSecond, const SymTab::Indexer &indexer, TypeEnvironment & env, const OpenVarSet &openVars ) { 64 Type * common = nullptr; 65 65 AssertionSet have, need; 66 66 OpenVarSet newOpen( openVars ); 67 67 // need unify to bind type variables 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; 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; 88 79 } 89 80 … … 99 90 100 91 // special case where one type has a reference depth of 1 larger than the other 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 ); 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; 105 105 } 106 106 // otherwise, both are reference types of the same depth and this is handled by the CommonType visitor. … … 150 150 static const BasicType::Kind combinedType[ BasicType::NUMBER_OF_BASIC_TYPES ][ BasicType::NUMBER_OF_BASIC_TYPES ] = 151 151 { 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 } 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, }, 174 176 }; 175 177 -
src/ResolvExpr/ConversionCost.cc
r78315272 r3f7e12cb 10 10 // Created On : Sun May 17 07:06:19 2015 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Wed Mar 2 17:35:46 201613 // Update Count : 612 // Last Modified On : Mon Sep 25 15:43:34 2017 13 // Update Count : 10 14 14 // 15 15 … … 28 28 29 29 namespace 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 ); 36 36 37 37 #if 0 … … 113 113 int assignResult = func( srcAsRef->get_base(), destAsRef->get_base(), env, indexer ); 114 114 PRINT( std::cerr << "comparing references: " << assignResult << " " << srcAsRef << " " << destAsRef << std::endl; ) 115 if ( assignResult <0 ) {115 if ( assignResult > 0 ) { 116 116 return Cost::safe; 117 } else if ( assignResult >0 ) {117 } else if ( assignResult < 0 ) { 118 118 return Cost::unsafe; 119 119 } // if … … 219 219 */ 220 220 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 } 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, }, 245 248 }; 246 249 … … 266 269 } 267 270 268 void ConversionCost::visit( PointerType *pointerType) {271 void ConversionCost::visit( PointerType * pointerType ) { 269 272 if ( PointerType *destAsPtr = dynamic_cast< PointerType* >( dest ) ) { 270 273 PRINT( std::cerr << pointerType << " ===> " << destAsPtr; ) … … 281 284 } 282 285 } else { // xxx - this discards qualifiers from consideration -- reducing qualifiers is a safe conversion; is this right? 283 int assignResult = ptrsAssignable( pointerType-> get_base(), destAsPtr->get_base(), env );286 int assignResult = ptrsAssignable( pointerType->base, destAsPtr->base, env ); 284 287 PRINT( std::cerr << " :: " << assignResult << std::endl; ) 285 if ( assignResult <0 && pointerType->get_base()->get_qualifiers() <= destAsPtr->get_qualifiers() ) {288 if ( assignResult > 0 && pointerType->get_base()->get_qualifiers() <= destAsPtr->get_qualifiers() ) { 286 289 cost = Cost::safe; 287 } else if ( assignResult >0 ) {290 } else if ( assignResult < 0 ) { 288 291 cost = Cost::unsafe; 289 292 } // if 290 293 // assignResult == 0 means Cost::Infinity 291 294 } // if 292 } else if ( dynamic_cast< ZeroType * >( dest ) != nullptr || dynamic_cast< OneType* >( dest ) != nullptr) {295 } else if ( dynamic_cast< ZeroType * >( dest ) ) { 293 296 cost = Cost::unsafe; 294 297 } // if 295 298 } 296 299 297 void ConversionCost::visit( __attribute((unused)) ArrayType *arrayType) {}298 299 void ConversionCost::visit( ReferenceType *refType) {300 void ConversionCost::visit( ArrayType * ) {} 301 302 void ConversionCost::visit( ReferenceType * refType ) { 300 303 // Note: dest can never be a reference, since it would have been caught in an earlier check 301 304 assert( ! dynamic_cast< ReferenceType * >( dest ) ); … … 303 306 // recursively compute conversion cost from T1 to T2. 304 307 // cv can be safely dropped because of 'implicit dereference' behavior. 305 refType-> get_base()->accept( *this );306 if ( refType-> get_base()->get_qualifiers() == dest->get_qualifiers() ) {308 refType->base->accept( *this ); 309 if ( refType->base->get_qualifiers() == dest->get_qualifiers() ) { 307 310 cost.incReference(); // prefer exact qualifiers 308 } else if ( refType-> get_base()->get_qualifiers() < dest->get_qualifiers() ) {311 } else if ( refType->base->get_qualifiers() < dest->get_qualifiers() ) { 309 312 cost.incSafe(); // then gaining qualifiers 310 313 } else { … … 314 317 } 315 318 316 void ConversionCost::visit( __attribute((unused)) FunctionType *functionType) {}317 318 void ConversionCost::visit( StructInstType *inst) {319 void ConversionCost::visit( FunctionType * ) {} 320 321 void ConversionCost::visit( StructInstType * inst ) { 319 322 if ( StructInstType *destAsInst = dynamic_cast< StructInstType* >( dest ) ) { 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) {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 * ) { 335 338 static Type::Qualifiers q; 336 339 static BasicType integer( q, BasicType::SignedInt ); … … 341 344 } 342 345 343 void ConversionCost::visit( __attribute((unused)) TraitInstType *inst) { 344 } 345 346 void ConversionCost::visit(TypeInstType *inst) { 346 void ConversionCost::visit( TraitInstType * ) {} 347 348 void ConversionCost::visit( TypeInstType *inst ) { 347 349 EqvClass eqvClass; 348 350 NamedTypeDecl *namedType; … … 363 365 } 364 366 365 void ConversionCost::visit( __attribute((unused)) TupleType *tupleType) {367 void ConversionCost::visit( TupleType * tupleType ) { 366 368 Cost c = Cost::zero; 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();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(); 370 372 while ( srcIt != tupleType->get_types().end() && destIt != destAsTuple->get_types().end() ) { 371 373 Cost newCost = conversionCost( *srcIt++, *destIt++, indexer, env ); … … 383 385 } 384 386 385 void ConversionCost::visit( __attribute((unused)) VarArgsType *varArgsType) {387 void ConversionCost::visit( VarArgsType * ) { 386 388 if ( dynamic_cast< VarArgsType* >( dest ) ) { 387 389 cost = Cost::zero; … … 389 391 } 390 392 391 void ConversionCost::visit( __attribute((unused)) ZeroType *zeroType) {392 if ( dynamic_cast< ZeroType * >( dest ) ) {393 void ConversionCost::visit( ZeroType * ) { 394 if ( dynamic_cast< ZeroType * >( dest ) ) { 393 395 cost = Cost::zero; 394 396 } else if ( BasicType *destAsBasic = dynamic_cast< BasicType* >( dest ) ) { … … 406 408 } 407 409 408 void ConversionCost::visit( __attribute((unused)) OneType *oneType) {409 if ( dynamic_cast< OneType * >( dest ) ) {410 void ConversionCost::visit( OneType * ) { 411 if ( dynamic_cast< OneType * >( dest ) ) { 410 412 cost = Cost::zero; 411 413 } else if ( BasicType *destAsBasic = dynamic_cast< BasicType* >( dest ) ) { -
src/ResolvExpr/CurrentObject.cc
r78315272 r3f7e12cb 260 260 261 261 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 << ")"; ) 262 263 init(); 263 264 } -
src/ResolvExpr/PolyCost.cc
r78315272 r3f7e12cb 5 5 // file "LICENCE" distributed with Cforall. 6 6 // 7 // PolyCost.cc -- 7 // PolyCost.cc -- 8 8 // 9 9 // Author : Richard C. Bilson … … 31 31 }; 32 32 33 int polyCost( Type *type, const TypeEnvironment & env, const SymTab::Indexer &indexer ) {33 int polyCost( Type *type, const TypeEnvironment & env, const SymTab::Indexer &indexer ) { 34 34 PolyCost coster( env, indexer ); 35 35 type->accept( coster ); … … 37 37 } 38 38 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 ) { 40 40 } 41 41 42 void PolyCost::visit(TypeInstType * typeInst) {42 void PolyCost::visit(TypeInstType * typeInst) { 43 43 EqvClass eqvClass; 44 if ( env.lookup( typeInst-> get_name(), eqvClass ) ) {44 if ( env.lookup( typeInst->name, eqvClass ) ) { 45 45 if ( eqvClass.type ) { 46 if ( TypeInstType *otherTypeInst = dynamic_cast< TypeInstType* >( eqvClass.type ) ) { 47 if ( indexer.lookupType( otherTypeInst->get_name() ) ) { 46 if ( TypeInstType * otherTypeInst = dynamic_cast< TypeInstType* >( eqvClass.type ) ) { 47 if ( indexer.lookupType( otherTypeInst->name ) ) { 48 // bound to opaque type 48 49 result += 1; 49 50 } // if 50 51 } else { 52 // bound to concrete type 51 53 result += 1; 52 54 } // if -
src/ResolvExpr/PtrsAssignable.cc
r78315272 r3f7e12cb 47 47 48 48 int ptrsAssignable( Type *src, Type *dest, const TypeEnvironment &env ) { 49 // std::cerr << "assignable: " << src << " | " << dest << std::endl; 49 50 if ( TypeInstType *destAsTypeInst = dynamic_cast< TypeInstType* >( dest ) ) { 50 51 EqvClass eqvClass; … … 54 55 } // if 55 56 if ( dynamic_cast< VoidType* >( dest ) ) { 56 return 1; 57 // void * = T * for any T is unsafe 58 // xxx - this should be safe, but that currently breaks the build 59 return -1; 57 60 } else { 58 61 PtrsAssignable ptrs( dest, env ); … … 65 68 66 69 void PtrsAssignable::visit( __attribute((unused)) VoidType *voidType ) { 67 if ( dynamic_cast< FunctionType* >( dest ) ) {68 result = 0;69 } else {70 result = -1;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; 71 74 } // if 72 75 } … … 75 78 void PtrsAssignable::visit( __attribute__((unused)) PointerType *pointerType ) {} 76 79 void PtrsAssignable::visit( __attribute__((unused)) ArrayType *arrayType ) {} 77 void PtrsAssignable::visit( __attribute__((unused)) FunctionType *functionType ) { 78 result = -1; 79 } 80 void PtrsAssignable::visit( __attribute__((unused)) FunctionType *functionType ) {} 80 81 81 82 void PtrsAssignable::visit( __attribute__((unused)) StructInstType *inst ) {} … … 83 84 84 85 void PtrsAssignable::visit( EnumInstType * ) { 85 if ( dynamic_cast< EnumInstType* >( dest ) ) { 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. 86 92 result = 1; 87 } else if ( BasicType *bt = dynamic_cast< BasicType* >( dest ) ) {88 result = bt->get_kind() == BasicType::SignedInt;89 93 } 90 94 } … … 94 98 EqvClass eqvClass; 95 99 if ( env.lookup( inst->get_name(), eqvClass ) && eqvClass.type ) { 100 // T * = S * for any S depends on the type bound to T 96 101 result = ptrsAssignable( eqvClass.type, dest, env ); 97 } else {98 result = 0;99 102 } // if 100 103 } -
src/ResolvExpr/PtrsCastable.cc
r78315272 r3f7e12cb 50 50 }; 51 51 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 ) { 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 ) { 60 66 return -1; 61 67 } // if 62 } //if63 } else if ( env.lookup( typeInst->get_name(), eqvClass ) ) {64 if ( eqvClass.data.kind == TypeDecl::Ftype ) {65 return -1;66 68 } // if 67 } // 68 } //if69 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 objectCast69 } //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 } 73 75 } 74 76 … … 93 95 } 94 96 95 void PtrsCastable::visit( __attribute__((unused)) VoidType *voidType) {97 void PtrsCastable::visit( VoidType * ) { 96 98 result = objectCast( dest, env, indexer ); 97 99 } 98 100 99 void PtrsCastable::visit( __attribute__((unused)) BasicType *basicType) {101 void PtrsCastable::visit( BasicType * ) { 100 102 result = objectCast( dest, env, indexer ); 101 103 } 102 104 103 void PtrsCastable::visit( __attribute__((unused)) PointerType *pointerType) {105 void PtrsCastable::visit( PointerType * ) { 104 106 result = objectCast( dest, env, indexer ); 105 107 } 106 108 107 void PtrsCastable::visit( __attribute__((unused)) ArrayType *arrayType) {109 void PtrsCastable::visit( ArrayType * ) { 108 110 result = objectCast( dest, env, indexer ); 109 111 } 110 112 111 void PtrsCastable::visit( __attribute__((unused)) FunctionType *functionType) {113 void PtrsCastable::visit( FunctionType * ) { 112 114 // result = -1; 113 115 result = functionCast( dest, env, indexer ); 114 116 } 115 117 116 void PtrsCastable::visit( __attribute__((unused)) StructInstType *inst) {118 void PtrsCastable::visit( StructInstType * ) { 117 119 result = objectCast( dest, env, indexer ); 118 120 } 119 121 120 void PtrsCastable::visit( __attribute__((unused)) UnionInstType *inst) {122 void PtrsCastable::visit( UnionInstType * ) { 121 123 result = objectCast( dest, env, indexer ); 122 124 } 123 125 124 void PtrsCastable::visit( __attribute__((unused)) EnumInstType *inst) {126 void PtrsCastable::visit( EnumInstType * ) { 125 127 if ( dynamic_cast< EnumInstType* >( dest ) ) { 126 128 result = 1; … … 136 138 } 137 139 138 void PtrsCastable::visit( __attribute__((unused)) TraitInstType *inst) {}140 void PtrsCastable::visit( TraitInstType * ) {} 139 141 140 142 void PtrsCastable::visit(TypeInstType *inst) { … … 143 145 } 144 146 145 void PtrsCastable::visit( __attribute__((unused)) TupleType *tupleType) {147 void PtrsCastable::visit( TupleType * ) { 146 148 result = objectCast( dest, env, indexer ); 147 149 } 148 150 149 void PtrsCastable::visit( __attribute__((unused)) VarArgsType *varArgsType) {151 void PtrsCastable::visit( VarArgsType * ) { 150 152 result = objectCast( dest, env, indexer ); 151 153 } 152 154 153 void PtrsCastable::visit( __attribute__((unused)) ZeroType *zeroType) {155 void PtrsCastable::visit( ZeroType * ) { 154 156 result = objectCast( dest, env, indexer ); 155 157 } 156 158 157 void PtrsCastable::visit( __attribute__((unused)) OneType *oneType) {159 void PtrsCastable::visit( OneType * ) { 158 160 result = objectCast( dest, env, indexer ); 159 161 } -
src/ResolvExpr/ResolveTypeof.cc
r78315272 r3f7e12cb 18 18 #include <cassert> // for assert 19 19 20 #include "Common/PassVisitor.h" // for PassVisitor 20 21 #include "Resolver.h" // for resolveInVoidContext 21 22 #include "SynTree/Expression.h" // for Expression … … 41 42 } 42 43 43 class ResolveTypeof : public Mutator{44 class ResolveTypeof : public WithShortCircuiting { 44 45 public: 45 46 ResolveTypeof( const SymTab::Indexer &indexer ) : indexer( indexer ) {} 46 Type *mutate( TypeofType *typeofType ); 47 void premutate( TypeofType *typeofType ); 48 Type * postmutate( TypeofType *typeofType ); 47 49 48 50 private: … … 50 52 }; 51 53 52 Type * resolveTypeof( Type *type, const SymTab::Indexer &indexer ) {53 ResolveTypeofmutator( indexer );54 Type * resolveTypeof( Type *type, const SymTab::Indexer &indexer ) { 55 PassVisitor<ResolveTypeof> mutator( indexer ); 54 56 return type->acceptMutator( mutator ); 55 57 } 56 58 57 Type *ResolveTypeof::mutate( TypeofType *typeofType ) { 59 void ResolveTypeof::premutate( TypeofType * ) { 60 visit_children = false; 61 } 62 63 Type * ResolveTypeof::postmutate( TypeofType *typeofType ) { 58 64 #if 0 59 std::c out<< "resolving typeof: ";60 typeofType->print( std::c out);61 std::c out<< std::endl;65 std::cerr << "resolving typeof: "; 66 typeofType->print( std::cerr ); 67 std::cerr << std::endl; 62 68 #endif 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 );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; 68 74 delete typeofType; 69 75 delete newExpr; -
src/ResolvExpr/Resolver.cc
r78315272 r3f7e12cb 40 40 #include "SynTree/Visitor.h" // for acceptAll, maybeAccept 41 41 #include "typeops.h" // for extractResultType 42 #include "Unify.h" // for unify 42 43 43 44 using namespace std; … … 52 53 void previsit( FunctionDecl *functionDecl ); 53 54 void postvisit( FunctionDecl *functionDecl ); 54 void previsit( ObjectDecl * functionDecl );55 void previsit( ObjectDecl *objectDecll ); 55 56 void previsit( TypeDecl *typeDecl ); 56 57 void previsit( EnumDecl * enumDecl ); … … 71 72 void previsit( ThrowStmt *throwStmt ); 72 73 void previsit( CatchStmt *catchStmt ); 74 void previsit( WaitForStmt * stmt ); 73 75 74 76 void previsit( SingleInit *singleInit ); … … 95 97 } 96 98 99 void resolveDecl( Declaration * decl, const SymTab::Indexer &indexer ) { 100 PassVisitor<Resolver> resolver( indexer ); 101 maybeAccept( decl, resolver ); 102 } 103 97 104 // used in resolveTypeof 98 105 Expression *resolveInVoidContext( Expression *expr, const SymTab::Indexer &indexer ) { … … 102 109 103 110 namespace { 104 void finishExpr( Expression *expr, const TypeEnvironment &env ) {105 expr-> set_env( new TypeSubstitution );111 void finishExpr( Expression *expr, const TypeEnvironment &env, TypeSubstitution * oldenv = nullptr ) { 112 expr->env = oldenv ? oldenv->clone() : new TypeSubstitution; 106 113 env.makeSubstitution( *expr->get_env() ); 107 114 } 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 } 108 127 } // namespace 109 128 110 Expression *findVoidExpression( Expression *untyped, const SymTab::Indexer &indexer ) {129 void findVoidExpression( Expression *& untyped, const SymTab::Indexer &indexer ) { 111 130 global_renamer.reset(); 112 131 TypeEnvironment env; 113 132 Expression *newExpr = resolveInVoidContext( untyped, indexer, env ); 114 finishExpr( newExpr, env ); 115 return newExpr; 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 ); 116 166 } 117 167 118 168 namespace { 119 Expression *findSingleExpression( Expression *untyped, const SymTab::Indexer &indexer ) {120 TypeEnvironment env;121 AlternativeFinder finder( indexer, env );122 finder.find( untyped );123 #if 0124 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 } // for131 } // if132 #endif133 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 140 169 bool isIntegralType( Type *type ) { 141 170 if ( dynamic_cast< EnumInstType * >( type ) ) { … … 150 179 } 151 180 152 Expression *findIntegralExpression( Expression *untyped, const SymTab::Indexer &indexer ) {181 void findIntegralExpression( Expression *& untyped, const SymTab::Indexer &indexer ) { 153 182 TypeEnvironment env; 154 183 AlternativeFinder finder( indexer, env ); … … 179 208 throw SemanticError( "No interpretations for case control expression", untyped ); 180 209 } // if 181 finishExpr( newExpr, *newEnv ); 182 return newExpr; 210 finishExpr( newExpr, *newEnv, untyped->env ); 211 delete untyped; 212 untyped = newExpr; 183 213 } 184 214 … … 205 235 void Resolver::handlePtrType( PtrType * type ) { 206 236 if ( type->get_dimension() ) { 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 ); 237 findSingleExpression( type->dimension, SymTab::SizeType->clone(), indexer ); 211 238 } 212 239 } … … 238 265 functionReturn = ResolvExpr::extractResultType( functionDecl->get_functionType() ); 239 266 } 240 241 267 242 268 void Resolver::postvisit( FunctionDecl *functionDecl ) { … … 262 288 void Resolver::previsit( ExprStmt *exprStmt ) { 263 289 visit_children = false; 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 ); 290 assertf( exprStmt->expr, "ExprStmt has null Expression in resolver" ); 291 findVoidExpression( exprStmt->expr, indexer ); 268 292 } 269 293 270 294 void Resolver::previsit( AsmExpr *asmExpr ) { 271 295 visit_children = false; 272 Expression *newExpr = findVoidExpression( asmExpr->get_operand(), indexer ); 273 delete asmExpr->get_operand(); 274 asmExpr->set_operand( newExpr ); 296 findVoidExpression( asmExpr->operand, indexer ); 275 297 if ( asmExpr->get_inout() ) { 276 newExpr = findVoidExpression( asmExpr->get_inout(), indexer ); 277 delete asmExpr->get_inout(); 278 asmExpr->set_inout( newExpr ); 298 findVoidExpression( asmExpr->inout, indexer ); 279 299 } // if 280 300 } … … 287 307 288 308 void Resolver::previsit( IfStmt *ifStmt ) { 289 Expression *newExpr = findSingleExpression( ifStmt->get_condition(), indexer ); 290 delete ifStmt->get_condition(); 291 ifStmt->set_condition( newExpr ); 309 findSingleExpression( ifStmt->condition, indexer ); 292 310 } 293 311 294 312 void Resolver::previsit( WhileStmt *whileStmt ) { 295 Expression *newExpr = findSingleExpression( whileStmt->get_condition(), indexer ); 296 delete whileStmt->get_condition(); 297 whileStmt->set_condition( newExpr ); 313 findSingleExpression( whileStmt->condition, indexer ); 298 314 } 299 315 300 316 void Resolver::previsit( ForStmt *forStmt ) { 301 if ( forStmt->get_condition() ) { 302 Expression * newExpr = findSingleExpression( forStmt->get_condition(), indexer ); 303 delete forStmt->get_condition(); 304 forStmt->set_condition( newExpr ); 317 if ( forStmt->condition ) { 318 findSingleExpression( forStmt->condition, indexer ); 305 319 } // if 306 320 307 if ( forStmt->get_increment() ) { 308 Expression * newExpr = findVoidExpression( forStmt->get_increment(), indexer ); 309 delete forStmt->get_increment(); 310 forStmt->set_increment( newExpr ); 321 if ( forStmt->increment ) { 322 findVoidExpression( forStmt->increment, indexer ); 311 323 } // if 312 324 } … … 314 326 void Resolver::previsit( SwitchStmt *switchStmt ) { 315 327 GuardValue( currentObject ); 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() ); 328 findIntegralExpression( switchStmt->condition, indexer ); 329 330 currentObject = CurrentObject( switchStmt->condition->result ); 322 331 } 323 332 … … 326 335 std::list< InitAlternative > initAlts = currentObject.getOptions(); 327 336 assertf( initAlts.size() == 1, "SwitchStmt did not correctly resolve an integral expression." ); 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 ); 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; 333 343 delete castExpr; 334 344 } … … 339 349 // must resolve the argument for a computed goto 340 350 if ( branchStmt->get_type() == BranchStmt::Goto ) { // check for computed goto statement 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 ); 351 if ( branchStmt->computedTarget ) { 352 // computed goto argument is void * 353 findSingleExpression( branchStmt->computedTarget, new PointerType( Type::Qualifiers(), new VoidType( Type::Qualifiers() ) ), indexer ); 347 354 } // if 348 355 } // if … … 351 358 void Resolver::previsit( ReturnStmt *returnStmt ) { 352 359 visit_children = false; 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 ); 360 if ( returnStmt->expr ) { 361 findSingleExpression( returnStmt->expr, functionReturn->clone(), indexer ); 358 362 } // if 359 363 } … … 366 370 indexer.lookupStruct( "__cfaehm__base_exception_t" ); 367 371 assert( exception_decl ); 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 ); 372 Type * exceptType = new PointerType( noQualifiers, new StructInstType( noQualifiers, exception_decl ) ); 373 findSingleExpression( throwStmt->expr, exceptType, indexer ); 380 374 } 381 375 } 382 376 383 377 void Resolver::previsit( CatchStmt *catchStmt ) { 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 ) ); 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 ); 390 569 } 391 570 } … … 403 582 visit_children = false; 404 583 // resolve initialization using the possibilities as determined by the currentObject cursor 405 UntypedInitExpr * untyped = new UntypedInitExpr( singleInit->get_value(), currentObject.getOptions() );406 Expression * newExpr = findSingleExpression( untyped, indexer );584 Expression * newExpr = new UntypedInitExpr( singleInit->value, currentObject.getOptions() ); 585 findSingleExpression( newExpr, indexer ); 407 586 InitExpr * initExpr = strict_dynamic_cast< InitExpr * >( newExpr ); 408 587 … … 411 590 412 591 // discard InitExpr wrapper and retain relevant pieces 413 newExpr = initExpr-> get_expr();414 newExpr->set_env( initExpr->get_env() );415 initExpr->set_expr( nullptr);416 initExpr->set_env( nullptr );592 newExpr = initExpr->expr; 593 initExpr->expr = nullptr; 594 std::swap( initExpr->env, newExpr->env ); 595 std::swap( initExpr->inferParams, newExpr->inferParams ) ; 417 596 delete initExpr; 418 597 419 598 // get the actual object's type (may not exactly match what comes back from the resolver due to conversions) 420 599 Type * initContext = currentObject.getCurrentType(); 600 601 removeExtraneousCast( newExpr, indexer ); 421 602 422 603 // check if actual object's type is char[] … … 426 607 if ( PointerType * pt = dynamic_cast< PointerType *>( newExpr->get_result() ) ) { 427 608 if ( isCharType( pt->get_base() ) ) { 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; 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 } 433 616 } 434 617 } … … 437 620 438 621 // set initializer expr to resolved express 439 singleInit-> set_value( newExpr );622 singleInit->value = newExpr; 440 623 441 624 // move cursor to next object in preparation for next initializer -
src/ResolvExpr/Resolver.h
r78315272 r3f7e12cb 29 29 /// Checks types and binds syntactic constructs to typed representations 30 30 void resolve( std::list< Declaration * > translationUnit ); 31 Expression *resolveInVoidContext( Expression *expr, const SymTab::Indexer &indexer ); 32 Expression *findVoidExpression( Expression *untyped, const SymTab::Indexer &indexer ); 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 ); 33 35 void resolveCtorInit( ConstructorInit * ctorInit, const SymTab::Indexer & indexer ); 34 36 void resolveStmtExpr( StmtExpr * stmtExpr, const SymTab::Indexer & indexer ); -
src/ResolvExpr/TypeEnvironment.cc
r78315272 r3f7e12cb 68 68 } 69 69 70 void EqvClass::print( std::ostream &os, intindent ) const {71 os << std::string( indent, ' ' ) <<"( ";70 void EqvClass::print( std::ostream &os, Indenter indent ) const { 71 os << "( "; 72 72 std::copy( vars.begin(), vars.end(), std::ostream_iterator< std::string >( os, " " ) ); 73 73 os << ")"; 74 74 if ( type ) { 75 75 os << " -> "; 76 type->print( os, indent );76 type->print( os, indent+1 ); 77 77 } // if 78 78 if ( ! allowWidening ) { … … 123 123 for ( std::list< EqvClass >::const_iterator theClass = env.begin(); theClass != env.end(); ++theClass ) { 124 124 for ( std::set< std::string >::const_iterator theVar = theClass->vars.begin(); theVar != theClass->vars.end(); ++theVar ) { 125 /// std::c out<< "adding " << *theVar;125 /// std::cerr << "adding " << *theVar; 126 126 if ( theClass->type ) { 127 /// std::c out<< " bound to ";128 /// theClass->type->print( std::c out);129 /// std::c out<< std::endl;127 /// std::cerr << " bound to "; 128 /// theClass->type->print( std::cerr ); 129 /// std::cerr << std::endl; 130 130 sub.add( *theVar, theClass->type ); 131 131 } else if ( theVar != theClass->vars.begin() ) { 132 132 TypeInstType *newTypeInst = new TypeInstType( Type::Qualifiers(), *theClass->vars.begin(), theClass->data.kind == TypeDecl::Ftype ); 133 /// std::c out<< " bound to variable " << *theClass->vars.begin() << std::endl;133 /// std::cerr << " bound to variable " << *theClass->vars.begin() << std::endl; 134 134 sub.add( *theVar, newTypeInst ); 135 135 delete newTypeInst; … … 144 144 } 145 145 146 void TypeEnvironment::print( std::ostream &os, intindent ) const {146 void TypeEnvironment::print( std::ostream &os, Indenter indent ) const { 147 147 for ( std::list< EqvClass >::const_iterator i = env.begin(); i != env.end(); ++i ) { 148 148 i->print( os, indent ); -
src/ResolvExpr/TypeEnvironment.h
r78315272 r3f7e12cb 68 68 EqvClass &operator=( const EqvClass &other ); 69 69 ~EqvClass(); 70 void print( std::ostream &os, int indent = 0) const;70 void print( std::ostream &os, Indenter indent = {} ) const; 71 71 }; 72 72 … … 80 80 void makeSubstitution( TypeSubstitution &result ) const; 81 81 bool isEmpty() const { return env.empty(); } 82 void print( std::ostream &os, int indent = 0) const;82 void print( std::ostream &os, Indenter indent = {} ) const; 83 83 void combine( const TypeEnvironment &second, Type *(*combineFunc)( Type*, Type* ) ); 84 84 void simpleCombine( const TypeEnvironment &second ); -
src/ResolvExpr/Unify.cc
r78315272 r3f7e12cb 17 17 #include <iterator> // for back_insert_iterator, back_inserter 18 18 #include <map> // for _Rb_tree_const_iterator, _Rb_tree_i... 19 #include <memory> // for unique_ptr , auto_ptr19 #include <memory> // for unique_ptr 20 20 #include <set> // for set 21 21 #include <string> // for string, operator==, operator!=, bas... 22 22 #include <utility> // for pair 23 23 24 #include "Common/PassVisitor.h" // for PassVisitor 24 25 #include "FindOpenVars.h" // for findOpenVars 25 26 #include "Parser/LinkageSpec.h" // for C … … 137 138 bool tyVarCompatible( const TypeDecl::Data & data, Type *type ) { 138 139 switch ( data.kind ) { 139 case TypeDecl::Any:140 140 case TypeDecl::Dtype: 141 141 // to bind to an object type variable, the type must not be a function type. … … 169 169 Type *common = 0; 170 170 // attempt to unify equivalence class type (which has qualifiers stripped, so they must be restored) with the type to bind to 171 std:: auto_ptr< Type > newType( curClass.type->clone() );171 std::unique_ptr< Type > newType( curClass.type->clone() ); 172 172 newType->get_qualifiers() = typeInst->get_qualifiers(); 173 173 if ( unifyInexact( newType.get(), other, env, needAssertions, haveAssertions, openVars, widenMode & WidenMode( curClass.allowWidening, true ), indexer, common ) ) { … … 458 458 if ( otherArray && arrayType->get_isVarLen() == otherArray->get_isVarLen() ) { 459 459 460 // not positive this is correct in all cases, but it's needed for typedefs461 if ( arrayType->get_isVarLen() || otherArray->get_isVarLen() ) {462 return;463 }464 465 460 if ( ! arrayType->get_isVarLen() && ! otherArray->get_isVarLen() && 466 461 arrayType->get_dimension() != 0 && otherArray->get_dimension() != 0 ) { … … 537 532 /// If this isn't done then argument lists can have wildly different 538 533 /// size and structure, when they should be compatible. 539 struct TtypeExpander : public Mutator { 540 TypeEnvironment & env; 541 TtypeExpander( TypeEnvironment & env ) : env( env ) {} 542 Type * mutate( TypeInstType * typeInst ) { 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 ) { 543 539 EqvClass eqvClass; 544 if ( env.lookup( typeInst->get_name(), eqvClass ) ) {540 if ( tenv.lookup( typeInst->get_name(), eqvClass ) ) { 545 541 if ( eqvClass.data.kind == TypeDecl::Ttype ) { 546 542 // expand ttype parameter into its actual type … … 560 556 dst.clear(); 561 557 for ( DeclarationWithType * dcl : src ) { 562 TtypeExpanderexpander( env );558 PassVisitor<TtypeExpander> expander( env ); 563 559 dcl->acceptMutator( expander ); 564 560 std::list< Type * > types; … … 750 746 std::list<Type *> types1, types2; 751 747 752 TtypeExpanderexpander( env );748 PassVisitor<TtypeExpander> expander( env ); 753 749 flat1->acceptMutator( expander ); 754 750 flat2->acceptMutator( expander ); -
src/SymTab/Autogen.cc
r78315272 r3f7e12cb 16 16 #include "Autogen.h" 17 17 18 #include <cstddef> // for NULL19 18 #include <algorithm> // for count_if 20 19 #include <cassert> // for strict_dynamic_cast, assert, assertf … … 27 26 #include "AddVisit.h" // for addVisit 28 27 #include "CodeGen/OperatorTable.h" // for isCtorDtor, isCtorDtorAssign 28 #include "Common/PassVisitor.h" // for PassVisitor 29 29 #include "Common/ScopedMap.h" // for ScopedMap<>::const_iterator, Scope... 30 30 #include "Common/utility.h" // for cloneAll, operator+ 31 #include "GenPoly/DeclMutator.h" // for DeclMutator32 31 #include "GenPoly/ScopedSet.h" // for ScopedSet, ScopedSet<>::iterator 32 #include "InitTweak/GenInit.h" // for fixReturnStatements 33 #include "ResolvExpr/Resolver.h" // for resolveDecl 33 34 #include "SymTab/Mangler.h" // for Mangler 34 35 #include "SynTree/Attribute.h" // For Attribute … … 42 43 namespace SymTab { 43 44 Type * SizeType = 0; 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. 45 46 /// Data used to generate functions generically. Specifically, the name of the generated function and a function which generates the routine protoype 47 47 struct FuncData { 48 48 typedef FunctionType * (*TypeGen)( Type * ); 49 FuncData( const std::string & fname, const TypeGen & genType , TypeMap & map ) : fname( fname ), genType( genType ), map( map) {}49 FuncData( const std::string & fname, const TypeGen & genType ) : fname( fname ), genType( genType ) {} 50 50 std::string fname; 51 51 TypeGen genType; 52 TypeMap & map; 53 }; 54 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 52 }; 53 54 struct AutogenerateRoutines final : public WithDeclsToAdd, public WithVisitorRef<AutogenerateRoutines>, public WithGuards, public WithShortCircuiting, public WithIndexer { 66 55 AutogenerateRoutines(); 67 56 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 ); 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 ); 80 68 81 69 private: 82 template< typename StmtClass > void visitStatement( StmtClass *stmt ); 83 84 std::list< Declaration * > declsToAdd, declsToAddAfter; 85 std::set< std::string > structsDone; 70 71 GenPoly::ScopedSet< std::string > structsDone; 86 72 unsigned int functionNesting = 0; // current level of nested functions 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; 73 74 InitTweak::ManagedTypes managedTypes; 91 75 std::vector< FuncData > data; 92 76 }; 93 77 94 78 /// generates routines for tuple types. 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 ); 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 ); 107 85 108 86 private: … … 112 90 113 91 void autogenerateRoutines( std::list< Declaration * > &translationUnit ) { 114 AutogenerateRoutinesgenerator;115 acceptA ndAdd( translationUnit, generator );92 PassVisitor<AutogenerateRoutines> generator; 93 acceptAll( translationUnit, generator ); 116 94 117 95 // needs to be done separately because AutogenerateRoutines skips types that appear as function arguments, etc. 118 96 // AutogenTupleRoutines tupleGenerator; 119 // tupleGenerator.mutateDeclarationList( translationUnit ); 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 ); 120 212 } 121 213 122 214 bool isUnnamedBitfield( ObjectDecl * obj ) { 123 return obj != NULL && obj->get_name() == "" && obj->get_bitfieldWidth() != NULL;215 return obj != nullptr && obj->name == "" && obj->bitfieldWidth != nullptr; 124 216 } 125 217 … … 127 219 void addForwardDecl( FunctionDecl * functionDecl, std::list< Declaration * > & declsToAdd ) { 128 220 FunctionDecl * decl = functionDecl->clone(); 129 delete decl-> get_statements();130 decl->s et_statements( NULL );221 delete decl->statements; 222 decl->statements = nullptr; 131 223 declsToAdd.push_back( decl ); 132 224 decl->fixUniqueId(); 133 225 } 134 226 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 135 237 /// given type T, generate type of default ctor/dtor, i.e. function type void (*) (T *) 136 238 FunctionType * genDefaultType( Type * paramType ) { 239 const auto & typeParams = getGenericParams( paramType ); 137 240 FunctionType *ftype = new FunctionType( Type::Qualifiers(), false ); 241 cloneAll( typeParams, ftype->forall ); 138 242 ObjectDecl *dstParam = new ObjectDecl( "_dst", Type::StorageClasses(), LinkageSpec::Cforall, nullptr, new ReferenceType( Type::Qualifiers(), paramType->clone() ), nullptr ); 139 ftype->get_parameters().push_back( dstParam ); 140 243 ftype->parameters.push_back( dstParam ); 141 244 return ftype; 142 245 } … … 146 249 FunctionType *ftype = genDefaultType( paramType ); 147 250 ObjectDecl *srcParam = new ObjectDecl( "_src", Type::StorageClasses(), LinkageSpec::Cforall, nullptr, paramType->clone(), nullptr ); 148 ftype-> get_parameters().push_back( srcParam );251 ftype->parameters.push_back( srcParam ); 149 252 return ftype; 150 253 } … … 154 257 FunctionType *ftype = genCopyType( paramType ); 155 258 ObjectDecl *returnVal = new ObjectDecl( "_ret", Type::StorageClasses(), LinkageSpec::Cforall, nullptr, paramType->clone(), nullptr ); 156 ftype-> get_returnVals().push_back( returnVal );259 ftype->returnVals.push_back( returnVal ); 157 260 return ftype; 158 261 } … … 171 274 } 172 275 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 ) ) { 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 ) ) { 226 319 ftype->parameters.front()->get_type()->set_mutex( true ); 227 320 } 228 321 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 ) { 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 ) { 304 387 InitTweak::InitExpander srcParam( src ); 305 388 306 389 // assign to destination 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 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 312 394 template<typename Iterator> 313 void makeStructFunctionBody( Iterator member, Iterator end, FunctionDecl * func, bool forward = true) {395 void StructFuncGenerator::makeFunctionBody( Iterator member, Iterator end, FunctionDecl * func, bool forward ) { 314 396 for ( ; member != end; ++member ) { 315 397 if ( DeclarationWithType *field = dynamic_cast< DeclarationWithType * >( *member ) ) { // otherwise some form of type declaration, e.g. Aggregate … … 321 403 } 322 404 323 if ( type->get_const() && func->get_name() == "?=?") {405 if ( type->get_const() && CodeGen::isAssignment( func->name ) ) { 324 406 // don't assign const members, but do construct/destruct 325 407 continue; 326 408 } 327 409 328 if ( field->get_name() == "" ) {329 // don't assign to anonymous members330 // xxx - this is a temporary fix. Anonymous members tie into331 // our inheritance model. I think the correct way to handle this is to332 // cast the structure to the type of the member and let the resolver333 // figure out whether it's valid and have a pass afterwards that fixes334 // the assignment to use pointer arithmetic with the offset of the335 // member, much like how generic type members are handled.336 continue;337 }338 339 410 assert( ! func->get_functionType()->get_parameters().empty() ); 340 411 ObjectDecl * dstParam = dynamic_cast<ObjectDecl*>( func->get_functionType()->get_parameters().front() ); 341 ObjectDecl * srcParam = NULL;412 ObjectDecl * srcParam = nullptr; 342 413 if ( func->get_functionType()->get_parameters().size() == 2 ) { 343 414 srcParam = dynamic_cast<ObjectDecl*>( func->get_functionType()->get_parameters().back() ); 344 415 } 416 345 417 // srcParam may be NULL, in which case we have default ctor/dtor 346 418 assert( dstParam ); 347 419 348 Expression *srcselect = srcParam ? new MemberExpr( field, new VariableExpr( srcParam ) ) : NULL;349 make StructMemberOp( dstParam, srcselect, field, func, forward );420 Expression *srcselect = srcParam ? new MemberExpr( field, new VariableExpr( srcParam ) ) : nullptr; 421 makeMemberOp( dstParam, srcselect, field, func, forward ); 350 422 } // if 351 423 } // for 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. 424 } // makeFunctionBody 425 356 426 template<typename Iterator> 357 void makeStructFieldCtorBody( Iterator member, Iterator end, FunctionDecl * func ) {358 FunctionType * ftype = func-> get_functionType();359 std::list<DeclarationWithType*> & params = ftype-> get_parameters();427 void StructFuncGenerator::makeFieldCtorBody( Iterator member, Iterator end, FunctionDecl * func ) { 428 FunctionType * ftype = func->type; 429 std::list<DeclarationWithType*> & params = ftype->parameters; 360 430 assert( params.size() >= 2 ); // should not call this function for default ctor, etc. 361 431 … … 369 439 // don't make a function whose parameter is an unnamed bitfield 370 440 continue; 371 } else if ( field->get_name() == "" ) {372 // don't assign to anonymous members373 // xxx - this is a temporary fix. Anonymous members tie into374 // our inheritance model. I think the correct way to handle this is to375 // cast the structure to the type of the member and let the resolver376 // figure out whether it's valid and have a pass afterwards that fixes377 // the assignment to use pointer arithmetic with the offset of the378 // member, much like how generic type members are handled.379 continue;380 441 } else if ( parameter != params.end() ) { 381 442 // matching parameter, initialize field with copy ctor 382 443 Expression *srcselect = new VariableExpr(*parameter); 383 make StructMemberOp( dstParam, srcselect, field, func );444 makeMemberOp( dstParam, srcselect, field, func ); 384 445 ++parameter; 385 446 } else { 386 447 // no matching parameter, initialize field with default ctor 387 make StructMemberOp( dstParam, NULL, field, func );448 makeMemberOp( dstParam, nullptr, field, func ); 388 449 } 389 450 } … … 391 452 } 392 453 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 ) { 454 bool UnionFuncGenerator::shouldAutogen() const { 402 455 // Builtins do not use autogeneration. 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 456 return ! aggregateDecl->linkage.is_builtin; 457 } 458 459 // xxx - is this right? 460 bool UnionFuncGenerator::isConcurrentType() const { return false; }; 461 462 /// generate a single union assignment expression (using memcpy) 463 template< typename OutputIterator > 464 void UnionFuncGenerator::makeMemberOp( ObjectDecl * srcParam, ObjectDecl * dstParam, OutputIterator out ) { 465 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() ) ); 469 *out++ = new ExprStmt( noLabels, copy ); 470 } 471 472 /// 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() { 419 491 // 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) 492 unsigned numCtors = std::count_if( definitions.begin(), definitions.end(), [](Declaration * dcl) { return CodeGen::isConstructor( dcl->get_name() ); } ); 493 453 494 // Field constructors are only generated if default and copy constructor 454 495 // 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 } 480 481 /// generate a single union assignment expression (using memcpy) 482 template< typename OutputIterator > 483 void makeUnionFieldsAssignment( ObjectDecl * srcParam, ObjectDecl * dstParam, OutputIterator out ) { 484 UntypedExpr *copy = new UntypedExpr( new NameExpr( "__builtin_memcpy" ) ); 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() ) ); 488 *out++ = new ExprStmt( noLabels, copy ); 489 } 490 491 /// generates the body of a union assignment/copy constructor/field constructor 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 ); 496 if ( numCtors != 2 ) return; 543 497 544 498 // create a constructor which takes the first member type as a parameter. … … 546 500 // void ?{}(A *, int) 547 501 // This is to mimic C's behaviour which initializes the first member of the union. 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 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 560 507 break; 561 508 } 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 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 //============================================================================================= 571 577 AutogenerateRoutines::AutogenerateRoutines() { 572 578 // the order here determines the order that these functions are generated. 573 579 // assignment should come last since it uses copy constructor in return. 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 } 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 ); 596 600 structInst.set_baseStruct( structDecl ); 597 makeStructFunctions( structDecl, &structInst, functionNesting, declsToAddAfter, data ); 598 structsDone.insert( structDecl->get_name() ); 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 ); 599 606 } // if 600 607 } 601 608 602 void AutogenerateRoutines::visit( UnionDecl *unionDecl ) { 603 if ( ! unionDecl->get_members().empty() ) { 609 void AutogenerateRoutines::previsit( UnionDecl * unionDecl ) { 610 visit_children = false; 611 if ( unionDecl->has_body() ) { 604 612 UnionInstType unionInst( Type::Qualifiers(), unionDecl->get_name() ); 605 613 unionInst.set_baseUnion( unionDecl ); … … 607 615 unionInst.get_parameters().push_back( new TypeExpr( new TypeInstType( Type::Qualifiers(), typeDecl->get_name(), typeDecl ) ) ); 608 616 } 609 makeUnionFunctions( unionDecl, &unionInst, functionNesting, declsToAddAfter ); 617 UnionFuncGenerator gen( unionDecl, &unionInst, data, functionNesting, indexer ); 618 generateFunctions( gen, declsToAddAfter ); 610 619 } // if 611 620 } 612 621 613 Type * declToTypeDeclBase( Declaration * decl ) {614 if ( TypeDecl * td = dynamic_cast< TypeDecl * >( decl ) ) {615 return td->base;616 }617 return nullptr;618 }619 620 622 // generate ctor/dtors/assign for typedecls, e.g., otype T = int *; 621 void AutogenerateRoutines::visit( TypeDecl *typeDecl ) { 623 void AutogenerateRoutines::previsit( TypeDecl * typeDecl ) { 624 visit_children = false; 622 625 if ( ! typeDecl->base ) return; 623 626 624 // generate each of the functions based on the supplied FuncData objects625 std::list< FunctionDecl * > newFuncs;626 std::list< Declaration * > tds { typeDecl };627 std::list< TypeDecl * > typeParams;628 627 TypeInstType refType( Type::Qualifiers(), typeDecl->name, typeDecl ); 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 *) { 628 TypeFuncGenerator gen( typeDecl, &refType, data, functionNesting, indexer ); 629 generateFunctions( gen, declsToAddAfter ); 630 } 631 632 void AutogenerateRoutines::previsit( FunctionType *) { 674 633 // ensure that we don't add assignment ops for types defined as part of the function 675 } 676 677 void AutogenerateRoutines::visit( PointerType *) { 634 visit_children = false; 635 } 636 637 void AutogenerateRoutines::previsit( PointerType *) { 678 638 // ensure that we don't add assignment ops for types defined as part of the pointer 679 } 680 681 void AutogenerateRoutines::visit( TraitDecl *) { 639 visit_children = false; 640 } 641 642 void AutogenerateRoutines::previsit( TraitDecl * ) { 682 643 // ensure that we don't add assignment ops for types defined as part of the trait 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 ) { 644 visit_children = false; 645 } 646 647 void AutogenerateRoutines::previsit( FunctionDecl * functionDecl ) { 648 visit_children = false; 693 649 // record the existence of this function as appropriate 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 ); 650 managedTypes.handleDWT( functionDecl ); 651 652 maybeAccept( functionDecl->type, *visitor ); 700 653 functionNesting += 1; 701 maybeAccept( functionDecl-> get_statements(), *this);654 maybeAccept( functionDecl->statements, *visitor ); 702 655 functionNesting -= 1; 703 656 } 704 657 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 ); 658 void AutogenerateRoutines::previsit( CompoundStmt * ) { 659 GuardScope( managedTypes ); 660 GuardScope( structsDone ); 719 661 } 720 662 … … 734 676 } 735 677 736 Type * AutogenTupleRoutines::mutate( TupleType * tupleType ) { 737 tupleType = strict_dynamic_cast< TupleType * >( Parent::mutate( tupleType ) ); 678 void AutogenTupleRoutines::postvisit( TupleType * tupleType ) { 738 679 std::string mangleName = SymTab::Mangler::mangleType( tupleType ); 739 if ( seenTuples.find( mangleName ) != seenTuples.end() ) return tupleType;680 if ( seenTuples.find( mangleName ) != seenTuples.end() ) return; 740 681 seenTuples.insert( mangleName ); 741 682 … … 755 696 if ( TypeInstType * ty = dynamic_cast< TypeInstType * >( t ) ) { 756 697 if ( ! done.count( ty->get_baseType() ) ) { 757 TypeDecl * newDecl = new TypeDecl( ty->get_baseType()->get_name(), Type::StorageClasses(), nullptr, TypeDecl:: Any);698 TypeDecl * newDecl = new TypeDecl( ty->get_baseType()->get_name(), Type::StorageClasses(), nullptr, TypeDecl::Dtype, true ); 758 699 TypeInstType * inst = new TypeInstType( Type::Qualifiers(), newDecl->get_name(), newDecl ); 759 700 newDecl->get_assertions().push_back( new FunctionDecl( "?=?", Type::StorageClasses(), LinkageSpec::Cforall, genAssignType( inst ), nullptr, … … 785 726 makeTupleFunctionBody( dtorDecl ); 786 727 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 ) ); 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 ); 797 737 functionNesting += 1; 798 functionDecl->set_statements( maybeMutate( functionDecl->get_statements(), *this ));738 maybeAccept( functionDecl->statements, *visitor ); 799 739 functionNesting -= 1; 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; 740 } 741 742 void AutogenTupleRoutines::previsit( CompoundStmt * ) { 743 GuardScope( seenTuples ); 808 744 } 809 745 } // SymTab -
src/SymTab/Autogen.h
r78315272 r3f7e12cb 19 19 #include <string> // for string 20 20 21 #include "CodeGen/OperatorTable.h" 21 22 #include "Common/UniqueName.h" // for UniqueName 22 23 #include "InitTweak/InitTweak.h" // for InitExpander … … 44 45 extern FunctionDecl * dereferenceOperator; 45 46 46 // temporary47 // generate the type of an assignment function for paramType 47 48 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 ); 48 55 49 56 /// inserts into out a generated call expression to function fname with arguments dstParam and srcParam. Intended to be used with generated ?=?, ?{}, and ^?{} calls. … … 54 61 /// optionally returns a statement which must be inserted prior to the containing loop, if there is one 55 62 template< typename OutputIterator > 56 Statement * genScalarCall( InitTweak::InitExpander & srcParam, Expression *dstParam, const std::string & fname, OutputIterator out, Type * type, bool addCast = false ) { 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 57 74 // want to be able to generate assignment, ctor, and dtor generically, 58 75 // so fname is either ?=?, ?{}, or ^?{} 59 UntypedExpr * fExpr = new UntypedExpr( new NameExpr( fname ) );76 UntypedExpr * fExpr = new UntypedExpr( new NameExpr( fname ) ); 60 77 61 78 if ( addCast ) { … … 72 89 dstParam = new CastExpr( dstParam, new ReferenceType( Type::Qualifiers(), castType ) ); 73 90 } 74 fExpr-> get_args().push_back( dstParam );91 fExpr->args.push_back( dstParam ); 75 92 76 93 Statement * listInit = srcParam.buildListInit( fExpr ); 77 94 78 std::list< Expression * > args = *++srcParam; 79 fExpr->get_args().splice( fExpr->get_args().end(), args ); 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 ); 80 106 81 107 *out++ = new ExprStmt( noLabels, fExpr ); … … 99 125 // generate: for ( int i = 0; i < N; ++i ) 100 126 begin = new ConstantExpr( Constant::from_int( 0 ) ); 101 end = array-> get_dimension()->clone();127 end = array->dimension->clone(); 102 128 cmp = new NameExpr( "?<?" ); 103 129 update = new NameExpr( "++?" ); … … 105 131 // generate: for ( int i = N-1; i >= 0; --i ) 106 132 begin = new UntypedExpr( new NameExpr( "?-?" ) ); 107 ((UntypedExpr*)begin)-> get_args().push_back( array->get_dimension()->clone() );108 ((UntypedExpr*)begin)-> get_args().push_back( new ConstantExpr( Constant::from_int( 1 ) ) );133 ((UntypedExpr*)begin)->args.push_back( array->dimension->clone() ); 134 ((UntypedExpr*)begin)->args.push_back( new ConstantExpr( Constant::from_int( 1 ) ) ); 109 135 end = new ConstantExpr( Constant::from_int( 0 ) ); 110 136 cmp = new NameExpr( "?>=?" ); … … 115 141 116 142 UntypedExpr *cond = new UntypedExpr( cmp ); 117 cond-> get_args().push_back( new VariableExpr( index ) );118 cond-> get_args().push_back( end );143 cond->args.push_back( new VariableExpr( index ) ); 144 cond->args.push_back( end ); 119 145 120 146 UntypedExpr *inc = new UntypedExpr( update ); 121 inc-> get_args().push_back( new VariableExpr( index ) );147 inc->args.push_back( new VariableExpr( index ) ); 122 148 123 149 UntypedExpr *dstIndex = new UntypedExpr( new NameExpr( "?[?]" ) ); 124 dstIndex-> get_args().push_back( dstParam );125 dstIndex-> get_args().push_back( new VariableExpr( index ) );150 dstIndex->args.push_back( dstParam ); 151 dstIndex->args.push_back( new VariableExpr( index ) ); 126 152 dstParam = dstIndex; 127 153 128 154 // srcParam must keep track of the array indices to build the 129 155 // source parameter and/or array list initializer 130 srcParam.addArrayIndex( new VariableExpr( index ), array-> get_dimension()->clone() );156 srcParam.addArrayIndex( new VariableExpr( index ), array->dimension->clone() ); 131 157 132 158 // for stmt's body, eventually containing call 133 159 CompoundStmt * body = new CompoundStmt( noLabels ); 134 Statement * listInit = genCall( srcParam, dstParam, fname, back_inserter( body-> get_kids() ), array->get_base(), addCast, forward );160 Statement * listInit = genCall( srcParam, dstParam, fname, back_inserter( body->kids ), array->base, addCast, forward ); 135 161 136 162 // block containing for stmt and index variable 137 163 std::list<Statement *> initList; 138 164 CompoundStmt * block = new CompoundStmt( noLabels ); 139 block-> get_kids().push_back( new DeclStmt( noLabels, index ) );165 block->push_back( new DeclStmt( noLabels, index ) ); 140 166 if ( listInit ) block->get_kids().push_back( listInit ); 141 block-> get_kids().push_back( new ForStmt( noLabels, initList, cond, inc, body ) );167 block->push_back( new ForStmt( noLabels, initList, cond, inc, body ) ); 142 168 143 169 *out++ = block; … … 145 171 146 172 template< typename OutputIterator > 147 Statement * genCall( InitTweak::InitExpander & 173 Statement * genCall( InitTweak::InitExpander & srcParam, Expression * dstParam, const std::string & fname, OutputIterator out, Type * type, bool addCast, bool forward ) { 148 174 if ( ArrayType * at = dynamic_cast< ArrayType * >( type ) ) { 149 175 genArrayCall( srcParam, dstParam, fname, out, at, addCast, forward ); … … 159 185 /// ImplicitCtorDtorStmt node. 160 186 template< typename OutputIterator > 161 void genImplicitCall( InitTweak::InitExpander & 187 void genImplicitCall( InitTweak::InitExpander & srcParam, Expression * dstParam, const std::string & fname, OutputIterator out, DeclarationWithType * decl, bool forward = true ) { 162 188 ObjectDecl *obj = dynamic_cast<ObjectDecl *>( decl ); 163 189 assert( obj ); … … 167 193 bool addCast = (fname == "?{}" || fname == "^?{}") && ( !obj || ( obj && ! obj->get_bitfieldWidth() ) ); 168 194 std::list< Statement * > stmts; 169 genCall( srcParam, dstParam, fname, back_inserter( stmts ), obj-> get_type(), addCast, forward );195 genCall( srcParam, dstParam, fname, back_inserter( stmts ), obj->type, addCast, forward ); 170 196 171 197 // 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
r78315272 r3f7e12cb 26 26 FixFunction::FixFunction() : isVoid( false ) {} 27 27 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() ); 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; 33 34 delete functionDecl; 34 35 return pointer; 35 36 } 36 37 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) { 38 Type * FixFunction::postmutate(ArrayType *arrayType) { 51 39 // need to recursively mutate the base type in order for multi-dimensional arrays to work. 52 PointerType *pointerType = new PointerType( arrayType->get_qualifiers(), arrayType->get_base()->clone()->acceptMutator( *this ), maybeClone( arrayType->get_dimension() ), arrayType->get_isVarLen(), arrayType->get_isStatic() ); 40 PointerType *pointerType = new PointerType( arrayType->get_qualifiers(), arrayType->base, arrayType->dimension, arrayType->isVarLen, arrayType->isStatic ); 41 arrayType->base = nullptr; 42 arrayType->dimension = nullptr; 53 43 delete arrayType; 54 44 return pointerType; 55 45 } 56 46 57 Type * FixFunction::mutate(StructInstType *aggregateUseType) {58 return aggregateUseType;47 void FixFunction::premutate(VoidType *) { 48 isVoid = true; 59 49 } 60 50 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 } 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; } 92 64 } // namespace SymTab 93 65 -
src/SymTab/FixFunction.h
r78315272 r3f7e12cb 16 16 #pragma once 17 17 18 #include " SynTree/Mutator.h" // for Mutator19 #include "SynTree/SynTree.h" // for Types18 #include "Common/PassVisitor.h" // for PassVisitor 19 #include "SynTree/SynTree.h" // for Types 20 20 21 21 namespace SymTab { 22 22 /// Replaces function and array types by equivalent pointer types. 23 class FixFunction : public Mutator{23 class FixFunction : public WithShortCircuiting { 24 24 typedef Mutator Parent; 25 25 public: 26 26 FixFunction(); 27 27 28 bool get_isVoid() const { return isVoid; } 29 void set_isVoid( bool newValue ) { isVoid = newValue; } 30 private: 31 virtual DeclarationWithType* mutate(FunctionDecl *functionDecl); 28 void premutate(FunctionDecl *functionDecl); 29 DeclarationWithType* postmutate(FunctionDecl *functionDecl); 32 30 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); 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); 46 46 47 47 bool isVoid; -
src/SymTab/Indexer.cc
r78315272 r3f7e12cb 40 40 41 41 namespace 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 55 42 typedef std::unordered_map< std::string, DeclarationWithType* > MangleTable; 56 43 typedef std::unordered_map< std::string, MangleTable > IdTable; … … 198 185 } 199 186 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) {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 ) { 205 192 that.tables = 0; 206 193 } … … 420 407 makeWritable(); 421 408 422 const std::string &name = decl-> get_name();409 const std::string &name = decl->name; 423 410 std::string mangleName; 424 if ( LinkageSpec::isOverridable( decl-> get_linkage()) ) {411 if ( LinkageSpec::isOverridable( decl->linkage ) ) { 425 412 // mangle the name without including the appropriate suffix, so overridable routines are placed into the 426 413 // same "bucket" as their user defined versions. … … 431 418 432 419 // this ensures that no two declarations with the same unmangled name at the same scope both have C linkage 433 if ( ! LinkageSpec::isMangled( decl-> get_linkage()) ) {420 if ( ! LinkageSpec::isMangled( decl->linkage ) ) { 434 421 // NOTE this is broken in Richard's original code in such a way that it never triggers (it 435 422 // doesn't check decls that have the same manglename, and all C-linkage decls are defined to … … 584 571 585 572 if ( doDebug ) { 586 std::c out<< "--- Entering scope " << scope << std::endl;573 std::cerr << "--- Entering scope " << scope << std::endl; 587 574 } 588 575 } 589 576 590 577 void Indexer::leaveScope() { 591 using std::c out;578 using std::cerr; 592 579 593 580 assert( scope > 0 && "cannot leave initial scope" ); 581 if ( doDebug ) { 582 cerr << "--- Leaving scope " << scope << " containing" << std::endl; 583 } 594 584 --scope; 595 585 596 586 while ( tables && tables->scope > scope ) { 597 587 if ( doDebug ) { 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 ); 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 ); 605 594 } 606 595 -
src/SymTab/Indexer.h
r78315272 r3f7e12cb 26 26 class Indexer { 27 27 public: 28 explicit Indexer( bool useDebug = false);28 explicit Indexer(); 29 29 30 30 Indexer( const Indexer &that ); … … 76 76 void addTrait( TraitDecl *decl ); 77 77 78 bool doDebug = false; ///< Display debugging trace? 78 79 private: 79 80 struct Impl; … … 81 82 Impl *tables; ///< Copy-on-write instance of table data structure 82 83 unsigned long scope; ///< Scope index of this pointer 83 bool doDebug; ///< Display debugging trace?84 84 85 85 /// Takes a new ref to a table (returns null if null) -
src/SymTab/Mangler.cc
r78315272 r3f7e12cb 9 9 // Author : Richard C. Bilson 10 10 // Created On : Sun May 17 21:40:29 2015 11 // Last Modified By : Andrew Beach12 // Last Modified On : Wed Jun 28 15:31:00201713 // Update Count : 2 111 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Mon Sep 25 15:49:26 2017 13 // Update Count : 23 14 14 // 15 15 #include "Mangler.h" … … 31 31 32 32 namespace SymTab { 33 std::string Mangler::mangleType( Type * ty ) {34 Mangler mangler( false, true );33 std::string Mangler::mangleType( Type * ty ) { 34 Mangler mangler( false, true, true ); 35 35 maybeAccept( ty, mangler ); 36 36 return mangler.get_mangleName(); 37 37 } 38 38 39 Mangler::Mangler( bool mangleOverridable, bool typeMode ) 40 : nextVarNum( 0 ), isTopLevel( true ), mangleOverridable( mangleOverridable ), typeMode( typeMode ) {} 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 ) {} 41 47 42 48 Mangler::Mangler( const Mangler &rhs ) : mangleName() { … … 48 54 } 49 55 50 void Mangler::mangleDecl( DeclarationWithType * declaration ) {56 void Mangler::mangleDecl( DeclarationWithType * declaration ) { 51 57 bool wasTopLevel = isTopLevel; 52 58 if ( isTopLevel ) { … … 79 85 } 80 86 81 void Mangler::visit( ObjectDecl * declaration ) {87 void Mangler::visit( ObjectDecl * declaration ) { 82 88 mangleDecl( declaration ); 83 89 } 84 90 85 void Mangler::visit( FunctionDecl * declaration ) {91 void Mangler::visit( FunctionDecl * declaration ) { 86 92 mangleDecl( declaration ); 87 93 } 88 94 89 void Mangler::visit( VoidType * voidType ) {95 void Mangler::visit( VoidType * voidType ) { 90 96 printQualifiers( voidType ); 91 97 mangleName << "v"; 92 98 } 93 99 94 void Mangler::visit( BasicType * basicType ) {100 void Mangler::visit( BasicType * basicType ) { 95 101 static const char *btLetter[] = { 96 102 "b", // Bool … … 115 121 "Id", // DoubleImaginary 116 122 "Ir", // LongDoubleImaginary 123 "w", // SignedInt128 124 "Uw", // UnsignedInt128 117 125 }; 118 126 … … 121 129 } 122 130 123 void Mangler::visit( PointerType * pointerType ) {131 void Mangler::visit( PointerType * pointerType ) { 124 132 printQualifiers( pointerType ); 125 133 mangleName << "P"; … … 127 135 } 128 136 129 void Mangler::visit( ArrayType * arrayType ) {137 void Mangler::visit( ArrayType * arrayType ) { 130 138 // TODO: encode dimension 131 139 printQualifiers( arrayType ); … … 134 142 } 135 143 136 void Mangler::visit( ReferenceType * refType ) {144 void Mangler::visit( ReferenceType * refType ) { 137 145 printQualifiers( refType ); 138 146 mangleName << "R"; … … 149 157 } 150 158 151 void Mangler::visit( FunctionType * functionType ) {159 void Mangler::visit( FunctionType * functionType ) { 152 160 printQualifiers( functionType ); 153 161 mangleName << "F"; … … 160 168 } 161 169 162 void Mangler::mangleRef( ReferenceToType * refType, std::string prefix ) {170 void Mangler::mangleRef( ReferenceToType * refType, std::string prefix ) { 163 171 printQualifiers( refType ); 164 172 165 173 mangleName << ( refType->get_name().length() + prefix.length() ) << prefix << refType->get_name(); 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 ); 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 << "_"; 183 185 } 184 mangleName << "_";185 186 } 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 ) { 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 ) { 202 198 mangleRef( aggregateUseType, "e" ); 203 199 } 204 200 205 void Mangler::visit( TypeInstType * typeInst ) {201 void Mangler::visit( TypeInstType * typeInst ) { 206 202 VarMapType::iterator varNum = varNums.find( typeInst->get_name() ); 207 203 if ( varNum == varNums.end() ) { … … 212 208 numStream << varNum->second.first; 213 209 switch ( (TypeDecl::Kind )varNum->second.second ) { 214 case TypeDecl::Any:215 mangleName << "t";216 break;217 210 case TypeDecl::Dtype: 218 211 mangleName << "d"; … … 231 224 } 232 225 233 void Mangler::visit( TupleType * tupleType ) {226 void Mangler::visit( TupleType * tupleType ) { 234 227 printQualifiers( tupleType ); 235 228 mangleName << "T"; 236 acceptAll( tupleType-> get_types(), *this );229 acceptAll( tupleType->types, *this ); 237 230 mangleName << "_"; 238 231 } 239 232 240 void Mangler::visit( VarArgsType * varArgsType ) {233 void Mangler::visit( VarArgsType * varArgsType ) { 241 234 printQualifiers( varArgsType ); 242 235 mangleName << "VARGS"; 243 236 } 244 237 245 void Mangler::visit( __attribute__((unused)) ZeroType *zeroType) {238 void Mangler::visit( ZeroType * ) { 246 239 mangleName << "Z"; 247 240 } 248 241 249 void Mangler::visit( __attribute__((unused)) OneType *oneType) {242 void Mangler::visit( OneType * ) { 250 243 mangleName << "O"; 251 244 } 252 245 253 void Mangler::visit( TypeDecl * decl ) {246 void Mangler::visit( TypeDecl * decl ) { 254 247 static const char *typePrefix[] = { "BT", "BD", "BF" }; 255 mangleName << typePrefix[ decl->get_kind() ] << ( decl-> get_name().length() + 1 ) << decl->get_name();248 mangleName << typePrefix[ decl->get_kind() ] << ( decl->name.length() + 1 ) << decl->name; 256 249 } 257 250 … … 262 255 } 263 256 264 void Mangler::printQualifiers( Type * type ) {257 void Mangler::printQualifiers( Type * type ) { 265 258 // skip if not including qualifiers 266 259 if ( typeMode ) return; … … 270 263 int tcount = 0, dcount = 0, fcount = 0, vcount = 0; 271 264 mangleName << "A"; 272 for ( Type::ForallList::iterator i = type-> get_forall().begin(); i != type->get_forall().end(); ++i ) {265 for ( Type::ForallList::iterator i = type->forall.begin(); i != type->forall.end(); ++i ) { 273 266 switch ( (*i)->get_kind() ) { 274 case TypeDecl::Any:275 tcount++;276 break;277 267 case TypeDecl::Dtype: 278 268 dcount++; … … 287 277 assert( false ); 288 278 } // switch 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 );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 ); 292 282 sub_mangler.nextVarNum = nextVarNum; 293 283 sub_mangler.isTopLevel = false; … … 307 297 mangleName << "V"; 308 298 } // if 299 if ( type->get_mutex() ) { 300 mangleName << "M"; 301 } // if 309 302 // Removed due to restrict not affecting function compatibility in GCC 310 303 // if ( type->get_isRestrict() ) { … … 312 305 // } // if 313 306 if ( type->get_lvalue() ) { 307 // mangle based on whether the type is lvalue, so that the resolver can differentiate lvalues and rvalues 314 308 mangleName << "L"; 315 } // if309 } 316 310 if ( type->get_atomic() ) { 317 311 mangleName << "A"; -
src/SymTab/Mangler.h
r78315272 r3f7e12cb 30 30 /// Mangle syntax tree object; primary interface to clients 31 31 template< typename SynTreeClass > 32 static std::string mangle( SynTreeClass *decl, bool mangleOverridable = true, bool typeMode = false );32 static std::string mangle( SynTreeClass *decl, bool mangleOverridable = true, bool typeMode = false, bool mangleGenericParams = true ); 33 33 /// Mangle a type name; secondary interface 34 34 static std::string mangleType( Type* ty ); 35 /// Mangle ignoring generic type parameters 36 static std::string mangleConcrete( Type* ty ); 37 35 38 36 39 virtual void visit( ObjectDecl *declaration ); … … 62 65 bool mangleOverridable; ///< Specially mangle overridable built-in methods 63 66 bool typeMode; ///< Produce a unique mangled name for a type 67 bool mangleGenericParams; ///< Include generic parameters in name mangling if true 64 68 65 Mangler( bool mangleOverridable, bool typeMode );69 Mangler( bool mangleOverridable, bool typeMode, bool mangleGenericParams ); 66 70 Mangler( const Mangler & ); 67 71 68 72 void mangleDecl( DeclarationWithType *declaration ); 69 73 void mangleRef( ReferenceToType *refType, std::string prefix ); 70 void mangleGenericRef( ReferenceToType *refType, std::string prefix );71 74 72 75 void printQualifiers( Type *type ); … … 74 77 75 78 template< typename SynTreeClass > 76 std::string Mangler::mangle( SynTreeClass *decl, bool mangleOverridable, bool typeMode ) {77 Mangler mangler( mangleOverridable, typeMode );79 std::string Mangler::mangle( SynTreeClass *decl, bool mangleOverridable, bool typeMode, bool mangleGenericParams ) { 80 Mangler mangler( mangleOverridable, typeMode, mangleGenericParams ); 78 81 maybeAccept( decl, mangler ); 79 82 return mangler.get_mangleName(); -
src/SymTab/Validate.cc
r78315272 r3f7e12cb 56 56 #include "FixFunction.h" // for FixFunction 57 57 #include "Indexer.h" // for Indexer 58 #include "InitTweak/GenInit.h" // for fixReturnStatements 58 59 #include "InitTweak/InitTweak.h" // for isCtorDtorAssign 59 60 #include "Parser/LinkageSpec.h" // for C … … 150 151 /// Replaces array and function types in forall lists by appropriate pointer type and assigns each Object and Function declaration a unique ID. 151 152 struct ForallPointerDecay final { 152 void previsit( ObjectDecl *object ); 153 void previsit( FunctionDecl *func ); 153 void previsit( ObjectDecl * object ); 154 void previsit( FunctionDecl * func ); 155 void previsit( StructDecl * aggrDecl ); 156 void previsit( UnionDecl * aggrDecl ); 154 157 }; 155 158 … … 265 268 HoistStruct::hoistStruct( translationUnit ); // must happen after EliminateTypedef, so that aggregate typedefs occur in the correct order 266 269 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 267 271 acceptAll( translationUnit, lrt ); // must happen before autogen, because sized flag needs to propagate to generated functions 268 272 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 exist270 273 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 271 276 Concurrency::applyKeywords( translationUnit ); 277 acceptAll( translationUnit, fpd ); // must happen before autogenerateRoutines, after Concurrency::applyKeywords because uniqueIds must be set on declaration before resolution 272 278 autogenerateRoutines( translationUnit ); // moved up, used to be below compoundLiteral - currently needs EnumAndPointerDecay 273 279 Concurrency::implementMutexFuncs( translationUnit ); 274 280 Concurrency::implementThreadStarter( translationUnit ); 275 ReturnChecker::checkFunctionReturns( translationUnit );276 281 mutateAll( translationUnit, compoundliteral ); 277 acceptAll( translationUnit, fpd );278 282 ArrayLength::computeLength( translationUnit ); 279 acceptAll( translationUnit, finder ); 283 acceptAll( translationUnit, finder ); // xxx - remove this pass soon 280 284 mutateAll( translationUnit, labelAddrFixer ); 281 285 } … … 368 372 DWTIterator begin( dwts.begin() ), end( dwts.end() ); 369 373 if ( begin == end ) return; 370 FixFunctionfixer;374 PassVisitor<FixFunction> fixer; 371 375 DWTIterator i = begin; 372 376 *i = (*i)->acceptMutator( fixer ); 373 if ( fixer. get_isVoid()) {377 if ( fixer.pass.isVoid ) { 374 378 DWTIterator j = i; 375 379 ++i; … … 382 386 ++i; 383 387 for ( ; i != end; ++i ) { 384 FixFunctionfixer;388 PassVisitor<FixFunction> fixer; 385 389 *i = (*i)->acceptMutator( fixer ); 386 if ( fixer. get_isVoid()) {390 if ( fixer.pass.isVoid ) { 387 391 throw SemanticError( "invalid type void in function type ", func ); 388 392 } // if … … 579 583 580 584 /// Fix up assertions - flattens assertion lists, removing all trait instances 581 void forallFixer( Type * func) {582 for ( TypeDecl * type : f unc->get_forall()) {585 void forallFixer( std::list< TypeDecl * > & forall, BaseSyntaxNode * node ) { 586 for ( TypeDecl * type : forall ) { 583 587 std::list< DeclarationWithType * > asserts; 584 588 asserts.splice( asserts.end(), type->assertions ); … … 596 600 // apply FixFunction to every assertion to check for invalid void type 597 601 for ( DeclarationWithType *& assertion : type->assertions ) { 598 FixFunctionfixer;602 PassVisitor<FixFunction> fixer; 599 603 assertion = assertion->acceptMutator( fixer ); 600 if ( fixer. get_isVoid()) {601 throw SemanticError( "invalid type void in assertion of function ", func);604 if ( fixer.pass.isVoid ) { 605 throw SemanticError( "invalid type void in assertion of function ", node ); 602 606 } // if 603 607 } // for … … 607 611 608 612 void ForallPointerDecay::previsit( ObjectDecl *object ) { 609 forallFixer( object-> get_type());610 if ( PointerType *pointer = dynamic_cast< PointerType * >( object-> get_type()) ) {611 forallFixer( pointer-> get_base());613 forallFixer( object->type->forall, object ); 614 if ( PointerType *pointer = dynamic_cast< PointerType * >( object->type ) ) { 615 forallFixer( pointer->base->forall, object ); 612 616 } // if 613 617 object->fixUniqueId(); … … 615 619 616 620 void ForallPointerDecay::previsit( FunctionDecl *func ) { 617 forallFixer( func-> get_type());621 forallFixer( func->type->forall, func ); 618 622 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 ); 619 631 } 620 632 … … 656 668 } 657 669 filter( translationUnit, isTypedef, true ); 658 659 670 } 660 671 … … 664 675 TypedefMap::const_iterator def = typedefNames.find( typeInst->get_name() ); 665 676 if ( def != typedefNames.end() ) { 666 Type *ret = def->second.first-> get_base()->clone();677 Type *ret = def->second.first->base->clone(); 667 678 ret->get_qualifiers() |= typeInst->get_qualifiers(); 668 679 // place instance parameters on the typedef'd type 669 if ( ! typeInst-> get_parameters().empty() ) {680 if ( ! typeInst->parameters.empty() ) { 670 681 ReferenceToType *rtt = dynamic_cast<ReferenceToType*>(ret); 671 682 if ( ! rtt ) { 672 throw SemanticError(" cannot apply type parameters to base type of " + typeInst->get_name());683 throw SemanticError("Cannot apply type parameters to base type of " + typeInst->name); 673 684 } 674 685 rtt->get_parameters().clear(); 675 cloneAll( typeInst-> get_parameters(), rtt->get_parameters());676 mutateAll( rtt-> get_parameters(), *visitor ); // recursively fix typedefs on parameters686 cloneAll( typeInst->parameters, rtt->parameters ); 687 mutateAll( rtt->parameters, *visitor ); // recursively fix typedefs on parameters 677 688 } // if 678 689 delete typeInst; … … 680 691 } else { 681 692 TypeDeclMap::const_iterator base = typedeclNames.find( typeInst->get_name() ); 682 assertf( base != typedeclNames.end(), "Cannot find typedecl name %s", typeInst-> get_name().c_str() );693 assertf( base != typedeclNames.end(), "Cannot find typedecl name %s", typeInst->name.c_str() ); 683 694 typeInst->set_baseType( base->second ); 684 695 } // if 685 696 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; 686 711 } 687 712 … … 694 719 Type * t2 = typedefNames[ tyDecl->get_name() ].first->get_base(); 695 720 if ( ! ResolvExpr::typesCompatible( t1, t2, Indexer() ) ) { 696 throw SemanticError( "cannot redefine typedef: " + tyDecl->get_name() ); 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 ); 697 726 } 698 727 } else { -
src/SynTree/AddressExpr.cc
r78315272 r3f7e12cb 33 33 Type * addrType( Type * type ) { 34 34 if ( ReferenceType * refType = dynamic_cast< ReferenceType * >( type ) ) { 35 return new ReferenceType( refType->get_qualifiers(), addrType( refType-> get_base()) );35 return new ReferenceType( refType->get_qualifiers(), addrType( refType->base ) ); 36 36 } else { 37 37 return new PointerType( Type::Qualifiers(), type->clone() ); … … 40 40 } 41 41 42 AddressExpr::AddressExpr( Expression *arg , Expression *_aname ) : Expression( _aname), arg( arg ) {43 if ( arg-> has_result()) {44 if ( arg-> get_result()->get_lvalue() ) {42 AddressExpr::AddressExpr( Expression *arg ) : Expression(), arg( arg ) { 43 if ( arg->result ) { 44 if ( arg->result->get_lvalue() ) { 45 45 // lvalue, retains all layers of reference and gains a pointer inside the references 46 set_result( addrType( arg-> get_result()) );46 set_result( addrType( arg->result ) ); 47 47 } else { 48 48 // taking address of non-lvalue -- must be a reference, loses one layer of reference 49 ReferenceType * refType = strict_dynamic_cast< ReferenceType * >( arg-> get_result());50 set_result( addrType( refType-> get_base()) );49 ReferenceType * refType = strict_dynamic_cast< ReferenceType * >( arg->result ); 50 set_result( addrType( refType->base ) ); 51 51 } 52 52 // result of & is never an lvalue … … 62 62 } 63 63 64 void AddressExpr::print( std::ostream &os, intindent ) const {64 void AddressExpr::print( std::ostream &os, Indenter indent ) const { 65 65 os << "Address of:" << std::endl; 66 66 if ( arg ) { 67 os << std::string( indent+2, ' ' );68 arg->print( os, indent+ 2);67 os << indent+1; 68 arg->print( os, indent+1 ); 69 69 } // if 70 70 } … … 77 77 LabelAddressExpr::~LabelAddressExpr() {} 78 78 79 void LabelAddressExpr::print( std::ostream & os, int indent) const {80 os << "Address of label:" << std::endl << std::string( indent+2, ' ' ) <<arg;79 void LabelAddressExpr::print( std::ostream & os, Indenter ) const { 80 os << "Address of label:" << arg; 81 81 } 82 82 -
src/SynTree/AggregateDecl.cc
r78315272 r3f7e12cb 41 41 } 42 42 43 void AggregateDecl::print( std::ostream &os, intindent ) const {43 void AggregateDecl::print( std::ostream &os, Indenter indent ) const { 44 44 using std::string; 45 45 using std::endl; 46 46 47 os << typeString() << " " << get_name()<< ":";47 os << typeString() << " " << name << ":"; 48 48 if ( get_linkage() != LinkageSpec::Cforall ) { 49 os << " " << LinkageSpec::linkageName( get_linkage());49 os << " " << LinkageSpec::linkageName( linkage ); 50 50 } // if 51 os << " with body " << has_body() << endl;51 os << " with body " << has_body(); 52 52 53 53 if ( ! parameters.empty() ) { 54 os << endl << string( indent+2, ' ' ) << "with parameters" << endl;55 printAll( parameters, os, indent+ 4);54 os << endl << indent << "... with parameters" << endl; 55 printAll( parameters, os, indent+1 ); 56 56 } // if 57 57 if ( ! members.empty() ) { 58 os << endl << string( indent+2, ' ' ) << "with members" << endl;59 printAll( members, os, indent+ 4);58 os << endl << indent << "... with members" << endl; 59 printAll( members, os, indent+1 ); 60 60 } // if 61 61 if ( ! attributes.empty() ) { 62 os << endl << string( indent+2, ' ' ) << "with attributes" << endl;63 printAll( attributes, os, indent+ 4);62 os << endl << indent << "... with attributes" << endl; 63 printAll( attributes, os, indent+1 ); 64 64 } // if 65 os << endl; 65 66 } 66 67 67 void AggregateDecl::printShort( std::ostream &os, intindent ) const {68 void AggregateDecl::printShort( std::ostream &os, Indenter indent ) const { 68 69 using std::string; 69 70 using std::endl; 70 71 71 os << typeString() << " " << get_name(); 72 os << string( indent+2, ' ' ) << "with body " << has_body() << endl; 72 os << typeString() << " " << name << " with body " << has_body() << endl; 73 73 74 74 if ( ! parameters.empty() ) { 75 os << endl << string( indent+2, ' ' ) << "with parameters" << endl;76 printAll( parameters, os, indent+ 4);75 os << indent << "... with parameters" << endl; 76 printAll( parameters, os, indent+1 ); 77 77 } // if 78 78 } -
src/SynTree/ApplicationExpr.cc
r78315272 r3f7e12cb 55 55 set_result( ResolvExpr::extractResultType( function ) ); 56 56 57 assert( has_result());57 assert( result ); 58 58 } 59 59 60 60 ApplicationExpr::ApplicationExpr( const ApplicationExpr &other ) : 61 Expression( other ), function( maybeClone( other.function ) ) , inferParams( other.inferParams ){61 Expression( other ), function( maybeClone( other.function ) ) { 62 62 cloneAll( other.args, args ); 63 63 } … … 68 68 } 69 69 70 void 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 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; 74 if ( ! args.empty() ) { 75 os << indent << "... to arguments" << std::endl; 76 printAll( args, os, indent+1 ); 79 77 } // if 80 }81 82 void ApplicationExpr::print( std::ostream &os, int indent ) const {83 os << "Application of" << std::endl << std::string(indent+2, ' ');84 function->print( os, indent+2 );85 if ( ! args.empty() ) {86 os << std::string( indent, ' ' ) << "to arguments" << std::endl;87 printAll( args, os, indent+2 );88 } // if89 printInferParams( inferParams, os, indent+2, 0 );90 78 Expression::print( os, indent ); 91 79 } -
src/SynTree/ArrayType.cc
r78315272 r3f7e12cb 39 39 } 40 40 41 void ArrayType::print( std::ostream &os, intindent ) const {41 void ArrayType::print( std::ostream &os, Indenter indent ) const { 42 42 Type::print( os, indent ); 43 43 if ( isStatic ) { -
src/SynTree/AttrType.cc
r78315272 r3f7e12cb 5 5 // file "LICENCE" distributed with Cforall. 6 6 // 7 // AttrType.cc.cc -- 7 // AttrType.cc.cc -- 8 8 // 9 9 // Author : Richard C. Bilson … … 42 42 } 43 43 44 void AttrType::print( std::ostream &os, intindent ) const {44 void AttrType::print( std::ostream &os, Indenter indent ) const { 45 45 Type::print( os, indent ); 46 46 os << "attribute " << name << " applied to "; -
src/SynTree/Attribute.cc
r78315272 r3f7e12cb 28 28 } 29 29 30 void Attribute::print( std::ostream &os, intindent ) const {30 void Attribute::print( std::ostream &os, Indenter indent ) const { 31 31 using std::endl; 32 32 using std::string; … … 36 36 if ( ! parameters.empty() ) { 37 37 os << " with parameters: " << endl; 38 printAll( parameters, os, indent );38 printAll( parameters, os, indent+1 ); 39 39 } 40 40 } -
src/SynTree/Attribute.h
r78315272 r3f7e12cb 20 20 #include <string> // for string, operator== 21 21 22 #include "BaseSyntaxNode.h" 23 #include "Mutator.h" 24 #include "Visitor.h" 25 22 26 class Expression; 23 27 24 28 // GCC attribute 25 29 // https://gcc.gnu.org/onlinedocs/gcc-6.1.0/gcc/Attribute-Syntax.html#Attribute-Syntax 26 class Attribute {30 class Attribute : public BaseSyntaxNode { 27 31 public: 32 std::string name; 33 // to keep things nice and tight, use NameExpr for special identifier parameters 34 std::list< Expression * > parameters; 35 28 36 Attribute( std::string name = "", const std::list< Expression * > & parameters = std::list< Expression * >() ) : name( name ), parameters( parameters ) {} 29 37 Attribute( const Attribute &other ); … … 35 43 bool empty() const { return name == ""; } 36 44 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; 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; 43 49 }; 44 50 -
src/SynTree/BaseSyntaxNode.h
r78315272 r3f7e12cb 17 17 18 18 #include "Common/CodeLocation.h" 19 #include "Common/Indenter.h" 19 20 class Visitor; 21 class Mutator; 20 22 21 23 class BaseSyntaxNode { … … 25 27 virtual ~BaseSyntaxNode() {} 26 28 29 virtual BaseSyntaxNode * clone() const = 0; 27 30 virtual void accept( Visitor & v ) = 0; 28 virtual void print( std::ostream & os, int indent = 0 ) const = 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 } 29 39 }; 40 41 std::ostream & operator<<( std::ostream & out, const BaseSyntaxNode * node ); 30 42 31 43 // Local Variables: // -
src/SynTree/BasicType.cc
r78315272 r3f7e12cb 5 5 // file "LICENCE" distributed with Cforall. 6 6 // 7 // BasicType.cc -- 7 // BasicType.cc -- 8 8 // 9 9 // Author : Richard C. Bilson 10 10 // Created On : Mon May 18 07:44:20 2015 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Mon Sep 11 12:52:05201713 // Update Count : 912 // Last Modified On : Mon Sep 25 14:14:03 2017 13 // Update Count : 11 14 14 // 15 15 … … 24 24 BasicType::BasicType( const Type::Qualifiers &tq, Kind bt, const std::list< Attribute * > & attributes ) : Type( tq, attributes ), kind( bt ) {} 25 25 26 void BasicType::print( std::ostream &os, intindent ) const {26 void BasicType::print( std::ostream &os, Indenter indent ) const { 27 27 Type::print( os, indent ); 28 28 os << BasicType::typeNames[ kind ]; … … 43 43 case LongLongSignedInt: 44 44 case LongLongUnsignedInt: 45 case SignedInt128: 46 case UnsignedInt128: 45 47 return true; 46 48 case Float: -
src/SynTree/CommaExpr.cc
r78315272 r3f7e12cb 21 21 #include "Type.h" // for Type 22 22 23 CommaExpr::CommaExpr( Expression *arg1, Expression *arg2 , Expression *_aname)24 : Expression( _aname), arg1( arg1 ), arg2( arg2 ) {23 CommaExpr::CommaExpr( Expression *arg1, Expression *arg2 ) 24 : Expression(), arg1( arg1 ), arg2( arg2 ) { 25 25 // xxx - result of a comma expression is never an lvalue, so should set lvalue 26 26 // to false on all result types. Actually doing this causes some strange things … … 39 39 } 40 40 41 void CommaExpr::print( std::ostream &os, intindent ) const {41 void CommaExpr::print( std::ostream &os, Indenter indent ) const { 42 42 os << "Comma Expression:" << std::endl; 43 os << std::string( indent+2, ' ');44 arg1->print( os, indent+ 2);43 os << (indent+1); 44 arg1->print( os, indent+1 ); 45 45 os << std::endl; 46 os << std::string( indent+2, ' ');47 arg2->print( os, indent+ 2);46 os << (indent+1); 47 arg2->print( os, indent+1 ); 48 48 Expression::print( os, indent ); 49 49 } -
src/SynTree/CompoundStmt.cc
r78315272 r3f7e12cb 29 29 30 30 CompoundStmt::CompoundStmt( std::list<Label> labels ) : Statement( labels ) { 31 } 32 33 CompoundStmt::CompoundStmt( std::list<Statement *> stmts ) : Statement( noLabels ), kids( stmts ) { 31 34 } 32 35 … … 70 73 } 71 74 72 void CompoundStmt::print( std::ostream &os, intindent ) const {73 os << "CompoundStmt" << endl 74 printAll( kids, os, indent + 2);75 void CompoundStmt::print( std::ostream &os, Indenter indent ) const { 76 os << "CompoundStmt" << endl; 77 printAll( kids, os, indent+1 ); 75 78 } 76 79 -
src/SynTree/Constant.cc
r78315272 r3f7e12cb 34 34 } 35 35 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 36 40 Constant Constant::from_int( int i ) { 37 41 return Constant( new BasicType( Type::Qualifiers(), BasicType::SignedInt ), std::to_string( i ), (unsigned long long int)i ); … … 67 71 } 68 72 69 void Constant::print( std::ostream &os ) const {73 void Constant::print( std::ostream &os, Indenter ) const { 70 74 os << "(" << rep << " " << val.ival; 71 75 if ( type ) { -
src/SynTree/Constant.h
r78315272 r3f7e12cb 19 19 #include <string> // for string 20 20 21 #include "BaseSyntaxNode.h" 21 22 #include "Mutator.h" // for Mutator 22 23 #include "Visitor.h" // for Visitor … … 24 25 class Type; 25 26 26 class Constant {27 class Constant : public BaseSyntaxNode { 27 28 public: 28 29 Constant( Type * type, std::string rep, unsigned long long val ); … … 30 31 Constant( const Constant & other ); 31 32 virtual ~Constant(); 33 34 virtual Constant * clone() const { return new Constant( *this ); } 32 35 33 36 Type * get_type() { return type; } … … 40 43 /// generates a boolean constant of the given bool 41 44 static Constant from_bool( bool b ); 45 /// generates a char constant of the given char 46 static Constant from_char( char c ); 42 47 /// generates an integer constant of the given int 43 48 static Constant from_int( int i ); … … 52 57 virtual void accept( Visitor & v ) { v.visit( this ); } 53 58 virtual Constant * acceptMutator( Mutator & m ) { return m.mutate( this ); } 54 virtual void print( std::ostream & os ) const;59 virtual void print( std::ostream & os, Indenter indent = 0 ) const; 55 60 private: 56 61 Type * type; -
src/SynTree/DeclStmt.cc
r78315272 r3f7e12cb 33 33 } 34 34 35 void DeclStmt::print( std::ostream &os, intindent ) const {35 void DeclStmt::print( std::ostream &os, Indenter indent ) const { 36 36 assert( decl != 0 ); 37 37 os << "Declaration of "; -
src/SynTree/Declaration.cc
r78315272 r3f7e12cb 42 42 43 43 void Declaration::fixUniqueId() { 44 // don't need to set unique ID twice 45 if ( uniqueId ) return; 44 46 uniqueId = ++lastUniqueId; 45 47 idMap[ uniqueId ] = this; … … 59 61 } 60 62 61 std::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 70 63 71 64 AsmDecl::AsmDecl( AsmStmt *stmt ) : Declaration( "", Type::StorageClasses(), LinkageSpec::C ), stmt( stmt ) { … … 79 72 } 80 73 81 void AsmDecl::print( std::ostream &os, intindent ) const {74 void AsmDecl::print( std::ostream &os, Indenter indent ) const { 82 75 stmt->print( os, indent ); 83 76 } 84 77 85 void AsmDecl::printShort( std::ostream &os, intindent ) const {78 void AsmDecl::printShort( std::ostream &os, Indenter indent ) const { 86 79 stmt->print( os, indent ); 87 80 } -
src/SynTree/Declaration.h
r78315272 r3f7e12cb 61 61 62 62 void fixUniqueId( void ); 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;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; 68 68 69 69 static void dumpIds( std::ostream &os ); … … 106 106 //void set_functionSpecifiers( Type::FuncSpecifiers newValue ) { fs = newValue; } 107 107 108 virtual DeclarationWithType *clone() const = 0;109 virtual DeclarationWithType *acceptMutator( Mutator &m ) = 0;108 virtual DeclarationWithType *clone() const override = 0; 109 virtual DeclarationWithType *acceptMutator( Mutator &m ) override = 0; 110 110 111 111 virtual Type * get_type() const = 0; … … 128 128 virtual ~ObjectDecl(); 129 129 130 virtual Type * get_type() const { return type; }131 virtual void set_type(Type *newType) { type = newType; }130 virtual Type * get_type() const override { return type; } 131 virtual void set_type(Type *newType) override { type = newType; } 132 132 133 133 Initializer *get_init() const { return init; } … … 139 139 static ObjectDecl * newObject( const std::string & name, Type * type, Initializer * init ); 140 140 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;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; 146 146 }; 147 147 … … 157 157 virtual ~FunctionDecl(); 158 158 159 Type * get_type() const{ return type; }160 virtual void set_type(Type * t) { type = strict_dynamic_cast< FunctionType* >( t ); }159 virtual Type * get_type() const override { return type; } 160 virtual void set_type(Type * t) override { type = strict_dynamic_cast< FunctionType* >( t ); } 161 161 162 162 FunctionType * get_functionType() const { return type; } … … 165 165 void set_statements( CompoundStmt *newValue ) { statements = newValue; } 166 166 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; 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; 172 174 }; 173 175 … … 190 192 virtual std::string typeString() const = 0; 191 193 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;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; 195 197 }; 196 198 … … 198 200 typedef NamedTypeDecl Parent; 199 201 public: 200 enum Kind { Any,Dtype, Ftype, Ttype };202 enum Kind { Dtype, Ftype, Ttype }; 201 203 202 204 Type * init; … … 214 216 }; 215 217 216 TypeDecl( const std::string &name, Type::StorageClasses scs, Type *type, Kind kind, Type * init = nullptr );218 TypeDecl( const std::string &name, Type::StorageClasses scs, Type *type, Kind kind, bool sized, Type * init = nullptr ); 217 219 TypeDecl( const TypeDecl &other ); 218 220 virtual ~TypeDecl(); … … 223 225 TypeDecl * set_init( Type * newValue ) { init = newValue; return this; } 224 226 225 bool isComplete() const { return kind == Any ||sized; }227 bool isComplete() const { return sized; } 226 228 bool get_sized() const { return sized; } 227 229 TypeDecl * set_sized( bool newValue ) { sized = newValue; return this; } 228 230 229 virtual std::string typeString() const ;231 virtual std::string typeString() const override; 230 232 virtual std::string genTypeString() const; 231 233 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;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; 236 238 237 239 private: … … 245 247 TypedefDecl( const TypedefDecl &other ) : Parent( other ) {} 246 248 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 ); }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 ); } 252 254 private: 253 255 }; … … 274 276 AggregateDecl * set_body( bool body ) { AggregateDecl::body = body; return this; } 275 277 276 virtual void print( std::ostream &os, int indent = 0 ) const;277 virtual void printShort( std::ostream &os, int indent = 0 ) const;278 virtual void print( std::ostream &os, Indenter indent = {} ) const override; 279 virtual void printShort( std::ostream &os, Indenter indent = {} ) const override; 278 280 protected: 279 281 virtual std::string typeString() const = 0; … … 290 292 bool is_thread() { return kind == DeclarationNode::Thread; } 291 293 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 ); }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 ); } 295 297 private: 296 298 DeclarationNode::Aggregate kind; 297 virtual std::string typeString() const ;299 virtual std::string typeString() const override; 298 300 }; 299 301 … … 304 306 UnionDecl( const UnionDecl &other ) : Parent( other ) {} 305 307 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 ;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; 311 313 }; 312 314 … … 317 319 EnumDecl( const EnumDecl &other ) : Parent( other ) {} 318 320 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 ;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; 324 326 }; 325 327 … … 332 334 TraitDecl( const TraitDecl &other ) : Parent( other ) {} 333 335 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 ;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; 339 341 }; 340 342 … … 350 352 void set_stmt( AsmStmt *newValue ) { stmt = newValue; } 351 353 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 359 std::ostream & operator<<( std::ostream & out, const Declaration * decl ); 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 360 361 std::ostream & operator<<( std::ostream & os, const TypeDecl::Data & data ); 361 362 -
src/SynTree/Expression.cc
r78315272 r3f7e12cb 33 33 #include "GenPoly/Lvalue.h" 34 34 35 Expression::Expression( Expression *_aname ) : result( 0 ), env( 0 ), argName( _aname ) {} 36 37 Expression::Expression( const Expression &other ) : BaseSyntaxNode( other ), result( maybeClone( other.result ) ), env( maybeClone( other.env ) ), argName( maybeClone( other.get_argName() ) ), extension( other.extension ) { 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 ) { 38 50 } 39 51 40 52 Expression::~Expression() { 41 53 delete env; 42 delete argName; // xxx -- there's a problem in cloning ConstantExpr I still don't know how to fix43 54 delete result; 44 55 } 45 56 46 void Expression::print( std::ostream &os, int indent ) const { 57 void Expression::print( std::ostream &os, Indenter indent ) const { 58 printInferParams( inferParams, os, indent+1, 0 ); 59 47 60 if ( env ) { 48 os << std:: string( indent, ' ' ) << "with environment:" << std::endl;49 env->print( os, indent+ 2);61 os << std::endl << indent << "... with environment:" << std::endl; 62 env->print( os, indent+1 ); 50 63 } // if 51 64 52 if ( argName ) { 53 os << std::string( indent, ' ' ) << "with designator:"; 54 argName->print( os, indent+2 ); 65 if ( extension ) { 66 os << std::endl << indent << "... with extension:"; 55 67 } // if 56 57 if ( extension ) { 58 os << std::string( indent, ' ' ) << "with extension:"; 59 } // if 60 } 61 62 ConstantExpr::ConstantExpr( Constant _c, Expression *_aname ) : Expression( _aname ), constant( _c ) { 68 } 69 70 ConstantExpr::ConstantExpr( Constant _c ) : Expression(), constant( _c ) { 63 71 set_result( constant.get_type()->clone() ); 64 72 } … … 69 77 ConstantExpr::~ConstantExpr() {} 70 78 71 void ConstantExpr::print( std::ostream &os, intindent ) const {79 void ConstantExpr::print( std::ostream &os, Indenter indent ) const { 72 80 os << "constant expression " ; 73 81 constant.print( os ); … … 75 83 } 76 84 77 VariableExpr::VariableExpr( DeclarationWithType *_var , Expression *_aname ) : Expression( _aname), var( _var ) {85 VariableExpr::VariableExpr( DeclarationWithType *_var ) : Expression(), var( _var ) { 78 86 assert( var ); 79 87 assert( var->get_type() ); … … 96 104 } 97 105 98 void VariableExpr::print( std::ostream &os, intindent ) const {106 void VariableExpr::print( std::ostream &os, Indenter indent ) const { 99 107 os << "Variable Expression: "; 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 107 SizeofExpr::SizeofExpr( Expression *expr_, Expression *_aname ) : 108 Expression( _aname ), expr(expr_), type(0), isType(false) { 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) { 109 114 set_result( new BasicType( Type::Qualifiers(), BasicType::LongUnsignedInt ) ); 110 115 } 111 116 112 SizeofExpr::SizeofExpr( Type *type_ , Expression *_aname) :113 Expression( _aname), expr(0), type(type_), isType(true) {117 SizeofExpr::SizeofExpr( Type *type_ ) : 118 Expression(), expr(0), type(type_), isType(true) { 114 119 set_result( new BasicType( Type::Qualifiers(), BasicType::LongUnsignedInt ) ); 115 120 } … … 124 129 } 125 130 126 void SizeofExpr::print( std::ostream &os, intindent) const {131 void SizeofExpr::print( std::ostream &os, Indenter indent) const { 127 132 os << "Sizeof Expression on: "; 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 138 AlignofExpr::AlignofExpr( Expression *expr_, Expression *_aname ) : 139 Expression( _aname ), expr(expr_), type(0), isType(false) { 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) { 140 140 set_result( new BasicType( Type::Qualifiers(), BasicType::LongUnsignedInt ) ); 141 141 } 142 142 143 AlignofExpr::AlignofExpr( Type *type_ , Expression *_aname) :144 Expression( _aname), expr(0), type(type_), isType(true) {143 AlignofExpr::AlignofExpr( Type *type_ ) : 144 Expression(), expr(0), type(type_), isType(true) { 145 145 set_result( new BasicType( Type::Qualifiers(), BasicType::LongUnsignedInt ) ); 146 146 } … … 155 155 } 156 156 157 void AlignofExpr::print( std::ostream &os, intindent) const {157 void AlignofExpr::print( std::ostream &os, Indenter indent) const { 158 158 os << "Alignof Expression on: "; 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 169 UntypedOffsetofExpr::UntypedOffsetofExpr( Type *type_, const std::string &member_, Expression *_aname ) : 170 Expression( _aname ), type(type_), member(member_) { 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 ); 171 167 set_result( new BasicType( Type::Qualifiers(), BasicType::LongUnsignedInt ) ); 172 168 } … … 179 175 } 180 176 181 void 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 194 OffsetofExpr::OffsetofExpr( Type *type_, DeclarationWithType *member_, Expression *_aname ) : 195 Expression( _aname ), type(type_), member(member_) { 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 ); 196 187 set_result( new BasicType( Type::Qualifiers(), BasicType::LongUnsignedInt ) ); 197 188 } … … 204 195 } 205 196 206 void 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 227 OffsetPackExpr::OffsetPackExpr( StructInstType *type_, Expression *aname_ ) : Expression( aname_ ), type( type_ ) { 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 ); 228 205 set_result( new ArrayType( Type::Qualifiers(), new BasicType( Type::Qualifiers(), BasicType::LongUnsignedInt ), 0, false, false ) ); 229 206 } … … 233 210 OffsetPackExpr::~OffsetPackExpr() { delete type; } 234 211 235 void 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 248 AttrExpr::AttrExpr( Expression *attr, Expression *expr_, Expression *_aname ) : 249 Expression( _aname ), attr( attr ), expr(expr_), type(0), isType(false) { 250 } 251 252 AttrExpr::AttrExpr( Expression *attr, Type *type_, Expression *_aname ) : 253 Expression( _aname ), attr( attr ), expr(0), type(type_), isType(true) { 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) { 254 224 } 255 225 … … 264 234 } 265 235 266 void AttrExpr::print( std::ostream &os, intindent) const {236 void AttrExpr::print( std::ostream &os, Indenter indent) const { 267 237 os << "Attr "; 268 attr->print( os, indent + 2);238 attr->print( os, indent+1); 269 239 if ( isType || expr ) { 270 240 os << "applied to: "; 271 272 if (isType) 273 type->print(os, indent + 2); 274 else 275 expr->print(os, indent + 2); 241 if (isType) type->print(os, indent+1); 242 else expr->print(os, indent+1); 276 243 } // if 277 278 os << std::endl; 279 Expression::print( os, indent ); 280 } 281 282 CastExpr::CastExpr( Expression *arg_, Type *toType, Expression *_aname ) : Expression( _aname ), arg(arg_) { 244 Expression::print( os, indent ); 245 } 246 247 CastExpr::CastExpr( Expression *arg_, Type *toType ) : Expression(), arg(arg_) { 283 248 set_result(toType); 284 249 } 285 250 286 CastExpr::CastExpr( Expression *arg_ , Expression *_aname ) : Expression( _aname), arg(arg_) {251 CastExpr::CastExpr( Expression *arg_ ) : Expression(), arg(arg_) { 287 252 set_result( new VoidType( Type::Qualifiers() ) ); 288 253 } … … 295 260 } 296 261 297 void 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, ' ' ); 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:"; 302 266 if ( result->isVoid() ) { 303 os << " nothing";267 os << " nothing"; 304 268 } else { 305 result->print( os, indent+2 ); 269 os << std::endl << indent+1; 270 result->print( os, indent+1 ); 306 271 } // if 307 os << std::endl;308 272 Expression::print( os, indent ); 309 273 } … … 320 284 } 321 285 322 void 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, ' ' ); 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:"; 327 290 if ( ! result ) { 328 os << " unknown";291 os << " unknown"; 329 292 } else { 330 result->print( os, indent+2 ); 293 os << std::endl << indent+1; 294 result->print( os, indent+1 ); 331 295 } // if 332 os << std::endl; 333 Expression::print( os, indent ); 334 } 335 336 UntypedMemberExpr::UntypedMemberExpr( Expression * _member, Expression *_aggregate, Expression *_aname ) : 337 Expression( _aname ), member(_member), aggregate(_aggregate) {} 296 Expression::print( os, indent ); 297 } 298 299 UntypedMemberExpr::UntypedMemberExpr( Expression * member, Expression *aggregate ) : 300 Expression(), member(member), aggregate(aggregate) { 301 assert( aggregate ); 302 } 338 303 339 304 UntypedMemberExpr::UntypedMemberExpr( const UntypedMemberExpr &other ) : … … 346 311 } 347 312 348 void 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, ' ' ); 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); 361 318 Expression::print( os, indent ); 362 319 } … … 377 334 378 335 379 MemberExpr::MemberExpr( DeclarationWithType *_member, Expression *_aggregate, Expression *_aname ) : 380 Expression( _aname ), member(_member), aggregate(_aggregate) { 336 MemberExpr::MemberExpr( DeclarationWithType *member, Expression *aggregate ) : 337 Expression(), member(member), aggregate(aggregate) { 338 assert( member ); 339 assert( aggregate ); 381 340 382 341 TypeSubstitution sub( makeSub( aggregate->get_result() ) ); … … 396 355 } 397 356 398 void MemberExpr::print( std::ostream &os, intindent ) const {357 void MemberExpr::print( std::ostream &os, Indenter indent ) const { 399 358 os << "Member Expression, with field: " << std::endl; 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 416 UntypedExpr::UntypedExpr( Expression *_function, const std::list<Expression *> &_args, Expression *_aname ) : 417 Expression( _aname ), function(_function), args(_args) {} 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) {} 418 368 419 369 UntypedExpr::UntypedExpr( const UntypedExpr &other ) : … … 456 406 457 407 458 void UntypedExpr::print( std::ostream &os, intindent ) const {408 void UntypedExpr::print( std::ostream &os, Indenter indent ) const { 459 409 os << "Applying untyped: " << std::endl; 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 467 void 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 475 NameExpr::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"); 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"); 478 420 } 479 421 … … 483 425 NameExpr::~NameExpr() {} 484 426 485 void NameExpr::print( std::ostream &os, intindent ) const {486 os << "Name: " << get_name() << std::endl;487 Expression::print( os, indent ); 488 } 489 490 LogicalExpr::LogicalExpr( Expression *arg1_, Expression *arg2_, bool andp , Expression *_aname) :491 Expression( _aname), arg1(arg1_), arg2(arg2_), isAnd(andp) {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) { 492 434 set_result( new BasicType( Type::Qualifiers(), BasicType::SignedInt ) ); 493 435 } … … 502 444 } 503 445 504 void LogicalExpr::print( std::ostream &os, intindent )const {505 os << "Short-circuited operation (" << (isAnd ?"and":"or") << ") on: ";446 void LogicalExpr::print( std::ostream &os, Indenter indent )const { 447 os << "Short-circuited operation (" << (isAnd ? "and" : "or") << ") on: "; 506 448 arg1->print(os); 507 449 os << " and "; 508 450 arg2->print(os); 509 os << std::endl; 510 Expression::print( os, indent ); 511 } 512 513 ConditionalExpr::ConditionalExpr( Expression *arg1_, Expression *arg2_, Expression *arg3_, Expression *_aname ) : 514 Expression( _aname ), arg1(arg1_), arg2(arg2_), arg3(arg3_) {} 451 Expression::print( os, indent ); 452 } 453 454 ConditionalExpr::ConditionalExpr( Expression * arg1, Expression * arg2, Expression * arg3 ) : 455 Expression(), arg1(arg1), arg2(arg2), arg3(arg3) {} 515 456 516 457 ConditionalExpr::ConditionalExpr( const ConditionalExpr &other ) : … … 524 465 } 525 466 526 void 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; 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 ); 537 474 Expression::print( os, indent ); 538 475 } … … 541 478 542 479 543 void AsmExpr::print( std::ostream &os, intindent ) const {480 void AsmExpr::print( std::ostream &os, Indenter indent ) const { 544 481 os << "Asm Expression: " << std::endl; 545 if ( inout ) inout->print( os, indent + 2);546 if ( constraint ) constraint->print( os, indent + 2);547 if ( operand ) operand->print( os, indent + 2);482 if ( inout ) inout->print( os, indent+1 ); 483 if ( constraint ) constraint->print( os, indent+1 ); 484 if ( operand ) operand->print( os, indent+1 ); 548 485 } 549 486 … … 551 488 ImplicitCopyCtorExpr::ImplicitCopyCtorExpr( ApplicationExpr * callExpr ) : callExpr( callExpr ) { 552 489 assert( callExpr ); 553 assert( callExpr-> has_result());490 assert( callExpr->result ); 554 491 set_result( callExpr->get_result()->clone() ); 555 492 } … … 569 506 } 570 507 571 void 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); 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 ); 580 515 Expression::print( os, indent ); 581 516 } … … 587 522 Expression * arg = InitTweak::getCallArg( callExpr, 0 ); 588 523 assert( arg ); 589 set_result( maybeClone( arg-> get_result()) );524 set_result( maybeClone( arg->result ) ); 590 525 } 591 526 … … 597 532 } 598 533 599 void ConstructorExpr::print( std::ostream &os, int indent ) const { 600 os << "Constructor Expression: " << std::endl; 601 assert( callExpr ); 602 os << std::string( indent+2, ' ' ); 534 void ConstructorExpr::print( std::ostream &os, Indenter indent ) const { 535 os << "Constructor Expression: " << std::endl << indent+1; 603 536 callExpr->print( os, indent + 2 ); 604 537 Expression::print( os, indent ); … … 618 551 } 619 552 620 void 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 ); 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 ); 626 558 Expression::print( os, indent ); 627 559 } … … 629 561 RangeExpr::RangeExpr( Expression *low, Expression *high ) : low( low ), high( high ) {} 630 562 RangeExpr::RangeExpr( const RangeExpr &other ) : Expression( other ), low( other.low->clone() ), high( other.high->clone() ) {} 631 void RangeExpr::print( std::ostream &os, intindent ) const {563 void RangeExpr::print( std::ostream &os, Indenter indent ) const { 632 564 os << "Range Expression: "; 633 565 low->print( os, indent ); … … 659 591 deleteAll( returnDecls ); 660 592 } 661 void StmtExpr::print( std::ostream &os, intindent ) const {662 os << "Statement Expression: " << std::endl << std::string( indent, ' ' );663 statements->print( os, indent+ 2);593 void StmtExpr::print( std::ostream &os, Indenter indent ) const { 594 os << "Statement Expression: " << std::endl << indent+1; 595 statements->print( os, indent+1 ); 664 596 if ( ! returnDecls.empty() ) { 665 os << std::string( indent+2, ' ' ) << "with returnDecls: ";666 printAll( returnDecls, os, indent+ 2);597 os << indent+1 << "... with returnDecls: "; 598 printAll( returnDecls, os, indent+1 ); 667 599 } 668 600 if ( ! dtors.empty() ) { 669 os << std::string( indent+2, ' ' ) << "with dtors: ";670 printAll( dtors, os, indent+ 2);601 os << indent+1 << "... with dtors: "; 602 printAll( dtors, os, indent+1 ); 671 603 } 672 604 Expression::print( os, indent ); … … 690 622 delete var; 691 623 } 692 void UniqueExpr::print( std::ostream &os, intindent ) 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);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 ); 698 630 } 699 631 Expression::print( os, indent ); … … 713 645 } 714 646 715 void UntypedInitExpr::print( std::ostream & os, intindent ) const {716 os << "Untyped Init Expression" << std::endl << std::string( indent+2, ' ' );717 expr->print( os, indent+ 2);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 ); 718 650 if ( ! initAlts.empty() ) { 719 651 for ( const InitAlternative & alt : initAlts ) { 720 os << std::string( indent+2, ' ' )<< "InitAlternative: ";721 alt.type->print( os, indent+ 2);722 alt.designation->print( os, indent+ 2);652 os << indent+1 << "InitAlternative: "; 653 alt.type->print( os, indent+1 ); 654 alt.designation->print( os, indent+1 ); 723 655 } 724 656 } … … 734 666 } 735 667 736 void 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 744 std::ostream & operator<<( std::ostream & out, const Expression * expr ) { 745 if ( expr ) { 746 expr->print( out ); 747 } else { 748 out << "nullptr"; 749 } 750 return out; 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 ); 751 673 } 752 674 -
src/SynTree/Expression.h
r78315272 r3f7e12cb 31 31 32 32 33 /// Expression is the root type for all expressions34 class 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 name39 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 63 33 struct ParamEntry; 64 34 … … 77 47 Type * actualType; 78 48 Type * formalType; 79 Expression * expr;49 Expression * expr; 80 50 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; 81 80 }; 82 81 … … 87 86 Expression * function; 88 87 std::list<Expression *> args; 89 InferredParams inferParams;90 88 91 89 ApplicationExpr( Expression * function, const std::list<Expression *> & args = std::list< Expression * >() ); … … 96 94 void set_function( Expression * newValue ) { function = newValue; } 97 95 std::list<Expression *>& get_args() { return args; } 98 InferredParams & get_inferParams() { return inferParams; }99 96 100 97 virtual ApplicationExpr * clone() const { return new ApplicationExpr( * this ); } 101 98 virtual void accept( Visitor & v ) { v.visit( this ); } 102 99 virtual Expression * acceptMutator( Mutator & m ) { return m.mutate( this ); } 103 virtual void print( std::ostream & os, int indent = 0) const;100 virtual void print( std::ostream & os, Indenter indent = {} ) const; 104 101 }; 105 102 … … 112 109 std::list<Expression*> args; 113 110 114 UntypedExpr( Expression * function, const std::list<Expression *> & args = std::list< Expression * >() , Expression *_aname = nullptr);111 UntypedExpr( Expression * function, const std::list<Expression *> & args = std::list< Expression * >() ); 115 112 UntypedExpr( const UntypedExpr & other ); 116 113 virtual ~UntypedExpr(); … … 119 116 void set_function( Expression * newValue ) { function = newValue; } 120 117 121 void set_args( std::list<Expression *> & listArgs ) { args = listArgs; }122 118 std::list<Expression*>::iterator begin_args() { return args.begin(); } 123 119 std::list<Expression*>::iterator end_args() { return args.end(); } … … 130 126 virtual void accept( Visitor & v ) { v.visit( this ); } 131 127 virtual Expression * acceptMutator( Mutator & m ) { return m.mutate( this ); } 132 virtual void print( std::ostream & os, int indent = 0 ) const; 133 virtual void printArgs(std::ostream & os, int indent = 0) const; 128 virtual void print( std::ostream & os, Indenter indent = {} ) const; 134 129 }; 135 130 … … 139 134 std::string name; 140 135 141 NameExpr( std::string name , Expression *_aname = nullptr);136 NameExpr( std::string name ); 142 137 NameExpr( const NameExpr & other ); 143 138 virtual ~NameExpr(); … … 149 144 virtual void accept( Visitor & v ) { v.visit( this ); } 150 145 virtual Expression * acceptMutator( Mutator & m ) { return m.mutate( this ); } 151 virtual void print( std::ostream & os, int indent = 0) const;146 virtual void print( std::ostream & os, Indenter indent = {} ) const; 152 147 }; 153 148 … … 160 155 Expression * arg; 161 156 162 AddressExpr( Expression * arg , Expression *_aname = nullptr);157 AddressExpr( Expression * arg ); 163 158 AddressExpr( const AddressExpr & other ); 164 159 virtual ~AddressExpr(); … … 170 165 virtual void accept( Visitor & v ) { v.visit( this ); } 171 166 virtual Expression * acceptMutator( Mutator & m ) { return m.mutate( this ); } 172 virtual void print( std::ostream & os, int indent = 0) const;167 virtual void print( std::ostream & os, Indenter indent = {} ) const; 173 168 }; 174 169 … … 186 181 virtual void accept( Visitor & v ) { v.visit( this ); } 187 182 virtual Expression * acceptMutator( Mutator & m ) { return m.mutate( this ); } 188 virtual void print( std::ostream & os, int indent = 0) const;183 virtual void print( std::ostream & os, Indenter indent = {} ) const; 189 184 }; 190 185 … … 194 189 Expression * arg; 195 190 196 CastExpr( Expression * arg , Expression *_aname = nullptr);197 CastExpr( Expression * arg, Type * toType , Expression *_aname = nullptr);191 CastExpr( Expression * arg ); 192 CastExpr( Expression * arg, Type * toType ); 198 193 CastExpr( const CastExpr & other ); 199 194 virtual ~CastExpr(); … … 205 200 virtual void accept( Visitor & v ) { v.visit( this ); } 206 201 virtual Expression * acceptMutator( Mutator & m ) { return m.mutate( this ); } 207 virtual void print( std::ostream & os, int indent = 0) const;202 virtual void print( std::ostream & os, Indenter indent = {} ) const; 208 203 }; 209 204 … … 223 218 virtual void accept( Visitor & v ) { v.visit( this ); } 224 219 virtual Expression * acceptMutator( Mutator & m ) { return m.mutate( this ); } 225 virtual void print( std::ostream & os, int indent = 0) const;220 virtual void print( std::ostream & os, Indenter indent = {} ) const; 226 221 }; 227 222 … … 232 227 Expression * aggregate; 233 228 234 UntypedMemberExpr( Expression * member, Expression * aggregate , Expression *_aname = nullptr);229 UntypedMemberExpr( Expression * member, Expression * aggregate ); 235 230 UntypedMemberExpr( const UntypedMemberExpr & other ); 236 231 virtual ~UntypedMemberExpr(); … … 244 239 virtual void accept( Visitor & v ) { v.visit( this ); } 245 240 virtual Expression * acceptMutator( Mutator & m ) { return m.mutate( this ); } 246 virtual void print( std::ostream & os, int indent = 0) const;241 virtual void print( std::ostream & os, Indenter indent = {} ) const; 247 242 }; 248 243 … … 254 249 Expression * aggregate; 255 250 256 MemberExpr( DeclarationWithType * member, Expression * aggregate , Expression *_aname = nullptr);251 MemberExpr( DeclarationWithType * member, Expression * aggregate ); 257 252 MemberExpr( const MemberExpr & other ); 258 253 virtual ~MemberExpr(); … … 266 261 virtual void accept( Visitor & v ) { v.visit( this ); } 267 262 virtual Expression * acceptMutator( Mutator & m ) { return m.mutate( this ); } 268 virtual void print( std::ostream & os, int indent = 0) const;263 virtual void print( std::ostream & os, Indenter indent = {} ) const; 269 264 }; 270 265 … … 275 270 DeclarationWithType * var; 276 271 277 VariableExpr( DeclarationWithType * var , Expression *_aname = nullptr);272 VariableExpr( DeclarationWithType * var ); 278 273 VariableExpr( const VariableExpr & other ); 279 274 virtual ~VariableExpr(); … … 287 282 virtual void accept( Visitor & v ) { v.visit( this ); } 288 283 virtual Expression * acceptMutator( Mutator & m ) { return m.mutate( this ); } 289 virtual void print( std::ostream & os, int indent = 0) const;284 virtual void print( std::ostream & os, Indenter indent = {} ) const; 290 285 }; 291 286 … … 295 290 Constant constant; 296 291 297 ConstantExpr( Constant constant , Expression *_aname = nullptr);292 ConstantExpr( Constant constant ); 298 293 ConstantExpr( const ConstantExpr & other ); 299 294 virtual ~ConstantExpr(); … … 305 300 virtual void accept( Visitor & v ) { v.visit( this ); } 306 301 virtual Expression * acceptMutator( Mutator & m ) { return m.mutate( this ); } 307 virtual void print( std::ostream & os, int indent = 0) const;302 virtual void print( std::ostream & os, Indenter indent = {} ) const; 308 303 }; 309 304 … … 315 310 bool isType; 316 311 317 SizeofExpr( Expression * expr , Expression *_aname = nullptr);312 SizeofExpr( Expression * expr ); 318 313 SizeofExpr( const SizeofExpr & other ); 319 SizeofExpr( Type * type , Expression *_aname = nullptr);314 SizeofExpr( Type * type ); 320 315 virtual ~SizeofExpr(); 321 316 … … 330 325 virtual void accept( Visitor & v ) { v.visit( this ); } 331 326 virtual Expression * acceptMutator( Mutator & m ) { return m.mutate( this ); } 332 virtual void print( std::ostream & os, int indent = 0) const;327 virtual void print( std::ostream & os, Indenter indent = {} ) const; 333 328 }; 334 329 … … 340 335 bool isType; 341 336 342 AlignofExpr( Expression * expr , Expression *_aname = nullptr);337 AlignofExpr( Expression * expr ); 343 338 AlignofExpr( const AlignofExpr & other ); 344 AlignofExpr( Type * type , Expression *_aname = nullptr);339 AlignofExpr( Type * type ); 345 340 virtual ~AlignofExpr(); 346 341 … … 355 350 virtual void accept( Visitor & v ) { v.visit( this ); } 356 351 virtual Expression * acceptMutator( Mutator & m ) { return m.mutate( this ); } 357 virtual void print( std::ostream & os, int indent = 0) const;352 virtual void print( std::ostream & os, Indenter indent = {} ) const; 358 353 }; 359 354 … … 364 359 std::string member; 365 360 366 UntypedOffsetofExpr( Type * type, const std::string & member , Expression *_aname = nullptr);361 UntypedOffsetofExpr( Type * type, const std::string & member ); 367 362 UntypedOffsetofExpr( const UntypedOffsetofExpr & other ); 368 363 virtual ~UntypedOffsetofExpr(); … … 376 371 virtual void accept( Visitor & v ) { v.visit( this ); } 377 372 virtual Expression * acceptMutator( Mutator & m ) { return m.mutate( this ); } 378 virtual void print( std::ostream & os, int indent = 0) const;373 virtual void print( std::ostream & os, Indenter indent = {} ) const; 379 374 }; 380 375 … … 385 380 DeclarationWithType * member; 386 381 387 OffsetofExpr( Type * type, DeclarationWithType * member , Expression *_aname = nullptr);382 OffsetofExpr( Type * type, DeclarationWithType * member ); 388 383 OffsetofExpr( const OffsetofExpr & other ); 389 384 virtual ~OffsetofExpr(); … … 397 392 virtual void accept( Visitor & v ) { v.visit( this ); } 398 393 virtual Expression * acceptMutator( Mutator & m ) { return m.mutate( this ); } 399 virtual void print( std::ostream & os, int indent = 0) const;394 virtual void print( std::ostream & os, Indenter indent = {} ) const; 400 395 }; 401 396 … … 405 400 StructInstType * type; 406 401 407 OffsetPackExpr( StructInstType * type _, Expression * aname_ = 0);402 OffsetPackExpr( StructInstType * type ); 408 403 OffsetPackExpr( const OffsetPackExpr & other ); 409 404 virtual ~OffsetPackExpr(); … … 415 410 virtual void accept( Visitor & v ) { v.visit( this ); } 416 411 virtual Expression * acceptMutator( Mutator & m ) { return m.mutate( this ); } 417 virtual void print( std::ostream & os, int indent = 0) const;412 virtual void print( std::ostream & os, Indenter indent = {} ) const; 418 413 }; 419 414 … … 426 421 bool isType; 427 422 428 AttrExpr(Expression * attr, Expression * expr , Expression *_aname = nullptr);423 AttrExpr(Expression * attr, Expression * expr ); 429 424 AttrExpr( const AttrExpr & other ); 430 AttrExpr( Expression * attr, Type * type , Expression *_aname = nullptr);425 AttrExpr( Expression * attr, Type * type ); 431 426 virtual ~AttrExpr(); 432 427 … … 443 438 virtual void accept( Visitor & v ) { v.visit( this ); } 444 439 virtual Expression * acceptMutator( Mutator & m ) { return m.mutate( this ); } 445 virtual void print( std::ostream & os, int indent = 0) const;440 virtual void print( std::ostream & os, Indenter indent = {} ) const; 446 441 }; 447 442 … … 452 447 Expression * arg2; 453 448 454 LogicalExpr( Expression * arg1, Expression * arg2, bool andp = true , Expression *_aname = nullptr);449 LogicalExpr( Expression * arg1, Expression * arg2, bool andp = true ); 455 450 LogicalExpr( const LogicalExpr & other ); 456 451 virtual ~LogicalExpr(); … … 465 460 virtual void accept( Visitor & v ) { v.visit( this ); } 466 461 virtual Expression * acceptMutator( Mutator & m ) { return m.mutate( this ); } 467 virtual void print( std::ostream & os, int indent = 0) const;462 virtual void print( std::ostream & os, Indenter indent = {} ) const; 468 463 469 464 private: … … 478 473 Expression * arg3; 479 474 480 ConditionalExpr( Expression * arg1, Expression * arg2, Expression * arg3 , Expression *_aname = nullptr);475 ConditionalExpr( Expression * arg1, Expression * arg2, Expression * arg3 ); 481 476 ConditionalExpr( const ConditionalExpr & other ); 482 477 virtual ~ConditionalExpr(); … … 492 487 virtual void accept( Visitor & v ) { v.visit( this ); } 493 488 virtual Expression * acceptMutator( Mutator & m ) { return m.mutate( this ); } 494 virtual void print( std::ostream & os, int indent = 0) const;489 virtual void print( std::ostream & os, Indenter indent = {} ) const; 495 490 }; 496 491 … … 501 496 Expression * arg2; 502 497 503 CommaExpr( Expression * arg1, Expression * arg2 , Expression *_aname = nullptr);498 CommaExpr( Expression * arg1, Expression * arg2 ); 504 499 CommaExpr( const CommaExpr & other ); 505 500 virtual ~CommaExpr(); … … 513 508 virtual void accept( Visitor & v ) { v.visit( this ); } 514 509 virtual Expression * acceptMutator( Mutator & m ) { return m.mutate( this ); } 515 virtual void print( std::ostream & os, int indent = 0) const;510 virtual void print( std::ostream & os, Indenter indent = {} ) const; 516 511 }; 517 512 … … 531 526 virtual void accept( Visitor & v ) { v.visit( this ); } 532 527 virtual Expression * acceptMutator( Mutator & m ) { return m.mutate( this ); } 533 virtual void print( std::ostream & os, int indent = 0) const;528 virtual void print( std::ostream & os, Indenter indent = {} ) const; 534 529 }; 535 530 … … 557 552 virtual void accept( Visitor & v ) { v.visit( this ); } 558 553 virtual Expression * acceptMutator( Mutator & m ) { return m.mutate( this ); } 559 virtual void print( std::ostream & os, int indent = 0) const;554 virtual void print( std::ostream & os, Indenter indent = {} ) const; 560 555 561 556 // https://gcc.gnu.org/onlinedocs/gcc-4.7.1/gcc/Machine-Constraints.html#Machine-Constraints … … 585 580 virtual void accept( Visitor & v ) { v.visit( this ); } 586 581 virtual Expression * acceptMutator( Mutator & m ) { return m.mutate( this ); } 587 virtual void print( std::ostream & os, int indent = 0) const;582 virtual void print( std::ostream & os, Indenter indent = {} ) const; 588 583 }; 589 584 … … 603 598 virtual void accept( Visitor & v ) { v.visit( this ); } 604 599 virtual Expression * acceptMutator( Mutator & m ) { return m.mutate( this ); } 605 virtual void print( std::ostream & os, int indent = 0) const;600 virtual void print( std::ostream & os, Indenter indent = {} ) const; 606 601 }; 607 602 … … 621 616 virtual void accept( Visitor & v ) { v.visit( this ); } 622 617 virtual Expression * acceptMutator( Mutator & m ) { return m.mutate( this ); } 623 virtual void print( std::ostream & os, int indent = 0) const;618 virtual void print( std::ostream & os, Indenter indent = {} ) const; 624 619 }; 625 620 … … 640 635 virtual void accept( Visitor & v ) { v.visit( this ); } 641 636 virtual Expression * acceptMutator( Mutator & m ) { return m.mutate( this ); } 642 virtual void print( std::ostream & os, int indent = 0) const;637 virtual void print( std::ostream & os, Indenter indent = {} ) const; 643 638 }; 644 639 … … 648 643 std::list<Expression*> exprs; 649 644 650 UntypedTupleExpr( const std::list< Expression * > & exprs , Expression *_aname = nullptr);645 UntypedTupleExpr( const std::list< Expression * > & exprs ); 651 646 UntypedTupleExpr( const UntypedTupleExpr & other ); 652 647 virtual ~UntypedTupleExpr(); … … 657 652 virtual void accept( Visitor & v ) { v.visit( this ); } 658 653 virtual Expression * acceptMutator( Mutator & m ) { return m.mutate( this ); } 659 virtual void print( std::ostream & os, int indent = 0) const;654 virtual void print( std::ostream & os, Indenter indent = {} ) const; 660 655 }; 661 656 … … 665 660 std::list<Expression*> exprs; 666 661 667 TupleExpr( const std::list< Expression * > & exprs , Expression *_aname = nullptr);662 TupleExpr( const std::list< Expression * > & exprs ); 668 663 TupleExpr( const TupleExpr & other ); 669 664 virtual ~TupleExpr(); … … 674 669 virtual void accept( Visitor & v ) { v.visit( this ); } 675 670 virtual Expression * acceptMutator( Mutator & m ) { return m.mutate( this ); } 676 virtual void print( std::ostream & os, int indent = 0) const;671 virtual void print( std::ostream & os, Indenter indent = {} ) const; 677 672 }; 678 673 … … 695 690 virtual void accept( Visitor & v ) { v.visit( this ); } 696 691 virtual Expression * acceptMutator( Mutator & m ) { return m.mutate( this ); } 697 virtual void print( std::ostream & os, int indent = 0) const;692 virtual void print( std::ostream & os, Indenter indent = {} ) const; 698 693 }; 699 694 … … 703 698 StmtExpr * stmtExpr = nullptr; 704 699 705 TupleAssignExpr( const std::list< Expression * > & assigns, const std::list< ObjectDecl * > & tempDecls , Expression * _aname = nullptr);700 TupleAssignExpr( const std::list< Expression * > & assigns, const std::list< ObjectDecl * > & tempDecls ); 706 701 TupleAssignExpr( const TupleAssignExpr & other ); 707 702 virtual ~TupleAssignExpr(); … … 713 708 virtual void accept( Visitor & v ) { v.visit( this ); } 714 709 virtual Expression * acceptMutator( Mutator & m ) { return m.mutate( this ); } 715 virtual void print( std::ostream & os, int indent = 0) const;710 virtual void print( std::ostream & os, Indenter indent = {} ) const; 716 711 }; 717 712 … … 736 731 virtual void accept( Visitor & v ) { v.visit( this ); } 737 732 virtual Expression * acceptMutator( Mutator & m ) { return m.mutate( this ); } 738 virtual void print( std::ostream & os, int indent = 0) const;733 virtual void print( std::ostream & os, Indenter indent = {} ) const; 739 734 }; 740 735 … … 763 758 virtual void accept( Visitor & v ) { v.visit( this ); } 764 759 virtual Expression * acceptMutator( Mutator & m ) { return m.mutate( this ); } 765 virtual void print( std::ostream & os, int indent = 0) const;760 virtual void print( std::ostream & os, Indenter indent = {} ) const; 766 761 767 762 private: … … 797 792 virtual void accept( Visitor & v ) { v.visit( this ); } 798 793 virtual Expression * acceptMutator( Mutator & m ) { return m.mutate( this ); } 799 virtual void print( std::ostream & os, int indent = 0) const;794 virtual void print( std::ostream & os, Indenter indent = {} ) const; 800 795 }; 801 796 … … 818 813 virtual void accept( Visitor & v ) { v.visit( this ); } 819 814 virtual Expression * acceptMutator( Mutator & m ) { return m.mutate( this ); } 820 virtual void print( std::ostream & os, int indent = 0 ) const; 821 }; 822 823 824 std::ostream & operator<<( std::ostream & out, const Expression * expr ); 815 virtual void print( std::ostream & os, Indenter indent = {} ) const; 816 }; 825 817 826 818 // Local Variables: // -
src/SynTree/FunctionDecl.cc
r78315272 r3f7e12cb 26 26 #include "Statement.h" // for CompoundStmt 27 27 #include "Type.h" // for Type, FunctionType, Type::FuncSpecif... 28 #include "VarExprReplacer.h" 28 29 29 30 extern bool translation_unit_nomain; … … 39 40 FunctionDecl::FunctionDecl( const FunctionDecl &other ) 40 41 : 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 } 41 54 } 42 55 … … 46 59 } 47 60 48 void FunctionDecl::print( std::ostream &os, int indent ) const { 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 { 49 66 using std::endl; 50 67 using std::string; 51 68 52 if ( get_name()!= "" ) {53 os << get_name()<< ": ";69 if ( name != "" ) { 70 os << name << ": "; 54 71 } // if 55 if ( get_linkage()!= LinkageSpec::Cforall ) {56 os << LinkageSpec::linkageName( get_linkage()) << " ";72 if ( linkage != LinkageSpec::Cforall ) { 73 os << LinkageSpec::linkageName( linkage ) << " "; 57 74 } // if 58 75 59 printAll( get_attributes(), os, indent );76 printAll( attributes, os, indent ); 60 77 61 78 get_storageClasses().print( os ); 62 79 get_funcSpec().print( os ); 63 80 64 if ( get_type()) {65 get_type()->print( os, indent );81 if ( type ) { 82 type->print( os, indent ); 66 83 } else { 67 84 os << "untyped entity "; … … 69 86 70 87 if ( statements ) { 71 os << string( indent + 2, ' ' ) << "with body " << endl; 72 os << string( indent + 4, ' ' ); 73 statements->print( os, indent + 4 ); 88 os << indent << "... with body " << endl << indent+1; 89 statements->print( os, indent+1 ); 74 90 } // if 75 91 } 76 92 77 void FunctionDecl::printShort( std::ostream &os, intindent ) const {93 void FunctionDecl::printShort( std::ostream &os, Indenter indent ) const { 78 94 using std::endl; 79 95 using std::string; 80 96 81 if ( get_name()!= "" ) {82 os << get_name()<< ": ";97 if ( name != "" ) { 98 os << name << ": "; 83 99 } // if 84 85 // xxx - should printShort print attributes?86 100 87 101 get_storageClasses().print( os ); 88 102 get_funcSpec().print( os ); 89 103 90 if ( get_type()) {91 get_type()->print( os, indent );104 if ( type ) { 105 type->print( os, indent ); 92 106 } else { 93 107 os << "untyped entity "; -
src/SynTree/FunctionType.cc
r78315272 r3f7e12cb 51 51 } 52 52 53 void FunctionType::print( std::ostream &os, intindent ) const {53 void FunctionType::print( std::ostream &os, Indenter indent ) const { 54 54 using std::string; 55 55 using std::endl; … … 58 58 os << "function" << endl; 59 59 if ( ! parameters.empty() ) { 60 os << string( indent + 2, ' ' ) << "with parameters" << endl;61 printAll( parameters, os, indent + 4);60 os << indent << "... with parameters" << endl; 61 printAll( parameters, os, indent+1 ); 62 62 if ( isVarArgs ) { 63 os << string( indent + 4, ' ' )<< "and a variable number of other arguments" << endl;63 os << indent+1 << "and a variable number of other arguments" << endl; 64 64 } // if 65 65 } else if ( isVarArgs ) { 66 os << string( indent + 4, ' ' )<< "accepting unspecified arguments" << endl;66 os << indent+1 << "accepting unspecified arguments" << endl; 67 67 } // if 68 os << string( indent + 2, ' ' ) << "returning ";68 os << indent << "... returning "; 69 69 if ( returnVals.empty() ) { 70 os << endl << string( indent + 4, ' ' ) <<"nothing " << endl;70 os << "nothing " << endl; 71 71 } else { 72 72 os << endl; 73 printAll( returnVals, os, indent + 4);73 printAll( returnVals, os, indent+1 ); 74 74 } // if 75 75 } -
src/SynTree/Initializer.cc
r78315272 r3f7e12cb 38 38 } 39 39 40 void Designation::print( std::ostream &os, intindent ) const {40 void Designation::print( std::ostream &os, Indenter indent ) const { 41 41 if ( ! designators.empty() ) { 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 ); 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; 46 47 } 47 os << std::endl;48 48 } // if 49 49 } … … 64 64 } 65 65 66 void 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 ); 66 void SingleInit::print( std::ostream &os, Indenter indent ) const { 67 os << "Simple Initializer: "; 68 value->print( os, indent ); 70 69 } 71 70 … … 93 92 } 94 93 95 void 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 ); 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 ); 103 101 os << std::endl; 102 if ( ! d->designators.empty() ) { 103 os << indent+1; 104 d->print( os, indent+1 ); 105 } 104 106 } 105 107 } … … 116 118 } 117 119 118 void ConstructorInit::print( std::ostream &os, intindent ) const {119 os << std::endl << std::string(indent, ' ') <<"Constructor initializer: " << std::endl;120 void ConstructorInit::print( std::ostream &os, Indenter indent ) const { 121 os << "Constructor initializer: " << std::endl; 120 122 if ( ctor ) { 121 os << std::string(indent+2, ' '); 122 os << "initially constructed with "; 123 ctor->print( os, indent+4 ); 123 os << indent << "... initially constructed with "; 124 ctor->print( os, indent+1 ); 124 125 } // if 125 126 126 127 if ( dtor ) { 127 os << std::string(indent+2, ' '); 128 os << "destructed with "; 129 dtor->print( os, indent+4 ); 128 os << indent << "... destructed with "; 129 dtor->print( os, indent+1 ); 130 130 } 131 131 132 132 if ( init ) { 133 os << std::string(indent+2, ' '); 134 os << "with fallback C-style initializer: "; 135 init->print( os, indent+4 ); 133 os << indent << "... with fallback C-style initializer: "; 134 init->print( os, indent+1 ); 136 135 } 137 }138 139 std::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 148 std::ostream & operator<<( std::ostream & out, const Designation * des ) {149 if ( des ) {150 des->print( out );151 } else {152 out << "nullptr";153 }154 return out;155 136 } 156 137 -
src/SynTree/Initializer.h
r78315272 r3f7e12cb 37 37 std::list< Expression * > & get_designators() { return designators; } 38 38 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;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; 43 43 }; 44 44 … … 54 54 bool get_maybeConstructed() { return maybeConstructed; } 55 55 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;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; 60 60 private: 61 61 bool maybeConstructed; … … 75 75 void set_value( Expression *newValue ) { value = newValue; } 76 76 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;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; 81 81 }; 82 82 … … 103 103 const_iterator end() const { return initializers.end(); } 104 104 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;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; 109 109 }; 110 110 … … 117 117 Statement * ctor; 118 118 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; 119 122 120 123 ConstructorInit( Statement * ctor, Statement * dtor, Initializer * init ); … … 129 132 Initializer * get_init() const { return init; } 130 133 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;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; 135 138 136 139 private: 137 // C-style initializer made up of SingleInit and ListInit nodes to use as a fallback138 // if an appropriate constructor definition is not found by the resolver139 Initializer * init;140 140 }; 141 142 std::ostream & operator<<( std::ostream & out, const Initializer * init );143 std::ostream & operator<<( std::ostream & out, const Designation * des );144 141 145 142 // Local Variables: // -
src/SynTree/Mutator.cc
r78315272 r3f7e12cb 17 17 #include <list> // for list 18 18 19 #include "Attribute.h" // for Attribute 19 20 #include "Declaration.h" // for ObjectDecl, Declaration, DeclarationWi... 20 21 #include "Expression.h" // for Expression, ConstantExpr, ConditionalExpr … … 36 37 objectDecl->set_init( maybeMutate( objectDecl->get_init(), *this ) ); 37 38 objectDecl->set_bitfieldWidth( maybeMutate( objectDecl->get_bitfieldWidth(), *this ) ); 39 mutateAll( objectDecl->attributes, *this ); 38 40 return objectDecl; 39 41 } … … 42 44 functionDecl->set_functionType( maybeMutate( functionDecl->get_functionType(), *this ) ); 43 45 functionDecl->set_statements( maybeMutate( functionDecl->get_statements(), *this ) ); 46 mutateAll( functionDecl->attributes, *this ); 44 47 return functionDecl; 45 48 } … … 618 621 } 619 622 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 620 638 // Local Variables: // 621 639 // tab-width: 4 // -
src/SynTree/Mutator.h
r78315272 r3f7e12cb 25 25 virtual ~Mutator(); 26 26 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 ); 36 36 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 ); 55 55 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 ); 90 90 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 ); 108 108 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 ); 113 113 114 virtual Subrange * mutate( Subrange *subrange );114 virtual Subrange * mutate( Subrange * subrange ); 115 115 116 virtual Constant *mutate( Constant *constant ); 116 virtual Constant * mutate( Constant * constant ); 117 118 virtual Attribute * mutate( Attribute * attribute ); 119 120 virtual TypeSubstitution * mutate( TypeSubstitution * sub ); 117 121 private: 118 virtual Declaration * handleAggregateDecl(AggregateDecl *aggregateDecl );119 virtual Declaration * handleNamedTypeDecl(NamedTypeDecl *typeDecl );120 virtual Type * handleReferenceToType(ReferenceToType *aggregateUseType );122 virtual Declaration * handleAggregateDecl(AggregateDecl * aggregateDecl ); 123 virtual Declaration * handleNamedTypeDecl(NamedTypeDecl * typeDecl ); 124 virtual Type * handleReferenceToType(ReferenceToType * aggregateUseType ); 121 125 }; 122 126 -
src/SynTree/NamedTypeDecl.cc
r78315272 r3f7e12cb 38 38 } 39 39 40 void NamedTypeDecl::print( std::ostream &os, intindent ) const {40 void NamedTypeDecl::print( std::ostream &os, Indenter indent ) const { 41 41 using namespace std; 42 42 43 if ( get_name() != "" ) { 44 os << get_name() << ": "; 45 } // if 46 if ( get_linkage() != LinkageSpec::Cforall ) { 47 os << LinkageSpec::linkageName( get_linkage() ) << " "; 43 if ( name != "" ) os << name << ": "; 44 45 if ( linkage != LinkageSpec::Cforall ) { 46 os << LinkageSpec::linkageName( linkage ) << " "; 48 47 } // if 49 48 get_storageClasses().print( os ); … … 51 50 if ( base ) { 52 51 os << " for "; 53 base->print( os, indent );52 base->print( os, indent+1 ); 54 53 } // if 55 54 if ( ! parameters.empty() ) { 56 os << endl << string( indent, ' ' ) << "with parameters" << endl;57 printAll( parameters, os, indent+ 2);55 os << endl << indent << "... with parameters" << endl; 56 printAll( parameters, os, indent+1 ); 58 57 } // if 59 58 if ( ! assertions.empty() ) { 60 os << endl << string( indent, ' ' ) << "with assertions" << endl;61 printAll( assertions, os, indent+ 2);59 os << endl << indent << "... with assertions" << endl; 60 printAll( assertions, os, indent+1 ); 62 61 } // if 63 62 } 64 63 65 void NamedTypeDecl::printShort( std::ostream &os, intindent ) const {64 void NamedTypeDecl::printShort( std::ostream &os, Indenter indent ) const { 66 65 using namespace std; 67 66 68 if ( get_name() != "" ) { 69 os << get_name() << ": "; 70 } // if 67 if ( name != "" ) os << name << ": "; 71 68 get_storageClasses().print( os ); 72 69 os << typeString(); 73 70 if ( base ) { 74 71 os << " for "; 75 base->print( os, indent );72 base->print( os, indent+1 ); 76 73 } // if 77 74 if ( ! parameters.empty() ) { 78 os << endl << string( indent, ' ' ) << "with parameters" << endl;79 printAll( parameters, os, indent+ 2);75 os << endl << indent << "... with parameters" << endl; 76 printAll( parameters, os, indent+1 ); 80 77 } // if 81 78 } -
src/SynTree/ObjectDecl.cc
r78315272 r3f7e12cb 44 44 } 45 45 46 void ObjectDecl::print( std::ostream &os, int indent ) const { 47 if ( get_name() != "" ) { 48 os << get_name() << ": "; 46 void ObjectDecl::print( std::ostream &os, Indenter indent ) const { 47 if ( name != "" ) os << name << ": "; 48 49 if ( linkage != LinkageSpec::Cforall ) { 50 os << LinkageSpec::linkageName( linkage ) << " "; 49 51 } // if 50 51 if ( get_linkage() != LinkageSpec::Cforall ) {52 os << LinkageSpec::linkageName( get_linkage() ) << " ";53 } // if54 55 printAll( get_attributes(), os, indent );56 52 57 53 get_storageClasses().print( os ); 58 54 59 if ( get_type()) {60 get_type()->print( os, indent );55 if ( type ) { 56 type->print( os, indent ); 61 57 } else { 62 58 os << " untyped entity "; … … 64 60 65 61 if ( init ) { 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(); 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; 70 65 } // if 71 66 67 if ( ! attributes.empty() ) { 68 os << std::endl << indent << "... with attributes: " << std::endl; 69 printAll( attributes, os, indent+1 ); 70 } 71 72 72 if ( bitfieldWidth ) { 73 os << std::string(indent, ' '); 74 os << " with bitfield width "; 73 os << indent << " with bitfield width "; 75 74 bitfieldWidth->print( os ); 76 75 } // if 77 76 } 78 77 79 void ObjectDecl::printShort( std::ostream &os, intindent ) const {78 void ObjectDecl::printShort( std::ostream &os, Indenter indent ) const { 80 79 #if 0 81 80 if ( get_mangleName() != "") { … … 83 82 } else 84 83 #endif 85 if ( get_name() != "" ) { 86 os << get_name() << ": "; 87 } // if 88 89 // xxx - should printShort print attributes? 84 if ( name != "" ) os << name << ": "; 90 85 91 86 get_storageClasses().print( os ); 92 87 93 if ( get_type()) {94 get_type()->print( os, indent );88 if ( type ) { 89 type->print( os, indent ); 95 90 } else { 96 91 os << "untyped entity "; -
src/SynTree/PointerType.cc
r78315272 r3f7e12cb 41 41 } 42 42 43 void PointerType::print( std::ostream &os, intindent ) const {43 void PointerType::print( std::ostream &os, Indenter indent ) const { 44 44 Type::print( os, indent ); 45 45 if ( ! is_array() ) { -
src/SynTree/ReferenceToType.cc
r78315272 r3f7e12cb 14 14 // 15 15 16 #include <stddef.h> // for NULL17 16 #include <cassert> // for assert 18 17 #include <list> // for list, _List_const_iterator, list<>::cons... … … 38 37 } 39 38 40 void ReferenceToType::print( std::ostream &os, intindent ) const {39 void ReferenceToType::print( std::ostream &os, Indenter indent ) const { 41 40 using std::endl; 42 41 … … 44 43 os << "instance of " << typeString() << " " << name << " "; 45 44 if ( ! parameters.empty() ) { 46 os << endl << std::string( indent, ' ' ) << "with parameters" << endl;47 printAll( parameters, os, indent+ 2);45 os << endl << indent << "... with parameters" << endl; 46 printAll( parameters, os, indent+1 ); 48 47 } // if 49 48 } … … 65 64 66 65 std::list<TypeDecl*>* StructInstType::get_baseParameters() { 67 if ( ! baseStruct ) return NULL;66 if ( ! baseStruct ) return nullptr; 68 67 return &baseStruct->get_parameters(); 69 68 } … … 76 75 } 77 76 78 void StructInstType::print( std::ostream &os, intindent ) const {77 void StructInstType::print( std::ostream &os, Indenter indent ) const { 79 78 using std::endl; 80 79 81 if ( baseStruct == NULL) ReferenceToType::print( os, indent );80 if ( baseStruct == nullptr ) ReferenceToType::print( os, indent ); 82 81 else { 83 82 Type::print( os, indent ); 84 83 os << "instance of " << typeString() << " " << name << " with body " << baseStruct->has_body() << " "; 85 84 if ( ! parameters.empty() ) { 86 os << endl << std::string( indent, ' ' ) << "with parameters" << endl;87 printAll( parameters, os, indent+ 2);85 os << endl << indent << "... with parameters" << endl; 86 printAll( parameters, os, indent+1 ); 88 87 } // if 89 88 } // if … … 97 96 98 97 std::list< TypeDecl * > * UnionInstType::get_baseParameters() { 99 if ( ! baseUnion ) return NULL;98 if ( ! baseUnion ) return nullptr; 100 99 return &baseUnion->get_parameters(); 101 100 } … … 108 107 } 109 108 110 void UnionInstType::print( std::ostream &os, intindent ) const {109 void UnionInstType::print( std::ostream &os, Indenter indent ) const { 111 110 using std::endl; 112 111 113 if ( baseUnion == NULL) ReferenceToType::print( os, indent );112 if ( baseUnion == nullptr ) ReferenceToType::print( os, indent ); 114 113 else { 115 114 Type::print( os, indent ); 116 115 os << "instance of " << typeString() << " " << name << " with body " << baseUnion->has_body() << " "; 117 116 if ( ! parameters.empty() ) { 118 os << endl << std::string( indent, ' ' ) << "with parameters" << endl;119 printAll( parameters, os, indent+ 2);117 os << endl << indent << "... with parameters" << endl; 118 printAll( parameters, os, indent+1 ); 120 119 } // if 121 120 } // if … … 129 128 130 129 bool 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 131 141 132 142 std::string TraitInstType::typeString() const { return "trait"; } … … 166 176 bool TypeInstType::isComplete() const { return baseType->isComplete(); } 167 177 168 void TypeInstType::print( std::ostream &os, intindent ) const {178 void TypeInstType::print( std::ostream &os, Indenter indent ) const { 169 179 using std::endl; 170 180 … … 172 182 os << "instance of " << typeString() << " " << get_name() << " (" << ( isFtype ? "" : "not" ) << " function type) "; 173 183 if ( ! parameters.empty() ) { 174 os << endl << std::string( indent, ' ' ) << "with parameters" << endl;175 printAll( parameters, os, indent+ 2);184 os << endl << indent << "... with parameters" << endl; 185 printAll( parameters, os, indent+1 ); 176 186 } // if 177 187 } -
src/SynTree/ReferenceType.cc
r78315272 r3f7e12cb 35 35 } 36 36 37 void ReferenceType::print( std::ostream &os, intindent ) const {37 void ReferenceType::print( std::ostream &os, Indenter indent ) const { 38 38 Type::print( os, indent ); 39 39 os << "reference to "; -
src/SynTree/Statement.cc
r78315272 r3f7e12cb 34 34 Statement::Statement( std::list<Label> labels ) : labels( labels ) {} 35 35 36 void Statement::print( __attribute__((unused)) std::ostream &, __attribute__((unused)) int indent ) const {} 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 } 37 45 38 46 Statement::~Statement() {} … … 46 54 } 47 55 48 void ExprStmt::print( std::ostream &os, intindent ) const {49 os << "Expression Statement:" << endl << std::string( indent + 2, ' ' );50 expr->print( os, indent + 2);56 void ExprStmt::print( std::ostream &os, Indenter indent ) const { 57 os << "Expression Statement:" << endl << indent+1; 58 expr->print( os, indent+1 ); 51 59 } 52 60 … … 67 75 } 68 76 69 void AsmStmt::print( std::ostream &os, intindent ) const {77 void AsmStmt::print( std::ostream &os, Indenter indent ) const { 70 78 os << "Assembler Statement:" << endl; 71 os << std::string( indent, ' ' ) << "instruction: " << endl << std::string( indent, ' ' );72 instruction->print( os, indent + 2);79 os << indent+1 << "instruction: " << endl << indent; 80 instruction->print( os, indent+1 ); 73 81 if ( ! output.empty() ) { 74 os << endl << std::string( indent, ' ' )<< "output: " << endl;75 printAll( output, os, indent + 2);82 os << endl << indent+1 << "output: " << endl; 83 printAll( output, os, indent+1 ); 76 84 } // if 77 85 if ( ! input.empty() ) { 78 os << std::string( indent, ' ' ) << "input: " << endl << std::string( indent, ' ' );79 printAll( input, os, indent + 2);86 os << indent+1 << "input: " << endl; 87 printAll( input, os, indent+1 ); 80 88 } // if 81 89 if ( ! clobber.empty() ) { 82 os << std::string( indent, ' ' )<< "clobber: " << endl;83 printAll( clobber, os, indent + 2);90 os << indent+1 << "clobber: " << endl; 91 printAll( clobber, os, indent+1 ); 84 92 } // if 85 93 } … … 103 111 } 104 112 105 void BranchStmt::print( std::ostream &os, intindent ) 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;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; 110 118 } 111 119 … … 118 126 } 119 127 120 void ReturnStmt::print( std::ostream &os, intindent ) const {121 os << 122 if ( expr != 0) {123 os << endl << string( indent+2, ' ' );124 expr->print( os, indent + 2);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 ); 125 133 } 126 134 os << endl; … … 142 150 } 143 151 144 void IfStmt::print( std::ostream &os, intindent ) const {145 os << "If on condition: " << endl 146 os << string( indent+4, ' ' );147 condition->print( os, indent + 4);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 ); 148 156 149 157 if ( !initialization.empty() ) { 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);158 os << indent << "... with initialization: \n"; 159 for ( const Statement * stmt : initialization ) { 160 os << indent+1; 161 stmt->print( os, indent+1 ); 154 162 } 155 163 os << endl; 156 164 } 157 165 158 os << string( indent+2, ' ' )<< "... then: " << endl;159 160 os << string( indent+4, ' ' );161 thenPart->print( os, indent + 4);166 os << indent << "... then: " << endl; 167 168 os << indent+1; 169 thenPart->print( os, indent+1 ); 162 170 163 171 if ( elsePart != 0 ) { 164 os << string( indent+2, ' ' )<< "... else: " << endl;165 os << string( indent+4, ' ' );166 elsePart->print( os, indent + 4);167 } // if 168 } 169 170 SwitchStmt::SwitchStmt( std::list<Label> labels, Expression * condition, std::list<Statement *> &statements ):172 os << indent << "... else: " << endl; 173 os << indent+1; 174 elsePart->print( os, indent+1 ); 175 } // if 176 } 177 178 SwitchStmt::SwitchStmt( std::list<Label> labels, Expression * condition, const std::list<Statement *> &statements ): 171 179 Statement( labels ), condition( condition ), statements( statements ) { 172 180 } … … 183 191 } 184 192 185 void SwitchStmt::print( std::ostream &os, intindent ) const {193 void SwitchStmt::print( std::ostream &os, Indenter indent ) const { 186 194 os << "Switch on condition: "; 187 195 condition->print( os ); 188 196 os << endl; 189 197 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 198 CaseStmt::CaseStmt( std::list<Label> labels, Expression *condition, std::list<Statement *> &statements, bool deflt ) throw ( SemanticError ) : 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 ) : 199 204 Statement( labels ), condition( condition ), stmts( statements ), _isDefault( deflt ) { 200 if ( isDefault() && condition != 0 ) 201 throw SemanticError("default with conditions"); 205 if ( isDefault() && condition != 0 ) throw SemanticError("default case with condition: ", condition); 202 206 } 203 207 … … 216 220 } 217 221 218 void CaseStmt::print( std::ostream &os, int indent ) const { 219 os << string( indent, ' ' ); 220 221 if ( isDefault() ) 222 os << "Default "; 222 void CaseStmt::print( std::ostream &os, Indenter indent ) const { 223 if ( isDefault() ) os << "Default "; 223 224 else { 224 225 os << "Case "; 225 condition->print( os ); 226 } // if 227 228 os << endl; 229 230 std::list<Statement *>::const_iterator i; 231 for ( i = stmts.begin(); i != stmts.end(); i++) 232 (*i )->print( os, indent + 4 ); 226 condition->print( os, indent ); 227 } // if 228 os << endl; 229 230 for ( Statement * stmt : stmts ) { 231 stmt->print( os, indent+1 ); 232 } 233 233 } 234 234 … … 246 246 } 247 247 248 void WhileStmt::print( std::ostream &os, intindent ) const {248 void WhileStmt::print( std::ostream &os, Indenter indent ) const { 249 249 os << "While on condition: " << endl ; 250 condition->print( os, indent + 4);251 252 os << string( indent, ' ' ) << ".... with body: " << endl;253 254 if ( body != 0 ) body->print( os, indent + 4);250 condition->print( os, indent+1 ); 251 252 os << indent << "... with body: " << endl; 253 254 if ( body != 0 ) body->print( os, indent+1 ); 255 255 } 256 256 … … 272 272 } 273 273 274 void 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"; 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 302 297 if ( body != 0 ) { 303 os << string( indent + 4, ' ' ); 304 body->print( os, indent + 4 ); 305 } 306 298 os << "\n" << indent << "... with body: \n" << indent+1; 299 body->print( os, indent+1 ); 300 } 307 301 os << endl; 308 302 } … … 322 316 } 323 317 324 void ThrowStmt::print( std::ostream &os, int indent) const { 318 void ThrowStmt::print( std::ostream &os, Indenter indent) const { 319 if ( target ) os << "Non-Local "; 320 os << "Throw Statement, raising: "; 321 expr->print(os, indent+1); 325 322 if ( target ) { 326 os << "Non-Local "; 327 } 328 os << "Throw Statement, raising: "; 329 expr->print(os, indent + 4); 330 if ( target ) { 331 os << "At: "; 332 target->print(os, indent + 4); 323 os << "... at: "; 324 target->print(os, indent+1); 333 325 } 334 326 } … … 348 340 } 349 341 350 void TryStmt::print( std::ostream &os, intindent ) const {342 void TryStmt::print( std::ostream &os, Indenter indent ) const { 351 343 os << "Try Statement" << endl; 352 os << string( indent + 2, ' ' ) << "with block:" << endl; 353 os << string( indent + 4, ' ' ); 354 block->print( os, indent + 4 ); 344 os << indent << "... with block:" << endl << indent+1; 345 block->print( os, indent+1 ); 355 346 356 347 // handlers 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);348 os << indent << "... and handlers:" << endl; 349 for ( const CatchStmt * stmt : handlers ) { 350 os << indent+1; 351 stmt->print( os, indent+1 ); 361 352 } 362 353 363 354 // finally block 364 355 if ( finallyBlock != 0 ) { 365 os << string( indent + 2, ' ' ) << "and finally:" << endl;366 finallyBlock->print( os, indent + 4);356 os << indent << "... and finally:" << endl << indent+1; 357 finallyBlock->print( os, indent+1 ); 367 358 } // if 368 359 } … … 370 361 CatchStmt::CatchStmt( std::list<Label> labels, Kind kind, Declaration *decl, Expression *cond, Statement *body ) : 371 362 Statement( labels ), kind ( kind ), decl ( decl ), cond ( cond ), body( body ) { 363 assertf( decl, "Catch clause must have a declaration." ); 372 364 } 373 365 … … 381 373 } 382 374 383 void CatchStmt::print( std::ostream &os, intindent ) const {375 void CatchStmt::print( std::ostream &os, Indenter indent ) const { 384 376 os << "Catch " << ((Terminate == kind) ? "Terminate" : "Resume") << " Statement" << endl; 385 377 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; 378 os << indent << "... catching: "; 379 decl->printShort( os, indent+1 ); 380 os << endl; 393 381 394 382 if ( cond ) { 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 ); 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 ); 405 390 } 406 391 … … 417 402 } 418 403 419 void FinallyStmt::print( std::ostream &os, intindent ) const {404 void FinallyStmt::print( std::ostream &os, Indenter indent ) const { 420 405 os << "Finally Statement" << endl; 421 os << string( indent + 2, ' ' ) << "with block:" << endl; 422 os << string( indent + 4, ' ' ); 423 block->print( os, indent + 4 ); 406 os << indent << "... with block:" << endl << indent+1; 407 block->print( os, indent+1 ); 424 408 } 425 409 … … 465 449 } 466 450 467 void WaitForStmt::print( std::ostream &os, intindent ) const {451 void WaitForStmt::print( std::ostream &os, Indenter indent ) const { 468 452 os << "Waitfor Statement" << endl; 469 os << string( indent + 2, ' ' ) << "with block:" << endl; 470 os << string( indent + 4, ' ' ); 453 os << indent << "... with block:" << endl << indent+1; 471 454 // block->print( os, indent + 4 ); 472 455 } … … 475 458 NullStmt::NullStmt() : Statement( std::list<Label>() ) {} 476 459 477 void NullStmt::print( std::ostream &os, __attribute__((unused)) int indent) const {478 os << "Null Statement" << endl 460 void NullStmt::print( std::ostream &os, Indenter ) const { 461 os << "Null Statement" << endl; 479 462 } 480 463 … … 490 473 } 491 474 492 void ImplicitCtorDtorStmt::print( std::ostream &os, intindent ) const {475 void ImplicitCtorDtorStmt::print( std::ostream &os, Indenter indent ) const { 493 476 os << "Implicit Ctor Dtor Statement" << endl; 494 os << string( indent + 2, ' ' ) << "with Ctor/Dtor: "; 495 callStmt->print( os, indent + 2); 496 os << endl; 497 } 498 499 std::ostream & operator<<( std::ostream & out, const Statement * statement ) { 500 if ( statement ) { 501 statement->print( out ); 502 } else { 503 out << "nullptr"; 504 } 505 return out; 477 os << indent << "... with Ctor/Dtor: "; 478 callStmt->print( os, indent+1); 479 os << endl; 506 480 } 507 481 -
src/SynTree/Statement.h
r78315272 r3f7e12cb 43 43 const std::list<Label> & get_labels() const { return labels; } 44 44 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;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; 49 49 }; 50 50 … … 54 54 55 55 CompoundStmt( std::list<Label> labels ); 56 CompoundStmt( std::list<Statement *> stmts ); 56 57 CompoundStmt( const CompoundStmt &other ); 57 58 virtual ~CompoundStmt(); … … 61 62 void push_front( Statement * stmt ) { kids.push_front( stmt ); } 62 63 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;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; 67 68 }; 68 69 … … 72 73 NullStmt( std::list<Label> labels ); 73 74 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;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; 78 79 }; 79 80 … … 89 90 void set_expr( Expression *newValue ) { expr = newValue; } 90 91 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;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; 95 96 }; 96 97 … … 123 124 virtual void accept( Visitor & v ) { v.visit( this ); } 124 125 virtual Statement * acceptMutator( Mutator & m ) { return m.mutate( this ); } 125 virtual void print( std::ostream & os, int indent = 0) const;126 virtual void print( std::ostream & os, Indenter indent = {} ) const; 126 127 }; 127 128 … … 146 147 void set_elsePart( Statement *newValue ) { elsePart = newValue; } 147 148 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;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; 152 153 }; 153 154 … … 157 158 std::list<Statement *> statements; 158 159 159 SwitchStmt( std::list<Label> labels, Expression *condition, std::list<Statement *> &statements );160 SwitchStmt( std::list<Label> labels, Expression *condition, const std::list<Statement *> &statements ); 160 161 SwitchStmt( const SwitchStmt &other ); 161 162 virtual ~SwitchStmt(); … … 166 167 std::list<Statement *> & get_statements() { return statements; } 167 168 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;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; 173 174 174 175 }; … … 179 180 std::list<Statement *> stmts; 180 181 181 CaseStmt( std::list<Label> labels, Expression *conditions, std::list<Statement *> &stmts, bool isdef = false ) throw(SemanticError);182 CaseStmt( std::list<Label> labels, Expression *conditions, const std::list<Statement *> &stmts, bool isdef = false ) throw(SemanticError); 182 183 CaseStmt( const CaseStmt &other ); 183 184 virtual ~CaseStmt(); … … 194 195 void set_statements( std::list<Statement *> &newValue ) { stmts = newValue; } 195 196 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;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; 201 202 private: 202 203 bool _isDefault; … … 221 222 void set_isDoWhile( bool newValue ) { isDoWhile = newValue; } 222 223 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;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; 227 228 }; 228 229 … … 247 248 void set_body( Statement *newValue ) { body = newValue; } 248 249 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;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; 253 254 }; 254 255 … … 276 277 const char *get_typename() { return brType[ type ]; } 277 278 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;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; 282 283 private: 283 284 static const char *brType[]; … … 295 296 void set_expr( Expression *newValue ) { expr = newValue; } 296 297 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;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; 301 302 }; 302 303 … … 319 320 void set_target( Expression * newTarget ) { target = newTarget; } 320 321 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;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; 325 326 }; 326 327 … … 342 343 void set_finally( FinallyStmt *newValue ) { finallyBlock = newValue; } 343 344 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;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; 348 349 }; 349 350 … … 370 371 void set_body( Statement *newValue ) { body = newValue; } 371 372 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;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; 376 377 }; 377 378 … … 387 388 void set_block( CompoundStmt *newValue ) { block = newValue; } 388 389 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;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; 393 394 }; 394 395 … … 424 425 } orelse; 425 426 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;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; 430 431 431 432 }; … … 444 445 void set_decl( Declaration *newValue ) { decl = newValue; } 445 446 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;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; 450 451 }; 451 452 … … 466 467 void set_callStmt( Statement * newValue ) { callStmt = newValue; } 467 468 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 475 std::ostream & operator<<( std::ostream & out, const Statement * statement ); 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 }; 476 474 477 475 // Local Variables: // -
src/SynTree/TupleExpr.cc
r78315272 r3f7e12cb 28 28 #include "Type.h" // for TupleType, Type 29 29 30 UntypedTupleExpr::UntypedTupleExpr( const std::list< Expression * > & exprs , Expression *_aname ) : Expression( _aname), exprs( exprs ) {30 UntypedTupleExpr::UntypedTupleExpr( const std::list< Expression * > & exprs ) : Expression(), exprs( exprs ) { 31 31 } 32 32 … … 39 39 } 40 40 41 void UntypedTupleExpr::print( std::ostream &os, intindent ) const {41 void UntypedTupleExpr::print( std::ostream &os, Indenter indent ) const { 42 42 os << "Untyped Tuple:" << std::endl; 43 printAll( exprs, os, indent+ 2);43 printAll( exprs, os, indent+1 ); 44 44 Expression::print( os, indent ); 45 45 } 46 46 47 TupleExpr::TupleExpr( const std::list< Expression * > & exprs , Expression *_aname ) : Expression( _aname), exprs( exprs ) {47 TupleExpr::TupleExpr( const std::list< Expression * > & exprs ) : Expression(), exprs( exprs ) { 48 48 set_result( Tuples::makeTupleType( exprs ) ); 49 49 } … … 57 57 } 58 58 59 void TupleExpr::print( std::ostream &os, intindent ) const {59 void TupleExpr::print( std::ostream &os, Indenter indent ) const { 60 60 os << "Tuple:" << std::endl; 61 printAll( exprs, os, indent+ 2);61 printAll( exprs, os, indent+1 ); 62 62 Expression::print( os, indent ); 63 63 } … … 78 78 } 79 79 80 void TupleIndexExpr::print( std::ostream &os, intindent ) const {80 void TupleIndexExpr::print( std::ostream &os, Indenter indent ) const { 81 81 os << "Tuple Index Expression, with tuple:" << 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;82 os << indent+1; 83 tuple->print( os, indent+1 ); 84 os << indent+1 << "with index: " << index << std::endl; 85 85 Expression::print( os, indent ); 86 86 } 87 87 88 TupleAssignExpr::TupleAssignExpr( const std::list< Expression * > & assigns, const std::list< ObjectDecl * > & tempDecls , Expression * _aname ) : Expression( _aname) {88 TupleAssignExpr::TupleAssignExpr( const std::list< Expression * > & assigns, const std::list< ObjectDecl * > & tempDecls ) : Expression() { 89 89 // convert internally into a StmtExpr which contains the declarations and produces the tuple of the assignments 90 90 set_result( Tuples::makeTupleType( assigns ) ); … … 109 109 } 110 110 111 void TupleAssignExpr::print( std::ostream &os, intindent ) const {111 void TupleAssignExpr::print( std::ostream &os, Indenter indent ) const { 112 112 os << "Tuple Assignment Expression, with stmt expr:" << std::endl; 113 os << std::string( indent+2, ' ' );114 stmtExpr->print( os, indent+ 4);113 os << indent+1; 114 stmtExpr->print( os, indent+1 ); 115 115 Expression::print( os, indent ); 116 116 } -
src/SynTree/TupleType.cc
r78315272 r3f7e12cb 48 48 } 49 49 50 void TupleType::print( std::ostream &os, intindent ) const {50 void TupleType::print( std::ostream &os, Indenter indent ) const { 51 51 Type::print( os, indent ); 52 52 os << "tuple of types" << std::endl; 53 printAll( types, os, indent+ 2);53 printAll( types, os, indent+1 ); 54 54 } 55 55 -
src/SynTree/Type.cc
r78315272 r3f7e12cb 10 10 // Created On : Mon May 18 07:44:20 2015 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Mon Sep 11 13:21:25201713 // Update Count : 3 712 // Last Modified On : Mon Sep 25 15:16:32 2017 13 // Update Count : 38 14 14 // 15 15 #include "Type.h" … … 45 45 "double _Imaginary", 46 46 "long double _Imaginary", 47 "__int128", 48 "unsigned __int128", 47 49 }; 48 50 … … 73 75 Type * type; 74 76 ReferenceType * ref; 75 for ( type = this; (ref = dynamic_cast<ReferenceType *>( type )); type = ref-> get_base());77 for ( type = this; (ref = dynamic_cast<ReferenceType *>( type )); type = ref->base ); 76 78 return type; 77 79 } … … 79 81 int Type::referenceDepth() const { return 0; } 80 82 81 void Type::print( std::ostream &os, intindent ) const {83 void Type::print( std::ostream &os, Indenter indent ) const { 82 84 if ( ! forall.empty() ) { 83 85 os << "forall" << std::endl; 84 printAll( forall, os, indent + 4);85 os << std::string( indent+2, ' ' );86 printAll( forall, os, indent+1 ); 87 os << ++indent; 86 88 } // if 87 89 88 90 if ( ! attributes.empty() ) { 89 os << endl << string( indent+2, ' ' ) <<"with attributes" << endl;90 printAll( attributes, os, indent+ 4);91 os << "with attributes" << endl; 92 printAll( attributes, os, indent+1 ); 91 93 } // if 92 94 … … 99 101 const Type::Qualifiers noQualifiers; 100 102 101 std::ostream & operator<<( std::ostream & out, const Type * type ) {102 if ( type ) {103 type->print( out );104 } else {105 out << "nullptr";106 } // if107 return out;108 }109 110 103 // Local Variables: // 111 104 // tab-width: 4 // -
src/SynTree/Type.h
r78315272 r3f7e12cb 9 9 // Author : Richard C. Bilson 10 10 // Created On : Mon May 18 07:44:20 2015 11 // Last Modified By : Andrew Beach12 // Last Modified On : Wed Aug 9 14:25:00201713 // Update Count : 15 211 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Mon Sep 25 14:14:01 2017 13 // Update Count : 154 14 14 // 15 15 … … 181 181 virtual void accept( Visitor & v ) = 0; 182 182 virtual Type *acceptMutator( Mutator & m ) = 0; 183 virtual void print( std::ostream & os, int indent = 0) const;183 virtual void print( std::ostream & os, Indenter indent = {} ) const; 184 184 }; 185 185 … … 192 192 VoidType( const Type::Qualifiers & tq, const std::list< Attribute * > & attributes = std::list< Attribute * >() ); 193 193 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;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; 201 201 }; 202 202 … … 225 225 DoubleImaginary, 226 226 LongDoubleImaginary, 227 SignedInt128, 228 UnsignedInt128, 227 229 NUMBER_OF_BASIC_TYPES 228 230 } kind; … … 235 237 void set_kind( Kind newValue ) { kind = newValue; } 236 238 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;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; 241 243 242 244 bool isInteger() const; … … 268 270 bool is_array() const { return isStatic || isVarLen || dimension; } 269 271 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;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; 276 278 }; 277 279 … … 296 298 void set_isStatic( bool newValue ) { isStatic = newValue; } 297 299 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; 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; 304 309 }; 305 310 … … 315 320 void set_base( Type *newValue ) { base = newValue; } 316 321 317 virtual int referenceDepth() const ;322 virtual int referenceDepth() const override; 318 323 319 324 // Since reference types act like value types, their size is the size of the base. 320 325 // This makes it simple to cast the empty tuple to a reference type, since casts that increase 321 326 // the number of values are disallowed. 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;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; 328 333 }; 329 334 … … 349 354 bool isTtype() const; 350 355 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;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; 355 360 }; 356 361 … … 371 376 void set_hoistType( bool newValue ) { hoistType = newValue; } 372 377 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;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; 377 382 378 383 virtual void lookup( __attribute__((unused)) const std::string & name, __attribute__((unused)) std::list< Declaration* > & foundDecls ) const {} … … 398 403 std::list<TypeDecl*> * get_baseParameters(); 399 404 400 virtual bool isComplete() const ;405 virtual bool isComplete() const override; 401 406 402 407 /// Looks up the members of this struct named "name" and places them into "foundDecls". 403 408 /// Clones declarations into "foundDecls", caller responsible for freeing 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;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; 411 416 private: 412 virtual std::string typeString() const ;417 virtual std::string typeString() const override; 413 418 }; 414 419 … … 430 435 std::list< TypeDecl * > * get_baseParameters(); 431 436 432 virtual bool isComplete() const ;437 virtual bool isComplete() const override; 433 438 434 439 /// looks up the members of this union named "name" and places them into "foundDecls" 435 440 /// Clones declarations into "foundDecls", caller responsible for freeing 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;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; 443 448 private: 444 virtual std::string typeString() const ;449 virtual std::string typeString() const override; 445 450 }; 446 451 … … 459 464 void set_baseEnum( EnumDecl *newValue ) { baseEnum = newValue; } 460 465 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 ); } 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; 466 473 private: 467 virtual std::string typeString() const ;474 virtual std::string typeString() const override; 468 475 }; 469 476 … … 480 487 ~TraitInstType(); 481 488 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 ); }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 ); } 487 494 private: 488 virtual std::string typeString() const ;495 virtual std::string typeString() const override; 489 496 }; 490 497 … … 507 514 void set_isFtype( bool newValue ) { isFtype = newValue; } 508 515 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;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; 515 522 private: 516 virtual std::string typeString() const ;523 virtual std::string typeString() const override; 517 524 }; 518 525 … … 530 537 531 538 std::list<Type *> & get_types() { return types; } 532 virtual unsigned size() const { return types.size(); };539 virtual unsigned size() const override { return types.size(); }; 533 540 534 541 // For now, this is entirely synthetic -- tuple types always have unnamed members. … … 539 546 iterator end() { return types.end(); } 540 547 541 virtual Type * getComponent( unsigned i ) {548 virtual Type * getComponent( unsigned i ) override { 542 549 assertf( i < size(), "TupleType::getComponent: index %d must be less than size %d", i, size() ); 543 550 return *(begin()+i); 544 551 } 545 552 546 // virtual bool isComplete() const { return true; } // xxx - not sure if this is right, might need to recursively check complete-ness547 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;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; 552 559 }; 553 560 … … 563 570 void set_expr( Expression *newValue ) { expr = newValue; } 564 571 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;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; 571 578 }; 572 579 … … 592 599 void set_isType( bool newValue ) { isType = newValue; } 593 600 594 virtual bool isComplete() const { assert( false ); } // xxx - not sure what to do here595 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;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; 600 607 }; 601 608 … … 606 613 VarArgsType( Type::Qualifiers tq, const std::list< Attribute * > & attributes = std::list< Attribute * >() ); 607 614 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;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; 614 621 }; 615 622 … … 620 627 ZeroType( Type::Qualifiers tq, const std::list< Attribute * > & attributes = std::list< Attribute * >() ); 621 628 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;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; 626 633 }; 627 634 … … 632 639 OneType( Type::Qualifiers tq, const std::list< Attribute * > & attributes = std::list< Attribute * >() ); 633 640 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 640 std::ostream & operator<<( std::ostream & out, const Type * type ); 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 }; 641 646 642 647 // Local Variables: // -
src/SynTree/TypeDecl.cc
r78315272 r3f7e12cb 21 21 #include "Type.h" // for Type, Type::StorageClasses 22 22 23 TypeDecl::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 ) {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 ) { 24 24 } 25 25 … … 32 32 33 33 std::string TypeDecl::typeString() const { 34 static const std::string kindNames[] = { "type", "incomplete type", "function type", "tuple type" }; 35 return (kind != Any && isComplete() ? "sized " : "") + kindNames[ kind ]; 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 ]; 36 38 } 37 39 38 40 std::string TypeDecl::genTypeString() const { 39 static const std::string kindNames[] = { "otype", "dtype", "ftype", "ttype" }; 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." ); 40 44 return kindNames[ kind ]; 41 45 } 42 46 43 void TypeDecl::print( std::ostream &os, intindent ) const {47 void TypeDecl::print( std::ostream &os, Indenter indent ) const { 44 48 NamedTypeDecl::print( os, indent ); 45 49 if ( init ) { 46 os << std::endl << std::string( indent, ' ' )<< "with type initializer: ";47 init->print( os, indent + 2);50 os << std::endl << indent << "with type initializer: "; 51 init->print( os, indent + 1 ); 48 52 } 49 53 } -
src/SynTree/TypeExpr.cc
r78315272 r3f7e12cb 30 30 } 31 31 32 void TypeExpr::print( std::ostream &os, intindent ) const {32 void TypeExpr::print( std::ostream &os, Indenter indent ) const { 33 33 if ( type ) type->print( os, indent ); 34 34 Expression::print( os, indent ); -
src/SynTree/TypeSubstitution.cc
r78315272 r3f7e12cb 148 148 template< typename TypeClass > 149 149 Type *TypeSubstitution::handleType( TypeClass *type ) { 150 BoundVarsTypeoldBoundVars( boundVars );150 ValueGuard<BoundVarsType> oldBoundVars( boundVars ); 151 151 // bind type variables from forall-qualifiers 152 152 if ( freeOnly ) { … … 156 156 } // if 157 157 Type *ret = Mutator::mutate( type ); 158 boundVars = oldBoundVars;159 158 return ret; 160 159 } … … 162 161 template< typename TypeClass > 163 162 Type *TypeSubstitution::handleAggregateType( TypeClass *type ) { 164 BoundVarsTypeoldBoundVars( boundVars );163 ValueGuard<BoundVarsType> oldBoundVars( boundVars ); 165 164 // bind type variables from forall-qualifiers 166 165 if ( freeOnly ) { … … 177 176 } // if 178 177 Type *ret = Mutator::mutate( type ); 179 boundVars = oldBoundVars;180 178 return ret; 181 179 } … … 233 231 } 234 232 235 TypeSubstitution * 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 245 void TypeSubstitution::print( std::ostream &os, int indent ) const { 246 os << std::string( indent, ' ' ) << "Types:" << std::endl; 233 void TypeSubstitution::print( std::ostream &os, Indenter indent ) const { 234 os << indent << "Types:" << std::endl; 247 235 for ( TypeEnvType::const_iterator i = typeEnv.begin(); i != typeEnv.end(); ++i ) { 248 os << std::string( indent+2, ' ' )<< i->first << " -> ";249 i->second->print( os, indent+ 4);236 os << indent+1 << i->first << " -> "; 237 i->second->print( os, indent+2 ); 250 238 os << std::endl; 251 239 } // for 252 os << std::string( indent, ' ' )<< "Non-types:" << std::endl;240 os << indent << "Non-types:" << std::endl; 253 241 for ( VarEnvType::const_iterator i = varEnv.begin(); i != varEnv.end(); ++i ) { 254 os << std::string( indent+2, ' ' )<< i->first << " -> ";255 i->second->print( os, indent+ 4);242 os << indent+1 << i->first << " -> "; 243 i->second->print( os, indent+2 ); 256 244 os << std::endl; 257 245 } // for -
src/SynTree/TypeSubstitution.h
r78315272 r3f7e12cb 59 59 void normalize(); 60 60 61 TypeSubstitution * acceptMutator( Mutator & m utator );61 TypeSubstitution * acceptMutator( Mutator & m ) { return m.mutate( this ); } 62 62 63 void print( std::ostream &os, int indent = 0) const;63 void print( std::ostream &os, Indenter indent = {} ) const; 64 64 TypeSubstitution *clone() const { return new TypeSubstitution( *this ); } 65 65 private: … … 89 89 90 90 void initialize( const TypeSubstitution &src, TypeSubstitution &dest ); 91 92 friend class Mutator; 93 94 template<typename pass_type> 95 friend class PassVisitor; 91 96 92 97 typedef std::map< std::string, Type* > TypeEnvType; -
src/SynTree/TypeofType.cc
r78315272 r3f7e12cb 5 5 // file "LICENCE" distributed with Cforall. 6 6 // 7 // TypeofType.cc -- 7 // TypeofType.cc -- 8 8 // 9 9 // Author : Richard C. Bilson … … 33 33 } 34 34 35 void TypeofType::print( std::ostream &os, intindent ) const {35 void TypeofType::print( std::ostream &os, Indenter indent ) const { 36 36 Type::print( os, indent ); 37 37 os << "type-of expression "; -
src/SynTree/VarArgsType.cc
r78315272 r3f7e12cb 25 25 VarArgsType::VarArgsType( Type::Qualifiers tq, const std::list< Attribute * > & attributes ) : Type( tq, attributes ) {} 26 26 27 void VarArgsType::print( std::ostream &os, intindent ) const {27 void VarArgsType::print( std::ostream &os, Indenter indent ) const { 28 28 Type::print( os, indent ); 29 29 os << "builtin var args pack"; -
src/SynTree/VarExprReplacer.h
r78315272 r3f7e12cb 29 29 private: 30 30 const DeclMap & declMap; 31 31 bool debug; 32 32 public: 33 33 VarExprReplacer( const DeclMap & declMap, bool debug = false ); … … 35 35 // replace variable with new node from decl map 36 36 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 } 37 42 }; 38 43 -
src/SynTree/Visitor.cc
r78315272 r3f7e12cb 17 17 #include <list> // for list 18 18 19 #include "Attribute.h" // for Attribute 19 20 #include "Constant.h" // for Constant 20 21 #include "Declaration.h" // for DeclarationWithType, ObjectDecl, Declaration … … 35 36 maybeAccept( objectDecl->get_init(), *this ); 36 37 maybeAccept( objectDecl->get_bitfieldWidth(), *this ); 38 acceptAll( objectDecl->attributes, *this ); 37 39 } 38 40 … … 40 42 maybeAccept( functionDecl->get_functionType(), *this ); 41 43 maybeAccept( functionDecl->get_statements(), *this ); 44 acceptAll( functionDecl->attributes, *this ); 42 45 } 43 46 … … 487 490 488 491 489 void Visitor::visit( __attribute__((unused)) Subrange *subrange ) {} 490 491 492 void Visitor::visit( __attribute__((unused)) Constant *constant ) {} 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 493 501 // Local Variables: // 494 502 // tab-width: 4 // -
src/SynTree/Visitor.h
r78315272 r3f7e12cb 25 25 public: 26 26 // visit: Default implementation of all functions visits the children 27 27 // of the given syntax node, but performs no other action. 28 28 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 ); 38 38 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 ); 57 57 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 ); 92 92 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 ); 110 110 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 ); 115 115 116 virtual void visit( Subrange * subrange );116 virtual void visit( Subrange * subrange ); 117 117 118 virtual void visit( Constant *constant ); 118 virtual void visit( Constant * constant ); 119 120 virtual void visit( Attribute * attribute ); 119 121 private: 120 122 virtual void handleAggregateDecl( AggregateDecl *aggregateDecl ); -
src/SynTree/VoidType.cc
r78315272 r3f7e12cb 5 5 // file "LICENCE" distributed with Cforall. 6 6 // 7 // VoidType.cc -- 7 // VoidType.cc -- 8 8 // 9 9 // Author : Richard C. Bilson … … 24 24 } 25 25 26 void VoidType::print( std::ostream &os, intindent ) const {26 void VoidType::print( std::ostream &os, Indenter indent ) const { 27 27 Type::print( os, indent ); 28 28 os << "void "; -
src/SynTree/ZeroOneType.cc
r78315272 r3f7e12cb 25 25 ZeroType::ZeroType( Type::Qualifiers tq, const std::list< Attribute * > & attributes ) : Type( tq, attributes ) {} 26 26 27 void ZeroType::print( std::ostream &os, __attribute__((unused)) int indent) const {27 void ZeroType::print( std::ostream &os, Indenter ) const { 28 28 os << "zero_t"; 29 29 } … … 33 33 OneType::OneType( Type::Qualifiers tq, const std::list< Attribute * > & attributes ) : Type( tq, attributes ) {} 34 34 35 void OneType::print( std::ostream &os, __attribute__((unused)) int indent) const {35 void OneType::print( std::ostream &os, Indenter ) const { 36 36 os << "one_t"; 37 37 } -
src/SynTree/module.mk
r78315272 r3f7e12cb 48 48 SynTree/Visitor.cc \ 49 49 SynTree/Mutator.cc \ 50 SynTree/AddStmtVisitor.cc \51 50 SynTree/TypeSubstitution.cc \ 52 51 SynTree/Attribute.cc \ -
src/Tuples/TupleAssignment.cc
r78315272 r3f7e12cb 95 95 bool isTuple( Expression *expr ) { 96 96 if ( ! expr ) return false; 97 assert( expr-> has_result());97 assert( expr->result ); 98 98 return dynamic_cast< TupleType * >( expr->get_result()->stripReferences() ); 99 99 } … … 285 285 286 286 ObjectDecl * TupleAssignSpotter::Matcher::newObject( UniqueName & namer, Expression * expr ) { 287 assert( expr-> has_result()&& ! expr->get_result()->isVoid() );287 assert( expr->result && ! expr->get_result()->isVoid() ); 288 288 ObjectDecl * ret = new ObjectDecl( namer.newName(), Type::StorageClasses(), LinkageSpec::Cforall, nullptr, expr->get_result()->clone(), new SingleInit( expr->clone() ) ); 289 289 // if expression type is a reference, don't need to construct anything, a simple initializer is sufficient. … … 295 295 ctorInit->accept( rm ); 296 296 } 297 PRINT( std::cerr << "new object: " << ret << std::endl; ) 297 298 return ret; 298 299 } -
src/Tuples/TupleExpansion.cc
r78315272 r3f7e12cb 21 21 #include "Common/ScopedMap.h" // for ScopedMap 22 22 #include "Common/utility.h" // for CodeLocation 23 #include "GenPoly/DeclMutator.h" // for DeclMutator24 23 #include "InitTweak/InitTweak.h" // for getFunction 25 24 #include "Parser/LinkageSpec.h" // for Spec, C, Intrinsic … … 205 204 decl->set_body( true ); 206 205 for ( size_t i = 0; i < tupleSize; ++i ) { 207 TypeDecl * tyParam = new TypeDecl( toString( "tuple_param_", tupleSize, "_", i ), Type::StorageClasses(), nullptr, TypeDecl:: Any);206 TypeDecl * tyParam = new TypeDecl( toString( "tuple_param_", tupleSize, "_", i ), Type::StorageClasses(), nullptr, TypeDecl::Dtype, true ); 208 207 decl->get_members().push_back( new ObjectDecl( toString("field_", i ), Type::StorageClasses(), LinkageSpec::C, nullptr, new TypeInstType( Type::Qualifiers(), tyParam->get_name(), tyParam ), nullptr ) ); 209 208 decl->get_parameters().push_back( tyParam ); -
src/benchmark/Makefile.am
r78315272 r3f7e12cb 19 19 AM_CFLAGS = -g -Wall -Wno-unused-function -O2 20 20 CC = @CFA_BINDIR@/@CFA_NAME@ 21 TOOLSDIR = ${abs_top_srcdir}/tools/ 22 REPEAT = ${TOOLSDIR}repeat 23 STATS = ${TOOLSDIR}stat.py 24 repeats = 30 21 25 22 noinst_PROGRAMS = bench$(EXEEXT) ctxswitch-coroutine$(EXEEXT) ctxswitch-thread$(EXEEXT) sched-int$(EXEEXT) monitor$(EXEEXT) csv-data$(EXEEXT) 26 .NOTPARALLEL: 27 28 noinst_PROGRAMS = 29 30 all : ctxswitch$(EXEEXT) mutex$(EXEEXT) signal$(EXEEXT) waitfor$(EXEEXT) creation$(EXEEXT) 23 31 24 32 bench$(EXEEXT) : … … 30 38 rm -f ./a.out ; 31 39 32 ctxswitch-coroutine$(EXEEXT):33 ${CC} ${AM_CFLAGS} ${CFLAGS} ${ccflags} @CFA_FLAGS@ -nodebug -lrt -DN=50000000 CorCtxSwitch.c34 @rm -f .result.log35 @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 done38 @./stat.py .result.log39 @rm -f a.out .result.log40 41 ctxswitch-thread$(EXEEXT):42 ${CC} ${AM_CFLAGS} ${CFLAGS} ${ccflags} @CFA_FLAGS@ -nodebug -lrt -DN=50000000 ThrdCtxSwitch.c43 @rm -f .result.log44 @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 done47 @./stat.py .result.log48 @rm -f a.out .result.log49 50 sched-int$(EXEEXT):51 ${CC} ${AM_CFLAGS} ${CFLAGS} ${ccflags} @CFA_FLAGS@ -nodebug -lrt -DN=50000000 SchedInt.c52 @rm -f .result.log53 @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 done56 @./stat.py .result.log57 @rm -f a.out .result.log58 59 monitor$(EXEEXT):60 ${CC} ${AM_CFLAGS} ${CFLAGS} ${ccflags} @CFA_FLAGS@ -nodebug -lrt -DN=50000000 Monitor.c61 @rm -f .result.log62 @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 done65 @./stat.py .result.log66 @rm -f a.out .result.log67 68 40 csv-data$(EXEEXT): 69 41 @${CC} ${AM_CFLAGS} ${CFLAGS} ${ccflags} @CFA_FLAGS@ -nodebug -lrt -quiet -DN=50000000 csv-data.c 70 42 @./a.out 71 43 @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
r78315272 r3f7e12cb 92 92 build_triplet = @build@ 93 93 host_triplet = @host@ 94 noinst_PROGRAMS = 94 95 subdir = src/benchmark 95 96 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 … … 103 104 CONFIG_CLEAN_VPATH_FILES = 104 105 PROGRAMS = $(noinst_PROGRAMS) 105 bench_SOURCES = bench.c106 bench_OBJECTS = bench.$(OBJEXT)107 bench_LDADD = $(LDADD)108 csv_data_SOURCES = csv-data.c109 csv_data_OBJECTS = csv-data.$(OBJEXT)110 csv_data_LDADD = $(LDADD)111 ctxswitch_coroutine_SOURCES = ctxswitch-coroutine.c112 ctxswitch_coroutine_OBJECTS = ctxswitch-coroutine.$(OBJEXT)113 ctxswitch_coroutine_LDADD = $(LDADD)114 ctxswitch_thread_SOURCES = ctxswitch-thread.c115 ctxswitch_thread_OBJECTS = ctxswitch-thread.$(OBJEXT)116 ctxswitch_thread_LDADD = $(LDADD)117 monitor_SOURCES = monitor.c118 monitor_OBJECTS = monitor.$(OBJEXT)119 monitor_LDADD = $(LDADD)120 sched_int_SOURCES = sched-int.c121 sched_int_OBJECTS = sched-int.$(OBJEXT)122 sched_int_LDADD = $(LDADD)123 106 AM_V_P = $(am__v_P_@AM_V@) 124 107 am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) … … 133 116 am__v_at_0 = @ 134 117 am__v_at_1 = 135 DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) 136 depcomp = $(SHELL) $(top_srcdir)/automake/depcomp 137 am__depfiles_maybe = depfiles 138 am__mv = mv -f 139 COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ 140 $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) 141 AM_V_CC = $(am__v_CC_@AM_V@) 142 am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@) 143 am__v_CC_0 = @echo " CC " $@; 144 am__v_CC_1 = 145 CCLD = $(CC) 146 LINK = $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@ 147 AM_V_CCLD = $(am__v_CCLD_@AM_V@) 148 am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@) 149 am__v_CCLD_0 = @echo " CCLD " $@; 150 am__v_CCLD_1 = 151 SOURCES = bench.c csv-data.c ctxswitch-coroutine.c ctxswitch-thread.c \ 152 monitor.c sched-int.c 153 DIST_SOURCES = bench.c csv-data.c ctxswitch-coroutine.c \ 154 ctxswitch-thread.c monitor.c sched-int.c 118 SOURCES = 119 DIST_SOURCES = 155 120 am__can_run_installinfo = \ 156 121 case $$AM_UPDATE_INFO_DIR in \ … … 159 124 esac 160 125 am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) 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. 164 am__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. 172 am__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)` 177 ETAGS = etags 178 CTAGS = ctags 179 am__DIST_COMMON = $(srcdir)/Makefile.in $(top_srcdir)/automake/depcomp 126 am__DIST_COMMON = $(srcdir)/Makefile.in 180 127 DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) 181 128 ACLOCAL = @ACLOCAL@ … … 302 249 top_srcdir = @top_srcdir@ 303 250 AM_CFLAGS = -g -Wall -Wno-unused-function -O2 304 noinst_PROGRAMS = bench$(EXEEXT) ctxswitch-coroutine$(EXEEXT) ctxswitch-thread$(EXEEXT) sched-int$(EXEEXT) monitor$(EXEEXT) csv-data$(EXEEXT) 251 TOOLSDIR = ${abs_top_srcdir}/tools/ 252 REPEAT = ${TOOLSDIR}repeat 253 STATS = ${TOOLSDIR}stat.py 254 repeats = 30 305 255 all: all-am 306 256 307 257 .SUFFIXES: 308 .SUFFIXES: .c .o .obj309 258 $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) 310 259 @for dep in $?; do \ … … 339 288 clean-noinstPROGRAMS: 340 289 -test -z "$(noinst_PROGRAMS)" || rm -f $(noinst_PROGRAMS) 341 342 mostlyclean-compile: 343 -rm -f *.$(OBJEXT) 344 345 distclean-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 371 ID: $(am__tagged_files) 372 $(am__define_uniq_tagged_files); mkid -fID $$unique 373 tags: tags-am 374 TAGS: tags 375 376 tags-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 391 ctags: ctags-am 392 393 CTAGS: ctags 394 ctags-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 400 GTAGS: 401 here=`$(am__cd) $(top_builddir) && pwd` \ 402 && $(am__cd) $(top_srcdir) \ 403 && gtags -i $(GTAGS_ARGS) "$$here" 404 cscopelist: cscopelist-am 405 406 cscopelist-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 420 distclean-tags: 421 -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags 290 tags TAGS: 291 292 ctags CTAGS: 293 294 cscope cscopelist: 295 422 296 423 297 distdir: $(DISTFILES) … … 490 364 491 365 distclean: distclean-am 492 -rm -rf ./$(DEPDIR)493 366 -rm -f Makefile 494 distclean-am: clean-am distclean-compile distclean-generic \ 495 distclean-tags 367 distclean-am: clean-am distclean-generic 496 368 497 369 dvi: dvi-am … … 536 408 537 409 maintainer-clean: maintainer-clean-am 538 -rm -rf ./$(DEPDIR)539 410 -rm -f Makefile 540 411 maintainer-clean-am: distclean-am maintainer-clean-generic … … 542 413 mostlyclean: mostlyclean-am 543 414 544 mostlyclean-am: mostlyclean- compile mostlyclean-generic415 mostlyclean-am: mostlyclean-generic 545 416 546 417 pdf: pdf-am … … 556 427 .MAKE: install-am install-strip 557 428 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 \ 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 \ 569 439 uninstall-am 570 440 571 441 .PRECIOUS: Makefile 572 442 443 444 .NOTPARALLEL: 445 446 all : ctxswitch$(EXEEXT) mutex$(EXEEXT) signal$(EXEEXT) waitfor$(EXEEXT) creation$(EXEEXT) 573 447 574 448 bench$(EXEEXT) : … … 580 454 rm -f ./a.out ; 581 455 582 ctxswitch-coroutine$(EXEEXT):583 ${CC} ${AM_CFLAGS} ${CFLAGS} ${ccflags} @CFA_FLAGS@ -nodebug -lrt -DN=50000000 CorCtxSwitch.c584 @rm -f .result.log585 @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 done588 @./stat.py .result.log589 @rm -f a.out .result.log590 591 ctxswitch-thread$(EXEEXT):592 ${CC} ${AM_CFLAGS} ${CFLAGS} ${ccflags} @CFA_FLAGS@ -nodebug -lrt -DN=50000000 ThrdCtxSwitch.c593 @rm -f .result.log594 @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 done597 @./stat.py .result.log598 @rm -f a.out .result.log599 600 sched-int$(EXEEXT):601 ${CC} ${AM_CFLAGS} ${CFLAGS} ${ccflags} @CFA_FLAGS@ -nodebug -lrt -DN=50000000 SchedInt.c602 @rm -f .result.log603 @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 done606 @./stat.py .result.log607 @rm -f a.out .result.log608 609 monitor$(EXEEXT):610 ${CC} ${AM_CFLAGS} ${CFLAGS} ${ccflags} @CFA_FLAGS@ -nodebug -lrt -DN=50000000 Monitor.c611 @rm -f .result.log612 @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 done615 @./stat.py .result.log616 @rm -f a.out .result.log617 618 456 csv-data$(EXEEXT): 619 457 @${CC} ${AM_CFLAGS} ${CFLAGS} ${ccflags} @CFA_FLAGS@ -nodebug -lrt -quiet -DN=50000000 csv-data.c … … 621 459 @rm -f ./a.out 622 460 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 623 579 # Tell versions [3.59,3.63) of GNU make to not export all variables. 624 580 # Otherwise a system limit (for SysV at least) may be exceeded. -
src/benchmark/bench.h
r78315272 r3f7e12cb 1 1 #pragma once 2 2 3 #if defined(__CFORALL__) 3 4 extern "C" { 5 #endif 6 #include <stdlib.h> 4 7 #include <unistd.h> // sysconf 5 8 #include <sys/times.h> // times 6 9 #include <time.h> 10 #if defined(__CFORALL__) 7 11 } 12 #endif 8 13 9 inline unsigned long long int Time() {10 timespec ts;14 static inline unsigned long long int Time() { 15 struct timespec ts; 11 16 clock_gettime( 12 17 #if defined( __linux__ ) … … 23 28 } // Time 24 29 25 #ifndef N26 #define N1000000030 #ifndef BENCH_N 31 #define BENCH_N 500 //10000000 27 32 #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; 28 46 29 47 unsigned int default_preemption() { -
src/benchmark/csv-data.c
r78315272 r3f7e12cb 111 111 StartTime = Time(); 112 112 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); 116 116 } 117 117 EndTime = Time(); … … 122 122 void side1B( mon_t & mutex a ) { 123 123 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); 127 127 } 128 128 } … … 159 159 StartTime = Time(); 160 160 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); 164 164 } 165 165 EndTime = Time(); … … 170 170 void side2B( mon_t & mutex a, mon_t & mutex b ) { 171 171 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); 175 175 } 176 176 } -
src/driver/cfa.cc
r78315272 r3f7e12cb 9 9 // Author : Peter A. Buhr 10 10 // Created On : Tue Aug 20 13:44:49 2002 11 // Last Modified By : Andrew Beach12 // Last Modified On : T hr Aug 17 15:24:00201713 // Update Count : 1 5611 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Tue Oct 31 11:40:44 2017 13 // Update Count : 160 14 14 // 15 15 … … 305 305 } // if 306 306 307 shuffle( args, sargs, nargs, 1 ); // make room at front of argument list 308 nargs += 1; 307 309 if ( CFA_flag ) { 310 args[sargs] = "-D__CFA_FLAG__=-N"; 308 311 args[nargs] = "-D__CFA_PREPROCESS_"; 309 312 nargs += 1; 310 } // if 313 } else { 314 args[sargs] = "-D__CFA_FLAG__=-L"; 315 } // if 316 sargs += 1; 311 317 312 318 if ( debug ) { … … 345 351 } // if 346 352 args[nargs] = "-fgnu89-inline"; 353 nargs += 1; 354 args[nargs] = "-D__int8_t_defined"; // prevent gcc type-size attributes 347 355 nargs += 1; 348 356 args[nargs] = ( *new string( string("-B") + Bprefix + "/" ) ).c_str(); -
src/include/cassert
r78315272 r3f7e12cb 41 41 static inline T strict_dynamic_cast( const U & src ) { 42 42 T ret = dynamic_cast<T>(src); 43 assert (ret);43 assertf(ret, "%s", toString(src).c_str()); 44 44 return ret; 45 45 } -
src/libcfa/Makefile.am
r78315272 r3f7e12cb 31 31 32 32 libcfa_a-libcfa-prelude.o : libcfa-prelude.c 33 ${AM_V_GEN}@BACKEND_CC@ @CFA_FLAGS@ - O2 -c -o $@ $<33 ${AM_V_GEN}@BACKEND_CC@ @CFA_FLAGS@ -Wall -O2 -c -o $@ $< 34 34 35 35 libcfa_d_a-libcfa-prelude.o : libcfa-prelude.c 36 ${AM_V_GEN}@BACKEND_CC@ @CFA_FLAGS@ -D__CFA_DEBUG__ - O0 -c -o $@ $<36 ${AM_V_GEN}@BACKEND_CC@ @CFA_FLAGS@ -D__CFA_DEBUG__ -Wall -O0 -c -o $@ $< 37 37 38 EXTRA_FLAGS = -g -Wall -W error -Wno-unused-function -imacros libcfa-prelude.c @CFA_FLAGS@38 EXTRA_FLAGS = -g -Wall -Wno-unused-function -imacros libcfa-prelude.c @CFA_FLAGS@ 39 39 40 40 AM_CCASFLAGS = @CFA_FLAGS@ -
src/libcfa/Makefile.in
r78315272 r3f7e12cb 416 416 ARFLAGS = cr 417 417 lib_LIBRARIES = $(am__append_1) $(am__append_2) 418 EXTRA_FLAGS = -g -Wall -W error -Wno-unused-function -imacros libcfa-prelude.c @CFA_FLAGS@418 EXTRA_FLAGS = -g -Wall -Wno-unused-function -imacros libcfa-prelude.c @CFA_FLAGS@ 419 419 AM_CCASFLAGS = @CFA_FLAGS@ 420 420 headers = fstream iostream iterator limits rational stdlib \ … … 1498 1498 1499 1499 libcfa_a-libcfa-prelude.o : libcfa-prelude.c 1500 ${AM_V_GEN}@BACKEND_CC@ @CFA_FLAGS@ - O2 -c -o $@ $<1500 ${AM_V_GEN}@BACKEND_CC@ @CFA_FLAGS@ -Wall -O2 -c -o $@ $< 1501 1501 1502 1502 libcfa_d_a-libcfa-prelude.o : libcfa-prelude.c 1503 ${AM_V_GEN}@BACKEND_CC@ @CFA_FLAGS@ -D__CFA_DEBUG__ - O0 -c -o $@ $<1503 ${AM_V_GEN}@BACKEND_CC@ @CFA_FLAGS@ -D__CFA_DEBUG__ -Wall -O0 -c -o $@ $< 1504 1504 1505 1505 # extensionless header files are overridden by -o flag in default makerule => explicitly override default rule to silently do nothing -
src/libcfa/concurrency/coroutine.c
r78315272 r3f7e12cb 123 123 if(pageSize == 0ul) pageSize = sysconf( _SC_PAGESIZE ); 124 124 125 LIB_DEBUG_PRINT_SAFE("FRED");126 127 125 size_t cxtSize = libCeiling( sizeof(machine_context_t), 8 ); // minimum alignment 128 126 … … 158 156 this->limit = (char *)libCeiling( (unsigned long)this->storage, 16 ); // minimum alignment 159 157 } // if 160 assertf( this->size >= MinStackSize, "Stack size % d provides less than minimum of %d bytes for a stack.", this->size, MinStackSize );158 assertf( this->size >= MinStackSize, "Stack size %zd provides less than minimum of %d bytes for a stack.", this->size, MinStackSize ); 161 159 162 160 this->base = (char *)this->limit + this->size; -
src/libcfa/concurrency/invoke.h
r78315272 r3f7e12cb 25 25 #define _INVOKE_H_ 26 26 27 #define unlikely(x) __builtin_expect(!!(x), 0) 28 #define thread_local _Thread_local 29 30 typedef void (*fptr_t)(); 31 32 struct spinlock { 33 volatile int lock; 34 #ifdef __CFA_DEBUG__ 35 const char * prev_name; 36 void* prev_thrd; 37 #endif 38 }; 39 40 struct __thread_queue_t { 41 struct thread_desc * head; 42 struct thread_desc ** tail; 43 }; 44 45 struct __condition_stack_t { 46 struct __condition_criterion_t * top; 47 }; 48 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 ** ); 55 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 * ); 59 60 void ?{}(spinlock & this); 61 void ^?{}(spinlock & this); 62 } 63 #endif 64 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 }; 74 75 enum coroutine_state { Halted, Start, Inactive, Active, Primed }; 76 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 }; 85 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 92 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 }; 97 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 102 103 // Link lists fields 104 struct thread_desc * next; // instrusive link field for threads 105 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 27 #define unlikely(x) __builtin_expect(!!(x), 0) 28 #define thread_local _Thread_local 29 30 typedef void (*fptr_t)(); 31 typedef int_fast16_t __lock_size_t; 32 33 struct spinlock { 34 volatile int lock; 35 #ifdef __CFA_DEBUG__ 36 const char * prev_name; 37 void* prev_thrd; 38 #endif 39 }; 40 41 struct __thread_queue_t { 42 struct thread_desc * head; 43 struct thread_desc ** tail; 44 }; 45 46 struct __condition_stack_t { 47 struct __condition_criterion_t * top; 48 }; 49 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 ** ); 56 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 & ); 60 61 void ?{}(spinlock & this); 62 void ^?{}(spinlock & this); 63 } 64 #endif 65 66 struct coStack_t { 67 // size of stack 68 size_t size; 69 70 // pointer to stack 71 void *storage; 72 73 // stack grows towards stack limit 74 void *limit; 75 76 // base of stack 77 void *base; 78 79 // address of cfa_context_t 80 void *context; 81 82 // address of top of storage 83 void *top; 84 85 // whether or not the user allocated the stack 86 bool userStack; 87 }; 88 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; 110 173 }; 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 111 196 112 197 #endif //_INVOKE_H_ … … 115 200 #define _INVOKE_PRIVATE_H_ 116 201 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 202 struct machine_context_t { 203 void *SP; 204 void *FP; 205 void *PC; 206 }; 207 208 // assembler routines that performs the context switch 209 extern void CtxInvokeStub( void ); 210 void CtxSwitch( void * from, void * to ) asm ("CtxSwitch"); 211 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 138 223 139 224 #endif //_INVOKE_PRIVATE_H_ -
src/libcfa/concurrency/kernel
r78315272 r3f7e12cb 26 26 //----------------------------------------------------------------------------- 27 27 // Locks 28 void lock ( spinlock * DEBUG_CTX_PARAM2 ); // Lock the spinlock, spin if already acquired 29 void lock_yield( spinlock * DEBUG_CTX_PARAM2 ); // Lock the spinlock, yield repeatedly if already acquired 30 bool try_lock ( spinlock * DEBUG_CTX_PARAM2 ); // Lock the spinlock, return false if already acquired 31 void unlock ( spinlock * ); // Unlock the spinlock 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 * ); 32 39 33 40 struct semaphore { … … 39 46 void ?{}(semaphore & this, int count = 1); 40 47 void ^?{}(semaphore & this); 41 void P(semaphore *this);42 void V(semaphore *this);48 void P (semaphore & this); 49 void V (semaphore & this); 43 50 44 51 … … 46 53 // Cluster 47 54 struct cluster { 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 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; 51 63 }; 52 64 53 void ?{} (cluster & this);65 void ?{} (cluster & this); 54 66 void ^?{}(cluster & this); 55 67 … … 79 91 struct processor { 80 92 // Main state 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 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; 84 101 85 102 // Termination 86 volatile bool do_terminate; // Set to true to notify the processor should terminate 87 semaphore terminated; // Termination synchronisation 103 // Set to true to notify the processor should terminate 104 volatile bool do_terminate; 105 106 // Termination synchronisation 107 semaphore terminated; 88 108 89 109 // RunThread data 90 struct FinishAction finish; // Action to do after a thread is ran 110 // Action to do after a thread is ran 111 struct FinishAction finish; 91 112 92 113 // Preemption data 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 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; 95 119 96 120 #ifdef __CFA_DEBUG__ 97 char * last_enable; // Last function to enable preemption on this processor 121 // Last function to enable preemption on this processor 122 char * last_enable; 98 123 #endif 99 124 }; 100 125 101 void ?{}(processor & this);102 void ?{}(processor & this, cluster * cltr);126 void ?{}(processor & this); 127 void ?{}(processor & this, cluster * cltr); 103 128 void ^?{}(processor & this); 104 129 -
src/libcfa/concurrency/kernel.c
r78315272 r3f7e12cb 106 106 107 107 void ?{}( thread_desc & this, current_stack_info_t * info) { 108 (this. cor){ info };108 (this.self_cor){ info }; 109 109 } 110 110 … … 158 158 LIB_DEBUG_PRINT_SAFE("Kernel : core %p signaling termination\n", &this); 159 159 this.do_terminate = true; 160 P( &this.terminated );160 P( this.terminated ); 161 161 pthread_join( this.kernel_thread, NULL ); 162 162 } … … 216 216 } 217 217 218 V( &this->terminated );218 V( this->terminated ); 219 219 220 220 LIB_DEBUG_PRINT_SAFE("Kernel : core %p terminated\n", this); … … 328 328 // if( !thrd ) return; 329 329 verify( thrd ); 330 verify( thrd-> cor.state != Halted );330 verify( thrd->self_cor.state != Halted ); 331 331 332 332 verify( disable_preempt_count > 0 ); … … 335 335 336 336 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 ); 338 338 unlock( &this_processor->cltr->ready_queue_lock ); 339 339 … … 344 344 verify( disable_preempt_count > 0 ); 345 345 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 ); 347 347 unlock( &this->ready_queue_lock ); 348 348 verify( disable_preempt_count > 0 ); … … 373 373 assert(thrd); 374 374 disable_interrupts(); 375 assert( thrd-> cor.state != Halted );375 assert( thrd->self_cor.state != Halted ); 376 376 this_processor->finish.action_code = Schedule; 377 377 this_processor->finish.thrd = thrd; … … 398 398 } 399 399 400 void BlockInternal(spinlock * * locks, unsigned short count) {400 void BlockInternal(spinlock * locks [], unsigned short count) { 401 401 disable_interrupts(); 402 402 this_processor->finish.action_code = Release_Multi; … … 411 411 } 412 412 413 void BlockInternal(spinlock * * locks, unsigned short lock_count, thread_desc ** thrds, unsigned short thrd_count) {413 void BlockInternal(spinlock * locks [], unsigned short lock_count, thread_desc * thrds [], unsigned short thrd_count) { 414 414 disable_interrupts(); 415 415 this_processor->finish.action_code = Release_Multi_Schedule; … … 466 466 this_processor = mainProcessor; 467 467 this_thread = mainThread; 468 this_coroutine = &mainThread-> cor;468 this_coroutine = &mainThread->self_cor; 469 469 470 470 // Enable preemption … … 547 547 thread_desc * thrd = kernel_data; 548 548 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 );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 ); 551 551 552 552 if ( thrd != this_coroutine ) { 553 553 len = snprintf( abort_text, abort_text_size, " in coroutine %.256s (%p).\n", this_coroutine->name, this_coroutine ); 554 __lib_debug_write( STDERR_FILENO,abort_text, len );554 __lib_debug_write( abort_text, len ); 555 555 } 556 556 else { 557 __lib_debug_write( STDERR_FILENO,".\n", 2 );557 __lib_debug_write( ".\n", 2 ); 558 558 } 559 559 } … … 618 618 void ^?{}(semaphore & this) {} 619 619 620 void P(semaphore *this) {621 lock( &this ->lock DEBUG_CTX2 );622 this ->count -= 1;623 if ( this ->count < 0 ) {620 void P(semaphore & this) { 621 lock( &this.lock DEBUG_CTX2 ); 622 this.count -= 1; 623 if ( this.count < 0 ) { 624 624 // queue current task 625 append( &this->waiting, (thread_desc *)this_thread );625 append( this.waiting, (thread_desc *)this_thread ); 626 626 627 627 // atomically release spin lock and block 628 BlockInternal( &this ->lock );628 BlockInternal( &this.lock ); 629 629 } 630 630 else { 631 unlock( &this ->lock );632 } 633 } 634 635 void V(semaphore *this) {631 unlock( &this.lock ); 632 } 633 } 634 635 void V(semaphore & this) { 636 636 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 ) { 640 640 // 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 ); 645 645 646 646 // make new owner … … 655 655 } 656 656 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;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; 665 665 if( head ) { 666 this ->head = head->next;666 this.head = head->next; 667 667 if( !head->next ) { 668 this ->tail = &this->head;668 this.tail = &this.head; 669 669 } 670 670 head->next = NULL; … … 673 673 } 674 674 675 thread_desc * remove( __thread_queue_t *this, thread_desc ** it ) {675 thread_desc * remove( __thread_queue_t & this, thread_desc ** it ) { 676 676 thread_desc * thrd = *it; 677 677 verify( thrd ); … … 679 679 (*it) = thrd->next; 680 680 681 if( this ->tail == &thrd->next ) {682 this ->tail = it;681 if( this.tail == &thrd->next ) { 682 this.tail = it; 683 683 } 684 684 685 685 thrd->next = NULL; 686 686 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 ); 689 689 return thrd; 690 690 } … … 694 694 } 695 695 696 void push( __condition_stack_t *this, __condition_criterion_t * t ) {696 void push( __condition_stack_t & this, __condition_criterion_t * t ) { 697 697 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; 704 704 if( top ) { 705 this ->top = top->next;705 this.top = top->next; 706 706 top->next = NULL; 707 707 } -
src/libcfa/concurrency/kernel_private.h
r78315272 r3f7e12cb 48 48 void BlockInternal(thread_desc * thrd); 49 49 void 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);50 void BlockInternal(spinlock * locks [], unsigned short count); 51 void BlockInternal(spinlock * locks [], unsigned short count, thread_desc * thrds [], unsigned short thrd_count); 52 52 void LeaveThread(spinlock * lock, thread_desc * thrd); 53 53 -
src/libcfa/concurrency/monitor
r78315272 r3f7e12cb 10 10 // Created On : Thd Feb 23 12:27:26 2017 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Sat Jul 22 09:59:01201713 // Update Count : 312 // Last Modified On : Sat Oct 7 18:06:45 2017 13 // Update Count : 10 14 14 // 15 15 … … 22 22 #include "stdlib" 23 23 24 trait is_monitor(dtype T) { 25 monitor_desc * get_monitor( T & ); 26 void ^?{}( T & mutex ); 27 }; 28 24 29 static inline void ?{}(monitor_desc & this) { 25 30 (this.lock){}; 26 this.owner = NULL;27 31 (this.entry_queue){}; 28 32 (this.signal_stack){}; 29 this.recursion = 0; 30 this.acceptables = NULL; 31 this.acceptable_count = 0; 32 this.accepted_index = -1; 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; 33 39 } 34 40 35 41 struct monitor_guard_t { 36 42 monitor_desc ** m; 37 intcount;43 __lock_size_t count; 38 44 monitor_desc ** prev_mntrs; 39 unsigned shortprev_count;45 __lock_size_t prev_count; 40 46 fptr_t prev_func; 41 47 }; 42 48 43 static inline int ?<?(monitor_desc* lhs, monitor_desc* rhs) { 44 return ((intptr_t)lhs) < ((intptr_t)rhs); 49 void ?{}( monitor_guard_t & this, monitor_desc ** m, __lock_size_t count, void (*func)() ); 50 void ^?{}( 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 ); 45 66 } 46 47 void ?{}( monitor_guard_t & this, monitor_desc ** m, int count, void (*func)() );48 void ^?{}( monitor_guard_t & this );49 67 50 68 //----------------------------------------------------------------------------- … … 52 70 53 71 struct __condition_criterion_t { 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 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; 58 83 }; 59 84 60 85 struct __condition_node_t { 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 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; 66 100 }; 67 101 … … 71 105 }; 72 106 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 73 111 void ?{}( __condition_blocked_queue_t & ); 74 void append( __condition_blocked_queue_t *, __condition_node_t * );75 __condition_node_t * pop_head( __condition_blocked_queue_t *);112 void append( __condition_blocked_queue_t &, __condition_node_t * ); 113 __condition_node_t * pop_head( __condition_blocked_queue_t & ); 76 114 77 115 struct condition { 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 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; 81 124 }; 82 125 … … 90 133 } 91 134 92 void wait( condition *this, uintptr_t user_info = 0 );93 bool signal( condition *this );94 bool signal_block( condition *this );95 static inline bool is_empty ( condition * this ) { return !this->blocked.head; }96 uintptr_t front( condition *this );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 ); 97 140 98 141 //----------------------------------------------------------------------------- … … 100 143 101 144 struct __acceptable_t { 102 fptr_t func; 103 unsigned short count; 104 monitor_desc ** monitors; 145 __monitor_group_t; 105 146 bool is_dtor; 106 147 }; 107 148 108 int __accept_internal( unsigned short count, __acceptable_t * acceptables);149 void __waitfor_internal( const __waitfor_mask_t & mask, int duration ); 109 150 110 151 // Local Variables: // -
src/libcfa/concurrency/monitor.c
r78315272 r3f7e12cb 17 17 18 18 #include <stdlib> 19 #include <inttypes.h> 19 20 20 21 #include "libhdr.h" 21 22 #include "kernel_private.h" 22 23 24 #include "bits/algorithms.h" 25 23 26 //----------------------------------------------------------------------------- 24 27 // Forward declarations 25 static inline void set_owner( monitor_desc * this, thread_desc * owner ); 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 26 33 static inline thread_desc * next_thread( monitor_desc * this ); 27 static inline int is_accepted( thread_desc * owner, monitor_desc * this, monitor_desc ** group, int group_cnt, void (*func)() ); 28 29 static inline void lock_all( spinlock ** locks, unsigned short count ); 30 static inline void lock_all( monitor_desc ** source, spinlock ** /*out*/ locks, unsigned short count ); 31 static inline void unlock_all( spinlock ** locks, unsigned short count ); 32 static inline void unlock_all( monitor_desc ** locks, unsigned short count ); 33 34 static inline void save_recursion ( monitor_desc ** ctx, unsigned int * /*out*/ recursions, unsigned short count ); 35 static inline void restore_recursion( monitor_desc ** ctx, unsigned int * /*in */ recursions, unsigned short count ); 36 37 static inline void init ( int count, monitor_desc ** monitors, __condition_node_t * waiter, __condition_criterion_t * criteria ); 38 static inline void init_push( int count, monitor_desc ** monitors, __condition_node_t * waiter, __condition_criterion_t * criteria ); 39 40 static inline thread_desc * check_condition( __condition_criterion_t * ); 41 static inline void brand_condition( condition * ); 42 static inline unsigned short insert_unique( thread_desc ** thrds, unsigned short end, thread_desc * val ); 43 44 static inline thread_desc * search_entry_queue( __acceptable_t * acceptables, int acc_count, monitor_desc ** monitors, int count ); 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 ); 45 55 46 56 //----------------------------------------------------------------------------- 47 57 // Useful defines 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 */ \ 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 63 78 64 79 //----------------------------------------------------------------------------- … … 68 83 extern "C" { 69 84 // Enter single monitor 70 static void __enter_monitor_desc( monitor_desc * this, monitor_desc ** group, int group_cnt, void (*func)()) {85 static void __enter_monitor_desc( monitor_desc * this, const __monitor_group_t & group ) { 71 86 // Lock the monitor spinlock, lock_yield to reduce contention 72 87 lock_yield( &this->lock DEBUG_CTX2 ); … … 75 90 LIB_DEBUG_PRINT_SAFE("Kernel : %10p Entering mon %p (%p)\n", thrd, this, this->owner); 76 91 77 this->accepted_index = -1;78 92 if( !this->owner ) { 79 93 // No one has the monitor, just take it … … 83 97 } 84 98 else if( this->owner == thrd) { 85 // We already have the monitor, just not how many times we took it 86 verify( this->recursion > 0 ); 99 // We already have the monitor, just note how many times we took it 87 100 this->recursion += 1; 88 101 89 102 LIB_DEBUG_PRINT_SAFE("Kernel : mon already owned \n"); 90 103 } 91 else if( (this->accepted_index = is_accepted( thrd, this, group, group_cnt, func)) >= 0) {104 else if( is_accepted( this, group) ) { 92 105 // Some one was waiting for us, enter 93 106 set_owner( this, thrd ); 94 107 108 // Reset mask 109 reset_mask( this ); 110 95 111 LIB_DEBUG_PRINT_SAFE("Kernel : mon accepts \n"); 96 112 } … … 99 115 100 116 // Some one else has the monitor, wait in line for it 101 append( &this->entry_queue, thrd );117 append( this->entry_queue, thrd ); 102 118 BlockInternal( &this->lock ); 103 119 … … 113 129 unlock( &this->lock ); 114 130 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 115 194 } 116 195 … … 120 199 lock_yield( &this->lock DEBUG_CTX2 ); 121 200 122 verifyf( this_thread == this->owner, "Expected owner to be %p, got %p (r: %i)", this_thread, this->owner, this->recursion ); 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 ); 123 204 124 205 // Leaving a recursion level, decrement the counter … … 128 209 // it means we don't need to do anything 129 210 if( this->recursion != 0) { 211 LIB_DEBUG_PRINT_SAFE("Kernel : recursion still %d\n", this->recursion); 130 212 unlock( &this->lock ); 131 213 return; … … 140 222 //We need to wake-up the thread 141 223 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 ) 142 236 } 143 237 … … 146 240 // Should never return 147 241 void __leave_thread_monitor( thread_desc * thrd ) { 148 monitor_desc * this = &thrd-> mon;242 monitor_desc * this = &thrd->self_mon; 149 243 150 244 // Lock the monitor now … … 153 247 disable_interrupts(); 154 248 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);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 ); 158 252 159 253 // Leaving a recursion level, decrement the counter … … 178 272 // Enter multiple monitor 179 273 // relies on the monitor array being sorted 180 static 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);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 ); 183 277 } 184 278 } … … 186 280 // Leave multiple monitor 187 281 // relies on the monitor array being sorted 188 static inline void leave(monitor_desc * * monitors, int count) {189 for( int i = count - 1; i >= 0; i--) {282 static inline void leave(monitor_desc * monitors [], __lock_size_t count) { 283 for( __lock_size_t i = count - 1; i >= 0; i--) { 190 284 __leave_monitor_desc( monitors[i] ); 191 285 } … … 194 288 // Ctor for monitor guard 195 289 // Sorts monitors before entering 196 void ?{}( monitor_guard_t & this, monitor_desc * * m, int count, void (*func)()) {290 void ?{}( monitor_guard_t & this, monitor_desc * m [], __lock_size_t count, fptr_t func ) { 197 291 // Store current array 198 292 this.m = m; … … 200 294 201 295 // Sort monitors based on address -> TODO use a sort specialized for small numbers 202 qsort(this.m, count);296 __libcfa_small_sort(this.m, count); 203 297 204 298 // Save previous thread context 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; 299 this.[prev_mntrs, prev_count, prev_func] = this_thread->monitors.[list, size, func]; 208 300 209 301 // Update thread context (needed for conditions) 210 this_thread-> current_monitors = m;211 this_thread->current_monitor_count = count; 212 this_thread->current_monitor_func = func;302 this_thread->monitors.[list, size, func] = [m, count, func]; 303 304 // LIB_DEBUG_PRINT_SAFE("MGUARD : enter %d\n", count); 213 305 214 306 // Enter the monitors in order 215 enter( this.m, this.count, func ); 307 __monitor_group_t group = {this.m, this.count, func}; 308 enter( group ); 309 310 // LIB_DEBUG_PRINT_SAFE("MGUARD : entered\n"); 216 311 } 217 312 … … 219 314 // Dtor for monitor guard 220 315 void ^?{}( monitor_guard_t & this ) { 316 // LIB_DEBUG_PRINT_SAFE("MGUARD : leaving %d\n", this.count); 317 221 318 // Leave the monitors in order 222 319 leave( this.m, this.count ); 223 320 321 // LIB_DEBUG_PRINT_SAFE("MGUARD : left\n"); 322 224 323 // Restore thread context 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; 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]; 228 349 } 229 350 230 351 //----------------------------------------------------------------------------- 231 352 // Internal scheduling types 232 void ?{}(__condition_node_t & this, thread_desc * waiting_thread, unsigned short count, uintptr_t user_info ) {353 void ?{}(__condition_node_t & this, thread_desc * waiting_thread, __lock_size_t count, uintptr_t user_info ) { 233 354 this.waiting_thread = waiting_thread; 234 355 this.count = count; … … 244 365 } 245 366 246 void ?{}(__condition_criterion_t & this, monitor_desc * target, __condition_node_t *owner ) {367 void ?{}(__condition_criterion_t & this, monitor_desc * target, __condition_node_t & owner ) { 247 368 this.ready = false; 248 369 this.target = target; 249 this.owner = owner;370 this.owner = &owner; 250 371 this.next = NULL; 251 372 } … … 253 374 //----------------------------------------------------------------------------- 254 375 // Internal scheduling 255 void wait( condition *this, uintptr_t user_info = 0 ) {376 void wait( condition & this, uintptr_t user_info = 0 ) { 256 377 brand_condition( this ); 257 378 258 379 // Check that everything is as expected 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 );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 ); 262 383 263 384 // Create storage for monitor context 264 monitor_ctx( this ->monitors, this->monitor_count );385 monitor_ctx( this.monitors, this.monitor_count ); 265 386 266 387 // Create the node specific to this wait operation … … 269 390 // Append the current wait operation to the ones already queued on the condition 270 391 // We don't need locks for that since conditions must always be waited on inside monitor mutual exclusion 271 append( &this->blocked, &waiter );272 273 // Lock all monitors (aggregates the lock themas well)392 append( this.blocked, &waiter ); 393 394 // Lock all monitors (aggregates the locks as well) 274 395 lock_all( monitors, locks, count ); 275 396 276 // DON'T unlock, ask the kernel to do it277 278 // Save monitor state279 save_recursion( monitors, recursions, count );280 281 397 // Find the next thread(s) to run 282 unsigned short thread_count = 0;398 __lock_size_t thread_count = 0; 283 399 thread_desc * threads[ count ]; 284 for(int i = 0; i < count; i++) { 285 threads[i] = 0; 286 } 400 __builtin_memset( threads, 0, sizeof( threads ) ); 401 402 // Save monitor states 403 monitor_save; 287 404 288 405 // Remove any duplicate threads 289 for( int i = 0; i < count; i++) {406 for( __lock_size_t i = 0; i < count; i++) { 290 407 thread_desc * new_owner = next_thread( monitors[i] ); 291 thread_count =insert_unique( threads, thread_count, new_owner );408 insert_unique( threads, thread_count, new_owner ); 292 409 } 293 410 … … 295 412 BlockInternal( locks, count, threads, thread_count ); 296 413 297 298 // WE WOKE UP299 300 301 414 // We are back, restore the owners and recursions 302 lock_all( locks, count ); 303 restore_recursion( monitors, recursions, count ); 304 unlock_all( locks, count ); 305 } 306 307 bool signal( condition * this ) { 415 monitor_restore; 416 } 417 418 bool signal( condition & this ) { 308 419 if( is_empty( this ) ) { return false; } 309 420 310 421 //Check that everything is as expected 311 verify( this ->monitors );312 verify( this ->monitor_count != 0 );422 verify( this.monitors ); 423 verify( this.monitor_count != 0 ); 313 424 314 425 //Some more checking in debug 315 426 LIB_DEBUG_DO( 316 427 thread_desc * this_thrd = this_thread; 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] );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] ); 324 435 } 325 436 } 326 437 ); 327 438 328 unsigned short count = this->monitor_count;439 __lock_size_t count = this.monitor_count; 329 440 330 441 // Lock all monitors 331 lock_all( this ->monitors, NULL, count );442 lock_all( this.monitors, NULL, count ); 332 443 333 444 //Pop the head of the waiting queue 334 __condition_node_t * node = pop_head( &this->blocked );445 __condition_node_t * node = pop_head( this.blocked ); 335 446 336 447 //Add the thread to the proper AS stack … … 338 449 __condition_criterion_t * crit = &node->criteria[i]; 339 450 assert( !crit->ready ); 340 push( &crit->target->signal_stack, crit );451 push( crit->target->signal_stack, crit ); 341 452 } 342 453 343 454 //Release 344 unlock_all( this ->monitors, count );455 unlock_all( this.monitors, count ); 345 456 346 457 return true; 347 458 } 348 459 349 bool signal_block( condition *this ) {350 if( !this ->blocked.head ) { return false; }460 bool signal_block( condition & this ) { 461 if( !this.blocked.head ) { return false; } 351 462 352 463 //Check that everything is as expected 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 );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 ); 355 466 356 467 // Create storage for monitor context 357 monitor_ctx( this ->monitors, this->monitor_count );468 monitor_ctx( this.monitors, this.monitor_count ); 358 469 359 470 // Lock all monitors (aggregates the locks them as well) … … 364 475 365 476 //save contexts 366 save_recursion( monitors, recursions, count );477 monitor_save; 367 478 368 479 //Find the thread to run 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 }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 ); 373 484 374 485 //Everything is ready to go to sleep … … 379 490 380 491 381 //We are back, restore the owners and recursions382 lock_all( locks, count ); 383 restore_recursion( monitors, recursions, count );384 unlock_all( locks, count );492 LIB_DEBUG_PRINT_BUFFER_LOCAL( "Kernel : signal_block returned\n" ); 493 494 //We are back, restore the masks and recursions 495 monitor_restore; 385 496 386 497 return true; … … 388 499 389 500 // Access the user_info of the thread waiting at the front of the queue 390 uintptr_t front( condition *this ) {501 uintptr_t front( condition & this ) { 391 502 verifyf( !is_empty(this), 392 503 "Attempt to access user data on an empty condition.\n" 393 504 "Possible cause is not checking if the condition is empty before reading stored data." 394 505 ); 395 return this ->blocked.head->user_info;506 return this.blocked.head->user_info; 396 507 } 397 508 398 509 //----------------------------------------------------------------------------- 399 // Internal scheduling 400 int __accept_internal( unsigned short acc_count, __acceptable_t * acceptables ) { 401 thread_desc * thrd = this_thread; 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"); 402 536 403 537 // Create storage for monitor context 404 monitor_ctx( acceptables->monitors, acceptables->count );405 406 // Lock all monitors (aggregates the lock themas well)538 monitor_ctx( mon_storage, actual_count ); 539 540 // Lock all monitors (aggregates the locks as well) 407 541 lock_all( monitors, locks, count ); 408 542 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 409 612 // Create the node specific to this wait operation 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; 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); 454 635 } 455 636 … … 458 639 459 640 static 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 460 643 //Pass the monitor appropriately 461 644 this->owner = owner; … … 465 648 } 466 649 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 467 671 static inline thread_desc * next_thread( monitor_desc * this ) { 468 672 //Check the signaller stack 469 __condition_criterion_t * urgent = pop( &this->signal_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 ); 470 675 if( urgent ) { 471 676 //The signaller stack is not empty, … … 479 684 // No signaller thread 480 685 // Get the next thread in the entry_queue 481 thread_desc * new_owner = pop_head( &this->entry_queue );686 thread_desc * new_owner = pop_head( this->entry_queue ); 482 687 set_owner( this, new_owner ); 483 688 … … 485 690 } 486 691 487 static inline int is_accepted( thread_desc * owner, monitor_desc * this, monitor_desc ** group, int group_cnt, void (*func)()) {488 __acceptable_t * accs = this->acceptables; // Optim489 int acc_cnt = this->acceptable_count;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; 490 695 491 696 // Check if there are any acceptable functions 492 if( ! accs ) return -1;697 if( !it ) return false; 493 698 494 699 // If this isn't the first monitor to test this, there is no reason to repeat the test. 495 if( this != group[0] ) return group[0]-> accepted_index;700 if( this != group[0] ) return group[0]->mask.accepted >= 0; 496 701 497 702 // For all acceptable functions check if this is the current function. 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; 703 for( __lock_size_t i = 0; i < count; i++, it++ ) { 704 if( *it == group ) { 705 *this->mask.accepted = i; 706 return true; 516 707 } 517 708 } 518 709 519 710 // No function matched 520 return -1;521 } 522 523 static inline void init( int count, monitor_desc ** monitors, __condition_node_t * waiter, __condition_criterion_t * criteria) {524 for( int i = 0; i < count; i++) {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++) { 525 716 (criteria[i]){ monitors[i], waiter }; 526 717 } 527 718 528 waiter ->criteria = criteria;529 } 530 531 static 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++) {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++) { 533 724 (criteria[i]){ monitors[i], waiter }; 534 push( &criteria[i].target->signal_stack, &criteria[i] ); 535 } 536 537 waiter->criteria = criteria; 538 } 539 540 static inline void lock_all( spinlock ** locks, unsigned short count ) { 541 for( int i = 0; i < count; i++ ) { 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++ ) { 542 734 lock_yield( locks[i] DEBUG_CTX2 ); 543 735 } 544 736 } 545 737 546 static inline void lock_all( monitor_desc * * source, spinlock ** /*out*/ locks, unsigned short count ) {547 for( int i = 0; i < count; i++ ) {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++ ) { 548 740 spinlock * l = &source[i]->lock; 549 741 lock_yield( l DEBUG_CTX2 ); … … 552 744 } 553 745 554 static inline void unlock_all( spinlock * * locks, unsigned short count ) {555 for( int i = 0; i < count; i++ ) {746 static inline void unlock_all( spinlock * locks [], __lock_size_t count ) { 747 for( __lock_size_t i = 0; i < count; i++ ) { 556 748 unlock( locks[i] ); 557 749 } 558 750 } 559 751 560 static inline void unlock_all( monitor_desc * * locks, unsigned short count ) {561 for( int i = 0; i < count; i++ ) {752 static inline void unlock_all( monitor_desc * locks [], __lock_size_t count ) { 753 for( __lock_size_t i = 0; i < count; i++ ) { 562 754 unlock( &locks[i]->lock ); 563 755 } 564 756 } 565 757 566 567 static inline void save_recursion ( monitor_desc ** ctx, unsigned int * /*out*/ recursions, unsigned short count ) { 568 for( int i = 0; i < count; i++ ) { 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++ ) { 569 766 recursions[i] = ctx[i]->recursion; 570 } 571 } 572 573 static inline void restore_recursion( monitor_desc ** ctx, unsigned int * /*in */ recursions, unsigned short count ) { 574 for( int i = 0; i < count; i++ ) { 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++ ) { 575 780 ctx[i]->recursion = recursions[i]; 576 } 781 ctx[i]->mask = masks[i]; 782 } 783 unlock_all( locks, count ); 577 784 } 578 785 … … 599 806 } 600 807 601 // LIB_DEBUG_PRINT_SAFE( "Runing %i\n", ready2run);808 LIB_DEBUG_PRINT_SAFE( "Kernel : Runing %i (%p)\n", ready2run, ready2run ? node->waiting_thread : NULL ); 602 809 return ready2run ? node->waiting_thread : NULL; 603 810 } 604 811 605 static inline void brand_condition( condition *this ) {812 static inline void brand_condition( condition & this ) { 606 813 thread_desc * thrd = this_thread; 607 if( !this ->monitors ) {814 if( !this.monitors ) { 608 815 // LIB_DEBUG_PRINT_SAFE("Branding\n"); 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 619 static 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 631 static 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 639 static 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; 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; 642 829 643 830 // For each thread in the entry-queue 644 for( thread_desc ** thrd_it = &entry_queue ->head;831 for( thread_desc ** thrd_it = &entry_queue.head; 645 832 *thrd_it; 646 thrd_it = &(*thrd_it)->next )647 {833 thrd_it = &(*thrd_it)->next 834 ) { 648 835 // For each acceptable check if it matches 649 __acceptable_t * acc_end = acceptables + acc_count; 650 for( __acceptable_t * acc_it = acceptables; acc_it != acc_end; acc_it++ ) { 836 int i = 0; 837 __acceptable_t * end = mask.clauses + mask.size; 838 for( __acceptable_t * it = mask.clauses; it != end; it++, i++ ) { 651 839 // Check if we have a match 652 if( match( acc_it, *thrd_it )) {840 if( *it == (*thrd_it)->monitors ) { 653 841 654 842 // If we have a match return it 655 843 // after removeing it from the entry queue 656 return remove( entry_queue, thrd_it );844 return [remove( entry_queue, thrd_it ), i]; 657 845 } 658 846 } 659 847 } 660 848 661 return NULL; 662 } 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 663 886 void ?{}( __condition_blocked_queue_t & this ) { 664 887 this.head = NULL; … … 666 889 } 667 890 668 void 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;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; 676 899 if( head ) { 677 this ->head = head->next;900 this.head = head->next; 678 901 if( !head->next ) { 679 this ->tail = &this->head;902 this.tail = &this.head; 680 903 } 681 904 head->next = NULL; -
src/libcfa/concurrency/preemption.c
r78315272 r3f7e12cb 328 328 siginfo_t info; 329 329 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 } 330 344 331 345 // If another signal arrived something went wrong … … 366 380 367 381 if ( sigaction( sig, &act, NULL ) == -1 ) { 368 LIB_DEBUG_PRINT_BUFFER_DECL( STDERR_FILENO,382 LIB_DEBUG_PRINT_BUFFER_DECL( 369 383 " __kernel_sigaction( sig:%d, handler:%p, flags:%d ), problem installing signal handler, error(%d) %s.\n", 370 384 sig, handler, flags, errno, strerror( errno ) … … 383 397 384 398 if ( sigaction( sig, &act, NULL ) == -1 ) { 385 LIB_DEBUG_PRINT_BUFFER_DECL( STDERR_FILENO,399 LIB_DEBUG_PRINT_BUFFER_DECL( 386 400 " __kernel_sigdefault( sig:%d ), problem reseting signal handler, error(%d) %s.\n", 387 401 sig, errno, strerror( errno ) -
src/libcfa/concurrency/thread
r78315272 r3f7e12cb 36 36 forall( dtype T | is_thread(T) ) 37 37 static inline coroutine_desc* get_coroutine(T & this) { 38 return &get_thread(this)-> cor;38 return &get_thread(this)->self_cor; 39 39 } 40 40 41 41 forall( dtype T | is_thread(T) ) 42 42 static inline monitor_desc* get_monitor(T & this) { 43 return &get_thread(this)-> mon;43 return &get_thread(this)->self_mon; 44 44 } 45 45 46 46 static inline coroutine_desc* get_coroutine(thread_desc * this) { 47 return &this-> cor;47 return &this->self_cor; 48 48 } 49 49 50 50 static inline monitor_desc* get_monitor(thread_desc * this) { 51 return &this-> mon;51 return &this->self_mon; 52 52 } 53 53 -
src/libcfa/concurrency/thread.c
r78315272 r3f7e12cb 33 33 34 34 void ?{}(thread_desc& this) { 35 (this.cor){}; 36 this.cor.name = "Anonymous Coroutine"; 37 this.mon.owner = &this; 38 this.mon.recursion = 1; 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; 39 40 this.next = NULL; 40 41 41 this.current_monitors = &this.mon; 42 this.current_monitor_count = 1; 42 (this.monitors){ &this.self_mon_p, 1, (fptr_t)0 }; 43 43 } 44 44 45 45 void ^?{}(thread_desc& this) { 46 ^(this. cor){};46 ^(this.self_cor){}; 47 47 } 48 48 -
src/libcfa/interpose.c
r78315272 r3f7e12cb 127 127 va_end( args ); 128 128 129 __lib_debug_write( STDERR_FILENO,abort_text, len );130 __lib_debug_write( STDERR_FILENO,"\n", 1 );129 __lib_debug_write( abort_text, len ); 130 __lib_debug_write( "\n", 1 ); 131 131 } 132 132 133 133 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( STDERR_FILENO,abort_text, len );134 __lib_debug_write( abort_text, len ); 135 135 136 136 -
src/libcfa/iostream
r78315272 r3f7e12cb 10 10 // Created On : Wed May 27 17:56:53 2015 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Wed Sep 13 12:53:46201713 // Update Count : 1 3812 // Last Modified On : Tue Oct 10 14:51:10 2017 13 // Update Count : 140 14 14 // 15 15 … … 79 79 forall( dtype ostype | ostream( ostype ) ) ostype * ?|?( ostype *, const char * ); 80 80 forall( 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 81 82 forall( dtype ostype | ostream( ostype ) ) ostype * ?|?( ostype *, const char32_t * ); 83 #endif // ! ( __ARM_ARCH_ISA_ARM == 1 && __ARM_32BIT_STATE == 1 ) 82 84 forall( dtype ostype | ostream( ostype ) ) ostype * ?|?( ostype *, const wchar_t * ); 83 85 forall( dtype ostype | ostream( ostype ) ) ostype * ?|?( ostype *, const void * ); -
src/libcfa/iostream.c
r78315272 r3f7e12cb 10 10 // Created On : Wed May 27 17:56:53 2015 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Sun Sep 17 23:24:25201713 // Update Count : 42 212 // Last Modified On : Tue Oct 10 14:51:09 2017 13 // Update Count : 424 14 14 // 15 15 … … 191 191 } // ?|? 192 192 193 #if ! ( __ARM_ARCH_ISA_ARM == 1 && __ARM_32BIT_STATE == 1 ) // char32_t == wchar_t => ambiguous 193 194 forall( dtype ostype | ostream( ostype ) ) 194 195 ostype * ?|?( ostype * os, const char32_t * str ) { … … 197 198 return os; 198 199 } // ?|? 200 #endif // ! ( __ARM_ARCH_ISA_ARM == 1 && __ARM_32BIT_STATE == 1 ) 199 201 200 202 forall( dtype ostype | ostream( ostype ) ) -
src/libcfa/libhdr/libdebug.c
r78315272 r3f7e12cb 9 9 // Author : Thierry Delisle 10 10 // 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 : 13 13 // Update Count : 0 14 14 // … … 28 28 extern "C" { 29 29 30 void __lib_debug_write( int fd,const char *in_buffer, int len ) {30 void __lib_debug_write( const char *in_buffer, int len ) { 31 31 // 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 ) { 33 33 in_buffer += count; 34 34 35 35 for ( ;; ) { 36 retcode = write( fd, in_buffer, len - count );36 retcode = write( STDERR_FILENO, in_buffer, len - count ); 37 37 38 38 // not a timer interrupt ? 39 if ( retcode != -1 || errno != EINTR ) break; 39 if ( retcode != -1 || errno != EINTR ) break; 40 40 } 41 41 … … 52 52 va_start( args, fmt ); 53 53 __lib_debug_acquire(); 54 54 55 55 int len = vsnprintf( buffer, buffer_size, fmt, args ); 56 __lib_debug_write( STDERR_FILENO,buffer, len );56 __lib_debug_write( buffer, len ); 57 57 58 58 __lib_debug_release(); … … 64 64 65 65 va_start( args, fmt ); 66 66 67 67 int len = vsnprintf( buffer, buffer_size, fmt, args ); 68 __lib_debug_write( STDERR_FILENO,buffer, len );68 __lib_debug_write( buffer, len ); 69 69 70 70 va_end( args ); … … 73 73 void __lib_debug_print_vararg( const char fmt[], va_list args ) { 74 74 int len = vsnprintf( buffer, buffer_size, fmt, args ); 75 __lib_debug_write( STDERR_FILENO,buffer, len );75 __lib_debug_write( buffer, len ); 76 76 } 77 77 … … 80 80 81 81 va_start( args, fmt ); 82 82 83 83 int len = vsnprintf( in_buffer, in_buffer_size, fmt, args ); 84 __lib_debug_write( STDERR_FILENO,in_buffer, len );84 __lib_debug_write( in_buffer, len ); 85 85 86 86 va_end( args ); -
src/libcfa/libhdr/libdebug.h
r78315272 r3f7e12cb 44 44 extern "C" { 45 45 #endif 46 #include <stdarg.h> 46 #include <stdarg.h> 47 #include <stdio.h> 47 48 48 extern void __lib_debug_write( int fd,const char *buffer, int len );49 extern void __lib_debug_write( const char *buffer, int len ); 49 50 extern void __lib_debug_acquire(); 50 51 extern void __lib_debug_release(); … … 58 59 59 60 #ifdef __CFA_DEBUG_PRINT__ 60 #define LIB_DEBUG_WRITE( fd, buffer, len ) __lib_debug_write( fd,buffer, len )61 #define LIB_DEBUG_WRITE( buffer, len ) __lib_debug_write( buffer, len ) 61 62 #define LIB_DEBUG_ACQUIRE() __lib_debug_acquire() 62 63 #define LIB_DEBUG_RELEASE() __lib_debug_release() … … 64 65 #define LIB_DEBUG_PRINT_NOLOCK(...) __lib_debug_print_nolock (__VA_ARGS__) 65 66 #define LIB_DEBUG_PRINT_BUFFER(...) __lib_debug_print_buffer (__VA_ARGS__) 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 );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 ); 68 69 #else 69 70 #define LIB_DEBUG_WRITE(...) ((void)0) -
src/libcfa/stdlib
r78315272 r3f7e12cb 10 10 // Created On : Thu Jan 28 17:12:35 2016 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Wed Aug 23 20:29:47201713 // Update Count : 2 2412 // Last Modified On : Tue Oct 31 13:47:24 2017 13 // Update Count : 245 14 14 // 15 15 … … 27 27 // allocation, non-array types 28 28 static inline forall( dtype T | sized(T) ) T * malloc( void ) { 29 // printf( "X1\n" );29 // printf( "* malloc\n" ); 30 30 return (T *)(void *)malloc( (size_t)sizeof(T) ); // C malloc 31 31 } // 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 32 39 33 40 extern "C" { void * calloc( size_t dim, size_t size ); } // default C routine … … 206 213 //--------------------------------------- 207 214 208 void rand48seed( long int s ); 209 char rand48( void ); 210 int rand48( void ); 211 unsigned int rand48( void ); 212 long int rand48( void ); 213 unsigned long int rand48( void ); 214 float rand48( void ); 215 double rand48( void ); 216 float _Complex rand48( void ); 217 double _Complex rand48( void ); 218 long double _Complex rand48( void ); 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 ); 219 231 220 232 //--------------------------------------- -
src/libcfa/stdlib.c
r78315272 r3f7e12cb 10 10 // Created On : Thu Jan 28 17:10:29 2016 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Wed Aug 23 20:30:44201713 // Update Count : 29 212 // Last Modified On : Mon Oct 30 22:43:02 2017 13 // Update Count : 297 14 14 // 15 15 … … 275 275 //--------------------------------------- 276 276 277 void rand48seed( long int s ) { srand48( s ); } 278 char rand48( void ) { return mrand48(); } 279 int rand48( void ) { return mrand48(); } 280 unsigned int rand48( void ) { return lrand48(); } 281 long int rand48( void ) { return mrand48(); } 282 unsigned long int rand48( void ) { return lrand48(); } 283 float rand48( void ) { return (float)drand48(); } // otherwise float uses lrand48 284 double rand48( void ) { return drand48(); } 285 float _Complex rand48( void ) { return (float)drand48() + (float _Complex)(drand48() * _Complex_I); } 286 double _Complex rand48( void ) { return drand48() + (double _Complex)(drand48() * _Complex_I); } 287 long double _Complex rand48( void) { return (long double)drand48() + (long double _Complex)(drand48() * _Complex_I); } 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); } 288 293 289 294 //--------------------------------------- -
src/main.cc
r78315272 r3f7e12cb 10 10 // Author : Richard C. Bilson 11 11 // Created On : Fri May 15 23:12:02 2015 12 // Last Modified By : Andrew Beach13 // Last Modified On : Wed Jul 26 14:38:00 201714 // Update Count : 44 312 // Last Modified By : Peter A. Buhr 13 // Last Modified On : Tue Oct 31 12:22:40 2017 14 // Update Count : 445 15 15 // 16 16 … … 44 44 #include "ControlStruct/Mutate.h" // for mutate 45 45 #include "GenPoly/Box.h" // for box 46 #include "GenPoly/CopyParams.h" // for copyParams47 46 #include "GenPoly/InstantiateGeneric.h" // for instantiateGeneric 48 47 #include "GenPoly/Lvalue.h" // for convertLvalue … … 94 93 codegenp = false, 95 94 prettycodegenp = false, 96 nolinemarks = false;95 linemarks = false; 97 96 98 97 static void parse_cmdline( int argc, char *argv[], const char *& filename ); … … 239 238 } // if 240 239 241 // OPTPRINT( "Concurrency" )242 // Concurrency::applyKeywords( translationUnit );243 244 240 // add the assignment statement after the initialization of a type parameter 245 241 OPTPRINT( "validate" ) … … 324 320 OPTPRINT("instantiateGenerics") 325 321 GenPoly::instantiateGeneric( translationUnit ); 326 OPTPRINT( "copyParams" );327 GenPoly::copyParams( translationUnit );328 322 OPTPRINT( "convertLvalue" ) 329 323 GenPoly::convertLvalue( translationUnit ); … … 346 340 347 341 CodeTools::fillLocations( translationUnit ); 348 CodeGen::generate( translationUnit, *output, ! noprotop, prettycodegenp, true, ! nolinemarks );342 CodeGen::generate( translationUnit, *output, ! noprotop, prettycodegenp, true, linemarks ); 349 343 350 344 CodeGen::FixMain::fix( *output, treep ? "../prelude/bootloader.c" : CFA_LIBDIR "/bootloader.c" ); … … 384 378 385 379 void parse_cmdline( int argc, char * argv[], const char *& filename ) { 386 enum { Ast, Bbox, Bresolver, CtorInitFix, DeclStats, Expr, ExprAlt, Grammar, LibCFA, Nopreamble, Parse, Prototypes, Resolver, Symbol, Tree, TupleExpansion, Validate, };380 enum { Ast, Bbox, Bresolver, CtorInitFix, DeclStats, Expr, ExprAlt, Grammar, LibCFA, Linemarks, Nolinemarks, Nopreamble, Parse, Prototypes, Resolver, Symbol, Tree, TupleExpansion, Validate, }; 387 381 388 382 static struct option long_opts[] = { … … 396 390 { "grammar", no_argument, 0, Grammar }, 397 391 { "libcfa", no_argument, 0, LibCFA }, 392 { "line-marks", no_argument, 0, Linemarks }, 393 { "no-line-marks", no_argument, 0, Nolinemarks }, 398 394 { "no-preamble", no_argument, 0, Nopreamble }, 399 395 { "parse", no_argument, 0, Parse }, … … 411 407 412 408 int c; 413 while ( (c = getopt_long( argc, argv, "abBcCdefglLmn pqrstTvyzZD:F:", long_opts, &long_index )) != -1 ) {409 while ( (c = getopt_long( argc, argv, "abBcCdefglLmnNpqrstTvyzZD:F:", long_opts, &long_index )) != -1 ) { 414 410 switch ( c ) { 415 411 case Ast: … … 451 447 libcfap = true; 452 448 break; 453 case 'L': // surpress lines marks 454 nolinemarks = true; 449 case Linemarks: 450 case 'L': // print lines marks 451 linemarks = true; 455 452 break; 456 453 case Nopreamble: 457 454 case 'n': // do not read preamble 458 455 nopreludep = true; 456 break; 457 case Nolinemarks: 458 case 'N': // suppress line marks 459 linemarks = false; 459 460 break; 460 461 case Prototypes: … … 508 509 assertf( false, "Unknown option: %s\n", argv[optind - 1] ); 509 510 } // if 511 #if __GNUC__ < 7 512 #else 513 __attribute__((fallthrough)); 514 #endif 510 515 default: 511 516 abort(); -
src/prelude/Makefile.am
r78315272 r3f7e12cb 57 57 58 58 bootloader.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 Lbootloader.cf $@ # use src/cfa-cpp as not in lib until after install59 ${AM_V_GEN}${abs_top_srcdir}/src/driver/cfa-cpp -tpm bootloader.cf $@ # use src/cfa-cpp as not in lib until after install 60 60 61 61 maintainer-clean-local : -
src/prelude/Makefile.in
r78315272 r3f7e12cb 526 526 527 527 bootloader.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 Lbootloader.cf $@ # use src/cfa-cpp as not in lib until after install528 ${AM_V_GEN}${abs_top_srcdir}/src/driver/cfa-cpp -tpm bootloader.cf $@ # use src/cfa-cpp as not in lib until after install 529 529 530 530 maintainer-clean-local : -
src/prelude/extras.c
r78315272 r3f7e12cb 1 1 #include <stddef.h> // size_t, ptrdiff_t 2 #include <stdint.h> // intX_t, uintX_t, where X is 8, 16, 32, 64 2 3 #include <uchar.h> // char16_t, char32_t 3 4 #include <wchar.h> // wchar_t -
src/prelude/extras.regx
r78315272 r3f7e12cb 1 1 typedef.* size_t; 2 2 typedef.* 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; 3 11 typedef.* char16_t; 4 12 typedef.* char32_t; -
src/prelude/prelude.cf
r78315272 r3f7e12cb 7 7 // Created On : Sat Nov 29 07:23:41 2014 8 8 // Last Modified By : Peter A. Buhr 9 // Last Modified On : Wed Aug 30 07:56:07201710 // Update Count : 939 // Last Modified On : Sat Oct 28 16:33:09 2017 10 // Update Count : 102 11 11 // 12 12 … … 41 41 _Bool ?++( _Bool & ), ?++( volatile _Bool & ); 42 42 _Bool ?--( _Bool & ), ?--( volatile _Bool & ); 43 unsigned char ?++( unsigned char & ), ?++( volatile unsigned char & ); 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 & ); 44 47 signed int ?++( signed int & ), ?++( volatile signed int & ); 45 48 signed int ?--( signed int & ), ?--( volatile signed int & ); … … 92 95 93 96 _Bool ++?( _Bool & ), --?( _Bool & ); 97 signed short ++?( signed short & ), --?( signed short & ); 94 98 signed int ++?( signed int & ), --?( signed int & ); 95 unsigned int ++?( unsigned int & ), --?( unsigned int & ); 99 unsigned short ++?( unsigned int & ), --?( unsigned int & ); 100 unsigned int ++?( unsigned short & ), --?( unsigned short & ); 96 101 signed long int ++?( signed long int & ), --?( signed long int & ); 97 102 unsigned long int ++?( unsigned long int & ), --?( unsigned long int & ); … … 190 195 long double _Complex ?+?( long double _Complex, long double _Complex ), ?-?( long double _Complex, long double _Complex ); 191 196 192 forall( dtype T | sized(T) ) T * 193 forall( dtype T | sized(T) ) T * 197 forall( dtype T | sized(T) ) T * ?+?( T *, ptrdiff_t ); 198 forall( dtype T | sized(T) ) T * ?+?( ptrdiff_t, T * ); 194 199 forall( dtype T | sized(T) ) const T * ?+?( const T *, ptrdiff_t ); 195 200 forall( dtype T | sized(T) ) const T * ?+?( ptrdiff_t, const T * ); 196 forall( dtype T | sized(T) ) volatile T * 197 forall( dtype T | sized(T) ) volatile 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 * ); 198 203 forall( dtype T | sized(T) ) const volatile T * ?+?( const volatile T *, ptrdiff_t ); 199 204 forall( dtype T | sized(T) ) const volatile T * ?+?( ptrdiff_t, const volatile T * ); 200 forall( dtype T | sized(T) ) T * 205 forall( dtype T | sized(T) ) T * ?-?( T *, ptrdiff_t ); 201 206 forall( dtype T | sized(T) ) const T * ?-?( const T *, ptrdiff_t ); 202 forall( dtype T | sized(T) ) volatile T * 207 forall( dtype T | sized(T) ) volatile T * ?-?( volatile T *, ptrdiff_t ); 203 208 forall( dtype T | sized(T) ) const volatile T * ?-?( const volatile T *, ptrdiff_t ); 204 209 forall( dtype T | sized(T) ) ptrdiff_t ?-?( const volatile T *, const volatile T * ); … … 226 231 signed int ?<?( _Bool, _Bool ), ?<=?( _Bool, _Bool ), 227 232 ?>?( _Bool, _Bool ), ?>=?( _Bool, _Bool ); 228 signed int ?<?( char, char ), ?<=?( char, char ),229 ?>?( char, char ), ?>=?( char, char );233 signed int ?<?( char, char ), ?<=?( char, char ), 234 ?>?( char, char ), ?>=?( char, char ); 230 235 signed int ?<?( signed char, signed char ), ?<=?( signed char, signed char ), 231 236 ?>?( signed char, signed char ), ?>=?( signed char, signed char ); … … 235 240 ?>?( signed short, signed short ), ?>=?( signed short, signed short ); 236 241 signed int ?<?( unsigned short, unsigned short ), ?<=?( unsigned short, unsigned short ), 237 ?>?( unsigned short, unsigned short ), 242 ?>?( unsigned short, unsigned short ), ?>=?( unsigned short, unsigned short ); 238 243 signed int ?<?( signed int, signed int ), ?<=?( signed int, signed int ), 239 244 ?>?( signed int, signed int ), ?>=?( signed int, signed int ); … … 468 473 forall( ftype FT ) FT * ?=?( FT * volatile &, zero_t ); 469 474 470 forall( dtype T | sized(T) ) T * 471 forall( dtype T | sized(T) ) T * 475 forall( dtype T | sized(T) ) T * ?+=?( T * &, ptrdiff_t ); 476 forall( dtype T | sized(T) ) T * ?+=?( T * volatile &, ptrdiff_t ); 472 477 forall( dtype T | sized(T) ) const T * ?+=?( const T * &, ptrdiff_t ); 473 478 forall( dtype T | sized(T) ) const T * ?+=?( const T * volatile &, ptrdiff_t ); 474 forall( dtype T | sized(T) ) volatile T * 475 forall( dtype T | sized(T) ) volatile 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 ); 476 481 forall( dtype T | sized(T) ) const volatile T * ?+=?( const volatile T * &, ptrdiff_t ); 477 482 forall( dtype T | sized(T) ) const volatile T * ?+=?( const volatile T * volatile &, ptrdiff_t ); 478 forall( dtype T | sized(T) ) T * 479 forall( dtype T | sized(T) ) T * 483 forall( dtype T | sized(T) ) T * ?-=?( T * &, ptrdiff_t ); 484 forall( dtype T | sized(T) ) T * ?-=?( T * volatile &, ptrdiff_t ); 480 485 forall( dtype T | sized(T) ) const T * ?-=?( const T * &, ptrdiff_t ); 481 486 forall( dtype T | sized(T) ) const T * ?-=?( const T * volatile &, ptrdiff_t ); 482 forall( dtype T | sized(T) ) volatile T * 483 forall( dtype T | sized(T) ) volatile 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 ); 484 489 forall( dtype T | sized(T) ) const volatile T * ?-=?( const volatile T * &, ptrdiff_t ); 485 490 forall( dtype T | sized(T) ) const volatile T * ?-=?( const volatile T * volatile &, ptrdiff_t ); … … 497 502 signed long long int ?=?( signed long long int &, signed long long int ), ?=?( volatile signed long long int &, signed long long int ); 498 503 unsigned long long int ?=?( unsigned long long int &, unsigned long long int ), ?=?( volatile unsigned long long int &, unsigned long long int ); 499 zero_t ?=?( zero_t &, zero_t );504 zero_t ?=?( zero_t &, zero_t ); 500 505 one_t ?=?( one_t &, one_t ); 501 506 … … 552 557 signed long long int ?+=?( signed long long int &, signed long long int ), ?+=?( volatile signed long long int &, signed long long int ); 553 558 unsigned 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 ); 554 561 555 562 _Bool ?-=?( _Bool &, _Bool ), ?-=?( volatile _Bool &, _Bool ); … … 666 673 ?+=?( long double _Complex &, long double _Complex ), ?+=?( volatile long double _Complex &, long double _Complex ), 667 674 ?-=?( long double _Complex &, long double _Complex ), ?-=?( volatile long double _Complex &, long double _Complex ); 668 669 670 671 675 672 676 … … 838 842 forall( dtype DT ) void ^?{}( const volatile DT * &); 839 843 840 void 841 void 842 void 843 void ^?{}( constvolatile void * &);844 void ^?{}( void * &); 845 void ^?{}( const void * &); 846 void ^?{}( volatile void * &); 847 void ^?{}( const volatile void * &); 844 848 845 849 // Local Variables: // -
src/tests/.expect/32/KRfunctions.txt
r78315272 r3f7e12cb 21 21 static inline void ___destructor__F_R2sS_autogen___1(struct S *___dst__R2sS_1); 22 22 static 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); 23 24 static inline void ___constructor__F_R2sS_autogen___1(struct S *___dst__R2sS_1){ 24 25 ((void)((*___dst__R2sS_1).__i__i_1) /* ?{} */); … … 33 34 struct S ___ret__2sS_1; 34 35 ((void)((*___dst__R2sS_1).__i__i_1=___src__2sS_1.__i__i_1)); 35 ((void)___constructor__F_R2sS2sS_autogen___1((&___ret__2sS_1), ___src__2sS_1));36 return ((struct S )___ret__2sS_1);36 ((void)___constructor__F_R2sS2sS_autogen___1((&___ret__2sS_1), (*___dst__R2sS_1))); 37 return ___ret__2sS_1; 37 38 } 38 39 static inline void ___constructor__F_R2sSi_autogen___1(struct S *___dst__R2sS_1, signed int __i__i_1){ … … 65 66 signed int *__x__FPi_ii__2(signed int __anonymous_object2, signed int __anonymous_object3); 66 67 ((void)(___retval_f10__PFPi_ii__1=__x__FPi_ii__2) /* ?{} */); 67 return ((signed int *(*)(signed int __x__i_1, signed int __y__i_1))___retval_f10__PFPi_ii__1);68 return ___retval_f10__PFPi_ii__1; 68 69 } 69 70 signed 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
r78315272 r3f7e12cb 23 23 static inline struct __anonymous0 ___operator_assign__F13s__anonymous0_R13s__anonymous013s__anonymous0_autogen___1(struct __anonymous0 *___dst__R13s__anonymous0_1, struct __anonymous0 ___src__13s__anonymous0_1){ 24 24 struct __anonymous0 ___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);25 ((void)___constructor__F_R13s__anonymous013s__anonymous0_autogen___1((&___ret__13s__anonymous0_1), (*___dst__R13s__anonymous0_1))); 26 return ___ret__13s__anonymous0_1; 27 27 } 28 28 __attribute__ ((unused)) struct Agn1; … … 41 41 static inline struct Agn2 ___operator_assign__F5sAgn2_R5sAgn25sAgn2_autogen___1(struct Agn2 *___dst__R5sAgn2_1, struct Agn2 ___src__5sAgn2_1){ 42 42 struct Agn2 ___ret__5sAgn2_1; 43 ((void)___constructor__F_R5sAgn25sAgn2_autogen___1((&___ret__5sAgn2_1), ___src__5sAgn2_1));44 return ((struct Agn2 )___ret__5sAgn2_1);43 ((void)___constructor__F_R5sAgn25sAgn2_autogen___1((&___ret__5sAgn2_1), (*___dst__R5sAgn2_1))); 44 return ___ret__5sAgn2_1; 45 45 } 46 46 enum __attribute__ ((unused)) __anonymous1 { … … 69 69 static inline void ___destructor__F_R4sFdl_autogen___1(struct Fdl *___dst__R4sFdl_1); 70 70 static 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); 71 81 static inline void ___constructor__F_R4sFdl_autogen___1(struct Fdl *___dst__R4sFdl_1){ 72 82 ((void)((*___dst__R4sFdl_1).__f1__i_1) /* ?{} */); … … 78 88 ((void)((*___dst__R4sFdl_1).__f7__i_1) /* ?{} */); 79 89 ((void)((*___dst__R4sFdl_1).__f8__i_1) /* ?{} */); 90 ((void)((*___dst__R4sFdl_1).__anonymous_object0) /* ?{} */); 80 91 ((void)((*___dst__R4sFdl_1).__f9__Pi_1) /* ?{} */); 81 92 } … … 89 100 ((void)((*___dst__R4sFdl_1).__f7__i_1=___src__4sFdl_1.__f7__i_1) /* ?{} */); 90 101 ((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) /* ?{} */); 91 103 ((void)((*___dst__R4sFdl_1).__f9__Pi_1=___src__4sFdl_1.__f9__Pi_1) /* ?{} */); 92 104 } 93 105 static inline void ___destructor__F_R4sFdl_autogen___1(struct Fdl *___dst__R4sFdl_1){ 94 106 ((void)((*___dst__R4sFdl_1).__f9__Pi_1) /* ^?{} */); 107 ((void)((*___dst__R4sFdl_1).__anonymous_object0) /* ^?{} */); 95 108 ((void)((*___dst__R4sFdl_1).__f8__i_1) /* ^?{} */); 96 109 ((void)((*___dst__R4sFdl_1).__f7__i_1) /* ^?{} */); … … 112 125 ((void)((*___dst__R4sFdl_1).__f7__i_1=___src__4sFdl_1.__f7__i_1)); 113 126 ((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)); 114 128 ((void)((*___dst__R4sFdl_1).__f9__Pi_1=___src__4sFdl_1.__f9__Pi_1)); 115 ((void)___constructor__F_R4sFdl4sFdl_autogen___1((&___ret__4sFdl_1), ___src__4sFdl_1));116 return ((struct Fdl )___ret__4sFdl_1);129 ((void)___constructor__F_R4sFdl4sFdl_autogen___1((&___ret__4sFdl_1), (*___dst__R4sFdl_1))); 130 return ___ret__4sFdl_1; 117 131 } 118 132 static inline void ___constructor__F_R4sFdli_autogen___1(struct Fdl *___dst__R4sFdl_1, signed int __f1__i_1){ … … 125 139 ((void)((*___dst__R4sFdl_1).__f7__i_1) /* ?{} */); 126 140 ((void)((*___dst__R4sFdl_1).__f8__i_1) /* ?{} */); 141 ((void)((*___dst__R4sFdl_1).__anonymous_object0) /* ?{} */); 127 142 ((void)((*___dst__R4sFdl_1).__f9__Pi_1) /* ?{} */); 128 143 } … … 136 151 ((void)((*___dst__R4sFdl_1).__f7__i_1) /* ?{} */); 137 152 ((void)((*___dst__R4sFdl_1).__f8__i_1) /* ?{} */); 153 ((void)((*___dst__R4sFdl_1).__anonymous_object0) /* ?{} */); 138 154 ((void)((*___dst__R4sFdl_1).__f9__Pi_1) /* ?{} */); 139 155 } … … 147 163 ((void)((*___dst__R4sFdl_1).__f7__i_1) /* ?{} */); 148 164 ((void)((*___dst__R4sFdl_1).__f8__i_1) /* ?{} */); 165 ((void)((*___dst__R4sFdl_1).__anonymous_object0) /* ?{} */); 149 166 ((void)((*___dst__R4sFdl_1).__f9__Pi_1) /* ?{} */); 150 167 } … … 158 175 ((void)((*___dst__R4sFdl_1).__f7__i_1) /* ?{} */); 159 176 ((void)((*___dst__R4sFdl_1).__f8__i_1) /* ?{} */); 177 ((void)((*___dst__R4sFdl_1).__anonymous_object0) /* ?{} */); 160 178 ((void)((*___dst__R4sFdl_1).__f9__Pi_1) /* ?{} */); 161 179 } … … 169 187 ((void)((*___dst__R4sFdl_1).__f7__i_1) /* ?{} */); 170 188 ((void)((*___dst__R4sFdl_1).__f8__i_1) /* ?{} */); 189 ((void)((*___dst__R4sFdl_1).__anonymous_object0) /* ?{} */); 171 190 ((void)((*___dst__R4sFdl_1).__f9__Pi_1) /* ?{} */); 172 191 } … … 180 199 ((void)((*___dst__R4sFdl_1).__f7__i_1) /* ?{} */); 181 200 ((void)((*___dst__R4sFdl_1).__f8__i_1) /* ?{} */); 201 ((void)((*___dst__R4sFdl_1).__anonymous_object0) /* ?{} */); 182 202 ((void)((*___dst__R4sFdl_1).__f9__Pi_1) /* ?{} */); 183 203 } … … 191 211 ((void)((*___dst__R4sFdl_1).__f7__i_1=__f7__i_1) /* ?{} */); 192 212 ((void)((*___dst__R4sFdl_1).__f8__i_1) /* ?{} */); 213 ((void)((*___dst__R4sFdl_1).__anonymous_object0) /* ?{} */); 193 214 ((void)((*___dst__R4sFdl_1).__f9__Pi_1) /* ?{} */); 194 215 } … … 202 223 ((void)((*___dst__R4sFdl_1).__f7__i_1=__f7__i_1) /* ?{} */); 203 224 ((void)((*___dst__R4sFdl_1).__f8__i_1=__f8__i_1) /* ?{} */); 204 ((void)((*___dst__R4sFdl_1).__f9__Pi_1) /* ?{} */); 205 } 206 static 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){ 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){ 207 229 ((void)((*___dst__R4sFdl_1).__f1__i_1=__f1__i_1) /* ?{} */); 208 230 ((void)((*___dst__R4sFdl_1).__f2__i_1=__f2__i_1) /* ?{} */); … … 213 235 ((void)((*___dst__R4sFdl_1).__f7__i_1=__f7__i_1) /* ?{} */); 214 236 ((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) /* ?{} */); 215 250 ((void)((*___dst__R4sFdl_1).__f9__Pi_1=__f9__Pi_1) /* ?{} */); 216 251 } … … 232 267 __attribute__ ((unused)) signed int **const ___retval_f2__CPPi_1; 233 268 } 234 __attribute__ ((unused,used,unused)) signed int (*__f3__FPA0i_i__1(signed int __anonymous_object 1))[];269 __attribute__ ((unused,used,unused)) signed int (*__f3__FPA0i_i__1(signed int __anonymous_object5))[]; 235 270 __attribute__ ((unused,unused)) signed int (*__f3__FPA0i_i__1(signed int __p__i_1))[]{ 236 271 __attribute__ ((unused)) signed int (*___retval_f3__PA0i_1)[]; 237 272 } 238 __attribute__ ((unused,used,unused)) signed int (*__f4__FPFi_i____1())(signed int __anonymous_object 2);239 __attribute__ ((unused,unused)) signed int (*__f4__FPFi_i____1())(signed int __anonymous_object 3){240 __attribute__ ((unused)) signed int (*___retval_f4__PFi_i__1)(signed int __anonymous_object 4);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); 241 276 } 242 277 signed int __vtr__Fi___1(){ … … 268 303 signed int __tpr2__Fi_PPi__1(__attribute__ ((unused,unused,unused,unused,unused,unused)) signed int **__Foo__PPi_1); 269 304 signed int __tpr3__Fi_Pi__1(__attribute__ ((unused,unused,unused)) signed int *__Foo__Pi_1); 270 signed int __tpr4__Fi_PFi_Pi___1(__attribute__ ((unused,unused)) signed int (*__anonymous_object 5)(__attribute__ ((unused,unused)) signed int __anonymous_object6[((unsigned int )5)]));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)])); 271 306 signed int __tpr5__Fi_PFi____1(__attribute__ ((unused,unused,unused)) signed int (*__Foo__PFi___1)()); 272 307 signed int __tpr6__Fi_PFi____1(__attribute__ ((unused,unused,unused)) signed int (*__Foo__PFi___1)()); 273 signed int __tpr7__Fi_PFi_PFi_i____1(__attribute__ ((unused,unused)) signed int (*__anonymous_object 7)(__attribute__ ((unused)) signed int (*__anonymous_object8)(__attribute__ ((unused,unused)) signed int __anonymous_object9)));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))); 274 309 signed int __ad__Fi___1(){ 275 310 __attribute__ ((unused)) signed int ___retval_ad__i_1; … … 300 335 struct __anonymous4 ___ret__13s__anonymous4_2; 301 336 ((void)((*___dst__R13s__anonymous4_2).__i__i_2=___src__13s__anonymous4_2.__i__i_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);337 ((void)___constructor__F_R13s__anonymous413s__anonymous4_autogen___2((&___ret__13s__anonymous4_2), (*___dst__R13s__anonymous4_2))); 338 return ___ret__13s__anonymous4_2; 304 339 } 305 340 inline void ___constructor__F_R13s__anonymous4i_autogen___2(struct __anonymous4 *___dst__R13s__anonymous4_2, signed int __i__i_2){ … … 313 348 } 314 349 inline void ___constructor__F_R13e__anonymous513e__anonymous5_intrinsic___2(enum __anonymous5 *___dst__R13e__anonymous5_2, enum __anonymous5 ___src__13e__anonymous5_2){ 315 ((void)((*___dst__R13e__anonymous5_2)=___src__13e__anonymous5_2) );350 ((void)((*___dst__R13e__anonymous5_2)=___src__13e__anonymous5_2) /* ?{} */); 316 351 } 317 352 inline void ___destructor__F_R13e__anonymous5_intrinsic___2(__attribute__ ((unused)) enum __anonymous5 *___dst__R13e__anonymous5_2){ … … 319 354 inline enum __anonymous5 ___operator_assign__F13e__anonymous5_R13e__anonymous513e__anonymous5_intrinsic___2(enum __anonymous5 *___dst__R13e__anonymous5_2, enum __anonymous5 ___src__13e__anonymous5_2){ 320 355 enum __anonymous5 ___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); 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; 323 359 } 324 360 ((void)sizeof(enum __anonymous5 )); 325 361 } 326 signed int __apd1__Fi_PiPi__1(__attribute__ ((unused,unused,unused)) signed int *__anonymous_object1 0, __attribute__ ((unused,unused,unused)) signed int *__anonymous_object11);327 signed int __apd2__Fi_PPiPPi__1(__attribute__ ((unused,unused,unused,unused)) signed int **__anonymous_object1 2, __attribute__ ((unused,unused,unused,unused)) signed int **__anonymous_object13);328 signed int __apd3__Fi_PiPi__1(__attribute__ ((unused,unused,unused)) signed int *__anonymous_object1 4, __attribute__ ((unused,unused,unused)) signed int *__anonymous_object15);329 signed int __apd4__Fi_PFi__PFi____1(__attribute__ ((unused,unused,unused)) signed int (*__anonymous_object 16)(), __attribute__ ((unused,unused,unused)) signed int (*__anonymous_object17)());330 signed int __apd5__Fi_PFi_i_PFi_i___1(__attribute__ ((unused,unused,unused)) signed int (*__anonymous_object 18)(__attribute__ ((unused)) signed int __anonymous_object19), __attribute__ ((unused,unused,unused)) signed int (*__anonymous_object20)(__attribute__ ((unused)) signed int __anonymous_object21));331 signed int __apd6__Fi_PFi__PFi____1(__attribute__ ((unused,unused,unused)) signed int (*__anonymous_object2 2)(), __attribute__ ((unused,unused,unused)) signed int (*__anonymous_object23)());332 signed int __apd7__Fi_PFi_i_PFi_i___1(__attribute__ ((unused,unused,unused)) signed int (*__anonymous_object2 4)(__attribute__ ((unused)) signed int __anonymous_object25), __attribute__ ((unused,unused,unused)) signed int (*__anonymous_object26)(__attribute__ ((unused)) signed int __anonymous_object27));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)); 333 369 struct Vad { 334 __attribute__ ((unused)) signed int __anonymous_object 28;335 __attribute__ ((unused,unused)) signed int *__anonymous_object 29;336 __attribute__ ((unused,unused)) signed int __anonymous_object3 0[((unsigned int )10)];337 __attribute__ ((unused,unused)) signed int (*__anonymous_object3 1)();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)(); 338 374 }; 339 375 static inline void ___constructor__F_R4sVad_autogen___1(struct Vad *___dst__R4sVad_1); … … 341 377 static inline void ___destructor__F_R4sVad_autogen___1(struct Vad *___dst__R4sVad_1); 342 378 static 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)()); 343 383 static 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) /* ?{} */); 344 395 } 345 396 static 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) /* ?{} */); 346 408 } 347 409 static 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) /* ^?{} */); 348 421 } 349 422 static inline struct Vad ___operator_assign__F4sVad_R4sVad4sVad_autogen___1(struct Vad *___dst__R4sVad_1, struct Vad ___src__4sVad_1){ 350 423 struct Vad ___ret__4sVad_1; 351 ((void)___constructor__F_R4sVad4sVad_autogen___1((&___ret__4sVad_1), ___src__4sVad_1)); 352 return ((struct Vad )___ret__4sVad_1); 353 } 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 } -
src/tests/.expect/32/declarationSpecifier.txt
r78315272 r3f7e12cb 20 20 static inline void ___destructor__F_R13s__anonymous0_autogen___1(struct __anonymous0 *___dst__R13s__anonymous0_1); 21 21 static 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); 22 23 static inline void ___constructor__F_R13s__anonymous0_autogen___1(struct __anonymous0 *___dst__R13s__anonymous0_1){ 23 24 ((void)((*___dst__R13s__anonymous0_1).__i__i_1) /* ?{} */); … … 32 33 struct __anonymous0 ___ret__13s__anonymous0_1; 33 34 ((void)((*___dst__R13s__anonymous0_1).__i__i_1=___src__13s__anonymous0_1.__i__i_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);35 ((void)___constructor__F_R13s__anonymous013s__anonymous0_autogen___1((&___ret__13s__anonymous0_1), (*___dst__R13s__anonymous0_1))); 36 return ___ret__13s__anonymous0_1; 36 37 } 37 38 static inline void ___constructor__F_R13s__anonymous0i_autogen___1(struct __anonymous0 *___dst__R13s__anonymous0_1, signed int __i__i_1){ … … 46 47 static inline void ___destructor__F_R13s__anonymous1_autogen___1(struct __anonymous1 *___dst__R13s__anonymous1_1); 47 48 static 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); 48 50 static inline void ___constructor__F_R13s__anonymous1_autogen___1(struct __anonymous1 *___dst__R13s__anonymous1_1){ 49 51 ((void)((*___dst__R13s__anonymous1_1).__i__i_1) /* ?{} */); … … 58 60 struct __anonymous1 ___ret__13s__anonymous1_1; 59 61 ((void)((*___dst__R13s__anonymous1_1).__i__i_1=___src__13s__anonymous1_1.__i__i_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);62 ((void)___constructor__F_R13s__anonymous113s__anonymous1_autogen___1((&___ret__13s__anonymous1_1), (*___dst__R13s__anonymous1_1))); 63 return ___ret__13s__anonymous1_1; 62 64 } 63 65 static inline void ___constructor__F_R13s__anonymous1i_autogen___1(struct __anonymous1 *___dst__R13s__anonymous1_1, signed int __i__i_1){ … … 72 74 static inline void ___destructor__F_R13s__anonymous2_autogen___1(struct __anonymous2 *___dst__R13s__anonymous2_1); 73 75 static 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); 74 77 static inline void ___constructor__F_R13s__anonymous2_autogen___1(struct __anonymous2 *___dst__R13s__anonymous2_1){ 75 78 ((void)((*___dst__R13s__anonymous2_1).__i__i_1) /* ?{} */); … … 84 87 struct __anonymous2 ___ret__13s__anonymous2_1; 85 88 ((void)((*___dst__R13s__anonymous2_1).__i__i_1=___src__13s__anonymous2_1.__i__i_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);89 ((void)___constructor__F_R13s__anonymous213s__anonymous2_autogen___1((&___ret__13s__anonymous2_1), (*___dst__R13s__anonymous2_1))); 90 return ___ret__13s__anonymous2_1; 88 91 } 89 92 static inline void ___constructor__F_R13s__anonymous2i_autogen___1(struct __anonymous2 *___dst__R13s__anonymous2_1, signed int __i__i_1){ … … 98 101 static inline void ___destructor__F_R13s__anonymous3_autogen___1(struct __anonymous3 *___dst__R13s__anonymous3_1); 99 102 static 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); 100 104 static inline void ___constructor__F_R13s__anonymous3_autogen___1(struct __anonymous3 *___dst__R13s__anonymous3_1){ 101 105 ((void)((*___dst__R13s__anonymous3_1).__i__i_1) /* ?{} */); … … 110 114 struct __anonymous3 ___ret__13s__anonymous3_1; 111 115 ((void)((*___dst__R13s__anonymous3_1).__i__i_1=___src__13s__anonymous3_1.__i__i_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);116 ((void)___constructor__F_R13s__anonymous313s__anonymous3_autogen___1((&___ret__13s__anonymous3_1), (*___dst__R13s__anonymous3_1))); 117 return ___ret__13s__anonymous3_1; 114 118 } 115 119 static inline void ___constructor__F_R13s__anonymous3i_autogen___1(struct __anonymous3 *___dst__R13s__anonymous3_1, signed int __i__i_1){ … … 124 128 static inline void ___destructor__F_R13s__anonymous4_autogen___1(struct __anonymous4 *___dst__R13s__anonymous4_1); 125 129 static 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); 126 131 static inline void ___constructor__F_R13s__anonymous4_autogen___1(struct __anonymous4 *___dst__R13s__anonymous4_1){ 127 132 ((void)((*___dst__R13s__anonymous4_1).__i__i_1) /* ?{} */); … … 136 141 struct __anonymous4 ___ret__13s__anonymous4_1; 137 142 ((void)((*___dst__R13s__anonymous4_1).__i__i_1=___src__13s__anonymous4_1.__i__i_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);143 ((void)___constructor__F_R13s__anonymous413s__anonymous4_autogen___1((&___ret__13s__anonymous4_1), (*___dst__R13s__anonymous4_1))); 144 return ___ret__13s__anonymous4_1; 140 145 } 141 146 static inline void ___constructor__F_R13s__anonymous4i_autogen___1(struct __anonymous4 *___dst__R13s__anonymous4_1, signed int __i__i_1){ … … 150 155 static inline void ___destructor__F_R13s__anonymous5_autogen___1(struct __anonymous5 *___dst__R13s__anonymous5_1); 151 156 static 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); 152 158 static inline void ___constructor__F_R13s__anonymous5_autogen___1(struct __anonymous5 *___dst__R13s__anonymous5_1){ 153 159 ((void)((*___dst__R13s__anonymous5_1).__i__i_1) /* ?{} */); … … 162 168 struct __anonymous5 ___ret__13s__anonymous5_1; 163 169 ((void)((*___dst__R13s__anonymous5_1).__i__i_1=___src__13s__anonymous5_1.__i__i_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);170 ((void)___constructor__F_R13s__anonymous513s__anonymous5_autogen___1((&___ret__13s__anonymous5_1), (*___dst__R13s__anonymous5_1))); 171 return ___ret__13s__anonymous5_1; 166 172 } 167 173 static inline void ___constructor__F_R13s__anonymous5i_autogen___1(struct __anonymous5 *___dst__R13s__anonymous5_1, signed int __i__i_1){ … … 176 182 static inline void ___destructor__F_R13s__anonymous6_autogen___1(struct __anonymous6 *___dst__R13s__anonymous6_1); 177 183 static 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); 178 185 static inline void ___constructor__F_R13s__anonymous6_autogen___1(struct __anonymous6 *___dst__R13s__anonymous6_1){ 179 186 ((void)((*___dst__R13s__anonymous6_1).__i__i_1) /* ?{} */); … … 188 195 struct __anonymous6 ___ret__13s__anonymous6_1; 189 196 ((void)((*___dst__R13s__anonymous6_1).__i__i_1=___src__13s__anonymous6_1.__i__i_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);197 ((void)___constructor__F_R13s__anonymous613s__anonymous6_autogen___1((&___ret__13s__anonymous6_1), (*___dst__R13s__anonymous6_1))); 198 return ___ret__13s__anonymous6_1; 192 199 } 193 200 static inline void ___constructor__F_R13s__anonymous6i_autogen___1(struct __anonymous6 *___dst__R13s__anonymous6_1, signed int __i__i_1){ … … 202 209 static inline void ___destructor__F_R13s__anonymous7_autogen___1(struct __anonymous7 *___dst__R13s__anonymous7_1); 203 210 static 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); 204 212 static inline void ___constructor__F_R13s__anonymous7_autogen___1(struct __anonymous7 *___dst__R13s__anonymous7_1){ 205 213 ((void)((*___dst__R13s__anonymous7_1).__i__i_1) /* ?{} */); … … 214 222 struct __anonymous7 ___ret__13s__anonymous7_1; 215 223 ((void)((*___dst__R13s__anonymous7_1).__i__i_1=___src__13s__anonymous7_1.__i__i_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);224 ((void)___constructor__F_R13s__anonymous713s__anonymous7_autogen___1((&___ret__13s__anonymous7_1), (*___dst__R13s__anonymous7_1))); 225 return ___ret__13s__anonymous7_1; 218 226 } 219 227 static inline void ___constructor__F_R13s__anonymous7i_autogen___1(struct __anonymous7 *___dst__R13s__anonymous7_1, signed int __i__i_1){ … … 236 244 static inline void ___destructor__F_R13s__anonymous8_autogen___1(struct __anonymous8 *___dst__R13s__anonymous8_1); 237 245 static 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); 238 247 static inline void ___constructor__F_R13s__anonymous8_autogen___1(struct __anonymous8 *___dst__R13s__anonymous8_1){ 239 248 ((void)((*___dst__R13s__anonymous8_1).__i__s_1) /* ?{} */); … … 248 257 struct __anonymous8 ___ret__13s__anonymous8_1; 249 258 ((void)((*___dst__R13s__anonymous8_1).__i__s_1=___src__13s__anonymous8_1.__i__s_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);259 ((void)___constructor__F_R13s__anonymous813s__anonymous8_autogen___1((&___ret__13s__anonymous8_1), (*___dst__R13s__anonymous8_1))); 260 return ___ret__13s__anonymous8_1; 252 261 } 253 262 static inline void ___constructor__F_R13s__anonymous8s_autogen___1(struct __anonymous8 *___dst__R13s__anonymous8_1, signed short int __i__s_1){ … … 262 271 static inline void ___destructor__F_R13s__anonymous9_autogen___1(struct __anonymous9 *___dst__R13s__anonymous9_1); 263 272 static 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); 264 274 static inline void ___constructor__F_R13s__anonymous9_autogen___1(struct __anonymous9 *___dst__R13s__anonymous9_1){ 265 275 ((void)((*___dst__R13s__anonymous9_1).__i__s_1) /* ?{} */); … … 274 284 struct __anonymous9 ___ret__13s__anonymous9_1; 275 285 ((void)((*___dst__R13s__anonymous9_1).__i__s_1=___src__13s__anonymous9_1.__i__s_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);286 ((void)___constructor__F_R13s__anonymous913s__anonymous9_autogen___1((&___ret__13s__anonymous9_1), (*___dst__R13s__anonymous9_1))); 287 return ___ret__13s__anonymous9_1; 278 288 } 279 289 static inline void ___constructor__F_R13s__anonymous9s_autogen___1(struct __anonymous9 *___dst__R13s__anonymous9_1, signed short int __i__s_1){ … … 288 298 static inline void ___destructor__F_R14s__anonymous10_autogen___1(struct __anonymous10 *___dst__R14s__anonymous10_1); 289 299 static 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); 290 301 static inline void ___constructor__F_R14s__anonymous10_autogen___1(struct __anonymous10 *___dst__R14s__anonymous10_1){ 291 302 ((void)((*___dst__R14s__anonymous10_1).__i__s_1) /* ?{} */); … … 300 311 struct __anonymous10 ___ret__14s__anonymous10_1; 301 312 ((void)((*___dst__R14s__anonymous10_1).__i__s_1=___src__14s__anonymous10_1.__i__s_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);313 ((void)___constructor__F_R14s__anonymous1014s__anonymous10_autogen___1((&___ret__14s__anonymous10_1), (*___dst__R14s__anonymous10_1))); 314 return ___ret__14s__anonymous10_1; 304 315 } 305 316 static inline void ___constructor__F_R14s__anonymous10s_autogen___1(struct __anonymous10 *___dst__R14s__anonymous10_1, signed short int __i__s_1){ … … 314 325 static inline void ___destructor__F_R14s__anonymous11_autogen___1(struct __anonymous11 *___dst__R14s__anonymous11_1); 315 326 static 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); 316 328 static inline void ___constructor__F_R14s__anonymous11_autogen___1(struct __anonymous11 *___dst__R14s__anonymous11_1){ 317 329 ((void)((*___dst__R14s__anonymous11_1).__i__s_1) /* ?{} */); … … 326 338 struct __anonymous11 ___ret__14s__anonymous11_1; 327 339 ((void)((*___dst__R14s__anonymous11_1).__i__s_1=___src__14s__anonymous11_1.__i__s_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);340 ((void)___constructor__F_R14s__anonymous1114s__anonymous11_autogen___1((&___ret__14s__anonymous11_1), (*___dst__R14s__anonymous11_1))); 341 return ___ret__14s__anonymous11_1; 330 342 } 331 343 static inline void ___constructor__F_R14s__anonymous11s_autogen___1(struct __anonymous11 *___dst__R14s__anonymous11_1, signed short int __i__s_1){ … … 340 352 static inline void ___destructor__F_R14s__anonymous12_autogen___1(struct __anonymous12 *___dst__R14s__anonymous12_1); 341 353 static 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); 342 355 static inline void ___constructor__F_R14s__anonymous12_autogen___1(struct __anonymous12 *___dst__R14s__anonymous12_1){ 343 356 ((void)((*___dst__R14s__anonymous12_1).__i__s_1) /* ?{} */); … … 352 365 struct __anonymous12 ___ret__14s__anonymous12_1; 353 366 ((void)((*___dst__R14s__anonymous12_1).__i__s_1=___src__14s__anonymous12_1.__i__s_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);367 ((void)___constructor__F_R14s__anonymous1214s__anonymous12_autogen___1((&___ret__14s__anonymous12_1), (*___dst__R14s__anonymous12_1))); 368 return ___ret__14s__anonymous12_1; 356 369 } 357 370 static inline void ___constructor__F_R14s__anonymous12s_autogen___1(struct __anonymous12 *___dst__R14s__anonymous12_1, signed short int __i__s_1){ … … 366 379 static inline void ___destructor__F_R14s__anonymous13_autogen___1(struct __anonymous13 *___dst__R14s__anonymous13_1); 367 380 static 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); 368 382 static inline void ___constructor__F_R14s__anonymous13_autogen___1(struct __anonymous13 *___dst__R14s__anonymous13_1){ 369 383 ((void)((*___dst__R14s__anonymous13_1).__i__s_1) /* ?{} */); … … 378 392 struct __anonymous13 ___ret__14s__anonymous13_1; 379 393 ((void)((*___dst__R14s__anonymous13_1).__i__s_1=___src__14s__anonymous13_1.__i__s_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);394 ((void)___constructor__F_R14s__anonymous1314s__anonymous13_autogen___1((&___ret__14s__anonymous13_1), (*___dst__R14s__anonymous13_1))); 395 return ___ret__14s__anonymous13_1; 382 396 } 383 397 static inline void ___constructor__F_R14s__anonymous13s_autogen___1(struct __anonymous13 *___dst__R14s__anonymous13_1, signed short int __i__s_1){ … … 392 406 static inline void ___destructor__F_R14s__anonymous14_autogen___1(struct __anonymous14 *___dst__R14s__anonymous14_1); 393 407 static 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); 394 409 static inline void ___constructor__F_R14s__anonymous14_autogen___1(struct __anonymous14 *___dst__R14s__anonymous14_1){ 395 410 ((void)((*___dst__R14s__anonymous14_1).__i__s_1) /* ?{} */); … … 404 419 struct __anonymous14 ___ret__14s__anonymous14_1; 405 420 ((void)((*___dst__R14s__anonymous14_1).__i__s_1=___src__14s__anonymous14_1.__i__s_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);421 ((void)___constructor__F_R14s__anonymous1414s__anonymous14_autogen___1((&___ret__14s__anonymous14_1), (*___dst__R14s__anonymous14_1))); 422 return ___ret__14s__anonymous14_1; 408 423 } 409 424 static inline void ___constructor__F_R14s__anonymous14s_autogen___1(struct __anonymous14 *___dst__R14s__anonymous14_1, signed short int __i__s_1){ … … 418 433 static inline void ___destructor__F_R14s__anonymous15_autogen___1(struct __anonymous15 *___dst__R14s__anonymous15_1); 419 434 static 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); 420 436 static inline void ___constructor__F_R14s__anonymous15_autogen___1(struct __anonymous15 *___dst__R14s__anonymous15_1){ 421 437 ((void)((*___dst__R14s__anonymous15_1).__i__s_1) /* ?{} */); … … 430 446 struct __anonymous15 ___ret__14s__anonymous15_1; 431 447 ((void)((*___dst__R14s__anonymous15_1).__i__s_1=___src__14s__anonymous15_1.__i__s_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);448 ((void)___constructor__F_R14s__anonymous1514s__anonymous15_autogen___1((&___ret__14s__anonymous15_1), (*___dst__R14s__anonymous15_1))); 449 return ___ret__14s__anonymous15_1; 434 450 } 435 451 static inline void ___constructor__F_R14s__anonymous15s_autogen___1(struct __anonymous15 *___dst__R14s__anonymous15_1, signed short int __i__s_1){ … … 460 476 static inline void ___destructor__F_R14s__anonymous16_autogen___1(struct __anonymous16 *___dst__R14s__anonymous16_1); 461 477 static 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); 462 479 static inline void ___constructor__F_R14s__anonymous16_autogen___1(struct __anonymous16 *___dst__R14s__anonymous16_1){ 463 480 ((void)((*___dst__R14s__anonymous16_1).__i__i_1) /* ?{} */); … … 472 489 struct __anonymous16 ___ret__14s__anonymous16_1; 473 490 ((void)((*___dst__R14s__anonymous16_1).__i__i_1=___src__14s__anonymous16_1.__i__i_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);491 ((void)___constructor__F_R14s__anonymous1614s__anonymous16_autogen___1((&___ret__14s__anonymous16_1), (*___dst__R14s__anonymous16_1))); 492 return ___ret__14s__anonymous16_1; 476 493 } 477 494 static inline void ___constructor__F_R14s__anonymous16i_autogen___1(struct __anonymous16 *___dst__R14s__anonymous16_1, signed int __i__i_1){ … … 486 503 static inline void ___destructor__F_R14s__anonymous17_autogen___1(struct __anonymous17 *___dst__R14s__anonymous17_1); 487 504 static 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); 488 506 static inline void ___constructor__F_R14s__anonymous17_autogen___1(struct __anonymous17 *___dst__R14s__anonymous17_1){ 489 507 ((void)((*___dst__R14s__anonymous17_1).__i__i_1) /* ?{} */); … … 498 516 struct __anonymous17 ___ret__14s__anonymous17_1; 499 517 ((void)((*___dst__R14s__anonymous17_1).__i__i_1=___src__14s__anonymous17_1.__i__i_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);518 ((void)___constructor__F_R14s__anonymous1714s__anonymous17_autogen___1((&___ret__14s__anonymous17_1), (*___dst__R14s__anonymous17_1))); 519 return ___ret__14s__anonymous17_1; 502 520 } 503 521 static inline void ___constructor__F_R14s__anonymous17i_autogen___1(struct __anonymous17 *___dst__R14s__anonymous17_1, signed int __i__i_1){ … … 512 530 static inline void ___destructor__F_R14s__anonymous18_autogen___1(struct __anonymous18 *___dst__R14s__anonymous18_1); 513 531 static 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); 514 533 static inline void ___constructor__F_R14s__anonymous18_autogen___1(struct __anonymous18 *___dst__R14s__anonymous18_1){ 515 534 ((void)((*___dst__R14s__anonymous18_1).__i__i_1) /* ?{} */); … … 524 543 struct __anonymous18 ___ret__14s__anonymous18_1; 525 544 ((void)((*___dst__R14s__anonymous18_1).__i__i_1=___src__14s__anonymous18_1.__i__i_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);545 ((void)___constructor__F_R14s__anonymous1814s__anonymous18_autogen___1((&___ret__14s__anonymous18_1), (*___dst__R14s__anonymous18_1))); 546 return ___ret__14s__anonymous18_1; 528 547 } 529 548 static inline void ___constructor__F_R14s__anonymous18i_autogen___1(struct __anonymous18 *___dst__R14s__anonymous18_1, signed int __i__i_1){ … … 538 557 static inline void ___destructor__F_R14s__anonymous19_autogen___1(struct __anonymous19 *___dst__R14s__anonymous19_1); 539 558 static 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); 540 560 static inline void ___constructor__F_R14s__anonymous19_autogen___1(struct __anonymous19 *___dst__R14s__anonymous19_1){ 541 561 ((void)((*___dst__R14s__anonymous19_1).__i__i_1) /* ?{} */); … … 550 570 struct __anonymous19 ___ret__14s__anonymous19_1; 551 571 ((void)((*___dst__R14s__anonymous19_1).__i__i_1=___src__14s__anonymous19_1.__i__i_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);572 ((void)___constructor__F_R14s__anonymous1914s__anonymous19_autogen___1((&___ret__14s__anonymous19_1), (*___dst__R14s__anonymous19_1))); 573 return ___ret__14s__anonymous19_1; 554 574 } 555 575 static inline void ___constructor__F_R14s__anonymous19i_autogen___1(struct __anonymous19 *___dst__R14s__anonymous19_1, signed int __i__i_1){ … … 564 584 static inline void ___destructor__F_R14s__anonymous20_autogen___1(struct __anonymous20 *___dst__R14s__anonymous20_1); 565 585 static 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); 566 587 static inline void ___constructor__F_R14s__anonymous20_autogen___1(struct __anonymous20 *___dst__R14s__anonymous20_1){ 567 588 ((void)((*___dst__R14s__anonymous20_1).__i__i_1) /* ?{} */); … … 576 597 struct __anonymous20 ___ret__14s__anonymous20_1; 577 598 ((void)((*___dst__R14s__anonymous20_1).__i__i_1=___src__14s__anonymous20_1.__i__i_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);599 ((void)___constructor__F_R14s__anonymous2014s__anonymous20_autogen___1((&___ret__14s__anonymous20_1), (*___dst__R14s__anonymous20_1))); 600 return ___ret__14s__anonymous20_1; 580 601 } 581 602 static inline void ___constructor__F_R14s__anonymous20i_autogen___1(struct __anonymous20 *___dst__R14s__anonymous20_1, signed int __i__i_1){ … … 590 611 static inline void ___destructor__F_R14s__anonymous21_autogen___1(struct __anonymous21 *___dst__R14s__anonymous21_1); 591 612 static 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); 592 614 static inline void ___constructor__F_R14s__anonymous21_autogen___1(struct __anonymous21 *___dst__R14s__anonymous21_1){ 593 615 ((void)((*___dst__R14s__anonymous21_1).__i__i_1) /* ?{} */); … … 602 624 struct __anonymous21 ___ret__14s__anonymous21_1; 603 625 ((void)((*___dst__R14s__anonymous21_1).__i__i_1=___src__14s__anonymous21_1.__i__i_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);626 ((void)___constructor__F_R14s__anonymous2114s__anonymous21_autogen___1((&___ret__14s__anonymous21_1), (*___dst__R14s__anonymous21_1))); 627 return ___ret__14s__anonymous21_1; 606 628 } 607 629 static inline void ___constructor__F_R14s__anonymous21i_autogen___1(struct __anonymous21 *___dst__R14s__anonymous21_1, signed int __i__i_1){ … … 616 638 static inline void ___destructor__F_R14s__anonymous22_autogen___1(struct __anonymous22 *___dst__R14s__anonymous22_1); 617 639 static 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); 618 641 static inline void ___constructor__F_R14s__anonymous22_autogen___1(struct __anonymous22 *___dst__R14s__anonymous22_1){ 619 642 ((void)((*___dst__R14s__anonymous22_1).__i__i_1) /* ?{} */); … … 628 651 struct __anonymous22 ___ret__14s__anonymous22_1; 629 652 ((void)((*___dst__R14s__anonymous22_1).__i__i_1=___src__14s__anonymous22_1.__i__i_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);653 ((void)___constructor__F_R14s__anonymous2214s__anonymous22_autogen___1((&___ret__14s__anonymous22_1), (*___dst__R14s__anonymous22_1))); 654 return ___ret__14s__anonymous22_1; 632 655 } 633 656 static inline void ___constructor__F_R14s__anonymous22i_autogen___1(struct __anonymous22 *___dst__R14s__anonymous22_1, signed int __i__i_1){ … … 642 665 static inline void ___destructor__F_R14s__anonymous23_autogen___1(struct __anonymous23 *___dst__R14s__anonymous23_1); 643 666 static 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); 644 668 static inline void ___constructor__F_R14s__anonymous23_autogen___1(struct __anonymous23 *___dst__R14s__anonymous23_1){ 645 669 ((void)((*___dst__R14s__anonymous23_1).__i__i_1) /* ?{} */); … … 654 678 struct __anonymous23 ___ret__14s__anonymous23_1; 655 679 ((void)((*___dst__R14s__anonymous23_1).__i__i_1=___src__14s__anonymous23_1.__i__i_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);680 ((void)___constructor__F_R14s__anonymous2314s__anonymous23_autogen___1((&___ret__14s__anonymous23_1), (*___dst__R14s__anonymous23_1))); 681 return ___ret__14s__anonymous23_1; 658 682 } 659 683 static inline void ___constructor__F_R14s__anonymous23i_autogen___1(struct __anonymous23 *___dst__R14s__anonymous23_1, signed int __i__i_1){ … … 672 696 __attribute__ ((unused)) signed int ___retval_main__i_1; 673 697 ((void)(___retval_main__i_1=((signed int )0)) /* ?{} */); 674 return ((signed int )___retval_main__i_1);698 return ___retval_main__i_1; 675 699 ((void)(___retval_main__i_1=0) /* ?{} */); 676 return ((signed int )___retval_main__i_1);700 return ___retval_main__i_1; 677 701 } 678 702 static inline int invoke_main(int argc, char* argv[], char* envp[]) { (void)argc; (void)argv; (void)envp; return __main__Fi_iPPCc__1(argc, argv); } … … 689 713 ((void)(___retval_main__i_1=(((void)(_tmp_cp_ret0=invoke_main(__argc__i_1, __argv__PPc_1, __envp__PPc_1))) , _tmp_cp_ret0)) /* ?{} */); 690 714 ((void)(_tmp_cp_ret0) /* ^?{} */); 691 return ((signed int )___retval_main__i_1);692 } 715 return ___retval_main__i_1; 716 } -
src/tests/.expect/32/extension.txt
r78315272 r3f7e12cb 17 17 static inline void ___destructor__F_R2sS_autogen___1(struct S *___dst__R2sS_1); 18 18 static 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); 19 22 static inline void ___constructor__F_R2sS_autogen___1(struct S *___dst__R2sS_1){ 20 23 ((void)((*___dst__R2sS_1).__a__i_1) /* ?{} */); … … 37 40 ((void)((*___dst__R2sS_1).__b__i_1=___src__2sS_1.__b__i_1)); 38 41 ((void)((*___dst__R2sS_1).__c__i_1=___src__2sS_1.__c__i_1)); 39 ((void)___constructor__F_R2sS2sS_autogen___1((&___ret__2sS_1), ___src__2sS_1));40 return ((struct S )___ret__2sS_1);42 ((void)___constructor__F_R2sS2sS_autogen___1((&___ret__2sS_1), (*___dst__R2sS_1))); 43 return ___ret__2sS_1; 41 44 } 42 45 static inline void ___constructor__F_R2sSi_autogen___1(struct S *___dst__R2sS_1, signed int __a__i_1){ … … 60 63 __extension__ signed int __c__i_1; 61 64 }; 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); 62 70 static inline void ___constructor__F_R2uU_autogen___1(__attribute__ ((unused)) union U *___dst__R2uU_1){ 63 71 } … … 70 78 union U ___ret__2uU_1; 71 79 ((void)__builtin_memcpy(((void *)___dst__R2uU_1), ((const void *)(&___src__2uU_1)), sizeof(union U ))); 72 ((void)___constructor__F_R2uU2uU_autogen___1((&___ret__2uU_1), ___src__2uU_1));73 return ((union U )___ret__2uU_1);74 } 75 static 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 )));80 ((void)___constructor__F_R2uU2uU_autogen___1((&___ret__2uU_1), (*___dst__R2uU_1))); 81 return ___ret__2uU_1; 82 } 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 ))); 77 85 } 78 86 __extension__ enum E { … … 94 102 __extension__ signed int *__z__Pi_2; 95 103 }; 96 signed int __i__i_2 = ((signed int )(__extension__ __a__i_1+__extension__ 3)); 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); 97 188 ((void)__extension__ 3); 98 189 ((void)__extension__ __a__i_1); -
src/tests/.expect/32/gccExtensions.txt
r78315272 r3f7e12cb 63 63 ((void)((*___dst__R2sS_2).__b__i_2=___src__2sS_2.__b__i_2)); 64 64 ((void)((*___dst__R2sS_2).__c__i_2=___src__2sS_2.__c__i_2)); 65 ((void)___constructor__F_R2sS2sS_autogen___2((&___ret__2sS_2), ___src__2sS_2));66 return ((struct S )___ret__2sS_2);65 ((void)___constructor__F_R2sS2sS_autogen___2((&___ret__2sS_2), (*___dst__R2sS_2))); 66 return ___ret__2sS_2; 67 67 } 68 68 inline void ___constructor__F_R2sSi_autogen___2(struct S *___dst__R2sS_2, signed int __a__i_2){ … … 81 81 ((void)((*___dst__R2sS_2).__c__i_2=__c__i_2) /* ?{} */); 82 82 } 83 signed int __i__i_2 = ((signed int )__extension__ 3);83 signed int __i__i_2 = __extension__ 3; 84 84 __extension__ signed int __a__i_2; 85 85 __extension__ signed int __b__i_2; … … 113 113 struct s2 ___ret__3ss2_2; 114 114 ((void)((*___dst__R3ss2_2).__i__i_2=___src__3ss2_2.__i__i_2)); 115 ((void)___constructor__F_R3ss23ss2_autogen___2((&___ret__3ss2_2), ___src__3ss2_2));116 return ((struct s2 )___ret__3ss2_2);115 ((void)___constructor__F_R3ss23ss2_autogen___2((&___ret__3ss2_2), (*___dst__R3ss2_2))); 116 return ___ret__3ss2_2; 117 117 } 118 118 inline void ___constructor__F_R3ss2i_autogen___2(struct s2 *___dst__R3ss2_2, signed int __i__i_2){ … … 134 134 struct s3 ___ret__3ss3_2; 135 135 ((void)((*___dst__R3ss3_2).__i__i_2=___src__3ss3_2.__i__i_2)); 136 ((void)___constructor__F_R3ss33ss3_autogen___2((&___ret__3ss3_2), ___src__3ss3_2));137 return ((struct s3 )___ret__3ss3_2);136 ((void)___constructor__F_R3ss33ss3_autogen___2((&___ret__3ss3_2), (*___dst__R3ss3_2))); 137 return ___ret__3ss3_2; 138 138 } 139 139 inline void ___constructor__F_R3ss3i_autogen___2(struct s3 *___dst__R3ss3_2, signed int __i__i_2){ … … 157 157 struct s4 ___ret__3ss4_2; 158 158 ((void)((*___dst__R3ss4_2).__i__i_2=___src__3ss4_2.__i__i_2)); 159 ((void)___constructor__F_R3ss43ss4_autogen___2((&___ret__3ss4_2), ___src__3ss4_2));160 return ((struct s4 )___ret__3ss4_2);159 ((void)___constructor__F_R3ss43ss4_autogen___2((&___ret__3ss4_2), (*___dst__R3ss4_2))); 160 return ___ret__3ss4_2; 161 161 } 162 162 inline void ___constructor__F_R3ss4i_autogen___2(struct s4 *___dst__R3ss4_2, signed int __i__i_2){ … … 169 169 signed int __m3__A0A0i_2[((unsigned int )10)][((unsigned int )10)]; 170 170 ((void)(___retval_main__i_1=((signed int )0)) /* ?{} */); 171 return ((signed int )___retval_main__i_1);171 return ___retval_main__i_1; 172 172 ((void)(___retval_main__i_1=0) /* ?{} */); 173 return ((signed int )___retval_main__i_1);173 return ___retval_main__i_1; 174 174 } 175 175 static inline int invoke_main(int argc, char* argv[], char* envp[]) { (void)argc; (void)argv; (void)envp; return __main__Fi_iPPCc__1(argc, argv); } … … 186 186 ((void)(___retval_main__i_1=(((void)(_tmp_cp_ret0=invoke_main(__argc__i_1, __argv__PPc_1, __envp__PPc_1))) , _tmp_cp_ret0)) /* ?{} */); 187 187 ((void)(_tmp_cp_ret0) /* ^?{} */); 188 return ((signed int )___retval_main__i_1);188 return ___retval_main__i_1; 189 189 } -
src/tests/.expect/32/literals.txt
r78315272 r3f7e12cb 5 5 __attribute__ ((__nothrow__,__leaf__,__noreturn__)) extern void exit(signed int __status); 6 6 extern signed int printf(const char *__restrict __format, ...); 7 void __for_each__A 2_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));8 void __for_each_reverse__A 2_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));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)); 9 9 void *___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); 10 10 void *___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); … … 29 29 void *___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); 30 30 void *___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__A 1_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);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); 32 32 void *___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)); 33 33 void *__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); … … 38 38 void *__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); 39 39 void *__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__A 2_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);41 void __write_reverse__A 2_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);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); 42 42 void *___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); 43 43 void *___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); … … 64 64 static inline void ___destructor__F_R16s_Istream_cstrUC_autogen___1(struct _Istream_cstrUC *___dst__R16s_Istream_cstrUC_1); 65 65 static 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); 66 67 static inline void ___constructor__F_R16s_Istream_cstrUC_autogen___1(struct _Istream_cstrUC *___dst__R16s_Istream_cstrUC_1){ 67 68 ((void)((*___dst__R16s_Istream_cstrUC_1).__s__Pc_1) /* ?{} */); … … 76 77 struct _Istream_cstrUC ___ret__16s_Istream_cstrUC_1; 77 78 ((void)((*___dst__R16s_Istream_cstrUC_1).__s__Pc_1=___src__16s_Istream_cstrUC_1.__s__Pc_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);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; 80 81 } 81 82 static inline void ___constructor__F_R16s_Istream_cstrUCPc_autogen___1(struct _Istream_cstrUC *___dst__R16s_Istream_cstrUC_1, char *__s__Pc_1){ … … 92 93 static inline void ___destructor__F_R15s_Istream_cstrC_autogen___1(struct _Istream_cstrC *___dst__R15s_Istream_cstrC_1); 93 94 static 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); 94 97 static inline void ___constructor__F_R15s_Istream_cstrC_autogen___1(struct _Istream_cstrC *___dst__R15s_Istream_cstrC_1){ 95 98 ((void)((*___dst__R15s_Istream_cstrC_1).__s__Pc_1) /* ?{} */); … … 108 111 ((void)((*___dst__R15s_Istream_cstrC_1).__s__Pc_1=___src__15s_Istream_cstrC_1.__s__Pc_1)); 109 112 ((void)((*___dst__R15s_Istream_cstrC_1).__size__i_1=___src__15s_Istream_cstrC_1.__size__i_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);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; 112 115 } 113 116 static inline void ___constructor__F_R15s_Istream_cstrCPc_autogen___1(struct _Istream_cstrC *___dst__R15s_Istream_cstrC_1, char *__s__Pc_1){ … … 122 125 void *___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); 123 126 enum __anonymous0 { 124 __sepSize__C13e__anonymous0_1 = ((signed int )16),127 __sepSize__C13e__anonymous0_1 = 16, 125 128 }; 126 129 struct ofstream { … … 137 140 static inline void ___destructor__F_R9sofstream_autogen___1(struct ofstream *___dst__R9sofstream_1); 138 141 static 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)]); 139 149 static inline void ___constructor__F_R9sofstream_autogen___1(struct ofstream *___dst__R9sofstream_1){ 140 150 ((void)((*___dst__R9sofstream_1).__file__Pv_1) /* ?{} */); … … 144 154 ((void)((*___dst__R9sofstream_1).__sepCur__PCc_1) /* ?{} */); 145 155 { 146 signed int _index0 = ((signed int )0);156 signed int _index0 = 0; 147 157 for (;(_index0<((signed int )__sepSize__C13e__anonymous0_1));((void)(++_index0))) { 148 158 ((void)((*((char *)(&(*___dst__R9sofstream_1).__separator__A0c_1[_index0])))) /* ?{} */); … … 150 160 151 161 } 152 { 153 signed int _index1 = ((signed int )0); 162 163 { 164 signed int _index1 = 0; 154 165 for (;(_index1<((signed int )__sepSize__C13e__anonymous0_1));((void)(++_index1))) { 155 166 ((void)((*((char *)(&(*___dst__R9sofstream_1).__tupleSeparator__A0c_1[_index1])))) /* ?{} */); … … 157 168 158 169 } 170 159 171 } 160 172 static inline void ___constructor__F_R9sofstream9sofstream_autogen___1(struct ofstream *___dst__R9sofstream_1, struct ofstream ___src__9sofstream_1){ … … 165 177 ((void)((*___dst__R9sofstream_1).__sepCur__PCc_1=___src__9sofstream_1.__sepCur__PCc_1) /* ?{} */); 166 178 { 167 signed int _index2 = ((signed int )0);179 signed int _index2 = 0; 168 180 for (;(_index2<((signed int )__sepSize__C13e__anonymous0_1));((void)(++_index2))) { 169 181 ((void)((*((char *)(&(*___dst__R9sofstream_1).__separator__A0c_1[_index2])))=___src__9sofstream_1.__separator__A0c_1[_index2]) /* ?{} */); … … 171 183 172 184 } 173 { 174 signed int _index3 = ((signed int )0); 185 186 { 187 signed int _index3 = 0; 175 188 for (;(_index3<((signed int )__sepSize__C13e__anonymous0_1));((void)(++_index3))) { 176 189 ((void)((*((char *)(&(*___dst__R9sofstream_1).__tupleSeparator__A0c_1[_index3])))=___src__9sofstream_1.__tupleSeparator__A0c_1[_index3]) /* ?{} */); … … 178 191 179 192 } 193 180 194 } 181 195 static inline void ___destructor__F_R9sofstream_autogen___1(struct ofstream *___dst__R9sofstream_1){ 182 196 { 183 signed int _index4 = (( signed int )(((signed int )__sepSize__C13e__anonymous0_1)-1));197 signed int _index4 = (((signed int )__sepSize__C13e__anonymous0_1)-1); 184 198 for (;(_index4>=0);((void)(--_index4))) { 185 199 ((void)((*((char *)(&(*___dst__R9sofstream_1).__tupleSeparator__A0c_1[_index4])))) /* ^?{} */); … … 187 201 188 202 } 189 { 190 signed int _index5 = ((signed int )(((signed int )__sepSize__C13e__anonymous0_1)-1)); 203 204 { 205 signed int _index5 = (((signed int )__sepSize__C13e__anonymous0_1)-1); 191 206 for (;(_index5>=0);((void)(--_index5))) { 192 207 ((void)((*((char *)(&(*___dst__R9sofstream_1).__separator__A0c_1[_index5])))) /* ^?{} */); … … 194 209 195 210 } 211 196 212 ((void)((*___dst__R9sofstream_1).__sepCur__PCc_1) /* ^?{} */); 197 213 ((void)((*___dst__R9sofstream_1).__sawNL__b_1) /* ^?{} */); … … 208 224 ((void)((*___dst__R9sofstream_1).__sepCur__PCc_1=___src__9sofstream_1.__sepCur__PCc_1)); 209 225 { 210 signed int _index6 = ((signed int )0);226 signed int _index6 = 0; 211 227 for (;(_index6<((signed int )__sepSize__C13e__anonymous0_1));((void)(++_index6))) { 212 228 ((void)((*___dst__R9sofstream_1).__separator__A0c_1[_index6]=___src__9sofstream_1.__separator__A0c_1[_index6])); … … 216 232 217 233 { 218 signed int _index7 = ((signed int )0);234 signed int _index7 = 0; 219 235 for (;(_index7<((signed int )__sepSize__C13e__anonymous0_1));((void)(++_index7))) { 220 236 ((void)((*___dst__R9sofstream_1).__tupleSeparator__A0c_1[_index7]=___src__9sofstream_1.__tupleSeparator__A0c_1[_index7])); … … 223 239 } 224 240 225 ((void)___constructor__F_R9sofstream9sofstream_autogen___1((&___ret__9sofstream_1), ___src__9sofstream_1));226 return ((struct ofstream )___ret__9sofstream_1);241 ((void)___constructor__F_R9sofstream9sofstream_autogen___1((&___ret__9sofstream_1), (*___dst__R9sofstream_1))); 242 return ___ret__9sofstream_1; 227 243 } 228 244 static inline void ___constructor__F_R9sofstreamPv_autogen___1(struct ofstream *___dst__R9sofstream_1, void *__file__Pv_1){ … … 233 249 ((void)((*___dst__R9sofstream_1).__sepCur__PCc_1) /* ?{} */); 234 250 { 235 signed int _index8 = ((signed int )0);251 signed int _index8 = 0; 236 252 for (;(_index8<((signed int )__sepSize__C13e__anonymous0_1));((void)(++_index8))) { 237 253 ((void)((*((char *)(&(*___dst__R9sofstream_1).__separator__A0c_1[_index8])))) /* ?{} */); … … 239 255 240 256 } 241 { 242 signed int _index9 = ((signed int )0); 257 258 { 259 signed int _index9 = 0; 243 260 for (;(_index9<((signed int )__sepSize__C13e__anonymous0_1));((void)(++_index9))) { 244 261 ((void)((*((char *)(&(*___dst__R9sofstream_1).__tupleSeparator__A0c_1[_index9])))) /* ?{} */); … … 246 263 247 264 } 265 248 266 } 249 267 static inline void ___constructor__F_R9sofstreamPvb_autogen___1(struct ofstream *___dst__R9sofstream_1, void *__file__Pv_1, _Bool __sepDefault__b_1){ … … 254 272 ((void)((*___dst__R9sofstream_1).__sepCur__PCc_1) /* ?{} */); 255 273 { 256 signed int _index10 = ((signed int )0);274 signed int _index10 = 0; 257 275 for (;(_index10<((signed int )__sepSize__C13e__anonymous0_1));((void)(++_index10))) { 258 276 ((void)((*((char *)(&(*___dst__R9sofstream_1).__separator__A0c_1[_index10])))) /* ?{} */); … … 260 278 261 279 } 262 { 263 signed int _index11 = ((signed int )0); 280 281 { 282 signed int _index11 = 0; 264 283 for (;(_index11<((signed int )__sepSize__C13e__anonymous0_1));((void)(++_index11))) { 265 284 ((void)((*((char *)(&(*___dst__R9sofstream_1).__tupleSeparator__A0c_1[_index11])))) /* ?{} */); … … 267 286 268 287 } 288 269 289 } 270 290 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){ … … 275 295 ((void)((*___dst__R9sofstream_1).__sepCur__PCc_1) /* ?{} */); 276 296 { 277 signed int _index12 = ((signed int )0);297 signed int _index12 = 0; 278 298 for (;(_index12<((signed int )__sepSize__C13e__anonymous0_1));((void)(++_index12))) { 279 299 ((void)((*((char *)(&(*___dst__R9sofstream_1).__separator__A0c_1[_index12])))) /* ?{} */); … … 281 301 282 302 } 283 { 284 signed int _index13 = ((signed int )0); 303 304 { 305 signed int _index13 = 0; 285 306 for (;(_index13<((signed int )__sepSize__C13e__anonymous0_1));((void)(++_index13))) { 286 307 ((void)((*((char *)(&(*___dst__R9sofstream_1).__tupleSeparator__A0c_1[_index13])))) /* ?{} */); … … 288 309 289 310 } 311 290 312 } 291 313 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){ … … 296 318 ((void)((*___dst__R9sofstream_1).__sepCur__PCc_1) /* ?{} */); 297 319 { 298 signed int _index14 = ((signed int )0);320 signed int _index14 = 0; 299 321 for (;(_index14<((signed int )__sepSize__C13e__anonymous0_1));((void)(++_index14))) { 300 322 ((void)((*((char *)(&(*___dst__R9sofstream_1).__separator__A0c_1[_index14])))) /* ?{} */); … … 302 324 303 325 } 304 { 305 signed int _index15 = ((signed int )0); 326 327 { 328 signed int _index15 = 0; 306 329 for (;(_index15<((signed int )__sepSize__C13e__anonymous0_1));((void)(++_index15))) { 307 330 ((void)((*((char *)(&(*___dst__R9sofstream_1).__tupleSeparator__A0c_1[_index15])))) /* ?{} */); … … 309 332 310 333 } 334 311 335 } 312 336 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){ … … 317 341 ((void)((*___dst__R9sofstream_1).__sepCur__PCc_1=__sepCur__PCc_1) /* ?{} */); 318 342 { 319 signed int _index16 = ((signed int )0);343 signed int _index16 = 0; 320 344 for (;(_index16<((signed int )__sepSize__C13e__anonymous0_1));((void)(++_index16))) { 321 345 ((void)((*((char *)(&(*___dst__R9sofstream_1).__separator__A0c_1[_index16])))) /* ?{} */); … … 323 347 324 348 } 325 { 326 signed int _index17 = ((signed int )0); 349 350 { 351 signed int _index17 = 0; 327 352 for (;(_index17<((signed int )__sepSize__C13e__anonymous0_1));((void)(++_index17))) { 328 353 ((void)((*((char *)(&(*___dst__R9sofstream_1).__tupleSeparator__A0c_1[_index17])))) /* ?{} */); … … 330 355 331 356 } 357 332 358 } 333 359 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)]){ … … 338 364 ((void)((*___dst__R9sofstream_1).__sepCur__PCc_1=__sepCur__PCc_1) /* ?{} */); 339 365 { 340 signed int _index18 = ((signed int )0);366 signed int _index18 = 0; 341 367 for (;(_index18<((signed int )__sepSize__C13e__anonymous0_1));((void)(++_index18))) { 342 368 ((void)((*((char *)(&(*___dst__R9sofstream_1).__separator__A0c_1[_index18])))=__separator__A0c_1[_index18]) /* ?{} */); … … 344 370 345 371 } 346 { 347 signed int _index19 = ((signed int )0); 372 373 { 374 signed int _index19 = 0; 348 375 for (;(_index19<((signed int )__sepSize__C13e__anonymous0_1));((void)(++_index19))) { 349 376 ((void)((*((char *)(&(*___dst__R9sofstream_1).__tupleSeparator__A0c_1[_index19])))) /* ?{} */); … … 351 378 352 379 } 380 353 381 } 354 382 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)]){ … … 359 387 ((void)((*___dst__R9sofstream_1).__sepCur__PCc_1=__sepCur__PCc_1) /* ?{} */); 360 388 { 361 signed int _index20 = ((signed int )0);389 signed int _index20 = 0; 362 390 for (;(_index20<((signed int )__sepSize__C13e__anonymous0_1));((void)(++_index20))) { 363 391 ((void)((*((char *)(&(*___dst__R9sofstream_1).__separator__A0c_1[_index20])))=__separator__A0c_1[_index20]) /* ?{} */); … … 365 393 366 394 } 367 { 368 signed int _index21 = ((signed int )0); 395 396 { 397 signed int _index21 = 0; 369 398 for (;(_index21<((signed int )__sepSize__C13e__anonymous0_1));((void)(++_index21))) { 370 399 ((void)((*((char *)(&(*___dst__R9sofstream_1).__tupleSeparator__A0c_1[_index21])))=__tupleSeparator__A0c_1[_index21]) /* ?{} */); … … 372 401 373 402 } 403 374 404 } 375 405 _Bool __sepPrt__Fb_P9sofstream__1(struct ofstream *__anonymous_object1294); … … 404 434 static inline void ___destructor__F_R9sifstream_autogen___1(struct ifstream *___dst__R9sifstream_1); 405 435 static 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); 406 437 static inline void ___constructor__F_R9sifstream_autogen___1(struct ifstream *___dst__R9sifstream_1){ 407 438 ((void)((*___dst__R9sifstream_1).__file__Pv_1) /* ?{} */); … … 416 447 struct ifstream ___ret__9sifstream_1; 417 448 ((void)((*___dst__R9sifstream_1).__file__Pv_1=___src__9sifstream_1.__file__Pv_1)); 418 ((void)___constructor__F_R9sifstream9sifstream_autogen___1((&___ret__9sifstream_1), ___src__9sifstream_1));419 return ((struct ifstream )___ret__9sifstream_1);449 ((void)___constructor__F_R9sifstream9sifstream_autogen___1((&___ret__9sifstream_1), (*___dst__R9sifstream_1))); 450 return ___ret__9sifstream_1; 420 451 } 421 452 static inline void ___constructor__F_R9sifstreamPv_autogen___1(struct ifstream *___dst__R9sifstream_1, void *__file__Pv_1){ … … 435 466 struct ofstream *_tmp_cp_ret2; 436 467 __attribute__ ((unused)) struct ofstream *_thunk0(struct ofstream *_p0){ 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));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)); 440 471 ((void)(_tmp_cp_ret0) /* ^?{} */); 441 472 ((void)(_tmp_cp_ret1) /* ^?{} */); … … 447 478 struct ofstream *_tmp_cp_ret5; 448 479 __attribute__ ((unused)) struct ofstream *_thunk1(struct ofstream *_p0){ 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));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)); 452 483 ((void)(_tmp_cp_ret3) /* ^?{} */); 453 484 ((void)(_tmp_cp_ret4) /* ^?{} */); … … 459 490 struct ofstream *_tmp_cp_ret8; 460 491 __attribute__ ((unused)) struct ofstream *_thunk2(struct ofstream *_p0){ 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));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)); 464 495 ((void)(_tmp_cp_ret6) /* ^?{} */); 465 496 ((void)(_tmp_cp_ret7) /* ^?{} */); … … 471 502 struct ofstream *_tmp_cp_ret11; 472 503 __attribute__ ((unused)) struct ofstream *_thunk3(struct ofstream *_p0){ 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));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)); 476 507 ((void)(_tmp_cp_ret9) /* ^?{} */); 477 508 ((void)(_tmp_cp_ret10) /* ^?{} */); … … 483 514 struct ofstream *_tmp_cp_ret14; 484 515 __attribute__ ((unused)) struct ofstream *_thunk4(struct ofstream *_p0){ 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));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)); 488 519 ((void)(_tmp_cp_ret12) /* ^?{} */); 489 520 ((void)(_tmp_cp_ret13) /* ^?{} */); … … 495 526 struct ofstream *_tmp_cp_ret17; 496 527 __attribute__ ((unused)) struct ofstream *_thunk5(struct ofstream *_p0){ 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));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)); 500 531 ((void)(_tmp_cp_ret15) /* ^?{} */); 501 532 ((void)(_tmp_cp_ret16) /* ^?{} */); … … 708 739 ((void)0123456789.e-09L); 709 740 ((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));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)); 716 747 ((void)(-0123456789.e-09)); 717 748 ((void)(-0123456789.e-09f)); … … 852 883 ((void)0123456789.0123456789E-09L); 853 884 ((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));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)); 860 891 ((void)(-0123456789.0123456789E-09)); 861 892 ((void)(-0123456789.0123456789E-09f)); … … 899 930 ((void)0x0123456789.p-09F); 900 931 ((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));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)); 906 937 ((void)(-0x0123456789.p-09)); 907 938 ((void)(-0x0123456789.p-09f)); … … 944 975 ((void)0x.0123456789P-09F); 945 976 ((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));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)); 951 982 ((void)(-0x.0123456789P-09)); 952 983 ((void)(-0x.0123456789P-09f)); … … 989 1020 ((void)0X0123456789.0123456789P-09F); 990 1021 ((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)); 991 1027 ((void)(-0X0123456789.0123456789P-09)); 992 1028 ((void)(-0X0123456789.0123456789P-09f)); … … 994 1030 ((void)(-0X0123456789.0123456789P-09F)); 995 1031 ((void)(-0X0123456789.0123456789P-09L)); 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)); 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))); 1001 1264 ((void)__f__F_c__1('a')); 1002 1265 ((void)__f__F_Sc__1(20)); … … 1111 1374 ((void)L"a" "b" "c"); 1112 1375 ((void)(___retval_main__i_1=0) /* ?{} */); 1113 return ((signed int )___retval_main__i_1);1376 return ___retval_main__i_1; 1114 1377 } 1115 1378 static inline int invoke_main(int argc, char* argv[], char* envp[]) { (void)argc; (void)argv; (void)envp; return __main__Fi___1(); } … … 1126 1389 ((void)(___retval_main__i_1=(((void)(_tmp_cp_ret0=invoke_main(__argc__i_1, __argv__PPc_1, __envp__PPc_1))) , _tmp_cp_ret0)) /* ?{} */); 1127 1390 ((void)(_tmp_cp_ret0) /* ^?{} */); 1128 return ((signed int )___retval_main__i_1);1129 } 1391 return ___retval_main__i_1; 1392 } -
src/tests/.expect/64/KRfunctions.txt
r78315272 r3f7e12cb 21 21 static inline void ___destructor__F_R2sS_autogen___1(struct S *___dst__R2sS_1); 22 22 static 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); 23 24 static inline void ___constructor__F_R2sS_autogen___1(struct S *___dst__R2sS_1){ 24 25 ((void)((*___dst__R2sS_1).__i__i_1) /* ?{} */); … … 33 34 struct S ___ret__2sS_1; 34 35 ((void)((*___dst__R2sS_1).__i__i_1=___src__2sS_1.__i__i_1)); 35 ((void)___constructor__F_R2sS2sS_autogen___1((&___ret__2sS_1), ___src__2sS_1));36 return ((struct S )___ret__2sS_1);36 ((void)___constructor__F_R2sS2sS_autogen___1((&___ret__2sS_1), (*___dst__R2sS_1))); 37 return ___ret__2sS_1; 37 38 } 38 39 static inline void ___constructor__F_R2sSi_autogen___1(struct S *___dst__R2sS_1, signed int __i__i_1){ … … 65 66 signed int *__x__FPi_ii__2(signed int __anonymous_object2, signed int __anonymous_object3); 66 67 ((void)(___retval_f10__PFPi_ii__1=__x__FPi_ii__2) /* ?{} */); 67 return ((signed int *(*)(signed int __x__i_1, signed int __y__i_1))___retval_f10__PFPi_ii__1);68 return ___retval_f10__PFPi_ii__1; 68 69 } 69 70 signed 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
r78315272 r3f7e12cb 23 23 static inline struct __anonymous0 ___operator_assign__F13s__anonymous0_R13s__anonymous013s__anonymous0_autogen___1(struct __anonymous0 *___dst__R13s__anonymous0_1, struct __anonymous0 ___src__13s__anonymous0_1){ 24 24 struct __anonymous0 ___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);25 ((void)___constructor__F_R13s__anonymous013s__anonymous0_autogen___1((&___ret__13s__anonymous0_1), (*___dst__R13s__anonymous0_1))); 26 return ___ret__13s__anonymous0_1; 27 27 } 28 28 __attribute__ ((unused)) struct Agn1; … … 41 41 static inline struct Agn2 ___operator_assign__F5sAgn2_R5sAgn25sAgn2_autogen___1(struct Agn2 *___dst__R5sAgn2_1, struct Agn2 ___src__5sAgn2_1){ 42 42 struct Agn2 ___ret__5sAgn2_1; 43 ((void)___constructor__F_R5sAgn25sAgn2_autogen___1((&___ret__5sAgn2_1), ___src__5sAgn2_1));44 return ((struct Agn2 )___ret__5sAgn2_1);43 ((void)___constructor__F_R5sAgn25sAgn2_autogen___1((&___ret__5sAgn2_1), (*___dst__R5sAgn2_1))); 44 return ___ret__5sAgn2_1; 45 45 } 46 46 enum __attribute__ ((unused)) __anonymous1 { … … 69 69 static inline void ___destructor__F_R4sFdl_autogen___1(struct Fdl *___dst__R4sFdl_1); 70 70 static 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); 71 81 static inline void ___constructor__F_R4sFdl_autogen___1(struct Fdl *___dst__R4sFdl_1){ 72 82 ((void)((*___dst__R4sFdl_1).__f1__i_1) /* ?{} */); … … 78 88 ((void)((*___dst__R4sFdl_1).__f7__i_1) /* ?{} */); 79 89 ((void)((*___dst__R4sFdl_1).__f8__i_1) /* ?{} */); 90 ((void)((*___dst__R4sFdl_1).__anonymous_object0) /* ?{} */); 80 91 ((void)((*___dst__R4sFdl_1).__f9__Pi_1) /* ?{} */); 81 92 } … … 89 100 ((void)((*___dst__R4sFdl_1).__f7__i_1=___src__4sFdl_1.__f7__i_1) /* ?{} */); 90 101 ((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) /* ?{} */); 91 103 ((void)((*___dst__R4sFdl_1).__f9__Pi_1=___src__4sFdl_1.__f9__Pi_1) /* ?{} */); 92 104 } 93 105 static inline void ___destructor__F_R4sFdl_autogen___1(struct Fdl *___dst__R4sFdl_1){ 94 106 ((void)((*___dst__R4sFdl_1).__f9__Pi_1) /* ^?{} */); 107 ((void)((*___dst__R4sFdl_1).__anonymous_object0) /* ^?{} */); 95 108 ((void)((*___dst__R4sFdl_1).__f8__i_1) /* ^?{} */); 96 109 ((void)((*___dst__R4sFdl_1).__f7__i_1) /* ^?{} */); … … 112 125 ((void)((*___dst__R4sFdl_1).__f7__i_1=___src__4sFdl_1.__f7__i_1)); 113 126 ((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)); 114 128 ((void)((*___dst__R4sFdl_1).__f9__Pi_1=___src__4sFdl_1.__f9__Pi_1)); 115 ((void)___constructor__F_R4sFdl4sFdl_autogen___1((&___ret__4sFdl_1), ___src__4sFdl_1));116 return ((struct Fdl )___ret__4sFdl_1);129 ((void)___constructor__F_R4sFdl4sFdl_autogen___1((&___ret__4sFdl_1), (*___dst__R4sFdl_1))); 130 return ___ret__4sFdl_1; 117 131 } 118 132 static inline void ___constructor__F_R4sFdli_autogen___1(struct Fdl *___dst__R4sFdl_1, signed int __f1__i_1){ … … 125 139 ((void)((*___dst__R4sFdl_1).__f7__i_1) /* ?{} */); 126 140 ((void)((*___dst__R4sFdl_1).__f8__i_1) /* ?{} */); 141 ((void)((*___dst__R4sFdl_1).__anonymous_object0) /* ?{} */); 127 142 ((void)((*___dst__R4sFdl_1).__f9__Pi_1) /* ?{} */); 128 143 } … … 136 151 ((void)((*___dst__R4sFdl_1).__f7__i_1) /* ?{} */); 137 152 ((void)((*___dst__R4sFdl_1).__f8__i_1) /* ?{} */); 153 ((void)((*___dst__R4sFdl_1).__anonymous_object0) /* ?{} */); 138 154 ((void)((*___dst__R4sFdl_1).__f9__Pi_1) /* ?{} */); 139 155 } … … 147 163 ((void)((*___dst__R4sFdl_1).__f7__i_1) /* ?{} */); 148 164 ((void)((*___dst__R4sFdl_1).__f8__i_1) /* ?{} */); 165 ((void)((*___dst__R4sFdl_1).__anonymous_object0) /* ?{} */); 149 166 ((void)((*___dst__R4sFdl_1).__f9__Pi_1) /* ?{} */); 150 167 } … … 158 175 ((void)((*___dst__R4sFdl_1).__f7__i_1) /* ?{} */); 159 176 ((void)((*___dst__R4sFdl_1).__f8__i_1) /* ?{} */); 177 ((void)((*___dst__R4sFdl_1).__anonymous_object0) /* ?{} */); 160 178 ((void)((*___dst__R4sFdl_1).__f9__Pi_1) /* ?{} */); 161 179 } … … 169 187 ((void)((*___dst__R4sFdl_1).__f7__i_1) /* ?{} */); 170 188 ((void)((*___dst__R4sFdl_1).__f8__i_1) /* ?{} */); 189 ((void)((*___dst__R4sFdl_1).__anonymous_object0) /* ?{} */); 171 190 ((void)((*___dst__R4sFdl_1).__f9__Pi_1) /* ?{} */); 172 191 } … … 180 199 ((void)((*___dst__R4sFdl_1).__f7__i_1) /* ?{} */); 181 200 ((void)((*___dst__R4sFdl_1).__f8__i_1) /* ?{} */); 201 ((void)((*___dst__R4sFdl_1).__anonymous_object0) /* ?{} */); 182 202 ((void)((*___dst__R4sFdl_1).__f9__Pi_1) /* ?{} */); 183 203 } … … 191 211 ((void)((*___dst__R4sFdl_1).__f7__i_1=__f7__i_1) /* ?{} */); 192 212 ((void)((*___dst__R4sFdl_1).__f8__i_1) /* ?{} */); 213 ((void)((*___dst__R4sFdl_1).__anonymous_object0) /* ?{} */); 193 214 ((void)((*___dst__R4sFdl_1).__f9__Pi_1) /* ?{} */); 194 215 } … … 202 223 ((void)((*___dst__R4sFdl_1).__f7__i_1=__f7__i_1) /* ?{} */); 203 224 ((void)((*___dst__R4sFdl_1).__f8__i_1=__f8__i_1) /* ?{} */); 204 ((void)((*___dst__R4sFdl_1).__f9__Pi_1) /* ?{} */); 205 } 206 static 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){ 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){ 207 229 ((void)((*___dst__R4sFdl_1).__f1__i_1=__f1__i_1) /* ?{} */); 208 230 ((void)((*___dst__R4sFdl_1).__f2__i_1=__f2__i_1) /* ?{} */); … … 213 235 ((void)((*___dst__R4sFdl_1).__f7__i_1=__f7__i_1) /* ?{} */); 214 236 ((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) /* ?{} */); 215 250 ((void)((*___dst__R4sFdl_1).__f9__Pi_1=__f9__Pi_1) /* ?{} */); 216 251 } … … 232 267 __attribute__ ((unused)) signed int **const ___retval_f2__CPPi_1; 233 268 } 234 __attribute__ ((unused,used,unused)) signed int (*__f3__FPA0i_i__1(signed int __anonymous_object 1))[];269 __attribute__ ((unused,used,unused)) signed int (*__f3__FPA0i_i__1(signed int __anonymous_object5))[]; 235 270 __attribute__ ((unused,unused)) signed int (*__f3__FPA0i_i__1(signed int __p__i_1))[]{ 236 271 __attribute__ ((unused)) signed int (*___retval_f3__PA0i_1)[]; 237 272 } 238 __attribute__ ((unused,used,unused)) signed int (*__f4__FPFi_i____1())(signed int __anonymous_object 2);239 __attribute__ ((unused,unused)) signed int (*__f4__FPFi_i____1())(signed int __anonymous_object 3){240 __attribute__ ((unused)) signed int (*___retval_f4__PFi_i__1)(signed int __anonymous_object 4);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); 241 276 } 242 277 signed int __vtr__Fi___1(){ … … 268 303 signed int __tpr2__Fi_PPi__1(__attribute__ ((unused,unused,unused,unused,unused,unused)) signed int **__Foo__PPi_1); 269 304 signed int __tpr3__Fi_Pi__1(__attribute__ ((unused,unused,unused)) signed int *__Foo__Pi_1); 270 signed int __tpr4__Fi_PFi_Pi___1(__attribute__ ((unused,unused)) signed int (*__anonymous_object 5)(__attribute__ ((unused,unused)) signed int __anonymous_object6[((unsigned long int )5)]));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)])); 271 306 signed int __tpr5__Fi_PFi____1(__attribute__ ((unused,unused,unused)) signed int (*__Foo__PFi___1)()); 272 307 signed int __tpr6__Fi_PFi____1(__attribute__ ((unused,unused,unused)) signed int (*__Foo__PFi___1)()); 273 signed int __tpr7__Fi_PFi_PFi_i____1(__attribute__ ((unused,unused)) signed int (*__anonymous_object 7)(__attribute__ ((unused)) signed int (*__anonymous_object8)(__attribute__ ((unused,unused)) signed int __anonymous_object9)));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))); 274 309 signed int __ad__Fi___1(){ 275 310 __attribute__ ((unused)) signed int ___retval_ad__i_1; … … 300 335 struct __anonymous4 ___ret__13s__anonymous4_2; 301 336 ((void)((*___dst__R13s__anonymous4_2).__i__i_2=___src__13s__anonymous4_2.__i__i_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);337 ((void)___constructor__F_R13s__anonymous413s__anonymous4_autogen___2((&___ret__13s__anonymous4_2), (*___dst__R13s__anonymous4_2))); 338 return ___ret__13s__anonymous4_2; 304 339 } 305 340 inline void ___constructor__F_R13s__anonymous4i_autogen___2(struct __anonymous4 *___dst__R13s__anonymous4_2, signed int __i__i_2){ … … 313 348 } 314 349 inline void ___constructor__F_R13e__anonymous513e__anonymous5_intrinsic___2(enum __anonymous5 *___dst__R13e__anonymous5_2, enum __anonymous5 ___src__13e__anonymous5_2){ 315 ((void)((*___dst__R13e__anonymous5_2)=___src__13e__anonymous5_2) );350 ((void)((*___dst__R13e__anonymous5_2)=___src__13e__anonymous5_2) /* ?{} */); 316 351 } 317 352 inline void ___destructor__F_R13e__anonymous5_intrinsic___2(__attribute__ ((unused)) enum __anonymous5 *___dst__R13e__anonymous5_2){ … … 319 354 inline enum __anonymous5 ___operator_assign__F13e__anonymous5_R13e__anonymous513e__anonymous5_intrinsic___2(enum __anonymous5 *___dst__R13e__anonymous5_2, enum __anonymous5 ___src__13e__anonymous5_2){ 320 355 enum __anonymous5 ___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); 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; 323 359 } 324 360 ((void)sizeof(enum __anonymous5 )); 325 361 } 326 signed int __apd1__Fi_PiPi__1(__attribute__ ((unused,unused,unused)) signed int *__anonymous_object1 0, __attribute__ ((unused,unused,unused)) signed int *__anonymous_object11);327 signed int __apd2__Fi_PPiPPi__1(__attribute__ ((unused,unused,unused,unused)) signed int **__anonymous_object1 2, __attribute__ ((unused,unused,unused,unused)) signed int **__anonymous_object13);328 signed int __apd3__Fi_PiPi__1(__attribute__ ((unused,unused,unused)) signed int *__anonymous_object1 4, __attribute__ ((unused,unused,unused)) signed int *__anonymous_object15);329 signed int __apd4__Fi_PFi__PFi____1(__attribute__ ((unused,unused,unused)) signed int (*__anonymous_object 16)(), __attribute__ ((unused,unused,unused)) signed int (*__anonymous_object17)());330 signed int __apd5__Fi_PFi_i_PFi_i___1(__attribute__ ((unused,unused,unused)) signed int (*__anonymous_object 18)(__attribute__ ((unused)) signed int __anonymous_object19), __attribute__ ((unused,unused,unused)) signed int (*__anonymous_object20)(__attribute__ ((unused)) signed int __anonymous_object21));331 signed int __apd6__Fi_PFi__PFi____1(__attribute__ ((unused,unused,unused)) signed int (*__anonymous_object2 2)(), __attribute__ ((unused,unused,unused)) signed int (*__anonymous_object23)());332 signed int __apd7__Fi_PFi_i_PFi_i___1(__attribute__ ((unused,unused,unused)) signed int (*__anonymous_object2 4)(__attribute__ ((unused)) signed int __anonymous_object25), __attribute__ ((unused,unused,unused)) signed int (*__anonymous_object26)(__attribute__ ((unused)) signed int __anonymous_object27));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)); 333 369 struct Vad { 334 __attribute__ ((unused)) signed int __anonymous_object 28;335 __attribute__ ((unused,unused)) signed int *__anonymous_object 29;336 __attribute__ ((unused,unused)) signed int __anonymous_object3 0[((unsigned long int )10)];337 __attribute__ ((unused,unused)) signed int (*__anonymous_object3 1)();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)(); 338 374 }; 339 375 static inline void ___constructor__F_R4sVad_autogen___1(struct Vad *___dst__R4sVad_1); … … 341 377 static inline void ___destructor__F_R4sVad_autogen___1(struct Vad *___dst__R4sVad_1); 342 378 static 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)()); 343 383 static 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) /* ?{} */); 344 395 } 345 396 static 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) /* ?{} */); 346 408 } 347 409 static 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) /* ^?{} */); 348 421 } 349 422 static inline struct Vad ___operator_assign__F4sVad_R4sVad4sVad_autogen___1(struct Vad *___dst__R4sVad_1, struct Vad ___src__4sVad_1){ 350 423 struct Vad ___ret__4sVad_1; 351 ((void)___constructor__F_R4sVad4sVad_autogen___1((&___ret__4sVad_1), ___src__4sVad_1)); 352 return ((struct Vad )___ret__4sVad_1); 353 } 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 } -
src/tests/.expect/64/declarationSpecifier.txt
r78315272 r3f7e12cb 20 20 static inline void ___destructor__F_R13s__anonymous0_autogen___1(struct __anonymous0 *___dst__R13s__anonymous0_1); 21 21 static 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); 22 23 static inline void ___constructor__F_R13s__anonymous0_autogen___1(struct __anonymous0 *___dst__R13s__anonymous0_1){ 23 24 ((void)((*___dst__R13s__anonymous0_1).__i__i_1) /* ?{} */); … … 32 33 struct __anonymous0 ___ret__13s__anonymous0_1; 33 34 ((void)((*___dst__R13s__anonymous0_1).__i__i_1=___src__13s__anonymous0_1.__i__i_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);35 ((void)___constructor__F_R13s__anonymous013s__anonymous0_autogen___1((&___ret__13s__anonymous0_1), (*___dst__R13s__anonymous0_1))); 36 return ___ret__13s__anonymous0_1; 36 37 } 37 38 static inline void ___constructor__F_R13s__anonymous0i_autogen___1(struct __anonymous0 *___dst__R13s__anonymous0_1, signed int __i__i_1){ … … 46 47 static inline void ___destructor__F_R13s__anonymous1_autogen___1(struct __anonymous1 *___dst__R13s__anonymous1_1); 47 48 static 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); 48 50 static inline void ___constructor__F_R13s__anonymous1_autogen___1(struct __anonymous1 *___dst__R13s__anonymous1_1){ 49 51 ((void)((*___dst__R13s__anonymous1_1).__i__i_1) /* ?{} */); … … 58 60 struct __anonymous1 ___ret__13s__anonymous1_1; 59 61 ((void)((*___dst__R13s__anonymous1_1).__i__i_1=___src__13s__anonymous1_1.__i__i_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);62 ((void)___constructor__F_R13s__anonymous113s__anonymous1_autogen___1((&___ret__13s__anonymous1_1), (*___dst__R13s__anonymous1_1))); 63 return ___ret__13s__anonymous1_1; 62 64 } 63 65 static inline void ___constructor__F_R13s__anonymous1i_autogen___1(struct __anonymous1 *___dst__R13s__anonymous1_1, signed int __i__i_1){ … … 72 74 static inline void ___destructor__F_R13s__anonymous2_autogen___1(struct __anonymous2 *___dst__R13s__anonymous2_1); 73 75 static 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); 74 77 static inline void ___constructor__F_R13s__anonymous2_autogen___1(struct __anonymous2 *___dst__R13s__anonymous2_1){ 75 78 ((void)((*___dst__R13s__anonymous2_1).__i__i_1) /* ?{} */); … … 84 87 struct __anonymous2 ___ret__13s__anonymous2_1; 85 88 ((void)((*___dst__R13s__anonymous2_1).__i__i_1=___src__13s__anonymous2_1.__i__i_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);89 ((void)___constructor__F_R13s__anonymous213s__anonymous2_autogen___1((&___ret__13s__anonymous2_1), (*___dst__R13s__anonymous2_1))); 90 return ___ret__13s__anonymous2_1; 88 91 } 89 92 static inline void ___constructor__F_R13s__anonymous2i_autogen___1(struct __anonymous2 *___dst__R13s__anonymous2_1, signed int __i__i_1){ … … 98 101 static inline void ___destructor__F_R13s__anonymous3_autogen___1(struct __anonymous3 *___dst__R13s__anonymous3_1); 99 102 static 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); 100 104 static inline void ___constructor__F_R13s__anonymous3_autogen___1(struct __anonymous3 *___dst__R13s__anonymous3_1){ 101 105 ((void)((*___dst__R13s__anonymous3_1).__i__i_1) /* ?{} */); … … 110 114 struct __anonymous3 ___ret__13s__anonymous3_1; 111 115 ((void)((*___dst__R13s__anonymous3_1).__i__i_1=___src__13s__anonymous3_1.__i__i_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);116 ((void)___constructor__F_R13s__anonymous313s__anonymous3_autogen___1((&___ret__13s__anonymous3_1), (*___dst__R13s__anonymous3_1))); 117 return ___ret__13s__anonymous3_1; 114 118 } 115 119 static inline void ___constructor__F_R13s__anonymous3i_autogen___1(struct __anonymous3 *___dst__R13s__anonymous3_1, signed int __i__i_1){ … … 124 128 static inline void ___destructor__F_R13s__anonymous4_autogen___1(struct __anonymous4 *___dst__R13s__anonymous4_1); 125 129 static 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); 126 131 static inline void ___constructor__F_R13s__anonymous4_autogen___1(struct __anonymous4 *___dst__R13s__anonymous4_1){ 127 132 ((void)((*___dst__R13s__anonymous4_1).__i__i_1) /* ?{} */); … … 136 141 struct __anonymous4 ___ret__13s__anonymous4_1; 137 142 ((void)((*___dst__R13s__anonymous4_1).__i__i_1=___src__13s__anonymous4_1.__i__i_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);143 ((void)___constructor__F_R13s__anonymous413s__anonymous4_autogen___1((&___ret__13s__anonymous4_1), (*___dst__R13s__anonymous4_1))); 144 return ___ret__13s__anonymous4_1; 140 145 } 141 146 static inline void ___constructor__F_R13s__anonymous4i_autogen___1(struct __anonymous4 *___dst__R13s__anonymous4_1, signed int __i__i_1){ … … 150 155 static inline void ___destructor__F_R13s__anonymous5_autogen___1(struct __anonymous5 *___dst__R13s__anonymous5_1); 151 156 static 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); 152 158 static inline void ___constructor__F_R13s__anonymous5_autogen___1(struct __anonymous5 *___dst__R13s__anonymous5_1){ 153 159 ((void)((*___dst__R13s__anonymous5_1).__i__i_1) /* ?{} */); … … 162 168 struct __anonymous5 ___ret__13s__anonymous5_1; 163 169 ((void)((*___dst__R13s__anonymous5_1).__i__i_1=___src__13s__anonymous5_1.__i__i_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);170 ((void)___constructor__F_R13s__anonymous513s__anonymous5_autogen___1((&___ret__13s__anonymous5_1), (*___dst__R13s__anonymous5_1))); 171 return ___ret__13s__anonymous5_1; 166 172 } 167 173 static inline void ___constructor__F_R13s__anonymous5i_autogen___1(struct __anonymous5 *___dst__R13s__anonymous5_1, signed int __i__i_1){ … … 176 182 static inline void ___destructor__F_R13s__anonymous6_autogen___1(struct __anonymous6 *___dst__R13s__anonymous6_1); 177 183 static 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); 178 185 static inline void ___constructor__F_R13s__anonymous6_autogen___1(struct __anonymous6 *___dst__R13s__anonymous6_1){ 179 186 ((void)((*___dst__R13s__anonymous6_1).__i__i_1) /* ?{} */); … … 188 195 struct __anonymous6 ___ret__13s__anonymous6_1; 189 196 ((void)((*___dst__R13s__anonymous6_1).__i__i_1=___src__13s__anonymous6_1.__i__i_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);197 ((void)___constructor__F_R13s__anonymous613s__anonymous6_autogen___1((&___ret__13s__anonymous6_1), (*___dst__R13s__anonymous6_1))); 198 return ___ret__13s__anonymous6_1; 192 199 } 193 200 static inline void ___constructor__F_R13s__anonymous6i_autogen___1(struct __anonymous6 *___dst__R13s__anonymous6_1, signed int __i__i_1){ … … 202 209 static inline void ___destructor__F_R13s__anonymous7_autogen___1(struct __anonymous7 *___dst__R13s__anonymous7_1); 203 210 static 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); 204 212 static inline void ___constructor__F_R13s__anonymous7_autogen___1(struct __anonymous7 *___dst__R13s__anonymous7_1){ 205 213 ((void)((*___dst__R13s__anonymous7_1).__i__i_1) /* ?{} */); … … 214 222 struct __anonymous7 ___ret__13s__anonymous7_1; 215 223 ((void)((*___dst__R13s__anonymous7_1).__i__i_1=___src__13s__anonymous7_1.__i__i_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);224 ((void)___constructor__F_R13s__anonymous713s__anonymous7_autogen___1((&___ret__13s__anonymous7_1), (*___dst__R13s__anonymous7_1))); 225 return ___ret__13s__anonymous7_1; 218 226 } 219 227 static inline void ___constructor__F_R13s__anonymous7i_autogen___1(struct __anonymous7 *___dst__R13s__anonymous7_1, signed int __i__i_1){ … … 236 244 static inline void ___destructor__F_R13s__anonymous8_autogen___1(struct __anonymous8 *___dst__R13s__anonymous8_1); 237 245 static 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); 238 247 static inline void ___constructor__F_R13s__anonymous8_autogen___1(struct __anonymous8 *___dst__R13s__anonymous8_1){ 239 248 ((void)((*___dst__R13s__anonymous8_1).__i__s_1) /* ?{} */); … … 248 257 struct __anonymous8 ___ret__13s__anonymous8_1; 249 258 ((void)((*___dst__R13s__anonymous8_1).__i__s_1=___src__13s__anonymous8_1.__i__s_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);259 ((void)___constructor__F_R13s__anonymous813s__anonymous8_autogen___1((&___ret__13s__anonymous8_1), (*___dst__R13s__anonymous8_1))); 260 return ___ret__13s__anonymous8_1; 252 261 } 253 262 static inline void ___constructor__F_R13s__anonymous8s_autogen___1(struct __anonymous8 *___dst__R13s__anonymous8_1, signed short int __i__s_1){ … … 262 271 static inline void ___destructor__F_R13s__anonymous9_autogen___1(struct __anonymous9 *___dst__R13s__anonymous9_1); 263 272 static 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); 264 274 static inline void ___constructor__F_R13s__anonymous9_autogen___1(struct __anonymous9 *___dst__R13s__anonymous9_1){ 265 275 ((void)((*___dst__R13s__anonymous9_1).__i__s_1) /* ?{} */); … … 274 284 struct __anonymous9 ___ret__13s__anonymous9_1; 275 285 ((void)((*___dst__R13s__anonymous9_1).__i__s_1=___src__13s__anonymous9_1.__i__s_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);286 ((void)___constructor__F_R13s__anonymous913s__anonymous9_autogen___1((&___ret__13s__anonymous9_1), (*___dst__R13s__anonymous9_1))); 287 return ___ret__13s__anonymous9_1; 278 288 } 279 289 static inline void ___constructor__F_R13s__anonymous9s_autogen___1(struct __anonymous9 *___dst__R13s__anonymous9_1, signed short int __i__s_1){ … … 288 298 static inline void ___destructor__F_R14s__anonymous10_autogen___1(struct __anonymous10 *___dst__R14s__anonymous10_1); 289 299 static 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); 290 301 static inline void ___constructor__F_R14s__anonymous10_autogen___1(struct __anonymous10 *___dst__R14s__anonymous10_1){ 291 302 ((void)((*___dst__R14s__anonymous10_1).__i__s_1) /* ?{} */); … … 300 311 struct __anonymous10 ___ret__14s__anonymous10_1; 301 312 ((void)((*___dst__R14s__anonymous10_1).__i__s_1=___src__14s__anonymous10_1.__i__s_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);313 ((void)___constructor__F_R14s__anonymous1014s__anonymous10_autogen___1((&___ret__14s__anonymous10_1), (*___dst__R14s__anonymous10_1))); 314 return ___ret__14s__anonymous10_1; 304 315 } 305 316 static inline void ___constructor__F_R14s__anonymous10s_autogen___1(struct __anonymous10 *___dst__R14s__anonymous10_1, signed short int __i__s_1){ … … 314 325 static inline void ___destructor__F_R14s__anonymous11_autogen___1(struct __anonymous11 *___dst__R14s__anonymous11_1); 315 326 static 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); 316 328 static inline void ___constructor__F_R14s__anonymous11_autogen___1(struct __anonymous11 *___dst__R14s__anonymous11_1){ 317 329 ((void)((*___dst__R14s__anonymous11_1).__i__s_1) /* ?{} */); … … 326 338 struct __anonymous11 ___ret__14s__anonymous11_1; 327 339 ((void)((*___dst__R14s__anonymous11_1).__i__s_1=___src__14s__anonymous11_1.__i__s_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);340 ((void)___constructor__F_R14s__anonymous1114s__anonymous11_autogen___1((&___ret__14s__anonymous11_1), (*___dst__R14s__anonymous11_1))); 341 return ___ret__14s__anonymous11_1; 330 342 } 331 343 static inline void ___constructor__F_R14s__anonymous11s_autogen___1(struct __anonymous11 *___dst__R14s__anonymous11_1, signed short int __i__s_1){ … … 340 352 static inline void ___destructor__F_R14s__anonymous12_autogen___1(struct __anonymous12 *___dst__R14s__anonymous12_1); 341 353 static 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); 342 355 static inline void ___constructor__F_R14s__anonymous12_autogen___1(struct __anonymous12 *___dst__R14s__anonymous12_1){ 343 356 ((void)((*___dst__R14s__anonymous12_1).__i__s_1) /* ?{} */); … … 352 365 struct __anonymous12 ___ret__14s__anonymous12_1; 353 366 ((void)((*___dst__R14s__anonymous12_1).__i__s_1=___src__14s__anonymous12_1.__i__s_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);367 ((void)___constructor__F_R14s__anonymous1214s__anonymous12_autogen___1((&___ret__14s__anonymous12_1), (*___dst__R14s__anonymous12_1))); 368 return ___ret__14s__anonymous12_1; 356 369 } 357 370 static inline void ___constructor__F_R14s__anonymous12s_autogen___1(struct __anonymous12 *___dst__R14s__anonymous12_1, signed short int __i__s_1){ … … 366 379 static inline void ___destructor__F_R14s__anonymous13_autogen___1(struct __anonymous13 *___dst__R14s__anonymous13_1); 367 380 static 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); 368 382 static inline void ___constructor__F_R14s__anonymous13_autogen___1(struct __anonymous13 *___dst__R14s__anonymous13_1){ 369 383 ((void)((*___dst__R14s__anonymous13_1).__i__s_1) /* ?{} */); … … 378 392 struct __anonymous13 ___ret__14s__anonymous13_1; 379 393 ((void)((*___dst__R14s__anonymous13_1).__i__s_1=___src__14s__anonymous13_1.__i__s_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);394 ((void)___constructor__F_R14s__anonymous1314s__anonymous13_autogen___1((&___ret__14s__anonymous13_1), (*___dst__R14s__anonymous13_1))); 395 return ___ret__14s__anonymous13_1; 382 396 } 383 397 static inline void ___constructor__F_R14s__anonymous13s_autogen___1(struct __anonymous13 *___dst__R14s__anonymous13_1, signed short int __i__s_1){ … … 392 406 static inline void ___destructor__F_R14s__anonymous14_autogen___1(struct __anonymous14 *___dst__R14s__anonymous14_1); 393 407 static 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); 394 409 static inline void ___constructor__F_R14s__anonymous14_autogen___1(struct __anonymous14 *___dst__R14s__anonymous14_1){ 395 410 ((void)((*___dst__R14s__anonymous14_1).__i__s_1) /* ?{} */); … … 404 419 struct __anonymous14 ___ret__14s__anonymous14_1; 405 420 ((void)((*___dst__R14s__anonymous14_1).__i__s_1=___src__14s__anonymous14_1.__i__s_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);421 ((void)___constructor__F_R14s__anonymous1414s__anonymous14_autogen___1((&___ret__14s__anonymous14_1), (*___dst__R14s__anonymous14_1))); 422 return ___ret__14s__anonymous14_1; 408 423 } 409 424 static inline void ___constructor__F_R14s__anonymous14s_autogen___1(struct __anonymous14 *___dst__R14s__anonymous14_1, signed short int __i__s_1){ … … 418 433 static inline void ___destructor__F_R14s__anonymous15_autogen___1(struct __anonymous15 *___dst__R14s__anonymous15_1); 419 434 static 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); 420 436 static inline void ___constructor__F_R14s__anonymous15_autogen___1(struct __anonymous15 *___dst__R14s__anonymous15_1){ 421 437 ((void)((*___dst__R14s__anonymous15_1).__i__s_1) /* ?{} */); … … 430 446 struct __anonymous15 ___ret__14s__anonymous15_1; 431 447 ((void)((*___dst__R14s__anonymous15_1).__i__s_1=___src__14s__anonymous15_1.__i__s_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);448 ((void)___constructor__F_R14s__anonymous1514s__anonymous15_autogen___1((&___ret__14s__anonymous15_1), (*___dst__R14s__anonymous15_1))); 449 return ___ret__14s__anonymous15_1; 434 450 } 435 451 static inline void ___constructor__F_R14s__anonymous15s_autogen___1(struct __anonymous15 *___dst__R14s__anonymous15_1, signed short int __i__s_1){ … … 460 476 static inline void ___destructor__F_R14s__anonymous16_autogen___1(struct __anonymous16 *___dst__R14s__anonymous16_1); 461 477 static 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); 462 479 static inline void ___constructor__F_R14s__anonymous16_autogen___1(struct __anonymous16 *___dst__R14s__anonymous16_1){ 463 480 ((void)((*___dst__R14s__anonymous16_1).__i__i_1) /* ?{} */); … … 472 489 struct __anonymous16 ___ret__14s__anonymous16_1; 473 490 ((void)((*___dst__R14s__anonymous16_1).__i__i_1=___src__14s__anonymous16_1.__i__i_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);491 ((void)___constructor__F_R14s__anonymous1614s__anonymous16_autogen___1((&___ret__14s__anonymous16_1), (*___dst__R14s__anonymous16_1))); 492 return ___ret__14s__anonymous16_1; 476 493 } 477 494 static inline void ___constructor__F_R14s__anonymous16i_autogen___1(struct __anonymous16 *___dst__R14s__anonymous16_1, signed int __i__i_1){ … … 486 503 static inline void ___destructor__F_R14s__anonymous17_autogen___1(struct __anonymous17 *___dst__R14s__anonymous17_1); 487 504 static 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); 488 506 static inline void ___constructor__F_R14s__anonymous17_autogen___1(struct __anonymous17 *___dst__R14s__anonymous17_1){ 489 507 ((void)((*___dst__R14s__anonymous17_1).__i__i_1) /* ?{} */); … … 498 516 struct __anonymous17 ___ret__14s__anonymous17_1; 499 517 ((void)((*___dst__R14s__anonymous17_1).__i__i_1=___src__14s__anonymous17_1.__i__i_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);518 ((void)___constructor__F_R14s__anonymous1714s__anonymous17_autogen___1((&___ret__14s__anonymous17_1), (*___dst__R14s__anonymous17_1))); 519 return ___ret__14s__anonymous17_1; 502 520 } 503 521 static inline void ___constructor__F_R14s__anonymous17i_autogen___1(struct __anonymous17 *___dst__R14s__anonymous17_1, signed int __i__i_1){ … … 512 530 static inline void ___destructor__F_R14s__anonymous18_autogen___1(struct __anonymous18 *___dst__R14s__anonymous18_1); 513 531 static 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); 514 533 static inline void ___constructor__F_R14s__anonymous18_autogen___1(struct __anonymous18 *___dst__R14s__anonymous18_1){ 515 534 ((void)((*___dst__R14s__anonymous18_1).__i__i_1) /* ?{} */); … … 524 543 struct __anonymous18 ___ret__14s__anonymous18_1; 525 544 ((void)((*___dst__R14s__anonymous18_1).__i__i_1=___src__14s__anonymous18_1.__i__i_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);545 ((void)___constructor__F_R14s__anonymous1814s__anonymous18_autogen___1((&___ret__14s__anonymous18_1), (*___dst__R14s__anonymous18_1))); 546 return ___ret__14s__anonymous18_1; 528 547 } 529 548 static inline void ___constructor__F_R14s__anonymous18i_autogen___1(struct __anonymous18 *___dst__R14s__anonymous18_1, signed int __i__i_1){ … … 538 557 static inline void ___destructor__F_R14s__anonymous19_autogen___1(struct __anonymous19 *___dst__R14s__anonymous19_1); 539 558 static 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); 540 560 static inline void ___constructor__F_R14s__anonymous19_autogen___1(struct __anonymous19 *___dst__R14s__anonymous19_1){ 541 561 ((void)((*___dst__R14s__anonymous19_1).__i__i_1) /* ?{} */); … … 550 570 struct __anonymous19 ___ret__14s__anonymous19_1; 551 571 ((void)((*___dst__R14s__anonymous19_1).__i__i_1=___src__14s__anonymous19_1.__i__i_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);572 ((void)___constructor__F_R14s__anonymous1914s__anonymous19_autogen___1((&___ret__14s__anonymous19_1), (*___dst__R14s__anonymous19_1))); 573 return ___ret__14s__anonymous19_1; 554 574 } 555 575 static inline void ___constructor__F_R14s__anonymous19i_autogen___1(struct __anonymous19 *___dst__R14s__anonymous19_1, signed int __i__i_1){ … … 564 584 static inline void ___destructor__F_R14s__anonymous20_autogen___1(struct __anonymous20 *___dst__R14s__anonymous20_1); 565 585 static 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); 566 587 static inline void ___constructor__F_R14s__anonymous20_autogen___1(struct __anonymous20 *___dst__R14s__anonymous20_1){ 567 588 ((void)((*___dst__R14s__anonymous20_1).__i__i_1) /* ?{} */); … … 576 597 struct __anonymous20 ___ret__14s__anonymous20_1; 577 598 ((void)((*___dst__R14s__anonymous20_1).__i__i_1=___src__14s__anonymous20_1.__i__i_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);599 ((void)___constructor__F_R14s__anonymous2014s__anonymous20_autogen___1((&___ret__14s__anonymous20_1), (*___dst__R14s__anonymous20_1))); 600 return ___ret__14s__anonymous20_1; 580 601 } 581 602 static inline void ___constructor__F_R14s__anonymous20i_autogen___1(struct __anonymous20 *___dst__R14s__anonymous20_1, signed int __i__i_1){ … … 590 611 static inline void ___destructor__F_R14s__anonymous21_autogen___1(struct __anonymous21 *___dst__R14s__anonymous21_1); 591 612 static 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); 592 614 static inline void ___constructor__F_R14s__anonymous21_autogen___1(struct __anonymous21 *___dst__R14s__anonymous21_1){ 593 615 ((void)((*___dst__R14s__anonymous21_1).__i__i_1) /* ?{} */); … … 602 624 struct __anonymous21 ___ret__14s__anonymous21_1; 603 625 ((void)((*___dst__R14s__anonymous21_1).__i__i_1=___src__14s__anonymous21_1.__i__i_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);626 ((void)___constructor__F_R14s__anonymous2114s__anonymous21_autogen___1((&___ret__14s__anonymous21_1), (*___dst__R14s__anonymous21_1))); 627 return ___ret__14s__anonymous21_1; 606 628 } 607 629 static inline void ___constructor__F_R14s__anonymous21i_autogen___1(struct __anonymous21 *___dst__R14s__anonymous21_1, signed int __i__i_1){ … … 616 638 static inline void ___destructor__F_R14s__anonymous22_autogen___1(struct __anonymous22 *___dst__R14s__anonymous22_1); 617 639 static 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); 618 641 static inline void ___constructor__F_R14s__anonymous22_autogen___1(struct __anonymous22 *___dst__R14s__anonymous22_1){ 619 642 ((void)((*___dst__R14s__anonymous22_1).__i__i_1) /* ?{} */); … … 628 651 struct __anonymous22 ___ret__14s__anonymous22_1; 629 652 ((void)((*___dst__R14s__anonymous22_1).__i__i_1=___src__14s__anonymous22_1.__i__i_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);653 ((void)___constructor__F_R14s__anonymous2214s__anonymous22_autogen___1((&___ret__14s__anonymous22_1), (*___dst__R14s__anonymous22_1))); 654 return ___ret__14s__anonymous22_1; 632 655 } 633 656 static inline void ___constructor__F_R14s__anonymous22i_autogen___1(struct __anonymous22 *___dst__R14s__anonymous22_1, signed int __i__i_1){ … … 642 665 static inline void ___destructor__F_R14s__anonymous23_autogen___1(struct __anonymous23 *___dst__R14s__anonymous23_1); 643 666 static 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); 644 668 static inline void ___constructor__F_R14s__anonymous23_autogen___1(struct __anonymous23 *___dst__R14s__anonymous23_1){ 645 669 ((void)((*___dst__R14s__anonymous23_1).__i__i_1) /* ?{} */); … … 654 678 struct __anonymous23 ___ret__14s__anonymous23_1; 655 679 ((void)((*___dst__R14s__anonymous23_1).__i__i_1=___src__14s__anonymous23_1.__i__i_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);680 ((void)___constructor__F_R14s__anonymous2314s__anonymous23_autogen___1((&___ret__14s__anonymous23_1), (*___dst__R14s__anonymous23_1))); 681 return ___ret__14s__anonymous23_1; 658 682 } 659 683 static inline void ___constructor__F_R14s__anonymous23i_autogen___1(struct __anonymous23 *___dst__R14s__anonymous23_1, signed int __i__i_1){ … … 672 696 __attribute__ ((unused)) signed int ___retval_main__i_1; 673 697 ((void)(___retval_main__i_1=((signed int )0)) /* ?{} */); 674 return ((signed int )___retval_main__i_1);698 return ___retval_main__i_1; 675 699 ((void)(___retval_main__i_1=0) /* ?{} */); 676 return ((signed int )___retval_main__i_1);700 return ___retval_main__i_1; 677 701 } 678 702 static inline int invoke_main(int argc, char* argv[], char* envp[]) { (void)argc; (void)argv; (void)envp; return __main__Fi_iPPCc__1(argc, argv); } … … 689 713 ((void)(___retval_main__i_1=(((void)(_tmp_cp_ret0=invoke_main(__argc__i_1, __argv__PPc_1, __envp__PPc_1))) , _tmp_cp_ret0)) /* ?{} */); 690 714 ((void)(_tmp_cp_ret0) /* ^?{} */); 691 return ((signed int )___retval_main__i_1);692 } 715 return ___retval_main__i_1; 716 } -
src/tests/.expect/64/extension.txt
r78315272 r3f7e12cb 17 17 static inline void ___destructor__F_R2sS_autogen___1(struct S *___dst__R2sS_1); 18 18 static 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); 19 22 static inline void ___constructor__F_R2sS_autogen___1(struct S *___dst__R2sS_1){ 20 23 ((void)((*___dst__R2sS_1).__a__i_1) /* ?{} */); … … 37 40 ((void)((*___dst__R2sS_1).__b__i_1=___src__2sS_1.__b__i_1)); 38 41 ((void)((*___dst__R2sS_1).__c__i_1=___src__2sS_1.__c__i_1)); 39 ((void)___constructor__F_R2sS2sS_autogen___1((&___ret__2sS_1), ___src__2sS_1));40 return ((struct S )___ret__2sS_1);42 ((void)___constructor__F_R2sS2sS_autogen___1((&___ret__2sS_1), (*___dst__R2sS_1))); 43 return ___ret__2sS_1; 41 44 } 42 45 static inline void ___constructor__F_R2sSi_autogen___1(struct S *___dst__R2sS_1, signed int __a__i_1){ … … 60 63 __extension__ signed int __c__i_1; 61 64 }; 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); 62 70 static inline void ___constructor__F_R2uU_autogen___1(__attribute__ ((unused)) union U *___dst__R2uU_1){ 63 71 } … … 70 78 union U ___ret__2uU_1; 71 79 ((void)__builtin_memcpy(((void *)___dst__R2uU_1), ((const void *)(&___src__2uU_1)), sizeof(union U ))); 72 ((void)___constructor__F_R2uU2uU_autogen___1((&___ret__2uU_1), ___src__2uU_1));73 return ((union U )___ret__2uU_1);74 } 75 static 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 )));80 ((void)___constructor__F_R2uU2uU_autogen___1((&___ret__2uU_1), (*___dst__R2uU_1))); 81 return ___ret__2uU_1; 82 } 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 ))); 77 85 } 78 86 __extension__ enum E { … … 94 102 __extension__ signed int *__z__Pi_2; 95 103 }; 96 signed int __i__i_2 = ((signed int )(__extension__ __a__i_1+__extension__ 3)); 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); 97 188 ((void)__extension__ 3); 98 189 ((void)__extension__ __a__i_1); -
src/tests/.expect/64/gccExtensions.txt
r78315272 r3f7e12cb 63 63 ((void)((*___dst__R2sS_2).__b__i_2=___src__2sS_2.__b__i_2)); 64 64 ((void)((*___dst__R2sS_2).__c__i_2=___src__2sS_2.__c__i_2)); 65 ((void)___constructor__F_R2sS2sS_autogen___2((&___ret__2sS_2), ___src__2sS_2));66 return ((struct S )___ret__2sS_2);65 ((void)___constructor__F_R2sS2sS_autogen___2((&___ret__2sS_2), (*___dst__R2sS_2))); 66 return ___ret__2sS_2; 67 67 } 68 68 inline void ___constructor__F_R2sSi_autogen___2(struct S *___dst__R2sS_2, signed int __a__i_2){ … … 81 81 ((void)((*___dst__R2sS_2).__c__i_2=__c__i_2) /* ?{} */); 82 82 } 83 signed int __i__i_2 = ((signed int )__extension__ 3);83 signed int __i__i_2 = __extension__ 3; 84 84 __extension__ signed int __a__i_2; 85 85 __extension__ signed int __b__i_2; … … 113 113 struct s2 ___ret__3ss2_2; 114 114 ((void)((*___dst__R3ss2_2).__i__i_2=___src__3ss2_2.__i__i_2)); 115 ((void)___constructor__F_R3ss23ss2_autogen___2((&___ret__3ss2_2), ___src__3ss2_2));116 return ((struct s2 )___ret__3ss2_2);115 ((void)___constructor__F_R3ss23ss2_autogen___2((&___ret__3ss2_2), (*___dst__R3ss2_2))); 116 return ___ret__3ss2_2; 117 117 } 118 118 inline void ___constructor__F_R3ss2i_autogen___2(struct s2 *___dst__R3ss2_2, signed int __i__i_2){ … … 134 134 struct s3 ___ret__3ss3_2; 135 135 ((void)((*___dst__R3ss3_2).__i__i_2=___src__3ss3_2.__i__i_2)); 136 ((void)___constructor__F_R3ss33ss3_autogen___2((&___ret__3ss3_2), ___src__3ss3_2));137 return ((struct s3 )___ret__3ss3_2);136 ((void)___constructor__F_R3ss33ss3_autogen___2((&___ret__3ss3_2), (*___dst__R3ss3_2))); 137 return ___ret__3ss3_2; 138 138 } 139 139 inline void ___constructor__F_R3ss3i_autogen___2(struct s3 *___dst__R3ss3_2, signed int __i__i_2){ … … 157 157 struct s4 ___ret__3ss4_2; 158 158 ((void)((*___dst__R3ss4_2).__i__i_2=___src__3ss4_2.__i__i_2)); 159 ((void)___constructor__F_R3ss43ss4_autogen___2((&___ret__3ss4_2), ___src__3ss4_2));160 return ((struct s4 )___ret__3ss4_2);159 ((void)___constructor__F_R3ss43ss4_autogen___2((&___ret__3ss4_2), (*___dst__R3ss4_2))); 160 return ___ret__3ss4_2; 161 161 } 162 162 inline void ___constructor__F_R3ss4i_autogen___2(struct s4 *___dst__R3ss4_2, signed int __i__i_2){ … … 169 169 signed int __m3__A0A0i_2[((unsigned long int )10)][((unsigned long int )10)]; 170 170 ((void)(___retval_main__i_1=((signed int )0)) /* ?{} */); 171 return ((signed int )___retval_main__i_1);171 return ___retval_main__i_1; 172 172 ((void)(___retval_main__i_1=0) /* ?{} */); 173 return ((signed int )___retval_main__i_1);173 return ___retval_main__i_1; 174 174 } 175 175 static inline int invoke_main(int argc, char* argv[], char* envp[]) { (void)argc; (void)argv; (void)envp; return __main__Fi_iPPCc__1(argc, argv); } … … 186 186 ((void)(___retval_main__i_1=(((void)(_tmp_cp_ret0=invoke_main(__argc__i_1, __argv__PPc_1, __envp__PPc_1))) , _tmp_cp_ret0)) /* ?{} */); 187 187 ((void)(_tmp_cp_ret0) /* ^?{} */); 188 return ((signed int )___retval_main__i_1);188 return ___retval_main__i_1; 189 189 } -
src/tests/.expect/64/literals.txt
r78315272 r3f7e12cb 5 5 __attribute__ ((__nothrow__,__leaf__,__noreturn__)) extern void exit(signed int __status); 6 6 extern signed int printf(const char *__restrict __format, ...); 7 void __for_each__A 2_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));8 void __for_each_reverse__A 2_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));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)); 9 9 void *___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); 10 10 void *___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); … … 29 29 void *___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); 30 30 void *___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__A 1_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);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); 32 32 void *___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)); 33 33 void *__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); … … 38 38 void *__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); 39 39 void *__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__A 2_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);41 void __write_reverse__A 2_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);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); 42 42 void *___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); 43 43 void *___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); … … 64 64 static inline void ___destructor__F_R16s_Istream_cstrUC_autogen___1(struct _Istream_cstrUC *___dst__R16s_Istream_cstrUC_1); 65 65 static 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); 66 67 static inline void ___constructor__F_R16s_Istream_cstrUC_autogen___1(struct _Istream_cstrUC *___dst__R16s_Istream_cstrUC_1){ 67 68 ((void)((*___dst__R16s_Istream_cstrUC_1).__s__Pc_1) /* ?{} */); … … 76 77 struct _Istream_cstrUC ___ret__16s_Istream_cstrUC_1; 77 78 ((void)((*___dst__R16s_Istream_cstrUC_1).__s__Pc_1=___src__16s_Istream_cstrUC_1.__s__Pc_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);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; 80 81 } 81 82 static inline void ___constructor__F_R16s_Istream_cstrUCPc_autogen___1(struct _Istream_cstrUC *___dst__R16s_Istream_cstrUC_1, char *__s__Pc_1){ … … 92 93 static inline void ___destructor__F_R15s_Istream_cstrC_autogen___1(struct _Istream_cstrC *___dst__R15s_Istream_cstrC_1); 93 94 static 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); 94 97 static inline void ___constructor__F_R15s_Istream_cstrC_autogen___1(struct _Istream_cstrC *___dst__R15s_Istream_cstrC_1){ 95 98 ((void)((*___dst__R15s_Istream_cstrC_1).__s__Pc_1) /* ?{} */); … … 108 111 ((void)((*___dst__R15s_Istream_cstrC_1).__s__Pc_1=___src__15s_Istream_cstrC_1.__s__Pc_1)); 109 112 ((void)((*___dst__R15s_Istream_cstrC_1).__size__i_1=___src__15s_Istream_cstrC_1.__size__i_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);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; 112 115 } 113 116 static inline void ___constructor__F_R15s_Istream_cstrCPc_autogen___1(struct _Istream_cstrC *___dst__R15s_Istream_cstrC_1, char *__s__Pc_1){ … … 122 125 void *___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); 123 126 enum __anonymous0 { 124 __sepSize__C13e__anonymous0_1 = ((signed int )16),127 __sepSize__C13e__anonymous0_1 = 16, 125 128 }; 126 129 struct ofstream { … … 137 140 static inline void ___destructor__F_R9sofstream_autogen___1(struct ofstream *___dst__R9sofstream_1); 138 141 static 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)]); 139 149 static inline void ___constructor__F_R9sofstream_autogen___1(struct ofstream *___dst__R9sofstream_1){ 140 150 ((void)((*___dst__R9sofstream_1).__file__Pv_1) /* ?{} */); … … 144 154 ((void)((*___dst__R9sofstream_1).__sepCur__PCc_1) /* ?{} */); 145 155 { 146 signed int _index0 = ((signed int )0);156 signed int _index0 = 0; 147 157 for (;(_index0<((signed int )__sepSize__C13e__anonymous0_1));((void)(++_index0))) { 148 158 ((void)((*((char *)(&(*___dst__R9sofstream_1).__separator__A0c_1[((signed long int )_index0)])))) /* ?{} */); … … 150 160 151 161 } 152 { 153 signed int _index1 = ((signed int )0); 162 163 { 164 signed int _index1 = 0; 154 165 for (;(_index1<((signed int )__sepSize__C13e__anonymous0_1));((void)(++_index1))) { 155 166 ((void)((*((char *)(&(*___dst__R9sofstream_1).__tupleSeparator__A0c_1[((signed long int )_index1)])))) /* ?{} */); … … 157 168 158 169 } 170 159 171 } 160 172 static inline void ___constructor__F_R9sofstream9sofstream_autogen___1(struct ofstream *___dst__R9sofstream_1, struct ofstream ___src__9sofstream_1){ … … 165 177 ((void)((*___dst__R9sofstream_1).__sepCur__PCc_1=___src__9sofstream_1.__sepCur__PCc_1) /* ?{} */); 166 178 { 167 signed int _index2 = ((signed int )0);179 signed int _index2 = 0; 168 180 for (;(_index2<((signed int )__sepSize__C13e__anonymous0_1));((void)(++_index2))) { 169 181 ((void)((*((char *)(&(*___dst__R9sofstream_1).__separator__A0c_1[((signed long int )_index2)])))=___src__9sofstream_1.__separator__A0c_1[((signed long int )_index2)]) /* ?{} */); … … 171 183 172 184 } 173 { 174 signed int _index3 = ((signed int )0); 185 186 { 187 signed int _index3 = 0; 175 188 for (;(_index3<((signed int )__sepSize__C13e__anonymous0_1));((void)(++_index3))) { 176 189 ((void)((*((char *)(&(*___dst__R9sofstream_1).__tupleSeparator__A0c_1[((signed long int )_index3)])))=___src__9sofstream_1.__tupleSeparator__A0c_1[((signed long int )_index3)]) /* ?{} */); … … 178 191 179 192 } 193 180 194 } 181 195 static inline void ___destructor__F_R9sofstream_autogen___1(struct ofstream *___dst__R9sofstream_1){ 182 196 { 183 signed int _index4 = (( signed int )(((signed int )__sepSize__C13e__anonymous0_1)-1));197 signed int _index4 = (((signed int )__sepSize__C13e__anonymous0_1)-1); 184 198 for (;(_index4>=0);((void)(--_index4))) { 185 199 ((void)((*((char *)(&(*___dst__R9sofstream_1).__tupleSeparator__A0c_1[((signed long int )_index4)])))) /* ^?{} */); … … 187 201 188 202 } 189 { 190 signed int _index5 = ((signed int )(((signed int )__sepSize__C13e__anonymous0_1)-1)); 203 204 { 205 signed int _index5 = (((signed int )__sepSize__C13e__anonymous0_1)-1); 191 206 for (;(_index5>=0);((void)(--_index5))) { 192 207 ((void)((*((char *)(&(*___dst__R9sofstream_1).__separator__A0c_1[((signed long int )_index5)])))) /* ^?{} */); … … 194 209 195 210 } 211 196 212 ((void)((*___dst__R9sofstream_1).__sepCur__PCc_1) /* ^?{} */); 197 213 ((void)((*___dst__R9sofstream_1).__sawNL__b_1) /* ^?{} */); … … 208 224 ((void)((*___dst__R9sofstream_1).__sepCur__PCc_1=___src__9sofstream_1.__sepCur__PCc_1)); 209 225 { 210 signed int _index6 = ((signed int )0);226 signed int _index6 = 0; 211 227 for (;(_index6<((signed int )__sepSize__C13e__anonymous0_1));((void)(++_index6))) { 212 228 ((void)((*___dst__R9sofstream_1).__separator__A0c_1[((signed long int )_index6)]=___src__9sofstream_1.__separator__A0c_1[((signed long int )_index6)])); … … 216 232 217 233 { 218 signed int _index7 = ((signed int )0);234 signed int _index7 = 0; 219 235 for (;(_index7<((signed int )__sepSize__C13e__anonymous0_1));((void)(++_index7))) { 220 236 ((void)((*___dst__R9sofstream_1).__tupleSeparator__A0c_1[((signed long int )_index7)]=___src__9sofstream_1.__tupleSeparator__A0c_1[((signed long int )_index7)])); … … 223 239 } 224 240 225 ((void)___constructor__F_R9sofstream9sofstream_autogen___1((&___ret__9sofstream_1), ___src__9sofstream_1));226 return ((struct ofstream )___ret__9sofstream_1);241 ((void)___constructor__F_R9sofstream9sofstream_autogen___1((&___ret__9sofstream_1), (*___dst__R9sofstream_1))); 242 return ___ret__9sofstream_1; 227 243 } 228 244 static inline void ___constructor__F_R9sofstreamPv_autogen___1(struct ofstream *___dst__R9sofstream_1, void *__file__Pv_1){ … … 233 249 ((void)((*___dst__R9sofstream_1).__sepCur__PCc_1) /* ?{} */); 234 250 { 235 signed int _index8 = ((signed int )0);251 signed int _index8 = 0; 236 252 for (;(_index8<((signed int )__sepSize__C13e__anonymous0_1));((void)(++_index8))) { 237 253 ((void)((*((char *)(&(*___dst__R9sofstream_1).__separator__A0c_1[((signed long int )_index8)])))) /* ?{} */); … … 239 255 240 256 } 241 { 242 signed int _index9 = ((signed int )0); 257 258 { 259 signed int _index9 = 0; 243 260 for (;(_index9<((signed int )__sepSize__C13e__anonymous0_1));((void)(++_index9))) { 244 261 ((void)((*((char *)(&(*___dst__R9sofstream_1).__tupleSeparator__A0c_1[((signed long int )_index9)])))) /* ?{} */); … … 246 263 247 264 } 265 248 266 } 249 267 static inline void ___constructor__F_R9sofstreamPvb_autogen___1(struct ofstream *___dst__R9sofstream_1, void *__file__Pv_1, _Bool __sepDefault__b_1){ … … 254 272 ((void)((*___dst__R9sofstream_1).__sepCur__PCc_1) /* ?{} */); 255 273 { 256 signed int _index10 = ((signed int )0);274 signed int _index10 = 0; 257 275 for (;(_index10<((signed int )__sepSize__C13e__anonymous0_1));((void)(++_index10))) { 258 276 ((void)((*((char *)(&(*___dst__R9sofstream_1).__separator__A0c_1[((signed long int )_index10)])))) /* ?{} */); … … 260 278 261 279 } 262 { 263 signed int _index11 = ((signed int )0); 280 281 { 282 signed int _index11 = 0; 264 283 for (;(_index11<((signed int )__sepSize__C13e__anonymous0_1));((void)(++_index11))) { 265 284 ((void)((*((char *)(&(*___dst__R9sofstream_1).__tupleSeparator__A0c_1[((signed long int )_index11)])))) /* ?{} */); … … 267 286 268 287 } 288 269 289 } 270 290 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){ … … 275 295 ((void)((*___dst__R9sofstream_1).__sepCur__PCc_1) /* ?{} */); 276 296 { 277 signed int _index12 = ((signed int )0);297 signed int _index12 = 0; 278 298 for (;(_index12<((signed int )__sepSize__C13e__anonymous0_1));((void)(++_index12))) { 279 299 ((void)((*((char *)(&(*___dst__R9sofstream_1).__separator__A0c_1[((signed long int )_index12)])))) /* ?{} */); … … 281 301 282 302 } 283 { 284 signed int _index13 = ((signed int )0); 303 304 { 305 signed int _index13 = 0; 285 306 for (;(_index13<((signed int )__sepSize__C13e__anonymous0_1));((void)(++_index13))) { 286 307 ((void)((*((char *)(&(*___dst__R9sofstream_1).__tupleSeparator__A0c_1[((signed long int )_index13)])))) /* ?{} */); … … 288 309 289 310 } 311 290 312 } 291 313 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){ … … 296 318 ((void)((*___dst__R9sofstream_1).__sepCur__PCc_1) /* ?{} */); 297 319 { 298 signed int _index14 = ((signed int )0);320 signed int _index14 = 0; 299 321 for (;(_index14<((signed int )__sepSize__C13e__anonymous0_1));((void)(++_index14))) { 300 322 ((void)((*((char *)(&(*___dst__R9sofstream_1).__separator__A0c_1[((signed long int )_index14)])))) /* ?{} */); … … 302 324 303 325 } 304 { 305 signed int _index15 = ((signed int )0); 326 327 { 328 signed int _index15 = 0; 306 329 for (;(_index15<((signed int )__sepSize__C13e__anonymous0_1));((void)(++_index15))) { 307 330 ((void)((*((char *)(&(*___dst__R9sofstream_1).__tupleSeparator__A0c_1[((signed long int )_index15)])))) /* ?{} */); … … 309 332 310 333 } 334 311 335 } 312 336 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){ … … 317 341 ((void)((*___dst__R9sofstream_1).__sepCur__PCc_1=__sepCur__PCc_1) /* ?{} */); 318 342 { 319 signed int _index16 = ((signed int )0);343 signed int _index16 = 0; 320 344 for (;(_index16<((signed int )__sepSize__C13e__anonymous0_1));((void)(++_index16))) { 321 345 ((void)((*((char *)(&(*___dst__R9sofstream_1).__separator__A0c_1[((signed long int )_index16)])))) /* ?{} */); … … 323 347 324 348 } 325 { 326 signed int _index17 = ((signed int )0); 349 350 { 351 signed int _index17 = 0; 327 352 for (;(_index17<((signed int )__sepSize__C13e__anonymous0_1));((void)(++_index17))) { 328 353 ((void)((*((char *)(&(*___dst__R9sofstream_1).__tupleSeparator__A0c_1[((signed long int )_index17)])))) /* ?{} */); … … 330 355 331 356 } 357 332 358 } 333 359 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)]){ … … 338 364 ((void)((*___dst__R9sofstream_1).__sepCur__PCc_1=__sepCur__PCc_1) /* ?{} */); 339 365 { 340 signed int _index18 = ((signed int )0);366 signed int _index18 = 0; 341 367 for (;(_index18<((signed int )__sepSize__C13e__anonymous0_1));((void)(++_index18))) { 342 368 ((void)((*((char *)(&(*___dst__R9sofstream_1).__separator__A0c_1[((signed long int )_index18)])))=__separator__A0c_1[((signed long int )_index18)]) /* ?{} */); … … 344 370 345 371 } 346 { 347 signed int _index19 = ((signed int )0); 372 373 { 374 signed int _index19 = 0; 348 375 for (;(_index19<((signed int )__sepSize__C13e__anonymous0_1));((void)(++_index19))) { 349 376 ((void)((*((char *)(&(*___dst__R9sofstream_1).__tupleSeparator__A0c_1[((signed long int )_index19)])))) /* ?{} */); … … 351 378 352 379 } 380 353 381 } 354 382 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)]){ … … 359 387 ((void)((*___dst__R9sofstream_1).__sepCur__PCc_1=__sepCur__PCc_1) /* ?{} */); 360 388 { 361 signed int _index20 = ((signed int )0);389 signed int _index20 = 0; 362 390 for (;(_index20<((signed int )__sepSize__C13e__anonymous0_1));((void)(++_index20))) { 363 391 ((void)((*((char *)(&(*___dst__R9sofstream_1).__separator__A0c_1[((signed long int )_index20)])))=__separator__A0c_1[((signed long int )_index20)]) /* ?{} */); … … 365 393 366 394 } 367 { 368 signed int _index21 = ((signed int )0); 395 396 { 397 signed int _index21 = 0; 369 398 for (;(_index21<((signed int )__sepSize__C13e__anonymous0_1));((void)(++_index21))) { 370 399 ((void)((*((char *)(&(*___dst__R9sofstream_1).__tupleSeparator__A0c_1[((signed long int )_index21)])))=__tupleSeparator__A0c_1[((signed long int )_index21)]) /* ?{} */); … … 372 401 373 402 } 403 374 404 } 375 405 _Bool __sepPrt__Fb_P9sofstream__1(struct ofstream *__anonymous_object1294); … … 404 434 static inline void ___destructor__F_R9sifstream_autogen___1(struct ifstream *___dst__R9sifstream_1); 405 435 static 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); 406 437 static inline void ___constructor__F_R9sifstream_autogen___1(struct ifstream *___dst__R9sifstream_1){ 407 438 ((void)((*___dst__R9sifstream_1).__file__Pv_1) /* ?{} */); … … 416 447 struct ifstream ___ret__9sifstream_1; 417 448 ((void)((*___dst__R9sifstream_1).__file__Pv_1=___src__9sifstream_1.__file__Pv_1)); 418 ((void)___constructor__F_R9sifstream9sifstream_autogen___1((&___ret__9sifstream_1), ___src__9sifstream_1));419 return ((struct ifstream )___ret__9sifstream_1);449 ((void)___constructor__F_R9sifstream9sifstream_autogen___1((&___ret__9sifstream_1), (*___dst__R9sifstream_1))); 450 return ___ret__9sifstream_1; 420 451 } 421 452 static inline void ___constructor__F_R9sifstreamPv_autogen___1(struct ifstream *___dst__R9sifstream_1, void *__file__Pv_1){ … … 435 466 struct ofstream *_tmp_cp_ret2; 436 467 __attribute__ ((unused)) struct ofstream *_thunk0(struct ofstream *_p0){ 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));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)); 440 471 ((void)(_tmp_cp_ret0) /* ^?{} */); 441 472 ((void)(_tmp_cp_ret1) /* ^?{} */); … … 447 478 struct ofstream *_tmp_cp_ret5; 448 479 __attribute__ ((unused)) struct ofstream *_thunk1(struct ofstream *_p0){ 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));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)); 452 483 ((void)(_tmp_cp_ret3) /* ^?{} */); 453 484 ((void)(_tmp_cp_ret4) /* ^?{} */); … … 459 490 struct ofstream *_tmp_cp_ret8; 460 491 __attribute__ ((unused)) struct ofstream *_thunk2(struct ofstream *_p0){ 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));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)); 464 495 ((void)(_tmp_cp_ret6) /* ^?{} */); 465 496 ((void)(_tmp_cp_ret7) /* ^?{} */); … … 471 502 struct ofstream *_tmp_cp_ret11; 472 503 __attribute__ ((unused)) struct ofstream *_thunk3(struct ofstream *_p0){ 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));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)); 476 507 ((void)(_tmp_cp_ret9) /* ^?{} */); 477 508 ((void)(_tmp_cp_ret10) /* ^?{} */); … … 483 514 struct ofstream *_tmp_cp_ret14; 484 515 __attribute__ ((unused)) struct ofstream *_thunk4(struct ofstream *_p0){ 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));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)); 488 519 ((void)(_tmp_cp_ret12) /* ^?{} */); 489 520 ((void)(_tmp_cp_ret13) /* ^?{} */); … … 495 526 struct ofstream *_tmp_cp_ret17; 496 527 __attribute__ ((unused)) struct ofstream *_thunk5(struct ofstream *_p0){ 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));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)); 500 531 ((void)(_tmp_cp_ret15) /* ^?{} */); 501 532 ((void)(_tmp_cp_ret16) /* ^?{} */); … … 708 739 ((void)0123456789.e-09L); 709 740 ((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));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)); 716 747 ((void)(-0123456789.e-09)); 717 748 ((void)(-0123456789.e-09f)); … … 852 883 ((void)0123456789.0123456789E-09L); 853 884 ((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));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)); 860 891 ((void)(-0123456789.0123456789E-09)); 861 892 ((void)(-0123456789.0123456789E-09f)); … … 899 930 ((void)0x0123456789.p-09F); 900 931 ((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));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)); 906 937 ((void)(-0x0123456789.p-09)); 907 938 ((void)(-0x0123456789.p-09f)); … … 944 975 ((void)0x.0123456789P-09F); 945 976 ((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));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)); 951 982 ((void)(-0x.0123456789P-09)); 952 983 ((void)(-0x.0123456789P-09f)); … … 989 1020 ((void)0X0123456789.0123456789P-09F); 990 1021 ((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)); 991 1027 ((void)(-0X0123456789.0123456789P-09)); 992 1028 ((void)(-0X0123456789.0123456789P-09f)); … … 994 1030 ((void)(-0X0123456789.0123456789P-09F)); 995 1031 ((void)(-0X0123456789.0123456789P-09L)); 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)); 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))); 1001 1264 ((void)__f__F_c__1('a')); 1002 1265 ((void)__f__F_Sc__1(20)); … … 1111 1374 ((void)L"a" "b" "c"); 1112 1375 ((void)(___retval_main__i_1=0) /* ?{} */); 1113 return ((signed int )___retval_main__i_1);1376 return ___retval_main__i_1; 1114 1377 } 1115 1378 static inline int invoke_main(int argc, char* argv[], char* envp[]) { (void)argc; (void)argv; (void)envp; return __main__Fi___1(); } … … 1126 1389 ((void)(___retval_main__i_1=(((void)(_tmp_cp_ret0=invoke_main(__argc__i_1, __argv__PPc_1, __envp__PPc_1))) , _tmp_cp_ret0)) /* ?{} */); 1127 1390 ((void)(_tmp_cp_ret0) /* ^?{} */); 1128 return ((signed int )___retval_main__i_1);1129 } 1391 return ___retval_main__i_1; 1392 } -
src/tests/.expect/castError.txt
r78315272 r3f7e12cb 1 castError.c:7:1 error: Cannot choose between 3 alternatives for expression Cast of: 1 castError.c:7:1 error: Cannot choose between 3 alternatives for expression 2 Cast of: 2 3 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: 3 14 4 to: 5 char 6 Alternatives are: Cost ( 1, 0, 0, 0 ): Cast of: 7 Variable Expression: f: function 8 accepting unspecified arguments 9 returning 10 nothing 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: 11 35 12 36 13 to:14 char15 (types:16 char17 )18 Environment:19 20 Cost ( 1, 0, 0, 0 ): Cast of:21 Variable Expression: f: signed int22 23 to:24 char25 (types:26 char27 )28 Environment:29 30 Cost ( 1, 0, 0, 0 ): Cast of:31 Variable Expression: f: double32 33 to:34 char35 (types:36 char37 )38 Environment:39 40 -
src/tests/.expect/scopeErrors.txt
r78315272 r3f7e12cb 1 1 scopeErrors.c:2:1 error: duplicate object definition for thisIsAnError: signed int 2 2 scopeErrors.c:20:1 error: duplicate function definition for butThisIsAnError: function 3 with parameters 4 double 5 returning 6 _retval_butThisIsAnError: Attribute with name: unused 7 double 8 with body 9 CompoundStmt 3 ... with parameters 4 double 5 ... returning 6 _retval_butThisIsAnError: double 7 ... with attributes: 8 Attribute with name: unused 10 9 10 ... with body 11 CompoundStmt 12 -
src/tests/Makefile.am
r78315272 r3f7e12cb 11 11 ## Created On : Sun May 31 09:08:15 2015 12 12 ## Last Modified By : Peter A. Buhr 13 ## Last Modified On : Mon Sep 11 16:17:16201714 ## Update Count : 4 513 ## Last Modified On : Tue Oct 10 14:04:40 2017 14 ## Update Count : 47 15 15 ############################################################################### 16 16 … … 22 22 concurrent = yes 23 23 quick_test += coroutine thread monitor 24 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 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 25 45 else 26 46 concurrent=no … … 87 107 88 108 declarationSpecifier: declarationSpecifier.c @CFA_BINDIR@/@CFA_NAME@ 89 ${CC} ${AM_CFLAGS} ${CFLAGS} -CFA -XCFA -p -XCFA -L${<} -o ${@}109 ${CC} ${AM_CFLAGS} ${CFLAGS} -CFA -XCFA -p ${<} -o ${@} 90 110 91 111 gccExtensions : gccExtensions.c @CFA_BINDIR@/@CFA_NAME@ 92 ${CC} ${AM_CFLAGS} ${CFLAGS} -CFA -XCFA -p -XCFA -L${<} -o ${@}112 ${CC} ${AM_CFLAGS} ${CFLAGS} -CFA -XCFA -p ${<} -o ${@} 93 113 94 114 extension : extension.c @CFA_BINDIR@/@CFA_NAME@ 95 ${CC} ${AM_CFLAGS} ${CFLAGS} -CFA -XCFA -p -XCFA -L${<} -o ${@}115 ${CC} ${AM_CFLAGS} ${CFLAGS} -CFA -XCFA -p ${<} -o ${@} 96 116 97 117 attributes : attributes.c @CFA_BINDIR@/@CFA_NAME@ 98 ${CC} ${AM_CFLAGS} ${CFLAGS} -CFA -XCFA -p -XCFA -L${<} -o ${@}118 ${CC} ${AM_CFLAGS} ${CFLAGS} -CFA -XCFA -p ${<} -o ${@} 99 119 100 120 KRfunctions : KRfunctions.c @CFA_BINDIR@/@CFA_NAME@ 101 ${CC} ${AM_CFLAGS} ${CFLAGS} -CFA -XCFA -p -XCFA -L${<} -o ${@}121 ${CC} ${AM_CFLAGS} ${CFLAGS} -CFA -XCFA -p ${<} -o ${@} 102 122 103 123 literals : literals.c @CFA_BINDIR@/@CFA_NAME@ 104 ${CC} ${AM_CFLAGS} ${CFLAGS} -CFA -XCFA -p -XCFA -L ${<} -o ${@} 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 ${@} 105 128 106 129 gmp : gmp.c @CFA_BINDIR@/@CFA_NAME@ … … 110 133 ${CC} ${AM_CFLAGS} ${CFLAGS} -DERR1 ${<} -o ${@} 111 134 135 ctor-autogen-ERR1: ctor-autogen.c @CFA_BINDIR@/@CFA_NAME@ 136 ${CC} ${AM_CFLAGS} ${CFLAGS} -DERR1 ${<} -o ${@} 137 112 138 completeTypeError : completeTypeError.c @CFA_BINDIR@/@CFA_NAME@ 113 139 ${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
r78315272 r3f7e12cb 320 320 @BUILD_CONCURRENCY_TRUE@concurrent = yes 321 321 @BUILD_CONCURRENCY_FALSE@concurrent_test = 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 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 323 344 324 345 # applies to both programs … … 839 860 840 861 declarationSpecifier: declarationSpecifier.c @CFA_BINDIR@/@CFA_NAME@ 841 ${CC} ${AM_CFLAGS} ${CFLAGS} -CFA -XCFA -p -XCFA -L${<} -o ${@}862 ${CC} ${AM_CFLAGS} ${CFLAGS} -CFA -XCFA -p ${<} -o ${@} 842 863 843 864 gccExtensions : gccExtensions.c @CFA_BINDIR@/@CFA_NAME@ 844 ${CC} ${AM_CFLAGS} ${CFLAGS} -CFA -XCFA -p -XCFA -L${<} -o ${@}865 ${CC} ${AM_CFLAGS} ${CFLAGS} -CFA -XCFA -p ${<} -o ${@} 845 866 846 867 extension : extension.c @CFA_BINDIR@/@CFA_NAME@ 847 ${CC} ${AM_CFLAGS} ${CFLAGS} -CFA -XCFA -p -XCFA -L${<} -o ${@}868 ${CC} ${AM_CFLAGS} ${CFLAGS} -CFA -XCFA -p ${<} -o ${@} 848 869 849 870 attributes : attributes.c @CFA_BINDIR@/@CFA_NAME@ 850 ${CC} ${AM_CFLAGS} ${CFLAGS} -CFA -XCFA -p -XCFA -L${<} -o ${@}871 ${CC} ${AM_CFLAGS} ${CFLAGS} -CFA -XCFA -p ${<} -o ${@} 851 872 852 873 KRfunctions : KRfunctions.c @CFA_BINDIR@/@CFA_NAME@ 853 ${CC} ${AM_CFLAGS} ${CFLAGS} -CFA -XCFA -p -XCFA -L${<} -o ${@}874 ${CC} ${AM_CFLAGS} ${CFLAGS} -CFA -XCFA -p ${<} -o ${@} 854 875 855 876 literals : literals.c @CFA_BINDIR@/@CFA_NAME@ 856 ${CC} ${AM_CFLAGS} ${CFLAGS} -CFA -XCFA -p -XCFA -L ${<} -o ${@} 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 ${@} 857 881 858 882 gmp : gmp.c @CFA_BINDIR@/@CFA_NAME@ … … 862 886 ${CC} ${AM_CFLAGS} ${CFLAGS} -DERR1 ${<} -o ${@} 863 887 888 ctor-autogen-ERR1: ctor-autogen.c @CFA_BINDIR@/@CFA_NAME@ 889 ${CC} ${AM_CFLAGS} ${CFLAGS} -DERR1 ${<} -o ${@} 890 864 891 completeTypeError : completeTypeError.c @CFA_BINDIR@/@CFA_NAME@ 892 ${CC} ${AM_CFLAGS} ${CFLAGS} -DERR1 ${<} -o ${@} 893 894 typedefRedef-ERR1: typedefRedef.c @CFA_BINDIR@/@CFA_NAME@ 865 895 ${CC} ${AM_CFLAGS} ${CFLAGS} -DERR1 ${<} -o ${@} 866 896 -
src/tests/coroutine.c
r78315272 r3f7e12cb 10 10 // Created On : Thu Jun 8 07:29:37 2017 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Thu Jun 8 07:37:12201713 // Update Count : 512 // Last Modified On : Sun Sep 17 21:38:15 2017 13 // Update Count : 7 14 14 // 15 15 … … 18 18 19 19 coroutine Fibonacci { 20 int fn; // used for communication20 int fn; // used for communication 21 21 }; 22 22 … … 26 26 27 27 void main( Fibonacci & this ) { 28 int fn1, fn2; // retained between resumes29 this.fn = 0; // case 028 int fn1, fn2; // retained between resumes 29 this.fn = 0; // case 0 30 30 fn1 = this.fn; 31 suspend(); // return tolast resume31 suspend(); // restart last resume 32 32 33 this.fn = 1; // case 1 34 fn2 = fn1; 35 fn1 = this.fn; 36 suspend(); // return to last resume 33 this.fn = 1; // case 1 34 fn2 = fn1; fn1 = this.fn; 35 suspend(); // restart last resume 37 36 38 for ( ;; ) { // general case37 for ( ;; ) { // general case 39 38 this.fn = fn1 + fn2; 40 fn2 = fn1; 41 fn1 = this.fn; 42 suspend(); // return to last resume 39 fn2 = fn1; fn1 = this.fn; 40 suspend(); // restart last resume 43 41 } // for 44 42 } 45 43 46 44 int next( Fibonacci & this ) { 47 resume( this ); // transfer tolast suspend45 resume( this ); // restart last suspend 48 46 return this.fn; 49 47 } … … 52 50 Fibonacci f1, f2; 53 51 for ( int i = 1; i <= 10; i += 1 ) { 54 sout | next( f1 ) | ' ' |next( f2 ) | endl;52 sout | next( f1 ) | next( f2 ) | endl; 55 53 } // for 56 54 } -
src/tests/fmtLines.c
r78315272 r3f7e12cb 10 10 // Created On : Sun Sep 17 21:56:15 2017 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Mon Sep 18 11:35:57201713 // Update Count : 3 112 // Last Modified On : Sun Oct 1 11:57:19 2017 13 // Update Count : 34 14 14 // 15 15 … … 23 23 24 24 void ?{}( Format & fmt ) { 25 resume( fmt ); // startcoroutine25 resume( fmt ); // prime (start) coroutine 26 26 } 27 27 28 28 void ^?{}( Format & fmt ) { 29 29 if ( fmt.g != 0 || fmt.b != 0 ) sout | endl; 30 30 } 31 31 … … 47 47 48 48 void prt( Format & fmt, char ch ) { 49 50 49 fmt.ch = ch; 50 resume( fmt ); 51 51 } // prt 52 52 53 53 int main() { 54 Format fmt; 54 Format fmt; // format characters into blocks of 4 and groups of 5 blocks per line 55 55 char ch; 56 56 57 for ( ;; ) {57 Eof: for ( ;; ) { // read until end of file 58 58 sin | ch; // read one character 59 if ( eof( sin ) ) break ;// eof ?60 prt( fmt, ch ); 59 if ( eof( sin ) ) break Eof; // eof ? 60 prt( fmt, ch ); // push character for formatting 61 61 } // for 62 62 } // main -
src/tests/gmp.c
r78315272 r3f7e12cb 10 10 // Created On : Tue Apr 19 08:55:51 2016 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Mon Sep 4 09:51:18201713 // Update Count : 55 012 // Last Modified On : Thu Sep 28 18:33:51 2017 13 // Update Count : 555 14 14 // 15 15 … … 97 97 98 98 sout | "Factorial Numbers" | endl; 99 Int fact; 100 fact = 1; // 1st case 99 Int fact = 1; // 1st case 101 100 sout | (int)0 | fact | endl; 102 101 for ( unsigned int i = 1; i <= 40; i += 1 ) { -
src/tests/literals.c
r78315272 r3f7e12cb 10 10 // Created On : Sat Sep 9 16:34:38 2017 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Tue Sep 12 07:45:46201713 // Update Count : 8812 // Last Modified On : Mon Sep 25 20:26:00 2017 13 // Update Count : 132 14 14 // 15 15 16 16 #ifdef __CFA__ 17 #include <stdint.h> 17 18 #include <fstream> 18 19 … … 72 73 73 74 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;75 +0123456789.e-09; +0123456789.e-09f; +0123456789.e-09l; +0123456789.e-09F; +0123456789.e-09L; +0123456789.e-09DL; 75 76 -0123456789.e-09; -0123456789.e-09f; -0123456789.e-09l; -0123456789.e-09F; -0123456789.e-09L; -0123456789.e-09DL; 76 77 … … 104 105 105 106 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;107 +0123456789.0123456789E-09; +0123456789.0123456789E-09f; +0123456789.0123456789E-09l; +0123456789.0123456789E-09F; +0123456789.0123456789E-09L; +0123456789.0123456789E-09DL; 107 108 -0123456789.0123456789E-09; -0123456789.0123456789E-09f; -0123456789.0123456789E-09l; -0123456789.0123456789E-09F; -0123456789.0123456789E-09L; -0123456789.0123456789E-09DL; 108 109 … … 118 119 119 120 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;121 +0x0123456789.p-09; +0x0123456789.p-09f; +0x0123456789.p-09l; +0x0123456789.p-09F; +0x0123456789.p-09L; 121 122 -0x0123456789.p-09; -0x0123456789.p-09f; -0x0123456789.p-09l; -0x0123456789.p-09F; -0x0123456789.p-09L; 122 123 … … 130 131 131 132 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;133 +0x.0123456789P-09; +0x.0123456789P-09f; +0x.0123456789P-09l; +0x.0123456789P-09F; +0x.0123456789P-09L; 133 134 -0x.0123456789P-09; -0x.0123456789P-09f; -0x.0123456789P-09l; -0x.0123456789P-09F; -0x.0123456789P-09L; 134 135 … … 142 143 143 144 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; 144 146 -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; 147 148 #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; 146 203 147 204 // char, short, int suffix overloading 148 205 149 #ifdef __CFA__150 206 f( 'a' ); 151 207 f( 20_hh ); -
src/tests/prodcons.c
r78315272 r3f7e12cb 10 10 // Created On : Mon Sep 18 12:23:39 2017 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Wed Sep 20 17:03:28201713 // Update Count : 4 012 // Last Modified On : Mon Oct 30 23:06:05 2017 13 // Update Count : 42 14 14 // 15 15 16 16 #include <fstream> 17 17 #include <coroutine> 18 #include <stdlib> // rand 4818 #include <stdlib> // random 19 19 #include <unistd.h> // getpid 20 20 … … 30 30 // 1st resume starts here 31 31 for ( int i = 0; i < prod.N; i += 1 ) { 32 int p1 = (unsigned int)rand48() % 100; // non-negative33 int p2 = (unsigned int)rand48() % 100;32 int p1 = random( 100 ); 33 int p2 = random( 100 ); 34 34 sout | p1 | " " | p2 | endl; 35 35 int status = delivery( *prod.c, p1, p2 ); … … 90 90 Prod prod; 91 91 Cons cons = { prod }; 92 rand 48seed( /* getpid() */ 103 ); // fixed seed for testing92 random_seed( /* getpid() */ 103 ); // fixed seed for testing 93 93 start( prod, 5, cons ); 94 94 sout | "main stops" | endl; -
src/tests/random.c
r78315272 r3f7e12cb 10 10 // Created On : Tue Jul 5 21:29:30 2016 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Wed Jul 6 18:00:29 201613 // Update Count : 312 // Last Modified On : Mon Oct 30 23:06:49 2017 13 // Update Count : 6 14 14 // 15 15 … … 19 19 20 20 int main() { 21 // rand48seed( getpid() ); // set random seed22 rand 48seed( 1003 );// fixed seed for repeatable tests21 //srandom( getpid() ); // set random seed 22 random_seed( 1003 ); // fixed seed for repeatable tests 23 23 24 24 // test polymorphic calls to random and stream 25 char c = rand 48();25 char c = random(); 26 26 sout | c | endl; 27 int i = rand 48();27 int i = random(); 28 28 sout | i | endl; 29 unsigned int ui = rand 48();29 unsigned int ui = random(); 30 30 sout | ui | endl; 31 long int li = rand 48();31 long int li = random(); 32 32 sout | li | endl; 33 unsigned long int uli = rand 48();33 unsigned long int uli = random(); 34 34 sout | uli | endl; 35 float f = rand 48();35 float f = random(); 36 36 sout | f | endl; 37 double d = rand 48();37 double d = random(); 38 38 sout | d | endl; 39 float _Complex fc = rand 48();39 float _Complex fc = random(); 40 40 sout | fc | endl; 41 double _Complex dc = rand 48();41 double _Complex dc = random(); 42 42 sout | dc | endl; 43 long double _Complex ldc = rand 48();43 long double _Complex ldc = random(); 44 44 sout | ldc | endl; 45 45 } // main -
src/tests/rational.c
r78315272 r3f7e12cb 10 10 // Created On : Mon Mar 28 08:43:12 2016 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Wed Aug 23 21:40:11201713 // Update Count : 6 612 // Last Modified On : Tue Oct 10 23:25:04 2017 13 // Update Count : 67 14 14 // 15 15 -
src/tests/sched-ext-parse.c
r78315272 r3f7e12cb 1 //---------------------------------------------------------------------------------------- 2 //---------------------------------------------------------------------------------------- 3 // 4 // DEPRECATED TEST 5 // DIFFERS BETWEEN DEBUG AND RELEASE 6 // 7 //---------------------------------------------------------------------------------------- 8 //---------------------------------------------------------------------------------------- 9 1 10 #include <monitor> 2 11 … … 80 89 16; 81 90 } 82 or waitfor( f 1, a, a ) {91 or waitfor( f2, a, a ) { 83 92 17; 84 93 } -
src/tests/sched-ext.c
r78315272 r3f7e12cb 26 26 volatile bool done; 27 27 28 unsigned rand10() {29 return (unsigned)rand48() % 10;30 }31 32 28 //---------------------------------------------------------------------------------------------------- 33 29 // Acceptor … … 36 32 void do_wait( global_t * mutex a ) { 37 33 sout | "Waiting to accept" | endl; 38 yield( rand 10() );34 yield( random( 10 ) ); 39 35 40 36 sout | "Accepting" | endl; … … 45 41 acceptable.monitors = &a; 46 42 47 __ accept_internal( 1, &acceptable );43 __waitfor_internal( 1, &acceptable ); 48 44 49 45 sout | "Accepted" | endl; 50 yield( rand 10() );46 yield( random( 10 ) ); 51 47 } 52 48 … … 68 64 void main( Acceptee* this ) { 69 65 while( !done ) { 70 yield( rand 10() );66 yield( random( 10 ) ); 71 67 do_notify( &globalA ); 72 yield( rand 10() );68 yield( random( 10 ) ); 73 69 } 74 70 } … … 78 74 int main(int argc, char* argv[]) { 79 75 done = false; 80 rand 48seed( time( NULL ) );76 random_seed( time( NULL ) ); 81 77 printf("%p\n", &globalA); 82 78 sout | "Starting" | endl; -
src/tests/sched-int-barge.c
r78315272 r3f7e12cb 1 //---------------------------------------------------------------------------------------- 2 //---------------------------------------------------------------------------------------- 3 // 4 // DEPRECATED TEST 5 // 6 //---------------------------------------------------------------------------------------- 7 //---------------------------------------------------------------------------------------- 8 1 9 #include <fstream> 2 10 #include <kernel> … … 56 64 57 65 if( action == 0 ) { 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);66 c.do_signal = max( random( 10 ), 1); 67 c.do_wait1 = random( c.do_signal ); 68 c.do_wait2 = random( c.do_signal ); 61 69 62 70 if(c.do_wait1 == c.do_wait2) sout | "Same" | endl; … … 65 73 if( action == c.do_wait1 || action == c.do_wait2 ) { 66 74 c.state = WAIT; 67 wait( &cond );75 wait( cond ); 68 76 69 77 if(c.state != SIGNAL) { … … 75 83 c.state = SIGNAL; 76 84 77 signal( &cond );78 signal( &cond );85 signal( cond ); 86 signal( cond ); 79 87 } 80 88 else { … … 101 109 102 110 int main(int argc, char* argv[]) { 103 rand 48seed(0);111 random_seed(0); 104 112 processor p; 105 113 { -
src/tests/sched-int-block.c
r78315272 r3f7e12cb 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 1 9 #include <fstream> 2 10 #include <kernel> … … 39 47 //------------------------------------------------------------------------------ 40 48 void wait_op( global_data_t & mutex a, global_data_t & mutex b, unsigned i ) { 41 wait( &cond, (uintptr_t)this_thread );49 wait( cond, (uintptr_t)this_thread ); 42 50 43 yield( ((unsigned)rand48()) % 10);51 yield( random( 10 ) ); 44 52 45 53 if(a.last_thread != a.last_signaller || b.last_thread != b.last_signaller ) { … … 50 58 a.last_thread = b.last_thread = this_thread; 51 59 52 yield( ((unsigned)rand48()) % 10);60 yield( random( 10 ) ); 53 61 } 54 62 … … 62 70 //------------------------------------------------------------------------------ 63 71 void signal_op( global_data_t & mutex a, global_data_t & mutex b ) { 64 yield( ((unsigned)rand48()) % 10);72 yield( random( 10 ) ); 65 73 66 74 [a.last_thread, b.last_thread, a.last_signaller, b.last_signaller] = this_thread; 67 75 68 if( !is_empty( &cond ) ) {76 if( !is_empty( cond ) ) { 69 77 70 thread_desc * next = front( &cond );78 thread_desc * next = front( cond ); 71 79 72 if( ! signal_block( &cond ) ) {80 if( ! signal_block( cond ) ) { 73 81 sout | "ERROR expected to be able to signal" | endl; 74 82 abort(); 75 83 } 76 84 77 yield( ((unsigned)rand48()) % 10);85 yield( random( 10 ) ); 78 86 79 87 if(a.last_thread != next || b.last_thread != next) { … … 110 118 111 119 int main(int argc, char* argv[]) { 112 rand 48seed( time( NULL ) );120 random_seed( time( NULL ) ); 113 121 done = false; 114 122 processor p; -
src/tests/sched-int-disjoint.c
r78315272 r3f7e12cb 59 59 // Waiting logic 60 60 bool wait( global_t & mutex m, global_data_t & mutex d ) { 61 wait( &cond );61 wait( cond ); 62 62 if( d.state != SIGNAL ) { 63 63 sout | "ERROR barging!" | endl; … … 80 80 //------------------------------------------------------------------------------ 81 81 // Signalling logic 82 void signal( condition *cond, global_t & mutex a, global_data_t & mutex b ) {82 void signal( condition & cond, global_t & mutex a, global_data_t & mutex b ) { 83 83 b.state = SIGNAL; 84 84 signal( cond ); … … 86 86 87 87 void logic( global_t & mutex a ) { 88 signal( &cond, a, data );88 signal( cond, a, data ); 89 89 90 yield( (unsigned)rand48() % 10);90 yield( random( 10 ) ); 91 91 92 92 //This is technically a mutual exclusion violation but the mutex monitor protects us … … 109 109 // Main loop 110 110 int main(int argc, char* argv[]) { 111 rand 48seed( time( NULL ) );111 random_seed( time( NULL ) ); 112 112 all_done = false; 113 113 processor p; -
src/tests/sched-int-wait.c
r78315272 r3f7e12cb 1 //--------------------------------------------------------- 2 // Multi wait test 3 // Ensures that no deadlock from waiting/signalling conditions 4 //--------------------------------------------------------- 5 6 1 7 #include <fstream> 2 8 #include <kernel> … … 35 41 //---------------------------------------------------------------------------------------------------- 36 42 // Tools 37 void signal( condition *cond, global_t & mutex a, global_t & mutex b ) {43 void signal( condition & cond, global_t & mutex a, global_t & mutex b ) { 38 44 signal( cond ); 39 45 } 40 46 41 void signal( condition *cond, global_t & mutex a, global_t & mutex b, global_t & mutex c ) {47 void signal( condition & cond, global_t & mutex a, global_t & mutex b, global_t & mutex c ) { 42 48 signal( cond ); 43 49 } 44 50 45 void wait( condition *cond, global_t & mutex a, global_t & mutex b ) {51 void wait( condition & cond, global_t & mutex a, global_t & mutex b ) { 46 52 wait( cond ); 47 53 } 48 54 49 void wait( condition *cond, global_t & mutex a, global_t & mutex b, global_t & mutex c ) {55 void wait( condition & cond, global_t & mutex a, global_t & mutex b, global_t & mutex c ) { 50 56 wait( cond ); 51 57 } … … 56 62 57 63 while( waiter_left != 0 ) { 58 unsigned action = (unsigned)rand48() % 4;64 unsigned action = random( 4 ); 59 65 switch( action ) { 60 66 case 0: 61 signal( &condABC, globalA, globalB, globalC );67 signal( condABC, globalA, globalB, globalC ); 62 68 break; 63 69 case 1: 64 signal( &condAB , globalA, globalB );70 signal( condAB , globalA, globalB ); 65 71 break; 66 72 case 2: 67 signal( &condBC , globalB, globalC );73 signal( condBC , globalB, globalC ); 68 74 break; 69 75 case 3: 70 signal( &condAC , globalA, globalC );76 signal( condAC , globalA, globalC ); 71 77 break; 72 78 default: … … 82 88 void main( WaiterABC & this ) { 83 89 for( int i = 0; i < N; i++ ) { 84 wait( &condABC, globalA, globalB, globalC );90 wait( condABC, globalA, globalB, globalC ); 85 91 } 86 92 … … 92 98 void main( WaiterAB & this ) { 93 99 for( int i = 0; i < N; i++ ) { 94 wait( &condAB , globalA, globalB );100 wait( condAB , globalA, globalB ); 95 101 } 96 102 … … 102 108 void main( WaiterAC & this ) { 103 109 for( int i = 0; i < N; i++ ) { 104 wait( &condAC , globalA, globalC );110 wait( condAC , globalA, globalC ); 105 111 } 106 112 … … 112 118 void main( WaiterBC & this ) { 113 119 for( int i = 0; i < N; i++ ) { 114 wait( &condBC , globalB, globalC );120 wait( condBC , globalB, globalC ); 115 121 } 116 122 … … 121 127 // Main 122 128 int main(int argc, char* argv[]) { 123 rand 48seed( time( NULL ) );129 random_seed( time( NULL ) ); 124 130 waiter_left = 4; 125 131 processor p[2]; -
src/tests/thread.c
r78315272 r3f7e12cb 15 15 yield(); 16 16 } 17 V( this.lock);17 V(*this.lock); 18 18 } 19 19 20 20 void main(Second& this) { 21 P( this.lock);21 P(*this.lock); 22 22 for(int i = 0; i < 10; i++) { 23 23 sout | "Second : Suspend No." | i + 1 | endl;
Note:
See TracChangeset
for help on using the changeset viewer.