Changes in / [341bb80:6d44da1]
- Files:
-
- 113 added
- 95 deleted
- 65 edited
Legend:
- Unmodified
- Added
- Removed
-
.gitignore
r341bb80 r6d44da1 38 38 libcfa/prelude/gcc-builtins.cf 39 39 libcfa/prelude/gcc-builtins.c 40 libcfa/prelude/prelude.cf 40 libcfa/prelude/prelude.cfa 41 41 libcfa/x64-debug/ 42 42 libcfa/x64-nodebug/ … … 56 56 src/Parser/parser.h 57 57 src/Parser/parser.hh 58 src/demangler 58 59 59 60 tools/prettyprinter/parser.output -
Jenkinsfile
r341bb80 r6d44da1 128 128 //Run the tests from the tests directory 129 129 if ( Settings.RunAllTests ) { 130 sh 'make --no-print-directory -C tests all-tests debug=yes'131 sh 'make --no-print-directory -C tests all-tests debug=no '130 sh 'make --no-print-directory -C tests timeouts="--timeout=600" all-tests debug=yes' 131 sh 'make --no-print-directory -C tests timeouts="--timeout=600" all-tests debug=no ' 132 132 } 133 133 else { -
automake/cfa.m4
r341bb80 r6d44da1 57 57 58 58 AC_DEFUN([M4CFA_CANNON_CPU], [ 59 case $ arch_namein59 case $1 in 60 60 "host") arch_name=${host_cpu};; 61 *) ;;61 *) arch_name=$1;; 62 62 esac 63 63 -
benchmark/Makefile.am
r341bb80 r6d44da1 33 33 TIME_FORMAT = "%E" 34 34 PRINT_FORMAT = %20s: #Comments needed for spacing 35 36 LIBFIBRE_DIR ?= /home/tdelisle/software/KOS/src/37 35 38 36 .NOTPARALLEL: … … 111 109 112 110 ## ========================================================================================================= 113 ctxswitch$(EXEEXT):\111 CTXSWITCH_DEPEND = \ 114 112 loop.run \ 115 113 function.run \ … … 121 119 ctxswitch-upp_coroutine.run \ 122 120 ctxswitch-upp_thread.run \ 123 -ctxswitch-kos_fibre.run \124 -ctxswitch-kos_fibre2.run \125 121 ctxswitch-goroutine.run \ 126 122 ctxswitch-java_thread.run 127 123 124 if WITH_LIBFIBRE 125 CTXSWITCH_DEPEND += \ 126 ctxswitch-kos_fibre.run \ 127 ctxswitch-kos_fibre2.run 128 129 130 ctxswitch-kos_fibre$(EXEEXT): 131 @$(CXXCOMPILE) -DBENCH_N=50000000 $(srcdir)/ctxswitch/kos_fibre.cpp -I$(LIBFIBRE_DIR) -lfibre 132 133 ctxswitch-kos_fibre2$(EXEEXT): 134 @$(CXXCOMPILE) -DBENCH_N=50000000 $(srcdir)/ctxswitch/kos_fibre2.cpp -I$(LIBFIBRE_DIR) -lfibre 135 endif 136 137 ctxswitch$(EXEEXT): $(CTXSWITCH_DEPEND) 138 128 139 ctxswitch-pthread$(EXEEXT): 129 140 @$(COMPILE) -DBENCH_N=50000000 $(srcdir)/ctxswitch/pthreads.c … … 143 154 ctxswitch-upp_thread$(EXEEXT): 144 155 @$(UPPCOMPILE) -DBENCH_N=50000000 $(srcdir)/ctxswitch/upp_thrd.cc 145 146 ctxswitch-kos_fibre$(EXEEXT):147 @$(CXXCOMPILE) -DBENCH_N=50000000 $(srcdir)/ctxswitch/kos_fibre.cpp -I$(LIBFIBRE_DIR) -lfibre148 149 ctxswitch-kos_fibre2$(EXEEXT):150 @$(CXXCOMPILE) -DBENCH_N=50000000 $(srcdir)/ctxswitch/kos_fibre2.cpp -I$(LIBFIBRE_DIR) -lfibre151 156 152 157 ctxswitch-goroutine$(EXEEXT): -
benchmark/Makefile.in
r341bb80 r6d44da1 93 93 host_triplet = @host@ 94 94 noinst_PROGRAMS = 95 @WITH_LIBFIBRE_TRUE@am__append_1 = \ 96 @WITH_LIBFIBRE_TRUE@ ctxswitch-kos_fibre.run \ 97 @WITH_LIBFIBRE_TRUE@ ctxswitch-kos_fibre2.run 98 95 99 subdir = benchmark 96 100 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 … … 278 282 TIME_FORMAT = "%E" 279 283 PRINT_FORMAT = %20s: #Comments needed for spacing 284 CTXSWITCH_DEPEND = loop.run function.run fetch_add.run \ 285 ctxswitch-pthread.run ctxswitch-cfa_coroutine.run \ 286 ctxswitch-cfa_thread.run ctxswitch-cfa_thread2.run \ 287 ctxswitch-upp_coroutine.run ctxswitch-upp_thread.run \ 288 ctxswitch-goroutine.run ctxswitch-java_thread.run \ 289 $(am__append_1) 280 290 testdir = $(top_srcdir)/tests 281 291 all: all-am … … 470 480 471 481 472 .cfa.o: $(CFACC) $(CFACPP)482 .cfa.o: 473 483 $(AM_V_CFA)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.o$$||'`;\ 474 484 $(CFACOMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\ 475 485 $(am__mv) $$depbase.Tpo $$depbase.Po 476 486 487 <<<<<<< HEAD 477 488 .cfa.lo: 478 489 $(AM_V_CFA)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.lo$$||'`;\ … … 482 493 LIBFIBRE_DIR ?= /home/tdelisle/software/KOS/src/ 483 494 495 ======= 496 >>>>>>> master 484 497 .NOTPARALLEL: 485 498 … … 551 564 $(COMPILE) -DBENCH_N=500000000 fetch_add.c 552 565 553 ctxswitch$(EXEEXT): \ 554 loop.run \ 555 function.run \ 556 fetch_add.run \ 557 ctxswitch-pthread.run \ 558 ctxswitch-cfa_coroutine.run \ 559 ctxswitch-cfa_thread.run \ 560 ctxswitch-cfa_thread2.run \ 561 ctxswitch-upp_coroutine.run \ 562 ctxswitch-upp_thread.run \ 563 -ctxswitch-kos_fibre.run \ 564 -ctxswitch-kos_fibre2.run \ 565 ctxswitch-goroutine.run \ 566 ctxswitch-java_thread.run 566 @WITH_LIBFIBRE_TRUE@ctxswitch-kos_fibre$(EXEEXT): 567 @WITH_LIBFIBRE_TRUE@ @$(CXXCOMPILE) -DBENCH_N=50000000 $(srcdir)/ctxswitch/kos_fibre.cpp -I$(LIBFIBRE_DIR) -lfibre 568 569 @WITH_LIBFIBRE_TRUE@ctxswitch-kos_fibre2$(EXEEXT): 570 @WITH_LIBFIBRE_TRUE@ @$(CXXCOMPILE) -DBENCH_N=50000000 $(srcdir)/ctxswitch/kos_fibre2.cpp -I$(LIBFIBRE_DIR) -lfibre 571 572 ctxswitch$(EXEEXT): $(CTXSWITCH_DEPEND) 567 573 568 574 ctxswitch-pthread$(EXEEXT): … … 583 589 ctxswitch-upp_thread$(EXEEXT): 584 590 @$(UPPCOMPILE) -DBENCH_N=50000000 $(srcdir)/ctxswitch/upp_thrd.cc 585 586 ctxswitch-kos_fibre$(EXEEXT):587 @$(CXXCOMPILE) -DBENCH_N=50000000 $(srcdir)/ctxswitch/kos_fibre.cpp -I$(LIBFIBRE_DIR) -lfibre588 589 ctxswitch-kos_fibre2$(EXEEXT):590 @$(CXXCOMPILE) -DBENCH_N=50000000 $(srcdir)/ctxswitch/kos_fibre2.cpp -I$(LIBFIBRE_DIR) -lfibre591 591 592 592 ctxswitch-goroutine$(EXEEXT): -
configure
r341bb80 r6d44da1 630 630 GREP 631 631 CPP 632 WITH_LIBFIBRE_FALSE 633 WITH_LIBFIBRE_TRUE 632 634 RANLIB 633 635 LEXLIB … … 2528 2530 2529 2531 2532 2530 2533 # don't use the default CFLAGS as they unconditonnaly add -O2 2531 2534 : ${CFLAGS=""} … … 3459 3462 3460 3463 3461 case $ arch_namein3464 case ${arch_name} in 3462 3465 "host") arch_name=${host_cpu};; 3463 *) ;;3466 *) arch_name=${arch_name};; 3464 3467 esac 3465 3468 … … 3498 3501 3499 3502 3500 case $ arch_namein3503 case ${host_cpu} in 3501 3504 "host") arch_name=${host_cpu};; 3502 *) ;;3505 *) arch_name=${host_cpu};; 3503 3506 esac 3504 3507 … … 5438 5441 5439 5442 # Checks for libraries. 5443 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for Fibre::yield in -lfibre" >&5 5444 $as_echo_n "checking for Fibre::yield in -lfibre... " >&6; } 5445 if ${ac_cv_lib_fibre_Fibre__yield+:} false; then : 5446 $as_echo_n "(cached) " >&6 5447 else 5448 ac_check_lib_save_LIBS=$LIBS 5449 LIBS="-lfibre $LIBS" 5450 cat confdefs.h - <<_ACEOF >conftest.$ac_ext 5451 /* end confdefs.h. */ 5452 5453 /* Override any GCC internal prototype to avoid an error. 5454 Use char because int might match the return type of a GCC 5455 builtin and then its argument prototype would still apply. */ 5456 #ifdef __cplusplus 5457 extern "C" 5458 #endif 5459 char Fibre::yield (); 5460 int 5461 main () 5462 { 5463 return Fibre::yield (); 5464 ; 5465 return 0; 5466 } 5467 _ACEOF 5468 if ac_fn_c_try_link "$LINENO"; then : 5469 ac_cv_lib_fibre_Fibre__yield=yes 5470 else 5471 ac_cv_lib_fibre_Fibre__yield=no 5472 fi 5473 rm -f core conftest.err conftest.$ac_objext \ 5474 conftest$ac_exeext conftest.$ac_ext 5475 LIBS=$ac_check_lib_save_LIBS 5476 fi 5477 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_fibre_Fibre__yield" >&5 5478 $as_echo "$ac_cv_lib_fibre_Fibre__yield" >&6; } 5479 if test "x$ac_cv_lib_fibre_Fibre__yield" = xyes; then : 5480 HAVE_LIBFIBRE=1 5481 else 5482 HAVE_LIBFIBRE=0 5483 fi 5484 5485 if test "$HAVE_LIBFIBRE" -eq 1; then 5486 WITH_LIBFIBRE_TRUE= 5487 WITH_LIBFIBRE_FALSE='#' 5488 else 5489 WITH_LIBFIBRE_TRUE='#' 5490 WITH_LIBFIBRE_FALSE= 5491 fi 5492 5440 5493 5441 5494 # Checks for header files. … … 6477 6530 if test -z "${am__fastdepCCAS_TRUE}" && test -z "${am__fastdepCCAS_FALSE}"; then 6478 6531 as_fn_error $? "conditional \"am__fastdepCCAS\" was never defined. 6532 Usually this means the macro was only invoked conditionally." "$LINENO" 5 6533 fi 6534 if test -z "${WITH_LIBFIBRE_TRUE}" && test -z "${WITH_LIBFIBRE_FALSE}"; then 6535 as_fn_error $? "conditional \"WITH_LIBFIBRE\" was never defined. 6479 6536 Usually this means the macro was only invoked conditionally." "$LINENO" 5 6480 6537 fi -
configure.ac
r341bb80 r6d44da1 204 204 205 205 # Checks for libraries. 206 AC_CHECK_LIB([fibre], [Fibre::yield], [HAVE_LIBFIBRE=1], [HAVE_LIBFIBRE=0]) 207 AM_CONDITIONAL([WITH_LIBFIBRE], [test "$HAVE_LIBFIBRE" -eq 1]) 206 208 207 209 # Checks for header files. -
doc/bibliography/pl.bib
r341bb80 r6d44da1 701 701 % B 702 702 703 @article{Michael13, 704 contributer = {pabuhr@plg}, 705 author = {Maged M. Michael}, 706 title = {The Balancing Act of Choosing Nonblocking Features}, 707 journal = cacm, 708 volume = 56, 709 number = 9, 710 month = sep, 711 year = 2013, 712 pages = {46--53}, 713 publisher = {ACM}, 714 address = {New York, NY, USA}, 715 } 716 703 717 @incollection{beta:old, 704 718 keywords = {beta, patterns, virtual types}, … … 908 922 909 923 @misc{Cforall, 924 contributer = {pabuhr@plg}, 910 925 key = {Cforall}, 911 title = {\textsf{C}{$\mathbf{\forall}$} Features},912 howpublished= {\ url{https://plg.uwaterloo.ca/~cforall/features}},926 author = {{\textsf{C}{$\mathbf{\forall}$} Features}}, 927 howpublished= {\href{https://plg.uwaterloo.ca/~cforall/features}{https://\-plg.uwaterloo.ca/\-~cforall/\-features}}, 913 928 optnote = {Accessed: 2018-01-01}, 914 929 } … … 926 941 927 942 @misc{CFAStackEvaluation, 943 contributer = {a3moss@plg}, 928 944 author = {Aaron Moss}, 929 945 title = {\textsf{C}$\mathbf{\forall}$ Stack Evaluation Programs}, 930 946 year = 2018, 931 howpublished= {\href{https://cforall.uwaterloo.ca/CFAStackEvaluation.zip}{ \textcolor{blue}{Q4: https://cforall.uwaterloo.ca/\-CFAStackEvaluation.zip}}},947 howpublished= {\href{https://cforall.uwaterloo.ca/CFAStackEvaluation.zip}{https://cforall.uwaterloo.ca/\-CFAStackEvaluation.zip}}, 932 948 optnote = {[Accessed May 2018]}, 933 949 } 934 950 935 951 @article{Moss18, 936 keywords = { concurrency, C++},952 keywords = {type systems, tuples, Cforall}, 937 953 contributer = {pabuhr@plg}, 938 954 author = {Aaron Moss and Robert Schluntz and Peter A. Buhr}, 939 955 title = {\textsf{C}$\mathbf{\forall}$ : Adding Modern Programming Language Features to C}, 940 956 year = 2018, 957 month = aug, 941 958 journal = spe, 942 note = { Accepted, to appear},959 note = {\href{http://dx.doi.org/10.1002/spe.2624}{http://\-dx.doi.org/\-10.1002/\-spe.2624}}, 943 960 } 944 961 … … 962 979 comment = { 963 980 The evidence given is thin. 964 } 981 }, 965 982 } 966 983 … … 1416 1433 } 1417 1434 1435 @misc{NThreadCode13, 1436 keywords = {N-thread software-solution mutual exclusion}, 1437 contributer = {pabuhr@plg}, 1438 key = {concurrent locking}, 1439 author = {Peter A. Buhr and David Dice and Wim H. Hesselink}, 1440 title = {concurrent-locking}, 1441 howpublished= {\href{https://github.com/pabuhr/concurrent-locking}{https://\-github.com/\-pabuhr/\-concurrent-locking}}, 1442 optnote = {[Accessed April 2017]}, 1443 } 1444 1418 1445 @incollection{Reppy93, 1419 1446 keywords = {ML, concurrency, continuation passing}, … … 1489 1516 month = dec, 1490 1517 year = 2017, 1491 note = {\href{http ://plg.uwaterloo.ca/~usystem/pub/uSystem/u++-7.0.0.sh}{http://\-plg.\-uwaterloo.\-ca/\-$\sim$usystem/\-pub/\-uSystem/\-u++-7.0.0.sh}},1518 note = {\href{https://plg.uwaterloo.ca/~usystem/pub/uSystem/uC++.pdf}{https://\-plg.uwaterloo.ca/\-~usystem/\-pub/\-uSystem/uC++.pdf}}, 1492 1519 } 1493 1520 … … 1556 1583 } 1557 1584 1585 @mastersthesis{Sun15, 1586 author = {Sun, Xianda}, 1587 title = {Concurrent High-performance Persistent Hash Table In {J}ava}, 1588 school = {School of Computer Science, University of Waterloo}, 1589 year = 2015, 1590 optaddress = {Waterloo, Ontario, Canada, N2L 3G1}, 1591 note = {\href{https://uwspace.uwaterloo.ca/handle/10012/10013}{https://\-uwspace.uwaterloo.ca/\-handle/\-10012/\-10013}}, 1592 } 1593 1558 1594 @book{Andrews91:book, 1559 1595 keywords = {concurrency}, … … 1580 1616 1581 1617 @mastersthesis{Delisle18, 1582 author = {Thierry Delisle }, 1618 keywords = {concurrency, Cforall}, 1619 contributer = {pabuhr@plg}, 1620 author = {Thierry Delisle}, 1583 1621 title = {Concurrency in \textsf{C}$\mathbf{\forall}$}, 1584 1622 school = {School of Computer Science, University of Waterloo}, 1585 1623 year = 2018, 1586 address = {Waterloo, Ontario, Canada, N2L 3G1},1624 optaddress = {Waterloo, Ontario, Canada, N2L 3G1}, 1587 1625 note = {\href{https://uwspace.uwaterloo.ca/handle/10012/12888}{https://\-uwspace.uwaterloo.ca/\-handle/\-10012/\-12888}}, 1626 } 1627 1628 @article{Delisle18b, 1629 keywords = {concurrency, Cforall}, 1630 contributer = {pabuhr@plg}, 1631 author = {Thierry Delisle and Peter A. Buhr}, 1632 title = {Concurrency in \textsf{C}$\mathbf{\forall}$}, 1633 year = 2018, 1634 journal = spe, 1635 pages = {1-32}, 1636 note = {submitted}, 1588 1637 } 1589 1638 … … 1827 1876 key = {Peter Buhr}, 1828 1877 title = {CS343}, 1829 year = 201 7,1878 year = 2018, 1830 1879 howpublished= {\href{https://www.student.cs.uwaterloo.ca/~cs343}{https://\-www.student.cs.uwaterloo.ca/\-~cs343}}, 1831 1880 } … … 2864 2913 keywords = {concurrency, mutual exclusion, performance experiment, software solutions}, 2865 2914 title = {Fast mutual exclusion by the {T}riangle algorithm}, 2866 author = {Wim H. Hesselink and Peter Buhr and David Dice},2915 author = {Wim H. Hesselink and Peter A. Buhr and David Dice}, 2867 2916 journal = ccpe, 2868 2917 volume = 30, … … 2871 2920 month = feb, 2872 2921 publisher = {John Wiley \& Sons}, 2873 note = {\ url{https://doi.org/10.1002/cpe.4183}}2922 note = {\href{https://doi.org/10.1002/cpe.4183}{https://\-doi.org/\-10.1002/\-cpe.4183}} 2874 2923 } 2875 2924 … … 3283 3332 edition = {{S}imon {M}arlow}, 3284 3333 year = 2010, 3285 note = {\href{https://haskell.org/definition/haskell2010.pdf}{https:// haskell.org/\-definition/\-haskell2010.pdf}},3334 note = {\href{https://haskell.org/definition/haskell2010.pdf}{https://\-haskell.org/\-definition/\-haskell2010.pdf}}, 3286 3335 } 3287 3336 … … 3357 3406 } 3358 3407 3359 @article{Hesselink17 ,3408 @article{Hesselink17b, 3360 3409 keywords = {concurrency, mutual exclusion, performance experiment, software solutions}, 3361 3410 title = {High-Contention Mutual Exclusion by Elevator Algorithms}, 3362 author = {Peter Buhr and David Dice and Wim H. Hesselink},3411 author = {Peter A. Buhr and David Dice and Wim H. Hesselink}, 3363 3412 journal = ccpe, 3364 volume opt= 30,3365 number opt = 4,3413 volume = 30, 3414 number = 18, 3366 3415 year = 2018, 3367 month = may,3416 month = sep, 3368 3417 publisher = {John Wiley \& Sons}, 3369 note = {\ url{https://doi-org.proxy.lib.uwaterloo.ca/10.1002/cpe.4475}}3418 note = {\href{https://doi-org.proxy.lib.uwaterloo.ca/10.1002/cpe.4475}{https://\-doi-org.proxy.lib.uwaterloo.ca/\-10.1002/\-cpe.4475}}, 3370 3419 } 3371 3420 … … 3846 3895 % K 3847 3896 3897 @inproceedings{Buhr96b, 3898 author = {Peter A. Buhr and Martin Karsten and Jun Shih}, 3899 title = {{\small\textsf{KDB}}: A Multi-threaded Debugger for Multi-threaded Applications}, 3900 booktitle = {Proceedings of SPDT'96: SIGMETRICS Symposium on Parallel and Distributed Tools}, 3901 publisher = {ACM Press}, 3902 address = {Philadelphia, Pennsylvania, U.S.A.}, 3903 month = may, 3904 year = 1996, 3905 pages = {80-87}, 3906 } 3907 3848 3908 @article{Duggan96, 3849 3909 keywords = {concurrency, critical section}, 3850 3910 contributer = {pabuhr@plg}, 3851 author = {Dominic Duggan and G .V. Cormack and John Ophel},3911 author = {Dominic Duggan and Gordon V. Cormack and John Ophel}, 3852 3912 title = {Kinded Type Inference for Parametric Overloading}, 3853 3913 journal = acta, … … 4533 4593 % N 4534 4594 4595 @techreport{Drepper03, 4596 keywords = {NPTL, threading, 1:1 model}, 4597 contributer = {pabuhr@plg}, 4598 author = {Ulrich Drepper and Ingo Molnar}, 4599 title = {The Native POSIX Thread Library for Linux}, 4600 institution = {Red Hat}, 4601 year = 2003, 4602 note = {\href{http://www.cs.utexas.edu/~witchel/372/lectures/POSIX_Linux_Threading.pdf}{http://www.cs.utexas.edu/\-$\sim$witchel/\-372/\-lectures/\-POSIX\_Linux\_Threading.pdf}}, 4603 } 4604 4535 4605 @article{Haddon77, 4536 4606 keywords = {monitors, nested monitor calls}, … … 4656 4726 volume = 9, 4657 4727 pages = {157-164}, 4728 } 4729 4730 @misc{nginx, 4731 key = {nginx}, 4732 author = {{NGINX}}, 4733 howpublished= {\href{https://www.nginx.com}{https://\-www.nginx.com}}, 4658 4734 } 4659 4735 … … 4768 4844 @misc{obj-c-book, 4769 4845 keywords = {objective-c}, 4770 contributor = { a3moss@uwaterloo.ca},4846 contributor = {pabuhr@plg}, 4771 4847 key = {Objective-C}, 4772 title= {Objective-C},4848 author = {Objective-C}, 4773 4849 publisher = {Apple Inc.}, 4774 year = 201 5,4775 howpublished= {\href{https://developer.apple.com/library/ content/documentation/General/Conceptual/DevPedia-CocoaCore/ObjectiveC.html}{https://developer.apple.com/\-library/\-content/\-documentation/\-General/\-Conceptual/\-DevPedia-\-CocoaCore/\-ObjectiveC.html}},4850 year = 2014, 4851 howpublished= {\href{https://developer.apple.com/library/archive/documentation/Cocoa/Conceptual/ProgrammingWithObjectiveC}{https://\-developer.apple.com/\-library/archive/\-documentation/\-Cocoa/\-Conceptual/\-ProgrammingWithObjectiveC}}, 4776 4852 optnote = {Accessed: 2018-03} 4777 4853 } … … 4783 4859 title = {{X}code 7 Release Notes}, 4784 4860 year = 2015, 4785 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}},4861 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}}, 4786 4862 optnote = {Accessed: 2017-04} 4787 4863 } … … 5283 5359 } 5284 5360 5361 @misc{perf, 5362 contributer = {pabuhr@plg}, 5363 key = {perf}, 5364 author = {perf}, 5365 howpublished= {\href{https://perf.wiki.kernel.org/index.php/Tutorial}{https://\-perf.wiki.kernel.org/\-index.php/\-Tutorial}}, 5366 } 5367 5368 @misc{Verch12, 5369 contributer = {pabuhr@plg}, 5370 author = {Shaun Verch}, 5371 title = {Performance Analysis of 64-Bit Capriccio}, 5372 month = may, 5373 year = 2012, 5374 howpublished= {\href{http://cs.brown.edu/research/pubs/theses/masters/2012/verch.pdf}{http://cs.brown.edu/\-research/\-pubs/\-theses/\-masters/\-2012/\-verch.pdf}}, 5375 optnote = {Accessed: 2013-10-4} 5376 } 5377 5285 5378 @article{Anderson90, 5286 5379 keywords = {spin locks, back off, performance}, … … 5503 5596 note = {Proceedings of the OOPSLA'89 Conference, Oct. 1--6, 1989, New Orleans, Lousiana}, 5504 5597 abstract = {}, 5598 } 5599 5600 @inproceedings{Buhr98, 5601 keywords = {profiling, monitoring, visualization}, 5602 contributer = {pabuhr@plg}, 5603 author = {Peter A. Buhr and Robert Denda}, 5604 title = {{$\mu$Profiler} : Profiling User-Level Threads in a Shared-Memory Programming Environment}, 5605 booktitle = {Proceedings of the Second International Symposium on Computing in Object-Oriented Parallel Environments (ISCOPE'98)}, 5606 series = {Lecture Notes in Computer Science}, 5607 publisher = {Springer-Verlag}, 5608 volume = 1505, 5609 opteditor = {Dennis Caromel and Rodney R. Oldehoeft and Marydell Tholburn}, 5610 address = {Santa Fe, New Mexico, U.S.A.}, 5611 month = dec, 5612 year = 1998, 5613 pages = {159-166}, 5505 5614 } 5506 5615 … … 5855 5964 keywords = {Cyclone, existential types, polymorphism, type variables}, 5856 5965 contributer = {a3moss@plg}, 5857 author = {D .Grossman},5966 author = {Dan Grossman}, 5858 5967 title = {Quantified Types in an Imperative Language}, 5859 5968 journal = toplas, … … 5964 6073 } 5965 6074 6075 @article{Ronsse03, 6076 keywords = {profiling, replay}, 6077 contributer = {pabuhr@plg}, 6078 author = {Michiel Ronsse and De Bosschere, Koen and Mark Christiaens and Jacques Chassin de Kergommeaux and Dieter Kranzlm\"{u}ller}, 6079 title = {Record/Replay for Nondeterministic Program Executions}, 6080 journal = cacm, 6081 month = sep, 6082 year = 2003, 6083 volume = 46, 6084 number = 9, 6085 pages = {62-67}, 6086 } 6087 5966 6088 @article{Robinson48, 5967 6089 keywords = {recursion, Ackermann function}, … … 6002 6124 } 6003 6125 6126 @mastersthesis{Schuster99, 6127 author = {Oliver Schuster}, 6128 title = {Replay of Concurrent Shared-Memory Programs}, 6129 school = {Universit\"at Mannheim}, 6130 address = {Mannheim, Deutschland}, 6131 year = 1999, 6132 month = apr, 6133 type = {Diplomarbeit}, 6134 note = {\href{ftp://plg.uwaterloo.ca/pub/theses/SchusterThesis.ps.gz}{ftp://\-plg.uwaterloo.ca/\-pub/\-theses/\-SchusterThesis.ps.gz}}, 6135 } 6136 6004 6137 @article{Euclid, 6005 6138 keywords = {Euclid}, … … 6033 6166 school = {School of Computer Science, University of Waterloo}, 6034 6167 year = 2017, 6035 address = {Waterloo, Ontario, Canada, N2L 3G1},6168 optaddress = {Waterloo, Ontario, Canada, N2L 3G1}, 6036 6169 note = {\href{https://uwspace.uwaterloo.ca/handle/10012/11830}{https://\-uwspace.uwaterloo.ca/\-handle/\-10012/\-11830}}, 6037 6170 } … … 6860 6993 contributer = {pabuhr@plg}, 6861 6994 key = {TIOBE Index}, 6862 title = {{TIOBE} Index},6995 author = {{TIOBE Index}}, 6863 6996 howpublished= {\href{http://www.tiobe.com/tiobe_index}{http://\-www.tiobe.com/\-tiobe\_index}}, 6864 6997 optnote = {Accessed: 2018-09}, … … 7000 7133 year = 1980 7001 7134 } 7135 7136 @misc{TraceCompass, 7137 contributer = {pabuhr@plg}, 7138 key = {Trace Compass}, 7139 author = {{T}race {C}ompass}, 7140 howpublished= {\href{https://projects.eclipse.org/proposals/trace-compass}{https://\-projects.eclipse.org/\-proposals/\-trace-compass}}, 7141 } 7002 7142 7003 7143 @article{Leroy00, … … 7135 7275 title = {Usability Challenges in Exception Handling}, 7136 7276 booktitle = {5th International Workshop on Exception Handling (WEH)}, 7137 o rganization= {16th International Symposium on the Foundations of Software Engineering (FSE 16)},7277 optorganization= {16th International Symposium on the Foundations of Software Engineering (FSE 16)}, 7138 7278 address = {Zurich, Switzerland}, 7139 7279 month = jun, … … 7279 7419 } 7280 7420 7421 @inproceedings{vonBehren03, 7422 keywords = {threads, events, web server}, 7423 contributer = {pabuhr@plg}, 7424 author = {Rob von Behren and Jeremy Condit and Eric Brewer}, 7425 title = {Why Events Are a Bad Idea (for high-concurrency servers)}, 7426 booktitle = {HotOS IX: The 9th Workshop on Hot Topics in Operating Systems}, 7427 publisher = {USENIX Association}, 7428 address = {Lihue, Hawaii, U.S.A.}, 7429 month = may, 7430 year = 2003, 7431 pages = {19-24}, 7432 } 7433 7281 7434 @techreport{Moss90, 7282 7435 keywords = {Swizzling, database}, … … 7343 7496 year = 1986, 7344 7497 editor = {Norman Meyrowitz}, 7345 publisher = sigplan # " 21(11)",7498 publisher = sigplan, 7346 7499 organization= {Association for Computing Machinery}, 7347 7500 address = {Portland, Oregon}, 7348 month = sep # { 29}7501 month = sep, 7349 7502 } 7350 7503 … … 7355 7508 year = 1987, 7356 7509 editor = {Norman Meyrowitz}, 7357 publisher = sigplan # " 22(12)",7510 publisher = sigplan, 7358 7511 organization= {Association for Computing Machinery}, 7359 7512 address = {Orlando, Florida}, 7360 month = oct # { 4--8}7513 month = oct, 7361 7514 } 7362 7515 … … 7367 7520 year = 1988, 7368 7521 editor = {Norman Meyrowitz}, 7369 publisher = sigplan # " 23(11)",7522 publisher = sigplan, 7370 7523 organization= {Association for Computing Machinery}, 7371 7524 address = {San Diego, California}, 7372 month = sep # { 25--30}7525 month = sep, 7373 7526 } 7374 7527 … … 7379 7532 year = 1989, 7380 7533 editor = {Norman Meyrowitz}, 7381 publisher = sigplan # " 24(10)",7534 publisher = sigplan, 7382 7535 organization= {Association for Computing Machinery}, 7383 7536 address = {New Orleans, Louisiana}, 7384 month = oct # { 1--6}7537 month = oct, 7385 7538 } 7386 7539 … … 7391 7544 year = 1990, 7392 7545 editor = {Norman Meyrowitz}, 7393 publisher = sigplan # " 25(10)",7546 publisher = sigplan, 7394 7547 organization= {Association for Computing Machinery}, 7395 7548 address = {Ottawa, Canada}, 7396 month = oct # { 21--25}7549 month = oct, 7397 7550 } 7398 7551 … … 7403 7556 year = 1991, 7404 7557 editor = {Andreas Paepcke}, 7405 publisher = sigplan # " 26(11)",7558 publisher = sigplan, 7406 7559 organization= {Association for Computing Machinery}, 7407 7560 address = {Phoenix, Arizona}, 7408 month = oct # { 6--11}7409 } 7561 month = oct, 7562 } -
doc/papers/general/Paper.tex
r341bb80 r6d44da1 196 196 \author[1]{Robert Schluntz} 197 197 \author[1]{Peter A. Buhr} 198 \author[]{\textcolor{blue}{Q1 AUTHOR NAMES CORRECT}}199 198 \authormark{MOSS \textsc{et al}} 200 199 … … 208 207 The 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. 209 208 This installation base and the programmers producing it represent a massive software engineering investment spanning decades and likely to continue for decades more. 210 Nevertheless, C, which was first standardized almost 30 \textcolor{blue}{CHANGE ``40'' TO ``30''}years ago, lacks many features that make programming in more modern languages safer and more productive.209 Nevertheless, C, which was first standardized almost 30 years ago, lacks many features that make programming in more modern languages safer and more productive. 211 210 The 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 backward compatibility with C and its programmers. 212 211 Prior projects have attempted similar goals but failed to honor the C programming style; … … 226 225 227 226 227 \vspace*{-10pt} 228 228 \section{Introduction} 229 229 230 230 The 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. 231 231 This installation base and the programmers producing it represent a massive software engineering investment spanning decades and likely to continue for decades more. 232 The TIOBE index~\cite{TIOBE} \textcolor{blue}{CHANGE ``TIOBE'' TO ``The TIOBE index''}ranks the top five most \emph{popular} programming languages as Java 15\%, \Textbf{C 12\%}, \Textbf{\CC 5.5\%}, and Python 5\%, \Csharp 4.5\% = 42\%, where the next 50 languages are less than 4\% each with a long tail.232 The TIOBE index~\cite{TIOBE} ranks the top five most \emph{popular} programming languages as Java 15\%, \Textbf{C 12\%}, \Textbf{\CC 5.5\%}, and Python 5\%, \Csharp 4.5\% = 42\%, where the next 50 languages are less than 4\% each with a long tail. 233 233 The top three rankings over the past 30 years are as follows. 234 \newpage235 \textcolor{blue}{MOVE TABLE HERE}236 234 \begin{center} 237 235 \setlength{\tabcolsep}{10pt} … … 246 244 \lstMakeShortInline@% 247 245 \end{center} 248 249 246 Love it or hate it, C is extremely popular, highly used, and one of the few systems languages. 250 247 In many cases, \CC is often used solely as a better C. 251 Nevertheless, C, which was first standardized almost 30 \textcolor{blue}{CHANGE ``40'' TO ``30''}years ago~\cite{ANSI89:C}, lacks many features that make programming in more modern languages safer and more productive.248 Nevertheless, C, which was first standardized almost 30 years ago~\cite{ANSI89:C}, lacks many features that make programming in more modern languages safer and more productive. 252 249 253 250 \CFA (pronounced ``C for all'' and written \CFA or Cforall) is an evolutionary extension of the C programming language that adds modern language features to C, while maintaining source and runtime compatibility in the familiar C programming model. … … 281 278 ultimately, a compiler is necessary for advanced features and optimal performance. 282 279 % The translator design is based on the \emph{visitor pattern}, allowing multiple passes over the abstract code-tree, which works well for incrementally adding new feature through additional visitor passes. 283 Two key translator components are expression analysis, determining expression validity and what operations are required for its implementation, and code generation, dealing with multiple forms of overloading, polymorphism, and multiple return values by converting them into C code for a C compiler that supports none of these features.280 Two key translator components are expression analysis, determining expression validity and what operations are required for its implementation, and code generation, dealing with multiple forms of overloading, polymorphism, and multiple return values by converting them into the C code for a C compiler that supports none of these features. 284 281 Details of these components are available in chapters 2 and 3 in the work of Bilson~\cite{Bilson03} and form the base for the current \CFA translator. 285 282 % @plg2[8]% cd cfa-cc/src; cloc libcfa … … 345 342 Section~\ref{sec:libraries} includes a number of examples of how this overloading simplifies \CFA programming relative to C. 346 343 Code generation for these overloaded functions and variables is implemented by the usual approach of mangling the identifier names to include a representation of their type, while \CFA decides which overload to apply based on the same ``usual arithmetic conversions'' used in C to disambiguate operator overloads. 347 \textcolor{blue}{REMOVE ``We have the following as an example''} 344 348 345 \newpage 349 \textcolor{blue}{UPDATE FOLLOWING PROGRAM EXAMPLE WITH ADJUSTED COMMENTS TO FIT PAGE WIDTH.}350 346 \begin{cfa} 351 347 int max = 2147483647; $\C[4in]{// (1)}$ … … 362 358 In some cases, hundreds of names can be reduced to tens, resulting in a significant cognitive reduction. 363 359 In the above, the name @max@ has a consistent meaning, and a programmer only needs to remember the single concept: maximum. 364 To prevent significant ambiguities, \CFA uses the return type in selecting overloads, \eg in the assignment to @m@, the compiler use @m@'s type to unambiguously select the most appropriate call to function @max@ (as does Ada).360 To prevent significant ambiguities, \CFA uses the return type in selecting overloads, \eg in the assignment to @m@, the compiler uses @m@'s type to unambiguously select the most appropriate call to function @max@ (as does Ada). 365 361 As is shown later, there are a number of situations where \CFA takes advantage of available type information to disambiguate, where other programming languages generate ambiguities. 366 362 … … 380 376 \label{sec:poly-fns} 381 377 382 The signature feature of \CFA is parametric-polymorphic functions~\cite{forceone:impl,Cormack90,Duggan96} with functions generalized using a @forall@ clause (giving the language its name). \textcolor{blue}{REMOVE ``as follows''}378 The signature feature of \CFA is parametric-polymorphic functions~\cite{forceone:impl,Cormack90,Duggan96} with functions generalized using a @forall@ clause (giving the language its name). 383 379 \begin{cfa} 384 380 `forall( otype T )` T identity( T val ) { return val; } … … 395 391 396 392 Since bare polymorphic types provide a restricted set of available operations, \CFA provides a \newterm{type assertion}~\cite[pp.~37-44]{Alphard} mechanism to provide further type information, where type assertions may be variable or function declarations that depend on a polymorphic type variable. 397 For example, the function @twice@ can be defined using the \CFA syntax for operator overloading. \textcolor{blue}{REMOVE ``as follows''}393 For example, the function @twice@ can be defined using the \CFA syntax for operator overloading. 398 394 \begin{cfa} 399 395 forall( otype T `| { T ?+?(T, T); }` ) T twice( T x ) { return x `+` x; } $\C{// ? denotes operands}$ … … 409 405 Crucial to the design of a new programming language are the libraries to access thousands of external software features. 410 406 Like \CC, \CFA inherits a massive compatible library base, where other programming languages must rewrite or provide fragile interlanguage communication with C. 411 A simple example is leveraging the existing type-unsafe (@void *@) C @bsearch@ to binary search a sorted float array. \textcolor{blue}{REMOVE ``as follows''}407 A simple example is leveraging the existing type-unsafe (@void *@) C @bsearch@ to binary search a sorted float array. 412 408 \begin{cfa} 413 409 void * bsearch( const void * key, const void * base, size_t nmemb, size_t size, … … 605 601 To enable interoperation among equivalent instantiations of a generic type, the translator saves the set of instantiations currently in scope and reuses the generated structure declarations where appropriate. 606 602 A function declaration that accepts or returns a concrete generic type produces a declaration for the instantiated structure in the same scope, which all callers may reuse. 607 For example, the concrete instantiation for @pair( const char *, int )@ is \textcolor{blue}{REMOVE ``as follows.''}603 For example, the concrete instantiation for @pair( const char *, int )@ is 608 604 \begin{cfa} 609 605 struct _pair_conc0 { … … 634 630 If a dynamic generic type is declared to be passed or returned by value from a polymorphic function, the translator can safely assume that the generic type is complete (\ie has a known layout) at any call site, and the offset array is passed from the caller; 635 631 if the generic type is concrete at the call site, the elements of this offset array can even be statically generated using the C @offsetof@ macro. 636 As an example, the body of the second @value@ function is implemented as \textcolor{blue}{REMOVE ``follows.''}632 As an example, the body of the second @value@ function is implemented as 637 633 \begin{cfa} 638 634 _assign_T( _retval, p + _offsetof_pair[1] ); $\C{// return *p.second}$ … … 640 636 \newpage 641 637 \noindent 642 \textcolor{blue}{NO PARAGRAPH INDENT}Here, @_assign_T@ is passed in as an implicit parameter from @otype T@, and takes two @T *@ (@void *@ in the generated code), a destination and a source, and @_retval@ is the pointer to a caller-allocated buffer for the return value, the usual \CFA method to handle dynamically sized return types.638 Here, @_assign_T@ is passed in as an implicit parameter from @otype T@, and takes two @T *@ (@void *@ in the generated code), a destination and a source, and @_retval@ is the pointer to a caller-allocated buffer for the return value, the usual \CFA method to handle dynamically sized return types. 643 639 @_offsetof_pair@ is the offset array passed into @value@; 644 this array is generated at the call site as \textcolor{blue}{REMOVE ``follows.''}640 this array is generated at the call site as 645 641 \begin{cfa} 646 642 size_t _offsetof_pair[] = { offsetof( _pair_conc0, first ), offsetof( _pair_conc0, second ) } … … 677 673 678 674 Another useful pattern enabled by reused dtype-static type instantiations is zero-cost \newterm{tag structures}. 679 Sometimes, information is only used for type checking and can be omitted at runtime. \textcolor{blue}{REMOVE ``As an example, we have the following''}675 Sometimes, information is only used for type checking and can be omitted at runtime. 680 676 \begin{cquote} 681 677 \lstDeleteShortInline@% … … 724 720 Both approaches are awkward. 725 721 % FIX 726 Alternatively, a programming language can directly support returning multiple values, \eg \CFA provides the following. \textcolor{blue}{REPLACE ``in \CFA, we have the following'' WITH ``\CFA provides the following''}722 Alternatively, a programming language can directly support returning multiple values, \eg \CFA provides the following. 727 723 \begin{cfa} 728 724 [ int, int ] div( int num, int den ); $\C{// return two integers}$ … … 745 741 As such, \CFA allows assigning multiple values from a function into multiple variables, using a square-bracketed list of lvalue expressions (as above), called a \newterm{tuple}. 746 742 747 However, functions also use \newterm{composition} (nested calls), with the direct consequence that MRVFs must also support composition to be orthogonal with single-returning-value functions (SRVFs), \eg, \CFA provides the following. \textcolor{blue}{REPLACE ``As an example, we have the following'' WITH ``\CFA provides the following''}743 However, functions also use \newterm{composition} (nested calls), with the direct consequence that MRVFs must also support composition to be orthogonal with single-returning-value functions (SRVFs), \eg, \CFA provides the following. 748 744 \begin{cfa} 749 745 printf( "%d %d\n", div( 13, 5 ) ); $\C{// return values seperated into arguments}$ … … 781 777 printf( "%d %d\n", qr ); 782 778 \end{cfa} 783 \CFA also supports \newterm{tuple indexing} to access single components of a tuple expression. \textcolor{blue}{REMOVE ``as follows''}779 \CFA also supports \newterm{tuple indexing} to access single components of a tuple expression. 784 780 \begin{cfa} 785 781 [int, int] * p = &qr; $\C{// tuple pointer}$ … … 809 805 In the call to @f@, @x@ is implicitly flattened so the components of @x@ are passed as two arguments. 810 806 In the call to @g@, the values @y@ and @10@ are structured into a single argument of type @[int, int]@ to match the parameter type of @g@. 811 Finally, in the call to @h@, @x@ is flattened to yield an argument list of length 3, of which the first component of @x@ is passed as the first parameter of @h@, and the second component \textcolor{blue}{CHANGE ``components'' TO ``component''}of @x@ and @y@ are structured into the second argument of type @[int, int]@.812 The flexible structure of tuples permits a simple and expressive function call syntax to work seamlessly with both SRVFs and MRVFs \textcolor{blue}{REMOVE ``and''}with any number of arguments of arbitrarily complex structure.807 Finally, in the call to @h@, @x@ is flattened to yield an argument list of length 3, of which the first component of @x@ is passed as the first parameter of @h@, and the second component of @x@ and @y@ are structured into the second argument of type @[int, int]@. 808 The flexible structure of tuples permits a simple and expressive function call syntax to work seamlessly with both SRVFs and MRVFs with any number of arguments of arbitrarily complex structure. 813 809 814 810 815 811 \subsection{Tuple assignment} 816 812 813 \enlargethispage{-10pt} 817 814 An assignment where the left side is a tuple type is called \newterm{tuple assignment}. 818 815 There are two kinds of tuple assignment depending on whether the right side of the assignment operator has a tuple type or a nontuple type, called \newterm{multiple} and \newterm{mass assignment}, respectively. … … 828 825 Both kinds of tuple assignment have parallel semantics, so that each value on the left and right sides is evaluated before any assignments occur. 829 826 As a result, it is possible to swap the values in two variables without explicitly creating any temporary variables or calling a function, \eg, @[x, y] = [y, x]@. 830 This semantics means mass assignment differs from C cascading 831 \newpage 832 assignment (\eg @a = b = c@) in that conversions are applied in each individual assignment, which prevents data loss from the chain of conversions that can happen during a cascading assignment. 827 This semantics means mass assignment differs from C cascading assignment (\eg @a = b = c@) in that conversions are applied in each individual assignment, which prevents data loss from the chain of conversions that can happen during a cascading assignment. 833 828 For example, @[y, x] = 3.14@ performs the assignments @y = 3.14@ and @x = 3.14@, yielding @y == 3.14@ and @x == 3@, whereas C cascading assignment @y = x = 3.14@ performs the assignments @x = 3.14@ and @y = x@, yielding @3@ in @y@ and @x@. 834 829 Finally, tuple assignment is an expression where the result type is the type of the left-hand side of the assignment, just like all other assignment expressions in C. … … 857 852 [int, int, int] y = x.[2, 0, 2]; $\C{// duplicate: [y.0, y.1, y.2] = [x.2, x.0.x.2]}$ 858 853 \end{cfa} 859 It is also possible for a member access to contain other member accesses. \textcolor{blue}{REMOVE ``, as follows.''}854 It is also possible for a member access to contain other member accesses. 860 855 \begin{cfa} 861 856 struct A { double i; int j; }; … … 969 964 Since nothing is known about a parameter pack by default, assertion parameters are key to doing anything meaningful. 970 965 Unlike variadic templates, @ttype@ polymorphic functions can be separately compiled. 971 For example, the following is a \textcolor{blue}{CHANGE ``As an example, we have the following'' TO ``For example, the following is a''}generalized @sum@ function.966 For example, the following is a generalized @sum@ function. 972 967 \begin{cfa} 973 968 int sum$\(_0\)$() { return 0; } … … 1003 998 Unlike C variadic functions, it is unnecessary to hard code the number and expected types. 1004 999 Furthermore, this code is extendable for any user-defined type with a @?+?@ operator. 1005 Summing \textcolor{blue}{REMOVE ``up''}arbitrary heterogeneous lists is possible with similar code by adding the appropriate type variables and addition operators.1000 Summing arbitrary heterogeneous lists is possible with similar code by adding the appropriate type variables and addition operators. 1006 1001 1007 1002 It is also possible to write a type-safe variadic print function to replace @printf@: … … 1039 1034 Tuples are implemented in the \CFA translator via a transformation into \newterm{generic types}. 1040 1035 For each $N$, the first time an $N$-tuple is seen in a scope, a generic type with $N$ type parameters is generated. 1041 For example, the following \textcolor{blue}{CHANGE ``, as follows:'' TO ``For example, the following''}1036 For example, the following 1042 1037 \begin{cfa} 1043 1038 [int, int] f() { … … 1519 1514 \end{cfa} 1520 1515 1521 \textcolor{blue}{PARAGRAPH INDENT}Finally, \CFA provides a Java-like @finally@ clause after the catch clauses.1516 Finally, \CFA provides a Java-like @finally@ clause after the catch clauses. 1522 1517 \begin{cfa} 1523 1518 try { … … 1655 1650 1656 1651 C declaration syntax is notoriously confusing and error prone. 1657 For example, many C programmers are confused by a declaration as simple as the following. \textcolor{blue}{CHANGE ``simple a declaration as in'' TO ``declaration as simple as''}1652 For example, many C programmers are confused by a declaration as simple as the following. 1658 1653 \begin{cquote} 1659 1654 \lstDeleteShortInline@% … … 1709 1704 % Specifically, the character @*@ is used to indicate a pointer, square brackets @[@\,@]@ are used to represent an array or function return value, and parentheses @()@ are used to indicate a function parameter. 1710 1705 However, unlike C, \CFA type declaration tokens are distributed across all variables in the declaration list. 1711 For instance, variables @x@ and @y@ of type pointer to integer are defined in \CFA as \textcolor{blue}{REMOVE ``follows.''}1706 For instance, variables @x@ and @y@ of type pointer to integer are defined in \CFA as 1712 1707 \begin{cquote} 1713 1708 \lstDeleteShortInline@% … … 1959 1954 Since \CFA in not object oriented, adopting dynamic scoping does not make sense; 1960 1955 instead, \CFA adopts \CC static nesting, using the member-selection operator ``@.@'' for type qualification, as does Java, rather than the \CC type-selection operator ``@::@'' (see Figure~\ref{f:TypeNestingQualification}). 1956 In the C left example, types @C@, @U@ and @T@ are implicitly hoisted outside of type @S@ into the containing block scope. 1957 In the \CFA right example, the types are not hoisted and accessible. 1961 1958 1962 1959 \begin{figure} … … 2028 2025 \vspace*{-8pt} 2029 2026 \end{figure} 2030 2031 In the C left example, types @C@, @U@ and @T@ are implicitly hoisted outside of type @S@ into the containing block scope.2032 In the \CFA right example, the types are not hoisted and accessible.2033 2027 2034 2028 … … 2066 2060 For details of the code-generation placement of implicit constructor and destructor calls among complex executable statements, see section~2.2 in the work of Schlintz~\cite{Schluntz17}. 2067 2061 2068 \CFA also provides syntax for \newterm{initialization} and \newterm{copy}. \textcolor{blue}{REMOVE ``, as follows''}2062 \CFA also provides syntax for \newterm{initialization} and \newterm{copy}. 2069 2063 \begin{cfa} 2070 2064 void ?{}( VLA & vla, int size, char fill = '\0' ) { $\C{// initialization}$ … … 2131 2125 2132 2126 A simple example is allowing the underscore, as in Ada, to separate prefixes, digits, and suffixes in all \CFA constants, \eg @0x`_`1.ffff`_`ffff`_`p`_`128`_`l@, where the underscore is also the standard separator in C identifiers. 2133 \CC uses a single quote as a separator, but it is restricted among digits, precluding its use in the literal prefix or suffix, \eg @0x1.ffff@@`'@@ffffp128l@, and causes problems with most \textcolor{blue}{Q2 CHANGE ``IDEs'' TO ``integrated development environments (IDEs)''}, which must be extended to deal with this alternate use of the single quote.2127 \CC uses a single quote as a separator, but it is restricted among digits, precluding its use in the literal prefix or suffix, \eg @0x1.ffff@@`'@@ffffp128l@, and causes problems with most integrated development environments (IDEs), which must be extended to deal with this alternate use of the single quote. 2134 2128 2135 2129 … … 2203 2197 y = "12345678901234567890123456789"|`mp| + "12345678901234567890123456789"|`mp|; 2204 2198 \end{cfa} 2205 Because \CFA uses a standard function, all types and literals are applicable, as well as overloading and conversions, where @?`@ \textcolor{blue}{USE CHARACTER \lstinline@`@ NOT \textsf{'}} denotes a postfix-function name and @`@ \textcolor{blue}{USE CHARACTER \lstinline@`@ NOT `}denotes a postfix-function call.2199 Because \CFA uses a standard function, all types and literals are applicable, as well as overloading and conversions, where @?`@ denotes a postfix-function name and @`@ denotes a postfix-function call. 2206 2200 }% 2207 2201 \begin{cquote} … … 2345 2339 \lstMakeShortInline@% 2346 2340 \end{cquote} 2347 The result is a significant reduction in names to access typed constants. \textcolor{blue}{REMOVE ``, as follows.''}2341 The result is a significant reduction in names to access typed constants. 2348 2342 \begin{cquote} 2349 2343 \lstDeleteShortInline@% … … 2390 2384 \lstMakeShortInline@% 2391 2385 \end{cquote} 2392 The result is a significant reduction in names to access math functions. \textcolor{blue}{REMOVE ``, as follows.''}2386 The result is a significant reduction in names to access math functions. 2393 2387 \begin{cquote} 2394 2388 \lstDeleteShortInline@% … … 2437 2431 \lstMakeShortInline@% 2438 2432 \end{cquote} 2439 The result is a significant reduction in names to access the utility functions. \textcolor{blue}{REMOVE ``, as follows.''}2433 The result is a significant reduction in names to access the utility functions. 2440 2434 \begin{cquote} 2441 2435 \lstDeleteShortInline@% … … 2458 2452 In addition, there are polymorphic functions, like @min@ and @max@, that work on any type with operator @?<?@ or @?>?@. 2459 2453 2460 The following shows one example where \CFA \ textcolor{blue}{ADD SPACE} \emph{extends} an existing standard C interface to reduce complexity and provide safety.2454 The following shows one example where \CFA \emph{extends} an existing standard C interface to reduce complexity and provide safety. 2461 2455 C/\Celeven provide a number of complex and overlapping storage-management operations to support the following capabilities. 2462 2456 \begin{list}{}{\itemsep=0pt\parsep=0pt\labelwidth=0pt\leftmargin\parindent\itemindent-\leftmargin\let\makelabel\descriptionlabel} … … 2649 2643 \label{s:MultiPrecisionIntegers} 2650 2644 2651 \CFA has an interface to the \textcolor{blue}{Q3 CHANGE ``GMP multiprecision'' TO ``GNU multiple precision (GMP)''}signed integers~\cite{GMP}, similar to the \CC interface provided by GMP.2645 \CFA has an interface to the GNU multiple precision (GMP) signed integers~\cite{GMP}, similar to the \CC interface provided by GMP. 2652 2646 The \CFA interface wraps GMP functions into operator functions to make programming with multiprecision integers identical to using fixed-sized integers. 2653 2647 The \CFA type name for multiprecision signed integers is @Int@ and the header file is @gmp@. … … 2742 2736 Figure~\ref{fig:eval} and Table~\ref{tab:eval} show the results of running the benchmark in Figure~\ref{fig:BenchmarkTest} and its C, \CC, and \CCV equivalents. 2743 2737 The graph plots the median of five consecutive runs of each program, with an initial warm-up run omitted. 2744 All code is compiled at \texttt{-O2} by gcc or g++ 6.4.0, with all \CC code compiled as \CCfourteen. \textcolor{blue}{CHANGE ``\CC{}fourteen'' TO ``\CCfourteen''}2745 The benchmarks are run on an Ubuntu 16.04 workstation with 16 GB of RAM and a 6-core AMD FX-6300 CPU with 3.5 GHz \textcolor{blue}{REMOVE ``of''}maximum clock frequency.2738 All code is compiled at \texttt{-O2} by gcc or g++ 6.4.0, with all \CC code compiled as \CCfourteen. 2739 The benchmarks are run on an Ubuntu 16.04 workstation with 16 GB of RAM and a 6-core AMD FX-6300 CPU with 3.5 GHz maximum clock frequency. 2746 2740 2747 2741 \begin{figure} … … 2770 2764 \end{table} 2771 2765 2766 \enlargethispage{-10pt} 2772 2767 The C and \CCV variants are generally the slowest with the largest memory footprint, due to their less-efficient memory layout and the pointer indirection necessary to implement generic types; 2773 2768 this inefficiency is exacerbated by the second level of generic types in the pair benchmarks. … … 2860 2855 Tuples are a generalization of @std::pair@, in that they allow for arbitrary length, fixed-size aggregation of heterogeneous values. 2861 2856 Operations include @std::get<N>@ to extract values, @std::tie@ to create a tuple of references used for assignment, and lexicographic comparisons. 2862 \CCseventeen \textcolor{blue}{CHANGE ``\CC{}seventeen TO ``\CCseventeen''}proposes \emph{structured bindings}~\cite{Sutter15} to eliminate predeclaring variables and the use of @std::tie@ for binding the results.2857 \CCseventeen proposes \emph{structured bindings}~\cite{Sutter15} to eliminate predeclaring variables and the use of @std::tie@ for binding the results. 2863 2858 This extension requires the use of @auto@ to infer the types of the new variables; hence, complicated expressions with a nonobvious type must be documented with some other mechanism. 2864 2859 Furthermore, structured bindings are not a full replacement for @std::tie@, as it always declares new variables. -
doc/user/user.tex
r341bb80 r6d44da1 11 11 %% Created On : Wed Apr 6 14:53:29 2016 12 12 %% Last Modified By : Peter A. Buhr 13 %% Last Modified On : Thu Jul 26 17:29:05201814 %% Update Count : 33 6613 %% Last Modified On : Fri Aug 31 07:54:50 2018 14 %% Update Count : 3396 15 15 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 16 16 … … 210 210 Even with all its problems, C continues to be popular because it allows writing software at virtually any level in a computer system without restriction. 211 211 For system programming, where direct access to hardware, storage management, and real-time issues are a requirement, C is usually the only language of choice. 212 The TIOBE index~\cite{TIOBE} for July 2018 ranks the top 5 most \emph{popular} programming languages as:\Index*{Java} 16\%, C 14\%, \Index*[C++]{\CC{}} 7.5\%, Python 6\%, Visual Basic 4\% = 47.5\%, where the next 50 languages are less than 4\% each, with a long tail.212 The TIOBE index~\cite{TIOBE} for July 2018 ranks the top five most \emph{popular} programming languages as \Index*{Java} 16\%, C 14\%, \Index*[C++]{\CC{}} 7.5\%, Python 6\%, Visual Basic 4\% = 47.5\%, where the next 50 languages are less than 4\% each, with a long tail. 213 213 The top 3 rankings over the past 30 years are: 214 214 \begin{center} … … 351 351 The 2011 C standard plus GNU extensions. 352 352 \item 353 \Indexc[deletekeywords=inline]{-fgnu89-inline}\index{compilation option!-fgnu89-inline@{\lstinline[deletekeywords=inline] @-fgnu89-inline@}}353 \Indexc[deletekeywords=inline]{-fgnu89-inline}\index{compilation option!-fgnu89-inline@{\lstinline[deletekeywords=inline]$-fgnu89-inline$}} 354 354 Use the traditional GNU semantics for inline routines in C11 mode, which allows inline routines in header files. 355 355 \end{description} … … 455 455 #endif 456 456 457 ®#include_next <bfdlink.h> 457 ®#include_next <bfdlink.h> §\C{// must have internal check for multiple expansion}§ 458 458 ® 459 459 #if defined( with ) && defined( __CFA_BFD_H__ ) §\C{// reset only if set}§ … … 504 504 505 505 C, \CC, and Java (and many other programming languages) have no exponentiation operator\index{exponentiation!operator}\index{operator!exponentiation}, \ie $x^y$, and instead use a routine, like \Indexc{pow}, to perform the exponentiation operation. 506 \CFA extends the basic operators with the exponentiation operator ©?\?©\index{?\\?@ \lstinline@?\?@} and ©?\=?©\index{?\\=?@\lstinline@?\=?@}, as in, ©x \ y© and ©x \= y©, which means $x^y$ and $x \leftarrow x^y$.506 \CFA extends the basic operators with the exponentiation operator ©?\?©\index{?\\?@©?\?©} and ©?\=?©\index{?\\=?@©\=?©}, as in, ©x \ y© and ©x \= y©, which means $x^y$ and $x \leftarrow x^y$. 507 507 The priority of the exponentiation operator is between the cast and multiplicative operators, so that ©w * (int)x \ (int)y * z© is parenthesized as ©((w * (((int)x) \ ((int)y))) * z)©. 508 508 … … 516 516 256 64 -64 0.015625 -0.015625 18.3791736799526 0.264715-1.1922i 517 517 \end{cfa} 518 Parenthesis are necessary for the complex constants or the expression is parsed as ©1.0f+(2.0fi \ 3.0f)+2.0fi©.518 Parenthesis are necessary for complex constants or the expression is parsed as ©1.0f+®(®2.0fi \ 3.0f®)®+2.0fi©. 519 519 The exponentiation operator is available for all the basic types, but for user-defined types, only the integral-computation versions are available. 520 520 For returning an integral value, the user type ©T© must define multiplication, ©*©, and one, ©1©; … … 527 527 528 528 529 %\subsection{\texorpdfstring{\protect\lstinline@if@ Statement}{if Statement}} 530 \subsection{\texorpdfstring{\LstKeywordStyle{if} Statement}{if Statement}} 531 532 The ©if© expression allows declarations, similar to ©for© declaration expression: 533 \begin{cfa} 534 if ( int x = f() ) ... §\C{// x != 0}§ 535 if ( int x = f(), y = g() ) ... §\C{// x != 0 \&\& y != 0}§ 536 if ( int x = f(), y = g(); ®x < y® ) ... §\C{// relational expression}§ 537 \end{cfa} 538 Unless a relational expression is specified, each variable is compared not equal to 0, which is the standard semantics for the ©if© expression, and the results are combined using the logical ©&&© operator.\footnote{\CC only provides a single declaration always compared not equal to 0.} 529 %\subsection{\texorpdfstring{\protect\lstinline@if@/\protect\lstinline@while@ Statement}{if Statement}} 530 \subsection{\texorpdfstring{\LstKeywordStyle{if}/\LstKeywordStyle{while} Statement}{if/while Statement}} 531 532 The ©if©/©while© expression allows declarations, similar to ©for© declaration expression. 533 (Does not make sense for ©do©-©while©.) 534 \begin{cfa} 535 if ( ®int x = f()® ) ... §\C{// x != 0}§ 536 if ( ®int x = f(), y = g()® ) ... §\C{// x != 0 \&\& y != 0}§ 537 if ( ®int x = f(), y = g(); x < y® ) ... §\C{// relational expression}§ 538 if ( ®struct S { int i; } x = { f() }; x.i < 4® ) §\C{// relational expression}§ 539 540 while ( ®int x = f()® ) ... §\C{// x != 0}§ 541 while ( ®int x = f(), y = g()® ) ... §\C{// x != 0 \&\& y != 0}§ 542 while ( ®int x = f(), y = g(); x < y® ) ... §\C{// relational expression}§ 543 while ( ®struct S { int i; } x = { f() }; x.i < 4® ) ... §\C{// relational expression}§ 544 \end{cfa} 545 Unless a relational expression is specified, each variable is compared not equal to 0, which is the standard semantics for the ©if©/©while© expression, and the results are combined using the logical ©&&© operator.\footnote{\CC only provides a single declaration always compared not equal to 0.} 539 546 The scope of the declaration(s) is local to the @if@ statement but exist within both the ``then'' and ``else'' clauses. 547 548 549 %\subsection{\texorpdfstring{\protect\lstinline@for@ Statement}{for Statement}} 550 \subsection{\texorpdfstring{\LstKeywordStyle{for} Statement}{for Statement}} 551 552 The ©for©/©while©/©do-while© loop-control allows empty or simplified ranges. 553 An empty conditional implies ©1©. 554 The up-to range ©~©\index{~@©~©} means exclusive range [M,N); 555 the up-to range ©~=©\index{~=@©~=©} means inclusive range [M,N]. 556 The down-to range ©-~©\index{-~@©-~©} means exclusive range [N,M); 557 the down-to range ©-~=©\index{-~=@©-~=©} means inclusive range [N,M]. 558 ©0© is the implicit start value; 559 ©1© is the implicit increment value for an up-to range and ©-1© for an implicit down-to range. 560 The loop index is polymorphic in the type of the start value or comparison value when start is implicitly ©0©. 561 \begin{cquote} 562 \begin{tabular}{@{}ll|l@{}} 563 \multicolumn{2}{c|}{for control} & \multicolumn{1}{c}{output} \\ 564 \hline 565 \begin{cfa} 566 while ®()® { sout | "empty"; break; } 567 do { sout | "empty"; break; } while ®()®; 568 for ®()® { sout | "empty"; break; } 569 for ( ®0® ) { sout | "A"; } 570 for ( ®1® ) { sout | "A"; } 571 for ( ®10® ) { sout | "A"; } 572 for ( ®1 ~= 10 ~ 2® ) { sout | "B"; } 573 for ( ®10 -~= 1 ~ -2® ) { sout | "C"; } 574 for ( ®0.5 ~ 5.5® ) { sout | "D"; } 575 for ( ®5.5 -~ 0.5® ) { sout | "E"; } 576 for ( ®i; 10® ) { sout | i; } 577 for ( ®i; 1 ~= 10 ~ 2® ) { sout | i; } 578 for ( ®i; 10 -~= 1 ~ -2® ) { sout | i; } 579 for ( ®i; 0.5 ~ 5.5® ) { sout | i; } 580 for ( ®i; 5.5 -~ 0.5® ) { sout | i; } 581 for ( ®ui; 2u ~= 10u ~ 2u® ) { sout | ui; } 582 for ( ®ui; 10u -~= 2u ~ -2u® ) { sout | ui; } 583 int start = 3, comp = 10, inc = 2; 584 for ( ®i; start ~ comp ~ inc + 1® ) { sout | i; } 585 \end{cfa} 586 & 587 \begin{cfa} 588 sout | endl; 589 sout | endl; 590 sout | endl; 591 sout | endl; 592 sout | endl; 593 sout | endl; 594 sout | endl; 595 sout | endl; 596 sout | endl; 597 sout | endl; 598 sout | endl; 599 sout | endl; 600 sout | endl; 601 sout | endl; 602 sout | endl; 603 sout | endl; 604 sout | endl; 605 606 sout | endl; 607 \end{cfa} 608 & 609 \begin{cfa} 610 empty 611 empty 612 empty 613 614 A 615 A A A A A A A A A A 616 B B B B B 617 C C C C C 618 D D D D D 619 E E E E E 620 0 1 2 3 4 5 6 7 8 9 621 1 3 5 7 9 622 10 8 6 4 2 623 0.5 1.5 2.5 3.5 4.5 624 5.5 4.5 3.5 2.5 1.5 625 2 4 6 8 10 626 10 8 6 4 2 627 628 3 6 9 629 \end{cfa} 630 \end{tabular} 631 \end{cquote} 540 632 541 633 … … 800 892 801 893 894 % for () => for ( ;; ) 895 % for ( 10 - t ) => for ( typeof(10 - t) ? = 0 ; ? < 10 - t; ? += 1 ) // using 0 and 1 896 % for ( i ; 10 - t ) => for ( typeof(10 - t) i = 0 ; i < 10 - t; i += 1 ) // using 0 and 1 897 % for ( T i ; 10 - t ) => for ( T i = 0 ; i < 10 - t; i += 1 ) // using 0 and 1 898 % for ( 3~9 ) => for ( int ? = 3 ; ? < 9; ? += 1 ) // using 1 899 % for ( i ; 3~9 ) => for ( int i = 3 ; i < 9; i += 1 ) // using 1 900 % for ( T i ; 3~9 ) => for ( T i = 3 ; i < 9; i += 1 ) // using 1 901 902 802 903 %\subsection{\texorpdfstring{Labelled \protect\lstinline@continue@ / \protect\lstinline@break@}{Labelled continue / break}} 803 904 \subsection{\texorpdfstring{Labelled \LstKeywordStyle{continue} / \LstKeywordStyle{break} Statement}{Labelled continue / break Statement}} … … 805 906 While C provides ©continue© and ©break© statements for altering control flow, both are restricted to one level of nesting for a particular control structure. 806 907 Unfortunately, this restriction forces programmers to use \Indexc{goto} to achieve the equivalent control-flow for more than one level of nesting. 807 To prevent having to switch to the ©goto©, \CFA extends the \Indexc{continue}\index{continue@ \lstinline@continue@!labelled}\index{labelled!continue@©continue©} and \Indexc{break}\index{break@\lstinline@break@!labelled}\index{labelled!break@©break©} with a target label to support static multi-level exit\index{multi-level exit}\index{static multi-level exit}~\cite{Buhr85}, as in Java.908 To prevent having to switch to the ©goto©, \CFA extends the \Indexc{continue}\index{continue@©continue©!labelled}\index{labelled!continue@©continue©} and \Indexc{break}\index{break@©break©!labelled}\index{labelled!break@©break©} with a target label to support static multi-level exit\index{multi-level exit}\index{static multi-level exit}~\cite{Buhr85}, as in Java. 808 909 For both ©continue© and ©break©, the target label must be directly associated with a ©for©, ©while© or ©do© statement; 809 910 for ©break©, the target label can also be associated with a ©switch©, ©if© or compound (©{}©) statement. … … 890 991 \end{figure} 891 992 892 Both labelled ©continue© and ©break© are a ©goto©\index{goto@ \lstinline@goto@!restricted} restricted in the following ways:993 Both labelled ©continue© and ©break© are a ©goto©\index{goto@©goto©!restricted} restricted in the following ways: 893 994 \begin{itemize} 894 995 \item -
driver/as.cc
r341bb80 r6d44da1 5 5 // file "LICENCE" distributed with Cforall. 6 6 // 7 // as.c -- 7 // as.c -- map assembler file, scan for debug information. If found, expand file by one character and insert Cforall 8 // language code on the N line from the start of the debug information. 8 9 // 9 10 // Author : Peter A. Buhr 10 11 // Created On : Wed Aug 1 10:49:42 2018 11 12 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Thu Aug 2 17:50:09201813 // Update Count : 9 013 // Last Modified On : Sat Sep 8 08:40:16 2018 14 // Update Count : 97 14 15 // 15 16 … … 23 24 24 25 //#define __DEBUG_H__ 26 27 #ifdef __DEBUG_H__ 28 #include <iostream> 29 using namespace std; 30 #endif // __DEBUG_H__ 25 31 26 32 int main( const int argc, const char * argv[] ) { … … 38 44 off_t size = mystat.st_size; 39 45 40 char * start = (char *)mmap( NULL, size, PROT_READ | PROT_WRITE, MAP_SHARED, fd, 0 ); 41 if ( start == (void *)-1 ) { perror( "mmap" ); exit( EXIT_FAILURE ); }; 46 if ( size ) { // cannot map 0 sized file 47 char * start = (char *)mmap( NULL, size, PROT_READ | PROT_WRITE, MAP_SHARED, fd, 0 ); 48 if ( start == (void *)-1 ) { perror( "mmap" ); exit( EXIT_FAILURE ); }; 42 49 43 if ( char * cursor = strstr( start, ".Ldebug_info0:" ) ) { // debug information ?44 // Expand file by one byte to hold 2 character Cforall language code.45 if ( ftruncate( fd, size + 1 ) ) { perror( "ftruncate" ); exit( EXIT_FAILURE ); };50 if ( char * cursor = strstr( start, ".Ldebug_info0:" ) ) { // debug information ? 51 // Expand file by one byte to hold 2 character Cforall language code. 52 if ( ftruncate( fd, size + 1 ) ) { perror( "ftruncate" ); exit( EXIT_FAILURE ); }; 46 53 47 for ( int i = 0; i < 8; i += 1 ) {// move N (magic) lines forward48 cursor = strstr( cursor, "\n" ) + 1;49 } // for54 for ( int i = 0; i < 8; i += 1 ) { // move N (magic) lines forward 55 cursor = strstr( cursor, "\n" ) + 1; 56 } // for 50 57 51 cursor -= 2;// backup over "c\n" language value52 if ( *(cursor - 1) != 'x' ) { fprintf( stderr, "invalid C language code\n" ); exit( EXIT_FAILURE ); };58 cursor -= 2; // backup over "c\n" language value 59 if ( *(cursor - 1) != 'x' ) { fprintf( stderr, "invalid C language code\n" ); exit( EXIT_FAILURE ); }; 53 60 54 memmove( cursor + 2, cursor + 1, start + size - cursor - 1 ); // move remaining text 1 character right61 memmove( cursor + 2, cursor + 1, start + size - cursor - 1 ); // move remaining text 1 character right 55 62 56 *(cursor) = '2'; // replace C language value with CFA 57 *(cursor + 1) = '5'; 63 *(cursor) = '2'; // replace C language value with CFA 64 *(cursor + 1) = '5'; 65 } // if 66 67 if ( munmap( start, size ) ) { perror( "munmap" ); exit( EXIT_FAILURE ); }; // update on disk 58 68 } // if 59 60 if ( munmap( start, size ) ) { perror( "munmap" ); exit( EXIT_FAILURE ); }; // update on disk61 69 62 70 argv[0] = "as"; -
driver/cc1.cc
r341bb80 r6d44da1 10 10 // Created On : Fri Aug 26 14:23:51 2005 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Thu Jul 19 10:46:11201813 // Update Count : 1 1112 // Last Modified On : Mon Sep 3 16:57:05 2018 13 // Update Count : 125 14 14 // 15 15 … … 32 32 string compiler_name( CFA_BACKEND_CC ); // path/name of C compiler 33 33 34 string D__GCC_X__( "-D__GCC_X__=" );35 34 string D__GCC_BPREFIX__( "-D__GCC_BPREFIX__=" ); 36 35 string D__CFA_FLAGPREFIX__( "-D__CFA_FLAG__=" ); … … 47 46 const string suffixes[NumSuffixes] = { "cfa", "hfa", }; 48 47 49 bool suffix( string arg) {48 void suffix( string arg, const char * args[], int & nargs ) { 50 49 //std::cerr << arg << std::endl; 51 50 size_t dot = arg.find_last_of( "." ); 52 51 //std::cerr << dot << " " << (dot != string::npos ? arg.substr( dot + 1 ) : "fred" ) << std::endl; 53 if ( dot == string::npos ) return false;52 if ( dot == string::npos ) return; 54 53 string sx = arg.substr( dot + 1 ); 55 54 for ( int i = 0; i < NumSuffixes; i += 1 ) { 56 if ( sx == suffixes[i] ) return true; 57 } // for 58 return false; 55 if ( sx == suffixes[i] ) { 56 args[nargs] = "-x"; 57 nargs += 1; 58 args[nargs] = "c"; 59 nargs += 1; 60 return; 61 } // if 62 } // for 59 63 } // suffix 60 64 61 65 62 void checkEnv( const char * args[], int &nargs ) {66 void checkEnv( const char * args[], int & nargs ) { 63 67 char *value; 64 68 65 value = getenv( "__C OMPILER__" );69 value = getenv( "__CFA_COMPILER__" ); 66 70 if ( value != NULL ) { 67 71 compiler_name = value; … … 110 114 void Stage1( const int argc, const char * const argv[] ) { 111 115 int code; 112 int i;113 116 114 117 string arg; … … 133 136 cerr << "Stage1" << endl; 134 137 #endif // __DEBUG_H__ 138 checkEnv( args, nargs ); // arguments passed via environment variables 139 #ifdef __DEBUG_H__ 140 for ( int i = 1; i < argc; i += 1 ) { 141 cerr << "argv[" << i << "]:\"" << argv[i] << "\"" << endl; 142 } // for 143 #endif // __DEBUG_H__ 135 144 136 145 // process all the arguments 137 146 138 checkEnv( args, nargs ); // arguments passed via environment variables 139 140 for ( i = 1; i < argc; i += 1 ) { 141 #ifdef __DEBUG_H__ 142 cerr << "argv[" << i << "]:\"" << argv[i] << "\"" << endl; 143 #endif // __DEBUG_H__ 147 for ( int i = 1; i < argc; i += 1 ) { 144 148 arg = argv[i]; 145 #ifdef __DEBUG_H__146 cerr << "arg:\"" << arg << "\"" << endl;147 #endif // __DEBUG_H__148 149 if ( prefix( arg, "-" ) ) { 149 150 // strip g++ flags that are inappropriate or cause duplicates in subsequent passes … … 179 180 ncargs += 1; 180 181 i += 1; // and the argument 181 // } else if ( prefix( arg, D__GCC_X__ ) ) {182 // args[nargs] = "-x";183 // nargs += 1;184 // args[nargs] = ( *new string( arg.substr( D__GCC_X__.size() ) ) ).c_str(); // pass the flag along185 // nargs += 1;186 // } else if ( arg == "-D" && prefix( argv[i + 1], D__GCC_X__.substr(2) ) ) {187 // args[nargs] = "-x";188 // nargs += 1;189 // args[nargs] = ( *new string( string( argv[i + 1] ).substr( D__GCC_X__.size() - 2 ) ) ).c_str(); // pass the flag along190 // nargs += 1;191 // i += 1; // and the argument192 182 } else if ( prefix( arg, D__GCC_BPREFIX__ ) ) { 193 183 bprefix = arg.substr( D__GCC_BPREFIX__.size() ); … … 245 235 #ifdef __DEBUG_H__ 246 236 cerr << "args:"; 247 for ( i = 1; i < nargs; i += 1 ) {237 for ( int i = 1; i < nargs; i += 1 ) { 248 238 cerr << " " << args[i]; 249 239 } // for … … 263 253 264 254 args[0] = compiler_name.c_str(); 255 suffix( cpp_in, args, nargs ); // check suffix 265 256 args[nargs] = cpp_in; 266 257 nargs += 1; … … 275 266 #ifdef __DEBUG_H__ 276 267 cerr << "nargs: " << nargs << endl; 277 for ( i = 0; args[i] != NULL; i += 1 ) {268 for ( int i = 0; args[i] != NULL; i += 1 ) { 278 269 cerr << args[i] << " "; 279 270 } // for … … 310 301 311 302 args[0] = compiler_name.c_str(); 312 if ( suffix( cpp_in ) ) { 313 args[nargs] = "-x"; 314 nargs += 1; 315 args[nargs] = "c"; 316 nargs += 1; 317 } // if 303 suffix( cpp_in, args, nargs ); // check suffix 318 304 args[nargs] = cpp_in; // input to cpp 319 305 nargs += 1; … … 322 308 #ifdef __DEBUG_H__ 323 309 cerr << "cpp nargs: " << nargs << endl; 324 for ( i = 0; args[i] != NULL; i += 1 ) {310 for ( int i = 0; args[i] != NULL; i += 1 ) { 325 311 cerr << args[i] << " "; 326 312 } // for … … 354 340 355 341 if ( fork() == 0 ) { // child runs CFA 356 cargs[0] = ( *new string( bprefix + " /cfa-cpp" ) ).c_str();342 cargs[0] = ( *new string( bprefix + "cfa-cpp" ) ).c_str(); 357 343 358 344 // Source file-name used to generate routine names containing global initializations for TU. … … 375 361 #ifdef __DEBUG_H__ 376 362 cerr << "cfa-cpp ncargs: " << o_name << " " << CFA_flag << " " << ncargs << endl; 377 for ( i = 0; cargs[i] != NULL; i += 1 ) {363 for ( int i = 0; cargs[i] != NULL; i += 1 ) { 378 364 cerr << cargs[i] << " "; 379 365 } // for … … 405 391 406 392 void Stage2( const int argc, const char * const * argv ) { 407 int i;408 409 393 string arg; 410 394 … … 417 401 cerr << "Stage2" << endl; 418 402 #endif // __DEBUG_H__ 403 checkEnv( args, nargs ); // arguments passed via environment variables 404 #ifdef __DEBUG_H__ 405 for ( int i = 1; i < argc; i += 1 ) { 406 cerr << "argv[" << i << "]:\"" << argv[i] << "\"" << endl; 407 } // for 408 #endif // __DEBUG_H__ 419 409 420 410 // process all the arguments 421 411 422 checkEnv( args, nargs ); // arguments passed via environment variables 423 424 for ( i = 1; i < argc; i += 1 ) { 425 #ifdef __DEBUG_H__ 426 cerr << "argv[" << i << "]:\"" << argv[i] << "\"" << endl; 427 #endif // __DEBUG_H__ 412 for ( int i = 1; i < argc; i += 1 ) { 428 413 arg = argv[i]; 429 #ifdef __DEBUG_H__430 cerr << "arg:\"" << arg << "\"" << endl;431 #endif // __DEBUG_H__432 414 if ( prefix( arg, "-" ) ) { 433 415 // strip inappropriate flags … … 474 456 #ifdef __DEBUG_H__ 475 457 cerr << "args:"; 476 for ( i = 1; i < nargs; i += 1 ) {458 for ( int i = 1; i < nargs; i += 1 ) { 477 459 cerr << " " << args[i]; 478 460 } // for … … 490 472 #ifdef __DEBUG_H__ 491 473 cerr << "stage2 nargs: " << nargs << endl; 492 for ( i = 0; args[i] != NULL; i += 1 ) {474 for ( int i = 0; args[i] != NULL; i += 1 ) { 493 475 cerr << args[i] << " "; 494 476 } // for … … 504 486 int main( const int argc, const char * const argv[], __attribute__((unused)) const char * const env[] ) { 505 487 #ifdef __DEBUG_H__ 506 for ( int i = 0; env[i] != NULL; i += 1 ) {488 for ( int int i = 0; env[i] != NULL; i += 1 ) { 507 489 cerr << env[i] << endl; 508 490 } // for -
driver/cfa.cc
r341bb80 r6d44da1 10 10 // Created On : Tue Aug 20 13:44:49 2002 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Fri Aug 10 18:17:58201813 // Update Count : 2 5912 // Last Modified On : Mon Sep 3 16:47:59 2018 13 // Update Count : 275 14 14 // 15 15 … … 43 43 const string suffixes[NumSuffixes] = { "cfa", "hfa", }; 44 44 45 bool suffix( string arg ) {45 bool suffix( string arg, const char * args[], int & nargs ) { 46 46 //std::cerr << arg << std::endl; 47 47 size_t dot = arg.find_last_of( "." ); … … 50 50 string sx = arg.substr( dot + 1 ); 51 51 for ( int i = 0; i < NumSuffixes; i += 1 ) { 52 if ( sx == suffixes[i] ) return true; 52 if ( sx == suffixes[i] ) { 53 args[nargs] = "-x"; 54 nargs += 1; 55 args[nargs] = "c"; 56 nargs += 1; 57 return true; 58 } // if 53 59 } // for 54 60 return false; … … 86 92 string Major( str( CFA_VERSION_MAJOR ) ), Minor( str( CFA_VERSION_MINOR ) ), Patch( str( CFA_VERSION_PATCH ) ); 87 93 88 string installincdir( CFA_INCDIR ); 89 string installlibdir( CFA_LIBDIR ); 90 string srcdriverdir ( TOP_BUILDDIR "driver"); 94 string installincdir( CFA_INCDIR ); // fixed location of include files 95 string installlibdir( CFA_LIBDIR ); // fixed location of cc1 and cfa-cpp commands when installed 96 string srcdriverdir ( TOP_BUILDDIR "driver"); // fixed location of cc1 and cfa-cpp commands when in tree 91 97 92 98 string heading; // banner printed at start of cfa compilation … … 123 129 #ifdef __DEBUG_H__ 124 130 cerr << "CFA:" << endl; 131 for ( int i = 1; i < argc; i += 1 ) { 132 cerr << "argv[" << i << "]:\"" << argv[i] << "\"" << endl; 133 } // for 125 134 #endif // __DEBUG_H__ 126 135 … … 128 137 129 138 for ( int i = 1; i < argc; i += 1 ) { 130 #ifdef __DEBUG_H__131 cerr << "argv[" << i << "]:\"" << argv[i] << "\"" << endl;132 #endif // __DEBUG_H__133 139 arg = argv[i]; // convert to string value 134 #ifdef __DEBUG_H__135 cerr << "arg:\"" << arg << "\"" << endl;136 #endif // __DEBUG_H__137 140 if ( prefix( arg, "-" ) ) { 138 141 // pass through arguments … … 178 181 if ( i == argc ) continue; // next argument available ? 179 182 compiler_path = argv[i]; 180 if ( putenv( (char *)( *new string( string( "__ U_COMPILER__=" ) + argv[i]) ).c_str() ) != 0 ) {183 if ( putenv( (char *)( *new string( string( "__CFA_COMPILER__=" ) + argv[i]) ).c_str() ) != 0 ) { 181 184 cerr << argv[0] << " error, cannot set environment variable." << endl; 182 185 exit( EXIT_FAILURE ); … … 197 200 args[nargs] = argv[i]; // pass the argument along 198 201 nargs += 1; 199 } else if ( arg == "-x" ) {200 xflag = true;201 args[nargs] = argv[i]; // pass the argument along202 nargs += 1;203 i += 1; // advance to argument204 args[nargs] = argv[i]; // pass the argument along205 nargs += 1;206 // args[nargs] = ( *new string( string("-D__GCC_X__=") + argv[i] ) ).c_str(); // add the argument for -x207 // nargs += 1;208 } else if ( prefix( arg, "-x" ) ) {209 xflag = true;210 args[nargs] = argv[i]; // pass the argument along211 nargs += 1;212 // args[nargs] = ( *new string( string("-D__GCC_X__=") + arg.substr(2) ) ).c_str(); // add the argument for -x213 // nargs += 1;214 202 } else if ( arg == "-w" ) { 215 203 args[nargs] = argv[i]; // pass the argument along … … 293 281 } // if 294 282 } else { 295 bool opt = false; 296 if ( ! xflag && suffix( arg ) ) { 283 bool cfa = suffix( arg, args, nargs ); // check suffix 284 args[nargs] = argv[i]; // concatenate file 285 nargs += 1; 286 if ( cfa ) { 297 287 args[nargs] = "-x"; 298 288 nargs += 1; 299 args[nargs] = "c";300 nargs += 1;301 // args[nargs] = ( *new string( string("-D__GCC_X__=c") ) ).c_str(); // add the argument for -x302 // nargs += 1;303 opt = true;304 } // if305 // concatenate other arguments306 args[nargs] = argv[i];307 nargs += 1;308 if ( opt ) {309 args[nargs] = "-x";310 nargs += 1;311 289 args[nargs] = "none"; 312 290 nargs += 1; 313 // args[nargs] = ( *new string( string("-D__GCC_X__=none") ) ).c_str(); // add the argument for -x314 // nargs += 1;315 291 } // if 316 292 nonoptarg = true; … … 319 295 } // for 320 296 297 args[nargs] = "-x"; // turn off language 298 nargs += 1; 299 args[nargs] = "none"; 300 nargs += 1; 301 321 302 #ifdef __x86_64__ 322 303 args[nargs] = "-mcx16"; // allow double-wide CAA … … 341 322 args[nargs] = "-I" CFA_INCDIR; 342 323 nargs += 1; 343 if ( ! noincstd_flag ) { 344 args[nargs] = "-I" CFA_INCDIR " /stdhdr";324 if ( ! noincstd_flag ) { // do not use during build 325 args[nargs] = "-I" CFA_INCDIR "stdhdr"; 345 326 nargs += 1; 346 327 } // if 347 args[nargs] = "-I" CFA_INCDIR " /concurrency";348 nargs += 1; 349 args[nargs] = "-I" CFA_INCDIR " /containers";328 args[nargs] = "-I" CFA_INCDIR "concurrency"; 329 nargs += 1; 330 args[nargs] = "-I" CFA_INCDIR "containers"; 350 331 nargs += 1; 351 332 } else { 352 333 args[nargs] = "-I" TOP_SRCDIR "libcfa/src"; 353 334 nargs += 1; 354 if ( ! noincstd_flag ) { 335 if ( ! noincstd_flag ) { // do not use during build 355 336 args[nargs] = "-I" TOP_SRCDIR "libcfa/src" "/stdhdr"; 356 337 nargs += 1; … … 377 358 } 378 359 379 const char * const arch = m32 ? CFA_32_CPU : (m64 ? CFA_64_CPU : CFA_DEFAULT_CPU); 360 string arch = m32 ? CFA_32_CPU : (m64 ? CFA_64_CPU : CFA_DEFAULT_CPU); 361 if ( ! m32 && ! m64 ) { 362 if ( arch == "x86" ) { 363 args[nargs] = "-m32"; 364 nargs += 1; 365 } else if ( arch == "x64" ) { 366 args[nargs] = "-m64"; 367 nargs += 1; 368 } // if 369 } // if 380 370 const char * config = debug ? "debug": "nodebug"; 381 371 string libdir = libbase + arch + "-" + config; 382 if( !dirExists(libdir) ) { 372 373 if ( ! dirExists( libdir ) ) { 383 374 cerr << argv[0] << " internal error, configuration " << config << " not installed." << endl; 384 375 cerr << "Was looking for " << libdir << endl; 385 376 libdir = libbase + arch + "-" + "nolib"; 386 } 387 388 if ( !dirExists(libdir) ) {377 } // if 378 379 if ( ! dirExists( libdir ) ) { 389 380 cerr << argv[0] << " internal error, cannot find prelude directory." << endl; 390 381 cerr << "Was looking for " << libdir << endl; 391 382 exit( EXIT_FAILURE ); 392 } 383 } // if 393 384 394 385 args[nargs] = ( *new string( string("-D__CFA_FLAG__=--prelude-dir=" ) + libdir + (intree ? "/prelude" : "")) ).c_str(); … … 472 463 473 464 if ( Bprefix.length() == 0 ) { 474 Bprefix = !intree ? installlibdir : srcdriverdir; 465 Bprefix = ! intree ? installlibdir : srcdriverdir; 466 if ( Bprefix[Bprefix.length() - 1] != '/' ) Bprefix += '/'; 475 467 args[nargs] = ( *new string( string("-D__GCC_BPREFIX__=") + Bprefix ) ).c_str(); 476 468 nargs += 1; … … 506 498 args[nargs] = "-D__int8_t_defined"; // prevent gcc type-size attributes 507 499 nargs += 1; 508 args[nargs] = ( *new string( string("-B") + Bprefix + "/") ).c_str();500 args[nargs] = ( *new string( string("-B") + Bprefix ) ).c_str(); 509 501 nargs += 1; 510 502 args[nargs] = "-lm"; -
libcfa/Makefile.in
r341bb80 r6d44da1 238 238 CFLAGS = @CFLAGS@ 239 239 CONFIGURATION = @CONFIGURATION@ 240 CONFIG_BUILDLIB = @CONFIG_BUILDLIB@ 240 241 CONFIG_CFAFLAGS = @CONFIG_CFAFLAGS@ 241 242 CONFIG_CFLAGS = @CONFIG_CFLAGS@ -
libcfa/configure
r341bb80 r6d44da1 701 701 CFA_PREFIX 702 702 CFA_NAME 703 BUILDLIB_FALSE 704 BUILDLIB_TRUE 705 CONFIG_BUILDLIB 703 706 CONFIG_CFAFLAGS 704 707 CONFIG_CFLAGS … … 2376 2379 2377 2380 2381 2378 2382 am__api_version='1.15' 2379 2383 … … 2947 2951 CONFIG_CFLAGS="-O0 -g" 2948 2952 CONFIG_CFAFLAGS="-debug" 2953 CONFIG_BUILDLIB="yes" 2949 2954 ;; 2950 2955 "nodebug" ) 2951 2956 CONFIG_CFLAGS="-O2 -s" 2952 2957 CONFIG_CFAFLAGS="-nodebug" 2958 CONFIG_BUILDLIB="yes" 2953 2959 ;; 2954 2960 "nolib" ) 2955 CONFIG_CFLAGS="" 2956 CONFIG_CFAFLAGS="" 2961 CONFIG_CFLAGS="-O2 -s" 2962 CONFIG_CFAFLAGS="-nodebug" 2963 CONFIG_BUILDLIB="no" 2957 2964 ;; 2958 2965 esac 2959 2966 2960 2967 2968 2969 2970 2971 if test "x${CONFIG_BUILDLIB}" = "xyes"; then 2972 BUILDLIB_TRUE= 2973 BUILDLIB_FALSE='#' 2974 else 2975 BUILDLIB_TRUE='#' 2976 BUILDLIB_FALSE= 2977 fi 2961 2978 2962 2979 … … 16944 16961 fi 16945 16962 16963 if test -z "${BUILDLIB_TRUE}" && test -z "${BUILDLIB_FALSE}"; then 16964 as_fn_error $? "conditional \"BUILDLIB\" was never defined. 16965 Usually this means the macro was only invoked conditionally." "$LINENO" 5 16966 fi 16946 16967 if test -z "${AMDEP_TRUE}" && test -z "${AMDEP_FALSE}"; then 16947 16968 as_fn_error $? "conditional \"AMDEP\" was never defined. -
libcfa/configure.ac
r341bb80 r6d44da1 42 42 CONFIG_CFLAGS="-O0 -g" 43 43 CONFIG_CFAFLAGS="-debug" 44 CONFIG_BUILDLIB="yes" 44 45 ;; 45 46 "nodebug" ) 46 47 CONFIG_CFLAGS="-O2 -s" 47 48 CONFIG_CFAFLAGS="-nodebug" 49 CONFIG_BUILDLIB="yes" 48 50 ;; 49 51 "nolib" ) 50 CONFIG_CFLAGS="" 51 CONFIG_CFAFLAGS="" 52 CONFIG_CFLAGS="-O2 -s" 53 CONFIG_CFAFLAGS="-nodebug" 54 CONFIG_BUILDLIB="no" 52 55 ;; 53 56 esac … … 55 58 AC_SUBST(CONFIG_CFLAGS) 56 59 AC_SUBST(CONFIG_CFAFLAGS) 60 AC_SUBST(CONFIG_BUILDLIB) 61 62 AM_CONDITIONAL([BUILDLIB], [test "x${CONFIG_BUILDLIB}" = "xyes"]) 57 63 58 64 #============================================================================== -
libcfa/prelude/Makefile.am
r341bb80 r6d44da1 21 21 # put into lib for now 22 22 cfalibdir = ${CFA_LIBDIR} 23 cfalib_DATA = gcc-builtins.cf builtins.cf extras.cf prelude.cf bootloader.c 24 noinst_DATA = ../src/prelude.c 23 cfalib_DATA = gcc-builtins.cf builtins.cf extras.cf prelude.cfa bootloader.c 25 24 26 25 CC = @CFACC@ … … 45 44 ${AM_V_GEN}gcc -I${srcdir} -E ${srcdir}/prototypes.c | awk -f ${srcdir}/prototypes.awk > $@ 46 45 47 prelude.cf : prelude-gen.cc46 prelude.cfa : prelude-gen.cc 48 47 ${AM_V_GEN}${CXX} ${AM_CXXFLAGS} ${CXXFLAGS} ${AM_CFLAGS} ${<} -o prelude-gen -Wall -Wextra -O2 -g -std=c++14 49 48 @./prelude-gen > $@ … … 61 60 include $(DEPDIR)/builtins.Po 62 61 63 ../src/prelude.c : prelude.cf extras.cf gcc-builtins.cf builtins.cf @CFACPP@ 64 ${AM_V_GEN}@CFACPP@ --prelude-dir=${builddir} -l prelude.cf $@ # use src/cfa-cpp as not in lib until after install 65 66 bootloader.c : ${srcdir}/bootloader.cf prelude.cf extras.cf gcc-builtins.cf builtins.cf @CFACPP@ 62 bootloader.c : ${srcdir}/bootloader.cf prelude.cfa extras.cf gcc-builtins.cf builtins.cf @CFACPP@ 67 63 ${AM_V_GEN}@CFACPP@ --prelude-dir=${builddir} -tpm ${srcdir}/bootloader.cf $@ # use src/cfa-cpp as not in lib until after install 68 64 … … 70 66 rm -rf $(DEPDIR) 71 67 72 MOSTLYCLEANFILES = bootloader.c builtins.cf extras.cf gcc-builtins.c gcc-builtins.cf prelude.cf 68 MOSTLYCLEANFILES = bootloader.c builtins.cf extras.cf gcc-builtins.c gcc-builtins.cf prelude.cfa 73 69 MAINTAINERCLEANFILES = ${addprefix ${libdir}/,${cfalib_DATA}} ${addprefix ${libdir}/,${lib_LIBRARIES}} -
libcfa/prelude/Makefile.in
r341bb80 r6d44da1 153 153 } 154 154 am__installdirs = "$(DESTDIR)$(cfalibdir)" 155 DATA = $(cfalib_DATA) $(noinst_DATA)155 DATA = $(cfalib_DATA) 156 156 am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) 157 157 am__DIST_COMMON = $(srcdir)/Makefile.in … … 181 181 CFLAGS = @CFLAGS@ 182 182 CONFIGURATION = @CONFIGURATION@ 183 CONFIG_BUILDLIB = @CONFIG_BUILDLIB@ 183 184 CONFIG_CFAFLAGS = @CONFIG_CFAFLAGS@ 184 185 CONFIG_CFLAGS = @CONFIG_CFLAGS@ … … 301 302 # put into lib for now 302 303 cfalibdir = ${CFA_LIBDIR} 304 <<<<<<< HEAD 303 305 cfalib_DATA = gcc-builtins.cf builtins.cf extras.cf prelude.cf bootloader.c 304 306 noinst_DATA = ../src/prelude.c 305 307 AM_CFLAGS = -g -Wall -Wno-unused-function -fPIC @ARCH_FLAGS@ @CONFIG_CFLAGS@ 308 ======= 309 cfalib_DATA = gcc-builtins.cf builtins.cf extras.cf prelude.cfa bootloader.c 310 AM_CFLAGS = -g -Wall -Wno-unused-function @ARCH_FLAGS@ @CONFIG_CFLAGS@ 311 >>>>>>> master 306 312 AM_CFAFLAGS = @CONFIG_CFAFLAGS@ 307 MOSTLYCLEANFILES = bootloader.c builtins.cf extras.cf gcc-builtins.c gcc-builtins.cf prelude.cf 313 MOSTLYCLEANFILES = bootloader.c builtins.cf extras.cf gcc-builtins.c gcc-builtins.cf prelude.cfa 308 314 MAINTAINERCLEANFILES = ${addprefix ${libdir}/,${cfalib_DATA}} ${addprefix ${libdir}/,${lib_LIBRARIES}} 309 315 all: all-am … … 544 550 ${AM_V_GEN}gcc -I${srcdir} -E ${srcdir}/prototypes.c | awk -f ${srcdir}/prototypes.awk > $@ 545 551 546 prelude.cf : prelude-gen.cc552 prelude.cfa : prelude-gen.cc 547 553 ${AM_V_GEN}${CXX} ${AM_CXXFLAGS} ${CXXFLAGS} ${AM_CFLAGS} ${<} -o prelude-gen -Wall -Wextra -O2 -g -std=c++14 548 554 @./prelude-gen > $@ … … 560 566 include $(DEPDIR)/builtins.Po 561 567 562 ../src/prelude.c : prelude.cf extras.cf gcc-builtins.cf builtins.cf @CFACPP@ 563 ${AM_V_GEN}@CFACPP@ --prelude-dir=${builddir} -l prelude.cf $@ # use src/cfa-cpp as not in lib until after install 564 565 bootloader.c : ${srcdir}/bootloader.cf prelude.cf extras.cf gcc-builtins.cf builtins.cf @CFACPP@ 568 bootloader.c : ${srcdir}/bootloader.cf prelude.cfa extras.cf gcc-builtins.cf builtins.cf @CFACPP@ 566 569 ${AM_V_GEN}@CFACPP@ --prelude-dir=${builddir} -tpm ${srcdir}/bootloader.cf $@ # use src/cfa-cpp as not in lib until after install 567 570 -
libcfa/prelude/prelude-gen.cc
r341bb80 r6d44da1 142 142 143 143 int main() { 144 cout << "# 2 \"prelude.cf \" // needed for error messages from this file" << endl;144 cout << "# 2 \"prelude.cfa\" // needed for error messages from this file" << endl; 145 145 cout << "trait sized(dtype T) {};" << endl; 146 146 -
libcfa/src/Makefile.am
r341bb80 r6d44da1 25 25 lib_LTLIBRARIES = libcfa.la 26 26 27 VPATH += :../prelude 28 27 29 # AM_CFLAGS for all cfa source 28 30 # AM_CFAFLAGS for only cfa source 29 31 # use -no-include-stdhdr to prevent rebuild cycles 30 32 # The built sources must not depend on the installed headers 31 AM_CFAFLAGS = -quiet -in-tree - imacros prelude.c -I$(srcdir)/stdhdr @CONFIG_CFAFLAGS@33 AM_CFAFLAGS = -quiet -in-tree -I$(srcdir)/stdhdr @CONFIG_CFAFLAGS@ 32 34 AM_CFLAGS = -g -Wall -Wno-unused-function -fPIC @ARCH_FLAGS@ @CONFIG_CFLAGS@ 33 35 AM_CCASFLAGS = -g -Wall -Wno-unused-function @ARCH_FLAGS@ @CONFIG_CFLAGS@ … … 35 37 36 38 #---------------------------------------------------------------------------------------------------------------- 39 if BUILDLIB 37 40 headers = fstream.hfa iostream.hfa iterator.hfa limits.hfa rational.hfa time.hfa stdlib.hfa common.hfa \ 38 41 containers/maybe.hfa containers/pair.hfa containers/result.hfa containers/vector.hfa 42 43 headers_nosrc = math.hfa gmp.hfa time_t.hfa bits/align.hfa bits/containers.hfa bits/defs.hfa bits/debug.hfa bits/locks.hfa 39 44 40 45 # not all platforms support concurrency, add option do disable it 41 46 headers += concurrency/coroutine.hfa concurrency/thread.hfa concurrency/kernel.hfa concurrency/monitor.hfa concurrency/mutex.hfa 42 47 48 headers_nosrc += concurrency/invoke.h 49 43 50 libobjs = ${headers:.hfa=.lo} 44 libsrc = prelude.c startup.cfa interpose.cfa bits/debug.cfa assert.cfa exception.c virtual.c heap.cfa \ 45 ${headers:.hfa=.cfa} 51 libsrc = startup.cfa interpose.cfa bits/debug.cfa assert.cfa exception.c virtual.c heap.cfa ${headers:.hfa=.cfa} 46 52 47 53 # not all platforms support concurrency, add option do disable it 48 54 libsrc += concurrency/CtxSwitch-@ARCHITECTURE@.S concurrency/alarm.cfa concurrency/invoke.c concurrency/preemption.cfa 55 else 56 headers = 57 headers_nosrc = 58 libsrc = 59 endif 60 49 61 50 62 #---------------------------------------------------------------------------------------------------------------- 51 63 # add dependency to cfa-cpp so all libraries are rebuilt with new translator 52 ${libobjs} : ${cfalib_DATA} 64 #@CFACC@ @CFACPP@ prelude.cfa 53 65 54 libcfa_la_SOURCES = ${libsrc} 66 # add dependency of cfa files 67 libobjs = $(addsuffix .lo, $(basename $(filter %.cfa,$(libsrc)))) 68 $(libobjs) : @CFACC@ @CFACPP@ prelude.cfa 69 70 71 # .deps inclusion is not done automatically by automake for new languages 72 libdeps = $(join \ 73 $(addsuffix $(DEPDIR)/ , $(dir $(libobjs) ) ), \ 74 $(notdir ${libobjs:.lo=.Po}) \ 75 ) 76 77 -include $(libdeps) 78 79 prelude.lo : prelude.cfa extras.cf gcc-builtins.cf builtins.cf @CFACC@ @CFACPP@ 80 ${AM_V_GEN}@CFACC@ ${AM_CFLAGS} ${CFLAGS} -quiet -in-tree -XCFA -l ${<} -c -o ${@} 81 82 83 84 #---------------------------------------------------------------------------------------------------------------- 85 libcfa_la_SOURCES = prelude.cfa ${libsrc} 55 86 56 87 stdhdr = $(shell find $(srcdir)/stdhdr -type f -printf "%p ") 57 88 58 89 cfa_includedir = $(CFA_INCDIR) 59 nobase_cfa_include_HEADERS = \ 60 ${headers} \ 61 ${stdhdr} \ 62 math.hfa \ 63 gmp.hfa \ 64 time_t.hfa \ 65 bits/align.hfa \ 66 bits/containers.hfa \ 67 bits/defs.hfa \ 68 bits/debug.hfa \ 69 bits/locks.hfa \ 70 concurrency/invoke.h 71 72 MOSTLYCLEANFILES = prelude.c 90 nobase_cfa_include_HEADERS = ${stdhdr} ${headers} ${headers_nosrc} 73 91 74 92 #---------------------------------------------------------------------------------------------------------------- 75 93 maintainer-clean-local: 76 94 -rm -rf ${CFA_INCDIR} ${CFA_LIBDIR} 95 96 97 # $(AM_V_CFA)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.o$$||'`;\ 98 # $(CFACOMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\ 99 # $(am__mv) $$depbase.Tpo $$depbase.Po -
libcfa/src/Makefile.in
r341bb80 r6d44da1 19 19 20 20 21 VPATH = @srcdir@22 21 am__is_gnu_make = { \ 23 22 if test -z '$(MAKELEVEL)'; then \ … … 103 102 am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ 104 103 $(ACLOCAL_M4) 105 DIST_COMMON = $(srcdir)/Makefile.am $(nobase_cfa_include_HEADERS)\106 $(am__ DIST_COMMON)104 DIST_COMMON = $(srcdir)/Makefile.am \ 105 $(am__nobase_cfa_include_HEADERS_DIST) $(am__DIST_COMMON) 107 106 mkinstalldirs = $(install_sh) -d 108 107 CONFIG_CLEAN_FILES = … … 136 135 } 137 136 am__installdirs = "$(DESTDIR)$(libdir)" "$(DESTDIR)$(cfa_includedir)" 137 <<<<<<< HEAD 138 138 LTLIBRARIES = $(lib_LTLIBRARIES) 139 139 libcfa_la_LIBADD = … … 155 155 am__v_lt_0 = --silent 156 156 am__v_lt_1 = 157 ======= 158 LIBRARIES = $(lib_LIBRARIES) 159 AR = ar 160 AM_V_AR = $(am__v_AR_@AM_V@) 161 am__v_AR_ = $(am__v_AR_@AM_DEFAULT_V@) 162 am__v_AR_0 = @echo " AR " $@; 163 am__v_AR_1 = 164 libcfa_a_AR = $(AR) $(ARFLAGS) 165 libcfa_a_LIBADD = 166 am__libcfa_a_SOURCES_DIST = prelude.cfa startup.cfa interpose.cfa \ 167 bits/debug.cfa assert.cfa exception.c virtual.c heap.cfa \ 168 fstream.cfa iostream.cfa iterator.cfa limits.cfa rational.cfa \ 169 time.cfa stdlib.cfa common.cfa containers/maybe.cfa \ 170 containers/pair.cfa containers/result.cfa \ 171 containers/vector.cfa concurrency/coroutine.cfa \ 172 concurrency/thread.cfa concurrency/kernel.cfa \ 173 concurrency/monitor.cfa concurrency/mutex.cfa \ 174 concurrency/CtxSwitch-@ARCHITECTURE@.S concurrency/alarm.cfa \ 175 concurrency/invoke.c concurrency/preemption.cfa 176 am__dirstamp = $(am__leading_dot)dirstamp 177 @BUILDLIB_TRUE@am__objects_1 = fstream.$(OBJEXT) iostream.$(OBJEXT) \ 178 @BUILDLIB_TRUE@ iterator.$(OBJEXT) limits.$(OBJEXT) \ 179 @BUILDLIB_TRUE@ rational.$(OBJEXT) time.$(OBJEXT) \ 180 @BUILDLIB_TRUE@ stdlib.$(OBJEXT) common.$(OBJEXT) \ 181 @BUILDLIB_TRUE@ containers/maybe.$(OBJEXT) \ 182 @BUILDLIB_TRUE@ containers/pair.$(OBJEXT) \ 183 @BUILDLIB_TRUE@ containers/result.$(OBJEXT) \ 184 @BUILDLIB_TRUE@ containers/vector.$(OBJEXT) \ 185 @BUILDLIB_TRUE@ concurrency/coroutine.$(OBJEXT) \ 186 @BUILDLIB_TRUE@ concurrency/thread.$(OBJEXT) \ 187 @BUILDLIB_TRUE@ concurrency/kernel.$(OBJEXT) \ 188 @BUILDLIB_TRUE@ concurrency/monitor.$(OBJEXT) \ 189 @BUILDLIB_TRUE@ concurrency/mutex.$(OBJEXT) 190 @BUILDLIB_TRUE@am__objects_2 = startup.$(OBJEXT) interpose.$(OBJEXT) \ 191 @BUILDLIB_TRUE@ bits/debug.$(OBJEXT) assert.$(OBJEXT) \ 192 @BUILDLIB_TRUE@ exception.$(OBJEXT) virtual.$(OBJEXT) \ 193 @BUILDLIB_TRUE@ heap.$(OBJEXT) $(am__objects_1) \ 194 @BUILDLIB_TRUE@ concurrency/CtxSwitch-@ARCHITECTURE@.$(OBJEXT) \ 195 @BUILDLIB_TRUE@ concurrency/alarm.$(OBJEXT) \ 196 @BUILDLIB_TRUE@ concurrency/invoke.$(OBJEXT) \ 197 @BUILDLIB_TRUE@ concurrency/preemption.$(OBJEXT) 198 am_libcfa_a_OBJECTS = prelude.$(OBJEXT) $(am__objects_2) 199 libcfa_a_OBJECTS = $(am_libcfa_a_OBJECTS) 200 >>>>>>> master 157 201 AM_V_P = $(am__v_P_@AM_V@) 158 202 am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) … … 199 243 am__v_CCLD_0 = @echo " CCLD " $@; 200 244 am__v_CCLD_1 = 245 <<<<<<< HEAD 201 246 SOURCES = $(libcfa_la_SOURCES) 202 247 DIST_SOURCES = $(libcfa_la_SOURCES) 248 ======= 249 SOURCES = $(libcfa_a_SOURCES) 250 DIST_SOURCES = $(am__libcfa_a_SOURCES_DIST) 251 >>>>>>> master 203 252 am__can_run_installinfo = \ 204 253 case $$AM_UPDATE_INFO_DIR in \ … … 206 255 *) (install-info --version) >/dev/null 2>&1;; \ 207 256 esac 257 am__nobase_cfa_include_HEADERS_DIST = ${shell find ${srcdir}/stdhdr \ 258 -type f -printf "%p "} fstream.hfa iostream.hfa iterator.hfa \ 259 limits.hfa rational.hfa time.hfa stdlib.hfa common.hfa \ 260 containers/maybe.hfa containers/pair.hfa containers/result.hfa \ 261 containers/vector.hfa concurrency/coroutine.hfa \ 262 concurrency/thread.hfa concurrency/kernel.hfa \ 263 concurrency/monitor.hfa concurrency/mutex.hfa math.hfa gmp.hfa \ 264 time_t.hfa bits/align.hfa bits/containers.hfa bits/defs.hfa \ 265 bits/debug.hfa bits/locks.hfa concurrency/invoke.h 208 266 HEADERS = $(nobase_cfa_include_HEADERS) 209 267 am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) … … 229 287 $(top_srcdir)/automake/depcomp 230 288 DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) 289 VPATH = @srcdir@ :../prelude 231 290 ACLOCAL = @ACLOCAL@ 232 291 AMTAR = @AMTAR@ … … 253 312 CFLAGS = @CFLAGS@ 254 313 CONFIGURATION = @CONFIGURATION@ 314 CONFIG_BUILDLIB = @CONFIG_BUILDLIB@ 255 315 CONFIG_CFAFLAGS = @CONFIG_CFAFLAGS@ 256 316 CONFIG_CFLAGS = @CONFIG_CFLAGS@ … … 369 429 # create object files in directory with source files 370 430 AUTOMAKE_OPTIONS = foreign subdir-objects 431 <<<<<<< HEAD 371 432 ACLOCAL_AMFLAGS = -I automake 433 ======= 434 >>>>>>> master 372 435 ARFLAGS = cr 373 436 CFACOMPILE = $(CFACC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CFAFLAGS) $(CFAFLAGS) $(AM_CFLAGS) $(CFLAGS) … … 387 450 # use -no-include-stdhdr to prevent rebuild cycles 388 451 # The built sources must not depend on the installed headers 452 <<<<<<< HEAD 389 453 AM_CFAFLAGS = -quiet -in-tree -imacros prelude.c -I$(srcdir)/stdhdr @CONFIG_CFAFLAGS@ 390 454 AM_CFLAGS = -g -Wall -Wno-unused-function -fPIC @ARCH_FLAGS@ @CONFIG_CFLAGS@ 455 ======= 456 AM_CFAFLAGS = -quiet -in-tree -I$(srcdir)/stdhdr @CONFIG_CFAFLAGS@ 457 AM_CFLAGS = -g -Wall -Wno-unused-function @ARCH_FLAGS@ @CONFIG_CFLAGS@ 458 >>>>>>> master 391 459 AM_CCASFLAGS = -g -Wall -Wno-unused-function @ARCH_FLAGS@ @CONFIG_CFLAGS@ 460 @BUILDLIB_FALSE@headers = 392 461 393 462 #---------------------------------------------------------------------------------------------------------------- 394 463 395 464 # not all platforms support concurrency, add option do disable it 465 <<<<<<< HEAD 396 466 headers = fstream.hfa iostream.hfa iterator.hfa limits.hfa \ 397 467 rational.hfa time.hfa stdlib.hfa common.hfa \ … … 409 479 libcfa_la_SOURCES = ${libsrc} 410 480 stdhdr = $(shell find $(srcdir)/stdhdr -type f -printf "%p ") 481 ======= 482 @BUILDLIB_TRUE@headers = fstream.hfa iostream.hfa iterator.hfa \ 483 @BUILDLIB_TRUE@ limits.hfa rational.hfa time.hfa stdlib.hfa \ 484 @BUILDLIB_TRUE@ common.hfa containers/maybe.hfa \ 485 @BUILDLIB_TRUE@ containers/pair.hfa containers/result.hfa \ 486 @BUILDLIB_TRUE@ containers/vector.hfa concurrency/coroutine.hfa \ 487 @BUILDLIB_TRUE@ concurrency/thread.hfa concurrency/kernel.hfa \ 488 @BUILDLIB_TRUE@ concurrency/monitor.hfa concurrency/mutex.hfa 489 @BUILDLIB_FALSE@headers_nosrc = 490 @BUILDLIB_TRUE@headers_nosrc = math.hfa gmp.hfa time_t.hfa \ 491 @BUILDLIB_TRUE@ bits/align.hfa bits/containers.hfa \ 492 @BUILDLIB_TRUE@ bits/defs.hfa bits/debug.hfa bits/locks.hfa \ 493 @BUILDLIB_TRUE@ concurrency/invoke.h 494 @BUILDLIB_FALSE@libsrc = 495 496 # not all platforms support concurrency, add option do disable it 497 @BUILDLIB_TRUE@libsrc = startup.cfa interpose.cfa bits/debug.cfa \ 498 @BUILDLIB_TRUE@ assert.cfa exception.c virtual.c heap.cfa \ 499 @BUILDLIB_TRUE@ ${headers:.hfa=.cfa} \ 500 @BUILDLIB_TRUE@ concurrency/CtxSwitch-@ARCHITECTURE@.S \ 501 @BUILDLIB_TRUE@ concurrency/alarm.cfa concurrency/invoke.c \ 502 @BUILDLIB_TRUE@ concurrency/preemption.cfa 503 504 #---------------------------------------------------------------------------------------------------------------- 505 # add dependency to cfa-cpp so all libraries are rebuilt with new translator 506 #@CFACC@ @CFACPP@ prelude.cfa 507 508 # add dependency of cfa files 509 libobjs = $(addsuffix .o, $(basename $(filter %.cfa,$(libsrc)))) 510 511 # .deps inclusion is not done automatically by automake for new languages 512 libdeps = $(join \ 513 $(addsuffix $(DEPDIR)/ , $(dir $(libobjs) ) ), \ 514 $(notdir ${libobjs:.o=.Po}) \ 515 ) 516 517 518 #---------------------------------------------------------------------------------------------------------------- 519 libcfa_a_SOURCES = prelude.cfa ${libsrc} 520 stdhdr = ${shell find ${srcdir}/stdhdr -type f -printf "%p "} 521 >>>>>>> master 411 522 cfa_includedir = $(CFA_INCDIR) 412 nobase_cfa_include_HEADERS = \ 413 ${headers} \ 414 ${stdhdr} \ 415 math.hfa \ 416 gmp.hfa \ 417 time_t.hfa \ 418 bits/align.hfa \ 419 bits/containers.hfa \ 420 bits/defs.hfa \ 421 bits/debug.hfa \ 422 bits/locks.hfa \ 423 concurrency/invoke.h 424 425 MOSTLYCLEANFILES = prelude.c 523 nobase_cfa_include_HEADERS = ${stdhdr} ${headers} ${headers_nosrc} 426 524 all: all-am 427 525 … … 554 652 -rm -f *.tab.c 555 653 654 <<<<<<< HEAD 556 655 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/exception.Plo@am__quote@ 557 656 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/prelude.Plo@am__quote@ … … 559 658 @AMDEP_TRUE@@am__include@ @am__quote@concurrency/$(DEPDIR)/CtxSwitch-@ARCHITECTURE@.Plo@am__quote@ 560 659 @AMDEP_TRUE@@am__include@ @am__quote@concurrency/$(DEPDIR)/invoke.Plo@am__quote@ 660 ======= 661 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/exception.Po@am__quote@ 662 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/virtual.Po@am__quote@ 663 @AMDEP_TRUE@@am__include@ @am__quote@concurrency/$(DEPDIR)/CtxSwitch-@ARCHITECTURE@.Po@am__quote@ 664 @AMDEP_TRUE@@am__include@ @am__quote@concurrency/$(DEPDIR)/invoke.Po@am__quote@ 665 >>>>>>> master 561 666 562 667 .S.o: … … 750 855 fi 751 856 mostlyclean-generic: 752 -test -z "$(MOSTLYCLEANFILES)" || rm -f $(MOSTLYCLEANFILES)753 857 754 858 clean-generic: … … 861 965 862 966 863 .cfa.o: $(CFACC) $(CFACPP)967 .cfa.o: 864 968 $(AM_V_CFA)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.o$$||'`;\ 865 969 $(CFACOMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\ 866 970 $(am__mv) $$depbase.Tpo $$depbase.Po 867 971 $(libobjs) : @CFACC@ @CFACPP@ prelude.cfa 972 973 <<<<<<< HEAD 868 974 .cfa.lo: 869 975 $(AM_V_CFA)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.lo$$||'`;\ … … 874 980 # add dependency to cfa-cpp so all libraries are rebuilt with new translator 875 981 ${libobjs} : ${cfalib_DATA} 982 ======= 983 -include $(libdeps) 984 985 prelude.o : prelude.cfa extras.cf gcc-builtins.cf builtins.cf @CFACC@ @CFACPP@ 986 ${AM_V_GEN}@CFACC@ ${AM_CFLAGS} ${CFLAGS} -quiet -in-tree -XCFA -l ${<} -c -o ${@} 987 >>>>>>> master 876 988 877 989 #---------------------------------------------------------------------------------------------------------------- … … 879 991 -rm -rf ${CFA_INCDIR} ${CFA_LIBDIR} 880 992 993 # $(AM_V_CFA)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.o$$||'`;\ 994 # $(CFACOMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\ 995 # $(am__mv) $$depbase.Tpo $$depbase.Po 996 881 997 # Tell versions [3.59,3.63) of GNU make to not export all variables. 882 998 # Otherwise a system limit (for SysV at least) may be exceeded. -
libcfa/src/heap.cfa
r341bb80 r6d44da1 1 // #comment TD : this file uses both spaces and tabs for indentation2 3 1 // 4 2 // Cforall Version 1.0.0 Copyright (C) 2017 University of Waterloo … … 12 10 // Created On : Tue Dec 19 21:58:35 2017 13 11 // Last Modified By : Peter A. Buhr 14 // Last Modified On : Sat Aug 11 08:22:16201815 // Update Count : 49512 // Last Modified On : Thu Sep 6 09:01:30 2018 13 // Update Count : 513 16 14 // 17 15 … … 25 23 26 24 // #comment TD : Many of these should be merged into math I believe 27 #include "bits/align.hfa" 28 #include "bits/defs.hfa" 29 #include "bits/locks.hfa" 25 #include "bits/align.hfa" // libPow2 26 #include "bits/defs.hfa" // likely, unlikely 27 #include "bits/locks.hfa" // __spinlock_t 30 28 #include "startup.hfa" // STARTUP_PRIORITY_MEMORY 31 #include "stdlib.hfa" 29 #include "stdlib.hfa" // bsearchl 32 30 #include "malloc.h" 33 31 … … 151 149 152 150 extern "C" { 153 void heapAppStart() {// called by __cfaabi_appready_startup154 allocFree = 0;155 } // heapAppStart156 157 void heapAppStop() {// called by __cfaabi_appready_startdown158 fclose( stdin ); fclose( stdout );159 checkUnfreed();160 } // heapAppStop151 void heapAppStart() { // called by __cfaabi_appready_startup 152 allocFree = 0; 153 } // heapAppStart 154 155 void heapAppStop() { // called by __cfaabi_appready_startdown 156 fclose( stdin ); fclose( stdout ); 157 checkUnfreed(); 158 } // heapAppStop 161 159 } // extern "C" 162 160 #endif // __CFA_DEBUG__ … … 167 165 168 166 struct Storage { 169 167 struct Header { // header 170 168 union Kind { 171 169 struct RealHeader { 172 170 union { 173 // #comment TD : this code use byte size but the comment uses bit size 174 175 struct { // 32-bit word => 64-bit header, 64-bit word => 128-bit header 171 struct { // 4-byte word => 8-byte header, 8-byte word => 16-byte header 176 172 #if __BYTE_ORDER__ == __ORDER_BIG_ENDIAN__ && __SIZEOF_POINTER__ == 4 177 173 uint32_t padding; // unused, force home/blocksize to overlay alignment in fake header 178 #endif // __ ORDER_BIG_ENDIAN__ && __U_WORDSIZE__ == 32174 #endif // __BYTE_ORDER__ == __ORDER_BIG_ENDIAN__ && __SIZEOF_POINTER__ == 4 179 175 180 176 union { … … 189 185 #if __BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__ && __SIZEOF_POINTER__ == 4 190 186 uint32_t padding; // unused, force home/blocksize to overlay alignment in fake header 191 #endif // __ORDER_LITTLE_ENDIAN__ && __U_WORDSIZE__ == 32 192 187 #endif // __BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__ && __SIZEOF_POINTER__ == 4 193 188 }; 194 195 // #comment TD : C++ code 189 // future code 196 190 #if BUCKLOCK == LOCKFREE 197 191 Stack<Storage>::Link next; // freed block points next freed block of same size (double-wide) … … 211 205 } fake; // FakeHeader 212 206 } kind; // Kind 213 214 215 207 } header; // Header 208 char pad[ALIGN - sizeof( Header )]; 209 char data[0]; // storage 216 210 }; // Storage 217 211 … … 220 214 struct FreeHeader { 221 215 #if BUCKLOCK == SPINLOCK 222 223 216 __spinlock_t lock; // must be first field for alignment 217 Storage * freeList; 224 218 #elif BUCKLOCK == LOCKFREE 225 // #comment TD : C++code226 219 // future code 220 StackLF<Storage> freeList; 227 221 #else 228 222 #error undefined lock type for bucket lock 229 223 #endif // SPINLOCK 230 224 size_t blockSize; // size of allocations on this list 231 225 }; // FreeHeader 232 226 … … 249 243 static unsigned int maxBucketsUsed; // maximum number of buckets in use 250 244 251 // #comment TD : This array is not const but it feels like it should be252 245 // Powers of 2 are common allocation sizes, so make powers of 2 generate the minimum required size. 253 static unsigned int bucketSizes[NoBucketSizes] @= {// different bucket sizes246 static const unsigned int bucketSizes[NoBucketSizes] @= { // different bucket sizes 254 247 16, 32, 48, 64, 255 248 64 + sizeof(HeapManager.Storage), 96, 112, 128, 128 + sizeof(HeapManager.Storage), 160, 192, 224, … … 279 272 // #comment TD : The return type of this function should be commented 280 273 static inline bool setMmapStart( size_t value ) { 281 274 if ( value < pageSize || bucketSizes[NoBucketSizes - 1] < value ) return true; 282 275 mmapStart = value; // set global 283 276 … … 313 306 sbrk( (char *)libCeiling( (long unsigned int)End, libAlign() ) - End ); // move start of heap to multiple of alignment 314 307 heapBegin = heapEnd = sbrk( 0 ); // get new start point 315 } // HeapManager308 } // HeapManager 316 309 317 310 … … 323 316 // } // if 324 317 #endif // __STATISTICS__ 325 } // ~HeapManager318 } // ~HeapManager 326 319 327 320 … … 329 322 void memory_startup( void ) { 330 323 #ifdef __CFA_DEBUG__ 331 if ( unlikely( heapBoot ) ) { // check for recursion during system boot324 if ( unlikely( heapBoot ) ) { // check for recursion during system boot 332 325 // DO NOT USE STREAMS AS THEY MAY BE UNAVAILABLE AT THIS POINT. 333 326 abort( "boot() : internal error, recursively invoked during system boot." ); … … 336 329 #endif // __CFA_DEBUG__ 337 330 338 // #comment TD : This assertion seems redundent with the above code339 assert( heapManager.heapBegin == 0 );340 heapManager{};331 //assert( heapManager.heapBegin != 0 ); 332 //heapManager{}; 333 if ( heapManager.heapBegin == 0 ) heapManager{}; 341 334 } // memory_startup 342 335 … … 374 367 char helpText[512]; 375 368 __cfaabi_dbg_bits_print_buffer( helpText, sizeof(helpText), 376 "\nHeap statistics:\n"377 " malloc: calls %u / storage %llu\n"378 " calloc: calls %u / storage %llu\n"379 " memalign: calls %u / storage %llu\n"380 " cmemalign: calls %u / storage %llu\n"381 " realloc: calls %u / storage %llu\n"382 " free: calls %u / storage %llu\n"383 " mmap: calls %u / storage %llu\n"384 " munmap: calls %u / storage %llu\n"385 " sbrk: calls %u / storage %llu\n",386 malloc_calls, malloc_storage,387 calloc_calls, calloc_storage,388 memalign_calls, memalign_storage,389 cmemalign_calls, cmemalign_storage,390 realloc_calls, realloc_storage,391 free_calls, free_storage,392 mmap_calls, mmap_storage,393 munmap_calls, munmap_storage,394 sbrk_calls, sbrk_storage369 "\nHeap statistics:\n" 370 " malloc: calls %u / storage %llu\n" 371 " calloc: calls %u / storage %llu\n" 372 " memalign: calls %u / storage %llu\n" 373 " cmemalign: calls %u / storage %llu\n" 374 " realloc: calls %u / storage %llu\n" 375 " free: calls %u / storage %llu\n" 376 " mmap: calls %u / storage %llu\n" 377 " munmap: calls %u / storage %llu\n" 378 " sbrk: calls %u / storage %llu\n", 379 malloc_calls, malloc_storage, 380 calloc_calls, calloc_storage, 381 memalign_calls, memalign_storage, 382 cmemalign_calls, cmemalign_storage, 383 realloc_calls, realloc_storage, 384 free_calls, free_storage, 385 mmap_calls, mmap_storage, 386 munmap_calls, munmap_storage, 387 sbrk_calls, sbrk_storage 395 388 ); 396 389 } // printStats 397 390 398 // #comment TD : Why do we have this? 399 static int printStatsXML( FILE * stream ) { 391 static int printStatsXML( FILE * stream ) { // see malloc_info 400 392 char helpText[512]; 401 393 int len = snprintf( helpText, sizeof(helpText), … … 431 423 static inline void noMemory() { 432 424 abort( "Heap memory exhausted at %zu bytes.\n" 433 434 425 "Possible cause is very large memory allocation and/or large amount of unfreed storage allocated by the program or system/library routines.", 426 ((char *)(sbrk( 0 )) - (char *)(heapManager.heapBegin)) ); 435 427 } // noMemory 436 428 … … 444 436 445 437 static inline bool setHeapExpand( size_t value ) { 446 438 if ( heapExpand < pageSize ) return true; 447 439 heapExpand = value; 448 440 return false; … … 453 445 if ( unlikely( check ) ) { // bad address ? 454 446 abort( "Attempt to %s storage %p with address outside the heap.\n" 455 456 447 "Possible cause is duplicate free on same block or overwriting of memory.", 448 name, addr ); 457 449 } // if 458 450 } // checkHeader … … 484 476 485 477 #ifdef __CFA_DEBUG__ 486 478 checkHeader( addr < heapBegin || header < (HeapManager.Storage.Header *)heapBegin, name, addr ); // bad low address ? 487 479 #endif // __CFA_DEBUG__ 488 480 … … 490 482 // It's called as the first statement of both branches of the last if, with the same parameters in all cases 491 483 492 493 484 // header may be safe to dereference 485 fakeHeader( header, size, alignment ); 494 486 #ifdef __CFA_DEBUG__ 495 487 checkHeader( header < (HeapManager.Storage.Header *)heapBegin || (HeapManager.Storage.Header *)heapEnd < header, name, addr ); // bad address ? (offset could be + or -) 496 488 #endif // __CFA_DEBUG__ 497 489 498 490 freeElem = (HeapManager.FreeHeader *)((size_t)header->kind.real.home & -3); 499 491 #ifdef __CFA_DEBUG__ 500 501 502 503 504 492 if ( freeElem < &freeLists[0] || &freeLists[NoBucketSizes] <= freeElem ) { 493 abort( "Attempt to %s storage %p with corrupted header.\n" 494 "Possible cause is duplicate free on same block or overwriting of header information.", 495 name, addr ); 496 } // if 505 497 #endif // __CFA_DEBUG__ 506 507 498 size = freeElem->blockSize; 499 return false; 508 500 } // headers 509 501 … … 521 513 return 0; 522 514 } // if 523 #ifdef __STATISTICS__515 #ifdef __STATISTICS__ 524 516 sbrk_calls += 1; 525 517 sbrk_storage += increase; 526 #endif // __STATISTICS__527 #ifdef __CFA_DEBUG__518 #endif // __STATISTICS__ 519 #ifdef __CFA_DEBUG__ 528 520 // Set new memory to garbage so subsequent uninitialized usages might fail. 529 521 memset( (char *)heapEnd + heapRemaining, '\377', increase ); 530 #endif // __CFA_DEBUG__522 #endif // __CFA_DEBUG__ 531 523 rem = heapRemaining + increase - size; 532 524 } // if … … 560 552 561 553 #if defined( SPINLOCK ) 562 563 554 lock( freeElem->lock __cfaabi_dbg_ctx2 ); 555 block = freeElem->freeList; // remove node from stack 564 556 #else 565 557 block = freeElem->freeList.pop(); 566 558 #endif // SPINLOCK 567 559 if ( unlikely( block == 0 ) ) { // no free block ? … … 569 561 unlock( freeElem->lock ); 570 562 #endif // SPINLOCK 563 571 564 // Freelist for that size was empty, so carve it out of the heap if there's enough left, or get some more 572 565 // and then carve it off. 573 566 574 567 block = (HeapManager.Storage *)extend( tsize ); // mutual exclusion on call 575 568 if ( unlikely( block == 0 ) ) return 0; 576 569 #if defined( SPINLOCK ) 577 570 } else { … … 582 575 583 576 block->header.kind.real.home = freeElem; // pointer back to free list of apropriate size 584 577 } else { // large size => mmap 585 578 tsize = libCeiling( tsize, pageSize ); // must be multiple of page size 586 579 #ifdef __STATISTICS__ 587 588 580 __atomic_add_fetch( &mmap_calls, 1, __ATOMIC_SEQ_CST ); 581 __atomic_add_fetch( &mmap_storage, tsize, __ATOMIC_SEQ_CST ); 589 582 #endif // __STATISTICS__ 590 583 block = (HeapManager.Storage *)mmap( 0, tsize, PROT_READ | PROT_WRITE, MAP_PRIVATE | MAP_ANONYMOUS, mmapFd, 0 ); … … 593 586 abort( "(HeapManager &)0x%p.doMalloc() : internal error, mmap failure, size:%zu error:%d.", &heapManager, tsize, errno ); 594 587 } // if 595 #ifdef __CFA_DEBUG__588 #ifdef __CFA_DEBUG__ 596 589 // Set new memory to garbage so subsequent uninitialized usages might fail. 597 590 memset( block, '\377', tsize ); 598 #endif // __CFA_DEBUG__591 #endif // __CFA_DEBUG__ 599 592 block->header.kind.real.blockSize = tsize; // storage size for munmap 600 601 602 593 } // if 594 595 void * area = &(block->data); // adjust off header to user bytes 603 596 604 597 #ifdef __CFA_DEBUG__ 605 606 607 608 609 610 611 612 613 598 assert( ((uintptr_t)area & (libAlign() - 1)) == 0 ); // minimum alignment ? 599 __atomic_add_fetch( &allocFree, tsize, __ATOMIC_SEQ_CST ); 600 if ( traceHeap() ) { 601 enum { BufferSize = 64 }; 602 char helpText[BufferSize]; 603 int len = snprintf( helpText, BufferSize, "%p = Malloc( %zu ) (allocated %zu)\n", area, size, tsize ); 604 // int len = snprintf( helpText, BufferSize, "Malloc %p %zu\n", area, size ); 605 __cfaabi_dbg_bits_write( helpText, len ); 606 } // if 614 607 #endif // __CFA_DEBUG__ 615 608 … … 620 613 static inline void doFree( void * addr ) with ( heapManager ) { 621 614 #ifdef __CFA_DEBUG__ 622 623 624 615 if ( unlikely( heapManager.heapBegin == 0 ) ) { 616 abort( "doFree( %p ) : internal error, called before heap is initialized.", addr ); 617 } // if 625 618 #endif // __CFA_DEBUG__ 626 619 … … 631 624 if ( headers( "free", addr, header, freeElem, size, alignment ) ) { // mmapped ? 632 625 #ifdef __STATISTICS__ 633 634 626 __atomic_add_fetch( &munmap_calls, 1, __ATOMIC_SEQ_CST ); 627 __atomic_add_fetch( &munmap_storage, size, __ATOMIC_SEQ_CST ); 635 628 #endif // __STATISTICS__ 636 629 if ( munmap( header, size ) == -1 ) { 637 630 #ifdef __CFA_DEBUG__ 638 631 abort( "Attempt to deallocate storage %p not allocated or with corrupt header.\n" 639 640 632 "Possible cause is invalid pointer.", 633 addr ); 641 634 #endif // __CFA_DEBUG__ 642 635 } // if 643 636 } else { 644 637 #ifdef __CFA_DEBUG__ 645 646 638 // Set free memory to garbage so subsequent usages might fail. 639 memset( ((HeapManager.Storage *)header)->data, '\377', freeElem->blockSize - sizeof( HeapManager.Storage ) ); 647 640 #endif // __CFA_DEBUG__ 648 641 649 642 #ifdef __STATISTICS__ 650 643 free_storage += size; 651 644 #endif // __STATISTICS__ 652 645 #if defined( SPINLOCK ) 653 654 655 656 646 lock( freeElem->lock __cfaabi_dbg_ctx2 ); // acquire spin lock 647 header->kind.real.next = freeElem->freeList; // push on stack 648 freeElem->freeList = (HeapManager.Storage *)header; 649 unlock( freeElem->lock ); // release spin lock 657 650 #else 658 651 freeElem->freeList.push( *(HeapManager.Storage *)header ); 659 652 #endif // SPINLOCK 660 653 } // if 661 654 662 655 #ifdef __CFA_DEBUG__ 663 664 665 666 667 668 656 __atomic_add_fetch( &allocFree, -size, __ATOMIC_SEQ_CST ); 657 if ( traceHeap() ) { 658 char helpText[64]; 659 int len = snprintf( helpText, sizeof(helpText), "Free( %p ) size:%zu\n", addr, size ); 660 __cfaabi_dbg_bits_write( helpText, len ); 661 } // if 669 662 #endif // __CFA_DEBUG__ 670 663 } // doFree … … 674 667 size_t total = 0; 675 668 #ifdef __STATISTICS__ 676 677 669 __cfaabi_dbg_bits_acquire(); 670 __cfaabi_dbg_bits_print_nolock( "\nBin lists (bin size : free blocks on list)\n" ); 678 671 #endif // __STATISTICS__ 679 672 for ( unsigned int i = 0; i < maxBucketsUsed; i += 1 ) { … … 695 688 696 689 #ifdef __STATISTICS__ 697 698 690 __cfaabi_dbg_bits_print_nolock( "%7zu, %-7u ", size, N ); 691 if ( (i + 1) % 8 == 0 ) __cfaabi_dbg_bits_print_nolock( "\n" ); 699 692 #endif // __STATISTICS__ 700 693 } // for 701 694 #ifdef __STATISTICS__ 702 703 695 __cfaabi_dbg_bits_print_nolock( "\ntotal free blocks:%zu\n", total ); 696 __cfaabi_dbg_bits_release(); 704 697 #endif // __STATISTICS__ 705 698 return (char *)heapEnd - (char *)heapBegin - total; 706 699 } // checkFree 707 700 708 // #comment TD : This is not a good name, plus this feels like it could easily be folded into doMalloc 709 static inline void * malloc2( size_t size ) { // necessary for malloc statistics 710 assert( heapManager.heapBegin != 0 ); 701 702 static inline void * mallocNoStats( size_t size ) { // necessary for malloc statistics 703 //assert( heapManager.heapBegin != 0 ); 704 if ( unlikely( heapManager.heapBegin == 0 ) ) heapManager{}; // called before memory_startup ? 711 705 void * area = doMalloc( size ); 712 706 if ( unlikely( area == 0 ) ) errno = ENOMEM; // POSIX 713 707 return area; 714 } // malloc 2715 716 717 static inline void * memalign 2( size_t alignment, size_t size ) { // necessary for malloc statistics718 #ifdef __CFA_DEBUG__708 } // mallocNoStats 709 710 711 static inline void * memalignNoStats( size_t alignment, size_t size ) { // necessary for malloc statistics 712 #ifdef __CFA_DEBUG__ 719 713 checkAlign( alignment ); // check alignment 720 #endif // __CFA_DEBUG__714 #endif // __CFA_DEBUG__ 721 715 722 716 // if alignment <= default alignment, do normal malloc as two headers are unnecessary 723 if ( unlikely( alignment <= libAlign() ) ) return malloc2( size );717 if ( unlikely( alignment <= libAlign() ) ) return mallocNoStats( size ); 724 718 725 719 // Allocate enough storage to guarantee an address on the alignment boundary, and sufficient space before it for … … 732 726 // subtract libAlign() because it is already the minimum alignment 733 727 // add sizeof(Storage) for fake header 734 // #comment TD : this is the only place that calls doMalloc without calling malloc 2, why ?728 // #comment TD : this is the only place that calls doMalloc without calling mallocNoStats, why ? 735 729 char * area = (char *)doMalloc( size + alignment - libAlign() + sizeof(HeapManager.Storage) ); 736 730 if ( unlikely( area == 0 ) ) return area; 737 731 738 732 // address in the block of the "next" alignment address … … 749 743 750 744 return user; 751 } // memalign 2745 } // memalignNoStats 752 746 753 747 754 748 extern "C" { 755 // The malloc() function allocates size bytes and returns a pointer to the 756 // allocated memory. The memory is not initialized. If size is 0, then malloc() 757 // returns either NULL, or a unique pointer value that can later be successfully 758 // passed to free(). 749 // The malloc() function allocates size bytes and returns a pointer to the allocated memory. The memory is not 750 // initialized. If size is 0, then malloc() returns either NULL, or a unique pointer value that can later be 751 // successfully passed to free(). 759 752 void * malloc( size_t size ) { 760 753 #ifdef __STATISTICS__ 761 __atomic_add_fetch( &malloc_calls, 1, __ATOMIC_SEQ_CST ); 762 __atomic_add_fetch( &malloc_storage, size, __ATOMIC_SEQ_CST ); 763 #endif // __STATISTICS__ 764 765 return malloc2( size ); 766 } // malloc 767 768 // The calloc() function allocates memory for an array of nmemb elements of 769 // size bytes each and returns a pointer to the allocated memory. The memory 770 // is set to zero. If nmemb or size is 0, then calloc() returns either NULL, 771 // or a unique pointer value that can later be successfully passed to free(). 772 void * calloc( size_t noOfElems, size_t elemSize ) { 754 __atomic_add_fetch( &malloc_calls, 1, __ATOMIC_SEQ_CST ); 755 __atomic_add_fetch( &malloc_storage, size, __ATOMIC_SEQ_CST ); 756 #endif // __STATISTICS__ 757 758 return mallocNoStats( size ); 759 } // malloc 760 761 // The calloc() function allocates memory for an array of nmemb elements of size bytes each and returns a pointer to 762 // the allocated memory. The memory is set to zero. If nmemb or size is 0, then calloc() returns either NULL, or a 763 // unique pointer value that can later be successfully passed to free(). 764 void * calloc( size_t noOfElems, size_t elemSize ) { 773 765 size_t size = noOfElems * elemSize; 774 766 #ifdef __STATISTICS__ 775 776 777 #endif // __STATISTICS__ 778 779 char * area = (char *)malloc 2( size );780 767 __atomic_add_fetch( &calloc_calls, 1, __ATOMIC_SEQ_CST ); 768 __atomic_add_fetch( &calloc_storage, size, __ATOMIC_SEQ_CST ); 769 #endif // __STATISTICS__ 770 771 char * area = (char *)mallocNoStats( size ); 772 if ( unlikely( area == 0 ) ) return 0; 781 773 782 774 HeapManager.Storage.Header * header; … … 790 782 memset( area, '\0', asize - sizeof(HeapManager.Storage) ); // set to zeros 791 783 792 header->kind.real.blockSize |= 2; // mark as zero filled784 header->kind.real.blockSize |= 2; // mark as zero filled 793 785 return area; 794 786 } // calloc 795 787 796 788 // #comment TD : Document this function … … 798 790 size_t size = noOfElems * elemSize; 799 791 #ifdef __STATISTICS__ 800 801 802 #endif // __STATISTICS__ 803 804 char * area = (char *)memalign 2( alignment, size );805 792 __atomic_add_fetch( &cmemalign_calls, 1, __ATOMIC_SEQ_CST ); 793 __atomic_add_fetch( &cmemalign_storage, size, __ATOMIC_SEQ_CST ); 794 #endif // __STATISTICS__ 795 796 char * area = (char *)memalignNoStats( alignment, size ); 797 if ( unlikely( area == 0 ) ) return 0; 806 798 HeapManager.Storage.Header * header; 807 799 HeapManager.FreeHeader * freeElem; … … 811 803 // Mapped storage is zero filled, but in debug mode mapped memory is scrubbed in doMalloc, so it has to be reset to zero. 812 804 if ( ! mapped ) 813 #endif // __CFA_DEBUG__805 #endif // __CFA_DEBUG__ 814 806 memset( area, '\0', asize - ( (char *)area - (char *)header ) ); // set to zeros 815 807 header->kind.real.blockSize |= 2; // mark as zero filled 816 808 817 809 return area; 818 } // cmemalign 819 820 // The realloc() function changes the size of the memory block pointed to by 821 // ptr to size bytes. The contents will be unchanged in the range from the 822 // start of the region up to the minimum of the old and new sizes. If the new 823 // size is larger than the old size, the added memory will not be initialized. 824 // If ptr is NULL, then the call is equivalent to malloc(size), for all values 825 // of size; if size is equal to zero, and ptr is not NULL, then the call is 826 // equivalent to free(ptr). Unless ptr is NULL, it must have been returned by 827 // an earlier call to malloc(), calloc() or realloc(). If the area pointed to 828 // was moved, a free(ptr) is done. 829 void * realloc( void * addr, size_t size ) { 830 #ifdef __STATISTICS__ 831 __atomic_add_fetch( &realloc_calls, 1, __ATOMIC_SEQ_CST ); 832 #endif // __STATISTICS__ 833 834 if ( unlikely( addr == 0 ) ) return malloc2( size ); // special cases 835 if ( unlikely( size == 0 ) ) { free( addr ); return 0; } 810 } // cmemalign 811 812 // The realloc() function changes the size of the memory block pointed to by ptr to size bytes. The contents will be 813 // unchanged in the range from the start of the region up to the minimum of the old and new sizes. If the new size 814 // is larger than the old size, the added memory will not be initialized. If ptr is NULL, then the call is 815 // equivalent to malloc(size), for all values of size; if size is equal to zero, and ptr is not NULL, then the call 816 // is equivalent to free(ptr). Unless ptr is NULL, it must have been returned by an earlier call to malloc(), 817 // calloc() or realloc(). If the area pointed to was moved, a free(ptr) is done. 818 void * realloc( void * addr, size_t size ) { 819 #ifdef __STATISTICS__ 820 __atomic_add_fetch( &realloc_calls, 1, __ATOMIC_SEQ_CST ); 821 #endif // __STATISTICS__ 822 823 if ( unlikely( addr == 0 ) ) return mallocNoStats( size ); // special cases 824 if ( unlikely( size == 0 ) ) { free( addr ); return 0; } 836 825 837 826 HeapManager.Storage.Header * header; … … 848 837 849 838 #ifdef __STATISTICS__ 850 839 __atomic_add_fetch( &realloc_storage, size, __ATOMIC_SEQ_CST ); 851 840 #endif // __STATISTICS__ 852 841 … … 855 844 area = memalign( alignment, size ); // create new area 856 845 } else { 857 area = malloc 2( size );// create new area846 area = mallocNoStats( size ); // create new area 858 847 } // if 859 848 if ( unlikely( area == 0 ) ) return 0; 860 849 if ( unlikely( header->kind.real.blockSize & 2 ) ) { // previous request zero fill (calloc/cmemalign) ? 861 850 assert( (header->kind.real.blockSize & 1) == 0 ); … … 864 853 // Mapped storage is zero filled, but in debug mode mapped memory is scrubbed in doMalloc, so it has to be reset to zero. 865 854 if ( ! mapped ) 866 #endif // __CFA_DEBUG__855 #endif // __CFA_DEBUG__ 867 856 memset( (char *)area + usize, '\0', asize - ( (char *)area - (char *)header ) - usize ); // zero-fill back part 868 857 header->kind.real.blockSize |= 2; // mark new request as zero fill … … 874 863 875 864 876 // The obsolete function memalign() allocates size bytes and returns 877 // a pointer to the allocated memory. The memory address will be a 878 // multiple of alignment, which must be a power of two. 879 void * memalign( size_t alignment, size_t size ) __attribute__ ((deprecated)); 880 void * memalign( size_t alignment, size_t size ) { 865 // The obsolete function memalign() allocates size bytes and returns a pointer to the allocated memory. The memory 866 // address will be a multiple of alignment, which must be a power of two. 867 void * memalign( size_t alignment, size_t size ) { 881 868 #ifdef __STATISTICS__ 882 869 __atomic_add_fetch( &memalign_calls, 1, __ATOMIC_SEQ_CST ); … … 884 871 #endif // __STATISTICS__ 885 872 886 void * area = memalign 2( alignment, size );873 void * area = memalignNoStats( alignment, size ); 887 874 888 875 return area; 889 890 891 // The function aligned_alloc() is the same as memalign(), except for 892 // the added restriction that size should be amultiple of alignment.876 } // memalign 877 878 // The function aligned_alloc() is the same as memalign(), except for the added restriction that size should be a 879 // multiple of alignment. 893 880 void * aligned_alloc( size_t alignment, size_t size ) { 894 881 return memalign( alignment, size ); … … 896 883 897 884 898 // The function posix_memalign() allocates size bytes and places the address 899 // of the allocated memory in *memptr. The address of the allocated memory 900 // will be a multiple of alignment, which must be a power of two and a multiple 901 // of sizeof(void *). If size is 0, then posix_memalign() returns either NULL, 902 // or a unique pointer value that can later be successfully passed to free(3). 885 // The function posix_memalign() allocates size bytes and places the address of the allocated memory in *memptr. The 886 // address of the allocated memory will be a multiple of alignment, which must be a power of two and a multiple of 887 // sizeof(void *). If size is 0, then posix_memalign() returns either NULL, or a unique pointer value that can later 888 // be successfully passed to free(3). 903 889 int posix_memalign( void ** memptr, size_t alignment, size_t size ) { 904 890 if ( alignment < sizeof(void *) || ! libPow2( alignment ) ) return EINVAL; // check alignment 905 891 * memptr = memalign( alignment, size ); 906 892 if ( unlikely( * memptr == 0 ) ) return ENOMEM; 907 893 return 0; 908 894 } // posix_memalign 909 895 910 // The obsolete function valloc() allocates size bytes and returns a pointer 911 // to the allocated memory. The memory address will be a multiple of the page size. 912 // It is equivalent to memalign(sysconf(_SC_PAGESIZE),size). 913 void * valloc( size_t size ) __attribute__ ((deprecated)); 896 // The obsolete function valloc() allocates size bytes and returns a pointer to the allocated memory. The memory 897 // address will be a multiple of the page size. It is equivalent to memalign(sysconf(_SC_PAGESIZE),size). 914 898 void * valloc( size_t size ) { 915 899 return memalign( pageSize, size ); … … 917 901 918 902 919 // The free() function frees the memory space pointed to by ptr, which must 920 // have been returned by a previous call to malloc(), calloc() or realloc(). 921 // Otherwise, or if free(ptr) has already been called before, undefined 922 // behavior occurs. If ptr is NULL, no operation is performed. 903 // The free() function frees the memory space pointed to by ptr, which must have been returned by a previous call to 904 // malloc(), calloc() or realloc(). Otherwise, or if free(ptr) has already been called before, undefined behavior 905 // occurs. If ptr is NULL, no operation is performed. 923 906 void free( void * addr ) { 924 907 #ifdef __STATISTICS__ 925 908 __atomic_add_fetch( &free_calls, 1, __ATOMIC_SEQ_CST ); 926 909 #endif // __STATISTICS__ 927 910 … … 931 914 if ( unlikely( addr == 0 ) ) { // special case 932 915 #ifdef __CFA_DEBUG__ 933 934 935 936 937 916 if ( traceHeap() ) { 917 #define nullmsg "Free( 0x0 ) size:0\n" 918 // Do not debug print free( 0 ), as it can cause recursive entry from sprintf. 919 __cfaabi_dbg_bits_write( nullmsg, sizeof(nullmsg) - 1 ); 920 } // if 938 921 #endif // __CFA_DEBUG__ 939 922 return; … … 943 926 } // free 944 927 945 // The mallopt() function adjusts parameters that control the behavior of the 946 // memory-allocation functions (see malloc(3)). The param argument specifies 947 // the parameter to be modified, and value specifies the new value for that 928 // The mallopt() function adjusts parameters that control the behavior of the memory-allocation functions (see 929 // malloc(3)). The param argument specifies the parameter to be modified, and value specifies the new value for that 948 930 // parameter. 949 931 int mallopt( int option, int value ) { 950 932 choose( option ) { 951 952 953 954 955 956 957 933 case M_TOP_PAD: 934 if ( setHeapExpand( value ) ) fallthru default; 935 case M_MMAP_THRESHOLD: 936 if ( setMmapStart( value ) ) fallthru default; 937 default: 938 // #comment TD : 1 for unsopported feels wrong 939 return 1; // success, or unsupported 958 940 } // switch 959 941 return 0; // error 960 942 } // mallopt 961 943 962 // The malloc_trim() function attempts to release free memory at the top 963 // of the heap (by calling sbrk(2) with asuitable argument).944 // The malloc_trim() function attempts to release free memory at the top of the heap (by calling sbrk(2) with a 945 // suitable argument). 964 946 int malloc_trim( size_t ) { 965 947 return 0; // => impossible to release memory 966 948 } // malloc_trim 967 949 968 // The malloc_usable_size() function returns the number of usable bytes in the 969 // block pointed to by ptr, a pointer to a block of memory allocated by 970 // malloc(3) or a related function. 971 size_t malloc_usable_size( void * addr ) { 972 if ( unlikely( addr == 0 ) ) return 0; // null allocation has 0 size 950 // The malloc_usable_size() function returns the number of usable bytes in the block pointed to by ptr, a pointer to 951 // a block of memory allocated by malloc(3) or a related function. 952 size_t malloc_usable_size( void * addr ) { 953 if ( unlikely( addr == 0 ) ) return 0; // null allocation has 0 size 973 954 974 955 HeapManager.Storage.Header * header; … … 982 963 983 964 984 // #comment TD : Document this function 965 // The malloc_alignment() function returns the alignment of the allocation. 985 966 size_t malloc_alignment( void * addr ) { 986 967 if ( unlikely( addr == 0 ) ) return libAlign(); // minimum alignment 987 968 HeapManager.Storage.Header * header = (HeapManager.Storage.Header *)( (char *)addr - sizeof(HeapManager.Storage) ); 988 969 if ( (header->kind.fake.alignment & 1) == 1 ) { // fake header ? … … 991 972 return libAlign (); // minimum alignment 992 973 } // if 993 994 995 996 // #comment TD : Document this function 974 } // malloc_alignment 975 976 977 // The malloc_zero_fill() function returns true if the allocation is zero filled, i.e., initially allocated by calloc(). 997 978 bool malloc_zero_fill( void * addr ) { 998 979 if ( unlikely( addr == 0 ) ) return false; // null allocation is not zero fill 999 980 1000 981 HeapManager.Storage.Header * header = (HeapManager.Storage.Header *)( (char *)addr - sizeof(HeapManager.Storage) ); … … 1003 984 } // if 1004 985 return (header->kind.real.blockSize & 2) != 0; // zero filled (calloc/cmemalign) ? 1005 } // malloc_zero_fill 1006 1007 1008 // #comment TD : Document this function 986 } // malloc_zero_fill 987 988 989 // The malloc_stats() function prints (on default standard error) statistics about memory allocated by malloc(3) and 990 // related functions. 1009 991 void malloc_stats( void ) { 1010 992 #ifdef __STATISTICS__ 1011 1012 1013 #endif // __STATISTICS__ 1014 1015 1016 // #comment TD : Document this function1017 1018 #ifdef __STATISTICS__ 1019 1020 1021 993 printStats(); 994 if ( checkFree() ) checkFree( heapManager ); 995 #endif // __STATISTICS__ 996 } // malloc_stats 997 998 // The malloc_stats_fd() function changes the file descripter where malloc_stats() writes the statistics. 999 int malloc_stats_fd( int fd ) { 1000 #ifdef __STATISTICS__ 1001 int temp = statfd; 1002 statfd = fd; 1003 return temp; 1022 1004 #else 1023 return -1; 1024 #endif // __STATISTICS__ 1025 } // malloc_stats_fd 1026 1027 1028 // #comment TD : Document this function 1005 return -1; 1006 #endif // __STATISTICS__ 1007 } // malloc_stats_fd 1008 1009 // The malloc_info() function exports an XML string that describes the current state of the memory-allocation 1010 // implementation in the caller. The string is printed on the file stream stream. The exported string includes 1011 // information about all arenas (see malloc(3)). 1029 1012 int malloc_info( int options, FILE * stream ) { 1030 1013 return printStatsXML( stream ); … … 1032 1015 1033 1016 1034 // #comment TD : What are these two functions for? 1017 // The malloc_get_state() function records the current state of all malloc(3) internal bookkeeping variables (but 1018 // not the actual contents of the heap or the state of malloc_hook(3) functions pointers). The state is recorded in 1019 // a system-dependent opaque data structure dynamically allocated via malloc(3), and a pointer to that data 1020 // structure is returned as the function result. (It is the caller's responsibility to free(3) this memory.) 1035 1021 void * malloc_get_state( void ) { 1036 return 0; 1022 return 0; // unsupported 1037 1023 } // malloc_get_state 1038 1024 1025 1026 // The malloc_set_state() function restores the state of all malloc(3) internal bookkeeping variables to the values 1027 // recorded in the opaque data structure pointed to by state. 1039 1028 int malloc_set_state( void * ptr ) { 1040 return 0; 1029 return 0; // unsupported 1041 1030 } // malloc_set_state 1042 1031 } // extern "C" -
src/CodeTools/module.mk
r341bb80 r6d44da1 16 16 17 17 SRC += CodeTools/DeclStats.cc \ 18 CodeTools/ResolvProtoDump.cc \ 18 19 CodeTools/TrackLoc.cc -
src/CompilationState.cc
r341bb80 r6d44da1 30 30 parsep = false, 31 31 resolvep = false, 32 resolvprotop = false, 32 33 symtabp = false, 33 34 treep = false, -
src/CompilationState.h
r341bb80 r6d44da1 31 31 parsep, 32 32 resolvep, 33 resolvprotop, 33 34 symtabp, 34 35 treep, -
src/GenPoly/ScrubTyVars.cc
r341bb80 r6d44da1 50 50 delete typeInst; 51 51 return new PointerType( Type::Qualifiers(), new FunctionType( Type::Qualifiers(), true ) ); 52 default: 53 assertf(false, "Unhandled tyvar kind: %d", tyVar->second.kind); 52 54 } // switch 53 55 } // if -
src/Makefile.am
r341bb80 r6d44da1 44 44 # put into lib for now 45 45 cfa_cpplibdir = $(CFA_LIBDIR) 46 cfa_cpplib_PROGRAMS = ../driver/cfa-cpp 46 cfa_cpplib_PROGRAMS = ../driver/cfa-cpp demangler 47 47 ___driver_cfa_cpp_SOURCES = $(SRC) 48 48 ___driver_cfa_cpp_LDADD = -ldl # yywrap … … 50 50 AM_CXXFLAGS = @HOST_FLAGS@ -Wno-deprecated -Wall -Wextra -DDEBUG_ALL -I./Parser -I$(srcdir)/Parser -I$(srcdir)/include -DYY_NO_INPUT -O2 -g -std=c++14 51 51 AM_LDFLAGS = @HOST_FLAGS@ -Xlinker -export-dynamic 52 ARFLAGS = cr 53 54 demangler_SOURCES = SymTab/demangler.cc 55 56 demangler_LDADD = libdemangle.a # yywrap 57 58 noinst_LIBRARIES = libdemangle.a 59 libdemangle_a_SOURCES = SymTab/Demangle.cc SymTab/ManglerCommon.cc \ 60 SynTree/Type.cc \ 61 SynTree/VoidType.cc \ 62 SynTree/BasicType.cc \ 63 SynTree/PointerType.cc \ 64 SynTree/ArrayType.cc \ 65 SynTree/ReferenceType.cc \ 66 SynTree/FunctionType.cc \ 67 SynTree/ReferenceToType.cc \ 68 SynTree/TupleType.cc \ 69 SynTree/TypeofType.cc \ 70 SynTree/AttrType.cc \ 71 SynTree/VarArgsType.cc \ 72 SynTree/ZeroOneType.cc \ 73 SynTree/Constant.cc \ 74 SynTree/Expression.cc \ 75 SynTree/TupleExpr.cc \ 76 SynTree/CommaExpr.cc \ 77 SynTree/TypeExpr.cc \ 78 SynTree/ApplicationExpr.cc \ 79 SynTree/AddressExpr.cc \ 80 SynTree/Statement.cc \ 81 SynTree/CompoundStmt.cc \ 82 SynTree/DeclStmt.cc \ 83 SynTree/Declaration.cc \ 84 SynTree/DeclarationWithType.cc \ 85 SynTree/ObjectDecl.cc \ 86 SynTree/FunctionDecl.cc \ 87 SynTree/AggregateDecl.cc \ 88 SynTree/NamedTypeDecl.cc \ 89 SynTree/TypeDecl.cc \ 90 SynTree/Initializer.cc \ 91 SynTree/TypeSubstitution.cc \ 92 SynTree/Attribute.cc \ 93 SynTree/DeclReplacer.cc \ 94 CompilationState.cc \ 95 CodeGen/CodeGenerator.cc \ 96 CodeGen/FixMain.cc \ 97 CodeGen/GenType.cc \ 98 CodeGen/OperatorTable.cc \ 99 Common/Assert.cc \ 100 Common/Eval.cc \ 101 Common/SemanticError.cc \ 102 Common/UniqueName.cc \ 103 Concurrency/Keywords.cc \ 104 ControlStruct/ForExprMutator.cc \ 105 ControlStruct/LabelFixer.cc \ 106 ControlStruct/LabelGenerator.cc \ 107 ControlStruct/MLEMutator.cc \ 108 ControlStruct/Mutate.cc \ 109 GenPoly/GenPoly.cc \ 110 GenPoly/Lvalue.cc \ 111 InitTweak/GenInit.cc \ 112 InitTweak/InitTweak.cc \ 113 Parser/LinkageSpec.cc \ 114 ResolvExpr/AdjustExprType.cc \ 115 ResolvExpr/Alternative.cc \ 116 ResolvExpr/AlternativeFinder.cc \ 117 ResolvExpr/ExplodedActual.cc \ 118 ResolvExpr/CastCost.cc \ 119 ResolvExpr/CommonType.cc \ 120 ResolvExpr/ConversionCost.cc \ 121 ResolvExpr/CurrentObject.cc \ 122 ResolvExpr/FindOpenVars.cc \ 123 ResolvExpr/Occurs.cc \ 124 ResolvExpr/PolyCost.cc \ 125 ResolvExpr/PtrsAssignable.cc \ 126 ResolvExpr/PtrsCastable.cc \ 127 ResolvExpr/RenameVars.cc \ 128 ResolvExpr/Resolver.cc \ 129 ResolvExpr/ResolveTypeof.cc \ 130 ResolvExpr/TypeEnvironment.cc \ 131 ResolvExpr/Unify.cc \ 132 SymTab/Autogen.cc \ 133 SymTab/FixFunction.cc \ 134 SymTab/Indexer.cc \ 135 SymTab/Mangler.cc \ 136 SymTab/Validate.cc \ 137 Tuples/Explode.cc \ 138 Tuples/TupleAssignment.cc \ 139 Tuples/TupleExpansion.cc \ 140 Validate/HandleAttributes.cc 52 141 53 142 MAINTAINERCLEANFILES += ${libdir}/${notdir ${cfa_cpplib_PROGRAMS}} -
src/Makefile.in
r341bb80 r6d44da1 62 62 ######################### -*- Mode: Makefile-Gmake -*- ######################## 63 63 ############################################################################### 64 64 65 65 66 VPATH = @srcdir@ … … 137 138 build_triplet = @build@ 138 139 host_triplet = @host@ 139 cfa_cpplib_PROGRAMS = ../driver/cfa-cpp$(EXEEXT) 140 cfa_cpplib_PROGRAMS = ../driver/cfa-cpp$(EXEEXT) demangler$(EXEEXT) 140 141 subdir = src 141 142 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 … … 149 150 CONFIG_CLEAN_FILES = 150 151 CONFIG_CLEAN_VPATH_FILES = 152 LIBRARIES = $(noinst_LIBRARIES) 153 AR = ar 154 AM_V_AR = $(am__v_AR_@AM_V@) 155 am__v_AR_ = $(am__v_AR_@AM_DEFAULT_V@) 156 am__v_AR_0 = @echo " AR " $@; 157 am__v_AR_1 = 158 libdemangle_a_AR = $(AR) $(ARFLAGS) 159 libdemangle_a_LIBADD = 160 am__dirstamp = $(am__leading_dot)dirstamp 161 am_libdemangle_a_OBJECTS = SymTab/Demangle.$(OBJEXT) \ 162 SymTab/ManglerCommon.$(OBJEXT) SynTree/Type.$(OBJEXT) \ 163 SynTree/VoidType.$(OBJEXT) SynTree/BasicType.$(OBJEXT) \ 164 SynTree/PointerType.$(OBJEXT) SynTree/ArrayType.$(OBJEXT) \ 165 SynTree/ReferenceType.$(OBJEXT) SynTree/FunctionType.$(OBJEXT) \ 166 SynTree/ReferenceToType.$(OBJEXT) SynTree/TupleType.$(OBJEXT) \ 167 SynTree/TypeofType.$(OBJEXT) SynTree/AttrType.$(OBJEXT) \ 168 SynTree/VarArgsType.$(OBJEXT) SynTree/ZeroOneType.$(OBJEXT) \ 169 SynTree/Constant.$(OBJEXT) SynTree/Expression.$(OBJEXT) \ 170 SynTree/TupleExpr.$(OBJEXT) SynTree/CommaExpr.$(OBJEXT) \ 171 SynTree/TypeExpr.$(OBJEXT) SynTree/ApplicationExpr.$(OBJEXT) \ 172 SynTree/AddressExpr.$(OBJEXT) SynTree/Statement.$(OBJEXT) \ 173 SynTree/CompoundStmt.$(OBJEXT) SynTree/DeclStmt.$(OBJEXT) \ 174 SynTree/Declaration.$(OBJEXT) \ 175 SynTree/DeclarationWithType.$(OBJEXT) \ 176 SynTree/ObjectDecl.$(OBJEXT) SynTree/FunctionDecl.$(OBJEXT) \ 177 SynTree/AggregateDecl.$(OBJEXT) \ 178 SynTree/NamedTypeDecl.$(OBJEXT) SynTree/TypeDecl.$(OBJEXT) \ 179 SynTree/Initializer.$(OBJEXT) \ 180 SynTree/TypeSubstitution.$(OBJEXT) SynTree/Attribute.$(OBJEXT) \ 181 SynTree/DeclReplacer.$(OBJEXT) CompilationState.$(OBJEXT) \ 182 CodeGen/CodeGenerator.$(OBJEXT) CodeGen/FixMain.$(OBJEXT) \ 183 CodeGen/GenType.$(OBJEXT) CodeGen/OperatorTable.$(OBJEXT) \ 184 Common/Assert.$(OBJEXT) Common/Eval.$(OBJEXT) \ 185 Common/SemanticError.$(OBJEXT) Common/UniqueName.$(OBJEXT) \ 186 Concurrency/Keywords.$(OBJEXT) \ 187 ControlStruct/ForExprMutator.$(OBJEXT) \ 188 ControlStruct/LabelFixer.$(OBJEXT) \ 189 ControlStruct/LabelGenerator.$(OBJEXT) \ 190 ControlStruct/MLEMutator.$(OBJEXT) \ 191 ControlStruct/Mutate.$(OBJEXT) GenPoly/GenPoly.$(OBJEXT) \ 192 GenPoly/Lvalue.$(OBJEXT) InitTweak/GenInit.$(OBJEXT) \ 193 InitTweak/InitTweak.$(OBJEXT) Parser/LinkageSpec.$(OBJEXT) \ 194 ResolvExpr/AdjustExprType.$(OBJEXT) \ 195 ResolvExpr/Alternative.$(OBJEXT) \ 196 ResolvExpr/AlternativeFinder.$(OBJEXT) \ 197 ResolvExpr/ExplodedActual.$(OBJEXT) \ 198 ResolvExpr/CastCost.$(OBJEXT) ResolvExpr/CommonType.$(OBJEXT) \ 199 ResolvExpr/ConversionCost.$(OBJEXT) \ 200 ResolvExpr/CurrentObject.$(OBJEXT) \ 201 ResolvExpr/FindOpenVars.$(OBJEXT) ResolvExpr/Occurs.$(OBJEXT) \ 202 ResolvExpr/PolyCost.$(OBJEXT) \ 203 ResolvExpr/PtrsAssignable.$(OBJEXT) \ 204 ResolvExpr/PtrsCastable.$(OBJEXT) \ 205 ResolvExpr/RenameVars.$(OBJEXT) ResolvExpr/Resolver.$(OBJEXT) \ 206 ResolvExpr/ResolveTypeof.$(OBJEXT) \ 207 ResolvExpr/TypeEnvironment.$(OBJEXT) \ 208 ResolvExpr/Unify.$(OBJEXT) SymTab/Autogen.$(OBJEXT) \ 209 SymTab/FixFunction.$(OBJEXT) SymTab/Indexer.$(OBJEXT) \ 210 SymTab/Mangler.$(OBJEXT) SymTab/Validate.$(OBJEXT) \ 211 Tuples/Explode.$(OBJEXT) Tuples/TupleAssignment.$(OBJEXT) \ 212 Tuples/TupleExpansion.$(OBJEXT) \ 213 Validate/HandleAttributes.$(OBJEXT) 214 libdemangle_a_OBJECTS = $(am_libdemangle_a_OBJECTS) 151 215 am__installdirs = "$(DESTDIR)$(cfa_cpplibdir)" 152 216 PROGRAMS = $(cfa_cpplib_PROGRAMS) 153 am__dirstamp = $(am__leading_dot)dirstamp154 217 am__objects_1 = main.$(OBJEXT) MakeLibCfa.$(OBJEXT) \ 155 218 CompilationState.$(OBJEXT) CodeGen/Generate.$(OBJEXT) \ … … 157 220 CodeGen/FixNames.$(OBJEXT) CodeGen/FixMain.$(OBJEXT) \ 158 221 CodeGen/OperatorTable.$(OBJEXT) CodeTools/DeclStats.$(OBJEXT) \ 222 CodeTools/ResolvProtoDump.$(OBJEXT) \ 159 223 CodeTools/TrackLoc.$(OBJEXT) Concurrency/Keywords.$(OBJEXT) \ 160 224 Concurrency/Waitfor.$(OBJEXT) Common/SemanticError.$(OBJEXT) \ … … 196 260 ResolvExpr/CurrentObject.$(OBJEXT) \ 197 261 ResolvExpr/ExplodedActual.$(OBJEXT) SymTab/Indexer.$(OBJEXT) \ 198 SymTab/Mangler.$(OBJEXT) SymTab/ Validate.$(OBJEXT) \199 SymTab/ FixFunction.$(OBJEXT) SymTab/Autogen.$(OBJEXT) \200 Sy nTree/Type.$(OBJEXT) SynTree/VoidType.$(OBJEXT) \201 SynTree/ BasicType.$(OBJEXT) SynTree/PointerType.$(OBJEXT) \202 SynTree/ ArrayType.$(OBJEXT) SynTree/ReferenceType.$(OBJEXT) \203 SynTree/ FunctionType.$(OBJEXT) \262 SymTab/Mangler.$(OBJEXT) SymTab/ManglerCommon.$(OBJEXT) \ 263 SymTab/Validate.$(OBJEXT) SymTab/FixFunction.$(OBJEXT) \ 264 SymTab/Autogen.$(OBJEXT) SynTree/Type.$(OBJEXT) \ 265 SynTree/VoidType.$(OBJEXT) SynTree/BasicType.$(OBJEXT) \ 266 SynTree/PointerType.$(OBJEXT) SynTree/ArrayType.$(OBJEXT) \ 267 SynTree/ReferenceType.$(OBJEXT) SynTree/FunctionType.$(OBJEXT) \ 204 268 SynTree/ReferenceToType.$(OBJEXT) SynTree/TupleType.$(OBJEXT) \ 205 269 SynTree/TypeofType.$(OBJEXT) SynTree/AttrType.$(OBJEXT) \ … … 225 289 ___driver_cfa_cpp_OBJECTS = $(am____driver_cfa_cpp_OBJECTS) 226 290 ___driver_cfa_cpp_DEPENDENCIES = 291 am_demangler_OBJECTS = SymTab/demangler.$(OBJEXT) 292 demangler_OBJECTS = $(am_demangler_OBJECTS) 293 demangler_DEPENDENCIES = libdemangle.a 227 294 AM_V_P = $(am__v_P_@AM_V@) 228 295 am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) … … 279 346 am__v_CCLD_0 = @echo " CCLD " $@; 280 347 am__v_CCLD_1 = 281 SOURCES = $(___driver_cfa_cpp_SOURCES) 282 DIST_SOURCES = $(___driver_cfa_cpp_SOURCES) 348 SOURCES = $(libdemangle_a_SOURCES) $(___driver_cfa_cpp_SOURCES) \ 349 $(demangler_SOURCES) 350 DIST_SOURCES = $(libdemangle_a_SOURCES) $(___driver_cfa_cpp_SOURCES) \ 351 $(demangler_SOURCES) 283 352 am__can_run_installinfo = \ 284 353 case $$AM_UPDATE_INFO_DIR in \ … … 451 520 CodeGen/FixNames.cc CodeGen/FixMain.cc \ 452 521 CodeGen/OperatorTable.cc CodeTools/DeclStats.cc \ 453 CodeTools/TrackLoc.cc Concurrency/Keywords.cc \ 454 Concurrency/Waitfor.cc Common/SemanticError.cc \ 455 Common/UniqueName.cc Common/DebugMalloc.cc Common/Assert.cc \ 456 Common/Heap.cc Common/Eval.cc ControlStruct/LabelGenerator.cc \ 522 CodeTools/ResolvProtoDump.cc CodeTools/TrackLoc.cc \ 523 Concurrency/Keywords.cc Concurrency/Waitfor.cc \ 524 Common/SemanticError.cc Common/UniqueName.cc \ 525 Common/DebugMalloc.cc Common/Assert.cc Common/Heap.cc \ 526 Common/Eval.cc ControlStruct/LabelGenerator.cc \ 457 527 ControlStruct/LabelFixer.cc ControlStruct/MLEMutator.cc \ 458 528 ControlStruct/Mutate.cc ControlStruct/ForExprMutator.cc \ … … 477 547 ResolvExpr/Occurs.cc ResolvExpr/TypeEnvironment.cc \ 478 548 ResolvExpr/CurrentObject.cc ResolvExpr/ExplodedActual.cc \ 479 SymTab/Indexer.cc SymTab/Mangler.cc SymTab/ Validate.cc \480 SymTab/ FixFunction.cc SymTab/Autogen.cc SynTree/Type.cc \481 SynTree/ VoidType.cc SynTree/BasicType.cc \549 SymTab/Indexer.cc SymTab/Mangler.cc SymTab/ManglerCommon.cc \ 550 SymTab/Validate.cc SymTab/FixFunction.cc SymTab/Autogen.cc \ 551 SynTree/Type.cc SynTree/VoidType.cc SynTree/BasicType.cc \ 482 552 SynTree/PointerType.cc SynTree/ArrayType.cc \ 483 553 SynTree/ReferenceType.cc SynTree/FunctionType.cc \ … … 511 581 AM_CXXFLAGS = @HOST_FLAGS@ -Wno-deprecated -Wall -Wextra -DDEBUG_ALL -I./Parser -I$(srcdir)/Parser -I$(srcdir)/include -DYY_NO_INPUT -O2 -g -std=c++14 512 582 AM_LDFLAGS = @HOST_FLAGS@ -Xlinker -export-dynamic 583 ARFLAGS = cr 584 demangler_SOURCES = SymTab/demangler.cc 585 demangler_LDADD = libdemangle.a # yywrap 586 noinst_LIBRARIES = libdemangle.a 587 libdemangle_a_SOURCES = SymTab/Demangle.cc SymTab/ManglerCommon.cc \ 588 SynTree/Type.cc \ 589 SynTree/VoidType.cc \ 590 SynTree/BasicType.cc \ 591 SynTree/PointerType.cc \ 592 SynTree/ArrayType.cc \ 593 SynTree/ReferenceType.cc \ 594 SynTree/FunctionType.cc \ 595 SynTree/ReferenceToType.cc \ 596 SynTree/TupleType.cc \ 597 SynTree/TypeofType.cc \ 598 SynTree/AttrType.cc \ 599 SynTree/VarArgsType.cc \ 600 SynTree/ZeroOneType.cc \ 601 SynTree/Constant.cc \ 602 SynTree/Expression.cc \ 603 SynTree/TupleExpr.cc \ 604 SynTree/CommaExpr.cc \ 605 SynTree/TypeExpr.cc \ 606 SynTree/ApplicationExpr.cc \ 607 SynTree/AddressExpr.cc \ 608 SynTree/Statement.cc \ 609 SynTree/CompoundStmt.cc \ 610 SynTree/DeclStmt.cc \ 611 SynTree/Declaration.cc \ 612 SynTree/DeclarationWithType.cc \ 613 SynTree/ObjectDecl.cc \ 614 SynTree/FunctionDecl.cc \ 615 SynTree/AggregateDecl.cc \ 616 SynTree/NamedTypeDecl.cc \ 617 SynTree/TypeDecl.cc \ 618 SynTree/Initializer.cc \ 619 SynTree/TypeSubstitution.cc \ 620 SynTree/Attribute.cc \ 621 SynTree/DeclReplacer.cc \ 622 CompilationState.cc \ 623 CodeGen/CodeGenerator.cc \ 624 CodeGen/FixMain.cc \ 625 CodeGen/GenType.cc \ 626 CodeGen/OperatorTable.cc \ 627 Common/Assert.cc \ 628 Common/Eval.cc \ 629 Common/SemanticError.cc \ 630 Common/UniqueName.cc \ 631 Concurrency/Keywords.cc \ 632 ControlStruct/ForExprMutator.cc \ 633 ControlStruct/LabelFixer.cc \ 634 ControlStruct/LabelGenerator.cc \ 635 ControlStruct/MLEMutator.cc \ 636 ControlStruct/Mutate.cc \ 637 GenPoly/GenPoly.cc \ 638 GenPoly/Lvalue.cc \ 639 InitTweak/GenInit.cc \ 640 InitTweak/InitTweak.cc \ 641 Parser/LinkageSpec.cc \ 642 ResolvExpr/AdjustExprType.cc \ 643 ResolvExpr/Alternative.cc \ 644 ResolvExpr/AlternativeFinder.cc \ 645 ResolvExpr/ExplodedActual.cc \ 646 ResolvExpr/CastCost.cc \ 647 ResolvExpr/CommonType.cc \ 648 ResolvExpr/ConversionCost.cc \ 649 ResolvExpr/CurrentObject.cc \ 650 ResolvExpr/FindOpenVars.cc \ 651 ResolvExpr/Occurs.cc \ 652 ResolvExpr/PolyCost.cc \ 653 ResolvExpr/PtrsAssignable.cc \ 654 ResolvExpr/PtrsCastable.cc \ 655 ResolvExpr/RenameVars.cc \ 656 ResolvExpr/Resolver.cc \ 657 ResolvExpr/ResolveTypeof.cc \ 658 ResolvExpr/TypeEnvironment.cc \ 659 ResolvExpr/Unify.cc \ 660 SymTab/Autogen.cc \ 661 SymTab/FixFunction.cc \ 662 SymTab/Indexer.cc \ 663 SymTab/Mangler.cc \ 664 SymTab/Validate.cc \ 665 Tuples/Explode.cc \ 666 Tuples/TupleAssignment.cc \ 667 Tuples/TupleExpansion.cc \ 668 Validate/HandleAttributes.cc 669 513 670 all: $(BUILT_SOURCES) 514 671 $(MAKE) $(AM_MAKEFLAGS) all-am … … 546 703 cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh 547 704 $(am__aclocal_m4_deps): 705 706 clean-noinstLIBRARIES: 707 -test -z "$(noinst_LIBRARIES)" || rm -f $(noinst_LIBRARIES) 708 SymTab/$(am__dirstamp): 709 @$(MKDIR_P) SymTab 710 @: > SymTab/$(am__dirstamp) 711 SymTab/$(DEPDIR)/$(am__dirstamp): 712 @$(MKDIR_P) SymTab/$(DEPDIR) 713 @: > SymTab/$(DEPDIR)/$(am__dirstamp) 714 SymTab/Demangle.$(OBJEXT): SymTab/$(am__dirstamp) \ 715 SymTab/$(DEPDIR)/$(am__dirstamp) 716 SymTab/ManglerCommon.$(OBJEXT): SymTab/$(am__dirstamp) \ 717 SymTab/$(DEPDIR)/$(am__dirstamp) 718 SynTree/$(am__dirstamp): 719 @$(MKDIR_P) SynTree 720 @: > SynTree/$(am__dirstamp) 721 SynTree/$(DEPDIR)/$(am__dirstamp): 722 @$(MKDIR_P) SynTree/$(DEPDIR) 723 @: > SynTree/$(DEPDIR)/$(am__dirstamp) 724 SynTree/Type.$(OBJEXT): SynTree/$(am__dirstamp) \ 725 SynTree/$(DEPDIR)/$(am__dirstamp) 726 SynTree/VoidType.$(OBJEXT): SynTree/$(am__dirstamp) \ 727 SynTree/$(DEPDIR)/$(am__dirstamp) 728 SynTree/BasicType.$(OBJEXT): SynTree/$(am__dirstamp) \ 729 SynTree/$(DEPDIR)/$(am__dirstamp) 730 SynTree/PointerType.$(OBJEXT): SynTree/$(am__dirstamp) \ 731 SynTree/$(DEPDIR)/$(am__dirstamp) 732 SynTree/ArrayType.$(OBJEXT): SynTree/$(am__dirstamp) \ 733 SynTree/$(DEPDIR)/$(am__dirstamp) 734 SynTree/ReferenceType.$(OBJEXT): SynTree/$(am__dirstamp) \ 735 SynTree/$(DEPDIR)/$(am__dirstamp) 736 SynTree/FunctionType.$(OBJEXT): SynTree/$(am__dirstamp) \ 737 SynTree/$(DEPDIR)/$(am__dirstamp) 738 SynTree/ReferenceToType.$(OBJEXT): SynTree/$(am__dirstamp) \ 739 SynTree/$(DEPDIR)/$(am__dirstamp) 740 SynTree/TupleType.$(OBJEXT): SynTree/$(am__dirstamp) \ 741 SynTree/$(DEPDIR)/$(am__dirstamp) 742 SynTree/TypeofType.$(OBJEXT): SynTree/$(am__dirstamp) \ 743 SynTree/$(DEPDIR)/$(am__dirstamp) 744 SynTree/AttrType.$(OBJEXT): SynTree/$(am__dirstamp) \ 745 SynTree/$(DEPDIR)/$(am__dirstamp) 746 SynTree/VarArgsType.$(OBJEXT): SynTree/$(am__dirstamp) \ 747 SynTree/$(DEPDIR)/$(am__dirstamp) 748 SynTree/ZeroOneType.$(OBJEXT): SynTree/$(am__dirstamp) \ 749 SynTree/$(DEPDIR)/$(am__dirstamp) 750 SynTree/Constant.$(OBJEXT): SynTree/$(am__dirstamp) \ 751 SynTree/$(DEPDIR)/$(am__dirstamp) 752 SynTree/Expression.$(OBJEXT): SynTree/$(am__dirstamp) \ 753 SynTree/$(DEPDIR)/$(am__dirstamp) 754 SynTree/TupleExpr.$(OBJEXT): SynTree/$(am__dirstamp) \ 755 SynTree/$(DEPDIR)/$(am__dirstamp) 756 SynTree/CommaExpr.$(OBJEXT): SynTree/$(am__dirstamp) \ 757 SynTree/$(DEPDIR)/$(am__dirstamp) 758 SynTree/TypeExpr.$(OBJEXT): SynTree/$(am__dirstamp) \ 759 SynTree/$(DEPDIR)/$(am__dirstamp) 760 SynTree/ApplicationExpr.$(OBJEXT): SynTree/$(am__dirstamp) \ 761 SynTree/$(DEPDIR)/$(am__dirstamp) 762 SynTree/AddressExpr.$(OBJEXT): SynTree/$(am__dirstamp) \ 763 SynTree/$(DEPDIR)/$(am__dirstamp) 764 SynTree/Statement.$(OBJEXT): SynTree/$(am__dirstamp) \ 765 SynTree/$(DEPDIR)/$(am__dirstamp) 766 SynTree/CompoundStmt.$(OBJEXT): SynTree/$(am__dirstamp) \ 767 SynTree/$(DEPDIR)/$(am__dirstamp) 768 SynTree/DeclStmt.$(OBJEXT): SynTree/$(am__dirstamp) \ 769 SynTree/$(DEPDIR)/$(am__dirstamp) 770 SynTree/Declaration.$(OBJEXT): SynTree/$(am__dirstamp) \ 771 SynTree/$(DEPDIR)/$(am__dirstamp) 772 SynTree/DeclarationWithType.$(OBJEXT): SynTree/$(am__dirstamp) \ 773 SynTree/$(DEPDIR)/$(am__dirstamp) 774 SynTree/ObjectDecl.$(OBJEXT): SynTree/$(am__dirstamp) \ 775 SynTree/$(DEPDIR)/$(am__dirstamp) 776 SynTree/FunctionDecl.$(OBJEXT): SynTree/$(am__dirstamp) \ 777 SynTree/$(DEPDIR)/$(am__dirstamp) 778 SynTree/AggregateDecl.$(OBJEXT): SynTree/$(am__dirstamp) \ 779 SynTree/$(DEPDIR)/$(am__dirstamp) 780 SynTree/NamedTypeDecl.$(OBJEXT): SynTree/$(am__dirstamp) \ 781 SynTree/$(DEPDIR)/$(am__dirstamp) 782 SynTree/TypeDecl.$(OBJEXT): SynTree/$(am__dirstamp) \ 783 SynTree/$(DEPDIR)/$(am__dirstamp) 784 SynTree/Initializer.$(OBJEXT): SynTree/$(am__dirstamp) \ 785 SynTree/$(DEPDIR)/$(am__dirstamp) 786 SynTree/TypeSubstitution.$(OBJEXT): SynTree/$(am__dirstamp) \ 787 SynTree/$(DEPDIR)/$(am__dirstamp) 788 SynTree/Attribute.$(OBJEXT): SynTree/$(am__dirstamp) \ 789 SynTree/$(DEPDIR)/$(am__dirstamp) 790 SynTree/DeclReplacer.$(OBJEXT): SynTree/$(am__dirstamp) \ 791 SynTree/$(DEPDIR)/$(am__dirstamp) 792 CodeGen/$(am__dirstamp): 793 @$(MKDIR_P) CodeGen 794 @: > CodeGen/$(am__dirstamp) 795 CodeGen/$(DEPDIR)/$(am__dirstamp): 796 @$(MKDIR_P) CodeGen/$(DEPDIR) 797 @: > CodeGen/$(DEPDIR)/$(am__dirstamp) 798 CodeGen/CodeGenerator.$(OBJEXT): CodeGen/$(am__dirstamp) \ 799 CodeGen/$(DEPDIR)/$(am__dirstamp) 800 CodeGen/FixMain.$(OBJEXT): CodeGen/$(am__dirstamp) \ 801 CodeGen/$(DEPDIR)/$(am__dirstamp) 802 CodeGen/GenType.$(OBJEXT): CodeGen/$(am__dirstamp) \ 803 CodeGen/$(DEPDIR)/$(am__dirstamp) 804 CodeGen/OperatorTable.$(OBJEXT): CodeGen/$(am__dirstamp) \ 805 CodeGen/$(DEPDIR)/$(am__dirstamp) 806 Common/$(am__dirstamp): 807 @$(MKDIR_P) Common 808 @: > Common/$(am__dirstamp) 809 Common/$(DEPDIR)/$(am__dirstamp): 810 @$(MKDIR_P) Common/$(DEPDIR) 811 @: > Common/$(DEPDIR)/$(am__dirstamp) 812 Common/Assert.$(OBJEXT): Common/$(am__dirstamp) \ 813 Common/$(DEPDIR)/$(am__dirstamp) 814 Common/Eval.$(OBJEXT): Common/$(am__dirstamp) \ 815 Common/$(DEPDIR)/$(am__dirstamp) 816 Common/SemanticError.$(OBJEXT): Common/$(am__dirstamp) \ 817 Common/$(DEPDIR)/$(am__dirstamp) 818 Common/UniqueName.$(OBJEXT): Common/$(am__dirstamp) \ 819 Common/$(DEPDIR)/$(am__dirstamp) 820 Concurrency/$(am__dirstamp): 821 @$(MKDIR_P) Concurrency 822 @: > Concurrency/$(am__dirstamp) 823 Concurrency/$(DEPDIR)/$(am__dirstamp): 824 @$(MKDIR_P) Concurrency/$(DEPDIR) 825 @: > Concurrency/$(DEPDIR)/$(am__dirstamp) 826 Concurrency/Keywords.$(OBJEXT): Concurrency/$(am__dirstamp) \ 827 Concurrency/$(DEPDIR)/$(am__dirstamp) 828 ControlStruct/$(am__dirstamp): 829 @$(MKDIR_P) ControlStruct 830 @: > ControlStruct/$(am__dirstamp) 831 ControlStruct/$(DEPDIR)/$(am__dirstamp): 832 @$(MKDIR_P) ControlStruct/$(DEPDIR) 833 @: > ControlStruct/$(DEPDIR)/$(am__dirstamp) 834 ControlStruct/ForExprMutator.$(OBJEXT): ControlStruct/$(am__dirstamp) \ 835 ControlStruct/$(DEPDIR)/$(am__dirstamp) 836 ControlStruct/LabelFixer.$(OBJEXT): ControlStruct/$(am__dirstamp) \ 837 ControlStruct/$(DEPDIR)/$(am__dirstamp) 838 ControlStruct/LabelGenerator.$(OBJEXT): ControlStruct/$(am__dirstamp) \ 839 ControlStruct/$(DEPDIR)/$(am__dirstamp) 840 ControlStruct/MLEMutator.$(OBJEXT): ControlStruct/$(am__dirstamp) \ 841 ControlStruct/$(DEPDIR)/$(am__dirstamp) 842 ControlStruct/Mutate.$(OBJEXT): ControlStruct/$(am__dirstamp) \ 843 ControlStruct/$(DEPDIR)/$(am__dirstamp) 844 GenPoly/$(am__dirstamp): 845 @$(MKDIR_P) GenPoly 846 @: > GenPoly/$(am__dirstamp) 847 GenPoly/$(DEPDIR)/$(am__dirstamp): 848 @$(MKDIR_P) GenPoly/$(DEPDIR) 849 @: > GenPoly/$(DEPDIR)/$(am__dirstamp) 850 GenPoly/GenPoly.$(OBJEXT): GenPoly/$(am__dirstamp) \ 851 GenPoly/$(DEPDIR)/$(am__dirstamp) 852 GenPoly/Lvalue.$(OBJEXT): GenPoly/$(am__dirstamp) \ 853 GenPoly/$(DEPDIR)/$(am__dirstamp) 854 InitTweak/$(am__dirstamp): 855 @$(MKDIR_P) InitTweak 856 @: > InitTweak/$(am__dirstamp) 857 InitTweak/$(DEPDIR)/$(am__dirstamp): 858 @$(MKDIR_P) InitTweak/$(DEPDIR) 859 @: > InitTweak/$(DEPDIR)/$(am__dirstamp) 860 InitTweak/GenInit.$(OBJEXT): InitTweak/$(am__dirstamp) \ 861 InitTweak/$(DEPDIR)/$(am__dirstamp) 862 InitTweak/InitTweak.$(OBJEXT): InitTweak/$(am__dirstamp) \ 863 InitTweak/$(DEPDIR)/$(am__dirstamp) 864 Parser/$(am__dirstamp): 865 @$(MKDIR_P) Parser 866 @: > Parser/$(am__dirstamp) 867 Parser/$(DEPDIR)/$(am__dirstamp): 868 @$(MKDIR_P) Parser/$(DEPDIR) 869 @: > Parser/$(DEPDIR)/$(am__dirstamp) 870 Parser/LinkageSpec.$(OBJEXT): Parser/$(am__dirstamp) \ 871 Parser/$(DEPDIR)/$(am__dirstamp) 872 ResolvExpr/$(am__dirstamp): 873 @$(MKDIR_P) ResolvExpr 874 @: > ResolvExpr/$(am__dirstamp) 875 ResolvExpr/$(DEPDIR)/$(am__dirstamp): 876 @$(MKDIR_P) ResolvExpr/$(DEPDIR) 877 @: > ResolvExpr/$(DEPDIR)/$(am__dirstamp) 878 ResolvExpr/AdjustExprType.$(OBJEXT): ResolvExpr/$(am__dirstamp) \ 879 ResolvExpr/$(DEPDIR)/$(am__dirstamp) 880 ResolvExpr/Alternative.$(OBJEXT): ResolvExpr/$(am__dirstamp) \ 881 ResolvExpr/$(DEPDIR)/$(am__dirstamp) 882 ResolvExpr/AlternativeFinder.$(OBJEXT): ResolvExpr/$(am__dirstamp) \ 883 ResolvExpr/$(DEPDIR)/$(am__dirstamp) 884 ResolvExpr/ExplodedActual.$(OBJEXT): ResolvExpr/$(am__dirstamp) \ 885 ResolvExpr/$(DEPDIR)/$(am__dirstamp) 886 ResolvExpr/CastCost.$(OBJEXT): ResolvExpr/$(am__dirstamp) \ 887 ResolvExpr/$(DEPDIR)/$(am__dirstamp) 888 ResolvExpr/CommonType.$(OBJEXT): ResolvExpr/$(am__dirstamp) \ 889 ResolvExpr/$(DEPDIR)/$(am__dirstamp) 890 ResolvExpr/ConversionCost.$(OBJEXT): ResolvExpr/$(am__dirstamp) \ 891 ResolvExpr/$(DEPDIR)/$(am__dirstamp) 892 ResolvExpr/CurrentObject.$(OBJEXT): ResolvExpr/$(am__dirstamp) \ 893 ResolvExpr/$(DEPDIR)/$(am__dirstamp) 894 ResolvExpr/FindOpenVars.$(OBJEXT): ResolvExpr/$(am__dirstamp) \ 895 ResolvExpr/$(DEPDIR)/$(am__dirstamp) 896 ResolvExpr/Occurs.$(OBJEXT): ResolvExpr/$(am__dirstamp) \ 897 ResolvExpr/$(DEPDIR)/$(am__dirstamp) 898 ResolvExpr/PolyCost.$(OBJEXT): ResolvExpr/$(am__dirstamp) \ 899 ResolvExpr/$(DEPDIR)/$(am__dirstamp) 900 ResolvExpr/PtrsAssignable.$(OBJEXT): ResolvExpr/$(am__dirstamp) \ 901 ResolvExpr/$(DEPDIR)/$(am__dirstamp) 902 ResolvExpr/PtrsCastable.$(OBJEXT): ResolvExpr/$(am__dirstamp) \ 903 ResolvExpr/$(DEPDIR)/$(am__dirstamp) 904 ResolvExpr/RenameVars.$(OBJEXT): ResolvExpr/$(am__dirstamp) \ 905 ResolvExpr/$(DEPDIR)/$(am__dirstamp) 906 ResolvExpr/Resolver.$(OBJEXT): ResolvExpr/$(am__dirstamp) \ 907 ResolvExpr/$(DEPDIR)/$(am__dirstamp) 908 ResolvExpr/ResolveTypeof.$(OBJEXT): ResolvExpr/$(am__dirstamp) \ 909 ResolvExpr/$(DEPDIR)/$(am__dirstamp) 910 ResolvExpr/TypeEnvironment.$(OBJEXT): ResolvExpr/$(am__dirstamp) \ 911 ResolvExpr/$(DEPDIR)/$(am__dirstamp) 912 ResolvExpr/Unify.$(OBJEXT): ResolvExpr/$(am__dirstamp) \ 913 ResolvExpr/$(DEPDIR)/$(am__dirstamp) 914 SymTab/Autogen.$(OBJEXT): SymTab/$(am__dirstamp) \ 915 SymTab/$(DEPDIR)/$(am__dirstamp) 916 SymTab/FixFunction.$(OBJEXT): SymTab/$(am__dirstamp) \ 917 SymTab/$(DEPDIR)/$(am__dirstamp) 918 SymTab/Indexer.$(OBJEXT): SymTab/$(am__dirstamp) \ 919 SymTab/$(DEPDIR)/$(am__dirstamp) 920 SymTab/Mangler.$(OBJEXT): SymTab/$(am__dirstamp) \ 921 SymTab/$(DEPDIR)/$(am__dirstamp) 922 SymTab/Validate.$(OBJEXT): SymTab/$(am__dirstamp) \ 923 SymTab/$(DEPDIR)/$(am__dirstamp) 924 Tuples/$(am__dirstamp): 925 @$(MKDIR_P) Tuples 926 @: > Tuples/$(am__dirstamp) 927 Tuples/$(DEPDIR)/$(am__dirstamp): 928 @$(MKDIR_P) Tuples/$(DEPDIR) 929 @: > Tuples/$(DEPDIR)/$(am__dirstamp) 930 Tuples/Explode.$(OBJEXT): Tuples/$(am__dirstamp) \ 931 Tuples/$(DEPDIR)/$(am__dirstamp) 932 Tuples/TupleAssignment.$(OBJEXT): Tuples/$(am__dirstamp) \ 933 Tuples/$(DEPDIR)/$(am__dirstamp) 934 Tuples/TupleExpansion.$(OBJEXT): Tuples/$(am__dirstamp) \ 935 Tuples/$(DEPDIR)/$(am__dirstamp) 936 Validate/$(am__dirstamp): 937 @$(MKDIR_P) Validate 938 @: > Validate/$(am__dirstamp) 939 Validate/$(DEPDIR)/$(am__dirstamp): 940 @$(MKDIR_P) Validate/$(DEPDIR) 941 @: > Validate/$(DEPDIR)/$(am__dirstamp) 942 Validate/HandleAttributes.$(OBJEXT): Validate/$(am__dirstamp) \ 943 Validate/$(DEPDIR)/$(am__dirstamp) 944 945 libdemangle.a: $(libdemangle_a_OBJECTS) $(libdemangle_a_DEPENDENCIES) $(EXTRA_libdemangle_a_DEPENDENCIES) 946 $(AM_V_at)-rm -f libdemangle.a 947 $(AM_V_AR)$(libdemangle_a_AR) libdemangle.a $(libdemangle_a_OBJECTS) $(libdemangle_a_LIBADD) 948 $(AM_V_at)$(RANLIB) libdemangle.a 548 949 install-cfa_cpplibPROGRAMS: $(cfa_cpplib_PROGRAMS) 549 950 @$(NORMAL_INSTALL) … … 588 989 clean-cfa_cpplibPROGRAMS: 589 990 -test -z "$(cfa_cpplib_PROGRAMS)" || rm -f $(cfa_cpplib_PROGRAMS) 590 CodeGen/$(am__dirstamp):591 @$(MKDIR_P) CodeGen592 @: > CodeGen/$(am__dirstamp)593 CodeGen/$(DEPDIR)/$(am__dirstamp):594 @$(MKDIR_P) CodeGen/$(DEPDIR)595 @: > CodeGen/$(DEPDIR)/$(am__dirstamp)596 991 CodeGen/Generate.$(OBJEXT): CodeGen/$(am__dirstamp) \ 597 992 CodeGen/$(DEPDIR)/$(am__dirstamp) 598 CodeGen/CodeGenerator.$(OBJEXT): CodeGen/$(am__dirstamp) \599 CodeGen/$(DEPDIR)/$(am__dirstamp)600 CodeGen/GenType.$(OBJEXT): CodeGen/$(am__dirstamp) \601 CodeGen/$(DEPDIR)/$(am__dirstamp)602 993 CodeGen/FixNames.$(OBJEXT): CodeGen/$(am__dirstamp) \ 603 CodeGen/$(DEPDIR)/$(am__dirstamp)604 CodeGen/FixMain.$(OBJEXT): CodeGen/$(am__dirstamp) \605 CodeGen/$(DEPDIR)/$(am__dirstamp)606 CodeGen/OperatorTable.$(OBJEXT): CodeGen/$(am__dirstamp) \607 994 CodeGen/$(DEPDIR)/$(am__dirstamp) 608 995 CodeTools/$(am__dirstamp): … … 614 1001 CodeTools/DeclStats.$(OBJEXT): CodeTools/$(am__dirstamp) \ 615 1002 CodeTools/$(DEPDIR)/$(am__dirstamp) 1003 CodeTools/ResolvProtoDump.$(OBJEXT): CodeTools/$(am__dirstamp) \ 1004 CodeTools/$(DEPDIR)/$(am__dirstamp) 616 1005 CodeTools/TrackLoc.$(OBJEXT): CodeTools/$(am__dirstamp) \ 617 1006 CodeTools/$(DEPDIR)/$(am__dirstamp) 618 Concurrency/$(am__dirstamp):619 @$(MKDIR_P) Concurrency620 @: > Concurrency/$(am__dirstamp)621 Concurrency/$(DEPDIR)/$(am__dirstamp):622 @$(MKDIR_P) Concurrency/$(DEPDIR)623 @: > Concurrency/$(DEPDIR)/$(am__dirstamp)624 Concurrency/Keywords.$(OBJEXT): Concurrency/$(am__dirstamp) \625 Concurrency/$(DEPDIR)/$(am__dirstamp)626 1007 Concurrency/Waitfor.$(OBJEXT): Concurrency/$(am__dirstamp) \ 627 1008 Concurrency/$(DEPDIR)/$(am__dirstamp) 628 Common/$(am__dirstamp):629 @$(MKDIR_P) Common630 @: > Common/$(am__dirstamp)631 Common/$(DEPDIR)/$(am__dirstamp):632 @$(MKDIR_P) Common/$(DEPDIR)633 @: > Common/$(DEPDIR)/$(am__dirstamp)634 Common/SemanticError.$(OBJEXT): Common/$(am__dirstamp) \635 Common/$(DEPDIR)/$(am__dirstamp)636 Common/UniqueName.$(OBJEXT): Common/$(am__dirstamp) \637 Common/$(DEPDIR)/$(am__dirstamp)638 1009 Common/DebugMalloc.$(OBJEXT): Common/$(am__dirstamp) \ 639 Common/$(DEPDIR)/$(am__dirstamp)640 Common/Assert.$(OBJEXT): Common/$(am__dirstamp) \641 1010 Common/$(DEPDIR)/$(am__dirstamp) 642 1011 Common/Heap.$(OBJEXT): Common/$(am__dirstamp) \ 643 1012 Common/$(DEPDIR)/$(am__dirstamp) 644 Common/Eval.$(OBJEXT): Common/$(am__dirstamp) \645 Common/$(DEPDIR)/$(am__dirstamp)646 ControlStruct/$(am__dirstamp):647 @$(MKDIR_P) ControlStruct648 @: > ControlStruct/$(am__dirstamp)649 ControlStruct/$(DEPDIR)/$(am__dirstamp):650 @$(MKDIR_P) ControlStruct/$(DEPDIR)651 @: > ControlStruct/$(DEPDIR)/$(am__dirstamp)652 ControlStruct/LabelGenerator.$(OBJEXT): ControlStruct/$(am__dirstamp) \653 ControlStruct/$(DEPDIR)/$(am__dirstamp)654 ControlStruct/LabelFixer.$(OBJEXT): ControlStruct/$(am__dirstamp) \655 ControlStruct/$(DEPDIR)/$(am__dirstamp)656 ControlStruct/MLEMutator.$(OBJEXT): ControlStruct/$(am__dirstamp) \657 ControlStruct/$(DEPDIR)/$(am__dirstamp)658 ControlStruct/Mutate.$(OBJEXT): ControlStruct/$(am__dirstamp) \659 ControlStruct/$(DEPDIR)/$(am__dirstamp)660 ControlStruct/ForExprMutator.$(OBJEXT): ControlStruct/$(am__dirstamp) \661 ControlStruct/$(DEPDIR)/$(am__dirstamp)662 1013 ControlStruct/ExceptTranslate.$(OBJEXT): \ 663 1014 ControlStruct/$(am__dirstamp) \ 664 1015 ControlStruct/$(DEPDIR)/$(am__dirstamp) 665 GenPoly/$(am__dirstamp):666 @$(MKDIR_P) GenPoly667 @: > GenPoly/$(am__dirstamp)668 GenPoly/$(DEPDIR)/$(am__dirstamp):669 @$(MKDIR_P) GenPoly/$(DEPDIR)670 @: > GenPoly/$(DEPDIR)/$(am__dirstamp)671 1016 GenPoly/Box.$(OBJEXT): GenPoly/$(am__dirstamp) \ 672 1017 GenPoly/$(DEPDIR)/$(am__dirstamp) 673 GenPoly/GenPoly.$(OBJEXT): GenPoly/$(am__dirstamp) \674 GenPoly/$(DEPDIR)/$(am__dirstamp)675 1018 GenPoly/ScrubTyVars.$(OBJEXT): GenPoly/$(am__dirstamp) \ 676 GenPoly/$(DEPDIR)/$(am__dirstamp)677 GenPoly/Lvalue.$(OBJEXT): GenPoly/$(am__dirstamp) \678 1019 GenPoly/$(DEPDIR)/$(am__dirstamp) 679 1020 GenPoly/Specialize.$(OBJEXT): GenPoly/$(am__dirstamp) \ … … 683 1024 GenPoly/InstantiateGeneric.$(OBJEXT): GenPoly/$(am__dirstamp) \ 684 1025 GenPoly/$(DEPDIR)/$(am__dirstamp) 685 InitTweak/$(am__dirstamp):686 @$(MKDIR_P) InitTweak687 @: > InitTweak/$(am__dirstamp)688 InitTweak/$(DEPDIR)/$(am__dirstamp):689 @$(MKDIR_P) InitTweak/$(DEPDIR)690 @: > InitTweak/$(DEPDIR)/$(am__dirstamp)691 InitTweak/GenInit.$(OBJEXT): InitTweak/$(am__dirstamp) \692 InitTweak/$(DEPDIR)/$(am__dirstamp)693 1026 InitTweak/FixInit.$(OBJEXT): InitTweak/$(am__dirstamp) \ 694 1027 InitTweak/$(DEPDIR)/$(am__dirstamp) 695 1028 InitTweak/FixGlobalInit.$(OBJEXT): InitTweak/$(am__dirstamp) \ 696 1029 InitTweak/$(DEPDIR)/$(am__dirstamp) 697 InitTweak/InitTweak.$(OBJEXT): InitTweak/$(am__dirstamp) \698 InitTweak/$(DEPDIR)/$(am__dirstamp)699 1030 Parser/parser.hh: Parser/parser.cc 700 1031 @if test ! -f $@; then rm -f Parser/parser.cc; else :; fi 701 1032 @if test ! -f $@; then $(MAKE) $(AM_MAKEFLAGS) Parser/parser.cc; else :; fi 702 Parser/$(am__dirstamp):703 @$(MKDIR_P) Parser704 @: > Parser/$(am__dirstamp)705 Parser/$(DEPDIR)/$(am__dirstamp):706 @$(MKDIR_P) Parser/$(DEPDIR)707 @: > Parser/$(DEPDIR)/$(am__dirstamp)708 1033 Parser/parser.$(OBJEXT): Parser/$(am__dirstamp) \ 709 1034 Parser/$(DEPDIR)/$(am__dirstamp) … … 724 1049 Parser/TypeData.$(OBJEXT): Parser/$(am__dirstamp) \ 725 1050 Parser/$(DEPDIR)/$(am__dirstamp) 726 Parser/LinkageSpec.$(OBJEXT): Parser/$(am__dirstamp) \727 Parser/$(DEPDIR)/$(am__dirstamp)728 1051 Parser/parserutility.$(OBJEXT): Parser/$(am__dirstamp) \ 729 1052 Parser/$(DEPDIR)/$(am__dirstamp) 730 ResolvExpr/$(am__dirstamp):731 @$(MKDIR_P) ResolvExpr732 @: > ResolvExpr/$(am__dirstamp)733 ResolvExpr/$(DEPDIR)/$(am__dirstamp):734 @$(MKDIR_P) ResolvExpr/$(DEPDIR)735 @: > ResolvExpr/$(DEPDIR)/$(am__dirstamp)736 ResolvExpr/AlternativeFinder.$(OBJEXT): ResolvExpr/$(am__dirstamp) \737 ResolvExpr/$(DEPDIR)/$(am__dirstamp)738 ResolvExpr/Alternative.$(OBJEXT): ResolvExpr/$(am__dirstamp) \739 ResolvExpr/$(DEPDIR)/$(am__dirstamp)740 ResolvExpr/Unify.$(OBJEXT): ResolvExpr/$(am__dirstamp) \741 ResolvExpr/$(DEPDIR)/$(am__dirstamp)742 ResolvExpr/PtrsAssignable.$(OBJEXT): ResolvExpr/$(am__dirstamp) \743 ResolvExpr/$(DEPDIR)/$(am__dirstamp)744 ResolvExpr/CommonType.$(OBJEXT): ResolvExpr/$(am__dirstamp) \745 ResolvExpr/$(DEPDIR)/$(am__dirstamp)746 ResolvExpr/ConversionCost.$(OBJEXT): ResolvExpr/$(am__dirstamp) \747 ResolvExpr/$(DEPDIR)/$(am__dirstamp)748 ResolvExpr/CastCost.$(OBJEXT): ResolvExpr/$(am__dirstamp) \749 ResolvExpr/$(DEPDIR)/$(am__dirstamp)750 ResolvExpr/PtrsCastable.$(OBJEXT): ResolvExpr/$(am__dirstamp) \751 ResolvExpr/$(DEPDIR)/$(am__dirstamp)752 ResolvExpr/AdjustExprType.$(OBJEXT): ResolvExpr/$(am__dirstamp) \753 ResolvExpr/$(DEPDIR)/$(am__dirstamp)754 1053 ResolvExpr/AlternativePrinter.$(OBJEXT): ResolvExpr/$(am__dirstamp) \ 755 1054 ResolvExpr/$(DEPDIR)/$(am__dirstamp) 756 ResolvExpr/Resolver.$(OBJEXT): ResolvExpr/$(am__dirstamp) \757 ResolvExpr/$(DEPDIR)/$(am__dirstamp)758 ResolvExpr/ResolveTypeof.$(OBJEXT): ResolvExpr/$(am__dirstamp) \759 ResolvExpr/$(DEPDIR)/$(am__dirstamp)760 ResolvExpr/RenameVars.$(OBJEXT): ResolvExpr/$(am__dirstamp) \761 ResolvExpr/$(DEPDIR)/$(am__dirstamp)762 ResolvExpr/FindOpenVars.$(OBJEXT): ResolvExpr/$(am__dirstamp) \763 ResolvExpr/$(DEPDIR)/$(am__dirstamp)764 ResolvExpr/PolyCost.$(OBJEXT): ResolvExpr/$(am__dirstamp) \765 ResolvExpr/$(DEPDIR)/$(am__dirstamp)766 ResolvExpr/Occurs.$(OBJEXT): ResolvExpr/$(am__dirstamp) \767 ResolvExpr/$(DEPDIR)/$(am__dirstamp)768 ResolvExpr/TypeEnvironment.$(OBJEXT): ResolvExpr/$(am__dirstamp) \769 ResolvExpr/$(DEPDIR)/$(am__dirstamp)770 ResolvExpr/CurrentObject.$(OBJEXT): ResolvExpr/$(am__dirstamp) \771 ResolvExpr/$(DEPDIR)/$(am__dirstamp)772 ResolvExpr/ExplodedActual.$(OBJEXT): ResolvExpr/$(am__dirstamp) \773 ResolvExpr/$(DEPDIR)/$(am__dirstamp)774 SymTab/$(am__dirstamp):775 @$(MKDIR_P) SymTab776 @: > SymTab/$(am__dirstamp)777 SymTab/$(DEPDIR)/$(am__dirstamp):778 @$(MKDIR_P) SymTab/$(DEPDIR)779 @: > SymTab/$(DEPDIR)/$(am__dirstamp)780 SymTab/Indexer.$(OBJEXT): SymTab/$(am__dirstamp) \781 SymTab/$(DEPDIR)/$(am__dirstamp)782 SymTab/Mangler.$(OBJEXT): SymTab/$(am__dirstamp) \783 SymTab/$(DEPDIR)/$(am__dirstamp)784 SymTab/Validate.$(OBJEXT): SymTab/$(am__dirstamp) \785 SymTab/$(DEPDIR)/$(am__dirstamp)786 SymTab/FixFunction.$(OBJEXT): SymTab/$(am__dirstamp) \787 SymTab/$(DEPDIR)/$(am__dirstamp)788 SymTab/Autogen.$(OBJEXT): SymTab/$(am__dirstamp) \789 SymTab/$(DEPDIR)/$(am__dirstamp)790 SynTree/$(am__dirstamp):791 @$(MKDIR_P) SynTree792 @: > SynTree/$(am__dirstamp)793 SynTree/$(DEPDIR)/$(am__dirstamp):794 @$(MKDIR_P) SynTree/$(DEPDIR)795 @: > SynTree/$(DEPDIR)/$(am__dirstamp)796 SynTree/Type.$(OBJEXT): SynTree/$(am__dirstamp) \797 SynTree/$(DEPDIR)/$(am__dirstamp)798 SynTree/VoidType.$(OBJEXT): SynTree/$(am__dirstamp) \799 SynTree/$(DEPDIR)/$(am__dirstamp)800 SynTree/BasicType.$(OBJEXT): SynTree/$(am__dirstamp) \801 SynTree/$(DEPDIR)/$(am__dirstamp)802 SynTree/PointerType.$(OBJEXT): SynTree/$(am__dirstamp) \803 SynTree/$(DEPDIR)/$(am__dirstamp)804 SynTree/ArrayType.$(OBJEXT): SynTree/$(am__dirstamp) \805 SynTree/$(DEPDIR)/$(am__dirstamp)806 SynTree/ReferenceType.$(OBJEXT): SynTree/$(am__dirstamp) \807 SynTree/$(DEPDIR)/$(am__dirstamp)808 SynTree/FunctionType.$(OBJEXT): SynTree/$(am__dirstamp) \809 SynTree/$(DEPDIR)/$(am__dirstamp)810 SynTree/ReferenceToType.$(OBJEXT): SynTree/$(am__dirstamp) \811 SynTree/$(DEPDIR)/$(am__dirstamp)812 SynTree/TupleType.$(OBJEXT): SynTree/$(am__dirstamp) \813 SynTree/$(DEPDIR)/$(am__dirstamp)814 SynTree/TypeofType.$(OBJEXT): SynTree/$(am__dirstamp) \815 SynTree/$(DEPDIR)/$(am__dirstamp)816 SynTree/AttrType.$(OBJEXT): SynTree/$(am__dirstamp) \817 SynTree/$(DEPDIR)/$(am__dirstamp)818 SynTree/VarArgsType.$(OBJEXT): SynTree/$(am__dirstamp) \819 SynTree/$(DEPDIR)/$(am__dirstamp)820 SynTree/ZeroOneType.$(OBJEXT): SynTree/$(am__dirstamp) \821 SynTree/$(DEPDIR)/$(am__dirstamp)822 SynTree/Constant.$(OBJEXT): SynTree/$(am__dirstamp) \823 SynTree/$(DEPDIR)/$(am__dirstamp)824 SynTree/Expression.$(OBJEXT): SynTree/$(am__dirstamp) \825 SynTree/$(DEPDIR)/$(am__dirstamp)826 SynTree/TupleExpr.$(OBJEXT): SynTree/$(am__dirstamp) \827 SynTree/$(DEPDIR)/$(am__dirstamp)828 SynTree/CommaExpr.$(OBJEXT): SynTree/$(am__dirstamp) \829 SynTree/$(DEPDIR)/$(am__dirstamp)830 SynTree/TypeExpr.$(OBJEXT): SynTree/$(am__dirstamp) \831 SynTree/$(DEPDIR)/$(am__dirstamp)832 SynTree/ApplicationExpr.$(OBJEXT): SynTree/$(am__dirstamp) \833 SynTree/$(DEPDIR)/$(am__dirstamp)834 SynTree/AddressExpr.$(OBJEXT): SynTree/$(am__dirstamp) \835 SynTree/$(DEPDIR)/$(am__dirstamp)836 SynTree/Statement.$(OBJEXT): SynTree/$(am__dirstamp) \837 SynTree/$(DEPDIR)/$(am__dirstamp)838 SynTree/CompoundStmt.$(OBJEXT): SynTree/$(am__dirstamp) \839 SynTree/$(DEPDIR)/$(am__dirstamp)840 SynTree/DeclStmt.$(OBJEXT): SynTree/$(am__dirstamp) \841 SynTree/$(DEPDIR)/$(am__dirstamp)842 SynTree/Declaration.$(OBJEXT): SynTree/$(am__dirstamp) \843 SynTree/$(DEPDIR)/$(am__dirstamp)844 SynTree/DeclarationWithType.$(OBJEXT): SynTree/$(am__dirstamp) \845 SynTree/$(DEPDIR)/$(am__dirstamp)846 SynTree/ObjectDecl.$(OBJEXT): SynTree/$(am__dirstamp) \847 SynTree/$(DEPDIR)/$(am__dirstamp)848 SynTree/FunctionDecl.$(OBJEXT): SynTree/$(am__dirstamp) \849 SynTree/$(DEPDIR)/$(am__dirstamp)850 SynTree/AggregateDecl.$(OBJEXT): SynTree/$(am__dirstamp) \851 SynTree/$(DEPDIR)/$(am__dirstamp)852 SynTree/NamedTypeDecl.$(OBJEXT): SynTree/$(am__dirstamp) \853 SynTree/$(DEPDIR)/$(am__dirstamp)854 SynTree/TypeDecl.$(OBJEXT): SynTree/$(am__dirstamp) \855 SynTree/$(DEPDIR)/$(am__dirstamp)856 SynTree/Initializer.$(OBJEXT): SynTree/$(am__dirstamp) \857 SynTree/$(DEPDIR)/$(am__dirstamp)858 SynTree/TypeSubstitution.$(OBJEXT): SynTree/$(am__dirstamp) \859 SynTree/$(DEPDIR)/$(am__dirstamp)860 SynTree/Attribute.$(OBJEXT): SynTree/$(am__dirstamp) \861 SynTree/$(DEPDIR)/$(am__dirstamp)862 SynTree/DeclReplacer.$(OBJEXT): SynTree/$(am__dirstamp) \863 SynTree/$(DEPDIR)/$(am__dirstamp)864 Tuples/$(am__dirstamp):865 @$(MKDIR_P) Tuples866 @: > Tuples/$(am__dirstamp)867 Tuples/$(DEPDIR)/$(am__dirstamp):868 @$(MKDIR_P) Tuples/$(DEPDIR)869 @: > Tuples/$(DEPDIR)/$(am__dirstamp)870 Tuples/TupleAssignment.$(OBJEXT): Tuples/$(am__dirstamp) \871 Tuples/$(DEPDIR)/$(am__dirstamp)872 Tuples/TupleExpansion.$(OBJEXT): Tuples/$(am__dirstamp) \873 Tuples/$(DEPDIR)/$(am__dirstamp)874 Tuples/Explode.$(OBJEXT): Tuples/$(am__dirstamp) \875 Tuples/$(DEPDIR)/$(am__dirstamp)876 Validate/$(am__dirstamp):877 @$(MKDIR_P) Validate878 @: > Validate/$(am__dirstamp)879 Validate/$(DEPDIR)/$(am__dirstamp):880 @$(MKDIR_P) Validate/$(DEPDIR)881 @: > Validate/$(DEPDIR)/$(am__dirstamp)882 Validate/HandleAttributes.$(OBJEXT): Validate/$(am__dirstamp) \883 Validate/$(DEPDIR)/$(am__dirstamp)884 1055 Virtual/$(am__dirstamp): 885 1056 @$(MKDIR_P) Virtual … … 897 1068 @rm -f ../driver/cfa-cpp$(EXEEXT) 898 1069 $(AM_V_CXXLD)$(CXXLINK) $(___driver_cfa_cpp_OBJECTS) $(___driver_cfa_cpp_LDADD) $(LIBS) 1070 SymTab/demangler.$(OBJEXT): SymTab/$(am__dirstamp) \ 1071 SymTab/$(DEPDIR)/$(am__dirstamp) 1072 1073 demangler$(EXEEXT): $(demangler_OBJECTS) $(demangler_DEPENDENCIES) $(EXTRA_demangler_DEPENDENCIES) 1074 @rm -f demangler$(EXEEXT) 1075 $(AM_V_CXXLD)$(CXXLINK) $(demangler_OBJECTS) $(demangler_LDADD) $(LIBS) 899 1076 900 1077 mostlyclean-compile: … … 928 1105 @AMDEP_TRUE@@am__include@ @am__quote@CodeGen/$(DEPDIR)/OperatorTable.Po@am__quote@ 929 1106 @AMDEP_TRUE@@am__include@ @am__quote@CodeTools/$(DEPDIR)/DeclStats.Po@am__quote@ 1107 @AMDEP_TRUE@@am__include@ @am__quote@CodeTools/$(DEPDIR)/ResolvProtoDump.Po@am__quote@ 930 1108 @AMDEP_TRUE@@am__include@ @am__quote@CodeTools/$(DEPDIR)/TrackLoc.Po@am__quote@ 931 1109 @AMDEP_TRUE@@am__include@ @am__quote@Common/$(DEPDIR)/Assert.Po@am__quote@ … … 985 1163 @AMDEP_TRUE@@am__include@ @am__quote@ResolvExpr/$(DEPDIR)/Unify.Po@am__quote@ 986 1164 @AMDEP_TRUE@@am__include@ @am__quote@SymTab/$(DEPDIR)/Autogen.Po@am__quote@ 1165 @AMDEP_TRUE@@am__include@ @am__quote@SymTab/$(DEPDIR)/Demangle.Po@am__quote@ 987 1166 @AMDEP_TRUE@@am__include@ @am__quote@SymTab/$(DEPDIR)/FixFunction.Po@am__quote@ 988 1167 @AMDEP_TRUE@@am__include@ @am__quote@SymTab/$(DEPDIR)/Indexer.Po@am__quote@ 989 1168 @AMDEP_TRUE@@am__include@ @am__quote@SymTab/$(DEPDIR)/Mangler.Po@am__quote@ 1169 @AMDEP_TRUE@@am__include@ @am__quote@SymTab/$(DEPDIR)/ManglerCommon.Po@am__quote@ 990 1170 @AMDEP_TRUE@@am__include@ @am__quote@SymTab/$(DEPDIR)/Validate.Po@am__quote@ 1171 @AMDEP_TRUE@@am__include@ @am__quote@SymTab/$(DEPDIR)/demangler.Po@am__quote@ 991 1172 @AMDEP_TRUE@@am__include@ @am__quote@SynTree/$(DEPDIR)/AddressExpr.Po@am__quote@ 992 1173 @AMDEP_TRUE@@am__include@ @am__quote@SynTree/$(DEPDIR)/AggregateDecl.Po@am__quote@ … … 1136 1317 check: $(BUILT_SOURCES) 1137 1318 $(MAKE) $(AM_MAKEFLAGS) check-am 1138 all-am: Makefile $( PROGRAMS)1319 all-am: Makefile $(LIBRARIES) $(PROGRAMS) 1139 1320 installdirs: 1140 1321 for dir in "$(DESTDIR)$(cfa_cpplibdir)"; do \ … … 1209 1390 clean: clean-am 1210 1391 1211 clean-am: clean-cfa_cpplibPROGRAMS clean-generic mostlyclean-am 1392 clean-am: clean-cfa_cpplibPROGRAMS clean-generic clean-noinstLIBRARIES \ 1393 mostlyclean-am 1212 1394 1213 1395 distclean: distclean-am … … 1279 1461 1280 1462 .PHONY: CTAGS GTAGS TAGS all all-am check check-am clean \ 1281 clean-cfa_cpplibPROGRAMS clean-generic cscopelist-am ctags \ 1282 ctags-am distclean distclean-compile distclean-generic \ 1283 distclean-tags distdir dvi dvi-am html html-am info info-am \ 1284 install install-am install-cfa_cpplibPROGRAMS install-data \ 1285 install-data-am install-dvi install-dvi-am install-exec \ 1286 install-exec-am install-html install-html-am install-info \ 1287 install-info-am install-man install-pdf install-pdf-am \ 1288 install-ps install-ps-am install-strip installcheck \ 1289 installcheck-am installdirs maintainer-clean \ 1290 maintainer-clean-generic mostlyclean mostlyclean-compile \ 1291 mostlyclean-generic pdf pdf-am ps ps-am tags tags-am uninstall \ 1292 uninstall-am uninstall-cfa_cpplibPROGRAMS 1463 clean-cfa_cpplibPROGRAMS clean-generic clean-noinstLIBRARIES \ 1464 cscopelist-am ctags ctags-am distclean distclean-compile \ 1465 distclean-generic distclean-tags distdir dvi dvi-am html \ 1466 html-am info info-am install install-am \ 1467 install-cfa_cpplibPROGRAMS install-data install-data-am \ 1468 install-dvi install-dvi-am install-exec install-exec-am \ 1469 install-html install-html-am install-info install-info-am \ 1470 install-man install-pdf install-pdf-am install-ps \ 1471 install-ps-am install-strip installcheck installcheck-am \ 1472 installdirs maintainer-clean maintainer-clean-generic \ 1473 mostlyclean mostlyclean-compile mostlyclean-generic pdf pdf-am \ 1474 ps ps-am tags tags-am uninstall uninstall-am \ 1475 uninstall-cfa_cpplibPROGRAMS 1293 1476 1294 1477 .PRECIOUS: Makefile -
src/Parser/LinkageSpec.cc
r341bb80 r6d44da1 10 10 // Created On : Sat May 16 13:22:09 2015 11 11 // Last Modified By : Andrew Beach 12 // Last Modified On : Fri Jul 7 11:11:00 201713 // Update Count : 2 512 // Last Modified On : Thr Spt 12 15:59:00 2018 13 // Update Count : 26 14 14 // 15 15 … … 23 23 24 24 namespace LinkageSpec { 25 26 Spec linkageCheck( CodeLocation location, const string * spec ) {27 assert( spec );28 unique_ptr<const string> guard( spec ); // allocated by lexer29 if ( *spec == "\"Cforall\"" ) {30 return Cforall;31 } else if ( *spec == "\"C\"" ) {32 return C;33 } else if ( *spec == "\"BuiltinC\"" ) {34 return BuiltinC;35 } else {36 SemanticError( location, "Invalid linkage specifier " + *spec );37 } // if38 }39 25 40 26 Spec linkageUpdate( CodeLocation location, Spec old_spec, const string * cmd ) { -
src/Parser/LinkageSpec.h
r341bb80 r6d44da1 9 9 // Author : Rodolfo G. Esteves 10 10 // Created On : Sat May 16 13:24:28 2015 11 // Last Modified By : Peter A. Buhr12 // Last Modified On : Mon Jul 2 07:46:49201813 // Update Count : 1 611 // Last Modified By : Andrew Beach 12 // Last Modified On : Thr Spt 13 15:59:00 2018 13 // Update Count : 17 14 14 // 15 15 … … 41 41 42 42 43 Spec linkageCheck( CodeLocation location, const std::string * );44 // Returns the Spec with the given name (limited to C, Cforall & BuiltinC)45 43 Spec linkageUpdate( CodeLocation location, Spec old_spec, const std::string * cmd ); 46 44 /* If cmd = "C" returns a Spec that is old_spec with is_mangled = false -
src/Parser/lex.ll
r341bb80 r6d44da1 10 10 * Created On : Sat Sep 22 08:58:10 2001 11 11 * Last Modified By : Peter A. Buhr 12 * Last Modified On : Wed Aug 8 17:23:17201813 * Update Count : 68 512 * Last Modified On : Wed Aug 29 15:02:41 2018 13 * Update Count : 686 14 14 */ 15 15 … … 410 410 ">>=" { NAMEDOP_RETURN(RSassign); } 411 411 412 "~=" { NAMEDOP_RETURN(Erange); } // CFA413 412 "@=" { NAMEDOP_RETURN(ATassign); } // CFA 413 "~=" { NAMEDOP_RETURN(ErangeUpEq); } // CFA 414 "-~" { NAMEDOP_RETURN(ErangeDown); } // CFA 415 "-~=" { NAMEDOP_RETURN(ErangeDownEq); } // CFA 414 416 415 417 /* CFA, operator identifier */ -
src/Parser/parser.yy
r341bb80 r6d44da1 10 10 // Created On : Sat Sep 1 20:22:55 2001 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Wed Aug 8 17:50:07201813 // Update Count : 399812 // Last Modified On : Thu Aug 30 17:02:25 2018 13 // Update Count : 4029 14 14 // 15 15 … … 186 186 } // fieldDecl 187 187 188 ExpressionNode *forInc( const OperKinds op ) { 189 return new ExpressionNode( build_constantInteger( *new string( op == OperKinds::LThan || op == OperKinds::LEThan ? "1" : "-1" ) ) ); 190 } // forInc 191 188 192 ForCtrl * forCtrl( ExpressionNode * type, string * index, ExpressionNode * start, enum OperKinds compop, ExpressionNode * comp, ExpressionNode * inc ) { 193 ConstantExpr *constant = dynamic_cast<ConstantExpr *>(type->get_expr()); 194 if ( constant && (constant->get_constant()->get_value() == "0" || constant->get_constant()->get_value() == "1") ) { 195 type = new ExpressionNode( new CastExpr( maybeMoveBuild< Expression >(type), new BasicType( Type::Qualifiers(), BasicType::SignedInt ) ) ); 196 } // if 189 197 return new ForCtrl( 190 198 distAttr( DeclarationNode::newTypeof( type ), DeclarationNode::newName( index )->addInitializer( new InitializerNode( start ) ) ), … … 214 222 215 223 // Types declaration for productions 216 %union 217 { 224 %union { 218 225 Token tok; 219 226 ParseNode * pn; … … 290 297 %token ANDassign ERassign ORassign // &= ^= |= 291 298 292 %token Erange //~=299 %token ErangeUpEq ErangeDown ErangeDownEq // ~= -~ -~= 293 300 %token ATassign // @= 294 301 … … 1138 1145 $$ = new ForCtrl( (ExpressionNode * )nullptr, (ExpressionNode * )nullptr, (ExpressionNode * )nullptr ); 1139 1146 } else { 1140 $$ = forCtrl( $1, new string( DeclarationNode::anonymous.newName() ), new ExpressionNode( build_constantInteger( *new string( "0" ) ) ), OperKinds::LThan, $1->clone(),1141 new ExpressionNode( build_constantInteger( *new string( "1" ) )) );1147 $$ = forCtrl( $1, new string( DeclarationNode::anonymous.newName() ), new ExpressionNode( build_constantInteger( *new string( "0" ) ) ), 1148 OperKinds::LThan, $1->clone(), forInc( OperKinds::LThan ) ); 1142 1149 } // if 1143 1150 } 1144 1151 | constant_expression inclexcl constant_expression // CFA 1145 { $$ = forCtrl( $1, new string( DeclarationNode::anonymous.newName() ), $1->clone(), $2, $3, new ExpressionNode( build_constantInteger( *new string( "1" ) )) ); }1152 { $$ = forCtrl( $1, new string( DeclarationNode::anonymous.newName() ), $1->clone(), $2, $3, forInc( $2 ) ); } 1146 1153 | constant_expression inclexcl constant_expression '~' constant_expression // CFA 1147 1154 { $$ = forCtrl( $1, new string( DeclarationNode::anonymous.newName() ), $1->clone(), $2, $3, $5 ); } … … 1154 1161 } else { 1155 1162 if ( NameExpr *identifier = dynamic_cast<NameExpr *>($1->get_expr()) ) { 1156 $$ = forCtrl( $3, new string( identifier->name ), new ExpressionNode( build_constantInteger( *new string( "0" ) ) ), OperKinds::LThan, $3->clone(),1157 new ExpressionNode( build_constantInteger( *new string( "1" ) )) );1163 $$ = forCtrl( $3, new string( identifier->name ), new ExpressionNode( build_constantInteger( *new string( "0" ) ) ), 1164 OperKinds::LThan, $3->clone(), forInc( OperKinds::LThan ) ); 1158 1165 } else { 1159 1166 SemanticError( yylloc, "Expression disallowed. Only loop-index name allowed" ); $$ = nullptr; … … 1167 1174 } else { 1168 1175 if ( NameExpr *identifier = dynamic_cast<NameExpr *>($1->get_expr()) ) { 1169 $$ = forCtrl( $3, new string( identifier->name ), $3->clone(), $4, $5, new ExpressionNode( build_constantInteger( *new string( "1" ) )) );1176 $$ = forCtrl( $3, new string( identifier->name ), $3->clone(), $4, $5, forInc( $4 ) ); 1170 1177 } else { 1171 1178 SemanticError( yylloc, "Expression disallowed. Only loop-index name allowed" ); $$ = nullptr; … … 1194 1201 '~' 1195 1202 { $$ = OperKinds::LThan; } 1196 | Erange 1203 | ErangeUpEq 1197 1204 { $$ = OperKinds::LEThan; }