Changeset 53bb8f1
- Timestamp:
- Mar 12, 2019, 3:00:54 PM (7 years ago)
- Branches:
- ADT, aaron-thesis, arm-eh, ast-experimental, cleanup-dtors, enum, forall-pointer-decay, jacob/cs343-translation, jenkins-sandbox, master, new-ast, new-ast-unique-expr, pthread-emulation, qualifiedEnum
- Children:
- 30e32b2, a2545593
- Parents:
- 9d9a451 (diff), 91d6584 (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the(diff)
links above to see all the changes relative to each parent. - Files:
-
- 15 added
- 1 deleted
- 107 edited
- 16 moved
Legend:
- Unmodified
- Added
- Removed
-
.gitignore
r9d9a451 r53bb8f1 10 10 config.py 11 11 stamp-h1 12 libtool 12 13 /Makefile 13 14 **/Makefile … … 49 50 libcfa/arm-nolib/ 50 51 51 52 52 # generated by bison and lex from parser.yy and lex.ll 53 53 src/Parser/parser.output -
Makefile.am
r9d9a451 r53bb8f1 11 11 ## Created On : Sun May 31 22:14:18 2015 12 12 ## Last Modified By : Peter A. Buhr 13 ## Last Modified On : Wed Dec 14 14:20:48 201614 ## Update Count : 1513 ## Last Modified On : Sat Feb 2 16:54:42 2019 14 ## Update Count : 21 15 15 ############################################################################### 16 16 … … 18 18 ACLOCAL_AMFLAGS = -I automake 19 19 20 MAINTAINERCLEANFILES = lib/* bin/* tests/.deps/* tests/.out/* 21 # order important 20 MAINTAINERCLEANFILES = lib/* bin/* tests/.deps/* tests/.out/* # order important 22 21 23 22 SUBDIRS = driver src . @LIBCFA_TARGET_DIRS@ -
Makefile.in
r9d9a451 r53bb8f1 250 250 distcleancheck_listfiles = find . -type f -print 251 251 ACLOCAL = @ACLOCAL@ 252 ALLOCA = @ALLOCA@253 252 AMTAR = @AMTAR@ 254 253 AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ … … 396 395 AUTOMAKE_OPTIONS = foreign # do not require all the GNU file names 397 396 ACLOCAL_AMFLAGS = -I automake 398 MAINTAINERCLEANFILES = lib/* bin/* tests/.deps/* tests/.out/* 397 MAINTAINERCLEANFILES = lib/* bin/* tests/.deps/* tests/.out/* # order important 399 398 SUBDIRS = driver src . @LIBCFA_TARGET_DIRS@ 400 399 noinst_DATA = @LIBCFA_TARGET_MAKEFILES@ … … 928 927 .PRECIOUS: Makefile 929 928 930 # order important931 929 932 930 @LIBCFA_TARGET_MAKEFILES@ : Makefile $(srcdir)/libcfa/configure -
automake/cfa.m4
r9d9a451 r53bb8f1 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.m4 84 AC_DEFUN([M4CFA_CHECK_COMPILE_FLAG], 85 [AC_PREREQ(2.64)dnl for _AC_LANG_PREFIX and AS_VAR_IF 86 AS_VAR_PUSHDEF([CACHEVAR],[m4cfa_cv_check_[]_AC_LANG_ABBREV[]flags_$4_$1])dnl 87 AC_CACHE_CHECK([whether _AC_LANG compiler accepts $1], CACHEVAR, [ 88 m4cfa_check_save_flags=$[]_AC_LANG_PREFIX[]FLAGS 89 _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])dnl 98 ])dnl M4CFA_CHECK_COMPILE_FLAGS -
benchmark/Makefile.am
r9d9a451 r53bb8f1 21 21 include $(top_srcdir)/src/cfa.make 22 22 23 UPPCC = u++24 25 23 AM_CFLAGS = -O2 -Wall -I$(srcdir) -lrt -pthread 26 24 AM_CFAFLAGS = -quiet -in-tree -nodebug 27 25 AM_UPPFLAGS = -quiet -nodebug -multi 28 26 29 TOOLSDIR = ${abs_top_srcdir}/tools/ 30 REPEAT = ${TOOLSDIR}repeat 31 STATS = ${TOOLSDIR}stat.py 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 32 53 repeats = 30 33 54 skipcompile = no … … 35 56 PRINT_FORMAT = %20s: #Comments needed for spacing 36 57 37 #prevent any tests in parallel 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 38 68 .NOTPARALLEL: 39 40 #make sure automake includes the compile rules for C and C++41 EXTRA_PROGRAMS = dummy42 dummy_SOURCES = c.c cxx.cpp43 69 44 70 ## ========================================================================================================= … … 55 81 56 82 %.runquiet : 57 @+make $(basename $@) CFLAGS="-w" 83 @+make $(basename $@) CFLAGS="-w" __quiet=quiet 58 84 @taskset -c 1 ./a.out 59 85 @rm -f a.out … … 64 90 65 91 ${REPEAT} : 66 @+make -C ${ TOOLSDIR}repeat92 @+make -C ${abs_top_builddir}/tools repeat 67 93 68 94 ## ========================================================================================================= … … 105 131 ## ========================================================================================================= 106 132 loop$(EXEEXT): 107 $( AM_V_CC)$(COMPILE) -DBENCH_N=5000000000 $(srcdir)/loop.c133 $(BENCH_V_CC)$(COMPILE) -DBENCH_N=5000000000 $(srcdir)/loop.c 108 134 109 135 function$(EXEEXT): 110 $( AM_V_CC)$(COMPILE) -DBENCH_N=5000000000 $(srcdir)/function.c136 $(BENCH_V_CC)$(COMPILE) -DBENCH_N=5000000000 $(srcdir)/function.c 111 137 112 138 fetch_add$(EXEEXT): 113 $( AM_V_CC)$(COMPILE) -DBENCH_N=500000000 $(srcdir)/fetch_add.c139 $(BENCH_V_CC)$(COMPILE) -DBENCH_N=500000000 $(srcdir)/fetch_add.c 114 140 115 141 ## ========================================================================================================= … … 134 160 135 161 ctxswitch-kos_fibre$(EXEEXT): 136 $( AM_V_CXX)$(CXXCOMPILE) -DBENCH_N=50000000 $(srcdir)/ctxswitch/kos_fibre.cpp -I$(LIBFIBRE_DIR) -lfibre162 $(BENCH_V_CXX)$(CXXCOMPILE) -DBENCH_N=50000000 $(srcdir)/ctxswitch/kos_fibre.cpp -I$(LIBFIBRE_DIR) -lfibre 137 163 138 164 ctxswitch-kos_fibre2$(EXEEXT): 139 $( AM_V_CXX)$(CXXCOMPILE) -DBENCH_N=50000000 $(srcdir)/ctxswitch/kos_fibre2.cpp -I$(LIBFIBRE_DIR) -lfibre165 $(BENCH_V_CXX)$(CXXCOMPILE) -DBENCH_N=50000000 $(srcdir)/ctxswitch/kos_fibre2.cpp -I$(LIBFIBRE_DIR) -lfibre 140 166 endif 141 167 … … 143 169 144 170 ctxswitch-pthread$(EXEEXT): 145 $( AM_V_CC)$(COMPILE) -DBENCH_N=50000000 $(srcdir)/ctxswitch/pthreads.c171 $(BENCH_V_CC)$(COMPILE) -DBENCH_N=50000000 $(srcdir)/ctxswitch/pthreads.c 146 172 147 173 ctxswitch-cfa_coroutine$(EXEEXT): 148 $( AM_V_CFA)$(CFACOMPILE) -DBENCH_N=50000000 $(srcdir)/ctxswitch/cfa_cor.c174 $(BENCH_V_CFA)$(CFACOMPILE) -DBENCH_N=50000000 $(srcdir)/ctxswitch/cfa_cor.cfa 149 175 150 176 ctxswitch-cfa_thread$(EXEEXT): 151 $( AM_V_CFA)$(CFACOMPILE) -DBENCH_N=50000000 $(srcdir)/ctxswitch/cfa_thrd.c177 $(BENCH_V_CFA)$(CFACOMPILE) -DBENCH_N=50000000 $(srcdir)/ctxswitch/cfa_thrd.cfa 152 178 153 179 ctxswitch-cfa_thread2$(EXEEXT): 154 $( AM_V_CFA)$(CFACOMPILE) -DBENCH_N=50000000 $(srcdir)/ctxswitch/cfa_thrd2.c180 $(BENCH_V_CFA)$(CFACOMPILE) -DBENCH_N=50000000 $(srcdir)/ctxswitch/cfa_thrd2.cfa 155 181 156 182 ctxswitch-upp_coroutine$(EXEEXT): 157 $( AM_V_UPP)$(UPPCOMPILE) -DBENCH_N=50000000 $(srcdir)/ctxswitch/upp_cor.cc183 $(BENCH_V_UPP)$(UPPCOMPILE) -DBENCH_N=50000000 $(srcdir)/ctxswitch/upp_cor.cc 158 184 159 185 ctxswitch-upp_thread$(EXEEXT): 160 $( AM_V_UPP)$(UPPCOMPILE) -DBENCH_N=50000000 $(srcdir)/ctxswitch/upp_thrd.cc186 $(BENCH_V_UPP)$(UPPCOMPILE) -DBENCH_N=50000000 $(srcdir)/ctxswitch/upp_thrd.cc 161 187 162 188 ctxswitch-goroutine$(EXEEXT): 163 $( AM_V_GOC)go build -o a.out $(srcdir)/ctxswitch/goroutine.go189 $(BENCH_V_GOC)go build -o a.out $(srcdir)/ctxswitch/goroutine.go 164 190 165 191 ctxswitch-java_thread$(EXEEXT): 166 $( AM_V_JAVAC)javac -d $(builddir) $(srcdir)/ctxswitch/JavaThread.java192 $(BENCH_V_JAVAC)javac -d $(builddir) $(srcdir)/ctxswitch/JavaThread.java 167 193 @echo "#!/bin/sh" > a.out 168 194 @echo "java JavaThread" >> a.out … … 182 208 183 209 mutex-pthread_lock$(EXEEXT): 184 $( AM_V_CC)$(COMPILE) -DBENCH_N=50000000 $(srcdir)/mutex/pthreads.c210 $(BENCH_V_CC)$(COMPILE) -DBENCH_N=50000000 $(srcdir)/mutex/pthreads.c 185 211 186 212 mutex-upp$(EXEEXT): 187 $( AM_V_UPP)$(UPPCOMPILE) -DBENCH_N=50000000 $(srcdir)/mutex/upp.cc213 $(BENCH_V_UPP)$(UPPCOMPILE) -DBENCH_N=50000000 $(srcdir)/mutex/upp.cc 188 214 189 215 mutex-cfa1$(EXEEXT): 190 $( AM_V_CFA)$(CFACOMPILE) -DBENCH_N=5000000 $(srcdir)/mutex/cfa1.c216 $(BENCH_V_CFA)$(CFACOMPILE) -DBENCH_N=5000000 $(srcdir)/mutex/cfa1.cfa 191 217 192 218 mutex-cfa2$(EXEEXT): 193 $( AM_V_CFA)$(CFACOMPILE) -DBENCH_N=5000000 $(srcdir)/mutex/cfa2.c219 $(BENCH_V_CFA)$(CFACOMPILE) -DBENCH_N=5000000 $(srcdir)/mutex/cfa2.cfa 194 220 195 221 mutex-cfa4$(EXEEXT): 196 $( AM_V_CFA)$(CFACOMPILE) -DBENCH_N=5000000 $(srcdir)/mutex/cfa4.c222 $(BENCH_V_CFA)$(CFACOMPILE) -DBENCH_N=5000000 $(srcdir)/mutex/cfa4.cfa 197 223 198 224 mutex-java_thread$(EXEEXT): 199 $( AM_V_JAVAC)javac -d $(builddir) $(srcdir)/mutex/JavaThread.java225 $(BENCH_V_JAVAC)javac -d $(builddir) $(srcdir)/mutex/JavaThread.java 200 226 @echo "#!/bin/sh" > a.out 201 227 @echo "java JavaThread" >> a.out … … 212 238 213 239 signal-pthread_cond$(EXEEXT): 214 $( AM_V_CC)$(COMPILE) -DBENCH_N=500000 $(srcdir)/schedint/pthreads.c240 $(BENCH_V_CC)$(COMPILE) -DBENCH_N=500000 $(srcdir)/schedint/pthreads.c 215 241 216 242 signal-upp$(EXEEXT): 217 $( AM_V_UPP)$(UPPCOMPILE) -DBENCH_N=5000000 $(srcdir)/schedint/upp.cc243 $(BENCH_V_UPP)$(UPPCOMPILE) -DBENCH_N=5000000 $(srcdir)/schedint/upp.cc 218 244 219 245 signal-cfa1$(EXEEXT): 220 $( AM_V_CFA)$(CFACOMPILE) -DBENCH_N=500000 $(srcdir)/schedint/cfa1.c246 $(BENCH_V_CFA)$(CFACOMPILE) -DBENCH_N=500000 $(srcdir)/schedint/cfa1.cfa 221 247 222 248 signal-cfa2$(EXEEXT): 223 $( AM_V_CFA)$(CFACOMPILE) -DBENCH_N=500000 $(srcdir)/schedint/cfa2.c249 $(BENCH_V_CFA)$(CFACOMPILE) -DBENCH_N=500000 $(srcdir)/schedint/cfa2.cfa 224 250 225 251 signal-cfa4$(EXEEXT): 226 $( AM_V_CFA)$(CFACOMPILE) -DBENCH_N=500000 $(srcdir)/schedint/cfa4.c252 $(BENCH_V_CFA)$(CFACOMPILE) -DBENCH_N=500000 $(srcdir)/schedint/cfa4.cfa 227 253 228 254 signal-java_thread$(EXEEXT): 229 $( AM_V_JAVAC)javac -d $(builddir) $(srcdir)/schedint/JavaThread.java255 $(BENCH_V_JAVAC)javac -d $(builddir) $(srcdir)/schedint/JavaThread.java 230 256 @echo "#!/bin/sh" > a.out 231 257 @echo "java JavaThread" >> a.out … … 241 267 242 268 waitfor-upp$(EXEEXT): 243 $( AM_V_UPP)$(UPPCOMPILE) -DBENCH_N=5000000 $(srcdir)/schedext/upp.cc269 $(BENCH_V_UPP)$(UPPCOMPILE) -DBENCH_N=5000000 $(srcdir)/schedext/upp.cc 244 270 245 271 waitfor-cfa1$(EXEEXT): 246 $( AM_V_CFA)$(CFACOMPILE) -DBENCH_N=500000 $(srcdir)/schedext/cfa1.c272 $(BENCH_V_CFA)$(CFACOMPILE) -DBENCH_N=500000 $(srcdir)/schedext/cfa1.cfa 247 273 248 274 waitfor-cfa2$(EXEEXT): 249 $( AM_V_CFA)$(CFACOMPILE) -DBENCH_N=500000 $(srcdir)/schedext/cfa2.c275 $(BENCH_V_CFA)$(CFACOMPILE) -DBENCH_N=500000 $(srcdir)/schedext/cfa2.cfa 250 276 251 277 waitfor-cfa4$(EXEEXT): 252 $( AM_V_CFA)$(CFACOMPILE) -DBENCH_N=500000 $(srcdir)/schedext/cfa4.c278 $(BENCH_V_CFA)$(CFACOMPILE) -DBENCH_N=500000 $(srcdir)/schedext/cfa4.cfa 253 279 254 280 ## ========================================================================================================= … … 264 290 265 291 creation-cfa_coroutine$(EXEEXT): 266 $( AM_V_CFA)$(CFACOMPILE) -DBENCH_N=10000000 $(srcdir)/creation/cfa_cor.c292 $(BENCH_V_CFA)$(CFACOMPILE) -DBENCH_N=10000000 $(srcdir)/creation/cfa_cor.cfa 267 293 268 294 creation-cfa_coroutine_eager$(EXEEXT): 269 $( AM_V_CFA)$(CFACOMPILE) -DBENCH_N=10000000 $(srcdir)/creation/cfa_cor.c295 $(BENCH_V_CFA)$(CFACOMPILE) -DBENCH_N=10000000 $(srcdir)/creation/cfa_cor.cfa -DEAGER 270 296 271 297 creation-cfa_thread$(EXEEXT): 272 $( AM_V_CFA)$(CFACOMPILE) -DBENCH_N=10000000 $(srcdir)/creation/cfa_thrd.c298 $(BENCH_V_CFA)$(CFACOMPILE) -DBENCH_N=10000000 $(srcdir)/creation/cfa_thrd.cfa 273 299 274 300 creation-upp_coroutine$(EXEEXT): 275 $( AM_V_UPP)$(UPPCOMPILE) -DBENCH_N=50000000 $(srcdir)/creation/upp_cor.cc301 $(BENCH_V_UPP)$(UPPCOMPILE) -DBENCH_N=50000000 $(srcdir)/creation/upp_cor.cc 276 302 277 303 creation-upp_thread$(EXEEXT): 278 $( AM_V_UPP)$(UPPCOMPILE) -DBENCH_N=50000000 $(srcdir)/creation/upp_thrd.cc304 $(BENCH_V_UPP)$(UPPCOMPILE) -DBENCH_N=50000000 $(srcdir)/creation/upp_thrd.cc 279 305 280 306 creation-pthread$(EXEEXT): 281 $( AM_V_CC)$(COMPILE) -DBENCH_N=250000 $(srcdir)/creation/pthreads.c307 $(BENCH_V_CC)$(COMPILE) -DBENCH_N=250000 $(srcdir)/creation/pthreads.c 282 308 283 309 creation-goroutine$(EXEEXT): 284 $( AM_V_GOC)go build -o a.out $(srcdir)/creation/goroutine.go310 $(BENCH_V_GOC)go build -o a.out $(srcdir)/creation/goroutine.go 285 311 286 312 creation-java_thread$(EXEEXT): 287 $( AM_V_JAVAC)javac -d $(builddir) $(srcdir)/creation/JavaThread.java313 $(BENCH_V_JAVAC)javac -d $(builddir) $(srcdir)/creation/JavaThread.java 288 314 @echo "#!/bin/sh" > a.out 289 315 @echo "java JavaThread" >> a.out … … 306 332 307 333 compile-array$(EXEEXT): 308 $(AM_V_CFA)$(CFACOMPILE) -fsyntax-only -w $(testdir)/array.c334 @$(CFACOMPILE) -fsyntax-only -w $(testdir)/array.cfa 309 335 310 336 compile-attributes$(EXEEXT): 311 $(AM_V_CFA)$(CFACOMPILE) -fsyntax-only -w $(testdir)/attributes.cfa337 @$(CFACOMPILE) -fsyntax-only -w $(testdir)/attributes.cfa 312 338 313 339 compile-empty$(EXEEXT): 314 $(AM_V_CFA)$(CFACOMPILE) -fsyntax-only -w $(srcdir)/compile/empty.c340 @$(CFACOMPILE) -fsyntax-only -w $(srcdir)/compile/empty.cfa 315 341 316 342 compile-expression$(EXEEXT): 317 $(AM_V_CFA)$(CFACOMPILE) -fsyntax-only -w $(testdir)/expression.c343 @$(CFACOMPILE) -fsyntax-only -w $(testdir)/expression.cfa 318 344 319 345 compile-io$(EXEEXT): 320 $(AM_V_CFA)$(CFACOMPILE) -fsyntax-only -w $(testdir)/io1.c346 @$(CFACOMPILE) -fsyntax-only -w $(testdir)/io1.cfa 321 347 322 348 compile-monitor$(EXEEXT): 323 $(AM_V_CFA)$(CFACOMPILE) -fsyntax-only -w $(testdir)/concurrent/monitor.c349 @$(CFACOMPILE) -fsyntax-only -w $(testdir)/concurrent/monitor.cfa 324 350 325 351 compile-operators$(EXEEXT): 326 $(AM_V_CFA)$(CFACOMPILE) -fsyntax-only -w $(testdir)/operators.c352 @$(CFACOMPILE) -fsyntax-only -w $(testdir)/operators.cfa 327 353 328 354 compile-thread$(EXEEXT): 329 $(AM_V_CFA)$(CFACOMPILE) -fsyntax-only -w $(testdir)/concurrent/thread.c355 @$(CFACOMPILE) -fsyntax-only -w $(testdir)/concurrent/thread.cfa 330 356 331 357 compile-typeof$(EXEEXT): 332 $(AM_V_CFA)$(CFACOMPILE) -fsyntax-only -w $(testdir)/typeof.c333 358 @$(CFACOMPILE) -fsyntax-only -w $(testdir)/typeof.cfa 359 -
benchmark/Makefile.in
r9d9a451 r53bb8f1 111 111 CONFIG_CLEAN_FILES = 112 112 CONFIG_CLEAN_VPATH_FILES = 113 am_dummy_OBJECTS = c.$(OBJEXT) cxx.$(OBJEXT)113 am_dummy_OBJECTS = dummyC.$(OBJEXT) dummyCXX.$(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@203 202 AMTAR = @AMTAR@ 204 203 AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ … … 364 363 am__v_GOC_0 = @echo " GOC " $@; 365 364 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++374 373 AM_CFLAGS = -O2 -Wall -I$(srcdir) -lrt -pthread 375 374 AM_CFAFLAGS = -quiet -in-tree -nodebug 376 375 AM_UPPFLAGS = -quiet -nodebug -multi 377 TOOLSDIR = ${abs_top_srcdir}/tools/ 378 REPEAT = ${TOOLSDIR}repeat 379 STATS = ${TOOLSDIR}stat.py 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 380 398 repeats = 30 381 399 skipcompile = no 382 400 TIME_FORMAT = "%E" 383 401 PRINT_FORMAT = %20s: #Comments needed for spacing 384 dummy_SOURCES = c.c cxx.cpp402 dummy_SOURCES = dummyC.c dummyCXX.cpp 385 403 CTXSWITCH_DEPEND = loop.run function.run fetch_add.run \ 386 404 ctxswitch-pthread.run ctxswitch-cfa_coroutine.run \ … … 435 453 -rm -f *.tab.c 436 454 437 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ c.Po@am__quote@438 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ cxx.Po@am__quote@455 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dummyC.Po@am__quote@ 456 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dummyCXX.Po@am__quote@ 439 457 440 458 .c.o: … … 706 724 $(am__mv) $$depbase.Tpo $$depbase.Plo 707 725 708 #prevent any tests in parallel 726 dummyC.c: 727 @echo "int main() { return 0; }" > ${@} 728 729 dummyCXX.cpp: 730 @echo "int main() { return 0; }" > ${@} 731 709 732 .NOTPARALLEL: 710 733 … … 721 744 722 745 %.runquiet : 723 @+make $(basename $@) CFLAGS="-w" 746 @+make $(basename $@) CFLAGS="-w" __quiet=quiet 724 747 @taskset -c 1 ./a.out 725 748 @rm -f a.out … … 730 753 731 754 ${REPEAT} : 732 @+make -C ${ TOOLSDIR}repeat755 @+make -C ${abs_top_builddir}/tools repeat 733 756 734 757 jenkins$(EXEEXT): … … 768 791 769 792 loop$(EXEEXT): 770 $( AM_V_CC)$(COMPILE) -DBENCH_N=5000000000 $(srcdir)/loop.c793 $(BENCH_V_CC)$(COMPILE) -DBENCH_N=5000000000 $(srcdir)/loop.c 771 794 772 795 function$(EXEEXT): 773 $( AM_V_CC)$(COMPILE) -DBENCH_N=5000000000 $(srcdir)/function.c796 $(BENCH_V_CC)$(COMPILE) -DBENCH_N=5000000000 $(srcdir)/function.c 774 797 775 798 fetch_add$(EXEEXT): 776 $( AM_V_CC)$(COMPILE) -DBENCH_N=500000000 $(srcdir)/fetch_add.c799 $(BENCH_V_CC)$(COMPILE) -DBENCH_N=500000000 $(srcdir)/fetch_add.c 777 800 778 801 @WITH_LIBFIBRE_TRUE@ctxswitch-kos_fibre$(EXEEXT): 779 @WITH_LIBFIBRE_TRUE@ $( AM_V_CXX)$(CXXCOMPILE) -DBENCH_N=50000000 $(srcdir)/ctxswitch/kos_fibre.cpp -I$(LIBFIBRE_DIR) -lfibre802 @WITH_LIBFIBRE_TRUE@ $(BENCH_V_CXX)$(CXXCOMPILE) -DBENCH_N=50000000 $(srcdir)/ctxswitch/kos_fibre.cpp -I$(LIBFIBRE_DIR) -lfibre 780 803 781 804 @WITH_LIBFIBRE_TRUE@ctxswitch-kos_fibre2$(EXEEXT): 782 @WITH_LIBFIBRE_TRUE@ $( AM_V_CXX)$(CXXCOMPILE) -DBENCH_N=50000000 $(srcdir)/ctxswitch/kos_fibre2.cpp -I$(LIBFIBRE_DIR) -lfibre805 @WITH_LIBFIBRE_TRUE@ $(BENCH_V_CXX)$(CXXCOMPILE) -DBENCH_N=50000000 $(srcdir)/ctxswitch/kos_fibre2.cpp -I$(LIBFIBRE_DIR) -lfibre 783 806 784 807 ctxswitch$(EXEEXT): $(CTXSWITCH_DEPEND) 785 808 786 809 ctxswitch-pthread$(EXEEXT): 787 $( AM_V_CC)$(COMPILE) -DBENCH_N=50000000 $(srcdir)/ctxswitch/pthreads.c810 $(BENCH_V_CC)$(COMPILE) -DBENCH_N=50000000 $(srcdir)/ctxswitch/pthreads.c 788 811 789 812 ctxswitch-cfa_coroutine$(EXEEXT): 790 $( AM_V_CFA)$(CFACOMPILE) -DBENCH_N=50000000 $(srcdir)/ctxswitch/cfa_cor.c813 $(BENCH_V_CFA)$(CFACOMPILE) -DBENCH_N=50000000 $(srcdir)/ctxswitch/cfa_cor.cfa 791 814 792 815 ctxswitch-cfa_thread$(EXEEXT): 793 $( AM_V_CFA)$(CFACOMPILE) -DBENCH_N=50000000 $(srcdir)/ctxswitch/cfa_thrd.c816 $(BENCH_V_CFA)$(CFACOMPILE) -DBENCH_N=50000000 $(srcdir)/ctxswitch/cfa_thrd.cfa 794 817 795 818 ctxswitch-cfa_thread2$(EXEEXT): 796 $( AM_V_CFA)$(CFACOMPILE) -DBENCH_N=50000000 $(srcdir)/ctxswitch/cfa_thrd2.c819 $(BENCH_V_CFA)$(CFACOMPILE) -DBENCH_N=50000000 $(srcdir)/ctxswitch/cfa_thrd2.cfa 797 820 798 821 ctxswitch-upp_coroutine$(EXEEXT): 799 $( AM_V_UPP)$(UPPCOMPILE) -DBENCH_N=50000000 $(srcdir)/ctxswitch/upp_cor.cc822 $(BENCH_V_UPP)$(UPPCOMPILE) -DBENCH_N=50000000 $(srcdir)/ctxswitch/upp_cor.cc 800 823 801 824 ctxswitch-upp_thread$(EXEEXT): 802 $( AM_V_UPP)$(UPPCOMPILE) -DBENCH_N=50000000 $(srcdir)/ctxswitch/upp_thrd.cc825 $(BENCH_V_UPP)$(UPPCOMPILE) -DBENCH_N=50000000 $(srcdir)/ctxswitch/upp_thrd.cc 803 826 804 827 ctxswitch-goroutine$(EXEEXT): 805 $( AM_V_GOC)go build -o a.out $(srcdir)/ctxswitch/goroutine.go828 $(BENCH_V_GOC)go build -o a.out $(srcdir)/ctxswitch/goroutine.go 806 829 807 830 ctxswitch-java_thread$(EXEEXT): 808 $( AM_V_JAVAC)javac -d $(builddir) $(srcdir)/ctxswitch/JavaThread.java831 $(BENCH_V_JAVAC)javac -d $(builddir) $(srcdir)/ctxswitch/JavaThread.java 809 832 @echo "#!/bin/sh" > a.out 810 833 @echo "java JavaThread" >> a.out … … 823 846 824 847 mutex-pthread_lock$(EXEEXT): 825 $( AM_V_CC)$(COMPILE) -DBENCH_N=50000000 $(srcdir)/mutex/pthreads.c848 $(BENCH_V_CC)$(COMPILE) -DBENCH_N=50000000 $(srcdir)/mutex/pthreads.c 826 849 827 850 mutex-upp$(EXEEXT): 828 $( AM_V_UPP)$(UPPCOMPILE) -DBENCH_N=50000000 $(srcdir)/mutex/upp.cc851 $(BENCH_V_UPP)$(UPPCOMPILE) -DBENCH_N=50000000 $(srcdir)/mutex/upp.cc 829 852 830 853 mutex-cfa1$(EXEEXT): 831 $( AM_V_CFA)$(CFACOMPILE) -DBENCH_N=5000000 $(srcdir)/mutex/cfa1.c854 $(BENCH_V_CFA)$(CFACOMPILE) -DBENCH_N=5000000 $(srcdir)/mutex/cfa1.cfa 832 855 833 856 mutex-cfa2$(EXEEXT): 834 $( AM_V_CFA)$(CFACOMPILE) -DBENCH_N=5000000 $(srcdir)/mutex/cfa2.c857 $(BENCH_V_CFA)$(CFACOMPILE) -DBENCH_N=5000000 $(srcdir)/mutex/cfa2.cfa 835 858 836 859 mutex-cfa4$(EXEEXT): 837 $( AM_V_CFA)$(CFACOMPILE) -DBENCH_N=5000000 $(srcdir)/mutex/cfa4.c860 $(BENCH_V_CFA)$(CFACOMPILE) -DBENCH_N=5000000 $(srcdir)/mutex/cfa4.cfa 838 861 839 862 mutex-java_thread$(EXEEXT): 840 $( AM_V_JAVAC)javac -d $(builddir) $(srcdir)/mutex/JavaThread.java863 $(BENCH_V_JAVAC)javac -d $(builddir) $(srcdir)/mutex/JavaThread.java 841 864 @echo "#!/bin/sh" > a.out 842 865 @echo "java JavaThread" >> a.out … … 852 875 853 876 signal-pthread_cond$(EXEEXT): 854 $( AM_V_CC)$(COMPILE) -DBENCH_N=500000 $(srcdir)/schedint/pthreads.c877 $(BENCH_V_CC)$(COMPILE) -DBENCH_N=500000 $(srcdir)/schedint/pthreads.c 855 878 856 879 signal-upp$(EXEEXT): 857 $( AM_V_UPP)$(UPPCOMPILE) -DBENCH_N=5000000 $(srcdir)/schedint/upp.cc880 $(BENCH_V_UPP)$(UPPCOMPILE) -DBENCH_N=5000000 $(srcdir)/schedint/upp.cc 858 881 859 882 signal-cfa1$(EXEEXT): 860 $( AM_V_CFA)$(CFACOMPILE) -DBENCH_N=500000 $(srcdir)/schedint/cfa1.c883 $(BENCH_V_CFA)$(CFACOMPILE) -DBENCH_N=500000 $(srcdir)/schedint/cfa1.cfa 861 884 862 885 signal-cfa2$(EXEEXT): 863 $( AM_V_CFA)$(CFACOMPILE) -DBENCH_N=500000 $(srcdir)/schedint/cfa2.c886 $(BENCH_V_CFA)$(CFACOMPILE) -DBENCH_N=500000 $(srcdir)/schedint/cfa2.cfa 864 887 865 888 signal-cfa4$(EXEEXT): 866 $( AM_V_CFA)$(CFACOMPILE) -DBENCH_N=500000 $(srcdir)/schedint/cfa4.c889 $(BENCH_V_CFA)$(CFACOMPILE) -DBENCH_N=500000 $(srcdir)/schedint/cfa4.cfa 867 890 868 891 signal-java_thread$(EXEEXT): 869 $( AM_V_JAVAC)javac -d $(builddir) $(srcdir)/schedint/JavaThread.java892 $(BENCH_V_JAVAC)javac -d $(builddir) $(srcdir)/schedint/JavaThread.java 870 893 @echo "#!/bin/sh" > a.out 871 894 @echo "java JavaThread" >> a.out … … 879 902 880 903 waitfor-upp$(EXEEXT): 881 $( AM_V_UPP)$(UPPCOMPILE) -DBENCH_N=5000000 $(srcdir)/schedext/upp.cc904 $(BENCH_V_UPP)$(UPPCOMPILE) -DBENCH_N=5000000 $(srcdir)/schedext/upp.cc 882 905 883 906 waitfor-cfa1$(EXEEXT): 884 $( AM_V_CFA)$(CFACOMPILE) -DBENCH_N=500000 $(srcdir)/schedext/cfa1.c907 $(BENCH_V_CFA)$(CFACOMPILE) -DBENCH_N=500000 $(srcdir)/schedext/cfa1.cfa 885 908 886 909 waitfor-cfa2$(EXEEXT): 887 $( AM_V_CFA)$(CFACOMPILE) -DBENCH_N=500000 $(srcdir)/schedext/cfa2.c910 $(BENCH_V_CFA)$(CFACOMPILE) -DBENCH_N=500000 $(srcdir)/schedext/cfa2.cfa 888 911 889 912 waitfor-cfa4$(EXEEXT): 890 $( AM_V_CFA)$(CFACOMPILE) -DBENCH_N=500000 $(srcdir)/schedext/cfa4.c913 $(BENCH_V_CFA)$(CFACOMPILE) -DBENCH_N=500000 $(srcdir)/schedext/cfa4.cfa 891 914 892 915 creation$(EXEEXT) :\ … … 901 924 902 925 creation-cfa_coroutine$(EXEEXT): 903 $( AM_V_CFA)$(CFACOMPILE) -DBENCH_N=10000000 $(srcdir)/creation/cfa_cor.c926 $(BENCH_V_CFA)$(CFACOMPILE) -DBENCH_N=10000000 $(srcdir)/creation/cfa_cor.cfa 904 927 905 928 creation-cfa_coroutine_eager$(EXEEXT): 906 $( AM_V_CFA)$(CFACOMPILE) -DBENCH_N=10000000 $(srcdir)/creation/cfa_cor.c929 $(BENCH_V_CFA)$(CFACOMPILE) -DBENCH_N=10000000 $(srcdir)/creation/cfa_cor.cfa -DEAGER 907 930 908 931 creation-cfa_thread$(EXEEXT): 909 $( AM_V_CFA)$(CFACOMPILE) -DBENCH_N=10000000 $(srcdir)/creation/cfa_thrd.c932 $(BENCH_V_CFA)$(CFACOMPILE) -DBENCH_N=10000000 $(srcdir)/creation/cfa_thrd.cfa 910 933 911 934 creation-upp_coroutine$(EXEEXT): 912 $( AM_V_UPP)$(UPPCOMPILE) -DBENCH_N=50000000 $(srcdir)/creation/upp_cor.cc935 $(BENCH_V_UPP)$(UPPCOMPILE) -DBENCH_N=50000000 $(srcdir)/creation/upp_cor.cc 913 936 914 937 creation-upp_thread$(EXEEXT): 915 $( AM_V_UPP)$(UPPCOMPILE) -DBENCH_N=50000000 $(srcdir)/creation/upp_thrd.cc938 $(BENCH_V_UPP)$(UPPCOMPILE) -DBENCH_N=50000000 $(srcdir)/creation/upp_thrd.cc 916 939 917 940 creation-pthread$(EXEEXT): 918 $( AM_V_CC)$(COMPILE) -DBENCH_N=250000 $(srcdir)/creation/pthreads.c941 $(BENCH_V_CC)$(COMPILE) -DBENCH_N=250000 $(srcdir)/creation/pthreads.c 919 942 920 943 creation-goroutine$(EXEEXT): 921 $( AM_V_GOC)go build -o a.out $(srcdir)/creation/goroutine.go944 $(BENCH_V_GOC)go build -o a.out $(srcdir)/creation/goroutine.go 922 945 923 946 creation-java_thread$(EXEEXT): 924 $( AM_V_JAVAC)javac -d $(builddir) $(srcdir)/creation/JavaThread.java947 $(BENCH_V_JAVAC)javac -d $(builddir) $(srcdir)/creation/JavaThread.java 925 948 @echo "#!/bin/sh" > a.out 926 949 @echo "java JavaThread" >> a.out … … 938 961 939 962 compile-array$(EXEEXT): 940 $(AM_V_CFA)$(CFACOMPILE) -fsyntax-only -w $(testdir)/array.c963 @$(CFACOMPILE) -fsyntax-only -w $(testdir)/array.cfa 941 964 942 965 compile-attributes$(EXEEXT): 943 $(AM_V_CFA)$(CFACOMPILE) -fsyntax-only -w $(testdir)/attributes.cfa966 @$(CFACOMPILE) -fsyntax-only -w $(testdir)/attributes.cfa 944 967 945 968 compile-empty$(EXEEXT): 946 $(AM_V_CFA)$(CFACOMPILE) -fsyntax-only -w $(srcdir)/compile/empty.c969 @$(CFACOMPILE) -fsyntax-only -w $(srcdir)/compile/empty.cfa 947 970 948 971 compile-expression$(EXEEXT): 949 $(AM_V_CFA)$(CFACOMPILE) -fsyntax-only -w $(testdir)/expression.c972 @$(CFACOMPILE) -fsyntax-only -w $(testdir)/expression.cfa 950 973 951 974 compile-io$(EXEEXT): 952 $(AM_V_CFA)$(CFACOMPILE) -fsyntax-only -w $(testdir)/io1.c975 @$(CFACOMPILE) -fsyntax-only -w $(testdir)/io1.cfa 953 976 954 977 compile-monitor$(EXEEXT): 955 $(AM_V_CFA)$(CFACOMPILE) -fsyntax-only -w $(testdir)/concurrent/monitor.c978 @$(CFACOMPILE) -fsyntax-only -w $(testdir)/concurrent/monitor.cfa 956 979 957 980 compile-operators$(EXEEXT): 958 $(AM_V_CFA)$(CFACOMPILE) -fsyntax-only -w $(testdir)/operators.c981 @$(CFACOMPILE) -fsyntax-only -w $(testdir)/operators.cfa 959 982 960 983 compile-thread$(EXEEXT): 961 $(AM_V_CFA)$(CFACOMPILE) -fsyntax-only -w $(testdir)/concurrent/thread.c984 @$(CFACOMPILE) -fsyntax-only -w $(testdir)/concurrent/thread.cfa 962 985 963 986 compile-typeof$(EXEEXT): 964 $(AM_V_CFA)$(CFACOMPILE) -fsyntax-only -w $(testdir)/typeof.c987 @$(CFACOMPILE) -fsyntax-only -w $(testdir)/typeof.cfa 965 988 966 989 # Tell versions [3.59,3.63) of GNU make to not export all variables. -
configure
r9d9a451 r53bb8f1 637 637 LIBOBJS 638 638 CFA_BACKEND_CC 639 ALLOCA640 639 WITH_LIBFIBRE_FALSE 641 640 WITH_LIBFIBRE_TRUE … … 1961 1960 } # ac_fn_cxx_try_link 1962 1961 1963 # ac_fn_c_check_type LINENO TYPE VAR INCLUDES1964 # -------------------------------------------1965 # Tests whether TYPE exists after having included INCLUDES, setting cache1966 # variable VAR accordingly.1967 ac_fn_c_check_type ()1968 {1969 as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack1970 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&51971 $as_echo_n "checking for $2... " >&6; }1972 if eval \${$3+:} false; then :1973 $as_echo_n "(cached) " >&61974 else1975 eval "$3=no"1976 cat confdefs.h - <<_ACEOF >conftest.$ac_ext1977 /* end confdefs.h. */1978 $41979 int1980 main ()1981 {1982 if (sizeof ($2))1983 return 0;1984 ;1985 return 0;1986 }1987 _ACEOF1988 if ac_fn_c_try_compile "$LINENO"; then :1989 cat confdefs.h - <<_ACEOF >conftest.$ac_ext1990 /* end confdefs.h. */1991 $41992 int1993 main ()1994 {1995 if (sizeof (($2)))1996 return 0;1997 ;1998 return 0;1999 }2000 _ACEOF2001 if ac_fn_c_try_compile "$LINENO"; then :2002 2003 else2004 eval "$3=yes"2005 fi2006 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext2007 fi2008 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext2009 fi2010 eval ac_res=\$$32011 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&52012 $as_echo "$ac_res" >&6; }2013 eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno2014 2015 } # ac_fn_c_check_type2016 2017 1962 # ac_fn_c_check_header_mongrel LINENO HEADER VAR INCLUDES 2018 1963 # ------------------------------------------------------- … … 2106 2051 } # ac_fn_c_check_header_mongrel 2107 2052 2108 # ac_fn_c_ find_intX_t LINENO BITS VAR2109 # ----------------------------------- 2110 # Finds a signed integer type with width BITS, setting cache variable VAR2111 # accordingly.2112 ac_fn_c_ find_intX_t()2053 # ac_fn_c_check_type LINENO TYPE VAR INCLUDES 2054 # ------------------------------------------- 2055 # Tests whether TYPE exists after having included INCLUDES, setting cache 2056 # variable VAR accordingly. 2057 ac_fn_c_check_type () 2113 2058 { 2114 2059 as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack 2115 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for int$2_t" >&52116 $as_echo_n "checking for int$2_t... " >&6; }2060 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 2061 $as_echo_n "checking for $2... " >&6; } 2117 2062 if eval \${$3+:} false; then : 2118 2063 $as_echo_n "(cached) " >&6 2119 2064 else 2120 2065 eval "$3=no" 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 2066 cat confdefs.h - <<_ACEOF >conftest.$ac_ext 2126 2067 /* end confdefs.h. */ 2127 $ac_includes_default 2128 enum { N = $2 / 2 - 1 }; 2068 $4 2129 2069 int 2130 2070 main () 2131 2071 { 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 2072 if (sizeof ($2)) 2073 return 0; 2136 2074 ; 2137 2075 return 0; … … 2141 2079 cat confdefs.h - <<_ACEOF >conftest.$ac_ext 2142 2080 /* end confdefs.h. */ 2143 $ac_includes_default 2144 enum { N = $2 / 2 - 1 }; 2081 $4 2145 2082 int 2146 2083 main () 2147 2084 { 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 2085 if (sizeof (($2))) 2086 return 0; 2153 2087 ; 2154 2088 return 0; … … 2158 2092 2159 2093 else 2160 case $ac_type in #( 2161 int$2_t) : 2162 eval "$3=yes" ;; #( 2163 *) : 2164 eval "$3=\$ac_type" ;; 2165 esac 2094 eval "$3=yes" 2166 2095 fi 2167 2096 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext 2168 2097 fi 2169 2098 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext 2170 if eval test \"x\$"$3"\" = x"no"; then :2171 2172 else2173 break2174 fi2175 done2176 2099 fi 2177 2100 eval ac_res=\$$3 … … 2180 2103 eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno 2181 2104 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 2105 } # ac_fn_c_check_type 2237 2106 cat >config.log <<_ACEOF 2238 2107 This file contains any messages produced by compilers while … … 2667 2536 2668 2537 2538 # http://git.savannah.gnu.org/gitweb/?p=autoconf-archive.git;a=blob_plain;f=m4/ax_check_compile_flag.m4 2539 2669 2540 2670 2541 # don't use the default CFLAGS as they unconditonnaly add -O2 … … 5183 5054 5184 5055 5185 # deprecated5186 5056 # These are often not installed and people miss seeing the "no", so stop the configure. 5187 5057 for ac_prog in 'bison -y' byacc … … 16734 16604 16735 16605 16736 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ${MAKE-make} sets \$(MAKE)" >&516737 $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) " >&616742 else16743 cat >conftest.make <<\_ACEOF16744 SHELL = /bin/sh16745 all:16746 @echo '@@@%%%=$(MAKE)=@@@%%%'16747 _ACEOF16748 # GNU make sometimes prints "make[1]: Entering ...", which would confuse us.16749 case `${MAKE-make} -f conftest.make 2>/dev/null` in16750 *@@@%%%=?*=@@@%%%*)16751 eval ac_cv_prog_make_${ac_make}_set=yes;;16752 *)16753 eval ac_cv_prog_make_${ac_make}_set=no;;16754 esac16755 rm -f conftest.make16756 fi16757 if eval test \$ac_cv_prog_make_${ac_make}_set = yes; then16758 { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&516759 $as_echo "yes" >&6; }16760 SET_MAKE=16761 else16762 { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&516763 $as_echo "no" >&6; }16764 SET_MAKE="MAKE=${MAKE-make}"16765 fi16766 16767 16606 16768 16607 # Checks for libraries. … … 16819 16658 16820 16659 # Checks for header files. 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 16660 for ac_header in libintl.h malloc.h unistd.h 17019 16661 do : 17020 16662 as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` … … 17025 16667 _ACEOF 17026 16668 16669 else 16670 echo "Error: Missing required header"; exit 1 17027 16671 fi 17028 16672 … … 17031 16675 17032 16676 # Checks for typedefs, structures, and compiler characteristics. 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 : 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 : 17036 16695 $as_echo_n "(cached) " >&6 17037 16696 else 17038 cat confdefs.h - <<_ACEOF >conftest.$ac_ext 16697 16698 m4cfa_check_save_flags=$CFLAGS 16699 CFLAGS="$CFLAGS -Wcast-function-type" 16700 cat confdefs.h - <<_ACEOF >conftest.$ac_ext 17039 16701 /* end confdefs.h. */ 17040 17041 #include <stdbool.h>17042 #ifndef bool17043 "error: bool is not defined"17044 #endif17045 #ifndef false17046 "error: false is not defined"17047 #endif17048 #if false17049 "error: false is not 0"17050 #endif17051 #ifndef true17052 "error: true is not defined"17053 #endif17054 #if true != 117055 "error: true is not 1"17056 #endif17057 #ifndef __bool_true_false_are_defined17058 "error: __bool_true_false_are_defined is not defined"17059 #endif17060 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 for17074 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. See17079 http://gcc.gnu.org/ml/gcc-patches/2003-12/msg02303.html17080 http://lists.gnu.org/archive/html/bug-coreutils/2005-11/msg00161.html17081 */17082 _Bool q = true;17083 _Bool *pq = &q;17084 16702 17085 16703 int 17086 16704 main () 17087 16705 { 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 + !!l17094 + !m + !n + !o + !p + !q + !pq);17095 16706 17096 16707 ; … … 17099 16710 _ACEOF 17100 16711 if ac_fn_c_try_compile "$LINENO"; then : 17101 ac_cv_header_stdbool_h=yes17102 else 17103 ac_cv_header_stdbool_h=no16712 m4cfa_cv_check_cflags___Wcast_function_type=yes 16713 else 16714 m4cfa_cv_check_cflags___Wcast_function_type=no 17104 16715 fi 17105 16716 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext 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 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 17311 16728 17312 16729 -
configure.ac
r9d9a451 r53bb8f1 178 178 AC_PROG_CC 179 179 AM_PROG_AS 180 AM_PROG_CC_C_O # deprecated181 180 # These are often not installed and people miss seeing the "no", so stop the configure. 182 181 AC_PROG_YACC … … 186 185 AC_PROG_LIBTOOL 187 186 AC_PROG_INSTALL 188 AC_PROG_MAKE_SET189 187 190 188 # Checks for libraries. … … 193 191 194 192 # Checks for header files. 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]) 193 AC_CHECK_HEADERS([libintl.h malloc.h unistd.h], [], [echo "Error: Missing required header"; exit 1]) 197 194 198 195 # Checks for typedefs, structures, and compiler characteristics. 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]) 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.])) 212 200 213 201 #============================================================================== -
doc/LaTeXmacros/lstlang.sty
r9d9a451 r53bb8f1 8 8 %% Created On : Sat May 13 16:34:42 2017 9 9 %% Last Modified By : Peter A. Buhr 10 %% Last Modified On : Fri Apr 6 23:44:50 201811 %% Update Count : 2 010 %% Last Modified On : Tue Jan 8 14:40:33 2019 11 %% Update Count : 21 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, __extension__, exception, fallthrough, fallthru, finally,116 coroutine, disable, dtype, enable, exception, __extension__, 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
r9d9a451 r53bb8f1 330 330 contributer = {pabuhr@plg}, 331 331 author = {Nissim Francez}, 332 title = {Another Advantage of Key 332 title = {Another Advantage of Keyword 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 optnote = {Accessed: 2016-09}, 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}}, 835 844 } 836 845 … … 939 948 author = {{\textsf{C}{$\mathbf{\forall}$} Features}}, 940 949 howpublished= {\href{https://plg.uwaterloo.ca/~cforall/features}{https://\-plg.uwaterloo.ca/\-$\sim$cforall/\-features}}, 941 optnote = {Accessed: 2018-01-01},942 950 } 943 951 … … 959 967 year = 2018, 960 968 howpublished= {\href{https://cforall.uwaterloo.ca/CFAStackEvaluation.zip}{https://cforall.uwaterloo.ca/\-CFAStackEvaluation.zip}}, 961 optnote = {[Accessed May 2018]},962 969 } 963 970 … … 1134 1141 } 1135 1142 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}, 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)} 1141 1149 year = {2018}, 1142 1150 month = {September}, 1151 pages = {53-60}, 1143 1152 publisher = {IEEE}, 1144 1153 url = {https://www.microsoft.com/en-us/research/publication/checkedc-making-c-safe-by-extension/}, 1145 pages = {53-60},1146 1154 } 1147 1155 … … 1314 1322 journal = sigplan, 1315 1323 year = 1986, 1316 month = oct, volume = 21, number = 10, pages = {19-28}, 1324 month = oct, 1325 volume = 21, 1326 number = 10, 1327 pages = {19-28}, 1317 1328 note = {Object Oriented Programming Workshop} 1318 1329 } … … 1479 1490 title = {concurrent-locking}, 1480 1491 howpublished= {\href{https://github.com/pabuhr/concurrent-locking}{https://\-github.com/\-pabuhr/\-concurrent-locking}}, 1481 optnote = {[Accessed April 2017]},1482 1492 } 1483 1493 … … 1767 1777 howpublished= {\href{https://www.airs.com/blog/archives/428} 1768 1778 {https://www.airs.com/\-blog/\-archives/\-428}}, 1769 optnote = {Accessed: 2018-05},1770 1779 } 1771 1780 … … 2956 2965 year = 2014, 2957 2966 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},2959 2967 } 2960 2968 … … 3040 3048 } 3041 3049 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 3042 3060 @inproceedings{F-bound, 3043 3061 keywords = {}, … … 3087 3105 } 3088 3106 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 3089 3117 @manual{Fortran95, 3090 3118 keywords = {Fortran 95}, … … 3107 3135 address = {\href{https://www.iso.org/standard/50459.html}{https://\-www.iso.org/\-standard/\-50459.html}}, 3108 3136 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, 3109 3148 } 3110 3149 … … 3356 3395 year = 2014, 3357 3396 howpublished= {https://developer.gnome.org/gobject/stable/}, 3358 optnote = {Accessed: 2017-04},3359 3397 } 3360 3398 … … 3671 3709 year = {1964}, 3672 3710 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}}, 3673 3723 } 3674 3724 … … 3998 4048 year = 2015, 3999 4049 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, 4000 4071 } 4001 4072 … … 4179 4250 } 4180 4251 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 4181 4263 @book{Weissman67, 4182 4264 keywords = {lisp}, … … 4224 4306 pages = {161-169}, 4225 4307 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, 4226 4317 } 4227 4318 … … 4566 4657 } 4567 4658 % 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 } 4568 4673 4569 4674 @manual{MPI, … … 4992 5097 year = 2014, 4993 5098 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}4995 5099 } 4996 5100 … … 5002 5106 year = 2015, 5003 5107 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}5005 5108 } 5006 5109 … … 5515 5618 year = 2012, 5516 5619 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}5518 5620 } 5519 5621 … … 5839 5941 address = {\href{https://www.iso.org/standard/64029.html}{https://\-www.iso.org/\-standard/\-64029.html}}, 5840 5942 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, 5841 5954 } 5842 5955 … … 5992 6105 institution = {Carnegie Mellon University}, 5993 6106 year = 1991, 5994 month = feb, number = "CMU-CS-91-106", 6107 month = feb, 6108 number = {CMU-CS-91-106}, 5995 6109 annote = { 5996 6110 Discusses a typed lambda calculus with … … 6049 6163 journal = sigplan, 6050 6164 year = 1988, 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}, 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}, 6054 6170 abstract = { 6055 6171 This paper deals with the integration of an efficient asynchronous … … 6101 6217 } 6102 6218 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 6103 6230 @manual{Python, 6104 6231 keywords = {Python}, 6105 6232 contributer = {pabuhr@plg}, 6106 title = {Python Reference Manual, Release 2.5},6107 author = {Guido van Rossum},6233 author = {Python}, 6234 title = {Python Language Reference, Release 3.7.2}, 6108 6235 organization= {Python Software Foundation}, 6109 month = sep, 6110 year = 2006, 6111 note = {Fred L. Drake, Jr., editor}, 6236 address = {\href{https://docs.python.org/3/reference/index.html}{https://\-docs.python.org/\-3/\-reference/\-index.html}}, 6237 year = 2018, 6112 6238 } 6113 6239 6114 6240 % 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 } 6115 6252 6116 6253 @article{Grossman06, … … 6149 6286 } 6150 6287 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 6151 6298 % R 6152 6299 … … 6262 6409 number = 10, 6263 6410 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}, 6264 6422 } 6265 6423 … … 6400 6558 } 6401 6559 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 6402 6570 % S 6403 6571 … … 7190 7358 author = {{TIOBE Index}}, 7191 7359 howpublished= {\href{http://www.tiobe.com/tiobe_index}{http://\-www.tiobe.com/\-tiobe\_index}}, 7192 optnote = {Accessed: 2018-09}, 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)}}, 7193 7368 } 7194 7369 … … 7522 7697 year = 2017, 7523 7698 howpublished= {\url{https://wiki.gnome.org/Projects/Vala/Manual}}, 7524 optnote = {Accessed: 2017-04}7525 7699 } 7526 7700 … … 7696 7870 % Y 7697 7871 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 7698 7887 % Z 7699 7888 -
doc/papers/concurrency/Paper.tex
r9d9a451 r53bb8f1 228 228 } 229 229 230 \title{\texorpdfstring{ Concurrency in \protect\CFA}{Concurrencyin Cforall}}230 \title{\texorpdfstring{Advanced Control-flow in \protect\CFA}{Advanced Control-flow in Cforall}} 231 231 232 232 \author[1]{Thierry Delisle} … … 241 241 242 242 \abstract[Summary]{ 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}. 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. 249 248 All features respect the expectations of C programmers, while being fully integrate with the \CFA polymorphic type-system and other language features. 250 249 Experimental results show comparable performance of the new features with similar mechanisms in other concurrent programming-languages. 251 250 }% 252 251 253 \keywords{co ncurrency, parallelism, coroutines, threads, monitors, runtime, C, Cforall}252 \keywords{coroutines, concurrency, parallelism, threads, monitors, runtime, C, \CFA (Cforall)} 254 253 255 254 … … 262 261 \section{Introduction} 263 262 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 \item 315 allowing multiple monitors to be safely acquired \emph{simultaneously} (deadlock free), while seamlessly integrating this capability with all monitor synchronization mechanisms. 316 \item 317 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 \item 319 experimental results show comparable performance of the new features with similar mechanisms in other concurrent programming-languages. 320 \end{itemize} 321 322 \begin{comment} 264 323 This paper provides a minimal concurrency \newterm{Application Program Interface} (API) that is simple, efficient and can be used to build other concurrency features. 265 324 While the simplest concurrency system is a thread and a lock, this low-level approach is hard to master. … … 281 340 The proposed concurrency API is implemented in a dialect of C, called \CFA (pronounced C-for-all). 282 341 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. 283 284 342 \end{comment} 343 344 345 \begin{comment} 285 346 \section{\CFA Overview} 286 347 … … 551 612 \end{cfa} 552 613 where the return type supplies the type/size of the allocation, which is impossible in most type systems. 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). 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). 595 620 Coroutines are generalized routines allowing execution to be temporarily suspended and later resumed. 596 621 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. … … 1060 1085 \end{cquote} 1061 1086 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. 1062 1124 1063 1125 -
doc/papers/concurrency/mail
r9d9a451 r53bb8f1 27 27 28 28 Software: Practice and Experience Editorial Office 29 30 31 32 Date: Wed, 3 Oct 2018 21:25:28 +0000 33 From: Richard Jones <onbehalfof@manuscriptcentral.com> 34 Reply-To: R.E.Jones@kent.ac.uk 35 To: tdelisle@uwaterloo.ca, pabuhr@uwaterloo.ca 36 Subject: Software: Practice and Experience - Decision on Manuscript ID 37 SPE-18-0205 38 39 03-Oct-2018 40 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 Jones 53 Editor, Software: Practice and Experience 54 R.E.Jones@kent.ac.uk 55 56 Referee(s)' Comments to Author: 57 58 Reviewing: 1 59 60 Comments to the Author 61 "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: 2 89 90 Comments to the Author 91 This article presents the design and rationale behind the concurrency 92 features of C-forall, a new low-level programming language. After an 93 introduction that defines a selection of standard terminology, section 94 2 gives crucial background on the design of the C-forall language. 95 Section 3 then starts the core of the article, discussing the 96 language's support for "concurrency" which in this case means 97 coroutines and threads; a very brief Section 4 builds on section 3 98 with a discussion of lower level synchronizations. Section 5 the 99 presents the main features of concurrency control in C-forall: 100 monitors and mutexes. Section 6 then extends monitors with condition 101 variables to to support scheduling, and a very brief section 7 102 discusses preemption and pooling. Section 8 discusses the runtime 103 conceptual model, section 9 gives implementation detail, and section 104 10 briefly evaluates C-forall's performance via five concurrent 105 micro benchmarks. Finally section 11 concludes the article, and then 106 section 12 presents some future work. 107 108 109 At the start of section 7, article lays out its rationale: that while 110 "historically, computer performance was about processor speeds" but 111 "Now, high-performance applications must care about parallelism, 112 which requires concurrency". The doomsayers trumpeting the death of 113 Moore's law have been proved correct at last, with CPUs sequential 114 performance increasing much more slowly than the number of cores 115 within each die. This means programmers --- especially low-level, 116 systems programmers --- must somehow manage the essential complexity 117 of writing concurrent programs to run in parallel in multiple threads 118 across multiple cores. Unfortunately, the most venerable widely used 119 systems programming language, C, supports parallelism only via an 120 e.g. the threads library. This article aims to integrate concurrent 121 programming mechanisms more closely into a novel low-level C-based 122 programming language, C-forall. The article gives an outline of much of 123 C-forall, presents a series of concurrency mechanisms, and finally 124 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 the 128 best summary of the problem the design of concurrent C-forall sets 129 out to solve is buried more than halfway through the article in section 130 7, as above, and then the best overview of the proposed solution is 131 given in the 2nd, 4th and 5th sentence of the conclusion: 132 133 "The approach provides concurrency based on a preemptive M:N 134 user-level threading-system, executing in clusters, which 135 encapsulate scheduling of work on multiple kernel threads 136 providing parallelism... High-level objects (monitor/task) are the 137 core mechanism for mutual exclusion and synchronization. A novel 138 aspect is allowing multiple mutex-objects to be accessed 139 simultaneously reducing the potential for deadlock for this 140 complex scenario." 141 142 That is, in my reading of the article, it proceeds bottom up rather 143 than top down, and so my main recommendation is to essentially reverse 144 the order of the article, proceeding from the problem to be solved, 145 the high level architecture of the proposed solutions, and then going 146 down to the low-level mechanisms. My biggest problem reading the 147 article was for explanations of why a particular decision was taken, 148 or why a particular mechanism may be used --- often this description 149 is actually later in the article, but at that point it's too late for 150 the reader. I have tried to point out most of these places in the 151 detailed comments below. 152 153 My second concern is that the article makes several claims that are 154 not really justified by the design or implementation in the article. 155 These include claims that this approach meets the expectations of C 156 programmers, is minimal, is implemented in itself, etc. The article 157 doesn't generally offer evidence to support these assertions (for many 158 of them, that would require empirical studies of programmers, or at 159 least corpus studies). The solution here is to talk about motivations 160 for the design choices "we made these decisions hoping that C 161 programmers would be comfortable" rather than claims of fact "C 162 programmers are comfortable". Again I attempt to point these out below. 163 164 * abstract: needs to characterize the work top down, and not make 165 claims "features respect the expectations of C programmers" that 166 are not supported empirically. 167 168 * p1 line 14 "integrated" 169 170 * introduction needs to introduce the big ideas and scope of the 171 article, not define terms. Some of the terms / distinctions are 172 non-standard (e.g. the distinction between "concurrency" and 173 "parallelism") and can be avoided by using more specific terms 174 (mutual exclusion, synchronization, parallel execution. etc). 175 176 * to me this article introduces novel language features, not just an 177 API. Similarly, it doesn't talk about any additions "to the 178 language translator" - i.e compiler changes! - rather about language 179 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 a 184 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 why 187 not. 188 189 * 2.2 calling it a "with statement" was confusing, given that a with 190 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 not 197 so much. 198 199 * 2.5 and many places elsewhere. Always first describe the semantics 200 of your language constructs, then describe their properties, then 201 compare with e.g. related languages (mostly C++ & Java?). E.g in 202 this case, something like: 203 204 "C-forall includes constructors, which are called to initialize 205 newly allocated objects, and constructors, which are called when 206 objects are deallocated. Constructors and destructors are written as 207 functions returning void, under the special names "?{}" for 208 constructors and "^{}" for destructors: constructors may be 209 overridden, but destructors may not be. The semantics of C-forall's 210 constructors and destructors are essentially those of C++." 211 212 this problem repeats many times throughout the article and should be 213 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 generics 218 etc. 219 220 * why special case forward declarations? It's not 1970 any more. 221 222 * what are traits? structural interfaces (like Go interfaces) or 223 nominal bindings? 224 225 * section 3 - lines 2-30, also making very specific global definitions 226 as in the introduction. The article does not need to take on this 227 fight either, rather make clear that this is the conceptual model in 228 C-forall. (If the article starts at the top and works down, that may 229 well follow anyway). 230 231 * "in modern programming languages... unacceptable"; "in a 232 system-level language.. concurrent programs should be written with 233 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 support 237 coroutines, threads, fibres, etc 238 239 * FIG 2B - where's the output? 240 syntax "sout | next(f1) | next(f2) | endl" nowhere explained 241 why not use C++s' << and >> 242 243 * FIG 3 be clearer, earlier about the coroutine" constructor syntax 244 245 ** ensure all figures are placed *after* their first mention in the 246 text. consider interleaving smaller snippets of text rather than 247 just referring to large figures 248 249 * sec 3.1 p7 etc,. need more context / comparison e.g. Python 250 generators etc. 251 252 * FIGURE 4 is this right? should there a constructor for Cons taking 253 a Prod? 254 255 256 * sec 3.2 order of constructors depends on the language. more 257 generally, if the article is going to make arguments against OO 258 (e.g. section 2) then the article needs to explain, in detail, why 259 e.g. coroutine, thread, etc *cannot* be classes / objects. 260 261 * "type coroutine_t must be an abstract handle.. descriptor and is 262 stack are non-copyable" - too many assumptions in here (and other 263 similar passages) that are not really spelled out in detail. 264 265 * p10 line 4 introduces "coroutine" keyword. needs to give its 266 semantics. also needs to introduce and define properties and compare 267 before all the examples using coroutines. 268 269 * p10 again, trait semantics need to be better defined 270 271 * 3.3 should be an introduction to this section. Note that section 272 titles are not part of the text of the article. 273 274 * what's the difference between "coroutines" and "user threads" (and 275 "fibres?") 276 277 * what's a "task type" or an "interface routine" or "underlying 278 thread" 279 280 * section 4 - "... meaningless". nope some semantics are possible 281 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 order 287 288 * 4.1 p12 13-25, again it's not clear where this is going. presenting the model 289 top down may hopefully resolve this 290 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 to 298 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 the 305 difference between "a type that is a monitor" and "a type that looks 306 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 lock 314 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 unclear 320 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"? which 325 approaches? examined by whom? if this is a novel contribution, needs 326 rather more there, and more comparison with related work 327 328 * FIG 8 consider e.g. sequence diagrams rather than code to show these 329 cases 330 331 * 6.2 p19 line 5 "similarly, monitor routines can be added at any 332 time" really? I thought C-forall was compiled? there's a big 333 difference between "static" and "dynamic" inheritance. which is this 334 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 be 341 expanded to give enough detail to support that argument 342 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 the 351 user threads, fibres, etc here; 352 353 * sec 8.1 I found these sections hard to follow. how is a cluster a 354 "collection of threads and virtual processors... like a virtual 355 machine"? Where do the thread pools from 7.3 fit in? 356 357 * sec 8.3 is out of place, probably unneeded in the paper 358 359 * section 9 dives straight into details with no overview. Section 9 360 seems very detailed, and depends on assumptions or details that are 361 not in the article. 362 363 * section 10 covers only microbenchmarks. are there any moderate sized 364 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 written 368 in C-forall". The article doesn't 369 370 371 * future work should precede conclusion, not follow it 372 373 * the article should have a related work section (2-3 pages) comparing 374 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: 3 380 381 Comments to the Author 382 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 design 427 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
r9d9a451 r53bb8f1 187 187 DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) 188 188 ACLOCAL = @ACLOCAL@ 189 ALLOCA = @ALLOCA@190 189 AMTAR = @AMTAR@ 191 190 AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ -
driver/cfa.cc
r9d9a451 r53bb8f1 10 10 // Created On : Tue Aug 20 13:44:49 2002 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Fri Sep 14 23:02:59 201813 // Update Count : 2 7712 // Last Modified On : Sun Feb 10 08:28:09 2019 13 // Update Count : 281 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 help = false; // -help 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 112 113 bool CFA_flag = false; // -CFA flag 113 114 bool cpp_flag = false; // -E or -M flag, preprocessor only … … 162 163 debug = true; // strip the debug flag 163 164 } else if ( arg == "-nodebug" ) { 164 debug = false; // strip the nodebug flag 165 debug = false; // strip the debug flag 166 } else if ( arg == "-nolib" ) { 167 nolib = true; // strip the nodebug flag 165 168 } else if ( arg == "-quiet" ) { 166 169 quiet = true; // strip the quiet flag … … 366 369 } // if 367 370 } // if 368 const char * config = debug ? "debug": "nodebug";371 const char * config = nolib ? "nolib" : (debug ? "debug": "nodebug"); 369 372 string libdir = libbase + arch + "-" + config; 370 373 371 if ( ! dirExists( libdir ) ) {374 if ( ! nolib && ! dirExists( libdir ) ) { 372 375 cerr << argv[0] << " internal error, configuration " << config << " not installed." << endl; 373 376 cerr << "Was looking for " << libdir << endl; … … 384 387 nargs += 1; 385 388 389 for ( int i = 0; i < nlibs; i += 1 ) { // copy non-user libraries after all user libraries 390 args[nargs] = libs[i]; 391 nargs += 1; 392 } // for 393 386 394 if ( link ) { 387 395 args[nargs] = "-Xlinker"; … … 414 422 nargs += 1; 415 423 args[nargs] = "-lrt"; 424 nargs += 1; 425 args[nargs] = "-lm"; 416 426 nargs += 1; 417 427 } // if … … 488 498 args[nargs] = "-Wno-deprecated"; 489 499 nargs += 1; 500 #ifdef HAVE_CAST_FUNCTION_TYPE 501 args[nargs] = "-Wno-cast-function-type"; 502 nargs += 1; 503 #endif // HAVE_CAST_FUNCTION_TYPE 490 504 if ( ! std_flag ) { // default c11, if none specified 491 505 args[nargs] = "-std=gnu11"; … … 497 511 nargs += 1; 498 512 args[nargs] = ( *new string( string("-B") + Bprefix ) ).c_str(); 499 nargs += 1;500 args[nargs] = "-lm";501 513 nargs += 1; 502 514 } else { … … 504 516 exit( EXIT_FAILURE ); 505 517 } // if 506 507 for ( int i = 0; i < nlibs; i += 1 ) { // copy non-user libraries after all user libraries508 args[nargs] = libs[i];509 nargs += 1;510 } // for511 518 512 519 args[nargs] = NULL; // terminate with NULL -
libcfa/configure
r9d9a451 r53bb8f1 2382 2382 2383 2383 2384 # http://git.savannah.gnu.org/gitweb/?p=autoconf-archive.git;a=blob_plain;f=m4/ax_check_compile_flag.m4 2385 2384 2386 2385 2387 am__api_version='1.15' … … 2968 2970 "nolib" ) 2969 2971 CONFIG_CFLAGS="-O2 -s" 2970 CONFIG_CFAFLAGS="-no debug"2972 CONFIG_CFAFLAGS="-nolib" 2971 2973 CONFIG_BUILDLIB="no" 2972 2974 ;; -
libcfa/configure.ac
r9d9a451 r53bb8f1 56 56 "nolib" ) 57 57 CONFIG_CFLAGS="-O2 -s" 58 CONFIG_CFAFLAGS="-no debug"58 CONFIG_CFAFLAGS="-nolib" 59 59 CONFIG_BUILDLIB="no" 60 60 ;; -
libcfa/prelude/builtins.c
r9d9a451 r53bb8f1 10 10 // Created On : Fri Jul 21 16:21:03 2017 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Sun Aug 5 21:40:38 201813 // Update Count : 2012 // Last Modified On : Sun Mar 10 10:52:50 2019 13 // Update Count : 31 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; } 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; } 39 43 40 44 // exponentiation operator implementation -
libcfa/prelude/extras.c
r9d9a451 r53bb8f1 1 #include <stddef.h> // size_t, ptrdiff_t 1 #include <stddef.h> // size_t, ptrdiff_t, intptr_t, uintptr_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
r9d9a451 r53bb8f1 1 1 typedef.* size_t; 2 2 typedef.* ptrdiff_t; 3 typedef.* intptr_t; 4 typedef.* uintptr_t; 3 5 typedef.* __int8_t; 4 6 typedef.* __int16_t; -
libcfa/prelude/prelude-gen.cc
r9d9a451 r53bb8f1 1 // 2 // Cforall Version 1.0.0 Copyright (C) 2018 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 // prelude-gen.cc -- 8 // 9 // Author : Rob Schluntz and Thierry Delisle 10 // Created On : Sat Feb 16 08:44:58 2019 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Fri Mar 8 16:00:22 2019 13 // Update Count : 26 14 // 15 1 16 #include <algorithm> 2 17 #include <array> … … 11 26 bool hasComparison; 12 27 } basicTypes[] = { 13 //{ "char" , false, true , },14 //{ "signed char" , false, true , },15 //{ "unsigned char" , false, true , },28 { "char" , false, true , }, 29 { "signed char" , false, true , }, 30 { "unsigned char" , false, true , }, 16 31 { "signed short" , false, true , }, 17 32 { "unsigned short" , false, true , }, … … 34 49 #if defined(__i386__) || defined(__ia64__) || defined(__x86_64__) 35 50 { "__float80" , true , true , }, 36 { "_ Float128", true , true , },51 { "__float128" , true , true , }, 37 52 #endif 38 53 }; … … 150 165 cout << endl; 151 166 152 cout << "signed int ?==?( zero_t, zero_t ), 153 cout << "signed int ?==?( one_t, one_t ), 154 cout << "signed int ?==?( _Bool, _Bool ), 155 cout << "signed int 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; 156 171 157 172 for (auto op : arithmeticOperators) { … … 188 203 cout << "// Arithmetic Constructors //" << endl; 189 204 cout << "/////////////////////////////" << endl; 205 cout << endl; 206 190 207 auto otype = [](const std::string & type, bool do_volatile = false) { 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 << ")";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 << ")"; 196 213 } 197 214 cout << ";" << endl; 198 cout << "void \t^?{}( " << type << " & );" << endl;215 cout << "void ^?{}( " << type << " & );" << endl; 199 216 }; 200 217 … … 202 219 otype("one_t"); 203 220 otype("_Bool", true); 204 otype("char", true); 205 otype("signed char", true); 206 otype("unsigned char", true); 221 cout << endl; 207 222 208 223 for (auto type : basicTypes) { 209 cout << "void ?{}(" << type.name << " &);" << endl; 210 cout << "void ?{}(" << type.name << " &, " << type.name << ");" << endl; 224 cout << "void ?{}(" << type.name << " &);" << endl; 225 cout << "void ?{}(" << type.name << " &, " << type.name << ");" << endl; 226 cout << "void ?{}(" << type.name << " &, zero_t);" << endl; 211 227 cout << "void ^?{}(" << type.name << " &);" << endl; 212 228 cout << endl; … … 217 233 cout << "// Pointer Constructors //" << endl; 218 234 cout << "//////////////////////////" << endl; 219 cout << "forall(ftype FT) void ?{}( FT *&, FT * );" << endl; 220 cout << "forall(ftype FT) void ?{}( FT * volatile &, FT * );" << endl; 235 cout << endl; 236 237 cout << "forall(ftype FT) void ?{}( FT *&, FT * );" << endl; 238 cout << "forall(ftype FT) void ?{}( FT * volatile &, FT * );" << endl; 221 239 222 240 // generate qualifiers … … 242 260 for (auto cvq : qualifiersPair) { 243 261 for (auto is_vol : { " ", "volatile" }) { 244 cout << "forall(dtype DT) void 262 cout << "forall(dtype DT) void ?{}(" << cvq.first << type << " * " << is_vol << " &, " << cvq.second << "DT *);" << endl; 245 263 } 246 264 } 247 265 for (auto cvq : qualifiersSingle) { 248 266 for (auto is_vol : { " ", "volatile" }) { 249 cout << "forall(dtype DT) void 267 cout << "forall(dtype DT) void ?{}(" << cvq << type << " * " << is_vol << " &);" << endl; 250 268 } 251 269 for (auto is_vol : { " ", "volatile" }) { … … 269 287 cout << "forall(ftype FT) FT * ?=?( FT * &, zero_t );" << endl; 270 288 cout << "forall(ftype FT) FT * ?=?( FT * volatile &, zero_t );" << endl; 271 cout << "forall( ftype FT) void ?{}( FT * & );" << endl;272 cout << "forall( ftype FT) void ^?{}( FT * & );" << endl;289 cout << "forall(ftype FT) void ?{}( FT * & );" << endl; 290 cout << "forall(ftype FT) void ^?{}( FT * & );" << endl; 273 291 cout << endl; 274 292 … … 277 295 cout << "///////////////////////" << endl; 278 296 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 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; 286 303 287 304 for (auto op : pointerOperators) { … … 387 404 } 388 405 406 // Local Variables: // 407 // tab-width: 4 // 408 // End: // -
libcfa/src/Makefile.in
r9d9a451 r53bb8f1 415 415 am__v_GOC_0 = @echo " GOC " $@; 416 416 am__v_GOC_1 = 417 UPPCC = u++ 417 418 UPPCOMPILE = $(UPPCC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_UPPFLAGS) $(UPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) $(AM_CFLAGS) $(CFLAGS) 418 419 AM_V_UPP = $(am__v_UPP_@AM_V@) -
libcfa/src/containers/maybe.cfa
r9d9a451 r53bb8f1 10 10 // Created On : Wed May 24 15:40:00 2017 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Thu Jul 20 15:23:50 201713 // Update Count : 212 // Last Modified On : Sun Feb 17 11:22:03 2019 13 // Update Count : 3 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
r9d9a451 r53bb8f1 10 10 // Created On : Wed May 24 15:40:00 2017 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Thu Jul 20 15:23:58 201713 // Update Count : 212 // Last Modified On : Sun Feb 17 11:24:04 2019 13 // Update Count : 3 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
r9d9a451 r53bb8f1 10 10 // Created On : Wed May 27 17:56:53 2015 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Mon Dec 24 18:33:40 201813 // Update Count : 5 8912 // Last Modified On : Mon Mar 4 20:57:24 2019 13 // Update Count : 593 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 29 47 ostype & ?|?( ostype & os, bool b ) { 30 48 if ( sepPrt( os ) ) fmt( os, "%s", sepGetCur( os ) ); -
libcfa/src/iostream.hfa
r9d9a451 r53bb8f1 10 10 // Created On : Wed May 27 17:56:53 2015 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Mon Dec 24 18:33:40 201813 // Update Count : 22 012 // Last Modified On : Tue Feb 26 16:57:22 2019 13 // Update Count : 221 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 64 69 ostype & ?|?( ostype &, bool ); 65 70 void ?|?( ostype &, bool ); -
src/CodeGen/module.mk
r9d9a451 r53bb8f1 18 18 # ArgTweak/Mutate.cc 19 19 20 SRC += CodeGen/Generate.cc\20 SRC_CODEGEN = \ 21 21 CodeGen/CodeGenerator.cc \ 22 CodeGen/FixMain.cc \ 22 23 CodeGen/GenType.cc \ 23 CodeGen/FixNames.cc \24 CodeGen/FixMain.cc \25 24 CodeGen/OperatorTable.cc 25 26 27 SRC += $(SRC_CODEGEN) CodeGen/Generate.cc CodeGen/FixNames.cc 28 SRCDEMANGLE += $(SRC_CODEGEN) -
src/Common/PassVisitor.h
r9d9a451 r53bb8f1 5 5 #include <stack> 6 6 7 #include "Common/Stats.h" 7 8 #include "Common/utility.h" 8 9 … … 426 427 }; 427 428 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 428 437 #include "SynTree/TypeSubstitution.h" 429 438 #include "PassVisitor.impl.h" -
src/Common/PassVisitor.impl.h
r9d9a451 r53bb8f1 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); 69 72 for ( std::list< Declaration* >::iterator i = decls.begin(); ; ++i ) { 73 74 70 75 // splice in new declarations after previous decl 71 76 if ( !empty( afterDecls ) ) { decls.splice( i, *afterDecls ); } … … 83 88 if ( !empty( beforeDecls ) ) { decls.splice( i, *beforeDecls ); } 84 89 } 90 pass_visitor_stats.depth--; 85 91 if ( ! errors.isEmpty() ) { 86 92 throw errors; … … 94 100 SemanticErrorException errors; 95 101 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); 96 105 for ( std::list< Declaration* >::iterator i = decls.begin(); ; ++i ) { 97 106 // splice in new declarations after previous decl … … 109 118 if ( !empty( beforeDecls ) ) { decls.splice( i, *beforeDecls ); } 110 119 } 120 pass_visitor_stats.depth--; 111 121 if ( ! errors.isEmpty() ) { 112 122 throw errors; … … 126 136 if ( ! visitor.get_visit_children() ) return; 127 137 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); 128 142 for ( typename Container::iterator i = container.begin(); i != container.end(); ++i ) { 129 143 try { … … 135 149 } 136 150 } 151 pass_visitor_stats.depth--; 137 152 if ( ! errors.isEmpty() ) { 138 153 throw errors; … … 153 168 if ( ! mutator.get_visit_children() ) return; 154 169 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); 155 174 for ( typename Container::iterator i = container.begin(); i != container.end(); ++i ) { 156 175 try { … … 163 182 } // try 164 183 } // for 184 pass_visitor_stats.depth--; 165 185 if ( ! errors.isEmpty() ) { 166 186 throw errors; … … 185 205 DeclList_t* afterDecls = get_afterDecls(); 186 206 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); 187 210 for ( std::list< Statement* >::iterator i = statements.begin(); i != statements.end(); ++i ) { 188 211 … … 202 225 if ( !empty( beforeStmts ) ) { statements.splice( i, *beforeStmts ); } 203 226 } 227 pass_visitor_stats.depth--; 204 228 205 229 if ( !empty( afterDecls ) ) { splice( std::back_inserter( statements ), afterDecls); } -
src/Common/Stats/Heap.h
r9d9a451 r53bb8f1 16 16 #pragma once 17 17 18 namespace HeapStats { 19 void newPass( const char * const name ); 20 void printStats(); 18 namespace Stats { 19 namespace Heap { 20 void newPass( const char * const name ); 21 void print(); 22 } 21 23 } -
src/Common/module.mk
r9d9a451 r53bb8f1 15 15 ############################################################################### 16 16 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 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) -
src/Concurrency/Waitfor.cc
r9d9a451 r53bb8f1 11 11 // Last Modified By : 12 12 // Last Modified On : 13 // Update Count : 513 // Update Count : 7 14 14 // 15 15 -
src/Concurrency/module.mk
r9d9a451 r53bb8f1 15 15 ############################################################################### 16 16 17 SRC += Concurrency/Keywords.cc \18 Concurrency/Waitfor.cc17 SRC += Concurrency/Keywords.cc Concurrency/Waitfor.cc 18 SRCDEMANGLE += Concurrency/Keywords.cc 19 19 -
src/ControlStruct/ExceptTranslate.cc
r9d9a451 r53bb8f1 9 9 // Author : Andrew Beach 10 10 // Created On : Wed Jun 14 16:49:00 2017 11 // Last Modified By : Andrew Beach12 // Last Modified On : Thr Aug 17 17:19:00 201713 // Update Count : 911 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Wed Feb 13 18:15:29 2019 13 // Update Count : 11 14 14 // 15 15 -
src/ControlStruct/module.mk
r9d9a451 r53bb8f1 15 15 ############################################################################### 16 16 17 SRC += ControlStruct/LabelGenerator.cc \ 17 SRC_CONTROLSTRUCT = \ 18 ControlStruct/ForExprMutator.cc \ 18 19 ControlStruct/LabelFixer.cc \ 20 ControlStruct/LabelGenerator.cc \ 19 21 ControlStruct/MLEMutator.cc \ 20 ControlStruct/Mutate.cc \ 21 ControlStruct/ForExprMutator.cc \ 22 ControlStruct/ExceptTranslate.cc 22 ControlStruct/Mutate.cc 23 24 SRC += $(SRC_CONTROLSTRUCT) ControlStruct/ExceptTranslate.cc 25 SRCDEMANGLE += $(SRC_CONTROLSTRUCT) 26 -
src/GenPoly/module.mk
r9d9a451 r53bb8f1 22 22 GenPoly/FindFunction.cc \ 23 23 GenPoly/InstantiateGeneric.cc 24 25 SRCDEMANGLE += GenPoly/GenPoly.cc GenPoly/Lvalue.cc 26 -
src/InitTweak/FixInit.cc
r9d9a451 r53bb8f1 10 10 // Created On : Wed Jan 13 16:29:30 2016 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Wed Jun 21 17:35:05 201713 // Update Count : 7 412 // Last Modified On : Wed Feb 13 18:15:56 2019 13 // Update Count : 76 14 14 // 15 15 #include "FixInit.h" -
src/InitTweak/module.mk
r9d9a451 r53bb8f1 20 20 InitTweak/InitTweak.cc 21 21 22 SRCDEMANGLE += InitTweak/GenInit.cc \ 23 InitTweak/InitTweak.cc 24 -
src/MakeLibCfa.cc
r9d9a451 r53bb8f1 9 9 // Author : Richard C. Bilson 10 10 // Created On : Sat May 16 10:33:33 2015 11 // Last Modified By : Rob Schluntz12 // Last Modified On : Fri Apr 22 13:54:15 201613 // Update Count : 4 011 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Sun Feb 17 21:08:09 2019 13 // Update Count : 41 14 14 // 15 15 … … 146 146 } // namespace 147 147 } // namespace LibCfa 148 149 // Local Variables: // 150 // tab-width: 4 // 151 // End: // -
src/Makefile.am
r9d9a451 r53bb8f1 10 10 ## Author : Peter A. Buhr 11 11 ## Created On : Sun May 31 08:51:46 2015 12 ## Last Modified By : Andrew Beach13 ## Last Modified On : Tus Jul 25 10:34:00 201714 ## Update Count : 7612 ## Last Modified By : Peter A. Buhr 13 ## Last Modified On : Fri Feb 15 09:44:09 2019 14 ## Update Count : 97 15 15 ############################################################################### 16 16 … … 23 23 CompilationState.cc 24 24 25 SRCDEMANGLE = CompilationState.cc 26 25 27 MAINTAINERCLEANFILES = 26 28 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.h 46 47 $(srcdir)/SynTree/Type.h : BasicTypes-gen.cc 48 ${AM_V_GEN}${CXXCOMPILE} $< -o BasicTypes-gen -Wall -Wextra 49 @./BasicTypes-gen 50 @rm BasicTypes-gen 51 45 52 # put into lib for now 46 53 cfa_cpplibdir = $(CFA_LIBDIR) … … 55 62 demangler_SOURCES = SymTab/demangler.cc 56 63 57 demangler_LDADD = libdemangle.a 64 demangler_LDADD = libdemangle.a -ldl # yywrap 58 65 59 66 noinst_LIBRARIES = libdemangle.a 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 67 libdemangle_a_SOURCES = $(SRCDEMANGLE) 144 68 145 69 MAINTAINERCLEANFILES += ${libdir}/${notdir ${cfa_cpplib_PROGRAMS}} -
src/Makefile.in
r9d9a451 r53bb8f1 162 162 libdemangle_a_LIBADD = 163 163 am__dirstamp = $(am__leading_dot)dirstamp 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) \ 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) \ 191 173 ControlStruct/LabelFixer.$(OBJEXT) \ 192 174 ControlStruct/LabelGenerator.$(OBJEXT) \ 193 175 ControlStruct/MLEMutator.$(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) \ 176 ControlStruct/Mutate.$(OBJEXT) 177 am__objects_4 = ResolvExpr/AdjustExprType.$(OBJEXT) \ 198 178 ResolvExpr/Alternative.$(OBJEXT) \ 199 179 ResolvExpr/AlternativeFinder.$(OBJEXT) \ 200 ResolvExpr/ExplodedActual.$(OBJEXT) \201 180 ResolvExpr/CastCost.$(OBJEXT) ResolvExpr/CommonType.$(OBJEXT) \ 202 181 ResolvExpr/ConversionCost.$(OBJEXT) \ 203 182 ResolvExpr/CurrentObject.$(OBJEXT) \ 183 ResolvExpr/ExplodedActual.$(OBJEXT) \ 204 184 ResolvExpr/FindOpenVars.$(OBJEXT) ResolvExpr/Occurs.$(OBJEXT) \ 205 185 ResolvExpr/PolyCost.$(OBJEXT) \ … … 212 192 ResolvExpr/SpecCost.$(OBJEXT) \ 213 193 ResolvExpr/TypeEnvironment.$(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) \ 194 ResolvExpr/Unify.$(OBJEXT) 195 am__objects_5 = SymTab/Autogen.$(OBJEXT) SymTab/FixFunction.$(OBJEXT) \ 270 196 SymTab/Indexer.$(OBJEXT) SymTab/Mangler.$(OBJEXT) \ 271 SymTab/ManglerCommon.$(OBJEXT) SymTab/Validate.$(OBJEXT) \ 272 SymTab/FixFunction.$(OBJEXT) SymTab/Autogen.$(OBJEXT) \ 273 SynTree/Type.$(OBJEXT) SynTree/VoidType.$(OBJEXT) \ 197 SymTab/ManglerCommon.$(OBJEXT) SymTab/Validate.$(OBJEXT) 198 am__objects_6 = SynTree/Type.$(OBJEXT) SynTree/VoidType.$(OBJEXT) \ 274 199 SynTree/BasicType.$(OBJEXT) SynTree/PointerType.$(OBJEXT) \ 275 200 SynTree/ArrayType.$(OBJEXT) SynTree/ReferenceType.$(OBJEXT) \ … … 290 215 SynTree/Initializer.$(OBJEXT) \ 291 216 SynTree/TypeSubstitution.$(OBJEXT) SynTree/Attribute.$(OBJEXT) \ 292 SynTree/DeclReplacer.$(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) \ 293 254 Tuples/TupleAssignment.$(OBJEXT) \ 294 255 Tuples/TupleExpansion.$(OBJEXT) Tuples/Explode.$(OBJEXT) \ 295 256 Validate/HandleAttributes.$(OBJEXT) \ 296 257 Virtual/ExpandCasts.$(OBJEXT) 297 am____driver_cfa_cpp_OBJECTS = $(am__objects_ 1)258 am____driver_cfa_cpp_OBJECTS = $(am__objects_8) 298 259 ___driver_cfa_cpp_OBJECTS = $(am____driver_cfa_cpp_OBJECTS) 299 260 ___driver_cfa_cpp_DEPENDENCIES = … … 416 377 DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) 417 378 ACLOCAL = @ACLOCAL@ 418 ALLOCA = @ALLOCA@419 379 AMTAR = @AMTAR@ 420 380 AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ … … 564 524 AUTOMAKE_OPTIONS = foreign subdir-objects 565 525 ACLOCAL_AMFLAGS = -I automake 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 \ 526 SRC = main.cc MakeLibCfa.cc CompilationState.cc $(SRC_CODEGEN) \ 527 CodeGen/Generate.cc CodeGen/FixNames.cc CodeTools/DeclStats.cc \ 570 528 CodeTools/ResolvProtoDump.cc CodeTools/TrackLoc.cc \ 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 \ 529 Concurrency/Keywords.cc Concurrency/Waitfor.cc $(SRC_COMMON) \ 530 Common/DebugMalloc.cc $(SRC_CONTROLSTRUCT) \ 577 531 ControlStruct/ExceptTranslate.cc GenPoly/Box.cc \ 578 532 GenPoly/GenPoly.cc GenPoly/ScrubTyVars.cc GenPoly/Lvalue.cc \ … … 585 539 Parser/StatementNode.cc Parser/InitializerNode.cc \ 586 540 Parser/TypeData.cc Parser/LinkageSpec.cc \ 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 \ 541 Parser/parserutility.cc $(SRC_RESOLVEXPR) \ 542 ResolvExpr/AlternativePrinter.cc $(SRC_SYMTAB) $(SRC_SYNTREE) \ 616 543 Tuples/TupleAssignment.cc Tuples/TupleExpansion.cc \ 617 544 Tuples/Explode.cc Validate/HandleAttributes.cc \ 618 545 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.cc 619 553 MAINTAINERCLEANFILES = ${libdir}/${notdir ${cfa_cpplib_PROGRAMS}} 620 MOSTLYCLEANFILES = Parser/parser.hh Parser/parser.output 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 621 580 BUILT_SOURCES = Parser/parser.hh 622 581 AM_YFLAGS = -d -t -v 623 624 # Is there a way to use a variable for the directory names? 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 625 648 626 649 # put into lib for now … … 632 655 ARFLAGS = cr 633 656 demangler_SOURCES = SymTab/demangler.cc 634 demangler_LDADD = libdemangle.a 657 demangler_LDADD = libdemangle.a -ldl # yywrap 635 658 noinst_LIBRARIES = libdemangle.a 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 659 libdemangle_a_SOURCES = $(SRCDEMANGLE) 721 660 all: $(BUILT_SOURCES) 722 661 $(MAKE) $(AM_MAKEFLAGS) all-am … … 757 696 clean-noinstLIBRARIES: 758 697 -test -z "$(noinst_LIBRARIES)" || rm -f $(noinst_LIBRARIES) 759 SymTab/$(am__dirstamp):760 @$(MKDIR_P) SymTab761 @: > 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) SynTree771 @: > 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)843 698 CodeGen/$(am__dirstamp): 844 699 @$(MKDIR_P) CodeGen … … 855 710 CodeGen/OperatorTable.$(OBJEXT): CodeGen/$(am__dirstamp) \ 856 711 CodeGen/$(DEPDIR)/$(am__dirstamp) 712 Concurrency/$(am__dirstamp): 713 @$(MKDIR_P) Concurrency 714 @: > 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) 857 720 Common/$(am__dirstamp): 858 721 @$(MKDIR_P) Common … … 865 728 Common/Eval.$(OBJEXT): Common/$(am__dirstamp) \ 866 729 Common/$(DEPDIR)/$(am__dirstamp) 730 Common/PassVisitor.$(OBJEXT): Common/$(am__dirstamp) \ 731 Common/$(DEPDIR)/$(am__dirstamp) 867 732 Common/SemanticError.$(OBJEXT): Common/$(am__dirstamp) \ 868 733 Common/$(DEPDIR)/$(am__dirstamp) 734 Common/Stats/$(am__dirstamp): 735 @$(MKDIR_P) Common/Stats 736 @: > 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) 869 748 Common/UniqueName.$(OBJEXT): Common/$(am__dirstamp) \ 870 749 Common/$(DEPDIR)/$(am__dirstamp) 871 Concurrency/$(am__dirstamp):872 @$(MKDIR_P) Concurrency873 @: > 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)879 750 ControlStruct/$(am__dirstamp): 880 751 @$(MKDIR_P) ControlStruct … … 933 804 ResolvExpr/AlternativeFinder.$(OBJEXT): ResolvExpr/$(am__dirstamp) \ 934 805 ResolvExpr/$(DEPDIR)/$(am__dirstamp) 806 ResolvExpr/CastCost.$(OBJEXT): ResolvExpr/$(am__dirstamp) \ 807 ResolvExpr/$(DEPDIR)/$(am__dirstamp) 808 ResolvExpr/CommonType.$(OBJEXT): ResolvExpr/$(am__dirstamp) \ 809 ResolvExpr/$(DEPDIR)/$(am__dirstamp) 810 ResolvExpr/ConversionCost.$(OBJEXT): ResolvExpr/$(am__dirstamp) \ 811 ResolvExpr/$(DEPDIR)/$(am__dirstamp) 812 ResolvExpr/CurrentObject.$(OBJEXT): ResolvExpr/$(am__dirstamp) \ 813 ResolvExpr/$(DEPDIR)/$(am__dirstamp) 935 814 ResolvExpr/ExplodedActual.$(OBJEXT): ResolvExpr/$(am__dirstamp) \ 936 815 ResolvExpr/$(DEPDIR)/$(am__dirstamp) 937 ResolvExpr/CastCost.$(OBJEXT): ResolvExpr/$(am__dirstamp) \938 ResolvExpr/$(DEPDIR)/$(am__dirstamp)939 ResolvExpr/CommonType.$(OBJEXT): ResolvExpr/$(am__dirstamp) \940 ResolvExpr/$(DEPDIR)/$(am__dirstamp)941 ResolvExpr/ConversionCost.$(OBJEXT): ResolvExpr/$(am__dirstamp) \942 ResolvExpr/$(DEPDIR)/$(am__dirstamp)943 ResolvExpr/CurrentObject.$(OBJEXT): ResolvExpr/$(am__dirstamp) \944 ResolvExpr/$(DEPDIR)/$(am__dirstamp)945 816 ResolvExpr/FindOpenVars.$(OBJEXT): ResolvExpr/$(am__dirstamp) \ 946 817 ResolvExpr/$(DEPDIR)/$(am__dirstamp) … … 967 838 ResolvExpr/Unify.$(OBJEXT): ResolvExpr/$(am__dirstamp) \ 968 839 ResolvExpr/$(DEPDIR)/$(am__dirstamp) 840 SymTab/$(am__dirstamp): 841 @$(MKDIR_P) SymTab 842 @: > SymTab/$(am__dirstamp) 843 SymTab/$(DEPDIR)/$(am__dirstamp): 844 @$(MKDIR_P) SymTab/$(DEPDIR) 845 @: > SymTab/$(DEPDIR)/$(am__dirstamp) 969 846 SymTab/Autogen.$(OBJEXT): SymTab/$(am__dirstamp) \ 970 847 SymTab/$(DEPDIR)/$(am__dirstamp) … … 975 852 SymTab/Mangler.$(OBJEXT): SymTab/$(am__dirstamp) \ 976 853 SymTab/$(DEPDIR)/$(am__dirstamp) 854 SymTab/ManglerCommon.$(OBJEXT): SymTab/$(am__dirstamp) \ 855 SymTab/$(DEPDIR)/$(am__dirstamp) 977 856 SymTab/Validate.$(OBJEXT): SymTab/$(am__dirstamp) \ 978 857 SymTab/$(DEPDIR)/$(am__dirstamp) 858 SymTab/Demangle.$(OBJEXT): SymTab/$(am__dirstamp) \ 859 SymTab/$(DEPDIR)/$(am__dirstamp) 860 SynTree/$(am__dirstamp): 861 @$(MKDIR_P) SynTree 862 @: > 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) 979 934 Tuples/$(am__dirstamp): 980 935 @$(MKDIR_P) Tuples … … 983 938 @$(MKDIR_P) Tuples/$(DEPDIR) 984 939 @: > Tuples/$(DEPDIR)/$(am__dirstamp) 985 Tuples/Explode.$(OBJEXT): Tuples/$(am__dirstamp) \986 Tuples/$(DEPDIR)/$(am__dirstamp)987 940 Tuples/TupleAssignment.$(OBJEXT): Tuples/$(am__dirstamp) \ 988 941 Tuples/$(DEPDIR)/$(am__dirstamp) 989 942 Tuples/TupleExpansion.$(OBJEXT): Tuples/$(am__dirstamp) \ 943 Tuples/$(DEPDIR)/$(am__dirstamp) 944 Tuples/Explode.$(OBJEXT): Tuples/$(am__dirstamp) \ 990 945 Tuples/$(DEPDIR)/$(am__dirstamp) 991 946 Validate/$(am__dirstamp): … … 1070 1025 Concurrency/$(DEPDIR)/$(am__dirstamp) 1071 1026 Common/DebugMalloc.$(OBJEXT): Common/$(am__dirstamp) \ 1072 Common/$(DEPDIR)/$(am__dirstamp)1073 Common/Heap.$(OBJEXT): Common/$(am__dirstamp) \1074 1027 Common/$(DEPDIR)/$(am__dirstamp) 1075 1028 ControlStruct/ExceptTranslate.$(OBJEXT): \ … … 1142 1095 -rm -f CodeTools/*.$(OBJEXT) 1143 1096 -rm -f Common/*.$(OBJEXT) 1097 -rm -f Common/Stats/*.$(OBJEXT) 1144 1098 -rm -f Concurrency/*.$(OBJEXT) 1145 1099 -rm -f ControlStruct/*.$(OBJEXT) … … 1172 1126 @AMDEP_TRUE@@am__include@ @am__quote@Common/$(DEPDIR)/DebugMalloc.Po@am__quote@ 1173 1127 @AMDEP_TRUE@@am__include@ @am__quote@Common/$(DEPDIR)/Eval.Po@am__quote@ 1174 @AMDEP_TRUE@@am__include@ @am__quote@Common/$(DEPDIR)/ Heap.Po@am__quote@1128 @AMDEP_TRUE@@am__include@ @am__quote@Common/$(DEPDIR)/PassVisitor.Po@am__quote@ 1175 1129 @AMDEP_TRUE@@am__include@ @am__quote@Common/$(DEPDIR)/SemanticError.Po@am__quote@ 1176 1130 @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@ 1177 1135 @AMDEP_TRUE@@am__include@ @am__quote@Concurrency/$(DEPDIR)/Keywords.Po@am__quote@ 1178 1136 @AMDEP_TRUE@@am__include@ @am__quote@Concurrency/$(DEPDIR)/Waitfor.Po@am__quote@ … … 1436 1394 -rm -f Common/$(DEPDIR)/$(am__dirstamp) 1437 1395 -rm -f Common/$(am__dirstamp) 1396 -rm -f Common/Stats/$(DEPDIR)/$(am__dirstamp) 1397 -rm -f Common/Stats/$(am__dirstamp) 1438 1398 -rm -f Concurrency/$(DEPDIR)/$(am__dirstamp) 1439 1399 -rm -f Concurrency/$(am__dirstamp) … … 1473 1433 1474 1434 distclean: distclean-am 1475 -rm -rf ./$(DEPDIR) CodeGen/$(DEPDIR) CodeTools/$(DEPDIR) Common/$(DEPDIR) Co ncurrency/$(DEPDIR) ControlStruct/$(DEPDIR) GenPoly/$(DEPDIR) InitTweak/$(DEPDIR) Parser/$(DEPDIR) ResolvExpr/$(DEPDIR) SymTab/$(DEPDIR) SynTree/$(DEPDIR) Tuples/$(DEPDIR) Validate/$(DEPDIR) Virtual/$(DEPDIR)1435 -rm -rf ./$(DEPDIR) CodeGen/$(DEPDIR) CodeTools/$(DEPDIR) Common/$(DEPDIR) Common/Stats/$(DEPDIR) Concurrency/$(DEPDIR) ControlStruct/$(DEPDIR) GenPoly/$(DEPDIR) InitTweak/$(DEPDIR) Parser/$(DEPDIR) ResolvExpr/$(DEPDIR) SymTab/$(DEPDIR) SynTree/$(DEPDIR) Tuples/$(DEPDIR) Validate/$(DEPDIR) Virtual/$(DEPDIR) 1476 1436 -rm -f Makefile 1477 1437 distclean-am: clean-am distclean-compile distclean-generic \ … … 1519 1479 1520 1480 maintainer-clean: maintainer-clean-am 1521 -rm -rf ./$(DEPDIR) CodeGen/$(DEPDIR) CodeTools/$(DEPDIR) Common/$(DEPDIR) Co ncurrency/$(DEPDIR) ControlStruct/$(DEPDIR) GenPoly/$(DEPDIR) InitTweak/$(DEPDIR) Parser/$(DEPDIR) ResolvExpr/$(DEPDIR) SymTab/$(DEPDIR) SynTree/$(DEPDIR) Tuples/$(DEPDIR) Validate/$(DEPDIR) Virtual/$(DEPDIR)1481 -rm -rf ./$(DEPDIR) CodeGen/$(DEPDIR) CodeTools/$(DEPDIR) Common/$(DEPDIR) Common/Stats/$(DEPDIR) Concurrency/$(DEPDIR) ControlStruct/$(DEPDIR) GenPoly/$(DEPDIR) InitTweak/$(DEPDIR) Parser/$(DEPDIR) ResolvExpr/$(DEPDIR) SymTab/$(DEPDIR) SynTree/$(DEPDIR) Tuples/$(DEPDIR) Validate/$(DEPDIR) Virtual/$(DEPDIR) 1522 1482 -rm -f Makefile 1523 1483 maintainer-clean-am: distclean-am maintainer-clean-generic … … 1559 1519 1560 1520 1521 $(addprefix $(srcdir)/, ResolvExpr/ConversionCost.cc ResolvExpr/CommonType.cc SymTab/ManglerCommon.cc) : $(srcdir)/SynTree/Type.h 1522 1523 $(srcdir)/SynTree/Type.h : BasicTypes-gen.cc 1524 ${AM_V_GEN}${CXXCOMPILE} $< -o BasicTypes-gen -Wall -Wextra 1525 @./BasicTypes-gen 1526 @rm BasicTypes-gen 1527 1561 1528 # Tell versions [3.59,3.63) of GNU make to not export all variables. 1562 1529 # Otherwise a system limit (for SysV at least) may be exceeded. -
src/Parser/DeclarationNode.cc
r9d9a451 r53bb8f1 10 10 // Created On : Sat May 16 12:34:05 2015 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Thu Nov 1 20:54:26 201813 // Update Count : 11 0812 // Last Modified On : Fri Feb 1 16:49:17 2019 13 // Update Count : 1113 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", "float", "double", "long double", "int128", "float80", "float128", "NoBasicTypeNames" }; 44 const char * DeclarationNode::complexTypeNames[] = { "_Complex", "_Imaginary", "NoComplexTypeNames" }; 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 45 47 const char * DeclarationNode::signednessNames[] = { "signed", "unsigned", "NoSignednessNames" }; 46 48 const char * DeclarationNode::lengthNames[] = { "short", "long", "long long", "NoLengthNames" }; -
src/Parser/ExpressionNode.cc
r9d9a451 r53bb8f1 10 10 // Created On : Sat May 16 13:17:07 2015 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Mon Jun 4 21:24:45 201813 // Update Count : 80212 // Last Modified On : Sun Mar 10 16:10:32 2019 13 // Update Count : 976 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 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'; } 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'; } 57 56 static inline bool checkF( char c ) { return c == 'f' || c == 'F'; } 58 57 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'; } 59 61 static inline bool checkI( char c ) { return c == 'i' || c == 'I'; } 60 62 static inline bool checkB( char c ) { return c == 'b' || c == 'B'; } 61 63 static inline bool checkX( char c ) { return c == 'x' || c == 'X'; } 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; 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; 79 82 } else { // 128 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 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 95 109 96 110 Expression * build_constantInteger( string & str ) { 97 static const BasicType::Kind kind[2][ 6] = {98 // short (h) must be before char (hh) 111 static const BasicType::Kind kind[2][7] = { 112 // short (h) must be before char (hh) because shorter type has the longer suffix 99 113 { BasicType::ShortSignedInt, BasicType::SignedChar, BasicType::SignedInt, BasicType::LongSignedInt, BasicType::LongLongSignedInt, BasicType::SignedInt128, }, 100 114 { BasicType::ShortUnsignedInt, BasicType::UnsignedChar, BasicType::UnsignedInt, BasicType::LongUnsignedInt, BasicType::LongLongUnsignedInt, BasicType::UnsignedInt128, }, 101 115 }; 102 116 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 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 106 121 107 122 unsigned long long int v; // converted integral value 108 123 size_t last = str.length() - 1; // last subscript of constant 109 124 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 => int128 128 int ltype = -1; // 0 => 16 bits, 1 => 8 bits, 2 => 32 bits, 3 => 64 bits, 4 => size_t, 5 => intptr, 6 => pointer 129 bool dec = true, Unsigned = false; // decimal, unsigned constant 110 130 111 131 // special constants … … 119 139 } // if 120 140 121 // Cannot be "0"141 // Cannot be just "0"/"1"; sscanf stops at the suffix, if any; value goes over the wall => always generate 122 142 123 143 if ( str[0] == '0' ) { // radix character ? … … 127 147 //printf( "%llx %llu\n", v, v ); 128 148 } else if ( checkB( str[1] ) ) { // binary constant ? 129 v = 0; 130 for ( unsigned int i = 2;; i += 1 ) { // compute value149 v = 0; // compute value 150 for ( unsigned int i = 2;; ) { // ignore prefix 131 151 if ( str[i] == '1' ) v |= 1; 132 if ( i == last ) break; 152 i += 1; 153 if ( i == last - 1 || (str[i] != '0' && str[i] != '1') ) break; 133 154 v <<= 1; 134 155 } // for 135 //printf( "% llx %llu\n", v, v );156 //printf( "%#llx %llu\n", v, v ); 136 157 } else { // octal constant 137 158 sscanf( (char *)str.c_str(), "%llo", &v ); 138 //printf( "% llo %llu\n", v, v );159 //printf( "%#llo %llu\n", v, v ); 139 160 } // if 140 161 } else { // decimal constant ? 141 162 sscanf( (char *)str.c_str(), "%llu", &v ); 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; 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 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 ? 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 ) ); 170 221 } // 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 // Constant type is correct for overload resolving. 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 // 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][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 222 } // if 223 } // if 224 225 CLEANUP: ; 224 226 delete &str; // created by lex 225 227 return ret; … … 227 229 228 230 229 static inline void checkLNFloat( string & str, int & lnth, int & size ) { 230 string::size_type posn = str.find_first_of( "lL" ), start = posn; 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 231 240 if ( posn == string::npos ) return; 232 size = 2; // assume largest size 233 lnth = 0; 241 explnth = true; 234 242 posn += 1; // advance to size 235 243 if ( str[posn] == '3' ) { // 32 236 size = 0; 244 if ( str[last] != 'x' ) type = 6; 245 else type = 7; 237 246 } else if ( str[posn] == '6' ) { // 64 238 size = 1; 239 } else if ( str[posn] == '8' || str[posn] == '1' ) { // 80, 128 240 size = 2; 241 if ( str[posn] == '1' ) posn += 1; 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 242 258 } else { 243 259 assertf( false, "internal error, bad floating point length %s", str.c_str() ); 244 260 } // if 245 posn += 1; 246 str.erase( start, posn - start + 1 ); // remove length suffix 247 } // checkLNFloat 261 } // checkFnxFloat 248 262 249 263 250 264 Expression * build_constantFloat( string & str ) { 251 static const BasicType::Kind kind[2][ 3] = {252 { BasicType::Float, BasicType::Double, BasicType::LongDouble },253 { BasicType::FloatComplex, BasicType::DoubleComplex, BasicType::LongDoubleComplex },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 }, 254 268 }; 255 269 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 270 // floating-point constant has minimum of 2 characters 1. or .1 260 271 size_t last = str.length() - 1; 261 272 double v; 273 int type; // 0 => float, 1 => double, 3 => long double, ... 274 bool complx = false; // real, complex 275 bool explnth = false; // explicit literal length 262 276 263 277 sscanf( str.c_str(), "%lg", &v ); … … 269 283 270 284 if ( checkF( str[last] ) ) { // float ? 271 size = 0;285 type = 0; 272 286 } else if ( checkD( str[last] ) ) { // double ? 273 size = 1;287 type = 1; 274 288 } else if ( checkL( str[last] ) ) { // long double ? 275 size = 2; 289 type = 2; 290 } else if ( checkF80( str[last] ) ) { // __float80 ? 291 type = 3; 292 } else if ( checkF128( str[last] ) ) { // __float128 ? 293 type = 4; 276 294 } else { 277 size = 1; // double (default) 278 checkLNFloat( str, lnth, size ); 279 } // if 295 type = 1; // double (default if no suffix) 296 checkFnxFloat( str, last, explnth, type ); 297 } // if 298 280 299 if ( ! complx && checkI( str[last - 1] ) ) { // imaginary ? 281 300 complx = true; 282 301 } // if 283 302 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 );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 ); 288 307 } // if 289 308 -
src/Parser/ParseNode.h
r9d9a451 r53bb8f1 10 10 // Created On : Sat May 16 13:28:16 2015 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Thu Nov 1 20:54:53 201813 // Update Count : 8 5412 // Last Modified On : Wed Feb 13 17:36:49 2019 13 // Update Count : 867 14 14 // 15 15 … … 206 206 class DeclarationNode : public ParseNode { 207 207 public: 208 // These enumerations must harmonize with their names. 209 enum BasicType { Void, Bool, Char, Int, Float, Double, LongDouble, Int128, Float80, Float128, NoBasicType }; 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 }; 210 212 static const char * basicTypeNames[]; 211 enum ComplexType { Complex, Imaginary, NoComplexType };213 enum ComplexType { Complex, NoComplexType, Imaginary }; // Imaginary unsupported => parse, but make invisible and print error message 212 214 static const char * complexTypeNames[]; 213 215 enum Signedness { Signed, Unsigned, NoSignedness }; -
src/Parser/TypeData.cc
r9d9a451 r53bb8f1 10 10 // Created On : Sat May 16 15:12:51 2015 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Fri Nov 2 07:54:26 201813 // Update Count : 6 2412 // Last Modified On : Wed Feb 13 18:16:23 2019 13 // Update Count : 649 14 14 // 15 15 … … 666 666 667 667 case DeclarationNode::Float: 668 case DeclarationNode::Float80:669 case DeclarationNode::Float128:670 668 case DeclarationNode::Double: 671 669 case DeclarationNode::LongDouble: // not set until below 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 }, 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, }, 676 682 }; 677 683 … … 686 692 genTSError( DeclarationNode::lengthNames[ td->length ], td->basictype ); 687 693 } // if 694 if ( td->complextype == DeclarationNode::Imaginary ) { 695 genTSError( DeclarationNode::complexTypeNames[ td->complextype ], td->basictype ); 696 } // if 697 if ( (td->basictype == DeclarationNode::uuFloat80 || td->basictype == DeclarationNode::uuFloat128) && td->complextype == DeclarationNode::Complex ) { // gcc unsupported 698 genTSError( DeclarationNode::complexTypeNames[ td->complextype ], td->basictype ); 699 } // if 688 700 if ( td->length == DeclarationNode::Long ) { 689 701 const_cast<TypeData *>(td)->basictype = DeclarationNode::LongDouble; 690 702 } // if 691 703 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 701 704 ret = floattype[ td->complextype ][ td->basictype - DeclarationNode::Float ]; 705 //printf( "XXXX %d %d %d %d\n", td->complextype, td->basictype, DeclarationNode::Float, ret ); 702 706 break; 703 707 -
src/Parser/TypeData.h
r9d9a451 r53bb8f1 31 31 struct Aggregate_t { 32 32 DeclarationNode::Aggregate kind; 33 const std::string * name ;34 DeclarationNode * params ;35 ExpressionNode * actuals ; // holds actual parameters later applied to AggInst36 DeclarationNode * fields ;33 const std::string * name = nullptr; 34 DeclarationNode * params = nullptr; 35 ExpressionNode * actuals = nullptr; // holds actual parameters later applied to AggInst 36 DeclarationNode * fields = nullptr; 37 37 bool body; 38 38 bool anon; 39 39 40 40 bool tagged; 41 const std::string * parent ;41 const std::string * parent = nullptr; 42 42 }; 43 43 44 44 struct AggInst_t { 45 TypeData * aggregate ;46 ExpressionNode * params ;45 TypeData * aggregate = nullptr; 46 ExpressionNode * params = nullptr; 47 47 bool hoistType; 48 48 }; 49 49 50 50 struct Array_t { 51 ExpressionNode * dimension ;51 ExpressionNode * dimension = nullptr; 52 52 bool isVarLen; 53 53 bool isStatic; … … 55 55 56 56 struct Enumeration_t { 57 const std::string * name ;58 DeclarationNode * constants ;57 const std::string * name = nullptr; 58 DeclarationNode * constants = nullptr; 59 59 bool body; 60 60 bool anon; … … 62 62 63 63 struct Function_t { 64 mutable DeclarationNode * params ; // mutables modified in buildKRFunction65 mutable DeclarationNode * idList ; // old-style66 mutable DeclarationNode * oldDeclList ;67 StatementNode * body ;68 ExpressionNode * withExprs ; // expressions from function's with_clause64 mutable DeclarationNode * params = nullptr; // mutables modified in buildKRFunction 65 mutable DeclarationNode * idList = nullptr; // old-style 66 mutable DeclarationNode * oldDeclList = nullptr; 67 StatementNode * body = nullptr; 68 ExpressionNode * withExprs = nullptr; // expressions from function's with_clause 69 69 }; 70 70 71 71 struct Symbolic_t { 72 const std::string * name ;72 const std::string * name = nullptr; 73 73 bool isTypedef; // false => TYPEGENname, true => TYPEDEFname 74 DeclarationNode * params ;75 ExpressionNode * actuals ;76 DeclarationNode * assertions ;74 DeclarationNode * params = nullptr; 75 ExpressionNode * actuals = nullptr; 76 DeclarationNode * assertions = nullptr; 77 77 }; 78 78 79 79 struct Qualified_t { // qualified type S.T 80 TypeData * parent ;81 TypeData * child ;80 TypeData * parent = nullptr; 81 TypeData * child = nullptr; 82 82 }; 83 83 … … 93 93 94 94 Type::Qualifiers qualifiers; 95 DeclarationNode * forall ;95 DeclarationNode * forall = nullptr; 96 96 97 97 Aggregate_t aggregate; … … 102 102 Symbolic_t symbolic; 103 103 Qualified_t qualified; 104 DeclarationNode * tuple ;105 ExpressionNode * typeexpr ;104 DeclarationNode * tuple = nullptr; 105 ExpressionNode * typeexpr = nullptr; 106 106 107 107 TypeData( Kind k = Unknown ); -
src/Parser/lex.ll
r9d9a451 r53bb8f1 10 10 * Created On : Sat Sep 22 08:58:10 2001 11 11 * Last Modified By : Peter A. Buhr 12 * Last Modified On : Thu Nov 1 20:57:35 201813 * Update Count : 68712 * Last Modified On : Sun Mar 10 09:13:09 2019 13 * Update Count : 706 14 14 */ 15 15 … … 39 39 using namespace std; 40 40 41 #include "config.h" // configure info 41 42 #include "ParseNode.h" 42 43 #include "TypedefTable.h" … … 59 60 #define IDENTIFIER_RETURN() RETURN_VAL( typedefTable.isKind( yytext ) ) 60 61 #define ATTRIBUTE_RETURN() RETURN_VAL( ATTR_IDENTIFIER ) 62 63 #ifdef HAVE_KEYWORDS_FLOATXX // GCC >= 7 => keyword, otherwise typedef 64 #define FLOATXX(v) KEYWORD_RETURN(v); 65 #else 66 #define FLOATXX(v) IDENTIFIER_RETURN(); 67 #endif // HAVE_KEYWORDS_FLOATXX 61 68 62 69 void rm_underscore() { … … 92 99 hex_quad {hex}("_"?{hex}){3} 93 100 size_opt (8|16|32|64|128)? 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]))? 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]))? 96 105 97 106 octal_digits ({octal})|({octal}({octal}|"_")*{octal}) … … 112 121 // GCC: D (double) and iI (imaginary) suffixes, and DL (long double) 113 122 exponent "_"?[eE]"_"?[+-]?{decimal_digits} 114 floating_size 32|64|80|128115 floating_length ([fFdDlL ]|[lL]{floating_size})123 floating_size 16|32|32x|64|64x|80|128|128x 124 floating_length ([fFdDlLwWqQ]|[fF]{floating_size}) 116 125 floating_suffix ({floating_length}?[iI]?)|([iI]{floating_length}) 117 126 floating_suffix_opt ("_"?({floating_suffix}|"DL"))? … … 240 249 finally { KEYWORD_RETURN(FINALLY); } // CFA 241 250 float { KEYWORD_RETURN(FLOAT); } 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 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 252 262 for { KEYWORD_RETURN(FOR); } 253 263 forall { KEYWORD_RETURN(FORALL); } // CFA -
src/Parser/module.mk
r9d9a451 r53bb8f1 31 31 Parser/parserutility.cc 32 32 33 MOSTLYCLEANFILES += Parser/parser.hh Parser/parser.output 33 SRCDEMANGLE += \ 34 Parser/LinkageSpec.cc 35 36 37 MOSTLYCLEANFILES += Parser/lex.cc Parser/parser.cc Parser/parser.hh Parser/parser.output -
src/Parser/parser.yy
r9d9a451 r53bb8f1 10 10 // Created On : Sat Sep 1 20:22:55 2001 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Thu Nov 8 18:08:23 201813 // Update Count : 4 05212 // Last Modified On : Thu Feb 21 08:45:07 2019 13 // Update Count : 4232 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 //cur->addType( specifier ); 102 for ( cur = dynamic_cast< DeclarationNode * >( cur->get_next() ); cur != nullptr; cur = dynamic_cast< DeclarationNode * >( cur->get_next() ) ) { 101 for ( cur = dynamic_cast<DeclarationNode *>( cur->get_next() ); cur != nullptr; cur = dynamic_cast<DeclarationNode *>( cur->get_next() ) ) { 103 102 cl->cloneBaseType( cur ); 104 103 } // for 105 104 declList->addType( cl ); 106 // delete cl;107 105 return declList; 108 106 } // distAttr … … 193 191 return new ForCtrl( 194 192 distAttr( DeclarationNode::newTypeof( type, true ), DeclarationNode::newName( index )->addInitializer( new InitializerNode( start ) ) ), 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 ) ) ); 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 ); 198 197 } // forCtrl 199 198 … … 201 200 if ( NameExpr * identifier = dynamic_cast<NameExpr *>(index->get_expr()) ) { 202 201 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 } // if 203 208 } else { 204 209 SemanticError( yylloc, "Expression disallowed. Only loop-index name allowed" ); return nullptr; … … 263 268 %token VOID CHAR SHORT INT LONG FLOAT DOUBLE SIGNED UNSIGNED 264 269 %token BOOL COMPLEX IMAGINARY // C99 265 %token INT128 FLOAT80 FLOAT128 // GCC 270 %token INT128 uuFLOAT80 uuFLOAT128 // GCC 271 %token uFLOAT16 uFLOAT32 uFLOAT32X uFLOAT64 uFLOAT64X uFLOAT128 // GCC 266 272 %token ZERO_T ONE_T // CFA 267 273 %token VALIST // GCC … … 324 330 %type<en> argument_expression_list argument_expression default_initialize_opt 325 331 %type<ifctl> if_control_expression 326 %type<fctl> for_control_expression 332 %type<fctl> for_control_expression for_control_expression_list 327 333 %type<compop> inclexcl 328 334 %type<en> subrange … … 984 990 // labels cannot be identifiers 0 or 1 or ATTR_IDENTIFIER 985 991 identifier_or_type_name ':' attribute_list_opt statement 986 { 987 $$ = $4->add_label( $1, $3 ); 988 } 992 { $$ = $4->add_label( $1, $3 ); } 989 993 ; 990 994 … … 1002 1006 statement_decl 1003 1007 | statement_decl_list statement_decl 1004 { if ( $1 != 0 ) { $1->set_last( $2 ); $$ = $1; }}1008 { assert( $1 ); $1->set_last( $2 ); $$ = $1; } 1005 1009 ; 1006 1010 … … 1009 1013 { $$ = new StatementNode( $1 ); } 1010 1014 | EXTENSION declaration // GCC 1011 { 1012 distExt( $2 ); 1013 $$ = new StatementNode( $2 ); 1014 } 1015 { distExt( $2 ); $$ = new StatementNode( $2 ); } 1015 1016 | function_definition 1016 1017 { $$ = new StatementNode( $1 ); } 1017 1018 | EXTENSION function_definition // GCC 1018 { 1019 distExt( $2 ); 1020 $$ = new StatementNode( $2 ); 1021 } 1019 { distExt( $2 ); $$ = new StatementNode( $2 ); } 1022 1020 | statement 1023 1021 ; … … 1026 1024 statement 1027 1025 | statement_list_nodecl statement 1028 { if ( $1 != 0 ) { $1->set_last( $2 ); $$ = $1; }}1026 { assert( $1 ); $1->set_last( $2 ); $$ = $1; } 1029 1027 ; 1030 1028 … … 1138 1136 | DO statement WHILE '(' ')' ';' // CFA => do while( 1 ) 1139 1137 { $$ = new StatementNode( build_do_while( new ExpressionNode( build_constantInteger( *new string( "1" ) ) ), $2 ) ); } 1140 | FOR '(' push for_control_expression ')' statement pop1138 | FOR '(' push for_control_expression_list ')' statement pop 1141 1139 { $$ = new StatementNode( build_for( $4, $6 ) ); } 1142 1140 | FOR '(' ')' statement // CFA => for ( ;; ) … … 1144 1142 ; 1145 1143 1144 for_control_expression_list: 1145 for_control_expression 1146 | for_control_expression_list ':' for_control_expression 1147 { $$ = $3; } 1148 ; 1149 1146 1150 for_control_expression: 1147 comma_expression // CFA 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 1148 1158 { $$ = forCtrl( $1, new string( DeclarationNode::anonymous.newName() ), new ExpressionNode( build_constantInteger( *new string( "0" ) ) ), 1149 1159 OperKinds::LThan, $1->clone(), new ExpressionNode( build_constantInteger( *new string( "1" ) ) ) ); } 1150 | co nstant_expression inclexcl constant_expression// CFA1160 | comma_expression inclexcl comma_expression // CFA 1151 1161 { $$ = forCtrl( $1, new string( DeclarationNode::anonymous.newName() ), $1->clone(), $2, $3, new ExpressionNode( build_constantInteger( *new string( "1" ) ) ) ); } 1152 | co nstant_expression inclexcl constant_expression '~' constant_expression // CFA1162 | comma_expression inclexcl comma_expression '~' comma_expression // CFA 1153 1163 { $$ = forCtrl( $1, new string( DeclarationNode::anonymous.newName() ), $1->clone(), $2, $3, $5 ); } 1154 1164 | comma_expression ';' comma_expression // CFA 1155 1165 { $$ = forCtrl( $3, $1, new ExpressionNode( build_constantInteger( *new string( "0" ) ) ), 1156 1166 OperKinds::LThan, $3->clone(), new ExpressionNode( build_constantInteger( *new string( "1" ) ) ) ); } 1157 | comma_expression ';' co nstant_expression inclexcl constant_expression // CFA1167 | comma_expression ';' comma_expression inclexcl comma_expression // CFA 1158 1168 { $$ = forCtrl( $3, $1, $3->clone(), $4, $5, new ExpressionNode( build_constantInteger( *new string( "1" ) ) ) ); } 1159 | comma_expression ';' co nstant_expression inclexcl constant_expression '~' constant_expression // CFA1169 | comma_expression ';' comma_expression inclexcl comma_expression '~' comma_expression // CFA 1160 1170 { $$ = forCtrl( $3, $1, $3->clone(), $4, $5, $7 ); } 1161 | comma_expression ';' comma_expression _opt ';' comma_expression_opt1162 { $$ = new ForCtrl( $1, $3, $5); }1163 | ';' comma_expression_opt ';' comma_expression_opt1164 { $$ = new ForCtrl( (ExpressionNode * )nullptr, $2, $4); }1165 | declaration comma_expression_opt ';' comma_expression_opt // C99, declaration has ';'1166 { $$ = new ForCtrl( $1, $2, $4); }1171 | comma_expression ';' comma_expression '~' '@' '~' comma_expression // CFA 1172 { $$ = forCtrl( $3, $1, $3->clone(), OperKinds::LThan, nullptr, $7 ); } 1173 | comma_expression ';' comma_expression ErangeDown '@' '~' comma_expression // CFA 1174 { $$ = forCtrl( $3, $1, $3->clone(), OperKinds::GThan, nullptr, $7 ); } 1175 | comma_expression ';' comma_expression '~' '@' '~' '@' // CFA 1176 { $$ = forCtrl( $3, $1, $3->clone(), OperKinds::LThan, nullptr, nullptr ); } 1167 1177 ; 1168 1178 … … 1771 1781 | FLOAT 1772 1782 { $$ = DeclarationNode::newBasicType( DeclarationNode::Float ); } 1773 | FLOAT801774 { $$ = DeclarationNode::newBasicType( DeclarationNode::Float80 ); }1775 | FLOAT1281776 { $$ = DeclarationNode::newBasicType( DeclarationNode::Float128 ); }1777 1783 | DOUBLE 1778 1784 { $$ = DeclarationNode::newBasicType( DeclarationNode::Double ); } 1785 | uuFLOAT80 1786 { $$ = DeclarationNode::newBasicType( DeclarationNode::uuFloat80 ); } 1787 | uuFLOAT128 1788 { $$ = DeclarationNode::newBasicType( DeclarationNode::uuFloat128 ); } 1789 | uFLOAT16 1790 { $$ = DeclarationNode::newBasicType( DeclarationNode::uFloat16 ); } 1791 | uFLOAT32 1792 { $$ = DeclarationNode::newBasicType( DeclarationNode::uFloat32 ); } 1793 | uFLOAT32X 1794 { $$ = DeclarationNode::newBasicType( DeclarationNode::uFloat32x ); } 1795 | uFLOAT64 1796 { $$ = DeclarationNode::newBasicType( DeclarationNode::uFloat64 ); } 1797 | uFLOAT64X 1798 { $$ = DeclarationNode::newBasicType( DeclarationNode::uFloat64x ); } 1799 | uFLOAT128 1800 { $$ = DeclarationNode::newBasicType( DeclarationNode::uFloat128 ); } 1779 1801 | COMPLEX // C99 1780 1802 { $$ = DeclarationNode::newComplexType( DeclarationNode::Complex ); } -
src/ResolvExpr/AlternativeFinder.cc
r9d9a451 r53bb8f1 474 474 } 475 475 476 // mark specialization cost of return types 477 for ( DeclarationWithType* returnVal : function->returnVals ) { 478 convCost.decSpec( specCost( returnVal->get_type() ) ); 479 } 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 // } 480 483 481 484 // mark type variable and specialization cost of forall clause … … 483 486 for ( TypeDecl* td : function->forall ) { 484 487 convCost.decSpec( td->assertions.size() ); 485 }486 487 // xxx -- replace with new costs in resolver488 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 );490 488 } 491 489 … … 1229 1227 Alternative newAlt{ 1230 1228 restructureCast( alt.expr->clone(), toType, castExpr->isGenerated ), 1231 alt.env, openVars, needAssertions, alt.cost + thisCost,thisCost };1229 alt.env, openVars, needAssertions, alt.cost, alt.cost + thisCost }; 1232 1230 inferParameters( newAlt, back_inserter( candidates ) ); 1233 1231 } // if -
src/ResolvExpr/CommonType.cc
r9d9a451 r53bb8f1 10 10 // Created On : Sun May 17 06:59:27 2015 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Mon Sep 25 15:18:17 201713 // Update Count : 912 // Last Modified On : Thu Feb 14 17:10:10 2019 13 // Update Count : 24 14 14 // 15 15 … … 176 176 } 177 177 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 }; 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 207 480 static_assert( 208 sizeof(com binedType)/sizeof(combinedType[0][0]) == BasicType::NUMBER_OF_BASIC_TYPES*BasicType::NUMBER_OF_BASIC_TYPES,481 sizeof(commonTypes)/sizeof(commonTypes[0][0]) == BasicType::NUMBER_OF_BASIC_TYPES*BasicType::NUMBER_OF_BASIC_TYPES, 209 482 "Each basic type kind should have a corresponding row in the combined type matrix" 210 483 ); … … 218 491 void CommonType::postvisit( BasicType *basicType ) { 219 492 if ( BasicType *otherBasic = dynamic_cast< BasicType* >( type2 ) ) { 220 BasicType::Kind newType = com binedType[ basicType->get_kind() ][ otherBasic->get_kind() ];493 BasicType::Kind newType = commonTypes[ basicType->get_kind() ][ otherBasic->get_kind() ]; 221 494 if ( ( ( newType == basicType->get_kind() && basicType->get_qualifiers() >= otherBasic->get_qualifiers() ) || widenFirst ) && ( ( newType == otherBasic->get_kind() && basicType->get_qualifiers() <= otherBasic->get_qualifiers() ) || widenSecond ) ) { 222 495 result = new BasicType( basicType->get_qualifiers() | otherBasic->get_qualifiers(), newType ); … … 224 497 } else if ( dynamic_cast< EnumInstType * > ( type2 ) || dynamic_cast< ZeroType* >( type2 ) || dynamic_cast< OneType* >( type2 ) ) { 225 498 // use signed int in lieu of the enum/zero/one type 226 BasicType::Kind newType = com binedType[ basicType->get_kind() ][ BasicType::SignedInt ];499 BasicType::Kind newType = commonTypes[ basicType->get_kind() ][ BasicType::SignedInt ]; 227 500 if ( ( ( newType == basicType->get_kind() && basicType->get_qualifiers() >= type2->get_qualifiers() ) || widenFirst ) && ( ( newType != basicType->get_kind() && basicType->get_qualifiers() <= type2->get_qualifiers() ) || widenSecond ) ) { 228 501 result = new BasicType( basicType->get_qualifiers() | type2->get_qualifiers(), newType ); -
src/ResolvExpr/ConversionCost.cc
r9d9a451 r53bb8f1 10 10 // Created On : Sun May 17 07:06:19 2015 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Mon Sep 25 15:43:34 201713 // Update Count : 1012 // Last Modified On : Thu Feb 14 17:04:31 2019 13 // Update Count : 23 14 14 // 15 15 … … 28 28 29 29 namespace ResolvExpr { 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 }; 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 }; 38 39 39 40 #if 0 … … 42 43 #define PRINT(x) 43 44 #endif 45 44 46 Cost conversionCost( Type *src, Type *dest, const SymTab::Indexer &indexer, const TypeEnvironment &env ) { 45 47 if ( TypeInstType *destAsTypeInst = dynamic_cast< TypeInstType* >( dest ) ) { … … 179 181 } 180 182 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 }; 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 263 250 static_assert( 264 251 sizeof(costMatrix)/sizeof(costMatrix[0][0]) == BasicType::NUMBER_OF_BASIC_TYPES*BasicType::NUMBER_OF_BASIC_TYPES, 265 " Each basic type kind should have a corresponding row in the cost matrix"252 "Missing row in the cost matrix" 266 253 ); 267 254 255 // GENERATED START, DO NOT EDIT 256 // GENERATED BY BasicTypes-gen.cc 257 static const int signMatrix[BasicType::NUMBER_OF_BASIC_TYPES][BasicType::NUMBER_OF_BASIC_TYPES] = { // number of sign changes in safe conversion 258 /* 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 }; // signMatrix 296 // GENERATED END 297 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 ); 268 301 269 302 void ConversionCost::postvisit( VoidType * ) { … … 279 312 cost = Cost::zero; 280 313 cost.incSafe( tableResult ); 314 cost.incSign( signMatrix[ basicType->get_kind() ][ destAsBasic->get_kind() ] ); 281 315 } // if 282 316 } else if ( dynamic_cast< EnumInstType *>( dest ) ) { … … 300 334 // types are the same, except otherPointer has more qualifiers 301 335 cost = Cost::safe; 302 } 336 } // if 303 337 } else { 304 338 int assignResult = ptrsAssignable( pointerType->base, destAsPtr->base, env ); … … 422 456 cost = Cost::zero; 423 457 cost.incSafe( tableResult + 1 ); 424 } 458 cost.incSign( signMatrix[ BasicType::SignedInt ][ destAsBasic->get_kind() ] ); 459 } // if 425 460 } else if ( dynamic_cast< PointerType* >( dest ) ) { 426 461 cost = Cost::safe; 427 } 462 } // if 428 463 } 429 464 … … 439 474 cost = Cost::zero; 440 475 cost.incSafe( tableResult + 1 ); 441 } 442 } 476 cost.incSign( signMatrix[ BasicType::SignedInt ][ destAsBasic->get_kind() ] ); 477 } // if 478 } // if 443 479 } 444 480 } // namespace ResolvExpr -
src/ResolvExpr/Cost.h
r9d9a451 r53bb8f1 9 9 // Author : Richard C. Bilson 10 10 // Created On : Sun May 17 09:39:50 2015 11 // Last Modified By : Aaron B. Moss12 // Last Modified On : Fri Oct 05 14:32:00 201813 // Update Count : 711 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Thu Feb 7 20:54:29 2019 13 // Update Count : 8 14 14 // 15 15 … … 21 21 class Cost { 22 22 private: 23 Cost( int unsafeCost, int polyCost, int safeCost, int varCost, int specCost, 24 int referenceCost ); 25 23 Cost( int unsafeCost, int polyCost, int safeCost, int signCost, 24 int varCost, int specCost, int referenceCost ); 26 25 public: 27 26 Cost & incUnsafe( int inc = 1 ); 28 27 Cost & incPoly( int inc = 1 ); 29 28 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; } 37 38 int get_varCost() const { return varCost; } 38 39 int get_specCost() const { return specCost; } … … 40 41 41 42 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; 57 58 static const Cost var; 58 59 static const Cost spec; … … 63 64 int polyCost; ///< Count of parameters and return values bound to some poly type 64 65 int safeCost; ///< Safe (widening) conversions 66 int signCost; ///< Count of safe sign conversions 65 67 int varCost; ///< Count of polymorphic type variables 66 68 int specCost; ///< Polymorphic type specializations (type assertions), negative cost … … 68 70 }; 69 71 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 ) {}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 ) {} 74 76 75 77 inline Cost & Cost::incUnsafe( int inc ) { … … 88 90 if ( *this == infinity ) return *this; 89 91 safeCost += inc; 92 return *this; 93 } 94 95 inline Cost & Cost::incSign( int inc ) { 96 if ( *this == infinity ) return *this; 97 signCost += inc; 90 98 return *this; 91 99 } … … 111 119 inline Cost Cost::operator+( const Cost &other ) const { 112 120 if ( *this == infinity || other == infinity ) return infinity; 113 return Cost{ 114 unsafeCost + other.unsafeCost, polyCost + other.polyCost, safeCost + other.safeCost, 115 varCost + other.varCost, specCost + other.specCost,121 return Cost{ 122 unsafeCost + other.unsafeCost, polyCost + other.polyCost, safeCost + other.safeCost, 123 signCost + other.signCost, varCost + other.varCost, specCost + other.specCost, 116 124 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; 136 137 varCost += other.varCost; 137 138 specCost += other.specCost; … … 156 157 } else if ( safeCost < other.safeCost ) { 157 158 return true; 159 } else if ( signCost > other.signCost ) { 160 return false; 161 } else if ( signCost < other.signCost ) { 162 return true; 158 163 } else if ( varCost > other.varCost ) { 159 164 return false; … … 180 185 c = polyCost - other.polyCost; if ( c ) return c; 181 186 c = safeCost - other.safeCost; if ( c ) return c; 187 c = signCost - other.signCost; if ( c ) return c; 182 188 c = varCost - other.varCost; if ( c ) return c; 183 189 c = specCost - other.specCost; if ( c ) return c; … … 189 195 && polyCost == other.polyCost 190 196 && safeCost == other.safeCost 197 && signCost == other.signCost 191 198 && varCost == other.varCost 192 199 && specCost == other.specCost … … 199 206 200 207 inline std::ostream &operator<<( std::ostream &os, const Cost &cost ) { 201 return os << "( " << cost.unsafeCost << ", " << cost.polyCost << ", " 202 << cost.safeCost << ", " << cost.varCost << ", " << cost.specCost << ", " 208 return os << "( " << cost.unsafeCost << ", " << cost.polyCost << ", " 209 << cost.safeCost << ", " << cost.signCost << ", " 210 << cost.varCost << ", " << cost.specCost << ", " 203 211 << cost.referenceCost << " )"; 204 212 } -
src/ResolvExpr/ResolveAssertions.cc
r9d9a451 r53bb8f1 20 20 #include <list> // for list 21 21 #include <memory> // for unique_ptr 22 #include <string> 22 23 #include <unordered_map> // for unordered_map, unordered_multimap 23 24 #include <utility> // for move … … 55 56 using CandidateList = std::vector<AssnCandidate>; 56 57 58 /// Unique identifier for a yet-to-be-resolved assertion 59 struct AssnId { 60 DeclarationWithType* decl; ///< Declaration of assertion 61 AssertionSetValue info; ///< Information about assertion 62 63 AssnId(DeclarationWithType* decl, const AssertionSetValue& info) : decl(decl), info(info) {} 64 }; 65 66 /// Cached assertion items 67 struct AssnCacheItem { 68 CandidateList matches; ///< Possible matches for this assertion 69 std::vector<AssnId> deferIds; ///< Deferred assertions which resolve to this item 70 71 AssnCacheItem( CandidateList&& m ) : matches(std::move(m)), deferIds() {} 72 }; 73 74 /// Cache of resolved assertions 75 using AssnCache = std::unordered_map<std::string, AssnCacheItem>; 76 57 77 /// Reference to single deferred item 58 78 struct DeferRef { 59 const DeclarationWithType* decl; 60 const AssertionSetValue& info; 79 const AssnCacheItem& item; 61 80 const AssnCandidate& match; 62 81 }; … … 65 84 /// Acts like indexed list of DeferRef 66 85 struct DeferItem { 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] }; } 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; } 80 105 }; 81 106 … … 152 177 for ( const auto& assn : x.assns ) { 153 178 k += computeConversionCost( 154 assn.match.adjType, assn.decl->get_type(), indexer, x.env ); 179 assn.match.adjType, assn.item.deferIds[0].decl->get_type(), indexer, 180 x.env ); 155 181 } 156 182 it = cache.emplace_hint( it, &x, k ); … … 208 234 candidate->get_uniqueId(), match.adjType->clone(), decl->get_type()->clone(), 209 235 varExpr }; 210 211 // // follow the current assertion's ID chain to find the correct set of inferred parameters212 // // to add the candidate o (i.e. the set of inferred parameters belonging to the entity213 // // 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 };221 236 } 222 237 223 238 /// Adds a captured assertion to the symbol table 224 239 void addToIndexer( AssertionSet &assertSet, SymTab::Indexer &indexer ) { 225 for ( AssertionSet::iterator i = assertSet.begin(); i != assertSet.end(); ++i) {226 if ( i ->second.isUsed ) {227 indexer.addId( i ->first );240 for ( auto& i : assertSet ) { 241 if ( i.second.isUsed ) { 242 indexer.addId( i.first ); 228 243 } 229 244 } … … 234 249 235 250 /// Resolve a single assertion, in context 236 bool resolveAssertion( AssertionItem& assn, ResnState& resn ) {251 bool resolveAssertion( AssertionItem& assn, ResnState& resn, AssnCache& cache ) { 237 252 // skip unused assertions 238 253 if ( ! assn.info.isUsed ) return true; 239 254 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; 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 } 266 288 } 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; 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 } 278 295 } 279 } 296 297 it = cache.emplace_hint( it, assnKey, AssnCacheItem{ std::move(matches) } ); 298 } 299 300 CandidateList& matches = it->second.matches; 280 301 281 302 // break if no suitable assertion … … 284 305 // defer if too many suitable assertions 285 306 if ( matches.size() > 1 ) { 286 resn.deferred.emplace_back( assn.decl, assn.info, std::move(matches) ); 307 it->second.deferIds.emplace_back( assn.decl, assn.info ); 308 resn.deferred.emplace_back( cache, assnKey ); 287 309 return true; 288 310 } … … 292 314 addToIndexer( match.have, resn.indexer ); 293 315 resn.newNeed.insert( match.need.begin(), match.need.end() ); 294 resn.alt.env = std::move(match.env);295 resn.alt.openVars = std::move(match.openVars);316 resn.alt.env = match.env; 317 resn.alt.openVars = match.openVars; 296 318 297 319 bindAssertion( assn.decl, assn.info, resn.alt, match, resn.inferred ); … … 354 376 ResnList resns{ ResnState{ alt, root_indexer } }; 355 377 ResnList new_resns{}; 378 AssnCache assnCache; 356 379 357 380 // resolve assertions in breadth-first-order up to a limited number of levels deep … … 362 385 for ( auto& assn : resn.need ) { 363 386 // fail early if any assertion is not resolvable 364 if ( ! resolveAssertion( assn, resn ) ) goto nextResn;387 if ( ! resolveAssertion( assn, resn, assnCache ) ) goto nextResn; 365 388 } 366 389 … … 373 396 } 374 397 } else { 398 // only resolve each deferred assertion once 399 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() ); 375 402 // resolve deferred assertions by mutual compatibility 376 403 std::vector<CandidateEnvMerger::OutType> compatible = filterCombos( … … 380 407 CandidateCost coster{ resn.indexer }; 381 408 std::sort( compatible.begin(), compatible.end(), coster ); 382 // // sort by cost if pruning383 // if ( pruneAssertions ) {384 // auto lmin = sort_mins( compatible.begin(), compatible.end(),385 // CandidateCost{resn.indexer} );386 // compatible.erase( lmin, compatible.end() );387 // }388 409 389 410 // keep map of detected options … … 408 429 new_resn.newNeed.insert( match.need.begin(), match.need.end() ); 409 430 410 bindAssertion( r.decl, r.info, new_resn.alt, match, new_resn.inferred ); 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 } 411 436 } 412 437 -
src/ResolvExpr/Resolver.cc
r9d9a451 r53bb8f1 9 9 // Author : Richard C. Bilson 10 10 // Created On : Sun May 17 12:17:01 2015 11 // Last Modified By : Aaron B. Moss12 // Last Modified On : Fri Oct 05 09:43:00 201813 // Update Count : 2 1411 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Tue Feb 19 18:09:56 2019 13 // Update Count : 240 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 static CastExpr untyped( nullptr ); // cast to void292 untyped .location = expr->location;291 CastExpr * untyped = new CastExpr( expr ); // cast to void 292 untyped->location = expr->location; 293 293 294 294 // set up and resolve expression cast to void 295 untyped.arg = expr;296 295 Alternative choice; 297 findUnfinishedKindExpression( &untyped, choice, indexer, "", standardAlternativeFilter, ResolvMode::withAdjustment() );296 findUnfinishedKindExpression( untyped, choice, indexer, "", standardAlternativeFilter, ResolvMode::withAdjustment() ); 298 297 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
r9d9a451 r53bb8f1 10 10 // Created On : Sun May 17 12:18:34 2015 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Sat Jul 22 09:36:57 201713 // Update Count : 312 // Last Modified On : Mon Feb 18 20:40:38 2019 13 // Update Count : 4 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
r9d9a451 r53bb8f1 15 15 ############################################################################### 16 16 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 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) -
src/ResolvExpr/typeops.h
r9d9a451 r53bb8f1 10 10 // Created On : Sun May 17 07:28:22 2015 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Sat Jul 22 09:36:18 201713 // Update Count : 312 // Last Modified On : Fri Feb 8 09:30:34 2019 13 // Update Count : 4 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
r9d9a451 r53bb8f1 26 26 #include "Common/SemanticError.h" // for SemanticError 27 27 #include "Common/utility.h" // for cloneAll 28 #include "Common/Stats/Counter.h" // for counters 28 29 #include "GenPoly/GenPoly.h" 29 30 #include "InitTweak/InitTweak.h" // for isConstructor, isCopyFunction, isC... … … 41 42 42 43 namespace SymTab { 44 45 // Statistics block 46 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 43 81 std::ostream & operator<<( std::ostream & out, const Indexer::IdData & data ) { 44 82 return out << "(" << data.id << "," << data.baseExpr << ")"; … … 197 235 } 198 236 199 Indexer::Indexer() : tables( 0 ), scope( 0 ) {} 200 201 Indexer::Indexer( const Indexer &that ) : doDebug( that.doDebug ), tables( newRef( that.tables ) ), scope( that.scope ) {} 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 } 202 244 203 245 Indexer::Indexer( Indexer &&that ) : doDebug( that.doDebug ), tables( that.tables ), scope( that.scope ) { … … 206 248 207 249 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 } 208 259 deleteRef( tables ); 209 260 } … … 237 288 while ( searchTables ) { 238 289 290 (*stats_idtable().find)++; 291 stats_idtable().key->push( id.size() ); 292 stats_idtable().size->push( searchTables->idTable.size() ); 239 293 IdTable::const_iterator decls = searchTables->idTable.find( id ); 240 294 if ( decls != searchTables->idTable.end() ) { … … 313 367 if ( tables->scope < scope ) return nullptr; 314 368 369 (*stats_idtable().find)++; 370 stats_idtable().key->push( id.size() ); 371 stats_idtable().size->push( tables->idTable.size() ); 315 372 IdTable::const_iterator decls = tables->idTable.find( id ); 316 373 if ( decls != tables->idTable.end() ) { … … 331 388 if ( tables->scope < scope ) return false; 332 389 390 (*stats_idtable().find)++; 391 stats_idtable().key->push( id.size() ); 392 stats_idtable().size->push( tables->idTable.size() ); 333 393 IdTable::const_iterator decls = tables->idTable.find( id ); 334 394 if ( decls != tables->idTable.end() ) { … … 347 407 if ( tables->scope < scope ) return false; 348 408 409 (*stats_idtable().find)++; 410 stats_idtable().key->push( id.size() ); 411 stats_idtable().size->push( tables->idTable.size() ); 349 412 IdTable::const_iterator decls = tables->idTable.find( id ); 350 413 if ( decls != tables->idTable.end() ) { -
src/SymTab/Mangler.cc
r9d9a451 r53bb8f1 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 "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... 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... 32 33 33 34 namespace SymTab { … … 37 38 struct Mangler : public WithShortCircuiting, public WithVisitorRef<Mangler>, public WithGuards { 38 39 Mangler( bool mangleOverridable, bool typeMode, bool mangleGenericParams ); 40 Mangler( const ResolvExpr::TypeEnvironment& env ); 39 41 Mangler( const Mangler & ) = delete; 40 42 … … 65 67 private: 66 68 std::ostringstream mangleName; ///< Mangled name being constructed 67 typedef std::map< std::string, std::pair< int, int > > VarMapType;69 typedef std::map< std::string, std::pair< std::string, int > > VarMapType; 68 70 VarMapType varNums; ///< Map of type variables to indices 69 71 int nextVarNum; ///< Next type variable index 72 const ResolvExpr::TypeEnvironment* env; ///< optional environment for substitutions 70 73 bool isTopLevel; ///< Is the Mangler at the top level 71 74 bool mangleOverridable; ///< Specially mangle overridable built-in methods … … 75 78 bool inQualifiedType = false; ///< Add start/end delimiters around qualified type 76 79 80 public: 81 Mangler( bool mangleOverridable, bool typeMode, bool mangleGenericParams, 82 int nextVarNum, const ResolvExpr::TypeEnvironment* env, 83 const VarMapType& varNums ); 84 85 private: 77 86 void mangleDecl( DeclarationWithType *declaration ); 78 87 void mangleRef( ReferenceToType *refType, std::string prefix ); … … 100 109 } 101 110 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 102 118 namespace { 103 119 Mangler::Mangler( bool mangleOverridable, bool typeMode, bool mangleGenericParams ) 104 : nextVarNum( 0 ), isTopLevel( true ), mangleOverridable( mangleOverridable ), typeMode( typeMode ), mangleGenericParams( 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 ) {} 105 134 106 135 void Mangler::mangleDecl( DeclarationWithType * declaration ) { … … 329 358 assert( false ); 330 359 } // switch 331 varNums[ (*i)->name ] = std::pair< int, int >( nextVarNum++, (int)(*i)->get_kind() ); 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() ); 332 377 for ( std::list< DeclarationWithType* >::iterator assert = (*i)->assertions.begin(); assert != (*i)->assertions.end(); ++assert ) { 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; 378 PassVisitor<Mangler> sub_mangler( 379 mangleOverridable, typeMode, mangleGenericParams, nextVarNum, env, 380 varNums ); 337 381 (*assert)->accept( sub_mangler ); 338 assertionNames.push_back( sub_mangler.pass. mangleName.str() );382 assertionNames.push_back( sub_mangler.pass.get_mangleName() ); 339 383 acount++; 340 384 } // for -
src/SymTab/Mangler.h
r9d9a451 r53bb8f1 31 31 // * Currently name compression is not implemented. 32 32 33 namespace ResolvExpr { 34 class TypeEnvironment; 35 } 36 33 37 namespace SymTab { 34 38 namespace Mangler { … … 40 44 /// Mangle ignoring generic type parameters 41 45 std::string mangleConcrete( Type* ty ); 46 /// Mangle for assertion key 47 std::string mangleAssnKey( DeclarationWithType* decl, 48 const ResolvExpr::TypeEnvironment& env ); 42 49 43 50 namespace Encoding { -
src/SymTab/ManglerCommon.cc
r9d9a451 r53bb8f1 10 10 // Created On : Sun May 17 21:44:03 2015 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Sat Jul 22 09:45:30 201713 // Update Count : 1512 // Last Modified On : Thu Feb 14 17:06:37 2019 13 // Update Count : 26 14 14 // 15 15 … … 23 23 const std::string manglePrefix = "_X"; 24 24 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 }; 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 61 80 static_assert( 62 81 sizeof(basicTypes)/sizeof(basicTypes[0]) == BasicType::NUMBER_OF_BASIC_TYPES, -
src/SymTab/Validate.cc
r9d9a451 r53bb8f1 49 49 #include "CodeGen/OperatorTable.h" // for isCtorDtor, isCtorDtorAssign 50 50 #include "ControlStruct/Mutate.h" // for ForExprMutator 51 #include "Common/Stats.h" // for Stats::Heap 51 52 #include "Common/PassVisitor.h" // for PassVisitor, WithDeclsToAdd 52 53 #include "Common/ScopedMap.h" // for ScopedMap … … 303 304 PassVisitor<FixQualifiedTypes> fixQual; 304 305 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 ); 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 } 330 389 } 331 390 -
src/SymTab/module.mk
r9d9a451 r53bb8f1 15 15 ############################################################################### 16 16 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 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 -
src/SynTree/AddressExpr.cc
r9d9a451 r53bb8f1 9 9 // Author : Richard C. Bilson 10 10 // Created On : Sun May 17 23:54:44 2015 11 // Last Modified By : Rob Schluntz12 // Last Modified On : T ue Apr 26 12:35:13 201613 // Update Count : 611 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Thu Feb 28 13:13:38 2019 13 // Update Count : 10 14 14 // 15 15 … … 47 47 } else { 48 48 // taking address of non-lvalue -- must be a reference, loses one layer of reference 49 ReferenceType * refType = strict_dynamic_cast< ReferenceType * >( arg->result ); 50 set_result( addrType( refType->base ) ); 49 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 51 54 } 52 55 // result of & is never an lvalue -
src/SynTree/BasicType.cc
r9d9a451 r53bb8f1 10 10 // Created On : Mon May 18 07:44:20 2015 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Mon Sep 25 14:14:03 201713 // Update Count : 1 112 // Last Modified On : Thu Jan 31 21:37:36 2019 13 // Update Count : 12 14 14 // 15 15 … … 30 30 31 31 bool BasicType::isInteger() const { 32 return kind <= UnsignedInt128; 33 #if 0 32 34 switch ( kind ) { 33 35 case Bool: … … 63 65 assert( false ); 64 66 return false; 67 #endif 65 68 } 66 69 -
src/SynTree/Constant.cc
r9d9a451 r53bb8f1 9 9 // Author : Richard C. Bilson 10 10 // Created On : Mon May 18 07:44:20 2015 11 // Last Modified By : Andrew Beach12 // Last Modified On : Fri Spt 28 14:49:00 201813 // Update Count : 3 011 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Wed Feb 13 18:11:22 2019 13 // Update Count : 32 14 14 // 15 15 -
src/SynTree/Expression.cc
r9d9a451 r53bb8f1 10 10 // Created On : Mon May 18 07:44:20 2015 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Tue Jul 25 14:15:47 201713 // Update Count : 5412 // Last Modified On : Tue Feb 19 18:10:55 2019 13 // Update Count : 60 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 ) : Expression(),arg(arg), isGenerated( isGenerated ) {280 CastExpr::CastExpr( Expression * arg, Type * toType, bool isGenerated ) : arg(arg), isGenerated( isGenerated ) { 281 281 set_result(toType); 282 282 } 283 283 284 CastExpr::CastExpr( Expression * arg, bool isGenerated ) : Expression(),arg(arg), isGenerated( isGenerated ) {284 CastExpr::CastExpr( Expression * arg, bool isGenerated ) : 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 << "Cast of:" << std::endl << indent+1;295 void CastExpr::print( std::ostream & os, Indenter indent ) const { 296 os << (isGenerated ? "Generated " : "Explicit ") << "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
r9d9a451 r53bb8f1 10 10 // Created On : Mon May 18 07:44:20 2015 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Sun Sep 3 19:23:46 201713 // Update Count : 4 812 // Last Modified On : Mon Feb 18 18:29:51 2019 13 // Update Count : 49 14 14 // 15 15 … … 195 195 public: 196 196 Expression * arg; 197 bool isGenerated = true; // whether this cast appeared in the sourceprogram197 bool isGenerated = true; // cast generated implicitly by code generation or explicit in program 198 198 199 199 CastExpr( Expression * arg, bool isGenerated = true ); -
src/SynTree/Type.cc
r9d9a451 r53bb8f1 10 10 // Created On : Mon May 18 07:44:20 2015 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Fri Jun 22 10:17:19 201813 // Update Count : 3912 // Last Modified On : Thu Jan 31 21:54:16 2019 13 // Update Count : 43 14 14 // 15 15 #include "Type.h" … … 25 25 26 26 const char *BasicType::typeNames[] = { 27 #if 0 27 28 "_Bool", 28 29 "char", … … 49 50 "unsigned __int128", 50 51 "__float80", 51 "__float128" 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", 52 107 }; 53 108 static_assert( -
src/SynTree/Type.h
r9d9a451 r53bb8f1 10 10 // Created On : Mon May 18 07:44:20 2015 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Mon Sep 25 14:14:01 201713 // Update Count : 1 5412 // Last Modified On : Thu Feb 14 17:11:24 2019 13 // Update Count : 169 14 14 // 15 15 … … 207 207 class BasicType : public Type { 208 208 public: 209 // GENERATED START, DO NOT EDIT 210 // GENERATED BY BasicTypes-gen.cc 209 211 enum Kind { 210 212 Bool, … … 220 222 LongLongSignedInt, 221 223 LongLongUnsignedInt, 222 Float,223 Double,224 LongDouble,225 FloatComplex,226 DoubleComplex,227 LongDoubleComplex,228 FloatImaginary,229 DoubleImaginary,230 LongDoubleImaginary,231 224 SignedInt128, 232 225 UnsignedInt128, 233 Float80, 234 Float128, 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, 235 248 NUMBER_OF_BASIC_TYPES 236 249 } kind; 250 // GENERATED END 237 251 238 252 static const char *typeNames[]; // string names for basic types, MUST MATCH with Kind -
src/SynTree/module.mk
r9d9a451 r53bb8f1 15 15 ############################################################################### 16 16 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 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 51 52 53 SRC += $(SRC_SYNTREE) 54 SRCDEMANGLE += $(SRC_SYNTREE) -
src/Tuples/TupleExpansion.cc
r9d9a451 r53bb8f1 10 10 // Created On : Mon May 18 07:44:20 2015 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Wed Jun 21 17:35:04 201713 // Update Count : 1912 // Last Modified On : Wed Feb 13 18:14:12 2019 13 // Update Count : 21 14 14 // 15 15 -
src/Tuples/module.mk
r9d9a451 r53bb8f1 15 15 ############################################################################### 16 16 17 SRC += Tuples/TupleAssignment.cc \ 18 Tuples/TupleExpansion.cc \ 19 Tuples/Explode.cc 17 SRC += Tuples/TupleAssignment.cc Tuples/TupleExpansion.cc Tuples/Explode.cc 18 SRCDEMANGLE += Tuples/TupleAssignment.cc Tuples/TupleExpansion.cc Tuples/Explode.cc -
src/Validate/module.mk
r9d9a451 r53bb8f1 16 16 17 17 SRC += Validate/HandleAttributes.cc 18 SRCDEMANGLE += Validate/HandleAttributes.cc -
src/cfa.make
r9d9a451 r53bb8f1 32 32 am__v_GOC_1 = 33 33 34 34 UPPCC = u++ 35 35 UPPCOMPILE = $(UPPCC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_UPPFLAGS) $(UPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) $(AM_CFLAGS) $(CFLAGS) 36 36 -
src/config.h.in
r9d9a451 r53bb8f1 52 52 #undef CFA_VERSION_SHORT 53 53 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 54 /* Have compiler warning cast-function-type. */ 55 #undef HAVE_CAST_FUNCTION_TYPE 68 56 69 57 /* Define to 1 if you have the <dlfcn.h> header file. */ 70 58 #undef HAVE_DLFCN_H 71 59 72 /* Define to 1 if you have the <fenv.h> header file. */73 #undef HAVE_FENV_H74 75 /* Define to 1 if you have the <float.h> header file. */76 #undef HAVE_FLOAT_H77 78 60 /* Define to 1 if you have the <inttypes.h> header file. */ 79 61 #undef HAVE_INTTYPES_H 80 62 63 /* Have keywords _FloatXX. */ 64 #undef HAVE_KEYWORDS_FLOATXX 65 81 66 /* Define to 1 if you have the <libintl.h> header file. */ 82 67 #undef HAVE_LIBINTL_H 83 84 /* Define to 1 if you have the <limits.h> header file. */85 #undef HAVE_LIMITS_H86 68 87 69 /* Define to 1 if you have the <malloc.h> header file. */ … … 91 73 #undef HAVE_MEMORY_H 92 74 93 /* Define to 1 if you have the `memset' function. */94 #undef HAVE_MEMSET95 96 /* Define to 1 if you have the `putenv' function. */97 #undef HAVE_PUTENV98 99 /* Define to 1 if stdbool.h conforms to C99. */100 #undef HAVE_STDBOOL_H101 102 /* Define to 1 if you have the <stddef.h> header file. */103 #undef HAVE_STDDEF_H104 105 75 /* Define to 1 if you have the <stdint.h> header file. */ 106 76 #undef HAVE_STDINT_H … … 109 79 #undef HAVE_STDLIB_H 110 80 111 /* Define to 1 if you have the `strchr' function. */112 #undef HAVE_STRCHR113 114 81 /* Define to 1 if you have the <strings.h> header file. */ 115 82 #undef HAVE_STRINGS_H … … 117 84 /* Define to 1 if you have the <string.h> header file. */ 118 85 #undef HAVE_STRING_H 119 120 /* Define to 1 if you have the `strtol' function. */121 #undef HAVE_STRTOL122 86 123 87 /* Define to 1 if you have the <sys/stat.h> header file. */ … … 130 94 #undef HAVE_UNISTD_H 131 95 132 /* Define to 1 if the system has the type `_ Bool'. */133 #undef HAVE__ BOOL96 /* Define to 1 if the system has the type `_Float32'. */ 97 #undef HAVE__FLOAT32 134 98 135 99 /* Define to the sub-directory where libtool stores uninstalled libraries. */ … … 157 121 #undef PACKAGE_VERSION 158 122 159 /* If using the C implementation of alloca, define if you know the160 direction of stack growth for your system; otherwise it will be161 automatically deduced at runtime.162 STACK_DIRECTION > 0 => grows toward higher addresses163 STACK_DIRECTION < 0 => grows toward lower addresses164 STACK_DIRECTION = 0 => direction of growth unknown */165 #undef STACK_DIRECTION166 167 123 /* Define to 1 if you have the ANSI C header files. */ 168 124 #undef STDC_HEADERS … … 180 136 `char[]'. */ 181 137 #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, the185 #define below would cause a syntax error. */186 #undef _UINT32_T187 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, the190 #define below would cause a syntax error. */191 #undef _UINT8_T192 193 /* Define to `__inline__' or `__inline' if that's what the C compiler194 calls it, or to nothing if 'inline' is not supported under any name. */195 #ifndef __cplusplus196 #undef inline197 #endif198 199 /* Define to the type of a signed integer type of width exactly 16 bits if200 such a type exists and the standard includes do not define it. */201 #undef int16_t202 203 /* Define to the type of a signed integer type of width exactly 32 bits if204 such a type exists and the standard includes do not define it. */205 #undef int32_t206 207 /* Define to the type of a signed integer type of width exactly 8 bits if such208 a type exists and the standard includes do not define it. */209 #undef int8_t210 211 /* Define to the equivalent of the C99 'restrict' keyword, or to212 nothing if this is not supported. Do not define if restrict is213 supported directly. */214 #undef restrict215 /* Work around a bug in Sun C++: it does not support _Restrict or216 __restrict__, even though the corresponding Sun C compiler ends up with217 "#define restrict _Restrict" or "#define restrict __restrict__" in the218 previous line. Perhaps some future version of Sun C++ will work with219 restrict; if so, hopefully it defines __RESTRICT like Sun C does. */220 #if defined __SUNPRO_CC && !defined __RESTRICT221 # define _Restrict222 # define __restrict__223 #endif224 225 /* Define to `unsigned int' if <sys/types.h> does not define. */226 #undef size_t227 228 /* Define to the type of an unsigned integer type of width exactly 16 bits if229 such a type exists and the standard includes do not define it. */230 #undef uint16_t231 232 /* Define to the type of an unsigned integer type of width exactly 32 bits if233 such a type exists and the standard includes do not define it. */234 #undef uint32_t235 236 /* Define to the type of an unsigned integer type of width exactly 8 bits if237 such a type exists and the standard includes do not define it. */238 #undef uint8_t -
src/main.cc
r9d9a451 r53bb8f1 10 10 // Created On : Fri May 15 23:12:02 2015 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Wed Jun 6 15:51:47 201813 // Update Count : 49812 // Last Modified On : Sat Feb 16 09:14:04 2019 13 // Update Count : 500 14 14 // 15 15 … … 37 37 #include "CodeTools/TrackLoc.h" // for fillLocations 38 38 #include "Common/CompilerError.h" // for CompilerError 39 #include "Common/ Heap.h"39 #include "Common/Stats.h" 40 40 #include "Common/PassVisitor.h" 41 41 #include "Common/SemanticError.h" // for SemanticError … … 65 65 using namespace std; 66 66 67 #define PASS(name, pass) \ 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) \ 68 79 if ( errorp ) { cerr << name << endl; } \ 69 HeapStats::newPass(name); \ 70 pass; 80 NewPass(name); \ 81 Stats::Time::StartBlock(name); \ 82 pass; \ 83 Stats::Time::StopBlock(); 71 84 72 85 LinkageSpec::Spec linkage = LinkageSpec::Cforall; … … 142 155 backtrace( 6 ); // skip first 6 stack frames 143 156 signal( SIGABRT, SIG_DFL); // reset default signal handler 144 157 raise( SIGABRT ); // reraise SIGABRT 145 158 } // sigAbortHandler 146 159 … … 148 161 int main( int argc, char * argv[] ) { 149 162 FILE * input; // use FILE rather than istream because yyin is FILE 150 ostream * output = & cout;151 const char * filename = nullptr;163 ostream * output = & cout; 164 const char * filename = nullptr; 152 165 list< Declaration * > translationUnit; 153 166 … … 181 194 } // if 182 195 196 Stats::Time::StartGlobal(); 197 NewPass("Parse"); 198 Stats::Time::StartBlock("Parse"); 199 183 200 // read in the builtins, extras, and the prelude 184 201 if ( ! nopreludep ) { // include gcc builtins … … 231 248 // works okay for now. 232 249 CodeTools::fillLocations( translationUnit ); 250 Stats::Time::StopBlock(); 233 251 234 252 // add the assignment statement after the initialization of a type parameter 235 PASS( " validate", SymTab::validate( translationUnit, symtabp ) );253 PASS( "Validate", SymTab::validate( translationUnit, symtabp ) ); 236 254 if ( symtabp ) { 237 255 deleteAll( translationUnit ); … … 250 268 } // if 251 269 252 PASS( " fixLabels", ControlStruct::fixLabels( translationUnit ) );253 PASS( " fixNames", CodeGen::fixNames( translationUnit ) );254 PASS( " genInit", InitTweak::genInit( translationUnit ) );255 PASS( " expandMemberTuples" , Tuples::expandMemberTuples( translationUnit ) );270 PASS( "Fix Labels", ControlStruct::fixLabels( translationUnit ) ); 271 PASS( "Fix Names", CodeGen::fixNames( translationUnit ) ); 272 PASS( "Gen Init", InitTweak::genInit( translationUnit ) ); 273 PASS( "Expand Member Tuples" , Tuples::expandMemberTuples( translationUnit ) ); 256 274 if ( libcfap ) { 257 275 // generate the bodies of cfa library functions … … 277 295 } 278 296 279 PASS( " resolve", ResolvExpr::resolve( translationUnit ) );297 PASS( "Resolve", ResolvExpr::resolve( translationUnit ) ); 280 298 if ( exprp ) { 281 299 dump( translationUnit ); … … 284 302 285 303 // fix ObjectDecl - replaces ConstructorInit nodes 286 PASS( " fixInit", InitTweak::fix( translationUnit, buildingLibrary() ) );304 PASS( "Fix Init", InitTweak::fix( translationUnit, buildingLibrary() ) ); 287 305 if ( ctorinitp ) { 288 306 dump ( translationUnit ); … … 290 308 } // if 291 309 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 reused293 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 expanded299 300 PASS( " expandTuples", Tuples::expandTuples( translationUnit ) ); // xxx - is this the right place for this?310 PASS( "Expand Unique Expr", 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 311 312 PASS( "Translate EHM" , ControlStruct::translateEHM( translationUnit ) ); 313 314 PASS( "Gen Waitfor" , Concurrency::generateWaitFor( translationUnit ) ); 315 316 PASS( "Convert Specializations", GenPoly::convertSpecializations( translationUnit ) ); // needs to happen before tuple types are expanded 317 318 PASS( "Expand Tuples", Tuples::expandTuples( translationUnit ) ); // xxx - is this the right place for this? 301 319 302 320 if ( tuplep ) { … … 305 323 } 306 324 307 PASS( " virtual expandCasts", Virtual::expandCasts( translationUnit ) ); // Must come after translateEHM308 309 PASS( " instantiateGenerics", GenPoly::instantiateGeneric( translationUnit ) );325 PASS( "Virtual Expand Casts", Virtual::expandCasts( translationUnit ) ); // Must come after translateEHM 326 327 PASS( "Instantiate Generics", GenPoly::instantiateGeneric( translationUnit ) ); 310 328 if ( genericsp ) { 311 329 dump( translationUnit ); 312 330 return 0; 313 331 } 314 PASS( " convertLvalue", GenPoly::convertLvalue( translationUnit ) );332 PASS( "Convert L-Value", GenPoly::convertLvalue( translationUnit ) ); 315 333 316 334 … … 319 337 return 0; 320 338 } // if 321 PASS( " box", GenPoly::box( translationUnit ) );339 PASS( "Box", GenPoly::box( translationUnit ) ); 322 340 323 341 if ( bcodegenp ) { … … 331 349 332 350 CodeTools::fillLocations( translationUnit ); 333 PASS( " codegen", CodeGen::generate( translationUnit, *output, ! noprotop, prettycodegenp, true, linemarks ) );351 PASS( "Code Gen", CodeGen::generate( translationUnit, *output, ! noprotop, prettycodegenp, true, linemarks ) ); 334 352 335 353 CodeGen::FixMain::fix( *output, (PreludeDirector + "/bootloader.c").c_str() ); … … 371 389 } 372 390 } catch(const std::exception& e) { 373 std::cerr << "Un aught Exception \"" << e.what() << "\"\n";391 std::cerr << "Uncaught Exception \"" << e.what() << "\"\n"; 374 392 } 375 393 return 1; … … 377 395 378 396 deleteAll( translationUnit ); 379 if(!libcfap && !treep) HeapStats::printStats(); 397 Stats::print(); 398 380 399 return 0; 381 400 } // main 382 401 383 402 void parse_cmdline( int argc, char * argv[], const char *& filename ) { 384 enum { Ast, Bbox, Bresolver, CtorInitFix, DeclStats, Expr, ExprAlt, Grammar, LibCFA, Linemarks, Nolinemarks, Nopreamble, Parse, PreludeDir, Prototypes, Resolver, ResolvProto, S ymbol, Tree, TupleExpansion, Validate,};403 enum { Ast, Bbox, Bresolver, CtorInitFix, DeclStats, Expr, ExprAlt, Grammar, LibCFA, Linemarks, Nolinemarks, Nopreamble, Parse, PreludeDir, Prototypes, Resolver, ResolvProto, Stats, Symbol, Tree, TupleExpansion, Validate}; 385 404 386 405 static struct option long_opts[] = { … … 402 421 { "resolver", no_argument, 0, Resolver }, 403 422 { "resolv-proto", no_argument, 0, ResolvProto }, 423 { "stats", required_argument, 0, Stats }, 404 424 { "symbol", no_argument, 0, Symbol }, 405 425 { "tree", no_argument, 0, Tree }, … … 416 436 while ( (c = getopt_long( argc, argv, "abBcCdefgGlLmnNpqrRstTvwW:yzZD:F:", long_opts, &long_index )) != -1 ) { 417 437 switch ( c ) { 418 419 438 case Ast: 439 case 'a': // dump AST 420 440 astp = true; 421 441 break; 422 423 442 case Bresolver: 443 case 'b': // print before resolver steps 424 444 bresolvep = true; 425 445 break; 426 446 case 'B': // print before box steps 427 447 bboxp = true; 428 448 break; 429 430 449 case CtorInitFix: 450 case 'c': // print after constructors and destructors are replaced 431 451 ctorinitp = true; 432 452 break; 433 453 case 'C': // print before code generation 434 454 bcodegenp = true; 435 455 break; 436 437 438 439 break; 440 441 456 case DeclStats: 457 case 'd': 458 declstatsp = true; 459 break; 460 case Expr: 461 case 'e': // dump AST after expression analysis 442 462 exprp = true; 443 463 break; 444 445 464 case ExprAlt: 465 case 'f': // print alternatives for expressions 446 466 expraltp = true; 447 467 break; 448 449 468 case Grammar: 469 case 'g': // bison debugging info (grammar rules) 450 470 yydebug = true; 451 471 break; 452 472 case 'G': // dump AST after instantiate generics 453 473 genericsp = true; 454 474 break; 455 456 475 case LibCFA: 476 case 'l': // generate libcfa.c 457 477 libcfap = true; 458 478 break; 459 460 479 case Linemarks: 480 case 'L': // print lines marks 461 481 linemarks = true; 462 482 break; 463 464 483 case Nopreamble: 484 case 'n': // do not read preamble 465 485 nopreludep = true; 466 486 break; 467 468 487 case Nolinemarks: 488 case 'N': // suppress line marks 469 489 linemarks = false; 470 490 break; 471 472 491 case Prototypes: 492 case 'p': // generate prototypes for preamble functions 473 493 noprotop = true; 474 494 break; 475 476 477 break; 478 479 480 break; 481 482 495 case PreludeDir: 496 PreludeDirector = optarg; 497 break; 498 case 'm': // don't replace the main 499 nomainp = true; 500 break; 501 case Parse: 502 case 'q': // dump parse tree 483 503 parsep = true; 484 504 break; 485 486 505 case Resolver: 506 case 'r': // print resolver steps 487 507 resolvep = true; 488 508 break; 489 509 case 'R': // dump resolv-proto instance 490 510 resolvprotop = true; 491 511 break; 492 case Symbol: 493 case 's': // print symbol table events 512 case Stats: 513 Stats::parse_params(optarg); 514 break; 515 case Symbol: 516 case 's': // print symbol table events 494 517 symtabp = true; 495 518 break; 496 497 519 case Tree: 520 case 't': // build in tree 498 521 treep = true; 499 522 break; 500 501 523 case TupleExpansion: 524 case 'T': // print after tuple expansion 502 525 tuplep = true; 503 526 break; 504 527 case 'v': // dump AST after decl validation pass 505 528 validp = true; 506 529 break; 507 530 case 'w': 508 531 Wsuppress = true; 509 532 break; 510 533 case 'W': 511 534 if ( strcmp( optarg, "all" ) == 0 ) { 512 535 SemanticWarning_EnableAll(); … … 525 548 } // if 526 549 break; 527 550 case 'y': // dump AST on error 528 551 errorp = true; 529 552 break; 530 553 case 'z': // dump as codegen rather than AST 531 554 codegenp = true; 532 555 break; … … 534 557 prettycodegenp = true; 535 558 break; 536 537 break; 538 559 case 'D': // ignore -Dxxx 560 break; 561 case 'F': // source file-name without suffix 539 562 filename = optarg; 540 563 break; 541 564 case '?': 542 565 if ( optopt ) { // short option ? 543 566 assertf( false, "Unknown option: -%c\n", (char)optopt ); … … 548 571 __attribute__((fallthrough)); 549 572 #endif 550 573 default: 551 574 abort(); 552 575 } // switch -
tests/.expect/castError.txt
r9d9a451 r53bb8f1 1 castError.cfa: 7:1 error: Cannot choose between 3 alternatives for expression2 Cast of:1 castError.cfa:21:1 error: Cannot choose between 3 alternatives for expression 2 Explicit Cast of: 3 3 Name: f 4 4 ... to: 5 5 char Alternatives are: 6 Cost ( 1, 0, 0, 0, 0, 0 ):Cast of:6 Cost ( 1, 0, 0, 0, 0, 0, 0 ): Explicit 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 ):Cast of:18 Cost ( 1, 0, 0, 0, 0, 0, 0 ): Explicit Cast of: 19 19 Variable Expression: f: double 20 20 ... to: … … 25 25 Environment: 26 26 27 Cost ( 1, 0, 0, 0, 0, 0 ):Cast of:27 Cost ( 1, 0, 0, 0, 0, 0, 0 ): Explicit 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 expression 38 Generated Cast of: 39 Comma Expression: 40 constant expression (3 3: signed int) 41 Name: v 42 ... 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 char 47 ... to: nothing 48 (types: 49 void 50 ) 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 int 57 ... to: nothing 58 (types: 59 void 60 ) 61 Environment: 62 63 -
tests/.expect/completeTypeError.txt
r9d9a451 r53bb8f1 45 45 46 46 Alternatives with failing assertions are: 47 Cost ( 0, 1, 0, 1, -5, 0 ): Application of47 Cost ( 0, 1, 0, 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 3_0_T ) -> instance of type T (not function type) (no widening)89 Environment:( _74_0_T ) -> instance of type T (not function type) (no widening) 90 90 91 91 -
tests/.expect/declarationSpecifier.x64.txt
r9d9a451 r53bb8f1 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= ((signed int )0)) /* ?{} */);691 ((void)(_X12_retval_maini_1=0) /* ?{} */); 692 692 return _X12_retval_maini_1; 693 693 ((void)(_X12_retval_maini_1=0) /* ?{} */); -
tests/.expect/declarationSpecifier.x86.txt
r9d9a451 r53bb8f1 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= ((signed int )0)) /* ?{} */);691 ((void)(_X12_retval_maini_1=0) /* ?{} */); 692 692 return _X12_retval_maini_1; 693 693 ((void)(_X12_retval_maini_1=0) /* ?{} */); -
tests/.expect/gccExtensions.x64.txt
r9d9a451 r53bb8f1 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= ((signed int )0)) /* ?{} */);164 ((void)(_X12_retval_maini_1=0) /* ?{} */); 165 165 return _X12_retval_maini_1; 166 166 ((void)(_X12_retval_maini_1=0) /* ?{} */); -
tests/.expect/gccExtensions.x86.txt
r9d9a451 r53bb8f1 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= ((signed int )0)) /* ?{} */);164 ((void)(_X12_retval_maini_1=0) /* ?{} */); 165 165 return _X12_retval_maini_1; 166 166 ((void)(_X12_retval_maini_1=0) /* ?{} */); -
tests/.expect/io1.txt
r9d9a451 r53bb8f1 1 1 9 6 28 0 7 1 2 2 1 2 33 1234 1232 0 1 2 3 3 0123 4 0123 5 5 6 6 opening delimiters -
tests/.expect/loopctrl.txt
r9d9a451 r53bb8f1 19 19 10 8 6 4 2 20 20 21 2 4 6 8 10 22 2.1 3.8 5.5 7.2 8.9 23 10 8 6 4 2 0 24 12.1 10.4 8.7 7 5.3 3.6 21 25 22 26 N N N N N N N N N N … … 24 28 10 9 8 7 6 5 4 3 2 1 25 29 26 27 30 3 6 9 28 29 31 30 32 (0 0)(1 1)(2 2)(3 3)(4 4)(5 5)(6 6)(7 7)(8 8)(9 9) -
tests/.expect/sum.txt
r9d9a451 r53bb8f1 1 sum from 5 to 15 is 95, check 95 2 sum from 5 to 15 is 95, check 95 1 3 sum from 5 to 15 is 95, check 95 2 4 sum from 5 to 15 is 95, check 95 -
tests/Makefile.in
r9d9a451 r53bb8f1 186 186 DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) 187 187 ACLOCAL = @ACLOCAL@ 188 ALLOCA = @ALLOCA@189 188 AMTAR = @AMTAR@ 190 189 AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ … … 350 349 am__v_GOC_0 = @echo " GOC " $@; 351 350 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
r9d9a451 r53bb8f1 1 //Testing array declarations 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 2 17 int a1[]; 3 18 //int a2[*]; … … 34 49 } 35 50 36 //Dummy main 37 int main(int argc, char const *argv[]) 38 { 39 return 0; 40 } 51 int main() {} 52 53 // Local Variables: // 54 // tab-width: 4 // 55 // compile-command: "cfa array.cfa" // 56 // End: // -
tests/castError.cfa
r9d9a451 r53bb8f1 1 //Testing some of the invalid casts of chars 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 2 16 int f; 3 17 … … 7 21 (char)f; 8 22 (int(*)())f; 23 24 unsigned char v; 25 short int v; 26 3, v; // implicit void cast 9 27 } 10 28 11 //Dummy main 12 int main(int argc, char const *argv[]) 13 { 14 return 0; 15 } 29 int main() {} 30 31 // Local Variables: // 32 // tab-width: 4 // 33 // compile-command: "cfa castError.cfa" // 34 // End: // -
tests/concurrent/examples/boundedBufferEXT.cfa
r9d9a451 r53bb8f1 1 1 // 2 // Cforall Version 1.0.0 Copyright (C) 2018 University of Waterloo 3 // 2 4 // The contents of this file are covered under the licence agreement in the 3 5 // file "LICENCE" distributed with Cforall. … … 8 10 // Created On : Wed Apr 18 22:52:12 2018 9 11 // Last Modified By : Peter A. Buhr 10 // Last Modified On : Tue Dec 11 21:55:02 201811 // Update Count : 912 // Last Modified On : Wed Feb 20 08:36:45 2019 13 // Update Count : 11 12 14 // 13 15 14 #include <stdlib.hfa> 16 #include <stdlib.hfa> // random 15 17 #include <fstream.hfa> 16 18 #include <kernel.hfa> -
tests/concurrent/examples/boundedBufferINT.cfa
r9d9a451 r53bb8f1 1 1 // 2 // Cforall Version 1.0.0 Copyright (C) 2017 University of Waterloo 3 // 2 4 // The contents of this file are covered under the licence agreement in the 3 5 // file "LICENCE" distributed with Cforall. … … 8 10 // Created On : Mon Oct 30 12:45:13 2017 9 11 // Last Modified By : Peter A. Buhr 10 // Last Modified On : Tue Dec 11 21:55:45 201811 // Update Count : 8 412 // Last Modified On : Wed Feb 20 08:37:24 2019 13 // Update Count : 87 12 14 // 13 15 14 #include <stdlib.hfa> 16 #include <stdlib.hfa> // random 15 17 #include <fstream.hfa> 16 18 #include <kernel.hfa> -
tests/concurrent/examples/datingService.cfa
r9d9a451 r53bb8f1 1 1 // 2 // Cforall Version 1.0.0 Copyright (C) 2017 University of Waterloo 3 // 2 4 // The contents of this file are covered under the licence agreement in the 3 5 // file "LICENCE" distributed with Cforall. … … 8 10 // Created On : Mon Oct 30 12:56:20 2017 9 11 // Last Modified By : Peter A. Buhr 10 // Last Modified On : Tue Dec 11 21:55:34 201811 // Update Count : 2812 // Last Modified On : Wed Feb 20 08:37:12 2019 13 // Update Count : 30 12 14 // 13 15 14 #include <stdlib.hfa> 16 #include <stdlib.hfa> // random 15 17 #include <fstream.hfa> 16 18 #include <kernel.hfa> -
tests/concurrent/examples/matrixSum.cfa
r9d9a451 r53bb8f1 1 // -*- Mode: C -*-2 1 // 3 2 // Cforall Version 1.0.0 Copyright (C) 2017 University of Waterloo … … 11 10 // Created On : Mon Oct 9 08:29:28 2017 12 11 // Last Modified By : Peter A. Buhr 13 // Last Modified On : Tue Dec 11 21:54:55 201814 // Update Count : 1 512 // Last Modified On : Wed Feb 20 08:37:53 2019 13 // Update Count : 16 15 14 // 16 15 -
tests/concurrent/examples/quickSort.cfa
r9d9a451 r53bb8f1 1 // 2 // Cforall Version 1.0.0 Copyright (C) 2017 University of Waterloo 1 3 // 2 4 // The contents of this file are covered under the licence agreement in the … … 9 11 // Created On : Wed Dec 6 12:15:52 2017 10 12 // Last Modified By : Peter A. Buhr 11 // Last Modified On : Sat Dec 22 08:44:27 201812 // Update Count : 16 813 // Last Modified On : Wed Feb 20 08:38:24 2019 14 // Update Count : 169 13 15 // 14 16 -
tests/io1.cfa
r9d9a451 r53bb8f1 10 10 // Created On : Wed Mar 2 16:56:02 2016 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Fri Dec 21 16:02:55 201813 // Update Count : 11 412 // Last Modified On : Mon Mar 4 21:42:47 2019 13 // Update Count : 115 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 | 1 | 2 | 3;22 sout | ' 1' | '2' | '3';23 sout | 1 | "" | 2 | "" | 3;21 sout | 0 | 1 | 2 | 3; 22 sout | '0' | '1' | '2' | '3'; 23 sout | 0 | "" | 1 | "" | 2 | "" | 3; 24 24 sout | nl; 25 25 -
tests/literals.cfa
r9d9a451 r53bb8f1 10 10 // Created On : Sat Sep 9 16:34:38 2017 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Tue Dec 4 21:44:01 2018 13 // Update Count : 139 14 // 15 12 // Last Modified On : Tue Feb 12 08:07:39 2019 13 // Update Count : 224 14 // 15 16 #include <features.h> // __GNUC_PREREQ 16 17 #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 >= 7 154 // floating with length, gcc f16/f128x unsupported and no prelude code for any _FloatXXx, so they work by conversion to long double 155 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 153 197 #ifdef __CFA__ 154 198 // fixed-size length … … 167 211 // octal 168 212 01234567_l8; 01234567_l16; 01234567_l32; 01234567_l64; 01234567_l8u; 01234567_ul16; 01234567_l32u; 01234567_ul64; 169 +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; 170 214 -01234567_l8; -01234567_l16; -01234567_l32; -01234567_l64; -01234567_l8u; -01234567_ul16; -01234567_l32u; -01234567_ul64; 171 215 … … 203 247 +0X0123456789ABCDEF_l8; +0X0123456789ABCDEF_l16; +0X0123456789ABCDEFl32; +0X0123456789ABCDEFl64; +0X0123456789ABCDEF_ul8; +0X0123456789ABCDEF_l16u; +0X0123456789ABCDEFul32; +0X0123456789ABCDEFl64u; 204 248 -0X0123456789ABCDEF_l8; -0X0123456789ABCDEF_l16; -0X0123456789ABCDEFl32; -0X0123456789ABCDEFl64; -0X0123456789ABCDEF_ul8; -0X0123456789ABCDEF_l16u; -0X0123456789ABCDEFul32; -0X0123456789ABCDEFl64u; 205 206 // floating207 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;231 249 232 250 // char, short, int suffix overloading -
tests/loopctrl.cfa
r9d9a451 r53bb8f1 10 10 // Created On : Wed Aug 8 18:32:59 2018 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Sun Dec 23 23:00:29 201813 // Update Count : 7912 // Last Modified On : Thu Feb 21 08:54:47 2019 13 // Update Count : 86 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 | nl;56 for ( ui; 10u -~= 2u ~ 2u ) { sout | ui; } sout | 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 58 77 enum { N = 10 }; 59 78 for ( N ) { sout | "N"; } sout | nl; 60 79 for ( i; N ) { sout | i; } sout | nl; 61 for ( i; N -~ 0 ) { sout | i; } sout | nl | nl | nl;80 for ( i; N -~ 0 ) { sout | i; } sout | nl | nl; 62 81 63 82 const int start = 3, comp = 10, inc = 2; 64 83 for ( i; start ~ comp ~ inc + 1 ) { sout | i; } sout | nl | nl; 65 84 66 sout | nl;67 85 for ( S s = (S){0}; s < (S){10,10}; s += (S){1} ) { sout | s; } sout | nl; 68 86 for ( s; (S){10,10} ) { sout | s; } sout | nl; -
tests/numericConstants.cfa
r9d9a451 r53bb8f1 10 10 // Created On : Wed May 24 22:10:36 2017 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Tue Nov 6 17:59:53 201813 // Update Count : 312 // Last Modified On : Tue Feb 5 08:58:16 2019 13 // Update Count : 5 14 14 // 15 15 … … 67 67 // Local Variables: // 68 68 // tab-width: 4 // 69 // compile-command: "cfa minmax.cfa" //69 // compile-command: "cfa numericConstants.cfa" // 70 70 // End: // -
tests/preempt_longrun/Makefile.in
r9d9a451 r53bb8f1 334 334 DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) 335 335 ACLOCAL = @ACLOCAL@ 336 ALLOCA = @ALLOCA@337 336 AMTAR = @AMTAR@ 338 337 AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ -
tests/pybin/tools.py
r9d9a451 r53bb8f1 3 3 import __main__ 4 4 import argparse 5 import fileinput 5 6 import multiprocessing 6 7 import os 7 8 import re 9 import resource 8 10 import signal 9 11 import stat 10 12 import sys 11 import fileinput13 import time 12 14 13 15 from pybin import settings … … 131 133 132 134 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 ret 139 133 140 ################################################################################ 134 141 # file handling 135 142 ################################################################################ 143 # move a file 144 def mv(source, dest): 145 ret, _ = sh("mv %s %s" % (source, dest)) 146 return ret 147 148 # cat one file into the other 149 def cat(source, dest): 150 ret, _ = sh("cat %s > %s" % (source, dest)) 151 return ret 136 152 137 153 # helper function to replace patterns in a file … … 230 246 signal.signal(signal.SIGINT, signal.SIG_IGN) 231 247 248 249 # enable core dumps for all the test children 250 resource.setrlimit(resource.RLIMIT_CORE, (resource.RLIM_INFINITY, resource.RLIM_INFINITY)) 251 232 252 ################################################################################ 233 253 # misc … … 251 271 else: 252 272 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 self 294 295 def __exit__(self, *args): 296 self.end = time.time() 297 self.duration = self.end - self.start -
tests/raii/.expect/ctor-autogen-ERR1.txt
r9d9a451 r53bb8f1 1 raii/ctor-autogen.cfa:102:1 error: Unique best alternative includes deleted identifier in Cast of:1 raii/ctor-autogen.cfa:102:1 error: Unique best alternative includes deleted identifier in Generated Cast of: 2 2 Application of 3 3 Deleted Expression … … 27 27 28 28 ... to arguments 29 Cast of:29 Generated Cast of: 30 30 Member Expression, with field: 31 31 x: signed int 32 32 ... from aggregate: 33 Cast of:33 Generated 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 Cast of:39 Generated Cast of: 40 40 constant expression (0 0: zero_t) 41 41 ... to: … … 48 48 49 49 ... to arguments 50 Cast of:50 Generated Cast of: 51 51 Variable Expression: x: instance of struct Managed with body 1 52 52 ... to: -
tests/sum.cfa
r9d9a451 r53bb8f1 11 11 // Created On : Wed May 27 17:56:53 2015 12 12 // Last Modified By : Peter A. Buhr 13 // Last Modified On : Sun Dec 23 23:00:38 201814 // Update Count : 28713 // Last Modified On : Wed Feb 20 08:32:46 2019 14 // Update Count : 329 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 prelude21 19 22 20 trait sumable( otype T ) { … … 36 34 } // sum 37 35 38 // Not in prelude.39 unsigned char ?+?( unsigned char t1, unsigned char t2 ) { return (int)t1 + t2; } // cast forces integer addition, otherwise recursion40 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 49 36 int main( void ) { 50 37 const int low = 5, High = 15, size = High - low; 51 38 52 unsigned char s = 0, a[size], v = (char)low;53 for ( int i = 0; i < size; i += 1, v += 1 ) {39 signed char s = 0, a[size], v = (char)low; 40 for ( int i = 0; i < size; i += 1, v += 1hh ) { 54 41 s += v; 55 42 a[i] = v; 56 43 } // for 57 44 sout | "sum from" | low | "to" | High | "is" 58 | sum( size, (unsigned char *)a ) | ", check" | (int)s; 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; 59 62 60 63 int s = 0, a[size], v = low; -
tests/test.py
r9d9a451 r53bb8f1 121 121 # running test functions 122 122 ################################################################################ 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 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) 130 131 131 132 # logic to run a single test and return the result (No handling of printing or other test framework logic) … … 143 144 144 145 # build, skipping to next test on error 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 146 with Timed() as comp_dur: 147 make_ret, _ = make( test.target(), redirects = ("2> %s 1> /dev/null" % out_file), error_file = err_file ) 148 149 # if the make command succeds continue otherwise skip to diff 154 150 run_dur = None 155 156 # if the make command succeds continue otherwise skip to diff 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 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) 168 159 else: 169 retcode, _ = sh("mv %s %s" % (err_file, out_file)) 170 171 172 if retcode == 0: 173 # fixoutput(out_file) 160 retcode = mv(err_file, out_file) 161 162 if success(retcode): 174 163 if settings.generating : 175 164 # if we are ounly generating the output we still need to check that the test actually exists 176 if no t settings.dry_run and fileContainsOnly(out_file, "make: *** No rule to make target `%s'. Stop." %test.target()) :177 retcode = 1 ;165 if noRule(out_file, test.target()) : 166 retcode = 1 178 167 error = "\t\tNo make target for test %s!" % test.target() 179 sh("rm %s" % out_file, False)168 rm(out_file) 180 169 else: 181 170 error = None … … 188 177 error = myfile.read() 189 178 179 ret, info = coreInfo(exe_file) 180 error = error + info 181 182 190 183 191 184 # clean the executable 192 sh("rm -f %s > /dev/null 2>&1" % test.target())193 194 return retcode, error, [comp_dur , run_dur]185 rm(exe_file) 186 187 return retcode, error, [comp_dur.duration, run_dur.duration if run_dur else None] 195 188 196 189 # run a single test and handle the errors, outputs, printing, exception handling, etc. … … 199 192 with SignalHandling(): 200 193 # print formated name 201 name_txt = "%2 0s " % t.name194 name_txt = "%24s " % t.name 202 195 203 196 retcode, error, duration = run_single_test(t) … … 263 256 allTests = listTests( options.include, options.exclude ) 264 257 258 265 259 # if user wants all tests than no other treatement of the test list is required 266 260 if options.all or options.list or options.list_comp or options.include : -
tests/warnings/.expect/self-assignment.txt
r9d9a451 r53bb8f1 1 warnings/self-assignment.cfa:29:1 warning: self assignment of expression: Cast of:1 warnings/self-assignment.cfa:29:1 warning: self assignment of expression: Generated 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: Cast of:5 warnings/self-assignment.cfa:30:1 warning: self assignment of expression: Generated 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: Cast of:9 warnings/self-assignment.cfa:31:1 warning: self assignment of expression: Generated 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: Cast of:16 warnings/self-assignment.cfa:32:1 warning: self assignment of expression: Generated Cast of: 17 17 Member Expression, with field: 18 18 i: signed int -
tests/warnings/self-assignment.cfa
r9d9a451 r53bb8f1 9 9 // Author : Rob Schluntz 10 10 // Created On : Thu Mar 1 13:53:57 2018 11 // Last Modified By : Rob Schluntz12 // Last Modified On : Thu Mar 1 13:53:57 201813 // Update Count : 211 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Wed Feb 20 07:56:17 2019 13 // Update Count : 3 14 14 // 15 15 16 16 struct S { 17 17 int i; 18 18 }; 19 19 20 20 struct T { 21 21 S s; 22 22 }; 23 23 24 24 int main() { 25 26 27 25 int j = 0; 26 S s = { 0 }; 27 T t = { { 0 } }; 28 28 29 30 31 32 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
r9d9a451 r53bb8f1 194 194 DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) 195 195 ACLOCAL = @ACLOCAL@ 196 ALLOCA = @ALLOCA@197 196 AMTAR = @AMTAR@ 198 197 AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ -
tools/PrettyGitLogs.sh
r9d9a451 r53bb8f1 3 3 set -e 4 4 5 GIT_UPDATE="$1/GIT_UPDATE" 6 GIT_LOG="$1/GIT_LOG" 7 GIT_DIFF="$1/GIT_DIFF" 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" 8 10 9 11 rm -f ${GIT_UPDATE} ${GIT_LOG} ${GIT_DIFF} 10 12 11 GitOldRef=$ 212 GitNewRef=$ 313 GitOldRef=$3 14 GitNewRef=$4 13 15 14 16 -
tools/prettyprinter/Makefile.in
r9d9a451 r53bb8f1 223 223 DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) 224 224 ACLOCAL = @ACLOCAL@ 225 ALLOCA = @ALLOCA@226 225 AMTAR = @AMTAR@ 227 226 AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
Note:
See TracChangeset
for help on using the changeset viewer.