Changeset 3537dd7


Ignore:
Timestamp:
Aug 3, 2018, 9:02:32 AM (6 years ago)
Author:
Rob Schluntz <rschlunt@…>
Branches:
ADT, aaron-thesis, arm-eh, ast-experimental, cleanup-dtors, deferred_resn, demangler, enum, forall-pointer-decay, jacob/cs343-translation, jenkins-sandbox, master, new-ast, new-ast-unique-expr, no_list, persistent-indexer, pthread-emulation, qualifiedEnum
Children:
ac3362c
Parents:
04e367c (diff), f7ac09d (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 branch 'master' of plg.uwaterloo.ca:/u/cforall/software/cfa/cfa-cc

Files:
4 added
29 edited

Legend:

Unmodified
Added
Removed
  • .gitignore

    r04e367c r3537dd7  
    2929
    3030# src executables, for lib and bin
    31 src/driver/cc1
     31src/driver/as
    3232src/driver/cfa
    3333src/driver/cfa-cpp
     34src/driver/cc1
    3435
    3536src/prelude/bootloader.c
  • Jenkins/FullBuild

    r04e367c r3537dd7  
    8787
    8888        if(result.result != 'SUCCESS') {
    89                 sh("wget -q -O - ${result.absoluteUrl}/consoleText")
     89                sh("wget -q -O - http://localhost:8084/jenkins/job/Cforall/job/master/${result.number}/consoleText")
    9090                error(result.result)
    9191        }
  • Jenkinsfile

    r04e367c r3537dd7  
    2222        do_sendemail    = true
    2323
     24        builddir = pwd tmp: true
     25        srcdir   = pwd tmp: false
     26
    2427        currentBuild.result = "SUCCESS"
    2528
     
    3235                        prepare_build()
    3336
     37                        clean()
     38
    3439                        checkout()
    3540
     
    4146
    4247                        benchmark()
    43 
    44                         clean()
    4548
    4649                        build_doc()
     
    6770        finally {
    6871                //Send email with final results if this is not a full build
    69                 if( do_sendemail && !bIsSandbox ) {
     72                if( do_sendemail ) {
    7073                        echo 'Notifying users of result'
    71                         email(currentBuild.result, log_needed)
     74                        email(currentBuild.result, log_needed, bIsSandbox)
    7275                }
    7376
     
    155158        do_sendemail    = ! (pSilent == 'true')
    156159
     160        collect_git_info()
     161
     162        def full = do_alltests ? " (Full)" : ""
     163        currentBuild.description = "${compiler.cc_name}:${arch_name}${full}"
     164
    157165        echo """Compiler              : ${compiler.cc_name} (${compiler.cpp_cc}/${compiler.cfa_cc})
    158166Architecture            : ${arch_name}
     
    164172Silent                  : ${ pSilent.toString() }
    165173"""
    166 
    167         collect_git_info()
    168174}
    169175
     
    241247// Main compilation routines
    242248//===========================================================================================================
     249def clean() {
     250        build_stage('Cleanup') {
     251                // clean the build by wipping the build directory
     252                dir(builddir) {
     253                        deleteDir()
     254                }
     255
     256                //Clean all temporary files to make sure no artifacts of the previous build remain
     257                sh 'git clean -fdqx'
     258
     259                //Reset the git repo so no local changes persist
     260                sh 'git reset --hard'
     261        }
     262}
     263
    243264//Compilation script is done here but environnement set-up and error handling is done in main loop
    244265def checkout() {
     
    246267                //checkout the source code and clean the repo
    247268                checkout scm
    248 
    249                 //Clean all temporary files to make sure no artifacts of the previous build remain
    250                 sh 'git clean -fdqx'
    251 
    252                 //Reset the git repo so no local changes persist
    253                 sh 'git reset --hard'
    254269        }
    255270}
     
    257272def build() {
    258273        build_stage('Build') {
    259 
    260                 def install_dir = pwd tmp: true
    261 
    262274                // Build outside of the src tree to ease cleaning
    263                 sh "mkdir -p build"
    264                 dir ('build') {
     275                dir (builddir) {
    265276                        //Configure the conpilation (Output is not relevant)
    266277                        //Use the current directory as the installation target so nothing escapes the sandbox
    267278                        //Also specify the compiler by hand
    268                         sh "../configure CXX=${compiler.cpp_cc} ${architecture} --with-backend-compiler=${compiler.cfa_cc} --prefix=${install_dir} --enable-silent-rules --quiet"
     279                        sh "${srcdir}/configure CXX=${compiler.cpp_cc} ${architecture} --with-backend-compiler=${compiler.cfa_cc} --enable-silent-rules --quiet"
    269280
    270281                        //Compile the project
     
    277288        build_stage('Test') {
    278289
    279                 //Run the tests from the tests directory
    280                 if ( do_alltests ) {
    281                         sh 'make -C build/src/tests all-tests debug=yes --no-print-directory'
    282                         sh 'make -C build/src/tests all-tests debug=no --no-print-directory'
    283                 }
    284                 else {
    285                         sh 'make -C build/src/tests --no-print-directory'
     290                dir (builddir) {
     291                        //Run the tests from the tests directory
     292                        if ( do_alltests ) {
     293                                sh 'make --no-print-directory -C src/tests all-tests debug=yes'
     294                                sh 'make --no-print-directory -C src/tests all-tests debug=no '
     295                        }
     296                        else {
     297                                sh 'make --no-print-directory -C src/tests'
     298                        }
    286299                }
    287300        }
     
    293306                if( !do_benchmark ) return
    294307
    295                 //Append bench results
    296                 sh 'make -C build/src/benchmark --no-print-directory jenkins githash=' + gitRefNewValue + ' arch=' + arch_name + ' | tee bench.json'
    297         }
    298 }
    299 
    300 def clean() {
    301         build_stage('Cleanup') {
    302                 // clean the build by wipping the build directory
    303                 sh 'rm -rf build'
     308                dir (builddir) {
     309                        //Append bench results
     310                        sh "make --no-print-directory -C src/benchmark jenkins githash=${gitRefNewValue} arch=${arch_name} | tee ${srcdir}/bench.json"
     311                }
    304312        }
    305313}
     
    334342//===========================================================================================================
    335343//Standard build email notification
    336 def email(String status, boolean log) {
     344def email(String status, boolean log, boolean bIsSandbox) {
    337345        //Since tokenizer doesn't work, figure stuff out from the environnement variables and command line
    338346        //Configurations for email format
     
    377385        def email_to = "cforall@lists.uwaterloo.ca"
    378386
    379         //send email notification
    380         emailext body: email_body, subject: email_subject, to: email_to, attachLog: log
    381 }
     387        if( !bIsSandbox ) {
     388                //send email notification
     389                emailext body: email_body, subject: email_subject, to: email_to, attachLog: log
     390        } else {
     391                echo "Would send email to: ${email_to}"
     392                echo "With title: ${email_subject}"
     393                echo "Content: \n${email_body}"
     394        }
     395}
  • Makefile.in

    r04e367c r3537dd7  
    250250AWK = @AWK@
    251251BACKEND_CC = @BACKEND_CC@               # C compiler used to compile Cforall programs, versus C++ compiler used to build cfa command
     252BUILD_IN_TREE_FLAGS = @BUILD_IN_TREE_FLAGS@
     253BUILD_IN_TREE_FLAGS_NOLIB = @BUILD_IN_TREE_FLAGS_NOLIB@
    252254CC = @CC@
    253255CCAS = @CCAS@
     
    255257CCASFLAGS = @CCASFLAGS@
    256258CCDEPMODE = @CCDEPMODE@
     259CFACC = @CFACC@
     260CFACPP = @CFACPP@
    257261CFA_BACKEND_CC = @CFA_BACKEND_CC@
    258262CFA_BINDIR = @CFA_BINDIR@
     
    271275DEFS = @DEFS@
    272276DEPDIR = @DEPDIR@
     277DRIVER_DIR = @DRIVER_DIR@
    273278ECHO_C = @ECHO_C@
    274279ECHO_N = @ECHO_N@
  • configure

    r04e367c r3537dd7  
    674674build_cpu
    675675build
     676BUILD_IN_TREE_FLAGS
     677BUILD_IN_TREE_FLAGS_NOLIB
     678CFACPP
     679CFACC
     680DRIVER_DIR
    676681CFA_LIBDIR
    677682CFA_BINDIR
     
    33753380
    33763381
     3382# Create variables for commonly used targets
     3383DRIVER_DIR='$(top_builddir)/src/driver'
     3384CFACC=${DRIVER_DIR}/cfa
     3385CFACPP=${DRIVER_DIR}/cfa-cpp
     3386
     3387
     3388
     3389
     3390# Flag variables needed to build in tree
     3391LIBCFA_SRC='$(top_srcdir)/src/libcfa'
     3392LIBCFA_BUILD='$(top_builddir)/src/libcfa'
     3393BUILD_IN_TREE_FLAGS_NOLIB="-XCFA -t -B${DRIVER_DIR}"
     3394BUILD_IN_TREE_FLAGS="${BUILD_IN_TREE_FLAGS_NOLIB} -L${LIBCFA_BUILD} -I${LIBCFA_SRC} -I${LIBCFA_SRC}/containers -I${LIBCFA_SRC}/concurrency -I${LIBCFA_SRC}/stdhdr"
     3395
     3396
     3397
    33773398# Make sure we can run config.sub.
    33783399$SHELL "$ac_aux_dir/config.sub" sun4 >/dev/null 2>&1 ||
  • configure.ac

    r04e367c r3537dd7  
    170170AC_DEFINE_UNQUOTED(CFA_LIBDIR, "${cfa_libdir}", [Location of cc1 and cfa-cpp commands.])
    171171AC_SUBST(CFA_LIBDIR, ${cfa_libdir})
     172
     173# Create variables for commonly used targets
     174DRIVER_DIR='$(top_builddir)/src/driver'
     175CFACC=${DRIVER_DIR}/cfa
     176CFACPP=${DRIVER_DIR}/cfa-cpp
     177AC_SUBST(DRIVER_DIR)
     178AC_SUBST(CFACC)
     179AC_SUBST(CFACPP)
     180
     181# Flag variables needed to build in tree
     182LIBCFA_SRC='$(top_srcdir)/src/libcfa'
     183LIBCFA_BUILD='$(top_builddir)/src/libcfa'
     184BUILD_IN_TREE_FLAGS_NOLIB="-XCFA -t -B${DRIVER_DIR}"
     185BUILD_IN_TREE_FLAGS="${BUILD_IN_TREE_FLAGS_NOLIB} -L${LIBCFA_BUILD} -I${LIBCFA_SRC} -I${LIBCFA_SRC}/containers -I${LIBCFA_SRC}/concurrency -I${LIBCFA_SRC}/stdhdr"
     186AC_SUBST(BUILD_IN_TREE_FLAGS_NOLIB)
     187AC_SUBST(BUILD_IN_TREE_FLAGS)
    172188
    173189AC_CANONICAL_BUILD
  • doc/papers/general/Paper.tex

    r04e367c r3537dd7  
    203203The C programming language is a foundational technology for modern computing with millions of lines of code implementing everything from hobby projects to commercial operating-systems.
    204204This installation base and the programmers producing it represent a massive software-engineering investment spanning decades and likely to continue for decades more.
    205 Nevertheless, C, first standardized almost forty years ago, lacks many features that make programming in more modern languages safer and more productive.
     205Nevertheless, C, first standardized almost thirty years ago, lacks many features that make programming in more modern languages safer and more productive.
    206206
    207207The goal of the \CFA project (pronounced ``C-for-all'') is to create an extension of C that provides modern safety and productivity features while still ensuring strong backwards compatibility with C and its programmers.
  • doc/user/user.tex

    r04e367c r3537dd7  
    1111%% Created On       : Wed Apr  6 14:53:29 2016
    1212%% Last Modified By : Peter A. Buhr
    13 %% Last Modified On : Mon Jul  9 10:49:52 2018
    14 %% Update Count     : 3361
     13%% Last Modified On : Thu Jul 26 17:29:05 2018
     14%% Update Count     : 3366
    1515%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
    1616
     
    59675967void * memalign( size_t align, size_t size );§\indexc{memalign}§
    59685968int posix_memalign( void ** ptr, size_t align, size_t size );§\indexc{posix_memalign}§
    5969 }
    5970 
    5971 // §\CFA§ safe equivalents, i.e., implicit size specification
    5972 forall( dtype T | sized(T) ) T * malloc( void );
    5973 forall( dtype T | sized(T) ) T * calloc( size_t dim );
    5974 forall( dtype T | sized(T) ) T * realloc( T * ptr, size_t size );
    5975 forall( dtype T | sized(T) ) T * memalign( size_t align );
    5976 forall( dtype T | sized(T) ) T * aligned_alloc( size_t align );
    5977 forall( dtype T | sized(T) ) int posix_memalign( T ** ptr, size_t align );
    5978 
    5979 // §\CFA§ safe general allocation, fill, resize, array
    5980 forall( dtype T | sized(T) ) T * alloc( void );§\indexc{alloc}§
    5981 forall( dtype T | sized(T) ) T * alloc( char fill );
    5982 forall( dtype T | sized(T) ) T * alloc( size_t dim );
    5983 forall( dtype T | sized(T) ) T * alloc( size_t dim, char fill );
    5984 forall( dtype T | sized(T) ) T * alloc( T ptr[], size_t dim );
    5985 forall( dtype T | sized(T) ) T * alloc( T ptr[], size_t dim, char fill );
    5986 
    5987 // §\CFA§ safe general allocation, align, fill, array
    5988 forall( dtype T | sized(T) ) T * align_alloc( size_t align );
    5989 forall( dtype T | sized(T) ) T * align_alloc( size_t align, char fill );
    5990 forall( dtype T | sized(T) ) T * align_alloc( size_t align, size_t dim );
    5991 forall( dtype T | sized(T) ) T * align_alloc( size_t align, size_t dim, char fill );
    59925969
    59935970// C unsafe initialization/copy
    5994 extern "C" {
    59955971void * memset( void * dest, int c, size_t size );
    59965972void * memcpy( void * dest, const void * src, size_t size );
    59975973}
    59985974
     5975forall( dtype T | sized(T) ) {
     5976// §\CFA§ safe equivalents, i.e., implicit size specification
     5977        T * malloc( void );
     5978        T * calloc( size_t dim );
     5979        T * realloc( T * ptr, size_t size );
     5980        T * memalign( size_t align );
     5981        T * aligned_alloc( size_t align );
     5982        int posix_memalign( T ** ptr, size_t align );
     5983
     5984// §\CFA§ safe general allocation, fill, resize, array
     5985        T * alloc( void );§\indexc{alloc}§
     5986        T * alloc( char fill );
     5987        T * alloc( size_t dim );
     5988        T * alloc( size_t dim, char fill );
     5989        T * alloc( T ptr[], size_t dim );
     5990        T * alloc( T ptr[], size_t dim, char fill );
     5991
     5992// §\CFA§ safe general allocation, align, fill, array
     5993        T * align_alloc( size_t align );
     5994        T * align_alloc( size_t align, char fill );
     5995        T * align_alloc( size_t align, size_t dim );
     5996        T * align_alloc( size_t align, size_t dim, char fill );
     5997
    59995998// §\CFA§ safe initialization/copy, i.e., implicit size specification
    6000 forall( dtype T | sized(T) ) T * memset( T * dest, char c );§\indexc{memset}§
    6001 forall( dtype T | sized(T) ) T * memcpy( T * dest, const T * src );§\indexc{memcpy}§
     5999        T * memset( T * dest, char c );§\indexc{memset}§
     6000        T * memcpy( T * dest, const T * src );§\indexc{memcpy}§
    60026001
    60036002// §\CFA§ safe initialization/copy array
    6004 forall( dtype T | sized(T) ) T * memset( T dest[], size_t dim, char c );
    6005 forall( dtype T | sized(T) ) T * memcpy( T dest[], const T src[], size_t dim );
     6003        T * amemset( T dest[], char c, size_t dim );
     6004        T * amemcpy( T dest[], const T src[], size_t dim );
     6005}
    60066006
    60076007// §\CFA§ allocation/deallocation and constructor/destructor
     
    60636063forall( otype T | { int ?<?( T, T ); } )
    60646064void qsort( const T * arr, size_t dim );§\indexc{qsort}§
     6065
     6066forall( otype E | { int ?<?( E, E ); } ) {
     6067        E * bsearch( E key, const E * vals, size_t dim );§\indexc{bsearch}§     §\C{// location}§
     6068        size_t bsearch( E key, const E * vals, size_t dim );§\C{// position}§
     6069        E * bsearchl( E key, const E * vals, size_t dim );§\indexc{bsearchl}§
     6070        size_t bsearchl( E key, const E * vals, size_t dim );
     6071        E * bsearchu( E key, const E * vals, size_t dim );§\indexc{bsearchu}§
     6072        size_t bsearchu( E key, const E * vals, size_t dim );
     6073}
     6074
     6075forall( otype K, otype E | { int ?<?( K, K ); K getKey( const E & ); } ) {
     6076        E * bsearch( K key, const E * vals, size_t dim );
     6077        size_t bsearch( K key, const E * vals, size_t dim );
     6078        E * bsearchl( K key, const E * vals, size_t dim );
     6079        size_t bsearchl( K key, const E * vals, size_t dim );
     6080        E * bsearchu( K key, const E * vals, size_t dim );
     6081        size_t bsearchu( K key, const E * vals, size_t dim );
     6082}
     6083
     6084forall( otype E | { int ?<?( E, E ); } ) {
     6085        void qsort( E * vals, size_t dim );§\indexc{qsort}§
     6086}
    60656087\end{cfa}
    60666088
  • src/Makefile.am

    r04e367c r3537dd7  
    4242
    4343# put into lib for now
    44 cfa_cpplibdir = ${CFA_LIBDIR}
     44cfa_cpplibdir = $(CFA_LIBDIR)
    4545cfa_cpplib_PROGRAMS = driver/cfa-cpp
    46 driver_cfa_cpp_SOURCES = ${SRC}
     46driver_cfa_cpp_SOURCES = $(SRC)
    4747driver_cfa_cpp_LDADD = -ldl                     # yywrap
    48 driver_cfa_cpp_CXXFLAGS = -Wno-deprecated -Wall -Wextra -DDEBUG_ALL -I./Parser -I${abs_top_srcdir}/src/Parser -I${abs_top_srcdir}/src/include -DYY_NO_INPUT -O2 -g -std=c++14
     48driver_cfa_cpp_CXXFLAGS = -Wno-deprecated -Wall -Wextra -DDEBUG_ALL -I./Parser -I$(srcdir)/Parser -I$(srcdir)/include -DYY_NO_INPUT -O2 -g -std=c++14
    4949driver_cfa_cpp_LDFLAGS = -Xlinker -export-dynamic
    5050
  • src/Makefile.in

    r04e367c r3537dd7  
    372372AWK = @AWK@
    373373BACKEND_CC = @BACKEND_CC@
     374BUILD_IN_TREE_FLAGS = @BUILD_IN_TREE_FLAGS@
     375BUILD_IN_TREE_FLAGS_NOLIB = @BUILD_IN_TREE_FLAGS_NOLIB@
    374376CC = @CC@
    375377CCAS = @CCAS@
     
    377379CCASFLAGS = @CCASFLAGS@
    378380CCDEPMODE = @CCDEPMODE@
     381CFACC = @CFACC@
     382CFACPP = @CFACPP@
    379383CFA_BACKEND_CC = @CFA_BACKEND_CC@
    380384CFA_BINDIR = @CFA_BINDIR@
     
    393397DEFS = @DEFS@
    394398DEPDIR = @DEPDIR@
     399DRIVER_DIR = @DRIVER_DIR@
    395400ECHO_C = @ECHO_C@
    396401ECHO_N = @ECHO_N@
     
    544549
    545550# put into lib for now
    546 cfa_cpplibdir = ${CFA_LIBDIR}
    547 driver_cfa_cpp_SOURCES = ${SRC}
     551cfa_cpplibdir = $(CFA_LIBDIR)
     552driver_cfa_cpp_SOURCES = $(SRC)
    548553driver_cfa_cpp_LDADD = -ldl                     # yywrap
    549 driver_cfa_cpp_CXXFLAGS = -Wno-deprecated -Wall -Wextra -DDEBUG_ALL -I./Parser -I${abs_top_srcdir}/src/Parser -I${abs_top_srcdir}/src/include -DYY_NO_INPUT -O2 -g -std=c++14
     554driver_cfa_cpp_CXXFLAGS = -Wno-deprecated -Wall -Wextra -DDEBUG_ALL -I./Parser -I$(srcdir)/Parser -I$(srcdir)/include -DYY_NO_INPUT -O2 -g -std=c++14
    550555driver_cfa_cpp_LDFLAGS = -Xlinker -export-dynamic
    551556all: $(BUILT_SOURCES)
  • src/benchmark/Makefile.am

    r04e367c r3537dd7  
    1818CFLAGS =
    1919AM_CFLAGS = \
    20         -XCFA \
    21         -t \
    22         -B${abs_top_builddir}/src/driver \
    2320        -g \
    2421        -O2 \
     
    2724        -quiet \
    2825        -I$(srcdir) \
    29         -L${abs_top_builddir}/src/libcfa \
    30         -I${abs_top_srcdir}/src/libcfa \
    31         -I${abs_top_srcdir}/src/libcfa/containers \
    32         -I${abs_top_srcdir}/src/libcfa/concurrency \
    33         -I${abs_top_srcdir}/src/libcfa/stdhdr
    34 
    35 CC = ${top_builddir}/src/driver/cfa
     26        @BUILD_IN_TREE_FLAGS@
     27
     28CC = @CFACC@
    3629TOOLSDIR = ${abs_top_srcdir}/tools/
    3730REPEAT   = ${TOOLSDIR}repeat
  • src/benchmark/Makefile.in

    r04e367c r3537dd7  
    135135AWK = @AWK@
    136136BACKEND_CC = @BACKEND_CC@
    137 CC = ${top_builddir}/src/driver/cfa
     137BUILD_IN_TREE_FLAGS = @BUILD_IN_TREE_FLAGS@
     138BUILD_IN_TREE_FLAGS_NOLIB = @BUILD_IN_TREE_FLAGS_NOLIB@
     139CC = @CFACC@
    138140CCAS = @CCAS@
    139141CCASDEPMODE = @CCASDEPMODE@
    140142CCASFLAGS = @CCASFLAGS@
    141143CCDEPMODE = @CCDEPMODE@
     144CFACC = @CFACC@
     145CFACPP = @CFACPP@
    142146CFA_BACKEND_CC = @CFA_BACKEND_CC@
    143147CFA_BINDIR = @CFA_BINDIR@
     
    158162DEFS = @DEFS@
    159163DEPDIR = @DEPDIR@
     164DRIVER_DIR = @DRIVER_DIR@
    160165ECHO_C = @ECHO_C@
    161166ECHO_N = @ECHO_N@
     
    248253top_srcdir = @top_srcdir@
    249254AM_CFLAGS = \
    250         -XCFA \
    251         -t \
    252         -B${abs_top_builddir}/src/driver \
    253255        -g \
    254256        -O2 \
     
    257259        -quiet \
    258260        -I$(srcdir) \
    259         -L${abs_top_builddir}/src/libcfa \
    260         -I${abs_top_srcdir}/src/libcfa \
    261         -I${abs_top_srcdir}/src/libcfa/containers \
    262         -I${abs_top_srcdir}/src/libcfa/concurrency \
    263         -I${abs_top_srcdir}/src/libcfa/stdhdr
     261        @BUILD_IN_TREE_FLAGS@
    264262
    265263TOOLSDIR = ${abs_top_srcdir}/tools/
  • src/driver/Makefile.am

    r04e367c r3537dd7  
    1111## Created On       : Sun May 31 08:49:31 2015
    1212## Last Modified By : Peter A. Buhr
    13 ## Last Modified On : Mon Apr 30 17:44:17 2018
    14 ## Update Count     : 11
     13## Last Modified On : Thu Aug  2 12:18:25 2018
     14## Update Count     : 14
    1515###############################################################################
    1616
     
    4848cc1_SOURCES = cc1.cc
    4949
     50aslibdir = ${CFA_LIBDIR}
     51aslib_PROGRAMS = as
     52as_SOURCES = as.cc
     53
    5054MAINTAINERCLEANFILES = $(CFA_BINDIR)/$(CFA_NAME) @CFA_PREFIX@/lib/${cc1lib_PROGRAMS}
  • src/driver/Makefile.in

    r04e367c r3537dd7  
    9797noinst_PROGRAMS = cfa$(EXEEXT)
    9898cc1lib_PROGRAMS = cc1$(EXEEXT)
     99aslib_PROGRAMS = as$(EXEEXT)
    99100subdir = src/driver
    100101ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
     
    107108CONFIG_CLEAN_FILES =
    108109CONFIG_CLEAN_VPATH_FILES =
    109 am__installdirs = "$(DESTDIR)$(cc1libdir)"
    110 PROGRAMS = $(cc1lib_PROGRAMS) $(noinst_PROGRAMS)
     110am__installdirs = "$(DESTDIR)$(aslibdir)" "$(DESTDIR)$(cc1libdir)"
     111PROGRAMS = $(aslib_PROGRAMS) $(cc1lib_PROGRAMS) $(noinst_PROGRAMS)
     112am_as_OBJECTS = as.$(OBJEXT)
     113as_OBJECTS = $(am_as_OBJECTS)
     114as_LDADD = $(LDADD)
    111115am_cc1_OBJECTS = cc1.$(OBJEXT)
    112116cc1_OBJECTS = $(am_cc1_OBJECTS)
     
    144148am__v_CXXLD_0 = @echo "  CXXLD   " $@;
    145149am__v_CXXLD_1 =
    146 SOURCES = $(cc1_SOURCES) $(cfa_SOURCES)
    147 DIST_SOURCES = $(cc1_SOURCES) $(cfa_SOURCES)
     150SOURCES = $(as_SOURCES) $(cc1_SOURCES) $(cfa_SOURCES)
     151DIST_SOURCES = $(as_SOURCES) $(cc1_SOURCES) $(cfa_SOURCES)
    148152am__can_run_installinfo = \
    149153  case $$AM_UPDATE_INFO_DIR in \
     
    181185AWK = @AWK@
    182186BACKEND_CC = @BACKEND_CC@
     187BUILD_IN_TREE_FLAGS = @BUILD_IN_TREE_FLAGS@
     188BUILD_IN_TREE_FLAGS_NOLIB = @BUILD_IN_TREE_FLAGS_NOLIB@
    183189CC = @CC@
    184190CCAS = @CCAS@
     
    186192CCASFLAGS = @CCASFLAGS@
    187193CCDEPMODE = @CCDEPMODE@
     194CFACC = @CFACC@
     195CFACPP = @CFACPP@
    188196CFA_BACKEND_CC = @CFA_BACKEND_CC@
    189197CFA_BINDIR = @CFA_BINDIR@
     
    202210DEFS = @DEFS@
    203211DEPDIR = @DEPDIR@
     212DRIVER_DIR = @DRIVER_DIR@
    204213ECHO_C = @ECHO_C@
    205214ECHO_N = @ECHO_N@
     
    300309cc1libdir = ${CFA_LIBDIR}
    301310cc1_SOURCES = cc1.cc
     311aslibdir = ${CFA_LIBDIR}
     312as_SOURCES = as.cc
    302313MAINTAINERCLEANFILES = $(CFA_BINDIR)/$(CFA_NAME) @CFA_PREFIX@/lib/${cc1lib_PROGRAMS}
    303314all: all-am
     
    334345        cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
    335346$(am__aclocal_m4_deps):
     347install-aslibPROGRAMS: $(aslib_PROGRAMS)
     348        @$(NORMAL_INSTALL)
     349        @list='$(aslib_PROGRAMS)'; test -n "$(aslibdir)" || list=; \
     350        if test -n "$$list"; then \
     351          echo " $(MKDIR_P) '$(DESTDIR)$(aslibdir)'"; \
     352          $(MKDIR_P) "$(DESTDIR)$(aslibdir)" || exit 1; \
     353        fi; \
     354        for p in $$list; do echo "$$p $$p"; done | \
     355        sed 's/$(EXEEXT)$$//' | \
     356        while read p p1; do if test -f $$p \
     357          ; then echo "$$p"; echo "$$p"; else :; fi; \
     358        done | \
     359        sed -e 'p;s,.*/,,;n;h' \
     360            -e 's|.*|.|' \
     361            -e 'p;x;s,.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/' | \
     362        sed 'N;N;N;s,\n, ,g' | \
     363        $(AWK) 'BEGIN { files["."] = ""; dirs["."] = 1 } \
     364          { d=$$3; if (dirs[d] != 1) { print "d", d; dirs[d] = 1 } \
     365            if ($$2 == $$4) files[d] = files[d] " " $$1; \
     366            else { print "f", $$3 "/" $$4, $$1; } } \
     367          END { for (d in files) print "f", d, files[d] }' | \
     368        while read type dir files; do \
     369            if test "$$dir" = .; then dir=; else dir=/$$dir; fi; \
     370            test -z "$$files" || { \
     371              echo " $(INSTALL_PROGRAM_ENV) $(INSTALL_PROGRAM) $$files '$(DESTDIR)$(aslibdir)$$dir'"; \
     372              $(INSTALL_PROGRAM_ENV) $(INSTALL_PROGRAM) $$files "$(DESTDIR)$(aslibdir)$$dir" || exit $$?; \
     373            } \
     374        ; done
     375
     376uninstall-aslibPROGRAMS:
     377        @$(NORMAL_UNINSTALL)
     378        @list='$(aslib_PROGRAMS)'; test -n "$(aslibdir)" || list=; \
     379        files=`for p in $$list; do echo "$$p"; done | \
     380          sed -e 'h;s,^.*/,,;s/$(EXEEXT)$$//;$(transform)' \
     381              -e 's/$$/$(EXEEXT)/' \
     382        `; \
     383        test -n "$$list" || exit 0; \
     384        echo " ( cd '$(DESTDIR)$(aslibdir)' && rm -f" $$files ")"; \
     385        cd "$(DESTDIR)$(aslibdir)" && rm -f $$files
     386
     387clean-aslibPROGRAMS:
     388        -test -z "$(aslib_PROGRAMS)" || rm -f $(aslib_PROGRAMS)
    336389install-cc1libPROGRAMS: $(cc1lib_PROGRAMS)
    337390        @$(NORMAL_INSTALL)
     
    380433        -test -z "$(noinst_PROGRAMS)" || rm -f $(noinst_PROGRAMS)
    381434
     435as$(EXEEXT): $(as_OBJECTS) $(as_DEPENDENCIES) $(EXTRA_as_DEPENDENCIES)
     436        @rm -f as$(EXEEXT)
     437        $(AM_V_CXXLD)$(CXXLINK) $(as_OBJECTS) $(as_LDADD) $(LIBS)
     438
    382439cc1$(EXEEXT): $(cc1_OBJECTS) $(cc1_DEPENDENCIES) $(EXTRA_cc1_DEPENDENCIES)
    383440        @rm -f cc1$(EXEEXT)
     
    394451        -rm -f *.tab.c
    395452
     453@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/as.Po@am__quote@
    396454@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cc1.Po@am__quote@
    397455@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cfa.Po@am__quote@
     
    499557all-am: Makefile $(PROGRAMS)
    500558installdirs:
    501         for dir in "$(DESTDIR)$(cc1libdir)"; do \
     559        for dir in "$(DESTDIR)$(aslibdir)" "$(DESTDIR)$(cc1libdir)"; do \
    502560          test -z "$$dir" || $(MKDIR_P) "$$dir"; \
    503561        done
     
    535593clean: clean-am
    536594
    537 clean-am: clean-cc1libPROGRAMS clean-generic clean-noinstPROGRAMS \
    538         mostlyclean-am
     595clean-am: clean-aslibPROGRAMS clean-cc1libPROGRAMS clean-generic \
     596        clean-noinstPROGRAMS mostlyclean-am
    539597
    540598distclean: distclean-am
     
    556614info-am:
    557615
    558 install-data-am: install-cc1libPROGRAMS
     616install-data-am: install-aslibPROGRAMS install-cc1libPROGRAMS
    559617
    560618install-dvi: install-dvi-am
     
    602660ps-am:
    603661
    604 uninstall-am: uninstall-cc1libPROGRAMS
     662uninstall-am: uninstall-aslibPROGRAMS uninstall-cc1libPROGRAMS
    605663        @$(NORMAL_INSTALL)
    606664        $(MAKE) $(AM_MAKEFLAGS) uninstall-hook
     
    608666
    609667.PHONY: CTAGS GTAGS TAGS all all-am check check-am clean \
    610         clean-cc1libPROGRAMS clean-generic clean-noinstPROGRAMS \
    611         cscopelist-am ctags ctags-am distclean distclean-compile \
    612         distclean-generic distclean-tags distdir dvi dvi-am html \
    613         html-am info info-am install install-am install-cc1libPROGRAMS \
    614         install-data install-data-am install-dvi install-dvi-am \
    615         install-exec install-exec-am install-exec-hook install-html \
    616         install-html-am install-info install-info-am install-man \
    617         install-pdf install-pdf-am install-ps install-ps-am \
    618         install-strip installcheck installcheck-am installdirs \
    619         maintainer-clean maintainer-clean-generic mostlyclean \
    620         mostlyclean-compile mostlyclean-generic pdf pdf-am ps ps-am \
    621         tags tags-am uninstall uninstall-am uninstall-cc1libPROGRAMS \
     668        clean-aslibPROGRAMS clean-cc1libPROGRAMS clean-generic \
     669        clean-noinstPROGRAMS cscopelist-am ctags ctags-am distclean \
     670        distclean-compile distclean-generic distclean-tags distdir dvi \
     671        dvi-am html html-am info info-am install install-am \
     672        install-aslibPROGRAMS install-cc1libPROGRAMS install-data \
     673        install-data-am install-dvi install-dvi-am install-exec \
     674        install-exec-am install-exec-hook install-html install-html-am \
     675        install-info install-info-am install-man install-pdf \
     676        install-pdf-am install-ps install-ps-am install-strip \
     677        installcheck installcheck-am installdirs maintainer-clean \
     678        maintainer-clean-generic mostlyclean mostlyclean-compile \
     679        mostlyclean-generic pdf pdf-am ps ps-am tags tags-am uninstall \
     680        uninstall-am uninstall-aslibPROGRAMS uninstall-cc1libPROGRAMS \
    622681        uninstall-hook
    623682
  • src/examples/Makefile.am

    r04e367c r3537dd7  
    2525avl_test_SOURCES = avltree/avl_test.c avltree/avl0.c avltree/avl1.c avltree/avl2.c avltree/avl3.c avltree/avl4.c avltree/avl-private.c
    2626
    27 Bench : Bench.c
     27Bench$(EXEEXT) : Bench.c
    2828        @for ccflags in "-debug" "-nodebug"; do \
    2929                echo ${CC} ${AM_CFLAGS} ${CFLAGS} $${ccflags} -lrt Bench.c;\
  • src/examples/Makefile.in

    r04e367c r3537dd7  
    189189AWK = @AWK@
    190190BACKEND_CC = @BACKEND_CC@
     191BUILD_IN_TREE_FLAGS = @BUILD_IN_TREE_FLAGS@
     192BUILD_IN_TREE_FLAGS_NOLIB = @BUILD_IN_TREE_FLAGS_NOLIB@
    191193CC = @CFA_BINDIR@/@CFA_NAME@
    192194CCAS = @CCAS@
     
    194196CCASFLAGS = @CCASFLAGS@
    195197CCDEPMODE = @CCDEPMODE@
     198CFACC = @CFACC@
     199CFACPP = @CFACPP@
    196200CFA_BACKEND_CC = @CFA_BACKEND_CC@
    197201CFA_BINDIR = @CFA_BINDIR@
     
    212216DEFS = @DEFS@
    213217DEPDIR = @DEPDIR@
     218DRIVER_DIR = @DRIVER_DIR@
    214219ECHO_C = @ECHO_C@
    215220ECHO_N = @ECHO_N@
     
    615620
    616621
    617 Bench : Bench.c
     622Bench$(EXEEXT) : Bench.c
    618623        @for ccflags in "-debug" "-nodebug"; do \
    619624                echo ${CC} ${AM_CFLAGS} ${CFLAGS} $${ccflags} -lrt Bench.c;\
  • src/libcfa/Makefile.am

    r04e367c r3537dd7  
    4343#use -no-include-stdhdr to prevent rebuild cycles
    4444#The built sources must not depend on the installed headers
    45 CFLAGS = -quiet -no-include-stdhdr -I${abs_top_srcdir}/src/libcfa/stdhdr -XCFA -t -B${abs_top_builddir}/src/driver ${EXTRA_FLAGS}
    46 CC = ${abs_top_builddir}/src/driver/cfa
     45CFLAGS = -quiet -no-include-stdhdr @BUILD_IN_TREE_FLAGS@ ${EXTRA_FLAGS}
     46CC = @CFACC@
    4747
    4848headers = fstream iostream iterator limits rational time stdlib common \
     
    9292        ${AM_V_CC}@BACKEND_CC@ -DHAVE_CONFIG_H -I. -I../.. -D__CFA_DEBUG__ -O0 ${EXTRA_FLAGS} -c -o $@ $<
    9393
    94 ${libobjs} : ${abs_top_srcdir}/src/driver/cfa-cpp ${cfalib_DATA} # add dependency to cfa-cpp so all libraries are rebuilt with new translator
     94${libobjs} : @CFACPP@ ${cfalib_DATA} # add dependency to cfa-cpp so all libraries are rebuilt with new translator
    9595
    9696libcfa_a_SOURCES = ${libsrc}
  • src/libcfa/Makefile.in

    r04e367c r3537dd7  
    303303AWK = @AWK@
    304304BACKEND_CC = @BACKEND_CC@
    305 CC = ${abs_top_builddir}/src/driver/cfa
     305BUILD_IN_TREE_FLAGS = @BUILD_IN_TREE_FLAGS@
     306BUILD_IN_TREE_FLAGS_NOLIB = @BUILD_IN_TREE_FLAGS_NOLIB@
     307CC = @CFACC@
    306308CCAS = @CCAS@
    307309CCASDEPMODE = @CCASDEPMODE@
    308310CCASFLAGS = @CCASFLAGS@
    309311CCDEPMODE = @CCDEPMODE@
     312CFACC = @CFACC@
     313CFACPP = @CFACPP@
    310314CFA_BACKEND_CC = @CFA_BACKEND_CC@
    311315CFA_BINDIR = @CFA_BINDIR@
     
    319323#use -no-include-stdhdr to prevent rebuild cycles
    320324#The built sources must not depend on the installed headers
    321 CFLAGS = -quiet -no-include-stdhdr -I${abs_top_srcdir}/src/libcfa/stdhdr -XCFA -t -B${abs_top_builddir}/src/driver ${EXTRA_FLAGS}
     325CFLAGS = -quiet -no-include-stdhdr @BUILD_IN_TREE_FLAGS@ ${EXTRA_FLAGS}
    322326CPP = @CPP@
    323327CPPFLAGS = @CPPFLAGS@
     
    328332DEFS = @DEFS@
    329333DEPDIR = @DEPDIR@
     334DRIVER_DIR = @DRIVER_DIR@
    330335ECHO_C = @ECHO_C@
    331336ECHO_N = @ECHO_N@
     
    17041709        ${AM_V_CC}@BACKEND_CC@ -DHAVE_CONFIG_H -I. -I../.. -D__CFA_DEBUG__ -O0 ${EXTRA_FLAGS} -c -o $@ $<
    17051710
    1706 ${libobjs} : ${abs_top_srcdir}/src/driver/cfa-cpp ${cfalib_DATA} # add dependency to cfa-cpp so all libraries are rebuilt with new translator
     1711${libobjs} : @CFACPP@ ${cfalib_DATA} # add dependency to cfa-cpp so all libraries are rebuilt with new translator
    17071712
    17081713maintainer-clean-local:
  • src/libcfa/heap.c

    r04e367c r3537dd7  
    1010// Created On       : Tue Dec 19 21:58:35 2017
    1111// Last Modified By : Peter A. Buhr
    12 // Last Modified On : Thu Jul 26 22:28:23 2018
    13 // Update Count     : 449
     12// Last Modified On : Tue Jul 31 18:08:50 2018
     13// Update Count     : 470
    1414//
    1515
     
    9494
    9595
    96 // static _Bool prtHeapTerm = false;
    97 
    98 // inline _Bool prtHeapTerm() {
    99 //      return prtHeapTerm;
    100 // } // prtHeapTerm
    101 
    102 // _Bool prtHeapTermOn() {
    103 //      _Bool temp = traceHeap;
    104 //      traceHeap = true;
     96static _Bool checkFree = false;
     97
     98inline _Bool checkFree() {
     99        return checkFree;
     100} // checkFree
     101
     102_Bool checkFreeOn() {
     103        _Bool temp = checkFree;
     104        checkFree = true;
     105        return temp;
     106} // checkFreeOn
     107
     108_Bool checkFreeOff() {
     109        _Bool temp = checkFree;
     110        checkFree = false;
     111        return temp;
     112} // checkFreeOff
     113
     114
     115// static _Bool traceHeapTerm = false;
     116
     117// inline _Bool traceHeapTerm() {
     118//      return traceHeapTerm;
     119// } // traceHeapTerm
     120
     121// _Bool traceHeapTermOn() {
     122//      _Bool temp = traceHeapTerm;
     123//      traceHeapTerm = true;
    105124//      return temp;
    106 // } // prtHeapTermOn
    107 
    108 // _Bool prtHeapTermOff() {
    109 //      _Bool temp = traceHeap;
    110 //      traceHeap = false;
     125// } // traceHeapTermOn
     126
     127// _Bool traceHeapTermOff() {
     128//      _Bool temp = traceHeapTerm;
     129//      traceHeapTerm = false;
    111130//      return temp;
    112 // } // prtHeapTermOff
     131// } // traceHeapTermOff
    113132
    114133
     
    139158} // extern "C"
    140159#endif // __CFA_DEBUG__
    141 
    142 
    143 // statically allocated variables => zero filled.
    144 
    145 static size_t pageSize;                                                                 // architecture pagesize
    146 static size_t heapExpand;                                                               // sbrk advance
    147 static size_t mmapStart;                                                                // cross over point for mmap
    148 static unsigned int maxBucketsUsed;                                             // maximum number of buckets in use
    149 static unsigned int bucketSizes[NoBucketSizes] = {              // different bucket sizes
    150     16, 32, 48, 64,
    151     80, 96, 112, 128, 144, 160, 192, 224,
    152     256, 320, 384, 448, 512, 640, 768, 896,
    153     1024, 1536, 2048, 2560, 3072, 3584, 4096, 6144,
    154     8192, 9216, 10240, 11264, 12288, 13312, 14336, 15360,
    155     16384, 18432, 20480, 22528, 24576, 26624, 28672, 30720,
    156     32768, 36864, 40960, 45056, 49152, 53248, 57344, 61440,
    157     65536, 73728, 81920, 90112, 98304, 106496, 114688, 122880,
    158     131072, 147456, 163840, 180224, 196608, 212992, 229376, 245760,
    159     262144, 294912, 327680, 360448, 393216, 425984, 458752, 491520,
    160     524288, 655360, 786432, 917504, 1048576, 1179648, 1310720, 1441792,
    161     1572864, 1703936, 1835008, 1966080, 2097152, 2621440, 3145728, 3670016,
    162     4194304
    163 };
    164 #ifdef FASTLOOKUP
    165 static unsigned char lookup[LookupSizes];                               // O(1) lookup for small sizes
    166 #endif // FASTLOOKUP
    167 static int mmapFd = -1;                                                                 // fake or actual fd for anonymous file
    168160
    169161
     
    240232}; // HeapManager
    241233
     234static inline size_t getKey( const HeapManager.FreeHeader & freeheader ) { return freeheader.blockSize; }
     235// statically allocated variables => zero filled.
     236
     237
     238static size_t pageSize;                                                                 // architecture pagesize
     239static size_t heapExpand;                                                               // sbrk advance
     240static size_t mmapStart;                                                                // cross over point for mmap
     241static unsigned int maxBucketsUsed;                                             // maximum number of buckets in use
     242
     243// Powers of 2 are common allocation sizes, so make powers of 2 generate the minimum required size.
     244static unsigned int bucketSizes[NoBucketSizes] @= {             // different bucket sizes
     245    16, 32, 48, 64,
     246    64 + sizeof(HeapManager.Storage), 96, 112, 128, 128 + sizeof(HeapManager.Storage), 160, 192, 224,
     247    256 + sizeof(HeapManager.Storage), 320, 384, 448, 512 + sizeof(HeapManager.Storage), 640, 768, 896,
     248    1_024 + sizeof(HeapManager.Storage), 1_536, 2_048 + sizeof(HeapManager.Storage), 2_560, 3_072, 3_584, 4_096 + sizeof(HeapManager.Storage), 6_144,
     249    8_192 + sizeof(HeapManager.Storage), 9_216, 10_240, 11_264, 12_288, 13_312, 14_336, 15_360,
     250    16_384 + sizeof(HeapManager.Storage), 18_432, 20_480, 22_528, 24_576, 26_624, 28_672, 30_720,
     251    32_768 + sizeof(HeapManager.Storage), 36_864, 40_960, 45_056, 49_152, 53_248, 57_344, 61_440,
     252    65_536 + sizeof(HeapManager.Storage), 73_728, 81_920, 90_112, 98_304, 106_496, 114_688, 122_880,
     253    131_072 + sizeof(HeapManager.Storage), 147_456, 163_840, 180_224, 196_608, 212_992, 229_376, 245_760,
     254    262_144 + sizeof(HeapManager.Storage), 294_912, 327_680, 360_448, 393_216, 425_984, 458_752, 491_520,
     255    524_288 + sizeof(HeapManager.Storage), 655_360, 786_432, 917_504, 1_048_576 + sizeof(HeapManager.Storage), 1_179_648, 1_310_720, 1_441_792,
     256    1_572_864, 1_703_936, 1_835_008, 1_966_080, 2_097_152 + sizeof(HeapManager.Storage), 2_621_440, 3_145_728, 3_670_016,
     257    4_194_304 + sizeof(HeapManager.Storage)
     258};
     259#ifdef FASTLOOKUP
     260static unsigned char lookup[LookupSizes];                               // O(1) lookup for small sizes
     261#endif // FASTLOOKUP
     262static int mmapFd = -1;                                                                 // fake or actual fd for anonymous file
     263
     264
     265#ifdef __CFA_DEBUG__
     266static _Bool heapBoot = 0;                                                              // detect recursion during boot
     267#endif // __CFA_DEBUG__
     268static HeapManager heapManager __attribute__(( aligned (128) )) @= {}; // size of cache line to prevent false sharing
     269
    242270
    243271static inline _Bool setMmapStart( size_t value ) {
     
    281309static void ^?{}( HeapManager & ) {
    282310        #ifdef __STATISTICS__
    283         // if ( prtHeapTerm() ) {
     311        // if ( traceHeapTerm() ) {
    284312        //      printStats();
    285         //      checkFree( heapManager, true );
     313        //      if ( checkfree() ) checkFree( heapManager, true );
    286314        // } // if
    287315        #endif // __STATISTICS__
    288316} // ~HeapManager
    289317
    290 
    291 #ifdef __CFA_DEBUG__
    292 static _Bool heapBoot = 0;                                                              // detect recursion during boot
    293 #endif // __CFA_DEBUG__
    294 static HeapManager heapManager __attribute__(( aligned (128) )) @= {}; // size of cache line to prevent false sharing
    295318
    296319static void memory_startup( void ) __attribute__(( constructor( STARTUP_PRIORITY_MEMORY ) ));
     
    312335        ^heapManager{};
    313336} // memory_shutdown
    314 
    315 static inline size_t getKey( const HeapManager.FreeHeader & freeheader ) { return freeheader.blockSize; }
    316337
    317338
     
    342363static void printStats() {
    343364    char helpText[512];
    344     int len = snprintf( helpText, 512,
    345                                                 "\nHeap statistics:\n"
    346                                                 "  malloc: calls %u / storage %llu\n"
    347                                                 "  calloc: calls %u / storage %llu\n"
    348                                                 "  memalign: calls %u / storage %llu\n"
    349                                                 "  cmemalign: calls %u / storage %llu\n"
    350                                                 "  realloc: calls %u / storage %llu\n"
    351                                                 "  free: calls %u / storage %llu\n"
    352                                                 "  mmap: calls %u / storage %llu\n"
    353                                                 "  munmap: calls %u / storage %llu\n"
    354                                                 "  sbrk: calls %u / storage %llu\n",
    355                                                 malloc_calls, malloc_storage,
    356                                                 calloc_calls, calloc_storage,
    357                                                 memalign_calls, memalign_storage,
    358                                                 cmemalign_calls, cmemalign_storage,
    359                                                 realloc_calls, realloc_storage,
    360                                                 free_calls, free_storage,
    361                                                 mmap_calls, mmap_storage,
    362                                                 munmap_calls, munmap_storage,
    363                                                 sbrk_calls, sbrk_storage
     365        __cfaabi_dbg_bits_print_buffer( helpText, 512,
     366                        "\nHeap statistics:\n"
     367                        "  malloc: calls %u / storage %llu\n"
     368                        "  calloc: calls %u / storage %llu\n"
     369                        "  memalign: calls %u / storage %llu\n"
     370                        "  cmemalign: calls %u / storage %llu\n"
     371                        "  realloc: calls %u / storage %llu\n"
     372                        "  free: calls %u / storage %llu\n"
     373                        "  mmap: calls %u / storage %llu\n"
     374                        "  munmap: calls %u / storage %llu\n"
     375                        "  sbrk: calls %u / storage %llu\n",
     376                        malloc_calls, malloc_storage,
     377                        calloc_calls, calloc_storage,
     378                        memalign_calls, memalign_storage,
     379                        cmemalign_calls, cmemalign_storage,
     380                        realloc_calls, realloc_storage,
     381                        free_calls, free_storage,
     382                        mmap_calls, mmap_storage,
     383                        munmap_calls, munmap_storage,
     384                        sbrk_calls, sbrk_storage
    364385                );
    365     write( statfd, helpText, len );
    366386} // printStats
    367387
     
    637657
    638658
    639 size_t checkFree( HeapManager & manager, _Bool prt ) with ( manager ) {
     659size_t checkFree( HeapManager & manager ) with ( manager ) {
    640660    size_t total = 0;
    641661        #ifdef __STATISTICS__
    642662    __cfaabi_dbg_bits_acquire();
    643     if ( prt ) __cfaabi_dbg_bits_print_nolock( "\nBin lists (bin size : free blocks on list)\n" );
     663    __cfaabi_dbg_bits_print_nolock( "\nBin lists (bin size : free blocks on list)\n" );
    644664        #endif // __STATISTICS__
    645665    for ( unsigned int i = 0; i < maxBucketsUsed; i += 1 ) {
     
    659679            } // for
    660680                #ifdef __STATISTICS__
    661             if ( prt ) __cfaabi_dbg_bits_print_nolock( "%7zu, %-7u  ", size, N );
     681            __cfaabi_dbg_bits_print_nolock( "%7zu, %-7u  ", size, N );
    662682            if ( (i + 1) % 8 == 0 ) __cfaabi_dbg_bits_print_nolock( "\n" );
    663683                #endif // __STATISTICS__
    664684        } // for
    665685        #ifdef __STATISTICS__
    666         if ( prt ) __cfaabi_dbg_bits_print_nolock( "\ntotal free blocks:%zu\n", total );
     686        __cfaabi_dbg_bits_print_nolock( "\ntotal free blocks:%zu\n", total );
    667687        __cfaabi_dbg_bits_release();
    668688        #endif // __STATISTICS__
     
    922942                #ifdef __STATISTICS__
    923943                printStats();
    924                 checkFree( heapManager, true );
     944                if ( checkFree() ) checkFree( heapManager );
    925945                #endif // __STATISTICS__
    926946    } // malloc_stats
  • src/libcfa/stdhdr/malloc.h

    r04e367c r3537dd7  
    1010// Created On       : Thu Jul 20 15:58:16 2017
    1111// Last Modified By : Peter A. Buhr
    12 // Last Modified On : Mon Jul 23 18:20:32 2018
    13 // Update Count     : 8
     12// Last Modified On : Tue Jul 31 10:01:10 2018
     13// Update Count     : 9
    1414//
    1515
     
    1717size_t default_mmap_start();                                                    // CFA extras
    1818size_t default_heap_expansion();
     19
     20_Bool traceHeap();
     21_Bool traceHeapOn();
     22_Bool traceHeapOff();
     23
     24_Bool traceHeapTerm();
     25_Bool traceHeapTermOn();
     26_Bool traceHeapTermOff();
     27
     28_Bool checkFree();
     29_Bool checkFreeOn();
     30_Bool checkFreeOff();
     31
    1932extern "C" {
    2033size_t malloc_alignment( void * );
  • src/prelude/Makefile.am

    r04e367c r3537dd7  
    2323noinst_DATA = ../libcfa/libcfa-prelude.c
    2424
    25 CC = ${abs_top_builddir}/src/driver/cfa
     25CC = @CFACC@
    2626
    2727$(DEPDIR) :
     
    5858include $(DEPDIR)/builtins.Po
    5959
    60 ../libcfa/libcfa-prelude.c : prelude.cf extras.cf gcc-builtins.cf builtins.cf ${abs_top_builddir}/src/driver/cfa-cpp
    61         ${AM_V_GEN}${abs_top_builddir}/src/driver/cfa-cpp -l prelude.cf $@  # use src/cfa-cpp as not in lib until after install
     60../libcfa/libcfa-prelude.c : prelude.cf extras.cf gcc-builtins.cf builtins.cf @CFACPP@
     61        ${AM_V_GEN}@CFACPP@ -l prelude.cf $@  # use src/cfa-cpp as not in lib until after install
    6262
    63 bootloader.c : ${srcdir}/bootloader.cf prelude.cf extras.cf gcc-builtins.cf builtins.cf ${abs_top_builddir}/src/driver/cfa-cpp
    64         ${AM_V_GEN}${abs_top_builddir}/src/driver/cfa-cpp -tpm ${srcdir}/bootloader.cf $@  # use src/cfa-cpp as not in lib until after install
     63bootloader.c : ${srcdir}/bootloader.cf prelude.cf extras.cf gcc-builtins.cf builtins.cf @CFACPP@
     64        ${AM_V_GEN}@CFACPP@ -tpm ${srcdir}/bootloader.cf $@  # use src/cfa-cpp as not in lib until after install
    6565
    6666maintainer-clean-local :
  • src/prelude/Makefile.in

    r04e367c r3537dd7  
    162162AWK = @AWK@
    163163BACKEND_CC = @BACKEND_CC@
    164 CC = ${abs_top_builddir}/src/driver/cfa
     164BUILD_IN_TREE_FLAGS = @BUILD_IN_TREE_FLAGS@
     165BUILD_IN_TREE_FLAGS_NOLIB = @BUILD_IN_TREE_FLAGS_NOLIB@
     166CC = @CFACC@
    165167CCAS = @CCAS@
    166168CCASDEPMODE = @CCASDEPMODE@
    167169CCASFLAGS = @CCASFLAGS@
    168170CCDEPMODE = @CCDEPMODE@
     171CFACC = @CFACC@
     172CFACPP = @CFACPP@
    169173CFA_BACKEND_CC = @CFA_BACKEND_CC@
    170174CFA_BINDIR = @CFA_BINDIR@
     
    183187DEFS = @DEFS@
    184188DEPDIR = @DEPDIR@
     189DRIVER_DIR = @DRIVER_DIR@
    185190ECHO_C = @ECHO_C@
    186191ECHO_N = @ECHO_N@
     
    526531include $(DEPDIR)/builtins.Po
    527532
    528 ../libcfa/libcfa-prelude.c : prelude.cf extras.cf gcc-builtins.cf builtins.cf ${abs_top_builddir}/src/driver/cfa-cpp
    529         ${AM_V_GEN}${abs_top_builddir}/src/driver/cfa-cpp -l prelude.cf $@  # use src/cfa-cpp as not in lib until after install
    530 
    531 bootloader.c : ${srcdir}/bootloader.cf prelude.cf extras.cf gcc-builtins.cf builtins.cf ${abs_top_builddir}/src/driver/cfa-cpp
    532         ${AM_V_GEN}${abs_top_builddir}/src/driver/cfa-cpp -tpm ${srcdir}/bootloader.cf $@  # use src/cfa-cpp as not in lib until after install
     533../libcfa/libcfa-prelude.c : prelude.cf extras.cf gcc-builtins.cf builtins.cf @CFACPP@
     534        ${AM_V_GEN}@CFACPP@ -l prelude.cf $@  # use src/cfa-cpp as not in lib until after install
     535
     536bootloader.c : ${srcdir}/bootloader.cf prelude.cf extras.cf gcc-builtins.cf builtins.cf @CFACPP@
     537        ${AM_V_GEN}@CFACPP@ -tpm ${srcdir}/bootloader.cf $@  # use src/cfa-cpp as not in lib until after install
    533538
    534539maintainer-clean-local :
  • src/tests/Makefile.am

    r04e367c r3537dd7  
    3030# applies to both programs
    3131AM_CFLAGS = $(if $(test), 2> $(test), ) \
    32         -XCFA \
    33         -t \
    34         -B${abs_top_builddir}/src/driver \
    3532        -g \
    3633        -Wall \
    3734        -Wno-unused-function \
    3835        -quiet @CFA_FLAGS@ \
    39         -I. \
    4036        -DIN_DIR="${srcdir}/.in/" \
    41         -L${abs_top_builddir}/src/libcfa \
    42         -I${abs_top_srcdir}/src/libcfa \
    43         -I${abs_top_srcdir}/src/libcfa/containers \
    44         -I${abs_top_srcdir}/src/libcfa/concurrency \
    45         -I${abs_top_srcdir}/src/libcfa/stdhdr
     37        @BUILD_IN_TREE_FLAGS@
    4638
    4739if !BUILD_DEBUG
     
    5547endif
    5648
    57 CC = ${abs_top_builddir}/src/driver/cfa
     49CC = @CFACC@
    5850
    5951.PHONY : list
     
    9385# implicit rule so not all test require a rule
    9486% : %.c $(CC)
    95         echo $(headers_deps)
    9687        $(COMPILE) $(abspath ${<}) -o ${@}
    9788
  • src/tests/Makefile.in

    r04e367c r3537dd7  
    181181AWK = @AWK@
    182182BACKEND_CC = @BACKEND_CC@
    183 CC = ${abs_top_builddir}/src/driver/cfa
     183BUILD_IN_TREE_FLAGS = @BUILD_IN_TREE_FLAGS@
     184BUILD_IN_TREE_FLAGS_NOLIB = @BUILD_IN_TREE_FLAGS_NOLIB@
     185CC = @CFACC@
    184186CCAS = @CCAS@
    185187CCASDEPMODE = @CCASDEPMODE@
    186188CCASFLAGS = @CCASFLAGS@
    187189CCDEPMODE = @CCDEPMODE@
     190CFACC = @CFACC@
     191CFACPP = @CFACPP@
    188192CFA_BACKEND_CC = @CFA_BACKEND_CC@
    189193CFA_BINDIR = @CFA_BINDIR@
     
    202206DEFS = @DEFS@
    203207DEPDIR = @DEPDIR@
     208DRIVER_DIR = @DRIVER_DIR@
    204209ECHO_C = @ECHO_C@
    205210ECHO_N = @ECHO_N@
     
    298303
    299304# applies to both programs
    300 AM_CFLAGS = $(if $(test), 2> $(test), ) -XCFA -t \
    301         -B${abs_top_builddir}/src/driver -g -Wall -Wno-unused-function \
    302         -quiet @CFA_FLAGS@ -I. -DIN_DIR="${srcdir}/.in/" \
    303         -L${abs_top_builddir}/src/libcfa \
    304         -I${abs_top_srcdir}/src/libcfa \
    305         -I${abs_top_srcdir}/src/libcfa/containers \
    306         -I${abs_top_srcdir}/src/libcfa/concurrency \
    307         -I${abs_top_srcdir}/src/libcfa/stdhdr $(am__append_1) \
    308         $(am__append_2) $(am__append_3)
     305AM_CFLAGS = $(if $(test), 2> $(test), ) -g -Wall -Wno-unused-function \
     306        -quiet @CFA_FLAGS@ -DIN_DIR="${srcdir}/.in/" \
     307        @BUILD_IN_TREE_FLAGS@ $(am__append_1) $(am__append_2) \
     308        $(am__append_3)
    309309fstream_test_SOURCES = fstream_test.c
    310310avl_test_SOURCES = avltree/avl_test.c avltree/avl0.c avltree/avl1.c avltree/avl2.c avltree/avl3.c avltree/avl4.c avltree/avl-private.c
     
    641641# implicit rule so not all test require a rule
    642642% : %.c $(CC)
    643         echo $(headers_deps)
    644643        $(COMPILE) $(abspath ${<}) -o ${@}
    645644
  • src/tests/preempt_longrun/Makefile.am

    r04e367c r3537dd7  
    3232BUILD_FLAGS = -g -Wall -Wno-unused-function -quiet @CFA_FLAGS@ -O2 -DPREEMPTION_RATE=${preempt} -I.. -I. -DTEST_$(shell cat .type | tr a-z A-Z)
    3333CFLAGS = ${BUILD_FLAGS}
    34 CC = ${top_builddir}/src/driver/cfa
     34CC = @CFACC@
    3535
    3636TESTS = block coroutine create disjoint enter enter3 processor stack wait yield
  • src/tests/preempt_longrun/Makefile.in

    r04e367c r3537dd7  
    337337AWK = @AWK@
    338338BACKEND_CC = @BACKEND_CC@
    339 CC = ${top_builddir}/src/driver/cfa
     339BUILD_IN_TREE_FLAGS = @BUILD_IN_TREE_FLAGS@
     340BUILD_IN_TREE_FLAGS_NOLIB = @BUILD_IN_TREE_FLAGS_NOLIB@
     341CC = @CFACC@
    340342CCAS = @CCAS@
    341343CCASDEPMODE = @CCASDEPMODE@
    342344CCASFLAGS = @CCASFLAGS@
    343345CCDEPMODE = @CCDEPMODE@
     346CFACC = @CFACC@
     347CFACPP = @CFACPP@
    344348CFA_BACKEND_CC = @CFA_BACKEND_CC@
    345349CFA_BINDIR = @CFA_BINDIR@
     
    358362DEFS = @DEFS@
    359363DEPDIR = @DEPDIR@
     364DRIVER_DIR = @DRIVER_DIR@
    360365ECHO_C = @ECHO_C@
    361366ECHO_N = @ECHO_N@
  • src/tests/pybin/tools.py

    r04e367c r3537dd7  
    4848                return False
    4949
    50         return match.group(1) == "ASCII text"
     50        return match.group(1).startswith("ASCII text")
    5151
    5252# Remove 1 or more files silently
  • tools/Makefile.in

    r04e367c r3537dd7  
    186186AWK = @AWK@
    187187BACKEND_CC = @BACKEND_CC@
     188BUILD_IN_TREE_FLAGS = @BUILD_IN_TREE_FLAGS@
     189BUILD_IN_TREE_FLAGS_NOLIB = @BUILD_IN_TREE_FLAGS_NOLIB@
    188190CC = @BACKEND_CC@
    189191CCAS = @CCAS@
     
    191193CCASFLAGS = @CCASFLAGS@
    192194CCDEPMODE = @CCDEPMODE@
     195CFACC = @CFACC@
     196CFACPP = @CFACPP@
    193197CFA_BACKEND_CC = @CFA_BACKEND_CC@
    194198CFA_BINDIR = @CFA_BINDIR@
     
    207211DEFS = @DEFS@
    208212DEPDIR = @DEPDIR@
     213DRIVER_DIR = @DRIVER_DIR@
    209214ECHO_C = @ECHO_C@
    210215ECHO_N = @ECHO_N@
  • tools/prettyprinter/Makefile.in

    r04e367c r3537dd7  
    210210AWK = @AWK@
    211211BACKEND_CC = @BACKEND_CC@
     212BUILD_IN_TREE_FLAGS = @BUILD_IN_TREE_FLAGS@
     213BUILD_IN_TREE_FLAGS_NOLIB = @BUILD_IN_TREE_FLAGS_NOLIB@
    212214CC = @CC@
    213215CCAS = @CCAS@
     
    215217CCASFLAGS = @CCASFLAGS@
    216218CCDEPMODE = @CCDEPMODE@
     219CFACC = @CFACC@
     220CFACPP = @CFACPP@
    217221CFA_BACKEND_CC = @CFA_BACKEND_CC@
    218222CFA_BINDIR = @CFA_BINDIR@
     
    231235DEFS = @DEFS@
    232236DEPDIR = @DEPDIR@
     237DRIVER_DIR = @DRIVER_DIR@
    233238ECHO_C = @ECHO_C@
    234239ECHO_N = @ECHO_N@
Note: See TracChangeset for help on using the changeset viewer.