Changeset 53bb8f1


Ignore:
Timestamp:
Mar 12, 2019, 3:00:54 PM (3 years ago)
Author:
Aaron Moss <a3moss@…>
Branches:
aaron-thesis, arm-eh, cleanup-dtors, jacob/cs343-translation, jenkins-sandbox, master, new-ast, new-ast-unique-expr
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.
Message:

Merge second draft of Aaron's thesis

Files:
15 added
1 deleted
107 edited
16 moved

Legend:

Unmodified
Added
Removed
  • .gitignore

    r9d9a451 r53bb8f1  
    1010config.py
    1111stamp-h1
     12libtool
    1213/Makefile
    1314**/Makefile
     
    4950libcfa/arm-nolib/
    5051
    51 
    5252# generated by bison and lex from parser.yy and lex.ll
    5353src/Parser/parser.output
  • Makefile.am

    r9d9a451 r53bb8f1  
    1111## Created On       : Sun May 31 22:14:18 2015
    1212## Last Modified By : Peter A. Buhr
    13 ## Last Modified On : Wed Dec 14 14:20:48 2016
    14 ## Update Count     : 15
     13## Last Modified On : Sat Feb  2 16:54:42 2019
     14## Update Count     : 21
    1515###############################################################################
    1616
     
    1818ACLOCAL_AMFLAGS  = -I automake
    1919
    20 MAINTAINERCLEANFILES = lib/* bin/* tests/.deps/* tests/.out/*
    21  # order important
     20MAINTAINERCLEANFILES = lib/* bin/* tests/.deps/* tests/.out/* # order important
    2221
    2322SUBDIRS = driver src . @LIBCFA_TARGET_DIRS@
  • Makefile.in

    r9d9a451 r53bb8f1  
    250250distcleancheck_listfiles = find . -type f -print
    251251ACLOCAL = @ACLOCAL@
    252 ALLOCA = @ALLOCA@
    253252AMTAR = @AMTAR@
    254253AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
     
    396395AUTOMAKE_OPTIONS = foreign    # do not require all the GNU file names
    397396ACLOCAL_AMFLAGS = -I automake
    398 MAINTAINERCLEANFILES = lib/* bin/* tests/.deps/* tests/.out/*
     397MAINTAINERCLEANFILES = lib/* bin/* tests/.deps/* tests/.out/* # order important
    399398SUBDIRS = driver src . @LIBCFA_TARGET_DIRS@
    400399noinst_DATA = @LIBCFA_TARGET_MAKEFILES@
     
    928927.PRECIOUS: Makefile
    929928
    930  # order important
    931929
    932930@LIBCFA_TARGET_MAKEFILES@ : Makefile $(srcdir)/libcfa/configure
  • automake/cfa.m4

    r9d9a451 r53bb8f1  
    8080        esac
    8181])
     82
     83# http://git.savannah.gnu.org/gitweb/?p=autoconf-archive.git;a=blob_plain;f=m4/ax_check_compile_flag.m4
     84AC_DEFUN([M4CFA_CHECK_COMPILE_FLAG],
     85[AC_PREREQ(2.64)dnl for _AC_LANG_PREFIX and AS_VAR_IF
     86AS_VAR_PUSHDEF([CACHEVAR],[m4cfa_cv_check_[]_AC_LANG_ABBREV[]flags_$4_$1])dnl
     87AC_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])
     94AS_VAR_IF(CACHEVAR,yes,
     95        [m4_default([$2], :)],
     96        [m4_default([$3], :)])
     97AS_VAR_POPDEF([CACHEVAR])dnl
     98])dnl M4CFA_CHECK_COMPILE_FLAGS
  • benchmark/Makefile.am

    r9d9a451 r53bb8f1  
    2121include $(top_srcdir)/src/cfa.make
    2222
    23 UPPCC = u++
    24 
    2523AM_CFLAGS = -O2 -Wall -I$(srcdir) -lrt -pthread
    2624AM_CFAFLAGS = -quiet -in-tree -nodebug
    2725AM_UPPFLAGS = -quiet -nodebug -multi
    2826
    29 TOOLSDIR = ${abs_top_srcdir}/tools/
    30 REPEAT   = ${TOOLSDIR}repeat
    31 STATS    = ${TOOLSDIR}stat.py
     27BENCH_V_CC = $(__bench_v_CC_$(__quiet))
     28BENCH_V_CFA = $(__bench_v_CFA_$(__quiet))
     29BENCH_V_CXX = $(__bench_v_CXX_$(__quiet))
     30BENCH_V_GOC = $(__bench_v_GOC_$(__quiet))
     31BENCH_V_JAVAC = $(__bench_v_JAVAC_$(__quiet))
     32BENCH_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
     50TOOLSDIR = ${abs_top_builddir}/tools/
     51REPEAT   = ${abs_top_builddir}/tools/repeat
     52STATS    = ${abs_top_srcdir}/tools/stat.py
    3253repeats  = 30
    3354skipcompile = no
     
    3556PRINT_FORMAT = %20s: #Comments needed for spacing
    3657
    37 #prevent any tests in parallel
     58# Dummy hack tricks
     59EXTRA_PROGRAMS = dummy # build but do not install
     60dummy_SOURCES = dummyC.c dummyCXX.cpp
     61
     62dummyC.c:
     63        @echo "int main() { return 0; }" > ${@}
     64
     65dummyCXX.cpp:
     66        @echo "int main() { return 0; }" > ${@}
     67
    3868.NOTPARALLEL:
    39 
    40 #make sure automake includes the compile rules for C and C++
    41 EXTRA_PROGRAMS = dummy
    42 dummy_SOURCES = c.c cxx.cpp
    4369
    4470## =========================================================================================================
     
    5581
    5682%.runquiet :
    57         @+make $(basename $@) CFLAGS="-w"
     83        @+make $(basename $@) CFLAGS="-w" __quiet=quiet
    5884        @taskset -c 1 ./a.out
    5985        @rm -f a.out
     
    6490
    6591${REPEAT} :
    66         @+make -C ${TOOLSDIR} repeat
     92        @+make -C ${abs_top_builddir}/tools repeat
    6793
    6894## =========================================================================================================
     
    105131## =========================================================================================================
    106132loop$(EXEEXT):
    107         $(AM_V_CC)$(COMPILE) -DBENCH_N=5000000000 $(srcdir)/loop.c
     133        $(BENCH_V_CC)$(COMPILE) -DBENCH_N=5000000000 $(srcdir)/loop.c
    108134
    109135function$(EXEEXT):
    110         $(AM_V_CC)$(COMPILE) -DBENCH_N=5000000000 $(srcdir)/function.c
     136        $(BENCH_V_CC)$(COMPILE) -DBENCH_N=5000000000 $(srcdir)/function.c
    111137
    112138fetch_add$(EXEEXT):
    113         $(AM_V_CC)$(COMPILE) -DBENCH_N=500000000  $(srcdir)/fetch_add.c
     139        $(BENCH_V_CC)$(COMPILE) -DBENCH_N=500000000  $(srcdir)/fetch_add.c
    114140
    115141## =========================================================================================================
     
    134160
    135161ctxswitch-kos_fibre$(EXEEXT):
    136         $(AM_V_CXX)$(CXXCOMPILE) -DBENCH_N=50000000 $(srcdir)/ctxswitch/kos_fibre.cpp  -I$(LIBFIBRE_DIR) -lfibre
     162        $(BENCH_V_CXX)$(CXXCOMPILE) -DBENCH_N=50000000 $(srcdir)/ctxswitch/kos_fibre.cpp  -I$(LIBFIBRE_DIR) -lfibre
    137163
    138164ctxswitch-kos_fibre2$(EXEEXT):
    139         $(AM_V_CXX)$(CXXCOMPILE) -DBENCH_N=50000000 $(srcdir)/ctxswitch/kos_fibre2.cpp -I$(LIBFIBRE_DIR) -lfibre
     165        $(BENCH_V_CXX)$(CXXCOMPILE) -DBENCH_N=50000000 $(srcdir)/ctxswitch/kos_fibre2.cpp -I$(LIBFIBRE_DIR) -lfibre
    140166endif
    141167
     
    143169
    144170ctxswitch-pthread$(EXEEXT):
    145         $(AM_V_CC)$(COMPILE)    -DBENCH_N=50000000 $(srcdir)/ctxswitch/pthreads.c
     171        $(BENCH_V_CC)$(COMPILE)    -DBENCH_N=50000000 $(srcdir)/ctxswitch/pthreads.c
    146172
    147173ctxswitch-cfa_coroutine$(EXEEXT):
    148         $(AM_V_CFA)$(CFACOMPILE) -DBENCH_N=50000000 $(srcdir)/ctxswitch/cfa_cor.c
     174        $(BENCH_V_CFA)$(CFACOMPILE) -DBENCH_N=50000000 $(srcdir)/ctxswitch/cfa_cor.cfa
    149175
    150176ctxswitch-cfa_thread$(EXEEXT):
    151         $(AM_V_CFA)$(CFACOMPILE) -DBENCH_N=50000000 $(srcdir)/ctxswitch/cfa_thrd.c
     177        $(BENCH_V_CFA)$(CFACOMPILE) -DBENCH_N=50000000 $(srcdir)/ctxswitch/cfa_thrd.cfa
    152178
    153179ctxswitch-cfa_thread2$(EXEEXT):
    154         $(AM_V_CFA)$(CFACOMPILE) -DBENCH_N=50000000 $(srcdir)/ctxswitch/cfa_thrd2.c
     180        $(BENCH_V_CFA)$(CFACOMPILE) -DBENCH_N=50000000 $(srcdir)/ctxswitch/cfa_thrd2.cfa
    155181
    156182ctxswitch-upp_coroutine$(EXEEXT):
    157         $(AM_V_UPP)$(UPPCOMPILE) -DBENCH_N=50000000 $(srcdir)/ctxswitch/upp_cor.cc
     183        $(BENCH_V_UPP)$(UPPCOMPILE) -DBENCH_N=50000000 $(srcdir)/ctxswitch/upp_cor.cc
    158184
    159185ctxswitch-upp_thread$(EXEEXT):
    160         $(AM_V_UPP)$(UPPCOMPILE) -DBENCH_N=50000000 $(srcdir)/ctxswitch/upp_thrd.cc
     186        $(BENCH_V_UPP)$(UPPCOMPILE) -DBENCH_N=50000000 $(srcdir)/ctxswitch/upp_thrd.cc
    161187
    162188ctxswitch-goroutine$(EXEEXT):
    163         $(AM_V_GOC)go build -o a.out $(srcdir)/ctxswitch/goroutine.go
     189        $(BENCH_V_GOC)go build -o a.out $(srcdir)/ctxswitch/goroutine.go
    164190
    165191ctxswitch-java_thread$(EXEEXT):
    166         $(AM_V_JAVAC)javac -d $(builddir) $(srcdir)/ctxswitch/JavaThread.java
     192        $(BENCH_V_JAVAC)javac -d $(builddir) $(srcdir)/ctxswitch/JavaThread.java
    167193        @echo "#!/bin/sh" > a.out
    168194        @echo "java JavaThread" >> a.out
     
    182208
    183209mutex-pthread_lock$(EXEEXT):
    184         $(AM_V_CC)$(COMPILE)    -DBENCH_N=50000000 $(srcdir)/mutex/pthreads.c
     210        $(BENCH_V_CC)$(COMPILE)    -DBENCH_N=50000000 $(srcdir)/mutex/pthreads.c
    185211
    186212mutex-upp$(EXEEXT):
    187         $(AM_V_UPP)$(UPPCOMPILE) -DBENCH_N=50000000 $(srcdir)/mutex/upp.cc
     213        $(BENCH_V_UPP)$(UPPCOMPILE) -DBENCH_N=50000000 $(srcdir)/mutex/upp.cc
    188214
    189215mutex-cfa1$(EXEEXT):
    190         $(AM_V_CFA)$(CFACOMPILE) -DBENCH_N=5000000  $(srcdir)/mutex/cfa1.c
     216        $(BENCH_V_CFA)$(CFACOMPILE) -DBENCH_N=5000000  $(srcdir)/mutex/cfa1.cfa
    191217
    192218mutex-cfa2$(EXEEXT):
    193         $(AM_V_CFA)$(CFACOMPILE) -DBENCH_N=5000000  $(srcdir)/mutex/cfa2.c
     219        $(BENCH_V_CFA)$(CFACOMPILE) -DBENCH_N=5000000  $(srcdir)/mutex/cfa2.cfa
    194220
    195221mutex-cfa4$(EXEEXT):
    196         $(AM_V_CFA)$(CFACOMPILE) -DBENCH_N=5000000  $(srcdir)/mutex/cfa4.c
     222        $(BENCH_V_CFA)$(CFACOMPILE) -DBENCH_N=5000000  $(srcdir)/mutex/cfa4.cfa
    197223
    198224mutex-java_thread$(EXEEXT):
    199         $(AM_V_JAVAC)javac -d $(builddir) $(srcdir)/mutex/JavaThread.java
     225        $(BENCH_V_JAVAC)javac -d $(builddir) $(srcdir)/mutex/JavaThread.java
    200226        @echo "#!/bin/sh" > a.out
    201227        @echo "java JavaThread" >> a.out
     
    212238
    213239signal-pthread_cond$(EXEEXT):
    214         $(AM_V_CC)$(COMPILE)    -DBENCH_N=500000  $(srcdir)/schedint/pthreads.c
     240        $(BENCH_V_CC)$(COMPILE)    -DBENCH_N=500000  $(srcdir)/schedint/pthreads.c
    215241
    216242signal-upp$(EXEEXT):
    217         $(AM_V_UPP)$(UPPCOMPILE) -DBENCH_N=5000000 $(srcdir)/schedint/upp.cc
     243        $(BENCH_V_UPP)$(UPPCOMPILE) -DBENCH_N=5000000 $(srcdir)/schedint/upp.cc
    218244
    219245signal-cfa1$(EXEEXT):
    220         $(AM_V_CFA)$(CFACOMPILE) -DBENCH_N=500000  $(srcdir)/schedint/cfa1.c
     246        $(BENCH_V_CFA)$(CFACOMPILE) -DBENCH_N=500000  $(srcdir)/schedint/cfa1.cfa
    221247
    222248signal-cfa2$(EXEEXT):
    223         $(AM_V_CFA)$(CFACOMPILE) -DBENCH_N=500000  $(srcdir)/schedint/cfa2.c
     249        $(BENCH_V_CFA)$(CFACOMPILE) -DBENCH_N=500000  $(srcdir)/schedint/cfa2.cfa
    224250
    225251signal-cfa4$(EXEEXT):
    226         $(AM_V_CFA)$(CFACOMPILE) -DBENCH_N=500000  $(srcdir)/schedint/cfa4.c
     252        $(BENCH_V_CFA)$(CFACOMPILE) -DBENCH_N=500000  $(srcdir)/schedint/cfa4.cfa
    227253
    228254signal-java_thread$(EXEEXT):
    229         $(AM_V_JAVAC)javac -d $(builddir) $(srcdir)/schedint/JavaThread.java
     255        $(BENCH_V_JAVAC)javac -d $(builddir) $(srcdir)/schedint/JavaThread.java
    230256        @echo "#!/bin/sh" > a.out
    231257        @echo "java JavaThread" >> a.out
     
    241267
    242268waitfor-upp$(EXEEXT):
    243         $(AM_V_UPP)$(UPPCOMPILE) -DBENCH_N=5000000 $(srcdir)/schedext/upp.cc
     269        $(BENCH_V_UPP)$(UPPCOMPILE) -DBENCH_N=5000000 $(srcdir)/schedext/upp.cc
    244270
    245271waitfor-cfa1$(EXEEXT):
    246         $(AM_V_CFA)$(CFACOMPILE) -DBENCH_N=500000  $(srcdir)/schedext/cfa1.c
     272        $(BENCH_V_CFA)$(CFACOMPILE) -DBENCH_N=500000  $(srcdir)/schedext/cfa1.cfa
    247273
    248274waitfor-cfa2$(EXEEXT):
    249         $(AM_V_CFA)$(CFACOMPILE) -DBENCH_N=500000  $(srcdir)/schedext/cfa2.c
     275        $(BENCH_V_CFA)$(CFACOMPILE) -DBENCH_N=500000  $(srcdir)/schedext/cfa2.cfa
    250276
    251277waitfor-cfa4$(EXEEXT):
    252         $(AM_V_CFA)$(CFACOMPILE) -DBENCH_N=500000  $(srcdir)/schedext/cfa4.c
     278        $(BENCH_V_CFA)$(CFACOMPILE) -DBENCH_N=500000  $(srcdir)/schedext/cfa4.cfa
    253279
    254280## =========================================================================================================
     
    264290
    265291creation-cfa_coroutine$(EXEEXT):
    266         $(AM_V_CFA)$(CFACOMPILE) -DBENCH_N=10000000 $(srcdir)/creation/cfa_cor.c
     292        $(BENCH_V_CFA)$(CFACOMPILE) -DBENCH_N=10000000 $(srcdir)/creation/cfa_cor.cfa
    267293
    268294creation-cfa_coroutine_eager$(EXEEXT):
    269         $(AM_V_CFA)$(CFACOMPILE) -DBENCH_N=10000000 $(srcdir)/creation/cfa_cor.c
     295        $(BENCH_V_CFA)$(CFACOMPILE) -DBENCH_N=10000000 $(srcdir)/creation/cfa_cor.cfa  -DEAGER
    270296
    271297creation-cfa_thread$(EXEEXT):
    272         $(AM_V_CFA)$(CFACOMPILE) -DBENCH_N=10000000 $(srcdir)/creation/cfa_thrd.c
     298        $(BENCH_V_CFA)$(CFACOMPILE) -DBENCH_N=10000000 $(srcdir)/creation/cfa_thrd.cfa
    273299
    274300creation-upp_coroutine$(EXEEXT):
    275         $(AM_V_UPP)$(UPPCOMPILE) -DBENCH_N=50000000 $(srcdir)/creation/upp_cor.cc
     301        $(BENCH_V_UPP)$(UPPCOMPILE) -DBENCH_N=50000000 $(srcdir)/creation/upp_cor.cc
    276302
    277303creation-upp_thread$(EXEEXT):
    278         $(AM_V_UPP)$(UPPCOMPILE) -DBENCH_N=50000000 $(srcdir)/creation/upp_thrd.cc
     304        $(BENCH_V_UPP)$(UPPCOMPILE) -DBENCH_N=50000000 $(srcdir)/creation/upp_thrd.cc
    279305
    280306creation-pthread$(EXEEXT):
    281         $(AM_V_CC)$(COMPILE)    -DBENCH_N=250000   $(srcdir)/creation/pthreads.c
     307        $(BENCH_V_CC)$(COMPILE)    -DBENCH_N=250000   $(srcdir)/creation/pthreads.c
    282308
    283309creation-goroutine$(EXEEXT):
    284         $(AM_V_GOC)go build -o a.out $(srcdir)/creation/goroutine.go
     310        $(BENCH_V_GOC)go build -o a.out $(srcdir)/creation/goroutine.go
    285311
    286312creation-java_thread$(EXEEXT):
    287         $(AM_V_JAVAC)javac -d $(builddir) $(srcdir)/creation/JavaThread.java
     313        $(BENCH_V_JAVAC)javac -d $(builddir) $(srcdir)/creation/JavaThread.java
    288314        @echo "#!/bin/sh" > a.out
    289315        @echo "java JavaThread" >> a.out
     
    306332
    307333compile-array$(EXEEXT):
    308         $(AM_V_CFA)$(CFACOMPILE) -fsyntax-only -w $(testdir)/array.c
     334        @$(CFACOMPILE) -fsyntax-only -w $(testdir)/array.cfa
    309335
    310336compile-attributes$(EXEEXT):
    311         $(AM_V_CFA)$(CFACOMPILE) -fsyntax-only -w $(testdir)/attributes.cfa
     337        @$(CFACOMPILE) -fsyntax-only -w $(testdir)/attributes.cfa
    312338
    313339compile-empty$(EXEEXT):
    314         $(AM_V_CFA)$(CFACOMPILE) -fsyntax-only -w $(srcdir)/compile/empty.c
     340        @$(CFACOMPILE) -fsyntax-only -w $(srcdir)/compile/empty.cfa
    315341
    316342compile-expression$(EXEEXT):
    317         $(AM_V_CFA)$(CFACOMPILE) -fsyntax-only -w $(testdir)/expression.c
     343        @$(CFACOMPILE) -fsyntax-only -w $(testdir)/expression.cfa
    318344
    319345compile-io$(EXEEXT):
    320         $(AM_V_CFA)$(CFACOMPILE) -fsyntax-only -w $(testdir)/io1.c
     346        @$(CFACOMPILE) -fsyntax-only -w $(testdir)/io1.cfa
    321347
    322348compile-monitor$(EXEEXT):
    323         $(AM_V_CFA)$(CFACOMPILE) -fsyntax-only -w $(testdir)/concurrent/monitor.c
     349        @$(CFACOMPILE) -fsyntax-only -w $(testdir)/concurrent/monitor.cfa
    324350
    325351compile-operators$(EXEEXT):
    326         $(AM_V_CFA)$(CFACOMPILE) -fsyntax-only -w $(testdir)/operators.c
     352        @$(CFACOMPILE) -fsyntax-only -w $(testdir)/operators.cfa
    327353
    328354compile-thread$(EXEEXT):
    329         $(AM_V_CFA)$(CFACOMPILE) -fsyntax-only -w $(testdir)/concurrent/thread.c
     355        @$(CFACOMPILE) -fsyntax-only -w $(testdir)/concurrent/thread.cfa
    330356
    331357compile-typeof$(EXEEXT):
    332         $(AM_V_CFA)$(CFACOMPILE) -fsyntax-only -w $(testdir)/typeof.c
    333 
     358        @$(CFACOMPILE) -fsyntax-only -w $(testdir)/typeof.cfa
     359
  • benchmark/Makefile.in

    r9d9a451 r53bb8f1  
    111111CONFIG_CLEAN_FILES =
    112112CONFIG_CLEAN_VPATH_FILES =
    113 am_dummy_OBJECTS = c.$(OBJEXT) cxx.$(OBJEXT)
     113am_dummy_OBJECTS = dummyC.$(OBJEXT) dummyCXX.$(OBJEXT)
    114114dummy_OBJECTS = $(am_dummy_OBJECTS)
    115115dummy_LDADD = $(LDADD)
     
    200200DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
    201201ACLOCAL = @ACLOCAL@
    202 ALLOCA = @ALLOCA@
    203202AMTAR = @AMTAR@
    204203AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
     
    364363am__v_GOC_0 = @echo "  GOC     " $@;
    365364am__v_GOC_1 =
     365UPPCC = u++
    366366UPPCOMPILE = $(UPPCC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_UPPFLAGS) $(UPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) $(AM_CFLAGS) $(CFLAGS)
    367367AM_V_UPP = $(am__v_UPP_@AM_V@)
     
    371371
    372372# applies to both programs
    373 UPPCC = u++
    374373AM_CFLAGS = -O2 -Wall -I$(srcdir) -lrt -pthread
    375374AM_CFAFLAGS = -quiet -in-tree -nodebug
    376375AM_UPPFLAGS = -quiet -nodebug -multi
    377 TOOLSDIR = ${abs_top_srcdir}/tools/
    378 REPEAT = ${TOOLSDIR}repeat
    379 STATS = ${TOOLSDIR}stat.py
     376BENCH_V_CC = $(__bench_v_CC_$(__quiet))
     377BENCH_V_CFA = $(__bench_v_CFA_$(__quiet))
     378BENCH_V_CXX = $(__bench_v_CXX_$(__quiet))
     379BENCH_V_GOC = $(__bench_v_GOC_$(__quiet))
     380BENCH_V_JAVAC = $(__bench_v_JAVAC_$(__quiet))
     381BENCH_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)
     395TOOLSDIR = ${abs_top_builddir}/tools/
     396REPEAT = ${abs_top_builddir}/tools/repeat
     397STATS = ${abs_top_srcdir}/tools/stat.py
    380398repeats = 30
    381399skipcompile = no
    382400TIME_FORMAT = "%E"
    383401PRINT_FORMAT = %20s: #Comments needed for spacing
    384 dummy_SOURCES = c.c cxx.cpp
     402dummy_SOURCES = dummyC.c dummyCXX.cpp
    385403CTXSWITCH_DEPEND = loop.run function.run fetch_add.run \
    386404        ctxswitch-pthread.run ctxswitch-cfa_coroutine.run \
     
    435453        -rm -f *.tab.c
    436454
    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@
    439457
    440458.c.o:
     
    706724        $(am__mv) $$depbase.Tpo $$depbase.Plo
    707725
    708 #prevent any tests in parallel
     726dummyC.c:
     727        @echo "int main() { return 0; }" > ${@}
     728
     729dummyCXX.cpp:
     730        @echo "int main() { return 0; }" > ${@}
     731
    709732.NOTPARALLEL:
    710733
     
    721744
    722745%.runquiet :
    723         @+make $(basename $@) CFLAGS="-w"
     746        @+make $(basename $@) CFLAGS="-w" __quiet=quiet
    724747        @taskset -c 1 ./a.out
    725748        @rm -f a.out
     
    730753
    731754${REPEAT} :
    732         @+make -C ${TOOLSDIR} repeat
     755        @+make -C ${abs_top_builddir}/tools repeat
    733756
    734757jenkins$(EXEEXT):
     
    768791
    769792loop$(EXEEXT):
    770         $(AM_V_CC)$(COMPILE) -DBENCH_N=5000000000 $(srcdir)/loop.c
     793        $(BENCH_V_CC)$(COMPILE) -DBENCH_N=5000000000 $(srcdir)/loop.c
    771794
    772795function$(EXEEXT):
    773         $(AM_V_CC)$(COMPILE) -DBENCH_N=5000000000 $(srcdir)/function.c
     796        $(BENCH_V_CC)$(COMPILE) -DBENCH_N=5000000000 $(srcdir)/function.c
    774797
    775798fetch_add$(EXEEXT):
    776         $(AM_V_CC)$(COMPILE) -DBENCH_N=500000000  $(srcdir)/fetch_add.c
     799        $(BENCH_V_CC)$(COMPILE) -DBENCH_N=500000000  $(srcdir)/fetch_add.c
    777800
    778801@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) -lfibre
     802@WITH_LIBFIBRE_TRUE@    $(BENCH_V_CXX)$(CXXCOMPILE) -DBENCH_N=50000000 $(srcdir)/ctxswitch/kos_fibre.cpp  -I$(LIBFIBRE_DIR) -lfibre
    780803
    781804@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) -lfibre
     805@WITH_LIBFIBRE_TRUE@    $(BENCH_V_CXX)$(CXXCOMPILE) -DBENCH_N=50000000 $(srcdir)/ctxswitch/kos_fibre2.cpp -I$(LIBFIBRE_DIR) -lfibre
    783806
    784807ctxswitch$(EXEEXT): $(CTXSWITCH_DEPEND)
    785808
    786809ctxswitch-pthread$(EXEEXT):
    787         $(AM_V_CC)$(COMPILE)    -DBENCH_N=50000000 $(srcdir)/ctxswitch/pthreads.c
     810        $(BENCH_V_CC)$(COMPILE)    -DBENCH_N=50000000 $(srcdir)/ctxswitch/pthreads.c
    788811
    789812ctxswitch-cfa_coroutine$(EXEEXT):
    790         $(AM_V_CFA)$(CFACOMPILE) -DBENCH_N=50000000 $(srcdir)/ctxswitch/cfa_cor.c
     813        $(BENCH_V_CFA)$(CFACOMPILE) -DBENCH_N=50000000 $(srcdir)/ctxswitch/cfa_cor.cfa
    791814
    792815ctxswitch-cfa_thread$(EXEEXT):
    793         $(AM_V_CFA)$(CFACOMPILE) -DBENCH_N=50000000 $(srcdir)/ctxswitch/cfa_thrd.c
     816        $(BENCH_V_CFA)$(CFACOMPILE) -DBENCH_N=50000000 $(srcdir)/ctxswitch/cfa_thrd.cfa
    794817
    795818ctxswitch-cfa_thread2$(EXEEXT):
    796         $(AM_V_CFA)$(CFACOMPILE) -DBENCH_N=50000000 $(srcdir)/ctxswitch/cfa_thrd2.c
     819        $(BENCH_V_CFA)$(CFACOMPILE) -DBENCH_N=50000000 $(srcdir)/ctxswitch/cfa_thrd2.cfa
    797820
    798821ctxswitch-upp_coroutine$(EXEEXT):
    799         $(AM_V_UPP)$(UPPCOMPILE) -DBENCH_N=50000000 $(srcdir)/ctxswitch/upp_cor.cc
     822        $(BENCH_V_UPP)$(UPPCOMPILE) -DBENCH_N=50000000 $(srcdir)/ctxswitch/upp_cor.cc
    800823
    801824ctxswitch-upp_thread$(EXEEXT):
    802         $(AM_V_UPP)$(UPPCOMPILE) -DBENCH_N=50000000 $(srcdir)/ctxswitch/upp_thrd.cc
     825        $(BENCH_V_UPP)$(UPPCOMPILE) -DBENCH_N=50000000 $(srcdir)/ctxswitch/upp_thrd.cc
    803826
    804827ctxswitch-goroutine$(EXEEXT):
    805         $(AM_V_GOC)go build -o a.out $(srcdir)/ctxswitch/goroutine.go
     828        $(BENCH_V_GOC)go build -o a.out $(srcdir)/ctxswitch/goroutine.go
    806829
    807830ctxswitch-java_thread$(EXEEXT):
    808         $(AM_V_JAVAC)javac -d $(builddir) $(srcdir)/ctxswitch/JavaThread.java
     831        $(BENCH_V_JAVAC)javac -d $(builddir) $(srcdir)/ctxswitch/JavaThread.java
    809832        @echo "#!/bin/sh" > a.out
    810833        @echo "java JavaThread" >> a.out
     
    823846
    824847mutex-pthread_lock$(EXEEXT):
    825         $(AM_V_CC)$(COMPILE)    -DBENCH_N=50000000 $(srcdir)/mutex/pthreads.c
     848        $(BENCH_V_CC)$(COMPILE)    -DBENCH_N=50000000 $(srcdir)/mutex/pthreads.c
    826849
    827850mutex-upp$(EXEEXT):
    828         $(AM_V_UPP)$(UPPCOMPILE) -DBENCH_N=50000000 $(srcdir)/mutex/upp.cc
     851        $(BENCH_V_UPP)$(UPPCOMPILE) -DBENCH_N=50000000 $(srcdir)/mutex/upp.cc
    829852
    830853mutex-cfa1$(EXEEXT):
    831         $(AM_V_CFA)$(CFACOMPILE) -DBENCH_N=5000000  $(srcdir)/mutex/cfa1.c
     854        $(BENCH_V_CFA)$(CFACOMPILE) -DBENCH_N=5000000  $(srcdir)/mutex/cfa1.cfa
    832855
    833856mutex-cfa2$(EXEEXT):
    834         $(AM_V_CFA)$(CFACOMPILE) -DBENCH_N=5000000  $(srcdir)/mutex/cfa2.c
     857        $(BENCH_V_CFA)$(CFACOMPILE) -DBENCH_N=5000000  $(srcdir)/mutex/cfa2.cfa
    835858
    836859mutex-cfa4$(EXEEXT):
    837         $(AM_V_CFA)$(CFACOMPILE) -DBENCH_N=5000000  $(srcdir)/mutex/cfa4.c
     860        $(BENCH_V_CFA)$(CFACOMPILE) -DBENCH_N=5000000  $(srcdir)/mutex/cfa4.cfa
    838861
    839862mutex-java_thread$(EXEEXT):
    840         $(AM_V_JAVAC)javac -d $(builddir) $(srcdir)/mutex/JavaThread.java
     863        $(BENCH_V_JAVAC)javac -d $(builddir) $(srcdir)/mutex/JavaThread.java
    841864        @echo "#!/bin/sh" > a.out
    842865        @echo "java JavaThread" >> a.out
     
    852875
    853876signal-pthread_cond$(EXEEXT):
    854         $(AM_V_CC)$(COMPILE)    -DBENCH_N=500000  $(srcdir)/schedint/pthreads.c
     877        $(BENCH_V_CC)$(COMPILE)    -DBENCH_N=500000  $(srcdir)/schedint/pthreads.c
    855878
    856879signal-upp$(EXEEXT):
    857         $(AM_V_UPP)$(UPPCOMPILE) -DBENCH_N=5000000 $(srcdir)/schedint/upp.cc
     880        $(BENCH_V_UPP)$(UPPCOMPILE) -DBENCH_N=5000000 $(srcdir)/schedint/upp.cc
    858881
    859882signal-cfa1$(EXEEXT):
    860         $(AM_V_CFA)$(CFACOMPILE) -DBENCH_N=500000  $(srcdir)/schedint/cfa1.c
     883        $(BENCH_V_CFA)$(CFACOMPILE) -DBENCH_N=500000  $(srcdir)/schedint/cfa1.cfa
    861884
    862885signal-cfa2$(EXEEXT):
    863         $(AM_V_CFA)$(CFACOMPILE) -DBENCH_N=500000  $(srcdir)/schedint/cfa2.c
     886        $(BENCH_V_CFA)$(CFACOMPILE) -DBENCH_N=500000  $(srcdir)/schedint/cfa2.cfa
    864887
    865888signal-cfa4$(EXEEXT):
    866         $(AM_V_CFA)$(CFACOMPILE) -DBENCH_N=500000  $(srcdir)/schedint/cfa4.c
     889        $(BENCH_V_CFA)$(CFACOMPILE) -DBENCH_N=500000  $(srcdir)/schedint/cfa4.cfa
    867890
    868891signal-java_thread$(EXEEXT):
    869         $(AM_V_JAVAC)javac -d $(builddir) $(srcdir)/schedint/JavaThread.java
     892        $(BENCH_V_JAVAC)javac -d $(builddir) $(srcdir)/schedint/JavaThread.java
    870893        @echo "#!/bin/sh" > a.out
    871894        @echo "java JavaThread" >> a.out
     
    879902
    880903waitfor-upp$(EXEEXT):
    881         $(AM_V_UPP)$(UPPCOMPILE) -DBENCH_N=5000000 $(srcdir)/schedext/upp.cc
     904        $(BENCH_V_UPP)$(UPPCOMPILE) -DBENCH_N=5000000 $(srcdir)/schedext/upp.cc
    882905
    883906waitfor-cfa1$(EXEEXT):
    884         $(AM_V_CFA)$(CFACOMPILE) -DBENCH_N=500000  $(srcdir)/schedext/cfa1.c
     907        $(BENCH_V_CFA)$(CFACOMPILE) -DBENCH_N=500000  $(srcdir)/schedext/cfa1.cfa
    885908
    886909waitfor-cfa2$(EXEEXT):
    887         $(AM_V_CFA)$(CFACOMPILE) -DBENCH_N=500000  $(srcdir)/schedext/cfa2.c
     910        $(BENCH_V_CFA)$(CFACOMPILE) -DBENCH_N=500000  $(srcdir)/schedext/cfa2.cfa
    888911
    889912waitfor-cfa4$(EXEEXT):
    890         $(AM_V_CFA)$(CFACOMPILE) -DBENCH_N=500000  $(srcdir)/schedext/cfa4.c
     913        $(BENCH_V_CFA)$(CFACOMPILE) -DBENCH_N=500000  $(srcdir)/schedext/cfa4.cfa
    891914
    892915creation$(EXEEXT) :\
     
    901924
    902925creation-cfa_coroutine$(EXEEXT):
    903         $(AM_V_CFA)$(CFACOMPILE) -DBENCH_N=10000000 $(srcdir)/creation/cfa_cor.c
     926        $(BENCH_V_CFA)$(CFACOMPILE) -DBENCH_N=10000000 $(srcdir)/creation/cfa_cor.cfa
    904927
    905928creation-cfa_coroutine_eager$(EXEEXT):
    906         $(AM_V_CFA)$(CFACOMPILE) -DBENCH_N=10000000 $(srcdir)/creation/cfa_cor.c
     929        $(BENCH_V_CFA)$(CFACOMPILE) -DBENCH_N=10000000 $(srcdir)/creation/cfa_cor.cfa  -DEAGER
    907930
    908931creation-cfa_thread$(EXEEXT):
    909         $(AM_V_CFA)$(CFACOMPILE) -DBENCH_N=10000000 $(srcdir)/creation/cfa_thrd.c
     932        $(BENCH_V_CFA)$(CFACOMPILE) -DBENCH_N=10000000 $(srcdir)/creation/cfa_thrd.cfa
    910933
    911934creation-upp_coroutine$(EXEEXT):
    912         $(AM_V_UPP)$(UPPCOMPILE) -DBENCH_N=50000000 $(srcdir)/creation/upp_cor.cc
     935        $(BENCH_V_UPP)$(UPPCOMPILE) -DBENCH_N=50000000 $(srcdir)/creation/upp_cor.cc
    913936
    914937creation-upp_thread$(EXEEXT):
    915         $(AM_V_UPP)$(UPPCOMPILE) -DBENCH_N=50000000 $(srcdir)/creation/upp_thrd.cc
     938        $(BENCH_V_UPP)$(UPPCOMPILE) -DBENCH_N=50000000 $(srcdir)/creation/upp_thrd.cc
    916939
    917940creation-pthread$(EXEEXT):
    918         $(AM_V_CC)$(COMPILE)    -DBENCH_N=250000   $(srcdir)/creation/pthreads.c
     941        $(BENCH_V_CC)$(COMPILE)    -DBENCH_N=250000   $(srcdir)/creation/pthreads.c
    919942
    920943creation-goroutine$(EXEEXT):
    921         $(AM_V_GOC)go build -o a.out $(srcdir)/creation/goroutine.go
     944        $(BENCH_V_GOC)go build -o a.out $(srcdir)/creation/goroutine.go
    922945
    923946creation-java_thread$(EXEEXT):
    924         $(AM_V_JAVAC)javac -d $(builddir) $(srcdir)/creation/JavaThread.java
     947        $(BENCH_V_JAVAC)javac -d $(builddir) $(srcdir)/creation/JavaThread.java
    925948        @echo "#!/bin/sh" > a.out
    926949        @echo "java JavaThread" >> a.out
     
    938961
    939962compile-array$(EXEEXT):
    940         $(AM_V_CFA)$(CFACOMPILE) -fsyntax-only -w $(testdir)/array.c
     963        @$(CFACOMPILE) -fsyntax-only -w $(testdir)/array.cfa
    941964
    942965compile-attributes$(EXEEXT):
    943         $(AM_V_CFA)$(CFACOMPILE) -fsyntax-only -w $(testdir)/attributes.cfa
     966        @$(CFACOMPILE) -fsyntax-only -w $(testdir)/attributes.cfa
    944967
    945968compile-empty$(EXEEXT):
    946         $(AM_V_CFA)$(CFACOMPILE) -fsyntax-only -w $(srcdir)/compile/empty.c
     969        @$(CFACOMPILE) -fsyntax-only -w $(srcdir)/compile/empty.cfa
    947970
    948971compile-expression$(EXEEXT):
    949         $(AM_V_CFA)$(CFACOMPILE) -fsyntax-only -w $(testdir)/expression.c
     972        @$(CFACOMPILE) -fsyntax-only -w $(testdir)/expression.cfa
    950973
    951974compile-io$(EXEEXT):
    952         $(AM_V_CFA)$(CFACOMPILE) -fsyntax-only -w $(testdir)/io1.c
     975        @$(CFACOMPILE) -fsyntax-only -w $(testdir)/io1.cfa
    953976
    954977compile-monitor$(EXEEXT):
    955         $(AM_V_CFA)$(CFACOMPILE) -fsyntax-only -w $(testdir)/concurrent/monitor.c
     978        @$(CFACOMPILE) -fsyntax-only -w $(testdir)/concurrent/monitor.cfa
    956979
    957980compile-operators$(EXEEXT):
    958         $(AM_V_CFA)$(CFACOMPILE) -fsyntax-only -w $(testdir)/operators.c
     981        @$(CFACOMPILE) -fsyntax-only -w $(testdir)/operators.cfa
    959982
    960983compile-thread$(EXEEXT):
    961         $(AM_V_CFA)$(CFACOMPILE) -fsyntax-only -w $(testdir)/concurrent/thread.c
     984        @$(CFACOMPILE) -fsyntax-only -w $(testdir)/concurrent/thread.cfa
    962985
    963986compile-typeof$(EXEEXT):
    964         $(AM_V_CFA)$(CFACOMPILE) -fsyntax-only -w $(testdir)/typeof.c
     987        @$(CFACOMPILE) -fsyntax-only -w $(testdir)/typeof.cfa
    965988
    966989# Tell versions [3.59,3.63) of GNU make to not export all variables.
  • configure

    r9d9a451 r53bb8f1  
    637637LIBOBJS
    638638CFA_BACKEND_CC
    639 ALLOCA
    640639WITH_LIBFIBRE_FALSE
    641640WITH_LIBFIBRE_TRUE
     
    19611960} # ac_fn_cxx_try_link
    19621961
    1963 # ac_fn_c_check_type LINENO TYPE VAR INCLUDES
    1964 # -------------------------------------------
    1965 # Tests whether TYPE exists after having included INCLUDES, setting cache
    1966 # variable VAR accordingly.
    1967 ac_fn_c_check_type ()
    1968 {
    1969   as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
    1970   { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5
    1971 $as_echo_n "checking for $2... " >&6; }
    1972 if eval \${$3+:} false; then :
    1973   $as_echo_n "(cached) " >&6
    1974 else
    1975   eval "$3=no"
    1976   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
    1977 /* end confdefs.h.  */
    1978 $4
    1979 int
    1980 main ()
    1981 {
    1982 if (sizeof ($2))
    1983          return 0;
    1984   ;
    1985   return 0;
    1986 }
    1987 _ACEOF
    1988 if ac_fn_c_try_compile "$LINENO"; then :
    1989   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
    1990 /* end confdefs.h.  */
    1991 $4
    1992 int
    1993 main ()
    1994 {
    1995 if (sizeof (($2)))
    1996             return 0;
    1997   ;
    1998   return 0;
    1999 }
    2000 _ACEOF
    2001 if ac_fn_c_try_compile "$LINENO"; then :
    2002 
    2003 else
    2004   eval "$3=yes"
    2005 fi
    2006 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
    2007 fi
    2008 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
    2009 fi
    2010 eval ac_res=\$$3
    2011                { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
    2012 $as_echo "$ac_res" >&6; }
    2013   eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
    2014 
    2015 } # ac_fn_c_check_type
    2016 
    20171962# ac_fn_c_check_header_mongrel LINENO HEADER VAR INCLUDES
    20181963# -------------------------------------------------------
     
    21062051} # ac_fn_c_check_header_mongrel
    21072052
    2108 # ac_fn_c_find_intX_t LINENO BITS VAR
    2109 # -----------------------------------
    2110 # Finds a signed integer type with width BITS, setting cache variable VAR
    2111 # accordingly.
    2112 ac_fn_c_find_intX_t ()
     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.
     2057ac_fn_c_check_type ()
    21132058{
    21142059  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" >&5
    2116 $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; }
    21172062if eval \${$3+:} false; then :
    21182063  $as_echo_n "(cached) " >&6
    21192064else
    21202065  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
    21262067/* end confdefs.h.  */
    2127 $ac_includes_default
    2128              enum { N = $2 / 2 - 1 };
     2068$4
    21292069int
    21302070main ()
    21312071{
    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 
     2072if (sizeof ($2))
     2073         return 0;
    21362074  ;
    21372075  return 0;
     
    21412079  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
    21422080/* end confdefs.h.  */
    2143 $ac_includes_default
    2144                 enum { N = $2 / 2 - 1 };
     2081$4
    21452082int
    21462083main ()
    21472084{
    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 
     2085if (sizeof (($2)))
     2086            return 0;
    21532087  ;
    21542088  return 0;
     
    21582092
    21592093else
    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"
    21662095fi
    21672096rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
    21682097fi
    21692098rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
    2170        if eval test \"x\$"$3"\" = x"no"; then :
    2171 
    2172 else
    2173   break
    2174 fi
    2175      done
    21762099fi
    21772100eval ac_res=\$$3
     
    21802103  eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
    21812104
    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
    22372106cat >config.log <<_ACEOF
    22382107This file contains any messages produced by compilers while
     
    26672536
    26682537
     2538# http://git.savannah.gnu.org/gitweb/?p=autoconf-archive.git;a=blob_plain;f=m4/ax_check_compile_flag.m4
     2539
    26692540
    26702541# don't use the default CFLAGS as they unconditonnaly add -O2
     
    51835054
    51845055
    5185         # deprecated
    51865056# These are often not installed and people miss seeing the "no", so stop the configure.
    51875057for ac_prog in 'bison -y' byacc
     
    1673416604
    1673516605
    16736 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ${MAKE-make} sets \$(MAKE)" >&5
    16737 $as_echo_n "checking whether ${MAKE-make} sets \$(MAKE)... " >&6; }
    16738 set x ${MAKE-make}
    16739 ac_make=`$as_echo "$2" | sed 's/+/p/g; s/[^a-zA-Z0-9_]/_/g'`
    16740 if eval \${ac_cv_prog_make_${ac_make}_set+:} false; then :
    16741   $as_echo_n "(cached) " >&6
    16742 else
    16743   cat >conftest.make <<\_ACEOF
    16744 SHELL = /bin/sh
    16745 all:
    16746         @echo '@@@%%%=$(MAKE)=@@@%%%'
    16747 _ACEOF
    16748 # GNU make sometimes prints "make[1]: Entering ...", which would confuse us.
    16749 case `${MAKE-make} -f conftest.make 2>/dev/null` in
    16750   *@@@%%%=?*=@@@%%%*)
    16751     eval ac_cv_prog_make_${ac_make}_set=yes;;
    16752   *)
    16753     eval ac_cv_prog_make_${ac_make}_set=no;;
    16754 esac
    16755 rm -f conftest.make
    16756 fi
    16757 if eval test \$ac_cv_prog_make_${ac_make}_set = yes; then
    16758   { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
    16759 $as_echo "yes" >&6; }
    16760   SET_MAKE=
    16761 else
    16762   { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
    16763 $as_echo "no" >&6; }
    16764   SET_MAKE="MAKE=${MAKE-make}"
    16765 fi
    16766 
    1676716606
    1676816607# Checks for libraries.
     
    1681916658
    1682016659# 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
     16660for ac_header in libintl.h malloc.h unistd.h
    1701916661do :
    1702016662  as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
     
    1702516667_ACEOF
    1702616668
     16669else
     16670  echo "Error: Missing required header"; exit 1
    1702716671fi
    1702816672
     
    1703116675
    1703216676# 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 :
     16677ac_fn_c_check_type "$LINENO" "_Float32" "ac_cv_type__Float32" "
     16678"
     16679if test "x$ac_cv_type__Float32" = xyes; then :
     16680
     16681cat >>confdefs.h <<_ACEOF
     16682#define HAVE__FLOAT32 1
     16683_ACEOF
     16684
     16685
     16686$as_echo "#define HAVE_KEYWORDS_FLOATXX /**/" >>confdefs.h
     16687
     16688fi
     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; }
     16694if ${m4cfa_cv_check_cflags___Wcast_function_type+:} false; then :
    1703616695  $as_echo_n "(cached) " >&6
    1703716696else
    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
    1703916701/* end confdefs.h.  */
    17040 
    17041              #include <stdbool.h>
    17042              #ifndef bool
    17043               "error: bool is not defined"
    17044              #endif
    17045              #ifndef false
    17046               "error: false is not defined"
    17047              #endif
    17048              #if false
    17049               "error: false is not 0"
    17050              #endif
    17051              #ifndef true
    17052               "error: true is not defined"
    17053              #endif
    17054              #if true != 1
    17055               "error: true is not 1"
    17056              #endif
    17057              #ifndef __bool_true_false_are_defined
    17058               "error: __bool_true_false_are_defined is not defined"
    17059              #endif
    17060 
    17061              struct s { _Bool s: 1; _Bool t; } s;
    17062 
    17063              char a[true == 1 ? 1 : -1];
    17064              char b[false == 0 ? 1 : -1];
    17065              char c[__bool_true_false_are_defined == 1 ? 1 : -1];
    17066              char d[(bool) 0.5 == true ? 1 : -1];
    17067              /* See body of main program for 'e'.  */
    17068              char f[(_Bool) 0.0 == false ? 1 : -1];
    17069              char g[true];
    17070              char h[sizeof (_Bool)];
    17071              char i[sizeof s.t];
    17072              enum { j = false, k = true, l = false * true, m = true * 256 };
    17073              /* The following fails for
    17074                 HP aC++/ANSI C B3910B A.05.55 [Dec 04 2003]. */
    17075              _Bool n[m];
    17076              char o[sizeof n == m * sizeof n[0] ? 1 : -1];
    17077              char p[-1 - (_Bool) 0 < 0 && -1 - (bool) 0 < 0 ? 1 : -1];
    17078              /* Catch a bug in an HP-UX C compiler.  See
    17079                 http://gcc.gnu.org/ml/gcc-patches/2003-12/msg02303.html
    17080                 http://lists.gnu.org/archive/html/bug-coreutils/2005-11/msg00161.html
    17081               */
    17082              _Bool q = true;
    17083              _Bool *pq = &q;
    1708416702
    1708516703int
    1708616704main ()
    1708716705{
    17088 
    17089              bool e = &s;
    17090              *pq |= q;
    17091              *pq |= ! q;
    17092              /* Refer to every declared value, to avoid compiler optimizations.  */
    17093              return (!a + !b + !c + !d + !e + !f + !g + !h + !i + !!j + !k + !!l
    17094                      + !m + !n + !o + !p + !q + !pq);
    1709516706
    1709616707  ;
     
    1709916710_ACEOF
    1710016711if ac_fn_c_try_compile "$LINENO"; then :
    17101   ac_cv_header_stdbool_h=yes
    17102 else
    17103   ac_cv_header_stdbool_h=no
     16712  m4cfa_cv_check_cflags___Wcast_function_type=yes
     16713else
     16714  m4cfa_cv_check_cflags___Wcast_function_type=no
    1710416715fi
    1710516716rm -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
     16718fi
     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; }
     16721if test "x$m4cfa_cv_check_cflags___Wcast_function_type" = xyes; then :
     16722
     16723$as_echo "#define HAVE_CAST_FUNCTION_TYPE /**/" >>confdefs.h
     16724
     16725else
     16726  :
     16727fi
    1731116728
    1731216729
  • configure.ac

    r9d9a451 r53bb8f1  
    178178AC_PROG_CC
    179179AM_PROG_AS
    180 AM_PROG_CC_C_O  # deprecated
    181180# These are often not installed and people miss seeing the "no", so stop the configure.
    182181AC_PROG_YACC
     
    186185AC_PROG_LIBTOOL
    187186AC_PROG_INSTALL
    188 AC_PROG_MAKE_SET
    189187
    190188# Checks for libraries.
     
    193191
    194192# 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])
     193AC_CHECK_HEADERS([libintl.h malloc.h unistd.h], [], [echo "Error: Missing required header"; exit 1])
    197194
    198195# 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])
     196AC_CHECK_TYPES([_Float32], AC_DEFINE([HAVE_KEYWORDS_FLOATXX], [], [Have keywords _FloatXX.]), [], [[]])
     197
     198# Checks for compiler flags.
     199M4CFA_CHECK_COMPILE_FLAG([-Wcast-function-type], AC_DEFINE([HAVE_CAST_FUNCTION_TYPE], [], [Have compiler warning cast-function-type.]))
    212200
    213201#==============================================================================
  • doc/LaTeXmacros/lstlang.sty

    r9d9a451 r53bb8f1  
    88%% Created On       : Sat May 13 16:34:42 2017
    99%% Last Modified By : Peter A. Buhr
    10 %% Last Modified On : Fri Apr  6 23:44:50 2018
    11 %% Update Count     : 20
     10%% Last Modified On : Tue Jan  8 14:40:33 2019
     11%% Update Count     : 21
    1212%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
    1313
     
    114114                _Alignas, _Alignof, __alignof, __alignof__, asm, __asm, __asm__, __attribute, __attribute__,
    115115                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,
    117117                __float80, float80, __float128, float128, forall, ftype, _Generic, _Imaginary, __imag, __imag__,
    118118                inline, __inline, __inline__, __int128, int128, __label__, monitor, mutex, _Noreturn, one_t, or,
  • doc/bibliography/pl.bib

    r9d9a451 r53bb8f1  
    330330    contributer = {pabuhr@plg},
    331331    author      = {Nissim Francez},
    332     title       = {Another Advantage of Key word Notation for Parameter Communication with Subprograms},
     332    title       = {Another Advantage of Keyword Notation for Parameter Communication with Subprograms},
    333333    journal     = cacm,
    334334    volume      = 20,
     
    831831    year        = 2015,
    832832    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}},
    835844}
    836845
     
    939948    author      = {{\textsf{C}{$\mathbf{\forall}$} Features}},
    940949    howpublished= {\href{https://plg.uwaterloo.ca/~cforall/features}{https://\-plg.uwaterloo.ca/\-$\sim$cforall/\-features}},
    941     optnote     = {Accessed: 2018-01-01},
    942950}
    943951
     
    959967    year        = 2018,
    960968    howpublished= {\href{https://cforall.uwaterloo.ca/CFAStackEvaluation.zip}{https://cforall.uwaterloo.ca/\-CFAStackEvaluation.zip}},
    961     optnote     = {[Accessed May 2018]},
    962969}
    963970
     
    11341141}
    11351142
    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)}
    11411149    year = {2018},
    11421150    month = {September},
     1151    pages = {53-60},
    11431152    publisher = {IEEE},
    11441153    url = {https://www.microsoft.com/en-us/research/publication/checkedc-making-c-safe-by-extension/},
    1145     pages = {53-60},
    11461154}
    11471155
     
    13141322    journal     = sigplan,
    13151323    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},
    13171328    note        = {Object Oriented Programming Workshop}
    13181329}
     
    14791490    title       = {concurrent-locking},
    14801491    howpublished= {\href{https://github.com/pabuhr/concurrent-locking}{https://\-github.com/\-pabuhr/\-concurrent-locking}},
    1481     optnote     = {[Accessed April 2017]},
    14821492}
    14831493
     
    17671777    howpublished= {\href{https://www.airs.com/blog/archives/428}
    17681778                  {https://www.airs.com/\-blog/\-archives/\-428}},
    1769     optnote     = {Accessed: 2018-05},
    17701779}
    17711780
     
    29562965    year        = 2014,
    29572966    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},
    29592967}
    29602968
     
    30403048}
    30413049
     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
    30423060@inproceedings{F-bound,
    30433061    keywords    = {},
     
    30873105}
    30883106
     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
    30893117@manual{Fortran95,
    30903118    keywords    = {Fortran 95},
     
    31073135    address     = {\href{https://www.iso.org/standard/50459.html}{https://\-www.iso.org/\-standard/\-50459.html}},
    31083136    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,
    31093148}
    31103149
     
    33563395    year        = 2014,
    33573396    howpublished= {https://developer.gnome.org/gobject/stable/},
    3358     optnote     = {Accessed: 2017-04},
    33593397}
    33603398
     
    36713709    year        = {1964},
    36723710    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}},
    36733723}
    36743724
     
    39984048    year        = 2015,
    39994049    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,
    40004071}
    40014072
     
    41794250}
    41804251
     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
    41814263@book{Weissman67,
    41824264    keywords    = {lisp},
     
    42244306    pages       = {161-169},
    42254307    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,
    42264317}
    42274318
     
    45664657}
    45674658%    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}
    45684673
    45694674@manual{MPI,
     
    49925097    year        = 2014,
    49935098    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}
    49955099}
    49965100
     
    50025106    year        = 2015,
    50035107    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}
    50055108}
    50065109
     
    55155618    year        = 2012,
    55165619    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}
    55185620}
    55195621
     
    58395941    address     = {\href{https://www.iso.org/standard/64029.html}{https://\-www.iso.org/\-standard/\-64029.html}},
    58405942    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,
    58415954}
    58425955
     
    59926105    institution = {Carnegie Mellon University},
    59936106    year        = 1991,
    5994     month       = feb, number = "CMU-CS-91-106",
     6107    month       = feb,
     6108    number      = {CMU-CS-91-106},
    59956109    annote      = {
    59966110        Discusses a typed lambda calculus with
     
    60496163    journal     = sigplan,
    60506164    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},
    60546170    abstract    = {
    60556171        This paper deals with the integration of an efficient asynchronous
     
    61016217}
    61026218
     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
    61036230@manual{Python,
    61046231    keywords    = {Python},
    61056232    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},
    61086235    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,
    61126238}
    61136239
    61146240% 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}
    61156252
    61166253@article{Grossman06,
     
    61496286}
    61506287
     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
    61516298% R
    61526299
     
    62626409    number      = 10,
    62636410    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},
    62646422}
    62656423
     
    64006558}
    64016559
     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
    64026570% S
    64036571
     
    71907358    author      = {{TIOBE Index}},
    71917359    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)}},
    71937368}
    71947369
     
    75227697    year        = 2017,
    75237698    howpublished= {\url{https://wiki.gnome.org/Projects/Vala/Manual}},
    7524     optnote     = {Accessed: 2017-04}
    75257699}
    75267700
     
    76967870% Y
    76977871
     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
    76987887% Z
    76997888
  • doc/papers/concurrency/Paper.tex

    r9d9a451 r53bb8f1  
    228228}
    229229
    230 \title{\texorpdfstring{Concurrency in \protect\CFA}{Concurrency in Cforall}}
     230\title{\texorpdfstring{Advanced Control-flow in \protect\CFA}{Advanced Control-flow in Cforall}}
    231231
    232232\author[1]{Thierry Delisle}
     
    241241
    242242\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.
     244This paper discusses the advanced control-flow features in \CFA, which include concurrency and parallelism, and its supporting runtime system.
     245These 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.
     247A 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.
    249248All features respect the expectations of C programmers, while being fully integrate with the \CFA polymorphic type-system and other language features.
    250249Experimental results show comparable performance of the new features with similar mechanisms in other concurrent programming-languages.
    251250}%
    252251
    253 \keywords{concurrency, parallelism, coroutines, threads, monitors, runtime, C, Cforall}
     252\keywords{coroutines, concurrency, parallelism, threads, monitors, runtime, C, \CFA (Cforall)}
    254253
    255254
     
    262261\section{Introduction}
    263262
     263This 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.
     266However, 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.},
     267backwards-compatible extension of the C programming language~\cite{Moss18}.
     268Within the \CFA framework, new control-flow features were created from scratch.
     269ISO \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}.
     270Furthermore, \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;
     271no high-level language concurrency features exist.
     272Interestingly, 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.
     273Finally, 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
     275In contrast, there has been a renewed interest during the past decade in user-level (M:N, green) threading in old and new programming languages.
     276As multi-core hardware became available in the 1980/90s, both user and kernel threading were examined.
     277Kernel 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}.
     278Libraries like pthreads were developed for C, and the Solaris operating-system switched from user (JDK 1.1~\cite{JDK1.1}) to kernel threads.
     279As 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.
     280From 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}.
     281The 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}.
     282As well, user-threading facilitates a simpler concurrency approach using thread objects that leverage sequential patterns versus events with call-backs~\cite{vonBehren03}.
     283Finally, 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
     285A 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.
     286This 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}.
     287The consequence is that a language must be cognizant of these features and provide sufficient tools to program around any safety issues.
     288For example, C created the @volatile@ qualifier to provide correct execution for @setjmp@/@logjmp@ (concurrency came later).
     289The 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
     291While 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.
     292Essentially, using low-level explicit locks is the concurrent equivalent of assembler programming.
     293Just 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.
     294The goal is to get the compiler to check for correct usage and follow any complex coding conventions implicitly.
     295The drawback is that language constructs may preclude certain specialized techniques, therefore introducing inefficiency or inhibiting concurrency.
     296For 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.)
     298Only 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.
     299As stated, this observation applies to non-concurrent forms of complex control-flow, like exception handling and coroutines.
     300
     301Adapting the programming language allows matching the control-flow model with the programming-language style, versus adapting to one general (sound) library/paradigm.
     302For 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++}.
     303It 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.
     304As well, user threading is often a complementary feature, allowing light-weight threading to match with low-cost objects, while hiding the application/kernel boundary.
     305User 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{
     306All implicit concurrency models have explicit threading in their implementation, and hence, can be build from explicit threading;
     307however, 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.}
     308Finally, 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.
     311We attempt to show the \CFA extensions and runtime are demonstrably better than those proposed for \CC and other concurrent, imperative programming languages.
     312The contributions of this work are:
     313\begin{itemize}
     314\item
     315allowing multiple monitors to be safely acquired \emph{simultaneously} (deadlock free), while seamlessly integrating this capability with all monitor synchronization mechanisms.
     316\item
     317all 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
     319experimental results show comparable performance of the new features with similar mechanisms in other concurrent programming-languages.
     320\end{itemize}
     321
     322\begin{comment}
    264323This paper provides a minimal concurrency \newterm{Application Program Interface} (API) that is simple, efficient and can be used to build other concurrency features.
    265324While the simplest concurrency system is a thread and a lock, this low-level approach is hard to master.
     
    281340The proposed concurrency API is implemented in a dialect of C, called \CFA (pronounced C-for-all).
    282341The 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}
    285346\section{\CFA Overview}
    286347
     
    551612\end{cfa}
    552613where 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
     619Advanced 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).
    595620Coroutines are generalized routines allowing execution to be temporarily suspended and later resumed.
    596621Hence, 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.
     
    10601085\end{cquote}
    10611086The 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
     1092At its core, concurrency is based on multiple call-stacks and scheduling threads executing on these stacks.
     1093Multiple 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}.
     1094In 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.
     1095A \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;
     1096a \newterm{stackful} coroutine executes on its own stack, allowing full generality.
     1097Only stackful coroutines are a stepping stone to concurrency.
     1098
     1099The 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}.
     1100Therefore, a minimal concurrency system is possible using coroutines (see Section \ref{coroutine}) in conjunction with a scheduler to decide where to context switch next.
     1101The resulting execution system now follows a cooperative threading-model, called \newterm{non-preemptive scheduling}.
     1102
     1103Because the scheduler is special, it can either be a stackless or stackful coroutine.
     1104For 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.
     1105For 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.
     1106A stackful scheduler is often used for simplicity and security.
     1107
     1108Regardless of the approach used, a subset of concurrency related challenges start to appear.
     1109For 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}.
     1110While a scheduler introduces uncertainty in the order of execution, preemption introduces uncertainty about where context switches occur.
     1111Interestingly, uncertainty is necessary for the runtime (operating) system to give the illusion of parallelism on a single processor and increase performance on multiple processors.
     1112The reason is that only the runtime has complete knowledge about resources and how to best utilized them.
     1113However, the introduction of unrestricted non-determinism results in the need for \newterm{mutual exclusion} and \newterm{synchronization} to restrict non-determinism for correctness;
     1114otherwise, it is impossible to write meaningful programs.
     1115Optimal performance in concurrent applications is often obtained by having as much non-determinism as correctness allows.
     1116
     1117An 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.
     1118As such, library support for threading is far from widespread.
     1119At the time of writing the paper, neither \protect\lstinline@gcc@ nor \protect\lstinline@clang@ support \protect\lstinline@threads.h@ in their standard libraries.}.
     1120In 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.
     1121As 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.
     1122Furthermore, because C is a system-level language, programmers expect to choose precisely which features they need and which cost they are willing to pay.
     1123Hence, concurrent programs should be written using high-level mechanisms, and only step down to lower-level mechanisms when performance bottlenecks are encountered.
    10621124
    10631125
  • doc/papers/concurrency/mail

    r9d9a451 r53bb8f1  
    2727
    2828Software: Practice and Experience Editorial Office
     29
     30
     31
     32Date: Wed, 3 Oct 2018 21:25:28 +0000
     33From: Richard Jones <onbehalfof@manuscriptcentral.com>
     34Reply-To: R.E.Jones@kent.ac.uk
     35To: tdelisle@uwaterloo.ca, pabuhr@uwaterloo.ca
     36Subject: Software: Practice and Experience - Decision on Manuscript ID
     37 SPE-18-0205
     38
     3903-Oct-2018
     40
     41Dear Dr Buhr,
     42
     43Many thanks for submitting SPE-18-0205 entitled "Concurrency in C∀" to Software: Practice and Experience.
     44
     45In 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
     47Thank 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
     49Yours sincerely,
     50
     51
     52Prof. Richard Jones
     53Editor, Software: Practice and Experience
     54R.E.Jones@kent.ac.uk
     55
     56Referee(s)' Comments to Author:
     57
     58Reviewing: 1
     59
     60Comments 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
     63Section 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
     65Section 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
     67Sections 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
     69Section 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
     71Section 4 briefly touches on a collection of well known synchronisation primitives. Again, this discussion does not materially contribute to the paper.
     72
     73Section 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
     75Section 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
     77Section 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
     79Section 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
     81Section 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
     83The 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
     85It 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
     88Reviewing: 2
     89
     90Comments to the Author
     91This article presents the design and rationale behind the concurrency
     92features of C-forall, a new low-level programming language.  After an
     93introduction that defines a selection of standard terminology, section
     942 gives crucial background on the design of the C-forall language.
     95Section 3 then starts the core of the article, discussing the
     96language's support for "concurrency" which in this case means
     97coroutines and threads; a very brief Section 4 builds on section 3
     98with a discussion of lower level synchronizations.  Section 5 the
     99presents the main features of concurrency control in C-forall:
     100monitors and mutexes. Section 6 then extends monitors with condition
     101variables to to support scheduling, and a very brief section 7
     102discusses preemption and pooling. Section 8 discusses the runtime
     103conceptual model, section 9 gives implementation detail, and section
     10410 briefly evaluates C-forall's performance via five concurrent
     105micro benchmarks. Finally section 11 concludes the article, and then
     106section 12 presents some future work. 
     107
     108
     109At 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,
     112which requires concurrency". The doomsayers trumpeting the death of
     113Moore's law have been proved correct at last, with CPUs sequential
     114performance increasing much more slowly than the number of cores
     115within each die. This means programmers --- especially low-level,
     116systems programmers --- must somehow manage the essential complexity
     117of writing concurrent programs to run in parallel in multiple threads
     118across multiple cores. Unfortunately, the most venerable widely used
     119systems programming language, C, supports parallelism only via an
     120e.g. the threads library.  This article aims to integrate concurrent
     121programming mechanisms more closely into a novel low-level C-based
     122programming language, C-forall. The article gives an outline of much of
     123C-forall, presents a series of concurrency mechanisms, and finally
     124some microbenchmark results.  The article is detailed, comprehensive,
     125and generally well written in understandable English.
     126
     127My main concern about the article are indicated by the fact that the
     128best summary of the problem the design of concurrent C-forall sets
     129out to solve is buried more than halfway through the article in section
     1307, as above, and then the best overview of the proposed solution is
     131given 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
     142That is, in my reading of the article, it proceeds bottom up rather
     143than top down, and so my main recommendation is to essentially reverse
     144the order of the article, proceeding from the problem to be solved,
     145the high level architecture of the proposed solutions, and then going
     146down to the low-level mechanisms.  My biggest problem reading the
     147article was for explanations of why a particular decision was taken,
     148or why a particular mechanism may be used --- often this description
     149is actually later in the article, but at that point it's too late for
     150the reader.  I have tried to point out most of these places in the
     151detailed comments below.
     152
     153My second concern is that the article makes several claims that are
     154not really justified by the design or implementation in the article.
     155These include claims that this approach meets the expectations of C
     156programmers, is minimal, is implemented in itself, etc.  The article
     157doesn't generally offer evidence to support these assertions (for many
     158of them, that would require empirical studies of programmers, or at
     159least corpus studies). The solution here is to talk about motivations
     160for the design choices "we made these decisions hoping that C
     161programmers would be comfortable" rather than claims of fact "C
     162programmers 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
     377To encourage accountability, I'm signing my reviews in 2018. For the record, I am James Noble, kjx@ecs.vuw.ac.nz.
     378
     379Reviewing: 3
     380
     381Comments to the Author
     382This 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
     384It 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
     386Overall the impression I gained is that this is a substantial system into which have gone much thought and effort.
     387
     388However, 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
     390The 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
     392The 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
     394Certain 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
     396Similarly, 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
     398I 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
     400The empirical data presented is a reasonable start at characterising the implementation's performance. However, it currently suffers certain flaws.
     401
     402Firstly, 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
     404It 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
     406It 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
     408In 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
     410The 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
     412The 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
     414One 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
     416I 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
     418Minor comments:
     419
     420The 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  
    187187DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
    188188ACLOCAL = @ACLOCAL@
    189 ALLOCA = @ALLOCA@
    190189AMTAR = @AMTAR@
    191190AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
  • driver/cfa.cc

    r9d9a451 r53bb8f1  
    1010// Created On       : Tue Aug 20 13:44:49 2002
    1111// Last Modified By : Peter A. Buhr
    12 // Last Modified On : Fri Sep 14 23:02:59 2018
    13 // Update Count     : 277
     12// Last Modified On : Sun Feb 10 08:28:09 2019
     13// Update Count     : 281
    1414//
    1515
     
    107107        bool link = true;                                                                       // linking as well as compiling
    108108        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
    112113        bool CFA_flag = false;                                                          // -CFA flag
    113114        bool cpp_flag = false;                                                          // -E or -M flag, preprocessor only
     
    162163                                debug = true;                                                   // strip the debug flag
    163164                        } 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
    165168                        } else if ( arg == "-quiet" ) {
    166169                                quiet = true;                                                   // strip the quiet flag
     
    366369                }  // if
    367370        } // if
    368         const char * config = debug ? "debug": "nodebug";
     371        const char * config = nolib ? "nolib" : (debug ? "debug": "nodebug");
    369372        string libdir = libbase + arch + "-" + config;
    370373
    371         if ( ! dirExists( libdir ) ) {
     374        if ( ! nolib && ! dirExists( libdir ) ) {
    372375                cerr << argv[0] << " internal error, configuration " << config << " not installed." << endl;
    373376                cerr << "Was looking for " << libdir << endl;
     
    384387        nargs += 1;
    385388
     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
    386394        if ( link ) {
    387395                args[nargs] = "-Xlinker";
     
    414422                nargs += 1;
    415423                args[nargs] = "-lrt";
     424                nargs += 1;
     425                args[nargs] = "-lm";
    416426                nargs += 1;
    417427        } // if
     
    488498                args[nargs] = "-Wno-deprecated";
    489499                nargs += 1;
     500#ifdef HAVE_CAST_FUNCTION_TYPE
     501                args[nargs] = "-Wno-cast-function-type";
     502                nargs += 1;
     503#endif // HAVE_CAST_FUNCTION_TYPE
    490504                if ( ! std_flag ) {                                                             // default c11, if none specified
    491505                        args[nargs] = "-std=gnu11";
     
    497511                nargs += 1;
    498512                args[nargs] = ( *new string( string("-B") + Bprefix ) ).c_str();
    499                 nargs += 1;
    500                 args[nargs] = "-lm";
    501513                nargs += 1;
    502514        } else {
     
    504516                exit( EXIT_FAILURE );
    505517        } // if
    506 
    507         for ( int i = 0; i < nlibs; i += 1 ) {                          // copy non-user libraries after all user libraries
    508                 args[nargs] = libs[i];
    509                 nargs += 1;
    510         } // for
    511518
    512519        args[nargs] = NULL;                                                                     // terminate with NULL
  • libcfa/configure

    r9d9a451 r53bb8f1  
    23822382
    23832383
     2384# http://git.savannah.gnu.org/gitweb/?p=autoconf-archive.git;a=blob_plain;f=m4/ax_check_compile_flag.m4
     2385
    23842386
    23852387am__api_version='1.15'
     
    29682970        "nolib"   )
    29692971                CONFIG_CFLAGS="-O2 -s"
    2970                 CONFIG_CFAFLAGS="-nodebug"
     2972                CONFIG_CFAFLAGS="-nolib"
    29712973                CONFIG_BUILDLIB="no"
    29722974        ;;
  • libcfa/configure.ac

    r9d9a451 r53bb8f1  
    5656        "nolib"   )
    5757                CONFIG_CFLAGS="-O2 -s"
    58                 CONFIG_CFAFLAGS="-nodebug"
     58                CONFIG_CFAFLAGS="-nolib"
    5959                CONFIG_BUILDLIB="no"
    6060        ;;
  • libcfa/prelude/builtins.c

    r9d9a451 r53bb8f1  
    1010// Created On       : Fri Jul 21 16:21:03 2017
    1111// Last Modified By : Peter A. Buhr
    12 // Last Modified On : Sun Aug  5 21:40:38 2018
    13 // Update Count     : 20
     12// Last Modified On : Sun Mar 10 10:52:50 2019
     13// Update Count     : 31
    1414//
    1515
     
    2626// increment/decrement unification
    2727
    28 static inline forall( dtype T | { T& ?+=?( T&, one_t ); } )
    29 T& ++? ( T& x ) { return x += 1; }
     28static inline forall( dtype T | { T & ?+=?( T &, one_t ); } )
     29T & ++? ( T & x ) { return x += 1; }
    3030
    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; }
     31static inline forall( dtype T | sized(T) | { void ?{}( T &, T ); void ^?{}( T & ); T & ?+=?( T &, one_t ); } )
     32T & ?++ ( T & x ) { T tmp = x; x += 1; return tmp; }
    3333
    34 static inline forall( dtype T | { T& ?-=?( T&, one_t ); } )
    35 T& --? ( T& x ) { return x -= 1; }
     34static inline forall( dtype T | { T & ?-=?( T &, one_t ); } )
     35T & --? ( T & x ) { return x -= 1; }
    3636
    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; }
     37static inline forall( dtype T | sized(T) | { void ?{}( T &, T ); void ^?{}( T & ); T & ?-=?( T &, one_t ); } )
     38T & ?-- ( T & x ) { T tmp = x; x -= 1; return tmp; }
     39
     40// universal typed pointer constant
     41
     42static inline forall( dtype T ) T * intptr( uintptr_t addr ) { return (T *)addr; }
    3943
    4044// 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
    22#include <stdint.h>                                     // intX_t, uintX_t, where X is 8, 16, 32, 64
    33#include <uchar.h>                                      // char16_t, char32_t
  • libcfa/prelude/extras.regx

    r9d9a451 r53bb8f1  
    11typedef.* size_t;
    22typedef.* ptrdiff_t;
     3typedef.* intptr_t;
     4typedef.* uintptr_t;
    35typedef.* __int8_t;
    46typedef.* __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
    116#include <algorithm>
    217#include <array>
     
    1126        bool hasComparison;
    1227} 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 , },
    1631        { "signed short"          , false, true , },
    1732        { "unsigned short"        , false, true , },
     
    3449#if defined(__i386__) || defined(__ia64__) || defined(__x86_64__)
    3550        { "__float80"             , true , true , },
    36         { "_Float128"             , true , true , },
     51        { "__float128"            , true , true , },
    3752#endif
    3853};
     
    150165        cout << endl;
    151166
    152         cout << "signed int ?==?( zero_t, zero_t ),                                                     ?!=?( zero_t, zero_t );" << endl;
    153         cout << "signed int ?==?( one_t, one_t ),                                                       ?!=?( one_t, one_t );" << endl;
    154         cout << "signed int ?==?( _Bool, _Bool ),                                                       ?!=?( _Bool, _Bool );" << endl;
    155         cout << "signed int     !?( _Bool );" << endl;
     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;
    156171
    157172        for (auto op : arithmeticOperators) {
     
    188203        cout << "// Arithmetic Constructors //" << endl;
    189204        cout << "/////////////////////////////" << endl;
     205        cout << endl;
     206
    190207        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 << ")";
    196213                }
    197214                cout << ";" << endl;
    198                 cout << "void \t^?{}( " << type << " & );" << endl;
     215                cout << "void ^?{}( " << type << " & );" << endl;
    199216        };
    200217
     
    202219        otype("one_t");
    203220        otype("_Bool", true);
    204         otype("char", true);
    205         otype("signed char", true);
    206         otype("unsigned char", true);
     221        cout << endl;
    207222
    208223        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;
    211227                cout << "void ^?{}(" << type.name << " &);" << endl;
    212228                cout << endl;
     
    217233        cout << "// Pointer Constructors //" << endl;
    218234        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;
    221239
    222240        // generate qualifiers
     
    242260                for (auto cvq : qualifiersPair) {
    243261                        for (auto is_vol : { "        ", "volatile" }) {
    244                                 cout << "forall(dtype DT) void  ?{}(" << cvq.first << type << " * " << is_vol << " &, " << cvq.second << "DT *);" << endl;
     262                                cout << "forall(dtype DT) void ?{}(" << cvq.first << type << " * " << is_vol << " &, " << cvq.second << "DT *);" << endl;
    245263                        }
    246264                }
    247265                for (auto cvq : qualifiersSingle) {
    248266                        for (auto is_vol : { "        ", "volatile" }) {
    249                                 cout << "forall(dtype DT) void  ?{}(" << cvq << type << " * " << is_vol << " &);" << endl;
     267                                cout << "forall(dtype DT) void ?{}(" << cvq << type << " * " << is_vol << " &);" << endl;
    250268                        }
    251269                        for (auto is_vol : { "        ", "volatile" }) {
     
    269287        cout << "forall(ftype FT) FT *                  ?=?( FT *          &, zero_t );" << endl;
    270288        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;
    273291        cout << endl;
    274292
     
    277295        cout << "///////////////////////" << endl;
    278296
    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;
    286303
    287304        for (auto op : pointerOperators) {
     
    387404}
    388405
     406// Local Variables: //
     407// tab-width: 4 //
     408// End: //
  • libcfa/src/Makefile.in

    r9d9a451 r53bb8f1  
    415415am__v_GOC_0 = @echo "  GOC     " $@;
    416416am__v_GOC_1 =
     417UPPCC = u++
    417418UPPCOMPILE = $(UPPCC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_UPPFLAGS) $(UPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) $(AM_CFLAGS) $(CFLAGS)
    418419AM_V_UPP = $(am__v_UPP_@AM_V@)
  • libcfa/src/containers/maybe.cfa

    r9d9a451 r53bb8f1  
    1010// Created On       : Wed May 24 15:40:00 2017
    1111// Last Modified By : Peter A. Buhr
    12 // Last Modified On : Thu Jul 20 15:23:50 2017
    13 // Update Count     : 2
     12// Last Modified On : Sun Feb 17 11:22:03 2019
     13// Update Count     : 3
    1414//
    1515
     
    3939forall(otype T)
    4040maybe(T) ?=?(maybe(T) & this, maybe(T) that) {
    41         if (this.has_value & that.has_value) {
     41        if (this.has_value && that.has_value) {
    4242                this.value = that.value;
    4343        } else if (this.has_value) {
  • libcfa/src/containers/result.cfa

    r9d9a451 r53bb8f1  
    1010// Created On       : Wed May 24 15:40:00 2017
    1111// Last Modified By : Peter A. Buhr
    12 // Last Modified On : Thu Jul 20 15:23:58 2017
    13 // Update Count     : 2
     12// Last Modified On : Sun Feb 17 11:24:04 2019
     13// Update Count     : 3
    1414//
    1515
     
    4848forall(otype T, otype E)
    4949result(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) {
    5151                this.value = that.value;
    5252        } else if (this.has_value) {
  • libcfa/src/iostream.cfa

    r9d9a451 r53bb8f1  
    1010// Created On       : Wed May 27 17:56:53 2015
    1111// Last Modified By : Peter A. Buhr
    12 // Last Modified On : Mon Dec 24 18:33:40 2018
    13 // Update Count     : 589
     12// Last Modified On : Mon Mar  4 20:57:24 2019
     13// Update Count     : 593
    1414//
    1515
     
    2727
    2828forall( 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
    2947        ostype & ?|?( ostype & os, bool b ) {
    3048                if ( sepPrt( os ) ) fmt( os, "%s", sepGetCur( os ) );
  • libcfa/src/iostream.hfa

    r9d9a451 r53bb8f1  
    1010// Created On       : Wed May 27 17:56:53 2015
    1111// Last Modified By : Peter A. Buhr
    12 // Last Modified On : Mon Dec 24 18:33:40 2018
    13 // Update Count     : 220
     12// Last Modified On : Tue Feb 26 16:57:22 2019
     13// Update Count     : 221
    1414//
    1515
     
    6262
    6363forall( 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
    6469        ostype & ?|?( ostype &, bool );
    6570        void ?|?( ostype &, bool );
  • src/CodeGen/module.mk

    r9d9a451 r53bb8f1  
    1818#       ArgTweak/Mutate.cc
    1919
    20 SRC +=  CodeGen/Generate.cc \
     20SRC_CODEGEN = \
    2121        CodeGen/CodeGenerator.cc \
     22        CodeGen/FixMain.cc \
    2223        CodeGen/GenType.cc \
    23         CodeGen/FixNames.cc \
    24         CodeGen/FixMain.cc \
    2524        CodeGen/OperatorTable.cc
     25
     26
     27SRC += $(SRC_CODEGEN) CodeGen/Generate.cc CodeGen/FixNames.cc
     28SRCDEMANGLE += $(SRC_CODEGEN)
  • src/Common/PassVisitor.h

    r9d9a451 r53bb8f1  
    55#include <stack>
    66
     7#include "Common/Stats.h"
    78#include "Common/utility.h"
    89
     
    426427};
    427428
     429#include "Common/Stats.h"
     430
     431extern 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
    428437#include "SynTree/TypeSubstitution.h"
    429438#include "PassVisitor.impl.h"
  • src/Common/PassVisitor.impl.h

    r9d9a451 r53bb8f1  
    6767        SemanticErrorException errors;
    6868
     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);
    6972        for ( std::list< Declaration* >::iterator i = decls.begin(); ; ++i ) {
     73
     74
    7075                // splice in new declarations after previous decl
    7176                if ( !empty( afterDecls ) ) { decls.splice( i, *afterDecls ); }
     
    8388                if ( !empty( beforeDecls ) ) { decls.splice( i, *beforeDecls ); }
    8489        }
     90        pass_visitor_stats.depth--;
    8591        if ( ! errors.isEmpty() ) {
    8692                throw errors;
     
    94100        SemanticErrorException errors;
    95101
     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);
    96105        for ( std::list< Declaration* >::iterator i = decls.begin(); ; ++i ) {
    97106                // splice in new declarations after previous decl
     
    109118                if ( !empty( beforeDecls ) ) { decls.splice( i, *beforeDecls ); }
    110119        }
     120        pass_visitor_stats.depth--;
    111121        if ( ! errors.isEmpty() ) {
    112122                throw errors;
     
    126136        if ( ! visitor.get_visit_children() ) return;
    127137        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);
    128142        for ( typename Container::iterator i = container.begin(); i != container.end(); ++i ) {
    129143                try {
     
    135149                }
    136150        }
     151        pass_visitor_stats.depth--;
    137152        if ( ! errors.isEmpty() ) {
    138153                throw errors;
     
    153168        if ( ! mutator.get_visit_children() ) return;
    154169        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);
    155174        for ( typename Container::iterator i = container.begin(); i != container.end(); ++i ) {
    156175                try {
     
    163182                } // try
    164183        } // for
     184        pass_visitor_stats.depth--;
    165185        if ( ! errors.isEmpty() ) {
    166186                throw errors;
     
    185205        DeclList_t* afterDecls  = get_afterDecls();
    186206
     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);
    187210        for ( std::list< Statement* >::iterator i = statements.begin(); i != statements.end(); ++i ) {
    188211
     
    202225                if ( !empty( beforeStmts ) ) { statements.splice( i, *beforeStmts ); }
    203226        }
     227        pass_visitor_stats.depth--;
    204228
    205229        if ( !empty( afterDecls ) ) { splice( std::back_inserter( statements ), afterDecls); }
  • src/Common/Stats/Heap.h

    r9d9a451 r53bb8f1  
    1616#pragma once
    1717
    18 namespace HeapStats {
    19         void newPass( const char * const name );
    20         void printStats();
     18namespace Stats {
     19        namespace Heap {
     20                void newPass( const char * const name );
     21                void print();
     22        }
    2123}
  • src/Common/module.mk

    r9d9a451 r53bb8f1  
    1515###############################################################################
    1616
    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
     17SRC_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
     28SRC += $(SRC_COMMON) Common/DebugMalloc.cc
     29SRCDEMANGLE += $(SRC_COMMON)
  • src/Concurrency/Waitfor.cc

    r9d9a451 r53bb8f1  
    1111// Last Modified By :
    1212// Last Modified On :
    13 // Update Count     : 5
     13// Update Count     : 7
    1414//
    1515
  • src/Concurrency/module.mk

    r9d9a451 r53bb8f1  
    1515###############################################################################
    1616
    17 SRC += Concurrency/Keywords.cc \
    18        Concurrency/Waitfor.cc
     17SRC += Concurrency/Keywords.cc Concurrency/Waitfor.cc
     18SRCDEMANGLE += Concurrency/Keywords.cc
    1919
  • src/ControlStruct/ExceptTranslate.cc

    r9d9a451 r53bb8f1  
    99// Author           : Andrew Beach
    1010// Created On       : Wed Jun 14 16:49:00 2017
    11 // Last Modified By : Andrew Beach
    12 // Last Modified On : Thr Aug 17 17:19:00 2017
    13 // Update Count     : 9
     11// Last Modified By : Peter A. Buhr
     12// Last Modified On : Wed Feb 13 18:15:29 2019
     13// Update Count     : 11
    1414//
    1515
  • src/ControlStruct/module.mk

    r9d9a451 r53bb8f1  
    1515###############################################################################
    1616
    17 SRC +=  ControlStruct/LabelGenerator.cc \
     17SRC_CONTROLSTRUCT = \
     18        ControlStruct/ForExprMutator.cc \
    1819        ControlStruct/LabelFixer.cc \
     20        ControlStruct/LabelGenerator.cc \
    1921        ControlStruct/MLEMutator.cc \
    20         ControlStruct/Mutate.cc \
    21         ControlStruct/ForExprMutator.cc \
    22         ControlStruct/ExceptTranslate.cc
     22        ControlStruct/Mutate.cc
     23
     24SRC += $(SRC_CONTROLSTRUCT) ControlStruct/ExceptTranslate.cc
     25SRCDEMANGLE += $(SRC_CONTROLSTRUCT)
     26
  • src/GenPoly/module.mk

    r9d9a451 r53bb8f1  
    2222       GenPoly/FindFunction.cc \
    2323       GenPoly/InstantiateGeneric.cc
     24
     25SRCDEMANGLE += GenPoly/GenPoly.cc GenPoly/Lvalue.cc
     26
  • src/InitTweak/FixInit.cc

    r9d9a451 r53bb8f1  
    1010// Created On       : Wed Jan 13 16:29:30 2016
    1111// Last Modified By : Peter A. Buhr
    12 // Last Modified On : Wed Jun 21 17:35:05 2017
    13 // Update Count     : 74
     12// Last Modified On : Wed Feb 13 18:15:56 2019
     13// Update Count     : 76
    1414//
    1515#include "FixInit.h"
  • src/InitTweak/module.mk

    r9d9a451 r53bb8f1  
    2020        InitTweak/InitTweak.cc
    2121
     22SRCDEMANGLE += InitTweak/GenInit.cc \
     23        InitTweak/InitTweak.cc
     24
  • src/MakeLibCfa.cc

    r9d9a451 r53bb8f1  
    99// Author           : Richard C. Bilson
    1010// Created On       : Sat May 16 10:33:33 2015
    11 // Last Modified By : Rob Schluntz
    12 // Last Modified On : Fri Apr 22 13:54:15 2016
    13 // Update Count     : 40
     11// Last Modified By : Peter A. Buhr
     12// Last Modified On : Sun Feb 17 21:08:09 2019
     13// Update Count     : 41
    1414//
    1515
     
    146146        } // namespace
    147147} // namespace LibCfa
     148
     149// Local Variables: //
     150// tab-width: 4 //
     151// End: //
  • src/Makefile.am

    r9d9a451 r53bb8f1  
    1010## Author           : Peter A. Buhr
    1111## Created On       : Sun May 31 08:51:46 2015
    12 ## Last Modified By : Andrew Beach
    13 ## Last Modified On : Tus Jul 25 10:34:00 2017
    14 ## Update Count     : 76
     12## Last Modified By : Peter A. Buhr
     13## Last Modified On : Fri Feb 15 09:44:09 2019
     14## Update Count     : 97
    1515###############################################################################
    1616
     
    2323      CompilationState.cc
    2424
     25SRCDEMANGLE = CompilationState.cc
     26
    2527MAINTAINERCLEANFILES =
    2628MOSTLYCLEANFILES =
    27 
    28 # Is there a way to use a variable for the directory names?
    2929
    3030include CodeGen/module.mk
     
    4343include Virtual/module.mk
    4444
     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
    4552# put into lib for now
    4653cfa_cpplibdir = $(CFA_LIBDIR)
     
    5562demangler_SOURCES = SymTab/demangler.cc
    5663
    57 demangler_LDADD = libdemangle.a     # yywrap
     64demangler_LDADD = libdemangle.a -ldl                    # yywrap
    5865
    5966noinst_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
     67libdemangle_a_SOURCES = $(SRCDEMANGLE)
    14468
    14569MAINTAINERCLEANFILES += ${libdir}/${notdir ${cfa_cpplib_PROGRAMS}}
  • src/Makefile.in

    r9d9a451 r53bb8f1  
    162162libdemangle_a_LIBADD =
    163163am__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) \
     164am__objects_1 = CodeGen/CodeGenerator.$(OBJEXT) \
     165        CodeGen/FixMain.$(OBJEXT) CodeGen/GenType.$(OBJEXT) \
     166        CodeGen/OperatorTable.$(OBJEXT)
     167am__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)
     172am__objects_3 = ControlStruct/ForExprMutator.$(OBJEXT) \
    191173        ControlStruct/LabelFixer.$(OBJEXT) \
    192174        ControlStruct/LabelGenerator.$(OBJEXT) \
    193175        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)
     177am__objects_4 = ResolvExpr/AdjustExprType.$(OBJEXT) \
    198178        ResolvExpr/Alternative.$(OBJEXT) \
    199179        ResolvExpr/AlternativeFinder.$(OBJEXT) \
    200         ResolvExpr/ExplodedActual.$(OBJEXT) \
    201180        ResolvExpr/CastCost.$(OBJEXT) ResolvExpr/CommonType.$(OBJEXT) \
    202181        ResolvExpr/ConversionCost.$(OBJEXT) \
    203182        ResolvExpr/CurrentObject.$(OBJEXT) \
     183        ResolvExpr/ExplodedActual.$(OBJEXT) \
    204184        ResolvExpr/FindOpenVars.$(OBJEXT) ResolvExpr/Occurs.$(OBJEXT) \
    205185        ResolvExpr/PolyCost.$(OBJEXT) \
     
    212192        ResolvExpr/SpecCost.$(OBJEXT) \
    213193        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)
     195am__objects_5 = SymTab/Autogen.$(OBJEXT) SymTab/FixFunction.$(OBJEXT) \
    270196        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)
     198am__objects_6 = SynTree/Type.$(OBJEXT) SynTree/VoidType.$(OBJEXT) \
    274199        SynTree/BasicType.$(OBJEXT) SynTree/PointerType.$(OBJEXT) \
    275200        SynTree/ArrayType.$(OBJEXT) SynTree/ReferenceType.$(OBJEXT) \
     
    290215        SynTree/Initializer.$(OBJEXT) \
    291216        SynTree/TypeSubstitution.$(OBJEXT) SynTree/Attribute.$(OBJEXT) \
    292         SynTree/DeclReplacer.$(OBJEXT) \
     217        SynTree/DeclReplacer.$(OBJEXT)
     218am__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)
     227am_libdemangle_a_OBJECTS = $(am__objects_7)
     228libdemangle_a_OBJECTS = $(am_libdemangle_a_OBJECTS)
     229am__installdirs = "$(DESTDIR)$(cfa_cpplibdir)"
     230PROGRAMS = $(cfa_cpplib_PROGRAMS)
     231am__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) \
    293254        Tuples/TupleAssignment.$(OBJEXT) \
    294255        Tuples/TupleExpansion.$(OBJEXT) Tuples/Explode.$(OBJEXT) \
    295256        Validate/HandleAttributes.$(OBJEXT) \
    296257        Virtual/ExpandCasts.$(OBJEXT)
    297 am____driver_cfa_cpp_OBJECTS = $(am__objects_1)
     258am____driver_cfa_cpp_OBJECTS = $(am__objects_8)
    298259___driver_cfa_cpp_OBJECTS = $(am____driver_cfa_cpp_OBJECTS)
    299260___driver_cfa_cpp_DEPENDENCIES =
     
    416377DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
    417378ACLOCAL = @ACLOCAL@
    418 ALLOCA = @ALLOCA@
    419379AMTAR = @AMTAR@
    420380AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
     
    564524AUTOMAKE_OPTIONS = foreign subdir-objects
    565525ACLOCAL_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 \
     526SRC = main.cc MakeLibCfa.cc CompilationState.cc $(SRC_CODEGEN) \
     527        CodeGen/Generate.cc CodeGen/FixNames.cc CodeTools/DeclStats.cc \
    570528        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) \
    577531        ControlStruct/ExceptTranslate.cc GenPoly/Box.cc \
    578532        GenPoly/GenPoly.cc GenPoly/ScrubTyVars.cc GenPoly/Lvalue.cc \
     
    585539        Parser/StatementNode.cc Parser/InitializerNode.cc \
    586540        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) \
    616543        Tuples/TupleAssignment.cc Tuples/TupleExpansion.cc \
    617544        Tuples/Explode.cc Validate/HandleAttributes.cc \
    618545        Virtual/ExpandCasts.cc
     546SRCDEMANGLE = 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
    619553MAINTAINERCLEANFILES = ${libdir}/${notdir ${cfa_cpplib_PROGRAMS}}
    620 MOSTLYCLEANFILES = Parser/parser.hh Parser/parser.output
     554MOSTLYCLEANFILES = Parser/lex.cc Parser/parser.cc Parser/parser.hh \
     555        Parser/parser.output
     556SRC_CODEGEN = \
     557        CodeGen/CodeGenerator.cc \
     558        CodeGen/FixMain.cc \
     559        CodeGen/GenType.cc \
     560        CodeGen/OperatorTable.cc
     561
     562SRC_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
     573SRC_CONTROLSTRUCT = \
     574        ControlStruct/ForExprMutator.cc \
     575        ControlStruct/LabelFixer.cc \
     576        ControlStruct/LabelGenerator.cc \
     577        ControlStruct/MLEMutator.cc \
     578        ControlStruct/Mutate.cc
     579
    621580BUILT_SOURCES = Parser/parser.hh
    622581AM_YFLAGS = -d -t -v
    623 
    624 # Is there a way to use a variable for the directory names?
     582SRC_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
     604SRC_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
     612SRC_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
    625648
    626649# put into lib for now
     
    632655ARFLAGS = cr
    633656demangler_SOURCES = SymTab/demangler.cc
    634 demangler_LDADD = libdemangle.a     # yywrap
     657demangler_LDADD = libdemangle.a -ldl                    # yywrap
    635658noinst_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 
     659libdemangle_a_SOURCES = $(SRCDEMANGLE)
    721660all: $(BUILT_SOURCES)
    722661        $(MAKE) $(AM_MAKEFLAGS) all-am
     
    757696clean-noinstLIBRARIES:
    758697        -test -z "$(noinst_LIBRARIES)" || rm -f $(noinst_LIBRARIES)
    759 SymTab/$(am__dirstamp):
    760         @$(MKDIR_P) SymTab
    761         @: > SymTab/$(am__dirstamp)
    762 SymTab/$(DEPDIR)/$(am__dirstamp):
    763         @$(MKDIR_P) SymTab/$(DEPDIR)
    764         @: > SymTab/$(DEPDIR)/$(am__dirstamp)
    765 SymTab/Demangle.$(OBJEXT): SymTab/$(am__dirstamp) \
    766         SymTab/$(DEPDIR)/$(am__dirstamp)
    767 SymTab/ManglerCommon.$(OBJEXT): SymTab/$(am__dirstamp) \
    768         SymTab/$(DEPDIR)/$(am__dirstamp)
    769 SynTree/$(am__dirstamp):
    770         @$(MKDIR_P) SynTree
    771         @: > SynTree/$(am__dirstamp)
    772 SynTree/$(DEPDIR)/$(am__dirstamp):
    773         @$(MKDIR_P) SynTree/$(DEPDIR)
    774         @: > SynTree/$(DEPDIR)/$(am__dirstamp)
    775 SynTree/Type.$(OBJEXT): SynTree/$(am__dirstamp) \
    776         SynTree/$(DEPDIR)/$(am__dirstamp)
    777 SynTree/VoidType.$(OBJEXT): SynTree/$(am__dirstamp) \
    778         SynTree/$(DEPDIR)/$(am__dirstamp)
    779 SynTree/BasicType.$(OBJEXT): SynTree/$(am__dirstamp) \
    780         SynTree/$(DEPDIR)/$(am__dirstamp)
    781 SynTree/PointerType.$(OBJEXT): SynTree/$(am__dirstamp) \
    782         SynTree/$(DEPDIR)/$(am__dirstamp)
    783 SynTree/ArrayType.$(OBJEXT): SynTree/$(am__dirstamp) \
    784         SynTree/$(DEPDIR)/$(am__dirstamp)
    785 SynTree/ReferenceType.$(OBJEXT): SynTree/$(am__dirstamp) \
    786         SynTree/$(DEPDIR)/$(am__dirstamp)
    787 SynTree/FunctionType.$(OBJEXT): SynTree/$(am__dirstamp) \
    788         SynTree/$(DEPDIR)/$(am__dirstamp)
    789 SynTree/ReferenceToType.$(OBJEXT): SynTree/$(am__dirstamp) \
    790         SynTree/$(DEPDIR)/$(am__dirstamp)
    791 SynTree/TupleType.$(OBJEXT): SynTree/$(am__dirstamp) \
    792         SynTree/$(DEPDIR)/$(am__dirstamp)
    793 SynTree/TypeofType.$(OBJEXT): SynTree/$(am__dirstamp) \
    794         SynTree/$(DEPDIR)/$(am__dirstamp)
    795 SynTree/AttrType.$(OBJEXT): SynTree/$(am__dirstamp) \
    796         SynTree/$(DEPDIR)/$(am__dirstamp)
    797 SynTree/VarArgsType.$(OBJEXT): SynTree/$(am__dirstamp) \
    798         SynTree/$(DEPDIR)/$(am__dirstamp)
    799 SynTree/ZeroOneType.$(OBJEXT): SynTree/$(am__dirstamp) \
    800         SynTree/$(DEPDIR)/$(am__dirstamp)
    801 SynTree/Constant.$(OBJEXT): SynTree/$(am__dirstamp) \
    802         SynTree/$(DEPDIR)/$(am__dirstamp)
    803 SynTree/Expression.$(OBJEXT): SynTree/$(am__dirstamp) \
    804         SynTree/$(DEPDIR)/$(am__dirstamp)
    805 SynTree/TupleExpr.$(OBJEXT): SynTree/$(am__dirstamp) \
    806         SynTree/$(DEPDIR)/$(am__dirstamp)
    807 SynTree/CommaExpr.$(OBJEXT): SynTree/$(am__dirstamp) \
    808         SynTree/$(DEPDIR)/$(am__dirstamp)
    809 SynTree/TypeExpr.$(OBJEXT): SynTree/$(am__dirstamp) \
    810         SynTree/$(DEPDIR)/$(am__dirstamp)
    811 SynTree/ApplicationExpr.$(OBJEXT): SynTree/$(am__dirstamp) \
    812         SynTree/$(DEPDIR)/$(am__dirstamp)
    813 SynTree/AddressExpr.$(OBJEXT): SynTree/$(am__dirstamp) \
    814         SynTree/$(DEPDIR)/$(am__dirstamp)
    815 SynTree/Statement.$(OBJEXT): SynTree/$(am__dirstamp) \
    816         SynTree/$(DEPDIR)/$(am__dirstamp)
    817 SynTree/CompoundStmt.$(OBJEXT): SynTree/$(am__dirstamp) \
    818         SynTree/$(DEPDIR)/$(am__dirstamp)
    819 SynTree/DeclStmt.$(OBJEXT): SynTree/$(am__dirstamp) \
    820         SynTree/$(DEPDIR)/$(am__dirstamp)
    821 SynTree/Declaration.$(OBJEXT): SynTree/$(am__dirstamp) \
    822         SynTree/$(DEPDIR)/$(am__dirstamp)
    823 SynTree/DeclarationWithType.$(OBJEXT): SynTree/$(am__dirstamp) \
    824         SynTree/$(DEPDIR)/$(am__dirstamp)
    825 SynTree/ObjectDecl.$(OBJEXT): SynTree/$(am__dirstamp) \
    826         SynTree/$(DEPDIR)/$(am__dirstamp)
    827 SynTree/FunctionDecl.$(OBJEXT): SynTree/$(am__dirstamp) \
    828         SynTree/$(DEPDIR)/$(am__dirstamp)
    829 SynTree/AggregateDecl.$(OBJEXT): SynTree/$(am__dirstamp) \
    830         SynTree/$(DEPDIR)/$(am__dirstamp)
    831 SynTree/NamedTypeDecl.$(OBJEXT): SynTree/$(am__dirstamp) \
    832         SynTree/$(DEPDIR)/$(am__dirstamp)
    833 SynTree/TypeDecl.$(OBJEXT): SynTree/$(am__dirstamp) \
    834         SynTree/$(DEPDIR)/$(am__dirstamp)
    835 SynTree/Initializer.$(OBJEXT): SynTree/$(am__dirstamp) \
    836         SynTree/$(DEPDIR)/$(am__dirstamp)
    837 SynTree/TypeSubstitution.$(OBJEXT): SynTree/$(am__dirstamp) \
    838         SynTree/$(DEPDIR)/$(am__dirstamp)
    839 SynTree/Attribute.$(OBJEXT): SynTree/$(am__dirstamp) \
    840         SynTree/$(DEPDIR)/$(am__dirstamp)
    841 SynTree/DeclReplacer.$(OBJEXT): SynTree/$(am__dirstamp) \
    842         SynTree/$(DEPDIR)/$(am__dirstamp)
    843698CodeGen/$(am__dirstamp):
    844699        @$(MKDIR_P) CodeGen
     
    855710CodeGen/OperatorTable.$(OBJEXT): CodeGen/$(am__dirstamp) \
    856711        CodeGen/$(DEPDIR)/$(am__dirstamp)
     712Concurrency/$(am__dirstamp):
     713        @$(MKDIR_P) Concurrency
     714        @: > Concurrency/$(am__dirstamp)
     715Concurrency/$(DEPDIR)/$(am__dirstamp):
     716        @$(MKDIR_P) Concurrency/$(DEPDIR)
     717        @: > Concurrency/$(DEPDIR)/$(am__dirstamp)
     718Concurrency/Keywords.$(OBJEXT): Concurrency/$(am__dirstamp) \
     719        Concurrency/$(DEPDIR)/$(am__dirstamp)
    857720Common/$(am__dirstamp):
    858721        @$(MKDIR_P) Common
     
    865728Common/Eval.$(OBJEXT): Common/$(am__dirstamp) \
    866729        Common/$(DEPDIR)/$(am__dirstamp)
     730Common/PassVisitor.$(OBJEXT): Common/$(am__dirstamp) \
     731        Common/$(DEPDIR)/$(am__dirstamp)
    867732Common/SemanticError.$(OBJEXT): Common/$(am__dirstamp) \
    868733        Common/$(DEPDIR)/$(am__dirstamp)
     734Common/Stats/$(am__dirstamp):
     735        @$(MKDIR_P) Common/Stats
     736        @: > Common/Stats/$(am__dirstamp)
     737Common/Stats/$(DEPDIR)/$(am__dirstamp):
     738        @$(MKDIR_P) Common/Stats/$(DEPDIR)
     739        @: > Common/Stats/$(DEPDIR)/$(am__dirstamp)
     740Common/Stats/Counter.$(OBJEXT): Common/Stats/$(am__dirstamp) \
     741        Common/Stats/$(DEPDIR)/$(am__dirstamp)
     742Common/Stats/Heap.$(OBJEXT): Common/Stats/$(am__dirstamp) \
     743        Common/Stats/$(DEPDIR)/$(am__dirstamp)
     744Common/Stats/Stats.$(OBJEXT): Common/Stats/$(am__dirstamp) \
     745        Common/Stats/$(DEPDIR)/$(am__dirstamp)
     746Common/Stats/Time.$(OBJEXT): Common/Stats/$(am__dirstamp) \
     747        Common/Stats/$(DEPDIR)/$(am__dirstamp)
    869748Common/UniqueName.$(OBJEXT): Common/$(am__dirstamp) \
    870749        Common/$(DEPDIR)/$(am__dirstamp)
    871 Concurrency/$(am__dirstamp):
    872         @$(MKDIR_P) Concurrency
    873         @: > Concurrency/$(am__dirstamp)
    874 Concurrency/$(DEPDIR)/$(am__dirstamp):
    875         @$(MKDIR_P) Concurrency/$(DEPDIR)
    876         @: > Concurrency/$(DEPDIR)/$(am__dirstamp)
    877 Concurrency/Keywords.$(OBJEXT): Concurrency/$(am__dirstamp) \
    878         Concurrency/$(DEPDIR)/$(am__dirstamp)
    879750ControlStruct/$(am__dirstamp):
    880751        @$(MKDIR_P) ControlStruct
     
    933804ResolvExpr/AlternativeFinder.$(OBJEXT): ResolvExpr/$(am__dirstamp) \
    934805        ResolvExpr/$(DEPDIR)/$(am__dirstamp)
     806ResolvExpr/CastCost.$(OBJEXT): ResolvExpr/$(am__dirstamp) \
     807        ResolvExpr/$(DEPDIR)/$(am__dirstamp)
     808ResolvExpr/CommonType.$(OBJEXT): ResolvExpr/$(am__dirstamp) \
     809        ResolvExpr/$(DEPDIR)/$(am__dirstamp)
     810ResolvExpr/ConversionCost.$(OBJEXT): ResolvExpr/$(am__dirstamp) \
     811        ResolvExpr/$(DEPDIR)/$(am__dirstamp)
     812ResolvExpr/CurrentObject.$(OBJEXT): ResolvExpr/$(am__dirstamp) \
     813        ResolvExpr/$(DEPDIR)/$(am__dirstamp)
    935814ResolvExpr/ExplodedActual.$(OBJEXT): ResolvExpr/$(am__dirstamp) \
    936815        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)
    945816ResolvExpr/FindOpenVars.$(OBJEXT): ResolvExpr/$(am__dirstamp) \
    946817        ResolvExpr/$(DEPDIR)/$(am__dirstamp)
     
    967838ResolvExpr/Unify.$(OBJEXT): ResolvExpr/$(am__dirstamp) \
    968839        ResolvExpr/$(DEPDIR)/$(am__dirstamp)
     840SymTab/$(am__dirstamp):
     841        @$(MKDIR_P) SymTab
     842        @: > SymTab/$(am__dirstamp)
     843SymTab/$(DEPDIR)/$(am__dirstamp):
     844        @$(MKDIR_P) SymTab/$(DEPDIR)
     845        @: > SymTab/$(DEPDIR)/$(am__dirstamp)
    969846SymTab/Autogen.$(OBJEXT): SymTab/$(am__dirstamp) \
    970847        SymTab/$(DEPDIR)/$(am__dirstamp)
     
    975852SymTab/Mangler.$(OBJEXT): SymTab/$(am__dirstamp) \
    976853        SymTab/$(DEPDIR)/$(am__dirstamp)
     854SymTab/ManglerCommon.$(OBJEXT): SymTab/$(am__dirstamp) \
     855        SymTab/$(DEPDIR)/$(am__dirstamp)
    977856SymTab/Validate.$(OBJEXT): SymTab/$(am__dirstamp) \
    978857        SymTab/$(DEPDIR)/$(am__dirstamp)
     858SymTab/Demangle.$(OBJEXT): SymTab/$(am__dirstamp) \
     859        SymTab/$(DEPDIR)/$(am__dirstamp)
     860SynTree/$(am__dirstamp):
     861        @$(MKDIR_P) SynTree
     862        @: > SynTree/$(am__dirstamp)
     863SynTree/$(DEPDIR)/$(am__dirstamp):
     864        @$(MKDIR_P) SynTree/$(DEPDIR)
     865        @: > SynTree/$(DEPDIR)/$(am__dirstamp)
     866SynTree/Type.$(OBJEXT): SynTree/$(am__dirstamp) \
     867        SynTree/$(DEPDIR)/$(am__dirstamp)
     868SynTree/VoidType.$(OBJEXT): SynTree/$(am__dirstamp) \
     869        SynTree/$(DEPDIR)/$(am__dirstamp)
     870SynTree/BasicType.$(OBJEXT): SynTree/$(am__dirstamp) \
     871        SynTree/$(DEPDIR)/$(am__dirstamp)
     872SynTree/PointerType.$(OBJEXT): SynTree/$(am__dirstamp) \
     873        SynTree/$(DEPDIR)/$(am__dirstamp)
     874SynTree/ArrayType.$(OBJEXT): SynTree/$(am__dirstamp) \
     875        SynTree/$(DEPDIR)/$(am__dirstamp)
     876SynTree/ReferenceType.$(OBJEXT): SynTree/$(am__dirstamp) \
     877        SynTree/$(DEPDIR)/$(am__dirstamp)
     878SynTree/FunctionType.$(OBJEXT): SynTree/$(am__dirstamp) \
     879        SynTree/$(DEPDIR)/$(am__dirstamp)
     880SynTree/ReferenceToType.$(OBJEXT): SynTree/$(am__dirstamp) \
     881        SynTree/$(DEPDIR)/$(am__dirstamp)
     882SynTree/TupleType.$(OBJEXT): SynTree/$(am__dirstamp) \
     883        SynTree/$(DEPDIR)/$(am__dirstamp)
     884SynTree/TypeofType.$(OBJEXT): SynTree/$(am__dirstamp) \
     885        SynTree/$(DEPDIR)/$(am__dirstamp)
     886SynTree/AttrType.$(OBJEXT): SynTree/$(am__dirstamp) \
     887        SynTree/$(DEPDIR)/$(am__dirstamp)
     888SynTree/VarArgsType.$(OBJEXT): SynTree/$(am__dirstamp) \
     889        SynTree/$(DEPDIR)/$(am__dirstamp)
     890SynTree/ZeroOneType.$(OBJEXT): SynTree/$(am__dirstamp) \
     891        SynTree/$(DEPDIR)/$(am__dirstamp)
     892SynTree/Constant.$(OBJEXT): SynTree/$(am__dirstamp) \
     893        SynTree/$(DEPDIR)/$(am__dirstamp)
     894SynTree/Expression.$(OBJEXT): SynTree/$(am__dirstamp) \
     895        SynTree/$(DEPDIR)/$(am__dirstamp)
     896SynTree/TupleExpr.$(OBJEXT): SynTree/$(am__dirstamp) \
     897        SynTree/$(DEPDIR)/$(am__dirstamp)
     898SynTree/CommaExpr.$(OBJEXT): SynTree/$(am__dirstamp) \
     899        SynTree/$(DEPDIR)/$(am__dirstamp)
     900SynTree/TypeExpr.$(OBJEXT): SynTree/$(am__dirstamp) \
     901        SynTree/$(DEPDIR)/$(am__dirstamp)
     902SynTree/ApplicationExpr.$(OBJEXT): SynTree/$(am__dirstamp) \
     903        SynTree/$(DEPDIR)/$(am__dirstamp)
     904SynTree/AddressExpr.$(OBJEXT): SynTree/$(am__dirstamp) \
     905        SynTree/$(DEPDIR)/$(am__dirstamp)
     906SynTree/Statement.$(OBJEXT): SynTree/$(am__dirstamp) \
     907        SynTree/$(DEPDIR)/$(am__dirstamp)
     908SynTree/CompoundStmt.$(OBJEXT): SynTree/$(am__dirstamp) \
     909        SynTree/$(DEPDIR)/$(am__dirstamp)
     910SynTree/DeclStmt.$(OBJEXT): SynTree/$(am__dirstamp) \
     911        SynTree/$(DEPDIR)/$(am__dirstamp)
     912SynTree/Declaration.$(OBJEXT): SynTree/$(am__dirstamp) \
     913        SynTree/$(DEPDIR)/$(am__dirstamp)
     914SynTree/DeclarationWithType.$(OBJEXT): SynTree/$(am__dirstamp) \
     915        SynTree/$(DEPDIR)/$(am__dirstamp)
     916SynTree/ObjectDecl.$(OBJEXT): SynTree/$(am__dirstamp) \
     917        SynTree/$(DEPDIR)/$(am__dirstamp)
     918SynTree/FunctionDecl.$(OBJEXT): SynTree/$(am__dirstamp) \
     919        SynTree/$(DEPDIR)/$(am__dirstamp)
     920SynTree/AggregateDecl.$(OBJEXT): SynTree/$(am__dirstamp) \
     921        SynTree/$(DEPDIR)/$(am__dirstamp)
     922SynTree/NamedTypeDecl.$(OBJEXT): SynTree/$(am__dirstamp) \
     923        SynTree/$(DEPDIR)/$(am__dirstamp)
     924SynTree/TypeDecl.$(OBJEXT): SynTree/$(am__dirstamp) \
     925        SynTree/$(DEPDIR)/$(am__dirstamp)
     926SynTree/Initializer.$(OBJEXT): SynTree/$(am__dirstamp) \
     927        SynTree/$(DEPDIR)/$(am__dirstamp)
     928SynTree/TypeSubstitution.$(OBJEXT): SynTree/$(am__dirstamp) \
     929        SynTree/$(DEPDIR)/$(am__dirstamp)
     930SynTree/Attribute.$(OBJEXT): SynTree/$(am__dirstamp) \
     931        SynTree/$(DEPDIR)/$(am__dirstamp)
     932SynTree/DeclReplacer.$(OBJEXT): SynTree/$(am__dirstamp) \
     933        SynTree/$(DEPDIR)/$(am__dirstamp)
    979934Tuples/$(am__dirstamp):
    980935        @$(MKDIR_P) Tuples
     
    983938        @$(MKDIR_P) Tuples/$(DEPDIR)
    984939        @: > Tuples/$(DEPDIR)/$(am__dirstamp)
    985 Tuples/Explode.$(OBJEXT): Tuples/$(am__dirstamp) \
    986         Tuples/$(DEPDIR)/$(am__dirstamp)
    987940Tuples/TupleAssignment.$(OBJEXT): Tuples/$(am__dirstamp) \
    988941        Tuples/$(DEPDIR)/$(am__dirstamp)
    989942Tuples/TupleExpansion.$(OBJEXT): Tuples/$(am__dirstamp) \
     943        Tuples/$(DEPDIR)/$(am__dirstamp)
     944Tuples/Explode.$(OBJEXT): Tuples/$(am__dirstamp) \
    990945        Tuples/$(DEPDIR)/$(am__dirstamp)
    991946Validate/$(am__dirstamp):
     
    10701025        Concurrency/$(DEPDIR)/$(am__dirstamp)
    10711026Common/DebugMalloc.$(OBJEXT): Common/$(am__dirstamp) \
    1072         Common/$(DEPDIR)/$(am__dirstamp)
    1073 Common/Heap.$(OBJEXT): Common/$(am__dirstamp) \
    10741027        Common/$(DEPDIR)/$(am__dirstamp)
    10751028ControlStruct/ExceptTranslate.$(OBJEXT):  \
     
    11421095        -rm -f CodeTools/*.$(OBJEXT)
    11431096        -rm -f Common/*.$(OBJEXT)
     1097        -rm -f Common/Stats/*.$(OBJEXT)
    11441098        -rm -f Concurrency/*.$(OBJEXT)
    11451099        -rm -f ControlStruct/*.$(OBJEXT)
     
    11721126@AMDEP_TRUE@@am__include@ @am__quote@Common/$(DEPDIR)/DebugMalloc.Po@am__quote@
    11731127@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@
    11751129@AMDEP_TRUE@@am__include@ @am__quote@Common/$(DEPDIR)/SemanticError.Po@am__quote@
    11761130@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@
    11771135@AMDEP_TRUE@@am__include@ @am__quote@Concurrency/$(DEPDIR)/Keywords.Po@am__quote@
    11781136@AMDEP_TRUE@@am__include@ @am__quote@Concurrency/$(DEPDIR)/Waitfor.Po@am__quote@
     
    14361394        -rm -f Common/$(DEPDIR)/$(am__dirstamp)
    14371395        -rm -f Common/$(am__dirstamp)
     1396        -rm -f Common/Stats/$(DEPDIR)/$(am__dirstamp)
     1397        -rm -f Common/Stats/$(am__dirstamp)
    14381398        -rm -f Concurrency/$(DEPDIR)/$(am__dirstamp)
    14391399        -rm -f Concurrency/$(am__dirstamp)
     
    14731433
    14741434distclean: distclean-am
    1475         -rm -rf ./$(DEPDIR) CodeGen/$(DEPDIR) CodeTools/$(DEPDIR) Common/$(DEPDIR) Concurrency/$(DEPDIR) ControlStruct/$(DEPDIR) GenPoly/$(DEPDIR) InitTweak/$(DEPDIR) Parser/$(DEPDIR) ResolvExpr/$(DEPDIR) SymTab/$(DEPDIR) SynTree/$(DEPDIR) Tuples/$(DEPDIR) Validate/$(DEPDIR) Virtual/$(DEPDIR)
     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)
    14761436        -rm -f Makefile
    14771437distclean-am: clean-am distclean-compile distclean-generic \
     
    15191479
    15201480maintainer-clean: maintainer-clean-am
    1521         -rm -rf ./$(DEPDIR) CodeGen/$(DEPDIR) CodeTools/$(DEPDIR) Common/$(DEPDIR) Concurrency/$(DEPDIR) ControlStruct/$(DEPDIR) GenPoly/$(DEPDIR) InitTweak/$(DEPDIR) Parser/$(DEPDIR) ResolvExpr/$(DEPDIR) SymTab/$(DEPDIR) SynTree/$(DEPDIR) Tuples/$(DEPDIR) Validate/$(DEPDIR) Virtual/$(DEPDIR)
     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)
    15221482        -rm -f Makefile
    15231483maintainer-clean-am: distclean-am maintainer-clean-generic
     
    15591519
    15601520
     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
    15611528# Tell versions [3.59,3.63) of GNU make to not export all variables.
    15621529# Otherwise a system limit (for SysV at least) may be exceeded.
  • src/Parser/DeclarationNode.cc

    r9d9a451 r53bb8f1  
    1010// Created On       : Sat May 16 12:34:05 2015
    1111// Last Modified By : Peter A. Buhr
    12 // Last Modified On : Thu Nov  1 20:54:26 2018
    13 // Update Count     : 1108
     12// Last Modified On : Fri Feb  1 16:49:17 2019
     13// Update Count     : 1113
    1414//
    1515
     
    4141
    4242// 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" };
     43const char * DeclarationNode::basicTypeNames[] = { "void", "_Bool", "char", "int", "int128",
     44                                                                                                   "float", "double", "long double", "float80", "float128",
     45                                                                                                   "_float16", "_float32", "_float32x", "_float64", "_float64x", "_float128", "_float128x", "NoBasicTypeNames" };
     46const char * DeclarationNode::complexTypeNames[] = { "_Complex", "NoComplexTypeNames", "_Imaginary" }; // Imaginary unsupported => parse, but make invisible and print error message
    4547const char * DeclarationNode::signednessNames[] = { "signed", "unsigned", "NoSignednessNames" };
    4648const char * DeclarationNode::lengthNames[] = { "short", "long", "long long", "NoLengthNames" };
  • src/Parser/ExpressionNode.cc

    r9d9a451 r53bb8f1  
    1010// Created On       : Sat May 16 13:17:07 2015
    1111// Last Modified By : Peter A. Buhr
    12 // Last Modified On : Mon Jun  4 21:24:45 2018
    13 // Update Count     : 802
     12// Last Modified On : Sun Mar 10 16:10:32 2019
     13// Update Count     : 976
    1414//
    1515
     
    5151extern const Type::Qualifiers noQualifiers;                             // no qualifiers on constants
    5252
    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'; }
    5756static inline bool checkF( char c ) { return c == 'f' || c == 'F'; }
    5857static inline bool checkD( char c ) { return c == 'd' || c == 'D'; }
     58static inline bool checkF80( char c ) { return c == 'w' || c == 'W'; }
     59static inline bool checkF128( char c ) { return c == 'q' || c == 'Q'; }
     60static inline bool checkL( char c ) { return c == 'l' || c == 'L'; }
    5961static inline bool checkI( char c ) { return c == 'i' || c == 'I'; }
    6062static inline bool checkB( char c ) { return c == 'b' || c == 'B'; }
    6163static 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;
     64static inline bool checkN( char c ) { return c == 'n' || c == 'N'; }
     65
     66void 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;
    7982                } 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
     90void 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
    95109
    96110Expression * 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
    99113                { BasicType::ShortSignedInt, BasicType::SignedChar, BasicType::SignedInt, BasicType::LongSignedInt, BasicType::LongLongSignedInt, BasicType::SignedInt128, },
    100114                { BasicType::ShortUnsignedInt, BasicType::UnsignedChar, BasicType::UnsignedInt, BasicType::LongUnsignedInt, BasicType::LongLongUnsignedInt, BasicType::UnsignedInt128, },
    101115        };
    102116
    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
    106121
    107122        unsigned long long int v;                                                       // converted integral value
    108123        size_t last = str.length() - 1;                                         // last subscript of constant
    109124        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
    110130
    111131        // special constants
     
    119139        } // if
    120140
    121         // Cannot be "0"
     141        // Cannot be just "0"/"1"; sscanf stops at the suffix, if any; value goes over the wall => always generate
    122142
    123143        if ( str[0] == '0' ) {                                                          // radix character ?
     
    127147                        //printf( "%llx %llu\n", v, v );
    128148                } else if ( checkB( str[1] ) ) {                                // binary constant ?
    129                         v = 0;
    130                         for ( unsigned int i = 2;; i += 1 ) {           // compute value
     149                        v = 0;                                                                          // compute value
     150                        for ( unsigned int i = 2;; ) {                          // ignore prefix
    131151                                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;
    133154                                v <<= 1;
    134155                        } // for
    135                         //printf( "%llx %llu\n", v, v );
     156                        //printf( "%#llx %llu\n", v, v );
    136157                } else {                                                                                // octal constant
    137158                        sscanf( (char *)str.c_str(), "%llo", &v );
    138                         //printf( "%llo %llu\n", v, v );
     159                        //printf( "%#llo %llu\n", v, v );
    139160                } // if
    140161        } else {                                                                                        // decimal constant ?
    141162                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 ) );                                                             
    170221                        } // 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: ;
    224226        delete &str;                                                                            // created by lex
    225227        return ret;
     
    227229
    228230
    229 static inline void checkLNFloat( string & str, int & lnth, int & size ) {
    230         string::size_type posn = str.find_first_of( "lL" ), start = posn;
     231static 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
    231240  if ( posn == string::npos ) return;
    232         size = 2;                                                                                       // assume largest size
    233         lnth = 0;
     241        explnth = true;
    234242        posn += 1;                                                                                      // advance to size
    235243        if ( str[posn] == '3' ) {                                                       // 32
    236                 size = 0;
     244                if ( str[last] != 'x' ) type = 6;
     245                else type = 7;
    237246        } 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
    242258        } else {
    243259                assertf( false, "internal error, bad floating point length %s", str.c_str() );
    244260        } // if
    245         posn += 1;
    246         str.erase( start, posn - start + 1 );                           // remove length suffix
    247 } // checkLNFloat
     261} // checkFnxFloat
    248262
    249263
    250264Expression * 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 },
    254268        };
    255269
    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
    260271        size_t last = str.length() - 1;
    261272        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
    262276
    263277        sscanf( str.c_str(), "%lg", &v );
     
    269283
    270284        if ( checkF( str[last] ) ) {                                            // float ?
    271                 size = 0;
     285                type = 0;
    272286        } else if ( checkD( str[last] ) ) {                                     // double ?
    273                 size = 1;
     287                type = 1;
    274288        } 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;
    276294        } 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
    280299        if ( ! complx && checkI( str[last - 1] ) ) {            // imaginary ?
    281300                complx = true;
    282301        } // if
    283302
    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 );
    288307        } // if
    289308
  • src/Parser/ParseNode.h

    r9d9a451 r53bb8f1  
    1010// Created On       : Sat May 16 13:28:16 2015
    1111// Last Modified By : Peter A. Buhr
    12 // Last Modified On : Thu Nov  1 20:54:53 2018
    13 // Update Count     : 854
     12// Last Modified On : Wed Feb 13 17:36:49 2019
     13// Update Count     : 867
    1414//
    1515
     
    206206class DeclarationNode : public ParseNode {
    207207  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 };
    210212        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
    212214        static const char * complexTypeNames[];
    213215        enum Signedness { Signed, Unsigned, NoSignedness };
  • src/Parser/TypeData.cc

    r9d9a451 r53bb8f1  
    1010// Created On       : Sat May 16 15:12:51 2015
    1111// Last Modified By : Peter A. Buhr
    12 // Last Modified On : Fri Nov  2 07:54:26 2018
    13 // Update Count     : 624
     12// Last Modified On : Wed Feb 13 18:16:23 2019
     13// Update Count     : 649
    1414//
    1515
     
    666666
    667667          case DeclarationNode::Float:
    668           case DeclarationNode::Float80:
    669           case DeclarationNode::Float128:
    670668          case DeclarationNode::Double:
    671669          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, },
    676682                };
    677683
     
    686692                        genTSError( DeclarationNode::lengthNames[ td->length ], td->basictype );
    687693                } // 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
    688700                if ( td->length == DeclarationNode::Long ) {
    689701                        const_cast<TypeData *>(td)->basictype = DeclarationNode::LongDouble;
    690702                } // if
    691703
    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 
    701704                ret = floattype[ td->complextype ][ td->basictype - DeclarationNode::Float ];
     705                //printf( "XXXX %d %d %d %d\n", td->complextype, td->basictype, DeclarationNode::Float, ret );
    702706                break;
    703707
  • src/Parser/TypeData.h

    r9d9a451 r53bb8f1  
    3131        struct Aggregate_t {
    3232                DeclarationNode::Aggregate kind;
    33                 const std::string * name;
    34                 DeclarationNode * params;
    35                 ExpressionNode * actuals;                                               // holds actual parameters later applied to AggInst
    36                 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;
    3737                bool body;
    3838                bool anon;
    3939
    4040                bool tagged;
    41                 const std::string * parent;
     41                const std::string * parent = nullptr;
    4242        };
    4343
    4444        struct AggInst_t {
    45                 TypeData * aggregate;
    46                 ExpressionNode * params;
     45                TypeData * aggregate = nullptr;
     46                ExpressionNode * params = nullptr;
    4747                bool hoistType;
    4848        };
    4949
    5050        struct Array_t {
    51                 ExpressionNode * dimension;
     51                ExpressionNode * dimension = nullptr;
    5252                bool isVarLen;
    5353                bool isStatic;
     
    5555
    5656        struct Enumeration_t {
    57                 const std::string * name;
    58                 DeclarationNode * constants;
     57                const std::string * name = nullptr;
     58                DeclarationNode * constants = nullptr;
    5959                bool body;
    6060                bool anon;
     
    6262
    6363        struct Function_t {
    64                 mutable DeclarationNode * params;                               // mutables modified in buildKRFunction
    65                 mutable DeclarationNode * idList;                               // old-style
    66                 mutable DeclarationNode * oldDeclList;
    67                 StatementNode * body;
    68                 ExpressionNode * withExprs;                                             // expressions from function's with_clause
     64                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
    6969        };
    7070
    7171        struct Symbolic_t {
    72                 const std::string * name;
     72                const std::string * name = nullptr;
    7373                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;
    7777        };
    7878
    7979        struct Qualified_t {                                                            // qualified type S.T
    80                 TypeData * parent;
    81                 TypeData * child;
     80                TypeData * parent = nullptr;
     81                TypeData * child = nullptr;
    8282        };
    8383
     
    9393
    9494        Type::Qualifiers qualifiers;
    95         DeclarationNode * forall;
     95        DeclarationNode * forall = nullptr;
    9696
    9797        Aggregate_t aggregate;
     
    102102        Symbolic_t symbolic;
    103103        Qualified_t qualified;
    104         DeclarationNode * tuple;
    105         ExpressionNode * typeexpr;
     104        DeclarationNode * tuple = nullptr;
     105        ExpressionNode * typeexpr = nullptr;
    106106
    107107        TypeData( Kind k = Unknown );
  • src/Parser/lex.ll

    r9d9a451 r53bb8f1  
    1010 * Created On       : Sat Sep 22 08:58:10 2001
    1111 * Last Modified By : Peter A. Buhr
    12  * Last Modified On : Thu Nov  1 20:57:35 2018
    13  * Update Count     : 687
     12 * Last Modified On : Sun Mar 10 09:13:09 2019
     13 * Update Count     : 706
    1414 */
    1515
     
    3939using namespace std;
    4040
     41#include "config.h"                                                                             // configure info
    4142#include "ParseNode.h"
    4243#include "TypedefTable.h"
     
    5960#define IDENTIFIER_RETURN()     RETURN_VAL( typedefTable.isKind( yytext ) )
    6061#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
    6168
    6269void rm_underscore() {
     
    9299hex_quad {hex}("_"?{hex}){3}
    93100size_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'
     102length ("ll"|"LL"|[lL]{size_opt})|("hh"|"HH"|[hHnN])
     103                                // CFA: size_t 'z', pointer 'p', which define a sign and length
     104integer_suffix_opt ("_"?(([uU]({length}?[iI]?)|([iI]{length}))|([iI]({length}?[uU]?)|([uU]{length}))|({length}([iI]?[uU]?)|([uU][iI]))|[zZ]|[pP]))?
    96105
    97106octal_digits ({octal})|({octal}({octal}|"_")*{octal})
     
    112121                                // GCC: D (double) and iI (imaginary) suffixes, and DL (long double)
    113122exponent "_"?[eE]"_"?[+-]?{decimal_digits}
    114 floating_size 32|64|80|128
    115 floating_length ([fFdDlL]|[lL]{floating_size})
     123floating_size 16|32|32x|64|64x|80|128|128x
     124floating_length ([fFdDlLwWqQ]|[fF]{floating_size})
    116125floating_suffix ({floating_length}?[iI]?)|([iI]{floating_length})
    117126floating_suffix_opt ("_"?({floating_suffix}|"DL"))?
     
    240249finally                 { KEYWORD_RETURN(FINALLY); }                    // CFA
    241250float                   { 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
     252float80                 { KEYWORD_RETURN(uuFLOAT80); }                  // GCC
     253__float128              { KEYWORD_RETURN(uuFLOAT128); }                 // GCC
     254float128                { 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
    252262for                             { KEYWORD_RETURN(FOR); }
    253263forall                  { KEYWORD_RETURN(FORALL); }                             // CFA
  • src/Parser/module.mk

    r9d9a451 r53bb8f1  
    3131       Parser/parserutility.cc
    3232
    33 MOSTLYCLEANFILES += Parser/parser.hh Parser/parser.output
     33SRCDEMANGLE += \
     34        Parser/LinkageSpec.cc
     35
     36
     37MOSTLYCLEANFILES += Parser/lex.cc Parser/parser.cc Parser/parser.hh Parser/parser.output
  • src/Parser/parser.yy

    r9d9a451 r53bb8f1  
    1010// Created On       : Sat Sep  1 20:22:55 2001