Changes in / [3f7e12cb:78315272]
- Files:
-
- 23 added
- 70 deleted
- 187 edited
-
.gitignore (modified) (1 diff)
-
configure (modified) (2 diffs)
-
configure.ac (modified) (1 diff)
-
doc/LaTeXmacros/lstlang.sty (modified) (2 diffs)
-
doc/proposals/concurrency/.gitignore (modified) (1 diff)
-
doc/proposals/concurrency/Makefile (modified) (3 diffs)
-
doc/proposals/concurrency/annex/glossary.tex (modified) (2 diffs)
-
doc/proposals/concurrency/figures/dependency.fig (deleted)
-
doc/proposals/concurrency/figures/ext_monitor.fig (modified) (5 diffs)
-
doc/proposals/concurrency/figures/int_monitor.fig.bak (added)
-
doc/proposals/concurrency/figures/system.fig (deleted)
-
doc/proposals/concurrency/style/cfa-format.tex (modified) (5 diffs)
-
doc/proposals/concurrency/text/basics.tex (modified) (14 diffs)
-
doc/proposals/concurrency/text/cforall.tex (modified) (2 diffs)
-
doc/proposals/concurrency/text/concurrency.tex (modified) (27 diffs)
-
doc/proposals/concurrency/text/future.tex (deleted)
-
doc/proposals/concurrency/text/internals.tex (deleted)
-
doc/proposals/concurrency/text/intro.tex (modified) (1 diff)
-
doc/proposals/concurrency/text/parallelism.tex (modified) (1 diff)
-
doc/proposals/concurrency/text/results.tex (deleted)
-
doc/proposals/concurrency/text/together.tex (deleted)
-
doc/proposals/concurrency/thesis.tex (modified) (5 diffs)
-
doc/proposals/concurrency/version (modified) (1 diff)
-
src/CodeGen/CodeGenerator.cc (modified) (13 diffs)
-
src/CodeGen/CodeGenerator.h (modified) (1 diff)
-
src/CodeGen/FixNames.cc (modified) (1 diff)
-
src/CodeGen/GenType.cc (modified) (1 diff)
-
src/Common/Indenter.h (modified) (2 diffs)
-
src/Common/PassVisitor.h (modified) (4 diffs)
-
src/Common/PassVisitor.impl.h (modified) (112 diffs)
-
src/Common/PassVisitor.proto.h (modified) (1 diff)
-
src/Common/utility.h (modified) (5 diffs)
-
src/Concurrency/Keywords.cc (modified) (9 diffs)
-
src/Concurrency/Waitfor.cc (modified) (20 diffs)
-
src/GenPoly/Box.cc (modified) (40 diffs)
-
src/GenPoly/CopyParams.cc (added)
-
src/GenPoly/CopyParams.h (added)
-
src/GenPoly/DeclMutator.cc (added)
-
src/GenPoly/DeclMutator.h (added)
-
src/GenPoly/FindFunction.cc (modified) (6 diffs)
-
src/GenPoly/GenPoly.cc (modified) (1 diff)
-
src/GenPoly/GenPoly.h (modified) (1 diff)
-
src/GenPoly/InstantiateGeneric.cc (modified) (2 diffs)
-
src/GenPoly/PolyMutator.cc (added)
-
src/GenPoly/PolyMutator.h (added)
-
src/GenPoly/ScrubTyVars.cc (modified) (1 diff)
-
src/GenPoly/Specialize.cc (modified) (12 diffs)
-
src/GenPoly/module.mk (modified) (2 diffs)
-
src/InitTweak/FixInit.cc (modified) (38 diffs)
-
src/InitTweak/GenInit.cc (modified) (19 diffs)
-
src/InitTweak/GenInit.h (modified) (2 diffs)
-
src/InitTweak/InitTweak.cc (modified) (14 diffs)
-
src/InitTweak/InitTweak.h (modified) (2 diffs)
-
src/MakeLibCfa.cc (modified) (3 diffs)
-
src/Makefile.in (modified) (13 diffs)
-
src/Parser/DeclarationNode.cc (modified) (3 diffs)
-
src/Parser/ExpressionNode.cc (modified) (11 diffs)
-
src/Parser/ParseNode.h (modified) (3 diffs)
-
src/Parser/StatementNode.cc (modified) (4 diffs)
-
src/Parser/TypeData.cc (modified) (29 diffs)
-
src/Parser/lex.ll (modified) (6 diffs)
-
src/Parser/parser.yy (modified) (19 diffs)
-
src/Parser/parserutility.cc (modified) (1 diff)
-
src/ResolvExpr/AdjustExprType.cc (modified) (5 diffs)
-
src/ResolvExpr/Alternative.cc (modified) (1 diff)
-
src/ResolvExpr/Alternative.h (modified) (1 diff)
-
src/ResolvExpr/AlternativeFinder.cc (modified) (24 diffs)
-
src/ResolvExpr/AlternativeFinder.h (modified) (4 diffs)
-
src/ResolvExpr/CastCost.cc (modified) (2 diffs)
-
src/ResolvExpr/CommonType.cc (modified) (4 diffs)
-
src/ResolvExpr/ConversionCost.cc (modified) (13 diffs)
-
src/ResolvExpr/CurrentObject.cc (modified) (1 diff)
-
src/ResolvExpr/PolyCost.cc (modified) (3 diffs)
-
src/ResolvExpr/PtrsAssignable.cc (modified) (6 diffs)
-
src/ResolvExpr/PtrsCastable.cc (modified) (4 diffs)
-
src/ResolvExpr/ResolveTypeof.cc (modified) (3 diffs)
-
src/ResolvExpr/Resolver.cc (modified) (20 diffs)
-
src/ResolvExpr/Resolver.h (modified) (1 diff)
-
src/ResolvExpr/TypeEnvironment.cc (modified) (3 diffs)
-
src/ResolvExpr/TypeEnvironment.h (modified) (2 diffs)
-
src/ResolvExpr/Unify.cc (modified) (7 diffs)
-
src/SymTab/Autogen.cc (modified) (16 diffs)
-
src/SymTab/Autogen.h (modified) (10 diffs)
-
src/SymTab/FixFunction.cc (modified) (1 diff)
-
src/SymTab/FixFunction.h (modified) (1 diff)
-
src/SymTab/Indexer.cc (modified) (5 diffs)
-
src/SymTab/Indexer.h (modified) (3 diffs)
-
src/SymTab/Mangler.cc (modified) (17 diffs)
-
src/SymTab/Mangler.h (modified) (3 diffs)
-
src/SymTab/Validate.cc (modified) (13 diffs)
-
src/SynTree/AddStmtVisitor.cc (added)
-
src/SynTree/AddStmtVisitor.h (added)
-
src/SynTree/AddressExpr.cc (modified) (4 diffs)
-
src/SynTree/AggregateDecl.cc (modified) (1 diff)
-
src/SynTree/ApplicationExpr.cc (modified) (2 diffs)
-
src/SynTree/ArrayType.cc (modified) (1 diff)
-
src/SynTree/AttrType.cc (modified) (2 diffs)
-
src/SynTree/Attribute.cc (modified) (2 diffs)
-
src/SynTree/Attribute.h (modified) (2 diffs)
-
src/SynTree/BaseSyntaxNode.h (modified) (2 diffs)
-
src/SynTree/BasicType.cc (modified) (3 diffs)
-
src/SynTree/CommaExpr.cc (modified) (2 diffs)
-
src/SynTree/CompoundStmt.cc (modified) (2 diffs)
-
src/SynTree/Constant.cc (modified) (2 diffs)
-
src/SynTree/Constant.h (modified) (5 diffs)
-
src/SynTree/DeclStmt.cc (modified) (1 diff)
-
src/SynTree/Declaration.cc (modified) (3 diffs)
-
src/SynTree/Declaration.h (modified) (17 diffs)
-
src/SynTree/Expression.cc (modified) (30 diffs)
-
src/SynTree/Expression.h (modified) (58 diffs)
-
src/SynTree/FunctionDecl.cc (modified) (4 diffs)
-
src/SynTree/FunctionType.cc (modified) (2 diffs)
-
src/SynTree/Initializer.cc (modified) (4 diffs)
-
src/SynTree/Initializer.h (modified) (6 diffs)
-
src/SynTree/Mutator.cc (modified) (4 diffs)
-
src/SynTree/Mutator.h (modified) (1 diff)
-
src/SynTree/NamedTypeDecl.cc (modified) (2 diffs)
-
src/SynTree/ObjectDecl.cc (modified) (3 diffs)
-
src/SynTree/PointerType.cc (modified) (1 diff)
-
src/SynTree/ReferenceToType.cc (modified) (10 diffs)
-
src/SynTree/ReferenceType.cc (modified) (1 diff)
-
src/SynTree/Statement.cc (modified) (18 diffs)
-
src/SynTree/Statement.h (modified) (22 diffs)
-
src/SynTree/TupleExpr.cc (modified) (5 diffs)
-
src/SynTree/TupleType.cc (modified) (1 diff)
-
src/SynTree/Type.cc (modified) (5 diffs)
-
src/SynTree/Type.h (modified) (22 diffs)
-
src/SynTree/TypeDecl.cc (modified) (2 diffs)
-
src/SynTree/TypeExpr.cc (modified) (1 diff)
-
src/SynTree/TypeSubstitution.cc (modified) (5 diffs)
-
src/SynTree/TypeSubstitution.h (modified) (2 diffs)
-
src/SynTree/TypeofType.cc (modified) (2 diffs)
-
src/SynTree/VarArgsType.cc (modified) (1 diff)
-
src/SynTree/VarExprReplacer.h (modified) (2 diffs)
-
src/SynTree/Visitor.cc (modified) (4 diffs)
-
src/SynTree/Visitor.h (modified) (1 diff)
-
src/SynTree/VoidType.cc (modified) (2 diffs)
-
src/SynTree/ZeroOneType.cc (modified) (2 diffs)
-
src/SynTree/module.mk (modified) (1 diff)
-
src/Tuples/TupleAssignment.cc (modified) (3 diffs)
-
src/Tuples/TupleExpansion.cc (modified) (2 diffs)
-
src/benchmark/CorCtxSwitch.c (added)
-
src/benchmark/Makefile.am (modified) (2 diffs)
-
src/benchmark/Makefile.in (modified) (12 diffs)
-
src/benchmark/SchedInt.c (added)
-
src/benchmark/ThrdCtxSwitch.c (added)
-
src/benchmark/bench.h (modified) (2 diffs)
-
src/benchmark/create_cfaCor.c (added)
-
src/benchmark/create_cfaThrd.c (added)
-
src/benchmark/create_pthrd.c (added)
-
src/benchmark/create_uCor.cpp (added)
-
src/benchmark/create_uTask.cpp (added)
-
src/benchmark/creation/cfa_cor.c (deleted)
-
src/benchmark/creation/cfa_thrd.c (deleted)
-
src/benchmark/creation/pthreads.c (deleted)
-
src/benchmark/creation/upp_cor.cc (deleted)
-
src/benchmark/creation/upp_thrd.cc (deleted)
-
src/benchmark/csv-data.c (modified) (4 diffs)
-
src/benchmark/ctxswitch/cfa_cor.c (deleted)
-
src/benchmark/ctxswitch/cfa_thrd.c (deleted)
-
src/benchmark/ctxswitch/pthreads.c (deleted)
-
src/benchmark/ctxswitch/upp_cor.cc (deleted)
-
src/benchmark/ctxswitch/upp_thrd.cc (deleted)
-
src/benchmark/mutex/cfa1.c (deleted)
-
src/benchmark/mutex/cfa2.c (deleted)
-
src/benchmark/mutex/cfa4.c (deleted)
-
src/benchmark/mutex/function.c (deleted)
-
src/benchmark/mutex/pthreads.c (deleted)
-
src/benchmark/mutex/upp.cc (deleted)
-
src/benchmark/schedext/cfa1.c (deleted)
-
src/benchmark/schedext/cfa2.c (deleted)
-
src/benchmark/schedext/cfa4.c (deleted)
-
src/benchmark/schedext/upp.cc (deleted)
-
src/benchmark/schedint/cfa1.c (deleted)
-
src/benchmark/schedint/cfa2.c (deleted)
-
src/benchmark/schedint/cfa4.c (deleted)
-
src/benchmark/schedint/upp.cc (deleted)
-
src/benchmark/stat.py (added)
-
src/driver/cfa.cc (modified) (3 diffs)
-
src/examples/sum.c (added)
-
src/include/cassert (modified) (1 diff)
-
src/libcfa/Makefile.am (modified) (1 diff)
-
src/libcfa/Makefile.in (modified) (2 diffs)
-
src/libcfa/bits/algorithms.h (deleted)
-
src/libcfa/concurrency/coroutine.c (modified) (2 diffs)
-
src/libcfa/concurrency/invoke.h (modified) (2 diffs)
-
src/libcfa/concurrency/kernel (modified) (4 diffs)
-
src/libcfa/concurrency/kernel.c (modified) (16 diffs)
-
src/libcfa/concurrency/kernel_private.h (modified) (1 diff)
-
src/libcfa/concurrency/monitor (modified) (6 diffs)
-
src/libcfa/concurrency/monitor.c (modified) (31 diffs)
-
src/libcfa/concurrency/preemption.c (modified) (3 diffs)
-
src/libcfa/concurrency/thread (modified) (1 diff)
-
src/libcfa/concurrency/thread.c (modified) (1 diff)
-
src/libcfa/interpose.c (modified) (1 diff)
-
src/libcfa/iostream (modified) (2 diffs)
-
src/libcfa/iostream.c (modified) (3 diffs)
-
src/libcfa/libhdr/libdebug.c (modified) (6 diffs)
-
src/libcfa/libhdr/libdebug.h (modified) (3 diffs)
-
src/libcfa/stdlib (modified) (3 diffs)
-
src/libcfa/stdlib.c (modified) (2 diffs)
-
src/main.cc (modified) (11 diffs)
-
src/prelude/Makefile.am (modified) (1 diff)
-
src/prelude/Makefile.in (modified) (1 diff)
-
src/prelude/extras.c (modified) (1 diff)
-
src/prelude/extras.regx (modified) (1 diff)
-
src/prelude/prelude.cf (modified) (11 diffs)
-
src/tests/.expect/32/KRfunctions.txt (modified) (3 diffs)
-
src/tests/.expect/32/attributes.txt (modified) (21 diffs)
-
src/tests/.expect/32/declarationSpecifier.txt (modified) (50 diffs)
-
src/tests/.expect/32/extension.txt (modified) (5 diffs)
-
src/tests/.expect/32/gccExtensions.txt (modified) (7 diffs)
-
src/tests/.expect/32/literals.txt (modified) (57 diffs)
-
src/tests/.expect/64/KRfunctions.txt (modified) (3 diffs)
-
src/tests/.expect/64/attributes.txt (modified) (21 diffs)
-
src/tests/.expect/64/declarationSpecifier.txt (modified) (50 diffs)
-
src/tests/.expect/64/extension.txt (modified) (5 diffs)
-
src/tests/.expect/64/gccExtensions.txt (modified) (7 diffs)
-
src/tests/.expect/64/literals.txt (modified) (57 diffs)
-
src/tests/.expect/castError.txt (modified) (1 diff)
-
src/tests/.expect/concurrent/boundedBuffer.txt (deleted)
-
src/tests/.expect/concurrent/datingService.txt (deleted)
-
src/tests/.expect/concurrent/fmtLines.txt (deleted)
-
src/tests/.expect/concurrent/matrixSum.txt (deleted)
-
src/tests/.expect/concurrent/pingpong.txt (deleted)
-
src/tests/.expect/concurrent/prodcons.txt (deleted)
-
src/tests/.expect/concurrent/sched-ext-barge.txt (deleted)
-
src/tests/.expect/concurrent/sched-ext-dtor.txt (deleted)
-
src/tests/.expect/concurrent/sched-ext-else.txt (deleted)
-
src/tests/.expect/concurrent/sched-ext-recurse.txt (deleted)
-
src/tests/.expect/concurrent/sched-ext-statment.txt (deleted)
-
src/tests/.expect/concurrent/sched-ext-when.txt (deleted)
-
src/tests/.expect/ctor-autogen-ERR1.txt (deleted)
-
src/tests/.expect/ctor-autogen.txt (deleted)
-
src/tests/.expect/fmtLines.txt (added)
-
src/tests/.expect/pingpong.txt (added)
-
src/tests/.expect/polymorphism.txt (deleted)
-
src/tests/.expect/prodcons.txt (added)
-
src/tests/.expect/references.txt (deleted)
-
src/tests/.expect/scopeErrors.txt (modified) (1 diff)
-
src/tests/.expect/sum.txt (deleted)
-
src/tests/.expect/typedefRedef-ERR1.txt (deleted)
-
src/tests/.expect/typedefRedef.txt (deleted)
-
src/tests/Makefile.am (modified) (4 diffs)
-
src/tests/Makefile.in (modified) (3 diffs)
-
src/tests/boundedBuffer.c (deleted)
-
src/tests/coroutine.c (modified) (4 diffs)
-
src/tests/ctor-autogen.c (deleted)
-
src/tests/datingService.c (deleted)
-
src/tests/fmtLines.c (modified) (3 diffs)
-
src/tests/gmp.c (modified) (2 diffs)
-
src/tests/literals.c (modified) (6 diffs)
-
src/tests/matrixSum.c (deleted)
-
src/tests/polymorphism.c (deleted)
-
src/tests/prodcons.c (modified) (3 diffs)
-
src/tests/random.c (modified) (2 diffs)
-
src/tests/rational.c (modified) (1 diff)
-
src/tests/references.c (deleted)
-
src/tests/sched-ext-barge.c (deleted)
-
src/tests/sched-ext-dtor.c (deleted)
-
src/tests/sched-ext-else.c (deleted)
-
src/tests/sched-ext-parse.c (modified) (2 diffs)
-
src/tests/sched-ext-recurse.c (deleted)
-
src/tests/sched-ext-statment.c (deleted)
-
src/tests/sched-ext-when.c (deleted)
-
src/tests/sched-ext.c (modified) (5 diffs)
-
src/tests/sched-int-barge.c (modified) (5 diffs)
-
src/tests/sched-int-block.c (modified) (5 diffs)
-
src/tests/sched-int-disjoint.c (modified) (4 diffs)
-
src/tests/sched-int-wait.c (modified) (8 diffs)
-
src/tests/sum.c (deleted)
-
src/tests/thread.c (modified) (1 diff)
-
src/tests/typedefRedef.c (deleted)
-
tools/Makefile.am (deleted)
-
tools/Makefile.in (deleted)
-
tools/catchsig.c (deleted)
-
tools/repeat (added)
-
tools/repeat.c (deleted)
-
tools/repeat.old (deleted)
-
tools/stat.py (deleted)
Legend:
- Unmodified
- Added
- Removed
-
.gitignore
r3f7e12cb r78315272 52 52 tools/prettyprinter/pretty 53 53 tools/pretty 54 tools/catchsig55 tools/repeat56 54 57 55 # generated by xfig for user manual -
configure
r3f7e12cb r78315272 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/ 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/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" ;;7051 7050 "tools/prettyprinter/Makefile") CONFIG_FILES="$CONFIG_FILES tools/prettyprinter/Makefile" ;; 7052 7051 -
configure.ac
r3f7e12cb r78315272 238 238 src/prelude/Makefile 239 239 src/libcfa/Makefile 240 tools/Makefile241 240 tools/prettyprinter/Makefile 242 241 ]) -
doc/LaTeXmacros/lstlang.sty
r3f7e12cb r78315272 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 ith, zero_t},112 finally, forall, ftype, _Generic, _Imaginary, inline, __label__, lvalue, _Noreturn, one_t, 113 otype, restrict, _Static_assert, throw, throwResume, trait, try, ttype, typeof, __typeof, 114 __typeof__, virtual, waitfor, when, with, zero_t}, 115 115 morekeywords=[2]{ 116 _Atomic, coroutine, is_coroutine, is_monitor, is_thread, monitor, mutex, nomutex, or,117 resume, suspend, thread, _Thread_local, waitfor, when,yield},116 _Atomic, coroutine, is_coroutine, is_monitor, is_thread, monitor, mutex, nomutex, 117 resume, suspend, thread, _Thread_local, yield}, 118 118 moredirectives={defined,include_next}% 119 119 } -
doc/proposals/concurrency/.gitignore
r3f7e12cb r78315272 16 16 build/*.out 17 17 build/*.ps 18 build/*.pstex19 build/*.pstex_t20 18 build/*.tex 21 19 build/*.toc -
doc/proposals/concurrency/Makefile
r3f7e12cb r78315272 13 13 annex/glossary \ 14 14 text/intro \ 15 text/cforall \ 15 16 text/basics \ 16 text/cforall \17 17 text/concurrency \ 18 text/internals \19 18 text/parallelism \ 20 text/results \21 text/together \22 text/future \23 19 } 24 20 … … 27 23 ext_monitor \ 28 24 int_monitor \ 29 dependency \30 25 }} 31 26 32 PICTURES = ${addprefix build/, ${addsuffix .pstex, \ 33 system \ 34 }} 27 PICTURES = ${addsuffix .pstex, \ 28 } 35 29 36 30 PROGRAMS = ${addsuffix .tex, \ … … 69 63 build/*.out \ 70 64 build/*.ps \ 71 build/*.pstex \72 65 build/*.pstex_t \ 73 66 build/*.tex \ -
doc/proposals/concurrency/annex/glossary.tex
r3f7e12cb r78315272 13 13 } 14 14 15 \longnewglossaryentry{ bulk-acq}16 {name={bulk -acquiring}}15 \longnewglossaryentry{group-acquire} 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.25 19 } 26 20 … … 107 101 \newacronym{api}{API}{Application Program Interface} 108 102 \newacronym{raii}{RAII}{Ressource Acquisition Is Initialization} 109 \newacronym{numa}{NUMA}{Non-Uniform Memory Access} -
doc/proposals/concurrency/figures/ext_monitor.fig
r3f7e12cb r78315272 14 14 4 1 -1 0 0 0 10 0.0000 2 105 90 6000 2160 d\001 15 15 -6 16 6 5 100 2100 5400 240017 1 3 0 1 -1 -1 1 0 4 0.000 1 0.0000 5250 2250 105 105 5250 2250 5355 225018 4 1 -1 0 0 0 10 0.0000 2 105 120 5250 2295 X\00116 6 5850 1650 6150 1950 17 1 3 0 1 -1 -1 0 0 -1 0.000 1 0.0000 6000 1800 105 105 6000 1800 6105 1905 18 4 1 -1 0 0 0 10 0.0000 2 105 90 6000 1860 b\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 850 1650 6150 195025 1 3 0 1 -1 -1 0 0 -1 0.000 1 0.0000 6000 1800 105 105 6000 1800 6105 190526 4 1 -1 0 0 0 10 0.0000 2 105 90 6000 1860 b\00124 6 5100 2100 5400 2400 25 1 3 0 1 -1 -1 1 0 4 0.000 1 0.0000 5250 2250 105 105 5250 2250 5355 2250 26 4 1 -1 0 0 0 10 0.0000 2 105 120 5250 2295 X\001 27 27 -6 28 6 30 70 5445 7275 565528 6 3000 5400 7200 5700 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 35 1050 6225 5625 routine mask\00134 4 0 -1 0 0 0 12 0.0000 2 180 930 6225 5625 routine ptrs\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 2 46 5850 2850 6075 3000 45 47 2 1 0 1 -1 -1 0 0 -1 0.000 0 0 -1 0 0 4 46 48 3150 3750 3750 3750 3750 4050 3150 4050 … … 64 66 2 2 1 1 -1 -1 0 0 -1 4.000 0 0 0 0 0 5 65 67 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 3 69 5250 2850 5850 2850 5850 1650 70 2 1 0 1 -1 -1 0 0 -1 0.000 0 0 -1 0 0 4 71 3150 3150 3750 3150 3750 2850 5325 2850 66 72 2 1 0 1 0 7 50 -1 -1 0.000 0 0 -1 1 1 2 67 73 1 1 1.00 60.00 120.00 68 74 7 1 1.00 60.00 120.00 69 75 5250 3150 5250 2400 70 2 1 0 1 0 7 50 -1 -1 0.000 0 0 -1 0 0 571 3150 3150 3750 3150 3750 2850 5850 2850 5850 165072 2 1 0 1 0 7 50 -1 -1 0.000 0 0 -1 0 0 273 5850 2850 6150 300074 76 2 2 0 1 0 7 50 -1 -1 0.000 0 0 -1 0 0 5 75 77 5100 1800 5400 1800 5400 2400 5100 2400 5100 1800 -
doc/proposals/concurrency/style/cfa-format.tex
r3f7e12cb r78315272 108 108 belowskip=3pt, 109 109 keepspaces=true, 110 tabsize=4,111 110 % frame=lines, 112 111 literate=, … … 134 133 belowskip=3pt, 135 134 keepspaces=true, 136 tabsize=4,137 135 % frame=lines, 138 136 literate=, … … 152 150 keywordstyle=\bfseries\color{blue}, 153 151 keywordstyle=[2]\bfseries\color{Plum}, 154 commentstyle=\ sf\itshape\color{OliveGreen},% green and italic comments152 commentstyle=\itshape\color{OliveGreen}, % green and italic comments 155 153 identifierstyle=\color{identifierCol}, 156 154 stringstyle=\sf\color{Mahogany}, % use sanserif font … … 160 158 belowskip=3pt, 161 159 keepspaces=true, 162 tabsize=4,163 160 % frame=lines, 164 161 literate=, … … 254 251 }{} 255 252 256 \lstnewenvironment{gocode}[1][]{257 \lstset{258 language = Golang,259 style=defaultStyle,260 #1261 }262 }{}263 264 253 \newcommand{\zero}{\lstinline{zero_t}\xspace} 265 254 \newcommand{\one}{\lstinline{one_t}\xspace} -
doc/proposals/concurrency/text/basics.tex
r3f7e12cb r78315272 1 1 % ====================================================================== 2 2 % ====================================================================== 3 \chapter{ ConcurrencyBasics}\label{basics}3 \chapter{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 -code.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 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. 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. 16 10 17 11 \section{\protect\CFA 's Thread Building Blocks} 18 One of the important features that is missing in C is threading. On modern architectures, a lack of threading is unacceptable\cite{Sutter05, Sutter05b}, and therefore modern programming languages must have the proper tools to allow users to write performant concurrent programs to take advantage of parallelism. As an extension of C, \CFA needs to express these concepts in a way that is as natural as possible to programmers familiar withimperative 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.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 to imperative languages. And being a system-level language means programmers expect to choose precisely which features they need and which cost they are willing to pay. 19 13 20 14 \section{Coroutines: A stepping stone}\label{coroutine} 21 While the main focus of this proposal is concurrency and parallelism, it is important to address coroutines, which are actually a significant building block of a concurrency system. Coroutines need to deal with context-switches and other context-management operations. Therefore, this proposal includes coroutines both as an intermediate step for the implementation of threads, and a first class feature of \CFA. Furthermore, many design challenges of threads are at least partially present in designing coroutines, which makes the design effort that much more relevant. The core \acrshort{api} of coroutines revolve around two features: independent call stacks and \code{suspend}/\code{resume}. 22 23 \begin{figure} 24 \begin{center} 25 \begin{tabular}{c @{\hskip 0.025in}|@{\hskip 0.025in} c @{\hskip 0.025in}|@{\hskip 0.025in} c} 26 \begin{ccode}[tabsize=2] 27 //Using callbacks 28 void fibonacci_func( 29 int n, 30 void (*callback)(int) 31 ) { 32 int first = 0; 33 int second = 1; 34 int next, i; 35 for(i = 0; i < n; i++) 36 { 37 if(i <= 1) 38 next = i; 39 else { 40 next = f1 + f2; 41 f1 = f2; 42 f2 = next; 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; 35 fn2 = fn1; 36 fn1 = this.fn; 37 suspend(this); // return to last resume 38 39 for ( ;; ) { 40 this.fn = fn1 + fn2; 41 fn2 = fn1; 42 fn1 = this.fn; 43 suspend(this); // return to last resume 43 44 } 44 callback(next); 45 } 46 } 47 48 int main() { 49 void print_fib(int n) { 50 printf("%d\n", n); 51 } 52 53 fibonacci_func( 54 10, print_fib 55 ); 56 57 58 59 } 60 \end{ccode}&\begin{ccode}[tabsize=2] 61 //Using output array 62 void fibonacci_array( 63 int n, 64 int * array 65 ) { 66 int f1 = 0; int f2 = 1; 67 int next, i; 68 for(i = 0; i < n; i++) 69 { 70 if(i <= 1) 71 next = i; 72 else { 73 next = f1 + f2; 74 f1 = f2; 75 f2 = next; 45 } 46 47 int next(Fibonacci & this) { 48 resume(this); // transfer to last suspend 49 return this.fn; 50 } 51 52 void main() { // regular program main 53 Fibonacci f1, f2; 54 for ( int i = 1; i <= 10; i += 1 ) { 55 sout | next( f1 ) | next( f2 ) | endl; 76 56 } 77 array[i] = next; 78 } 79 } 80 81 82 int main() { 83 int a[10]; 84 85 fibonacci_func( 86 10, a 87 ); 88 89 for(int i=0;i<10;i++){ 90 printf("%d\n", a[i]); 91 } 92 93 } 94 \end{ccode}&\begin{ccode}[tabsize=2] 95 //Using external state 96 typedef struct { 97 int f1, f2; 98 } Iterator_t; 99 100 int fibonacci_state( 101 Iterator_t * it 102 ) { 103 int f; 104 f = it->f1 + it->f2; 105 it->f2 = it->f1; 106 it->f1 = max(f,1); 107 return f; 108 } 109 110 111 112 113 114 115 116 int main() { 117 Iterator_t it={0,0}; 118 119 for(int i=0;i<10;i++){ 120 printf("%d\n", 121 fibonacci_state( 122 &it 123 ); 124 ); 125 } 126 127 } 128 \end{ccode} 129 \end{tabular} 130 \end{center} 131 \caption{Different implementations of a fibonacci sequence generator in C.} 132 \label{lst:fibonacci-c} 133 \end{figure} 134 135 A good example of a problem made easier with coroutines is generators, like the fibonacci sequence. This problem comes with the challenge of decoupling how a sequence is generated and how it is used. Figure \ref{lst:fibonacci-c} shows conventional approaches to writing generators in C. All three of these approach suffer from strong coupling. The left and center approaches require that the generator have knowledge of how the sequence is used, while the rightmost approach requires holding internal state between calls on behalf of the generator and makes it much harder to handle corner cases like the Fibonacci seed. 136 137 Figure \ref{lst:fibonacci-cfa} is an example of a solution to the fibonnaci problem using \CFA coroutines, where the coroutine stack holds sufficient state for the generation. This solution has the advantage of having very strong decoupling between how the sequence is generated and how it is used. Indeed, this version is as easy to use as the \code{fibonacci_state} solution, while the imlpementation is very similar to the \code{fibonacci_func} example. 138 139 \begin{figure} 140 \begin{cfacode} 141 coroutine Fibonacci { 142 int fn; //used for communication 143 }; 144 145 void ?{}(Fibonacci & this) { //constructor 146 this.fn = 0; 147 } 148 149 //main automacically called on first resume 150 void main(Fibonacci & this) with (this) { 151 int fn1, fn2; //retained between resumes 152 fn = 0; 153 fn1 = fn; 154 suspend(this); //return to last resume 155 156 fn = 1; 157 fn2 = fn1; 158 fn1 = fn; 159 suspend(this); //return to last resume 160 161 for ( ;; ) { 162 fn = fn1 + fn2; 163 fn2 = fn1; 164 fn1 = fn; 165 suspend(this); //return to last resume 166 } 167 } 168 169 int next(Fibonacci & this) { 170 resume(this); //transfer to last suspend 171 return this.fn; 172 } 173 174 void main() { //regular program main 175 Fibonacci f1, f2; 176 for ( int i = 1; i <= 10; i += 1 ) { 177 sout | next( f1 ) | next( f2 ) | endl; 178 } 179 } 180 \end{cfacode} 181 \caption{Implementation of fibonacci using coroutines} 182 \label{lst:fibonacci-cfa} 183 \end{figure} 184 185 Figure \ref{lst:fmt-line} shows the \code{Format} coroutine which rearranges text in order to group characters into blocks of fixed size. The example takes advantage of resuming coroutines in the constructor to simplify the code and highlights the idea that interesting control flow can occur in the constructor. 186 187 \begin{figure} 188 \begin{cfacode}[tabsize=3] 189 //format characters into blocks of 4 and groups of 5 blocks per line 190 coroutine Format { 191 char ch; //used for communication 192 int g, b; //global because used in destructor 193 }; 194 195 void ?{}(Format & fmt) { 196 resume( fmt ); //prime (start) coroutine 197 } 198 199 void ^?{}(Format & fmt) with fmt { 200 if ( fmt.g != 0 || fmt.b != 0 ) 201 sout | endl; 202 } 203 204 void main(Format & fmt) with fmt { 205 for ( ;; ) { //for as many characters 206 for(g = 0; g < 5; g++) { //groups of 5 blocks 207 for(b = 0; b < 4; fb++) { //blocks of 4 characters 208 suspend(); 209 sout | ch; //print character 210 } 211 sout | " "; //print block separator 212 } 213 sout | endl; //print group separator 214 } 215 } 216 217 void prt(Format & fmt, char ch) { 218 fmt.ch = ch; 219 resume(fmt); 220 } 221 222 int main() { 223 Format fmt; 224 char ch; 225 Eof: for ( ;; ) { //read until end of file 226 sin | ch; //read one character 227 if(eof(sin)) break Eof; //eof ? 228 prt(fmt, ch); //push character for formatting 229 } 230 } 231 \end{cfacode} 232 \caption{Formatting text into lines of 5 blocks of 4 characters.} 233 \label{lst:fmt-line} 234 \end{figure} 57 } 58 \end{cfacode} 235 59 236 60 \subsection{Construction} 237 One important design challenge for coroutines and threads (shown in section \ref{threads}) is that the runtime system needs to run code after the user-constructor runs to connect the fully constructed object into the system. In the case of coroutines, this challenge is simpler since there is no non-determinism from preemption or scheduling. However, the underlying challenge remains the same for coroutines and threads.238 239 The runtime system needs to create the coroutine's stack and more importantly prepare it for the first resumption. The timing of the creation is non-trivial since users both expect to have fully constructed objects once execution enters the coroutine main and to be able to resume the coroutine from the constructor. As regular objects, constructors canleak coroutines before they are ready. There are several solutions to this problem but the chosen options effectively forces the design of the coroutine.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 still leak coroutines before they are ready. There are several solutions to this problem but the chosen options effectively forces the design of the coroutine. 240 64 241 65 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: … … 247 71 248 72 forall(otype T) 249 void noop(T *) {}73 void noop(T *) {} 250 74 251 75 void bar() { 252 76 int a; 253 async(noop, &a); //start thread running noop with argument a 254 } 255 \end{cfacode} 256 77 async(noop, &a); 78 } 79 \end{cfacode} 257 80 The generated C code\footnote{Code trimmed down for brevity} creates a local thunk to hold type information: 258 81 … … 272 95 } 273 96 \end{ccode} 274 The problem in this example is a storage management issue, the function pointer \code{_thunk0} is only valid until the end of the block, which limits the viable solutions because storing the function pointer for too long causes undefined behavior; i.e., the stack-based thunk being destroyed before it can be used. This challenge is an extension of challenges that come with second-class routines. Indeed, GCC nested routines also have the limitation that nested routine cannot be passed outside of the declaration scope. The case of coroutines and threads is simply an extension of this problem to multiple call-stacks.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. 275 98 276 99 \subsection{Alternative: Composition} 277 One solution to this challenge is to use composition/containement, where coroutine fields are added to manage the coroutine. 278 279 \begin{cfacode} 280 struct Fibonacci { 281 int fn; //used for communication 282 coroutine c; //composition 283 }; 284 285 void FibMain(void *) { 286 //... 287 } 288 289 void ?{}(Fibonacci & this) { 290 this.fn = 0; 291 //Call constructor to initialize coroutine 292 (this.c){myMain}; 293 } 294 \end{cfacode} 295 The downside of this approach is that users need to correctly construct the coroutine handle before using it. Like any other objects, doing so the users carefully choose construction order to prevent usage of unconstructed objects. However, in the case of coroutines, users must also pass to the coroutine information about the coroutine main, like in the previous example. This opens the door for user errors and requires extra runtime storage to pass at runtime information that can be known statically. 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. 296 114 297 115 \subsection{Alternative: Reserved keyword} … … 299 117 300 118 \begin{cfacode} 301 coroutine Fibonacci { 302 int fn; //used for communication 303 }; 304 \end{cfacode} 305 The \code{coroutine} keyword means the compiler can find and inject code where needed. The downside of this approach is that it makes coroutine a special case in the language. Users wantint to extend coroutines or build their own for various reasons can only do so in ways offered by the language. Furthermore, implementing coroutines without language supports also displays the power of the programming language used. While this is ultimately the option used for idiomatic \CFA code, coroutines and threads can still be constructed by users without using the language support. The reserved keywords are only present to improve ease of use for the common cases. 119 coroutine Fibonacci { 120 int fn; // used for communication 121 }; 122 \end{cfacode} 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. 306 125 307 126 \subsection{Alternative: Lamda Objects} … … 316 135 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. 317 136 318 A variation of this would be to use a simple function pointer in the same way pthread does for threads :137 A variation of this would be to use an simple function pointer in the same way pthread does for threads : 319 138 \begin{cfacode} 320 139 void foo( coroutine_t cid, void * arg ) { … … 329 148 } 330 149 \end{cfacode} 331 This semantic s is more common for thread interfaces than coroutines worksequally well. As discussed in section \ref{threads}, this approach is superseeded by static approaches in terms of expressivity.150 This semantic is more common for thread interfaces than coroutines but would work equally well. As discussed in section \ref{threads}, this approach is superseeded by static approaches in terms of expressivity. 332 151 333 152 \subsection{Alternative: Trait-based coroutines} … … 340 159 coroutine_desc * get_coroutine(T & this); 341 160 }; 342 343 forall( dtype T | is_coroutine(T) ) void suspend(T &); 344 forall( dtype T | is_coroutine(T) ) void resume (T &); 345 \end{cfacode} 346 This ensures an object is not a coroutine until \code{resume} is called on the object. Correspondingly, any object that is passed to \code{resume} is a coroutine since it must satisfy the \code{is_coroutine} trait to compile. The advantage of this approach is that users can easily create different types of coroutines, for example, changing the memory layout of a coroutine is trivial when implementing the \code{get_coroutine} routine. The \CFA keyword \code{coroutine} only has the effect of implementing the getter and forward declarations required for users to only have to implement the main routine. 161 \end{cfacode} 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. 347 163 348 164 \begin{center} … … 370 186 \end{center} 371 187 372 The combination of these two approaches allows users new to co routinning and concurrency to have an easy and concise specification, while more advanced users havetighter control on memory layout and initialization.188 The combination of these two approaches allows users new to concurrency to have a easy and concise method while more advanced users can expose themselves to otherwise hidden pitfalls at the benefit of tighter control on memory layout and initialization. 373 189 374 190 \section{Thread Interface}\label{threads} … … 376 192 377 193 \begin{cfacode} 378 thread foo {};194 thread foo {}; 379 195 \end{cfacode} 380 196 … … 389 205 \end{cfacode} 390 206 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. 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. 423 238 \begin{cfacode} 424 239 thread World; … … 439 254 \end{cfacode} 440 255 441 This semantic has several advantages over explicit semantics : a thread is always started and stopped exaclty once, users cannot make any progamming errors, and it naturally scales to multiple threads meaning basic synchronisation is very simple.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 simple 442 257 443 258 \begin{cfacode} … … 461 276 \end{cfacode} 462 277 463 However, one of the drawbacks of this approach is that threads now always form a lattice, that is they are always destroyed in the opposite order of construction because of block structure. This restriction is relaxed by using dynamic allocation, so threads can outlive the scope in which they are created, much like dynamically allocating memory lets objects outlive the scope in which they are created.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 created 464 279 465 280 \begin{cfacode} … … 468 283 }; 469 284 285 //main 470 286 void main(MyThread & this) { 471 287 //... … … 475 291 MyThread * long_lived; 476 292 { 293 MyThread short_lived; 477 294 //Start a thread at the beginning of the scope 478 MyThread short_lived; 295 296 DoStuff(); 479 297 480 298 //create another thread that will outlive the thread in this scope 481 299 long_lived = new MyThread; 482 300 483 DoStuff();484 485 301 //Wait for the thread short_lived to finish 486 302 } 487 303 DoMoreStuff(); 488 304 489 //Now wait for the long_lived to finish305 //Now wait for the short_lived to finish 490 306 delete long_lived; 491 307 } -
doc/proposals/concurrency/text/cforall.tex
r3f7e12cb r78315272 1 1 % ====================================================================== 2 2 % ====================================================================== 3 \chapter{Cforall Overview}3 \chapter{Cforall crash course} 4 4 % ====================================================================== 5 5 % ====================================================================== 6 6 7 The following is a quick introduction to the \CFA language,specifically tailored to the features needed to support concurrency.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 language specifically tailored to the features needed to support concurrency. 8 8 9 \CFA is a extension of ISO-C and therefore supports all of the same paradigms as C. It is a non-object oriented system language, meaning most of the major abstractions have either no runtime overhead or can be opt-out easily. Like C, the basics of \CFA revolve around structures and routines, which are thin abstractions over machine code. The vast majority of the code produced by the \CFA translator respects memory-layouts and calling-conventions laid out by C. Interestingly, while \CFA is not an object-oriented language, lacking the concept of a receiver (e.g., this), it does have some notion of objects\footnote{C defines the term objects as : ``region of data storage in the execution environment, the contents of which can represent 10 values''\cite[3.15]{C11}}, most importantly construction and destruction of objects. Most of the following code examples can be found on the \CFA website \cite{www-cfa} 9 \CFA is a extension of ISO C and therefore supports much of the same paradigms as C. It is a non-object oriented system level language, meaning it has very most of the major abstractions have either no runtime cost or can be opt-out easily. Like C, the basics of \CFA revolve around structures and routines, which are thin abstractions over assembly. The vast majority of the code produced by a \CFA compiler respects memory-layouts and calling-conventions laid out by C. However, while \CFA is not an object-oriented language according to a strict definition. It does have some notion of objects, most importantly construction and destruction of objects. Most of the following pieces of code can be found as is on the \CFA website : \cite{www-cfa} 11 10 12 11 \section{References} 13 12 14 Like \CC, \CFA introduces re bindable 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:13 Like \CC, \CFA introduces references as an alternative to pointers. In regards to concurrency, the semantics difference between pointers and references aren't particularly relevant but since this document uses mostly references here is a quick overview of the semantics : 15 14 \begin{cfacode} 16 15 int x, *p1 = &x, **p2 = &p1, ***p3 = &p2, 17 &r1 = x, &&r2 = r1, &&&r3 = r2; 18 ***p3 = 3; //change x 19 r3 = 3; //change x, ***r3 20 **p3 = ...; //change p1 21 *p3 = ...; //change p2 22 int y, z, & ar[3] = {x, y, z}; //initialize array of references 23 typeof( ar[1]) p; //is int, i.e., the type of referenced object 24 typeof(&ar[1]) q; //is int &, i.e., the type of reference 25 sizeof( ar[1]) == sizeof(int); //is true, i.e., the size of referenced object 26 sizeof(&ar[1]) == sizeof(int *); //is true, i.e., the size of a reference 16 &r1 = x, &&r2 = r1, &&&r3 = r2; 17 ***p3 = 3; // change x 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 27 30 \end{cfacode} 28 The important t ake away from this code example is that references offer a handle to an object, much like pointers, but which is automatically dereferenced for convinience.31 The important thing to take away from this code snippet is that references offer a handle to an object much like pointers but which is automatically derefferenced when convinient. 29 32 30 33 \section{Overloading} 31 34 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.35 Another important feature \CFA has in common with \CC is function overloading : 33 36 \begin{cfacode} 34 // selection based on type and number of parameters35 void f( void); //(1)36 void f( char); //(2)37 void f( int, double); //(3)38 f(); //select (1)39 f( 'a'); //select (2)40 f( 3, 5.2); //select (3)37 // selection based on type and number of parameters 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) 41 44 42 //selection based on type and number of returns 43 char f(int); //(1) 44 double f(int); //(2) 45 char c = f(3); //select (1) 46 double d = f(4); //select (2) 45 // selection based on type and number of returns 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) 47 52 \end{cfacode} 48 This feature is particularly important for concurrency since the runtime system relies on creating different types to represent concurrency objects. Therefore, overloading is necessary to prevent the need for long prefixes and other naming conventions that prevent name clashes. As seen in chapter \ref{basics}, routine \code{main} is an example that benefits from overloading.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. 49 54 50 55 \section{Operators} 51 Overloading also extends to operators. The syntax for denoting operator-overloading is to name a routine with the symbol of the operator and question marks where the arguments of the operation occur, e.g.: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 : 52 57 \begin{cfacode} 53 int ++? (int op); //unary prefix increment54 int ?++ (int op); //unary postfix increment55 int ?+? (int op1, int op2); //binary plus56 int ?<=?( int op1, int op2); //binary less than57 int ?=? (int & op1, int op2); //binary assignment58 int ?+=?( int & op1, int op2); //binary plus-assignment58 int ++?( int op ); // unary prefix increment 59 int ?++( int op ); // unary postfix increment 60 int ?+?( int op1, int op2 ); // binary plus 61 int ?<=?( int op1, int op2 ); // binary less than 62 int ?=?( int & op1, int op2 ); // binary assignment 63 int ?+=?( int & op1, int op2 ); // binary plus-assignment 59 64 60 struct S { int i, j;};61 S ?+?( S op1, S op2) { //add two structures62 return (S){ op1.i + op2.i, op1.j + op2.j};65 struct S { int i, j; }; 66 S ?+?( S op1, S op2 ) { // add two structures 67 return (S){ op1.i + op2.i, op1.j + op2.j }; 63 68 } 64 S s1 = { 1, 2}, s2 = {2, 3}, s3;65 s3 = s1 + s2; //compute sum: s3 == {2, 5}69 S s1 = { 1, 2 }, s2 = { 2, 3 }, s3; 70 s3 = s1 + s2; // compute sum: s3 == { 2, 5 } 66 71 \end{cfacode} 67 While concurrency does not use operator overloading directly, this feature is more important as an introduction for the syntax of constructors. 72 73 Since concurrency does not use operator overloading, this feature is more important as an introduction for the syntax of constructors. 68 74 69 75 \section{Constructors/Destructors} 70 Object life-time is often a challenge in concurrency. \CFA uses the approach of giving concurrent meaning to object life-time as a mean of synchronization and/or mutual exclusion. Since \CFA relies heavily on the life time of objects, constructors and destructors are a core feature required for concurrency and parallelism.\CFA uses the following syntax for constructors and destructors :76 \CFA uses the following syntax for constructors and destructors : 71 77 \begin{cfacode} 72 78 struct S { … … 74 80 int * ia; 75 81 }; 76 void ?{}( S & s, int asize) { //constructor operator77 s .size = asize; //initialize fields78 s.ia = calloc(size, sizeof(S));82 void ?{}( S & s, int asize ) with s { // constructor operator 83 size = asize; // initialize fields 84 ia = calloc( size, sizeof( S ) ); 79 85 } 80 void ^?{}( S & s) { //destructor operator81 free( ia); //de-initialization fields86 void ^?{}( S & s ) with s { // destructor operator 87 free( ia ); // de-initialization fields 82 88 } 83 89 int main() { 84 S x = { 10}, y = {100}; //implict calls: ?{}(x, 10), ?{}(y, 100)85 ... //use x and y86 ^x{}; ^y{}; // explicit calls to de-initialize87 x{ 20}; y{200}; //explicit calls to reinitialize88 ... //reuse x and y89 } //implict calls: ^?{}(y), ^?{}(x)90 S x = { 10 }, y = { 100 }; // implict calls: ?{}( x, 10 ), ?{}( y, 100 ) 91 ... // use x and y 92 ^x{}; ^y{}; // explicit calls to de-initialize 93 x{ 20 }; y{ 200 }; // explicit calls to reinitialize 94 ... // reuse x and y 95 } // implict calls: ^?{}( y ), ^?{}( x ) 90 96 \end{cfacode} 91 The language guarantees that every object and all their fields are constructed. Like \CC, construction of an object is automatically done on allocation and destruction of the object is done on deallocation. Allocation and deallocation can occur on the stack or on the heap. 92 \begin{cfacode} 93 { 94 struct S s = {10}; //allocation, call constructor 95 ... 96 } //deallocation, call destructor 97 struct S * s = new(); //allocation, call constructor 98 ... 99 delete(s); //deallocation, call destructor 100 \end{cfacode} 101 Note that like \CC, \CFA introduces \code{new} and \code{delete}, which behave like \code{malloc} and \code{free} in addition to constructing and destructing objects, after calling \code{malloc} and before calling \code{free} respectively. 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. 102 98 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}. 99 For more information see \cite{cforall-ug,rob-thesis,www-cfa}. -
doc/proposals/concurrency/text/concurrency.tex
r3f7e12cb r78315272 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 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.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\cit for example). However, in languages that use routine calls as their core abstraction-mechanism, these approaches force a clear distinction between concurrent and non-concurrent paradigms (i.e., message passing versus routine call). This distinction in turn means that, in order to be effective, programmers need to learn two sets of designs patterns. While this distinction can be hidden away in library code, effective use of the librairy still has to take both paradigms into account. 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 ing 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 systemslanguage, 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.10 An approach that is worth mentionning because it is gaining in popularity is transactionnal memory~\cite{Dice10}[Check citation]. While this approach is even pursued by system languages like \CC\cit, the performance and feature set is currently too restrictive to be the main concurrency paradigm for general purpose language, which is why it was rejected as the core paradigm for concurrency in \CFA. 11 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 providenumerous 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 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 s 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 composabilitybecause 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 solution exists for mutual exclusion which vary in terms of performance, flexibility and ease of use. Methods range from low-level locks, which are fast and flexible but require significant attention to be correct, to higher-level mutual-exclusion methods, which sacrifice some performance in order to improve ease of use. Ease of use comes by either guaranteeing some problems cannot occur (e.g., being deadlock free) or by offering a more explicit coupling between data and corresponding critical section. For example, the \CC \code{std::atomic<T>} which offer an easy way to express mutual-exclusion on a restricted set of operations (.e.g: reading/writing large types atomically). Another challenge with low-level locks is composability. Locks are not composable because it takes careful organising for multiple locks to be used while preventing deadlocks. Easing composability is another feature higher-level mutual-exclusion mechanisms often offer. 19 19 20 20 \subsection{Synchronization} 21 As for mutual-exclusion, low -level synchronisation primitives often offer good performance and good flexibility at the cost of ease of use. Again, higher-level mechanism often simplify usage by adding better coupling between synchronization and data, e.g.: message passing, or offering simpler solution to otherwise involved challenges. As mentioned above, synchronization can be expressed as guaranteeing that event \textit{X} always happens before \textit{Y}. Most of the time, synchronisation happens within a critical section, where threads must acquire mutual-exclusion in a certain order. However, it may also be desirable to guarantee that event \textit{Z} does not occur between \textit{X} and \textit{Y}. Not satisfying this property called barging. For example, where event \textit{X} tries to effect event \textit{Y} but another thread acquires the critical section and emits \textit{Z} before \textit{Y}. The classic exmaple is the thread that finishes using a ressource and unblocks a thread waiting to use the resource, but the unblocked thread must compete again to acquire the resource. Preventing or detecting barging is an involved challenge with low-level locks, which can be made much easier by higher-level constructs. This challenge is often split into two different methods, barging avoidance and barging prevention. Algorithms that use status flags and other flag variables to detect barging threads are said to be using barging avoidance while algorithms that baton-passing locks between threads instead of releasing the locks are said to be using barging prevention.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. 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 typedef /*some monitor type*/ monitor;31 int f(monitor & m);32 33 int main() {34 monitor m; //Handle m35 f(m); //Routine using handle36 }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} 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 57 155 This counter is used as follows: 58 156 \begin{center} … … 71 169 \end{tabular} 72 170 \end{center} 73 Notice how the counter is used without any explicit synchronisation and yet supports thread-safe semantics for both reading and writting, which is similar in usage to \CC \code{atomic} template. 74 75 Here, the constructor(\code{?\{\}}) uses the \code{nomutex} keyword to signify that it does not acquire the monitor mutual-exclusion when constructing. This semantics is because an object not yet con\-structed should never be shared and therefore does not require mutual exclusion. The prefix increment operator uses \code{mutex} to protect the incrementing process from race conditions. Finally, there is a conversion operator from \code{counter_t} to \code{size_t}. This conversion may or may not require the \code{mutex} keyword depending on whether or not reading a \code{size_t} is an atomic operation. 76 77 For maximum usability, monitors use \gls{multi-acq} semantics, which means a single thread can acquire the same monitor multiple times without deadlock. For example, figure \ref{fig:search} uses recursion and \gls{multi-acq} to print values inside a binary tree. 78 \begin{figure} 79 \label{fig:search} 80 \begin{cfacode} 81 monitor printer { ... }; 82 struct tree { 83 tree * left, right; 84 char * value; 85 }; 86 void print(printer & mutex p, char * v); 87 88 void print(printer & mutex p, tree * t) { 89 print(p, t->value); 90 print(p, t->left ); 91 print(p, t->right); 92 } 93 \end{cfacode} 94 \caption{Recursive printing algorithm using \gls{multi-acq}.} 95 \end{figure} 96 97 Having both \code{mutex} and \code{nomutex} keywords is redundant based on the meaning of a routine having neither of these keywords. For example, given a routine without qualifiers \code{void foo(counter_t & this)}, then it is reasonable that it should default to the safest option \code{mutex}, whereas assuming \code{nomutex} is unsafe and may cause subtle errors. In fact, \code{nomutex} is the ``normal'' parameter behaviour, with the \code{nomutex} keyword effectively stating explicitly that ``this routine is not special''. Another alternative is making exactly one of these keywords mandatory, which provides the same semantics but without the ambiguity of supporting routines with neither keyword. Mandatory keywords would also have the added benefit of being self-documented but at the cost of extra typing. While there are several benefits to mandatory keywords, they do bring a few challenges. Mandatory keywords in \CFA would imply that the compiler must know without doubt whether or not a parameter is a monitor or not. Since \CFA relies heavily on traits as an abstraction mechanism, the distinction between a type that is a monitor and a type that looks like a monitor can become blurred. For this reason, \CFA only has the \code{mutex} keyword and uses no keyword to mean \code{nomutex}. 98 99 The next semantic decision is to establish when \code{mutex} may be used as a type qualifier. Consider the following declarations: 100 \begin{cfacode} 101 int f1(monitor & mutex m); 102 int f2(const monitor & mutex m); 103 int f3(monitor ** mutex m); 104 int f4(monitor * mutex m []); 105 int f5(graph(monitor*) & mutex m); 106 \end{cfacode} 107 The problem is to indentify which object(s) should be acquired. Furthermore, each object needs to be acquired only once. In the case of simple routines like \code{f1} and \code{f2} it is easy to identify an exhaustive list of objects to acquire on entry. Adding indirections (\code{f3}) still allows the compiler and programmer to indentify which object is acquired. However, adding in arrays (\code{f4}) makes it much harder. Array lengths are not necessarily known in C, and even then making sure objects are only acquired once becomes none-trivial. This problem can be extended to absurd limits like \code{f5}, which uses a graph of monitors. To make the issue tractable, this project imposes the requirement that a routine may only acquire one monitor per parameter and it must be the type of the parameter with at most one level of indirection (ignoring potential qualifiers). Also note that while routine \code{f3} can be supported, meaning that monitor \code{**m} is be acquired, passing an array to this routine would be type safe and yet result in undefined behavior because only the first element of the array is acquired. However, this ambiguity is part of the C type-system with respects to arrays. For this reason, \code{mutex} is disallowed in the context where arrays may be passed: 108 \begin{cfacode} 109 int f1(monitor & mutex m); //Okay : recommanded case 110 int f2(monitor * mutex m); //Okay : could be an array but probably not 111 int f3(monitor mutex m []); //Not Okay : Array of unkown length 112 int f4(monitor ** mutex m); //Not Okay : Could be an array 113 int f5(monitor * mutex m []); //Not Okay : Array of unkown length 114 \end{cfacode} 115 Note that not all array functions are actually distinct in the type system. However, even if the code generation could tell the difference, the extra information is still not sufficient to extend meaningfully the monitor call semantic. 116 117 Unlike object-oriented monitors, where calling a mutex member \emph{implicitly} acquires mutual-exclusion of the receiver object, \CFA uses an explicit mechanism to acquire mutual-exclusion. A consequence of this approach is that it extends naturally to multi-monitor calls. 118 \begin{cfacode} 119 int f(MonitorA & mutex a, MonitorB & mutex b); 120 121 MonitorA a; 122 MonitorB b; 123 f(a,b); 124 \end{cfacode} 125 While OO monitors could be extended with a mutex qualifier for multiple-monitor calls, no example of this feature could be found. The capacity to acquire multiple locks before entering a critical section is called \emph{\gls{bulk-acq}}. In practice, writing multi-locking routines that do not lead to deadlocks is tricky. Having language support for such a feature is therefore a significant asset for \CFA. In the case presented above, \CFA guarantees that the order of aquisition is consistent across calls to different routines using the same monitors as arguments. This consistent ordering means acquiring multiple monitors in the way is safe from deadlock. However, users can still force the acquiring order. For example, notice which routines use \code{mutex}/\code{nomutex} and how this affects aquiring order: 126 \begin{cfacode} 127 void foo(A & mutex a, B & mutex b) { //acquire a & b 128 ... 129 } 130 131 void bar(A & mutex a, B & /*nomutex*/ b) { //acquire a 132 ... foo(a, b); ... //acquire b 133 } 134 135 void baz(A & /*nomutex*/ a, B & mutex b) { //acquire b 136 ... foo(a, b); ... //acquire a 137 } 138 \end{cfacode} 139 The \gls{multi-acq} monitor lock allows a monitor lock to be acquired by both \code{bar} or \code{baz} and acquired again in \code{foo}. In the calls to \code{bar} and \code{baz} the monitors are acquired in opposite order. 140 141 However, such use leads to the lock acquiring order problem. In the example above, the user uses implicit ordering in the case of function \code{foo} but explicit ordering in the case of \code{bar} and \code{baz}. This subtle mistake means that calling these routines concurrently may lead to deadlock and is therefore undefined behavior. As shown\cit, solving this problem requires: 142 \begin{enumerate} 143 \item Dynamically tracking of the monitor-call order. 144 \item Implement rollback semantics. 145 \end{enumerate} 146 While the first requirement is already a significant constraint on the system, implementing a general rollback semantics in a C-like language is prohibitively complex \cit. In \CFA, users simply need to be carefull when acquiring multiple monitors at the same time or only use \gls{bulk-acq} of all the monitors. While \CFA provides only a partial solution, many system provide no solution and the \CFA partial solution handles many useful cases. 147 148 For example, \gls{multi-acq} and \gls{bulk-acq} can be used together in interesting ways: 149 \begin{cfacode} 150 monitor bank { ... }; 151 152 void deposit( bank & mutex b, int deposit ); 153 154 void transfer( bank & mutex mybank, bank & mutex yourbank, int me2you) { 155 deposit( mybank, -me2you ); 156 deposit( yourbank, me2you ); 157 } 158 \end{cfacode} 159 This example shows a trivial solution to the bank-account transfer-problem\cit. Without \gls{multi-acq} and \gls{bulk-acq}, the solution to this problem is much more involved and requires carefull engineering. 160 161 \subsection{\code{mutex} statement} \label{mutex-stmt} 162 163 The call semantics discussed aboved have one software engineering issue, only a named routine can acquire the mutual-exclusion of a set of monitor. \CFA offers the \code{mutex} statement to workaround the need for unnecessary names, avoiding a major software engineering problem\cit. Listing \ref{lst:mutex-stmt} shows an example of the \code{mutex} statement, which introduces a new scope in which the mutual-exclusion of a set of monitor is acquired. Beyond naming, the \code{mutex} statement has no semantic difference from a routine call with \code{mutex} parameters. 164 165 \begin{figure} 166 \begin{center} 167 \begin{tabular}{|c|c|} 168 function call & \code{mutex} statement \\ 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: 183 \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 \\ 169 188 \hline 170 189 \begin{cfacode}[tabsize=3] 171 monitor M {}; 172 void foo( M & mutex m ) { 173 //critical section 174 } 175 176 void bar( M & m ) { 177 foo( m ); 178 } 179 \end{cfacode}&\begin{cfacode}[tabsize=3] 180 monitor M {}; 181 void bar( M & m ) { 182 mutex(m) { 183 //critical section 184 } 185 } 186 187 188 \end{cfacode} 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} 189 244 \end{tabular} 190 245 \end{center} 191 \caption{Regular call semantics vs. \code{mutex} statement} 192 \label{lst:mutex-stmt} 193 \end{figure} 194 195 % ====================================================================== 196 % ====================================================================== 197 \subsection{Data semantics} \label{data} 198 % ====================================================================== 199 % ====================================================================== 200 Once the call semantics are established, the next step is to establish data semantics. Indeed, until now a monitor is used simply as a generic handle but in most cases monitors contain shared data. This data should be intrinsic to the monitor declaration to prevent any accidental use of data without its appropriate protection. For example, here is a complete version of the counter showed in section \ref{call}: 201 \begin{cfacode} 202 monitor counter_t { 203 int value; 204 }; 205 206 void ?{}(counter_t & this) { 207 this.cnt = 0; 208 } 209 210 int ?++(counter_t & mutex this) { 211 return ++this.value; 212 } 213 214 //need for mutex is platform dependent here 215 void ?{}(int * this, counter_t & mutex cnt) { 216 *this = (int)cnt; 217 } 218 \end{cfacode} 219 220 Like threads and coroutines, monitors are defined in terms of traits with some additional language support in the form of the \code{monitor} keyword. The monitor trait is : 221 \begin{cfacode} 222 trait is_monitor(dtype T) { 223 monitor_desc * get_monitor( T & ); 224 void ^?{}( T & mutex ); 225 }; 226 \end{cfacode} 227 Note that the destructor of a monitor must be a \code{mutex} routine. This requirement ensures that the destructor has mutual-exclusion. As with any object, any call to a monitor, using \code{mutex} or otherwise, is Undefined Behaviour after the destructor has run. 228 229 % ====================================================================== 230 % ====================================================================== 231 \section{Internal scheduling} \label{intsched} 232 % ====================================================================== 233 % ====================================================================== 234 In addition to mutual exclusion, the monitors at the core of \CFA's concurrency can also be used to achieve synchronisation. With monitors, this capability is generally achieved with internal or external scheduling as in\cit. Since internal scheduling within a single monitor is mostly a solved problem, this thesis concentrates on extending internal scheduling to multiple monitors. Indeed, like the \gls{bulk-acq} semantics, internal scheduling extends to multiple monitors in a way that is natural to the user but requires additional complexity on the implementation side. 246 247 \Gls{callsite-locking} is inefficient, since any \code{dtype} routine may have to obtain some lock before calling a routine, depending on whether or not the type passed is a monitor. However, with \gls{entry-point-locking} calling a monitor routine becomes exactly the same as calling it from anywhere else. 248 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. 235 270 236 271 First, here is a simple example of such a technique: 237 272 238 273 \begin{cfacode} 239 monitor A {240 condition e;241 }242 243 void foo(A & mutex a) {244 ...245 //Wait for cooperation from bar()246 wait(a.e);247 ...248 }249 250 void bar(A & mutex a) {251 //Provide cooperation for foo()252 ...253 //Unblock foo254 signal(a.e);255 }256 \end{cfacode} 257 258 There are two details to note here. First, the \code{signal} is a delayed operation, it only unblocks the waiting thread when it reaches the end of the critical section. This semantic is needed to respect mutual-exclusion. The alternative is to return immediately after the call to \code{signal}, which is significantly more restrictive. Second, in \CFA, while it is common to store a \code{condition} as a field of the monitor, a \code{condition} variable can be stored/created independently of a monitor. Here routine \code{foo} waits for the \code{signal} from \code{bar} before making further progress, effectively ensuring a basic ordering.259 260 An important aspect of the implementation is that \CFA does not allow barging, which means that once function \code{bar} releases the monitor, \code{foo}is guaranteed to resume immediately after (unless some other thread waited on the same condition). This guarantees offers the benefit of not having to loop arount waits in order to guarantee that a condition is still met. The main reason \CFA offers this guarantee is that users can easily introduce barging if it becomes a necessity but adding barging prevention or barging avoidance is more involved without language support. Supporting barging prevention as well as extending internal scheduling to multiple monitors is the main source of complexity in the design of \CFA concurrency.274 monitor A { 275 condition e; 276 } 277 278 void foo(A & mutex a) { 279 ... 280 // Wait for cooperation from bar() 281 wait(a.e); 282 ... 283 } 284 285 void bar(A & mutex a) { 286 // Provide cooperation for foo() 287 ... 288 // Unblock foo at scope exit 289 signal(a.e); 290 } 291 \end{cfacode} 292 293 There are two details to note here. First, there \code{signal} is a delayed operation, it only unblocks the waiting thread when it reaches the end of the critical section. This is needed to respect mutual-exclusion. Second, in \CFA, \code{condition} have no particular need to be stored inside a monitor, beyond any software engineering reasons. Here routine \code{foo} waits for the \code{signal} from \code{bar} before making further progress, effectively ensuring a basic ordering. 294 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, 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. 261 296 262 297 % ====================================================================== … … 265 300 % ====================================================================== 266 301 % ====================================================================== 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.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. 268 303 269 304 \begin{multicols}{2} … … 284 319 \end{pseudo} 285 320 \end{multicols} 286 The example shows the simple case of having two threads (one for each column) and a single monitor A. One thread acquires before waiting (atomically blocking and releasing A) and the other acquires before signalling. It is important to note here that both \code{wait} and \code{signal} must be called with the proper monitor(s) already acquired. This semanticis a logical requirement for barging prevention.287 288 A direct extension of the previous example is a \gls{bulk-acq} version: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 it is a logical requirement for barging prevention. 322 323 A direct extension of the previous example is the \gls{group-acquire} version: 289 324 290 325 \begin{multicols}{2} … … 303 338 \end{pseudo} 304 339 \end{multicols} 305 This version uses \gls{bulk-acq} (denoted using the {\sf\&} symbol), but the presence of multiple monitors does not add a particularly new meaning. Synchronization happens between the two threads in exactly the same way and order. The only difference is that mutual exclusion covers more monitors. On the implementation side, handling multiple monitors does add a degree of complexity as the next few examples demonstrate. 306 307 While deadlock issues can occur when nesting monitors, these issues are only a symptom of the fact that locks, and by extension monitors, are not perfectly composable. For monitors, a well known deadlock problem is the Nested Monitor Problem\cit, which occurs when a \code{wait} is made by a thread that holds more than one monitor. For example, the following pseudo-code runs into the nested-monitor problem : 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 308 344 \begin{multicols}{2} 309 345 \begin{pseudo} … … 318 354 319 355 \begin{pseudo} 320 acquire A321 acquire B322 signal B323 release B324 release A325 \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 A335 acquire B336 wait B337 release B338 release A339 \end{pseudo}340 341 \columnbreak342 343 \begin{pseudo}344 356 345 357 acquire B … … 350 362 \end{multicols} 351 363 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] 364 The next example is where \gls{group-acquire} adds a significant layer of complexity to the internal signalling semantics. 365 361 366 \begin{multicols}{2} 362 367 Waiting thread 363 368 \begin{pseudo}[numbers=left] 364 369 acquire A 365 // Code Section 1370 // Code Section 1 366 371 acquire A & B 367 // Code Section 2372 // Code Section 2 368 373 wait A & B 369 // Code Section 3374 // Code Section 3 370 375 release A & B 371 // Code Section 4376 // Code Section 4 372 377 release A 373 378 \end{pseudo} … … 378 383 \begin{pseudo}[numbers=left, firstnumber=10] 379 384 acquire A 380 // Code Section 5385 // Code Section 5 381 386 acquire A & B 382 // Code Section 6387 // Code Section 6 383 388 signal A & B 384 // Code Section 7389 // Code Section 7 385 390 release A & B 386 // Code Section 8391 // Code Section 8 387 392 release A 388 393 \end{pseudo} 389 394 \end{multicols} 390 \caption{Internal scheduling with \gls{bulk-acq}} 391 \label{lst:int-bulk-pseudo} 392 \end{figure} 393 394 \begin{figure}[!b] 395 \begin{center} 396 \begin{cfacode}[xleftmargin=.4\textwidth] 397 monitor A a; 398 monitor B b; 399 condition c; 400 \end{cfacode} 401 \end{center} 402 \begin{multicols}{2} 403 Waiting thread 404 \begin{cfacode} 405 mutex(a) { 406 //Code Section 1 407 mutex(a, b) { 408 //Code Section 2 409 wait(c); 410 //Code Section 3 411 } 412 //Code Section 4 413 } 414 \end{cfacode} 415 416 \columnbreak 417 418 Signalling thread 419 \begin{cfacode} 420 mutex(a) { 421 //Code Section 5 422 mutex(a, b) { 423 //Code Section 6 424 signal(c); 425 //Code Section 7 426 } 427 //Code Section 8 428 } 429 \end{cfacode} 430 \end{multicols} 431 \caption{Equivalent \CFA code for listing \ref{lst:int-bulk-pseudo}} 432 \label{lst:int-bulk-cfa} 433 \end{figure} 434 435 The complexity begins at code sections 4 and 8, which are where the existing semantics of internal scheduling need to be extended for multiple monitors. The root of the problem is that \gls{bulk-acq} is used in a context where one of the monitors is already acquired and is why it is important to define the behaviour of the previous pseudo-code. When the signaller thread reaches the location where it should ``release \code{A & B}'' (line 16), it must actually transfer ownership of monitor \code{B} to the waiting thread. This ownership trasnfer is required in order to prevent barging. Since the signalling thread still needs monitor \code{A}, simply waking up the waiting thread is not an option because it violates mutual exclusion. There are three options. 395 \begin{center} 396 Listing 1 397 \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: 436 400 437 401 \subsubsection{Delaying signals} 438 The obvious solution to solve the problem of multi-monitor scheduling is to keep ownership of all locks until the last lock is ready to be transferred. It can be argued that that moment is when the last lock is no longer needed because this semantics fits most closely to the behaviour of single-monitor scheduling. This solution has the main benefit of transferring ownership of groups of monitors, which simplifies the semantics from mutiple objects to a single group of objects, effectively making the existing single-monitor semantic viable by simply changing monitors to monitor groups.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. 439 403 \begin{multicols}{2} 440 404 Waiter … … 460 424 \end{pseudo} 461 425 \end{multicols} 462 However, this solution can become much more complicated depending on what is executed while secretly holding B (at line 10). Indeed, nothing prevents signalling monitor A on a different condition variable:463 \ begin{figure}464 \begin{multicols}{ 3}465 Thread $\alpha$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 from signalling monitor A on a different condition variable: 427 \newpage 428 \begin{multicols}{2} 429 Thread 1 466 430 \begin{pseudo}[numbers=left, firstnumber=1] 467 431 acquire A … … 472 436 \end{pseudo} 473 437 438 Thread 2 439 \begin{pseudo}[numbers=left, firstnumber=6] 440 acquire A 441 wait A 442 release A 443 \end{pseudo} 444 474 445 \columnbreak 475 446 476 Thread $\gamma$477 \begin{pseudo}[numbers=left, firstnumber=1 ]447 Thread 3 448 \begin{pseudo}[numbers=left, firstnumber=10] 478 449 acquire A 479 450 acquire A & B 480 451 signal A & B 481 452 release A & B 453 //Secretly keep B here 482 454 signal A 483 455 release A 484 \end{pseudo} 485 486 \columnbreak 487 488 Thread $\beta$ 489 \begin{pseudo}[numbers=left, firstnumber=1] 490 acquire A 491 wait A 492 release A 493 \end{pseudo} 494 456 //Wakeup thread 1 or 2? 457 //Who wakes up the other thread? 458 \end{pseudo} 495 459 \end{multicols} 496 \caption{Dependency graph}497 \label{lst:dependency}498 \end{figure}499 460 500 461 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. … … 506 467 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. 507 468 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.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. 509 470 510 471 \subsubsection{Dependency graphs} 511 In the listing \ref{lst:int-bulk-pseudo} pseudo-code, there is a solution which statisfies both barging prevention and mutual exclusion. If ownership of both monitors is transferred to the waiter when the signaller releases \code{A & B} and then the waiter transfers back ownership of \code{A} when it releases it, then the problem is solved (\code{B} is no longer in use at this point). Dynamically finding the correct order is therefore the second possible solution. The problem it encounters is that it effectively boils down to resolving a dependency graph of ownership requirements. Here even the simplest of code snippets requires two transfers and it seems to increase in a manner closer to polynomial. For example, the following code, which is just a direct extension to three monitors, requires at least three ownership transfer and has multiple solutions: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: 512 473 513 474 \begin{multicols}{2} … … 534 495 \end{pseudo} 535 496 \end{multicols} 536 537 \begin{figure} 538 \begin{center} 539 \input{dependency} 540 \end{center} 541 \caption{Dependency graph of the statements in listing \ref{lst:dependency}} 542 \label{fig:dependency} 543 \end{figure} 544 545 Listing \ref{lst:dependency} is the three thread example rewritten for dependency graphs. Figure \ref{fig:dependency} shows the corresponding dependency graph that results, where every node is a statement of one of the three threads, and the arrows the dependency of that statement (e.g., $\alpha1$ must happen before $\alpha2$). The extra challenge is that this dependency graph is effectively post-mortem, but the runtime system needs to be able to build and solve these graphs as the dependency unfolds. Resolving dependency graph being a complex and expensive endeavour, this solution is not the preffered one. 497 Resolving dependency graph being a complex and expensive endeavour, this solution is not the preffered one. 546 498 547 499 \subsubsection{Partial signalling} \label{partial-sig} 548 Finally, the solution that is chosen for \CFA is to use partial signalling. Again using listing \ref{lst:int-bulk-pseudo}, the partial signalling solution transfers ownership of monitor B at lines 10 but does not wake the waiting thread since it is still using monitor A. Only when it reaches line 11 does it actually wakeup the waiting thread. This solution has the benefit that complexity is encapsulated into only two actions, passing monitors to the next owner when they should be release and conditionally waking threads if all conditions are met. This solution has a much simpler implementation than a dependency graph solving algorithm which is why it was chosen. Furthermore, after being fully implemented, this solution does not appear to have any downsides worth mentionning. 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. 549 523 550 524 % ====================================================================== … … 553 527 % ====================================================================== 554 528 % ====================================================================== 555 \begin{figure} 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} 556 533 \begin{tabular}{|c|c|} 557 534 \code{signal} & \code{signal_block} \\ 558 535 \hline 559 \begin{cfacode}[tabsize=3] 560 monitor DatingService 561 { 562 //compatibility codes 563 enum{ CCodes = 20 }; 564 565 int girlPhoneNo 566 int boyPhoneNo; 567 }; 568 569 condition girls[CCodes]; 570 condition boys [CCodes]; 571 condition exchange; 572 573 int girl(int phoneNo, int ccode) 574 { 575 //no compatible boy ? 576 if(empty(boys[ccode])) 577 { 578 //wait for boy 579 wait(girls[ccode]); 580 581 //make phone number available 582 girlPhoneNo = phoneNo; 583 584 //wake boy from chair 585 signal(exchange); 586 } 587 else 588 { 589 //make phone number available 590 girlPhoneNo = phoneNo; 591 592 //wake boy 593 signal(boys[ccode]); 594 595 //sit in chair 596 wait(exchange); 597 } 598 return boyPhoneNo; 599 } 600 601 int boy(int phoneNo, int ccode) 602 { 603 //same as above 604 //with boy/girl interchanged 605 } 606 \end{cfacode}&\begin{cfacode}[tabsize=3] 607 monitor DatingService 608 { 609 //compatibility codes 610 enum{ CCodes = 20 }; 611 612 int girlPhoneNo; 613 int boyPhoneNo; 614 }; 615 616 condition girls[CCodes]; 617 condition boys [CCodes]; 618 //exchange is not needed 619 620 int girl(int phoneNo, int ccode) 621 { 622 //no compatible boy ? 623 if(empty(boys[ccode])) 624 { 625 //wait for boy 626 wait(girls[ccode]); 627 628 //make phone number available 629 girlPhoneNo = phoneNo; 630 631 //wake boy from chair 632 signal(exchange); 633 } 634 else 635 { 636 //make phone number available 637 girlPhoneNo = phoneNo; 638 639 //wake boy 640 signal_block(boys[ccode]); 641 642 //second handshake unnecessary 643 644 } 645 return boyPhoneNo; 646 } 647 648 int boy(int phoneNo, int ccode) 649 { 650 //same as above 651 //with boy/girl interchanged 536 \begin{cfacode} 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; 652 579 } 653 580 \end{cfacode} 654 581 \end{tabular} 655 \caption{Dating service example using \code{signal} and \code{signal_block}. } 656 \label{lst:datingservice} 657 \end{figure} 658 An important note is that, until now, signalling a monitor was a delayed operation. The ownership of the monitor is transferred only when the monitor would have otherwise been released, not at the point of the \code{signal} statement. However, in some cases, it may be more convenient for users to immediately transfer ownership to the thread that is waiting for cooperation, which is achieved using the \code{signal_block} routine\footnote{name to be discussed}. 659 660 The example in listing \ref{lst:datingservice} highlights the difference in behaviour. As mentioned, \code{signal} only transfers ownership once the current critical section exits, this behaviour requires additional synchronisation when a two-way handshake is needed. To avoid this extraneous synchronisation, the \code{condition} type offers the \code{signal_block} routine, which handles the two-way handshake as shown in the example. This removes the need for a second condition variables and simplifies programming. Like every other monitor semantic, \code{signal_block} uses barging prevention, which means mutual-exclusion is baton-passed both on the frond-end and the back-end of the call to \code{signal_block}, meaning no other thread can acquire the monitor neither before nor after the call. 582 \end{center} 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 585 \begin{center} 586 \begin{tabular}{|c|c|} 587 \code{signal} & \code{signal_block} \\ 588 \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. 661 660 662 661 % ====================================================================== … … 665 664 % ====================================================================== 666 665 % ====================================================================== 667 An alternative to internal scheduling is external scheduling, e.g., in \uC.668 \begin{center} 669 \begin{tabular}{|c|c| c|}670 Internal Scheduling & External Scheduling & Go\\666 An alternative to internal scheduling is to use external scheduling. 667 \begin{center} 668 \begin{tabular}{|c|c|} 669 Internal Scheduling & External Scheduling \\ 671 670 \hline 672 \begin{ucppcode} [tabsize=3]671 \begin{ucppcode} 673 672 _Monitor Semaphore { 674 673 condition c; … … 676 675 public: 677 676 void P() { 678 if(inUse) 679 wait(c); 677 if(inUse) wait(c); 680 678 inUse = true; 681 679 } … … 685 683 } 686 684 } 687 \end{ucppcode}&\begin{ucppcode} [tabsize=3]685 \end{ucppcode}&\begin{ucppcode} 688 686 _Monitor Semaphore { 689 687 … … 691 689 public: 692 690 void P() { 693 if(inUse) 694 _Accept(V); 691 if(inUse) _Accept(V); 695 692 inUse = true; 696 693 } … … 700 697 } 701 698 } 702 \end{ucppcode}&\begin{gocode}[tabsize=3] 703 type MySem struct { 704 inUse bool 705 c chan bool 706 } 707 708 // acquire 709 func (s MySem) P() { 710 if s.inUse { 711 select { 712 case <-s.c: 713 } 714 } 715 s.inUse = true 716 } 717 718 // release 719 func (s MySem) V() { 720 s.inUse = false 721 722 //This actually deadlocks 723 //when single thread 724 s.c <- false 725 } 726 \end{gocode} 699 \end{ucppcode} 727 700 \end{tabular} 728 701 \end{center} 729 This method is more constrained and explicit, which helps users tone down the undeterministic nature of concurrency. Indeed, as the following examples demonstrates, external scheduling allows users to wait for events from other threads without the concern of unrelated events occuring. External scheduling can generally be done either in terms of control flow (e.g., \uC with \code{_Accept}) or in terms of data (e.g., Go with channels). Of course, both of these paradigms have their own strenghts and weaknesses but for this project control-flow semantics were chosen to stay consistent with the rest of the languages semantics. Two challenges specific to \CFA arise when trying to add external scheduling with loose object definitions and multi-monitor routines. The previous example shows a simple use \code{_Accept} versus \code{wait}/\code{signal} and its advantages. Note that while other languages often use \code{accept}/\code{select} as the core external scheduling keyword, \CFA uses \code{waitfor} to prevent name collisions with existing socket \acrshort{api}s.730 731 For the \code{P} member above using internal scheduling, the call to \code{wait} only guarantees that \code{V} is the last routine to access the monitor, allowing a third routine, say \code{isInUse()}, acquire mutual exclusion several times while routine \code{P} is waiting. On the other hand, external scheduling guarantees that while routine \code{P} is waiting, no routine other than \code{V} canacquire the monitor.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} could acquire the monitor. 732 705 733 706 % ====================================================================== … … 736 709 % ====================================================================== 737 710 % ====================================================================== 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 } 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 } 752 721 \end{cfacode} 753 722 … … 759 728 if monitor is free 760 729 enter 761 elif already own the monitor730 elif I already own the monitor 762 731 continue 763 732 elif monitor accepts me … … 769 738 \end{center} 770 739 771 For the fi rst 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:740 For the fist two conditions, it is easy to implement a check that can evaluate the condition in a few instruction. However, a fast check for \pscode{monitor accepts me} is much harder to implement depending on the constraints put on the monitors. Indeed, monitors are often expressed as an entry queue and some acceptor queue as in the following figure: 772 741 773 742 \begin{center} … … 775 744 \end{center} 776 745 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: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: 779 748 780 749 \begin{center} … … 782 751 \end{center} 783 752 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. 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. 806 758 807 759 % ====================================================================== … … 811 763 % ====================================================================== 812 764 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 }765 External scheduling, like internal scheduling, becomes orders of magnitude more complex when we start introducing multi-monitor syntax. Even in the simplest possible case some new semantics need to be established: 766 \begin{cfacode} 767 mutex struct A {}; 768 769 mutex struct B {}; 770 771 void g(A & mutex a, B & mutex b) { 772 waitfor(f); //ambiguous, which monitor 773 } 822 774 \end{cfacode} 823 775 … … 825 777 826 778 \begin{cfacode} 827 monitor M {}; 828 829 void f(M & mutex a); 830 831 void g(M & mutex a, M & mutex b) { 832 waitfor( f, b ); 833 } 834 \end{cfacode} 835 836 This syntax is unambiguous. Both locks are acquired and kept by \code{g}. When routine \code{f} is called, the lock for monitor \code{b} is temporarily transferred from \code{g} to \code{f} (while \code{g} still holds lock \code{a}). This behavior can be extended to multi-monitor \code{waitfor} statement as follows. 837 838 \begin{cfacode} 839 monitor M {}; 840 841 void f(M & mutex a, M & mutex b); 842 843 void g(M & mutex a, M & mutex b) { 844 waitfor( f, a, b); 845 } 846 \end{cfacode} 847 848 Note that the set of monitors passed to the \code{waitfor} statement must be entirely contained in the set of monitors already acquired in the routine. \code{waitfor} used in any other context is Undefined Behaviour. 849 850 An important behavior to note is when a set of monitors only match partially : 851 852 \begin{cfacode} 853 mutex struct A {}; 854 855 mutex struct B {}; 856 857 void g(A & mutex a, B & mutex b) { 858 waitfor(f, a, b); 859 } 860 861 A a1, a2; 862 B b; 863 864 void foo() { 865 g(a1, b); //block on accept 866 } 867 868 void bar() { 869 f(a2, b); //fufill cooperation 870 } 871 \end{cfacode} 872 873 While the equivalent can happen when using internal scheduling, the fact that conditions are specific to a set of monitors means that users have to use two different condition variables. In both cases, partially matching monitor sets does not wake-up the waiting thread. It is also important to note that in the case of external scheduling, as for routine calls, the order of parameters is irrelevant; \code{waitfor(f,a,b)} and \code{waitfor(f,b,a)} are indistinguishable waiting condition. 874 875 % ====================================================================== 876 % ====================================================================== 877 \subsection{\code{waitfor} semantics} 878 % ====================================================================== 879 % ====================================================================== 880 881 Syntactically, the \code{waitfor} statement takes a function identifier and a set of monitors. While the set of monitors can be any list of expression, the function name is more restricted because the compiler validates at compile time the validity of the function type and the parameters used with the \code{waitfor} statement. It checks that the set of monitor passed in matches the requirements for a function call. Listing \ref{lst:waitfor} shows various usage of the waitfor statement and which are acceptable. The choice of the function type is made ignoring any non-\code{mutex} parameter. One limitation of the current implementation is that it does not handle overloading. 882 \begin{figure} 883 \begin{cfacode} 884 monitor A{}; 885 monitor B{}; 886 887 void f1( A & mutex ); 888 void f2( A & mutex, B & mutex ); 889 void f3( A & mutex, int ); 890 void f4( A & mutex, int ); 891 void f4( A & mutex, double ); 892 893 void foo( A & mutex a1, A & mutex a2, B & mutex b1, B & b2 ) { 894 A * ap = & a1; 895 void (*fp)( A & mutex ) = f1; 896 897 waitfor(f1, a1); //Correct : 1 monitor case 898 waitfor(f2, a1, b1); //Correct : 2 monitor case 899 waitfor(f3, a1); //Correct : non-mutex arguments are ignored 900 waitfor(f1, *ap); //Correct : expression as argument 901 902 waitfor(f1, a1, b1); //Incorrect : Too many mutex arguments 903 waitfor(f2, a1); //Incorrect : Too few mutex arguments 904 waitfor(f2, a1, a2); //Incorrect : Mutex arguments don't match 905 waitfor(f1, 1); //Incorrect : 1 not a mutex argument 906 waitfor(f9, a1); //Incorrect : f9 function does not exist 907 waitfor(*fp, a1 ); //Incorrect : fp not an identifier 908 waitfor(f4, a1); //Incorrect : f4 ambiguous 909 910 waitfor(f2, a1, b2); //Undefined Behaviour : b2 may not acquired 911 } 912 \end{cfacode} 913 \caption{Various correct and incorrect uses of the waitfor statement} 914 \label{lst:waitfor} 915 \end{figure} 916 917 Finally, for added flexibility, \CFA supports constructing complex \code{waitfor} mask using the \code{or}, \code{timeout} and \code{else}. Indeed, multiple \code{waitfor} can be chained together using \code{or}; this chain forms a single statement that uses baton-pass to any one function that fits one of the function+monitor set passed in. To eanble users to tell which accepted function is accepted, \code{waitfor}s are followed by a statement (including the null statement \code{;}) or a compound statement. When multiple \code{waitfor} are chained together, only the statement corresponding to the accepted function is executed. A \code{waitfor} chain can also be followed by a \code{timeout}, to signify an upper bound on the wait, or an \code{else}, to signify that the call should be non-blocking, that is only check of a matching function call already arrived and return immediately otherwise. Any and all of these clauses can be preceded by a \code{when} condition to dynamically construct the mask based on some current state. Listing \ref{lst:waitfor2}, demonstrates several complex masks and some incorrect ones. 918 919 \begin{figure} 920 \begin{cfacode} 921 monitor A{}; 922 923 void f1( A & mutex ); 924 void f2( A & mutex ); 925 926 void foo( A & mutex a, bool b, int t ) { 927 //Correct : blocking case 928 waitfor(f1, a); 929 930 //Correct : block with statement 931 waitfor(f1, a) { 932 sout | "f1" | endl; 933 } 934 935 //Correct : block waiting for f1 or f2 936 waitfor(f1, a) { 937 sout | "f1" | endl; 938 } or waitfor(f2, a) { 939 sout | "f2" | endl; 940 } 941 942 //Correct : non-blocking case 943 waitfor(f1, a); or else; 944 945 //Correct : non-blocking case 946 waitfor(f1, a) { 947 sout | "blocked" | endl; 948 } or else { 949 sout | "didn't block" | endl; 950 } 951 952 //Correct : block at most 10 seconds 953 waitfor(f1, a) { 954 sout | "blocked" | endl; 955 } or timeout( 10`s) { 956 sout | "didn't block" | endl; 957 } 958 959 //Correct : block only if b == true 960 //if b == false, don't even make the call 961 when(b) waitfor(f1, a); 962 963 //Correct : block only if b == true 964 //if b == false, make non-blocking call 965 waitfor(f1, a); or when(!b) else; 966 967 //Correct : block only of t > 1 968 waitfor(f1, a); or when(t > 1) timeout(t); or else; 969 970 //Incorrect : timeout clause is dead code 971 waitfor(f1, a); or timeout(t); or else; 972 973 //Incorrect : order must be 974 //waitfor [or waitfor... [or timeout] [or else]] 975 timeout(t); or waitfor(f1, a); or else; 976 } 977 \end{cfacode} 978 \caption{Various correct and incorrect uses of the or, else, and timeout clause around a waitfor statement} 979 \label{lst:waitfor2} 980 \end{figure} 981 982 % ====================================================================== 983 % ====================================================================== 984 \subsection{Waiting for the destructor} 985 % ====================================================================== 986 % ====================================================================== 987 An interesting use for the \code{waitfor} statement is destructor semantics. Indeed, the \code{waitfor} statement can accept any \code{mutex} routine, which includes the destructor (see section \ref{data}). However, with the semantics discussed until now, waiting for the destructor does not make any sense since using an object after its destructor is called is undefined behaviour. The simplest approach is to disallow \code{waitfor} on a destructor. However, a more expressive approach is to flip execution ordering when waiting for the destructor, meaning that waiting for the destructor allows the destructor to run after the current \code{mutex} routine, similarly to how a condition is signalled. 988 \begin{figure} 989 \begin{cfacode} 990 monitor Executer {}; 991 struct Action; 992 993 void ^?{} (Executer & mutex this); 994 void execute(Executer & mutex this, const Action & ); 995 void run (Executer & mutex this) { 996 while(true) { 997 waitfor(execute, this); 998 or waitfor(^?{} , this) { 999 break; 1000 } 1001 } 1002 } 1003 \end{cfacode} 1004 \caption{Example of an executor which executes action in series until the destructor is called.} 1005 \label{lst:dtor-order} 1006 \end{figure} 1007 For example, listing \ref{lst:dtor-order} shows an example of an executor with an infinite loop, which waits for the destructor to break out of this loop. Switching the semantic meaning introduces an idiomatic way to terminate a task and/or wait for its termination via destruction. 779 mutex struct A {}; 780 781 mutex struct B {}; 782 783 void g(A & mutex a, B & mutex b) { 784 waitfor( f, b ); 785 } 786 \end{cfacode} 787 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 -
doc/proposals/concurrency/text/intro.tex
r3f7e12cb r78315272 3 3 % ====================================================================== 4 4 5 This thesis provides a minimal concurrency \acrshort{api} that is simple, efficient and can be reused to build higher-level features. The simplest possible concurrency system is a thread and a lock but this low-level approach is hard to master. An easier approach for users is to support higher-level constructs as the basis of concurrency. Indeed, for highly productive concurrent programming, high-level approaches are much more popular~\cite{HPP:Study}. Examples are task based, message passing and implicit threading. The high-level approach and its minimal \acrshort{api} are tested in a dialect of C, call \CFA. Furthermore, the proposed \acrshort{api} doubles as an early definition of the \CFA language and library. This thesis also comes with an implementation of the concurrency library for \CFA as well as all the required language features added to the source-to-source translator.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 \CFA 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 programmer. While these two concepts are often combined, they are in fact distinct, requiringdifferent 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 users. While these two concepts are often combined, they are in fact distinct concepts that require different tools~\cite{Buhr05a}. Concurrency tools need to handle mutual exclusion and synchronization, while parallelism tools are about performance, cost and resource utilization. -
doc/proposals/concurrency/text/parallelism.tex
r3f7e12cb r78315272 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 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.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 expensives costs of using kernel threads. The down side is that almost none of the low-level threading problems are hidden, users still have to think about data races, deadlocks and synchronization issues. These issues can be somewhat alleviated by a concurrency toolkit with strong garantees but the parallelism toolkit offers very little to reduce complexity in itself. 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 ered 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 ignoresfibers.18 A popular varient of \glspl{uthread} is what is often reffered to as \glspl{fiber}. However, \glspl{fiber} do not present meaningful semantical differences with \glspl{uthread}. Advocates of \glspl{fiber} list their high performance and ease of implementation as majors strenghts of \glspl{fiber} but the performance difference between \glspl{uthread} and \glspl{fiber} is controversial and the ease of implementation, while true, is a weak argument in the context of language design. Therefore this proposal largely ignore fibers. 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 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 limitthe 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 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 limits the interaction that can occur among jobs. Indeed, any \gls{job} that blocks also blocks the underlying worker, which effectively means the CPU utilization, and therefore throughput, suffers noticeably. It can be argued that a solution to this problem is to use more workers than available cores. However, unless the number of jobs and the number of workers are comparable, having a significant amount of blocked jobs always results in idles cores. 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 (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.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. 29 29 30 \section{The \protect\CFA\ Kernel : Processors, Clusters and Threads}\label{kernel} 30 \newpage 31 \TODO 32 \subsection{The \protect\CFA\ Kernel : Processors, Clusters and Threads}\label{kernel} 31 33 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.36 34 37 35 \subsection{Paradigms}\label{cfaparadigms} 38 Given these building blocks, it is possible to reproduce all three of the popular paradigms. Indeed, \glspl{uthread} is the default paradigm in \CFA. However, disabling \gls{preemption} on the \gls{cfacluster} means \glspl{cfathread} effectively become \glspl{fiber}. Since several \glspl{cfacluster} with different scheduling policy can coexist in the same application, this allows \glspl{fiber} and \glspl{uthread} to coexist in the runtime of an application. Finally, it is possible to build executors for thread pools from \glspl{uthread} or \glspl{fiber}. 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? -
doc/proposals/concurrency/thesis.tex
r3f7e12cb r78315272 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}38 37 \renewcommand{\linenumberfont}{\scriptsize\sffamily} 39 \usepackage{siunitx}40 \sisetup{ binary-units=true }41 38 \input{style} % bespoke macros used in the document 42 39 \usepackage[dvips,plainpages=false,pdfpagelabels,pdfpagemode=UseNone,colorlinks=true,pagebackref=true,linkcolor=blue,citecolor=blue,urlcolor=blue,pagebackref=true,breaklinks=true]{hyperref} … … 73 70 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 74 71 75 \setcounter{secnumdepth}{ 2} % number subsubsections76 \setcounter{tocdepth}{ 2} % subsubsections in table of contents72 \setcounter{secnumdepth}{3} % number subsubsections 73 \setcounter{tocdepth}{3} % subsubsections in table of contents 77 74 % \linenumbers % comment out to turn off line numbering 78 75 \makeindex … … 106 103 \input{parallelism} 107 104 108 \input{internals} 109 110 \input{together} 111 112 \input{results} 113 114 \input{future} 105 \chapter{Putting it all together} 115 106 116 107 \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} 117 112 118 113 \section*{Acknowledgements} -
doc/proposals/concurrency/version
r3f7e12cb r78315272 1 0. 11.471 0.9.180 -
src/CodeGen/CodeGenerator.cc
r3f7e12cb r78315272 287 287 void CodeGenerator::postvisit( TypeDecl * typeDecl ) { 288 288 assertf( ! genC, "TypeDecls should not reach code generation." ); 289 output << typeDecl->genTypeString() << " " << typeDecl-> name;290 if ( typeDecl-> sized) {291 output << " | sized(" << typeDecl-> name<< ")";292 } 293 if ( ! typeDecl-> assertions.empty() ) {289 output << typeDecl->genTypeString() << " " << typeDecl->get_name(); 290 if ( typeDecl->get_kind() != TypeDecl::Any && typeDecl->get_sized() ) { 291 output << " | sized(" << typeDecl->get_name() << ")"; 292 } 293 if ( ! typeDecl->get_assertions().empty() ) { 294 294 output << " | { "; 295 for ( DeclarationWithType * assert : typeDecl->assertions ) { 296 assert->accept( *visitor ); 297 output << "; "; 298 } 295 genCommaList( typeDecl->get_assertions().begin(), typeDecl->get_assertions().end() ); 299 296 output << " }"; 300 297 } … … 446 443 void CodeGenerator::postvisit( UntypedExpr * untypedExpr ) { 447 444 extension( untypedExpr ); 448 if ( NameExpr * nameExpr = dynamic_cast< NameExpr* >( untypedExpr-> function) ) {445 if ( NameExpr * nameExpr = dynamic_cast< NameExpr* >( untypedExpr->get_function() ) ) { 449 446 OperatorInfo opInfo; 450 if ( operatorLookup( nameExpr-> name, opInfo ) ) {451 std::list< Expression* >::iterator arg = untypedExpr-> args.begin();447 if ( operatorLookup( nameExpr->get_name(), opInfo ) ) { 448 std::list< Expression* >::iterator arg = untypedExpr->get_args().begin(); 452 449 switch ( opInfo.type ) { 453 450 case OT_INDEX: 454 assert( untypedExpr-> args.size() == 2 );451 assert( untypedExpr->get_args().size() == 2 ); 455 452 (*arg++)->accept( *visitor ); 456 453 output << "["; … … 464 461 case OT_CTOR: 465 462 case OT_DTOR: 466 if ( untypedExpr-> args.size() == 1 ) {463 if ( untypedExpr->get_args().size() == 1 ) { 467 464 // the expression fed into a single parameter constructor or destructor may contain side 468 465 // effects, so must still output this expression … … 483 480 (*arg++)->accept( *visitor ); 484 481 output << opInfo.symbol << "{ "; 485 genCommaList( arg, untypedExpr-> args.end() );482 genCommaList( arg, untypedExpr->get_args().end() ); 486 483 output << "}) /* " << opInfo.inputName << " */"; 487 484 } // if … … 491 488 case OT_PREFIXASSIGN: 492 489 case OT_LABELADDRESS: 493 assert( untypedExpr-> args.size() == 1 );490 assert( untypedExpr->get_args().size() == 1 ); 494 491 output << "("; 495 492 output << opInfo.symbol; … … 500 497 case OT_POSTFIX: 501 498 case OT_POSTFIXASSIGN: 502 assert( untypedExpr-> args.size() == 1 );499 assert( untypedExpr->get_args().size() == 1 ); 503 500 (*arg)->accept( *visitor ); 504 501 output << opInfo.symbol; … … 507 504 case OT_INFIX: 508 505 case OT_INFIXASSIGN: 509 assert( untypedExpr-> args.size() == 2 );506 assert( untypedExpr->get_args().size() == 2 ); 510 507 output << "("; 511 508 (*arg++)->accept( *visitor ); … … 520 517 } // switch 521 518 } else { 522 // builtin routines 523 nameExpr->accept( *visitor ); 524 output << "("; 525 genCommaList( untypedExpr->args.begin(), untypedExpr->args.end() ); 526 output << ")"; 519 if ( nameExpr->get_name() == "..." ) { // case V1 ... V2 or case V1~V2 520 assert( untypedExpr->get_args().size() == 2 ); 521 (*untypedExpr->get_args().begin())->accept( *visitor ); 522 output << " ... "; 523 (*--untypedExpr->get_args().end())->accept( *visitor ); 524 } else { // builtin routines 525 nameExpr->accept( *visitor ); 526 output << "("; 527 genCommaList( untypedExpr->get_args().begin(), untypedExpr->get_args().end() ); 528 output << ")"; 529 } // if 527 530 } // if 528 531 } else { 529 untypedExpr-> function->accept( *visitor );532 untypedExpr->get_function()->accept( *visitor ); 530 533 output << "("; 531 genCommaList( untypedExpr-> args.begin(), untypedExpr->args.end() );534 genCommaList( untypedExpr->get_args().begin(), untypedExpr->get_args().end() ); 532 535 output << ")"; 533 536 } // if … … 535 538 536 539 void CodeGenerator::postvisit( RangeExpr * rangeExpr ) { 537 rangeExpr-> low->accept( *visitor );540 rangeExpr->get_low()->accept( *visitor ); 538 541 output << " ... "; 539 rangeExpr-> high->accept( *visitor );542 rangeExpr->get_high()->accept( *visitor ); 540 543 } 541 544 … … 543 546 extension( nameExpr ); 544 547 OperatorInfo opInfo; 545 if ( operatorLookup( nameExpr->name, opInfo ) ) { 546 if ( opInfo.type == OT_CONSTANT ) { 547 output << opInfo.symbol; 548 } else { 549 output << opInfo.outputName; 550 } 548 if ( operatorLookup( nameExpr->get_name(), opInfo ) ) { 549 assert( opInfo.type == OT_CONSTANT ); 550 output << opInfo.symbol; 551 551 } else { 552 552 output << nameExpr->get_name(); … … 885 885 886 886 void CodeGenerator::postvisit( CaseStmt * caseStmt ) { 887 updateLocation( caseStmt );888 output << indent;889 887 if ( caseStmt->isDefault()) { 890 888 output << "default"; … … 949 947 output << ";"; 950 948 } 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 1014 949 1015 950 void CodeGenerator::postvisit( WhileStmt * whileStmt ) { … … 1090 1025 } 1091 1026 } // 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 }1104 1027 1105 1028 // Local Variables: // -
src/CodeGen/CodeGenerator.h
r3f7e12cb r78315272 100 100 void postvisit( ReturnStmt * ); 101 101 void postvisit( ThrowStmt * ); 102 void postvisit( CatchStmt * );103 void postvisit( WaitForStmt * );104 102 void postvisit( WhileStmt * ); 105 103 void postvisit( ForStmt * ); -
src/CodeGen/FixNames.cc
r3f7e12cb r78315272 66 66 ); 67 67 68 main _type->get_parameters().push_back(68 mainDecl->get_functionType()->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 _type->get_parameters().push_back(72 mainDecl->get_functionType()->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
r3f7e12cb r78315272 210 210 211 211 std::string GenType::handleGeneric( ReferenceToType * refType ) { 212 if ( ! refType-> parameters.empty() ) {212 if ( ! refType->get_parameters().empty() ) { 213 213 std::ostringstream os; 214 214 PassVisitor<CodeGenerator> cg( os, pretty, genC, lineMarks ); 215 215 os << "("; 216 cg.pass.genCommaList( refType-> parameters.begin(), refType->parameters.end() );216 cg.pass.genCommaList( refType->get_parameters().begin(), refType->get_parameters().end() ); 217 217 os << ") "; 218 218 return os.str(); -
src/Common/Indenter.h
r3f7e12cb r78315272 18 18 19 19 struct Indenter { 20 static unsigned tabsize; 21 22 Indenter( unsigned int amt = tabsize, unsigned int indent = 0 ) : amt( amt ), indent( indent ) {} 23 unsigned int amt; // amount 1 level increases indent by (i.e. how much to increase by in operator++) 24 unsigned int indent; 20 Indenter( unsigned int amt = 2 ) : amt( amt ) {} 21 unsigned int amt = 2; // amount 1 level increases indent by (i.e. how much to increase by in operator++) 22 unsigned int indent = 0; 25 23 26 24 Indenter & operator+=(int nlevels) { indent += amt*nlevels; return *this; } … … 32 30 }; 33 31 34 inline std::ostream & operator<<( std::ostream & out, constIndenter & indent ) {32 inline std::ostream & operator<<( std::ostream & out, Indenter & indent ) { 35 33 return out << std::string(indent.indent, ' '); 36 34 } -
src/Common/PassVisitor.h
r3f7e12cb r78315272 4 4 5 5 #include <stack> 6 7 #include "Common/utility.h"8 6 9 7 #include "SynTree/Mutator.h" … … 12 10 #include "SymTab/Indexer.h" 13 11 14 #include "SynTree/Attribute.h"15 12 #include "SynTree/Initializer.h" 16 13 #include "SynTree/Statement.h" … … 56 53 pass_type pass; 57 54 58 virtual void visit( ObjectDecl * objectDecl ) override final; 59 virtual void visit( FunctionDecl * functionDecl ) override final; 60 virtual void visit( StructDecl * aggregateDecl ) override final; 61 virtual void visit( UnionDecl * aggregateDecl ) override final; 62 virtual void visit( EnumDecl * aggregateDecl ) override final; 63 virtual void visit( TraitDecl * aggregateDecl ) override final; 64 virtual void visit( TypeDecl * typeDecl ) override final; 65 virtual void visit( TypedefDecl * typeDecl ) override final; 66 virtual void visit( AsmDecl * asmDecl ) override final; 67 68 virtual void visit( CompoundStmt * compoundStmt ) override final; 69 virtual void visit( ExprStmt * exprStmt ) override final; 70 virtual void visit( AsmStmt * asmStmt ) override final; 71 virtual void visit( IfStmt * ifStmt ) override final; 72 virtual void visit( WhileStmt * whileStmt ) override final; 73 virtual void visit( ForStmt * forStmt ) override final; 74 virtual void visit( SwitchStmt * switchStmt ) override final; 75 virtual void visit( CaseStmt * caseStmt ) override final; 76 virtual void visit( BranchStmt * branchStmt ) override final; 77 virtual void visit( ReturnStmt * returnStmt ) override final; 78 virtual void visit( ThrowStmt * throwStmt ) override final; 79 virtual void visit( TryStmt * tryStmt ) override final; 80 virtual void visit( CatchStmt * catchStmt ) override final; 81 virtual void visit( FinallyStmt * finallyStmt ) override final; 82 virtual void visit( WaitForStmt * waitforStmt ) override final; 83 virtual void visit( NullStmt * nullStmt ) override final; 84 virtual void visit( DeclStmt * declStmt ) override final; 85 virtual void visit( ImplicitCtorDtorStmt * impCtorDtorStmt ) override final; 86 87 virtual void visit( ApplicationExpr * applicationExpr ) override final; 88 virtual void visit( UntypedExpr * untypedExpr ) override final; 89 virtual void visit( NameExpr * nameExpr ) override final; 90 virtual void visit( CastExpr * castExpr ) override final; 91 virtual void visit( VirtualCastExpr * castExpr ) override final; 92 virtual void visit( AddressExpr * addressExpr ) override final; 93 virtual void visit( LabelAddressExpr * labAddressExpr ) override final; 94 virtual void visit( UntypedMemberExpr * memberExpr ) override final; 95 virtual void visit( MemberExpr * memberExpr ) override final; 96 virtual void visit( VariableExpr * variableExpr ) override final; 97 virtual void visit( ConstantExpr * constantExpr ) override final; 98 virtual void visit( SizeofExpr * sizeofExpr ) override final; 99 virtual void visit( AlignofExpr * alignofExpr ) override final; 100 virtual void visit( UntypedOffsetofExpr * offsetofExpr ) override final; 101 virtual void visit( OffsetofExpr * offsetofExpr ) override final; 102 virtual void visit( OffsetPackExpr * offsetPackExpr ) override final; 103 virtual void visit( AttrExpr * attrExpr ) override final; 104 virtual void visit( LogicalExpr * logicalExpr ) override final; 105 virtual void visit( ConditionalExpr * conditionalExpr ) override final; 106 virtual void visit( CommaExpr * commaExpr ) override final; 107 virtual void visit( TypeExpr * typeExpr ) override final; 108 virtual void visit( AsmExpr * asmExpr ) override final; 109 virtual void visit( ImplicitCopyCtorExpr * impCpCtorExpr ) override final; 110 virtual void visit( ConstructorExpr * ctorExpr ) override final; 111 virtual void visit( CompoundLiteralExpr * compLitExpr ) override final; 112 virtual void visit( RangeExpr * rangeExpr ) override final; 113 virtual void visit( UntypedTupleExpr * tupleExpr ) override final; 114 virtual void visit( TupleExpr * tupleExpr ) override final; 115 virtual void visit( TupleIndexExpr * tupleExpr ) override final; 116 virtual void visit( TupleAssignExpr * assignExpr ) override final; 117 virtual void visit( StmtExpr * stmtExpr ) override final; 118 virtual void visit( UniqueExpr * uniqueExpr ) override final; 119 120 virtual void visit( VoidType * basicType ) override final; 121 virtual void visit( BasicType * basicType ) override final; 122 virtual void visit( PointerType * pointerType ) override final; 123 virtual void visit( ArrayType * arrayType ) override final; 124 virtual void visit( ReferenceType * referenceType ) override final; 125 virtual void visit( FunctionType * functionType ) override final; 126 virtual void visit( StructInstType * aggregateUseType ) override final; 127 virtual void visit( UnionInstType * aggregateUseType ) override final; 128 virtual void visit( EnumInstType * aggregateUseType ) override final; 129 virtual void visit( TraitInstType * aggregateUseType ) override final; 130 virtual void visit( TypeInstType * aggregateUseType ) override final; 131 virtual void visit( TupleType * tupleType ) override final; 132 virtual void visit( TypeofType * typeofType ) override final; 133 virtual void visit( AttrType * attrType ) override final; 134 virtual void visit( VarArgsType * varArgsType ) override final; 135 virtual void visit( ZeroType * zeroType ) override final; 136 virtual void visit( OneType * oneType ) override final; 137 138 virtual void visit( Designation * designation ) override final; 139 virtual void visit( SingleInit * singleInit ) override final; 140 virtual void visit( ListInit * listInit ) override final; 141 virtual void visit( ConstructorInit * ctorInit ) override final; 142 143 virtual void visit( Subrange * subrange ) override final; 144 145 virtual void visit( Constant * constant ) override final; 146 147 virtual void visit( Attribute * attribute ) override final; 148 149 virtual DeclarationWithType * mutate( ObjectDecl * objectDecl ) override final; 150 virtual DeclarationWithType * mutate( FunctionDecl * functionDecl ) override final; 151 virtual Declaration * mutate( StructDecl * aggregateDecl ) override final; 152 virtual Declaration * mutate( UnionDecl * aggregateDecl ) override final; 153 virtual Declaration * mutate( EnumDecl * aggregateDecl ) override final; 154 virtual Declaration * mutate( TraitDecl * aggregateDecl ) override final; 155 virtual Declaration * mutate( TypeDecl * typeDecl ) override final; 156 virtual Declaration * mutate( TypedefDecl * typeDecl ) override final; 157 virtual AsmDecl * mutate( AsmDecl * asmDecl ) override final; 158 159 virtual CompoundStmt * mutate( CompoundStmt * compoundStmt ) override final; 160 virtual Statement * mutate( ExprStmt * exprStmt ) override final; 161 virtual Statement * mutate( AsmStmt * asmStmt ) override final; 162 virtual Statement * mutate( IfStmt * ifStmt ) override final; 163 virtual Statement * mutate( WhileStmt * whileStmt ) override final; 164 virtual Statement * mutate( ForStmt * forStmt ) override final; 165 virtual Statement * mutate( SwitchStmt * switchStmt ) override final; 166 virtual Statement * mutate( CaseStmt * caseStmt ) override final; 167 virtual Statement * mutate( BranchStmt * branchStmt ) override final; 168 virtual Statement * mutate( ReturnStmt * returnStmt ) override final; 169 virtual Statement * mutate( ThrowStmt * throwStmt ) override final; 170 virtual Statement * mutate( TryStmt * tryStmt ) override final; 171 virtual Statement * mutate( CatchStmt * catchStmt ) override final; 172 virtual Statement * mutate( FinallyStmt * finallyStmt ) override final; 173 virtual Statement * mutate( WaitForStmt * waitforStmt ) override final; 174 virtual NullStmt * mutate( NullStmt * nullStmt ) override final; 175 virtual Statement * mutate( DeclStmt * declStmt ) override final; 176 virtual Statement * mutate( ImplicitCtorDtorStmt * impCtorDtorStmt ) override final; 177 178 virtual Expression * mutate( ApplicationExpr * applicationExpr ) override final; 179 virtual Expression * mutate( UntypedExpr * untypedExpr ) override final; 180 virtual Expression * mutate( NameExpr * nameExpr ) override final; 181 virtual Expression * mutate( AddressExpr * castExpr ) override final; 182 virtual Expression * mutate( LabelAddressExpr * labAddressExpr ) override final; 183 virtual Expression * mutate( CastExpr * castExpr ) override final; 184 virtual Expression * mutate( VirtualCastExpr * castExpr ) override final; 185 virtual Expression * mutate( UntypedMemberExpr * memberExpr ) override final; 186 virtual Expression * mutate( MemberExpr * memberExpr ) override final; 187 virtual Expression * mutate( VariableExpr * variableExpr ) override final; 188 virtual Expression * mutate( ConstantExpr * constantExpr ) override final; 189 virtual Expression * mutate( SizeofExpr * sizeofExpr ) override final; 190 virtual Expression * mutate( AlignofExpr * alignofExpr ) override final; 191 virtual Expression * mutate( UntypedOffsetofExpr * offsetofExpr ) override final; 192 virtual Expression * mutate( OffsetofExpr * offsetofExpr ) override final; 193 virtual Expression * mutate( OffsetPackExpr * offsetPackExpr ) override final; 194 virtual Expression * mutate( AttrExpr * attrExpr ) override final; 195 virtual Expression * mutate( LogicalExpr * logicalExpr ) override final; 196 virtual Expression * mutate( ConditionalExpr * conditionalExpr ) override final; 197 virtual Expression * mutate( CommaExpr * commaExpr ) override final; 198 virtual Expression * mutate( TypeExpr * typeExpr ) override final; 199 virtual Expression * mutate( AsmExpr * asmExpr ) override final; 200 virtual Expression * mutate( ImplicitCopyCtorExpr * impCpCtorExpr ) override final; 201 virtual Expression * mutate( ConstructorExpr * ctorExpr ) override final; 202 virtual Expression * mutate( CompoundLiteralExpr * compLitExpr ) override final; 203 virtual Expression * mutate( RangeExpr * rangeExpr ) override final; 204 virtual Expression * mutate( UntypedTupleExpr * tupleExpr ) override final; 205 virtual Expression * mutate( TupleExpr * tupleExpr ) override final; 206 virtual Expression * mutate( TupleIndexExpr * tupleExpr ) override final; 207 virtual Expression * mutate( TupleAssignExpr * assignExpr ) override final; 208 virtual Expression * mutate( StmtExpr * stmtExpr ) override final; 209 virtual Expression * mutate( UniqueExpr * uniqueExpr ) override final; 210 211 virtual Type * mutate( VoidType * basicType ) override final; 212 virtual Type * mutate( BasicType * basicType ) override final; 213 virtual Type * mutate( PointerType * pointerType ) override final; 214 virtual Type * mutate( ArrayType * arrayType ) override final; 215 virtual Type * mutate( ReferenceType * referenceType ) override final; 216 virtual Type * mutate( FunctionType * functionType ) override final; 217 virtual Type * mutate( StructInstType * aggregateUseType ) override final; 218 virtual Type * mutate( UnionInstType * aggregateUseType ) override final; 219 virtual Type * mutate( EnumInstType * aggregateUseType ) override final; 220 virtual Type * mutate( TraitInstType * aggregateUseType ) override final; 221 virtual Type * mutate( TypeInstType * aggregateUseType ) override final; 222 virtual Type * mutate( TupleType * tupleType ) override final; 223 virtual Type * mutate( TypeofType * typeofType ) override final; 224 virtual Type * mutate( AttrType * attrType ) override final; 225 virtual Type * mutate( VarArgsType * varArgsType ) override final; 226 virtual Type * mutate( ZeroType * zeroType ) override final; 227 virtual Type * mutate( OneType * oneType ) override final; 228 229 virtual Designation * mutate( Designation * designation ) override final; 230 virtual Initializer * mutate( SingleInit * singleInit ) override final; 231 virtual Initializer * mutate( ListInit * listInit ) override final; 232 virtual Initializer * mutate( ConstructorInit * ctorInit ) override final; 233 234 virtual Subrange * mutate( Subrange * subrange ) override final; 235 236 virtual Constant * mutate( Constant * constant ) override final; 237 238 virtual Attribute * mutate( Attribute * attribute ) override final; 239 240 virtual TypeSubstitution * mutate( TypeSubstitution * sub ) final; 55 virtual void visit( ObjectDecl *objectDecl ) override final; 56 virtual void visit( FunctionDecl *functionDecl ) override final; 57 virtual void visit( StructDecl *aggregateDecl ) override final; 58 virtual void visit( UnionDecl *aggregateDecl ) override final; 59 virtual void visit( EnumDecl *aggregateDecl ) override final; 60 virtual void visit( TraitDecl *aggregateDecl ) override final; 61 virtual void visit( TypeDecl *typeDecl ) override final; 62 virtual void visit( TypedefDecl *typeDecl ) override final; 63 virtual void visit( AsmDecl *asmDecl ) override final; 64 65 virtual void visit( CompoundStmt *compoundStmt ) override final; 66 virtual void visit( ExprStmt *exprStmt ) override final; 67 virtual void visit( AsmStmt *asmStmt ) override final; 68 virtual void visit( IfStmt *ifStmt ) override final; 69 virtual void visit( WhileStmt *whileStmt ) override final; 70 virtual void visit( ForStmt *forStmt ) override final; 71 virtual void visit( SwitchStmt *switchStmt ) override final; 72 virtual void visit( CaseStmt *caseStmt ) override final; 73 virtual void visit( BranchStmt *branchStmt ) override final; 74 virtual void visit( ReturnStmt *returnStmt ) override final; 75 virtual void visit( ThrowStmt *throwStmt ) override final; 76 virtual void visit( TryStmt *tryStmt ) override final; 77 virtual void visit( CatchStmt *catchStmt ) override final; 78 virtual void visit( FinallyStmt *finallyStmt ) override final; 79 virtual void visit( WaitForStmt *waitforStmt ) override final; 80 virtual void visit( NullStmt *nullStmt ) override final; 81 virtual void visit( DeclStmt *declStmt ) override final; 82 virtual void visit( ImplicitCtorDtorStmt *impCtorDtorStmt ) override final; 83 84 virtual void visit( ApplicationExpr *applicationExpr ) override final; 85 virtual void visit( UntypedExpr *untypedExpr ) override final; 86 virtual void visit( NameExpr *nameExpr ) override final; 87 virtual void visit( CastExpr *castExpr ) override final; 88 virtual void visit( VirtualCastExpr *castExpr ) override final; 89 virtual void visit( AddressExpr *addressExpr ) override final; 90 virtual void visit( LabelAddressExpr *labAddressExpr ) override final; 91 virtual void visit( UntypedMemberExpr *memberExpr ) override final; 92 virtual void visit( MemberExpr *memberExpr ) override final; 93 virtual void visit( VariableExpr *variableExpr ) override final; 94 virtual void visit( ConstantExpr *constantExpr ) override final; 95 virtual void visit( SizeofExpr *sizeofExpr ) override final; 96 virtual void visit( AlignofExpr *alignofExpr ) override final; 97 virtual void visit( UntypedOffsetofExpr *offsetofExpr ) override final; 98 virtual void visit( OffsetofExpr *offsetofExpr ) override final; 99 virtual void visit( OffsetPackExpr *offsetPackExpr ) override final; 100 virtual void visit( AttrExpr *attrExpr ) override final; 101 virtual void visit( LogicalExpr *logicalExpr ) override final; 102 virtual void visit( ConditionalExpr *conditionalExpr ) override final; 103 virtual void visit( CommaExpr *commaExpr ) override final; 104 virtual void visit( TypeExpr *typeExpr ) override final; 105 virtual void visit( AsmExpr *asmExpr ) override final; 106 virtual void visit( ImplicitCopyCtorExpr *impCpCtorExpr ) override final; 107 virtual void visit( ConstructorExpr * ctorExpr ) override final; 108 virtual void visit( CompoundLiteralExpr *compLitExpr ) override final; 109 virtual void visit( RangeExpr *rangeExpr ) override final; 110 virtual void visit( UntypedTupleExpr *tupleExpr ) override final; 111 virtual void visit( TupleExpr *tupleExpr ) override final; 112 virtual void visit( TupleIndexExpr *tupleExpr ) override final; 113 virtual void visit( TupleAssignExpr *assignExpr ) override final; 114 virtual void visit( StmtExpr * stmtExpr ) override final; 115 virtual void visit( UniqueExpr * uniqueExpr ) override final; 116 117 virtual void visit( VoidType *basicType ) override final; 118 virtual void visit( BasicType *basicType ) override final; 119 virtual void visit( PointerType *pointerType ) override final; 120 virtual void visit( ArrayType *arrayType ) override final; 121 virtual void visit( ReferenceType *referenceType ) override final; 122 virtual void visit( FunctionType *functionType ) override final; 123 virtual void visit( StructInstType *aggregateUseType ) override final; 124 virtual void visit( UnionInstType *aggregateUseType ) override final; 125 virtual void visit( EnumInstType *aggregateUseType ) override final; 126 virtual void visit( TraitInstType *aggregateUseType ) override final; 127 virtual void visit( TypeInstType *aggregateUseType ) override final; 128 virtual void visit( TupleType *tupleType ) override final; 129 virtual void visit( TypeofType *typeofType ) override final; 130 virtual void visit( AttrType *attrType ) override final; 131 virtual void visit( VarArgsType *varArgsType ) override final; 132 virtual void visit( ZeroType *zeroType ) override final; 133 virtual void visit( OneType *oneType ) override final; 134 135 virtual void visit( Designation *designation ) override final; 136 virtual void visit( SingleInit *singleInit ) override final; 137 virtual void visit( ListInit *listInit ) override final; 138 virtual void visit( ConstructorInit *ctorInit ) override final; 139 140 virtual void visit( Subrange *subrange ) override final; 141 142 virtual void visit( Constant *constant ) override final; 143 144 virtual DeclarationWithType* mutate( ObjectDecl *objectDecl ) override final; 145 virtual DeclarationWithType* mutate( FunctionDecl *functionDecl ) override final; 146 virtual Declaration* mutate( StructDecl *aggregateDecl ) override final; 147 virtual Declaration* mutate( UnionDecl *aggregateDecl ) override final; 148 virtual Declaration* mutate( EnumDecl *aggregateDecl ) override final; 149 virtual Declaration* mutate( TraitDecl *aggregateDecl ) override final; 150 virtual Declaration* mutate( TypeDecl *typeDecl ) override final; 151 virtual Declaration* mutate( TypedefDecl *typeDecl ) override final; 152 virtual AsmDecl* mutate( AsmDecl *asmDecl ) override final; 153 154 virtual CompoundStmt* mutate( CompoundStmt *compoundStmt ) override final; 155 virtual Statement* mutate( ExprStmt *exprStmt ) override final; 156 virtual Statement* mutate( AsmStmt *asmStmt ) override final; 157 virtual Statement* mutate( IfStmt *ifStmt ) override final; 158 virtual Statement* mutate( WhileStmt *whileStmt ) override final; 159 virtual Statement* mutate( ForStmt *forStmt ) override final; 160 virtual Statement* mutate( SwitchStmt *switchStmt ) override final; 161 virtual Statement* mutate( CaseStmt *caseStmt ) override final; 162 virtual Statement* mutate( BranchStmt *branchStmt ) override final; 163 virtual Statement* mutate( ReturnStmt *returnStmt ) override final; 164 virtual Statement* mutate( ThrowStmt *throwStmt ) override final; 165 virtual Statement* mutate( TryStmt *tryStmt ) override final; 166 virtual Statement* mutate( CatchStmt *catchStmt ) override final; 167 virtual Statement* mutate( FinallyStmt *finallyStmt ) override final; 168 virtual Statement* mutate( WaitForStmt *waitforStmt ) override final; 169 virtual NullStmt* mutate( NullStmt *nullStmt ) override final; 170 virtual Statement* mutate( DeclStmt *declStmt ) override final; 171 virtual Statement* mutate( ImplicitCtorDtorStmt *impCtorDtorStmt ) override final; 172 173 virtual Expression* mutate( ApplicationExpr *applicationExpr ) override final; 174 virtual Expression* mutate( UntypedExpr *untypedExpr ) override final; 175 virtual Expression* mutate( NameExpr *nameExpr ) override final; 176 virtual Expression* mutate( AddressExpr *castExpr ) override final; 177 virtual Expression* mutate( LabelAddressExpr *labAddressExpr ) override final; 178 virtual Expression* mutate( CastExpr *castExpr ) override final; 179 virtual Expression* mutate( VirtualCastExpr *castExpr ) override final; 180 virtual Expression* mutate( UntypedMemberExpr *memberExpr ) override final; 181 virtual Expression* mutate( MemberExpr *memberExpr ) override final; 182 virtual Expression* mutate( VariableExpr *variableExpr ) override final; 183 virtual Expression* mutate( ConstantExpr *constantExpr ) override final; 184 virtual Expression* mutate( SizeofExpr *sizeofExpr ) override final; 185 virtual Expression* mutate( AlignofExpr *alignofExpr ) override final; 186 virtual Expression* mutate( UntypedOffsetofExpr *offsetofExpr ) override final; 187 virtual Expression* mutate( OffsetofExpr *offsetofExpr ) override final; 188 virtual Expression* mutate( OffsetPackExpr *offsetPackExpr ) override final; 189 virtual Expression* mutate( AttrExpr *attrExpr ) override final; 190 virtual Expression* mutate( LogicalExpr *logicalExpr ) override final; 191 virtual Expression* mutate( ConditionalExpr *conditionalExpr ) override final; 192 virtual Expression* mutate( CommaExpr *commaExpr ) override final; 193 virtual Expression* mutate( TypeExpr *typeExpr ) override final; 194 virtual Expression* mutate( AsmExpr *asmExpr ) override final; 195 virtual Expression* mutate( ImplicitCopyCtorExpr *impCpCtorExpr ) override final; 196 virtual Expression* mutate( ConstructorExpr *ctorExpr ) override final; 197 virtual Expression* mutate( CompoundLiteralExpr *compLitExpr ) override final; 198 virtual Expression* mutate( RangeExpr *rangeExpr ) override final; 199 virtual Expression* mutate( UntypedTupleExpr *tupleExpr ) override final; 200 virtual Expression* mutate( TupleExpr *tupleExpr ) override final; 201 virtual Expression* mutate( TupleIndexExpr *tupleExpr ) override final; 202 virtual Expression* mutate( TupleAssignExpr *assignExpr ) override final; 203 virtual Expression* mutate( StmtExpr * stmtExpr ) override final; 204 virtual Expression* mutate( UniqueExpr * uniqueExpr ) override final; 205 206 virtual Type* mutate( VoidType *basicType ) override final; 207 virtual Type* mutate( BasicType *basicType ) override final; 208 virtual Type* mutate( PointerType *pointerType ) override final; 209 virtual Type* mutate( ArrayType *arrayType ) override final; 210 virtual Type* mutate( ReferenceType *referenceType ) override final; 211 virtual Type* mutate( FunctionType *functionType ) override final; 212 virtual Type* mutate( StructInstType *aggregateUseType ) override final; 213 virtual Type* mutate( UnionInstType *aggregateUseType ) override final; 214 virtual Type* mutate( EnumInstType *aggregateUseType ) override final; 215 virtual Type* mutate( TraitInstType *aggregateUseType ) override final; 216 virtual Type* mutate( TypeInstType *aggregateUseType ) override final; 217 virtual Type* mutate( TupleType *tupleType ) override final; 218 virtual Type* mutate( TypeofType *typeofType ) override final; 219 virtual Type* mutate( AttrType *attrType ) override final; 220 virtual Type* mutate( VarArgsType *varArgsType ) override final; 221 virtual Type* mutate( ZeroType *zeroType ) override final; 222 virtual Type* mutate( OneType *oneType ) override final; 223 224 virtual Designation* mutate( Designation *designation ) override final; 225 virtual Initializer* mutate( SingleInit *singleInit ) override final; 226 virtual Initializer* mutate( ListInit *listInit ) override final; 227 virtual Initializer* mutate( ConstructorInit *ctorInit ) override final; 228 229 virtual Subrange *mutate( Subrange *subrange ) override final; 230 231 virtual Constant *mutate( Constant *constant ) override final; 241 232 242 233 private: 243 234 template<typename pass_t> friend void acceptAll( std::list< Declaration* > &decls, PassVisitor< pass_t >& visitor ); 244 235 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 );249 236 250 237 template<typename node_type> void call_previsit ( node_type * node ) { previsit_impl ( pass, node, 0 ); } … … 281 268 std::list< Declaration* > * get_afterDecls () { return declsToAddAfter_impl ( pass, 0); } 282 269 283 bool get_visit_children () { bool_ref * ptr = visit_children_impl(pass, 0); return ptr ? *ptr : true; } 284 bool_ref * get_visit_children_ptr() { return visit_children_impl(pass, 0); } 270 void set_visit_children( bool& ref ) { bool_ref * ptr = visit_children_impl(pass, 0); if(ptr) ptr->set( ref ); } 285 271 286 272 void indexerScopeEnter () { indexer_impl_enterScope ( pass, 0 ); } -
src/Common/PassVisitor.impl.h
r3f7e12cb r78315272 2 2 // IWYU pragma: private, include "PassVisitor.h" 3 3 4 #define VISIT_START( node ) \ 5 __attribute__((unused)) \ 6 ChildrenGuard children_guard( get_visit_children_ptr() ); \ 7 __attribute__((unused)) \ 4 #define VISIT_START( node ) \ 5 __attribute__((unused)) \ 8 6 guard_value_impl guard( at_cleanup_impl(pass, 0) ); \ 9 call_previsit( node ); \ 7 bool visit_children = true; \ 8 set_visit_children( visit_children ); \ 9 call_previsit( node ); \ 10 if( visit_children ) { \ 10 11 11 12 #define VISIT_END( node ) \ 13 } \ 12 14 call_postvisit( node ); \ 13 15 14 #define MUTATE_START( node ) \ 15 __attribute__((unused)) \ 16 ChildrenGuard children_guard( get_visit_children_ptr() ); \ 17 __attribute__((unused)) \ 16 #define MUTATE_START( node ) \ 17 __attribute__((unused)) \ 18 18 guard_value_impl guard( at_cleanup_impl(pass, 0) ); \ 19 call_premutate( node ); \ 19 bool visit_children = true; \ 20 set_visit_children( visit_children ); \ 21 call_premutate( node ); \ 22 if( visit_children ) { \ 20 23 21 24 #define MUTATE_END( type, node ) \ 25 } \ 22 26 return call_postmutate< type * >( node ); \ 23 27 24 28 25 #define VISIT_BODY( node ) \ 26 VISIT_START( node ); \ 27 if( children_guard ) { \ 28 Visitor::visit( node ); \ 29 } \ 30 VISIT_END( node ); \ 31 32 33 #define MUTATE_BODY( type, node ) \ 34 MUTATE_START( node ); \ 35 if( children_guard ) { \ 36 Mutator::mutate( node ); \ 37 } \ 38 MUTATE_END( type, node ); \ 29 #define VISIT_BODY( node ) \ 30 VISIT_START( node ); \ 31 Visitor::visit( node ); \ 32 VISIT_END( node ); \ 33 34 35 #define MUTATE_BODY( type, node ) \ 36 MUTATE_START( node ); \ 37 Mutator::mutate( node ); \ 38 MUTATE_END( type, node ); \ 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 65 66 DeclList_t* beforeDecls = visitor.get_beforeDecls(); 66 67 DeclList_t* afterDecls = visitor.get_afterDecls(); … … 75 76 try { 76 77 // run visitor on declaration 77 maybeAccept _impl( *i, visitor );78 maybeAccept( *i, visitor ); 78 79 } catch( SemanticError &e ) { 79 80 e.set_location( (*i)->location ); … … 91 92 template< typename pass_type > 92 93 static inline void mutateAll( std::list< Declaration* > &decls, PassVisitor< pass_type >& mutator ) { 94 93 95 DeclList_t* beforeDecls = mutator.get_beforeDecls(); 94 96 DeclList_t* afterDecls = mutator.get_afterDecls(); … … 102 104 try { 103 105 // run mutator on declaration 104 maybeMutate_impl( *i, mutator );106 *i = maybeMutate( *i, mutator ); 105 107 } catch( SemanticError &e ) { 106 108 e.set_location( (*i)->location ); … … 116 118 } 117 119 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; 120 template< typename Container, typename VisitorType > 121 inline void maybeAccept( Container &container, VisitorType &visitor ) { 129 122 SemanticError errors; 130 123 for ( typename Container::iterator i = container.begin(); i != container.end(); ++i ) { … … 143 136 } 144 137 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; 138 template< typename Container, typename MutatorType > 139 inline void maybeMutateRef( Container &container, MutatorType &mutator ) { 157 140 SemanticError errors; 158 141 for ( typename Container::iterator i = container.begin(); i != container.end(); ++i ) { 159 142 try { 160 143 if ( *i ) { 144 /// *i = (*i)->acceptMutator( mutator ); 161 145 *i = dynamic_cast< typename Container::value_type >( (*i)->acceptMutator( mutator ) ); 162 146 assert( *i ); … … 175 159 template< typename func_t > 176 160 void PassVisitor< pass_type >::handleStatementList( std::list< Statement * > & statements, func_t func ) { 177 if ( ! get_visit_children() ) return;178 161 SemanticError errors; 179 162 … … 216 199 void PassVisitor< pass_type >::visitStatementList( std::list< Statement * > & statements ) { 217 200 handleStatementList( statements, [this]( Statement * stmt) { 218 maybeAccept_impl( stmt,*this );201 stmt->accept( *this ); 219 202 }); 220 203 } … … 223 206 void PassVisitor< pass_type >::mutateStatementList( std::list< Statement * > & statements ) { 224 207 handleStatementList( statements, [this]( Statement *& stmt) { 225 maybeMutate_impl( stmt,*this );208 stmt = stmt->acceptMutator( *this ); 226 209 }); 227 210 } … … 231 214 template< typename func_t > 232 215 Statement * PassVisitor< pass_type >::handleStatement( Statement * stmt, func_t func ) { 233 if ( ! get_visit_children() ) return stmt;234 235 216 // don't want statements from outer CompoundStmts to be added to this CompoundStmt 236 217 ValueGuardPtr< TypeSubstitution * > oldEnv ( get_env_ptr () ); … … 263 244 Statement * PassVisitor< pass_type >::visitStatement( Statement * stmt ) { 264 245 return handleStatement( stmt, [this]( Statement * stmt ) { 265 maybeAccept _impl( stmt, *this );246 maybeAccept( stmt, *this ); 266 247 return stmt; 267 248 }); … … 271 252 Statement * PassVisitor< pass_type >::mutateStatement( Statement * stmt ) { 272 253 return handleStatement( stmt, [this]( Statement * stmt ) { 273 maybeMutate_impl( stmt, *this ); 274 return stmt; 254 return maybeMutate( stmt, *this ); 275 255 }); 276 256 } … … 279 259 template< typename func_t > 280 260 Expression * PassVisitor< pass_type >::handleExpression( Expression * expr, func_t func ) { 281 if ( ! get_visit_children() ) return expr;282 261 if( !expr ) return nullptr; 283 262 … … 287 266 } 288 267 289 // should env be movedonto the result of the mutate?268 // should env be cloned (or moved) onto the result of the mutate? 290 269 return func( expr ); 291 270 } … … 294 273 Expression * PassVisitor< pass_type >::visitExpression( Expression * expr ) { 295 274 return handleExpression(expr, [this]( Expression * expr ) { 296 maybeAccept_impl( expr,*this );275 expr->accept( *this ); 297 276 return expr; 298 277 }); … … 302 281 Expression * PassVisitor< pass_type >::mutateExpression( Expression * expr ) { 303 282 return handleExpression(expr, [this]( Expression * expr ) { 304 maybeMutate_impl( expr, *this ); 305 return expr; 283 return expr->acceptMutator( *this ); 306 284 }); 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 );327 285 } 328 286 … … 361 319 362 320 indexerScopedAccept( node->type , *this ); 363 maybeAccept_impl ( node->init , *this ); 364 maybeAccept_impl ( node->bitfieldWidth, *this ); 365 maybeAccept_impl ( node->attributes , *this ); 321 maybeAccept ( node->init , *this ); 322 maybeAccept ( node->bitfieldWidth, *this ); 366 323 367 324 if ( node->name != "" ) { … … 377 334 378 335 indexerScopedMutate( node->type , *this ); 379 maybeMutate_impl ( node->init , *this ); 380 maybeMutate_impl ( node->bitfieldWidth, *this ); 381 maybeMutate_impl ( node->attributes , *this ); 336 maybeMutateRef ( node->init , *this ); 337 maybeMutateRef ( node->bitfieldWidth, *this ); 382 338 383 339 if ( node->name != "" ) { … … 400 356 { 401 357 auto guard = makeFuncGuard( [this]() { indexerScopeEnter(); }, [this]() { indexerScopeLeave(); } ); 402 maybeAccept_impl( node->type, *this ); 403 maybeAccept_impl( node->statements, *this ); 404 maybeAccept_impl( node->attributes, *this ); 358 maybeAccept( node->type, *this ); 359 maybeAccept( node->statements, *this ); 405 360 } 406 361 … … 418 373 { 419 374 auto guard = makeFuncGuard( [this]() { indexerScopeEnter(); }, [this]() { indexerScopeLeave(); } ); 420 maybeMutate_impl( node->type, *this ); 421 maybeMutate_impl( node->statements, *this ); 422 maybeMutate_impl( node->attributes, *this ); 375 maybeMutateRef( node->type, *this ); 376 maybeMutateRef( node->statements, *this ); 423 377 } 424 378 … … 438 392 { 439 393 auto guard = makeFuncGuard( [this]() { indexerScopeEnter(); }, [this]() { indexerScopeLeave(); } ); 440 maybeAccept _impl( node->parameters, *this );441 maybeAccept _impl( node->members , *this );394 maybeAccept( node->parameters, *this ); 395 maybeAccept( node->members , *this ); 442 396 } 443 397 … … 458 412 { 459 413 auto guard = makeFuncGuard( [this]() { indexerScopeEnter(); }, [this]() { indexerScopeLeave(); } ); 460 maybeMutate _impl( node->parameters, *this );461 maybeMutate _impl( node->members , *this );414 maybeMutateRef( node->parameters, *this ); 415 maybeMutateRef( node->members , *this ); 462 416 } 463 417 … … 479 433 { 480 434 auto guard = makeFuncGuard( [this]() { indexerScopeEnter(); }, [this]() { indexerScopeLeave(); } ); 481 maybeAccept _impl( node->parameters, *this );482 maybeAccept _impl( node->members , *this );435 maybeAccept( node->parameters, *this ); 436 maybeAccept( node->members , *this ); 483 437 } 484 438 … … 497 451 { 498 452 auto guard = makeFuncGuard( [this]() { indexerScopeEnter(); }, [this]() { indexerScopeLeave(); } ); 499 maybeMutate _impl( node->parameters, *this );500 maybeMutate _impl( node->members , *this );453 maybeMutateRef( node->parameters, *this ); 454 maybeMutateRef( node->members , *this ); 501 455 } 502 456 … … 515 469 516 470 // unlike structs, traits, and unions, enums inject their members into the global scope 517 maybeAccept _impl( node->parameters, *this );518 maybeAccept _impl( node->members , *this );471 maybeAccept( node->parameters, *this ); 472 maybeAccept( node->members , *this ); 519 473 520 474 VISIT_END( node ); … … 528 482 529 483 // unlike structs, traits, and unions, enums inject their members into the global scope 530 maybeMutate _impl( node->parameters, *this );531 maybeMutate _impl( node->members , *this );484 maybeMutateRef( node->parameters, *this ); 485 maybeMutateRef( node->members , *this ); 532 486 533 487 MUTATE_END( Declaration, node ); … … 542 496 { 543 497 auto guard = makeFuncGuard( [this]() { indexerScopeEnter(); }, [this]() { indexerScopeLeave(); } ); 544 maybeAccept _impl( node->parameters, *this );545 maybeAccept _impl( node->members , *this );498 maybeAccept( node->parameters, *this ); 499 maybeAccept( node->members , *this ); 546 500 } 547 501 … … 557 511 { 558 512 auto guard = makeFuncGuard( [this]() { indexerScopeEnter(); }, [this]() { indexerScopeLeave(); } ); 559 maybeMutate _impl( node->parameters, *this );560 maybeMutate _impl( node->members , *this );513 maybeMutateRef( node->parameters, *this ); 514 maybeMutateRef( node->members , *this ); 561 515 } 562 516 … … 574 528 { 575 529 auto guard = makeFuncGuard( [this]() { indexerScopeEnter(); }, [this]() { indexerScopeLeave(); } ); 576 maybeAccept _impl( node->parameters, *this );577 maybeAccept _impl( node->base , *this );530 maybeAccept( node->parameters, *this ); 531 maybeAccept( node->base , *this ); 578 532 } 579 533 … … 583 537 indexerAddType( node ); 584 538 585 maybeAccept _impl( node->assertions, *this );539 maybeAccept( node->assertions, *this ); 586 540 587 541 indexerScopedAccept( node->init, *this ); … … 596 550 { 597 551 auto guard = makeFuncGuard( [this]() { indexerScopeEnter(); }, [this]() { indexerScopeLeave(); } ); 598 maybeMutate _impl( node->parameters, *this );599 maybeMutate _impl( node->base , *this );552 maybeMutateRef( node->parameters, *this ); 553 maybeMutateRef( node->base , *this ); 600 554 } 601 555 … … 605 559 indexerAddType( node ); 606 560 607 maybeMutate _impl( node->assertions, *this );561 maybeMutateRef( node->assertions, *this ); 608 562 609 563 indexerScopedMutate( node->init, *this ); … … 620 574 { 621 575 auto guard = makeFuncGuard( [this]() { indexerScopeEnter(); }, [this]() { indexerScopeLeave(); } ); 622 maybeAccept _impl( node->parameters, *this );623 maybeAccept _impl( node->base , *this );576 maybeAccept( node->parameters, *this ); 577 maybeAccept( node->base , *this ); 624 578 } 625 579 626 580 indexerAddType( node ); 627 581 628 maybeAccept _impl( node->assertions, *this );582 maybeAccept( node->assertions, *this ); 629 583 630 584 VISIT_END( node ); … … 637 591 { 638 592 auto guard = makeFuncGuard( [this]() { indexerScopeEnter(); }, [this]() { indexerScopeLeave(); } ); 639 maybeMutate _impl( node->parameters, *this );640 maybeMutate _impl( node->base , *this );593 maybeMutateRef ( node->parameters, *this ); 594 maybeMutateRef( node->base , *this ); 641 595 } 642 596 643 597 indexerAddType( node ); 644 598 645 maybeMutate _impl( node->assertions, *this );599 maybeMutateRef( node->assertions, *this ); 646 600 647 601 MUTATE_END( Declaration, node ); … … 654 608 VISIT_START( node ); 655 609 656 maybeAccept _impl( node->stmt, *this );610 maybeAccept( node->stmt, *this ); 657 611 658 612 VISIT_END( node ); … … 663 617 MUTATE_START( node ); 664 618 665 maybeMutate _impl( node->stmt, *this );619 maybeMutateRef( node->stmt, *this ); 666 620 667 621 MUTATE_END( AsmDecl, node ); … … 732 686 // if statements introduce a level of scope (for the initialization) 733 687 auto guard = makeFuncGuard( [this]() { indexerScopeEnter(); }, [this]() { indexerScopeLeave(); } ); 734 maybeAccept_impl( node->get_initialization(), *this );735 visitExpression ( node->condition );688 acceptAll( node->get_initialization(), *this ); 689 visitExpression( node->condition ); 736 690 node->thenPart = visitStatement( node->thenPart ); 737 691 node->elsePart = visitStatement( node->elsePart ); … … 746 700 // if statements introduce a level of scope (for the initialization) 747 701 auto guard = makeFuncGuard( [this]() { indexerScopeEnter(); }, [this]() { indexerScopeLeave(); } ); 748 maybeMutate _impl( node->get_initialization(), *this );702 maybeMutateRef( node->get_initialization(), *this ); 749 703 node->condition = mutateExpression( node->condition ); 750 704 node->thenPart = mutateStatement ( node->thenPart ); … … 784 738 // for statements introduce a level of scope (for the initialization) 785 739 auto guard = makeFuncGuard( [this]() { indexerScopeEnter(); }, [this]() { indexerScopeLeave(); } ); 786 maybeAccept _impl( node->initialization, *this );740 maybeAccept( node->initialization, *this ); 787 741 visitExpression( node->condition ); 788 742 visitExpression( node->increment ); … … 798 752 // for statements introduce a level of scope (for the initialization) 799 753 auto guard = makeFuncGuard( [this]() { indexerScopeEnter(); }, [this]() { indexerScopeLeave(); } ); 800 maybeMutate _impl( node->initialization, *this );754 maybeMutateRef( node->initialization, *this ); 801 755 node->condition = mutateExpression( node->condition ); 802 756 node->increment = mutateExpression( node->increment ); … … 901 855 VISIT_START( node ); 902 856 903 maybeAccept _impl( node->block , *this );904 maybeAccept _impl( node->handlers , *this );905 maybeAccept _impl( node->finallyBlock, *this );857 maybeAccept( node->block , *this ); 858 maybeAccept( node->handlers , *this ); 859 maybeAccept( node->finallyBlock, *this ); 906 860 907 861 VISIT_END( node ); … … 912 866 MUTATE_START( node ); 913 867 914 maybeMutate _impl( node->block , *this );915 maybeMutate _impl( node->handlers , *this );916 maybeMutate _impl( node->finallyBlock, *this );868 maybeMutateRef( node->block , *this ); 869 maybeMutateRef( node->handlers , *this ); 870 maybeMutateRef( node->finallyBlock, *this ); 917 871 918 872 MUTATE_END( Statement, node ); … … 927 881 // catch statements introduce a level of scope (for the caught exception) 928 882 auto guard = makeFuncGuard( [this]() { indexerScopeEnter(); }, [this]() { indexerScopeLeave(); } ); 929 maybeAccept _impl( node->decl, *this );883 maybeAccept( node->decl, *this ); 930 884 node->cond = visitExpression( node->cond ); 931 885 node->body = visitStatement ( node->body ); … … 940 894 // catch statements introduce a level of scope (for the caught exception) 941 895 auto guard = makeFuncGuard( [this]() { indexerScopeEnter(); }, [this]() { indexerScopeLeave(); } ); 942 maybeMutate _impl( node->decl, *this );896 maybeMutateRef( node->decl, *this ); 943 897 node->cond = mutateExpression( node->cond ); 944 898 node->body = mutateStatement ( node->body ); … … 1014 968 1015 969 indexerScopedAccept( node->result , *this ); 1016 maybeAccept _impl( node->function, *this );1017 maybeAccept _impl( node->args , *this );970 maybeAccept ( node->function, *this ); 971 maybeAccept ( node->args , *this ); 1018 972 1019 973 VISIT_END( node ); … … 1026 980 indexerScopedMutate( node->env , *this ); 1027 981 indexerScopedMutate( node->result , *this ); 1028 maybeMutate _impl( node->function, *this );1029 maybeMutate _impl( node->args , *this );982 maybeMutateRef ( node->function, *this ); 983 maybeMutateRef ( node->args , *this ); 1030 984 1031 985 MUTATE_END( Expression, node ); … … 1038 992 VISIT_START( node ); 1039 993 1040 // maybeAccept _impl( node->get_env(), *this );994 // maybeAccept( node->get_env(), *this ); 1041 995 indexerScopedAccept( node->result, *this ); 1042 996 … … 1090 1044 1091 1045 indexerScopedAccept( node->result, *this ); 1092 maybeAccept _impl( node->arg , *this );1046 maybeAccept ( node->arg , *this ); 1093 1047 1094 1048 VISIT_END( node ); … … 1101 1055 indexerScopedMutate( node->env , *this ); 1102 1056 indexerScopedMutate( node->result, *this ); 1103 maybeMutate _impl( node->arg , *this );1057 maybeMutateRef ( node->arg , *this ); 1104 1058 1105 1059 MUTATE_END( Expression, node ); … … 1113 1067 1114 1068 indexerScopedAccept( node->result, *this ); 1115 maybeAccept _impl( node->arg, *this );1069 maybeAccept( node->arg, *this ); 1116 1070 1117 1071 VISIT_END( node ); … … 1124 1078 indexerScopedMutate( node->env , *this ); 1125 1079 indexerScopedMutate( node->result, *this ); 1126 maybeMutate _impl( node->arg , *this );1080 maybeMutateRef ( node->arg , *this ); 1127 1081 1128 1082 MUTATE_END( Expression, node ); … … 1136 1090 1137 1091 indexerScopedAccept( node->result, *this ); 1138 maybeAccept _impl( node->arg , *this );1092 maybeAccept ( node->arg , *this ); 1139 1093 1140 1094 VISIT_END( node ); … … 1147 1101 indexerScopedMutate( node->env , *this ); 1148 1102 indexerScopedMutate( node->result, *this ); 1149 maybeMutate _impl( node->arg , *this );1103 maybeMutateRef ( node->arg , *this ); 1150 1104 1151 1105 MUTATE_END( Expression, node ); … … 1180 1134 1181 1135 indexerScopedAccept( node->result , *this ); 1182 maybeAccept _impl( node->aggregate, *this );1183 maybeAccept _impl( node->member , *this );1136 maybeAccept ( node->aggregate, *this ); 1137 maybeAccept ( node->member , *this ); 1184 1138 1185 1139 VISIT_END( node ); … … 1192 1146 indexerScopedMutate( node->env , *this ); 1193 1147 indexerScopedMutate( node->result , *this ); 1194 maybeMutate _impl( node->aggregate, *this );1195 maybeMutate _impl( node->member , *this );1148 maybeMutateRef ( node->aggregate, *this ); 1149 maybeMutateRef ( node->member , *this ); 1196 1150 1197 1151 MUTATE_END( Expression, node ); … … 1205 1159 1206 1160 indexerScopedAccept( node->result , *this ); 1207 maybeAccept _impl( node->aggregate, *this );1161 maybeAccept ( node->aggregate, *this ); 1208 1162 1209 1163 VISIT_END( node ); … … 1216 1170 indexerScopedMutate( node->env , *this ); 1217 1171 indexerScopedMutate( node->result , *this ); 1218 maybeMutate _impl( node->aggregate, *this );1172 maybeMutateRef ( node->aggregate, *this ); 1219 1173 1220 1174 MUTATE_END( Expression, node ); … … 1249 1203 1250 1204 indexerScopedAccept( node->result , *this ); 1251 maybeAccept _impl( &node->constant, *this );1205 maybeAccept ( &node->constant, *this ); 1252 1206 1253 1207 VISIT_END( node ); … … 1260 1214 indexerScopedMutate( node->env , *this ); 1261 1215 indexerScopedMutate( node->result, *this ); 1262 Constant * ptr = &node->constant; 1263 maybeMutate_impl( ptr, *this ); 1264 node->constant = *ptr; 1216 node->constant = *maybeMutate( &node->constant, *this ); 1265 1217 1266 1218 MUTATE_END( Expression, node ); … … 1275 1227 indexerScopedAccept( node->result, *this ); 1276 1228 if ( node->get_isType() ) { 1277 maybeAccept _impl( node->type, *this );1229 maybeAccept( node->type, *this ); 1278 1230 } else { 1279 maybeAccept _impl( node->expr, *this );1231 maybeAccept( node->expr, *this ); 1280 1232 } 1281 1233 … … 1290 1242 indexerScopedMutate( node->result, *this ); 1291 1243 if ( node->get_isType() ) { 1292 maybeMutate _impl( node->type, *this );1244 maybeMutateRef( node->type, *this ); 1293 1245 } else { 1294 maybeMutate _impl( node->expr, *this );1246 maybeMutateRef( node->expr, *this ); 1295 1247 } 1296 1248 … … 1306 1258 indexerScopedAccept( node->result, *this ); 1307 1259 if ( node->get_isType() ) { 1308 maybeAccept _impl( node->type, *this );1260 maybeAccept( node->type, *this ); 1309 1261 } else { 1310 maybeAccept _impl( node->expr, *this );1262 maybeAccept( node->expr, *this ); 1311 1263 } 1312 1264 … … 1321 1273 indexerScopedMutate( node->result, *this ); 1322 1274 if ( node->get_isType() ) { 1323 maybeMutate _impl( node->type, *this );1275 maybeMutateRef( node->type, *this ); 1324 1276 } else { 1325 maybeMutate _impl( node->expr, *this );1277 maybeMutateRef( node->expr, *this ); 1326 1278 } 1327 1279 … … 1336 1288 1337 1289 indexerScopedAccept( node->result, *this ); 1338 maybeAccept _impl( node->type , *this );1290 maybeAccept ( node->type , *this ); 1339 1291 1340 1292 VISIT_END( node ); … … 1347 1299 indexerScopedMutate( node->env , *this ); 1348 1300 indexerScopedMutate( node->result, *this ); 1349 maybeMutate _impl( node->type , *this );1301 maybeMutateRef ( node->type , *this ); 1350 1302 1351 1303 MUTATE_END( Expression, node ); … … 1359 1311 1360 1312 indexerScopedAccept( node->result, *this ); 1361 maybeAccept _impl( node->type , *this );1362 maybeAccept _impl( node->member, *this );1313 maybeAccept ( node->type , *this ); 1314 maybeAccept ( node->member, *this ); 1363 1315 1364 1316 VISIT_END( node ); … … 1371 1323 indexerScopedMutate( node->env , *this ); 1372 1324 indexerScopedMutate( node->result, *this ); 1373 maybeMutate _impl( node->type , *this );1374 maybeMutate _impl( node->member, *this );1325 maybeMutateRef ( node->type , *this ); 1326 maybeMutateRef ( node->member, *this ); 1375 1327 1376 1328 MUTATE_END( Expression, node ); … … 1384 1336 1385 1337 indexerScopedAccept( node->result, *this ); 1386 maybeAccept _impl( node->type , *this );1338 maybeAccept ( node->type , *this ); 1387 1339 1388 1340 VISIT_END( node ); … … 1395 1347 indexerScopedMutate( node->env , *this ); 1396 1348 indexerScopedMutate( node->result, *this ); 1397 maybeMutate _impl( node->type , *this );1349 maybeMutateRef ( node->type , *this ); 1398 1350 1399 1351 MUTATE_END( Expression, node ); … … 1408 1360 indexerScopedAccept( node->result, *this ); 1409 1361 if ( node->get_isType() ) { 1410 maybeAccept _impl( node->type, *this );1362 maybeAccept( node->type, *this ); 1411 1363 } else { 1412 maybeAccept _impl( node->expr, *this );1364 maybeAccept( node->expr, *this ); 1413 1365 } 1414 1366 … … 1423 1375 indexerScopedMutate( node->result, *this ); 1424 1376 if ( node->get_isType() ) { 1425 maybeMutate _impl( node->type, *this );1377 maybeMutateRef( node->type, *this ); 1426 1378 } else { 1427 maybeMutate _impl( node->expr, *this );1379 maybeMutateRef( node->expr, *this ); 1428 1380 } 1429 1381 … … 1438 1390 1439 1391 indexerScopedAccept( node->result, *this ); 1440 maybeAccept _impl( node->arg1 , *this );1441 maybeAccept _impl( node->arg2 , *this );1392 maybeAccept ( node->arg1 , *this ); 1393 maybeAccept ( node->arg2 , *this ); 1442 1394 1443 1395 VISIT_END( node ); … … 1450 1402 indexerScopedMutate( node->env , *this ); 1451 1403 indexerScopedMutate( node->result, *this ); 1452 maybeMutate _impl( node->arg1 , *this );1453 maybeMutate _impl( node->arg2 , *this );1404 maybeMutateRef ( node->arg1 , *this ); 1405 maybeMutateRef ( node->arg2 , *this ); 1454 1406 1455 1407 MUTATE_END( Expression, node ); … … 1463 1415 1464 1416 indexerScopedAccept( node->result, *this ); 1465 maybeAccept _impl( node->arg1 , *this );1466 maybeAccept _impl( node->arg2 , *this );1467 maybeAccept _impl( node->arg3 , *this );1417 maybeAccept ( node->arg1 , *this ); 1418 maybeAccept ( node->arg2 , *this ); 1419 maybeAccept ( node->arg3 , *this ); 1468 1420 1469 1421 VISIT_END( node ); … … 1476 1428 indexerScopedMutate( node->env , *this ); 1477 1429 indexerScopedMutate( node->result, *this ); 1478 maybeMutate _impl( node->arg1 , *this );1479 maybeMutate _impl( node->arg2 , *this );1480 maybeMutate _impl( node->arg3 , *this );1430 maybeMutateRef ( node->arg1 , *this ); 1431 maybeMutateRef ( node->arg2 , *this ); 1432 maybeMutateRef ( node->arg3 , *this ); 1481 1433 1482 1434 MUTATE_END( Expression, node ); … … 1490 1442 1491 1443 indexerScopedAccept( node->result, *this ); 1492 maybeAccept _impl( node->arg1 , *this );1493 maybeAccept _impl( node->arg2 , *this );1444 maybeAccept ( node->arg1 , *this ); 1445 maybeAccept ( node->arg2 , *this ); 1494 1446 1495 1447 VISIT_END( node ); … … 1502 1454 indexerScopedMutate( node->env , *this ); 1503 1455 indexerScopedMutate( node->result, *this ); 1504 maybeMutate _impl( node->arg1 , *this );1505 maybeMutate _impl( node->arg2 , *this );1456 maybeMutateRef ( node->arg1 , *this ); 1457 maybeMutateRef ( node->arg2 , *this ); 1506 1458 1507 1459 MUTATE_END( Expression, node ); … … 1515 1467 1516 1468 indexerScopedAccept( node->result, *this ); 1517 maybeAccept _impl( node->type, *this );1469 maybeAccept ( node->type, *this ); 1518 1470 1519 1471 VISIT_END( node ); … … 1526 1478 indexerScopedMutate( node->env , *this ); 1527 1479 indexerScopedMutate( node->result, *this ); 1528 maybeMutate _impl( node->type , *this );1480 maybeMutateRef ( node->type , *this ); 1529 1481 1530 1482 MUTATE_END( Expression, node ); … … 1538 1490 1539 1491 indexerScopedAccept( node->result , *this ); 1540 maybeAccept _impl( node->inout , *this );1541 maybeAccept _impl( node->constraint, *this );1542 maybeAccept _impl( node->operand , *this );1492 maybeAccept ( node->inout , *this ); 1493 maybeAccept ( node->constraint, *this ); 1494 maybeAccept ( node->operand , *this ); 1543 1495 1544 1496 VISIT_END( node ); … … 1551 1503 indexerScopedMutate( node->env , *this ); 1552 1504 indexerScopedMutate( node->result , *this ); 1553 maybeMutate _impl( node->inout , *this );1554 maybeMutate _impl( node->constraint, *this );1555 maybeMutate _impl( node->operand , *this );1505 maybeMutateRef ( node->inout , *this ); 1506 maybeMutateRef ( node->constraint, *this ); 1507 maybeMutateRef ( node->operand , *this ); 1556 1508 1557 1509 MUTATE_END( Expression, node ); … … 1565 1517 1566 1518 indexerScopedAccept( node->result , *this ); 1567 maybeAccept _impl( node->callExpr , *this );1568 maybeAccept _impl( node->tempDecls , *this );1569 maybeAccept _impl( node->returnDecls, *this );1570 maybeAccept _impl( node->dtors , *this );1519 maybeAccept ( node->callExpr , *this ); 1520 maybeAccept ( node->tempDecls , *this ); 1521 maybeAccept ( node->returnDecls, *this ); 1522 maybeAccept ( node->dtors , *this ); 1571 1523 1572 1524 VISIT_END( node ); … … 1579 1531 indexerScopedMutate( node->env , *this ); 1580 1532 indexerScopedMutate( node->result , *this ); 1581 maybeMutate _impl( node->callExpr , *this );1582 maybeMutate _impl( node->tempDecls , *this );1583 maybeMutate _impl( node->returnDecls, *this );1584 maybeMutate _impl( node->dtors , *this );1533 maybeMutateRef ( node->callExpr , *this ); 1534 maybeMutateRef ( node->tempDecls , *this ); 1535 maybeMutateRef ( node->returnDecls, *this ); 1536 maybeMutateRef ( node->dtors , *this ); 1585 1537 1586 1538 MUTATE_END( Expression, node ); … … 1594 1546 1595 1547 indexerScopedAccept( node->result , *this ); 1596 maybeAccept _impl( node->callExpr, *this );1548 maybeAccept ( node->callExpr, *this ); 1597 1549 1598 1550 VISIT_END( node ); … … 1605 1557 indexerScopedMutate( node->env , *this ); 1606 1558 indexerScopedMutate( node->result , *this ); 1607 maybeMutate _impl( node->callExpr, *this );1559 maybeMutateRef ( node->callExpr, *this ); 1608 1560 1609 1561 MUTATE_END( Expression, node ); … … 1617 1569 1618 1570 indexerScopedAccept( node->result , *this ); 1619 maybeAccept _impl( node->initializer, *this );1571 maybeAccept ( node->initializer, *this ); 1620 1572 1621 1573 VISIT_END( node ); … … 1628 1580 indexerScopedMutate( node->env , *this ); 1629 1581 indexerScopedMutate( node->result , *this ); 1630 maybeMutate _impl( node->initializer, *this );1582 maybeMutateRef ( node->initializer, *this ); 1631 1583 1632 1584 MUTATE_END( Expression, node ); … … 1640 1592 1641 1593 indexerScopedAccept( node->result, *this ); 1642 maybeAccept _impl( node->low , *this );1643 maybeAccept _impl( node->high , *this );1594 maybeAccept ( node->low , *this ); 1595 maybeAccept ( node->high , *this ); 1644 1596 1645 1597 VISIT_END( node ); … … 1652 1604 indexerScopedMutate( node->env , *this ); 1653 1605 indexerScopedMutate( node->result, *this ); 1654 maybeMutate _impl( node->low , *this );1655 maybeMutate _impl( node->high , *this );1606 maybeMutateRef ( node->low , *this ); 1607 maybeMutateRef ( node->high , *this ); 1656 1608 1657 1609 MUTATE_END( Expression, node ); … … 1665 1617 1666 1618 indexerScopedAccept( node->result, *this ); 1667 maybeAccept _impl( node->exprs , *this );1619 maybeAccept ( node->exprs , *this ); 1668 1620 1669 1621 VISIT_END( node ); … … 1676 1628 indexerScopedMutate( node->env , *this ); 1677 1629 indexerScopedMutate( node->result, *this ); 1678 maybeMutate _impl( node->exprs , *this );1630 maybeMutateRef ( node->exprs , *this ); 1679 1631 1680 1632 MUTATE_END( Expression, node ); … … 1688 1640 1689 1641 indexerScopedAccept( node->result, *this ); 1690 maybeAccept _impl( node->exprs , *this );1642 maybeAccept ( node->exprs , *this ); 1691 1643 1692 1644 VISIT_END( node ); … … 1699 1651 indexerScopedMutate( node->env , *this ); 1700 1652 indexerScopedMutate( node->result, *this ); 1701 maybeMutate _impl( node->exprs , *this );1653 maybeMutateRef ( node->exprs , *this ); 1702 1654 1703 1655 MUTATE_END( Expression, node ); … … 1711 1663 1712 1664 indexerScopedAccept( node->result, *this ); 1713 maybeAccept _impl( node->tuple , *this );1665 maybeAccept ( node->tuple , *this ); 1714 1666 1715 1667 VISIT_END( node ); … … 1722 1674 indexerScopedMutate( node->env , *this ); 1723 1675 indexerScopedMutate( node->result, *this ); 1724 maybeMutate _impl( node->tuple , *this );1676 maybeMutateRef ( node->tuple , *this ); 1725 1677 1726 1678 MUTATE_END( Expression, node ); … … 1734 1686 1735 1687 indexerScopedAccept( node->result , *this ); 1736 maybeAccept _impl( node->stmtExpr, *this );1688 maybeAccept ( node->stmtExpr, *this ); 1737 1689 1738 1690 VISIT_END( node ); … … 1745 1697 indexerScopedMutate( node->env , *this ); 1746 1698 indexerScopedMutate( node->result , *this ); 1747 maybeMutate _impl( node->stmtExpr, *this );1699 maybeMutateRef ( node->stmtExpr, *this ); 1748 1700 1749 1701 MUTATE_END( Expression, node ); … … 1762 1714 1763 1715 indexerScopedAccept( node->result , *this ); 1764 maybeAccept _impl( node->statements , *this );1765 maybeAccept _impl( node->returnDecls, *this );1766 maybeAccept _impl( node->dtors , *this );1716 maybeAccept ( node->statements , *this ); 1717 maybeAccept ( node->returnDecls, *this ); 1718 maybeAccept ( node->dtors , *this ); 1767 1719 1768 1720 VISIT_END( node ); … … 1779 1731 1780 1732 indexerScopedMutate( node->result , *this ); 1781 maybeMutate _impl( node->statements , *this );1782 maybeMutate _impl( node->returnDecls, *this );1783 maybeMutate _impl( node->dtors , *this );1733 maybeMutateRef ( node->statements , *this ); 1734 maybeMutateRef ( node->returnDecls, *this ); 1735 maybeMutateRef ( node->dtors , *this ); 1784 1736 1785 1737 MUTATE_END( Expression, node ); … … 1793 1745 1794 1746 indexerScopedAccept( node->result, *this ); 1795 maybeAccept _impl( node->expr , *this );1747 maybeAccept ( node->expr , *this ); 1796 1748 1797 1749 VISIT_END( node ); … … 1804 1756 indexerScopedMutate( node->env , *this ); 1805 1757 indexerScopedMutate( node->result, *this ); 1806 maybeMutate _impl( node->expr , *this );1758 maybeMutateRef ( node->expr , *this ); 1807 1759 1808 1760 MUTATE_END( Expression, node ); … … 1849 1801 { 1850 1802 auto guard = makeFuncGuard( [this]() { indexerScopeEnter(); }, [this]() { indexerScopeLeave(); } ); 1851 maybeAccept _impl( node->forall , *this );1852 maybeAccept _impl( node->parameters, *this );1803 maybeAccept( node->forall , *this ); 1804 maybeAccept( node->parameters, *this ); 1853 1805 } 1854 1806 … … 1864 1816 { 1865 1817 auto guard = makeFuncGuard( [this]() { indexerScopeEnter(); }, [this]() { indexerScopeLeave(); } ); 1866 maybeMutate _impl( node->forall , *this );1867 maybeMutate _impl( node->parameters, *this );1818 maybeMutateRef( node->forall , *this ); 1819 maybeMutateRef( node->parameters, *this ); 1868 1820 } 1869 1821 … … 1881 1833 { 1882 1834 auto guard = makeFuncGuard( [this]() { indexerScopeEnter(); }, [this]() { indexerScopeLeave(); } ); 1883 maybeAccept _impl( node->forall , *this );1884 maybeAccept _impl( node->parameters, *this );1835 maybeAccept( node->forall , *this ); 1836 maybeAccept( node->parameters, *this ); 1885 1837 } 1886 1838 … … 1896 1848 { 1897 1849 auto guard = makeFuncGuard( [this]() { indexerScopeEnter(); }, [this]() { indexerScopeLeave(); } ); 1898 maybeMutate _impl( node->forall , *this );1899 maybeMutate _impl( node->parameters, *this );1850 maybeMutateRef( node->forall , *this ); 1851 maybeMutateRef( node->parameters, *this ); 1900 1852 } 1901 1853 … … 1921 1873 VISIT_START( node ); 1922 1874 1923 maybeAccept _impl( node->forall , *this );1924 maybeAccept _impl( node->parameters, *this );1875 maybeAccept( node->forall , *this ); 1876 maybeAccept( node->parameters, *this ); 1925 1877 1926 1878 VISIT_END( node ); … … 1931 1883 MUTATE_START( node ); 1932 1884 1933 maybeMutate _impl( node->forall , *this );1934 maybeMutate _impl( node->parameters, *this );1885 maybeMutateRef( node->forall , *this ); 1886 maybeMutateRef( node->parameters, *this ); 1935 1887 1936 1888 MUTATE_END( Type, node ); … … 1978 1930 VISIT_START( node ); 1979 1931 1980 maybeAccept _impl( node->get_designators(), *this );1932 maybeAccept( node->get_designators(), *this ); 1981 1933 1982 1934 VISIT_END( node ); … … 1987 1939 MUTATE_START( node ); 1988 1940 1989 maybeMutate _impl( node->get_designators(), *this );1941 maybeMutateRef( node->get_designators(), *this ); 1990 1942 1991 1943 MUTATE_END( Designation, node ); … … 2029 1981 template< typename pass_type > 2030 1982 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 ) {2036 1983 VISIT_BODY( node ); 2037 1984 } … … 2122 2069 MUTATE_BODY( Constant, node ); 2123 2070 } 2124 2125 template< typename pass_type >2126 Attribute * PassVisitor< pass_type >::mutate( Attribute * node ) {2127 MUTATE_BODY( Attribute, node );2128 }2129 2130 template< typename pass_type >2131 TypeSubstitution * PassVisitor< pass_type >::mutate( TypeSubstitution * node ) {2132 MUTATE_START( node );2133 2134 for ( auto & p : node->typeEnv ) {2135 indexerScopedMutate( p.second, *this );2136 }2137 for ( auto & p : node->varEnv ) {2138 indexerScopedMutate( p.second, *this );2139 }2140 2141 MUTATE_END( TypeSubstitution, node );2142 } -
src/Common/PassVisitor.proto.h
r3f7e12cb r78315272 46 46 ~bool_ref() = default; 47 47 48 operator bool() { return m_ref ? *m_ref : true; }48 operator bool() { return *m_ref; } 49 49 bool operator=( bool val ) { return *m_ref = val; } 50 50 51 51 private: 52 52 53 friend class ChildrenGuard; 54 55 bool * set( bool & val ) { 56 bool * prev = m_ref; 57 m_ref = &val; 58 return prev; 59 } 60 61 bool * m_ref = nullptr; 53 template<typename pass> 54 friend class PassVisitor; 55 56 void set( bool & val ) { m_ref = &val; }; 57 58 bool * m_ref; 62 59 }; 63 60 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 } ;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 } 86 83 87 84 //------------------------------------------------------------------------------------------------------------------------------------------------------------------------- -
src/Common/utility.h
r3f7e12cb r78315272 18 18 #include <cctype> 19 19 #include <algorithm> 20 #include <functional>21 20 #include <iostream> 22 21 #include <iterator> … … 28 27 29 28 #include <cassert> 30 31 #include "Common/Indenter.h"32 29 33 30 template< typename T > … … 78 75 79 76 template< typename Container > 80 void printAll( const Container &container, std::ostream &os, Indenter indent = {}) {77 void printAll( const Container &container, std::ostream &os, int indent = 0 ) { 81 78 for ( typename Container::const_iterator i = container.begin(); i != container.end(); ++i ) { 82 79 if ( *i ) { 83 os << indent;84 (*i)->print( os, indent );80 os << std::string( indent, ' ' ); 81 (*i)->print( os, indent + 2 ); 85 82 // need an endl after each element because it's not easy to know when each individual item should end 86 83 os << std::endl; … … 354 351 template< typename T1, typename T2 > 355 352 struct group_iterate_t { 356 private:357 std::tuple<T1, T2> args;358 public:359 353 group_iterate_t( bool skipBoundsCheck, const T1 & v1, const T2 & v2 ) : args(v1, v2) { 360 354 assertf(skipBoundsCheck || v1.size() == v2.size(), "group iteration requires containers of the same size: <%zd, %zd>.", v1.size(), v2.size()); 361 355 }; 362 356 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 367 357 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; 368 363 typedef std::tuple<T1Iter, T2Iter> IterTuple; 369 364 IterTuple it; … … 375 370 value_type operator*() const { return std::tie( *std::get<0>(it), *std::get<1>(it) ); } 376 371 }; 377 378 372 iterator begin() { return iterator( std::get<0>(args).begin(), std::get<1>(args).begin() ); } 379 373 iterator end() { return iterator( std::get<0>(args).end(), std::get<1>(args).end() ); } 374 375 private: 376 std::tuple<T1, T2> args; 380 377 }; 381 378 -
src/Concurrency/Keywords.cc
r3f7e12cb r78315272 196 196 std::list<DeclarationWithType*> findMutexArgs( FunctionDecl* ); 197 197 void validate( DeclarationWithType * ); 198 void addDtorStatments( FunctionDecl* func, CompoundStmt *, const std::list<DeclarationWithType * > &);199 198 void addStatments( FunctionDecl* func, CompoundStmt *, const std::list<DeclarationWithType * > &); 200 199 … … 207 206 StructDecl* monitor_decl = nullptr; 208 207 StructDecl* guard_decl = nullptr; 209 StructDecl* dtor_guard_decl = nullptr;210 208 211 209 static std::unique_ptr< Type > generic_func; … … 231 229 232 230 void postvisit( FunctionDecl * decl ); 233 void previsit ( StructDecl * decl );234 231 235 232 void addStartStatement( FunctionDecl * decl, DeclarationWithType * param ); … … 239 236 acceptAll( translationUnit, impl ); 240 237 } 241 242 private :243 bool thread_ctor_seen = false;244 StructDecl * thread_decl = nullptr;245 238 }; 246 239 … … 410 403 if( mutexArgs.empty() ) return; 411 404 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 418 405 for(auto arg : mutexArgs) { 419 406 validate( arg ); … … 425 412 if( !monitor_decl ) throw SemanticError( "mutex keyword requires monitors to be in scope, add #include <monitor>", decl ); 426 413 if( !guard_decl ) throw SemanticError( "mutex keyword requires monitors to be in scope, add #include <monitor>", decl ); 427 if( !dtor_guard_decl ) throw SemanticError( "mutex keyword requires monitors to be in scope, add #include <monitor>", decl ); 428 429 if( isDtor ) { 430 addDtorStatments( decl, body, mutexArgs ); 431 } 432 else { 433 addStatments( decl, body, mutexArgs ); 434 } 414 415 addStatments( decl, body, mutexArgs ); 435 416 } 436 417 … … 444 425 assert( !guard_decl ); 445 426 guard_decl = decl; 446 }447 else if( decl->name == "monitor_dtor_guard_t" ) {448 assert( !dtor_guard_decl );449 dtor_guard_decl = decl;450 427 } 451 428 } … … 480 457 //Make sure that typed isn't mutex 481 458 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_decl498 )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_decl519 ),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 true527 )528 ))529 );530 531 //monitor_desc * __monitors[] = { get_monitor(a), get_monitor(b) };532 body->push_front( new DeclStmt( noLabels, monitors) );533 459 } 534 460 … … 597 523 // General entry routine 598 524 //============================================================================================= 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 606 525 void ThreadStarter::postvisit(FunctionDecl * decl) { 607 526 if( ! CodeGen::isConstructor(decl->name) ) return; 608 527 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 615 528 DeclarationWithType * param = decl->get_functionType()->get_parameters().front(); 616 529 auto type = dynamic_cast< StructInstType * >( InitTweak::getPointerBase( param->get_type() ) ); 530 // if( type ) std::cerr << "FRED2" << std::endl; 617 531 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 622 532 addStartStatement( decl, param ); 623 533 } -
src/Concurrency/Waitfor.cc
r3f7e12cb r78315272 27 27 #include "InitTweak/InitTweak.h" // for getPointerBase 28 28 #include "Parser/LinkageSpec.h" // for Cforall 29 #include " ResolvExpr/Resolver.h" // for findVoidExpression29 #include "SymTab/AddVisit.h" // for acceptAndAdd 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 Indexer{114 class GenerateWaitForPass final : public WithStmtsToAdd { 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 );130 128 ObjectDecl * declMon( WaitForStmt::Clause & clause, CompoundStmt * stmt ); 131 void init( ObjectDecl * acceptables, int index, WaitForStmt::Clause & clause, Statement * settter,CompoundStmt * stmt );132 Expression * init_timeout( Expression *& time, Expression *& time_cond, bool has_else, Expression *& else_cond, Statement * settter,CompoundStmt * stmt );133 Expression * call( size_t count, ObjectDecl * acceptables, Expression * timeout, CompoundStmt * stmt);134 void choose( WaitForStmt * waitfor, Expression * result, CompoundStmt * stmt);129 void init( ObjectDecl * acceptables, int index, WaitForStmt::Clause & clause, CompoundStmt * stmt ); 130 Expression * init_timeout( Expression *& time, Expression *& time_cond, bool has_else, Expression *& else_cond, CompoundStmt * stmt ); 131 Expression * call(); 132 void choose(); 135 133 136 134 static void implement( std::list< Declaration * > & translationUnit ) { … … 142 140 private: 143 141 FunctionDecl * decl_waitfor = nullptr; 144 StructDecl * decl_mask = nullptr;145 142 StructDecl * decl_acceptable = nullptr; 146 143 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; 147 148 148 149 static std::unique_ptr< Type > generic_func; 149 150 151 UniqueName namer_mon = "__monitors_"s; 150 152 UniqueName namer_acc = "__acceptables_"s; 151 UniqueName namer_idx = "__index_"s;152 UniqueName namer_flg = "__do_run_"s;153 UniqueName namer_msk = "__mask_"s;154 UniqueName namer_mon = "__monitors_"s;155 153 UniqueName namer_tim = "__timeout_"s; 156 154 }; … … 169 167 namespace { 170 168 Expression * makeOpIndex( DeclarationWithType * array, unsigned long index ) { 171 return new UntypedExpr(169 return new ApplicationExpr( 172 170 new NameExpr( "?[?]" ), 173 171 { … … 179 177 180 178 Expression * makeOpAssign( Expression * lhs, Expression * rhs ) { 181 return new UntypedExpr(179 return new ApplicationExpr( 182 180 new NameExpr( "?=?" ), 183 181 { lhs, rhs } … … 185 183 } 186 184 187 Expression * makeOpMember( Expression * sue, const std::string & mem ) { 188 return new UntypedMemberExpr( new NameExpr( mem ), sue ); 189 } 190 191 Statement * makeAccStatement( DeclarationWithType * object, unsigned long index, const std::string & member, Expression * value, const SymTab::Indexer & indexer ) { 192 Expression * expr = makeOpAssign( 193 makeOpMember( 194 makeOpIndex( 195 object, 196 index 185 Expression * makeOpMember( Expression * sue, DeclarationWithType * mem ) { 186 return new MemberExpr( mem, sue ); 187 } 188 189 Statement * makeAccStatement( DeclarationWithType * object, unsigned long index, DeclarationWithType * member, Expression * value ) { 190 return new ExprStmt( 191 noLabels, 192 makeOpAssign( 193 makeOpMember( 194 makeOpIndex( 195 object, 196 index 197 ), 198 member 197 199 ), 198 member 199 ), 200 value 200 value 201 ) 201 202 ); 202 203 ResolvExpr::findVoidExpression( expr, indexer );204 205 return new ExprStmt( noLabels, expr );206 203 } 207 204 … … 211 208 return new ConstantExpr( Constant::from_bool( ifnull ) ); 212 209 } 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 }228 210 }; 229 211 … … 234 216 235 217 void GenerateWaitForPass::premutate( FunctionDecl * decl) { 236 if( decl->name != "__ waitfor_internal" ) return;218 if( decl->name != "__accept_internal" ) return; 237 219 238 220 decl_waitfor = decl; … … 245 227 assert( !decl_acceptable ); 246 228 decl_acceptable = decl; 247 } 248 else if( decl->name == "__waitfor_mask_t" ) { 249 assert( !decl_mask ); 250 decl_mask = decl; 229 for( Declaration * field : decl_acceptable->members ) { 230 if( field->name == "func" ) decl_m_func = strict_dynamic_cast< DeclarationWithType * >( field ); 231 else if( field->name == "count" ) decl_m_count = strict_dynamic_cast< DeclarationWithType * >( field ); 232 else if( field->name == "monitor" ) decl_m_monitors = strict_dynamic_cast< DeclarationWithType * >( field ); 233 else if( field->name == "is_dtor" ) decl_m_isdtor = strict_dynamic_cast< DeclarationWithType * >( field ); 234 } 235 251 236 } 252 237 else if( decl->name == "monitor_desc" ) { … … 257 242 258 243 Statement * GenerateWaitForPass::postmutate( WaitForStmt * waitfor ) { 259 if( !decl_monitor || !decl_acceptable || !decl_mask ) throw SemanticError( "waitfor keyword requires monitors to be in scope, add #include <monitor>", waitfor ); 244 return waitfor; 245 246 if( !decl_monitor || !decl_acceptable ) throw SemanticError( "waitfor keyword requires monitors to be in scope, add #include <monitor>", waitfor ); 260 247 261 248 CompoundStmt * stmt = new CompoundStmt( noLabels ); 262 249 263 250 ObjectDecl * acceptables = declare( waitfor->clauses.size(), stmt ); 264 ObjectDecl * flag = declareFlag( stmt );265 Statement * setter = makeSetter( flag );266 251 267 252 int index = 0; 268 253 for( auto & clause : waitfor->clauses ) { 269 init( acceptables, index, clause, s etter, stmt );254 init( acceptables, index, clause, stmt ); 270 255 271 256 index++; … … 277 262 waitfor->orelse .statement, 278 263 waitfor->orelse .condition, 279 setter,280 264 stmt 281 265 ); 282 266 283 CompoundStmt * compound = new CompoundStmt( noLabels ); 284 stmt->push_back( new IfStmt( 285 noLabels, 286 safeCond( new VariableExpr( flag ) ), 287 compound, 288 nullptr 289 )); 290 291 Expression * result = call( waitfor->clauses.size(), acceptables, timeout, compound ); 292 293 choose( waitfor, result, compound ); 267 // Expression * result = call( acceptables, timeout, orelse, stmt ); 268 269 // choose( waitfor, result ); 294 270 295 271 return stmt; … … 298 274 ObjectDecl * GenerateWaitForPass::declare( unsigned long count, CompoundStmt * stmt ) 299 275 { 300 ObjectDecl * acceptables = ObjectDecl::newObject(276 ObjectDecl * acceptables = new ObjectDecl( 301 277 namer_acc.newName(), 278 noStorage, 279 LinkageSpec::Cforall, 280 nullptr, 302 281 new ArrayType( 303 282 noQualifiers, … … 315 294 stmt->push_back( new DeclStmt( noLabels, acceptables) ); 316 295 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 330 296 return acceptables; 331 297 } 332 298 333 ObjectDecl * GenerateWaitForPass::declareFlag( CompoundStmt * stmt ) {334 ObjectDecl * flag = ObjectDecl::newObject(335 namer_flg.newName(),336 new BasicType(337 noQualifiers,338 BasicType::Bool339 ),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 362 299 ObjectDecl * GenerateWaitForPass::declMon( WaitForStmt::Clause & clause, CompoundStmt * stmt ) { 363 300 364 ObjectDecl * mon = ObjectDecl::newObject(301 ObjectDecl * mon = new ObjectDecl( 365 302 namer_mon.newName(), 303 noStorage, 304 LinkageSpec::Cforall, 305 nullptr, 366 306 new ArrayType( 367 307 noQualifiers, 368 new PointerType(308 new StructInstType( 369 309 noQualifiers, 370 new StructInstType( 371 noQualifiers, 372 decl_monitor 373 ) 310 decl_monitor 374 311 ), 375 312 new ConstantExpr( Constant::from_ulong( clause.target.arguments.size() ) ), … … 379 316 new ListInit( 380 317 map_range < std::list<Initializer*> > ( clause.target.arguments, [this](Expression * expr ){ 381 Expression * init = new CastExpr( 382 new UntypedExpr( 383 new NameExpr( "get_monitor" ), 384 { expr } 385 ), 386 new PointerType( 387 noQualifiers, 388 new StructInstType( 389 noQualifiers, 390 decl_monitor 391 ) 392 ) 393 ); 394 395 ResolvExpr::findSingleExpression( init, indexer ); 396 return new SingleInit( init ); 318 return new SingleInit( expr ); 397 319 }) 398 320 ) … … 404 326 } 405 327 406 void GenerateWaitForPass::init( ObjectDecl * acceptables, int index, WaitForStmt::Clause & clause, Statement * setter,CompoundStmt * stmt ) {328 void GenerateWaitForPass::init( ObjectDecl * acceptables, int index, WaitForStmt::Clause & clause, CompoundStmt * stmt ) { 407 329 408 330 ObjectDecl * monitors = declMon( clause, stmt ); 409 331 410 Type * fptr_t = new PointerType( noQualifiers, new FunctionType( noQualifiers, true ) ); 332 CompoundStmt * compound = new CompoundStmt( noLabels ); 333 compound->push_back( makeAccStatement( acceptables, index, decl_m_func , clause.target.function ) ); 334 compound->push_back( makeAccStatement( acceptables, index, decl_m_count , new ConstantExpr( Constant::from_ulong( clause.target.arguments.size() ) ) ) ); 335 compound->push_back( makeAccStatement( acceptables, index, decl_m_monitors, new VariableExpr( monitors ) ) ); 336 compound->push_back( makeAccStatement( acceptables, index, decl_m_isdtor , new ConstantExpr( Constant::from_bool( true ) ) ) ); 411 337 412 338 stmt->push_back( new IfStmt( 413 339 noLabels, 414 340 safeCond( clause.condition ), 415 new CompoundStmt({ 416 makeAccStatement( acceptables, index, "is_dtor", detectIsDtor( clause.target.function ) , indexer ), 417 makeAccStatement( acceptables, index, "func" , new CastExpr( clause.target.function, fptr_t ) , indexer ), 418 makeAccStatement( acceptables, index, "list" , new VariableExpr( monitors ) , indexer ), 419 makeAccStatement( acceptables, index, "size" , new ConstantExpr( Constant::from_ulong( clause.target.arguments.size() ) ), indexer ), 420 setter->clone() 421 }), 341 compound, 422 342 nullptr 423 343 )); … … 433 353 bool has_else, 434 354 Expression *& else_cond, 435 Statement * setter,436 355 CompoundStmt * stmt 437 356 ) { 438 ObjectDecl * timeout = ObjectDecl::newObject(357 ObjectDecl * timeout = new ObjectDecl( 439 358 namer_tim.newName(), 359 noStorage, 360 LinkageSpec::Cforall, 361 nullptr, 440 362 new BasicType( 441 363 noQualifiers, … … 452 374 stmt->push_back( new IfStmt( 453 375 noLabels, 454 safeCond( time_cond ), 455 new CompoundStmt({ 456 new ExprStmt( 457 noLabels, 458 makeOpAssign( 459 new VariableExpr( timeout ), 460 time 461 ) 462 ), 463 setter->clone() 464 }), 376 safeCond( else_cond ), 377 new ExprStmt( 378 noLabels, 379 makeOpAssign( 380 new VariableExpr( timeout ), 381 time 382 ) 383 ), 465 384 nullptr 466 385 )); … … 473 392 noLabels, 474 393 safeCond( else_cond ), 475 new CompoundStmt({ 476 new ExprStmt( 477 noLabels, 478 makeOpAssign( 479 new VariableExpr( timeout ), 480 new ConstantExpr( Constant::from_ulong( 0 ) ) 481 ) 482 ), 483 setter->clone() 484 }), 394 new ExprStmt( 395 noLabels, 396 makeOpAssign( 397 new VariableExpr( timeout ), 398 new ConstantExpr( Constant::from_ulong( 0 ) ) 399 ) 400 ), 485 401 nullptr 486 402 )); … … 489 405 } 490 406 491 delete setter;492 493 407 return new VariableExpr( timeout ); 494 }495 496 Expression * GenerateWaitForPass::call(497 size_t count,498 ObjectDecl * acceptables,499 Expression * timeout,500 CompoundStmt * stmt501 ) {502 ObjectDecl * index = ObjectDecl::newObject(503 namer_idx.newName(),504 new BasicType(505 noQualifiers,506 BasicType::ShortSignedInt507 ),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_mask520 ),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_mask542 )543 )544 ),545 timeout546 }547 )548 ));549 550 return new VariableExpr( index );551 }552 553 void GenerateWaitForPass::choose(554 WaitForStmt * waitfor,555 Expression * result,556 CompoundStmt * stmt557 ) {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::Break576 )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::Break593 )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::Break610 )611 }612 )613 );614 }615 616 stmt->push_back( swtch );617 408 } 618 409 }; -
src/GenPoly/Box.cc
r3f7e12cb r78315272 32 32 #include "Common/UniqueName.h" // for UniqueName 33 33 #include "Common/utility.h" // for toString 34 #include "DeclMutator.h" // for DeclMutator 34 35 #include "FindFunction.h" // for findFunction, findAndReplace... 35 36 #include "GenPoly/ErasableScopedMap.h" // for ErasableScopedMap<>::const_i... … … 38 39 #include "Lvalue.h" // for generalizedLvalue 39 40 #include "Parser/LinkageSpec.h" // for C, Spec, Cforall, Intrinsic 41 #include "PolyMutator.h" // for PolyMutator 40 42 #include "ResolvExpr/TypeEnvironment.h" // for EqvClass 41 43 #include "ResolvExpr/typeops.h" // for typesCompatible … … 60 62 FunctionType *makeAdapterType( FunctionType *adaptee, const TyVarMap &tyVars ); 61 63 62 class BoxPass { 63 protected: 64 BoxPass() : scopeTyVars( TypeDecl::Data{} ) {} 65 TyVarMap scopeTyVars; 64 /// Adds layout-generation functions to polymorphic types 65 class LayoutFunctionBuilder final : public DeclMutator { 66 unsigned int functionNesting; // current level of nested functions 67 public: 68 LayoutFunctionBuilder() : functionNesting( 0 ) {} 69 70 using DeclMutator::mutate; 71 virtual DeclarationWithType *mutate( FunctionDecl *functionDecl ) override; 72 virtual Declaration *mutate( StructDecl *structDecl ) override; 73 virtual Declaration *mutate( UnionDecl *unionDecl ) override; 66 74 }; 67 75 68 /// Adds layout-generation functions to polymorphic types69 class LayoutFunctionBuilder final : public WithDeclsToAdd, public WithVisitorRef<LayoutFunctionBuilder>, public WithShortCircuiting {70 unsigned int functionNesting = 0; // current level of nested functions71 public:72 void previsit( FunctionDecl *functionDecl );73 void previsit( StructDecl *structDecl );74 void previsit( UnionDecl *unionDecl );75 };76 77 76 /// Replaces polymorphic return types with out-parameters, replaces calls to polymorphic functions with adapter calls as needed, and adds appropriate type variables to the function call 78 class Pass1 final : public BoxPass, public WithTypeSubstitution, public WithStmtsToAdd, public WithGuards, public WithVisitorRef<Pass1>, public WithShortCircuiting{77 class Pass1 final : public PolyMutator { 79 78 public: 80 79 Pass1(); 81 80 82 void premutate( FunctionDecl * functionDecl ); 83 void premutate( TypeDecl * typeDecl ); 84 void premutate( CommaExpr * commaExpr ); 85 Expression * postmutate( ApplicationExpr * appExpr ); 86 Expression * postmutate( UntypedExpr *expr ); 87 void premutate( AddressExpr * addrExpr ); 88 Expression * postmutate( AddressExpr * addrExpr ); 89 void premutate( ReturnStmt * returnStmt ); 90 void premutate( PointerType * pointerType ); 91 void premutate( FunctionType * functionType ); 92 93 void beginScope(); 94 void endScope(); 81 using PolyMutator::mutate; 82 virtual Expression *mutate( ApplicationExpr *appExpr ) override; 83 virtual Expression *mutate( AddressExpr *addrExpr ) override; 84 virtual Expression *mutate( UntypedExpr *expr ) override; 85 virtual DeclarationWithType* mutate( FunctionDecl *functionDecl ) override; 86 virtual TypeDecl *mutate( TypeDecl *typeDecl ) override; 87 virtual Expression *mutate( CommaExpr *commaExpr ) override; 88 virtual Expression *mutate( ConditionalExpr *condExpr ) override; 89 virtual Statement * mutate( ReturnStmt *returnStmt ) override; 90 virtual Type *mutate( PointerType *pointerType ) override; 91 virtual Type * mutate( FunctionType *functionType ) override; 92 93 virtual void doBeginScope() override; 94 virtual void doEndScope() override; 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 struct Pass2 final : public BoxPass, public WithGuards { 132 void handleAggDecl(); 133 134 DeclarationWithType * postmutate( FunctionDecl *functionDecl ); 135 void premutate( StructDecl *structDecl ); 136 void premutate( UnionDecl *unionDecl ); 137 void premutate( TraitDecl *unionDecl ); 138 void premutate( TypeDecl *typeDecl ); 139 void premutate( PointerType *pointerType ); 140 void premutate( FunctionType *funcType ); 131 class Pass2 final : public PolyMutator { 132 public: 133 template< typename DeclClass > 134 DeclClass *handleDecl( DeclClass *decl ); 135 template< typename AggDecl > 136 AggDecl * handleAggDecl( AggDecl * aggDecl ); 137 138 typedef PolyMutator Parent; 139 using Parent::mutate; 140 virtual DeclarationWithType *mutate( FunctionDecl *functionDecl ) override; 141 virtual ObjectDecl *mutate( ObjectDecl *objectDecl ) override; 142 virtual StructDecl *mutate( StructDecl *structDecl ) override; 143 virtual UnionDecl *mutate( UnionDecl *unionDecl ) override; 144 virtual TraitDecl *mutate( TraitDecl *unionDecl ) override; 145 virtual TypeDecl *mutate( TypeDecl *typeDecl ) override; 146 virtual TypedefDecl *mutate( TypedefDecl *typedefDecl ) override; 147 virtual Type *mutate( PointerType *pointerType ) override; 148 virtual Type *mutate( FunctionType *funcType ) override; 141 149 142 150 private: … … 150 158 /// * Calculates polymorphic offsetof expressions from offset array 151 159 /// * Inserts dynamic calculation of polymorphic type layouts where needed 152 class PolyGenericCalculator final : public BoxPass, publicWithGuards, public WithVisitorRef<PolyGenericCalculator>, public WithStmtsToAdd, public WithDeclsToAdd, public WithTypeSubstitution {160 class PolyGenericCalculator final : public WithGuards, public WithVisitorRef<PolyGenericCalculator>, public WithStmtsToAdd, public WithDeclsToAdd, public WithTypeSubstitution { 153 161 public: 154 162 PolyGenericCalculator(); … … 189 197 ScopedSet< std::string > knownOffsets; ///< Set of non-generic types for which the offset array exists in the current scope, indexed by offsetofName 190 198 UniqueName bufNamer; ///< Namer for VLA buffers 199 TyVarMap scopeTyVars; 191 200 }; 192 201 193 202 /// Replaces initialization of polymorphic values with alloca, declaration of dtype/ftype with appropriate void expression, sizeof expressions of polymorphic types with the proper variable, and strips fields from generic struct declarations. 194 struct Pass3 final : public BoxPass, public WithGuards { 203 class Pass3 final : public PolyMutator { 204 public: 195 205 template< typename DeclClass > 196 void handleDecl( DeclClass * decl, Type * type ); 197 198 void premutate( ObjectDecl * objectDecl ); 199 void premutate( FunctionDecl * functionDecl ); 200 void premutate( TypedefDecl * typedefDecl ); 201 void premutate( StructDecl * structDecl ); 202 void premutate( UnionDecl * unionDecl ); 203 void premutate( TypeDecl * typeDecl ); 204 void premutate( PointerType * pointerType ); 205 void premutate( FunctionType * funcType ); 206 DeclClass *handleDecl( DeclClass *decl, Type *type ); 207 208 using PolyMutator::mutate; 209 virtual DeclarationWithType *mutate( FunctionDecl *functionDecl ) override; 210 virtual Declaration *mutate( StructDecl *structDecl ) override; 211 virtual Declaration *mutate( UnionDecl *unionDecl ) override; 212 virtual ObjectDecl *mutate( ObjectDecl *objectDecl ) override; 213 virtual TypedefDecl *mutate( TypedefDecl *objectDecl ) override; 214 virtual TypeDecl *mutate( TypeDecl *objectDecl ) override; 215 virtual Type *mutate( PointerType *pointerType ) override; 216 virtual Type *mutate( FunctionType *funcType ) override; 217 private: 206 218 }; 207 219 } // anonymous namespace … … 235 247 236 248 void box( std::list< Declaration *>& translationUnit ) { 237 PassVisitor<LayoutFunctionBuilder>layoutBuilder;238 Pass Visitor<Pass1>pass1;239 Pass Visitor<Pass2>pass2;249 LayoutFunctionBuilder layoutBuilder; 250 Pass1 pass1; 251 Pass2 pass2; 240 252 PassVisitor<PolyGenericCalculator> polyCalculator; 241 Pass Visitor<Pass3>pass3;242 243 acceptAll( translationUnit, layoutBuilder);244 mutate All( translationUnit, pass1 );245 mutate All( translationUnit, pass2 );253 Pass3 pass3; 254 255 layoutBuilder.mutateDeclarationList( translationUnit ); 256 mutateTranslationUnit/*All*/( translationUnit, pass1 ); 257 mutateTranslationUnit/*All*/( translationUnit, pass2 ); 246 258 mutateAll( translationUnit, polyCalculator ); 247 mutate All( translationUnit, pass3 );259 mutateTranslationUnit/*All*/( translationUnit, pass3 ); 248 260 } 249 261 250 262 ////////////////////////////////// LayoutFunctionBuilder //////////////////////////////////////////// 251 263 252 void LayoutFunctionBuilder::previsit( FunctionDecl *functionDecl ) { 253 visit_children = false; 254 maybeAccept( functionDecl->get_functionType(), *visitor ); 264 DeclarationWithType *LayoutFunctionBuilder::mutate( FunctionDecl *functionDecl ) { 265 functionDecl->set_functionType( maybeMutate( functionDecl->get_functionType(), *this ) ); 255 266 ++functionNesting; 256 maybeAccept( functionDecl->get_statements(), *visitor);267 functionDecl->set_statements( maybeMutate( functionDecl->get_statements(), *this ) ); 257 268 --functionNesting; 269 return functionDecl; 258 270 } 259 271 … … 344 356 } 345 357 346 void LayoutFunctionBuilder::previsit( StructDecl *structDecl ) {358 Declaration *LayoutFunctionBuilder::mutate( StructDecl *structDecl ) { 347 359 // do not generate layout function for "empty" tag structs 348 visit_children = false; 349 if ( structDecl->get_members().empty() ) return; 360 if ( structDecl->get_members().empty() ) return structDecl; 350 361 351 362 // get parameters that can change layout, exiting early if none 352 363 std::list< TypeDecl* > otypeParams = takeOtypeOnly( structDecl->get_parameters() ); 353 if ( otypeParams.empty() ) return ;364 if ( otypeParams.empty() ) return structDecl; 354 365 355 366 // build layout function signature … … 402 413 addStmt( layoutDecl->get_statements(), makeAlignTo( derefVar( sizeParam ), derefVar( alignParam ) ) ); 403 414 404 declsToAddAfter.push_back( layoutDecl ); 415 addDeclarationAfter( layoutDecl ); 416 return structDecl; 405 417 } 406 418 407 void LayoutFunctionBuilder::previsit( UnionDecl *unionDecl ) {419 Declaration *LayoutFunctionBuilder::mutate( UnionDecl *unionDecl ) { 408 420 // do not generate layout function for "empty" tag unions 409 visit_children = false; 410 if ( unionDecl->get_members().empty() ) return; 421 if ( unionDecl->get_members().empty() ) return unionDecl; 411 422 412 423 // get parameters that can change layout, exiting early if none 413 424 std::list< TypeDecl* > otypeParams = takeOtypeOnly( unionDecl->get_parameters() ); 414 if ( otypeParams.empty() ) return ;425 if ( otypeParams.empty() ) return unionDecl; 415 426 416 427 // build layout function signature … … 445 456 addStmt( layoutDecl->get_statements(), makeAlignTo( derefVar( sizeParam ), derefVar( alignParam ) ) ); 446 457 447 declsToAddAfter.push_back( layoutDecl ); 458 addDeclarationAfter( layoutDecl ); 459 return unionDecl; 448 460 } 449 461 … … 489 501 Pass1::Pass1() : tempNamer( "_temp" ) {} 490 502 491 void Pass1::premutate( FunctionDecl *functionDecl ) {503 DeclarationWithType *Pass1::mutate( FunctionDecl *functionDecl ) { 492 504 if ( functionDecl->get_statements() ) { // empty routine body ? 493 505 // std::cerr << "mutating function: " << functionDecl->get_mangleName() << std::endl; 494 GuardScope( scopeTyVars ); 495 GuardValue( retval ); 506 doBeginScope(); 507 scopeTyVars.beginScope(); 508 509 DeclarationWithType *oldRetval = retval; 496 510 497 511 // process polymorphic return value 498 512 retval = nullptr; 499 FunctionType *functionType = functionDecl->type; 500 if ( isDynRet( functionType ) && functionDecl->linkage != LinkageSpec::C ) { 501 retval = functionType->returnVals.front(); 513 if ( isDynRet( functionDecl->get_functionType() ) && functionDecl->get_linkage() != LinkageSpec::C ) { 514 retval = functionDecl->get_functionType()->get_returnVals().front(); 502 515 503 516 // give names to unnamed return values 504 if ( retval-> name== "" ) {505 retval-> name = "_retparm";506 retval-> linkage = LinkageSpec::C;517 if ( retval->get_name() == "" ) { 518 retval->set_name( "_retparm" ); 519 retval->set_linkage( LinkageSpec::C ); 507 520 } // if 508 521 } // if 509 522 510 makeTyVarMap( functionType, scopeTyVars ); 511 512 std::list< DeclarationWithType *> ¶mList = functionType->parameters; 523 FunctionType *functionType = functionDecl->get_functionType(); 524 makeTyVarMap( functionDecl->get_functionType(), scopeTyVars ); 525 526 std::list< DeclarationWithType *> ¶mList = functionType->get_parameters(); 513 527 std::list< FunctionType *> functions; 514 for ( Type::ForallList::iterator tyVar = functionType-> forall.begin(); tyVar != functionType->forall.end(); ++tyVar ) {515 for ( std::list< DeclarationWithType *>::iterator assert = (*tyVar)-> assertions.begin(); assert != (*tyVar)->assertions.end(); ++assert ) {528 for ( Type::ForallList::iterator tyVar = functionType->get_forall().begin(); tyVar != functionType->get_forall().end(); ++tyVar ) { 529 for ( std::list< DeclarationWithType *>::iterator assert = (*tyVar)->get_assertions().begin(); assert != (*tyVar)->get_assertions().end(); ++assert ) { 516 530 findFunction( (*assert)->get_type(), functions, scopeTyVars, needsAdapter ); 517 531 } // for … … 528 542 } // if 529 543 } // for 544 545 functionDecl->set_statements( functionDecl->get_statements()->acceptMutator( *this ) ); 546 547 scopeTyVars.endScope(); 548 retval = oldRetval; 549 doEndScope(); 530 550 // std::cerr << "end function: " << functionDecl->get_mangleName() << std::endl; 531 551 } // if 532 } 533 534 void Pass1::premutate( TypeDecl *typeDecl ) { 552 return functionDecl; 553 } 554 555 TypeDecl *Pass1::mutate( TypeDecl *typeDecl ) { 535 556 addToTyVarMap( typeDecl, scopeTyVars ); 536 } 537 538 void Pass1::premutate( CommaExpr *commaExpr ) { 557 return dynamic_cast<TypeDecl*>( Mutator::mutate( typeDecl ) ); 558 } 559 560 Expression *Pass1::mutate( CommaExpr *commaExpr ) { 539 561 // Attempting to find application expressions that were mutated by the copy constructor passes 540 562 // to use an explicit return variable, so that the variable can be reused as a parameter to the … … 552 574 } 553 575 } 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 554 588 } 555 589 … … 600 634 601 635 // add size/align for generic types to parameter list 602 if ( ! appExpr->get_function()-> result) return;636 if ( ! appExpr->get_function()->has_result() ) return; 603 637 FunctionType *funcType = getFunctionType( appExpr->get_function()->get_result() ); 604 638 assert( funcType ); … … 625 659 ObjectDecl *Pass1::makeTemporary( Type *type ) { 626 660 ObjectDecl *newObj = new ObjectDecl( tempNamer.newName(), Type::StorageClasses(), LinkageSpec::C, 0, type, 0 ); 627 stmtsToAdd Before.push_back( new DeclStmt( noLabels, newObj ) );661 stmtsToAdd.push_back( new DeclStmt( noLabels, newObj ) ); 628 662 return newObj; 629 663 } … … 714 748 715 749 void Pass1::boxParam( Type *param, Expression *&arg, const TyVarMap &exprTyVars ) { 716 assertf( arg->result, "arg does not have result: %s", toString( arg ).c_str() ); 717 if ( ! needsBoxing( param, arg->result, exprTyVars, env ) ) return; 718 719 if ( arg->result->get_lvalue() ) { 720 // argument expression may be CFA lvalue, but not C lvalue -- apply generalizedLvalue transformations. 721 // if ( VariableExpr * varExpr = dynamic_cast< VariableExpr * >( arg ) ) { 722 // if ( dynamic_cast<ArrayType *>( varExpr->var->get_type() ) ){ 723 // // temporary hack - don't box arrays, because &arr is not the same as &arr[0] 724 // return; 725 // } 726 // } 727 arg = generalizedLvalue( new AddressExpr( arg ) ); 728 if ( ! ResolvExpr::typesCompatible( param, arg->get_result(), SymTab::Indexer() ) ) { 729 // silence warnings by casting boxed parameters when the actual type does not match up with the formal type. 730 arg = new CastExpr( arg, param->clone() ); 731 } 732 } else { 733 // use type computed in unification to declare boxed variables 734 Type * newType = param->clone(); 750 assertf( arg->has_result(), "arg does not have result: %s", toString( arg ).c_str() ); 751 if ( isPolyType( param, exprTyVars ) ) { 752 Type * newType = arg->get_result()->clone(); 735 753 if ( env ) env->apply( newType ); 736 ObjectDecl *newObj = ObjectDecl::newObject( tempNamer.newName(), newType, nullptr ); 737 newObj->get_type()->get_qualifiers() = Type::Qualifiers(); // TODO: is this right??? 738 stmtsToAddBefore.push_back( new DeclStmt( noLabels, newObj ) ); 739 UntypedExpr *assign = new UntypedExpr( new NameExpr( "?=?" ) ); // TODO: why doesn't this just use initialization syntax? 740 assign->get_args().push_back( new VariableExpr( newObj ) ); 741 assign->get_args().push_back( arg ); 742 stmtsToAddBefore.push_back( new ExprStmt( noLabels, assign ) ); 743 arg = new AddressExpr( new VariableExpr( newObj ) ); 754 std::unique_ptr<Type> manager( newType ); 755 if ( isPolyType( newType ) ) { 756 // if the argument's type is polymorphic, we don't need to box again! 757 return; 758 } else if ( arg->get_result()->get_lvalue() ) { 759 // argument expression may be CFA lvalue, but not C lvalue -- apply generalizedLvalue transformations. 760 // if ( VariableExpr * varExpr = dynamic_cast< VariableExpr * >( arg ) ) { 761 // if ( dynamic_cast<ArrayType *>( varExpr->var->get_type() ) ){ 762 // // temporary hack - don't box arrays, because &arr is not the same as &arr[0] 763 // return; 764 // } 765 // } 766 arg = generalizedLvalue( new AddressExpr( arg ) ); 767 if ( ! ResolvExpr::typesCompatible( param, arg->get_result(), SymTab::Indexer() ) ) { 768 // silence warnings by casting boxed parameters when the actual type does not match up with the formal type. 769 arg = new CastExpr( arg, param->clone() ); 770 } 771 } else { 772 // use type computed in unification to declare boxed variables 773 Type * newType = param->clone(); 774 if ( env ) env->apply( newType ); 775 ObjectDecl *newObj = new ObjectDecl( tempNamer.newName(), Type::StorageClasses(), LinkageSpec::C, 0, newType, 0 ); 776 newObj->get_type()->get_qualifiers() = Type::Qualifiers(); // TODO: is this right??? 777 stmtsToAdd.push_back( new DeclStmt( noLabels, newObj ) ); 778 UntypedExpr *assign = new UntypedExpr( new NameExpr( "?=?" ) ); // TODO: why doesn't this just use initialization syntax? 779 assign->get_args().push_back( new VariableExpr( newObj ) ); 780 assign->get_args().push_back( arg ); 781 stmtsToAdd.push_back( new ExprStmt( noLabels, assign ) ); 782 arg = new AddressExpr( new VariableExpr( newObj ) ); 783 } // if 744 784 } // if 745 }746 747 // find instances of polymorphic type parameters748 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 t760 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;765 785 } 766 786 … … 769 789 /// this gets rid of warnings from gcc. 770 790 void addCast( Expression *&actual, Type *formal, const TyVarMap &tyVars ) { 771 // type contains polymorphism, but isn't exactly a polytype, in which case it 772 // has some real actual type (e.g. unsigned int) and casting to void * is wrong 773 if ( hasPolymorphism( formal, tyVars ) && ! isPolyType( formal, tyVars ) ) { 791 if ( getFunctionType( formal ) ) { 774 792 Type * newType = formal->clone(); 775 793 newType = ScrubTyVars::scrub( newType, tyVars ); … … 779 797 780 798 void Pass1::boxParams( ApplicationExpr *appExpr, FunctionType *function, std::list< Expression *>::iterator &arg, const TyVarMap &exprTyVars ) { 781 for ( std::list< DeclarationWithType *>::const_iterator param = function->get_parameters().begin(); param != function-> parameters.end(); ++param, ++arg ) {782 assertf( arg != appExpr-> args.end(), "boxParams: missing argument for param %s to %s in %s", toString( *param ).c_str(), toString( function ).c_str(), toString( appExpr ).c_str() );799 for ( std::list< DeclarationWithType *>::const_iterator param = function->get_parameters().begin(); param != function->get_parameters().end(); ++param, ++arg ) { 800 assertf( arg != appExpr->get_args().end(), "boxParams: missing argument for param %s to %s in %s", toString( *param ).c_str(), toString( function ).c_str(), toString( appExpr ).c_str() ); 783 801 addCast( *arg, (*param)->get_type(), exprTyVars ); 784 802 boxParam( (*param)->get_type(), *arg, exprTyVars ); … … 789 807 std::list< Expression *>::iterator cur = arg; 790 808 for ( Type::ForallList::iterator tyVar = functionType->get_forall().begin(); tyVar != functionType->get_forall().end(); ++tyVar ) { 791 for ( std::list< DeclarationWithType *>::iterator assert = (*tyVar)-> assertions.begin(); assert != (*tyVar)->assertions.end(); ++assert ) {809 for ( std::list< DeclarationWithType *>::iterator assert = (*tyVar)->get_assertions().begin(); assert != (*tyVar)->get_assertions().end(); ++assert ) { 792 810 InferredParams::const_iterator inferParam = appExpr->get_inferParams().find( (*assert)->get_uniqueId() ); 793 assertf( inferParam != appExpr->get_inferParams().end(), "addInferredParams missing inferred parameter: %s in: %s", toString( *assert ).c_str(), toString( appExpr ).c_str() ); 811 if ( inferParam == appExpr->get_inferParams().end() ) { 812 std::cerr << "looking for assertion: " << (*assert) << std::endl << appExpr << std::endl; 813 } 814 assertf( inferParam != appExpr->get_inferParams().end(), "NOTE: Explicit casts of polymorphic functions to compatible monomorphic functions are currently unsupported" ); 794 815 Expression *newExpr = inferParam->second.expr->clone(); 795 816 addCast( newExpr, (*assert)->get_type(), tyVars ); … … 801 822 802 823 void makeRetParm( FunctionType *funcType ) { 803 DeclarationWithType *retParm = funcType-> returnVals.front();824 DeclarationWithType *retParm = funcType->get_returnVals().front(); 804 825 805 826 // make a new parameter that is a pointer to the type of the old return value … … 814 835 // actually make the adapter type 815 836 FunctionType *adapter = adaptee->clone(); 837 // if ( ! adapter->get_returnVals().empty() && isPolyType( adapter->get_returnVals().front()->get_type(), tyVars ) ) { 816 838 if ( isDynRet( adapter, tyVars ) ) { 817 839 makeRetParm( adapter ); … … 939 961 std::pair< AdapterIter, bool > answer = adapters.insert( std::pair< std::string, DeclarationWithType *>( mangleName, newAdapter ) ); 940 962 adapter = answer.first; 941 stmtsToAdd Before.push_back( new DeclStmt( noLabels, newAdapter ) );963 stmtsToAdd.push_back( new DeclStmt( noLabels, newAdapter ) ); 942 964 } // if 943 965 assert( adapter != adapters.end() ); … … 977 999 if ( varExpr->get_var()->get_linkage() == LinkageSpec::Intrinsic ) { 978 1000 if ( varExpr->get_var()->get_name() == "?[?]" ) { 979 assert( appExpr-> result);1001 assert( appExpr->has_result() ); 980 1002 assert( appExpr->get_args().size() == 2 ); 981 1003 Type *baseType1 = isPolyPtr( appExpr->get_args().front()->get_result(), scopeTyVars, env ); … … 1011 1033 } // if 1012 1034 } else if ( varExpr->get_var()->get_name() == "*?" ) { 1013 assert( appExpr-> result);1035 assert( appExpr->has_result() ); 1014 1036 assert( ! appExpr->get_args().empty() ); 1015 1037 if ( isPolyType( appExpr->get_result(), scopeTyVars, env ) ) { … … 1028 1050 } // if 1029 1051 } else if ( varExpr->get_var()->get_name() == "?++" || varExpr->get_var()->get_name() == "?--" ) { 1030 assert( appExpr-> result);1052 assert( appExpr->has_result() ); 1031 1053 assert( appExpr->get_args().size() == 1 ); 1032 1054 if ( Type *baseType = isPolyPtr( appExpr->get_result(), scopeTyVars, env ) ) { … … 1048 1070 } // if 1049 1071 } else if ( varExpr->get_var()->get_name() == "++?" || varExpr->get_var()->get_name() == "--?" ) { 1050 assert( appExpr-> result);1072 assert( appExpr->has_result() ); 1051 1073 assert( appExpr->get_args().size() == 1 ); 1052 1074 if ( Type *baseType = isPolyPtr( appExpr->get_result(), scopeTyVars, env ) ) { … … 1054 1076 } // if 1055 1077 } else if ( varExpr->get_var()->get_name() == "?+?" || varExpr->get_var()->get_name() == "?-?" ) { 1056 assert( appExpr-> result);1078 assert( appExpr->has_result() ); 1057 1079 assert( appExpr->get_args().size() == 2 ); 1058 1080 Type *baseType1 = isPolyPtr( appExpr->get_args().front()->get_result(), scopeTyVars, env ); … … 1080 1102 } // if 1081 1103 } else if ( varExpr->get_var()->get_name() == "?+=?" || varExpr->get_var()->get_name() == "?-=?" ) { 1082 assert( appExpr-> result);1104 assert( appExpr->has_result() ); 1083 1105 assert( appExpr->get_args().size() == 2 ); 1084 1106 Type *baseType = isPolyPtr( appExpr->get_result(), scopeTyVars, env ); … … 1096 1118 } 1097 1119 1098 Expression *Pass1:: postmutate( ApplicationExpr *appExpr ) {1120 Expression *Pass1::mutate( ApplicationExpr *appExpr ) { 1099 1121 // std::cerr << "mutate appExpr: " << InitTweak::getFunctionName( appExpr ) << std::endl; 1100 1122 // for ( TyVarMap::iterator i = scopeTyVars.begin(); i != scopeTyVars.end(); ++i ) { … … 1102 1124 // } 1103 1125 // std::cerr << "\n"; 1104 1105 assert( appExpr->function->result ); 1106 FunctionType * function = getFunctionType( appExpr->function->result ); 1107 assertf( function, "ApplicationExpr has non-function type: %s", toString( appExpr->function->result ).c_str() ); 1126 appExpr->get_function()->acceptMutator( *this ); 1127 mutateAll( appExpr->get_args(), *this ); 1128 1129 assert( appExpr->get_function()->has_result() ); 1130 FunctionType * function = getFunctionType( appExpr->get_function()->get_result() ); 1131 assertf( function, "ApplicationExpr has non-function type: %s", toString( appExpr->get_function()->get_result() ).c_str() ); 1108 1132 1109 1133 if ( Expression *newExpr = handleIntrinsics( appExpr ) ) { … … 1158 1182 } 1159 1183 1160 Expression * Pass1::postmutate( UntypedExpr *expr ) {1161 if ( expr-> result && isPolyType( expr->result, scopeTyVars, env ) ) {1162 if ( NameExpr *name = dynamic_cast< NameExpr *>( expr-> function) ) {1184 Expression *Pass1::mutate( UntypedExpr *expr ) { 1185 if ( expr->has_result() && isPolyType( expr->get_result(), scopeTyVars, env ) ) { 1186 if ( NameExpr *name = dynamic_cast< NameExpr *>( expr->get_function() ) ) { 1163 1187 if ( name->get_name() == "*?" ) { 1164 Expression *ret = expr-> args.front();1165 expr-> args.clear();1188 Expression *ret = expr->get_args().front(); 1189 expr->get_args().clear(); 1166 1190 delete expr; 1167 return ret ;1191 return ret->acceptMutator( *this ); 1168 1192 } // if 1169 1193 } // if 1170 1194 } // if 1171 return expr; 1172 } 1173 1174 void Pass1::premutate( AddressExpr * ) { visit_children = false; } 1175 Expression * Pass1::postmutate( AddressExpr * addrExpr ) { 1176 assert( addrExpr->get_arg()->result && ! addrExpr->get_arg()->get_result()->isVoid() ); 1195 return PolyMutator::mutate( expr ); 1196 } 1197 1198 Expression *Pass1::mutate( AddressExpr *addrExpr ) { 1199 assert( addrExpr->get_arg()->has_result() && ! addrExpr->get_arg()->get_result()->isVoid() ); 1177 1200 1178 1201 bool needs = false; 1179 1202 if ( UntypedExpr *expr = dynamic_cast< UntypedExpr *>( addrExpr->get_arg() ) ) { 1180 if ( expr-> result&& isPolyType( expr->get_result(), scopeTyVars, env ) ) {1203 if ( expr->has_result() && isPolyType( expr->get_result(), scopeTyVars, env ) ) { 1181 1204 if ( NameExpr *name = dynamic_cast< NameExpr *>( expr->get_function() ) ) { 1182 1205 if ( name->get_name() == "*?" ) { 1183 1206 if ( ApplicationExpr * appExpr = dynamic_cast< ApplicationExpr * >( expr->get_args().front() ) ) { 1184 assert( appExpr->get_function()-> result);1207 assert( appExpr->get_function()->has_result() ); 1185 1208 FunctionType *function = getFunctionType( appExpr->get_function()->get_result() ); 1186 1209 assert( function ); … … 1193 1216 // isPolyType check needs to happen before mutating addrExpr arg, so pull it forward 1194 1217 // out of the if condition. 1195 addrExpr-> arg = addrExpr->get_arg()->acceptMutator( *visitor);1218 addrExpr->set_arg( mutateExpression( addrExpr->get_arg() ) ); 1196 1219 // ... but must happen after mutate, since argument might change (e.g. intrinsic *?, ?[?]) - re-evaluate above comment 1197 1220 bool polytype = isPolyType( addrExpr->get_arg()->get_result(), scopeTyVars, env ); … … 1208 1231 } 1209 1232 1210 void Pass1::premutate( ReturnStmt *returnStmt ) { 1211 if ( retval && returnStmt->expr ) { 1212 assert( returnStmt->expr->result && ! returnStmt->expr->result->isVoid() ); 1213 delete returnStmt->expr; 1214 returnStmt->expr = nullptr; 1233 Statement * Pass1::mutate( ReturnStmt *returnStmt ) { 1234 if ( retval && returnStmt->get_expr() ) { 1235 assert( returnStmt->get_expr()->has_result() && ! returnStmt->get_expr()->get_result()->isVoid() ); 1236 delete returnStmt->get_expr(); 1237 returnStmt->set_expr( 0 ); 1238 } else { 1239 returnStmt->set_expr( mutateExpression( returnStmt->get_expr() ) ); 1215 1240 } // if 1216 } 1217 1218 void Pass1::premutate( PointerType *pointerType ) { 1219 GuardScope( scopeTyVars ); 1241 return returnStmt; 1242 } 1243 1244 Type * Pass1::mutate( PointerType *pointerType ) { 1245 scopeTyVars.beginScope(); 1220 1246 makeTyVarMap( pointerType, scopeTyVars ); 1221 } 1222 1223 void Pass1::premutate( FunctionType *functionType ) { 1224 GuardScope( scopeTyVars ); 1247 1248 Type *ret = Mutator::mutate( pointerType ); 1249 1250 scopeTyVars.endScope(); 1251 return ret; 1252 } 1253 1254 Type * Pass1::mutate( FunctionType *functionType ) { 1255 scopeTyVars.beginScope(); 1225 1256 makeTyVarMap( functionType, scopeTyVars ); 1226 } 1227 1228 void Pass1::beginScope() { 1257 1258 Type *ret = Mutator::mutate( functionType ); 1259 1260 scopeTyVars.endScope(); 1261 return ret; 1262 } 1263 1264 void Pass1::doBeginScope() { 1229 1265 adapters.beginScope(); 1230 1266 } 1231 1267 1232 void Pass1:: endScope() {1268 void Pass1::doEndScope() { 1233 1269 adapters.endScope(); 1234 1270 } … … 1257 1293 } 1258 1294 1259 DeclarationWithType * Pass2::postmutate( FunctionDecl *functionDecl ) { 1295 template< typename DeclClass > 1296 DeclClass * Pass2::handleDecl( DeclClass *decl ) { 1297 DeclClass *ret = static_cast< DeclClass *>( Parent::mutate( decl ) ); 1298 1299 return ret; 1300 } 1301 1302 DeclarationWithType * Pass2::mutate( FunctionDecl *functionDecl ) { 1303 functionDecl = strict_dynamic_cast< FunctionDecl * > ( handleDecl( functionDecl ) ); 1260 1304 FunctionType * ftype = functionDecl->get_functionType(); 1261 1305 if ( ! ftype->get_returnVals().empty() && functionDecl->get_statements() ) { … … 1281 1325 } 1282 1326 1283 void Pass2::premutate( StructDecl * ) { 1327 ObjectDecl * Pass2::mutate( ObjectDecl *objectDecl ) { 1328 return handleDecl( objectDecl ); 1329 } 1330 1331 template< typename AggDecl > 1332 AggDecl * Pass2::handleAggDecl( AggDecl * aggDecl ) { 1284 1333 // prevent tyVars from leaking into containing scope 1285 GuardScope( scopeTyVars ); 1286 } 1287 1288 void Pass2::premutate( UnionDecl * ) { 1289 // prevent tyVars from leaking into containing scope 1290 GuardScope( scopeTyVars ); 1291 } 1292 1293 void Pass2::premutate( TraitDecl * ) { 1294 // prevent tyVars from leaking into containing scope 1295 GuardScope( scopeTyVars ); 1296 } 1297 1298 void Pass2::premutate( TypeDecl *typeDecl ) { 1334 scopeTyVars.beginScope(); 1335 Parent::mutate( aggDecl ); 1336 scopeTyVars.endScope(); 1337 return aggDecl; 1338 } 1339 1340 StructDecl * Pass2::mutate( StructDecl *aggDecl ) { 1341 return handleAggDecl( aggDecl ); 1342 } 1343 1344 UnionDecl * Pass2::mutate( UnionDecl *aggDecl ) { 1345 return handleAggDecl( aggDecl ); 1346 } 1347 1348 TraitDecl * Pass2::mutate( TraitDecl *aggDecl ) { 1349 return handleAggDecl( aggDecl ); 1350 } 1351 1352 TypeDecl * Pass2::mutate( TypeDecl *typeDecl ) { 1299 1353 addToTyVarMap( typeDecl, scopeTyVars ); 1300 } 1301 1302 void Pass2::premutate( PointerType *pointerType ) { 1303 GuardScope( scopeTyVars ); 1354 if ( typeDecl->get_base() ) { 1355 return handleDecl( typeDecl ); 1356 } else { 1357 return dynamic_cast<TypeDecl*>( Parent::mutate( typeDecl ) ); 1358 } 1359 } 1360 1361 TypedefDecl * Pass2::mutate( TypedefDecl *typedefDecl ) { 1362 return handleDecl( typedefDecl ); 1363 } 1364 1365 Type * Pass2::mutate( PointerType *pointerType ) { 1366 scopeTyVars.beginScope(); 1304 1367 makeTyVarMap( pointerType, scopeTyVars ); 1305 } 1306 1307 void Pass2::premutate( FunctionType *funcType ) { 1308 GuardScope( scopeTyVars ); 1368 1369 Type *ret = Parent::mutate( pointerType ); 1370 1371 scopeTyVars.endScope(); 1372 return ret; 1373 } 1374 1375 Type *Pass2::mutate( FunctionType *funcType ) { 1376 scopeTyVars.beginScope(); 1377 1309 1378 makeTyVarMap( funcType, scopeTyVars ); 1310 1379 … … 1345 1414 // move all assertions into parameter list 1346 1415 for ( std::list< DeclarationWithType *>::iterator assert = (*tyParm)->get_assertions().begin(); assert != (*tyParm)->get_assertions().end(); ++assert ) { 1416 // *assert = (*assert)->acceptMutator( *this ); 1347 1417 // assertion parameters may not be used in body, pass along with unused attribute. 1348 1418 (*assert)->get_attributes().push_back( new Attribute( "unused" ) ); … … 1380 1450 } 1381 1451 } 1452 1382 1453 seenTypes.insert( typeName ); 1383 1454 } … … 1387 1458 funcType->get_parameters().splice( last, inferredParams ); 1388 1459 addAdapters( funcType ); 1460 mutateAll( funcType->get_returnVals(), *this ); 1461 mutateAll( funcType->get_parameters(), *this ); 1462 1463 scopeTyVars.endScope(); 1464 return funcType; 1389 1465 } 1390 1466 … … 1392 1468 1393 1469 PolyGenericCalculator::PolyGenericCalculator() 1394 : knownLayouts(), knownOffsets(), bufNamer( "_buf" ) {}1470 : knownLayouts(), knownOffsets(), bufNamer( "_buf" ), scopeTyVars( TypeDecl::Data{} ) {} 1395 1471 1396 1472 void PolyGenericCalculator::beginTypeScope( Type *ty ) { … … 1753 1829 1754 1830 template< typename DeclClass > 1755 void Pass3::handleDecl( DeclClass * decl, Type *type ) {1756 GuardScope( scopeTyVars);1831 DeclClass * Pass3::handleDecl( DeclClass *decl, Type *type ) { 1832 scopeTyVars.beginScope(); 1757 1833 makeTyVarMap( type, scopeTyVars ); 1834 1835 DeclClass *ret = static_cast< DeclClass *>( Mutator::mutate( decl ) ); 1836 // ScrubTyVars::scrub( decl, scopeTyVars ); 1758 1837 ScrubTyVars::scrubAll( decl ); 1759 } 1760 1761 void Pass3::premutate( ObjectDecl * objectDecl ) { 1762 handleDecl( objectDecl, objectDecl->type ); 1763 } 1764 1765 void Pass3::premutate( FunctionDecl * functionDecl ) { 1766 handleDecl( functionDecl, functionDecl->type ); 1767 } 1768 1769 void Pass3::premutate( TypedefDecl * typedefDecl ) { 1770 handleDecl( typedefDecl, typedefDecl->base ); 1838 1839 scopeTyVars.endScope(); 1840 return ret; 1841 } 1842 1843 ObjectDecl * Pass3::mutate( ObjectDecl *objectDecl ) { 1844 return handleDecl( objectDecl, objectDecl->get_type() ); 1845 } 1846 1847 DeclarationWithType * Pass3::mutate( FunctionDecl *functionDecl ) { 1848 return handleDecl( functionDecl, functionDecl->get_functionType() ); 1849 } 1850 1851 TypedefDecl * Pass3::mutate( TypedefDecl *typedefDecl ) { 1852 return handleDecl( typedefDecl, typedefDecl->get_base() ); 1771 1853 } 1772 1854 1773 1855 /// Strips the members from a generic aggregate 1774 void stripGenericMembers(AggregateDecl * decl) {1775 if ( ! decl-> parameters.empty() ) decl->members.clear();1776 } 1777 1778 void Pass3::premutate( StructDecl *structDecl ) {1856 void stripGenericMembers(AggregateDecl* decl) { 1857 if ( ! decl->get_parameters().empty() ) decl->get_members().clear(); 1858 } 1859 1860 Declaration *Pass3::mutate( StructDecl *structDecl ) { 1779 1861 stripGenericMembers( structDecl ); 1780 } 1781 1782 void Pass3::premutate( UnionDecl * unionDecl ) { 1862 return structDecl; 1863 } 1864 1865 Declaration *Pass3::mutate( UnionDecl *unionDecl ) { 1783 1866 stripGenericMembers( unionDecl ); 1784 } 1785 1786 void Pass3::premutate( TypeDecl * typeDecl ) { 1867 return unionDecl; 1868 } 1869 1870 TypeDecl * Pass3::mutate( TypeDecl *typeDecl ) { 1871 // Initializer *init = 0; 1872 // std::list< Expression *> designators; 1873 // addToTyVarMap( typeDecl, scopeTyVars ); 1874 // if ( typeDecl->get_base() ) { 1875 // init = new SimpleInit( new SizeofExpr( handleDecl( typeDecl, typeDecl->get_base() ) ), designators ); 1876 // } 1877 // return new ObjectDecl( typeDecl->get_name(), Declaration::Extern, LinkageSpec::C, 0, new BasicType( Type::Qualifiers(), BasicType::UnsignedInt ), init ); 1878 1787 1879 addToTyVarMap( typeDecl, scopeTyVars ); 1788 } 1789 1790 void Pass3::premutate( PointerType * pointerType ) { 1791 GuardScope( scopeTyVars ); 1880 return dynamic_cast<TypeDecl*>( Mutator::mutate( typeDecl ) ); 1881 } 1882 1883 Type * Pass3::mutate( PointerType *pointerType ) { 1884 scopeTyVars.beginScope(); 1792 1885 makeTyVarMap( pointerType, scopeTyVars ); 1793 } 1794 1795 void Pass3::premutate( FunctionType * functionType ) { 1796 GuardScope( scopeTyVars ); 1886 1887 Type *ret = Mutator::mutate( pointerType ); 1888 1889 scopeTyVars.endScope(); 1890 return ret; 1891 } 1892 1893 Type * Pass3::mutate( FunctionType *functionType ) { 1894 scopeTyVars.beginScope(); 1797 1895 makeTyVarMap( functionType, scopeTyVars ); 1896 1897 Type *ret = Mutator::mutate( functionType ); 1898 1899 scopeTyVars.endScope(); 1900 return ret; 1798 1901 } 1799 1902 } // anonymous namespace -
src/GenPoly/FindFunction.cc
r3f7e12cb r78315272 18 18 #include <utility> // for pair 19 19 20 #include "Common/PassVisitor.h" // for PassVisitor21 20 #include "Common/SemanticError.h" // for SemanticError 22 21 #include "GenPoly/ErasableScopedMap.h" // for ErasableScopedMap<>::iterator … … 28 27 29 28 namespace GenPoly { 30 class FindFunction : public WithGuards, public WithVisitorRef<FindFunction>, public WithShortCircuiting{29 class FindFunction : public Mutator { 31 30 public: 32 31 FindFunction( std::list< FunctionType* > &functions, const TyVarMap &tyVars, bool replaceMode, FindFunctionPredicate predicate ); 33 32 34 void premutate( FunctionType * functionType ); 35 Type * postmutate( FunctionType * functionType ); 36 void premutate( PointerType * pointerType ); 33 virtual Type *mutate( FunctionType *functionType ); 34 virtual Type *mutate( PointerType *pointerType ); 37 35 private: 38 36 void handleForall( const Type::ForallList &forall ); … … 45 43 46 44 void findFunction( Type *type, std::list< FunctionType* > &functions, const TyVarMap &tyVars, FindFunctionPredicate predicate ) { 47 PassVisitor<FindFunction>finder( functions, tyVars, false, predicate );45 FindFunction finder( functions, tyVars, false, predicate ); 48 46 type->acceptMutator( finder ); 49 47 } 50 48 51 49 void findAndReplaceFunction( Type *&type, std::list< FunctionType* > &functions, const TyVarMap &tyVars, FindFunctionPredicate predicate ) { 52 PassVisitor<FindFunction>finder( functions, tyVars, true, predicate );50 FindFunction finder( functions, tyVars, true, predicate ); 53 51 type = type->acceptMutator( finder ); 54 52 } … … 59 57 60 58 void FindFunction::handleForall( const Type::ForallList &forall ) { 61 for ( const Declaration * td : forall) {62 TyVarMap::iterator var = tyVars.find( td->name);59 for ( Type::ForallList::const_iterator i = forall.begin(); i != forall.end(); ++i ) { 60 TyVarMap::iterator var = tyVars.find( (*i)->get_name() ); 63 61 if ( var != tyVars.end() ) { 64 62 tyVars.erase( var->first ); … … 67 65 } 68 66 69 void FindFunction::premutate( FunctionType * functionType ) { 70 visit_children = false; 71 GuardScope( tyVars ); 67 Type * FindFunction::mutate( FunctionType *functionType ) { 68 tyVars.beginScope(); 72 69 handleForall( functionType->get_forall() ); 73 mutateAll( functionType->get_returnVals(), *visitor ); 74 } 75 76 Type * FindFunction::postmutate( FunctionType * functionType ) { 70 mutateAll( functionType->get_returnVals(), *this ); 77 71 Type *ret = functionType; 78 72 if ( predicate( functionType, tyVars ) ) { … … 83 77 } // if 84 78 } // if 79 tyVars.endScope(); 85 80 return ret; 86 81 } 87 82 88 void FindFunction::premutate( PointerType *pointerType ) {89 GuardScope( tyVars);83 Type * FindFunction::mutate( PointerType *pointerType ) { 84 tyVars.beginScope(); 90 85 handleForall( pointerType->get_forall() ); 86 Type *ret = Mutator::mutate( pointerType ); 87 tyVars.endScope(); 88 return ret; 91 89 } 92 90 } // namespace GenPoly -
src/GenPoly/GenPoly.cc
r3f7e12cb r78315272 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 box436 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 452 434 void addToTyVarMap( TypeDecl * tyVar, TyVarMap &tyVarMap ) { 453 435 // xxx - should this actually be insert? -
src/GenPoly/GenPoly.h
r3f7e12cb r78315272 80 80 bool typesPolyCompatible( Type *aty, Type *bty ); 81 81 82 /// true if arg requires boxing given exprTyVars83 bool needsBoxing( Type * param, Type * arg, const TyVarMap &exprTyVars, TypeSubstitution * env );84 85 /// true if arg requires boxing in the call to appExpr86 bool needsBoxing( Type * param, Type * arg, ApplicationExpr * appExpr, TypeSubstitution * env );87 88 82 /// Adds the type variable `tyVar` to `tyVarMap` 89 83 void addToTyVarMap( TypeDecl * tyVar, TyVarMap &tyVarMap ); -
src/GenPoly/InstantiateGeneric.cc
r3f7e12cb r78315272 238 238 assertf( false, "Ttype parameters are not currently allowed as parameters to generic types." ); 239 239 break; 240 default:241 assertf( false, " Unhandled type parameter kind" );240 case TypeDecl::Any: 241 assertf( false, "otype parameters handled by baseParam->isComplete()." ); 242 242 break; 243 243 } … … 278 278 substituteMembers( base->get_members(), baseParams, typeSubs ); 279 279 280 // xxx - can't delete type parameters because they may have assertions that are used 281 // deleteAll( baseParams ); 280 deleteAll( baseParams ); 282 281 baseParams.clear(); 283 282 -
src/GenPoly/ScrubTyVars.cc
r3f7e12cb r78315272 40 40 if ( tyVar != tyVars->end() ) { 41 41 switch ( tyVar->second.kind ) { 42 case TypeDecl::Any: 42 43 case TypeDecl::Dtype: 43 44 case TypeDecl::Ttype: -
src/GenPoly/Specialize.cc
r3f7e12cb r78315272 22 22 #include <utility> // for pair 23 23 24 #include "Common/PassVisitor.h"25 24 #include "Common/SemanticError.h" // for SemanticError 26 25 #include "Common/UniqueName.h" // for UniqueName … … 29 28 #include "InitTweak/InitTweak.h" // for isIntrinsicCallExpr 30 29 #include "Parser/LinkageSpec.h" // for C 30 #include "PolyMutator.h" // for PolyMutator 31 31 #include "ResolvExpr/FindOpenVars.h" // for findOpenVars 32 32 #include "ResolvExpr/TypeEnvironment.h" // for OpenVarSet, AssertionSet … … 43 43 44 44 namespace GenPoly { 45 struct Specialize final : public WithTypeSubstitution, public WithStmtsToAdd, public WithVisitorRef<Specialize> { 46 Expression * postmutate( ApplicationExpr *applicationExpr ); 47 Expression * postmutate( CastExpr *castExpr ); 45 class Specialize final : public PolyMutator { 46 public: 47 using PolyMutator::mutate; 48 virtual Expression * mutate( ApplicationExpr *applicationExpr ) override; 49 virtual Expression * mutate( AddressExpr *castExpr ) override; 50 virtual Expression * mutate( CastExpr *castExpr ) override; 51 // virtual Expression * mutate( LogicalExpr *logicalExpr ); 52 // virtual Expression * mutate( ConditionalExpr *conditionalExpr ); 53 // virtual Expression * mutate( CommaExpr *commaExpr ); 48 54 49 55 void handleExplicitParams( ApplicationExpr *appExpr ); 50 56 Expression * createThunkFunction( FunctionType *funType, Expression *actual, InferredParams *inferParams ); 51 Expression * doSpecialization( Type *formalType, Expression *actual, InferredParams *inferParams );57 Expression * doSpecialization( Type *formalType, Expression *actual, InferredParams *inferParams = nullptr ); 52 58 53 59 std::string paramPrefix = "_p"; … … 66 72 if ( ! boundType ) continue; 67 73 if ( TypeInstType *typeInst = dynamic_cast< TypeInstType* >( boundType ) ) { 68 // bound to another type variable69 74 if ( closedVars.find( typeInst->get_name() ) == closedVars.end() ) { 70 // bound to a closed variable => must specialize71 75 return true; 72 76 } // if 73 77 } else { 74 // variable is bound to a concrete type => must specialize75 78 return true; 76 79 } // if 77 80 } // for 78 // none of the type variables are bound79 81 return false; 80 82 } else { 81 // no env82 83 return false; 83 84 } // if … … 135 136 if ( functionParameterSize( fftype ) != functionParameterSize( aftype ) ) return false; 136 137 // tuple-parameter sizes are the same, but actual parameter sizes differ - must tuple specialize 137 if ( fftype-> parameters.size() != aftype->parameters.size() ) return true;138 if ( fftype->get_parameters().size() != aftype->get_parameters().size() ) return true; 138 139 // total parameter size can be the same, while individual parameters can have different structure 139 for ( auto params : group_iterate( fftype-> parameters, aftype->parameters) ) {140 for ( auto params : group_iterate( fftype->get_parameters(), aftype->get_parameters() ) ) { 140 141 DeclarationWithType * formal = std::get<0>(params); 141 142 DeclarationWithType * actual = std::get<1>(params); … … 151 152 152 153 Expression * Specialize::doSpecialization( Type *formalType, Expression *actual, InferredParams *inferParams ) { 153 assertf( actual-> result, "attempting to specialize an untyped expression" );154 assertf( actual->has_result(), "attempting to specialize an untyped expression" ); 154 155 if ( needsSpecialization( formalType, actual->get_result(), env ) ) { 155 156 if ( FunctionType *funType = getFunctionType( formalType ) ) { 156 if ( ApplicationExpr * appExpr = dynamic_cast<ApplicationExpr*>( actual ) ) { 157 ApplicationExpr *appExpr; 158 VariableExpr *varExpr; 159 if ( ( appExpr = dynamic_cast<ApplicationExpr*>( actual ) ) ) { 157 160 return createThunkFunction( funType, appExpr->get_function(), inferParams ); 158 } else if ( VariableExpr * varExpr = dynamic_cast<VariableExpr*>( actual) ) {161 } else if ( ( varExpr = dynamic_cast<VariableExpr*>( actual ) ) ) { 159 162 return createThunkFunction( funType, varExpr, inferParams ); 160 163 } else { … … 201 204 } 202 205 203 struct EnvTrimmer {206 struct EnvTrimmer : public Visitor { 204 207 TypeSubstitution * env, * newEnv; 205 208 EnvTrimmer( TypeSubstitution * env, TypeSubstitution * newEnv ) : env( env ), newEnv( newEnv ){} 206 v oid previsit( TypeDecl * tyDecl ) {209 virtual void visit( TypeDecl * tyDecl ) { 207 210 // transfer known bindings for seen type variables 208 if ( Type * t = env->lookup( tyDecl-> name) ) {209 newEnv->add( tyDecl-> name, t );211 if ( Type * t = env->lookup( tyDecl->get_name() ) ) { 212 newEnv->add( tyDecl->get_name(), t ); 210 213 } 211 214 } … … 216 219 if ( env ) { 217 220 TypeSubstitution * newEnv = new TypeSubstitution(); 218 PassVisitor<EnvTrimmer>trimmer( env, newEnv );221 EnvTrimmer trimmer( env, newEnv ); 219 222 expr->accept( trimmer ); 220 223 return newEnv; … … 274 277 std::string oldParamPrefix = paramPrefix; 275 278 paramPrefix += "p"; 276 // save stmtsToAdd Beforein oldStmts279 // save stmtsToAdd in oldStmts 277 280 std::list< Statement* > oldStmts; 278 oldStmts.splice( oldStmts.end(), stmtsToAdd Before);279 appExpr->acceptMutator( *visitor );281 oldStmts.splice( oldStmts.end(), stmtsToAdd ); 282 mutate( appExpr ); 280 283 paramPrefix = oldParamPrefix; 281 284 // write any statements added for recursive specializations into the thunk body 282 thunkFunc-> statements->kids.splice( thunkFunc->statements->kids.end(), stmtsToAddBefore);283 // restore oldStmts into stmtsToAdd Before284 stmtsToAdd Before.splice( stmtsToAddBefore.end(), oldStmts );285 thunkFunc->get_statements()->get_kids().splice( thunkFunc->get_statements()->get_kids().end(), stmtsToAdd ); 286 // restore oldStmts into stmtsToAdd 287 stmtsToAdd.splice( stmtsToAdd.end(), oldStmts ); 285 288 286 289 // add return (or valueless expression) to the thunk 287 290 Statement *appStmt; 288 if ( funType-> returnVals.empty() ) {291 if ( funType->get_returnVals().empty() ) { 289 292 appStmt = new ExprStmt( noLabels, appExpr ); 290 293 } else { 291 294 appStmt = new ReturnStmt( noLabels, appExpr ); 292 295 } // if 293 thunkFunc-> statements->kids.push_back( appStmt );296 thunkFunc->get_statements()->get_kids().push_back( appStmt ); 294 297 295 298 // add thunk definition to queue of statements to add 296 stmtsToAdd Before.push_back( new DeclStmt( noLabels, thunkFunc ) );299 stmtsToAdd.push_back( new DeclStmt( noLabels, thunkFunc ) ); 297 300 // return address of thunk function as replacement expression 298 301 return new AddressExpr( new VariableExpr( thunkFunc ) ); … … 301 304 void Specialize::handleExplicitParams( ApplicationExpr *appExpr ) { 302 305 // create thunks for the explicit parameters 303 assert( appExpr-> function->result);304 FunctionType *function = getFunctionType( appExpr-> function->result);306 assert( appExpr->get_function()->has_result() ); 307 FunctionType *function = getFunctionType( appExpr->get_function()->get_result() ); 305 308 assert( function ); 306 309 std::list< DeclarationWithType* >::iterator formal; 307 310 std::list< Expression* >::iterator actual; 308 311 for ( formal = function->get_parameters().begin(), actual = appExpr->get_args().begin(); formal != function->get_parameters().end() && actual != appExpr->get_args().end(); ++formal, ++actual ) { 309 *actual = doSpecialization( (*formal)->get_type(), *actual, &appExpr->get_inferParams() ); 310 } 311 } 312 313 Expression * Specialize::postmutate( ApplicationExpr *appExpr ) { 312 *actual = doSpecialization( (*formal )->get_type(), *actual, &appExpr->get_inferParams() ); 313 } 314 } 315 316 Expression * Specialize::mutate( ApplicationExpr *appExpr ) { 317 appExpr->get_function()->acceptMutator( *this ); 318 mutateAll( appExpr->get_args(), *this ); 319 314 320 if ( ! InitTweak::isIntrinsicCallExpr( appExpr ) ) { 315 321 // create thunks for the inferred parameters … … 325 331 } 326 332 327 Expression * Specialize::postmutate( CastExpr *castExpr ) { 328 if ( castExpr->result->isVoid() ) { 333 Expression * Specialize::mutate( AddressExpr *addrExpr ) { 334 addrExpr->get_arg()->acceptMutator( *this ); 335 assert( addrExpr->has_result() ); 336 addrExpr->set_arg( doSpecialization( addrExpr->get_result(), addrExpr->get_arg() ) ); 337 return addrExpr; 338 } 339 340 Expression * Specialize::mutate( CastExpr *castExpr ) { 341 castExpr->get_arg()->acceptMutator( *this ); 342 if ( castExpr->get_result()->isVoid() ) { 329 343 // can't specialize if we don't have a return value 330 344 return castExpr; 331 345 } 332 Expression *specialized = doSpecialization( castExpr-> result, castExpr->arg, &castExpr->inferParams);333 if ( specialized != castExpr-> arg) {346 Expression *specialized = doSpecialization( castExpr->get_result(), castExpr->get_arg() ); 347 if ( specialized != castExpr->get_arg() ) { 334 348 // assume here that the specialization incorporates the cast 335 349 return specialized; … … 339 353 } 340 354 355 // Removing these for now. Richard put these in for some reason, but it's not clear why. 356 // In particular, copy constructors produce a comma expression, and with this code the parts 357 // of that comma expression are not specialized, which causes problems. 358 359 // Expression * Specialize::mutate( LogicalExpr *logicalExpr ) { 360 // return logicalExpr; 361 // } 362 363 // Expression * Specialize::mutate( ConditionalExpr *condExpr ) { 364 // return condExpr; 365 // } 366 367 // Expression * Specialize::mutate( CommaExpr *commaExpr ) { 368 // return commaExpr; 369 // } 370 341 371 void convertSpecializations( std::list< Declaration* >& translationUnit ) { 342 PassVisitor<Specialize>spec;372 Specialize spec; 343 373 mutateAll( translationUnit, spec ); 344 374 } -
src/GenPoly/module.mk
r3f7e12cb r78315272 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 \ 19 20 GenPoly/ScrubTyVars.cc \ 20 21 GenPoly/Lvalue.cc \ 21 22 GenPoly/Specialize.cc \ 23 GenPoly/CopyParams.cc \ 22 24 GenPoly/FindFunction.cc \ 25 GenPoly/DeclMutator.cc \ 23 26 GenPoly/InstantiateGeneric.cc -
src/InitTweak/FixInit.cc
r3f7e12cb r78315272 36 36 #include "FixGlobalInit.h" // for fixGlobalInit 37 37 #include "GenInit.h" // for genCtorDtor 38 #include "GenPoly/DeclMutator.h" // for DeclMutator 38 39 #include "GenPoly/GenPoly.h" // for getFunctionType 40 #include "GenPoly/PolyMutator.h" // for PolyMutator 39 41 #include "InitTweak.h" // for getFunctionName, getCallArg 40 42 #include "Parser/LinkageSpec.h" // for C, Spec, Cforall, isBuiltin … … 44 46 #include "SymTab/Indexer.h" // for Indexer 45 47 #include "SymTab/Mangler.h" // for Mangler 48 #include "SynTree/AddStmtVisitor.h" // for AddStmtVisitor 46 49 #include "SynTree/Attribute.h" // for Attribute 47 50 #include "SynTree/Constant.h" // for Constant … … 55 58 #include "SynTree/TypeSubstitution.h" // for TypeSubstitution, operator<< 56 59 #include "SynTree/Visitor.h" // for acceptAll, maybeAccept 60 #include "Tuples/Tuples.h" // for isTtype 57 61 58 62 bool ctordtorp = false; // print all debug … … 93 97 /// true if type does not need to be copy constructed to ensure correctness 94 98 bool skipCopyConstruct( Type * type ); 95 void copyConstructArg( Expression *& arg, ImplicitCopyCtorExpr * impCpCtorExpr , Type * formal);99 void copyConstructArg( Expression *& arg, ImplicitCopyCtorExpr * impCpCtorExpr ); 96 100 void destructRet( ObjectDecl * ret, ImplicitCopyCtorExpr * impCpCtorExpr ); 97 101 … … 183 187 }; 184 188 185 class FixCopyCtors final : public WithStmtsToAdd, public WithShortCircuiting, public WithVisitorRef<FixCopyCtors>{189 class FixCopyCtors final : public GenPoly::PolyMutator { 186 190 public: 187 191 FixCopyCtors( UnqCount & unqCount ) : unqCount( unqCount ){} … … 190 194 static void fixCopyCtors( std::list< Declaration * > &translationUnit, UnqCount & unqCount ); 191 195 192 Expression * postmutate( ImplicitCopyCtorExpr * impCpCtorExpr ); 193 void premutate( StmtExpr * stmtExpr ); 194 void premutate( UniqueExpr * unqExpr ); 196 typedef GenPoly::PolyMutator Parent; 197 using Parent::mutate; 198 virtual Expression * mutate( ImplicitCopyCtorExpr * impCpCtorExpr ) override; 199 virtual Expression * mutate( UniqueExpr * unqExpr ) override; 200 virtual Expression * mutate( StmtExpr * stmtExpr ) override; 195 201 196 202 UnqCount & unqCount; … … 214 220 void emit( CodeLocation, const Params &... params ); 215 221 216 FunctionDecl * function = nullptr;222 FunctionDecl * function = 0; 217 223 std::set< DeclarationWithType * > unhandled; 218 224 std::map< DeclarationWithType *, CodeLocation > usedUninit; 219 ObjectDecl * thisParam = nullptr;225 ObjectDecl * thisParam = 0; 220 226 bool isCtor = false; // true if current function is a constructor 221 StructDecl * structDecl = nullptr;227 StructDecl * structDecl = 0; 222 228 }; 223 229 … … 237 243 }; 238 244 239 struct FixCtorExprs final : public WithDeclsToAdd, public WithIndexer { 245 class FixCtorExprs final : public GenPoly::DeclMutator { 246 public: 240 247 /// expands ConstructorExpr nodes into comma expressions, using a temporary for the first argument 241 248 static void fix( std::list< Declaration * > & translationUnit ); 242 249 243 Expression * postmutate( ConstructorExpr * ctorExpr ); 250 using GenPoly::DeclMutator::mutate; 251 virtual Expression * mutate( ConstructorExpr * ctorExpr ) override; 244 252 }; 245 253 } // namespace … … 260 268 261 269 GenStructMemberCalls::generate( translationUnit ); 262 263 270 // xxx - ctor expansion currently has to be after FixCopyCtors, because there is currently a 264 271 // hack in the way untyped assignments are generated, where the first argument cannot have … … 290 297 for ( std::list< Declaration * >::iterator i = translationUnit.begin(); i != translationUnit.end(); ++i ) { 291 298 try { 292 maybeMutate( *i, fixer );299 *i = maybeMutate( *i, fixer ); 293 300 translationUnit.splice( i, fixer.pass.staticDtorDecls ); 294 301 } catch( SemanticError &e ) { … … 309 316 310 317 void FixCopyCtors::fixCopyCtors( std::list< Declaration * > & translationUnit, UnqCount & unqCount ) { 311 PassVisitor<FixCopyCtors>fixer( unqCount );318 FixCopyCtors fixer( unqCount ); 312 319 mutateAll( translationUnit, fixer ); 313 320 } … … 319 326 320 327 void FixCtorExprs::fix( std::list< Declaration * > & translationUnit ) { 321 PassVisitor<FixCtorExprs>fixer;322 mutateAll( translationUnit, fixer);328 FixCtorExprs fixer; 329 fixer.mutateDeclarationList( translationUnit ); 323 330 } 324 331 325 332 Expression * InsertImplicitCalls::postmutate( ApplicationExpr * appExpr ) { 333 assert( appExpr ); 334 326 335 if ( VariableExpr * function = dynamic_cast< VariableExpr * > ( appExpr->get_function() ) ) { 327 if ( function->var->linkage.is_builtin) {336 if ( LinkageSpec::isBuiltin( function->get_var()->get_linkage() ) ) { 328 337 // optimization: don't need to copy construct in order to call intrinsic functions 329 338 return appExpr; 330 339 } else if ( DeclarationWithType * funcDecl = dynamic_cast< DeclarationWithType * > ( function->get_var() ) ) { 331 340 FunctionType * ftype = dynamic_cast< FunctionType * >( GenPoly::getFunctionType( funcDecl->get_type() ) ); 332 assert f( ftype, "Function call without function type: %s", toString( funcDecl ).c_str());333 if ( CodeGen::isConstructor( funcDecl->get_name() ) && ftype-> parameters.size() == 2 ) {334 Type * t1 = getPointerBase( ftype-> parameters.front()->get_type() );335 Type * t2 = ftype-> parameters.back()->get_type();341 assert( ftype ); 342 if ( CodeGen::isConstructor( funcDecl->get_name() ) && ftype->get_parameters().size() == 2 ) { 343 Type * t1 = getPointerBase( ftype->get_parameters().front()->get_type() ); 344 Type * t2 = ftype->get_parameters().back()->get_type(); 336 345 assert( t1 ); 337 346 … … 359 368 } 360 369 361 bool ResolveCopyCtors::skipCopyConstruct( Type * type ) { return ! isConstructable( type ); } 370 bool ResolveCopyCtors::skipCopyConstruct( Type * type ) { 371 return dynamic_cast< VarArgsType * >( type ) || dynamic_cast< ReferenceType * >( type ) || GenPoly::getFunctionType( type ) || Tuples::isTtype( type ); 372 } 362 373 363 374 Expression * ResolveCopyCtors::makeCtorDtor( const std::string & fname, ObjectDecl * var, Expression * cpArg ) { … … 366 377 ImplicitCtorDtorStmt * stmt = genCtorDtor( fname, var, cpArg ); 367 378 ExprStmt * exprStmt = strict_dynamic_cast< ExprStmt * >( stmt->get_callStmt() ); 368 Expression * resolved = exprStmt->expr; 369 exprStmt->expr = nullptr; // take ownership of expr 379 Expression * untyped = exprStmt->get_expr(); 370 380 371 381 // resolve copy constructor 372 382 // should only be one alternative for copy ctor and dtor expressions, since all arguments are fixed 373 383 // (VariableExpr and already resolved expression) 374 CP_CTOR_PRINT( std::cerr << "ResolvingCtorDtor " << resolved << std::endl; )375 ResolvExpr::findVoidExpression( resolved, indexer );384 CP_CTOR_PRINT( std::cerr << "ResolvingCtorDtor " << untyped << std::endl; ) 385 Expression * resolved = ResolvExpr::findVoidExpression( untyped, indexer ); 376 386 assert( resolved ); 377 387 if ( resolved->get_env() ) { … … 381 391 resolved->set_env( nullptr ); 382 392 } // if 393 383 394 delete stmt; 384 395 return resolved; 385 396 } 386 397 387 void ResolveCopyCtors::copyConstructArg( Expression *& arg, ImplicitCopyCtorExpr * impCpCtorExpr , Type * formal) {398 void ResolveCopyCtors::copyConstructArg( Expression *& arg, ImplicitCopyCtorExpr * impCpCtorExpr ) { 388 399 static UniqueName tempNamer("_tmp_cp"); 389 400 assert( env ); 390 401 CP_CTOR_PRINT( std::cerr << "Type Substitution: " << *env << std::endl; ) 391 assert( arg-> result);392 Type * result = arg-> result;402 assert( arg->has_result() ); 403 Type * result = arg->get_result(); 393 404 if ( skipCopyConstruct( result ) ) return; // skip certain non-copyable types 394 405 395 // type may involve type variables, so apply type substitution to get temporary variable's actual type. 396 // Use applyFree so that types bound in function pointers are not substituted, e.g. in forall(dtype T) void (*)(T). 406 // type may involve type variables, so apply type substitution to get temporary variable's actual type 397 407 result = result->clone(); 398 env->apply Free( result );399 ObjectDecl * tmp = ObjectDecl::newObject( "__tmp", result, nullptr);408 env->apply( result ); 409 ObjectDecl * tmp = new ObjectDecl( tempNamer.newName(), Type::StorageClasses(), LinkageSpec::C, 0, result, 0 ); 400 410 tmp->get_type()->set_const( false ); 401 411 … … 407 417 // if the chosen constructor is intrinsic, the copy is unnecessary, so 408 418 // don't create the temporary and don't call the copy constructor 409 VariableExpr * function = strict_dynamic_cast< VariableExpr * >( appExpr->function ); 410 if ( function->var->linkage == LinkageSpec::Intrinsic ) { 411 // arguments that need to be boxed need a temporary regardless of whether the copy constructor is intrinsic, 412 // so that the object isn't changed inside of the polymorphic function 413 if ( ! GenPoly::needsBoxing( formal, result, impCpCtorExpr->callExpr, env ) ) return; 414 } 415 } 416 417 // set a unique name for the temporary once it's certain the call is necessary 418 tmp->name = tempNamer.newName(); 419 VariableExpr * function = dynamic_cast< VariableExpr * >( appExpr->get_function() ); 420 assert( function ); 421 if ( function->get_var()->get_linkage() == LinkageSpec::Intrinsic ) return; 422 } 419 423 420 424 // replace argument to function call with temporary 421 425 arg = new CommaExpr( cpCtor, new VariableExpr( tmp ) ); 422 impCpCtorExpr-> tempDecls.push_back( tmp );423 impCpCtorExpr-> dtors.push_front( makeCtorDtor( "^?{}", tmp ) );426 impCpCtorExpr->get_tempDecls().push_back( tmp ); 427 impCpCtorExpr->get_dtors().push_front( makeCtorDtor( "^?{}", tmp ) ); 424 428 } 425 429 … … 431 435 CP_CTOR_PRINT( std::cerr << "ResolveCopyCtors: " << impCpCtorExpr << std::endl; ) 432 436 433 ApplicationExpr * appExpr = impCpCtorExpr-> callExpr;437 ApplicationExpr * appExpr = impCpCtorExpr->get_callExpr(); 434 438 435 439 // take each argument and attempt to copy construct it. 436 FunctionType * ftype = GenPoly::getFunctionType( appExpr->function->result ); 437 assert( ftype ); 438 auto & params = ftype->parameters; 439 auto iter = params.begin(); 440 for ( Expression * & arg : appExpr->args ) { 441 Type * formal = nullptr; 442 if ( iter != params.end() ) { 443 DeclarationWithType * param = *iter++; 444 formal = param->get_type(); 445 } 446 447 copyConstructArg( arg, impCpCtorExpr, formal ); 440 for ( Expression * & arg : appExpr->get_args() ) { 441 copyConstructArg( arg, impCpCtorExpr ); 448 442 } // for 449 443 … … 451 445 // initialized with the return value and is destructed later 452 446 // xxx - handle named return values? 453 Type * result = appExpr-> result;447 Type * result = appExpr->get_result(); 454 448 if ( ! result->isVoid() ) { 455 449 static UniqueName retNamer("_tmp_cp_ret"); 456 450 result = result->clone(); 457 451 env->apply( result ); 458 ObjectDecl * ret = ObjectDecl::newObject( retNamer.newName(), result, nullptr);459 ret-> type->set_const( false );460 impCpCtorExpr-> returnDecls.push_back( ret );452 ObjectDecl * ret = new ObjectDecl( retNamer.newName(), Type::StorageClasses(), LinkageSpec::C, 0, result, 0 ); 453 ret->get_type()->set_const( false ); 454 impCpCtorExpr->get_returnDecls().push_back( ret ); 461 455 CP_CTOR_PRINT( std::cerr << "makeCtorDtor for a return" << std::endl; ) 462 456 if ( ! dynamic_cast< ReferenceType * >( result ) ) { 463 // destructing reference returns is bad because it can cause multiple destructor calls to the same object - the returned object is not a temporary457 // destructing lvalue returns is bad because it can cause multiple destructor calls to the same object - the returned object is not a temporary 464 458 destructRet( ret, impCpCtorExpr ); 465 459 } … … 478 472 result = result->clone(); 479 473 env->apply( result ); 480 ObjectDecl * ret = ObjectDecl::newObject( retNamer.newName(), result, nullptr);474 ObjectDecl * ret = new ObjectDecl( retNamer.newName(), Type::StorageClasses(), LinkageSpec::C, 0, result, 0 ); 481 475 ret->get_type()->set_const( false ); 482 476 stmtExpr->get_returnDecls().push_front( ret ); … … 499 493 visit_children = false; 500 494 } 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 empty508 if ( inst->baseStruct->members.empty() ) return new ListInit({});509 } else if ( UnionInstType * inst = dynamic_cast< UnionInstType * >( t ) ) {510 // initizer for empty union must be empty511 if ( inst->baseUnion->members.empty() ) return new ListInit({});512 }513 514 return new ListInit( { new SingleInit( new ConstantExpr( Constant::from_int( 0 ) ) ) } );515 495 } 516 496 … … 529 509 } else { 530 510 // expr isn't a call expr, so create a new temporary variable to use to hold the value of the unique expression 531 unqExpr->set_object( ObjectDecl::newObject( toString("_unq", unqExpr->get_id()), unqExpr->get_result()->clone(), makeInit( unqExpr->get_result() )) );511 unqExpr->set_object( new ObjectDecl( toString("_unq", unqExpr->get_id()), Type::StorageClasses(), LinkageSpec::C, nullptr, unqExpr->get_result()->clone(), nullptr ) ); 532 512 unqExpr->set_var( new VariableExpr( unqExpr->get_object() ) ); 533 513 } … … 535 515 } 536 516 537 Expression * FixCopyCtors:: postmutate( ImplicitCopyCtorExpr * impCpCtorExpr ) {517 Expression * FixCopyCtors::mutate( ImplicitCopyCtorExpr * impCpCtorExpr ) { 538 518 CP_CTOR_PRINT( std::cerr << "FixCopyCtors: " << impCpCtorExpr << std::endl; ) 539 519 520 impCpCtorExpr = strict_dynamic_cast< ImplicitCopyCtorExpr * >( Parent::mutate( impCpCtorExpr ) ); 540 521 std::list< ObjectDecl * > & tempDecls = impCpCtorExpr->get_tempDecls(); 541 522 std::list< ObjectDecl * > & returnDecls = impCpCtorExpr->get_returnDecls(); … … 544 525 // add all temporary declarations and their constructors 545 526 for ( ObjectDecl * obj : tempDecls ) { 546 stmtsToAdd Before.push_back( new DeclStmt( noLabels, obj ) );527 stmtsToAdd.push_back( new DeclStmt( noLabels, obj ) ); 547 528 } // for 548 529 for ( ObjectDecl * obj : returnDecls ) { 549 stmtsToAdd Before.push_back( new DeclStmt( noLabels, obj ) );530 stmtsToAdd.push_back( new DeclStmt( noLabels, obj ) ); 550 531 } // for 551 532 … … 555 536 } // for 556 537 538 // xxx - update to work with multiple return values 557 539 ObjectDecl * returnDecl = returnDecls.empty() ? nullptr : returnDecls.front(); 558 540 Expression * callExpr = impCpCtorExpr->get_callExpr(); … … 579 561 Expression * retExpr = new CommaExpr( assign, new VariableExpr( returnDecl ) ); 580 562 // move env from callExpr to retExpr 581 std::swap( retExpr->env, callExpr->env ); 563 retExpr->set_env( callExpr->get_env() ); 564 callExpr->set_env( nullptr ); 582 565 return retExpr; 583 566 } else { … … 586 569 } 587 570 588 void FixCopyCtors::premutate( StmtExpr * stmtExpr ) {571 Expression * FixCopyCtors::mutate( StmtExpr * stmtExpr ) { 589 572 // function call temporaries should be placed at statement-level, rather than nested inside of a new statement expression, 590 573 // since temporaries can be shared across sub-expressions, e.g. 591 574 // [A, A] f(); 592 575 // g([A] x, [A] y); 593 // g(f());576 // f(g()); 594 577 // 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 added596 // to the outer context, rather than inside of the statement expression.597 visit_children = false;598 578 std::list< Statement * > & stmts = stmtExpr->get_statements()->get_kids(); 599 579 for ( Statement *& stmt : stmts ) { 600 stmt = stmt->acceptMutator( * visitor);580 stmt = stmt->acceptMutator( *this ); 601 581 } // for 582 // stmtExpr = strict_dynamic_cast< StmtExpr * >( Parent::mutate( stmtExpr ) ); 602 583 assert( stmtExpr->get_result() ); 603 584 Type * result = stmtExpr->get_result(); 604 585 if ( ! result->isVoid() ) { 605 586 for ( ObjectDecl * obj : stmtExpr->get_returnDecls() ) { 606 stmtsToAdd Before.push_back( new DeclStmt( noLabels, obj ) );587 stmtsToAdd.push_back( new DeclStmt( noLabels, obj ) ); 607 588 } // for 608 589 // add destructors after current statement … … 611 592 } // for 612 593 // must have a non-empty body, otherwise it wouldn't have a result 613 assert( ! stmts.empty() ); 594 CompoundStmt * body = stmtExpr->get_statements(); 595 assert( ! body->get_kids().empty() ); 614 596 assert( ! stmtExpr->get_returnDecls().empty() ); 615 stmts.push_back( new ExprStmt( noLabels, new VariableExpr( stmtExpr->get_returnDecls().front() ) ) );597 body->get_kids().push_back( new ExprStmt( noLabels, new VariableExpr( stmtExpr->get_returnDecls().front() ) ) ); 616 598 stmtExpr->get_returnDecls().clear(); 617 599 stmtExpr->get_dtors().clear(); … … 619 601 assert( stmtExpr->get_returnDecls().empty() ); 620 602 assert( stmtExpr->get_dtors().empty() ); 621 }622 623 void FixCopyCtors::premutate( UniqueExpr * unqExpr ) { 624 visit_children = false;603 return stmtExpr; 604 } 605 606 Expression * FixCopyCtors::mutate( UniqueExpr * unqExpr ) { 625 607 unqCount[ unqExpr->get_id() ]--; 626 608 static std::unordered_map< int, std::list< Statement * > > dtors; 627 609 static std::unordered_map< int, UniqueExpr * > unqMap; 610 static std::unordered_set< int > addDeref; 628 611 // has to be done to clean up ImplicitCopyCtorExpr nodes, even when this node was skipped in previous passes 629 612 if ( unqMap.count( unqExpr->get_id() ) ) { … … 636 619 stmtsToAddAfter.splice( stmtsToAddAfter.end(), dtors[ unqExpr->get_id() ] ); 637 620 } 638 return; 639 } 640 PassVisitor<FixCopyCtors> fixer( unqCount ); 621 if ( addDeref.count( unqExpr->get_id() ) ) { 622 // other UniqueExpr was dereferenced because it was an lvalue return, so this one should be too 623 return UntypedExpr::createDeref( unqExpr ); 624 } 625 return unqExpr; 626 } 627 FixCopyCtors fixer( unqCount ); 641 628 unqExpr->set_expr( unqExpr->get_expr()->acceptMutator( fixer ) ); // stmtexprs contained should not be separately fixed, so this must occur after the lookup 642 stmtsToAdd Before.splice( stmtsToAddBefore.end(), fixer.pass.stmtsToAddBefore);629 stmtsToAdd.splice( stmtsToAdd.end(), fixer.stmtsToAdd ); 643 630 unqMap[unqExpr->get_id()] = unqExpr; 644 631 if ( unqCount[ unqExpr->get_id() ] == 0 ) { // insert destructor after the last use of the unique expression 645 632 stmtsToAddAfter.splice( stmtsToAddAfter.end(), dtors[ unqExpr->get_id() ] ); 646 633 } else { // remember dtors for last instance of unique expr 647 dtors[ unqExpr->get_id() ] = fixer.pass.stmtsToAddAfter; 648 } 649 return; 650 } 651 652 DeclarationWithType * FixInit::postmutate( ObjectDecl *objDecl ) { 634 dtors[ unqExpr->get_id() ] = fixer.stmtsToAddAfter; 635 } 636 if ( UntypedExpr * deref = dynamic_cast< UntypedExpr * >( unqExpr->get_expr() ) ) { 637 // unique expression is now a dereference, because the inner expression is an lvalue returning function call. 638 // Normalize the expression by dereferencing the unique expression, rather than the inner expression 639 // (i.e. move the dereference out a level) 640 assert( getFunctionName( deref ) == "*?" ); 641 unqExpr->set_expr( getCallArg( deref, 0 ) ); 642 getCallArg( deref, 0 ) = unqExpr; 643 addDeref.insert( unqExpr->get_id() ); 644 return deref; 645 } 646 return unqExpr; 647 } 648 649 DeclarationWithType *FixInit::postmutate( ObjectDecl *objDecl ) { 653 650 // since this removes the init field from objDecl, it must occur after children are mutated (i.e. postmutate) 654 651 if ( ConstructorInit * ctorInit = dynamic_cast< ConstructorInit * >( objDecl->get_init() ) ) { … … 748 745 } else { 749 746 ImplicitCtorDtorStmt * implicit = strict_dynamic_cast< ImplicitCtorDtorStmt * > ( ctor ); 750 ExprStmt * ctorStmt = dynamic_cast< ExprStmt * >( implicit-> callStmt);747 ExprStmt * ctorStmt = dynamic_cast< ExprStmt * >( implicit->get_callStmt() ); 751 748 ApplicationExpr * ctorCall = nullptr; 752 if ( ctorStmt && (ctorCall = isIntrinsicCallExpr( ctorStmt-> expr)) && ctorCall->get_args().size() == 2 ) {749 if ( ctorStmt && (ctorCall = isIntrinsicCallExpr( ctorStmt->get_expr() )) && ctorCall->get_args().size() == 2 ) { 753 750 // clean up intrinsic copy constructor calls by making them into SingleInits 754 Expression * ctorArg = ctorCall->args.back(); 755 std::swap( ctorArg->env, ctorCall->env ); 756 objDecl->init = new SingleInit( ctorArg ); 757 758 ctorCall->args.pop_back(); 751 objDecl->set_init( new SingleInit( ctorCall->get_args().back() ) ); 752 ctorCall->get_args().pop_back(); 759 753 } else { 760 754 stmtsToAddAfter.push_back( ctor ); 761 objDecl-> init = nullptr;762 ctorInit-> ctor = nullptr;755 objDecl->set_init( nullptr ); 756 ctorInit->set_ctor( nullptr ); 763 757 } 764 758 } // if 765 } else if ( Initializer * init = ctorInit-> init) {766 objDecl-> init = init;767 ctorInit-> init = nullptr;759 } else if ( Initializer * init = ctorInit->get_init() ) { 760 objDecl->set_init( init ); 761 ctorInit->set_init( nullptr ); 768 762 } else { 769 763 // no constructor and no initializer, which is okay 770 objDecl-> init = nullptr;764 objDecl->set_init( nullptr ); 771 765 } // if 772 766 delete ctorInit; … … 825 819 assert( ! ctorInit->get_ctor() || ! ctorInit->get_init() ); 826 820 Statement * dtor = ctorInit->get_dtor(); 827 // don't need to call intrinsic dtor, because it does nothing, but828 // non-intrinsic dtors must be called829 821 if ( dtor && ! isIntrinsicSingleArgCallStmt( dtor ) ) { 830 // set dtor location to the object's location for error messages831 ctorInit->dtor->location = objDecl->location;822 // don't need to call intrinsic dtor, because it does nothing, but 823 // non-intrinsic dtors must be called 832 824 reverseDeclOrder.front().push_front( objDecl ); 833 825 } // if … … 840 832 GuardValue( labelVars ); 841 833 labelVars.clear(); 842 // LabelFinder does not recurse into FunctionDecl, so need to visit843 // its children manually.844 834 maybeAccept( funcDecl->type, finder ); 845 835 maybeAccept( funcDecl->statements, finder ); … … 943 933 } 944 934 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 958 935 void GenStructMemberCalls::previsit( FunctionDecl * funcDecl ) { 959 GuardValue( func tion);936 GuardValue( funcDecl ); 960 937 GuardValue( unhandled ); 961 938 GuardValue( usedUninit ); … … 990 967 } 991 968 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 992 982 void GenStructMemberCalls::postvisit( FunctionDecl * funcDecl ) { 993 983 // remove the unhandled objects from usedUninit, because a call is inserted … … 1022 1012 // skip non-DWT members 1023 1013 if ( ! field ) continue; 1024 // skip non-constructable members1025 if ( ! tryConstruct( field ) ) continue;1026 1014 // skip handled members 1027 1015 if ( ! unhandled.count( field ) ) continue; … … 1142 1130 } 1143 1131 1144 DeclarationWithType * MutatingResolver::mutate( ObjectDecl * objectDecl ) {1132 DeclarationWithType * MutatingResolver::mutate( ObjectDecl *objectDecl ) { 1145 1133 // add object to the indexer assumes that there will be no name collisions 1146 1134 // in generated code. If this changes, add mutate methods for entities with … … 1150 1138 } 1151 1139 1152 Expression * MutatingResolver::mutate( UntypedExpr * untypedExpr ) { 1153 Expression * newExpr = untypedExpr; 1154 ResolvExpr::findVoidExpression( newExpr, indexer ); 1155 return newExpr; 1156 } 1157 1158 Expression * FixCtorExprs::postmutate( ConstructorExpr * ctorExpr ) { 1140 Expression* MutatingResolver::mutate( UntypedExpr *untypedExpr ) { 1141 return strict_dynamic_cast< ApplicationExpr * >( ResolvExpr::findVoidExpression( untypedExpr, indexer ) ); 1142 } 1143 1144 Expression * FixCtorExprs::mutate( ConstructorExpr * ctorExpr ) { 1159 1145 static UniqueName tempNamer( "_tmp_ctor_expr" ); 1160 1146 // xxx - is the size check necessary? 1161 assert( ctorExpr-> result&& ctorExpr->get_result()->size() == 1 );1147 assert( ctorExpr->has_result() && ctorExpr->get_result()->size() == 1 ); 1162 1148 1163 1149 // xxx - ideally we would reuse the temporary generated from the copy constructor passes from within firstArg if it exists and not generate a temporary if it's unnecessary. 1164 ObjectDecl * tmp = ObjectDecl::newObject( tempNamer.newName(), ctorExpr->get_result()->clone(), nullptr );1165 declsToAddBefore.push_back( tmp );1150 ObjectDecl * tmp = new ObjectDecl( tempNamer.newName(), Type::StorageClasses(), LinkageSpec::C, nullptr, ctorExpr->get_result()->clone(), nullptr ); 1151 addDeclaration( tmp ); 1166 1152 1167 1153 // xxx - this can be TupleAssignExpr now. Need to properly handle this case. … … 1172 1158 delete ctorExpr; 1173 1159 1174 // build assignment and replace constructor's first argument with new temporary1175 1160 Expression *& firstArg = callExpr->get_args().front(); 1176 Expression * assign = new UntypedExpr( new NameExpr( "?=?" ), { new AddressExpr( new VariableExpr( tmp ) ), new AddressExpr( firstArg ) } ); 1161 1162 // xxx - hack in 'fake' assignment operator until resolver can easily be called in this pass. Once the resolver can be used in PassVisitor, this hack goes away. 1163 1164 // generate the type of assignment operator using the type of tmp minus any reference types 1165 Type * type = tmp->get_type()->stripReferences(); 1166 FunctionType * ftype = SymTab::genAssignType( type ); 1167 1168 // generate fake assignment decl and call it using &tmp and &firstArg 1169 // since tmp is guaranteed to be a reference and we want to assign pointers 1170 FunctionDecl * assignDecl = new FunctionDecl( "?=?", Type::StorageClasses(), LinkageSpec::Intrinsic, ftype, nullptr ); 1171 ApplicationExpr * assign = new ApplicationExpr( VariableExpr::functionPointer( assignDecl ) ); 1172 assign->get_args().push_back( new AddressExpr( new VariableExpr( tmp ) ) ); 1173 Expression * addrArg = new AddressExpr( firstArg ); 1174 // if firstArg has type T&&, then &firstArg has type T*&. 1175 // Cast away the reference to a value type so that the argument 1176 // matches the assignment's parameter types 1177 if ( dynamic_cast<ReferenceType *>( addrArg->get_result() ) ) { 1178 addrArg = new CastExpr( addrArg, addrArg->get_result()->stripReferences()->clone() ); 1179 } 1180 assign->get_args().push_back( addrArg ); 1177 1181 firstArg = new VariableExpr( tmp ); 1178 1179 // resolve assignment and dispose of new env1180 ResolvExpr::findVoidExpression( assign, indexer );1181 delete assign->env;1182 assign->env = nullptr;1183 1182 1184 1183 // for constructor expr: -
src/InitTweak/GenInit.cc
r3f7e12cb r78315272 26 26 #include "Common/UniqueName.h" // for UniqueName 27 27 #include "Common/utility.h" // for ValueGuard, maybeClone 28 #include "GenPoly/DeclMutator.h" // for DeclMutator 28 29 #include "GenPoly/GenPoly.h" // for getFunctionType, isPolyType 29 30 #include "GenPoly/ScopedSet.h" // for ScopedSet, ScopedSet<>::const_iter... … … 61 62 }; 62 63 63 struct CtorDtor : public WithGuards, public WithShortCircuiting , public WithVisitorRef<CtorDtor>{64 struct CtorDtor : public WithGuards, public WithShortCircuiting { 64 65 /// create constructor and destructor statements for object declarations. 65 66 /// the actual call statements will be added in after the resolver has run … … 74 75 // that need to be constructed or destructed 75 76 void previsit( StructDecl *aggregateDecl ); 76 void previsit( AggregateDecl * ) { visit_children = false; } 77 void previsit( NamedTypeDecl * ) { visit_children = false; } 78 void previsit( FunctionType * ) { visit_children = false; } 77 void previsit( __attribute__((unused)) UnionDecl * aggregateDecl ) { visit_children = false; } 78 void previsit( __attribute__((unused)) EnumDecl * aggregateDecl ) { visit_children = false; } 79 void previsit( __attribute__((unused)) TraitDecl * aggregateDecl ) { visit_children = false; } 80 void previsit( __attribute__((unused)) TypeDecl * typeDecl ) { visit_children = false; } 81 void previsit( __attribute__((unused)) TypedefDecl * typeDecl ) { visit_children = false; } 82 void previsit( __attribute__((unused)) FunctionType * funcType ) { visit_children = false; } 79 83 80 84 void previsit( CompoundStmt * compoundStmt ); … … 85 89 // should not have a ConstructorInit generated. 86 90 87 ManagedTypes managedTypes; 91 bool isManaged( ObjectDecl * objDecl ) const ; // determine if object is managed 92 bool isManaged( Type * type ) const; // determine if type is managed 93 void handleDWT( DeclarationWithType * dwt ); // add type to managed if ctor/dtor 94 GenPoly::ScopedSet< std::string > managedTypes; 88 95 bool inFunction = false; 89 96 }; 90 97 91 struct HoistArrayDimension final : public WithDeclsToAdd, public WithShortCircuiting, public WithGuards { 98 class HoistArrayDimension final : public GenPoly::DeclMutator { 99 public: 100 typedef GenPoly::DeclMutator Parent; 101 92 102 /// hoist dimension from array types in object declaration so that it uses a single 93 103 /// const variable of type size_t, so that side effecting array dimensions are only … … 95 105 static void hoistArrayDimension( std::list< Declaration * > & translationUnit ); 96 106 97 void premutate( ObjectDecl * objectDecl ); 98 DeclarationWithType * postmutate( ObjectDecl * objectDecl ); 99 void premutate( FunctionDecl *functionDecl ); 107 private: 108 using Parent::mutate; 109 110 virtual DeclarationWithType * mutate( ObjectDecl * objectDecl ) override; 111 virtual DeclarationWithType * mutate( FunctionDecl *functionDecl ) override; 100 112 // should not traverse into any of these declarations to find objects 101 113 // that need to be constructed or destructed 102 void premutate( AggregateDecl * ) { visit_children = false; } 103 void premutate( NamedTypeDecl * ) { visit_children = false; } 104 void premutate( FunctionType * ) { visit_children = false; } 114 virtual Declaration* mutate( StructDecl *aggregateDecl ) override { return aggregateDecl; } 115 virtual Declaration* mutate( UnionDecl *aggregateDecl ) override { return aggregateDecl; } 116 virtual Declaration* mutate( EnumDecl *aggregateDecl ) override { return aggregateDecl; } 117 virtual Declaration* mutate( TraitDecl *aggregateDecl ) override { return aggregateDecl; } 118 virtual TypeDecl* mutate( TypeDecl *typeDecl ) override { return typeDecl; } 119 virtual Declaration* mutate( TypedefDecl *typeDecl ) override { return typeDecl; } 120 121 virtual Type* mutate( FunctionType *funcType ) override { return funcType; } 105 122 106 123 void hoist( Type * type ); … … 111 128 112 129 void genInit( std::list< Declaration * > & translationUnit ) { 113 fixReturnStatements( translationUnit );130 ReturnFixer::makeReturnTemp( translationUnit ); 114 131 HoistArrayDimension::hoistArrayDimension( translationUnit ); 115 132 CtorDtor::generateCtorDtor( translationUnit ); 116 133 } 117 134 118 void fixReturnStatements( std::list< Declaration * > & translationUnit ) {135 void ReturnFixer::makeReturnTemp( std::list< Declaration * > & translationUnit ) { 119 136 PassVisitor<ReturnFixer> fixer; 120 137 mutateAll( translationUnit, fixer ); … … 126 143 // hands off if the function returns a reference - we don't want to allocate a temporary if a variable's address 127 144 // is being returned 128 if ( returnStmt-> expr && returnVals.size() == 1 && isConstructable( returnVals.front()->get_type() ) ) {145 if ( returnStmt->get_expr() && returnVals.size() == 1 && ! dynamic_cast< ReferenceType * >( returnVals.front()->get_type() ) ) { 129 146 // explicitly construct the return value using the return expression and the retVal object 130 assertf( returnVals.front()->name != "", "Function %s has unnamed return value\n", funcName.c_str() ); 131 132 ObjectDecl * retVal = strict_dynamic_cast< ObjectDecl * >( returnVals.front() ); 133 if ( VariableExpr * varExpr = dynamic_cast< VariableExpr * >( returnStmt->expr ) ) { 134 // return statement has already been mutated - don't need to do it again 135 if ( varExpr->var == retVal ) return; 136 } 137 stmtsToAddBefore.push_back( genCtorDtor( "?{}", retVal, returnStmt->get_expr() ) ); 147 assertf( returnVals.front()->get_name() != "", "Function %s has unnamed return value\n", funcName.c_str() ); 148 149 stmtsToAddBefore.push_back( genCtorDtor( "?{}", dynamic_cast< ObjectDecl *>( returnVals.front() ), returnStmt->get_expr() ) ); 138 150 139 151 // return the retVal object 140 returnStmt-> expr = new VariableExpr( returnVals.front() );152 returnStmt->set_expr( new VariableExpr( returnVals.front() ) ); 141 153 } // if 142 154 } … … 146 158 GuardValue( funcName ); 147 159 148 ftype = functionDecl-> type;149 funcName = functionDecl-> name;160 ftype = functionDecl->get_functionType(); 161 funcName = functionDecl->get_name(); 150 162 } 151 163 … … 153 165 // which would be incorrect if it is a side-effecting computation. 154 166 void HoistArrayDimension::hoistArrayDimension( std::list< Declaration * > & translationUnit ) { 155 PassVisitor<HoistArrayDimension> hoister; 156 mutateAll( translationUnit, hoister ); 157 } 158 159 void HoistArrayDimension::premutate( ObjectDecl * objectDecl ) { 160 GuardValue( storageClasses ); 167 HoistArrayDimension hoister; 168 hoister.mutateDeclarationList( translationUnit ); 169 } 170 171 DeclarationWithType * HoistArrayDimension::mutate( ObjectDecl * objectDecl ) { 161 172 storageClasses = objectDecl->get_storageClasses(); 162 } 163 164 DeclarationWithType * HoistArrayDimension::postmutate( ObjectDecl * objectDecl ) { 173 DeclarationWithType * temp = Parent::mutate( objectDecl ); 165 174 hoist( objectDecl->get_type() ); 166 return objectDecl;175 return temp; 167 176 } 168 177 … … 185 194 186 195 arrayType->set_dimension( new VariableExpr( arrayDimension ) ); 187 declsToAddBefore.push_back( arrayDimension );196 addDeclaration( arrayDimension ); 188 197 189 198 hoist( arrayType->get_base() ); … … 192 201 } 193 202 194 void HoistArrayDimension::premutate( FunctionDecl * ) { 195 GuardValue( inFunction ); 203 DeclarationWithType * HoistArrayDimension::mutate( FunctionDecl *functionDecl ) { 204 ValueGuard< bool > oldInFunc( inFunction ); 205 inFunction = true; 206 DeclarationWithType * decl = Parent::mutate( functionDecl ); 207 return decl; 196 208 } 197 209 … … 201 213 } 202 214 203 bool ManagedTypes::isManaged( Type * type ) const {204 // references are never constructed215 bool CtorDtor::isManaged( Type * type ) const { 216 // at least for now, references are never constructed 205 217 if ( dynamic_cast< ReferenceType * >( type ) ) return false; 206 218 // need to clear and reset qualifiers when determining if a type is managed … … 209 221 if ( TupleType * tupleType = dynamic_cast< TupleType * > ( type ) ) { 210 222 // tuple is also managed if any of its components are managed 211 if ( std::any_of( tupleType-> types.begin(), tupleType->types.end(), [&](Type * type) { return isManaged( type ); }) ) {223 if ( std::any_of( tupleType->get_types().begin(), tupleType->get_types().end(), [&](Type * type) { return isManaged( type ); }) ) { 212 224 return true; 213 225 } 214 226 } 215 227 // a type is managed if it appears in the map of known managed types, or if it contains any polymorphism (is a type variable or generic type containing a type variable) 216 return managedTypes.find( SymTab::Mangler::mangle Concrete( type ) ) != managedTypes.end() || GenPoly::isPolyType( type );217 } 218 219 bool ManagedTypes::isManaged( ObjectDecl * objDecl ) const {228 return managedTypes.find( SymTab::Mangler::mangle( type ) ) != managedTypes.end() || GenPoly::isPolyType( type ); 229 } 230 231 bool CtorDtor::isManaged( ObjectDecl * objDecl ) const { 220 232 Type * type = objDecl->get_type(); 221 233 while ( ArrayType * at = dynamic_cast< ArrayType * >( type ) ) { … … 225 237 } 226 238 227 void ManagedTypes::handleDWT( DeclarationWithType * dwt ) {239 void CtorDtor::handleDWT( DeclarationWithType * dwt ) { 228 240 // if this function is a user-defined constructor or destructor, mark down the type as "managed" 229 241 if ( ! LinkageSpec::isOverridable( dwt->get_linkage() ) && CodeGen::isCtorDtor( dwt->get_name() ) ) { … … 232 244 Type * type = InitTweak::getPointerBase( params.front()->get_type() ); 233 245 assert( type ); 234 managedTypes.insert( SymTab::Mangler::mangleConcrete( type ) ); 235 } 236 } 237 238 void ManagedTypes::handleStruct( StructDecl * aggregateDecl ) { 239 // don't construct members, but need to take note if there is a managed member, 240 // because that means that this type is also managed 241 for ( Declaration * member : aggregateDecl->get_members() ) { 242 if ( ObjectDecl * field = dynamic_cast< ObjectDecl * >( member ) ) { 243 if ( isManaged( field ) ) { 244 // generic parameters should not play a role in determining whether a generic type is constructed - construct all generic types, so that 245 // polymorphic constructors make generic types managed types 246 StructInstType inst( Type::Qualifiers(), aggregateDecl ); 247 managedTypes.insert( SymTab::Mangler::mangleConcrete( &inst ) ); 248 break; 249 } 250 } 251 } 252 } 253 254 void ManagedTypes::beginScope() { managedTypes.beginScope(); } 255 void ManagedTypes::endScope() { managedTypes.endScope(); } 246 managedTypes.insert( SymTab::Mangler::mangle( type ) ); 247 } 248 } 256 249 257 250 ImplicitCtorDtorStmt * genCtorDtor( const std::string & fname, ObjectDecl * objDecl, Expression * arg ) { … … 298 291 299 292 void CtorDtor::previsit( ObjectDecl * objDecl ) { 300 managedTypes.handleDWT( objDecl );293 handleDWT( objDecl ); 301 294 // hands off if @=, extern, builtin, etc. 302 295 // even if unmanaged, try to construct global or static if initializer is not constexpr, since this is not legal C 303 if ( tryConstruct( objDecl ) && ( managedTypes.isManaged( objDecl ) || ((! inFunction || objDecl->get_storageClasses().is_static ) && ! isConstExpr( objDecl->get_init() ) ) ) ) {296 if ( tryConstruct( objDecl ) && ( isManaged( objDecl ) || ((! inFunction || objDecl->get_storageClasses().is_static ) && ! isConstExpr( objDecl->get_init() ) ) ) ) { 304 297 // constructed objects cannot be designated 305 298 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 ); … … 312 305 313 306 void CtorDtor::previsit( FunctionDecl *functionDecl ) { 314 visit_children = false; // do not try and construct parameters or forall parameters315 307 GuardValue( inFunction ); 316 308 inFunction = true; 317 309 318 managedTypes.handleDWT( functionDecl );310 handleDWT( functionDecl ); 319 311 320 312 GuardScope( managedTypes ); … … 322 314 for ( auto & tyDecl : functionDecl->get_functionType()->get_forall() ) { 323 315 for ( DeclarationWithType *& assertion : tyDecl->get_assertions() ) { 324 managedTypes.handleDWT( assertion );316 handleDWT( assertion ); 325 317 } 326 318 } 327 319 328 maybeAccept( functionDecl->get_statements(), *visitor ); 320 PassVisitor<CtorDtor> newCtorDtor; 321 newCtorDtor.pass = *this; 322 maybeAccept( functionDecl->get_statements(), newCtorDtor ); 323 visit_children = false; // do not try and construct parameters or forall parameters - must happen after maybeAccept 329 324 } 330 325 … … 332 327 visit_children = false; // do not try to construct and destruct aggregate members 333 328 334 managedTypes.handleStruct( aggregateDecl ); 335 } 336 337 void CtorDtor::previsit( CompoundStmt * ) { 329 // don't construct members, but need to take note if there is a managed member, 330 // because that means that this type is also managed 331 for ( Declaration * member : aggregateDecl->get_members() ) { 332 if ( ObjectDecl * field = dynamic_cast< ObjectDecl * >( member ) ) { 333 if ( isManaged( field ) ) { 334 StructInstType inst( Type::Qualifiers(), aggregateDecl ); 335 managedTypes.insert( SymTab::Mangler::mangle( &inst ) ); 336 break; 337 } 338 } 339 } 340 } 341 342 void CtorDtor::previsit( __attribute__((unused)) CompoundStmt * compoundStmt ) { 338 343 GuardScope( managedTypes ); 339 344 } -
src/InitTweak/GenInit.h
r3f7e12cb r78315272 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 22 23 #include "GenPoly/ScopedSet.h" // for ScopedSet 21 #include "SynTree/SynTree.h" // for Visitor Nodes 24 22 25 23 namespace InitTweak { … … 27 25 void genInit( std::list< Declaration * > & translationUnit ); 28 26 29 /// Converts return statements into copy constructor calls on the hidden return variable 30 void fixReturnStatements( std::list< Declaration * > & translationUnit ); 31 32 /// generates a single ctor/dtor statement using objDecl as the 'this' parameter and arg as the optional argument 33 ImplicitCtorDtorStmt * genCtorDtor( const std::string & fname, ObjectDecl * objDecl, Expression * arg = nullptr ); 27 /// generates a single ctor/dtor statement using objDecl as the 'this' parameter and arg as the optional argument 28 ImplicitCtorDtorStmt * genCtorDtor( const std::string & fname, ObjectDecl * objDecl, Expression * arg = nullptr ); 34 29 35 30 /// creates an appropriate ConstructorInit node which contains a constructor, destructor, and C-initializer 36 31 ConstructorInit * genCtorInit( ObjectDecl * objDecl ); 37 38 class ManagedTypes {39 public:40 bool isManaged( ObjectDecl * objDecl ) const ; // determine if object is managed41 bool isManaged( Type * type ) const; // determine if type is managed42 43 void handleDWT( DeclarationWithType * dwt ); // add type to managed if ctor/dtor44 void handleStruct( StructDecl * aggregateDecl ); // add type to managed if child is managed45 46 void beginScope();47 void endScope();48 private:49 GenPoly::ScopedSet< std::string > managedTypes;50 };51 32 } // namespace 52 33 -
src/InitTweak/InitTweak.cc
r3f7e12cb r78315272 1 #include <stddef.h> // for NULL 1 2 #include <algorithm> // for find, all_of 2 3 #include <cassert> // for assertf, assert, strict_dynamic_cast … … 22 23 #include "SynTree/Type.h" // for FunctionType, ArrayType, PointerType 23 24 #include "SynTree/Visitor.h" // for Visitor, maybeAccept 24 #include "Tuples/Tuples.h" // for Tuples::isTtype25 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 181 172 namespace { 182 173 /// given index i, dimension d, initializer init, and callExpr f, generates … … 193 184 callExpr->get_args().splice( callExpr->get_args().end(), args ); 194 185 195 *out++ = new IfStmt( noLabels, cond, new ExprStmt( noLabels, callExpr ), nullptr);186 *out++ = new IfStmt( noLabels, cond, new ExprStmt( noLabels, callExpr ), NULL ); 196 187 197 188 UntypedExpr * increment = new UntypedExpr( new NameExpr( "++?" ) ); … … 259 250 // To accomplish this, generate switch statement, consuming all of expander's elements 260 251 Statement * InitImpl::buildListInit( UntypedExpr * dst, std::list< Expression * > & indices ) { 261 if ( ! init ) return nullptr;252 if ( ! init ) return NULL; 262 253 CompoundStmt * block = new CompoundStmt( noLabels ); 263 254 build( dst, indices.begin(), indices.end(), init, back_inserter( block->get_kids() ) ); 264 255 if ( block->get_kids().empty() ) { 265 256 delete block; 266 return nullptr;257 return NULL; 267 258 } else { 268 init = nullptr; // init was consumed in creating the list init259 init = NULL; // init was consumed in creating the list init 269 260 return block; 270 261 } 271 262 } 272 263 273 Statement * ExprImpl::buildListInit( UntypedExpr *, std::list< Expression * > &) {274 return nullptr;264 Statement * ExprImpl::buildListInit( __attribute((unused)) UntypedExpr * dst, __attribute((unused)) std::list< Expression * > & indices ) { 265 return NULL; 275 266 } 276 267 … … 279 270 } 280 271 281 Type * getTypeofThis( FunctionType * ftype ) { 282 assertf( ftype, "getTypeofThis: nullptr ftype" ); 283 ObjectDecl * thisParam = getParamThis( ftype ); 284 ReferenceType * refType = strict_dynamic_cast< ReferenceType * >( thisParam->type ); 285 return refType->base; 286 } 287 288 ObjectDecl * getParamThis( FunctionType * ftype ) { 289 assertf( ftype, "getParamThis: nullptr ftype" ); 290 auto & params = ftype->parameters; 291 assertf( ! params.empty(), "getParamThis: ftype with 0 parameters: %s", toString( ftype ).c_str() ); 292 return strict_dynamic_cast< ObjectDecl * >( params.front() ); 293 } 294 295 bool tryConstruct( DeclarationWithType * dwt ) { 296 ObjectDecl * objDecl = dynamic_cast< ObjectDecl * >( dwt ); 297 if ( ! objDecl ) return false; 272 bool tryConstruct( ObjectDecl * objDecl ) { 298 273 return ! LinkageSpec::isBuiltin( objDecl->get_linkage() ) && 299 (objDecl->get_init() == nullptr || 300 ( objDecl->get_init() != nullptr && objDecl->get_init()->get_maybeConstructed() )) 301 && ! objDecl->get_storageClasses().is_extern 302 && isConstructable( objDecl->type ); 303 } 304 305 bool isConstructable( Type * type ) { 306 return ! dynamic_cast< VarArgsType * >( type ) && ! dynamic_cast< ReferenceType * >( type ) && ! dynamic_cast< FunctionType * >( type ) && ! Tuples::isTtype( type ); 274 (objDecl->get_init() == NULL || 275 ( objDecl->get_init() != NULL && objDecl->get_init()->get_maybeConstructed() )) 276 && ! objDecl->get_storageClasses().is_extern; 307 277 } 308 278 … … 344 314 collectCtorDtorCalls( stmt, matches ); 345 315 assert( matches.size() <= 1 ); 346 return matches.size() == 1 ? matches.front() : nullptr;316 return matches.size() == 1 ? matches.front() : NULL; 347 317 } 348 318 … … 362 332 assert( expr ); 363 333 if ( VariableExpr * varExpr = dynamic_cast< VariableExpr * >( expr ) ) { 364 return varExpr-> var;334 return varExpr->get_var(); 365 335 } else if ( MemberExpr * memberExpr = dynamic_cast< MemberExpr * >( expr ) ) { 366 return memberExpr-> member;336 return memberExpr->get_member(); 367 337 } else if ( CastExpr * castExpr = dynamic_cast< CastExpr * >( expr ) ) { 368 return getCalledFunction( castExpr-> arg);338 return getCalledFunction( castExpr->get_arg() ); 369 339 } else if ( UntypedExpr * untypedExpr = dynamic_cast< UntypedExpr * >( expr ) ) { 370 340 return handleDerefCalledFunction( untypedExpr ); … … 372 342 return handleDerefCalledFunction( appExpr ); 373 343 } else if ( AddressExpr * addrExpr = dynamic_cast< AddressExpr * >( expr ) ) { 374 return getCalledFunction( addrExpr->arg ); 375 } else if ( CommaExpr * commaExpr = dynamic_cast< CommaExpr * >( expr ) ) { 376 return getCalledFunction( commaExpr->arg2 ); 344 return getCalledFunction( addrExpr->get_arg() ); 377 345 } 378 346 return nullptr; … … 391 359 ApplicationExpr * isIntrinsicCallExpr( Expression * expr ) { 392 360 ApplicationExpr * appExpr = dynamic_cast< ApplicationExpr * >( expr ); 393 if ( ! appExpr ) return nullptr;361 if ( ! appExpr ) return NULL; 394 362 DeclarationWithType * function = getCalledFunction( appExpr->get_function() ); 395 363 assertf( function, "getCalledFunction returned nullptr: %s", toString( appExpr->get_function() ).c_str() ); 396 364 // check for Intrinsic only - don't want to remove all overridable ctor/dtors because autogenerated ctor/dtor 397 365 // will call all member dtors, and some members may have a user defined dtor. 398 return function->get_linkage() == LinkageSpec::Intrinsic ? appExpr : nullptr;366 return function->get_linkage() == LinkageSpec::Intrinsic ? appExpr : NULL; 399 367 } 400 368 … … 514 482 return refType->get_base(); 515 483 } else { 516 return nullptr;484 return NULL; 517 485 } 518 486 } … … 520 488 Type * isPointerType( Type * type ) { 521 489 if ( getPointerBase( type ) ) return type; 522 else return nullptr;490 else return NULL; 523 491 } 524 492 … … 589 557 FunctionDecl * isCopyFunction( Declaration * decl, const std::string & fname ) { 590 558 FunctionDecl * function = dynamic_cast< FunctionDecl * >( decl ); 591 if ( ! function ) return nullptr;592 if ( function-> name != fname ) return nullptr;593 FunctionType * ftype = function-> type;594 if ( ftype-> parameters.size() != 2 ) return nullptr;559 if ( ! function ) return 0; 560 if ( function->get_name() != fname ) return 0; 561 FunctionType * ftype = function->get_functionType(); 562 if ( ftype->get_parameters().size() != 2 ) return 0; 595 563 596 564 Type * t1 = getPointerBase( ftype->get_parameters().front()->get_type() ); 597 Type * t2 = ftype-> parameters.back()->get_type();565 Type * t2 = ftype->get_parameters().back()->get_type(); 598 566 assert( t1 ); 599 567 … … 615 583 } 616 584 FunctionDecl * isDefaultConstructor( Declaration * decl ) { 617 if ( isConstructor( decl-> name) ) {585 if ( isConstructor( decl->get_name() ) ) { 618 586 if ( FunctionDecl * func = dynamic_cast< FunctionDecl * >( decl ) ) { 619 if ( func-> type->parameters.size() == 1 ) {587 if ( func->get_functionType()->get_parameters().size() == 1 ) { 620 588 return func; 621 589 } -
src/InitTweak/InitTweak.h
r3f7e12cb r78315272 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 function33 Type * getTypeofThis( FunctionType * ftype );34 35 /// returns the first parameter of a constructor/destructor/assignment function36 ObjectDecl * getParamThis( FunctionType * ftype );37 38 32 /// transform Initializer into an argument list that can be passed to a call expression 39 33 std::list< Expression * > makeInitList( Initializer * init ); 40 34 41 /// True if the resolver should try to construct dwt 42 bool tryConstruct( DeclarationWithType * dwt ); 43 44 /// True if the type can have a user-defined constructor 45 bool isConstructable( Type * t ); 35 /// True if the resolver should try to construct objDecl 36 bool tryConstruct( ObjectDecl * objDecl ); 46 37 47 38 /// True if the Initializer contains designations … … 105 96 void addArrayIndex( Expression * index, Expression * dimension ); 106 97 void clearArrayIndices(); 107 bool addReference();108 98 109 99 class ExpanderImpl; -
src/MakeLibCfa.cc
r3f7e12cb r78315272 119 119 newDecls.push_back( funcDecl ); 120 120 121 Statement * stmt = nullptr;122 121 switch ( opInfo.type ) { 123 122 case CodeGen::OT_INDEX: … … 129 128 case CodeGen::OT_POSTFIXASSIGN: 130 129 case CodeGen::OT_INFIXASSIGN: 131 // return the recursive call132 stmt = new ReturnStmt( noLabels, newExpr );133 break;134 130 case CodeGen::OT_CTOR: 135 131 case CodeGen::OT_DTOR: 136 // executethe recursive call137 stmt = new ExprStmt( noLabels, newExpr);132 // return the recursive call 133 funcDecl->get_statements()->get_kids().push_back( new ReturnStmt( std::list< Label >(), newExpr ) ); 138 134 break; 139 135 case CodeGen::OT_CONSTANT: … … 142 138 assert( false ); 143 139 } // switch 144 funcDecl->get_statements()->push_back( stmt );145 140 } 146 141 } // namespace -
src/Makefile.in
r3f7e12cb r78315272 172 172 GenPoly/driver_cfa_cpp-Box.$(OBJEXT) \ 173 173 GenPoly/driver_cfa_cpp-GenPoly.$(OBJEXT) \ 174 GenPoly/driver_cfa_cpp-PolyMutator.$(OBJEXT) \ 174 175 GenPoly/driver_cfa_cpp-ScrubTyVars.$(OBJEXT) \ 175 176 GenPoly/driver_cfa_cpp-Lvalue.$(OBJEXT) \ 176 177 GenPoly/driver_cfa_cpp-Specialize.$(OBJEXT) \ 178 GenPoly/driver_cfa_cpp-CopyParams.$(OBJEXT) \ 177 179 GenPoly/driver_cfa_cpp-FindFunction.$(OBJEXT) \ 180 GenPoly/driver_cfa_cpp-DeclMutator.$(OBJEXT) \ 178 181 GenPoly/driver_cfa_cpp-InstantiateGeneric.$(OBJEXT) \ 179 182 InitTweak/driver_cfa_cpp-GenInit.$(OBJEXT) \ … … 250 253 SynTree/driver_cfa_cpp-Visitor.$(OBJEXT) \ 251 254 SynTree/driver_cfa_cpp-Mutator.$(OBJEXT) \ 255 SynTree/driver_cfa_cpp-AddStmtVisitor.$(OBJEXT) \ 252 256 SynTree/driver_cfa_cpp-TypeSubstitution.$(OBJEXT) \ 253 257 SynTree/driver_cfa_cpp-Attribute.$(OBJEXT) \ … … 493 497 ControlStruct/ForExprMutator.cc \ 494 498 ControlStruct/ExceptTranslate.cc GenPoly/Box.cc \ 495 GenPoly/GenPoly.cc GenPoly/ScrubTyVars.cc GenPoly/Lvalue.cc \ 496 GenPoly/Specialize.cc GenPoly/FindFunction.cc \ 497 GenPoly/InstantiateGeneric.cc InitTweak/GenInit.cc \ 498 InitTweak/FixInit.cc InitTweak/FixGlobalInit.cc \ 499 InitTweak/InitTweak.cc Parser/parser.yy Parser/lex.ll \ 500 Parser/TypedefTable.cc Parser/ParseNode.cc \ 501 Parser/DeclarationNode.cc Parser/ExpressionNode.cc \ 502 Parser/StatementNode.cc Parser/InitializerNode.cc \ 503 Parser/TypeData.cc Parser/LinkageSpec.cc \ 504 Parser/parserutility.cc ResolvExpr/AlternativeFinder.cc \ 505 ResolvExpr/Alternative.cc ResolvExpr/Unify.cc \ 506 ResolvExpr/PtrsAssignable.cc ResolvExpr/CommonType.cc \ 507 ResolvExpr/ConversionCost.cc ResolvExpr/CastCost.cc \ 508 ResolvExpr/PtrsCastable.cc ResolvExpr/AdjustExprType.cc \ 509 ResolvExpr/AlternativePrinter.cc ResolvExpr/Resolver.cc \ 510 ResolvExpr/ResolveTypeof.cc ResolvExpr/RenameVars.cc \ 511 ResolvExpr/FindOpenVars.cc ResolvExpr/PolyCost.cc \ 512 ResolvExpr/Occurs.cc ResolvExpr/TypeEnvironment.cc \ 513 ResolvExpr/CurrentObject.cc SymTab/Indexer.cc \ 514 SymTab/Mangler.cc SymTab/Validate.cc SymTab/FixFunction.cc \ 515 SymTab/ImplementationType.cc SymTab/TypeEquality.cc \ 516 SymTab/Autogen.cc SynTree/Type.cc SynTree/VoidType.cc \ 517 SynTree/BasicType.cc SynTree/PointerType.cc \ 518 SynTree/ArrayType.cc SynTree/ReferenceType.cc \ 519 SynTree/FunctionType.cc SynTree/ReferenceToType.cc \ 520 SynTree/TupleType.cc SynTree/TypeofType.cc SynTree/AttrType.cc \ 499 GenPoly/GenPoly.cc GenPoly/PolyMutator.cc \ 500 GenPoly/ScrubTyVars.cc GenPoly/Lvalue.cc GenPoly/Specialize.cc \ 501 GenPoly/CopyParams.cc GenPoly/FindFunction.cc \ 502 GenPoly/DeclMutator.cc GenPoly/InstantiateGeneric.cc \ 503 InitTweak/GenInit.cc InitTweak/FixInit.cc \ 504 InitTweak/FixGlobalInit.cc InitTweak/InitTweak.cc \ 505 Parser/parser.yy Parser/lex.ll Parser/TypedefTable.cc \ 506 Parser/ParseNode.cc Parser/DeclarationNode.cc \ 507 Parser/ExpressionNode.cc Parser/StatementNode.cc \ 508 Parser/InitializerNode.cc Parser/TypeData.cc \ 509 Parser/LinkageSpec.cc Parser/parserutility.cc \ 510 ResolvExpr/AlternativeFinder.cc ResolvExpr/Alternative.cc \ 511 ResolvExpr/Unify.cc ResolvExpr/PtrsAssignable.cc \ 512 ResolvExpr/CommonType.cc ResolvExpr/ConversionCost.cc \ 513 ResolvExpr/CastCost.cc ResolvExpr/PtrsCastable.cc \ 514 ResolvExpr/AdjustExprType.cc ResolvExpr/AlternativePrinter.cc \ 515 ResolvExpr/Resolver.cc ResolvExpr/ResolveTypeof.cc \ 516 ResolvExpr/RenameVars.cc ResolvExpr/FindOpenVars.cc \ 517 ResolvExpr/PolyCost.cc ResolvExpr/Occurs.cc \ 518 ResolvExpr/TypeEnvironment.cc ResolvExpr/CurrentObject.cc \ 519 SymTab/Indexer.cc SymTab/Mangler.cc SymTab/Validate.cc \ 520 SymTab/FixFunction.cc SymTab/ImplementationType.cc \ 521 SymTab/TypeEquality.cc SymTab/Autogen.cc SynTree/Type.cc \ 522 SynTree/VoidType.cc SynTree/BasicType.cc \ 523 SynTree/PointerType.cc SynTree/ArrayType.cc \ 524 SynTree/ReferenceType.cc SynTree/FunctionType.cc \ 525 SynTree/ReferenceToType.cc SynTree/TupleType.cc \ 526 SynTree/TypeofType.cc SynTree/AttrType.cc \ 521 527 SynTree/VarArgsType.cc SynTree/ZeroOneType.cc \ 522 528 SynTree/Constant.cc SynTree/Expression.cc SynTree/TupleExpr.cc \ … … 529 535 SynTree/NamedTypeDecl.cc SynTree/TypeDecl.cc \ 530 536 SynTree/Initializer.cc SynTree/Visitor.cc SynTree/Mutator.cc \ 531 SynTree/ TypeSubstitution.cc SynTree/Attribute.cc \532 SynTree/ VarExprReplacer.cc Tuples/TupleAssignment.cc \533 Tuples/Tuple Expansion.cc Tuples/Explode.cc \534 Virtual/ExpandCasts.cc537 SynTree/AddStmtVisitor.cc SynTree/TypeSubstitution.cc \ 538 SynTree/Attribute.cc SynTree/VarExprReplacer.cc \ 539 Tuples/TupleAssignment.cc Tuples/TupleExpansion.cc \ 540 Tuples/Explode.cc Virtual/ExpandCasts.cc 535 541 MAINTAINERCLEANFILES = Parser/parser.output ${libdir}/${notdir \ 536 542 ${cfa_cpplib_PROGRAMS}} … … 711 717 GenPoly/driver_cfa_cpp-GenPoly.$(OBJEXT): GenPoly/$(am__dirstamp) \ 712 718 GenPoly/$(DEPDIR)/$(am__dirstamp) 719 GenPoly/driver_cfa_cpp-PolyMutator.$(OBJEXT): GenPoly/$(am__dirstamp) \ 720 GenPoly/$(DEPDIR)/$(am__dirstamp) 713 721 GenPoly/driver_cfa_cpp-ScrubTyVars.$(OBJEXT): GenPoly/$(am__dirstamp) \ 714 722 GenPoly/$(DEPDIR)/$(am__dirstamp) … … 717 725 GenPoly/driver_cfa_cpp-Specialize.$(OBJEXT): GenPoly/$(am__dirstamp) \ 718 726 GenPoly/$(DEPDIR)/$(am__dirstamp) 727 GenPoly/driver_cfa_cpp-CopyParams.$(OBJEXT): GenPoly/$(am__dirstamp) \ 728 GenPoly/$(DEPDIR)/$(am__dirstamp) 719 729 GenPoly/driver_cfa_cpp-FindFunction.$(OBJEXT): \ 720 730 GenPoly/$(am__dirstamp) GenPoly/$(DEPDIR)/$(am__dirstamp) 731 GenPoly/driver_cfa_cpp-DeclMutator.$(OBJEXT): GenPoly/$(am__dirstamp) \ 732 GenPoly/$(DEPDIR)/$(am__dirstamp) 721 733 GenPoly/driver_cfa_cpp-InstantiateGeneric.$(OBJEXT): \ 722 734 GenPoly/$(am__dirstamp) GenPoly/$(DEPDIR)/$(am__dirstamp) … … 917 929 SynTree/driver_cfa_cpp-Mutator.$(OBJEXT): SynTree/$(am__dirstamp) \ 918 930 SynTree/$(DEPDIR)/$(am__dirstamp) 931 SynTree/driver_cfa_cpp-AddStmtVisitor.$(OBJEXT): \ 932 SynTree/$(am__dirstamp) SynTree/$(DEPDIR)/$(am__dirstamp) 919 933 SynTree/driver_cfa_cpp-TypeSubstitution.$(OBJEXT): \ 920 934 SynTree/$(am__dirstamp) SynTree/$(DEPDIR)/$(am__dirstamp) … … 993 1007 @AMDEP_TRUE@@am__include@ @am__quote@ControlStruct/$(DEPDIR)/driver_cfa_cpp-Mutate.Po@am__quote@ 994 1008 @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@ 995 1011 @AMDEP_TRUE@@am__include@ @am__quote@GenPoly/$(DEPDIR)/driver_cfa_cpp-FindFunction.Po@am__quote@ 996 1012 @AMDEP_TRUE@@am__include@ @am__quote@GenPoly/$(DEPDIR)/driver_cfa_cpp-GenPoly.Po@am__quote@ 997 1013 @AMDEP_TRUE@@am__include@ @am__quote@GenPoly/$(DEPDIR)/driver_cfa_cpp-InstantiateGeneric.Po@am__quote@ 998 1014 @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@ 999 1016 @AMDEP_TRUE@@am__include@ @am__quote@GenPoly/$(DEPDIR)/driver_cfa_cpp-ScrubTyVars.Po@am__quote@ 1000 1017 @AMDEP_TRUE@@am__include@ @am__quote@GenPoly/$(DEPDIR)/driver_cfa_cpp-Specialize.Po@am__quote@ … … 1039 1056 @AMDEP_TRUE@@am__include@ @am__quote@SymTab/$(DEPDIR)/driver_cfa_cpp-TypeEquality.Po@am__quote@ 1040 1057 @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@ 1041 1059 @AMDEP_TRUE@@am__include@ @am__quote@SynTree/$(DEPDIR)/driver_cfa_cpp-AddressExpr.Po@am__quote@ 1042 1060 @AMDEP_TRUE@@am__include@ @am__quote@SynTree/$(DEPDIR)/driver_cfa_cpp-AggregateDecl.Po@am__quote@ … … 1432 1450 @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` 1433 1451 1452 GenPoly/driver_cfa_cpp-PolyMutator.o: GenPoly/PolyMutator.cc 1453 @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -MT GenPoly/driver_cfa_cpp-PolyMutator.o -MD -MP -MF GenPoly/$(DEPDIR)/driver_cfa_cpp-PolyMutator.Tpo -c -o GenPoly/driver_cfa_cpp-PolyMutator.o `test -f 'GenPoly/PolyMutator.cc' || echo '$(srcdir)/'`GenPoly/PolyMutator.cc 1454 @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) GenPoly/$(DEPDIR)/driver_cfa_cpp-PolyMutator.Tpo GenPoly/$(DEPDIR)/driver_cfa_cpp-PolyMutator.Po 1455 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='GenPoly/PolyMutator.cc' object='GenPoly/driver_cfa_cpp-PolyMutator.o' libtool=no @AMDEPBACKSLASH@ 1456 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ 1457 @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -c -o GenPoly/driver_cfa_cpp-PolyMutator.o `test -f 'GenPoly/PolyMutator.cc' || echo '$(srcdir)/'`GenPoly/PolyMutator.cc 1458 1459 GenPoly/driver_cfa_cpp-PolyMutator.obj: GenPoly/PolyMutator.cc 1460 @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -MT GenPoly/driver_cfa_cpp-PolyMutator.obj -MD -MP -MF GenPoly/$(DEPDIR)/driver_cfa_cpp-PolyMutator.Tpo -c -o GenPoly/driver_cfa_cpp-PolyMutator.obj `if test -f 'GenPoly/PolyMutator.cc'; then $(CYGPATH_W) 'GenPoly/PolyMutator.cc'; else $(CYGPATH_W) '$(srcdir)/GenPoly/PolyMutator.cc'; fi` 1461 @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) GenPoly/$(DEPDIR)/driver_cfa_cpp-PolyMutator.Tpo GenPoly/$(DEPDIR)/driver_cfa_cpp-PolyMutator.Po 1462 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='GenPoly/PolyMutator.cc' object='GenPoly/driver_cfa_cpp-PolyMutator.obj' libtool=no @AMDEPBACKSLASH@ 1463 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ 1464 @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -c -o GenPoly/driver_cfa_cpp-PolyMutator.obj `if test -f 'GenPoly/PolyMutator.cc'; then $(CYGPATH_W) 'GenPoly/PolyMutator.cc'; else $(CYGPATH_W) '$(srcdir)/GenPoly/PolyMutator.cc'; fi` 1465 1434 1466 GenPoly/driver_cfa_cpp-ScrubTyVars.o: GenPoly/ScrubTyVars.cc 1435 1467 @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 … … 1474 1506 @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` 1475 1507 1508 GenPoly/driver_cfa_cpp-CopyParams.o: GenPoly/CopyParams.cc 1509 @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -MT GenPoly/driver_cfa_cpp-CopyParams.o -MD -MP -MF GenPoly/$(DEPDIR)/driver_cfa_cpp-CopyParams.Tpo -c -o GenPoly/driver_cfa_cpp-CopyParams.o `test -f 'GenPoly/CopyParams.cc' || echo '$(srcdir)/'`GenPoly/CopyParams.cc 1510 @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) GenPoly/$(DEPDIR)/driver_cfa_cpp-CopyParams.Tpo GenPoly/$(DEPDIR)/driver_cfa_cpp-CopyParams.Po 1511 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='GenPoly/CopyParams.cc' object='GenPoly/driver_cfa_cpp-CopyParams.o' libtool=no @AMDEPBACKSLASH@ 1512 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ 1513 @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -c -o GenPoly/driver_cfa_cpp-CopyParams.o `test -f 'GenPoly/CopyParams.cc' || echo '$(srcdir)/'`GenPoly/CopyParams.cc 1514 1515 GenPoly/driver_cfa_cpp-CopyParams.obj: GenPoly/CopyParams.cc 1516 @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -MT GenPoly/driver_cfa_cpp-CopyParams.obj -MD -MP -MF GenPoly/$(DEPDIR)/driver_cfa_cpp-CopyParams.Tpo -c -o GenPoly/driver_cfa_cpp-CopyParams.obj `if test -f 'GenPoly/CopyParams.cc'; then $(CYGPATH_W) 'GenPoly/CopyParams.cc'; else $(CYGPATH_W) '$(srcdir)/GenPoly/CopyParams.cc'; fi` 1517 @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) GenPoly/$(DEPDIR)/driver_cfa_cpp-CopyParams.Tpo GenPoly/$(DEPDIR)/driver_cfa_cpp-CopyParams.Po 1518 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='GenPoly/CopyParams.cc' object='GenPoly/driver_cfa_cpp-CopyParams.obj' libtool=no @AMDEPBACKSLASH@ 1519 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ 1520 @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -c -o GenPoly/driver_cfa_cpp-CopyParams.obj `if test -f 'GenPoly/CopyParams.cc'; then $(CYGPATH_W) 'GenPoly/CopyParams.cc'; else $(CYGPATH_W) '$(srcdir)/GenPoly/CopyParams.cc'; fi` 1521 1476 1522 GenPoly/driver_cfa_cpp-FindFunction.o: GenPoly/FindFunction.cc 1477 1523 @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 … … 1488 1534 @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` 1489 1535 1536 GenPoly/driver_cfa_cpp-DeclMutator.o: GenPoly/DeclMutator.cc 1537 @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -MT GenPoly/driver_cfa_cpp-DeclMutator.o -MD -MP -MF GenPoly/$(DEPDIR)/driver_cfa_cpp-DeclMutator.Tpo -c -o GenPoly/driver_cfa_cpp-DeclMutator.o `test -f 'GenPoly/DeclMutator.cc' || echo '$(srcdir)/'`GenPoly/DeclMutator.cc 1538 @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) GenPoly/$(DEPDIR)/driver_cfa_cpp-DeclMutator.Tpo GenPoly/$(DEPDIR)/driver_cfa_cpp-DeclMutator.Po 1539 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='GenPoly/DeclMutator.cc' object='GenPoly/driver_cfa_cpp-DeclMutator.o' libtool=no @AMDEPBACKSLASH@ 1540 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ 1541 @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -c -o GenPoly/driver_cfa_cpp-DeclMutator.o `test -f 'GenPoly/DeclMutator.cc' || echo '$(srcdir)/'`GenPoly/DeclMutator.cc 1542 1543 GenPoly/driver_cfa_cpp-DeclMutator.obj: GenPoly/DeclMutator.cc 1544 @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -MT GenPoly/driver_cfa_cpp-DeclMutator.obj -MD -MP -MF GenPoly/$(DEPDIR)/driver_cfa_cpp-DeclMutator.Tpo -c -o GenPoly/driver_cfa_cpp-DeclMutator.obj `if test -f 'GenPoly/DeclMutator.cc'; then $(CYGPATH_W) 'GenPoly/DeclMutator.cc'; else $(CYGPATH_W) '$(srcdir)/GenPoly/DeclMutator.cc'; fi` 1545 @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) GenPoly/$(DEPDIR)/driver_cfa_cpp-DeclMutator.Tpo GenPoly/$(DEPDIR)/driver_cfa_cpp-DeclMutator.Po 1546 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='GenPoly/DeclMutator.cc' object='GenPoly/driver_cfa_cpp-DeclMutator.obj' libtool=no @AMDEPBACKSLASH@ 1547 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ 1548 @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -c -o GenPoly/driver_cfa_cpp-DeclMutator.obj `if test -f 'GenPoly/DeclMutator.cc'; then $(CYGPATH_W) 'GenPoly/DeclMutator.cc'; else $(CYGPATH_W) '$(srcdir)/GenPoly/DeclMutator.cc'; fi` 1549 1490 1550 GenPoly/driver_cfa_cpp-InstantiateGeneric.o: GenPoly/InstantiateGeneric.cc 1491 1551 @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 … … 2523 2583 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ 2524 2584 @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.cc 2587 @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -MT SynTree/driver_cfa_cpp-AddStmtVisitor.o -MD -MP -MF SynTree/$(DEPDIR)/driver_cfa_cpp-AddStmtVisitor.Tpo -c -o SynTree/driver_cfa_cpp-AddStmtVisitor.o `test -f 'SynTree/AddStmtVisitor.cc' || echo '$(srcdir)/'`SynTree/AddStmtVisitor.cc 2588 @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) SynTree/$(DEPDIR)/driver_cfa_cpp-AddStmtVisitor.Tpo SynTree/$(DEPDIR)/driver_cfa_cpp-AddStmtVisitor.Po 2589 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='SynTree/AddStmtVisitor.cc' object='SynTree/driver_cfa_cpp-AddStmtVisitor.o' libtool=no @AMDEPBACKSLASH@ 2590 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ 2591 @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -c -o SynTree/driver_cfa_cpp-AddStmtVisitor.o `test -f 'SynTree/AddStmtVisitor.cc' || echo '$(srcdir)/'`SynTree/AddStmtVisitor.cc 2592 2593 SynTree/driver_cfa_cpp-AddStmtVisitor.obj: SynTree/AddStmtVisitor.cc 2594 @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -MT SynTree/driver_cfa_cpp-AddStmtVisitor.obj -MD -MP -MF SynTree/$(DEPDIR)/driver_cfa_cpp-AddStmtVisitor.Tpo -c -o SynTree/driver_cfa_cpp-AddStmtVisitor.obj `if test -f 'SynTree/AddStmtVisitor.cc'; then $(CYGPATH_W) 'SynTree/AddStmtVisitor.cc'; else $(CYGPATH_W) '$(srcdir)/SynTree/AddStmtVisitor.cc'; fi` 2595 @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) SynTree/$(DEPDIR)/driver_cfa_cpp-AddStmtVisitor.Tpo SynTree/$(DEPDIR)/driver_cfa_cpp-AddStmtVisitor.Po 2596 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='SynTree/AddStmtVisitor.cc' object='SynTree/driver_cfa_cpp-AddStmtVisitor.obj' libtool=no @AMDEPBACKSLASH@ 2597 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ 2598 @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -c -o SynTree/driver_cfa_cpp-AddStmtVisitor.obj `if test -f 'SynTree/AddStmtVisitor.cc'; then $(CYGPATH_W) 'SynTree/AddStmtVisitor.cc'; else $(CYGPATH_W) '$(srcdir)/SynTree/AddStmtVisitor.cc'; fi` 2525 2599 2526 2600 SynTree/driver_cfa_cpp-TypeSubstitution.o: SynTree/TypeSubstitution.cc -
src/Parser/DeclarationNode.cc
r3f7e12cb r78315272 9 9 // Author : Rodolfo G. Esteves 10 10 // Created On : Sat May 16 12:34:05 2015 11 // Last Modified By : Peter A. Buhr12 // Last Modified On : Sat Sep 23 18:16:48201713 // Update Count : 102 411 // Last Modified By : Andrew Beach 12 // Last Modified On : Thr Aug 10 17:02:00 2017 13 // Update Count : 1021 14 14 // 15 15 … … 40 40 using namespace std; 41 41 42 // These must harmonize withthe corresponding DeclarationNode enumerations.43 const char * DeclarationNode::basicTypeNames[] = { "void", "_Bool", "char", "int", "float", "double", "long double", " int128", "float80", "float128", "NoBasicTypeNames" };42 // These must remain in the same order as the corresponding DeclarationNode enumerations. 43 const char * DeclarationNode::basicTypeNames[] = { "void", "_Bool", "char", "int", "float", "double", "long double", "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 // otype is internally converted to dtype + otype parameters 1034 static const TypeDecl::Kind kindMap[] = { TypeDecl::Dtype, TypeDecl::Dtype, TypeDecl::Ftype, TypeDecl::Ttype }; 1035 assertf( sizeof(kindMap)/sizeof(kindMap[0]) == NoTypeClass, "DeclarationNode::build: kindMap is out of sync." ); 1033 static const TypeDecl::Kind kindMap[] = { TypeDecl::Any, TypeDecl::Dtype, TypeDecl::Ftype, TypeDecl::Ttype }; 1034 assertf( sizeof(kindMap)/sizeof(kindMap[0] == NoTypeClass-1), "DeclarationNode::build: kindMap is out of sync." ); 1036 1035 assertf( variable.tyClass < sizeof(kindMap)/sizeof(kindMap[0]), "Variable's tyClass is out of bounds." ); 1037 TypeDecl * ret = new TypeDecl( *name, Type::StorageClasses(), nullptr, kindMap[ variable.tyClass ], variable. tyClass == Otype, variable.initializer ? variable.initializer->buildType() : nullptr );1036 TypeDecl * ret = new TypeDecl( *name, Type::StorageClasses(), nullptr, kindMap[ variable.tyClass ], variable.initializer ? variable.initializer->buildType() : nullptr ); 1038 1037 buildList( variable.assertions, ret->get_assertions() ); 1039 1038 return ret; -
src/Parser/ExpressionNode.cc
r3f7e12cb r78315272 10 10 // Created On : Sat May 16 13:17:07 2015 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Wed Sep 27 22:51:55201713 // Update Count : 78112 // Last Modified On : Thu Sep 14 23:09:34 2017 13 // Update Count : 690 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 }; // lnthsInt66 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 size71 posn += 1; // advance to size72 if ( str[posn] == '8' ) { // 873 lnth = 0;74 } else if ( str[posn] == '1' ) {75 posn += 1;76 if ( str[posn] == '6' ) { // 1677 lnth = 1;78 } else { // 12879 posn += 1;80 lnth = 5;81 } // if82 } else {83 if ( str[posn] == '3' ) { // 3284 lnth = 2;85 } else if ( str[posn] == '6' ) { // 6486 lnth = 3;87 } else {88 assertf( false, "internal error, bad integral length %s", str.c_str() );89 } // if90 posn += 1;91 } // if92 str.erase( start, posn - start + 1 ); // remove length suffix93 } // checkLNInt94 95 62 static void sepNumeric( string & str, string & units ) { 96 63 string::size_type posn = str.find_first_of( "`" ); … … 102 69 103 70 Expression * build_constantInteger( string & str ) { 104 static const BasicType::Kind kind[2][ 6] = {71 static const BasicType::Kind kind[2][5] = { 105 72 // short (h) must be before char (hh) 106 { BasicType::ShortSignedInt, BasicType::SignedChar, BasicType::SignedInt, BasicType::LongSignedInt, BasicType::LongLongSignedInt , BasicType::SignedInt128,},107 { BasicType::ShortUnsignedInt, BasicType::UnsignedChar, BasicType::UnsignedInt, BasicType::LongUnsignedInt, BasicType::LongLongUnsignedInt , BasicType::UnsignedInt128,},73 { BasicType::ShortSignedInt, BasicType::SignedChar, BasicType::SignedInt, BasicType::LongSignedInt, BasicType::LongLongSignedInt }, 74 { BasicType::ShortUnsignedInt, BasicType::UnsignedChar, BasicType::UnsignedInt, BasicType::LongUnsignedInt, BasicType::LongLongUnsignedInt }, 108 75 }; 109 76 110 string units; 77 string units; // units 111 78 sepNumeric( str, units ); // separate constant from units 112 79 113 80 bool dec = true, Unsigned = false; // decimal, unsigned constant 114 int size; // 0 => short, 1 => char, 2 => int, 3 => long int, 4 => long long int, 5 => int128 115 int lnth = -1; // literal length 116 81 int size; // 0 => short, 1 => char, 2 => int, 3 => long int, 4 => long long int, 5 => size_t 117 82 unsigned long long int v; // converted integral value 118 83 size_t last = str.length() - 1; // last character of constant … … 175 140 } // if 176 141 str.erase( last - size - 1, size + 1 ); // remove 'h'/"hh" 177 } else { // suffix "ln" ?178 checkLNInt( str, lnth, size );179 142 } // if 180 143 } else if ( checkL( str[ last ] ) ) { // suffix 'l' ? … … 200 163 str.erase( last - size, size + 1 ); // remove 'h'/"hh" 201 164 } else if ( checkZ( str[last] ) ) { // suffix 'z' ? 202 lnth = 4;165 size = 5; 203 166 str.erase( last, 1 ); // remove 'z' 204 } else { // suffix "ln" ? 205 checkLNInt( str, lnth, size ); 206 } // if 207 208 assert( 0 <= size && size < 6 ); 209 // Constant type is correct for overload resolving. 167 } // if 168 210 169 ret = new ConstantExpr( Constant( new BasicType( noQualifiers, kind[Unsigned][size] ), str, v ) ); 211 if ( Unsigned && size < 2 ) { // hh or h,less than int ?212 // int i = -1uh => 65535 not -1, so cast is necessary for unsigned, which unfortunatelyeliminates warnings for large values.170 if ( Unsigned && size < 2 ) { // less than int ? 171 // int i = -1uh => 65535 not -1, so cast is necessary for unsigned, which eliminates warnings for large values. 213 172 ret = new CastExpr( ret, new BasicType( Type::Qualifiers(), kind[Unsigned][size] ) ); 214 } else if ( lnth != -1 ) { // explicit length ? 215 if ( lnth == 5 ) { // int128 ? 216 size = 5; 217 ret = new CastExpr( ret, new BasicType( Type::Qualifiers(), kind[Unsigned][size] ) ); 218 } else { 219 ret = new CastExpr( ret, new TypeInstType( Type::Qualifiers(), lnthsInt[Unsigned][lnth], false ) ); 220 } // if 173 } else if ( size == 5 ) { // explicit cast to size_t 174 ret = new CastExpr( ret, new TypeInstType( Type::Qualifiers(), "size_t", false ) ); 221 175 } // if 222 176 CLEANUP: … … 228 182 return ret; 229 183 } // 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 size236 lnth = 0;237 posn += 1; // advance to size238 if ( str[posn] == '3' ) { // 32239 size = 0;240 } else if ( str[posn] == '6' ) { // 64241 size = 1;242 } else if ( str[posn] == '8' || str[posn] == '1' ) { // 80, 128243 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 } // if248 posn += 1;249 str.erase( start, posn - start + 1 ); // remove length suffix250 } // checkLNFloat251 252 184 253 185 Expression * build_constantFloat( string & str ) { … … 257 189 }; 258 190 259 string units; 191 string units; // units 260 192 sepNumeric( str, units ); // separate constant from units 261 193 262 194 bool complx = false; // real, complex 263 int size = 1; // 0 => float, 1 => double, 2 => long double 264 int lnth = -1; // literal length 195 int size = 1; // 0 => float, 1 => double (default), 2 => long double 265 196 // floating-point constant has minimum of 2 characters: 1. or .1 266 197 size_t last = str.length() - 1; … … 280 211 } else if ( checkL( str[last] ) ) { // long double ? 281 212 size = 2; 282 } else {283 size = 1; // double (default)284 checkLNFloat( str, lnth, size );285 213 } // if 286 214 if ( ! complx && checkI( str[last - 1] ) ) { // imaginary ? … … 288 216 } // if 289 217 290 assert( 0 <= size && size < 3 );291 218 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 } // if295 219 if ( units.length() != 0 ) { 296 220 ret = new UntypedExpr( new NameExpr( units ), { ret } ); … … 397 321 398 322 NameExpr * build_varref( const string * name ) { 399 NameExpr * expr = new NameExpr( *name );323 NameExpr * expr = new NameExpr( *name, nullptr ); 400 324 delete name; 401 325 return expr; … … 488 412 list< Expression * > args; 489 413 buildMoveList( expr_node, args ); 490 return new UntypedExpr( maybeMoveBuild< Expression >(function), args );414 return new UntypedExpr( maybeMoveBuild< Expression >(function), args, nullptr ); 491 415 } // build_func 492 416 -
src/Parser/ParseNode.h
r3f7e12cb r78315272 10 10 // Created On : Sat May 16 13:28:16 2015 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Sat Sep 23 18:11:22201713 // Update Count : 8 2112 // Last Modified On : Thu Sep 14 23:09:39 2017 13 // Update Count : 815 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; 49 51 extern YYLTYPE yylloc; 50 52 … … 195 197 class DeclarationNode : public ParseNode { 196 198 public: 197 // These enumerations must harmonize with their names. 198 enum BasicType { Void, Bool, Char, Int, Float, Double, LongDouble, Int128, Float80, Float128, NoBasicType }; 199 enum BasicType { Void, Bool, Char, Int, Float, Double, LongDouble, NoBasicType }; 200 enum ComplexType { Complex, Imaginary, NoComplexType }; 201 enum Signedness { Signed, Unsigned, NoSignedness }; 202 enum Length { Short, Long, LongLong, NoLength }; 203 enum Aggregate { Struct, Union, Trait, Coroutine, Monitor, Thread, NoAggregate }; 204 enum TypeClass { Otype, Dtype, Ftype, Ttype, NoTypeClass }; 205 enum BuiltinType { Valist, Zero, One, NoBuiltinType }; 206 199 207 static const char * basicTypeNames[]; 200 enum ComplexType { Complex, Imaginary, NoComplexType };201 208 static const char * complexTypeNames[]; 202 enum Signedness { Signed, Unsigned, NoSignedness };203 209 static const char * signednessNames[]; 204 enum Length { Short, Long, LongLong, NoLength };205 210 static const char * lengthNames[]; 206 enum Aggregate { Struct, Union, Trait, Coroutine, Monitor, Thread, NoAggregate };207 211 static const char * aggregateNames[]; 208 enum TypeClass { Otype, Dtype, Ftype, Ttype, NoTypeClass };209 212 static const char * typeClassNames[]; 210 enum BuiltinType { Valist, Zero, One, NoBuiltinType };211 213 static const char * builtinTypeNames[]; 212 214 -
src/Parser/StatementNode.cc
r3f7e12cb r78315272 234 234 target, 235 235 maybeMoveBuild<Statement >( stmt ), 236 notZeroExpr( maybeMoveBuild<Expression>( when ))236 maybeMoveBuild<Expression>( when ) 237 237 }); 238 238 … … 250 250 delete targetExpr; 251 251 252 node->clauses. insert( node->clauses.begin(),WaitForStmt::Clause{252 node->clauses.push_back( WaitForStmt::Clause{ 253 253 std::move( target ), 254 254 maybeMoveBuild<Statement >( stmt ), 255 notZeroExpr( maybeMoveBuild<Expression>( when ))255 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 = notZeroExpr( maybeMoveBuild<Expression>( when ));267 node->timeout.condition = maybeMoveBuild<Expression>( when ); 268 268 } 269 269 else { 270 node->orelse.statement = maybeMoveBuild<Statement >( stmt );271 node->orelse.condition = notZeroExpr( maybeMoveBuild<Expression>( when ));270 node->orelse.statement = maybeMoveBuild<Statement >( stmt ); 271 node->orelse.condition = maybeMoveBuild<Expression>( when ); 272 272 } 273 273 … … 280 280 node->timeout.time = maybeMoveBuild<Expression>( timeout ); 281 281 node->timeout.statement = maybeMoveBuild<Statement >( stmt ); 282 node->timeout.condition = notZeroExpr( maybeMoveBuild<Expression>( when ));282 node->timeout.condition = maybeMoveBuild<Expression>( when ); 283 283 284 284 node->orelse.statement = maybeMoveBuild<Statement >( else_stmt ); 285 node->orelse.condition = notZeroExpr( maybeMoveBuild<Expression>( else_when ));285 node->orelse.condition = 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 // } 289 295 290 296 Statement *build_compound( StatementNode *first ) { -
src/Parser/TypeData.cc
r3f7e12cb r78315272 10 10 // Created On : Sat May 16 15:12:51 2015 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Mon Sep 25 18:33:41201713 // Update Count : 5 8712 // Last Modified On : Fri Sep 1 23:13:38 2017 13 // Update Count : 569 14 14 // 15 15 … … 98 98 } // TypeData::TypeData 99 99 100 101 100 TypeData::~TypeData() { 102 101 delete base; … … 162 161 } // switch 163 162 } // TypeData::~TypeData 164 165 163 166 164 TypeData * TypeData::clone() const { … … 237 235 } // TypeData::clone 238 236 239 240 237 void TypeData::print( ostream &os, int indent ) const { 241 238 for ( int i = 0; i < Type::NumTypeQualifier; i += 1 ) { … … 402 399 } // TypeData::print 403 400 404 405 401 template< typename ForallList > 406 402 void buildForall( const DeclarationNode * firstNode, ForallList &outputList ) { 407 403 buildList( firstNode, outputList ); 408 auto n = firstNode; 409 for ( typename ForallList::iterator i = outputList.begin(); i != outputList.end(); ++i, n = (DeclarationNode*)n->get_next() ) { 404 for ( typename ForallList::iterator i = outputList.begin(); i != outputList.end(); ++i ) { 410 405 TypeDecl * td = static_cast<TypeDecl *>(*i); 411 if ( n->variable.tyClass == DeclarationNode::Otype) {406 if ( td->get_kind() == TypeDecl::Any ) { 412 407 // add assertion parameters to `type' tyvars in reverse order 413 408 // add dtor: void ^?{}(T *) … … 435 430 } // if 436 431 } // for 437 } // buildForall 438 432 } 439 433 440 434 Type * typebuild( const TypeData * td ) { … … 483 477 } // typebuild 484 478 485 486 479 TypeData * typeextractAggregate( const TypeData * td, bool toplevel ) { 487 480 TypeData * ret = nullptr; … … 511 504 } // typeextractAggregate 512 505 513 514 506 Type::Qualifiers buildQualifiers( const TypeData * td ) { 515 507 return td->qualifiers; 516 508 } // buildQualifiers 517 509 518 519 static string genTSError( string msg, DeclarationNode::BasicType basictype ) {520 throw SemanticError( string( "invalid type specifier \"" ) + msg + "\" for type \"" + DeclarationNode::basicTypeNames[basictype] + "\"." );521 } // genTSError522 523 510 Type * buildBasicType( const TypeData * td ) { 524 511 BasicType::Kind ret; … … 526 513 switch ( td->basictype ) { 527 514 case DeclarationNode::Void: 528 if ( td->signedness != DeclarationNode::NoSignedness ) { 529 genTSError( DeclarationNode::signednessNames[ td->signedness ], td->basictype ); 530 } // if 531 if ( td->length != DeclarationNode::NoLength ) { 532 genTSError( DeclarationNode::lengthNames[ td->length ], td->basictype ); 533 } // if 515 if ( td->signedness != DeclarationNode::NoSignedness && td->length != DeclarationNode::NoLength ) { 516 throw SemanticError( "invalid type specifier \"void\" in type: ", td ); 517 } // if 518 534 519 return new VoidType( buildQualifiers( td ) ); 535 520 break; … … 537 522 case DeclarationNode::Bool: 538 523 if ( td->signedness != DeclarationNode::NoSignedness ) { 539 genTSError( DeclarationNode::signednessNames[ td->signedness ], td->basictype);524 throw SemanticError( string( "invalid type specifier " ) + DeclarationNode::signednessNames[ td->signedness ] + " in type: ", td ); 540 525 } // if 541 526 if ( td->length != DeclarationNode::NoLength ) { 542 genTSError( DeclarationNode::lengthNames[ td->length ], td->basictype);527 throw SemanticError( string( "invalid type specifier " ) + DeclarationNode::lengthNames[ td->length ] + " in type: ", td ); 543 528 } // if 544 529 … … 553 538 554 539 if ( td->length != DeclarationNode::NoLength ) { 555 genTSError( DeclarationNode::lengthNames[ td->length ], td->basictype);540 throw SemanticError( string( "invalid type specifier " ) + DeclarationNode::lengthNames[ td->length ] + " in type: ", td ); 556 541 } // if 557 542 … … 572 557 break; 573 558 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 } // if579 break;580 581 559 case DeclarationNode::Float: 582 case DeclarationNode::Float80:583 case DeclarationNode::Float128:584 560 case DeclarationNode::Double: 585 561 case DeclarationNode::LongDouble: // not set until below … … 592 568 FloatingPoint: ; 593 569 if ( td->signedness != DeclarationNode::NoSignedness ) { 594 genTSError( DeclarationNode::signednessNames[ td->signedness ], td->basictype);570 throw SemanticError( string( "invalid type specifier " ) + DeclarationNode::signednessNames[ td->signedness ] + " in type: ", td ); 595 571 } // if 596 572 if ( td->length == DeclarationNode::Short || td->length == DeclarationNode::LongLong ) { 597 genTSError( DeclarationNode::lengthNames[ td->length ], td->basictype);573 throw SemanticError( string( "invalid type specifier " ) + DeclarationNode::lengthNames[ td->length ] + " in type: ", td ); 598 574 } // if 599 575 if ( td->basictype == DeclarationNode::Float && td->length == DeclarationNode::Long ) { 600 genTSError( DeclarationNode::lengthNames[ td->length ], td->basictype);576 throw SemanticError( "invalid type specifier \"long\" in type: ", td ); 601 577 } // if 602 578 if ( td->length == DeclarationNode::Long ) { … … 617 593 goto Integral; 618 594 default: 619 assert f( false, "unknown basic type");595 assert(false); 620 596 return nullptr; 621 597 } // switch … … 625 601 return bt; 626 602 } // buildBasicType 627 628 603 629 604 PointerType * buildPointer( const TypeData * td ) { … … 637 612 return pt; 638 613 } // buildPointer 639 640 614 641 615 ArrayType * buildArray( const TypeData * td ) { … … 652 626 } // buildArray 653 627 654 655 628 ReferenceType * buildReference( const TypeData * td ) { 656 629 ReferenceType * rt; … … 664 637 } // buildReference 665 638 666 667 639 AggregateDecl * buildAggregate( const TypeData * td, std::list< Attribute * > attributes, LinkageSpec::Spec linkage ) { 668 640 assert( td->kind == TypeData::Aggregate ); … … 693 665 return at; 694 666 } // buildAggregate 695 696 667 697 668 ReferenceToType * buildComAggInst( const TypeData * type, std::list< Attribute * > attributes, LinkageSpec::Spec linkage ) { … … 751 722 } // buildAggInst 752 723 753 754 724 ReferenceToType * buildAggInst( const TypeData * td ) { 755 725 assert( td->kind == TypeData::AggregateInst ); … … 791 761 } // buildAggInst 792 762 793 794 763 NamedTypeDecl * buildSymbolic( const TypeData * td, const string & name, Type::StorageClasses scs, LinkageSpec::Spec linkage ) { 795 764 assert( td->kind == TypeData::Symbolic ); … … 799 768 ret = new TypedefDecl( name, scs, typebuild( td->base ), linkage ); 800 769 } else { 801 ret = new TypeDecl( name, scs, typebuild( td->base ), TypeDecl:: Dtype, true);770 ret = new TypeDecl( name, scs, typebuild( td->base ), TypeDecl::Any ); 802 771 } // if 803 772 buildList( td->symbolic.params, ret->get_parameters() ); … … 805 774 return ret; 806 775 } // buildSymbolic 807 808 776 809 777 EnumDecl * buildEnum( const TypeData * td, std::list< Attribute * > attributes, LinkageSpec::Spec linkage ) { … … 822 790 } // buildEnum 823 791 824 825 792 TypeInstType * buildSymbolicInst( const TypeData * td ) { 826 793 assert( td->kind == TypeData::SymbolicInst ); … … 830 797 return ret; 831 798 } // buildSymbolicInst 832 833 799 834 800 TupleType * buildTuple( const TypeData * td ) { … … 841 807 } // buildTuple 842 808 843 844 809 TypeofType * buildTypeof( const TypeData * td ) { 845 810 assert( td->kind == TypeData::Typeof ); … … 848 813 return new TypeofType( buildQualifiers( td ), td->typeexpr->build() ); 849 814 } // buildTypeof 850 851 815 852 816 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 ) { … … 872 836 return nullptr; 873 837 } // buildDecl 874 875 838 876 839 FunctionType * buildFunction( const TypeData * td ) { … … 894 857 return ft; 895 858 } // buildFunction 896 897 859 898 860 // Transform KR routine declarations into C99 routine declarations: -
src/Parser/lex.ll
r3f7e12cb r78315272 10 10 * Created On : Sat Sep 22 08:58:10 2001 11 11 * Last Modified By : Peter A. Buhr 12 * Last Modified On : Wed Oct 25 13:53:56201713 * Update Count : 6 3412 * Last Modified On : Sun Sep 10 22:29:15 2017 13 * Update Count : 620 14 14 */ 15 15 … … 93 93 // numeric constants, CFA: '_' in constant 94 94 hex_quad {hex}("_"?{hex}){3} 95 size_opt (8|16|32|64|128)? 96 length ("ll"|"LL"|[lL]{size_opt})|("hh"|"HH"|[hH]) 95 length ("ll"|"LL"|[lL])|("hh"|"HH"|[hH]) 97 96 integer_suffix_opt ("_"?(([uU]({length}?[iI]?)|([iI]{length}))|([iI]({length}?[uU]?)|([uU]{length}))|({length}([iI]?[uU]?)|([uU][iI]))|[zZ]))?{user_suffix_opt} 98 97 … … 110 109 // GCC: D (double) and iI (imaginary) suffixes, and DL (long double) 111 110 exponent "_"?[eE]"_"?[+-]?{decimal_digits} 112 floating_size 32|64|80|128 113 floating_length ([fFdDlL]|[lL]{floating_size}) 114 floating_suffix ({floating_length}?[iI]?)|([iI]{floating_length}) 111 floating_suffix ([fFdDlL]?[iI]?)|([iI][lLfFdD]) 115 112 floating_suffix_opt ("_"?({floating_suffix}|"DL"))?{user_suffix_opt} 116 113 decimal_digits ({decimal})|({decimal}({decimal}|"_")*{decimal}) … … 233 230 __extension__ { KEYWORD_RETURN(EXTENSION); } // GCC 234 231 extern { KEYWORD_RETURN(EXTERN); } 232 fallthrough { KEYWORD_RETURN(FALLTHRU); } // CFA 235 233 fallthru { KEYWORD_RETURN(FALLTHRU); } // CFA 236 fallthrough { KEYWORD_RETURN(FALLTHROUGH); } // CFA237 234 finally { KEYWORD_RETURN(FINALLY); } // CFA 238 235 float { KEYWORD_RETURN(FLOAT); } 239 __float80 { KEYWORD_RETURN(FLOAT80); } // GCC 240 float80 { KEYWORD_RETURN(FLOAT80); } // GCC 241 __float128 { KEYWORD_RETURN(FLOAT128); } // GCC 242 float128 { KEYWORD_RETURN(FLOAT128); } // GCC 236 __float128 { KEYWORD_RETURN(FLOAT); } // GCC 243 237 for { KEYWORD_RETURN(FOR); } 244 238 forall { KEYWORD_RETURN(FORALL); } // CFA … … 255 249 __inline__ { KEYWORD_RETURN(INLINE); } // GCC 256 250 int { KEYWORD_RETURN(INT); } 257 __int128 { KEYWORD_RETURN(INT 128); } // GCC258 int128 { KEYWORD_RETURN(INT128); } // GCC251 __int128 { KEYWORD_RETURN(INT); } // GCC 252 __int128_t { KEYWORD_RETURN(INT); } // GCC 259 253 __label__ { KEYWORD_RETURN(LABEL); } // GCC 260 254 long { KEYWORD_RETURN(LONG); } … … 291 285 __typeof { KEYWORD_RETURN(TYPEOF); } // GCC 292 286 __typeof__ { KEYWORD_RETURN(TYPEOF); } // GCC 287 __uint128_t { KEYWORD_RETURN(INT); } // GCC 293 288 union { KEYWORD_RETURN(UNION); } 294 289 unsigned { KEYWORD_RETURN(UNSIGNED); } -
src/Parser/parser.yy
r3f7e12cb r78315272 10 10 // Created On : Sat Sep 1 20:22:55 2001 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Wed Oct 25 12:28:54201713 // Update Count : 28 9312 // Last Modified On : Thu Sep 14 23:07:12 2017 13 // Update Count : 2815 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 // more information in syntax errors45 #define YYERROR_VERBOSE 46 46 47 47 #undef __GNUC_MINOR__ … … 117 117 bool forall = false; // aggregate have one or more forall qualifiers ? 118 118 119 // https://www.gnu.org/software/bison/manual/bison.html#Location-Type 120 #define YYLLOC_DEFAULT(Cur, Rhs, N) \ 121 if ( N ) { \ 122 (Cur).first_line = YYRHSLOC( Rhs, 1 ).first_line; \ 123 (Cur).first_column = YYRHSLOC( Rhs, 1 ).first_column; \ 124 (Cur).last_line = YYRHSLOC( Rhs, N ).last_line; \ 125 (Cur).last_column = YYRHSLOC( Rhs, N ).last_column; \ 126 (Cur).filename = YYRHSLOC( Rhs, 1 ).filename; \ 127 } else { \ 128 (Cur).first_line = (Cur).last_line = YYRHSLOC( Rhs, 0 ).last_line; \ 129 (Cur).first_column = (Cur).last_column = YYRHSLOC( Rhs, 0 ).last_column; \ 130 (Cur).filename = YYRHSLOC( Rhs, 0 ).filename; \ 131 } 119 # define YYLLOC_DEFAULT(Cur, Rhs, N) \ 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) 132 135 %} 133 136 134 137 %define parse.error verbose 135 138 136 // Types declaration for productions139 // Types declaration 137 140 %union 138 141 { … … 170 173 %token VOID CHAR SHORT INT LONG FLOAT DOUBLE SIGNED UNSIGNED 171 174 %token BOOL COMPLEX IMAGINARY // C99 172 %token INT128 FLOAT80 FLOAT128 // GCC173 175 %token ZERO_T ONE_T // CFA 174 176 %token VALIST // GCC … … 180 182 %token ATTRIBUTE EXTENSION // GCC 181 183 %token IF ELSE SWITCH CASE DEFAULT DO WHILE FOR BREAK CONTINUE GOTO RETURN 182 %token CHOOSE DISABLE ENABLE FALLTHRU FALLTHROUGHTRY CATCH CATCHRESUME FINALLY THROW THROWRESUME AT WITH WHEN WAITFOR // CFA184 %token CHOOSE DISABLE ENABLE FALLTHRU TRY CATCH CATCHRESUME FINALLY THROW THROWRESUME AT WITH WHEN WAITFOR // CFA 183 185 %token ASM // C99, extension ISO/IEC 9899:1999 Section J.5.10(1) 184 186 %token ALIGNAS ALIGNOF GENERIC STATICASSERT // C11 … … 250 252 %type<sn> exception_statement handler_clause finally_clause 251 253 %type<catch_kind> handler_key 252 %type<sn> mutex_statement253 254 %type<en> when_clause when_clause_opt waitfor timeout 254 255 %type<sn> waitfor_statement … … 362 363 %precedence ELSE // token precedence for start of else clause in IF/WAITFOR statement 363 364 364 %locations // support location tracking for error messages365 %locations 365 366 366 367 %start translation_unit // parse-tree root … … 457 458 | '(' compound_statement ')' // GCC, lambda expression 458 459 { $$ = new ExpressionNode( new StmtExpr( dynamic_cast< CompoundStmt * >(maybeMoveBuild< Statement >($2) ) ) ); } 460 | primary_expression '{' argument_expression_list '}' // CFA, constructor call 461 { 462 Token fn; 463 fn.str = new std::string( "?{}" ); // location undefined - use location of '{'? 464 $$ = new ExpressionNode( new ConstructorExpr( build_func( new ExpressionNode( build_varref( fn ) ), (ExpressionNode *)( $1 )->set_last( $3 ) ) ) ); 465 } 459 466 | type_name '.' no_attr_identifier // CFA, nested type 460 { throw SemanticError("Qualified names are currently unimplemented.");$$ = nullptr; } // FIX ME467 { $$ = nullptr; } // FIX ME 461 468 | type_name '.' '[' push field_list pop ']' // CFA, nested type / tuple field selector 462 { throw SemanticError("Qualified names are currently unimplemented.");$$ = nullptr; } // FIX ME469 { $$ = nullptr; } // FIX ME 463 470 ; 464 471 … … 471 478 // equivalent to the old x[i,j]. 472 479 { $$ = new ExpressionNode( build_binary_val( OperKinds::Index, $1, $4 ) ); } 473 | postfix_expression '{' argument_expression_list '}' // CFA, constructor call474 {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 }479 480 | postfix_expression '(' argument_expression_list ')' 480 481 { $$ = new ExpressionNode( build_func( $1, $3 ) ); } … … 808 809 | jump_statement 809 810 | with_statement 810 | mutex_statement811 811 | waitfor_statement 812 812 | exception_statement … … 974 974 ; 975 975 976 fall_through _name:// CFA976 fall_through: // CFA 977 977 FALLTHRU 978 | FALLTHROUGH979 ;980 981 fall_through: // CFA982 fall_through_name983 978 { $$ = nullptr; } 984 | fall_through_name';'979 | FALLTHRU ';' 985 980 { $$ = nullptr; } 986 981 ; … … 1038 1033 ; 1039 1034 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 ')' statement1043 { $$ = nullptr; } // FIX ME1044 ;1045 1046 1035 when_clause: 1047 1036 WHEN '(' comma_expression ')' … … 1562 1551 | VOLATILE 1563 1552 { $$ = DeclarationNode::newTypeQualifier( Type::Volatile ); } 1553 | MUTEX 1554 { $$ = DeclarationNode::newTypeQualifier( Type::Mutex ); } 1564 1555 | ATOMIC 1565 1556 { $$ = DeclarationNode::newTypeQualifier( Type::Atomic ); } … … 1615 1606 1616 1607 basic_type_name: 1617 VOID 1608 CHAR 1609 { $$ = DeclarationNode::newBasicType( DeclarationNode::Char ); } 1610 | DOUBLE 1611 { $$ = DeclarationNode::newBasicType( DeclarationNode::Double ); } 1612 | FLOAT 1613 { $$ = DeclarationNode::newBasicType( DeclarationNode::Float ); } 1614 | INT 1615 { $$ = DeclarationNode::newBasicType( DeclarationNode::Int ); } 1616 | LONG 1617 { $$ = DeclarationNode::newLength( DeclarationNode::Long ); } 1618 | SHORT 1619 { $$ = DeclarationNode::newLength( DeclarationNode::Short ); } 1620 | SIGNED 1621 { $$ = DeclarationNode::newSignedNess( DeclarationNode::Signed ); } 1622 | UNSIGNED 1623 { $$ = DeclarationNode::newSignedNess( DeclarationNode::Unsigned ); } 1624 | VOID 1618 1625 { $$ = DeclarationNode::newBasicType( DeclarationNode::Void ); } 1619 1626 | BOOL // C99 1620 1627 { $$ = DeclarationNode::newBasicType( DeclarationNode::Bool ); } 1621 | CHAR1622 { $$ = DeclarationNode::newBasicType( DeclarationNode::Char ); }1623 | INT1624 { $$ = DeclarationNode::newBasicType( DeclarationNode::Int ); }1625 | INT1281626 { $$ = DeclarationNode::newBasicType( DeclarationNode::Int128 ); }1627 | FLOAT1628 { $$ = DeclarationNode::newBasicType( DeclarationNode::Float ); }1629 | FLOAT801630 { $$ = DeclarationNode::newBasicType( DeclarationNode::Float80 ); }1631 | FLOAT1281632 { $$ = DeclarationNode::newBasicType( DeclarationNode::Float128 ); }1633 | DOUBLE1634 { $$ = DeclarationNode::newBasicType( DeclarationNode::Double ); }1635 1628 | COMPLEX // C99 1636 1629 { $$ = DeclarationNode::newComplexType( DeclarationNode::Complex ); } 1637 1630 | IMAGINARY // C99 1638 1631 { $$ = DeclarationNode::newComplexType( DeclarationNode::Imaginary ); } 1639 | SIGNED1640 { $$ = DeclarationNode::newSignedNess( DeclarationNode::Signed ); }1641 | UNSIGNED1642 { $$ = DeclarationNode::newSignedNess( DeclarationNode::Unsigned ); }1643 | SHORT1644 { $$ = DeclarationNode::newLength( DeclarationNode::Short ); }1645 | LONG1646 { $$ = DeclarationNode::newLength( DeclarationNode::Long ); }1647 1632 | ZERO_T 1648 1633 { $$ = DeclarationNode::newBuiltinType( DeclarationNode::Zero ); } … … 2491 2476 | TYPEDEFname 2492 2477 | TYPEGENname 2493 | FALLTHROUGH2494 { $$ = Token{ new string( "fallthrough" ), { nullptr, -1 } }; }2495 2478 | CONST 2496 2479 { $$ = Token{ new string( "__const__" ), { nullptr, -1 } }; } … … 2716 2699 paren_identifier attribute_list_opt 2717 2700 { $$ = $1->addQualifiers( $2 ); } 2718 | '&' MUTEX paren_identifier attribute_list_opt2719 { $$ = $3->addPointer( DeclarationNode::newPointer( DeclarationNode::newTypeQualifier( Type::Mutex ), OperKinds::AddressOf ) )->addQualifiers( $4 ); }2720 2701 | identifier_parameter_ptr 2721 2702 | identifier_parameter_array attribute_list_opt … … 2758 2739 // 2759 2740 // typedef int foo; 2760 // forall( otype T ) struct foo;2761 2741 // int f( int foo ); // redefine typedef name in new scope 2762 2742 // … … 2766 2746 typedef attribute_list_opt 2767 2747 { $$ = $1->addQualifiers( $2 ); } 2768 | '&' MUTEX typedef attribute_list_opt2769 { $$ = $3->addPointer( DeclarationNode::newPointer( DeclarationNode::newTypeQualifier( Type::Mutex ), OperKinds::AddressOf ) )->addQualifiers( $4 ); }2770 2748 | type_parameter_ptr 2771 2749 | type_parameter_array attribute_list_opt … … 2914 2892 abstract_parameter_declarator: 2915 2893 abstract_parameter_ptr 2916 | '&' MUTEX attribute_list_opt2917 { $$ = DeclarationNode::newPointer( DeclarationNode::newTypeQualifier( Type::Mutex ), OperKinds::AddressOf )->addQualifiers( $3 ); }2918 2894 | abstract_parameter_array attribute_list_opt 2919 2895 { $$ = $1->addQualifiers( $2 ); } -
src/Parser/parserutility.cc
r3f7e12cb r78315272 29 29 30 30 Expression *notZeroExpr( Expression *orig ) { 31 if( !orig ) return nullptr;32 31 UntypedExpr *comparison = new UntypedExpr( new NameExpr( "?!=?" ) ); 33 32 comparison->get_args().push_back( orig ); -
src/ResolvExpr/AdjustExprType.cc
r3f7e12cb r78315272 14 14 // 15 15 16 #include "Common/PassVisitor.h"17 16 #include "SymTab/Indexer.h" // for Indexer 18 17 #include "SynTree/Declaration.h" // for TypeDecl, TypeDecl::Kind::Ftype … … 22 21 23 22 namespace ResolvExpr { 24 class AdjustExprType : public WithShortCircuiting { 23 class AdjustExprType : public Mutator { 24 typedef Mutator Parent; 25 using Parent::mutate; 25 26 public: 26 27 AdjustExprType( const TypeEnvironment &env, const SymTab::Indexer &indexer ); 27 void premutate( VoidType * ) { visit_children = false; } 28 void premutate( BasicType * ) { visit_children = false; } 29 void premutate( PointerType * ) { visit_children = false; } 30 void premutate( ArrayType * ) { visit_children = false; } 31 void premutate( FunctionType * ) { visit_children = false; } 32 void premutate( StructInstType * ) { visit_children = false; } 33 void premutate( UnionInstType * ) { visit_children = false; } 34 void premutate( EnumInstType * ) { visit_children = false; } 35 void premutate( TraitInstType * ) { visit_children = false; } 36 void premutate( TypeInstType * ) { visit_children = false; } 37 void premutate( TupleType * ) { visit_children = false; } 38 void premutate( VarArgsType * ) { visit_children = false; } 39 void premutate( ZeroType * ) { visit_children = false; } 40 void premutate( OneType * ) { visit_children = false; } 28 private: 29 virtual Type* mutate( VoidType *voidType ); 30 virtual Type* mutate( BasicType *basicType ); 31 virtual Type* mutate( PointerType *pointerType ); 32 virtual Type* mutate( ArrayType *arrayType ); 33 virtual Type* mutate( FunctionType *functionType ); 34 virtual Type* mutate( StructInstType *aggregateUseType ); 35 virtual Type* mutate( UnionInstType *aggregateUseType ); 36 virtual Type* mutate( EnumInstType *aggregateUseType ); 37 virtual Type* mutate( TraitInstType *aggregateUseType ); 38 virtual Type* mutate( TypeInstType *aggregateUseType ); 39 virtual Type* mutate( TupleType *tupleType ); 40 virtual Type* mutate( VarArgsType *varArgsType ); 41 virtual Type* mutate( ZeroType *zeroType ); 42 virtual Type* mutate( OneType *oneType ); 41 43 42 Type * postmutate( ArrayType *arrayType );43 Type * postmutate( FunctionType *functionType );44 Type * postmutate( TypeInstType *aggregateUseType );45 46 private:47 44 const TypeEnvironment &env; 48 45 const SymTab::Indexer &indexer; … … 50 47 51 48 void adjustExprType( Type *&type, const TypeEnvironment &env, const SymTab::Indexer &indexer ) { 52 PassVisitor<AdjustExprType>adjuster( env, indexer );49 AdjustExprType adjuster( env, indexer ); 53 50 Type *newType = type->acceptMutator( adjuster ); 54 51 type = newType; … … 59 56 } 60 57 61 Type * AdjustExprType::postmutate( ArrayType * arrayType ) { 62 PointerType *pointerType = new PointerType( arrayType->get_qualifiers(), arrayType->base ); 63 arrayType->base = nullptr; 58 Type *AdjustExprType::mutate( VoidType *voidType ) { 59 return voidType; 60 } 61 62 Type *AdjustExprType::mutate( BasicType *basicType ) { 63 return basicType; 64 } 65 66 Type *AdjustExprType::mutate( PointerType *pointerType ) { 67 return pointerType; 68 } 69 70 Type *AdjustExprType::mutate( ArrayType *arrayType ) { 71 // need to recursively mutate the base type in order for multi-dimensional arrays to work. 72 PointerType *pointerType = new PointerType( arrayType->get_qualifiers(), arrayType->get_base()->clone()->acceptMutator( *this ) ); 64 73 delete arrayType; 65 74 return pointerType; 66 75 } 67 76 68 Type * AdjustExprType::postmutate( FunctionType * functionType ) { 69 return new PointerType( Type::Qualifiers(), functionType ); 77 Type *AdjustExprType::mutate( FunctionType *functionType ) { 78 PointerType *pointerType = new PointerType( Type::Qualifiers(), functionType ); 79 return pointerType; 70 80 } 71 81 72 Type * AdjustExprType::postmutate( TypeInstType * typeInst ) { 82 Type *AdjustExprType::mutate( StructInstType *aggregateUseType ) { 83 return aggregateUseType; 84 } 85 86 Type *AdjustExprType::mutate( UnionInstType *aggregateUseType ) { 87 return aggregateUseType; 88 } 89 90 Type *AdjustExprType::mutate( EnumInstType *aggregateUseType ) { 91 return aggregateUseType; 92 } 93 94 Type *AdjustExprType::mutate( TraitInstType *aggregateUseType ) { 95 return aggregateUseType; 96 } 97 98 Type *AdjustExprType::mutate( TypeInstType *typeInst ) { 73 99 EqvClass eqvClass; 74 100 if ( env.lookup( typeInst->get_name(), eqvClass ) ) { … … 87 113 return typeInst; 88 114 } 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 } 89 131 } // namespace ResolvExpr 90 132 -
src/ResolvExpr/Alternative.cc
r3f7e12cb r78315272 66 66 } 67 67 68 void Alternative::print( std::ostream &os, Indenterindent ) const {69 os << "Cost " << cost << ": ";68 void Alternative::print( std::ostream &os, int indent ) const { 69 os << std::string( indent, ' ' ) << "Cost " << cost << ": "; 70 70 if ( expr ) { 71 expr->print( os, indent +1);72 os << std::endl << indent <<"(types:" << std::endl;73 os << indent+1;74 expr-> result->print( os, indent+1);75 os << std::endl << indent <<")" << std::endl;71 expr->print( os, indent ); 72 os << "(types:" << std::endl; 73 os << std::string( indent+4, ' ' ); 74 expr->get_result()->print( os, indent + 4 ); 75 os << std::endl << ")" << std::endl; 76 76 } else { 77 77 os << "Null expression!" << std::endl; 78 78 } // if 79 os << indent<< "Environment: ";80 env.print( os, indent+ 1);79 os << std::string( indent, ' ' ) << "Environment: "; 80 env.print( os, indent+2 ); 81 81 os << std::endl; 82 82 } -
src/ResolvExpr/Alternative.h
r3f7e12cb r78315272 39 39 ~Alternative(); 40 40 41 void print( std::ostream &os, Indenter indent = {}) const;41 void print( std::ostream &os, int indent = 0 ) const; 42 42 43 43 Cost cost; -
src/ResolvExpr/AlternativeFinder.cc
r3f7e12cb r78315272 76 76 77 77 namespace { 78 void printAlts( const AltList &list, std::ostream &os, unsigned int indentAmt = 0 ) { 79 Indenter indent = { Indenter::tabsize, indentAmt }; 78 void printAlts( const AltList &list, std::ostream &os, int indent = 0 ) { 80 79 for ( AltList::const_iterator i = list.begin(); i != list.end(); ++i ) { 81 80 i->print( os, indent ); … … 123 122 ) 124 123 mapPlace->second.isAmbiguous = true; 125 } else {126 PRINT(127 std::cerr << "cost " << candidate->cost << " loses to " << mapPlace->second.candidate->cost << std::endl;128 )129 124 } 130 125 } else { … … 132 127 } 133 128 } 129 130 PRINT( 131 std::cerr << "there are " << selected.size() << " alternatives before elimination" << std::endl; 132 ) 134 133 135 134 // accept the alternatives that were unambiguous … … 146 145 expr->get_result()->accept( global_renamer ); 147 146 } 147 148 void referenceToRvalueConversion( Expression *& expr ) { 149 if ( dynamic_cast< ReferenceType * >( expr->get_result() ) ) { 150 // cast away reference from expr 151 expr = new CastExpr( expr, expr->get_result()->stripReferences()->clone() ); 152 } 153 } 148 154 } // namespace 149 150 void referenceToRvalueConversion( Expression *& expr ) {151 if ( dynamic_cast< ReferenceType * >( expr->get_result() ) ) {152 // cast away reference from expr153 expr = new CastExpr( expr, expr->get_result()->stripReferences()->clone() );154 }155 }156 155 157 156 template< typename InputIterator, typename OutputIterator > … … 176 175 } 177 176 178 void AlternativeFinder::find( Expression *expr, bool adjust, bool prune , bool failFast) {177 void AlternativeFinder::find( Expression *expr, bool adjust, bool prune ) { 179 178 expr->accept( *this ); 180 if ( failFast &&alternatives.empty() ) {179 if ( alternatives.empty() ) { 181 180 throw SemanticError( "No reasonable alternatives for expression ", expr ); 182 181 } 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 } 183 187 if ( prune ) { 184 auto oldsize = alternatives.size();185 188 PRINT( 186 189 std::cerr << "alternatives before prune:" << std::endl; … … 189 192 AltList::iterator oldBegin = alternatives.begin(); 190 193 pruneAlternatives( alternatives.begin(), alternatives.end(), front_inserter( alternatives ) ); 191 if ( failFast &&alternatives.begin() == oldBegin ) {194 if ( alternatives.begin() == oldBegin ) { 192 195 std::ostringstream stream; 193 196 AltList winners; 194 197 findMinCost( alternatives.begin(), alternatives.end(), back_inserter( winners ) ); 195 stream << "Cannot choose between " << winners.size() << " alternatives for expression \n";198 stream << "Cannot choose between " << winners.size() << " alternatives for expression "; 196 199 expr->print( stream ); 197 stream << "Alternatives are: \n";198 printAlts( winners, stream, 1);200 stream << "Alternatives are:"; 201 printAlts( winners, stream, 8 ); 199 202 throw SemanticError( stream.str() ); 200 203 } 201 204 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 adjusted210 for ( AltList::iterator i = alternatives.begin(); i != alternatives.end(); ++i ) {211 if ( adjust ) {212 adjustExprType( i->expr->get_result(), i->env, indexer );213 }214 208 } 215 209 … … 221 215 } 222 216 223 void AlternativeFinder::findWithAdjustment( Expression *expr ) { 224 find( expr, true ); 225 } 226 227 void AlternativeFinder::findWithoutPrune( Expression * expr ) { 228 find( expr, true, false ); 229 } 230 231 void AlternativeFinder::maybeFind( Expression * expr ) { 232 find( expr, true, true, false ); 217 void AlternativeFinder::findWithAdjustment( Expression *expr, bool prune ) { 218 find( expr, true, prune ); 233 219 } 234 220 … … 313 299 Cost convCost = conversionCost( actualType, formalType, indexer, env ); 314 300 PRINT( 315 std::cerr << std::endl << "cost is " << convCost << std::endl;301 std::cerr << std::endl << "cost is" << convCost << std::endl; 316 302 ) 317 303 if ( convCost == Cost::infinity ) { … … 319 305 } 320 306 convCost.incPoly( polyCost( formalType, env, indexer ) + polyCost( actualType, env, indexer ) ); 321 PRINT(322 std::cerr << "cost with polycost is " << convCost << std::endl;323 )324 307 return convCost; 325 308 } … … 327 310 Cost computeExpressionConversionCost( Expression *& actualExpr, Type * formalType, const SymTab::Indexer &indexer, const TypeEnvironment & env ) { 328 311 Cost convCost = computeConversionCost( actualExpr->result, formalType, indexer, env ); 329 330 // if there is a non-zero conversion cost, ignoring poly cost, then the expression requires conversion. 331 // ignore poly cost for now, since this requires resolution of the cast to infer parameters and this 332 // does not currently work for the reason stated below. 312 // if ( convCost != Cost::zero ) { 313 314 // xxx - temporary -- ignore poly cost, since this causes some polymorphic functions to be cast, which causes the specialize 315 // pass to try to specialize them, which currently does not work. Once that is fixed, remove the next 3 lines and uncomment the 316 // previous line. 333 317 Cost tmpCost = convCost; 334 318 tmpCost.incPoly( -tmpCost.get_polyCost() ); … … 373 357 if ( function->get_isVarArgs() ) { 374 358 convCost.incUnsafe(); 375 PRINT( std::cerr << "end of formals with varargs function: inc unsafe: " << convCost << std::endl; ; )376 359 // convert reference-typed expressions to value-typed expressions 377 360 referenceToRvalueConversion( *actualExpr ); … … 382 365 } 383 366 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 ) 384 376 convCost += computeExpressionConversionCost( *actualExpr, formalType, indexer, alt.env ); 385 377 ++formal; // can't be in for-loop update because of the continue … … 489 481 Alternative newerAlt( newAlt ); 490 482 newerAlt.env = newEnv; 491 assert f( (*candidate)->get_uniqueId(), "Assertion candidate does not have a unique ID: %s", toString( *candidate ).c_str() );483 assert( (*candidate)->get_uniqueId() ); 492 484 DeclarationWithType *candDecl = static_cast< DeclarationWithType* >( Declaration::declFromId( (*candidate)->get_uniqueId() ) ); 493 485 … … 515 507 std::cerr << std::endl; 516 508 ) 509 ApplicationExpr *appExpr = static_cast< ApplicationExpr* >( newerAlt.expr ); 517 510 // follow the current assertion's ID chain to find the correct set of inferred parameters to add the candidate to (i.e. the set of inferred parameters belonging to the entity which requested the assertion parameter). 518 InferredParams * inferParameters = & newerAlt.expr->get_inferParams();511 InferredParams * inferParameters = &appExpr->get_inferParams(); 519 512 for ( UniqueId id : cur->second.idChain ) { 520 513 inferParameters = (*inferParameters)[ id ].inferParams.get(); … … 793 786 794 787 return ! results.empty(); 795 } 788 } 796 789 797 790 template<typename OutputIterator> 798 void AlternativeFinder::makeFunctionAlternatives( const Alternative &func,799 FunctionType *funcType, const std::vector< AlternativeFinder > &args,791 void AlternativeFinder::makeFunctionAlternatives( const Alternative& func, 792 FunctionType* funcType, const std::vector< AlternativeFinder >& args, 800 793 OutputIterator out ) { 801 794 OpenVarSet funcOpenVars; 802 795 AssertionSet funcNeed, funcHave; 803 TypeEnvironment funcEnv ( func.env );796 TypeEnvironment funcEnv; 804 797 makeUnifiableVars( funcType, funcOpenVars, funcNeed ); 805 798 // add all type variables as open variables now so that those not used in the parameter 806 799 // list are still considered open. 807 800 funcEnv.add( funcType->get_forall() ); 808 801 809 802 if ( targetType && ! targetType->isVoid() && ! funcType->get_returnVals().empty() ) { 810 803 // attempt to narrow based on expected target type 811 Type * returnType = funcType->get_returnVals().front()->get_type();804 Type* returnType = funcType->get_returnVals().front()->get_type(); 812 805 if ( ! unify( returnType, targetType, funcEnv, funcNeed, funcHave, funcOpenVars, 813 806 indexer ) ) { … … 912 905 913 906 // find function operators 914 static NameExpr *opExpr = new NameExpr( "?()" );915 907 AlternativeFinder funcOpFinder( indexer, env ); 916 // it's ok if there aren't any defined function ops 917 funcOpFinder.maybeFind( opExpr); 908 NameExpr *opExpr = new NameExpr( "?()" ); 909 try { 910 funcOpFinder.findWithAdjustment( opExpr ); 911 } catch( SemanticError &e ) { 912 // it's ok if there aren't any defined function ops 913 } 918 914 PRINT( 919 915 std::cerr << "known function ops:" << std::endl; 920 printAlts( funcOpFinder.alternatives, std::cerr, 1);916 printAlts( funcOpFinder.alternatives, std::cerr, 8 ); 921 917 ) 922 918 … … 1032 1028 bool isLvalue( Expression *expr ) { 1033 1029 // xxx - recurse into tuples? 1034 return expr-> result&& ( expr->get_result()->get_lvalue() || dynamic_cast< ReferenceType * >( expr->get_result() ) );1030 return expr->has_result() && ( expr->get_result()->get_lvalue() || dynamic_cast< ReferenceType * >( expr->get_result() ) ); 1035 1031 } 1036 1032 … … 1107 1103 thisCost.incSafe( discardedValues ); 1108 1104 Alternative newAlt( restructureCast( i->expr->clone(), toType ), i->env, i->cost, thisCost ); 1109 inferParameters( needAssertions, haveAssertions, newAlt, openVars, back_inserter( candidates ) ); 1105 // xxx - this doesn't work at the moment, since inferParameters requires an ApplicationExpr as the alternative. 1106 // Once this works, it should be possible to infer parameters on a cast expression and specialize any function. 1107 1108 // inferParameters( needAssertions, haveAssertions, newAlt, openVars, back_inserter( candidates ) ); 1109 candidates.emplace_back( std::move( newAlt ) ); 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 finder.findWithoutPrune( castExpr->get_arg() ); 1125 // (giving the alternatives different types is half of the point of ConstructorExpr nodes) 1126 finder.findWithAdjustment( castExpr->get_arg(), false ); 1126 1127 for ( Alternative & alt : finder.alternatives ) { 1127 1128 alternatives.push_back( Alternative( … … 1162 1163 PRINT( std::cerr << "nameExpr is " << nameExpr->get_name() << std::endl; ) 1163 1164 for ( std::list< DeclarationWithType* >::iterator i = declList.begin(); i != declList.end(); ++i ) { 1164 VariableExpr newExpr( *i );1165 VariableExpr newExpr( *i, nameExpr->get_argName() ); 1165 1166 alternatives.push_back( Alternative( newExpr.clone(), env, Cost::zero ) ); 1166 1167 PRINT( … … 1397 1398 findSubExprs( tupleExpr->get_exprs().begin(), tupleExpr->get_exprs().end(), back_inserter( subExprAlternatives ) ); 1398 1399 std::list< AltList > possibilities; 1400 // TODO re-write to use iterative method 1399 1401 combos( subExprAlternatives.begin(), subExprAlternatives.end(), back_inserter( possibilities ) ); 1400 1402 for ( std::list< AltList >::const_iterator i = possibilities.begin(); i != possibilities.end(); ++i ) { … … 1420 1422 // don't prune here, since it's guaranteed all alternatives will have the same type 1421 1423 // (giving the alternatives different types is half of the point of ConstructorExpr nodes) 1422 finder.findWith outPrune( ctorExpr->get_callExpr());1424 finder.findWithAdjustment( ctorExpr->get_callExpr(), false ); 1423 1425 for ( Alternative & alt : finder.alternatives ) { 1424 1426 alternatives.push_back( Alternative( new ConstructorExpr( alt.expr->clone() ), alt.env, alt.cost ) ); … … 1457 1459 // O(N^2) checks of d-types with e-types 1458 1460 for ( InitAlternative & initAlt : initExpr->get_initAlts() ) { 1459 Type * toType = resolveTypeof( initAlt.type ->clone(), indexer );1461 Type * toType = resolveTypeof( initAlt.type, indexer ); 1460 1462 SymTab::validateType( toType, &indexer ); 1461 1463 adjustExprType( toType, env, indexer ); … … 1486 1488 // count one safe conversion for each value that is thrown away 1487 1489 thisCost.incSafe( discardedValues ); 1488 Alternative newAlt( new InitExpr( restructureCast( alt.expr->clone(), toType ), initAlt.designation->clone() ), newEnv, alt.cost, thisCost ); 1489 inferParameters( needAssertions, haveAssertions, newAlt, openVars, back_inserter( candidates ) ); 1490 candidates.push_back( Alternative( new InitExpr( restructureCast( alt.expr->clone(), toType ), initAlt.designation->clone() ), newEnv, alt.cost, thisCost ) ); 1490 1491 } 1491 1492 } -
src/ResolvExpr/AlternativeFinder.h
r3f7e12cb r78315272 61 61 } 62 62 63 void find( Expression *expr, bool adjust = false, bool prune = true , bool failFast = true);63 void find( Expression *expr, bool adjust = false, bool prune = true ); 64 64 /// Calls find with the adjust flag set; adjustment turns array and function types into equivalent pointer types 65 void findWithAdjustment( Expression *expr ); 66 /// Calls find with the adjust flag set and prune flag unset; pruning ensures there is at most one alternative per result type 67 void findWithoutPrune( Expression *expr ); 68 /// Calls find with the adjust and prune flags set, failFast flags unset; fail fast ensures that there is at least one resulting alternative 69 void maybeFind( Expression *expr ); 65 void findWithAdjustment( Expression *expr, bool prune = true ); 70 66 AltList &get_alternatives() { return alternatives; } 71 67 … … 81 77 const SymTab::Indexer &get_indexer() const { return indexer; } 82 78 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 );88 79 private: 89 80 virtual void visit( ApplicationExpr *applicationExpr ); … … 117 108 virtual void visit( StmtExpr *stmtExpr ); 118 109 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 ); 119 114 120 115 /// Adds alternatives for anonymous members … … 139 134 140 135 Expression *resolveInVoidContext( Expression *expr, const SymTab::Indexer &indexer, TypeEnvironment &env ); 141 void referenceToRvalueConversion( Expression *& expr );142 136 143 137 template< typename InputIterator, typename OutputIterator > -
src/ResolvExpr/CastCost.cc
r3f7e12cb r78315272 24 24 #include "typeops.h" // for typesCompatibleIgnoreQualifiers 25 25 26 #if 027 #define PRINT(x) x28 #else29 #define PRINT(x)30 #endif31 26 32 27 namespace ResolvExpr { … … 57 52 } // if 58 53 } // 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 69 54 if ( typesCompatibleIgnoreQualifiers( src, dest, indexer, env ) ) { 70 PRINT( std::cerr << "compatible!" << std::endl; )71 55 return Cost::zero; 72 56 } else if ( dynamic_cast< VoidType* >( dest ) ) { 73 57 return Cost::safe; 74 58 } else if ( ReferenceType * refType = dynamic_cast< ReferenceType * > ( dest ) ) { 75 PRINT( std::cerr << "conversionCost: dest is reference" << std::endl; )76 59 return convertToReferenceCost( src, refType, indexer, env, [](Type * t1, Type * t2, const TypeEnvironment & env, const SymTab::Indexer & indexer) { 77 60 return ptrsCastable( t1, t2, env, indexer ); -
src/ResolvExpr/CommonType.cc
r3f7e12cb r78315272 10 10 // Created On : Sun May 17 06:59:27 2015 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Mon Sep 25 15:18:17201713 // Update Count : 912 // Last Modified On : Thu Mar 16 16:24:31 2017 13 // Update Count : 7 14 14 // 15 15 … … 61 61 }; 62 62 63 Type * handleReference( Type * t1, Type * t2, bool widenFirst, bool widenSecond, const SymTab::Indexer &indexer, TypeEnvironment & env, const OpenVarSet &openVars ) {64 Type * common = nullptr;63 Type * handleReference( ReferenceType * refType, Type * other, bool widenFirst, bool widenSecond, const SymTab::Indexer &indexer, TypeEnvironment & env, const OpenVarSet &openVars ) { 64 Type * result = nullptr, * common = nullptr; 65 65 AssertionSet have, need; 66 66 OpenVarSet newOpen( openVars ); 67 67 // need unify to bind type variables 68 if ( unify( t1, t2, env, have, need, newOpen, indexer, common ) ) { 69 // std::cerr << "unify success: " << widenFirst << " " << widenSecond << std::endl; 70 if ( (widenFirst || t2->get_qualifiers() <= t1->get_qualifiers()) && (widenSecond || t1->get_qualifiers() <= t2->get_qualifiers()) ) { 71 // std::cerr << "widen okay" << std::endl; 72 common->get_qualifiers() |= t1->get_qualifiers(); 73 common->get_qualifiers() |= t2->get_qualifiers(); 74 return common; 75 } 76 } 77 // std::cerr << "exact unify failed: " << t1 << " " << t2 << std::endl; 78 return nullptr; 68 if ( unify( refType->get_base(), other, env, have, need, newOpen, indexer, common ) ) { 69 // std::cerr << "unify success" << std::endl; 70 if ( widenSecond ) { 71 // std::cerr << "widen second" << std::endl; 72 if ( widenFirst || other->get_qualifiers() <= refType->get_qualifiers() ) { 73 result = new ReferenceType( refType->get_qualifiers(), common ); // refType->clone(); 74 result->get_qualifiers() |= other->get_qualifiers(); 75 } 76 } else if ( widenFirst ) { 77 // std::cerr << "widen first" << std::endl; 78 if ( widenSecond || refType->get_qualifiers() <= other->get_qualifiers() ) { 79 result = common; 80 result->get_qualifiers() |= refType->get_qualifiers(); 81 } 82 } 83 } else { 84 // std::cerr << "exact unify failed: " << refType << " " << other << std::endl; 85 } 86 // std::cerr << "common type of reference [" << refType << "] and non-reference [" << other << "] is [" << result << "]" << std::endl; 87 return result; 79 88 } 80 89 … … 90 99 91 100 // special case where one type has a reference depth of 1 larger than the other 92 if ( diff > 0 || diff < 0 ) { 93 Type * result = nullptr; 94 if ( ReferenceType * ref1 = dynamic_cast< ReferenceType * >( type1 ) ) { 95 // formal is reference, so result should be reference 96 result = handleReference( ref1->base, type2, widenFirst, widenSecond, indexer, env, openVars ); 97 if ( result ) result = new ReferenceType( ref1->get_qualifiers(), result ); 98 } else { 99 // formal is value, so result should be value 100 ReferenceType * ref2 = strict_dynamic_cast< ReferenceType * > ( type2 ); 101 result = handleReference( type1, ref2->base, widenFirst, widenSecond, indexer, env, openVars ); 102 } 103 // std::cerr << "common type of reference [" << type1 << "] and [" << type2 << "] is [" << result << "]" << std::endl; 104 return result; 101 if ( diff > 0 ) { 102 return handleReference( strict_dynamic_cast<ReferenceType *>( type1 ), type2, widenFirst, widenSecond, indexer, env, openVars ); 103 } else if ( diff < 0 ) { 104 return handleReference( strict_dynamic_cast<ReferenceType *>( type2 ), type1, widenSecond, widenFirst, indexer, env, openVars ); 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 SignedInt128 UnsignedInt128 */ 153 /* Bool */ { BasicType::Bool, BasicType::Char, BasicType::SignedChar, BasicType::UnsignedChar, BasicType::ShortSignedInt, BasicType::ShortUnsignedInt, BasicType::SignedInt, BasicType::UnsignedInt, BasicType::LongSignedInt, BasicType::LongUnsignedInt, BasicType::LongLongSignedInt, BasicType::LongLongUnsignedInt, BasicType::Float, BasicType::Double, BasicType::LongDouble, BasicType::FloatComplex, BasicType::DoubleComplex, BasicType::LongDoubleComplex, BasicType::FloatComplex, BasicType::DoubleComplex, BasicType::LongDoubleComplex, BasicType::SignedInt128, BasicType::UnsignedInt128, }, 154 /* Char */ { BasicType::Char, BasicType::Char, BasicType::UnsignedChar, BasicType::UnsignedChar, BasicType::ShortSignedInt, BasicType::ShortUnsignedInt, BasicType::SignedInt, BasicType::UnsignedInt, BasicType::LongSignedInt, BasicType::LongUnsignedInt, BasicType::LongLongSignedInt, BasicType::LongLongUnsignedInt, BasicType::Float, BasicType::Double, BasicType::LongDouble, BasicType::FloatComplex, BasicType::DoubleComplex, BasicType::LongDoubleComplex, BasicType::FloatComplex, BasicType::DoubleComplex, BasicType::LongDoubleComplex, BasicType::SignedInt128, BasicType::UnsignedInt128, }, 155 /* SignedChar */ { BasicType::SignedChar, BasicType::UnsignedChar, BasicType::SignedChar, BasicType::UnsignedChar, BasicType::ShortSignedInt, BasicType::ShortUnsignedInt, BasicType::SignedInt, BasicType::UnsignedInt, BasicType::LongSignedInt, BasicType::LongUnsignedInt, BasicType::LongLongSignedInt, BasicType::LongLongUnsignedInt, BasicType::Float, BasicType::Double, BasicType::LongDouble, BasicType::FloatComplex, BasicType::DoubleComplex, BasicType::LongDoubleComplex, BasicType::FloatComplex, BasicType::DoubleComplex, BasicType::LongDoubleComplex, BasicType::SignedInt128, BasicType::UnsignedInt128, }, 156 /* UnsignedChar */ { BasicType::UnsignedChar, BasicType::UnsignedChar, BasicType::UnsignedChar, BasicType::UnsignedChar, BasicType::ShortSignedInt, BasicType::ShortUnsignedInt, BasicType::SignedInt, BasicType::UnsignedInt, BasicType::LongSignedInt, BasicType::LongUnsignedInt, BasicType::LongLongSignedInt, BasicType::LongLongUnsignedInt, BasicType::Float, BasicType::Double, BasicType::LongDouble, BasicType::FloatComplex, BasicType::DoubleComplex, BasicType::LongDoubleComplex, BasicType::FloatComplex, BasicType::DoubleComplex, BasicType::LongDoubleComplex, BasicType::SignedInt128, BasicType::UnsignedInt128, }, 157 /* ShortSignedInt */ { BasicType::ShortSignedInt, BasicType::ShortSignedInt, BasicType::ShortSignedInt, BasicType::ShortSignedInt, BasicType::ShortSignedInt, BasicType::ShortUnsignedInt, BasicType::SignedInt, BasicType::UnsignedInt, BasicType::LongSignedInt, BasicType::LongUnsignedInt, BasicType::LongLongSignedInt, BasicType::LongLongUnsignedInt, BasicType::Float, BasicType::Double, BasicType::LongDouble, BasicType::FloatComplex, BasicType::DoubleComplex, BasicType::LongDoubleComplex, BasicType::FloatComplex, BasicType::DoubleComplex, BasicType::LongDoubleComplex, BasicType::SignedInt128, BasicType::UnsignedInt128, }, 158 /* ShortUnsignedInt */ { BasicType::ShortUnsignedInt, BasicType::ShortUnsignedInt, BasicType::ShortUnsignedInt, BasicType::ShortUnsignedInt, BasicType::ShortUnsignedInt, BasicType::ShortUnsignedInt, BasicType::SignedInt, BasicType::UnsignedInt, BasicType::LongSignedInt, BasicType::LongUnsignedInt, BasicType::LongLongSignedInt, BasicType::LongLongUnsignedInt, BasicType::Float, BasicType::Double, BasicType::LongDouble, BasicType::FloatComplex, BasicType::DoubleComplex, BasicType::LongDoubleComplex, BasicType::FloatComplex, BasicType::DoubleComplex, BasicType::LongDoubleComplex, BasicType::SignedInt128, BasicType::UnsignedInt128, }, 159 /* SignedInt */ { BasicType::SignedInt, BasicType::SignedInt, BasicType::SignedInt, BasicType::SignedInt, BasicType::SignedInt, BasicType::SignedInt, BasicType::SignedInt, BasicType::UnsignedInt, BasicType::LongSignedInt, BasicType::LongUnsignedInt, BasicType::LongLongSignedInt, BasicType::LongLongUnsignedInt, BasicType::Float, BasicType::Double, BasicType::LongDouble, BasicType::FloatComplex, BasicType::DoubleComplex, BasicType::LongDoubleComplex, BasicType::FloatComplex, BasicType::DoubleComplex, BasicType::LongDoubleComplex, BasicType::SignedInt128, BasicType::UnsignedInt128, }, 160 /* UnsignedInt */ { BasicType::UnsignedInt, BasicType::UnsignedInt, BasicType::UnsignedInt, BasicType::UnsignedInt, BasicType::UnsignedInt, BasicType::UnsignedInt, BasicType::UnsignedInt, BasicType::UnsignedInt, BasicType::LongUnsignedInt, BasicType::LongUnsignedInt, BasicType::LongLongSignedInt, BasicType::LongLongUnsignedInt, BasicType::Float, BasicType::Double, BasicType::LongDouble, BasicType::FloatComplex, BasicType::DoubleComplex, BasicType::LongDoubleComplex, BasicType::FloatComplex, BasicType::DoubleComplex, BasicType::LongDoubleComplex, BasicType::SignedInt128, BasicType::UnsignedInt128, }, 161 /* LongSignedInt */ { BasicType::LongSignedInt, BasicType::LongSignedInt, BasicType::LongSignedInt, BasicType::LongSignedInt, BasicType::LongSignedInt, BasicType::LongSignedInt, BasicType::LongSignedInt, BasicType::LongUnsignedInt, BasicType::LongSignedInt, BasicType::LongUnsignedInt, BasicType::LongLongSignedInt, BasicType::LongLongUnsignedInt, BasicType::Float, BasicType::Double, BasicType::LongDouble, BasicType::FloatComplex, BasicType::DoubleComplex, BasicType::LongDoubleComplex, BasicType::FloatComplex, BasicType::DoubleComplex, BasicType::LongDoubleComplex, BasicType::SignedInt128, BasicType::UnsignedInt128, }, 162 /* LongUnsignedInt */ { BasicType::LongUnsignedInt, BasicType::LongUnsignedInt, BasicType::LongUnsignedInt, BasicType::LongUnsignedInt, BasicType::LongUnsignedInt, BasicType::LongUnsignedInt, BasicType::LongUnsignedInt, BasicType::LongUnsignedInt, BasicType::LongUnsignedInt, BasicType::LongUnsignedInt, BasicType::LongLongSignedInt, BasicType::LongLongUnsignedInt, BasicType::Float, BasicType::Double, BasicType::LongDouble, BasicType::FloatComplex, BasicType::DoubleComplex, BasicType::LongDoubleComplex, BasicType::FloatComplex, BasicType::DoubleComplex, BasicType::LongDoubleComplex, BasicType::SignedInt128, BasicType::UnsignedInt128, }, 163 /* LongLongSignedInt */ { BasicType::LongLongSignedInt, BasicType::LongLongSignedInt, BasicType::LongLongSignedInt, BasicType::LongLongSignedInt, BasicType::LongLongSignedInt, BasicType::LongLongSignedInt, BasicType::LongLongSignedInt, BasicType::LongLongSignedInt, BasicType::LongLongSignedInt, BasicType::LongLongSignedInt, BasicType::LongLongSignedInt, BasicType::LongLongUnsignedInt, BasicType::Float, BasicType::Double, BasicType::LongDouble, BasicType::FloatComplex, BasicType::DoubleComplex, BasicType::LongDoubleComplex, BasicType::FloatComplex, BasicType::DoubleComplex, BasicType::LongDoubleComplex, BasicType::SignedInt128, BasicType::UnsignedInt128, }, 164 /* LongLongUnsignedInt */ { BasicType::LongLongUnsignedInt, BasicType::LongLongUnsignedInt, BasicType::LongLongUnsignedInt, BasicType::LongLongUnsignedInt, BasicType::LongLongUnsignedInt, BasicType::LongLongUnsignedInt, BasicType::LongLongUnsignedInt, BasicType::LongLongUnsignedInt, BasicType::LongLongUnsignedInt, BasicType::LongLongUnsignedInt, BasicType::LongLongUnsignedInt, BasicType::LongLongUnsignedInt, BasicType::Float, BasicType::Double, BasicType::LongDouble, BasicType::FloatComplex, BasicType::DoubleComplex, BasicType::LongDoubleComplex, BasicType::FloatComplex, BasicType::DoubleComplex, BasicType::LongDoubleComplex, BasicType::SignedInt128, BasicType::UnsignedInt128, }, 165 /* Float */ { BasicType::Float, BasicType::Float, BasicType::Float, BasicType::Float, BasicType::Float, BasicType::Float, BasicType::Float, BasicType::Float, BasicType::Float, BasicType::Float, BasicType::Float, BasicType::Float, BasicType::Float, BasicType::Double, BasicType::LongDouble, BasicType::FloatComplex, BasicType::DoubleComplex, BasicType::LongDoubleComplex, BasicType::FloatComplex, BasicType::DoubleComplex, BasicType::LongDoubleComplex, BasicType::Float, BasicType::Float, }, 166 /* Double */ { BasicType::Double, BasicType::Double, BasicType::Double, BasicType::Double, BasicType::Double, BasicType::Double, BasicType::Double, BasicType::Double, BasicType::Double, BasicType::Double, BasicType::Double, BasicType::Double, BasicType::Double, BasicType::Double, BasicType::LongDouble, BasicType::DoubleComplex, BasicType::DoubleComplex, BasicType::LongDoubleComplex, BasicType::DoubleComplex, BasicType::DoubleComplex, BasicType::LongDoubleComplex, BasicType::Double, BasicType::Double, }, 167 /* LongDouble */ { BasicType::LongDouble, BasicType::LongDouble, BasicType::LongDouble, BasicType::LongDouble, BasicType::LongDouble, BasicType::LongDouble, BasicType::LongDouble, BasicType::LongDouble, BasicType::LongDouble, BasicType::LongDouble, BasicType::LongDouble, BasicType::LongDouble, BasicType::LongDouble, BasicType::LongDouble, BasicType::LongDouble, BasicType::LongDoubleComplex, BasicType::LongDoubleComplex, BasicType::LongDoubleComplex, BasicType::LongDoubleComplex, BasicType::LongDoubleComplex, BasicType::LongDoubleComplex, BasicType::LongDouble, BasicType::LongDouble, }, 168 /* FloatComplex */ { BasicType::FloatComplex, BasicType::FloatComplex, BasicType::FloatComplex, BasicType::FloatComplex, BasicType::FloatComplex, BasicType::FloatComplex, BasicType::FloatComplex, BasicType::FloatComplex, BasicType::FloatComplex, BasicType::FloatComplex, BasicType::FloatComplex, BasicType::FloatComplex, BasicType::FloatComplex, BasicType::DoubleComplex, BasicType::LongDoubleComplex, BasicType::FloatComplex, BasicType::DoubleComplex, BasicType::LongDoubleComplex, BasicType::FloatComplex, BasicType::DoubleComplex, BasicType::LongDoubleComplex, BasicType::FloatComplex, BasicType::FloatComplex, }, 169 /* DoubleComplex */ { BasicType::DoubleComplex, BasicType::DoubleComplex, BasicType::DoubleComplex, BasicType::DoubleComplex, BasicType::DoubleComplex, BasicType::DoubleComplex, BasicType::DoubleComplex, BasicType::DoubleComplex, BasicType::DoubleComplex, BasicType::DoubleComplex, BasicType::DoubleComplex, BasicType::DoubleComplex, BasicType::DoubleComplex, BasicType::DoubleComplex, BasicType::LongDoubleComplex, BasicType::DoubleComplex, BasicType::DoubleComplex, BasicType::LongDoubleComplex, BasicType::DoubleComplex, BasicType::DoubleComplex, BasicType::LongDoubleComplex, BasicType::DoubleComplex, BasicType::DoubleComplex, }, 170 /* LongDoubleComplex */ { BasicType::LongDoubleComplex, BasicType::LongDoubleComplex, BasicType::LongDoubleComplex, BasicType::LongDoubleComplex, BasicType::LongDoubleComplex, BasicType::LongDoubleComplex, BasicType::LongDoubleComplex, BasicType::LongDoubleComplex, BasicType::LongDoubleComplex, BasicType::LongDoubleComplex, BasicType::LongDoubleComplex, BasicType::LongDoubleComplex, BasicType::LongDoubleComplex, BasicType::LongDoubleComplex, BasicType::LongDoubleComplex, BasicType::LongDoubleComplex, BasicType::LongDoubleComplex, BasicType::LongDoubleComplex, BasicType::LongDoubleComplex, BasicType::LongDoubleComplex, BasicType::LongDoubleComplex, BasicType::LongDoubleComplex, BasicType::LongDoubleComplex, }, 171 /* FloatImaginary */ { BasicType::FloatComplex, BasicType::FloatComplex, BasicType::FloatComplex, BasicType::FloatComplex, BasicType::FloatComplex, BasicType::FloatComplex, BasicType::FloatComplex, BasicType::FloatComplex, BasicType::FloatComplex, BasicType::FloatComplex, BasicType::FloatComplex, BasicType::FloatComplex, BasicType::FloatComplex, BasicType::DoubleComplex, BasicType::LongDoubleComplex, BasicType::FloatComplex, BasicType::DoubleComplex, BasicType::LongDoubleComplex, BasicType::FloatImaginary, BasicType::DoubleImaginary, BasicType::LongDoubleImaginary, BasicType::FloatImaginary, BasicType::FloatImaginary, }, 172 /* DoubleImaginary */ { BasicType::DoubleComplex, BasicType::DoubleComplex, BasicType::DoubleComplex, BasicType::DoubleComplex, BasicType::DoubleComplex, BasicType::DoubleComplex, BasicType::DoubleComplex, BasicType::DoubleComplex, BasicType::DoubleComplex, BasicType::DoubleComplex, BasicType::DoubleComplex, BasicType::DoubleComplex, BasicType::DoubleComplex, BasicType::DoubleComplex, BasicType::LongDoubleComplex, BasicType::DoubleComplex, BasicType::DoubleComplex, BasicType::LongDoubleComplex, BasicType::DoubleImaginary, BasicType::DoubleImaginary, BasicType::LongDoubleImaginary, BasicType::DoubleImaginary, BasicType::DoubleImaginary, }, 173 /* LongDoubleImaginary */ { BasicType::LongDoubleComplex, BasicType::LongDoubleComplex, BasicType::LongDoubleComplex, BasicType::LongDoubleComplex, BasicType::LongDoubleComplex, BasicType::LongDoubleComplex, BasicType::LongDoubleComplex, BasicType::LongDoubleComplex, BasicType::LongDoubleComplex, BasicType::LongDoubleComplex, BasicType::LongDoubleComplex, BasicType::LongDoubleComplex, BasicType::LongDoubleComplex, BasicType::LongDoubleComplex, BasicType::LongDoubleComplex, BasicType::LongDoubleComplex, BasicType::LongDoubleComplex, BasicType::LongDoubleComplex, BasicType::LongDoubleImaginary, BasicType::LongDoubleImaginary, BasicType::LongDoubleImaginary }, 174 /* SignedInt128 */ { BasicType::SignedInt128, BasicType::SignedInt128, BasicType::SignedInt128, BasicType::SignedInt128, BasicType::SignedInt128, BasicType::SignedInt128, BasicType::SignedInt128, BasicType::SignedInt128, BasicType::SignedInt128, BasicType::SignedInt128, BasicType::SignedInt128, BasicType::SignedInt128, BasicType::Float, BasicType::Double, BasicType::LongDouble, BasicType::FloatComplex, BasicType::DoubleComplex, BasicType::LongDoubleComplex, BasicType::FloatComplex, BasicType::DoubleComplex, BasicType::LongDoubleComplex, BasicType::SignedInt128, BasicType::UnsignedInt128, }, 175 /* UnsignedInt128 */ { BasicType::UnsignedInt128, BasicType::UnsignedInt128, BasicType::UnsignedInt128, BasicType::UnsignedInt128, BasicType::UnsignedInt128, BasicType::UnsignedInt128, BasicType::UnsignedInt128, BasicType::UnsignedInt128, BasicType::UnsignedInt128, BasicType::UnsignedInt128, BasicType::UnsignedInt128, BasicType::UnsignedInt128, BasicType::Float, BasicType::Double, BasicType::LongDouble, BasicType::FloatComplex, BasicType::DoubleComplex, BasicType::LongDoubleComplex, BasicType::FloatComplex, BasicType::DoubleComplex, BasicType::LongDoubleComplex, BasicType::UnsignedInt128, BasicType::UnsignedInt128, }, 152 /* Bool Char SignedChar UnsignedChar ShortSignedInt ShortUnsignedInt SignedInt UnsignedInt LongSignedInt LongUnsignedInt LongLongSignedInt LongLongUnsignedInt Float Double LongDouble FloatComplex DoubleComplex LongDoubleComplex FloatImaginary DoubleImaginary LongDoubleImaginary */ 153 /* Bool */ { BasicType::Bool, BasicType::Char, BasicType::SignedChar, BasicType::UnsignedChar, BasicType::ShortSignedInt, BasicType::ShortUnsignedInt, BasicType::SignedInt, BasicType::UnsignedInt, BasicType::LongSignedInt, BasicType::LongUnsignedInt, BasicType::LongLongSignedInt, BasicType::LongLongUnsignedInt, BasicType::Float, BasicType::Double, BasicType::LongDouble, BasicType::FloatComplex, BasicType::DoubleComplex, BasicType::LongDoubleComplex, BasicType::FloatComplex, BasicType::DoubleComplex, BasicType::LongDoubleComplex }, 154 /* Char */ { BasicType::Char, BasicType::Char, BasicType::UnsignedChar, BasicType::UnsignedChar, BasicType::ShortSignedInt, BasicType::ShortUnsignedInt, BasicType::SignedInt, BasicType::UnsignedInt, BasicType::LongSignedInt, BasicType::LongUnsignedInt, BasicType::LongLongSignedInt, BasicType::LongLongUnsignedInt, BasicType::Float, BasicType::Double, BasicType::LongDouble, BasicType::FloatComplex, BasicType::DoubleComplex, BasicType::LongDoubleComplex, BasicType::FloatComplex, BasicType::DoubleComplex, BasicType::LongDoubleComplex }, 155 /* SignedChar */ { BasicType::SignedChar, BasicType::UnsignedChar, BasicType::SignedChar, BasicType::UnsignedChar, BasicType::ShortSignedInt, BasicType::ShortUnsignedInt, BasicType::SignedInt, BasicType::UnsignedInt, BasicType::LongSignedInt, BasicType::LongUnsignedInt, BasicType::LongLongSignedInt, BasicType::LongLongUnsignedInt, BasicType::Float, BasicType::Double, BasicType::LongDouble, BasicType::FloatComplex, BasicType::DoubleComplex, BasicType::LongDoubleComplex, BasicType::FloatComplex, BasicType::DoubleComplex, BasicType::LongDoubleComplex }, 156 /* UnsignedChar */ { BasicType::UnsignedChar, BasicType::UnsignedChar, BasicType::UnsignedChar, BasicType::UnsignedChar, BasicType::ShortSignedInt, BasicType::ShortUnsignedInt, BasicType::SignedInt, BasicType::UnsignedInt, BasicType::LongSignedInt, BasicType::LongUnsignedInt, BasicType::LongLongSignedInt, BasicType::LongLongUnsignedInt, BasicType::Float, BasicType::Double, BasicType::LongDouble, BasicType::FloatComplex, BasicType::DoubleComplex, BasicType::LongDoubleComplex, BasicType::FloatComplex, BasicType::DoubleComplex, BasicType::LongDoubleComplex }, 157 /* ShortSignedInt */ { BasicType::ShortSignedInt, BasicType::ShortSignedInt, BasicType::ShortSignedInt, BasicType::ShortSignedInt, BasicType::ShortSignedInt, BasicType::ShortUnsignedInt, BasicType::SignedInt, BasicType::UnsignedInt, BasicType::LongSignedInt, BasicType::LongUnsignedInt, BasicType::LongLongSignedInt, BasicType::LongLongUnsignedInt, BasicType::Float, BasicType::Double, BasicType::LongDouble, BasicType::FloatComplex, BasicType::DoubleComplex, BasicType::LongDoubleComplex, BasicType::FloatComplex, BasicType::DoubleComplex, BasicType::LongDoubleComplex }, 158 /* ShortUnsignedInt */ { BasicType::ShortUnsignedInt, BasicType::ShortUnsignedInt, BasicType::ShortUnsignedInt, BasicType::ShortUnsignedInt, BasicType::ShortUnsignedInt, BasicType::ShortUnsignedInt, BasicType::SignedInt, BasicType::UnsignedInt, BasicType::LongSignedInt, BasicType::LongUnsignedInt, BasicType::LongLongSignedInt, BasicType::LongLongUnsignedInt, BasicType::Float, BasicType::Double, BasicType::LongDouble, BasicType::FloatComplex, BasicType::DoubleComplex, BasicType::LongDoubleComplex, BasicType::FloatComplex, BasicType::DoubleComplex, BasicType::LongDoubleComplex }, 159 /* SignedInt */ { BasicType::SignedInt, BasicType::SignedInt, BasicType::SignedInt, BasicType::SignedInt, BasicType::SignedInt, BasicType::SignedInt, BasicType::SignedInt, BasicType::UnsignedInt, BasicType::LongSignedInt, BasicType::LongUnsignedInt, BasicType::LongLongSignedInt, BasicType::LongLongUnsignedInt, BasicType::Float, BasicType::Double, BasicType::LongDouble, BasicType::FloatComplex, BasicType::DoubleComplex, BasicType::LongDoubleComplex, BasicType::FloatComplex, BasicType::DoubleComplex, BasicType::LongDoubleComplex }, 160 /* UnsignedInt */ { BasicType::UnsignedInt, BasicType::UnsignedInt, BasicType::UnsignedInt, BasicType::UnsignedInt, BasicType::UnsignedInt, BasicType::UnsignedInt, BasicType::UnsignedInt, BasicType::UnsignedInt, BasicType::LongUnsignedInt, BasicType::LongUnsignedInt, BasicType::LongLongSignedInt, BasicType::LongLongUnsignedInt, BasicType::Float, BasicType::Double, BasicType::LongDouble, BasicType::FloatComplex, BasicType::DoubleComplex, BasicType::LongDoubleComplex, BasicType::FloatComplex, BasicType::DoubleComplex, BasicType::LongDoubleComplex }, 161 /* LongSignedInt */ { BasicType::LongSignedInt, BasicType::LongSignedInt, BasicType::LongSignedInt, BasicType::LongSignedInt, BasicType::LongSignedInt, BasicType::LongSignedInt, BasicType::LongSignedInt, BasicType::LongUnsignedInt, BasicType::LongSignedInt, BasicType::LongUnsignedInt, BasicType::LongLongSignedInt, BasicType::LongLongUnsignedInt, BasicType::Float, BasicType::Double, BasicType::LongDouble, BasicType::FloatComplex, BasicType::DoubleComplex, BasicType::LongDoubleComplex, BasicType::FloatComplex, BasicType::DoubleComplex, BasicType::LongDoubleComplex }, 162 /* LongUnsignedInt */ { BasicType::LongUnsignedInt, BasicType::LongUnsignedInt, BasicType::LongUnsignedInt, BasicType::LongUnsignedInt, BasicType::LongUnsignedInt, BasicType::LongUnsignedInt, BasicType::LongUnsignedInt, BasicType::LongUnsignedInt, BasicType::LongUnsignedInt, BasicType::LongUnsignedInt, BasicType::LongLongSignedInt, BasicType::LongLongUnsignedInt, BasicType::Float, BasicType::Double, BasicType::LongDouble, BasicType::FloatComplex, BasicType::DoubleComplex, BasicType::LongDoubleComplex, BasicType::FloatComplex, BasicType::DoubleComplex, BasicType::LongDoubleComplex }, 163 /* LongLongSignedInt */ { BasicType::LongLongSignedInt, BasicType::LongLongSignedInt, BasicType::LongLongSignedInt, BasicType::LongLongSignedInt, BasicType::LongLongSignedInt, BasicType::LongLongSignedInt, BasicType::LongLongSignedInt, BasicType::LongLongSignedInt, BasicType::LongLongSignedInt, BasicType::LongLongSignedInt, BasicType::LongLongSignedInt, BasicType::LongLongUnsignedInt, BasicType::Float, BasicType::Double, BasicType::LongDouble, BasicType::FloatComplex, BasicType::DoubleComplex, BasicType::LongDoubleComplex, BasicType::FloatComplex, BasicType::DoubleComplex, BasicType::LongDoubleComplex }, 164 /* LongLongUnsignedInt */ { BasicType::LongLongUnsignedInt, BasicType::LongLongUnsignedInt, BasicType::LongLongUnsignedInt, BasicType::LongLongUnsignedInt, BasicType::LongLongUnsignedInt, BasicType::LongLongUnsignedInt, BasicType::LongLongUnsignedInt, BasicType::LongLongUnsignedInt, BasicType::LongLongUnsignedInt, BasicType::LongLongUnsignedInt, BasicType::LongLongUnsignedInt, BasicType::LongLongUnsignedInt, BasicType::Float, BasicType::Double, BasicType::LongDouble, BasicType::FloatComplex, BasicType::DoubleComplex, BasicType::LongDoubleComplex, BasicType::FloatComplex, BasicType::DoubleComplex, BasicType::LongDoubleComplex }, 165 /* Float */ { BasicType::Float, BasicType::Float, BasicType::Float, BasicType::Float, BasicType::Float, BasicType::Float, BasicType::Float, BasicType::Float, BasicType::Float, BasicType::Float, BasicType::Float, BasicType::Float, BasicType::Float, BasicType::Double, BasicType::LongDouble, BasicType::FloatComplex, BasicType::DoubleComplex, BasicType::LongDoubleComplex, BasicType::FloatComplex, BasicType::DoubleComplex, BasicType::LongDoubleComplex }, 166 /* Double */ { BasicType::Double, BasicType::Double, BasicType::Double, BasicType::Double, BasicType::Double, BasicType::Double, BasicType::Double, BasicType::Double, BasicType::Double, BasicType::Double, BasicType::Double, BasicType::Double, BasicType::Double, BasicType::Double, BasicType::LongDouble, BasicType::DoubleComplex, BasicType::DoubleComplex, BasicType::LongDoubleComplex, BasicType::DoubleComplex, BasicType::DoubleComplex, BasicType::LongDoubleComplex }, 167 /* LongDouble */ { BasicType::LongDouble, BasicType::LongDouble, BasicType::LongDouble, BasicType::LongDouble, BasicType::LongDouble, BasicType::LongDouble, BasicType::LongDouble, BasicType::LongDouble, BasicType::LongDouble, BasicType::LongDouble, BasicType::LongDouble, BasicType::LongDouble, BasicType::LongDouble, BasicType::LongDouble, BasicType::LongDouble, BasicType::LongDoubleComplex, BasicType::LongDoubleComplex, BasicType::LongDoubleComplex, BasicType::LongDoubleComplex, BasicType::LongDoubleComplex, BasicType::LongDoubleComplex }, 168 /* FloatComplex */ { BasicType::FloatComplex, BasicType::FloatComplex, BasicType::FloatComplex, BasicType::FloatComplex, BasicType::FloatComplex, BasicType::FloatComplex, BasicType::FloatComplex, BasicType::FloatComplex, BasicType::FloatComplex, BasicType::FloatComplex, BasicType::FloatComplex, BasicType::FloatComplex, BasicType::FloatComplex, BasicType::DoubleComplex, BasicType::LongDoubleComplex, BasicType::FloatComplex, BasicType::DoubleComplex, BasicType::LongDoubleComplex, BasicType::FloatComplex, BasicType::DoubleComplex, BasicType::LongDoubleComplex }, 169 /* DoubleComplex */ { BasicType::DoubleComplex, BasicType::DoubleComplex, BasicType::DoubleComplex, BasicType::DoubleComplex, BasicType::DoubleComplex, BasicType::DoubleComplex, BasicType::DoubleComplex, BasicType::DoubleComplex, BasicType::DoubleComplex, BasicType::DoubleComplex, BasicType::DoubleComplex, BasicType::DoubleComplex, BasicType::DoubleComplex, BasicType::DoubleComplex, BasicType::LongDoubleComplex, BasicType::DoubleComplex, BasicType::DoubleComplex, BasicType::LongDoubleComplex, BasicType::DoubleComplex, BasicType::DoubleComplex, BasicType::LongDoubleComplex }, 170 /* LongDoubleComplex */ { BasicType::LongDoubleComplex, BasicType::LongDoubleComplex, BasicType::LongDoubleComplex, BasicType::LongDoubleComplex, BasicType::LongDoubleComplex, BasicType::LongDoubleComplex, BasicType::LongDoubleComplex, BasicType::LongDoubleComplex, BasicType::LongDoubleComplex, BasicType::LongDoubleComplex, BasicType::LongDoubleComplex, BasicType::LongDoubleComplex, BasicType::LongDoubleComplex, BasicType::LongDoubleComplex, BasicType::LongDoubleComplex, BasicType::LongDoubleComplex, BasicType::LongDoubleComplex, BasicType::LongDoubleComplex, BasicType::LongDoubleComplex, BasicType::LongDoubleComplex, BasicType::LongDoubleComplex }, 171 /* FloatImaginary */ { BasicType::FloatComplex, BasicType::FloatComplex, BasicType::FloatComplex, BasicType::FloatComplex, BasicType::FloatComplex, BasicType::FloatComplex, BasicType::FloatComplex, BasicType::FloatComplex, BasicType::FloatComplex, BasicType::FloatComplex, BasicType::FloatComplex, BasicType::FloatComplex, BasicType::FloatComplex, BasicType::DoubleComplex, BasicType::LongDoubleComplex, BasicType::FloatComplex, BasicType::DoubleComplex, BasicType::LongDoubleComplex, BasicType::FloatImaginary, BasicType::DoubleImaginary, BasicType::LongDoubleImaginary }, 172 /* DoubleImaginary */ { BasicType::DoubleComplex, BasicType::DoubleComplex, BasicType::DoubleComplex, BasicType::DoubleComplex, BasicType::DoubleComplex, BasicType::DoubleComplex, BasicType::DoubleComplex, BasicType::DoubleComplex, BasicType::DoubleComplex, BasicType::DoubleComplex, BasicType::DoubleComplex, BasicType::DoubleComplex, BasicType::DoubleComplex, BasicType::DoubleComplex, BasicType::LongDoubleComplex, BasicType::DoubleComplex, BasicType::DoubleComplex, BasicType::LongDoubleComplex, BasicType::DoubleImaginary, BasicType::DoubleImaginary, BasicType::LongDoubleImaginary }, 173 /* LongDoubleImaginary */ { BasicType::LongDoubleComplex, BasicType::LongDoubleComplex, BasicType::LongDoubleComplex, BasicType::LongDoubleComplex, BasicType::LongDoubleComplex, BasicType::LongDoubleComplex, BasicType::LongDoubleComplex, BasicType::LongDoubleComplex, BasicType::LongDoubleComplex, BasicType::LongDoubleComplex, BasicType::LongDoubleComplex, BasicType::LongDoubleComplex, BasicType::LongDoubleComplex, BasicType::LongDoubleComplex, BasicType::LongDoubleComplex, BasicType::LongDoubleComplex, BasicType::LongDoubleComplex, BasicType::LongDoubleComplex, BasicType::LongDoubleImaginary, BasicType::LongDoubleImaginary, BasicType::LongDoubleImaginary } 176 174 }; 177 175 -
src/ResolvExpr/ConversionCost.cc
r3f7e12cb r78315272 10 10 // Created On : Sun May 17 07:06:19 2015 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Mon Sep 25 15:43:34 201713 // Update Count : 1012 // Last Modified On : Wed Mar 2 17:35:46 2016 13 // Update Count : 6 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 /* Src \ Dest: Bool Char SChar UChar Short UShort Int UInt Long ULong LLong ULLong Float Double LDbl FCplex DCplex LDCplex FImag DImag LDImag I128, U128 */ 223 /* Bool */ { 0, 1, 1, 2, 3, 4, 5, 6, 6, 7, 8, 9, 12, 13, 14, 12, 13, 14, -1, -1, -1, 10, 11, }, 224 /* Char */ { -1, 0, -1, 1, 2, 3, 4, 5, 5, 6, 7, 8, 11, 12, 13, 11, 12, 13, -1, -1, -1, 9, 10, }, 225 /* SChar */ { -1, -1, 0, 1, 2, 3, 4, 5, 5, 6, 7, 8, 11, 12, 13, 11, 12, 13, -1, -1, -1, 9, 10, }, 226 /* UChar */ { -1, -1, -1, 0, 1, 2, 3, 4, 4, 5, 6, 7, 10, 11, 12, 10, 11, 12, -1, -1, -1, 8, 9, }, 227 /* Short */ { -1, -1, -1, -1, 0, 1, 2, 3, 3, 4, 5, 6, 9, 10, 11, 9, 10, 11, -1, -1, -1, 7, 8, }, 228 /* UShort */{ -1, -1, -1, -1, -1, 0, 1, 2, 2, 3, 4, 5, 8, 9, 10, 8, 9, 10, -1, -1, -1, 6, 7, }, 229 /* Int */ { -1, -1, -1, -1, -1, -1, 0, 1, 1, 2, 3, 4, 7, 8, 9, 7, 8, 9, -1, -1, -1, 5, 6, }, 230 /* UInt */ { -1, -1, -1, -1, -1, -1, -1, 0, -1, 1, 2, 3, 6, 7, 8, 6, 7, 8, -1, -1, -1, 4, 5, }, 231 /* Long */ { -1, -1, -1, -1, -1, -1, -1, -1, 0, 1, 2, 3, 6, 7, 8, 6, 7, 8, -1, -1, -1, 4, 5, }, 232 /* ULong */ { -1, -1, -1, -1, -1, -1, -1, -1, -1, 0, 1, 2, 5, 6, 7, 5, 6, 7, -1, -1, -1, 3, 4, }, 233 /* LLong */ { -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 0, 1, 4, 5, 6, 4, 5, 6, -1, -1, -1, 2, 3, }, 234 /* ULLong */{ -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 0, 3, 4, 5, 3, 4, 5, -1, -1, -1, 1, 2, }, 235 236 /* Float */ { -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 0, 1, 2, 1, 2, 3, -1, -1, -1, -1, -1, }, 237 /* Double */{ -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 0, 1, -1, 1, 2, -1, -1, -1, -1, -1, }, 238 /* LDbl */ { -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 0, -1, -1, 1, -1, -1, -1, -1, -1, }, 239 /* FCplex */{ -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 0, 1, 2, -1, -1, -1, -1, -1, }, 240 /* DCplex */{ -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 0, 1, -1, -1, -1, -1, -1, }, 241 /* LDCplex */{ -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 0, -1, -1, -1, -1, -1, }, 242 /* FImag */ { -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 1, 2, 3, 0, 1, 2, -1, -1, }, 243 /* DImag */ { -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 1, 2, -1, 0, 1, -1, -1, }, 244 /* LDImag */{ -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 1, -1, -1, 0, -1, -1, }, 245 246 /* I128 */ { -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 2, 3, 4, 3, 4, 5, -1, -1, -1, 0, 1, }, 247 /* U128 */ { -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 1, 2, 3, 2, 3, 4, -1, -1, -1, -1, 0, }, 221 static const int costMatrix[ BasicType::NUMBER_OF_BASIC_TYPES ][ BasicType::NUMBER_OF_BASIC_TYPES ] = 222 { 223 /* Src \ Dest: Bool Char SChar UChar Short UShort Int UInt Long ULong LLong ULLong Float Double LDbl FCplex DCplex LDCplex FImag DImag LDImag */ 224 /* Bool */ { 0, 1, 1, 2, 3, 4, 5, 6, 6, 7, 8, 9, 10, 11, 12, 11, 12, 13, -1, -1, -1 }, 225 /* Char */ { -1, 0, -1, 1, 2, 3, 4, 5, 5, 6, 7, 8, 9, 10, 11, 10, 11, 12, -1, -1, -1 }, 226 /* SChar */ { -1, -1, 0, 1, 2, 3, 4, 5, 5, 6, 7, 8, 9, 10, 11, 10, 11, 12, -1, -1, -1 }, 227 /* UChar */ { -1, -1, -1, 0, 1, 2, 3, 4, 4, 5, 6, 7, 8, 9, 10, 9, 10, 11, -1, -1, -1 }, 228 /* Short */ { -1, -1, -1, -1, 0, 1, 2, 3, 3, 4, 5, 6, 7, 8, 9, 8, 9, 10, -1, -1, -1 }, 229 /* UShort */{ -1, -1, -1, -1, -1, 0, 1, 2, 2, 3, 4, 5, 6, 7, 8, 7, 8, 9, -1, -1, -1 }, 230 /* Int */ { -1, -1, -1, -1, -1, -1, 0, 1, 1, 2, 3, 4, 5, 6, 7, 6, 7, 8, -1, -1, -1 }, 231 /* UInt */ { -1, -1, -1, -1, -1, -1, -1, 0, -1, 1, 2, 3, 4, 5, 6, 5, 6, 7, -1, -1, -1 }, 232 /* Long */ { -1, -1, -1, -1, -1, -1, -1, -1, 0, 1, 2, 3, 4, 5, 6, 5, 6, 7, -1, -1, -1 }, 233 /* ULong */ { -1, -1, -1, -1, -1, -1, -1, -1, -1, 0, 1, 2, 3, 4, 5, 4, 5, 6, -1, -1, -1 }, 234 /* LLong */ { -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 0, 1, 2, 3, 4, 3, 4, 5, -1, -1, -1 }, 235 /* ULLong */{ -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 0, 1, 2, 3, 2, 3, 4, -1, -1, -1 }, 236 /* Float */ { -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 0, 1, 2, 1, 2, 3, -1, -1, -1 }, 237 /* Double */{ -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 0, 1, -1, 1, 2, -1, -1, -1 }, 238 /* LDbl */ { -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 0, -1, -1, 1, -1, -1, -1 }, 239 /* FCplex */{ -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 0, 1, 2, -1, -1, -1 }, 240 /* DCplex */{ -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 0, 1, -1, -1, -1 }, 241 /* LDCplex */{ -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 0, -1, -1, -1 }, 242 /* FImag */ { -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 1, 2, 3, 0, 1, 2 }, 243 /* DImag */ { -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 1, 2, -1, 0, 1 }, 244 /* LDImag */{ -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 1, -1, -1, 0 } 248 245 }; 249 246 … … 269 266 } 270 267 271 void ConversionCost::visit( PointerType * pointerType) {268 void ConversionCost::visit(PointerType *pointerType) { 272 269 if ( PointerType *destAsPtr = dynamic_cast< PointerType* >( dest ) ) { 273 270 PRINT( std::cerr << pointerType << " ===> " << destAsPtr; ) … … 284 281 } 285 282 } else { // xxx - this discards qualifiers from consideration -- reducing qualifiers is a safe conversion; is this right? 286 int assignResult = ptrsAssignable( pointerType-> base, destAsPtr->base, env );283 int assignResult = ptrsAssignable( pointerType->get_base(), destAsPtr->get_base(), env ); 287 284 PRINT( std::cerr << " :: " << assignResult << std::endl; ) 288 if ( assignResult >0 && pointerType->get_base()->get_qualifiers() <= destAsPtr->get_qualifiers() ) {285 if ( assignResult < 0 && pointerType->get_base()->get_qualifiers() <= destAsPtr->get_qualifiers() ) { 289 286 cost = Cost::safe; 290 } else if ( assignResult <0 ) {287 } else if ( assignResult > 0 ) { 291 288 cost = Cost::unsafe; 292 289 } // if 293 290 // assignResult == 0 means Cost::Infinity 294 291 } // if 295 } else if ( dynamic_cast< ZeroType * >( dest )) {292 } else if ( dynamic_cast< ZeroType* >( dest ) != nullptr || dynamic_cast< OneType* >( dest ) != nullptr ) { 296 293 cost = Cost::unsafe; 297 294 } // if 298 295 } 299 296 300 void ConversionCost::visit( ArrayType *) {}301 302 void ConversionCost::visit( ReferenceType * refType) {297 void ConversionCost::visit(__attribute((unused)) ArrayType *arrayType) {} 298 299 void ConversionCost::visit(ReferenceType *refType) { 303 300 // Note: dest can never be a reference, since it would have been caught in an earlier check 304 301 assert( ! dynamic_cast< ReferenceType * >( dest ) ); … … 306 303 // recursively compute conversion cost from T1 to T2. 307 304 // cv can be safely dropped because of 'implicit dereference' behavior. 308 refType-> base->accept( *this );309 if ( refType-> base->get_qualifiers() == dest->get_qualifiers() ) {305 refType->get_base()->accept( *this ); 306 if ( refType->get_base()->get_qualifiers() == dest->get_qualifiers() ) { 310 307 cost.incReference(); // prefer exact qualifiers 311 } else if ( refType-> base->get_qualifiers() < dest->get_qualifiers() ) {308 } else if ( refType->get_base()->get_qualifiers() < dest->get_qualifiers() ) { 312 309 cost.incSafe(); // then gaining qualifiers 313 310 } else { … … 317 314 } 318 315 319 void ConversionCost::visit( FunctionType *) {}320 321 void ConversionCost::visit( StructInstType * inst) {316 void ConversionCost::visit(__attribute((unused)) FunctionType *functionType) {} 317 318 void ConversionCost::visit(StructInstType *inst) { 322 319 if ( StructInstType *destAsInst = dynamic_cast< StructInstType* >( dest ) ) { 323 if ( inst-> name == destAsInst->name) {324 cost = Cost::zero; 325 } // if 326 } // if 327 } 328 329 void ConversionCost::visit( UnionInstType * inst) {330 if ( UnionInstType *destAsInst = dynamic_cast< UnionInstType* >( dest ) ) {331 if ( inst-> name == destAsInst->name) {332 cost = Cost::zero; 333 } // if 334 } // if 335 } 336 337 void ConversionCost::visit( EnumInstType *) {320 if ( inst->get_name() == destAsInst->get_name() ) { 321 cost = Cost::zero; 322 } // if 323 } // if 324 } 325 326 void ConversionCost::visit(UnionInstType *inst) { 327 if ( StructInstType *destAsInst = dynamic_cast< StructInstType* >( dest ) ) { 328 if ( inst->get_name() == destAsInst->get_name() ) { 329 cost = Cost::zero; 330 } // if 331 } // if 332 } 333 334 void ConversionCost::visit( __attribute((unused)) EnumInstType *inst ) { 338 335 static Type::Qualifiers q; 339 336 static BasicType integer( q, BasicType::SignedInt ); … … 344 341 } 345 342 346 void ConversionCost::visit( TraitInstType * ) {} 347 348 void ConversionCost::visit( TypeInstType *inst ) { 343 void ConversionCost::visit( __attribute((unused)) TraitInstType *inst) { 344 } 345 346 void ConversionCost::visit(TypeInstType *inst) { 349 347 EqvClass eqvClass; 350 348 NamedTypeDecl *namedType; … … 365 363 } 366 364 367 void ConversionCost::visit( TupleType * tupleType) {365 void ConversionCost::visit( __attribute((unused)) TupleType *tupleType) { 368 366 Cost c = Cost::zero; 369 if ( TupleType * destAsTuple = dynamic_cast< TupleType* >( dest ) ) {370 std::list< Type * >::const_iterator srcIt = tupleType->get_types().begin();371 std::list< Type * >::const_iterator destIt = destAsTuple->get_types().begin();367 if ( TupleType *destAsTuple = dynamic_cast< TupleType* >( dest ) ) { 368 std::list< Type* >::const_iterator srcIt = tupleType->get_types().begin(); 369 std::list< Type* >::const_iterator destIt = destAsTuple->get_types().begin(); 372 370 while ( srcIt != tupleType->get_types().end() && destIt != destAsTuple->get_types().end() ) { 373 371 Cost newCost = conversionCost( *srcIt++, *destIt++, indexer, env ); … … 385 383 } 386 384 387 void ConversionCost::visit( VarArgsType *) {385 void ConversionCost::visit( __attribute((unused)) VarArgsType *varArgsType) { 388 386 if ( dynamic_cast< VarArgsType* >( dest ) ) { 389 387 cost = Cost::zero; … … 391 389 } 392 390 393 void ConversionCost::visit( ZeroType *) {394 if ( dynamic_cast< ZeroType * >( dest ) ) {391 void ConversionCost::visit( __attribute((unused)) ZeroType *zeroType) { 392 if ( dynamic_cast< ZeroType* >( dest ) ) { 395 393 cost = Cost::zero; 396 394 } else if ( BasicType *destAsBasic = dynamic_cast< BasicType* >( dest ) ) { … … 408 406 } 409 407 410 void ConversionCost::visit( OneType *) {411 if ( dynamic_cast< OneType * >( dest ) ) {408 void ConversionCost::visit( __attribute((unused)) OneType *oneType) { 409 if ( dynamic_cast< OneType* >( dest ) ) { 412 410 cost = Cost::zero; 413 411 } else if ( BasicType *destAsBasic = dynamic_cast< BasicType* >( dest ) ) { -
src/ResolvExpr/CurrentObject.cc
r3f7e12cb r78315272 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 << ")"; )263 262 init(); 264 263 } -
src/ResolvExpr/PolyCost.cc
r3f7e12cb r78315272 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-> name, eqvClass ) ) {44 if ( env.lookup( typeInst->get_name(), eqvClass ) ) { 45 45 if ( eqvClass.type ) { 46 if ( TypeInstType * otherTypeInst = dynamic_cast< TypeInstType* >( eqvClass.type ) ) { 47 if ( indexer.lookupType( otherTypeInst->name ) ) { 48 // bound to opaque type 46 if ( TypeInstType *otherTypeInst = dynamic_cast< TypeInstType* >( eqvClass.type ) ) { 47 if ( indexer.lookupType( otherTypeInst->get_name() ) ) { 49 48 result += 1; 50 49 } // if 51 50 } else { 52 // bound to concrete type53 51 result += 1; 54 52 } // if -
src/ResolvExpr/PtrsAssignable.cc
r3f7e12cb r78315272 47 47 48 48 int ptrsAssignable( Type *src, Type *dest, const TypeEnvironment &env ) { 49 // std::cerr << "assignable: " << src << " | " << dest << std::endl;50 49 if ( TypeInstType *destAsTypeInst = dynamic_cast< TypeInstType* >( dest ) ) { 51 50 EqvClass eqvClass; … … 55 54 } // if 56 55 if ( dynamic_cast< VoidType* >( dest ) ) { 57 // void * = T * for any T is unsafe 58 // xxx - this should be safe, but that currently breaks the build 59 return -1; 56 return 1; 60 57 } else { 61 58 PtrsAssignable ptrs( dest, env ); … … 68 65 69 66 void PtrsAssignable::visit( __attribute((unused)) VoidType *voidType ) { 70 if ( !dynamic_cast< FunctionType* >( dest ) ) {71 // T * = void * is safe for any T that is not a function type.72 // xxx - this should be unsafe...73 result = 1;67 if ( dynamic_cast< FunctionType* >( dest ) ) { 68 result = 0; 69 } else { 70 result = -1; 74 71 } // if 75 72 } … … 78 75 void PtrsAssignable::visit( __attribute__((unused)) PointerType *pointerType ) {} 79 76 void PtrsAssignable::visit( __attribute__((unused)) ArrayType *arrayType ) {} 80 void PtrsAssignable::visit( __attribute__((unused)) FunctionType *functionType ) {} 77 void PtrsAssignable::visit( __attribute__((unused)) FunctionType *functionType ) { 78 result = -1; 79 } 81 80 82 81 void PtrsAssignable::visit( __attribute__((unused)) StructInstType *inst ) {} … … 84 83 85 84 void PtrsAssignable::visit( EnumInstType * ) { 86 if ( dynamic_cast< BasicType* >( dest ) ) { 87 // int * = E *, etc. is safe. This isn't technically correct, as each 88 // enum has one basic type that it is compatible with, an that type can 89 // differ from enum to enum. Without replicating GCC's internal logic, 90 // there is no way to know which type this particular enum is compatible 91 // with, so punt on this for now. 85 if ( dynamic_cast< EnumInstType* >( dest ) ) { 92 86 result = 1; 87 } else if ( BasicType *bt = dynamic_cast< BasicType* >( dest ) ) { 88 result = bt->get_kind() == BasicType::SignedInt; 93 89 } 94 90 } … … 98 94 EqvClass eqvClass; 99 95 if ( env.lookup( inst->get_name(), eqvClass ) && eqvClass.type ) { 100 // T * = S * for any S depends on the type bound to T101 96 result = ptrsAssignable( eqvClass.type, dest, env ); 97 } else { 98 result = 0; 102 99 } // if 103 100 } -
src/ResolvExpr/PtrsCastable.cc
r3f7e12cb r78315272 50 50 }; 51 51 52 namespace { 53 int objectCast( Type *src, const TypeEnvironment &env, const SymTab::Indexer &indexer ) { 54 if ( dynamic_cast< FunctionType* >( src ) ) { 55 return -1; 56 } else if ( TypeInstType *typeInst = dynamic_cast< TypeInstType* >( src ) ) { 57 EqvClass eqvClass; 58 if ( NamedTypeDecl *ntDecl = indexer.lookupType( typeInst->get_name() ) ) { 59 if ( TypeDecl *tyDecl = dynamic_cast< TypeDecl* >( ntDecl ) ) { 60 if ( tyDecl->get_kind() == TypeDecl::Ftype ) { 61 return -1; 62 } // if 63 } //if 64 } else if ( env.lookup( typeInst->get_name(), eqvClass ) ) { 65 if ( eqvClass.data.kind == TypeDecl::Ftype ) { 52 int objectCast( Type *src, const TypeEnvironment &env, const SymTab::Indexer &indexer ) { 53 if ( dynamic_cast< FunctionType* >( src ) ) { 54 return -1; 55 } else if ( TypeInstType *typeInst = dynamic_cast< TypeInstType* >( src ) ) { 56 EqvClass eqvClass; 57 if ( NamedTypeDecl *ntDecl = indexer.lookupType( typeInst->get_name() ) ) { 58 if ( TypeDecl *tyDecl = dynamic_cast< TypeDecl* >( ntDecl ) ) { 59 if ( tyDecl->get_kind() == TypeDecl::Ftype ) { 66 60 return -1; 67 61 } // if 62 } //if 63 } else if ( env.lookup( typeInst->get_name(), eqvClass ) ) { 64 if ( eqvClass.data.kind == TypeDecl::Ftype ) { 65 return -1; 68 66 } // if 69 } // if70 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 objectCast74 }67 } // if 68 } //if 69 return 1; 70 } 71 int functionCast( Type *src, const TypeEnvironment &env, const SymTab::Indexer &indexer ) { 72 return -1 * objectCast( src, env, indexer ); // reverse the sense of objectCast 75 73 } 76 74 … … 95 93 } 96 94 97 void PtrsCastable::visit( VoidType *) {95 void PtrsCastable::visit( __attribute__((unused)) VoidType *voidType) { 98 96 result = objectCast( dest, env, indexer ); 99 97 } 100 98 101 void PtrsCastable::visit( BasicType *) {99 void PtrsCastable::visit( __attribute__((unused)) BasicType *basicType) { 102 100 result = objectCast( dest, env, indexer ); 103 101 } 104 102 105 void PtrsCastable::visit( PointerType *) {103 void PtrsCastable::visit( __attribute__((unused)) PointerType *pointerType) { 106 104 result = objectCast( dest, env, indexer ); 107 105 } 108 106 109 void PtrsCastable::visit( ArrayType *) {107 void PtrsCastable::visit( __attribute__((unused)) ArrayType *arrayType) { 110 108 result = objectCast( dest, env, indexer ); 111 109 } 112 110 113 void PtrsCastable::visit( FunctionType *) {111 void PtrsCastable::visit( __attribute__((unused)) FunctionType *functionType) { 114 112 // result = -1; 115 113 result = functionCast( dest, env, indexer ); 116 114 } 117 115 118 void PtrsCastable::visit( StructInstType *) {116 void PtrsCastable::visit( __attribute__((unused)) StructInstType *inst) { 119 117 result = objectCast( dest, env, indexer ); 120 118 } 121 119 122 void PtrsCastable::visit( UnionInstType *) {120 void PtrsCastable::visit( __attribute__((unused)) UnionInstType *inst) { 123 121 result = objectCast( dest, env, indexer ); 124 122 } 125 123 126 void PtrsCastable::visit( EnumInstType *) {124 void PtrsCastable::visit( __attribute__((unused)) EnumInstType *inst) { 127 125 if ( dynamic_cast< EnumInstType* >( dest ) ) { 128 126 result = 1; … … 138 136 } 139 137 140 void PtrsCastable::visit( TraitInstType *) {}138 void PtrsCastable::visit( __attribute__((unused)) TraitInstType *inst ) {} 141 139 142 140 void PtrsCastable::visit(TypeInstType *inst) { … … 145 143 } 146 144 147 void PtrsCastable::visit( TupleType *) {145 void PtrsCastable::visit( __attribute__((unused)) TupleType *tupleType) { 148 146 result = objectCast( dest, env, indexer ); 149 147 } 150 148 151 void PtrsCastable::visit( VarArgsType *) {149 void PtrsCastable::visit( __attribute__((unused)) VarArgsType *varArgsType) { 152 150 result = objectCast( dest, env, indexer ); 153 151 } 154 152 155 void PtrsCastable::visit( ZeroType *) {153 void PtrsCastable::visit( __attribute__((unused)) ZeroType *zeroType) { 156 154 result = objectCast( dest, env, indexer ); 157 155 } 158 156 159 void PtrsCastable::visit( OneType *) {157 void PtrsCastable::visit( __attribute__((unused)) OneType *oneType) { 160 158 result = objectCast( dest, env, indexer ); 161 159 } -
src/ResolvExpr/ResolveTypeof.cc
r3f7e12cb r78315272 18 18 #include <cassert> // for assert 19 19 20 #include "Common/PassVisitor.h" // for PassVisitor21 20 #include "Resolver.h" // for resolveInVoidContext 22 21 #include "SynTree/Expression.h" // for Expression … … 42 41 } 43 42 44 class ResolveTypeof : public WithShortCircuiting{43 class ResolveTypeof : public Mutator { 45 44 public: 46 45 ResolveTypeof( const SymTab::Indexer &indexer ) : indexer( indexer ) {} 47 void premutate( TypeofType *typeofType ); 48 Type * postmutate( TypeofType *typeofType ); 46 Type *mutate( TypeofType *typeofType ); 49 47 50 48 private: … … 52 50 }; 53 51 54 Type * resolveTypeof( Type *type, const SymTab::Indexer &indexer ) {55 PassVisitor<ResolveTypeof>mutator( indexer );52 Type *resolveTypeof( Type *type, const SymTab::Indexer &indexer ) { 53 ResolveTypeof mutator( indexer ); 56 54 return type->acceptMutator( mutator ); 57 55 } 58 56 59 void ResolveTypeof::premutate( TypeofType * ) { 60 visit_children = false; 61 } 62 63 Type * ResolveTypeof::postmutate( TypeofType *typeofType ) { 57 Type *ResolveTypeof::mutate( TypeofType *typeofType ) { 64 58 #if 0 65 std::c err<< "resolving typeof: ";66 typeofType->print( std::c err);67 std::c err<< std::endl;59 std::cout << "resolving typeof: "; 60 typeofType->print( std::cout ); 61 std::cout << std::endl; 68 62 #endif 69 if ( typeofType-> expr) {70 Expression * newExpr = resolveInVoidContext( typeofType->expr, indexer );71 assert( newExpr-> result && ! newExpr->result->isVoid() );72 Type * newType = newExpr->result;73 newExpr-> result = nullptr;63 if ( typeofType->get_expr() ) { 64 Expression *newExpr = resolveInVoidContext( typeofType->get_expr(), indexer ); 65 assert( newExpr->has_result() && ! newExpr->get_result()->isVoid() ); 66 Type *newType = newExpr->get_result(); 67 newExpr->set_result( nullptr ); 74 68 delete typeofType; 75 69 delete newExpr; -
src/ResolvExpr/Resolver.cc
r3f7e12cb r78315272 40 40 #include "SynTree/Visitor.h" // for acceptAll, maybeAccept 41 41 #include "typeops.h" // for extractResultType 42 #include "Unify.h" // for unify43 42 44 43 using namespace std; … … 53 52 void previsit( FunctionDecl *functionDecl ); 54 53 void postvisit( FunctionDecl *functionDecl ); 55 void previsit( ObjectDecl * objectDecll );54 void previsit( ObjectDecl *functionDecl ); 56 55 void previsit( TypeDecl *typeDecl ); 57 56 void previsit( EnumDecl * enumDecl ); … … 72 71 void previsit( ThrowStmt *throwStmt ); 73 72 void previsit( CatchStmt *catchStmt ); 74 void previsit( WaitForStmt * stmt );75 73 76 74 void previsit( SingleInit *singleInit ); … … 97 95 } 98 96 99 void resolveDecl( Declaration * decl, const SymTab::Indexer &indexer ) {100 PassVisitor<Resolver> resolver( indexer );101 maybeAccept( decl, resolver );102 }103 104 97 // used in resolveTypeof 105 98 Expression *resolveInVoidContext( Expression *expr, const SymTab::Indexer &indexer ) { … … 109 102 110 103 namespace { 111 void finishExpr( Expression *expr, const TypeEnvironment &env , TypeSubstitution * oldenv = nullptr) {112 expr-> env = oldenv ? oldenv->clone() : new TypeSubstitution;104 void finishExpr( Expression *expr, const TypeEnvironment &env ) { 105 expr->set_env( new TypeSubstitution ); 113 106 env.makeSubstitution( *expr->get_env() ); 114 107 } 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 it120 expr = castExpr->arg;121 castExpr->arg = nullptr;122 std::swap( expr->env, castExpr->env );123 delete castExpr;124 }125 }126 }127 108 } // namespace 128 109 129 void findVoidExpression( Expression *&untyped, const SymTab::Indexer &indexer ) {110 Expression *findVoidExpression( Expression *untyped, const SymTab::Indexer &indexer ) { 130 111 global_renamer.reset(); 131 112 TypeEnvironment env; 132 113 Expression *newExpr = resolveInVoidContext( untyped, indexer, env ); 133 finishExpr( newExpr, env, untyped->env ); 134 delete untyped; 135 untyped = newExpr; 136 } 137 138 void findSingleExpression( Expression *&untyped, const SymTab::Indexer &indexer ) { 139 if ( ! untyped ) return; 140 TypeEnvironment env; 141 AlternativeFinder finder( indexer, env ); 142 finder.find( untyped ); 143 #if 0 144 if ( finder.get_alternatives().size() != 1 ) { 145 std::cerr << "untyped expr is "; 146 untyped->print( std::cerr ); 147 std::cerr << std::endl << "alternatives are:"; 148 for ( const Alternative & alt : finder.get_alternatives() ) { 149 alt.print( std::cerr ); 150 } // for 151 } // if 152 #endif 153 assertf( finder.get_alternatives().size() == 1, "findSingleExpression: must have exactly one alternative at the end." ); 154 Alternative &choice = finder.get_alternatives().front(); 155 Expression *newExpr = choice.expr->clone(); 156 finishExpr( newExpr, choice.env, untyped->env ); 157 delete untyped; 158 untyped = newExpr; 159 } 160 161 void findSingleExpression( Expression *& untyped, Type * type, const SymTab::Indexer & indexer ) { 162 assert( untyped && type ); 163 untyped = new CastExpr( untyped, type ); 164 findSingleExpression( untyped, indexer ); 165 removeExtraneousCast( untyped, indexer ); 114 finishExpr( newExpr, env ); 115 return newExpr; 166 116 } 167 117 168 118 namespace { 119 Expression *findSingleExpression( Expression *untyped, const SymTab::Indexer &indexer ) { 120 TypeEnvironment env; 121 AlternativeFinder finder( indexer, env ); 122 finder.find( untyped ); 123 #if 0 124 if ( finder.get_alternatives().size() != 1 ) { 125 std::cout << "untyped expr is "; 126 untyped->print( std::cout ); 127 std::cout << std::endl << "alternatives are:"; 128 for ( std::list< Alternative >::const_iterator i = finder.get_alternatives().begin(); i != finder.get_alternatives().end(); ++i ) { 129 i->print( std::cout ); 130 } // for 131 } // if 132 #endif 133 assertf( finder.get_alternatives().size() == 1, "findSingleExpression: must have exactly one alternative at the end." ); 134 Alternative &choice = finder.get_alternatives().front(); 135 Expression *newExpr = choice.expr->clone(); 136 finishExpr( newExpr, choice.env ); 137 return newExpr; 138 } 139 169 140 bool isIntegralType( Type *type ) { 170 141 if ( dynamic_cast< EnumInstType * >( type ) ) { … … 179 150 } 180 151 181 void findIntegralExpression( Expression *&untyped, const SymTab::Indexer &indexer ) {152 Expression *findIntegralExpression( Expression *untyped, const SymTab::Indexer &indexer ) { 182 153 TypeEnvironment env; 183 154 AlternativeFinder finder( indexer, env ); … … 208 179 throw SemanticError( "No interpretations for case control expression", untyped ); 209 180 } // if 210 finishExpr( newExpr, *newEnv, untyped->env ); 211 delete untyped; 212 untyped = newExpr; 181 finishExpr( newExpr, *newEnv ); 182 return newExpr; 213 183 } 214 184 … … 235 205 void Resolver::handlePtrType( PtrType * type ) { 236 206 if ( type->get_dimension() ) { 237 findSingleExpression( type->dimension, SymTab::SizeType->clone(), indexer ); 207 CastExpr *castExpr = new CastExpr( type->get_dimension(), SymTab::SizeType->clone() ); 208 Expression *newExpr = findSingleExpression( castExpr, indexer ); 209 delete type->get_dimension(); 210 type->set_dimension( newExpr ); 238 211 } 239 212 } … … 265 238 functionReturn = ResolvExpr::extractResultType( functionDecl->get_functionType() ); 266 239 } 240 267 241 268 242 void Resolver::postvisit( FunctionDecl *functionDecl ) { … … 288 262 void Resolver::previsit( ExprStmt *exprStmt ) { 289 263 visit_children = false; 290 assertf( exprStmt->expr, "ExprStmt has null Expression in resolver" ); 291 findVoidExpression( exprStmt->expr, indexer ); 264 assertf( exprStmt->get_expr(), "ExprStmt has null Expression in resolver" ); 265 Expression *newExpr = findVoidExpression( exprStmt->get_expr(), indexer ); 266 delete exprStmt->get_expr(); 267 exprStmt->set_expr( newExpr ); 292 268 } 293 269 294 270 void Resolver::previsit( AsmExpr *asmExpr ) { 295 271 visit_children = false; 296 findVoidExpression( asmExpr->operand, indexer ); 272 Expression *newExpr = findVoidExpression( asmExpr->get_operand(), indexer ); 273 delete asmExpr->get_operand(); 274 asmExpr->set_operand( newExpr ); 297 275 if ( asmExpr->get_inout() ) { 298 findVoidExpression( asmExpr->inout, indexer ); 276 newExpr = findVoidExpression( asmExpr->get_inout(), indexer ); 277 delete asmExpr->get_inout(); 278 asmExpr->set_inout( newExpr ); 299 279 } // if 300 280 } … … 307 287 308 288 void Resolver::previsit( IfStmt *ifStmt ) { 309 findSingleExpression( ifStmt->condition, indexer ); 289 Expression *newExpr = findSingleExpression( ifStmt->get_condition(), indexer ); 290 delete ifStmt->get_condition(); 291 ifStmt->set_condition( newExpr ); 310 292 } 311 293 312 294 void Resolver::previsit( WhileStmt *whileStmt ) { 313 findSingleExpression( whileStmt->condition, indexer ); 295 Expression *newExpr = findSingleExpression( whileStmt->get_condition(), indexer ); 296 delete whileStmt->get_condition(); 297 whileStmt->set_condition( newExpr ); 314 298 } 315 299 316 300 void Resolver::previsit( ForStmt *forStmt ) { 317 if ( forStmt->condition ) { 318 findSingleExpression( forStmt->condition, indexer ); 301 if ( forStmt->get_condition() ) { 302 Expression * newExpr = findSingleExpression( forStmt->get_condition(), indexer ); 303 delete forStmt->get_condition(); 304 forStmt->set_condition( newExpr ); 319 305 } // if 320 306 321 if ( forStmt->increment ) { 322 findVoidExpression( forStmt->increment, indexer ); 307 if ( forStmt->get_increment() ) { 308 Expression * newExpr = findVoidExpression( forStmt->get_increment(), indexer ); 309 delete forStmt->get_increment(); 310 forStmt->set_increment( newExpr ); 323 311 } // if 324 312 } … … 326 314 void Resolver::previsit( SwitchStmt *switchStmt ) { 327 315 GuardValue( currentObject ); 328 findIntegralExpression( switchStmt->condition, indexer ); 329 330 currentObject = CurrentObject( switchStmt->condition->result ); 316 Expression *newExpr; 317 newExpr = findIntegralExpression( switchStmt->get_condition(), indexer ); 318 delete switchStmt->get_condition(); 319 switchStmt->set_condition( newExpr ); 320 321 currentObject = CurrentObject( newExpr->get_result() ); 331 322 } 332 323 … … 335 326 std::list< InitAlternative > initAlts = currentObject.getOptions(); 336 327 assertf( initAlts.size() == 1, "SwitchStmt did not correctly resolve an integral expression." ); 337 // must remove cast from case statement because RangeExpr cannot be cast. 338 Expression * newExpr = new CastExpr( caseStmt->condition, initAlts.front().type->clone() ); 339 findSingleExpression( newExpr, indexer ); 340 CastExpr * castExpr = strict_dynamic_cast< CastExpr * >( newExpr ); 341 caseStmt->condition = castExpr->arg; 342 castExpr->arg = nullptr; 328 CastExpr * castExpr = new CastExpr( caseStmt->get_condition(), initAlts.front().type->clone() ); 329 Expression * newExpr = findSingleExpression( castExpr, indexer ); 330 castExpr = strict_dynamic_cast< CastExpr * >( newExpr ); 331 caseStmt->set_condition( castExpr->get_arg() ); 332 castExpr->set_arg( nullptr ); 343 333 delete castExpr; 344 334 } … … 349 339 // must resolve the argument for a computed goto 350 340 if ( branchStmt->get_type() == BranchStmt::Goto ) { // check for computed goto statement 351 if ( branchStmt->computedTarget ) { 352 // computed goto argument is void * 353 findSingleExpression( branchStmt->computedTarget, new PointerType( Type::Qualifiers(), new VoidType( Type::Qualifiers() ) ), indexer ); 341 if ( Expression * arg = branchStmt->get_computedTarget() ) { 342 VoidType v = Type::Qualifiers(); // cast to void * for the alternative finder 343 PointerType pt( Type::Qualifiers(), v.clone() ); 344 CastExpr * castExpr = new CastExpr( arg, pt.clone() ); 345 Expression * newExpr = findSingleExpression( castExpr, indexer ); // find best expression 346 branchStmt->set_target( newExpr ); 354 347 } // if 355 348 } // if … … 358 351 void Resolver::previsit( ReturnStmt *returnStmt ) { 359 352 visit_children = false; 360 if ( returnStmt->expr ) { 361 findSingleExpression( returnStmt->expr, functionReturn->clone(), indexer ); 353 if ( returnStmt->get_expr() ) { 354 CastExpr *castExpr = new CastExpr( returnStmt->get_expr(), functionReturn->clone() ); 355 Expression *newExpr = findSingleExpression( castExpr, indexer ); 356 delete castExpr; 357 returnStmt->set_expr( newExpr ); 362 358 } // if 363 359 } … … 370 366 indexer.lookupStruct( "__cfaehm__base_exception_t" ); 371 367 assert( exception_decl ); 372 Type * exceptType = new PointerType( noQualifiers, new StructInstType( noQualifiers, exception_decl ) ); 373 findSingleExpression( throwStmt->expr, exceptType, indexer ); 368 Expression * wrapped = new CastExpr( 369 throwStmt->get_expr(), 370 new PointerType( 371 noQualifiers, 372 new StructInstType( 373 noQualifiers, 374 exception_decl 375 ) 376 ) 377 ); 378 Expression * newExpr = findSingleExpression( wrapped, indexer ); 379 throwStmt->set_expr( newExpr ); 374 380 } 375 381 } 376 382 377 383 void Resolver::previsit( CatchStmt *catchStmt ) { 378 if ( catchStmt->cond ) { 379 findSingleExpression( catchStmt->cond, new BasicType( noQualifiers, BasicType::Bool ), indexer ); 380 } 381 } 382 383 template< typename iterator_t > 384 inline bool advance_to_mutex( iterator_t & it, const iterator_t & end ) { 385 while( it != end && !(*it)->get_type()->get_mutex() ) { 386 it++; 387 } 388 389 return it != end; 390 } 391 392 void Resolver::previsit( WaitForStmt * stmt ) { 393 visit_children = false; 394 395 // Resolve all clauses first 396 for( auto& clause : stmt->clauses ) { 397 398 TypeEnvironment env; 399 AlternativeFinder funcFinder( indexer, env ); 400 401 // Find all alternatives for a function in canonical form 402 funcFinder.findWithAdjustment( clause.target.function ); 403 404 if ( funcFinder.get_alternatives().empty() ) { 405 stringstream ss; 406 ss << "Use of undeclared indentifier '"; 407 ss << strict_dynamic_cast<NameExpr*>( clause.target.function )->name; 408 ss << "' in call to waitfor"; 409 throw SemanticError( ss.str() ); 410 } 411 412 // Find all alternatives for all arguments in canonical form 413 std::list< AlternativeFinder > argAlternatives; 414 funcFinder.findSubExprs( clause.target.arguments.begin(), clause.target.arguments.end(), back_inserter( argAlternatives ) ); 415 416 // List all combinations of arguments 417 std::list< AltList > possibilities; 418 combos( argAlternatives.begin(), argAlternatives.end(), back_inserter( possibilities ) ); 419 420 AltList func_candidates; 421 std::vector< AltList > args_candidates; 422 423 // For every possible function : 424 // try matching the arguments to the parameters 425 // not the other way around because we have more arguments than parameters 426 SemanticError errors; 427 for ( Alternative & func : funcFinder.get_alternatives() ) { 428 try { 429 PointerType * pointer = dynamic_cast< PointerType* >( func.expr->get_result()->stripReferences() ); 430 if( !pointer ) { 431 throw SemanticError( "candidate not viable: not a pointer type\n", func.expr->get_result() ); 432 } 433 434 FunctionType * function = dynamic_cast< FunctionType* >( pointer->get_base() ); 435 if( !function ) { 436 throw SemanticError( "candidate not viable: not a function type\n", pointer->get_base() ); 437 } 438 439 440 { 441 auto param = function->parameters.begin(); 442 auto param_end = function->parameters.end(); 443 444 if( !advance_to_mutex( param, param_end ) ) { 445 throw SemanticError("candidate function not viable: no mutex parameters\n", function); 446 } 447 } 448 449 Alternative newFunc( func ); 450 // Strip reference from function 451 referenceToRvalueConversion( newFunc.expr ); 452 453 // For all the set of arguments we have try to match it with the parameter of the current function alternative 454 for ( auto & argsList : possibilities ) { 455 456 try { 457 // Declare data structures need for resolution 458 OpenVarSet openVars; 459 AssertionSet resultNeed, resultHave; 460 TypeEnvironment resultEnv; 461 462 // Load type variables from arguemnts into one shared space 463 simpleCombineEnvironments( argsList.begin(), argsList.end(), resultEnv ); 464 465 // Make sure we don't widen any existing bindings 466 for ( auto & i : resultEnv ) { 467 i.allowWidening = false; 468 } 469 470 // Find any unbound type variables 471 resultEnv.extractOpenVars( openVars ); 472 473 auto param = function->parameters.begin(); 474 auto param_end = function->parameters.end(); 475 476 // For every arguments of its set, check if it matches one of the parameter 477 // The order is important 478 for( auto & arg : argsList ) { 479 480 // Ignore non-mutex arguments 481 if( !advance_to_mutex( param, param_end ) ) { 482 // We ran out of parameters but still have arguments 483 // this function doesn't match 484 throw SemanticError("candidate function not viable: too many mutex arguments\n", function); 485 } 486 487 // Check if the argument matches the parameter type in the current scope 488 if( ! unify( (*param)->get_type(), arg.expr->get_result(), resultEnv, resultNeed, resultHave, openVars, this->indexer ) ) { 489 // Type doesn't match 490 stringstream ss; 491 ss << "candidate function not viable: no known convertion from '"; 492 arg.expr->get_result()->print( ss ); 493 ss << "' to '"; 494 (*param)->get_type()->print( ss ); 495 ss << "'\n"; 496 throw SemanticError(ss.str(), function); 497 } 498 499 param++; 500 } 501 502 // All arguments match ! 503 504 // Check if parameters are missing 505 if( advance_to_mutex( param, param_end ) ) { 506 // We ran out of arguments but still have parameters left 507 // this function doesn't match 508 throw SemanticError("candidate function not viable: too few mutex arguments\n", function); 509 } 510 511 // All parameters match ! 512 513 // Finish the expressions to tie in the proper environments 514 finishExpr( newFunc.expr, resultEnv ); 515 for( Alternative & alt : argsList ) { 516 finishExpr( alt.expr, resultEnv ); 517 } 518 519 // This is a match store it and save it for later 520 func_candidates.push_back( newFunc ); 521 args_candidates.push_back( argsList ); 522 523 } 524 catch( SemanticError &e ) { 525 errors.append( e ); 526 } 527 } 528 } 529 catch( SemanticError &e ) { 530 errors.append( e ); 531 } 532 } 533 534 // Make sure we got the right number of arguments 535 if( func_candidates.empty() ) { SemanticError top( "No alternatives for function in call to waitfor" ); top.append( errors ); throw top; } 536 if( args_candidates.empty() ) { SemanticError top( "No alternatives for arguments in call to waitfor" ); top.append( errors ); throw top; } 537 if( func_candidates.size() > 1 ) { SemanticError top( "Ambiguous function in call to waitfor" ); top.append( errors ); throw top; } 538 if( args_candidates.size() > 1 ) { SemanticError top( "Ambiguous arguments in call to waitfor" ); top.append( errors ); throw top; } 539 540 541 // Swap the results from the alternative with the unresolved values. 542 // Alternatives will handle deletion on destruction 543 std::swap( clause.target.function, func_candidates.front().expr ); 544 for( auto arg_pair : group_iterate( clause.target.arguments, args_candidates.front() ) ) { 545 std::swap ( std::get<0>( arg_pair), std::get<1>( arg_pair).expr ); 546 } 547 548 // Resolve the conditions as if it were an IfStmt 549 // Resolve the statments normally 550 findSingleExpression( clause.condition, this->indexer ); 551 clause.statement->accept( *visitor ); 552 } 553 554 555 if( stmt->timeout.statement ) { 556 // Resolve the timeout as an size_t for now 557 // Resolve the conditions as if it were an IfStmt 558 // Resolve the statments normally 559 findSingleExpression( stmt->timeout.time, new BasicType( noQualifiers, BasicType::LongLongUnsignedInt ), this->indexer ); 560 findSingleExpression( stmt->timeout.condition, this->indexer ); 561 stmt->timeout.statement->accept( *visitor ); 562 } 563 564 if( stmt->orelse.statement ) { 565 // Resolve the conditions as if it were an IfStmt 566 // Resolve the statments normally 567 findSingleExpression( stmt->orelse.condition, this->indexer ); 568 stmt->orelse.statement->accept( *visitor ); 384 if ( catchStmt->get_cond() ) { 385 Expression * wrapped = new CastExpr( 386 catchStmt->get_cond(), 387 new BasicType( noQualifiers, BasicType::Bool ) 388 ); 389 catchStmt->set_cond( findSingleExpression( wrapped, indexer ) ); 569 390 } 570 391 } … … 582 403 visit_children = false; 583 404 // resolve initialization using the possibilities as determined by the currentObject cursor 584 Expression * newExpr = new UntypedInitExpr( singleInit->value, currentObject.getOptions() );585 findSingleExpression( newExpr, indexer );405 UntypedInitExpr * untyped = new UntypedInitExpr( singleInit->get_value(), currentObject.getOptions() ); 406 Expression * newExpr = findSingleExpression( untyped, indexer ); 586 407 InitExpr * initExpr = strict_dynamic_cast< InitExpr * >( newExpr ); 587 408 … … 590 411 591 412 // discard InitExpr wrapper and retain relevant pieces 592 newExpr = initExpr-> expr;593 initExpr->expr = nullptr;594 std::swap( initExpr->env, newExpr->env);595 std::swap( initExpr->inferParams, newExpr->inferParams );413 newExpr = initExpr->get_expr(); 414 newExpr->set_env( initExpr->get_env() ); 415 initExpr->set_expr( nullptr ); 416 initExpr->set_env( nullptr ); 596 417 delete initExpr; 597 418 598 419 // get the actual object's type (may not exactly match what comes back from the resolver due to conversions) 599 420 Type * initContext = currentObject.getCurrentType(); 600 601 removeExtraneousCast( newExpr, indexer );602 421 603 422 // check if actual object's type is char[] … … 607 426 if ( PointerType * pt = dynamic_cast< PointerType *>( newExpr->get_result() ) ) { 608 427 if ( isCharType( pt->get_base() ) ) { 609 if ( CastExpr *ce = dynamic_cast< CastExpr * >( newExpr ) ) { 610 // strip cast if we're initializing a char[] with a char *, e.g. char x[] = "hello"; 611 newExpr = ce->get_arg(); 612 ce->set_arg( nullptr ); 613 std::swap( ce->env, newExpr->env ); 614 delete ce; 615 } 428 // strip cast if we're initializing a char[] with a char *, e.g. char x[] = "hello"; 429 CastExpr *ce = strict_dynamic_cast< CastExpr * >( newExpr ); 430 newExpr = ce->get_arg(); 431 ce->set_arg( nullptr ); 432 delete ce; 616 433 } 617 434 } … … 620 437 621 438 // set initializer expr to resolved express 622 singleInit-> value = newExpr;439 singleInit->set_value( newExpr ); 623 440 624 441 // move cursor to next object in preparation for next initializer -
src/ResolvExpr/Resolver.h
r3f7e12cb r78315272 29 29 /// Checks types and binds syntactic constructs to typed representations 30 30 void resolve( std::list< Declaration * > translationUnit ); 31 void resolveDecl( Declaration *, const SymTab::Indexer &indexer ); 32 Expression *resolveInVoidContext( Expression * expr, const SymTab::Indexer &indexer ); 33 void findVoidExpression( Expression *& untyped, const SymTab::Indexer &indexer ); 34 void findSingleExpression( Expression *& untyped, const SymTab::Indexer &indexer ); 31 Expression *resolveInVoidContext( Expression *expr, const SymTab::Indexer &indexer ); 32 Expression *findVoidExpression( Expression *untyped, const SymTab::Indexer &indexer ); 35 33 void resolveCtorInit( ConstructorInit * ctorInit, const SymTab::Indexer & indexer ); 36 34 void resolveStmtExpr( StmtExpr * stmtExpr, const SymTab::Indexer & indexer ); -
src/ResolvExpr/TypeEnvironment.cc
r3f7e12cb r78315272 68 68 } 69 69 70 void EqvClass::print( std::ostream &os, Indenterindent ) const {71 os << "( ";70 void EqvClass::print( std::ostream &os, int indent ) const { 71 os << std::string( indent, ' ' ) << "( "; 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 +1);76 type->print( os, indent ); 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 err<< "adding " << *theVar;125 /// std::cout << "adding " << *theVar; 126 126 if ( theClass->type ) { 127 /// std::c err<< " bound to ";128 /// theClass->type->print( std::c err);129 /// std::c err<< std::endl;127 /// std::cout << " bound to "; 128 /// theClass->type->print( std::cout ); 129 /// std::cout << 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 err<< " bound to variable " << *theClass->vars.begin() << std::endl;133 /// std::cout << " 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, Indenterindent ) const {146 void TypeEnvironment::print( std::ostream &os, int 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
r3f7e12cb r78315272 68 68 EqvClass &operator=( const EqvClass &other ); 69 69 ~EqvClass(); 70 void print( std::ostream &os, Indenter indent = {}) const;70 void print( std::ostream &os, int indent = 0 ) 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, Indenter indent = {}) const;82 void print( std::ostream &os, int indent = 0 ) const; 83 83 void combine( const TypeEnvironment &second, Type *(*combineFunc)( Type*, Type* ) ); 84 84 void simpleCombine( const TypeEnvironment &second ); -
src/ResolvExpr/Unify.cc
r3f7e12cb r78315272 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 19 #include <memory> // for unique_ptr, auto_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 PassVisitor25 24 #include "FindOpenVars.h" // for findOpenVars 26 25 #include "Parser/LinkageSpec.h" // for C … … 138 137 bool tyVarCompatible( const TypeDecl::Data & data, Type *type ) { 139 138 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:: unique_ptr< Type > newType( curClass.type->clone() );171 std::auto_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 typedefs 461 if ( arrayType->get_isVarLen() || otherArray->get_isVarLen() ) { 462 return; 463 } 464 460 465 if ( ! arrayType->get_isVarLen() && ! otherArray->get_isVarLen() && 461 466 arrayType->get_dimension() != 0 && otherArray->get_dimension() != 0 ) { … … 532 537 /// If this isn't done then argument lists can have wildly different 533 538 /// size and structure, when they should be compatible. 534 struct TtypeExpander : public WithShortCircuiting { 535 TypeEnvironment & tenv; 536 TtypeExpander( TypeEnvironment & tenv ) : tenv( tenv ) {} 537 void premutate( TypeInstType * ) { visit_children = false; } 538 Type * postmutate( TypeInstType * typeInst ) { 539 struct TtypeExpander : public Mutator { 540 TypeEnvironment & env; 541 TtypeExpander( TypeEnvironment & env ) : env( env ) {} 542 Type * mutate( TypeInstType * typeInst ) { 539 543 EqvClass eqvClass; 540 if ( tenv.lookup( typeInst->get_name(), eqvClass ) ) {544 if ( env.lookup( typeInst->get_name(), eqvClass ) ) { 541 545 if ( eqvClass.data.kind == TypeDecl::Ttype ) { 542 546 // expand ttype parameter into its actual type … … 556 560 dst.clear(); 557 561 for ( DeclarationWithType * dcl : src ) { 558 PassVisitor<TtypeExpander>expander( env );562 TtypeExpander expander( env ); 559 563 dcl->acceptMutator( expander ); 560 564 std::list< Type * > types; … … 746 750 std::list<Type *> types1, types2; 747 751 748 PassVisitor<TtypeExpander>expander( env );752 TtypeExpander expander( env ); 749 753 flat1->acceptMutator( expander ); 750 754 flat2->acceptMutator( expander ); -
src/SymTab/Autogen.cc
r3f7e12cb r78315272 16 16 #include "Autogen.h" 17 17 18 #include <cstddef> // for NULL 18 19 #include <algorithm> // for count_if 19 20 #include <cassert> // for strict_dynamic_cast, assert, assertf … … 26 27 #include "AddVisit.h" // for addVisit 27 28 #include "CodeGen/OperatorTable.h" // for isCtorDtor, isCtorDtorAssign 28 #include "Common/PassVisitor.h" // for PassVisitor29 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 DeclMutator 31 32 #include "GenPoly/ScopedSet.h" // for ScopedSet, ScopedSet<>::iterator 32 #include "InitTweak/GenInit.h" // for fixReturnStatements33 #include "ResolvExpr/Resolver.h" // for resolveDecl34 33 #include "SymTab/Mangler.h" // for Mangler 35 34 #include "SynTree/Attribute.h" // For Attribute … … 43 42 namespace SymTab { 44 43 Type * SizeType = 0; 45 46 /// Data used to generate functions generically. Specifically, the name of the generated function and a function which generates the routine protoype 44 typedef ScopedMap< std::string, bool > TypeMap; 45 46 /// Data used to generate functions generically. Specifically, the name of the generated function, a function which generates the routine protoype, and a map which contains data to determine whether a function should be generated. 47 47 struct FuncData { 48 48 typedef FunctionType * (*TypeGen)( Type * ); 49 FuncData( const std::string & fname, const TypeGen & genType ) : fname( fname ), genType( genType) {}49 FuncData( const std::string & fname, const TypeGen & genType, TypeMap & map ) : fname( fname ), genType( genType ), map( map ) {} 50 50 std::string fname; 51 51 TypeGen genType; 52 TypeMap & map; 52 53 }; 53 54 54 struct AutogenerateRoutines final : public WithDeclsToAdd, public WithVisitorRef<AutogenerateRoutines>, public WithGuards, public WithShortCircuiting, public WithIndexer { 55 class AutogenerateRoutines final : public Visitor { 56 template< typename Visitor > 57 friend void acceptAndAdd( std::list< Declaration * > &translationUnit, Visitor &visitor ); 58 template< typename Visitor > 59 friend void addVisitStatementList( std::list< Statement* > &stmts, Visitor &visitor ); 60 public: 61 std::list< Declaration * > &get_declsToAdd() { return declsToAdd; } 62 63 typedef Visitor Parent; 64 using Parent::visit; 65 55 66 AutogenerateRoutines(); 56 67 57 void previsit( EnumDecl * enumDecl ); 58 void previsit( StructDecl * structDecl ); 59 void previsit( UnionDecl * structDecl ); 60 void previsit( TypeDecl * typeDecl ); 61 void previsit( TraitDecl * traitDecl ); 62 void previsit( FunctionDecl * functionDecl ); 63 64 void previsit( FunctionType * ftype ); 65 void previsit( PointerType * ptype ); 66 67 void previsit( CompoundStmt * compoundStmt ); 68 virtual void visit( EnumDecl *enumDecl ); 69 virtual void visit( StructDecl *structDecl ); 70 virtual void visit( UnionDecl *structDecl ); 71 virtual void visit( TypeDecl *typeDecl ); 72 virtual void visit( TraitDecl *ctxDecl ); 73 virtual void visit( FunctionDecl *functionDecl ); 74 75 virtual void visit( FunctionType *ftype ); 76 virtual void visit( PointerType *ftype ); 77 78 virtual void visit( CompoundStmt *compoundStmt ); 79 virtual void visit( SwitchStmt *switchStmt ); 68 80 69 81 private: 70 71 GenPoly::ScopedSet< std::string > structsDone; 82 template< typename StmtClass > void visitStatement( StmtClass *stmt ); 83 84 std::list< Declaration * > declsToAdd, declsToAddAfter; 85 std::set< std::string > structsDone; 72 86 unsigned int functionNesting = 0; // current level of nested functions 73 74 InitTweak::ManagedTypes managedTypes; 87 /// Note: the following maps could be ScopedSets, but it should be easier to work 88 /// deleted functions in if they are maps, since the value false can be inserted 89 /// at the current scope without affecting outer scopes or requiring copies. 90 TypeMap copyable, assignable, constructable, destructable; 75 91 std::vector< FuncData > data; 76 92 }; 77 93 78 94 /// generates routines for tuple types. 79 struct AutogenTupleRoutines : public WithDeclsToAdd, public WithVisitorRef<AutogenTupleRoutines>, public WithGuards, public WithShortCircuiting { 80 void previsit( FunctionDecl * functionDecl ); 81 82 void postvisit( TupleType * tupleType ); 83 84 void previsit( CompoundStmt * compoundStmt ); 95 /// Doesn't really need to be a mutator, but it's easier to reuse DeclMutator than it is to use AddVisit 96 /// or anything we currently have that supports adding new declarations for visitors 97 class AutogenTupleRoutines : public GenPoly::DeclMutator { 98 public: 99 typedef GenPoly::DeclMutator Parent; 100 using Parent::mutate; 101 102 virtual DeclarationWithType * mutate( FunctionDecl *functionDecl ); 103 104 virtual Type * mutate( TupleType *tupleType ); 105 106 virtual CompoundStmt * mutate( CompoundStmt *compoundStmt ); 85 107 86 108 private: … … 90 112 91 113 void autogenerateRoutines( std::list< Declaration * > &translationUnit ) { 92 PassVisitor<AutogenerateRoutines>generator;93 acceptA ll( translationUnit, generator );114 AutogenerateRoutines generator; 115 acceptAndAdd( translationUnit, generator ); 94 116 95 117 // needs to be done separately because AutogenerateRoutines skips types that appear as function arguments, etc. 96 118 // AutogenTupleRoutines tupleGenerator; 97 // acceptAll( translationUnit, tupleGenerator ); 98 } 99 100 //============================================================================================= 101 // FuncGenerator definitions 102 //============================================================================================= 103 class FuncGenerator { 104 public: 105 std::list< Declaration * > definitions, forwards; 106 107 FuncGenerator( Type * type, const std::vector< FuncData > & data, unsigned int functionNesting, SymTab::Indexer & indexer ) : type( type ), data( data ), functionNesting( functionNesting ), indexer( indexer ) {} 108 109 virtual bool shouldAutogen() const = 0; 110 void genStandardFuncs(); 111 virtual void genFieldCtors() = 0; 112 protected: 113 Type * type; 114 const std::vector< FuncData > & data; 115 unsigned int functionNesting; 116 SymTab::Indexer & indexer; 117 118 virtual void genFuncBody( FunctionDecl * dcl ) = 0; 119 virtual bool isConcurrentType() const = 0; 120 121 void resolve( FunctionDecl * dcl ); 122 void generatePrototypes( std::list< FunctionDecl * > & newFuncs ); 123 }; 124 125 class StructFuncGenerator : public FuncGenerator { 126 StructDecl * aggregateDecl; 127 public: 128 StructFuncGenerator( StructDecl * aggregateDecl, StructInstType * refType, const std::vector< FuncData > & data, unsigned int functionNesting, SymTab::Indexer & indexer ) : FuncGenerator( refType, data, functionNesting, indexer ), aggregateDecl( aggregateDecl) {} 129 130 virtual bool shouldAutogen() const override; 131 virtual bool isConcurrentType() const override; 132 133 virtual void genFuncBody( FunctionDecl * dcl ) override; 134 virtual void genFieldCtors() override; 135 136 private: 137 /// generates a single struct member operation (constructor call, destructor call, assignment call) 138 void makeMemberOp( ObjectDecl * dstParam, Expression * src, DeclarationWithType * field, FunctionDecl * func, bool forward = true ); 139 140 /// generates the body of a struct function by iterating the struct members (via parameters) - generates default ctor, copy ctor, assignment, and dtor bodies, but NOT field ctor bodies 141 template<typename Iterator> 142 void makeFunctionBody( Iterator member, Iterator end, FunctionDecl * func, bool forward = true ); 143 144 /// generate the body of a constructor which takes parameters that match fields, e.g. 145 /// void ?{}(A *, int) and void?{}(A *, int, int) for a struct A which has two int fields. 146 template<typename Iterator> 147 void makeFieldCtorBody( Iterator member, Iterator end, FunctionDecl * func ); 148 }; 149 150 class UnionFuncGenerator : public FuncGenerator { 151 UnionDecl * aggregateDecl; 152 public: 153 UnionFuncGenerator( UnionDecl * aggregateDecl, UnionInstType * refType, const std::vector< FuncData > & data, unsigned int functionNesting, SymTab::Indexer & indexer ) : FuncGenerator( refType, data, functionNesting, indexer ), aggregateDecl( aggregateDecl) {} 154 155 virtual bool shouldAutogen() const override; 156 virtual bool isConcurrentType() const override; 157 158 virtual void genFuncBody( FunctionDecl * dcl ) override; 159 virtual void genFieldCtors() override; 160 161 private: 162 /// generates a single struct member operation (constructor call, destructor call, assignment call) 163 template<typename OutputIterator> 164 void makeMemberOp( ObjectDecl * srcParam, ObjectDecl * dstParam, OutputIterator out ); 165 166 /// generates the body of a struct function by iterating the struct members (via parameters) - generates default ctor, copy ctor, assignment, and dtor bodies, but NOT field ctor bodies 167 template<typename Iterator> 168 void makeFunctionBody( Iterator member, Iterator end, FunctionDecl * func, bool forward = true ); 169 170 /// generate the body of a constructor which takes parameters that match fields, e.g. 171 /// void ?{}(A *, int) and void?{}(A *, int, int) for a struct A which has two int fields. 172 template<typename Iterator> 173 void makeFieldCtorBody( Iterator member, Iterator end, FunctionDecl * func ); 174 }; 175 176 class EnumFuncGenerator : public FuncGenerator { 177 public: 178 EnumFuncGenerator( EnumInstType * refType, const std::vector< FuncData > & data, unsigned int functionNesting, SymTab::Indexer & indexer ) : FuncGenerator( refType, data, functionNesting, indexer ) {} 179 180 virtual bool shouldAutogen() const override; 181 virtual bool isConcurrentType() const override; 182 183 virtual void genFuncBody( FunctionDecl * dcl ) override; 184 virtual void genFieldCtors() override; 185 186 private: 187 }; 188 189 class TypeFuncGenerator : public FuncGenerator { 190 TypeDecl * typeDecl; 191 public: 192 TypeFuncGenerator( TypeDecl * typeDecl, TypeInstType * refType, const std::vector<FuncData> & data, unsigned int functionNesting, SymTab::Indexer & indexer ) : FuncGenerator( refType, data, functionNesting, indexer ), typeDecl( typeDecl ) {} 193 194 virtual bool shouldAutogen() const override; 195 virtual void genFuncBody( FunctionDecl * dcl ) override; 196 virtual bool isConcurrentType() const override; 197 virtual void genFieldCtors() override; 198 }; 199 200 //============================================================================================= 201 // helper functions 202 //============================================================================================= 203 void generateFunctions( FuncGenerator & gen, std::list< Declaration * > & declsToAdd ) { 204 if ( ! gen.shouldAutogen() ) return; 205 206 // generate each of the functions based on the supplied FuncData objects 207 gen.genStandardFuncs(); 208 gen.genFieldCtors(); 209 210 declsToAdd.splice( declsToAdd.end(), gen.forwards ); 211 declsToAdd.splice( declsToAdd.end(), gen.definitions ); 119 // tupleGenerator.mutateDeclarationList( translationUnit ); 212 120 } 213 121 214 122 bool isUnnamedBitfield( ObjectDecl * obj ) { 215 return obj != nullptr && obj->name == "" && obj->bitfieldWidth != nullptr;123 return obj != NULL && obj->get_name() == "" && obj->get_bitfieldWidth() != NULL; 216 124 } 217 125 … … 219 127 void addForwardDecl( FunctionDecl * functionDecl, std::list< Declaration * > & declsToAdd ) { 220 128 FunctionDecl * decl = functionDecl->clone(); 221 delete decl-> statements;222 decl->s tatements = nullptr;129 delete decl->get_statements(); 130 decl->set_statements( NULL ); 223 131 declsToAdd.push_back( decl ); 224 132 decl->fixUniqueId(); 225 133 } 226 134 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 237 135 /// given type T, generate type of default ctor/dtor, i.e. function type void (*) (T *) 238 136 FunctionType * genDefaultType( Type * paramType ) { 239 const auto & typeParams = getGenericParams( paramType );240 137 FunctionType *ftype = new FunctionType( Type::Qualifiers(), false ); 241 cloneAll( typeParams, ftype->forall );242 138 ObjectDecl *dstParam = new ObjectDecl( "_dst", Type::StorageClasses(), LinkageSpec::Cforall, nullptr, new ReferenceType( Type::Qualifiers(), paramType->clone() ), nullptr ); 243 ftype->parameters.push_back( dstParam ); 139 ftype->get_parameters().push_back( dstParam ); 140 244 141 return ftype; 245 142 } … … 249 146 FunctionType *ftype = genDefaultType( paramType ); 250 147 ObjectDecl *srcParam = new ObjectDecl( "_src", Type::StorageClasses(), LinkageSpec::Cforall, nullptr, paramType->clone(), nullptr ); 251 ftype-> parameters.push_back( srcParam );148 ftype->get_parameters().push_back( srcParam ); 252 149 return ftype; 253 150 } … … 257 154 FunctionType *ftype = genCopyType( paramType ); 258 155 ObjectDecl *returnVal = new ObjectDecl( "_ret", Type::StorageClasses(), LinkageSpec::Cforall, nullptr, paramType->clone(), nullptr ); 259 ftype-> returnVals.push_back( returnVal );156 ftype->get_returnVals().push_back( returnVal ); 260 157 return ftype; 261 158 } … … 274 171 } 275 172 276 Type * declToType( Declaration * decl ) { 277 if ( DeclarationWithType * dwt = dynamic_cast< DeclarationWithType * >( decl ) ) { 278 return dwt->get_type(); 279 } 280 return nullptr; 281 } 282 283 Type * declToTypeDeclBase( Declaration * decl ) { 284 if ( TypeDecl * td = dynamic_cast< TypeDecl * >( decl ) ) { 285 return td->base; 286 } 287 return nullptr; 288 } 289 290 //============================================================================================= 291 // FuncGenerator member definitions 292 //============================================================================================= 293 void FuncGenerator::genStandardFuncs() { 294 std::list< FunctionDecl * > newFuncs; 295 generatePrototypes( newFuncs ); 296 297 for ( FunctionDecl * dcl : newFuncs ) { 298 genFuncBody( dcl ); 299 if ( CodeGen::isAssignment( dcl->name ) ) { 300 // assignment needs to return a value 301 FunctionType * assignType = dcl->type; 302 assert( assignType->parameters.size() == 2 ); 303 assert( assignType->returnVals.size() == 1 ); 304 ObjectDecl * dstParam = strict_dynamic_cast< ObjectDecl * >( assignType->parameters.front() ); 305 dcl->statements->push_back( new ReturnStmt( noLabels, new VariableExpr( dstParam ) ) ); 306 } 307 resolve( dcl ); 308 } 309 } 310 311 void FuncGenerator::generatePrototypes( std::list< FunctionDecl * > & newFuncs ) { 312 bool concurrent_type = isConcurrentType(); 313 for ( const FuncData & d : data ) { 314 // generate a function (?{}, ?=?, ^?{}) based on the current FuncData. 315 FunctionType * ftype = d.genType( type ); 316 317 // destructor for concurrent type must be mutex 318 if ( concurrent_type && CodeGen::isDestructor( d.fname ) ) { 173 /// inserts base type of first argument into map if pred(funcDecl) is true 174 void insert( FunctionDecl *funcDecl, TypeMap & map, FunctionDecl * (*pred)(Declaration *) ) { 175 // insert type into constructable, etc. map if appropriate 176 if ( pred( funcDecl ) ) { 177 FunctionType * ftype = funcDecl->get_functionType(); 178 assert( ! ftype->get_parameters().empty() ); 179 Type * t = InitTweak::getPointerBase( ftype->get_parameters().front()->get_type() ); 180 assert( t ); 181 map.insert( Mangler::mangleType( t ), true ); 182 } 183 } 184 185 /// using map and t, determines if is constructable, etc. 186 bool lookup( const TypeMap & map, Type * t ) { 187 assertf( t, "Autogenerate lookup was given non-type: %s", toString( t ).c_str() ); 188 if ( dynamic_cast< PointerType * >( t ) ) { 189 // will need more complicated checking if we want this to work with pointer types, since currently 190 return true; 191 } else if ( ArrayType * at = dynamic_cast< ArrayType * >( t ) ) { 192 // an array's constructor, etc. is generated on the fly based on the base type's constructor, etc. 193 return lookup( map, at->get_base() ); 194 } 195 TypeMap::const_iterator it = map.find( Mangler::mangleType( t ) ); 196 if ( it != map.end() ) return it->second; 197 // something that does not appear in the map is by default not constructable, etc. 198 return false; 199 } 200 201 /// using map and aggr, examines each member to determine if constructor, etc. should be generated 202 template<typename Container> 203 bool shouldGenerate( const TypeMap & map, const Container & container ) { 204 for ( Type * t : container ) { 205 if ( ! lookup( map, t ) ) return false; 206 } 207 return true; 208 } 209 210 /// data structure for abstracting the generation of special functions 211 template< typename OutputIterator, typename Container > 212 struct FuncGenerator { 213 const Container & container; 214 Type *refType; 215 unsigned int functionNesting; 216 const std::list< TypeDecl* > & typeParams; 217 OutputIterator out; 218 FuncGenerator( const Container & container, Type *refType, unsigned int functionNesting, const std::list< TypeDecl* > & typeParams, OutputIterator out ) : container( container ), refType( refType ), functionNesting( functionNesting ), typeParams( typeParams ), out( out ) {} 219 220 /// generates a function (?{}, ?=?, ^?{}) based on the data argument and members. If function is generated, inserts the type into the map. 221 void gen( const FuncData & data, bool concurrent_type ) { 222 if ( ! shouldGenerate( data.map, container ) ) return; 223 FunctionType * ftype = data.genType( refType ); 224 225 if ( concurrent_type && CodeGen::isDestructor( data.fname ) ) { 319 226 ftype->parameters.front()->get_type()->set_mutex( true ); 320 227 } 321 228 322 newFuncs.push_back( genFunc( d.fname, ftype, functionNesting ) ); 323 } 324 } 325 326 void FuncGenerator::resolve( FunctionDecl * dcl ) { 327 try { 328 ResolvExpr::resolveDecl( dcl, indexer ); 329 if ( functionNesting == 0 ) { 330 // forward declare if top-level struct, so that 331 // type is complete as soon as its body ends 332 // Note: this is necessary if we want structs which contain 333 // generic (otype) structs as members. 334 addForwardDecl( dcl, forwards ); 335 } 336 definitions.push_back( dcl ); 337 indexer.addId( dcl ); 338 } catch ( SemanticError err ) { 339 // okay if decl does not resolve - that means the function should not be generated 340 delete dcl; 341 } 342 } 343 344 bool StructFuncGenerator::shouldAutogen() const { 345 // Builtins do not use autogeneration. 346 return ! aggregateDecl->linkage.is_builtin; 347 } 348 bool StructFuncGenerator::isConcurrentType() const { return aggregateDecl->is_thread() || aggregateDecl->is_monitor(); } 349 350 void StructFuncGenerator::genFuncBody( FunctionDecl * dcl ) { 351 // generate appropriate calls to member ctor, assignment 352 // destructor needs to do everything in reverse, so pass "forward" based on whether the function is a destructor 353 if ( ! CodeGen::isDestructor( dcl->name ) ) { 354 makeFunctionBody( aggregateDecl->members.begin(), aggregateDecl->members.end(), dcl ); 355 } else { 356 makeFunctionBody( aggregateDecl->members.rbegin(), aggregateDecl->members.rend(), dcl, false ); 357 } 358 } 359 360 void StructFuncGenerator::genFieldCtors() { 361 // field ctors are only generated if default constructor and copy constructor are both generated 362 unsigned numCtors = std::count_if( definitions.begin(), definitions.end(), [](Declaration * dcl) { return CodeGen::isConstructor( dcl->name ); } ); 363 364 // Field constructors are only generated if default and copy constructor 365 // are generated, since they need access to both 366 if ( numCtors != 2 ) return; 367 368 // create constructors which take each member type as a parameter. 369 // for example, for struct A { int x, y; }; generate 370 // void ?{}(A *, int) and void ?{}(A *, int, int) 371 FunctionType * memCtorType = genDefaultType( type ); 372 for ( Declaration * member : aggregateDecl->members ) { 373 DeclarationWithType * field = strict_dynamic_cast<DeclarationWithType *>( member ); 374 if ( isUnnamedBitfield( dynamic_cast< ObjectDecl * > ( field ) ) ) { 375 // don't make a function whose parameter is an unnamed bitfield 376 continue; 377 } 378 memCtorType->parameters.push_back( new ObjectDecl( field->name, Type::StorageClasses(), LinkageSpec::Cforall, 0, field->get_type()->clone(), 0 ) ); 379 FunctionDecl * ctor = genFunc( "?{}", memCtorType->clone(), functionNesting ); 380 makeFieldCtorBody( aggregateDecl->members.begin(), aggregateDecl->members.end(), ctor ); 381 resolve( ctor ); 382 } 383 delete memCtorType; 384 } 385 386 void StructFuncGenerator::makeMemberOp( ObjectDecl * dstParam, Expression * src, DeclarationWithType * field, FunctionDecl * func, bool forward ) { 229 cloneAll( typeParams, ftype->forall ); 230 *out++ = genFunc( data.fname, ftype, functionNesting ); 231 data.map.insert( Mangler::mangleType( refType ), true ); 232 } 233 }; 234 235 template< typename OutputIterator, typename Container > 236 FuncGenerator<OutputIterator, Container> makeFuncGenerator( const Container & container, Type *refType, unsigned int functionNesting, const std::list< TypeDecl* > & typeParams, OutputIterator out ) { 237 return FuncGenerator<OutputIterator, Container>( container, refType, functionNesting, typeParams, out ); 238 } 239 240 /// generates a single enumeration assignment expression 241 ApplicationExpr * genEnumAssign( FunctionType * ftype, FunctionDecl * assignDecl ) { 242 // enum copy construct and assignment is just C-style assignment. 243 // this looks like a bad recursive call, but code gen will turn it into 244 // a C-style assignment. 245 // This happens before function pointer type conversion, so need to do it manually here 246 // NOTE: ftype is not necessarily the functionType belonging to assignDecl - ftype is the 247 // type of the function that this expression is being generated for (so that the correct 248 // parameters) are using in the variable exprs 249 assert( ftype->get_parameters().size() == 2 ); 250 ObjectDecl * dstParam = strict_dynamic_cast< ObjectDecl * >( ftype->get_parameters().front() ); 251 ObjectDecl * srcParam = strict_dynamic_cast< ObjectDecl * >( ftype->get_parameters().back() ); 252 253 VariableExpr * assignVarExpr = new VariableExpr( assignDecl ); 254 Type * assignVarExprType = assignVarExpr->get_result(); 255 assignVarExprType = new PointerType( Type::Qualifiers(), assignVarExprType ); 256 assignVarExpr->set_result( assignVarExprType ); 257 ApplicationExpr * assignExpr = new ApplicationExpr( assignVarExpr ); 258 assignExpr->get_args().push_back( new VariableExpr( dstParam ) ); 259 assignExpr->get_args().push_back( new VariableExpr( srcParam ) ); 260 return assignExpr; 261 } 262 263 // E ?=?(E volatile*, int), 264 // ?=?(E _Atomic volatile*, int); 265 void makeEnumFunctions( EnumInstType *refType, unsigned int functionNesting, std::list< Declaration * > &declsToAdd ) { 266 267 // T ?=?(E *, E); 268 FunctionType *assignType = genAssignType( refType ); 269 270 // void ?{}(E *); void ^?{}(E *); 271 FunctionType * ctorType = genDefaultType( refType->clone() ); 272 FunctionType * dtorType = genDefaultType( refType->clone() ); 273 274 // void ?{}(E *, E); 275 FunctionType *copyCtorType = genCopyType( refType->clone() ); 276 277 // add unused attribute to parameters of default constructor and destructor 278 ctorType->get_parameters().front()->get_attributes().push_back( new Attribute( "unused" ) ); 279 dtorType->get_parameters().front()->get_attributes().push_back( new Attribute( "unused" ) ); 280 281 // xxx - should we also generate void ?{}(E *, int) and E ?{}(E *, E)? 282 // right now these cases work, but that might change. 283 284 // xxx - Temporary: make these functions intrinsic so they codegen as C assignment. 285 // Really they're something of a cross between instrinsic and autogen, so should 286 // probably make a new linkage type 287 FunctionDecl *assignDecl = genFunc( "?=?", assignType, functionNesting, true ); 288 FunctionDecl *ctorDecl = genFunc( "?{}", ctorType, functionNesting, true ); 289 FunctionDecl *copyCtorDecl = genFunc( "?{}", copyCtorType, functionNesting, true ); 290 FunctionDecl *dtorDecl = genFunc( "^?{}", dtorType, functionNesting, true ); 291 292 // body is either return stmt or expr stmt 293 assignDecl->get_statements()->get_kids().push_back( new ReturnStmt( noLabels, genEnumAssign( assignType, assignDecl ) ) ); 294 copyCtorDecl->get_statements()->get_kids().push_back( new ExprStmt( noLabels, genEnumAssign( copyCtorType, assignDecl ) ) ); 295 296 declsToAdd.push_back( ctorDecl ); 297 declsToAdd.push_back( copyCtorDecl ); 298 declsToAdd.push_back( dtorDecl ); 299 declsToAdd.push_back( assignDecl ); // assignment should come last since it uses copy constructor in return 300 } 301 302 /// generates a single struct member operation (constructor call, destructor call, assignment call) 303 void makeStructMemberOp( ObjectDecl * dstParam, Expression * src, DeclarationWithType * field, FunctionDecl * func, bool forward = true ) { 387 304 InitTweak::InitExpander srcParam( src ); 388 305 389 306 // assign to destination 390 Expression *dstselect = new MemberExpr( field, new CastExpr( new VariableExpr( dstParam ), strict_dynamic_cast< ReferenceType* >( dstParam->get_type() )->base->clone() ) ); 391 genImplicitCall( srcParam, dstselect, func->name, back_inserter( func->statements->kids ), field, forward ); 392 } 393 307 Expression *dstselect = new MemberExpr( field, new CastExpr( new VariableExpr( dstParam ), strict_dynamic_cast< ReferenceType* >( dstParam->get_type() )->get_base()->clone() ) ); 308 genImplicitCall( srcParam, dstselect, func->get_name(), back_inserter( func->get_statements()->get_kids() ), field, forward ); 309 } 310 311 /// generates the body of a struct function by iterating the struct members (via parameters) - generates default ctor, copy ctor, assignment, and dtor bodies, but NOT field ctor bodies 394 312 template<typename Iterator> 395 void StructFuncGenerator::makeFunctionBody( Iterator member, Iterator end, FunctionDecl * func, bool forward) {313 void makeStructFunctionBody( Iterator member, Iterator end, FunctionDecl * func, bool forward = true ) { 396 314 for ( ; member != end; ++member ) { 397 315 if ( DeclarationWithType *field = dynamic_cast< DeclarationWithType * >( *member ) ) { // otherwise some form of type declaration, e.g. Aggregate … … 403 321 } 404 322 405 if ( type->get_const() && CodeGen::isAssignment( func->name )) {323 if ( type->get_const() && func->get_name() == "?=?" ) { 406 324 // don't assign const members, but do construct/destruct 407 325 continue; 408 326 } 409 327 328 if ( field->get_name() == "" ) { 329 // don't assign to anonymous members 330 // xxx - this is a temporary fix. Anonymous members tie into 331 // our inheritance model. I think the correct way to handle this is to 332 // cast the structure to the type of the member and let the resolver 333 // figure out whether it's valid and have a pass afterwards that fixes 334 // the assignment to use pointer arithmetic with the offset of the 335 // member, much like how generic type members are handled. 336 continue; 337 } 338 410 339 assert( ! func->get_functionType()->get_parameters().empty() ); 411 340 ObjectDecl * dstParam = dynamic_cast<ObjectDecl*>( func->get_functionType()->get_parameters().front() ); 412 ObjectDecl * srcParam = nullptr;341 ObjectDecl * srcParam = NULL; 413 342 if ( func->get_functionType()->get_parameters().size() == 2 ) { 414 343 srcParam = dynamic_cast<ObjectDecl*>( func->get_functionType()->get_parameters().back() ); 415 344 } 416 417 345 // srcParam may be NULL, in which case we have default ctor/dtor 418 346 assert( dstParam ); 419 347 420 Expression *srcselect = srcParam ? new MemberExpr( field, new VariableExpr( srcParam ) ) : nullptr;421 make MemberOp( dstParam, srcselect, field, func, forward );348 Expression *srcselect = srcParam ? new MemberExpr( field, new VariableExpr( srcParam ) ) : NULL; 349 makeStructMemberOp( dstParam, srcselect, field, func, forward ); 422 350 } // if 423 351 } // for 424 } // makeFunctionBody 425 352 } // makeStructFunctionBody 353 354 /// generate the body of a constructor which takes parameters that match fields, e.g. 355 /// void ?{}(A *, int) and void?{}(A *, int, int) for a struct A which has two int fields. 426 356 template<typename Iterator> 427 void StructFuncGenerator::makeFieldCtorBody( Iterator member, Iterator end, FunctionDecl * func ) {428 FunctionType * ftype = func-> type;429 std::list<DeclarationWithType*> & params = ftype-> parameters;357 void makeStructFieldCtorBody( Iterator member, Iterator end, FunctionDecl * func ) { 358 FunctionType * ftype = func->get_functionType(); 359 std::list<DeclarationWithType*> & params = ftype->get_parameters(); 430 360 assert( params.size() >= 2 ); // should not call this function for default ctor, etc. 431 361 … … 439 369 // don't make a function whose parameter is an unnamed bitfield 440 370 continue; 371 } else if ( field->get_name() == "" ) { 372 // don't assign to anonymous members 373 // xxx - this is a temporary fix. Anonymous members tie into 374 // our inheritance model. I think the correct way to handle this is to 375 // cast the structure to the type of the member and let the resolver 376 // figure out whether it's valid and have a pass afterwards that fixes 377 // the assignment to use pointer arithmetic with the offset of the 378 // member, much like how generic type members are handled. 379 continue; 441 380 } else if ( parameter != params.end() ) { 442 381 // matching parameter, initialize field with copy ctor 443 382 Expression *srcselect = new VariableExpr(*parameter); 444 make MemberOp( dstParam, srcselect, field, func );383 makeStructMemberOp( dstParam, srcselect, field, func ); 445 384 ++parameter; 446 385 } else { 447 386 // no matching parameter, initialize field with default ctor 448 make MemberOp( dstParam, nullptr, field, func );387 makeStructMemberOp( dstParam, NULL, field, func ); 449 388 } 450 389 } … … 452 391 } 453 392 454 bool UnionFuncGenerator::shouldAutogen() const { 393 Type * declToType( Declaration * decl ) { 394 if ( DeclarationWithType * dwt = dynamic_cast< DeclarationWithType * >( decl ) ) { 395 return dwt->get_type(); 396 } 397 return nullptr; 398 } 399 400 /// generates struct constructors, destructor, and assignment functions 401 void makeStructFunctions( StructDecl *aggregateDecl, StructInstType *refType, unsigned int functionNesting, std::list< Declaration * > & declsToAdd, const std::vector< FuncData > & data ) { 455 402 // Builtins do not use autogeneration. 456 return ! aggregateDecl->linkage.is_builtin; 457 } 458 459 // xxx - is this right? 460 bool UnionFuncGenerator::isConcurrentType() const { return false; }; 403 if ( aggregateDecl->get_linkage() == LinkageSpec::BuiltinCFA || 404 aggregateDecl->get_linkage() == LinkageSpec::BuiltinC ) { 405 return; 406 } 407 408 // Make function polymorphic in same parameters as generic struct, if applicable 409 const std::list< TypeDecl* > & typeParams = aggregateDecl->get_parameters(); // List of type variables to be placed on the generated functions 410 411 // generate each of the functions based on the supplied FuncData objects 412 std::list< FunctionDecl * > newFuncs; 413 // structure that iterates aggregate decl members, returning their types 414 auto generator = makeFuncGenerator( lazy_map( aggregateDecl->members, declToType ), refType, functionNesting, typeParams, back_inserter( newFuncs ) ); 415 for ( const FuncData & d : data ) { 416 generator.gen( d, aggregateDecl->is_thread() || aggregateDecl->is_monitor() ); 417 } 418 419 // field ctors are only generated if default constructor and copy constructor are both generated 420 unsigned numCtors = std::count_if( newFuncs.begin(), newFuncs.end(), [](FunctionDecl * dcl) { return CodeGen::isConstructor( dcl->get_name() ); } ); 421 422 if ( functionNesting == 0 ) { 423 // forward declare if top-level struct, so that 424 // type is complete as soon as its body ends 425 // Note: this is necessary if we want structs which contain 426 // generic (otype) structs as members. 427 for ( FunctionDecl * dcl : newFuncs ) { 428 addForwardDecl( dcl, declsToAdd ); 429 } 430 } 431 432 for ( FunctionDecl * dcl : newFuncs ) { 433 // generate appropriate calls to member ctor, assignment 434 // destructor needs to do everything in reverse, so pass "forward" based on whether the function is a destructor 435 if ( ! CodeGen::isDestructor( dcl->get_name() ) ) { 436 makeStructFunctionBody( aggregateDecl->get_members().begin(), aggregateDecl->get_members().end(), dcl ); 437 } else { 438 makeStructFunctionBody( aggregateDecl->get_members().rbegin(), aggregateDecl->get_members().rend(), dcl, false ); 439 } 440 if ( CodeGen::isAssignment( dcl->get_name() ) ) { 441 // assignment needs to return a value 442 FunctionType * assignType = dcl->get_functionType(); 443 assert( assignType->get_parameters().size() == 2 ); 444 ObjectDecl * srcParam = strict_dynamic_cast< ObjectDecl * >( assignType->get_parameters().back() ); 445 dcl->get_statements()->get_kids().push_back( new ReturnStmt( noLabels, new VariableExpr( srcParam ) ) ); 446 } 447 declsToAdd.push_back( dcl ); 448 } 449 450 // create constructors which take each member type as a parameter. 451 // for example, for struct A { int x, y; }; generate 452 // void ?{}(A *, int) and void ?{}(A *, int, int) 453 // Field constructors are only generated if default and copy constructor 454 // are generated, since they need access to both 455 if ( numCtors == 2 ) { 456 FunctionType * memCtorType = genDefaultType( refType ); 457 cloneAll( typeParams, memCtorType->get_forall() ); 458 for ( std::list<Declaration *>::iterator i = aggregateDecl->get_members().begin(); i != aggregateDecl->get_members().end(); ++i ) { 459 DeclarationWithType * member = dynamic_cast<DeclarationWithType *>( *i ); 460 assert( member ); 461 if ( isUnnamedBitfield( dynamic_cast< ObjectDecl * > ( member ) ) ) { 462 // don't make a function whose parameter is an unnamed bitfield 463 continue; 464 } else if ( member->get_name() == "" ) { 465 // don't assign to anonymous members 466 // xxx - this is a temporary fix. Anonymous members tie into 467 // our inheritance model. I think the correct way to handle this is to 468 // cast the structure to the type of the member and let the resolver 469 // figure out whether it's valid/choose the correct unnamed member 470 continue; 471 } 472 memCtorType->get_parameters().push_back( new ObjectDecl( member->get_name(), Type::StorageClasses(), LinkageSpec::Cforall, 0, member->get_type()->clone(), 0 ) ); 473 FunctionDecl * ctor = genFunc( "?{}", memCtorType->clone(), functionNesting ); 474 makeStructFieldCtorBody( aggregateDecl->get_members().begin(), aggregateDecl->get_members().end(), ctor ); 475 declsToAdd.push_back( ctor ); 476 } 477 delete memCtorType; 478 } 479 } 461 480 462 481 /// generate a single union assignment expression (using memcpy) 463 482 template< typename OutputIterator > 464 void UnionFuncGenerator::makeMemberOp( ObjectDecl * srcParam, ObjectDecl * dstParam, OutputIterator out ) {483 void makeUnionFieldsAssignment( ObjectDecl * srcParam, ObjectDecl * dstParam, OutputIterator out ) { 465 484 UntypedExpr *copy = new UntypedExpr( new NameExpr( "__builtin_memcpy" ) ); 466 copy-> args.push_back( new AddressExpr( new VariableExpr( dstParam ) ) );467 copy-> args.push_back( new AddressExpr( new VariableExpr( srcParam ) ) );468 copy-> args.push_back( new SizeofExpr( srcParam->get_type()->clone() ) );485 copy->get_args().push_back( new AddressExpr( new VariableExpr( dstParam ) ) ); 486 copy->get_args().push_back( new AddressExpr( new VariableExpr( srcParam ) ) ); 487 copy->get_args().push_back( new SizeofExpr( srcParam->get_type()->clone() ) ); 469 488 *out++ = new ExprStmt( noLabels, copy ); 470 489 } 471 490 472 491 /// generates the body of a union assignment/copy constructor/field constructor 473 void UnionFuncGenerator::genFuncBody( FunctionDecl * funcDecl ) { 474 FunctionType * ftype = funcDecl->type; 475 if ( InitTweak::isCopyConstructor( funcDecl ) || InitTweak::isAssignment( funcDecl ) ) { 476 assert( ftype->parameters.size() == 2 ); 477 ObjectDecl * dstParam = strict_dynamic_cast< ObjectDecl * >( ftype->parameters.front() ); 478 ObjectDecl * srcParam = strict_dynamic_cast< ObjectDecl * >( ftype->parameters.back() ); 479 makeMemberOp( srcParam, dstParam, back_inserter( funcDecl->statements->kids ) ); 480 } else { 481 // default ctor/dtor body is empty - add unused attribute to parameter to silence warnings 482 assert( ftype->parameters.size() == 1 ); 483 ObjectDecl * dstParam = strict_dynamic_cast< ObjectDecl * >( ftype->parameters.front() ); 484 dstParam->attributes.push_back( new Attribute( "unused" ) ); 485 } 486 } 487 488 /// generate the body of a constructor which takes parameters that match fields, e.g. 489 /// void ?{}(A *, int) and void?{}(A *, int, int) for a struct A which has two int fields. 490 void UnionFuncGenerator::genFieldCtors() { 491 // field ctors are only generated if default constructor and copy constructor are both generated 492 unsigned numCtors = std::count_if( definitions.begin(), definitions.end(), [](Declaration * dcl) { return CodeGen::isConstructor( dcl->get_name() ); } ); 493 494 // Field constructors are only generated if default and copy constructor 495 // are generated, since they need access to both 496 if ( numCtors != 2 ) return; 492 void makeUnionAssignBody( FunctionDecl * funcDecl ) { 493 FunctionType * ftype = funcDecl->get_functionType(); 494 assert( ftype->get_parameters().size() == 2 ); 495 ObjectDecl * dstParam = strict_dynamic_cast< ObjectDecl * >( ftype->get_parameters().front() ); 496 ObjectDecl * srcParam = strict_dynamic_cast< ObjectDecl * >( ftype->get_parameters().back() ); 497 498 makeUnionFieldsAssignment( srcParam, dstParam, back_inserter( funcDecl->get_statements()->get_kids() ) ); 499 if ( CodeGen::isAssignment( funcDecl->get_name() ) ) { 500 // also generate return statement in assignment 501 funcDecl->get_statements()->get_kids().push_back( new ReturnStmt( noLabels, new VariableExpr( srcParam ) ) ); 502 } 503 } 504 505 /// generates union constructors, destructors, and assignment operator 506 void makeUnionFunctions( UnionDecl *aggregateDecl, UnionInstType *refType, unsigned int functionNesting, std::list< Declaration * > & declsToAdd ) { 507 // Make function polymorphic in same parameters as generic union, if applicable 508 const std::list< TypeDecl* > & typeParams = aggregateDecl->get_parameters(); // List of type variables to be placed on the generated functions 509 510 // default ctor/dtor need only first parameter 511 // void ?{}(T *); void ^?{}(T *); 512 FunctionType *ctorType = genDefaultType( refType ); 513 FunctionType *dtorType = genDefaultType( refType ); 514 515 // copy ctor needs both parameters 516 // void ?{}(T *, T); 517 FunctionType *copyCtorType = genCopyType( refType ); 518 519 // assignment needs both and return value 520 // T ?=?(T *, T); 521 FunctionType *assignType = genAssignType( refType ); 522 523 cloneAll( typeParams, ctorType->get_forall() ); 524 cloneAll( typeParams, dtorType->get_forall() ); 525 cloneAll( typeParams, copyCtorType->get_forall() ); 526 cloneAll( typeParams, assignType->get_forall() ); 527 528 // add unused attribute to parameters of default constructor and destructor 529 ctorType->get_parameters().front()->get_attributes().push_back( new Attribute( "unused" ) ); 530 dtorType->get_parameters().front()->get_attributes().push_back( new Attribute( "unused" ) ); 531 532 // Routines at global scope marked "static" to prevent multiple definitions is separate translation units 533 // because each unit generates copies of the default routines for each aggregate. 534 FunctionDecl *assignDecl = genFunc( "?=?", assignType, functionNesting ); 535 FunctionDecl *ctorDecl = genFunc( "?{}", ctorType, functionNesting ); 536 FunctionDecl *copyCtorDecl = genFunc( "?{}", copyCtorType, functionNesting ); 537 FunctionDecl *dtorDecl = genFunc( "^?{}", dtorType, functionNesting ); 538 539 makeUnionAssignBody( assignDecl ); 540 541 // body of assignment and copy ctor is the same 542 makeUnionAssignBody( copyCtorDecl ); 497 543 498 544 // create a constructor which takes the first member type as a parameter. … … 500 546 // void ?{}(A *, int) 501 547 // This is to mimic C's behaviour which initializes the first member of the union. 502 FunctionType * memCtorType = genDefaultType( type ); 503 for ( Declaration * member : aggregateDecl->members ) { 504 DeclarationWithType * field = strict_dynamic_cast<DeclarationWithType *>( member ); 505 if ( isUnnamedBitfield( dynamic_cast< ObjectDecl * > ( field ) ) ) { 506 // don't make a function whose parameter is an unnamed bitfield 548 std::list<Declaration *> memCtors; 549 for ( Declaration * member : aggregateDecl->get_members() ) { 550 if ( DeclarationWithType * field = dynamic_cast< DeclarationWithType * >( member ) ) { 551 ObjectDecl * srcParam = new ObjectDecl( "src", Type::StorageClasses(), LinkageSpec::Cforall, 0, field->get_type()->clone(), 0 ); 552 553 FunctionType * memCtorType = ctorType->clone(); 554 memCtorType->get_parameters().push_back( srcParam ); 555 FunctionDecl * ctor = genFunc( "?{}", memCtorType, functionNesting ); 556 557 makeUnionAssignBody( ctor ); 558 memCtors.push_back( ctor ); 559 // only generate a ctor for the first field 507 560 break; 508 561 } 509 memCtorType->parameters.push_back( new ObjectDecl( field->name, Type::StorageClasses(), LinkageSpec::Cforall, nullptr, field->get_type()->clone(), nullptr ) ); 510 FunctionDecl * ctor = genFunc( "?{}", memCtorType->clone(), functionNesting ); 511 ObjectDecl * srcParam = strict_dynamic_cast<ObjectDecl *>( ctor->type->parameters.back() ); 512 srcParam->fixUniqueId(); 513 ObjectDecl * dstParam = InitTweak::getParamThis( ctor->type ); 514 makeMemberOp( srcParam, dstParam, back_inserter( ctor->statements->kids ) ); 515 resolve( ctor ); 516 // only generate one field ctor for unions 517 break; 518 } 519 delete memCtorType; 520 } 521 522 void EnumFuncGenerator::genFuncBody( FunctionDecl * funcDecl ) { 523 // xxx - Temporary: make these functions intrinsic so they codegen as C assignment. 524 // Really they're something of a cross between instrinsic and autogen, so should 525 // probably make a new linkage type 526 funcDecl->linkage = LinkageSpec::Intrinsic; 527 FunctionType * ftype = funcDecl->type; 528 if ( InitTweak::isCopyConstructor( funcDecl ) || InitTweak::isAssignment( funcDecl ) ) { 529 assert( ftype->parameters.size() == 2 ); 530 ObjectDecl * dstParam = strict_dynamic_cast< ObjectDecl * >( ftype->parameters.front() ); 531 ObjectDecl * srcParam = strict_dynamic_cast< ObjectDecl * >( ftype->parameters.back() ); 532 533 // enum copy construct and assignment is just C-style assignment. 534 // this looks like a bad recursive call, but code gen will turn it into 535 // a C-style assignment. 536 // This happens before function pointer type conversion, so need to do it manually here 537 ApplicationExpr * callExpr = new ApplicationExpr( VariableExpr::functionPointer( funcDecl ) ); 538 callExpr->get_args().push_back( new VariableExpr( dstParam ) ); 539 callExpr->get_args().push_back( new VariableExpr( srcParam ) ); 540 funcDecl->statements->push_back( new ExprStmt( noLabels, callExpr ) ); 541 } else { 542 // default ctor/dtor body is empty - add unused attribute to parameter to silence warnings 543 assert( ftype->parameters.size() == 1 ); 544 ObjectDecl * dstParam = strict_dynamic_cast< ObjectDecl * >( ftype->parameters.front() ); 545 dstParam->attributes.push_back( new Attribute( "unused" ) ); 546 } 547 } 548 549 bool EnumFuncGenerator::shouldAutogen() const { return true; } 550 bool EnumFuncGenerator::isConcurrentType() const { return false; } 551 // enums do not have field constructors 552 void EnumFuncGenerator::genFieldCtors() {} 553 554 bool TypeFuncGenerator::shouldAutogen() const { return true; }; 555 556 void TypeFuncGenerator::genFuncBody( FunctionDecl * dcl ) { 557 FunctionType * ftype = dcl->type; 558 assertf( ftype->parameters.size() == 1 || ftype->parameters.size() == 2, "Incorrect number of parameters in autogenerated typedecl function: %zd", ftype->parameters.size() ); 559 DeclarationWithType * dst = ftype->parameters.front(); 560 DeclarationWithType * src = ftype->parameters.size() == 2 ? ftype->parameters.back() : nullptr; 561 // generate appropriate calls to member ctor, assignment 562 UntypedExpr * expr = new UntypedExpr( new NameExpr( dcl->name ) ); 563 expr->args.push_back( new CastExpr( new VariableExpr( dst ), new ReferenceType( Type::Qualifiers(), typeDecl->base->clone() ) ) ); 564 if ( src ) expr->args.push_back( new CastExpr( new VariableExpr( src ), typeDecl->base->clone() ) ); 565 dcl->statements->kids.push_back( new ExprStmt( noLabels, expr ) ); 566 }; 567 568 // xxx - should reach in and determine if base type is concurrent? 569 bool TypeFuncGenerator::isConcurrentType() const { return false; }; 570 571 // opaque types do not have field constructors 572 void TypeFuncGenerator::genFieldCtors() {}; 573 574 //============================================================================================= 575 // Visitor definitions 576 //============================================================================================= 562 } 563 564 declsToAdd.push_back( ctorDecl ); 565 declsToAdd.push_back( copyCtorDecl ); 566 declsToAdd.push_back( dtorDecl ); 567 declsToAdd.push_back( assignDecl ); // assignment should come last since it uses copy constructor in return 568 declsToAdd.splice( declsToAdd.end(), memCtors ); 569 } 570 577 571 AutogenerateRoutines::AutogenerateRoutines() { 578 572 // the order here determines the order that these functions are generated. 579 573 // assignment should come last since it uses copy constructor in return. 580 data.emplace_back( "?{}", genDefaultType ); 581 data.emplace_back( "?{}", genCopyType ); 582 data.emplace_back( "^?{}", genDefaultType ); 583 data.emplace_back( "?=?", genAssignType ); 584 } 585 586 void AutogenerateRoutines::previsit( EnumDecl * enumDecl ) { 587 // must visit children (enum constants) to add them to the indexer 588 if ( enumDecl->has_body() ) { 589 EnumInstType enumInst( Type::Qualifiers(), enumDecl->get_name() ); 590 enumInst.set_baseEnum( enumDecl ); 591 EnumFuncGenerator gen( &enumInst, data, functionNesting, indexer ); 592 generateFunctions( gen, declsToAddAfter ); 593 } 594 } 595 596 void AutogenerateRoutines::previsit( StructDecl * structDecl ) { 597 visit_children = false; 598 if ( structDecl->has_body() ) { 599 StructInstType structInst( Type::Qualifiers(), structDecl->name ); 574 data.push_back( FuncData( "?{}", genDefaultType, constructable ) ); 575 data.push_back( FuncData( "?{}", genCopyType, copyable ) ); 576 data.push_back( FuncData( "^?{}", genDefaultType, destructable ) ); 577 data.push_back( FuncData( "?=?", genAssignType, assignable ) ); 578 } 579 580 void AutogenerateRoutines::visit( EnumDecl *enumDecl ) { 581 if ( ! enumDecl->get_members().empty() ) { 582 EnumInstType *enumInst = new EnumInstType( Type::Qualifiers(), enumDecl->get_name() ); 583 // enumInst->set_baseEnum( enumDecl ); 584 makeEnumFunctions( enumInst, functionNesting, declsToAddAfter ); 585 } 586 } 587 588 void AutogenerateRoutines::visit( StructDecl *structDecl ) { 589 if ( structDecl->has_body() && structsDone.find( structDecl->get_name() ) == structsDone.end() ) { 590 StructInstType structInst( Type::Qualifiers(), structDecl->get_name() ); 591 for ( TypeDecl * typeDecl : structDecl->get_parameters() ) { 592 // need to visit assertions so that they are added to the appropriate maps 593 acceptAll( typeDecl->get_assertions(), *this ); 594 structInst.get_parameters().push_back( new TypeExpr( new TypeInstType( Type::Qualifiers(), typeDecl->get_name(), typeDecl ) ) ); 595 } 600 596 structInst.set_baseStruct( structDecl ); 601 for ( TypeDecl * typeDecl : structDecl->parameters ) { 602 structInst.parameters.push_back( new TypeExpr( new TypeInstType( Type::Qualifiers(), typeDecl->name, typeDecl ) ) ); 603 } 604 StructFuncGenerator gen( structDecl, &structInst, data, functionNesting, indexer ); 605 generateFunctions( gen, declsToAddAfter ); 597 makeStructFunctions( structDecl, &structInst, functionNesting, declsToAddAfter, data ); 598 structsDone.insert( structDecl->get_name() ); 606 599 } // if 607 600 } 608 601 609 void AutogenerateRoutines::previsit( UnionDecl * unionDecl ) { 610 visit_children = false; 611 if ( unionDecl->has_body() ) { 602 void AutogenerateRoutines::visit( UnionDecl *unionDecl ) { 603 if ( ! unionDecl->get_members().empty() ) { 612 604 UnionInstType unionInst( Type::Qualifiers(), unionDecl->get_name() ); 613 605 unionInst.set_baseUnion( unionDecl ); … … 615 607 unionInst.get_parameters().push_back( new TypeExpr( new TypeInstType( Type::Qualifiers(), typeDecl->get_name(), typeDecl ) ) ); 616 608 } 617 UnionFuncGenerator gen( unionDecl, &unionInst, data, functionNesting, indexer ); 618 generateFunctions( gen, declsToAddAfter ); 609 makeUnionFunctions( unionDecl, &unionInst, functionNesting, declsToAddAfter ); 619 610 } // if 620 611 } 621 612 613 Type * declToTypeDeclBase( Declaration * decl ) { 614 if ( TypeDecl * td = dynamic_cast< TypeDecl * >( decl ) ) { 615 return td->base; 616 } 617 return nullptr; 618 } 619 622 620 // generate ctor/dtors/assign for typedecls, e.g., otype T = int *; 623 void AutogenerateRoutines::previsit( TypeDecl * typeDecl ) { 624 visit_children = false; 621 void AutogenerateRoutines::visit( TypeDecl *typeDecl ) { 625 622 if ( ! typeDecl->base ) return; 626 623 624 // generate each of the functions based on the supplied FuncData objects 625 std::list< FunctionDecl * > newFuncs; 626 std::list< Declaration * > tds { typeDecl }; 627 std::list< TypeDecl * > typeParams; 627 628 TypeInstType refType( Type::Qualifiers(), typeDecl->name, typeDecl ); 628 TypeFuncGenerator gen( typeDecl, &refType, data, functionNesting, indexer ); 629 generateFunctions( gen, declsToAddAfter ); 630 } 631 632 void AutogenerateRoutines::previsit( FunctionType *) { 629 auto generator = makeFuncGenerator( lazy_map( tds, declToTypeDeclBase ), &refType, functionNesting, typeParams, back_inserter( newFuncs ) ); 630 for ( const FuncData & d : data ) { 631 generator.gen( d, false ); 632 } 633 634 if ( functionNesting == 0 ) { 635 // forward declare if top-level struct, so that 636 // type is complete as soon as its body ends 637 // Note: this is necessary if we want structs which contain 638 // generic (otype) structs as members. 639 for ( FunctionDecl * dcl : newFuncs ) { 640 addForwardDecl( dcl, declsToAddAfter ); 641 } 642 } 643 644 for ( FunctionDecl * dcl : newFuncs ) { 645 FunctionType * ftype = dcl->type; 646 assertf( ftype->parameters.size() == 1 || ftype->parameters.size() == 2, "Incorrect number of parameters in autogenerated typedecl function: %zd", ftype->parameters.size() ); 647 DeclarationWithType * dst = ftype->parameters.front(); 648 DeclarationWithType * src = ftype->parameters.size() == 2 ? ftype->parameters.back() : nullptr; 649 // generate appropriate calls to member ctor, assignment 650 // destructor needs to do everything in reverse, so pass "forward" based on whether the function is a destructor 651 UntypedExpr * expr = new UntypedExpr( new NameExpr( dcl->name ) ); 652 expr->args.push_back( new CastExpr( new VariableExpr( dst ), new ReferenceType( Type::Qualifiers(), typeDecl->base->clone() ) ) ); 653 if ( src ) expr->args.push_back( new CastExpr( new VariableExpr( src ), typeDecl->base->clone() ) ); 654 dcl->statements->kids.push_back( new ExprStmt( noLabels, expr ) ); 655 if ( CodeGen::isAssignment( dcl->get_name() ) ) { 656 // assignment needs to return a value 657 FunctionType * assignType = dcl->type; 658 assert( assignType->parameters.size() == 2 ); 659 ObjectDecl * srcParam = strict_dynamic_cast< ObjectDecl * >( assignType->parameters.back() ); 660 dcl->statements->kids.push_back( new ReturnStmt( noLabels, new VariableExpr( srcParam ) ) ); 661 } 662 declsToAddAfter.push_back( dcl ); 663 } 664 } 665 666 void addDecls( std::list< Declaration * > &declsToAdd, std::list< Statement * > &statements, std::list< Statement * >::iterator i ) { 667 for ( std::list< Declaration * >::iterator decl = declsToAdd.begin(); decl != declsToAdd.end(); ++decl ) { 668 statements.insert( i, new DeclStmt( noLabels, *decl ) ); 669 } // for 670 declsToAdd.clear(); 671 } 672 673 void AutogenerateRoutines::visit( FunctionType *) { 633 674 // ensure that we don't add assignment ops for types defined as part of the function 634 visit_children = false; 635 } 636 637 void AutogenerateRoutines::previsit( PointerType *) { 675 } 676 677 void AutogenerateRoutines::visit( PointerType *) { 638 678 // ensure that we don't add assignment ops for types defined as part of the pointer 639 visit_children = false; 640 } 641 642 void AutogenerateRoutines::previsit( TraitDecl * ) { 679 } 680 681 void AutogenerateRoutines::visit( TraitDecl *) { 643 682 // ensure that we don't add assignment ops for types defined as part of the trait 644 visit_children = false; 645 } 646 647 void AutogenerateRoutines::previsit( FunctionDecl * functionDecl ) { 648 visit_children = false; 683 } 684 685 template< typename StmtClass > 686 inline void AutogenerateRoutines::visitStatement( StmtClass *stmt ) { 687 std::set< std::string > oldStructs = structsDone; 688 addVisit( stmt, *this ); 689 structsDone = oldStructs; 690 } 691 692 void AutogenerateRoutines::visit( FunctionDecl *functionDecl ) { 649 693 // record the existence of this function as appropriate 650 managedTypes.handleDWT( functionDecl ); 651 652 maybeAccept( functionDecl->type, *visitor ); 694 insert( functionDecl, constructable, InitTweak::isDefaultConstructor ); 695 insert( functionDecl, assignable, InitTweak::isAssignment ); 696 insert( functionDecl, copyable, InitTweak::isCopyConstructor ); 697 insert( functionDecl, destructable, InitTweak::isDestructor ); 698 699 maybeAccept( functionDecl->get_functionType(), *this ); 653 700 functionNesting += 1; 654 maybeAccept( functionDecl-> statements, *visitor);701 maybeAccept( functionDecl->get_statements(), *this ); 655 702 functionNesting -= 1; 656 703 } 657 704 658 void AutogenerateRoutines::previsit( CompoundStmt * ) { 659 GuardScope( managedTypes ); 660 GuardScope( structsDone ); 705 void AutogenerateRoutines::visit( CompoundStmt *compoundStmt ) { 706 constructable.beginScope(); 707 assignable.beginScope(); 708 copyable.beginScope(); 709 destructable.beginScope(); 710 visitStatement( compoundStmt ); 711 constructable.endScope(); 712 assignable.endScope(); 713 copyable.endScope(); 714 destructable.endScope(); 715 } 716 717 void AutogenerateRoutines::visit( SwitchStmt *switchStmt ) { 718 visitStatement( switchStmt ); 661 719 } 662 720 … … 676 734 } 677 735 678 void AutogenTupleRoutines::postvisit( TupleType * tupleType ) { 736 Type * AutogenTupleRoutines::mutate( TupleType * tupleType ) { 737 tupleType = strict_dynamic_cast< TupleType * >( Parent::mutate( tupleType ) ); 679 738 std::string mangleName = SymTab::Mangler::mangleType( tupleType ); 680 if ( seenTuples.find( mangleName ) != seenTuples.end() ) return ;739 if ( seenTuples.find( mangleName ) != seenTuples.end() ) return tupleType; 681 740 seenTuples.insert( mangleName ); 682 741 … … 696 755 if ( TypeInstType * ty = dynamic_cast< TypeInstType * >( t ) ) { 697 756 if ( ! done.count( ty->get_baseType() ) ) { 698 TypeDecl * newDecl = new TypeDecl( ty->get_baseType()->get_name(), Type::StorageClasses(), nullptr, TypeDecl:: Dtype, true);757 TypeDecl * newDecl = new TypeDecl( ty->get_baseType()->get_name(), Type::StorageClasses(), nullptr, TypeDecl::Any ); 699 758 TypeInstType * inst = new TypeInstType( Type::Qualifiers(), newDecl->get_name(), newDecl ); 700 759 newDecl->get_assertions().push_back( new FunctionDecl( "?=?", Type::StorageClasses(), LinkageSpec::Cforall, genAssignType( inst ), nullptr, … … 726 785 makeTupleFunctionBody( dtorDecl ); 727 786 728 declsToAddBefore.push_back( ctorDecl ); 729 declsToAddBefore.push_back( copyCtorDecl ); 730 declsToAddBefore.push_back( dtorDecl ); 731 declsToAddBefore.push_back( assignDecl ); // assignment should come last since it uses copy constructor in return 732 } 733 734 void AutogenTupleRoutines::previsit( FunctionDecl *functionDecl ) { 735 visit_children = false; 736 maybeAccept( functionDecl->type, *visitor ); 787 addDeclaration( ctorDecl ); 788 addDeclaration( copyCtorDecl ); 789 addDeclaration( dtorDecl ); 790 addDeclaration( assignDecl ); // assignment should come last since it uses copy constructor in return 791 792 return tupleType; 793 } 794 795 DeclarationWithType * AutogenTupleRoutines::mutate( FunctionDecl *functionDecl ) { 796 functionDecl->set_functionType( maybeMutate( functionDecl->get_functionType(), *this ) ); 737 797 functionNesting += 1; 738 maybeAccept( functionDecl->statements, *visitor);798 functionDecl->set_statements( maybeMutate( functionDecl->get_statements(), *this ) ); 739 799 functionNesting -= 1; 740 } 741 742 void AutogenTupleRoutines::previsit( CompoundStmt * ) { 743 GuardScope( seenTuples ); 800 return functionDecl; 801 } 802 803 CompoundStmt * AutogenTupleRoutines::mutate( CompoundStmt *compoundStmt ) { 804 seenTuples.beginScope(); 805 compoundStmt = strict_dynamic_cast< CompoundStmt * >( Parent::mutate( compoundStmt ) ); 806 seenTuples.endScope(); 807 return compoundStmt; 744 808 } 745 809 } // SymTab -
src/SymTab/Autogen.h
r3f7e12cb r78315272 19 19 #include <string> // for string 20 20 21 #include "CodeGen/OperatorTable.h"22 21 #include "Common/UniqueName.h" // for UniqueName 23 22 #include "InitTweak/InitTweak.h" // for InitExpander … … 45 44 extern FunctionDecl * dereferenceOperator; 46 45 47 // generate the type of an assignment function for paramType46 // temporary 48 47 FunctionType * genAssignType( Type * paramType ); 49 50 // generate the type of a default constructor or destructor for paramType51 FunctionType * genDefaultType( Type * paramType );52 53 // generate the type of a copy constructor for paramType54 FunctionType * genCopyType( Type * paramType );55 48 56 49 /// inserts into out a generated call expression to function fname with arguments dstParam and srcParam. Intended to be used with generated ?=?, ?{}, and ^?{} calls. … … 61 54 /// optionally returns a statement which must be inserted prior to the containing loop, if there is one 62 55 template< typename OutputIterator > 63 Statement * genScalarCall( InitTweak::InitExpander & srcParam, Expression * dstParam, std::string fname, OutputIterator out, Type * type, bool addCast = false ) { 64 bool isReferenceCtorDtor = false; 65 if ( dynamic_cast< ReferenceType * >( type ) && CodeGen::isCtorDtor( fname ) ) { 66 // reference constructors are essentially application of the rebind operator. 67 // apply & to both arguments, do not need a cast 68 fname = "?=?"; 69 dstParam = new AddressExpr( dstParam ); 70 addCast = false; 71 isReferenceCtorDtor = true; 72 } 73 56 Statement * genScalarCall( InitTweak::InitExpander & srcParam, Expression *dstParam, const std::string & fname, OutputIterator out, Type * type, bool addCast = false ) { 74 57 // want to be able to generate assignment, ctor, and dtor generically, 75 58 // so fname is either ?=?, ?{}, or ^?{} 76 UntypedExpr * fExpr = new UntypedExpr( new NameExpr( fname ) );59 UntypedExpr *fExpr = new UntypedExpr( new NameExpr( fname ) ); 77 60 78 61 if ( addCast ) { … … 89 72 dstParam = new CastExpr( dstParam, new ReferenceType( Type::Qualifiers(), castType ) ); 90 73 } 91 fExpr-> args.push_back( dstParam );74 fExpr->get_args().push_back( dstParam ); 92 75 93 76 Statement * listInit = srcParam.buildListInit( fExpr ); 94 77 95 // fetch next set of arguments 96 ++srcParam; 97 98 // return if adding reference fails - will happen on default constructor and destructor 99 if ( isReferenceCtorDtor && ! srcParam.addReference() ) { 100 delete fExpr; 101 return listInit; 102 } 103 104 std::list< Expression * > args = *srcParam; 105 fExpr->args.splice( fExpr->args.end(), args ); 78 std::list< Expression * > args = *++srcParam; 79 fExpr->get_args().splice( fExpr->get_args().end(), args ); 106 80 107 81 *out++ = new ExprStmt( noLabels, fExpr ); … … 125 99 // generate: for ( int i = 0; i < N; ++i ) 126 100 begin = new ConstantExpr( Constant::from_int( 0 ) ); 127 end = array-> dimension->clone();101 end = array->get_dimension()->clone(); 128 102 cmp = new NameExpr( "?<?" ); 129 103 update = new NameExpr( "++?" ); … … 131 105 // generate: for ( int i = N-1; i >= 0; --i ) 132 106 begin = new UntypedExpr( new NameExpr( "?-?" ) ); 133 ((UntypedExpr*)begin)-> args.push_back( array->dimension->clone() );134 ((UntypedExpr*)begin)-> args.push_back( new ConstantExpr( Constant::from_int( 1 ) ) );107 ((UntypedExpr*)begin)->get_args().push_back( array->get_dimension()->clone() ); 108 ((UntypedExpr*)begin)->get_args().push_back( new ConstantExpr( Constant::from_int( 1 ) ) ); 135 109 end = new ConstantExpr( Constant::from_int( 0 ) ); 136 110 cmp = new NameExpr( "?>=?" ); … … 141 115 142 116 UntypedExpr *cond = new UntypedExpr( cmp ); 143 cond-> args.push_back( new VariableExpr( index ) );144 cond-> args.push_back( end );117 cond->get_args().push_back( new VariableExpr( index ) ); 118 cond->get_args().push_back( end ); 145 119 146 120 UntypedExpr *inc = new UntypedExpr( update ); 147 inc-> args.push_back( new VariableExpr( index ) );121 inc->get_args().push_back( new VariableExpr( index ) ); 148 122 149 123 UntypedExpr *dstIndex = new UntypedExpr( new NameExpr( "?[?]" ) ); 150 dstIndex-> args.push_back( dstParam );151 dstIndex-> args.push_back( new VariableExpr( index ) );124 dstIndex->get_args().push_back( dstParam ); 125 dstIndex->get_args().push_back( new VariableExpr( index ) ); 152 126 dstParam = dstIndex; 153 127 154 128 // srcParam must keep track of the array indices to build the 155 129 // source parameter and/or array list initializer 156 srcParam.addArrayIndex( new VariableExpr( index ), array-> dimension->clone() );130 srcParam.addArrayIndex( new VariableExpr( index ), array->get_dimension()->clone() ); 157 131 158 132 // for stmt's body, eventually containing call 159 133 CompoundStmt * body = new CompoundStmt( noLabels ); 160 Statement * listInit = genCall( srcParam, dstParam, fname, back_inserter( body-> kids ), array->base, addCast, forward );134 Statement * listInit = genCall( srcParam, dstParam, fname, back_inserter( body->get_kids() ), array->get_base(), addCast, forward ); 161 135 162 136 // block containing for stmt and index variable 163 137 std::list<Statement *> initList; 164 138 CompoundStmt * block = new CompoundStmt( noLabels ); 165 block-> push_back( new DeclStmt( noLabels, index ) );139 block->get_kids().push_back( new DeclStmt( noLabels, index ) ); 166 140 if ( listInit ) block->get_kids().push_back( listInit ); 167 block-> push_back( new ForStmt( noLabels, initList, cond, inc, body ) );141 block->get_kids().push_back( new ForStmt( noLabels, initList, cond, inc, body ) ); 168 142 169 143 *out++ = block; … … 171 145 172 146 template< typename OutputIterator > 173 Statement * genCall( InitTweak::InitExpander & srcParam, Expression * dstParam, const std::string & fname, OutputIterator out, Type * type, bool addCast, bool forward ) {147 Statement * genCall( InitTweak::InitExpander & srcParam, Expression * dstParam, const std::string & fname, OutputIterator out, Type * type, bool addCast, bool forward ) { 174 148 if ( ArrayType * at = dynamic_cast< ArrayType * >( type ) ) { 175 149 genArrayCall( srcParam, dstParam, fname, out, at, addCast, forward ); … … 185 159 /// ImplicitCtorDtorStmt node. 186 160 template< typename OutputIterator > 187 void genImplicitCall( InitTweak::InitExpander & srcParam, Expression * dstParam, const std::string & fname, OutputIterator out, DeclarationWithType * decl, bool forward = true ) {161 void genImplicitCall( InitTweak::InitExpander & srcParam, Expression * dstParam, const std::string & fname, OutputIterator out, DeclarationWithType * decl, bool forward = true ) { 188 162 ObjectDecl *obj = dynamic_cast<ObjectDecl *>( decl ); 189 163 assert( obj ); … … 193 167 bool addCast = (fname == "?{}" || fname == "^?{}") && ( !obj || ( obj && ! obj->get_bitfieldWidth() ) ); 194 168 std::list< Statement * > stmts; 195 genCall( srcParam, dstParam, fname, back_inserter( stmts ), obj-> type, addCast, forward );169 genCall( srcParam, dstParam, fname, back_inserter( stmts ), obj->get_type(), addCast, forward ); 196 170 197 171 // currently genCall should produce at most one element, but if that changes then the next line needs to be updated to grab the statement which contains the call -
src/SymTab/FixFunction.cc
r3f7e12cb r78315272 26 26 FixFunction::FixFunction() : isVoid( false ) {} 27 27 28 29 DeclarationWithType * FixFunction::postmutate(FunctionDecl *functionDecl) { 30 // can't delete function type because it may contain assertions, so transfer ownership to new object 31 ObjectDecl *pointer = new ObjectDecl( functionDecl->name, functionDecl->get_storageClasses(), functionDecl->linkage, nullptr, new PointerType( Type::Qualifiers(), functionDecl->type ), nullptr, functionDecl->attributes ); 32 functionDecl->attributes.clear(); 33 functionDecl->type = nullptr; 28 DeclarationWithType * FixFunction::mutate(FunctionDecl *functionDecl) { 29 ObjectDecl *pointer = new ObjectDecl( functionDecl->get_name(), functionDecl->get_storageClasses(), functionDecl->get_linkage(), 0, new PointerType( Type::Qualifiers(), functionDecl->get_type() ), 0, functionDecl->get_attributes() ); 30 functionDecl->get_attributes().clear(); 31 // can't delete function type because it may contain assertions, but can't transfer ownership without a clone since set_type checks for nullptr 32 functionDecl->set_type( functionDecl->get_type()->clone() ); 34 33 delete functionDecl; 35 34 return pointer; 36 35 } 37 36 38 Type * FixFunction::postmutate(ArrayType *arrayType) { 37 Type * FixFunction::mutate(VoidType *voidType) { 38 isVoid = true; 39 return voidType; 40 } 41 42 Type * FixFunction::mutate(BasicType *basicType) { 43 return basicType; 44 } 45 46 Type * FixFunction::mutate(PointerType *pointerType) { 47 return pointerType; 48 } 49 50 Type * FixFunction::mutate(ArrayType *arrayType) { 39 51 // need to recursively mutate the base type in order for multi-dimensional arrays to work. 40 PointerType *pointerType = new PointerType( arrayType->get_qualifiers(), arrayType->base, arrayType->dimension, arrayType->isVarLen, arrayType->isStatic ); 41 arrayType->base = nullptr; 42 arrayType->dimension = nullptr; 52 PointerType *pointerType = new PointerType( arrayType->get_qualifiers(), arrayType->get_base()->clone()->acceptMutator( *this ), maybeClone( arrayType->get_dimension() ), arrayType->get_isVarLen(), arrayType->get_isStatic() ); 43 53 delete arrayType; 44 54 return pointerType; 45 55 } 46 56 47 void FixFunction::premutate(VoidType *) {48 isVoid = true;57 Type * FixFunction::mutate(StructInstType *aggregateUseType) { 58 return aggregateUseType; 49 59 } 50 60 51 void FixFunction::premutate(FunctionDecl *) { visit_children = false; } 52 void FixFunction::premutate(ArrayType *) { visit_children = false; } 53 void FixFunction::premutate(BasicType *) { visit_children = false; } 54 void FixFunction::premutate(PointerType *) { visit_children = false; } 55 void FixFunction::premutate(StructInstType *) { visit_children = false; } 56 void FixFunction::premutate(UnionInstType *) { visit_children = false; } 57 void FixFunction::premutate(EnumInstType *) { visit_children = false; } 58 void FixFunction::premutate(TraitInstType *) { visit_children = false; } 59 void FixFunction::premutate(TypeInstType *) { visit_children = false; } 60 void FixFunction::premutate(TupleType *) { visit_children = false; } 61 void FixFunction::premutate(VarArgsType *) { visit_children = false; } 62 void FixFunction::premutate(ZeroType *) { visit_children = false; } 63 void FixFunction::premutate(OneType *) { visit_children = false; } 61 Type * FixFunction::mutate(UnionInstType *aggregateUseType) { 62 return aggregateUseType; 63 } 64 65 Type * FixFunction::mutate(EnumInstType *aggregateUseType) { 66 return aggregateUseType; 67 } 68 69 Type * FixFunction::mutate(TraitInstType *aggregateUseType) { 70 return aggregateUseType; 71 } 72 73 Type * FixFunction::mutate(TypeInstType *aggregateUseType) { 74 return aggregateUseType; 75 } 76 77 Type * FixFunction::mutate(TupleType *tupleType) { 78 return tupleType; 79 } 80 81 Type * FixFunction::mutate(VarArgsType *varArgsType) { 82 return varArgsType; 83 } 84 85 Type * FixFunction::mutate(ZeroType *zeroType) { 86 return zeroType; 87 } 88 89 Type * FixFunction::mutate(OneType *oneType) { 90 return oneType; 91 } 64 92 } // namespace SymTab 65 93 -
src/SymTab/FixFunction.h
r3f7e12cb r78315272 16 16 #pragma once 17 17 18 #include " Common/PassVisitor.h" // for PassVisitor19 #include "SynTree/SynTree.h" // for Types18 #include "SynTree/Mutator.h" // for Mutator 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 WithShortCircuiting{23 class FixFunction : public Mutator { 24 24 typedef Mutator Parent; 25 25 public: 26 26 FixFunction(); 27 27 28 void premutate(FunctionDecl *functionDecl); 29 DeclarationWithType* postmutate(FunctionDecl *functionDecl); 28 bool get_isVoid() const { return isVoid; } 29 void set_isVoid( bool newValue ) { isVoid = newValue; } 30 private: 31 virtual DeclarationWithType* mutate(FunctionDecl *functionDecl); 30 32 31 Type * postmutate(ArrayType * arrayType); 32 33 void premutate(ArrayType * arrayType); 34 void premutate(VoidType * voidType); 35 void premutate(BasicType * basicType); 36 void premutate(PointerType * pointerType); 37 void premutate(StructInstType * aggregateUseType); 38 void premutate(UnionInstType * aggregateUseType); 39 void premutate(EnumInstType * aggregateUseType); 40 void premutate(TraitInstType * aggregateUseType); 41 void premutate(TypeInstType * aggregateUseType); 42 void premutate(TupleType * tupleType); 43 void premutate(VarArgsType * varArgsType); 44 void premutate(ZeroType * zeroType); 45 void premutate(OneType * oneType); 33 virtual Type* mutate(VoidType *voidType); 34 virtual Type* mutate(BasicType *basicType); 35 virtual Type* mutate(PointerType *pointerType); 36 virtual Type* mutate(ArrayType *arrayType); 37 virtual Type* mutate(StructInstType *aggregateUseType); 38 virtual Type* mutate(UnionInstType *aggregateUseType); 39 virtual Type* mutate(EnumInstType *aggregateUseType); 40 virtual Type* mutate(TraitInstType *aggregateUseType); 41 virtual Type* mutate(TypeInstType *aggregateUseType); 42 virtual Type* mutate(TupleType *tupleType); 43 virtual Type* mutate(VarArgsType *varArgsType); 44 virtual Type* mutate(ZeroType *zeroType); 45 virtual Type* mutate(OneType *oneType); 46 46 47 47 bool isVoid; -
src/SymTab/Indexer.cc
r3f7e12cb r78315272 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 42 55 typedef std::unordered_map< std::string, DeclarationWithType* > MangleTable; 43 56 typedef std::unordered_map< std::string, MangleTable > IdTable; … … 185 198 } 186 199 187 Indexer::Indexer( ) : tables( 0 ), scope( 0) {}188 189 Indexer::Indexer( const Indexer &that ) : doDebug( that.doDebug ), tables( newRef( that.tables ) ), scope( that.scope) {}190 191 Indexer::Indexer( Indexer &&that ) : doDebug( that.doDebug ), tables( that.tables ), scope( that.scope) {200 Indexer::Indexer( bool _doDebug ) : tables( 0 ), scope( 0 ), doDebug( _doDebug ) {} 201 202 Indexer::Indexer( const Indexer &that ) : tables( newRef( that.tables ) ), scope( that.scope ), doDebug( that.doDebug ) {} 203 204 Indexer::Indexer( Indexer &&that ) : tables( that.tables ), scope( that.scope ), doDebug( that.doDebug ) { 192 205 that.tables = 0; 193 206 } … … 407 420 makeWritable(); 408 421 409 const std::string &name = decl-> name;422 const std::string &name = decl->get_name(); 410 423 std::string mangleName; 411 if ( LinkageSpec::isOverridable( decl-> linkage) ) {424 if ( LinkageSpec::isOverridable( decl->get_linkage() ) ) { 412 425 // mangle the name without including the appropriate suffix, so overridable routines are placed into the 413 426 // same "bucket" as their user defined versions. … … 418 431 419 432 // this ensures that no two declarations with the same unmangled name at the same scope both have C linkage 420 if ( ! LinkageSpec::isMangled( decl-> linkage) ) {433 if ( ! LinkageSpec::isMangled( decl->get_linkage() ) ) { 421 434 // NOTE this is broken in Richard's original code in such a way that it never triggers (it 422 435 // doesn't check decls that have the same manglename, and all C-linkage decls are defined to … … 571 584 572 585 if ( doDebug ) { 573 std::c err<< "--- Entering scope " << scope << std::endl;586 std::cout << "--- Entering scope " << scope << std::endl; 574 587 } 575 588 } 576 589 577 590 void Indexer::leaveScope() { 578 using std::c err;591 using std::cout; 579 592 580 593 assert( scope > 0 && "cannot leave initial scope" ); 581 if ( doDebug ) {582 cerr << "--- Leaving scope " << scope << " containing" << std::endl;583 }584 594 --scope; 585 595 586 596 while ( tables && tables->scope > scope ) { 587 597 if ( doDebug ) { 588 dump( tables->idTable, cerr ); 589 dump( tables->typeTable, cerr ); 590 dump( tables->structTable, cerr ); 591 dump( tables->enumTable, cerr ); 592 dump( tables->unionTable, cerr ); 593 dump( tables->traitTable, cerr ); 598 cout << "--- Leaving scope " << tables->scope << " containing" << std::endl; 599 dump( tables->idTable, cout ); 600 dump( tables->typeTable, cout ); 601 dump( tables->structTable, cout ); 602 dump( tables->enumTable, cout ); 603 dump( tables->unionTable, cout ); 604 dump( tables->traitTable, cout ); 594 605 } 595 606 -
src/SymTab/Indexer.h
r3f7e12cb r78315272 26 26 class Indexer { 27 27 public: 28 explicit Indexer( );28 explicit Indexer( bool useDebug = false ); 29 29 30 30 Indexer( const Indexer &that ); … … 76 76 void addTrait( TraitDecl *decl ); 77 77 78 bool doDebug = false; ///< Display debugging trace?79 78 private: 80 79 struct Impl; … … 82 81 Impl *tables; ///< Copy-on-write instance of table data structure 83 82 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
r3f7e12cb r78315272 9 9 // Author : Richard C. Bilson 10 10 // Created On : Sun May 17 21:40:29 2015 11 // Last Modified By : Peter A. Buhr12 // Last Modified On : Mon Sep 25 15:49:26201713 // Update Count : 2 311 // Last Modified By : Andrew Beach 12 // Last Modified On : Wed Jun 28 15:31:00 2017 13 // Update Count : 21 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 , true);33 std::string Mangler::mangleType( Type *ty ) { 34 Mangler mangler( false, true ); 35 35 maybeAccept( ty, mangler ); 36 36 return mangler.get_mangleName(); 37 37 } 38 38 39 std::string Mangler::mangleConcrete( Type* ty ) { 40 Mangler mangler( false, false, false ); 41 maybeAccept( ty, mangler ); 42 return mangler.get_mangleName(); 43 } 44 45 Mangler::Mangler( bool mangleOverridable, bool typeMode, bool mangleGenericParams ) 46 : nextVarNum( 0 ), isTopLevel( true ), mangleOverridable( mangleOverridable ), typeMode( typeMode ), mangleGenericParams( mangleGenericParams ) {} 39 Mangler::Mangler( bool mangleOverridable, bool typeMode ) 40 : nextVarNum( 0 ), isTopLevel( true ), mangleOverridable( mangleOverridable ), typeMode( typeMode ) {} 47 41 48 42 Mangler::Mangler( const Mangler &rhs ) : mangleName() { … … 54 48 } 55 49 56 void Mangler::mangleDecl( DeclarationWithType * declaration ) {50 void Mangler::mangleDecl( DeclarationWithType *declaration ) { 57 51 bool wasTopLevel = isTopLevel; 58 52 if ( isTopLevel ) { … … 85 79 } 86 80 87 void Mangler::visit( ObjectDecl * declaration ) {81 void Mangler::visit( ObjectDecl *declaration ) { 88 82 mangleDecl( declaration ); 89 83 } 90 84 91 void Mangler::visit( FunctionDecl * declaration ) {85 void Mangler::visit( FunctionDecl *declaration ) { 92 86 mangleDecl( declaration ); 93 87 } 94 88 95 void Mangler::visit( VoidType * voidType ) {89 void Mangler::visit( VoidType *voidType ) { 96 90 printQualifiers( voidType ); 97 91 mangleName << "v"; 98 92 } 99 93 100 void Mangler::visit( BasicType * basicType ) {94 void Mangler::visit( BasicType *basicType ) { 101 95 static const char *btLetter[] = { 102 96 "b", // Bool … … 121 115 "Id", // DoubleImaginary 122 116 "Ir", // LongDoubleImaginary 123 "w", // SignedInt128124 "Uw", // UnsignedInt128125 117 }; 126 118 … … 129 121 } 130 122 131 void Mangler::visit( PointerType * pointerType ) {123 void Mangler::visit( PointerType *pointerType ) { 132 124 printQualifiers( pointerType ); 133 125 mangleName << "P"; … … 135 127 } 136 128 137 void Mangler::visit( ArrayType * arrayType ) {129 void Mangler::visit( ArrayType *arrayType ) { 138 130 // TODO: encode dimension 139 131 printQualifiers( arrayType ); … … 142 134 } 143 135 144 void Mangler::visit( ReferenceType * refType ) {136 void Mangler::visit( ReferenceType *refType ) { 145 137 printQualifiers( refType ); 146 138 mangleName << "R"; … … 157 149 } 158 150 159 void Mangler::visit( FunctionType * functionType ) {151 void Mangler::visit( FunctionType *functionType ) { 160 152 printQualifiers( functionType ); 161 153 mangleName << "F"; … … 168 160 } 169 161 170 void Mangler::mangleRef( ReferenceToType * refType, std::string prefix ) {162 void Mangler::mangleRef( ReferenceToType *refType, std::string prefix ) { 171 163 printQualifiers( refType ); 172 164 173 165 mangleName << ( refType->get_name().length() + prefix.length() ) << prefix << refType->get_name(); 174 175 if ( mangleGenericParams ) { 176 std::list< Expression* >& params = refType->get_parameters(); 177 if ( ! params.empty() ) { 178 mangleName << "_"; 179 for ( std::list< Expression* >::const_iterator param = params.begin(); param != params.end(); ++param ) { 180 TypeExpr *paramType = dynamic_cast< TypeExpr* >( *param ); 181 assertf(paramType, "Aggregate parameters should be type expressions: %s", toString(*param).c_str()); 182 maybeAccept( paramType->get_type(), *this ); 183 } 184 mangleName << "_"; 166 } 167 168 void Mangler::mangleGenericRef( ReferenceToType *refType, std::string prefix ) { 169 printQualifiers( refType ); 170 171 std::ostringstream oldName( mangleName.str() ); 172 mangleName.clear(); 173 174 mangleName << prefix << refType->get_name(); 175 176 std::list< Expression* >& params = refType->get_parameters(); 177 if ( ! params.empty() ) { 178 mangleName << "_"; 179 for ( std::list< Expression* >::const_iterator param = params.begin(); param != params.end(); ++param ) { 180 TypeExpr *paramType = dynamic_cast< TypeExpr* >( *param ); 181 assertf(paramType, "Aggregate parameters should be type expressions: %s", toString(*param).c_str()); 182 maybeAccept( paramType->get_type(), *this ); 185 183 } 184 mangleName << "_"; 186 185 } 187 } 188 189 void Mangler::visit( StructInstType * aggregateUseType ) { 190 mangleRef( aggregateUseType, "s" ); 191 } 192 193 void Mangler::visit( UnionInstType * aggregateUseType ) { 194 mangleRef( aggregateUseType, "u" ); 195 } 196 197 void Mangler::visit( EnumInstType * aggregateUseType ) { 186 187 oldName << mangleName.str().length() << mangleName.str(); 188 mangleName.str( oldName.str() ); 189 } 190 191 void Mangler::visit( StructInstType *aggregateUseType ) { 192 if ( typeMode ) mangleGenericRef( aggregateUseType, "s" ); 193 else mangleRef( aggregateUseType, "s" ); 194 } 195 196 void Mangler::visit( UnionInstType *aggregateUseType ) { 197 if ( typeMode ) mangleGenericRef( aggregateUseType, "u" ); 198 else mangleRef( aggregateUseType, "u" ); 199 } 200 201 void Mangler::visit( EnumInstType *aggregateUseType ) { 198 202 mangleRef( aggregateUseType, "e" ); 199 203 } 200 204 201 void Mangler::visit( TypeInstType * typeInst ) {205 void Mangler::visit( TypeInstType *typeInst ) { 202 206 VarMapType::iterator varNum = varNums.find( typeInst->get_name() ); 203 207 if ( varNum == varNums.end() ) { … … 208 212 numStream << varNum->second.first; 209 213 switch ( (TypeDecl::Kind )varNum->second.second ) { 214 case TypeDecl::Any: 215 mangleName << "t"; 216 break; 210 217 case TypeDecl::Dtype: 211 218 mangleName << "d"; … … 224 231 } 225 232 226 void Mangler::visit( TupleType * tupleType ) {233 void Mangler::visit( TupleType *tupleType ) { 227 234 printQualifiers( tupleType ); 228 235 mangleName << "T"; 229 acceptAll( tupleType-> types, *this );236 acceptAll( tupleType->get_types(), *this ); 230 237 mangleName << "_"; 231 238 } 232 239 233 void Mangler::visit( VarArgsType * varArgsType ) {240 void Mangler::visit( VarArgsType *varArgsType ) { 234 241 printQualifiers( varArgsType ); 235 242 mangleName << "VARGS"; 236 243 } 237 244 238 void Mangler::visit( ZeroType *) {245 void Mangler::visit( __attribute__((unused)) ZeroType *zeroType ) { 239 246 mangleName << "Z"; 240 247 } 241 248 242 void Mangler::visit( OneType *) {249 void Mangler::visit( __attribute__((unused)) OneType *oneType ) { 243 250 mangleName << "O"; 244 251 } 245 252 246 void Mangler::visit( TypeDecl * decl ) {253 void Mangler::visit( TypeDecl *decl ) { 247 254 static const char *typePrefix[] = { "BT", "BD", "BF" }; 248 mangleName << typePrefix[ decl->get_kind() ] << ( decl-> name.length() + 1 ) << decl->name;255 mangleName << typePrefix[ decl->get_kind() ] << ( decl->get_name().length() + 1 ) << decl->get_name(); 249 256 } 250 257 … … 255 262 } 256 263 257 void Mangler::printQualifiers( Type * type ) {264 void Mangler::printQualifiers( Type *type ) { 258 265 // skip if not including qualifiers 259 266 if ( typeMode ) return; … … 263 270 int tcount = 0, dcount = 0, fcount = 0, vcount = 0; 264 271 mangleName << "A"; 265 for ( Type::ForallList::iterator i = type-> forall.begin(); i != type->forall.end(); ++i ) {272 for ( Type::ForallList::iterator i = type->get_forall().begin(); i != type->get_forall().end(); ++i ) { 266 273 switch ( (*i)->get_kind() ) { 274 case TypeDecl::Any: 275 tcount++; 276 break; 267 277 case TypeDecl::Dtype: 268 278 dcount++; … … 277 287 assert( false ); 278 288 } // switch 279 varNums[ (*i )->name ] = std::pair< int, int >( nextVarNum++, (int)(*i)->get_kind() );280 for ( std::list< DeclarationWithType* >::iterator assert = (*i )->assertions.begin(); assert != (*i)->assertions.end(); ++assert ) {281 Mangler sub_mangler( mangleOverridable, typeMode , mangleGenericParams);289 varNums[ (*i )->get_name() ] = std::pair< int, int >( nextVarNum++, (int )(*i )->get_kind() ); 290 for ( std::list< DeclarationWithType* >::iterator assert = (*i )->get_assertions().begin(); assert != (*i )->get_assertions().end(); ++assert ) { 291 Mangler sub_mangler( mangleOverridable, typeMode ); 282 292 sub_mangler.nextVarNum = nextVarNum; 283 293 sub_mangler.isTopLevel = false; … … 297 307 mangleName << "V"; 298 308 } // if 299 if ( type->get_mutex() ) {300 mangleName << "M";301 } // if302 309 // Removed due to restrict not affecting function compatibility in GCC 303 310 // if ( type->get_isRestrict() ) { … … 305 312 // } // if 306 313 if ( type->get_lvalue() ) { 307 // mangle based on whether the type is lvalue, so that the resolver can differentiate lvalues and rvalues308 314 mangleName << "L"; 309 } 315 } // if 310 316 if ( type->get_atomic() ) { 311 317 mangleName << "A"; -
src/SymTab/Mangler.h
r3f7e12cb r78315272 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 , bool mangleGenericParams = true);32 static std::string mangle( SynTreeClass *decl, bool mangleOverridable = true, bool typeMode = false ); 33 33 /// Mangle a type name; secondary interface 34 34 static std::string mangleType( Type* ty ); 35 /// Mangle ignoring generic type parameters36 static std::string mangleConcrete( Type* ty );37 38 35 39 36 virtual void visit( ObjectDecl *declaration ); … … 65 62 bool mangleOverridable; ///< Specially mangle overridable built-in methods 66 63 bool typeMode; ///< Produce a unique mangled name for a type 67 bool mangleGenericParams; ///< Include generic parameters in name mangling if true68 64 69 Mangler( bool mangleOverridable, bool typeMode , bool mangleGenericParams);65 Mangler( bool mangleOverridable, bool typeMode ); 70 66 Mangler( const Mangler & ); 71 67 72 68 void mangleDecl( DeclarationWithType *declaration ); 73 69 void mangleRef( ReferenceToType *refType, std::string prefix ); 70 void mangleGenericRef( ReferenceToType *refType, std::string prefix ); 74 71 75 72 void printQualifiers( Type *type ); … … 77 74 78 75 template< typename SynTreeClass > 79 std::string Mangler::mangle( SynTreeClass *decl, bool mangleOverridable, bool typeMode , bool mangleGenericParams) {80 Mangler mangler( mangleOverridable, typeMode , mangleGenericParams);76 std::string Mangler::mangle( SynTreeClass *decl, bool mangleOverridable, bool typeMode ) { 77 Mangler mangler( mangleOverridable, typeMode ); 81 78 maybeAccept( decl, mangler ); 82 79 return mangler.get_mangleName(); -
src/SymTab/Validate.cc
r3f7e12cb r78315272 56 56 #include "FixFunction.h" // for FixFunction 57 57 #include "Indexer.h" // for Indexer 58 #include "InitTweak/GenInit.h" // for fixReturnStatements59 58 #include "InitTweak/InitTweak.h" // for isCtorDtorAssign 60 59 #include "Parser/LinkageSpec.h" // for C … … 151 150 /// Replaces array and function types in forall lists by appropriate pointer type and assigns each Object and Function declaration a unique ID. 152 151 struct ForallPointerDecay final { 153 void previsit( ObjectDecl * object ); 154 void previsit( FunctionDecl * func ); 155 void previsit( StructDecl * aggrDecl ); 156 void previsit( UnionDecl * aggrDecl ); 152 void previsit( ObjectDecl *object ); 153 void previsit( FunctionDecl *func ); 157 154 }; 158 155 … … 268 265 HoistStruct::hoistStruct( translationUnit ); // must happen after EliminateTypedef, so that aggregate typedefs occur in the correct order 269 266 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 mangling271 267 acceptAll( translationUnit, lrt ); // must happen before autogen, because sized flag needs to propagate to generated functions 272 268 acceptAll( translationUnit, genericParams ); // check as early as possible - can't happen before LinkReferenceToTypes 269 acceptAll( translationUnit, epc ); // must happen before VerifyCtorDtorAssign, because void return objects should not exist 273 270 VerifyCtorDtorAssign::verify( translationUnit ); // must happen before autogen, because autogen examines existing ctor/dtors 274 ReturnChecker::checkFunctionReturns( translationUnit );275 InitTweak::fixReturnStatements( translationUnit ); // must happen before autogen276 271 Concurrency::applyKeywords( translationUnit ); 277 acceptAll( translationUnit, fpd ); // must happen before autogenerateRoutines, after Concurrency::applyKeywords because uniqueIds must be set on declaration before resolution278 272 autogenerateRoutines( translationUnit ); // moved up, used to be below compoundLiteral - currently needs EnumAndPointerDecay 279 273 Concurrency::implementMutexFuncs( translationUnit ); 280 274 Concurrency::implementThreadStarter( translationUnit ); 275 ReturnChecker::checkFunctionReturns( translationUnit ); 281 276 mutateAll( translationUnit, compoundliteral ); 277 acceptAll( translationUnit, fpd ); 282 278 ArrayLength::computeLength( translationUnit ); 283 acceptAll( translationUnit, finder ); // xxx - remove this pass soon279 acceptAll( translationUnit, finder ); 284 280 mutateAll( translationUnit, labelAddrFixer ); 285 281 } … … 372 368 DWTIterator begin( dwts.begin() ), end( dwts.end() ); 373 369 if ( begin == end ) return; 374 PassVisitor<FixFunction>fixer;370 FixFunction fixer; 375 371 DWTIterator i = begin; 376 372 *i = (*i)->acceptMutator( fixer ); 377 if ( fixer. pass.isVoid) {373 if ( fixer.get_isVoid() ) { 378 374 DWTIterator j = i; 379 375 ++i; … … 386 382 ++i; 387 383 for ( ; i != end; ++i ) { 388 PassVisitor<FixFunction>fixer;384 FixFunction fixer; 389 385 *i = (*i)->acceptMutator( fixer ); 390 if ( fixer. pass.isVoid) {386 if ( fixer.get_isVoid() ) { 391 387 throw SemanticError( "invalid type void in function type ", func ); 392 388 } // if … … 583 579 584 580 /// Fix up assertions - flattens assertion lists, removing all trait instances 585 void forallFixer( std::list< TypeDecl * > & forall, BaseSyntaxNode * node) {586 for ( TypeDecl * type : f orall) {581 void forallFixer( Type * func ) { 582 for ( TypeDecl * type : func->get_forall() ) { 587 583 std::list< DeclarationWithType * > asserts; 588 584 asserts.splice( asserts.end(), type->assertions ); … … 600 596 // apply FixFunction to every assertion to check for invalid void type 601 597 for ( DeclarationWithType *& assertion : type->assertions ) { 602 PassVisitor<FixFunction>fixer;598 FixFunction fixer; 603 599 assertion = assertion->acceptMutator( fixer ); 604 if ( fixer. pass.isVoid) {605 throw SemanticError( "invalid type void in assertion of function ", node);600 if ( fixer.get_isVoid() ) { 601 throw SemanticError( "invalid type void in assertion of function ", func ); 606 602 } // if 607 603 } // for … … 611 607 612 608 void ForallPointerDecay::previsit( ObjectDecl *object ) { 613 forallFixer( object-> type->forall, object);614 if ( PointerType *pointer = dynamic_cast< PointerType * >( object-> type) ) {615 forallFixer( pointer-> base->forall, object);609 forallFixer( object->get_type() ); 610 if ( PointerType *pointer = dynamic_cast< PointerType * >( object->get_type() ) ) { 611 forallFixer( pointer->get_base() ); 616 612 } // if 617 613 object->fixUniqueId(); … … 619 615 620 616 void ForallPointerDecay::previsit( FunctionDecl *func ) { 621 forallFixer( func-> type->forall, func);617 forallFixer( func->get_type() ); 622 618 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 );631 619 } 632 620 … … 668 656 } 669 657 filter( translationUnit, isTypedef, true ); 658 670 659 } 671 660 … … 675 664 TypedefMap::const_iterator def = typedefNames.find( typeInst->get_name() ); 676 665 if ( def != typedefNames.end() ) { 677 Type *ret = def->second.first-> base->clone();666 Type *ret = def->second.first->get_base()->clone(); 678 667 ret->get_qualifiers() |= typeInst->get_qualifiers(); 679 668 // place instance parameters on the typedef'd type 680 if ( ! typeInst-> parameters.empty() ) {669 if ( ! typeInst->get_parameters().empty() ) { 681 670 ReferenceToType *rtt = dynamic_cast<ReferenceToType*>(ret); 682 671 if ( ! rtt ) { 683 throw SemanticError(" Cannot apply type parameters to base type of " + typeInst->name);672 throw SemanticError("cannot apply type parameters to base type of " + typeInst->get_name()); 684 673 } 685 674 rtt->get_parameters().clear(); 686 cloneAll( typeInst-> parameters, rtt->parameters);687 mutateAll( rtt-> parameters, *visitor ); // recursively fix typedefs on parameters675 cloneAll( typeInst->get_parameters(), rtt->get_parameters() ); 676 mutateAll( rtt->get_parameters(), *visitor ); // recursively fix typedefs on parameters 688 677 } // if 689 678 delete typeInst; … … 691 680 } else { 692 681 TypeDeclMap::const_iterator base = typedeclNames.find( typeInst->get_name() ); 693 assertf( base != typedeclNames.end(), "Cannot find typedecl name %s", typeInst-> name.c_str() );682 assertf( base != typedeclNames.end(), "Cannot find typedecl name %s", typeInst->get_name().c_str() ); 694 683 typeInst->set_baseType( base->second ); 695 684 } // if 696 685 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;711 686 } 712 687 … … 719 694 Type * t2 = typedefNames[ tyDecl->get_name() ].first->get_base(); 720 695 if ( ! ResolvExpr::typesCompatible( t1, t2, Indexer() ) ) { 721 throw SemanticError( "Cannot redefine typedef: " + tyDecl->name ); 722 } 723 // cannot redefine VLA typedefs 724 if ( isVariableLength( t1 ) || isVariableLength( t2 ) ) { 725 throw SemanticError( "Cannot redefine typedef: " + tyDecl->name ); 696 throw SemanticError( "cannot redefine typedef: " + tyDecl->get_name() ); 726 697 } 727 698 } else { -
src/SynTree/AddressExpr.cc
r3f7e12cb r78315272 33 33 Type * addrType( Type * type ) { 34 34 if ( ReferenceType * refType = dynamic_cast< ReferenceType * >( type ) ) { 35 return new ReferenceType( refType->get_qualifiers(), addrType( refType-> base) );35 return new ReferenceType( refType->get_qualifiers(), addrType( refType->get_base() ) ); 36 36 } else { 37 37 return new PointerType( Type::Qualifiers(), type->clone() ); … … 40 40 } 41 41 42 AddressExpr::AddressExpr( Expression *arg ) : Expression(), arg( arg ) {43 if ( arg-> result) {44 if ( arg-> result->get_lvalue() ) {42 AddressExpr::AddressExpr( Expression *arg, Expression *_aname ) : Expression( _aname ), arg( arg ) { 43 if ( arg->has_result() ) { 44 if ( arg->get_result()->get_lvalue() ) { 45 45 // lvalue, retains all layers of reference and gains a pointer inside the references 46 set_result( addrType( arg-> result) );46 set_result( addrType( arg->get_result() ) ); 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-> result);50 set_result( addrType( refType-> base) );49 ReferenceType * refType = strict_dynamic_cast< ReferenceType * >( arg->get_result() ); 50 set_result( addrType( refType->get_base() ) ); 51 51 } 52 52 // result of & is never an lvalue … … 62 62 } 63 63 64 void AddressExpr::print( std::ostream &os, Indenterindent ) const {64 void AddressExpr::print( std::ostream &os, int indent ) const { 65 65 os << "Address of:" << std::endl; 66 66 if ( arg ) { 67 os << indent+1;68 arg->print( os, indent+ 1);67 os << std::string( indent+2, ' ' ); 68 arg->print( os, indent+2 ); 69 69 } // if 70 70 } … … 77 77 LabelAddressExpr::~LabelAddressExpr() {} 78 78 79 void LabelAddressExpr::print( std::ostream & os, Indenter) const {80 os << "Address of label:" << arg;79 void LabelAddressExpr::print( std::ostream & os, int indent ) const { 80 os << "Address of label:" << std::endl << std::string( indent+2, ' ' ) << arg; 81 81 } 82 82 -
src/SynTree/AggregateDecl.cc
r3f7e12cb r78315272 41 41 } 42 42 43 void AggregateDecl::print( std::ostream &os, Indenterindent ) const {43 void AggregateDecl::print( std::ostream &os, int indent ) const { 44 44 using std::string; 45 45 using std::endl; 46 46 47 os << typeString() << " " << name<< ":";47 os << typeString() << " " << get_name() << ":"; 48 48 if ( get_linkage() != LinkageSpec::Cforall ) { 49 os << " " << LinkageSpec::linkageName( linkage);49 os << " " << LinkageSpec::linkageName( get_linkage() ); 50 50 } // if 51 os << " with body " << has_body() ;51 os << " with body " << has_body() << endl; 52 52 53 53 if ( ! parameters.empty() ) { 54 os << endl << indent << "...with parameters" << endl;55 printAll( parameters, os, indent+ 1);54 os << endl << string( indent+2, ' ' ) << "with parameters" << endl; 55 printAll( parameters, os, indent+4 ); 56 56 } // if 57 57 if ( ! members.empty() ) { 58 os << endl << indent << "...with members" << endl;59 printAll( members, os, indent+ 1);58 os << endl << string( indent+2, ' ' ) << "with members" << endl; 59 printAll( members, os, indent+4 ); 60 60 } // if 61 61 if ( ! attributes.empty() ) { 62 os << endl << indent << "...with attributes" << endl;63 printAll( attributes, os, indent+ 1);62 os << endl << string( indent+2, ' ' ) << "with attributes" << endl; 63 printAll( attributes, os, indent+4 ); 64 64 } // if 65 os << endl;66 65 } 67 66 68 void AggregateDecl::printShort( std::ostream &os, Indenterindent ) const {67 void AggregateDecl::printShort( std::ostream &os, int indent ) const { 69 68 using std::string; 70 69 using std::endl; 71 70 72 os << typeString() << " " << name << " with body " << has_body() << endl; 71 os << typeString() << " " << get_name(); 72 os << string( indent+2, ' ' ) << "with body " << has_body() << endl; 73 73 74 74 if ( ! parameters.empty() ) { 75 os << indent << "...with parameters" << endl;76 printAll( parameters, os, indent+ 1);75 os << endl << string( indent+2, ' ' ) << "with parameters" << endl; 76 printAll( parameters, os, indent+4 ); 77 77 } // if 78 78 } -
src/SynTree/ApplicationExpr.cc
r3f7e12cb r78315272 55 55 set_result( ResolvExpr::extractResultType( function ) ); 56 56 57 assert( result);57 assert( has_result() ); 58 58 } 59 59 60 60 ApplicationExpr::ApplicationExpr( const ApplicationExpr &other ) : 61 Expression( other ), function( maybeClone( other.function ) ) {61 Expression( other ), function( maybeClone( other.function ) ), inferParams( other.inferParams ) { 62 62 cloneAll( other.args, args ); 63 63 } … … 68 68 } 69 69 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; 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 79 } // 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 ); 74 85 if ( ! args.empty() ) { 75 os << indent << "...to arguments" << std::endl;76 printAll( args, os, indent+ 1);86 os << std::string( indent, ' ' ) << "to arguments" << std::endl; 87 printAll( args, os, indent+2 ); 77 88 } // if 89 printInferParams( inferParams, os, indent+2, 0 ); 78 90 Expression::print( os, indent ); 79 91 } -
src/SynTree/ArrayType.cc
r3f7e12cb r78315272 39 39 } 40 40 41 void ArrayType::print( std::ostream &os, Indenterindent ) const {41 void ArrayType::print( std::ostream &os, int indent ) const { 42 42 Type::print( os, indent ); 43 43 if ( isStatic ) { -
src/SynTree/AttrType.cc
r3f7e12cb r78315272 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, Indenterindent ) const {44 void AttrType::print( std::ostream &os, int indent ) const { 45 45 Type::print( os, indent ); 46 46 os << "attribute " << name << " applied to "; -
src/SynTree/Attribute.cc
r3f7e12cb r78315272 28 28 } 29 29 30 void Attribute::print( std::ostream &os, Indenterindent ) const {30 void Attribute::print( std::ostream &os, int 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 +1);38 printAll( parameters, os, indent ); 39 39 } 40 40 } -
src/SynTree/Attribute.h
r3f7e12cb r78315272 20 20 #include <string> // for string, operator== 21 21 22 #include "BaseSyntaxNode.h"23 #include "Mutator.h"24 #include "Visitor.h"25 26 22 class Expression; 27 23 28 24 // GCC attribute 29 25 // https://gcc.gnu.org/onlinedocs/gcc-6.1.0/gcc/Attribute-Syntax.html#Attribute-Syntax 30 class Attribute : public BaseSyntaxNode{26 class Attribute { 31 27 public: 32 std::string name;33 // to keep things nice and tight, use NameExpr for special identifier parameters34 std::list< Expression * > parameters;35 36 28 Attribute( std::string name = "", const std::list< Expression * > & parameters = std::list< Expression * >() ) : name( name ), parameters( parameters ) {} 37 29 Attribute( const Attribute &other ); … … 43 35 bool empty() const { return name == ""; } 44 36 45 Attribute * clone() const override { return new Attribute( *this ); } 46 virtual void accept( Visitor & v ) override { v.visit( this ); } 47 virtual Attribute * acceptMutator( Mutator & m ) override { return m.mutate( this ); } 48 virtual void print( std::ostream & os, Indenter indent = {} ) const override; 37 Attribute * clone() const { return new Attribute( *this ); } 38 void print( std:: ostream &os, int indent = 0 ) const; 39 private: 40 std::string name; 41 // to keep things nice and tight, use NameExpr for special identifier parameters 42 std::list< Expression * > parameters; 49 43 }; 50 44 -
src/SynTree/BaseSyntaxNode.h
r3f7e12cb r78315272 17 17 18 18 #include "Common/CodeLocation.h" 19 #include "Common/Indenter.h"20 19 class Visitor; 21 class Mutator;22 20 23 21 class BaseSyntaxNode { … … 27 25 virtual ~BaseSyntaxNode() {} 28 26 29 virtual BaseSyntaxNode * clone() const = 0;30 27 virtual void accept( Visitor & v ) = 0; 31 virtual BaseSyntaxNode * acceptMutator( Mutator & m ) = 0; 32 /// Notes: 33 /// * each node is responsible for indenting its children. 34 /// * Expressions should not finish with a newline, since the expression's parent has better information. 35 virtual void print( std::ostream & os, Indenter indent = {} ) const = 0; 36 void print( std::ostream & os, unsigned int indent ) { 37 print( os, Indenter{ Indenter::tabsize, indent }); 38 } 28 virtual void print( std::ostream & os, int indent = 0 ) const = 0; 39 29 }; 40 41 std::ostream & operator<<( std::ostream & out, const BaseSyntaxNode * node );42 30 43 31 // Local Variables: // -
src/SynTree/BasicType.cc
r3f7e12cb r78315272 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 25 14:14:03201713 // Update Count : 1112 // Last Modified On : Mon Sep 11 12:52:05 2017 13 // Update Count : 9 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, Indenterindent ) const {26 void BasicType::print( std::ostream &os, int 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:47 45 return true; 48 46 case Float: -
src/SynTree/CommaExpr.cc
r3f7e12cb r78315272 21 21 #include "Type.h" // for Type 22 22 23 CommaExpr::CommaExpr( Expression *arg1, Expression *arg2 )24 : Expression( ), arg1( arg1 ), arg2( arg2 ) {23 CommaExpr::CommaExpr( Expression *arg1, Expression *arg2, Expression *_aname ) 24 : Expression( _aname ), 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, Indenterindent ) const {41 void CommaExpr::print( std::ostream &os, int indent ) const { 42 42 os << "Comma Expression:" << std::endl; 43 os << (indent+1);44 arg1->print( os, indent+ 1);43 os << std::string( indent+2, ' ' ); 44 arg1->print( os, indent+2 ); 45 45 os << std::endl; 46 os << (indent+1);47 arg2->print( os, indent+ 1);46 os << std::string( indent+2, ' ' ); 47 arg2->print( os, indent+2 ); 48 48 Expression::print( os, indent ); 49 49 } -
src/SynTree/CompoundStmt.cc
r3f7e12cb r78315272 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 ) {34 31 } 35 32 … … 73 70 } 74 71 75 void CompoundStmt::print( std::ostream &os, Indenterindent ) const {76 os << "CompoundStmt" << endl ;77 printAll( kids, os, indent +1);72 void CompoundStmt::print( std::ostream &os, int indent ) const { 73 os << "CompoundStmt" << endl ; 74 printAll( kids, os, indent + 2 ); 78 75 } 79 76 -
src/SynTree/Constant.cc
r3f7e12cb r78315272 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 40 36 Constant Constant::from_int( int i ) { 41 37 return Constant( new BasicType( Type::Qualifiers(), BasicType::SignedInt ), std::to_string( i ), (unsigned long long int)i ); … … 71 67 } 72 68 73 void Constant::print( std::ostream &os , Indenter) const {69 void Constant::print( std::ostream &os ) const { 74 70 os << "(" << rep << " " << val.ival; 75 71 if ( type ) { -
src/SynTree/Constant.h
r3f7e12cb r78315272 19 19 #include <string> // for string 20 20 21 #include "BaseSyntaxNode.h"22 21 #include "Mutator.h" // for Mutator 23 22 #include "Visitor.h" // for Visitor … … 25 24 class Type; 26 25 27 class Constant : public BaseSyntaxNode{26 class Constant { 28 27 public: 29 28 Constant( Type * type, std::string rep, unsigned long long val ); … … 31 30 Constant( const Constant & other ); 32 31 virtual ~Constant(); 33 34 virtual Constant * clone() const { return new Constant( *this ); }35 32 36 33 Type * get_type() { return type; } … … 43 40 /// generates a boolean constant of the given bool 44 41 static Constant from_bool( bool b ); 45 /// generates a char constant of the given char46 static Constant from_char( char c );47 42 /// generates an integer constant of the given int 48 43 static Constant from_int( int i ); … … 57 52 virtual void accept( Visitor & v ) { v.visit( this ); } 58 53 virtual Constant * acceptMutator( Mutator & m ) { return m.mutate( this ); } 59 virtual void print( std::ostream & os , Indenter indent = 0) const;54 virtual void print( std::ostream & os ) const; 60 55 private: 61 56 Type * type; -
src/SynTree/DeclStmt.cc
r3f7e12cb r78315272 33 33 } 34 34 35 void DeclStmt::print( std::ostream &os, Indenterindent ) const {35 void DeclStmt::print( std::ostream &os, int indent ) const { 36 36 assert( decl != 0 ); 37 37 os << "Declaration of "; -
src/SynTree/Declaration.cc
r3f7e12cb r78315272 42 42 43 43 void Declaration::fixUniqueId() { 44 // don't need to set unique ID twice45 if ( uniqueId ) return;46 44 uniqueId = ++lastUniqueId; 47 45 idMap[ uniqueId ] = this; … … 61 59 } 62 60 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 63 70 64 71 AsmDecl::AsmDecl( AsmStmt *stmt ) : Declaration( "", Type::StorageClasses(), LinkageSpec::C ), stmt( stmt ) { … … 72 79 } 73 80 74 void AsmDecl::print( std::ostream &os, Indenterindent ) const {81 void AsmDecl::print( std::ostream &os, int indent ) const { 75 82 stmt->print( os, indent ); 76 83 } 77 84 78 void AsmDecl::printShort( std::ostream &os, Indenterindent ) const {85 void AsmDecl::printShort( std::ostream &os, int indent ) const { 79 86 stmt->print( os, indent ); 80 87 } -
src/SynTree/Declaration.h
r3f7e12cb r78315272 61 61 62 62 void fixUniqueId( void ); 63 virtual Declaration *clone() const override= 0;64 virtual void accept( Visitor &v ) override= 0;65 virtual Declaration *acceptMutator( Mutator &m ) override= 0;66 virtual void print( std::ostream &os, Indenter indent = {} ) const override= 0;67 virtual void printShort( std::ostream &os, Indenter indent = {}) const = 0;63 virtual Declaration *clone() const = 0; 64 virtual void accept( Visitor &v ) = 0; 65 virtual Declaration *acceptMutator( Mutator &m ) = 0; 66 virtual void print( std::ostream &os, int indent = 0 ) const = 0; 67 virtual void printShort( std::ostream &os, int indent = 0 ) const = 0; 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 override= 0;109 virtual DeclarationWithType *acceptMutator( Mutator &m ) override= 0;108 virtual DeclarationWithType *clone() const = 0; 109 virtual DeclarationWithType *acceptMutator( Mutator &m ) = 0; 110 110 111 111 virtual Type * get_type() const = 0; … … 128 128 virtual ~ObjectDecl(); 129 129 130 virtual Type * get_type() const override{ return type; }131 virtual void set_type(Type *newType) override{ type = newType; }130 virtual Type * get_type() const { return type; } 131 virtual void set_type(Type *newType) { type = newType; } 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 override{ return new ObjectDecl( *this ); }142 virtual void accept( Visitor &v ) override{ v.visit( this ); }143 virtual DeclarationWithType *acceptMutator( Mutator &m ) override{ return m.mutate( this ); }144 virtual void print( std::ostream &os, Indenter indent = {} ) const override;145 virtual void printShort( std::ostream &os, Indenter indent = {} ) const override;141 virtual ObjectDecl *clone() const { return new ObjectDecl( *this ); } 142 virtual void accept( Visitor &v ) { v.visit( this ); } 143 virtual DeclarationWithType *acceptMutator( Mutator &m ) { return m.mutate( this ); } 144 virtual void print( std::ostream &os, int indent = 0 ) const; 145 virtual void printShort( std::ostream &os, int indent = 0 ) const; 146 146 }; 147 147 … … 157 157 virtual ~FunctionDecl(); 158 158 159 virtual Type * get_type() const override{ return type; }160 virtual void set_type(Type * t) override{ type = strict_dynamic_cast< FunctionType* >( t ); }159 Type * get_type() const { return type; } 160 virtual void set_type(Type * t) { type = strict_dynamic_cast< FunctionType* >( t ); } 161 161 162 162 FunctionType * get_functionType() const { return type; } … … 165 165 void set_statements( CompoundStmt *newValue ) { statements = newValue; } 166 166 167 static FunctionDecl * newFunction( const std::string & name, FunctionType * type, CompoundStmt * statements ); 168 169 virtual FunctionDecl *clone() const override { return new FunctionDecl( *this ); } 170 virtual void accept( Visitor &v ) override { v.visit( this ); } 171 virtual DeclarationWithType *acceptMutator( Mutator &m ) override { return m.mutate( this ); } 172 virtual void print( std::ostream &os, Indenter indent = {} ) const override; 173 virtual void printShort( std::ostream &os, Indenter indent = {} ) const override; 167 virtual FunctionDecl *clone() const { return new FunctionDecl( *this ); } 168 virtual void accept( Visitor &v ) { v.visit( this ); } 169 virtual DeclarationWithType *acceptMutator( Mutator &m ) { return m.mutate( this ); } 170 virtual void print( std::ostream &os, int indent = 0 ) const; 171 virtual void printShort( std::ostream &os, int indent = 0 ) const; 174 172 }; 175 173 … … 192 190 virtual std::string typeString() const = 0; 193 191 194 virtual NamedTypeDecl *clone() const override= 0;195 virtual void print( std::ostream &os, Indenter indent = {} ) const override;196 virtual void printShort( std::ostream &os, Indenter indent = {} ) const override;192 virtual NamedTypeDecl *clone() const = 0; 193 virtual void print( std::ostream &os, int indent = 0 ) const; 194 virtual void printShort( std::ostream &os, int indent = 0 ) const; 197 195 }; 198 196 … … 200 198 typedef NamedTypeDecl Parent; 201 199 public: 202 enum Kind { Dtype, Ftype, Ttype };200 enum Kind { Any, Dtype, Ftype, Ttype }; 203 201 204 202 Type * init; … … 216 214 }; 217 215 218 TypeDecl( const std::string &name, Type::StorageClasses scs, Type *type, Kind kind, bool sized,Type * init = nullptr );216 TypeDecl( const std::string &name, Type::StorageClasses scs, Type *type, Kind kind, Type * init = nullptr ); 219 217 TypeDecl( const TypeDecl &other ); 220 218 virtual ~TypeDecl(); … … 225 223 TypeDecl * set_init( Type * newValue ) { init = newValue; return this; } 226 224 227 bool isComplete() const { return sized; }225 bool isComplete() const { return kind == Any || sized; } 228 226 bool get_sized() const { return sized; } 229 227 TypeDecl * set_sized( bool newValue ) { sized = newValue; return this; } 230 228 231 virtual std::string typeString() const override;229 virtual std::string typeString() const; 232 230 virtual std::string genTypeString() const; 233 231 234 virtual TypeDecl *clone() const override{ return new TypeDecl( *this ); }235 virtual void accept( Visitor &v ) override{ v.visit( this ); }236 virtual Declaration *acceptMutator( Mutator &m ) override{ return m.mutate( this ); }237 virtual void print( std::ostream &os, Indenter indent = {} ) const override;232 virtual TypeDecl *clone() const { return new TypeDecl( *this ); } 233 virtual void accept( Visitor &v ) { v.visit( this ); } 234 virtual Declaration *acceptMutator( Mutator &m ) { return m.mutate( this ); } 235 virtual void print( std::ostream &os, int indent = 0 ) const; 238 236 239 237 private: … … 247 245 TypedefDecl( const TypedefDecl &other ) : Parent( other ) {} 248 246 249 virtual std::string typeString() const override;250 251 virtual TypedefDecl *clone() const override{ return new TypedefDecl( *this ); }252 virtual void accept( Visitor &v ) override{ v.visit( this ); }253 virtual Declaration *acceptMutator( Mutator &m ) override{ return m.mutate( this ); }247 virtual std::string typeString() const; 248 249 virtual TypedefDecl *clone() const { return new TypedefDecl( *this ); } 250 virtual void accept( Visitor &v ) { v.visit( this ); } 251 virtual Declaration *acceptMutator( Mutator &m ) { return m.mutate( this ); } 254 252 private: 255 253 }; … … 276 274 AggregateDecl * set_body( bool body ) { AggregateDecl::body = body; return this; } 277 275 278 virtual void print( std::ostream &os, Indenter indent = {} ) const override;279 virtual void printShort( std::ostream &os, Indenter indent = {} ) const override;276 virtual void print( std::ostream &os, int indent = 0 ) const; 277 virtual void printShort( std::ostream &os, int indent = 0 ) const; 280 278 protected: 281 279 virtual std::string typeString() const = 0; … … 292 290 bool is_thread() { return kind == DeclarationNode::Thread; } 293 291 294 virtual StructDecl *clone() const override{ return new StructDecl( *this ); }295 virtual void accept( Visitor &v ) override{ v.visit( this ); }296 virtual Declaration *acceptMutator( Mutator &m ) override{ return m.mutate( this ); }292 virtual StructDecl *clone() const { return new StructDecl( *this ); } 293 virtual void accept( Visitor &v ) { v.visit( this ); } 294 virtual Declaration *acceptMutator( Mutator &m ) { return m.mutate( this ); } 297 295 private: 298 296 DeclarationNode::Aggregate kind; 299 virtual std::string typeString() const override;297 virtual std::string typeString() const; 300 298 }; 301 299 … … 306 304 UnionDecl( const UnionDecl &other ) : Parent( other ) {} 307 305 308 virtual UnionDecl *clone() const override{ return new UnionDecl( *this ); }309 virtual void accept( Visitor &v ) override{ v.visit( this ); }310 virtual Declaration *acceptMutator( Mutator &m ) override{ return m.mutate( this ); }311 private: 312 virtual std::string typeString() const override;306 virtual UnionDecl *clone() const { return new UnionDecl( *this ); } 307 virtual void accept( Visitor &v ) { v.visit( this ); } 308 virtual Declaration *acceptMutator( Mutator &m ) { return m.mutate( this ); } 309 private: 310 virtual std::string typeString() const; 313 311 }; 314 312 … … 319 317 EnumDecl( const EnumDecl &other ) : Parent( other ) {} 320 318 321 virtual EnumDecl *clone() const override{ return new EnumDecl( *this ); }322 virtual void accept( Visitor &v ) override{ v.visit( this ); }323 virtual Declaration *acceptMutator( Mutator &m ) override{ return m.mutate( this ); }324 private: 325 virtual std::string typeString() const override;319 virtual EnumDecl *clone() const { return new EnumDecl( *this ); } 320 virtual void accept( Visitor &v ) { v.visit( this ); } 321 virtual Declaration *acceptMutator( Mutator &m ) { return m.mutate( this ); } 322 private: 323 virtual std::string typeString() const; 326 324 }; 327 325 … … 334 332 TraitDecl( const TraitDecl &other ) : Parent( other ) {} 335 333 336 virtual TraitDecl *clone() const override{ return new TraitDecl( *this ); }337 virtual void accept( Visitor &v ) override{ v.visit( this ); }338 virtual Declaration *acceptMutator( Mutator &m ) override{ return m.mutate( this ); }339 private: 340 virtual std::string typeString() const override;334 virtual TraitDecl *clone() const { return new TraitDecl( *this ); } 335 virtual void accept( Visitor &v ) { v.visit( this ); } 336 virtual Declaration *acceptMutator( Mutator &m ) { return m.mutate( this ); } 337 private: 338 virtual std::string typeString() const; 341 339 }; 342 340 … … 352 350 void set_stmt( AsmStmt *newValue ) { stmt = newValue; } 353 351 354 virtual AsmDecl *clone() const override { return new AsmDecl( *this ); } 355 virtual void accept( Visitor &v ) override { v.visit( this ); } 356 virtual AsmDecl *acceptMutator( Mutator &m ) override { return m.mutate( this ); } 357 virtual void print( std::ostream &os, Indenter indent = {} ) const override; 358 virtual void printShort( std::ostream &os, Indenter indent = {} ) const override; 359 }; 360 352 virtual AsmDecl *clone() const { return new AsmDecl( *this ); } 353 virtual void accept( Visitor &v ) { v.visit( this ); } 354 virtual AsmDecl *acceptMutator( Mutator &m ) { return m.mutate( this ); } 355 virtual void print( std::ostream &os, int indent = 0 ) const; 356 virtual void printShort( std::ostream &os, int indent = 0 ) const; 357 }; 358 359 std::ostream & operator<<( std::ostream & out, const Declaration * decl ); 361 360 std::ostream & operator<<( std::ostream & os, const TypeDecl::Data & data ); 362 361 -
src/SynTree/Expression.cc
r3f7e12cb r78315272 33 33 #include "GenPoly/Lvalue.h" 34 34 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 ) { 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 ) { 50 38 } 51 39 52 40 Expression::~Expression() { 53 41 delete env; 42 delete argName; // xxx -- there's a problem in cloning ConstantExpr I still don't know how to fix 54 43 delete result; 55 44 } 56 45 57 void Expression::print( std::ostream &os, Indenter indent ) const { 58 printInferParams( inferParams, os, indent+1, 0 ); 59 46 void Expression::print( std::ostream &os, int indent ) const { 60 47 if ( env ) { 61 os << std:: endl << indent << "...with environment:" << std::endl;62 env->print( os, indent+ 1);48 os << std::string( indent, ' ' ) << "with environment:" << std::endl; 49 env->print( os, indent+2 ); 63 50 } // if 64 51 52 if ( argName ) { 53 os << std::string( indent, ' ' ) << "with designator:"; 54 argName->print( os, indent+2 ); 55 } // if 56 65 57 if ( extension ) { 66 os << std:: endl << indent << "...with extension:";58 os << std::string( indent, ' ' ) << "with extension:"; 67 59 } // if 68 60 } 69 61 70 ConstantExpr::ConstantExpr( Constant _c ) : Expression(), constant( _c ) {62 ConstantExpr::ConstantExpr( Constant _c, Expression *_aname ) : Expression( _aname ), constant( _c ) { 71 63 set_result( constant.get_type()->clone() ); 72 64 } … … 77 69 ConstantExpr::~ConstantExpr() {} 78 70 79 void ConstantExpr::print( std::ostream &os, Indenterindent ) const {71 void ConstantExpr::print( std::ostream &os, int indent ) const { 80 72 os << "constant expression " ; 81 73 constant.print( os ); … … 83 75 } 84 76 85 VariableExpr::VariableExpr( DeclarationWithType *_var ) : Expression(), var( _var ) {77 VariableExpr::VariableExpr( DeclarationWithType *_var, Expression *_aname ) : Expression( _aname ), var( _var ) { 86 78 assert( var ); 87 79 assert( var->get_type() ); … … 104 96 } 105 97 106 void VariableExpr::print( std::ostream &os, Indenterindent ) const {98 void VariableExpr::print( std::ostream &os, int indent ) const { 107 99 os << "Variable Expression: "; 108 var->printShort(os, indent); 109 Expression::print( os, indent ); 110 } 111 112 SizeofExpr::SizeofExpr( Expression *expr_ ) : 113 Expression(), expr(expr_), type(0), isType(false) { 100 101 Declaration *decl = get_var(); 102 if ( decl != 0) decl->printShort(os, indent + 2); 103 os << std::endl; 104 Expression::print( os, indent ); 105 } 106 107 SizeofExpr::SizeofExpr( Expression *expr_, Expression *_aname ) : 108 Expression( _aname ), expr(expr_), type(0), isType(false) { 114 109 set_result( new BasicType( Type::Qualifiers(), BasicType::LongUnsignedInt ) ); 115 110 } 116 111 117 SizeofExpr::SizeofExpr( Type *type_ ) :118 Expression( ), expr(0), type(type_), isType(true) {112 SizeofExpr::SizeofExpr( Type *type_, Expression *_aname ) : 113 Expression( _aname ), expr(0), type(type_), isType(true) { 119 114 set_result( new BasicType( Type::Qualifiers(), BasicType::LongUnsignedInt ) ); 120 115 } … … 129 124 } 130 125 131 void SizeofExpr::print( std::ostream &os, Indenterindent) const {126 void SizeofExpr::print( std::ostream &os, int indent) const { 132 127 os << "Sizeof Expression on: "; 133 if (isType) type->print(os, indent+1); 134 else expr->print(os, indent+1); 135 Expression::print( os, indent ); 136 } 137 138 AlignofExpr::AlignofExpr( Expression *expr_ ) : 139 Expression(), expr(expr_), type(0), isType(false) { 128 129 if (isType) 130 type->print(os, indent + 2); 131 else 132 expr->print(os, indent + 2); 133 134 os << std::endl; 135 Expression::print( os, indent ); 136 } 137 138 AlignofExpr::AlignofExpr( Expression *expr_, Expression *_aname ) : 139 Expression( _aname ), 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_ ) :144 Expression( ), expr(0), type(type_), isType(true) {143 AlignofExpr::AlignofExpr( Type *type_, Expression *_aname ) : 144 Expression( _aname ), 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, Indenterindent) const {157 void AlignofExpr::print( std::ostream &os, int indent) const { 158 158 os << "Alignof Expression on: "; 159 if (isType) type->print(os, indent+1); 160 else expr->print(os, indent+1); 161 Expression::print( os, indent ); 162 } 163 164 UntypedOffsetofExpr::UntypedOffsetofExpr( Type *type, const std::string &member ) : 165 Expression(), type(type), member(member) { 166 assert( type ); 159 160 if (isType) 161 type->print(os, indent + 2); 162 else 163 expr->print(os, indent + 2); 164 165 os << std::endl; 166 Expression::print( os, indent ); 167 } 168 169 UntypedOffsetofExpr::UntypedOffsetofExpr( Type *type_, const std::string &member_, Expression *_aname ) : 170 Expression( _aname ), type(type_), member(member_) { 167 171 set_result( new BasicType( Type::Qualifiers(), BasicType::LongUnsignedInt ) ); 168 172 } … … 175 179 } 176 180 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 ); 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_) { 187 196 set_result( new BasicType( Type::Qualifiers(), BasicType::LongUnsignedInt ) ); 188 197 } … … 195 204 } 196 205 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 ); 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_ ) { 205 228 set_result( new ArrayType( Type::Qualifiers(), new BasicType( Type::Qualifiers(), BasicType::LongUnsignedInt ), 0, false, false ) ); 206 229 } … … 210 233 OffsetPackExpr::~OffsetPackExpr() { delete type; } 211 234 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) { 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) { 224 254 } 225 255 … … 234 264 } 235 265 236 void AttrExpr::print( std::ostream &os, Indenterindent) const {266 void AttrExpr::print( std::ostream &os, int indent) const { 237 267 os << "Attr "; 238 attr->print( os, indent +1);268 attr->print( os, indent + 2 ); 239 269 if ( isType || expr ) { 240 270 os << "applied to: "; 241 if (isType) type->print(os, indent+1); 242 else expr->print(os, indent+1); 271 272 if (isType) 273 type->print(os, indent + 2); 274 else 275 expr->print(os, indent + 2); 243 276 } // if 244 Expression::print( os, indent ); 245 } 246 247 CastExpr::CastExpr( Expression *arg_, Type *toType ) : Expression(), arg(arg_) { 277 278 os << std::endl; 279 Expression::print( os, indent ); 280 } 281 282 CastExpr::CastExpr( Expression *arg_, Type *toType, Expression *_aname ) : Expression( _aname ), arg(arg_) { 248 283 set_result(toType); 249 284 } 250 285 251 CastExpr::CastExpr( Expression *arg_ ) : Expression(), arg(arg_) {286 CastExpr::CastExpr( Expression *arg_, Expression *_aname ) : Expression( _aname ), arg(arg_) { 252 287 set_result( new VoidType( Type::Qualifiers() ) ); 253 288 } … … 260 295 } 261 296 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:"; 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, ' ' ); 266 302 if ( result->isVoid() ) { 267 os << " nothing";303 os << "nothing"; 268 304 } else { 269 os << std::endl << indent+1; 270 result->print( os, indent+1 ); 305 result->print( os, indent+2 ); 271 306 } // if 307 os << std::endl; 272 308 Expression::print( os, indent ); 273 309 } … … 284 320 } 285 321 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:"; 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, ' ' ); 290 327 if ( ! result ) { 291 os << " unknown";328 os << "unknown"; 292 329 } else { 293 os << std::endl << indent+1; 294 result->print( os, indent+1 ); 330 result->print( os, indent+2 ); 295 331 } // if 296 Expression::print( os, indent ); 297 } 298 299 UntypedMemberExpr::UntypedMemberExpr( Expression * member, Expression *aggregate ) : 300 Expression(), member(member), aggregate(aggregate) { 301 assert( aggregate ); 302 } 332 os << std::endl; 333 Expression::print( os, indent ); 334 } 335 336 UntypedMemberExpr::UntypedMemberExpr( Expression * _member, Expression *_aggregate, Expression *_aname ) : 337 Expression( _aname ), member(_member), aggregate(_aggregate) {} 303 338 304 339 UntypedMemberExpr::UntypedMemberExpr( const UntypedMemberExpr &other ) : … … 311 346 } 312 347 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); 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, ' ' ); 318 361 Expression::print( os, indent ); 319 362 } … … 334 377 335 378 336 MemberExpr::MemberExpr( DeclarationWithType *member, Expression *aggregate ) : 337 Expression(), member(member), aggregate(aggregate) { 338 assert( member ); 339 assert( aggregate ); 379 MemberExpr::MemberExpr( DeclarationWithType *_member, Expression *_aggregate, Expression *_aname ) : 380 Expression( _aname ), member(_member), aggregate(_aggregate) { 340 381 341 382 TypeSubstitution sub( makeSub( aggregate->get_result() ) ); … … 355 396 } 356 397 357 void MemberExpr::print( std::ostream &os, Indenterindent ) const {398 void MemberExpr::print( std::ostream &os, int indent ) const { 358 399 os << "Member Expression, with field: " << std::endl; 359 os << indent+1; 360 member->print( os, indent+1 ); 361 os << std::endl << indent << "... from aggregate: " << std::endl << indent+1; 362 aggregate->print(os, indent + 1); 363 Expression::print( os, indent ); 364 } 365 366 UntypedExpr::UntypedExpr( Expression *function, const std::list<Expression *> &args ) : 367 Expression(), function(function), args(args) {} 400 401 assert( member ); 402 os << std::string( indent + 2, ' ' ); 403 member->print( os, indent + 2 ); 404 os << std::endl; 405 406 Expression *agg = get_aggregate(); 407 os << std::string( indent, ' ' ) << "from aggregate: " << std::endl; 408 if (agg != 0) { 409 os << std::string( indent + 2, ' ' ); 410 agg->print(os, indent + 2); 411 } 412 os << std::string( indent+2, ' ' ); 413 Expression::print( os, indent ); 414 } 415 416 UntypedExpr::UntypedExpr( Expression *_function, const std::list<Expression *> &_args, Expression *_aname ) : 417 Expression( _aname ), function(_function), args(_args) {} 368 418 369 419 UntypedExpr::UntypedExpr( const UntypedExpr &other ) : … … 406 456 407 457 408 void UntypedExpr::print( std::ostream &os, Indenterindent ) const {458 void UntypedExpr::print( std::ostream &os, int indent ) const { 409 459 os << "Applying untyped: " << std::endl; 410 os << indent+1; 411 function->print(os, indent+1); 412 os << std::endl << indent << "...to: " << std::endl; 413 printAll(args, os, indent+1); 414 Expression::print( os, indent ); 415 } 416 417 NameExpr::NameExpr( std::string name ) : Expression(), name(name) { 418 assertf(name != "0", "Zero is not a valid name"); 419 assertf(name != "1", "One is not a valid name"); 460 os << std::string( indent+2, ' ' ); 461 function->print(os, indent + 2); 462 os << std::string( indent, ' ' ) << "...to: " << std::endl; 463 printAll(args, os, indent + 2); 464 Expression::print( os, indent ); 465 } 466 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"); 420 478 } 421 479 … … 425 483 NameExpr::~NameExpr() {} 426 484 427 void NameExpr::print( std::ostream &os, Indenterindent ) 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) {485 void NameExpr::print( std::ostream &os, int indent ) 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) { 434 492 set_result( new BasicType( Type::Qualifiers(), BasicType::SignedInt ) ); 435 493 } … … 444 502 } 445 503 446 void LogicalExpr::print( std::ostream &os, Indenterindent )const {447 os << "Short-circuited operation (" << (isAnd ? "and" :"or") << ") on: ";504 void LogicalExpr::print( std::ostream &os, int indent )const { 505 os << "Short-circuited operation (" << (isAnd?"and":"or") << ") on: "; 448 506 arg1->print(os); 449 507 os << " and "; 450 508 arg2->print(os); 451 Expression::print( os, indent ); 452 } 453 454 ConditionalExpr::ConditionalExpr( Expression * arg1, Expression * arg2, Expression * arg3 ) : 455 Expression(), arg1(arg1), arg2(arg2), arg3(arg3) {} 509 os << std::endl; 510 Expression::print( os, indent ); 511 } 512 513 ConditionalExpr::ConditionalExpr( Expression *arg1_, Expression *arg2_, Expression *arg3_, Expression *_aname ) : 514 Expression( _aname ), arg1(arg1_), arg2(arg2_), arg3(arg3_) {} 456 515 457 516 ConditionalExpr::ConditionalExpr( const ConditionalExpr &other ) : … … 465 524 } 466 525 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 ); 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; 474 537 Expression::print( os, indent ); 475 538 } … … 478 541 479 542 480 void AsmExpr::print( std::ostream &os, Indenterindent ) const {543 void AsmExpr::print( std::ostream &os, int indent ) const { 481 544 os << "Asm Expression: " << std::endl; 482 if ( inout ) inout->print( os, indent +1);483 if ( constraint ) constraint->print( os, indent +1);484 if ( operand ) operand->print( os, indent +1);545 if ( inout ) inout->print( os, indent + 2 ); 546 if ( constraint ) constraint->print( os, indent + 2 ); 547 if ( operand ) operand->print( os, indent + 2 ); 485 548 } 486 549 … … 488 551 ImplicitCopyCtorExpr::ImplicitCopyCtorExpr( ApplicationExpr * callExpr ) : callExpr( callExpr ) { 489 552 assert( callExpr ); 490 assert( callExpr-> result);553 assert( callExpr->has_result() ); 491 554 set_result( callExpr->get_result()->clone() ); 492 555 } … … 506 569 } 507 570 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 ); 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); 515 580 Expression::print( os, indent ); 516 581 } … … 522 587 Expression * arg = InitTweak::getCallArg( callExpr, 0 ); 523 588 assert( arg ); 524 set_result( maybeClone( arg-> result) );589 set_result( maybeClone( arg->get_result() ) ); 525 590 } 526 591 … … 532 597 } 533 598 534 void ConstructorExpr::print( std::ostream &os, Indenter indent ) const { 535 os << "Constructor Expression: " << std::endl << indent+1; 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, ' ' ); 536 603 callExpr->print( os, indent + 2 ); 537 604 Expression::print( os, indent ); … … 551 618 } 552 619 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 ); 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 ); 558 626 Expression::print( os, indent ); 559 627 } … … 561 629 RangeExpr::RangeExpr( Expression *low, Expression *high ) : low( low ), high( high ) {} 562 630 RangeExpr::RangeExpr( const RangeExpr &other ) : Expression( other ), low( other.low->clone() ), high( other.high->clone() ) {} 563 void RangeExpr::print( std::ostream &os, Indenterindent ) const {631 void RangeExpr::print( std::ostream &os, int indent ) const { 564 632 os << "Range Expression: "; 565 633 low->print( os, indent ); … … 591 659 deleteAll( returnDecls ); 592 660 } 593 void StmtExpr::print( std::ostream &os, Indenterindent ) const {594 os << "Statement Expression: " << std::endl << indent+1;595 statements->print( os, indent+ 1);661 void StmtExpr::print( std::ostream &os, int indent ) const { 662 os << "Statement Expression: " << std::endl << std::string( indent, ' ' ); 663 statements->print( os, indent+2 ); 596 664 if ( ! returnDecls.empty() ) { 597 os << indent+1 << "...with returnDecls: ";598 printAll( returnDecls, os, indent+ 1);665 os << std::string( indent+2, ' ' ) << "with returnDecls: "; 666 printAll( returnDecls, os, indent+2 ); 599 667 } 600 668 if ( ! dtors.empty() ) { 601 os << indent+1 << "...with dtors: ";602 printAll( dtors, os, indent+ 1);669 os << std::string( indent+2, ' ' ) << "with dtors: "; 670 printAll( dtors, os, indent+2 ); 603 671 } 604 672 Expression::print( os, indent ); … … 622 690 delete var; 623 691 } 624 void UniqueExpr::print( std::ostream &os, Indenterindent ) 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);692 void UniqueExpr::print( std::ostream &os, int indent ) const { 693 os << "Unique Expression with id:" << id << std::endl << std::string( indent+2, ' ' ); 694 get_expr()->print( os, indent+2 ); 695 if ( get_object() ) { 696 os << std::string( indent+2, ' ' ) << "with decl: "; 697 get_object()->printShort( os, indent+2 ); 630 698 } 631 699 Expression::print( os, indent ); … … 645 713 } 646 714 647 void UntypedInitExpr::print( std::ostream & os, Indenterindent ) const {648 os << "Untyped Init Expression" << std::endl << indent+1;649 expr->print( os, indent+ 1);715 void UntypedInitExpr::print( std::ostream & os, int indent ) const { 716 os << "Untyped Init Expression" << std::endl << std::string( indent+2, ' ' ); 717 expr->print( os, indent+2 ); 650 718 if ( ! initAlts.empty() ) { 651 719 for ( const InitAlternative & alt : initAlts ) { 652 os << indent+1<< "InitAlternative: ";653 alt.type->print( os, indent+ 1);654 alt.designation->print( os, indent+ 1);720 os << std::string( indent+2, ' ' ) << "InitAlternative: "; 721 alt.type->print( os, indent+2 ); 722 alt.designation->print( os, indent+2 ); 655 723 } 656 724 } … … 666 734 } 667 735 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 ); 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; 673 751 } 674 752 -
src/SynTree/Expression.h
r3f7e12cb r78315272 31 31 32 32 33 /// Expression is the root type for all expressions 34 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 name 39 bool extension = false; 40 41 Expression( Expression * _aname = nullptr ); 42 Expression( const Expression & other ); 43 virtual ~Expression(); 44 45 Type *& get_result() { return result; } 46 const Type * get_result() const { return result; } 47 void set_result( Type * newValue ) { result = newValue; } 48 bool has_result() const { return result != nullptr; } 49 50 TypeSubstitution * get_env() const { return env; } 51 void set_env( TypeSubstitution * newValue ) { env = newValue; } 52 Expression * get_argName() const { return argName; } 53 void set_argName( Expression * name ) { argName = name; } 54 bool get_extension() const { return extension; } 55 Expression * set_extension( bool exten ) { extension = exten; return this; } 56 57 virtual Expression * clone() const = 0; 58 virtual void accept( Visitor & v ) = 0; 59 virtual Expression * acceptMutator( Mutator & m ) = 0; 60 virtual void print( std::ostream & os, int indent = 0 ) const; 61 }; 62 33 63 struct ParamEntry; 34 64 … … 47 77 Type * actualType; 48 78 Type * formalType; 49 Expression * expr;79 Expression* expr; 50 80 std::unique_ptr< InferredParams > inferParams; 51 };52 53 /// Expression is the root type for all expressions54 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;80 81 }; 81 82 … … 86 87 Expression * function; 87 88 std::list<Expression *> args; 89 InferredParams inferParams; 88 90 89 91 ApplicationExpr( Expression * function, const std::list<Expression *> & args = std::list< Expression * >() ); … … 94 96 void set_function( Expression * newValue ) { function = newValue; } 95 97 std::list<Expression *>& get_args() { return args; } 98 InferredParams & get_inferParams() { return inferParams; } 96 99 97 100 virtual ApplicationExpr * clone() const { return new ApplicationExpr( * this ); } 98 101 virtual void accept( Visitor & v ) { v.visit( this ); } 99 102 virtual Expression * acceptMutator( Mutator & m ) { return m.mutate( this ); } 100 virtual void print( std::ostream & os, Indenter indent = {}) const;103 virtual void print( std::ostream & os, int indent = 0 ) const; 101 104 }; 102 105 … … 109 112 std::list<Expression*> args; 110 113 111 UntypedExpr( Expression * function, const std::list<Expression *> & args = std::list< Expression * >() );114 UntypedExpr( Expression * function, const std::list<Expression *> & args = std::list< Expression * >(), Expression *_aname = nullptr ); 112 115 UntypedExpr( const UntypedExpr & other ); 113 116 virtual ~UntypedExpr(); … … 116 119 void set_function( Expression * newValue ) { function = newValue; } 117 120 121 void set_args( std::list<Expression *> & listArgs ) { args = listArgs; } 118 122 std::list<Expression*>::iterator begin_args() { return args.begin(); } 119 123 std::list<Expression*>::iterator end_args() { return args.end(); } … … 126 130 virtual void accept( Visitor & v ) { v.visit( this ); } 127 131 virtual Expression * acceptMutator( Mutator & m ) { return m.mutate( this ); } 128 virtual void print( std::ostream & os, Indenter indent = {} ) const; 132 virtual void print( std::ostream & os, int indent = 0 ) const; 133 virtual void printArgs(std::ostream & os, int indent = 0) const; 129 134 }; 130 135 … … 134 139 std::string name; 135 140 136 NameExpr( std::string name );141 NameExpr( std::string name, Expression *_aname = nullptr ); 137 142 NameExpr( const NameExpr & other ); 138 143 virtual ~NameExpr(); … … 144 149 virtual void accept( Visitor & v ) { v.visit( this ); } 145 150 virtual Expression * acceptMutator( Mutator & m ) { return m.mutate( this ); } 146 virtual void print( std::ostream & os, Indenter indent = {}) const;151 virtual void print( std::ostream & os, int indent = 0 ) const; 147 152 }; 148 153 … … 155 160 Expression * arg; 156 161 157 AddressExpr( Expression * arg );162 AddressExpr( Expression * arg, Expression *_aname = nullptr ); 158 163 AddressExpr( const AddressExpr & other ); 159 164 virtual ~AddressExpr(); … … 165 170 virtual void accept( Visitor & v ) { v.visit( this ); } 166 171 virtual Expression * acceptMutator( Mutator & m ) { return m.mutate( this ); } 167 virtual void print( std::ostream & os, Indenter indent = {}) const;172 virtual void print( std::ostream & os, int indent = 0 ) const; 168 173 }; 169 174 … … 181 186 virtual void accept( Visitor & v ) { v.visit( this ); } 182 187 virtual Expression * acceptMutator( Mutator & m ) { return m.mutate( this ); } 183 virtual void print( std::ostream & os, Indenter indent = {}) const;188 virtual void print( std::ostream & os, int indent = 0 ) const; 184 189 }; 185 190 … … 189 194 Expression * arg; 190 195 191 CastExpr( Expression * arg );192 CastExpr( Expression * arg, Type * toType );196 CastExpr( Expression * arg, Expression *_aname = nullptr ); 197 CastExpr( Expression * arg, Type * toType, Expression *_aname = nullptr ); 193 198 CastExpr( const CastExpr & other ); 194 199 virtual ~CastExpr(); … … 200 205 virtual void accept( Visitor & v ) { v.visit( this ); } 201 206 virtual Expression * acceptMutator( Mutator & m ) { return m.mutate( this ); } 202 virtual void print( std::ostream & os, Indenter indent = {}) const;207 virtual void print( std::ostream & os, int indent = 0 ) const; 203 208 }; 204 209 … … 218 223 virtual void accept( Visitor & v ) { v.visit( this ); } 219 224 virtual Expression * acceptMutator( Mutator & m ) { return m.mutate( this ); } 220 virtual void print( std::ostream & os, Indenter indent = {}) const;225 virtual void print( std::ostream & os, int indent = 0 ) const; 221 226 }; 222 227 … … 227 232 Expression * aggregate; 228 233 229 UntypedMemberExpr( Expression * member, Expression * aggregate );234 UntypedMemberExpr( Expression * member, Expression * aggregate, Expression *_aname = nullptr ); 230 235 UntypedMemberExpr( const UntypedMemberExpr & other ); 231 236 virtual ~UntypedMemberExpr(); … … 239 244 virtual void accept( Visitor & v ) { v.visit( this ); } 240 245 virtual Expression * acceptMutator( Mutator & m ) { return m.mutate( this ); } 241 virtual void print( std::ostream & os, Indenter indent = {}) const;246 virtual void print( std::ostream & os, int indent = 0 ) const; 242 247 }; 243 248 … … 249 254 Expression * aggregate; 250 255 251 MemberExpr( DeclarationWithType * member, Expression * aggregate );256 MemberExpr( DeclarationWithType * member, Expression * aggregate, Expression *_aname = nullptr ); 252 257 MemberExpr( const MemberExpr & other ); 253 258 virtual ~MemberExpr(); … … 261 266 virtual void accept( Visitor & v ) { v.visit( this ); } 262 267 virtual Expression * acceptMutator( Mutator & m ) { return m.mutate( this ); } 263 virtual void print( std::ostream & os, Indenter indent = {}) const;268 virtual void print( std::ostream & os, int indent = 0 ) const; 264 269 }; 265 270 … … 270 275 DeclarationWithType * var; 271 276 272 VariableExpr( DeclarationWithType * var );277 VariableExpr( DeclarationWithType * var, Expression *_aname = nullptr ); 273 278 VariableExpr( const VariableExpr & other ); 274 279 virtual ~VariableExpr(); … … 282 287 virtual void accept( Visitor & v ) { v.visit( this ); } 283 288 virtual Expression * acceptMutator( Mutator & m ) { return m.mutate( this ); } 284 virtual void print( std::ostream & os, Indenter indent = {}) const;289 virtual void print( std::ostream & os, int indent = 0 ) const; 285 290 }; 286 291 … … 290 295 Constant constant; 291 296 292 ConstantExpr( Constant constant );297 ConstantExpr( Constant constant, Expression *_aname = nullptr ); 293 298 ConstantExpr( const ConstantExpr & other ); 294 299 virtual ~ConstantExpr(); … … 300 305 virtual void accept( Visitor & v ) { v.visit( this ); } 301 306 virtual Expression * acceptMutator( Mutator & m ) { return m.mutate( this ); } 302 virtual void print( std::ostream & os, Indenter indent = {}) const;307 virtual void print( std::ostream & os, int indent = 0 ) const; 303 308 }; 304 309 … … 310 315 bool isType; 311 316 312 SizeofExpr( Expression * expr );317 SizeofExpr( Expression * expr, Expression *_aname = nullptr ); 313 318 SizeofExpr( const SizeofExpr & other ); 314 SizeofExpr( Type * type );319 SizeofExpr( Type * type, Expression *_aname = nullptr ); 315 320 virtual ~SizeofExpr(); 316 321 … … 325 330 virtual void accept( Visitor & v ) { v.visit( this ); } 326 331 virtual Expression * acceptMutator( Mutator & m ) { return m.mutate( this ); } 327 virtual void print( std::ostream & os, Indenter indent = {}) const;332 virtual void print( std::ostream & os, int indent = 0 ) const; 328 333 }; 329 334 … … 335 340 bool isType; 336 341 337 AlignofExpr( Expression * expr );342 AlignofExpr( Expression * expr, Expression *_aname = nullptr ); 338 343 AlignofExpr( const AlignofExpr & other ); 339 AlignofExpr( Type * type );344 AlignofExpr( Type * type, Expression *_aname = nullptr ); 340 345 virtual ~AlignofExpr(); 341 346 … … 350 355 virtual void accept( Visitor & v ) { v.visit( this ); } 351 356 virtual Expression * acceptMutator( Mutator & m ) { return m.mutate( this ); } 352 virtual void print( std::ostream & os, Indenter indent = {}) const;357 virtual void print( std::ostream & os, int indent = 0 ) const; 353 358 }; 354 359 … … 359 364 std::string member; 360 365 361 UntypedOffsetofExpr( Type * type, const std::string & member );366 UntypedOffsetofExpr( Type * type, const std::string & member, Expression *_aname = nullptr ); 362 367 UntypedOffsetofExpr( const UntypedOffsetofExpr & other ); 363 368 virtual ~UntypedOffsetofExpr(); … … 371 376 virtual void accept( Visitor & v ) { v.visit( this ); } 372 377 virtual Expression * acceptMutator( Mutator & m ) { return m.mutate( this ); } 373 virtual void print( std::ostream & os, Indenter indent = {}) const;378 virtual void print( std::ostream & os, int indent = 0 ) const; 374 379 }; 375 380 … … 380 385 DeclarationWithType * member; 381 386 382 OffsetofExpr( Type * type, DeclarationWithType * member );387 OffsetofExpr( Type * type, DeclarationWithType * member, Expression *_aname = nullptr ); 383 388 OffsetofExpr( const OffsetofExpr & other ); 384 389 virtual ~OffsetofExpr(); … … 392 397 virtual void accept( Visitor & v ) { v.visit( this ); } 393 398 virtual Expression * acceptMutator( Mutator & m ) { return m.mutate( this ); } 394 virtual void print( std::ostream & os, Indenter indent = {}) const;399 virtual void print( std::ostream & os, int indent = 0 ) const; 395 400 }; 396 401 … … 400 405 StructInstType * type; 401 406 402 OffsetPackExpr( StructInstType * type );407 OffsetPackExpr( StructInstType * type_, Expression * aname_ = 0 ); 403 408 OffsetPackExpr( const OffsetPackExpr & other ); 404 409 virtual ~OffsetPackExpr(); … … 410 415 virtual void accept( Visitor & v ) { v.visit( this ); } 411 416 virtual Expression * acceptMutator( Mutator & m ) { return m.mutate( this ); } 412 virtual void print( std::ostream & os, Indenter indent = {}) const;417 virtual void print( std::ostream & os, int indent = 0 ) const; 413 418 }; 414 419 … … 421 426 bool isType; 422 427 423 AttrExpr(Expression * attr, Expression * expr );428 AttrExpr(Expression * attr, Expression * expr, Expression *_aname = nullptr ); 424 429 AttrExpr( const AttrExpr & other ); 425 AttrExpr( Expression * attr, Type * type );430 AttrExpr( Expression * attr, Type * type, Expression *_aname = nullptr ); 426 431 virtual ~AttrExpr(); 427 432 … … 438 443 virtual void accept( Visitor & v ) { v.visit( this ); } 439 444 virtual Expression * acceptMutator( Mutator & m ) { return m.mutate( this ); } 440 virtual void print( std::ostream & os, Indenter indent = {}) const;445 virtual void print( std::ostream & os, int indent = 0 ) const; 441 446 }; 442 447 … … 447 452 Expression * arg2; 448 453 449 LogicalExpr( Expression * arg1, Expression * arg2, bool andp = true );454 LogicalExpr( Expression * arg1, Expression * arg2, bool andp = true, Expression *_aname = nullptr ); 450 455 LogicalExpr( const LogicalExpr & other ); 451 456 virtual ~LogicalExpr(); … … 460 465 virtual void accept( Visitor & v ) { v.visit( this ); } 461 466 virtual Expression * acceptMutator( Mutator & m ) { return m.mutate( this ); } 462 virtual void print( std::ostream & os, Indenter indent = {}) const;467 virtual void print( std::ostream & os, int indent = 0 ) const; 463 468 464 469 private: … … 473 478 Expression * arg3; 474 479 475 ConditionalExpr( Expression * arg1, Expression * arg2, Expression * arg3 );480 ConditionalExpr( Expression * arg1, Expression * arg2, Expression * arg3, Expression *_aname = nullptr ); 476 481 ConditionalExpr( const ConditionalExpr & other ); 477 482 virtual ~ConditionalExpr(); … … 487 492 virtual void accept( Visitor & v ) { v.visit( this ); } 488 493 virtual Expression * acceptMutator( Mutator & m ) { return m.mutate( this ); } 489 virtual void print( std::ostream & os, Indenter indent = {}) const;494 virtual void print( std::ostream & os, int indent = 0 ) const; 490 495 }; 491 496 … … 496 501 Expression * arg2; 497 502 498 CommaExpr( Expression * arg1, Expression * arg2 );503 CommaExpr( Expression * arg1, Expression * arg2, Expression *_aname = nullptr ); 499 504 CommaExpr( const CommaExpr & other ); 500 505 virtual ~CommaExpr(); … … 508 513 virtual void accept( Visitor & v ) { v.visit( this ); } 509 514 virtual Expression * acceptMutator( Mutator & m ) { return m.mutate( this ); } 510 virtual void print( std::ostream & os, Indenter indent = {}) const;515 virtual void print( std::ostream & os, int indent = 0 ) const; 511 516 }; 512 517 … … 526 531 virtual void accept( Visitor & v ) { v.visit( this ); } 527 532 virtual Expression * acceptMutator( Mutator & m ) { return m.mutate( this ); } 528 virtual void print( std::ostream & os, Indenter indent = {}) const;533 virtual void print( std::ostream & os, int indent = 0 ) const; 529 534 }; 530 535 … … 552 557 virtual void accept( Visitor & v ) { v.visit( this ); } 553 558 virtual Expression * acceptMutator( Mutator & m ) { return m.mutate( this ); } 554 virtual void print( std::ostream & os, Indenter indent = {}) const;559 virtual void print( std::ostream & os, int indent = 0 ) const; 555 560 556 561 // https://gcc.gnu.org/onlinedocs/gcc-4.7.1/gcc/Machine-Constraints.html#Machine-Constraints … … 580 585 virtual void accept( Visitor & v ) { v.visit( this ); } 581 586 virtual Expression * acceptMutator( Mutator & m ) { return m.mutate( this ); } 582 virtual void print( std::ostream & os, Indenter indent = {}) const;587 virtual void print( std::ostream & os, int indent = 0 ) const; 583 588 }; 584 589 … … 598 603 virtual void accept( Visitor & v ) { v.visit( this ); } 599 604 virtual Expression * acceptMutator( Mutator & m ) { return m.mutate( this ); } 600 virtual void print( std::ostream & os, Indenter indent = {}) const;605 virtual void print( std::ostream & os, int indent = 0 ) const; 601 606 }; 602 607 … … 616 621 virtual void accept( Visitor & v ) { v.visit( this ); } 617 622 virtual Expression * acceptMutator( Mutator & m ) { return m.mutate( this ); } 618 virtual void print( std::ostream & os, Indenter indent = {}) const;623 virtual void print( std::ostream & os, int indent = 0 ) const; 619 624 }; 620 625 … … 635 640 virtual void accept( Visitor & v ) { v.visit( this ); } 636 641 virtual Expression * acceptMutator( Mutator & m ) { return m.mutate( this ); } 637 virtual void print( std::ostream & os, Indenter indent = {}) const;642 virtual void print( std::ostream & os, int indent = 0 ) const; 638 643 }; 639 644 … … 643 648 std::list<Expression*> exprs; 644 649 645 UntypedTupleExpr( const std::list< Expression * > & exprs );650 UntypedTupleExpr( const std::list< Expression * > & exprs, Expression *_aname = nullptr ); 646 651 UntypedTupleExpr( const UntypedTupleExpr & other ); 647 652 virtual ~UntypedTupleExpr(); … … 652 657 virtual void accept( Visitor & v ) { v.visit( this ); } 653 658 virtual Expression * acceptMutator( Mutator & m ) { return m.mutate( this ); } 654 virtual void print( std::ostream & os, Indenter indent = {}) const;659 virtual void print( std::ostream & os, int indent = 0 ) const; 655 660 }; 656 661 … … 660 665 std::list<Expression*> exprs; 661 666 662 TupleExpr( const std::list< Expression * > & exprs );667 TupleExpr( const std::list< Expression * > & exprs, Expression *_aname = nullptr ); 663 668 TupleExpr( const TupleExpr & other ); 664 669 virtual ~TupleExpr(); … … 669 674 virtual void accept( Visitor & v ) { v.visit( this ); } 670 675 virtual Expression * acceptMutator( Mutator & m ) { return m.mutate( this ); } 671 virtual void print( std::ostream & os, Indenter indent = {}) const;676 virtual void print( std::ostream & os, int indent = 0 ) const; 672 677 }; 673 678 … … 690 695 virtual void accept( Visitor & v ) { v.visit( this ); } 691 696 virtual Expression * acceptMutator( Mutator & m ) { return m.mutate( this ); } 692 virtual void print( std::ostream & os, Indenter indent = {}) const;697 virtual void print( std::ostream & os, int indent = 0 ) const; 693 698 }; 694 699 … … 698 703 StmtExpr * stmtExpr = nullptr; 699 704 700 TupleAssignExpr( const std::list< Expression * > & assigns, const std::list< ObjectDecl * > & tempDecls );705 TupleAssignExpr( const std::list< Expression * > & assigns, const std::list< ObjectDecl * > & tempDecls, Expression * _aname = nullptr ); 701 706 TupleAssignExpr( const TupleAssignExpr & other ); 702 707 virtual ~TupleAssignExpr(); … … 708 713 virtual void accept( Visitor & v ) { v.visit( this ); } 709 714 virtual Expression * acceptMutator( Mutator & m ) { return m.mutate( this ); } 710 virtual void print( std::ostream & os, Indenter indent = {}) const;715 virtual void print( std::ostream & os, int indent = 0 ) const; 711 716 }; 712 717 … … 731 736 virtual void accept( Visitor & v ) { v.visit( this ); } 732 737 virtual Expression * acceptMutator( Mutator & m ) { return m.mutate( this ); } 733 virtual void print( std::ostream & os, Indenter indent = {}) const;738 virtual void print( std::ostream & os, int indent = 0 ) const; 734 739 }; 735 740 … … 758 763 virtual void accept( Visitor & v ) { v.visit( this ); } 759 764 virtual Expression * acceptMutator( Mutator & m ) { return m.mutate( this ); } 760 virtual void print( std::ostream & os, Indenter indent = {}) const;765 virtual void print( std::ostream & os, int indent = 0 ) const; 761 766 762 767 private: … … 792 797 virtual void accept( Visitor & v ) { v.visit( this ); } 793 798 virtual Expression * acceptMutator( Mutator & m ) { return m.mutate( this ); } 794 virtual void print( std::ostream & os, Indenter indent = {}) const;799 virtual void print( std::ostream & os, int indent = 0 ) const; 795 800 }; 796 801 … … 813 818 virtual void accept( Visitor & v ) { v.visit( this ); } 814 819 virtual Expression * acceptMutator( Mutator & m ) { return m.mutate( this ); } 815 virtual void print( std::ostream & os, Indenter indent = {} ) const; 816 }; 820 virtual void print( std::ostream & os, int indent = 0 ) const; 821 }; 822 823 824 std::ostream & operator<<( std::ostream & out, const Expression * expr ); 817 825 818 826 // Local Variables: // -
src/SynTree/FunctionDecl.cc
r3f7e12cb r78315272 26 26 #include "Statement.h" // for CompoundStmt 27 27 #include "Type.h" // for Type, FunctionType, Type::FuncSpecif... 28 #include "VarExprReplacer.h"29 28 30 29 extern bool translation_unit_nomain; … … 40 39 FunctionDecl::FunctionDecl( const FunctionDecl &other ) 41 40 : 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 }54 41 } 55 42 … … 59 46 } 60 47 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 { 48 void FunctionDecl::print( std::ostream &os, int indent ) const { 66 49 using std::endl; 67 50 using std::string; 68 51 69 if ( name!= "" ) {70 os << name<< ": ";52 if ( get_name() != "" ) { 53 os << get_name() << ": "; 71 54 } // if 72 if ( linkage!= LinkageSpec::Cforall ) {73 os << LinkageSpec::linkageName( linkage) << " ";55 if ( get_linkage() != LinkageSpec::Cforall ) { 56 os << LinkageSpec::linkageName( get_linkage() ) << " "; 74 57 } // if 75 58 76 printAll( attributes, os, indent );59 printAll( get_attributes(), os, indent ); 77 60 78 61 get_storageClasses().print( os ); 79 62 get_funcSpec().print( os ); 80 63 81 if ( type) {82 type->print( os, indent );64 if ( get_type() ) { 65 get_type()->print( os, indent ); 83 66 } else { 84 67 os << "untyped entity "; … … 86 69 87 70 if ( statements ) { 88 os << indent << "... with body " << endl << indent+1; 89 statements->print( os, indent+1 ); 71 os << string( indent + 2, ' ' ) << "with body " << endl; 72 os << string( indent + 4, ' ' ); 73 statements->print( os, indent + 4 ); 90 74 } // if 91 75 } 92 76 93 void FunctionDecl::printShort( std::ostream &os, Indenterindent ) const {77 void FunctionDecl::printShort( std::ostream &os, int indent ) const { 94 78 using std::endl; 95 79 using std::string; 96 80 97 if ( name!= "" ) {98 os << name<< ": ";81 if ( get_name() != "" ) { 82 os << get_name() << ": "; 99 83 } // if 84 85 // xxx - should printShort print attributes? 100 86 101 87 get_storageClasses().print( os ); 102 88 get_funcSpec().print( os ); 103 89 104 if ( type) {105 type->print( os, indent );90 if ( get_type() ) { 91 get_type()->print( os, indent ); 106 92 } else { 107 93 os << "untyped entity "; -
src/SynTree/FunctionType.cc
r3f7e12cb r78315272 51 51 } 52 52 53 void FunctionType::print( std::ostream &os, Indenterindent ) const {53 void FunctionType::print( std::ostream &os, int indent ) const { 54 54 using std::string; 55 55 using std::endl; … … 58 58 os << "function" << endl; 59 59 if ( ! parameters.empty() ) { 60 os << indent << "...with parameters" << endl;61 printAll( parameters, os, indent +1);60 os << string( indent + 2, ' ' ) << "with parameters" << endl; 61 printAll( parameters, os, indent + 4 ); 62 62 if ( isVarArgs ) { 63 os << indent+1<< "and a variable number of other arguments" << endl;63 os << string( indent + 4, ' ' ) << "and a variable number of other arguments" << endl; 64 64 } // if 65 65 } else if ( isVarArgs ) { 66 os << indent+1<< "accepting unspecified arguments" << endl;66 os << string( indent + 4, ' ' ) << "accepting unspecified arguments" << endl; 67 67 } // if 68 os << indent << "...returning ";68 os << string( indent + 2, ' ' ) << "returning "; 69 69 if ( returnVals.empty() ) { 70 os << "nothing " << endl;70 os << endl << string( indent + 4, ' ' ) << "nothing " << endl; 71 71 } else { 72 72 os << endl; 73 printAll( returnVals, os, indent +1);73 printAll( returnVals, os, indent + 4 ); 74 74 } // if 75 75 } -
src/SynTree/Initializer.cc
r3f7e12cb r78315272 38 38 } 39 39 40 void Designation::print( std::ostream &os, Indenterindent ) const {40 void Designation::print( std::ostream &os, int indent ) const { 41 41 if ( ! designators.empty() ) { 42 os << "... designated by: " << std::endl; 43 for ( const Expression * d : designators ) { 44 os << indent+1; 45 d->print(os, indent+1 ); 46 os << std::endl; 42 os << std::string(indent + 2, ' ' ) << "designated by: " << std::endl; 43 for ( std::list < Expression * >::const_iterator i = designators.begin(); i != designators.end(); i++ ) { 44 os << std::string(indent + 4, ' ' ); 45 ( *i )->print(os, indent + 4 ); 47 46 } 47 os << std::endl; 48 48 } // if 49 49 } … … 64 64 } 65 65 66 void SingleInit::print( std::ostream &os, Indenter indent ) const { 67 os << "Simple Initializer: "; 68 value->print( os, indent ); 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 ); 69 70 } 70 71 … … 92 93 } 93 94 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 ); 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 ); 101 103 os << std::endl; 102 if ( ! d->designators.empty() ) {103 os << indent+1;104 d->print( os, indent+1 );105 }106 104 } 107 105 } … … 118 116 } 119 117 120 void ConstructorInit::print( std::ostream &os, Indenterindent ) const {121 os << "Constructor initializer: " << std::endl;118 void ConstructorInit::print( std::ostream &os, int indent ) const { 119 os << std::endl << std::string(indent, ' ') << "Constructor initializer: " << std::endl; 122 120 if ( ctor ) { 123 os << indent << "... initially constructed with "; 124 ctor->print( os, indent+1 ); 121 os << std::string(indent+2, ' '); 122 os << "initially constructed with "; 123 ctor->print( os, indent+4 ); 125 124 } // if 126 125 127 126 if ( dtor ) { 128 os << indent << "... destructed with "; 129 dtor->print( os, indent+1 ); 127 os << std::string(indent+2, ' '); 128 os << "destructed with "; 129 dtor->print( os, indent+4 ); 130 130 } 131 131 132 132 if ( init ) { 133 os << indent << "... with fallback C-style initializer: "; 134 init->print( os, indent+1 ); 133 os << std::string(indent+2, ' '); 134 os << "with fallback C-style initializer: "; 135 init->print( os, indent+4 ); 135 136 } 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; 136 155 } 137 156 -
src/SynTree/Initializer.h
r3f7e12cb r78315272 37 37 std::list< Expression * > & get_designators() { return designators; } 38 38 39 virtual Designation * clone() const override{ return new Designation( *this ); };40 virtual void accept( Visitor &v ) override{ v.visit( this ); }41 virtual Designation * acceptMutator( Mutator &m ) override{ return m.mutate( this ); }42 virtual void print( std::ostream &os, Indenter indent = {} ) const override;39 virtual Designation * clone() const { return new Designation( *this ); }; 40 virtual void accept( Visitor &v ) { v.visit( this ); } 41 virtual Designation * acceptMutator( Mutator &m ) { return m.mutate( this ); } 42 virtual void print( std::ostream &os, int indent = 0 ) const; 43 43 }; 44 44 … … 54 54 bool get_maybeConstructed() { return maybeConstructed; } 55 55 56 virtual Initializer *clone() const override= 0;57 virtual void accept( Visitor &v ) override= 0;58 virtual Initializer *acceptMutator( Mutator &m ) override= 0;59 virtual void print( std::ostream &os, Indenter indent = {} ) const override= 0;56 virtual Initializer *clone() const = 0; 57 virtual void accept( Visitor &v ) = 0; 58 virtual Initializer *acceptMutator( Mutator &m ) = 0; 59 virtual void print( std::ostream &os, int indent = 0 ) const = 0; 60 60 private: 61 61 bool maybeConstructed; … … 75 75 void set_value( Expression *newValue ) { value = newValue; } 76 76 77 virtual SingleInit *clone() const override{ return new SingleInit( *this); }78 virtual void accept( Visitor &v ) override{ v.visit( this ); }79 virtual Initializer *acceptMutator( Mutator &m ) override{ return m.mutate( this ); }80 virtual void print( std::ostream &os, Indenter indent = {} ) const override;77 virtual SingleInit *clone() const { return new SingleInit( *this); } 78 virtual void accept( Visitor &v ) { v.visit( this ); } 79 virtual Initializer *acceptMutator( Mutator &m ) { return m.mutate( this ); } 80 virtual void print( std::ostream &os, int indent = 0 ) const; 81 81 }; 82 82 … … 103 103 const_iterator end() const { return initializers.end(); } 104 104 105 virtual ListInit *clone() const override{ return new ListInit( *this ); }106 virtual void accept( Visitor &v ) override{ v.visit( this ); }107 virtual Initializer *acceptMutator( Mutator &m ) override{ return m.mutate( this ); }108 virtual void print( std::ostream &os, Indenter indent = {} ) const override;105 virtual ListInit *clone() const { return new ListInit( *this ); } 106 virtual void accept( Visitor &v ) { v.visit( this ); } 107 virtual Initializer *acceptMutator( Mutator &m ) { return m.mutate( this ); } 108 virtual void print( std::ostream &os, int indent = 0 ) const; 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 fallback120 // if an appropriate constructor definition is not found by the resolver121 Initializer * init;122 119 123 120 ConstructorInit( Statement * ctor, Statement * dtor, Initializer * init ); … … 132 129 Initializer * get_init() const { return init; } 133 130 134 ConstructorInit *clone() const override{ return new ConstructorInit( *this ); }135 virtual void accept( Visitor &v ) override{ v.visit( this ); }136 virtual Initializer *acceptMutator( Mutator &m ) override{ return m.mutate( this ); }137 virtual void print( std::ostream &os, Indenter indent = {} ) const override;131 ConstructorInit *clone() const { return new ConstructorInit( *this ); } 132 virtual void accept( Visitor &v ) { v.visit( this ); } 133 virtual Initializer *acceptMutator( Mutator &m ) { return m.mutate( this ); } 134 virtual void print( std::ostream &os, int indent = 0 ) const; 138 135 139 136 private: 137 // C-style initializer made up of SingleInit and ListInit nodes to use as a fallback 138 // if an appropriate constructor definition is not found by the resolver 139 Initializer * init; 140 140 }; 141 142 std::ostream & operator<<( std::ostream & out, const Initializer * init ); 143 std::ostream & operator<<( std::ostream & out, const Designation * des ); 141 144 142 145 // Local Variables: // -
src/SynTree/Mutator.cc
r3f7e12cb r78315272 17 17 #include <list> // for list 18 18 19 #include "Attribute.h" // for Attribute20 19 #include "Declaration.h" // for ObjectDecl, Declaration, DeclarationWi... 21 20 #include "Expression.h" // for Expression, ConstantExpr, ConditionalExpr … … 37 36 objectDecl->set_init( maybeMutate( objectDecl->get_init(), *this ) ); 38 37 objectDecl->set_bitfieldWidth( maybeMutate( objectDecl->get_bitfieldWidth(), *this ) ); 39 mutateAll( objectDecl->attributes, *this );40 38 return objectDecl; 41 39 } … … 44 42 functionDecl->set_functionType( maybeMutate( functionDecl->get_functionType(), *this ) ); 45 43 functionDecl->set_statements( maybeMutate( functionDecl->get_statements(), *this ) ); 46 mutateAll( functionDecl->attributes, *this );47 44 return functionDecl; 48 45 } … … 621 618 } 622 619 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 638 620 // Local Variables: // 639 621 // tab-width: 4 // -
src/SynTree/Mutator.h
r3f7e12cb r78315272 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 ); 117 118 virtual Attribute * mutate( Attribute * attribute ); 119 120 virtual TypeSubstitution * mutate( TypeSubstitution * sub ); 116 virtual Constant *mutate( Constant *constant ); 121 117 private: 122 virtual Declaration * handleAggregateDecl(AggregateDecl *aggregateDecl );123 virtual Declaration * handleNamedTypeDecl(NamedTypeDecl *typeDecl );124 virtual Type * handleReferenceToType(ReferenceToType *aggregateUseType );118 virtual Declaration* handleAggregateDecl(AggregateDecl *aggregateDecl ); 119 virtual Declaration* handleNamedTypeDecl(NamedTypeDecl *typeDecl ); 120 virtual Type* handleReferenceToType(ReferenceToType *aggregateUseType ); 125 121 }; 126 122 -
src/SynTree/NamedTypeDecl.cc
r3f7e12cb r78315272 38 38 } 39 39 40 void NamedTypeDecl::print( std::ostream &os, Indenterindent ) const {40 void NamedTypeDecl::print( std::ostream &os, int indent ) const { 41 41 using namespace std; 42 42 43 if ( name != "" ) os << name << ": "; 44 45 if ( linkage != LinkageSpec::Cforall ) { 46 os << LinkageSpec::linkageName( linkage ) << " "; 43 if ( get_name() != "" ) { 44 os << get_name() << ": "; 45 } // if 46 if ( get_linkage() != LinkageSpec::Cforall ) { 47 os << LinkageSpec::linkageName( get_linkage() ) << " "; 47 48 } // if 48 49 get_storageClasses().print( os ); … … 50 51 if ( base ) { 51 52 os << " for "; 52 base->print( os, indent +1);53 base->print( os, indent ); 53 54 } // if 54 55 if ( ! parameters.empty() ) { 55 os << endl << indent << "...with parameters" << endl;56 printAll( parameters, os, indent+ 1);56 os << endl << string( indent, ' ' ) << "with parameters" << endl; 57 printAll( parameters, os, indent+2 ); 57 58 } // if 58 59 if ( ! assertions.empty() ) { 59 os << endl << indent << "...with assertions" << endl;60 printAll( assertions, os, indent+ 1);60 os << endl << string( indent, ' ' ) << "with assertions" << endl; 61 printAll( assertions, os, indent+2 ); 61 62 } // if 62 63 } 63 64 64 void NamedTypeDecl::printShort( std::ostream &os, Indenterindent ) const {65 void NamedTypeDecl::printShort( std::ostream &os, int indent ) const { 65 66 using namespace std; 66 67 67 if ( name != "" ) os << name << ": "; 68 if ( get_name() != "" ) { 69 os << get_name() << ": "; 70 } // if 68 71 get_storageClasses().print( os ); 69 72 os << typeString(); 70 73 if ( base ) { 71 74 os << " for "; 72 base->print( os, indent +1);75 base->print( os, indent ); 73 76 } // if 74 77 if ( ! parameters.empty() ) { 75 os << endl << indent << "...with parameters" << endl;76 printAll( parameters, os, indent+ 1);78 os << endl << string( indent, ' ' ) << "with parameters" << endl; 79 printAll( parameters, os, indent+2 ); 77 80 } // if 78 81 } -
src/SynTree/ObjectDecl.cc
r3f7e12cb r78315272 44 44 } 45 45 46 void ObjectDecl::print( std::ostream &os, Indenter indent ) const { 47 if ( name != "" ) os << name << ": "; 46 void ObjectDecl::print( std::ostream &os, int indent ) const { 47 if ( get_name() != "" ) { 48 os << get_name() << ": "; 49 } // if 48 50 49 if ( linkage!= LinkageSpec::Cforall ) {50 os << LinkageSpec::linkageName( linkage) << " ";51 if ( get_linkage() != LinkageSpec::Cforall ) { 52 os << LinkageSpec::linkageName( get_linkage() ) << " "; 51 53 } // if 54 55 printAll( get_attributes(), os, indent ); 52 56 53 57 get_storageClasses().print( os ); 54 58 55 if ( type) {56 type->print( os, indent );59 if ( get_type() ) { 60 get_type()->print( os, indent ); 57 61 } else { 58 62 os << " untyped entity "; … … 60 64 61 65 if ( init ) { 62 os << " with initializer (" << (init->get_maybeConstructed() ? "maybe constructed" : "not constructed") << ")" << std::endl << indent+1; 63 init->print( os, indent+1 ); 64 os << std::endl; 66 os << " with initializer " << std::endl; 67 init->print( os, indent+2 ); 68 os << std::endl << std::string(indent+2, ' '); 69 os << "maybeConstructed? " << init->get_maybeConstructed(); 65 70 } // if 66 71 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 << indent << " with bitfield width "; 73 os << std::string(indent, ' '); 74 os << " with bitfield width "; 74 75 bitfieldWidth->print( os ); 75 76 } // if 76 77 } 77 78 78 void ObjectDecl::printShort( std::ostream &os, Indenterindent ) const {79 void ObjectDecl::printShort( std::ostream &os, int indent ) const { 79 80 #if 0 80 81 if ( get_mangleName() != "") { … … 82 83 } else 83 84 #endif 84 if ( name != "" ) os << name << ": "; 85 if ( get_name() != "" ) { 86 os << get_name() << ": "; 87 } // if 88 89 // xxx - should printShort print attributes? 85 90 86 91 get_storageClasses().print( os ); 87 92 88 if ( type) {89 type->print( os, indent );93 if ( get_type() ) { 94 get_type()->print( os, indent ); 90 95 } else { 91 96 os << "untyped entity "; -
src/SynTree/PointerType.cc
r3f7e12cb r78315272 41 41 } 42 42 43 void PointerType::print( std::ostream &os, Indenterindent ) const {43 void PointerType::print( std::ostream &os, int indent ) const { 44 44 Type::print( os, indent ); 45 45 if ( ! is_array() ) { -
src/SynTree/ReferenceToType.cc
r3f7e12cb r78315272 14 14 // 15 15 16 #include <stddef.h> // for NULL 16 17 #include <cassert> // for assert 17 18 #include <list> // for list, _List_const_iterator, list<>::cons... … … 37 38 } 38 39 39 void ReferenceToType::print( std::ostream &os, Indenterindent ) const {40 void ReferenceToType::print( std::ostream &os, int indent ) const { 40 41 using std::endl; 41 42 … … 43 44 os << "instance of " << typeString() << " " << name << " "; 44 45 if ( ! parameters.empty() ) { 45 os << endl << indent << "...with parameters" << endl;46 printAll( parameters, os, indent+ 1);46 os << endl << std::string( indent, ' ' ) << "with parameters" << endl; 47 printAll( parameters, os, indent+2 ); 47 48 } // if 48 49 } … … 64 65 65 66 std::list<TypeDecl*>* StructInstType::get_baseParameters() { 66 if ( ! baseStruct ) return nullptr;67 if ( ! baseStruct ) return NULL; 67 68 return &baseStruct->get_parameters(); 68 69 } … … 75 76 } 76 77 77 void StructInstType::print( std::ostream &os, Indenterindent ) const {78 void StructInstType::print( std::ostream &os, int indent ) const { 78 79 using std::endl; 79 80 80 if ( baseStruct == nullptr) ReferenceToType::print( os, indent );81 if ( baseStruct == NULL ) ReferenceToType::print( os, indent ); 81 82 else { 82 83 Type::print( os, indent ); 83 84 os << "instance of " << typeString() << " " << name << " with body " << baseStruct->has_body() << " "; 84 85 if ( ! parameters.empty() ) { 85 os << endl << indent << "...with parameters" << endl;86 printAll( parameters, os, indent+ 1);86 os << endl << std::string( indent, ' ' ) << "with parameters" << endl; 87 printAll( parameters, os, indent+2 ); 87 88 } // if 88 89 } // if … … 96 97 97 98 std::list< TypeDecl * > * UnionInstType::get_baseParameters() { 98 if ( ! baseUnion ) return nullptr;99 if ( ! baseUnion ) return NULL; 99 100 return &baseUnion->get_parameters(); 100 101 } … … 107 108 } 108 109 109 void UnionInstType::print( std::ostream &os, Indenterindent ) const {110 void UnionInstType::print( std::ostream &os, int indent ) const { 110 111 using std::endl; 111 112 112 if ( baseUnion == nullptr) ReferenceToType::print( os, indent );113 if ( baseUnion == NULL ) ReferenceToType::print( os, indent ); 113 114 else { 114 115 Type::print( os, indent ); 115 116 os << "instance of " << typeString() << " " << name << " with body " << baseUnion->has_body() << " "; 116 117 if ( ! parameters.empty() ) { 117 os << endl << indent << "...with parameters" << endl;118 printAll( parameters, os, indent+ 1);118 os << endl << std::string( indent, ' ' ) << "with parameters" << endl; 119 printAll( parameters, os, indent+2 ); 119 120 } // if 120 121 } // if … … 128 129 129 130 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 } // if139 }140 141 131 142 132 std::string TraitInstType::typeString() const { return "trait"; } … … 176 166 bool TypeInstType::isComplete() const { return baseType->isComplete(); } 177 167 178 void TypeInstType::print( std::ostream &os, Indenterindent ) const {168 void TypeInstType::print( std::ostream &os, int indent ) const { 179 169 using std::endl; 180 170 … … 182 172 os << "instance of " << typeString() << " " << get_name() << " (" << ( isFtype ? "" : "not" ) << " function type) "; 183 173 if ( ! parameters.empty() ) { 184 os << endl << indent << "...with parameters" << endl;185 printAll( parameters, os, indent+ 1);174 os << endl << std::string( indent, ' ' ) << "with parameters" << endl; 175 printAll( parameters, os, indent+2 ); 186 176 } // if 187 177 } -
src/SynTree/ReferenceType.cc
r3f7e12cb r78315272 35 35 } 36 36 37 void ReferenceType::print( std::ostream &os, Indenterindent ) const {37 void ReferenceType::print( std::ostream &os, int indent ) const { 38 38 Type::print( os, indent ); 39 39 os << "reference to "; -
src/SynTree/Statement.cc
r3f7e12cb r78315272 34 34 Statement::Statement( std::list<Label> labels ) : labels( labels ) {} 35 35 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 } 36 void Statement::print( __attribute__((unused)) std::ostream &, __attribute__((unused)) int indent ) const {} 45 37 46 38 Statement::~Statement() {} … … 54 46 } 55 47 56 void ExprStmt::print( std::ostream &os, Indenterindent ) const {57 os << "Expression Statement:" << endl << indent+1;58 expr->print( os, indent +1);48 void ExprStmt::print( std::ostream &os, int indent ) const { 49 os << "Expression Statement:" << endl << std::string( indent + 2, ' ' ); 50 expr->print( os, indent + 2 ); 59 51 } 60 52 … … 75 67 } 76 68 77 void AsmStmt::print( std::ostream &os, Indenterindent ) const {69 void AsmStmt::print( std::ostream &os, int indent ) const { 78 70 os << "Assembler Statement:" << endl; 79 os << indent+1 << "instruction: " << endl << indent;80 instruction->print( os, indent +1);71 os << std::string( indent, ' ' ) << "instruction: " << endl << std::string( indent, ' ' ); 72 instruction->print( os, indent + 2 ); 81 73 if ( ! output.empty() ) { 82 os << endl << indent+1<< "output: " << endl;83 printAll( output, os, indent +1);74 os << endl << std::string( indent, ' ' ) << "output: " << endl; 75 printAll( output, os, indent + 2 ); 84 76 } // if 85 77 if ( ! input.empty() ) { 86 os << indent+1 << "input: " << endl;87 printAll( input, os, indent +1);78 os << std::string( indent, ' ' ) << "input: " << endl << std::string( indent, ' ' ); 79 printAll( input, os, indent + 2 ); 88 80 } // if 89 81 if ( ! clobber.empty() ) { 90 os << indent+1<< "clobber: " << endl;91 printAll( clobber, os, indent +1);82 os << std::string( indent, ' ' ) << "clobber: " << endl; 83 printAll( clobber, os, indent + 2 ); 92 84 } // if 93 85 } … … 111 103 } 112 104 113 void BranchStmt::print( std::ostream &os, Indenterindent ) 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;105 void BranchStmt::print( std::ostream &os, int indent ) const { 106 os << string( indent, ' ' ) << "Branch (" << brType[type] << ")" << endl ; 107 if ( target != "" ) os << string( indent+2, ' ' ) << "with target: " << target << endl; 108 if ( originalTarget != "" ) os << string( indent+2, ' ' ) << "with original target: " << originalTarget << endl; 109 if ( computedTarget != nullptr ) os << string( indent+2, ' ' ) << "with computed target: " << computedTarget << endl; 118 110 } 119 111 … … 126 118 } 127 119 128 void ReturnStmt::print( std::ostream &os, Indenterindent ) const {129 os << "Return Statement, returning: ";130 if ( expr != nullptr) {131 os << endl << indent+1;132 expr->print( os, indent +1);120 void ReturnStmt::print( std::ostream &os, int indent ) const { 121 os << "Return Statement, returning: "; 122 if ( expr != 0 ) { 123 os << endl << string( indent+2, ' ' ); 124 expr->print( os, indent + 2 ); 133 125 } 134 126 os << endl; … … 150 142 } 151 143 152 void IfStmt::print( std::ostream &os, Indenterindent ) const {153 os << "If on condition: " << endl ;154 os << indent+1;155 condition->print( os, indent +1);144 void IfStmt::print( std::ostream &os, int indent ) const { 145 os << "If on condition: " << endl ; 146 os << string( indent+4, ' ' ); 147 condition->print( os, indent + 4 ); 156 148 157 149 if ( !initialization.empty() ) { 158 os << indent << "... withinitialization: \n";159 for ( const Statement * stmt : initialization) {160 os << indent+1;161 stmt->print( os, indent+1);150 os << string( indent + 2, ' ' ) << "initialization: \n"; 151 for ( std::list<Statement *>::const_iterator it = initialization.begin(); it != initialization.end(); ++it ) { 152 os << string( indent + 4, ' ' ); 153 (*it)->print( os, indent + 4 ); 162 154 } 163 155 os << endl; 164 156 } 165 157 166 os << indent<< "... then: " << endl;167 168 os << indent+1;169 thenPart->print( os, indent +1);158 os << string( indent+2, ' ' ) << "... then: " << endl; 159 160 os << string( indent+4, ' ' ); 161 thenPart->print( os, indent + 4 ); 170 162 171 163 if ( elsePart != 0 ) { 172 os << indent<< "... else: " << endl;173 os << indent+1;174 elsePart->print( os, indent +1);164 os << string( indent+2, ' ' ) << "... else: " << endl; 165 os << string( indent+4, ' ' ); 166 elsePart->print( os, indent + 4 ); 175 167 } // if 176 168 } 177 169 178 SwitchStmt::SwitchStmt( std::list<Label> labels, Expression * condition, conststd::list<Statement *> &statements ):170 SwitchStmt::SwitchStmt( std::list<Label> labels, Expression * condition, std::list<Statement *> &statements ): 179 171 Statement( labels ), condition( condition ), statements( statements ) { 180 172 } … … 191 183 } 192 184 193 void SwitchStmt::print( std::ostream &os, Indenterindent ) const {185 void SwitchStmt::print( std::ostream &os, int indent ) const { 194 186 os << "Switch on condition: "; 195 187 condition->print( os ); 196 188 os << endl; 197 189 198 for ( const Statement * stmt : statements ) { 199 stmt->print( os, indent+1 ); 200 } 201 } 202 203 CaseStmt::CaseStmt( std::list<Label> labels, Expression *condition, const std::list<Statement *> &statements, bool deflt ) throw ( SemanticError ) : 190 // statements 191 std::list<Statement *>::const_iterator i; 192 for ( i = statements.begin(); i != statements.end(); i++) 193 (*i)->print( os, indent + 4 ); 194 195 //for_each( statements.begin(), statements.end(), mem_fun( bind1st(&Statement::print ), os )); 196 } 197 198 CaseStmt::CaseStmt( std::list<Label> labels, Expression *condition, std::list<Statement *> &statements, bool deflt ) throw ( SemanticError ) : 204 199 Statement( labels ), condition( condition ), stmts( statements ), _isDefault( deflt ) { 205 if ( isDefault() && condition != 0 ) throw SemanticError("default case with condition: ", condition); 200 if ( isDefault() && condition != 0 ) 201 throw SemanticError("default with conditions"); 206 202 } 207 203 … … 220 216 } 221 217 222 void CaseStmt::print( std::ostream &os, Indenter indent ) const { 223 if ( isDefault() ) os << "Default "; 218 void CaseStmt::print( std::ostream &os, int indent ) const { 219 os << string( indent, ' ' ); 220 221 if ( isDefault() ) 222 os << "Default "; 224 223 else { 225 224 os << "Case "; 226 condition->print( os , indent);225 condition->print( os ); 227 226 } // if 227 228 228 os << endl; 229 229 230 for ( Statement * stmt : stmts ) {231 stmt->print( os, indent+1 );232 }230 std::list<Statement *>::const_iterator i; 231 for ( i = stmts.begin(); i != stmts.end(); i++) 232 (*i )->print( os, indent + 4 ); 233 233 } 234 234 … … 246 246 } 247 247 248 void WhileStmt::print( std::ostream &os, Indenterindent ) const {248 void WhileStmt::print( std::ostream &os, int indent ) const { 249 249 os << "While on condition: " << endl ; 250 condition->print( os, indent +1);251 252 os << indent << "... with body: " << endl;253 254 if ( body != 0 ) body->print( os, indent +1);250 condition->print( os, indent + 4 ); 251 252 os << string( indent, ' ' ) << ".... with body: " << endl; 253 254 if ( body != 0 ) body->print( os, indent + 4 ); 255 255 } 256 256 … … 272 272 } 273 273 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 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"; 297 302 if ( body != 0 ) { 298 os << "\n" << indent << "... with body: \n" << indent+1; 299 body->print( os, indent+1 ); 300 } 303 os << string( indent + 4, ' ' ); 304 body->print( os, indent + 4 ); 305 } 306 301 307 os << endl; 302 308 } … … 316 322 } 317 323 318 void ThrowStmt::print( std::ostream &os, Indenter indent) const { 319 if ( target ) os << "Non-Local "; 324 void ThrowStmt::print( std::ostream &os, int indent) const { 325 if ( target ) { 326 os << "Non-Local "; 327 } 320 328 os << "Throw Statement, raising: "; 321 expr->print(os, indent +1);329 expr->print(os, indent + 4); 322 330 if ( target ) { 323 os << " ... at: ";324 target->print(os, indent +1);331 os << "At: "; 332 target->print(os, indent + 4); 325 333 } 326 334 } … … 340 348 } 341 349 342 void TryStmt::print( std::ostream &os, Indenterindent ) const {350 void TryStmt::print( std::ostream &os, int indent ) const { 343 351 os << "Try Statement" << endl; 344 os << indent << "... with block:" << endl << indent+1; 345 block->print( os, indent+1 ); 352 os << string( indent + 2, ' ' ) << "with block:" << endl; 353 os << string( indent + 4, ' ' ); 354 block->print( os, indent + 4 ); 346 355 347 356 // handlers 348 os << indent << "...and handlers:" << endl;349 for ( const CatchStmt * stmt : handlers) {350 os << indent+1;351 stmt->print( os, indent+1);357 os << string( indent + 2, ' ' ) << "and handlers:" << endl; 358 for ( std::list<CatchStmt *>::const_iterator i = handlers.begin(); i != handlers.end(); i++) { 359 os << string( indent + 4, ' ' ); 360 (*i )->print( os, indent + 4 ); 352 361 } 353 362 354 363 // finally block 355 364 if ( finallyBlock != 0 ) { 356 os << indent << "... and finally:" << endl << indent+1;357 finallyBlock->print( os, indent +1);365 os << string( indent + 2, ' ' ) << "and finally:" << endl; 366 finallyBlock->print( os, indent + 4 ); 358 367 } // if 359 368 } … … 361 370 CatchStmt::CatchStmt( std::list<Label> labels, Kind kind, Declaration *decl, Expression *cond, Statement *body ) : 362 371 Statement( labels ), kind ( kind ), decl ( decl ), cond ( cond ), body( body ) { 363 assertf( decl, "Catch clause must have a declaration." );364 372 } 365 373 … … 373 381 } 374 382 375 void CatchStmt::print( std::ostream &os, Indenterindent ) const {383 void CatchStmt::print( std::ostream &os, int indent ) const { 376 384 os << "Catch " << ((Terminate == kind) ? "Terminate" : "Resume") << " Statement" << endl; 377 385 378 os << indent << "... catching: "; 379 decl->printShort( os, indent+1 ); 380 os << endl; 386 os << string( indent + 2, ' ' ) << "... catching: "; 387 if ( decl ) { 388 decl->printShort( os, indent + 4 ); 389 os << endl; 390 } 391 else 392 os << string( indent + 4 , ' ' ) << ">>> Error: this catch clause must have a declaration <<<" << endl; 381 393 382 394 if ( cond ) { 383 os << indent << "... with conditional:" << endl << indent+1; 384 cond->print( os, indent+1 ); 385 } 386 387 os << indent << "... with block:" << endl; 388 os << indent+1; 389 body->print( os, indent+1 ); 395 os << string( indent + 2, ' ' ) << "with conditional:" << endl; 396 os << string( indent + 4, ' ' ); 397 cond->print( os, indent + 4 ); 398 } 399 else 400 os << string( indent + 2, ' ' ) << "with no conditional" << endl; 401 402 os << string( indent + 2, ' ' ) << "with block:" << endl; 403 os << string( indent + 4, ' ' ); 404 body->print( os, indent + 4 ); 390 405 } 391 406 … … 402 417 } 403 418 404 void FinallyStmt::print( std::ostream &os, Indenterindent ) const {419 void FinallyStmt::print( std::ostream &os, int indent ) const { 405 420 os << "Finally Statement" << endl; 406 os << indent << "... with block:" << endl << indent+1; 407 block->print( os, indent+1 ); 421 os << string( indent + 2, ' ' ) << "with block:" << endl; 422 os << string( indent + 4, ' ' ); 423 block->print( os, indent + 4 ); 408 424 } 409 425 … … 449 465 } 450 466 451 void WaitForStmt::print( std::ostream &os, Indenterindent ) const {467 void WaitForStmt::print( std::ostream &os, int indent ) const { 452 468 os << "Waitfor Statement" << endl; 453 os << indent << "... with block:" << endl << indent+1; 469 os << string( indent + 2, ' ' ) << "with block:" << endl; 470 os << string( indent + 4, ' ' ); 454 471 // block->print( os, indent + 4 ); 455 472 } … … 458 475 NullStmt::NullStmt() : Statement( std::list<Label>() ) {} 459 476 460 void NullStmt::print( std::ostream &os, Indenter) const {461 os << "Null Statement" << endl ;477 void NullStmt::print( std::ostream &os, __attribute__((unused)) int indent ) const { 478 os << "Null Statement" << endl ; 462 479 } 463 480 … … 473 490 } 474 491 475 void ImplicitCtorDtorStmt::print( std::ostream &os, Indenterindent ) const {492 void ImplicitCtorDtorStmt::print( std::ostream &os, int indent ) const { 476 493 os << "Implicit Ctor Dtor Statement" << endl; 477 os << indent << "...with Ctor/Dtor: ";478 callStmt->print( os, indent +1);494 os << string( indent + 2, ' ' ) << "with Ctor/Dtor: "; 495 callStmt->print( os, indent + 2); 479 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; 480 506 } 481 507 -
src/SynTree/Statement.h
r3f7e12cb r78315272 43 43 const std::list<Label> & get_labels() const { return labels; } 44 44 45 virtual Statement *clone() const override= 0;46 virtual void accept( Visitor &v ) override= 0;47 virtual Statement *acceptMutator( Mutator &m ) override= 0;48 virtual void print( std::ostream &os, Indenter indent = {} ) const override;45 virtual Statement *clone() const = 0; 46 virtual void accept( Visitor &v ) = 0; 47 virtual Statement *acceptMutator( Mutator &m ) = 0; 48 virtual void print( std::ostream &os, int indent = 0 ) const; 49 49 }; 50 50 … … 54 54 55 55 CompoundStmt( std::list<Label> labels ); 56 CompoundStmt( std::list<Statement *> stmts );57 56 CompoundStmt( const CompoundStmt &other ); 58 57 virtual ~CompoundStmt(); … … 62 61 void push_front( Statement * stmt ) { kids.push_front( stmt ); } 63 62 64 virtual CompoundStmt *clone() const override{ return new CompoundStmt( *this ); }65 virtual void accept( Visitor &v ) override{ v.visit( this ); }66 virtual CompoundStmt *acceptMutator( Mutator &m ) override{ return m.mutate( this ); }67 virtual void print( std::ostream &os, Indenter indent = {} ) const override;63 virtual CompoundStmt *clone() const { return new CompoundStmt( *this ); } 64 virtual void accept( Visitor &v ) { v.visit( this ); } 65 virtual CompoundStmt *acceptMutator( Mutator &m ) { return m.mutate( this ); } 66 virtual void print( std::ostream &os, int indent = 0 ) const; 68 67 }; 69 68 … … 73 72 NullStmt( std::list<Label> labels ); 74 73 75 virtual NullStmt *clone() const override{ return new NullStmt( *this ); }76 virtual void accept( Visitor &v ) override{ v.visit( this ); }77 virtual NullStmt *acceptMutator( Mutator &m ) override{ return m.mutate( this ); }78 virtual void print( std::ostream &os, Indenter indent = {} ) const override;74 virtual NullStmt *clone() const { return new NullStmt( *this ); } 75 virtual void accept( Visitor &v ) { v.visit( this ); } 76 virtual NullStmt *acceptMutator( Mutator &m ) { return m.mutate( this ); } 77 virtual void print( std::ostream &os, int indent = 0 ) const; 79 78 }; 80 79 … … 90 89 void set_expr( Expression *newValue ) { expr = newValue; } 91 90 92 virtual ExprStmt *clone() const override{ return new ExprStmt( *this ); }93 virtual void accept( Visitor &v ) override{ v.visit( this ); }94 virtual Statement *acceptMutator( Mutator &m ) override{ return m.mutate( this ); }95 virtual void print( std::ostream &os, Indenter indent = {} ) const override;91 virtual ExprStmt *clone() const { return new ExprStmt( *this ); } 92 virtual void accept( Visitor &v ) { v.visit( this ); } 93 virtual Statement *acceptMutator( Mutator &m ) { return m.mutate( this ); } 94 virtual void print( std::ostream &os, int indent = 0 ) const; 96 95 }; 97 96 … … 124 123 virtual void accept( Visitor & v ) { v.visit( this ); } 125 124 virtual Statement * acceptMutator( Mutator & m ) { return m.mutate( this ); } 126 virtual void print( std::ostream & os, Indenter indent = {}) const;125 virtual void print( std::ostream & os, int indent = 0 ) const; 127 126 }; 128 127 … … 147 146 void set_elsePart( Statement *newValue ) { elsePart = newValue; } 148 147 149 virtual IfStmt *clone() const override{ return new IfStmt( *this ); }150 virtual void accept( Visitor &v ) override{ v.visit( this ); }151 virtual Statement *acceptMutator( Mutator &m ) override{ return m.mutate( this ); }152 virtual void print( std::ostream &os, Indenter indent = {} ) const override;148 virtual IfStmt *clone() const { return new IfStmt( *this ); } 149 virtual void accept( Visitor &v ) { v.visit( this ); } 150 virtual Statement *acceptMutator( Mutator &m ) { return m.mutate( this ); } 151 virtual void print( std::ostream &os, int indent = 0 ) const; 153 152 }; 154 153 … … 158 157 std::list<Statement *> statements; 159 158 160 SwitchStmt( std::list<Label> labels, Expression *condition, conststd::list<Statement *> &statements );159 SwitchStmt( std::list<Label> labels, Expression *condition, std::list<Statement *> &statements ); 161 160 SwitchStmt( const SwitchStmt &other ); 162 161 virtual ~SwitchStmt(); … … 167 166 std::list<Statement *> & get_statements() { return statements; } 168 167 169 virtual void accept( Visitor &v ) override{ v.visit( this ); }170 virtual Statement *acceptMutator( Mutator &m ) override{ return m.mutate( this ); }171 172 virtual SwitchStmt *clone() const override{ return new SwitchStmt( *this ); }173 virtual void print( std::ostream &os, Indenter indent = {} ) const override;168 virtual void accept( Visitor &v ) { v.visit( this ); } 169 virtual Statement *acceptMutator( Mutator &m ) { return m.mutate( this ); } 170 171 virtual SwitchStmt *clone() const { return new SwitchStmt( *this ); } 172 virtual void print( std::ostream &os, int indent = 0 ) const; 174 173 175 174 }; … … 180 179 std::list<Statement *> stmts; 181 180 182 CaseStmt( std::list<Label> labels, Expression *conditions, conststd::list<Statement *> &stmts, bool isdef = false ) throw(SemanticError);181 CaseStmt( std::list<Label> labels, Expression *conditions, std::list<Statement *> &stmts, bool isdef = false ) throw(SemanticError); 183 182 CaseStmt( const CaseStmt &other ); 184 183 virtual ~CaseStmt(); … … 195 194 void set_statements( std::list<Statement *> &newValue ) { stmts = newValue; } 196 195 197 virtual void accept( Visitor &v ) override{ v.visit( this ); }198 virtual Statement *acceptMutator( Mutator &m ) override{ return m.mutate( this ); }199 200 virtual CaseStmt *clone() const override{ return new CaseStmt( *this ); }201 virtual void print( std::ostream &os, Indenter indent = {} ) const override;196 virtual void accept( Visitor &v ) { v.visit( this ); } 197 virtual Statement *acceptMutator( Mutator &m ) { return m.mutate( this ); } 198 199 virtual CaseStmt *clone() const { return new CaseStmt( *this ); } 200 virtual void print( std::ostream &os, int indent = 0 ) const; 202 201 private: 203 202 bool _isDefault; … … 222 221 void set_isDoWhile( bool newValue ) { isDoWhile = newValue; } 223 222 224 virtual WhileStmt *clone() const override{ return new WhileStmt( *this ); }225 virtual void accept( Visitor &v ) override{ v.visit( this ); }226 virtual Statement *acceptMutator( Mutator &m ) override{ return m.mutate( this ); }227 virtual void print( std::ostream &os, Indenter indent = {} ) const override;223 virtual WhileStmt *clone() const { return new WhileStmt( *this ); } 224 virtual void accept( Visitor &v ) { v.visit( this ); } 225 virtual Statement *acceptMutator( Mutator &m ) { return m.mutate( this ); } 226 virtual void print( std::ostream &os, int indent = 0 ) const; 228 227 }; 229 228 … … 248 247 void set_body( Statement *newValue ) { body = newValue; } 249 248 250 virtual ForStmt *clone() const override{ return new ForStmt( *this ); }251 virtual void accept( Visitor &v ) override{ v.visit( this ); }252 virtual Statement *acceptMutator( Mutator &m ) override{ return m.mutate( this ); }253 virtual void print( std::ostream &os, Indenter indent = {} ) const override;249 virtual ForStmt *clone() const { return new ForStmt( *this ); } 250 virtual void accept( Visitor &v ) { v.visit( this ); } 251 virtual Statement *acceptMutator( Mutator &m ) { return m.mutate( this ); } 252 virtual void print( std::ostream &os, int indent = 0 ) const; 254 253 }; 255 254 … … 277 276 const char *get_typename() { return brType[ type ]; } 278 277 279 virtual BranchStmt *clone() const override{ return new BranchStmt( *this ); }280 virtual void accept( Visitor &v ) override{ v.visit( this ); }281 virtual Statement *acceptMutator( Mutator &m ) override{ return m.mutate( this ); }282 virtual void print( std::ostream &os, Indenter indent = {} ) const override;278 virtual BranchStmt *clone() const { return new BranchStmt( *this ); } 279 virtual void accept( Visitor &v ) { v.visit( this ); } 280 virtual Statement *acceptMutator( Mutator &m ) { return m.mutate( this ); } 281 virtual void print( std::ostream &os, int indent = 0 ) const; 283 282 private: 284 283 static const char *brType[]; … … 296 295 void set_expr( Expression *newValue ) { expr = newValue; } 297 296 298 virtual ReturnStmt *clone() const override{ return new ReturnStmt( *this ); }299 virtual void accept( Visitor &v ) override{ v.visit( this ); }300 virtual Statement *acceptMutator( Mutator &m ) override{ return m.mutate( this ); }301 virtual void print( std::ostream &os, Indenter indent = {} ) const override;297 virtual ReturnStmt *clone() const { return new ReturnStmt( *this ); } 298 virtual void accept( Visitor &v ) { v.visit( this ); } 299 virtual Statement *acceptMutator( Mutator &m ) { return m.mutate( this ); } 300 virtual void print( std::ostream &os, int indent = 0 ) const; 302 301 }; 303 302 … … 320 319 void set_target( Expression * newTarget ) { target = newTarget; } 321 320 322 virtual ThrowStmt *clone() const override{ return new ThrowStmt( *this ); }323 virtual void accept( Visitor &v ) override{ v.visit( this ); }324 virtual Statement *acceptMutator( Mutator &m ) override{ return m.mutate( this ); }325 virtual void print( std::ostream &os, Indenter indent = {} ) const override;321 virtual ThrowStmt *clone() const { return new ThrowStmt( *this ); } 322 virtual void accept( Visitor &v ) { v.visit( this ); } 323 virtual Statement *acceptMutator( Mutator &m ) { return m.mutate( this ); } 324 virtual void print( std::ostream &os, int indent = 0 ) const; 326 325 }; 327 326 … … 343 342 void set_finally( FinallyStmt *newValue ) { finallyBlock = newValue; } 344 343 345 virtual TryStmt *clone() const override{ return new TryStmt( *this ); }346 virtual void accept( Visitor &v ) override{ v.visit( this ); }347 virtual Statement *acceptMutator( Mutator &m ) override{ return m.mutate( this ); }348 virtual void print( std::ostream &os, Indenter indent = {} ) const override;344 virtual TryStmt *clone() const { return new TryStmt( *this ); } 345 virtual void accept( Visitor &v ) { v.visit( this ); } 346 virtual Statement *acceptMutator( Mutator &m ) { return m.mutate( this ); } 347 virtual void print( std::ostream &os, int indent = 0 ) const; 349 348 }; 350 349 … … 371 370 void set_body( Statement *newValue ) { body = newValue; } 372 371 373 virtual CatchStmt *clone() const override{ return new CatchStmt( *this ); }374 virtual void accept( Visitor &v ) override{ v.visit( this ); }375 virtual Statement *acceptMutator( Mutator &m ) override{ return m.mutate( this ); }376 virtual void print( std::ostream &os, Indenter indent = {} ) const override;372 virtual CatchStmt *clone() const { return new CatchStmt( *this ); } 373 virtual void accept( Visitor &v ) { v.visit( this ); } 374 virtual Statement *acceptMutator( Mutator &m ) { return m.mutate( this ); } 375 virtual void print( std::ostream &os, int indent = 0 ) const; 377 376 }; 378 377 … … 388 387 void set_block( CompoundStmt *newValue ) { block = newValue; } 389 388 390 virtual FinallyStmt *clone() const override{ return new FinallyStmt( *this ); }391 virtual void accept( Visitor &v ) override{ v.visit( this ); }392 virtual Statement *acceptMutator( Mutator &m ) override{ return m.mutate( this ); }393 virtual void print( std::ostream &os, Indenter indent = {} ) const override;389 virtual FinallyStmt *clone() const { return new FinallyStmt( *this ); } 390 virtual void accept( Visitor &v ) { v.visit( this ); } 391 virtual Statement *acceptMutator( Mutator &m ) { return m.mutate( this ); } 392 virtual void print( std::ostream &os, int indent = 0 ) const; 394 393 }; 395 394 … … 425 424 } orelse; 426 425 427 virtual WaitForStmt *clone() const override{ return new WaitForStmt( *this ); }428 virtual void accept( Visitor &v ) override{ v.visit( this ); }429 virtual Statement *acceptMutator( Mutator &m ) override{ return m.mutate( this ); }430 virtual void print( std::ostream &os, Indenter indent = {} ) const override;426 virtual WaitForStmt *clone() const { return new WaitForStmt( *this ); } 427 virtual void accept( Visitor &v ) { v.visit( this ); } 428 virtual Statement *acceptMutator( Mutator &m ) { return m.mutate( this ); } 429 virtual void print( std::ostream &os, int indent = 0 ) const; 431 430 432 431 }; … … 445 444 void set_decl( Declaration *newValue ) { decl = newValue; } 446 445 447 virtual DeclStmt *clone() const override{ return new DeclStmt( *this ); }448 virtual void accept( Visitor &v ) override{ v.visit( this ); }449 virtual Statement *acceptMutator( Mutator &m ) override{ return m.mutate( this ); }450 virtual void print( std::ostream &os, Indenter indent = {} ) const override;446 virtual DeclStmt *clone() const { return new DeclStmt( *this ); } 447 virtual void accept( Visitor &v ) { v.visit( this ); } 448 virtual Statement *acceptMutator( Mutator &m ) { return m.mutate( this ); } 449 virtual void print( std::ostream &os, int indent = 0 ) const; 451 450 }; 452 451 … … 467 466 void set_callStmt( Statement * newValue ) { callStmt = newValue; } 468 467 469 virtual ImplicitCtorDtorStmt *clone() const override { return new ImplicitCtorDtorStmt( *this ); } 470 virtual void accept( Visitor &v ) override { v.visit( this ); } 471 virtual Statement *acceptMutator( Mutator &m ) override { return m.mutate( this ); } 472 virtual void print( std::ostream &os, Indenter indent = {} ) const override; 473 }; 468 virtual ImplicitCtorDtorStmt *clone() const { return new ImplicitCtorDtorStmt( *this ); } 469 virtual void accept( Visitor &v ) { v.visit( this ); } 470 virtual Statement *acceptMutator( Mutator &m ) { return m.mutate( this ); } 471 virtual void print( std::ostream &os, int indent = 0 ) const; 472 }; 473 474 475 std::ostream & operator<<( std::ostream & out, const Statement * statement ); 474 476 475 477 // Local Variables: // -
src/SynTree/TupleExpr.cc
r3f7e12cb r78315272 28 28 #include "Type.h" // for TupleType, Type 29 29 30 UntypedTupleExpr::UntypedTupleExpr( const std::list< Expression * > & exprs ) : Expression(), exprs( exprs ) {30 UntypedTupleExpr::UntypedTupleExpr( const std::list< Expression * > & exprs, Expression *_aname ) : Expression( _aname ), exprs( exprs ) { 31 31 } 32 32 … … 39 39 } 40 40 41 void UntypedTupleExpr::print( std::ostream &os, Indenterindent ) const {41 void UntypedTupleExpr::print( std::ostream &os, int indent ) const { 42 42 os << "Untyped Tuple:" << std::endl; 43 printAll( exprs, os, indent+ 1);43 printAll( exprs, os, indent+2 ); 44 44 Expression::print( os, indent ); 45 45 } 46 46 47 TupleExpr::TupleExpr( const std::list< Expression * > & exprs ) : Expression(), exprs( exprs ) {47 TupleExpr::TupleExpr( const std::list< Expression * > & exprs, Expression *_aname ) : Expression( _aname ), exprs( exprs ) { 48 48 set_result( Tuples::makeTupleType( exprs ) ); 49 49 } … … 57 57 } 58 58 59 void TupleExpr::print( std::ostream &os, Indenterindent ) const {59 void TupleExpr::print( std::ostream &os, int indent ) const { 60 60 os << "Tuple:" << std::endl; 61 printAll( exprs, os, indent+ 1);61 printAll( exprs, os, indent+2 ); 62 62 Expression::print( os, indent ); 63 63 } … … 78 78 } 79 79 80 void TupleIndexExpr::print( std::ostream &os, Indenterindent ) const {80 void TupleIndexExpr::print( std::ostream &os, int indent ) const { 81 81 os << "Tuple Index Expression, with tuple:" << std::endl; 82 os << indent+1;83 tuple->print( os, indent+ 1);84 os << indent+1<< "with index: " << index << std::endl;82 os << std::string( indent+2, ' ' ); 83 tuple->print( os, indent+2 ); 84 os << std::string( indent+2, ' ' ) << "with index: " << index << std::endl; 85 85 Expression::print( os, indent ); 86 86 } 87 87 88 TupleAssignExpr::TupleAssignExpr( const std::list< Expression * > & assigns, const std::list< ObjectDecl * > & tempDecls ) : Expression() {88 TupleAssignExpr::TupleAssignExpr( const std::list< Expression * > & assigns, const std::list< ObjectDecl * > & tempDecls, Expression * _aname ) : Expression( _aname ) { 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, Indenterindent ) const {111 void TupleAssignExpr::print( std::ostream &os, int indent ) const { 112 112 os << "Tuple Assignment Expression, with stmt expr:" << std::endl; 113 os << indent+1;114 stmtExpr->print( os, indent+ 1);113 os << std::string( indent+2, ' ' ); 114 stmtExpr->print( os, indent+4 ); 115 115 Expression::print( os, indent ); 116 116 } -
src/SynTree/TupleType.cc
r3f7e12cb r78315272 48 48 } 49 49 50 void TupleType::print( std::ostream &os, Indenterindent ) const {50 void TupleType::print( std::ostream &os, int indent ) const { 51 51 Type::print( os, indent ); 52 52 os << "tuple of types" << std::endl; 53 printAll( types, os, indent+ 1);53 printAll( types, os, indent+2 ); 54 54 } 55 55 -
src/SynTree/Type.cc
r3f7e12cb r78315272 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 25 15:16:32201713 // Update Count : 3 812 // Last Modified On : Mon Sep 11 13:21:25 2017 13 // Update Count : 37 14 14 // 15 15 #include "Type.h" … … 45 45 "double _Imaginary", 46 46 "long double _Imaginary", 47 "__int128",48 "unsigned __int128",49 47 }; 50 48 … … 75 73 Type * type; 76 74 ReferenceType * ref; 77 for ( type = this; (ref = dynamic_cast<ReferenceType *>( type )); type = ref-> base);75 for ( type = this; (ref = dynamic_cast<ReferenceType *>( type )); type = ref->get_base() ); 78 76 return type; 79 77 } … … 81 79 int Type::referenceDepth() const { return 0; } 82 80 83 void Type::print( std::ostream &os, Indenterindent ) const {81 void Type::print( std::ostream &os, int indent ) const { 84 82 if ( ! forall.empty() ) { 85 83 os << "forall" << std::endl; 86 printAll( forall, os, indent +1);87 os << ++indent;84 printAll( forall, os, indent + 4 ); 85 os << std::string( indent+2, ' ' ); 88 86 } // if 89 87 90 88 if ( ! attributes.empty() ) { 91 os << "with attributes" << endl;92 printAll( attributes, os, indent+ 1);89 os << endl << string( indent+2, ' ' ) << "with attributes" << endl; 90 printAll( attributes, os, indent+4 ); 93 91 } // if 94 92 … … 101 99 const Type::Qualifiers noQualifiers; 102 100 101 std::ostream & operator<<( std::ostream & out, const Type * type ) { 102 if ( type ) { 103 type->print( out ); 104 } else { 105 out << "nullptr"; 106 } // if 107 return out; 108 } 109 103 110 // Local Variables: // 104 111 // tab-width: 4 // -
src/SynTree/Type.h
r3f7e12cb r78315272 9 9 // Author : Richard C. Bilson 10 10 // Created On : Mon May 18 07:44:20 2015 11 // Last Modified By : Peter A. Buhr12 // Last Modified On : Mon Sep 25 14:14:01201713 // Update Count : 15 411 // Last Modified By : Andrew Beach 12 // Last Modified On : Wed Aug 9 14:25:00 2017 13 // Update Count : 152 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, Indenter indent = {}) const;183 virtual void print( std::ostream & os, int indent = 0 ) 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 override{ return 0; };195 virtual bool isComplete() const override{ return false; }196 197 virtual VoidType *clone() const override{ return new VoidType( *this ); }198 virtual void accept( Visitor & v ) override{ v.visit( this ); }199 virtual Type *acceptMutator( Mutator & m ) override{ return m.mutate( this ); }200 virtual void print( std::ostream & os, Indenter indent = {} ) const override;194 virtual unsigned size() const { return 0; }; 195 virtual bool isComplete() const { return false; } 196 197 virtual VoidType *clone() const { return new VoidType( *this ); } 198 virtual void accept( Visitor & v ) { v.visit( this ); } 199 virtual Type *acceptMutator( Mutator & m ) { return m.mutate( this ); } 200 virtual void print( std::ostream & os, int indent = 0 ) const; 201 201 }; 202 202 … … 225 225 DoubleImaginary, 226 226 LongDoubleImaginary, 227 SignedInt128,228 UnsignedInt128,229 227 NUMBER_OF_BASIC_TYPES 230 228 } kind; … … 237 235 void set_kind( Kind newValue ) { kind = newValue; } 238 236 239 virtual BasicType *clone() const override{ return new BasicType( *this ); }240 virtual void accept( Visitor & v ) override{ v.visit( this ); }241 virtual Type *acceptMutator( Mutator & m ) override{ return m.mutate( this ); }242 virtual void print( std::ostream & os, Indenter indent = {} ) const override;237 virtual BasicType *clone() const { return new BasicType( *this ); } 238 virtual void accept( Visitor & v ) { v.visit( this ); } 239 virtual Type *acceptMutator( Mutator & m ) { return m.mutate( this ); } 240 virtual void print( std::ostream & os, int indent = 0 ) const; 243 241 244 242 bool isInteger() const; … … 270 268 bool is_array() const { return isStatic || isVarLen || dimension; } 271 269 272 virtual bool isComplete() const override{ return ! isVarLen; }273 274 virtual PointerType *clone() const override{ return new PointerType( *this ); }275 virtual void accept( Visitor & v ) override{ v.visit( this ); }276 virtual Type *acceptMutator( Mutator & m ) override{ return m.mutate( this ); }277 virtual void print( std::ostream & os, Indenter indent = {} ) const override;270 virtual bool isComplete() const { return ! isVarLen; } 271 272 virtual PointerType *clone() const { return new PointerType( *this ); } 273 virtual void accept( Visitor & v ) { v.visit( this ); } 274 virtual Type *acceptMutator( Mutator & m ) { return m.mutate( this ); } 275 virtual void print( std::ostream & os, int indent = 0 ) const; 278 276 }; 279 277 … … 298 296 void set_isStatic( bool newValue ) { isStatic = newValue; } 299 297 300 // array types are complete if they have a dimension expression or are 301 // VLAs ('*' in parameter declaration), and incomplete otherwise. 302 // See 6.7.6.2 303 virtual bool isComplete() const override { return dimension || isVarLen; } 304 305 virtual ArrayType *clone() const override { return new ArrayType( *this ); } 306 virtual void accept( Visitor & v ) override { v.visit( this ); } 307 virtual Type *acceptMutator( Mutator & m ) override { return m.mutate( this ); } 308 virtual void print( std::ostream & os, Indenter indent = {} ) const override; 298 virtual bool isComplete() const { return ! isVarLen; } 299 300 virtual ArrayType *clone() const { return new ArrayType( *this ); } 301 virtual void accept( Visitor & v ) { v.visit( this ); } 302 virtual Type *acceptMutator( Mutator & m ) { return m.mutate( this ); } 303 virtual void print( std::ostream & os, int indent = 0 ) const; 309 304 }; 310 305 … … 320 315 void set_base( Type *newValue ) { base = newValue; } 321 316 322 virtual int referenceDepth() const override;317 virtual int referenceDepth() const; 323 318 324 319 // Since reference types act like value types, their size is the size of the base. 325 320 // This makes it simple to cast the empty tuple to a reference type, since casts that increase 326 321 // the number of values are disallowed. 327 virtual unsigned size() const override{ return base->size(); }328 329 virtual ReferenceType *clone() const override{ return new ReferenceType( *this ); }330 virtual void accept( Visitor & v ) override{ v.visit( this ); }331 virtual Type *acceptMutator( Mutator & m ) override{ return m.mutate( this ); }332 virtual void print( std::ostream & os, Indenter indent = {} ) const override;322 virtual unsigned size() const { return base->size(); } 323 324 virtual ReferenceType *clone() const { return new ReferenceType( *this ); } 325 virtual void accept( Visitor & v ) { v.visit( this ); } 326 virtual Type *acceptMutator( Mutator & m ) { return m.mutate( this ); } 327 virtual void print( std::ostream & os, int indent = 0 ) const; 333 328 }; 334 329 … … 354 349 bool isTtype() const; 355 350 356 virtual FunctionType *clone() const override{ return new FunctionType( *this ); }357 virtual void accept( Visitor & v ) override{ v.visit( this ); }358 virtual Type *acceptMutator( Mutator & m ) override{ return m.mutate( this ); }359 virtual void print( std::ostream & os, Indenter indent = {} ) const override;351 virtual FunctionType *clone() const { return new FunctionType( *this ); } 352 virtual void accept( Visitor & v ) { v.visit( this ); } 353 virtual Type *acceptMutator( Mutator & m ) { return m.mutate( this ); } 354 virtual void print( std::ostream & os, int indent = 0 ) const; 360 355 }; 361 356 … … 376 371 void set_hoistType( bool newValue ) { hoistType = newValue; } 377 372 378 virtual ReferenceToType *clone() const override= 0;379 virtual void accept( Visitor & v ) override= 0;380 virtual Type *acceptMutator( Mutator & m ) override= 0;381 virtual void print( std::ostream & os, Indenter indent = {} ) const override;373 virtual ReferenceToType *clone() const = 0; 374 virtual void accept( Visitor & v ) = 0; 375 virtual Type *acceptMutator( Mutator & m ) = 0; 376 virtual void print( std::ostream & os, int indent = 0 ) const; 382 377 383 378 virtual void lookup( __attribute__((unused)) const std::string & name, __attribute__((unused)) std::list< Declaration* > & foundDecls ) const {} … … 403 398 std::list<TypeDecl*> * get_baseParameters(); 404 399 405 virtual bool isComplete() const override;400 virtual bool isComplete() const; 406 401 407 402 /// Looks up the members of this struct named "name" and places them into "foundDecls". 408 403 /// Clones declarations into "foundDecls", caller responsible for freeing 409 void lookup( const std::string & name, std::list< Declaration* > & foundDecls ) const override;410 411 virtual StructInstType *clone() const override{ return new StructInstType( *this ); }412 virtual void accept( Visitor & v ) override{ v.visit( this ); }413 virtual Type *acceptMutator( Mutator & m ) override{ return m.mutate( this ); }414 415 virtual void print( std::ostream & os, Indenter indent = {} ) const override;404 void lookup( const std::string & name, std::list< Declaration* > & foundDecls ) const; 405 406 virtual StructInstType *clone() const { return new StructInstType( *this ); } 407 virtual void accept( Visitor & v ) { v.visit( this ); } 408 virtual Type *acceptMutator( Mutator & m ) { return m.mutate( this ); } 409 410 virtual void print( std::ostream & os, int indent = 0 ) const; 416 411 private: 417 virtual std::string typeString() const override;412 virtual std::string typeString() const; 418 413 }; 419 414 … … 435 430 std::list< TypeDecl * > * get_baseParameters(); 436 431 437 virtual bool isComplete() const override;432 virtual bool isComplete() const; 438 433 439 434 /// looks up the members of this union named "name" and places them into "foundDecls" 440 435 /// Clones declarations into "foundDecls", caller responsible for freeing 441 void lookup( const std::string & name, std::list< Declaration* > & foundDecls ) const override;442 443 virtual UnionInstType *clone() const override{ return new UnionInstType( *this ); }444 virtual void accept( Visitor & v ) override{ v.visit( this ); }445 virtual Type *acceptMutator( Mutator & m ) override{ return m.mutate( this ); }446 447 virtual void print( std::ostream & os, Indenter indent = {} ) const override;436 void lookup( const std::string & name, std::list< Declaration* > & foundDecls ) const; 437 438 virtual UnionInstType *clone() const { return new UnionInstType( *this ); } 439 virtual void accept( Visitor & v ) { v.visit( this ); } 440 virtual Type *acceptMutator( Mutator & m ) { return m.mutate( this ); } 441 442 virtual void print( std::ostream & os, int indent = 0 ) const; 448 443 private: 449 virtual std::string typeString() const override;444 virtual std::string typeString() const; 450 445 }; 451 446 … … 464 459 void set_baseEnum( EnumDecl *newValue ) { baseEnum = newValue; } 465 460 466 virtual bool isComplete() const override; 467 468 virtual EnumInstType *clone() const override { return new EnumInstType( *this ); } 469 virtual void accept( Visitor & v ) override { v.visit( this ); } 470 virtual Type *acceptMutator( Mutator & m ) override { return m.mutate( this ); } 471 472 virtual void print( std::ostream & os, Indenter indent = {} ) const override; 461 virtual bool isComplete() const; 462 463 virtual EnumInstType *clone() const { return new EnumInstType( *this ); } 464 virtual void accept( Visitor & v ) { v.visit( this ); } 465 virtual Type *acceptMutator( Mutator & m ) { return m.mutate( this ); } 473 466 private: 474 virtual std::string typeString() const override;467 virtual std::string typeString() const; 475 468 }; 476 469 … … 487 480 ~TraitInstType(); 488 481 489 virtual bool isComplete() const override;490 491 virtual TraitInstType *clone() const override{ return new TraitInstType( *this ); }492 virtual void accept( Visitor & v ) override{ v.visit( this ); }493 virtual Type *acceptMutator( Mutator & m ) override{ return m.mutate( this ); }482 virtual bool isComplete() const; 483 484 virtual TraitInstType *clone() const { return new TraitInstType( *this ); } 485 virtual void accept( Visitor & v ) { v.visit( this ); } 486 virtual Type *acceptMutator( Mutator & m ) { return m.mutate( this ); } 494 487 private: 495 virtual std::string typeString() const override;488 virtual std::string typeString() const; 496 489 }; 497 490 … … 514 507 void set_isFtype( bool newValue ) { isFtype = newValue; } 515 508 516 virtual bool isComplete() const override;517 518 virtual TypeInstType *clone() const override{ return new TypeInstType( *this ); }519 virtual void accept( Visitor & v ) override{ v.visit( this ); }520 virtual Type *acceptMutator( Mutator & m ) override{ return m.mutate( this ); }521 virtual void print( std::ostream & os, Indenter indent = {} ) const override;509 virtual bool isComplete() const; 510 511 virtual TypeInstType *clone() const { return new TypeInstType( *this ); } 512 virtual void accept( Visitor & v ) { v.visit( this ); } 513 virtual Type *acceptMutator( Mutator & m ) { return m.mutate( this ); } 514 virtual void print( std::ostream & os, int indent = 0 ) const; 522 515 private: 523 virtual std::string typeString() const override;516 virtual std::string typeString() const; 524 517 }; 525 518 … … 537 530 538 531 std::list<Type *> & get_types() { return types; } 539 virtual unsigned size() const override{ return types.size(); };532 virtual unsigned size() const { return types.size(); }; 540 533 541 534 // For now, this is entirely synthetic -- tuple types always have unnamed members. … … 546 539 iterator end() { return types.end(); } 547 540 548 virtual Type * getComponent( unsigned i ) override{541 virtual Type * getComponent( unsigned i ) { 549 542 assertf( i < size(), "TupleType::getComponent: index %d must be less than size %d", i, size() ); 550 543 return *(begin()+i); 551 544 } 552 545 553 // virtual bool isComplete() const override{ return true; } // xxx - not sure if this is right, might need to recursively check complete-ness554 555 virtual TupleType *clone() const override{ return new TupleType( *this ); }556 virtual void accept( Visitor & v ) override{ v.visit( this ); }557 virtual Type *acceptMutator( Mutator & m ) override{ return m.mutate( this ); }558 virtual void print( std::ostream & os, Indenter indent = {} ) const override;546 // virtual bool isComplete() const { return true; } // xxx - not sure if this is right, might need to recursively check complete-ness 547 548 virtual TupleType *clone() const { return new TupleType( *this ); } 549 virtual void accept( Visitor & v ) { v.visit( this ); } 550 virtual Type *acceptMutator( Mutator & m ) { return m.mutate( this ); } 551 virtual void print( std::ostream & os, int indent = 0 ) const; 559 552 }; 560 553 … … 570 563 void set_expr( Expression *newValue ) { expr = newValue; } 571 564 572 virtual bool isComplete() const override{ assert( false ); return false; }573 574 virtual TypeofType *clone() const override{ return new TypeofType( *this ); }575 virtual void accept( Visitor & v ) override{ v.visit( this ); }576 virtual Type *acceptMutator( Mutator & m ) override{ return m.mutate( this ); }577 virtual void print( std::ostream & os, Indenter indent = {} ) const override;565 virtual bool isComplete() const { assert( false ); return false; } 566 567 virtual TypeofType *clone() const { return new TypeofType( *this ); } 568 virtual void accept( Visitor & v ) { v.visit( this ); } 569 virtual Type *acceptMutator( Mutator & m ) { return m.mutate( this ); } 570 virtual void print( std::ostream & os, int indent = 0 ) const; 578 571 }; 579 572 … … 599 592 void set_isType( bool newValue ) { isType = newValue; } 600 593 601 virtual bool isComplete() const override{ assert( false ); } // xxx - not sure what to do here602 603 virtual AttrType *clone() const override{ return new AttrType( *this ); }604 virtual void accept( Visitor & v ) override{ v.visit( this ); }605 virtual Type *acceptMutator( Mutator & m ) override{ return m.mutate( this ); }606 virtual void print( std::ostream & os, Indenter indent = {} ) const override;594 virtual bool isComplete() const { assert( false ); } // xxx - not sure what to do here 595 596 virtual AttrType *clone() const { return new AttrType( *this ); } 597 virtual void accept( Visitor & v ) { v.visit( this ); } 598 virtual Type *acceptMutator( Mutator & m ) { return m.mutate( this ); } 599 virtual void print( std::ostream & os, int indent = 0 ) const; 607 600 }; 608 601 … … 613 606 VarArgsType( Type::Qualifiers tq, const std::list< Attribute * > & attributes = std::list< Attribute * >() ); 614 607 615 virtual bool isComplete() const override{ return true; } // xxx - is this right?616 617 virtual VarArgsType *clone() const override{ return new VarArgsType( *this ); }618 virtual void accept( Visitor & v ) override{ v.visit( this ); }619 virtual Type *acceptMutator( Mutator & m ) override{ return m.mutate( this ); }620 virtual void print( std::ostream & os, Indenter indent = {} ) const override;608 virtual bool isComplete() const{ return true; } // xxx - is this right? 609 610 virtual VarArgsType *clone() const { return new VarArgsType( *this ); } 611 virtual void accept( Visitor & v ) { v.visit( this ); } 612 virtual Type *acceptMutator( Mutator & m ) { return m.mutate( this ); } 613 virtual void print( std::ostream & os, int indent = 0 ) const; 621 614 }; 622 615 … … 627 620 ZeroType( Type::Qualifiers tq, const std::list< Attribute * > & attributes = std::list< Attribute * >() ); 628 621 629 virtual ZeroType *clone() const override{ return new ZeroType( *this ); }630 virtual void accept( Visitor & v ) override{ v.visit( this ); }631 virtual Type *acceptMutator( Mutator & m ) override{ return m.mutate( this ); }632 virtual void print( std::ostream & os, Indenter indent = {} ) const override;622 virtual ZeroType *clone() const { return new ZeroType( *this ); } 623 virtual void accept( Visitor & v ) { v.visit( this ); } 624 virtual Type *acceptMutator( Mutator & m ) { return m.mutate( this ); } 625 virtual void print( std::ostream & os, int indent = 0 ) const; 633 626 }; 634 627 … … 639 632 OneType( Type::Qualifiers tq, const std::list< Attribute * > & attributes = std::list< Attribute * >() ); 640 633 641 virtual OneType *clone() const override { return new OneType( *this ); } 642 virtual void accept( Visitor & v ) override { v.visit( this ); } 643 virtual Type *acceptMutator( Mutator & m ) override { return m.mutate( this ); } 644 virtual void print( std::ostream & os, Indenter indent = {} ) const override; 645 }; 634 virtual OneType *clone() const { return new OneType( *this ); } 635 virtual void accept( Visitor & v ) { v.visit( this ); } 636 virtual Type *acceptMutator( Mutator & m ) { return m.mutate( this ); } 637 virtual void print( std::ostream & os, int indent = 0 ) const; 638 }; 639 640 std::ostream & operator<<( std::ostream & out, const Type * type ); 646 641 647 642 // Local Variables: // -
src/SynTree/TypeDecl.cc
r3f7e12cb r78315272 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, bool sized, Type * init ) : Parent( name, scs, type ), init( init ), sized( kind == Ttype || sized), kind( kind ) {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 ) { 24 24 } 25 25 … … 32 32 33 33 std::string TypeDecl::typeString() const { 34 static const std::string kindNames[] = { "object type", "function type", "tuple type" }; 35 assertf( sizeof(kindNames)/sizeof(kindNames[0]) == DeclarationNode::NoTypeClass-1, "typeString: kindNames is out of sync." ); 36 assertf( kind < sizeof(kindNames)/sizeof(kindNames[0]), "TypeDecl's kind is out of bounds." ); 37 return (isComplete() ? "sized " : "") + kindNames[ kind ]; 34 static const std::string kindNames[] = { "type", "incomplete type", "function type", "tuple type" }; 35 return (kind != Any && isComplete() ? "sized " : "") + kindNames[ kind ]; 38 36 } 39 37 40 38 std::string TypeDecl::genTypeString() const { 41 static const std::string kindNames[] = { "dtype", "ftype", "ttype" }; 42 assertf( sizeof(kindNames)/sizeof(kindNames[0]) == DeclarationNode::NoTypeClass-1, "genTypeString: kindNames is out of sync." ); 43 assertf( kind < sizeof(kindNames)/sizeof(kindNames[0]), "TypeDecl's kind is out of bounds." ); 39 static const std::string kindNames[] = { "otype", "dtype", "ftype", "ttype" }; 44 40 return kindNames[ kind ]; 45 41 } 46 42 47 void TypeDecl::print( std::ostream &os, Indenterindent ) const {43 void TypeDecl::print( std::ostream &os, int indent ) const { 48 44 NamedTypeDecl::print( os, indent ); 49 45 if ( init ) { 50 os << std::endl << indent<< "with type initializer: ";51 init->print( os, indent + 1);46 os << std::endl << std::string( indent, ' ' ) << "with type initializer: "; 47 init->print( os, indent + 2 ); 52 48 } 53 49 } -
src/SynTree/TypeExpr.cc
r3f7e12cb r78315272 30 30 } 31 31 32 void TypeExpr::print( std::ostream &os, Indenterindent ) const {32 void TypeExpr::print( std::ostream &os, int indent ) const { 33 33 if ( type ) type->print( os, indent ); 34 34 Expression::print( os, indent ); -
src/SynTree/TypeSubstitution.cc
r3f7e12cb r78315272 148 148 template< typename TypeClass > 149 149 Type *TypeSubstitution::handleType( TypeClass *type ) { 150 ValueGuard<BoundVarsType>oldBoundVars( boundVars );150 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; 158 159 return ret; 159 160 } … … 161 162 template< typename TypeClass > 162 163 Type *TypeSubstitution::handleAggregateType( TypeClass *type ) { 163 ValueGuard<BoundVarsType>oldBoundVars( boundVars );164 BoundVarsType oldBoundVars( boundVars ); 164 165 // bind type variables from forall-qualifiers 165 166 if ( freeOnly ) { … … 176 177 } // if 177 178 Type *ret = Mutator::mutate( type ); 179 boundVars = oldBoundVars; 178 180 return ret; 179 181 } … … 231 233 } 232 234 233 void TypeSubstitution::print( std::ostream &os, Indenter indent ) const { 234 os << indent << "Types:" << std::endl; 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; 235 247 for ( TypeEnvType::const_iterator i = typeEnv.begin(); i != typeEnv.end(); ++i ) { 236 os << indent+1<< i->first << " -> ";237 i->second->print( os, indent+ 2);248 os << std::string( indent+2, ' ' ) << i->first << " -> "; 249 i->second->print( os, indent+4 ); 238 250 os << std::endl; 239 251 } // for 240 os << indent<< "Non-types:" << std::endl;252 os << std::string( indent, ' ' ) << "Non-types:" << std::endl; 241 253 for ( VarEnvType::const_iterator i = varEnv.begin(); i != varEnv.end(); ++i ) { 242 os << indent+1<< i->first << " -> ";243 i->second->print( os, indent+ 2);254 os << std::string( indent+2, ' ' ) << i->first << " -> "; 255 i->second->print( os, indent+4 ); 244 256 os << std::endl; 245 257 } // for -
src/SynTree/TypeSubstitution.h
r3f7e12cb r78315272 59 59 void normalize(); 60 60 61 TypeSubstitution * acceptMutator( Mutator & m ) { return m.mutate( this ); }61 TypeSubstitution * acceptMutator( Mutator & mutator ); 62 62 63 void print( std::ostream &os, Indenter indent = {}) const;63 void print( std::ostream &os, int indent = 0 ) 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;96 91 97 92 typedef std::map< std::string, Type* > TypeEnvType; -
src/SynTree/TypeofType.cc
r3f7e12cb r78315272 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, Indenterindent ) const {35 void TypeofType::print( std::ostream &os, int indent ) const { 36 36 Type::print( os, indent ); 37 37 os << "type-of expression "; -
src/SynTree/VarArgsType.cc
r3f7e12cb r78315272 25 25 VarArgsType::VarArgsType( Type::Qualifiers tq, const std::list< Attribute * > & attributes ) : Type( tq, attributes ) {} 26 26 27 void VarArgsType::print( std::ostream &os, Indenterindent ) const {27 void VarArgsType::print( std::ostream &os, int indent ) const { 28 28 Type::print( os, indent ); 29 29 os << "builtin var args pack"; -
src/SynTree/VarExprReplacer.h
r3f7e12cb r78315272 29 29 private: 30 30 const DeclMap & declMap; 31 bool debug;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 }42 37 }; 43 38 -
src/SynTree/Visitor.cc
r3f7e12cb r78315272 17 17 #include <list> // for list 18 18 19 #include "Attribute.h" // for Attribute20 19 #include "Constant.h" // for Constant 21 20 #include "Declaration.h" // for DeclarationWithType, ObjectDecl, Declaration … … 36 35 maybeAccept( objectDecl->get_init(), *this ); 37 36 maybeAccept( objectDecl->get_bitfieldWidth(), *this ); 38 acceptAll( objectDecl->attributes, *this );39 37 } 40 38 … … 42 40 maybeAccept( functionDecl->get_functionType(), *this ); 43 41 maybeAccept( functionDecl->get_statements(), *this ); 44 acceptAll( functionDecl->attributes, *this );45 42 } 46 43 … … 490 487 491 488 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 489 void Visitor::visit( __attribute__((unused)) Subrange *subrange ) {} 490 491 492 void Visitor::visit( __attribute__((unused)) Constant *constant ) {} 501 493 // Local Variables: // 502 494 // tab-width: 4 // -
src/SynTree/Visitor.h
r3f7e12cb r78315272 25 25 public: 26 26 // visit: Default implementation of all functions visits the children 27 // of the given syntax node, but performs no other action.27 // of the given syntax node, but performs no other action. 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 ); 119 120 virtual void visit( Attribute * attribute ); 118 virtual void visit( Constant *constant ); 121 119 private: 122 120 virtual void handleAggregateDecl( AggregateDecl *aggregateDecl ); -
src/SynTree/VoidType.cc
r3f7e12cb r78315272 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, Indenterindent ) const {26 void VoidType::print( std::ostream &os, int indent ) const { 27 27 Type::print( os, indent ); 28 28 os << "void "; -
src/SynTree/ZeroOneType.cc
r3f7e12cb r78315272 25 25 ZeroType::ZeroType( Type::Qualifiers tq, const std::list< Attribute * > & attributes ) : Type( tq, attributes ) {} 26 26 27 void ZeroType::print( std::ostream &os, Indenter) const {27 void ZeroType::print( std::ostream &os, __attribute__((unused)) int indent ) 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, Indenter) const {35 void OneType::print( std::ostream &os, __attribute__((unused)) int indent ) const { 36 36 os << "one_t"; 37 37 } -
src/SynTree/module.mk
r3f7e12cb r78315272 48 48 SynTree/Visitor.cc \ 49 49 SynTree/Mutator.cc \ 50 SynTree/AddStmtVisitor.cc \ 50 51 SynTree/TypeSubstitution.cc \ 51 52 SynTree/Attribute.cc \ -
src/Tuples/TupleAssignment.cc
r3f7e12cb r78315272 95 95 bool isTuple( Expression *expr ) { 96 96 if ( ! expr ) return false; 97 assert( expr-> result);97 assert( expr->has_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-> result&& ! expr->get_result()->isVoid() );287 assert( expr->has_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; )298 297 return ret; 299 298 } -
src/Tuples/TupleExpansion.cc
r3f7e12cb r78315272 21 21 #include "Common/ScopedMap.h" // for ScopedMap 22 22 #include "Common/utility.h" // for CodeLocation 23 #include "GenPoly/DeclMutator.h" // for DeclMutator 23 24 #include "InitTweak/InitTweak.h" // for getFunction 24 25 #include "Parser/LinkageSpec.h" // for Spec, C, Intrinsic … … 204 205 decl->set_body( true ); 205 206 for ( size_t i = 0; i < tupleSize; ++i ) { 206 TypeDecl * tyParam = new TypeDecl( toString( "tuple_param_", tupleSize, "_", i ), Type::StorageClasses(), nullptr, TypeDecl:: Dtype, true);207 TypeDecl * tyParam = new TypeDecl( toString( "tuple_param_", tupleSize, "_", i ), Type::StorageClasses(), nullptr, TypeDecl::Any ); 207 208 decl->get_members().push_back( new ObjectDecl( toString("field_", i ), Type::StorageClasses(), LinkageSpec::C, nullptr, new TypeInstType( Type::Qualifiers(), tyParam->get_name(), tyParam ), nullptr ) ); 208 209 decl->get_parameters().push_back( tyParam ); -
src/benchmark/Makefile.am
r3f7e12cb r78315272 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}repeat23 STATS = ${TOOLSDIR}stat.py24 repeats = 3025 21 26 .NOTPARALLEL: 27 28 noinst_PROGRAMS = 29 30 all : ctxswitch$(EXEEXT) mutex$(EXEEXT) signal$(EXEEXT) waitfor$(EXEEXT) creation$(EXEEXT) 22 noinst_PROGRAMS = bench$(EXEEXT) ctxswitch-coroutine$(EXEEXT) ctxswitch-thread$(EXEEXT) sched-int$(EXEEXT) monitor$(EXEEXT) csv-data$(EXEEXT) 31 23 32 24 bench$(EXEEXT) : … … 38 30 rm -f ./a.out ; 39 31 32 ctxswitch-coroutine$(EXEEXT): 33 ${CC} ${AM_CFLAGS} ${CFLAGS} ${ccflags} @CFA_FLAGS@ -nodebug -lrt -DN=50000000 CorCtxSwitch.c 34 @rm -f .result.log 35 @for number in 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20; do \ 36 ./a.out | tee -a .result.log ; \ 37 done 38 @./stat.py .result.log 39 @rm -f a.out .result.log 40 41 ctxswitch-thread$(EXEEXT): 42 ${CC} ${AM_CFLAGS} ${CFLAGS} ${ccflags} @CFA_FLAGS@ -nodebug -lrt -DN=50000000 ThrdCtxSwitch.c 43 @rm -f .result.log 44 @for number in 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20; do \ 45 ./a.out | tee -a .result.log ; \ 46 done 47 @./stat.py .result.log 48 @rm -f a.out .result.log 49 50 sched-int$(EXEEXT): 51 ${CC} ${AM_CFLAGS} ${CFLAGS} ${ccflags} @CFA_FLAGS@ -nodebug -lrt -DN=50000000 SchedInt.c 52 @rm -f .result.log 53 @for number in 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20; do \ 54 ./a.out | tee -a .result.log ; \ 55 done 56 @./stat.py .result.log 57 @rm -f a.out .result.log 58 59 monitor$(EXEEXT): 60 ${CC} ${AM_CFLAGS} ${CFLAGS} ${ccflags} @CFA_FLAGS@ -nodebug -lrt -DN=50000000 Monitor.c 61 @rm -f .result.log 62 @for number in 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20; do \ 63 ./a.out | tee -a .result.log ; \ 64 done 65 @./stat.py .result.log 66 @rm -f a.out .result.log 67 40 68 csv-data$(EXEEXT): 41 69 @${CC} ${AM_CFLAGS} ${CFLAGS} ${ccflags} @CFA_FLAGS@ -nodebug -lrt -quiet -DN=50000000 csv-data.c 42 70 @./a.out 43 71 @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.run52 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.run76 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.run101 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.run120 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.run140 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.log160 @echo "------------------------------------------------------"161 @echo $<162 @${REPEAT} ${repeats} ./a.out | tee -a .result.log163 @${STATS} .result.log164 @echo "------------------------------------------------------"165 @rm -f a.out .result.log166 167 ${REPEAT} :168 @+make -C ${TOOLSDIR} repeat -
src/benchmark/Makefile.in
r3f7e12cb r78315272 92 92 build_triplet = @build@ 93 93 host_triplet = @host@ 94 noinst_PROGRAMS =95 94 subdir = src/benchmark 96 95 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 … … 104 103 CONFIG_CLEAN_VPATH_FILES = 105 104 PROGRAMS = $(noinst_PROGRAMS) 105 bench_SOURCES = bench.c 106 bench_OBJECTS = bench.$(OBJEXT) 107 bench_LDADD = $(LDADD) 108 csv_data_SOURCES = csv-data.c 109 csv_data_OBJECTS = csv-data.$(OBJEXT) 110 csv_data_LDADD = $(LDADD) 111 ctxswitch_coroutine_SOURCES = ctxswitch-coroutine.c 112 ctxswitch_coroutine_OBJECTS = ctxswitch-coroutine.$(OBJEXT) 113 ctxswitch_coroutine_LDADD = $(LDADD) 114 ctxswitch_thread_SOURCES = ctxswitch-thread.c 115 ctxswitch_thread_OBJECTS = ctxswitch-thread.$(OBJEXT) 116 ctxswitch_thread_LDADD = $(LDADD) 117 monitor_SOURCES = monitor.c 118 monitor_OBJECTS = monitor.$(OBJEXT) 119 monitor_LDADD = $(LDADD) 120 sched_int_SOURCES = sched-int.c 121 sched_int_OBJECTS = sched-int.$(OBJEXT) 122 sched_int_LDADD = $(LDADD) 106 123 AM_V_P = $(am__v_P_@AM_V@) 107 124 am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) … … 116 133 am__v_at_0 = @ 117 134 am__v_at_1 = 118 SOURCES = 119 DIST_SOURCES = 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 120 155 am__can_run_installinfo = \ 121 156 case $$AM_UPDATE_INFO_DIR in \ … … 124 159 esac 125 160 am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) 126 am__DIST_COMMON = $(srcdir)/Makefile.in 161 # Read a list of newline-separated strings from the standard input, 162 # and print each of them once, without duplicates. Input order is 163 # *not* preserved. 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 127 180 DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) 128 181 ACLOCAL = @ACLOCAL@ … … 249 302 top_srcdir = @top_srcdir@ 250 303 AM_CFLAGS = -g -Wall -Wno-unused-function -O2 251 TOOLSDIR = ${abs_top_srcdir}/tools/ 252 REPEAT = ${TOOLSDIR}repeat 253 STATS = ${TOOLSDIR}stat.py 254 repeats = 30 304 noinst_PROGRAMS = bench$(EXEEXT) ctxswitch-coroutine$(EXEEXT) ctxswitch-thread$(EXEEXT) sched-int$(EXEEXT) monitor$(EXEEXT) csv-data$(EXEEXT) 255 305 all: all-am 256 306 257 307 .SUFFIXES: 308 .SUFFIXES: .c .o .obj 258 309 $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) 259 310 @for dep in $?; do \ … … 288 339 clean-noinstPROGRAMS: 289 340 -test -z "$(noinst_PROGRAMS)" || rm -f $(noinst_PROGRAMS) 290 tags TAGS: 291 292 ctags CTAGS: 293 294 cscope cscopelist: 295 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 296 422 297 423 distdir: $(DISTFILES) … … 364 490 365 491 distclean: distclean-am 492 -rm -rf ./$(DEPDIR) 366 493 -rm -f Makefile 367 distclean-am: clean-am distclean-generic 494 distclean-am: clean-am distclean-compile distclean-generic \ 495 distclean-tags 368 496 369 497 dvi: dvi-am … … 408 536 409 537 maintainer-clean: maintainer-clean-am 538 -rm -rf ./$(DEPDIR) 410 539 -rm -f Makefile 411 540 maintainer-clean-am: distclean-am maintainer-clean-generic … … 413 542 mostlyclean: mostlyclean-am 414 543 415 mostlyclean-am: mostlyclean- generic544 mostlyclean-am: mostlyclean-compile mostlyclean-generic 416 545 417 546 pdf: pdf-am … … 427 556 .MAKE: install-am install-strip 428 557 429 .PHONY: all all-am check check-am clean clean-generic \ 430 clean-noinstPROGRAMS cscopelist-am ctags-am distclean \ 431 distclean-generic distdir dvi dvi-am html html-am info info-am \ 432 install install-am install-data install-data-am install-dvi \ 433 install-dvi-am install-exec install-exec-am install-html \ 434 install-html-am install-info install-info-am install-man \ 435 install-pdf install-pdf-am install-ps install-ps-am \ 436 install-strip installcheck installcheck-am installdirs \ 437 maintainer-clean maintainer-clean-generic mostlyclean \ 438 mostlyclean-generic pdf pdf-am ps ps-am tags-am uninstall \ 558 .PHONY: CTAGS GTAGS TAGS all all-am check check-am clean clean-generic \ 559 clean-noinstPROGRAMS cscopelist-am ctags ctags-am distclean \ 560 distclean-compile distclean-generic distclean-tags distdir dvi \ 561 dvi-am html html-am info info-am install install-am \ 562 install-data install-data-am install-dvi install-dvi-am \ 563 install-exec install-exec-am install-html install-html-am \ 564 install-info install-info-am install-man install-pdf \ 565 install-pdf-am install-ps install-ps-am install-strip \ 566 installcheck installcheck-am installdirs maintainer-clean \ 567 maintainer-clean-generic mostlyclean mostlyclean-compile \ 568 mostlyclean-generic pdf pdf-am ps ps-am tags tags-am uninstall \ 439 569 uninstall-am 440 570 441 571 .PRECIOUS: Makefile 442 572 443 444 .NOTPARALLEL:445 446 all : ctxswitch$(EXEEXT) mutex$(EXEEXT) signal$(EXEEXT) waitfor$(EXEEXT) creation$(EXEEXT)447 573 448 574 bench$(EXEEXT) : … … 454 580 rm -f ./a.out ; 455 581 582 ctxswitch-coroutine$(EXEEXT): 583 ${CC} ${AM_CFLAGS} ${CFLAGS} ${ccflags} @CFA_FLAGS@ -nodebug -lrt -DN=50000000 CorCtxSwitch.c 584 @rm -f .result.log 585 @for number in 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20; do \ 586 ./a.out | tee -a .result.log ; \ 587 done 588 @./stat.py .result.log 589 @rm -f a.out .result.log 590 591 ctxswitch-thread$(EXEEXT): 592 ${CC} ${AM_CFLAGS} ${CFLAGS} ${ccflags} @CFA_FLAGS@ -nodebug -lrt -DN=50000000 ThrdCtxSwitch.c 593 @rm -f .result.log 594 @for number in 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20; do \ 595 ./a.out | tee -a .result.log ; \ 596 done 597 @./stat.py .result.log 598 @rm -f a.out .result.log 599 600 sched-int$(EXEEXT): 601 ${CC} ${AM_CFLAGS} ${CFLAGS} ${ccflags} @CFA_FLAGS@ -nodebug -lrt -DN=50000000 SchedInt.c 602 @rm -f .result.log 603 @for number in 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20; do \ 604 ./a.out | tee -a .result.log ; \ 605 done 606 @./stat.py .result.log 607 @rm -f a.out .result.log 608 609 monitor$(EXEEXT): 610 ${CC} ${AM_CFLAGS} ${CFLAGS} ${ccflags} @CFA_FLAGS@ -nodebug -lrt -DN=50000000 Monitor.c 611 @rm -f .result.log 612 @for number in 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20; do \ 613 ./a.out | tee -a .result.log ; \ 614 done 615 @./stat.py .result.log 616 @rm -f a.out .result.log 617 456 618 csv-data$(EXEEXT): 457 619 @${CC} ${AM_CFLAGS} ${CFLAGS} ${ccflags} @CFA_FLAGS@ -nodebug -lrt -quiet -DN=50000000 csv-data.c … … 459 621 @rm -f ./a.out 460 622 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.run467 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.run490 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.run514 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.run532 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.run551 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.log569 @echo "------------------------------------------------------"570 @echo $<571 @${REPEAT} ${repeats} ./a.out | tee -a .result.log572 @${STATS} .result.log573 @echo "------------------------------------------------------"574 @rm -f a.out .result.log575 576 ${REPEAT} :577 @+make -C ${TOOLSDIR} repeat578 579 623 # Tell versions [3.59,3.63) of GNU make to not export all variables. 580 624 # Otherwise a system limit (for SysV at least) may be exceeded. -
src/benchmark/bench.h
r3f7e12cb r78315272 1 1 #pragma once 2 2 3 #if defined(__CFORALL__)4 3 extern "C" { 5 #endif6 #include <stdlib.h>7 4 #include <unistd.h> // sysconf 8 5 #include <sys/times.h> // times 9 6 #include <time.h> 10 #if defined(__CFORALL__)11 7 } 12 #endif13 8 14 staticinline unsigned long long int Time() {15 structtimespec ts;9 inline unsigned long long int Time() { 10 timespec ts; 16 11 clock_gettime( 17 12 #if defined( __linux__ ) … … 28 23 } // Time 29 24 30 #ifndef BENCH_N31 #define BENCH_N 500 //1000000025 #ifndef N 26 #define N 10000000 32 27 #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;46 28 47 29 unsigned int default_preemption() { -
src/benchmark/csv-data.c
r3f7e12cb r78315272 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
r3f7e12cb r78315272 9 9 // Author : Peter A. Buhr 10 10 // Created On : Tue Aug 20 13:44:49 2002 11 // Last Modified By : Peter A. Buhr12 // Last Modified On : T ue Oct 31 11:40:44201713 // Update Count : 1 6011 // Last Modified By : Andrew Beach 12 // Last Modified On : Thr Aug 17 15:24:00 2017 13 // Update Count : 156 14 14 // 15 15 … … 305 305 } // if 306 306 307 shuffle( args, sargs, nargs, 1 ); // make room at front of argument list308 nargs += 1;309 307 if ( CFA_flag ) { 310 args[sargs] = "-D__CFA_FLAG__=-N";311 308 args[nargs] = "-D__CFA_PREPROCESS_"; 312 309 nargs += 1; 313 } else { 314 args[sargs] = "-D__CFA_FLAG__=-L"; 315 } // if 316 sargs += 1; 310 } // if 317 311 318 312 if ( debug ) { … … 351 345 } // if 352 346 args[nargs] = "-fgnu89-inline"; 353 nargs += 1;354 args[nargs] = "-D__int8_t_defined"; // prevent gcc type-size attributes355 347 nargs += 1; 356 348 args[nargs] = ( *new string( string("-B") + Bprefix + "/" ) ).c_str(); -
src/include/cassert
r3f7e12cb r78315272 41 41 static inline T strict_dynamic_cast( const U & src ) { 42 42 T ret = dynamic_cast<T>(src); 43 assert f(ret, "%s", toString(src).c_str());43 assert(ret); 44 44 return ret; 45 45 } -
src/libcfa/Makefile.am
r3f7e12cb r78315272 31 31 32 32 libcfa_a-libcfa-prelude.o : libcfa-prelude.c 33 ${AM_V_GEN}@BACKEND_CC@ @CFA_FLAGS@ - Wall -O2 -c -o $@ $<33 ${AM_V_GEN}@BACKEND_CC@ @CFA_FLAGS@ -O2 -c -o $@ $< 34 34 35 35 libcfa_d_a-libcfa-prelude.o : libcfa-prelude.c 36 ${AM_V_GEN}@BACKEND_CC@ @CFA_FLAGS@ -D__CFA_DEBUG__ - Wall -O0 -c -o $@ $<36 ${AM_V_GEN}@BACKEND_CC@ @CFA_FLAGS@ -D__CFA_DEBUG__ -O0 -c -o $@ $< 37 37 38 EXTRA_FLAGS = -g -Wall -W no-unused-function -imacros libcfa-prelude.c @CFA_FLAGS@38 EXTRA_FLAGS = -g -Wall -Werror -Wno-unused-function -imacros libcfa-prelude.c @CFA_FLAGS@ 39 39 40 40 AM_CCASFLAGS = @CFA_FLAGS@ -
src/libcfa/Makefile.in
r3f7e12cb r78315272 416 416 ARFLAGS = cr 417 417 lib_LIBRARIES = $(am__append_1) $(am__append_2) 418 EXTRA_FLAGS = -g -Wall -W no-unused-function -imacros libcfa-prelude.c @CFA_FLAGS@418 EXTRA_FLAGS = -g -Wall -Werror -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@ - Wall -O2 -c -o $@ $<1500 ${AM_V_GEN}@BACKEND_CC@ @CFA_FLAGS@ -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__ - Wall -O0 -c -o $@ $<1503 ${AM_V_GEN}@BACKEND_CC@ @CFA_FLAGS@ -D__CFA_DEBUG__ -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
r3f7e12cb r78315272 123 123 if(pageSize == 0ul) pageSize = sysconf( _SC_PAGESIZE ); 124 124 125 LIB_DEBUG_PRINT_SAFE("FRED"); 126 125 127 size_t cxtSize = libCeiling( sizeof(machine_context_t), 8 ); // minimum alignment 126 128 … … 156 158 this->limit = (char *)libCeiling( (unsigned long)this->storage, 16 ); // minimum alignment 157 159 } // if 158 assertf( this->size >= MinStackSize, "Stack size % zd provides less than minimum of %d bytes for a stack.", this->size, MinStackSize );160 assertf( this->size >= MinStackSize, "Stack size %d provides less than minimum of %d bytes for a stack.", this->size, MinStackSize ); 159 161 160 162 this->base = (char *)this->limit + this->size; -
src/libcfa/concurrency/invoke.h
r3f7e12cb r78315272 25 25 #define _INVOKE_H_ 26 26 27 #define unlikely(x) __builtin_expect(!!(x), 0)28 #define thread_local _Thread_local27 #define unlikely(x) __builtin_expect(!!(x), 0) 28 #define thread_local _Thread_local 29 29 30 typedef void (*fptr_t)(); 31 typedef int_fast16_t __lock_size_t; 30 typedef void (*fptr_t)(); 32 31 33 struct spinlock {34 volatile int lock;35 #ifdef __CFA_DEBUG__36 const char * prev_name;37 void* prev_thrd;38 #endif39 };32 struct spinlock { 33 volatile int lock; 34 #ifdef __CFA_DEBUG__ 35 const char * prev_name; 36 void* prev_thrd; 37 #endif 38 }; 40 39 41 struct __thread_queue_t {42 struct thread_desc * head;43 struct thread_desc ** tail;44 };40 struct __thread_queue_t { 41 struct thread_desc * head; 42 struct thread_desc ** tail; 43 }; 45 44 46 struct __condition_stack_t {47 struct __condition_criterion_t * top;48 };45 struct __condition_stack_t { 46 struct __condition_criterion_t * top; 47 }; 49 48 50 #ifdef __CFORALL__51 extern "Cforall" {52 void ?{}( struct __thread_queue_t & );53 void append( struct __thread_queue_t &, struct thread_desc * );54 struct thread_desc * pop_head( struct __thread_queue_t &);55 struct thread_desc * remove( struct __thread_queue_t &, struct thread_desc ** );49 #ifdef __CFORALL__ 50 extern "Cforall" { 51 void ?{}( struct __thread_queue_t & ); 52 void append( struct __thread_queue_t *, struct thread_desc * ); 53 struct thread_desc * pop_head( struct __thread_queue_t * ); 54 struct thread_desc * remove( struct __thread_queue_t *, struct thread_desc ** ); 56 55 57 void ?{}( struct __condition_stack_t & );58 void push( struct __condition_stack_t &, struct __condition_criterion_t * );59 struct __condition_criterion_t * pop( struct __condition_stack_t &);56 void ?{}( struct __condition_stack_t & ); 57 void push( struct __condition_stack_t *, struct __condition_criterion_t * ); 58 struct __condition_criterion_t * pop( struct __condition_stack_t * ); 60 59 61 void?{}(spinlock & this);62 void ^?{}(spinlock & this);63 }64 #endif60 void ?{}(spinlock & this); 61 void ^?{}(spinlock & this); 62 } 63 #endif 65 64 66 struct coStack_t { 67 // size of stack 68 size_t size; 65 struct coStack_t { 66 unsigned int size; // size of stack 67 void *storage; // pointer to stack 68 void *limit; // stack grows towards stack limit 69 void *base; // base of stack 70 void *context; // address of cfa_context_t 71 void *top; // address of top of storage 72 bool userStack; // whether or not the user allocated the stack 73 }; 69 74 70 // pointer to stack 71 void *storage; 75 enum coroutine_state { Halted, Start, Inactive, Active, Primed }; 72 76 73 // stack grows towards stack limit 74 void *limit; 77 struct coroutine_desc { 78 struct coStack_t stack; // stack information of the coroutine 79 const char *name; // textual name for coroutine/task, initialized by uC++ generated code 80 int errno_; // copy of global UNIX variable errno 81 enum coroutine_state state; // current execution status for coroutine 82 struct coroutine_desc * starter; // first coroutine to resume this one 83 struct coroutine_desc * last; // last coroutine to resume this one 84 }; 75 85 76 // base of stack 77 void *base; 86 struct monitor_desc { 87 struct spinlock lock; // spinlock to protect internal data 88 struct thread_desc * owner; // current owner of the monitor 89 struct __thread_queue_t entry_queue; // queue of threads that are blocked waiting for the monitor 90 struct __condition_stack_t signal_stack; // stack of conditions to run next once we exit the monitor 91 unsigned int recursion; // monitor routines can be called recursively, we need to keep track of that 78 92 79 // address of cfa_context_t 80 void *context; 93 struct __acceptable_t * acceptables; // list of acceptable functions, null if any 94 unsigned short acceptable_count; // number of acceptable functions 95 short accepted_index; // the index of the accepted function, -1 if none 96 }; 81 97 82 // address of top of storage 83 void *top; 98 struct thread_desc { 99 // Core threading fields 100 struct coroutine_desc cor; // coroutine body used to store context 101 struct monitor_desc mon; // monitor body used for mutual exclusion 84 102 85 // whether or not the user allocated the stack 86 bool userStack; 87 }; 103 // Link lists fields 104 struct thread_desc * next; // instrusive link field for threads 88 105 89 enum coroutine_state { Halted, Start, Inactive, Active, Primed }; 90 91 struct coroutine_desc { 92 // stack information of the coroutine 93 struct coStack_t stack; 94 95 // textual name for coroutine/task, initialized by uC++ generated code 96 const char *name; 97 98 // copy of global UNIX variable errno 99 int errno_; 100 101 // current execution status for coroutine 102 enum coroutine_state state; 103 104 // first coroutine to resume this one 105 struct coroutine_desc * starter; 106 107 // last coroutine to resume this one 108 struct coroutine_desc * last; 109 }; 110 111 struct __waitfor_mask_t { 112 // the index of the accepted function, -1 if none 113 short * accepted; 114 115 // list of acceptable functions, null if any 116 struct __acceptable_t * clauses; 117 118 // number of acceptable functions 119 __lock_size_t size; 120 }; 121 122 struct monitor_desc { 123 // spinlock to protect internal data 124 struct spinlock lock; 125 126 // current owner of the monitor 127 struct thread_desc * owner; 128 129 // queue of threads that are blocked waiting for the monitor 130 struct __thread_queue_t entry_queue; 131 132 // stack of conditions to run next once we exit the monitor 133 struct __condition_stack_t signal_stack; 134 135 // monitor routines can be called recursively, we need to keep track of that 136 unsigned int recursion; 137 138 // mask used to know if some thread is waiting for something while holding the monitor 139 struct __waitfor_mask_t mask; 140 141 // node used to signal the dtor in a waitfor dtor 142 struct __condition_node_t * dtor_node; 143 }; 144 145 struct __monitor_group_t { 146 // currently held monitors 147 struct monitor_desc ** list; 148 149 // number of currently held monitors 150 __lock_size_t size; 151 152 // last function that acquired monitors 153 fptr_t func; 154 }; 155 156 struct thread_desc { 157 // Core threading fields 158 // coroutine body used to store context 159 struct coroutine_desc self_cor; 160 161 // monitor body used for mutual exclusion 162 struct monitor_desc self_mon; 163 164 // pointer to monitor with sufficient lifetime for current monitors 165 struct monitor_desc * self_mon_p; 166 167 // monitors currently held by this thread 168 struct __monitor_group_t monitors; 169 170 // Link lists fields 171 // instrusive link field for threads 172 struct thread_desc * next; 106 // Current status related to monitors 107 struct monitor_desc ** current_monitors; // currently held monitors 108 unsigned short current_monitor_count; // number of currently held monitors 109 fptr_t current_monitor_func; // last function that acquired monitors 173 110 }; 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 match187 for( int i = 0; i < lhs.size; i++ ) {188 // If not a match, check next function189 if( lhs[i] != rhs[i] ) return false;190 }191 192 return true;193 }194 }195 #endif196 111 197 112 #endif //_INVOKE_H_ … … 200 115 #define _INVOKE_PRIVATE_H_ 201 116 202 struct machine_context_t {203 void *SP;204 void *FP;205 void *PC;206 };117 struct machine_context_t { 118 void *SP; 119 void *FP; 120 void *PC; 121 }; 207 122 208 // assembler routines that performs the context switch209 extern void CtxInvokeStub( void );210 void CtxSwitch( void * from, void * to ) asm ("CtxSwitch");123 // assembler routines that performs the context switch 124 extern void CtxInvokeStub( void ); 125 void CtxSwitch( void * from, void * to ) asm ("CtxSwitch"); 211 126 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 #endif127 #if defined( __x86_64__ ) 128 #define CtxGet( ctx ) __asm__ ( \ 129 "movq %%rsp,%0\n" \ 130 "movq %%rbp,%1\n" \ 131 : "=rm" (ctx.SP), "=rm" (ctx.FP) ) 132 #elif defined( __i386__ ) 133 #define CtxGet( ctx ) __asm__ ( \ 134 "movl %%esp,%0\n" \ 135 "movl %%ebp,%1\n" \ 136 : "=rm" (ctx.SP), "=rm" (ctx.FP) ) 137 #endif 223 138 224 139 #endif //_INVOKE_PRIVATE_H_ -
src/libcfa/concurrency/kernel
r3f7e12cb r78315272 26 26 //----------------------------------------------------------------------------- 27 27 // Locks 28 // Lock the spinlock, spin if already acquired 29 void lock ( spinlock * DEBUG_CTX_PARAM2 ); 30 31 // Lock the spinlock, yield repeatedly if already acquired 32 void lock_yield( spinlock * DEBUG_CTX_PARAM2 ); 33 34 // Lock the spinlock, return false if already acquired 35 bool try_lock ( spinlock * DEBUG_CTX_PARAM2 ); 36 37 // Unlock the spinlock 38 void unlock ( spinlock * ); 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 39 32 40 33 struct semaphore { … … 46 39 void ?{}(semaphore & this, int count = 1); 47 40 void ^?{}(semaphore & this); 48 void P (semaphore &this);49 void V (semaphore &this);41 void P(semaphore * this); 42 void V(semaphore * this); 50 43 51 44 … … 53 46 // Cluster 54 47 struct cluster { 55 // Ready queue locks 56 spinlock ready_queue_lock; 57 58 // Ready queue for threads 59 __thread_queue_t ready_queue; 60 61 // Preemption rate on this cluster 62 unsigned long long int preemption; 48 spinlock ready_queue_lock; // Ready queue locks 49 __thread_queue_t ready_queue; // Ready queue for threads 50 unsigned long long int preemption; // Preemption rate on this cluster 63 51 }; 64 52 65 void ?{} (cluster & this);53 void ?{}(cluster & this); 66 54 void ^?{}(cluster & this); 67 55 … … 91 79 struct processor { 92 80 // Main state 93 // Coroutine ctx who does keeps the state of the processor 94 struct processorCtx_t * runner; 95 96 // Cluster from which to get threads 97 cluster * cltr; 98 99 // Handle to pthreads 100 pthread_t kernel_thread; 81 struct processorCtx_t * runner; // Coroutine ctx who does keeps the state of the processor 82 cluster * cltr; // Cluster from which to get threads 83 pthread_t kernel_thread; // Handle to pthreads 101 84 102 85 // Termination 103 // Set to true to notify the processor should terminate 104 volatile bool do_terminate; 105 106 // Termination synchronisation 107 semaphore terminated; 86 volatile bool do_terminate; // Set to true to notify the processor should terminate 87 semaphore terminated; // Termination synchronisation 108 88 109 89 // RunThread data 110 // Action to do after a thread is ran 111 struct FinishAction finish; 90 struct FinishAction finish; // Action to do after a thread is ran 112 91 113 92 // Preemption data 114 // Node which is added in the discrete event simulaiton 115 struct alarm_node_t * preemption_alarm; 116 117 // If true, a preemption was triggered in an unsafe region, the processor must preempt as soon as possible 118 bool pending_preemption; 93 struct alarm_node_t * preemption_alarm; // Node which is added in the discrete event simulaiton 94 bool pending_preemption; // If true, a preemption was triggered in an unsafe region, the processor must preempt as soon as possible 119 95 120 96 #ifdef __CFA_DEBUG__ 121 // Last function to enable preemption on this processor 122 char * last_enable; 97 char * last_enable; // Last function to enable preemption on this processor 123 98 #endif 124 99 }; 125 100 126 void ?{}(processor & this);127 void ?{}(processor & this, cluster * cltr);101 void ?{}(processor & this); 102 void ?{}(processor & this, cluster * cltr); 128 103 void ^?{}(processor & this); 129 104 -
src/libcfa/concurrency/kernel.c
r3f7e12cb r78315272 106 106 107 107 void ?{}( thread_desc & this, current_stack_info_t * info) { 108 (this. self_cor){ info };108 (this.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-> self_cor.state != Halted );330 verify( thrd->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-> self_cor.state != Halted );375 assert( thrd->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-> self_cor;468 this_coroutine = &mainThread->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-> self_cor.name, thrd );550 __lib_debug_write( abort_text, len );549 int len = snprintf( abort_text, abort_text_size, "Error occurred while executing task %.256s (%p)", thrd->cor.name, thrd ); 550 __lib_debug_write( STDERR_FILENO, abort_text, len ); 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( abort_text, len );554 __lib_debug_write( STDERR_FILENO, abort_text, len ); 555 555 } 556 556 else { 557 __lib_debug_write( ".\n", 2 );557 __lib_debug_write( STDERR_FILENO, ".\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
r3f7e12cb r78315272 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
r3f7e12cb r78315272 10 10 // Created On : Thd Feb 23 12:27:26 2017 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Sat Oct 7 18:06:45201713 // Update Count : 1012 // Last Modified On : Sat Jul 22 09:59:01 2017 13 // Update Count : 3 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 29 24 static inline void ?{}(monitor_desc & this) { 30 25 (this.lock){}; 26 this.owner = NULL; 31 27 (this.entry_queue){}; 32 28 (this.signal_stack){}; 33 this.owner = NULL; 34 this.recursion = 0; 35 this.mask.accepted = NULL; 36 this.mask.clauses = NULL; 37 this.mask.size = 0; 38 this.dtor_node = NULL; 29 this.recursion = 0; 30 this.acceptables = NULL; 31 this.acceptable_count = 0; 32 this.accepted_index = -1; 39 33 } 40 34 41 35 struct monitor_guard_t { 42 36 monitor_desc ** m; 43 __lock_size_tcount;37 int count; 44 38 monitor_desc ** prev_mntrs; 45 __lock_size_tprev_count;39 unsigned short prev_count; 46 40 fptr_t prev_func; 47 41 }; 48 42 49 void ?{}( monitor_guard_t & this, monitor_desc ** m, __lock_size_t count, void (*func)() ); 43 static inline int ?<?(monitor_desc* lhs, monitor_desc* rhs) { 44 return ((intptr_t)lhs) < ((intptr_t)rhs); 45 } 46 47 void ?{}( monitor_guard_t & this, monitor_desc ** m, int count, void (*func)() ); 50 48 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 );66 }67 49 68 50 //----------------------------------------------------------------------------- … … 70 52 71 53 struct __condition_criterion_t { 72 // Whether or not the criterion is met (True if met) 73 bool ready; 74 75 // The monitor this criterion concerns 76 monitor_desc * target; 77 78 // The parent node to which this criterion belongs 79 struct __condition_node_t * owner; 80 81 // Intrusive linked list Next field 82 __condition_criterion_t * next; 54 bool ready; //Whether or not the criterion is met (True if met) 55 monitor_desc * target; //The monitor this criterion concerns 56 struct __condition_node_t * owner; //The parent node to which this criterion belongs 57 __condition_criterion_t * next; //Intrusive linked list Next field 83 58 }; 84 59 85 60 struct __condition_node_t { 86 // Thread that needs to be woken when all criteria are met 87 thread_desc * waiting_thread; 88 89 // Array of criteria (Criterions are contiguous in memory) 90 __condition_criterion_t * criteria; 91 92 // Number of criterions in the criteria 93 __lock_size_t count; 94 95 // Intrusive linked list Next field 96 __condition_node_t * next; 97 98 // Custom user info accessible before signalling 99 uintptr_t user_info; 61 thread_desc * waiting_thread; //Thread that needs to be woken when all criteria are met 62 __condition_criterion_t * criteria; //Array of criteria (Criterions are contiguous in memory) 63 unsigned short count; //Number of criterions in the criteria 64 __condition_node_t * next; //Intrusive linked list Next field 65 uintptr_t user_info; //Custom user info accessible before signalling 100 66 }; 101 67 … … 105 71 }; 106 72 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 111 73 void ?{}( __condition_blocked_queue_t & ); 112 void append( __condition_blocked_queue_t &, __condition_node_t * );113 __condition_node_t * pop_head( __condition_blocked_queue_t &);74 void append( __condition_blocked_queue_t *, __condition_node_t * ); 75 __condition_node_t * pop_head( __condition_blocked_queue_t * ); 114 76 115 77 struct condition { 116 // Link list which contains the blocked threads as-well as the information needed to unblock them 117 __condition_blocked_queue_t blocked; 118 119 // Array of monitor pointers (Monitors are NOT contiguous in memory) 120 monitor_desc ** monitors; 121 122 // Number of monitors in the array 123 __lock_size_t monitor_count; 78 __condition_blocked_queue_t blocked; //Link list which contains the blocked threads as-well as the information needed to unblock them 79 monitor_desc ** monitors; //Array of monitor pointers (Monitors are NOT contiguous in memory) 80 unsigned short monitor_count; //Number of monitors in the array 124 81 }; 125 82 … … 133 90 } 134 91 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 );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 ); 140 97 141 98 //----------------------------------------------------------------------------- … … 143 100 144 101 struct __acceptable_t { 145 __monitor_group_t; 102 fptr_t func; 103 unsigned short count; 104 monitor_desc ** monitors; 146 105 bool is_dtor; 147 106 }; 148 107 149 void __waitfor_internal( const __waitfor_mask_t & mask, int duration);108 int __accept_internal( unsigned short count, __acceptable_t * acceptables ); 150 109 151 110 // Local Variables: // -
src/libcfa/concurrency/monitor.c
r3f7e12cb r78315272 17 17 18 18 #include <stdlib> 19 #include <inttypes.h>20 19 21 20 #include "libhdr.h" 22 21 #include "kernel_private.h" 23 22 24 #include "bits/algorithms.h"25 26 23 //----------------------------------------------------------------------------- 27 24 // Forward declarations 28 static inline void set_owner ( monitor_desc * this, thread_desc * owner ); 29 static inline void set_owner ( monitor_desc * storage [], __lock_size_t count, thread_desc * owner ); 30 static inline void set_mask ( monitor_desc * storage [], __lock_size_t count, const __waitfor_mask_t & mask ); 31 static inline void reset_mask( monitor_desc * this ); 32 25 static inline void set_owner( monitor_desc * this, thread_desc * owner ); 33 26 static inline thread_desc * next_thread( monitor_desc * this ); 34 static inline bool is_accepted( monitor_desc * this, const __monitor_group_t & monitors ); 35 36 static inline void lock_all ( spinlock * locks [], __lock_size_t count ); 37 static inline void lock_all ( monitor_desc * source [], spinlock * /*out*/ locks [], __lock_size_t count ); 38 static inline void unlock_all( spinlock * locks [], __lock_size_t count ); 39 static inline void unlock_all( monitor_desc * locks [], __lock_size_t count ); 40 41 static inline void save ( monitor_desc * ctx [], __lock_size_t count, spinlock * locks [], unsigned int /*out*/ recursions [], __waitfor_mask_t /*out*/ masks [] ); 42 static inline void restore( monitor_desc * ctx [], __lock_size_t count, spinlock * locks [], unsigned int /*in */ recursions [], __waitfor_mask_t /*in */ masks [] ); 43 44 static inline void init ( __lock_size_t count, monitor_desc * monitors [], __condition_node_t & waiter, __condition_criterion_t criteria [] ); 45 static inline void init_push( __lock_size_t count, monitor_desc * monitors [], __condition_node_t & waiter, __condition_criterion_t criteria [] ); 46 47 static inline thread_desc * check_condition ( __condition_criterion_t * ); 48 static inline void brand_condition ( condition & ); 49 static inline [thread_desc *, int] search_entry_queue( const __waitfor_mask_t &, monitor_desc * monitors [], __lock_size_t count ); 50 51 forall(dtype T | sized( T )) 52 static inline __lock_size_t insert_unique( T * array [], __lock_size_t & size, T * val ); 53 static inline __lock_size_t count_max ( const __waitfor_mask_t & mask ); 54 static inline __lock_size_t aggregate ( monitor_desc * storage [], const __waitfor_mask_t & mask ); 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 ); 55 45 56 46 //----------------------------------------------------------------------------- 57 47 // Useful defines 58 #define wait_ctx(thrd, user_info) /* Create the necessary information to use the signaller stack */ \ 59 __condition_node_t waiter = { thrd, count, user_info }; /* Create the node specific to this wait operation */ \ 60 __condition_criterion_t criteria[count]; /* Create the creteria this wait operation needs to wake up */ \ 61 init( count, monitors, waiter, criteria ); /* Link everything together */ \ 62 63 #define wait_ctx_primed(thrd, user_info) /* Create the necessary information to use the signaller stack */ \ 64 __condition_node_t waiter = { thrd, count, user_info }; /* Create the node specific to this wait operation */ \ 65 __condition_criterion_t criteria[count]; /* Create the creteria this wait operation needs to wake up */ \ 66 init_push( count, monitors, waiter, criteria ); /* Link everything together and push it to the AS-Stack */ \ 67 68 #define monitor_ctx( mons, cnt ) /* Define that create the necessary struct for internal/external scheduling operations */ \ 69 monitor_desc ** monitors = mons; /* Save the targeted monitors */ \ 70 __lock_size_t count = cnt; /* Save the count to a local variable */ \ 71 unsigned int recursions[ count ]; /* Save the current recursion levels to restore them later */ \ 72 __waitfor_mask_t masks [ count ]; /* Save the current waitfor masks to restore them later */ \ 73 spinlock * locks [ count ]; /* We need to pass-in an array of locks to BlockInternal */ \ 74 75 #define monitor_save save ( monitors, count, locks, recursions, masks ) 76 #define monitor_restore restore( monitors, count, locks, recursions, masks ) 77 48 #define wait_ctx(thrd, user_info) /* Create the necessary information to use the signaller stack */ \ 49 __condition_node_t waiter = { thrd, count, user_info }; /* Create the node specific to this wait operation */ \ 50 __condition_criterion_t criteria[count]; /* Create the creteria this wait operation needs to wake up */ \ 51 init( count, monitors, &waiter, criteria ); /* Link everything together */ \ 52 53 #define wait_ctx_primed(thrd, user_info) /* Create the necessary information to use the signaller stack */ \ 54 __condition_node_t waiter = { thrd, count, user_info }; /* Create the node specific to this wait operation */ \ 55 __condition_criterion_t criteria[count]; /* Create the creteria this wait operation needs to wake up */ \ 56 init_push( count, monitors, &waiter, criteria ); /* Link everything together and push it to the AS-Stack */ \ 57 58 #define monitor_ctx( mons, cnt ) /* Define that create the necessary struct for internal/external scheduling operations */ \ 59 monitor_desc ** monitors = mons; /* Save the targeted monitors */ \ 60 unsigned short count = cnt; /* Save the count to a local variable */ \ 61 unsigned int recursions[ count ]; /* Save the current recursion levels to restore them later */ \ 62 spinlock * locks [ count ]; /* We need to pass-in an array of locks to BlockInternal */ \ 78 63 79 64 //----------------------------------------------------------------------------- … … 83 68 extern "C" { 84 69 // Enter single monitor 85 static void __enter_monitor_desc( monitor_desc * this, const __monitor_group_t & group) {70 static void __enter_monitor_desc( monitor_desc * this, monitor_desc ** group, int group_cnt, void (*func)() ) { 86 71 // Lock the monitor spinlock, lock_yield to reduce contention 87 72 lock_yield( &this->lock DEBUG_CTX2 ); … … 90 75 LIB_DEBUG_PRINT_SAFE("Kernel : %10p Entering mon %p (%p)\n", thrd, this, this->owner); 91 76 77 this->accepted_index = -1; 92 78 if( !this->owner ) { 93 79 // No one has the monitor, just take it … … 97 83 } 98 84 else if( this->owner == thrd) { 99 // We already have the monitor, just note how many times we took it 85 // We already have the monitor, just not how many times we took it 86 verify( this->recursion > 0 ); 100 87 this->recursion += 1; 101 88 102 89 LIB_DEBUG_PRINT_SAFE("Kernel : mon already owned \n"); 103 90 } 104 else if( is_accepted( this, group)) {91 else if( (this->accepted_index = is_accepted( thrd, this, group, group_cnt, func)) >= 0 ) { 105 92 // Some one was waiting for us, enter 106 93 set_owner( this, thrd ); 107 94 108 // Reset mask109 reset_mask( this );110 111 95 LIB_DEBUG_PRINT_SAFE("Kernel : mon accepts \n"); 112 96 } … … 115 99 116 100 // Some one else has the monitor, wait in line for it 117 append( this->entry_queue, thrd );101 append( &this->entry_queue, thrd ); 118 102 BlockInternal( &this->lock ); 119 103 … … 129 113 unlock( &this->lock ); 130 114 return; 131 }132 133 static void __enter_monitor_dtor( monitor_desc * this, fptr_t func ) {134 // Lock the monitor spinlock, lock_yield to reduce contention135 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 it145 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 fail152 // 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 this163 __condition_criterion_t * urgent = pop( this->signal_stack );164 verify( urgent );165 166 // Reset mask167 reset_mask( this );168 169 // Create the node specific to this wait operation170 wait_ctx_primed( this_thread, 0 )171 172 // Some one else has the monitor, wait for him to finish and then run173 BlockInternal( &this->lock, urgent->owner->waiting_thread );174 175 // Some one was waiting for us, enter176 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 it185 append( this->entry_queue, thrd );186 BlockInternal( &this->lock );187 188 // BlockInternal will unlock spinlock, no need to unlock ourselves189 return;190 }191 192 LIB_DEBUG_PRINT_SAFE("Kernel : Destroying %p\n", this);193 194 115 } 195 116 … … 199 120 lock_yield( &this->lock DEBUG_CTX2 ); 200 121 201 LIB_DEBUG_PRINT_SAFE("Kernel : %10p Leaving mon %p (%p)\n", this_thread, this, this->owner); 202 203 verifyf( this_thread == this->owner, "Expected owner to be %p, got %p (r: %i, m: %p)", this_thread, this->owner, this->recursion, this ); 122 verifyf( this_thread == this->owner, "Expected owner to be %p, got %p (r: %i)", this_thread, this->owner, this->recursion ); 204 123 205 124 // Leaving a recursion level, decrement the counter … … 209 128 // it means we don't need to do anything 210 129 if( this->recursion != 0) { 211 LIB_DEBUG_PRINT_SAFE("Kernel : recursion still %d\n", this->recursion);212 130 unlock( &this->lock ); 213 131 return; … … 222 140 //We need to wake-up the thread 223 141 WakeThread( new_owner ); 224 }225 226 // Leave single monitor for the last time227 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 )236 142 } 237 143 … … 240 146 // Should never return 241 147 void __leave_thread_monitor( thread_desc * thrd ) { 242 monitor_desc * this = &thrd-> self_mon;148 monitor_desc * this = &thrd->mon; 243 149 244 150 // Lock the monitor now … … 247 153 disable_interrupts(); 248 154 249 thrd-> self_cor.state = Halted;250 251 verifyf( thrd == this->owner, "Expected owner to be %p, got %p (r: %i , m: %p)", thrd, this->owner, this->recursion, this);155 thrd->cor.state = Halted; 156 157 verifyf( thrd == this->owner, "Expected owner to be %p, got %p (r: %i)", thrd, this->owner, this->recursion ); 252 158 253 159 // Leaving a recursion level, decrement the counter … … 272 178 // Enter multiple monitor 273 179 // relies on the monitor array being sorted 274 static inline void enter( __monitor_group_t monitors) {275 for( __lock_size_t i = 0; i < monitors.size; i++) {276 __enter_monitor_desc( monitors .list[i], monitors);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 ); 277 183 } 278 184 } … … 280 186 // Leave multiple monitor 281 187 // relies on the monitor array being sorted 282 static inline void leave(monitor_desc * monitors [], __lock_size_t count) {283 for( __lock_size_t i = count - 1; i >= 0; i--) {188 static inline void leave(monitor_desc ** monitors, int count) { 189 for(int i = count - 1; i >= 0; i--) { 284 190 __leave_monitor_desc( monitors[i] ); 285 191 } … … 288 194 // Ctor for monitor guard 289 195 // Sorts monitors before entering 290 void ?{}( monitor_guard_t & this, monitor_desc * m [], __lock_size_t count, fptr_t func) {196 void ?{}( monitor_guard_t & this, monitor_desc ** m, int count, void (*func)() ) { 291 197 // Store current array 292 198 this.m = m; … … 294 200 295 201 // Sort monitors based on address -> TODO use a sort specialized for small numbers 296 __libcfa_small_sort(this.m, count);202 qsort(this.m, count); 297 203 298 204 // Save previous thread context 299 this.[prev_mntrs, prev_count, prev_func] = this_thread->monitors.[list, size, func]; 205 this.prev_mntrs = this_thread->current_monitors; 206 this.prev_count = this_thread->current_monitor_count; 207 this.prev_func = this_thread->current_monitor_func; 300 208 301 209 // Update thread context (needed for conditions) 302 this_thread-> monitors.[list, size, func] = [m, count, func];303 304 // LIB_DEBUG_PRINT_SAFE("MGUARD : enter %d\n", count);210 this_thread->current_monitors = m; 211 this_thread->current_monitor_count = count; 212 this_thread->current_monitor_func = func; 305 213 306 214 // Enter the monitors in order 307 __monitor_group_t group = {this.m, this.count, func}; 308 enter( group ); 309 310 // LIB_DEBUG_PRINT_SAFE("MGUARD : entered\n"); 215 enter( this.m, this.count, func ); 311 216 } 312 217 … … 314 219 // Dtor for monitor guard 315 220 void ^?{}( monitor_guard_t & this ) { 316 // LIB_DEBUG_PRINT_SAFE("MGUARD : leaving %d\n", this.count);317 318 221 // Leave the monitors in order 319 222 leave( this.m, this.count ); 320 223 321 // LIB_DEBUG_PRINT_SAFE("MGUARD : left\n");322 323 224 // Restore thread context 324 this_thread->monitors.[list, size, func] = this.[prev_mntrs, prev_count, prev_func]; 325 } 326 327 // Ctor for monitor guard 328 // Sorts monitors before entering 329 void ?{}( monitor_dtor_guard_t & this, monitor_desc * m [], fptr_t func ) { 330 // Store current array 331 this.m = *m; 332 333 // Save previous thread context 334 this.[prev_mntrs, prev_count, prev_func] = this_thread->monitors.[list, size, func]; 335 336 // Update thread context (needed for conditions) 337 this_thread->monitors.[list, size, func] = [m, 1, func]; 338 339 __enter_monitor_dtor( this.m, func ); 340 } 341 342 // Dtor for monitor guard 343 void ^?{}( monitor_dtor_guard_t & this ) { 344 // Leave the monitors in order 345 __leave_dtor_monitor_desc( this.m ); 346 347 // Restore thread context 348 this_thread->monitors.[list, size, func] = this.[prev_mntrs, prev_count, prev_func]; 225 this_thread->current_monitors = this.prev_mntrs; 226 this_thread->current_monitor_count = this.prev_count; 227 this_thread->current_monitor_func = this.prev_func; 349 228 } 350 229 351 230 //----------------------------------------------------------------------------- 352 231 // Internal scheduling types 353 void ?{}(__condition_node_t & this, thread_desc * waiting_thread, __lock_size_t count, uintptr_t user_info ) {232 void ?{}(__condition_node_t & this, thread_desc * waiting_thread, unsigned short count, uintptr_t user_info ) { 354 233 this.waiting_thread = waiting_thread; 355 234 this.count = count; … … 365 244 } 366 245 367 void ?{}(__condition_criterion_t & this, monitor_desc * target, __condition_node_t &owner ) {246 void ?{}(__condition_criterion_t & this, monitor_desc * target, __condition_node_t * owner ) { 368 247 this.ready = false; 369 248 this.target = target; 370 this.owner = &owner;249 this.owner = owner; 371 250 this.next = NULL; 372 251 } … … 374 253 //----------------------------------------------------------------------------- 375 254 // Internal scheduling 376 void wait( condition &this, uintptr_t user_info = 0 ) {255 void wait( condition * this, uintptr_t user_info = 0 ) { 377 256 brand_condition( this ); 378 257 379 258 // Check that everything is as expected 380 assertf( this .monitors != NULL, "Waiting with no monitors (%p)", this.monitors );381 verifyf( this .monitor_count != 0, "Waiting with 0 monitors (%"PRIiFAST16")", this.monitor_count );382 verifyf( this .monitor_count < 32u, "Excessive monitor count (%"PRIiFAST16")", this.monitor_count );259 assertf( this->monitors != NULL, "Waiting with no monitors (%p)", this->monitors ); 260 verifyf( this->monitor_count != 0, "Waiting with 0 monitors (%i)", this->monitor_count ); 261 verifyf( this->monitor_count < 32u, "Excessive monitor count (%i)", this->monitor_count ); 383 262 384 263 // Create storage for monitor context 385 monitor_ctx( this .monitors, this.monitor_count );264 monitor_ctx( this->monitors, this->monitor_count ); 386 265 387 266 // Create the node specific to this wait operation … … 390 269 // Append the current wait operation to the ones already queued on the condition 391 270 // We don't need locks for that since conditions must always be waited on inside monitor mutual exclusion 392 append( this.blocked, &waiter );393 394 // Lock all monitors (aggregates the lock sas well)271 append( &this->blocked, &waiter ); 272 273 // Lock all monitors (aggregates the lock them as well) 395 274 lock_all( monitors, locks, count ); 396 275 276 // DON'T unlock, ask the kernel to do it 277 278 // Save monitor state 279 save_recursion( monitors, recursions, count ); 280 397 281 // Find the next thread(s) to run 398 __lock_size_t thread_count = 0;282 unsigned short thread_count = 0; 399 283 thread_desc * threads[ count ]; 400 __builtin_memset( threads, 0, sizeof( threads ) ); 401 402 // Save monitor states 403 monitor_save; 284 for(int i = 0; i < count; i++) { 285 threads[i] = 0; 286 } 404 287 405 288 // Remove any duplicate threads 406 for( __lock_size_t i = 0; i < count; i++) {289 for( int i = 0; i < count; i++) { 407 290 thread_desc * new_owner = next_thread( monitors[i] ); 408 insert_unique( threads, thread_count, new_owner );291 thread_count = insert_unique( threads, thread_count, new_owner ); 409 292 } 410 293 … … 412 295 BlockInternal( locks, count, threads, thread_count ); 413 296 297 298 // WE WOKE UP 299 300 414 301 // We are back, restore the owners and recursions 415 monitor_restore; 416 } 417 418 bool signal( condition & this ) { 302 lock_all( locks, count ); 303 restore_recursion( monitors, recursions, count ); 304 unlock_all( locks, count ); 305 } 306 307 bool signal( condition * this ) { 419 308 if( is_empty( this ) ) { return false; } 420 309 421 310 //Check that everything is as expected 422 verify( this .monitors );423 verify( this .monitor_count != 0 );311 verify( this->monitors ); 312 verify( this->monitor_count != 0 ); 424 313 425 314 //Some more checking in debug 426 315 LIB_DEBUG_DO( 427 316 thread_desc * this_thrd = this_thread; 428 if ( this .monitor_count != this_thrd->monitors.size) {429 abortf( "Signal on condition %p made with different number of monitor(s), expected %i got %i", &this, this.monitor_count, this_thrd->monitors.size);430 } 431 432 for(int i = 0; i < this .monitor_count; i++) {433 if ( this .monitors[i] != this_thrd->monitors.list[i] ) {434 abortf( "Signal on condition %p made with different monitor, expected %p got %i", &this, this.monitors[i], this_thrd->monitors.list[i] );317 if ( this->monitor_count != this_thrd->current_monitor_count ) { 318 abortf( "Signal on condition %p made with different number of monitor(s), expected %i got %i", this, this->monitor_count, this_thrd->current_monitor_count ); 319 } 320 321 for(int i = 0; i < this->monitor_count; i++) { 322 if ( this->monitors[i] != this_thrd->current_monitors[i] ) { 323 abortf( "Signal on condition %p made with different monitor, expected %p got %i", this, this->monitors[i], this_thrd->current_monitors[i] ); 435 324 } 436 325 } 437 326 ); 438 327 439 __lock_size_t count = this.monitor_count;328 unsigned short count = this->monitor_count; 440 329 441 330 // Lock all monitors 442 lock_all( this .monitors, NULL, count );331 lock_all( this->monitors, NULL, count ); 443 332 444 333 //Pop the head of the waiting queue 445 __condition_node_t * node = pop_head( this.blocked );334 __condition_node_t * node = pop_head( &this->blocked ); 446 335 447 336 //Add the thread to the proper AS stack … … 449 338 __condition_criterion_t * crit = &node->criteria[i]; 450 339 assert( !crit->ready ); 451 push( crit->target->signal_stack, crit );340 push( &crit->target->signal_stack, crit ); 452 341 } 453 342 454 343 //Release 455 unlock_all( this .monitors, count );344 unlock_all( this->monitors, count ); 456 345 457 346 return true; 458 347 } 459 348 460 bool signal_block( condition &this ) {461 if( !this .blocked.head ) { return false; }349 bool signal_block( condition * this ) { 350 if( !this->blocked.head ) { return false; } 462 351 463 352 //Check that everything is as expected 464 verifyf( this .monitors != NULL, "Waiting with no monitors (%p)", this.monitors );465 verifyf( this .monitor_count != 0, "Waiting with 0 monitors (%"PRIiFAST16")", this.monitor_count );353 verifyf( this->monitors != NULL, "Waiting with no monitors (%p)", this->monitors ); 354 verifyf( this->monitor_count != 0, "Waiting with 0 monitors (%i)", this->monitor_count ); 466 355 467 356 // Create storage for monitor context 468 monitor_ctx( this .monitors, this.monitor_count );357 monitor_ctx( this->monitors, this->monitor_count ); 469 358 470 359 // Lock all monitors (aggregates the locks them as well) … … 475 364 476 365 //save contexts 477 monitor_save;366 save_recursion( monitors, recursions, count ); 478 367 479 368 //Find the thread to run 480 thread_desc * signallee = pop_head( this.blocked )->waiting_thread;481 set_owner( monitors, count, signallee );482 483 LIB_DEBUG_PRINT_BUFFER_DECL( "Kernel : signal_block condition %p (s: %p)\n", &this, signallee );369 thread_desc * signallee = pop_head( &this->blocked )->waiting_thread; 370 for(int i = 0; i < count; i++) { 371 set_owner( monitors[i], signallee ); 372 } 484 373 485 374 //Everything is ready to go to sleep … … 490 379 491 380 492 LIB_DEBUG_PRINT_BUFFER_LOCAL( "Kernel : signal_block returned\n" );493 494 //We are back, restore the masks and recursions495 monitor_restore;381 //We are back, restore the owners and recursions 382 lock_all( locks, count ); 383 restore_recursion( monitors, recursions, count ); 384 unlock_all( locks, count ); 496 385 497 386 return true; … … 499 388 500 389 // Access the user_info of the thread waiting at the front of the queue 501 uintptr_t front( condition &this ) {390 uintptr_t front( condition * this ) { 502 391 verifyf( !is_empty(this), 503 392 "Attempt to access user data on an empty condition.\n" 504 393 "Possible cause is not checking if the condition is empty before reading stored data." 505 394 ); 506 return this .blocked.head->user_info;395 return this->blocked.head->user_info; 507 396 } 508 397 509 398 //----------------------------------------------------------------------------- 510 // External scheduling 511 // cases to handle : 512 // - target already there : 513 // block and wake 514 // - dtor already there 515 // put thread on signaller stack 516 // - non-blocking 517 // return else 518 // - timeout 519 // return timeout 520 // - block 521 // setup mask 522 // block 523 void __waitfor_internal( const __waitfor_mask_t & mask, int duration ) { 524 // This statment doesn't have a contiguous list of monitors... 525 // Create one! 526 __lock_size_t max = count_max( mask ); 527 monitor_desc * mon_storage[max]; 528 __builtin_memset( mon_storage, 0, sizeof( mon_storage ) ); 529 __lock_size_t actual_count = aggregate( mon_storage, mask ); 530 531 LIB_DEBUG_PRINT_BUFFER_DECL( "Kernel : waitfor %d (s: %d, m: %d)\n", actual_count, mask.size, (__lock_size_t)max); 532 533 if(actual_count == 0) return; 534 535 LIB_DEBUG_PRINT_BUFFER_LOCAL( "Kernel : waitfor internal proceeding\n"); 399 // Internal scheduling 400 int __accept_internal( unsigned short acc_count, __acceptable_t * acceptables ) { 401 thread_desc * thrd = this_thread; 536 402 537 403 // Create storage for monitor context 538 monitor_ctx( mon_storage, actual_count );539 540 // Lock all monitors (aggregates the lock sas well)404 monitor_ctx( acceptables->monitors, acceptables->count ); 405 406 // Lock all monitors (aggregates the lock them as well) 541 407 lock_all( monitors, locks, count ); 542 408 543 {544 // Check if the entry queue545 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 operation566 wait_ctx_primed( this_thread, 0 );567 568 // Save monitor states569 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 #endif577 LIB_DEBUG_PRINT_BUFFER_LOCAL( "\n");578 579 // Set the owners to be the next thread580 set_owner( monitors, count, next );581 582 // Everything is ready to go to sleep583 BlockInternal( locks, count, &next, 1 );584 585 // We are back, restore the owners and recursions586 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 612 409 // Create the node specific to this wait operation 613 wait_ctx_primed( this_thread, 0 ); 614 615 monitor_save; 616 set_mask( monitors, count, mask ); 617 618 for( __lock_size_t i = 0; i < count; i++) { 619 verify( monitors[i]->owner == this_thread ); 620 } 621 622 //Everything is ready to go to sleep 623 BlockInternal( locks, count ); 624 625 626 // WE WOKE UP 627 628 629 //We are back, restore the masks and recursions 630 monitor_restore; 631 632 LIB_DEBUG_PRINT_BUFFER_LOCAL( "Kernel : exiting\n"); 633 634 LIB_DEBUG_PRINT_BUFFER_LOCAL( "Kernel : accepted %d\n", *mask.accepted); 410 wait_ctx_primed( thrd, 0 ); 411 412 // Check if the entry queue 413 thread_desc * next = search_entry_queue( acceptables, acc_count, monitors, count ); 414 415 LIB_DEBUG_PRINT_SAFE("Owner(s) :"); 416 for(int i = 0; i < count; i++) { 417 LIB_DEBUG_PRINT_SAFE(" %p", monitors[i]->owner ); 418 } 419 LIB_DEBUG_PRINT_SAFE("\n"); 420 421 LIB_DEBUG_PRINT_SAFE("Passing mon to %p\n", next); 422 423 if( !next ) { 424 // Update acceptables on the current monitors 425 for(int i = 0; i < count; i++) { 426 monitors[i]->acceptables = acceptables; 427 monitors[i]->acceptable_count = acc_count; 428 } 429 } 430 else { 431 for(int i = 0; i < count; i++) { 432 set_owner( monitors[i], next ); 433 } 434 } 435 436 437 save_recursion( monitors, recursions, count ); 438 439 440 // Everything is ready to go to sleep 441 BlockInternal( locks, count, &next, next ? 1 : 0 ); 442 443 444 //WE WOKE UP 445 446 447 //We are back, restore the owners and recursions 448 lock_all( locks, count ); 449 restore_recursion( monitors, recursions, count ); 450 int acc_idx = monitors[0]->accepted_index; 451 unlock_all( locks, count ); 452 453 return acc_idx; 635 454 } 636 455 … … 639 458 640 459 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 643 460 //Pass the monitor appropriately 644 461 this->owner = owner; … … 648 465 } 649 466 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 671 467 static inline thread_desc * next_thread( monitor_desc * this ) { 672 468 //Check the signaller stack 673 LIB_DEBUG_PRINT_SAFE("Kernel : mon %p AS-stack top %p\n", this, this->signal_stack.top); 674 __condition_criterion_t * urgent = pop( this->signal_stack ); 469 __condition_criterion_t * urgent = pop( &this->signal_stack ); 675 470 if( urgent ) { 676 471 //The signaller stack is not empty, … … 684 479 // No signaller thread 685 480 // Get the next thread in the entry_queue 686 thread_desc * new_owner = pop_head( this->entry_queue );481 thread_desc * new_owner = pop_head( &this->entry_queue ); 687 482 set_owner( this, new_owner ); 688 483 … … 690 485 } 691 486 692 static inline bool is_accepted( monitor_desc * this, const __monitor_group_t & group) {693 __acceptable_t * it = this->mask.clauses; // Optim694 __lock_size_t count = this->mask.size;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; // Optim 489 int acc_cnt = this->acceptable_count; 695 490 696 491 // Check if there are any acceptable functions 697 if( ! it ) return false;492 if( !accs ) return -1; 698 493 699 494 // If this isn't the first monitor to test this, there is no reason to repeat the test. 700 if( this != group[0] ) return group[0]-> mask.accepted >= 0;495 if( this != group[0] ) return group[0]->accepted_index; 701 496 702 497 // For all acceptable functions check if this is the current function. 703 for( __lock_size_t i = 0; i < count; i++, it++ ) { 704 if( *it == group ) { 705 *this->mask.accepted = i; 706 return true; 498 OUT_LOOP: 499 for( int i = 0; i < acc_cnt; i++ ) { 500 __acceptable_t * acc = &accs[i]; 501 502 // if function matches, check the monitors 503 if( acc->func == func ) { 504 505 // If the group count is different then it can't be a match 506 if( acc->count != group_cnt ) return -1; 507 508 // Check that all the monitors match 509 for( int j = 0; j < group_cnt; j++ ) { 510 // If not a match, check next function 511 if( acc->monitors[j] != group[j] ) continue OUT_LOOP; 512 } 513 514 // It's a complete match, accept the call 515 return i; 707 516 } 708 517 } 709 518 710 519 // No function matched 711 return false;712 } 713 714 static inline void init( __lock_size_t count, monitor_desc * monitors [], __condition_node_t & waiter, __condition_criterion_t criteria []) {715 for( __lock_size_t i = 0; i < count; i++) {520 return -1; 521 } 522 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++) { 716 525 (criteria[i]){ monitors[i], waiter }; 717 526 } 718 527 719 waiter .criteria = criteria;720 } 721 722 static inline void init_push( __lock_size_t count, monitor_desc * monitors [], __condition_node_t & waiter, __condition_criterion_t criteria []) {723 for( __lock_size_t i = 0; i < count; i++) {528 waiter->criteria = criteria; 529 } 530 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++) { 724 533 (criteria[i]){ monitors[i], waiter }; 725 LIB_DEBUG_PRINT_SAFE( "Kernel : target %p = %p\n", criteria[i].target, &criteria[i] ); 726 push( criteria[i].target->signal_stack, &criteria[i] ); 727 } 728 729 waiter.criteria = criteria; 730 } 731 732 static inline void lock_all( spinlock * locks [], __lock_size_t count ) { 733 for( __lock_size_t i = 0; i < count; i++ ) { 534 push( &criteria[i].target->signal_stack, &criteria[i] ); 535 } 536 537 waiter->criteria = criteria; 538 } 539 540 static inline void lock_all( spinlock ** locks, unsigned short count ) { 541 for( int i = 0; i < count; i++ ) { 734 542 lock_yield( locks[i] DEBUG_CTX2 ); 735 543 } 736 544 } 737 545 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++ ) {546 static inline void lock_all( monitor_desc ** source, spinlock ** /*out*/ locks, unsigned short count ) { 547 for( int i = 0; i < count; i++ ) { 740 548 spinlock * l = &source[i]->lock; 741 549 lock_yield( l DEBUG_CTX2 ); … … 744 552 } 745 553 746 static inline void unlock_all( spinlock * locks [], __lock_size_t count ) {747 for( __lock_size_t i = 0; i < count; i++ ) {554 static inline void unlock_all( spinlock ** locks, unsigned short count ) { 555 for( int i = 0; i < count; i++ ) { 748 556 unlock( locks[i] ); 749 557 } 750 558 } 751 559 752 static inline void unlock_all( monitor_desc * locks [], __lock_size_t count ) {753 for( __lock_size_t i = 0; i < count; i++ ) {560 static inline void unlock_all( monitor_desc ** locks, unsigned short count ) { 561 for( int i = 0; i < count; i++ ) { 754 562 unlock( &locks[i]->lock ); 755 563 } 756 564 } 757 565 758 static inline void save( 759 monitor_desc * ctx [], 760 __lock_size_t count, 761 __attribute((unused)) spinlock * locks [], 762 unsigned int /*out*/ recursions [], 763 __waitfor_mask_t /*out*/ masks [] 764 ) { 765 for( __lock_size_t i = 0; i < count; i++ ) { 566 567 static inline void save_recursion ( monitor_desc ** ctx, unsigned int * /*out*/ recursions, unsigned short count ) { 568 for( int i = 0; i < count; i++ ) { 766 569 recursions[i] = ctx[i]->recursion; 767 masks[i] = ctx[i]->mask; 768 } 769 } 770 771 static inline void restore( 772 monitor_desc * ctx [], 773 __lock_size_t count, 774 spinlock * locks [], 775 unsigned int /*out*/ recursions [], 776 __waitfor_mask_t /*out*/ masks [] 777 ) { 778 lock_all( locks, count ); 779 for( __lock_size_t i = 0; i < count; i++ ) { 570 } 571 } 572 573 static inline void restore_recursion( monitor_desc ** ctx, unsigned int * /*in */ recursions, unsigned short count ) { 574 for( int i = 0; i < count; i++ ) { 780 575 ctx[i]->recursion = recursions[i]; 781 ctx[i]->mask = masks[i]; 782 } 783 unlock_all( locks, count ); 576 } 784 577 } 785 578 … … 806 599 } 807 600 808 LIB_DEBUG_PRINT_SAFE( "Kernel : Runing %i (%p)\n", ready2run, ready2run ? node->waiting_thread : NULL);601 // LIB_DEBUG_PRINT_SAFE( "Runing %i\n", ready2run ); 809 602 return ready2run ? node->waiting_thread : NULL; 810 603 } 811 604 812 static inline void brand_condition( condition &this ) {605 static inline void brand_condition( condition * this ) { 813 606 thread_desc * thrd = this_thread; 814 if( !this .monitors ) {607 if( !this->monitors ) { 815 608 // LIB_DEBUG_PRINT_SAFE("Branding\n"); 816 assertf( thrd->monitors.list != NULL, "No current monitor to brand condition %p", thrd->monitors.list ); 817 this.monitor_count = thrd->monitors.size; 818 819 this.monitors = malloc( this.monitor_count * sizeof( *this.monitors ) ); 820 for( int i = 0; i < this.monitor_count; i++ ) { 821 this.monitors[i] = thrd->monitors.list[i]; 822 } 823 } 824 } 825 826 static inline [thread_desc *, int] search_entry_queue( const __waitfor_mask_t & mask, monitor_desc * monitors [], __lock_size_t count ) { 827 828 __thread_queue_t & entry_queue = monitors[0]->entry_queue; 609 assertf( thrd->current_monitors != NULL, "No current monitor to brand condition %p", thrd->current_monitors ); 610 this->monitor_count = thrd->current_monitor_count; 611 612 this->monitors = malloc( this->monitor_count * sizeof( *this->monitors ) ); 613 for( int i = 0; i < this->monitor_count; i++ ) { 614 this->monitors[i] = thrd->current_monitors[i]; 615 } 616 } 617 } 618 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; 829 642 830 643 // For each thread in the entry-queue 831 for( thread_desc ** thrd_it = &entry_queue .head;644 for( thread_desc ** thrd_it = &entry_queue->head; 832 645 *thrd_it; 833 thrd_it = &(*thrd_it)->next 834 ){646 thrd_it = &(*thrd_it)->next) 647 { 835 648 // For each acceptable check if it matches 836 int i = 0; 837 __acceptable_t * end = mask.clauses + mask.size; 838 for( __acceptable_t * it = mask.clauses; it != end; it++, i++ ) { 649 __acceptable_t * acc_end = acceptables + acc_count; 650 for( __acceptable_t * acc_it = acceptables; acc_it != acc_end; acc_it++ ) { 839 651 // Check if we have a match 840 if( *it == (*thrd_it)->monitors) {652 if( match( acc_it, *thrd_it ) ) { 841 653 842 654 // If we have a match return it 843 655 // after removeing it from the entry queue 844 return [remove( entry_queue, thrd_it ), i];656 return remove( entry_queue, thrd_it ); 845 657 } 846 658 } 847 659 } 848 660 849 return [0, -1]; 850 } 851 852 forall(dtype T | sized( T )) 853 static inline __lock_size_t insert_unique( T * array [], __lock_size_t & size, T * val ) { 854 if( !val ) return size; 855 856 for( __lock_size_t i = 0; i <= size; i++) { 857 if( array[i] == val ) return size; 858 } 859 860 array[size] = val; 861 size = size + 1; 862 return size; 863 } 864 865 static inline __lock_size_t count_max( const __waitfor_mask_t & mask ) { 866 __lock_size_t max = 0; 867 for( __lock_size_t i = 0; i < mask.size; i++ ) { 868 max += mask.clauses[i].size; 869 } 870 return max; 871 } 872 873 static inline __lock_size_t aggregate( monitor_desc * storage [], const __waitfor_mask_t & mask ) { 874 __lock_size_t size = 0; 875 for( __lock_size_t i = 0; i < mask.size; i++ ) { 876 __libcfa_small_sort( mask.clauses[i].list, mask.clauses[i].size ); 877 for( __lock_size_t j = 0; j < mask.clauses[i].size; j++) { 878 insert_unique( storage, size, mask.clauses[i].list[j] ); 879 } 880 } 881 // TODO insertion sort instead of this 882 __libcfa_small_sort( storage, size ); 883 return size; 884 } 885 661 return NULL; 662 } 886 663 void ?{}( __condition_blocked_queue_t & this ) { 887 664 this.head = NULL; … … 889 666 } 890 667 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;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; 899 676 if( head ) { 900 this .head = head->next;677 this->head = head->next; 901 678 if( !head->next ) { 902 this .tail = &this.head;679 this->tail = &this->head; 903 680 } 904 681 head->next = NULL; -
src/libcfa/concurrency/preemption.c
r3f7e12cb r78315272 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 }344 330 345 331 // If another signal arrived something went wrong … … 380 366 381 367 if ( sigaction( sig, &act, NULL ) == -1 ) { 382 LIB_DEBUG_PRINT_BUFFER_DECL( 368 LIB_DEBUG_PRINT_BUFFER_DECL( STDERR_FILENO, 383 369 " __kernel_sigaction( sig:%d, handler:%p, flags:%d ), problem installing signal handler, error(%d) %s.\n", 384 370 sig, handler, flags, errno, strerror( errno ) … … 397 383 398 384 if ( sigaction( sig, &act, NULL ) == -1 ) { 399 LIB_DEBUG_PRINT_BUFFER_DECL( 385 LIB_DEBUG_PRINT_BUFFER_DECL( STDERR_FILENO, 400 386 " __kernel_sigdefault( sig:%d ), problem reseting signal handler, error(%d) %s.\n", 401 387 sig, errno, strerror( errno ) -
src/libcfa/concurrency/thread
r3f7e12cb r78315272 36 36 forall( dtype T | is_thread(T) ) 37 37 static inline coroutine_desc* get_coroutine(T & this) { 38 return &get_thread(this)-> self_cor;38 return &get_thread(this)->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)-> self_mon;43 return &get_thread(this)->mon; 44 44 } 45 45 46 46 static inline coroutine_desc* get_coroutine(thread_desc * this) { 47 return &this-> self_cor;47 return &this->cor; 48 48 } 49 49 50 50 static inline monitor_desc* get_monitor(thread_desc * this) { 51 return &this-> self_mon;51 return &this->mon; 52 52 } 53 53 -
src/libcfa/concurrency/thread.c
r3f7e12cb r78315272 33 33 34 34 void ?{}(thread_desc& this) { 35 (this.self_cor){}; 36 this.self_cor.name = "Anonymous Coroutine"; 37 this.self_mon.owner = &this; 38 this.self_mon.recursion = 1; 39 this.self_mon_p = &this.self_mon; 35 (this.cor){}; 36 this.cor.name = "Anonymous Coroutine"; 37 this.mon.owner = &this; 38 this.mon.recursion = 1; 40 39 this.next = NULL; 41 40 42 (this.monitors){ &this.self_mon_p, 1, (fptr_t)0 }; 41 this.current_monitors = &this.mon; 42 this.current_monitor_count = 1; 43 43 } 44 44 45 45 void ^?{}(thread_desc& this) { 46 ^(this. self_cor){};46 ^(this.cor){}; 47 47 } 48 48 -
src/libcfa/interpose.c
r3f7e12cb r78315272 127 127 va_end( args ); 128 128 129 __lib_debug_write( abort_text, len );130 __lib_debug_write( "\n", 1 );129 __lib_debug_write( STDERR_FILENO, abort_text, len ); 130 __lib_debug_write( STDERR_FILENO, "\n", 1 ); 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( abort_text, len );134 __lib_debug_write( STDERR_FILENO, abort_text, len ); 135 135 136 136 -
src/libcfa/iostream
r3f7e12cb r78315272 10 10 // Created On : Wed May 27 17:56:53 2015 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Tue Oct 10 14:51:10201713 // Update Count : 1 4012 // Last Modified On : Wed Sep 13 12:53:46 2017 13 // Update Count : 138 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 => ambiguous82 81 forall( dtype ostype | ostream( ostype ) ) ostype * ?|?( ostype *, const char32_t * ); 83 #endif // ! ( __ARM_ARCH_ISA_ARM == 1 && __ARM_32BIT_STATE == 1 )84 82 forall( dtype ostype | ostream( ostype ) ) ostype * ?|?( ostype *, const wchar_t * ); 85 83 forall( dtype ostype | ostream( ostype ) ) ostype * ?|?( ostype *, const void * ); -
src/libcfa/iostream.c
r3f7e12cb r78315272 10 10 // Created On : Wed May 27 17:56:53 2015 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Tue Oct 10 14:51:09201713 // Update Count : 42 412 // Last Modified On : Sun Sep 17 23:24:25 2017 13 // Update Count : 422 14 14 // 15 15 … … 191 191 } // ?|? 192 192 193 #if ! ( __ARM_ARCH_ISA_ARM == 1 && __ARM_32BIT_STATE == 1 ) // char32_t == wchar_t => ambiguous194 193 forall( dtype ostype | ostream( ostype ) ) 195 194 ostype * ?|?( ostype * os, const char32_t * str ) { … … 198 197 return os; 199 198 } // ?|? 200 #endif // ! ( __ARM_ARCH_ISA_ARM == 1 && __ARM_32BIT_STATE == 1 )201 199 202 200 forall( dtype ostype | ostream( ostype ) ) -
src/libcfa/libhdr/libdebug.c
r3f7e12cb r78315272 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( const char *in_buffer, int len ) {30 void __lib_debug_write( int fd, 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( STDERR_FILENO, in_buffer, len - count );36 retcode = write( fd, 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( buffer, len );56 __lib_debug_write( STDERR_FILENO, 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( buffer, len );68 __lib_debug_write( STDERR_FILENO, 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( buffer, len );75 __lib_debug_write( STDERR_FILENO, 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( in_buffer, len );84 __lib_debug_write( STDERR_FILENO, in_buffer, len ); 85 85 86 86 va_end( args ); -
src/libcfa/libhdr/libdebug.h
r3f7e12cb r78315272 44 44 extern "C" { 45 45 #endif 46 #include <stdarg.h> 47 #include <stdio.h> 46 #include <stdarg.h> 48 47 49 extern void __lib_debug_write( const char *buffer, int len );48 extern void __lib_debug_write( int fd, const char *buffer, int len ); 50 49 extern void __lib_debug_acquire(); 51 50 extern void __lib_debug_release(); … … 59 58 60 59 #ifdef __CFA_DEBUG_PRINT__ 61 #define LIB_DEBUG_WRITE( buffer, len ) __lib_debug_write(buffer, len )60 #define LIB_DEBUG_WRITE( fd, buffer, len ) __lib_debug_write( fd, buffer, len ) 62 61 #define LIB_DEBUG_ACQUIRE() __lib_debug_acquire() 63 62 #define LIB_DEBUG_RELEASE() __lib_debug_release() … … 65 64 #define LIB_DEBUG_PRINT_NOLOCK(...) __lib_debug_print_nolock (__VA_ARGS__) 66 65 #define LIB_DEBUG_PRINT_BUFFER(...) __lib_debug_print_buffer (__VA_ARGS__) 67 #define LIB_DEBUG_PRINT_BUFFER_DECL( ...) char __dbg_text[256]; int __dbg_len = snprintf( __dbg_text, 256, __VA_ARGS__ ); __lib_debug_write( __dbg_text, __dbg_len );68 #define LIB_DEBUG_PRINT_BUFFER_LOCAL( ...) __dbg_len = snprintf( __dbg_text, 256, __VA_ARGS__ ); __lib_debug_write( __dbg_text, __dbg_len );66 #define LIB_DEBUG_PRINT_BUFFER_DECL(fd, ...) char text[256]; int len = snprintf( text, 256, __VA_ARGS__ ); __lib_debug_write( fd, text, len ); 67 #define LIB_DEBUG_PRINT_BUFFER_LOCAL(fd, ...) len = snprintf( text, 256, __VA_ARGS__ ); __lib_debug_write( fd, text, len ); 69 68 #else 70 69 #define LIB_DEBUG_WRITE(...) ((void)0) -
src/libcfa/stdlib
r3f7e12cb r78315272 10 10 // Created On : Thu Jan 28 17:12:35 2016 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Tue Oct 31 13:47:24201713 // Update Count : 2 4512 // Last Modified On : Wed Aug 23 20:29:47 2017 13 // Update Count : 224 14 14 // 15 15 … … 27 27 // allocation, non-array types 28 28 static inline forall( dtype T | sized(T) ) T * malloc( void ) { 29 // printf( "* malloc\n" );29 //printf( "X1\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 malloc35 // printf( "& malloc %p\n", &p );36 // return p;37 // // return (T &)*(T *)(void *)malloc( (size_t)sizeof(T) ); // C malloc38 // } // malloc39 32 40 33 extern "C" { void * calloc( size_t dim, size_t size ); } // default C routine … … 213 206 //--------------------------------------- 214 207 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 ); 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 ); 231 219 232 220 //--------------------------------------- -
src/libcfa/stdlib.c
r3f7e12cb r78315272 10 10 // Created On : Thu Jan 28 17:10:29 2016 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Mon Oct 30 22:43:02201713 // Update Count : 29 712 // Last Modified On : Wed Aug 23 20:30:44 2017 13 // Update Count : 292 14 14 // 15 15 … … 275 275 //--------------------------------------- 276 276 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); } 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); } 293 288 294 289 //--------------------------------------- -
src/main.cc
r3f7e12cb r78315272 10 10 // Author : Richard C. Bilson 11 11 // Created On : Fri May 15 23:12:02 2015 12 // Last Modified By : Peter A. Buhr13 // Last Modified On : Tue Oct 31 12:22:40 201714 // Update Count : 44 512 // Last Modified By : Andrew Beach 13 // Last Modified On : Wed Jul 26 14:38:00 2017 14 // Update Count : 443 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 copyParams 46 47 #include "GenPoly/InstantiateGeneric.h" // for instantiateGeneric 47 48 #include "GenPoly/Lvalue.h" // for convertLvalue … … 93 94 codegenp = false, 94 95 prettycodegenp = false, 95 linemarks = false;96 nolinemarks = false; 96 97 97 98 static void parse_cmdline( int argc, char *argv[], const char *& filename ); … … 238 239 } // if 239 240 241 // OPTPRINT( "Concurrency" ) 242 // Concurrency::applyKeywords( translationUnit ); 243 240 244 // add the assignment statement after the initialization of a type parameter 241 245 OPTPRINT( "validate" ) … … 320 324 OPTPRINT("instantiateGenerics") 321 325 GenPoly::instantiateGeneric( translationUnit ); 326 OPTPRINT( "copyParams" ); 327 GenPoly::copyParams( translationUnit ); 322 328 OPTPRINT( "convertLvalue" ) 323 329 GenPoly::convertLvalue( translationUnit ); … … 340 346 341 347 CodeTools::fillLocations( translationUnit ); 342 CodeGen::generate( translationUnit, *output, ! noprotop, prettycodegenp, true, linemarks );348 CodeGen::generate( translationUnit, *output, ! noprotop, prettycodegenp, true, ! nolinemarks ); 343 349 344 350 CodeGen::FixMain::fix( *output, treep ? "../prelude/bootloader.c" : CFA_LIBDIR "/bootloader.c" ); … … 378 384 379 385 void parse_cmdline( int argc, char * argv[], const char *& filename ) { 380 enum { Ast, Bbox, Bresolver, CtorInitFix, DeclStats, Expr, ExprAlt, Grammar, LibCFA, Linemarks, Nolinemarks,Nopreamble, Parse, Prototypes, Resolver, Symbol, Tree, TupleExpansion, Validate, };386 enum { Ast, Bbox, Bresolver, CtorInitFix, DeclStats, Expr, ExprAlt, Grammar, LibCFA, Nopreamble, Parse, Prototypes, Resolver, Symbol, Tree, TupleExpansion, Validate, }; 381 387 382 388 static struct option long_opts[] = { … … 390 396 { "grammar", no_argument, 0, Grammar }, 391 397 { "libcfa", no_argument, 0, LibCFA }, 392 { "line-marks", no_argument, 0, Linemarks },393 { "no-line-marks", no_argument, 0, Nolinemarks },394 398 { "no-preamble", no_argument, 0, Nopreamble }, 395 399 { "parse", no_argument, 0, Parse }, … … 407 411 408 412 int c; 409 while ( (c = getopt_long( argc, argv, "abBcCdefglLmn NpqrstTvyzZD:F:", long_opts, &long_index )) != -1 ) {413 while ( (c = getopt_long( argc, argv, "abBcCdefglLmnpqrstTvyzZD:F:", long_opts, &long_index )) != -1 ) { 410 414 switch ( c ) { 411 415 case Ast: … … 447 451 libcfap = true; 448 452 break; 449 case Linemarks: 450 case 'L': // print lines marks 451 linemarks = true; 453 case 'L': // surpress lines marks 454 nolinemarks = true; 452 455 break; 453 456 case Nopreamble: 454 457 case 'n': // do not read preamble 455 458 nopreludep = true; 456 break;457 case Nolinemarks:458 case 'N': // suppress line marks459 linemarks = false;460 459 break; 461 460 case Prototypes: … … 509 508 assertf( false, "Unknown option: %s\n", argv[optind - 1] ); 510 509 } // if 511 #if __GNUC__ < 7512 #else513 __attribute__((fallthrough));514 #endif515 510 default: 516 511 abort(); -
src/prelude/Makefile.am
r3f7e12cb r78315272 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 bootloader.cf $@ # use src/cfa-cpp as not in lib until after install59 ${AM_V_GEN}${abs_top_srcdir}/src/driver/cfa-cpp -tpmL bootloader.cf $@ # use src/cfa-cpp as not in lib until after install 60 60 61 61 maintainer-clean-local : -
src/prelude/Makefile.in
r3f7e12cb r78315272 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 bootloader.cf $@ # use src/cfa-cpp as not in lib until after install528 ${AM_V_GEN}${abs_top_srcdir}/src/driver/cfa-cpp -tpmL bootloader.cf $@ # use src/cfa-cpp as not in lib until after install 529 529 530 530 maintainer-clean-local : -
src/prelude/extras.c
r3f7e12cb r78315272 1 1 #include <stddef.h> // size_t, ptrdiff_t 2 #include <stdint.h> // intX_t, uintX_t, where X is 8, 16, 32, 643 2 #include <uchar.h> // char16_t, char32_t 4 3 #include <wchar.h> // wchar_t -
src/prelude/extras.regx
r3f7e12cb r78315272 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;11 3 typedef.* char16_t; 12 4 typedef.* char32_t; -
src/prelude/prelude.cf
r3f7e12cb r78315272 7 7 // Created On : Sat Nov 29 07:23:41 2014 8 8 // Last Modified By : Peter A. Buhr 9 // Last Modified On : Sat Oct 28 16:33:09201710 // Update Count : 1029 // Last Modified On : Wed Aug 30 07:56:07 2017 10 // Update Count : 93 11 11 // 12 12 … … 41 41 _Bool ?++( _Bool & ), ?++( volatile _Bool & ); 42 42 _Bool ?--( _Bool & ), ?--( volatile _Bool & ); 43 signed short ?++( signed short & ), ?++( volatile signed short & ); 44 signed short ?--( signed short & ), ?--( volatile signed short & ); 45 unsigned short ?++( unsigned short & ), ?++( volatile unsigned short & ); 46 unsigned short ?--( unsigned short & ), ?--( volatile unsigned short & ); 43 unsigned char ?++( unsigned char & ), ?++( volatile unsigned char & ); 47 44 signed int ?++( signed int & ), ?++( volatile signed int & ); 48 45 signed int ?--( signed int & ), ?--( volatile signed int & ); … … 95 92 96 93 _Bool ++?( _Bool & ), --?( _Bool & ); 97 signed short ++?( signed short & ), --?( signed short & );98 94 signed int ++?( signed int & ), --?( signed int & ); 99 unsigned short ++?( unsigned int & ), --?( unsigned int & ); 100 unsigned int ++?( unsigned short & ), --?( unsigned short & ); 95 unsigned int ++?( unsigned int & ), --?( unsigned int & ); 101 96 signed long int ++?( signed long int & ), --?( signed long int & ); 102 97 unsigned long int ++?( unsigned long int & ), --?( unsigned long int & ); … … 195 190 long double _Complex ?+?( long double _Complex, long double _Complex ), ?-?( long double _Complex, long double _Complex ); 196 191 197 forall( dtype T | sized(T) ) T * ?+?( T *, ptrdiff_t );198 forall( dtype T | sized(T) ) T * ?+?( ptrdiff_t, T * );192 forall( dtype T | sized(T) ) T * ?+?( T *, ptrdiff_t ); 193 forall( dtype T | sized(T) ) T * ?+?( ptrdiff_t, T * ); 199 194 forall( dtype T | sized(T) ) const T * ?+?( const T *, ptrdiff_t ); 200 195 forall( dtype T | sized(T) ) const T * ?+?( ptrdiff_t, const T * ); 201 forall( dtype T | sized(T) ) volatile T * ?+?( volatile T *, ptrdiff_t );202 forall( dtype T | sized(T) ) volatile T * ?+?( ptrdiff_t, volatile T * );196 forall( dtype T | sized(T) ) volatile T * ?+?( volatile T *, ptrdiff_t ); 197 forall( dtype T | sized(T) ) volatile T * ?+?( ptrdiff_t, volatile T * ); 203 198 forall( dtype T | sized(T) ) const volatile T * ?+?( const volatile T *, ptrdiff_t ); 204 199 forall( dtype T | sized(T) ) const volatile T * ?+?( ptrdiff_t, const volatile T * ); 205 forall( dtype T | sized(T) ) T * ?-?( T *, ptrdiff_t );200 forall( dtype T | sized(T) ) T * ?-?( T *, ptrdiff_t ); 206 201 forall( dtype T | sized(T) ) const T * ?-?( const T *, ptrdiff_t ); 207 forall( dtype T | sized(T) ) volatile T * ?-?( volatile T *, ptrdiff_t );202 forall( dtype T | sized(T) ) volatile T * ?-?( volatile T *, ptrdiff_t ); 208 203 forall( dtype T | sized(T) ) const volatile T * ?-?( const volatile T *, ptrdiff_t ); 209 204 forall( dtype T | sized(T) ) ptrdiff_t ?-?( const volatile T *, const volatile T * ); … … 231 226 signed int ?<?( _Bool, _Bool ), ?<=?( _Bool, _Bool ), 232 227 ?>?( _Bool, _Bool ), ?>=?( _Bool, _Bool ); 233 signed int ?<?( char, char ), ?<=?( char, char ),234 ?>?( char, char ), ?>=?( char, char );228 signed int ?<?( char, char ), ?<=?( char, char ), 229 ?>?( char, char ), ?>=?( char, char ); 235 230 signed int ?<?( signed char, signed char ), ?<=?( signed char, signed char ), 236 231 ?>?( signed char, signed char ), ?>=?( signed char, signed char ); … … 240 235 ?>?( signed short, signed short ), ?>=?( signed short, signed short ); 241 236 signed int ?<?( unsigned short, unsigned short ), ?<=?( unsigned short, unsigned short ), 242 ?>?( unsigned short, unsigned short ), ?>=?( unsigned short, unsigned short );237 ?>?( unsigned short, unsigned short ), ?>=?( unsigned short, unsigned short ); 243 238 signed int ?<?( signed int, signed int ), ?<=?( signed int, signed int ), 244 239 ?>?( signed int, signed int ), ?>=?( signed int, signed int ); … … 473 468 forall( ftype FT ) FT * ?=?( FT * volatile &, zero_t ); 474 469 475 forall( dtype T | sized(T) ) T * ?+=?( T * &, ptrdiff_t );476 forall( dtype T | sized(T) ) T * ?+=?( T * volatile &, ptrdiff_t );470 forall( dtype T | sized(T) ) T * ?+=?( T * &, ptrdiff_t ); 471 forall( dtype T | sized(T) ) T * ?+=?( T * volatile &, ptrdiff_t ); 477 472 forall( dtype T | sized(T) ) const T * ?+=?( const T * &, ptrdiff_t ); 478 473 forall( dtype T | sized(T) ) const T * ?+=?( const T * volatile &, ptrdiff_t ); 479 forall( dtype T | sized(T) ) volatile T * ?+=?( volatile T * &, ptrdiff_t );480 forall( dtype T | sized(T) ) volatile T * ?+=?( volatile T * volatile &, ptrdiff_t );474 forall( dtype T | sized(T) ) volatile T * ?+=?( volatile T * &, ptrdiff_t ); 475 forall( dtype T | sized(T) ) volatile T * ?+=?( volatile T * volatile &, ptrdiff_t ); 481 476 forall( dtype T | sized(T) ) const volatile T * ?+=?( const volatile T * &, ptrdiff_t ); 482 477 forall( dtype T | sized(T) ) const volatile T * ?+=?( const volatile T * volatile &, ptrdiff_t ); 483 forall( dtype T | sized(T) ) T * ?-=?( T * &, ptrdiff_t );484 forall( dtype T | sized(T) ) T * ?-=?( T * volatile &, ptrdiff_t );478 forall( dtype T | sized(T) ) T * ?-=?( T * &, ptrdiff_t ); 479 forall( dtype T | sized(T) ) T * ?-=?( T * volatile &, ptrdiff_t ); 485 480 forall( dtype T | sized(T) ) const T * ?-=?( const T * &, ptrdiff_t ); 486 481 forall( dtype T | sized(T) ) const T * ?-=?( const T * volatile &, ptrdiff_t ); 487 forall( dtype T | sized(T) ) volatile T * ?-=?( volatile T * &, ptrdiff_t );488 forall( dtype T | sized(T) ) volatile T * ?-=?( volatile T * volatile &, ptrdiff_t );482 forall( dtype T | sized(T) ) volatile T * ?-=?( volatile T * &, ptrdiff_t ); 483 forall( dtype T | sized(T) ) volatile T * ?-=?( volatile T * volatile &, ptrdiff_t ); 489 484 forall( dtype T | sized(T) ) const volatile T * ?-=?( const volatile T * &, ptrdiff_t ); 490 485 forall( dtype T | sized(T) ) const volatile T * ?-=?( const volatile T * volatile &, ptrdiff_t ); … … 502 497 signed long long int ?=?( signed long long int &, signed long long int ), ?=?( volatile signed long long int &, signed long long int ); 503 498 unsigned long long int ?=?( unsigned long long int &, unsigned long long int ), ?=?( volatile unsigned long long int &, unsigned long long int ); 504 zero_t ?=?( zero_t &, zero_t );499 zero_t ?=?( zero_t &, zero_t ); 505 500 one_t ?=?( one_t &, one_t ); 506 501 … … 557 552 signed long long int ?+=?( signed long long int &, signed long long int ), ?+=?( volatile signed long long int &, signed long long int ); 558 553 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 );561 554 562 555 _Bool ?-=?( _Bool &, _Bool ), ?-=?( volatile _Bool &, _Bool ); … … 673 666 ?+=?( long double _Complex &, long double _Complex ), ?+=?( volatile long double _Complex &, long double _Complex ), 674 667 ?-=?( long double _Complex &, long double _Complex ), ?-=?( volatile long double _Complex &, long double _Complex ); 668 669 670 675 671 676 672 … … 842 838 forall( dtype DT ) void ^?{}( const volatile DT * &); 843 839 844 void ^?{}( void * &);845 void ^?{}( const void * &);846 void ^?{}( volatile void * &);847 void ^?{}( constvolatile void * &);840 void ^?{}( void * &); 841 void ^?{}( const void * &); 842 void ^?{}( volatile void * &); 843 void ^?{}( const volatile void * &); 848 844 849 845 // Local Variables: // -
src/tests/.expect/32/KRfunctions.txt
r3f7e12cb r78315272 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);24 23 static inline void ___constructor__F_R2sS_autogen___1(struct S *___dst__R2sS_1){ 25 24 ((void)((*___dst__R2sS_1).__i__i_1) /* ?{} */); … … 34 33 struct S ___ret__2sS_1; 35 34 ((void)((*___dst__R2sS_1).__i__i_1=___src__2sS_1.__i__i_1)); 36 ((void)___constructor__F_R2sS2sS_autogen___1((&___ret__2sS_1), (*___dst__R2sS_1)));37 return ___ret__2sS_1;35 ((void)___constructor__F_R2sS2sS_autogen___1((&___ret__2sS_1), ___src__2sS_1)); 36 return ((struct S )___ret__2sS_1); 38 37 } 39 38 static inline void ___constructor__F_R2sSi_autogen___1(struct S *___dst__R2sS_1, signed int __i__i_1){ … … 66 65 signed int *__x__FPi_ii__2(signed int __anonymous_object2, signed int __anonymous_object3); 67 66 ((void)(___retval_f10__PFPi_ii__1=__x__FPi_ii__2) /* ?{} */); 68 return ___retval_f10__PFPi_ii__1;67 return ((signed int *(*)(signed int __x__i_1, signed int __y__i_1))___retval_f10__PFPi_ii__1); 69 68 } 70 69 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
r3f7e12cb r78315272 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), (*___dst__R13s__anonymous0_1)));26 return ___ret__13s__anonymous0_1;25 ((void)___constructor__F_R13s__anonymous013s__anonymous0_autogen___1((&___ret__13s__anonymous0_1), ___src__13s__anonymous0_1)); 26 return ((struct __anonymous0 )___ret__13s__anonymous0_1); 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), (*___dst__R5sAgn2_1)));44 return ___ret__5sAgn2_1;43 ((void)___constructor__F_R5sAgn25sAgn2_autogen___1((&___ret__5sAgn2_1), ___src__5sAgn2_1)); 44 return ((struct Agn2 )___ret__5sAgn2_1); 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);81 71 static inline void ___constructor__F_R4sFdl_autogen___1(struct Fdl *___dst__R4sFdl_1){ 82 72 ((void)((*___dst__R4sFdl_1).__f1__i_1) /* ?{} */); … … 88 78 ((void)((*___dst__R4sFdl_1).__f7__i_1) /* ?{} */); 89 79 ((void)((*___dst__R4sFdl_1).__f8__i_1) /* ?{} */); 90 ((void)((*___dst__R4sFdl_1).__anonymous_object0) /* ?{} */);91 80 ((void)((*___dst__R4sFdl_1).__f9__Pi_1) /* ?{} */); 92 81 } … … 100 89 ((void)((*___dst__R4sFdl_1).__f7__i_1=___src__4sFdl_1.__f7__i_1) /* ?{} */); 101 90 ((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) /* ?{} */);103 91 ((void)((*___dst__R4sFdl_1).__f9__Pi_1=___src__4sFdl_1.__f9__Pi_1) /* ?{} */); 104 92 } 105 93 static inline void ___destructor__F_R4sFdl_autogen___1(struct Fdl *___dst__R4sFdl_1){ 106 94 ((void)((*___dst__R4sFdl_1).__f9__Pi_1) /* ^?{} */); 107 ((void)((*___dst__R4sFdl_1).__anonymous_object0) /* ^?{} */);108 95 ((void)((*___dst__R4sFdl_1).__f8__i_1) /* ^?{} */); 109 96 ((void)((*___dst__R4sFdl_1).__f7__i_1) /* ^?{} */); … … 125 112 ((void)((*___dst__R4sFdl_1).__f7__i_1=___src__4sFdl_1.__f7__i_1)); 126 113 ((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));128 114 ((void)((*___dst__R4sFdl_1).__f9__Pi_1=___src__4sFdl_1.__f9__Pi_1)); 129 ((void)___constructor__F_R4sFdl4sFdl_autogen___1((&___ret__4sFdl_1), (*___dst__R4sFdl_1)));130 return ___ret__4sFdl_1;115 ((void)___constructor__F_R4sFdl4sFdl_autogen___1((&___ret__4sFdl_1), ___src__4sFdl_1)); 116 return ((struct Fdl )___ret__4sFdl_1); 131 117 } 132 118 static inline void ___constructor__F_R4sFdli_autogen___1(struct Fdl *___dst__R4sFdl_1, signed int __f1__i_1){ … … 139 125 ((void)((*___dst__R4sFdl_1).__f7__i_1) /* ?{} */); 140 126 ((void)((*___dst__R4sFdl_1).__f8__i_1) /* ?{} */); 141 ((void)((*___dst__R4sFdl_1).__anonymous_object0) /* ?{} */);142 127 ((void)((*___dst__R4sFdl_1).__f9__Pi_1) /* ?{} */); 143 128 } … … 151 136 ((void)((*___dst__R4sFdl_1).__f7__i_1) /* ?{} */); 152 137 ((void)((*___dst__R4sFdl_1).__f8__i_1) /* ?{} */); 153 ((void)((*___dst__R4sFdl_1).__anonymous_object0) /* ?{} */);154 138 ((void)((*___dst__R4sFdl_1).__f9__Pi_1) /* ?{} */); 155 139 } … … 163 147 ((void)((*___dst__R4sFdl_1).__f7__i_1) /* ?{} */); 164 148 ((void)((*___dst__R4sFdl_1).__f8__i_1) /* ?{} */); 165 ((void)((*___dst__R4sFdl_1).__anonymous_object0) /* ?{} */);166 149 ((void)((*___dst__R4sFdl_1).__f9__Pi_1) /* ?{} */); 167 150 } … … 175 158 ((void)((*___dst__R4sFdl_1).__f7__i_1) /* ?{} */); 176 159 ((void)((*___dst__R4sFdl_1).__f8__i_1) /* ?{} */); 177 ((void)((*___dst__R4sFdl_1).__anonymous_object0) /* ?{} */);178 160 ((void)((*___dst__R4sFdl_1).__f9__Pi_1) /* ?{} */); 179 161 } … … 187 169 ((void)((*___dst__R4sFdl_1).__f7__i_1) /* ?{} */); 188 170 ((void)((*___dst__R4sFdl_1).__f8__i_1) /* ?{} */); 189 ((void)((*___dst__R4sFdl_1).__anonymous_object0) /* ?{} */);190 171 ((void)((*___dst__R4sFdl_1).__f9__Pi_1) /* ?{} */); 191 172 } … … 199 180 ((void)((*___dst__R4sFdl_1).__f7__i_1) /* ?{} */); 200 181 ((void)((*___dst__R4sFdl_1).__f8__i_1) /* ?{} */); 201 ((void)((*___dst__R4sFdl_1).__anonymous_object0) /* ?{} */);202 182 ((void)((*___dst__R4sFdl_1).__f9__Pi_1) /* ?{} */); 203 183 } … … 211 191 ((void)((*___dst__R4sFdl_1).__f7__i_1=__f7__i_1) /* ?{} */); 212 192 ((void)((*___dst__R4sFdl_1).__f8__i_1) /* ?{} */); 213 ((void)((*___dst__R4sFdl_1).__anonymous_object0) /* ?{} */);214 193 ((void)((*___dst__R4sFdl_1).__f9__Pi_1) /* ?{} */); 215 194 } … … 223 202 ((void)((*___dst__R4sFdl_1).__f7__i_1=__f7__i_1) /* ?{} */); 224 203 ((void)((*___dst__R4sFdl_1).__f8__i_1=__f8__i_1) /* ?{} */); 225 ((void)((*___dst__R4sFdl_1).__anonymous_object0) /* ?{} */); 226 ((void)((*___dst__R4sFdl_1).__f9__Pi_1) /* ?{} */); 227 } 228 static inline void ___constructor__F_R4sFdliiiiiiiii_autogen___1(struct Fdl *___dst__R4sFdl_1, signed int __f1__i_1, signed int __f2__i_1, signed int __f3__i_1, signed int __f4__i_1, signed int __f5__i_1, signed int __f6__i_1, signed int __f7__i_1, signed int __f8__i_1, signed int __anonymous_object3){ 204 ((void)((*___dst__R4sFdl_1).__f9__Pi_1) /* ?{} */); 205 } 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){ 229 207 ((void)((*___dst__R4sFdl_1).__f1__i_1=__f1__i_1) /* ?{} */); 230 208 ((void)((*___dst__R4sFdl_1).__f2__i_1=__f2__i_1) /* ?{} */); … … 235 213 ((void)((*___dst__R4sFdl_1).__f7__i_1=__f7__i_1) /* ?{} */); 236 214 ((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) /* ?{} */);250 215 ((void)((*___dst__R4sFdl_1).__f9__Pi_1=__f9__Pi_1) /* ?{} */); 251 216 } … … 267 232 __attribute__ ((unused)) signed int **const ___retval_f2__CPPi_1; 268 233 } 269 __attribute__ ((unused,used,unused)) signed int (*__f3__FPA0i_i__1(signed int __anonymous_object 5))[];234 __attribute__ ((unused,used,unused)) signed int (*__f3__FPA0i_i__1(signed int __anonymous_object1))[]; 270 235 __attribute__ ((unused,unused)) signed int (*__f3__FPA0i_i__1(signed int __p__i_1))[]{ 271 236 __attribute__ ((unused)) signed int (*___retval_f3__PA0i_1)[]; 272 237 } 273 __attribute__ ((unused,used,unused)) signed int (*__f4__FPFi_i____1())(signed int __anonymous_object 6);274 __attribute__ ((unused,unused)) signed int (*__f4__FPFi_i____1())(signed int __anonymous_object 7){275 __attribute__ ((unused)) signed int (*___retval_f4__PFi_i__1)(signed int __anonymous_object 8);238 __attribute__ ((unused,used,unused)) signed int (*__f4__FPFi_i____1())(signed int __anonymous_object2); 239 __attribute__ ((unused,unused)) signed int (*__f4__FPFi_i____1())(signed int __anonymous_object3){ 240 __attribute__ ((unused)) signed int (*___retval_f4__PFi_i__1)(signed int __anonymous_object4); 276 241 } 277 242 signed int __vtr__Fi___1(){ … … 303 268 signed int __tpr2__Fi_PPi__1(__attribute__ ((unused,unused,unused,unused,unused,unused)) signed int **__Foo__PPi_1); 304 269 signed int __tpr3__Fi_Pi__1(__attribute__ ((unused,unused,unused)) signed int *__Foo__Pi_1); 305 signed int __tpr4__Fi_PFi_Pi___1(__attribute__ ((unused,unused)) signed int (*__anonymous_object 9)(__attribute__ ((unused,unused)) signed int __anonymous_object10[((unsigned int )5)]));270 signed int __tpr4__Fi_PFi_Pi___1(__attribute__ ((unused,unused)) signed int (*__anonymous_object5)(__attribute__ ((unused,unused)) signed int __anonymous_object6[((unsigned int )5)])); 306 271 signed int __tpr5__Fi_PFi____1(__attribute__ ((unused,unused,unused)) signed int (*__Foo__PFi___1)()); 307 272 signed int __tpr6__Fi_PFi____1(__attribute__ ((unused,unused,unused)) signed int (*__Foo__PFi___1)()); 308 signed int __tpr7__Fi_PFi_PFi_i____1(__attribute__ ((unused,unused)) signed int (*__anonymous_object 11)(__attribute__ ((unused)) signed int (*__anonymous_object12)(__attribute__ ((unused,unused)) signed int __anonymous_object13)));273 signed int __tpr7__Fi_PFi_PFi_i____1(__attribute__ ((unused,unused)) signed int (*__anonymous_object7)(__attribute__ ((unused)) signed int (*__anonymous_object8)(__attribute__ ((unused,unused)) signed int __anonymous_object9))); 309 274 signed int __ad__Fi___1(){ 310 275 __attribute__ ((unused)) signed int ___retval_ad__i_1; … … 335 300 struct __anonymous4 ___ret__13s__anonymous4_2; 336 301 ((void)((*___dst__R13s__anonymous4_2).__i__i_2=___src__13s__anonymous4_2.__i__i_2)); 337 ((void)___constructor__F_R13s__anonymous413s__anonymous4_autogen___2((&___ret__13s__anonymous4_2), (*___dst__R13s__anonymous4_2)));338 return ___ret__13s__anonymous4_2;302 ((void)___constructor__F_R13s__anonymous413s__anonymous4_autogen___2((&___ret__13s__anonymous4_2), ___src__13s__anonymous4_2)); 303 return ((struct __anonymous4 )___ret__13s__anonymous4_2); 339 304 } 340 305 inline void ___constructor__F_R13s__anonymous4i_autogen___2(struct __anonymous4 *___dst__R13s__anonymous4_2, signed int __i__i_2){ … … 348 313 } 349 314 inline void ___constructor__F_R13e__anonymous513e__anonymous5_intrinsic___2(enum __anonymous5 *___dst__R13e__anonymous5_2, enum __anonymous5 ___src__13e__anonymous5_2){ 350 ((void)((*___dst__R13e__anonymous5_2)=___src__13e__anonymous5_2) /* ?{} */);315 ((void)((*___dst__R13e__anonymous5_2)=___src__13e__anonymous5_2)); 351 316 } 352 317 inline void ___destructor__F_R13e__anonymous5_intrinsic___2(__attribute__ ((unused)) enum __anonymous5 *___dst__R13e__anonymous5_2){ … … 354 319 inline enum __anonymous5 ___operator_assign__F13e__anonymous5_R13e__anonymous513e__anonymous5_intrinsic___2(enum __anonymous5 *___dst__R13e__anonymous5_2, enum __anonymous5 ___src__13e__anonymous5_2){ 355 320 enum __anonymous5 ___ret__13e__anonymous5_2; 356 ((void)((*___dst__R13e__anonymous5_2)=___src__13e__anonymous5_2)); 357 ((void)(___ret__13e__anonymous5_2=(*___dst__R13e__anonymous5_2)) /* ?{} */); 358 return ___ret__13e__anonymous5_2; 321 ((void)(___ret__13e__anonymous5_2=((*___dst__R13e__anonymous5_2)=___src__13e__anonymous5_2)) /* ?{} */); 322 return ((enum __anonymous5 )___ret__13e__anonymous5_2); 359 323 } 360 324 ((void)sizeof(enum __anonymous5 )); 361 325 } 362 signed int __apd1__Fi_PiPi__1(__attribute__ ((unused,unused,unused)) signed int *__anonymous_object1 4, __attribute__ ((unused,unused,unused)) signed int *__anonymous_object15);363 signed int __apd2__Fi_PPiPPi__1(__attribute__ ((unused,unused,unused,unused)) signed int **__anonymous_object1 6, __attribute__ ((unused,unused,unused,unused)) signed int **__anonymous_object17);364 signed int __apd3__Fi_PiPi__1(__attribute__ ((unused,unused,unused)) signed int *__anonymous_object1 8, __attribute__ ((unused,unused,unused)) signed int *__anonymous_object19);365 signed int __apd4__Fi_PFi__PFi____1(__attribute__ ((unused,unused,unused)) signed int (*__anonymous_object 20)(), __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_object 22)(__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_object2 6)(), __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_object2 8)(__attribute__ ((unused)) signed int __anonymous_object29), __attribute__ ((unused,unused,unused)) signed int (*__anonymous_object30)(__attribute__ ((unused)) signed int __anonymous_object31));326 signed int __apd1__Fi_PiPi__1(__attribute__ ((unused,unused,unused)) signed int *__anonymous_object10, __attribute__ ((unused,unused,unused)) signed int *__anonymous_object11); 327 signed int __apd2__Fi_PPiPPi__1(__attribute__ ((unused,unused,unused,unused)) signed int **__anonymous_object12, __attribute__ ((unused,unused,unused,unused)) signed int **__anonymous_object13); 328 signed int __apd3__Fi_PiPi__1(__attribute__ ((unused,unused,unused)) signed int *__anonymous_object14, __attribute__ ((unused,unused,unused)) signed int *__anonymous_object15); 329 signed int __apd4__Fi_PFi__PFi____1(__attribute__ ((unused,unused,unused)) signed int (*__anonymous_object16)(), __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_object18)(__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_object22)(), __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_object24)(__attribute__ ((unused)) signed int __anonymous_object25), __attribute__ ((unused,unused,unused)) signed int (*__anonymous_object26)(__attribute__ ((unused)) signed int __anonymous_object27)); 369 333 struct Vad { 370 __attribute__ ((unused)) signed int __anonymous_object 32;371 __attribute__ ((unused,unused)) signed int *__anonymous_object 33;372 __attribute__ ((unused,unused)) signed int __anonymous_object3 4[((unsigned int )10)];373 __attribute__ ((unused,unused)) signed int (*__anonymous_object3 5)();334 __attribute__ ((unused)) signed int __anonymous_object28; 335 __attribute__ ((unused,unused)) signed int *__anonymous_object29; 336 __attribute__ ((unused,unused)) signed int __anonymous_object30[((unsigned int )10)]; 337 __attribute__ ((unused,unused)) signed int (*__anonymous_object31)(); 374 338 }; 375 339 static inline void ___constructor__F_R4sVad_autogen___1(struct Vad *___dst__R4sVad_1); … … 377 341 static inline void ___destructor__F_R4sVad_autogen___1(struct Vad *___dst__R4sVad_1); 378 342 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)());383 343 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) /* ?{} */);395 344 } 396 345 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) /* ?{} */);408 346 } 409 347 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) /* ^?{} */);421 348 } 422 349 static inline struct Vad ___operator_assign__F4sVad_R4sVad4sVad_autogen___1(struct Vad *___dst__R4sVad_1, struct Vad ___src__4sVad_1){ 423 350 struct Vad ___ret__4sVad_1; 424 ((void)((*___dst__R4sVad_1).__anonymous_object32=___src__4sVad_1.__anonymous_object32)); 425 ((void)((*___dst__R4sVad_1).__anonymous_object33=___src__4sVad_1.__anonymous_object33)); 426 { 427 signed int _index3 = 0; 428 for (;(_index3<10);((void)(++_index3))) { 429 ((void)((*___dst__R4sVad_1).__anonymous_object34[_index3]=___src__4sVad_1.__anonymous_object34[_index3])); 430 } 431 432 } 433 434 ((void)((*___dst__R4sVad_1).__anonymous_object35=___src__4sVad_1.__anonymous_object35)); 435 ((void)___constructor__F_R4sVad4sVad_autogen___1((&___ret__4sVad_1), (*___dst__R4sVad_1))); 436 return ___ret__4sVad_1; 437 } 438 static inline void ___constructor__F_R4sVadi_autogen___1(struct Vad *___dst__R4sVad_1, signed int __anonymous_object46){ 439 ((void)((*___dst__R4sVad_1).__anonymous_object32=__anonymous_object46) /* ?{} */); 440 ((void)((*___dst__R4sVad_1).__anonymous_object33) /* ?{} */); 441 { 442 signed int _index4 = 0; 443 for (;(_index4<10);((void)(++_index4))) { 444 ((void)((*((signed int *)(&(*___dst__R4sVad_1).__anonymous_object34[_index4])))) /* ?{} */); 445 } 446 447 } 448 449 ((void)((*___dst__R4sVad_1).__anonymous_object35) /* ?{} */); 450 } 451 static inline void ___constructor__F_R4sVadiPi_autogen___1(struct Vad *___dst__R4sVad_1, signed int __anonymous_object47, signed int *__anonymous_object48){ 452 ((void)((*___dst__R4sVad_1).__anonymous_object32=__anonymous_object47) /* ?{} */); 453 ((void)((*___dst__R4sVad_1).__anonymous_object33=__anonymous_object48) /* ?{} */); 454 { 455 signed int _index5 = 0; 456 for (;(_index5<10);((void)(++_index5))) { 457 ((void)((*((signed int *)(&(*___dst__R4sVad_1).__anonymous_object34[_index5])))) /* ?{} */); 458 } 459 460 } 461 462 ((void)((*___dst__R4sVad_1).__anonymous_object35) /* ?{} */); 463 } 464 static inline void ___constructor__F_R4sVadiPiA0i_autogen___1(struct Vad *___dst__R4sVad_1, signed int __anonymous_object49, signed int *__anonymous_object50, signed int __anonymous_object51[((unsigned int )10)]){ 465 ((void)((*___dst__R4sVad_1).__anonymous_object32=__anonymous_object49) /* ?{} */); 466 ((void)((*___dst__R4sVad_1).__anonymous_object33=__anonymous_object50) /* ?{} */); 467 { 468 signed int _index6 = 0; 469 for (;(_index6<10);((void)(++_index6))) { 470 ((void)((*((signed int *)(&(*___dst__R4sVad_1).__anonymous_object34[_index6])))=__anonymous_object51[_index6]) /* ?{} */); 471 } 472 473 } 474 475 ((void)((*___dst__R4sVad_1).__anonymous_object35) /* ?{} */); 476 } 477 static inline void ___constructor__F_R4sVadiPiA0iPFi___autogen___1(struct Vad *___dst__R4sVad_1, signed int __anonymous_object52, signed int *__anonymous_object53, signed int __anonymous_object54[((unsigned int )10)], signed int (*__anonymous_object55)()){ 478 ((void)((*___dst__R4sVad_1).__anonymous_object32=__anonymous_object52) /* ?{} */); 479 ((void)((*___dst__R4sVad_1).__anonymous_object33=__anonymous_object53) /* ?{} */); 480 { 481 signed int _index7 = 0; 482 for (;(_index7<10);((void)(++_index7))) { 483 ((void)((*((signed int *)(&(*___dst__R4sVad_1).__anonymous_object34[_index7])))=__anonymous_object54[_index7]) /* ?{} */); 484 } 485 486 } 487 488 ((void)((*___dst__R4sVad_1).__anonymous_object35=__anonymous_object55) /* ?{} */); 489 } 351 ((void)___constructor__F_R4sVad4sVad_autogen___1((&___ret__4sVad_1), ___src__4sVad_1)); 352 return ((struct Vad )___ret__4sVad_1); 353 } -
src/tests/.expect/32/declarationSpecifier.txt
r3f7e12cb r78315272 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);23 22 static inline void ___constructor__F_R13s__anonymous0_autogen___1(struct __anonymous0 *___dst__R13s__anonymous0_1){ 24 23 ((void)((*___dst__R13s__anonymous0_1).__i__i_1) /* ?{} */); … … 33 32 struct __anonymous0 ___ret__13s__anonymous0_1; 34 33 ((void)((*___dst__R13s__anonymous0_1).__i__i_1=___src__13s__anonymous0_1.__i__i_1)); 35 ((void)___constructor__F_R13s__anonymous013s__anonymous0_autogen___1((&___ret__13s__anonymous0_1), (*___dst__R13s__anonymous0_1)));36 return ___ret__13s__anonymous0_1;34 ((void)___constructor__F_R13s__anonymous013s__anonymous0_autogen___1((&___ret__13s__anonymous0_1), ___src__13s__anonymous0_1)); 35 return ((struct __anonymous0 )___ret__13s__anonymous0_1); 37 36 } 38 37 static inline void ___constructor__F_R13s__anonymous0i_autogen___1(struct __anonymous0 *___dst__R13s__anonymous0_1, signed int __i__i_1){ … … 47 46 static inline void ___destructor__F_R13s__anonymous1_autogen___1(struct __anonymous1 *___dst__R13s__anonymous1_1); 48 47 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);50 48 static inline void ___constructor__F_R13s__anonymous1_autogen___1(struct __anonymous1 *___dst__R13s__anonymous1_1){ 51 49 ((void)((*___dst__R13s__anonymous1_1).__i__i_1) /* ?{} */); … … 60 58 struct __anonymous1 ___ret__13s__anonymous1_1; 61 59 ((void)((*___dst__R13s__anonymous1_1).__i__i_1=___src__13s__anonymous1_1.__i__i_1)); 62 ((void)___constructor__F_R13s__anonymous113s__anonymous1_autogen___1((&___ret__13s__anonymous1_1), (*___dst__R13s__anonymous1_1)));63 return ___ret__13s__anonymous1_1;60 ((void)___constructor__F_R13s__anonymous113s__anonymous1_autogen___1((&___ret__13s__anonymous1_1), ___src__13s__anonymous1_1)); 61 return ((struct __anonymous1 )___ret__13s__anonymous1_1); 64 62 } 65 63 static inline void ___constructor__F_R13s__anonymous1i_autogen___1(struct __anonymous1 *___dst__R13s__anonymous1_1, signed int __i__i_1){ … … 74 72 static inline void ___destructor__F_R13s__anonymous2_autogen___1(struct __anonymous2 *___dst__R13s__anonymous2_1); 75 73 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);77 74 static inline void ___constructor__F_R13s__anonymous2_autogen___1(struct __anonymous2 *___dst__R13s__anonymous2_1){ 78 75 ((void)((*___dst__R13s__anonymous2_1).__i__i_1) /* ?{} */); … … 87 84 struct __anonymous2 ___ret__13s__anonymous2_1; 88 85 ((void)((*___dst__R13s__anonymous2_1).__i__i_1=___src__13s__anonymous2_1.__i__i_1)); 89 ((void)___constructor__F_R13s__anonymous213s__anonymous2_autogen___1((&___ret__13s__anonymous2_1), (*___dst__R13s__anonymous2_1)));90 return ___ret__13s__anonymous2_1;86 ((void)___constructor__F_R13s__anonymous213s__anonymous2_autogen___1((&___ret__13s__anonymous2_1), ___src__13s__anonymous2_1)); 87 return ((struct __anonymous2 )___ret__13s__anonymous2_1); 91 88 } 92 89 static inline void ___constructor__F_R13s__anonymous2i_autogen___1(struct __anonymous2 *___dst__R13s__anonymous2_1, signed int __i__i_1){ … … 101 98 static inline void ___destructor__F_R13s__anonymous3_autogen___1(struct __anonymous3 *___dst__R13s__anonymous3_1); 102 99 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);104 100 static inline void ___constructor__F_R13s__anonymous3_autogen___1(struct __anonymous3 *___dst__R13s__anonymous3_1){ 105 101 ((void)((*___dst__R13s__anonymous3_1).__i__i_1) /* ?{} */); … … 114 110 struct __anonymous3 ___ret__13s__anonymous3_1; 115 111 ((void)((*___dst__R13s__anonymous3_1).__i__i_1=___src__13s__anonymous3_1.__i__i_1)); 116 ((void)___constructor__F_R13s__anonymous313s__anonymous3_autogen___1((&___ret__13s__anonymous3_1), (*___dst__R13s__anonymous3_1)));117 return ___ret__13s__anonymous3_1;112 ((void)___constructor__F_R13s__anonymous313s__anonymous3_autogen___1((&___ret__13s__anonymous3_1), ___src__13s__anonymous3_1)); 113 return ((struct __anonymous3 )___ret__13s__anonymous3_1); 118 114 } 119 115 static inline void ___constructor__F_R13s__anonymous3i_autogen___1(struct __anonymous3 *___dst__R13s__anonymous3_1, signed int __i__i_1){ … … 128 124 static inline void ___destructor__F_R13s__anonymous4_autogen___1(struct __anonymous4 *___dst__R13s__anonymous4_1); 129 125 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);131 126 static inline void ___constructor__F_R13s__anonymous4_autogen___1(struct __anonymous4 *___dst__R13s__anonymous4_1){ 132 127 ((void)((*___dst__R13s__anonymous4_1).__i__i_1) /* ?{} */); … … 141 136 struct __anonymous4 ___ret__13s__anonymous4_1; 142 137 ((void)((*___dst__R13s__anonymous4_1).__i__i_1=___src__13s__anonymous4_1.__i__i_1)); 143 ((void)___constructor__F_R13s__anonymous413s__anonymous4_autogen___1((&___ret__13s__anonymous4_1), (*___dst__R13s__anonymous4_1)));144 return ___ret__13s__anonymous4_1;138 ((void)___constructor__F_R13s__anonymous413s__anonymous4_autogen___1((&___ret__13s__anonymous4_1), ___src__13s__anonymous4_1)); 139 return ((struct __anonymous4 )___ret__13s__anonymous4_1); 145 140 } 146 141 static inline void ___constructor__F_R13s__anonymous4i_autogen___1(struct __anonymous4 *___dst__R13s__anonymous4_1, signed int __i__i_1){ … … 155 150 static inline void ___destructor__F_R13s__anonymous5_autogen___1(struct __anonymous5 *___dst__R13s__anonymous5_1); 156 151 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);158 152 static inline void ___constructor__F_R13s__anonymous5_autogen___1(struct __anonymous5 *___dst__R13s__anonymous5_1){ 159 153 ((void)((*___dst__R13s__anonymous5_1).__i__i_1) /* ?{} */); … … 168 162 struct __anonymous5 ___ret__13s__anonymous5_1; 169 163 ((void)((*___dst__R13s__anonymous5_1).__i__i_1=___src__13s__anonymous5_1.__i__i_1)); 170 ((void)___constructor__F_R13s__anonymous513s__anonymous5_autogen___1((&___ret__13s__anonymous5_1), (*___dst__R13s__anonymous5_1)));171 return ___ret__13s__anonymous5_1;164 ((void)___constructor__F_R13s__anonymous513s__anonymous5_autogen___1((&___ret__13s__anonymous5_1), ___src__13s__anonymous5_1)); 165 return ((struct __anonymous5 )___ret__13s__anonymous5_1); 172 166 } 173 167 static inline void ___constructor__F_R13s__anonymous5i_autogen___1(struct __anonymous5 *___dst__R13s__anonymous5_1, signed int __i__i_1){ … … 182 176 static inline void ___destructor__F_R13s__anonymous6_autogen___1(struct __anonymous6 *___dst__R13s__anonymous6_1); 183 177 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);185 178 static inline void ___constructor__F_R13s__anonymous6_autogen___1(struct __anonymous6 *___dst__R13s__anonymous6_1){ 186 179 ((void)((*___dst__R13s__anonymous6_1).__i__i_1) /* ?{} */); … … 195 188 struct __anonymous6 ___ret__13s__anonymous6_1; 196 189 ((void)((*___dst__R13s__anonymous6_1).__i__i_1=___src__13s__anonymous6_1.__i__i_1)); 197 ((void)___constructor__F_R13s__anonymous613s__anonymous6_autogen___1((&___ret__13s__anonymous6_1), (*___dst__R13s__anonymous6_1)));198 return ___ret__13s__anonymous6_1;190 ((void)___constructor__F_R13s__anonymous613s__anonymous6_autogen___1((&___ret__13s__anonymous6_1), ___src__13s__anonymous6_1)); 191 return ((struct __anonymous6 )___ret__13s__anonymous6_1); 199 192 } 200 193 static inline void ___constructor__F_R13s__anonymous6i_autogen___1(struct __anonymous6 *___dst__R13s__anonymous6_1, signed int __i__i_1){ … … 209 202 static inline void ___destructor__F_R13s__anonymous7_autogen___1(struct __anonymous7 *___dst__R13s__anonymous7_1); 210 203 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);212 204 static inline void ___constructor__F_R13s__anonymous7_autogen___1(struct __anonymous7 *___dst__R13s__anonymous7_1){ 213 205 ((void)((*___dst__R13s__anonymous7_1).__i__i_1) /* ?{} */); … … 222 214 struct __anonymous7 ___ret__13s__anonymous7_1; 223 215 ((void)((*___dst__R13s__anonymous7_1).__i__i_1=___src__13s__anonymous7_1.__i__i_1)); 224 ((void)___constructor__F_R13s__anonymous713s__anonymous7_autogen___1((&___ret__13s__anonymous7_1), (*___dst__R13s__anonymous7_1)));225 return ___ret__13s__anonymous7_1;216 ((void)___constructor__F_R13s__anonymous713s__anonymous7_autogen___1((&___ret__13s__anonymous7_1), ___src__13s__anonymous7_1)); 217 return ((struct __anonymous7 )___ret__13s__anonymous7_1); 226 218 } 227 219 static inline void ___constructor__F_R13s__anonymous7i_autogen___1(struct __anonymous7 *___dst__R13s__anonymous7_1, signed int __i__i_1){ … … 244 236 static inline void ___destructor__F_R13s__anonymous8_autogen___1(struct __anonymous8 *___dst__R13s__anonymous8_1); 245 237 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);247 238 static inline void ___constructor__F_R13s__anonymous8_autogen___1(struct __anonymous8 *___dst__R13s__anonymous8_1){ 248 239 ((void)((*___dst__R13s__anonymous8_1).__i__s_1) /* ?{} */); … … 257 248 struct __anonymous8 ___ret__13s__anonymous8_1; 258 249 ((void)((*___dst__R13s__anonymous8_1).__i__s_1=___src__13s__anonymous8_1.__i__s_1)); 259 ((void)___constructor__F_R13s__anonymous813s__anonymous8_autogen___1((&___ret__13s__anonymous8_1), (*___dst__R13s__anonymous8_1)));260 return ___ret__13s__anonymous8_1;250 ((void)___constructor__F_R13s__anonymous813s__anonymous8_autogen___1((&___ret__13s__anonymous8_1), ___src__13s__anonymous8_1)); 251 return ((struct __anonymous8 )___ret__13s__anonymous8_1); 261 252 } 262 253 static inline void ___constructor__F_R13s__anonymous8s_autogen___1(struct __anonymous8 *___dst__R13s__anonymous8_1, signed short int __i__s_1){ … … 271 262 static inline void ___destructor__F_R13s__anonymous9_autogen___1(struct __anonymous9 *___dst__R13s__anonymous9_1); 272 263 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);274 264 static inline void ___constructor__F_R13s__anonymous9_autogen___1(struct __anonymous9 *___dst__R13s__anonymous9_1){ 275 265 ((void)((*___dst__R13s__anonymous9_1).__i__s_1) /* ?{} */); … … 284 274 struct __anonymous9 ___ret__13s__anonymous9_1; 285 275 ((void)((*___dst__R13s__anonymous9_1).__i__s_1=___src__13s__anonymous9_1.__i__s_1)); 286 ((void)___constructor__F_R13s__anonymous913s__anonymous9_autogen___1((&___ret__13s__anonymous9_1), (*___dst__R13s__anonymous9_1)));287 return ___ret__13s__anonymous9_1;276 ((void)___constructor__F_R13s__anonymous913s__anonymous9_autogen___1((&___ret__13s__anonymous9_1), ___src__13s__anonymous9_1)); 277 return ((struct __anonymous9 )___ret__13s__anonymous9_1); 288 278 } 289 279 static inline void ___constructor__F_R13s__anonymous9s_autogen___1(struct __anonymous9 *___dst__R13s__anonymous9_1, signed short int __i__s_1){ … … 298 288 static inline void ___destructor__F_R14s__anonymous10_autogen___1(struct __anonymous10 *___dst__R14s__anonymous10_1); 299 289 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);301 290 static inline void ___constructor__F_R14s__anonymous10_autogen___1(struct __anonymous10 *___dst__R14s__anonymous10_1){ 302 291 ((void)((*___dst__R14s__anonymous10_1).__i__s_1) /* ?{} */); … … 311 300 struct __anonymous10 ___ret__14s__anonymous10_1; 312 301 ((void)((*___dst__R14s__anonymous10_1).__i__s_1=___src__14s__anonymous10_1.__i__s_1)); 313 ((void)___constructor__F_R14s__anonymous1014s__anonymous10_autogen___1((&___ret__14s__anonymous10_1), (*___dst__R14s__anonymous10_1)));314 return ___ret__14s__anonymous10_1;302 ((void)___constructor__F_R14s__anonymous1014s__anonymous10_autogen___1((&___ret__14s__anonymous10_1), ___src__14s__anonymous10_1)); 303 return ((struct __anonymous10 )___ret__14s__anonymous10_1); 315 304 } 316 305 static inline void ___constructor__F_R14s__anonymous10s_autogen___1(struct __anonymous10 *___dst__R14s__anonymous10_1, signed short int __i__s_1){ … … 325 314 static inline void ___destructor__F_R14s__anonymous11_autogen___1(struct __anonymous11 *___dst__R14s__anonymous11_1); 326 315 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);328 316 static inline void ___constructor__F_R14s__anonymous11_autogen___1(struct __anonymous11 *___dst__R14s__anonymous11_1){ 329 317 ((void)((*___dst__R14s__anonymous11_1).__i__s_1) /* ?{} */); … … 338 326 struct __anonymous11 ___ret__14s__anonymous11_1; 339 327 ((void)((*___dst__R14s__anonymous11_1).__i__s_1=___src__14s__anonymous11_1.__i__s_1)); 340 ((void)___constructor__F_R14s__anonymous1114s__anonymous11_autogen___1((&___ret__14s__anonymous11_1), (*___dst__R14s__anonymous11_1)));341 return ___ret__14s__anonymous11_1;328 ((void)___constructor__F_R14s__anonymous1114s__anonymous11_autogen___1((&___ret__14s__anonymous11_1), ___src__14s__anonymous11_1)); 329 return ((struct __anonymous11 )___ret__14s__anonymous11_1); 342 330 } 343 331 static inline void ___constructor__F_R14s__anonymous11s_autogen___1(struct __anonymous11 *___dst__R14s__anonymous11_1, signed short int __i__s_1){ … … 352 340 static inline void ___destructor__F_R14s__anonymous12_autogen___1(struct __anonymous12 *___dst__R14s__anonymous12_1); 353 341 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);355 342 static inline void ___constructor__F_R14s__anonymous12_autogen___1(struct __anonymous12 *___dst__R14s__anonymous12_1){ 356 343 ((void)((*___dst__R14s__anonymous12_1).__i__s_1) /* ?{} */); … … 365 352 struct __anonymous12 ___ret__14s__anonymous12_1; 366 353 ((void)((*___dst__R14s__anonymous12_1).__i__s_1=___src__14s__anonymous12_1.__i__s_1)); 367 ((void)___constructor__F_R14s__anonymous1214s__anonymous12_autogen___1((&___ret__14s__anonymous12_1), (*___dst__R14s__anonymous12_1)));368 return ___ret__14s__anonymous12_1;354 ((void)___constructor__F_R14s__anonymous1214s__anonymous12_autogen___1((&___ret__14s__anonymous12_1), ___src__14s__anonymous12_1)); 355 return ((struct __anonymous12 )___ret__14s__anonymous12_1); 369 356 } 370 357 static inline void ___constructor__F_R14s__anonymous12s_autogen___1(struct __anonymous12 *___dst__R14s__anonymous12_1, signed short int __i__s_1){ … … 379 366 static inline void ___destructor__F_R14s__anonymous13_autogen___1(struct __anonymous13 *___dst__R14s__anonymous13_1); 380 367 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);382 368 static inline void ___constructor__F_R14s__anonymous13_autogen___1(struct __anonymous13 *___dst__R14s__anonymous13_1){ 383 369 ((void)((*___dst__R14s__anonymous13_1).__i__s_1) /* ?{} */); … … 392 378 struct __anonymous13 ___ret__14s__anonymous13_1; 393 379 ((void)((*___dst__R14s__anonymous13_1).__i__s_1=___src__14s__anonymous13_1.__i__s_1)); 394 ((void)___constructor__F_R14s__anonymous1314s__anonymous13_autogen___1((&___ret__14s__anonymous13_1), (*___dst__R14s__anonymous13_1)));395 return ___ret__14s__anonymous13_1;380 ((void)___constructor__F_R14s__anonymous1314s__anonymous13_autogen___1((&___ret__14s__anonymous13_1), ___src__14s__anonymous13_1)); 381 return ((struct __anonymous13 )___ret__14s__anonymous13_1); 396 382 } 397 383 static inline void ___constructor__F_R14s__anonymous13s_autogen___1(struct __anonymous13 *___dst__R14s__anonymous13_1, signed short int __i__s_1){ … … 406 392 static inline void ___destructor__F_R14s__anonymous14_autogen___1(struct __anonymous14 *___dst__R14s__anonymous14_1); 407 393 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);409 394 static inline void ___constructor__F_R14s__anonymous14_autogen___1(struct __anonymous14 *___dst__R14s__anonymous14_1){ 410 395 ((void)((*___dst__R14s__anonymous14_1).__i__s_1) /* ?{} */); … … 419 404 struct __anonymous14 ___ret__14s__anonymous14_1; 420 405 ((void)((*___dst__R14s__anonymous14_1).__i__s_1=___src__14s__anonymous14_1.__i__s_1)); 421 ((void)___constructor__F_R14s__anonymous1414s__anonymous14_autogen___1((&___ret__14s__anonymous14_1), (*___dst__R14s__anonymous14_1)));422 return ___ret__14s__anonymous14_1;406 ((void)___constructor__F_R14s__anonymous1414s__anonymous14_autogen___1((&___ret__14s__anonymous14_1), ___src__14s__anonymous14_1)); 407 return ((struct __anonymous14 )___ret__14s__anonymous14_1); 423 408 } 424 409 static inline void ___constructor__F_R14s__anonymous14s_autogen___1(struct __anonymous14 *___dst__R14s__anonymous14_1, signed short int __i__s_1){ … … 433 418 static inline void ___destructor__F_R14s__anonymous15_autogen___1(struct __anonymous15 *___dst__R14s__anonymous15_1); 434 419 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);436 420 static inline void ___constructor__F_R14s__anonymous15_autogen___1(struct __anonymous15 *___dst__R14s__anonymous15_1){ 437 421 ((void)((*___dst__R14s__anonymous15_1).__i__s_1) /* ?{} */); … … 446 430 struct __anonymous15 ___ret__14s__anonymous15_1; 447 431 ((void)((*___dst__R14s__anonymous15_1).__i__s_1=___src__14s__anonymous15_1.__i__s_1)); 448 ((void)___constructor__F_R14s__anonymous1514s__anonymous15_autogen___1((&___ret__14s__anonymous15_1), (*___dst__R14s__anonymous15_1)));449 return ___ret__14s__anonymous15_1;432 ((void)___constructor__F_R14s__anonymous1514s__anonymous15_autogen___1((&___ret__14s__anonymous15_1), ___src__14s__anonymous15_1)); 433 return ((struct __anonymous15 )___ret__14s__anonymous15_1); 450 434 } 451 435 static inline void ___constructor__F_R14s__anonymous15s_autogen___1(struct __anonymous15 *___dst__R14s__anonymous15_1, signed short int __i__s_1){ … … 476 460 static inline void ___destructor__F_R14s__anonymous16_autogen___1(struct __anonymous16 *___dst__R14s__anonymous16_1); 477 461 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);479 462 static inline void ___constructor__F_R14s__anonymous16_autogen___1(struct __anonymous16 *___dst__R14s__anonymous16_1){ 480 463 ((void)((*___dst__R14s__anonymous16_1).__i__i_1) /* ?{} */); … … 489 472 struct __anonymous16 ___ret__14s__anonymous16_1; 490 473 ((void)((*___dst__R14s__anonymous16_1).__i__i_1=___src__14s__anonymous16_1.__i__i_1)); 491 ((void)___constructor__F_R14s__anonymous1614s__anonymous16_autogen___1((&___ret__14s__anonymous16_1), (*___dst__R14s__anonymous16_1)));492 return ___ret__14s__anonymous16_1;474 ((void)___constructor__F_R14s__anonymous1614s__anonymous16_autogen___1((&___ret__14s__anonymous16_1), ___src__14s__anonymous16_1)); 475 return ((struct __anonymous16 )___ret__14s__anonymous16_1); 493 476 } 494 477 static inline void ___constructor__F_R14s__anonymous16i_autogen___1(struct __anonymous16 *___dst__R14s__anonymous16_1, signed int __i__i_1){ … … 503 486 static inline void ___destructor__F_R14s__anonymous17_autogen___1(struct __anonymous17 *___dst__R14s__anonymous17_1); 504 487 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);506 488 static inline void ___constructor__F_R14s__anonymous17_autogen___1(struct __anonymous17 *___dst__R14s__anonymous17_1){ 507 489 ((void)((*___dst__R14s__anonymous17_1).__i__i_1) /* ?{} */); … … 516 498 struct __anonymous17 ___ret__14s__anonymous17_1; 517 499 ((void)((*___dst__R14s__anonymous17_1).__i__i_1=___src__14s__anonymous17_1.__i__i_1)); 518 ((void)___constructor__F_R14s__anonymous1714s__anonymous17_autogen___1((&___ret__14s__anonymous17_1), (*___dst__R14s__anonymous17_1)));519 return ___ret__14s__anonymous17_1;500 ((void)___constructor__F_R14s__anonymous1714s__anonymous17_autogen___1((&___ret__14s__anonymous17_1), ___src__14s__anonymous17_1)); 501 return ((struct __anonymous17 )___ret__14s__anonymous17_1); 520 502 } 521 503 static inline void ___constructor__F_R14s__anonymous17i_autogen___1(struct __anonymous17 *___dst__R14s__anonymous17_1, signed int __i__i_1){ … … 530 512 static inline void ___destructor__F_R14s__anonymous18_autogen___1(struct __anonymous18 *___dst__R14s__anonymous18_1); 531 513 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);533 514 static inline void ___constructor__F_R14s__anonymous18_autogen___1(struct __anonymous18 *___dst__R14s__anonymous18_1){ 534 515 ((void)((*___dst__R14s__anonymous18_1).__i__i_1) /* ?{} */); … … 543 524 struct __anonymous18 ___ret__14s__anonymous18_1; 544 525 ((void)((*___dst__R14s__anonymous18_1).__i__i_1=___src__14s__anonymous18_1.__i__i_1)); 545 ((void)___constructor__F_R14s__anonymous1814s__anonymous18_autogen___1((&___ret__14s__anonymous18_1), (*___dst__R14s__anonymous18_1)));546 return ___ret__14s__anonymous18_1;526 ((void)___constructor__F_R14s__anonymous1814s__anonymous18_autogen___1((&___ret__14s__anonymous18_1), ___src__14s__anonymous18_1)); 527 return ((struct __anonymous18 )___ret__14s__anonymous18_1); 547 528 } 548 529 static inline void ___constructor__F_R14s__anonymous18i_autogen___1(struct __anonymous18 *___dst__R14s__anonymous18_1, signed int __i__i_1){ … … 557 538 static inline void ___destructor__F_R14s__anonymous19_autogen___1(struct __anonymous19 *___dst__R14s__anonymous19_1); 558 539 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);560 540 static inline void ___constructor__F_R14s__anonymous19_autogen___1(struct __anonymous19 *___dst__R14s__anonymous19_1){ 561 541 ((void)((*___dst__R14s__anonymous19_1).__i__i_1) /* ?{} */); … … 570 550 struct __anonymous19 ___ret__14s__anonymous19_1; 571 551 ((void)((*___dst__R14s__anonymous19_1).__i__i_1=___src__14s__anonymous19_1.__i__i_1)); 572 ((void)___constructor__F_R14s__anonymous1914s__anonymous19_autogen___1((&___ret__14s__anonymous19_1), (*___dst__R14s__anonymous19_1)));573 return ___ret__14s__anonymous19_1;552 ((void)___constructor__F_R14s__anonymous1914s__anonymous19_autogen___1((&___ret__14s__anonymous19_1), ___src__14s__anonymous19_1)); 553 return ((struct __anonymous19 )___ret__14s__anonymous19_1); 574 554 } 575 555 static inline void ___constructor__F_R14s__anonymous19i_autogen___1(struct __anonymous19 *___dst__R14s__anonymous19_1, signed int __i__i_1){ … … 584 564 static inline void ___destructor__F_R14s__anonymous20_autogen___1(struct __anonymous20 *___dst__R14s__anonymous20_1); 585 565 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);587 566 static inline void ___constructor__F_R14s__anonymous20_autogen___1(struct __anonymous20 *___dst__R14s__anonymous20_1){ 588 567 ((void)((*___dst__R14s__anonymous20_1).__i__i_1) /* ?{} */); … … 597 576 struct __anonymous20 ___ret__14s__anonymous20_1; 598 577 ((void)((*___dst__R14s__anonymous20_1).__i__i_1=___src__14s__anonymous20_1.__i__i_1)); 599 ((void)___constructor__F_R14s__anonymous2014s__anonymous20_autogen___1((&___ret__14s__anonymous20_1), (*___dst__R14s__anonymous20_1)));600 return ___ret__14s__anonymous20_1;578 ((void)___constructor__F_R14s__anonymous2014s__anonymous20_autogen___1((&___ret__14s__anonymous20_1), ___src__14s__anonymous20_1)); 579 return ((struct __anonymous20 )___ret__14s__anonymous20_1); 601 580 } 602 581 static inline void ___constructor__F_R14s__anonymous20i_autogen___1(struct __anonymous20 *___dst__R14s__anonymous20_1, signed int __i__i_1){ … … 611 590 static inline void ___destructor__F_R14s__anonymous21_autogen___1(struct __anonymous21 *___dst__R14s__anonymous21_1); 612 591 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);614 592 static inline void ___constructor__F_R14s__anonymous21_autogen___1(struct __anonymous21 *___dst__R14s__anonymous21_1){ 615 593 ((void)((*___dst__R14s__anonymous21_1).__i__i_1) /* ?{} */); … … 624 602 struct __anonymous21 ___ret__14s__anonymous21_1; 625 603 ((void)((*___dst__R14s__anonymous21_1).__i__i_1=___src__14s__anonymous21_1.__i__i_1)); 626 ((void)___constructor__F_R14s__anonymous2114s__anonymous21_autogen___1((&___ret__14s__anonymous21_1), (*___dst__R14s__anonymous21_1)));627 return ___ret__14s__anonymous21_1;604 ((void)___constructor__F_R14s__anonymous2114s__anonymous21_autogen___1((&___ret__14s__anonymous21_1), ___src__14s__anonymous21_1)); 605 return ((struct __anonymous21 )___ret__14s__anonymous21_1); 628 606 } 629 607 static inline void ___constructor__F_R14s__anonymous21i_autogen___1(struct __anonymous21 *___dst__R14s__anonymous21_1, signed int __i__i_1){ … … 638 616 static inline void ___destructor__F_R14s__anonymous22_autogen___1(struct __anonymous22 *___dst__R14s__anonymous22_1); 639 617 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);641 618 static inline void ___constructor__F_R14s__anonymous22_autogen___1(struct __anonymous22 *___dst__R14s__anonymous22_1){ 642 619 ((void)((*___dst__R14s__anonymous22_1).__i__i_1) /* ?{} */); … … 651 628 struct __anonymous22 ___ret__14s__anonymous22_1; 652 629 ((void)((*___dst__R14s__anonymous22_1).__i__i_1=___src__14s__anonymous22_1.__i__i_1)); 653 ((void)___constructor__F_R14s__anonymous2214s__anonymous22_autogen___1((&___ret__14s__anonymous22_1), (*___dst__R14s__anonymous22_1)));654 return ___ret__14s__anonymous22_1;630 ((void)___constructor__F_R14s__anonymous2214s__anonymous22_autogen___1((&___ret__14s__anonymous22_1), ___src__14s__anonymous22_1)); 631 return ((struct __anonymous22 )___ret__14s__anonymous22_1); 655 632 } 656 633 static inline void ___constructor__F_R14s__anonymous22i_autogen___1(struct __anonymous22 *___dst__R14s__anonymous22_1, signed int __i__i_1){ … … 665 642 static inline void ___destructor__F_R14s__anonymous23_autogen___1(struct __anonymous23 *___dst__R14s__anonymous23_1); 666 643 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);668 644 static inline void ___constructor__F_R14s__anonymous23_autogen___1(struct __anonymous23 *___dst__R14s__anonymous23_1){ 669 645 ((void)((*___dst__R14s__anonymous23_1).__i__i_1) /* ?{} */); … … 678 654 struct __anonymous23 ___ret__14s__anonymous23_1; 679 655 ((void)((*___dst__R14s__anonymous23_1).__i__i_1=___src__14s__anonymous23_1.__i__i_1)); 680 ((void)___constructor__F_R14s__anonymous2314s__anonymous23_autogen___1((&___ret__14s__anonymous23_1), (*___dst__R14s__anonymous23_1)));681 return ___ret__14s__anonymous23_1;656 ((void)___constructor__F_R14s__anonymous2314s__anonymous23_autogen___1((&___ret__14s__anonymous23_1), ___src__14s__anonymous23_1)); 657 return ((struct __anonymous23 )___ret__14s__anonymous23_1); 682 658 } 683 659 static inline void ___constructor__F_R14s__anonymous23i_autogen___1(struct __anonymous23 *___dst__R14s__anonymous23_1, signed int __i__i_1){ … … 696 672 __attribute__ ((unused)) signed int ___retval_main__i_1; 697 673 ((void)(___retval_main__i_1=((signed int )0)) /* ?{} */); 698 return ___retval_main__i_1;674 return ((signed int )___retval_main__i_1); 699 675 ((void)(___retval_main__i_1=0) /* ?{} */); 700 return ___retval_main__i_1;676 return ((signed int )___retval_main__i_1); 701 677 } 702 678 static inline int invoke_main(int argc, char* argv[], char* envp[]) { (void)argc; (void)argv; (void)envp; return __main__Fi_iPPCc__1(argc, argv); } … … 713 689 ((void)(___retval_main__i_1=(((void)(_tmp_cp_ret0=invoke_main(__argc__i_1, __argv__PPc_1, __envp__PPc_1))) , _tmp_cp_ret0)) /* ?{} */); 714 690 ((void)(_tmp_cp_ret0) /* ^?{} */); 715 return ___retval_main__i_1;716 } 691 return ((signed int )___retval_main__i_1); 692 } -
src/tests/.expect/32/extension.txt
r3f7e12cb r78315272 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);22 19 static inline void ___constructor__F_R2sS_autogen___1(struct S *___dst__R2sS_1){ 23 20 ((void)((*___dst__R2sS_1).__a__i_1) /* ?{} */); … … 40 37 ((void)((*___dst__R2sS_1).__b__i_1=___src__2sS_1.__b__i_1)); 41 38 ((void)((*___dst__R2sS_1).__c__i_1=___src__2sS_1.__c__i_1)); 42 ((void)___constructor__F_R2sS2sS_autogen___1((&___ret__2sS_1), (*___dst__R2sS_1)));43 return ___ret__2sS_1;39 ((void)___constructor__F_R2sS2sS_autogen___1((&___ret__2sS_1), ___src__2sS_1)); 40 return ((struct S )___ret__2sS_1); 44 41 } 45 42 static inline void ___constructor__F_R2sSi_autogen___1(struct S *___dst__R2sS_1, signed int __a__i_1){ … … 63 60 __extension__ signed int __c__i_1; 64 61 }; 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);70 62 static inline void ___constructor__F_R2uU_autogen___1(__attribute__ ((unused)) union U *___dst__R2uU_1){ 71 63 } … … 78 70 union U ___ret__2uU_1; 79 71 ((void)__builtin_memcpy(((void *)___dst__R2uU_1), ((const void *)(&___src__2uU_1)), sizeof(union U ))); 80 ((void)___constructor__F_R2uU2uU_autogen___1((&___ret__2uU_1), (*___dst__R2uU_1)));81 return ___ret__2uU_1;72 ((void)___constructor__F_R2uU2uU_autogen___1((&___ret__2uU_1), ___src__2uU_1)); 73 return ((union U )___ret__2uU_1); 82 74 } 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 )));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 ))); 85 77 } 86 78 __extension__ enum E { … … 102 94 __extension__ signed int *__z__Pi_2; 103 95 }; 104 inline void ___constructor__F_R2sS_autogen___2(struct S *___dst__R2sS_2){ 105 ((void)((*___dst__R2sS_2).__a__i_2) /* ?{} */); 106 ((void)((*___dst__R2sS_2).__b__i_2) /* ?{} */); 107 ((void)((*___dst__R2sS_2).__c__i_2) /* ?{} */); 108 ((void)((*___dst__R2sS_2).__x__Pi_2) /* ?{} */); 109 ((void)((*___dst__R2sS_2).__y__Pi_2) /* ?{} */); 110 ((void)((*___dst__R2sS_2).__z__Pi_2) /* ?{} */); 111 } 112 inline void ___constructor__F_R2sS2sS_autogen___2(struct S *___dst__R2sS_2, struct S ___src__2sS_2){ 113 ((void)((*___dst__R2sS_2).__a__i_2=___src__2sS_2.__a__i_2) /* ?{} */); 114 ((void)((*___dst__R2sS_2).__b__i_2=___src__2sS_2.__b__i_2) /* ?{} */); 115 ((void)((*___dst__R2sS_2).__c__i_2=___src__2sS_2.__c__i_2) /* ?{} */); 116 ((void)((*___dst__R2sS_2).__x__Pi_2=___src__2sS_2.__x__Pi_2) /* ?{} */); 117 ((void)((*___dst__R2sS_2).__y__Pi_2=___src__2sS_2.__y__Pi_2) /* ?{} */); 118 ((void)((*___dst__R2sS_2).__z__Pi_2=___src__2sS_2.__z__Pi_2) /* ?{} */); 119 } 120 inline void ___destructor__F_R2sS_autogen___2(struct S *___dst__R2sS_2){ 121 ((void)((*___dst__R2sS_2).__z__Pi_2) /* ^?{} */); 122 ((void)((*___dst__R2sS_2).__y__Pi_2) /* ^?{} */); 123 ((void)((*___dst__R2sS_2).__x__Pi_2) /* ^?{} */); 124 ((void)((*___dst__R2sS_2).__c__i_2) /* ^?{} */); 125 ((void)((*___dst__R2sS_2).__b__i_2) /* ^?{} */); 126 ((void)((*___dst__R2sS_2).__a__i_2) /* ^?{} */); 127 } 128 inline struct S ___operator_assign__F2sS_R2sS2sS_autogen___2(struct S *___dst__R2sS_2, struct S ___src__2sS_2){ 129 struct S ___ret__2sS_2; 130 ((void)((*___dst__R2sS_2).__a__i_2=___src__2sS_2.__a__i_2)); 131 ((void)((*___dst__R2sS_2).__b__i_2=___src__2sS_2.__b__i_2)); 132 ((void)((*___dst__R2sS_2).__c__i_2=___src__2sS_2.__c__i_2)); 133 ((void)((*___dst__R2sS_2).__x__Pi_2=___src__2sS_2.__x__Pi_2)); 134 ((void)((*___dst__R2sS_2).__y__Pi_2=___src__2sS_2.__y__Pi_2)); 135 ((void)((*___dst__R2sS_2).__z__Pi_2=___src__2sS_2.__z__Pi_2)); 136 ((void)___constructor__F_R2sS2sS_autogen___2((&___ret__2sS_2), (*___dst__R2sS_2))); 137 return ___ret__2sS_2; 138 } 139 inline void ___constructor__F_R2sSi_autogen___2(struct S *___dst__R2sS_2, signed int __a__i_2){ 140 ((void)((*___dst__R2sS_2).__a__i_2=__a__i_2) /* ?{} */); 141 ((void)((*___dst__R2sS_2).__b__i_2) /* ?{} */); 142 ((void)((*___dst__R2sS_2).__c__i_2) /* ?{} */); 143 ((void)((*___dst__R2sS_2).__x__Pi_2) /* ?{} */); 144 ((void)((*___dst__R2sS_2).__y__Pi_2) /* ?{} */); 145 ((void)((*___dst__R2sS_2).__z__Pi_2) /* ?{} */); 146 } 147 inline void ___constructor__F_R2sSii_autogen___2(struct S *___dst__R2sS_2, signed int __a__i_2, signed int __b__i_2){ 148 ((void)((*___dst__R2sS_2).__a__i_2=__a__i_2) /* ?{} */); 149 ((void)((*___dst__R2sS_2).__b__i_2=__b__i_2) /* ?{} */); 150 ((void)((*___dst__R2sS_2).__c__i_2) /* ?{} */); 151 ((void)((*___dst__R2sS_2).__x__Pi_2) /* ?{} */); 152 ((void)((*___dst__R2sS_2).__y__Pi_2) /* ?{} */); 153 ((void)((*___dst__R2sS_2).__z__Pi_2) /* ?{} */); 154 } 155 inline void ___constructor__F_R2sSiii_autogen___2(struct S *___dst__R2sS_2, signed int __a__i_2, signed int __b__i_2, signed int __c__i_2){ 156 ((void)((*___dst__R2sS_2).__a__i_2=__a__i_2) /* ?{} */); 157 ((void)((*___dst__R2sS_2).__b__i_2=__b__i_2) /* ?{} */); 158 ((void)((*___dst__R2sS_2).__c__i_2=__c__i_2) /* ?{} */); 159 ((void)((*___dst__R2sS_2).__x__Pi_2) /* ?{} */); 160 ((void)((*___dst__R2sS_2).__y__Pi_2) /* ?{} */); 161 ((void)((*___dst__R2sS_2).__z__Pi_2) /* ?{} */); 162 } 163 inline void ___constructor__F_R2sSiiiPi_autogen___2(struct S *___dst__R2sS_2, signed int __a__i_2, signed int __b__i_2, signed int __c__i_2, signed int *__x__Pi_2){ 164 ((void)((*___dst__R2sS_2).__a__i_2=__a__i_2) /* ?{} */); 165 ((void)((*___dst__R2sS_2).__b__i_2=__b__i_2) /* ?{} */); 166 ((void)((*___dst__R2sS_2).__c__i_2=__c__i_2) /* ?{} */); 167 ((void)((*___dst__R2sS_2).__x__Pi_2=__x__Pi_2) /* ?{} */); 168 ((void)((*___dst__R2sS_2).__y__Pi_2) /* ?{} */); 169 ((void)((*___dst__R2sS_2).__z__Pi_2) /* ?{} */); 170 } 171 inline void ___constructor__F_R2sSiiiPiPi_autogen___2(struct S *___dst__R2sS_2, signed int __a__i_2, signed int __b__i_2, signed int __c__i_2, signed int *__x__Pi_2, signed int *__y__Pi_2){ 172 ((void)((*___dst__R2sS_2).__a__i_2=__a__i_2) /* ?{} */); 173 ((void)((*___dst__R2sS_2).__b__i_2=__b__i_2) /* ?{} */); 174 ((void)((*___dst__R2sS_2).__c__i_2=__c__i_2) /* ?{} */); 175 ((void)((*___dst__R2sS_2).__x__Pi_2=__x__Pi_2) /* ?{} */); 176 ((void)((*___dst__R2sS_2).__y__Pi_2=__y__Pi_2) /* ?{} */); 177 ((void)((*___dst__R2sS_2).__z__Pi_2) /* ?{} */); 178 } 179 inline void ___constructor__F_R2sSiiiPiPiPi_autogen___2(struct S *___dst__R2sS_2, signed int __a__i_2, signed int __b__i_2, signed int __c__i_2, signed int *__x__Pi_2, signed int *__y__Pi_2, signed int *__z__Pi_2){ 180 ((void)((*___dst__R2sS_2).__a__i_2=__a__i_2) /* ?{} */); 181 ((void)((*___dst__R2sS_2).__b__i_2=__b__i_2) /* ?{} */); 182 ((void)((*___dst__R2sS_2).__c__i_2=__c__i_2) /* ?{} */); 183 ((void)((*___dst__R2sS_2).__x__Pi_2=__x__Pi_2) /* ?{} */); 184 ((void)((*___dst__R2sS_2).__y__Pi_2=__y__Pi_2) /* ?{} */); 185 ((void)((*___dst__R2sS_2).__z__Pi_2=__z__Pi_2) /* ?{} */); 186 } 187 signed int __i__i_2 = (__extension__ __a__i_1+__extension__ 3); 96 signed int __i__i_2 = ((signed int )(__extension__ __a__i_1+__extension__ 3)); 188 97 ((void)__extension__ 3); 189 98 ((void)__extension__ __a__i_1); -
src/tests/.expect/32/gccExtensions.txt
r3f7e12cb r78315272 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), (*___dst__R2sS_2)));66 return ___ret__2sS_2;65 ((void)___constructor__F_R2sS2sS_autogen___2((&___ret__2sS_2), ___src__2sS_2)); 66 return ((struct S )___ret__2sS_2); 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 = __extension__ 3;83 signed int __i__i_2 = ((signed int )__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), (*___dst__R3ss2_2)));116 return ___ret__3ss2_2;115 ((void)___constructor__F_R3ss23ss2_autogen___2((&___ret__3ss2_2), ___src__3ss2_2)); 116 return ((struct s2 )___ret__3ss2_2); 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), (*___dst__R3ss3_2)));137 return ___ret__3ss3_2;136 ((void)___constructor__F_R3ss33ss3_autogen___2((&___ret__3ss3_2), ___src__3ss3_2)); 137 return ((struct s3 )___ret__3ss3_2); 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), (*___dst__R3ss4_2)));160 return ___ret__3ss4_2;159 ((void)___constructor__F_R3ss43ss4_autogen___2((&___ret__3ss4_2), ___src__3ss4_2)); 160 return ((struct s4 )___ret__3ss4_2); 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 ___retval_main__i_1;171 return ((signed int )___retval_main__i_1); 172 172 ((void)(___retval_main__i_1=0) /* ?{} */); 173 return ___retval_main__i_1;173 return ((signed int )___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 ___retval_main__i_1;188 return ((signed int )___retval_main__i_1); 189 189 } -
src/tests/.expect/32/literals.txt
r3f7e12cb r78315272 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 0_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__A 0_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));7 void __for_each__A2_0_0_0____operator_assign__PFt0_Rt0t0____constructor__PF_Rt0____constructor__PF_Rt0t0____destructor__PF_Rt0____operator_assign__PFt1_Rt1t1____constructor__PF_Rt1____constructor__PF_Rt1t1____destructor__PF_Rt1____operator_preincr__PFt0_Rt0____operator_predecr__PFt0_Rt0____operator_equal__PFi_t0t0____operator_notequal__PFi_t0t0____operator_deref__PFRt1_t0__F_t0t0PF_t1___1(__attribute__ ((unused)) void (*_adapterF_9telt_type__P)(void (*__anonymous_object0)(), void *__anonymous_object1), __attribute__ ((unused)) void *(*_adapterFP9telt_type_14titerator_type_M_P)(void (*__anonymous_object2)(), void *__anonymous_object3), __attribute__ ((unused)) signed int (*_adapterFi_14titerator_type14titerator_type_M_PP)(void (*__anonymous_object4)(), void *__anonymous_object5, void *__anonymous_object6), __attribute__ ((unused)) void (*_adapterF14titerator_type_P14titerator_type_P_M)(void (*__anonymous_object7)(), __attribute__ ((unused)) void *___retval__operator_preincr__14titerator_type_1, void *__anonymous_object8), __attribute__ ((unused)) void (*_adapterF_P9telt_type9telt_type__MP)(void (*__anonymous_object9)(), void *__anonymous_object10, void *__anonymous_object11), __attribute__ ((unused)) void (*_adapterF9telt_type_P9telt_type9telt_type_P_MP)(void (*__anonymous_object12)(), __attribute__ ((unused)) void *___retval__operator_assign__9telt_type_1, void *__anonymous_object13, void *__anonymous_object14), __attribute__ ((unused)) void (*_adapterF_P14titerator_type14titerator_type__MP)(void (*__anonymous_object15)(), void *__anonymous_object16, void *__anonymous_object17), __attribute__ ((unused)) void (*_adapterF14titerator_type_P14titerator_type14titerator_type_P_MP)(void (*__anonymous_object18)(), __attribute__ ((unused)) void *___retval__operator_assign__14titerator_type_1, void *__anonymous_object19, void *__anonymous_object20), __attribute__ ((unused)) unsigned long int _sizeof_14titerator_type, __attribute__ ((unused)) unsigned long int _alignof_14titerator_type, __attribute__ ((unused)) unsigned long int _sizeof_9telt_type, __attribute__ ((unused)) unsigned long int _alignof_9telt_type, __attribute__ ((unused)) void *(*___operator_assign__PF14titerator_type_R14titerator_type14titerator_type__1)(void *__anonymous_object21, void *__anonymous_object22), __attribute__ ((unused)) void (*___constructor__PF_R14titerator_type__1)(void *__anonymous_object23), __attribute__ ((unused)) void (*___constructor__PF_R14titerator_type14titerator_type__1)(void *__anonymous_object24, void *__anonymous_object25), __attribute__ ((unused)) void (*___destructor__PF_R14titerator_type__1)(void *__anonymous_object26), __attribute__ ((unused)) void *(*___operator_assign__PF9telt_type_R9telt_type9telt_type__1)(void *__anonymous_object27, void *__anonymous_object28), __attribute__ ((unused)) void (*___constructor__PF_R9telt_type__1)(void *__anonymous_object29), __attribute__ ((unused)) void (*___constructor__PF_R9telt_type9telt_type__1)(void *__anonymous_object30, void *__anonymous_object31), __attribute__ ((unused)) void (*___destructor__PF_R9telt_type__1)(void *__anonymous_object32), __attribute__ ((unused)) void *(*___operator_preincr__PF14titerator_type_R14titerator_type__1)(void *__anonymous_object33), __attribute__ ((unused)) void *(*___operator_predecr__PF14titerator_type_R14titerator_type__1)(void *__anonymous_object34), __attribute__ ((unused)) signed int (*___operator_equal__PFi_14titerator_type14titerator_type__1)(void *__anonymous_object35, void *__anonymous_object36), __attribute__ ((unused)) signed int (*___operator_notequal__PFi_14titerator_type14titerator_type__1)(void *__anonymous_object37, void *__anonymous_object38), __attribute__ ((unused)) void *(*___operator_deref__PFR9telt_type_14titerator_type__1)(void *__anonymous_object39), void *__begin__14titerator_type_1, void *__end__14titerator_type_1, void (*__func__PF_9telt_type__1)(void *__anonymous_object40)); 8 void __for_each_reverse__A2_0_0_0____operator_assign__PFt0_Rt0t0____constructor__PF_Rt0____constructor__PF_Rt0t0____destructor__PF_Rt0____operator_assign__PFt1_Rt1t1____constructor__PF_Rt1____constructor__PF_Rt1t1____destructor__PF_Rt1____operator_preincr__PFt0_Rt0____operator_predecr__PFt0_Rt0____operator_equal__PFi_t0t0____operator_notequal__PFi_t0t0____operator_deref__PFRt1_t0__F_t0t0PF_t1___1(__attribute__ ((unused)) void (*_adapterF_9telt_type__P)(void (*__anonymous_object41)(), void *__anonymous_object42), __attribute__ ((unused)) void *(*_adapterFP9telt_type_14titerator_type_M_P)(void (*__anonymous_object43)(), void *__anonymous_object44), __attribute__ ((unused)) signed int (*_adapterFi_14titerator_type14titerator_type_M_PP)(void (*__anonymous_object45)(), void *__anonymous_object46, void *__anonymous_object47), __attribute__ ((unused)) void (*_adapterF14titerator_type_P14titerator_type_P_M)(void (*__anonymous_object48)(), __attribute__ ((unused)) void *___retval__operator_preincr__14titerator_type_1, void *__anonymous_object49), __attribute__ ((unused)) void (*_adapterF_P9telt_type9telt_type__MP)(void (*__anonymous_object50)(), void *__anonymous_object51, void *__anonymous_object52), __attribute__ ((unused)) void (*_adapterF9telt_type_P9telt_type9telt_type_P_MP)(void (*__anonymous_object53)(), __attribute__ ((unused)) void *___retval__operator_assign__9telt_type_1, void *__anonymous_object54, void *__anonymous_object55), __attribute__ ((unused)) void (*_adapterF_P14titerator_type14titerator_type__MP)(void (*__anonymous_object56)(), void *__anonymous_object57, void *__anonymous_object58), __attribute__ ((unused)) void (*_adapterF14titerator_type_P14titerator_type14titerator_type_P_MP)(void (*__anonymous_object59)(), __attribute__ ((unused)) void *___retval__operator_assign__14titerator_type_1, void *__anonymous_object60, void *__anonymous_object61), __attribute__ ((unused)) unsigned long int _sizeof_14titerator_type, __attribute__ ((unused)) unsigned long int _alignof_14titerator_type, __attribute__ ((unused)) unsigned long int _sizeof_9telt_type, __attribute__ ((unused)) unsigned long int _alignof_9telt_type, __attribute__ ((unused)) void *(*___operator_assign__PF14titerator_type_R14titerator_type14titerator_type__1)(void *__anonymous_object62, void *__anonymous_object63), __attribute__ ((unused)) void (*___constructor__PF_R14titerator_type__1)(void *__anonymous_object64), __attribute__ ((unused)) void (*___constructor__PF_R14titerator_type14titerator_type__1)(void *__anonymous_object65, void *__anonymous_object66), __attribute__ ((unused)) void (*___destructor__PF_R14titerator_type__1)(void *__anonymous_object67), __attribute__ ((unused)) void *(*___operator_assign__PF9telt_type_R9telt_type9telt_type__1)(void *__anonymous_object68, void *__anonymous_object69), __attribute__ ((unused)) void (*___constructor__PF_R9telt_type__1)(void *__anonymous_object70), __attribute__ ((unused)) void (*___constructor__PF_R9telt_type9telt_type__1)(void *__anonymous_object71, void *__anonymous_object72), __attribute__ ((unused)) void (*___destructor__PF_R9telt_type__1)(void *__anonymous_object73), __attribute__ ((unused)) void *(*___operator_preincr__PF14titerator_type_R14titerator_type__1)(void *__anonymous_object74), __attribute__ ((unused)) void *(*___operator_predecr__PF14titerator_type_R14titerator_type__1)(void *__anonymous_object75), __attribute__ ((unused)) signed int (*___operator_equal__PFi_14titerator_type14titerator_type__1)(void *__anonymous_object76, void *__anonymous_object77), __attribute__ ((unused)) signed int (*___operator_notequal__PFi_14titerator_type14titerator_type__1)(void *__anonymous_object78, void *__anonymous_object79), __attribute__ ((unused)) void *(*___operator_deref__PFR9telt_type_14titerator_type__1)(void *__anonymous_object80), void *__begin__14titerator_type_1, void *__end__14titerator_type_1, void (*__func__PF_9telt_type__1)(void *__anonymous_object81)); 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 0_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);31 void *___operator_bitor__A1_1_0_1____operator_assign__PFt1_Rt1t1____constructor__PF_Rt1____constructor__PF_Rt1t1____destructor__PF_Rt1____operator_bitor__PFPd0_Pd0t1___sepPrt__PFb_Pd0___sepReset__PF_Pd0___sepReset__PF_Pd0b___sepGetCur__PFPCc_Pd0___sepSetCur__PF_Pd0PCc___getNL__PFb_Pd0___setNL__PF_Pd0b___sepOn__PF_Pd0___sepOff__PF_Pd0___sepDisable__PFb_Pd0___sepEnable__PFb_Pd0___sepGet__PFPCc_Pd0___sepSet__PF_Pd0PCc___sepGetTuple__PFPCc_Pd0___sepSetTuple__PF_Pd0PCc___fail__PFi_Pd0___flush__PFi_Pd0___open__PF_Pd0PCcPCc___close__PF_Pd0___write__PFPd0_Pd0PCcUl___fmt__PFi_Pd0PCc____operator_bitor__PFPd0_Pd0tVARGS2__FPd0_Pd0t1tVARGS2__1(__attribute__ ((unused)) void *(*_adapterFP7tostype_P7tostype7tParams_M_MP)(void (*__anonymous_object698)(), void *__anonymous_object699, void *__anonymous_object700), __attribute__ ((unused)) void *(*_adapterFP7tostype_P7tostype2tT_M_MP)(void (*__anonymous_object701)(), void *__anonymous_object702, void *__anonymous_object703), __attribute__ ((unused)) void (*_adapterF_P2tT2tT__MP)(void (*__anonymous_object704)(), void *__anonymous_object705, void *__anonymous_object706), __attribute__ ((unused)) void (*_adapterF2tT_P2tT2tT_P_MP)(void (*__anonymous_object707)(), __attribute__ ((unused)) void *___retval__operator_assign__2tT_1, void *__anonymous_object708, void *__anonymous_object709), __attribute__ ((unused)) unsigned long int _sizeof_2tT, __attribute__ ((unused)) unsigned long int _alignof_2tT, __attribute__ ((unused)) unsigned long int _sizeof_7tParams, __attribute__ ((unused)) unsigned long int _alignof_7tParams, __attribute__ ((unused)) void *(*___operator_assign__PF2tT_R2tT2tT__1)(void *__anonymous_object710, void *__anonymous_object711), __attribute__ ((unused)) void (*___constructor__PF_R2tT__1)(void *__anonymous_object712), __attribute__ ((unused)) void (*___constructor__PF_R2tT2tT__1)(void *__anonymous_object713, void *__anonymous_object714), __attribute__ ((unused)) void (*___destructor__PF_R2tT__1)(void *__anonymous_object715), __attribute__ ((unused)) void *(*___operator_bitor__PFP7tostype_P7tostype2tT__1)(void *__anonymous_object716, void *__anonymous_object717), __attribute__ ((unused)) _Bool (*__sepPrt__PFb_P7tostype__1)(void *__anonymous_object718), __attribute__ ((unused)) void (*__sepReset__PF_P7tostype__1)(void *__anonymous_object719), __attribute__ ((unused)) void (*__sepReset__PF_P7tostypeb__1)(void *__anonymous_object720, _Bool __anonymous_object721), __attribute__ ((unused)) const char *(*__sepGetCur__PFPCc_P7tostype__1)(void *__anonymous_object722), __attribute__ ((unused)) void (*__sepSetCur__PF_P7tostypePCc__1)(void *__anonymous_object723, const char *__anonymous_object724), __attribute__ ((unused)) _Bool (*__getNL__PFb_P7tostype__1)(void *__anonymous_object725), __attribute__ ((unused)) void (*__setNL__PF_P7tostypeb__1)(void *__anonymous_object726, _Bool __anonymous_object727), __attribute__ ((unused)) void (*__sepOn__PF_P7tostype__1)(void *__anonymous_object728), __attribute__ ((unused)) void (*__sepOff__PF_P7tostype__1)(void *__anonymous_object729), __attribute__ ((unused)) _Bool (*__sepDisable__PFb_P7tostype__1)(void *__anonymous_object730), __attribute__ ((unused)) _Bool (*__sepEnable__PFb_P7tostype__1)(void *__anonymous_object731), __attribute__ ((unused)) const char *(*__sepGet__PFPCc_P7tostype__1)(void *__anonymous_object732), __attribute__ ((unused)) void (*__sepSet__PF_P7tostypePCc__1)(void *__anonymous_object733, const char *__anonymous_object734), __attribute__ ((unused)) const char *(*__sepGetTuple__PFPCc_P7tostype__1)(void *__anonymous_object735), __attribute__ ((unused)) void (*__sepSetTuple__PF_P7tostypePCc__1)(void *__anonymous_object736, const char *__anonymous_object737), __attribute__ ((unused)) signed int (*__fail__PFi_P7tostype__1)(void *__anonymous_object738), __attribute__ ((unused)) signed int (*__flush__PFi_P7tostype__1)(void *__anonymous_object739), __attribute__ ((unused)) void (*__open__PF_P7tostypePCcPCc__1)(void *__os__P7tostype_1, const char *__name__PCc_1, const char *__mode__PCc_1), __attribute__ ((unused)) void (*__close__PF_P7tostype__1)(void *__os__P7tostype_1), __attribute__ ((unused)) void *(*__write__PFP7tostype_P7tostypePCcUl__1)(void *__anonymous_object740, const char *__anonymous_object741, unsigned long int __anonymous_object742), __attribute__ ((unused)) signed int (*__fmt__PFi_P7tostypePCc__1)(void *__anonymous_object743, const char *__fmt__PCc_1, ...), __attribute__ ((unused)) void *(*___operator_bitor__PFP7tostype_P7tostype7tParams__1)(void *__anonymous_object744, void *__anonymous_object745), void *__os__P7tostype_1, void *__arg__2tT_1, void *__rest__7tParams_1); 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 0_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__A 0_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);40 void __write__A2_1_0_0____operator_assign__PFt1_Rt1t1____constructor__PF_Rt1____constructor__PF_Rt1t1____destructor__PF_Rt1____operator_bitor__PFPd0_Pd0t1___sepPrt__PFb_Pd0___sepReset__PF_Pd0___sepReset__PF_Pd0b___sepGetCur__PFPCc_Pd0___sepSetCur__PF_Pd0PCc___getNL__PFb_Pd0___setNL__PF_Pd0b___sepOn__PF_Pd0___sepOff__PF_Pd0___sepDisable__PFb_Pd0___sepEnable__PFb_Pd0___sepGet__PFPCc_Pd0___sepSet__PF_Pd0PCc___sepGetTuple__PFPCc_Pd0___sepSetTuple__PF_Pd0PCc___fail__PFi_Pd0___flush__PFi_Pd0___open__PF_Pd0PCcPCc___close__PF_Pd0___write__PFPd0_Pd0PCcUl___fmt__PFi_Pd0PCc____operator_assign__PFt2_Rt2t2____constructor__PF_Rt2____constructor__PF_Rt2t2____destructor__PF_Rt2____operator_preincr__PFt2_Rt2____operator_predecr__PFt2_Rt2____operator_equal__PFi_t2t2____operator_notequal__PFi_t2t2____operator_deref__PFRt1_t2__F_t2t2Pd0__1(__attribute__ ((unused)) void *(*_adapterFP9telt_type_14titerator_type_M_P)(void (*__anonymous_object964)(), void *__anonymous_object965), __attribute__ ((unused)) signed int (*_adapterFi_14titerator_type14titerator_type_M_PP)(void (*__anonymous_object966)(), void *__anonymous_object967, void *__anonymous_object968), __attribute__ ((unused)) void (*_adapterF14titerator_type_P14titerator_type_P_M)(void (*__anonymous_object969)(), __attribute__ ((unused)) void *___retval__operator_preincr__14titerator_type_1, void *__anonymous_object970), __attribute__ ((unused)) void (*_adapterF_P14titerator_type14titerator_type__MP)(void (*__anonymous_object971)(), void *__anonymous_object972, void *__anonymous_object973), __attribute__ ((unused)) void (*_adapterF14titerator_type_P14titerator_type14titerator_type_P_MP)(void (*__anonymous_object974)(), __attribute__ ((unused)) void *___retval__operator_assign__14titerator_type_1, void *__anonymous_object975, void *__anonymous_object976), __attribute__ ((unused)) void *(*_adapterFP7tostype_P7tostype9telt_type_M_MP)(void (*__anonymous_object977)(), void *__anonymous_object978, void *__anonymous_object979), __attribute__ ((unused)) void (*_adapterF_P9telt_type9telt_type__MP)(void (*__anonymous_object980)(), void *__anonymous_object981, void *__anonymous_object982), __attribute__ ((unused)) void (*_adapterF9telt_type_P9telt_type9telt_type_P_MP)(void (*__anonymous_object983)(), __attribute__ ((unused)) void *___retval__operator_assign__9telt_type_1, void *__anonymous_object984, void *__anonymous_object985), __attribute__ ((unused)) unsigned long int _sizeof_9telt_type, __attribute__ ((unused)) unsigned long int _alignof_9telt_type, __attribute__ ((unused)) unsigned long int _sizeof_14titerator_type, __attribute__ ((unused)) unsigned long int _alignof_14titerator_type, __attribute__ ((unused)) void *(*___operator_assign__PF9telt_type_R9telt_type9telt_type__1)(void *__anonymous_object986, void *__anonymous_object987), __attribute__ ((unused)) void (*___constructor__PF_R9telt_type__1)(void *__anonymous_object988), __attribute__ ((unused)) void (*___constructor__PF_R9telt_type9telt_type__1)(void *__anonymous_object989, void *__anonymous_object990), __attribute__ ((unused)) void (*___destructor__PF_R9telt_type__1)(void *__anonymous_object991), __attribute__ ((unused)) void *(*___operator_bitor__PFP7tostype_P7tostype9telt_type__1)(void *__anonymous_object992, void *__anonymous_object993), __attribute__ ((unused)) _Bool (*__sepPrt__PFb_P7tostype__1)(void *__anonymous_object994), __attribute__ ((unused)) void (*__sepReset__PF_P7tostype__1)(void *__anonymous_object995), __attribute__ ((unused)) void (*__sepReset__PF_P7tostypeb__1)(void *__anonymous_object996, _Bool __anonymous_object997), __attribute__ ((unused)) const char *(*__sepGetCur__PFPCc_P7tostype__1)(void *__anonymous_object998), __attribute__ ((unused)) void (*__sepSetCur__PF_P7tostypePCc__1)(void *__anonymous_object999, const char *__anonymous_object1000), __attribute__ ((unused)) _Bool (*__getNL__PFb_P7tostype__1)(void *__anonymous_object1001), __attribute__ ((unused)) void (*__setNL__PF_P7tostypeb__1)(void *__anonymous_object1002, _Bool __anonymous_object1003), __attribute__ ((unused)) void (*__sepOn__PF_P7tostype__1)(void *__anonymous_object1004), __attribute__ ((unused)) void (*__sepOff__PF_P7tostype__1)(void *__anonymous_object1005), __attribute__ ((unused)) _Bool (*__sepDisable__PFb_P7tostype__1)(void *__anonymous_object1006), __attribute__ ((unused)) _Bool (*__sepEnable__PFb_P7tostype__1)(void *__anonymous_object1007), __attribute__ ((unused)) const char *(*__sepGet__PFPCc_P7tostype__1)(void *__anonymous_object1008), __attribute__ ((unused)) void (*__sepSet__PF_P7tostypePCc__1)(void *__anonymous_object1009, const char *__anonymous_object1010), __attribute__ ((unused)) const char *(*__sepGetTuple__PFPCc_P7tostype__1)(void *__anonymous_object1011), __attribute__ ((unused)) void (*__sepSetTuple__PF_P7tostypePCc__1)(void *__anonymous_object1012, const char *__anonymous_object1013), __attribute__ ((unused)) signed int (*__fail__PFi_P7tostype__1)(void *__anonymous_object1014), __attribute__ ((unused)) signed int (*__flush__PFi_P7tostype__1)(void *__anonymous_object1015), __attribute__ ((unused)) void (*__open__PF_P7tostypePCcPCc__1)(void *__os__P7tostype_1, const char *__name__PCc_1, const char *__mode__PCc_1), __attribute__ ((unused)) void (*__close__PF_P7tostype__1)(void *__os__P7tostype_1), __attribute__ ((unused)) void *(*__write__PFP7tostype_P7tostypePCcUl__1)(void *__anonymous_object1016, const char *__anonymous_object1017, unsigned long int __anonymous_object1018), __attribute__ ((unused)) signed int (*__fmt__PFi_P7tostypePCc__1)(void *__anonymous_object1019, const char *__fmt__PCc_1, ...), __attribute__ ((unused)) void *(*___operator_assign__PF14titerator_type_R14titerator_type14titerator_type__1)(void *__anonymous_object1020, void *__anonymous_object1021), __attribute__ ((unused)) void (*___constructor__PF_R14titerator_type__1)(void *__anonymous_object1022), __attribute__ ((unused)) void (*___constructor__PF_R14titerator_type14titerator_type__1)(void *__anonymous_object1023, void *__anonymous_object1024), __attribute__ ((unused)) void (*___destructor__PF_R14titerator_type__1)(void *__anonymous_object1025), __attribute__ ((unused)) void *(*___operator_preincr__PF14titerator_type_R14titerator_type__1)(void *__anonymous_object1026), __attribute__ ((unused)) void *(*___operator_predecr__PF14titerator_type_R14titerator_type__1)(void *__anonymous_object1027), __attribute__ ((unused)) signed int (*___operator_equal__PFi_14titerator_type14titerator_type__1)(void *__anonymous_object1028, void *__anonymous_object1029), __attribute__ ((unused)) signed int (*___operator_notequal__PFi_14titerator_type14titerator_type__1)(void *__anonymous_object1030, void *__anonymous_object1031), __attribute__ ((unused)) void *(*___operator_deref__PFR9telt_type_14titerator_type__1)(void *__anonymous_object1032), void *__begin__14titerator_type_1, void *__end__14titerator_type_1, void *__os__P7tostype_1); 41 void __write_reverse__A2_1_0_0____operator_assign__PFt1_Rt1t1____constructor__PF_Rt1____constructor__PF_Rt1t1____destructor__PF_Rt1____operator_bitor__PFPd0_Pd0t1___sepPrt__PFb_Pd0___sepReset__PF_Pd0___sepReset__PF_Pd0b___sepGetCur__PFPCc_Pd0___sepSetCur__PF_Pd0PCc___getNL__PFb_Pd0___setNL__PF_Pd0b___sepOn__PF_Pd0___sepOff__PF_Pd0___sepDisable__PFb_Pd0___sepEnable__PFb_Pd0___sepGet__PFPCc_Pd0___sepSet__PF_Pd0PCc___sepGetTuple__PFPCc_Pd0___sepSetTuple__PF_Pd0PCc___fail__PFi_Pd0___flush__PFi_Pd0___open__PF_Pd0PCcPCc___close__PF_Pd0___write__PFPd0_Pd0PCcUl___fmt__PFi_Pd0PCc____operator_assign__PFt2_Rt2t2____constructor__PF_Rt2____constructor__PF_Rt2t2____destructor__PF_Rt2____operator_preincr__PFt2_Rt2____operator_predecr__PFt2_Rt2____operator_equal__PFi_t2t2____operator_notequal__PFi_t2t2____operator_deref__PFRt1_t2__F_t2t2Pd0__1(__attribute__ ((unused)) void *(*_adapterFP9telt_type_14titerator_type_M_P)(void (*__anonymous_object1033)(), void *__anonymous_object1034), __attribute__ ((unused)) signed int (*_adapterFi_14titerator_type14titerator_type_M_PP)(void (*__anonymous_object1035)(), void *__anonymous_object1036, void *__anonymous_object1037), __attribute__ ((unused)) void (*_adapterF14titerator_type_P14titerator_type_P_M)(void (*__anonymous_object1038)(), __attribute__ ((unused)) void *___retval__operator_preincr__14titerator_type_1, void *__anonymous_object1039), __attribute__ ((unused)) void (*_adapterF_P14titerator_type14titerator_type__MP)(void (*__anonymous_object1040)(), void *__anonymous_object1041, void *__anonymous_object1042), __attribute__ ((unused)) void (*_adapterF14titerator_type_P14titerator_type14titerator_type_P_MP)(void (*__anonymous_object1043)(), __attribute__ ((unused)) void *___retval__operator_assign__14titerator_type_1, void *__anonymous_object1044, void *__anonymous_object1045), __attribute__ ((unused)) void *(*_adapterFP7tostype_P7tostype9telt_type_M_MP)(void (*__anonymous_object1046)(), void *__anonymous_object1047, void *__anonymous_object1048), __attribute__ ((unused)) void (*_adapterF_P9telt_type9telt_type__MP)(void (*__anonymous_object1049)(), void *__anonymous_object1050, void *__anonymous_object1051), __attribute__ ((unused)) void (*_adapterF9telt_type_P9telt_type9telt_type_P_MP)(void (*__anonymous_object1052)(), __attribute__ ((unused)) void *___retval__operator_assign__9telt_type_1, void *__anonymous_object1053, void *__anonymous_object1054), __attribute__ ((unused)) unsigned long int _sizeof_9telt_type, __attribute__ ((unused)) unsigned long int _alignof_9telt_type, __attribute__ ((unused)) unsigned long int _sizeof_14titerator_type, __attribute__ ((unused)) unsigned long int _alignof_14titerator_type, __attribute__ ((unused)) void *(*___operator_assign__PF9telt_type_R9telt_type9telt_type__1)(void *__anonymous_object1055, void *__anonymous_object1056), __attribute__ ((unused)) void (*___constructor__PF_R9telt_type__1)(void *__anonymous_object1057), __attribute__ ((unused)) void (*___constructor__PF_R9telt_type9telt_type__1)(void *__anonymous_object1058, void *__anonymous_object1059), __attribute__ ((unused)) void (*___destructor__PF_R9telt_type__1)(void *__anonymous_object1060), __attribute__ ((unused)) void *(*___operator_bitor__PFP7tostype_P7tostype9telt_type__1)(void *__anonymous_object1061, void *__anonymous_object1062), __attribute__ ((unused)) _Bool (*__sepPrt__PFb_P7tostype__1)(void *__anonymous_object1063), __attribute__ ((unused)) void (*__sepReset__PF_P7tostype__1)(void *__anonymous_object1064), __attribute__ ((unused)) void (*__sepReset__PF_P7tostypeb__1)(void *__anonymous_object1065, _Bool __anonymous_object1066), __attribute__ ((unused)) const char *(*__sepGetCur__PFPCc_P7tostype__1)(void *__anonymous_object1067), __attribute__ ((unused)) void (*__sepSetCur__PF_P7tostypePCc__1)(void *__anonymous_object1068, const char *__anonymous_object1069), __attribute__ ((unused)) _Bool (*__getNL__PFb_P7tostype__1)(void *__anonymous_object1070), __attribute__ ((unused)) void (*__setNL__PF_P7tostypeb__1)(void *__anonymous_object1071, _Bool __anonymous_object1072), __attribute__ ((unused)) void (*__sepOn__PF_P7tostype__1)(void *__anonymous_object1073), __attribute__ ((unused)) void (*__sepOff__PF_P7tostype__1)(void *__anonymous_object1074), __attribute__ ((unused)) _Bool (*__sepDisable__PFb_P7tostype__1)(void *__anonymous_object1075), __attribute__ ((unused)) _Bool (*__sepEnable__PFb_P7tostype__1)(void *__anonymous_object1076), __attribute__ ((unused)) const char *(*__sepGet__PFPCc_P7tostype__1)(void *__anonymous_object1077), __attribute__ ((unused)) void (*__sepSet__PF_P7tostypePCc__1)(void *__anonymous_object1078, const char *__anonymous_object1079), __attribute__ ((unused)) const char *(*__sepGetTuple__PFPCc_P7tostype__1)(void *__anonymous_object1080), __attribute__ ((unused)) void (*__sepSetTuple__PF_P7tostypePCc__1)(void *__anonymous_object1081, const char *__anonymous_object1082), __attribute__ ((unused)) signed int (*__fail__PFi_P7tostype__1)(void *__anonymous_object1083), __attribute__ ((unused)) signed int (*__flush__PFi_P7tostype__1)(void *__anonymous_object1084), __attribute__ ((unused)) void (*__open__PF_P7tostypePCcPCc__1)(void *__os__P7tostype_1, const char *__name__PCc_1, const char *__mode__PCc_1), __attribute__ ((unused)) void (*__close__PF_P7tostype__1)(void *__os__P7tostype_1), __attribute__ ((unused)) void *(*__write__PFP7tostype_P7tostypePCcUl__1)(void *__anonymous_object1085, const char *__anonymous_object1086, unsigned long int __anonymous_object1087), __attribute__ ((unused)) signed int (*__fmt__PFi_P7tostypePCc__1)(void *__anonymous_object1088, const char *__fmt__PCc_1, ...), __attribute__ ((unused)) void *(*___operator_assign__PF14titerator_type_R14titerator_type14titerator_type__1)(void *__anonymous_object1089, void *__anonymous_object1090), __attribute__ ((unused)) void (*___constructor__PF_R14titerator_type__1)(void *__anonymous_object1091), __attribute__ ((unused)) void (*___constructor__PF_R14titerator_type14titerator_type__1)(void *__anonymous_object1092, void *__anonymous_object1093), __attribute__ ((unused)) void (*___destructor__PF_R14titerator_type__1)(void *__anonymous_object1094), __attribute__ ((unused)) void *(*___operator_preincr__PF14titerator_type_R14titerator_type__1)(void *__anonymous_object1095), __attribute__ ((unused)) void *(*___operator_predecr__PF14titerator_type_R14titerator_type__1)(void *__anonymous_object1096), __attribute__ ((unused)) signed int (*___operator_equal__PFi_14titerator_type14titerator_type__1)(void *__anonymous_object1097, void *__anonymous_object1098), __attribute__ ((unused)) signed int (*___operator_notequal__PFi_14titerator_type14titerator_type__1)(void *__anonymous_object1099, void *__anonymous_object1100), __attribute__ ((unused)) void *(*___operator_deref__PFR9telt_type_14titerator_type__1)(void *__anonymous_object1101), void *__begin__14titerator_type_1, void *__end__14titerator_type_1, void *__os__P7tostype_1); 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);67 66 static inline void ___constructor__F_R16s_Istream_cstrUC_autogen___1(struct _Istream_cstrUC *___dst__R16s_Istream_cstrUC_1){ 68 67 ((void)((*___dst__R16s_Istream_cstrUC_1).__s__Pc_1) /* ?{} */); … … 77 76 struct _Istream_cstrUC ___ret__16s_Istream_cstrUC_1; 78 77 ((void)((*___dst__R16s_Istream_cstrUC_1).__s__Pc_1=___src__16s_Istream_cstrUC_1.__s__Pc_1)); 79 ((void)___constructor__F_R16s_Istream_cstrUC16s_Istream_cstrUC_autogen___1((&___ret__16s_Istream_cstrUC_1), (*___dst__R16s_Istream_cstrUC_1)));80 return ___ret__16s_Istream_cstrUC_1;78 ((void)___constructor__F_R16s_Istream_cstrUC16s_Istream_cstrUC_autogen___1((&___ret__16s_Istream_cstrUC_1), ___src__16s_Istream_cstrUC_1)); 79 return ((struct _Istream_cstrUC )___ret__16s_Istream_cstrUC_1); 81 80 } 82 81 static inline void ___constructor__F_R16s_Istream_cstrUCPc_autogen___1(struct _Istream_cstrUC *___dst__R16s_Istream_cstrUC_1, char *__s__Pc_1){ … … 93 92 static inline void ___destructor__F_R15s_Istream_cstrC_autogen___1(struct _Istream_cstrC *___dst__R15s_Istream_cstrC_1); 94 93 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);97 94 static inline void ___constructor__F_R15s_Istream_cstrC_autogen___1(struct _Istream_cstrC *___dst__R15s_Istream_cstrC_1){ 98 95 ((void)((*___dst__R15s_Istream_cstrC_1).__s__Pc_1) /* ?{} */); … … 111 108 ((void)((*___dst__R15s_Istream_cstrC_1).__s__Pc_1=___src__15s_Istream_cstrC_1.__s__Pc_1)); 112 109 ((void)((*___dst__R15s_Istream_cstrC_1).__size__i_1=___src__15s_Istream_cstrC_1.__size__i_1)); 113 ((void)___constructor__F_R15s_Istream_cstrC15s_Istream_cstrC_autogen___1((&___ret__15s_Istream_cstrC_1), (*___dst__R15s_Istream_cstrC_1)));114 return ___ret__15s_Istream_cstrC_1;110 ((void)___constructor__F_R15s_Istream_cstrC15s_Istream_cstrC_autogen___1((&___ret__15s_Istream_cstrC_1), ___src__15s_Istream_cstrC_1)); 111 return ((struct _Istream_cstrC )___ret__15s_Istream_cstrC_1); 115 112 } 116 113 static inline void ___constructor__F_R15s_Istream_cstrCPc_autogen___1(struct _Istream_cstrC *___dst__R15s_Istream_cstrC_1, char *__s__Pc_1){ … … 125 122 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); 126 123 enum __anonymous0 { 127 __sepSize__C13e__anonymous0_1 = 16,124 __sepSize__C13e__anonymous0_1 = ((signed int )16), 128 125 }; 129 126 struct ofstream { … … 140 137 static inline void ___destructor__F_R9sofstream_autogen___1(struct ofstream *___dst__R9sofstream_1); 141 138 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)]);149 139 static inline void ___constructor__F_R9sofstream_autogen___1(struct ofstream *___dst__R9sofstream_1){ 150 140 ((void)((*___dst__R9sofstream_1).__file__Pv_1) /* ?{} */); … … 154 144 ((void)((*___dst__R9sofstream_1).__sepCur__PCc_1) /* ?{} */); 155 145 { 156 signed int _index0 = 0;146 signed int _index0 = ((signed int )0); 157 147 for (;(_index0<((signed int )__sepSize__C13e__anonymous0_1));((void)(++_index0))) { 158 148 ((void)((*((char *)(&(*___dst__R9sofstream_1).__separator__A0c_1[_index0])))) /* ?{} */); … … 160 150 161 151 } 162 163 { 164 signed int _index1 = 0; 152 { 153 signed int _index1 = ((signed int )0); 165 154 for (;(_index1<((signed int )__sepSize__C13e__anonymous0_1));((void)(++_index1))) { 166 155 ((void)((*((char *)(&(*___dst__R9sofstream_1).__tupleSeparator__A0c_1[_index1])))) /* ?{} */); … … 168 157 169 158 } 170 171 159 } 172 160 static inline void ___constructor__F_R9sofstream9sofstream_autogen___1(struct ofstream *___dst__R9sofstream_1, struct ofstream ___src__9sofstream_1){ … … 177 165 ((void)((*___dst__R9sofstream_1).__sepCur__PCc_1=___src__9sofstream_1.__sepCur__PCc_1) /* ?{} */); 178 166 { 179 signed int _index2 = 0;167 signed int _index2 = ((signed int )0); 180 168 for (;(_index2<((signed int )__sepSize__C13e__anonymous0_1));((void)(++_index2))) { 181 169 ((void)((*((char *)(&(*___dst__R9sofstream_1).__separator__A0c_1[_index2])))=___src__9sofstream_1.__separator__A0c_1[_index2]) /* ?{} */); … … 183 171 184 172 } 185 186 { 187 signed int _index3 = 0; 173 { 174 signed int _index3 = ((signed int )0); 188 175 for (;(_index3<((signed int )__sepSize__C13e__anonymous0_1));((void)(++_index3))) { 189 176 ((void)((*((char *)(&(*___dst__R9sofstream_1).__tupleSeparator__A0c_1[_index3])))=___src__9sofstream_1.__tupleSeparator__A0c_1[_index3]) /* ?{} */); … … 191 178 192 179 } 193 194 180 } 195 181 static inline void ___destructor__F_R9sofstream_autogen___1(struct ofstream *___dst__R9sofstream_1){ 196 182 { 197 signed int _index4 = (( (signed int )__sepSize__C13e__anonymous0_1)-1);183 signed int _index4 = ((signed int )(((signed int )__sepSize__C13e__anonymous0_1)-1)); 198 184 for (;(_index4>=0);((void)(--_index4))) { 199 185 ((void)((*((char *)(&(*___dst__R9sofstream_1).__tupleSeparator__A0c_1[_index4])))) /* ^?{} */); … … 201 187 202 188 } 203 204 { 205 signed int _index5 = (((signed int )__sepSize__C13e__anonymous0_1)-1); 189 { 190 signed int _index5 = ((signed int )(((signed int )__sepSize__C13e__anonymous0_1)-1)); 206 191 for (;(_index5>=0);((void)(--_index5))) { 207 192 ((void)((*((char *)(&(*___dst__R9sofstream_1).__separator__A0c_1[_index5])))) /* ^?{} */); … … 209 194 210 195 } 211 212 196 ((void)((*___dst__R9sofstream_1).__sepCur__PCc_1) /* ^?{} */); 213 197 ((void)((*___dst__R9sofstream_1).__sawNL__b_1) /* ^?{} */); … … 224 208 ((void)((*___dst__R9sofstream_1).__sepCur__PCc_1=___src__9sofstream_1.__sepCur__PCc_1)); 225 209 { 226 signed int _index6 = 0;210 signed int _index6 = ((signed int )0); 227 211 for (;(_index6<((signed int )__sepSize__C13e__anonymous0_1));((void)(++_index6))) { 228 212 ((void)((*___dst__R9sofstream_1).__separator__A0c_1[_index6]=___src__9sofstream_1.__separator__A0c_1[_index6])); … … 232 216 233 217 { 234 signed int _index7 = 0;218 signed int _index7 = ((signed int )0); 235 219 for (;(_index7<((signed int )__sepSize__C13e__anonymous0_1));((void)(++_index7))) { 236 220 ((void)((*___dst__R9sofstream_1).__tupleSeparator__A0c_1[_index7]=___src__9sofstream_1.__tupleSeparator__A0c_1[_index7])); … … 239 223 } 240 224 241 ((void)___constructor__F_R9sofstream9sofstream_autogen___1((&___ret__9sofstream_1), (*___dst__R9sofstream_1)));242 return ___ret__9sofstream_1;225 ((void)___constructor__F_R9sofstream9sofstream_autogen___1((&___ret__9sofstream_1), ___src__9sofstream_1)); 226 return ((struct ofstream )___ret__9sofstream_1); 243 227 } 244 228 static inline void ___constructor__F_R9sofstreamPv_autogen___1(struct ofstream *___dst__R9sofstream_1, void *__file__Pv_1){ … … 249 233 ((void)((*___dst__R9sofstream_1).__sepCur__PCc_1) /* ?{} */); 250 234 { 251 signed int _index8 = 0;235 signed int _index8 = ((signed int )0); 252 236 for (;(_index8<((signed int )__sepSize__C13e__anonymous0_1));((void)(++_index8))) { 253 237 ((void)((*((char *)(&(*___dst__R9sofstream_1).__separator__A0c_1[_index8])))) /* ?{} */); … … 255 239 256 240 } 257 258 { 259 signed int _index9 = 0; 241 { 242 signed int _index9 = ((signed int )0); 260 243 for (;(_index9<((signed int )__sepSize__C13e__anonymous0_1));((void)(++_index9))) { 261 244 ((void)((*((char *)(&(*___dst__R9sofstream_1).__tupleSeparator__A0c_1[_index9])))) /* ?{} */); … … 263 246 264 247 } 265 266 248 } 267 249 static inline void ___constructor__F_R9sofstreamPvb_autogen___1(struct ofstream *___dst__R9sofstream_1, void *__file__Pv_1, _Bool __sepDefault__b_1){ … … 272 254 ((void)((*___dst__R9sofstream_1).__sepCur__PCc_1) /* ?{} */); 273 255 { 274 signed int _index10 = 0;256 signed int _index10 = ((signed int )0); 275 257 for (;(_index10<((signed int )__sepSize__C13e__anonymous0_1));((void)(++_index10))) { 276 258 ((void)((*((char *)(&(*___dst__R9sofstream_1).__separator__A0c_1[_index10])))) /* ?{} */); … … 278 260 279 261 } 280 281 { 282 signed int _index11 = 0; 262 { 263 signed int _index11 = ((signed int )0); 283 264 for (;(_index11<((signed int )__sepSize__C13e__anonymous0_1));((void)(++_index11))) { 284 265 ((void)((*((char *)(&(*___dst__R9sofstream_1).__tupleSeparator__A0c_1[_index11])))) /* ?{} */); … … 286 267 287 268 } 288 289 269 } 290 270 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){ … … 295 275 ((void)((*___dst__R9sofstream_1).__sepCur__PCc_1) /* ?{} */); 296 276 { 297 signed int _index12 = 0;277 signed int _index12 = ((signed int )0); 298 278 for (;(_index12<((signed int )__sepSize__C13e__anonymous0_1));((void)(++_index12))) { 299 279 ((void)((*((char *)(&(*___dst__R9sofstream_1).__separator__A0c_1[_index12])))) /* ?{} */); … … 301 281 302 282 } 303 304 { 305 signed int _index13 = 0; 283 { 284 signed int _index13 = ((signed int )0); 306 285 for (;(_index13<((signed int )__sepSize__C13e__anonymous0_1));((void)(++_index13))) { 307 286 ((void)((*((char *)(&(*___dst__R9sofstream_1).__tupleSeparator__A0c_1[_index13])))) /* ?{} */); … … 309 288 310 289 } 311 312 290 } 313 291 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){ … … 318 296 ((void)((*___dst__R9sofstream_1).__sepCur__PCc_1) /* ?{} */); 319 297 { 320 signed int _index14 = 0;298 signed int _index14 = ((signed int )0); 321 299 for (;(_index14<((signed int )__sepSize__C13e__anonymous0_1));((void)(++_index14))) { 322 300 ((void)((*((char *)(&(*___dst__R9sofstream_1).__separator__A0c_1[_index14])))) /* ?{} */); … … 324 302 325 303 } 326 327 { 328 signed int _index15 = 0; 304 { 305 signed int _index15 = ((signed int )0); 329 306 for (;(_index15<((signed int )__sepSize__C13e__anonymous0_1));((void)(++_index15))) { 330 307 ((void)((*((char *)(&(*___dst__R9sofstream_1).__tupleSeparator__A0c_1[_index15])))) /* ?{} */); … … 332 309 333 310 } 334 335 311 } 336 312 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){ … … 341 317 ((void)((*___dst__R9sofstream_1).__sepCur__PCc_1=__sepCur__PCc_1) /* ?{} */); 342 318 { 343 signed int _index16 = 0;319 signed int _index16 = ((signed int )0); 344 320 for (;(_index16<((signed int )__sepSize__C13e__anonymous0_1));((void)(++_index16))) { 345 321 ((void)((*((char *)(&(*___dst__R9sofstream_1).__separator__A0c_1[_index16])))) /* ?{} */); … … 347 323 348 324 } 349 350 { 351 signed int _index17 = 0; 325 { 326 signed int _index17 = ((signed int )0); 352 327 for (;(_index17<((signed int )__sepSize__C13e__anonymous0_1));((void)(++_index17))) { 353 328 ((void)((*((char *)(&(*___dst__R9sofstream_1).__tupleSeparator__A0c_1[_index17])))) /* ?{} */); … … 355 330 356 331 } 357 358 332 } 359 333 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)]){ … … 364 338 ((void)((*___dst__R9sofstream_1).__sepCur__PCc_1=__sepCur__PCc_1) /* ?{} */); 365 339 { 366 signed int _index18 = 0;340 signed int _index18 = ((signed int )0); 367 341 for (;(_index18<((signed int )__sepSize__C13e__anonymous0_1));((void)(++_index18))) { 368 342 ((void)((*((char *)(&(*___dst__R9sofstream_1).__separator__A0c_1[_index18])))=__separator__A0c_1[_index18]) /* ?{} */); … … 370 344 371 345 } 372 373 { 374 signed int _index19 = 0; 346 { 347 signed int _index19 = ((signed int )0); 375 348 for (;(_index19<((signed int )__sepSize__C13e__anonymous0_1));((void)(++_index19))) { 376 349 ((void)((*((char *)(&(*___dst__R9sofstream_1).__tupleSeparator__A0c_1[_index19])))) /* ?{} */); … … 378 351 379 352 } 380 381 353 } 382 354 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)]){ … … 387 359 ((void)((*___dst__R9sofstream_1).__sepCur__PCc_1=__sepCur__PCc_1) /* ?{} */); 388 360 { 389 signed int _index20 = 0;361 signed int _index20 = ((signed int )0); 390 362 for (;(_index20<((signed int )__sepSize__C13e__anonymous0_1));((void)(++_index20))) { 391 363 ((void)((*((char *)(&(*___dst__R9sofstream_1).__separator__A0c_1[_index20])))=__separator__A0c_1[_index20]) /* ?{} */); … … 393 365 394 366 } 395 396 { 397 signed int _index21 = 0; 367 { 368 signed int _index21 = ((signed int )0); 398 369 for (;(_index21<((signed int )__sepSize__C13e__anonymous0_1));((void)(++_index21))) { 399 370 ((void)((*((char *)(&(*___dst__R9sofstream_1).__tupleSeparator__A0c_1[_index21])))=__tupleSeparator__A0c_1[_index21]) /* ?{} */); … … 401 372 402 373 } 403 404 374 } 405 375 _Bool __sepPrt__Fb_P9sofstream__1(struct ofstream *__anonymous_object1294); … … 434 404 static inline void ___destructor__F_R9sifstream_autogen___1(struct ifstream *___dst__R9sifstream_1); 435 405 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);437 406 static inline void ___constructor__F_R9sifstream_autogen___1(struct ifstream *___dst__R9sifstream_1){ 438 407 ((void)((*___dst__R9sifstream_1).__file__Pv_1) /* ?{} */); … … 447 416 struct ifstream ___ret__9sifstream_1; 448 417 ((void)((*___dst__R9sifstream_1).__file__Pv_1=___src__9sifstream_1.__file__Pv_1)); 449 ((void)___constructor__F_R9sifstream9sifstream_autogen___1((&___ret__9sifstream_1), (*___dst__R9sifstream_1)));450 return ___ret__9sifstream_1;418 ((void)___constructor__F_R9sifstream9sifstream_autogen___1((&___ret__9sifstream_1), ___src__9sifstream_1)); 419 return ((struct ifstream )___ret__9sifstream_1); 451 420 } 452 421 static inline void ___constructor__F_R9sifstreamPv_autogen___1(struct ifstream *___dst__R9sifstream_1, void *__file__Pv_1){ … … 466 435 struct ofstream *_tmp_cp_ret2; 467 436 __attribute__ ((unused)) struct ofstream *_thunk0(struct ofstream *_p0){ 468 return __endl__A0_1_0_0___sepPrt__PFb_Pd0___sepReset__PF_Pd0___sepReset__PF_Pd0b___sepGetCur__PFPCc_Pd0___sepSetCur__PF_Pd0PCc___getNL__PFb_Pd0___setNL__PF_Pd0b___sepOn__PF_Pd0___sepOff__PF_Pd0___sepDisable__PFb_Pd0___sepEnable__PFb_Pd0___sepGet__PFPCc_Pd0___sepSet__PF_Pd0PCc___sepGetTuple__PFPCc_Pd0___sepSetTuple__PF_Pd0PCc___fail__PFi_Pd0___flush__PFi_Pd0___open__PF_Pd0PCcPCc___close__PF_Pd0___write__PFPd0_Pd0PCcUl___fmt__PFi_Pd0PCc__FPd0_Pd0__1(((_Bool (*)(void *__anonymous_object1322))__sepPrt__Fb_P9sofstream__1), ((void (*)(void *__anonymous_object1323))__sepReset__F_P9sofstream__1), ((void (*)(void *__anonymous_object1324, _Bool __anonymous_object1325))__sepReset__F_P9sofstreamb__1), ((const char *(*)(void *__anonymous_object1326))__sepGetCur__FPCc_P9sofstream__1), ((void (*)(void *__anonymous_object1327, const char *__anonymous_object1328))__sepSetCur__F_P9sofstreamPCc__1), ((_Bool (*)(void *__anonymous_object1329))__getNL__Fb_P9sofstream__1), ((void (*)(void *__anonymous_object1330, _Bool __anonymous_object1331))__setNL__F_P9sofstreamb__1), ((void (*)(void *__anonymous_object1332))__sepOn__F_P9sofstream__1), ((void (*)(void *__anonymous_object1333))__sepOff__F_P9sofstream__1), ((_Bool (*)(void *__anonymous_object1334))__sepDisable__Fb_P9sofstream__1), ((_Bool (*)(void *__anonymous_object1335))__sepEnable__Fb_P9sofstream__1), ((const char *(*)(void *__anonymous_object1336))__sepGet__FPCc_P9sofstream__1), ((void (*)(void *__anonymous_object1337, const char *__anonymous_object1338))__sepSet__F_P9sofstreamPCc__1), ((const char *(*)(void *__anonymous_object1339))__sepGetTuple__FPCc_P9sofstream__1), ((void (*)(void *__anonymous_object1340, const char *__anonymous_object1341))__sepSetTuple__F_P9sofstreamPCc__1), ((signed int (*)(void *__anonymous_object1342))__fail__Fi_P9sofstream__1), ((signed int (*)(void *__anonymous_object1343))__flush__Fi_P9sofstream__1), ((void (*)(void *__os__P7tostype_1, const char *__name__PCc_1, const char *__mode__PCc_1))__open__F_P9sofstreamPCcPCc__1), ((void (*)(void *__os__P7tostype_1))__close__F_P9sofstream__1), ((void *(*)(void *__anonymous_object1344, const char *__anonymous_object1345, unsigned long int __anonymous_object1346))__write__FP9sofstream_P9sofstreamPCcUl__1), ((signed int (*)(void *__anonymous_object1347, const char *__fmt__PCc_1, ...))__fmt__Fi_P9sofstreamPCc__1), ((void *)_p0));469 } 470 ((void)(((void)(_tmp_cp_ret2=___operator_bitor__A0_1_0_0___sepPrt__PFb_Pd0___sepReset__PF_Pd0___sepReset__PF_Pd0b___sepGetCur__PFPCc_Pd0___sepSetCur__PF_Pd0PCc___getNL__PFb_Pd0___setNL__PF_Pd0b___sepOn__PF_Pd0___sepOff__PF_Pd0___sepDisable__PFb_Pd0___sepEnable__PFb_Pd0___sepGet__PFPCc_Pd0___sepSet__PF_Pd0PCc___sepGetTuple__PFPCc_Pd0___sepSetTuple__PF_Pd0PCc___fail__PFi_Pd0___flush__PFi_Pd0___open__PF_Pd0PCcPCc___close__PF_Pd0___write__PFPd0_Pd0PCcUl___fmt__PFi_Pd0PCc__FPd0_Pd0PFPd0_Pd0___1(((_Bool (*)(void *__anonymous_object1348))__sepPrt__Fb_P9sofstream__1), ((void (*)(void *__anonymous_object1349))__sepReset__F_P9sofstream__1), ((void (*)(void *__anonymous_object1350, _Bool __anonymous_object1351))__sepReset__F_P9sofstreamb__1), ((const char *(*)(void *__anonymous_object1352))__sepGetCur__FPCc_P9sofstream__1), ((void (*)(void *__anonymous_object1353, const char *__anonymous_object1354))__sepSetCur__F_P9sofstreamPCc__1), ((_Bool (*)(void *__anonymous_object1355))__getNL__Fb_P9sofstream__1), ((void (*)(void *__anonymous_object1356, _Bool __anonymous_object1357))__setNL__F_P9sofstreamb__1), ((void (*)(void *__anonymous_object1358))__sepOn__F_P9sofstream__1), ((void (*)(void *__anonymous_object1359))__sepOff__F_P9sofstream__1), ((_Bool (*)(void *__anonymous_object1360))__sepDisable__Fb_P9sofstream__1), ((_Bool (*)(void *__anonymous_object1361))__sepEnable__Fb_P9sofstream__1), ((const char *(*)(void *__anonymous_object1362))__sepGet__FPCc_P9sofstream__1), ((void (*)(void *__anonymous_object1363, const char *__anonymous_object1364))__sepSet__F_P9sofstreamPCc__1), ((const char *(*)(void *__anonymous_object1365))__sepGetTuple__FPCc_P9sofstream__1), ((void (*)(void *__anonymous_object1366, const char *__anonymous_object1367))__sepSetTuple__F_P9sofstreamPCc__1), ((signed int (*)(void *__anonymous_object1368))__fail__Fi_P9sofstream__1), ((signed int (*)(void *__anonymous_object1369))__flush__Fi_P9sofstream__1), ((void (*)(void *__os__P7tostype_1, const char *__name__PCc_1, const char *__mode__PCc_1))__open__F_P9sofstreamPCcPCc__1), ((void (*)(void *__os__P7tostype_1))__close__F_P9sofstream__1), ((void *(*)(void *__anonymous_object1370, const char *__anonymous_object1371, unsigned long int __anonymous_object1372))__write__FP9sofstream_P9sofstreamPCcUl__1), ((signed int (*)(void *__anonymous_object1373, const char *__fmt__PCc_1, ...))__fmt__Fi_P9sofstreamPCc__1), (( void *)(((void)(_tmp_cp_ret1=___operator_bitor__A0_1_0_0___sepPrt__PFb_Pd0___sepReset__PF_Pd0___sepReset__PF_Pd0b___sepGetCur__PFPCc_Pd0___sepSetCur__PF_Pd0PCc___getNL__PFb_Pd0___setNL__PF_Pd0b___sepOn__PF_Pd0___sepOff__PF_Pd0___sepDisable__PFb_Pd0___sepEnable__PFb_Pd0___sepGet__PFPCc_Pd0___sepSet__PF_Pd0PCc___sepGetTuple__PFPCc_Pd0___sepSetTuple__PF_Pd0PCc___fail__PFi_Pd0___flush__PFi_Pd0___open__PF_Pd0PCcPCc___close__PF_Pd0___write__PFPd0_Pd0PCcUl___fmt__PFi_Pd0PCc__FPd0_Pd0c__1(((_Bool (*)(void *__anonymous_object1374))__sepPrt__Fb_P9sofstream__1), ((void (*)(void *__anonymous_object1375))__sepReset__F_P9sofstream__1), ((void (*)(void *__anonymous_object1376, _Bool __anonymous_object1377))__sepReset__F_P9sofstreamb__1), ((const char *(*)(void *__anonymous_object1378))__sepGetCur__FPCc_P9sofstream__1), ((void (*)(void *__anonymous_object1379, const char *__anonymous_object1380))__sepSetCur__F_P9sofstreamPCc__1), ((_Bool (*)(void *__anonymous_object1381))__getNL__Fb_P9sofstream__1), ((void (*)(void *__anonymous_object1382, _Bool __anonymous_object1383))__setNL__F_P9sofstreamb__1), ((void (*)(void *__anonymous_object1384))__sepOn__F_P9sofstream__1), ((void (*)(void *__anonymous_object1385))__sepOff__F_P9sofstream__1), ((_Bool (*)(void *__anonymous_object1386))__sepDisable__Fb_P9sofstream__1), ((_Bool (*)(void *__anonymous_object1387))__sepEnable__Fb_P9sofstream__1), ((const char *(*)(void *__anonymous_object1388))__sepGet__FPCc_P9sofstream__1), ((void (*)(void *__anonymous_object1389, const char *__anonymous_object1390))__sepSet__F_P9sofstreamPCc__1), ((const char *(*)(void *__anonymous_object1391))__sepGetTuple__FPCc_P9sofstream__1), ((void (*)(void *__anonymous_object1392, const char *__anonymous_object1393))__sepSetTuple__F_P9sofstreamPCc__1), ((signed int (*)(void *__anonymous_object1394))__fail__Fi_P9sofstream__1), ((signed int (*)(void *__anonymous_object1395))__flush__Fi_P9sofstream__1), ((void (*)(void *__os__P7tostype_1, const char *__name__PCc_1, const char *__mode__PCc_1))__open__F_P9sofstreamPCcPCc__1), ((void (*)(void *__os__P7tostype_1))__close__F_P9sofstream__1), ((void *(*)(void *__anonymous_object1396, const char *__anonymous_object1397, unsigned long int __anonymous_object1398))__write__FP9sofstream_P9sofstreamPCcUl__1), ((signed int (*)(void *__anonymous_object1399, const char *__fmt__PCc_1, ...))__fmt__Fi_P9sofstreamPCc__1), ((void *)(((void)(_tmp_cp_ret0=___operator_bitor__A0_1_0_0___sepPrt__PFb_Pd0___sepReset__PF_Pd0___sepReset__PF_Pd0b___sepGetCur__PFPCc_Pd0___sepSetCur__PF_Pd0PCc___getNL__PFb_Pd0___setNL__PF_Pd0b___sepOn__PF_Pd0___sepOff__PF_Pd0___sepDisable__PFb_Pd0___sepEnable__PFb_Pd0___sepGet__PFPCc_Pd0___sepSet__PF_Pd0PCc___sepGetTuple__PFPCc_Pd0___sepSetTuple__PF_Pd0PCc___fail__PFi_Pd0___flush__PFi_Pd0___open__PF_Pd0PCcPCc___close__PF_Pd0___write__PFPd0_Pd0PCcUl___fmt__PFi_Pd0PCc__FPd0_Pd0PCc__1(((_Bool (*)(void *__anonymous_object1400))__sepPrt__Fb_P9sofstream__1), ((void (*)(void *__anonymous_object1401))__sepReset__F_P9sofstream__1), ((void (*)(void *__anonymous_object1402, _Bool __anonymous_object1403))__sepReset__F_P9sofstreamb__1), ((const char *(*)(void *__anonymous_object1404))__sepGetCur__FPCc_P9sofstream__1), ((void (*)(void *__anonymous_object1405, const char *__anonymous_object1406))__sepSetCur__F_P9sofstreamPCc__1), ((_Bool (*)(void *__anonymous_object1407))__getNL__Fb_P9sofstream__1), ((void (*)(void *__anonymous_object1408, _Bool __anonymous_object1409))__setNL__F_P9sofstreamb__1), ((void (*)(void *__anonymous_object1410))__sepOn__F_P9sofstream__1), ((void (*)(void *__anonymous_object1411))__sepOff__F_P9sofstream__1), ((_Bool (*)(void *__anonymous_object1412))__sepDisable__Fb_P9sofstream__1), ((_Bool (*)(void *__anonymous_object1413))__sepEnable__Fb_P9sofstream__1), ((const char *(*)(void *__anonymous_object1414))__sepGet__FPCc_P9sofstream__1), ((void (*)(void *__anonymous_object1415, const char *__anonymous_object1416))__sepSet__F_P9sofstreamPCc__1), ((const char *(*)(void *__anonymous_object1417))__sepGetTuple__FPCc_P9sofstream__1), ((void (*)(void *__anonymous_object1418, const char *__anonymous_object1419))__sepSetTuple__F_P9sofstreamPCc__1), ((signed int (*)(void *__anonymous_object1420))__fail__Fi_P9sofstream__1), ((signed int (*)(void *__anonymous_object1421))__flush__Fi_P9sofstream__1), ((void (*)(void *__os__P7tostype_1, const char *__name__PCc_1, const char *__mode__PCc_1))__open__F_P9sofstreamPCcPCc__1), ((void (*)(void *__os__P7tostype_1))__close__F_P9sofstream__1), ((void *(*)(void *__anonymous_object1422, const char *__anonymous_object1423, unsigned long int __anonymous_object1424))__write__FP9sofstream_P9sofstreamPCcUl__1), ((signed int (*)(void *__anonymous_object1425, const char *__fmt__PCc_1, ...))__fmt__Fi_P9sofstreamPCc__1), ((void *)__sout__P9sofstream_1), "char "))) , _tmp_cp_ret0)), __v__c_1))) , _tmp_cp_ret1)), ((void *(*)(void *__anonymous_object1426))(&_thunk0))))) , _tmp_cp_ret2));437 return __endl__A0_1_0_0___sepPrt__PFb_Pd0___sepReset__PF_Pd0___sepReset__PF_Pd0b___sepGetCur__PFPCc_Pd0___sepSetCur__PF_Pd0PCc___getNL__PFb_Pd0___setNL__PF_Pd0b___sepOn__PF_Pd0___sepOff__PF_Pd0___sepDisable__PFb_Pd0___sepEnable__PFb_Pd0___sepGet__PFPCc_Pd0___sepSet__PF_Pd0PCc___sepGetTuple__PFPCc_Pd0___sepSetTuple__PF_Pd0PCc___fail__PFi_Pd0___flush__PFi_Pd0___open__PF_Pd0PCcPCc___close__PF_Pd0___write__PFPd0_Pd0PCcUl___fmt__PFi_Pd0PCc__FPd0_Pd0__1(((_Bool (*)(void *__anonymous_object1322))__sepPrt__Fb_P9sofstream__1), ((void (*)(void *__anonymous_object1323))__sepReset__F_P9sofstream__1), ((void (*)(void *__anonymous_object1324, _Bool __anonymous_object1325))__sepReset__F_P9sofstreamb__1), ((const char *(*)(void *__anonymous_object1326))__sepGetCur__FPCc_P9sofstream__1), ((void (*)(void *__anonymous_object1327, const char *__anonymous_object1328))__sepSetCur__F_P9sofstreamPCc__1), ((_Bool (*)(void *__anonymous_object1329))__getNL__Fb_P9sofstream__1), ((void (*)(void *__anonymous_object1330, _Bool __anonymous_object1331))__setNL__F_P9sofstreamb__1), ((void (*)(void *__anonymous_object1332))__sepOn__F_P9sofstream__1), ((void (*)(void *__anonymous_object1333))__sepOff__F_P9sofstream__1), ((_Bool (*)(void *__anonymous_object1334))__sepDisable__Fb_P9sofstream__1), ((_Bool (*)(void *__anonymous_object1335))__sepEnable__Fb_P9sofstream__1), ((const char *(*)(void *__anonymous_object1336))__sepGet__FPCc_P9sofstream__1), ((void (*)(void *__anonymous_object1337, const char *__anonymous_object1338))__sepSet__F_P9sofstreamPCc__1), ((const char *(*)(void *__anonymous_object1339))__sepGetTuple__FPCc_P9sofstream__1), ((void (*)(void *__anonymous_object1340, const char *__anonymous_object1341))__sepSetTuple__F_P9sofstreamPCc__1), ((signed int (*)(void *__anonymous_object1342))__fail__Fi_P9sofstream__1), ((signed int (*)(void *__anonymous_object1343))__flush__Fi_P9sofstream__1), ((void (*)(void *__os__P7tostype_1, const char *__name__PCc_1, const char *__mode__PCc_1))__open__F_P9sofstreamPCcPCc__1), ((void (*)(void *__os__P7tostype_1))__close__F_P9sofstream__1), ((void *(*)(void *__anonymous_object1344, const char *__anonymous_object1345, unsigned long int __anonymous_object1346))__write__FP9sofstream_P9sofstreamPCcUl__1), ((signed int (*)(void *__anonymous_object1347, const char *__fmt__PCc_1, ...))__fmt__Fi_P9sofstreamPCc__1), _p0); 438 } 439 ((void)(((void)(_tmp_cp_ret2=___operator_bitor__A0_1_0_0___sepPrt__PFb_Pd0___sepReset__PF_Pd0___sepReset__PF_Pd0b___sepGetCur__PFPCc_Pd0___sepSetCur__PF_Pd0PCc___getNL__PFb_Pd0___setNL__PF_Pd0b___sepOn__PF_Pd0___sepOff__PF_Pd0___sepDisable__PFb_Pd0___sepEnable__PFb_Pd0___sepGet__PFPCc_Pd0___sepSet__PF_Pd0PCc___sepGetTuple__PFPCc_Pd0___sepSetTuple__PF_Pd0PCc___fail__PFi_Pd0___flush__PFi_Pd0___open__PF_Pd0PCcPCc___close__PF_Pd0___write__PFPd0_Pd0PCcUl___fmt__PFi_Pd0PCc__FPd0_Pd0PFPd0_Pd0___1(((_Bool (*)(void *__anonymous_object1348))__sepPrt__Fb_P9sofstream__1), ((void (*)(void *__anonymous_object1349))__sepReset__F_P9sofstream__1), ((void (*)(void *__anonymous_object1350, _Bool __anonymous_object1351))__sepReset__F_P9sofstreamb__1), ((const char *(*)(void *__anonymous_object1352))__sepGetCur__FPCc_P9sofstream__1), ((void (*)(void *__anonymous_object1353, const char *__anonymous_object1354))__sepSetCur__F_P9sofstreamPCc__1), ((_Bool (*)(void *__anonymous_object1355))__getNL__Fb_P9sofstream__1), ((void (*)(void *__anonymous_object1356, _Bool __anonymous_object1357))__setNL__F_P9sofstreamb__1), ((void (*)(void *__anonymous_object1358))__sepOn__F_P9sofstream__1), ((void (*)(void *__anonymous_object1359))__sepOff__F_P9sofstream__1), ((_Bool (*)(void *__anonymous_object1360))__sepDisable__Fb_P9sofstream__1), ((_Bool (*)(void *__anonymous_object1361))__sepEnable__Fb_P9sofstream__1), ((const char *(*)(void *__anonymous_object1362))__sepGet__FPCc_P9sofstream__1), ((void (*)(void *__anonymous_object1363, const char *__anonymous_object1364))__sepSet__F_P9sofstreamPCc__1), ((const char *(*)(void *__anonymous_object1365))__sepGetTuple__FPCc_P9sofstream__1), ((void (*)(void *__anonymous_object1366, const char *__anonymous_object1367))__sepSetTuple__F_P9sofstreamPCc__1), ((signed int (*)(void *__anonymous_object1368))__fail__Fi_P9sofstream__1), ((signed int (*)(void *__anonymous_object1369))__flush__Fi_P9sofstream__1), ((void (*)(void *__os__P7tostype_1, const char *__name__PCc_1, const char *__mode__PCc_1))__open__F_P9sofstreamPCcPCc__1), ((void (*)(void *__os__P7tostype_1))__close__F_P9sofstream__1), ((void *(*)(void *__anonymous_object1370, const char *__anonymous_object1371, unsigned long int __anonymous_object1372))__write__FP9sofstream_P9sofstreamPCcUl__1), ((signed int (*)(void *__anonymous_object1373, const char *__fmt__PCc_1, ...))__fmt__Fi_P9sofstreamPCc__1), (((void)(_tmp_cp_ret1=___operator_bitor__A0_1_0_0___sepPrt__PFb_Pd0___sepReset__PF_Pd0___sepReset__PF_Pd0b___sepGetCur__PFPCc_Pd0___sepSetCur__PF_Pd0PCc___getNL__PFb_Pd0___setNL__PF_Pd0b___sepOn__PF_Pd0___sepOff__PF_Pd0___sepDisable__PFb_Pd0___sepEnable__PFb_Pd0___sepGet__PFPCc_Pd0___sepSet__PF_Pd0PCc___sepGetTuple__PFPCc_Pd0___sepSetTuple__PF_Pd0PCc___fail__PFi_Pd0___flush__PFi_Pd0___open__PF_Pd0PCcPCc___close__PF_Pd0___write__PFPd0_Pd0PCcUl___fmt__PFi_Pd0PCc__FPd0_Pd0c__1(((_Bool (*)(void *__anonymous_object1374))__sepPrt__Fb_P9sofstream__1), ((void (*)(void *__anonymous_object1375))__sepReset__F_P9sofstream__1), ((void (*)(void *__anonymous_object1376, _Bool __anonymous_object1377))__sepReset__F_P9sofstreamb__1), ((const char *(*)(void *__anonymous_object1378))__sepGetCur__FPCc_P9sofstream__1), ((void (*)(void *__anonymous_object1379, const char *__anonymous_object1380))__sepSetCur__F_P9sofstreamPCc__1), ((_Bool (*)(void *__anonymous_object1381))__getNL__Fb_P9sofstream__1), ((void (*)(void *__anonymous_object1382, _Bool __anonymous_object1383))__setNL__F_P9sofstreamb__1), ((void (*)(void *__anonymous_object1384))__sepOn__F_P9sofstream__1), ((void (*)(void *__anonymous_object1385))__sepOff__F_P9sofstream__1), ((_Bool (*)(void *__anonymous_object1386))__sepDisable__Fb_P9sofstream__1), ((_Bool (*)(void *__anonymous_object1387))__sepEnable__Fb_P9sofstream__1), ((const char *(*)(void *__anonymous_object1388))__sepGet__FPCc_P9sofstream__1), ((void (*)(void *__anonymous_object1389, const char *__anonymous_object1390))__sepSet__F_P9sofstreamPCc__1), ((const char *(*)(void *__anonymous_object1391))__sepGetTuple__FPCc_P9sofstream__1), ((void (*)(void *__anonymous_object1392, const char *__anonymous_object1393))__sepSetTuple__F_P9sofstreamPCc__1), ((signed int (*)(void *__anonymous_object1394))__fail__Fi_P9sofstream__1), ((signed int (*)(void *__anonymous_object1395))__flush__Fi_P9sofstream__1), ((void (*)(void *__os__P7tostype_1, const char *__name__PCc_1, const char *__mode__PCc_1))__open__F_P9sofstreamPCcPCc__1), ((void (*)(void *__os__P7tostype_1))__close__F_P9sofstream__1), ((void *(*)(void *__anonymous_object1396, const char *__anonymous_object1397, unsigned long int __anonymous_object1398))__write__FP9sofstream_P9sofstreamPCcUl__1), ((signed int (*)(void *__anonymous_object1399, const char *__fmt__PCc_1, ...))__fmt__Fi_P9sofstreamPCc__1), (((void)(_tmp_cp_ret0=___operator_bitor__A0_1_0_0___sepPrt__PFb_Pd0___sepReset__PF_Pd0___sepReset__PF_Pd0b___sepGetCur__PFPCc_Pd0___sepSetCur__PF_Pd0PCc___getNL__PFb_Pd0___setNL__PF_Pd0b___sepOn__PF_Pd0___sepOff__PF_Pd0___sepDisable__PFb_Pd0___sepEnable__PFb_Pd0___sepGet__PFPCc_Pd0___sepSet__PF_Pd0PCc___sepGetTuple__PFPCc_Pd0___sepSetTuple__PF_Pd0PCc___fail__PFi_Pd0___flush__PFi_Pd0___open__PF_Pd0PCcPCc___close__PF_Pd0___write__PFPd0_Pd0PCcUl___fmt__PFi_Pd0PCc__FPd0_Pd0PCc__1(((_Bool (*)(void *__anonymous_object1400))__sepPrt__Fb_P9sofstream__1), ((void (*)(void *__anonymous_object1401))__sepReset__F_P9sofstream__1), ((void (*)(void *__anonymous_object1402, _Bool __anonymous_object1403))__sepReset__F_P9sofstreamb__1), ((const char *(*)(void *__anonymous_object1404))__sepGetCur__FPCc_P9sofstream__1), ((void (*)(void *__anonymous_object1405, const char *__anonymous_object1406))__sepSetCur__F_P9sofstreamPCc__1), ((_Bool (*)(void *__anonymous_object1407))__getNL__Fb_P9sofstream__1), ((void (*)(void *__anonymous_object1408, _Bool __anonymous_object1409))__setNL__F_P9sofstreamb__1), ((void (*)(void *__anonymous_object1410))__sepOn__F_P9sofstream__1), ((void (*)(void *__anonymous_object1411))__sepOff__F_P9sofstream__1), ((_Bool (*)(void *__anonymous_object1412))__sepDisable__Fb_P9sofstream__1), ((_Bool (*)(void *__anonymous_object1413))__sepEnable__Fb_P9sofstream__1), ((const char *(*)(void *__anonymous_object1414))__sepGet__FPCc_P9sofstream__1), ((void (*)(void *__anonymous_object1415, const char *__anonymous_object1416))__sepSet__F_P9sofstreamPCc__1), ((const char *(*)(void *__anonymous_object1417))__sepGetTuple__FPCc_P9sofstream__1), ((void (*)(void *__anonymous_object1418, const char *__anonymous_object1419))__sepSetTuple__F_P9sofstreamPCc__1), ((signed int (*)(void *__anonymous_object1420))__fail__Fi_P9sofstream__1), ((signed int (*)(void *__anonymous_object1421))__flush__Fi_P9sofstream__1), ((void (*)(void *__os__P7tostype_1, const char *__name__PCc_1, const char *__mode__PCc_1))__open__F_P9sofstreamPCcPCc__1), ((void (*)(void *__os__P7tostype_1))__close__F_P9sofstream__1), ((void *(*)(void *__anonymous_object1422, const char *__anonymous_object1423, unsigned long int __anonymous_object1424))__write__FP9sofstream_P9sofstreamPCcUl__1), ((signed int (*)(void *__anonymous_object1425, const char *__fmt__PCc_1, ...))__fmt__Fi_P9sofstreamPCc__1), __sout__P9sofstream_1, "char "))) , _tmp_cp_ret0), __v__c_1))) , _tmp_cp_ret1), ((void *(*)(void *__anonymous_object1426))(&_thunk0))))) , _tmp_cp_ret2)); 471 440 ((void)(_tmp_cp_ret0) /* ^?{} */); 472 441 ((void)(_tmp_cp_ret1) /* ^?{} */); … … 478 447 struct ofstream *_tmp_cp_ret5; 479 448 __attribute__ ((unused)) struct ofstream *_thunk1(struct ofstream *_p0){ 480 return __endl__A0_1_0_0___sepPrt__PFb_Pd0___sepReset__PF_Pd0___sepReset__PF_Pd0b___sepGetCur__PFPCc_Pd0___sepSetCur__PF_Pd0PCc___getNL__PFb_Pd0___setNL__PF_Pd0b___sepOn__PF_Pd0___sepOff__PF_Pd0___sepDisable__PFb_Pd0___sepEnable__PFb_Pd0___sepGet__PFPCc_Pd0___sepSet__PF_Pd0PCc___sepGetTuple__PFPCc_Pd0___sepSetTuple__PF_Pd0PCc___fail__PFi_Pd0___flush__PFi_Pd0___open__PF_Pd0PCcPCc___close__PF_Pd0___write__PFPd0_Pd0PCcUl___fmt__PFi_Pd0PCc__FPd0_Pd0__1(((_Bool (*)(void *__anonymous_object1427))__sepPrt__Fb_P9sofstream__1), ((void (*)(void *__anonymous_object1428))__sepReset__F_P9sofstream__1), ((void (*)(void *__anonymous_object1429, _Bool __anonymous_object1430))__sepReset__F_P9sofstreamb__1), ((const char *(*)(void *__anonymous_object1431))__sepGetCur__FPCc_P9sofstream__1), ((void (*)(void *__anonymous_object1432, const char *__anonymous_object1433))__sepSetCur__F_P9sofstreamPCc__1), ((_Bool (*)(void *__anonymous_object1434))__getNL__Fb_P9sofstream__1), ((void (*)(void *__anonymous_object1435, _Bool __anonymous_object1436))__setNL__F_P9sofstreamb__1), ((void (*)(void *__anonymous_object1437))__sepOn__F_P9sofstream__1), ((void (*)(void *__anonymous_object1438))__sepOff__F_P9sofstream__1), ((_Bool (*)(void *__anonymous_object1439))__sepDisable__Fb_P9sofstream__1), ((_Bool (*)(void *__anonymous_object1440))__sepEnable__Fb_P9sofstream__1), ((const char *(*)(void *__anonymous_object1441))__sepGet__FPCc_P9sofstream__1), ((void (*)(void *__anonymous_object1442, const char *__anonymous_object1443))__sepSet__F_P9sofstreamPCc__1), ((const char *(*)(void *__anonymous_object1444))__sepGetTuple__FPCc_P9sofstream__1), ((void (*)(void *__anonymous_object1445, const char *__anonymous_object1446))__sepSetTuple__F_P9sofstreamPCc__1), ((signed int (*)(void *__anonymous_object1447))__fail__Fi_P9sofstream__1), ((signed int (*)(void *__anonymous_object1448))__flush__Fi_P9sofstream__1), ((void (*)(void *__os__P7tostype_1, const char *__name__PCc_1, const char *__mode__PCc_1))__open__F_P9sofstreamPCcPCc__1), ((void (*)(void *__os__P7tostype_1))__close__F_P9sofstream__1), ((void *(*)(void *__anonymous_object1449, const char *__anonymous_object1450, unsigned long int __anonymous_object1451))__write__FP9sofstream_P9sofstreamPCcUl__1), ((signed int (*)(void *__anonymous_object1452, const char *__fmt__PCc_1, ...))__fmt__Fi_P9sofstreamPCc__1), ((void *)_p0));481 } 482 ((void)(((void)(_tmp_cp_ret5=___operator_bitor__A0_1_0_0___sepPrt__PFb_Pd0___sepReset__PF_Pd0___sepReset__PF_Pd0b___sepGetCur__PFPCc_Pd0___sepSetCur__PF_Pd0PCc___getNL__PFb_Pd0___setNL__PF_Pd0b___sepOn__PF_Pd0___sepOff__PF_Pd0___sepDisable__PFb_Pd0___sepEnable__PFb_Pd0___sepGet__PFPCc_Pd0___sepSet__PF_Pd0PCc___sepGetTuple__PFPCc_Pd0___sepSetTuple__PF_Pd0PCc___fail__PFi_Pd0___flush__PFi_Pd0___open__PF_Pd0PCcPCc___close__PF_Pd0___write__PFPd0_Pd0PCcUl___fmt__PFi_Pd0PCc__FPd0_Pd0PFPd0_Pd0___1(((_Bool (*)(void *__anonymous_object1453))__sepPrt__Fb_P9sofstream__1), ((void (*)(void *__anonymous_object1454))__sepReset__F_P9sofstream__1), ((void (*)(void *__anonymous_object1455, _Bool __anonymous_object1456))__sepReset__F_P9sofstreamb__1), ((const char *(*)(void *__anonymous_object1457))__sepGetCur__FPCc_P9sofstream__1), ((void (*)(void *__anonymous_object1458, const char *__anonymous_object1459))__sepSetCur__F_P9sofstreamPCc__1), ((_Bool (*)(void *__anonymous_object1460))__getNL__Fb_P9sofstream__1), ((void (*)(void *__anonymous_object1461, _Bool __anonymous_object1462))__setNL__F_P9sofstreamb__1), ((void (*)(void *__anonymous_object1463))__sepOn__F_P9sofstream__1), ((void (*)(void *__anonymous_object1464))__sepOff__F_P9sofstream__1), ((_Bool (*)(void *__anonymous_object1465))__sepDisable__Fb_P9sofstream__1), ((_Bool (*)(void *__anonymous_object1466))__sepEnable__Fb_P9sofstream__1), ((const char *(*)(void *__anonymous_object1467))__sepGet__FPCc_P9sofstream__1), ((void (*)(void *__anonymous_object1468, const char *__anonymous_object1469))__sepSet__F_P9sofstreamPCc__1), ((const char *(*)(void *__anonymous_object1470))__sepGetTuple__FPCc_P9sofstream__1), ((void (*)(void *__anonymous_object1471, const char *__anonymous_object1472))__sepSetTuple__F_P9sofstreamPCc__1), ((signed int (*)(void *__anonymous_object1473))__fail__Fi_P9sofstream__1), ((signed int (*)(void *__anonymous_object1474))__flush__Fi_P9sofstream__1), ((void (*)(void *__os__P7tostype_1, const char *__name__PCc_1, const char *__mode__PCc_1))__open__F_P9sofstreamPCcPCc__1), ((void (*)(void *__os__P7tostype_1))__close__F_P9sofstream__1), ((void *(*)(void *__anonymous_object1475, const char *__anonymous_object1476, unsigned long int __anonymous_object1477))__write__FP9sofstream_P9sofstreamPCcUl__1), ((signed int (*)(void *__anonymous_object1478, const char *__fmt__PCc_1, ...))__fmt__Fi_P9sofstreamPCc__1), (( void *)(((void)(_tmp_cp_ret4=___operator_bitor__A0_1_0_0___sepPrt__PFb_Pd0___sepReset__PF_Pd0___sepReset__PF_Pd0b___sepGetCur__PFPCc_Pd0___sepSetCur__PF_Pd0PCc___getNL__PFb_Pd0___setNL__PF_Pd0b___sepOn__PF_Pd0___sepOff__PF_Pd0___sepDisable__PFb_Pd0___sepEnable__PFb_Pd0___sepGet__PFPCc_Pd0___sepSet__PF_Pd0PCc___sepGetTuple__PFPCc_Pd0___sepSetTuple__PF_Pd0PCc___fail__PFi_Pd0___flush__PFi_Pd0___open__PF_Pd0PCcPCc___close__PF_Pd0___write__PFPd0_Pd0PCcUl___fmt__PFi_Pd0PCc__FPd0_Pd0Sc__1(((_Bool (*)(void *__anonymous_object1479))__sepPrt__Fb_P9sofstream__1), ((void (*)(void *__anonymous_object1480))__sepReset__F_P9sofstream__1), ((void (*)(void *__anonymous_object1481, _Bool __anonymous_object1482))__sepReset__F_P9sofstreamb__1), ((const char *(*)(void *__anonymous_object1483))__sepGetCur__FPCc_P9sofstream__1), ((void (*)(void *__anonymous_object1484, const char *__anonymous_object1485))__sepSetCur__F_P9sofstreamPCc__1), ((_Bool (*)(void *__anonymous_object1486))__getNL__Fb_P9sofstream__1), ((void (*)(void *__anonymous_object1487, _Bool __anonymous_object1488))__setNL__F_P9sofstreamb__1), ((void (*)(void *__anonymous_object1489))__sepOn__F_P9sofstream__1), ((void (*)(void *__anonymous_object1490))__sepOff__F_P9sofstream__1), ((_Bool (*)(void *__anonymous_object1491))__sepDisable__Fb_P9sofstream__1), ((_Bool (*)(void *__anonymous_object1492))__sepEnable__Fb_P9sofstream__1), ((const char *(*)(void *__anonymous_object1493))__sepGet__FPCc_P9sofstream__1), ((void (*)(void *__anonymous_object1494, const char *__anonymous_object1495))__sepSet__F_P9sofstreamPCc__1), ((const char *(*)(void *__anonymous_object1496))__sepGetTuple__FPCc_P9sofstream__1), ((void (*)(void *__anonymous_object1497, const char *__anonymous_object1498))__sepSetTuple__F_P9sofstreamPCc__1), ((signed int (*)(void *__anonymous_object1499))__fail__Fi_P9sofstream__1), ((signed int (*)(void *__anonymous_object1500))__flush__Fi_P9sofstream__1), ((void (*)(void *__os__P7tostype_1, const char *__name__PCc_1, const char *__mode__PCc_1))__open__F_P9sofstreamPCcPCc__1), ((void (*)(void *__os__P7tostype_1))__close__F_P9sofstream__1), ((void *(*)(void *__anonymous_object1501, const char *__anonymous_object1502, unsigned long int __anonymous_object1503))__write__FP9sofstream_P9sofstreamPCcUl__1), ((signed int (*)(void *__anonymous_object1504, const char *__fmt__PCc_1, ...))__fmt__Fi_P9sofstreamPCc__1), ((void *)(((void)(_tmp_cp_ret3=___operator_bitor__A0_1_0_0___sepPrt__PFb_Pd0___sepReset__PF_Pd0___sepReset__PF_Pd0b___sepGetCur__PFPCc_Pd0___sepSetCur__PF_Pd0PCc___getNL__PFb_Pd0___setNL__PF_Pd0b___sepOn__PF_Pd0___sepOff__PF_Pd0___sepDisable__PFb_Pd0___sepEnable__PFb_Pd0___sepGet__PFPCc_Pd0___sepSet__PF_Pd0PCc___sepGetTuple__PFPCc_Pd0___sepSetTuple__PF_Pd0PCc___fail__PFi_Pd0___flush__PFi_Pd0___open__PF_Pd0PCcPCc___close__PF_Pd0___write__PFPd0_Pd0PCcUl___fmt__PFi_Pd0PCc__FPd0_Pd0PCc__1(((_Bool (*)(void *__anonymous_object1505))__sepPrt__Fb_P9sofstream__1), ((void (*)(void *__anonymous_object1506))__sepReset__F_P9sofstream__1), ((void (*)(void *__anonymous_object1507, _Bool __anonymous_object1508))__sepReset__F_P9sofstreamb__1), ((const char *(*)(void *__anonymous_object1509))__sepGetCur__FPCc_P9sofstream__1), ((void (*)(void *__anonymous_object1510, const char *__anonymous_object1511))__sepSetCur__F_P9sofstreamPCc__1), ((_Bool (*)(void *__anonymous_object1512))__getNL__Fb_P9sofstream__1), ((void (*)(void *__anonymous_object1513, _Bool __anonymous_object1514))__setNL__F_P9sofstreamb__1), ((void (*)(void *__anonymous_object1515))__sepOn__F_P9sofstream__1), ((void (*)(void *__anonymous_object1516))__sepOff__F_P9sofstream__1), ((_Bool (*)(void *__anonymous_object1517))__sepDisable__Fb_P9sofstream__1), ((_Bool (*)(void *__anonymous_object1518))__sepEnable__Fb_P9sofstream__1), ((const char *(*)(void *__anonymous_object1519))__sepGet__FPCc_P9sofstream__1), ((void (*)(void *__anonymous_object1520, const char *__anonymous_object1521))__sepSet__F_P9sofstreamPCc__1), ((const char *(*)(void *__anonymous_object1522))__sepGetTuple__FPCc_P9sofstream__1), ((void (*)(void *__anonymous_object1523, const char *__anonymous_object1524))__sepSetTuple__F_P9sofstreamPCc__1), ((signed int (*)(void *__anonymous_object1525))__fail__Fi_P9sofstream__1), ((signed int (*)(void *__anonymous_object1526))__flush__Fi_P9sofstream__1), ((void (*)(void *__os__P7tostype_1, const char *__name__PCc_1, const char *__mode__PCc_1))__open__F_P9sofstreamPCcPCc__1), ((void (*)(void *__os__P7tostype_1))__close__F_P9sofstream__1), ((void *(*)(void *__anonymous_object1527, const char *__anonymous_object1528, unsigned long int __anonymous_object1529))__write__FP9sofstream_P9sofstreamPCcUl__1), ((signed int (*)(void *__anonymous_object1530, const char *__fmt__PCc_1, ...))__fmt__Fi_P9sofstreamPCc__1), ((void *)__sout__P9sofstream_1), "signed char "))) , _tmp_cp_ret3)), __v__Sc_1))) , _tmp_cp_ret4)), ((void *(*)(void *__anonymous_object1531))(&_thunk1))))) , _tmp_cp_ret5));449 return __endl__A0_1_0_0___sepPrt__PFb_Pd0___sepReset__PF_Pd0___sepReset__PF_Pd0b___sepGetCur__PFPCc_Pd0___sepSetCur__PF_Pd0PCc___getNL__PFb_Pd0___setNL__PF_Pd0b___sepOn__PF_Pd0___sepOff__PF_Pd0___sepDisable__PFb_Pd0___sepEnable__PFb_Pd0___sepGet__PFPCc_Pd0___sepSet__PF_Pd0PCc___sepGetTuple__PFPCc_Pd0___sepSetTuple__PF_Pd0PCc___fail__PFi_Pd0___flush__PFi_Pd0___open__PF_Pd0PCcPCc___close__PF_Pd0___write__PFPd0_Pd0PCcUl___fmt__PFi_Pd0PCc__FPd0_Pd0__1(((_Bool (*)(void *__anonymous_object1427))__sepPrt__Fb_P9sofstream__1), ((void (*)(void *__anonymous_object1428))__sepReset__F_P9sofstream__1), ((void (*)(void *__anonymous_object1429, _Bool __anonymous_object1430))__sepReset__F_P9sofstreamb__1), ((const char *(*)(void *__anonymous_object1431))__sepGetCur__FPCc_P9sofstream__1), ((void (*)(void *__anonymous_object1432, const char *__anonymous_object1433))__sepSetCur__F_P9sofstreamPCc__1), ((_Bool (*)(void *__anonymous_object1434))__getNL__Fb_P9sofstream__1), ((void (*)(void *__anonymous_object1435, _Bool __anonymous_object1436))__setNL__F_P9sofstreamb__1), ((void (*)(void *__anonymous_object1437))__sepOn__F_P9sofstream__1), ((void (*)(void *__anonymous_object1438))__sepOff__F_P9sofstream__1), ((_Bool (*)(void *__anonymous_object1439))__sepDisable__Fb_P9sofstream__1), ((_Bool (*)(void *__anonymous_object1440))__sepEnable__Fb_P9sofstream__1), ((const char *(*)(void *__anonymous_object1441))__sepGet__FPCc_P9sofstream__1), ((void (*)(void *__anonymous_object1442, const char *__anonymous_object1443))__sepSet__F_P9sofstreamPCc__1), ((const char *(*)(void *__anonymous_object1444))__sepGetTuple__FPCc_P9sofstream__1), ((void (*)(void *__anonymous_object1445, const char *__anonymous_object1446))__sepSetTuple__F_P9sofstreamPCc__1), ((signed int (*)(void *__anonymous_object1447))__fail__Fi_P9sofstream__1), ((signed int (*)(void *__anonymous_object1448))__flush__Fi_P9sofstream__1), ((void (*)(void *__os__P7tostype_1, const char *__name__PCc_1, const char *__mode__PCc_1))__open__F_P9sofstreamPCcPCc__1), ((void (*)(void *__os__P7tostype_1))__close__F_P9sofstream__1), ((void *(*)(void *__anonymous_object1449, const char *__anonymous_object1450, unsigned long int __anonymous_object1451))__write__FP9sofstream_P9sofstreamPCcUl__1), ((signed int (*)(void *__anonymous_object1452, const char *__fmt__PCc_1, ...))__fmt__Fi_P9sofstreamPCc__1), _p0); 450 } 451 ((void)(((void)(_tmp_cp_ret5=___operator_bitor__A0_1_0_0___sepPrt__PFb_Pd0___sepReset__PF_Pd0___sepReset__PF_Pd0b___sepGetCur__PFPCc_Pd0___sepSetCur__PF_Pd0PCc___getNL__PFb_Pd0___setNL__PF_Pd0b___sepOn__PF_Pd0___sepOff__PF_Pd0___sepDisable__PFb_Pd0___sepEnable__PFb_Pd0___sepGet__PFPCc_Pd0___sepSet__PF_Pd0PCc___sepGetTuple__PFPCc_Pd0___sepSetTuple__PF_Pd0PCc___fail__PFi_Pd0___flush__PFi_Pd0___open__PF_Pd0PCcPCc___close__PF_Pd0___write__PFPd0_Pd0PCcUl___fmt__PFi_Pd0PCc__FPd0_Pd0PFPd0_Pd0___1(((_Bool (*)(void *__anonymous_object1453))__sepPrt__Fb_P9sofstream__1), ((void (*)(void *__anonymous_object1454))__sepReset__F_P9sofstream__1), ((void (*)(void *__anonymous_object1455, _Bool __anonymous_object1456))__sepReset__F_P9sofstreamb__1), ((const char *(*)(void *__anonymous_object1457))__sepGetCur__FPCc_P9sofstream__1), ((void (*)(void *__anonymous_object1458, const char *__anonymous_object1459))__sepSetCur__F_P9sofstreamPCc__1), ((_Bool (*)(void *__anonymous_object1460))__getNL__Fb_P9sofstream__1), ((void (*)(void *__anonymous_object1461, _Bool __anonymous_object1462))__setNL__F_P9sofstreamb__1), ((void (*)(void *__anonymous_object1463))__sepOn__F_P9sofstream__1), ((void (*)(void *__anonymous_object1464))__sepOff__F_P9sofstream__1), ((_Bool (*)(void *__anonymous_object1465))__sepDisable__Fb_P9sofstream__1), ((_Bool (*)(void *__anonymous_object1466))__sepEnable__Fb_P9sofstream__1), ((const char *(*)(void *__anonymous_object1467))__sepGet__FPCc_P9sofstream__1), ((void (*)(void *__anonymous_object1468, const char *__anonymous_object1469))__sepSet__F_P9sofstreamPCc__1), ((const char *(*)(void *__anonymous_object1470))__sepGetTuple__FPCc_P9sofstream__1), ((void (*)(void *__anonymous_object1471, const char *__anonymous_object1472))__sepSetTuple__F_P9sofstreamPCc__1), ((signed int (*)(void *__anonymous_object1473))__fail__Fi_P9sofstream__1), ((signed int (*)(void *__anonymous_object1474))__flush__Fi_P9sofstream__1), ((void (*)(void *__os__P7tostype_1, const char *__name__PCc_1, const char *__mode__PCc_1))__open__F_P9sofstreamPCcPCc__1), ((void (*)(void *__os__P7tostype_1))__close__F_P9sofstream__1), ((void *(*)(void *__anonymous_object1475, const char *__anonymous_object1476, unsigned long int __anonymous_object1477))__write__FP9sofstream_P9sofstreamPCcUl__1), ((signed int (*)(void *__anonymous_object1478, const char *__fmt__PCc_1, ...))__fmt__Fi_P9sofstreamPCc__1), (((void)(_tmp_cp_ret4=___operator_bitor__A0_1_0_0___sepPrt__PFb_Pd0___sepReset__PF_Pd0___sepReset__PF_Pd0b___sepGetCur__PFPCc_Pd0___sepSetCur__PF_Pd0PCc___getNL__PFb_Pd0___setNL__PF_Pd0b___sepOn__PF_Pd0___sepOff__PF_Pd0___sepDisable__PFb_Pd0___sepEnable__PFb_Pd0___sepGet__PFPCc_Pd0___sepSet__PF_Pd0PCc___sepGetTuple__PFPCc_Pd0___sepSetTuple__PF_Pd0PCc___fail__PFi_Pd0___flush__PFi_Pd0___open__PF_Pd0PCcPCc___close__PF_Pd0___write__PFPd0_Pd0PCcUl___fmt__PFi_Pd0PCc__FPd0_Pd0Sc__1(((_Bool (*)(void *__anonymous_object1479))__sepPrt__Fb_P9sofstream__1), ((void (*)(void *__anonymous_object1480))__sepReset__F_P9sofstream__1), ((void (*)(void *__anonymous_object1481, _Bool __anonymous_object1482))__sepReset__F_P9sofstreamb__1), ((const char *(*)(void *__anonymous_object1483))__sepGetCur__FPCc_P9sofstream__1), ((void (*)(void *__anonymous_object1484, const char *__anonymous_object1485))__sepSetCur__F_P9sofstreamPCc__1), ((_Bool (*)(void *__anonymous_object1486))__getNL__Fb_P9sofstream__1), ((void (*)(void *__anonymous_object1487, _Bool __anonymous_object1488))__setNL__F_P9sofstreamb__1), ((void (*)(void *__anonymous_object1489))__sepOn__F_P9sofstream__1), ((void (*)(void *__anonymous_object1490))__sepOff__F_P9sofstream__1), ((_Bool (*)(void *__anonymous_object1491))__sepDisable__Fb_P9sofstream__1), ((_Bool (*)(void *__anonymous_object1492))__sepEnable__Fb_P9sofstream__1), ((const char *(*)(void *__anonymous_object1493))__sepGet__FPCc_P9sofstream__1), ((void (*)(void *__anonymous_object1494, const char *__anonymous_object1495))__sepSet__F_P9sofstreamPCc__1), ((const char *(*)(void *__anonymous_object1496))__sepGetTuple__FPCc_P9sofstream__1), ((void (*)(void *__anonymous_object1497, const char *__anonymous_object1498))__sepSetTuple__F_P9sofstreamPCc__1), ((signed int (*)(void *__anonymous_object1499))__fail__Fi_P9sofstream__1), ((signed int (*)(void *__anonymous_object1500))__flush__Fi_P9sofstream__1), ((void (*)(void *__os__P7tostype_1, const char *__name__PCc_1, const char *__mode__PCc_1))__open__F_P9sofstreamPCcPCc__1), ((void (*)(void *__os__P7tostype_1))__close__F_P9sofstream__1), ((void *(*)(void *__anonymous_object1501, const char *__anonymous_object1502, unsigned long int __anonymous_object1503))__write__FP9sofstream_P9sofstreamPCcUl__1), ((signed int (*)(void *__anonymous_object1504, const char *__fmt__PCc_1, ...))__fmt__Fi_P9sofstreamPCc__1), (((void)(_tmp_cp_ret3=___operator_bitor__A0_1_0_0___sepPrt__PFb_Pd0___sepReset__PF_Pd0___sepReset__PF_Pd0b___sepGetCur__PFPCc_Pd0___sepSetCur__PF_Pd0PCc___getNL__PFb_Pd0___setNL__PF_Pd0b___sepOn__PF_Pd0___sepOff__PF_Pd0___sepDisable__PFb_Pd0___sepEnable__PFb_Pd0___sepGet__PFPCc_Pd0___sepSet__PF_Pd0PCc___sepGetTuple__PFPCc_Pd0___sepSetTuple__PF_Pd0PCc___fail__PFi_Pd0___flush__PFi_Pd0___open__PF_Pd0PCcPCc___close__PF_Pd0___write__PFPd0_Pd0PCcUl___fmt__PFi_Pd0PCc__FPd0_Pd0PCc__1(((_Bool (*)(void *__anonymous_object1505))__sepPrt__Fb_P9sofstream__1), ((void (*)(void *__anonymous_object1506))__sepReset__F_P9sofstream__1), ((void (*)(void *__anonymous_object1507, _Bool __anonymous_object1508))__sepReset__F_P9sofstreamb__1), ((const char *(*)(void *__anonymous_object1509))__sepGetCur__FPCc_P9sofstream__1), ((void (*)(void *__anonymous_object1510, const char *__anonymous_object1511))__sepSetCur__F_P9sofstreamPCc__1), ((_Bool (*)(void *__anonymous_object1512))__getNL__Fb_P9sofstream__1), ((void (*)(void *__anonymous_object1513, _Bool __anonymous_object1514))__setNL__F_P9sofstreamb__1), ((void (*)(void *__anonymous_object1515))__sepOn__F_P9sofstream__1), ((void (*)(void *__anonymous_object1516))__sepOff__F_P9sofstream__1), ((_Bool (*)(void *__anonymous_object1517))__sepDisable__Fb_P9sofstream__1), ((_Bool (*)(void *__anonymous_object1518))__sepEnable__Fb_P9sofstream__1), ((const char *(*)(void *__anonymous_object1519))__sepGet__FPCc_P9sofstream__1), ((void (*)(void *__anonymous_object1520, const char *__anonymous_object1521))__sepSet__F_P9sofstreamPCc__1), ((const char *(*)(void *__anonymous_object1522))__sepGetTuple__FPCc_P9sofstream__1), ((void (*)(void *__anonymous_object1523, const char *__anonymous_object1524))__sepSetTuple__F_P9sofstreamPCc__1), ((signed int (*)(void *__anonymous_object1525))__fail__Fi_P9sofstream__1), ((signed int (*)(void *__anonymous_object1526))__flush__Fi_P9sofstream__1), ((void (*)(void *__os__P7tostype_1, const char *__name__PCc_1, const char *__mode__PCc_1))__open__F_P9sofstreamPCcPCc__1), ((void (*)(void *__os__P7tostype_1))__close__F_P9sofstream__1), ((void *(*)(void *__anonymous_object1527, const char *__anonymous_object1528, unsigned long int __anonymous_object1529))__write__FP9sofstream_P9sofstreamPCcUl__1), ((signed int (*)(void *__anonymous_object1530, const char *__fmt__PCc_1, ...))__fmt__Fi_P9sofstreamPCc__1), __sout__P9sofstream_1, "signed char "))) , _tmp_cp_ret3), __v__Sc_1))) , _tmp_cp_ret4), ((void *(*)(void *__anonymous_object1531))(&_thunk1))))) , _tmp_cp_ret5)); 483 452 ((void)(_tmp_cp_ret3) /* ^?{} */); 484 453 ((void)(_tmp_cp_ret4) /* ^?{} */); … … 490 459 struct ofstream *_tmp_cp_ret8; 491 460 __attribute__ ((unused)) struct ofstream *_thunk2(struct ofstream *_p0){ 492 return __endl__A0_1_0_0___sepPrt__PFb_Pd0___sepReset__PF_Pd0___sepReset__PF_Pd0b___sepGetCur__PFPCc_Pd0___sepSetCur__PF_Pd0PCc___getNL__PFb_Pd0___setNL__PF_Pd0b___sepOn__PF_Pd0___sepOff__PF_Pd0___sepDisable__PFb_Pd0___sepEnable__PFb_Pd0___sepGet__PFPCc_Pd0___sepSet__PF_Pd0PCc___sepGetTuple__PFPCc_Pd0___sepSetTuple__PF_Pd0PCc___fail__PFi_Pd0___flush__PFi_Pd0___open__PF_Pd0PCcPCc___close__PF_Pd0___write__PFPd0_Pd0PCcUl___fmt__PFi_Pd0PCc__FPd0_Pd0__1(((_Bool (*)(void *__anonymous_object1532))__sepPrt__Fb_P9sofstream__1), ((void (*)(void *__anonymous_object1533))__sepReset__F_P9sofstream__1), ((void (*)(void *__anonymous_object1534, _Bool __anonymous_object1535))__sepReset__F_P9sofstreamb__1), ((const char *(*)(void *__anonymous_object1536))__sepGetCur__FPCc_P9sofstream__1), ((void (*)(void *__anonymous_object1537, const char *__anonymous_object1538))__sepSetCur__F_P9sofstreamPCc__1), ((_Bool (*)(void *__anonymous_object1539))__getNL__Fb_P9sofstream__1), ((void (*)(void *__anonymous_object1540, _Bool __anonymous_object1541))__setNL__F_P9sofstreamb__1), ((void (*)(void *__anonymous_object1542))__sepOn__F_P9sofstream__1), ((void (*)(void *__anonymous_object1543))__sepOff__F_P9sofstream__1), ((_Bool (*)(void *__anonymous_object1544))__sepDisable__Fb_P9sofstream__1), ((_Bool (*)(void *__anonymous_object1545))__sepEnable__Fb_P9sofstream__1), ((const char *(*)(void *__anonymous_object1546))__sepGet__FPCc_P9sofstream__1), ((void (*)(void *__anonymous_object1547, const char *__anonymous_object1548))__sepSet__F_P9sofstreamPCc__1), ((const char *(*)(void *__anonymous_object1549))__sepGetTuple__FPCc_P9sofstream__1), ((void (*)(void *__anonymous_object1550, const char *__anonymous_object1551))__sepSetTuple__F_P9sofstreamPCc__1), ((signed int (*)(void *__anonymous_object1552))__fail__Fi_P9sofstream__1), ((signed int (*)(void *__anonymous_object1553))__flush__Fi_P9sofstream__1), ((void (*)(void *__os__P7tostype_1, const char *__name__PCc_1, const char *__mode__PCc_1))__open__F_P9sofstreamPCcPCc__1), ((void (*)(void *__os__P7tostype_1))__close__F_P9sofstream__1), ((void *(*)(void *__anonymous_object1554, const char *__anonymous_object1555, unsigned long int __anonymous_object1556))__write__FP9sofstream_P9sofstreamPCcUl__1), ((signed int (*)(void *__anonymous_object1557, const char *__fmt__PCc_1, ...))__fmt__Fi_P9sofstreamPCc__1), ((void *)_p0));493 } 494 ((void)(((void)(_tmp_cp_ret8=___operator_bitor__A0_1_0_0___sepPrt__PFb_Pd0___sepReset__PF_Pd0___sepReset__PF_Pd0b___sepGetCur__PFPCc_Pd0___sepSetCur__PF_Pd0PCc___getNL__PFb_Pd0___setNL__PF_Pd0b___sepOn__PF_Pd0___sepOff__PF_Pd0___sepDisable__PFb_Pd0___sepEnable__PFb_Pd0___sepGet__PFPCc_Pd0___sepSet__PF_Pd0PCc___sepGetTuple__PFPCc_Pd0___sepSetTuple__PF_Pd0PCc___fail__PFi_Pd0___flush__PFi_Pd0___open__PF_Pd0PCcPCc___close__PF_Pd0___write__PFPd0_Pd0PCcUl___fmt__PFi_Pd0PCc__FPd0_Pd0PFPd0_Pd0___1(((_Bool (*)(void *__anonymous_object1558))__sepPrt__Fb_P9sofstream__1), ((void (*)(void *__anonymous_object1559))__sepReset__F_P9sofstream__1), ((void (*)(void *__anonymous_object1560, _Bool __anonymous_object1561))__sepReset__F_P9sofstreamb__1), ((const char *(*)(void *__anonymous_object1562))__sepGetCur__FPCc_P9sofstream__1), ((void (*)(void *__anonymous_object1563, const char *__anonymous_object1564))__sepSetCur__F_P9sofstreamPCc__1), ((_Bool (*)(void *__anonymous_object1565))__getNL__Fb_P9sofstream__1), ((void (*)(void *__anonymous_object1566, _Bool __anonymous_object1567))__setNL__F_P9sofstreamb__1), ((void (*)(void *__anonymous_object1568))__sepOn__F_P9sofstream__1), ((void (*)(void *__anonymous_object1569))__sepOff__F_P9sofstream__1), ((_Bool (*)(void *__anonymous_object1570))__sepDisable__Fb_P9sofstream__1), ((_Bool (*)(void *__anonymous_object1571))__sepEnable__Fb_P9sofstream__1), ((const char *(*)(void *__anonymous_object1572))__sepGet__FPCc_P9sofstream__1), ((void (*)(void *__anonymous_object1573, const char *__anonymous_object1574))__sepSet__F_P9sofstreamPCc__1), ((const char *(*)(void *__anonymous_object1575))__sepGetTuple__FPCc_P9sofstream__1), ((void (*)(void *__anonymous_object1576, const char *__anonymous_object1577))__sepSetTuple__F_P9sofstreamPCc__1), ((signed int (*)(void *__anonymous_object1578))__fail__Fi_P9sofstream__1), ((signed int (*)(void *__anonymous_object1579))__flush__Fi_P9sofstream__1), ((void (*)(void *__os__P7tostype_1, const char *__name__PCc_1, const char *__mode__PCc_1))__open__F_P9sofstreamPCcPCc__1), ((void (*)(void *__os__P7tostype_1))__close__F_P9sofstream__1), ((void *(*)(void *__anonymous_object1580, const char *__anonymous_object1581, unsigned long int __anonymous_object1582))__write__FP9sofstream_P9sofstreamPCcUl__1), ((signed int (*)(void *__anonymous_object1583, const char *__fmt__PCc_1, ...))__fmt__Fi_P9sofstreamPCc__1), (( void *)(((void)(_tmp_cp_ret7=___operator_bitor__A0_1_0_0___sepPrt__PFb_Pd0___sepReset__PF_Pd0___sepReset__PF_Pd0b___sepGetCur__PFPCc_Pd0___sepSetCur__PF_Pd0PCc___getNL__PFb_Pd0___setNL__PF_Pd0b___sepOn__PF_Pd0___sepOff__PF_Pd0___sepDisable__PFb_Pd0___sepEnable__PFb_Pd0___sepGet__PFPCc_Pd0___sepSet__PF_Pd0PCc___sepGetTuple__PFPCc_Pd0___sepSetTuple__PF_Pd0PCc___fail__PFi_Pd0___flush__PFi_Pd0___open__PF_Pd0PCcPCc___close__PF_Pd0___write__PFPd0_Pd0PCcUl___fmt__PFi_Pd0PCc__FPd0_Pd0Uc__1(((_Bool (*)(void *__anonymous_object1584))__sepPrt__Fb_P9sofstream__1), ((void (*)(void *__anonymous_object1585))__sepReset__F_P9sofstream__1), ((void (*)(void *__anonymous_object1586, _Bool __anonymous_object1587))__sepReset__F_P9sofstreamb__1), ((const char *(*)(void *__anonymous_object1588))__sepGetCur__FPCc_P9sofstream__1), ((void (*)(void *__anonymous_object1589, const char *__anonymous_object1590))__sepSetCur__F_P9sofstreamPCc__1), ((_Bool (*)(void *__anonymous_object1591))__getNL__Fb_P9sofstream__1), ((void (*)(void *__anonymous_object1592, _Bool __anonymous_object1593))__setNL__F_P9sofstreamb__1), ((void (*)(void *__anonymous_object1594))__sepOn__F_P9sofstream__1), ((void (*)(void *__anonymous_object1595))__sepOff__F_P9sofstream__1), ((_Bool (*)(void *__anonymous_object1596))__sepDisable__Fb_P9sofstream__1), ((_Bool (*)(void *__anonymous_object1597))__sepEnable__Fb_P9sofstream__1), ((const char *(*)(void *__anonymous_object1598))__sepGet__FPCc_P9sofstream__1), ((void (*)(void *__anonymous_object1599, const char *__anonymous_object1600))__sepSet__F_P9sofstreamPCc__1), ((const char *(*)(void *__anonymous_object1601))__sepGetTuple__FPCc_P9sofstream__1), ((void (*)(void *__anonymous_object1602, const char *__anonymous_object1603))__sepSetTuple__F_P9sofstreamPCc__1), ((signed int (*)(void *__anonymous_object1604))__fail__Fi_P9sofstream__1), ((signed int (*)(void *__anonymous_object1605))__flush__Fi_P9sofstream__1), ((void (*)(void *__os__P7tostype_1, const char *__name__PCc_1, const char *__mode__PCc_1))__open__F_P9sofstreamPCcPCc__1), ((void (*)(void *__os__P7tostype_1))__close__F_P9sofstream__1), ((void *(*)(void *__anonymous_object1606, const char *__anonymous_object1607, unsigned long int __anonymous_object1608))__write__FP9sofstream_P9sofstreamPCcUl__1), ((signed int (*)(void *__anonymous_object1609, const char *__fmt__PCc_1, ...))__fmt__Fi_P9sofstreamPCc__1), ((void *)(((void)(_tmp_cp_ret6=___operator_bitor__A0_1_0_0___sepPrt__PFb_Pd0___sepReset__PF_Pd0___sepReset__PF_Pd0b___sepGetCur__PFPCc_Pd0___sepSetCur__PF_Pd0PCc___getNL__PFb_Pd0___setNL__PF_Pd0b___sepOn__PF_Pd0___sepOff__PF_Pd0___sepDisable__PFb_Pd0___sepEnable__PFb_Pd0___sepGet__PFPCc_Pd0___sepSet__PF_Pd0PCc___sepGetTuple__PFPCc_Pd0___sepSetTuple__PF_Pd0PCc___fail__PFi_Pd0___flush__PFi_Pd0___open__PF_Pd0PCcPCc___close__PF_Pd0___write__PFPd0_Pd0PCcUl___fmt__PFi_Pd0PCc__FPd0_Pd0PCc__1(((_Bool (*)(void *__anonymous_object1610))__sepPrt__Fb_P9sofstream__1), ((void (*)(void *__anonymous_object1611))__sepReset__F_P9sofstream__1), ((void (*)(void *__anonymous_object1612, _Bool __anonymous_object1613))__sepReset__F_P9sofstreamb__1), ((const char *(*)(void *__anonymous_object1614))__sepGetCur__FPCc_P9sofstream__1), ((void (*)(void *__anonymous_object1615, const char *__anonymous_object1616))__sepSetCur__F_P9sofstreamPCc__1), ((_Bool (*)(void *__anonymous_object1617))__getNL__Fb_P9sofstream__1), ((void (*)(void *__anonymous_object1618, _Bool __anonymous_object1619))__setNL__F_P9sofstreamb__1), ((void (*)(void *__anonymous_object1620))__sepOn__F_P9sofstream__1), ((void (*)(void *__anonymous_object1621))__sepOff__F_P9sofstream__1), ((_Bool (*)(void *__anonymous_object1622))__sepDisable__Fb_P9sofstream__1), ((_Bool (*)(void *__anonymous_object1623))__sepEnable__Fb_P9sofstream__1), ((const char *(*)(void *__anonymous_object1624))__sepGet__FPCc_P9sofstream__1), ((void (*)(void *__anonymous_object1625, const char *__anonymous_object1626))__sepSet__F_P9sofstreamPCc__1), ((const char *(*)(void *__anonymous_object1627))__sepGetTuple__FPCc_P9sofstream__1), ((void (*)(void *__anonymous_object1628, const char *__anonymous_object1629))__sepSetTuple__F_P9sofstreamPCc__1), ((signed int (*)(void *__anonymous_object1630))__fail__Fi_P9sofstream__1), ((signed int (*)(void *__anonymous_object1631))__flush__Fi_P9sofstream__1), ((void (*)(void *__os__P7tostype_1, const char *__name__PCc_1, const char *__mode__PCc_1))__open__F_P9sofstreamPCcPCc__1), ((void (*)(void *__os__P7tostype_1))__close__F_P9sofstream__1), ((void *(*)(void *__anonymous_object1632, const char *__anonymous_object1633, unsigned long int __anonymous_object1634))__write__FP9sofstream_P9sofstreamPCcUl__1), ((signed int (*)(void *__anonymous_object1635, const char *__fmt__PCc_1, ...))__fmt__Fi_P9sofstreamPCc__1), ((void *)__sout__P9sofstream_1), "unsigned char "))) , _tmp_cp_ret6)), __v__Uc_1))) , _tmp_cp_ret7)), ((void *(*)(void *__anonymous_object1636))(&_thunk2))))) , _tmp_cp_ret8));461 return __endl__A0_1_0_0___sepPrt__PFb_Pd0___sepReset__PF_Pd0___sepReset__PF_Pd0b___sepGetCur__PFPCc_Pd0___sepSetCur__PF_Pd0PCc___getNL__PFb_Pd0___setNL__PF_Pd0b___sepOn__PF_Pd0___sepOff__PF_Pd0___sepDisable__PFb_Pd0___sepEnable__PFb_Pd0___sepGet__PFPCc_Pd0___sepSet__PF_Pd0PCc___sepGetTuple__PFPCc_Pd0___sepSetTuple__PF_Pd0PCc___fail__PFi_Pd0___flush__PFi_Pd0___open__PF_Pd0PCcPCc___close__PF_Pd0___write__PFPd0_Pd0PCcUl___fmt__PFi_Pd0PCc__FPd0_Pd0__1(((_Bool (*)(void *__anonymous_object1532))__sepPrt__Fb_P9sofstream__1), ((void (*)(void *__anonymous_object1533))__sepReset__F_P9sofstream__1), ((void (*)(void *__anonymous_object1534, _Bool __anonymous_object1535))__sepReset__F_P9sofstreamb__1), ((const char *(*)(void *__anonymous_object1536))__sepGetCur__FPCc_P9sofstream__1), ((void (*)(void *__anonymous_object1537, const char *__anonymous_object1538))__sepSetCur__F_P9sofstreamPCc__1), ((_Bool (*)(void *__anonymous_object1539))__getNL__Fb_P9sofstream__1), ((void (*)(void *__anonymous_object1540, _Bool __anonymous_object1541))__setNL__F_P9sofstreamb__1), ((void (*)(void *__anonymous_object1542))__sepOn__F_P9sofstream__1), ((void (*)(void *__anonymous_object1543))__sepOff__F_P9sofstream__1), ((_Bool (*)(void *__anonymous_object1544))__sepDisable__Fb_P9sofstream__1), ((_Bool (*)(void *__anonymous_object1545))__sepEnable__Fb_P9sofstream__1), ((const char *(*)(void *__anonymous_object1546))__sepGet__FPCc_P9sofstream__1), ((void (*)(void *__anonymous_object1547, const char *__anonymous_object1548))__sepSet__F_P9sofstreamPCc__1), ((const char *(*)(void *__anonymous_object1549))__sepGetTuple__FPCc_P9sofstream__1), ((void (*)(void *__anonymous_object1550, const char *__anonymous_object1551))__sepSetTuple__F_P9sofstreamPCc__1), ((signed int (*)(void *__anonymous_object1552))__fail__Fi_P9sofstream__1), ((signed int (*)(void *__anonymous_object1553))__flush__Fi_P9sofstream__1), ((void (*)(void *__os__P7tostype_1, const char *__name__PCc_1, const char *__mode__PCc_1))__open__F_P9sofstreamPCcPCc__1), ((void (*)(void *__os__P7tostype_1))__close__F_P9sofstream__1), ((void *(*)(void *__anonymous_object1554, const char *__anonymous_object1555, unsigned long int __anonymous_object1556))__write__FP9sofstream_P9sofstreamPCcUl__1), ((signed int (*)(void *__anonymous_object1557, const char *__fmt__PCc_1, ...))__fmt__Fi_P9sofstreamPCc__1), _p0); 462 } 463 ((void)(((void)(_tmp_cp_ret8=___operator_bitor__A0_1_0_0___sepPrt__PFb_Pd0___sepReset__PF_Pd0___sepReset__PF_Pd0b___sepGetCur__PFPCc_Pd0___sepSetCur__PF_Pd0PCc___getNL__PFb_Pd0___setNL__PF_Pd0b___sepOn__PF_Pd0___sepOff__PF_Pd0___sepDisable__PFb_Pd0___sepEnable__PFb_Pd0___sepGet__PFPCc_Pd0___sepSet__PF_Pd0PCc___sepGetTuple__PFPCc_Pd0___sepSetTuple__PF_Pd0PCc___fail__PFi_Pd0___flush__PFi_Pd0___open__PF_Pd0PCcPCc___close__PF_Pd0___write__PFPd0_Pd0PCcUl___fmt__PFi_Pd0PCc__FPd0_Pd0PFPd0_Pd0___1(((_Bool (*)(void *__anonymous_object1558))__sepPrt__Fb_P9sofstream__1), ((void (*)(void *__anonymous_object1559))__sepReset__F_P9sofstream__1), ((void (*)(void *__anonymous_object1560, _Bool __anonymous_object1561))__sepReset__F_P9sofstreamb__1), ((const char *(*)(void *__anonymous_object1562))__sepGetCur__FPCc_P9sofstream__1), ((void (*)(void *__anonymous_object1563, const char *__anonymous_object1564))__sepSetCur__F_P9sofstreamPCc__1), ((_Bool (*)(void *__anonymous_object1565))__getNL__Fb_P9sofstream__1), ((void (*)(void *__anonymous_object1566, _Bool __anonymous_object1567))__setNL__F_P9sofstreamb__1), ((void (*)(void *__anonymous_object1568))__sepOn__F_P9sofstream__1), ((void (*)(void *__anonymous_object1569))__sepOff__F_P9sofstream__1), ((_Bool (*)(void *__anonymous_object1570))__sepDisable__Fb_P9sofstream__1), ((_Bool (*)(void *__anonymous_object1571))__sepEnable__Fb_P9sofstream__1), ((const char *(*)(void *__anonymous_object1572))__sepGet__FPCc_P9sofstream__1), ((void (*)(void *__anonymous_object1573, const char *__anonymous_object1574))__sepSet__F_P9sofstreamPCc__1), ((const char *(*)(void *__anonymous_object1575))__sepGetTuple__FPCc_P9sofstream__1), ((void (*)(void *__anonymous_object1576, const char *__anonymous_object1577))__sepSetTuple__F_P9sofstreamPCc__1), ((signed int (*)(void *__anonymous_object1578))__fail__Fi_P9sofstream__1), ((signed int (*)(void *__anonymous_object1579))__flush__Fi_P9sofstream__1), ((void (*)(void *__os__P7tostype_1, const char *__name__PCc_1, const char *__mode__PCc_1))__open__F_P9sofstreamPCcPCc__1), ((void (*)(void *__os__P7tostype_1))__close__F_P9sofstream__1), ((void *(*)(void *__anonymous_object1580, const char *__anonymous_object1581, unsigned long int __anonymous_object1582))__write__FP9sofstream_P9sofstreamPCcUl__1), ((signed int (*)(void *__anonymous_object1583, const char *__fmt__PCc_1, ...))__fmt__Fi_P9sofstreamPCc__1), (((void)(_tmp_cp_ret7=___operator_bitor__A0_1_0_0___sepPrt__PFb_Pd0___sepReset__PF_Pd0___sepReset__PF_Pd0b___sepGetCur__PFPCc_Pd0___sepSetCur__PF_Pd0PCc___getNL__PFb_Pd0___setNL__PF_Pd0b___sepOn__PF_Pd0___sepOff__PF_Pd0___sepDisable__PFb_Pd0___sepEnable__PFb_Pd0___sepGet__PFPCc_Pd0___sepSet__PF_Pd0PCc___sepGetTuple__PFPCc_Pd0___sepSetTuple__PF_Pd0PCc___fail__PFi_Pd0___flush__PFi_Pd0___open__PF_Pd0PCcPCc___close__PF_Pd0___write__PFPd0_Pd0PCcUl___fmt__PFi_Pd0PCc__FPd0_Pd0Uc__1(((_Bool (*)(void *__anonymous_object1584))__sepPrt__Fb_P9sofstream__1), ((void (*)(void *__anonymous_object1585))__sepReset__F_P9sofstream__1), ((void (*)(void *__anonymous_object1586, _Bool __anonymous_object1587))__sepReset__F_P9sofstreamb__1), ((const char *(*)(void *__anonymous_object1588))__sepGetCur__FPCc_P9sofstream__1), ((void (*)(void *__anonymous_object1589, const char *__anonymous_object1590))__sepSetCur__F_P9sofstreamPCc__1), ((_Bool (*)(void *__anonymous_object1591))__getNL__Fb_P9sofstream__1), ((void (*)(void *__anonymous_object1592, _Bool __anonymous_object1593))__setNL__F_P9sofstreamb__1), ((void (*)(void *__anonymous_object1594))__sepOn__F_P9sofstream__1), ((void (*)(void *__anonymous_object1595))__sepOff__F_P9sofstream__1), ((_Bool (*)(void *__anonymous_object1596))__sepDisable__Fb_P9sofstream__1), ((_Bool (*)(void *__anonymous_object1597))__sepEnable__Fb_P9sofstream__1), ((const char *(*)(void *__anonymous_object1598))__sepGet__FPCc_P9sofstream__1), ((void (*)(void *__anonymous_object1599, const char *__anonymous_object1600))__sepSet__F_P9sofstreamPCc__1), ((const char *(*)(void *__anonymous_object1601))__sepGetTuple__FPCc_P9sofstream__1), ((void (*)(void *__anonymous_object1602, const char *__anonymous_object1603))__sepSetTuple__F_P9sofstreamPCc__1), ((signed int (*)(void *__anonymous_object1604))__fail__Fi_P9sofstream__1), ((signed int (*)(void *__anonymous_object1605))__flush__Fi_P9sofstream__1), ((void (*)(void *__os__P7tostype_1, const char *__name__PCc_1, const char *__mode__PCc_1))__open__F_P9sofstreamPCcPCc__1), ((void (*)(void *__os__P7tostype_1))__close__F_P9sofstream__1), ((void *(*)(void *__anonymous_object1606, const char *__anonymous_object1607, unsigned long int __anonymous_object1608))__write__FP9sofstream_P9sofstreamPCcUl__1), ((signed int (*)(void *__anonymous_object1609, const char *__fmt__PCc_1, ...))__fmt__Fi_P9sofstreamPCc__1), (((void)(_tmp_cp_ret6=___operator_bitor__A0_1_0_0___sepPrt__PFb_Pd0___sepReset__PF_Pd0___sepReset__PF_Pd0b___sepGetCur__PFPCc_Pd0___sepSetCur__PF_Pd0PCc___getNL__PFb_Pd0___setNL__PF_Pd0b___sepOn__PF_Pd0___sepOff__PF_Pd0___sepDisable__PFb_Pd0___sepEnable__PFb_Pd0___sepGet__PFPCc_Pd0___sepSet__PF_Pd0PCc___sepGetTuple__PFPCc_Pd0___sepSetTuple__PF_Pd0PCc___fail__PFi_Pd0___flush__PFi_Pd0___open__PF_Pd0PCcPCc___close__PF_Pd0___write__PFPd0_Pd0PCcUl___fmt__PFi_Pd0PCc__FPd0_Pd0PCc__1(((_Bool (*)(void *__anonymous_object1610))__sepPrt__Fb_P9sofstream__1), ((void (*)(void *__anonymous_object1611))__sepReset__F_P9sofstream__1), ((void (*)(void *__anonymous_object1612, _Bool __anonymous_object1613))__sepReset__F_P9sofstreamb__1), ((const char *(*)(void *__anonymous_object1614))__sepGetCur__FPCc_P9sofstream__1), ((void (*)(void *__anonymous_object1615, const char *__anonymous_object1616))__sepSetCur__F_P9sofstreamPCc__1), ((_Bool (*)(void *__anonymous_object1617))__getNL__Fb_P9sofstream__1), ((void (*)(void *__anonymous_object1618, _Bool __anonymous_object1619))__setNL__F_P9sofstreamb__1), ((void (*)(void *__anonymous_object1620))__sepOn__F_P9sofstream__1), ((void (*)(void *__anonymous_object1621))__sepOff__F_P9sofstream__1), ((_Bool (*)(void *__anonymous_object1622))__sepDisable__Fb_P9sofstream__1), ((_Bool (*)(void *__anonymous_object1623))__sepEnable__Fb_P9sofstream__1), ((const char *(*)(void *__anonymous_object1624))__sepGet__FPCc_P9sofstream__1), ((void (*)(void *__anonymous_object1625, const char *__anonymous_object1626))__sepSet__F_P9sofstreamPCc__1), ((const char *(*)(void *__anonymous_object1627))__sepGetTuple__FPCc_P9sofstream__1), ((void (*)(void *__anonymous_object1628, const char *__anonymous_object1629))__sepSetTuple__F_P9sofstreamPCc__1), ((signed int (*)(void *__anonymous_object1630))__fail__Fi_P9sofstream__1), ((signed int (*)(void *__anonymous_object1631))__flush__Fi_P9sofstream__1), ((void (*)(void *__os__P7tostype_1, const char *__name__PCc_1, const char *__mode__PCc_1))__open__F_P9sofstreamPCcPCc__1), ((void (*)(void *__os__P7tostype_1))__close__F_P9sofstream__1), ((void *(*)(void *__anonymous_object1632, const char *__anonymous_object1633, unsigned long int __anonymous_object1634))__write__FP9sofstream_P9sofstreamPCcUl__1), ((signed int (*)(void *__anonymous_object1635, const char *__fmt__PCc_1, ...))__fmt__Fi_P9sofstreamPCc__1), __sout__P9sofstream_1, "unsigned char "))) , _tmp_cp_ret6), __v__Uc_1))) , _tmp_cp_ret7), ((void *(*)(void *__anonymous_object1636))(&_thunk2))))) , _tmp_cp_ret8)); 495 464 ((void)(_tmp_cp_ret6) /* ^?{} */); 496 465 ((void)(_tmp_cp_ret7) /* ^?{} */); … … 502 471 struct ofstream *_tmp_cp_ret11; 503 472 __attribute__ ((unused)) struct ofstream *_thunk3(struct ofstream *_p0){ 504 return __endl__A0_1_0_0___sepPrt__PFb_Pd0___sepReset__PF_Pd0___sepReset__PF_Pd0b___sepGetCur__PFPCc_Pd0___sepSetCur__PF_Pd0PCc___getNL__PFb_Pd0___setNL__PF_Pd0b___sepOn__PF_Pd0___sepOff__PF_Pd0___sepDisable__PFb_Pd0___sepEnable__PFb_Pd0___sepGet__PFPCc_Pd0___sepSet__PF_Pd0PCc___sepGetTuple__PFPCc_Pd0___sepSetTuple__PF_Pd0PCc___fail__PFi_Pd0___flush__PFi_Pd0___open__PF_Pd0PCcPCc___close__PF_Pd0___write__PFPd0_Pd0PCcUl___fmt__PFi_Pd0PCc__FPd0_Pd0__1(((_Bool (*)(void *__anonymous_object1637))__sepPrt__Fb_P9sofstream__1), ((void (*)(void *__anonymous_object1638))__sepReset__F_P9sofstream__1), ((void (*)(void *__anonymous_object1639, _Bool __anonymous_object1640))__sepReset__F_P9sofstreamb__1), ((const char *(*)(void *__anonymous_object1641))__sepGetCur__FPCc_P9sofstream__1), ((void (*)(void *__anonymous_object1642, const char *__anonymous_object1643))__sepSetCur__F_P9sofstreamPCc__1), ((_Bool (*)(void *__anonymous_object1644))__getNL__Fb_P9sofstream__1), ((void (*)(void *__anonymous_object1645, _Bool __anonymous_object1646))__setNL__F_P9sofstreamb__1), ((void (*)(void *__anonymous_object1647))__sepOn__F_P9sofstream__1), ((void (*)(void *__anonymous_object1648))__sepOff__F_P9sofstream__1), ((_Bool (*)(void *__anonymous_object1649))__sepDisable__Fb_P9sofstream__1), ((_Bool (*)(void *__anonymous_object1650))__sepEnable__Fb_P9sofstream__1), ((const char *(*)(void *__anonymous_object1651))__sepGet__FPCc_P9sofstream__1), ((void (*)(void *__anonymous_object1652, const char *__anonymous_object1653))__sepSet__F_P9sofstreamPCc__1), ((const char *(*)(void *__anonymous_object1654))__sepGetTuple__FPCc_P9sofstream__1), ((void (*)(void *__anonymous_object1655, const char *__anonymous_object1656))__sepSetTuple__F_P9sofstreamPCc__1), ((signed int (*)(void *__anonymous_object1657))__fail__Fi_P9sofstream__1), ((signed int (*)(void *__anonymous_object1658))__flush__Fi_P9sofstream__1), ((void (*)(void *__os__P7tostype_1, const char *__name__PCc_1, const char *__mode__PCc_1))__open__F_P9sofstreamPCcPCc__1), ((void (*)(void *__os__P7tostype_1))__close__F_P9sofstream__1), ((void *(*)(void *__anonymous_object1659, const char *__anonymous_object1660, unsigned long int __anonymous_object1661))__write__FP9sofstream_P9sofstreamPCcUl__1), ((signed int (*)(void *__anonymous_object1662, const char *__fmt__PCc_1, ...))__fmt__Fi_P9sofstreamPCc__1), ((void *)_p0));505 } 506 ((void)(((void)(_tmp_cp_ret11=___operator_bitor__A0_1_0_0___sepPrt__PFb_Pd0___sepReset__PF_Pd0___sepReset__PF_Pd0b___sepGetCur__PFPCc_Pd0___sepSetCur__PF_Pd0PCc___getNL__PFb_Pd0___setNL__PF_Pd0b___sepOn__PF_Pd0___sepOff__PF_Pd0___sepDisable__PFb_Pd0___sepEnable__PFb_Pd0___sepGet__PFPCc_Pd0___sepSet__PF_Pd0PCc___sepGetTuple__PFPCc_Pd0___sepSetTuple__PF_Pd0PCc___fail__PFi_Pd0___flush__PFi_Pd0___open__PF_Pd0PCcPCc___close__PF_Pd0___write__PFPd0_Pd0PCcUl___fmt__PFi_Pd0PCc__FPd0_Pd0PFPd0_Pd0___1(((_Bool (*)(void *__anonymous_object1663))__sepPrt__Fb_P9sofstream__1), ((void (*)(void *__anonymous_object1664))__sepReset__F_P9sofstream__1), ((void (*)(void *__anonymous_object1665, _Bool __anonymous_object1666))__sepReset__F_P9sofstreamb__1), ((const char *(*)(void *__anonymous_object1667))__sepGetCur__FPCc_P9sofstream__1), ((void (*)(void *__anonymous_object1668, const char *__anonymous_object1669))__sepSetCur__F_P9sofstreamPCc__1), ((_Bool (*)(void *__anonymous_object1670))__getNL__Fb_P9sofstream__1), ((void (*)(void *__anonymous_object1671, _Bool __anonymous_object1672))__setNL__F_P9sofstreamb__1), ((void (*)(void *__anonymous_object1673))__sepOn__F_P9sofstream__1), ((void (*)(void *__anonymous_object1674))__sepOff__F_P9sofstream__1), ((_Bool (*)(void *__anonymous_object1675))__sepDisable__Fb_P9sofstream__1), ((_Bool (*)(void *__anonymous_object1676))__sepEnable__Fb_P9sofstream__1), ((const char *(*)(void *__anonymous_object1677))__sepGet__FPCc_P9sofstream__1), ((void (*)(void *__anonymous_object1678, const char *__anonymous_object1679))__sepSet__F_P9sofstreamPCc__1), ((const char *(*)(void *__anonymous_object1680))__sepGetTuple__FPCc_P9sofstream__1), ((void (*)(void *__anonymous_object1681, const char *__anonymous_object1682))__sepSetTuple__F_P9sofstreamPCc__1), ((signed int (*)(void *__anonymous_object1683))__fail__Fi_P9sofstream__1), ((signed int (*)(void *__anonymous_object1684))__flush__Fi_P9sofstream__1), ((void (*)(void *__os__P7tostype_1, const char *__name__PCc_1, const char *__mode__PCc_1))__open__F_P9sofstreamPCcPCc__1), ((void (*)(void *__os__P7tostype_1))__close__F_P9sofstream__1), ((void *(*)(void *__anonymous_object1685, const char *__anonymous_object1686, unsigned long int __anonymous_object1687))__write__FP9sofstream_P9sofstreamPCcUl__1), ((signed int (*)(void *__anonymous_object1688, const char *__fmt__PCc_1, ...))__fmt__Fi_P9sofstreamPCc__1), (( void *)(((void)(_tmp_cp_ret10=___operator_bitor__A0_1_0_0___sepPrt__PFb_Pd0___sepReset__PF_Pd0___sepReset__PF_Pd0b___sepGetCur__PFPCc_Pd0___sepSetCur__PF_Pd0PCc___getNL__PFb_Pd0___setNL__PF_Pd0b___sepOn__PF_Pd0___sepOff__PF_Pd0___sepDisable__PFb_Pd0___sepEnable__PFb_Pd0___sepGet__PFPCc_Pd0___sepSet__PF_Pd0PCc___sepGetTuple__PFPCc_Pd0___sepSetTuple__PF_Pd0PCc___fail__PFi_Pd0___flush__PFi_Pd0___open__PF_Pd0PCcPCc___close__PF_Pd0___write__PFPd0_Pd0PCcUl___fmt__PFi_Pd0PCc__FPd0_Pd0s__1(((_Bool (*)(void *__anonymous_object1689))__sepPrt__Fb_P9sofstream__1), ((void (*)(void *__anonymous_object1690))__sepReset__F_P9sofstream__1), ((void (*)(void *__anonymous_object1691, _Bool __anonymous_object1692))__sepReset__F_P9sofstreamb__1), ((const char *(*)(void *__anonymous_object1693))__sepGetCur__FPCc_P9sofstream__1), ((void (*)(void *__anonymous_object1694, const char *__anonymous_object1695))__sepSetCur__F_P9sofstreamPCc__1), ((_Bool (*)(void *__anonymous_object1696))__getNL__Fb_P9sofstream__1), ((void (*)(void *__anonymous_object1697, _Bool __anonymous_object1698))__setNL__F_P9sofstreamb__1), ((void (*)(void *__anonymous_object1699))__sepOn__F_P9sofstream__1), ((void (*)(void *__anonymous_object1700))__sepOff__F_P9sofstream__1), ((_Bool (*)(void *__anonymous_object1701))__sepDisable__Fb_P9sofstream__1), ((_Bool (*)(void *__anonymous_object1702))__sepEnable__Fb_P9sofstream__1), ((const char *(*)(void *__anonymous_object1703))__sepGet__FPCc_P9sofstream__1), ((void (*)(void *__anonymous_object1704, const char *__anonymous_object1705))__sepSet__F_P9sofstreamPCc__1), ((const char *(*)(void *__anonymous_object1706))__sepGetTuple__FPCc_P9sofstream__1), ((void (*)(void *__anonymous_object1707, const char *__anonymous_object1708))__sepSetTuple__F_P9sofstreamPCc__1), ((signed int (*)(void *__anonymous_object1709))__fail__Fi_P9sofstream__1), ((signed int (*)(void *__anonymous_object1710))__flush__Fi_P9sofstream__1), ((void (*)(void *__os__P7tostype_1, const char *__name__PCc_1, const char *__mode__PCc_1))__open__F_P9sofstreamPCcPCc__1), ((void (*)(void *__os__P7tostype_1))__close__F_P9sofstream__1), ((void *(*)(void *__anonymous_object1711, const char *__anonymous_object1712, unsigned long int __anonymous_object1713))__write__FP9sofstream_P9sofstreamPCcUl__1), ((signed int (*)(void *__anonymous_object1714, const char *__fmt__PCc_1, ...))__fmt__Fi_P9sofstreamPCc__1), ((void *)(((void)(_tmp_cp_ret9=___operator_bitor__A0_1_0_0___sepPrt__PFb_Pd0___sepReset__PF_Pd0___sepReset__PF_Pd0b___sepGetCur__PFPCc_Pd0___sepSetCur__PF_Pd0PCc___getNL__PFb_Pd0___setNL__PF_Pd0b___sepOn__PF_Pd0___sepOff__PF_Pd0___sepDisable__PFb_Pd0___sepEnable__PFb_Pd0___sepGet__PFPCc_Pd0___sepSet__PF_Pd0PCc___sepGetTuple__PFPCc_Pd0___sepSetTuple__PF_Pd0PCc___fail__PFi_Pd0___flush__PFi_Pd0___open__PF_Pd0PCcPCc___close__PF_Pd0___write__PFPd0_Pd0PCcUl___fmt__PFi_Pd0PCc__FPd0_Pd0PCc__1(((_Bool (*)(void *__anonymous_object1715))__sepPrt__Fb_P9sofstream__1), ((void (*)(void *__anonymous_object1716))__sepReset__F_P9sofstream__1), ((void (*)(void *__anonymous_object1717, _Bool __anonymous_object1718))__sepReset__F_P9sofstreamb__1), ((const char *(*)(void *__anonymous_object1719))__sepGetCur__FPCc_P9sofstream__1), ((void (*)(void *__anonymous_object1720, const char *__anonymous_object1721))__sepSetCur__F_P9sofstreamPCc__1), ((_Bool (*)(void *__anonymous_object1722))__getNL__Fb_P9sofstream__1), ((void (*)(void *__anonymous_object1723, _Bool __anonymous_object1724))__setNL__F_P9sofstreamb__1), ((void (*)(void *__anonymous_object1725))__sepOn__F_P9sofstream__1), ((void (*)(void *__anonymous_object1726))__sepOff__F_P9sofstream__1), ((_Bool (*)(void *__anonymous_object1727))__sepDisable__Fb_P9sofstream__1), ((_Bool (*)(void *__anonymous_object1728))__sepEnable__Fb_P9sofstream__1), ((const char *(*)(void *__anonymous_object1729))__sepGet__FPCc_P9sofstream__1), ((void (*)(void *__anonymous_object1730, const char *__anonymous_object1731))__sepSet__F_P9sofstreamPCc__1), ((const char *(*)(void *__anonymous_object1732))__sepGetTuple__FPCc_P9sofstream__1), ((void (*)(void *__anonymous_object1733, const char *__anonymous_object1734))__sepSetTuple__F_P9sofstreamPCc__1), ((signed int (*)(void *__anonymous_object1735))__fail__Fi_P9sofstream__1), ((signed int (*)(void *__anonymous_object1736))__flush__Fi_P9sofstream__1), ((void (*)(void *__os__P7tostype_1, const char *__name__PCc_1, const char *__mode__PCc_1))__open__F_P9sofstreamPCcPCc__1), ((void (*)(void *__os__P7tostype_1))__close__F_P9sofstream__1), ((void *(*)(void *__anonymous_object1737, const char *__anonymous_object1738, unsigned long int __anonymous_object1739))__write__FP9sofstream_P9sofstreamPCcUl__1), ((signed int (*)(void *__anonymous_object1740, const char *__fmt__PCc_1, ...))__fmt__Fi_P9sofstreamPCc__1), ((void *)__sout__P9sofstream_1), "signed short int"))) , _tmp_cp_ret9)), __v__s_1))) , _tmp_cp_ret10)), ((void *(*)(void *__anonymous_object1741))(&_thunk3))))) , _tmp_cp_ret11));473 return __endl__A0_1_0_0___sepPrt__PFb_Pd0___sepReset__PF_Pd0___sepReset__PF_Pd0b___sepGetCur__PFPCc_Pd0___sepSetCur__PF_Pd0PCc___getNL__PFb_Pd0___setNL__PF_Pd0b___sepOn__PF_Pd0___sepOff__PF_Pd0___sepDisable__PFb_Pd0___sepEnable__PFb_Pd0___sepGet__PFPCc_Pd0___sepSet__PF_Pd0PCc___sepGetTuple__PFPCc_Pd0___sepSetTuple__PF_Pd0PCc___fail__PFi_Pd0___flush__PFi_Pd0___open__PF_Pd0PCcPCc___close__PF_Pd0___write__PFPd0_Pd0PCcUl___fmt__PFi_Pd0PCc__FPd0_Pd0__1(((_Bool (*)(void *__anonymous_object1637))__sepPrt__Fb_P9sofstream__1), ((void (*)(void *__anonymous_object1638))__sepReset__F_P9sofstream__1), ((void (*)(void *__anonymous_object1639, _Bool __anonymous_object1640))__sepReset__F_P9sofstreamb__1), ((const char *(*)(void *__anonymous_object1641))__sepGetCur__FPCc_P9sofstream__1), ((void (*)(void *__anonymous_object1642, const char *__anonymous_object1643))__sepSetCur__F_P9sofstreamPCc__1), ((_Bool (*)(void *__anonymous_object1644))__getNL__Fb_P9sofstream__1), ((void (*)(void *__anonymous_object1645, _Bool __anonymous_object1646))__setNL__F_P9sofstreamb__1), ((void (*)(void *__anonymous_object1647))__sepOn__F_P9sofstream__1), ((void (*)(void *__anonymous_object1648))__sepOff__F_P9sofstream__1), ((_Bool (*)(void *__anonymous_object1649))__sepDisable__Fb_P9sofstream__1), ((_Bool (*)(void *__anonymous_object1650))__sepEnable__Fb_P9sofstream__1), ((const char *(*)(void *__anonymous_object1651))__sepGet__FPCc_P9sofstream__1), ((void (*)(void *__anonymous_object1652, const char *__anonymous_object1653))__sepSet__F_P9sofstreamPCc__1), ((const char *(*)(void *__anonymous_object1654))__sepGetTuple__FPCc_P9sofstream__1), ((void (*)(void *__anonymous_object1655, const char *__anonymous_object1656))__sepSetTuple__F_P9sofstreamPCc__1), ((signed int (*)(void *__anonymous_object1657))__fail__Fi_P9sofstream__1), ((signed int (*)(void *__anonymous_object1658))__flush__Fi_P9sofstream__1), ((void (*)(void *__os__P7tostype_1, const char *__name__PCc_1, const char *__mode__PCc_1))__open__F_P9sofstreamPCcPCc__1), ((void (*)(void *__os__P7tostype_1))__close__F_P9sofstream__1), ((void *(*)(void *__anonymous_object1659, const char *__anonymous_object1660, unsigned long int __anonymous_object1661))__write__FP9sofstream_P9sofstreamPCcUl__1), ((signed int (*)(void *__anonymous_object1662, const char *__fmt__PCc_1, ...))__fmt__Fi_P9sofstreamPCc__1), _p0); 474 } 475 ((void)(((void)(_tmp_cp_ret11=___operator_bitor__A0_1_0_0___sepPrt__PFb_Pd0___sepReset__PF_Pd0___sepReset__PF_Pd0b___sepGetCur__PFPCc_Pd0___sepSetCur__PF_Pd0PCc___getNL__PFb_Pd0___setNL__PF_Pd0b___sepOn__PF_Pd0___sepOff__PF_Pd0___sepDisable__PFb_Pd0___sepEnable__PFb_Pd0___sepGet__PFPCc_Pd0___sepSet__PF_Pd0PCc___sepGetTuple__PFPCc_Pd0___sepSetTuple__PF_Pd0PCc___fail__PFi_Pd0___flush__PFi_Pd0___open__PF_Pd0PCcPCc___close__PF_Pd0___write__PFPd0_Pd0PCcUl___fmt__PFi_Pd0PCc__FPd0_Pd0PFPd0_Pd0___1(((_Bool (*)(void *__anonymous_object1663))__sepPrt__Fb_P9sofstream__1), ((void (*)(void *__anonymous_object1664))__sepReset__F_P9sofstream__1), ((void (*)(void *__anonymous_object1665, _Bool __anonymous_object1666))__sepReset__F_P9sofstreamb__1), ((const char *(*)(void *__anonymous_object1667))__sepGetCur__FPCc_P9sofstream__1), ((void (*)(void *__anonymous_object1668, const char *__anonymous_object1669))__sepSetCur__F_P9sofstreamPCc__1), ((_Bool (*)(void *__anonymous_object1670))__getNL__Fb_P9sofstream__1), ((void (*)(void *__anonymous_object1671, _Bool __anonymous_object1672))__setNL__F_P9sofstreamb__1), ((void (*)(void *__anonymous_object1673))__sepOn__F_P9sofstream__1), ((void (*)(void *__anonymous_object1674))__sepOff__F_P9sofstream__1), ((_Bool (*)(void *__anonymous_object1675))__sepDisable__Fb_P9sofstream__1), ((_Bool (*)(void *__anonymous_object1676))__sepEnable__Fb_P9sofstream__1), ((const char *(*)(void *__anonymous_object1677))__sepGet__FPCc_P9sofstream__1), ((void (*)(void *__anonymous_object1678, const char *__anonymous_object1679))__sepSet__F_P9sofstreamPCc__1), ((const char *(*)(void *__anonymous_object1680))__sepGetTuple__FPCc_P9sofstream__1), ((void (*)(void *__anonymous_object1681, const char *__anonymous_object1682))__sepSetTuple__F_P9sofstreamPCc__1), ((signed int (*)(void *__anonymous_object1683))__fail__Fi_P9sofstream__1), ((signed int (*)(void *__anonymous_object1684))__flush__Fi_P9sofstream__1), ((void (*)(void *__os__P7tostype_1, const char *__name__PCc_1, const char *__mode__PCc_1))__open__F_P9sofstreamPCcPCc__1), ((void (*)(void *__os__P7tostype_1))__close__F_P9sofstream__1), ((void *(*)(void *__anonymous_object1685, const char *__anonymous_object1686, unsigned long int __anonymous_object1687))__write__FP9sofstream_P9sofstreamPCcUl__1), ((signed int (*)(void *__anonymous_object1688, const char *__fmt__PCc_1, ...))__fmt__Fi_P9sofstreamPCc__1), (((void)(_tmp_cp_ret10=___operator_bitor__A0_1_0_0___sepPrt__PFb_Pd0___sepReset__PF_Pd0___sepReset__PF_Pd0b___sepGetCur__PFPCc_Pd0___sepSetCur__PF_Pd0PCc___getNL__PFb_Pd0___setNL__PF_Pd0b___sepOn__PF_Pd0___sepOff__PF_Pd0___sepDisable__PFb_Pd0___sepEnable__PFb_Pd0___sepGet__PFPCc_Pd0___sepSet__PF_Pd0PCc___sepGetTuple__PFPCc_Pd0___sepSetTuple__PF_Pd0PCc___fail__PFi_Pd0___flush__PFi_Pd0___open__PF_Pd0PCcPCc___close__PF_Pd0___write__PFPd0_Pd0PCcUl___fmt__PFi_Pd0PCc__FPd0_Pd0s__1(((_Bool (*)(void *__anonymous_object1689))__sepPrt__Fb_P9sofstream__1), ((void (*)(void *__anonymous_object1690))__sepReset__F_P9sofstream__1), ((void (*)(void *__anonymous_object1691, _Bool __anonymous_object1692))__sepReset__F_P9sofstreamb__1), ((const char *(*)(void *__anonymous_object1693))__sepGetCur__FPCc_P9sofstream__1), ((void (*)(void *__anonymous_object1694, const char *__anonymous_object1695))__sepSetCur__F_P9sofstreamPCc__1), ((_Bool (*)(void *__anonymous_object1696))__getNL__Fb_P9sofstream__1), ((void (*)(void *__anonymous_object1697, _Bool __anonymous_object1698))__setNL__F_P9sofstreamb__1), ((void (*)(void *__anonymous_object1699))__sepOn__F_P9sofstream__1), ((void (*)(void *__anonymous_object1700))__sepOff__F_P9sofstream__1), ((_Bool (*)(void *__anonymous_object1701))__sepDisable__Fb_P9sofstream__1), ((_Bool (*)(void *__anonymous_object1702))__sepEnable__Fb_P9sofstream__1), ((const char *(*)(void *__anonymous_object1703))__sepGet__FPCc_P9sofstream__1), ((void (*)(void *__anonymous_object1704, const char *__anonymous_object1705))__sepSet__F_P9sofstreamPCc__1), ((const char *(*)(void *__anonymous_object1706))__sepGetTuple__FPCc_P9sofstream__1), ((void (*)(void *__anonymous_object1707, const char *__anonymous_object1708))__sepSetTuple__F_P9sofstreamPCc__1), ((signed int (*)(void *__anonymous_object1709))__fail__Fi_P9sofstream__1), ((signed int (*)(void *__anonymous_object1710))__flush__Fi_P9sofstream__1), ((void (*)(void *__os__P7tostype_1, const char *__name__PCc_1, const char *__mode__PCc_1))__open__F_P9sofstreamPCcPCc__1), ((void (*)(void *__os__P7tostype_1))__close__F_P9sofstream__1), ((void *(*)(void *__anonymous_object1711, const char *__anonymous_object1712, unsigned long int __anonymous_object1713))__write__FP9sofstream_P9sofstreamPCcUl__1), ((signed int (*)(void *__anonymous_object1714, const char *__fmt__PCc_1, ...))__fmt__Fi_P9sofstreamPCc__1), (((void)(_tmp_cp_ret9=___operator_bitor__A0_1_0_0___sepPrt__PFb_Pd0___sepReset__PF_Pd0___sepReset__PF_Pd0b___sepGetCur__PFPCc_Pd0___sepSetCur__PF_Pd0PCc___getNL__PFb_Pd0___setNL__PF_Pd0b___sepOn__PF_Pd0___sepOff__PF_Pd0___sepDisable__PFb_Pd0___sepEnable__PFb_Pd0___sepGet__PFPCc_Pd0___sepSet__PF_Pd0PCc___sepGetTuple__PFPCc_Pd0___sepSetTuple__PF_Pd0PCc___fail__PFi_Pd0___flush__PFi_Pd0___open__PF_Pd0PCcPCc___close__PF_Pd0___write__PFPd0_Pd0PCcUl___fmt__PFi_Pd0PCc__FPd0_Pd0PCc__1(((_Bool (*)(void *__anonymous_object1715))__sepPrt__Fb_P9sofstream__1), ((void (*)(void *__anonymous_object1716))__sepReset__F_P9sofstream__1), ((void (*)(void *__anonymous_object1717, _Bool __anonymous_object1718))__sepReset__F_P9sofstreamb__1), ((const char *(*)(void *__anonymous_object1719))__sepGetCur__FPCc_P9sofstream__1), ((void (*)(void *__anonymous_object1720, const char *__anonymous_object1721))__sepSetCur__F_P9sofstreamPCc__1), ((_Bool (*)(void *__anonymous_object1722))__getNL__Fb_P9sofstream__1), ((void (*)(void *__anonymous_object1723, _Bool __anonymous_object1724))__setNL__F_P9sofstreamb__1), ((void (*)(void *__anonymous_object1725))__sepOn__F_P9sofstream__1), ((void (*)(void *__anonymous_object1726))__sepOff__F_P9sofstream__1), ((_Bool (*)(void *__anonymous_object1727))__sepDisable__Fb_P9sofstream__1), ((_Bool (*)(void *__anonymous_object1728))__sepEnable__Fb_P9sofstream__1), ((const char *(*)(void *__anonymous_object1729))__sepGet__FPCc_P9sofstream__1), ((void (*)(void *__anonymous_object1730, const char *__anonymous_object1731))__sepSet__F_P9sofstreamPCc__1), ((const char *(*)(void *__anonymous_object1732))__sepGetTuple__FPCc_P9sofstream__1), ((void (*)(void *__anonymous_object1733, const char *__anonymous_object1734))__sepSetTuple__F_P9sofstreamPCc__1), ((signed int (*)(void *__anonymous_object1735))__fail__Fi_P9sofstream__1), ((signed int (*)(void *__anonymous_object1736))__flush__Fi_P9sofstream__1), ((void (*)(void *__os__P7tostype_1, const char *__name__PCc_1, const char *__mode__PCc_1))__open__F_P9sofstreamPCcPCc__1), ((void (*)(void *__os__P7tostype_1))__close__F_P9sofstream__1), ((void *(*)(void *__anonymous_object1737, const char *__anonymous_object1738, unsigned long int __anonymous_object1739))__write__FP9sofstream_P9sofstreamPCcUl__1), ((signed int (*)(void *__anonymous_object1740, const char *__fmt__PCc_1, ...))__fmt__Fi_P9sofstreamPCc__1), __sout__P9sofstream_1, "signed short int"))) , _tmp_cp_ret9), __v__s_1))) , _tmp_cp_ret10), ((void *(*)(void *__anonymous_object1741))(&_thunk3))))) , _tmp_cp_ret11)); 507 476 ((void)(_tmp_cp_ret9) /* ^?{} */); 508 477 ((void)(_tmp_cp_ret10) /* ^?{} */); … … 514 483 struct ofstream *_tmp_cp_ret14; 515 484 __attribute__ ((unused)) struct ofstream *_thunk4(struct ofstream *_p0){ 516 return __endl__A0_1_0_0___sepPrt__PFb_Pd0___sepReset__PF_Pd0___sepReset__PF_Pd0b___sepGetCur__PFPCc_Pd0___sepSetCur__PF_Pd0PCc___getNL__PFb_Pd0___setNL__PF_Pd0b___sepOn__PF_Pd0___sepOff__PF_Pd0___sepDisable__PFb_Pd0___sepEnable__PFb_Pd0___sepGet__PFPCc_Pd0___sepSet__PF_Pd0PCc___sepGetTuple__PFPCc_Pd0___sepSetTuple__PF_Pd0PCc___fail__PFi_Pd0___flush__PFi_Pd0___open__PF_Pd0PCcPCc___close__PF_Pd0___write__PFPd0_Pd0PCcUl___fmt__PFi_Pd0PCc__FPd0_Pd0__1(((_Bool (*)(void *__anonymous_object1742))__sepPrt__Fb_P9sofstream__1), ((void (*)(void *__anonymous_object1743))__sepReset__F_P9sofstream__1), ((void (*)(void *__anonymous_object1744, _Bool __anonymous_object1745))__sepReset__F_P9sofstreamb__1), ((const char *(*)(void *__anonymous_object1746))__sepGetCur__FPCc_P9sofstream__1), ((void (*)(void *__anonymous_object1747, const char *__anonymous_object1748))__sepSetCur__F_P9sofstreamPCc__1), ((_Bool (*)(void *__anonymous_object1749))__getNL__Fb_P9sofstream__1), ((void (*)(void *__anonymous_object1750, _Bool __anonymous_object1751))__setNL__F_P9sofstreamb__1), ((void (*)(void *__anonymous_object1752))__sepOn__F_P9sofstream__1), ((void (*)(void *__anonymous_object1753))__sepOff__F_P9sofstream__1), ((_Bool (*)(void *__anonymous_object1754))__sepDisable__Fb_P9sofstream__1), ((_Bool (*)(void *__anonymous_object1755))__sepEnable__Fb_P9sofstream__1), ((const char *(*)(void *__anonymous_object1756))__sepGet__FPCc_P9sofstream__1), ((void (*)(void *__anonymous_object1757, const char *__anonymous_object1758))__sepSet__F_P9sofstreamPCc__1), ((const char *(*)(void *__anonymous_object1759))__sepGetTuple__FPCc_P9sofstream__1), ((void (*)(void *__anonymous_object1760, const char *__anonymous_object1761))__sepSetTuple__F_P9sofstreamPCc__1), ((signed int (*)(void *__anonymous_object1762))__fail__Fi_P9sofstream__1), ((signed int (*)(void *__anonymous_object1763))__flush__Fi_P9sofstream__1), ((void (*)(void *__os__P7tostype_1, const char *__name__PCc_1, const char *__mode__PCc_1))__open__F_P9sofstreamPCcPCc__1), ((void (*)(void *__os__P7tostype_1))__close__F_P9sofstream__1), ((void *(*)(void *__anonymous_object1764, const char *__anonymous_object1765, unsigned long int __anonymous_object1766))__write__FP9sofstream_P9sofstreamPCcUl__1), ((signed int (*)(void *__anonymous_object1767, const char *__fmt__PCc_1, ...))__fmt__Fi_P9sofstreamPCc__1), ((void *)_p0));517 } 518 ((void)(((void)(_tmp_cp_ret14=___operator_bitor__A0_1_0_0___sepPrt__PFb_Pd0___sepReset__PF_Pd0___sepReset__PF_Pd0b___sepGetCur__PFPCc_Pd0___sepSetCur__PF_Pd0PCc___getNL__PFb_Pd0___setNL__PF_Pd0b___sepOn__PF_Pd0___sepOff__PF_Pd0___sepDisable__PFb_Pd0___sepEnable__PFb_Pd0___sepGet__PFPCc_Pd0___sepSet__PF_Pd0PCc___sepGetTuple__PFPCc_Pd0___sepSetTuple__PF_Pd0PCc___fail__PFi_Pd0___flush__PFi_Pd0___open__PF_Pd0PCcPCc___close__PF_Pd0___write__PFPd0_Pd0PCcUl___fmt__PFi_Pd0PCc__FPd0_Pd0PFPd0_Pd0___1(((_Bool (*)(void *__anonymous_object1768))__sepPrt__Fb_P9sofstream__1), ((void (*)(void *__anonymous_object1769))__sepReset__F_P9sofstream__1), ((void (*)(void *__anonymous_object1770, _Bool __anonymous_object1771))__sepReset__F_P9sofstreamb__1), ((const char *(*)(void *__anonymous_object1772))__sepGetCur__FPCc_P9sofstream__1), ((void (*)(void *__anonymous_object1773, const char *__anonymous_object1774))__sepSetCur__F_P9sofstreamPCc__1), ((_Bool (*)(void *__anonymous_object1775))__getNL__Fb_P9sofstream__1), ((void (*)(void *__anonymous_object1776, _Bool __anonymous_object1777))__setNL__F_P9sofstreamb__1), ((void (*)(void *__anonymous_object1778))__sepOn__F_P9sofstream__1), ((void (*)(void *__anonymous_object1779))__sepOff__F_P9sofstream__1), ((_Bool (*)(void *__anonymous_object1780))__sepDisable__Fb_P9sofstream__1), ((_Bool (*)(void *__anonymous_object1781))__sepEnable__Fb_P9sofstream__1), ((const char *(*)(void *__anonymous_object1782))__sepGet__FPCc_P9sofstream__1), ((void (*)(void *__anonymous_object1783, const char *__anonymous_object1784))__sepSet__F_P9sofstreamPCc__1), ((const char *(*)(void *__anonymous_object1785))__sepGetTuple__FPCc_P9sofstream__1), ((void (*)(void *__anonymous_object1786, const char *__anonymous_object1787))__sepSetTuple__F_P9sofstreamPCc__1), ((signed int (*)(void *__anonymous_object1788))__fail__Fi_P9sofstream__1), ((signed int (*)(void *__anonymous_object1789))__flush__Fi_P9sofstream__1), ((void (*)(void *__os__P7tostype_1, const char *__name__PCc_1, const char *__mode__PCc_1))__open__F_P9sofstreamPCcPCc__1), ((void (*)(void *__os__P7tostype_1))__close__F_P9sofstream__1), ((void *(*)(void *__anonymous_object1790, const char *__anonymous_object1791, unsigned long int __anonymous_object1792))__write__FP9sofstream_P9sofstreamPCcUl__1), ((signed int (*)(void *__anonymous_object1793, const char *__fmt__PCc_1, ...))__fmt__Fi_P9sofstreamPCc__1), (( void *)(((void)(_tmp_cp_ret13=___operator_bitor__A0_1_0_0___sepPrt__PFb_Pd0___sepReset__PF_Pd0___sepReset__PF_Pd0b___sepGetCur__PFPCc_Pd0___sepSetCur__PF_Pd0PCc___getNL__PFb_Pd0___setNL__PF_Pd0b___sepOn__PF_Pd0___sepOff__PF_Pd0___sepDisable__PFb_Pd0___sepEnable__PFb_Pd0___sepGet__PFPCc_Pd0___sepSet__PF_Pd0PCc___sepGetTuple__PFPCc_Pd0___sepSetTuple__PF_Pd0PCc___fail__PFi_Pd0___flush__PFi_Pd0___open__PF_Pd0PCcPCc___close__PF_Pd0___write__PFPd0_Pd0PCcUl___fmt__PFi_Pd0PCc__FPd0_Pd0Us__1(((_Bool (*)(void *__anonymous_object1794))__sepPrt__Fb_P9sofstream__1), ((void (*)(void *__anonymous_object1795))__sepReset__F_P9sofstream__1), ((void (*)(void *__anonymous_object1796, _Bool __anonymous_object1797))__sepReset__F_P9sofstreamb__1), ((const char *(*)(void *__anonymous_object1798))__sepGetCur__FPCc_P9sofstream__1), ((void (*)(void *__anonymous_object1799, const char *__anonymous_object1800))__sepSetCur__F_P9sofstreamPCc__1), ((_Bool (*)(void *__anonymous_object1801))__getNL__Fb_P9sofstream__1), ((void (*)(void *__anonymous_object1802, _Bool __anonymous_object1803))__setNL__F_P9sofstreamb__1), ((void (*)(void *__anonymous_object1804))__sepOn__F_P9sofstream__1), ((void (*)(void *__anonymous_object1805))__sepOff__F_P9sofstream__1), ((_Bool (*)(void *__anonymous_object1806))__sepDisable__Fb_P9sofstream__1), ((_Bool (*)(void *__anonymous_object1807))__sepEnable__Fb_P9sofstream__1), ((const char *(*)(void *__anonymous_object1808))__sepGet__FPCc_P9sofstream__1), ((void (*)(void *__anonymous_object1809, const char *__anonymous_object1810))__sepSet__F_P9sofstreamPCc__1), ((const char *(*)(void *__anonymous_object1811))__sepGetTuple__FPCc_P9sofstream__1), ((void (*)(void *__anonymous_object1812, const char *__anonymous_object1813))__sepSetTuple__F_P9sofstreamPCc__1), ((signed int (*)(void *__anonymous_object1814))__fail__Fi_P9sofstream__1), ((signed int (*)(void *__anonymous_object1815))__flush__Fi_P9sofstream__1), ((void (*)(void *__os__P7tostype_1, const char *__name__PCc_1, const char *__mode__PCc_1))__open__F_P9sofstreamPCcPCc__1), ((void (*)(void *__os__P7tostype_1))__close__F_P9sofstream__1), ((void *(*)(void *__anonymous_object1816, const char *__anonymous_object1817, unsigned long int __anonymous_object1818))__write__FP9sofstream_P9sofstreamPCcUl__1), ((signed int (*)(void *__anonymous_object1819, const char *__fmt__PCc_1, ...))__fmt__Fi_P9sofstreamPCc__1), ((void *)(((void)(_tmp_cp_ret12=___operator_bitor__A0_1_0_0___sepPrt__PFb_Pd0___sepReset__PF_Pd0___sepReset__PF_Pd0b___sepGetCur__PFPCc_Pd0___sepSetCur__PF_Pd0PCc___getNL__PFb_Pd0___setNL__PF_Pd0b___sepOn__PF_Pd0___sepOff__PF_Pd0___sepDisable__PFb_Pd0___sepEnable__PFb_Pd0___sepGet__PFPCc_Pd0___sepSet__PF_Pd0PCc___sepGetTuple__PFPCc_Pd0___sepSetTuple__PF_Pd0PCc___fail__PFi_Pd0___flush__PFi_Pd0___open__PF_Pd0PCcPCc___close__PF_Pd0___write__PFPd0_Pd0PCcUl___fmt__PFi_Pd0PCc__FPd0_Pd0PCc__1(((_Bool (*)(void *__anonymous_object1820))__sepPrt__Fb_P9sofstream__1), ((void (*)(void *__anonymous_object1821))__sepReset__F_P9sofstream__1), ((void (*)(void *__anonymous_object1822, _Bool __anonymous_object1823))__sepReset__F_P9sofstreamb__1), ((const char *(*)(void *__anonymous_object1824))__sepGetCur__FPCc_P9sofstream__1), ((void (*)(void *__anonymous_object1825, const char *__anonymous_object1826))__sepSetCur__F_P9sofstreamPCc__1), ((_Bool (*)(void *__anonymous_object1827))__getNL__Fb_P9sofstream__1), ((void (*)(void *__anonymous_object1828, _Bool __anonymous_object1829))__setNL__F_P9sofstreamb__1), ((void (*)(void *__anonymous_object1830))__sepOn__F_P9sofstream__1), ((void (*)(void *__anonymous_object1831))__sepOff__F_P9sofstream__1), ((_Bool (*)(void *__anonymous_object1832))__sepDisable__Fb_P9sofstream__1), ((_Bool (*)(void *__anonymous_object1833))__sepEnable__Fb_P9sofstream__1), ((const char *(*)(void *__anonymous_object1834))__sepGet__FPCc_P9sofstream__1), ((void (*)(void *__anonymous_object1835, const char *__anonymous_object1836))__sepSet__F_P9sofstreamPCc__1), ((const char *(*)(void *__anonymous_object1837))__sepGetTuple__FPCc_P9sofstream__1), ((void (*)(void *__anonymous_object1838, const char *__anonymous_object1839))__sepSetTuple__F_P9sofstreamPCc__1), ((signed int (*)(void *__anonymous_object1840))__fail__Fi_P9sofstream__1), ((signed int (*)(void *__anonymous_object1841))__flush__Fi_P9sofstream__1), ((void (*)(void *__os__P7tostype_1, const char *__name__PCc_1, const char *__mode__PCc_1))__open__F_P9sofstreamPCcPCc__1), ((void (*)(void *__os__P7tostype_1))__close__F_P9sofstream__1), ((void *(*)(void *__anonymous_object1842, const char *__anonymous_object1843, unsigned long int __anonymous_object1844))__write__FP9sofstream_P9sofstreamPCcUl__1), ((signed int (*)(void *__anonymous_object1845, const char *__fmt__PCc_1, ...))__fmt__Fi_P9sofstreamPCc__1), ((void *)__sout__P9sofstream_1), "unsigned short int"))) , _tmp_cp_ret12)), __v__Us_1))) , _tmp_cp_ret13)), ((void *(*)(void *__anonymous_object1846))(&_thunk4))))) , _tmp_cp_ret14));485 return __endl__A0_1_0_0___sepPrt__PFb_Pd0___sepReset__PF_Pd0___sepReset__PF_Pd0b___sepGetCur__PFPCc_Pd0___sepSetCur__PF_Pd0PCc___getNL__PFb_Pd0___setNL__PF_Pd0b___sepOn__PF_Pd0___sepOff__PF_Pd0___sepDisable__PFb_Pd0___sepEnable__PFb_Pd0___sepGet__PFPCc_Pd0___sepSet__PF_Pd0PCc___sepGetTuple__PFPCc_Pd0___sepSetTuple__PF_Pd0PCc___fail__PFi_Pd0___flush__PFi_Pd0___open__PF_Pd0PCcPCc___close__PF_Pd0___write__PFPd0_Pd0PCcUl___fmt__PFi_Pd0PCc__FPd0_Pd0__1(((_Bool (*)(void *__anonymous_object1742))__sepPrt__Fb_P9sofstream__1), ((void (*)(void *__anonymous_object1743))__sepReset__F_P9sofstream__1), ((void (*)(void *__anonymous_object1744, _Bool __anonymous_object1745))__sepReset__F_P9sofstreamb__1), ((const char *(*)(void *__anonymous_object1746))__sepGetCur__FPCc_P9sofstream__1), ((void (*)(void *__anonymous_object1747, const char *__anonymous_object1748))__sepSetCur__F_P9sofstreamPCc__1), ((_Bool (*)(void *__anonymous_object1749))__getNL__Fb_P9sofstream__1), ((void (*)(void *__anonymous_object1750, _Bool __anonymous_object1751))__setNL__F_P9sofstreamb__1), ((void (*)(void *__anonymous_object1752))__sepOn__F_P9sofstream__1), ((void (*)(void *__anonymous_object1753))__sepOff__F_P9sofstream__1), ((_Bool (*)(void *__anonymous_object1754))__sepDisable__Fb_P9sofstream__1), ((_Bool (*)(void *__anonymous_object1755))__sepEnable__Fb_P9sofstream__1), ((const char *(*)(void *__anonymous_object1756))__sepGet__FPCc_P9sofstream__1), ((void (*)(void *__anonymous_object1757, const char *__anonymous_object1758))__sepSet__F_P9sofstreamPCc__1), ((const char *(*)(void *__anonymous_object1759))__sepGetTuple__FPCc_P9sofstream__1), ((void (*)(void *__anonymous_object1760, const char *__anonymous_object1761))__sepSetTuple__F_P9sofstreamPCc__1), ((signed int (*)(void *__anonymous_object1762))__fail__Fi_P9sofstream__1), ((signed int (*)(void *__anonymous_object1763))__flush__Fi_P9sofstream__1), ((void (*)(void *__os__P7tostype_1, const char *__name__PCc_1, const char *__mode__PCc_1))__open__F_P9sofstreamPCcPCc__1), ((void (*)(void *__os__P7tostype_1))__close__F_P9sofstream__1), ((void *(*)(void *__anonymous_object1764, const char *__anonymous_object1765, unsigned long int __anonymous_object1766))__write__FP9sofstream_P9sofstreamPCcUl__1), ((signed int (*)(void *__anonymous_object1767, const char *__fmt__PCc_1, ...))__fmt__Fi_P9sofstreamPCc__1), _p0); 486 } 487 ((void)(((void)(_tmp_cp_ret14=___operator_bitor__A0_1_0_0___sepPrt__PFb_Pd0___sepReset__PF_Pd0___sepReset__PF_Pd0b___sepGetCur__PFPCc_Pd0___sepSetCur__PF_Pd0PCc___getNL__PFb_Pd0___setNL__PF_Pd0b___sepOn__PF_Pd0___sepOff__PF_Pd0___sepDisable__PFb_Pd0___sepEnable__PFb_Pd0___sepGet__PFPCc_Pd0___sepSet__PF_Pd0PCc___sepGetTuple__PFPCc_Pd0___sepSetTuple__PF_Pd0PCc___fail__PFi_Pd0___flush__PFi_Pd0___open__PF_Pd0PCcPCc___close__PF_Pd0___write__PFPd0_Pd0PCcUl___fmt__PFi_Pd0PCc__FPd0_Pd0PFPd0_Pd0___1(((_Bool (*)(void *__anonymous_object1768))__sepPrt__Fb_P9sofstream__1), ((void (*)(void *__anonymous_object1769))__sepReset__F_P9sofstream__1), ((void (*)(void *__anonymous_object1770, _Bool __anonymous_object1771))__sepReset__F_P9sofstreamb__1), ((const char *(*)(void *__anonymous_object1772))__sepGetCur__FPCc_P9sofstream__1), ((void (*)(void *__anonymous_object1773, const char *__anonymous_object1774))__sepSetCur__F_P9sofstreamPCc__1), ((_Bool (*)(void *__anonymous_object1775))__getNL__Fb_P9sofstream__1), ((void (*)(void *__anonymous_object1776, _Bool __anonymous_object1777))__setNL__F_P9sofstreamb__1), ((void (*)(void *__anonymous_object1778))__sepOn__F_P9sofstream__1), ((void (*)(void *__anonymous_object1779))__sepOff__F_P9sofstream__1), ((_Bool (*)(void *__anonymous_object1780))__sepDisable__Fb_P9sofstream__1), ((_Bool (*)(void *__anonymous_object1781))__sepEnable__Fb_P9sofstream__1), ((const char *(*)(void *__anonymous_object1782))__sepGet__FPCc_P9sofstream__1), ((void (*)(void *__anonymous_object1783, const char *__anonymous_object1784))__sepSet__F_P9sofstreamPCc__1), ((const char *(*)(void *__anonymous_object1785))__sepGetTuple__FPCc_P9sofstream__1), ((void (*)(void *__anonymous_object1786, const char *__anonymous_object1787))__sepSetTuple__F_P9sofstreamPCc__1), ((signed int (*)(void *__anonymous_object1788))__fail__Fi_P9sofstream__1), ((signed int (*)(void *__anonymous_object1789))__flush__Fi_P9sofstream__1), ((void (*)(void *__os__P7tostype_1, const char *__name__PCc_1, const char *__mode__PCc_1))__open__F_P9sofstreamPCcPCc__1), ((void (*)(void *__os__P7tostype_1))__close__F_P9sofstream__1), ((void *(*)(void *__anonymous_object1790, const char *__anonymous_object1791, unsigned long int __anonymous_object1792))__write__FP9sofstream_P9sofstreamPCcUl__1), ((signed int (*)(void *__anonymous_object1793, const char *__fmt__PCc_1, ...))__fmt__Fi_P9sofstreamPCc__1), (((void)(_tmp_cp_ret13=___operator_bitor__A0_1_0_0___sepPrt__PFb_Pd0___sepReset__PF_Pd0___sepReset__PF_Pd0b___sepGetCur__PFPCc_Pd0___sepSetCur__PF_Pd0PCc___getNL__PFb_Pd0___setNL__PF_Pd0b___sepOn__PF_Pd0___sepOff__PF_Pd0___sepDisable__PFb_Pd0___sepEnable__PFb_Pd0___sepGet__PFPCc_Pd0___sepSet__PF_Pd0PCc___sepGetTuple__PFPCc_Pd0___sepSetTuple__PF_Pd0PCc___fail__PFi_Pd0___flush__PFi_Pd0___open__PF_Pd0PCcPCc___close__PF_Pd0___write__PFPd0_Pd0PCcUl___fmt__PFi_Pd0PCc__FPd0_Pd0Us__1(((_Bool (*)(void *__anonymous_object1794))__sepPrt__Fb_P9sofstream__1), ((void (*)(void *__anonymous_object1795))__sepReset__F_P9sofstream__1), ((void (*)(void *__anonymous_object1796, _Bool __anonymous_object1797))__sepReset__F_P9sofstreamb__1), ((const char *(*)(void *__anonymous_object1798))__sepGetCur__FPCc_P9sofstream__1), ((void (*)(void *__anonymous_object1799, const char *__anonymous_object1800))__sepSetCur__F_P9sofstreamPCc__1), ((_Bool (*)(void *__anonymous_object1801))__getNL__Fb_P9sofstream__1), ((void (*)(void *__anonymous_object1802, _Bool __anonymous_object1803))__setNL__F_P9sofstreamb__1), ((void (*)(void *__anonymous_object1804))__sepOn__F_P9sofstream__1), ((void (*)(void *__anonymous_object1805))__sepOff__F_P9sofstream__1), ((_Bool (*)(void *__anonymous_object1806))__sepDisable__Fb_P9sofstream__1), ((_Bool (*)(void *__anonymous_object1807))__sepEnable__Fb_P9sofstream__1), ((const char *(*)(void *__anonymous_object1808))__sepGet__FPCc_P9sofstream__1), ((void (*)(void *__anonymous_object1809, const char *__anonymous_object1810))__sepSet__F_P9sofstreamPCc__1), ((const char *(*)(void *__anonymous_object1811))__sepGetTuple__FPCc_P9sofstream__1), ((void (*)(void *__anonymous_object1812, const char *__anonymous_object1813))__sepSetTuple__F_P9sofstreamPCc__1), ((signed int (*)(void *__anonymous_object1814))__fail__Fi_P9sofstream__1), ((signed int (*)(void *__anonymous_object1815))__flush__Fi_P9sofstream__1), ((void (*)(void *__os__P7tostype_1, const char *__name__PCc_1, const char *__mode__PCc_1))__open__F_P9sofstreamPCcPCc__1), ((void (*)(void *__os__P7tostype_1))__close__F_P9sofstream__1), ((void *(*)(void *__anonymous_object1816, const char *__anonymous_object1817, unsigned long int __anonymous_object1818))__write__FP9sofstream_P9sofstreamPCcUl__1), ((signed int (*)(void *__anonymous_object1819, const char *__fmt__PCc_1, ...))__fmt__Fi_P9sofstreamPCc__1), (((void)(_tmp_cp_ret12=___operator_bitor__A0_1_0_0___sepPrt__PFb_Pd0___sepReset__PF_Pd0___sepReset__PF_Pd0b___sepGetCur__PFPCc_Pd0___sepSetCur__PF_Pd0PCc___getNL__PFb_Pd0___setNL__PF_Pd0b___sepOn__PF_Pd0___sepOff__PF_Pd0___sepDisable__PFb_Pd0___sepEnable__PFb_Pd0___sepGet__PFPCc_Pd0___sepSet__PF_Pd0PCc___sepGetTuple__PFPCc_Pd0___sepSetTuple__PF_Pd0PCc___fail__PFi_Pd0___flush__PFi_Pd0___open__PF_Pd0PCcPCc___close__PF_Pd0___write__PFPd0_Pd0PCcUl___fmt__PFi_Pd0PCc__FPd0_Pd0PCc__1(((_Bool (*)(void *__anonymous_object1820))__sepPrt__Fb_P9sofstream__1), ((void (*)(void *__anonymous_object1821))__sepReset__F_P9sofstream__1), ((void (*)(void *__anonymous_object1822, _Bool __anonymous_object1823))__sepReset__F_P9sofstreamb__1), ((const char *(*)(void *__anonymous_object1824))__sepGetCur__FPCc_P9sofstream__1), ((void (*)(void *__anonymous_object1825, const char *__anonymous_object1826))__sepSetCur__F_P9sofstreamPCc__1), ((_Bool (*)(void *__anonymous_object1827))__getNL__Fb_P9sofstream__1), ((void (*)(void *__anonymous_object1828, _Bool __anonymous_object1829))__setNL__F_P9sofstreamb__1), ((void (*)(void *__anonymous_object1830))__sepOn__F_P9sofstream__1), ((void (*)(void *__anonymous_object1831))__sepOff__F_P9sofstream__1), ((_Bool (*)(void *__anonymous_object1832))__sepDisable__Fb_P9sofstream__1), ((_Bool (*)(void *__anonymous_object1833))__sepEnable__Fb_P9sofstream__1), ((const char *(*)(void *__anonymous_object1834))__sepGet__FPCc_P9sofstream__1), ((void (*)(void *__anonymous_object1835, const char *__anonymous_object1836))__sepSet__F_P9sofstreamPCc__1), ((const char *(*)(void *__anonymous_object1837))__sepGetTuple__FPCc_P9sofstream__1), ((void (*)(void *__anonymous_object1838, const char *__anonymous_object1839))__sepSetTuple__F_P9sofstreamPCc__1), ((signed int (*)(void *__anonymous_object1840))__fail__Fi_P9sofstream__1), ((signed int (*)(void *__anonymous_object1841))__flush__Fi_P9sofstream__1), ((void (*)(void *__os__P7tostype_1, const char *__name__PCc_1, const char *__mode__PCc_1))__open__F_P9sofstreamPCcPCc__1), ((void (*)(void *__os__P7tostype_1))__close__F_P9sofstream__1), ((void *(*)(void *__anonymous_object1842, const char *__anonymous_object1843, unsigned long int __anonymous_object1844))__write__FP9sofstream_P9sofstreamPCcUl__1), ((signed int (*)(void *__anonymous_object1845, const char *__fmt__PCc_1, ...))__fmt__Fi_P9sofstreamPCc__1), __sout__P9sofstream_1, "unsigned short int"))) , _tmp_cp_ret12), __v__Us_1))) , _tmp_cp_ret13), ((void *(*)(void *__anonymous_object1846))(&_thunk4))))) , _tmp_cp_ret14)); 519 488 ((void)(_tmp_cp_ret12) /* ^?{} */); 520 489 ((void)(_tmp_cp_ret13) /* ^?{} */); … … 526 495 struct ofstream *_tmp_cp_ret17; 527 496 __attribute__ ((unused)) struct ofstream *_thunk5(struct ofstream *_p0){ 528 return __endl__A0_1_0_0___sepPrt__PFb_Pd0___sepReset__PF_Pd0___sepReset__PF_Pd0b___sepGetCur__PFPCc_Pd0___sepSetCur__PF_Pd0PCc___getNL__PFb_Pd0___setNL__PF_Pd0b___sepOn__PF_Pd0___sepOff__PF_Pd0___sepDisable__PFb_Pd0___sepEnable__PFb_Pd0___sepGet__PFPCc_Pd0___sepSet__PF_Pd0PCc___sepGetTuple__PFPCc_Pd0___sepSetTuple__PF_Pd0PCc___fail__PFi_Pd0___flush__PFi_Pd0___open__PF_Pd0PCcPCc___close__PF_Pd0___write__PFPd0_Pd0PCcUl___fmt__PFi_Pd0PCc__FPd0_Pd0__1(((_Bool (*)(void *__anonymous_object1847))__sepPrt__Fb_P9sofstream__1), ((void (*)(void *__anonymous_object1848))__sepReset__F_P9sofstream__1), ((void (*)(void *__anonymous_object1849, _Bool __anonymous_object1850))__sepReset__F_P9sofstreamb__1), ((const char *(*)(void *__anonymous_object1851))__sepGetCur__FPCc_P9sofstream__1), ((void (*)(void *__anonymous_object1852, const char *__anonymous_object1853))__sepSetCur__F_P9sofstreamPCc__1), ((_Bool (*)(void *__anonymous_object1854))__getNL__Fb_P9sofstream__1), ((void (*)(void *__anonymous_object1855, _Bool __anonymous_object1856))__setNL__F_P9sofstreamb__1), ((void (*)(void *__anonymous_object1857))__sepOn__F_P9sofstream__1), ((void (*)(void *__anonymous_object1858))__sepOff__F_P9sofstream__1), ((_Bool (*)(void *__anonymous_object1859))__sepDisable__Fb_P9sofstream__1), ((_Bool (*)(void *__anonymous_object1860))__sepEnable__Fb_P9sofstream__1), ((const char *(*)(void *__anonymous_object1861))__sepGet__FPCc_P9sofstream__1), ((void (*)(void *__anonymous_object1862, const char *__anonymous_object1863))__sepSet__F_P9sofstreamPCc__1), ((const char *(*)(void *__anonymous_object1864))__sepGetTuple__FPCc_P9sofstream__1), ((void (*)(void *__anonymous_object1865, const char *__anonymous_object1866))__sepSetTuple__F_P9sofstreamPCc__1), ((signed int (*)(void *__anonymous_object1867))__fail__Fi_P9sofstream__1), ((signed int (*)(void *__anonymous_object1868))__flush__Fi_P9sofstream__1), ((void (*)(void *__os__P7tostype_1, const char *__name__PCc_1, const char *__mode__PCc_1))__open__F_P9sofstreamPCcPCc__1), ((void (*)(void *__os__P7tostype_1))__close__F_P9sofstream__1), ((void *(*)(void *__anonymous_object1869, const char *__anonymous_object1870, unsigned long int __anonymous_object1871))__write__FP9sofstream_P9sofstreamPCcUl__1), ((signed int (*)(void *__anonymous_object1872, const char *__fmt__PCc_1, ...))__fmt__Fi_P9sofstreamPCc__1), ((void *)_p0));529 } 530 ((void)(((void)(_tmp_cp_ret17=___operator_bitor__A0_1_0_0___sepPrt__PFb_Pd0___sepReset__PF_Pd0___sepReset__PF_Pd0b___sepGetCur__PFPCc_Pd0___sepSetCur__PF_Pd0PCc___getNL__PFb_Pd0___setNL__PF_Pd0b___sepOn__PF_Pd0___sepOff__PF_Pd0___sepDisable__PFb_Pd0___sepEnable__PFb_Pd0___sepGet__PFPCc_Pd0___sepSet__PF_Pd0PCc___sepGetTuple__PFPCc_Pd0___sepSetTuple__PF_Pd0PCc___fail__PFi_Pd0___flush__PFi_Pd0___open__PF_Pd0PCcPCc___close__PF_Pd0___write__PFPd0_Pd0PCcUl___fmt__PFi_Pd0PCc__FPd0_Pd0PFPd0_Pd0___1(((_Bool (*)(void *__anonymous_object1873))__sepPrt__Fb_P9sofstream__1), ((void (*)(void *__anonymous_object1874))__sepReset__F_P9sofstream__1), ((void (*)(void *__anonymous_object1875, _Bool __anonymous_object1876))__sepReset__F_P9sofstreamb__1), ((const char *(*)(void *__anonymous_object1877))__sepGetCur__FPCc_P9sofstream__1), ((void (*)(void *__anonymous_object1878, const char *__anonymous_object1879))__sepSetCur__F_P9sofstreamPCc__1), ((_Bool (*)(void *__anonymous_object1880))__getNL__Fb_P9sofstream__1), ((void (*)(void *__anonymous_object1881, _Bool __anonymous_object1882))__setNL__F_P9sofstreamb__1), ((void (*)(void *__anonymous_object1883))__sepOn__F_P9sofstream__1), ((void (*)(void *__anonymous_object1884))__sepOff__F_P9sofstream__1), ((_Bool (*)(void *__anonymous_object1885))__sepDisable__Fb_P9sofstream__1), ((_Bool (*)(void *__anonymous_object1886))__sepEnable__Fb_P9sofstream__1), ((const char *(*)(void *__anonymous_object1887))__sepGet__FPCc_P9sofstream__1), ((void (*)(void *__anonymous_object1888, const char *__anonymous_object1889))__sepSet__F_P9sofstreamPCc__1), ((const char *(*)(void *__anonymous_object1890))__sepGetTuple__FPCc_P9sofstream__1), ((void (*)(void *__anonymous_object1891, const char *__anonymous_object1892))__sepSetTuple__F_P9sofstreamPCc__1), ((signed int (*)(void *__anonymous_object1893))__fail__Fi_P9sofstream__1), ((signed int (*)(void *__anonymous_object1894))__flush__Fi_P9sofstream__1), ((void (*)(void *__os__P7tostype_1, const char *__name__PCc_1, const char *__mode__PCc_1))__open__F_P9sofstreamPCcPCc__1), ((void (*)(void *__os__P7tostype_1))__close__F_P9sofstream__1), ((void *(*)(void *__anonymous_object1895, const char *__anonymous_object1896, unsigned long int __anonymous_object1897))__write__FP9sofstream_P9sofstreamPCcUl__1), ((signed int (*)(void *__anonymous_object1898, const char *__fmt__PCc_1, ...))__fmt__Fi_P9sofstreamPCc__1), (( void *)(((void)(_tmp_cp_ret16=___operator_bitor__A0_1_0_0___sepPrt__PFb_Pd0___sepReset__PF_Pd0___sepReset__PF_Pd0b___sepGetCur__PFPCc_Pd0___sepSetCur__PF_Pd0PCc___getNL__PFb_Pd0___setNL__PF_Pd0b___sepOn__PF_Pd0___sepOff__PF_Pd0___sepDisable__PFb_Pd0___sepEnable__PFb_Pd0___sepGet__PFPCc_Pd0___sepSet__PF_Pd0PCc___sepGetTuple__PFPCc_Pd0___sepSetTuple__PF_Pd0PCc___fail__PFi_Pd0___flush__PFi_Pd0___open__PF_Pd0PCcPCc___close__PF_Pd0___write__PFPd0_Pd0PCcUl___fmt__PFi_Pd0PCc__FPd0_Pd0Ui__1(((_Bool (*)(void *__anonymous_object1899))__sepPrt__Fb_P9sofstream__1), ((void (*)(void *__anonymous_object1900))__sepReset__F_P9sofstream__1), ((void (*)(void *__anonymous_object1901, _Bool __anonymous_object1902))__sepReset__F_P9sofstreamb__1), ((const char *(*)(void *__anonymous_object1903))__sepGetCur__FPCc_P9sofstream__1), ((void (*)(void *__anonymous_object1904, const char *__anonymous_object1905))__sepSetCur__F_P9sofstreamPCc__1), ((_Bool (*)(void *__anonymous_object1906))__getNL__Fb_P9sofstream__1), ((void (*)(void *__anonymous_object1907, _Bool __anonymous_object1908))__setNL__F_P9sofstreamb__1), ((void (*)(void *__anonymous_object1909))__sepOn__F_P9sofstream__1), ((void (*)(void *__anonymous_object1910))__sepOff__F_P9sofstream__1), ((_Bool (*)(void *__anonymous_object1911))__sepDisable__Fb_P9sofstream__1), ((_Bool (*)(void *__anonymous_object1912))__sepEnable__Fb_P9sofstream__1), ((const char *(*)(void *__anonymous_object1913))__sepGet__FPCc_P9sofstream__1), ((void (*)(void *__anonymous_object1914, const char *__anonymous_object1915))__sepSet__F_P9sofstreamPCc__1), ((const char *(*)(void *__anonymous_object1916))__sepGetTuple__FPCc_P9sofstream__1), ((void (*)(void *__anonymous_object1917, const char *__anonymous_object1918))__sepSetTuple__F_P9sofstreamPCc__1), ((signed int (*)(void *__anonymous_object1919))__fail__Fi_P9sofstream__1), ((signed int (*)(void *__anonymous_object1920))__flush__Fi_P9sofstream__1), ((void (*)(void *__os__P7tostype_1, const char *__name__PCc_1, const char *__mode__PCc_1))__open__F_P9sofstreamPCcPCc__1), ((void (*)(void *__os__P7tostype_1))__close__F_P9sofstream__1), ((void *(*)(void *__anonymous_object1921, const char *__anonymous_object1922, unsigned long int __anonymous_object1923))__write__FP9sofstream_P9sofstreamPCcUl__1), ((signed int (*)(void *__anonymous_object1924, const char *__fmt__PCc_1, ...))__fmt__Fi_P9sofstreamPCc__1), ((void *)(((void)(_tmp_cp_ret15=___operator_bitor__A0_1_0_0___sepPrt__PFb_Pd0___sepReset__PF_Pd0___sepReset__PF_Pd0b___sepGetCur__PFPCc_Pd0___sepSetCur__PF_Pd0PCc___getNL__PFb_Pd0___setNL__PF_Pd0b___sepOn__PF_Pd0___sepOff__PF_Pd0___sepDisable__PFb_Pd0___sepEnable__PFb_Pd0___sepGet__PFPCc_Pd0___sepSet__PF_Pd0PCc___sepGetTuple__PFPCc_Pd0___sepSetTuple__PF_Pd0PCc___fail__PFi_Pd0___flush__PFi_Pd0___open__PF_Pd0PCcPCc___close__PF_Pd0___write__PFPd0_Pd0PCcUl___fmt__PFi_Pd0PCc__FPd0_Pd0PCc__1(((_Bool (*)(void *__anonymous_object1925))__sepPrt__Fb_P9sofstream__1), ((void (*)(void *__anonymous_object1926))__sepReset__F_P9sofstream__1), ((void (*)(void *__anonymous_object1927, _Bool __anonymous_object1928))__sepReset__F_P9sofstreamb__1), ((const char *(*)(void *__anonymous_object1929))__sepGetCur__FPCc_P9sofstream__1), ((void (*)(void *__anonymous_object1930, const char *__anonymous_object1931))__sepSetCur__F_P9sofstreamPCc__1), ((_Bool (*)(void *__anonymous_object1932))__getNL__Fb_P9sofstream__1), ((void (*)(void *__anonymous_object1933, _Bool __anonymous_object1934))__setNL__F_P9sofstreamb__1), ((void (*)(void *__anonymous_object1935))__sepOn__F_P9sofstream__1), ((void (*)(void *__anonymous_object1936))__sepOff__F_P9sofstream__1), ((_Bool (*)(void *__anonymous_object1937))__sepDisable__Fb_P9sofstream__1), ((_Bool (*)(void *__anonymous_object1938))__sepEnable__Fb_P9sofstream__1), ((const char *(*)(void *__anonymous_object1939))__sepGet__FPCc_P9sofstream__1), ((void (*)(void *__anonymous_object1940, const char *__anonymous_object1941))__sepSet__F_P9sofstreamPCc__1), ((const char *(*)(void *__anonymous_object1942))__sepGetTuple__FPCc_P9sofstream__1), ((void (*)(void *__anonymous_object1943, const char *__anonymous_object1944))__sepSetTuple__F_P9sofstreamPCc__1), ((signed int (*)(void *__anonymous_object1945))__fail__Fi_P9sofstream__1), ((signed int (*)(void *__anonymous_object1946))__flush__Fi_P9sofstream__1), ((void (*)(void *__os__P7tostype_1, const char *__name__PCc_1, const char *__mode__PCc_1))__open__F_P9sofstreamPCcPCc__1), ((void (*)(void *__os__P7tostype_1))__close__F_P9sofstream__1), ((void *(*)(void *__anonymous_object1947, const char *__anonymous_object1948, unsigned long int __anonymous_object1949))__write__FP9sofstream_P9sofstreamPCcUl__1), ((signed int (*)(void *__anonymous_object1950, const char *__fmt__PCc_1, ...))__fmt__Fi_P9sofstreamPCc__1), ((void *)__sout__P9sofstream_1), "size_t"))) , _tmp_cp_ret15)), __v__Ui_1))) , _tmp_cp_ret16)), ((void *(*)(void *__anonymous_object1951))(&_thunk5))))) , _tmp_cp_ret17));497 return __endl__A0_1_0_0___sepPrt__PFb_Pd0___sepReset__PF_Pd0___sepReset__PF_Pd0b___sepGetCur__PFPCc_Pd0___sepSetCur__PF_Pd0PCc___getNL__PFb_Pd0___setNL__PF_Pd0b___sepOn__PF_Pd0___sepOff__PF_Pd0___sepDisable__PFb_Pd0___sepEnable__PFb_Pd0___sepGet__PFPCc_Pd0___sepSet__PF_Pd0PCc___sepGetTuple__PFPCc_Pd0___sepSetTuple__PF_Pd0PCc___fail__PFi_Pd0___flush__PFi_Pd0___open__PF_Pd0PCcPCc___close__PF_Pd0___write__PFPd0_Pd0PCcUl___fmt__PFi_Pd0PCc__FPd0_Pd0__1(((_Bool (*)(void *__anonymous_object1847))__sepPrt__Fb_P9sofstream__1), ((void (*)(void *__anonymous_object1848))__sepReset__F_P9sofstream__1), ((void (*)(void *__anonymous_object1849, _Bool __anonymous_object1850))__sepReset__F_P9sofstreamb__1), ((const char *(*)(void *__anonymous_object1851))__sepGetCur__FPCc_P9sofstream__1), ((void (*)(void *__anonymous_object1852, const char *__anonymous_object1853))__sepSetCur__F_P9sofstreamPCc__1), ((_Bool (*)(void *__anonymous_object1854))__getNL__Fb_P9sofstream__1), ((void (*)(void *__anonymous_object1855, _Bool __anonymous_object1856))__setNL__F_P9sofstreamb__1), ((void (*)(void *__anonymous_object1857))__sepOn__F_P9sofstream__1), ((void (*)(void *__anonymous_object1858))__sepOff__F_P9sofstream__1), ((_Bool (*)(void *__anonymous_object1859))__sepDisable__Fb_P9sofstream__1), ((_Bool (*)(void *__anonymous_object1860))__sepEnable__Fb_P9sofstream__1), ((const char *(*)(void *__anonymous_object1861))__sepGet__FPCc_P9sofstream__1), ((void (*)(void *__anonymous_object1862, const char *__anonymous_object1863))__sepSet__F_P9sofstreamPCc__1), ((const char *(*)(void *__anonymous_object1864))__sepGetTuple__FPCc_P9sofstream__1), ((void (*)(void *__anonymous_object1865, const char *__anonymous_object1866))__sepSetTuple__F_P9sofstreamPCc__1), ((signed int (*)(void *__anonymous_object1867))__fail__Fi_P9sofstream__1), ((signed int (*)(void *__anonymous_object1868))__flush__Fi_P9sofstream__1), ((void (*)(void *__os__P7tostype_1, const char *__name__PCc_1, const char *__mode__PCc_1))__open__F_P9sofstreamPCcPCc__1), ((void (*)(void *__os__P7tostype_1))__close__F_P9sofstream__1), ((void *(*)(void *__anonymous_object1869, const char *__anonymous_object1870, unsigned long int __anonymous_object1871))__write__FP9sofstream_P9sofstreamPCcUl__1), ((signed int (*)(void *__anonymous_object1872, const char *__fmt__PCc_1, ...))__fmt__Fi_P9sofstreamPCc__1), _p0); 498 } 499 ((void)(((void)(_tmp_cp_ret17=___operator_bitor__A0_1_0_0___sepPrt__PFb_Pd0___sepReset__PF_Pd0___sepReset__PF_Pd0b___sepGetCur__PFPCc_Pd0___sepSetCur__PF_Pd0PCc___getNL__PFb_Pd0___setNL__PF_Pd0b___sepOn__PF_Pd0___sepOff__PF_Pd0___sepDisable__PFb_Pd0___sepEnable__PFb_Pd0___sepGet__PFPCc_Pd0___sepSet__PF_Pd0PCc___sepGetTuple__PFPCc_Pd0___sepSetTuple__PF_Pd0PCc___fail__PFi_Pd0___flush__PFi_Pd0___open__PF_Pd0PCcPCc___close__PF_Pd0___write__PFPd0_Pd0PCcUl___fmt__PFi_Pd0PCc__FPd0_Pd0PFPd0_Pd0___1(((_Bool (*)(void *__anonymous_object1873))__sepPrt__Fb_P9sofstream__1), ((void (*)(void *__anonymous_object1874))__sepReset__F_P9sofstream__1), ((void (*)(void *__anonymous_object1875, _Bool __anonymous_object1876))__sepReset__F_P9sofstreamb__1), ((const char *(*)(void *__anonymous_object1877))__sepGetCur__FPCc_P9sofstream__1), ((void (*)(void *__anonymous_object1878, const char *__anonymous_object1879))__sepSetCur__F_P9sofstreamPCc__1), ((_Bool (*)(void *__anonymous_object1880))__getNL__Fb_P9sofstream__1), ((void (*)(void *__anonymous_object1881, _Bool __anonymous_object1882))__setNL__F_P9sofstreamb__1), ((void (*)(void *__anonymous_object1883))__sepOn__F_P9sofstream__1), ((void (*)(void *__anonymous_object1884))__sepOff__F_P9sofstream__1), ((_Bool (*)(void *__anonymous_object1885))__sepDisable__Fb_P9sofstream__1), ((_Bool (*)(void *__anonymous_object1886))__sepEnable__Fb_P9sofstream__1), ((const char *(*)(void *__anonymous_object1887))__sepGet__FPCc_P9sofstream__1), ((void (*)(void *__anonymous_object1888, const char *__anonymous_object1889))__sepSet__F_P9sofstreamPCc__1), ((const char *(*)(void *__anonymous_object1890))__sepGetTuple__FPCc_P9sofstream__1), ((void (*)(void *__anonymous_object1891, const char *__anonymous_object1892))__sepSetTuple__F_P9sofstreamPCc__1), ((signed int (*)(void *__anonymous_object1893))__fail__Fi_P9sofstream__1), ((signed int (*)(void *__anonymous_object1894))__flush__Fi_P9sofstream__1), ((void (*)(void *__os__P7tostype_1, const char *__name__PCc_1, const char *__mode__PCc_1))__open__F_P9sofstreamPCcPCc__1), ((void (*)(void *__os__P7tostype_1))__close__F_P9sofstream__1), ((void *(*)(void *__anonymous_object1895, const char *__anonymous_object1896, unsigned long int __anonymous_object1897))__write__FP9sofstream_P9sofstreamPCcUl__1), ((signed int (*)(void *__anonymous_object1898, const char *__fmt__PCc_1, ...))__fmt__Fi_P9sofstreamPCc__1), (((void)(_tmp_cp_ret16=___operator_bitor__A0_1_0_0___sepPrt__PFb_Pd0___sepReset__PF_Pd0___sepReset__PF_Pd0b___sepGetCur__PFPCc_Pd0___sepSetCur__PF_Pd0PCc___getNL__PFb_Pd0___setNL__PF_Pd0b___sepOn__PF_Pd0___sepOff__PF_Pd0___sepDisable__PFb_Pd0___sepEnable__PFb_Pd0___sepGet__PFPCc_Pd0___sepSet__PF_Pd0PCc___sepGetTuple__PFPCc_Pd0___sepSetTuple__PF_Pd0PCc___fail__PFi_Pd0___flush__PFi_Pd0___open__PF_Pd0PCcPCc___close__PF_Pd0___write__PFPd0_Pd0PCcUl___fmt__PFi_Pd0PCc__FPd0_Pd0Ui__1(((_Bool (*)(void *__anonymous_object1899))__sepPrt__Fb_P9sofstream__1), ((void (*)(void *__anonymous_object1900))__sepReset__F_P9sofstream__1), ((void (*)(void *__anonymous_object1901, _Bool __anonymous_object1902))__sepReset__F_P9sofstreamb__1), ((const char *(*)(void *__anonymous_object1903))__sepGetCur__FPCc_P9sofstream__1), ((void (*)(void *__anonymous_object1904, const char *__anonymous_object1905))__sepSetCur__F_P9sofstreamPCc__1), ((_Bool (*)(void *__anonymous_object1906))__getNL__Fb_P9sofstream__1), ((void (*)(void *__anonymous_object1907, _Bool __anonymous_object1908))__setNL__F_P9sofstreamb__1), ((void (*)(void *__anonymous_object1909))__sepOn__F_P9sofstream__1), ((void (*)(void *__anonymous_object1910))__sepOff__F_P9sofstream__1), ((_Bool (*)(void *__anonymous_object1911))__sepDisable__Fb_P9sofstream__1), ((_Bool (*)(void *__anonymous_object1912))__sepEnable__Fb_P9sofstream__1), ((const char *(*)(void *__anonymous_object1913))__sepGet__FPCc_P9sofstream__1), ((void (*)(void *__anonymous_object1914, const char *__anonymous_object1915))__sepSet__F_P9sofstreamPCc__1), ((const char *(*)(void *__anonymous_object1916))__sepGetTuple__FPCc_P9sofstream__1), ((void (*)(void *__anonymous_object1917, const char *__anonymous_object1918))__sepSetTuple__F_P9sofstreamPCc__1), ((signed int (*)(void *__anonymous_object1919))__fail__Fi_P9sofstream__1), ((signed int (*)(void *__anonymous_object1920))__flush__Fi_P9sofstream__1), ((void (*)(void *__os__P7tostype_1, const char *__name__PCc_1, const char *__mode__PCc_1))__open__F_P9sofstreamPCcPCc__1), ((void (*)(void *__os__P7tostype_1))__close__F_P9sofstream__1), ((void *(*)(void *__anonymous_object1921, const char *__anonymous_object1922, unsigned long int __anonymous_object1923))__write__FP9sofstream_P9sofstreamPCcUl__1), ((signed int (*)(void *__anonymous_object1924, const char *__fmt__PCc_1, ...))__fmt__Fi_P9sofstreamPCc__1), (((void)(_tmp_cp_ret15=___operator_bitor__A0_1_0_0___sepPrt__PFb_Pd0___sepReset__PF_Pd0___sepReset__PF_Pd0b___sepGetCur__PFPCc_Pd0___sepSetCur__PF_Pd0PCc___getNL__PFb_Pd0___setNL__PF_Pd0b___sepOn__PF_Pd0___sepOff__PF_Pd0___sepDisable__PFb_Pd0___sepEnable__PFb_Pd0___sepGet__PFPCc_Pd0___sepSet__PF_Pd0PCc___sepGetTuple__PFPCc_Pd0___sepSetTuple__PF_Pd0PCc___fail__PFi_Pd0___flush__PFi_Pd0___open__PF_Pd0PCcPCc___close__PF_Pd0___write__PFPd0_Pd0PCcUl___fmt__PFi_Pd0PCc__FPd0_Pd0PCc__1(((_Bool (*)(void *__anonymous_object1925))__sepPrt__Fb_P9sofstream__1), ((void (*)(void *__anonymous_object1926))__sepReset__F_P9sofstream__1), ((void (*)(void *__anonymous_object1927, _Bool __anonymous_object1928))__sepReset__F_P9sofstreamb__1), ((const char *(*)(void *__anonymous_object1929))__sepGetCur__FPCc_P9sofstream__1), ((void (*)(void *__anonymous_object1930, const char *__anonymous_object1931))__sepSetCur__F_P9sofstreamPCc__1), ((_Bool (*)(void *__anonymous_object1932))__getNL__Fb_P9sofstream__1), ((void (*)(void *__anonymous_object1933, _Bool __anonymous_object1934))__setNL__F_P9sofstreamb__1), ((void (*)(void *__anonymous_object1935))__sepOn__F_P9sofstream__1), ((void (*)(void *__anonymous_object1936))__sepOff__F_P9sofstream__1), ((_Bool (*)(void *__anonymous_object1937))__sepDisable__Fb_P9sofstream__1), ((_Bool (*)(void *__anonymous_object1938))__sepEnable__Fb_P9sofstream__1), ((const char *(*)(void *__anonymous_object1939))__sepGet__FPCc_P9sofstream__1), ((void (*)(void *__anonymous_object1940, const char *__anonymous_object1941))__sepSet__F_P9sofstreamPCc__1), ((const char *(*)(void *__anonymous_object1942))__sepGetTuple__FPCc_P9sofstream__1), ((void (*)(void *__anonymous_object1943, const char *__anonymous_object1944))__sepSetTuple__F_P9sofstreamPCc__1), ((signed int (*)(void *__anonymous_object1945))__fail__Fi_P9sofstream__1), ((signed int (*)(void *__anonymous_object1946))__flush__Fi_P9sofstream__1), ((void (*)(void *__os__P7tostype_1, const char *__name__PCc_1, const char *__mode__PCc_1))__open__F_P9sofstreamPCcPCc__1), ((void (*)(void *__os__P7tostype_1))__close__F_P9sofstream__1), ((void *(*)(void *__anonymous_object1947, const char *__anonymous_object1948, unsigned long int __anonymous_object1949))__write__FP9sofstream_P9sofstreamPCcUl__1), ((signed int (*)(void *__anonymous_object1950, const char *__fmt__PCc_1, ...))__fmt__Fi_P9sofstreamPCc__1), __sout__P9sofstream_1, "size_t"))) , _tmp_cp_ret15), __v__Ui_1))) , _tmp_cp_ret16), ((void *(*)(void *__anonymous_object1951))(&_thunk5))))) , _tmp_cp_ret17)); 531 500 ((void)(_tmp_cp_ret15) /* ^?{} */); 532 501 ((void)(_tmp_cp_ret16) /* ^?{} */); … … 739 708 ((void)0123456789.e-09L); 740 709 ((void)0123456789.e-09DL); 741 ((void)( +0123456789.e-09));742 ((void)( +0123456789.e-09f));743 ((void)( +0123456789.e-09l));744 ((void)( +0123456789.e-09F));745 ((void)( +0123456789.e-09L));746 ((void)( +0123456789.e-09DL));710 ((void)(-0123456789.e-09)); 711 ((void)(-0123456789.e-09f)); 712 ((void)(-0123456789.e-09l)); 713 ((void)(-0123456789.e-09F)); 714 ((void)(-0123456789.e-09L)); 715 ((void)(-0123456789.e-09DL)); 747 716 ((void)(-0123456789.e-09)); 748 717 ((void)(-0123456789.e-09f)); … … 883 852 ((void)0123456789.0123456789E-09L); 884 853 ((void)0123456789.0123456789E-09DL); 885 ((void)( +0123456789.0123456789E-09));886 ((void)( +0123456789.0123456789E-09f));887 ((void)( +0123456789.0123456789E-09l));888 ((void)( +0123456789.0123456789E-09F));889 ((void)( +0123456789.0123456789E-09L));890 ((void)( +0123456789.0123456789E-09DL));854 ((void)(-0123456789.0123456789E-09)); 855 ((void)(-0123456789.0123456789E-09f)); 856 ((void)(-0123456789.0123456789E-09l)); 857 ((void)(-0123456789.0123456789E-09F)); 858 ((void)(-0123456789.0123456789E-09L)); 859 ((void)(-0123456789.0123456789E-09DL)); 891 860 ((void)(-0123456789.0123456789E-09)); 892 861 ((void)(-0123456789.0123456789E-09f)); … … 930 899 ((void)0x0123456789.p-09F); 931 900 ((void)0x0123456789.p-09L); 932 ((void)( +0x0123456789.p-09));933 ((void)( +0x0123456789.p-09f));934 ((void)( +0x0123456789.p-09l));935 ((void)( +0x0123456789.p-09F));936 ((void)( +0x0123456789.p-09L));901 ((void)(-0x0123456789.p-09)); 902 ((void)(-0x0123456789.p-09f)); 903 ((void)(-0x0123456789.p-09l)); 904 ((void)(-0x0123456789.p-09F)); 905 ((void)(-0x0123456789.p-09L)); 937 906 ((void)(-0x0123456789.p-09)); 938 907 ((void)(-0x0123456789.p-09f)); … … 975 944 ((void)0x.0123456789P-09F); 976 945 ((void)0x.0123456789P-09L); 977 ((void)( +0x.0123456789P-09));978 ((void)( +0x.0123456789P-09f));979 ((void)( +0x.0123456789P-09l));980 ((void)( +0x.0123456789P-09F));981 ((void)( +0x.0123456789P-09L));946 ((void)(-0x.0123456789P-09)); 947 ((void)(-0x.0123456789P-09f)); 948 ((void)(-0x.0123456789P-09l)); 949 ((void)(-0x.0123456789P-09F)); 950 ((void)(-0x.0123456789P-09L)); 982 951 ((void)(-0x.0123456789P-09)); 983 952 ((void)(-0x.0123456789P-09f)); … … 1020 989 ((void)0X0123456789.0123456789P-09F); 1021 990 ((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));1027 991 ((void)(-0X0123456789.0123456789P-09)); 1028 992 ((void)(-0X0123456789.0123456789P-09f)); … … 1030 994 ((void)(-0X0123456789.0123456789P-09F)); 1031 995 ((void)(-0X0123456789.0123456789P-09L)); 1032 ((void)((signed char )01234567)); 1033 ((void)((signed short int )01234567)); 1034 ((void)((signed int )01234567)); 1035 ((void)((signed long long int )01234567)); 1036 ((void)((__int128 )01234567)); 1037 ((void)((unsigned char )01234567u)); 1038 ((void)((signed short int )01234567u)); 1039 ((void)((unsigned int )01234567u)); 1040 ((void)((signed long long int )01234567u)); 1041 ((void)((__int128 )01234567u)); 1042 ((void)(+((signed int )((signed char )01234567)))); 1043 ((void)(+((signed int )((signed short int )01234567)))); 1044 ((void)(+((signed int )01234567))); 1045 ((void)(+((signed long long int )01234567))); 1046 ((void)(+((float )((__int128 )01234567)))); 1047 ((void)(+((signed int )((unsigned char )01234567u)))); 1048 ((void)(+((signed int )((signed short int )01234567u)))); 1049 ((void)(+((unsigned int )01234567u))); 1050 ((void)(+((signed long long int )01234567u))); 1051 ((void)(+((float )((__int128 )01234567u)))); 1052 ((void)(-((signed int )((signed char )01234567)))); 1053 ((void)(-((signed int )((signed short int )01234567)))); 1054 ((void)(-((signed int )01234567))); 1055 ((void)(-((signed long long int )01234567))); 1056 ((void)(-((float )((__int128 )01234567)))); 1057 ((void)(-((signed int )((unsigned char )01234567u)))); 1058 ((void)(-((signed int )((signed short int )01234567u)))); 1059 ((void)(-((unsigned int )01234567u))); 1060 ((void)(-((signed long long int )01234567u))); 1061 ((void)(-((float )((__int128 )01234567u)))); 1062 ((void)((signed char )1234567890)); 1063 ((void)((signed short int )1234567890)); 1064 ((void)((signed int )1234567890)); 1065 ((void)((signed long long int )1234567890)); 1066 ((void)((__int128 )1234567890)); 1067 ((void)((signed char )1234567890U)); 1068 ((void)((unsigned short int )1234567890U)); 1069 ((void)((signed int )1234567890U)); 1070 ((void)((unsigned long long int )1234567890u)); 1071 ((void)((unsigned __int128 )1234567890u)); 1072 ((void)(+((signed int )((signed char )1234567890)))); 1073 ((void)(+((signed int )((signed short int )1234567890)))); 1074 ((void)(+((signed int )1234567890))); 1075 ((void)(+((signed long long int )1234567890))); 1076 ((void)(+((float )((__int128 )1234567890)))); 1077 ((void)(+((signed int )((signed char )1234567890U)))); 1078 ((void)(+((signed int )((unsigned short int )1234567890U)))); 1079 ((void)(+((signed int )1234567890U))); 1080 ((void)(+((unsigned long long int )1234567890u))); 1081 ((void)(+((float )((unsigned __int128 )1234567890u)))); 1082 ((void)(-((signed int )((signed char )1234567890)))); 1083 ((void)(-((signed int )((signed short int )1234567890)))); 1084 ((void)(-((signed int )1234567890))); 1085 ((void)(-((signed long long int )1234567890))); 1086 ((void)(-((float )((__int128 )1234567890)))); 1087 ((void)(-((signed int )((signed char )1234567890U)))); 1088 ((void)(-((signed int )((unsigned short int )1234567890U)))); 1089 ((void)(-((signed int )1234567890U))); 1090 ((void)(-((unsigned long long int )1234567890u))); 1091 ((void)(-((float )((unsigned __int128 )1234567890u)))); 1092 ((void)((signed char )0x0123456789abcdef)); 1093 ((void)((signed short int )0x0123456789abcdef)); 1094 ((void)((signed int )0x0123456789abcdef)); 1095 ((void)((signed long long int )0x0123456789abcdef)); 1096 ((void)((signed char )0x0123456789abcdefu)); 1097 ((void)((unsigned short int )0x0123456789abcdefu)); 1098 ((void)((signed int )0x0123456789abcdefu)); 1099 ((void)((unsigned long long int )0x0123456789abcdefu)); 1100 ((void)(+((signed int )((signed char )0x0123456789abcdef)))); 1101 ((void)(+((signed int )((signed short int )0x0123456789abcdef)))); 1102 ((void)(+((signed int )0x0123456789abcdef))); 1103 ((void)(+((signed long long int )0x0123456789abcdef))); 1104 ((void)(+((signed int )((signed char )0x0123456789abcdefu)))); 1105 ((void)(+((signed int )((unsigned short int )0x0123456789abcdefu)))); 1106 ((void)(+((signed int )0x0123456789abcdefu))); 1107 ((void)(+((unsigned long long int )0x0123456789abcdefu))); 1108 ((void)(-((signed int )((signed char )0x0123456789abcdef)))); 1109 ((void)(-((signed int )((signed short int )0x0123456789abcdef)))); 1110 ((void)(-((signed int )0x0123456789abcdef))); 1111 ((void)(-((signed long long int )0x0123456789abcdef))); 1112 ((void)(-((signed int )((signed char )0x0123456789abcdefu)))); 1113 ((void)(-((signed int )((unsigned short int )0x0123456789abcdefu)))); 1114 ((void)(-((signed int )0x0123456789abcdefu))); 1115 ((void)(-((unsigned long long int )0x0123456789abcdefu))); 1116 ((void)((signed char )0x0123456789ABCDEF)); 1117 ((void)((signed short int )0x0123456789ABCDEF)); 1118 ((void)((signed int )0x0123456789ABCDEF)); 1119 ((void)((signed long long int )0x0123456789ABCDEF)); 1120 ((void)((signed char )0x0123456789ABCDEFu)); 1121 ((void)((unsigned short int )0x0123456789ABCDEFu)); 1122 ((void)((signed int )0x0123456789ABCDEFu)); 1123 ((void)((unsigned long long int )0x0123456789ABCDEFu)); 1124 ((void)(+((signed int )((signed char )0x0123456789ABCDEF)))); 1125 ((void)(+((signed int )((signed short int )0x0123456789ABCDEF)))); 1126 ((void)(+((signed int )0x0123456789ABCDEF))); 1127 ((void)(+((signed long long int )0x0123456789ABCDEF))); 1128 ((void)(+((signed int )((signed char )0x0123456789ABCDEFu)))); 1129 ((void)(+((signed int )((unsigned short int )0x0123456789ABCDEFu)))); 1130 ((void)(+((signed int )0x0123456789ABCDEFu))); 1131 ((void)(+((unsigned long long int )0x0123456789ABCDEFu))); 1132 ((void)(-((signed int )((signed char )0x0123456789ABCDEF)))); 1133 ((void)(-((signed int )((signed short int )0x0123456789ABCDEF)))); 1134 ((void)(-((signed int )0x0123456789ABCDEF))); 1135 ((void)(-((signed long long int )0x0123456789ABCDEF))); 1136 ((void)(-((signed int )((signed char )0x0123456789ABCDEFu)))); 1137 ((void)(-((signed int )((unsigned short int )0x0123456789ABCDEFu)))); 1138 ((void)(-((signed int )0x0123456789ABCDEFu))); 1139 ((void)(-((unsigned long long int )0x0123456789ABCDEFu))); 1140 ((void)((signed char )0X0123456789abcdef)); 1141 ((void)((signed short int )0X0123456789abcdef)); 1142 ((void)((signed int )0X0123456789abcdef)); 1143 ((void)((signed long long int )0X0123456789abcdef)); 1144 ((void)((signed char )0X0123456789abcdefu)); 1145 ((void)((unsigned short int )0X0123456789abcdefu)); 1146 ((void)((signed int )0X0123456789abcdefu)); 1147 ((void)((unsigned long long int )0X0123456789abcdefu)); 1148 ((void)(+((signed int )((signed char )0X0123456789abcdef)))); 1149 ((void)(+((signed int )((signed short int )0X0123456789abcdef)))); 1150 ((void)(+((signed int )0X0123456789abcdef))); 1151 ((void)(+((signed long long int )0X0123456789abcdef))); 1152 ((void)(+((signed int )((signed char )0X0123456789abcdefu)))); 1153 ((void)(+((signed int )((unsigned short int )0X0123456789abcdefu)))); 1154 ((void)(+((signed int )0X0123456789abcdefu))); 1155 ((void)(+((unsigned long long int )0X0123456789abcdefu))); 1156 ((void)(-((signed int )((signed char )0X0123456789abcdef)))); 1157 ((void)(-((signed int )((signed short int )0X0123456789abcdef)))); 1158 ((void)(-((signed int )0X0123456789abcdef))); 1159 ((void)(-((signed long long int )0X0123456789abcdef))); 1160 ((void)(-((signed int )((signed char )0X0123456789abcdefu)))); 1161 ((void)(-((signed int )((unsigned short int )0X0123456789abcdefu)))); 1162 ((void)(-((signed int )0X0123456789abcdefu))); 1163 ((void)(-((unsigned long long int )0X0123456789abcdefu))); 1164 ((void)((signed char )0X0123456789ABCDEF)); 1165 ((void)((signed short int )0X0123456789ABCDEF)); 1166 ((void)((signed int )0X0123456789ABCDEF)); 1167 ((void)((signed long long int )0X0123456789ABCDEF)); 1168 ((void)((signed char )0X0123456789ABCDEFu)); 1169 ((void)((unsigned short int )0X0123456789ABCDEFu)); 1170 ((void)((signed int )0X0123456789ABCDEFu)); 1171 ((void)((unsigned long long int )0X0123456789ABCDEFu)); 1172 ((void)(+((signed int )((signed char )0X0123456789ABCDEF)))); 1173 ((void)(+((signed int )((signed short int )0X0123456789ABCDEF)))); 1174 ((void)(+((signed int )0X0123456789ABCDEF))); 1175 ((void)(+((signed long long int )0X0123456789ABCDEF))); 1176 ((void)(+((signed int )((signed char )0X0123456789ABCDEFu)))); 1177 ((void)(+((signed int )((unsigned short int )0X0123456789ABCDEFu)))); 1178 ((void)(+((signed int )0X0123456789ABCDEFu))); 1179 ((void)(+((unsigned long long int )0X0123456789ABCDEFu))); 1180 ((void)(-((signed int )((signed char )0X0123456789ABCDEF)))); 1181 ((void)(-((signed int )((signed short int )0X0123456789ABCDEF)))); 1182 ((void)(-((signed int )0X0123456789ABCDEF))); 1183 ((void)(-((signed long long int )0X0123456789ABCDEF))); 1184 ((void)(-((signed int )((signed char )0X0123456789ABCDEFu)))); 1185 ((void)(-((signed int )((unsigned short int )0X0123456789ABCDEFu)))); 1186 ((void)(-((signed int )0X0123456789ABCDEFu))); 1187 ((void)(-((unsigned long long int )0X0123456789ABCDEFu))); 1188 ((void)((float )0123456789.)); 1189 ((void)((double )0123456789.)); 1190 ((void)((long double )0123456789.)); 1191 ((void)((long double )0123456789.)); 1192 ((void)(+((float )0123456789.))); 1193 ((void)(+((double )0123456789.))); 1194 ((void)(+((long double )0123456789.))); 1195 ((void)(+((long double )0123456789.))); 1196 ((void)(-((float )0123456789.))); 1197 ((void)(-((double )0123456789.))); 1198 ((void)(-((long double )0123456789.))); 1199 ((void)(-((long double )0123456789.))); 1200 ((void)((float )0123456789.e09)); 1201 ((void)((double )0123456789.e09)); 1202 ((void)((long double )0123456789.e09)); 1203 ((void)((long double )0123456789.e09)); 1204 ((void)(+((float )0123456789.e+09))); 1205 ((void)(+((double )0123456789.e+09))); 1206 ((void)(+((long double )0123456789.e+09))); 1207 ((void)(+((long double )0123456789.e+09))); 1208 ((void)(-((float )0123456789.e-09))); 1209 ((void)(-((double )0123456789.e-09))); 1210 ((void)(-((long double )0123456789.e-09))); 1211 ((void)(-((long double )0123456789.e-09))); 1212 ((void)((float ).0123456789e09)); 1213 ((void)((double ).0123456789e09)); 1214 ((void)((long double ).0123456789e09)); 1215 ((void)((long double ).0123456789e09)); 1216 ((void)(+((float ).0123456789E+09))); 1217 ((void)(+((double ).0123456789E+09))); 1218 ((void)(+((long double ).0123456789E+09))); 1219 ((void)(+((long double ).0123456789E+09))); 1220 ((void)(-((float ).0123456789E-09))); 1221 ((void)(-((double ).0123456789E-09))); 1222 ((void)(-((long double ).0123456789E-09))); 1223 ((void)(-((long double ).0123456789E-09))); 1224 ((void)((float )0123456789.0123456789)); 1225 ((void)((double )0123456789.0123456789)); 1226 ((void)((long double )0123456789.0123456789)); 1227 ((void)((long double )0123456789.0123456789)); 1228 ((void)(+((float )0123456789.0123456789E09))); 1229 ((void)(+((double )0123456789.0123456789E09))); 1230 ((void)(+((long double )0123456789.0123456789E09))); 1231 ((void)(+((long double )0123456789.0123456789E09))); 1232 ((void)(-((float )0123456789.0123456789E+09))); 1233 ((void)(-((double )0123456789.0123456789E+09))); 1234 ((void)(-((long double )0123456789.0123456789E+09))); 1235 ((void)(-((long double )0123456789.0123456789E+09))); 1236 ((void)((float )0123456789.0123456789E-09)); 1237 ((void)((double )0123456789.0123456789E-09)); 1238 ((void)((long double )0123456789.0123456789E-09)); 1239 ((void)((long double )0123456789.0123456789E-09)); 1240 ((void)((float )0x0123456789.p09)); 1241 ((void)((double )0x0123456789.p09)); 1242 ((void)((long double )0x0123456789.p09)); 1243 ((void)((long double )0x0123456789.p09)); 1244 ((void)(+((float )0x0123456789.p09))); 1245 ((void)(+((double )0x0123456789.p09))); 1246 ((void)(+((long double )0x0123456789.p09))); 1247 ((void)(+((long double )0x0123456789.p09))); 1248 ((void)(-((float )0x0123456789.p09))); 1249 ((void)(-((double )0x0123456789.p09))); 1250 ((void)(-((long double )0x0123456789.p09))); 1251 ((void)(-((long double )0x0123456789.p09))); 1252 ((void)((float )0x0123456789.p+09)); 1253 ((void)((double )0x0123456789.p+09)); 1254 ((void)((long double )0x0123456789.p+09)); 1255 ((void)((long double )0x0123456789.p+09)); 1256 ((void)(+((float )0x0123456789.p-09))); 1257 ((void)(+((double )0x0123456789.p-09))); 1258 ((void)(+((long double )0x0123456789.p-09))); 1259 ((void)(+((long double )0x0123456789.p-09))); 1260 ((void)(-((float )0x.0123456789p09))); 1261 ((void)(-((double )0x.0123456789p09))); 1262 ((void)(-((long double )0x.0123456789p09))); 1263 ((void)(-((long double )0x.0123456789p09))); 996 ((void)(-0X0123456789.0123456789P-09)); 997 ((void)(-0X0123456789.0123456789P-09f)); 998 ((void)(-0X0123456789.0123456789P-09l)); 999 ((void)(-0X0123456789.0123456789P-09F)); 1000 ((void)(-0X0123456789.0123456789P-09L)); 1264 1001 ((void)__f__F_c__1('a')); 1265 1002 ((void)__f__F_Sc__1(20)); … … 1374 1111 ((void)L"a" "b" "c"); 1375 1112 ((void)(___retval_main__i_1=0) /* ?{} */); 1376 return ___retval_main__i_1;1113 return ((signed int )___retval_main__i_1); 1377 1114 } 1378 1115 static inline int invoke_main(int argc, char* argv[], char* envp[]) { (void)argc; (void)argv; (void)envp; return __main__Fi___1(); } … … 1389 1126 ((void)(___retval_main__i_1=(((void)(_tmp_cp_ret0=invoke_main(__argc__i_1, __argv__PPc_1, __envp__PPc_1))) , _tmp_cp_ret0)) /* ?{} */); 1390 1127 ((void)(_tmp_cp_ret0) /* ^?{} */); 1391 return ___retval_main__i_1;1392 } 1128 return ((signed int )___retval_main__i_1); 1129 } -
src/tests/.expect/64/KRfunctions.txt
r3f7e12cb r78315272 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);24 23 static inline void ___constructor__F_R2sS_autogen___1(struct S *___dst__R2sS_1){ 25 24 ((void)((*___dst__R2sS_1).__i__i_1) /* ?{} */); … … 34 33 struct S ___ret__2sS_1; 35 34 ((void)((*___dst__R2sS_1).__i__i_1=___src__2sS_1.__i__i_1)); 36 ((void)___constructor__F_R2sS2sS_autogen___1((&___ret__2sS_1), (*___dst__R2sS_1)));37 return ___ret__2sS_1;35 ((void)___constructor__F_R2sS2sS_autogen___1((&___ret__2sS_1), ___src__2sS_1)); 36 return ((struct S )___ret__2sS_1); 38 37 } 39 38 static inline void ___constructor__F_R2sSi_autogen___1(struct S *___dst__R2sS_1, signed int __i__i_1){ … … 66 65 signed int *__x__FPi_ii__2(signed int __anonymous_object2, signed int __anonymous_object3); 67 66 ((void)(___retval_f10__PFPi_ii__1=__x__FPi_ii__2) /* ?{} */); 68 return ___retval_f10__PFPi_ii__1;67 return ((signed int *(*)(signed int __x__i_1, signed int __y__i_1))___retval_f10__PFPi_ii__1); 69 68 } 70 69 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
r3f7e12cb r78315272 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), (*___dst__R13s__anonymous0_1)));26 return ___ret__13s__anonymous0_1;25 ((void)___constructor__F_R13s__anonymous013s__anonymous0_autogen___1((&___ret__13s__anonymous0_1), ___src__13s__anonymous0_1)); 26 return ((struct __anonymous0 )___ret__13s__anonymous0_1); 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), (*___dst__R5sAgn2_1)));44 return ___ret__5sAgn2_1;43 ((void)___constructor__F_R5sAgn25sAgn2_autogen___1((&___ret__5sAgn2_1), ___src__5sAgn2_1)); 44 return ((struct Agn2 )___ret__5sAgn2_1); 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);81 71 static inline void ___constructor__F_R4sFdl_autogen___1(struct Fdl *___dst__R4sFdl_1){ 82 72 ((void)((*___dst__R4sFdl_1).__f1__i_1) /* ?{} */); … … 88 78 ((void)((*___dst__R4sFdl_1).__f7__i_1) /* ?{} */); 89 79 ((void)((*___dst__R4sFdl_1).__f8__i_1) /* ?{} */); 90 ((void)((*___dst__R4sFdl_1).__anonymous_object0) /* ?{} */);91 80 ((void)((*___dst__R4sFdl_1).__f9__Pi_1) /* ?{} */); 92 81 } … … 100 89 ((void)((*___dst__R4sFdl_1).__f7__i_1=___src__4sFdl_1.__f7__i_1) /* ?{} */); 101 90 ((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) /* ?{} */);103 91 ((void)((*___dst__R4sFdl_1).__f9__Pi_1=___src__4sFdl_1.__f9__Pi_1) /* ?{} */); 104 92 } 105 93 static inline void ___destructor__F_R4sFdl_autogen___1(struct Fdl *___dst__R4sFdl_1){ 106 94 ((void)((*___dst__R4sFdl_1).__f9__Pi_1) /* ^?{} */); 107 ((void)((*___dst__R4sFdl_1).__anonymous_object0) /* ^?{} */);108 95 ((void)((*___dst__R4sFdl_1).__f8__i_1) /* ^?{} */); 109 96 ((void)((*___dst__R4sFdl_1).__f7__i_1) /* ^?{} */); … … 125 112 ((void)((*___dst__R4sFdl_1).__f7__i_1=___src__4sFdl_1.__f7__i_1)); 126 113 ((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));128 114 ((void)((*___dst__R4sFdl_1).__f9__Pi_1=___src__4sFdl_1.__f9__Pi_1)); 129 ((void)___constructor__F_R4sFdl4sFdl_autogen___1((&___ret__4sFdl_1), (*___dst__R4sFdl_1)));130 return ___ret__4sFdl_1;115 ((void)___constructor__F_R4sFdl4sFdl_autogen___1((&___ret__4sFdl_1), ___src__4sFdl_1)); 116 return ((struct Fdl )___ret__4sFdl_1); 131 117 } 132 118 static inline void ___constructor__F_R4sFdli_autogen___1(struct Fdl *___dst__R4sFdl_1, signed int __f1__i_1){ … … 139 125 ((void)((*___dst__R4sFdl_1).__f7__i_1) /* ?{} */); 140 126 ((void)((*___dst__R4sFdl_1).__f8__i_1) /* ?{} */); 141 ((void)((*___dst__R4sFdl_1).__anonymous_object0) /* ?{} */);142 127 ((void)((*___dst__R4sFdl_1).__f9__Pi_1) /* ?{} */); 143 128 } … … 151 136 ((void)((*___dst__R4sFdl_1).__f7__i_1) /* ?{} */); 152 137 ((void)((*___dst__R4sFdl_1).__f8__i_1) /* ?{} */); 153 ((void)((*___dst__R4sFdl_1).__anonymous_object0) /* ?{} */);154 138 ((void)((*___dst__R4sFdl_1).__f9__Pi_1) /* ?{} */); 155 139 } … … 163 147 ((void)((*___dst__R4sFdl_1).__f7__i_1) /* ?{} */); 164 148 ((void)((*___dst__R4sFdl_1).__f8__i_1) /* ?{} */); 165 ((void)((*___dst__R4sFdl_1).__anonymous_object0) /* ?{} */);166 149 ((void)((*___dst__R4sFdl_1).__f9__Pi_1) /* ?{} */); 167 150 } … … 175 158 ((void)((*___dst__R4sFdl_1).__f7__i_1) /* ?{} */); 176 159 ((void)((*___dst__R4sFdl_1).__f8__i_1) /* ?{} */); 177 ((void)((*___dst__R4sFdl_1).__anonymous_object0) /* ?{} */);178 160 ((void)((*___dst__R4sFdl_1).__f9__Pi_1) /* ?{} */); 179 161 } … … 187 169 ((void)((*___dst__R4sFdl_1).__f7__i_1) /* ?{} */); 188 170 ((void)((*___dst__R4sFdl_1).__f8__i_1) /* ?{} */); 189 ((void)((*___dst__R4sFdl_1).__anonymous_object0) /* ?{} */);190 171 ((void)((*___dst__R4sFdl_1).__f9__Pi_1) /* ?{} */); 191 172 } … … 199 180 ((void)((*___dst__R4sFdl_1).__f7__i_1) /* ?{} */); 200 181 ((void)((*___dst__R4sFdl_1).__f8__i_1) /* ?{} */); 201 ((void)((*___dst__R4sFdl_1).__anonymous_object0) /* ?{} */);202 182 ((void)((*___dst__R4sFdl_1).__f9__Pi_1) /* ?{} */); 203 183 } … … 211 191 ((void)((*___dst__R4sFdl_1).__f7__i_1=__f7__i_1) /* ?{} */); 212 192 ((void)((*___dst__R4sFdl_1).__f8__i_1) /* ?{} */); 213 ((void)((*___dst__R4sFdl_1).__anonymous_object0) /* ?{} */);214 193 ((void)((*___dst__R4sFdl_1).__f9__Pi_1) /* ?{} */); 215 194 } … … 223 202 ((void)((*___dst__R4sFdl_1).__f7__i_1=__f7__i_1) /* ?{} */); 224 203 ((void)((*___dst__R4sFdl_1).__f8__i_1=__f8__i_1) /* ?{} */); 225 ((void)((*___dst__R4sFdl_1).__anonymous_object0) /* ?{} */); 226 ((void)((*___dst__R4sFdl_1).__f9__Pi_1) /* ?{} */); 227 } 228 static inline void ___constructor__F_R4sFdliiiiiiiii_autogen___1(struct Fdl *___dst__R4sFdl_1, signed int __f1__i_1, signed int __f2__i_1, signed int __f3__i_1, signed int __f4__i_1, signed int __f5__i_1, signed int __f6__i_1, signed int __f7__i_1, signed int __f8__i_1, signed int __anonymous_object3){ 204 ((void)((*___dst__R4sFdl_1).__f9__Pi_1) /* ?{} */); 205 } 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){ 229 207 ((void)((*___dst__R4sFdl_1).__f1__i_1=__f1__i_1) /* ?{} */); 230 208 ((void)((*___dst__R4sFdl_1).__f2__i_1=__f2__i_1) /* ?{} */); … … 235 213 ((void)((*___dst__R4sFdl_1).__f7__i_1=__f7__i_1) /* ?{} */); 236 214 ((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) /* ?{} */);250 215 ((void)((*___dst__R4sFdl_1).__f9__Pi_1=__f9__Pi_1) /* ?{} */); 251 216 } … … 267 232 __attribute__ ((unused)) signed int **const ___retval_f2__CPPi_1; 268 233 } 269 __attribute__ ((unused,used,unused)) signed int (*__f3__FPA0i_i__1(signed int __anonymous_object 5))[];234 __attribute__ ((unused,used,unused)) signed int (*__f3__FPA0i_i__1(signed int __anonymous_object1))[]; 270 235 __attribute__ ((unused,unused)) signed int (*__f3__FPA0i_i__1(signed int __p__i_1))[]{ 271 236 __attribute__ ((unused)) signed int (*___retval_f3__PA0i_1)[]; 272 237 } 273 __attribute__ ((unused,used,unused)) signed int (*__f4__FPFi_i____1())(signed int __anonymous_object 6);274 __attribute__ ((unused,unused)) signed int (*__f4__FPFi_i____1())(signed int __anonymous_object 7){275 __attribute__ ((unused)) signed int (*___retval_f4__PFi_i__1)(signed int __anonymous_object 8);238 __attribute__ ((unused,used,unused)) signed int (*__f4__FPFi_i____1())(signed int __anonymous_object2); 239 __attribute__ ((unused,unused)) signed int (*__f4__FPFi_i____1())(signed int __anonymous_object3){ 240 __attribute__ ((unused)) signed int (*___retval_f4__PFi_i__1)(signed int __anonymous_object4); 276 241 } 277 242 signed int __vtr__Fi___1(){ … … 303 268 signed int __tpr2__Fi_PPi__1(__attribute__ ((unused,unused,unused,unused,unused,unused)) signed int **__Foo__PPi_1); 304 269 signed int __tpr3__Fi_Pi__1(__attribute__ ((unused,unused,unused)) signed int *__Foo__Pi_1); 305 signed int __tpr4__Fi_PFi_Pi___1(__attribute__ ((unused,unused)) signed int (*__anonymous_object 9)(__attribute__ ((unused,unused)) signed int __anonymous_object10[((unsigned long int )5)]));270 signed int __tpr4__Fi_PFi_Pi___1(__attribute__ ((unused,unused)) signed int (*__anonymous_object5)(__attribute__ ((unused,unused)) signed int __anonymous_object6[((unsigned long int )5)])); 306 271 signed int __tpr5__Fi_PFi____1(__attribute__ ((unused,unused,unused)) signed int (*__Foo__PFi___1)()); 307 272 signed int __tpr6__Fi_PFi____1(__attribute__ ((unused,unused,unused)) signed int (*__Foo__PFi___1)()); 308 signed int __tpr7__Fi_PFi_PFi_i____1(__attribute__ ((unused,unused)) signed int (*__anonymous_object 11)(__attribute__ ((unused)) signed int (*__anonymous_object12)(__attribute__ ((unused,unused)) signed int __anonymous_object13)));273 signed int __tpr7__Fi_PFi_PFi_i____1(__attribute__ ((unused,unused)) signed int (*__anonymous_object7)(__attribute__ ((unused)) signed int (*__anonymous_object8)(__attribute__ ((unused,unused)) signed int __anonymous_object9))); 309 274 signed int __ad__Fi___1(){ 310 275 __attribute__ ((unused)) signed int ___retval_ad__i_1; … … 335 300 struct __anonymous4 ___ret__13s__anonymous4_2; 336 301 ((void)((*___dst__R13s__anonymous4_2).__i__i_2=___src__13s__anonymous4_2.__i__i_2)); 337 ((void)___constructor__F_R13s__anonymous413s__anonymous4_autogen___2((&___ret__13s__anonymous4_2), (*___dst__R13s__anonymous4_2)));338 return ___ret__13s__anonymous4_2;302 ((void)___constructor__F_R13s__anonymous413s__anonymous4_autogen___2((&___ret__13s__anonymous4_2), ___src__13s__anonymous4_2)); 303 return ((struct __anonymous4 )___ret__13s__anonymous4_2); 339 304 } 340 305 inline void ___constructor__F_R13s__anonymous4i_autogen___2(struct __anonymous4 *___dst__R13s__anonymous4_2, signed int __i__i_2){ … … 348 313 } 349 314 inline void ___constructor__F_R13e__anonymous513e__anonymous5_intrinsic___2(enum __anonymous5 *___dst__R13e__anonymous5_2, enum __anonymous5 ___src__13e__anonymous5_2){ 350 ((void)((*___dst__R13e__anonymous5_2)=___src__13e__anonymous5_2) /* ?{} */);315 ((void)((*___dst__R13e__anonymous5_2)=___src__13e__anonymous5_2)); 351 316 } 352 317 inline void ___destructor__F_R13e__anonymous5_intrinsic___2(__attribute__ ((unused)) enum __anonymous5 *___dst__R13e__anonymous5_2){ … … 354 319 inline enum __anonymous5 ___operator_assign__F13e__anonymous5_R13e__anonymous513e__anonymous5_intrinsic___2(enum __anonymous5 *___dst__R13e__anonymous5_2, enum __anonymous5 ___src__13e__anonymous5_2){ 355 320 enum __anonymous5 ___ret__13e__anonymous5_2; 356 ((void)((*___dst__R13e__anonymous5_2)=___src__13e__anonymous5_2)); 357 ((void)(___ret__13e__anonymous5_2=(*___dst__R13e__anonymous5_2)) /* ?{} */); 358 return ___ret__13e__anonymous5_2; 321 ((void)(___ret__13e__anonymous5_2=((*___dst__R13e__anonymous5_2)=___src__13e__anonymous5_2)) /* ?{} */); 322 return ((enum __anonymous5 )___ret__13e__anonymous5_2); 359 323 } 360 324 ((void)sizeof(enum __anonymous5 )); 361 325 } 362 signed int __apd1__Fi_PiPi__1(__attribute__ ((unused,unused,unused)) signed int *__anonymous_object1 4, __attribute__ ((unused,unused,unused)) signed int *__anonymous_object15);363 signed int __apd2__Fi_PPiPPi__1(__attribute__ ((unused,unused,unused,unused)) signed int **__anonymous_object1 6, __attribute__ ((unused,unused,unused,unused)) signed int **__anonymous_object17);364 signed int __apd3__Fi_PiPi__1(__attribute__ ((unused,unused,unused)) signed int *__anonymous_object1 8, __attribute__ ((unused,unused,unused)) signed int *__anonymous_object19);365 signed int __apd4__Fi_PFi__PFi____1(__attribute__ ((unused,unused,unused)) signed int (*__anonymous_object 20)(), __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_object 22)(__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_object2 6)(), __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_object2 8)(__attribute__ ((unused)) signed int __anonymous_object29), __attribute__ ((unused,unused,unused)) signed int (*__anonymous_object30)(__attribute__ ((unused)) signed int __anonymous_object31));326 signed int __apd1__Fi_PiPi__1(__attribute__ ((unused,unused,unused)) signed int *__anonymous_object10, __attribute__ ((unused,unused,unused)) signed int *__anonymous_object11); 327 signed int __apd2__Fi_PPiPPi__1(__attribute__ ((unused,unused,unused,unused)) signed int **__anonymous_object12, __attribute__ ((unused,unused,unused,unused)) signed int **__anonymous_object13); 328 signed int __apd3__Fi_PiPi__1(__attribute__ ((unused,unused,unused)) signed int *__anonymous_object14, __attribute__ ((unused,unused,unused)) signed int *__anonymous_object15); 329 signed int __apd4__Fi_PFi__PFi____1(__attribute__ ((unused,unused,unused)) signed int (*__anonymous_object16)(), __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_object18)(__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_object22)(), __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_object24)(__attribute__ ((unused)) signed int __anonymous_object25), __attribute__ ((unused,unused,unused)) signed int (*__anonymous_object26)(__attribute__ ((unused)) signed int __anonymous_object27)); 369 333 struct Vad { 370 __attribute__ ((unused)) signed int __anonymous_object 32;371 __attribute__ ((unused,unused)) signed int *__anonymous_object 33;372 __attribute__ ((unused,unused)) signed int __anonymous_object3 4[((unsigned long int )10)];373 __attribute__ ((unused,unused)) signed int (*__anonymous_object3 5)();334 __attribute__ ((unused)) signed int __anonymous_object28; 335 __attribute__ ((unused,unused)) signed int *__anonymous_object29; 336 __attribute__ ((unused,unused)) signed int __anonymous_object30[((unsigned long int )10)]; 337 __attribute__ ((unused,unused)) signed int (*__anonymous_object31)(); 374 338 }; 375 339 static inline void ___constructor__F_R4sVad_autogen___1(struct Vad *___dst__R4sVad_1); … … 377 341 static inline void ___destructor__F_R4sVad_autogen___1(struct Vad *___dst__R4sVad_1); 378 342 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)());383 343 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) /* ?{} */);395 344 } 396 345 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) /* ?{} */);408 346 } 409 347 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) /* ^?{} */);421 348 } 422 349 static inline struct Vad ___operator_assign__F4sVad_R4sVad4sVad_autogen___1(struct Vad *___dst__R4sVad_1, struct Vad ___src__4sVad_1){ 423 350 struct Vad ___ret__4sVad_1; 424 ((void)((*___dst__R4sVad_1).__anonymous_object32=___src__4sVad_1.__anonymous_object32)); 425 ((void)((*___dst__R4sVad_1).__anonymous_object33=___src__4sVad_1.__anonymous_object33)); 426 { 427 signed int _index3 = 0; 428 for (;(_index3<10);((void)(++_index3))) { 429 ((void)((*___dst__R4sVad_1).__anonymous_object34[((signed long int )_index3)]=___src__4sVad_1.__anonymous_object34[((signed long int )_index3)])); 430 } 431 432 } 433 434 ((void)((*___dst__R4sVad_1).__anonymous_object35=___src__4sVad_1.__anonymous_object35)); 435 ((void)___constructor__F_R4sVad4sVad_autogen___1((&___ret__4sVad_1), (*___dst__R4sVad_1))); 436 return ___ret__4sVad_1; 437 } 438 static inline void ___constructor__F_R4sVadi_autogen___1(struct Vad *___dst__R4sVad_1, signed int __anonymous_object46){ 439 ((void)((*___dst__R4sVad_1).__anonymous_object32=__anonymous_object46) /* ?{} */); 440 ((void)((*___dst__R4sVad_1).__anonymous_object33) /* ?{} */); 441 { 442 signed int _index4 = 0; 443 for (;(_index4<10);((void)(++_index4))) { 444 ((void)((*((signed int *)(&(*___dst__R4sVad_1).__anonymous_object34[((signed long int )_index4)])))) /* ?{} */); 445 } 446 447 } 448 449 ((void)((*___dst__R4sVad_1).__anonymous_object35) /* ?{} */); 450 } 451 static inline void ___constructor__F_R4sVadiPi_autogen___1(struct Vad *___dst__R4sVad_1, signed int __anonymous_object47, signed int *__anonymous_object48){ 452 ((void)((*___dst__R4sVad_1).__anonymous_object32=__anonymous_object47) /* ?{} */); 453 ((void)((*___dst__R4sVad_1).__anonymous_object33=__anonymous_object48) /* ?{} */); 454 { 455 signed int _index5 = 0; 456 for (;(_index5<10);((void)(++_index5))) { 457 ((void)((*((signed int *)(&(*___dst__R4sVad_1).__anonymous_object34[((signed long int )_index5)])))) /* ?{} */); 458 } 459 460 } 461 462 ((void)((*___dst__R4sVad_1).__anonymous_object35) /* ?{} */); 463 } 464 static inline void ___constructor__F_R4sVadiPiA0i_autogen___1(struct Vad *___dst__R4sVad_1, signed int __anonymous_object49, signed int *__anonymous_object50, signed int __anonymous_object51[((unsigned long int )10)]){ 465 ((void)((*___dst__R4sVad_1).__anonymous_object32=__anonymous_object49) /* ?{} */); 466 ((void)((*___dst__R4sVad_1).__anonymous_object33=__anonymous_object50) /* ?{} */); 467 { 468 signed int _index6 = 0; 469 for (;(_index6<10);((void)(++_index6))) { 470 ((void)((*((signed int *)(&(*___dst__R4sVad_1).__anonymous_object34[((signed long int )_index6)])))=__anonymous_object51[((signed long int )_index6)]) /* ?{} */); 471 } 472 473 } 474 475 ((void)((*___dst__R4sVad_1).__anonymous_object35) /* ?{} */); 476 } 477 static inline void ___constructor__F_R4sVadiPiA0iPFi___autogen___1(struct Vad *___dst__R4sVad_1, signed int __anonymous_object52, signed int *__anonymous_object53, signed int __anonymous_object54[((unsigned long int )10)], signed int (*__anonymous_object55)()){ 478 ((void)((*___dst__R4sVad_1).__anonymous_object32=__anonymous_object52) /* ?{} */); 479 ((void)((*___dst__R4sVad_1).__anonymous_object33=__anonymous_object53) /* ?{} */); 480 { 481 signed int _index7 = 0; 482 for (;(_index7<10);((void)(++_index7))) { 483 ((void)((*((signed int *)(&(*___dst__R4sVad_1).__anonymous_object34[((signed long int )_index7)])))=__anonymous_object54[((signed long int )_index7)]) /* ?{} */); 484 } 485 486 } 487 488 ((void)((*___dst__R4sVad_1).__anonymous_object35=__anonymous_object55) /* ?{} */); 489 } 351 ((void)___constructor__F_R4sVad4sVad_autogen___1((&___ret__4sVad_1), ___src__4sVad_1)); 352 return ((struct Vad )___ret__4sVad_1); 353 } -
src/tests/.expect/64/declarationSpecifier.txt
r3f7e12cb r78315272 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);23 22 static inline void ___constructor__F_R13s__anonymous0_autogen___1(struct __anonymous0 *___dst__R13s__anonymous0_1){ 24 23 ((void)((*___dst__R13s__anonymous0_1).__i__i_1) /* ?{} */); … … 33 32 struct __anonymous0 ___ret__13s__anonymous0_1; 34 33 ((void)((*___dst__R13s__anonymous0_1).__i__i_1=___src__13s__anonymous0_1.__i__i_1)); 35 ((void)___constructor__F_R13s__anonymous013s__anonymous0_autogen___1((&___ret__13s__anonymous0_1), (*___dst__R13s__anonymous0_1)));36 return ___ret__13s__anonymous0_1;34 ((void)___constructor__F_R13s__anonymous013s__anonymous0_autogen___1((&___ret__13s__anonymous0_1), ___src__13s__anonymous0_1)); 35 return ((struct __anonymous0 )___ret__13s__anonymous0_1); 37 36 } 38 37 static inline void ___constructor__F_R13s__anonymous0i_autogen___1(struct __anonymous0 *___dst__R13s__anonymous0_1, signed int __i__i_1){ … … 47 46 static inline void ___destructor__F_R13s__anonymous1_autogen___1(struct __anonymous1 *___dst__R13s__anonymous1_1); 48 47 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);50 48 static inline void ___constructor__F_R13s__anonymous1_autogen___1(struct __anonymous1 *___dst__R13s__anonymous1_1){ 51 49 ((void)((*___dst__R13s__anonymous1_1).__i__i_1) /* ?{} */); … … 60 58 struct __anonymous1 ___ret__13s__anonymous1_1; 61 59 ((void)((*___dst__R13s__anonymous1_1).__i__i_1=___src__13s__anonymous1_1.__i__i_1)); 62 ((void)___constructor__F_R13s__anonymous113s__anonymous1_autogen___1((&___ret__13s__anonymous1_1), (*___dst__R13s__anonymous1_1)));63 return ___ret__13s__anonymous1_1;60 ((void)___constructor__F_R13s__anonymous113s__anonymous1_autogen___1((&___ret__13s__anonymous1_1), ___src__13s__anonymous1_1)); 61 return ((struct __anonymous1 )___ret__13s__anonymous1_1); 64 62 } 65 63 static inline void ___constructor__F_R13s__anonymous1i_autogen___1(struct __anonymous1 *___dst__R13s__anonymous1_1, signed int __i__i_1){ … … 74 72 static inline void ___destructor__F_R13s__anonymous2_autogen___1(struct __anonymous2 *___dst__R13s__anonymous2_1); 75 73 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);77 74 static inline void ___constructor__F_R13s__anonymous2_autogen___1(struct __anonymous2 *___dst__R13s__anonymous2_1){ 78 75 ((void)((*___dst__R13s__anonymous2_1).__i__i_1) /* ?{} */); … … 87 84 struct __anonymous2 ___ret__13s__anonymous2_1; 88 85 ((void)((*___dst__R13s__anonymous2_1).__i__i_1=___src__13s__anonymous2_1.__i__i_1)); 89 ((void)___constructor__F_R13s__anonymous213s__anonymous2_autogen___1((&___ret__13s__anonymous2_1), (*___dst__R13s__anonymous2_1)));90 return ___ret__13s__anonymous2_1;86 ((void)___constructor__F_R13s__anonymous213s__anonymous2_autogen___1((&___ret__13s__anonymous2_1), ___src__13s__anonymous2_1)); 87 return ((struct __anonymous2 )___ret__13s__anonymous2_1); 91 88 } 92 89 static inline void ___constructor__F_R13s__anonymous2i_autogen___1(struct __anonymous2 *___dst__R13s__anonymous2_1, signed int __i__i_1){ … … 101 98 static inline void ___destructor__F_R13s__anonymous3_autogen___1(struct __anonymous3 *___dst__R13s__anonymous3_1); 102 99 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);104 100 static inline void ___constructor__F_R13s__anonymous3_autogen___1(struct __anonymous3 *___dst__R13s__anonymous3_1){ 105 101 ((void)((*___dst__R13s__anonymous3_1).__i__i_1) /* ?{} */); … … 114 110 struct __anonymous3 ___ret__13s__anonymous3_1; 115 111 ((void)((*___dst__R13s__anonymous3_1).__i__i_1=___src__13s__anonymous3_1.__i__i_1)); 116 ((void)___constructor__F_R13s__anonymous313s__anonymous3_autogen___1((&___ret__13s__anonymous3_1), (*___dst__R13s__anonymous3_1)));117 return ___ret__13s__anonymous3_1;112 ((void)___constructor__F_R13s__anonymous313s__anonymous3_autogen___1((&___ret__13s__anonymous3_1), ___src__13s__anonymous3_1)); 113 return ((struct __anonymous3 )___ret__13s__anonymous3_1); 118 114 } 119 115 static inline void ___constructor__F_R13s__anonymous3i_autogen___1(struct __anonymous3 *___dst__R13s__anonymous3_1, signed int __i__i_1){ … … 128 124 static inline void ___destructor__F_R13s__anonymous4_autogen___1(struct __anonymous4 *___dst__R13s__anonymous4_1); 129 125 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);131 126 static inline void ___constructor__F_R13s__anonymous4_autogen___1(struct __anonymous4 *___dst__R13s__anonymous4_1){ 132 127 ((void)((*___dst__R13s__anonymous4_1).__i__i_1) /* ?{} */); … … 141 136 struct __anonymous4 ___ret__13s__anonymous4_1; 142 137 ((void)((*___dst__R13s__anonymous4_1).__i__i_1=___src__13s__anonymous4_1.__i__i_1)); 143 ((void)___constructor__F_R13s__anonymous413s__anonymous4_autogen___1((&___ret__13s__anonymous4_1), (*___dst__R13s__anonymous4_1)));144 return ___ret__13s__anonymous4_1;138 ((void)___constructor__F_R13s__anonymous413s__anonymous4_autogen___1((&___ret__13s__anonymous4_1), ___src__13s__anonymous4_1)); 139 return ((struct __anonymous4 )___ret__13s__anonymous4_1); 145 140 } 146 141 static inline void ___constructor__F_R13s__anonymous4i_autogen___1(struct __anonymous4 *___dst__R13s__anonymous4_1, signed int __i__i_1){ … … 155 150 static inline void ___destructor__F_R13s__anonymous5_autogen___1(struct __anonymous5 *___dst__R13s__anonymous5_1); 156 151 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);158 152 static inline void ___constructor__F_R13s__anonymous5_autogen___1(struct __anonymous5 *___dst__R13s__anonymous5_1){ 159 153 ((void)((*___dst__R13s__anonymous5_1).__i__i_1) /* ?{} */); … … 168 162 struct __anonymous5 ___ret__13s__anonymous5_1; 169 163 ((void)((*___dst__R13s__anonymous5_1).__i__i_1=___src__13s__anonymous5_1.__i__i_1)); 170 ((void)___constructor__F_R13s__anonymous513s__anonymous5_autogen___1((&___ret__13s__anonymous5_1), (*___dst__R13s__anonymous5_1)));171 return ___ret__13s__anonymous5_1;164 ((void)___constructor__F_R13s__anonymous513s__anonymous5_autogen___1((&___ret__13s__anonymous5_1), ___src__13s__anonymous5_1)); 165 return ((struct __anonymous5 )___ret__13s__anonymous5_1); 172 166 } 173 167 static inline void ___constructor__F_R13s__anonymous5i_autogen___1(struct __anonymous5 *___dst__R13s__anonymous5_1, signed int __i__i_1){ … … 182 176 static inline void ___destructor__F_R13s__anonymous6_autogen___1(struct __anonymous6 *___dst__R13s__anonymous6_1); 183 177 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);185 178 static inline void ___constructor__F_R13s__anonymous6_autogen___1(struct __anonymous6 *___dst__R13s__anonymous6_1){ 186 179 ((void)((*___dst__R13s__anonymous6_1).__i__i_1) /* ?{} */); … … 195 188 struct __anonymous6 ___ret__13s__anonymous6_1; 196 189 ((void)((*___dst__R13s__anonymous6_1).__i__i_1=___src__13s__anonymous6_1.__i__i_1)); 197 ((void)___constructor__F_R13s__anonymous613s__anonymous6_autogen___1((&___ret__13s__anonymous6_1), (*___dst__R13s__anonymous6_1)));198 return ___ret__13s__anonymous6_1;190 ((void)___constructor__F_R13s__anonymous613s__anonymous6_autogen___1((&___ret__13s__anonymous6_1), ___src__13s__anonymous6_1)); 191 return ((struct __anonymous6 )___ret__13s__anonymous6_1); 199 192 } 200 193 static inline void ___constructor__F_R13s__anonymous6i_autogen___1(struct __anonymous6 *___dst__R13s__anonymous6_1, signed int __i__i_1){ … … 209 202 static inline void ___destructor__F_R13s__anonymous7_autogen___1(struct __anonymous7 *___dst__R13s__anonymous7_1); 210 203 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);212 204 static inline void ___constructor__F_R13s__anonymous7_autogen___1(struct __anonymous7 *___dst__R13s__anonymous7_1){ 213 205 ((void)((*___dst__R13s__anonymous7_1).__i__i_1) /* ?{} */); … … 222 214 struct __anonymous7 ___ret__13s__anonymous7_1; 223 215 ((void)((*___dst__R13s__anonymous7_1).__i__i_1=___src__13s__anonymous7_1.__i__i_1)); 224 ((void)___constructor__F_R13s__anonymous713s__anonymous7_autogen___1((&___ret__13s__anonymous7_1), (*___dst__R13s__anonymous7_1)));225 return ___ret__13s__anonymous7_1;216 ((void)___constructor__F_R13s__anonymous713s__anonymous7_autogen___1((&___ret__13s__anonymous7_1), ___src__13s__anonymous7_1)); 217 return ((struct __anonymous7 )___ret__13s__anonymous7_1); 226 218 } 227 219 static inline void ___constructor__F_R13s__anonymous7i_autogen___1(struct __anonymous7 *___dst__R13s__anonymous7_1, signed int __i__i_1){ … … 244 236 static inline void ___destructor__F_R13s__anonymous8_autogen___1(struct __anonymous8 *___dst__R13s__anonymous8_1); 245 237 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);247 238 static inline void ___constructor__F_R13s__anonymous8_autogen___1(struct __anonymous8 *___dst__R13s__anonymous8_1){ 248 239 ((void)((*___dst__R13s__anonymous8_1).__i__s_1) /* ?{} */); … … 257 248 struct __anonymous8 ___ret__13s__anonymous8_1; 258 249 ((void)((*___dst__R13s__anonymous8_1).__i__s_1=___src__13s__anonymous8_1.__i__s_1)); 259 ((void)___constructor__F_R13s__anonymous813s__anonymous8_autogen___1((&___ret__13s__anonymous8_1), (*___dst__R13s__anonymous8_1)));260 return ___ret__13s__anonymous8_1;250 ((void)___constructor__F_R13s__anonymous813s__anonymous8_autogen___1((&___ret__13s__anonymous8_1), ___src__13s__anonymous8_1)); 251 return ((struct __anonymous8 )___ret__13s__anonymous8_1); 261 252 } 262 253 static inline void ___constructor__F_R13s__anonymous8s_autogen___1(struct __anonymous8 *___dst__R13s__anonymous8_1, signed short int __i__s_1){ … … 271 262 static inline void ___destructor__F_R13s__anonymous9_autogen___1(struct __anonymous9 *___dst__R13s__anonymous9_1); 272 263 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);274 264 static inline void ___constructor__F_R13s__anonymous9_autogen___1(struct __anonymous9 *___dst__R13s__anonymous9_1){ 275 265 ((void)((*___dst__R13s__anonymous9_1).__i__s_1) /* ?{} */); … … 284 274 struct __anonymous9 ___ret__13s__anonymous9_1; 285 275 ((void)((*___dst__R13s__anonymous9_1).__i__s_1=___src__13s__anonymous9_1.__i__s_1)); 286 ((void)___constructor__F_R13s__anonymous913s__anonymous9_autogen___1((&___ret__13s__anonymous9_1), (*___dst__R13s__anonymous9_1)));287 return ___ret__13s__anonymous9_1;276 ((void)___constructor__F_R13s__anonymous913s__anonymous9_autogen___1((&___ret__13s__anonymous9_1), ___src__13s__anonymous9_1)); 277 return ((struct __anonymous9 )___ret__13s__anonymous9_1); 288 278 } 289 279 static inline void ___constructor__F_R13s__anonymous9s_autogen___1(struct __anonymous9 *___dst__R13s__anonymous9_1, signed short int __i__s_1){ … … 298 288 static inline void ___destructor__F_R14s__anonymous10_autogen___1(struct __anonymous10 *___dst__R14s__anonymous10_1); 299 289 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);301 290 static inline void ___constructor__F_R14s__anonymous10_autogen___1(struct __anonymous10 *___dst__R14s__anonymous10_1){ 302 291 ((void)((*___dst__R14s__anonymous10_1).__i__s_1) /* ?{} */); … … 311 300 struct __anonymous10 ___ret__14s__anonymous10_1; 312 301 ((void)((*___dst__R14s__anonymous10_1).__i__s_1=___src__14s__anonymous10_1.__i__s_1)); 313 ((void)___constructor__F_R14s__anonymous1014s__anonymous10_autogen___1((&___ret__14s__anonymous10_1), (*___dst__R14s__anonymous10_1)));314 return ___ret__14s__anonymous10_1;302 ((void)___constructor__F_R14s__anonymous1014s__anonymous10_autogen___1((&___ret__14s__anonymous10_1), ___src__14s__anonymous10_1)); 303 return ((struct __anonymous10 )___ret__14s__anonymous10_1); 315 304 } 316 305 static inline void ___constructor__F_R14s__anonymous10s_autogen___1(struct __anonymous10 *___dst__R14s__anonymous10_1, signed short int __i__s_1){ … … 325 314 static inline void ___destructor__F_R14s__anonymous11_autogen___1(struct __anonymous11 *___dst__R14s__anonymous11_1); 326 315 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);328 316 static inline void ___constructor__F_R14s__anonymous11_autogen___1(struct __anonymous11 *___dst__R14s__anonymous11_1){ 329 317 ((void)((*___dst__R14s__anonymous11_1).__i__s_1) /* ?{} */); … … 338 326 struct __anonymous11 ___ret__14s__anonymous11_1; 339 327 ((void)((*___dst__R14s__anonymous11_1).__i__s_1=___src__14s__anonymous11_1.__i__s_1)); 340 ((void)___constructor__F_R14s__anonymous1114s__anonymous11_autogen___1((&___ret__14s__anonymous11_1), (*___dst__R14s__anonymous11_1)));341 return ___ret__14s__anonymous11_1;328 ((void)___constructor__F_R14s__anonymous1114s__anonymous11_autogen___1((&___ret__14s__anonymous11_1), ___src__14s__anonymous11_1)); 329 return ((struct __anonymous11 )___ret__14s__anonymous11_1); 342 330 } 343 331 static inline void ___constructor__F_R14s__anonymous11s_autogen___1(struct __anonymous11 *___dst__R14s__anonymous11_1, signed short int __i__s_1){ … … 352 340 static inline void ___destructor__F_R14s__anonymous12_autogen___1(struct __anonymous12 *___dst__R14s__anonymous12_1); 353 341 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);355 342 static inline void ___constructor__F_R14s__anonymous12_autogen___1(struct __anonymous12 *___dst__R14s__anonymous12_1){ 356 343 ((void)((*___dst__R14s__anonymous12_1).__i__s_1) /* ?{} */); … … 365 352 struct __anonymous12 ___ret__14s__anonymous12_1; 366 353 ((void)((*___dst__R14s__anonymous12_1).__i__s_1=___src__14s__anonymous12_1.__i__s_1)); 367 ((void)___constructor__F_R14s__anonymous1214s__anonymous12_autogen___1((&___ret__14s__anonymous12_1), (*___dst__R14s__anonymous12_1)));368 return ___ret__14s__anonymous12_1;354 ((void)___constructor__F_R14s__anonymous1214s__anonymous12_autogen___1((&___ret__14s__anonymous12_1), ___src__14s__anonymous12_1)); 355 return ((struct __anonymous12 )___ret__14s__anonymous12_1); 369 356 } 370 357 static inline void ___constructor__F_R14s__anonymous12s_autogen___1(struct __anonymous12 *___dst__R14s__anonymous12_1, signed short int __i__s_1){ … … 379 366 static inline void ___destructor__F_R14s__anonymous13_autogen___1(struct __anonymous13 *___dst__R14s__anonymous13_1); 380 367 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);382 368 static inline void ___constructor__F_R14s__anonymous13_autogen___1(struct __anonymous13 *___dst__R14s__anonymous13_1){ 383 369 ((void)((*___dst__R14s__anonymous13_1).__i__s_1) /* ?{} */); … … 392 378 struct __anonymous13 ___ret__14s__anonymous13_1; 393 379 ((void)((*___dst__R14s__anonymous13_1).__i__s_1=___src__14s__anonymous13_1.__i__s_1)); 394 ((void)___constructor__F_R14s__anonymous1314s__anonymous13_autogen___1((&___ret__14s__anonymous13_1), (*___dst__R14s__anonymous13_1)));395 return ___ret__14s__anonymous13_1;380 ((void)___constructor__F_R14s__anonymous1314s__anonymous13_autogen___1((&___ret__14s__anonymous13_1), ___src__14s__anonymous13_1)); 381 return ((struct __anonymous13 )___ret__14s__anonymous13_1); 396 382 } 397 383 static inline void ___constructor__F_R14s__anonymous13s_autogen___1(struct __anonymous13 *___dst__R14s__anonymous13_1, signed short int __i__s_1){ … … 406 392 static inline void ___destructor__F_R14s__anonymous14_autogen___1(struct __anonymous14 *___dst__R14s__anonymous14_1); 407 393 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);409 394 static inline void ___constructor__F_R14s__anonymous14_autogen___1(struct __anonymous14 *___dst__R14s__anonymous14_1){ 410 395 ((void)((*___dst__R14s__anonymous14_1).__i__s_1) /* ?{} */); … … 419 404 struct __anonymous14 ___ret__14s__anonymous14_1; 420 405 ((void)((*___dst__R14s__anonymous14_1).__i__s_1=___src__14s__anonymous14_1.__i__s_1)); 421 ((void)___constructor__F_R14s__anonymous1414s__anonymous14_autogen___1((&___ret__14s__anonymous14_1), (*___dst__R14s__anonymous14_1)));422 return ___ret__14s__anonymous14_1;406 ((void)___constructor__F_R14s__anonymous1414s__anonymous14_autogen___1((&___ret__14s__anonymous14_1), ___src__14s__anonymous14_1)); 407 return ((struct __anonymous14 )___ret__14s__anonymous14_1); 423 408 } 424 409 static inline void ___constructor__F_R14s__anonymous14s_autogen___1(struct __anonymous14 *___dst__R14s__anonymous14_1, signed short int __i__s_1){ … … 433 418 static inline void ___destructor__F_R14s__anonymous15_autogen___1(struct __anonymous15 *___dst__R14s__anonymous15_1); 434 419 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);436 420 static inline void ___constructor__F_R14s__anonymous15_autogen___1(struct __anonymous15 *___dst__R14s__anonymous15_1){ 437 421 ((void)((*___dst__R14s__anonymous15_1).__i__s_1) /* ?{} */); … … 446 430 struct __anonymous15 ___ret__14s__anonymous15_1; 447 431 ((void)((*___dst__R14s__anonymous15_1).__i__s_1=___src__14s__anonymous15_1.__i__s_1)); 448 ((void)___constructor__F_R14s__anonymous1514s__anonymous15_autogen___1((&___ret__14s__anonymous15_1), (*___dst__R14s__anonymous15_1)));449 return ___ret__14s__anonymous15_1;432 ((void)___constructor__F_R14s__anonymous1514s__anonymous15_autogen___1((&___ret__14s__anonymous15_1), ___src__14s__anonymous15_1)); 433 return ((struct __anonymous15 )___ret__14s__anonymous15_1); 450 434 } 451 435 static inline void ___constructor__F_R14s__anonymous15s_autogen___1(struct __anonymous15 *___dst__R14s__anonymous15_1, signed short int __i__s_1){ … … 476 460 static inline void ___destructor__F_R14s__anonymous16_autogen___1(struct __anonymous16 *___dst__R14s__anonymous16_1); 477 461 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);479 462 static inline void ___constructor__F_R14s__anonymous16_autogen___1(struct __anonymous16 *___dst__R14s__anonymous16_1){ 480 463 ((void)((*___dst__R14s__anonymous16_1).__i__i_1) /* ?{} */); … … 489 472 struct __anonymous16 ___ret__14s__anonymous16_1; 490 473 ((void)((*___dst__R14s__anonymous16_1).__i__i_1=___src__14s__anonymous16_1.__i__i_1)); 491 ((void)___constructor__F_R14s__anonymous1614s__anonymous16_autogen___1((&___ret__14s__anonymous16_1), (*___dst__R14s__anonymous16_1)));492 return ___ret__14s__anonymous16_1;474 ((void)___constructor__F_R14s__anonymous1614s__anonymous16_autogen___1((&___ret__14s__anonymous16_1), ___src__14s__anonymous16_1)); 475 return ((struct __anonymous16 )___ret__14s__anonymous16_1); 493 476 } 494 477 static inline void ___constructor__F_R14s__anonymous16i_autogen___1(struct __anonymous16 *___dst__R14s__anonymous16_1, signed int __i__i_1){ … … 503 486 static inline void ___destructor__F_R14s__anonymous17_autogen___1(struct __anonymous17 *___dst__R14s__anonymous17_1); 504 487 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);506 488 static inline void ___constructor__F_R14s__anonymous17_autogen___1(struct __anonymous17 *___dst__R14s__anonymous17_1){ 507 489 ((void)((*___dst__R14s__anonymous17_1).__i__i_1) /* ?{} */); … … 516 498 struct __anonymous17 ___ret__14s__anonymous17_1; 517 499 ((void)((*___dst__R14s__anonymous17_1).__i__i_1=___src__14s__anonymous17_1.__i__i_1)); 518 ((void)___constructor__F_R14s__anonymous1714s__anonymous17_autogen___1((&___ret__14s__anonymous17_1), (*___dst__R14s__anonymous17_1)));519 return ___ret__14s__anonymous17_1;500 ((void)___constructor__F_R14s__anonymous1714s__anonymous17_autogen___1((&___ret__14s__anonymous17_1), ___src__14s__anonymous17_1)); 501 return ((struct __anonymous17 )___ret__14s__anonymous17_1); 520 502 } 521 503 static inline void ___constructor__F_R14s__anonymous17i_autogen___1(struct __anonymous17 *___dst__R14s__anonymous17_1, signed int __i__i_1){ … … 530 512 static inline void ___destructor__F_R14s__anonymous18_autogen___1(struct __anonymous18 *___dst__R14s__anonymous18_1); 531 513 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);533 514 static inline void ___constructor__F_R14s__anonymous18_autogen___1(struct __anonymous18 *___dst__R14s__anonymous18_1){ 534 515 ((void)((*___dst__R14s__anonymous18_1).__i__i_1) /* ?{} */); … … 543 524 struct __anonymous18 ___ret__14s__anonymous18_1; 544 525 ((void)((*___dst__R14s__anonymous18_1).__i__i_1=___src__14s__anonymous18_1.__i__i_1)); 545 ((void)___constructor__F_R14s__anonymous1814s__anonymous18_autogen___1((&___ret__14s__anonymous18_1), (*___dst__R14s__anonymous18_1)));546 return ___ret__14s__anonymous18_1;526 ((void)___constructor__F_R14s__anonymous1814s__anonymous18_autogen___1((&___ret__14s__anonymous18_1), ___src__14s__anonymous18_1)); 527 return ((struct __anonymous18 )___ret__14s__anonymous18_1); 547 528 } 548 529 static inline void ___constructor__F_R14s__anonymous18i_autogen___1(struct __anonymous18 *___dst__R14s__anonymous18_1, signed int __i__i_1){ … … 557 538 static inline void ___destructor__F_R14s__anonymous19_autogen___1(struct __anonymous19 *___dst__R14s__anonymous19_1); 558 539 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);560 540 static inline void ___constructor__F_R14s__anonymous19_autogen___1(struct __anonymous19 *___dst__R14s__anonymous19_1){ 561 541 ((void)((*___dst__R14s__anonymous19_1).__i__i_1) /* ?{} */); … … 570 550 struct __anonymous19 ___ret__14s__anonymous19_1; 571 551 ((void)((*___dst__R14s__anonymous19_1).__i__i_1=___src__14s__anonymous19_1.__i__i_1)); 572 ((void)___constructor__F_R14s__anonymous1914s__anonymous19_autogen___1((&___ret__14s__anonymous19_1), (*___dst__R14s__anonymous19_1)));573 return ___ret__14s__anonymous19_1;552 ((void)___constructor__F_R14s__anonymous1914s__anonymous19_autogen___1((&___ret__14s__anonymous19_1), ___src__14s__anonymous19_1)); 553 return ((struct __anonymous19 )___ret__14s__anonymous19_1); 574 554 } 575 555 static inline void ___constructor__F_R14s__anonymous19i_autogen___1(struct __anonymous19 *___dst__R14s__anonymous19_1, signed int __i__i_1){ … … 584 564 static inline void ___destructor__F_R14s__anonymous20_autogen___1(struct __anonymous20 *___dst__R14s__anonymous20_1); 585 565 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);587 566 static inline void ___constructor__F_R14s__anonymous20_autogen___1(struct __anonymous20 *___dst__R14s__anonymous20_1){ 588 567 ((void)((*___dst__R14s__anonymous20_1).__i__i_1) /* ?{} */); … … 597 576 struct __anonymous20 ___ret__14s__anonymous20_1; 598 577 ((void)((*___dst__R14s__anonymous20_1).__i__i_1=___src__14s__anonymous20_1.__i__i_1)); 599 ((void)___constructor__F_R14s__anonymous2014s__anonymous20_autogen___1((&___ret__14s__anonymous20_1), (*___dst__R14s__anonymous20_1)));600 return ___ret__14s__anonymous20_1;578 ((void)___constructor__F_R14s__anonymous2014s__anonymous20_autogen___1((&___ret__14s__anonymous20_1), ___src__14s__anonymous20_1)); 579 return ((struct __anonymous20 )___ret__14s__anonymous20_1); 601 580 } 602 581 static inline void ___constructor__F_R14s__anonymous20i_autogen___1(struct __anonymous20 *___dst__R14s__anonymous20_1, signed int __i__i_1){ … … 611 590 static inline void ___destructor__F_R14s__anonymous21_autogen___1(struct __anonymous21 *___dst__R14s__anonymous21_1); 612 591 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);614 592 static inline void ___constructor__F_R14s__anonymous21_autogen___1(struct __anonymous21 *___dst__R14s__anonymous21_1){ 615 593 ((void)((*___dst__R14s__anonymous21_1).__i__i_1) /* ?{} */); … … 624 602 struct __anonymous21 ___ret__14s__anonymous21_1; 625 603 ((void)((*___dst__R14s__anonymous21_1).__i__i_1=___src__14s__anonymous21_1.__i__i_1)); 626 ((void)___constructor__F_R14s__anonymous2114s__anonymous21_autogen___1((&___ret__14s__anonymous21_1), (*___dst__R14s__anonymous21_1)));627 return ___ret__14s__anonymous21_1;604 ((void)___constructor__F_R14s__anonymous2114s__anonymous21_autogen___1((&___ret__14s__anonymous21_1), ___src__14s__anonymous21_1)); 605 return ((struct __anonymous21 )___ret__14s__anonymous21_1); 628 606 } 629 607 static inline void ___constructor__F_R14s__anonymous21i_autogen___1(struct __anonymous21 *___dst__R14s__anonymous21_1, signed int __i__i_1){ … … 638 616 static inline void ___destructor__F_R14s__anonymous22_autogen___1(struct __anonymous22 *___dst__R14s__anonymous22_1); 639 617 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);641 618 static inline void ___constructor__F_R14s__anonymous22_autogen___1(struct __anonymous22 *___dst__R14s__anonymous22_1){ 642 619 ((void)((*___dst__R14s__anonymous22_1).__i__i_1) /* ?{} */); … … 651 628 struct __anonymous22 ___ret__14s__anonymous22_1; 652 629 ((void)((*___dst__R14s__anonymous22_1).__i__i_1=___src__14s__anonymous22_1.__i__i_1)); 653 ((void)___constructor__F_R14s__anonymous2214s__anonymous22_autogen___1((&___ret__14s__anonymous22_1), (*___dst__R14s__anonymous22_1)));654 return ___ret__14s__anonymous22_1;630 ((void)___constructor__F_R14s__anonymous2214s__anonymous22_autogen___1((&___ret__14s__anonymous22_1), ___src__14s__anonymous22_1)); 631 return ((struct __anonymous22 )___ret__14s__anonymous22_1); 655 632 } 656 633 static inline void ___constructor__F_R14s__anonymous22i_autogen___1(struct __anonymous22 *___dst__R14s__anonymous22_1, signed int __i__i_1){ … … 665 642 static inline void ___destructor__F_R14s__anonymous23_autogen___1(struct __anonymous23 *___dst__R14s__anonymous23_1); 666 643 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);668 644 static inline void ___constructor__F_R14s__anonymous23_autogen___1(struct __anonymous23 *___dst__R14s__anonymous23_1){ 669 645 ((void)((*___dst__R14s__anonymous23_1).__i__i_1) /* ?{} */); … … 678 654 struct __anonymous23 ___ret__14s__anonymous23_1; 679 655 ((void)((*___dst__R14s__anonymous23_1).__i__i_1=___src__14s__anonymous23_1.__i__i_1)); 680 ((void)___constructor__F_R14s__anonymous2314s__anonymous23_autogen___1((&___ret__14s__anonymous23_1), (*___dst__R14s__anonymous23_1)));681 return ___ret__14s__anonymous23_1;656 ((void)___constructor__F_R14s__anonymous2314s__anonymous23_autogen___1((&___ret__14s__anonymous23_1), ___src__14s__anonymous23_1)); 657 return ((struct __anonymous23 )___ret__14s__anonymous23_1); 682 658 } 683 659 static inline void ___constructor__F_R14s__anonymous23i_autogen___1(struct __anonymous23 *___dst__R14s__anonymous23_1, signed int __i__i_1){ … … 696 672 __attribute__ ((unused)) signed int ___retval_main__i_1; 697 673 ((void)(___retval_main__i_1=((signed int )0)) /* ?{} */); 698 return ___retval_main__i_1;674 return ((signed int )___retval_main__i_1); 699 675 ((void)(___retval_main__i_1=0) /* ?{} */); 700 return ___retval_main__i_1;676 return ((signed int )___retval_main__i_1); 701 677 } 702 678 static inline int invoke_main(int argc, char* argv[], char* envp[]) { (void)argc; (void)argv; (void)envp; return __main__Fi_iPPCc__1(argc, argv); } … … 713 689 ((void)(___retval_main__i_1=(((void)(_tmp_cp_ret0=invoke_main(__argc__i_1, __argv__PPc_1, __envp__PPc_1))) , _tmp_cp_ret0)) /* ?{} */); 714 690 ((void)(_tmp_cp_ret0) /* ^?{} */); 715 return ___retval_main__i_1;716 } 691 return ((signed int )___retval_main__i_1); 692 } -
src/tests/.expect/64/extension.txt
r3f7e12cb r78315272 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);22 19 static inline void ___constructor__F_R2sS_autogen___1(struct S *___dst__R2sS_1){ 23 20 ((void)((*___dst__R2sS_1).__a__i_1) /* ?{} */); … … 40 37 ((void)((*___dst__R2sS_1).__b__i_1=___src__2sS_1.__b__i_1)); 41 38 ((void)((*___dst__R2sS_1).__c__i_1=___src__2sS_1.__c__i_1)); 42 ((void)___constructor__F_R2sS2sS_autogen___1((&___ret__2sS_1), (*___dst__R2sS_1)));43 return ___ret__2sS_1;39 ((void)___constructor__F_R2sS2sS_autogen___1((&___ret__2sS_1), ___src__2sS_1)); 40 return ((struct S )___ret__2sS_1); 44 41 } 45 42 static inline void ___constructor__F_R2sSi_autogen___1(struct S *___dst__R2sS_1, signed int __a__i_1){ … … 63 60 __extension__ signed int __c__i_1; 64 61 }; 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);70 62 static inline void ___constructor__F_R2uU_autogen___1(__attribute__ ((unused)) union U *___dst__R2uU_1){ 71 63 } … … 78 70 union U ___ret__2uU_1; 79 71 ((void)__builtin_memcpy(((void *)___dst__R2uU_1), ((const void *)(&___src__2uU_1)), sizeof(union U ))); 80 ((void)___constructor__F_R2uU2uU_autogen___1((&___ret__2uU_1), (*___dst__R2uU_1)));81 return ___ret__2uU_1;72 ((void)___constructor__F_R2uU2uU_autogen___1((&___ret__2uU_1), ___src__2uU_1)); 73 return ((union U )___ret__2uU_1); 82 74 } 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 )));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 ))); 85 77 } 86 78 __extension__ enum E { … … 102 94 __extension__ signed int *__z__Pi_2; 103 95 }; 104 inline void ___constructor__F_R2sS_autogen___2(struct S *___dst__R2sS_2){ 105 ((void)((*___dst__R2sS_2).__a__i_2) /* ?{} */); 106 ((void)((*___dst__R2sS_2).__b__i_2) /* ?{} */); 107 ((void)((*___dst__R2sS_2).__c__i_2) /* ?{} */); 108 ((void)((*___dst__R2sS_2).__x__Pi_2) /* ?{} */); 109 ((void)((*___dst__R2sS_2).__y__Pi_2) /* ?{} */); 110 ((void)((*___dst__R2sS_2).__z__Pi_2) /* ?{} */); 111 } 112 inline void ___constructor__F_R2sS2sS_autogen___2(struct S *___dst__R2sS_2, struct S ___src__2sS_2){ 113 ((void)((*___dst__R2sS_2).__a__i_2=___src__2sS_2.__a__i_2) /* ?{} */); 114 ((void)((*___dst__R2sS_2).__b__i_2=___src__2sS_2.__b__i_2) /* ?{} */); 115 ((void)((*___dst__R2sS_2).__c__i_2=___src__2sS_2.__c__i_2) /* ?{} */); 116 ((void)((*___dst__R2sS_2).__x__Pi_2=___src__2sS_2.__x__Pi_2) /* ?{} */); 117 ((void)((*___dst__R2sS_2).__y__Pi_2=___src__2sS_2.__y__Pi_2) /* ?{} */); 118 ((void)((*___dst__R2sS_2).__z__Pi_2=___src__2sS_2.__z__Pi_2) /* ?{} */); 119 } 120 inline void ___destructor__F_R2sS_autogen___2(struct S *___dst__R2sS_2){ 121 ((void)((*___dst__R2sS_2).__z__Pi_2) /* ^?{} */); 122 ((void)((*___dst__R2sS_2).__y__Pi_2) /* ^?{} */); 123 ((void)((*___dst__R2sS_2).__x__Pi_2) /* ^?{} */); 124 ((void)((*___dst__R2sS_2).__c__i_2) /* ^?{} */); 125 ((void)((*___dst__R2sS_2).__b__i_2) /* ^?{} */); 126 ((void)((*___dst__R2sS_2).__a__i_2) /* ^?{} */); 127 } 128 inline struct S ___operator_assign__F2sS_R2sS2sS_autogen___2(struct S *___dst__R2sS_2, struct S ___src__2sS_2){ 129 struct S ___ret__2sS_2; 130 ((void)((*___dst__R2sS_2).__a__i_2=___src__2sS_2.__a__i_2)); 131 ((void)((*___dst__R2sS_2).__b__i_2=___src__2sS_2.__b__i_2)); 132 ((void)((*___dst__R2sS_2).__c__i_2=___src__2sS_2.__c__i_2)); 133 ((void)((*___dst__R2sS_2).__x__Pi_2=___src__2sS_2.__x__Pi_2)); 134 ((void)((*___dst__R2sS_2).__y__Pi_2=___src__2sS_2.__y__Pi_2)); 135 ((void)((*___dst__R2sS_2).__z__Pi_2=___src__2sS_2.__z__Pi_2)); 136 ((void)___constructor__F_R2sS2sS_autogen___2((&___ret__2sS_2), (*___dst__R2sS_2))); 137 return ___ret__2sS_2; 138 } 139 inline void ___constructor__F_R2sSi_autogen___2(struct S *___dst__R2sS_2, signed int __a__i_2){ 140 ((void)((*___dst__R2sS_2).__a__i_2=__a__i_2) /* ?{} */); 141 ((void)((*___dst__R2sS_2).__b__i_2) /* ?{} */); 142 ((void)((*___dst__R2sS_2).__c__i_2) /* ?{} */); 143 ((void)((*___dst__R2sS_2).__x__Pi_2) /* ?{} */); 144 ((void)((*___dst__R2sS_2).__y__Pi_2) /* ?{} */); 145 ((void)((*___dst__R2sS_2).__z__Pi_2) /* ?{} */); 146 } 147 inline void ___constructor__F_R2sSii_autogen___2(struct S *___dst__R2sS_2, signed int __a__i_2, signed int __b__i_2){ 148 ((void)((*___dst__R2sS_2).__a__i_2=__a__i_2) /* ?{} */); 149 ((void)((*___dst__R2sS_2).__b__i_2=__b__i_2) /* ?{} */); 150 ((void)((*___dst__R2sS_2).__c__i_2) /* ?{} */); 151 ((void)((*___dst__R2sS_2).__x__Pi_2) /* ?{} */); 152 ((void)((*___dst__R2sS_2).__y__Pi_2) /* ?{} */); 153 ((void)((*___dst__R2sS_2).__z__Pi_2) /* ?{} */); 154 } 155 inline void ___constructor__F_R2sSiii_autogen___2(struct S *___dst__R2sS_2, signed int __a__i_2, signed int __b__i_2, signed int __c__i_2){ 156 ((void)((*___dst__R2sS_2).__a__i_2=__a__i_2) /* ?{} */); 157 ((void)((*___dst__R2sS_2).__b__i_2=__b__i_2) /* ?{} */); 158 ((void)((*___dst__R2sS_2).__c__i_2=__c__i_2) /* ?{} */); 159 ((void)((*___dst__R2sS_2).__x__Pi_2) /* ?{} */); 160 ((void)((*___dst__R2sS_2).__y__Pi_2) /* ?{} */); 161 ((void)((*___dst__R2sS_2).__z__Pi_2) /* ?{} */); 162 } 163 inline void ___constructor__F_R2sSiiiPi_autogen___2(struct S *___dst__R2sS_2, signed int __a__i_2, signed int __b__i_2, signed int __c__i_2, signed int *__x__Pi_2){ 164 ((void)((*___dst__R2sS_2).__a__i_2=__a__i_2) /* ?{} */); 165 ((void)((*___dst__R2sS_2).__b__i_2=__b__i_2) /* ?{} */); 166 ((void)((*___dst__R2sS_2).__c__i_2=__c__i_2) /* ?{} */); 167 ((void)((*___dst__R2sS_2).__x__Pi_2=__x__Pi_2) /* ?{} */); 168 ((void)((*___dst__R2sS_2).__y__Pi_2) /* ?{} */); 169 ((void)((*___dst__R2sS_2).__z__Pi_2) /* ?{} */); 170 } 171 inline void ___constructor__F_R2sSiiiPiPi_autogen___2(struct S *___dst__R2sS_2, signed int __a__i_2, signed int __b__i_2, signed int __c__i_2, signed int *__x__Pi_2, signed int *__y__Pi_2){ 172 ((void)((*___dst__R2sS_2).__a__i_2=__a__i_2) /* ?{} */); 173 ((void)((*___dst__R2sS_2).__b__i_2=__b__i_2) /* ?{} */); 174 ((void)((*___dst__R2sS_2).__c__i_2=__c__i_2) /* ?{} */); 175 ((void)((*___dst__R2sS_2).__x__Pi_2=__x__Pi_2) /* ?{} */); 176 ((void)((*___dst__R2sS_2).__y__Pi_2=__y__Pi_2) /* ?{} */); 177 ((void)((*___dst__R2sS_2).__z__Pi_2) /* ?{} */); 178 } 179 inline void ___constructor__F_R2sSiiiPiPiPi_autogen___2(struct S *___dst__R2sS_2, signed int __a__i_2, signed int __b__i_2, signed int __c__i_2, signed int *__x__Pi_2, signed int *__y__Pi_2, signed int *__z__Pi_2){ 180 ((void)((*___dst__R2sS_2).__a__i_2=__a__i_2) /* ?{} */); 181 ((void)((*___dst__R2sS_2).__b__i_2=__b__i_2) /* ?{} */); 182 ((void)((*___dst__R2sS_2).__c__i_2=__c__i_2) /* ?{} */); 183 ((void)((*___dst__R2sS_2).__x__Pi_2=__x__Pi_2) /* ?{} */); 184 ((void)((*___dst__R2sS_2).__y__Pi_2=__y__Pi_2) /* ?{} */); 185 ((void)((*___dst__R2sS_2).__z__Pi_2=__z__Pi_2) /* ?{} */); 186 } 187 signed int __i__i_2 = (__extension__ __a__i_1+__extension__ 3); 96 signed int __i__i_2 = ((signed int )(__extension__ __a__i_1+__extension__ 3)); 188 97 ((void)__extension__ 3); 189 98 ((void)__extension__ __a__i_1); -
src/tests/.expect/64/gccExtensions.txt
r3f7e12cb r78315272 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), (*___dst__R2sS_2)));66 return ___ret__2sS_2;65 ((void)___constructor__F_R2sS2sS_autogen___2((&___ret__2sS_2), ___src__2sS_2)); 66 return ((struct S )___ret__2sS_2); 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 = __extension__ 3;83 signed int __i__i_2 = ((signed int )__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), (*___dst__R3ss2_2)));116 return ___ret__3ss2_2;115 ((void)___constructor__F_R3ss23ss2_autogen___2((&___ret__3ss2_2), ___src__3ss2_2)); 116 return ((struct s2 )___ret__3ss2_2); 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), (*___dst__R3ss3_2)));137 return ___ret__3ss3_2;136 ((void)___constructor__F_R3ss33ss3_autogen___2((&___ret__3ss3_2), ___src__3ss3_2)); 137 return ((struct s3 )___ret__3ss3_2); 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), (*___dst__R3ss4_2)));160 return ___ret__3ss4_2;159 ((void)___constructor__F_R3ss43ss4_autogen___2((&___ret__3ss4_2), ___src__3ss4_2)); 160 return ((struct s4 )___ret__3ss4_2); 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 ___retval_main__i_1;171 return ((signed int )___retval_main__i_1); 172 172 ((void)(___retval_main__i_1=0) /* ?{} */); 173 return ___retval_main__i_1;173 return ((signed int )___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 ___retval_main__i_1;188 return ((signed int )___retval_main__i_1); 189 189 } -
src/tests/.expect/64/literals.txt
r3f7e12cb r78315272 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 0_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__A 0_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));7 void __for_each__A2_0_0_0____operator_assign__PFt0_Rt0t0____constructor__PF_Rt0____constructor__PF_Rt0t0____destructor__PF_Rt0____operator_assign__PFt1_Rt1t1____constructor__PF_Rt1____constructor__PF_Rt1t1____destructor__PF_Rt1____operator_preincr__PFt0_Rt0____operator_predecr__PFt0_Rt0____operator_equal__PFi_t0t0____operator_notequal__PFi_t0t0____operator_deref__PFRt1_t0__F_t0t0PF_t1___1(__attribute__ ((unused)) void (*_adapterF_9telt_type__P)(void (*__anonymous_object0)(), void *__anonymous_object1), __attribute__ ((unused)) void *(*_adapterFP9telt_type_14titerator_type_M_P)(void (*__anonymous_object2)(), void *__anonymous_object3), __attribute__ ((unused)) signed int (*_adapterFi_14titerator_type14titerator_type_M_PP)(void (*__anonymous_object4)(), void *__anonymous_object5, void *__anonymous_object6), __attribute__ ((unused)) void (*_adapterF14titerator_type_P14titerator_type_P_M)(void (*__anonymous_object7)(), __attribute__ ((unused)) void *___retval__operator_preincr__14titerator_type_1, void *__anonymous_object8), __attribute__ ((unused)) void (*_adapterF_P9telt_type9telt_type__MP)(void (*__anonymous_object9)(), void *__anonymous_object10, void *__anonymous_object11), __attribute__ ((unused)) void (*_adapterF9telt_type_P9telt_type9telt_type_P_MP)(void (*__anonymous_object12)(), __attribute__ ((unused)) void *___retval__operator_assign__9telt_type_1, void *__anonymous_object13, void *__anonymous_object14), __attribute__ ((unused)) void (*_adapterF_P14titerator_type14titerator_type__MP)(void (*__anonymous_object15)(), void *__anonymous_object16, void *__anonymous_object17), __attribute__ ((unused)) void (*_adapterF14titerator_type_P14titerator_type14titerator_type_P_MP)(void (*__anonymous_object18)(), __attribute__ ((unused)) void *___retval__operator_assign__14titerator_type_1, void *__anonymous_object19, void *__anonymous_object20), __attribute__ ((unused)) unsigned long int _sizeof_14titerator_type, __attribute__ ((unused)) unsigned long int _alignof_14titerator_type, __attribute__ ((unused)) unsigned long int _sizeof_9telt_type, __attribute__ ((unused)) unsigned long int _alignof_9telt_type, __attribute__ ((unused)) void *(*___operator_assign__PF14titerator_type_R14titerator_type14titerator_type__1)(void *__anonymous_object21, void *__anonymous_object22), __attribute__ ((unused)) void (*___constructor__PF_R14titerator_type__1)(void *__anonymous_object23), __attribute__ ((unused)) void (*___constructor__PF_R14titerator_type14titerator_type__1)(void *__anonymous_object24, void *__anonymous_object25), __attribute__ ((unused)) void (*___destructor__PF_R14titerator_type__1)(void *__anonymous_object26), __attribute__ ((unused)) void *(*___operator_assign__PF9telt_type_R9telt_type9telt_type__1)(void *__anonymous_object27, void *__anonymous_object28), __attribute__ ((unused)) void (*___constructor__PF_R9telt_type__1)(void *__anonymous_object29), __attribute__ ((unused)) void (*___constructor__PF_R9telt_type9telt_type__1)(void *__anonymous_object30, void *__anonymous_object31), __attribute__ ((unused)) void (*___destructor__PF_R9telt_type__1)(void *__anonymous_object32), __attribute__ ((unused)) void *(*___operator_preincr__PF14titerator_type_R14titerator_type__1)(void *__anonymous_object33), __attribute__ ((unused)) void *(*___operator_predecr__PF14titerator_type_R14titerator_type__1)(void *__anonymous_object34), __attribute__ ((unused)) signed int (*___operator_equal__PFi_14titerator_type14titerator_type__1)(void *__anonymous_object35, void *__anonymous_object36), __attribute__ ((unused)) signed int (*___operator_notequal__PFi_14titerator_type14titerator_type__1)(void *__anonymous_object37, void *__anonymous_object38), __attribute__ ((unused)) void *(*___operator_deref__PFR9telt_type_14titerator_type__1)(void *__anonymous_object39), void *__begin__14titerator_type_1, void *__end__14titerator_type_1, void (*__func__PF_9telt_type__1)(void *__anonymous_object40)); 8 void __for_each_reverse__A2_0_0_0____operator_assign__PFt0_Rt0t0____constructor__PF_Rt0____constructor__PF_Rt0t0____destructor__PF_Rt0____operator_assign__PFt1_Rt1t1____constructor__PF_Rt1____constructor__PF_Rt1t1____destructor__PF_Rt1____operator_preincr__PFt0_Rt0____operator_predecr__PFt0_Rt0____operator_equal__PFi_t0t0____operator_notequal__PFi_t0t0____operator_deref__PFRt1_t0__F_t0t0PF_t1___1(__attribute__ ((unused)) void (*_adapterF_9telt_type__P)(void (*__anonymous_object41)(), void *__anonymous_object42), __attribute__ ((unused)) void *(*_adapterFP9telt_type_14titerator_type_M_P)(void (*__anonymous_object43)(), void *__anonymous_object44), __attribute__ ((unused)) signed int (*_adapterFi_14titerator_type14titerator_type_M_PP)(void (*__anonymous_object45)(), void *__anonymous_object46, void *__anonymous_object47), __attribute__ ((unused)) void (*_adapterF14titerator_type_P14titerator_type_P_M)(void (*__anonymous_object48)(), __attribute__ ((unused)) void *___retval__operator_preincr__14titerator_type_1, void *__anonymous_object49), __attribute__ ((unused)) void (*_adapterF_P9telt_type9telt_type__MP)(void (*__anonymous_object50)(), void *__anonymous_object51, void *__anonymous_object52), __attribute__ ((unused)) void (*_adapterF9telt_type_P9telt_type9telt_type_P_MP)(void (*__anonymous_object53)(), __attribute__ ((unused)) void *___retval__operator_assign__9telt_type_1, void *__anonymous_object54, void *__anonymous_object55), __attribute__ ((unused)) void (*_adapterF_P14titerator_type14titerator_type__MP)(void (*__anonymous_object56)(), void *__anonymous_object57, void *__anonymous_object58), __attribute__ ((unused)) void (*_adapterF14titerator_type_P14titerator_type14titerator_type_P_MP)(void (*__anonymous_object59)(), __attribute__ ((unused)) void *___retval__operator_assign__14titerator_type_1, void *__anonymous_object60, void *__anonymous_object61), __attribute__ ((unused)) unsigned long int _sizeof_14titerator_type, __attribute__ ((unused)) unsigned long int _alignof_14titerator_type, __attribute__ ((unused)) unsigned long int _sizeof_9telt_type, __attribute__ ((unused)) unsigned long int _alignof_9telt_type, __attribute__ ((unused)) void *(*___operator_assign__PF14titerator_type_R14titerator_type14titerator_type__1)(void *__anonymous_object62, void *__anonymous_object63), __attribute__ ((unused)) void (*___constructor__PF_R14titerator_type__1)(void *__anonymous_object64), __attribute__ ((unused)) void (*___constructor__PF_R14titerator_type14titerator_type__1)(void *__anonymous_object65, void *__anonymous_object66), __attribute__ ((unused)) void (*___destructor__PF_R14titerator_type__1)(void *__anonymous_object67), __attribute__ ((unused)) void *(*___operator_assign__PF9telt_type_R9telt_type9telt_type__1)(void *__anonymous_object68, void *__anonymous_object69), __attribute__ ((unused)) void (*___constructor__PF_R9telt_type__1)(void *__anonymous_object70), __attribute__ ((unused)) void (*___constructor__PF_R9telt_type9telt_type__1)(void *__anonymous_object71, void *__anonymous_object72), __attribute__ ((unused)) void (*___destructor__PF_R9telt_type__1)(void *__anonymous_object73), __attribute__ ((unused)) void *(*___operator_preincr__PF14titerator_type_R14titerator_type__1)(void *__anonymous_object74), __attribute__ ((unused)) void *(*___operator_predecr__PF14titerator_type_R14titerator_type__1)(void *__anonymous_object75), __attribute__ ((unused)) signed int (*___operator_equal__PFi_14titerator_type14titerator_type__1)(void *__anonymous_object76, void *__anonymous_object77), __attribute__ ((unused)) signed int (*___operator_notequal__PFi_14titerator_type14titerator_type__1)(void *__anonymous_object78, void *__anonymous_object79), __attribute__ ((unused)) void *(*___operator_deref__PFR9telt_type_14titerator_type__1)(void *__anonymous_object80), void *__begin__14titerator_type_1, void *__end__14titerator_type_1, void (*__func__PF_9telt_type__1)(void *__anonymous_object81)); 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 0_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);31 void *___operator_bitor__A1_1_0_1____operator_assign__PFt1_Rt1t1____constructor__PF_Rt1____constructor__PF_Rt1t1____destructor__PF_Rt1____operator_bitor__PFPd0_Pd0t1___sepPrt__PFb_Pd0___sepReset__PF_Pd0___sepReset__PF_Pd0b___sepGetCur__PFPCc_Pd0___sepSetCur__PF_Pd0PCc___getNL__PFb_Pd0___setNL__PF_Pd0b___sepOn__PF_Pd0___sepOff__PF_Pd0___sepDisable__PFb_Pd0___sepEnable__PFb_Pd0___sepGet__PFPCc_Pd0___sepSet__PF_Pd0PCc___sepGetTuple__PFPCc_Pd0___sepSetTuple__PF_Pd0PCc___fail__PFi_Pd0___flush__PFi_Pd0___open__PF_Pd0PCcPCc___close__PF_Pd0___write__PFPd0_Pd0PCcUl___fmt__PFi_Pd0PCc____operator_bitor__PFPd0_Pd0tVARGS2__FPd0_Pd0t1tVARGS2__1(__attribute__ ((unused)) void *(*_adapterFP7tostype_P7tostype7tParams_M_MP)(void (*__anonymous_object698)(), void *__anonymous_object699, void *__anonymous_object700), __attribute__ ((unused)) void *(*_adapterFP7tostype_P7tostype2tT_M_MP)(void (*__anonymous_object701)(), void *__anonymous_object702, void *__anonymous_object703), __attribute__ ((unused)) void (*_adapterF_P2tT2tT__MP)(void (*__anonymous_object704)(), void *__anonymous_object705, void *__anonymous_object706), __attribute__ ((unused)) void (*_adapterF2tT_P2tT2tT_P_MP)(void (*__anonymous_object707)(), __attribute__ ((unused)) void *___retval__operator_assign__2tT_1, void *__anonymous_object708, void *__anonymous_object709), __attribute__ ((unused)) unsigned long int _sizeof_2tT, __attribute__ ((unused)) unsigned long int _alignof_2tT, __attribute__ ((unused)) unsigned long int _sizeof_7tParams, __attribute__ ((unused)) unsigned long int _alignof_7tParams, __attribute__ ((unused)) void *(*___operator_assign__PF2tT_R2tT2tT__1)(void *__anonymous_object710, void *__anonymous_object711), __attribute__ ((unused)) void (*___constructor__PF_R2tT__1)(void *__anonymous_object712), __attribute__ ((unused)) void (*___constructor__PF_R2tT2tT__1)(void *__anonymous_object713, void *__anonymous_object714), __attribute__ ((unused)) void (*___destructor__PF_R2tT__1)(void *__anonymous_object715), __attribute__ ((unused)) void *(*___operator_bitor__PFP7tostype_P7tostype2tT__1)(void *__anonymous_object716, void *__anonymous_object717), __attribute__ ((unused)) _Bool (*__sepPrt__PFb_P7tostype__1)(void *__anonymous_object718), __attribute__ ((unused)) void (*__sepReset__PF_P7tostype__1)(void *__anonymous_object719), __attribute__ ((unused)) void (*__sepReset__PF_P7tostypeb__1)(void *__anonymous_object720, _Bool __anonymous_object721), __attribute__ ((unused)) const char *(*__sepGetCur__PFPCc_P7tostype__1)(void *__anonymous_object722), __attribute__ ((unused)) void (*__sepSetCur__PF_P7tostypePCc__1)(void *__anonymous_object723, const char *__anonymous_object724), __attribute__ ((unused)) _Bool (*__getNL__PFb_P7tostype__1)(void *__anonymous_object725), __attribute__ ((unused)) void (*__setNL__PF_P7tostypeb__1)(void *__anonymous_object726, _Bool __anonymous_object727), __attribute__ ((unused)) void (*__sepOn__PF_P7tostype__1)(void *__anonymous_object728), __attribute__ ((unused)) void (*__sepOff__PF_P7tostype__1)(void *__anonymous_object729), __attribute__ ((unused)) _Bool (*__sepDisable__PFb_P7tostype__1)(void *__anonymous_object730), __attribute__ ((unused)) _Bool (*__sepEnable__PFb_P7tostype__1)(void *__anonymous_object731), __attribute__ ((unused)) const char *(*__sepGet__PFPCc_P7tostype__1)(void *__anonymous_object732), __attribute__ ((unused)) void (*__sepSet__PF_P7tostypePCc__1)(void *__anonymous_object733, const char *__anonymous_object734), __attribute__ ((unused)) const char *(*__sepGetTuple__PFPCc_P7tostype__1)(void *__anonymous_object735), __attribute__ ((unused)) void (*__sepSetTuple__PF_P7tostypePCc__1)(void *__anonymous_object736, const char *__anonymous_object737), __attribute__ ((unused)) signed int (*__fail__PFi_P7tostype__1)(void *__anonymous_object738), __attribute__ ((unused)) signed int (*__flush__PFi_P7tostype__1)(void *__anonymous_object739), __attribute__ ((unused)) void (*__open__PF_P7tostypePCcPCc__1)(void *__os__P7tostype_1, const char *__name__PCc_1, const char *__mode__PCc_1), __attribute__ ((unused)) void (*__close__PF_P7tostype__1)(void *__os__P7tostype_1), __attribute__ ((unused)) void *(*__write__PFP7tostype_P7tostypePCcUl__1)(void *__anonymous_object740, const char *__anonymous_object741, unsigned long int __anonymous_object742), __attribute__ ((unused)) signed int (*__fmt__PFi_P7tostypePCc__1)(void *__anonymous_object743, const char *__fmt__PCc_1, ...), __attribute__ ((unused)) void *(*___operator_bitor__PFP7tostype_P7tostype7tParams__1)(void *__anonymous_object744, void *__anonymous_object745), void *__os__P7tostype_1, void *__arg__2tT_1, void *__rest__7tParams_1); 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 0_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__A 0_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);40 void __write__A2_1_0_0____operator_assign__PFt1_Rt1t1____constructor__PF_Rt1____constructor__PF_Rt1t1____destructor__PF_Rt1____operator_bitor__PFPd0_Pd0t1___sepPrt__PFb_Pd0___sepReset__PF_Pd0___sepReset__PF_Pd0b___sepGetCur__PFPCc_Pd0___sepSetCur__PF_Pd0PCc___getNL__PFb_Pd0___setNL__PF_Pd0b___sepOn__PF_Pd0___sepOff__PF_Pd0___sepDisable__PFb_Pd0___sepEnable__PFb_Pd0___sepGet__PFPCc_Pd0___sepSet__PF_Pd0PCc___sepGetTuple__PFPCc_Pd0___sepSetTuple__PF_Pd0PCc___fail__PFi_Pd0___flush__PFi_Pd0___open__PF_Pd0PCcPCc___close__PF_Pd0___write__PFPd0_Pd0PCcUl___fmt__PFi_Pd0PCc____operator_assign__PFt2_Rt2t2____constructor__PF_Rt2____constructor__PF_Rt2t2____destructor__PF_Rt2____operator_preincr__PFt2_Rt2____operator_predecr__PFt2_Rt2____operator_equal__PFi_t2t2____operator_notequal__PFi_t2t2____operator_deref__PFRt1_t2__F_t2t2Pd0__1(__attribute__ ((unused)) void *(*_adapterFP9telt_type_14titerator_type_M_P)(void (*__anonymous_object964)(), void *__anonymous_object965), __attribute__ ((unused)) signed int (*_adapterFi_14titerator_type14titerator_type_M_PP)(void (*__anonymous_object966)(), void *__anonymous_object967, void *__anonymous_object968), __attribute__ ((unused)) void (*_adapterF14titerator_type_P14titerator_type_P_M)(void (*__anonymous_object969)(), __attribute__ ((unused)) void *___retval__operator_preincr__14titerator_type_1, void *__anonymous_object970), __attribute__ ((unused)) void (*_adapterF_P14titerator_type14titerator_type__MP)(void (*__anonymous_object971)(), void *__anonymous_object972, void *__anonymous_object973), __attribute__ ((unused)) void (*_adapterF14titerator_type_P14titerator_type14titerator_type_P_MP)(void (*__anonymous_object974)(), __attribute__ ((unused)) void *___retval__operator_assign__14titerator_type_1, void *__anonymous_object975, void *__anonymous_object976), __attribute__ ((unused)) void *(*_adapterFP7tostype_P7tostype9telt_type_M_MP)(void (*__anonymous_object977)(), void *__anonymous_object978, void *__anonymous_object979), __attribute__ ((unused)) void (*_adapterF_P9telt_type9telt_type__MP)(void (*__anonymous_object980)(), void *__anonymous_object981, void *__anonymous_object982), __attribute__ ((unused)) void (*_adapterF9telt_type_P9telt_type9telt_type_P_MP)(void (*__anonymous_object983)(), __attribute__ ((unused)) void *___retval__operator_assign__9telt_type_1, void *__anonymous_object984, void *__anonymous_object985), __attribute__ ((unused)) unsigned long int _sizeof_9telt_type, __attribute__ ((unused)) unsigned long int _alignof_9telt_type, __attribute__ ((unused)) unsigned long int _sizeof_14titerator_type, __attribute__ ((unused)) unsigned long int _alignof_14titerator_type, __attribute__ ((unused)) void *(*___operator_assign__PF9telt_type_R9telt_type9telt_type__1)(void *__anonymous_object986, void *__anonymous_object987), __attribute__ ((unused)) void (*___constructor__PF_R9telt_type__1)(void *__anonymous_object988), __attribute__ ((unused)) void (*___constructor__PF_R9telt_type9telt_type__1)(void *__anonymous_object989, void *__anonymous_object990), __attribute__ ((unused)) void (*___destructor__PF_R9telt_type__1)(void *__anonymous_object991), __attribute__ ((unused)) void *(*___operator_bitor__PFP7tostype_P7tostype9telt_type__1)(void *__anonymous_object992, void *__anonymous_object993), __attribute__ ((unused)) _Bool (*__sepPrt__PFb_P7tostype__1)(void *__anonymous_object994), __attribute__ ((unused)) void (*__sepReset__PF_P7tostype__1)(void *__anonymous_object995), __attribute__ ((unused)) void (*__sepReset__PF_P7tostypeb__1)(void *__anonymous_object996, _Bool __anonymous_object997), __attribute__ ((unused)) const char *(*__sepGetCur__PFPCc_P7tostype__1)(void *__anonymous_object998), __attribute__ ((unused)) void (*__sepSetCur__PF_P7tostypePCc__1)(void *__anonymous_object999, const char *__anonymous_object1000), __attribute__ ((unused)) _Bool (*__getNL__PFb_P7tostype__1)(void *__anonymous_object1001), __attribute__ ((unused)) void (*__setNL__PF_P7tostypeb__1)(void *__anonymous_object1002, _Bool __anonymous_object1003), __attribute__ ((unused)) void (*__sepOn__PF_P7tostype__1)(void *__anonymous_object1004), __attribute__ ((unused)) void (*__sepOff__PF_P7tostype__1)(void *__anonymous_object1005), __attribute__ ((unused)) _Bool (*__sepDisable__PFb_P7tostype__1)(void *__anonymous_object1006), __attribute__ ((unused)) _Bool (*__sepEnable__PFb_P7tostype__1)(void *__anonymous_object1007), __attribute__ ((unused)) const char *(*__sepGet__PFPCc_P7tostype__1)(void *__anonymous_object1008), __attribute__ ((unused)) void (*__sepSet__PF_P7tostypePCc__1)(void *__anonymous_object1009, const char *__anonymous_object1010), __attribute__ ((unused)) const char *(*__sepGetTuple__PFPCc_P7tostype__1)(void *__anonymous_object1011), __attribute__ ((unused)) void (*__sepSetTuple__PF_P7tostypePCc__1)(void *__anonymous_object1012, const char *__anonymous_object1013), __attribute__ ((unused)) signed int (*__fail__PFi_P7tostype__1)(void *__anonymous_object1014), __attribute__ ((unused)) signed int (*__flush__PFi_P7tostype__1)(void *__anonymous_object1015), __attribute__ ((unused)) void (*__open__PF_P7tostypePCcPCc__1)(void *__os__P7tostype_1, const char *__name__PCc_1, const char *__mode__PCc_1), __attribute__ ((unused)) void (*__close__PF_P7tostype__1)(void *__os__P7tostype_1), __attribute__ ((unused)) void *(*__write__PFP7tostype_P7tostypePCcUl__1)(void *__anonymous_object1016, const char *__anonymous_object1017, unsigned long int __anonymous_object1018), __attribute__ ((unused)) signed int (*__fmt__PFi_P7tostypePCc__1)(void *__anonymous_object1019, const char *__fmt__PCc_1, ...), __attribute__ ((unused)) void *(*___operator_assign__PF14titerator_type_R14titerator_type14titerator_type__1)(void *__anonymous_object1020, void *__anonymous_object1021), __attribute__ ((unused)) void (*___constructor__PF_R14titerator_type__1)(void *__anonymous_object1022), __attribute__ ((unused)) void (*___constructor__PF_R14titerator_type14titerator_type__1)(void *__anonymous_object1023, void *__anonymous_object1024), __attribute__ ((unused)) void (*___destructor__PF_R14titerator_type__1)(void *__anonymous_object1025), __attribute__ ((unused)) void *(*___operator_preincr__PF14titerator_type_R14titerator_type__1)(void *__anonymous_object1026), __attribute__ ((unused)) void *(*___operator_predecr__PF14titerator_type_R14titerator_type__1)(void *__anonymous_object1027), __attribute__ ((unused)) signed int (*___operator_equal__PFi_14titerator_type14titerator_type__1)(void *__anonymous_object1028, void *__anonymous_object1029), __attribute__ ((unused)) signed int (*___operator_notequal__PFi_14titerator_type14titerator_type__1)(void *__anonymous_object1030, void *__anonymous_object1031), __attribute__ ((unused)) void *(*___operator_deref__PFR9telt_type_14titerator_type__1)(void *__anonymous_object1032), void *__begin__14titerator_type_1, void *__end__14titerator_type_1, void *__os__P7tostype_1); 41 void __write_reverse__A2_1_0_0____operator_assign__PFt1_Rt1t1____constructor__PF_Rt1____constructor__PF_Rt1t1____destructor__PF_Rt1____operator_bitor__PFPd0_Pd0t1___sepPrt__PFb_Pd0___sepReset__PF_Pd0___sepReset__PF_Pd0b___sepGetCur__PFPCc_Pd0___sepSetCur__PF_Pd0PCc___getNL__PFb_Pd0___setNL__PF_Pd0b___sepOn__PF_Pd0___sepOff__PF_Pd0___sepDisable__PFb_Pd0___sepEnable__PFb_Pd0___sepGet__PFPCc_Pd0___sepSet__PF_Pd0PCc___sepGetTuple__PFPCc_Pd0___sepSetTuple__PF_Pd0PCc___fail__PFi_Pd0___flush__PFi_Pd0___open__PF_Pd0PCcPCc___close__PF_Pd0___write__PFPd0_Pd0PCcUl___fmt__PFi_Pd0PCc____operator_assign__PFt2_Rt2t2____constructor__PF_Rt2____constructor__PF_Rt2t2____destructor__PF_Rt2____operator_preincr__PFt2_Rt2____operator_predecr__PFt2_Rt2____operator_equal__PFi_t2t2____operator_notequal__PFi_t2t2____operator_deref__PFRt1_t2__F_t2t2Pd0__1(__attribute__ ((unused)) void *(*_adapterFP9telt_type_14titerator_type_M_P)(void (*__anonymous_object1033)(), void *__anonymous_object1034), __attribute__ ((unused)) signed int (*_adapterFi_14titerator_type14titerator_type_M_PP)(void (*__anonymous_object1035)(), void *__anonymous_object1036, void *__anonymous_object1037), __attribute__ ((unused)) void (*_adapterF14titerator_type_P14titerator_type_P_M)(void (*__anonymous_object1038)(), __attribute__ ((unused)) void *___retval__operator_preincr__14titerator_type_1, void *__anonymous_object1039), __attribute__ ((unused)) void (*_adapterF_P14titerator_type14titerator_type__MP)(void (*__anonymous_object1040)(), void *__anonymous_object1041, void *__anonymous_object1042), __attribute__ ((unused)) void (*_adapterF14titerator_type_P14titerator_type14titerator_type_P_MP)(void (*__anonymous_object1043)(), __attribute__ ((unused)) void *___retval__operator_assign__14titerator_type_1, void *__anonymous_object1044, void *__anonymous_object1045), __attribute__ ((unused)) void *(*_adapterFP7tostype_P7tostype9telt_type_M_MP)(void (*__anonymous_object1046)(), void *__anonymous_object1047, void *__anonymous_object1048), __attribute__ ((unused)) void (*_adapterF_P9telt_type9telt_type__MP)(void (*__anonymous_object1049)(), void *__anonymous_object1050, void *__anonymous_object1051), __attribute__ ((unused)) void (*_adapterF9telt_type_P9telt_type9telt_type_P_MP)(void (*__anonymous_object1052)(), __attribute__ ((unused)) void *___retval__operator_assign__9telt_type_1, void *__anonymous_object1053, void *__anonymous_object1054), __attribute__ ((unused)) unsigned long int _sizeof_9telt_type, __attribute__ ((unused)) unsigned long int _alignof_9telt_type, __attribute__ ((unused)) unsigned long int _sizeof_14titerator_type, __attribute__ ((unused)) unsigned long int _alignof_14titerator_type, __attribute__ ((unused)) void *(*___operator_assign__PF9telt_type_R9telt_type9telt_type__1)(void *__anonymous_object1055, void *__anonymous_object1056), __attribute__ ((unused)) void (*___constructor__PF_R9telt_type__1)(void *__anonymous_object1057), __attribute__ ((unused)) void (*___constructor__PF_R9telt_type9telt_type__1)(void *__anonymous_object1058, void *__anonymous_object1059), __attribute__ ((unused)) void (*___destructor__PF_R9telt_type__1)(void *__anonymous_object1060), __attribute__ ((unused)) void *(*___operator_bitor__PFP7tostype_P7tostype9telt_type__1)(void *__anonymous_object1061, void *__anonymous_object1062), __attribute__ ((unused)) _Bool (*__sepPrt__PFb_P7tostype__1)(void *__anonymous_object1063), __attribute__ ((unused)) void (*__sepReset__PF_P7tostype__1)(void *__anonymous_object1064), __attribute__ ((unused)) void (*__sepReset__PF_P7tostypeb__1)(void *__anonymous_object1065, _Bool __anonymous_object1066), __attribute__ ((unused)) const char *(*__sepGetCur__PFPCc_P7tostype__1)(void *__anonymous_object1067), __attribute__ ((unused)) void (*__sepSetCur__PF_P7tostypePCc__1)(void *__anonymous_object1068, const char *__anonymous_object1069), __attribute__ ((unused)) _Bool (*__getNL__PFb_P7tostype__1)(void *__anonymous_object1070), __attribute__ ((unused)) void (*__setNL__PF_P7tostypeb__1)(void *__anonymous_object1071, _Bool __anonymous_object1072), __attribute__ ((unused)) void (*__sepOn__PF_P7tostype__1)(void *__anonymous_object1073), __attribute__ ((unused)) void (*__sepOff__PF_P7tostype__1)(void *__anonymous_object1074), __attribute__ ((unused)) _Bool (*__sepDisable__PFb_P7tostype__1)(void *__anonymous_object1075), __attribute__ ((unused)) _Bool (*__sepEnable__PFb_P7tostype__1)(void *__anonymous_object1076), __attribute__ ((unused)) const char *(*__sepGet__PFPCc_P7tostype__1)(void *__anonymous_object1077), __attribute__ ((unused)) void (*__sepSet__PF_P7tostypePCc__1)(void *__anonymous_object1078, const char *__anonymous_object1079), __attribute__ ((unused)) const char *(*__sepGetTuple__PFPCc_P7tostype__1)(void *__anonymous_object1080), __attribute__ ((unused)) void (*__sepSetTuple__PF_P7tostypePCc__1)(void *__anonymous_object1081, const char *__anonymous_object1082), __attribute__ ((unused)) signed int (*__fail__PFi_P7tostype__1)(void *__anonymous_object1083), __attribute__ ((unused)) signed int (*__flush__PFi_P7tostype__1)(void *__anonymous_object1084), __attribute__ ((unused)) void (*__open__PF_P7tostypePCcPCc__1)(void *__os__P7tostype_1, const char *__name__PCc_1, const char *__mode__PCc_1), __attribute__ ((unused)) void (*__close__PF_P7tostype__1)(void *__os__P7tostype_1), __attribute__ ((unused)) void *(*__write__PFP7tostype_P7tostypePCcUl__1)(void *__anonymous_object1085, const char *__anonymous_object1086, unsigned long int __anonymous_object1087), __attribute__ ((unused)) signed int (*__fmt__PFi_P7tostypePCc__1)(void *__anonymous_object1088, const char *__fmt__PCc_1, ...), __attribute__ ((unused)) void *(*___operator_assign__PF14titerator_type_R14titerator_type14titerator_type__1)(void *__anonymous_object1089, void *__anonymous_object1090), __attribute__ ((unused)) void (*___constructor__PF_R14titerator_type__1)(void *__anonymous_object1091), __attribute__ ((unused)) void (*___constructor__PF_R14titerator_type14titerator_type__1)(void *__anonymous_object1092, void *__anonymous_object1093), __attribute__ ((unused)) void (*___destructor__PF_R14titerator_type__1)(void *__anonymous_object1094), __attribute__ ((unused)) void *(*___operator_preincr__PF14titerator_type_R14titerator_type__1)(void *__anonymous_object1095), __attribute__ ((unused)) void *(*___operator_predecr__PF14titerator_type_R14titerator_type__1)(void *__anonymous_object1096), __attribute__ ((unused)) signed int (*___operator_equal__PFi_14titerator_type14titerator_type__1)(void *__anonymous_object1097, void *__anonymous_object1098), __attribute__ ((unused)) signed int (*___operator_notequal__PFi_14titerator_type14titerator_type__1)(void *__anonymous_object1099, void *__anonymous_object1100), __attribute__ ((unused)) void *(*___operator_deref__PFR9telt_type_14titerator_type__1)(void *__anonymous_object1101), void *__begin__14titerator_type_1, void *__end__14titerator_type_1, void *__os__P7tostype_1); 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);67 66 static inline void ___constructor__F_R16s_Istream_cstrUC_autogen___1(struct _Istream_cstrUC *___dst__R16s_Istream_cstrUC_1){ 68 67 ((void)((*___dst__R16s_Istream_cstrUC_1).__s__Pc_1) /* ?{} */); … … 77 76 struct _Istream_cstrUC ___ret__16s_Istream_cstrUC_1; 78 77 ((void)((*___dst__R16s_Istream_cstrUC_1).__s__Pc_1=___src__16s_Istream_cstrUC_1.__s__Pc_1)); 79 ((void)___constructor__F_R16s_Istream_cstrUC16s_Istream_cstrUC_autogen___1((&___ret__16s_Istream_cstrUC_1), (*___dst__R16s_Istream_cstrUC_1)));80 return ___ret__16s_Istream_cstrUC_1;78 ((void)___constructor__F_R16s_Istream_cstrUC16s_Istream_cstrUC_autogen___1((&___ret__16s_Istream_cstrUC_1), ___src__16s_Istream_cstrUC_1)); 79 return ((struct _Istream_cstrUC )___ret__16s_Istream_cstrUC_1); 81 80 } 82 81 static inline void ___constructor__F_R16s_Istream_cstrUCPc_autogen___1(struct _Istream_cstrUC *___dst__R16s_Istream_cstrUC_1, char *__s__Pc_1){ … … 93 92 static inline void ___destructor__F_R15s_Istream_cstrC_autogen___1(struct _Istream_cstrC *___dst__R15s_Istream_cstrC_1); 94 93 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);97 94 static inline void ___constructor__F_R15s_Istream_cstrC_autogen___1(struct _Istream_cstrC *___dst__R15s_Istream_cstrC_1){ 98 95 ((void)((*___dst__R15s_Istream_cstrC_1).__s__Pc_1) /* ?{} */); … … 111 108 ((void)((*___dst__R15s_Istream_cstrC_1).__s__Pc_1=___src__15s_Istream_cstrC_1.__s__Pc_1)); 112 109 ((void)((*___dst__R15s_Istream_cstrC_1).__size__i_1=___src__15s_Istream_cstrC_1.__size__i_1)); 113 ((void)___constructor__F_R15s_Istream_cstrC15s_Istream_cstrC_autogen___1((&___ret__15s_Istream_cstrC_1), (*___dst__R15s_Istream_cstrC_1)));114 return ___ret__15s_Istream_cstrC_1;110 ((void)___constructor__F_R15s_Istream_cstrC15s_Istream_cstrC_autogen___1((&___ret__15s_Istream_cstrC_1), ___src__15s_Istream_cstrC_1)); 111 return ((struct _Istream_cstrC )___ret__15s_Istream_cstrC_1); 115 112 } 116 113 static inline void ___constructor__F_R15s_Istream_cstrCPc_autogen___1(struct _Istream_cstrC *___dst__R15s_Istream_cstrC_1, char *__s__Pc_1){ … … 125 122 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); 126 123 enum __anonymous0 { 127 __sepSize__C13e__anonymous0_1 = 16,124 __sepSize__C13e__anonymous0_1 = ((signed int )16), 128 125 }; 129 126 struct ofstream { … … 140 137 static inline void ___destructor__F_R9sofstream_autogen___1(struct ofstream *___dst__R9sofstream_1); 141 138 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)]);149 139 static inline void ___constructor__F_R9sofstream_autogen___1(struct ofstream *___dst__R9sofstream_1){ 150 140 ((void)((*___dst__R9sofstream_1).__file__Pv_1) /* ?{} */); … … 154 144 ((void)((*___dst__R9sofstream_1).__sepCur__PCc_1) /* ?{} */); 155 145 { 156 signed int _index0 = 0;146 signed int _index0 = ((signed int )0); 157 147 for (;(_index0<((signed int )__sepSize__C13e__anonymous0_1));((void)(++_index0))) { 158 148 ((void)((*((char *)(&(*___dst__R9sofstream_1).__separator__A0c_1[((signed long int )_index0)])))) /* ?{} */); … … 160 150 161 151 } 162 163 { 164 signed int _index1 = 0; 152 { 153 signed int _index1 = ((signed int )0); 165 154 for (;(_index1<((signed int )__sepSize__C13e__anonymous0_1));((void)(++_index1))) { 166 155 ((void)((*((char *)(&(*___dst__R9sofstream_1).__tupleSeparator__A0c_1[((signed long int )_index1)])))) /* ?{} */); … … 168 157 169 158 } 170 171 159 } 172 160 static inline void ___constructor__F_R9sofstream9sofstream_autogen___1(struct ofstream *___dst__R9sofstream_1, struct ofstream ___src__9sofstream_1){ … … 177 165 ((void)((*___dst__R9sofstream_1).__sepCur__PCc_1=___src__9sofstream_1.__sepCur__PCc_1) /* ?{} */); 178 166 { 179 signed int _index2 = 0;167 signed int _index2 = ((signed int )0); 180 168 for (;(_index2<((signed int )__sepSize__C13e__anonymous0_1));((void)(++_index2))) { 181 169 ((void)((*((char *)(&(*___dst__R9sofstream_1).__separator__A0c_1[((signed long int )_index2)])))=___src__9sofstream_1.__separator__A0c_1[((signed long int )_index2)]) /* ?{} */); … … 183 171 184 172 } 185 186 { 187 signed int _index3 = 0; 173 { 174 signed int _index3 = ((signed int )0); 188 175 for (;(_index3<((signed int )__sepSize__C13e__anonymous0_1));((void)(++_index3))) { 189 176 ((void)((*((char *)(&(*___dst__R9sofstream_1).__tupleSeparator__A0c_1[((signed long int )_index3)])))=___src__9sofstream_1.__tupleSeparator__A0c_1[((signed long int )_index3)]) /* ?{} */); … … 191 178 192 179 } 193 194 180 } 195 181 static inline void ___destructor__F_R9sofstream_autogen___1(struct ofstream *___dst__R9sofstream_1){ 196 182 { 197 signed int _index4 = (( (signed int )__sepSize__C13e__anonymous0_1)-1);183 signed int _index4 = ((signed int )(((signed int )__sepSize__C13e__anonymous0_1)-1)); 198 184 for (;(_index4>=0);((void)(--_index4))) { 199 185 ((void)((*((char *)(&(*___dst__R9sofstream_1).__tupleSeparator__A0c_1[((signed long int )_index4)])))) /* ^?{} */); … … 201 187 202 188 } 203 204 { 205 signed int _index5 = (((signed int )__sepSize__C13e__anonymous0_1)-1); 189 { 190 signed int _index5 = ((signed int )(((signed int )__sepSize__C13e__anonymous0_1)-1)); 206 191 for (;(_index5>=0);((void)(--_index5))) { 207 192 ((void)((*((char *)(&(*___dst__R9sofstream_1).__separator__A0c_1[((signed long int )_index5)])))) /* ^?{} */); … … 209 194 210 195 } 211 212 196 ((void)((*___dst__R9sofstream_1).__sepCur__PCc_1) /* ^?{} */); 213 197 ((void)((*___dst__R9sofstream_1).__sawNL__b_1) /* ^?{} */); … … 224 208 ((void)((*___dst__R9sofstream_1).__sepCur__PCc_1=___src__9sofstream_1.__sepCur__PCc_1)); 225 209 { 226 signed int _index6 = 0;210 signed int _index6 = ((signed int )0); 227 211 for (;(_index6<((signed int )__sepSize__C13e__anonymous0_1));((void)(++_index6))) { 228 212 ((void)((*___dst__R9sofstream_1).__separator__A0c_1[((signed long int )_index6)]=___src__9sofstream_1.__separator__A0c_1[((signed long int )_index6)])); … … 232 216 233 217 { 234 signed int _index7 = 0;218 signed int _index7 = ((signed int )0); 235 219 for (;(_index7<((signed int )__sepSize__C13e__anonymous0_1));((void)(++_index7))) { 236 220 ((void)((*___dst__R9sofstream_1).__tupleSeparator__A0c_1[((signed long int )_index7)]=___src__9sofstream_1.__tupleSeparator__A0c_1[((signed long int )_index7)])); … … 239 223 } 240 224 241 ((void)___constructor__F_R9sofstream9sofstream_autogen___1((&___ret__9sofstream_1), (*___dst__R9sofstream_1)));242 return ___ret__9sofstream_1;225 ((void)___constructor__F_R9sofstream9sofstream_autogen___1((&___ret__9sofstream_1), ___src__9sofstream_1)); 226 return ((struct ofstream )___ret__9sofstream_1); 243 227 } 244 228 static inline void ___constructor__F_R9sofstreamPv_autogen___1(struct ofstream *___dst__R9sofstream_1, void *__file__Pv_1){ … … 249 233 ((void)((*___dst__R9sofstream_1).__sepCur__PCc_1) /* ?{} */); 250 234 { 251 signed int _index8 = 0;235 signed int _index8 = ((signed int )0); 252 236 for (;(_index8<((signed int )__sepSize__C13e__anonymous0_1));((void)(++_index8))) { 253 237 ((void)((*((char *)(&(*___dst__R9sofstream_1).__separator__A0c_1[((signed long int )_index8)])))) /* ?{} */); … … 255 239 256 240 } 257 258 { 259 signed int _index9 = 0; 241 { 242 signed int _index9 = ((signed int )0); 260 243 for (;(_index9<((signed int )__sepSize__C13e__anonymous0_1));((void)(++_index9))) { 261 244 ((void)((*((char *)(&(*___dst__R9sofstream_1).__tupleSeparator__A0c_1[((signed long int )_index9)])))) /* ?{} */); … … 263 246 264 247 } 265 266 248 } 267 249 static inline void ___constructor__F_R9sofstreamPvb_autogen___1(struct ofstream *___dst__R9sofstream_1, void *__file__Pv_1, _Bool __sepDefault__b_1){ … … 272 254 ((void)((*___dst__R9sofstream_1).__sepCur__PCc_1) /* ?{} */); 273 255 { 274 signed int _index10 = 0;256 signed int _index10 = ((signed int )0); 275 257 for (;(_index10<((signed int )__sepSize__C13e__anonymous0_1));((void)(++_index10))) { 276 258 ((void)((*((char *)(&(*___dst__R9sofstream_1).__separator__A0c_1[((signed long int )_index10)])))) /* ?{} */); … … 278 260 279 261 } 280 281 { 282 signed int _index11 = 0; 262 { 263 signed int _index11 = ((signed int )0); 283 264 for (;(_index11<((signed int )__sepSize__C13e__anonymous0_1));((void)(++_index11))) { 284 265 ((void)((*((char *)(&(*___dst__R9sofstream_1).__tupleSeparator__A0c_1[((signed long int )_index11)])))) /* ?{} */); … … 286 267 287 268 } 288 289 269 } 290 270 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){ … … 295 275 ((void)((*___dst__R9sofstream_1).__sepCur__PCc_1) /* ?{} */); 296 276 { 297 signed int _index12 = 0;277 signed int _index12 = ((signed int )0); 298 278 for (;(_index12<((signed int )__sepSize__C13e__anonymous0_1));((void)(++_index12))) { 299 279 ((void)((*((char *)(&(*___dst__R9sofstream_1).__separator__A0c_1[((signed long int )_index12)])))) /* ?{} */); … … 301 281 302 282 } 303 304 { 305 signed int _index13 = 0; 283 { 284 signed int _index13 = ((signed int )0); 306 285 for (;(_index13<((signed int )__sepSize__C13e__anonymous0_1));((void)(++_index13))) { 307 286 ((void)((*((char *)(&(*___dst__R9sofstream_1).__tupleSeparator__A0c_1[((signed long int )_index13)])))) /* ?{} */); … … 309 288 310 289 } 311 312 290 } 313 291 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){ … … 318 296 ((void)((*___dst__R9sofstream_1).__sepCur__PCc_1) /* ?{} */); 319 297 { 320 signed int _index14 = 0;298 signed int _index14 = ((signed int )0); 321 299 for (;(_index14<((signed int )__sepSize__C13e__anonymous0_1));((void)(++_index14))) { 322 300 ((void)((*((char *)(&(*___dst__R9sofstream_1).__separator__A0c_1[((signed long int )_index14)])))) /* ?{} */); … … 324 302 325 303 } 326 327 { 328 signed int _index15 = 0; 304 { 305 signed int _index15 = ((signed int )0); 329 306 for (;(_index15<((signed int )__sepSize__C13e__anonymous0_1));((void)(++_index15))) { 330 307 ((void)((*((char *)(&(*___dst__R9sofstream_1).__tupleSeparator__A0c_1[((signed long int )_index15)])))) /* ?{} */); … … 332 309 333 310 } 334 335 311 } 336 312 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){ … … 341 317 ((void)((*___dst__R9sofstream_1).__sepCur__PCc_1=__sepCur__PCc_1) /* ?{} */); 342 318 { 343 signed int _index16 = 0;319 signed int _index16 = ((signed int )0); 344 320 for (;(_index16<((signed int )__sepSize__C13e__anonymous0_1));((void)(++_index16))) { 345 321 ((void)((*((char *)(&(*___dst__R9sofstream_1).__separator__A0c_1[((signed long int )_index16)])))) /* ?{} */); … … 347 323 348 324 } 349 350 { 351 signed int _index17 = 0; 325 { 326 signed int _index17 = ((signed int )0); 352 327 for (;(_index17<((signed int )__sepSize__C13e__anonymous0_1));((void)(++_index17))) { 353 328 ((void)((*((char *)(&(*___dst__R9sofstream_1).__tupleSeparator__A0c_1[((signed long int )_index17)])))) /* ?{} */); … … 355 330 356 331 } 357 358 332 } 359 333 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)]){ … … 364 338 ((void)((*___dst__R9sofstream_1).__sepCur__PCc_1=__sepCur__PCc_1) /* ?{} */); 365 339 { 366 signed int _index18 = 0;340 signed int _index18 = ((signed int )0); 367 341 for (;(_index18<((signed int )__sepSize__C13e__anonymous0_1));((void)(++_index18))) { 368 342 ((void)((*((char *)(&(*___dst__R9sofstream_1).__separator__A0c_1[((signed long int )_index18)])))=__separator__A0c_1[((signed long int )_index18)]) /* ?{} */); … … 370 344 371 345 } 372 373 { 374 signed int _index19 = 0; 346 { 347 signed int _index19 = ((signed int )0); 375 348 for (;(_index19<((signed int )__sepSize__C13e__anonymous0_1));((void)(++_index19))) { 376 349 ((void)((*((char *)(&(*___dst__R9sofstream_1).__tupleSeparator__A0c_1[((signed long int )_index19)])))) /* ?{} */); … … 378 351 379 352 } 380 381 353 } 382 354 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)]){ … … 387 359 ((void)((*___dst__R9sofstream_1).__sepCur__PCc_1=__sepCur__PCc_1) /* ?{} */); 388 360 { 389 signed int _index20 = 0;361 signed int _index20 = ((signed int )0); 390 362 for (;(_index20<((signed int )__sepSize__C13e__anonymous0_1));((void)(++_index20))) { 391 363 ((void)((*((char *)(&(*___dst__R9sofstream_1).__separator__A0c_1[((signed long int )_index20)])))=__separator__A0c_1[((signed long int )_index20)]) /* ?{} */); … … 393 365 394 366 } 395 396 { 397 signed int _index21 = 0; 367 { 368 signed int _index21 = ((signed int )0); 398 369 for (;(_index21<((signed int )__sepSize__C13e__anonymous0_1));((void)(++_index21))) { 399 370 ((void)((*((char *)(&(*___dst__R9sofstream_1).__tupleSeparator__A0c_1[((signed long int )_index21)])))=__tupleSeparator__A0c_1[((signed long int )_index21)]) /* ?{} */); … … 401 372 402 373 } 403 404 374 } 405 375 _Bool __sepPrt__Fb_P9sofstream__1(struct ofstream *__anonymous_object1294); … … 434 404 static inline void ___destructor__F_R9sifstream_autogen___1(struct ifstream *___dst__R9sifstream_1); 435 405 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);437 406 static inline void ___constructor__F_R9sifstream_autogen___1(struct ifstream *___dst__R9sifstream_1){ 438 407 ((void)((*___dst__R9sifstream_1).__file__Pv_1) /* ?{} */); … … 447 416 struct ifstream ___ret__9sifstream_1; 448 417 ((void)((*___dst__R9sifstream_1).__file__Pv_1=___src__9sifstream_1.__file__Pv_1)); 449 ((void)___constructor__F_R9sifstream9sifstream_autogen___1((&___ret__9sifstream_1), (*___dst__R9sifstream_1)));450 return ___ret__9sifstream_1;418 ((void)___constructor__F_R9sifstream9sifstream_autogen___1((&___ret__9sifstream_1), ___src__9sifstream_1)); 419 return ((struct ifstream )___ret__9sifstream_1); 451 420 } 452 421 static inline void ___constructor__F_R9sifstreamPv_autogen___1(struct ifstream *___dst__R9sifstream_1, void *__file__Pv_1){ … … 466 435 struct ofstream *_tmp_cp_ret2; 467 436 __attribute__ ((unused)) struct ofstream *_thunk0(struct ofstream *_p0){ 468 return __endl__A0_1_0_0___sepPrt__PFb_Pd0___sepReset__PF_Pd0___sepReset__PF_Pd0b___sepGetCur__PFPCc_Pd0___sepSetCur__PF_Pd0PCc___getNL__PFb_Pd0___setNL__PF_Pd0b___sepOn__PF_Pd0___sepOff__PF_Pd0___sepDisable__PFb_Pd0___sepEnable__PFb_Pd0___sepGet__PFPCc_Pd0___sepSet__PF_Pd0PCc___sepGetTuple__PFPCc_Pd0___sepSetTuple__PF_Pd0PCc___fail__PFi_Pd0___flush__PFi_Pd0___open__PF_Pd0PCcPCc___close__PF_Pd0___write__PFPd0_Pd0PCcUl___fmt__PFi_Pd0PCc__FPd0_Pd0__1(((_Bool (*)(void *__anonymous_object1322))__sepPrt__Fb_P9sofstream__1), ((void (*)(void *__anonymous_object1323))__sepReset__F_P9sofstream__1), ((void (*)(void *__anonymous_object1324, _Bool __anonymous_object1325))__sepReset__F_P9sofstreamb__1), ((const char *(*)(void *__anonymous_object1326))__sepGetCur__FPCc_P9sofstream__1), ((void (*)(void *__anonymous_object1327, const char *__anonymous_object1328))__sepSetCur__F_P9sofstreamPCc__1), ((_Bool (*)(void *__anonymous_object1329))__getNL__Fb_P9sofstream__1), ((void (*)(void *__anonymous_object1330, _Bool __anonymous_object1331))__setNL__F_P9sofstreamb__1), ((void (*)(void *__anonymous_object1332))__sepOn__F_P9sofstream__1), ((void (*)(void *__anonymous_object1333))__sepOff__F_P9sofstream__1), ((_Bool (*)(void *__anonymous_object1334))__sepDisable__Fb_P9sofstream__1), ((_Bool (*)(void *__anonymous_object1335))__sepEnable__Fb_P9sofstream__1), ((const char *(*)(void *__anonymous_object1336))__sepGet__FPCc_P9sofstream__1), ((void (*)(void *__anonymous_object1337, const char *__anonymous_object1338))__sepSet__F_P9sofstreamPCc__1), ((const char *(*)(void *__anonymous_object1339))__sepGetTuple__FPCc_P9sofstream__1), ((void (*)(void *__anonymous_object1340, const char *__anonymous_object1341))__sepSetTuple__F_P9sofstreamPCc__1), ((signed int (*)(void *__anonymous_object1342))__fail__Fi_P9sofstream__1), ((signed int (*)(void *__anonymous_object1343))__flush__Fi_P9sofstream__1), ((void (*)(void *__os__P7tostype_1, const char *__name__PCc_1, const char *__mode__PCc_1))__open__F_P9sofstreamPCcPCc__1), ((void (*)(void *__os__P7tostype_1))__close__F_P9sofstream__1), ((void *(*)(void *__anonymous_object1344, const char *__anonymous_object1345, unsigned long int __anonymous_object1346))__write__FP9sofstream_P9sofstreamPCcUl__1), ((signed int (*)(void *__anonymous_object1347, const char *__fmt__PCc_1, ...))__fmt__Fi_P9sofstreamPCc__1), ((void *)_p0));469 } 470 ((void)(((void)(_tmp_cp_ret2=___operator_bitor__A0_1_0_0___sepPrt__PFb_Pd0___sepReset__PF_Pd0___sepReset__PF_Pd0b___sepGetCur__PFPCc_Pd0___sepSetCur__PF_Pd0PCc___getNL__PFb_Pd0___setNL__PF_Pd0b___sepOn__PF_Pd0___sepOff__PF_Pd0___sepDisable__PFb_Pd0___sepEnable__PFb_Pd0___sepGet__PFPCc_Pd0___sepSet__PF_Pd0PCc___sepGetTuple__PFPCc_Pd0___sepSetTuple__PF_Pd0PCc___fail__PFi_Pd0___flush__PFi_Pd0___open__PF_Pd0PCcPCc___close__PF_Pd0___write__PFPd0_Pd0PCcUl___fmt__PFi_Pd0PCc__FPd0_Pd0PFPd0_Pd0___1(((_Bool (*)(void *__anonymous_object1348))__sepPrt__Fb_P9sofstream__1), ((void (*)(void *__anonymous_object1349))__sepReset__F_P9sofstream__1), ((void (*)(void *__anonymous_object1350, _Bool __anonymous_object1351))__sepReset__F_P9sofstreamb__1), ((const char *(*)(void *__anonymous_object1352))__sepGetCur__FPCc_P9sofstream__1), ((void (*)(void *__anonymous_object1353, const char *__anonymous_object1354))__sepSetCur__F_P9sofstreamPCc__1), ((_Bool (*)(void *__anonymous_object1355))__getNL__Fb_P9sofstream__1), ((void (*)(void *__anonymous_object1356, _Bool __anonymous_object1357))__setNL__F_P9sofstreamb__1), ((void (*)(void *__anonymous_object1358))__sepOn__F_P9sofstream__1), ((void (*)(void *__anonymous_object1359))__sepOff__F_P9sofstream__1), ((_Bool (*)(void *__anonymous_object1360))__sepDisable__Fb_P9sofstream__1), ((_Bool (*)(void *__anonymous_object1361))__sepEnable__Fb_P9sofstream__1), ((const char *(*)(void *__anonymous_object1362))__sepGet__FPCc_P9sofstream__1), ((void (*)(void *__anonymous_object1363, const char *__anonymous_object1364))__sepSet__F_P9sofstreamPCc__1), ((const char *(*)(void *__anonymous_object1365))__sepGetTuple__FPCc_P9sofstream__1), ((void (*)(void *__anonymous_object1366, const char *__anonymous_object1367))__sepSetTuple__F_P9sofstreamPCc__1), ((signed int (*)(void *__anonymous_object1368))__fail__Fi_P9sofstream__1), ((signed int (*)(void *__anonymous_object1369))__flush__Fi_P9sofstream__1), ((void (*)(void *__os__P7tostype_1, const char *__name__PCc_1, const char *__mode__PCc_1))__open__F_P9sofstreamPCcPCc__1), ((void (*)(void *__os__P7tostype_1))__close__F_P9sofstream__1), ((void *(*)(void *__anonymous_object1370, const char *__anonymous_object1371, unsigned long int __anonymous_object1372))__write__FP9sofstream_P9sofstreamPCcUl__1), ((signed int (*)(void *__anonymous_object1373, const char *__fmt__PCc_1, ...))__fmt__Fi_P9sofstreamPCc__1), (( void *)(((void)(_tmp_cp_ret1=___operator_bitor__A0_1_0_0___sepPrt__PFb_Pd0___sepReset__PF_Pd0___sepReset__PF_Pd0b___sepGetCur__PFPCc_Pd0___sepSetCur__PF_Pd0PCc___getNL__PFb_Pd0___setNL__PF_Pd0b___sepOn__PF_Pd0___sepOff__PF_Pd0___sepDisable__PFb_Pd0___sepEnable__PFb_Pd0___sepGet__PFPCc_Pd0___sepSet__PF_Pd0PCc___sepGetTuple__PFPCc_Pd0___sepSetTuple__PF_Pd0PCc___fail__PFi_Pd0___flush__PFi_Pd0___open__PF_Pd0PCcPCc___close__PF_Pd0___write__PFPd0_Pd0PCcUl___fmt__PFi_Pd0PCc__FPd0_Pd0c__1(((_Bool (*)(void *__anonymous_object1374))__sepPrt__Fb_P9sofstream__1), ((void (*)(void *__anonymous_object1375))__sepReset__F_P9sofstream__1), ((void (*)(void *__anonymous_object1376, _Bool __anonymous_object1377))__sepReset__F_P9sofstreamb__1), ((const char *(*)(void *__anonymous_object1378))__sepGetCur__FPCc_P9sofstream__1), ((void (*)(void *__anonymous_object1379, const char *__anonymous_object1380))__sepSetCur__F_P9sofstreamPCc__1), ((_Bool (*)(void *__anonymous_object1381))__getNL__Fb_P9sofstream__1), ((void (*)(void *__anonymous_object1382, _Bool __anonymous_object1383))__setNL__F_P9sofstreamb__1), ((void (*)(void *__anonymous_object1384))__sepOn__F_P9sofstream__1), ((void (*)(void *__anonymous_object1385))__sepOff__F_P9sofstream__1), ((_Bool (*)(void *__anonymous_object1386))__sepDisable__Fb_P9sofstream__1), ((_Bool (*)(void *__anonymous_object1387))__sepEnable__Fb_P9sofstream__1), ((const char *(*)(void *__anonymous_object1388))__sepGet__FPCc_P9sofstream__1), ((void (*)(void *__anonymous_object1389, const char *__anonymous_object1390))__sepSet__F_P9sofstreamPCc__1), ((const char *(*)(void *__anonymous_object1391))__sepGetTuple__FPCc_P9sofstream__1), ((void (*)(void *__anonymous_object1392, const char *__anonymous_object1393))__sepSetTuple__F_P9sofstreamPCc__1), ((signed int (*)(void *__anonymous_object1394))__fail__Fi_P9sofstream__1), ((signed int (*)(void *__anonymous_object1395))__flush__Fi_P9sofstream__1), ((void (*)(void *__os__P7tostype_1, const char *__name__PCc_1, const char *__mode__PCc_1))__open__F_P9sofstreamPCcPCc__1), ((void (*)(void *__os__P7tostype_1))__close__F_P9sofstream__1), ((void *(*)(void *__anonymous_object1396, const char *__anonymous_object1397, unsigned long int __anonymous_object1398))__write__FP9sofstream_P9sofstreamPCcUl__1), ((signed int (*)(void *__anonymous_object1399, const char *__fmt__PCc_1, ...))__fmt__Fi_P9sofstreamPCc__1), ((void *)(((void)(_tmp_cp_ret0=___operator_bitor__A0_1_0_0___sepPrt__PFb_Pd0___sepReset__PF_Pd0___sepReset__PF_Pd0b___sepGetCur__PFPCc_Pd0___sepSetCur__PF_Pd0PCc___getNL__PFb_Pd0___setNL__PF_Pd0b___sepOn__PF_Pd0___sepOff__PF_Pd0___sepDisable__PFb_Pd0___sepEnable__PFb_Pd0___sepGet__PFPCc_Pd0___sepSet__PF_Pd0PCc___sepGetTuple__PFPCc_Pd0___sepSetTuple__PF_Pd0PCc___fail__PFi_Pd0___flush__PFi_Pd0___open__PF_Pd0PCcPCc___close__PF_Pd0___write__PFPd0_Pd0PCcUl___fmt__PFi_Pd0PCc__FPd0_Pd0PCc__1(((_Bool (*)(void *__anonymous_object1400))__sepPrt__Fb_P9sofstream__1), ((void (*)(void *__anonymous_object1401))__sepReset__F_P9sofstream__1), ((void (*)(void *__anonymous_object1402, _Bool __anonymous_object1403))__sepReset__F_P9sofstreamb__1), ((const char *(*)(void *__anonymous_object1404))__sepGetCur__FPCc_P9sofstream__1), ((void (*)(void *__anonymous_object1405, const char *__anonymous_object1406))__sepSetCur__F_P9sofstreamPCc__1), ((_Bool (*)(void *__anonymous_object1407))__getNL__Fb_P9sofstream__1), ((void (*)(void *__anonymous_object1408, _Bool __anonymous_object1409))__setNL__F_P9sofstreamb__1), ((void (*)(void *__anonymous_object1410))__sepOn__F_P9sofstream__1), ((void (*)(void *__anonymous_object1411))__sepOff__F_P9sofstream__1), ((_Bool (*)(void *__anonymous_object1412))__sepDisable__Fb_P9sofstream__1), ((_Bool (*)(void *__anonymous_object1413))__sepEnable__Fb_P9sofstream__1), ((const char *(*)(void *__anonymous_object1414))__sepGet__FPCc_P9sofstream__1), ((void (*)(void *__anonymous_object1415, const char *__anonymous_object1416))__sepSet__F_P9sofstreamPCc__1), ((const char *(*)(void *__anonymous_object1417))__sepGetTuple__FPCc_P9sofstream__1), ((void (*)(void *__anonymous_object1418, const char *__anonymous_object1419))__sepSetTuple__F_P9sofstreamPCc__1), ((signed int (*)(void *__anonymous_object1420))__fail__Fi_P9sofstream__1), ((signed int (*)(void *__anonymous_object1421))__flush__Fi_P9sofstream__1), ((void (*)(void *__os__P7tostype_1, const char *__name__PCc_1, const char *__mode__PCc_1))__open__F_P9sofstreamPCcPCc__1), ((void (*)(void *__os__P7tostype_1))__close__F_P9sofstream__1), ((void *(*)(void *__anonymous_object1422, const char *__anonymous_object1423, unsigned long int __anonymous_object1424))__write__FP9sofstream_P9sofstreamPCcUl__1), ((signed int (*)(void *__anonymous_object1425, const char *__fmt__PCc_1, ...))__fmt__Fi_P9sofstreamPCc__1), ((void *)__sout__P9sofstream_1), "char "))) , _tmp_cp_ret0)), __v__c_1))) , _tmp_cp_ret1)), ((void *(*)(void *__anonymous_object1426))(&_thunk0))))) , _tmp_cp_ret2));437 return __endl__A0_1_0_0___sepPrt__PFb_Pd0___sepReset__PF_Pd0___sepReset__PF_Pd0b___sepGetCur__PFPCc_Pd0___sepSetCur__PF_Pd0PCc___getNL__PFb_Pd0___setNL__PF_Pd0b___sepOn__PF_Pd0___sepOff__PF_Pd0___sepDisable__PFb_Pd0___sepEnable__PFb_Pd0___sepGet__PFPCc_Pd0___sepSet__PF_Pd0PCc___sepGetTuple__PFPCc_Pd0___sepSetTuple__PF_Pd0PCc___fail__PFi_Pd0___flush__PFi_Pd0___open__PF_Pd0PCcPCc___close__PF_Pd0___write__PFPd0_Pd0PCcUl___fmt__PFi_Pd0PCc__FPd0_Pd0__1(((_Bool (*)(void *__anonymous_object1322))__sepPrt__Fb_P9sofstream__1), ((void (*)(void *__anonymous_object1323))__sepReset__F_P9sofstream__1), ((void (*)(void *__anonymous_object1324, _Bool __anonymous_object1325))__sepReset__F_P9sofstreamb__1), ((const char *(*)(void *__anonymous_object1326))__sepGetCur__FPCc_P9sofstream__1), ((void (*)(void *__anonymous_object1327, const char *__anonymous_object1328))__sepSetCur__F_P9sofstreamPCc__1), ((_Bool (*)(void *__anonymous_object1329))__getNL__Fb_P9sofstream__1), ((void (*)(void *__anonymous_object1330, _Bool __anonymous_object1331))__setNL__F_P9sofstreamb__1), ((void (*)(void *__anonymous_object1332))__sepOn__F_P9sofstream__1), ((void (*)(void *__anonymous_object1333))__sepOff__F_P9sofstream__1), ((_Bool (*)(void *__anonymous_object1334))__sepDisable__Fb_P9sofstream__1), ((_Bool (*)(void *__anonymous_object1335))__sepEnable__Fb_P9sofstream__1), ((const char *(*)(void *__anonymous_object1336))__sepGet__FPCc_P9sofstream__1), ((void (*)(void *__anonymous_object1337, const char *__anonymous_object1338))__sepSet__F_P9sofstreamPCc__1), ((const char *(*)(void *__anonymous_object1339))__sepGetTuple__FPCc_P9sofstream__1), ((void (*)(void *__anonymous_object1340, const char *__anonymous_object1341))__sepSetTuple__F_P9sofstreamPCc__1), ((signed int (*)(void *__anonymous_object1342))__fail__Fi_P9sofstream__1), ((signed int (*)(void *__anonymous_object1343))__flush__Fi_P9sofstream__1), ((void (*)(void *__os__P7tostype_1, const char *__name__PCc_1, const char *__mode__PCc_1))__open__F_P9sofstreamPCcPCc__1), ((void (*)(void *__os__P7tostype_1))__close__F_P9sofstream__1), ((void *(*)(void *__anonymous_object1344, const char *__anonymous_object1345, unsigned long int __anonymous_object1346))__write__FP9sofstream_P9sofstreamPCcUl__1), ((signed int (*)(void *__anonymous_object1347, const char *__fmt__PCc_1, ...))__fmt__Fi_P9sofstreamPCc__1), _p0); 438 } 439 ((void)(((void)(_tmp_cp_ret2=___operator_bitor__A0_1_0_0___sepPrt__PFb_Pd0___sepReset__PF_Pd0___sepReset__PF_Pd0b___sepGetCur__PFPCc_Pd0___sepSetCur__PF_Pd0PCc___getNL__PFb_Pd0___setNL__PF_Pd0b___sepOn__PF_Pd0___sepOff__PF_Pd0___sepDisable__PFb_Pd0___sepEnable__PFb_Pd0___sepGet__PFPCc_Pd0___sepSet__PF_Pd0PCc___sepGetTuple__PFPCc_Pd0___sepSetTuple__PF_Pd0PCc___fail__PFi_Pd0___flush__PFi_Pd0___open__PF_Pd0PCcPCc___close__PF_Pd0___write__PFPd0_Pd0PCcUl___fmt__PFi_Pd0PCc__FPd0_Pd0PFPd0_Pd0___1(((_Bool (*)(void *__anonymous_object1348))__sepPrt__Fb_P9sofstream__1), ((void (*)(void *__anonymous_object1349))__sepReset__F_P9sofstream__1), ((void (*)(void *__anonymous_object1350, _Bool __anonymous_object1351))__sepReset__F_P9sofstreamb__1), ((const char *(*)(void *__anonymous_object1352))__sepGetCur__FPCc_P9sofstream__1), ((void (*)(void *__anonymous_object1353, const char *__anonymous_object1354))__sepSetCur__F_P9sofstreamPCc__1), ((_Bool (*)(void *__anonymous_object1355))__getNL__Fb_P9sofstream__1), ((void (*)(void *__anonymous_object1356, _Bool __anonymous_object1357))__setNL__F_P9sofstreamb__1), ((void (*)(void *__anonymous_object1358))__sepOn__F_P9sofstream__1), ((void (*)(void *__anonymous_object1359))__sepOff__F_P9sofstream__1), ((_Bool (*)(void *__anonymous_object1360))__sepDisable__Fb_P9sofstream__1), ((_Bool (*)(void *__anonymous_object1361))__sepEnable__Fb_P9sofstream__1), ((const char *(*)(void *__anonymous_object1362))__sepGet__FPCc_P9sofstream__1), ((void (*)(void *__anonymous_object1363, const char *__anonymous_object1364))__sepSet__F_P9sofstreamPCc__1), ((const char *(*)(void *__anonymous_object1365))__sepGetTuple__FPCc_P9sofstream__1), ((void (*)(void *__anonymous_object1366, const char *__anonymous_object1367))__sepSetTuple__F_P9sofstreamPCc__1), ((signed int (*)(void *__anonymous_object1368))__fail__Fi_P9sofstream__1), ((signed int (*)(void *__anonymous_object1369))__flush__Fi_P9sofstream__1), ((void (*)(void *__os__P7tostype_1, const char *__name__PCc_1, const char *__mode__PCc_1))__open__F_P9sofstreamPCcPCc__1), ((void (*)(void *__os__P7tostype_1))__close__F_P9sofstream__1), ((void *(*)(void *__anonymous_object1370, const char *__anonymous_object1371, unsigned long int __anonymous_object1372))__write__FP9sofstream_P9sofstreamPCcUl__1), ((signed int (*)(void *__anonymous_object1373, const char *__fmt__PCc_1, ...))__fmt__Fi_P9sofstreamPCc__1), (((void)(_tmp_cp_ret1=___operator_bitor__A0_1_0_0___sepPrt__PFb_Pd0___sepReset__PF_Pd0___sepReset__PF_Pd0b___sepGetCur__PFPCc_Pd0___sepSetCur__PF_Pd0PCc___getNL__PFb_Pd0___setNL__PF_Pd0b___sepOn__PF_Pd0___sepOff__PF_Pd0___sepDisable__PFb_Pd0___sepEnable__PFb_Pd0___sepGet__PFPCc_Pd0___sepSet__PF_Pd0PCc___sepGetTuple__PFPCc_Pd0___sepSetTuple__PF_Pd0PCc___fail__PFi_Pd0___flush__PFi_Pd0___open__PF_Pd0PCcPCc___close__PF_Pd0___write__PFPd0_Pd0PCcUl___fmt__PFi_Pd0PCc__FPd0_Pd0c__1(((_Bool (*)(void *__anonymous_object1374))__sepPrt__Fb_P9sofstream__1), ((void (*)(void *__anonymous_object1375))__sepReset__F_P9sofstream__1), ((void (*)(void *__anonymous_object1376, _Bool __anonymous_object1377))__sepReset__F_P9sofstreamb__1), ((const char *(*)(void *__anonymous_object1378))__sepGetCur__FPCc_P9sofstream__1), ((void (*)(void *__anonymous_object1379, const char *__anonymous_object1380))__sepSetCur__F_P9sofstreamPCc__1), ((_Bool (*)(void *__anonymous_object1381))__getNL__Fb_P9sofstream__1), ((void (*)(void *__anonymous_object1382, _Bool __anonymous_object1383))__setNL__F_P9sofstreamb__1), ((void (*)(void *__anonymous_object1384))__sepOn__F_P9sofstream__1), ((void (*)(void *__anonymous_object1385))__sepOff__F_P9sofstream__1), ((_Bool (*)(void *__anonymous_object1386))__sepDisable__Fb_P9sofstream__1), ((_Bool (*)(void *__anonymous_object1387))__sepEnable__Fb_P9sofstream__1), ((const char *(*)(void *__anonymous_object1388))__sepGet__FPCc_P9sofstream__1), ((void (*)(void *__anonymous_object1389, const char *__anonymous_object1390))__sepSet__F_P9sofstreamPCc__1), ((const char *(*)(void *__anonymous_object1391))__sepGetTuple__FPCc_P9sofstream__1), ((void (*)(void *__anonymous_object1392, const char *__anonymous_object1393))__sepSetTuple__F_P9sofstreamPCc__1), ((signed int (*)(void *__anonymous_object1394))__fail__Fi_P9sofstream__1), ((signed int (*)(void *__anonymous_object1395))__flush__Fi_P9sofstream__1), ((void (*)(void *__os__P7tostype_1, const char *__name__PCc_1, const char *__mode__PCc_1))__open__F_P9sofstreamPCcPCc__1), ((void (*)(void *__os__P7tostype_1))__close__F_P9sofstream__1), ((void *(*)(void *__anonymous_object1396, const char *__anonymous_object1397, unsigned long int __anonymous_object1398))__write__FP9sofstream_P9sofstreamPCcUl__1), ((signed int (*)(void *__anonymous_object1399, const char *__fmt__PCc_1, ...))__fmt__Fi_P9sofstreamPCc__1), (((void)(_tmp_cp_ret0=___operator_bitor__A0_1_0_0___sepPrt__PFb_Pd0___sepReset__PF_Pd0___sepReset__PF_Pd0b___sepGetCur__PFPCc_Pd0___sepSetCur__PF_Pd0PCc___getNL__PFb_Pd0___setNL__PF_Pd0b___sepOn__PF_Pd0___sepOff__PF_Pd0___sepDisable__PFb_Pd0___sepEnable__PFb_Pd0___sepGet__PFPCc_Pd0___sepSet__PF_Pd0PCc___sepGetTuple__PFPCc_Pd0___sepSetTuple__PF_Pd0PCc___fail__PFi_Pd0___flush__PFi_Pd0___open__PF_Pd0PCcPCc___close__PF_Pd0___write__PFPd0_Pd0PCcUl___fmt__PFi_Pd0PCc__FPd0_Pd0PCc__1(((_Bool (*)(void *__anonymous_object1400))__sepPrt__Fb_P9sofstream__1), ((void (*)(void *__anonymous_object1401))__sepReset__F_P9sofstream__1), ((void (*)(void *__anonymous_object1402, _Bool __anonymous_object1403))__sepReset__F_P9sofstreamb__1), ((const char *(*)(void *__anonymous_object1404))__sepGetCur__FPCc_P9sofstream__1), ((void (*)(void *__anonymous_object1405, const char *__anonymous_object1406))__sepSetCur__F_P9sofstreamPCc__1), ((_Bool (*)(void *__anonymous_object1407))__getNL__Fb_P9sofstream__1), ((void (*)(void *__anonymous_object1408, _Bool __anonymous_object1409))__setNL__F_P9sofstreamb__1), ((void (*)(void *__anonymous_object1410))__sepOn__F_P9sofstream__1), ((void (*)(void *__anonymous_object1411))__sepOff__F_P9sofstream__1), ((_Bool (*)(void *__anonymous_object1412))__sepDisable__Fb_P9sofstream__1), ((_Bool (*)(void *__anonymous_object1413))__sepEnable__Fb_P9sofstream__1), ((const char *(*)(void *__anonymous_object1414))__sepGet__FPCc_P9sofstream__1), ((void (*)(void *__anonymous_object1415, const char *__anonymous_object1416))__sepSet__F_P9sofstreamPCc__1), ((const char *(*)(void *__anonymous_object1417))__sepGetTuple__FPCc_P9sofstream__1), ((void (*)(void *__anonymous_object1418, const char *__anonymous_object1419))__sepSetTuple__F_P9sofstreamPCc__1), ((signed int (*)(void *__anonymous_object1420))__fail__Fi_P9sofstream__1), ((signed int (*)(void *__anonymous_object1421))__flush__Fi_P9sofstream__1), ((void (*)(void *__os__P7tostype_1, const char *__name__PCc_1, const char *__mode__PCc_1))__open__F_P9sofstreamPCcPCc__1), ((void (*)(void *__os__P7tostype_1))__close__F_P9sofstream__1), ((void *(*)(void *__anonymous_object1422, const char *__anonymous_object1423, unsigned long int __anonymous_object1424))__write__FP9sofstream_P9sofstreamPCcUl__1), ((signed int (*)(void *__anonymous_object1425, const char *__fmt__PCc_1, ...))__fmt__Fi_P9sofstreamPCc__1), __sout__P9sofstream_1, "char "))) , _tmp_cp_ret0), __v__c_1))) , _tmp_cp_ret1), ((void *(*)(void *__anonymous_object1426))(&_thunk0))))) , _tmp_cp_ret2)); 471 440 ((void)(_tmp_cp_ret0) /* ^?{} */); 472 441 ((void)(_tmp_cp_ret1) /* ^?{} */); … … 478 447 struct ofstream *_tmp_cp_ret5; 479 448 __attribute__ ((unused)) struct ofstream *_thunk1(struct ofstream *_p0){ 480 return __endl__A0_1_0_0___sepPrt__PFb_Pd0___sepReset__PF_Pd0___sepReset__PF_Pd0b___sepGetCur__PFPCc_Pd0___sepSetCur__PF_Pd0PCc___getNL__PFb_Pd0___setNL__PF_Pd0b___sepOn__PF_Pd0___sepOff__PF_Pd0___sepDisable__PFb_Pd0___sepEnable__PFb_Pd0___sepGet__PFPCc_Pd0___sepSet__PF_Pd0PCc___sepGetTuple__PFPCc_Pd0___sepSetTuple__PF_Pd0PCc___fail__PFi_Pd0___flush__PFi_Pd0___open__PF_Pd0PCcPCc___close__PF_Pd0___write__PFPd0_Pd0PCcUl___fmt__PFi_Pd0PCc__FPd0_Pd0__1(((_Bool (*)(void *__anonymous_object1427))__sepPrt__Fb_P9sofstream__1), ((void (*)(void *__anonymous_object1428))__sepReset__F_P9sofstream__1), ((void (*)(void *__anonymous_object1429, _Bool __anonymous_object1430))__sepReset__F_P9sofstreamb__1), ((const char *(*)(void *__anonymous_object1431))__sepGetCur__FPCc_P9sofstream__1), ((void (*)(void *__anonymous_object1432, const char *__anonymous_object1433))__sepSetCur__F_P9sofstreamPCc__1), ((_Bool (*)(void *__anonymous_object1434))__getNL__Fb_P9sofstream__1), ((void (*)(void *__anonymous_object1435, _Bool __anonymous_object1436))__setNL__F_P9sofstreamb__1), ((void (*)(void *__anonymous_object1437))__sepOn__F_P9sofstream__1), ((void (*)(void *__anonymous_object1438))__sepOff__F_P9sofstream__1), ((_Bool (*)(void *__anonymous_object1439))__sepDisable__Fb_P9sofstream__1), ((_Bool (*)(void *__anonymous_object1440))__sepEnable__Fb_P9sofstream__1), ((const char *(*)(void *__anonymous_object1441))__sepGet__FPCc_P9sofstream__1), ((void (*)(void *__anonymous_object1442, const char *__anonymous_object1443))__sepSet__F_P9sofstreamPCc__1), ((const char *(*)(void *__anonymous_object1444))__sepGetTuple__FPCc_P9sofstream__1), ((void (*)(void *__anonymous_object1445, const char *__anonymous_object1446))__sepSetTuple__F_P9sofstreamPCc__1), ((signed int (*)(void *__anonymous_object1447))__fail__Fi_P9sofstream__1), ((signed int (*)(void *__anonymous_object1448))__flush__Fi_P9sofstream__1), ((void (*)(void *__os__P7tostype_1, const char *__name__PCc_1, const char *__mode__PCc_1))__open__F_P9sofstreamPCcPCc__1), ((void (*)(void *__os__P7tostype_1))__close__F_P9sofstream__1), ((void *(*)(void *__anonymous_object1449, const char *__anonymous_object1450, unsigned long int __anonymous_object1451))__write__FP9sofstream_P9sofstreamPCcUl__1), ((signed int (*)(void *__anonymous_object1452, const char *__fmt__PCc_1, ...))__fmt__Fi_P9sofstreamPCc__1), ((void *)_p0));481 } 482 ((void)(((void)(_tmp_cp_ret5=___operator_bitor__A0_1_0_0___sepPrt__PFb_Pd0___sepReset__PF_Pd0___sepReset__PF_Pd0b___sepGetCur__PFPCc_Pd0___sepSetCur__PF_Pd0PCc___getNL__PFb_Pd0___setNL__PF_Pd0b___sepOn__PF_Pd0___sepOff__PF_Pd0___sepDisable__PFb_Pd0___sepEnable__PFb_Pd0___sepGet__PFPCc_Pd0___sepSet__PF_Pd0PCc___sepGetTuple__PFPCc_Pd0___sepSetTuple__PF_Pd0PCc___fail__PFi_Pd0___flush__PFi_Pd0___open__PF_Pd0PCcPCc___close__PF_Pd0___write__PFPd0_Pd0PCcUl___fmt__PFi_Pd0PCc__FPd0_Pd0PFPd0_Pd0___1(((_Bool (*)(void *__anonymous_object1453))__sepPrt__Fb_P9sofstream__1), ((void (*)(void *__anonymous_object1454))__sepReset__F_P9sofstream__1), ((void (*)(void *__anonymous_object1455, _Bool __anonymous_object1456))__sepReset__F_P9sofstreamb__1), ((const char *(*)(void *__anonymous_object1457))__sepGetCur__FPCc_P9sofstream__1), ((void (*)(void *__anonymous_object1458, const char *__anonymous_object1459))__sepSetCur__F_P9sofstreamPCc__1), ((_Bool (*)(void *__anonymous_object1460))__getNL__Fb_P9sofstream__1), ((void (*)(void *__anonymous_object1461, _Bool __anonymous_object1462))__setNL__F_P9sofstreamb__1), ((void (*)(void *__anonymous_object1463))__sepOn__F_P9sofstream__1), ((void (*)(void *__anonymous_object1464))__sepOff__F_P9sofstream__1), ((_Bool (*)(void *__anonymous_object1465))__sepDisable__Fb_P9sofstream__1), ((_Bool (*)(void *__anonymous_object1466))__sepEnable__Fb_P9sofstream__1), ((const char *(*)(void *__anonymous_object1467))__sepGet__FPCc_P9sofstream__1), ((void (*)(void *__anonymous_object1468, const char *__anonymous_object1469))__sepSet__F_P9sofstreamPCc__1), ((const char *(*)(void *__anonymous_object1470))__sepGetTuple__FPCc_P9sofstream__1), ((void (*)(void *__anonymous_object1471, const char *__anonymous_object1472))__sepSetTuple__F_P9sofstreamPCc__1), ((signed int (*)(void *__anonymous_object1473))__fail__Fi_P9sofstream__1), ((signed int (*)(void *__anonymous_object1474))__flush__Fi_P9sofstream__1), ((void (*)(void *__os__P7tostype_1, const char *__name__PCc_1, const char *__mode__PCc_1))__open__F_P9sofstreamPCcPCc__1), ((void (*)(void *__os__P7tostype_1))__close__F_P9sofstream__1), ((void *(*)(void *__anonymous_object1475, const char *__anonymous_object1476, unsigned long int __anonymous_object1477))__write__FP9sofstream_P9sofstreamPCcUl__1), ((signed int (*)(void *__anonymous_object1478, const char *__fmt__PCc_1, ...))__fmt__Fi_P9sofstreamPCc__1), (( void *)(((void)(_tmp_cp_ret4=___operator_bitor__A0_1_0_0___sepPrt__PFb_Pd0___sepReset__PF_Pd0___sepReset__PF_Pd0b___sepGetCur__PFPCc_Pd0___sepSetCur__PF_Pd0PCc___getNL__PFb_Pd0___setNL__PF_Pd0b___sepOn__PF_Pd0___sepOff__PF_Pd0___sepDisable__PFb_Pd0___sepEnable__PFb_Pd0___sepGet__PFPCc_Pd0___sepSet__PF_Pd0PCc___sepGetTuple__PFPCc_Pd0___sepSetTuple__PF_Pd0PCc___fail__PFi_Pd0___flush__PFi_Pd0___open__PF_Pd0PCcPCc___close__PF_Pd0___write__PFPd0_Pd0PCcUl___fmt__PFi_Pd0PCc__FPd0_Pd0Sc__1(((_Bool (*)(void *__anonymous_object1479))__sepPrt__Fb_P9sofstream__1), ((void (*)(void *__anonymous_object1480))__sepReset__F_P9sofstream__1), ((void (*)(void *__anonymous_object1481, _Bool __anonymous_object1482))__sepReset__F_P9sofstreamb__1), ((const char *(*)(void *__anonymous_object1483))__sepGetCur__FPCc_P9sofstream__1), ((void (*)(void *__anonymous_object1484, const char *__anonymous_object1485))__sepSetCur__F_P9sofstreamPCc__1), ((_Bool (*)(void *__anonymous_object1486))__getNL__Fb_P9sofstream__1), ((void (*)(void *__anonymous_object1487, _Bool __anonymous_object1488))__setNL__F_P9sofstreamb__1), ((void (*)(void *__anonymous_object1489))__sepOn__F_P9sofstream__1), ((void (*)(void *__anonymous_object1490))__sepOff__F_P9sofstream__1), ((_Bool (*)(void *__anonymous_object1491))__sepDisable__Fb_P9sofstream__1), ((_Bool (*)(void *__anonymous_object1492))__sepEnable__Fb_P9sofstream__1), ((const char *(*)(void *__anonymous_object1493))__sepGet__FPCc_P9sofstream__1), ((void (*)(void *__anonymous_object1494, const char *__anonymous_object1495))__sepSet__F_P9sofstreamPCc__1), ((const char *(*)(void *__anonymous_object1496))__sepGetTuple__FPCc_P9sofstream__1), ((void (*)(void *__anonymous_object1497, const char *__anonymous_object1498))__sepSetTuple__F_P9sofstreamPCc__1), ((signed int (*)(void *__anonymous_object1499))__fail__Fi_P9sofstream__1), ((signed int (*)(void *__anonymous_object1500))__flush__Fi_P9sofstream__1), ((void (*)(void *__os__P7tostype_1, const char *__name__PCc_1, const char *__mode__PCc_1))__open__F_P9sofstreamPCcPCc__1), ((void (*)(void *__os__P7tostype_1))__close__F_P9sofstream__1), ((void *(*)(void *__anonymous_object1501, const char *__anonymous_object1502, unsigned long int __anonymous_object1503))__write__FP9sofstream_P9sofstreamPCcUl__1), ((signed int (*)(void *__anonymous_object1504, const char *__fmt__PCc_1, ...))__fmt__Fi_P9sofstreamPCc__1), ((void *)(((void)(_tmp_cp_ret3=___operator_bitor__A0_1_0_0___sepPrt__PFb_Pd0___sepReset__PF_Pd0___sepReset__PF_Pd0b___sepGetCur__PFPCc_Pd0___sepSetCur__PF_Pd0PCc___getNL__PFb_Pd0___setNL__PF_Pd0b___sepOn__PF_Pd0___sepOff__PF_Pd0___sepDisable__PFb_Pd0___sepEnable__PFb_Pd0___sepGet__PFPCc_Pd0___sepSet__PF_Pd0PCc___sepGetTuple__PFPCc_Pd0___sepSetTuple__PF_Pd0PCc___fail__PFi_Pd0___flush__PFi_Pd0___open__PF_Pd0PCcPCc___close__PF_Pd0___write__PFPd0_Pd0PCcUl___fmt__PFi_Pd0PCc__FPd0_Pd0PCc__1(((_Bool (*)(void *__anonymous_object1505))__sepPrt__Fb_P9sofstream__1), ((void (*)(void *__anonymous_object1506))__sepReset__F_P9sofstream__1), ((void (*)(void *__anonymous_object1507, _Bool __anonymous_object1508))__sepReset__F_P9sofstreamb__1), ((const char *(*)(void *__anonymous_object1509))__sepGetCur__FPCc_P9sofstream__1), ((void (*)(void *__anonymous_object1510, const char *__anonymous_object1511))__sepSetCur__F_P9sofstreamPCc__1), ((_Bool (*)(void *__anonymous_object1512))__getNL__Fb_P9sofstream__1), ((void (*)(void *__anonymous_object1513, _Bool __anonymous_object1514))__setNL__F_P9sofstreamb__1), ((void (*)(void *__anonymous_object1515))__sepOn__F_P9sofstream__1), ((void (*)(void *__anonymous_object1516))__sepOff__F_P9sofstream__1), ((_Bool (*)(void *__anonymous_object1517))__sepDisable__Fb_P9sofstream__1), ((_Bool (*)(void *__anonymous_object1518))__sepEnable__Fb_P9sofstream__1), ((const char *(*)(void *__anonymous_object1519))__sepGet__FPCc_P9sofstream__1), ((void (*)(void *__anonymous_object1520, const char *__anonymous_object1521))__sepSet__F_P9sofstreamPCc__1), ((const char *(*)(void *__anonymous_object1522))__sepGetTuple__FPCc_P9sofstream__1), ((void (*)(void *__anonymous_object1523, const char *__anonymous_object1524))__sepSetTuple__F_P9sofstreamPCc__1), ((signed int (*)(void *__anonymous_object1525))__fail__Fi_P9sofstream__1), ((signed int (*)(void *__anonymous_object1526))__flush__Fi_P9sofstream__1), ((void (*)(void *__os__P7tostype_1, const char *__name__PCc_1, const char *__mode__PCc_1))__open__F_P9sofstreamPCcPCc__1), ((void (*)(void *__os__P7tostype_1))__close__F_P9sofstream__1), ((void *(*)(void *__anonymous_object1527, const char *__anonymous_object1528, unsigned long int __anonymous_object1529))__write__FP9sofstream_P9sofstreamPCcUl__1), ((signed int (*)(void *__anonymous_object1530, const char *__fmt__PCc_1, ...))__fmt__Fi_P9sofstreamPCc__1), ((void *)__sout__P9sofstream_1), "signed char "))) , _tmp_cp_ret3)), __v__Sc_1))) , _tmp_cp_ret4)), ((void *(*)(void *__anonymous_object1531))(&_thunk1))))) , _tmp_cp_ret5));449 return __endl__A0_1_0_0___sepPrt__PFb_Pd0___sepReset__PF_Pd0___sepReset__PF_Pd0b___sepGetCur__PFPCc_Pd0___sepSetCur__PF_Pd0PCc___getNL__PFb_Pd0___setNL__PF_Pd0b___sepOn__PF_Pd0___sepOff__PF_Pd0___sepDisable__PFb_Pd0___sepEnable__PFb_Pd0___sepGet__PFPCc_Pd0___sepSet__PF_Pd0PCc___sepGetTuple__PFPCc_Pd0___sepSetTuple__PF_Pd0PCc___fail__PFi_Pd0___flush__PFi_Pd0___open__PF_Pd0PCcPCc___close__PF_Pd0___write__PFPd0_Pd0PCcUl___fmt__PFi_Pd0PCc__FPd0_Pd0__1(((_Bool (*)(void *__anonymous_object1427))__sepPrt__Fb_P9sofstream__1), ((void (*)(void *__anonymous_object1428))__sepReset__F_P9sofstream__1), ((void (*)(void *__anonymous_object1429, _Bool __anonymous_object1430))__sepReset__F_P9sofstreamb__1), ((const char *(*)(void *__anonymous_object1431))__sepGetCur__FPCc_P9sofstream__1), ((void (*)(void *__anonymous_object1432, const char *__anonymous_object1433))__sepSetCur__F_P9sofstreamPCc__1), ((_Bool (*)(void *__anonymous_object1434))__getNL__Fb_P9sofstream__1), ((void (*)(void *__anonymous_object1435, _Bool __anonymous_object1436))__setNL__F_P9sofstreamb__1), ((void (*)(void *__anonymous_object1437))__sepOn__F_P9sofstream__1), ((void (*)(void *__anonymous_object1438))__sepOff__F_P9sofstream__1), ((_Bool (*)(void *__anonymous_object1439))__sepDisable__Fb_P9sofstream__1), ((_Bool (*)(void *__anonymous_object1440))__sepEnable__Fb_P9sofstream__1), ((const char *(*)(void *__anonymous_object1441))__sepGet__FPCc_P9sofstream__1), ((void (*)(void *__anonymous_object1442, const char *__anonymous_object1443))__sepSet__F_P9sofstreamPCc__1), ((const char *(*)(void *__anonymous_object1444))__sepGetTuple__FPCc_P9sofstream__1), ((void (*)(void *__anonymous_object1445, const char *__anonymous_object1446))__sepSetTuple__F_P9sofstreamPCc__1), ((signed int (*)(void *__anonymous_object1447))__fail__Fi_P9sofstream__1), ((signed int (*)(void *__anonymous_object1448))__flush__Fi_P9sofstream__1), ((void (*)(void *__os__P7tostype_1, const char *__name__PCc_1, const char *__mode__PCc_1))__open__F_P9sofstreamPCcPCc__1), ((void (*)(void *__os__P7tostype_1))__close__F_P9sofstream__1), ((void *(*)(void *__anonymous_object1449, const char *__anonymous_object1450, unsigned long int __anonymous_object1451))__write__FP9sofstream_P9sofstreamPCcUl__1), ((signed int (*)(void *__anonymous_object1452, const char *__fmt__PCc_1, ...))__fmt__Fi_P9sofstreamPCc__1), _p0); 450 } 451 ((void)(((void)(_tmp_cp_ret5=___operator_bitor__A0_1_0_0___sepPrt__PFb_Pd0___sepReset__PF_Pd0___sepReset__PF_Pd0b___sepGetCur__PFPCc_Pd0___sepSetCur__PF_Pd0PCc___getNL__PFb_Pd0___setNL__PF_Pd0b___sepOn__PF_Pd0___sepOff__PF_Pd0___sepDisable__PFb_Pd0___sepEnable__PFb_Pd0___sepGet__PFPCc_Pd0___sepSet__PF_Pd0PCc___sepGetTuple__PFPCc_Pd0___sepSetTuple__PF_Pd0PCc___fail__PFi_Pd0___flush__PFi_Pd0___open__PF_Pd0PCcPCc___close__PF_Pd0___write__PFPd0_Pd0PCcUl___fmt__PFi_Pd0PCc__FPd0_Pd0PFPd0_Pd0___1(((_Bool (*)(void *__anonymous_object1453))__sepPrt__Fb_P9sofstream__1), ((void (*)(void *__anonymous_object1454))__sepReset__F_P9sofstream__1), ((void (*)(void *__anonymous_object1455, _Bool __anonymous_object1456))__sepReset__F_P9sofstreamb__1), ((const char *(*)(void *__anonymous_object1457))__sepGetCur__FPCc_P9sofstream__1), ((void (*)(void *__anonymous_object1458, const char *__anonymous_object1459))__sepSetCur__F_P9sofstreamPCc__1), ((_Bool (*)(void *__anonymous_object1460))__getNL__Fb_P9sofstream__1), ((void (*)(void *__anonymous_object1461, _Bool __anonymous_object1462))__setNL__F_P9sofstreamb__1), ((void (*)(void *__anonymous_object1463))__sepOn__F_P9sofstream__1), ((void (*)(void *__anonymous_object1464))__sepOff__F_P9sofstream__1), ((_Bool (*)(void *__anonymous_object1465))__sepDisable__Fb_P9sofstream__1), ((_Bool (*)(void *__anonymous_object1466))__sepEnable__Fb_P9sofstream__1), ((const char *(*)(void *__anonymous_object1467))__sepGet__FPCc_P9sofstream__1), ((void (*)(void *__anonymous_object1468, const char *__anonymous_object1469))__sepSet__F_P9sofstreamPCc__1), ((const char *(*)(void *__anonymous_object1470))__sepGetTuple__FPCc_P9sofstream__1), ((void (*)(void *__anonymous_object1471, const char *__anonymous_object1472))__sepSetTuple__F_P9sofstreamPCc__1), ((signed int (*)(void *__anonymous_object1473))__fail__Fi_P9sofstream__1), ((signed int (*)(void *__anonymous_object1474))__flush__Fi_P9sofstream__1), ((void (*)(void *__os__P7tostype_1, const char *__name__PCc_1, const char *__mode__PCc_1))__open__F_P9sofstreamPCcPCc__1), ((void (*)(void *__os__P7tostype_1))__close__F_P9sofstream__1), ((void *(*)(void *__anonymous_object1475, const char *__anonymous_object1476, unsigned long int __anonymous_object1477))__write__FP9sofstream_P9sofstreamPCcUl__1), ((signed int (*)(void *__anonymous_object1478, const char *__fmt__PCc_1, ...))__fmt__Fi_P9sofstreamPCc__1), (((void)(_tmp_cp_ret4=___operator_bitor__A0_1_0_0___sepPrt__PFb_Pd0___sepReset__PF_Pd0___sepReset__PF_Pd0b___sepGetCur__PFPCc_Pd0___sepSetCur__PF_Pd0PCc___getNL__PFb_Pd0___setNL__PF_Pd0b___sepOn__PF_Pd0___sepOff__PF_Pd0___sepDisable__PFb_Pd0___sepEnable__PFb_Pd0___sepGet__PFPCc_Pd0___sepSet__PF_Pd0PCc___sepGetTuple__PFPCc_Pd0___sepSetTuple__PF_Pd0PCc___fail__PFi_Pd0___flush__PFi_Pd0___open__PF_Pd0PCcPCc___close__PF_Pd0___write__PFPd0_Pd0PCcUl___fmt__PFi_Pd0PCc__FPd0_Pd0Sc__1(((_Bool (*)(void *__anonymous_object1479))__sepPrt__Fb_P9sofstream__1), ((void (*)(void *__anonymous_object1480))__sepReset__F_P9sofstream__1), ((void (*)(void *__anonymous_object1481, _Bool __anonymous_object1482))__sepReset__F_P9sofstreamb__1), ((const char *(*)(void *__anonymous_object1483))__sepGetCur__FPCc_P9sofstream__1), ((void (*)(void *__anonymous_object1484, const char *__anonymous_object1485))__sepSetCur__F_P9sofstreamPCc__1), ((_Bool (*)(void *__anonymous_object1486))__getNL__Fb_P9sofstream__1), ((void (*)(void *__anonymous_object1487, _Bool __anonymous_object1488))__setNL__F_P9sofstreamb__1), ((void (*)(void *__anonymous_object1489))__sepOn__F_P9sofstream__1), ((void (*)(void *__anonymous_object1490))__sepOff__F_P9sofstream__1), ((_Bool (*)(void *__anonymous_object1491))__sepDisable__Fb_P9sofstream__1), ((_Bool (*)(void *__anonymous_object1492))__sepEnable__Fb_P9sofstream__1), ((const char *(*)(void *__anonymous_object1493))__sepGet__FPCc_P9sofstream__1), ((void (*)(void *__anonymous_object1494, const char *__anonymous_object1495))__sepSet__F_P9sofstreamPCc__1), ((const char *(*)(void *__anonymous_object1496))__sepGetTuple__FPCc_P9sofstream__1), ((void (*)(void *__anonymous_object1497, const char *__anonymous_object1498))__sepSetTuple__F_P9sofstreamPCc__1), ((signed int (*)(void *__anonymous_object1499))__fail__Fi_P9sofstream__1), ((signed int (*)(void *__anonymous_object1500))__flush__Fi_P9sofstream__1), ((void (*)(void *__os__P7tostype_1, const char *__name__PCc_1, const char *__mode__PCc_1))__open__F_P9sofstreamPCcPCc__1), ((void (*)(void *__os__P7tostype_1))__close__F_P9sofstream__1), ((void *(*)(void *__anonymous_object1501, const char *__anonymous_object1502, unsigned long int __anonymous_object1503))__write__FP9sofstream_P9sofstreamPCcUl__1), ((signed int (*)(void *__anonymous_object1504, const char *__fmt__PCc_1, ...))__fmt__Fi_P9sofstreamPCc__1), (((void)(_tmp_cp_ret3=___operator_bitor__A0_1_0_0___sepPrt__PFb_Pd0___sepReset__PF_Pd0___sepReset__PF_Pd0b___sepGetCur__PFPCc_Pd0___sepSetCur__PF_Pd0PCc___getNL__PFb_Pd0___setNL__PF_Pd0b___sepOn__PF_Pd0___sepOff__PF_Pd0___sepDisable__PFb_Pd0___sepEnable__PFb_Pd0___sepGet__PFPCc_Pd0___sepSet__PF_Pd0PCc___sepGetTuple__PFPCc_Pd0___sepSetTuple__PF_Pd0PCc___fail__PFi_Pd0___flush__PFi_Pd0___open__PF_Pd0PCcPCc___close__PF_Pd0___write__PFPd0_Pd0PCcUl___fmt__PFi_Pd0PCc__FPd0_Pd0PCc__1(((_Bool (*)(void *__anonymous_object1505))__sepPrt__Fb_P9sofstream__1), ((void (*)(void *__anonymous_object1506))__sepReset__F_P9sofstream__1), ((void (*)(void *__anonymous_object1507, _Bool __anonymous_object1508))__sepReset__F_P9sofstreamb__1), ((const char *(*)(void *__anonymous_object1509))__sepGetCur__FPCc_P9sofstream__1), ((void (*)(void *__anonymous_object1510, const char *__anonymous_object1511))__sepSetCur__F_P9sofstreamPCc__1), ((_Bool (*)(void *__anonymous_object1512))__getNL__Fb_P9sofstream__1), ((void (*)(void *__anonymous_object1513, _Bool __anonymous_object1514))__setNL__F_P9sofstreamb__1), ((void (*)(void *__anonymous_object1515))__sepOn__F_P9sofstream__1), ((void (*)(void *__anonymous_object1516))__sepOff__F_P9sofstream__1), ((_Bool (*)(void *__anonymous_object1517))__sepDisable__Fb_P9sofstream__1), ((_Bool (*)(void *__anonymous_object1518))__sepEnable__Fb_P9sofstream__1), ((const char *(*)(void *__anonymous_object1519))__sepGet__FPCc_P9sofstream__1), ((void (*)(void *__anonymous_object1520, const char *__anonymous_object1521))__sepSet__F_P9sofstreamPCc__1), ((const char *(*)(void *__anonymous_object1522))__sepGetTuple__FPCc_P9sofstream__1), ((void (*)(void *__anonymous_object1523, const char *__anonymous_object1524))__sepSetTuple__F_P9sofstreamPCc__1), ((signed int (*)(void *__anonymous_object1525))__fail__Fi_P9sofstream__1), ((signed int (*)(void *__anonymous_object1526))__flush__Fi_P9sofstream__1), ((void (*)(void *__os__P7tostype_1, const char *__name__PCc_1, const char *__mode__PCc_1))__open__F_P9sofstreamPCcPCc__1), ((void (*)(void *__os__P7tostype_1))__close__F_P9sofstream__1), ((void *(*)(void *__anonymous_object1527, const char *__anonymous_object1528, unsigned long int __anonymous_object1529))__write__FP9sofstream_P9sofstreamPCcUl__1), ((signed int (*)(void *__anonymous_object1530, const char *__fmt__PCc_1, ...))__fmt__Fi_P9sofstreamPCc__1), __sout__P9sofstream_1, "signed char "))) , _tmp_cp_ret3), __v__Sc_1))) , _tmp_cp_ret4), ((void *(*)(void *__anonymous_object1531))(&_thunk1))))) , _tmp_cp_ret5)); 483 452 ((void)(_tmp_cp_ret3) /* ^?{} */); 484 453 ((void)(_tmp_cp_ret4) /* ^?{} */); … … 490 459 struct ofstream *_tmp_cp_ret8; 491 460 __attribute__ ((unused)) struct ofstream *_thunk2(struct ofstream *_p0){ 492 return __endl__A0_1_0_0___sepPrt__PFb_Pd0___sepReset__PF_Pd0___sepReset__PF_Pd0b___sepGetCur__PFPCc_Pd0___sepSetCur__PF_Pd0PCc___getNL__PFb_Pd0___setNL__PF_Pd0b___sepOn__PF_Pd0___sepOff__PF_Pd0___sepDisable__PFb_Pd0___sepEnable__PFb_Pd0___sepGet__PFPCc_Pd0___sepSet__PF_Pd0PCc___sepGetTuple__PFPCc_Pd0___sepSetTuple__PF_Pd0PCc___fail__PFi_Pd0___flush__PFi_Pd0___open__PF_Pd0PCcPCc___close__PF_Pd0___write__PFPd0_Pd0PCcUl___fmt__PFi_Pd0PCc__FPd0_Pd0__1(((_Bool (*)(void *__anonymous_object1532))__sepPrt__Fb_P9sofstream__1), ((void (*)(void *__anonymous_object1533))__sepReset__F_P9sofstream__1), ((void (*)(void *__anonymous_object1534, _Bool __anonymous_object1535))__sepReset__F_P9sofstreamb__1), ((const char *(*)(void *__anonymous_object1536))__sepGetCur__FPCc_P9sofstream__1), ((void (*)(void *__anonymous_object1537, const char *__anonymous_object1538))__sepSetCur__F_P9sofstreamPCc__1), ((_Bool (*)(void *__anonymous_object1539))__getNL__Fb_P9sofstream__1), ((void (*)(void *__anonymous_object1540, _Bool __anonymous_object1541))__setNL__F_P9sofstreamb__1), ((void (*)(void *__anonymous_object1542))__sepOn__F_P9sofstream__1), ((void (*)(void *__anonymous_object1543))__sepOff__F_P9sofstream__1), ((_Bool (*)(void *__anonymous_object1544))__sepDisable__Fb_P9sofstream__1), ((_Bool (*)(void *__anonymous_object1545))__sepEnable__Fb_P9sofstream__1), ((const char *(*)(void *__anonymous_object1546))__sepGet__FPCc_P9sofstream__1), ((void (*)(void *__anonymous_object1547, const char *__anonymous_object1548))__sepSet__F_P9sofstreamPCc__1), ((const char *(*)(void *__anonymous_object1549))__sepGetTuple__FPCc_P9sofstream__1), ((void (*)(void *__anonymous_object1550, const char *__anonymous_object1551))__sepSetTuple__F_P9sofstreamPCc__1), ((signed int (*)(void *__anonymous_object1552))__fail__Fi_P9sofstream__1), ((signed int (*)(void *__anonymous_object1553))__flush__Fi_P9sofstream__1), ((void (*)(void *__os__P7tostype_1, const char *__name__PCc_1, const char *__mode__PCc_1))__open__F_P9sofstreamPCcPCc__1), ((void (*)(void *__os__P7tostype_1))__close__F_P9sofstream__1), ((void *(*)(void *__anonymous_object1554, const char *__anonymous_object1555, unsigned long int __anonymous_object1556))__write__FP9sofstream_P9sofstreamPCcUl__1), ((signed int (*)(void *__anonymous_object1557, const char *__fmt__PCc_1, ...))__fmt__Fi_P9sofstreamPCc__1), ((void *)_p0));493 } 494 ((void)(((void)(_tmp_cp_ret8=___operator_bitor__A0_1_0_0___sepPrt__PFb_Pd0___sepReset__PF_Pd0___sepReset__PF_Pd0b___sepGetCur__PFPCc_Pd0___sepSetCur__PF_Pd0PCc___getNL__PFb_Pd0___setNL__PF_Pd0b___sepOn__PF_Pd0___sepOff__PF_Pd0___sepDisable__PFb_Pd0___sepEnable__PFb_Pd0___sepGet__PFPCc_Pd0___sepSet__PF_Pd0PCc___sepGetTuple__PFPCc_Pd0___sepSetTuple__PF_Pd0PCc___fail__PFi_Pd0___flush__PFi_Pd0___open__PF_Pd0PCcPCc___close__PF_Pd0___write__PFPd0_Pd0PCcUl___fmt__PFi_Pd0PCc__FPd0_Pd0PFPd0_Pd0___1(((_Bool (*)(void *__anonymous_object1558))__sepPrt__Fb_P9sofstream__1), ((void (*)(void *__anonymous_object1559))__sepReset__F_P9sofstream__1), ((void (*)(void *__anonymous_object1560, _Bool __anonymous_object1561))__sepReset__F_P9sofstreamb__1), ((const char *(*)(void *__anonymous_object1562))__sepGetCur__FPCc_P9sofstream__1), ((void (*)(void *__anonymous_object1563, const char *__anonymous_object1564))__sepSetCur__F_P9sofstreamPCc__1), ((_Bool (*)(void *__anonymous_object1565))__getNL__Fb_P9sofstream__1), ((void (*)(void *__anonymous_object1566, _Bool __anonymous_object1567))__setNL__F_P9sofstreamb__1), ((void (*)(void *__anonymous_object1568))__sepOn__F_P9sofstream__1), ((void (*)(void *__anonymous_object1569))__sepOff__F_P9sofstream__1), ((_Bool (*)(void *__anonymous_object1570))__sepDisable__Fb_P9sofstream__1), ((_Bool (*)(void *__anonymous_object1571))__sepEnable__Fb_P9sofstream__1), ((const char *(*)(void *__anonymous_object1572))__sepGet__FPCc_P9sofstream__1), ((void (*)(void *__anonymous_object1573, const char *__anonymous_object1574))__sepSet__F_P9sofstreamPCc__1), ((const char *(*)(void *__anonymous_object1575))__sepGetTuple__FPCc_P9sofstream__1), ((void (*)(void *__anonymous_object1576, const char *__anonymous_object1577))__sepSetTuple__F_P9sofstreamPCc__1), ((signed int (*)(void *__anonymous_object1578))__fail__Fi_P9sofstream__1), ((signed int (*)(void *__anonymous_object1579))__flush__Fi_P9sofstream__1), ((void (*)(void *__os__P7tostype_1, const char *__name__PCc_1, const char *__mode__PCc_1))__open__F_P9sofstreamPCcPCc__1), ((void (*)(void *__os__P7tostype_1))__close__F_P9sofstream__1), ((void *(*)(void *__anonymous_object1580, const char *__anonymous_object1581, unsigned long int __anonymous_object1582))__write__FP9sofstream_P9sofstreamPCcUl__1), ((signed int (*)(void *__anonymous_object1583, const char *__fmt__PCc_1, ...))__fmt__Fi_P9sofstreamPCc__1), (( void *)(((void)(_tmp_cp_ret7=___operator_bitor__A0_1_0_0___sepPrt__PFb_Pd0___sepReset__PF_Pd0___sepReset__PF_Pd0b___sepGetCur__PFPCc_Pd0___sepSetCur__PF_Pd0PCc___getNL__PFb_Pd0___setNL__PF_Pd0b___sepOn__PF_Pd0___sepOff__PF_Pd0___sepDisable__PFb_Pd0___sepEnable__PFb_Pd0___sepGet__PFPCc_Pd0___sepSet__PF_Pd0PCc___sepGetTuple__PFPCc_Pd0___sepSetTuple__PF_Pd0PCc___fail__PFi_Pd0___flush__PFi_Pd0___open__PF_Pd0PCcPCc___close__PF_Pd0___write__PFPd0_Pd0PCcUl___fmt__PFi_Pd0PCc__FPd0_Pd0Uc__1(((_Bool (*)(void *__anonymous_object1584))__sepPrt__Fb_P9sofstream__1), ((void (*)(void *__anonymous_object1585))__sepReset__F_P9sofstream__1), ((void (*)(void *__anonymous_object1586, _Bool __anonymous_object1587))__sepReset__F_P9sofstreamb__1), ((const char *(*)(void *__anonymous_object1588))__sepGetCur__FPCc_P9sofstream__1), ((void (*)(void *__anonymous_object1589, const char *__anonymous_object1590))__sepSetCur__F_P9sofstreamPCc__1), ((_Bool (*)(void *__anonymous_object1591))__getNL__Fb_P9sofstream__1), ((void (*)(void *__anonymous_object1592, _Bool __anonymous_object1593))__setNL__F_P9sofstreamb__1), ((void (*)(void *__anonymous_object1594))__sepOn__F_P9sofstream__1), ((void (*)(void *__anonymous_object1595))__sepOff__F_P9sofstream__1), ((_Bool (*)(void *__anonymous_object1596))__sepDisable__Fb_P9sofstream__1), ((_Bool (*)(void *__anonymous_object1597))__sepEnable__Fb_P9sofstream__1), ((const char *(*)(void *__anonymous_object1598))__sepGet__FPCc_P9sofstream__1), ((void (*)(void *__anonymous_object1599, const char *__anonymous_object1600))__sepSet__F_P9sofstreamPCc__1), ((const char *(*)(void *__anonymous_object1601))__sepGetTuple__FPCc_P9sofstream__1), ((void (*)(void *__anonymous_object1602, const char *__anonymous_object1603))__sepSetTuple__F_P9sofstreamPCc__1), ((signed int (*)(void *__anonymous_object1604))__fail__Fi_P9sofstream__1), ((signed int (*)(void *__anonymous_object1605))__flush__Fi_P9sofstream__1), ((void (*)(void *__os__P7tostype_1, const char *__name__PCc_1, const char *__mode__PCc_1))__open__F_P9sofstreamPCcPCc__1), ((void (*)(void *__os__P7tostype_1))__close__F_P9sofstream__1), ((void *(*)(void *__anonymous_object1606, const char *__anonymous_object1607, unsigned long int __anonymous_object1608))__write__FP9sofstream_P9sofstreamPCcUl__1), ((signed int (*)(void *__anonymous_object1609, const char *__fmt__PCc_1, ...))__fmt__Fi_P9sofstreamPCc__1), ((void *)(((void)(_tmp_cp_ret6=___operator_bitor__A0_1_0_0___sepPrt__PFb_Pd0___sepReset__PF_Pd0___sepReset__PF_Pd0b___sepGetCur__PFPCc_Pd0___sepSetCur__PF_Pd0PCc___getNL__PFb_Pd0___setNL__PF_Pd0b___sepOn__PF_Pd0___sepOff__PF_Pd0___sepDisable__PFb_Pd0___sepEnable__PFb_Pd0___sepGet__PFPCc_Pd0___sepSet__PF_Pd0PCc___sepGetTuple__PFPCc_Pd0___sepSetTuple__PF_Pd0PCc___fail__PFi_Pd0___flush__PFi_Pd0___open__PF_Pd0PCcPCc___close__PF_Pd0___write__PFPd0_Pd0PCcUl___fmt__PFi_Pd0PCc__FPd0_Pd0PCc__1(((_Bool (*)(void *__anonymous_object1610))__sepPrt__Fb_P9sofstream__1), ((void (*)(void *__anonymous_object1611))__sepReset__F_P9sofstream__1), ((void (*)(void *__anonymous_object1612, _Bool __anonymous_object1613))__sepReset__F_P9sofstreamb__1), ((const char *(*)(void *__anonymous_object1614))__sepGetCur__FPCc_P9sofstream__1), ((void (*)(void *__anonymous_object1615, const char *__anonymous_object1616))__sepSetCur__F_P9sofstreamPCc__1), ((_Bool (*)(void *__anonymous_object1617))__getNL__Fb_P9sofstream__1), ((void (*)(void *__anonymous_object1618, _Bool __anonymous_object1619))__setNL__F_P9sofstreamb__1), ((void (*)(void *__anonymous_object1620))__sepOn__F_P9sofstream__1), ((void (*)(void *__anonymous_object1621))__sepOff__F_P9sofstream__1), ((_Bool (*)(void *__anonymous_object1622))__sepDisable__Fb_P9sofstream__1), ((_Bool (*)(void *__anonymous_object1623))__sepEnable__Fb_P9sofstream__1), ((const char *(*)(void *__anonymous_object1624))__sepGet__FPCc_P9sofstream__1), ((void (*)(void *__anonymous_object1625, const char *__anonymous_object1626))__sepSet__F_P9sofstreamPCc__1), ((const char *(*)(void *__anonymous_object1627))__sepGetTuple__FPCc_P9sofstream__1), ((void (*)(void *__anonymous_object1628, const char *__anonymous_object1629))__sepSetTuple__F_P9sofstreamPCc__1), ((signed int (*)(void *__anonymous_object1630))__fail__Fi_P9sofstream__1), ((signed int (*)(void *__anonymous_object1631))__flush__Fi_P9sofstream__1), ((void (*)(void *__os__P7tostype_1, const char *__name__PCc_1, const char *__mode__PCc_1))__open__F_P9sofstreamPCcPCc__1), ((void (*)(void *__os__P7tostype_1))__close__F_P9sofstream__1), ((void *(*)(void *__anonymous_object1632, const char *__anonymous_object1633, unsigned long int __anonymous_object1634))__write__FP9sofstream_P9sofstreamPCcUl__1), ((signed int (*)(void *__anonymous_object1635, const char *__fmt__PCc_1, ...))__fmt__Fi_P9sofstreamPCc__1), ((void *)__sout__P9sofstream_1), "unsigned char "))) , _tmp_cp_ret6)), __v__Uc_1))) , _tmp_cp_ret7)), ((void *(*)(void *__anonymous_object1636))(&_thunk2))))) , _tmp_cp_ret8));461 return __endl__A0_1_0_0___sepPrt__PFb_Pd0___sepReset__PF_Pd0___sepReset__PF_Pd0b___sepGetCur__PFPCc_Pd0___sepSetCur__PF_Pd0PCc___getNL__PFb_Pd0___setNL__PF_Pd0b___sepOn__PF_Pd0___sepOff__PF_Pd0___sepDisable__PFb_Pd0___sepEnable__PFb_Pd0___sepGet__PFPCc_Pd0___sepSet__PF_Pd0PCc___sepGetTuple__PFPCc_Pd0___sepSetTuple__PF_Pd0PCc___fail__PFi_Pd0___flush__PFi_Pd0___open__PF_Pd0PCcPCc___close__PF_Pd0___write__PFPd0_Pd0PCcUl___fmt__PFi_Pd0PCc__FPd0_Pd0__1(((_Bool (*)(void *__anonymous_object1532))__sepPrt__Fb_P9sofstream__1), ((void (*)(void *__anonymous_object1533))__sepReset__F_P9sofstream__1), ((void (*)(void *__anonymous_object1534, _Bool __anonymous_object1535))__sepReset__F_P9sofstreamb__1), ((const char *(*)(void *__anonymous_object1536))__sepGetCur__FPCc_P9sofstream__1), ((void (*)(void *__anonymous_object1537, const char *__anonymous_object1538))__sepSetCur__F_P9sofstreamPCc__1), ((_Bool (*)(void *__anonymous_object1539))__getNL__Fb_P9sofstream__1), ((void (*)(void *__anonymous_object1540, _Bool __anonymous_object1541))__setNL__F_P9sofstreamb__1), ((void (*)(void *__anonymous_object1542))__sepOn__F_P9sofstream__1), ((void (*)(void *__anonymous_object1543))__sepOff__F_P9sofstream__1), ((_Bool (*)(void *__anonymous_object1544))__sepDisable__Fb_P9sofstream__1), ((_Bool (*)(void *__anonymous_object1545))__sepEnable__Fb_P9sofstream__1), ((const char *(*)(void *__anonymous_object1546))__sepGet__FPCc_P9sofstream__1), ((void (*)(void *__anonymous_object1547, const char *__anonymous_object1548))__sepSet__F_P9sofstreamPCc__1), ((const char *(*)(void *__anonymous_object1549))__sepGetTuple__FPCc_P9sofstream__1), ((void (*)(void *__anonymous_object1550, const char *__anonymous_object1551))__sepSetTuple__F_P9sofstreamPCc__1), ((signed int (*)(void *__anonymous_object1552))__fail__Fi_P9sofstream__1), ((signed int (*)(void *__anonymous_object1553))__flush__Fi_P9sofstream__1), ((void (*)(void *__os__P7tostype_1, const char *__name__PCc_1, const char *__mode__PCc_1))__open__F_P9sofstreamPCcPCc__1), ((void (*)(void *__os__P7tostype_1))__close__F_P9sofstream__1), ((void *(*)(void *__anonymous_object1554, const char *__anonymous_object1555, unsigned long int __anonymous_object1556))__write__FP9sofstream_P9sofstreamPCcUl__1), ((signed int (*)(void *__anonymous_object1557, const char *__fmt__PCc_1, ...))__fmt__Fi_P9sofstreamPCc__1), _p0); 462 } 463 ((void)(((void)(_tmp_cp_ret8=___operator_bitor__A0_1_0_0___sepPrt__PFb_Pd0___sepReset__PF_Pd0___sepReset__PF_Pd0b___sepGetCur__PFPCc_Pd0___sepSetCur__PF_Pd0PCc___getNL__PFb_Pd0___setNL__PF_Pd0b___sepOn__PF_Pd0___sepOff__PF_Pd0___sepDisable__PFb_Pd0___sepEnable__PFb_Pd0___sepGet__PFPCc_Pd0___sepSet__PF_Pd0PCc___sepGetTuple__PFPCc_Pd0___sepSetTuple__PF_Pd0PCc___fail__PFi_Pd0___flush__PFi_Pd0___open__PF_Pd0PCcPCc___close__PF_Pd0___write__PFPd0_Pd0PCcUl___fmt__PFi_Pd0PCc__FPd0_Pd0PFPd0_Pd0___1(((_Bool (*)(void *__anonymous_object1558))__sepPrt__Fb_P9sofstream__1), ((void (*)(void *__anonymous_object1559))__sepReset__F_P9sofstream__1), ((void (*)(void *__anonymous_object1560, _Bool __anonymous_object1561))__sepReset__F_P9sofstreamb__1), ((const char *(*)(void *__anonymous_object1562))__sepGetCur__FPCc_P9sofstream__1), ((void (*)(void *__anonymous_object1563, const char *__anonymous_object1564))__sepSetCur__F_P9sofstreamPCc__1), ((_Bool (*)(void *__anonymous_object1565))__getNL__Fb_P9sofstream__1), ((void (*)(void *__anonymous_object1566, _Bool __anonymous_object1567))__setNL__F_P9sofstreamb__1), ((void (*)(void *__anonymous_object1568))__sepOn__F_P9sofstream__1), ((void (*)(void *__anonymous_object1569))__sepOff__F_P9sofstream__1), ((_Bool (*)(void *__anonymous_object1570))__sepDisable__Fb_P9sofstream__1), ((_Bool (*)(void *__anonymous_object1571))__sepEnable__Fb_P9sofstream__1), ((const char *(*)(void *__anonymous_object1572))__sepGet__FPCc_P9sofstream__1), ((void (*)(void *__anonymous_object1573, const char *__anonymous_object1574))__sepSet__F_P9sofstreamPCc__1), ((const char *(*)(void *__anonymous_object1575))__sepGetTuple__FPCc_P9sofstream__1), ((void (*)(void *__anonymous_object1576, const char *__anonymous_object1577))__sepSetTuple__F_P9sofstreamPCc__1), ((signed int (*)(void *__anonymous_object1578))__fail__Fi_P9sofstream__1), ((signed int (*)(void *__anonymous_object1579))__flush__Fi_P9sofstream__1), ((void (*)(void *__os__P7tostype_1, const char *__name__PCc_1, const char *__mode__PCc_1))__open__F_P9sofstreamPCcPCc__1), ((void (*)(void *__os__P7tostype_1))__close__F_P9sofstream__1), ((void *(*)(void *__anonymous_object1580, const char *__anonymous_object1581, unsigned long int __anonymous_object1582))__write__FP9sofstream_P9sofstreamPCcUl__1), ((signed int (*)(void *__anonymous_object1583, const char *__fmt__PCc_1, ...))__fmt__Fi_P9sofstreamPCc__1), (((void)(_tmp_cp_ret7=___operator_bitor__A0_1_0_0___sepPrt__PFb_Pd0___sepReset__PF_Pd0___sepReset__PF_Pd0b___sepGetCur__PFPCc_Pd0___sepSetCur__PF_Pd0PCc___getNL__PFb_Pd0___setNL__PF_Pd0b___sepOn__PF_Pd0___sepOff__PF_Pd0___sepDisable__PFb_Pd0___sepEnable__PFb_Pd0___sepGet__PFPCc_Pd0___sepSet__PF_Pd0PCc___sepGetTuple__PFPCc_Pd0___sepSetTuple__PF_Pd0PCc___fail__PFi_Pd0___flush__PFi_Pd0___open__PF_Pd0PCcPCc___close__PF_Pd0___write__PFPd0_Pd0PCcUl___fmt__PFi_Pd0PCc__FPd0_Pd0Uc__1(((_Bool (*)(void *__anonymous_object1584))__sepPrt__Fb_P9sofstream__1), ((void (*)(void *__anonymous_object1585))__sepReset__F_P9sofstream__1), ((void (*)(void *__anonymous_object1586, _Bool __anonymous_object1587))__sepReset__F_P9sofstreamb__1), ((const char *(*)(void *__anonymous_object1588))__sepGetCur__FPCc_P9sofstream__1), ((void (*)(void *__anonymous_object1589, const char *__anonymous_object1590))__sepSetCur__F_P9sofstreamPCc__1), ((_Bool (*)(void *__anonymous_object1591))__getNL__Fb_P9sofstream__1), ((void (*)(void *__anonymous_object1592, _Bool __anonymous_object1593))__setNL__F_P9sofstreamb__1), ((void (*)(void *__anonymous_object1594))__sepOn__F_P9sofstream__1), ((void (*)(void *__anonymous_object1595))__sepOff__F_P9sofstream__1), ((_Bool (*)(void *__anonymous_object1596))__sepDisable__Fb_P9sofstream__1), ((_Bool (*)(void *__anonymous_object1597))__sepEnable__Fb_P9sofstream__1), ((const char *(*)(void *__anonymous_object1598))__sepGet__FPCc_P9sofstream__1), ((void (*)(void *__anonymous_object1599, const char *__anonymous_object1600))__sepSet__F_P9sofstreamPCc__1), ((const char *(*)(void *__anonymous_object1601))__sepGetTuple__FPCc_P9sofstream__1), ((void (*)(void *__anonymous_object1602, const char *__anonymous_object1603))__sepSetTuple__F_P9sofstreamPCc__1), ((signed int (*)(void *__anonymous_object1604))__fail__Fi_P9sofstream__1), ((signed int (*)(void *__anonymous_object1605))__flush__Fi_P9sofstream__1), ((void (*)(void *__os__P7tostype_1, const char *__name__PCc_1, const char *__mode__PCc_1))__open__F_P9sofstreamPCcPCc__1), ((void (*)(void *__os__P7tostype_1))__close__F_P9sofstream__1), ((void *(*)(void *__anonymous_object1606, const char *__anonymous_object1607, unsigned long int __anonymous_object1608))__write__FP9sofstream_P9sofstreamPCcUl__1), ((signed int (*)(void *__anonymous_object1609, const char *__fmt__PCc_1, ...))__fmt__Fi_P9sofstreamPCc__1), (((void)(_tmp_cp_ret6=___operator_bitor__A0_1_0_0___sepPrt__PFb_Pd0___sepReset__PF_Pd0___sepReset__PF_Pd0b___sepGetCur__PFPCc_Pd0___sepSetCur__PF_Pd0PCc___getNL__PFb_Pd0___setNL__PF_Pd0b___sepOn__PF_Pd0___sepOff__PF_Pd0___sepDisable__PFb_Pd0___sepEnable__PFb_Pd0___sepGet__PFPCc_Pd0___sepSet__PF_Pd0PCc___sepGetTuple__PFPCc_Pd0___sepSetTuple__PF_Pd0PCc___fail__PFi_Pd0___flush__PFi_Pd0___open__PF_Pd0PCcPCc___close__PF_Pd0___write__PFPd0_Pd0PCcUl___fmt__PFi_Pd0PCc__FPd0_Pd0PCc__1(((_Bool (*)(void *__anonymous_object1610))__sepPrt__Fb_P9sofstream__1), ((void (*)(void *__anonymous_object1611))__sepReset__F_P9sofstream__1), ((void (*)(void *__anonymous_object1612, _Bool __anonymous_object1613))__sepReset__F_P9sofstreamb__1), ((const char *(*)(void *__anonymous_object1614))__sepGetCur__FPCc_P9sofstream__1), ((void (*)(void *__anonymous_object1615, const char *__anonymous_object1616))__sepSetCur__F_P9sofstreamPCc__1), ((_Bool (*)(void *__anonymous_object1617))__getNL__Fb_P9sofstream__1), ((void (*)(void *__anonymous_object1618, _Bool __anonymous_object1619))__setNL__F_P9sofstreamb__1), ((void (*)(void *__anonymous_object1620))__sepOn__F_P9sofstream__1), ((void (*)(void *__anonymous_object1621))__sepOff__F_P9sofstream__1), ((_Bool (*)(void *__anonymous_object1622))__sepDisable__Fb_P9sofstream__1), ((_Bool (*)(void *__anonymous_object1623))__sepEnable__Fb_P9sofstream__1), ((const char *(*)(void *__anonymous_object1624))__sepGet__FPCc_P9sofstream__1), ((void (*)(void *__anonymous_object1625, const char *__anonymous_object1626))__sepSet__F_P9sofstreamPCc__1), ((const char *(*)(void *__anonymous_object1627))__sepGetTuple__FPCc_P9sofstream__1), ((void (*)(void *__anonymous_object1628, const char *__anonymous_object1629))__sepSetTuple__F_P9sofstreamPCc__1), ((signed int (*)(void *__anonymous_object1630))__fail__Fi_P9sofstream__1), ((signed int (*)(void *__anonymous_object1631))__flush__Fi_P9sofstream__1), ((void (*)(void *__os__P7tostype_1, const char *__name__PCc_1, const char *__mode__PCc_1))__open__F_P9sofstreamPCcPCc__1), ((void (*)(void *__os__P7tostype_1))__close__F_P9sofstream__1), ((void *(*)(void *__anonymous_object1632, const char *__anonymous_object1633, unsigned long int __anonymous_object1634))__write__FP9sofstream_P9sofstreamPCcUl__1), ((signed int (*)(void *__anonymous_object1635, const char *__fmt__PCc_1, ...))__fmt__Fi_P9sofstreamPCc__1), __sout__P9sofstream_1, "unsigned char "))) , _tmp_cp_ret6), __v__Uc_1))) , _tmp_cp_ret7), ((void *(*)(void *__anonymous_object1636))(&_thunk2))))) , _tmp_cp_ret8)); 495 464 ((void)(_tmp_cp_ret6) /* ^?{} */); 496 465 ((void)(_tmp_cp_ret7) /* ^?{} */); … … 502 471 struct ofstream *_tmp_cp_ret11; 503 472 __attribute__ ((unused)) struct ofstream *_thunk3(struct ofstream *_p0){ 504 return __endl__A0_1_0_0___sepPrt__PFb_Pd0___sepReset__PF_Pd0___sepReset__PF_Pd0b___sepGetCur__PFPCc_Pd0___sepSetCur__PF_Pd0PCc___getNL__PFb_Pd0___setNL__PF_Pd0b___sepOn__PF_Pd0___sepOff__PF_Pd0___sepDisable__PFb_Pd0___sepEnable__PFb_Pd0___sepGet__PFPCc_Pd0___sepSet__PF_Pd0PCc___sepGetTuple__PFPCc_Pd0___sepSetTuple__PF_Pd0PCc___fail__PFi_Pd0___flush__PFi_Pd0___open__PF_Pd0PCcPCc___close__PF_Pd0___write__PFPd0_Pd0PCcUl___fmt__PFi_Pd0PCc__FPd0_Pd0__1(((_Bool (*)(void *__anonymous_object1637))__sepPrt__Fb_P9sofstream__1), ((void (*)(void *__anonymous_object1638))__sepReset__F_P9sofstream__1), ((void (*)(void *__anonymous_object1639, _Bool __anonymous_object1640))__sepReset__F_P9sofstreamb__1), ((const char *(*)(void *__anonymous_object1641))__sepGetCur__FPCc_P9sofstream__1), ((void (*)(void *__anonymous_object1642, const char *__anonymous_object1643))__sepSetCur__F_P9sofstreamPCc__1), ((_Bool (*)(void *__anonymous_object1644))__getNL__Fb_P9sofstream__1), ((void (*)(void *__anonymous_object1645, _Bool __anonymous_object1646))__setNL__F_P9sofstreamb__1), ((void (*)(void *__anonymous_object1647))__sepOn__F_P9sofstream__1), ((void (*)(void *__anonymous_object1648))__sepOff__F_P9sofstream__1), ((_Bool (*)(void *__anonymous_object1649))__sepDisable__Fb_P9sofstream__1), ((_Bool (*)(void *__anonymous_object1650))__sepEnable__Fb_P9sofstream__1), ((const char *(*)(void *__anonymous_object1651))__sepGet__FPCc_P9sofstream__1), ((void (*)(void *__anonymous_object1652, const char *__anonymous_object1653))__sepSet__F_P9sofstreamPCc__1), ((const char *(*)(void *__anonymous_object1654))__sepGetTuple__FPCc_P9sofstream__1), ((void (*)(void *__anonymous_object1655, const char *__anonymous_object1656))__sepSetTuple__F_P9sofstreamPCc__1), ((signed int (*)(void *__anonymous_object1657))__fail__Fi_P9sofstream__1), ((signed int (*)(void *__anonymous_object1658))__flush__Fi_P9sofstream__1), ((void (*)(void *__os__P7tostype_1, const char *__name__PCc_1, const char *__mode__PCc_1))__open__F_P9sofstreamPCcPCc__1), ((void (*)(void *__os__P7tostype_1))__close__F_P9sofstream__1), ((void *(*)(void *__anonymous_object1659, const char *__anonymous_object1660, unsigned long int __anonymous_object1661))__write__FP9sofstream_P9sofstreamPCcUl__1), ((signed int (*)(void *__anonymous_object1662, const char *__fmt__PCc_1, ...))__fmt__Fi_P9sofstreamPCc__1), ((void *)_p0));505 } 506 ((void)(((void)(_tmp_cp_ret11=___operator_bitor__A0_1_0_0___sepPrt__PFb_Pd0___sepReset__PF_Pd0___sepReset__PF_Pd0b___sepGetCur__PFPCc_Pd0___sepSetCur__PF_Pd0PCc___getNL__PFb_Pd0___setNL__PF_Pd0b___sepOn__PF_Pd0___sepOff__PF_Pd0___sepDisable__PFb_Pd0___sepEnable__PFb_Pd0___sepGet__PFPCc_Pd0___sepSet__PF_Pd0PCc___sepGetTuple__PFPCc_Pd0___sepSetTuple__PF_Pd0PCc___fail__PFi_Pd0___flush__PFi_Pd0___open__PF_Pd0PCcPCc___close__PF_Pd0___write__PFPd0_Pd0PCcUl___fmt__PFi_Pd0PCc__FPd0_Pd0PFPd0_Pd0___1(((_Bool (*)(void *__anonymous_object1663))__sepPrt__Fb_P9sofstream__1), ((void (*)(void *__anonymous_object1664))__sepReset__F_P9sofstream__1), ((void (*)(void *__anonymous_object1665, _Bool __anonymous_object1666))__sepReset__F_P9sofstreamb__1), ((const char *(*)(void *__anonymous_object1667))__sepGetCur__FPCc_P9sofstream__1), ((void (*)(void *__anonymous_object1668, const char *__anonymous_object1669))__sepSetCur__F_P9sofstreamPCc__1), ((_Bool (*)(void *__anonymous_object1670))__getNL__Fb_P9sofstream__1), ((void (*)(void *__anonymous_object1671, _Bool __anonymous_object1672))__setNL__F_P9sofstreamb__1), ((void (*)(void *__anonymous_object1673))__sepOn__F_P9sofstream__1), ((void (*)(void *__anonymous_object1674))__sepOff__F_P9sofstream__1), ((_Bool (*)(void *__anonymous_object1675))__sepDisable__Fb_P9sofstream__1), ((_Bool (*)(void *__anonymous_object1676))__sepEnable__Fb_P9sofstream__1), ((const char *(*)(void *__anonymous_object1677))__sepGet__FPCc_P9sofstream__1), ((void (*)(void *__anonymous_object1678, const char *__anonymous_object1679))__sepSet__F_P9sofstreamPCc__1), ((const char *(*)(void *__anonymous_object1680))__sepGetTuple__FPCc_P9sofstream__1), ((void (*)(void *__anonymous_object1681, const char *__anonymous_object1682))__sepSetTuple__F_P9sofstreamPCc__1), ((signed int (*)(void *__anonymous_object1683))__fail__Fi_P9sofstream__1), ((signed int (*)(void *__anonymous_object1684))__flush__Fi_P9sofstream__1), ((void (*)(void *__os__P7tostype_1, const char *__name__PCc_1, const char *__mode__PCc_1))__open__F_P9sofstreamPCcPCc__1), ((void (*)(void *__os__P7tostype_1))__close__F_P9sofstream__1), ((void *(*)(void *__anonymous_object1685, const char *__anonymous_object1686, unsigned long int __anonymous_object1687))__write__FP9sofstream_P9sofstreamPCcUl__1), ((signed int (*)(void *__anonymous_object1688, const char *__fmt__PCc_1, ...))__fmt__Fi_P9sofstreamPCc__1), (( void *)(((void)(_tmp_cp_ret10=___operator_bitor__A0_1_0_0___sepPrt__PFb_Pd0___sepReset__PF_Pd0___sepReset__PF_Pd0b___sepGetCur__PFPCc_Pd0___sepSetCur__PF_Pd0PCc___getNL__PFb_Pd0___setNL__PF_Pd0b___sepOn__PF_Pd0___sepOff__PF_Pd0___sepDisable__PFb_Pd0___sepEnable__PFb_Pd0___sepGet__PFPCc_Pd0___sepSet__PF_Pd0PCc___sepGetTuple__PFPCc_Pd0___sepSetTuple__PF_Pd0PCc___fail__PFi_Pd0___flush__PFi_Pd0___open__PF_Pd0PCcPCc___close__PF_Pd0___write__PFPd0_Pd0PCcUl___fmt__PFi_Pd0PCc__FPd0_Pd0s__1(((_Bool (*)(void *__anonymous_object1689))__sepPrt__Fb_P9sofstream__1), ((void (*)(void *__anonymous_object1690))__sepReset__F_P9sofstream__1), ((void (*)(void *__anonymous_object1691, _Bool __anonymous_object1692))__sepReset__F_P9sofstreamb__1), ((const char *(*)(void *__anonymous_object1693))__sepGetCur__FPCc_P9sofstream__1), ((void (*)(void *__anonymous_object1694, const char *__anonymous_object1695))__sepSetCur__F_P9sofstreamPCc__1), ((_Bool (*)(void *__anonymous_object1696))__getNL__Fb_P9sofstream__1), ((void (*)(void *__anonymous_object1697, _Bool __anonymous_object1698))__setNL__F_P9sofstreamb__1), ((void (*)(void *__anonymous_object1699))__sepOn__F_P9sofstream__1), ((void (*)(void *__anonymous_object1700))__sepOff__F_P9sofstream__1), ((_Bool (*)(void *__anonymous_object1701))__sepDisable__Fb_P9sofstream__1), ((_Bool (*)(void *__anonymous_object1702))__sepEnable__Fb_P9sofstream__1), ((const char *(*)(void *__anonymous_object1703))__sepGet__FPCc_P9sofstream__1), ((void (*)(void *__anonymous_object1704, const char *__anonymous_object1705))__sepSet__F_P9sofstreamPCc__1), ((const char *(*)(void *__anonymous_object1706))__sepGetTuple__FPCc_P9sofstream__1), ((void (*)(void *__anonymous_object1707, const char *__anonymous_object1708))__sepSetTuple__F_P9sofstreamPCc__1), ((signed int (*)(void *__anonymous_object1709))__fail__Fi_P9sofstream__1), ((signed int (*)(void *__anonymous_object1710))__flush__Fi_P9sofstream__1), ((void (*)(void *__os__P7tostype_1, const char *__name__PCc_1, const char *__mode__PCc_1))__open__F_P9sofstreamPCcPCc__1), ((void (*)(void *__os__P7tostype_1))__close__F_P9sofstream__1), ((void *(*)(void *__anonymous_object1711, const char *__anonymous_object1712, unsigned long int __anonymous_object1713))__write__FP9sofstream_P9sofstreamPCcUl__1), ((signed int (*)(void *__anonymous_object1714, const char *__fmt__PCc_1, ...))__fmt__Fi_P9sofstreamPCc__1), ((void *)(((void)(_tmp_cp_ret9=___operator_bitor__A0_1_0_0___sepPrt__PFb_Pd0___sepReset__PF_Pd0___sepReset__PF_Pd0b___sepGetCur__PFPCc_Pd0___sepSetCur__PF_Pd0PCc___getNL__PFb_Pd0___setNL__PF_Pd0b___sepOn__PF_Pd0___sepOff__PF_Pd0___sepDisable__PFb_Pd0___sepEnable__PFb_Pd0___sepGet__PFPCc_Pd0___sepSet__PF_Pd0PCc___sepGetTuple__PFPCc_Pd0___sepSetTuple__PF_Pd0PCc___fail__PFi_Pd0___flush__PFi_Pd0___open__PF_Pd0PCcPCc___close__PF_Pd0___write__PFPd0_Pd0PCcUl___fmt__PFi_Pd0PCc__FPd0_Pd0PCc__1(((_Bool (*)(void *__anonymous_object1715))__sepPrt__Fb_P9sofstream__1), ((void (*)(void *__anonymous_object1716))__sepReset__F_P9sofstream__1), ((void (*)(void *__anonymous_object1717, _Bool __anonymous_object1718))__sepReset__F_P9sofstreamb__1), ((const char *(*)(void *__anonymous_object1719))__sepGetCur__FPCc_P9sofstream__1), ((void (*)(void *__anonymous_object1720, const char *__anonymous_object1721))__sepSetCur__F_P9sofstreamPCc__1), ((_Bool (*)(void *__anonymous_object1722))__getNL__Fb_P9sofstream__1), ((void (*)(void *__anonymous_object1723, _Bool __anonymous_object1724))__setNL__F_P9sofstreamb__1), ((void (*)(void *__anonymous_object1725))__sepOn__F_P9sofstream__1), ((void (*)(void *__anonymous_object1726))__sepOff__F_P9sofstream__1), ((_Bool (*)(void *__anonymous_object1727))__sepDisable__Fb_P9sofstream__1), ((_Bool (*)(void *__anonymous_object1728))__sepEnable__Fb_P9sofstream__1), ((const char *(*)(void *__anonymous_object1729))__sepGet__FPCc_P9sofstream__1), ((void (*)(void *__anonymous_object1730, const char *__anonymous_object1731))__sepSet__F_P9sofstreamPCc__1), ((const char *(*)(void *__anonymous_object1732))__sepGetTuple__FPCc_P9sofstream__1), ((void (*)(void *__anonymous_object1733, const char *__anonymous_object1734))__sepSetTuple__F_P9sofstreamPCc__1), ((signed int (*)(void *__anonymous_object1735))__fail__Fi_P9sofstream__1), ((signed int (*)(void *__anonymous_object1736))__flush__Fi_P9sofstream__1), ((void (*)(void *__os__P7tostype_1, const char *__name__PCc_1, const char *__mode__PCc_1))__open__F_P9sofstreamPCcPCc__1), ((void (*)(void *__os__P7tostype_1))__close__F_P9sofstream__1), ((void *(*)(void *__anonymous_object1737, const char *__anonymous_object1738, unsigned long int __anonymous_object1739))__write__FP9sofstream_P9sofstreamPCcUl__1), ((signed int (*)(void *__anonymous_object1740, const char *__fmt__PCc_1, ...))__fmt__Fi_P9sofstreamPCc__1), ((void *)__sout__P9sofstream_1), "signed short int"))) , _tmp_cp_ret9)), __v__s_1))) , _tmp_cp_ret10)), ((void *(*)(void *__anonymous_object1741))(&_thunk3))))) , _tmp_cp_ret11));473 return __endl__A0_1_0_0___sepPrt__PFb_Pd0___sepReset__PF_Pd0___sepReset__PF_Pd0b___sepGetCur__PFPCc_Pd0___sepSetCur__PF_Pd0PCc___getNL__PFb_Pd0___setNL__PF_Pd0b___sepOn__PF_Pd0___sepOff__PF_Pd0___sepDisable__PFb_Pd0___sepEnable__PFb_Pd0___sepGet__PFPCc_Pd0___sepSet__PF_Pd0PCc___sepGetTuple__PFPCc_Pd0___sepSetTuple__PF_Pd0PCc___fail__PFi_Pd0___flush__PFi_Pd0___open__PF_Pd0PCcPCc___close__PF_Pd0___write__PFPd0_Pd0PCcUl___fmt__PFi_Pd0PCc__FPd0_Pd0__1(((_Bool (*)(void *__anonymous_object1637))__sepPrt__Fb_P9sofstream__1), ((void (*)(void *__anonymous_object1638))__sepReset__F_P9sofstream__1), ((void (*)(void *__anonymous_object1639, _Bool __anonymous_object1640))__sepReset__F_P9sofstreamb__1), ((const char *(*)(void *__anonymous_object1641))__sepGetCur__FPCc_P9sofstream__1), ((void (*)(void *__anonymous_object1642, const char *__anonymous_object1643))__sepSetCur__F_P9sofstreamPCc__1), ((_Bool (*)(void *__anonymous_object1644))__getNL__Fb_P9sofstream__1), ((void (*)(void *__anonymous_object1645, _Bool __anonymous_object1646))__setNL__F_P9sofstreamb__1), ((void (*)(void *__anonymous_object1647))__sepOn__F_P9sofstream__1), ((void (*)(void *__anonymous_object1648))__sepOff__F_P9sofstream__1), ((_Bool (*)(void *__anonymous_object1649))__sepDisable__Fb_P9sofstream__1), ((_Bool (*)(void *__anonymous_object1650))__sepEnable__Fb_P9sofstream__1), ((const char *(*)(void *__anonymous_object1651))__sepGet__FPCc_P9sofstream__1), ((void (*)(void *__anonymous_object1652, const char *__anonymous_object1653))__sepSet__F_P9sofstreamPCc__1), ((const char *(*)(void *__anonymous_object1654))__sepGetTuple__FPCc_P9sofstream__1), ((void (*)(void *__anonymous_object1655, const char *__anonymous_object1656))__sepSetTuple__F_P9sofstreamPCc__1), ((signed int (*)(void *__anonymous_object1657))__fail__Fi_P9sofstream__1), ((signed int (*)(void *__anonymous_object1658))__flush__Fi_P9sofstream__1), ((void (*)(void *__os__P7tostype_1, const char *__name__PCc_1, const char *__mode__PCc_1))__open__F_P9sofstreamPCcPCc__1), ((void (*)(void *__os__P7tostype_1))__close__F_P9sofstream__1), ((void *(*)(void *__anonymous_object1659, const char *__anonymous_object1660, unsigned long int __anonymous_object1661))__write__FP9sofstream_P9sofstreamPCcUl__1), ((signed int (*)(void *__anonymous_object1662, const char *__fmt__PCc_1, ...))__fmt__Fi_P9sofstreamPCc__1), _p0); 474 } 475 ((void)(((void)(_tmp_cp_ret11=___operator_bitor__A0_1_0_0___sepPrt__PFb_Pd0___sepReset__PF_Pd0___sepReset__PF_Pd0b___sepGetCur__PFPCc_Pd0___sepSetCur__PF_Pd0PCc___getNL__PFb_Pd0___setNL__PF_Pd0b___sepOn__PF_Pd0___sepOff__PF_Pd0___sepDisable__PFb_Pd0___sepEnable__PFb_Pd0___sepGet__PFPCc_Pd0___sepSet__PF_Pd0PCc___sepGetTuple__PFPCc_Pd0___sepSetTuple__PF_Pd0PCc___fail__PFi_Pd0___flush__PFi_Pd0___open__PF_Pd0PCcPCc___close__PF_Pd0___write__PFPd0_Pd0PCcUl___fmt__PFi_Pd0PCc__FPd0_Pd0PFPd0_Pd0___1(((_Bool (*)(void *__anonymous_object1663))__sepPrt__Fb_P9sofstream__1), ((void (*)(void *__anonymous_object1664))__sepReset__F_P9sofstream__1), ((void (*)(void *__anonymous_object1665, _Bool __anonymous_object1666))__sepReset__F_P9sofstreamb__1), ((const char *(*)(void *__anonymous_object1667))__sepGetCur__FPCc_P9sofstream__1), ((void (*)(void *__anonymous_object1668, const char *__anonymous_object1669))__sepSetCur__F_P9sofstreamPCc__1), ((_Bool (*)(void *__anonymous_object1670))__getNL__Fb_P9sofstream__1), ((void (*)(void *__anonymous_object1671, _Bool __anonymous_object1672))__setNL__F_P9sofstreamb__1), ((void (*)(void *__anonymous_object1673))__sepOn__F_P9sofstream__1), ((void (*)(void *__anonymous_object1674))__sepOff__F_P9sofstream__1), ((_Bool (*)(void *__anonymous_object1675))__sepDisable__Fb_P9sofstream__1), ((_Bool (*)(void *__anonymous_object1676))__sepEnable__Fb_P9sofstream__1), ((const char *(*)(void *__anonymous_object1677))__sepGet__FPCc_P9sofstream__1), ((void (*)(void *__anonymous_object1678, const char *__anonymous_object1679))__sepSet__F_P9sofstreamPCc__1), ((const char *(*)(void *__anonymous_object1680))__sepGetTuple__FPCc_P9sofstream__1), ((void (*)(void *__anonymous_object1681, const char *__anonymous_object1682))__sepSetTuple__F_P9sofstreamPCc__1), ((signed int (*)(void *__anonymous_object1683))__fail__Fi_P9sofstream__1), ((signed int (*)(void *__anonymous_object1684))__flush__Fi_P9sofstream__1), ((void (*)(void *__os__P7tostype_1, const char *__name__PCc_1, const char *__mode__PCc_1))__open__F_P9sofstreamPCcPCc__1), ((void (*)(void *__os__P7tostype_1))__close__F_P9sofstream__1), ((void *(*)(void *__anonymous_object1685, const char *__anonymous_object1686, unsigned long int __anonymous_object1687))__write__FP9sofstream_P9sofstreamPCcUl__1), ((signed int (*)(void *__anonymous_object1688, const char *__fmt__PCc_1, ...))__fmt__Fi_P9sofstreamPCc__1), (((void)(_tmp_cp_ret10=___operator_bitor__A0_1_0_0___sepPrt__PFb_Pd0___sepReset__PF_Pd0___sepReset__PF_Pd0b___sepGetCur__PFPCc_Pd0___sepSetCur__PF_Pd0PCc___getNL__PFb_Pd0___setNL__PF_Pd0b___sepOn__PF_Pd0___sepOff__PF_Pd0___sepDisable__PFb_Pd0___sepEnable__PFb_Pd0___sepGet__PFPCc_Pd0___sepSet__PF_Pd0PCc___sepGetTuple__PFPCc_Pd0___sepSetTuple__PF_Pd0PCc___fail__PFi_Pd0___flush__PFi_Pd0___open__PF_Pd0PCcPCc___close__PF_Pd0___write__PFPd0_Pd0PCcUl___fmt__PFi_Pd0PCc__FPd0_Pd0s__1(((_Bool (*)(void *__anonymous_object1689))__sepPrt__Fb_P9sofstream__1), ((void (*)(void *__anonymous_object1690))__sepReset__F_P9sofstream__1), ((void (*)(void *__anonymous_object1691, _Bool __anonymous_object1692))__sepReset__F_P9sofstreamb__1), ((const char *(*)(void *__anonymous_object1693))__sepGetCur__FPCc_P9sofstream__1), ((void (*)(void *__anonymous_object1694, const char *__anonymous_object1695))__sepSetCur__F_P9sofstreamPCc__1), ((_Bool (*)(void *__anonymous_object1696))__getNL__Fb_P9sofstream__1), ((void (*)(void *__anonymous_object1697, _Bool __anonymous_object1698))__setNL__F_P9sofstreamb__1), ((void (*)(void *__anonymous_object1699))__sepOn__F_P9sofstream__1), ((void (*)(void *__anonymous_object1700))__sepOff__F_P9sofstream__1), ((_Bool (*)(void *__anonymous_object1701))__sepDisable__Fb_P9sofstream__1), ((_Bool (*)(void *__anonymous_object1702))__sepEnable__Fb_P9sofstream__1), ((const char *(*)(void *__anonymous_object1703))__sepGet__FPCc_P9sofstream__1), ((void (*)(void *__anonymous_object1704, const char *__anonymous_object1705))__sepSet__F_P9sofstreamPCc__1), ((const char *(*)(void *__anonymous_object1706))__sepGetTuple__FPCc_P9sofstream__1), ((void (*)(void *__anonymous_object1707, const char *__anonymous_object1708))__sepSetTuple__F_P9sofstreamPCc__1), ((signed int (*)(void *__anonymous_object1709))__fail__Fi_P9sofstream__1), ((signed int (*)(void *__anonymous_object1710))__flush__Fi_P9sofstream__1), ((void (*)(void *__os__P7tostype_1, const char *__name__PCc_1, const char *__mode__PCc_1))__open__F_P9sofstreamPCcPCc__1), ((void (*)(void *__os__P7tostype_1))__close__F_P9sofstream__1), ((void *(*)(void *__anonymous_object1711, const char *__anonymous_object1712, unsigned long int __anonymous_object1713))__write__FP9sofstream_P9sofstreamPCcUl__1), ((signed int (*)(void *__anonymous_object1714, const char *__fmt__PCc_1, ...))__fmt__Fi_P9sofstreamPCc__1), (((void)(_tmp_cp_ret9=___operator_bitor__A0_1_0_0___sepPrt__PFb_Pd0___sepReset__PF_Pd0___sepReset__PF_Pd0b___sepGetCur__PFPCc_Pd0___sepSetCur__PF_Pd0PCc___getNL__PFb_Pd0___setNL__PF_Pd0b___sepOn__PF_Pd0___sepOff__PF_Pd0___sepDisable__PFb_Pd0___sepEnable__PFb_Pd0___sepGet__PFPCc_Pd0___sepSet__PF_Pd0PCc___sepGetTuple__PFPCc_Pd0___sepSetTuple__PF_Pd0PCc___fail__PFi_Pd0___flush__PFi_Pd0___open__PF_Pd0PCcPCc___close__PF_Pd0___write__PFPd0_Pd0PCcUl___fmt__PFi_Pd0PCc__FPd0_Pd0PCc__1(((_Bool (*)(void *__anonymous_object1715))__sepPrt__Fb_P9sofstream__1), ((void (*)(void *__anonymous_object1716))__sepReset__F_P9sofstream__1), ((void (*)(void *__anonymous_object1717, _Bool __anonymous_object1718))__sepReset__F_P9sofstreamb__1), ((const char *(*)(void *__anonymous_object1719))__sepGetCur__FPCc_P9sofstream__1), ((void (*)(void *__anonymous_object1720, const char *__anonymous_object1721))__sepSetCur__F_P9sofstreamPCc__1), ((_Bool (*)(void *__anonymous_object1722))__getNL__Fb_P9sofstream__1), ((void (*)(void *__anonymous_object1723, _Bool __anonymous_object1724))__setNL__F_P9sofstreamb__1), ((void (*)(void *__anonymous_object1725))__sepOn__F_P9sofstream__1), ((void (*)(void *__anonymous_object1726))__sepOff__F_P9sofstream__1), ((_Bool (*)(void *__anonymous_object1727))__sepDisable__Fb_P9sofstream__1), ((_Bool (*)(void *__anonymous_object1728))__sepEnable__Fb_P9sofstream__1), ((const char *(*)(void *__anonymous_object1729))__sepGet__FPCc_P9sofstream__1), ((void (*)(void *__anonymous_object1730, const char *__anonymous_object1731))__sepSet__F_P9sofstreamPCc__1), ((const char *(*)(void *__anonymous_object1732))__sepGetTuple__FPCc_P9sofstream__1), ((void (*)(void *__anonymous_object1733, const char *__anonymous_object1734))__sepSetTuple__F_P9sofstreamPCc__1), ((signed int (*)(void *__anonymous_object1735))__fail__Fi_P9sofstream__1), ((signed int (*)(void *__anonymous_object1736))__flush__Fi_P9sofstream__1), ((void (*)(void *__os__P7tostype_1, const char *__name__PCc_1, const char *__mode__PCc_1))__open__F_P9sofstreamPCcPCc__1), ((void (*)(void *__os__P7tostype_1))__close__F_P9sofstream__1), ((void *(*)(void *__anonymous_object1737, const char *__anonymous_object1738, unsigned long int __anonymous_object1739))__write__FP9sofstream_P9sofstreamPCcUl__1), ((signed int (*)(void *__anonymous_object1740, const char *__fmt__PCc_1, ...))__fmt__Fi_P9sofstreamPCc__1), __sout__P9sofstream_1, "signed short int"))) , _tmp_cp_ret9), __v__s_1))) , _tmp_cp_ret10), ((void *(*)(void *__anonymous_object1741))(&_thunk3))))) , _tmp_cp_ret11)); 507 476 ((void)(_tmp_cp_ret9) /* ^?{} */); 508 477 ((void)(_tmp_cp_ret10) /* ^?{} */); … … 514 483 struct ofstream *_tmp_cp_ret14; 515 484 __attribute__ ((unused)) struct ofstream *_thunk4(struct ofstream *_p0){ 516 return __endl__A0_1_0_0___sepPrt__PFb_Pd0___sepReset__PF_Pd0___sepReset__PF_Pd0b___sepGetCur__PFPCc_Pd0___sepSetCur__PF_Pd0PCc___getNL__PFb_Pd0___setNL__PF_Pd0b___sepOn__PF_Pd0___sepOff__PF_Pd0___sepDisable__PFb_Pd0___sepEnable__PFb_Pd0___sepGet__PFPCc_Pd0___sepSet__PF_Pd0PCc___sepGetTuple__PFPCc_Pd0___sepSetTuple__PF_Pd0PCc___fail__PFi_Pd0___flush__PFi_Pd0___open__PF_Pd0PCcPCc___close__PF_Pd0___write__PFPd0_Pd0PCcUl___fmt__PFi_Pd0PCc__FPd0_Pd0__1(((_Bool (*)(void *__anonymous_object1742))__sepPrt__Fb_P9sofstream__1), ((void (*)(void *__anonymous_object1743))__sepReset__F_P9sofstream__1), ((void (*)(void *__anonymous_object1744, _Bool __anonymous_object1745))__sepReset__F_P9sofstreamb__1), ((const char *(*)(void *__anonymous_object1746))__sepGetCur__FPCc_P9sofstream__1), ((void (*)(void *__anonymous_object1747, const char *__anonymous_object1748))__sepSetCur__F_P9sofstreamPCc__1), ((_Bool (*)(void *__anonymous_object1749))__getNL__Fb_P9sofstream__1), ((void (*)(void *__anonymous_object1750, _Bool __anonymous_object1751))__setNL__F_P9sofstreamb__1), ((void (*)(void *__anonymous_object1752))__sepOn__F_P9sofstream__1), ((void (*)(void *__anonymous_object1753))__sepOff__F_P9sofstream__1), ((_Bool (*)(void *__anonymous_object1754))__sepDisable__Fb_P9sofstream__1), ((_Bool (*)(void *__anonymous_object1755))__sepEnable__Fb_P9sofstream__1), ((const char *(*)(void *__anonymous_object1756))__sepGet__FPCc_P9sofstream__1), ((void (*)(void *__anonymous_object1757, const char *__anonymous_object1758))__sepSet__F_P9sofstreamPCc__1), ((const char *(*)(void *__anonymous_object1759))__sepGetTuple__FPCc_P9sofstream__1), ((void (*)(void *__anonymous_object1760, const char *__anonymous_object1761))__sepSetTuple__F_P9sofstreamPCc__1), ((signed int (*)(void *__anonymous_object1762))__fail__Fi_P9sofstream__1), ((signed int (*)(void *__anonymous_object1763))__flush__Fi_P9sofstream__1), ((void (*)(void *__os__P7tostype_1, const char *__name__PCc_1, const char *__mode__PCc_1))__open__F_P9sofstreamPCcPCc__1), ((void (*)(void *__os__P7tostype_1))__close__F_P9sofstream__1), ((void *(*)(void *__anonymous_object1764, const char *__anonymous_object1765, unsigned long int __anonymous_object1766))__write__FP9sofstream_P9sofstreamPCcUl__1), ((signed int (*)(void *__anonymous_object1767, const char *__fmt__PCc_1, ...))__fmt__Fi_P9sofstreamPCc__1), ((void *)_p0));517 } 518 ((void)(((void)(_tmp_cp_ret14=___operator_bitor__A0_1_0_0___sepPrt__PFb_Pd0___sepReset__PF_Pd0___sepReset__PF_Pd0b___sepGetCur__PFPCc_Pd0___sepSetCur__PF_Pd0PCc___getNL__PFb_Pd0___setNL__PF_Pd0b___sepOn__PF_Pd0___sepOff__PF_Pd0___sepDisable__PFb_Pd0___sepEnable__PFb_Pd0___sepGet__PFPCc_Pd0___sepSet__PF_Pd0PCc___sepGetTuple__PFPCc_Pd0___sepSetTuple__PF_Pd0PCc___fail__PFi_Pd0___flush__PFi_Pd0___open__PF_Pd0PCcPCc___close__PF_Pd0___write__PFPd0_Pd0PCcUl___fmt__PFi_Pd0PCc__FPd0_Pd0PFPd0_Pd0___1(((_Bool (*)(void *__anonymous_object1768))__sepPrt__Fb_P9sofstream__1), ((void (*)(void *__anonymous_object1769))__sepReset__F_P9sofstream__1), ((void (*)(void *__anonymous_object1770, _Bool __anonymous_object1771))__sepReset__F_P9sofstreamb__1), ((const char *(*)(void *__anonymous_object1772))__sepGetCur__FPCc_P9sofstream__1), ((void (*)(void *__anonymous_object1773, const char *__anonymous_object1774))__sepSetCur__F_P9sofstreamPCc__1), ((_Bool (*)(void *__anonymous_object1775))__getNL__Fb_P9sofstream__1), ((void (*)(void *__anonymous_object1776, _Bool __anonymous_object1777))__setNL__F_P9sofstreamb__1), ((void (*)(void *__anonymous_object1778))__sepOn__F_P9sofstream__1), ((void (*)(void *__anonymous_object1779))__sepOff__F_P9sofstream__1), ((_Bool (*)(void *__anonymous_object1780))__sepDisable__Fb_P9sofstream__1), ((_Bool (*)(void *__anonymous_object1781))__sepEnable__Fb_P9sofstream__1), ((const char *(*)(void *__anonymous_object1782))__sepGet__FPCc_P9sofstream__1), ((void (*)(void *__anonymous_object1783, const char *__anonymous_object1784))__sepSet__F_P9sofstreamPCc__1), ((const char *(*)(void *__anonymous_object1785))__sepGetTuple__FPCc_P9sofstream__1), ((void (*)(void *__anonymous_object1786, const char *__anonymous_object1787))__sepSetTuple__F_P9sofstreamPCc__1), ((signed int (*)(void *__anonymous_object1788))__fail__Fi_P9sofstream__1), ((signed int (*)(void *__anonymous_object1789))__flush__Fi_P9sofstream__1), ((void (*)(void *__os__P7tostype_1, const char *__name__PCc_1, const char *__mode__PCc_1))__open__F_P9sofstreamPCcPCc__1), ((void (*)(void *__os__P7tostype_1))__close__F_P9sofstream__1), ((void *(*)(void *__anonymous_object1790, const char *__anonymous_object1791, unsigned long int __anonymous_object1792))__write__FP9sofstream_P9sofstreamPCcUl__1), ((signed int (*)(void *__anonymous_object1793, const char *__fmt__PCc_1, ...))__fmt__Fi_P9sofstreamPCc__1), (( void *)(((void)(_tmp_cp_ret13=___operator_bitor__A0_1_0_0___sepPrt__PFb_Pd0___sepReset__PF_Pd0___sepReset__PF_Pd0b___sepGetCur__PFPCc_Pd0___sepSetCur__PF_Pd0PCc___getNL__PFb_Pd0___setNL__PF_Pd0b___sepOn__PF_Pd0___sepOff__PF_Pd0___sepDisable__PFb_Pd0___sepEnable__PFb_Pd0___sepGet__PFPCc_Pd0___sepSet__PF_Pd0PCc___sepGetTuple__PFPCc_Pd0___sepSetTuple__PF_Pd0PCc___fail__PFi_Pd0___flush__PFi_Pd0___open__PF_Pd0PCcPCc___close__PF_Pd0___write__PFPd0_Pd0PCcUl___fmt__PFi_Pd0PCc__FPd0_Pd0Us__1(((_Bool (*)(void *__anonymous_object1794))__sepPrt__Fb_P9sofstream__1), ((void (*)(void *__anonymous_object1795))__sepReset__F_P9sofstream__1), ((void (*)(void *__anonymous_object1796, _Bool __anonymous_object1797))__sepReset__F_P9sofstreamb__1), ((const char *(*)(void *__anonymous_object1798))__sepGetCur__FPCc_P9sofstream__1), ((void (*)(void *__anonymous_object1799, const char *__anonymous_object1800))__sepSetCur__F_P9sofstreamPCc__1), ((_Bool (*)(void *__anonymous_object1801))__getNL__Fb_P9sofstream__1), ((void (*)(void *__anonymous_object1802, _Bool __anonymous_object1803))__setNL__F_P9sofstreamb__1), ((void (*)(void *__anonymous_object1804))__sepOn__F_P9sofstream__1), ((void (*)(void *__anonymous_object1805))__sepOff__F_P9sofstream__1), ((_Bool (*)(void *__anonymous_object1806))__sepDisable__Fb_P9sofstream__1), ((_Bool (*)(void *__anonymous_object1807))__sepEnable__Fb_P9sofstream__1), ((const char *(*)(void *__anonymous_object1808))__sepGet__FPCc_P9sofstream__1), ((void (*)(void *__anonymous_object1809, const char *__anonymous_object1810))__sepSet__F_P9sofstreamPCc__1), ((const char *(*)(void *__anonymous_object1811))__sepGetTuple__FPCc_P9sofstream__1), ((void (*)(void *__anonymous_object1812, const char *__anonymous_object1813))__sepSetTuple__F_P9sofstreamPCc__1), ((signed int (*)(void *__anonymous_object1814))__fail__Fi_P9sofstream__1), ((signed int (*)(void *__anonymous_object1815))__flush__Fi_P9sofstream__1), ((void (*)(void *__os__P7tostype_1, const char *__name__PCc_1, const char *__mode__PCc_1))__open__F_P9sofstreamPCcPCc__1), ((void (*)(void *__os__P7tostype_1))__close__F_P9sofstream__1), ((void *(*)(void *__anonymous_object1816, const char *__anonymous_object1817, unsigned long int __anonymous_object1818))__write__FP9sofstream_P9sofstreamPCcUl__1), ((signed int (*)(void *__anonymous_object1819, const char *__fmt__PCc_1, ...))__fmt__Fi_P9sofstreamPCc__1), ((void *)(((void)(_tmp_cp_ret12=___operator_bitor__A0_1_0_0___sepPrt__PFb_Pd0___sepReset__PF_Pd0___sepReset__PF_Pd0b___sepGetCur__PFPCc_Pd0___sepSetCur__PF_Pd0PCc___getNL__PFb_Pd0___setNL__PF_Pd0b___sepOn__PF_Pd0___sepOff__PF_Pd0___sepDisable__PFb_Pd0___sepEnable__PFb_Pd0___sepGet__PFPCc_Pd0___sepSet__PF_Pd0PCc___sepGetTuple__PFPCc_Pd0___sepSetTuple__PF_Pd0PCc___fail__PFi_Pd0___flush__PFi_Pd0___open__PF_Pd0PCcPCc___close__PF_Pd0___write__PFPd0_Pd0PCcUl___fmt__PFi_Pd0PCc__FPd0_Pd0PCc__1(((_Bool (*)(void *__anonymous_object1820))__sepPrt__Fb_P9sofstream__1), ((void (*)(void *__anonymous_object1821))__sepReset__F_P9sofstream__1), ((void (*)(void *__anonymous_object1822, _Bool __anonymous_object1823))__sepReset__F_P9sofstreamb__1), ((const char *(*)(void *__anonymous_object1824))__sepGetCur__FPCc_P9sofstream__1), ((void (*)(void *__anonymous_object1825, const char *__anonymous_object1826))__sepSetCur__F_P9sofstreamPCc__1), ((_Bool (*)(void *__anonymous_object1827))__getNL__Fb_P9sofstream__1), ((void (*)(void *__anonymous_object1828, _Bool __anonymous_object1829))__setNL__F_P9sofstreamb__1), ((void (*)(void *__anonymous_object1830))__sepOn__F_P9sofstream__1), ((void (*)(void *__anonymous_object1831))__sepOff__F_P9sofstream__1), ((_Bool (*)(void *__anonymous_object1832))__sepDisable__Fb_P9sofstream__1), ((_Bool (*)(void *__anonymous_object1833))__sepEnable__Fb_P9sofstream__1), ((const char *(*)(void *__anonymous_object1834))__sepGet__FPCc_P9sofstream__1), ((void (*)(void *__anonymous_object1835, const char *__anonymous_object1836))__sepSet__F_P9sofstreamPCc__1), ((const char *(*)(void *__anonymous_object1837))__sepGetTuple__FPCc_P9sofstream__1), ((void (*)(void *__anonymous_object1838, const char *__anonymous_object1839))__sepSetTuple__F_P9sofstreamPCc__1), ((signed int (*)(void *__anonymous_object1840))__fail__Fi_P9sofstream__1), ((signed int (*)(void *__anonymous_object1841))__flush__Fi_P9sofstream__1), ((void (*)(void *__os__P7tostype_1, const char *__name__PCc_1, const char *__mode__PCc_1))__open__F_P9sofstreamPCcPCc__1), ((void (*)(void *__os__P7tostype_1))__close__F_P9sofstream__1), ((void *(*)(void *__anonymous_object1842, const char *__anonymous_object1843, unsigned long int __anonymous_object1844))__write__FP9sofstream_P9sofstreamPCcUl__1), ((signed int (*)(void *__anonymous_object1845, const char *__fmt__PCc_1, ...))__fmt__Fi_P9sofstreamPCc__1), ((void *)__sout__P9sofstream_1), "unsigned short int"))) , _tmp_cp_ret12)), __v__Us_1))) , _tmp_cp_ret13)), ((void *(*)(void *__anonymous_object1846))(&_thunk4))))) , _tmp_cp_ret14));485 return __endl__A0_1_0_0___sepPrt__PFb_Pd0___sepReset__PF_Pd0___sepReset__PF_Pd0b___sepGetCur__PFPCc_Pd0___sepSetCur__PF_Pd0PCc___getNL__PFb_Pd0___setNL__PF_Pd0b___sepOn__PF_Pd0___sepOff__PF_Pd0___sepDisable__PFb_Pd0___sepEnable__PFb_Pd0___sepGet__PFPCc_Pd0___sepSet__PF_Pd0PCc___sepGetTuple__PFPCc_Pd0___sepSetTuple__PF_Pd0PCc___fail__PFi_Pd0___flush__PFi_Pd0___open__PF_Pd0PCcPCc___close__PF_Pd0___write__PFPd0_Pd0PCcUl___fmt__PFi_Pd0PCc__FPd0_Pd0__1(((_Bool (*)(void *__anonymous_object1742))__sepPrt__Fb_P9sofstream__1), ((void (*)(void *__anonymous_object1743))__sepReset__F_P9sofstream__1), ((void (*)(void *__anonymous_object1744, _Bool __anonymous_object1745))__sepReset__F_P9sofstreamb__1), ((const char *(*)(void *__anonymous_object1746))__sepGetCur__FPCc_P9sofstream__1), ((void (*)(void *__anonymous_object1747, const char *__anonymous_object1748))__sepSetCur__F_P9sofstreamPCc__1), ((_Bool (*)(void *__anonymous_object1749))__getNL__Fb_P9sofstream__1), ((void (*)(void *__anonymous_object1750, _Bool __anonymous_object1751))__setNL__F_P9sofstreamb__1), ((void (*)(void *__anonymous_object1752))__sepOn__F_P9sofstream__1), ((void (*)(void *__anonymous_object1753))__sepOff__F_P9sofstream__1), ((_Bool (*)(void *__anonymous_object1754))__sepDisable__Fb_P9sofstream__1), ((_Bool (*)(void *__anonymous_object1755))__sepEnable__Fb_P9sofstream__1), ((const char *(*)(void *__anonymous_object1756))__sepGet__FPCc_P9sofstream__1), ((void (*)(void *__anonymous_object1757, const char *__anonymous_object1758))__sepSet__F_P9sofstreamPCc__1), ((const char *(*)(void *__anonymous_object1759))__sepGetTuple__FPCc_P9sofstream__1), ((void (*)(void *__anonymous_object1760, const char *__anonymous_object1761))__sepSetTuple__F_P9sofstreamPCc__1), ((signed int (*)(void *__anonymous_object1762))__fail__Fi_P9sofstream__1), ((signed int (*)(void *__anonymous_object1763))__flush__Fi_P9sofstream__1), ((void (*)(void *__os__P7tostype_1, const char *__name__PCc_1, const char *__mode__PCc_1))__open__F_P9sofstreamPCcPCc__1), ((void (*)(void *__os__P7tostype_1))__close__F_P9sofstream__1), ((void *(*)(void *__anonymous_object1764, const char *__anonymous_object1765, unsigned long int __anonymous_object1766))__write__FP9sofstream_P9sofstreamPCcUl__1), ((signed int (*)(void *__anonymous_object1767, const char *__fmt__PCc_1, ...))__fmt__Fi_P9sofstreamPCc__1), _p0); 486 } 487 ((void)(((void)(_tmp_cp_ret14=___operator_bitor__A0_1_0_0___sepPrt__PFb_Pd0___sepReset__PF_Pd0___sepReset__PF_Pd0b___sepGetCur__PFPCc_Pd0___sepSetCur__PF_Pd0PCc___getNL__PFb_Pd0___setNL__PF_Pd0b___sepOn__PF_Pd0___sepOff__PF_Pd0___sepDisable__PFb_Pd0___sepEnable__PFb_Pd0___sepGet__PFPCc_Pd0___sepSet__PF_Pd0PCc___sepGetTuple__PFPCc_Pd0___sepSetTuple__PF_Pd0PCc___fail__PFi_Pd0___flush__PFi_Pd0___open__PF_Pd0PCcPCc___close__PF_Pd0___write__PFPd0_Pd0PCcUl___fmt__PFi_Pd0PCc__FPd0_Pd0PFPd0_Pd0___1(((_Bool (*)(void *__anonymous_object1768))__sepPrt__Fb_P9sofstream__1), ((void (*)(void *__anonymous_object1769))__sepReset__F_P9sofstream__1), ((void (*)(void *__anonymous_object1770, _Bool __anonymous_object1771))__sepReset__F_P9sofstreamb__1), ((const char *(*)(void *__anonymous_object1772))__sepGetCur__FPCc_P9sofstream__1), ((void (*)(void *__anonymous_object1773, const char *__anonymous_object1774))__sepSetCur__F_P9sofstreamPCc__1), ((_Bool (*)(void *__anonymous_object1775))__getNL__Fb_P9sofstream__1), ((void (*)(void *__anonymous_object1776, _Bool __anonymous_object1777))__setNL__F_P9sofstreamb__1), ((void (*)(void *__anonymous_object1778))__sepOn__F_P9sofstream__1), ((void (*)(void *__anonymous_object1779))__sepOff__F_P9sofstream__1), ((_Bool (*)(void *__anonymous_object1780))__sepDisable__Fb_P9sofstream__1), ((_Bool (*)(void *__anonymous_object1781))__sepEnable__Fb_P9sofstream__1), ((const char *(*)(void *__anonymous_object1782))__sepGet__FPCc_P9sofstream__1), ((void (*)(void *__anonymous_object1783, const char *__anonymous_object1784))__sepSet__F_P9sofstreamPCc__1), ((const char *(*)(void *__anonymous_object1785))__sepGetTuple__FPCc_P9sofstream__1), ((void (*)(void *__anonymous_object1786, const char *__anonymous_object1787))__sepSetTuple__F_P9sofstreamPCc__1), ((signed int (*)(void *__anonymous_object1788))__fail__Fi_P9sofstream__1), ((signed int (*)(void *__anonymous_object1789))__flush__Fi_P9sofstream__1), ((void (*)(void *__os__P7tostype_1, const char *__name__PCc_1, const char *__mode__PCc_1))__open__F_P9sofstreamPCcPCc__1), ((void (*)(void *__os__P7tostype_1))__close__F_P9sofstream__1), ((void *(*)(void *__anonymous_object1790, const char *__anonymous_object1791, unsigned long int __anonymous_object1792))__write__FP9sofstream_P9sofstreamPCcUl__1), ((signed int (*)(void *__anonymous_object1793, const char *__fmt__PCc_1, ...))__fmt__Fi_P9sofstreamPCc__1), (((void)(_tmp_cp_ret13=___operator_bitor__A0_1_0_0___sepPrt__PFb_Pd0___sepReset__PF_Pd0___sepReset__PF_Pd0b___sepGetCur__PFPCc_Pd0___sepSetCur__PF_Pd0PCc___getNL__PFb_Pd0___setNL__PF_Pd0b___sepOn__PF_Pd0___sepOff__PF_Pd0___sepDisable__PFb_Pd0___sepEnable__PFb_Pd0___sepGet__PFPCc_Pd0___sepSet__PF_Pd0PCc___sepGetTuple__PFPCc_Pd0___sepSetTuple__PF_Pd0PCc___fail__PFi_Pd0___flush__PFi_Pd0___open__PF_Pd0PCcPCc___close__PF_Pd0___write__PFPd0_Pd0PCcUl___fmt__PFi_Pd0PCc__FPd0_Pd0Us__1(((_Bool (*)(void *__anonymous_object1794))__sepPrt__Fb_P9sofstream__1), ((void (*)(void *__anonymous_object1795))__sepReset__F_P9sofstream__1), ((void (*)(void *__anonymous_object1796, _Bool __anonymous_object1797))__sepReset__F_P9sofstreamb__1), ((const char *(*)(void *__anonymous_object1798))__sepGetCur__FPCc_P9sofstream__1), ((void (*)(void *__anonymous_object1799, const char *__anonymous_object1800))__sepSetCur__F_P9sofstreamPCc__1), ((_Bool (*)(void *__anonymous_object1801))__getNL__Fb_P9sofstream__1), ((void (*)(void *__anonymous_object1802, _Bool __anonymous_object1803))__setNL__F_P9sofstreamb__1), ((void (*)(void *__anonymous_object1804))__sepOn__F_P9sofstream__1), ((void (*)(void *__anonymous_object1805))__sepOff__F_P9sofstream__1), ((_Bool (*)(void *__anonymous_object1806))__sepDisable__Fb_P9sofstream__1), ((_Bool (*)(void *__anonymous_object1807))__sepEnable__Fb_P9sofstream__1), ((const char *(*)(void *__anonymous_object1808))__sepGet__FPCc_P9sofstream__1), ((void (*)(void *__anonymous_object1809, const char *__anonymous_object1810))__sepSet__F_P9sofstreamPCc__1), ((const char *(*)(void *__anonymous_object1811))__sepGetTuple__FPCc_P9sofstream__1), ((void (*)(void *__anonymous_object1812, const char *__anonymous_object1813))__sepSetTuple__F_P9sofstreamPCc__1), ((signed int (*)(void *__anonymous_object1814))__fail__Fi_P9sofstream__1), ((signed int (*)(void *__anonymous_object1815))__flush__Fi_P9sofstream__1), ((void (*)(void *__os__P7tostype_1, const char *__name__PCc_1, const char *__mode__PCc_1))__open__F_P9sofstreamPCcPCc__1), ((void (*)(void *__os__P7tostype_1))__close__F_P9sofstream__1), ((void *(*)(void *__anonymous_object1816, const char *__anonymous_object1817, unsigned long int __anonymous_object1818))__write__FP9sofstream_P9sofstreamPCcUl__1), ((signed int (*)(void *__anonymous_object1819, const char *__fmt__PCc_1, ...))__fmt__Fi_P9sofstreamPCc__1), (((void)(_tmp_cp_ret12=___operator_bitor__A0_1_0_0___sepPrt__PFb_Pd0___sepReset__PF_Pd0___sepReset__PF_Pd0b___sepGetCur__PFPCc_Pd0___sepSetCur__PF_Pd0PCc___getNL__PFb_Pd0___setNL__PF_Pd0b___sepOn__PF_Pd0___sepOff__PF_Pd0___sepDisable__PFb_Pd0___sepEnable__PFb_Pd0___sepGet__PFPCc_Pd0___sepSet__PF_Pd0PCc___sepGetTuple__PFPCc_Pd0___sepSetTuple__PF_Pd0PCc___fail__PFi_Pd0___flush__PFi_Pd0___open__PF_Pd0PCcPCc___close__PF_Pd0___write__PFPd0_Pd0PCcUl___fmt__PFi_Pd0PCc__FPd0_Pd0PCc__1(((_Bool (*)(void *__anonymous_object1820))__sepPrt__Fb_P9sofstream__1), ((void (*)(void *__anonymous_object1821))__sepReset__F_P9sofstream__1), ((void (*)(void *__anonymous_object1822, _Bool __anonymous_object1823))__sepReset__F_P9sofstreamb__1), ((const char *(*)(void *__anonymous_object1824))__sepGetCur__FPCc_P9sofstream__1), ((void (*)(void *__anonymous_object1825, const char *__anonymous_object1826))__sepSetCur__F_P9sofstreamPCc__1), ((_Bool (*)(void *__anonymous_object1827))__getNL__Fb_P9sofstream__1), ((void (*)(void *__anonymous_object1828, _Bool __anonymous_object1829))__setNL__F_P9sofstreamb__1), ((void (*)(void *__anonymous_object1830))__sepOn__F_P9sofstream__1), ((void (*)(void *__anonymous_object1831))__sepOff__F_P9sofstream__1), ((_Bool (*)(void *__anonymous_object1832))__sepDisable__Fb_P9sofstream__1), ((_Bool (*)(void *__anonymous_object1833))__sepEnable__Fb_P9sofstream__1), ((const char *(*)(void *__anonymous_object1834))__sepGet__FPCc_P9sofstream__1), ((void (*)(void *__anonymous_object1835, const char *__anonymous_object1836))__sepSet__F_P9sofstreamPCc__1), ((const char *(*)(void *__anonymous_object1837))__sepGetTuple__FPCc_P9sofstream__1), ((void (*)(void *__anonymous_object1838, const char *__anonymous_object1839))__sepSetTuple__F_P9sofstreamPCc__1), ((signed int (*)(void *__anonymous_object1840))__fail__Fi_P9sofstream__1), ((signed int (*)(void *__anonymous_object1841))__flush__Fi_P9sofstream__1), ((void (*)(void *__os__P7tostype_1, const char *__name__PCc_1, const char *__mode__PCc_1))__open__F_P9sofstreamPCcPCc__1), ((void (*)(void *__os__P7tostype_1))__close__F_P9sofstream__1), ((void *(*)(void *__anonymous_object1842, const char *__anonymous_object1843, unsigned long int __anonymous_object1844))__write__FP9sofstream_P9sofstreamPCcUl__1), ((signed int (*)(void *__anonymous_object1845, const char *__fmt__PCc_1, ...))__fmt__Fi_P9sofstreamPCc__1), __sout__P9sofstream_1, "unsigned short int"))) , _tmp_cp_ret12), __v__Us_1))) , _tmp_cp_ret13), ((void *(*)(void *__anonymous_object1846))(&_thunk4))))) , _tmp_cp_ret14)); 519 488 ((void)(_tmp_cp_ret12) /* ^?{} */); 520 489 ((void)(_tmp_cp_ret13) /* ^?{} */); … … 526 495 struct ofstream *_tmp_cp_ret17; 527 496 __attribute__ ((unused)) struct ofstream *_thunk5(struct ofstream *_p0){ 528 return __endl__A0_1_0_0___sepPrt__PFb_Pd0___sepReset__PF_Pd0___sepReset__PF_Pd0b___sepGetCur__PFPCc_Pd0___sepSetCur__PF_Pd0PCc___getNL__PFb_Pd0___setNL__PF_Pd0b___sepOn__PF_Pd0___sepOff__PF_Pd0___sepDisable__PFb_Pd0___sepEnable__PFb_Pd0___sepGet__PFPCc_Pd0___sepSet__PF_Pd0PCc___sepGetTuple__PFPCc_Pd0___sepSetTuple__PF_Pd0PCc___fail__PFi_Pd0___flush__PFi_Pd0___open__PF_Pd0PCcPCc___close__PF_Pd0___write__PFPd0_Pd0PCcUl___fmt__PFi_Pd0PCc__FPd0_Pd0__1(((_Bool (*)(void *__anonymous_object1847))__sepPrt__Fb_P9sofstream__1), ((void (*)(void *__anonymous_object1848))__sepReset__F_P9sofstream__1), ((void (*)(void *__anonymous_object1849, _Bool __anonymous_object1850))__sepReset__F_P9sofstreamb__1), ((const char *(*)(void *__anonymous_object1851))__sepGetCur__FPCc_P9sofstream__1), ((void (*)(void *__anonymous_object1852, const char *__anonymous_object1853))__sepSetCur__F_P9sofstreamPCc__1), ((_Bool (*)(void *__anonymous_object1854))__getNL__Fb_P9sofstream__1), ((void (*)(void *__anonymous_object1855, _Bool __anonymous_object1856))__setNL__F_P9sofstreamb__1), ((void (*)(void *__anonymous_object1857))__sepOn__F_P9sofstream__1), ((void (*)(void *__anonymous_object1858))__sepOff__F_P9sofstream__1), ((_Bool (*)(void *__anonymous_object1859))__sepDisable__Fb_P9sofstream__1), ((_Bool (*)(void *__anonymous_object1860))__sepEnable__Fb_P9sofstream__1), ((const char *(*)(void *__anonymous_object1861))__sepGet__FPCc_P9sofstream__1), ((void (*)(void *__anonymous_object1862, const char *__anonymous_object1863))__sepSet__F_P9sofstreamPCc__1), ((const char *(*)(void *__anonymous_object1864))__sepGetTuple__FPCc_P9sofstream__1), ((void (*)(void *__anonymous_object1865, const char *__anonymous_object1866))__sepSetTuple__F_P9sofstreamPCc__1), ((signed int (*)(void *__anonymous_object1867))__fail__Fi_P9sofstream__1), ((signed int (*)(void *__anonymous_object1868))__flush__Fi_P9sofstream__1), ((void (*)(void *__os__P7tostype_1, const char *__name__PCc_1, const char *__mode__PCc_1))__open__F_P9sofstreamPCcPCc__1), ((void (*)(void *__os__P7tostype_1))__close__F_P9sofstream__1), ((void *(*)(void *__anonymous_object1869, const char *__anonymous_object1870, unsigned long int __anonymous_object1871))__write__FP9sofstream_P9sofstreamPCcUl__1), ((signed int (*)(void *__anonymous_object1872, const char *__fmt__PCc_1, ...))__fmt__Fi_P9sofstreamPCc__1), ((void *)_p0));529 } 530 ((void)(((void)(_tmp_cp_ret17=___operator_bitor__A0_1_0_0___sepPrt__PFb_Pd0___sepReset__PF_Pd0___sepReset__PF_Pd0b___sepGetCur__PFPCc_Pd0___sepSetCur__PF_Pd0PCc___getNL__PFb_Pd0___setNL__PF_Pd0b___sepOn__PF_Pd0___sepOff__PF_Pd0___sepDisable__PFb_Pd0___sepEnable__PFb_Pd0___sepGet__PFPCc_Pd0___sepSet__PF_Pd0PCc___sepGetTuple__PFPCc_Pd0___sepSetTuple__PF_Pd0PCc___fail__PFi_Pd0___flush__PFi_Pd0___open__PF_Pd0PCcPCc___close__PF_Pd0___write__PFPd0_Pd0PCcUl___fmt__PFi_Pd0PCc__FPd0_Pd0PFPd0_Pd0___1(((_Bool (*)(void *__anonymous_object1873))__sepPrt__Fb_P9sofstream__1), ((void (*)(void *__anonymous_object1874))__sepReset__F_P9sofstream__1), ((void (*)(void *__anonymous_object1875, _Bool __anonymous_object1876))__sepReset__F_P9sofstreamb__1), ((const char *(*)(void *__anonymous_object1877))__sepGetCur__FPCc_P9sofstream__1), ((void (*)(void *__anonymous_object1878, const char *__anonymous_object1879))__sepSetCur__F_P9sofstreamPCc__1), ((_Bool (*)(void *__anonymous_object1880))__getNL__Fb_P9sofstream__1), ((void (*)(void *__anonymous_object1881, _Bool __anonymous_object1882))__setNL__F_P9sofstreamb__1), ((void (*)(void *__anonymous_object1883))__sepOn__F_P9sofstream__1), ((void (*)(void *__anonymous_object1884))__sepOff__F_P9sofstream__1), ((_Bool (*)(void *__anonymous_object1885))__sepDisable__Fb_P9sofstream__1), ((_Bool (*)(void *__anonymous_object1886))__sepEnable__Fb_P9sofstream__1), ((const char *(*)(void *__anonymous_object1887))__sepGet__FPCc_P9sofstream__1), ((void (*)(void *__anonymous_object1888, const char *__anonymous_object1889))__sepSet__F_P9sofstreamPCc__1), ((const char *(*)(void *__anonymous_object1890))__sepGetTuple__FPCc_P9sofstream__1), ((void (*)(void *__anonymous_object1891, const char *__anonymous_object1892))__sepSetTuple__F_P9sofstreamPCc__1), ((signed int (*)(void *__anonymous_object1893))__fail__Fi_P9sofstream__1), ((signed int (*)(void *__anonymous_object1894))__flush__Fi_P9sofstream__1), ((void (*)(void *__os__P7tostype_1, const char *__name__PCc_1, const char *__mode__PCc_1))__open__F_P9sofstreamPCcPCc__1), ((void (*)(void *__os__P7tostype_1))__close__F_P9sofstream__1), ((void *(*)(void *__anonymous_object1895, const char *__anonymous_object1896, unsigned long int __anonymous_object1897))__write__FP9sofstream_P9sofstreamPCcUl__1), ((signed int (*)(void *__anonymous_object1898, const char *__fmt__PCc_1, ...))__fmt__Fi_P9sofstreamPCc__1), (( void *)(((void)(_tmp_cp_ret16=___operator_bitor__A0_1_0_0___sepPrt__PFb_Pd0___sepReset__PF_Pd0___sepReset__PF_Pd0b___sepGetCur__PFPCc_Pd0___sepSetCur__PF_Pd0PCc___getNL__PFb_Pd0___setNL__PF_Pd0b___sepOn__PF_Pd0___sepOff__PF_Pd0___sepDisable__PFb_Pd0___sepEnable__PFb_Pd0___sepGet__PFPCc_Pd0___sepSet__PF_Pd0PCc___sepGetTuple__PFPCc_Pd0___sepSetTuple__PF_Pd0PCc___fail__PFi_Pd0___flush__PFi_Pd0___open__PF_Pd0PCcPCc___close__PF_Pd0___write__PFPd0_Pd0PCcUl___fmt__PFi_Pd0PCc__FPd0_Pd0Ul__1(((_Bool (*)(void *__anonymous_object1899))__sepPrt__Fb_P9sofstream__1), ((void (*)(void *__anonymous_object1900))__sepReset__F_P9sofstream__1), ((void (*)(void *__anonymous_object1901, _Bool __anonymous_object1902))__sepReset__F_P9sofstreamb__1), ((const char *(*)(void *__anonymous_object1903))__sepGetCur__FPCc_P9sofstream__1), ((void (*)(void *__anonymous_object1904, const char *__anonymous_object1905))__sepSetCur__F_P9sofstreamPCc__1), ((_Bool (*)(void *__anonymous_object1906))__getNL__Fb_P9sofstream__1), ((void (*)(void *__anonymous_object1907, _Bool __anonymous_object1908))__setNL__F_P9sofstreamb__1), ((void (*)(void *__anonymous_object1909))__sepOn__F_P9sofstream__1), ((void (*)(void *__anonymous_object1910))__sepOff__F_P9sofstream__1), ((_Bool (*)(void *__anonymous_object1911))__sepDisable__Fb_P9sofstream__1), ((_Bool (*)(void *__anonymous_object1912))__sepEnable__Fb_P9sofstream__1), ((const char *(*)(void *__anonymous_object1913))__sepGet__FPCc_P9sofstream__1), ((void (*)(void *__anonymous_object1914, const char *__anonymous_object1915))__sepSet__F_P9sofstreamPCc__1), ((const char *(*)(void *__anonymous_object1916))__sepGetTuple__FPCc_P9sofstream__1), ((void (*)(void *__anonymous_object1917, const char *__anonymous_object1918))__sepSetTuple__F_P9sofstreamPCc__1), ((signed int (*)(void *__anonymous_object1919))__fail__Fi_P9sofstream__1), ((signed int (*)(void *__anonymous_object1920))__flush__Fi_P9sofstream__1), ((void (*)(void *__os__P7tostype_1, const char *__name__PCc_1, const char *__mode__PCc_1))__open__F_P9sofstreamPCcPCc__1), ((void (*)(void *__os__P7tostype_1))__close__F_P9sofstream__1), ((void *(*)(void *__anonymous_object1921, const char *__anonymous_object1922, unsigned long int __anonymous_object1923))__write__FP9sofstream_P9sofstreamPCcUl__1), ((signed int (*)(void *__anonymous_object1924, const char *__fmt__PCc_1, ...))__fmt__Fi_P9sofstreamPCc__1), ((void *)(((void)(_tmp_cp_ret15=___operator_bitor__A0_1_0_0___sepPrt__PFb_Pd0___sepReset__PF_Pd0___sepReset__PF_Pd0b___sepGetCur__PFPCc_Pd0___sepSetCur__PF_Pd0PCc___getNL__PFb_Pd0___setNL__PF_Pd0b___sepOn__PF_Pd0___sepOff__PF_Pd0___sepDisable__PFb_Pd0___sepEnable__PFb_Pd0___sepGet__PFPCc_Pd0___sepSet__PF_Pd0PCc___sepGetTuple__PFPCc_Pd0___sepSetTuple__PF_Pd0PCc___fail__PFi_Pd0___flush__PFi_Pd0___open__PF_Pd0PCcPCc___close__PF_Pd0___write__PFPd0_Pd0PCcUl___fmt__PFi_Pd0PCc__FPd0_Pd0PCc__1(((_Bool (*)(void *__anonymous_object1925))__sepPrt__Fb_P9sofstream__1), ((void (*)(void *__anonymous_object1926))__sepReset__F_P9sofstream__1), ((void (*)(void *__anonymous_object1927, _Bool __anonymous_object1928))__sepReset__F_P9sofstreamb__1), ((const char *(*)(void *__anonymous_object1929))__sepGetCur__FPCc_P9sofstream__1), ((void (*)(void *__anonymous_object1930, const char *__anonymous_object1931))__sepSetCur__F_P9sofstreamPCc__1), ((_Bool (*)(void *__anonymous_object1932))__getNL__Fb_P9sofstream__1), ((void (*)(void *__anonymous_object1933, _Bool __anonymous_object1934))__setNL__F_P9sofstreamb__1), ((void (*)(void *__anonymous_object1935))__sepOn__F_P9sofstream__1), ((void (*)(void *__anonymous_object1936))__sepOff__F_P9sofstream__1), ((_Bool (*)(void *__anonymous_object1937))__sepDisable__Fb_P9sofstream__1), ((_Bool (*)(void *__anonymous_object1938))__sepEnable__Fb_P9sofstream__1), ((const char *(*)(void *__anonymous_object1939))__sepGet__FPCc_P9sofstream__1), ((void (*)(void *__anonymous_object1940, const char *__anonymous_object1941))__sepSet__F_P9sofstreamPCc__1), ((const char *(*)(void *__anonymous_object1942))__sepGetTuple__FPCc_P9sofstream__1), ((void (*)(void *__anonymous_object1943, const char *__anonymous_object1944))__sepSetTuple__F_P9sofstreamPCc__1), ((signed int (*)(void *__anonymous_object1945))__fail__Fi_P9sofstream__1), ((signed int (*)(void *__anonymous_object1946))__flush__Fi_P9sofstream__1), ((void (*)(void *__os__P7tostype_1, const char *__name__PCc_1, const char *__mode__PCc_1))__open__F_P9sofstreamPCcPCc__1), ((void (*)(void *__os__P7tostype_1))__close__F_P9sofstream__1), ((void *(*)(void *__anonymous_object1947, const char *__anonymous_object1948, unsigned long int __anonymous_object1949))__write__FP9sofstream_P9sofstreamPCcUl__1), ((signed int (*)(void *__anonymous_object1950, const char *__fmt__PCc_1, ...))__fmt__Fi_P9sofstreamPCc__1), ((void *)__sout__P9sofstream_1), "size_t"))) , _tmp_cp_ret15)), __v__Ul_1))) , _tmp_cp_ret16)), ((void *(*)(void *__anonymous_object1951))(&_thunk5))))) , _tmp_cp_ret17));497 return __endl__A0_1_0_0___sepPrt__PFb_Pd0___sepReset__PF_Pd0___sepReset__PF_Pd0b___sepGetCur__PFPCc_Pd0___sepSetCur__PF_Pd0PCc___getNL__PFb_Pd0___setNL__PF_Pd0b___sepOn__PF_Pd0___sepOff__PF_Pd0___sepDisable__PFb_Pd0___sepEnable__PFb_Pd0___sepGet__PFPCc_Pd0___sepSet__PF_Pd0PCc___sepGetTuple__PFPCc_Pd0___sepSetTuple__PF_Pd0PCc___fail__PFi_Pd0___flush__PFi_Pd0___open__PF_Pd0PCcPCc___close__PF_Pd0___write__PFPd0_Pd0PCcUl___fmt__PFi_Pd0PCc__FPd0_Pd0__1(((_Bool (*)(void *__anonymous_object1847))__sepPrt__Fb_P9sofstream__1), ((void (*)(void *__anonymous_object1848))__sepReset__F_P9sofstream__1), ((void (*)(void *__anonymous_object1849, _Bool __anonymous_object1850))__sepReset__F_P9sofstreamb__1), ((const char *(*)(void *__anonymous_object1851))__sepGetCur__FPCc_P9sofstream__1), ((void (*)(void *__anonymous_object1852, const char *__anonymous_object1853))__sepSetCur__F_P9sofstreamPCc__1), ((_Bool (*)(void *__anonymous_object1854))__getNL__Fb_P9sofstream__1), ((void (*)(void *__anonymous_object1855, _Bool __anonymous_object1856))__setNL__F_P9sofstreamb__1), ((void (*)(void *__anonymous_object1857))__sepOn__F_P9sofstream__1), ((void (*)(void *__anonymous_object1858))__sepOff__F_P9sofstream__1), ((_Bool (*)(void *__anonymous_object1859))__sepDisable__Fb_P9sofstream__1), ((_Bool (*)(void *__anonymous_object1860))__sepEnable__Fb_P9sofstream__1), ((const char *(*)(void *__anonymous_object1861))__sepGet__FPCc_P9sofstream__1), ((void (*)(void *__anonymous_object1862, const char *__anonymous_object1863))__sepSet__F_P9sofstreamPCc__1), ((const char *(*)(void *__anonymous_object1864))__sepGetTuple__FPCc_P9sofstream__1), ((void (*)(void *__anonymous_object1865, const char *__anonymous_object1866))__sepSetTuple__F_P9sofstreamPCc__1), ((signed int (*)(void *__anonymous_object1867))__fail__Fi_P9sofstream__1), ((signed int (*)(void *__anonymous_object1868))__flush__Fi_P9sofstream__1), ((void (*)(void *__os__P7tostype_1, const char *__name__PCc_1, const char *__mode__PCc_1))__open__F_P9sofstreamPCcPCc__1), ((void (*)(void *__os__P7tostype_1))__close__F_P9sofstream__1), ((void *(*)(void *__anonymous_object1869, const char *__anonymous_object1870, unsigned long int __anonymous_object1871))__write__FP9sofstream_P9sofstreamPCcUl__1), ((signed int (*)(void *__anonymous_object1872, const char *__fmt__PCc_1, ...))__fmt__Fi_P9sofstreamPCc__1), _p0); 498 } 499 ((void)(((void)(_tmp_cp_ret17=___operator_bitor__A0_1_0_0___sepPrt__PFb_Pd0___sepReset__PF_Pd0___sepReset__PF_Pd0b___sepGetCur__PFPCc_Pd0___sepSetCur__PF_Pd0PCc___getNL__PFb_Pd0___setNL__PF_Pd0b___sepOn__PF_Pd0___sepOff__PF_Pd0___sepDisable__PFb_Pd0___sepEnable__PFb_Pd0___sepGet__PFPCc_Pd0___sepSet__PF_Pd0PCc___sepGetTuple__PFPCc_Pd0___sepSetTuple__PF_Pd0PCc___fail__PFi_Pd0___flush__PFi_Pd0___open__PF_Pd0PCcPCc___close__PF_Pd0___write__PFPd0_Pd0PCcUl___fmt__PFi_Pd0PCc__FPd0_Pd0PFPd0_Pd0___1(((_Bool (*)(void *__anonymous_object1873))__sepPrt__Fb_P9sofstream__1), ((void (*)(void *__anonymous_object1874))__sepReset__F_P9sofstream__1), ((void (*)(void *__anonymous_object1875, _Bool __anonymous_object1876))__sepReset__F_P9sofstreamb__1), ((const char *(*)(void *__anonymous_object1877))__sepGetCur__FPCc_P9sofstream__1), ((void (*)(void *__anonymous_object1878, const char *__anonymous_object1879))__sepSetCur__F_P9sofstreamPCc__1), ((_Bool (*)(void *__anonymous_object1880))__getNL__Fb_P9sofstream__1), ((void (*)(void *__anonymous_object1881, _Bool __anonymous_object1882))__setNL__F_P9sofstreamb__1), ((void (*)(void *__anonymous_object1883))__sepOn__F_P9sofstream__1), ((void (*)(void *__anonymous_object1884))__sepOff__F_P9sofstream__1), ((_Bool (*)(void *__anonymous_object1885))__sepDisable__Fb_P9sofstream__1), ((_Bool (*)(void *__anonymous_object1886))__sepEnable__Fb_P9sofstream__1), ((const char *(*)(void *__anonymous_object1887))__sepGet__FPCc_P9sofstream__1), ((void (*)(void *__anonymous_object1888, const char *__anonymous_object1889))__sepSet__F_P9sofstreamPCc__1), ((const char *(*)(void *__anonymous_object1890))__sepGetTuple__FPCc_P9sofstream__1), ((void (*)(void *__anonymous_object1891, const char *__anonymous_object1892))__sepSetTuple__F_P9sofstreamPCc__1), ((signed int (*)(void *__anonymous_object1893))__fail__Fi_P9sofstream__1), ((signed int (*)(void *__anonymous_object1894))__flush__Fi_P9sofstream__1), ((void (*)(void *__os__P7tostype_1, const char *__name__PCc_1, const char *__mode__PCc_1))__open__F_P9sofstreamPCcPCc__1), ((void (*)(void *__os__P7tostype_1))__close__F_P9sofstream__1), ((void *(*)(void *__anonymous_object1895, const char *__anonymous_object1896, unsigned long int __anonymous_object1897))__write__FP9sofstream_P9sofstreamPCcUl__1), ((signed int (*)(void *__anonymous_object1898, const char *__fmt__PCc_1, ...))__fmt__Fi_P9sofstreamPCc__1), (((void)(_tmp_cp_ret16=___operator_bitor__A0_1_0_0___sepPrt__PFb_Pd0___sepReset__PF_Pd0___sepReset__PF_Pd0b___sepGetCur__PFPCc_Pd0___sepSetCur__PF_Pd0PCc___getNL__PFb_Pd0___setNL__PF_Pd0b___sepOn__PF_Pd0___sepOff__PF_Pd0___sepDisable__PFb_Pd0___sepEnable__PFb_Pd0___sepGet__PFPCc_Pd0___sepSet__PF_Pd0PCc___sepGetTuple__PFPCc_Pd0___sepSetTuple__PF_Pd0PCc___fail__PFi_Pd0___flush__PFi_Pd0___open__PF_Pd0PCcPCc___close__PF_Pd0___write__PFPd0_Pd0PCcUl___fmt__PFi_Pd0PCc__FPd0_Pd0Ul__1(((_Bool (*)(void *__anonymous_object1899))__sepPrt__Fb_P9sofstream__1), ((void (*)(void *__anonymous_object1900))__sepReset__F_P9sofstream__1), ((void (*)(void *__anonymous_object1901, _Bool __anonymous_object1902))__sepReset__F_P9sofstreamb__1), ((const char *(*)(void *__anonymous_object1903))__sepGetCur__FPCc_P9sofstream__1), ((void (*)(void *__anonymous_object1904, const char *__anonymous_object1905))__sepSetCur__F_P9sofstreamPCc__1), ((_Bool (*)(void *__anonymous_object1906))__getNL__Fb_P9sofstream__1), ((void (*)(void *__anonymous_object1907, _Bool __anonymous_object1908))__setNL__F_P9sofstreamb__1), ((void (*)(void *__anonymous_object1909))__sepOn__F_P9sofstream__1), ((void (*)(void *__anonymous_object1910))__sepOff__F_P9sofstream__1), ((_Bool (*)(void *__anonymous_object1911))__sepDisable__Fb_P9sofstream__1), ((_Bool (*)(void *__anonymous_object1912))__sepEnable__Fb_P9sofstream__1), ((const char *(*)(void *__anonymous_object1913))__sepGet__FPCc_P9sofstream__1), ((void (*)(void *__anonymous_object1914, const char *__anonymous_object1915))__sepSet__F_P9sofstreamPCc__1), ((const char *(*)(void *__anonymous_object1916))__sepGetTuple__FPCc_P9sofstream__1), ((void (*)(void *__anonymous_object1917, const char *__anonymous_object1918))__sepSetTuple__F_P9sofstreamPCc__1), ((signed int (*)(void *__anonymous_object1919))__fail__Fi_P9sofstream__1), ((signed int (*)(void *__anonymous_object1920))__flush__Fi_P9sofstream__1), ((void (*)(void *__os__P7tostype_1, const char *__name__PCc_1, const char *__mode__PCc_1))__open__F_P9sofstreamPCcPCc__1), ((void (*)(void *__os__P7tostype_1))__close__F_P9sofstream__1), ((void *(*)(void *__anonymous_object1921, const char *__anonymous_object1922, unsigned long int __anonymous_object1923))__write__FP9sofstream_P9sofstreamPCcUl__1), ((signed int (*)(void *__anonymous_object1924, const char *__fmt__PCc_1, ...))__fmt__Fi_P9sofstreamPCc__1), (((void)(_tmp_cp_ret15=___operator_bitor__A0_1_0_0___sepPrt__PFb_Pd0___sepReset__PF_Pd0___sepReset__PF_Pd0b___sepGetCur__PFPCc_Pd0___sepSetCur__PF_Pd0PCc___getNL__PFb_Pd0___setNL__PF_Pd0b___sepOn__PF_Pd0___sepOff__PF_Pd0___sepDisable__PFb_Pd0___sepEnable__PFb_Pd0___sepGet__PFPCc_Pd0___sepSet__PF_Pd0PCc___sepGetTuple__PFPCc_Pd0___sepSetTuple__PF_Pd0PCc___fail__PFi_Pd0___flush__PFi_Pd0___open__PF_Pd0PCcPCc___close__PF_Pd0___write__PFPd0_Pd0PCcUl___fmt__PFi_Pd0PCc__FPd0_Pd0PCc__1(((_Bool (*)(void *__anonymous_object1925))__sepPrt__Fb_P9sofstream__1), ((void (*)(void *__anonymous_object1926))__sepReset__F_P9sofstream__1), ((void (*)(void *__anonymous_object1927, _Bool __anonymous_object1928))__sepReset__F_P9sofstreamb__1), ((const char *(*)(void *__anonymous_object1929))__sepGetCur__FPCc_P9sofstream__1), ((void (*)(void *__anonymous_object1930, const char *__anonymous_object1931))__sepSetCur__F_P9sofstreamPCc__1), ((_Bool (*)(void *__anonymous_object1932))__getNL__Fb_P9sofstream__1), ((void (*)(void *__anonymous_object1933, _Bool __anonymous_object1934))__setNL__F_P9sofstreamb__1), ((void (*)(void *__anonymous_object1935))__sepOn__F_P9sofstream__1), ((void (*)(void *__anonymous_object1936))__sepOff__F_P9sofstream__1), ((_Bool (*)(void *__anonymous_object1937))__sepDisable__Fb_P9sofstream__1), ((_Bool (*)(void *__anonymous_object1938))__sepEnable__Fb_P9sofstream__1), ((const char *(*)(void *__anonymous_object1939))__sepGet__FPCc_P9sofstream__1), ((void (*)(void *__anonymous_object1940, const char *__anonymous_object1941))__sepSet__F_P9sofstreamPCc__1), ((const char *(*)(void *__anonymous_object1942))__sepGetTuple__FPCc_P9sofstream__1), ((void (*)(void *__anonymous_object1943, const char *__anonymous_object1944))__sepSetTuple__F_P9sofstreamPCc__1), ((signed int (*)(void *__anonymous_object1945))__fail__Fi_P9sofstream__1), ((signed int (*)(void *__anonymous_object1946))__flush__Fi_P9sofstream__1), ((void (*)(void *__os__P7tostype_1, const char *__name__PCc_1, const char *__mode__PCc_1))__open__F_P9sofstreamPCcPCc__1), ((void (*)(void *__os__P7tostype_1))__close__F_P9sofstream__1), ((void *(*)(void *__anonymous_object1947, const char *__anonymous_object1948, unsigned long int __anonymous_object1949))__write__FP9sofstream_P9sofstreamPCcUl__1), ((signed int (*)(void *__anonymous_object1950, const char *__fmt__PCc_1, ...))__fmt__Fi_P9sofstreamPCc__1), __sout__P9sofstream_1, "size_t"))) , _tmp_cp_ret15), __v__Ul_1))) , _tmp_cp_ret16), ((void *(*)(void *__anonymous_object1951))(&_thunk5))))) , _tmp_cp_ret17)); 531 500 ((void)(_tmp_cp_ret15) /* ^?{} */); 532 501 ((void)(_tmp_cp_ret16) /* ^?{} */); … … 739 708 ((void)0123456789.e-09L); 740 709 ((void)0123456789.e-09DL); 741 ((void)( +0123456789.e-09));742 ((void)( +0123456789.e-09f));743 ((void)( +0123456789.e-09l));744 ((void)( +0123456789.e-09F));745 ((void)( +0123456789.e-09L));746 ((void)( +0123456789.e-09DL));710 ((void)(-0123456789.e-09)); 711 ((void)(-0123456789.e-09f)); 712 ((void)(-0123456789.e-09l)); 713 ((void)(-0123456789.e-09F)); 714 ((void)(-0123456789.e-09L)); 715 ((void)(-0123456789.e-09DL)); 747 716 ((void)(-0123456789.e-09)); 748 717 ((void)(-0123456789.e-09f)); … … 883 852 ((void)0123456789.0123456789E-09L); 884 853 ((void)0123456789.0123456789E-09DL); 885 ((void)( +0123456789.0123456789E-09));886 ((void)( +0123456789.0123456789E-09f));887 ((void)( +0123456789.0123456789E-09l));888 ((void)( +0123456789.0123456789E-09F));889 ((void)( +0123456789.0123456789E-09L));890 ((void)( +0123456789.0123456789E-09DL));854 ((void)(-0123456789.0123456789E-09)); 855 ((void)(-0123456789.0123456789E-09f)); 856 ((void)(-0123456789.0123456789E-09l)); 857 ((void)(-0123456789.0123456789E-09F)); 858 ((void)(-0123456789.0123456789E-09L)); 859 ((void)(-0123456789.0123456789E-09DL)); 891 860 ((void)(-0123456789.0123456789E-09)); 892 861 ((void)(-0123456789.0123456789E-09f)); … … 930 899 ((void)0x0123456789.p-09F); 931 900 ((void)0x0123456789.p-09L); 932 ((void)( +0x0123456789.p-09));933 ((void)( +0x0123456789.p-09f));934 ((void)( +0x0123456789.p-09l));935 ((void)( +0x0123456789.p-09F));936 ((void)( +0x0123456789.p-09L));901 ((void)(-0x0123456789.p-09)); 902 ((void)(-0x0123456789.p-09f)); 903 ((void)(-0x0123456789.p-09l)); 904 ((void)(-0x0123456789.p-09F)); 905 ((void)(-0x0123456789.p-09L)); 937 906 ((void)(-0x0123456789.p-09)); 938 907 ((void)(-0x0123456789.p-09f)); … … 975 944 ((void)0x.0123456789P-09F); 976 945 ((void)0x.0123456789P-09L); 977 ((void)( +0x.0123456789P-09));978 ((void)( +0x.0123456789P-09f));979 ((void)( +0x.0123456789P-09l));980 ((void)( +0x.0123456789P-09F));981 ((void)( +0x.0123456789P-09L));946 ((void)(-0x.0123456789P-09)); 947 ((void)(-0x.0123456789P-09f)); 948 ((void)(-0x.0123456789P-09l)); 949 ((void)(-0x.0123456789P-09F)); 950 ((void)(-0x.0123456789P-09L)); 982 951 ((void)(-0x.0123456789P-09)); 983 952 ((void)(-0x.0123456789P-09f)); … … 1020 989 ((void)0X0123456789.0123456789P-09F); 1021 990 ((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));1027 991 ((void)(-0X0123456789.0123456789P-09)); 1028 992 ((void)(-0X0123456789.0123456789P-09f)); … … 1030 994 ((void)(-0X0123456789.0123456789P-09F)); 1031 995 ((void)(-0X0123456789.0123456789P-09L)); 1032 ((void)((signed char )01234567)); 1033 ((void)((signed short int )01234567)); 1034 ((void)((signed int )01234567)); 1035 ((void)((signed long int )01234567)); 1036 ((void)((__int128 )01234567)); 1037 ((void)((unsigned char )01234567u)); 1038 ((void)((signed short int )01234567u)); 1039 ((void)((unsigned int )01234567u)); 1040 ((void)((signed long int )01234567u)); 1041 ((void)((__int128 )01234567u)); 1042 ((void)(+((signed int )((signed char )01234567)))); 1043 ((void)(+((signed int )((signed short int )01234567)))); 1044 ((void)(+((signed int )01234567))); 1045 ((void)(+((signed long int )01234567))); 1046 ((void)(+((float )((__int128 )01234567)))); 1047 ((void)(+((signed int )((unsigned char )01234567u)))); 1048 ((void)(+((signed int )((signed short int )01234567u)))); 1049 ((void)(+((unsigned int )01234567u))); 1050 ((void)(+((signed long int )01234567u))); 1051 ((void)(+((float )((__int128 )01234567u)))); 1052 ((void)(-((signed int )((signed char )01234567)))); 1053 ((void)(-((signed int )((signed short int )01234567)))); 1054 ((void)(-((signed int )01234567))); 1055 ((void)(-((signed long int )01234567))); 1056 ((void)(-((float )((__int128 )01234567)))); 1057 ((void)(-((signed int )((unsigned char )01234567u)))); 1058 ((void)(-((signed int )((signed short int )01234567u)))); 1059 ((void)(-((unsigned int )01234567u))); 1060 ((void)(-((signed long int )01234567u))); 1061 ((void)(-((float )((__int128 )01234567u)))); 1062 ((void)((signed char )1234567890)); 1063 ((void)((signed short int )1234567890)); 1064 ((void)((signed int )1234567890)); 1065 ((void)((signed long int )1234567890)); 1066 ((void)((__int128 )1234567890)); 1067 ((void)((signed char )1234567890U)); 1068 ((void)((unsigned short int )1234567890U)); 1069 ((void)((signed int )1234567890U)); 1070 ((void)((unsigned long int )1234567890u)); 1071 ((void)((unsigned __int128 )1234567890u)); 1072 ((void)(+((signed int )((signed char )1234567890)))); 1073 ((void)(+((signed int )((signed short int )1234567890)))); 1074 ((void)(+((signed int )1234567890))); 1075 ((void)(+((signed long int )1234567890))); 1076 ((void)(+((float )((__int128 )1234567890)))); 1077 ((void)(+((signed int )((signed char )1234567890U)))); 1078 ((void)(+((signed int )((unsigned short int )1234567890U)))); 1079 ((void)(+((signed int )1234567890U))); 1080 ((void)(+((unsigned long int )1234567890u))); 1081 ((void)(+((float )((unsigned __int128 )1234567890u)))); 1082 ((void)(-((signed int )((signed char )1234567890)))); 1083 ((void)(-((signed int )((signed short int )1234567890)))); 1084 ((void)(-((signed int )1234567890))); 1085 ((void)(-((signed long int )1234567890))); 1086 ((void)(-((float )((__int128 )1234567890)))); 1087 ((void)(-((signed int )((signed char )1234567890U)))); 1088 ((void)(-((signed int )((unsigned short int )1234567890U)))); 1089 ((void)(-((signed int )1234567890U))); 1090 ((void)(-((unsigned long int )1234567890u))); 1091 ((void)(-((float )((unsigned __int128 )1234567890u)))); 1092 ((void)((signed char )0x0123456789abcdef)); 1093 ((void)((signed short int )0x0123456789abcdef)); 1094 ((void)((signed int )0x0123456789abcdef)); 1095 ((void)((signed long int )0x0123456789abcdef)); 1096 ((void)((signed char )0x0123456789abcdefu)); 1097 ((void)((unsigned short int )0x0123456789abcdefu)); 1098 ((void)((signed int )0x0123456789abcdefu)); 1099 ((void)((unsigned long int )0x0123456789abcdefu)); 1100 ((void)(+((signed int )((signed char )0x0123456789abcdef)))); 1101 ((void)(+((signed int )((signed short int )0x0123456789abcdef)))); 1102 ((void)(+((signed int )0x0123456789abcdef))); 1103 ((void)(+((signed long int )0x0123456789abcdef))); 1104 ((void)(+((signed int )((signed char )0x0123456789abcdefu)))); 1105 ((void)(+((signed int )((unsigned short int )0x0123456789abcdefu)))); 1106 ((void)(+((signed int )0x0123456789abcdefu))); 1107 ((void)(+((unsigned long int )0x0123456789abcdefu))); 1108 ((void)(-((signed int )((signed char )0x0123456789abcdef)))); 1109 ((void)(-((signed int )((signed short int )0x0123456789abcdef)))); 1110 ((void)(-((signed int )0x0123456789abcdef))); 1111 ((void)(-((signed long int )0x0123456789abcdef))); 1112 ((void)(-((signed int )((signed char )0x0123456789abcdefu)))); 1113 ((void)(-((signed int )((unsigned short int )0x0123456789abcdefu)))); 1114 ((void)(-((signed int )0x0123456789abcdefu))); 1115 ((void)(-((unsigned long int )0x0123456789abcdefu))); 1116 ((void)((signed char )0x0123456789ABCDEF)); 1117 ((void)((signed short int )0x0123456789ABCDEF)); 1118 ((void)((signed int )0x0123456789ABCDEF)); 1119 ((void)((signed long int )0x0123456789ABCDEF)); 1120 ((void)((signed char )0x0123456789ABCDEFu)); 1121 ((void)((unsigned short int )0x0123456789ABCDEFu)); 1122 ((void)((signed int )0x0123456789ABCDEFu)); 1123 ((void)((unsigned long int )0x0123456789ABCDEFu)); 1124 ((void)(+((signed int )((signed char )0x0123456789ABCDEF)))); 1125 ((void)(+((signed int )((signed short int )0x0123456789ABCDEF)))); 1126 ((void)(+((signed int )0x0123456789ABCDEF))); 1127 ((void)(+((signed long int )0x0123456789ABCDEF))); 1128 ((void)(+((signed int )((signed char )0x0123456789ABCDEFu)))); 1129 ((void)(+((signed int )((unsigned short int )0x0123456789ABCDEFu)))); 1130 ((void)(+((signed int )0x0123456789ABCDEFu))); 1131 ((void)(+((unsigned long int )0x0123456789ABCDEFu))); 1132 ((void)(-((signed int )((signed char )0x0123456789ABCDEF)))); 1133 ((void)(-((signed int )((signed short int )0x0123456789ABCDEF)))); 1134 ((void)(-((signed int )0x0123456789ABCDEF))); 1135 ((void)(-((signed long int )0x0123456789ABCDEF))); 1136 ((void)(-((signed int )((signed char )0x0123456789ABCDEFu)))); 1137 ((void)(-((signed int )((unsigned short int )0x0123456789ABCDEFu)))); 1138 ((void)(-((signed int )0x0123456789ABCDEFu))); 1139 ((void)(-((unsigned long int )0x0123456789ABCDEFu))); 1140 ((void)((signed char )0X0123456789abcdef)); 1141 ((void)((signed short int )0X0123456789abcdef)); 1142 ((void)((signed int )0X0123456789abcdef)); 1143 ((void)((signed long int )0X0123456789abcdef)); 1144 ((void)((signed char )0X0123456789abcdefu)); 1145 ((void)((unsigned short int )0X0123456789abcdefu)); 1146 ((void)((signed int )0X0123456789abcdefu)); 1147 ((void)((unsigned long int )0X0123456789abcdefu)); 1148 ((void)(+((signed int )((signed char )0X0123456789abcdef)))); 1149 ((void)(+((signed int )((signed short int )0X0123456789abcdef)))); 1150 ((void)(+((signed int )0X0123456789abcdef))); 1151 ((void)(+((signed long int )0X0123456789abcdef))); 1152 ((void)(+((signed int )((signed char )0X0123456789abcdefu)))); 1153 ((void)(+((signed int )((unsigned short int )0X0123456789abcdefu)))); 1154 ((void)(+((signed int )0X0123456789abcdefu))); 1155 ((void)(+((unsigned long int )0X0123456789abcdefu))); 1156 ((void)(-((signed int )((signed char )0X0123456789abcdef)))); 1157 ((void)(-((signed int )((signed short int )0X0123456789abcdef)))); 1158 ((void)(-((signed int )0X0123456789abcdef))); 1159 ((void)(-((signed long int )0X0123456789abcdef))); 1160 ((void)(-((signed int )((signed char )0X0123456789abcdefu)))); 1161 ((void)(-((signed int )((unsigned short int )0X0123456789abcdefu)))); 1162 ((void)(-((signed int )0X0123456789abcdefu))); 1163 ((void)(-((unsigned long int )0X0123456789abcdefu))); 1164 ((void)((signed char )0X0123456789ABCDEF)); 1165 ((void)((signed short int )0X0123456789ABCDEF)); 1166 ((void)((signed int )0X0123456789ABCDEF)); 1167 ((void)((signed long int )0X0123456789ABCDEF)); 1168 ((void)((signed char )0X0123456789ABCDEFu)); 1169 ((void)((unsigned short int )0X0123456789ABCDEFu)); 1170 ((void)((signed int )0X0123456789ABCDEFu)); 1171 ((void)((unsigned long int )0X0123456789ABCDEFu)); 1172 ((void)(+((signed int )((signed char )0X0123456789ABCDEF)))); 1173 ((void)(+((signed int )((signed short int )0X0123456789ABCDEF)))); 1174 ((void)(+((signed int )0X0123456789ABCDEF))); 1175 ((void)(+((signed long int )0X0123456789ABCDEF))); 1176 ((void)(+((signed int )((signed char )0X0123456789ABCDEFu)))); 1177 ((void)(+((signed int )((unsigned short int )0X0123456789ABCDEFu)))); 1178 ((void)(+((signed int )0X0123456789ABCDEFu))); 1179 ((void)(+((unsigned long int )0X0123456789ABCDEFu))); 1180 ((void)(-((signed int )((signed char )0X0123456789ABCDEF)))); 1181 ((void)(-((signed int )((signed short int )0X0123456789ABCDEF)))); 1182 ((void)(-((signed int )0X0123456789ABCDEF))); 1183 ((void)(-((signed long int )0X0123456789ABCDEF))); 1184 ((void)(-((signed int )((signed char )0X0123456789ABCDEFu)))); 1185 ((void)(-((signed int )((unsigned short int )0X0123456789ABCDEFu)))); 1186 ((void)(-((signed int )0X0123456789ABCDEFu))); 1187 ((void)(-((unsigned long int )0X0123456789ABCDEFu))); 1188 ((void)((float )0123456789.)); 1189 ((void)((double )0123456789.)); 1190 ((void)((long double )0123456789.)); 1191 ((void)((long double )0123456789.)); 1192 ((void)(+((float )0123456789.))); 1193 ((void)(+((double )0123456789.))); 1194 ((void)(+((long double )0123456789.))); 1195 ((void)(+((long double )0123456789.))); 1196 ((void)(-((float )0123456789.))); 1197 ((void)(-((double )0123456789.))); 1198 ((void)(-((long double )0123456789.))); 1199 ((void)(-((long double )0123456789.))); 1200 ((void)((float )0123456789.e09)); 1201 ((void)((double )0123456789.e09)); 1202 ((void)((long double )0123456789.e09)); 1203 ((void)((long double )0123456789.e09)); 1204 ((void)(+((float )0123456789.e+09))); 1205 ((void)(+((double )0123456789.e+09))); 1206 ((void)(+((long double )0123456789.e+09))); 1207 ((void)(+((long double )0123456789.e+09))); 1208 ((void)(-((float )0123456789.e-09))); 1209 ((void)(-((double )0123456789.e-09))); 1210 ((void)(-((long double )0123456789.e-09))); 1211 ((void)(-((long double )0123456789.e-09))); 1212 ((void)((float ).0123456789e09)); 1213 ((void)((double ).0123456789e09)); 1214 ((void)((long double ).0123456789e09)); 1215 ((void)((long double ).0123456789e09)); 1216 ((void)(+((float ).0123456789E+09))); 1217 ((void)(+((double ).0123456789E+09))); 1218 ((void)(+((long double ).0123456789E+09))); 1219 ((void)(+((long double ).0123456789E+09))); 1220 ((void)(-((float ).0123456789E-09))); 1221 ((void)(-((double ).0123456789E-09))); 1222 ((void)(-((long double ).0123456789E-09))); 1223 ((void)(-((long double ).0123456789E-09))); 1224 ((void)((float )0123456789.0123456789)); 1225 ((void)((double )0123456789.0123456789)); 1226 ((void)((long double )0123456789.0123456789)); 1227 ((void)((long double )0123456789.0123456789)); 1228 ((void)(+((float )0123456789.0123456789E09))); 1229 ((void)(+((double )0123456789.0123456789E09))); 1230 ((void)(+((long double )0123456789.0123456789E09))); 1231 ((void)(+((long double )0123456789.0123456789E09))); 1232 ((void)(-((float )0123456789.0123456789E+09))); 1233 ((void)(-((double )0123456789.0123456789E+09))); 1234 ((void)(-((long double )0123456789.0123456789E+09))); 1235 ((void)(-((long double )0123456789.0123456789E+09))); 1236 ((void)((float )0123456789.0123456789E-09)); 1237 ((void)((double )0123456789.0123456789E-09)); 1238 ((void)((long double )0123456789.0123456789E-09)); 1239 ((void)((long double )0123456789.0123456789E-09)); 1240 ((void)((float )0x0123456789.p09)); 1241 ((void)((double )0x0123456789.p09)); 1242 ((void)((long double )0x0123456789.p09)); 1243 ((void)((long double )0x0123456789.p09)); 1244 ((void)(+((float )0x0123456789.p09))); 1245 ((void)(+((double )0x0123456789.p09))); 1246 ((void)(+((long double )0x0123456789.p09))); 1247 ((void)(+((long double )0x0123456789.p09))); 1248 ((void)(-((float )0x0123456789.p09))); 1249 ((void)(-((double )0x0123456789.p09))); 1250 ((void)(-((long double )0x0123456789.p09))); 1251 ((void)(-((long double )0x0123456789.p09))); 1252 ((void)((float )0x0123456789.p+09)); 1253 ((void)((double )0x0123456789.p+09)); 1254 ((void)((long double )0x0123456789.p+09)); 1255 ((void)((long double )0x0123456789.p+09)); 1256 ((void)(+((float )0x0123456789.p-09))); 1257 ((void)(+((double )0x0123456789.p-09))); 1258 ((void)(+((long double )0x0123456789.p-09))); 1259 ((void)(+((long double )0x0123456789.p-09))); 1260 ((void)(-((float )0x.0123456789p09))); 1261 ((void)(-((double )0x.0123456789p09))); 1262 ((void)(-((long double )0x.0123456789p09))); 1263 ((void)(-((long double )0x.0123456789p09))); 996 ((void)(-0X0123456789.0123456789P-09)); 997 ((void)(-0X0123456789.0123456789P-09f)); 998 ((void)(-0X0123456789.0123456789P-09l)); 999 ((void)(-0X0123456789.0123456789P-09F)); 1000 ((void)(-0X0123456789.0123456789P-09L)); 1264 1001 ((void)__f__F_c__1('a')); 1265 1002 ((void)__f__F_Sc__1(20)); … … 1374 1111 ((void)L"a" "b" "c"); 1375 1112 ((void)(___retval_main__i_1=0) /* ?{} */); 1376 return ___retval_main__i_1;1113 return ((signed int )___retval_main__i_1); 1377 1114 } 1378 1115 static inline int invoke_main(int argc, char* argv[], char* envp[]) { (void)argc; (void)argv; (void)envp; return __main__Fi___1(); } … … 1389 1126 ((void)(___retval_main__i_1=(((void)(_tmp_cp_ret0=invoke_main(__argc__i_1, __argv__PPc_1, __envp__PPc_1))) , _tmp_cp_ret0)) /* ?{} */); 1390 1127 ((void)(_tmp_cp_ret0) /* ^?{} */); 1391 return ___retval_main__i_1;1392 } 1128 return ((signed int )___retval_main__i_1); 1129 } -
src/tests/.expect/castError.txt
r3f7e12cb r78315272 1 castError.c:7:1 error: Cannot choose between 3 alternatives for expression 2 Cast of: 1 castError.c:7:1 error: Cannot choose between 3 alternatives for expression Cast of: 3 2 Name: f 4 ... to:5 charAlternatives are:6 Cost ( 1, 0, 0, 0 ): Cast of:7 Variable Expression: f: signed int8 ... to:9 char10 (types:11 char12 )13 Environment:14 3 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: 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 35 11 36 12 13 to: 14 char 15 (types: 16 char 17 ) 18 Environment: 19 20 Cost ( 1, 0, 0, 0 ): Cast of: 21 Variable Expression: f: signed int 22 23 to: 24 char 25 (types: 26 char 27 ) 28 Environment: 29 30 Cost ( 1, 0, 0, 0 ): Cast of: 31 Variable Expression: f: double 32 33 to: 34 char 35 (types: 36 char 37 ) 38 Environment: 39 40 -
src/tests/.expect/scopeErrors.txt
r3f7e12cb r78315272 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: double 7 ... with attributes: 8 Attribute with name: unused 3 with parameters 4 double 5 returning 6 _retval_butThisIsAnError: Attribute with name: unused 7 double 8 with body 9 CompoundStmt 9 10 10 ... with body11 CompoundStmt12 -
src/tests/Makefile.am
r3f7e12cb r78315272 11 11 ## Created On : Sun May 31 09:08:15 2015 12 12 ## Last Modified By : Peter A. Buhr 13 ## Last Modified On : Tue Oct 10 14:04:40201714 ## Update Count : 4 713 ## Last Modified On : Mon Sep 11 16:17:16 2017 14 ## Update Count : 45 15 15 ############################################################################### 16 16 … … 22 22 concurrent = yes 23 23 quick_test += coroutine thread monitor 24 concurrent_test = \ 25 coroutine \ 26 fmtLines \ 27 pingpong \ 28 prodcons \ 29 thread \ 30 matrixSum \ 31 monitor \ 32 multi-monitor \ 33 boundedBuffer \ 34 preempt \ 35 sched-int-block \ 36 sched-int-disjoint \ 37 sched-int-wait \ 38 sched-ext-barge \ 39 sched-ext-dtor \ 40 sched-ext-else \ 41 sched-ext-parse \ 42 sched-ext-recurse \ 43 sched-ext-statment \ 44 sched-ext-when 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 45 25 else 46 26 concurrent=no … … 107 87 108 88 declarationSpecifier: declarationSpecifier.c @CFA_BINDIR@/@CFA_NAME@ 109 ${CC} ${AM_CFLAGS} ${CFLAGS} -CFA -XCFA -p ${<} -o ${@}89 ${CC} ${AM_CFLAGS} ${CFLAGS} -CFA -XCFA -p -XCFA -L ${<} -o ${@} 110 90 111 91 gccExtensions : gccExtensions.c @CFA_BINDIR@/@CFA_NAME@ 112 ${CC} ${AM_CFLAGS} ${CFLAGS} -CFA -XCFA -p ${<} -o ${@}92 ${CC} ${AM_CFLAGS} ${CFLAGS} -CFA -XCFA -p -XCFA -L ${<} -o ${@} 113 93 114 94 extension : extension.c @CFA_BINDIR@/@CFA_NAME@ 115 ${CC} ${AM_CFLAGS} ${CFLAGS} -CFA -XCFA -p ${<} -o ${@}95 ${CC} ${AM_CFLAGS} ${CFLAGS} -CFA -XCFA -p -XCFA -L ${<} -o ${@} 116 96 117 97 attributes : attributes.c @CFA_BINDIR@/@CFA_NAME@ 118 ${CC} ${AM_CFLAGS} ${CFLAGS} -CFA -XCFA -p ${<} -o ${@}98 ${CC} ${AM_CFLAGS} ${CFLAGS} -CFA -XCFA -p -XCFA -L ${<} -o ${@} 119 99 120 100 KRfunctions : KRfunctions.c @CFA_BINDIR@/@CFA_NAME@ 121 ${CC} ${AM_CFLAGS} ${CFLAGS} -CFA -XCFA -p ${<} -o ${@}101 ${CC} ${AM_CFLAGS} ${CFLAGS} -CFA -XCFA -p -XCFA -L ${<} -o ${@} 122 102 123 103 literals : literals.c @CFA_BINDIR@/@CFA_NAME@ 124 ${CC} ${AM_CFLAGS} ${CFLAGS} -CFA -XCFA -p ${<} -o ${@} 125 126 sched-ext-parse : sched-ext-parse.c @CFA_BINDIR@/@CFA_NAME@ 127 ${CC} ${AM_CFLAGS} ${CFLAGS} -CFA -XCFA -p ${<} -o ${@} 104 ${CC} ${AM_CFLAGS} ${CFLAGS} -CFA -XCFA -p -XCFA -L ${<} -o ${@} 128 105 129 106 gmp : gmp.c @CFA_BINDIR@/@CFA_NAME@ … … 133 110 ${CC} ${AM_CFLAGS} ${CFLAGS} -DERR1 ${<} -o ${@} 134 111 135 ctor-autogen-ERR1: ctor-autogen.c @CFA_BINDIR@/@CFA_NAME@136 ${CC} ${AM_CFLAGS} ${CFLAGS} -DERR1 ${<} -o ${@}137 138 112 completeTypeError : completeTypeError.c @CFA_BINDIR@/@CFA_NAME@ 139 113 ${CC} ${AM_CFLAGS} ${CFLAGS} -DERR1 ${<} -o ${@} 140 141 typedefRedef-ERR1: typedefRedef.c @CFA_BINDIR@/@CFA_NAME@142 ${CC} ${AM_CFLAGS} ${CFLAGS} -DERR1 ${<} -o ${@} -
src/tests/Makefile.in
r3f7e12cb r78315272 320 320 @BUILD_CONCURRENCY_TRUE@concurrent = yes 321 321 @BUILD_CONCURRENCY_FALSE@concurrent_test = 322 @BUILD_CONCURRENCY_TRUE@concurrent_test = \ 323 @BUILD_CONCURRENCY_TRUE@ coroutine \ 324 @BUILD_CONCURRENCY_TRUE@ fmtLines \ 325 @BUILD_CONCURRENCY_TRUE@ pingpong \ 326 @BUILD_CONCURRENCY_TRUE@ prodcons \ 327 @BUILD_CONCURRENCY_TRUE@ thread \ 328 @BUILD_CONCURRENCY_TRUE@ matrixSum \ 329 @BUILD_CONCURRENCY_TRUE@ monitor \ 330 @BUILD_CONCURRENCY_TRUE@ multi-monitor \ 331 @BUILD_CONCURRENCY_TRUE@ boundedBuffer \ 332 @BUILD_CONCURRENCY_TRUE@ preempt \ 333 @BUILD_CONCURRENCY_TRUE@ sched-int-block \ 334 @BUILD_CONCURRENCY_TRUE@ sched-int-disjoint \ 335 @BUILD_CONCURRENCY_TRUE@ sched-int-wait \ 336 @BUILD_CONCURRENCY_TRUE@ sched-ext-barge \ 337 @BUILD_CONCURRENCY_TRUE@ sched-ext-dtor \ 338 @BUILD_CONCURRENCY_TRUE@ sched-ext-else \ 339 @BUILD_CONCURRENCY_TRUE@ sched-ext-parse \ 340 @BUILD_CONCURRENCY_TRUE@ sched-ext-recurse \ 341 @BUILD_CONCURRENCY_TRUE@ sched-ext-statment \ 342 @BUILD_CONCURRENCY_TRUE@ sched-ext-when 343 322 @BUILD_CONCURRENCY_TRUE@concurrent_test = coroutine thread monitor multi-monitor sched-int-barge sched-int-block sched-int-disjoint sched-int-wait sched-ext sched-ext-multi preempt 344 323 345 324 # applies to both programs … … 860 839 861 840 declarationSpecifier: declarationSpecifier.c @CFA_BINDIR@/@CFA_NAME@ 862 ${CC} ${AM_CFLAGS} ${CFLAGS} -CFA -XCFA -p ${<} -o ${@}841 ${CC} ${AM_CFLAGS} ${CFLAGS} -CFA -XCFA -p -XCFA -L ${<} -o ${@} 863 842 864 843 gccExtensions : gccExtensions.c @CFA_BINDIR@/@CFA_NAME@ 865 ${CC} ${AM_CFLAGS} ${CFLAGS} -CFA -XCFA -p ${<} -o ${@}844 ${CC} ${AM_CFLAGS} ${CFLAGS} -CFA -XCFA -p -XCFA -L ${<} -o ${@} 866 845 867 846 extension : extension.c @CFA_BINDIR@/@CFA_NAME@ 868 ${CC} ${AM_CFLAGS} ${CFLAGS} -CFA -XCFA -p ${<} -o ${@}847 ${CC} ${AM_CFLAGS} ${CFLAGS} -CFA -XCFA -p -XCFA -L ${<} -o ${@} 869 848 870 849 attributes : attributes.c @CFA_BINDIR@/@CFA_NAME@ 871 ${CC} ${AM_CFLAGS} ${CFLAGS} -CFA -XCFA -p ${<} -o ${@}850 ${CC} ${AM_CFLAGS} ${CFLAGS} -CFA -XCFA -p -XCFA -L ${<} -o ${@} 872 851 873 852 KRfunctions : KRfunctions.c @CFA_BINDIR@/@CFA_NAME@ 874 ${CC} ${AM_CFLAGS} ${CFLAGS} -CFA -XCFA -p ${<} -o ${@}853 ${CC} ${AM_CFLAGS} ${CFLAGS} -CFA -XCFA -p -XCFA -L ${<} -o ${@} 875 854 876 855 literals : literals.c @CFA_BINDIR@/@CFA_NAME@ 877 ${CC} ${AM_CFLAGS} ${CFLAGS} -CFA -XCFA -p ${<} -o ${@} 878 879 sched-ext-parse : sched-ext-parse.c @CFA_BINDIR@/@CFA_NAME@ 880 ${CC} ${AM_CFLAGS} ${CFLAGS} -CFA -XCFA -p ${<} -o ${@} 856 ${CC} ${AM_CFLAGS} ${CFLAGS} -CFA -XCFA -p -XCFA -L ${<} -o ${@} 881 857 882 858 gmp : gmp.c @CFA_BINDIR@/@CFA_NAME@ … … 886 862 ${CC} ${AM_CFLAGS} ${CFLAGS} -DERR1 ${<} -o ${@} 887 863 888 ctor-autogen-ERR1: ctor-autogen.c @CFA_BINDIR@/@CFA_NAME@889 ${CC} ${AM_CFLAGS} ${CFLAGS} -DERR1 ${<} -o ${@}890 891 864 completeTypeError : completeTypeError.c @CFA_BINDIR@/@CFA_NAME@ 892 ${CC} ${AM_CFLAGS} ${CFLAGS} -DERR1 ${<} -o ${@}893 894 typedefRedef-ERR1: typedefRedef.c @CFA_BINDIR@/@CFA_NAME@895 865 ${CC} ${AM_CFLAGS} ${CFLAGS} -DERR1 ${<} -o ${@} 896 866 -
src/tests/coroutine.c
r3f7e12cb r78315272 10 10 // Created On : Thu Jun 8 07:29:37 2017 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Sun Sep 17 21:38:15201713 // Update Count : 712 // Last Modified On : Thu Jun 8 07:37:12 2017 13 // Update Count : 5 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(); // restartlast resume31 suspend(); // return to last resume 32 32 33 this.fn = 1; // case 1 34 fn2 = fn1; fn1 = this.fn; 35 suspend(); // restart last resume 33 this.fn = 1; // case 1 34 fn2 = fn1; 35 fn1 = this.fn; 36 suspend(); // return to last resume 36 37 37 for ( ;; ) { // general case38 for ( ;; ) { // general case 38 39 this.fn = fn1 + fn2; 39 fn2 = fn1; fn1 = this.fn; 40 suspend(); // restart last resume 40 fn2 = fn1; 41 fn1 = this.fn; 42 suspend(); // return to last resume 41 43 } // for 42 44 } 43 45 44 46 int next( Fibonacci & this ) { 45 resume( this ); // restartlast suspend47 resume( this ); // transfer to last suspend 46 48 return this.fn; 47 49 } … … 50 52 Fibonacci f1, f2; 51 53 for ( int i = 1; i <= 10; i += 1 ) { 52 sout | next( f1 ) | next( f2 ) | endl;54 sout | next( f1 ) | ' ' | next( f2 ) | endl; 53 55 } // for 54 56 } -
src/tests/fmtLines.c
r3f7e12cb r78315272 10 10 // Created On : Sun Sep 17 21:56:15 2017 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Sun Oct 1 11:57:19201713 // Update Count : 3 412 // Last Modified On : Mon Sep 18 11:35:57 2017 13 // Update Count : 31 14 14 // 15 15 … … 23 23 24 24 void ?{}( Format & fmt ) { 25 resume( fmt ); // prime (start)coroutine25 resume( fmt ); // start coroutine 26 26 } 27 27 28 28 void ^?{}( Format & fmt ) { 29 if ( fmt.g != 0 || fmt.b != 0 ) sout | endl;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 fmt.ch = ch;50 resume( fmt );49 fmt.ch = ch; 50 resume( fmt ); 51 51 } // prt 52 52 53 53 int main() { 54 Format fmt; // format characters into blocks of 4 and groups of 5 blocks per line54 Format fmt; 55 55 char ch; 56 56 57 Eof: for ( ;; ) { // read until end of file57 for ( ;; ) { 58 58 sin | ch; // read one character 59 if ( eof( sin ) ) break Eof;// eof ?60 prt( fmt, ch ); // push character for formatting59 if ( eof( sin ) ) break; // eof ? 60 prt( fmt, ch ); 61 61 } // for 62 62 } // main -
src/tests/gmp.c
r3f7e12cb r78315272 10 10 // Created On : Tue Apr 19 08:55:51 2016 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Thu Sep 28 18:33:51201713 // Update Count : 55 512 // Last Modified On : Mon Sep 4 09:51:18 2017 13 // Update Count : 550 14 14 // 15 15 … … 97 97 98 98 sout | "Factorial Numbers" | endl; 99 Int fact = 1; // 1st case 99 Int fact; 100 fact = 1; // 1st case 100 101 sout | (int)0 | fact | endl; 101 102 for ( unsigned int i = 1; i <= 40; i += 1 ) { -
src/tests/literals.c
r3f7e12cb r78315272 10 10 // Created On : Sat Sep 9 16:34:38 2017 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Mon Sep 25 20:26:00201713 // Update Count : 13212 // Last Modified On : Tue Sep 12 07:45:46 2017 13 // Update Count : 88 14 14 // 15 15 16 16 #ifdef __CFA__ 17 #include <stdint.h>18 17 #include <fstream> 19 18 … … 73 72 74 73 0123456789.e-09; 0123456789.e-09f; 0123456789.e-09l; 0123456789.e-09F; 0123456789.e-09L; 0123456789.e-09DL; 75 +0123456789.e-09; +0123456789.e-09f; +0123456789.e-09l; +0123456789.e-09F; +0123456789.e-09L; +0123456789.e-09DL;74 -0123456789.e-09; -0123456789.e-09f; -0123456789.e-09l; -0123456789.e-09F; -0123456789.e-09L; -0123456789.e-09DL; 76 75 -0123456789.e-09; -0123456789.e-09f; -0123456789.e-09l; -0123456789.e-09F; -0123456789.e-09L; -0123456789.e-09DL; 77 76 … … 105 104 106 105 0123456789.0123456789E-09; 0123456789.0123456789E-09f; 0123456789.0123456789E-09l; 0123456789.0123456789E-09F; 0123456789.0123456789E-09L; 0123456789.0123456789E-09DL; 107 +0123456789.0123456789E-09; +0123456789.0123456789E-09f; +0123456789.0123456789E-09l; +0123456789.0123456789E-09F; +0123456789.0123456789E-09L; +0123456789.0123456789E-09DL;106 -0123456789.0123456789E-09; -0123456789.0123456789E-09f; -0123456789.0123456789E-09l; -0123456789.0123456789E-09F; -0123456789.0123456789E-09L; -0123456789.0123456789E-09DL; 108 107 -0123456789.0123456789E-09; -0123456789.0123456789E-09f; -0123456789.0123456789E-09l; -0123456789.0123456789E-09F; -0123456789.0123456789E-09L; -0123456789.0123456789E-09DL; 109 108 … … 119 118 120 119 0x0123456789.p-09; 0x0123456789.p-09f; 0x0123456789.p-09l; 0x0123456789.p-09F; 0x0123456789.p-09L; 121 +0x0123456789.p-09; +0x0123456789.p-09f; +0x0123456789.p-09l; +0x0123456789.p-09F; +0x0123456789.p-09L;120 -0x0123456789.p-09; -0x0123456789.p-09f; -0x0123456789.p-09l; -0x0123456789.p-09F; -0x0123456789.p-09L; 122 121 -0x0123456789.p-09; -0x0123456789.p-09f; -0x0123456789.p-09l; -0x0123456789.p-09F; -0x0123456789.p-09L; 123 122 … … 131 130 132 131 0x.0123456789P-09; 0x.0123456789P-09f; 0x.0123456789P-09l; 0x.0123456789P-09F; 0x.0123456789P-09L; 133 +0x.0123456789P-09; +0x.0123456789P-09f; +0x.0123456789P-09l; +0x.0123456789P-09F; +0x.0123456789P-09L;132 -0x.0123456789P-09; -0x.0123456789P-09f; -0x.0123456789P-09l; -0x.0123456789P-09F; -0x.0123456789P-09L; 134 133 -0x.0123456789P-09; -0x.0123456789P-09f; -0x.0123456789P-09l; -0x.0123456789P-09F; -0x.0123456789P-09L; 135 134 … … 143 142 144 143 0X0123456789.0123456789P-09; 0X0123456789.0123456789P-09f; 0X0123456789.0123456789P-09l; 0X0123456789.0123456789P-09F; 0X0123456789.0123456789P-09L; 145 +0X0123456789.0123456789P-09; +0X0123456789.0123456789P-09f; +0X0123456789.0123456789P-09l; +0X0123456789.0123456789P-09F; +0X0123456789.0123456789P-09L;146 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; 146 147 // char, short, int suffix overloading 147 148 148 149 #ifdef __CFA__ 149 // fixed-size length150 151 // octal152 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 // decimal157 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 // hexadecimal162 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 // floating179 0123456789.l32; 0123456789.l64; 0123456789.l80; 0123456789.l128;180 +0123456789.l32; +0123456789.l64; +0123456789.l80; +0123456789.l128;181 -0123456789.l32; -0123456789.l64; -0123456789.l80; -0123456789.l128;182 183 0123456789.e09L32; 0123456789.e09L64; 0123456789.e09L80; 0123456789.e09L128;184 +0123456789.e+09L32; +0123456789.e+09L64; +0123456789.e+09L80; +0123456789.e+09L128;185 -0123456789.e-09L32; -0123456789.e-09L64; -0123456789.e-09L80; -0123456789.e-09L128;186 187 .0123456789e09L32; .0123456789e09L64; .0123456789e09L80; .0123456789e09L128;188 +.0123456789E+09L32; +.0123456789E+09L64; +.0123456789E+09L80; +.0123456789E+09L128;189 -.0123456789E-09L32; -.0123456789E-09L64; -.0123456789E-09L80; -.0123456789E-09L128;190 191 0123456789.0123456789L32; 0123456789.0123456789L64; 0123456789.0123456789L80; 0123456789.0123456789L128;192 +0123456789.0123456789E09L32; +0123456789.0123456789E09L64; +0123456789.0123456789E09L80; +0123456789.0123456789E09L128;193 -0123456789.0123456789E+09L32; -0123456789.0123456789E+09L64; -0123456789.0123456789E+09L80; -0123456789.0123456789E+09L128;194 0123456789.0123456789E-09L32; 0123456789.0123456789E-09L64; 0123456789.0123456789E-09L80; 0123456789.0123456789E-09L128;195 196 0x0123456789.p09l32; 0x0123456789.p09l64; 0x0123456789.p09l80; 0x0123456789.p09l128;197 +0x0123456789.p09l32; +0x0123456789.p09l64; +0x0123456789.p09l80; +0x0123456789.p09l128;198 -0x0123456789.p09l32; -0x0123456789.p09l64; -0x0123456789.p09l80; -0x0123456789.p09l128;199 200 0x0123456789.p+09l32; 0x0123456789.p+09L64; 0x0123456789.p+09L80; 0x0123456789.p+09L128;201 +0x0123456789.p-09l32; +0x0123456789.p-09L64; +0x0123456789.p-09L80; +0x0123456789.p-09L128;202 -0x.0123456789p09l32; -0x.0123456789p09L64; -0x.0123456789p09L80; -0x.0123456789p09L128;203 204 // char, short, int suffix overloading205 206 150 f( 'a' ); 207 151 f( 20_hh ); -
src/tests/prodcons.c
r3f7e12cb r78315272 10 10 // Created On : Mon Sep 18 12:23:39 2017 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Mon Oct 30 23:06:05201713 // Update Count : 4 212 // Last Modified On : Wed Sep 20 17:03:28 2017 13 // Update Count : 40 14 14 // 15 15 16 16 #include <fstream> 17 17 #include <coroutine> 18 #include <stdlib> // rand om18 #include <stdlib> // rand48 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 = random( 100 );33 int p2 = random( 100 );32 int p1 = (unsigned int)rand48() % 100; // non-negative 33 int p2 = (unsigned int)rand48() % 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 om_seed( /* getpid() */ 103 ); // fixed seed for testing92 rand48seed( /* getpid() */ 103 ); // fixed seed for testing 93 93 start( prod, 5, cons ); 94 94 sout | "main stops" | endl; -
src/tests/random.c
r3f7e12cb r78315272 10 10 // Created On : Tue Jul 5 21:29:30 2016 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Mon Oct 30 23:06:49 201713 // Update Count : 612 // Last Modified On : Wed Jul 6 18:00:29 2016 13 // Update Count : 3 14 14 // 15 15 … … 19 19 20 20 int main() { 21 // srandom( getpid() ); // set random seed22 rand om_seed( 1003 );// fixed seed for repeatable tests21 //rand48seed( getpid() ); // set random seed 22 rand48seed( 1003 ); // fixed seed for repeatable tests 23 23 24 24 // test polymorphic calls to random and stream 25 char c = rand om();25 char c = rand48(); 26 26 sout | c | endl; 27 int i = rand om();27 int i = rand48(); 28 28 sout | i | endl; 29 unsigned int ui = rand om();29 unsigned int ui = rand48(); 30 30 sout | ui | endl; 31 long int li = rand om();31 long int li = rand48(); 32 32 sout | li | endl; 33 unsigned long int uli = rand om();33 unsigned long int uli = rand48(); 34 34 sout | uli | endl; 35 float f = rand om();35 float f = rand48(); 36 36 sout | f | endl; 37 double d = rand om();37 double d = rand48(); 38 38 sout | d | endl; 39 float _Complex fc = rand om();39 float _Complex fc = rand48(); 40 40 sout | fc | endl; 41 double _Complex dc = rand om();41 double _Complex dc = rand48(); 42 42 sout | dc | endl; 43 long double _Complex ldc = rand om();43 long double _Complex ldc = rand48(); 44 44 sout | ldc | endl; 45 45 } // main -
src/tests/rational.c
r3f7e12cb r78315272 10 10 // Created On : Mon Mar 28 08:43:12 2016 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Tue Oct 10 23:25:04201713 // Update Count : 6 712 // Last Modified On : Wed Aug 23 21:40:11 2017 13 // Update Count : 66 14 14 // 15 15 -
src/tests/sched-ext-parse.c
r3f7e12cb r78315272 1 //----------------------------------------------------------------------------------------2 //----------------------------------------------------------------------------------------3 //4 // DEPRECATED TEST5 // DIFFERS BETWEEN DEBUG AND RELEASE6 //7 //----------------------------------------------------------------------------------------8 //----------------------------------------------------------------------------------------9 10 1 #include <monitor> 11 2 … … 89 80 16; 90 81 } 91 or waitfor( f 2, a, a ) {82 or waitfor( f1, a, a ) { 92 83 17; 93 84 } -
src/tests/sched-ext.c
r3f7e12cb r78315272 26 26 volatile bool done; 27 27 28 unsigned rand10() { 29 return (unsigned)rand48() % 10; 30 } 31 28 32 //---------------------------------------------------------------------------------------------------- 29 33 // Acceptor … … 32 36 void do_wait( global_t * mutex a ) { 33 37 sout | "Waiting to accept" | endl; 34 yield( rand om( 10) );38 yield( rand10() ); 35 39 36 40 sout | "Accepting" | endl; … … 41 45 acceptable.monitors = &a; 42 46 43 __ waitfor_internal( 1, &acceptable );47 __accept_internal( 1, &acceptable ); 44 48 45 49 sout | "Accepted" | endl; 46 yield( rand om( 10) );50 yield( rand10() ); 47 51 } 48 52 … … 64 68 void main( Acceptee* this ) { 65 69 while( !done ) { 66 yield( rand om( 10) );70 yield( rand10() ); 67 71 do_notify( &globalA ); 68 yield( rand om( 10) );72 yield( rand10() ); 69 73 } 70 74 } … … 74 78 int main(int argc, char* argv[]) { 75 79 done = false; 76 rand om_seed( time( NULL ) );80 rand48seed( time( NULL ) ); 77 81 printf("%p\n", &globalA); 78 82 sout | "Starting" | endl; -
src/tests/sched-int-barge.c
r3f7e12cb r78315272 1 //----------------------------------------------------------------------------------------2 //----------------------------------------------------------------------------------------3 //4 // DEPRECATED TEST5 //6 //----------------------------------------------------------------------------------------7 //----------------------------------------------------------------------------------------8 9 1 #include <fstream> 10 2 #include <kernel> … … 64 56 65 57 if( action == 0 ) { 66 c.do_signal = max( random( 10 ), 1);67 c.do_wait1 = random( c.do_signal);68 c.do_wait2 = random( c.do_signal);58 c.do_signal = max( ((unsigned)rand48()) % 10, 1); 59 c.do_wait1 = ((unsigned)rand48()) % (c.do_signal); 60 c.do_wait2 = ((unsigned)rand48()) % (c.do_signal); 69 61 70 62 if(c.do_wait1 == c.do_wait2) sout | "Same" | endl; … … 73 65 if( action == c.do_wait1 || action == c.do_wait2 ) { 74 66 c.state = WAIT; 75 wait( cond );67 wait( &cond ); 76 68 77 69 if(c.state != SIGNAL) { … … 83 75 c.state = SIGNAL; 84 76 85 signal( cond );86 signal( cond );77 signal( &cond ); 78 signal( &cond ); 87 79 } 88 80 else { … … 109 101 110 102 int main(int argc, char* argv[]) { 111 rand om_seed(0);103 rand48seed(0); 112 104 processor p; 113 105 { -
src/tests/sched-int-block.c
r3f7e12cb r78315272 1 //---------------------------------------------------------2 // Barging test3 // Ensures that no barging can occur between :4 // - the frontend of the signal_block and the signaled thread5 // - the signaled threadand the backend of the signal_block6 //---------------------------------------------------------7 8 9 1 #include <fstream> 10 2 #include <kernel> … … 47 39 //------------------------------------------------------------------------------ 48 40 void wait_op( global_data_t & mutex a, global_data_t & mutex b, unsigned i ) { 49 wait( cond, (uintptr_t)this_thread );41 wait( &cond, (uintptr_t)this_thread ); 50 42 51 yield( random( 10 ));43 yield( ((unsigned)rand48()) % 10 ); 52 44 53 45 if(a.last_thread != a.last_signaller || b.last_thread != b.last_signaller ) { … … 58 50 a.last_thread = b.last_thread = this_thread; 59 51 60 yield( random( 10 ));52 yield( ((unsigned)rand48()) % 10 ); 61 53 } 62 54 … … 70 62 //------------------------------------------------------------------------------ 71 63 void signal_op( global_data_t & mutex a, global_data_t & mutex b ) { 72 yield( random( 10 ));64 yield( ((unsigned)rand48()) % 10 ); 73 65 74 66 [a.last_thread, b.last_thread, a.last_signaller, b.last_signaller] = this_thread; 75 67 76 if( !is_empty( cond ) ) {68 if( !is_empty( &cond ) ) { 77 69 78 thread_desc * next = front( cond );70 thread_desc * next = front( &cond ); 79 71 80 if( ! signal_block( cond ) ) {72 if( ! signal_block( &cond ) ) { 81 73 sout | "ERROR expected to be able to signal" | endl; 82 74 abort(); 83 75 } 84 76 85 yield( random( 10 ));77 yield( ((unsigned)rand48()) % 10 ); 86 78 87 79 if(a.last_thread != next || b.last_thread != next) { … … 118 110 119 111 int main(int argc, char* argv[]) { 120 rand om_seed( time( NULL ) );112 rand48seed( time( NULL ) ); 121 113 done = false; 122 114 processor p; -
src/tests/sched-int-disjoint.c
r3f7e12cb r78315272 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( random( 10 ));90 yield( (unsigned)rand48() % 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 om_seed( time( NULL ) );111 rand48seed( time( NULL ) ); 112 112 all_done = false; 113 113 processor p; -
src/tests/sched-int-wait.c
r3f7e12cb r78315272 1 //---------------------------------------------------------2 // Multi wait test3 // Ensures that no deadlock from waiting/signalling conditions4 //---------------------------------------------------------5 6 7 1 #include <fstream> 8 2 #include <kernel> … … 41 35 //---------------------------------------------------------------------------------------------------- 42 36 // Tools 43 void signal( condition &cond, global_t & mutex a, global_t & mutex b ) {37 void signal( condition * cond, global_t & mutex a, global_t & mutex b ) { 44 38 signal( cond ); 45 39 } 46 40 47 void signal( condition &cond, global_t & mutex a, global_t & mutex b, global_t & mutex c ) {41 void signal( condition * cond, global_t & mutex a, global_t & mutex b, global_t & mutex c ) { 48 42 signal( cond ); 49 43 } 50 44 51 void wait( condition &cond, global_t & mutex a, global_t & mutex b ) {45 void wait( condition * cond, global_t & mutex a, global_t & mutex b ) { 52 46 wait( cond ); 53 47 } 54 48 55 void wait( condition &cond, global_t & mutex a, global_t & mutex b, global_t & mutex c ) {49 void wait( condition * cond, global_t & mutex a, global_t & mutex b, global_t & mutex c ) { 56 50 wait( cond ); 57 51 } … … 62 56 63 57 while( waiter_left != 0 ) { 64 unsigned action = random( 4 );58 unsigned action = (unsigned)rand48() % 4; 65 59 switch( action ) { 66 60 case 0: 67 signal( condABC, globalA, globalB, globalC );61 signal( &condABC, globalA, globalB, globalC ); 68 62 break; 69 63 case 1: 70 signal( condAB , globalA, globalB );64 signal( &condAB , globalA, globalB ); 71 65 break; 72 66 case 2: 73 signal( condBC , globalB, globalC );67 signal( &condBC , globalB, globalC ); 74 68 break; 75 69 case 3: 76 signal( condAC , globalA, globalC );70 signal( &condAC , globalA, globalC ); 77 71 break; 78 72 default: … … 88 82 void main( WaiterABC & this ) { 89 83 for( int i = 0; i < N; i++ ) { 90 wait( condABC, globalA, globalB, globalC );84 wait( &condABC, globalA, globalB, globalC ); 91 85 } 92 86 … … 98 92 void main( WaiterAB & this ) { 99 93 for( int i = 0; i < N; i++ ) { 100 wait( condAB , globalA, globalB );94 wait( &condAB , globalA, globalB ); 101 95 } 102 96 … … 108 102 void main( WaiterAC & this ) { 109 103 for( int i = 0; i < N; i++ ) { 110 wait( condAC , globalA, globalC );104 wait( &condAC , globalA, globalC ); 111 105 } 112 106 … … 118 112 void main( WaiterBC & this ) { 119 113 for( int i = 0; i < N; i++ ) { 120 wait( condBC , globalB, globalC );114 wait( &condBC , globalB, globalC ); 121 115 } 122 116 … … 127 121 // Main 128 122 int main(int argc, char* argv[]) { 129 rand om_seed( time( NULL ) );123 rand48seed( time( NULL ) ); 130 124 waiter_left = 4; 131 125 processor p[2]; -
src/tests/thread.c
r3f7e12cb r78315272 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.