Changes in / [53bb8f1:9d9a451]
- Files:
-
- 17 added
- 31 deleted
- 107 edited
-
.gitignore (modified) (2 diffs)
-
Makefile.am (modified) (2 diffs)
-
Makefile.in (modified) (3 diffs)
-
automake/cfa.m4 (modified) (1 diff)
-
benchmark/Makefile.am (modified) (12 diffs)
-
benchmark/Makefile.in (modified) (14 diffs)
-
benchmark/compile/empty.c (added)
-
benchmark/compile/empty.cfa (deleted)
-
benchmark/creation/cfa_cor.c (added)
-
benchmark/creation/cfa_cor.cfa (deleted)
-
benchmark/creation/cfa_thrd.c (added)
-
benchmark/creation/cfa_thrd.cfa (deleted)
-
benchmark/ctxswitch/cfa_cor.c (added)
-
benchmark/ctxswitch/cfa_cor.cfa (deleted)
-
benchmark/ctxswitch/cfa_thrd.c (added)
-
benchmark/ctxswitch/cfa_thrd.cfa (deleted)
-
benchmark/ctxswitch/cfa_thrd2.c (added)
-
benchmark/ctxswitch/cfa_thrd2.cfa (deleted)
-
benchmark/jenkins.sh (deleted)
-
benchmark/mutex/cfa1.c (added)
-
benchmark/mutex/cfa1.cfa (deleted)
-
benchmark/mutex/cfa2.c (added)
-
benchmark/mutex/cfa2.cfa (deleted)
-
benchmark/mutex/cfa4.c (added)
-
benchmark/mutex/cfa4.cfa (deleted)
-
benchmark/schedext/cfa1.c (added)
-
benchmark/schedext/cfa1.cfa (deleted)
-
benchmark/schedext/cfa2.c (added)
-
benchmark/schedext/cfa2.cfa (deleted)
-
benchmark/schedext/cfa4.c (added)
-
benchmark/schedext/cfa4.cfa (deleted)
-
benchmark/schedint/cfa1.c (added)
-
benchmark/schedint/cfa1.cfa (deleted)
-
benchmark/schedint/cfa2.c (added)
-
benchmark/schedint/cfa2.cfa (deleted)
-
benchmark/schedint/cfa4.c (added)
-
benchmark/schedint/cfa4.cfa (deleted)
-
configure (modified) (13 diffs)
-
configure.ac (modified) (3 diffs)
-
doc/LaTeXmacros/lstlang.sty (modified) (2 diffs)
-
doc/bibliography/pl.bib (modified) (31 diffs)
-
doc/papers/concurrency/Paper.tex (modified) (6 diffs)
-
doc/papers/concurrency/mail (modified) (1 diff)
-
driver/Makefile.in (modified) (1 diff)
-
driver/cfa.cc (modified) (9 diffs)
-
libcfa/configure (modified) (2 diffs)
-
libcfa/configure.ac (modified) (1 diff)
-
libcfa/prelude/builtins.c (modified) (2 diffs)
-
libcfa/prelude/extras.c (modified) (1 diff)
-
libcfa/prelude/extras.regx (modified) (1 diff)
-
libcfa/prelude/prelude-gen.cc (modified) (11 diffs)
-
libcfa/src/Makefile.in (modified) (1 diff)
-
libcfa/src/containers/maybe.cfa (modified) (2 diffs)
-
libcfa/src/containers/result.cfa (modified) (2 diffs)
-
libcfa/src/iostream.cfa (modified) (2 diffs)
-
libcfa/src/iostream.hfa (modified) (2 diffs)
-
src/BasicTypes-gen.cc (deleted)
-
src/CodeGen/module.mk (modified) (1 diff)
-
src/Common/Heap.cc (added)
-
src/Common/Heap.h (added)
-
src/Common/PassVisitor.cc (deleted)
-
src/Common/PassVisitor.h (modified) (2 diffs)
-
src/Common/PassVisitor.impl.h (modified) (10 diffs)
-
src/Common/Stats.h (deleted)
-
src/Common/Stats/Base.h (deleted)
-
src/Common/Stats/Counter.cc (deleted)
-
src/Common/Stats/Counter.h (deleted)
-
src/Common/Stats/Heap.cc (deleted)
-
src/Common/Stats/Heap.h (deleted)
-
src/Common/Stats/Stats.cc (deleted)
-
src/Common/Stats/Time.cc (deleted)
-
src/Common/Stats/Time.h (deleted)
-
src/Common/module.mk (modified) (1 diff)
-
src/Concurrency/Waitfor.cc (modified) (1 diff)
-
src/Concurrency/module.mk (modified) (1 diff)
-
src/ControlStruct/ExceptTranslate.cc (modified) (1 diff)
-
src/ControlStruct/module.mk (modified) (1 diff)
-
src/GenPoly/module.mk (modified) (1 diff)
-
src/InitTweak/FixInit.cc (modified) (1 diff)
-
src/InitTweak/module.mk (modified) (1 diff)
-
src/MakeLibCfa.cc (modified) (2 diffs)
-
src/Makefile.am (modified) (4 diffs)
-
src/Makefile.in (modified) (22 diffs)
-
src/Parser/DeclarationNode.cc (modified) (2 diffs)
-
src/Parser/ExpressionNode.cc (modified) (6 diffs)
-
src/Parser/ParseNode.h (modified) (2 diffs)
-
src/Parser/TypeData.cc (modified) (3 diffs)
-
src/Parser/TypeData.h (modified) (5 diffs)
-
src/Parser/lex.ll (modified) (6 diffs)
-
src/Parser/module.mk (modified) (1 diff)
-
src/Parser/parser.yy (modified) (13 diffs)
-
src/ResolvExpr/AlternativeFinder.cc (modified) (3 diffs)
-
src/ResolvExpr/CommonType.cc (modified) (4 diffs)
-
src/ResolvExpr/ConversionCost.cc (modified) (8 diffs)
-
src/ResolvExpr/Cost.h (modified) (14 diffs)
-
src/ResolvExpr/ResolveAssertions.cc (modified) (13 diffs)
-
src/ResolvExpr/Resolver.cc (modified) (27 diffs)
-
src/ResolvExpr/Resolver.h (modified) (2 diffs)
-
src/ResolvExpr/module.mk (modified) (1 diff)
-
src/ResolvExpr/typeops.h (modified) (2 diffs)
-
src/SymTab/Indexer.cc (modified) (8 diffs)
-
src/SymTab/Mangler.cc (modified) (6 diffs)
-
src/SymTab/Mangler.h (modified) (2 diffs)
-
src/SymTab/ManglerCommon.cc (modified) (2 diffs)
-
src/SymTab/Validate.cc (modified) (2 diffs)
-
src/SymTab/module.mk (modified) (1 diff)
-
src/SynTree/AddressExpr.cc (modified) (2 diffs)
-
src/SynTree/BasicType.cc (modified) (3 diffs)
-
src/SynTree/Constant.cc (modified) (1 diff)
-
src/SynTree/Expression.cc (modified) (48 diffs)
-
src/SynTree/Expression.h (modified) (2 diffs)
-
src/SynTree/Type.cc (modified) (3 diffs)
-
src/SynTree/Type.h (modified) (3 diffs)
-
src/SynTree/module.mk (modified) (1 diff)
-
src/Tuples/TupleExpansion.cc (modified) (1 diff)
-
src/Tuples/module.mk (modified) (1 diff)
-
src/Validate/module.mk (modified) (1 diff)
-
src/cfa.make (modified) (1 diff)
-
src/config.h.in (modified) (7 diffs)
-
src/main.cc (modified) (21 diffs)
-
tests/.expect/castError.txt (modified) (4 diffs)
-
tests/.expect/completeTypeError.txt (modified) (2 diffs)
-
tests/.expect/declarationSpecifier.x64.txt (modified) (1 diff)
-
tests/.expect/declarationSpecifier.x86.txt (modified) (1 diff)
-
tests/.expect/gccExtensions.x64.txt (modified) (1 diff)
-
tests/.expect/gccExtensions.x86.txt (modified) (1 diff)
-
tests/.expect/io1.txt (modified) (1 diff)
-
tests/.expect/loopctrl.txt (modified) (2 diffs)
-
tests/.expect/sum.txt (modified) (1 diff)
-
tests/Makefile.in (modified) (2 diffs)
-
tests/abort.cfa (deleted)
-
tests/array.cfa (modified) (2 diffs)
-
tests/castError.cfa (modified) (2 diffs)
-
tests/concurrent/examples/.expect/gortn.txt (deleted)
-
tests/concurrent/examples/boundedBufferEXT.cfa (modified) (2 diffs)
-
tests/concurrent/examples/boundedBufferINT.cfa (modified) (2 diffs)
-
tests/concurrent/examples/datingService.cfa (modified) (2 diffs)
-
tests/concurrent/examples/gortn.cfa (deleted)
-
tests/concurrent/examples/matrixSum.cfa (modified) (2 diffs)
-
tests/concurrent/examples/quickSort.cfa (modified) (2 diffs)
-
tests/io1.cfa (modified) (2 diffs)
-
tests/literals.cfa (modified) (4 diffs)
-
tests/loopctrl.cfa (modified) (2 diffs)
-
tests/numericConstants.cfa (modified) (2 diffs)
-
tests/preempt_longrun/Makefile.in (modified) (1 diff)
-
tests/pybin/print-core.gdb (deleted)
-
tests/pybin/tools.py (modified) (4 diffs)
-
tests/raii/.expect/ctor-autogen-ERR1.txt (modified) (4 diffs)
-
tests/sum.cfa (modified) (2 diffs)
-
tests/test.py (modified) (5 diffs)
-
tests/warnings/.expect/self-assignment.txt (modified) (2 diffs)
-
tests/warnings/self-assignment.cfa (modified) (1 diff)
-
tools/Makefile.in (modified) (1 diff)
-
tools/PrettyGitLogs.sh (modified) (1 diff)
-
tools/prettyprinter/Makefile.in (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
.gitignore
r53bb8f1 r9d9a451 10 10 config.py 11 11 stamp-h1 12 libtool13 12 /Makefile 14 13 **/Makefile … … 50 49 libcfa/arm-nolib/ 51 50 51 52 52 # generated by bison and lex from parser.yy and lex.ll 53 53 src/Parser/parser.output -
Makefile.am
r53bb8f1 r9d9a451 11 11 ## Created On : Sun May 31 22:14:18 2015 12 12 ## Last Modified By : Peter A. Buhr 13 ## Last Modified On : Sat Feb 2 16:54:42 201914 ## Update Count : 2113 ## Last Modified On : Wed Dec 14 14:20:48 2016 14 ## Update Count : 15 15 15 ############################################################################### 16 16 … … 18 18 ACLOCAL_AMFLAGS = -I automake 19 19 20 MAINTAINERCLEANFILES = lib/* bin/* tests/.deps/* tests/.out/* # order important 20 MAINTAINERCLEANFILES = lib/* bin/* tests/.deps/* tests/.out/* 21 # order important 21 22 22 23 SUBDIRS = driver src . @LIBCFA_TARGET_DIRS@ -
Makefile.in
r53bb8f1 r9d9a451 250 250 distcleancheck_listfiles = find . -type f -print 251 251 ACLOCAL = @ACLOCAL@ 252 ALLOCA = @ALLOCA@ 252 253 AMTAR = @AMTAR@ 253 254 AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ … … 395 396 AUTOMAKE_OPTIONS = foreign # do not require all the GNU file names 396 397 ACLOCAL_AMFLAGS = -I automake 397 MAINTAINERCLEANFILES = lib/* bin/* tests/.deps/* tests/.out/* # order important398 MAINTAINERCLEANFILES = lib/* bin/* tests/.deps/* tests/.out/* 398 399 SUBDIRS = driver src . @LIBCFA_TARGET_DIRS@ 399 400 noinst_DATA = @LIBCFA_TARGET_MAKEFILES@ … … 927 928 .PRECIOUS: Makefile 928 929 930 # order important 929 931 930 932 @LIBCFA_TARGET_MAKEFILES@ : Makefile $(srcdir)/libcfa/configure -
automake/cfa.m4
r53bb8f1 r9d9a451 80 80 esac 81 81 ]) 82 83 # http://git.savannah.gnu.org/gitweb/?p=autoconf-archive.git;a=blob_plain;f=m4/ax_check_compile_flag.m484 AC_DEFUN([M4CFA_CHECK_COMPILE_FLAG],85 [AC_PREREQ(2.64)dnl for _AC_LANG_PREFIX and AS_VAR_IF86 AS_VAR_PUSHDEF([CACHEVAR],[m4cfa_cv_check_[]_AC_LANG_ABBREV[]flags_$4_$1])dnl87 AC_CACHE_CHECK([whether _AC_LANG compiler accepts $1], CACHEVAR, [88 m4cfa_check_save_flags=$[]_AC_LANG_PREFIX[]FLAGS89 _AC_LANG_PREFIX[]FLAGS="$[]_AC_LANG_PREFIX[]FLAGS $4 $1"90 AC_COMPILE_IFELSE([m4_default([$5],[AC_LANG_PROGRAM()])],91 [AS_VAR_SET(CACHEVAR,[yes])],92 [AS_VAR_SET(CACHEVAR,[no])])93 _AC_LANG_PREFIX[]FLAGS=$m4cfa_check_save_flags])94 AS_VAR_IF(CACHEVAR,yes,95 [m4_default([$2], :)],96 [m4_default([$3], :)])97 AS_VAR_POPDEF([CACHEVAR])dnl98 ])dnl M4CFA_CHECK_COMPILE_FLAGS -
benchmark/Makefile.am
r53bb8f1 r9d9a451 21 21 include $(top_srcdir)/src/cfa.make 22 22 23 UPPCC = u++ 24 23 25 AM_CFLAGS = -O2 -Wall -I$(srcdir) -lrt -pthread 24 26 AM_CFAFLAGS = -quiet -in-tree -nodebug 25 27 AM_UPPFLAGS = -quiet -nodebug -multi 26 28 27 BENCH_V_CC = $(__bench_v_CC_$(__quiet)) 28 BENCH_V_CFA = $(__bench_v_CFA_$(__quiet)) 29 BENCH_V_CXX = $(__bench_v_CXX_$(__quiet)) 30 BENCH_V_GOC = $(__bench_v_GOC_$(__quiet)) 31 BENCH_V_JAVAC = $(__bench_v_JAVAC_$(__quiet)) 32 BENCH_V_UPP = $(__bench_v_UPP_$(__quiet)) 33 34 __quiet = verbose 35 __bench_v_CC_quiet = @ 36 __bench_v_CFA_quiet = @ 37 __bench_v_CXX_quiet = @ 38 __bench_v_GOC_quiet = @ 39 __bench_v_JAVAC_quiet = @ 40 __bench_v_UPP_quiet = @ 41 __bench_v_CC_verbose = $(AM_V_CC) 42 __bench_v_CFA_verbose = $(AM_V_CFA) 43 __bench_v_CXX_verbose = $(AM_V_CXX) 44 __bench_v_GOC_verbose = $(AM_V_GOC) 45 __bench_v_JAVAC_verbose = $(AM_V_JAVAC) 46 __bench_v_UPP_verbose = $(AM_V_UPP) 47 48 49 50 TOOLSDIR = ${abs_top_builddir}/tools/ 51 REPEAT = ${abs_top_builddir}/tools/repeat 52 STATS = ${abs_top_srcdir}/tools/stat.py 29 TOOLSDIR = ${abs_top_srcdir}/tools/ 30 REPEAT = ${TOOLSDIR}repeat 31 STATS = ${TOOLSDIR}stat.py 53 32 repeats = 30 54 33 skipcompile = no … … 56 35 PRINT_FORMAT = %20s: #Comments needed for spacing 57 36 58 # Dummy hack tricks 59 EXTRA_PROGRAMS = dummy # build but do not install 60 dummy_SOURCES = dummyC.c dummyCXX.cpp 61 62 dummyC.c: 63 @echo "int main() { return 0; }" > ${@} 64 65 dummyCXX.cpp: 66 @echo "int main() { return 0; }" > ${@} 67 37 #prevent any tests in parallel 68 38 .NOTPARALLEL: 39 40 #make sure automake includes the compile rules for C and C++ 41 EXTRA_PROGRAMS = dummy 42 dummy_SOURCES = c.c cxx.cpp 69 43 70 44 ## ========================================================================================================= … … 81 55 82 56 %.runquiet : 83 @+make $(basename $@) CFLAGS="-w" __quiet=quiet57 @+make $(basename $@) CFLAGS="-w" 84 58 @taskset -c 1 ./a.out 85 59 @rm -f a.out … … 90 64 91 65 ${REPEAT} : 92 @+make -C ${ abs_top_builddir}/toolsrepeat66 @+make -C ${TOOLSDIR} repeat 93 67 94 68 ## ========================================================================================================= … … 131 105 ## ========================================================================================================= 132 106 loop$(EXEEXT): 133 $( BENCH_V_CC)$(COMPILE) -DBENCH_N=5000000000 $(srcdir)/loop.c107 $(AM_V_CC)$(COMPILE) -DBENCH_N=5000000000 $(srcdir)/loop.c 134 108 135 109 function$(EXEEXT): 136 $( BENCH_V_CC)$(COMPILE) -DBENCH_N=5000000000 $(srcdir)/function.c110 $(AM_V_CC)$(COMPILE) -DBENCH_N=5000000000 $(srcdir)/function.c 137 111 138 112 fetch_add$(EXEEXT): 139 $( BENCH_V_CC)$(COMPILE) -DBENCH_N=500000000 $(srcdir)/fetch_add.c113 $(AM_V_CC)$(COMPILE) -DBENCH_N=500000000 $(srcdir)/fetch_add.c 140 114 141 115 ## ========================================================================================================= … … 160 134 161 135 ctxswitch-kos_fibre$(EXEEXT): 162 $( BENCH_V_CXX)$(CXXCOMPILE) -DBENCH_N=50000000 $(srcdir)/ctxswitch/kos_fibre.cpp -I$(LIBFIBRE_DIR) -lfibre136 $(AM_V_CXX)$(CXXCOMPILE) -DBENCH_N=50000000 $(srcdir)/ctxswitch/kos_fibre.cpp -I$(LIBFIBRE_DIR) -lfibre 163 137 164 138 ctxswitch-kos_fibre2$(EXEEXT): 165 $( BENCH_V_CXX)$(CXXCOMPILE) -DBENCH_N=50000000 $(srcdir)/ctxswitch/kos_fibre2.cpp -I$(LIBFIBRE_DIR) -lfibre139 $(AM_V_CXX)$(CXXCOMPILE) -DBENCH_N=50000000 $(srcdir)/ctxswitch/kos_fibre2.cpp -I$(LIBFIBRE_DIR) -lfibre 166 140 endif 167 141 … … 169 143 170 144 ctxswitch-pthread$(EXEEXT): 171 $( BENCH_V_CC)$(COMPILE) -DBENCH_N=50000000 $(srcdir)/ctxswitch/pthreads.c145 $(AM_V_CC)$(COMPILE) -DBENCH_N=50000000 $(srcdir)/ctxswitch/pthreads.c 172 146 173 147 ctxswitch-cfa_coroutine$(EXEEXT): 174 $( BENCH_V_CFA)$(CFACOMPILE) -DBENCH_N=50000000 $(srcdir)/ctxswitch/cfa_cor.cfa148 $(AM_V_CFA)$(CFACOMPILE) -DBENCH_N=50000000 $(srcdir)/ctxswitch/cfa_cor.c 175 149 176 150 ctxswitch-cfa_thread$(EXEEXT): 177 $( BENCH_V_CFA)$(CFACOMPILE) -DBENCH_N=50000000 $(srcdir)/ctxswitch/cfa_thrd.cfa151 $(AM_V_CFA)$(CFACOMPILE) -DBENCH_N=50000000 $(srcdir)/ctxswitch/cfa_thrd.c 178 152 179 153 ctxswitch-cfa_thread2$(EXEEXT): 180 $( BENCH_V_CFA)$(CFACOMPILE) -DBENCH_N=50000000 $(srcdir)/ctxswitch/cfa_thrd2.cfa154 $(AM_V_CFA)$(CFACOMPILE) -DBENCH_N=50000000 $(srcdir)/ctxswitch/cfa_thrd2.c 181 155 182 156 ctxswitch-upp_coroutine$(EXEEXT): 183 $( BENCH_V_UPP)$(UPPCOMPILE) -DBENCH_N=50000000 $(srcdir)/ctxswitch/upp_cor.cc157 $(AM_V_UPP)$(UPPCOMPILE) -DBENCH_N=50000000 $(srcdir)/ctxswitch/upp_cor.cc 184 158 185 159 ctxswitch-upp_thread$(EXEEXT): 186 $( BENCH_V_UPP)$(UPPCOMPILE) -DBENCH_N=50000000 $(srcdir)/ctxswitch/upp_thrd.cc160 $(AM_V_UPP)$(UPPCOMPILE) -DBENCH_N=50000000 $(srcdir)/ctxswitch/upp_thrd.cc 187 161 188 162 ctxswitch-goroutine$(EXEEXT): 189 $( BENCH_V_GOC)go build -o a.out $(srcdir)/ctxswitch/goroutine.go163 $(AM_V_GOC)go build -o a.out $(srcdir)/ctxswitch/goroutine.go 190 164 191 165 ctxswitch-java_thread$(EXEEXT): 192 $( BENCH_V_JAVAC)javac -d $(builddir) $(srcdir)/ctxswitch/JavaThread.java166 $(AM_V_JAVAC)javac -d $(builddir) $(srcdir)/ctxswitch/JavaThread.java 193 167 @echo "#!/bin/sh" > a.out 194 168 @echo "java JavaThread" >> a.out … … 208 182 209 183 mutex-pthread_lock$(EXEEXT): 210 $( BENCH_V_CC)$(COMPILE) -DBENCH_N=50000000 $(srcdir)/mutex/pthreads.c184 $(AM_V_CC)$(COMPILE) -DBENCH_N=50000000 $(srcdir)/mutex/pthreads.c 211 185 212 186 mutex-upp$(EXEEXT): 213 $( BENCH_V_UPP)$(UPPCOMPILE) -DBENCH_N=50000000 $(srcdir)/mutex/upp.cc187 $(AM_V_UPP)$(UPPCOMPILE) -DBENCH_N=50000000 $(srcdir)/mutex/upp.cc 214 188 215 189 mutex-cfa1$(EXEEXT): 216 $( BENCH_V_CFA)$(CFACOMPILE) -DBENCH_N=5000000 $(srcdir)/mutex/cfa1.cfa190 $(AM_V_CFA)$(CFACOMPILE) -DBENCH_N=5000000 $(srcdir)/mutex/cfa1.c 217 191 218 192 mutex-cfa2$(EXEEXT): 219 $( BENCH_V_CFA)$(CFACOMPILE) -DBENCH_N=5000000 $(srcdir)/mutex/cfa2.cfa193 $(AM_V_CFA)$(CFACOMPILE) -DBENCH_N=5000000 $(srcdir)/mutex/cfa2.c 220 194 221 195 mutex-cfa4$(EXEEXT): 222 $( BENCH_V_CFA)$(CFACOMPILE) -DBENCH_N=5000000 $(srcdir)/mutex/cfa4.cfa196 $(AM_V_CFA)$(CFACOMPILE) -DBENCH_N=5000000 $(srcdir)/mutex/cfa4.c 223 197 224 198 mutex-java_thread$(EXEEXT): 225 $( BENCH_V_JAVAC)javac -d $(builddir) $(srcdir)/mutex/JavaThread.java199 $(AM_V_JAVAC)javac -d $(builddir) $(srcdir)/mutex/JavaThread.java 226 200 @echo "#!/bin/sh" > a.out 227 201 @echo "java JavaThread" >> a.out … … 238 212 239 213 signal-pthread_cond$(EXEEXT): 240 $( BENCH_V_CC)$(COMPILE) -DBENCH_N=500000 $(srcdir)/schedint/pthreads.c214 $(AM_V_CC)$(COMPILE) -DBENCH_N=500000 $(srcdir)/schedint/pthreads.c 241 215 242 216 signal-upp$(EXEEXT): 243 $( BENCH_V_UPP)$(UPPCOMPILE) -DBENCH_N=5000000 $(srcdir)/schedint/upp.cc217 $(AM_V_UPP)$(UPPCOMPILE) -DBENCH_N=5000000 $(srcdir)/schedint/upp.cc 244 218 245 219 signal-cfa1$(EXEEXT): 246 $( BENCH_V_CFA)$(CFACOMPILE) -DBENCH_N=500000 $(srcdir)/schedint/cfa1.cfa220 $(AM_V_CFA)$(CFACOMPILE) -DBENCH_N=500000 $(srcdir)/schedint/cfa1.c 247 221 248 222 signal-cfa2$(EXEEXT): 249 $( BENCH_V_CFA)$(CFACOMPILE) -DBENCH_N=500000 $(srcdir)/schedint/cfa2.cfa223 $(AM_V_CFA)$(CFACOMPILE) -DBENCH_N=500000 $(srcdir)/schedint/cfa2.c 250 224 251 225 signal-cfa4$(EXEEXT): 252 $( BENCH_V_CFA)$(CFACOMPILE) -DBENCH_N=500000 $(srcdir)/schedint/cfa4.cfa226 $(AM_V_CFA)$(CFACOMPILE) -DBENCH_N=500000 $(srcdir)/schedint/cfa4.c 253 227 254 228 signal-java_thread$(EXEEXT): 255 $( BENCH_V_JAVAC)javac -d $(builddir) $(srcdir)/schedint/JavaThread.java229 $(AM_V_JAVAC)javac -d $(builddir) $(srcdir)/schedint/JavaThread.java 256 230 @echo "#!/bin/sh" > a.out 257 231 @echo "java JavaThread" >> a.out … … 267 241 268 242 waitfor-upp$(EXEEXT): 269 $( BENCH_V_UPP)$(UPPCOMPILE) -DBENCH_N=5000000 $(srcdir)/schedext/upp.cc243 $(AM_V_UPP)$(UPPCOMPILE) -DBENCH_N=5000000 $(srcdir)/schedext/upp.cc 270 244 271 245 waitfor-cfa1$(EXEEXT): 272 $( BENCH_V_CFA)$(CFACOMPILE) -DBENCH_N=500000 $(srcdir)/schedext/cfa1.cfa246 $(AM_V_CFA)$(CFACOMPILE) -DBENCH_N=500000 $(srcdir)/schedext/cfa1.c 273 247 274 248 waitfor-cfa2$(EXEEXT): 275 $( BENCH_V_CFA)$(CFACOMPILE) -DBENCH_N=500000 $(srcdir)/schedext/cfa2.cfa249 $(AM_V_CFA)$(CFACOMPILE) -DBENCH_N=500000 $(srcdir)/schedext/cfa2.c 276 250 277 251 waitfor-cfa4$(EXEEXT): 278 $( BENCH_V_CFA)$(CFACOMPILE) -DBENCH_N=500000 $(srcdir)/schedext/cfa4.cfa252 $(AM_V_CFA)$(CFACOMPILE) -DBENCH_N=500000 $(srcdir)/schedext/cfa4.c 279 253 280 254 ## ========================================================================================================= … … 290 264 291 265 creation-cfa_coroutine$(EXEEXT): 292 $( BENCH_V_CFA)$(CFACOMPILE) -DBENCH_N=10000000 $(srcdir)/creation/cfa_cor.cfa266 $(AM_V_CFA)$(CFACOMPILE) -DBENCH_N=10000000 $(srcdir)/creation/cfa_cor.c 293 267 294 268 creation-cfa_coroutine_eager$(EXEEXT): 295 $( BENCH_V_CFA)$(CFACOMPILE) -DBENCH_N=10000000 $(srcdir)/creation/cfa_cor.cfa -DEAGER269 $(AM_V_CFA)$(CFACOMPILE) -DBENCH_N=10000000 $(srcdir)/creation/cfa_cor.c 296 270 297 271 creation-cfa_thread$(EXEEXT): 298 $( BENCH_V_CFA)$(CFACOMPILE) -DBENCH_N=10000000 $(srcdir)/creation/cfa_thrd.cfa272 $(AM_V_CFA)$(CFACOMPILE) -DBENCH_N=10000000 $(srcdir)/creation/cfa_thrd.c 299 273 300 274 creation-upp_coroutine$(EXEEXT): 301 $( BENCH_V_UPP)$(UPPCOMPILE) -DBENCH_N=50000000 $(srcdir)/creation/upp_cor.cc275 $(AM_V_UPP)$(UPPCOMPILE) -DBENCH_N=50000000 $(srcdir)/creation/upp_cor.cc 302 276 303 277 creation-upp_thread$(EXEEXT): 304 $( BENCH_V_UPP)$(UPPCOMPILE) -DBENCH_N=50000000 $(srcdir)/creation/upp_thrd.cc278 $(AM_V_UPP)$(UPPCOMPILE) -DBENCH_N=50000000 $(srcdir)/creation/upp_thrd.cc 305 279 306 280 creation-pthread$(EXEEXT): 307 $( BENCH_V_CC)$(COMPILE) -DBENCH_N=250000 $(srcdir)/creation/pthreads.c281 $(AM_V_CC)$(COMPILE) -DBENCH_N=250000 $(srcdir)/creation/pthreads.c 308 282 309 283 creation-goroutine$(EXEEXT): 310 $( BENCH_V_GOC)go build -o a.out $(srcdir)/creation/goroutine.go284 $(AM_V_GOC)go build -o a.out $(srcdir)/creation/goroutine.go 311 285 312 286 creation-java_thread$(EXEEXT): 313 $( BENCH_V_JAVAC)javac -d $(builddir) $(srcdir)/creation/JavaThread.java287 $(AM_V_JAVAC)javac -d $(builddir) $(srcdir)/creation/JavaThread.java 314 288 @echo "#!/bin/sh" > a.out 315 289 @echo "java JavaThread" >> a.out … … 332 306 333 307 compile-array$(EXEEXT): 334 @$(CFACOMPILE) -fsyntax-only -w $(testdir)/array.cfa308 $(AM_V_CFA)$(CFACOMPILE) -fsyntax-only -w $(testdir)/array.c 335 309 336 310 compile-attributes$(EXEEXT): 337 @$(CFACOMPILE) -fsyntax-only -w $(testdir)/attributes.cfa311 $(AM_V_CFA)$(CFACOMPILE) -fsyntax-only -w $(testdir)/attributes.cfa 338 312 339 313 compile-empty$(EXEEXT): 340 @$(CFACOMPILE) -fsyntax-only -w $(srcdir)/compile/empty.cfa314 $(AM_V_CFA)$(CFACOMPILE) -fsyntax-only -w $(srcdir)/compile/empty.c 341 315 342 316 compile-expression$(EXEEXT): 343 @$(CFACOMPILE) -fsyntax-only -w $(testdir)/expression.cfa317 $(AM_V_CFA)$(CFACOMPILE) -fsyntax-only -w $(testdir)/expression.c 344 318 345 319 compile-io$(EXEEXT): 346 @$(CFACOMPILE) -fsyntax-only -w $(testdir)/io1.cfa320 $(AM_V_CFA)$(CFACOMPILE) -fsyntax-only -w $(testdir)/io1.c 347 321 348 322 compile-monitor$(EXEEXT): 349 @$(CFACOMPILE) -fsyntax-only -w $(testdir)/concurrent/monitor.cfa323 $(AM_V_CFA)$(CFACOMPILE) -fsyntax-only -w $(testdir)/concurrent/monitor.c 350 324 351 325 compile-operators$(EXEEXT): 352 @$(CFACOMPILE) -fsyntax-only -w $(testdir)/operators.cfa326 $(AM_V_CFA)$(CFACOMPILE) -fsyntax-only -w $(testdir)/operators.c 353 327 354 328 compile-thread$(EXEEXT): 355 @$(CFACOMPILE) -fsyntax-only -w $(testdir)/concurrent/thread.cfa329 $(AM_V_CFA)$(CFACOMPILE) -fsyntax-only -w $(testdir)/concurrent/thread.c 356 330 357 331 compile-typeof$(EXEEXT): 358 @$(CFACOMPILE) -fsyntax-only -w $(testdir)/typeof.cfa359 332 $(AM_V_CFA)$(CFACOMPILE) -fsyntax-only -w $(testdir)/typeof.c 333 -
benchmark/Makefile.in
r53bb8f1 r9d9a451 111 111 CONFIG_CLEAN_FILES = 112 112 CONFIG_CLEAN_VPATH_FILES = 113 am_dummy_OBJECTS = dummyC.$(OBJEXT) dummyCXX.$(OBJEXT)113 am_dummy_OBJECTS = c.$(OBJEXT) cxx.$(OBJEXT) 114 114 dummy_OBJECTS = $(am_dummy_OBJECTS) 115 115 dummy_LDADD = $(LDADD) … … 200 200 DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) 201 201 ACLOCAL = @ACLOCAL@ 202 ALLOCA = @ALLOCA@ 202 203 AMTAR = @AMTAR@ 203 204 AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ … … 363 364 am__v_GOC_0 = @echo " GOC " $@; 364 365 am__v_GOC_1 = 365 UPPCC = u++366 366 UPPCOMPILE = $(UPPCC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_UPPFLAGS) $(UPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) $(AM_CFLAGS) $(CFLAGS) 367 367 AM_V_UPP = $(am__v_UPP_@AM_V@) … … 371 371 372 372 # applies to both programs 373 UPPCC = u++ 373 374 AM_CFLAGS = -O2 -Wall -I$(srcdir) -lrt -pthread 374 375 AM_CFAFLAGS = -quiet -in-tree -nodebug 375 376 AM_UPPFLAGS = -quiet -nodebug -multi 376 BENCH_V_CC = $(__bench_v_CC_$(__quiet)) 377 BENCH_V_CFA = $(__bench_v_CFA_$(__quiet)) 378 BENCH_V_CXX = $(__bench_v_CXX_$(__quiet)) 379 BENCH_V_GOC = $(__bench_v_GOC_$(__quiet)) 380 BENCH_V_JAVAC = $(__bench_v_JAVAC_$(__quiet)) 381 BENCH_V_UPP = $(__bench_v_UPP_$(__quiet)) 382 __quiet = verbose 383 __bench_v_CC_quiet = @ 384 __bench_v_CFA_quiet = @ 385 __bench_v_CXX_quiet = @ 386 __bench_v_GOC_quiet = @ 387 __bench_v_JAVAC_quiet = @ 388 __bench_v_UPP_quiet = @ 389 __bench_v_CC_verbose = $(AM_V_CC) 390 __bench_v_CFA_verbose = $(AM_V_CFA) 391 __bench_v_CXX_verbose = $(AM_V_CXX) 392 __bench_v_GOC_verbose = $(AM_V_GOC) 393 __bench_v_JAVAC_verbose = $(AM_V_JAVAC) 394 __bench_v_UPP_verbose = $(AM_V_UPP) 395 TOOLSDIR = ${abs_top_builddir}/tools/ 396 REPEAT = ${abs_top_builddir}/tools/repeat 397 STATS = ${abs_top_srcdir}/tools/stat.py 377 TOOLSDIR = ${abs_top_srcdir}/tools/ 378 REPEAT = ${TOOLSDIR}repeat 379 STATS = ${TOOLSDIR}stat.py 398 380 repeats = 30 399 381 skipcompile = no 400 382 TIME_FORMAT = "%E" 401 383 PRINT_FORMAT = %20s: #Comments needed for spacing 402 dummy_SOURCES = dummyC.c dummyCXX.cpp384 dummy_SOURCES = c.c cxx.cpp 403 385 CTXSWITCH_DEPEND = loop.run function.run fetch_add.run \ 404 386 ctxswitch-pthread.run ctxswitch-cfa_coroutine.run \ … … 453 435 -rm -f *.tab.c 454 436 455 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ dummyC.Po@am__quote@456 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ dummyCXX.Po@am__quote@437 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/c.Po@am__quote@ 438 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cxx.Po@am__quote@ 457 439 458 440 .c.o: … … 724 706 $(am__mv) $$depbase.Tpo $$depbase.Plo 725 707 726 dummyC.c: 727 @echo "int main() { return 0; }" > ${@} 728 729 dummyCXX.cpp: 730 @echo "int main() { return 0; }" > ${@} 731 708 #prevent any tests in parallel 732 709 .NOTPARALLEL: 733 710 … … 744 721 745 722 %.runquiet : 746 @+make $(basename $@) CFLAGS="-w" __quiet=quiet723 @+make $(basename $@) CFLAGS="-w" 747 724 @taskset -c 1 ./a.out 748 725 @rm -f a.out … … 753 730 754 731 ${REPEAT} : 755 @+make -C ${ abs_top_builddir}/toolsrepeat732 @+make -C ${TOOLSDIR} repeat 756 733 757 734 jenkins$(EXEEXT): … … 791 768 792 769 loop$(EXEEXT): 793 $( BENCH_V_CC)$(COMPILE) -DBENCH_N=5000000000 $(srcdir)/loop.c770 $(AM_V_CC)$(COMPILE) -DBENCH_N=5000000000 $(srcdir)/loop.c 794 771 795 772 function$(EXEEXT): 796 $( BENCH_V_CC)$(COMPILE) -DBENCH_N=5000000000 $(srcdir)/function.c773 $(AM_V_CC)$(COMPILE) -DBENCH_N=5000000000 $(srcdir)/function.c 797 774 798 775 fetch_add$(EXEEXT): 799 $( BENCH_V_CC)$(COMPILE) -DBENCH_N=500000000 $(srcdir)/fetch_add.c776 $(AM_V_CC)$(COMPILE) -DBENCH_N=500000000 $(srcdir)/fetch_add.c 800 777 801 778 @WITH_LIBFIBRE_TRUE@ctxswitch-kos_fibre$(EXEEXT): 802 @WITH_LIBFIBRE_TRUE@ $( BENCH_V_CXX)$(CXXCOMPILE) -DBENCH_N=50000000 $(srcdir)/ctxswitch/kos_fibre.cpp -I$(LIBFIBRE_DIR) -lfibre779 @WITH_LIBFIBRE_TRUE@ $(AM_V_CXX)$(CXXCOMPILE) -DBENCH_N=50000000 $(srcdir)/ctxswitch/kos_fibre.cpp -I$(LIBFIBRE_DIR) -lfibre 803 780 804 781 @WITH_LIBFIBRE_TRUE@ctxswitch-kos_fibre2$(EXEEXT): 805 @WITH_LIBFIBRE_TRUE@ $( BENCH_V_CXX)$(CXXCOMPILE) -DBENCH_N=50000000 $(srcdir)/ctxswitch/kos_fibre2.cpp -I$(LIBFIBRE_DIR) -lfibre782 @WITH_LIBFIBRE_TRUE@ $(AM_V_CXX)$(CXXCOMPILE) -DBENCH_N=50000000 $(srcdir)/ctxswitch/kos_fibre2.cpp -I$(LIBFIBRE_DIR) -lfibre 806 783 807 784 ctxswitch$(EXEEXT): $(CTXSWITCH_DEPEND) 808 785 809 786 ctxswitch-pthread$(EXEEXT): 810 $( BENCH_V_CC)$(COMPILE) -DBENCH_N=50000000 $(srcdir)/ctxswitch/pthreads.c787 $(AM_V_CC)$(COMPILE) -DBENCH_N=50000000 $(srcdir)/ctxswitch/pthreads.c 811 788 812 789 ctxswitch-cfa_coroutine$(EXEEXT): 813 $( BENCH_V_CFA)$(CFACOMPILE) -DBENCH_N=50000000 $(srcdir)/ctxswitch/cfa_cor.cfa790 $(AM_V_CFA)$(CFACOMPILE) -DBENCH_N=50000000 $(srcdir)/ctxswitch/cfa_cor.c 814 791 815 792 ctxswitch-cfa_thread$(EXEEXT): 816 $( BENCH_V_CFA)$(CFACOMPILE) -DBENCH_N=50000000 $(srcdir)/ctxswitch/cfa_thrd.cfa793 $(AM_V_CFA)$(CFACOMPILE) -DBENCH_N=50000000 $(srcdir)/ctxswitch/cfa_thrd.c 817 794 818 795 ctxswitch-cfa_thread2$(EXEEXT): 819 $( BENCH_V_CFA)$(CFACOMPILE) -DBENCH_N=50000000 $(srcdir)/ctxswitch/cfa_thrd2.cfa796 $(AM_V_CFA)$(CFACOMPILE) -DBENCH_N=50000000 $(srcdir)/ctxswitch/cfa_thrd2.c 820 797 821 798 ctxswitch-upp_coroutine$(EXEEXT): 822 $( BENCH_V_UPP)$(UPPCOMPILE) -DBENCH_N=50000000 $(srcdir)/ctxswitch/upp_cor.cc799 $(AM_V_UPP)$(UPPCOMPILE) -DBENCH_N=50000000 $(srcdir)/ctxswitch/upp_cor.cc 823 800 824 801 ctxswitch-upp_thread$(EXEEXT): 825 $( BENCH_V_UPP)$(UPPCOMPILE) -DBENCH_N=50000000 $(srcdir)/ctxswitch/upp_thrd.cc802 $(AM_V_UPP)$(UPPCOMPILE) -DBENCH_N=50000000 $(srcdir)/ctxswitch/upp_thrd.cc 826 803 827 804 ctxswitch-goroutine$(EXEEXT): 828 $( BENCH_V_GOC)go build -o a.out $(srcdir)/ctxswitch/goroutine.go805 $(AM_V_GOC)go build -o a.out $(srcdir)/ctxswitch/goroutine.go 829 806 830 807 ctxswitch-java_thread$(EXEEXT): 831 $( BENCH_V_JAVAC)javac -d $(builddir) $(srcdir)/ctxswitch/JavaThread.java808 $(AM_V_JAVAC)javac -d $(builddir) $(srcdir)/ctxswitch/JavaThread.java 832 809 @echo "#!/bin/sh" > a.out 833 810 @echo "java JavaThread" >> a.out … … 846 823 847 824 mutex-pthread_lock$(EXEEXT): 848 $( BENCH_V_CC)$(COMPILE) -DBENCH_N=50000000 $(srcdir)/mutex/pthreads.c825 $(AM_V_CC)$(COMPILE) -DBENCH_N=50000000 $(srcdir)/mutex/pthreads.c 849 826 850 827 mutex-upp$(EXEEXT): 851 $( BENCH_V_UPP)$(UPPCOMPILE) -DBENCH_N=50000000 $(srcdir)/mutex/upp.cc828 $(AM_V_UPP)$(UPPCOMPILE) -DBENCH_N=50000000 $(srcdir)/mutex/upp.cc 852 829 853 830 mutex-cfa1$(EXEEXT): 854 $( BENCH_V_CFA)$(CFACOMPILE) -DBENCH_N=5000000 $(srcdir)/mutex/cfa1.cfa831 $(AM_V_CFA)$(CFACOMPILE) -DBENCH_N=5000000 $(srcdir)/mutex/cfa1.c 855 832 856 833 mutex-cfa2$(EXEEXT): 857 $( BENCH_V_CFA)$(CFACOMPILE) -DBENCH_N=5000000 $(srcdir)/mutex/cfa2.cfa834 $(AM_V_CFA)$(CFACOMPILE) -DBENCH_N=5000000 $(srcdir)/mutex/cfa2.c 858 835 859 836 mutex-cfa4$(EXEEXT): 860 $( BENCH_V_CFA)$(CFACOMPILE) -DBENCH_N=5000000 $(srcdir)/mutex/cfa4.cfa837 $(AM_V_CFA)$(CFACOMPILE) -DBENCH_N=5000000 $(srcdir)/mutex/cfa4.c 861 838 862 839 mutex-java_thread$(EXEEXT): 863 $( BENCH_V_JAVAC)javac -d $(builddir) $(srcdir)/mutex/JavaThread.java840 $(AM_V_JAVAC)javac -d $(builddir) $(srcdir)/mutex/JavaThread.java 864 841 @echo "#!/bin/sh" > a.out 865 842 @echo "java JavaThread" >> a.out … … 875 852 876 853 signal-pthread_cond$(EXEEXT): 877 $( BENCH_V_CC)$(COMPILE) -DBENCH_N=500000 $(srcdir)/schedint/pthreads.c854 $(AM_V_CC)$(COMPILE) -DBENCH_N=500000 $(srcdir)/schedint/pthreads.c 878 855 879 856 signal-upp$(EXEEXT): 880 $( BENCH_V_UPP)$(UPPCOMPILE) -DBENCH_N=5000000 $(srcdir)/schedint/upp.cc857 $(AM_V_UPP)$(UPPCOMPILE) -DBENCH_N=5000000 $(srcdir)/schedint/upp.cc 881 858 882 859 signal-cfa1$(EXEEXT): 883 $( BENCH_V_CFA)$(CFACOMPILE) -DBENCH_N=500000 $(srcdir)/schedint/cfa1.cfa860 $(AM_V_CFA)$(CFACOMPILE) -DBENCH_N=500000 $(srcdir)/schedint/cfa1.c 884 861 885 862 signal-cfa2$(EXEEXT): 886 $( BENCH_V_CFA)$(CFACOMPILE) -DBENCH_N=500000 $(srcdir)/schedint/cfa2.cfa863 $(AM_V_CFA)$(CFACOMPILE) -DBENCH_N=500000 $(srcdir)/schedint/cfa2.c 887 864 888 865 signal-cfa4$(EXEEXT): 889 $( BENCH_V_CFA)$(CFACOMPILE) -DBENCH_N=500000 $(srcdir)/schedint/cfa4.cfa866 $(AM_V_CFA)$(CFACOMPILE) -DBENCH_N=500000 $(srcdir)/schedint/cfa4.c 890 867 891 868 signal-java_thread$(EXEEXT): 892 $( BENCH_V_JAVAC)javac -d $(builddir) $(srcdir)/schedint/JavaThread.java869 $(AM_V_JAVAC)javac -d $(builddir) $(srcdir)/schedint/JavaThread.java 893 870 @echo "#!/bin/sh" > a.out 894 871 @echo "java JavaThread" >> a.out … … 902 879 903 880 waitfor-upp$(EXEEXT): 904 $( BENCH_V_UPP)$(UPPCOMPILE) -DBENCH_N=5000000 $(srcdir)/schedext/upp.cc881 $(AM_V_UPP)$(UPPCOMPILE) -DBENCH_N=5000000 $(srcdir)/schedext/upp.cc 905 882 906 883 waitfor-cfa1$(EXEEXT): 907 $( BENCH_V_CFA)$(CFACOMPILE) -DBENCH_N=500000 $(srcdir)/schedext/cfa1.cfa884 $(AM_V_CFA)$(CFACOMPILE) -DBENCH_N=500000 $(srcdir)/schedext/cfa1.c 908 885 909 886 waitfor-cfa2$(EXEEXT): 910 $( BENCH_V_CFA)$(CFACOMPILE) -DBENCH_N=500000 $(srcdir)/schedext/cfa2.cfa887 $(AM_V_CFA)$(CFACOMPILE) -DBENCH_N=500000 $(srcdir)/schedext/cfa2.c 911 888 912 889 waitfor-cfa4$(EXEEXT): 913 $( BENCH_V_CFA)$(CFACOMPILE) -DBENCH_N=500000 $(srcdir)/schedext/cfa4.cfa890 $(AM_V_CFA)$(CFACOMPILE) -DBENCH_N=500000 $(srcdir)/schedext/cfa4.c 914 891 915 892 creation$(EXEEXT) :\ … … 924 901 925 902 creation-cfa_coroutine$(EXEEXT): 926 $( BENCH_V_CFA)$(CFACOMPILE) -DBENCH_N=10000000 $(srcdir)/creation/cfa_cor.cfa903 $(AM_V_CFA)$(CFACOMPILE) -DBENCH_N=10000000 $(srcdir)/creation/cfa_cor.c 927 904 928 905 creation-cfa_coroutine_eager$(EXEEXT): 929 $( BENCH_V_CFA)$(CFACOMPILE) -DBENCH_N=10000000 $(srcdir)/creation/cfa_cor.cfa -DEAGER906 $(AM_V_CFA)$(CFACOMPILE) -DBENCH_N=10000000 $(srcdir)/creation/cfa_cor.c 930 907 931 908 creation-cfa_thread$(EXEEXT): 932 $( BENCH_V_CFA)$(CFACOMPILE) -DBENCH_N=10000000 $(srcdir)/creation/cfa_thrd.cfa909 $(AM_V_CFA)$(CFACOMPILE) -DBENCH_N=10000000 $(srcdir)/creation/cfa_thrd.c 933 910 934 911 creation-upp_coroutine$(EXEEXT): 935 $( BENCH_V_UPP)$(UPPCOMPILE) -DBENCH_N=50000000 $(srcdir)/creation/upp_cor.cc912 $(AM_V_UPP)$(UPPCOMPILE) -DBENCH_N=50000000 $(srcdir)/creation/upp_cor.cc 936 913 937 914 creation-upp_thread$(EXEEXT): 938 $( BENCH_V_UPP)$(UPPCOMPILE) -DBENCH_N=50000000 $(srcdir)/creation/upp_thrd.cc915 $(AM_V_UPP)$(UPPCOMPILE) -DBENCH_N=50000000 $(srcdir)/creation/upp_thrd.cc 939 916 940 917 creation-pthread$(EXEEXT): 941 $( BENCH_V_CC)$(COMPILE) -DBENCH_N=250000 $(srcdir)/creation/pthreads.c918 $(AM_V_CC)$(COMPILE) -DBENCH_N=250000 $(srcdir)/creation/pthreads.c 942 919 943 920 creation-goroutine$(EXEEXT): 944 $( BENCH_V_GOC)go build -o a.out $(srcdir)/creation/goroutine.go921 $(AM_V_GOC)go build -o a.out $(srcdir)/creation/goroutine.go 945 922 946 923 creation-java_thread$(EXEEXT): 947 $( BENCH_V_JAVAC)javac -d $(builddir) $(srcdir)/creation/JavaThread.java924 $(AM_V_JAVAC)javac -d $(builddir) $(srcdir)/creation/JavaThread.java 948 925 @echo "#!/bin/sh" > a.out 949 926 @echo "java JavaThread" >> a.out … … 961 938 962 939 compile-array$(EXEEXT): 963 @$(CFACOMPILE) -fsyntax-only -w $(testdir)/array.cfa940 $(AM_V_CFA)$(CFACOMPILE) -fsyntax-only -w $(testdir)/array.c 964 941 965 942 compile-attributes$(EXEEXT): 966 @$(CFACOMPILE) -fsyntax-only -w $(testdir)/attributes.cfa943 $(AM_V_CFA)$(CFACOMPILE) -fsyntax-only -w $(testdir)/attributes.cfa 967 944 968 945 compile-empty$(EXEEXT): 969 @$(CFACOMPILE) -fsyntax-only -w $(srcdir)/compile/empty.cfa946 $(AM_V_CFA)$(CFACOMPILE) -fsyntax-only -w $(srcdir)/compile/empty.c 970 947 971 948 compile-expression$(EXEEXT): 972 @$(CFACOMPILE) -fsyntax-only -w $(testdir)/expression.cfa949 $(AM_V_CFA)$(CFACOMPILE) -fsyntax-only -w $(testdir)/expression.c 973 950 974 951 compile-io$(EXEEXT): 975 @$(CFACOMPILE) -fsyntax-only -w $(testdir)/io1.cfa952 $(AM_V_CFA)$(CFACOMPILE) -fsyntax-only -w $(testdir)/io1.c 976 953 977 954 compile-monitor$(EXEEXT): 978 @$(CFACOMPILE) -fsyntax-only -w $(testdir)/concurrent/monitor.cfa955 $(AM_V_CFA)$(CFACOMPILE) -fsyntax-only -w $(testdir)/concurrent/monitor.c 979 956 980 957 compile-operators$(EXEEXT): 981 @$(CFACOMPILE) -fsyntax-only -w $(testdir)/operators.cfa958 $(AM_V_CFA)$(CFACOMPILE) -fsyntax-only -w $(testdir)/operators.c 982 959 983 960 compile-thread$(EXEEXT): 984 @$(CFACOMPILE) -fsyntax-only -w $(testdir)/concurrent/thread.cfa961 $(AM_V_CFA)$(CFACOMPILE) -fsyntax-only -w $(testdir)/concurrent/thread.c 985 962 986 963 compile-typeof$(EXEEXT): 987 @$(CFACOMPILE) -fsyntax-only -w $(testdir)/typeof.cfa964 $(AM_V_CFA)$(CFACOMPILE) -fsyntax-only -w $(testdir)/typeof.c 988 965 989 966 # Tell versions [3.59,3.63) of GNU make to not export all variables. -
configure
r53bb8f1 r9d9a451 637 637 LIBOBJS 638 638 CFA_BACKEND_CC 639 ALLOCA 639 640 WITH_LIBFIBRE_FALSE 640 641 WITH_LIBFIBRE_TRUE … … 1960 1961 } # ac_fn_cxx_try_link 1961 1962 1963 # ac_fn_c_check_type LINENO TYPE VAR INCLUDES 1964 # ------------------------------------------- 1965 # Tests whether TYPE exists after having included INCLUDES, setting cache 1966 # variable VAR accordingly. 1967 ac_fn_c_check_type () 1968 { 1969 as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack 1970 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 1971 $as_echo_n "checking for $2... " >&6; } 1972 if eval \${$3+:} false; then : 1973 $as_echo_n "(cached) " >&6 1974 else 1975 eval "$3=no" 1976 cat confdefs.h - <<_ACEOF >conftest.$ac_ext 1977 /* end confdefs.h. */ 1978 $4 1979 int 1980 main () 1981 { 1982 if (sizeof ($2)) 1983 return 0; 1984 ; 1985 return 0; 1986 } 1987 _ACEOF 1988 if ac_fn_c_try_compile "$LINENO"; then : 1989 cat confdefs.h - <<_ACEOF >conftest.$ac_ext 1990 /* end confdefs.h. */ 1991 $4 1992 int 1993 main () 1994 { 1995 if (sizeof (($2))) 1996 return 0; 1997 ; 1998 return 0; 1999 } 2000 _ACEOF 2001 if ac_fn_c_try_compile "$LINENO"; then : 2002 2003 else 2004 eval "$3=yes" 2005 fi 2006 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext 2007 fi 2008 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext 2009 fi 2010 eval ac_res=\$$3 2011 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 2012 $as_echo "$ac_res" >&6; } 2013 eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno 2014 2015 } # ac_fn_c_check_type 2016 1962 2017 # ac_fn_c_check_header_mongrel LINENO HEADER VAR INCLUDES 1963 2018 # ------------------------------------------------------- … … 2051 2106 } # ac_fn_c_check_header_mongrel 2052 2107 2053 # ac_fn_c_ check_type LINENO TYPE VAR INCLUDES2054 # ----------------------------------- --------2055 # Tests whether TYPE exists after having included INCLUDES, setting cache2056 # variable VARaccordingly.2057 ac_fn_c_ check_type()2108 # ac_fn_c_find_intX_t LINENO BITS VAR 2109 # ----------------------------------- 2110 # Finds a signed integer type with width BITS, setting cache variable VAR 2111 # accordingly. 2112 ac_fn_c_find_intX_t () 2058 2113 { 2059 2114 as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack 2060 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&52061 $as_echo_n "checking for $2... " >&6; }2115 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for int$2_t" >&5 2116 $as_echo_n "checking for int$2_t... " >&6; } 2062 2117 if eval \${$3+:} false; then : 2063 2118 $as_echo_n "(cached) " >&6 2064 2119 else 2065 2120 eval "$3=no" 2066 cat confdefs.h - <<_ACEOF >conftest.$ac_ext 2121 # Order is important - never check a type that is potentially smaller 2122 # than half of the expected target width. 2123 for ac_type in int$2_t 'int' 'long int' \ 2124 'long long int' 'short int' 'signed char'; do 2125 cat confdefs.h - <<_ACEOF >conftest.$ac_ext 2067 2126 /* end confdefs.h. */ 2068 $4 2127 $ac_includes_default 2128 enum { N = $2 / 2 - 1 }; 2069 2129 int 2070 2130 main () 2071 2131 { 2072 if (sizeof ($2)) 2073 return 0; 2132 static int test_array [1 - 2 * !(0 < ($ac_type) ((((($ac_type) 1 << N) << N) - 1) * 2 + 1))]; 2133 test_array [0] = 0; 2134 return test_array [0]; 2135 2074 2136 ; 2075 2137 return 0; … … 2079 2141 cat confdefs.h - <<_ACEOF >conftest.$ac_ext 2080 2142 /* end confdefs.h. */ 2081 $4 2143 $ac_includes_default 2144 enum { N = $2 / 2 - 1 }; 2082 2145 int 2083 2146 main () 2084 2147 { 2085 if (sizeof (($2))) 2086 return 0; 2148 static int test_array [1 - 2 * !(($ac_type) ((((($ac_type) 1 << N) << N) - 1) * 2 + 1) 2149 < ($ac_type) ((((($ac_type) 1 << N) << N) - 1) * 2 + 2))]; 2150 test_array [0] = 0; 2151 return test_array [0]; 2152 2087 2153 ; 2088 2154 return 0; … … 2092 2158 2093 2159 else 2094 eval "$3=yes" 2160 case $ac_type in #( 2161 int$2_t) : 2162 eval "$3=yes" ;; #( 2163 *) : 2164 eval "$3=\$ac_type" ;; 2165 esac 2095 2166 fi 2096 2167 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext 2097 2168 fi 2098 2169 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext 2170 if eval test \"x\$"$3"\" = x"no"; then : 2171 2172 else 2173 break 2174 fi 2175 done 2099 2176 fi 2100 2177 eval ac_res=\$$3 … … 2103 2180 eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno 2104 2181 2105 } # ac_fn_c_check_type 2182 } # ac_fn_c_find_intX_t 2183 2184 # ac_fn_c_find_uintX_t LINENO BITS VAR 2185 # ------------------------------------ 2186 # Finds an unsigned integer type with width BITS, setting cache variable VAR 2187 # accordingly. 2188 ac_fn_c_find_uintX_t () 2189 { 2190 as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack 2191 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for uint$2_t" >&5 2192 $as_echo_n "checking for uint$2_t... " >&6; } 2193 if eval \${$3+:} false; then : 2194 $as_echo_n "(cached) " >&6 2195 else 2196 eval "$3=no" 2197 # Order is important - never check a type that is potentially smaller 2198 # than half of the expected target width. 2199 for ac_type in uint$2_t 'unsigned int' 'unsigned long int' \ 2200 'unsigned long long int' 'unsigned short int' 'unsigned char'; do 2201 cat confdefs.h - <<_ACEOF >conftest.$ac_ext 2202 /* end confdefs.h. */ 2203 $ac_includes_default 2204 int 2205 main () 2206 { 2207 static int test_array [1 - 2 * !((($ac_type) -1 >> ($2 / 2 - 1)) >> ($2 / 2 - 1) == 3)]; 2208 test_array [0] = 0; 2209 return test_array [0]; 2210 2211 ; 2212 return 0; 2213 } 2214 _ACEOF 2215 if ac_fn_c_try_compile "$LINENO"; then : 2216 case $ac_type in #( 2217 uint$2_t) : 2218 eval "$3=yes" ;; #( 2219 *) : 2220 eval "$3=\$ac_type" ;; 2221 esac 2222 fi 2223 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext 2224 if eval test \"x\$"$3"\" = x"no"; then : 2225 2226 else 2227 break 2228 fi 2229 done 2230 fi 2231 eval ac_res=\$$3 2232 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 2233 $as_echo "$ac_res" >&6; } 2234 eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno 2235 2236 } # ac_fn_c_find_uintX_t 2106 2237 cat >config.log <<_ACEOF 2107 2238 This file contains any messages produced by compilers while … … 2536 2667 2537 2668 2538 # http://git.savannah.gnu.org/gitweb/?p=autoconf-archive.git;a=blob_plain;f=m4/ax_check_compile_flag.m42539 2540 2669 2541 2670 # don't use the default CFLAGS as they unconditonnaly add -O2 … … 5054 5183 5055 5184 5185 # deprecated 5056 5186 # These are often not installed and people miss seeing the "no", so stop the configure. 5057 5187 for ac_prog in 'bison -y' byacc … … 16604 16734 16605 16735 16736 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ${MAKE-make} sets \$(MAKE)" >&5 16737 $as_echo_n "checking whether ${MAKE-make} sets \$(MAKE)... " >&6; } 16738 set x ${MAKE-make} 16739 ac_make=`$as_echo "$2" | sed 's/+/p/g; s/[^a-zA-Z0-9_]/_/g'` 16740 if eval \${ac_cv_prog_make_${ac_make}_set+:} false; then : 16741 $as_echo_n "(cached) " >&6 16742 else 16743 cat >conftest.make <<\_ACEOF 16744 SHELL = /bin/sh 16745 all: 16746 @echo '@@@%%%=$(MAKE)=@@@%%%' 16747 _ACEOF 16748 # GNU make sometimes prints "make[1]: Entering ...", which would confuse us. 16749 case `${MAKE-make} -f conftest.make 2>/dev/null` in 16750 *@@@%%%=?*=@@@%%%*) 16751 eval ac_cv_prog_make_${ac_make}_set=yes;; 16752 *) 16753 eval ac_cv_prog_make_${ac_make}_set=no;; 16754 esac 16755 rm -f conftest.make 16756 fi 16757 if eval test \$ac_cv_prog_make_${ac_make}_set = yes; then 16758 { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 16759 $as_echo "yes" >&6; } 16760 SET_MAKE= 16761 else 16762 { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 16763 $as_echo "no" >&6; } 16764 SET_MAKE="MAKE=${MAKE-make}" 16765 fi 16766 16606 16767 16607 16768 # Checks for libraries. … … 16658 16819 16659 16820 # Checks for header files. 16660 for ac_header in libintl.h malloc.h unistd.h 16821 ac_fn_c_check_type "$LINENO" "size_t" "ac_cv_type_size_t" "$ac_includes_default" 16822 if test "x$ac_cv_type_size_t" = xyes; then : 16823 16824 else 16825 16826 cat >>confdefs.h <<_ACEOF 16827 #define size_t unsigned int 16828 _ACEOF 16829 16830 fi 16831 16832 # The Ultrix 4.2 mips builtin alloca declared by alloca.h only works 16833 # for constant arguments. Useless! 16834 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for working alloca.h" >&5 16835 $as_echo_n "checking for working alloca.h... " >&6; } 16836 if ${ac_cv_working_alloca_h+:} false; then : 16837 $as_echo_n "(cached) " >&6 16838 else 16839 cat confdefs.h - <<_ACEOF >conftest.$ac_ext 16840 /* end confdefs.h. */ 16841 #include <alloca.h> 16842 int 16843 main () 16844 { 16845 char *p = (char *) alloca (2 * sizeof (int)); 16846 if (p) return 0; 16847 ; 16848 return 0; 16849 } 16850 _ACEOF 16851 if ac_fn_c_try_link "$LINENO"; then : 16852 ac_cv_working_alloca_h=yes 16853 else 16854 ac_cv_working_alloca_h=no 16855 fi 16856 rm -f core conftest.err conftest.$ac_objext \ 16857 conftest$ac_exeext conftest.$ac_ext 16858 fi 16859 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_working_alloca_h" >&5 16860 $as_echo "$ac_cv_working_alloca_h" >&6; } 16861 if test $ac_cv_working_alloca_h = yes; then 16862 16863 $as_echo "#define HAVE_ALLOCA_H 1" >>confdefs.h 16864 16865 fi 16866 16867 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for alloca" >&5 16868 $as_echo_n "checking for alloca... " >&6; } 16869 if ${ac_cv_func_alloca_works+:} false; then : 16870 $as_echo_n "(cached) " >&6 16871 else 16872 cat confdefs.h - <<_ACEOF >conftest.$ac_ext 16873 /* end confdefs.h. */ 16874 #ifdef __GNUC__ 16875 # define alloca __builtin_alloca 16876 #else 16877 # ifdef _MSC_VER 16878 # include <malloc.h> 16879 # define alloca _alloca 16880 # else 16881 # ifdef HAVE_ALLOCA_H 16882 # include <alloca.h> 16883 # else 16884 # ifdef _AIX 16885 #pragma alloca 16886 # else 16887 # ifndef alloca /* predefined by HP cc +Olibcalls */ 16888 void *alloca (size_t); 16889 # endif 16890 # endif 16891 # endif 16892 # endif 16893 #endif 16894 16895 int 16896 main () 16897 { 16898 char *p = (char *) alloca (1); 16899 if (p) return 0; 16900 ; 16901 return 0; 16902 } 16903 _ACEOF 16904 if ac_fn_c_try_link "$LINENO"; then : 16905 ac_cv_func_alloca_works=yes 16906 else 16907 ac_cv_func_alloca_works=no 16908 fi 16909 rm -f core conftest.err conftest.$ac_objext \ 16910 conftest$ac_exeext conftest.$ac_ext 16911 fi 16912 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_func_alloca_works" >&5 16913 $as_echo "$ac_cv_func_alloca_works" >&6; } 16914 16915 if test $ac_cv_func_alloca_works = yes; then 16916 16917 $as_echo "#define HAVE_ALLOCA 1" >>confdefs.h 16918 16919 else 16920 # The SVR3 libPW and SVR4 libucb both contain incompatible functions 16921 # that cause trouble. Some versions do not even contain alloca or 16922 # contain a buggy version. If you still want to use their alloca, 16923 # use ar to extract alloca.o from them instead of compiling alloca.c. 16924 16925 ALLOCA=\${LIBOBJDIR}alloca.$ac_objext 16926 16927 $as_echo "#define C_ALLOCA 1" >>confdefs.h 16928 16929 16930 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether \`alloca.c' needs Cray hooks" >&5 16931 $as_echo_n "checking whether \`alloca.c' needs Cray hooks... " >&6; } 16932 if ${ac_cv_os_cray+:} false; then : 16933 $as_echo_n "(cached) " >&6 16934 else 16935 cat confdefs.h - <<_ACEOF >conftest.$ac_ext 16936 /* end confdefs.h. */ 16937 #if defined CRAY && ! defined CRAY2 16938 webecray 16939 #else 16940 wenotbecray 16941 #endif 16942 16943 _ACEOF 16944 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | 16945 $EGREP "webecray" >/dev/null 2>&1; then : 16946 ac_cv_os_cray=yes 16947 else 16948 ac_cv_os_cray=no 16949 fi 16950 rm -f conftest* 16951 16952 fi 16953 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_os_cray" >&5 16954 $as_echo "$ac_cv_os_cray" >&6; } 16955 if test $ac_cv_os_cray = yes; then 16956 for ac_func in _getb67 GETB67 getb67; do 16957 as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` 16958 ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var" 16959 if eval test \"x\$"$as_ac_var"\" = x"yes"; then : 16960 16961 cat >>confdefs.h <<_ACEOF 16962 #define CRAY_STACKSEG_END $ac_func 16963 _ACEOF 16964 16965 break 16966 fi 16967 16968 done 16969 fi 16970 16971 { $as_echo "$as_me:${as_lineno-$LINENO}: checking stack direction for C alloca" >&5 16972 $as_echo_n "checking stack direction for C alloca... " >&6; } 16973 if ${ac_cv_c_stack_direction+:} false; then : 16974 $as_echo_n "(cached) " >&6 16975 else 16976 if test "$cross_compiling" = yes; then : 16977 ac_cv_c_stack_direction=0 16978 else 16979 cat confdefs.h - <<_ACEOF >conftest.$ac_ext 16980 /* end confdefs.h. */ 16981 $ac_includes_default 16982 int 16983 find_stack_direction (int *addr, int depth) 16984 { 16985 int dir, dummy = 0; 16986 if (! addr) 16987 addr = &dummy; 16988 *addr = addr < &dummy ? 1 : addr == &dummy ? 0 : -1; 16989 dir = depth ? find_stack_direction (addr, depth - 1) : 0; 16990 return dir + dummy; 16991 } 16992 16993 int 16994 main (int argc, char **argv) 16995 { 16996 return find_stack_direction (0, argc + !argv + 20) < 0; 16997 } 16998 _ACEOF 16999 if ac_fn_c_try_run "$LINENO"; then : 17000 ac_cv_c_stack_direction=1 17001 else 17002 ac_cv_c_stack_direction=-1 17003 fi 17004 rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ 17005 conftest.$ac_objext conftest.beam conftest.$ac_ext 17006 fi 17007 17008 fi 17009 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_stack_direction" >&5 17010 $as_echo "$ac_cv_c_stack_direction" >&6; } 17011 cat >>confdefs.h <<_ACEOF 17012 #define STACK_DIRECTION $ac_cv_c_stack_direction 17013 _ACEOF 17014 17015 17016 fi 17017 17018 for ac_header in fenv.h float.h inttypes.h libintl.h limits.h malloc.h stddef.h stdlib.h string.h unistd.h 16661 17019 do : 16662 17020 as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` … … 16667 17025 _ACEOF 16668 17026 16669 else16670 echo "Error: Missing required header"; exit 116671 17027 fi 16672 17028 … … 16675 17031 16676 17032 # Checks for typedefs, structures, and compiler characteristics. 16677 ac_fn_c_check_type "$LINENO" "_Float32" "ac_cv_type__Float32" " 16678 " 16679 if test "x$ac_cv_type__Float32" = xyes; then : 16680 16681 cat >>confdefs.h <<_ACEOF 16682 #define HAVE__FLOAT32 1 16683 _ACEOF 16684 16685 16686 $as_echo "#define HAVE_KEYWORDS_FLOATXX /**/" >>confdefs.h 16687 16688 fi 16689 16690 16691 # Checks for compiler flags. 16692 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether C compiler accepts -Wcast-function-type" >&5 16693 $as_echo_n "checking whether C compiler accepts -Wcast-function-type... " >&6; } 16694 if ${m4cfa_cv_check_cflags___Wcast_function_type+:} false; then : 17033 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for stdbool.h that conforms to C99" >&5 17034 $as_echo_n "checking for stdbool.h that conforms to C99... " >&6; } 17035 if ${ac_cv_header_stdbool_h+:} false; then : 16695 17036 $as_echo_n "(cached) " >&6 16696 17037 else 16697 16698 m4cfa_check_save_flags=$CFLAGS 16699 CFLAGS="$CFLAGS -Wcast-function-type" 16700 cat confdefs.h - <<_ACEOF >conftest.$ac_ext 17038 cat confdefs.h - <<_ACEOF >conftest.$ac_ext 16701 17039 /* end confdefs.h. */ 17040 17041 #include <stdbool.h> 17042 #ifndef bool 17043 "error: bool is not defined" 17044 #endif 17045 #ifndef false 17046 "error: false is not defined" 17047 #endif 17048 #if false 17049 "error: false is not 0" 17050 #endif 17051 #ifndef true 17052 "error: true is not defined" 17053 #endif 17054 #if true != 1 17055 "error: true is not 1" 17056 #endif 17057 #ifndef __bool_true_false_are_defined 17058 "error: __bool_true_false_are_defined is not defined" 17059 #endif 17060 17061 struct s { _Bool s: 1; _Bool t; } s; 17062 17063 char a[true == 1 ? 1 : -1]; 17064 char b[false == 0 ? 1 : -1]; 17065 char c[__bool_true_false_are_defined == 1 ? 1 : -1]; 17066 char d[(bool) 0.5 == true ? 1 : -1]; 17067 /* See body of main program for 'e'. */ 17068 char f[(_Bool) 0.0 == false ? 1 : -1]; 17069 char g[true]; 17070 char h[sizeof (_Bool)]; 17071 char i[sizeof s.t]; 17072 enum { j = false, k = true, l = false * true, m = true * 256 }; 17073 /* The following fails for 17074 HP aC++/ANSI C B3910B A.05.55 [Dec 04 2003]. */ 17075 _Bool n[m]; 17076 char o[sizeof n == m * sizeof n[0] ? 1 : -1]; 17077 char p[-1 - (_Bool) 0 < 0 && -1 - (bool) 0 < 0 ? 1 : -1]; 17078 /* Catch a bug in an HP-UX C compiler. See 17079 http://gcc.gnu.org/ml/gcc-patches/2003-12/msg02303.html 17080 http://lists.gnu.org/archive/html/bug-coreutils/2005-11/msg00161.html 17081 */ 17082 _Bool q = true; 17083 _Bool *pq = &q; 16702 17084 16703 17085 int 16704 17086 main () 16705 17087 { 17088 17089 bool e = &s; 17090 *pq |= q; 17091 *pq |= ! q; 17092 /* Refer to every declared value, to avoid compiler optimizations. */ 17093 return (!a + !b + !c + !d + !e + !f + !g + !h + !i + !!j + !k + !!l 17094 + !m + !n + !o + !p + !q + !pq); 16706 17095 16707 17096 ; … … 16710 17099 _ACEOF 16711 17100 if ac_fn_c_try_compile "$LINENO"; then : 16712 m4cfa_cv_check_cflags___Wcast_function_type=yes16713 else 16714 m4cfa_cv_check_cflags___Wcast_function_type=no17101 ac_cv_header_stdbool_h=yes 17102 else 17103 ac_cv_header_stdbool_h=no 16715 17104 fi 16716 17105 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext 16717 CFLAGS=$m4cfa_check_save_flags 16718 fi 16719 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $m4cfa_cv_check_cflags___Wcast_function_type" >&5 16720 $as_echo "$m4cfa_cv_check_cflags___Wcast_function_type" >&6; } 16721 if test "x$m4cfa_cv_check_cflags___Wcast_function_type" = xyes; then : 16722 16723 $as_echo "#define HAVE_CAST_FUNCTION_TYPE /**/" >>confdefs.h 16724 16725 else 16726 : 16727 fi 17106 fi 17107 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_stdbool_h" >&5 17108 $as_echo "$ac_cv_header_stdbool_h" >&6; } 17109 ac_fn_c_check_type "$LINENO" "_Bool" "ac_cv_type__Bool" "$ac_includes_default" 17110 if test "x$ac_cv_type__Bool" = xyes; then : 17111 17112 cat >>confdefs.h <<_ACEOF 17113 #define HAVE__BOOL 1 17114 _ACEOF 17115 17116 17117 fi 17118 17119 17120 if test $ac_cv_header_stdbool_h = yes; then 17121 17122 $as_echo "#define HAVE_STDBOOL_H 1" >>confdefs.h 17123 17124 fi 17125 17126 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for inline" >&5 17127 $as_echo_n "checking for inline... " >&6; } 17128 if ${ac_cv_c_inline+:} false; then : 17129 $as_echo_n "(cached) " >&6 17130 else 17131 ac_cv_c_inline=no 17132 for ac_kw in inline __inline__ __inline; do 17133 cat confdefs.h - <<_ACEOF >conftest.$ac_ext 17134 /* end confdefs.h. */ 17135 #ifndef __cplusplus 17136 typedef int foo_t; 17137 static $ac_kw foo_t static_foo () {return 0; } 17138 $ac_kw foo_t foo () {return 0; } 17139 #endif 17140 17141 _ACEOF 17142 if ac_fn_c_try_compile "$LINENO"; then : 17143 ac_cv_c_inline=$ac_kw 17144 fi 17145 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext 17146 test "$ac_cv_c_inline" != no && break 17147 done 17148 17149 fi 17150 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_inline" >&5 17151 $as_echo "$ac_cv_c_inline" >&6; } 17152 17153 case $ac_cv_c_inline in 17154 inline | yes) ;; 17155 *) 17156 case $ac_cv_c_inline in 17157 no) ac_val=;; 17158 *) ac_val=$ac_cv_c_inline;; 17159 esac 17160 cat >>confdefs.h <<_ACEOF 17161 #ifndef __cplusplus 17162 #define inline $ac_val 17163 #endif 17164 _ACEOF 17165 ;; 17166 esac 17167 17168 ac_fn_c_find_intX_t "$LINENO" "16" "ac_cv_c_int16_t" 17169 case $ac_cv_c_int16_t in #( 17170 no|yes) ;; #( 17171 *) 17172 17173 cat >>confdefs.h <<_ACEOF 17174 #define int16_t $ac_cv_c_int16_t 17175 _ACEOF 17176 ;; 17177 esac 17178 17179 ac_fn_c_find_intX_t "$LINENO" "32" "ac_cv_c_int32_t" 17180 case $ac_cv_c_int32_t in #( 17181 no|yes) ;; #( 17182 *) 17183 17184 cat >>confdefs.h <<_ACEOF 17185 #define int32_t $ac_cv_c_int32_t 17186 _ACEOF 17187 ;; 17188 esac 17189 17190 ac_fn_c_find_intX_t "$LINENO" "8" "ac_cv_c_int8_t" 17191 case $ac_cv_c_int8_t in #( 17192 no|yes) ;; #( 17193 *) 17194 17195 cat >>confdefs.h <<_ACEOF 17196 #define int8_t $ac_cv_c_int8_t 17197 _ACEOF 17198 ;; 17199 esac 17200 17201 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for C/C++ restrict keyword" >&5 17202 $as_echo_n "checking for C/C++ restrict keyword... " >&6; } 17203 if ${ac_cv_c_restrict+:} false; then : 17204 $as_echo_n "(cached) " >&6 17205 else 17206 ac_cv_c_restrict=no 17207 # The order here caters to the fact that C++ does not require restrict. 17208 for ac_kw in __restrict __restrict__ _Restrict restrict; do 17209 cat confdefs.h - <<_ACEOF >conftest.$ac_ext 17210 /* end confdefs.h. */ 17211 typedef int * int_ptr; 17212 int foo (int_ptr $ac_kw ip) { 17213 return ip[0]; 17214 } 17215 int 17216 main () 17217 { 17218 int s[1]; 17219 int * $ac_kw t = s; 17220 t[0] = 0; 17221 return foo(t) 17222 ; 17223 return 0; 17224 } 17225 _ACEOF 17226 if ac_fn_c_try_compile "$LINENO"; then : 17227 ac_cv_c_restrict=$ac_kw 17228 fi 17229 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext 17230 test "$ac_cv_c_restrict" != no && break 17231 done 17232 17233 fi 17234 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_restrict" >&5 17235 $as_echo "$ac_cv_c_restrict" >&6; } 17236 17237 case $ac_cv_c_restrict in 17238 restrict) ;; 17239 no) $as_echo "#define restrict /**/" >>confdefs.h 17240 ;; 17241 *) cat >>confdefs.h <<_ACEOF 17242 #define restrict $ac_cv_c_restrict 17243 _ACEOF 17244 ;; 17245 esac 17246 17247 ac_fn_c_check_type "$LINENO" "size_t" "ac_cv_type_size_t" "$ac_includes_default" 17248 if test "x$ac_cv_type_size_t" = xyes; then : 17249 17250 else 17251 17252 cat >>confdefs.h <<_ACEOF 17253 #define size_t unsigned int 17254 _ACEOF 17255 17256 fi 17257 17258 ac_fn_c_find_uintX_t "$LINENO" "16" "ac_cv_c_uint16_t" 17259 case $ac_cv_c_uint16_t in #( 17260 no|yes) ;; #( 17261 *) 17262 17263 17264 cat >>confdefs.h <<_ACEOF 17265 #define uint16_t $ac_cv_c_uint16_t 17266 _ACEOF 17267 ;; 17268 esac 17269 17270 ac_fn_c_find_uintX_t "$LINENO" "32" "ac_cv_c_uint32_t" 17271 case $ac_cv_c_uint32_t in #( 17272 no|yes) ;; #( 17273 *) 17274 17275 $as_echo "#define _UINT32_T 1" >>confdefs.h 17276 17277 17278 cat >>confdefs.h <<_ACEOF 17279 #define uint32_t $ac_cv_c_uint32_t 17280 _ACEOF 17281 ;; 17282 esac 17283 17284 ac_fn_c_find_uintX_t "$LINENO" "8" "ac_cv_c_uint8_t" 17285 case $ac_cv_c_uint8_t in #( 17286 no|yes) ;; #( 17287 *) 17288 17289 $as_echo "#define _UINT8_T 1" >>confdefs.h 17290 17291 17292 cat >>confdefs.h <<_ACEOF 17293 #define uint8_t $ac_cv_c_uint8_t 17294 _ACEOF 17295 ;; 17296 esac 17297 17298 17299 # Checks for library functions. 17300 for ac_func in memset putenv strchr strtol 17301 do : 17302 as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` 17303 ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var" 17304 if eval test \"x\$"$as_ac_var"\" = x"yes"; then : 17305 cat >>confdefs.h <<_ACEOF 17306 #define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 17307 _ACEOF 17308 17309 fi 17310 done 16728 17311 16729 17312 -
configure.ac
r53bb8f1 r9d9a451 178 178 AC_PROG_CC 179 179 AM_PROG_AS 180 AM_PROG_CC_C_O # deprecated 180 181 # These are often not installed and people miss seeing the "no", so stop the configure. 181 182 AC_PROG_YACC … … 185 186 AC_PROG_LIBTOOL 186 187 AC_PROG_INSTALL 188 AC_PROG_MAKE_SET 187 189 188 190 # Checks for libraries. … … 191 193 192 194 # Checks for header files. 193 AC_CHECK_HEADERS([libintl.h malloc.h unistd.h], [], [echo "Error: Missing required header"; exit 1]) 195 AC_FUNC_ALLOCA 196 AC_CHECK_HEADERS([fenv.h float.h inttypes.h libintl.h limits.h malloc.h stddef.h stdlib.h string.h unistd.h]) 194 197 195 198 # Checks for typedefs, structures, and compiler characteristics. 196 AC_CHECK_TYPES([_Float32], AC_DEFINE([HAVE_KEYWORDS_FLOATXX], [], [Have keywords _FloatXX.]), [], [[]]) 197 198 # Checks for compiler flags. 199 M4CFA_CHECK_COMPILE_FLAG([-Wcast-function-type], AC_DEFINE([HAVE_CAST_FUNCTION_TYPE], [], [Have compiler warning cast-function-type.])) 199 AC_HEADER_STDBOOL 200 AC_C_INLINE 201 AC_TYPE_INT16_T 202 AC_TYPE_INT32_T 203 AC_TYPE_INT8_T 204 AC_C_RESTRICT 205 AC_TYPE_SIZE_T 206 AC_TYPE_UINT16_T 207 AC_TYPE_UINT32_T 208 AC_TYPE_UINT8_T 209 210 # Checks for library functions. 211 AC_CHECK_FUNCS([memset putenv strchr strtol]) 200 212 201 213 #============================================================================== -
doc/LaTeXmacros/lstlang.sty
r53bb8f1 r9d9a451 8 8 %% Created On : Sat May 13 16:34:42 2017 9 9 %% Last Modified By : Peter A. Buhr 10 %% Last Modified On : Tue Jan 8 14:40:33 201911 %% Update Count : 2 110 %% Last Modified On : Fri Apr 6 23:44:50 2018 11 %% Update Count : 20 12 12 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 13 13 … … 114 114 _Alignas, _Alignof, __alignof, __alignof__, asm, __asm, __asm__, __attribute, __attribute__, 115 115 auto, _Bool, catch, catchResume, choose, _Complex, __complex, __complex__, __const, __const__, 116 coroutine, disable, dtype, enable, exception, __extension__, fallthrough, fallthru, finally,116 coroutine, disable, dtype, enable, __extension__, exception, fallthrough, fallthru, finally, 117 117 __float80, float80, __float128, float128, forall, ftype, _Generic, _Imaginary, __imag, __imag__, 118 118 inline, __inline, __inline__, __int128, int128, __label__, monitor, mutex, _Noreturn, one_t, or, -
doc/bibliography/pl.bib
r53bb8f1 r9d9a451 330 330 contributer = {pabuhr@plg}, 331 331 author = {Nissim Francez}, 332 title = {Another Advantage of Key word Notation for Parameter Communication with Subprograms},332 title = {Another Advantage of Key word Notation for Parameter Communication with Subprograms}, 333 333 journal = cacm, 334 334 volume = 20, … … 831 831 year = 2015, 832 832 howpublished= {\href{http://www.boost.org/doc/libs/1_61_0/libs/coroutine/doc/html/index.html} 833 {http://www.boost.org/\-doc/\-libs/1\_61\_0/\-libs/\-coroutine/\-doc/\-html/\-index.html}}, 834 } 835 836 @misc{BoostThreads, 837 keywords = {Boost Thread Library}, 838 contributer = {pabuhr@plg}, 839 author = {Anthony Williams and Vicente J. Botet Escriba}, 840 title = {Boost Thread Library}, 841 year = 2015, 842 howpublished= {\href{https://www.boost.org/doc/libs/1_61_0/doc/html/thread.html} 843 {https://\-www.boost.org/\-doc/\-libs/\-1\_61\_0/\-doc/\-html/\-thread.html}}, 833 {{http://www.boost.org/\-doc/\-libs/1\_61\_0/\-libs/\-coroutine/\-doc/\-html/\-index.html}}}, 834 optnote = {Accessed: 2016-09}, 844 835 } 845 836 … … 948 939 author = {{\textsf{C}{$\mathbf{\forall}$} Features}}, 949 940 howpublished= {\href{https://plg.uwaterloo.ca/~cforall/features}{https://\-plg.uwaterloo.ca/\-$\sim$cforall/\-features}}, 941 optnote = {Accessed: 2018-01-01}, 950 942 } 951 943 … … 967 959 year = 2018, 968 960 howpublished= {\href{https://cforall.uwaterloo.ca/CFAStackEvaluation.zip}{https://cforall.uwaterloo.ca/\-CFAStackEvaluation.zip}}, 961 optnote = {[Accessed May 2018]}, 969 962 } 970 963 … … 1141 1134 } 1142 1135 1143 @inproceedings{Tarditi18, 1144 keywords = {Checked C}, 1145 contributer = {a3moss@uwaterloo.ca}, 1146 author = {Tarditi, David and Elliott, Archibald Samuel and Ruef, Andrew and Hicks, Michael}, 1147 title = {Checked C: Making C Safe by Extension}, 1148 booktitle = {2018 IEEE Cybersecurity Development (SecDev)} 1136 @Inproceedings{Tarditi18, 1137 keywords = {Checked C}, 1138 contributer = {a3moss@uwaterloo.ca}, 1139 author = {Tarditi, David and Elliott, Archibald Samuel and Ruef, Andrew and Hicks, Michael}, 1140 title = {Checked C: Making C Safe by Extension}, 1149 1141 year = {2018}, 1150 1142 month = {September}, 1151 pages = {53-60},1152 1143 publisher = {IEEE}, 1153 1144 url = {https://www.microsoft.com/en-us/research/publication/checkedc-making-c-safe-by-extension/}, 1145 pages = {53-60}, 1154 1146 } 1155 1147 … … 1322 1314 journal = sigplan, 1323 1315 year = 1986, 1324 month = oct, 1325 volume = 21, 1326 number = 10, 1327 pages = {19-28}, 1316 month = oct, volume = 21, number = 10, pages = {19-28}, 1328 1317 note = {Object Oriented Programming Workshop} 1329 1318 } … … 1490 1479 title = {concurrent-locking}, 1491 1480 howpublished= {\href{https://github.com/pabuhr/concurrent-locking}{https://\-github.com/\-pabuhr/\-concurrent-locking}}, 1481 optnote = {[Accessed April 2017]}, 1492 1482 } 1493 1483 … … 1777 1767 howpublished= {\href{https://www.airs.com/blog/archives/428} 1778 1768 {https://www.airs.com/\-blog/\-archives/\-428}}, 1769 optnote = {Accessed: 2018-05}, 1779 1770 } 1780 1771 … … 2965 2956 year = 2014, 2966 2957 howpublished= {\href{https://gcc.gnu.org/onlinedocs/gcc-4.7.2/gcc/C-Extensions.html}{https://\-gcc.gnu.org/\-onlinedocs/\-gcc-4.7.2/\-gcc/\-C\-Extensions.html}}, 2958 optnote = {Accessed: 2017-04-02}, 2967 2959 } 2968 2960 … … 3048 3040 } 3049 3041 3050 @manual{WindowsFibers,3051 keywords = {threads, fibers},3052 contributer = {pabuhr@plg},3053 author = {Windows},3054 title = {Fibers},3055 organization= {Microsoft, Windows Development Center},3056 address = {\href{https://docs.microsoft.com/en-us/windows/desktop/ProcThread/fibers}{https://\-docs.microsoft.com/\-en-us/\-windows/\-desktop/\-ProcThread/\-fibers}},3057 year = 2018,3058 }3059 3060 3042 @inproceedings{F-bound, 3061 3043 keywords = {}, … … 3105 3087 } 3106 3088 3107 @manual{Folly,3108 keywords = {Folly},3109 contributer = {pabuhr@plg},3110 author = {Folly},3111 title = {Facebook Open-source Library},3112 organization= {Facebook},3113 address = {\href{https://github.com/facebook/folly}{https://\-github.com/\-facebook/\-folly}},3114 year = 2018,3115 }3116 3117 3089 @manual{Fortran95, 3118 3090 keywords = {Fortran 95}, … … 3135 3107 address = {\href{https://www.iso.org/standard/50459.html}{https://\-www.iso.org/\-standard/\-50459.html}}, 3136 3108 year = 2010, 3137 }3138 3139 @manual{Fortran18,3140 keywords = {ISO/IEC Fortran 10},3141 contributer = {pabuhr@plg},3142 author = {Fortran18},3143 title = {Programming Languages -- {Fortran} Part 1:Base Language ISO/IEC 1539-1:2018},3144 edition = {4rd},3145 publisher = {International Standard Organization},3146 address = {\href{https://www.iso.org/standard/72320.html}{https://\-www.iso.org/\-standard/\-72320.html}},3147 year = 2018,3148 3109 } 3149 3110 … … 3395 3356 year = 2014, 3396 3357 howpublished= {https://developer.gnome.org/gobject/stable/}, 3358 optnote = {Accessed: 2017-04}, 3397 3359 } 3398 3360 … … 3709 3671 year = {1964}, 3710 3672 publisher = {ACM} 3711 }3712 3713 @phdthesis{Barghi18,3714 keywords = {concurrency, user threads, actors},3715 contributer = {pabuhr@plg},3716 author = {Saman Barghi},3717 title = {Improving the Performance of User-level Runtime Systems for Concurrent Applications},3718 school = {School of Computer Science, University of Waterloo},3719 year = 2018,3720 month = sep,3721 optaddress = {Waterloo, Ontario, Canada, N2L 3G1},3722 note = {\href{https://uwspace.uwaterloo.ca/handle/10012/13935}{https://\-uwspace.uwaterloo.ca/\-handle/\-10012/\-13935}},3723 3673 } 3724 3674 … … 4048 3998 year = 2015, 4049 3999 edition = {{J}ava {SE} 8}, 4050 }4051 4052 @manual{Java11,4053 keywords = {Java SE 11},4054 contributer = {pabuhr@plg},4055 author = {James Gosling and Bill Joy and Guy Steele and Gilad Bracha and Alex Buckley and Daniel Smith},4056 title = {{Java} Language Specification},4057 publisher = {Oracle},4058 month = sep,4059 year = 2018,4060 edition = {{J}ava {SE} 11},4061 }4062 4063 @manual{JDK1.1,4064 keywords = {JDK 1.1},4065 contributer = {pabuhr@plg},4066 author = {{Multithreading Models}},4067 title = {JDK 1.1 for Solaris Developer's Guide},4068 publisher = {Oracle},4069 address = {\href{https://docs.oracle.com/cd/E19455-01/806-3461/6jck06gqk/index.html#ch2mt-41}{https://\-docs.oracle.com/\-cd/\-E19455-01/\-806-3461/\-6jck06gqk/\-index.html\#ch2mt-41}},4070 year = 2010,4071 4000 } 4072 4001 … … 4250 4179 } 4251 4180 4252 @manual{libmill,4253 keywords = {libmill},4254 contributer = {pabuhr@plg},4255 author = {libmill},4256 title = {{G}o-style concurrency in {C}, Version 1.18},4257 organization= {libmill},4258 address = {\href{http://libmill.org/documentation.html}{http://\-libmill.org/\-documentation.html}},4259 month = jan,4260 year = 2017,4261 }4262 4263 4181 @book{Weissman67, 4264 4182 keywords = {lisp}, … … 4306 4224 pages = {161-169}, 4307 4225 note = {Proceedings of the {SIGPLAN}~'89 Conference on Programming Language Design and Implementation} 4308 }4309 4310 @manual{Lua,4311 keywords = {Lua},4312 contributer = {pabuhr@plg},4313 author = {Lua},4314 title = {Lua 5.3 Reference Manual},4315 address = {\href{https://www.lua.org/manual/5.3}{https://\-www.lua.org/\-manual/\-5.3}},4316 year = 2018,4317 4226 } 4318 4227 … … 4657 4566 } 4658 4567 % editor = {Allen Kent and James G. Williams}, 4659 4660 @incollection{MPC,4661 keywords = {user-level threading},4662 contributer = {pabuhr@plg},4663 author = {Marc P\'erache and Herv\'e Jourdren and Raymond Namyst},4664 title = {MPC: A Unified Parallel Runtime for Clusters of {NUMA} Machines},4665 booktitle = {Euro-Par 2008},4666 pages = {329-342},4667 publisher = {Springer},4668 address = {Berlin, Heidelberg},4669 year = 2008,4670 volume = 5168,4671 series = {Lecture Notes in Computer Science},4672 }4673 4568 4674 4569 @manual{MPI, … … 5097 4992 year = 2014, 5098 4993 howpublished= {\href{https://developer.apple.com/library/archive/documentation/Cocoa/Conceptual/ProgrammingWithObjectiveC}{https://\-developer.apple.com/\-library/archive/\-documentation/\-Cocoa/\-Conceptual/\-ProgrammingWithObjectiveC}}, 4994 optnote = {Accessed: 2018-03} 5099 4995 } 5100 4996 … … 5106 5002 year = 2015, 5107 5003 howpublished= {\href{https://developer.apple.com/library/content/documentation/Xcode/Conceptual/RN-Xcode-Archive/Chapters/xc7_release_notes.html}{https://\-developer.apple.com/\-library/\-content/\-documentation/\-Xcode/\-Conceptual/\-RN-Xcode-Archive/\-Chapters/\-xc7\_release\_notes.html}}, 5004 optnote = {Accessed: 2017-04} 5108 5005 } 5109 5006 … … 5618 5515 year = 2012, 5619 5516 howpublished= {\href{http://cs.brown.edu/research/pubs/theses/masters/2012/verch.pdf}{http://cs.brown.edu/\-research/\-pubs/\-theses/\-masters/\-2012/\-verch.pdf}}, 5517 optnote = {Accessed: 2013-10-4} 5620 5518 } 5621 5519 … … 5941 5839 address = {\href{https://www.iso.org/standard/64029.html}{https://\-www.iso.org/\-standard/\-64029.html}}, 5942 5840 year = 2014, 5943 }5944 5945 @manual{C++17,5946 keywords = {ISO/IEC C++ 17},5947 contributer = {pabuhr@plg},5948 key = {C++17},5949 title = {{C}{\kern-.1em\hbox{\large\texttt{+\kern-.25em+}}} Programming Language ISO/IEC 14882:2017},5950 edition = {5th},5951 publisher = {International Standard Organization},5952 address = {\href{https://www.iso.org/standard/68564.html}{https://\-www.iso.org/\-standard/\-68564.html}},5953 year = 2017,5954 5841 } 5955 5842 … … 6105 5992 institution = {Carnegie Mellon University}, 6106 5993 year = 1991, 6107 month = feb, 6108 number = {CMU-CS-91-106}, 5994 month = feb, number = "CMU-CS-91-106", 6109 5995 annote = { 6110 5996 Discusses a typed lambda calculus with … … 6163 6049 journal = sigplan, 6164 6050 year = 1988, 6165 month = jul, 6166 volume = 23, 6167 number = 7, 6168 pages = {260-267}, 6169 note = {Proceedings of the SIGPLAN '88 Conference on Programming Language Design and Implementation}, 6051 month = jul, volume = 23, number = 7, pages = {260-267}, 6052 note = {Proceedings of the SIGPLAN '88 Conference on Programming Language 6053 Design and Implementation}, 6170 6054 abstract = { 6171 6055 This paper deals with the integration of an efficient asynchronous … … 6217 6101 } 6218 6102 6219 @misc{Pthreads,6220 keywords = {pthreads, C concurrency},6221 contributer = {pabuhr@plg},6222 key = {pthreads},6223 title = {{Pthread}.h, Specifications Issue 7, {IEEE} Std 1003.1-2017},6224 author = {IEEE and {The Open Group}},6225 year = 2018,6226 howpublished= {\href{http://pubs.opengroup.org/onlinepubs/9699919799/basedefs/pthread.h.html}6227 {http://\-pubs.opengroup.org/\-onlinepubs/\-9699919799/\-basedefs/\-pthread.h.html}},6228 }6229 6230 6103 @manual{Python, 6231 6104 keywords = {Python}, 6232 6105 contributer = {pabuhr@plg}, 6233 author = {Python},6234 title = {Python Language Reference, Release 3.7.2},6106 title = {Python Reference Manual, Release 2.5}, 6107 author = {Guido van Rossum}, 6235 6108 organization= {Python Software Foundation}, 6236 address = {\href{https://docs.python.org/3/reference/index.html}{https://\-docs.python.org/\-3/\-reference/\-index.html}}, 6237 year = 2018, 6109 month = sep, 6110 year = 2006, 6111 note = {Fred L. Drake, Jr., editor}, 6238 6112 } 6239 6113 6240 6114 % Q 6241 6242 @inproceedings{Qthreads,6243 keywords = {user-level threading},6244 author = {Kyle B. Wheeler and Richard C. Murphy and Douglas Thain},6245 title = {Qthreads: An API for Programming with Millions of Lightweight Threads},6246 booktitle = {International Symposium on Parallel and Distributed Processing},6247 organization= {IEEE},6248 address = {Miami, FL, USA},6249 month = apr,6250 year = 2008,6251 }6252 6115 6253 6116 @article{Grossman06, … … 6286 6149 } 6287 6150 6288 @manual{Quasar,6289 keywords = {Quasar},6290 contributer = {pabuhr@plg},6291 author = {Quasar},6292 title = {Quasar Documentation, Release 0.8.0},6293 organization= {Parallel Universe},6294 address = {\href{http://docs.paralleluniverse.co/quasar}{http://\-docs.paralleluniverse.co/\-quasar}},6295 year = 2018,6296 }6297 6298 6151 % R 6299 6152 … … 6409 6262 number = 10, 6410 6263 pages = {27-32}, 6411 }6412 6413 @article{Hesselink06,6414 author = {Wim H. Hesselink},6415 title = {Refinement Verification of the Lazy Caching Algorithm},6416 journal = acta,6417 year = 2006,6418 month = oct,6419 volume = 43,6420 number = 3,6421 pages = {195--222},6422 6264 } 6423 6265 … … 6558 6400 } 6559 6401 6560 @manual{Ruby,6561 keywords = {Ruby},6562 contributer = {pabuhr@plg},6563 author = {Ruby},6564 title = {Ruby Documentation, Release 2.6.0},6565 organization= {Python Software Foundation},6566 address = {\href{https://www.ruby-lang.org/en/documentation}{https://\-www.ruby-lang.org/\-en/\-documentation}},6567 year = 2018,6568 }6569 6570 6402 % S 6571 6403 … … 7358 7190 author = {{TIOBE Index}}, 7359 7191 howpublished= {\href{http://www.tiobe.com/tiobe_index}{http://\-www.tiobe.com/\-tiobe\_index}}, 7360 } 7361 7362 @misc{ThreadModel, 7363 contributer = {pabuhr@plg}, 7364 key = {ThreadModel}, 7365 title = {Thread (computing)}, 7366 author = {{Threading Model}}, 7367 howpublished= {\href{https://en.wikipedia.org/wiki/Thread_(computing)}{https://\-en.wikipedia.org/\-wiki/\-Thread\_(computing)}}, 7192 optnote = {Accessed: 2018-09}, 7368 7193 } 7369 7194 … … 7697 7522 year = 2017, 7698 7523 howpublished= {\url{https://wiki.gnome.org/Projects/Vala/Manual}}, 7524 optnote = {Accessed: 2017-04} 7699 7525 } 7700 7526 … … 7870 7696 % Y 7871 7697 7872 @article{Boehm12,7873 keywords = {memory model, race condition},7874 contributer = {pabuhr@plg},7875 author = {Boehm, Hans-J. and Adve, Sarita V.},7876 title = {You Don'T Know Jack About Shared Variables or Memory Models},7877 journal = cacm,7878 volume = 55,7879 number = 2,7880 month = feb,7881 year = 2012,7882 pages = {48--54},7883 publisher = {ACM},7884 address = {New York, NY, USA},7885 }7886 7887 7698 % Z 7888 7699 -
doc/papers/concurrency/Paper.tex
r53bb8f1 r9d9a451 228 228 } 229 229 230 \title{\texorpdfstring{ Advanced Control-flow in \protect\CFA}{Advanced Control-flowin Cforall}}230 \title{\texorpdfstring{Concurrency in \protect\CFA}{Concurrency in Cforall}} 231 231 232 232 \author[1]{Thierry Delisle} … … 241 241 242 242 \abstract[Summary]{ 243 \CFA is a modern, polymorphic, non-object-oriented, backwards-compatible extension of the C programming language. 244 This paper discusses the advanced control-flow features in \CFA, which include concurrency and parallelism, and its supporting runtime system. 245 These features are created from scratch as ISO C's concurrency is low-level and unimplemented, so C programmers continue to rely on the C pthreads library. 246 \CFA provides high-level control-flow mechanisms, like coroutines and user-level threads, and monitors for mutual exclusion and synchronization. 247 A unique contribution of this work is allowing multiple monitors to be safely acquired \emph{simultaneously} (deadlock free), while integrating this capability with all monitor synchronization mechanisms. 243 \CFA is a modern, polymorphic, \emph{non-object-oriented} extension of the C programming language. 244 This paper discusses the design of the concurrency and parallelism features in \CFA, and its concurrent runtime-system. 245 These features are created from scratch as ISO C lacks concurrency, relying largely on the pthreads library for concurrency. 246 Coroutines and lightweight (user) threads are introduced into \CFA; 247 as well, monitors are added as a high-level mechanism for mutual exclusion and synchronization. 248 A unique contribution of this work is allowing multiple monitors to be safely acquired \emph{simultaneously}. 248 249 All features respect the expectations of C programmers, while being fully integrate with the \CFA polymorphic type-system and other language features. 249 250 Experimental results show comparable performance of the new features with similar mechanisms in other concurrent programming-languages. 250 251 }% 251 252 252 \keywords{co routines, concurrency, parallelism, threads, monitors, runtime, C, \CFA (Cforall)}253 \keywords{concurrency, parallelism, coroutines, threads, monitors, runtime, C, Cforall} 253 254 254 255 … … 261 262 \section{Introduction} 262 263 263 This paper discusses the design of advanced, high-level control-flow extensions (especially concurrency and parallelism) in \CFA and its runtime.264 \CFA is a modern, polymorphic, non-object-oriented\footnote{265 \CFA has features often associated with object-oriented programming languages, such as constructors, destructors, virtuals and simple inheritance.266 However, functions \emph{cannot} be nested in structures, so there is no lexical binding between a structure and set of functions (member/method) implemented by an implicit \lstinline@this@ (receiver) parameter.},267 backwards-compatible extension of the C programming language~\cite{Moss18}.268 Within the \CFA framework, new control-flow features were created from scratch.269 ISO \Celeven defines only a subset of the \CFA extensions, and with respect to concurrency~\cite[\S~7.26]{C11}, the features are largely wrappers for a subset of the pthreads library~\cite{Butenhof97,Pthreads}.270 Furthermore, \Celeven and pthreads concurrency is basic, based on thread fork/join in a function and a few locks, which is low-level and error prone;271 no high-level language concurrency features exist.272 Interestingly, almost a decade after publication of the \Celeven standard, neither gcc-8, clang-8 nor msvc-19 (most recent versions) support the \Celeven include @threads.h@, indicating little interest in the C concurrency approach.273 Finally, while the \Celeven standard does not state a concurrent threading-model, the historical association with pthreads suggests the threading model is kernel-level threading (1:1)~\cite{ThreadModel}.274 275 In contrast, there has been a renewed interest during the past decade in user-level (M:N, green) threading in old and new programming languages.276 As multi-core hardware became available in the 1980/90s, both user and kernel threading were examined.277 Kernel threading was chosen, largely because of its simplicity and fit with the simpler operating systems and hardware architectures at the time, which gave it a performance advantage~\cite{Drepper03}.278 Libraries like pthreads were developed for C, and the Solaris operating-system switched from user (JDK 1.1~\cite{JDK1.1}) to kernel threads.279 As a result, languages like Java, Scala~\cite{Scala}, Objective-C~\cite{obj-c-book}, \CCeleven~\cite{C11}, and C\#~\cite{Csharp} adopted the 1:1 kernel-threading model, with a variety of presentation mechanisms.280 From 2000 onwards, languages like Go~\cite{Go}, Erlang~\cite{Erlang}, Haskell~\cite{Haskell}, D~\cite{D}, and \uC~\cite{uC++,uC++book} have championed the M:N user-threading model, and many user-threading libraries have appeared~\cite{Qthreads,MPC,BoostThreads}, including putting green threads back into Java~\cite{Quasar}.281 The main argument for user-level threading is that they are lighter weight than kernel threads (locking and context switching do not cross the kernel boundary), so there is less restriction on programming styles that encourage large numbers of threads performing smaller work-units to facilitate load balancing by the runtime~\cite{Verch12}.282 As well, user-threading facilitates a simpler concurrency approach using thread objects that leverage sequential patterns versus events with call-backs~\cite{vonBehren03}.283 Finally, performant user-threading implementations (both time and space) are largely competitive with direct kernel-threading implementations, while achieving the programming advantages of high concurrency levels and safety.284 285 A further effort over the past decade is the development of language memory-models to deal with the conflict between certain language features and compiler/hardware optimizations.286 This issue can be rephrased as some features are pervasive (language and runtime) and cannot be safely added via a library to prevent invalidation by sequential optimizations~\cite{Buhr95a,Boehm05}.287 The consequence is that a language must be cognizant of these features and provide sufficient tools to program around any safety issues.288 For example, C created the @volatile@ qualifier to provide correct execution for @setjmp@/@logjmp@ (concurrency came later).289 The simplest solution is to provide a handful of complex qualifiers and functions (e.g., @volatile@ and atomics) allowing programmers to write consistent/race-free programs, often in the sequentially-consistent memory-model~\cite{Boehm12}.290 291 While having a sufficient memory-model allows sound libraries to be constructed, writing these libraries can quickly become awkward and error prone, and using these low-level libraries has the same issues.292 Essentially, using low-level explicit locks is the concurrent equivalent of assembler programming.293 Just as most assembler programming is replaced with programming in a high-level language, explicit locks can be replaced with high-level concurrency constructs in a programming language.294 The goal is to get the compiler to check for correct usage and follow any complex coding conventions implicitly.295 The drawback is that language constructs may preclude certain specialized techniques, therefore introducing inefficiency or inhibiting concurrency.296 For most concurrent programs, these drawbacks are insignificant in comparison to the speed of composition, and subsequent reliability and maintainability of the high-level concurrent program.297 (The same is true for high-level programming versus assembler programming.)298 Only very rarely should it be necessary to drop down to races and/or explicit locks to apply a specialized technique to achieve maximum speed or concurrency.299 As stated, this observation applies to non-concurrent forms of complex control-flow, like exception handling and coroutines.300 301 Adapting the programming language allows matching the control-flow model with the programming-language style, versus adapting to one general (sound) library/paradigm.302 For example, it is possible to provide exceptions, coroutines, monitors, and tasks as specialized types in an object-oriented language, integrating these constructs to allow leveraging the type-system (static type-checking) and all other object-oriented capabilities~\cite{uC++}.303 It is also possible to leverage call/return for blocking communication via new control structures, versus switching to alternative communication paradigms, like channels or message passing.304 As well, user threading is often a complementary feature, allowing light-weight threading to match with low-cost objects, while hiding the application/kernel boundary.305 User threading also allows layering of implicit concurrency models (no explicit thread creation), such executors, data-flow, actors, into a single language, so programmers can chose the model that best fits an algorithm.\footnote{306 All implicit concurrency models have explicit threading in their implementation, and hence, can be build from explicit threading;307 however, the reverse is seldom true, i.e., given implicit concurrency, e.g., actors, it is virtually impossible to create explicit concurrency, e.g., blocking thread objects.}308 Finally, with extended language features and user-level threading it is possible to discretely fold locking and non-blocking I/O multiplexing into the language's I/O libraries, so threading implicitly dovetails with the I/O subsystem.309 310 \CFA embraces language extensions and user-level threading to provide advanced control-flow and concurrency.311 We attempt to show the \CFA extensions and runtime are demonstrably better than those proposed for \CC and other concurrent, imperative programming languages.312 The contributions of this work are:313 \begin{itemize}314 \item315 allowing multiple monitors to be safely acquired \emph{simultaneously} (deadlock free), while seamlessly integrating this capability with all monitor synchronization mechanisms.316 \item317 all control-flow features respect the expectations of C programmers, with statically type-safe interfaces that integrate with the \CFA polymorphic type-system and other language features.318 \item319 experimental results show comparable performance of the new features with similar mechanisms in other concurrent programming-languages.320 \end{itemize}321 322 \begin{comment}323 264 This paper provides a minimal concurrency \newterm{Application Program Interface} (API) that is simple, efficient and can be used to build other concurrency features. 324 265 While the simplest concurrency system is a thread and a lock, this low-level approach is hard to master. … … 340 281 The proposed concurrency API is implemented in a dialect of C, called \CFA (pronounced C-for-all). 341 282 The paper discusses how the language features are added to the \CFA translator with respect to parsing, semantics, and type checking, and the corresponding high-performance runtime-library to implement the concurrent features. 342 \end{comment} 343 344 345 \begin{comment} 283 284 346 285 \section{\CFA Overview} 347 286 … … 612 551 \end{cfa} 613 552 where the return type supplies the type/size of the allocation, which is impossible in most type systems. 614 \end{comment} 615 616 617 \section{Coroutines: A Stepping Stone}\label{coroutine} 618 619 Advanced controlWhile the focus of this discussion is concurrency and parallelism, it is important to address coroutines, which are a significant building block of a concurrency system (but not concurrent among themselves). 553 554 555 \section{Concurrency} 556 \label{s:Concurrency} 557 558 At its core, concurrency is based on multiple call-stacks and scheduling threads executing on these stacks. 559 Multiple call stacks (or contexts) and a single thread of execution, called \newterm{coroutining}~\cite{Conway63,Marlin80}, does \emph{not} imply concurrency~\cite[\S~2]{Buhr05a}. 560 In coroutining, the single thread is self-scheduling across the stacks, so execution is deterministic, \ie the execution path from input to output is fixed and predictable. 561 A \newterm{stackless} coroutine executes on the caller's stack~\cite{Python} but this approach is restrictive, \eg preventing modularization and supporting only iterator/generator-style programming; 562 a \newterm{stackful} coroutine executes on its own stack, allowing full generality. 563 Only stackful coroutines are a stepping stone to concurrency. 564 565 The transition to concurrency, even for execution with a single thread and multiple stacks, occurs when coroutines also context switch to a \newterm{scheduling oracle}, introducing non-determinism from the coroutine perspective~\cite[\S~3]{Buhr05a}. 566 Therefore, a minimal concurrency system is possible using coroutines (see Section \ref{coroutine}) in conjunction with a scheduler to decide where to context switch next. 567 The resulting execution system now follows a cooperative threading-model, called \newterm{non-preemptive scheduling}. 568 569 Because the scheduler is special, it can either be a stackless or stackful coroutine. 570 For stackless, the scheduler performs scheduling on the stack of the current coroutine and switches directly to the next coroutine, so there is one context switch. 571 For stackful, the current coroutine switches to the scheduler, which performs scheduling, and it then switches to the next coroutine, so there are two context switches. 572 A stackful scheduler is often used for simplicity and security. 573 574 Regardless of the approach used, a subset of concurrency related challenges start to appear. 575 For the complete set of concurrency challenges to occur, the missing feature is \newterm{preemption}, where context switching occurs randomly between any two instructions, often based on a timer interrupt, called \newterm{preemptive scheduling}. 576 While a scheduler introduces uncertainty in the order of execution, preemption introduces uncertainty about where context switches occur. 577 Interestingly, uncertainty is necessary for the runtime (operating) system to give the illusion of parallelism on a single processor and increase performance on multiple processors. 578 The reason is that only the runtime has complete knowledge about resources and how to best utilized them. 579 However, the introduction of unrestricted non-determinism results in the need for \newterm{mutual exclusion} and \newterm{synchronization} to restrict non-determinism for correctness; 580 otherwise, it is impossible to write meaningful programs. 581 Optimal performance in concurrent applications is often obtained by having as much non-determinism as correctness allows. 582 583 An important missing feature in C is threading\footnote{While the C11 standard defines a \protect\lstinline@threads.h@ header, it is minimal and defined as optional. 584 As such, library support for threading is far from widespread. 585 At the time of writing the paper, neither \protect\lstinline@gcc@ nor \protect\lstinline@clang@ support \protect\lstinline@threads.h@ in their standard libraries.}. 586 In modern programming languages, a lack of threading is unacceptable~\cite{Sutter05, Sutter05b}, and therefore existing and new programming languages must have tools for writing efficient concurrent programs to take advantage of parallelism. 587 As an extension of C, \CFA needs to express these concepts in a way that is as natural as possible to programmers familiar with imperative languages. 588 Furthermore, because C is a system-level language, programmers expect to choose precisely which features they need and which cost they are willing to pay. 589 Hence, concurrent programs should be written using high-level mechanisms, and only step down to lower-level mechanisms when performance bottlenecks are encountered. 590 591 592 \subsection{Coroutines: A Stepping Stone}\label{coroutine} 593 594 While the focus of this discussion is concurrency and parallelism, it is important to address coroutines, which are a significant building block of a concurrency system (but not concurrent among themselves). 620 595 Coroutines are generalized routines allowing execution to be temporarily suspended and later resumed. 621 596 Hence, unlike a normal routine, a coroutine may not terminate when it returns to its caller, allowing it to be restarted with the values and execution location present at the point of suspension. … … 1085 1060 \end{cquote} 1086 1061 The combination of these two approaches allows an easy and concise specification to coroutining (and concurrency) for normal users, while more advanced users have tighter control on memory layout and initialization. 1087 1088 1089 \section{Concurrency}1090 \label{s:Concurrency}1091 1092 At its core, concurrency is based on multiple call-stacks and scheduling threads executing on these stacks.1093 Multiple call stacks (or contexts) and a single thread of execution, called \newterm{coroutining}~\cite{Conway63,Marlin80}, does \emph{not} imply concurrency~\cite[\S~2]{Buhr05a}.1094 In coroutining, the single thread is self-scheduling across the stacks, so execution is deterministic, \ie the execution path from input to output is fixed and predictable.1095 A \newterm{stackless} coroutine executes on the caller's stack~\cite{Python} but this approach is restrictive, \eg preventing modularization and supporting only iterator/generator-style programming;1096 a \newterm{stackful} coroutine executes on its own stack, allowing full generality.1097 Only stackful coroutines are a stepping stone to concurrency.1098 1099 The transition to concurrency, even for execution with a single thread and multiple stacks, occurs when coroutines also context switch to a \newterm{scheduling oracle}, introducing non-determinism from the coroutine perspective~\cite[\S~3]{Buhr05a}.1100 Therefore, a minimal concurrency system is possible using coroutines (see Section \ref{coroutine}) in conjunction with a scheduler to decide where to context switch next.1101 The resulting execution system now follows a cooperative threading-model, called \newterm{non-preemptive scheduling}.1102 1103 Because the scheduler is special, it can either be a stackless or stackful coroutine.1104 For stackless, the scheduler performs scheduling on the stack of the current coroutine and switches directly to the next coroutine, so there is one context switch.1105 For stackful, the current coroutine switches to the scheduler, which performs scheduling, and it then switches to the next coroutine, so there are two context switches.1106 A stackful scheduler is often used for simplicity and security.1107 1108 Regardless of the approach used, a subset of concurrency related challenges start to appear.1109 For the complete set of concurrency challenges to occur, the missing feature is \newterm{preemption}, where context switching occurs randomly between any two instructions, often based on a timer interrupt, called \newterm{preemptive scheduling}.1110 While a scheduler introduces uncertainty in the order of execution, preemption introduces uncertainty about where context switches occur.1111 Interestingly, uncertainty is necessary for the runtime (operating) system to give the illusion of parallelism on a single processor and increase performance on multiple processors.1112 The reason is that only the runtime has complete knowledge about resources and how to best utilized them.1113 However, the introduction of unrestricted non-determinism results in the need for \newterm{mutual exclusion} and \newterm{synchronization} to restrict non-determinism for correctness;1114 otherwise, it is impossible to write meaningful programs.1115 Optimal performance in concurrent applications is often obtained by having as much non-determinism as correctness allows.1116 1117 An important missing feature in C is threading\footnote{While the C11 standard defines a \protect\lstinline@threads.h@ header, it is minimal and defined as optional.1118 As such, library support for threading is far from widespread.1119 At the time of writing the paper, neither \protect\lstinline@gcc@ nor \protect\lstinline@clang@ support \protect\lstinline@threads.h@ in their standard libraries.}.1120 In modern programming languages, a lack of threading is unacceptable~\cite{Sutter05, Sutter05b}, and therefore existing and new programming languages must have tools for writing efficient concurrent programs to take advantage of parallelism.1121 As an extension of C, \CFA needs to express these concepts in a way that is as natural as possible to programmers familiar with imperative languages.1122 Furthermore, because C is a system-level language, programmers expect to choose precisely which features they need and which cost they are willing to pay.1123 Hence, concurrent programs should be written using high-level mechanisms, and only step down to lower-level mechanisms when performance bottlenecks are encountered.1124 1062 1125 1063 -
doc/papers/concurrency/mail
r53bb8f1 r9d9a451 27 27 28 28 Software: Practice and Experience Editorial Office 29 30 31 32 Date: Wed, 3 Oct 2018 21:25:28 +000033 From: Richard Jones <onbehalfof@manuscriptcentral.com>34 Reply-To: R.E.Jones@kent.ac.uk35 To: tdelisle@uwaterloo.ca, pabuhr@uwaterloo.ca36 Subject: Software: Practice and Experience - Decision on Manuscript ID37 SPE-18-020538 39 03-Oct-201840 41 Dear Dr Buhr,42 43 Many thanks for submitting SPE-18-0205 entitled "Concurrency in C∀" to Software: Practice and Experience.44 45 In view of the comments of the referees found at the bottom of this letter, I cannot accept your paper for publication in Software: Practice and Experience. I hope that you find the referees' very detailed comments helpful.46 47 Thank you for considering Software: Practice and Experience for the publication of your research. I hope the outcome of this specific submission will not discourage you from submitting future manuscripts.48 49 Yours sincerely,50 51 52 Prof. Richard Jones53 Editor, Software: Practice and Experience54 R.E.Jones@kent.ac.uk55 56 Referee(s)' Comments to Author:57 58 Reviewing: 159 60 Comments to the Author61 "Concurrency in Cforall" presents a design and implementation of a set of standard concurrency features, including coroutines, user-space and kernel-space threads, mutexes, monitors, and a scheduler, for a polymorphic derivation of C called Cforall.62 63 Section 2 is an overview of sequential Cforall that does not materially contribute to the paper. A brief syntax explanation where necessary in examples would be plenty.64 65 Section 3 begins with with an extensive discussion of concurrency that also does not materially contribute to the paper. A brief mention of whether a particular approach implements cooperative or preemptive scheduling would be sufficient. Section 3 also makes some unfortunate claims, such as C not having threads -- C does in fact define threads, and this is noted as being true in a footnote, immediately after claiming that it does not. The question remains why the C11 parallelism design is insufficient and in what way this paper proposes to augment it. While I am personally a proponent of parallel programming languages, backing the assertion that all modern languages must have threading with citations from 2005 ignores the massive popularity of modern non-parallel languages (Javascript, node.js, Typescript, Python, Ruby, etc.) and parallel languages that are not thread based, although the authors are clearly aware of such approaches.66 67 Sections 3.1 and 3.2 dicusses assymetric and symmetric coroutines. This also does not seem to materially contribute to a paper that is ostensibly about concurrency in a modern systems programming language. The area of coroutines, continuations, and generators is already well explored in the context of systems languages, including compilation techniques for these constructs that are more advanced than the stack instantiation model discussed in the paper.68 69 Section 3.3 describes threads in Cforall, briefly touching on user-space vs. kernel-space thread implementations without detailing the extensive practical differences. It is unclear how the described interface differes from C++11 threads, as the description seems to center on an RAII style approach to joining in the destructor.70 71 Section 4 briefly touches on a collection of well known synchronisation primitives. Again, this discussion does not materially contribute to the paper.72 73 Section 5 describes monitors, which are a well known and well researched technique. The Cforall implementation is unsurprising. The "multi-acquire semantics" described are not a contribution of this paper, as establishing a stable order for lock acquisition is a well known technique, one example of which is the C++ std::scoped_lock.74 75 Section 6 is a discussion of scheduling that does not appear to be informed by the literature. There is no discussion of work-stealing vs. work-scheduling, static vs. dynamic priorities, priority inversion, or fairness. There is a claim in secion 6.1 for a novel technique, partial signalling, that appears to be a form of dynamic priority, but no comparison is made. In section 6.6, a very brief mention of other synchronisation techniques is made, without reference to current techniques such as array-based locks, CLH or MCS queue locks, RCU and other epoch-based mechanisms, etc. Perhaps these are considered out of scope.76 77 Section 7 discusses parallelism, but does not materially contribute to the paper. It is claimed that preemption is necessary to implement spinning, which is not correct, since two cores can implement a spinning based approach without preemption. It is claimed that with thread pools "concurrency errors return", but no approach to removing concurrency errors with either preemptive or cooperatively scheduled user threads has been proposed in the paper that would not also apply to thread pools.78 79 Section 8 is intended to describe the Cforall runtime structure, but does so in a way that uses terminology in an unfamiliar way. The word cluster is more usually used in distributed systems, but here refers to a process. The term virtual processor is more usually used in hardware virtualisation, but here refers to a kernel thread. The term debug kernel is more usually used in operating systems to refer to kernels that have both debug info and a method for using a debugger in kernel space, but here refers to a debug build of a user-space process. This section does not materially contribute to the paper.80 81 Section 9 is intended to describe the Cforall runtime implementation. It makes some unusual claims, such as C libraries migrating to stack chaining (stack chaining was an experimental GCC feature that has been abandoned, much as it has been abandoned in both Go and Rust).82 83 The performance measurements in section 10 are difficult to evaluate. While I appreciate that comparable concurrency benchmarks are very difficult to write, and the corpus of existing benchmarks primarily boils down to the parallel programs in the Computer Language Benchmark Game, the lack of detail as to what is being measured in these benchmarks (particularly when implemented in other languages) is unfortunate. For example, in table 3, the benchmark appears to measure uncontended lock access, which is not a useful micro-benchmark.84 85 It is not clear what the contributions of this paper are intended to be. A concise listing of the intended contributions would be helpful. Currently, it appears that the paper makes neither PL contributions in terms of novel features in Cforall, nor does it make systems contributions in terms of novel features in the runtime.86 87 88 Reviewing: 289 90 Comments to the Author91 This article presents the design and rationale behind the concurrency92 features of C-forall, a new low-level programming language. After an93 introduction that defines a selection of standard terminology, section94 2 gives crucial background on the design of the C-forall language.95 Section 3 then starts the core of the article, discussing the96 language's support for "concurrency" which in this case means97 coroutines and threads; a very brief Section 4 builds on section 398 with a discussion of lower level synchronizations. Section 5 the99 presents the main features of concurrency control in C-forall:100 monitors and mutexes. Section 6 then extends monitors with condition101 variables to to support scheduling, and a very brief section 7102 discusses preemption and pooling. Section 8 discusses the runtime103 conceptual model, section 9 gives implementation detail, and section104 10 briefly evaluates C-forall's performance via five concurrent105 micro benchmarks. Finally section 11 concludes the article, and then106 section 12 presents some future work.107 108 109 At the start of section 7, article lays out its rationale: that while110 "historically, computer performance was about processor speeds" but111 "Now, high-performance applications must care about parallelism,112 which requires concurrency". The doomsayers trumpeting the death of113 Moore's law have been proved correct at last, with CPUs sequential114 performance increasing much more slowly than the number of cores115 within each die. This means programmers --- especially low-level,116 systems programmers --- must somehow manage the essential complexity117 of writing concurrent programs to run in parallel in multiple threads118 across multiple cores. Unfortunately, the most venerable widely used119 systems programming language, C, supports parallelism only via an120 e.g. the threads library. This article aims to integrate concurrent121 programming mechanisms more closely into a novel low-level C-based122 programming language, C-forall. The article gives an outline of much of123 C-forall, presents a series of concurrency mechanisms, and finally124 some microbenchmark results. The article is detailed, comprehensive,125 and generally well written in understandable English.126 127 My main concern about the article are indicated by the fact that the128 best summary of the problem the design of concurrent C-forall sets129 out to solve is buried more than halfway through the article in section130 7, as above, and then the best overview of the proposed solution is131 given in the 2nd, 4th and 5th sentence of the conclusion:132 133 "The approach provides concurrency based on a preemptive M:N134 user-level threading-system, executing in clusters, which135 encapsulate scheduling of work on multiple kernel threads136 providing parallelism... High-level objects (monitor/task) are the137 core mechanism for mutual exclusion and synchronization. A novel138 aspect is allowing multiple mutex-objects to be accessed139 simultaneously reducing the potential for deadlock for this140 complex scenario."141 142 That is, in my reading of the article, it proceeds bottom up rather143 than top down, and so my main recommendation is to essentially reverse144 the order of the article, proceeding from the problem to be solved,145 the high level architecture of the proposed solutions, and then going146 down to the low-level mechanisms. My biggest problem reading the147 article was for explanations of why a particular decision was taken,148 or why a particular mechanism may be used --- often this description149 is actually later in the article, but at that point it's too late for150 the reader. I have tried to point out most of these places in the151 detailed comments below.152 153 My second concern is that the article makes several claims that are154 not really justified by the design or implementation in the article.155 These include claims that this approach meets the expectations of C156 programmers, is minimal, is implemented in itself, etc. The article157 doesn't generally offer evidence to support these assertions (for many158 of them, that would require empirical studies of programmers, or at159 least corpus studies). The solution here is to talk about motivations160 for the design choices "we made these decisions hoping that C161 programmers would be comfortable" rather than claims of fact "C162 programmers are comfortable". Again I attempt to point these out below.163 164 * abstract: needs to characterize the work top down, and not make165 claims "features respect the expectations of C programmers" that166 are not supported empirically.167 168 * p1 line 14 "integrated"169 170 * introduction needs to introduce the big ideas and scope of the171 article, not define terms. Some of the terms / distinctions are172 non-standard (e.g. the distinction between "concurrency" and173 "parallelism") and can be avoided by using more specific terms174 (mutual exclusion, synchronization, parallel execution. etc).175 176 * to me this article introduces novel language features, not just an177 API. Similarly, it doesn't talk about any additions "to the178 language translator" - i.e compiler changes! - rather about language179 features.180 181 182 * section 2 lines 6-9 why buy this fight against object-orientation?183 this article doesn't need to make this argument, but needs to do a184 better job of it if it does (see other comments below)185 186 * sec 2.1 - are these the same as C++. IF so, say so, if not, say why187 not.188 189 * 2.2 calling it a "with statement" was confusing, given that a with190 clause can appear in a routine declaration with a shorthand syntax.191 192 * 2.3 again compare with C++ and Java (as well as Ada)193 194 * line 9 "as we will see in section 3"195 196 * 2.4 I really quite like this syntax for operators, destructors not197 so much.198 199 * 2.5 and many places elsewhere. Always first describe the semantics200 of your language constructs, then describe their properties, then201 compare with e.g. related languages (mostly C++ & Java?). E.g in202 this case, something like:203 204 "C-forall includes constructors, which are called to initialize205 newly allocated objects, and constructors, which are called when206 objects are deallocated. Constructors and destructors are written as207 functions returning void, under the special names "?{}" for208 constructors and "^{}" for destructors: constructors may be209 overridden, but destructors may not be. The semantics of C-forall's210 constructors and destructors are essentially those of C++."211 212 this problem repeats many times throughout the article and should be213 fixed everywhere.214 215 216 * 2.6 again, first describe then properties then comparison.217 in this case, compare e.g. with C++ templates, Java/Ada generics218 etc.219 220 * why special case forward declarations? It's not 1970 any more.221 222 * what are traits? structural interfaces (like Go interfaces) or223 nominal bindings?224 225 * section 3 - lines 2-30, also making very specific global definitions226 as in the introduction. The article does not need to take on this227 fight either, rather make clear that this is the conceptual model in228 C-forall. (If the article starts at the top and works down, that may229 well follow anyway).230 231 * "in modern programming languages... unacceptable"; "in a232 system-level language.. concurrent programs should be written with233 high-level features" - again, no need to take on these fights.234 235 * 3.1 onwards; I found all this "building" up hard to follow.236 also it's not clear a "minimal" API must separately support237 coroutines, threads, fibres, etc238 239 * FIG 2B - where's the output?240 syntax "sout | next(f1) | next(f2) | endl" nowhere explained241 why not use C++s' << and >>242 243 * FIG 3 be clearer, earlier about the coroutine" constructor syntax244 245 ** ensure all figures are placed *after* their first mention in the246 text. consider interleaving smaller snippets of text rather than247 just referring to large figures248 249 * sec 3.1 p7 etc,. need more context / comparison e.g. Python250 generators etc.251 252 * FIGURE 4 is this right? should there a constructor for Cons taking253 a Prod?254 255 256 * sec 3.2 order of constructors depends on the language. more257 generally, if the article is going to make arguments against OO258 (e.g. section 2) then the article needs to explain, in detail, why259 e.g. coroutine, thread, etc *cannot* be classes / objects.260 261 * "type coroutine_t must be an abstract handle.. descriptor and is262 stack are non-copyable" - too many assumptions in here (and other263 similar passages) that are not really spelled out in detail.264 265 * p10 line 4 introduces "coroutine" keyword. needs to give its266 semantics. also needs to introduce and define properties and compare267 before all the examples using coroutines.268 269 * p10 again, trait semantics need to be better defined270 271 * 3.3 should be an introduction to this section. Note that section272 titles are not part of the text of the article.273 274 * what's the difference between "coroutines" and "user threads" (and275 "fibres?")276 277 * what's a "task type" or an "interface routine" or "underlying278 thread"279 280 * section 4 - "... meaningless". nope some semantics are possible281 e.g. if there's a memory model.282 283 * whatare "call/return based languages"284 285 * p12 - what if a programmer wants to join e.g. "1st of N" or "1st 3 of N"286 threads rather than all threads in order287 288 * 4.1 p12 13-25, again it's not clear where this is going. presenting the model289 top down may hopefully resolve this290 291 * section 4 should be merged e.g. into sec 3 (or 5)292 293 294 295 * section 5 p13 what's "routine" scope. "call/return paradigm"296 297 * thread/ coroutine declarations, traits etc, all look pretty close to298 inheritance. why wouldn't inheritance work?299 300 * open/closed locks = free/acquired free locks?301 302 * testability?303 304 * p14 lines 14-20 I had trouble following this. e.g/. what's the305 difference between "a type that is a monitor" and "a type that looks306 like a monitor"? why?307 308 * line 39 - what's an "object-oriented monitor"? Java?309 there is no one OO model of such things.310 311 * line 47 significant asset - how do you know?312 313 * how could this e.g. build a reader/writer lock314 315 * *p15 what's the "bank account transfer problem"316 317 *p16 lines6-10 why? explain?318 319 *p17 semantics of arrays of conditions is unclear320 given e.g. previous comments about arrays of mutexes.321 322 *p18 define "spurious wakeup"323 324 *p18 line 44 - "a number of approaches were examined"? which325 approaches? examined by whom? if this is a novel contribution, needs326 rather more there, and more comparison with related work327 328 * FIG 8 consider e.g. sequence diagrams rather than code to show these329 cases330 331 * 6.2 p19 line 5 "similarly, monitor routines can be added at any332 time" really? I thought C-forall was compiled? there's a big333 difference between "static" and "dynamic" inheritance. which is this334 closer to?335 336 * line 25 "FIgure 9 (B) shows the monitor implementation"337 I didn't understand this, especially not as an implementation.338 339 * section 6.6 - if the article is to make claims about completeness,340 about supporting low and high level operations, then this must be341 expanded to give enough detail to support that argument342 343 * "truest realization" huh?344 345 * section 7 should be merged into 6 or 8.346 it's not clear if this is exploring rejected alternatives,347 out outlining different features offered by C-forall, or what.348 349 350 * sec 7.2 how do the other threads in sections 5 & 6 relate to the351 user threads, fibres, etc here;352 353 * sec 8.1 I found these sections hard to follow. how is a cluster a354 "collection of threads and virtual processors... like a virtual355 machine"? Where do the thread pools from 7.3 fit in?356 357 * sec 8.3 is out of place, probably unneeded in the paper358 359 * section 9 dives straight into details with no overview. Section 9360 seems very detailed, and depends on assumptions or details that are361 not in the article.362 363 * section 10 covers only microbenchmarks. are there any moderate sized364 macrobenchmarks that can compare across the different systems?365 (e.g the Erlang Ring?)366 367 * sec 11 claims that "the entire C-forall runtime system are written368 in C-forall". The article doesn't369 370 371 * future work should precede conclusion, not follow it372 373 * the article should have a related work section (2-3 pages) comparing374 the design overall with various competing designs (C++, Java, go,375 Rust,...)376 377 To encourage accountability, I'm signing my reviews in 2018. For the record, I am James Noble, kjx@ecs.vuw.ac.nz.378 379 Reviewing: 3380 381 Comments to the Author382 This paper describes the design and implementation of coroutine- and thread-based concurrency in the C-for-all (I will write "C\/") system, a considerably extended form of the C language with many concurrency features.383 384 It first provides an overview of the non-concurrency-related aspects of the host language (references, operator overloading, generics, etc.), then addresses several technical issues around concurrency, including the multi-monitor design, bulk acquiring of locks (including deadlock-avoiding management of acquisition order), solutions to difficult scheduling problems around these, and implementation of monitors in the presence of separate compilation. It also presents empirical data showing the execution times of several microbenchmarks in comparison with other threaded concurrency systems, in support of the claim that the implementation is competitive with them.385 386 Overall the impression I gained is that this is a substantial system into which have gone much thought and effort.387 388 However, the present paper is not written so as to communicate sufficiently clearly the novel practices or experiences that emerged from that effort. This manifests itself in several ways.389 390 The system is described in general, rather than with a focus on novel insights or experiences. It was not until page 18 that I found a statement that hinted at a possible core contribution: "Supporting barging prevention as well as extending internal scheduling to multiple monitors is the main source of complexity in design and implementation of C\/ concurrency." Even then, it is unclear whether such challenges have already been surmounted in prior systems, or what other challenges the paper may also be covering. The most complete list of claims appears to be in the Conclusion (section 11; oddly not the last section), although not everything listed is a novel feature of the work (e.g. N:M threading models are an old idea). This presentation needs to be completely inverted, to focus from the outset on the claimed novel/noteworthy experiences that the work embodies.391 392 The text describing the system's motivation is unconvincing on one point: the claim that library support for threading in C is "far from widespread" (p5, footnote A). The pthreads library API is standardised, albeit not in the C language specification but rather in POSIX -- a widespread standard indeed. (With systems languages, even if the language does not define a feature, it of course does not follow that that feature is not available -- since such languages permit extension of their own runtime and/or toolchain.) Of course, the combination of C and pthreads does not provide close to the full complement of C\/-supported features, so it is easy to make a case for C\/'s targeted "gap in the market". But again, a presentation focused on novel aspects would bring this out and enable the reader to learn from the authors' efforts much more readily.393 394 Certain sections of the text read like a tutorial on concurrency... which is potentially valuable, but does not seem to belong here. For example, much effort is spent introducing the notions of "synchronization" and "mutual exclusion", including the whole of Section 4.2. Presently it is unclear how this content supports the findings/experiences that the paper is detailing.395 396 Similarly, section 8 reads mostly as a basic introduction to user versus kernel threading implementations (including hybrid models such as N:M scheduling), and appears superfluous to this paper. Mixed into this are details of C\/'s specific approach. These could instead be stated directly, with references to handle the unlikely case where the reader is unfamiliar.397 398 I also found the definitions of certain terms through the paper a bit non-standard, for unclear reasons. For example, why "condition lock" rather than the standard "condition variable" (if indeed that is what is intended)? To say that "synchronisation" is about "timing" strikes me as potentially confusing, since in truth synchronisation concerns only relative timing, i.e. ordering. (Even ordering is something of a derived concept -- since of course, most commonly, control over ordering is built atop synchronisation primitives, rather than being provided directly by them.)399 400 The empirical data presented is a reasonable start at characterising the implementation's performance. However, it currently suffers certain flaws.401 402 Firstly, it is not clear what is being claimed. The data cannot really be said to "verify the implementation" (section 10). Presumably the claim is that the system is competitive with other systems offering reasonably high-level concurrency constructs (Java monitors, Go channels, etc.) and/or on low-level facilities (mutexes, coroutines). A claim of this form, emphasising the latter, does eventually appear in the Conclusion, but it needs to be made explicitly during the presentation of the experiments. Shifting the focus towards higher-level features may be a better target, since this appears to be C\/'s main advance over pthreads and similar libraries.403 404 It appears some additional or alternative competitor systems might be a better match. For example, many green-thread or N:M libraries for C exist (libdill/libmill, Marcel, even GNU Pth). It would be instructive to compare with these.405 406 It would help greatly if the "functionally identical" benchmark code that was run on the competing systems were made available somewhere. Omitting it from the main text of the paper is understandable, since it would take too much space, but its details may still have a critical bearing on the results.407 408 In some cases it simply wasn't clear what is being compared. In Table 3, what are "FetchAdd + FetchSub"? I'm guessing this is some open-coded mutex using C++ atomics, but (unless I'm missing something) I cannot see an explanation in the text.409 410 The reports of variance (or, rather, standard deviation) are not always plausible. Is there really no observable variation in three of Table 3's cases? At the least, I would appreciate more detail on the measures taken to reduce run-time variance (e.g. disabling CPU throttling perhaps?).411 412 The text habitually asserts the benefits of C\/'s design without convincing argument. For example, in 2.1, do C\/'s references really reduce "syntactic noise"? I am sympathetic to the problem here, because many design trade-offs simply cannot be evaluated without very large-scale or long-term studies. However, the authors could easily refrain from extrapolating to a grand claim that cannot be substantiated. For example, instead of saying C\/ is "expressive" or "flexible" or "natural", or (say) that fork/join concurrency is "awkward and unnecessary" (p11), it would be preferable simply to give examples of the cases are captured well in the C\/ design (ideally together with any less favourable examples that illustrate the design trade-off in question) and let them speak for themselves.413 414 One thing I found confusing in the presentation of coroutines is that it elides the distinction between "coroutines" (i.e. their definitions) and activations thereof. It would be helpful to make this clearer, since at present this makes some claims/statements hard to understand. For example, much of 3.2 talks about "adding fields", which implies that a coroutine's activation state exists as fields in a structured object -- as, indeed, it does in C\/. This is non-obvious because in a more classical presentation of coroutines, their state would live not in "fields" but in local variables. Similarly, the text also talks about composition of "coroutines" as fields within other "coroutines", and so on, whereas if I understand correctly, these are also activations. (By later on in the text, the "C\/ style" of such constructs is clear, but not at first.)415 416 I was expecting a reference to Adya et al's 2002 Usenix ATC paper, on the topic of "fibers" and cooperative threading generally but also for its illustrative examples of stack ripping (maybe around "linearized code is the bane of device drivers", p7, which seems to be making a similar observation).417 418 Minor comments:419 420 The writing is rather patchy. It has many typos, and also some cases of "not meaning what is said", unclear allusions, etc.. The following is a non-exhaustive list.421 422 - p2 line 7: "C has a notion of objects" -- true, but this is not intended as "object" in anything like the same sense as "object-oriented", so raising it here is somewhere between confusing and meaningless.423 424 - lots of extraneous hyphenation e.g "inheritance-relationships", "critical-section", "mutual-exclusion", "shared-state" (as a general rule, only hyphenate noun phrases when making an adjective out of them)425 426 - p4 "impossible in most type systems" -- this is not a property of the "type system" as usually understood, merely the wider language design427 428 - p17: "release all acquired mutex types in the parameter list" should just say "release all acquired mutexes that are designated in the parameter list" (it is not "types" that are being released or acquired);429 430 - p19: "a class includes an exhaustive list of operations" -- except it is definitively *not* exhaustive, for the reasons given immediately afterwards. I do see the problem here, about separate compilation meaning that the space of functions using a particular type is not bounded at compile time, but that needs to be identified clearly as the problem. (Incidentally, one idea is that perhaps this mapping onto a dense space could be solved at link- or load-time, in preference to run-time indirection.)431 432 - p22: in 6.5, the significance of this design decision ("threads... are monitors") was still not clear to me.433 434 - p22: [user threads are] "the truest realization of concurrency" sounds like unnecessary editorializing (many systems can exist that can also encode all others, without necessarily giving one supremacy... e.g. actors can be used to encode shared-state concurrency).435 436 - p24: on line 19, the necessary feature is not "garbage collection" but precise pointer identification (which is distinct; not all GCs have it, and it has other applications besides GC)437 438 - p24: lines 32-39 are very dense and of unclear significance; an example, including code, would be much clearer.439 440 - p25: "current UNIX systems" seems to mean "Linux", so please say that or give the behaviour or some other modern Unix (I believe Solaris is somewhat different, and possibly the BSDs too). Also, in the explanation of signal dynamics, it would be useful to adopt the quotation's own terminology of "process-directed" signals. Presumably the "internal" thread-directed signals were generated using tgkill()? And presumably the timer expiry signal is left unblocked only on the thread (virtual processor) running the "simulation"? (Calling it a "simulation" is a bit odd, although I realise it is borrowing the concept of a discrete event queue.)441 -
driver/Makefile.in
r53bb8f1 r9d9a451 187 187 DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) 188 188 ACLOCAL = @ACLOCAL@ 189 ALLOCA = @ALLOCA@ 189 190 AMTAR = @AMTAR@ 190 191 AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ -
driver/cfa.cc
r53bb8f1 r9d9a451 10 10 // Created On : Tue Aug 20 13:44:49 2002 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Sun Feb 10 08:28:09 201913 // Update Count : 2 8112 // Last Modified On : Fri Sep 14 23:02:59 2018 13 // Update Count : 277 14 14 // 15 15 … … 107 107 bool link = true; // linking as well as compiling 108 108 bool verbose = false; // -v flag 109 bool quiet = false; // -quiet flag 110 bool debug = true; // -debug flag 111 bool nolib = false; // -nolib flag 112 bool help = false; // -help flag 109 bool quiet = false; // -quiet flag 110 bool debug = true; // -debug flag 111 bool help = false; // -help flag 113 112 bool CFA_flag = false; // -CFA flag 114 113 bool cpp_flag = false; // -E or -M flag, preprocessor only … … 163 162 debug = true; // strip the debug flag 164 163 } else if ( arg == "-nodebug" ) { 165 debug = false; // strip the debug flag 166 } else if ( arg == "-nolib" ) { 167 nolib = true; // strip the nodebug flag 164 debug = false; // strip the nodebug flag 168 165 } else if ( arg == "-quiet" ) { 169 166 quiet = true; // strip the quiet flag … … 369 366 } // if 370 367 } // if 371 const char * config = nolib ? "nolib" : (debug ? "debug": "nodebug");368 const char * config = debug ? "debug": "nodebug"; 372 369 string libdir = libbase + arch + "-" + config; 373 370 374 if ( ! nolib && !dirExists( libdir ) ) {371 if ( ! dirExists( libdir ) ) { 375 372 cerr << argv[0] << " internal error, configuration " << config << " not installed." << endl; 376 373 cerr << "Was looking for " << libdir << endl; … … 387 384 nargs += 1; 388 385 389 for ( int i = 0; i < nlibs; i += 1 ) { // copy non-user libraries after all user libraries390 args[nargs] = libs[i];391 nargs += 1;392 } // for393 394 386 if ( link ) { 395 387 args[nargs] = "-Xlinker"; … … 422 414 nargs += 1; 423 415 args[nargs] = "-lrt"; 424 nargs += 1;425 args[nargs] = "-lm";426 416 nargs += 1; 427 417 } // if … … 498 488 args[nargs] = "-Wno-deprecated"; 499 489 nargs += 1; 500 #ifdef HAVE_CAST_FUNCTION_TYPE501 args[nargs] = "-Wno-cast-function-type";502 nargs += 1;503 #endif // HAVE_CAST_FUNCTION_TYPE504 490 if ( ! std_flag ) { // default c11, if none specified 505 491 args[nargs] = "-std=gnu11"; … … 511 497 nargs += 1; 512 498 args[nargs] = ( *new string( string("-B") + Bprefix ) ).c_str(); 499 nargs += 1; 500 args[nargs] = "-lm"; 513 501 nargs += 1; 514 502 } else { … … 516 504 exit( EXIT_FAILURE ); 517 505 } // if 506 507 for ( int i = 0; i < nlibs; i += 1 ) { // copy non-user libraries after all user libraries 508 args[nargs] = libs[i]; 509 nargs += 1; 510 } // for 518 511 519 512 args[nargs] = NULL; // terminate with NULL -
libcfa/configure
r53bb8f1 r9d9a451 2382 2382 2383 2383 2384 # http://git.savannah.gnu.org/gitweb/?p=autoconf-archive.git;a=blob_plain;f=m4/ax_check_compile_flag.m42385 2386 2384 2387 2385 am__api_version='1.15' … … 2970 2968 "nolib" ) 2971 2969 CONFIG_CFLAGS="-O2 -s" 2972 CONFIG_CFAFLAGS="-no lib"2970 CONFIG_CFAFLAGS="-nodebug" 2973 2971 CONFIG_BUILDLIB="no" 2974 2972 ;; -
libcfa/configure.ac
r53bb8f1 r9d9a451 56 56 "nolib" ) 57 57 CONFIG_CFLAGS="-O2 -s" 58 CONFIG_CFAFLAGS="-no lib"58 CONFIG_CFAFLAGS="-nodebug" 59 59 CONFIG_BUILDLIB="no" 60 60 ;; -
libcfa/prelude/builtins.c
r53bb8f1 r9d9a451 10 10 // Created On : Fri Jul 21 16:21:03 2017 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Sun Mar 10 10:52:50 201913 // Update Count : 3112 // Last Modified On : Sun Aug 5 21:40:38 2018 13 // Update Count : 20 14 14 // 15 15 … … 26 26 // increment/decrement unification 27 27 28 static inline forall( dtype T | { T & ?+=?( T&, one_t ); } )29 T & ++? ( T& x ) { return x += 1; }28 static inline forall( dtype T | { T& ?+=?( T&, one_t ); } ) 29 T& ++? ( T& x ) { return x += 1; } 30 30 31 static inline forall( dtype T | sized(T) | { void ?{}( T &, T ); void ^?{}( T & ); T & ?+=?( T&, one_t ); } )32 T & ?++ ( T& x ) { T tmp = x; x += 1; return tmp; }31 static inline forall( dtype T | sized(T) | { void ?{}( T&, T ); void ^?{}( T& ); T& ?+=?( T&, one_t ); } ) 32 T& ?++ ( T& x ) { T tmp = x; x += 1; return tmp; } 33 33 34 static inline forall( dtype T | { T & ?-=?( T&, one_t ); } )35 T & --? ( T& x ) { return x -= 1; }34 static inline forall( dtype T | { T& ?-=?( T&, one_t ); } ) 35 T& --? ( T& x ) { return x -= 1; } 36 36 37 static inline forall( dtype T | sized(T) | { void ?{}( T &, T ); void ^?{}( T & ); T & ?-=?( T &, one_t ); } ) 38 T & ?-- ( T & x ) { T tmp = x; x -= 1; return tmp; } 39 40 // universal typed pointer constant 41 42 static inline forall( dtype T ) T * intptr( uintptr_t addr ) { return (T *)addr; } 37 static inline forall( dtype T | sized(T) | { void ?{}( T&, T ); void ^?{}( T& ); T& ?-=?( T&, one_t ); } ) 38 T& ?-- ( T& x ) { T tmp = x; x -= 1; return tmp; } 43 39 44 40 // exponentiation operator implementation -
libcfa/prelude/extras.c
r53bb8f1 r9d9a451 1 #include <stddef.h> // size_t, ptrdiff_t , intptr_t, uintptr_t1 #include <stddef.h> // size_t, ptrdiff_t 2 2 #include <stdint.h> // intX_t, uintX_t, where X is 8, 16, 32, 64 3 3 #include <uchar.h> // char16_t, char32_t -
libcfa/prelude/extras.regx
r53bb8f1 r9d9a451 1 1 typedef.* size_t; 2 2 typedef.* ptrdiff_t; 3 typedef.* intptr_t;4 typedef.* uintptr_t;5 3 typedef.* __int8_t; 6 4 typedef.* __int16_t; -
libcfa/prelude/prelude-gen.cc
r53bb8f1 r9d9a451 1 //2 // Cforall Version 1.0.0 Copyright (C) 2018 University of Waterloo3 //4 // The contents of this file are covered under the licence agreement in the5 // file "LICENCE" distributed with Cforall.6 //7 // prelude-gen.cc --8 //9 // Author : Rob Schluntz and Thierry Delisle10 // Created On : Sat Feb 16 08:44:58 201911 // Last Modified By : Peter A. Buhr12 // Last Modified On : Fri Mar 8 16:00:22 201913 // Update Count : 2614 //15 16 1 #include <algorithm> 17 2 #include <array> … … 26 11 bool hasComparison; 27 12 } basicTypes[] = { 28 { "char" , false, true , },29 { "signed char" , false, true , },30 { "unsigned char" , false, true , },13 // { "char" , false, true , }, 14 // { "signed char" , false, true , }, 15 // { "unsigned char" , false, true , }, 31 16 { "signed short" , false, true , }, 32 17 { "unsigned short" , false, true , }, … … 49 34 #if defined(__i386__) || defined(__ia64__) || defined(__x86_64__) 50 35 { "__float80" , true , true , }, 51 { "_ _float128", true , true , },36 { "_Float128" , true , true , }, 52 37 #endif 53 38 }; … … 165 150 cout << endl; 166 151 167 cout << "signed int ?==?( zero_t, zero_t ), ?!=?( zero_t, zero_t );" << endl;168 cout << "signed int ?==?( one_t, one_t ), ?!=?( one_t, one_t );" << endl;169 cout << "signed int ?==?( _Bool, _Bool ), ?!=?( _Bool, _Bool );" << endl;170 cout << "signed int !?( _Bool );" << endl;152 cout << "signed int ?==?( zero_t, zero_t ), ?!=?( zero_t, zero_t );" << endl; 153 cout << "signed int ?==?( one_t, one_t ), ?!=?( one_t, one_t );" << endl; 154 cout << "signed int ?==?( _Bool, _Bool ), ?!=?( _Bool, _Bool );" << endl; 155 cout << "signed int !?( _Bool );" << endl; 171 156 172 157 for (auto op : arithmeticOperators) { … … 203 188 cout << "// Arithmetic Constructors //" << endl; 204 189 cout << "/////////////////////////////" << endl; 205 cout << endl;206 207 190 auto otype = [](const std::string & type, bool do_volatile = false) { 208 cout << "void ?{} (" << type << " &);" << endl;209 cout << "void ?{} (" << type << " &, " << type << ");" << endl;210 cout << type << " ?=? (" << type << " &, " << type << ")";211 if ( do_volatile ) {212 cout << ", ?=?(volatile " << type << " &, " << type << ")";191 cout << "void \t?{} ( " << type << " & );" << endl; 192 cout << "void \t?{} ( " << type << " &, " << type << " );" << endl; 193 cout << type << " \t?=? ( " << type << " &, " << type << " )"; 194 if( do_volatile ) { 195 cout << ", \t?=?( volatile " << type << " &, " << type << " )"; 213 196 } 214 197 cout << ";" << endl; 215 cout << "void ^?{}( " << type << " & );" << endl;198 cout << "void \t^?{}( " << type << " & );" << endl; 216 199 }; 217 200 … … 219 202 otype("one_t"); 220 203 otype("_Bool", true); 221 cout << endl; 204 otype("char", true); 205 otype("signed char", true); 206 otype("unsigned char", true); 222 207 223 208 for (auto type : basicTypes) { 224 cout << "void ?{}(" << type.name << " &);" << endl; 225 cout << "void ?{}(" << type.name << " &, " << type.name << ");" << endl; 226 cout << "void ?{}(" << type.name << " &, zero_t);" << endl; 209 cout << "void ?{}(" << type.name << " &);" << endl; 210 cout << "void ?{}(" << type.name << " &, " << type.name << ");" << endl; 227 211 cout << "void ^?{}(" << type.name << " &);" << endl; 228 212 cout << endl; … … 233 217 cout << "// Pointer Constructors //" << endl; 234 218 cout << "//////////////////////////" << endl; 235 cout << endl; 236 237 cout << "forall(ftype FT) void ?{}( FT *&, FT * );" << endl; 238 cout << "forall(ftype FT) void ?{}( FT * volatile &, FT * );" << endl; 219 cout << "forall(ftype FT) void ?{}( FT *&, FT * );" << endl; 220 cout << "forall(ftype FT) void ?{}( FT * volatile &, FT * );" << endl; 239 221 240 222 // generate qualifiers … … 260 242 for (auto cvq : qualifiersPair) { 261 243 for (auto is_vol : { " ", "volatile" }) { 262 cout << "forall(dtype DT) void ?{}(" << cvq.first << type << " * " << is_vol << " &, " << cvq.second << "DT *);" << endl;244 cout << "forall(dtype DT) void ?{}(" << cvq.first << type << " * " << is_vol << " &, " << cvq.second << "DT *);" << endl; 263 245 } 264 246 } 265 247 for (auto cvq : qualifiersSingle) { 266 248 for (auto is_vol : { " ", "volatile" }) { 267 cout << "forall(dtype DT) void ?{}(" << cvq << type << " * " << is_vol << " &);" << endl;249 cout << "forall(dtype DT) void ?{}(" << cvq << type << " * " << is_vol << " &);" << endl; 268 250 } 269 251 for (auto is_vol : { " ", "volatile" }) { … … 287 269 cout << "forall(ftype FT) FT * ?=?( FT * &, zero_t );" << endl; 288 270 cout << "forall(ftype FT) FT * ?=?( FT * volatile &, zero_t );" << endl; 289 cout << "forall( ftype FT) void ?{}( FT * & );" << endl;290 cout << "forall( ftype FT) void ^?{}( FT * & );" << endl;271 cout << "forall( ftype FT ) void ?{}( FT * & );" << endl; 272 cout << "forall( ftype FT ) void ^?{}( FT * & );" << endl; 291 273 cout << endl; 292 274 … … 295 277 cout << "///////////////////////" << endl; 296 278 297 cout << "forall(ftype FT) FT * ?=?( FT *&, FT * );" << endl; 298 cout << "forall(ftype FT) FT * ?=?( FT * volatile &, FT * );" << endl; 299 cout << "forall(ftype FT) int !?( FT * );" << endl; 300 cout << "forall(ftype FT) signed int ?==?( FT *, FT * );" << endl; 301 cout << "forall(ftype FT) signed int ?!=?( FT *, FT * );" << endl; 302 cout << "forall(ftype FT) FT & *?( FT * );" << endl; 279 cout << "forall( ftype FT ) FT * ?=?( FT *&, FT * );" << endl; 280 cout << "forall( ftype FT ) FT * ?=?( FT * volatile &, FT * );" << endl; 281 cout << "forall( ftype FT ) int !?( FT * );" << endl; 282 cout << "forall( ftype FT ) signed int ?==?( FT *, FT * );" << endl; 283 cout << "forall( ftype FT ) signed int ?!=?( FT *, FT * );" << endl; 284 cout << "forall( ftype FT ) FT & *?( FT * );" << endl; 285 303 286 304 287 for (auto op : pointerOperators) { … … 404 387 } 405 388 406 // Local Variables: //407 // tab-width: 4 //408 // End: // -
libcfa/src/Makefile.in
r53bb8f1 r9d9a451 415 415 am__v_GOC_0 = @echo " GOC " $@; 416 416 am__v_GOC_1 = 417 UPPCC = u++418 417 UPPCOMPILE = $(UPPCC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_UPPFLAGS) $(UPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) $(AM_CFLAGS) $(CFLAGS) 419 418 AM_V_UPP = $(am__v_UPP_@AM_V@) -
libcfa/src/containers/maybe.cfa
r53bb8f1 r9d9a451 10 10 // Created On : Wed May 24 15:40:00 2017 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Sun Feb 17 11:22:03 201913 // Update Count : 312 // Last Modified On : Thu Jul 20 15:23:50 2017 13 // Update Count : 2 14 14 // 15 15 … … 39 39 forall(otype T) 40 40 maybe(T) ?=?(maybe(T) & this, maybe(T) that) { 41 if (this.has_value & &that.has_value) {41 if (this.has_value & that.has_value) { 42 42 this.value = that.value; 43 43 } else if (this.has_value) { -
libcfa/src/containers/result.cfa
r53bb8f1 r9d9a451 10 10 // Created On : Wed May 24 15:40:00 2017 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Sun Feb 17 11:24:04 201913 // Update Count : 312 // Last Modified On : Thu Jul 20 15:23:58 2017 13 // Update Count : 2 14 14 // 15 15 … … 48 48 forall(otype T, otype E) 49 49 result(T, E) ?=?(result(T, E) & this, result(T, E) that) { 50 if (this.has_value & &that.has_value) {50 if (this.has_value & that.has_value) { 51 51 this.value = that.value; 52 52 } else if (this.has_value) { -
libcfa/src/iostream.cfa
r53bb8f1 r9d9a451 10 10 // Created On : Wed May 27 17:56:53 2015 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Mon Mar 4 20:57:24 201913 // Update Count : 5 9312 // Last Modified On : Mon Dec 24 18:33:40 2018 13 // Update Count : 589 14 14 // 15 15 … … 27 27 28 28 forall( dtype ostype | ostream( ostype ) ) { 29 ostype & ?|?( ostype & os, zero_t ) {30 if ( sepPrt( os ) ) fmt( os, "%s", sepGetCur( os ) );31 fmt( os, "%d", 0n );32 return os;33 } // ?|?34 void ?|?( ostype & os, zero_t z ) {35 (ostype &)(os | z); nl( os );36 } // ?|?37 38 ostype & ?|?( ostype & os, one_t ) {39 if ( sepPrt( os ) ) fmt( os, "%s", sepGetCur( os ) );40 fmt( os, "%d", 1n );41 return os;42 } // ?|?43 void ?|?( ostype & os, one_t o ) {44 (ostype &)(os | o); nl( os );45 } // ?|?46 47 29 ostype & ?|?( ostype & os, bool b ) { 48 30 if ( sepPrt( os ) ) fmt( os, "%s", sepGetCur( os ) ); -
libcfa/src/iostream.hfa
r53bb8f1 r9d9a451 10 10 // Created On : Wed May 27 17:56:53 2015 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Tue Feb 26 16:57:22 201913 // Update Count : 22 112 // Last Modified On : Mon Dec 24 18:33:40 2018 13 // Update Count : 220 14 14 // 15 15 … … 62 62 63 63 forall( dtype ostype | ostream( ostype ) ) { 64 ostype & ?|?( ostype &, zero_t );65 void ?|?( ostype &, zero_t );66 ostype & ?|?( ostype &, one_t );67 void ?|?( ostype &, one_t );68 69 64 ostype & ?|?( ostype &, bool ); 70 65 void ?|?( ostype &, bool ); -
src/CodeGen/module.mk
r53bb8f1 r9d9a451 18 18 # ArgTweak/Mutate.cc 19 19 20 SRC _CODEGEN =\20 SRC += CodeGen/Generate.cc \ 21 21 CodeGen/CodeGenerator.cc \ 22 CodeGen/GenType.cc \ 23 CodeGen/FixNames.cc \ 22 24 CodeGen/FixMain.cc \ 23 CodeGen/GenType.cc \24 25 CodeGen/OperatorTable.cc 25 26 27 SRC += $(SRC_CODEGEN) CodeGen/Generate.cc CodeGen/FixNames.cc28 SRCDEMANGLE += $(SRC_CODEGEN) -
src/Common/PassVisitor.h
r53bb8f1 r9d9a451 5 5 #include <stack> 6 6 7 #include "Common/Stats.h"8 7 #include "Common/utility.h" 9 8 … … 427 426 }; 428 427 429 #include "Common/Stats.h"430 431 extern struct PassVisitorStats {432 size_t depth = 0;433 Stats::Counters::MaxCounter<double> * max = nullptr;434 Stats::Counters::AverageCounter<double> * avg = nullptr;435 } pass_visitor_stats;436 437 428 #include "SynTree/TypeSubstitution.h" 438 429 #include "PassVisitor.impl.h" -
src/Common/PassVisitor.impl.h
r53bb8f1 r9d9a451 67 67 SemanticErrorException errors; 68 68 69 pass_visitor_stats.depth++;70 pass_visitor_stats.max->push(pass_visitor_stats.depth);71 pass_visitor_stats.avg->push(pass_visitor_stats.depth);72 69 for ( std::list< Declaration* >::iterator i = decls.begin(); ; ++i ) { 73 74 75 70 // splice in new declarations after previous decl 76 71 if ( !empty( afterDecls ) ) { decls.splice( i, *afterDecls ); } … … 88 83 if ( !empty( beforeDecls ) ) { decls.splice( i, *beforeDecls ); } 89 84 } 90 pass_visitor_stats.depth--;91 85 if ( ! errors.isEmpty() ) { 92 86 throw errors; … … 100 94 SemanticErrorException errors; 101 95 102 pass_visitor_stats.depth++;103 pass_visitor_stats.max->push(pass_visitor_stats.depth);104 pass_visitor_stats.avg->push(pass_visitor_stats.depth);105 96 for ( std::list< Declaration* >::iterator i = decls.begin(); ; ++i ) { 106 97 // splice in new declarations after previous decl … … 118 109 if ( !empty( beforeDecls ) ) { decls.splice( i, *beforeDecls ); } 119 110 } 120 pass_visitor_stats.depth--;121 111 if ( ! errors.isEmpty() ) { 122 112 throw errors; … … 136 126 if ( ! visitor.get_visit_children() ) return; 137 127 SemanticErrorException errors; 138 139 pass_visitor_stats.depth++;140 pass_visitor_stats.max->push(pass_visitor_stats.depth);141 pass_visitor_stats.avg->push(pass_visitor_stats.depth);142 128 for ( typename Container::iterator i = container.begin(); i != container.end(); ++i ) { 143 129 try { … … 149 135 } 150 136 } 151 pass_visitor_stats.depth--;152 137 if ( ! errors.isEmpty() ) { 153 138 throw errors; … … 168 153 if ( ! mutator.get_visit_children() ) return; 169 154 SemanticErrorException errors; 170 171 pass_visitor_stats.depth++;172 pass_visitor_stats.max->push(pass_visitor_stats.depth);173 pass_visitor_stats.avg->push(pass_visitor_stats.depth);174 155 for ( typename Container::iterator i = container.begin(); i != container.end(); ++i ) { 175 156 try { … … 182 163 } // try 183 164 } // for 184 pass_visitor_stats.depth--;185 165 if ( ! errors.isEmpty() ) { 186 166 throw errors; … … 205 185 DeclList_t* afterDecls = get_afterDecls(); 206 186 207 pass_visitor_stats.depth++;208 pass_visitor_stats.max->push(pass_visitor_stats.depth);209 pass_visitor_stats.avg->push(pass_visitor_stats.depth);210 187 for ( std::list< Statement* >::iterator i = statements.begin(); i != statements.end(); ++i ) { 211 188 … … 225 202 if ( !empty( beforeStmts ) ) { statements.splice( i, *beforeStmts ); } 226 203 } 227 pass_visitor_stats.depth--;228 204 229 205 if ( !empty( afterDecls ) ) { splice( std::back_inserter( statements ), afterDecls); } -
src/Common/module.mk
r53bb8f1 r9d9a451 15 15 ############################################################################### 16 16 17 SRC_COMMON = \ 18 Common/Assert.cc \ 19 Common/Eval.cc \ 20 Common/PassVisitor.cc \ 21 Common/SemanticError.cc \ 22 Common/Stats/Counter.cc \ 23 Common/Stats/Heap.cc \ 24 Common/Stats/Stats.cc \ 25 Common/Stats/Time.cc \ 26 Common/UniqueName.cc 27 28 SRC += $(SRC_COMMON) Common/DebugMalloc.cc 29 SRCDEMANGLE += $(SRC_COMMON) 17 SRC += Common/SemanticError.cc \ 18 Common/UniqueName.cc \ 19 Common/DebugMalloc.cc \ 20 Common/Assert.cc \ 21 Common/Heap.cc \ 22 Common/Eval.cc -
src/Concurrency/Waitfor.cc
r53bb8f1 r9d9a451 11 11 // Last Modified By : 12 12 // Last Modified On : 13 // Update Count : 713 // Update Count : 5 14 14 // 15 15 -
src/Concurrency/module.mk
r53bb8f1 r9d9a451 15 15 ############################################################################### 16 16 17 SRC += Concurrency/Keywords.cc Concurrency/Waitfor.cc18 SRCDEMANGLE += Concurrency/Keywords.cc17 SRC += Concurrency/Keywords.cc \ 18 Concurrency/Waitfor.cc 19 19 -
src/ControlStruct/ExceptTranslate.cc
r53bb8f1 r9d9a451 9 9 // Author : Andrew Beach 10 10 // Created On : Wed Jun 14 16:49:00 2017 11 // Last Modified By : Peter A. Buhr12 // Last Modified On : Wed Feb 13 18:15:29 201913 // Update Count : 1111 // Last Modified By : Andrew Beach 12 // Last Modified On : Thr Aug 17 17:19:00 2017 13 // Update Count : 9 14 14 // 15 15 -
src/ControlStruct/module.mk
r53bb8f1 r9d9a451 15 15 ############################################################################### 16 16 17 SRC_CONTROLSTRUCT = \ 17 SRC += ControlStruct/LabelGenerator.cc \ 18 ControlStruct/LabelFixer.cc \ 19 ControlStruct/MLEMutator.cc \ 20 ControlStruct/Mutate.cc \ 18 21 ControlStruct/ForExprMutator.cc \ 19 ControlStruct/LabelFixer.cc \ 20 ControlStruct/LabelGenerator.cc \ 21 ControlStruct/MLEMutator.cc \ 22 ControlStruct/Mutate.cc 23 24 SRC += $(SRC_CONTROLSTRUCT) ControlStruct/ExceptTranslate.cc 25 SRCDEMANGLE += $(SRC_CONTROLSTRUCT) 26 22 ControlStruct/ExceptTranslate.cc -
src/GenPoly/module.mk
r53bb8f1 r9d9a451 22 22 GenPoly/FindFunction.cc \ 23 23 GenPoly/InstantiateGeneric.cc 24 25 SRCDEMANGLE += GenPoly/GenPoly.cc GenPoly/Lvalue.cc26 -
src/InitTweak/FixInit.cc
r53bb8f1 r9d9a451 10 10 // Created On : Wed Jan 13 16:29:30 2016 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Wed Feb 13 18:15:56 201913 // Update Count : 7 612 // Last Modified On : Wed Jun 21 17:35:05 2017 13 // Update Count : 74 14 14 // 15 15 #include "FixInit.h" -
src/InitTweak/module.mk
r53bb8f1 r9d9a451 20 20 InitTweak/InitTweak.cc 21 21 22 SRCDEMANGLE += InitTweak/GenInit.cc \23 InitTweak/InitTweak.cc24 -
src/MakeLibCfa.cc
r53bb8f1 r9d9a451 9 9 // Author : Richard C. Bilson 10 10 // Created On : Sat May 16 10:33:33 2015 11 // Last Modified By : Peter A. Buhr12 // Last Modified On : Sun Feb 17 21:08:09 201913 // Update Count : 4 111 // Last Modified By : Rob Schluntz 12 // Last Modified On : Fri Apr 22 13:54:15 2016 13 // Update Count : 40 14 14 // 15 15 … … 146 146 } // namespace 147 147 } // namespace LibCfa 148 149 // Local Variables: //150 // tab-width: 4 //151 // End: // -
src/Makefile.am
r53bb8f1 r9d9a451 10 10 ## Author : Peter A. Buhr 11 11 ## Created On : Sun May 31 08:51:46 2015 12 ## Last Modified By : Peter A. Buhr13 ## Last Modified On : Fri Feb 15 09:44:09 201914 ## Update Count : 9712 ## Last Modified By : Andrew Beach 13 ## Last Modified On : Tus Jul 25 10:34:00 2017 14 ## Update Count : 76 15 15 ############################################################################### 16 16 … … 23 23 CompilationState.cc 24 24 25 SRCDEMANGLE = CompilationState.cc26 27 25 MAINTAINERCLEANFILES = 28 26 MOSTLYCLEANFILES = 27 28 # Is there a way to use a variable for the directory names? 29 29 30 30 include CodeGen/module.mk … … 43 43 include Virtual/module.mk 44 44 45 $(addprefix $(srcdir)/, ResolvExpr/ConversionCost.cc ResolvExpr/CommonType.cc SymTab/ManglerCommon.cc) : $(srcdir)/SynTree/Type.h46 47 $(srcdir)/SynTree/Type.h : BasicTypes-gen.cc48 ${AM_V_GEN}${CXXCOMPILE} $< -o BasicTypes-gen -Wall -Wextra49 @./BasicTypes-gen50 @rm BasicTypes-gen51 52 45 # put into lib for now 53 46 cfa_cpplibdir = $(CFA_LIBDIR) … … 62 55 demangler_SOURCES = SymTab/demangler.cc 63 56 64 demangler_LDADD = libdemangle.a -ldl# yywrap57 demangler_LDADD = libdemangle.a # yywrap 65 58 66 59 noinst_LIBRARIES = libdemangle.a 67 libdemangle_a_SOURCES = $(SRCDEMANGLE) 60 libdemangle_a_SOURCES = SymTab/Demangle.cc SymTab/ManglerCommon.cc \ 61 SynTree/Type.cc \ 62 SynTree/VoidType.cc \ 63 SynTree/BasicType.cc \ 64 SynTree/PointerType.cc \ 65 SynTree/ArrayType.cc \ 66 SynTree/ReferenceType.cc \ 67 SynTree/FunctionType.cc \ 68 SynTree/ReferenceToType.cc \ 69 SynTree/TupleType.cc \ 70 SynTree/TypeofType.cc \ 71 SynTree/AttrType.cc \ 72 SynTree/VarArgsType.cc \ 73 SynTree/ZeroOneType.cc \ 74 SynTree/Constant.cc \ 75 SynTree/Expression.cc \ 76 SynTree/TupleExpr.cc \ 77 SynTree/CommaExpr.cc \ 78 SynTree/TypeExpr.cc \ 79 SynTree/ApplicationExpr.cc \ 80 SynTree/AddressExpr.cc \ 81 SynTree/Statement.cc \ 82 SynTree/CompoundStmt.cc \ 83 SynTree/DeclStmt.cc \ 84 SynTree/Declaration.cc \ 85 SynTree/DeclarationWithType.cc \ 86 SynTree/ObjectDecl.cc \ 87 SynTree/FunctionDecl.cc \ 88 SynTree/AggregateDecl.cc \ 89 SynTree/NamedTypeDecl.cc \ 90 SynTree/TypeDecl.cc \ 91 SynTree/Initializer.cc \ 92 SynTree/TypeSubstitution.cc \ 93 SynTree/Attribute.cc \ 94 SynTree/DeclReplacer.cc \ 95 CompilationState.cc \ 96 CodeGen/CodeGenerator.cc \ 97 CodeGen/FixMain.cc \ 98 CodeGen/GenType.cc \ 99 CodeGen/OperatorTable.cc \ 100 Common/Assert.cc \ 101 Common/Eval.cc \ 102 Common/SemanticError.cc \ 103 Common/UniqueName.cc \ 104 Concurrency/Keywords.cc \ 105 ControlStruct/ForExprMutator.cc \ 106 ControlStruct/LabelFixer.cc \ 107 ControlStruct/LabelGenerator.cc \ 108 ControlStruct/MLEMutator.cc \ 109 ControlStruct/Mutate.cc \ 110 GenPoly/GenPoly.cc \ 111 GenPoly/Lvalue.cc \ 112 InitTweak/GenInit.cc \ 113 InitTweak/InitTweak.cc \ 114 Parser/LinkageSpec.cc \ 115 ResolvExpr/AdjustExprType.cc \ 116 ResolvExpr/Alternative.cc \ 117 ResolvExpr/AlternativeFinder.cc \ 118 ResolvExpr/ExplodedActual.cc \ 119 ResolvExpr/CastCost.cc \ 120 ResolvExpr/CommonType.cc \ 121 ResolvExpr/ConversionCost.cc \ 122 ResolvExpr/CurrentObject.cc \ 123 ResolvExpr/FindOpenVars.cc \ 124 ResolvExpr/Occurs.cc \ 125 ResolvExpr/PolyCost.cc \ 126 ResolvExpr/PtrsAssignable.cc \ 127 ResolvExpr/PtrsCastable.cc \ 128 ResolvExpr/RenameVars.cc \ 129 ResolvExpr/ResolveAssertions.cc \ 130 ResolvExpr/Resolver.cc \ 131 ResolvExpr/ResolveTypeof.cc \ 132 ResolvExpr/SpecCost.cc \ 133 ResolvExpr/TypeEnvironment.cc \ 134 ResolvExpr/Unify.cc \ 135 SymTab/Autogen.cc \ 136 SymTab/FixFunction.cc \ 137 SymTab/Indexer.cc \ 138 SymTab/Mangler.cc \ 139 SymTab/Validate.cc \ 140 Tuples/Explode.cc \ 141 Tuples/TupleAssignment.cc \ 142 Tuples/TupleExpansion.cc \ 143 Validate/HandleAttributes.cc 68 144 69 145 MAINTAINERCLEANFILES += ${libdir}/${notdir ${cfa_cpplib_PROGRAMS}} -
src/Makefile.in
r53bb8f1 r9d9a451 162 162 libdemangle_a_LIBADD = 163 163 am__dirstamp = $(am__leading_dot)dirstamp 164 am__objects_1 = CodeGen/CodeGenerator.$(OBJEXT) \ 165 CodeGen/FixMain.$(OBJEXT) CodeGen/GenType.$(OBJEXT) \ 166 CodeGen/OperatorTable.$(OBJEXT) 167 am__objects_2 = Common/Assert.$(OBJEXT) Common/Eval.$(OBJEXT) \ 168 Common/PassVisitor.$(OBJEXT) Common/SemanticError.$(OBJEXT) \ 169 Common/Stats/Counter.$(OBJEXT) Common/Stats/Heap.$(OBJEXT) \ 170 Common/Stats/Stats.$(OBJEXT) Common/Stats/Time.$(OBJEXT) \ 171 Common/UniqueName.$(OBJEXT) 172 am__objects_3 = ControlStruct/ForExprMutator.$(OBJEXT) \ 164 am_libdemangle_a_OBJECTS = SymTab/Demangle.$(OBJEXT) \ 165 SymTab/ManglerCommon.$(OBJEXT) SynTree/Type.$(OBJEXT) \ 166 SynTree/VoidType.$(OBJEXT) SynTree/BasicType.$(OBJEXT) \ 167 SynTree/PointerType.$(OBJEXT) SynTree/ArrayType.$(OBJEXT) \ 168 SynTree/ReferenceType.$(OBJEXT) SynTree/FunctionType.$(OBJEXT) \ 169 SynTree/ReferenceToType.$(OBJEXT) SynTree/TupleType.$(OBJEXT) \ 170 SynTree/TypeofType.$(OBJEXT) SynTree/AttrType.$(OBJEXT) \ 171 SynTree/VarArgsType.$(OBJEXT) SynTree/ZeroOneType.$(OBJEXT) \ 172 SynTree/Constant.$(OBJEXT) SynTree/Expression.$(OBJEXT) \ 173 SynTree/TupleExpr.$(OBJEXT) SynTree/CommaExpr.$(OBJEXT) \ 174 SynTree/TypeExpr.$(OBJEXT) SynTree/ApplicationExpr.$(OBJEXT) \ 175 SynTree/AddressExpr.$(OBJEXT) SynTree/Statement.$(OBJEXT) \ 176 SynTree/CompoundStmt.$(OBJEXT) SynTree/DeclStmt.$(OBJEXT) \ 177 SynTree/Declaration.$(OBJEXT) \ 178 SynTree/DeclarationWithType.$(OBJEXT) \ 179 SynTree/ObjectDecl.$(OBJEXT) SynTree/FunctionDecl.$(OBJEXT) \ 180 SynTree/AggregateDecl.$(OBJEXT) \ 181 SynTree/NamedTypeDecl.$(OBJEXT) SynTree/TypeDecl.$(OBJEXT) \ 182 SynTree/Initializer.$(OBJEXT) \ 183 SynTree/TypeSubstitution.$(OBJEXT) SynTree/Attribute.$(OBJEXT) \ 184 SynTree/DeclReplacer.$(OBJEXT) CompilationState.$(OBJEXT) \ 185 CodeGen/CodeGenerator.$(OBJEXT) CodeGen/FixMain.$(OBJEXT) \ 186 CodeGen/GenType.$(OBJEXT) CodeGen/OperatorTable.$(OBJEXT) \ 187 Common/Assert.$(OBJEXT) Common/Eval.$(OBJEXT) \ 188 Common/SemanticError.$(OBJEXT) Common/UniqueName.$(OBJEXT) \ 189 Concurrency/Keywords.$(OBJEXT) \ 190 ControlStruct/ForExprMutator.$(OBJEXT) \ 173 191 ControlStruct/LabelFixer.$(OBJEXT) \ 174 192 ControlStruct/LabelGenerator.$(OBJEXT) \ 175 193 ControlStruct/MLEMutator.$(OBJEXT) \ 176 ControlStruct/Mutate.$(OBJEXT) 177 am__objects_4 = ResolvExpr/AdjustExprType.$(OBJEXT) \ 194 ControlStruct/Mutate.$(OBJEXT) GenPoly/GenPoly.$(OBJEXT) \ 195 GenPoly/Lvalue.$(OBJEXT) InitTweak/GenInit.$(OBJEXT) \ 196 InitTweak/InitTweak.$(OBJEXT) Parser/LinkageSpec.$(OBJEXT) \ 197 ResolvExpr/AdjustExprType.$(OBJEXT) \ 178 198 ResolvExpr/Alternative.$(OBJEXT) \ 179 199 ResolvExpr/AlternativeFinder.$(OBJEXT) \ 200 ResolvExpr/ExplodedActual.$(OBJEXT) \ 180 201 ResolvExpr/CastCost.$(OBJEXT) ResolvExpr/CommonType.$(OBJEXT) \ 181 202 ResolvExpr/ConversionCost.$(OBJEXT) \ 182 203 ResolvExpr/CurrentObject.$(OBJEXT) \ 183 ResolvExpr/ExplodedActual.$(OBJEXT) \184 204 ResolvExpr/FindOpenVars.$(OBJEXT) ResolvExpr/Occurs.$(OBJEXT) \ 185 205 ResolvExpr/PolyCost.$(OBJEXT) \ … … 192 212 ResolvExpr/SpecCost.$(OBJEXT) \ 193 213 ResolvExpr/TypeEnvironment.$(OBJEXT) \ 194 ResolvExpr/Unify.$(OBJEXT) 195 am__objects_5 = SymTab/Autogen.$(OBJEXT) SymTab/FixFunction.$(OBJEXT) \ 214 ResolvExpr/Unify.$(OBJEXT) SymTab/Autogen.$(OBJEXT) \ 215 SymTab/FixFunction.$(OBJEXT) SymTab/Indexer.$(OBJEXT) \ 216 SymTab/Mangler.$(OBJEXT) SymTab/Validate.$(OBJEXT) \ 217 Tuples/Explode.$(OBJEXT) Tuples/TupleAssignment.$(OBJEXT) \ 218 Tuples/TupleExpansion.$(OBJEXT) \ 219 Validate/HandleAttributes.$(OBJEXT) 220 libdemangle_a_OBJECTS = $(am_libdemangle_a_OBJECTS) 221 am__installdirs = "$(DESTDIR)$(cfa_cpplibdir)" 222 PROGRAMS = $(cfa_cpplib_PROGRAMS) 223 am__objects_1 = main.$(OBJEXT) MakeLibCfa.$(OBJEXT) \ 224 CompilationState.$(OBJEXT) CodeGen/Generate.$(OBJEXT) \ 225 CodeGen/CodeGenerator.$(OBJEXT) CodeGen/GenType.$(OBJEXT) \ 226 CodeGen/FixNames.$(OBJEXT) CodeGen/FixMain.$(OBJEXT) \ 227 CodeGen/OperatorTable.$(OBJEXT) CodeTools/DeclStats.$(OBJEXT) \ 228 CodeTools/ResolvProtoDump.$(OBJEXT) \ 229 CodeTools/TrackLoc.$(OBJEXT) Concurrency/Keywords.$(OBJEXT) \ 230 Concurrency/Waitfor.$(OBJEXT) Common/SemanticError.$(OBJEXT) \ 231 Common/UniqueName.$(OBJEXT) Common/DebugMalloc.$(OBJEXT) \ 232 Common/Assert.$(OBJEXT) Common/Heap.$(OBJEXT) \ 233 Common/Eval.$(OBJEXT) ControlStruct/LabelGenerator.$(OBJEXT) \ 234 ControlStruct/LabelFixer.$(OBJEXT) \ 235 ControlStruct/MLEMutator.$(OBJEXT) \ 236 ControlStruct/Mutate.$(OBJEXT) \ 237 ControlStruct/ForExprMutator.$(OBJEXT) \ 238 ControlStruct/ExceptTranslate.$(OBJEXT) GenPoly/Box.$(OBJEXT) \ 239 GenPoly/GenPoly.$(OBJEXT) GenPoly/ScrubTyVars.$(OBJEXT) \ 240 GenPoly/Lvalue.$(OBJEXT) GenPoly/Specialize.$(OBJEXT) \ 241 GenPoly/FindFunction.$(OBJEXT) \ 242 GenPoly/InstantiateGeneric.$(OBJEXT) \ 243 InitTweak/GenInit.$(OBJEXT) InitTweak/FixInit.$(OBJEXT) \ 244 InitTweak/FixGlobalInit.$(OBJEXT) \ 245 InitTweak/InitTweak.$(OBJEXT) Parser/parser.$(OBJEXT) \ 246 Parser/lex.$(OBJEXT) Parser/TypedefTable.$(OBJEXT) \ 247 Parser/ParseNode.$(OBJEXT) Parser/DeclarationNode.$(OBJEXT) \ 248 Parser/ExpressionNode.$(OBJEXT) Parser/StatementNode.$(OBJEXT) \ 249 Parser/InitializerNode.$(OBJEXT) Parser/TypeData.$(OBJEXT) \ 250 Parser/LinkageSpec.$(OBJEXT) Parser/parserutility.$(OBJEXT) \ 251 ResolvExpr/AlternativeFinder.$(OBJEXT) \ 252 ResolvExpr/Alternative.$(OBJEXT) ResolvExpr/Unify.$(OBJEXT) \ 253 ResolvExpr/PtrsAssignable.$(OBJEXT) \ 254 ResolvExpr/CommonType.$(OBJEXT) \ 255 ResolvExpr/ConversionCost.$(OBJEXT) \ 256 ResolvExpr/CastCost.$(OBJEXT) \ 257 ResolvExpr/PtrsCastable.$(OBJEXT) \ 258 ResolvExpr/AdjustExprType.$(OBJEXT) \ 259 ResolvExpr/AlternativePrinter.$(OBJEXT) \ 260 ResolvExpr/Resolver.$(OBJEXT) \ 261 ResolvExpr/ResolveTypeof.$(OBJEXT) \ 262 ResolvExpr/RenameVars.$(OBJEXT) \ 263 ResolvExpr/FindOpenVars.$(OBJEXT) \ 264 ResolvExpr/PolyCost.$(OBJEXT) ResolvExpr/Occurs.$(OBJEXT) \ 265 ResolvExpr/TypeEnvironment.$(OBJEXT) \ 266 ResolvExpr/CurrentObject.$(OBJEXT) \ 267 ResolvExpr/ExplodedActual.$(OBJEXT) \ 268 ResolvExpr/SpecCost.$(OBJEXT) \ 269 ResolvExpr/ResolveAssertions.$(OBJEXT) \ 196 270 SymTab/Indexer.$(OBJEXT) SymTab/Mangler.$(OBJEXT) \ 197 SymTab/ManglerCommon.$(OBJEXT) SymTab/Validate.$(OBJEXT) 198 am__objects_6 = SynTree/Type.$(OBJEXT) SynTree/VoidType.$(OBJEXT) \ 271 SymTab/ManglerCommon.$(OBJEXT) SymTab/Validate.$(OBJEXT) \ 272 SymTab/FixFunction.$(OBJEXT) SymTab/Autogen.$(OBJEXT) \ 273 SynTree/Type.$(OBJEXT) SynTree/VoidType.$(OBJEXT) \ 199 274 SynTree/BasicType.$(OBJEXT) SynTree/PointerType.$(OBJEXT) \ 200 275 SynTree/ArrayType.$(OBJEXT) SynTree/ReferenceType.$(OBJEXT) \ … … 215 290 SynTree/Initializer.$(OBJEXT) \ 216 291 SynTree/TypeSubstitution.$(OBJEXT) SynTree/Attribute.$(OBJEXT) \ 217 SynTree/DeclReplacer.$(OBJEXT) 218 am__objects_7 = CompilationState.$(OBJEXT) $(am__objects_1) \ 219 Concurrency/Keywords.$(OBJEXT) $(am__objects_2) \ 220 $(am__objects_3) GenPoly/GenPoly.$(OBJEXT) \ 221 GenPoly/Lvalue.$(OBJEXT) InitTweak/GenInit.$(OBJEXT) \ 222 InitTweak/InitTweak.$(OBJEXT) Parser/LinkageSpec.$(OBJEXT) \ 223 $(am__objects_4) $(am__objects_5) SymTab/Demangle.$(OBJEXT) \ 224 $(am__objects_6) Tuples/TupleAssignment.$(OBJEXT) \ 225 Tuples/TupleExpansion.$(OBJEXT) Tuples/Explode.$(OBJEXT) \ 226 Validate/HandleAttributes.$(OBJEXT) 227 am_libdemangle_a_OBJECTS = $(am__objects_7) 228 libdemangle_a_OBJECTS = $(am_libdemangle_a_OBJECTS) 229 am__installdirs = "$(DESTDIR)$(cfa_cpplibdir)" 230 PROGRAMS = $(cfa_cpplib_PROGRAMS) 231 am__objects_8 = main.$(OBJEXT) MakeLibCfa.$(OBJEXT) \ 232 CompilationState.$(OBJEXT) $(am__objects_1) \ 233 CodeGen/Generate.$(OBJEXT) CodeGen/FixNames.$(OBJEXT) \ 234 CodeTools/DeclStats.$(OBJEXT) \ 235 CodeTools/ResolvProtoDump.$(OBJEXT) \ 236 CodeTools/TrackLoc.$(OBJEXT) Concurrency/Keywords.$(OBJEXT) \ 237 Concurrency/Waitfor.$(OBJEXT) $(am__objects_2) \ 238 Common/DebugMalloc.$(OBJEXT) $(am__objects_3) \ 239 ControlStruct/ExceptTranslate.$(OBJEXT) GenPoly/Box.$(OBJEXT) \ 240 GenPoly/GenPoly.$(OBJEXT) GenPoly/ScrubTyVars.$(OBJEXT) \ 241 GenPoly/Lvalue.$(OBJEXT) GenPoly/Specialize.$(OBJEXT) \ 242 GenPoly/FindFunction.$(OBJEXT) \ 243 GenPoly/InstantiateGeneric.$(OBJEXT) \ 244 InitTweak/GenInit.$(OBJEXT) InitTweak/FixInit.$(OBJEXT) \ 245 InitTweak/FixGlobalInit.$(OBJEXT) \ 246 InitTweak/InitTweak.$(OBJEXT) Parser/parser.$(OBJEXT) \ 247 Parser/lex.$(OBJEXT) Parser/TypedefTable.$(OBJEXT) \ 248 Parser/ParseNode.$(OBJEXT) Parser/DeclarationNode.$(OBJEXT) \ 249 Parser/ExpressionNode.$(OBJEXT) Parser/StatementNode.$(OBJEXT) \ 250 Parser/InitializerNode.$(OBJEXT) Parser/TypeData.$(OBJEXT) \ 251 Parser/LinkageSpec.$(OBJEXT) Parser/parserutility.$(OBJEXT) \ 252 $(am__objects_4) ResolvExpr/AlternativePrinter.$(OBJEXT) \ 253 $(am__objects_5) $(am__objects_6) \ 292 SynTree/DeclReplacer.$(OBJEXT) \ 254 293 Tuples/TupleAssignment.$(OBJEXT) \ 255 294 Tuples/TupleExpansion.$(OBJEXT) Tuples/Explode.$(OBJEXT) \ 256 295 Validate/HandleAttributes.$(OBJEXT) \ 257 296 Virtual/ExpandCasts.$(OBJEXT) 258 am____driver_cfa_cpp_OBJECTS = $(am__objects_ 8)297 am____driver_cfa_cpp_OBJECTS = $(am__objects_1) 259 298 ___driver_cfa_cpp_OBJECTS = $(am____driver_cfa_cpp_OBJECTS) 260 299 ___driver_cfa_cpp_DEPENDENCIES = … … 377 416 DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) 378 417 ACLOCAL = @ACLOCAL@ 418 ALLOCA = @ALLOCA@ 379 419 AMTAR = @AMTAR@ 380 420 AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ … … 524 564 AUTOMAKE_OPTIONS = foreign subdir-objects 525 565 ACLOCAL_AMFLAGS = -I automake 526 SRC = main.cc MakeLibCfa.cc CompilationState.cc $(SRC_CODEGEN) \ 527 CodeGen/Generate.cc CodeGen/FixNames.cc CodeTools/DeclStats.cc \ 566 SRC = main.cc MakeLibCfa.cc CompilationState.cc CodeGen/Generate.cc \ 567 CodeGen/CodeGenerator.cc CodeGen/GenType.cc \ 568 CodeGen/FixNames.cc CodeGen/FixMain.cc \ 569 CodeGen/OperatorTable.cc CodeTools/DeclStats.cc \ 528 570 CodeTools/ResolvProtoDump.cc CodeTools/TrackLoc.cc \ 529 Concurrency/Keywords.cc Concurrency/Waitfor.cc $(SRC_COMMON) \ 530 Common/DebugMalloc.cc $(SRC_CONTROLSTRUCT) \ 571 Concurrency/Keywords.cc Concurrency/Waitfor.cc \ 572 Common/SemanticError.cc Common/UniqueName.cc \ 573 Common/DebugMalloc.cc Common/Assert.cc Common/Heap.cc \ 574 Common/Eval.cc ControlStruct/LabelGenerator.cc \ 575 ControlStruct/LabelFixer.cc ControlStruct/MLEMutator.cc \ 576 ControlStruct/Mutate.cc ControlStruct/ForExprMutator.cc \ 531 577 ControlStruct/ExceptTranslate.cc GenPoly/Box.cc \ 532 578 GenPoly/GenPoly.cc GenPoly/ScrubTyVars.cc GenPoly/Lvalue.cc \ … … 539 585 Parser/StatementNode.cc Parser/InitializerNode.cc \ 540 586 Parser/TypeData.cc Parser/LinkageSpec.cc \ 541 Parser/parserutility.cc $(SRC_RESOLVEXPR) \ 542 ResolvExpr/AlternativePrinter.cc $(SRC_SYMTAB) $(SRC_SYNTREE) \ 587 Parser/parserutility.cc ResolvExpr/AlternativeFinder.cc \ 588 ResolvExpr/Alternative.cc ResolvExpr/Unify.cc \ 589 ResolvExpr/PtrsAssignable.cc ResolvExpr/CommonType.cc \ 590 ResolvExpr/ConversionCost.cc ResolvExpr/CastCost.cc \ 591 ResolvExpr/PtrsCastable.cc ResolvExpr/AdjustExprType.cc \ 592 ResolvExpr/AlternativePrinter.cc ResolvExpr/Resolver.cc \ 593 ResolvExpr/ResolveTypeof.cc ResolvExpr/RenameVars.cc \ 594 ResolvExpr/FindOpenVars.cc ResolvExpr/PolyCost.cc \ 595 ResolvExpr/Occurs.cc ResolvExpr/TypeEnvironment.cc \ 596 ResolvExpr/CurrentObject.cc ResolvExpr/ExplodedActual.cc \ 597 ResolvExpr/SpecCost.cc ResolvExpr/ResolveAssertions.cc \ 598 SymTab/Indexer.cc SymTab/Mangler.cc SymTab/ManglerCommon.cc \ 599 SymTab/Validate.cc SymTab/FixFunction.cc SymTab/Autogen.cc \ 600 SynTree/Type.cc SynTree/VoidType.cc SynTree/BasicType.cc \ 601 SynTree/PointerType.cc SynTree/ArrayType.cc \ 602 SynTree/ReferenceType.cc SynTree/FunctionType.cc \ 603 SynTree/ReferenceToType.cc SynTree/TupleType.cc \ 604 SynTree/TypeofType.cc SynTree/AttrType.cc \ 605 SynTree/VarArgsType.cc SynTree/ZeroOneType.cc \ 606 SynTree/Constant.cc SynTree/Expression.cc SynTree/TupleExpr.cc \ 607 SynTree/CommaExpr.cc SynTree/TypeExpr.cc \ 608 SynTree/ApplicationExpr.cc SynTree/AddressExpr.cc \ 609 SynTree/Statement.cc SynTree/CompoundStmt.cc \ 610 SynTree/DeclStmt.cc SynTree/Declaration.cc \ 611 SynTree/DeclarationWithType.cc SynTree/ObjectDecl.cc \ 612 SynTree/FunctionDecl.cc SynTree/AggregateDecl.cc \ 613 SynTree/NamedTypeDecl.cc SynTree/TypeDecl.cc \ 614 SynTree/Initializer.cc SynTree/TypeSubstitution.cc \ 615 SynTree/Attribute.cc SynTree/DeclReplacer.cc \ 543 616 Tuples/TupleAssignment.cc Tuples/TupleExpansion.cc \ 544 617 Tuples/Explode.cc Validate/HandleAttributes.cc \ 545 618 Virtual/ExpandCasts.cc 546 SRCDEMANGLE = CompilationState.cc $(SRC_CODEGEN) \547 Concurrency/Keywords.cc $(SRC_COMMON) $(SRC_CONTROLSTRUCT) \548 GenPoly/GenPoly.cc GenPoly/Lvalue.cc InitTweak/GenInit.cc \549 InitTweak/InitTweak.cc Parser/LinkageSpec.cc $(SRC_RESOLVEXPR) \550 $(SRC_SYMTAB) SymTab/Demangle.cc $(SRC_SYNTREE) \551 Tuples/TupleAssignment.cc Tuples/TupleExpansion.cc \552 Tuples/Explode.cc Validate/HandleAttributes.cc553 619 MAINTAINERCLEANFILES = ${libdir}/${notdir ${cfa_cpplib_PROGRAMS}} 554 MOSTLYCLEANFILES = Parser/lex.cc Parser/parser.cc Parser/parser.hh \ 555 Parser/parser.output 556 SRC_CODEGEN = \ 557 CodeGen/CodeGenerator.cc \ 558 CodeGen/FixMain.cc \ 559 CodeGen/GenType.cc \ 560 CodeGen/OperatorTable.cc 561 562 SRC_COMMON = \ 563 Common/Assert.cc \ 564 Common/Eval.cc \ 565 Common/PassVisitor.cc \ 566 Common/SemanticError.cc \ 567 Common/Stats/Counter.cc \ 568 Common/Stats/Heap.cc \ 569 Common/Stats/Stats.cc \ 570 Common/Stats/Time.cc \ 571 Common/UniqueName.cc 572 573 SRC_CONTROLSTRUCT = \ 574 ControlStruct/ForExprMutator.cc \ 575 ControlStruct/LabelFixer.cc \ 576 ControlStruct/LabelGenerator.cc \ 577 ControlStruct/MLEMutator.cc \ 578 ControlStruct/Mutate.cc 579 620 MOSTLYCLEANFILES = Parser/parser.hh Parser/parser.output 580 621 BUILT_SOURCES = Parser/parser.hh 581 622 AM_YFLAGS = -d -t -v 582 SRC_RESOLVEXPR = \ 583 ResolvExpr/AdjustExprType.cc \ 584 ResolvExpr/Alternative.cc \ 585 ResolvExpr/AlternativeFinder.cc \ 586 ResolvExpr/CastCost.cc \ 587 ResolvExpr/CommonType.cc \ 588 ResolvExpr/ConversionCost.cc \ 589 ResolvExpr/CurrentObject.cc \ 590 ResolvExpr/ExplodedActual.cc \ 591 ResolvExpr/FindOpenVars.cc \ 592 ResolvExpr/Occurs.cc \ 593 ResolvExpr/PolyCost.cc \ 594 ResolvExpr/PtrsAssignable.cc \ 595 ResolvExpr/PtrsCastable.cc \ 596 ResolvExpr/RenameVars.cc \ 597 ResolvExpr/ResolveAssertions.cc \ 598 ResolvExpr/Resolver.cc \ 599 ResolvExpr/ResolveTypeof.cc \ 600 ResolvExpr/SpecCost.cc \ 601 ResolvExpr/TypeEnvironment.cc \ 602 ResolvExpr/Unify.cc 603 604 SRC_SYMTAB = \ 605 SymTab/Autogen.cc \ 606 SymTab/FixFunction.cc \ 607 SymTab/Indexer.cc \ 608 SymTab/Mangler.cc \ 609 SymTab/ManglerCommon.cc \ 610 SymTab/Validate.cc 611 612 SRC_SYNTREE = \ 613 SynTree/Type.cc \ 614 SynTree/VoidType.cc \ 615 SynTree/BasicType.cc \ 616 SynTree/PointerType.cc \ 617 SynTree/ArrayType.cc \ 618 SynTree/ReferenceType.cc \ 619 SynTree/FunctionType.cc \ 620 SynTree/ReferenceToType.cc \ 621 SynTree/TupleType.cc \ 622 SynTree/TypeofType.cc \ 623 SynTree/AttrType.cc \ 624 SynTree/VarArgsType.cc \ 625 SynTree/ZeroOneType.cc \ 626 SynTree/Constant.cc \ 627 SynTree/Expression.cc \ 628 SynTree/TupleExpr.cc \ 629 SynTree/CommaExpr.cc \ 630 SynTree/TypeExpr.cc \ 631 SynTree/ApplicationExpr.cc \ 632 SynTree/AddressExpr.cc \ 633 SynTree/Statement.cc \ 634 SynTree/CompoundStmt.cc \ 635 SynTree/DeclStmt.cc \ 636 SynTree/Declaration.cc \ 637 SynTree/DeclarationWithType.cc \ 638 SynTree/ObjectDecl.cc \ 639 SynTree/FunctionDecl.cc \ 640 SynTree/AggregateDecl.cc \ 641 SynTree/NamedTypeDecl.cc \ 642 SynTree/TypeDecl.cc \ 643 SynTree/Initializer.cc \ 644 SynTree/TypeSubstitution.cc \ 645 SynTree/Attribute.cc \ 646 SynTree/DeclReplacer.cc 647 623 624 # Is there a way to use a variable for the directory names? 648 625 649 626 # put into lib for now … … 655 632 ARFLAGS = cr 656 633 demangler_SOURCES = SymTab/demangler.cc 657 demangler_LDADD = libdemangle.a -ldl# yywrap634 demangler_LDADD = libdemangle.a # yywrap 658 635 noinst_LIBRARIES = libdemangle.a 659 libdemangle_a_SOURCES = $(SRCDEMANGLE) 636 libdemangle_a_SOURCES = SymTab/Demangle.cc SymTab/ManglerCommon.cc \ 637 SynTree/Type.cc \ 638 SynTree/VoidType.cc \ 639 SynTree/BasicType.cc \ 640 SynTree/PointerType.cc \ 641 SynTree/ArrayType.cc \ 642 SynTree/ReferenceType.cc \ 643 SynTree/FunctionType.cc \ 644 SynTree/ReferenceToType.cc \ 645 SynTree/TupleType.cc \ 646 SynTree/TypeofType.cc \ 647 SynTree/AttrType.cc \ 648 SynTree/VarArgsType.cc \ 649 SynTree/ZeroOneType.cc \ 650 SynTree/Constant.cc \ 651 SynTree/Expression.cc \ 652 SynTree/TupleExpr.cc \ 653 SynTree/CommaExpr.cc \ 654 SynTree/TypeExpr.cc \ 655 SynTree/ApplicationExpr.cc \ 656 SynTree/AddressExpr.cc \ 657 SynTree/Statement.cc \ 658 SynTree/CompoundStmt.cc \ 659 SynTree/DeclStmt.cc \ 660 SynTree/Declaration.cc \ 661 SynTree/DeclarationWithType.cc \ 662 SynTree/ObjectDecl.cc \ 663 SynTree/FunctionDecl.cc \ 664 SynTree/AggregateDecl.cc \ 665 SynTree/NamedTypeDecl.cc \ 666 SynTree/TypeDecl.cc \ 667 SynTree/Initializer.cc \ 668 SynTree/TypeSubstitution.cc \ 669 SynTree/Attribute.cc \ 670 SynTree/DeclReplacer.cc \ 671 CompilationState.cc \ 672 CodeGen/CodeGenerator.cc \ 673 CodeGen/FixMain.cc \ 674 CodeGen/GenType.cc \ 675 CodeGen/OperatorTable.cc \ 676 Common/Assert.cc \ 677 Common/Eval.cc \ 678 Common/SemanticError.cc \ 679 Common/UniqueName.cc \ 680 Concurrency/Keywords.cc \ 681 ControlStruct/ForExprMutator.cc \ 682 ControlStruct/LabelFixer.cc \ 683 ControlStruct/LabelGenerator.cc \ 684 ControlStruct/MLEMutator.cc \ 685 ControlStruct/Mutate.cc \ 686 GenPoly/GenPoly.cc \ 687 GenPoly/Lvalue.cc \ 688 InitTweak/GenInit.cc \ 689 InitTweak/InitTweak.cc \ 690 Parser/LinkageSpec.cc \ 691 ResolvExpr/AdjustExprType.cc \ 692 ResolvExpr/Alternative.cc \ 693 ResolvExpr/AlternativeFinder.cc \ 694 ResolvExpr/ExplodedActual.cc \ 695 ResolvExpr/CastCost.cc \ 696 ResolvExpr/CommonType.cc \ 697 ResolvExpr/ConversionCost.cc \ 698 ResolvExpr/CurrentObject.cc \ 699 ResolvExpr/FindOpenVars.cc \ 700 ResolvExpr/Occurs.cc \ 701 ResolvExpr/PolyCost.cc \ 702 ResolvExpr/PtrsAssignable.cc \ 703 ResolvExpr/PtrsCastable.cc \ 704 ResolvExpr/RenameVars.cc \ 705 ResolvExpr/ResolveAssertions.cc \ 706 ResolvExpr/Resolver.cc \ 707 ResolvExpr/ResolveTypeof.cc \ 708 ResolvExpr/SpecCost.cc \ 709 ResolvExpr/TypeEnvironment.cc \ 710 ResolvExpr/Unify.cc \ 711 SymTab/Autogen.cc \ 712 SymTab/FixFunction.cc \ 713 SymTab/Indexer.cc \ 714 SymTab/Mangler.cc \ 715 SymTab/Validate.cc \ 716 Tuples/Explode.cc \ 717 Tuples/TupleAssignment.cc \ 718 Tuples/TupleExpansion.cc \ 719 Validate/HandleAttributes.cc 720 660 721 all: $(BUILT_SOURCES) 661 722 $(MAKE) $(AM_MAKEFLAGS) all-am … … 696 757 clean-noinstLIBRARIES: 697 758 -test -z "$(noinst_LIBRARIES)" || rm -f $(noinst_LIBRARIES) 759 SymTab/$(am__dirstamp): 760 @$(MKDIR_P) SymTab 761 @: > SymTab/$(am__dirstamp) 762 SymTab/$(DEPDIR)/$(am__dirstamp): 763 @$(MKDIR_P) SymTab/$(DEPDIR) 764 @: > SymTab/$(DEPDIR)/$(am__dirstamp) 765 SymTab/Demangle.$(OBJEXT): SymTab/$(am__dirstamp) \ 766 SymTab/$(DEPDIR)/$(am__dirstamp) 767 SymTab/ManglerCommon.$(OBJEXT): SymTab/$(am__dirstamp) \ 768 SymTab/$(DEPDIR)/$(am__dirstamp) 769 SynTree/$(am__dirstamp): 770 @$(MKDIR_P) SynTree 771 @: > SynTree/$(am__dirstamp) 772 SynTree/$(DEPDIR)/$(am__dirstamp): 773 @$(MKDIR_P) SynTree/$(DEPDIR) 774 @: > SynTree/$(DEPDIR)/$(am__dirstamp) 775 SynTree/Type.$(OBJEXT): SynTree/$(am__dirstamp) \ 776 SynTree/$(DEPDIR)/$(am__dirstamp) 777 SynTree/VoidType.$(OBJEXT): SynTree/$(am__dirstamp) \ 778 SynTree/$(DEPDIR)/$(am__dirstamp) 779 SynTree/BasicType.$(OBJEXT): SynTree/$(am__dirstamp) \ 780 SynTree/$(DEPDIR)/$(am__dirstamp) 781 SynTree/PointerType.$(OBJEXT): SynTree/$(am__dirstamp) \ 782 SynTree/$(DEPDIR)/$(am__dirstamp) 783 SynTree/ArrayType.$(OBJEXT): SynTree/$(am__dirstamp) \ 784 SynTree/$(DEPDIR)/$(am__dirstamp) 785 SynTree/ReferenceType.$(OBJEXT): SynTree/$(am__dirstamp) \ 786 SynTree/$(DEPDIR)/$(am__dirstamp) 787 SynTree/FunctionType.$(OBJEXT): SynTree/$(am__dirstamp) \ 788 SynTree/$(DEPDIR)/$(am__dirstamp) 789 SynTree/ReferenceToType.$(OBJEXT): SynTree/$(am__dirstamp) \ 790 SynTree/$(DEPDIR)/$(am__dirstamp) 791 SynTree/TupleType.$(OBJEXT): SynTree/$(am__dirstamp) \ 792 SynTree/$(DEPDIR)/$(am__dirstamp) 793 SynTree/TypeofType.$(OBJEXT): SynTree/$(am__dirstamp) \ 794 SynTree/$(DEPDIR)/$(am__dirstamp) 795 SynTree/AttrType.$(OBJEXT): SynTree/$(am__dirstamp) \ 796 SynTree/$(DEPDIR)/$(am__dirstamp) 797 SynTree/VarArgsType.$(OBJEXT): SynTree/$(am__dirstamp) \ 798 SynTree/$(DEPDIR)/$(am__dirstamp) 799 SynTree/ZeroOneType.$(OBJEXT): SynTree/$(am__dirstamp) \ 800 SynTree/$(DEPDIR)/$(am__dirstamp) 801 SynTree/Constant.$(OBJEXT): SynTree/$(am__dirstamp) \ 802 SynTree/$(DEPDIR)/$(am__dirstamp) 803 SynTree/Expression.$(OBJEXT): SynTree/$(am__dirstamp) \ 804 SynTree/$(DEPDIR)/$(am__dirstamp) 805 SynTree/TupleExpr.$(OBJEXT): SynTree/$(am__dirstamp) \ 806 SynTree/$(DEPDIR)/$(am__dirstamp) 807 SynTree/CommaExpr.$(OBJEXT): SynTree/$(am__dirstamp) \ 808 SynTree/$(DEPDIR)/$(am__dirstamp) 809 SynTree/TypeExpr.$(OBJEXT): SynTree/$(am__dirstamp) \ 810 SynTree/$(DEPDIR)/$(am__dirstamp) 811 SynTree/ApplicationExpr.$(OBJEXT): SynTree/$(am__dirstamp) \ 812 SynTree/$(DEPDIR)/$(am__dirstamp) 813 SynTree/AddressExpr.$(OBJEXT): SynTree/$(am__dirstamp) \ 814 SynTree/$(DEPDIR)/$(am__dirstamp) 815 SynTree/Statement.$(OBJEXT): SynTree/$(am__dirstamp) \ 816 SynTree/$(DEPDIR)/$(am__dirstamp) 817 SynTree/CompoundStmt.$(OBJEXT): SynTree/$(am__dirstamp) \ 818 SynTree/$(DEPDIR)/$(am__dirstamp) 819 SynTree/DeclStmt.$(OBJEXT): SynTree/$(am__dirstamp) \ 820 SynTree/$(DEPDIR)/$(am__dirstamp) 821 SynTree/Declaration.$(OBJEXT): SynTree/$(am__dirstamp) \ 822 SynTree/$(DEPDIR)/$(am__dirstamp) 823 SynTree/DeclarationWithType.$(OBJEXT): SynTree/$(am__dirstamp) \ 824 SynTree/$(DEPDIR)/$(am__dirstamp) 825 SynTree/ObjectDecl.$(OBJEXT): SynTree/$(am__dirstamp) \ 826 SynTree/$(DEPDIR)/$(am__dirstamp) 827 SynTree/FunctionDecl.$(OBJEXT): SynTree/$(am__dirstamp) \ 828 SynTree/$(DEPDIR)/$(am__dirstamp) 829 SynTree/AggregateDecl.$(OBJEXT): SynTree/$(am__dirstamp) \ 830 SynTree/$(DEPDIR)/$(am__dirstamp) 831 SynTree/NamedTypeDecl.$(OBJEXT): SynTree/$(am__dirstamp) \ 832 SynTree/$(DEPDIR)/$(am__dirstamp) 833 SynTree/TypeDecl.$(OBJEXT): SynTree/$(am__dirstamp) \ 834 SynTree/$(DEPDIR)/$(am__dirstamp) 835 SynTree/Initializer.$(OBJEXT): SynTree/$(am__dirstamp) \ 836 SynTree/$(DEPDIR)/$(am__dirstamp) 837 SynTree/TypeSubstitution.$(OBJEXT): SynTree/$(am__dirstamp) \ 838 SynTree/$(DEPDIR)/$(am__dirstamp) 839 SynTree/Attribute.$(OBJEXT): SynTree/$(am__dirstamp) \ 840 SynTree/$(DEPDIR)/$(am__dirstamp) 841 SynTree/DeclReplacer.$(OBJEXT): SynTree/$(am__dirstamp) \ 842 SynTree/$(DEPDIR)/$(am__dirstamp) 698 843 CodeGen/$(am__dirstamp): 699 844 @$(MKDIR_P) CodeGen … … 710 855 CodeGen/OperatorTable.$(OBJEXT): CodeGen/$(am__dirstamp) \ 711 856 CodeGen/$(DEPDIR)/$(am__dirstamp) 712 Concurrency/$(am__dirstamp):713 @$(MKDIR_P) Concurrency714 @: > Concurrency/$(am__dirstamp)715 Concurrency/$(DEPDIR)/$(am__dirstamp):716 @$(MKDIR_P) Concurrency/$(DEPDIR)717 @: > Concurrency/$(DEPDIR)/$(am__dirstamp)718 Concurrency/Keywords.$(OBJEXT): Concurrency/$(am__dirstamp) \719 Concurrency/$(DEPDIR)/$(am__dirstamp)720 857 Common/$(am__dirstamp): 721 858 @$(MKDIR_P) Common … … 728 865 Common/Eval.$(OBJEXT): Common/$(am__dirstamp) \ 729 866 Common/$(DEPDIR)/$(am__dirstamp) 730 Common/PassVisitor.$(OBJEXT): Common/$(am__dirstamp) \731 Common/$(DEPDIR)/$(am__dirstamp)732 867 Common/SemanticError.$(OBJEXT): Common/$(am__dirstamp) \ 733 868 Common/$(DEPDIR)/$(am__dirstamp) 734 Common/Stats/$(am__dirstamp):735 @$(MKDIR_P) Common/Stats736 @: > Common/Stats/$(am__dirstamp)737 Common/Stats/$(DEPDIR)/$(am__dirstamp):738 @$(MKDIR_P) Common/Stats/$(DEPDIR)739 @: > Common/Stats/$(DEPDIR)/$(am__dirstamp)740 Common/Stats/Counter.$(OBJEXT): Common/Stats/$(am__dirstamp) \741 Common/Stats/$(DEPDIR)/$(am__dirstamp)742 Common/Stats/Heap.$(OBJEXT): Common/Stats/$(am__dirstamp) \743 Common/Stats/$(DEPDIR)/$(am__dirstamp)744 Common/Stats/Stats.$(OBJEXT): Common/Stats/$(am__dirstamp) \745 Common/Stats/$(DEPDIR)/$(am__dirstamp)746 Common/Stats/Time.$(OBJEXT): Common/Stats/$(am__dirstamp) \747 Common/Stats/$(DEPDIR)/$(am__dirstamp)748 869 Common/UniqueName.$(OBJEXT): Common/$(am__dirstamp) \ 749 870 Common/$(DEPDIR)/$(am__dirstamp) 871 Concurrency/$(am__dirstamp): 872 @$(MKDIR_P) Concurrency 873 @: > Concurrency/$(am__dirstamp) 874 Concurrency/$(DEPDIR)/$(am__dirstamp): 875 @$(MKDIR_P) Concurrency/$(DEPDIR) 876 @: > Concurrency/$(DEPDIR)/$(am__dirstamp) 877 Concurrency/Keywords.$(OBJEXT): Concurrency/$(am__dirstamp) \ 878 Concurrency/$(DEPDIR)/$(am__dirstamp) 750 879 ControlStruct/$(am__dirstamp): 751 880 @$(MKDIR_P) ControlStruct … … 804 933 ResolvExpr/AlternativeFinder.$(OBJEXT): ResolvExpr/$(am__dirstamp) \ 805 934 ResolvExpr/$(DEPDIR)/$(am__dirstamp) 935 ResolvExpr/ExplodedActual.$(OBJEXT): ResolvExpr/$(am__dirstamp) \ 936 ResolvExpr/$(DEPDIR)/$(am__dirstamp) 806 937 ResolvExpr/CastCost.$(OBJEXT): ResolvExpr/$(am__dirstamp) \ 807 938 ResolvExpr/$(DEPDIR)/$(am__dirstamp) … … 812 943 ResolvExpr/CurrentObject.$(OBJEXT): ResolvExpr/$(am__dirstamp) \ 813 944 ResolvExpr/$(DEPDIR)/$(am__dirstamp) 814 ResolvExpr/ExplodedActual.$(OBJEXT): ResolvExpr/$(am__dirstamp) \815 ResolvExpr/$(DEPDIR)/$(am__dirstamp)816 945 ResolvExpr/FindOpenVars.$(OBJEXT): ResolvExpr/$(am__dirstamp) \ 817 946 ResolvExpr/$(DEPDIR)/$(am__dirstamp) … … 838 967 ResolvExpr/Unify.$(OBJEXT): ResolvExpr/$(am__dirstamp) \ 839 968 ResolvExpr/$(DEPDIR)/$(am__dirstamp) 840 SymTab/$(am__dirstamp):841 @$(MKDIR_P) SymTab842 @: > SymTab/$(am__dirstamp)843 SymTab/$(DEPDIR)/$(am__dirstamp):844 @$(MKDIR_P) SymTab/$(DEPDIR)845 @: > SymTab/$(DEPDIR)/$(am__dirstamp)846 969 SymTab/Autogen.$(OBJEXT): SymTab/$(am__dirstamp) \ 847 970 SymTab/$(DEPDIR)/$(am__dirstamp) … … 852 975 SymTab/Mangler.$(OBJEXT): SymTab/$(am__dirstamp) \ 853 976 SymTab/$(DEPDIR)/$(am__dirstamp) 854 SymTab/ManglerCommon.$(OBJEXT): SymTab/$(am__dirstamp) \855 SymTab/$(DEPDIR)/$(am__dirstamp)856 977 SymTab/Validate.$(OBJEXT): SymTab/$(am__dirstamp) \ 857 978 SymTab/$(DEPDIR)/$(am__dirstamp) 858 SymTab/Demangle.$(OBJEXT): SymTab/$(am__dirstamp) \859 SymTab/$(DEPDIR)/$(am__dirstamp)860 SynTree/$(am__dirstamp):861 @$(MKDIR_P) SynTree862 @: > SynTree/$(am__dirstamp)863 SynTree/$(DEPDIR)/$(am__dirstamp):864 @$(MKDIR_P) SynTree/$(DEPDIR)865 @: > SynTree/$(DEPDIR)/$(am__dirstamp)866 SynTree/Type.$(OBJEXT): SynTree/$(am__dirstamp) \867 SynTree/$(DEPDIR)/$(am__dirstamp)868 SynTree/VoidType.$(OBJEXT): SynTree/$(am__dirstamp) \869 SynTree/$(DEPDIR)/$(am__dirstamp)870 SynTree/BasicType.$(OBJEXT): SynTree/$(am__dirstamp) \871 SynTree/$(DEPDIR)/$(am__dirstamp)872 SynTree/PointerType.$(OBJEXT): SynTree/$(am__dirstamp) \873 SynTree/$(DEPDIR)/$(am__dirstamp)874 SynTree/ArrayType.$(OBJEXT): SynTree/$(am__dirstamp) \875 SynTree/$(DEPDIR)/$(am__dirstamp)876 SynTree/ReferenceType.$(OBJEXT): SynTree/$(am__dirstamp) \877 SynTree/$(DEPDIR)/$(am__dirstamp)878 SynTree/FunctionType.$(OBJEXT): SynTree/$(am__dirstamp) \879 SynTree/$(DEPDIR)/$(am__dirstamp)880 SynTree/ReferenceToType.$(OBJEXT): SynTree/$(am__dirstamp) \881 SynTree/$(DEPDIR)/$(am__dirstamp)882 SynTree/TupleType.$(OBJEXT): SynTree/$(am__dirstamp) \883 SynTree/$(DEPDIR)/$(am__dirstamp)884 SynTree/TypeofType.$(OBJEXT): SynTree/$(am__dirstamp) \885 SynTree/$(DEPDIR)/$(am__dirstamp)886 SynTree/AttrType.$(OBJEXT): SynTree/$(am__dirstamp) \887 SynTree/$(DEPDIR)/$(am__dirstamp)888 SynTree/VarArgsType.$(OBJEXT): SynTree/$(am__dirstamp) \889 SynTree/$(DEPDIR)/$(am__dirstamp)890 SynTree/ZeroOneType.$(OBJEXT): SynTree/$(am__dirstamp) \891 SynTree/$(DEPDIR)/$(am__dirstamp)892 SynTree/Constant.$(OBJEXT): SynTree/$(am__dirstamp) \893 SynTree/$(DEPDIR)/$(am__dirstamp)894 SynTree/Expression.$(OBJEXT): SynTree/$(am__dirstamp) \895 SynTree/$(DEPDIR)/$(am__dirstamp)896 SynTree/TupleExpr.$(OBJEXT): SynTree/$(am__dirstamp) \897 SynTree/$(DEPDIR)/$(am__dirstamp)898 SynTree/CommaExpr.$(OBJEXT): SynTree/$(am__dirstamp) \899 SynTree/$(DEPDIR)/$(am__dirstamp)900 SynTree/TypeExpr.$(OBJEXT): SynTree/$(am__dirstamp) \901 SynTree/$(DEPDIR)/$(am__dirstamp)902 SynTree/ApplicationExpr.$(OBJEXT): SynTree/$(am__dirstamp) \903 SynTree/$(DEPDIR)/$(am__dirstamp)904 SynTree/AddressExpr.$(OBJEXT): SynTree/$(am__dirstamp) \905 SynTree/$(DEPDIR)/$(am__dirstamp)906 SynTree/Statement.$(OBJEXT): SynTree/$(am__dirstamp) \907 SynTree/$(DEPDIR)/$(am__dirstamp)908 SynTree/CompoundStmt.$(OBJEXT): SynTree/$(am__dirstamp) \909 SynTree/$(DEPDIR)/$(am__dirstamp)910 SynTree/DeclStmt.$(OBJEXT): SynTree/$(am__dirstamp) \911 SynTree/$(DEPDIR)/$(am__dirstamp)912 SynTree/Declaration.$(OBJEXT): SynTree/$(am__dirstamp) \913 SynTree/$(DEPDIR)/$(am__dirstamp)914 SynTree/DeclarationWithType.$(OBJEXT): SynTree/$(am__dirstamp) \915 SynTree/$(DEPDIR)/$(am__dirstamp)916 SynTree/ObjectDecl.$(OBJEXT): SynTree/$(am__dirstamp) \917 SynTree/$(DEPDIR)/$(am__dirstamp)918 SynTree/FunctionDecl.$(OBJEXT): SynTree/$(am__dirstamp) \919 SynTree/$(DEPDIR)/$(am__dirstamp)920 SynTree/AggregateDecl.$(OBJEXT): SynTree/$(am__dirstamp) \921 SynTree/$(DEPDIR)/$(am__dirstamp)922 SynTree/NamedTypeDecl.$(OBJEXT): SynTree/$(am__dirstamp) \923 SynTree/$(DEPDIR)/$(am__dirstamp)924 SynTree/TypeDecl.$(OBJEXT): SynTree/$(am__dirstamp) \925 SynTree/$(DEPDIR)/$(am__dirstamp)926 SynTree/Initializer.$(OBJEXT): SynTree/$(am__dirstamp) \927 SynTree/$(DEPDIR)/$(am__dirstamp)928 SynTree/TypeSubstitution.$(OBJEXT): SynTree/$(am__dirstamp) \929 SynTree/$(DEPDIR)/$(am__dirstamp)930 SynTree/Attribute.$(OBJEXT): SynTree/$(am__dirstamp) \931 SynTree/$(DEPDIR)/$(am__dirstamp)932 SynTree/DeclReplacer.$(OBJEXT): SynTree/$(am__dirstamp) \933 SynTree/$(DEPDIR)/$(am__dirstamp)934 979 Tuples/$(am__dirstamp): 935 980 @$(MKDIR_P) Tuples … … 938 983 @$(MKDIR_P) Tuples/$(DEPDIR) 939 984 @: > Tuples/$(DEPDIR)/$(am__dirstamp) 985 Tuples/Explode.$(OBJEXT): Tuples/$(am__dirstamp) \ 986 Tuples/$(DEPDIR)/$(am__dirstamp) 940 987 Tuples/TupleAssignment.$(OBJEXT): Tuples/$(am__dirstamp) \ 941 988 Tuples/$(DEPDIR)/$(am__dirstamp) 942 989 Tuples/TupleExpansion.$(OBJEXT): Tuples/$(am__dirstamp) \ 943 Tuples/$(DEPDIR)/$(am__dirstamp)944 Tuples/Explode.$(OBJEXT): Tuples/$(am__dirstamp) \945 990 Tuples/$(DEPDIR)/$(am__dirstamp) 946 991 Validate/$(am__dirstamp): … … 1025 1070 Concurrency/$(DEPDIR)/$(am__dirstamp) 1026 1071 Common/DebugMalloc.$(OBJEXT): Common/$(am__dirstamp) \ 1072 Common/$(DEPDIR)/$(am__dirstamp) 1073 Common/Heap.$(OBJEXT): Common/$(am__dirstamp) \ 1027 1074 Common/$(DEPDIR)/$(am__dirstamp) 1028 1075 ControlStruct/ExceptTranslate.$(OBJEXT): \ … … 1095 1142 -rm -f CodeTools/*.$(OBJEXT) 1096 1143 -rm -f Common/*.$(OBJEXT) 1097 -rm -f Common/Stats/*.$(OBJEXT)1098 1144 -rm -f Concurrency/*.$(OBJEXT) 1099 1145 -rm -f ControlStruct/*.$(OBJEXT) … … 1126 1172 @AMDEP_TRUE@@am__include@ @am__quote@Common/$(DEPDIR)/DebugMalloc.Po@am__quote@ 1127 1173 @AMDEP_TRUE@@am__include@ @am__quote@Common/$(DEPDIR)/Eval.Po@am__quote@ 1128 @AMDEP_TRUE@@am__include@ @am__quote@Common/$(DEPDIR)/ PassVisitor.Po@am__quote@1174 @AMDEP_TRUE@@am__include@ @am__quote@Common/$(DEPDIR)/Heap.Po@am__quote@ 1129 1175 @AMDEP_TRUE@@am__include@ @am__quote@Common/$(DEPDIR)/SemanticError.Po@am__quote@ 1130 1176 @AMDEP_TRUE@@am__include@ @am__quote@Common/$(DEPDIR)/UniqueName.Po@am__quote@ 1131 @AMDEP_TRUE@@am__include@ @am__quote@Common/Stats/$(DEPDIR)/Counter.Po@am__quote@1132 @AMDEP_TRUE@@am__include@ @am__quote@Common/Stats/$(DEPDIR)/Heap.Po@am__quote@1133 @AMDEP_TRUE@@am__include@ @am__quote@Common/Stats/$(DEPDIR)/Stats.Po@am__quote@1134 @AMDEP_TRUE@@am__include@ @am__quote@Common/Stats/$(DEPDIR)/Time.Po@am__quote@1135 1177 @AMDEP_TRUE@@am__include@ @am__quote@Concurrency/$(DEPDIR)/Keywords.Po@am__quote@ 1136 1178 @AMDEP_TRUE@@am__include@ @am__quote@Concurrency/$(DEPDIR)/Waitfor.Po@am__quote@ … … 1394 1436 -rm -f Common/$(DEPDIR)/$(am__dirstamp) 1395 1437 -rm -f Common/$(am__dirstamp) 1396 -rm -f Common/Stats/$(DEPDIR)/$(am__dirstamp)1397 -rm -f Common/Stats/$(am__dirstamp)1398 1438 -rm -f Concurrency/$(DEPDIR)/$(am__dirstamp) 1399 1439 -rm -f Concurrency/$(am__dirstamp) … … 1433 1473 1434 1474 distclean: distclean-am 1435 -rm -rf ./$(DEPDIR) CodeGen/$(DEPDIR) CodeTools/$(DEPDIR) Common/$(DEPDIR) Co mmon/Stats/$(DEPDIR) Concurrency/$(DEPDIR) ControlStruct/$(DEPDIR) GenPoly/$(DEPDIR) InitTweak/$(DEPDIR) Parser/$(DEPDIR) ResolvExpr/$(DEPDIR) SymTab/$(DEPDIR) SynTree/$(DEPDIR) Tuples/$(DEPDIR) Validate/$(DEPDIR) Virtual/$(DEPDIR)1475 -rm -rf ./$(DEPDIR) CodeGen/$(DEPDIR) CodeTools/$(DEPDIR) Common/$(DEPDIR) Concurrency/$(DEPDIR) ControlStruct/$(DEPDIR) GenPoly/$(DEPDIR) InitTweak/$(DEPDIR) Parser/$(DEPDIR) ResolvExpr/$(DEPDIR) SymTab/$(DEPDIR) SynTree/$(DEPDIR) Tuples/$(DEPDIR) Validate/$(DEPDIR) Virtual/$(DEPDIR) 1436 1476 -rm -f Makefile 1437 1477 distclean-am: clean-am distclean-compile distclean-generic \ … … 1479 1519 1480 1520 maintainer-clean: maintainer-clean-am 1481 -rm -rf ./$(DEPDIR) CodeGen/$(DEPDIR) CodeTools/$(DEPDIR) Common/$(DEPDIR) Co mmon/Stats/$(DEPDIR) Concurrency/$(DEPDIR) ControlStruct/$(DEPDIR) GenPoly/$(DEPDIR) InitTweak/$(DEPDIR) Parser/$(DEPDIR) ResolvExpr/$(DEPDIR) SymTab/$(DEPDIR) SynTree/$(DEPDIR) Tuples/$(DEPDIR) Validate/$(DEPDIR) Virtual/$(DEPDIR)1521 -rm -rf ./$(DEPDIR) CodeGen/$(DEPDIR) CodeTools/$(DEPDIR) Common/$(DEPDIR) Concurrency/$(DEPDIR) ControlStruct/$(DEPDIR) GenPoly/$(DEPDIR) InitTweak/$(DEPDIR) Parser/$(DEPDIR) ResolvExpr/$(DEPDIR) SymTab/$(DEPDIR) SynTree/$(DEPDIR) Tuples/$(DEPDIR) Validate/$(DEPDIR) Virtual/$(DEPDIR) 1482 1522 -rm -f Makefile 1483 1523 maintainer-clean-am: distclean-am maintainer-clean-generic … … 1519 1559 1520 1560 1521 $(addprefix $(srcdir)/, ResolvExpr/ConversionCost.cc ResolvExpr/CommonType.cc SymTab/ManglerCommon.cc) : $(srcdir)/SynTree/Type.h1522 1523 $(srcdir)/SynTree/Type.h : BasicTypes-gen.cc1524 ${AM_V_GEN}${CXXCOMPILE} $< -o BasicTypes-gen -Wall -Wextra1525 @./BasicTypes-gen1526 @rm BasicTypes-gen1527 1528 1561 # Tell versions [3.59,3.63) of GNU make to not export all variables. 1529 1562 # Otherwise a system limit (for SysV at least) may be exceeded. -
src/Parser/DeclarationNode.cc
r53bb8f1 r9d9a451 10 10 // Created On : Sat May 16 12:34:05 2015 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Fri Feb 1 16:49:17 201913 // Update Count : 11 1312 // Last Modified On : Thu Nov 1 20:54:26 2018 13 // Update Count : 1108 14 14 // 15 15 … … 41 41 42 42 // These must harmonize with the corresponding DeclarationNode enumerations. 43 const char * DeclarationNode::basicTypeNames[] = { "void", "_Bool", "char", "int", "int128", 44 "float", "double", "long double", "float80", "float128", 45 "_float16", "_float32", "_float32x", "_float64", "_float64x", "_float128", "_float128x", "NoBasicTypeNames" }; 46 const char * DeclarationNode::complexTypeNames[] = { "_Complex", "NoComplexTypeNames", "_Imaginary" }; // Imaginary unsupported => parse, but make invisible and print error message 43 const char * DeclarationNode::basicTypeNames[] = { "void", "_Bool", "char", "int", "float", "double", "long double", "int128", "float80", "float128", "NoBasicTypeNames" }; 44 const char * DeclarationNode::complexTypeNames[] = { "_Complex", "_Imaginary", "NoComplexTypeNames" }; 47 45 const char * DeclarationNode::signednessNames[] = { "signed", "unsigned", "NoSignednessNames" }; 48 46 const char * DeclarationNode::lengthNames[] = { "short", "long", "long long", "NoLengthNames" }; -
src/Parser/ExpressionNode.cc
r53bb8f1 r9d9a451 10 10 // Created On : Sat May 16 13:17:07 2015 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Sun Mar 10 16:10:32 201913 // Update Count : 97612 // Last Modified On : Mon Jun 4 21:24:45 2018 13 // Update Count : 802 14 14 // 15 15 … … 51 51 extern const Type::Qualifiers noQualifiers; // no qualifiers on constants 52 52 53 // static inline bool checkH( char c ) { return c == 'h' || c == 'H'; } 54 // static inline bool checkZ( char c ) { return c == 'z' || c == 'Z'; } 55 // static inline bool checkU( char c ) { return c == 'u' || c == 'U'; } 53 static inline bool checkH( char c ) { return c == 'h' || c == 'H'; } 54 static inline bool checkL( char c ) { return c == 'l' || c == 'L'; } 55 static inline bool checkZ( char c ) { return c == 'z' || c == 'Z'; } 56 static inline bool checkU( char c ) { return c == 'u' || c == 'U'; } 56 57 static inline bool checkF( char c ) { return c == 'f' || c == 'F'; } 57 58 static inline bool checkD( char c ) { return c == 'd' || c == 'D'; } 58 static inline bool checkF80( char c ) { return c == 'w' || c == 'W'; }59 static inline bool checkF128( char c ) { return c == 'q' || c == 'Q'; }60 static inline bool checkL( char c ) { return c == 'l' || c == 'L'; }61 59 static inline bool checkI( char c ) { return c == 'i' || c == 'I'; } 62 60 static inline bool checkB( char c ) { return c == 'b' || c == 'B'; } 63 61 static inline bool checkX( char c ) { return c == 'x' || c == 'X'; } 64 static inline bool checkN( char c ) { return c == 'n' || c == 'N'; } 65 66 void lnthSuffix( string & str, int & type, int & ltype ) { 67 string::size_type posn = str.find_last_of( "lL" ); 68 69 if ( posn == string::npos ) return; // no suffix 70 if ( posn == str.length() - 1 ) { type = 3; return; } // no length => long 71 72 string::size_type next = posn + 1; // advance to length 73 if ( str[next] == '3' ) { // 32 74 type = ltype = 2; 75 } else if ( str[next] == '6' ) { // 64 76 type = ltype = 3; 77 } else if ( str[next] == '8' ) { // 8 78 type = ltype = 1; 79 } else if ( str[next] == '1' ) { 80 if ( str[next + 1] == '6' ) { // 16 81 type = ltype = 0; 62 63 static const char * lnthsInt[2][6] = { 64 { "int8_t", "int16_t", "int32_t", "int64_t", "size_t", }, 65 { "uint8_t", "uint16_t", "uint32_t", "uint64_t", "size_t", } 66 }; // lnthsInt 67 68 static inline void checkLNInt( string & str, int & lnth, int & size ) { 69 string::size_type posn = str.find_first_of( "lL" ), start = posn; 70 if ( posn == string::npos ) return; 71 size = 4; // assume largest size 72 posn += 1; // advance to size 73 if ( str[posn] == '8' ) { // 8 74 lnth = 0; 75 } else if ( str[posn] == '1' ) { 76 posn += 1; 77 if ( str[posn] == '6' ) { // 16 78 lnth = 1; 82 79 } else { // 128 83 type = 5; ltype = 6; 84 } // if 85 } // if 86 // remove "lL" for these cases because it may not imply long 87 str.erase( posn ); // remove length 88 } // lnthSuffix 89 90 void valueToType( unsigned long long int & v, bool dec, int & type, bool & Unsigned ) { 91 // use value to determine type 92 if ( v <= INT_MAX ) { // signed int 93 type = 2; 94 } else if ( v <= UINT_MAX && ! dec ) { // unsigned int 95 type = 2; 96 Unsigned = true; // unsigned 97 } else if ( v <= LONG_MAX ) { // signed long int 98 type = 3; 99 } else if ( v <= ULONG_MAX && ( ! dec || LONG_MAX == LLONG_MAX ) ) { // signed long int 100 type = 3; 101 Unsigned = true; // unsigned long int 102 } else if ( v <= LLONG_MAX ) { // signed long long int 103 type = 4; 104 } else { // unsigned long long int 105 type = 4; 106 Unsigned = true; // unsigned long long int 107 } // if 108 } // valueToType 80 posn += 1; 81 lnth = 5; 82 } // if 83 } else { 84 if ( str[posn] == '3' ) { // 32 85 lnth = 2; 86 } else if ( str[posn] == '6' ) { // 64 87 lnth = 3; 88 } else { 89 assertf( false, "internal error, bad integral length %s", str.c_str() ); 90 } // if 91 posn += 1; 92 } // if 93 str.erase( start, posn - start + 1 ); // remove length suffix 94 } // checkLNInt 109 95 110 96 Expression * build_constantInteger( string & str ) { 111 static const BasicType::Kind kind[2][ 7] = {112 // short (h) must be before char (hh) because shorter type has the longer suffix97 static const BasicType::Kind kind[2][6] = { 98 // short (h) must be before char (hh) 113 99 { BasicType::ShortSignedInt, BasicType::SignedChar, BasicType::SignedInt, BasicType::LongSignedInt, BasicType::LongLongSignedInt, BasicType::SignedInt128, }, 114 100 { BasicType::ShortUnsignedInt, BasicType::UnsignedChar, BasicType::UnsignedInt, BasicType::LongUnsignedInt, BasicType::LongLongUnsignedInt, BasicType::UnsignedInt128, }, 115 101 }; 116 102 117 static const char * lnthsInt[2][6] = { 118 { "int16_t", "int8_t", "int32_t", "int64_t", "size_t", "uintptr_t", }, 119 { "uint16_t", "uint8_t", "uint32_t", "uint64_t", "size_t", "uintptr_t", }, 120 }; // lnthsInt 103 bool dec = true, Unsigned = false; // decimal, unsigned constant 104 int size; // 0 => short, 1 => char, 2 => int, 3 => long int, 4 => long long int, 5 => int128 105 int lnth = -1; // literal length 121 106 122 107 unsigned long long int v; // converted integral value 123 108 size_t last = str.length() - 1; // last subscript of constant 124 109 Expression * ret; 125 //string fred( str );126 127 int type = -1; // 0 => short, 1 => char, 2 => int, 3 => long int, 4 => long long int, 5 => int128128 int ltype = -1; // 0 => 16 bits, 1 => 8 bits, 2 => 32 bits, 3 => 64 bits, 4 => size_t, 5 => intptr, 6 => pointer129 bool dec = true, Unsigned = false; // decimal, unsigned constant130 110 131 111 // special constants … … 139 119 } // if 140 120 141 // Cannot be just "0"/"1"; sscanf stops at the suffix, if any; value goes over the wall => always generate121 // Cannot be "0" 142 122 143 123 if ( str[0] == '0' ) { // radix character ? … … 147 127 //printf( "%llx %llu\n", v, v ); 148 128 } else if ( checkB( str[1] ) ) { // binary constant ? 149 v = 0; // compute value150 for ( unsigned int i = 2;; ) { // ignore prefix129 v = 0; 130 for ( unsigned int i = 2;; i += 1 ) { // compute value 151 131 if ( str[i] == '1' ) v |= 1; 152 i += 1; 153 if ( i == last - 1 || (str[i] != '0' && str[i] != '1') ) break; 132 if ( i == last ) break; 154 133 v <<= 1; 155 134 } // for 156 //printf( "% #llx %llu\n", v, v );135 //printf( "%llx %llu\n", v, v ); 157 136 } else { // octal constant 158 137 sscanf( (char *)str.c_str(), "%llo", &v ); 159 //printf( "% #llo %llu\n", v, v );138 //printf( "%llo %llu\n", v, v ); 160 139 } // if 161 140 } else { // decimal constant ? 162 141 sscanf( (char *)str.c_str(), "%llu", &v ); 163 //printf( "%llu\n", v ); 164 } // if 165 166 string::size_type posn; 167 168 if ( isdigit( str[last] ) ) { // no suffix ? 169 lnthSuffix( str, type, ltype ); // could have length suffix 170 if ( type == -1 ) { // no suffix 171 valueToType( v, dec, type, Unsigned ); 172 } // if 173 } else { 174 // At least one digit in integer constant, so safe to backup while looking for suffix. 175 176 posn = str.find_last_of( "pP" ); 177 if ( posn != string::npos ) { valueToType( v, dec, type, Unsigned ); ltype = 5; str.erase( posn, 1 ); goto FINI; } 178 179 posn = str.find_last_of( "zZ" ); 180 if ( posn != string::npos ) { Unsigned = true; type = 2; ltype = 4; str.erase( posn, 1 ); goto FINI; } 181 182 // 'u' can appear before or after length suffix 183 if ( str.find_last_of( "uU" ) != string::npos ) Unsigned = true; 184 185 posn = str.rfind( "hh" ); 186 if ( posn != string::npos ) { type = 1; str.erase( posn, 2 ); goto FINI; } 187 188 posn = str.rfind( "HH" ); 189 if ( posn != string::npos ) { type = 1; str.erase( posn, 2 ); goto FINI; } 190 191 posn = str.find_last_of( "hH" ); 192 if ( posn != string::npos ) { type = 0; str.erase( posn, 1 ); goto FINI; } 193 194 posn = str.find_last_of( "nN" ); 195 if ( posn != string::npos ) { type = 2; str.erase( posn, 1 ); goto FINI; } 196 197 if ( str.rfind( "ll" ) != string::npos || str.rfind( "LL" ) != string::npos ) { type = 4; goto FINI; } 198 199 lnthSuffix( str, type, ltype ); // must be after check for "ll" 200 if ( type == -1 ) { // only 'u' suffix ? 201 valueToType( v, dec, type, Unsigned ); 202 } // if 203 FINI: ; 204 } // if 205 206 //if ( !( 0 <= type && type <= 6 ) ) { printf( "%s %lu %d %s\n", fred.c_str(), fred.length(), type, str.c_str() ); } 207 assert( 0 <= type && type <= 6 ); 208 142 //printf( "%llu %llu\n", v, v ); 143 } // if 144 145 if ( v <= INT_MAX ) { // signed int 146 size = 2; 147 } else if ( v <= UINT_MAX && ! dec ) { // unsigned int 148 size = 2; 149 Unsigned = true; // unsigned 150 } else if ( v <= LONG_MAX ) { // signed long int 151 size = 3; 152 } else if ( v <= ULONG_MAX && ( ! dec || LONG_MAX == LLONG_MAX ) ) { // signed long int 153 size = 3; 154 Unsigned = true; // unsigned long int 155 } else if ( v <= LLONG_MAX ) { // signed long long int 156 size = 4; 157 } else { // unsigned long long int 158 size = 4; 159 Unsigned = true; // unsigned long long int 160 } // if 161 162 // At least one digit in integer constant, so safe to backup while looking for suffix. 163 164 if ( checkU( str[last] ) ) { // suffix 'u' ? 165 Unsigned = true; 166 if ( checkL( str[last - 1] ) ) { // suffix 'l' ? 167 size = 3; 168 if ( checkL( str[last - 2] ) ) { // suffix "ll" ? 169 size = 4; 170 } // if 171 } else if ( checkH( str[last - 1] ) ) { // suffix 'h' ? 172 size = 0; 173 if ( checkH( str[last - 2] ) ) { // suffix "hh" ? 174 size = 1; 175 } // if 176 str.erase( last - size - 1, size + 1 ); // remove 'h'/"hh" 177 } else { // suffix "ln" ? 178 checkLNInt( str, lnth, size ); 179 } // if 180 } else if ( checkL( str[ last ] ) ) { // suffix 'l' ? 181 size = 3; 182 if ( checkL( str[last - 1] ) ) { // suffix 'll' ? 183 size = 4; 184 if ( checkU( str[last - 2] ) ) { // suffix 'u' ? 185 Unsigned = true; 186 } // if 187 } else if ( checkU( str[last - 1] ) ) { // suffix 'u' ? 188 Unsigned = true; 189 } // if 190 } else if ( checkH( str[ last ] ) ) { // suffix 'h' ? 191 size = 0; 192 if ( checkH( str[last - 1] ) ) { // suffix "hh" ? 193 size = 1; 194 if ( checkU( str[last - 2] ) ) { // suffix 'u' ? 195 Unsigned = true; 196 } // if 197 } else if ( checkU( str[last - 1] ) ) { // suffix 'u' ? 198 Unsigned = true; 199 } // if 200 str.erase( last - size, size + 1 ); // remove 'h'/"hh" 201 } else if ( checkZ( str[last] ) ) { // suffix 'z' ? 202 lnth = 4; 203 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 209 // Constant type is correct for overload resolving. 210 ret = new ConstantExpr( Constant( new BasicType( noQualifiers, kind[Unsigned][ type] ), str, v ) );211 if ( Unsigned && type < 2 ) { // hh or h, less than int ?210 ret = new ConstantExpr( Constant( new BasicType( noQualifiers, kind[Unsigned][size] ), str, v ) ); 211 if ( Unsigned && size < 2 ) { // hh or h, less than int ? 212 212 // int i = -1uh => 65535 not -1, so cast is necessary for unsigned, which unfortunately eliminates warnings for large values. 213 ret = new CastExpr( ret, new BasicType( Type::Qualifiers(), kind[Unsigned][type] ), false ); 214 } else if ( ltype != -1 ) { // explicit length ? 215 if ( ltype == 6 ) { // int128, (int128)constant 216 ret = new CastExpr( ret, new BasicType( Type::Qualifiers(), kind[Unsigned][type] ), false ); 217 } else { // explicit length, (length_type)constant 218 ret = new CastExpr( ret, new TypeInstType( Type::Qualifiers(), lnthsInt[Unsigned][ltype], false ), false ); 219 if ( ltype == 5 ) { // pointer, intptr( (uintptr_t)constant ) 220 ret = build_func( new ExpressionNode( build_varref( new string( "intptr" ) ) ), new ExpressionNode( ret ) ); 221 } // if 222 } // if 223 } // if 224 225 CLEANUP: ; 213 ret = new CastExpr( ret, new BasicType( Type::Qualifiers(), kind[Unsigned][size] ), false ); 214 } else if ( lnth != -1 ) { // explicit length ? 215 if ( lnth == 5 ) { // int128 ? 216 size = 5; 217 ret = new CastExpr( ret, new BasicType( Type::Qualifiers(), kind[Unsigned][size] ), false ); 218 } else { 219 ret = new CastExpr( ret, new TypeInstType( Type::Qualifiers(), lnthsInt[Unsigned][lnth], false ), false ); 220 } // if 221 } // if 222 CLEANUP: 223 226 224 delete &str; // created by lex 227 225 return ret; … … 229 227 230 228 231 static inline void checkFnxFloat( string & str, size_t last, bool & explnth, int & type ) { 232 string::size_type posn; 233 // floating-point constant has minimum of 2 characters, 1. or .1, so safe to look ahead 234 if ( str[1] == 'x' ) { // hex ? 235 posn = str.find_last_of( "pP" ); // back for exponent (must have) 236 posn = str.find_first_of( "fF", posn + 1 ); // forward for size (fF allowed in hex constant) 237 } else { 238 posn = str.find_last_of( "fF" ); // back for size (fF not allowed) 239 } // if 229 static inline void checkLNFloat( string & str, int & lnth, int & size ) { 230 string::size_type posn = str.find_first_of( "lL" ), start = posn; 240 231 if ( posn == string::npos ) return; 241 explnth = true; 232 size = 2; // assume largest size 233 lnth = 0; 242 234 posn += 1; // advance to size 243 235 if ( str[posn] == '3' ) { // 32 244 if ( str[last] != 'x' ) type = 6; 245 else type = 7; 236 size = 0; 246 237 } else if ( str[posn] == '6' ) { // 64 247 if ( str[last] != 'x' ) type = 8; 248 else type = 9; 249 } else if ( str[posn] == '8' ) { // 80 250 type = 3; 251 } else if ( str[posn] == '1' ) { // 16/128 252 if ( str[posn + 1] == '6' ) { // 16 253 type = 5; 254 } else { // 128 255 if ( str[last] != 'x' ) type = 10; 256 else type = 11; 257 } // if 238 size = 1; 239 } else if ( str[posn] == '8' || str[posn] == '1' ) { // 80, 128 240 size = 2; 241 if ( str[posn] == '1' ) posn += 1; 258 242 } else { 259 243 assertf( false, "internal error, bad floating point length %s", str.c_str() ); 260 244 } // if 261 } // checkFnxFloat 245 posn += 1; 246 str.erase( start, posn - start + 1 ); // remove length suffix 247 } // checkLNFloat 262 248 263 249 264 250 Expression * build_constantFloat( string & str ) { 265 static const BasicType::Kind kind[2][ 12] = {266 { BasicType::Float, BasicType::Double, BasicType::LongDouble , BasicType::uuFloat80, BasicType::uuFloat128, BasicType::uFloat16, BasicType::uFloat32, BasicType::uFloat32x, BasicType::uFloat64, BasicType::uFloat64x, BasicType::uFloat128, BasicType::uFloat128x},267 { BasicType::FloatComplex, BasicType::DoubleComplex, BasicType::LongDoubleComplex , (BasicType::Kind)-1, (BasicType::Kind)-1, BasicType::uFloat16Complex, BasicType::uFloat32Complex, BasicType::uFloat32xComplex, BasicType::uFloat64Complex, BasicType::uFloat64xComplex, BasicType::uFloat128Complex, BasicType::uFloat128xComplex},251 static const BasicType::Kind kind[2][3] = { 252 { BasicType::Float, BasicType::Double, BasicType::LongDouble }, 253 { BasicType::FloatComplex, BasicType::DoubleComplex, BasicType::LongDoubleComplex }, 268 254 }; 269 255 270 // floating-point constant has minimum of 2 characters 1. or .1 256 bool complx = false; // real, complex 257 int size = 1; // 0 => float, 1 => double, 2 => long double 258 int lnth = -1; // literal length 259 // floating-point constant has minimum of 2 characters: 1. or .1 271 260 size_t last = str.length() - 1; 272 261 double v; 273 int type; // 0 => float, 1 => double, 3 => long double, ...274 bool complx = false; // real, complex275 bool explnth = false; // explicit literal length276 262 277 263 sscanf( str.c_str(), "%lg", &v ); … … 283 269 284 270 if ( checkF( str[last] ) ) { // float ? 285 type = 0;271 size = 0; 286 272 } else if ( checkD( str[last] ) ) { // double ? 287 type = 1;273 size = 1; 288 274 } else if ( checkL( str[last] ) ) { // long double ? 289 type = 2; 290 } else if ( checkF80( str[last] ) ) { // __float80 ? 291 type = 3; 292 } else if ( checkF128( str[last] ) ) { // __float128 ? 293 type = 4; 275 size = 2; 294 276 } else { 295 type = 1; // double (default if no suffix) 296 checkFnxFloat( str, last, explnth, type ); 297 } // if 298 277 size = 1; // double (default) 278 checkLNFloat( str, lnth, size ); 279 } // if 299 280 if ( ! complx && checkI( str[last - 1] ) ) { // imaginary ? 300 281 complx = true; 301 282 } // if 302 283 303 assert( 0 <= type && type < 12);304 Expression * ret = new ConstantExpr( Constant( new BasicType( noQualifiers, kind[complx][ type] ), str, v ) );305 if ( explnth) { // explicit length ?306 ret = new CastExpr( ret, new BasicType( Type::Qualifiers(), kind[complx][ type] ), false );284 assert( 0 <= size && size < 3 ); 285 Expression * ret = new ConstantExpr( Constant( new BasicType( noQualifiers, kind[complx][size] ), str, v ) ); 286 if ( lnth != -1 ) { // explicit length ? 287 ret = new CastExpr( ret, new BasicType( Type::Qualifiers(), kind[complx][size] ), false ); 307 288 } // if 308 289 -
src/Parser/ParseNode.h
r53bb8f1 r9d9a451 10 10 // Created On : Sat May 16 13:28:16 2015 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Wed Feb 13 17:36:49 201913 // Update Count : 8 6712 // Last Modified On : Thu Nov 1 20:54:53 2018 13 // Update Count : 854 14 14 // 15 15 … … 206 206 class DeclarationNode : public ParseNode { 207 207 public: 208 // These enumerations must harmonize with their names in DeclarationNode.cc. 209 enum BasicType { Void, Bool, Char, Int, Int128, 210 Float, Double, LongDouble, uuFloat80, uuFloat128, 211 uFloat16, uFloat32, uFloat32x, uFloat64, uFloat64x, uFloat128, uFloat128x, NoBasicType }; 208 // These enumerations must harmonize with their names. 209 enum BasicType { Void, Bool, Char, Int, Float, Double, LongDouble, Int128, Float80, Float128, NoBasicType }; 212 210 static const char * basicTypeNames[]; 213 enum ComplexType { Complex, NoComplexType, Imaginary }; // Imaginary unsupported => parse, but make invisible and print error message211 enum ComplexType { Complex, Imaginary, NoComplexType }; 214 212 static const char * complexTypeNames[]; 215 213 enum Signedness { Signed, Unsigned, NoSignedness }; -
src/Parser/TypeData.cc
r53bb8f1 r9d9a451 10 10 // Created On : Sat May 16 15:12:51 2015 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Wed Feb 13 18:16:23 201913 // Update Count : 6 4912 // Last Modified On : Fri Nov 2 07:54:26 2018 13 // Update Count : 624 14 14 // 15 15 … … 666 666 667 667 case DeclarationNode::Float: 668 case DeclarationNode::Float80: 669 case DeclarationNode::Float128: 668 670 case DeclarationNode::Double: 669 671 case DeclarationNode::LongDouble: // not set until below 670 case DeclarationNode::uuFloat80: 671 case DeclarationNode::uuFloat128: 672 case DeclarationNode::uFloat16: 673 case DeclarationNode::uFloat32: 674 case DeclarationNode::uFloat32x: 675 case DeclarationNode::uFloat64: 676 case DeclarationNode::uFloat64x: 677 case DeclarationNode::uFloat128: 678 case DeclarationNode::uFloat128x: 679 static BasicType::Kind floattype[2][12] = { 680 { BasicType::FloatComplex, BasicType::DoubleComplex, BasicType::LongDoubleComplex, (BasicType::Kind)-1, (BasicType::Kind)-1, BasicType::uFloat16Complex, BasicType::uFloat32Complex, BasicType::uFloat32xComplex, BasicType::uFloat64Complex, BasicType::uFloat64xComplex, BasicType::uFloat128Complex, BasicType::uFloat128xComplex, }, 681 { BasicType::Float, BasicType::Double, BasicType::LongDouble, BasicType::uuFloat80, BasicType::uuFloat128, BasicType::uFloat16, BasicType::uFloat32, BasicType::uFloat32x, BasicType::uFloat64, BasicType::uFloat64x, BasicType::uFloat128, BasicType::uFloat128x, }, 672 static BasicType::Kind floattype[3][3] = { 673 { BasicType::FloatComplex, BasicType::DoubleComplex, BasicType::LongDoubleComplex }, 674 { BasicType::FloatImaginary, BasicType::DoubleImaginary, BasicType::LongDoubleImaginary }, 675 { BasicType::Float, BasicType::Double, BasicType::LongDouble }, 682 676 }; 683 677 … … 692 686 genTSError( DeclarationNode::lengthNames[ td->length ], td->basictype ); 693 687 } // if 694 if ( td->complextype == DeclarationNode::Imaginary ) {695 genTSError( DeclarationNode::complexTypeNames[ td->complextype ], td->basictype );696 } // if697 if ( (td->basictype == DeclarationNode::uuFloat80 || td->basictype == DeclarationNode::uuFloat128) && td->complextype == DeclarationNode::Complex ) { // gcc unsupported698 genTSError( DeclarationNode::complexTypeNames[ td->complextype ], td->basictype );699 } // if700 688 if ( td->length == DeclarationNode::Long ) { 701 689 const_cast<TypeData *>(td)->basictype = DeclarationNode::LongDouble; 702 690 } // if 703 691 692 if ( td->basictype == DeclarationNode::Float80 || td->basictype == DeclarationNode::Float128 ) { 693 // if ( td->complextype != DeclarationNode::NoComplexType ) { 694 // genTSError( DeclarationNode::complexTypeNames[ td->complextype ], td->basictype ); 695 // } 696 if ( td->basictype == DeclarationNode::Float80 ) ret = BasicType::Float80; 697 else ret = BasicType::Float128; 698 break; 699 } 700 704 701 ret = floattype[ td->complextype ][ td->basictype - DeclarationNode::Float ]; 705 //printf( "XXXX %d %d %d %d\n", td->complextype, td->basictype, DeclarationNode::Float, ret );706 702 break; 707 703 -
src/Parser/TypeData.h
r53bb8f1 r9d9a451 31 31 struct Aggregate_t { 32 32 DeclarationNode::Aggregate kind; 33 const std::string * name = nullptr;34 DeclarationNode * params = nullptr;35 ExpressionNode * actuals = nullptr; // holds actual parameters later applied to AggInst36 DeclarationNode * fields = nullptr;33 const std::string * name; 34 DeclarationNode * params; 35 ExpressionNode * actuals; // holds actual parameters later applied to AggInst 36 DeclarationNode * fields; 37 37 bool body; 38 38 bool anon; 39 39 40 40 bool tagged; 41 const std::string * parent = nullptr;41 const std::string * parent; 42 42 }; 43 43 44 44 struct AggInst_t { 45 TypeData * aggregate = nullptr;46 ExpressionNode * params = nullptr;45 TypeData * aggregate; 46 ExpressionNode * params; 47 47 bool hoistType; 48 48 }; 49 49 50 50 struct Array_t { 51 ExpressionNode * dimension = nullptr;51 ExpressionNode * dimension; 52 52 bool isVarLen; 53 53 bool isStatic; … … 55 55 56 56 struct Enumeration_t { 57 const std::string * name = nullptr;58 DeclarationNode * constants = nullptr;57 const std::string * name; 58 DeclarationNode * constants; 59 59 bool body; 60 60 bool anon; … … 62 62 63 63 struct Function_t { 64 mutable DeclarationNode * params = nullptr; // mutables modified in buildKRFunction65 mutable DeclarationNode * idList = nullptr; // old-style66 mutable DeclarationNode * oldDeclList = nullptr;67 StatementNode * body = nullptr;68 ExpressionNode * withExprs = nullptr; // expressions from function's with_clause64 mutable DeclarationNode * params; // mutables modified in buildKRFunction 65 mutable DeclarationNode * idList; // old-style 66 mutable DeclarationNode * oldDeclList; 67 StatementNode * body; 68 ExpressionNode * withExprs; // expressions from function's with_clause 69 69 }; 70 70 71 71 struct Symbolic_t { 72 const std::string * name = nullptr;72 const std::string * name; 73 73 bool isTypedef; // false => TYPEGENname, true => TYPEDEFname 74 DeclarationNode * params = nullptr;75 ExpressionNode * actuals = nullptr;76 DeclarationNode * assertions = nullptr;74 DeclarationNode * params; 75 ExpressionNode * actuals; 76 DeclarationNode * assertions; 77 77 }; 78 78 79 79 struct Qualified_t { // qualified type S.T 80 TypeData * parent = nullptr;81 TypeData * child = nullptr;80 TypeData * parent; 81 TypeData * child; 82 82 }; 83 83 … … 93 93 94 94 Type::Qualifiers qualifiers; 95 DeclarationNode * forall = nullptr;95 DeclarationNode * forall; 96 96 97 97 Aggregate_t aggregate; … … 102 102 Symbolic_t symbolic; 103 103 Qualified_t qualified; 104 DeclarationNode * tuple = nullptr;105 ExpressionNode * typeexpr = nullptr;104 DeclarationNode * tuple; 105 ExpressionNode * typeexpr; 106 106 107 107 TypeData( Kind k = Unknown ); -
src/Parser/lex.ll
r53bb8f1 r9d9a451 10 10 * Created On : Sat Sep 22 08:58:10 2001 11 11 * Last Modified By : Peter A. Buhr 12 * Last Modified On : Sun Mar 10 09:13:09 201913 * Update Count : 70612 * Last Modified On : Thu Nov 1 20:57:35 2018 13 * Update Count : 687 14 14 */ 15 15 … … 39 39 using namespace std; 40 40 41 #include "config.h" // configure info42 41 #include "ParseNode.h" 43 42 #include "TypedefTable.h" … … 60 59 #define IDENTIFIER_RETURN() RETURN_VAL( typedefTable.isKind( yytext ) ) 61 60 #define ATTRIBUTE_RETURN() RETURN_VAL( ATTR_IDENTIFIER ) 62 63 #ifdef HAVE_KEYWORDS_FLOATXX // GCC >= 7 => keyword, otherwise typedef64 #define FLOATXX(v) KEYWORD_RETURN(v);65 #else66 #define FLOATXX(v) IDENTIFIER_RETURN();67 #endif // HAVE_KEYWORDS_FLOATXX68 61 69 62 void rm_underscore() { … … 99 92 hex_quad {hex}("_"?{hex}){3} 100 93 size_opt (8|16|32|64|128)? 101 // CFA: explicit l8/l16/l32/l64/l128, char 'hh', short 'h', int 'n' 102 length ("ll"|"LL"|[lL]{size_opt})|("hh"|"HH"|[hHnN]) 103 // CFA: size_t 'z', pointer 'p', which define a sign and length 104 integer_suffix_opt ("_"?(([uU]({length}?[iI]?)|([iI]{length}))|([iI]({length}?[uU]?)|([uU]{length}))|({length}([iI]?[uU]?)|([uU][iI]))|[zZ]|[pP]))? 94 length ("ll"|"LL"|[lL]{size_opt})|("hh"|"HH"|[hH]) 95 integer_suffix_opt ("_"?(([uU]({length}?[iI]?)|([iI]{length}))|([iI]({length}?[uU]?)|([uU]{length}))|({length}([iI]?[uU]?)|([uU][iI]))|[zZ]))? 105 96 106 97 octal_digits ({octal})|({octal}({octal}|"_")*{octal}) … … 121 112 // GCC: D (double) and iI (imaginary) suffixes, and DL (long double) 122 113 exponent "_"?[eE]"_"?[+-]?{decimal_digits} 123 floating_size 16|32|32x|64|64x|80|128|128x124 floating_length ([fFdDlL wWqQ]|[fF]{floating_size})114 floating_size 32|64|80|128 115 floating_length ([fFdDlL]|[lL]{floating_size}) 125 116 floating_suffix ({floating_length}?[iI]?)|([iI]{floating_length}) 126 117 floating_suffix_opt ("_"?({floating_suffix}|"DL"))? … … 249 240 finally { KEYWORD_RETURN(FINALLY); } // CFA 250 241 float { KEYWORD_RETURN(FLOAT); } 251 __float80 { KEYWORD_RETURN(uuFLOAT80); } // GCC 252 float80 { KEYWORD_RETURN(uuFLOAT80); } // GCC 253 __float128 { KEYWORD_RETURN(uuFLOAT128); } // GCC 254 float128 { KEYWORD_RETURN(uuFLOAT128); } // GCC 255 _Float16 { FLOATXX(uFLOAT16); } // GCC 256 _Float32 { FLOATXX(uFLOAT32); } // GCC 257 _Float32x { FLOATXX(uFLOAT32X); } // GCC 258 _Float64 { FLOATXX(uFLOAT64); } // GCC 259 _Float64x { FLOATXX(uFLOAT64X); } // GCC 260 _Float128 { FLOATXX(uFLOAT128); } // GCC 261 _Float128x { FLOATXX(uFLOAT128); } // GCC 242 _Float32 { KEYWORD_RETURN(FLOAT); } // GCC 243 _Float32x { KEYWORD_RETURN(FLOAT); } // GCC 244 _Float64 { KEYWORD_RETURN(DOUBLE); } // GCC 245 _Float64x { KEYWORD_RETURN(DOUBLE); } // GCC 246 __float80 { KEYWORD_RETURN(FLOAT80); } // GCC 247 float80 { KEYWORD_RETURN(FLOAT80); } // GCC 248 _Float128 { KEYWORD_RETURN(FLOAT128); } // GCC 249 _Float128x { KEYWORD_RETURN(FLOAT128); } // GCC 250 __float128 { KEYWORD_RETURN(FLOAT128); } // GCC 251 float128 { KEYWORD_RETURN(FLOAT128); } // GCC 262 252 for { KEYWORD_RETURN(FOR); } 263 253 forall { KEYWORD_RETURN(FORALL); } // CFA -
src/Parser/module.mk
r53bb8f1 r9d9a451 31 31 Parser/parserutility.cc 32 32 33 SRCDEMANGLE += \ 34 Parser/LinkageSpec.cc 35 36 37 MOSTLYCLEANFILES += Parser/lex.cc Parser/parser.cc Parser/parser.hh Parser/parser.output 33 MOSTLYCLEANFILES += Parser/parser.hh Parser/parser.output -
src/Parser/parser.yy
r53bb8f1 r9d9a451 10 10 // Created On : Sat Sep 1 20:22:55 2001 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Thu Feb 21 08:45:07 201913 // Update Count : 4 23212 // Last Modified On : Thu Nov 8 18:08:23 2018 13 // Update Count : 4052 14 14 // 15 15 … … 99 99 // distribute declaration_specifier across all declared variables, e.g., static, const, __attribute__. 100 100 DeclarationNode * cur = declList, * cl = (new DeclarationNode)->addType( specifier ); 101 for ( cur = dynamic_cast<DeclarationNode *>( cur->get_next() ); cur != nullptr; cur = dynamic_cast<DeclarationNode *>( cur->get_next() ) ) { 101 //cur->addType( specifier ); 102 for ( cur = dynamic_cast< DeclarationNode * >( cur->get_next() ); cur != nullptr; cur = dynamic_cast< DeclarationNode * >( cur->get_next() ) ) { 102 103 cl->cloneBaseType( cur ); 103 104 } // for 104 105 declList->addType( cl ); 106 // delete cl; 105 107 return declList; 106 108 } // distAttr … … 191 193 return new ForCtrl( 192 194 distAttr( DeclarationNode::newTypeof( type, true ), DeclarationNode::newName( index )->addInitializer( new InitializerNode( start ) ) ), 193 // NULL comp/inc => leave blank 194 comp ? new ExpressionNode( build_binary_val( compop, new ExpressionNode( build_varref( new string( *index ) ) ), comp ) ) : 0, 195 inc ? new ExpressionNode( build_binary_val( compop == OperKinds::LThan || compop == OperKinds::LEThan ? // choose += or -= for upto/downto 196 OperKinds::PlusAssn : OperKinds::MinusAssn, new ExpressionNode( build_varref( new string( *index ) ) ), inc ) ) : 0 ); 195 new ExpressionNode( build_binary_val( compop, new ExpressionNode( build_varref( new string( *index ) ) ), comp ) ), 196 new ExpressionNode( build_binary_val( compop == OperKinds::LThan || compop == OperKinds::LEThan ? // choose += or -= for upto/downto 197 OperKinds::PlusAssn : OperKinds::MinusAssn, new ExpressionNode( build_varref( new string( *index ) ) ), inc ) ) ); 197 198 } // forCtrl 198 199 … … 200 201 if ( NameExpr * identifier = dynamic_cast<NameExpr *>(index->get_expr()) ) { 201 202 return forCtrl( type, new string( identifier->name ), start, compop, comp, inc ); 202 } else if ( CommaExpr * commaExpr = dynamic_cast<CommaExpr *>(index->get_expr()) ) {203 if ( NameExpr * identifier = dynamic_cast<NameExpr *>(commaExpr->arg1 ) ) {204 return forCtrl( type, new string( identifier->name ), start, compop, comp, inc );205 } else {206 SemanticError( yylloc, "Expression disallowed. Only loop-index name allowed" ); return nullptr;207 } // if208 203 } else { 209 204 SemanticError( yylloc, "Expression disallowed. Only loop-index name allowed" ); return nullptr; … … 268 263 %token VOID CHAR SHORT INT LONG FLOAT DOUBLE SIGNED UNSIGNED 269 264 %token BOOL COMPLEX IMAGINARY // C99 270 %token INT128 uuFLOAT80 uuFLOAT128 // GCC 271 %token uFLOAT16 uFLOAT32 uFLOAT32X uFLOAT64 uFLOAT64X uFLOAT128 // GCC 265 %token INT128 FLOAT80 FLOAT128 // GCC 272 266 %token ZERO_T ONE_T // CFA 273 267 %token VALIST // GCC … … 330 324 %type<en> argument_expression_list argument_expression default_initialize_opt 331 325 %type<ifctl> if_control_expression 332 %type<fctl> for_control_expression for_control_expression_list326 %type<fctl> for_control_expression 333 327 %type<compop> inclexcl 334 328 %type<en> subrange … … 990 984 // labels cannot be identifiers 0 or 1 or ATTR_IDENTIFIER 991 985 identifier_or_type_name ':' attribute_list_opt statement 992 { $$ = $4->add_label( $1, $3 ); } 986 { 987 $$ = $4->add_label( $1, $3 ); 988 } 993 989 ; 994 990 … … 1006 1002 statement_decl 1007 1003 | statement_decl_list statement_decl 1008 { assert( $1 ); $1->set_last( $2 ); $$ = $1;}1004 { if ( $1 != 0 ) { $1->set_last( $2 ); $$ = $1; } } 1009 1005 ; 1010 1006 … … 1013 1009 { $$ = new StatementNode( $1 ); } 1014 1010 | EXTENSION declaration // GCC 1015 { distExt( $2 ); $$ = new StatementNode( $2 ); } 1011 { 1012 distExt( $2 ); 1013 $$ = new StatementNode( $2 ); 1014 } 1016 1015 | function_definition 1017 1016 { $$ = new StatementNode( $1 ); } 1018 1017 | EXTENSION function_definition // GCC 1019 { distExt( $2 ); $$ = new StatementNode( $2 ); } 1018 { 1019 distExt( $2 ); 1020 $$ = new StatementNode( $2 ); 1021 } 1020 1022 | statement 1021 1023 ; … … 1024 1026 statement 1025 1027 | statement_list_nodecl statement 1026 { assert( $1 ); $1->set_last( $2 ); $$ = $1;}1028 { if ( $1 != 0 ) { $1->set_last( $2 ); $$ = $1; } } 1027 1029 ; 1028 1030 … … 1136 1138 | DO statement WHILE '(' ')' ';' // CFA => do while( 1 ) 1137 1139 { $$ = new StatementNode( build_do_while( new ExpressionNode( build_constantInteger( *new string( "1" ) ) ), $2 ) ); } 1138 | FOR '(' push for_control_expression _list')' statement pop1140 | FOR '(' push for_control_expression ')' statement pop 1139 1141 { $$ = new StatementNode( build_for( $4, $6 ) ); } 1140 1142 | FOR '(' ')' statement // CFA => for ( ;; ) … … 1142 1144 ; 1143 1145 1144 for_control_expression_list:1145 for_control_expression1146 | for_control_expression_list ':' for_control_expression1147 { $$ = $3; }1148 ;1149 1150 1146 for_control_expression: 1151 ';' comma_expression_opt ';' comma_expression_opt 1152 { $$ = new ForCtrl( (ExpressionNode * )nullptr, $2, $4 ); } 1153 | comma_expression ';' comma_expression_opt ';' comma_expression_opt 1154 { $$ = new ForCtrl( $1, $3, $5 ); } 1155 | declaration comma_expression_opt ';' comma_expression_opt // C99, declaration has ';' 1156 { $$ = new ForCtrl( $1, $2, $4 ); } 1157 | comma_expression // CFA 1147 comma_expression // CFA 1158 1148 { $$ = forCtrl( $1, new string( DeclarationNode::anonymous.newName() ), new ExpressionNode( build_constantInteger( *new string( "0" ) ) ), 1159 1149 OperKinds::LThan, $1->clone(), new ExpressionNode( build_constantInteger( *new string( "1" ) ) ) ); } 1160 | co mma_expression inclexcl comma_expression// CFA1150 | constant_expression inclexcl constant_expression // CFA 1161 1151 { $$ = forCtrl( $1, new string( DeclarationNode::anonymous.newName() ), $1->clone(), $2, $3, new ExpressionNode( build_constantInteger( *new string( "1" ) ) ) ); } 1162 | co mma_expression inclexcl comma_expression '~' comma_expression // CFA1152 | constant_expression inclexcl constant_expression '~' constant_expression // CFA 1163 1153 { $$ = forCtrl( $1, new string( DeclarationNode::anonymous.newName() ), $1->clone(), $2, $3, $5 ); } 1164 1154 | comma_expression ';' comma_expression // CFA 1165 1155 { $$ = forCtrl( $3, $1, new ExpressionNode( build_constantInteger( *new string( "0" ) ) ), 1166 1156 OperKinds::LThan, $3->clone(), new ExpressionNode( build_constantInteger( *new string( "1" ) ) ) ); } 1167 | comma_expression ';' co mma_expression inclexcl comma_expression // CFA1157 | comma_expression ';' constant_expression inclexcl constant_expression // CFA 1168 1158 { $$ = forCtrl( $3, $1, $3->clone(), $4, $5, new ExpressionNode( build_constantInteger( *new string( "1" ) ) ) ); } 1169 | comma_expression ';' co mma_expression inclexcl comma_expression '~' comma_expression // CFA1159 | comma_expression ';' constant_expression inclexcl constant_expression '~' constant_expression // CFA 1170 1160 { $$ = forCtrl( $3, $1, $3->clone(), $4, $5, $7 ); } 1171 | comma_expression ';' comma_expression '~' '@' '~' comma_expression // CFA1172 { $$ = forCtrl( $3, $1, $3->clone(), OperKinds::LThan, nullptr, $7); }1173 | comma_expression ';' comma_expression ErangeDown '@' '~' comma_expression // CFA1174 { $$ = forCtrl( $3, $1, $3->clone(), OperKinds::GThan, nullptr, $7); }1175 | comma_expression ';' comma_expression '~' '@' '~' '@' // CFA1176 { $$ = forCtrl( $3, $1, $3->clone(), OperKinds::LThan, nullptr, nullptr); }1161 | comma_expression ';' comma_expression_opt ';' comma_expression_opt 1162 { $$ = new ForCtrl( $1, $3, $5 ); } 1163 | ';' comma_expression_opt ';' comma_expression_opt 1164 { $$ = new ForCtrl( (ExpressionNode * )nullptr, $2, $4 ); } 1165 | declaration comma_expression_opt ';' comma_expression_opt // C99, declaration has ';' 1166 { $$ = new ForCtrl( $1, $2, $4 ); } 1177 1167 ; 1178 1168 … … 1781 1771 | FLOAT 1782 1772 { $$ = DeclarationNode::newBasicType( DeclarationNode::Float ); } 1773 | FLOAT80 1774 { $$ = DeclarationNode::newBasicType( DeclarationNode::Float80 ); } 1775 | FLOAT128 1776 { $$ = DeclarationNode::newBasicType( DeclarationNode::Float128 ); } 1783 1777 | DOUBLE 1784 1778 { $$ = DeclarationNode::newBasicType( DeclarationNode::Double ); } 1785 | uuFLOAT801786 { $$ = DeclarationNode::newBasicType( DeclarationNode::uuFloat80 ); }1787 | uuFLOAT1281788 { $$ = DeclarationNode::newBasicType( DeclarationNode::uuFloat128 ); }1789 | uFLOAT161790 { $$ = DeclarationNode::newBasicType( DeclarationNode::uFloat16 ); }1791 | uFLOAT321792 { $$ = DeclarationNode::newBasicType( DeclarationNode::uFloat32 ); }1793 | uFLOAT32X1794 { $$ = DeclarationNode::newBasicType( DeclarationNode::uFloat32x ); }1795 | uFLOAT641796 { $$ = DeclarationNode::newBasicType( DeclarationNode::uFloat64 ); }1797 | uFLOAT64X1798 { $$ = DeclarationNode::newBasicType( DeclarationNode::uFloat64x ); }1799 | uFLOAT1281800 { $$ = DeclarationNode::newBasicType( DeclarationNode::uFloat128 ); }1801 1779 | COMPLEX // C99 1802 1780 { $$ = DeclarationNode::newComplexType( DeclarationNode::Complex ); } -
src/ResolvExpr/AlternativeFinder.cc
r53bb8f1 r9d9a451 474 474 } 475 475 476 // specialization cost of return types can't be accounted for directly, it disables 477 // otherwise-identical calls, like this example based on auto-newline in the I/O lib: 478 // 479 // forall(otype OS) { 480 // void ?|?(OS&, int); // with newline 481 // OS& ?|?(OS&, int); // no newline, always chosen due to more specialization 482 // } 476 // mark specialization cost of return types 477 for ( DeclarationWithType* returnVal : function->returnVals ) { 478 convCost.decSpec( specCost( returnVal->get_type() ) ); 479 } 483 480 484 481 // mark type variable and specialization cost of forall clause … … 486 483 for ( TypeDecl* td : function->forall ) { 487 484 convCost.decSpec( td->assertions.size() ); 485 } 486 487 // xxx -- replace with new costs in resolver 488 for ( InferredParams::const_iterator assert = appExpr->inferParams.begin(); assert != appExpr->inferParams.end(); ++assert ) { 489 convCost += computeConversionCost( assert->second.actualType, assert->second.formalType, indexer, alt.env ); 488 490 } 489 491 … … 1227 1229 Alternative newAlt{ 1228 1230 restructureCast( alt.expr->clone(), toType, castExpr->isGenerated ), 1229 alt.env, openVars, needAssertions, alt.cost , alt.cost +thisCost };1231 alt.env, openVars, needAssertions, alt.cost + thisCost, thisCost }; 1230 1232 inferParameters( newAlt, back_inserter( candidates ) ); 1231 1233 } // if -
src/ResolvExpr/CommonType.cc
r53bb8f1 r9d9a451 10 10 // Created On : Sun May 17 06:59:27 2015 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Thu Feb 14 17:10:10 201913 // Update Count : 2412 // Last Modified On : Mon Sep 25 15:18:17 2017 13 // Update Count : 9 14 14 // 15 15 … … 176 176 } 177 177 178 // GENERATED START, DO NOT EDIT 179 // GENERATED BY BasicTypes-gen.cc 180 #define BT BasicType:: 181 static const BasicType::Kind commonTypes[BasicType::NUMBER_OF_BASIC_TYPES][BasicType::NUMBER_OF_BASIC_TYPES] = { // nearest common ancestor 182 /* B C SC UC SI SUI 183 I UI LI LUI LLI LLUI 184 IB UIB _FH _FH _F _FC 185 F FC _FX _FXC FD _FDC 186 D DC F80X _FDXC F80 _FB 187 _FLDC FB LD LDC _FBX _FLDXC 188 */ 189 { 190 /* B*/ BT Bool, BT Char, BT SignedChar, BT UnsignedChar, BT ShortSignedInt, BT ShortUnsignedInt, 191 BT SignedInt, BT UnsignedInt, BT LongSignedInt, BT LongUnsignedInt, BT LongLongSignedInt, BT LongLongUnsignedInt, 192 BT SignedInt128, BT UnsignedInt128, BT uFloat16, BT uFloat16Complex, BT uFloat32, BT uFloat32Complex, 193 BT Float, BT FloatComplex, BT uFloat32x, BT uFloat32xComplex, BT uFloat64, BT uFloat64Complex, 194 BT Double, BT DoubleComplex, BT uFloat64x, BT uFloat64xComplex, BT uuFloat80, BT uFloat128, 195 BT uFloat128Complex, BT uuFloat128, BT LongDouble, BT LongDoubleComplex, BT uFloat128x, BT uFloat128xComplex, 196 }, 197 { 198 /* C*/ BT Char, BT Char, BT SignedChar, BT UnsignedChar, BT ShortSignedInt, BT ShortUnsignedInt, 199 BT SignedInt, BT UnsignedInt, BT LongSignedInt, BT LongUnsignedInt, BT LongLongSignedInt, BT LongLongUnsignedInt, 200 BT SignedInt128, BT UnsignedInt128, BT uFloat16, BT uFloat16Complex, BT uFloat32, BT uFloat32Complex, 201 BT Float, BT FloatComplex, BT uFloat32x, BT uFloat32xComplex, BT uFloat64, BT uFloat64Complex, 202 BT Double, BT DoubleComplex, BT uFloat64x, BT uFloat64xComplex, BT uuFloat80, BT uFloat128, 203 BT uFloat128Complex, BT uuFloat128, BT LongDouble, BT LongDoubleComplex, BT uFloat128x, BT uFloat128xComplex, 204 }, 205 { 206 /* SC*/ BT SignedChar, BT SignedChar, BT SignedChar, BT UnsignedChar, BT ShortSignedInt, BT ShortUnsignedInt, 207 BT SignedInt, BT UnsignedInt, BT LongSignedInt, BT LongUnsignedInt, BT LongLongSignedInt, BT LongLongUnsignedInt, 208 BT SignedInt128, BT UnsignedInt128, BT uFloat16, BT uFloat16Complex, BT uFloat32, BT uFloat32Complex, 209 BT Float, BT FloatComplex, BT uFloat32x, BT uFloat32xComplex, BT uFloat64, BT uFloat64Complex, 210 BT Double, BT DoubleComplex, BT uFloat64x, BT uFloat64xComplex, BT uuFloat80, BT uFloat128, 211 BT uFloat128Complex, BT uuFloat128, BT LongDouble, BT LongDoubleComplex, BT uFloat128x, BT uFloat128xComplex, 212 }, 213 { 214 /* UC*/ BT UnsignedChar, BT UnsignedChar, BT UnsignedChar, BT UnsignedChar, BT ShortSignedInt, BT ShortUnsignedInt, 215 BT SignedInt, BT UnsignedInt, BT LongSignedInt, BT LongUnsignedInt, BT LongLongSignedInt, BT LongLongUnsignedInt, 216 BT SignedInt128, BT UnsignedInt128, BT uFloat16, BT uFloat16Complex, BT uFloat32, BT uFloat32Complex, 217 BT Float, BT FloatComplex, BT uFloat32x, BT uFloat32xComplex, BT uFloat64, BT uFloat64Complex, 218 BT Double, BT DoubleComplex, BT uFloat64x, BT uFloat64xComplex, BT uuFloat80, BT uFloat128, 219 BT uFloat128Complex, BT uuFloat128, BT LongDouble, BT LongDoubleComplex, BT uFloat128x, BT uFloat128xComplex, 220 }, 221 { 222 /* SI*/ BT ShortSignedInt, BT ShortSignedInt, BT ShortSignedInt, BT ShortSignedInt, BT ShortSignedInt, BT ShortUnsignedInt, 223 BT SignedInt, BT UnsignedInt, BT LongSignedInt, BT LongUnsignedInt, BT LongLongSignedInt, BT LongLongUnsignedInt, 224 BT SignedInt128, BT UnsignedInt128, BT uFloat16, BT uFloat16Complex, BT uFloat32, BT uFloat32Complex, 225 BT Float, BT FloatComplex, BT uFloat32x, BT uFloat32xComplex, BT uFloat64, BT uFloat64Complex, 226 BT Double, BT DoubleComplex, BT uFloat64x, BT uFloat64xComplex, BT uuFloat80, BT uFloat128, 227 BT uFloat128Complex, BT uuFloat128, BT LongDouble, BT LongDoubleComplex, BT uFloat128x, BT uFloat128xComplex, 228 }, 229 { 230 /* SUI*/ BT ShortUnsignedInt, BT ShortUnsignedInt, BT ShortUnsignedInt, BT ShortUnsignedInt, BT ShortUnsignedInt, BT ShortUnsignedInt, 231 BT SignedInt, BT UnsignedInt, BT LongSignedInt, BT LongUnsignedInt, BT LongLongSignedInt, BT LongLongUnsignedInt, 232 BT SignedInt128, BT UnsignedInt128, BT uFloat16, BT uFloat16Complex, BT uFloat32, BT uFloat32Complex, 233 BT Float, BT FloatComplex, BT uFloat32x, BT uFloat32xComplex, BT uFloat64, BT uFloat64Complex, 234 BT Double, BT DoubleComplex, BT uFloat64x, BT uFloat64xComplex, BT uuFloat80, BT uFloat128, 235 BT uFloat128Complex, BT uuFloat128, BT LongDouble, BT LongDoubleComplex, BT uFloat128x, BT uFloat128xComplex, 236 }, 237 { 238 /* I*/ BT SignedInt, BT SignedInt, BT SignedInt, BT SignedInt, BT SignedInt, BT SignedInt, 239 BT SignedInt, BT UnsignedInt, BT LongSignedInt, BT LongUnsignedInt, BT LongLongSignedInt, BT LongLongUnsignedInt, 240 BT SignedInt128, BT UnsignedInt128, BT uFloat16, BT uFloat16Complex, BT uFloat32, BT uFloat32Complex, 241 BT Float, BT FloatComplex, BT uFloat32x, BT uFloat32xComplex, BT uFloat64, BT uFloat64Complex, 242 BT Double, BT DoubleComplex, BT uFloat64x, BT uFloat64xComplex, BT uuFloat80, BT uFloat128, 243 BT uFloat128Complex, BT uuFloat128, BT LongDouble, BT LongDoubleComplex, BT uFloat128x, BT uFloat128xComplex, 244 }, 245 { 246 /* UI*/ BT UnsignedInt, BT UnsignedInt, BT UnsignedInt, BT UnsignedInt, BT UnsignedInt, BT UnsignedInt, 247 BT UnsignedInt, BT UnsignedInt, BT LongSignedInt, BT LongUnsignedInt, BT LongLongSignedInt, BT LongLongUnsignedInt, 248 BT SignedInt128, BT UnsignedInt128, BT uFloat16, BT uFloat16Complex, BT uFloat32, BT uFloat32Complex, 249 BT Float, BT FloatComplex, BT uFloat32x, BT uFloat32xComplex, BT uFloat64, BT uFloat64Complex, 250 BT Double, BT DoubleComplex, BT uFloat64x, BT uFloat64xComplex, BT uuFloat80, BT uFloat128, 251 BT uFloat128Complex, BT uuFloat128, BT LongDouble, BT LongDoubleComplex, BT uFloat128x, BT uFloat128xComplex, 252 }, 253 { 254 /* LI*/ BT LongSignedInt, BT LongSignedInt, BT LongSignedInt, BT LongSignedInt, BT LongSignedInt, BT LongSignedInt, 255 BT LongSignedInt, BT LongSignedInt, BT LongSignedInt, BT LongUnsignedInt, BT LongLongSignedInt, BT LongLongUnsignedInt, 256 BT SignedInt128, BT UnsignedInt128, BT uFloat16, BT uFloat16Complex, BT uFloat32, BT uFloat32Complex, 257 BT Float, BT FloatComplex, BT uFloat32x, BT uFloat32xComplex, BT uFloat64, BT uFloat64Complex, 258 BT Double, BT DoubleComplex, BT uFloat64x, BT uFloat64xComplex, BT uuFloat80, BT uFloat128, 259 BT uFloat128Complex, BT uuFloat128, BT LongDouble, BT LongDoubleComplex, BT uFloat128x, BT uFloat128xComplex, 260 }, 261 { 262 /* LUI*/ BT LongUnsignedInt, BT LongUnsignedInt, BT LongUnsignedInt, BT LongUnsignedInt, BT LongUnsignedInt, BT LongUnsignedInt, 263 BT LongUnsignedInt, BT LongUnsignedInt, BT LongUnsignedInt, BT LongUnsignedInt, BT LongLongSignedInt, BT LongLongUnsignedInt, 264 BT SignedInt128, BT UnsignedInt128, BT uFloat16, BT uFloat16Complex, BT uFloat32, BT uFloat32Complex, 265 BT Float, BT FloatComplex, BT uFloat32x, BT uFloat32xComplex, BT uFloat64, BT uFloat64Complex, 266 BT Double, BT DoubleComplex, BT uFloat64x, BT uFloat64xComplex, BT uuFloat80, BT uFloat128, 267 BT uFloat128Complex, BT uuFloat128, BT LongDouble, BT LongDoubleComplex, BT uFloat128x, BT uFloat128xComplex, 268 }, 269 { 270 /* LLI*/ BT LongLongSignedInt, BT LongLongSignedInt, BT LongLongSignedInt, BT LongLongSignedInt, BT LongLongSignedInt, BT LongLongSignedInt, 271 BT LongLongSignedInt, BT LongLongSignedInt, BT LongLongSignedInt, BT LongLongSignedInt, BT LongLongSignedInt, BT LongLongUnsignedInt, 272 BT SignedInt128, BT UnsignedInt128, BT uFloat16, BT uFloat16Complex, BT uFloat32, BT uFloat32Complex, 273 BT Float, BT FloatComplex, BT uFloat32x, BT uFloat32xComplex, BT uFloat64, BT uFloat64Complex, 274 BT Double, BT DoubleComplex, BT uFloat64x, BT uFloat64xComplex, BT uuFloat80, BT uFloat128, 275 BT uFloat128Complex, BT uuFloat128, BT LongDouble, BT LongDoubleComplex, BT uFloat128x, BT uFloat128xComplex, 276 }, 277 { 278 /* LLUI*/ BT LongLongUnsignedInt, BT LongLongUnsignedInt, BT LongLongUnsignedInt, BT LongLongUnsignedInt, BT LongLongUnsignedInt, BT LongLongUnsignedInt, 279 BT LongLongUnsignedInt, BT LongLongUnsignedInt, BT LongLongUnsignedInt, BT LongLongUnsignedInt, BT LongLongUnsignedInt, BT LongLongUnsignedInt, 280 BT SignedInt128, BT UnsignedInt128, BT uFloat16, BT uFloat16Complex, BT uFloat32, BT uFloat32Complex, 281 BT Float, BT FloatComplex, BT uFloat32x, BT uFloat32xComplex, BT uFloat64, BT uFloat64Complex, 282 BT Double, BT DoubleComplex, BT uFloat64x, BT uFloat64xComplex, BT uuFloat80, BT uFloat128, 283 BT uFloat128Complex, BT uuFloat128, BT LongDouble, BT LongDoubleComplex, BT uFloat128x, BT uFloat128xComplex, 284 }, 285 { 286 /* IB*/ BT SignedInt128, BT SignedInt128, BT SignedInt128, BT SignedInt128, BT SignedInt128, BT SignedInt128, 287 BT SignedInt128, BT SignedInt128, BT SignedInt128, BT SignedInt128, BT SignedInt128, BT SignedInt128, 288 BT SignedInt128, BT UnsignedInt128, BT uFloat16, BT uFloat16Complex, BT uFloat32, BT uFloat32Complex, 289 BT Float, BT FloatComplex, BT uFloat32x, BT uFloat32xComplex, BT uFloat64, BT uFloat64Complex, 290 BT Double, BT DoubleComplex, BT uFloat64x, BT uFloat64xComplex, BT uuFloat80, BT uFloat128, 291 BT uFloat128Complex, BT uuFloat128, BT LongDouble, BT LongDoubleComplex, BT uFloat128x, BT uFloat128xComplex, 292 }, 293 { 294 /* UIB*/ BT UnsignedInt128, BT UnsignedInt128, BT UnsignedInt128, BT UnsignedInt128, BT UnsignedInt128, BT UnsignedInt128, 295 BT UnsignedInt128, BT UnsignedInt128, BT UnsignedInt128, BT UnsignedInt128, BT UnsignedInt128, BT UnsignedInt128, 296 BT UnsignedInt128, BT UnsignedInt128, BT uFloat16, BT uFloat16Complex, BT uFloat32, BT uFloat32Complex, 297 BT Float, BT FloatComplex, BT uFloat32x, BT uFloat32xComplex, BT uFloat64, BT uFloat64Complex, 298 BT Double, BT DoubleComplex, BT uFloat64x, BT uFloat64xComplex, BT uuFloat80, BT uFloat128, 299 BT uFloat128Complex, BT uuFloat128, BT LongDouble, BT LongDoubleComplex, BT uFloat128x, BT uFloat128xComplex, 300 }, 301 { 302 /* _FH*/ BT uFloat16, BT uFloat16, BT uFloat16, BT uFloat16, BT uFloat16, BT uFloat16, 303 BT uFloat16, BT uFloat16, BT uFloat16, BT uFloat16, BT uFloat16, BT uFloat16, 304 BT uFloat16, BT uFloat16, BT uFloat16, BT uFloat16Complex, BT uFloat32, BT uFloat32Complex, 305 BT Float, BT FloatComplex, BT uFloat32x, BT uFloat32xComplex, BT uFloat64, BT uFloat64Complex, 306 BT Double, BT DoubleComplex, BT uFloat64x, BT uFloat64xComplex, BT uuFloat80, BT uFloat128, 307 BT uFloat128Complex, BT uuFloat128, BT LongDouble, BT LongDoubleComplex, BT uFloat128x, BT uFloat128xComplex, 308 }, 309 { 310 /* _FH*/ BT uFloat16Complex, BT uFloat16Complex, BT uFloat16Complex, BT uFloat16Complex, BT uFloat16Complex, BT uFloat16Complex, 311 BT uFloat16Complex, BT uFloat16Complex, BT uFloat16Complex, BT uFloat16Complex, BT uFloat16Complex, BT uFloat16Complex, 312 BT uFloat16Complex, BT uFloat16Complex, BT uFloat16Complex, BT uFloat16Complex, BT uFloat32Complex, BT uFloat32Complex, 313 BT FloatComplex, BT FloatComplex, BT uFloat32xComplex, BT uFloat32xComplex, BT uFloat64Complex, BT uFloat64Complex, 314 BT DoubleComplex, BT DoubleComplex, BT uFloat64xComplex, BT uFloat64xComplex, BT uFloat64xComplex, BT uFloat128Complex, 315 BT uFloat128Complex, BT uFloat128Complex, BT LongDoubleComplex, BT LongDoubleComplex, BT uFloat128xComplex, BT uFloat128xComplex, 316 }, 317 { 318 /* _F*/ BT uFloat32, BT uFloat32, BT uFloat32, BT uFloat32, BT uFloat32, BT uFloat32, 319 BT uFloat32, BT uFloat32, BT uFloat32, BT uFloat32, BT uFloat32, BT uFloat32, 320 BT uFloat32, BT uFloat32, BT uFloat32, BT uFloat32Complex, BT uFloat32, BT uFloat32Complex, 321 BT Float, BT FloatComplex, BT uFloat32x, BT uFloat32xComplex, BT uFloat64, BT uFloat64Complex, 322 BT Double, BT DoubleComplex, BT uFloat64x, BT uFloat64xComplex, BT uuFloat80, BT uFloat128, 323 BT uFloat128Complex, BT uuFloat128, BT LongDouble, BT LongDoubleComplex, BT uFloat128x, BT uFloat128xComplex, 324 }, 325 { 326 /* _FC*/ BT uFloat32Complex, BT uFloat32Complex, BT uFloat32Complex, BT uFloat32Complex, BT uFloat32Complex, BT uFloat32Complex, 327 BT uFloat32Complex, BT uFloat32Complex, BT uFloat32Complex, BT uFloat32Complex, BT uFloat32Complex, BT uFloat32Complex, 328 BT uFloat32Complex, BT uFloat32Complex, BT uFloat32Complex, BT uFloat32Complex, BT uFloat32Complex, BT uFloat32Complex, 329 BT FloatComplex, BT FloatComplex, BT uFloat32xComplex, BT uFloat32xComplex, BT uFloat64Complex, BT uFloat64Complex, 330 BT DoubleComplex, BT DoubleComplex, BT uFloat64xComplex, BT uFloat64xComplex, BT uFloat64xComplex, BT uFloat128Complex, 331 BT uFloat128Complex, BT uFloat128Complex, BT LongDoubleComplex, BT LongDoubleComplex, BT uFloat128xComplex, BT uFloat128xComplex, 332 }, 333 { 334 /* F*/ BT Float, BT Float, BT Float, BT Float, BT Float, BT Float, 335 BT Float, BT Float, BT Float, BT Float, BT Float, BT Float, 336 BT Float, BT Float, BT Float, BT FloatComplex, BT Float, BT FloatComplex, 337 BT Float, BT FloatComplex, BT uFloat32x, BT uFloat32xComplex, BT uFloat64, BT uFloat64Complex, 338 BT Double, BT DoubleComplex, BT uFloat64x, BT uFloat64xComplex, BT uuFloat80, BT uFloat128, 339 BT uFloat128Complex, BT uuFloat128, BT LongDouble, BT LongDoubleComplex, BT uFloat128x, BT uFloat128xComplex, 340 }, 341 { 342 /* FC*/ BT FloatComplex, BT FloatComplex, BT FloatComplex, BT FloatComplex, BT FloatComplex, BT FloatComplex, 343 BT FloatComplex, BT FloatComplex, BT FloatComplex, BT FloatComplex, BT FloatComplex, BT FloatComplex, 344 BT FloatComplex, BT FloatComplex, BT FloatComplex, BT FloatComplex, BT FloatComplex, BT FloatComplex, 345 BT FloatComplex, BT FloatComplex, BT uFloat32xComplex, BT uFloat32xComplex, BT uFloat64Complex, BT uFloat64Complex, 346 BT DoubleComplex, BT DoubleComplex, BT uFloat64xComplex, BT uFloat64xComplex, BT uFloat64xComplex, BT uFloat128Complex, 347 BT uFloat128Complex, BT uFloat128Complex, BT LongDoubleComplex, BT LongDoubleComplex, BT uFloat128xComplex, BT uFloat128xComplex, 348 }, 349 { 350 /* _FX*/ BT uFloat32x, BT uFloat32x, BT uFloat32x, BT uFloat32x, BT uFloat32x, BT uFloat32x, 351 BT uFloat32x, BT uFloat32x, BT uFloat32x, BT uFloat32x, BT uFloat32x, BT uFloat32x, 352 BT uFloat32x, BT uFloat32x, BT uFloat32x, BT uFloat32xComplex, BT uFloat32x, BT uFloat32xComplex, 353 BT uFloat32x, BT uFloat32xComplex, BT uFloat32x, BT uFloat32xComplex, BT uFloat64, BT uFloat64Complex, 354 BT Double, BT DoubleComplex, BT uFloat64x, BT uFloat64xComplex, BT uuFloat80, BT uFloat128, 355 BT uFloat128Complex, BT uuFloat128, BT LongDouble, BT LongDoubleComplex, BT uFloat128x, BT uFloat128xComplex, 356 }, 357 { 358 /* _FXC*/ BT uFloat32xComplex, BT uFloat32xComplex, BT uFloat32xComplex, BT uFloat32xComplex, BT uFloat32xComplex, BT uFloat32xComplex, 359 BT uFloat32xComplex, BT uFloat32xComplex, BT uFloat32xComplex, BT uFloat32xComplex, BT uFloat32xComplex, BT uFloat32xComplex, 360 BT uFloat32xComplex, BT uFloat32xComplex, BT uFloat32xComplex, BT uFloat32xComplex, BT uFloat32xComplex, BT uFloat32xComplex, 361 BT uFloat32xComplex, BT uFloat32xComplex, BT uFloat32xComplex, BT uFloat32xComplex, BT uFloat64Complex, BT uFloat64Complex, 362 BT DoubleComplex, BT DoubleComplex, BT uFloat64xComplex, BT uFloat64xComplex, BT uFloat64xComplex, BT uFloat128Complex, 363 BT uFloat128Complex, BT uFloat128Complex, BT LongDoubleComplex, BT LongDoubleComplex, BT uFloat128xComplex, BT uFloat128xComplex, 364 }, 365 { 366 /* FD*/ BT uFloat64, BT uFloat64, BT uFloat64, BT uFloat64, BT uFloat64, BT uFloat64, 367 BT uFloat64, BT uFloat64, BT uFloat64, BT uFloat64, BT uFloat64, BT uFloat64, 368 BT uFloat64, BT uFloat64, BT uFloat64, BT uFloat64Complex, BT uFloat64, BT uFloat64Complex, 369 BT uFloat64, BT uFloat64Complex, BT uFloat64, BT uFloat64Complex, BT uFloat64, BT uFloat64Complex, 370 BT Double, BT DoubleComplex, BT uFloat64x, BT uFloat64xComplex, BT uuFloat80, BT uFloat128, 371 BT uFloat128Complex, BT uuFloat128, BT LongDouble, BT LongDoubleComplex, BT uFloat128x, BT uFloat128xComplex, 372 }, 373 { 374 /* _FDC*/ BT uFloat64Complex, BT uFloat64Complex, BT uFloat64Complex, BT uFloat64Complex, BT uFloat64Complex, BT uFloat64Complex, 375 BT uFloat64Complex, BT uFloat64Complex, BT uFloat64Complex, BT uFloat64Complex, BT uFloat64Complex, BT uFloat64Complex, 376 BT uFloat64Complex, BT uFloat64Complex, BT uFloat64Complex, BT uFloat64Complex, BT uFloat64Complex, BT uFloat64Complex, 377 BT uFloat64Complex, BT uFloat64Complex, BT uFloat64Complex, BT uFloat64Complex, BT uFloat64Complex, BT uFloat64Complex, 378 BT DoubleComplex, BT DoubleComplex, BT uFloat64xComplex, BT uFloat64xComplex, BT uFloat64xComplex, BT uFloat128Complex, 379 BT uFloat128Complex, BT uFloat128Complex, BT LongDoubleComplex, BT LongDoubleComplex, BT uFloat128xComplex, BT uFloat128xComplex, 380 }, 381 { 382 /* D*/ BT Double, BT Double, BT Double, BT Double, BT Double, BT Double, 383 BT Double, BT Double, BT Double, BT Double, BT Double, BT Double, 384 BT Double, BT Double, BT Double, BT DoubleComplex, BT Double, BT DoubleComplex, 385 BT Double, BT DoubleComplex, BT Double, BT DoubleComplex, BT Double, BT DoubleComplex, 386 BT Double, BT DoubleComplex, BT uFloat64x, BT uFloat64xComplex, BT uuFloat80, BT uFloat128, 387 BT uFloat128Complex, BT uuFloat128, BT LongDouble, BT LongDoubleComplex, BT uFloat128x, BT uFloat128xComplex, 388 }, 389 { 390 /* DC*/ BT DoubleComplex, BT DoubleComplex, BT DoubleComplex, BT DoubleComplex, BT DoubleComplex, BT DoubleComplex, 391 BT DoubleComplex, BT DoubleComplex, BT DoubleComplex, BT DoubleComplex, BT DoubleComplex, BT DoubleComplex, 392 BT DoubleComplex, BT DoubleComplex, BT DoubleComplex, BT DoubleComplex, BT DoubleComplex, BT DoubleComplex, 393 BT DoubleComplex, BT DoubleComplex, BT DoubleComplex, BT DoubleComplex, BT DoubleComplex, BT DoubleComplex, 394 BT DoubleComplex, BT DoubleComplex, BT uFloat64xComplex, BT uFloat64xComplex, BT uFloat64xComplex, BT uFloat128Complex, 395 BT uFloat128Complex, BT uFloat128Complex, BT LongDoubleComplex, BT LongDoubleComplex, BT uFloat128xComplex, BT uFloat128xComplex, 396 }, 397 { 398 /* F80X*/ BT uFloat64x, BT uFloat64x, BT uFloat64x, BT uFloat64x, BT uFloat64x, BT uFloat64x, 399 BT uFloat64x, BT uFloat64x, BT uFloat64x, BT uFloat64x, BT uFloat64x, BT uFloat64x, 400 BT uFloat64x, BT uFloat64x, BT uFloat64x, BT uFloat64xComplex, BT uFloat64x, BT uFloat64xComplex, 401 BT uFloat64x, BT uFloat64xComplex, BT uFloat64x, BT uFloat64xComplex, BT uFloat64x, BT uFloat64xComplex, 402 BT uFloat64x, BT uFloat64xComplex, BT uFloat64x, BT uFloat64xComplex, BT uuFloat80, BT uFloat128, 403 BT uFloat128Complex, BT uuFloat128, BT LongDouble, BT LongDoubleComplex, BT uFloat128x, BT uFloat128xComplex, 404 }, 405 { 406 /* _FDXC*/ BT uFloat64xComplex, BT uFloat64xComplex, BT uFloat64xComplex, BT uFloat64xComplex, BT uFloat64xComplex, BT uFloat64xComplex, 407 BT uFloat64xComplex, BT uFloat64xComplex, BT uFloat64xComplex, BT uFloat64xComplex, BT uFloat64xComplex, BT uFloat64xComplex, 408 BT uFloat64xComplex, BT uFloat64xComplex, BT uFloat64xComplex, BT uFloat64xComplex, BT uFloat64xComplex, BT uFloat64xComplex, 409 BT uFloat64xComplex, BT uFloat64xComplex, BT uFloat64xComplex, BT uFloat64xComplex, BT uFloat64xComplex, BT uFloat64xComplex, 410 BT uFloat64xComplex, BT uFloat64xComplex, BT uFloat64xComplex, BT uFloat64xComplex, BT uFloat64xComplex, BT uFloat128Complex, 411 BT uFloat128Complex, BT uFloat128Complex, BT LongDoubleComplex, BT LongDoubleComplex, BT uFloat128xComplex, BT uFloat128xComplex, 412 }, 413 { 414 /* F80*/ BT uuFloat80, BT uuFloat80, BT uuFloat80, BT uuFloat80, BT uuFloat80, BT uuFloat80, 415 BT uuFloat80, BT uuFloat80, BT uuFloat80, BT uuFloat80, BT uuFloat80, BT uuFloat80, 416 BT uuFloat80, BT uuFloat80, BT uuFloat80, BT uFloat64xComplex, BT uuFloat80, BT uFloat64xComplex, 417 BT uuFloat80, BT uFloat64xComplex, BT uuFloat80, BT uFloat64xComplex, BT uuFloat80, BT uFloat64xComplex, 418 BT uuFloat80, BT uFloat64xComplex, BT uuFloat80, BT uFloat64xComplex, BT uuFloat80, BT uFloat128, 419 BT uFloat128Complex, BT uuFloat128, BT LongDouble, BT LongDoubleComplex, BT uFloat128x, BT uFloat128xComplex, 420 }, 421 { 422 /* _FB*/ BT uFloat128, BT uFloat128, BT uFloat128, BT uFloat128, BT uFloat128, BT uFloat128, 423 BT uFloat128, BT uFloat128, BT uFloat128, BT uFloat128, BT uFloat128, BT uFloat128, 424 BT uFloat128, BT uFloat128, BT uFloat128, BT uFloat128Complex, BT uFloat128, BT uFloat128Complex, 425 BT uFloat128, BT uFloat128Complex, BT uFloat128, BT uFloat128Complex, BT uFloat128, BT uFloat128Complex, 426 BT uFloat128, BT uFloat128Complex, BT uFloat128, BT uFloat128Complex, BT uFloat128, BT uFloat128, 427 BT uFloat128Complex, BT uuFloat128, BT LongDouble, BT LongDoubleComplex, BT uFloat128x, BT uFloat128xComplex, 428 }, 429 { 430 /* _FLDC*/ BT uFloat128Complex, BT uFloat128Complex, BT uFloat128Complex, BT uFloat128Complex, BT uFloat128Complex, BT uFloat128Complex, 431 BT uFloat128Complex, BT uFloat128Complex, BT uFloat128Complex, BT uFloat128Complex, BT uFloat128Complex, BT uFloat128Complex, 432 BT uFloat128Complex, BT uFloat128Complex, BT uFloat128Complex, BT uFloat128Complex, BT uFloat128Complex, BT uFloat128Complex, 433 BT uFloat128Complex, BT uFloat128Complex, BT uFloat128Complex, BT uFloat128Complex, BT uFloat128Complex, BT uFloat128Complex, 434 BT uFloat128Complex, BT uFloat128Complex, BT uFloat128Complex, BT uFloat128Complex, BT uFloat128Complex, BT uFloat128Complex, 435 BT uFloat128Complex, BT uFloat128Complex, BT LongDoubleComplex, BT LongDoubleComplex, BT uFloat128xComplex, BT uFloat128xComplex, 436 }, 437 { 438 /* FB*/ BT uuFloat128, BT uuFloat128, BT uuFloat128, BT uuFloat128, BT uuFloat128, BT uuFloat128, 439 BT uuFloat128, BT uuFloat128, BT uuFloat128, BT uuFloat128, BT uuFloat128, BT uuFloat128, 440 BT uuFloat128, BT uuFloat128, BT uuFloat128, BT uFloat128Complex, BT uuFloat128, BT uFloat128Complex, 441 BT uuFloat128, BT uFloat128Complex, BT uuFloat128, BT uFloat128Complex, BT uuFloat128, BT uFloat128Complex, 442 BT uuFloat128, BT uFloat128Complex, BT uuFloat128, BT uFloat128Complex, BT uuFloat128, BT uuFloat128, 443 BT uFloat128Complex, BT uuFloat128, BT LongDouble, BT LongDoubleComplex, BT uFloat128x, BT uFloat128xComplex, 444 }, 445 { 446 /* LD*/ BT LongDouble, BT LongDouble, BT LongDouble, BT LongDouble, BT LongDouble, BT LongDouble, 447 BT LongDouble, BT LongDouble, BT LongDouble, BT LongDouble, BT LongDouble, BT LongDouble, 448 BT LongDouble, BT LongDouble, BT LongDouble, BT LongDoubleComplex, BT LongDouble, BT LongDoubleComplex, 449 BT LongDouble, BT LongDoubleComplex, BT LongDouble, BT LongDoubleComplex, BT LongDouble, BT LongDoubleComplex, 450 BT LongDouble, BT LongDoubleComplex, BT LongDouble, BT LongDoubleComplex, BT LongDouble, BT LongDouble, 451 BT LongDoubleComplex, BT LongDouble, BT LongDouble, BT LongDoubleComplex, BT uFloat128x, BT uFloat128xComplex, 452 }, 453 { 454 /* LDC*/ BT LongDoubleComplex, BT LongDoubleComplex, BT LongDoubleComplex, BT LongDoubleComplex, BT LongDoubleComplex, BT LongDoubleComplex, 455 BT LongDoubleComplex, BT LongDoubleComplex, BT LongDoubleComplex, BT LongDoubleComplex, BT LongDoubleComplex, BT LongDoubleComplex, 456 BT LongDoubleComplex, BT LongDoubleComplex, BT LongDoubleComplex, BT LongDoubleComplex, BT LongDoubleComplex, BT LongDoubleComplex, 457 BT LongDoubleComplex, BT LongDoubleComplex, BT LongDoubleComplex, BT LongDoubleComplex, BT LongDoubleComplex, BT LongDoubleComplex, 458 BT LongDoubleComplex, BT LongDoubleComplex, BT LongDoubleComplex, BT LongDoubleComplex, BT LongDoubleComplex, BT LongDoubleComplex, 459 BT LongDoubleComplex, BT LongDoubleComplex, BT LongDoubleComplex, BT LongDoubleComplex, BT uFloat128xComplex, BT uFloat128xComplex, 460 }, 461 { 462 /* _FBX*/ BT uFloat128x, BT uFloat128x, BT uFloat128x, BT uFloat128x, BT uFloat128x, BT uFloat128x, 463 BT uFloat128x, BT uFloat128x, BT uFloat128x, BT uFloat128x, BT uFloat128x, BT uFloat128x, 464 BT uFloat128x, BT uFloat128x, BT uFloat128x, BT uFloat128xComplex, BT uFloat128x, BT uFloat128xComplex, 465 BT uFloat128x, BT uFloat128xComplex, BT uFloat128x, BT uFloat128xComplex, BT uFloat128x, BT uFloat128xComplex, 466 BT uFloat128x, BT uFloat128xComplex, BT uFloat128x, BT uFloat128xComplex, BT uFloat128x, BT uFloat128x, 467 BT uFloat128xComplex, BT uFloat128x, BT uFloat128x, BT uFloat128xComplex, BT uFloat128x, BT uFloat128xComplex, 468 }, 469 { 470 /*_FLDXC*/ BT uFloat128xComplex, BT uFloat128xComplex, BT uFloat128xComplex, BT uFloat128xComplex, BT uFloat128xComplex, BT uFloat128xComplex, 471 BT uFloat128xComplex, BT uFloat128xComplex, BT uFloat128xComplex, BT uFloat128xComplex, BT uFloat128xComplex, BT uFloat128xComplex, 472 BT uFloat128xComplex, BT uFloat128xComplex, BT uFloat128xComplex, BT uFloat128xComplex, BT uFloat128xComplex, BT uFloat128xComplex, 473 BT uFloat128xComplex, BT uFloat128xComplex, BT uFloat128xComplex, BT uFloat128xComplex, BT uFloat128xComplex, BT uFloat128xComplex, 474 BT uFloat128xComplex, BT uFloat128xComplex, BT uFloat128xComplex, BT uFloat128xComplex, BT uFloat128xComplex, BT uFloat128xComplex, 475 BT uFloat128xComplex, BT uFloat128xComplex, BT uFloat128xComplex, BT uFloat128xComplex, BT uFloat128xComplex, BT uFloat128xComplex, 476 }, 477 }; // commonTypes 478 #undef BT 479 // GENERATED END 178 static const BasicType::Kind combinedType[][ BasicType::NUMBER_OF_BASIC_TYPES ] = 179 { 180 /* Bool Char SignedChar UnsignedChar ShortSignedInt ShortUnsignedInt SignedInt UnsignedInt LongSignedInt LongUnsignedInt LongLongSignedInt LongLongUnsignedInt Float Double LongDouble FloatComplex DoubleComplex LongDoubleComplex FloatImaginary DoubleImaginary LongDoubleImaginary SignedInt128 UnsignedInt128 Float80 Float128 */ 181 /* 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, BasicType::Float80, BasicType::Float128 }, 182 /* 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, BasicType::Float80, BasicType::Float128 }, 183 /* 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, BasicType::Float80, BasicType::Float128 }, 184 /* 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, BasicType::Float80, BasicType::Float128 }, 185 /* 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, BasicType::Float80, BasicType::Float128 }, 186 /* 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, BasicType::Float80, BasicType::Float128 }, 187 /* 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, BasicType::Float80, BasicType::Float128 }, 188 /* 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, BasicType::Float80, BasicType::Float128 }, 189 /* 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, BasicType::Float80, BasicType::Float128 }, 190 /* 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, BasicType::Float80, BasicType::Float128 }, 191 /* 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, BasicType::Float80, BasicType::Float128 }, 192 /* 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, BasicType::Float80, BasicType::Float128 }, 193 /* 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, BasicType::Float80, BasicType::Float128 }, 194 /* 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, BasicType::Float80, BasicType::Float128 }, 195 /* 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, BasicType::BasicType::LongDouble, BasicType::Float128 }, 196 /* 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, BasicType::LongDoubleComplex, BasicType::LongDoubleComplex, }, 197 /* 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, BasicType::LongDoubleComplex, BasicType::LongDoubleComplex }, 198 /* 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, BasicType::LongDoubleComplex, BasicType::LongDoubleComplex, }, 199 /* 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, BasicType::LongDoubleImaginary, BasicType::LongDoubleImaginary, }, 200 /* 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, BasicType::LongDoubleImaginary, BasicType::LongDoubleImaginary, }, 201 /* 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, BasicType::LongDoubleImaginary, BasicType::LongDoubleImaginary, }, 202 /* 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, BasicType::Float80, BasicType::Float128, }, 203 /* 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, BasicType::Float80, BasicType::Float128, }, 204 /* Float80 */ { BasicType::Float80, BasicType::Float80, BasicType::Float80, BasicType::Float80, BasicType::Float80, BasicType::Float80, BasicType::Float80, BasicType::Float80, BasicType::Float80, BasicType::Float80, BasicType::Float80, BasicType::Float80, BasicType::Float80, BasicType::Float80, BasicType::LongDouble, BasicType::LongDoubleComplex, BasicType::LongDoubleComplex, BasicType::LongDoubleComplex, BasicType::LongDoubleComplex, BasicType::LongDoubleComplex, BasicType::LongDoubleComplex, BasicType::Float80, BasicType::Float80, BasicType::Float80, BasicType::Float128 }, 205 /* Float128 */ { BasicType::Float128, BasicType::Float128, BasicType::Float128, BasicType::Float128, BasicType::Float128, BasicType::Float128, BasicType::Float128, BasicType::Float128, BasicType::Float128, BasicType::Float128, BasicType::Float128, BasicType::Float128, BasicType::Float128, BasicType::Float128, BasicType::Float128, BasicType::LongDoubleComplex, BasicType::LongDoubleComplex, BasicType::LongDoubleComplex, BasicType::LongDoubleComplex, BasicType::LongDoubleComplex, BasicType::LongDoubleComplex, BasicType::Float128, BasicType::Float128, BasicType::Float128, BasicType::Float128 }, 206 }; 480 207 static_assert( 481 sizeof(com monTypes)/sizeof(commonTypes[0][0]) == BasicType::NUMBER_OF_BASIC_TYPES*BasicType::NUMBER_OF_BASIC_TYPES,208 sizeof(combinedType)/sizeof(combinedType[0][0]) == BasicType::NUMBER_OF_BASIC_TYPES*BasicType::NUMBER_OF_BASIC_TYPES, 482 209 "Each basic type kind should have a corresponding row in the combined type matrix" 483 210 ); … … 491 218 void CommonType::postvisit( BasicType *basicType ) { 492 219 if ( BasicType *otherBasic = dynamic_cast< BasicType* >( type2 ) ) { 493 BasicType::Kind newType = com monTypes[ basicType->get_kind() ][ otherBasic->get_kind() ];220 BasicType::Kind newType = combinedType[ basicType->get_kind() ][ otherBasic->get_kind() ]; 494 221 if ( ( ( newType == basicType->get_kind() && basicType->get_qualifiers() >= otherBasic->get_qualifiers() ) || widenFirst ) && ( ( newType == otherBasic->get_kind() && basicType->get_qualifiers() <= otherBasic->get_qualifiers() ) || widenSecond ) ) { 495 222 result = new BasicType( basicType->get_qualifiers() | otherBasic->get_qualifiers(), newType ); … … 497 224 } else if ( dynamic_cast< EnumInstType * > ( type2 ) || dynamic_cast< ZeroType* >( type2 ) || dynamic_cast< OneType* >( type2 ) ) { 498 225 // use signed int in lieu of the enum/zero/one type 499 BasicType::Kind newType = com monTypes[ basicType->get_kind() ][ BasicType::SignedInt ];226 BasicType::Kind newType = combinedType[ basicType->get_kind() ][ BasicType::SignedInt ]; 500 227 if ( ( ( newType == basicType->get_kind() && basicType->get_qualifiers() >= type2->get_qualifiers() ) || widenFirst ) && ( ( newType != basicType->get_kind() && basicType->get_qualifiers() <= type2->get_qualifiers() ) || widenSecond ) ) { 501 228 result = new BasicType( basicType->get_qualifiers() | type2->get_qualifiers(), newType ); -
src/ResolvExpr/ConversionCost.cc
r53bb8f1 r9d9a451 10 10 // Created On : Sun May 17 07:06:19 2015 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Thu Feb 14 17:04:31 201913 // Update Count : 2312 // Last Modified On : Mon Sep 25 15:43:34 2017 13 // Update Count : 10 14 14 // 15 15 … … 28 28 29 29 namespace ResolvExpr { 30 const Cost Cost::zero = Cost{ 0, 0, 0, 0, 0, 0, 0 }; 31 const Cost Cost::infinity = Cost{ -1, -1, -1, -1, -1, 1, -1 }; 32 const Cost Cost::unsafe = Cost{ 1, 0, 0, 0, 0, 0, 0 }; 33 const Cost Cost::poly = Cost{ 0, 1, 0, 0, 0, 0, 0 }; 34 const Cost Cost::safe = Cost{ 0, 0, 1, 0, 0, 0, 0 }; 35 const Cost Cost::sign = Cost{ 0, 0, 0, 1, 0, 0, 0 }; 36 const Cost Cost::var = Cost{ 0, 0, 0, 0, 1, 0, 0 }; 37 const Cost Cost::spec = Cost{ 0, 0, 0, 0, 0, -1, 0 }; 38 const Cost Cost::reference = Cost{ 0, 0, 0, 0, 0, 0, 1 }; 30 const Cost Cost::zero = Cost{ 0, 0, 0, 0, 0, 0 }; 31 const Cost Cost::infinity = Cost{ -1, -1, -1, -1, 1, -1 }; 32 const Cost Cost::unsafe = Cost{ 1, 0, 0, 0, 0, 0 }; 33 const Cost Cost::poly = Cost{ 0, 1, 0, 0, 0, 0 }; 34 const Cost Cost::safe = Cost{ 0, 0, 1, 0, 0, 0 }; 35 const Cost Cost::var = Cost{ 0, 0, 0, 1, 0, 0 }; 36 const Cost Cost::spec = Cost{ 0, 0, 0, 0, -1, 0 }; 37 const Cost Cost::reference = Cost{ 0, 0, 0, 0, 0, 1 }; 39 38 40 39 #if 0 … … 43 42 #define PRINT(x) 44 43 #endif 45 46 44 Cost conversionCost( Type *src, Type *dest, const SymTab::Indexer &indexer, const TypeEnvironment &env ) { 47 45 if ( TypeInstType *destAsTypeInst = dynamic_cast< TypeInstType* >( dest ) ) { … … 181 179 } 182 180 183 // GENERATED START, DO NOT EDIT 184 // GENERATED BY BasicTypes-gen.cc 185 /* EXTENDED INTEGRAL RANK HIERARCHY (root to leaves) 186 _Bool 187 char signed char unsigned char 188 signed short int unsigned short int 189 signed int unsigned int 190 signed long int unsigned long int 191 signed long long int unsigned long long int 192 __int128 unsigned __int128 193 _Float16 _Float16 _Complex 194 _Float32 _Float32 _Complex 195 float float _Complex 196 _Float32x _Float32x _Complex 197 _Float64 _Float64 _Complex 198 double double _Complex 199 _Float64x _Float64x _Complex 200 __float80 201 _Float128 _Float128 _Complex 202 __float128 203 long double long double _Complex 204 _Float128x _Float128x _Complex 205 */ 206 // GENERATED END 207 208 // GENERATED START, DO NOT EDIT 209 // GENERATED BY BasicTypes-gen.cc 210 static const int costMatrix[BasicType::NUMBER_OF_BASIC_TYPES][BasicType::NUMBER_OF_BASIC_TYPES] = { // path length from root to node 211 /* B C SC UC SI SUI I UI LI LUI LLI LLUI IB UIB _FH _FH _F _FC F FC _FX _FXC FD _FDC D DC F80X_FDXC F80 _FB_FLDC FB LD LDC _FBX_FLDXC */ 212 /* B*/ { 0, 1, 1, 2, 2, 3, 3, 4, 4, 5, 5, 6, 6, 7, 7, 8, 8, 9, 9, 10, 10, 11, 11, 12, 12, 13, 13, 14, 14, 15, 15, 16, 17, 16, 18, 17, }, 213 /* C*/ { -1, 0, 1, 1, 1, 2, 2, 3, 3, 4, 4, 5, 5, 6, 6, 7, 7, 8, 8, 9, 9, 10, 10, 11, 11, 12, 12, 13, 13, 14, 14, 15, 16, 15, 17, 16, }, 214 /* SC*/ { -1, -1, 0, 1, 1, 2, 2, 3, 3, 4, 4, 5, 5, 6, 6, 7, 7, 8, 8, 9, 9, 10, 10, 11, 11, 12, 12, 13, 13, 14, 14, 15, 16, 15, 17, 16, }, 215 /* UC*/ { -1, -1, -1, 0, 1, 1, 2, 2, 3, 3, 4, 4, 5, 5, 6, 7, 7, 8, 8, 9, 9, 10, 10, 11, 11, 12, 12, 13, 13, 14, 14, 15, 16, 15, 17, 16, }, 216 /* SI*/ { -1, -1, -1, -1, 0, 1, 1, 2, 2, 3, 3, 4, 4, 5, 5, 6, 6, 7, 7, 8, 8, 9, 9, 10, 10, 11, 11, 12, 12, 13, 13, 14, 15, 14, 16, 15, }, 217 /* SUI*/ { -1, -1, -1, -1, -1, 0, 1, 1, 2, 2, 3, 3, 4, 4, 5, 6, 6, 7, 7, 8, 8, 9, 9, 10, 10, 11, 11, 12, 12, 13, 13, 14, 15, 14, 16, 15, }, 218 /* I*/ { -1, -1, -1, -1, -1, -1, 0, 1, 1, 2, 2, 3, 3, 4, 4, 5, 5, 6, 6, 7, 7, 8, 8, 9, 9, 10, 10, 11, 11, 12, 12, 13, 14, 13, 15, 14, }, 219 /* UI*/ { -1, -1, -1, -1, -1, -1, -1, 0, 1, 1, 2, 2, 3, 3, 4, 5, 5, 6, 6, 7, 7, 8, 8, 9, 9, 10, 10, 11, 11, 12, 12, 13, 14, 13, 15, 14, }, 220 /* LI*/ { -1, -1, -1, -1, -1, -1, -1, -1, 0, 1, 1, 2, 2, 3, 3, 4, 4, 5, 5, 6, 6, 7, 7, 8, 8, 9, 9, 10, 10, 11, 11, 12, 13, 12, 14, 13, }, 221 /* LUI*/ { -1, -1, -1, -1, -1, -1, -1, -1, -1, 0, 1, 1, 2, 2, 3, 4, 4, 5, 5, 6, 6, 7, 7, 8, 8, 9, 9, 10, 10, 11, 11, 12, 13, 12, 14, 13, }, 222 /* LLI*/ { -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 0, 1, 1, 2, 2, 3, 3, 4, 4, 5, 5, 6, 6, 7, 7, 8, 8, 9, 9, 10, 10, 11, 12, 11, 13, 12, }, 223 /* LLUI*/ { -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 0, 1, 1, 2, 3, 3, 4, 4, 5, 5, 6, 6, 7, 7, 8, 8, 9, 9, 10, 10, 11, 12, 11, 13, 12, }, 224 /* IB*/ { -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 0, 1, 1, 2, 2, 3, 3, 4, 4, 5, 5, 6, 6, 7, 7, 8, 8, 9, 9, 10, 11, 10, 12, 11, }, 225 /* UIB*/ { -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 0, 1, 2, 2, 3, 3, 4, 4, 5, 5, 6, 6, 7, 7, 8, 8, 9, 9, 10, 11, 10, 12, 11, }, 226 /* _FH*/ { -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 0, 1, 1, 2, 2, 3, 3, 4, 4, 5, 5, 6, 6, 7, 7, 8, 8, 9, 10, 9, 11, 10, }, 227 /* _FH*/ { -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 0, -1, 1, -1, 2, -1, 3, -1, 4, -1, 5, -1, 6, -1, -1, 7, -1, -1, 8, -1, 9, }, 228 /* _F*/ { -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 0, 1, 1, 2, 2, 3, 3, 4, 4, 5, 5, 6, 6, 7, 7, 8, 9, 8, 10, 9, }, 229 /* _FC*/ { -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 0, -1, 1, -1, 2, -1, 3, -1, 4, -1, 5, -1, -1, 6, -1, -1, 7, -1, 8, }, 230 /* F*/ { -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 0, 1, 1, 2, 2, 3, 3, 4, 4, 5, 5, 6, 6, 7, 8, 7, 9, 8, }, 231 /* FC*/ { -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 0, -1, 1, -1, 2, -1, 3, -1, 4, -1, -1, 5, -1, -1, 6, -1, 7, }, 232 /* _FX*/ { -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 0, 1, 1, 2, 2, 3, 3, 4, 4, 5, 5, 6, 7, 6, 8, 7, }, 233 /* _FXC*/ { -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 0, -1, 1, -1, 2, -1, 3, -1, -1, 4, -1, -1, 5, -1, 6, }, 234 /* FD*/ { -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 0, 1, 1, 2, 2, 3, 3, 4, 4, 5, 6, 5, 7, 6, }, 235 /* _FDC*/ { -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 0, -1, 1, -1, 2, -1, -1, 3, -1, -1, 4, -1, 5, }, 236 /* D*/ { -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 0, 1, 1, 2, 2, 3, 3, 4, 5, 4, 6, 5, }, 237 /* DC*/ { -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 0, -1, 1, -1, -1, 2, -1, -1, 3, -1, 4, }, 238 /* F80X*/ { -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 0, 1, 1, 2, 2, 3, 4, 3, 5, 4, }, 239 /* _FDXC*/ { -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 0, -1, -1, 1, -1, -1, 2, -1, 3, }, 240 /* F80*/ { -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 1, 0, 1, 2, 2, 3, 3, 4, 4, }, 241 /* _FB*/ { -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 0, 1, 1, 2, 2, 3, 3, }, 242 /* _FLDC*/ { -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 0, -1, -1, 1, -1, 2, }, 243 /* FB*/ { -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 1, 0, 1, 2, 2, 3, }, 244 /* LD*/ { -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 0, 1, 1, 2, }, 245 /* LDC*/ { -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 0, -1, 1, }, 246 /* _FBX*/ { -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 0, 1, }, 247 /*_FLDXC*/ { -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 0, }, 248 }; // costMatrix 249 // GENERATED END 181 /* 182 Old 183 === 184 Double 185 | 186 Float 187 | 188 ULong 189 / \ 190 UInt Long 191 \ / 192 Int 193 | 194 Ushort 195 | 196 Short 197 | 198 Uchar 199 / \ 200 Schar Char 201 202 New 203 === 204 +-----LongDoubleComplex--+ 205 LongDouble--+ | +-LongDoubleImag 206 | +---DoubleComplex---+ | 207 Double------+ | +----DoubleImag 208 | +-FloatComplex-+ | 209 Float---------+ +-------FloatImag 210 | 211 ULongLong 212 | 213 LongLong 214 | 215 ULong 216 / \ 217 UInt Long 218 \ / 219 Int 220 | 221 Ushort 222 | 223 Short 224 | 225 Uchar 226 / \ 227 Schar Char 228 \ / 229 Bool 230 */ 231 232 static const int costMatrix[][ BasicType::NUMBER_OF_BASIC_TYPES ] = { 233 /* 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, F80, F128 */ 234 /* Bool */ { 0, 1, 1, 2, 3, 4, 5, 6, 6, 7, 8, 9, 12, 13, 14, 12, 13, 14, -1, -1, -1, 10, 11, 14, 15}, 235 /* Char */ { -1, 0, -1, 1, 2, 3, 4, 5, 5, 6, 7, 8, 11, 12, 13, 11, 12, 13, -1, -1, -1, 9, 10, 13, 14}, 236 /* SChar */ { -1, -1, 0, 1, 2, 3, 4, 5, 5, 6, 7, 8, 11, 12, 13, 11, 12, 13, -1, -1, -1, 9, 10, 13, 14}, 237 /* UChar */ { -1, -1, -1, 0, 1, 2, 3, 4, 4, 5, 6, 7, 10, 11, 12, 10, 11, 12, -1, -1, -1, 8, 9, 12, 13}, 238 /* Short */ { -1, -1, -1, -1, 0, 1, 2, 3, 3, 4, 5, 6, 9, 10, 11, 9, 10, 11, -1, -1, -1, 7, 8, 11, 12}, 239 /* UShort */{ -1, -1, -1, -1, -1, 0, 1, 2, 2, 3, 4, 5, 8, 9, 10, 8, 9, 10, -1, -1, -1, 6, 7, 10, 11}, 240 /* Int */ { -1, -1, -1, -1, -1, -1, 0, 1, 1, 2, 3, 4, 7, 8, 9, 7, 8, 9, -1, -1, -1, 5, 6, 9, 10}, 241 /* UInt */ { -1, -1, -1, -1, -1, -1, -1, 0, -1, 1, 2, 3, 6, 7, 8, 6, 7, 8, -1, -1, -1, 4, 5, 8, 9}, 242 /* Long */ { -1, -1, -1, -1, -1, -1, -1, -1, 0, 1, 2, 3, 6, 7, 8, 6, 7, 8, -1, -1, -1, 4, 5, 8, 9}, 243 /* ULong */ { -1, -1, -1, -1, -1, -1, -1, -1, -1, 0, 1, 2, 5, 6, 7, 5, 6, 7, -1, -1, -1, 3, 4, 7, 8}, 244 /* LLong */ { -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 0, 1, 4, 5, 6, 4, 5, 6, -1, -1, -1, 2, 3, 6, 7}, 245 /* ULLong */{ -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 0, 3, 4, 5, 3, 4, 5, -1, -1, -1, 1, 2, 5, 6}, 246 247 /* Float */ { -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 0, 1, 2, 1, 2, 3, -1, -1, -1, -1, -1, 2, 3}, 248 /* Double */{ -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 0, 1, -1, 1, 2, -1, -1, -1, -1, -1, 1, 2}, 249 /* LDbl */ { -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 0, -1, -1, 1, -1, -1, -1, -1, -1, -1, 1}, 250 /* FCplex */{ -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 0, 1, 2, -1, -1, -1, -1, -1, -1, -1}, 251 /* DCplex */{ -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 0, 1, -1, -1, -1, -1, -1, -1, -1}, 252 /* LDCplex */{ -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 0, -1, -1, -1, -1, -1, -1, -1}, 253 /* FImag */ { -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 1, 2, 3, 0, 1, 2, -1, -1, -1, -1}, 254 /* DImag */ { -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 1, 2, -1, 0, 1, -1, -1, -1, -1}, 255 /* LDImag */{ -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 1, -1, -1, 0, -1, -1, -1, -1}, 256 257 /* I128 */ { -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 2, 3, 4, 3, 4, 5, -1, -1, -1, 0, 1, 4, 4}, 258 /* U128 */ { -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 1, 2, 3, 2, 3, 4, -1, -1, -1, -1, 0, 3, 3}, 259 260 /* F80 */ { -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 1, -1, -1, 1, -1, -1, -1, -1, -1, 0, 1}, 261 /* F128 */ { -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 1, -1, -1, -1, -1, -1, -1, 0}, 262 }; 250 263 static_assert( 251 264 sizeof(costMatrix)/sizeof(costMatrix[0][0]) == BasicType::NUMBER_OF_BASIC_TYPES*BasicType::NUMBER_OF_BASIC_TYPES, 252 " Missing row in the cost matrix"265 "Each basic type kind should have a corresponding row in the cost matrix" 253 266 ); 254 267 255 // GENERATED START, DO NOT EDIT256 // GENERATED BY BasicTypes-gen.cc257 static const int signMatrix[BasicType::NUMBER_OF_BASIC_TYPES][BasicType::NUMBER_OF_BASIC_TYPES] = { // number of sign changes in safe conversion258 /* B C SC UC SI SUI I UI LI LUI LLI LLUI IB UIB _FH _FH _F _FC F FC _FX _FXC FD _FDC D DC F80X_FDXC F80 _FB_FLDC FB LD LDC _FBX_FLDXC */259 /* B*/ { 0, 0, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, },260 /* C*/ { -1, 0, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, },261 /* SC*/ { -1, -1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, },262 /* UC*/ { -1, -1, -1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, },263 /* SI*/ { -1, -1, -1, -1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, },264 /* SUI*/ { -1, -1, -1, -1, -1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, },265 /* I*/ { -1, -1, -1, -1, -1, -1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, },266 /* UI*/ { -1, -1, -1, -1, -1, -1, -1, 0, 1, 0, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, },267 /* LI*/ { -1, -1, -1, -1, -1, -1, -1, -1, 0, 1, 0, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, },268 /* LUI*/ { -1, -1, -1, -1, -1, -1, -1, -1, -1, 0, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, },269 /* LLI*/ { -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 0, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, },270 /* LLUI*/ { -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, },271 /* IB*/ { -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, },272 /* UIB*/ { -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, },273 /* _FH*/ { -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, },274 /* _FH*/ { -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 0, -1, 0, -1, 0, -1, 0, -1, 0, -1, 0, -1, 0, -1, -1, 0, -1, -1, 0, -1, 0, },275 /* _F*/ { -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, },276 /* _FC*/ { -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 0, -1, 0, -1, 0, -1, 0, -1, 0, -1, 0, -1, -1, 0, -1, -1, 0, -1, 0, },277 /* F*/ { -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, },278 /* FC*/ { -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 0, -1, 0, -1, 0, -1, 0, -1, 0, -1, -1, 0, -1, -1, 0, -1, 0, },279 /* _FX*/ { -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, },280 /* _FXC*/ { -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 0, -1, 0, -1, 0, -1, 0, -1, -1, 0, -1, -1, 0, -1, 0, },281 /* FD*/ { -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, },282 /* _FDC*/ { -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 0, -1, 0, -1, 0, -1, -1, 0, -1, -1, 0, -1, 0, },283 /* D*/ { -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, },284 /* DC*/ { -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 0, -1, 0, -1, -1, 0, -1, -1, 0, -1, 0, },285 /* F80X*/ { -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, },286 /* _FDXC*/ { -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 0, -1, -1, 0, -1, -1, 0, -1, 0, },287 /* F80*/ { -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, },288 /* _FB*/ { -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 0, 0, 0, 0, 0, 0, 0, },289 /* _FLDC*/ { -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 0, -1, -1, 0, -1, 0, },290 /* FB*/ { -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 0, 0, 0, 0, 0, 0, },291 /* LD*/ { -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 0, 0, 0, 0, },292 /* LDC*/ { -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 0, -1, 0, },293 /* _FBX*/ { -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 0, 0, },294 /*_FLDXC*/ { -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 0, },295 }; // signMatrix296 // GENERATED END297 static_assert(298 sizeof(signMatrix)/sizeof(signMatrix[0][0]) == BasicType::NUMBER_OF_BASIC_TYPES*BasicType::NUMBER_OF_BASIC_TYPES,299 "Missing row in the sign matrix"300 );301 268 302 269 void ConversionCost::postvisit( VoidType * ) { … … 312 279 cost = Cost::zero; 313 280 cost.incSafe( tableResult ); 314 cost.incSign( signMatrix[ basicType->get_kind() ][ destAsBasic->get_kind() ] );315 281 } // if 316 282 } else if ( dynamic_cast< EnumInstType *>( dest ) ) { … … 334 300 // types are the same, except otherPointer has more qualifiers 335 301 cost = Cost::safe; 336 } // if302 } 337 303 } else { 338 304 int assignResult = ptrsAssignable( pointerType->base, destAsPtr->base, env ); … … 456 422 cost = Cost::zero; 457 423 cost.incSafe( tableResult + 1 ); 458 cost.incSign( signMatrix[ BasicType::SignedInt ][ destAsBasic->get_kind() ] ); 459 } // if 424 } 460 425 } else if ( dynamic_cast< PointerType* >( dest ) ) { 461 426 cost = Cost::safe; 462 } // if427 } 463 428 } 464 429 … … 474 439 cost = Cost::zero; 475 440 cost.incSafe( tableResult + 1 ); 476 cost.incSign( signMatrix[ BasicType::SignedInt ][ destAsBasic->get_kind() ] ); 477 } // if 478 } // if 441 } 442 } 479 443 } 480 444 } // namespace ResolvExpr -
src/ResolvExpr/Cost.h
r53bb8f1 r9d9a451 9 9 // Author : Richard C. Bilson 10 10 // Created On : Sun May 17 09:39:50 2015 11 // Last Modified By : Peter A. Buhr12 // Last Modified On : Thu Feb 7 20:54:29 201913 // Update Count : 811 // Last Modified By : Aaron B. Moss 12 // Last Modified On : Fri Oct 05 14:32:00 2018 13 // Update Count : 7 14 14 // 15 15 … … 21 21 class Cost { 22 22 private: 23 Cost( int unsafeCost, int polyCost, int safeCost, int signCost, 24 int varCost, int specCost, int referenceCost ); 23 Cost( int unsafeCost, int polyCost, int safeCost, int varCost, int specCost, 24 int referenceCost ); 25 25 26 public: 26 27 Cost & incUnsafe( int inc = 1 ); 27 28 Cost & incPoly( int inc = 1 ); 28 29 Cost & incSafe( int inc = 1 ); 29 Cost & incSign( int inc = 1 );30 30 Cost & incVar( int inc = 1 ); 31 31 Cost & decSpec( int inc = 1 ); … … 35 35 int get_polyCost() const { return polyCost; } 36 36 int get_safeCost() const { return safeCost; } 37 int get_signCost() const { return signCost; }38 37 int get_varCost() const { return varCost; } 39 38 int get_specCost() const { return specCost; } … … 41 40 42 41 Cost operator+( const Cost &other ) const; 42 Cost operator-( const Cost &other ) const; 43 43 Cost &operator+=( const Cost &other ); 44 44 bool operator<( const Cost &other ) const; … … 55 55 static const Cost poly; 56 56 static const Cost safe; 57 static const Cost sign;58 57 static const Cost var; 59 58 static const Cost spec; … … 64 63 int polyCost; ///< Count of parameters and return values bound to some poly type 65 64 int safeCost; ///< Safe (widening) conversions 66 int signCost; ///< Count of safe sign conversions67 65 int varCost; ///< Count of polymorphic type variables 68 66 int specCost; ///< Polymorphic type specializations (type assertions), negative cost … … 70 68 }; 71 69 72 inline Cost::Cost( int unsafeCost, int polyCost, int safeCost, int signCost,73 int varCost, int specCost, int referenceCost )74 : unsafeCost( unsafeCost ), polyCost( polyCost ), safeCost( safeCost ), signCost( signCost ),75 varCost( varCost ),specCost( specCost ), referenceCost( referenceCost ) {}70 inline Cost::Cost( int unsafeCost, int polyCost, int safeCost, int varCost, int specCost, 71 int referenceCost ) 72 : unsafeCost( unsafeCost ), polyCost( polyCost ), safeCost( safeCost ), varCost( varCost ), 73 specCost( specCost ), referenceCost( referenceCost ) {} 76 74 77 75 inline Cost & Cost::incUnsafe( int inc ) { … … 90 88 if ( *this == infinity ) return *this; 91 89 safeCost += inc; 92 return *this;93 }94 95 inline Cost & Cost::incSign( int inc ) {96 if ( *this == infinity ) return *this;97 signCost += inc;98 90 return *this; 99 91 } … … 119 111 inline Cost Cost::operator+( const Cost &other ) const { 120 112 if ( *this == infinity || other == infinity ) return infinity; 121 return Cost{ 122 unsafeCost + other.unsafeCost, polyCost + other.polyCost, safeCost + other.safeCost, 123 signCost + other.signCost, varCost + other.varCost, specCost + other.specCost,113 return Cost{ 114 unsafeCost + other.unsafeCost, polyCost + other.polyCost, safeCost + other.safeCost, 115 varCost + other.varCost, specCost + other.specCost, 124 116 referenceCost + other.referenceCost }; 117 } 118 119 inline Cost Cost::operator-( const Cost &other ) const { 120 if ( *this == infinity || other == infinity ) return infinity; 121 return Cost{ 122 unsafeCost - other.unsafeCost, polyCost - other.polyCost, safeCost - other.safeCost, 123 varCost - other.varCost, specCost - other.specCost, 124 referenceCost - other.referenceCost }; 125 125 } 126 126 … … 134 134 polyCost += other.polyCost; 135 135 safeCost += other.safeCost; 136 signCost += other.signCost;137 136 varCost += other.varCost; 138 137 specCost += other.specCost; … … 157 156 } else if ( safeCost < other.safeCost ) { 158 157 return true; 159 } else if ( signCost > other.signCost ) {160 return false;161 } else if ( signCost < other.signCost ) {162 return true;163 158 } else if ( varCost > other.varCost ) { 164 159 return false; … … 185 180 c = polyCost - other.polyCost; if ( c ) return c; 186 181 c = safeCost - other.safeCost; if ( c ) return c; 187 c = signCost - other.signCost; if ( c ) return c;188 182 c = varCost - other.varCost; if ( c ) return c; 189 183 c = specCost - other.specCost; if ( c ) return c; … … 195 189 && polyCost == other.polyCost 196 190 && safeCost == other.safeCost 197 && signCost == other.signCost198 191 && varCost == other.varCost 199 192 && specCost == other.specCost … … 206 199 207 200 inline std::ostream &operator<<( std::ostream &os, const Cost &cost ) { 208 return os << "( " << cost.unsafeCost << ", " << cost.polyCost << ", " 209 << cost.safeCost << ", " << cost.signCost << ", " 210 << cost.varCost << ", " << cost.specCost << ", " 201 return os << "( " << cost.unsafeCost << ", " << cost.polyCost << ", " 202 << cost.safeCost << ", " << cost.varCost << ", " << cost.specCost << ", " 211 203 << cost.referenceCost << " )"; 212 204 } -
src/ResolvExpr/ResolveAssertions.cc
r53bb8f1 r9d9a451 20 20 #include <list> // for list 21 21 #include <memory> // for unique_ptr 22 #include <string>23 22 #include <unordered_map> // for unordered_map, unordered_multimap 24 23 #include <utility> // for move … … 56 55 using CandidateList = std::vector<AssnCandidate>; 57 56 58 /// Unique identifier for a yet-to-be-resolved assertion59 struct AssnId {60 DeclarationWithType* decl; ///< Declaration of assertion61 AssertionSetValue info; ///< Information about assertion62 63 AssnId(DeclarationWithType* decl, const AssertionSetValue& info) : decl(decl), info(info) {}64 };65 66 /// Cached assertion items67 struct AssnCacheItem {68 CandidateList matches; ///< Possible matches for this assertion69 std::vector<AssnId> deferIds; ///< Deferred assertions which resolve to this item70 71 AssnCacheItem( CandidateList&& m ) : matches(std::move(m)), deferIds() {}72 };73 74 /// Cache of resolved assertions75 using AssnCache = std::unordered_map<std::string, AssnCacheItem>;76 77 57 /// Reference to single deferred item 78 58 struct DeferRef { 79 const AssnCacheItem& item; 59 const DeclarationWithType* decl; 60 const AssertionSetValue& info; 80 61 const AssnCandidate& match; 81 62 }; … … 84 65 /// Acts like indexed list of DeferRef 85 66 struct DeferItem { 86 const AssnCache* cache; ///< Cache storing assertion item 87 std::string key; ///< Key into cache 88 89 DeferItem( const AssnCache& cache, const std::string& key ) : cache(&cache), key(key) {} 90 91 bool empty() const { return cache->at(key).matches.empty(); } 92 93 CandidateList::size_type size() const { return cache->at(key).matches.size(); } 94 95 DeferRef operator[] ( unsigned i ) const { 96 const AssnCacheItem& item = cache->at(key); 97 return { item, item.matches[i] }; 98 } 99 100 // sortable by key 101 // TODO look into optimizing combination process with other sort orders (e.g. by number 102 // of matches in candidate) 103 bool operator< ( const DeferItem& o ) const { return key < o.key; } 104 bool operator== ( const DeferItem& o ) const { return key == o.key; } 67 DeclarationWithType* decl; 68 AssertionSetValue info; 69 CandidateList matches; 70 71 DeferItem( DeclarationWithType* decl, const AssertionSetValue& info, 72 CandidateList&& matches ) 73 : decl(decl), info(info), matches(std::move(matches)) {} 74 75 bool empty() const { return matches.empty(); } 76 77 CandidateList::size_type size() const { return matches.size(); } 78 79 DeferRef operator[] ( unsigned i ) const { return { decl, info, matches[i] }; } 105 80 }; 106 81 … … 177 152 for ( const auto& assn : x.assns ) { 178 153 k += computeConversionCost( 179 assn.match.adjType, assn.item.deferIds[0].decl->get_type(), indexer, 180 x.env ); 154 assn.match.adjType, assn.decl->get_type(), indexer, x.env ); 181 155 } 182 156 it = cache.emplace_hint( it, &x, k ); … … 234 208 candidate->get_uniqueId(), match.adjType->clone(), decl->get_type()->clone(), 235 209 varExpr }; 210 211 // // follow the current assertion's ID chain to find the correct set of inferred parameters 212 // // to add the candidate o (i.e. the set of inferred parameters belonging to the entity 213 // // which requested the assertion parameter) 214 // InferredParams* inferParams = &alt.expr->inferParams; 215 // for ( UniqueId id : info.idChain ) { 216 // inferParams = (*inferParams)[ id ].inferParams.get(); 217 // } 218 219 // (*inferParams)[ decl->get_uniqueId() ] = ParamEntry{ 220 // candidate->get_uniqueId(), match.adjType, decl->get_type()->clone(), varExpr }; 236 221 } 237 222 238 223 /// Adds a captured assertion to the symbol table 239 224 void addToIndexer( AssertionSet &assertSet, SymTab::Indexer &indexer ) { 240 for ( auto& i : assertSet) {241 if ( i .second.isUsed ) {242 indexer.addId( i .first );225 for ( AssertionSet::iterator i = assertSet.begin(); i != assertSet.end(); ++i ) { 226 if ( i->second.isUsed ) { 227 indexer.addId( i->first ); 243 228 } 244 229 } … … 249 234 250 235 /// Resolve a single assertion, in context 251 bool resolveAssertion( AssertionItem& assn, ResnState& resn , AssnCache& cache) {236 bool resolveAssertion( AssertionItem& assn, ResnState& resn ) { 252 237 // skip unused assertions 253 238 if ( ! assn.info.isUsed ) return true; 254 239 255 // check cache for this assertion 256 std::string assnKey = SymTab::Mangler::mangleAssnKey( assn.decl, resn.alt.env ); 257 auto it = cache.find( assnKey ); 258 259 // attempt to resolve assertion if this is the first time seen 260 if ( it == cache.end() ) { 261 // lookup candidates for this assertion 262 std::list< SymTab::Indexer::IdData > candidates; 263 resn.indexer.lookupId( assn.decl->name, candidates ); 264 265 // find the candidates that unify with the desired type 266 CandidateList matches; 267 for ( const auto& cdata : candidates ) { 268 DeclarationWithType* candidate = cdata.id; 269 270 // build independent unification context for candidate 271 AssertionSet have, newNeed; 272 TypeEnvironment newEnv{ resn.alt.env }; 273 OpenVarSet newOpenVars{ resn.alt.openVars }; 274 Type* adjType = candidate->get_type()->clone(); 275 adjustExprType( adjType, newEnv, resn.indexer ); 276 renameTyVars( adjType ); 277 278 // keep unifying candidates 279 if ( unify( assn.decl->get_type(), adjType, newEnv, newNeed, have, newOpenVars, 280 resn.indexer ) ) { 281 // set up binding slot for recursive assertions 282 UniqueId crntResnSlot = 0; 283 if ( ! newNeed.empty() ) { 284 crntResnSlot = ++globalResnSlot; 285 for ( auto& a : newNeed ) { 286 a.second.resnSlot = crntResnSlot; 287 } 240 // lookup candidates for this assertion 241 std::list< SymTab::Indexer::IdData > candidates; 242 resn.indexer.lookupId( assn.decl->name, candidates ); 243 244 // find the candidates that unify with the desired type 245 CandidateList matches; 246 for ( const auto& cdata : candidates ) { 247 DeclarationWithType* candidate = cdata.id; 248 249 // build independent unification context for candidate 250 AssertionSet have, newNeed; 251 TypeEnvironment newEnv{ resn.alt.env }; 252 OpenVarSet newOpenVars{ resn.alt.openVars }; 253 Type* adjType = candidate->get_type()->clone(); 254 adjustExprType( adjType, newEnv, resn.indexer ); 255 renameTyVars( adjType ); 256 257 // keep unifying candidates 258 if ( unify( assn.decl->get_type(), adjType, newEnv, newNeed, have, newOpenVars, 259 resn.indexer ) ) { 260 // set up binding slot for recursive assertions 261 UniqueId crntResnSlot = 0; 262 if ( ! newNeed.empty() ) { 263 crntResnSlot = ++globalResnSlot; 264 for ( auto& a : newNeed ) { 265 a.second.resnSlot = crntResnSlot; 288 266 } 289 290 matches.emplace_back( cdata, adjType, std::move(newEnv), std::move(have), 291 std::move(newNeed), std::move(newOpenVars), crntResnSlot ); 292 } else { 293 delete adjType; 294 } 267 } 268 // // set up idChain on new assertions 269 // for ( auto& a : newNeed ) { 270 // a.second.idChain = assn.info.idChain; 271 // a.second.idChain.push_back( assn.decl->get_uniqueId() ); 272 // } 273 274 matches.emplace_back( cdata, adjType, std::move(newEnv), std::move(have), 275 std::move(newNeed), std::move(newOpenVars), crntResnSlot ); 276 } else { 277 delete adjType; 295 278 } 296 297 it = cache.emplace_hint( it, assnKey, AssnCacheItem{ std::move(matches) } ); 298 } 299 300 CandidateList& matches = it->second.matches; 279 } 301 280 302 281 // break if no suitable assertion … … 305 284 // defer if too many suitable assertions 306 285 if ( matches.size() > 1 ) { 307 it->second.deferIds.emplace_back( assn.decl, assn.info ); 308 resn.deferred.emplace_back( cache, assnKey ); 286 resn.deferred.emplace_back( assn.decl, assn.info, std::move(matches) ); 309 287 return true; 310 288 } … … 314 292 addToIndexer( match.have, resn.indexer ); 315 293 resn.newNeed.insert( match.need.begin(), match.need.end() ); 316 resn.alt.env = match.env;317 resn.alt.openVars = match.openVars;294 resn.alt.env = std::move(match.env); 295 resn.alt.openVars = std::move(match.openVars); 318 296 319 297 bindAssertion( assn.decl, assn.info, resn.alt, match, resn.inferred ); … … 376 354 ResnList resns{ ResnState{ alt, root_indexer } }; 377 355 ResnList new_resns{}; 378 AssnCache assnCache;379 356 380 357 // resolve assertions in breadth-first-order up to a limited number of levels deep … … 385 362 for ( auto& assn : resn.need ) { 386 363 // fail early if any assertion is not resolvable 387 if ( ! resolveAssertion( assn, resn , assnCache) ) goto nextResn;364 if ( ! resolveAssertion( assn, resn ) ) goto nextResn; 388 365 } 389 366 … … 396 373 } 397 374 } else { 398 // only resolve each deferred assertion once399 std::sort( resn.deferred.begin(), resn.deferred.end() );400 auto last = std::unique( resn.deferred.begin(), resn.deferred.end() );401 resn.deferred.erase( last, resn.deferred.end() );402 375 // resolve deferred assertions by mutual compatibility 403 376 std::vector<CandidateEnvMerger::OutType> compatible = filterCombos( … … 407 380 CandidateCost coster{ resn.indexer }; 408 381 std::sort( compatible.begin(), compatible.end(), coster ); 382 // // sort by cost if pruning 383 // if ( pruneAssertions ) { 384 // auto lmin = sort_mins( compatible.begin(), compatible.end(), 385 // CandidateCost{resn.indexer} ); 386 // compatible.erase( lmin, compatible.end() ); 387 // } 409 388 410 389 // keep map of detected options … … 429 408 new_resn.newNeed.insert( match.need.begin(), match.need.end() ); 430 409 431 // for each deferred assertion with the same form 432 for ( AssnId id : r.item.deferIds ) { 433 bindAssertion( 434 id.decl, id.info, new_resn.alt, match, new_resn.inferred ); 435 } 410 bindAssertion( r.decl, r.info, new_resn.alt, match, new_resn.inferred ); 436 411 } 437 412 -
src/ResolvExpr/Resolver.cc
r53bb8f1 r9d9a451 9 9 // Author : Richard C. Bilson 10 10 // Created On : Sun May 17 12:17:01 2015 11 // Last Modified By : Peter A. Buhr12 // Last Modified On : Tue Feb 19 18:09:56 201913 // Update Count : 2 4011 // Last Modified By : Aaron B. Moss 12 // Last Modified On : Fri Oct 05 09:43:00 2018 13 // Update Count : 214 14 14 // 15 15 … … 53 53 } 54 54 55 void previsit( FunctionDecl * functionDecl );56 void postvisit( FunctionDecl * functionDecl );57 void previsit( ObjectDecl * objectDecll );55 void previsit( FunctionDecl *functionDecl ); 56 void postvisit( FunctionDecl *functionDecl ); 57 void previsit( ObjectDecl *objectDecll ); 58 58 void previsit( EnumDecl * enumDecl ); 59 59 void previsit( StaticAssertDecl * assertDecl ); … … 62 62 void previsit( PointerType * at ); 63 63 64 void previsit( ExprStmt * exprStmt );65 void previsit( AsmExpr * asmExpr );66 void previsit( AsmStmt * asmStmt );67 void previsit( IfStmt * ifStmt );68 void previsit( WhileStmt * whileStmt );69 void previsit( ForStmt * forStmt );70 void previsit( SwitchStmt * switchStmt );71 void previsit( CaseStmt * caseStmt );72 void previsit( BranchStmt * branchStmt );73 void previsit( ReturnStmt * returnStmt );74 void previsit( ThrowStmt * throwStmt );75 void previsit( CatchStmt * catchStmt );64 void previsit( ExprStmt *exprStmt ); 65 void previsit( AsmExpr *asmExpr ); 66 void previsit( AsmStmt *asmStmt ); 67 void previsit( IfStmt *ifStmt ); 68 void previsit( WhileStmt *whileStmt ); 69 void previsit( ForStmt *forStmt ); 70 void previsit( SwitchStmt *switchStmt ); 71 void previsit( CaseStmt *caseStmt ); 72 void previsit( BranchStmt *branchStmt ); 73 void previsit( ReturnStmt *returnStmt ); 74 void previsit( ThrowStmt *throwStmt ); 75 void previsit( CatchStmt *catchStmt ); 76 76 void previsit( WaitForStmt * stmt ); 77 77 78 void previsit( SingleInit * singleInit );79 void previsit( ListInit * listInit );80 void previsit( ConstructorInit * ctorInit );78 void previsit( SingleInit *singleInit ); 79 void previsit( ListInit *listInit ); 80 void previsit( ConstructorInit *ctorInit ); 81 81 private: 82 82 typedef std::list< Initializer * >::iterator InitIterator; … … 104 104 } 105 105 106 void resolveDecl( Declaration * decl, const SymTab::Indexer & indexer ) {106 void resolveDecl( Declaration * decl, const SymTab::Indexer &indexer ) { 107 107 PassVisitor<Resolver> resolver( indexer ); 108 108 maybeAccept( decl, resolver ); … … 148 148 }; 149 149 150 void finishExpr( Expression *& expr, const TypeEnvironment &env, TypeSubstitution * oldenv = nullptr ) {150 void finishExpr( Expression *&expr, const TypeEnvironment &env, TypeSubstitution * oldenv = nullptr ) { 151 151 expr->env = oldenv ? oldenv->clone() : new TypeSubstitution; 152 152 env.makeSubstitution( *expr->env ); … … 279 279 280 280 // used in resolveTypeof 281 Expression * resolveInVoidContext( Expression * expr, const SymTab::Indexer &indexer ) {281 Expression * resolveInVoidContext( Expression *expr, const SymTab::Indexer &indexer ) { 282 282 TypeEnvironment env; 283 283 return resolveInVoidContext( expr, indexer, env ); 284 284 } 285 285 286 Expression * resolveInVoidContext( Expression * expr, const SymTab::Indexer & indexer, TypeEnvironment &env ) {286 Expression * resolveInVoidContext( Expression *expr, const SymTab::Indexer &indexer, TypeEnvironment &env ) { 287 287 // it's a property of the language that a cast expression has either 1 or 0 interpretations; if it has 0 288 288 // interpretations, an exception has already been thrown. 289 289 assertf( expr, "expected a non-null expression." ); 290 290 291 CastExpr * untyped = new CastExpr( expr ); // cast to void292 untyped ->location = expr->location;291 static CastExpr untyped( nullptr ); // cast to void 292 untyped.location = expr->location; 293 293 294 294 // set up and resolve expression cast to void 295 untyped.arg = expr; 295 296 Alternative choice; 296 findUnfinishedKindExpression( untyped, choice, indexer, "", standardAlternativeFilter, ResolvMode::withAdjustment() );297 findUnfinishedKindExpression( &untyped, choice, indexer, "", standardAlternativeFilter, ResolvMode::withAdjustment() ); 297 298 CastExpr * castExpr = strict_dynamic_cast< CastExpr * >( choice.expr ); 298 assert( castExpr );299 299 env = std::move( choice.env ); 300 300 … … 304 304 305 305 // unlink the arg so that it isn't deleted twice at the end of the program 306 untyped ->arg = nullptr;306 untyped.arg = nullptr; 307 307 return ret; 308 308 } 309 309 310 void findVoidExpression( Expression *& untyped, const SymTab::Indexer & indexer ) {310 void findVoidExpression( Expression *& untyped, const SymTab::Indexer &indexer ) { 311 311 resetTyVarRenaming(); 312 312 TypeEnvironment env; … … 317 317 } 318 318 319 void findSingleExpression( Expression *& untyped, const SymTab::Indexer &indexer ) {319 void findSingleExpression( Expression *&untyped, const SymTab::Indexer &indexer ) { 320 320 findKindExpression( untyped, indexer, "", standardAlternativeFilter ); 321 321 } … … 336 336 if ( dynamic_cast< EnumInstType * >( type ) ) { 337 337 return true; 338 } else if ( BasicType * bt = dynamic_cast< BasicType * >( type ) ) {338 } else if ( BasicType *bt = dynamic_cast< BasicType * >( type ) ) { 339 339 return bt->isInteger(); 340 340 } else if ( dynamic_cast< ZeroType* >( type ) != nullptr || dynamic_cast< OneType* >( type ) != nullptr ) { … … 345 345 } 346 346 347 void findIntegralExpression( Expression *& untyped, const SymTab::Indexer & indexer ) {347 void findIntegralExpression( Expression *& untyped, const SymTab::Indexer &indexer ) { 348 348 findKindExpression( untyped, indexer, "condition", isIntegralType ); 349 349 } … … 401 401 } 402 402 403 void Resolver::previsit( ObjectDecl * objectDecl ) {403 void Resolver::previsit( ObjectDecl *objectDecl ) { 404 404 // To handle initialization of routine pointers, e.g., int (*fp)(int) = foo(), means that 405 405 // class-variable initContext is changed multiple time because the LHS is analysed twice. … … 431 431 } 432 432 433 void Resolver::previsit( FunctionDecl * functionDecl ) {433 void Resolver::previsit( FunctionDecl *functionDecl ) { 434 434 #if 0 435 435 std::cerr << "resolver visiting functiondecl "; … … 441 441 } 442 442 443 void Resolver::postvisit( FunctionDecl * functionDecl ) {443 void Resolver::postvisit( FunctionDecl *functionDecl ) { 444 444 // default value expressions have an environment which shouldn't be there and trips up 445 445 // later passes. … … 466 466 } 467 467 468 void Resolver::previsit( ExprStmt * exprStmt ) {468 void Resolver::previsit( ExprStmt *exprStmt ) { 469 469 visit_children = false; 470 470 assertf( exprStmt->expr, "ExprStmt has null Expression in resolver" ); … … 472 472 } 473 473 474 void Resolver::previsit( AsmExpr * asmExpr ) {474 void Resolver::previsit( AsmExpr *asmExpr ) { 475 475 visit_children = false; 476 476 findVoidExpression( asmExpr->operand, indexer ); … … 480 480 } 481 481 482 void Resolver::previsit( AsmStmt * asmStmt ) {482 void Resolver::previsit( AsmStmt *asmStmt ) { 483 483 visit_children = false; 484 484 acceptAll( asmStmt->get_input(), *visitor ); … … 486 486 } 487 487 488 void Resolver::previsit( IfStmt * ifStmt ) {488 void Resolver::previsit( IfStmt *ifStmt ) { 489 489 findIntegralExpression( ifStmt->condition, indexer ); 490 490 } 491 491 492 void Resolver::previsit( WhileStmt * whileStmt ) {492 void Resolver::previsit( WhileStmt *whileStmt ) { 493 493 findIntegralExpression( whileStmt->condition, indexer ); 494 494 } 495 495 496 void Resolver::previsit( ForStmt * forStmt ) {496 void Resolver::previsit( ForStmt *forStmt ) { 497 497 if ( forStmt->condition ) { 498 498 findIntegralExpression( forStmt->condition, indexer ); … … 504 504 } 505 505 506 void Resolver::previsit( SwitchStmt * switchStmt ) {506 void Resolver::previsit( SwitchStmt *switchStmt ) { 507 507 GuardValue( currentObject ); 508 508 findIntegralExpression( switchStmt->condition, indexer ); … … 511 511 } 512 512 513 void Resolver::previsit( CaseStmt * caseStmt ) {513 void Resolver::previsit( CaseStmt *caseStmt ) { 514 514 if ( caseStmt->condition ) { 515 515 std::list< InitAlternative > initAlts = currentObject.getOptions(); … … 530 530 } 531 531 532 void Resolver::previsit( BranchStmt * branchStmt ) {532 void Resolver::previsit( BranchStmt *branchStmt ) { 533 533 visit_children = false; 534 534 // must resolve the argument for a computed goto … … 541 541 } 542 542 543 void Resolver::previsit( ReturnStmt * returnStmt ) {543 void Resolver::previsit( ReturnStmt *returnStmt ) { 544 544 visit_children = false; 545 545 if ( returnStmt->expr ) { … … 548 548 } 549 549 550 void Resolver::previsit( ThrowStmt * throwStmt ) {550 void Resolver::previsit( ThrowStmt *throwStmt ) { 551 551 visit_children = false; 552 552 // TODO: Replace *exception type with &exception type. … … 560 560 } 561 561 562 void Resolver::previsit( CatchStmt * catchStmt ) {562 void Resolver::previsit( CatchStmt *catchStmt ) { 563 563 if ( catchStmt->cond ) { 564 564 findSingleExpression( catchStmt->cond, new BasicType( noQualifiers, BasicType::Bool ), indexer ); … … 724 724 725 725 } 726 catch( SemanticErrorException & e ) {726 catch( SemanticErrorException &e ) { 727 727 errors.append( e ); 728 728 } 729 729 } 730 730 } 731 catch( SemanticErrorException & e ) {731 catch( SemanticErrorException &e ) { 732 732 errors.append( e ); 733 733 } … … 781 781 } 782 782 783 void Resolver::previsit( SingleInit * singleInit ) {783 void Resolver::previsit( SingleInit *singleInit ) { 784 784 visit_children = false; 785 785 // resolve initialization using the possibilities as determined by the currentObject cursor … … 813 813 if ( PointerType * pt = dynamic_cast< PointerType *>( newExpr->get_result() ) ) { 814 814 if ( isCharType( pt->get_base() ) ) { 815 if ( CastExpr * ce = dynamic_cast< CastExpr * >( newExpr ) ) {815 if ( CastExpr *ce = dynamic_cast< CastExpr * >( newExpr ) ) { 816 816 // strip cast if we're initializing a char[] with a char *, 817 817 // e.g. char x[] = "hello"; … … 893 893 } 894 894 895 void Resolver::previsit( ConstructorInit * ctorInit ) {895 void Resolver::previsit( ConstructorInit *ctorInit ) { 896 896 visit_children = false; 897 897 // xxx - fallback init has been removed => remove fallbackInit function and remove complexity from FixInit and remove C-init from ConstructorInit -
src/ResolvExpr/Resolver.h
r53bb8f1 r9d9a451 10 10 // Created On : Sun May 17 12:18:34 2015 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Mon Feb 18 20:40:38 201913 // Update Count : 412 // Last Modified On : Sat Jul 22 09:36:57 2017 13 // Update Count : 3 14 14 // 15 15 … … 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 );35 void findSingleExpression( Expression *& untyped, Type * type, const SymTab::Indexer & indexer );31 void resolveDecl( Declaration *, const SymTab::Indexer &indexer ); 32 Expression *resolveInVoidContext( Expression * expr, const SymTab::Indexer &indexer ); 33 void findVoidExpression( Expression *& untyped, const SymTab::Indexer &indexer ); 34 void findSingleExpression( Expression *& untyped, const SymTab::Indexer &indexer ); 35 void findSingleExpression( Expression *& untyped, Type * type, const SymTab::Indexer &indexer ); 36 36 void resolveCtorInit( ConstructorInit * ctorInit, const SymTab::Indexer & indexer ); 37 37 void resolveStmtExpr( StmtExpr * stmtExpr, const SymTab::Indexer & indexer ); -
src/ResolvExpr/module.mk
r53bb8f1 r9d9a451 15 15 ############################################################################### 16 16 17 SRC_RESOLVEXPR = \ 18 ResolvExpr/AdjustExprType.cc \ 19 ResolvExpr/Alternative.cc \ 20 ResolvExpr/AlternativeFinder.cc \ 21 ResolvExpr/CastCost.cc \ 22 ResolvExpr/CommonType.cc \ 23 ResolvExpr/ConversionCost.cc \ 24 ResolvExpr/CurrentObject.cc \ 25 ResolvExpr/ExplodedActual.cc \ 26 ResolvExpr/FindOpenVars.cc \ 27 ResolvExpr/Occurs.cc \ 28 ResolvExpr/PolyCost.cc \ 29 ResolvExpr/PtrsAssignable.cc \ 30 ResolvExpr/PtrsCastable.cc \ 31 ResolvExpr/RenameVars.cc \ 32 ResolvExpr/ResolveAssertions.cc \ 33 ResolvExpr/Resolver.cc \ 34 ResolvExpr/ResolveTypeof.cc \ 35 ResolvExpr/SpecCost.cc \ 36 ResolvExpr/TypeEnvironment.cc \ 37 ResolvExpr/Unify.cc 38 39 SRC += $(SRC_RESOLVEXPR) ResolvExpr/AlternativePrinter.cc 40 SRCDEMANGLE += $(SRC_RESOLVEXPR) 17 SRC += ResolvExpr/AlternativeFinder.cc \ 18 ResolvExpr/Alternative.cc \ 19 ResolvExpr/Unify.cc \ 20 ResolvExpr/PtrsAssignable.cc \ 21 ResolvExpr/CommonType.cc \ 22 ResolvExpr/ConversionCost.cc \ 23 ResolvExpr/CastCost.cc \ 24 ResolvExpr/PtrsCastable.cc \ 25 ResolvExpr/AdjustExprType.cc \ 26 ResolvExpr/AlternativePrinter.cc \ 27 ResolvExpr/Resolver.cc \ 28 ResolvExpr/ResolveTypeof.cc \ 29 ResolvExpr/RenameVars.cc \ 30 ResolvExpr/FindOpenVars.cc \ 31 ResolvExpr/PolyCost.cc \ 32 ResolvExpr/Occurs.cc \ 33 ResolvExpr/TypeEnvironment.cc \ 34 ResolvExpr/CurrentObject.cc \ 35 ResolvExpr/ExplodedActual.cc \ 36 ResolvExpr/SpecCost.cc \ 37 ResolvExpr/ResolveAssertions.cc -
src/ResolvExpr/typeops.h
r53bb8f1 r9d9a451 10 10 // Created On : Sun May 17 07:28:22 2015 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Fri Feb 8 09:30:34 201913 // Update Count : 412 // Last Modified On : Sat Jul 22 09:36:18 2017 13 // Update Count : 3 14 14 // 15 15 … … 101 101 102 102 // in CommonType.cc 103 Type * commonType( Type *type1, Type *type2, bool widenFirst, bool widenSecond, const SymTab::Indexer &indexer, TypeEnvironment &env, const OpenVarSet &openVars );103 Type *commonType( Type *type1, Type *type2, bool widenFirst, bool widenSecond, const SymTab::Indexer &indexer, TypeEnvironment &env, const OpenVarSet &openVars ); 104 104 105 105 // in PolyCost.cc -
src/SymTab/Indexer.cc
r53bb8f1 r9d9a451 26 26 #include "Common/SemanticError.h" // for SemanticError 27 27 #include "Common/utility.h" // for cloneAll 28 #include "Common/Stats/Counter.h" // for counters29 28 #include "GenPoly/GenPoly.h" 30 29 #include "InitTweak/InitTweak.h" // for isConstructor, isCopyFunction, isC... … … 42 41 43 42 namespace SymTab { 44 45 // Statistics block46 namespace {47 48 static inline auto stats_idtable() {49 using namespace Stats::Counters;50 static auto group = build<CounterGroup>("IdTable");51 static struct {52 SimpleCounter * find;53 AverageCounter<double> * size;54 AverageCounter<double> * key;55 } ret = {56 .find = build<SimpleCounter>("Find calls", group),57 .size = build<AverageCounter<double>>("Average Size", group),58 .key = build<AverageCounter<double>>("Average Key Size", group),59 };60 return ret;61 }62 63 static inline auto stats_indexers() {64 using namespace Stats::Counters;65 static auto group = build<CounterGroup>("Indexers");66 static struct {67 SimpleCounter * count;68 AverageCounter<double> * size;69 AverageCounter<double> * depth_a;70 MaxCounter<size_t> * depth_m;71 } ret = {72 .count = build<SimpleCounter>("Count", group),73 .size = build<AverageCounter<double>>("Average Size", group),74 .depth_a = build<AverageCounter<double>>("Average Depth", group),75 .depth_m = build<MaxCounter<size_t>>("Max Depth", group),76 };77 return ret;78 }79 }80 81 43 std::ostream & operator<<( std::ostream & out, const Indexer::IdData & data ) { 82 44 return out << "(" << data.id << "," << data.baseExpr << ")"; … … 235 197 } 236 198 237 Indexer::Indexer() : tables( 0 ), scope( 0 ) { 238 (*stats_indexers().count)++; 239 } 240 241 Indexer::Indexer( const Indexer &that ) : doDebug( that.doDebug ), tables( newRef( that.tables ) ), scope( that.scope ) { 242 (*stats_indexers().count)++; 243 } 199 Indexer::Indexer() : tables( 0 ), scope( 0 ) {} 200 201 Indexer::Indexer( const Indexer &that ) : doDebug( that.doDebug ), tables( newRef( that.tables ) ), scope( that.scope ) {} 244 202 245 203 Indexer::Indexer( Indexer &&that ) : doDebug( that.doDebug ), tables( that.tables ), scope( that.scope ) { … … 248 206 249 207 Indexer::~Indexer() { 250 if(tables) {251 stats_indexers().size->push( tables->idTable.size() );252 size_t depth = 1;253 for( auto crnt = tables->base.tables; crnt; crnt = crnt->base.tables ) {254 ++depth;255 }256 stats_indexers().depth_a->push( depth );257 stats_indexers().depth_m->push( depth );258 }259 208 deleteRef( tables ); 260 209 } … … 288 237 while ( searchTables ) { 289 238 290 (*stats_idtable().find)++;291 stats_idtable().key->push( id.size() );292 stats_idtable().size->push( searchTables->idTable.size() );293 239 IdTable::const_iterator decls = searchTables->idTable.find( id ); 294 240 if ( decls != searchTables->idTable.end() ) { … … 367 313 if ( tables->scope < scope ) return nullptr; 368 314 369 (*stats_idtable().find)++;370 stats_idtable().key->push( id.size() );371 stats_idtable().size->push( tables->idTable.size() );372 315 IdTable::const_iterator decls = tables->idTable.find( id ); 373 316 if ( decls != tables->idTable.end() ) { … … 388 331 if ( tables->scope < scope ) return false; 389 332 390 (*stats_idtable().find)++;391 stats_idtable().key->push( id.size() );392 stats_idtable().size->push( tables->idTable.size() );393 333 IdTable::const_iterator decls = tables->idTable.find( id ); 394 334 if ( decls != tables->idTable.end() ) { … … 407 347 if ( tables->scope < scope ) return false; 408 348 409 (*stats_idtable().find)++;410 stats_idtable().key->push( id.size() );411 stats_idtable().size->push( tables->idTable.size() );412 349 IdTable::const_iterator decls = tables->idTable.find( id ); 413 350 if ( decls != tables->idTable.end() ) { -
src/SymTab/Mangler.cc
r53bb8f1 r9d9a451 15 15 #include "Mangler.h" 16 16 17 #include <algorithm> // for copy, transform18 #include <cassert> // for assert, assertf19 #include <functional> // for const_mem_fun_t, mem_fun20 #include <iterator> // for ostream_iterator, back_insert_ite...21 #include <list> // for _List_iterator, list, _List_const...22 #include <string> // for string, char_traits, operator<<23 24 #include "CodeGen/OperatorTable.h" // for OperatorInfo, operatorLookup17 #include <algorithm> // for copy, transform 18 #include <cassert> // for assert, assertf 19 #include <functional> // for const_mem_fun_t, mem_fun 20 #include <iterator> // for ostream_iterator, back_insert_ite... 21 #include <list> // for _List_iterator, list, _List_const... 22 #include <string> // for string, char_traits, operator<< 23 24 #include "CodeGen/OperatorTable.h" // for OperatorInfo, operatorLookup 25 25 #include "Common/PassVisitor.h" 26 #include "Common/SemanticError.h" // for SemanticError 27 #include "Common/utility.h" // for toString 28 #include "Parser/LinkageSpec.h" // for Spec, isOverridable, AutoGen, Int... 29 #include "ResolvExpr/TypeEnvironment.h" // for TypeEnvironment 30 #include "SynTree/Declaration.h" // for TypeDecl, DeclarationWithType 31 #include "SynTree/Expression.h" // for TypeExpr, Expression, operator<< 32 #include "SynTree/Type.h" // for Type, ReferenceToType, Type::Fora... 26 #include "Common/SemanticError.h" // for SemanticError 27 #include "Common/utility.h" // for toString 28 #include "Parser/LinkageSpec.h" // for Spec, isOverridable, AutoGen, Int... 29 #include "SynTree/Declaration.h" // for TypeDecl, DeclarationWithType 30 #include "SynTree/Expression.h" // for TypeExpr, Expression, operator<< 31 #include "SynTree/Type.h" // for Type, ReferenceToType, Type::Fora... 33 32 34 33 namespace SymTab { … … 38 37 struct Mangler : public WithShortCircuiting, public WithVisitorRef<Mangler>, public WithGuards { 39 38 Mangler( bool mangleOverridable, bool typeMode, bool mangleGenericParams ); 40 Mangler( const ResolvExpr::TypeEnvironment& env );41 39 Mangler( const Mangler & ) = delete; 42 40 … … 67 65 private: 68 66 std::ostringstream mangleName; ///< Mangled name being constructed 69 typedef std::map< std::string, std::pair< std::string, int > > VarMapType;67 typedef std::map< std::string, std::pair< int, int > > VarMapType; 70 68 VarMapType varNums; ///< Map of type variables to indices 71 69 int nextVarNum; ///< Next type variable index 72 const ResolvExpr::TypeEnvironment* env; ///< optional environment for substitutions73 70 bool isTopLevel; ///< Is the Mangler at the top level 74 71 bool mangleOverridable; ///< Specially mangle overridable built-in methods … … 78 75 bool inQualifiedType = false; ///< Add start/end delimiters around qualified type 79 76 80 public:81 Mangler( bool mangleOverridable, bool typeMode, bool mangleGenericParams,82 int nextVarNum, const ResolvExpr::TypeEnvironment* env,83 const VarMapType& varNums );84 85 private:86 77 void mangleDecl( DeclarationWithType *declaration ); 87 78 void mangleRef( ReferenceToType *refType, std::string prefix ); … … 109 100 } 110 101 111 std::string mangleAssnKey( DeclarationWithType* decl,112 const ResolvExpr::TypeEnvironment& env ) {113 PassVisitor<Mangler> mangler( env );114 maybeAccept( decl, mangler );115 return mangler.pass.get_mangleName();116 }117 118 102 namespace { 119 103 Mangler::Mangler( bool mangleOverridable, bool typeMode, bool mangleGenericParams ) 120 : nextVarNum( 0 ), env(nullptr), isTopLevel( true ), 121 mangleOverridable( mangleOverridable ), typeMode( typeMode ), 122 mangleGenericParams( mangleGenericParams ) {} 123 124 Mangler::Mangler( const ResolvExpr::TypeEnvironment& env ) 125 : nextVarNum( 0 ), env( &env ), isTopLevel( true ), mangleOverridable( false ), 126 typeMode( false ), mangleGenericParams( true ) {} 127 128 Mangler::Mangler( bool mangleOverridable, bool typeMode, bool mangleGenericParams, 129 int nextVarNum, const ResolvExpr::TypeEnvironment* env, 130 const VarMapType& varNums ) 131 : varNums( varNums ), nextVarNum( nextVarNum ), env( env ), isTopLevel( false ), 132 mangleOverridable( mangleOverridable ), typeMode( typeMode ), 133 mangleGenericParams( mangleGenericParams ) {} 104 : nextVarNum( 0 ), isTopLevel( true ), mangleOverridable( mangleOverridable ), typeMode( typeMode ), mangleGenericParams( mangleGenericParams ) {} 134 105 135 106 void Mangler::mangleDecl( DeclarationWithType * declaration ) { … … 358 329 assert( false ); 359 330 } // switch 360 std::string varName; 361 // replace type with substitution name if environment is available and bound 362 if ( env ) { 363 const ResolvExpr::EqvClass* varClass = env->lookup( (*i)->name ); 364 if ( varClass && varClass->type ) { 365 PassVisitor<Mangler> sub_mangler( 366 mangleOverridable, typeMode, mangleGenericParams, nextVarNum, 367 env, varNums ); 368 varClass->type->accept( sub_mangler ); 369 varName = std::string{"%"} + sub_mangler.pass.get_mangleName(); 370 } 371 } 372 // otherwise just give type numeric name 373 if ( varName.empty() ) { 374 varName = std::to_string( nextVarNum++ ); 375 } 376 varNums[ (*i)->name ] = std::make_pair( varName, (int)(*i)->get_kind() ); 331 varNums[ (*i)->name ] = std::pair< int, int >( nextVarNum++, (int)(*i)->get_kind() ); 377 332 for ( std::list< DeclarationWithType* >::iterator assert = (*i)->assertions.begin(); assert != (*i)->assertions.end(); ++assert ) { 378 PassVisitor<Mangler> sub_mangler( 379 mangleOverridable, typeMode, mangleGenericParams, nextVarNum, env, 380 varNums ); 333 PassVisitor<Mangler> sub_mangler( mangleOverridable, typeMode, mangleGenericParams ); 334 sub_mangler.pass.nextVarNum = nextVarNum; 335 sub_mangler.pass.isTopLevel = false; 336 sub_mangler.pass.varNums = varNums; 381 337 (*assert)->accept( sub_mangler ); 382 assertionNames.push_back( sub_mangler.pass. get_mangleName() );338 assertionNames.push_back( sub_mangler.pass.mangleName.str() ); 383 339 acount++; 384 340 } // for -
src/SymTab/Mangler.h
r53bb8f1 r9d9a451 31 31 // * Currently name compression is not implemented. 32 32 33 namespace ResolvExpr {34 class TypeEnvironment;35 }36 37 33 namespace SymTab { 38 34 namespace Mangler { … … 44 40 /// Mangle ignoring generic type parameters 45 41 std::string mangleConcrete( Type* ty ); 46 /// Mangle for assertion key47 std::string mangleAssnKey( DeclarationWithType* decl,48 const ResolvExpr::TypeEnvironment& env );49 42 50 43 namespace Encoding { -
src/SymTab/ManglerCommon.cc
r53bb8f1 r9d9a451 10 10 // Created On : Sun May 17 21:44:03 2015 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Thu Feb 14 17:06:37 201913 // Update Count : 2612 // Last Modified On : Sat Jul 22 09:45:30 2017 13 // Update Count : 15 14 14 // 15 15 … … 23 23 const std::string manglePrefix = "_X"; 24 24 25 // GENERATED START, DO NOT EDIT 26 // GENERATED BY BasicTypes-gen.cc 27 // NOTES ON MANGLING: 28 // * Itanium spec says that Float80 encodes to "e" (like LongDouble), but the distinct lengths cause resolution problems. 29 // * Float128 is supposed to encode to "g", but I wanted it to mangle equal to LongDouble. 30 // * Mangling for non-standard complex types is by best guess 31 // * _FloatN is supposed to encode as "DF"N"_"; modified for same reason as above. 32 // * unused mangling identifiers: 33 // - "z" ellipsis 34 // - "Dd" IEEE 754r 64-bit decimal floating point (borrowed for _Float32x) 35 // - "De" IEEE 754r 128-bit decimal floating point 36 // - "Df" IEEE 754r 32-bit decimal floating point 37 // - "Dh" IEEE 754r 16-bit decimal floating point (borrowed for _Float16) 38 // - "DF"N"_" ISO/IEC TS 18661 N-bit binary floating point (_FloatN) 39 // - "Di" char32_t 40 // - "Ds" char16_t 41 const std::string basicTypes[BasicType::NUMBER_OF_BASIC_TYPES] = { 42 "b", // _Bool 43 "c", // char 44 "a", // signed char 45 "h", // unsigned char 46 "s", // signed short int 47 "t", // unsigned short int 48 "i", // signed int 49 "j", // unsigned int 50 "l", // signed long int 51 "m", // unsigned long int 52 "x", // signed long long int 53 "y", // unsigned long long int 54 "n", // __int128 55 "o", // unsigned __int128 56 "DF16_", // _Float16 57 "CDF16_", // _Float16 _Complex 58 "DF32_", // _Float32 59 "CDF32_", // _Float32 _Complex 60 "f", // float 61 "Cf", // float _Complex 62 "DF32x_", // _Float32x 63 "CDF32x_", // _Float32x _Complex 64 "DF64_", // _Float64 65 "CDF64_", // _Float64 _Complex 66 "d", // double 67 "Cd", // double _Complex 68 "DF64x_", // _Float64x 69 "CDF64x_", // _Float64x _Complex 70 "Dq", // __float80 71 "DF128_", // _Float128 72 "CDF128_", // _Float128 _Complex 73 "g", // __float128 74 "e", // long double 75 "Ce", // long double _Complex 76 "DF128x_", // _Float128x 77 "CDF128x_", // _Float128x _Complex 78 }; // basicTypes 79 // GENERATED END 25 const std::string basicTypes[] = { 26 "b", // Bool 27 "c", // Char 28 "a", // SignedChar 29 "h", // UnsignedChar 30 "s", // ShortSignedInt 31 "t", // ShortUnsignedInt 32 "i", // SignedInt 33 "j", // UnsignedInt 34 "l", // LongSignedInt 35 "m", // LongUnsignedInt 36 "x", // LongLongSignedInt 37 "y", // LongLongUnsignedInt 38 "f", // Float 39 "d", // Double 40 "e", // LongDouble 41 "Cf", // FloatComplex 42 "Cd", // DoubleComplex 43 "Ce", // LongDoubleComplex 44 // Note: imaginary is not an overloadable type in C++ 45 "If", // FloatImaginary 46 "Id", // DoubleImaginary 47 "Ie", // LongDoubleImaginary 48 "n", // SignedInt128 49 "o", // UnsignedInt128 50 "Dq", // Float80 -- TODO: itanium says Float80 and LongDouble both encode to "e", but doing this causes problems with constructing long double, because the cost tables are incorrect 51 "g", // Float128 52 // "z", // ellipsis 53 // "Dd" // # IEEE 754r decimal floating point (64 bits) 54 // "De" // # IEEE 754r decimal floating point (128 bits) 55 // "Df" // # IEEE 754r decimal floating point (32 bits) 56 // "Dh" // # IEEE 754r half-precision floating point (16 bits) 57 // "DF"N_ // # ISO/IEC TS 18661 binary floating point type _FloatN (N bits) 58 // "Di" // char32_t 59 // "Ds" // char16_t 60 }; 80 61 static_assert( 81 62 sizeof(basicTypes)/sizeof(basicTypes[0]) == BasicType::NUMBER_OF_BASIC_TYPES, -
src/SymTab/Validate.cc
r53bb8f1 r9d9a451 49 49 #include "CodeGen/OperatorTable.h" // for isCtorDtor, isCtorDtorAssign 50 50 #include "ControlStruct/Mutate.h" // for ForExprMutator 51 #include "Common/Stats.h" // for Stats::Heap52 51 #include "Common/PassVisitor.h" // for PassVisitor, WithDeclsToAdd 53 52 #include "Common/ScopedMap.h" // for ScopedMap … … 304 303 PassVisitor<FixQualifiedTypes> fixQual; 305 304 306 { 307 Stats::Heap::newPass("validate-A"); 308 Stats::Time::BlockGuard guard("validate-A"); 309 acceptAll( translationUnit, hoistDecls ); 310 ReplaceTypedef::replaceTypedef( translationUnit ); 311 ReturnTypeFixer::fix( translationUnit ); // must happen before autogen 312 acceptAll( translationUnit, epc ); // must happen before VerifyCtorDtorAssign, because void return objects should not exist; before LinkReferenceToTypes because it is an indexer and needs correct types for mangling 313 } 314 { 315 Stats::Heap::newPass("validate-B"); 316 Stats::Time::BlockGuard guard("validate-B"); 317 Stats::Time::TimeBlock("Link Reference To Types", [&]() { 318 acceptAll( translationUnit, lrt ); // must happen before autogen, because sized flag needs to propagate to generated functions 319 }); 320 Stats::Time::TimeBlock("Fix Qualified Types", [&]() { 321 mutateAll( translationUnit, fixQual ); // must happen after LinkReferenceToTypes, because aggregate members are accessed 322 }); 323 Stats::Time::TimeBlock("Hoist Structs", [&]() { 324 HoistStruct::hoistStruct( translationUnit ); // must happen after EliminateTypedef, so that aggregate typedefs occur in the correct order 325 }); 326 Stats::Time::TimeBlock("Eliminate Typedefs", [&]() { 327 EliminateTypedef::eliminateTypedef( translationUnit ); // 328 }); 329 } 330 { 331 Stats::Heap::newPass("validate-C"); 332 Stats::Time::BlockGuard guard("validate-C"); 333 acceptAll( translationUnit, genericParams ); // check as early as possible - can't happen before LinkReferenceToTypes 334 VerifyCtorDtorAssign::verify( translationUnit ); // must happen before autogen, because autogen examines existing ctor/dtors 335 ReturnChecker::checkFunctionReturns( translationUnit ); 336 InitTweak::fixReturnStatements( translationUnit ); // must happen before autogen 337 } 338 { 339 Stats::Heap::newPass("validate-D"); 340 Stats::Time::BlockGuard guard("validate-D"); 341 Stats::Time::TimeBlock("Apply Concurrent Keywords", [&]() { 342 Concurrency::applyKeywords( translationUnit ); 343 }); 344 Stats::Time::TimeBlock("Forall Pointer Decay", [&]() { 345 acceptAll( translationUnit, fpd ); // must happen before autogenerateRoutines, after Concurrency::applyKeywords because uniqueIds must be set on declaration before resolution 346 }); 347 Stats::Time::TimeBlock("Hoist Control Declarations", [&]() { 348 ControlStruct::hoistControlDecls( translationUnit ); // hoist initialization out of for statements; must happen before autogenerateRoutines 349 }); 350 Stats::Time::TimeBlock("Generate Autogen routines", [&]() { 351 autogenerateRoutines( translationUnit ); // moved up, used to be below compoundLiteral - currently needs EnumAndPointerDecay 352 }); 353 } 354 { 355 Stats::Heap::newPass("validate-E"); 356 Stats::Time::BlockGuard guard("validate-E"); 357 Stats::Time::TimeBlock("Implement Mutex Func", [&]() { 358 Concurrency::implementMutexFuncs( translationUnit ); 359 }); 360 Stats::Time::TimeBlock("Implement Thread Start", [&]() { 361 Concurrency::implementThreadStarter( translationUnit ); 362 }); 363 Stats::Time::TimeBlock("Compound Literal", [&]() { 364 mutateAll( translationUnit, compoundliteral ); 365 }); 366 Stats::Time::TimeBlock("Resolve With Expressions", [&]() { 367 ResolvExpr::resolveWithExprs( translationUnit ); // must happen before FixObjectType because user-code is resolved and may contain with variables 368 }); 369 } 370 { 371 Stats::Heap::newPass("validate-F"); 372 Stats::Time::BlockGuard guard("validate-F"); 373 Stats::Time::TimeBlock("Fix Object Type", [&]() { 374 FixObjectType::fix( translationUnit ); 375 }); 376 Stats::Time::TimeBlock("Array Length", [&]() { 377 ArrayLength::computeLength( translationUnit ); 378 }); 379 Stats::Time::TimeBlock("Find Special Declarations", [&]() { 380 acceptAll( translationUnit, finder ); // xxx - remove this pass soon 381 }); 382 Stats::Time::TimeBlock("Fix Label Address", [&]() { 383 mutateAll( translationUnit, labelAddrFixer ); 384 }); 385 Stats::Time::TimeBlock("Handle Attributes", [&]() { 386 Validate::handleAttributes( translationUnit ); 387 }); 388 } 305 acceptAll( translationUnit, hoistDecls ); 306 ReplaceTypedef::replaceTypedef( translationUnit ); 307 ReturnTypeFixer::fix( translationUnit ); // must happen before autogen 308 acceptAll( translationUnit, epc ); // must happen before VerifyCtorDtorAssign, because void return objects should not exist; before LinkReferenceToTypes because it is an indexer and needs correct types for mangling 309 acceptAll( translationUnit, lrt ); // must happen before autogen, because sized flag needs to propagate to generated functions 310 mutateAll( translationUnit, fixQual ); // must happen after LinkReferenceToTypes, because aggregate members are accessed 311 HoistStruct::hoistStruct( translationUnit ); // must happen after EliminateTypedef, so that aggregate typedefs occur in the correct order 312 EliminateTypedef::eliminateTypedef( translationUnit ); // 313 acceptAll( translationUnit, genericParams ); // check as early as possible - can't happen before LinkReferenceToTypes 314 VerifyCtorDtorAssign::verify( translationUnit ); // must happen before autogen, because autogen examines existing ctor/dtors 315 ReturnChecker::checkFunctionReturns( translationUnit ); 316 InitTweak::fixReturnStatements( translationUnit ); // must happen before autogen 317 Concurrency::applyKeywords( translationUnit ); 318 acceptAll( translationUnit, fpd ); // must happen before autogenerateRoutines, after Concurrency::applyKeywords because uniqueIds must be set on declaration before resolution 319 ControlStruct::hoistControlDecls( translationUnit ); // hoist initialization out of for statements; must happen before autogenerateRoutines 320 autogenerateRoutines( translationUnit ); // moved up, used to be below compoundLiteral - currently needs EnumAndPointerDecay 321 Concurrency::implementMutexFuncs( translationUnit ); 322 Concurrency::implementThreadStarter( translationUnit ); 323 mutateAll( translationUnit, compoundliteral ); 324 ResolvExpr::resolveWithExprs( translationUnit ); // must happen before FixObjectType because user-code is resolved and may contain with variables 325 FixObjectType::fix( translationUnit ); 326 ArrayLength::computeLength( translationUnit ); 327 acceptAll( translationUnit, finder ); // xxx - remove this pass soon 328 mutateAll( translationUnit, labelAddrFixer ); 329 Validate::handleAttributes( translationUnit ); 389 330 } 390 331 -
src/SymTab/module.mk
r53bb8f1 r9d9a451 15 15 ############################################################################### 16 16 17 SRC_SYMTAB = \ 18 SymTab/Autogen.cc \ 19 SymTab/FixFunction.cc \ 20 SymTab/Indexer.cc \ 21 SymTab/Mangler.cc \ 22 SymTab/ManglerCommon.cc \ 23 SymTab/Validate.cc 24 25 SRC += $(SRC_SYMTAB) 26 SRCDEMANGLE += $(SRC_SYMTAB) SymTab/Demangle.cc 17 SRC += SymTab/Indexer.cc \ 18 SymTab/Mangler.cc \ 19 SymTab/ManglerCommon.cc \ 20 SymTab/Validate.cc \ 21 SymTab/FixFunction.cc \ 22 SymTab/Autogen.cc -
src/SynTree/AddressExpr.cc
r53bb8f1 r9d9a451 9 9 // Author : Richard C. Bilson 10 10 // Created On : Sun May 17 23:54:44 2015 11 // Last Modified By : Peter A. Buhr12 // Last Modified On : T hu Feb 28 13:13:38 201913 // Update Count : 1011 // Last Modified By : Rob Schluntz 12 // Last Modified On : Tue Apr 26 12:35:13 2016 13 // Update Count : 6 14 14 // 15 15 … … 47 47 } else { 48 48 // taking address of non-lvalue -- must be a reference, loses one layer of reference 49 if ( ReferenceType * refType = dynamic_cast< ReferenceType * >( arg->result ) ) { 50 set_result( addrType( refType->base ) ); 51 } else { 52 SemanticError( arg->result, "Attempt to take address of non-lvalue expression: " ); 53 } // if 49 ReferenceType * refType = strict_dynamic_cast< ReferenceType * >( arg->result ); 50 set_result( addrType( refType->base ) ); 54 51 } 55 52 // result of & is never an lvalue -
src/SynTree/BasicType.cc
r53bb8f1 r9d9a451 10 10 // Created On : Mon May 18 07:44:20 2015 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Thu Jan 31 21:37:36 201913 // Update Count : 1 212 // Last Modified On : Mon Sep 25 14:14:03 2017 13 // Update Count : 11 14 14 // 15 15 … … 30 30 31 31 bool BasicType::isInteger() const { 32 return kind <= UnsignedInt128;33 #if 034 32 switch ( kind ) { 35 33 case Bool: … … 65 63 assert( false ); 66 64 return false; 67 #endif68 65 } 69 66 -
src/SynTree/Constant.cc
r53bb8f1 r9d9a451 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 : Wed Feb 13 18:11:22 201913 // Update Count : 3 211 // Last Modified By : Andrew Beach 12 // Last Modified On : Fri Spt 28 14:49:00 2018 13 // Update Count : 30 14 14 // 15 15 -
src/SynTree/Expression.cc
r53bb8f1 r9d9a451 10 10 // Created On : Mon May 18 07:44:20 2015 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Tue Feb 19 18:10:55 201913 // Update Count : 6012 // Last Modified On : Tue Jul 25 14:15:47 2017 13 // Update Count : 54 14 14 // 15 15 … … 33 33 #include "GenPoly/Lvalue.h" 34 34 35 void printInferParams( const InferredParams & inferParams, std::ostream & os, Indenter indent, int level ) {35 void printInferParams( const InferredParams & inferParams, std::ostream &os, Indenter indent, int level ) { 36 36 if ( ! inferParams.empty() ) { 37 37 os << indent << "with inferred parameters " << level << ":" << std::endl; … … 47 47 Expression::Expression() : result( 0 ), env( 0 ) {} 48 48 49 Expression::Expression( const Expression & other ) : BaseSyntaxNode( other ), result( maybeClone( other.result ) ), env( maybeClone( other.env ) ), extension( other.extension ), inferParams( other.inferParams ), resnSlots( other.resnSlots ) {}49 Expression::Expression( const Expression &other ) : BaseSyntaxNode( other ), result( maybeClone( other.result ) ), env( maybeClone( other.env ) ), extension( other.extension ), inferParams( other.inferParams ), resnSlots( other.resnSlots ) {} 50 50 51 51 void Expression::spliceInferParams( Expression * other ) { … … 62 62 } 63 63 64 void Expression::print( std::ostream & os, Indenter indent ) const {64 void Expression::print( std::ostream &os, Indenter indent ) const { 65 65 printInferParams( inferParams, os, indent+1, 0 ); 66 66 … … 79 79 } 80 80 81 ConstantExpr::ConstantExpr( const ConstantExpr & other) : Expression( other ), constant( other.constant ) {81 ConstantExpr::ConstantExpr( const ConstantExpr &other) : Expression( other ), constant( other.constant ) { 82 82 } 83 83 84 84 ConstantExpr::~ConstantExpr() {} 85 85 86 void ConstantExpr::print( std::ostream & os, Indenter indent ) const {86 void ConstantExpr::print( std::ostream &os, Indenter indent ) const { 87 87 os << "constant expression " ; 88 88 constant.print( os ); … … 124 124 } 125 125 126 VariableExpr::VariableExpr( const VariableExpr & other ) : Expression( other ), var( other.var ) {126 VariableExpr::VariableExpr( const VariableExpr &other ) : Expression( other ), var( other.var ) { 127 127 } 128 128 … … 137 137 } 138 138 139 void VariableExpr::print( std::ostream & os, Indenter indent ) const {139 void VariableExpr::print( std::ostream &os, Indenter indent ) const { 140 140 os << "Variable Expression: "; 141 141 var->printShort(os, indent); … … 143 143 } 144 144 145 SizeofExpr::SizeofExpr( Expression * expr_ ) :145 SizeofExpr::SizeofExpr( Expression *expr_ ) : 146 146 Expression(), expr(expr_), type(0), isType(false) { 147 147 set_result( new BasicType( Type::Qualifiers(), BasicType::LongUnsignedInt ) ); 148 148 } 149 149 150 SizeofExpr::SizeofExpr( Type * type_ ) :150 SizeofExpr::SizeofExpr( Type *type_ ) : 151 151 Expression(), expr(0), type(type_), isType(true) { 152 152 set_result( new BasicType( Type::Qualifiers(), BasicType::LongUnsignedInt ) ); 153 153 } 154 154 155 SizeofExpr::SizeofExpr( const SizeofExpr & other ) :155 SizeofExpr::SizeofExpr( const SizeofExpr &other ) : 156 156 Expression( other ), expr( maybeClone( other.expr ) ), type( maybeClone( other.type ) ), isType( other.isType ) { 157 157 } … … 162 162 } 163 163 164 void SizeofExpr::print( std::ostream & os, Indenter indent) const {164 void SizeofExpr::print( std::ostream &os, Indenter indent) const { 165 165 os << "Sizeof Expression on: "; 166 166 if (isType) type->print(os, indent+1); … … 169 169 } 170 170 171 AlignofExpr::AlignofExpr( Expression * expr_ ) :171 AlignofExpr::AlignofExpr( Expression *expr_ ) : 172 172 Expression(), expr(expr_), type(0), isType(false) { 173 173 set_result( new BasicType( Type::Qualifiers(), BasicType::LongUnsignedInt ) ); 174 174 } 175 175 176 AlignofExpr::AlignofExpr( Type * type_ ) :176 AlignofExpr::AlignofExpr( Type *type_ ) : 177 177 Expression(), expr(0), type(type_), isType(true) { 178 178 set_result( new BasicType( Type::Qualifiers(), BasicType::LongUnsignedInt ) ); 179 179 } 180 180 181 AlignofExpr::AlignofExpr( const AlignofExpr & other ) :181 AlignofExpr::AlignofExpr( const AlignofExpr &other ) : 182 182 Expression( other ), expr( maybeClone( other.expr ) ), type( maybeClone( other.type ) ), isType( other.isType ) { 183 183 } … … 188 188 } 189 189 190 void AlignofExpr::print( std::ostream & os, Indenter indent) const {190 void AlignofExpr::print( std::ostream &os, Indenter indent) const { 191 191 os << "Alignof Expression on: "; 192 192 if (isType) type->print(os, indent+1); … … 195 195 } 196 196 197 UntypedOffsetofExpr::UntypedOffsetofExpr( Type * type, const std::string &member ) :197 UntypedOffsetofExpr::UntypedOffsetofExpr( Type *type, const std::string &member ) : 198 198 Expression(), type(type), member(member) { 199 199 assert( type ); … … 201 201 } 202 202 203 UntypedOffsetofExpr::UntypedOffsetofExpr( const UntypedOffsetofExpr & other ) :203 UntypedOffsetofExpr::UntypedOffsetofExpr( const UntypedOffsetofExpr &other ) : 204 204 Expression( other ), type( maybeClone( other.type ) ), member( other.member ) {} 205 205 … … 208 208 } 209 209 210 void UntypedOffsetofExpr::print( std::ostream & os, Indenter indent) const {210 void UntypedOffsetofExpr::print( std::ostream &os, Indenter indent) const { 211 211 os << "Untyped Offsetof Expression on member " << member << " of "; 212 212 type->print(os, indent+1); … … 214 214 } 215 215 216 OffsetofExpr::OffsetofExpr( Type * type, DeclarationWithType *member ) :216 OffsetofExpr::OffsetofExpr( Type *type, DeclarationWithType *member ) : 217 217 Expression(), type(type), member(member) { 218 218 assert( member ); … … 221 221 } 222 222 223 OffsetofExpr::OffsetofExpr( const OffsetofExpr & other ) :223 OffsetofExpr::OffsetofExpr( const OffsetofExpr &other ) : 224 224 Expression( other ), type( maybeClone( other.type ) ), member( other.member ) {} 225 225 … … 228 228 } 229 229 230 void OffsetofExpr::print( std::ostream & os, Indenter indent) const {230 void OffsetofExpr::print( std::ostream &os, Indenter indent) const { 231 231 os << "Offsetof Expression on member " << member->name << " of "; 232 232 type->print(os, indent+1); … … 234 234 } 235 235 236 OffsetPackExpr::OffsetPackExpr( StructInstType * type ) : Expression(), type( type ) {236 OffsetPackExpr::OffsetPackExpr( StructInstType *type ) : Expression(), type( type ) { 237 237 assert( type ); 238 238 set_result( new ArrayType( Type::Qualifiers(), new BasicType( Type::Qualifiers(), BasicType::LongUnsignedInt ), 0, false, false ) ); 239 239 } 240 240 241 OffsetPackExpr::OffsetPackExpr( const OffsetPackExpr & other ) : Expression( other ), type( maybeClone( other.type ) ) {}241 OffsetPackExpr::OffsetPackExpr( const OffsetPackExpr &other ) : Expression( other ), type( maybeClone( other.type ) ) {} 242 242 243 243 OffsetPackExpr::~OffsetPackExpr() { delete type; } 244 244 245 void OffsetPackExpr::print( std::ostream & os, Indenter indent ) const {245 void OffsetPackExpr::print( std::ostream &os, Indenter indent ) const { 246 246 os << "Offset pack expression on "; 247 247 type->print(os, indent+1); … … 249 249 } 250 250 251 AttrExpr::AttrExpr( Expression * attr, Expression *expr_ ) :251 AttrExpr::AttrExpr( Expression *attr, Expression *expr_ ) : 252 252 Expression(), attr( attr ), expr(expr_), type(0), isType(false) { 253 253 } 254 254 255 AttrExpr::AttrExpr( Expression * attr, Type *type_ ) :255 AttrExpr::AttrExpr( Expression *attr, Type *type_ ) : 256 256 Expression(), attr( attr ), expr(0), type(type_), isType(true) { 257 257 } 258 258 259 AttrExpr::AttrExpr( const AttrExpr & other ) :259 AttrExpr::AttrExpr( const AttrExpr &other ) : 260 260 Expression( other ), attr( maybeClone( other.attr ) ), expr( maybeClone( other.expr ) ), type( maybeClone( other.type ) ), isType( other.isType ) { 261 261 } … … 267 267 } 268 268 269 void AttrExpr::print( std::ostream & os, Indenter indent) const {269 void AttrExpr::print( std::ostream &os, Indenter indent) const { 270 270 os << "Attr "; 271 271 attr->print( os, indent+1); … … 278 278 } 279 279 280 CastExpr::CastExpr( Expression * arg, Type * toType, bool isGenerated ) :arg(arg), isGenerated( isGenerated ) {280 CastExpr::CastExpr( Expression *arg, Type *toType, bool isGenerated ) : Expression(), arg(arg), isGenerated( isGenerated ) { 281 281 set_result(toType); 282 282 } 283 283 284 CastExpr::CastExpr( Expression * arg, bool isGenerated ) :arg(arg), isGenerated( isGenerated ) {284 CastExpr::CastExpr( Expression *arg, bool isGenerated ) : Expression(), arg(arg), isGenerated( isGenerated ) { 285 285 set_result( new VoidType( Type::Qualifiers() ) ); 286 286 } 287 287 288 CastExpr::CastExpr( const CastExpr & other ) : Expression( other ), arg( maybeClone( other.arg ) ), isGenerated( other.isGenerated ) {288 CastExpr::CastExpr( const CastExpr &other ) : Expression( other ), arg( maybeClone( other.arg ) ), isGenerated( other.isGenerated ) { 289 289 } 290 290 … … 293 293 } 294 294 295 void CastExpr::print( std::ostream & os, Indenter indent ) const {296 os << (isGenerated ? "Generated " : "Explicit ") <<"Cast of:" << std::endl << indent+1;295 void CastExpr::print( std::ostream &os, Indenter indent ) const { 296 os << "Cast of:" << std::endl << indent+1; 297 297 arg->print(os, indent+1); 298 298 os << std::endl << indent << "... to:"; … … 306 306 } 307 307 308 KeywordCastExpr::KeywordCastExpr( Expression * arg, Target target ) : Expression(), arg(arg), target( target ) {309 } 310 311 KeywordCastExpr::KeywordCastExpr( const KeywordCastExpr & other ) : Expression( other ), arg( maybeClone( other.arg ) ), target( other.target ) {308 KeywordCastExpr::KeywordCastExpr( Expression *arg, Target target ) : Expression(), arg(arg), target( target ) { 309 } 310 311 KeywordCastExpr::KeywordCastExpr( const KeywordCastExpr &other ) : Expression( other ), arg( maybeClone( other.arg ) ), target( other.target ) { 312 312 } 313 313 … … 327 327 } 328 328 329 void KeywordCastExpr::print( std::ostream & os, Indenter indent ) const {329 void KeywordCastExpr::print( std::ostream &os, Indenter indent ) const { 330 330 os << "Keyword Cast of:" << std::endl << indent+1; 331 331 arg->print(os, indent+1); … … 335 335 } 336 336 337 VirtualCastExpr::VirtualCastExpr( Expression * arg_, Type *toType ) : Expression(), arg(arg_) {337 VirtualCastExpr::VirtualCastExpr( Expression *arg_, Type *toType ) : Expression(), arg(arg_) { 338 338 set_result(toType); 339 339 } 340 340 341 VirtualCastExpr::VirtualCastExpr( const VirtualCastExpr & other ) : Expression( other ), arg( maybeClone( other.arg ) ) {341 VirtualCastExpr::VirtualCastExpr( const VirtualCastExpr &other ) : Expression( other ), arg( maybeClone( other.arg ) ) { 342 342 } 343 343 … … 346 346 } 347 347 348 void VirtualCastExpr::print( std::ostream & os, Indenter indent ) const {348 void VirtualCastExpr::print( std::ostream &os, Indenter indent ) const { 349 349 os << "Virtual Cast of:" << std::endl << indent+1; 350 350 arg->print(os, indent+1); … … 359 359 } 360 360 361 UntypedMemberExpr::UntypedMemberExpr( Expression * member, Expression * aggregate ) :361 UntypedMemberExpr::UntypedMemberExpr( Expression * member, Expression *aggregate ) : 362 362 Expression(), member(member), aggregate(aggregate) { 363 363 assert( aggregate ); 364 364 } 365 365 366 UntypedMemberExpr::UntypedMemberExpr( const UntypedMemberExpr & other ) :366 UntypedMemberExpr::UntypedMemberExpr( const UntypedMemberExpr &other ) : 367 367 Expression( other ), member( maybeClone( other.member ) ), aggregate( maybeClone( other.aggregate ) ) { 368 368 } … … 373 373 } 374 374 375 void UntypedMemberExpr::print( std::ostream & os, Indenter indent ) const {375 void UntypedMemberExpr::print( std::ostream &os, Indenter indent ) const { 376 376 os << "Untyped Member Expression, with field: " << std::endl << indent+1; 377 377 member->print(os, indent+1 ); … … 381 381 } 382 382 383 MemberExpr::MemberExpr( DeclarationWithType * member, Expression *aggregate ) :383 MemberExpr::MemberExpr( DeclarationWithType *member, Expression *aggregate ) : 384 384 Expression(), member(member), aggregate(aggregate) { 385 385 assert( member ); … … 395 395 } 396 396 397 MemberExpr::MemberExpr( const MemberExpr & other ) :397 MemberExpr::MemberExpr( const MemberExpr &other ) : 398 398 Expression( other ), member( other.member ), aggregate( maybeClone( other.aggregate ) ) { 399 399 } … … 404 404 } 405 405 406 void MemberExpr::print( std::ostream & os, Indenter indent ) const {406 void MemberExpr::print( std::ostream &os, Indenter indent ) const { 407 407 os << "Member Expression, with field:" << std::endl; 408 408 os << indent+1; … … 413 413 } 414 414 415 UntypedExpr::UntypedExpr( Expression * function, const std::list<Expression *> &args ) :415 UntypedExpr::UntypedExpr( Expression *function, const std::list<Expression *> &args ) : 416 416 Expression(), function(function), args(args) {} 417 417 418 UntypedExpr::UntypedExpr( const UntypedExpr & other ) :418 UntypedExpr::UntypedExpr( const UntypedExpr &other ) : 419 419 Expression( other ), function( maybeClone( other.function ) ) { 420 420 cloneAll( other.args, args ); … … 455 455 456 456 457 void UntypedExpr::print( std::ostream & os, Indenter indent ) const {457 void UntypedExpr::print( std::ostream &os, Indenter indent ) const { 458 458 os << "Applying untyped:" << std::endl; 459 459 os << indent+1; … … 469 469 } 470 470 471 NameExpr::NameExpr( const NameExpr & other ) : Expression( other ), name( other.name ) {471 NameExpr::NameExpr( const NameExpr &other ) : Expression( other ), name( other.name ) { 472 472 } 473 473 474 474 NameExpr::~NameExpr() {} 475 475 476 void NameExpr::print( std::ostream & os, Indenter indent ) const {476 void NameExpr::print( std::ostream &os, Indenter indent ) const { 477 477 os << "Name: " << get_name(); 478 478 Expression::print( os, indent ); 479 479 } 480 480 481 LogicalExpr::LogicalExpr( Expression * arg1_, Expression *arg2_, bool andp ) :481 LogicalExpr::LogicalExpr( Expression *arg1_, Expression *arg2_, bool andp ) : 482 482 Expression(), arg1(arg1_), arg2(arg2_), isAnd(andp) { 483 483 set_result( new BasicType( Type::Qualifiers(), BasicType::SignedInt ) ); 484 484 } 485 485 486 LogicalExpr::LogicalExpr( const LogicalExpr & other ) :486 LogicalExpr::LogicalExpr( const LogicalExpr &other ) : 487 487 Expression( other ), arg1( maybeClone( other.arg1 ) ), arg2( maybeClone( other.arg2 ) ), isAnd( other.isAnd ) { 488 488 } … … 493 493 } 494 494 495 void LogicalExpr::print( std::ostream & os, Indenter indent )const {495 void LogicalExpr::print( std::ostream &os, Indenter indent )const { 496 496 os << "Short-circuited operation (" << (isAnd ? "and" : "or") << ") on: "; 497 497 arg1->print(os); … … 504 504 Expression(), arg1(arg1), arg2(arg2), arg3(arg3) {} 505 505 506 ConditionalExpr::ConditionalExpr( const ConditionalExpr & other ) :506 ConditionalExpr::ConditionalExpr( const ConditionalExpr &other ) : 507 507 Expression( other ), arg1( maybeClone( other.arg1 ) ), arg2( maybeClone( other.arg2 ) ), arg3( maybeClone( other.arg3 ) ) { 508 508 } … … 514 514 } 515 515 516 void ConditionalExpr::print( std::ostream & os, Indenter indent ) const {516 void ConditionalExpr::print( std::ostream &os, Indenter indent ) const { 517 517 os << "Conditional expression on: " << std::endl << indent+1; 518 518 arg1->print( os, indent+1 ); … … 527 527 528 528 529 void AsmExpr::print( std::ostream & os, Indenter indent ) const {529 void AsmExpr::print( std::ostream &os, Indenter indent ) const { 530 530 os << "Asm Expression: " << std::endl; 531 531 if ( inout ) inout->print( os, indent+1 ); … … 555 555 } 556 556 557 void ImplicitCopyCtorExpr::print( std::ostream & os, Indenter indent ) const {557 void ImplicitCopyCtorExpr::print( std::ostream &os, Indenter indent ) const { 558 558 os << "Implicit Copy Constructor Expression: " << std::endl << indent+1; 559 559 callExpr->print( os, indent+1 ); … … 581 581 } 582 582 583 void ConstructorExpr::print( std::ostream & os, Indenter indent ) const {583 void ConstructorExpr::print( std::ostream &os, Indenter indent ) const { 584 584 os << "Constructor Expression: " << std::endl << indent+1; 585 585 callExpr->print( os, indent + 2 ); … … 594 594 } 595 595 596 CompoundLiteralExpr::CompoundLiteralExpr( const CompoundLiteralExpr & other ) : Expression( other ), initializer( other.initializer->clone() ) {}596 CompoundLiteralExpr::CompoundLiteralExpr( const CompoundLiteralExpr &other ) : Expression( other ), initializer( other.initializer->clone() ) {} 597 597 598 598 CompoundLiteralExpr::~CompoundLiteralExpr() { … … 600 600 } 601 601 602 void CompoundLiteralExpr::print( std::ostream & os, Indenter indent ) const {602 void CompoundLiteralExpr::print( std::ostream &os, Indenter indent ) const { 603 603 os << "Compound Literal Expression: " << std::endl << indent+1; 604 604 result->print( os, indent+1 ); … … 608 608 } 609 609 610 RangeExpr::RangeExpr( Expression * low, Expression *high ) : low( low ), high( high ) {}611 RangeExpr::RangeExpr( const RangeExpr & other ) : Expression( other ), low( other.low->clone() ), high( other.high->clone() ) {}612 void RangeExpr::print( std::ostream & os, Indenter indent ) const {610 RangeExpr::RangeExpr( Expression *low, Expression *high ) : low( low ), high( high ) {} 611 RangeExpr::RangeExpr( const RangeExpr &other ) : Expression( other ), low( other.low->clone() ), high( other.high->clone() ) {} 612 void RangeExpr::print( std::ostream &os, Indenter indent ) const { 613 613 os << "Range Expression: "; 614 614 low->print( os, indent ); … … 618 618 } 619 619 620 StmtExpr::StmtExpr( CompoundStmt * statements ) : statements( statements ) {620 StmtExpr::StmtExpr( CompoundStmt *statements ) : statements( statements ) { 621 621 computeResult(); 622 622 } 623 StmtExpr::StmtExpr( const StmtExpr & other ) : Expression( other ), statements( other.statements->clone() ) {623 StmtExpr::StmtExpr( const StmtExpr &other ) : Expression( other ), statements( other.statements->clone() ) { 624 624 cloneAll( other.returnDecls, returnDecls ); 625 625 cloneAll( other.dtors, dtors ); … … 650 650 } 651 651 } 652 void StmtExpr::print( std::ostream & os, Indenter indent ) const {652 void StmtExpr::print( std::ostream &os, Indenter indent ) const { 653 653 os << "Statement Expression: " << std::endl << indent+1; 654 654 statements->print( os, indent+1 ); … … 666 666 667 667 long long UniqueExpr::count = 0; 668 UniqueExpr::UniqueExpr( Expression * expr, long long idVal ) : expr( expr ), object( nullptr ), var( nullptr ), id( idVal ) {668 UniqueExpr::UniqueExpr( Expression *expr, long long idVal ) : expr( expr ), object( nullptr ), var( nullptr ), id( idVal ) { 669 669 assert( expr ); 670 670 assert( count != -1 ); … … 674 674 } 675 675 } 676 UniqueExpr::UniqueExpr( const UniqueExpr & other ) : Expression( other ), expr( maybeClone( other.expr ) ), object( maybeClone( other.object ) ), var( maybeClone( other.var ) ), id( other.id ) {676 UniqueExpr::UniqueExpr( const UniqueExpr &other ) : Expression( other ), expr( maybeClone( other.expr ) ), object( maybeClone( other.object ) ), var( maybeClone( other.var ) ), id( other.id ) { 677 677 } 678 678 UniqueExpr::~UniqueExpr() { … … 681 681 delete var; 682 682 } 683 void UniqueExpr::print( std::ostream & os, Indenter indent ) const {683 void UniqueExpr::print( std::ostream &os, Indenter indent ) const { 684 684 os << "Unique Expression with id:" << id << std::endl << indent+1; 685 685 expr->print( os, indent+1 ); -
src/SynTree/Expression.h
r53bb8f1 r9d9a451 10 10 // Created On : Mon May 18 07:44:20 2015 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Mon Feb 18 18:29:51 201913 // Update Count : 4 912 // Last Modified On : Sun Sep 3 19:23:46 2017 13 // Update Count : 48 14 14 // 15 15 … … 195 195 public: 196 196 Expression * arg; 197 bool isGenerated = true; // cast generated implicitly by code generation or explicit inprogram197 bool isGenerated = true; // whether this cast appeared in the source program 198 198 199 199 CastExpr( Expression * arg, bool isGenerated = true ); -
src/SynTree/Type.cc
r53bb8f1 r9d9a451 10 10 // Created On : Mon May 18 07:44:20 2015 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Thu Jan 31 21:54:16 201913 // Update Count : 4312 // Last Modified On : Fri Jun 22 10:17:19 2018 13 // Update Count : 39 14 14 // 15 15 #include "Type.h" … … 25 25 26 26 const char *BasicType::typeNames[] = { 27 #if 028 27 "_Bool", 29 28 "char", … … 50 49 "unsigned __int128", 51 50 "__float80", 52 "__float128", 53 "_Float16", 54 "_Float32", 55 "_Float32x", 56 "_Float64", 57 "_Float64x", 58 "_Float128", 59 "_Float128x", 60 "_Float16 _Complex", 61 "_Float32 _Complex", 62 "_Float32x _Complex", 63 "_Float64 _Complex", 64 "_Float64x _Complex", 65 "_Float128 _Complex", 66 "_Float128x _Complex", 67 #endif 68 "_Bool", 69 "char", 70 "signed char", 71 "unsigned char", 72 "signed short int", 73 "unsigned short int", 74 "signed int", 75 "unsigned int", 76 "signed long int", 77 "unsigned long int", 78 "signed long long int", 79 "unsigned long long int", 80 "__int128", 81 "unsigned __int128", 82 "_Float16", 83 "_Float16 _Complex", 84 "_Float32", 85 "_Float32 _Complex", 86 "float", 87 "float _Complex", 88 //"float _Imaginary", 89 "_Float32x", 90 "_Float32x _Complex", 91 "_Float64", 92 "_Float64 _Complex", 93 "double", 94 "double _Complex", 95 //"double _Imaginary", 96 "_Float64x", 97 "_Float64x _Complex", 98 "__float80", 99 "_Float128", 100 "_Float128 _Complex", 101 "__float128", 102 "long double", 103 "long double _Complex", 104 //"long double _Imaginary", 105 "_Float128x", 106 "_Float128x _Complex", 51 "__float128" 107 52 }; 108 53 static_assert( -
src/SynTree/Type.h
r53bb8f1 r9d9a451 10 10 // Created On : Mon May 18 07:44:20 2015 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Thu Feb 14 17:11:24 201913 // Update Count : 1 6912 // Last Modified On : Mon Sep 25 14:14:01 2017 13 // Update Count : 154 14 14 // 15 15 … … 207 207 class BasicType : public Type { 208 208 public: 209 // GENERATED START, DO NOT EDIT210 // GENERATED BY BasicTypes-gen.cc211 209 enum Kind { 212 210 Bool, … … 222 220 LongLongSignedInt, 223 221 LongLongUnsignedInt, 222 Float, 223 Double, 224 LongDouble, 225 FloatComplex, 226 DoubleComplex, 227 LongDoubleComplex, 228 FloatImaginary, 229 DoubleImaginary, 230 LongDoubleImaginary, 224 231 SignedInt128, 225 232 UnsignedInt128, 226 uFloat16, 227 uFloat16Complex, 228 uFloat32, 229 uFloat32Complex, 230 Float, 231 FloatComplex, 232 uFloat32x, 233 uFloat32xComplex, 234 uFloat64, 235 uFloat64Complex, 236 Double, 237 DoubleComplex, 238 uFloat64x, 239 uFloat64xComplex, 240 uuFloat80, 241 uFloat128, 242 uFloat128Complex, 243 uuFloat128, 244 LongDouble, 245 LongDoubleComplex, 246 uFloat128x, 247 uFloat128xComplex, 233 Float80, 234 Float128, 248 235 NUMBER_OF_BASIC_TYPES 249 236 } kind; 250 // GENERATED END251 237 252 238 static const char *typeNames[]; // string names for basic types, MUST MATCH with Kind -
src/SynTree/module.mk
r53bb8f1 r9d9a451 15 15 ############################################################################### 16 16 17 SRC_SYNTREE = \ 18 SynTree/Type.cc \ 19 SynTree/VoidType.cc \ 20 SynTree/BasicType.cc \ 21 SynTree/PointerType.cc \ 22 SynTree/ArrayType.cc \ 23 SynTree/ReferenceType.cc \ 24 SynTree/FunctionType.cc \ 25 SynTree/ReferenceToType.cc \ 26 SynTree/TupleType.cc \ 27 SynTree/TypeofType.cc \ 28 SynTree/AttrType.cc \ 29 SynTree/VarArgsType.cc \ 30 SynTree/ZeroOneType.cc \ 31 SynTree/Constant.cc \ 32 SynTree/Expression.cc \ 33 SynTree/TupleExpr.cc \ 34 SynTree/CommaExpr.cc \ 35 SynTree/TypeExpr.cc \ 36 SynTree/ApplicationExpr.cc \ 37 SynTree/AddressExpr.cc \ 38 SynTree/Statement.cc \ 39 SynTree/CompoundStmt.cc \ 40 SynTree/DeclStmt.cc \ 41 SynTree/Declaration.cc \ 42 SynTree/DeclarationWithType.cc \ 43 SynTree/ObjectDecl.cc \ 44 SynTree/FunctionDecl.cc \ 45 SynTree/AggregateDecl.cc \ 46 SynTree/NamedTypeDecl.cc \ 47 SynTree/TypeDecl.cc \ 48 SynTree/Initializer.cc \ 49 SynTree/TypeSubstitution.cc \ 50 SynTree/Attribute.cc \ 51 SynTree/DeclReplacer.cc 17 SRC += SynTree/Type.cc \ 18 SynTree/VoidType.cc \ 19 SynTree/BasicType.cc \ 20 SynTree/PointerType.cc \ 21 SynTree/ArrayType.cc \ 22 SynTree/ReferenceType.cc \ 23 SynTree/FunctionType.cc \ 24 SynTree/ReferenceToType.cc \ 25 SynTree/TupleType.cc \ 26 SynTree/TypeofType.cc \ 27 SynTree/AttrType.cc \ 28 SynTree/VarArgsType.cc \ 29 SynTree/ZeroOneType.cc \ 30 SynTree/Constant.cc \ 31 SynTree/Expression.cc \ 32 SynTree/TupleExpr.cc \ 33 SynTree/CommaExpr.cc \ 34 SynTree/TypeExpr.cc \ 35 SynTree/ApplicationExpr.cc \ 36 SynTree/AddressExpr.cc \ 37 SynTree/Statement.cc \ 38 SynTree/CompoundStmt.cc \ 39 SynTree/DeclStmt.cc \ 40 SynTree/Declaration.cc \ 41 SynTree/DeclarationWithType.cc \ 42 SynTree/ObjectDecl.cc \ 43 SynTree/FunctionDecl.cc \ 44 SynTree/AggregateDecl.cc \ 45 SynTree/NamedTypeDecl.cc \ 46 SynTree/TypeDecl.cc \ 47 SynTree/Initializer.cc \ 48 SynTree/TypeSubstitution.cc \ 49 SynTree/Attribute.cc \ 50 SynTree/DeclReplacer.cc 52 51 53 SRC += $(SRC_SYNTREE)54 SRCDEMANGLE += $(SRC_SYNTREE) -
src/Tuples/TupleExpansion.cc
r53bb8f1 r9d9a451 10 10 // Created On : Mon May 18 07:44:20 2015 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Wed Feb 13 18:14:12 201913 // Update Count : 2112 // Last Modified On : Wed Jun 21 17:35:04 2017 13 // Update Count : 19 14 14 // 15 15 -
src/Tuples/module.mk
r53bb8f1 r9d9a451 15 15 ############################################################################### 16 16 17 SRC += Tuples/TupleAssignment.cc Tuples/TupleExpansion.cc Tuples/Explode.cc 18 SRCDEMANGLE += Tuples/TupleAssignment.cc Tuples/TupleExpansion.cc Tuples/Explode.cc 17 SRC += Tuples/TupleAssignment.cc \ 18 Tuples/TupleExpansion.cc \ 19 Tuples/Explode.cc -
src/Validate/module.mk
r53bb8f1 r9d9a451 16 16 17 17 SRC += Validate/HandleAttributes.cc 18 SRCDEMANGLE += Validate/HandleAttributes.cc -
src/cfa.make
r53bb8f1 r9d9a451 32 32 am__v_GOC_1 = 33 33 34 UPPCC = u++ 34 35 35 UPPCOMPILE = $(UPPCC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_UPPFLAGS) $(UPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) $(AM_CFLAGS) $(CFLAGS) 36 36 -
src/config.h.in
r53bb8f1 r9d9a451 52 52 #undef CFA_VERSION_SHORT 53 53 54 /* Have compiler warning cast-function-type. */ 55 #undef HAVE_CAST_FUNCTION_TYPE 54 /* Define to one of `_getb67', `GETB67', `getb67' for Cray-2 and Cray-YMP 55 systems. This function is required for `alloca.c' support on those systems. 56 */ 57 #undef CRAY_STACKSEG_END 58 59 /* Define to 1 if using `alloca.c'. */ 60 #undef C_ALLOCA 61 62 /* Define to 1 if you have `alloca', as a function or macro. */ 63 #undef HAVE_ALLOCA 64 65 /* Define to 1 if you have <alloca.h> and it should be used (not on Ultrix). 66 */ 67 #undef HAVE_ALLOCA_H 56 68 57 69 /* Define to 1 if you have the <dlfcn.h> header file. */ 58 70 #undef HAVE_DLFCN_H 59 71 72 /* Define to 1 if you have the <fenv.h> header file. */ 73 #undef HAVE_FENV_H 74 75 /* Define to 1 if you have the <float.h> header file. */ 76 #undef HAVE_FLOAT_H 77 60 78 /* Define to 1 if you have the <inttypes.h> header file. */ 61 79 #undef HAVE_INTTYPES_H 62 80 63 /* Have keywords _FloatXX. */64 #undef HAVE_KEYWORDS_FLOATXX65 66 81 /* Define to 1 if you have the <libintl.h> header file. */ 67 82 #undef HAVE_LIBINTL_H 68 83 84 /* Define to 1 if you have the <limits.h> header file. */ 85 #undef HAVE_LIMITS_H 86 69 87 /* Define to 1 if you have the <malloc.h> header file. */ 70 88 #undef HAVE_MALLOC_H … … 73 91 #undef HAVE_MEMORY_H 74 92 93 /* Define to 1 if you have the `memset' function. */ 94 #undef HAVE_MEMSET 95 96 /* Define to 1 if you have the `putenv' function. */ 97 #undef HAVE_PUTENV 98 99 /* Define to 1 if stdbool.h conforms to C99. */ 100 #undef HAVE_STDBOOL_H 101 102 /* Define to 1 if you have the <stddef.h> header file. */ 103 #undef HAVE_STDDEF_H 104 75 105 /* Define to 1 if you have the <stdint.h> header file. */ 76 106 #undef HAVE_STDINT_H … … 79 109 #undef HAVE_STDLIB_H 80 110 111 /* Define to 1 if you have the `strchr' function. */ 112 #undef HAVE_STRCHR 113 81 114 /* Define to 1 if you have the <strings.h> header file. */ 82 115 #undef HAVE_STRINGS_H … … 85 118 #undef HAVE_STRING_H 86 119 120 /* Define to 1 if you have the `strtol' function. */ 121 #undef HAVE_STRTOL 122 87 123 /* Define to 1 if you have the <sys/stat.h> header file. */ 88 124 #undef HAVE_SYS_STAT_H … … 94 130 #undef HAVE_UNISTD_H 95 131 96 /* Define to 1 if the system has the type `_ Float32'. */97 #undef HAVE__ FLOAT32132 /* Define to 1 if the system has the type `_Bool'. */ 133 #undef HAVE__BOOL 98 134 99 135 /* Define to the sub-directory where libtool stores uninstalled libraries. */ … … 120 156 /* Define to the version of this package. */ 121 157 #undef PACKAGE_VERSION 158 159 /* If using the C implementation of alloca, define if you know the 160 direction of stack growth for your system; otherwise it will be 161 automatically deduced at runtime. 162 STACK_DIRECTION > 0 => grows toward higher addresses 163 STACK_DIRECTION < 0 => grows toward lower addresses 164 STACK_DIRECTION = 0 => direction of growth unknown */ 165 #undef STACK_DIRECTION 122 166 123 167 /* Define to 1 if you have the ANSI C header files. */ … … 136 180 `char[]'. */ 137 181 #undef YYTEXT_POINTER 182 183 /* Define for Solaris 2.5.1 so the uint32_t typedef from <sys/synch.h>, 184 <pthread.h>, or <semaphore.h> is not used. If the typedef were allowed, the 185 #define below would cause a syntax error. */ 186 #undef _UINT32_T 187 188 /* Define for Solaris 2.5.1 so the uint8_t typedef from <sys/synch.h>, 189 <pthread.h>, or <semaphore.h> is not used. If the typedef were allowed, the 190 #define below would cause a syntax error. */ 191 #undef _UINT8_T 192 193 /* Define to `__inline__' or `__inline' if that's what the C compiler 194 calls it, or to nothing if 'inline' is not supported under any name. */ 195 #ifndef __cplusplus 196 #undef inline 197 #endif 198 199 /* Define to the type of a signed integer type of width exactly 16 bits if 200 such a type exists and the standard includes do not define it. */ 201 #undef int16_t 202 203 /* Define to the type of a signed integer type of width exactly 32 bits if 204 such a type exists and the standard includes do not define it. */ 205 #undef int32_t 206 207 /* Define to the type of a signed integer type of width exactly 8 bits if such 208 a type exists and the standard includes do not define it. */ 209 #undef int8_t 210 211 /* Define to the equivalent of the C99 'restrict' keyword, or to 212 nothing if this is not supported. Do not define if restrict is 213 supported directly. */ 214 #undef restrict 215 /* Work around a bug in Sun C++: it does not support _Restrict or 216 __restrict__, even though the corresponding Sun C compiler ends up with 217 "#define restrict _Restrict" or "#define restrict __restrict__" in the 218 previous line. Perhaps some future version of Sun C++ will work with 219 restrict; if so, hopefully it defines __RESTRICT like Sun C does. */ 220 #if defined __SUNPRO_CC && !defined __RESTRICT 221 # define _Restrict 222 # define __restrict__ 223 #endif 224 225 /* Define to `unsigned int' if <sys/types.h> does not define. */ 226 #undef size_t 227 228 /* Define to the type of an unsigned integer type of width exactly 16 bits if 229 such a type exists and the standard includes do not define it. */ 230 #undef uint16_t 231 232 /* Define to the type of an unsigned integer type of width exactly 32 bits if 233 such a type exists and the standard includes do not define it. */ 234 #undef uint32_t 235 236 /* Define to the type of an unsigned integer type of width exactly 8 bits if 237 such a type exists and the standard includes do not define it. */ 238 #undef uint8_t -
src/main.cc
r53bb8f1 r9d9a451 10 10 // Created On : Fri May 15 23:12:02 2015 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Sat Feb 16 09:14:04 201913 // Update Count : 50012 // Last Modified On : Wed Jun 6 15:51:47 2018 13 // Update Count : 498 14 14 // 15 15 … … 37 37 #include "CodeTools/TrackLoc.h" // for fillLocations 38 38 #include "Common/CompilerError.h" // for CompilerError 39 #include "Common/ Stats.h"39 #include "Common/Heap.h" 40 40 #include "Common/PassVisitor.h" 41 41 #include "Common/SemanticError.h" // for SemanticError … … 65 65 using namespace std; 66 66 67 68 void NewPass(const char * const name) { 69 Stats::Heap::newPass(name); 70 using namespace Stats::Counters; 71 static auto pass_visitor_group = build<CounterGroup>("Pass Visitor"); 72 auto pass = build<CounterGroup>(name, pass_visitor_group); 73 pass_visitor_stats.depth = 0; 74 pass_visitor_stats.avg = build<AverageCounter<double>>("Average Depth", pass); 75 pass_visitor_stats.max = build<MaxCounter<double>>("Max Depth", pass); 76 } 77 78 #define PASS(name, pass) \ 67 #define PASS(name, pass) \ 79 68 if ( errorp ) { cerr << name << endl; } \ 80 NewPass(name); \ 81 Stats::Time::StartBlock(name); \ 82 pass; \ 83 Stats::Time::StopBlock(); 69 HeapStats::newPass(name); \ 70 pass; 84 71 85 72 LinkageSpec::Spec linkage = LinkageSpec::Cforall; … … 155 142 backtrace( 6 ); // skip first 6 stack frames 156 143 signal( SIGABRT, SIG_DFL); // reset default signal handler 157 raise( SIGABRT ); // reraise SIGABRT144 raise( SIGABRT ); // reraise SIGABRT 158 145 } // sigAbortHandler 159 146 … … 161 148 int main( int argc, char * argv[] ) { 162 149 FILE * input; // use FILE rather than istream because yyin is FILE 163 ostream * output = & cout;164 const char * filename = nullptr;150 ostream *output = & cout; 151 const char *filename = nullptr; 165 152 list< Declaration * > translationUnit; 166 153 … … 194 181 } // if 195 182 196 Stats::Time::StartGlobal();197 NewPass("Parse");198 Stats::Time::StartBlock("Parse");199 200 183 // read in the builtins, extras, and the prelude 201 184 if ( ! nopreludep ) { // include gcc builtins … … 248 231 // works okay for now. 249 232 CodeTools::fillLocations( translationUnit ); 250 Stats::Time::StopBlock();251 233 252 234 // add the assignment statement after the initialization of a type parameter 253 PASS( " Validate", SymTab::validate( translationUnit, symtabp ) );235 PASS( "validate", SymTab::validate( translationUnit, symtabp ) ); 254 236 if ( symtabp ) { 255 237 deleteAll( translationUnit ); … … 268 250 } // if 269 251 270 PASS( " FixLabels", ControlStruct::fixLabels( translationUnit ) );271 PASS( " FixNames", CodeGen::fixNames( translationUnit ) );272 PASS( " GenInit", InitTweak::genInit( translationUnit ) );273 PASS( " Expand MemberTuples" , Tuples::expandMemberTuples( translationUnit ) );252 PASS( "fixLabels", ControlStruct::fixLabels( translationUnit ) ); 253 PASS( "fixNames", CodeGen::fixNames( translationUnit ) ); 254 PASS( "genInit", InitTweak::genInit( translationUnit ) ); 255 PASS( "expandMemberTuples" , Tuples::expandMemberTuples( translationUnit ) ); 274 256 if ( libcfap ) { 275 257 // generate the bodies of cfa library functions … … 295 277 } 296 278 297 PASS( " Resolve", ResolvExpr::resolve( translationUnit ) );279 PASS( "resolve", ResolvExpr::resolve( translationUnit ) ); 298 280 if ( exprp ) { 299 281 dump( translationUnit ); … … 302 284 303 285 // fix ObjectDecl - replaces ConstructorInit nodes 304 PASS( " FixInit", InitTweak::fix( translationUnit, buildingLibrary() ) );286 PASS( "fixInit", InitTweak::fix( translationUnit, buildingLibrary() ) ); 305 287 if ( ctorinitp ) { 306 288 dump ( translationUnit ); … … 308 290 } // if 309 291 310 PASS( " Expand UniqueExpr", Tuples::expandUniqueExpr( translationUnit ) ); // xxx - is this the right place for this? want to expand ASAP so tha, sequent passes don't need to worry about double-visiting a unique expr - needs to go after InitTweak::fix so that copy constructed return declarations are reused311 312 PASS( " TranslateEHM" , ControlStruct::translateEHM( translationUnit ) );313 314 PASS( " GenWaitfor" , Concurrency::generateWaitFor( translationUnit ) );315 316 PASS( " ConvertSpecializations", GenPoly::convertSpecializations( translationUnit ) ); // needs to happen before tuple types are expanded317 318 PASS( " ExpandTuples", Tuples::expandTuples( translationUnit ) ); // xxx - is this the right place for this?292 PASS( "expandUniqueExpr", Tuples::expandUniqueExpr( translationUnit ) ); // xxx - is this the right place for this? want to expand ASAP so tha, sequent passes don't need to worry about double-visiting a unique expr - needs to go after InitTweak::fix so that copy constructed return declarations are reused 293 294 PASS( "translateEHM" , ControlStruct::translateEHM( translationUnit ) ); 295 296 PASS( "generateWaitfor" , Concurrency::generateWaitFor( translationUnit ) ); 297 298 PASS( "convertSpecializations", GenPoly::convertSpecializations( translationUnit ) ); // needs to happen before tuple types are expanded 299 300 PASS( "expandTuples", Tuples::expandTuples( translationUnit ) ); // xxx - is this the right place for this? 319 301 320 302 if ( tuplep ) { … … 323 305 } 324 306 325 PASS( " Virtual ExpandCasts", Virtual::expandCasts( translationUnit ) ); // Must come after translateEHM326 327 PASS( " InstantiateGenerics", GenPoly::instantiateGeneric( translationUnit ) );307 PASS( "virtual expandCasts", Virtual::expandCasts( translationUnit ) ); // Must come after translateEHM 308 309 PASS( "instantiateGenerics", GenPoly::instantiateGeneric( translationUnit ) ); 328 310 if ( genericsp ) { 329 311 dump( translationUnit ); 330 312 return 0; 331 313 } 332 PASS( " Convert L-Value", GenPoly::convertLvalue( translationUnit ) );314 PASS( "convertLvalue", GenPoly::convertLvalue( translationUnit ) ); 333 315 334 316 … … 337 319 return 0; 338 320 } // if 339 PASS( " Box", GenPoly::box( translationUnit ) );321 PASS( "box", GenPoly::box( translationUnit ) ); 340 322 341 323 if ( bcodegenp ) { … … 349 331 350 332 CodeTools::fillLocations( translationUnit ); 351 PASS( " Code Gen", CodeGen::generate( translationUnit, *output, ! noprotop, prettycodegenp, true, linemarks ) );333 PASS( "codegen", CodeGen::generate( translationUnit, *output, ! noprotop, prettycodegenp, true, linemarks ) ); 352 334 353 335 CodeGen::FixMain::fix( *output, (PreludeDirector + "/bootloader.c").c_str() ); … … 389 371 } 390 372 } catch(const std::exception& e) { 391 std::cerr << "Un caught Exception \"" << e.what() << "\"\n";373 std::cerr << "Unaught Exception \"" << e.what() << "\"\n"; 392 374 } 393 375 return 1; … … 395 377 396 378 deleteAll( translationUnit ); 397 Stats::print(); 398 379 if(!libcfap && !treep) HeapStats::printStats(); 399 380 return 0; 400 381 } // main 401 382 402 383 void parse_cmdline( int argc, char * argv[], const char *& filename ) { 403 enum { Ast, Bbox, Bresolver, CtorInitFix, DeclStats, Expr, ExprAlt, Grammar, LibCFA, Linemarks, Nolinemarks, Nopreamble, Parse, PreludeDir, Prototypes, Resolver, ResolvProto, S tats, Symbol, Tree, TupleExpansion, Validate};384 enum { Ast, Bbox, Bresolver, CtorInitFix, DeclStats, Expr, ExprAlt, Grammar, LibCFA, Linemarks, Nolinemarks, Nopreamble, Parse, PreludeDir, Prototypes, Resolver, ResolvProto, Symbol, Tree, TupleExpansion, Validate, }; 404 385 405 386 static struct option long_opts[] = { … … 421 402 { "resolver", no_argument, 0, Resolver }, 422 403 { "resolv-proto", no_argument, 0, ResolvProto }, 423 { "stats", required_argument, 0, Stats },424 404 { "symbol", no_argument, 0, Symbol }, 425 405 { "tree", no_argument, 0, Tree }, … … 436 416 while ( (c = getopt_long( argc, argv, "abBcCdefgGlLmnNpqrRstTvwW:yzZD:F:", long_opts, &long_index )) != -1 ) { 437 417 switch ( c ) { 438 case Ast:439 case 'a': // dump AST418 case Ast: 419 case 'a': // dump AST 440 420 astp = true; 441 421 break; 442 case Bresolver:443 case 'b': // print before resolver steps422 case Bresolver: 423 case 'b': // print before resolver steps 444 424 bresolvep = true; 445 425 break; 446 case 'B': // print before box steps426 case 'B': // print before box steps 447 427 bboxp = true; 448 428 break; 449 case CtorInitFix:450 case 'c': // print after constructors and destructors are replaced429 case CtorInitFix: 430 case 'c': // print after constructors and destructors are replaced 451 431 ctorinitp = true; 452 432 break; 453 case 'C': // print before code generation433 case 'C': // print before code generation 454 434 bcodegenp = true; 455 435 break; 456 case DeclStats:457 case 'd':458 declstatsp = true;459 break; 460 case Expr:461 case 'e': // dump AST after expression analysis436 case DeclStats: 437 case 'd': 438 declstatsp = true; 439 break; 440 case Expr: 441 case 'e': // dump AST after expression analysis 462 442 exprp = true; 463 443 break; 464 case ExprAlt:465 case 'f': // print alternatives for expressions444 case ExprAlt: 445 case 'f': // print alternatives for expressions 466 446 expraltp = true; 467 447 break; 468 case Grammar:469 case 'g': // bison debugging info (grammar rules)448 case Grammar: 449 case 'g': // bison debugging info (grammar rules) 470 450 yydebug = true; 471 451 break; 472 case 'G': // dump AST after instantiate generics452 case 'G': // dump AST after instantiate generics 473 453 genericsp = true; 474 454 break; 475 case LibCFA:476 case 'l': // generate libcfa.c455 case LibCFA: 456 case 'l': // generate libcfa.c 477 457 libcfap = true; 478 458 break; 479 case Linemarks:480 case 'L': // print lines marks459 case Linemarks: 460 case 'L': // print lines marks 481 461 linemarks = true; 482 462 break; 483 case Nopreamble:484 case 'n': // do not read preamble463 case Nopreamble: 464 case 'n': // do not read preamble 485 465 nopreludep = true; 486 466 break; 487 case Nolinemarks:488 case 'N': // suppress line marks467 case Nolinemarks: 468 case 'N': // suppress line marks 489 469 linemarks = false; 490 470 break; 491 case Prototypes:492 case 'p': // generate prototypes for preamble functions471 case Prototypes: 472 case 'p': // generate prototypes for preamble functions 493 473 noprotop = true; 494 474 break; 495 case PreludeDir:496 PreludeDirector = optarg;497 break; 498 case 'm': // don't replace the main499 nomainp = true;500 break; 501 case Parse:502 case 'q': // dump parse tree475 case PreludeDir: 476 PreludeDirector = optarg; 477 break; 478 case 'm': // don't replace the main 479 nomainp = true; 480 break; 481 case Parse: 482 case 'q': // dump parse tree 503 483 parsep = true; 504 484 break; 505 case Resolver:506 case 'r': // print resolver steps485 case Resolver: 486 case 'r': // print resolver steps 507 487 resolvep = true; 508 488 break; 509 case 'R': // dump resolv-proto instance489 case 'R': // dump resolv-proto instance 510 490 resolvprotop = true; 511 491 break; 512 case Stats: 513 Stats::parse_params(optarg); 514 break; 515 case Symbol: 516 case 's': // print symbol table events 492 case Symbol: 493 case 's': // print symbol table events 517 494 symtabp = true; 518 495 break; 519 case Tree:520 case 't': // build in tree496 case Tree: 497 case 't': // build in tree 521 498 treep = true; 522 499 break; 523 case TupleExpansion:524 case 'T': // print after tuple expansion500 case TupleExpansion: 501 case 'T': // print after tuple expansion 525 502 tuplep = true; 526 503 break; 527 case 'v': // dump AST after decl validation pass504 case 'v': // dump AST after decl validation pass 528 505 validp = true; 529 506 break; 530 case 'w':507 case 'w': 531 508 Wsuppress = true; 532 509 break; 533 case 'W':510 case 'W': 534 511 if ( strcmp( optarg, "all" ) == 0 ) { 535 512 SemanticWarning_EnableAll(); … … 548 525 } // if 549 526 break; 550 case 'y': // dump AST on error527 case 'y': // dump AST on error 551 528 errorp = true; 552 529 break; 553 case 'z': // dump as codegen rather than AST530 case 'z': // dump as codegen rather than AST 554 531 codegenp = true; 555 532 break; … … 557 534 prettycodegenp = true; 558 535 break; 559 case 'D': // ignore -Dxxx560 break; 561 case 'F': // source file-name without suffix536 case 'D': // ignore -Dxxx 537 break; 538 case 'F': // source file-name without suffix 562 539 filename = optarg; 563 540 break; 564 case '?':541 case '?': 565 542 if ( optopt ) { // short option ? 566 543 assertf( false, "Unknown option: -%c\n", (char)optopt ); … … 571 548 __attribute__((fallthrough)); 572 549 #endif 573 default:550 default: 574 551 abort(); 575 552 } // switch -
tests/.expect/castError.txt
r53bb8f1 r9d9a451 1 castError.cfa: 21:1 error: Cannot choose between 3 alternatives for expression2 ExplicitCast of:1 castError.cfa:7:1 error: Cannot choose between 3 alternatives for expression 2 Cast of: 3 3 Name: f 4 4 ... to: 5 5 char Alternatives are: 6 Cost ( 1, 0, 0, 0, 0, 0 , 0 ): ExplicitCast of:6 Cost ( 1, 0, 0, 0, 0, 0 ): Cast of: 7 7 Variable Expression: f: function 8 8 accepting unspecified arguments … … 16 16 Environment: 17 17 18 Cost ( 1, 0, 0, 0, 0, 0 , 0 ): ExplicitCast of:18 Cost ( 1, 0, 0, 0, 0, 0 ): Cast of: 19 19 Variable Expression: f: double 20 20 ... to: … … 25 25 Environment: 26 26 27 Cost ( 1, 0, 0, 0, 0, 0 , 0 ): ExplicitCast of:27 Cost ( 1, 0, 0, 0, 0, 0 ): Cast of: 28 28 Variable Expression: f: signed int 29 29 ... to: … … 35 35 36 36 37 castError.cfa:26:1 error: Cannot choose between 2 alternatives for expression38 Generated Cast of:39 Comma Expression:40 constant expression (3 3: signed int)41 Name: v42 ... to: nothing Alternatives are:43 Cost ( 0, 0, 2, 0, 0, 0, 0 ): Generated Cast of:44 Comma Expression:45 constant expression (3 3: signed int)46 Variable Expression: v: unsigned char47 ... to: nothing48 (types:49 void50 )51 Environment:52 53 Cost ( 0, 0, 2, 0, 0, 0, 0 ): Generated Cast of:54 Comma Expression:55 constant expression (3 3: signed int)56 Variable Expression: v: signed short int57 ... to: nothing58 (types:59 void60 )61 Environment:62 63 -
tests/.expect/completeTypeError.txt
r53bb8f1 r9d9a451 45 45 46 46 Alternatives with failing assertions are: 47 Cost ( 0, 1, 0, 0,1, -5, 0 ): Application of47 Cost ( 0, 1, 0, 1, -5, 0 ): Application of 48 48 Variable Expression: baz: forall 49 49 T: sized object type … … 87 87 void 88 88 ) 89 Environment:( _7 4_0_T ) -> instance of type T (not function type) (no widening)89 Environment:( _73_0_T ) -> instance of type T (not function type) (no widening) 90 90 91 91 -
tests/.expect/declarationSpecifier.x64.txt
r53bb8f1 r9d9a451 689 689 signed int _X4mainFi_iPPKc__1(signed int _X4argci_1, const char **_X4argvPPKc_1){ 690 690 __attribute__ ((unused)) signed int _X12_retval_maini_1; 691 ((void)(_X12_retval_maini_1= 0) /* ?{} */);691 ((void)(_X12_retval_maini_1=((signed int )0)) /* ?{} */); 692 692 return _X12_retval_maini_1; 693 693 ((void)(_X12_retval_maini_1=0) /* ?{} */); -
tests/.expect/declarationSpecifier.x86.txt
r53bb8f1 r9d9a451 689 689 signed int _X4mainFi_iPPKc__1(signed int _X4argci_1, const char **_X4argvPPKc_1){ 690 690 __attribute__ ((unused)) signed int _X12_retval_maini_1; 691 ((void)(_X12_retval_maini_1= 0) /* ?{} */);691 ((void)(_X12_retval_maini_1=((signed int )0)) /* ?{} */); 692 692 return _X12_retval_maini_1; 693 693 ((void)(_X12_retval_maini_1=0) /* ?{} */); -
tests/.expect/gccExtensions.x64.txt
r53bb8f1 r9d9a451 162 162 signed int _X2m2A0A0i_2[((unsigned long int )10)][((unsigned long int )10)]; 163 163 signed int _X2m3A0A0i_2[((unsigned long int )10)][((unsigned long int )10)]; 164 ((void)(_X12_retval_maini_1= 0) /* ?{} */);164 ((void)(_X12_retval_maini_1=((signed int )0)) /* ?{} */); 165 165 return _X12_retval_maini_1; 166 166 ((void)(_X12_retval_maini_1=0) /* ?{} */); -
tests/.expect/gccExtensions.x86.txt
r53bb8f1 r9d9a451 162 162 signed int _X2m2A0A0i_2[((unsigned int )10)][((unsigned int )10)]; 163 163 signed int _X2m3A0A0i_2[((unsigned int )10)][((unsigned int )10)]; 164 ((void)(_X12_retval_maini_1= 0) /* ?{} */);164 ((void)(_X12_retval_maini_1=((signed int )0)) /* ?{} */); 165 165 return _X12_retval_maini_1; 166 166 ((void)(_X12_retval_maini_1=0) /* ?{} */); -
tests/.expect/io1.txt
r53bb8f1 r9d9a451 1 1 9 6 28 0 7 1 2 2 01 2 33 01234 01232 1 2 3 3 123 4 123 5 5 6 6 opening delimiters -
tests/.expect/loopctrl.txt
r53bb8f1 r9d9a451 19 19 10 8 6 4 2 20 20 21 2 4 6 8 1022 2.1 3.8 5.5 7.2 8.923 10 8 6 4 2 024 12.1 10.4 8.7 7 5.3 3.625 21 26 22 N N N N N N N N N N … … 28 24 10 9 8 7 6 5 4 3 2 1 29 25 26 30 27 3 6 9 28 31 29 32 30 (0 0)(1 1)(2 2)(3 3)(4 4)(5 5)(6 6)(7 7)(8 8)(9 9) -
tests/.expect/sum.txt
r53bb8f1 r9d9a451 1 sum from 5 to 15 is 95, check 952 sum from 5 to 15 is 95, check 953 1 sum from 5 to 15 is 95, check 95 4 2 sum from 5 to 15 is 95, check 95 -
tests/Makefile.in
r53bb8f1 r9d9a451 186 186 DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) 187 187 ACLOCAL = @ACLOCAL@ 188 ALLOCA = @ALLOCA@ 188 189 AMTAR = @AMTAR@ 189 190 AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ … … 349 350 am__v_GOC_0 = @echo " GOC " $@; 350 351 am__v_GOC_1 = 351 UPPCC = u++352 352 UPPCOMPILE = $(UPPCC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_UPPFLAGS) $(UPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) $(AM_CFLAGS) $(CFLAGS) 353 353 AM_V_UPP = $(am__v_UPP_@AM_V@) -
tests/array.cfa
r53bb8f1 r9d9a451 1 // -*- Mode: C -*- 2 // 3 // Cforall Version 1.0.0 Copyright (C) 2016 University of Waterloo 4 // 5 // The contents of this file are covered under the licence agreement in the 6 // file "LICENCE" distributed with Cforall. 7 // 8 // array.cfa -- test array declarations 9 // 10 // Author : Peter A. Buhr 11 // Created On : Tue Feb 19 21:18:06 2019 12 // Last Modified By : Peter A. Buhr 13 // Last Modified On : Tue Feb 19 21:18:46 2019 14 // Update Count : 1 15 // 16 1 //Testing array declarations 17 2 int a1[]; 18 3 //int a2[*]; … … 49 34 } 50 35 51 int main() {} 52 53 // Local Variables: // 54 // tab-width: 4 // 55 // compile-command: "cfa array.cfa" // 56 // End: // 36 //Dummy main 37 int main(int argc, char const *argv[]) 38 { 39 return 0; 40 } -
tests/castError.cfa
r53bb8f1 r9d9a451 1 // 2 // Cforall Version 1.0.0 Copyright (C) 2016 University of Waterloo 3 // 4 // The contents of this file are covered under the licence agreement in the 5 // file "LICENCE" distributed with Cforall. 6 // 7 // castError.cfa -- test invalid casts 8 // 9 // Author : Peter A. Buhr 10 // Created On : Tue Feb 19 21:15:39 2019 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Tue Feb 19 21:16:44 2019 13 // Update Count : 1 14 // 15 1 //Testing some of the invalid casts of chars 16 2 int f; 17 3 … … 21 7 (char)f; 22 8 (int(*)())f; 23 24 unsigned char v;25 short int v;26 3, v; // implicit void cast27 9 } 28 10 29 int main() {} 30 31 // Local Variables: // 32 // tab-width: 4 // 33 // compile-command: "cfa castError.cfa" // 34 // End: // 11 //Dummy main 12 int main(int argc, char const *argv[]) 13 { 14 return 0; 15 } -
tests/concurrent/examples/boundedBufferEXT.cfa
r53bb8f1 r9d9a451 1 1 // 2 // Cforall Version 1.0.0 Copyright (C) 2018 University of Waterloo3 //4 2 // The contents of this file are covered under the licence agreement in the 5 3 // file "LICENCE" distributed with Cforall. … … 10 8 // Created On : Wed Apr 18 22:52:12 2018 11 9 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Wed Feb 20 08:36:45 201913 // Update Count : 1110 // Last Modified On : Tue Dec 11 21:55:02 2018 11 // Update Count : 9 14 12 // 15 13 16 #include <stdlib.hfa> // random14 #include <stdlib.hfa> // random 17 15 #include <fstream.hfa> 18 16 #include <kernel.hfa> -
tests/concurrent/examples/boundedBufferINT.cfa
r53bb8f1 r9d9a451 1 1 // 2 // Cforall Version 1.0.0 Copyright (C) 2017 University of Waterloo3 //4 2 // The contents of this file are covered under the licence agreement in the 5 3 // file "LICENCE" distributed with Cforall. … … 10 8 // Created On : Mon Oct 30 12:45:13 2017 11 9 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Wed Feb 20 08:37:24 201913 // Update Count : 8 710 // Last Modified On : Tue Dec 11 21:55:45 2018 11 // Update Count : 84 14 12 // 15 13 16 #include <stdlib.hfa> // random14 #include <stdlib.hfa> // random 17 15 #include <fstream.hfa> 18 16 #include <kernel.hfa> -
tests/concurrent/examples/datingService.cfa
r53bb8f1 r9d9a451 1 1 // 2 // Cforall Version 1.0.0 Copyright (C) 2017 University of Waterloo3 //4 2 // The contents of this file are covered under the licence agreement in the 5 3 // file "LICENCE" distributed with Cforall. … … 10 8 // Created On : Mon Oct 30 12:56:20 2017 11 9 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Wed Feb 20 08:37:12 201913 // Update Count : 3010 // Last Modified On : Tue Dec 11 21:55:34 2018 11 // Update Count : 28 14 12 // 15 13 16 #include <stdlib.hfa> // random14 #include <stdlib.hfa> // random 17 15 #include <fstream.hfa> 18 16 #include <kernel.hfa> -
tests/concurrent/examples/matrixSum.cfa
r53bb8f1 r9d9a451 1 // -*- Mode: C -*- 1 2 // 2 3 // Cforall Version 1.0.0 Copyright (C) 2017 University of Waterloo … … 10 11 // Created On : Mon Oct 9 08:29:28 2017 11 12 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Wed Feb 20 08:37:53 201913 // Update Count : 1 613 // Last Modified On : Tue Dec 11 21:54:55 2018 14 // Update Count : 15 14 15 // 15 16 -
tests/concurrent/examples/quickSort.cfa
r53bb8f1 r9d9a451 1 //2 // Cforall Version 1.0.0 Copyright (C) 2017 University of Waterloo3 1 // 4 2 // The contents of this file are covered under the licence agreement in the … … 11 9 // Created On : Wed Dec 6 12:15:52 2017 12 10 // Last Modified By : Peter A. Buhr 13 // Last Modified On : Wed Feb 20 08:38:24 201914 // Update Count : 16 911 // Last Modified On : Sat Dec 22 08:44:27 2018 12 // Update Count : 168 15 13 // 16 14 -
tests/io1.cfa
r53bb8f1 r9d9a451 10 10 // Created On : Wed Mar 2 16:56:02 2016 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Mon Mar 4 21:42:47 201913 // Update Count : 11 512 // Last Modified On : Fri Dec 21 16:02:55 2018 13 // Update Count : 114 14 14 // 15 15 … … 19 19 int x = 3, y = 5, z = 7; 20 20 sout | x * 3 | y + 1 | z << 2 | x == y | (x | y) | (x || y) | (x > z ? 1 : 2); 21 sout | 0 |1 | 2 | 3;22 sout | ' 0' | '1' | '2' | '3';23 sout | 0 | "" |1 | "" | 2 | "" | 3;21 sout | 1 | 2 | 3; 22 sout | '1' | '2' | '3'; 23 sout | 1 | "" | 2 | "" | 3; 24 24 sout | nl; 25 25 -
tests/literals.cfa
r53bb8f1 r9d9a451 10 10 // Created On : Sat Sep 9 16:34:38 2017 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Tue Feb 12 08:07:39 2019 13 // Update Count : 224 14 // 15 16 #include <features.h> // __GNUC_PREREQ 12 // Last Modified On : Tue Dec 4 21:44:01 2018 13 // Update Count : 139 14 // 15 17 16 #ifdef __CFA__ 17 #include <stdint.h> 18 18 #include <fstream.hfa> 19 19 … … 151 151 -0X0123456789.0123456789P-09; -0X0123456789.0123456789P-09f; -0X0123456789.0123456789P-09l; -0X0123456789.0123456789P-09F; -0X0123456789.0123456789P-09L; 152 152 153 #if defined(__GNUC__) && __GNUC_PREREQ(7,0) // gcc version >= 7154 // floating with length, gcc f16/f128x unsupported and no prelude code for any _FloatXXx, so they work by conversion to long double155 156 /* 0123456789.f16; */ 0123456789.f32; 0123456789.f32x; 0123456789.f64; 0123456789.f64x; 0123456789.W; 0123456789.f128; 0123456789.q; /* 0123456789.f128x; */157 /* +0123456789.f16; */ +0123456789.f32; +0123456789.f32x; +0123456789.f64; +0123456789.f64x; +0123456789.w; +0123456789.f128; +0123456789.Q; /* +0123456789.f128x; */158 /* -0123456789.f16; */ -0123456789.f32; -0123456789.f32x; -0123456789.f64; -0123456789.f64x; -0123456789.W; -0123456789.f128; -0123456789.q; /* -0123456789.f128x; */159 160 /* 0123456789.e09F16; */ 0123456789.e09F32; 0123456789.e09F32x; 0123456789.e09F64; 0123456789.e09F64x; 0123456789.e09W; 0123456789.e09F128; 0123456789.e09q; /* .0123456789e09q; */161 /* +0123456789.e+09F16; */ +0123456789.e+09F32; +0123456789.e+09F32x; +0123456789.e+09F64; +0123456789.e+09F64x; +0123456789.e+09w; +0123456789.e+09F128; +0123456789.e+09Q; /* +.0123456789E+09Q; */162 /* -0123456789.e-09F16; */ -0123456789.e-09F32; -0123456789.e-09F32x; -0123456789.e-09F64; -0123456789.e-09F64x; -0123456789.e-09W; -0123456789.e-09F128; -0123456789.e-09q; /* -.0123456789E-09q; */163 164 /* .0123456789e09F16; */ .0123456789e09F32; .0123456789e09F32x; .0123456789e09F64; .0123456789e09F64x; .0123456789e09W; .0123456789e09F128; .0123456789e09q; /* .0123456789e09q; */165 /* +.0123456789e+09F16; */ +.0123456789e+09F32; +.0123456789e+09F32x; +.0123456789e+09F64; +.0123456789e+09F64x; +.0123456789e+09w; +.0123456789e+09F128; +.0123456789e+09Q; /* +.0123456789E+09Q; */166 /* -.0123456789e-09F16; */ -.0123456789e-09F32; -.0123456789e-09F32x; -.0123456789e-09F64; -.0123456789e-09F64x; -.0123456789e-09W; -.0123456789e-09F128; -.0123456789e-09q; /* -.0123456789E-09q; */167 168 /* 0123456789.0123456789F16; */ 0123456789.0123456789F32; 0123456789.0123456789F32x; 0123456789.0123456789F64; 0123456789.0123456789F64x; 0123456789.0123456789W; 0123456789.0123456789F128; 0123456789.0123456789q; /* 0123456789.0123456789q; */169 /* +0123456789.0123456789F16; */ +0123456789.0123456789F32; +0123456789.0123456789F32x; +0123456789.0123456789F64; +0123456789.0123456789F64x; +0123456789.0123456789w; +0123456789.0123456789F128; +0123456789.0123456789Q; /* +0123456789.0123456789Q; */170 /* -0123456789.0123456789F16; */ -0123456789.0123456789F32; -0123456789.0123456789F32x; -0123456789.0123456789F64; -0123456789.0123456789F64x; -0123456789.0123456789W; -0123456789.0123456789F128; -0123456789.0123456789q; /* -0123456789.0123456789q; */171 172 /* 0123456789.0123456789E09F16; */ 0123456789.0123456789E09F32; 0123456789.0123456789E09F32x; 0123456789.0123456789E09F64; 0123456789.0123456789E09F64x; 0123456789.0123456789E09W; 0123456789.0123456789E09F128; 0123456789.0123456789E09q; /* 0123456789.0123456789E09q; */173 /* +0123456789.0123456789E+09F16; */ +0123456789.0123456789E+09F32; +0123456789.0123456789E+09F32x; +0123456789.0123456789E+09F64; +0123456789.0123456789E+09F64x; +0123456789.0123456789E+09w; +0123456789.0123456789E+09F128; +0123456789.0123456789E+09Q; /* +0123456789.0123456789E+09Q; */174 /* -0123456789.0123456789E-09F16; */ -0123456789.0123456789E-09F32; -0123456789.0123456789E-09F32x; -0123456789.0123456789E-09F64; -0123456789.0123456789E-09F64x; -0123456789.0123456789E-09W; -0123456789.0123456789E-09F128; -0123456789.0123456789E-09q; /* -0123456789.0123456789E-09q; */175 176 /* 0x123456789.p09f16; */ 0x123456789.p09f32; 0x123456789.p09f32x; 0x123456789.p09f64; 0x123456789.p09f64x; 0x123456789.p09W; 0x123456789.p09f128; 0x123456789.p09q; /* 0x123456789.p09f128x; */177 /* +0x123456789.P+09f16; */ +0x123456789.P+09f32; +0x123456789.P+09f32x; +0x123456789.P+09f64; +0x123456789.P+09f64x; +0x123456789.P+09w; +0x123456789.P+09f128; +0x123456789.P+09Q; /* +0x123456789.P+09f128x; */178 /* -0x123456789.P-09f16; */ -0x123456789.P-09f32; -0x123456789.P-09f32x; -0x123456789.P-09f64; -0x123456789.P-09f64x; -0x123456789.P-09W; -0x123456789.P-09f128; -0x123456789.P-09q; /* -0x123456789.P-09f128x; */179 180 /* 0x123456789.p09F16; */ 0x123456789.p09F32; 0x123456789.p09F32x; 0x123456789.p09F64; 0x123456789.p09F64x; 0x123456789.p09W; 0x123456789.p09F128; 0x123456789.p09q; /* .0123456789p09q; */181 /* +0x123456789.p+09F16; */ +0x123456789.p+09F32; +0x123456789.p+09F32x; +0x123456789.p+09F64; +0x123456789.p+09F64x; +0x123456789.p+09w; +0x123456789.p+09F128; +0x123456789.p+09Q; /* +.0123456789p+09Q; */182 /* -0x123456789.p-09F16; */ -0x123456789.p-09F32; -0x123456789.p-09F32x; -0x123456789.p-09F64; -0x123456789.p-09F64x; -0x123456789.p-09W; -0x123456789.p-09F128; -0x123456789.p-09q; /* -.0123456789P-09q; */183 184 /* 0X.0123456789p09F16; */ 0X.0123456789p09F32; 0X.0123456789p09F32x; 0X.0123456789p09F64; 0X.0123456789p09F64x; 0X.0123456789p09W; 0X.0123456789p09F128; 0X.0123456789p09q; /* 0X.0123456789p09q; */185 /* +0X.0123456789p+09F16; */ +0X.0123456789p+09F32; +0X.0123456789p+09F32x; +0X.0123456789p+09F64; +0X.0123456789p+09F64x; +0X.0123456789p+09w; +0X.0123456789p+09F128; +0X.0123456789p+09Q; /* +0X.0123456789p+09Q; */186 /* -0X.0123456789p-09F16; */ -0X.0123456789p-09F32; -0X.0123456789p-09F32x; -0X.0123456789p-09F64; -0X.0123456789p-09F64x; -0X.0123456789p-09W; -0X.0123456789p-09F128; -0X.0123456789p-09q; /* -0X.0123456789P-09q; */187 188 /* 0x123456789.0123456789P09F16; */ 0x123456789.0123456789P09F32; 0x123456789.0123456789P09F32x; 0x123456789.0123456789P09F64; 0x123456789.0123456789P09F64x; 0x123456789.0123456789P09W; 0x123456789.0123456789P09F128; 0x123456789.0123456789P09q; /* 0x123456789.0123456789P09q; */189 /* +0x123456789.0123456789P+09F16; */ +0x123456789.0123456789P+09F32; +0x123456789.0123456789P+09F32x; +0x123456789.0123456789P+09F64; +0x123456789.0123456789P+09F64x; +0x123456789.0123456789P+09w; +0x123456789.0123456789P+09F128; +0x123456789.0123456789P+09Q; /* +0x123456789.0123456789P+09Q; */190 /* -0x123456789.0123456789p-09F16; */ -0x123456789.0123456789p-09F32; -0x123456789.0123456789p-09F32x; -0x123456789.0123456789p-09F64; -0x123456789.0123456789p-09F64x; -0x123456789.0123456789p-09W; -0x123456789.0123456789p-09F128; -0x123456789.0123456789p-09q; /* -0x123456789.0123456789p-09q; */191 192 /* 0x123456789.0123456789P09F16; */ 0x123456789.0123456789P09F32; 0x123456789.0123456789P09F32x; 0x123456789.0123456789P09F64; 0x123456789.0123456789P09F64x; 0x123456789.0123456789P09W; 0x123456789.0123456789P09F128; 0x123456789.0123456789P09q; /* 0x123456789.0123456789P09q; */193 /* +0x123456789.0123456789p+09F16; */ +0x123456789.0123456789p+09F32; +0x123456789.0123456789p+09F32x; +0x123456789.0123456789p+09F64; +0x123456789.0123456789p+09F64x; +0x123456789.0123456789p+09w; +0x123456789.0123456789p+09F128; +0x123456789.0123456789p+09Q; /* +0x123456789.0123456789p+09Q; */194 /* -0x123456789.0123456789P-09F16; */ -0x123456789.0123456789P-09F32; -0x123456789.0123456789P-09F32x; -0x123456789.0123456789P-09F64; -0x123456789.0123456789P-09F64x; -0x123456789.0123456789P-09W; -0x123456789.0123456789P-09F128; -0x123456789.0123456789P-09q; /* -0x123456789.0123456789P-09q; */195 #endif // __GNUC_PREREQ(7,0)196 197 153 #ifdef __CFA__ 198 154 // fixed-size length … … 211 167 // octal 212 168 01234567_l8; 01234567_l16; 01234567_l32; 01234567_l64; 01234567_l8u; 01234567_ul16; 01234567_l32u; 01234567_ul64; 213 +01234567_l8; +01234567_l16; +01234567_l32; +01234567_l64; +01234567_ ul8; +01234567_ul16; +01234567_l32u; +01234567_ul64;169 +01234567_l8; +01234567_l16; +01234567_l32; +01234567_l64; +01234567_l8u; +01234567_ul16; +01234567_l32u; +01234567_ul64; 214 170 -01234567_l8; -01234567_l16; -01234567_l32; -01234567_l64; -01234567_l8u; -01234567_ul16; -01234567_l32u; -01234567_ul64; 215 171 … … 247 203 +0X0123456789ABCDEF_l8; +0X0123456789ABCDEF_l16; +0X0123456789ABCDEFl32; +0X0123456789ABCDEFl64; +0X0123456789ABCDEF_ul8; +0X0123456789ABCDEF_l16u; +0X0123456789ABCDEFul32; +0X0123456789ABCDEFl64u; 248 204 -0X0123456789ABCDEF_l8; -0X0123456789ABCDEF_l16; -0X0123456789ABCDEFl32; -0X0123456789ABCDEFl64; -0X0123456789ABCDEF_ul8; -0X0123456789ABCDEF_l16u; -0X0123456789ABCDEFul32; -0X0123456789ABCDEFl64u; 205 206 // floating 207 0123456789.l32; 0123456789.l64; 0123456789.l80; 0123456789.l128; 208 +0123456789.l32; +0123456789.l64; +0123456789.l80; +0123456789.l128; 209 -0123456789.l32; -0123456789.l64; -0123456789.l80; -0123456789.l128; 210 211 0123456789.e09L32; 0123456789.e09L64; 0123456789.e09L80; 0123456789.e09L128; 212 +0123456789.e+09L32; +0123456789.e+09L64; +0123456789.e+09L80; +0123456789.e+09L128; 213 -0123456789.e-09L32; -0123456789.e-09L64; -0123456789.e-09L80; -0123456789.e-09L128; 214 215 .0123456789e09L32; .0123456789e09L64; .0123456789e09L80; .0123456789e09L128; 216 +.0123456789E+09L32; +.0123456789E+09L64; +.0123456789E+09L80; +.0123456789E+09L128; 217 -.0123456789E-09L32; -.0123456789E-09L64; -.0123456789E-09L80; -.0123456789E-09L128; 218 219 0123456789.0123456789L32; 0123456789.0123456789L64; 0123456789.0123456789L80; 0123456789.0123456789L128; 220 +0123456789.0123456789E09L32; +0123456789.0123456789E09L64; +0123456789.0123456789E09L80; +0123456789.0123456789E09L128; 221 -0123456789.0123456789E+09L32; -0123456789.0123456789E+09L64; -0123456789.0123456789E+09L80; -0123456789.0123456789E+09L128; 222 0123456789.0123456789E-09L32; 0123456789.0123456789E-09L64; 0123456789.0123456789E-09L80; 0123456789.0123456789E-09L128; 223 224 0x0123456789.p09l32; 0x0123456789.p09l64; 0x0123456789.p09l80; 0x0123456789.p09l128; 225 +0x0123456789.p09l32; +0x0123456789.p09l64; +0x0123456789.p09l80; +0x0123456789.p09l128; 226 -0x0123456789.p09l32; -0x0123456789.p09l64; -0x0123456789.p09l80; -0x0123456789.p09l128; 227 228 0x0123456789.p+09l32; 0x0123456789.p+09L64; 0x0123456789.p+09L80; 0x0123456789.p+09L128; 229 +0x0123456789.p-09l32; +0x0123456789.p-09L64; +0x0123456789.p-09L80; +0x0123456789.p-09L128; 230 -0x.0123456789p09l32; -0x.0123456789p09L64; -0x.0123456789p09L80; -0x.0123456789p09L128; 249 231 250 232 // char, short, int suffix overloading -
tests/loopctrl.cfa
r53bb8f1 r9d9a451 10 10 // Created On : Wed Aug 8 18:32:59 2018 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Thu Feb 21 08:54:47 201913 // Update Count : 8612 // Last Modified On : Sun Dec 23 23:00:29 2018 13 // Update Count : 79 14 14 // 15 15 … … 54 54 for ( i; 5.5 -~ 0.5 ) { sout | i; } sout | nl; 55 55 for ( ui; 2u ~= 10u ~ 2u ) { sout | ui; } sout | nl; 56 for ( ui; 10u -~= 2u ~ 2u ) { sout | ui; } sout | nl | nl ;56 for ( ui; 10u -~= 2u ~ 2u ) { sout | ui; } sout | nl | nl | nl; 57 57 58 for ( i; 2 ~ @ ~ 2 ) {59 if ( i > 10 ) break;60 sout | i;61 } sout | nl;62 for ( i; 2.1 ~ @ ~ @ ) {63 if ( i > 10.5 ) break;64 sout | i;65 i += 1.7;66 } sout | nl;67 for ( i; 10 -~ @ ~ 2 ) {68 if ( i < 0 ) break;69 sout | i;70 } sout | nl;71 for ( i; 12.1 ~ @ ~ @ ) {72 if ( i < 2.5 ) break;73 sout | i;74 i -= 1.7;75 } sout | nl | nl;76 77 58 enum { N = 10 }; 78 59 for ( N ) { sout | "N"; } sout | nl; 79 60 for ( i; N ) { sout | i; } sout | nl; 80 for ( i; N -~ 0 ) { sout | i; } sout | nl | nl ;61 for ( i; N -~ 0 ) { sout | i; } sout | nl | nl | nl; 81 62 82 63 const int start = 3, comp = 10, inc = 2; 83 64 for ( i; start ~ comp ~ inc + 1 ) { sout | i; } sout | nl | nl; 84 65 66 sout | nl; 85 67 for ( S s = (S){0}; s < (S){10,10}; s += (S){1} ) { sout | s; } sout | nl; 86 68 for ( s; (S){10,10} ) { sout | s; } sout | nl; -
tests/numericConstants.cfa
r53bb8f1 r9d9a451 10 10 // Created On : Wed May 24 22:10:36 2017 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Tue Feb 5 08:58:16 201913 // Update Count : 512 // Last Modified On : Tue Nov 6 17:59:53 2018 13 // Update Count : 3 14 14 // 15 15 … … 67 67 // Local Variables: // 68 68 // tab-width: 4 // 69 // compile-command: "cfa numericConstants.cfa" //69 // compile-command: "cfa minmax.cfa" // 70 70 // End: // -
tests/preempt_longrun/Makefile.in
r53bb8f1 r9d9a451 334 334 DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) 335 335 ACLOCAL = @ACLOCAL@ 336 ALLOCA = @ALLOCA@ 336 337 AMTAR = @AMTAR@ 337 338 AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ -
tests/pybin/tools.py
r53bb8f1 r9d9a451 3 3 import __main__ 4 4 import argparse 5 import fileinput6 5 import multiprocessing 7 6 import os 8 7 import re 9 import resource10 8 import signal 11 9 import stat 12 10 import sys 13 import time11 import fileinput 14 12 15 13 from pybin import settings … … 133 131 134 132 return None 135 136 def run(exe, output, input):137 ret, _ = sh("timeout %d %s > %s 2>&1" % (settings.timeout.single, exe, output), input = input)138 return ret139 140 133 ################################################################################ 141 134 # file handling 142 135 ################################################################################ 143 # move a file144 def mv(source, dest):145 ret, _ = sh("mv %s %s" % (source, dest))146 return ret147 148 # cat one file into the other149 def cat(source, dest):150 ret, _ = sh("cat %s > %s" % (source, dest))151 return ret152 136 153 137 # helper function to replace patterns in a file … … 246 230 signal.signal(signal.SIGINT, signal.SIG_IGN) 247 231 248 249 # enable core dumps for all the test children250 resource.setrlimit(resource.RLIMIT_CORE, (resource.RLIM_INFINITY, resource.RLIM_INFINITY))251 252 232 ################################################################################ 253 233 # misc … … 271 251 else: 272 252 print(text) 273 274 275 def coreInfo(path):276 cmd = os.path.join(settings.SRCDIR, "pybin/print-core.gdb")277 if not os.path.isfile(cmd):278 return 1, "ERR Printing format for core dumps not found"279 280 dname = os.path.dirname(path)281 core = os.path.join(dname, "core" )282 if not os.path.isfile(path):283 return 1, "ERR Executable path is wrong"284 285 if not os.path.isfile(core):286 return 1, "ERR No core dump"287 288 return sh("gdb -n %s %s -batch -x %s" % (path, core, cmd), print2stdout=False)289 290 class Timed:291 def __enter__(self):292 self.start = time.time()293 return self294 295 def __exit__(self, *args):296 self.end = time.time()297 self.duration = self.end - self.start -
tests/raii/.expect/ctor-autogen-ERR1.txt
r53bb8f1 r9d9a451 1 raii/ctor-autogen.cfa:102:1 error: Unique best alternative includes deleted identifier in GeneratedCast of:1 raii/ctor-autogen.cfa:102:1 error: Unique best alternative includes deleted identifier in Cast of: 2 2 Application of 3 3 Deleted Expression … … 27 27 28 28 ... to arguments 29 GeneratedCast of:29 Cast of: 30 30 Member Expression, with field: 31 31 x: signed int 32 32 ... from aggregate: 33 GeneratedCast of:33 Cast of: 34 34 Variable Expression: m: reference to instance of struct Managed with body 1 35 35 ... to: … … 37 37 ... to: 38 38 reference to signed int 39 GeneratedCast of:39 Cast of: 40 40 constant expression (0 0: zero_t) 41 41 ... to: … … 48 48 49 49 ... to arguments 50 GeneratedCast of:50 Cast of: 51 51 Variable Expression: x: instance of struct Managed with body 1 52 52 ... to: -
tests/sum.cfa
r53bb8f1 r9d9a451 11 11 // Created On : Wed May 27 17:56:53 2015 12 12 // Last Modified By : Peter A. Buhr 13 // Last Modified On : Wed Feb 20 08:32:46 201914 // Update Count : 32913 // Last Modified On : Sun Dec 23 23:00:38 2018 14 // Update Count : 287 15 15 // 16 16 17 17 #include <fstream.hfa> 18 18 #include <stdlib.hfa> 19 20 void ?{}( int & c, zero_t ) { c = 0; } // not in prelude 19 21 20 22 trait sumable( otype T ) { … … 34 36 } // sum 35 37 38 // Not in prelude. 39 unsigned char ?+?( unsigned char t1, unsigned char t2 ) { return (int)t1 + t2; } // cast forces integer addition, otherwise recursion 40 unsigned char ?+=?( unsigned char & t1, unsigned char t2 ) { t1 = t1 + t2; return t1; } 41 unsigned char ++?( unsigned char & t ) { t += 1; return t; } 42 unsigned char ?++( unsigned char & t ) { unsigned char temp = t; t += 1; return temp; } 43 44 // Not in prelude. 45 void ?{}( unsigned char & c, zero_t ) { c = 0; } 46 void ?{}( float & f, zero_t ) { f = 0.0; } 47 void ?{}( double & d, zero_t ) { d = 0.0; } 48 36 49 int main( void ) { 37 50 const int low = 5, High = 15, size = High - low; 38 51 39 signed char s = 0, a[size], v = (char)low;40 for ( int i = 0; i < size; i += 1, v += 1 hh) {52 unsigned char s = 0, a[size], v = (char)low; 53 for ( int i = 0; i < size; i += 1, v += 1 ) { 41 54 s += v; 42 55 a[i] = v; 43 56 } // for 44 57 sout | "sum from" | low | "to" | High | "is" 45 | sum( size, (signed char *)a ) | ", check" | (signed char)s; 46 47 unsigned char s = 0, a[size], v = low; 48 for ( int i = 0; i < size; i += 1, v += 1hhu ) { 49 s += (unsigned char)v; 50 a[i] = (unsigned char)v; 51 } // for 52 sout | "sum from" | low | "to" | High | "is" 53 | sum( size, (unsigned char *)a ) | ", check" | (unsigned char)s; 54 55 short int s = 0, a[size], v = low; 56 for ( int i = 0; i < size; i += 1, v += 1h ) { 57 s += (short int)v; 58 a[i] = (short int)v; 59 } // for 60 sout | "sum from" | low | "to" | High | "is" 61 | sum( size, (short int *)a ) | ", check" | (short int)s; 58 | sum( size, (unsigned char *)a ) | ", check" | (int)s; 62 59 63 60 int s = 0, a[size], v = low; -
tests/test.py
r53bb8f1 r9d9a451 121 121 # running test functions 122 122 ################################################################################ 123 def success(val): 124 return val == 0 or settings.dry_run 125 126 def isExe(file): 127 return settings.dry_run or fileIsExecutable(file) 128 129 def noRule(file, target): 130 return not settings.dry_run and fileContainsOnly(file, "make: *** No rule to make target `%s'. Stop." % target) 123 # fix the absolute paths in the output 124 def fixoutput( fname ): 125 if not is_ascii(fname): 126 return 127 128 file_replace(fname, "%s/" % settings.SRCDIR, "") 129 131 130 132 131 # logic to run a single test and return the result (No handling of printing or other test framework logic) … … 144 143 145 144 # build, skipping to next test on error 146 with Timed() as comp_dur: 147 make_ret, _ = make( test.target(), redirects = ("2> %s 1> /dev/null" % out_file), error_file = err_file ) 145 before = time.time() 146 make_ret, _ = make( test.target(), 147 redirects = "2> %s 1> /dev/null" % out_file, 148 error_file = err_file 149 ) 150 after = time.time() 151 152 comp_dur = after - before 153 154 run_dur = None 148 155 149 156 # if the make command succeds continue otherwise skip to diff 150 run_dur = None 151 if success(make_ret): 152 with Timed() as run_dur: 153 if isExe(exe_file): 154 # run test 155 retcode = run(exe_file, out_file, in_file) 156 else : 157 # simply cat the result into the output 158 retcode = cat(exe_file, out_file) 157 if make_ret == 0 or settings.dry_run: 158 before = time.time() 159 if settings.dry_run or fileIsExecutable(exe_file) : 160 # run test 161 retcode, _ = sh("timeout %d %s > %s 2>&1" % (settings.timeout.single, exe_file, out_file), input = in_file) 162 else : 163 # simply cat the result into the output 164 retcode, _ = sh("cat %s > %s" % (exe_file, out_file)) 165 166 after = time.time() 167 run_dur = after - before 159 168 else: 160 retcode = mv(err_file, out_file) 161 162 if success(retcode): 169 retcode, _ = sh("mv %s %s" % (err_file, out_file)) 170 171 172 if retcode == 0: 173 # fixoutput(out_file) 163 174 if settings.generating : 164 175 # if we are ounly generating the output we still need to check that the test actually exists 165 if no Rule(out_file,test.target()) :166 retcode = 1 176 if not settings.dry_run and fileContainsOnly(out_file, "make: *** No rule to make target `%s'. Stop." % test.target()) : 177 retcode = 1; 167 178 error = "\t\tNo make target for test %s!" % test.target() 168 rm(out_file)179 sh("rm %s" % out_file, False) 169 180 else: 170 181 error = None … … 177 188 error = myfile.read() 178 189 179 ret, info = coreInfo(exe_file)180 error = error + info181 182 183 190 184 191 # clean the executable 185 rm(exe_file)186 187 return retcode, error, [comp_dur .duration, run_dur.duration if run_dur else None]192 sh("rm -f %s > /dev/null 2>&1" % test.target()) 193 194 return retcode, error, [comp_dur, run_dur] 188 195 189 196 # run a single test and handle the errors, outputs, printing, exception handling, etc. … … 192 199 with SignalHandling(): 193 200 # print formated name 194 name_txt = "%2 4s " % t.name201 name_txt = "%20s " % t.name 195 202 196 203 retcode, error, duration = run_single_test(t) … … 256 263 allTests = listTests( options.include, options.exclude ) 257 264 258 259 265 # if user wants all tests than no other treatement of the test list is required 260 266 if options.all or options.list or options.list_comp or options.include : -
tests/warnings/.expect/self-assignment.txt
r53bb8f1 r9d9a451 1 warnings/self-assignment.cfa:29:1 warning: self assignment of expression: GeneratedCast of:1 warnings/self-assignment.cfa:29:1 warning: self assignment of expression: Cast of: 2 2 Variable Expression: j: signed int 3 3 ... to: 4 4 reference to signed int 5 warnings/self-assignment.cfa:30:1 warning: self assignment of expression: GeneratedCast of:5 warnings/self-assignment.cfa:30:1 warning: self assignment of expression: Cast of: 6 6 Variable Expression: s: instance of struct S with body 1 7 7 ... to: 8 8 reference to instance of struct S with body 1 9 warnings/self-assignment.cfa:31:1 warning: self assignment of expression: GeneratedCast of:9 warnings/self-assignment.cfa:31:1 warning: self assignment of expression: Cast of: 10 10 Member Expression, with field: 11 11 i: signed int … … 14 14 ... to: 15 15 reference to signed int 16 warnings/self-assignment.cfa:32:1 warning: self assignment of expression: GeneratedCast of:16 warnings/self-assignment.cfa:32:1 warning: self assignment of expression: Cast of: 17 17 Member Expression, with field: 18 18 i: signed int -
tests/warnings/self-assignment.cfa
r53bb8f1 r9d9a451 9 9 // Author : Rob Schluntz 10 10 // Created On : Thu Mar 1 13:53:57 2018 11 // Last Modified By : Peter A. Buhr12 // Last Modified On : Wed Feb 20 07:56:17 201913 // Update Count : 311 // Last Modified By : Rob Schluntz 12 // Last Modified On : Thu Mar 1 13:53:57 2018 13 // Update Count : 2 14 14 // 15 15 16 16 struct S { 17 int i;17 int i; 18 18 }; 19 19 20 20 struct T { 21 S s;21 S s; 22 22 }; 23 23 24 24 int main() { 25 int j = 0;26 S s = { 0 };27 T t = { { 0 } };25 int j = 0; 26 S s = { 0 }; 27 T t = { { 0 } }; 28 28 29 j = j;30 s = s;31 s.i = s.i;32 t.s.i = t.s.i;29 j = j; 30 s = s; 31 s.i = s.i; 32 t.s.i = t.s.i; 33 33 } 34 34 -
tools/Makefile.in
r53bb8f1 r9d9a451 194 194 DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) 195 195 ACLOCAL = @ACLOCAL@ 196 ALLOCA = @ALLOCA@ 196 197 AMTAR = @AMTAR@ 197 198 AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ -
tools/PrettyGitLogs.sh
r53bb8f1 r9d9a451 3 3 set -e 4 4 5 GIT="git --git-dir=$1/.git" 6 7 GIT_UPDATE="$2/GIT_UPDATE" 8 GIT_LOG="$2/GIT_LOG" 9 GIT_DIFF="$2/GIT_DIFF" 5 GIT_UPDATE="$1/GIT_UPDATE" 6 GIT_LOG="$1/GIT_LOG" 7 GIT_DIFF="$1/GIT_DIFF" 10 8 11 9 rm -f ${GIT_UPDATE} ${GIT_LOG} ${GIT_DIFF} 12 10 13 GitOldRef=$ 314 GitNewRef=$ 411 GitOldRef=$2 12 GitNewRef=$3 15 13 16 14 -
tools/prettyprinter/Makefile.in
r53bb8f1 r9d9a451 223 223 DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) 224 224 ACLOCAL = @ACLOCAL@ 225 ALLOCA = @ALLOCA@ 225 226 AMTAR = @AMTAR@ 226 227 AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
Note:
See TracChangeset
for help on using the changeset viewer.