Changes in / [f9feab8:90152a4]
- Files:
-
- 915 added
- 670 deleted
- 163 edited
-
.autom4te.cfg (added)
-
.gitignore (modified) (2 diffs)
-
Jenkins/FullBuild (modified) (3 diffs)
-
Jenkins/TestRegen (modified) (4 diffs)
-
Jenkinsfile (modified) (13 diffs)
-
Makefile.am (modified) (2 diffs)
-
Makefile.in (modified) (18 diffs)
-
README (modified) (2 diffs)
-
aclocal.m4 (modified) (2 diffs)
-
automake/cfa.m4 (added)
-
automake/compile (modified) (1 diff, 1 prop)
-
automake/config.guess (modified) (1 diff, 1 prop)
-
automake/config.sub (modified) (1 diff, 1 prop)
-
automake/depcomp (modified) (1 diff, 1 prop)
-
automake/install-sh (modified) (1 diff, 1 prop)
-
automake/missing (modified) (1 diff, 1 prop)
-
automake/test-driver (modified) (1 diff, 1 prop)
-
automake/ylwrap (modified) (1 diff, 1 prop)
-
benchmark/Makefile.am (added)
-
benchmark/Makefile.in (added)
-
benchmark/Monitor.c (added)
-
benchmark/bench.h (added)
-
benchmark/compile/empty.c (added)
-
benchmark/creation/JavaThread.java (added)
-
benchmark/creation/cfa_cor.c (added)
-
benchmark/creation/cfa_thrd.c (added)
-
benchmark/creation/goroutine.go (added)
-
benchmark/creation/pthreads.c (added)
-
benchmark/creation/upp_cor.cc (added)
-
benchmark/creation/upp_thrd.cc (added)
-
benchmark/ctxswitch/JavaThread.java (added)
-
benchmark/ctxswitch/cfa_cor.c (added)
-
benchmark/ctxswitch/cfa_thrd.c (added)
-
benchmark/ctxswitch/cfa_thrd2.c (added)
-
benchmark/ctxswitch/goroutine.go (added)
-
benchmark/ctxswitch/kos_fibre.cpp (added)
-
benchmark/ctxswitch/kos_fibre2.cpp (added)
-
benchmark/ctxswitch/pthreads.c (added)
-
benchmark/ctxswitch/upp_cor.cc (added)
-
benchmark/ctxswitch/upp_thrd.cc (added)
-
benchmark/fetch_add.c (added)
-
benchmark/function.c (added)
-
benchmark/interrupt_linux.c (added)
-
benchmark/loop.c (added)
-
benchmark/mutex/JavaThread.java (added)
-
benchmark/mutex/cfa1.c (added)
-
benchmark/mutex/cfa2.c (added)
-
benchmark/mutex/cfa4.c (added)
-
benchmark/mutex/pthreads.c (added)
-
benchmark/mutex/upp.cc (added)
-
benchmark/schedext/cfa1.c (added)
-
benchmark/schedext/cfa2.c (added)
-
benchmark/schedext/cfa4.c (added)
-
benchmark/schedext/upp.cc (added)
-
benchmark/schedint/JavaThread.java (added)
-
benchmark/schedint/cfa1.c (added)
-
benchmark/schedint/cfa2.c (added)
-
benchmark/schedint/cfa4.c (added)
-
benchmark/schedint/pthreads.c (added)
-
benchmark/schedint/upp.cc (added)
-
config.h.in (deleted)
-
configure (modified) (30 diffs)
-
configure.ac (modified) (4 diffs)
-
doc/LaTeXmacros/common.tex (modified) (14 diffs)
-
doc/LaTeXmacros/lstlang.sty (modified) (4 diffs)
-
doc/NDA/Aaron_Moss-Rob_Schluntz-Thierry_Delisle.pdf (added)
-
doc/NDA/Cover_Letter.pdf (added)
-
doc/NDA/Daniel_Caccamo.pdf (added)
-
doc/NDA/NDA.pdf (added)
-
doc/NDA/Neda_Paryab.pdf (added)
-
doc/NDA/Peter_Buhr-30-jul-2014.pdf (added)
-
doc/aaron_comp_II/.gitignore (deleted)
-
doc/aaron_comp_II/Efficient Type Resolution in Cforall.pptx (deleted)
-
doc/aaron_comp_II/Makefile (deleted)
-
doc/aaron_comp_II/comp_II.tex (deleted)
-
doc/aaron_comp_II/conversion_dag.eps (deleted)
-
doc/aaron_comp_II/conversion_dag.odg (deleted)
-
doc/aaron_comp_II/conversion_dag.png (deleted)
-
doc/aaron_comp_II/resolution_dag.eps (deleted)
-
doc/aaron_comp_II/resolution_dag.odg (deleted)
-
doc/aaron_comp_II/resolution_dag.png (deleted)
-
doc/aaron_comp_II/resolution_dag2.odg (deleted)
-
doc/aaron_comp_II/resolution_dag2.png (deleted)
-
doc/bibliography/cfa.bib (deleted)
-
doc/bibliography/pl.bib (added)
-
doc/generic_types/.gitignore (deleted)
-
doc/generic_types/ACM-Reference-Format.bst (deleted)
-
doc/generic_types/Makefile (deleted)
-
doc/generic_types/acmart-pacmpl-template.tex (deleted)
-
doc/generic_types/acmart.cls (deleted)
-
doc/generic_types/evaluation/.gitignore (deleted)
-
doc/generic_types/evaluation/Makefile (deleted)
-
doc/generic_types/evaluation/bench.h (deleted)
-
doc/generic_types/evaluation/bench.hpp (deleted)
-
doc/generic_types/evaluation/c-bench.c (deleted)
-
doc/generic_types/evaluation/c-pair.c (deleted)
-
doc/generic_types/evaluation/c-pair.h (deleted)
-
doc/generic_types/evaluation/c-print.c (deleted)
-
doc/generic_types/evaluation/c-print.h (deleted)
-
doc/generic_types/evaluation/c-stack.c (deleted)
-
doc/generic_types/evaluation/c-stack.h (deleted)
-
doc/generic_types/evaluation/cfa-bench.c (deleted)
-
doc/generic_types/evaluation/cfa-pair.c (deleted)
-
doc/generic_types/evaluation/cfa-pair.h (deleted)
-
doc/generic_types/evaluation/cfa-print.c (deleted)
-
doc/generic_types/evaluation/cfa-print.h (deleted)
-
doc/generic_types/evaluation/cfa-stack.c (deleted)
-
doc/generic_types/evaluation/cfa-stack.h (deleted)
-
doc/generic_types/evaluation/cpp-bench.cpp (deleted)
-
doc/generic_types/evaluation/cpp-pair.hpp (deleted)
-
doc/generic_types/evaluation/cpp-print.hpp (deleted)
-
doc/generic_types/evaluation/cpp-stack.hpp (deleted)
-
doc/generic_types/evaluation/cpp-vbench.cpp (deleted)
-
doc/generic_types/evaluation/cpp-vprint.hpp (deleted)
-
doc/generic_types/evaluation/cpp-vstack.cpp (deleted)
-
doc/generic_types/evaluation/cpp-vstack.hpp (deleted)
-
doc/generic_types/evaluation/object.hpp (deleted)
-
doc/generic_types/evaluation/timing.dat (deleted)
-
doc/generic_types/evaluation/timing.gp (deleted)
-
doc/generic_types/evaluation/timing.xlsx (deleted)
-
doc/generic_types/generic_types.tex (deleted)
-
doc/generic_types/mail (deleted)
-
doc/generic_types/refereeReport.txt (deleted)
-
doc/nda/Aaron_Moss-Rob_Schluntz-Thierry_Delisle.pdf (deleted)
-
doc/nda/Cover_Letter.pdf (deleted)
-
doc/nda/Daniel_Caccamo.pdf (deleted)
-
doc/nda/NDA.pdf (deleted)
-
doc/nda/Neda_Paryab.pdf (deleted)
-
doc/nda/Peter_Buhr-30-jul-2014.pdf (deleted)
-
doc/papers/AMA/AMA-stix-1510051231000.zip (added)
-
doc/papers/AMA/AMA-stix/Documents/.log (added)
-
doc/papers/AMA/AMA-stix/Documents/README.txt (added)
-
doc/papers/AMA/AMA-stix/Documents/wileyNJD-Doc.pdf (added)
-
doc/papers/AMA/AMA-stix/Documents/wileyNJD-Doc.tex (added)
-
doc/papers/AMA/AMA-stix/Stix-fonts/STIXGeneral-Bold.pfb (added)
-
doc/papers/AMA/AMA-stix/Stix-fonts/STIXGeneral-BoldItalic.pfb (added)
-
doc/papers/AMA/AMA-stix/Stix-fonts/STIXGeneral-Italic.pfb (added)
-
doc/papers/AMA/AMA-stix/Stix-fonts/STIXGeneral-Regular.pfb (added)
-
doc/papers/AMA/AMA-stix/Stix-fonts/Windows-Stix-fontinstaller.exe (added)
-
doc/papers/AMA/AMA-stix/Stix-fonts/a_axxd65.enc (added)
-
doc/papers/AMA/AMA-stix/Stix-fonts/ls1stix.fd (added)
-
doc/papers/AMA/AMA-stix/Stix-fonts/ls1stixbb.fd (added)
-
doc/papers/AMA/AMA-stix/Stix-fonts/ls1stixfrak.fd (added)
-
doc/papers/AMA/AMA-stix/Stix-fonts/ls1stixscr.fd (added)
-
doc/papers/AMA/AMA-stix/Stix-fonts/ls1stixsf.fd (added)
-
doc/papers/AMA/AMA-stix/Stix-fonts/ls2stix.fd (added)
-
doc/papers/AMA/AMA-stix/Stix-fonts/ls2stixcal.fd (added)
-
doc/papers/AMA/AMA-stix/Stix-fonts/ls2stixex.fd (added)
-
doc/papers/AMA/AMA-stix/Stix-fonts/ls2stixtt.fd (added)
-
doc/papers/AMA/AMA-stix/Stix-fonts/ly1sti.fd (added)
-
doc/papers/AMA/AMA-stix/Stix-fonts/ot1-stixgeneral-bold.tfm (added)
-
doc/papers/AMA/AMA-stix/Stix-fonts/ot1-stixgeneral-bolditalic.tfm (added)
-
doc/papers/AMA/AMA-stix/Stix-fonts/ot1-stixgeneral-italic.tfm (added)
-
doc/papers/AMA/AMA-stix/Stix-fonts/ot1-stixgeneral.tfm (added)
-
doc/papers/AMA/AMA-stix/Stix-fonts/ot1-stixgeneralsc-bold.tfm (added)
-
doc/papers/AMA/AMA-stix/Stix-fonts/ot1-stixgeneralsc-bold.vf (added)
-
doc/papers/AMA/AMA-stix/Stix-fonts/ot1-stixgeneralsc.tfm (added)
-
doc/papers/AMA/AMA-stix/Stix-fonts/ot1-stixgeneralsc.vf (added)
-
doc/papers/AMA/AMA-stix/Stix-fonts/ot1stix.fd (added)
-
doc/papers/AMA/AMA-stix/Stix-fonts/ot2-stixgeneral-bold.tfm (added)
-
doc/papers/AMA/AMA-stix/Stix-fonts/ot2-stixgeneral-bolditalic.tfm (added)
-
doc/papers/AMA/AMA-stix/Stix-fonts/ot2-stixgeneral-italic.tfm (added)
-
doc/papers/AMA/AMA-stix/Stix-fonts/ot2-stixgeneral.tfm (added)
-
doc/papers/AMA/AMA-stix/Stix-fonts/ot2-stixgeneralsc-bold.tfm (added)
-
doc/papers/AMA/AMA-stix/Stix-fonts/ot2-stixgeneralsc-bold.vf (added)
-
doc/papers/AMA/AMA-stix/Stix-fonts/ot2-stixgeneralsc.tfm (added)
-
doc/papers/AMA/AMA-stix/Stix-fonts/ot2-stixgeneralsc.vf (added)
-
doc/papers/AMA/AMA-stix/Stix-fonts/ot2stix.fd (added)
-
doc/papers/AMA/AMA-stix/Stix-fonts/stix-extra1.enc (added)
-
doc/papers/AMA/AMA-stix/Stix-fonts/stix-extra1.tfm (added)
-
doc/papers/AMA/AMA-stix/Stix-fonts/stix-extra2.enc (added)
-
doc/papers/AMA/AMA-stix/Stix-fonts/stix-extra2.tfm (added)
-
doc/papers/AMA/AMA-stix/Stix-fonts/stix-extra3.enc (added)
-
doc/papers/AMA/AMA-stix/Stix-fonts/stix-extra3.tfm (added)
-
doc/papers/AMA/AMA-stix/Stix-fonts/stix-mathbb-bold.pfb (added)
-
doc/papers/AMA/AMA-stix/Stix-fonts/stix-mathbb-bold.tfm (added)
-
doc/papers/AMA/AMA-stix/Stix-fonts/stix-mathbb.pfb (added)
-
doc/papers/AMA/AMA-stix/Stix-fonts/stix-mathbb.tfm (added)
-
doc/papers/AMA/AMA-stix/Stix-fonts/stix-mathbbit-bold.pfb (added)
-
doc/papers/AMA/AMA-stix/Stix-fonts/stix-mathbbit-bold.tfm (added)
-
doc/papers/AMA/AMA-stix/Stix-fonts/stix-mathbbit.pfb (added)
-
doc/papers/AMA/AMA-stix/Stix-fonts/stix-mathbbit.tfm (added)
-
doc/papers/AMA/AMA-stix/Stix-fonts/stix-mathcal-bold.pfb (added)
-
doc/papers/AMA/AMA-stix/Stix-fonts/stix-mathcal-bold.tfm (added)
-
doc/papers/AMA/AMA-stix/Stix-fonts/stix-mathcal.pfb (added)
-
doc/papers/AMA/AMA-stix/Stix-fonts/stix-mathcal.tfm (added)
-
doc/papers/AMA/AMA-stix/Stix-fonts/stix-mathex-bold.pfb (added)
-
doc/papers/AMA/AMA-stix/Stix-fonts/stix-mathex-bold.tfm (added)
-
doc/papers/AMA/AMA-stix/Stix-fonts/stix-mathex.pfb (added)
-
doc/papers/AMA/AMA-stix/Stix-fonts/stix-mathex.tfm (added)
-
doc/papers/AMA/AMA-stix/Stix-fonts/stix-mathfrak-bold.pfb (added)
-
doc/papers/AMA/AMA-stix/Stix-fonts/stix-mathfrak-bold.tfm (added)
-
doc/papers/AMA/AMA-stix/Stix-fonts/stix-mathfrak.pfb (added)
-
doc/papers/AMA/AMA-stix/Stix-fonts/stix-mathfrak.tfm (added)
-
doc/papers/AMA/AMA-stix/Stix-fonts/stix-mathit-bold.pfb (added)
-
doc/papers/AMA/AMA-stix/Stix-fonts/stix-mathit-bold.tfm (added)
-
doc/papers/AMA/AMA-stix/Stix-fonts/stix-mathit.pfb (added)
-
doc/papers/AMA/AMA-stix/Stix-fonts/stix-mathit.tfm (added)
-
doc/papers/AMA/AMA-stix/Stix-fonts/stix-mathrm-bold.pfb (added)
-
doc/papers/AMA/AMA-stix/Stix-fonts/stix-mathrm-bold.tfm (added)
-
doc/papers/AMA/AMA-stix/Stix-fonts/stix-mathrm.pfb (added)
-
doc/papers/AMA/AMA-stix/Stix-fonts/stix-mathrm.tfm (added)
-
doc/papers/AMA/AMA-stix/Stix-fonts/stix-mathscr-bold.pfb (added)
-
doc/papers/AMA/AMA-stix/Stix-fonts/stix-mathscr-bold.tfm (added)
-
doc/papers/AMA/AMA-stix/Stix-fonts/stix-mathscr.pfb (added)
-
doc/papers/AMA/AMA-stix/Stix-fonts/stix-mathscr.tfm (added)
-
doc/papers/AMA/AMA-stix/Stix-fonts/stix-mathsf-bold.pfb (added)
-
doc/papers/AMA/AMA-stix/Stix-fonts/stix-mathsf-bold.tfm (added)
-
doc/papers/AMA/AMA-stix/Stix-fonts/stix-mathsf.pfb (added)
-
doc/papers/AMA/AMA-stix/Stix-fonts/stix-mathsf.tfm (added)
-
doc/papers/AMA/AMA-stix/Stix-fonts/stix-mathsfit-bold.pfb (added)
-
doc/papers/AMA/AMA-stix/Stix-fonts/stix-mathsfit-bold.tfm (added)
-
doc/papers/AMA/AMA-stix/Stix-fonts/stix-mathsfit.pfb (added)
-
doc/papers/AMA/AMA-stix/Stix-fonts/stix-mathsfit.tfm (added)
-
doc/papers/AMA/AMA-stix/Stix-fonts/stix-mathtt-bold.pfb (added)
-
doc/papers/AMA/AMA-stix/Stix-fonts/stix-mathtt-bold.tfm (added)
-
doc/papers/AMA/AMA-stix/Stix-fonts/stix-mathtt.pfb (added)
-
doc/papers/AMA/AMA-stix/Stix-fonts/stix-mathtt.tfm (added)
-
doc/papers/AMA/AMA-stix/Stix-fonts/stix-ot1.enc (added)
-
doc/papers/AMA/AMA-stix/Stix-fonts/stix-ot2.enc (added)
-
doc/papers/AMA/AMA-stix/Stix-fonts/stix-t1.enc (added)
-
doc/papers/AMA/AMA-stix/Stix-fonts/stix-ts1.enc (added)
-
doc/papers/AMA/AMA-stix/Stix-fonts/stix.dtx (added)
-
doc/papers/AMA/AMA-stix/Stix-fonts/stix.fdd (added)
-
doc/papers/AMA/AMA-stix/Stix-fonts/stix.map (added)
-
doc/papers/AMA/AMA-stix/Stix-fonts/stix.sty (added)
-
doc/papers/AMA/AMA-stix/Stix-fonts/t1-stixgeneral-bold.tfm (added)
-
doc/papers/AMA/AMA-stix/Stix-fonts/t1-stixgeneral-bolditalic.tfm (added)
-
doc/papers/AMA/AMA-stix/Stix-fonts/t1-stixgeneral-italic.tfm (added)
-
doc/papers/AMA/AMA-stix/Stix-fonts/t1-stixgeneral.tfm (added)
-
doc/papers/AMA/AMA-stix/Stix-fonts/t1-stixgeneralsc-bold.tfm (added)
-
doc/papers/AMA/AMA-stix/Stix-fonts/t1-stixgeneralsc-bold.vf (added)
-
doc/papers/AMA/AMA-stix/Stix-fonts/t1-stixgeneralsc.tfm (added)
-
doc/papers/AMA/AMA-stix/Stix-fonts/t1-stixgeneralsc.vf (added)
-
doc/papers/AMA/AMA-stix/Stix-fonts/t1stix.fd (added)
-
doc/papers/AMA/AMA-stix/Stix-fonts/ts1-stixgeneral-bold.tfm (added)
-
doc/papers/AMA/AMA-stix/Stix-fonts/ts1-stixgeneral-bolditalic.tfm (added)
-
doc/papers/AMA/AMA-stix/Stix-fonts/ts1-stixgeneral-italic.tfm (added)
-
doc/papers/AMA/AMA-stix/Stix-fonts/ts1-stixgeneral.tfm (added)
-
doc/papers/AMA/AMA-stix/Stix-fonts/ts1stix.fd (added)
-
doc/papers/AMA/AMA-stix/ama/NJDnatbib.sty (added)
-
doc/papers/AMA/AMA-stix/ama/WileyNJD-AMA.bst (added)
-
doc/papers/AMA/AMA-stix/ama/WileyNJD-AMA.bst.orig (added)
-
doc/papers/AMA/AMA-stix/ama/WileyNJD-v2.cls (added)
-
doc/papers/AMA/AMA-stix/ama/empty.eps (added)
-
doc/papers/AMA/AMA-stix/ama/empty.pdf (added)
-
doc/papers/AMA/AMA-stix/ama/wileyNJD-AMA.bbl (added)
-
doc/papers/AMA/AMA-stix/ama/wileyNJD-AMA.bib (added)
-
doc/papers/AMA/AMA-stix/ama/wileyNJD-AMA.pdf (added)
-
doc/papers/AMA/AMA-stix/ama/wileyNJD-AMA.tex (added)
-
doc/papers/Baker82.pdf (deleted)
-
doc/papers/Bilson.pdf (deleted)
-
doc/papers/Bilson03.pdf (deleted)
-
doc/papers/Breuel.pdf (deleted)
-
doc/papers/Cormack81.pdf (deleted)
-
doc/papers/CormackWright90.pdf (deleted)
-
doc/papers/Ditchfield92.pdf (deleted)
-
doc/papers/Grossman06.pdf (deleted)
-
doc/papers/Jones97.pdf (deleted)
-
doc/papers/Laufer92.pdf (deleted)
-
doc/papers/OOPSLA17/.gitignore (added)
-
doc/papers/OOPSLA17/ACM-Reference-Format.bst (added)
-
doc/papers/OOPSLA17/Makefile (added)
-
doc/papers/OOPSLA17/acmart-pacmpl-template.tex (added)
-
doc/papers/OOPSLA17/acmart.cls (added)
-
doc/papers/OOPSLA17/evaluation/.gitignore (added)
-
doc/papers/OOPSLA17/evaluation/Makefile (added)
-
doc/papers/OOPSLA17/evaluation/bench.h (added)
-
doc/papers/OOPSLA17/evaluation/bench.hpp (added)
-
doc/papers/OOPSLA17/evaluation/c-bench.c (added)
-
doc/papers/OOPSLA17/evaluation/c-pair.c (added)
-
doc/papers/OOPSLA17/evaluation/c-pair.h (added)
-
doc/papers/OOPSLA17/evaluation/c-print.c (added)
-
doc/papers/OOPSLA17/evaluation/c-print.h (added)
-
doc/papers/OOPSLA17/evaluation/c-stack.c (added)
-
doc/papers/OOPSLA17/evaluation/c-stack.h (added)
-
doc/papers/OOPSLA17/evaluation/cfa-bench.c (added)
-
doc/papers/OOPSLA17/evaluation/cfa-pair.c (added)
-
doc/papers/OOPSLA17/evaluation/cfa-pair.h (added)
-
doc/papers/OOPSLA17/evaluation/cfa-print.c (added)
-
doc/papers/OOPSLA17/evaluation/cfa-print.h (added)
-
doc/papers/OOPSLA17/evaluation/cfa-stack.c (added)
-
doc/papers/OOPSLA17/evaluation/cfa-stack.h (added)
-
doc/papers/OOPSLA17/evaluation/cpp-bench.cpp (added)
-
doc/papers/OOPSLA17/evaluation/cpp-pair.hpp (added)
-
doc/papers/OOPSLA17/evaluation/cpp-print.hpp (added)
-
doc/papers/OOPSLA17/evaluation/cpp-stack.hpp (added)
-
doc/papers/OOPSLA17/evaluation/cpp-vbench.cpp (added)
-
doc/papers/OOPSLA17/evaluation/cpp-vprint.hpp (added)
-
doc/papers/OOPSLA17/evaluation/cpp-vstack.cpp (added)
-
doc/papers/OOPSLA17/evaluation/cpp-vstack.hpp (added)
-
doc/papers/OOPSLA17/evaluation/object.hpp (added)
-
doc/papers/OOPSLA17/evaluation/timing.dat (added)
-
doc/papers/OOPSLA17/evaluation/timing.gp (added)
-
doc/papers/OOPSLA17/evaluation/timing.xlsx (added)
-
doc/papers/OOPSLA17/generic_types.tex (added)
-
doc/papers/OOPSLA17/mail (added)
-
doc/papers/OOPSLA17/refereeReport.txt (added)
-
doc/papers/Ziegler92.pdf (deleted)
-
doc/papers/concurrency/.gitignore (added)
-
doc/papers/concurrency/Makefile (added)
-
doc/papers/concurrency/Paper.tex (added)
-
doc/papers/concurrency/annex/local.bib (added)
-
doc/papers/concurrency/figures/RunTimeStructure.fig (added)
-
doc/papers/concurrency/figures/dependency.fig (added)
-
doc/papers/concurrency/figures/ext_monitor.fig (added)
-
doc/papers/concurrency/figures/int_monitor.fig (added)
-
doc/papers/concurrency/figures/monitor.fig (added)
-
doc/papers/concurrency/figures/monitor_structs.fig (added)
-
doc/papers/concurrency/figures/system.fig (added)
-
doc/papers/concurrency/mail (added)
-
doc/papers/general/.gitignore (added)
-
doc/papers/general/Makefile (added)
-
doc/papers/general/Paper.tex (added)
-
doc/papers/general/evaluation/.gitignore (added)
-
doc/papers/general/evaluation/Makefile (added)
-
doc/papers/general/evaluation/bench.h (added)
-
doc/papers/general/evaluation/bench.hpp (added)
-
doc/papers/general/evaluation/c-bench.c (added)
-
doc/papers/general/evaluation/c-pair.c (added)
-
doc/papers/general/evaluation/c-pair.h (added)
-
doc/papers/general/evaluation/c-print.c (added)
-
doc/papers/general/evaluation/c-print.h (added)
-
doc/papers/general/evaluation/c-stack.c (added)
-
doc/papers/general/evaluation/c-stack.h (added)
-
doc/papers/general/evaluation/cfa-bench.c (added)
-
doc/papers/general/evaluation/cfa-pair.c (added)
-
doc/papers/general/evaluation/cfa-pair.h (added)
-
doc/papers/general/evaluation/cfa-print.c (added)
-
doc/papers/general/evaluation/cfa-print.h (added)
-
doc/papers/general/evaluation/cfa-stack.c (added)
-
doc/papers/general/evaluation/cfa-stack.h (added)
-
doc/papers/general/evaluation/cpp-bench.cpp (added)
-
doc/papers/general/evaluation/cpp-pair.hpp (added)
-
doc/papers/general/evaluation/cpp-print.hpp (added)
-
doc/papers/general/evaluation/cpp-stack.hpp (added)
-
doc/papers/general/evaluation/cpp-vbench.cpp (added)
-
doc/papers/general/evaluation/cpp-vprint.hpp (added)
-
doc/papers/general/evaluation/cpp-vstack.cpp (added)
-
doc/papers/general/evaluation/cpp-vstack.hpp (added)
-
doc/papers/general/evaluation/object.hpp (added)
-
doc/papers/general/evaluation/timing.dat (added)
-
doc/papers/general/evaluation/timing.gp (added)
-
doc/papers/general/evaluation/timing.xlsx (added)
-
doc/papers/general/fig.tex (added)
-
doc/papers/general/figures/Cdecl.fig (added)
-
doc/papers/general/response (added)
-
doc/papers/refrat98.pdf (deleted)
-
doc/proposals/concurrency/.gitignore (deleted)
-
doc/proposals/concurrency/Makefile (deleted)
-
doc/proposals/concurrency/annex/glossary.tex (deleted)
-
doc/proposals/concurrency/annex/local.bib (deleted)
-
doc/proposals/concurrency/build/bump_ver.sh (deleted)
-
doc/proposals/concurrency/figures/dependency.fig (deleted)
-
doc/proposals/concurrency/figures/ext_monitor.fig (deleted)
-
doc/proposals/concurrency/figures/int_monitor.fig (deleted)
-
doc/proposals/concurrency/figures/monitor.fig (deleted)
-
doc/proposals/concurrency/figures/monitor_structs.fig (deleted)
-
doc/proposals/concurrency/figures/system.fig (deleted)
-
doc/proposals/concurrency/notes/cor-thread-traits.c (deleted)
-
doc/proposals/concurrency/notes/lit-review.md (deleted)
-
doc/proposals/concurrency/notes/notes.md (deleted)
-
doc/proposals/concurrency/style/cfa-format.tex (deleted)
-
doc/proposals/concurrency/style/style.tex (deleted)
-
doc/proposals/concurrency/text/basics.tex (deleted)
-
doc/proposals/concurrency/text/cforall.tex (deleted)
-
doc/proposals/concurrency/text/concurrency.tex (deleted)
-
doc/proposals/concurrency/text/frontpgs.tex (deleted)
-
doc/proposals/concurrency/text/future.tex (deleted)
-
doc/proposals/concurrency/text/internals.tex (deleted)
-
doc/proposals/concurrency/text/intro.tex (deleted)
-
doc/proposals/concurrency/text/parallelism.tex (deleted)
-
doc/proposals/concurrency/text/results.tex (deleted)
-
doc/proposals/concurrency/text/together.tex (deleted)
-
doc/proposals/concurrency/thePlan.md (deleted)
-
doc/proposals/concurrency/thesis.tex (deleted)
-
doc/proposals/concurrency/version (deleted)
-
doc/proposals/ctordtor/Makefile (modified) (3 diffs)
-
doc/proposals/ctordtor/ctor.tex (modified) (5 diffs)
-
doc/proposals/tuples/Makefile (modified) (3 diffs)
-
doc/proposals/tuples/tuples.tex (modified) (5 diffs)
-
doc/proposals/user_conversions.md (modified) (9 diffs)
-
doc/refrat/.gitignore (modified) (1 diff)
-
doc/refrat/Makefile (modified) (3 diffs)
-
doc/refrat/keywords.tex (modified) (2 diffs)
-
doc/refrat/refrat.bib (deleted)
-
doc/refrat/refrat.tex (modified) (4 diffs)
-
doc/related_papers/Baker82.pdf (added)
-
doc/related_papers/Bilson.pdf (added)
-
doc/related_papers/Bilson03.pdf (added)
-
doc/related_papers/Breuel.pdf (added)
-
doc/related_papers/Buhr94.pdf (added)
-
doc/related_papers/Cormack81.pdf (added)
-
doc/related_papers/CormackWright90.pdf (added)
-
doc/related_papers/Ditchfield92.pdf (added)
-
doc/related_papers/Grossman06.pdf (added)
-
doc/related_papers/Jones97.pdf (added)
-
doc/related_papers/Laufer92.pdf (added)
-
doc/related_papers/Ziegler92.pdf (added)
-
doc/related_papers/refrat98.pdf (added)
-
doc/rob_thesis/.gitignore (deleted)
-
doc/rob_thesis/Makefile (deleted)
-
doc/rob_thesis/cfa-format.tex (deleted)
-
doc/rob_thesis/conclusions.tex (deleted)
-
doc/rob_thesis/ctordtor.tex (deleted)
-
doc/rob_thesis/examples/conclusions/dtor.c (deleted)
-
doc/rob_thesis/examples/conclusions/except.c (deleted)
-
doc/rob_thesis/examples/conclusions/except.cc (deleted)
-
doc/rob_thesis/examples/ctor/array_ctor.c (deleted)
-
doc/rob_thesis/examples/ctor/copy_ctor.c (deleted)
-
doc/rob_thesis/examples/ctor/cv_ctor.c (deleted)
-
doc/rob_thesis/examples/ctor/enum_ctor.c (deleted)
-
doc/rob_thesis/examples/ctor/expr_ctor.c (deleted)
-
doc/rob_thesis/examples/ctor/global_ctor.c (deleted)
-
doc/rob_thesis/examples/ctor/hide_ctor.c (deleted)
-
doc/rob_thesis/examples/ctor/member.c (deleted)
-
doc/rob_thesis/examples/ctor/placement_ctor.c (deleted)
-
doc/rob_thesis/examples/ctor/return_dtor.c (deleted)
-
doc/rob_thesis/examples/ctor/static_ctor.c (deleted)
-
doc/rob_thesis/examples/ctor/union_ctor.c (deleted)
-
doc/rob_thesis/examples/intro/FileOutputStream.java (deleted)
-
doc/rob_thesis/examples/intro/compound_lit.c (deleted)
-
doc/rob_thesis/examples/intro/designation.c (deleted)
-
doc/rob_thesis/examples/intro/ignore.c (deleted)
-
doc/rob_thesis/examples/intro/ires.java (deleted)
-
doc/rob_thesis/examples/intro/res.java (deleted)
-
doc/rob_thesis/examples/intro/res1.java (deleted)
-
doc/rob_thesis/examples/intro/res2.java (deleted)
-
doc/rob_thesis/examples/intro/res3.java (deleted)
-
doc/rob_thesis/examples/intro/tuple.cc (deleted)
-
doc/rob_thesis/examples/intro/variadic.java (deleted)
-
doc/rob_thesis/examples/malloc.cc (deleted)
-
doc/rob_thesis/examples/nested.c (deleted)
-
doc/rob_thesis/examples/poly.c (deleted)
-
doc/rob_thesis/examples/scope_guard.h (deleted)
-
doc/rob_thesis/examples/test_scoped_guard.c (deleted)
-
doc/rob_thesis/examples/tuples/assign.c (deleted)
-
doc/rob_thesis/examples/tuples/cast.c (deleted)
-
doc/rob_thesis/examples/tuples/ctor.c (deleted)
-
doc/rob_thesis/examples/tuples/mrv.c (deleted)
-
doc/rob_thesis/examples/tuples/mrv_1.c (deleted)
-
doc/rob_thesis/examples/tuples/mrv_2.c (deleted)
-
doc/rob_thesis/examples/tuples/mrv_3.c (deleted)
-
doc/rob_thesis/examples/tuples/named.c (deleted)
-
doc/rob_thesis/examples/variadic/new.c (deleted)
-
doc/rob_thesis/examples/variadic/print.c (deleted)
-
doc/rob_thesis/examples/variadic/sum1.c (deleted)
-
doc/rob_thesis/examples/variadic/sum2.c (deleted)
-
doc/rob_thesis/intro.tex (deleted)
-
doc/rob_thesis/thesis-frontpgs.tex (deleted)
-
doc/rob_thesis/thesis.bib (deleted)
-
doc/rob_thesis/thesis.tex (deleted)
-
doc/rob_thesis/tuples.tex (deleted)
-
doc/rob_thesis/variadic.tex (deleted)
-
doc/theses/aaron_moss/comp_II/.gitignore (added)
-
doc/theses/aaron_moss/comp_II/Efficient Type Resolution in Cforall.pptx (added)
-
doc/theses/aaron_moss/comp_II/Makefile (added)
-
doc/theses/aaron_moss/comp_II/comp_II.tex (added)
-
doc/theses/aaron_moss/comp_II/conversion_dag.eps (added)
-
doc/theses/aaron_moss/comp_II/conversion_dag.odg (added)
-
doc/theses/aaron_moss/comp_II/conversion_dag.png (added)
-
doc/theses/aaron_moss/comp_II/resolution_dag.eps (added)
-
doc/theses/aaron_moss/comp_II/resolution_dag.odg (added)
-
doc/theses/aaron_moss/comp_II/resolution_dag.png (added)
-
doc/theses/aaron_moss/comp_II/resolution_dag2.odg (added)
-
doc/theses/aaron_moss/comp_II/resolution_dag2.png (added)
-
doc/theses/rob_schluntz/.gitignore (added)
-
doc/theses/rob_schluntz/Makefile (added)
-
doc/theses/rob_schluntz/cfa-format.tex (added)
-
doc/theses/rob_schluntz/conclusions.tex (added)
-
doc/theses/rob_schluntz/ctordtor.tex (added)
-
doc/theses/rob_schluntz/examples/conclusions/dtor.c (added)
-
doc/theses/rob_schluntz/examples/conclusions/except.c (added)
-
doc/theses/rob_schluntz/examples/conclusions/except.cc (added)
-
doc/theses/rob_schluntz/examples/ctor/array_ctor.c (added)
-
doc/theses/rob_schluntz/examples/ctor/copy_ctor.c (added)
-
doc/theses/rob_schluntz/examples/ctor/cv_ctor.c (added)
-
doc/theses/rob_schluntz/examples/ctor/enum_ctor.c (added)
-
doc/theses/rob_schluntz/examples/ctor/expr_ctor.c (added)
-
doc/theses/rob_schluntz/examples/ctor/global_ctor.c (added)
-
doc/theses/rob_schluntz/examples/ctor/hide_ctor.c (added)
-
doc/theses/rob_schluntz/examples/ctor/member.c (added)
-
doc/theses/rob_schluntz/examples/ctor/placement_ctor.c (added)
-
doc/theses/rob_schluntz/examples/ctor/return_dtor.c (added)
-
doc/theses/rob_schluntz/examples/ctor/static_ctor.c (added)
-
doc/theses/rob_schluntz/examples/ctor/union_ctor.c (added)
-
doc/theses/rob_schluntz/examples/intro/FileOutputStream.java (added)
-
doc/theses/rob_schluntz/examples/intro/compound_lit.c (added)
-
doc/theses/rob_schluntz/examples/intro/designation.c (added)
-
doc/theses/rob_schluntz/examples/intro/ignore.c (added)
-
doc/theses/rob_schluntz/examples/intro/ires.java (added)
-
doc/theses/rob_schluntz/examples/intro/res.java (added)
-
doc/theses/rob_schluntz/examples/intro/res1.java (added)
-
doc/theses/rob_schluntz/examples/intro/res2.java (added)
-
doc/theses/rob_schluntz/examples/intro/res3.java (added)
-
doc/theses/rob_schluntz/examples/intro/tuple.cc (added)
-
doc/theses/rob_schluntz/examples/intro/variadic.java (added)
-
doc/theses/rob_schluntz/examples/malloc.cc (added)
-
doc/theses/rob_schluntz/examples/nested.c (added)
-
doc/theses/rob_schluntz/examples/poly.c (added)
-
doc/theses/rob_schluntz/examples/scope_guard.h (added)
-
doc/theses/rob_schluntz/examples/test_scoped_guard.c (added)
-
doc/theses/rob_schluntz/examples/tuples/assign.c (added)
-
doc/theses/rob_schluntz/examples/tuples/cast.c (added)
-
doc/theses/rob_schluntz/examples/tuples/ctor.c (added)
-
doc/theses/rob_schluntz/examples/tuples/mrv.c (added)
-
doc/theses/rob_schluntz/examples/tuples/mrv_1.c (added)
-
doc/theses/rob_schluntz/examples/tuples/mrv_2.c (added)
-
doc/theses/rob_schluntz/examples/tuples/mrv_3.c (added)
-
doc/theses/rob_schluntz/examples/tuples/named.c (added)
-
doc/theses/rob_schluntz/examples/variadic/new.c (added)
-
doc/theses/rob_schluntz/examples/variadic/print.c (added)
-
doc/theses/rob_schluntz/examples/variadic/sum1.c (added)
-
doc/theses/rob_schluntz/examples/variadic/sum2.c (added)
-
doc/theses/rob_schluntz/intro.tex (added)
-
doc/theses/rob_schluntz/thesis-frontpgs.tex (added)
-
doc/theses/rob_schluntz/thesis.bib (added)
-
doc/theses/rob_schluntz/thesis.tex (added)
-
doc/theses/rob_schluntz/tuples.tex (added)
-
doc/theses/rob_schluntz/variadic.tex (added)
-
doc/theses/thierry_delisle/.gitignore (added)
-
doc/theses/thierry_delisle/Makefile (added)
-
doc/theses/thierry_delisle/annex/glossary.tex (added)
-
doc/theses/thierry_delisle/annex/local.bib (added)
-
doc/theses/thierry_delisle/figures/dependency.fig (added)
-
doc/theses/thierry_delisle/figures/ext_monitor.fig (added)
-
doc/theses/thierry_delisle/figures/int_monitor.fig (added)
-
doc/theses/thierry_delisle/figures/monitor.fig (added)
-
doc/theses/thierry_delisle/figures/monitor_structs.fig (added)
-
doc/theses/thierry_delisle/figures/system.fig (added)
-
doc/theses/thierry_delisle/notes/cor-thread-traits.c (added)
-
doc/theses/thierry_delisle/notes/lit-review.md (added)
-
doc/theses/thierry_delisle/notes/notes.md (added)
-
doc/theses/thierry_delisle/style/cfa-format.tex (added)
-
doc/theses/thierry_delisle/style/style.tex (added)
-
doc/theses/thierry_delisle/text/basics.tex (added)
-
doc/theses/thierry_delisle/text/cforall.tex (added)
-
doc/theses/thierry_delisle/text/concurrency.tex (added)
-
doc/theses/thierry_delisle/text/frontpgs.tex (added)
-
doc/theses/thierry_delisle/text/future.tex (added)
-
doc/theses/thierry_delisle/text/internals.tex (added)
-
doc/theses/thierry_delisle/text/intro.tex (added)
-
doc/theses/thierry_delisle/text/parallelism.tex (added)
-
doc/theses/thierry_delisle/text/results.tex (added)
-
doc/theses/thierry_delisle/text/together.tex (added)
-
doc/theses/thierry_delisle/thePlan.md (added)
-
doc/theses/thierry_delisle/thesis.tex (added)
-
doc/theses/thierry_delisle/version (added)
-
doc/theses/thierry_delisle/version.sh (added)
-
doc/user/.gitignore (modified) (1 diff)
-
doc/user/Cdecl.fig (deleted)
-
doc/user/EHMHierarchy.fig (deleted)
-
doc/user/Makefile (modified) (2 diffs)
-
doc/user/figures/Cdecl.fig (added)
-
doc/user/figures/EHMHierarchy.fig (added)
-
doc/user/figures/pointer1.fig (added)
-
doc/user/figures/pointer2.fig (added)
-
doc/user/pointer1.fig (deleted)
-
doc/user/pointer2.fig (deleted)
-
doc/user/user.tex (modified) (84 diffs)
-
doc/working/assertion_resolution.md (added)
-
doc/working/glen_conversions/float_promo.dia (added)
-
doc/working/glen_conversions/float_promo.png (added)
-
doc/working/glen_conversions/index.html (added)
-
driver/Makefile.am (added)
-
driver/Makefile.in (added)
-
driver/as.cc (added)
-
driver/cc1.cc (added)
-
driver/cfa.cc (added)
-
examples/ArrayN.c (added)
-
examples/Attributes.c (added)
-
examples/Initialization.c (added)
-
examples/Initialization2.c (added)
-
examples/Makefile.example (added)
-
examples/Members.c (added)
-
examples/Misc.c (added)
-
examples/MiscError.c (added)
-
examples/Rank2.c (added)
-
examples/Tuple.c (added)
-
examples/abstype.c (added)
-
examples/constructors.c (added)
-
examples/forward.c (added)
-
examples/gc_no_raii/.gitignore (added)
-
examples/gc_no_raii/bug-repro/assert.c (added)
-
examples/gc_no_raii/bug-repro/blockers.tar.gz (added)
-
examples/gc_no_raii/bug-repro/blockers/explicit_cast.c (added)
-
examples/gc_no_raii/bug-repro/blockers/file_scope.c (added)
-
examples/gc_no_raii/bug-repro/blockers/recursive_realloc.c (added)
-
examples/gc_no_raii/bug-repro/crash.c (added)
-
examples/gc_no_raii/bug-repro/deref.c (added)
-
examples/gc_no_raii/bug-repro/field.c (added)
-
examples/gc_no_raii/bug-repro/find.c (added)
-
examples/gc_no_raii/bug-repro/inline.c (added)
-
examples/gc_no_raii/bug-repro/malloc.c (added)
-
examples/gc_no_raii/bug-repro/not_equal.c (added)
-
examples/gc_no_raii/bug-repro/oddtype.c (added)
-
examples/gc_no_raii/bug-repro/push_back.c (added)
-
examples/gc_no_raii/bug-repro/push_back.h (added)
-
examples/gc_no_raii/bug-repro/realloc.c (added)
-
examples/gc_no_raii/bug-repro/return.c (added)
-
examples/gc_no_raii/bug-repro/return_template.c (added)
-
examples/gc_no_raii/bug-repro/slow_malloc.c (added)
-
examples/gc_no_raii/bug-repro/static_const_local.c (added)
-
examples/gc_no_raii/bug-repro/test-assert.cpp (added)
-
examples/gc_no_raii/bug-repro/void_pointer.c (added)
-
examples/gc_no_raii/bug-repro/while.c (added)
-
examples/gc_no_raii/bug-repro/zero.c (added)
-
examples/gc_no_raii/pool-alloc/allocate-malign.c (added)
-
examples/gc_no_raii/pool-alloc/allocate-malloc.c (added)
-
examples/gc_no_raii/pool-alloc/allocate-mmap.c (added)
-
examples/gc_no_raii/pool-alloc/allocate-win-valloc.c (added)
-
examples/gc_no_raii/premake4.lua (added)
-
examples/gc_no_raii/src/allocate-pool.c (added)
-
examples/gc_no_raii/src/allocate-pool.h (added)
-
examples/gc_no_raii/src/gc.h (added)
-
examples/gc_no_raii/src/gcpointers.c (added)
-
examples/gc_no_raii/src/gcpointers.h (added)
-
examples/gc_no_raii/src/internal/card_table.h (added)
-
examples/gc_no_raii/src/internal/collector.c (added)
-
examples/gc_no_raii/src/internal/collector.h (added)
-
examples/gc_no_raii/src/internal/gc_tools.h (added)
-
examples/gc_no_raii/src/internal/globals.h (added)
-
examples/gc_no_raii/src/internal/memory_pool.c (added)
-
examples/gc_no_raii/src/internal/memory_pool.h (added)
-
examples/gc_no_raii/src/internal/object_header.c (added)
-
examples/gc_no_raii/src/internal/object_header.h (added)
-
examples/gc_no_raii/src/internal/state.c (added)
-
examples/gc_no_raii/src/internal/state.h (added)
-
examples/gc_no_raii/src/test_include.c (added)
-
examples/gc_no_raii/src/tools.h (added)
-
examples/gc_no_raii/src/tools/checks.h (added)
-
examples/gc_no_raii/src/tools/print.c (added)
-
examples/gc_no_raii/src/tools/print.h (added)
-
examples/gc_no_raii/src/tools/worklist.h (added)
-
examples/gc_no_raii/test/badlll.c (added)
-
examples/gc_no_raii/test/gctest.c (added)
-
examples/gc_no_raii/test/operators.c (added)
-
examples/huge.c (added)
-
examples/includes.c (added)
-
examples/index.h (added)
-
examples/it_out.c (added)
-
examples/multicore.c (added)
-
examples/new.c (added)
-
examples/poly-bench.c (added)
-
examples/prolog.c (added)
-
examples/quad.c (added)
-
examples/s.c (added)
-
examples/simplePoly.c (added)
-
examples/simpler.c (added)
-
examples/specialize.c (added)
-
examples/square.c (added)
-
examples/twice.c (added)
-
examples/wrapper/.gitignore (added)
-
examples/wrapper/premake4.lua (added)
-
examples/wrapper/src/main.c (added)
-
examples/wrapper/src/pointer.h (added)
-
examples/zero_one.c (added)
-
libcfa/.autom4te.cfg (added)
-
libcfa/Makefile.am (added)
-
libcfa/Makefile.in (added)
-
libcfa/aclocal.m4 (added)
-
libcfa/automake/compile (added)
-
libcfa/automake/config.guess (added)
-
libcfa/automake/config.sub (added)
-
libcfa/automake/depcomp (added)
-
libcfa/automake/install-sh (added)
-
libcfa/automake/missing (added)
-
libcfa/configure (added)
-
libcfa/configure.ac (added)
-
libcfa/prelude/Makefile.am (added)
-
libcfa/prelude/Makefile.in (added)
-
libcfa/prelude/bootloader.cf (added)
-
libcfa/prelude/builtins.c (added)
-
libcfa/prelude/builtins.def (added)
-
libcfa/prelude/extras.c (added)
-
libcfa/prelude/extras.regx (added)
-
libcfa/prelude/prelude-gen.cc (added)
-
libcfa/prelude/prelude.old.cf (added)
-
libcfa/prelude/prototypes.awk (added)
-
libcfa/prelude/prototypes.c (added)
-
libcfa/prelude/prototypes.sed (added)
-
libcfa/prelude/sync-builtins.cf (added)
-
libcfa/prelude/sync-builtins.def (added)
-
libcfa/src/Makefile.am (added)
-
libcfa/src/Makefile.in (added)
-
libcfa/src/assert.cfa (added)
-
libcfa/src/bits/algorithm.hfa (added)
-
libcfa/src/bits/align.hfa (added)
-
libcfa/src/bits/containers.hfa (added)
-
libcfa/src/bits/debug.cfa (added)
-
libcfa/src/bits/debug.hfa (added)
-
libcfa/src/bits/defs.hfa (added)
-
libcfa/src/bits/locks.hfa (added)
-
libcfa/src/bits/signal.hfa (added)
-
libcfa/src/clock.hfa (added)
-
libcfa/src/common.cfa (added)
-
libcfa/src/common.hfa (added)
-
libcfa/src/concurrency/CtxSwitch-armv7l.S (added)
-
libcfa/src/concurrency/CtxSwitch-i386.S (added)
-
libcfa/src/concurrency/CtxSwitch-i686.S (added)
-
libcfa/src/concurrency/CtxSwitch-x64.S (added)
-
libcfa/src/concurrency/CtxSwitch-x86.S (added)
-
libcfa/src/concurrency/CtxSwitch-x86_64.S (added)
-
libcfa/src/concurrency/alarm.cfa (added)
-
libcfa/src/concurrency/alarm.hfa (added)
-
libcfa/src/concurrency/coroutine.cfa (added)
-
libcfa/src/concurrency/coroutine.hfa (added)
-
libcfa/src/concurrency/invoke.c (added)
-
libcfa/src/concurrency/invoke.h (added)
-
libcfa/src/concurrency/kernel.cfa (added)
-
libcfa/src/concurrency/kernel.hfa (added)
-
libcfa/src/concurrency/kernel_private.hfa (added)
-
libcfa/src/concurrency/monitor.cfa (added)
-
libcfa/src/concurrency/monitor.hfa (added)
-
libcfa/src/concurrency/mutex.cfa (added)
-
libcfa/src/concurrency/mutex.hfa (added)
-
libcfa/src/concurrency/preemption.cfa (added)
-
libcfa/src/concurrency/preemption.hfa (added)
-
libcfa/src/concurrency/thread.cfa (added)
-
libcfa/src/concurrency/thread.hfa (added)
-
libcfa/src/containers/maybe.cfa (added)
-
libcfa/src/containers/maybe.hfa (added)
-
libcfa/src/containers/pair.cfa (added)
-
libcfa/src/containers/pair.hfa (added)
-
libcfa/src/containers/result.cfa (added)
-
libcfa/src/containers/result.hfa (added)
-
libcfa/src/containers/vector.cfa (added)
-
libcfa/src/containers/vector.hfa (added)
-
libcfa/src/exception.c (added)
-
libcfa/src/exception.h (added)
-
libcfa/src/expat.h (added)
-
libcfa/src/fstream.cfa (added)
-
libcfa/src/fstream.hfa (added)
-
libcfa/src/gmp.hfa (added)
-
libcfa/src/heap.cfa (added)
-
libcfa/src/interpose.cfa (added)
-
libcfa/src/iostream.cfa (added)
-
libcfa/src/iostream.hfa (added)
-
libcfa/src/iterator.cfa (added)
-
libcfa/src/iterator.hfa (added)
-
libcfa/src/limits.cfa (added)
-
libcfa/src/limits.hfa (added)
-
libcfa/src/lsda.h (added)
-
libcfa/src/math.hfa (added)
-
libcfa/src/memcheck.awk (added)
-
libcfa/src/rational.cfa (added)
-
libcfa/src/rational.hfa (added)
-
libcfa/src/startup.cfa (added)
-
libcfa/src/startup.hfa (added)
-
libcfa/src/stdhdr/assert.h (added)
-
libcfa/src/stdhdr/bfdlink.h (added)
-
libcfa/src/stdhdr/complex.h (added)
-
libcfa/src/stdhdr/ctype.h (added)
-
libcfa/src/stdhdr/errno.h (added)
-
libcfa/src/stdhdr/fenv.h (added)
-
libcfa/src/stdhdr/float.h (added)
-
libcfa/src/stdhdr/gmp.h (added)
-
libcfa/src/stdhdr/hwloc.h (added)
-
libcfa/src/stdhdr/inttypes.h (added)
-
libcfa/src/stdhdr/iso646.h (added)
-
libcfa/src/stdhdr/krb5.h (added)
-
libcfa/src/stdhdr/limits.h (added)
-
libcfa/src/stdhdr/locale.h (added)
-
libcfa/src/stdhdr/malloc.h (added)
-
libcfa/src/stdhdr/math.h (added)
-
libcfa/src/stdhdr/setjmp.h (added)
-
libcfa/src/stdhdr/signal.h (added)
-
libcfa/src/stdhdr/stdalign.h (added)
-
libcfa/src/stdhdr/stdarg.h (added)
-
libcfa/src/stdhdr/stdatomic.h (added)
-
libcfa/src/stdhdr/stdbool.h (added)
-
libcfa/src/stdhdr/stddef.h (added)
-
libcfa/src/stdhdr/stdint.h (added)
-
libcfa/src/stdhdr/stdio.h (added)
-
libcfa/src/stdhdr/stdlib.h (added)
-
libcfa/src/stdhdr/stdnoreturn.h (added)
-
libcfa/src/stdhdr/string.h (added)
-
libcfa/src/stdhdr/sys/ucontext.h (added)
-
libcfa/src/stdhdr/tgmath.h (added)
-
libcfa/src/stdhdr/threads.h (added)
-
libcfa/src/stdhdr/time.h (added)
-
libcfa/src/stdhdr/uchar.h (added)
-
libcfa/src/stdhdr/unistd.h (added)
-
libcfa/src/stdhdr/wchar.h (added)
-
libcfa/src/stdhdr/wctype.h (added)
-
libcfa/src/stdlib.cfa (added)
-
libcfa/src/stdlib.hfa (added)
-
libcfa/src/time.cfa (added)
-
libcfa/src/time.hfa (added)
-
libcfa/src/time_t.hfa (added)
-
libcfa/src/virtual.c (added)
-
libcfa/src/virtual.h (added)
-
src/CodeGen/CodeGenerator.cc (modified) (22 diffs)
-
src/CodeGen/CodeGenerator.h (modified) (6 diffs)
-
src/CodeGen/FixMain.cc (modified) (3 diffs)
-
src/CodeGen/FixNames.cc (modified) (3 diffs)
-
src/CodeGen/GenType.cc (modified) (13 diffs)
-
src/CodeGen/Generate.cc (modified) (2 diffs)
-
src/CodeGen/Generate.h (modified) (1 diff)
-
src/CodeGen/OperatorTable.cc (modified) (2 diffs)
-
src/CodeGen/OperatorTable.h (modified) (1 diff)
-
src/CodeTools/DeclStats.cc (modified) (19 diffs)
-
src/CodeTools/TrackLoc.cc (modified) (2 diffs)
-
src/Common/Debug.h (modified) (1 diff)
-
src/Common/ErrorObjects.h (added)
-
src/Common/Eval.cc (added)
-
src/Common/Heap.cc (added)
-
src/Common/Heap.h (added)
-
src/Common/PassVisitor.h (modified) (14 diffs)
-
src/Common/PassVisitor.impl.h (modified) (38 diffs)
-
src/Common/PassVisitor.proto.h (modified) (6 diffs)
-
src/Common/ScopedMap.h (modified) (19 diffs)
-
src/Common/SemanticError.cc (modified) (1 diff)
-
src/Common/SemanticError.h (modified) (1 diff)
-
src/Common/module.mk (modified) (2 diffs)
-
src/Common/utility.h (modified) (5 diffs)
-
src/CompilationState.cc (added)
-
src/CompilationState.h (added)
-
src/Concurrency/Keywords.cc (modified) (23 diffs)
-
src/Concurrency/Waitfor.cc (modified) (2 diffs)
-
src/ControlStruct/ExceptTranslate.cc (modified) (3 diffs)
-
src/ControlStruct/ForExprMutator.cc (modified) (1 diff)
-
src/ControlStruct/ForExprMutator.h (modified) (2 diffs)
-
src/ControlStruct/LabelFixer.cc (modified) (3 diffs)
-
src/ControlStruct/LabelFixer.h (modified) (1 diff)
-
src/ControlStruct/MLEMutator.cc (modified) (11 diffs)
-
src/ControlStruct/MLEMutator.h (modified) (5 diffs)
-
src/ControlStruct/Mutate.cc (modified) (2 diffs)
-
src/ControlStruct/Mutate.h (modified) (2 diffs)
-
src/Docs/Makefile (deleted)
-
src/Docs/cfa-cpp.1 (deleted)
-
src/Docs/design.tex (deleted)
-
src/Docs/uml.dia (deleted)
-
src/GenPoly/Box.cc (modified) (21 diffs)
-
src/GenPoly/FindFunction.cc (modified) (1 diff)
-
src/GenPoly/GenPoly.cc (modified) (3 diffs)
-
src/GenPoly/InstantiateGeneric.cc (modified) (5 diffs)
-
src/GenPoly/Lvalue.cc (modified) (18 diffs)
-
src/GenPoly/ScrubTyVars.cc (modified) (7 diffs)
-
src/GenPoly/ScrubTyVars.h (modified) (6 diffs)
-
src/GenPoly/Specialize.cc (modified) (3 diffs)
-
src/InitTweak/FixGlobalInit.cc (modified) (6 diffs)
-
src/InitTweak/FixGlobalInit.h (modified) (1 diff)
-
src/InitTweak/FixInit.cc (modified) (31 diffs)
-
src/InitTweak/FixInit.h (modified) (1 diff)
-
src/InitTweak/GenInit.cc (modified) (9 diffs)
-
src/InitTweak/InitTweak.cc (modified) (5 diffs)
-
src/Makefile.am (modified) (2 diffs)
-
src/Makefile.in (modified) (35 diffs)
-
src/Parser/DeclarationNode.cc (modified) (40 diffs)
-
src/Parser/ExpressionNode.cc (modified) (13 diffs)
-
src/Parser/InitializerNode.cc (modified) (4 diffs)
-
src/Parser/LinkageSpec.cc (modified) (3 diffs)
-
src/Parser/LinkageSpec.h (modified) (5 diffs)
-
src/Parser/ParseNode.h (modified) (24 diffs)
-
src/Parser/StatementNode.cc (modified) (14 diffs)
-
src/Parser/TypeData.cc (modified) (34 diffs)
-
src/Parser/TypeData.h (modified) (9 diffs)
-
src/Parser/TypedefTable.cc (modified) (1 diff)
-
src/Parser/TypedefTable.h (modified) (1 diff)
-
src/Parser/lex.ll (modified) (21 diffs)
-
src/Parser/module.mk (modified) (2 diffs)
-
src/Parser/parser.yy (modified) (95 diffs)
-
src/ResolvExpr/AdjustExprType.cc (modified) (5 diffs)
-
src/ResolvExpr/Alternative.cc (modified) (3 diffs)
-
src/ResolvExpr/Alternative.h (modified) (1 diff)
-
src/ResolvExpr/AlternativeFinder.cc (modified) (73 diffs)
-
src/ResolvExpr/AlternativeFinder.h (modified) (3 diffs)
-
src/ResolvExpr/CastCost.cc (modified) (3 diffs)
-
src/ResolvExpr/CommonType.cc (modified) (16 diffs)
-
src/ResolvExpr/ConversionCost.cc (modified) (21 diffs)
-
src/ResolvExpr/ConversionCost.h (modified) (3 diffs)
-
src/ResolvExpr/CurrentObject.cc (modified) (9 diffs)
-
src/ResolvExpr/ExplodedActual.h (modified) (1 diff)
-
src/ResolvExpr/FindOpenVars.cc (modified) (3 diffs)
-
src/ResolvExpr/Occurs.cc (modified) (3 diffs)
-
src/ResolvExpr/PolyCost.cc (modified) (1 diff)
-
src/ResolvExpr/PtrsAssignable.cc (modified) (6 diffs)
-
src/ResolvExpr/PtrsCastable.cc (modified) (9 diffs)
-
src/ResolvExpr/RenameVars.cc (modified) (2 diffs)
-
src/ResolvExpr/RenameVars.h (modified) (1 diff)
-
src/ResolvExpr/Resolver.cc (modified) (33 diffs)
-
src/ResolvExpr/Resolver.h (modified) (1 diff)
-
src/ResolvExpr/TypeEnvironment.cc (modified) (11 diffs)
-
src/ResolvExpr/TypeEnvironment.h (modified) (6 diffs)
-
src/ResolvExpr/TypeMap.h (deleted)
-
src/ResolvExpr/Unify.cc (modified) (18 diffs)
-
src/ResolvExpr/Unify.h (modified) (3 diffs)
-
src/ResolvExpr/WidenMode.h (added)
-
src/ResolvExpr/typeops.h (modified) (2 diffs)
-
src/SymTab/AddVisit.h (deleted)
-
src/SymTab/Autogen.cc (modified) (4 diffs)
-
src/SymTab/Demangle.cc (added)
-
src/SymTab/FixFunction.cc (modified) (3 diffs)
-
src/SymTab/FixFunction.h (modified) (1 diff)
-
src/SymTab/Indexer.cc (modified) (25 diffs)
-
src/SymTab/Indexer.h (modified) (6 diffs)
-
src/SymTab/Mangler.cc (modified) (2 diffs)
-
src/SymTab/Mangler.h (modified) (1 diff)
-
src/SymTab/ManglerCommon.cc (added)
-
src/SymTab/Validate.cc (modified) (44 diffs)
-
src/SymTab/demangler.cc (added)
-
src/SymTab/module.mk (modified) (1 diff)
-
src/SynTree/AggregateDecl.cc (modified) (1 diff)
-
src/SynTree/ApplicationExpr.cc (modified) (1 diff)
-
src/SynTree/Attribute.cc (modified) (2 diffs)
-
src/SynTree/Attribute.h (modified) (1 diff)
-
src/SynTree/BasicType.cc (modified) (1 diff)
-
src/SynTree/CompoundStmt.cc (modified) (3 diffs)
-
src/SynTree/DeclReplacer.cc (added)
-
src/SynTree/DeclReplacer.h (added)
-
src/SynTree/Declaration.cc (modified) (1 diff)
-
src/SynTree/Declaration.h (modified) (7 diffs)
-
src/SynTree/Expression.cc (modified) (10 diffs)
-
src/SynTree/Expression.h (modified) (7 diffs)
-
src/SynTree/FunctionDecl.cc (modified) (3 diffs)
-
src/SynTree/Label.h (modified) (1 diff)
-
src/SynTree/Mutator.cc (deleted)
-
src/SynTree/Mutator.h (modified) (3 diffs)
-
src/SynTree/ReferenceToType.cc (modified) (7 diffs)
-
src/SynTree/ReferenceType.cc (modified) (2 diffs)
-
src/SynTree/Statement.cc (modified) (8 diffs)
-
src/SynTree/Statement.h (modified) (6 diffs)
-
src/SynTree/SynTree.h (modified) (6 diffs)
-
src/SynTree/Type.cc (modified) (5 diffs)
-
src/SynTree/Type.h (modified) (9 diffs)
-
src/SynTree/TypeSubstitution.cc (modified) (2 diffs)
-
src/SynTree/TypeSubstitution.h (modified) (7 diffs)
-
src/SynTree/VarExprReplacer.cc (deleted)
-
src/SynTree/VarExprReplacer.h (deleted)
-
src/SynTree/Visitor.cc (deleted)
-
src/SynTree/Visitor.h (modified) (3 diffs)
-
src/SynTree/module.mk (modified) (1 diff)
-
src/Tuples/Explode.h (modified) (7 diffs)
-
src/Tuples/TupleAssignment.cc (modified) (5 diffs)
-
src/Tuples/TupleExpansion.cc (modified) (8 diffs)
-
src/Validate/HandleAttributes.cc (added)
-
src/Validate/HandleAttributes.h (added)
-
src/Validate/module.mk (added)
-
src/benchmark/Makefile.am (deleted)
-
src/benchmark/Makefile.in (deleted)
-
src/benchmark/Monitor.c (deleted)
-
src/benchmark/bench.h (deleted)
-
src/benchmark/compile/empty.c (deleted)
-
src/benchmark/creation/JavaThread.java (deleted)
-
src/benchmark/creation/cfa_cor.c (deleted)
-
src/benchmark/creation/cfa_thrd.c (deleted)
-
src/benchmark/creation/goroutine.go (deleted)
-
src/benchmark/creation/pthreads.c (deleted)
-
src/benchmark/creation/upp_cor.cc (deleted)
-
src/benchmark/creation/upp_thrd.cc (deleted)
-
src/benchmark/ctxswitch/JavaThread.java (deleted)
-
src/benchmark/ctxswitch/cfa_cor.c (deleted)
-
src/benchmark/ctxswitch/cfa_thrd.c (deleted)
-
src/benchmark/ctxswitch/goroutine.go (deleted)
-
src/benchmark/ctxswitch/pthreads.c (deleted)
-
src/benchmark/ctxswitch/upp_cor.cc (deleted)
-
src/benchmark/ctxswitch/upp_thrd.cc (deleted)
-
src/benchmark/interrupt_linux.c (deleted)
-
src/benchmark/mutex/JavaThread.java (deleted)
-
src/benchmark/mutex/cfa1.c (deleted)
-
src/benchmark/mutex/cfa2.c (deleted)
-
src/benchmark/mutex/cfa4.c (deleted)
-
src/benchmark/mutex/fetch_add.c (deleted)
-
src/benchmark/mutex/function.c (deleted)
-
src/benchmark/mutex/pthreads.c (deleted)
-
src/benchmark/mutex/upp.cc (deleted)
-
src/benchmark/schedext/cfa1.c (deleted)
-
src/benchmark/schedext/cfa2.c (deleted)
-
src/benchmark/schedext/cfa4.c (deleted)
-
src/benchmark/schedext/upp.cc (deleted)
-
src/benchmark/schedint/JavaThread.java (deleted)
-
src/benchmark/schedint/cfa1.c (deleted)
-
src/benchmark/schedint/cfa2.c (deleted)
-
src/benchmark/schedint/cfa4.c (deleted)
-
src/benchmark/schedint/upp.cc (deleted)
-
src/cfa.make (added)
-
src/config.h.in (added)
-
src/driver/Makefile.am (deleted)
-
src/driver/Makefile.in (deleted)
-
src/driver/cc1.cc (deleted)
-
src/driver/cfa.cc (deleted)
-
src/examples/ArrayN.c (deleted)
-
src/examples/Attributes.c (deleted)
-
src/examples/Initialization.c (deleted)
-
src/examples/Initialization2.c (deleted)
-
src/examples/Makefile.am (deleted)
-
src/examples/Makefile.example (deleted)
-
src/examples/Makefile.in (deleted)
-
src/examples/Members.c (deleted)
-
src/examples/Misc.c (deleted)
-
src/examples/MiscError.c (deleted)
-
src/examples/Rank2.c (deleted)
-
src/examples/Tuple.c (deleted)
-
src/examples/abstype.c (deleted)
-
src/examples/constructors.c (deleted)
-
src/examples/forward.c (deleted)
-
src/examples/gc_no_raii/.gitignore (deleted)
-
src/examples/gc_no_raii/bug-repro/assert.c (deleted)
-
src/examples/gc_no_raii/bug-repro/blockers.tar.gz (deleted)
-
src/examples/gc_no_raii/bug-repro/blockers/explicit_cast.c (deleted)
-
src/examples/gc_no_raii/bug-repro/blockers/file_scope.c (deleted)
-
src/examples/gc_no_raii/bug-repro/blockers/recursive_realloc.c (deleted)
-
src/examples/gc_no_raii/bug-repro/crash.c (deleted)
-
src/examples/gc_no_raii/bug-repro/deref.c (deleted)
-
src/examples/gc_no_raii/bug-repro/field.c (deleted)
-
src/examples/gc_no_raii/bug-repro/find.c (deleted)
-
src/examples/gc_no_raii/bug-repro/inline.c (deleted)
-
src/examples/gc_no_raii/bug-repro/malloc.c (deleted)
-
src/examples/gc_no_raii/bug-repro/not_equal.c (deleted)
-
src/examples/gc_no_raii/bug-repro/oddtype.c (deleted)
-
src/examples/gc_no_raii/bug-repro/push_back.c (deleted)
-
src/examples/gc_no_raii/bug-repro/push_back.h (deleted)
-
src/examples/gc_no_raii/bug-repro/realloc.c (deleted)
-
src/examples/gc_no_raii/bug-repro/return.c (deleted)
-
src/examples/gc_no_raii/bug-repro/return_template.c (deleted)
-
src/examples/gc_no_raii/bug-repro/slow_malloc.c (deleted)
-
src/examples/gc_no_raii/bug-repro/static_const_local.c (deleted)
-
src/examples/gc_no_raii/bug-repro/test-assert.cpp (deleted)
-
src/examples/gc_no_raii/bug-repro/void_pointer.c (deleted)
-
src/examples/gc_no_raii/bug-repro/while.c (deleted)
-
src/examples/gc_no_raii/bug-repro/zero.c (deleted)
-
src/examples/gc_no_raii/pool-alloc/allocate-malign.c (deleted)
-
src/examples/gc_no_raii/pool-alloc/allocate-malloc.c (deleted)
-
src/examples/gc_no_raii/pool-alloc/allocate-mmap.c (deleted)
-
src/examples/gc_no_raii/pool-alloc/allocate-win-valloc.c (deleted)
-
src/examples/gc_no_raii/premake4.lua (deleted)
-
src/examples/gc_no_raii/src/allocate-pool.c (deleted)
-
src/examples/gc_no_raii/src/allocate-pool.h (deleted)
-
src/examples/gc_no_raii/src/gc.h (deleted)
-
src/examples/gc_no_raii/src/gcpointers.c (deleted)
-
src/examples/gc_no_raii/src/gcpointers.h (deleted)
-
src/examples/gc_no_raii/src/internal/card_table.h (deleted)
-
src/examples/gc_no_raii/src/internal/collector.c (deleted)
-
src/examples/gc_no_raii/src/internal/collector.h (deleted)
-
src/examples/gc_no_raii/src/internal/gc_tools.h (deleted)
-
src/examples/gc_no_raii/src/internal/globals.h (deleted)
-
src/examples/gc_no_raii/src/internal/memory_pool.c (deleted)
-
src/examples/gc_no_raii/src/internal/memory_pool.h (deleted)
-
src/examples/gc_no_raii/src/internal/object_header.c (deleted)
-
src/examples/gc_no_raii/src/internal/object_header.h (deleted)
-
src/examples/gc_no_raii/src/internal/state.c (deleted)
-
src/examples/gc_no_raii/src/internal/state.h (deleted)
-
src/examples/gc_no_raii/src/test_include.c (deleted)
-
src/examples/gc_no_raii/src/tools.h (deleted)
-
src/examples/gc_no_raii/src/tools/checks.h (deleted)
-
src/examples/gc_no_raii/src/tools/print.c (deleted)
-
src/examples/gc_no_raii/src/tools/print.h (deleted)
-
src/examples/gc_no_raii/src/tools/worklist.h (deleted)
-
src/examples/gc_no_raii/test/badlll.c (deleted)
-
src/examples/gc_no_raii/test/gctest.c (deleted)
-
src/examples/gc_no_raii/test/operators.c (deleted)
-
src/examples/huge.c (deleted)
-
src/examples/includes.c (deleted)
-
src/examples/index.h (deleted)
-
src/examples/it_out.c (deleted)
-
src/examples/multicore.c (deleted)
-
src/examples/new.c (deleted)
-
src/examples/poly-bench.c (deleted)
-
src/examples/prolog.c (deleted)
-
src/examples/quad.c (deleted)
-
src/examples/s.c (deleted)
-
src/examples/simplePoly.c (deleted)
-
src/examples/simpler.c (deleted)
-
src/examples/specialize.c (deleted)
-
src/examples/square.c (deleted)
-
src/examples/twice.c (deleted)
-
src/examples/wrapper/.gitignore (deleted)
-
src/examples/wrapper/premake4.lua (deleted)
-
src/examples/wrapper/src/main.c (deleted)
-
src/examples/wrapper/src/pointer.h (deleted)
-
src/examples/zero_one.c (deleted)
-
src/libcfa/Makefile.am (deleted)
-
src/libcfa/Makefile.in (deleted)
-
src/libcfa/assert.c (deleted)
-
src/libcfa/bits/algorithms.h (deleted)
-
src/libcfa/bits/align.h (deleted)
-
src/libcfa/bits/containers.h (deleted)
-
src/libcfa/bits/debug.c (deleted)
-
src/libcfa/bits/debug.h (deleted)
-
src/libcfa/bits/defs.h (deleted)
-
src/libcfa/bits/locks.h (deleted)
-
src/libcfa/concurrency/CtxSwitch-i386.S (deleted)
-
src/libcfa/concurrency/CtxSwitch-i686.S (deleted)
-
src/libcfa/concurrency/CtxSwitch-x86_64.S (deleted)
-
src/libcfa/concurrency/alarm.c (deleted)
-
src/libcfa/concurrency/alarm.h (deleted)
-
src/libcfa/concurrency/coroutine (deleted)
-
src/libcfa/concurrency/coroutine.c (deleted)
-
src/libcfa/concurrency/invoke.c (deleted)
-
src/libcfa/concurrency/invoke.h (deleted)
-
src/libcfa/concurrency/kernel (deleted)
-
src/libcfa/concurrency/kernel.c (deleted)
-
src/libcfa/concurrency/kernel_private.h (deleted)
-
src/libcfa/concurrency/monitor (deleted)
-
src/libcfa/concurrency/monitor.c (deleted)
-
src/libcfa/concurrency/preemption.c (deleted)
-
src/libcfa/concurrency/preemption.h (deleted)
-
src/libcfa/concurrency/thread (deleted)
-
src/libcfa/concurrency/thread.c (deleted)
-
src/libcfa/containers/maybe (deleted)
-
src/libcfa/containers/maybe.c (deleted)
-
src/libcfa/containers/pair (deleted)
-
src/libcfa/containers/pair.c (deleted)
-
src/libcfa/containers/result (deleted)
-
src/libcfa/containers/result.c (deleted)
-
src/libcfa/containers/vector (deleted)
-
src/libcfa/containers/vector.c (deleted)
-
src/libcfa/exception.c (deleted)
-
src/libcfa/exception.h (deleted)
-
src/libcfa/expat.h (deleted)
-
src/libcfa/fstream (deleted)
-
src/libcfa/fstream.c (deleted)
-
src/libcfa/gmp (deleted)
-
src/libcfa/interpose.c (deleted)
-
src/libcfa/interpose.h (deleted)
-
src/libcfa/iostream (deleted)
-
src/libcfa/iostream.c (deleted)
-
src/libcfa/iterator (deleted)
-
src/libcfa/iterator.c (deleted)
-
src/libcfa/limits (deleted)
-
src/libcfa/limits.c (deleted)
-
src/libcfa/lsda.h (deleted)
-
src/libcfa/math (deleted)
-
src/libcfa/memcheck.awk (deleted)
-
src/libcfa/rational (deleted)
-
src/libcfa/rational.c (deleted)
-
src/libcfa/startup.h (deleted)
-
src/libcfa/stdhdr/assert.h (deleted)
-
src/libcfa/stdhdr/bfdlink.h (deleted)
-
src/libcfa/stdhdr/complex.h (deleted)
-
src/libcfa/stdhdr/ctype.h (deleted)
-
src/libcfa/stdhdr/errno.h (deleted)
-
src/libcfa/stdhdr/fenv.h (deleted)
-
src/libcfa/stdhdr/float.h (deleted)
-
src/libcfa/stdhdr/gmp.h (deleted)
-
src/libcfa/stdhdr/hwloc.h (deleted)
-
src/libcfa/stdhdr/inttypes.h (deleted)
-
src/libcfa/stdhdr/iso646.h (deleted)
-
src/libcfa/stdhdr/krb5.h (deleted)
-
src/libcfa/stdhdr/limits.h (deleted)
-
src/libcfa/stdhdr/locale.h (deleted)
-
src/libcfa/stdhdr/malloc.h (deleted)
-
src/libcfa/stdhdr/math.h (deleted)
-
src/libcfa/stdhdr/setjmp.h (deleted)
-
src/libcfa/stdhdr/signal.h (deleted)
-
src/libcfa/stdhdr/stdalign.h (deleted)
-
src/libcfa/stdhdr/stdarg.h (deleted)
-
src/libcfa/stdhdr/stdatomic.h (deleted)
-
src/libcfa/stdhdr/stdbool.h (deleted)
-
src/libcfa/stdhdr/stddef.h (deleted)
-
src/libcfa/stdhdr/stdint.h (deleted)
-
src/libcfa/stdhdr/stdio.h (deleted)
-
src/libcfa/stdhdr/stdlib.h (deleted)
-
src/libcfa/stdhdr/stdnoreturn.h (deleted)
-
src/libcfa/stdhdr/string.h (deleted)
-
src/libcfa/stdhdr/tgmath.h (deleted)
-
src/libcfa/stdhdr/threads.h (deleted)
-
src/libcfa/stdhdr/time.h (deleted)
-
src/libcfa/stdhdr/uchar.h (deleted)
-
src/libcfa/stdhdr/unistd.h (deleted)
-
src/libcfa/stdhdr/wchar.h (deleted)
-
src/libcfa/stdhdr/wctype.h (deleted)
-
src/libcfa/stdlib (deleted)
-
src/libcfa/stdlib.c (deleted)
-
src/libcfa/virtual.c (deleted)
-
src/libcfa/virtual.h (deleted)
-
src/main.cc (modified) (28 diffs)
-
src/prelude/Makefile.am (deleted)
-
src/prelude/Makefile.in (deleted)
-
src/prelude/bootloader.cf (deleted)
-
src/prelude/builtins.c (deleted)
-
src/prelude/builtins.def (deleted)
-
src/prelude/extras.c (deleted)
-
src/prelude/extras.regx (deleted)
-
src/prelude/prelude.cf (deleted)
-
src/prelude/prototypes.awk (deleted)
-
src/prelude/prototypes.c (deleted)
-
src/prelude/prototypes.sed (deleted)
-
src/prelude/sync-builtins.def (deleted)
-
src/tests/.expect/KRfunctions.x64.txt (deleted)
-
src/tests/.expect/KRfunctions.x86.txt (deleted)
-
src/tests/.expect/abs.txt (deleted)
-
src/tests/.expect/alloc-ERROR.txt (deleted)
-
src/tests/.expect/alloc.txt (deleted)
-
src/tests/.expect/array.txt (deleted)
-
src/tests/.expect/ato.txt (deleted)
-
src/tests/.expect/attributes.x64.txt (deleted)
-
src/tests/.expect/attributes.x86.txt (deleted)
-
src/tests/.expect/avl_test.txt (deleted)
-
src/tests/.expect/cast.txt (deleted)
-
src/tests/.expect/castError.txt (deleted)
-
src/tests/.expect/completeTypeError.txt (deleted)
-
src/tests/.expect/complex.txt (deleted)
-
src/tests/.expect/ctor-autogen-ERR1.txt (deleted)
-
src/tests/.expect/ctor-autogen.txt (deleted)
-
src/tests/.expect/declarationErrors.txt (deleted)
-
src/tests/.expect/declarationSpecifier.x64.txt (deleted)
-
src/tests/.expect/declarationSpecifier.x86.txt (deleted)
-
src/tests/.expect/designations.txt (deleted)
-
src/tests/.expect/div.txt (deleted)
-
src/tests/.expect/dtor-early-exit-ERR1.txt (deleted)
-
src/tests/.expect/dtor-early-exit-ERR2.txt (deleted)
-
src/tests/.expect/dtor-early-exit.txt (deleted)
-
src/tests/.expect/enum.txt (deleted)
-
src/tests/.expect/expression.txt (deleted)
-
src/tests/.expect/extension.x64.txt (deleted)
-
src/tests/.expect/extension.x86.txt (deleted)
-
src/tests/.expect/fstream_test.txt (deleted)
-
src/tests/.expect/function-operator.txt (deleted)
-
src/tests/.expect/functions.x64.txt (deleted)
-
src/tests/.expect/functions.x86.txt (deleted)
-
src/tests/.expect/gccExtensions.x64.txt (deleted)
-
src/tests/.expect/gccExtensions.x86.txt (deleted)
-
src/tests/.expect/genericUnion.txt (deleted)
-
src/tests/.expect/globals.txt (deleted)
-
src/tests/.expect/gmp.x64.txt (deleted)
-
src/tests/.expect/hello.txt (deleted)
-
src/tests/.expect/identFuncDeclarator.txt (deleted)
-
src/tests/.expect/identParamDeclarator.txt (deleted)
-
src/tests/.expect/identity.txt (deleted)
-
src/tests/.expect/ifcond.txt (deleted)
-
src/tests/.expect/init_once.txt (deleted)
-
src/tests/.expect/io.txt (deleted)
-
src/tests/.expect/labelledExit.txt (deleted)
-
src/tests/.expect/libcfa_vector.txt (deleted)
-
src/tests/.expect/limits.txt (deleted)
-
src/tests/.expect/literals.x64.txt (deleted)
-
src/tests/.expect/literals.x86.txt (deleted)
-
src/tests/.expect/math1.x64.txt (deleted)
-
src/tests/.expect/math1.x86.txt (deleted)
-
src/tests/.expect/math2.x64.txt (deleted)
-
src/tests/.expect/math2.x86.txt (deleted)
-
src/tests/.expect/math3.x64.txt (deleted)
-
src/tests/.expect/math3.x86.txt (deleted)
-
src/tests/.expect/maybe.txt (deleted)
-
src/tests/.expect/memberCtors-ERR1.txt (deleted)
-
src/tests/.expect/memberCtors.txt (deleted)
-
src/tests/.expect/minmax.txt (deleted)
-
src/tests/.expect/multiDimension.txt (deleted)
-
src/tests/.expect/numericConstants.txt (deleted)
-
src/tests/.expect/operators.txt (deleted)
-
src/tests/.expect/polymorphism.txt (deleted)
-
src/tests/.expect/quoted_keyword.txt (deleted)
-
src/tests/.expect/random.txt (deleted)
-
src/tests/.expect/rational.txt (deleted)
-
src/tests/.expect/references.txt (deleted)
-
src/tests/.expect/result.txt (deleted)
-
src/tests/.expect/scopeErrors.txt (deleted)
-
src/tests/.expect/searchsort.txt (deleted)
-
src/tests/.expect/shortCircuit.txt (deleted)
-
src/tests/.expect/simpleGenericTriple.txt (deleted)
-
src/tests/.expect/stdincludes.txt (deleted)
-
src/tests/.expect/sum.txt (deleted)
-
src/tests/.expect/swap.txt (deleted)
-
src/tests/.expect/switch.txt (deleted)
-
src/tests/.expect/tupleAssign.txt (deleted)
-
src/tests/.expect/tupleCast.txt (deleted)
-
src/tests/.expect/tupleFunction.txt (deleted)
-
src/tests/.expect/tupleMember.txt (deleted)
-
src/tests/.expect/tuplePolymorphism.txt (deleted)
-
src/tests/.expect/tupleVariadic.txt (deleted)
-
src/tests/.expect/typedefRedef-ERR1.txt (deleted)
-
src/tests/.expect/typedefRedef.txt (deleted)
-
src/tests/.expect/typeof.txt (deleted)
-
src/tests/.expect/user_literals.txt (deleted)
-
src/tests/.expect/variableDeclarator.txt (deleted)
-
src/tests/.expect/vector_test.txt (deleted)
-
src/tests/.expect/voidPtr.txt (deleted)
-
src/tests/.expect/with-statement.txt (deleted)
-
src/tests/.gitignore (deleted)
-
src/tests/.in/fstream_test.txt (deleted)
-
src/tests/.in/gmp.txt (deleted)
-
src/tests/.in/rational.txt (deleted)
-
src/tests/.in/vector_test.txt (deleted)
-
src/tests/KRfunctions.c (deleted)
-
src/tests/Makefile.am (deleted)
-
src/tests/Makefile.in (deleted)
-
src/tests/abs.c (deleted)
-
src/tests/alloc.c (deleted)
-
src/tests/array.c (deleted)
-
src/tests/ato.c (deleted)
-
src/tests/attributes.c (deleted)
-
src/tests/avltree/avl-private.c (deleted)
-
src/tests/avltree/avl-private.h (deleted)
-
src/tests/avltree/avl.h (deleted)
-
src/tests/avltree/avl0.c (deleted)
-
src/tests/avltree/avl1.c (deleted)
-
src/tests/avltree/avl2.c (deleted)
-
src/tests/avltree/avl3.c (deleted)
-
src/tests/avltree/avl4.c (deleted)
-
src/tests/avltree/avl_test.c (deleted)
-
src/tests/cast.c (deleted)
-
src/tests/castError.c (deleted)
-
src/tests/commentMisc.c (deleted)
-
src/tests/completeTypeError.c (deleted)
-
src/tests/complex.c (deleted)
-
src/tests/concurrent/.expect/monitor.txt (deleted)
-
src/tests/concurrent/.expect/multi-monitor.txt (deleted)
-
src/tests/concurrent/.expect/preempt.txt (deleted)
-
src/tests/concurrent/.expect/thread.txt (deleted)
-
src/tests/concurrent/examples/.expect/boundedBuffer.txt (deleted)
-
src/tests/concurrent/examples/.expect/datingService.txt (deleted)
-
src/tests/concurrent/examples/.expect/matrixSum.txt (deleted)
-
src/tests/concurrent/examples/boundedBuffer.c (deleted)
-
src/tests/concurrent/examples/datingService.c (deleted)
-
src/tests/concurrent/examples/matrixSum.c (deleted)
-
src/tests/concurrent/monitor.c (deleted)
-
src/tests/concurrent/multi-monitor.c (deleted)
-
src/tests/concurrent/preempt.c (deleted)
-
src/tests/concurrent/signal/.expect/block.txt (deleted)
-
src/tests/concurrent/signal/.expect/disjoint.txt (deleted)
-
src/tests/concurrent/signal/.expect/wait.txt (deleted)
-
src/tests/concurrent/signal/barge.c (deleted)
-
src/tests/concurrent/signal/block.c (deleted)
-
src/tests/concurrent/signal/disjoint.c (deleted)
-
src/tests/concurrent/signal/wait.c (deleted)
-
src/tests/concurrent/thread.c (deleted)
-
src/tests/concurrent/waitfor/.expect/barge.txt (deleted)
-
src/tests/concurrent/waitfor/.expect/dtor.txt (deleted)
-
src/tests/concurrent/waitfor/.expect/else.txt (deleted)
-
src/tests/concurrent/waitfor/.expect/recurse.txt (deleted)
-
src/tests/concurrent/waitfor/.expect/statment.txt (deleted)
-
src/tests/concurrent/waitfor/.expect/when.txt (deleted)
-
src/tests/concurrent/waitfor/barge.c (deleted)
-
src/tests/concurrent/waitfor/dtor.c (deleted)
-
src/tests/concurrent/waitfor/else.c (deleted)
-
src/tests/concurrent/waitfor/parse.c (deleted)
-
src/tests/concurrent/waitfor/parse2.c (deleted)
-
src/tests/concurrent/waitfor/recurse.c (deleted)
-
src/tests/concurrent/waitfor/simple.c (deleted)
-
src/tests/concurrent/waitfor/statment.c (deleted)
-
src/tests/concurrent/waitfor/when.c (deleted)
-
src/tests/context.c (deleted)
-
src/tests/coroutine/.expect/coroutine.txt (deleted)
-
src/tests/coroutine/.expect/fmtLines.txt (deleted)
-
src/tests/coroutine/.expect/pingpong.txt (deleted)
-
src/tests/coroutine/.expect/prodcons.txt (deleted)
-
src/tests/coroutine/.in/fmtLines.txt (deleted)
-
src/tests/coroutine/coroutine.c (deleted)
-
src/tests/coroutine/fmtLines.c (deleted)
-
src/tests/coroutine/pingpong.c (deleted)
-
src/tests/coroutine/prodcons.c (deleted)
-
src/tests/ctor-autogen.c (deleted)
-
src/tests/declarationErrors.c (deleted)
-
src/tests/declarationSpecifier.c (deleted)
-
src/tests/designations.c (deleted)
-
src/tests/div.c (deleted)
-
src/tests/dtor-early-exit.c (deleted)
-
src/tests/enum.c (deleted)
-
src/tests/except-0.c (deleted)
-
src/tests/except-1.c (deleted)
-
src/tests/except-2.c (deleted)
-
src/tests/except-3.c (deleted)
-
src/tests/except-mac.h (deleted)
-
src/tests/expression.c (deleted)
-
src/tests/extension.c (deleted)
-
src/tests/forall.c (deleted)
-
src/tests/fstream_test.c (deleted)
-
src/tests/function-operator.c (deleted)
-
src/tests/functions.c (deleted)
-
src/tests/gccExtensions.c (deleted)
-
src/tests/genericUnion.c (deleted)
-
src/tests/globals.c (deleted)
-
src/tests/gmp.c (deleted)
-
src/tests/hello.c (deleted)
-
src/tests/identFuncDeclarator.c (deleted)
-
src/tests/identParamDeclarator.c (deleted)
-
src/tests/identity.c (deleted)
-
src/tests/ifcond.c (deleted)
-
src/tests/init_once.c (deleted)
-
src/tests/io.c (deleted)
-
src/tests/io.data (deleted)
-
src/tests/labelledExit.c (deleted)
-
src/tests/libcfa_vector.c (deleted)
-
src/tests/limits.c (deleted)
-
src/tests/literals.c (deleted)
-
src/tests/math1.c (deleted)
-
src/tests/math2.c (deleted)
-
src/tests/math3.c (deleted)
-
src/tests/maybe.c (deleted)
-
src/tests/memberCtors.c (deleted)
-
src/tests/minmax.c (deleted)
-
src/tests/multiDimension.c (deleted)
-
src/tests/namedParmArg.c (deleted)
-
src/tests/numericConstants.c (deleted)
-
src/tests/occursError.c (deleted)
-
src/tests/operators.c (deleted)
-
src/tests/polymorphism.c (deleted)
-
src/tests/preempt_longrun/Makefile.am (deleted)
-
src/tests/preempt_longrun/Makefile.in (deleted)
-
src/tests/preempt_longrun/block.c (deleted)
-
src/tests/preempt_longrun/create.c (deleted)
-
src/tests/preempt_longrun/disjoint.c (deleted)
-
src/tests/preempt_longrun/enter.c (deleted)
-
src/tests/preempt_longrun/enter3.c (deleted)
-
src/tests/preempt_longrun/processor.c (deleted)
-
src/tests/preempt_longrun/stack.c (deleted)
-
src/tests/preempt_longrun/wait.c (deleted)
-
src/tests/preempt_longrun/yield.c (deleted)
-
src/tests/pybin/__init__.py (deleted)
-
src/tests/pybin/settings.py (deleted)
-
src/tests/pybin/test_run.py (deleted)
-
src/tests/pybin/tools.py (deleted)
-
src/tests/quoted_keyword.c (deleted)
-
src/tests/random.c (deleted)
-
src/tests/rational.c (deleted)
-
src/tests/references.c (deleted)
-
src/tests/result.c (deleted)
-
src/tests/scope.c (deleted)
-
src/tests/scopeErrors.c (deleted)
-
src/tests/searchsort.c (deleted)
-
src/tests/shortCircuit.c (deleted)
-
src/tests/simpleGenericTriple.c (deleted)
-
src/tests/stdincludes.c (deleted)
-
src/tests/structMember.c (deleted)
-
src/tests/subrange.c (deleted)
-
src/tests/sum.c (deleted)
-
src/tests/swap.c (deleted)
-
src/tests/switch.c (deleted)
-
src/tests/test.py (deleted)
-
src/tests/tupleAssign.c (deleted)
-
src/tests/tupleCast.c (deleted)
-
src/tests/tupleFunction.c (deleted)
-
src/tests/tupleMember.c (deleted)
-
src/tests/tuplePolymorphism.c (deleted)
-
src/tests/tupleVariadic.c (deleted)
-
src/tests/tuples.c (deleted)
-
src/tests/typeGenerator.c (deleted)
-
src/tests/typedef.c (deleted)
-
src/tests/typedefDeclarator.c (deleted)
-
src/tests/typedefRedef.c (deleted)
-
src/tests/typeof.c (deleted)
-
src/tests/user_literals.c (deleted)
-
src/tests/variableDeclarator.c (deleted)
-
src/tests/vector/array.c (deleted)
-
src/tests/vector/array.h (deleted)
-
src/tests/vector/vector_int.c (deleted)
-
src/tests/vector/vector_int.h (deleted)
-
src/tests/vector/vector_test.c (deleted)
-
src/tests/virtualCast.c (deleted)
-
src/tests/voidPtr.c (deleted)
-
src/tests/with-statement.c (deleted)
-
tests/.expect/KRfunctions.x64.txt (added)
-
tests/.expect/KRfunctions.x86.txt (added)
-
tests/.expect/abs.txt (added)
-
tests/.expect/alloc-ERROR.txt (added)
-
tests/.expect/alloc.txt (added)
-
tests/.expect/array.txt (added)
-
tests/.expect/ato.txt (added)
-
tests/.expect/attributes.x64.txt (added)
-
tests/.expect/attributes.x86.txt (added)
-
tests/.expect/avl_test.txt (added)
-
tests/.expect/cast.txt (added)
-
tests/.expect/castError.txt (added)
-
tests/.expect/completeTypeError.txt (added)
-
tests/.expect/complex.txt (added)
-
tests/.expect/counter.txt (added)
-
tests/.expect/declarationErrors.txt (added)
-
tests/.expect/declarationSpecifier.x64.txt (added)
-
tests/.expect/declarationSpecifier.x86.txt (added)
-
tests/.expect/designations.txt (added)
-
tests/.expect/div.txt (added)
-
tests/.expect/enum.txt (added)
-
tests/.expect/expression.txt (added)
-
tests/.expect/extension.x64.txt (added)
-
tests/.expect/extension.x86.txt (added)
-
tests/.expect/fallthrough.txt (added)
-
tests/.expect/forall.txt (added)
-
tests/.expect/forctrl.txt (added)
-
tests/.expect/fstream_test.txt (added)
-
tests/.expect/function-operator.txt (added)
-
tests/.expect/functions.x64.txt (added)
-
tests/.expect/functions.x86.txt (added)
-
tests/.expect/gccExtensions.x64.txt (added)
-
tests/.expect/gccExtensions.x86.txt (added)
-
tests/.expect/genericUnion.txt (added)
-
tests/.expect/gmp.x64.txt (added)
-
tests/.expect/heap.txt (added)
-
tests/.expect/hello.txt (added)
-
tests/.expect/identFuncDeclarator.txt (added)
-
tests/.expect/identParamDeclarator.txt (added)
-
tests/.expect/identity.txt (added)
-
tests/.expect/ifwhileCtl.txt (added)
-
tests/.expect/io1.txt (added)
-
tests/.expect/io2.txt (added)
-
tests/.expect/labelledExit.txt (added)
-
tests/.expect/limits.txt (added)
-
tests/.expect/literals.txt (added)
-
tests/.expect/math1.txt (added)
-
tests/.expect/math2.txt (added)
-
tests/.expect/math3.txt (added)
-
tests/.expect/math4.txt (added)
-
tests/.expect/maybe.txt (added)
-
tests/.expect/minmax.txt (added)
-
tests/.expect/nested-types-ERR1.txt (added)
-
tests/.expect/nested-types-ERR2.txt (added)
-
tests/.expect/nested-types.txt (added)
-
tests/.expect/numericConstants.txt (added)
-
tests/.expect/operators.txt (added)
-
tests/.expect/polymorphism.txt (added)
-
tests/.expect/quoted_keyword.txt (added)
-
tests/.expect/random.txt (added)
-
tests/.expect/rational.txt (added)
-
tests/.expect/references.txt (added)
-
tests/.expect/result.txt (added)
-
tests/.expect/scopeErrors.txt (added)
-
tests/.expect/searchsort.txt (added)
-
tests/.expect/shortCircuit.txt (added)
-
tests/.expect/simpleGenericTriple.txt (added)
-
tests/.expect/stdincludes.txt (added)
-
tests/.expect/sum.txt (added)
-
tests/.expect/swap.txt (added)
-
tests/.expect/switch.txt (added)
-
tests/.expect/time.txt (added)
-
tests/.expect/typedefRedef-ERR1.txt (added)
-
tests/.expect/typedefRedef.txt (added)
-
tests/.expect/typeof.txt (added)
-
tests/.expect/user_literals.txt (added)
-
tests/.expect/variableDeclarator.txt (added)
-
tests/.expect/vector.txt (added)
-
tests/.expect/voidPtr.txt (added)
-
tests/.expect/with-statement.txt (added)
-
tests/.gitignore (added)
-
tests/.in/fstream_test.txt (added)
-
tests/.in/gmp.txt (added)
-
tests/.in/io.data (added)
-
tests/.in/rational.txt (added)
-
tests/KRfunctions.c (added)
-
tests/Makefile.am (added)
-
tests/Makefile.in (added)
-
tests/abs.c (added)
-
tests/alloc.c (added)
-
tests/array.c (added)
-
tests/ato.c (added)
-
tests/attributes.c (added)
-
tests/avltree/avl-private.c (added)
-
tests/avltree/avl-private.h (added)
-
tests/avltree/avl.h (added)
-
tests/avltree/avl0.c (added)
-
tests/avltree/avl1.c (added)
-
tests/avltree/avl2.c (added)
-
tests/avltree/avl3.c (added)
-
tests/avltree/avl4.c (added)
-
tests/avltree/avl_test.c (added)
-
tests/builtins/.expect/sync.txt (added)
-
tests/builtins/sync.c (added)
-
tests/cast.c (added)
-
tests/castError.c (added)
-
tests/commentMisc.c (added)
-
tests/completeTypeError.c (added)
-
tests/complex.c (added)
-
tests/concurrent/.expect/coroutineYield.txt (added)
-
tests/concurrent/.expect/monitor.txt (added)
-
tests/concurrent/.expect/multi-monitor.txt (added)
-
tests/concurrent/.expect/preempt.txt (added)
-
tests/concurrent/.expect/thread.txt (added)
-
tests/concurrent/coroutineYield.c (added)
-
tests/concurrent/examples/.expect/boundedBufferEXT.txt (added)
-
tests/concurrent/examples/.expect/boundedBufferINT.txt (added)
-
tests/concurrent/examples/.expect/datingService.txt (added)
-
tests/concurrent/examples/.expect/matrixSum.txt (added)
-
tests/concurrent/examples/.expect/quickSort.txt (added)
-
tests/concurrent/examples/.in/quickSort.txt (added)
-
tests/concurrent/examples/boundedBufferEXT.c (added)
-
tests/concurrent/examples/boundedBufferINT.c (added)
-
tests/concurrent/examples/datingService.c (added)
-
tests/concurrent/examples/matrixSum.c (added)
-
tests/concurrent/examples/quickSort.c (added)
-
tests/concurrent/monitor.c (added)
-
tests/concurrent/multi-monitor.c (added)
-
tests/concurrent/preempt.c (added)
-
tests/concurrent/signal/.expect/block.txt (added)
-
tests/concurrent/signal/.expect/disjoint.txt (added)
-
tests/concurrent/signal/.expect/wait.txt (added)
-
tests/concurrent/signal/block.c (added)
-
tests/concurrent/signal/disjoint.c (added)
-
tests/concurrent/signal/wait.c (added)
-
tests/concurrent/thread.c (added)
-
tests/concurrent/waitfor/.expect/barge.txt (added)
-
tests/concurrent/waitfor/.expect/dtor.txt (added)
-
tests/concurrent/waitfor/.expect/else.txt (added)
-
tests/concurrent/waitfor/.expect/recurse.txt (added)
-
tests/concurrent/waitfor/.expect/statment.txt (added)
-
tests/concurrent/waitfor/.expect/when.txt (added)
-
tests/concurrent/waitfor/barge.c (added)
-
tests/concurrent/waitfor/dtor.c (added)
-
tests/concurrent/waitfor/else.c (added)
-
tests/concurrent/waitfor/parse.c (added)
-
tests/concurrent/waitfor/parse2.c (added)
-
tests/concurrent/waitfor/recurse.c (added)
-
tests/concurrent/waitfor/simple.c (added)
-
tests/concurrent/waitfor/statment.c (added)
-
tests/concurrent/waitfor/when.c (added)
-
tests/config.py.in (added)
-
tests/context.c (added)
-
tests/coroutine/.expect/fibonacci.txt (added)
-
tests/coroutine/.expect/fmtLines.txt (added)
-
tests/coroutine/.expect/pingpong.txt (added)
-
tests/coroutine/.expect/prodcons.txt (added)
-
tests/coroutine/.expect/runningTotal.txt (added)
-
tests/coroutine/.in/fmtLines.txt (added)
-
tests/coroutine/fibonacci.c (added)
-
tests/coroutine/fibonacci_1.c (added)
-
tests/coroutine/fmtLines.c (added)
-
tests/coroutine/pingpong.c (added)
-
tests/coroutine/prodcons.c (added)
-
tests/coroutine/runningTotal.c (added)
-
tests/counter.c (added)
-
tests/declarationErrors.c (added)
-
tests/declarationSpecifier.c (added)
-
tests/designations.c (added)
-
tests/div.c (added)
-
tests/enum.c (added)
-
tests/except-0.c (added)
-
tests/except-1.c (added)
-
tests/except-2.c (added)
-
tests/except-3.c (added)
-
tests/except-mac.h (added)
-
tests/expression.c (added)
-
tests/extension.c (added)
-
tests/fallthrough.c (added)
-
tests/forall.c (added)
-
tests/forctrl.c (added)
-
tests/fstream_test.c (added)
-
tests/function-operator.c (added)
-
tests/functions.c (added)
-
tests/gccExtensions.c (added)
-
tests/genericUnion.c (added)
-
tests/gmp.c (added)
-
tests/heap.c (added)
-
tests/hello.c (added)
-
tests/identFuncDeclarator.c (added)
-
tests/identParamDeclarator.c (added)
-
tests/identity.c (added)
-
tests/ifwhileCtl.c (added)
-
tests/io1.c (added)
-
tests/io2.c (added)
-
tests/labelledExit.c (added)
-
tests/limits.c (added)
-
tests/literals.c (added)
-
tests/long_tests.h (added)
-
tests/math1.c (added)
-
tests/math2.c (added)
-
tests/math3.c (added)
-
tests/math4.c (added)
-
tests/maybe.c (added)
-
tests/minmax.c (added)
-
tests/namedParmArg.c (added)
-
tests/nested-types.c (added)
-
tests/numericConstants.c (added)
-
tests/occursError.c (added)
-
tests/operators.c (added)
-
tests/polymorphism.c (added)
-
tests/preempt_longrun/Makefile.am (added)
-
tests/preempt_longrun/Makefile.in (added)
-
tests/preempt_longrun/block.c (added)
-
tests/preempt_longrun/coroutine.c (added)
-
tests/preempt_longrun/create.c (added)
-
tests/preempt_longrun/disjoint.c (added)
-
tests/preempt_longrun/enter.c (added)
-
tests/preempt_longrun/enter3.c (added)
-
tests/preempt_longrun/preempt.c (added)
-
tests/preempt_longrun/processor.c (added)
-
tests/preempt_longrun/stack.c (added)
-
tests/preempt_longrun/update-type (added)
-
tests/preempt_longrun/wait.c (added)
-
tests/preempt_longrun/yield.c (added)
-
tests/pybin/__init__.py (added)
-
tests/pybin/settings.py (added)
-
tests/pybin/test_run.py (added)
-
tests/pybin/tools.py (added)
-
tests/quoted_keyword.c (added)
-
tests/raii/.expect/ctor-autogen-ERR1.txt (added)
-
tests/raii/.expect/ctor-autogen.txt (added)
-
tests/raii/.expect/dtor-early-exit-ERR1.txt (added)
-
tests/raii/.expect/dtor-early-exit-ERR2.txt (added)
-
tests/raii/.expect/dtor-early-exit.txt (added)
-
tests/raii/.expect/globals.txt (added)
-
tests/raii/.expect/init_once.txt (added)
-
tests/raii/.expect/memberCtors-ERR1.txt (added)
-
tests/raii/.expect/memberCtors.txt (added)
-
tests/raii/ctor-autogen.c (added)
-
tests/raii/dtor-early-exit.c (added)
-
tests/raii/globals.c (added)
-
tests/raii/init_once.c (added)
-
tests/raii/memberCtors.c (added)
-
tests/raii/multiDimension.c (added)
-
tests/raii/multiDimension.txt (added)
-
tests/random.c (added)
-
tests/rational.c (added)
-
tests/references.c (added)
-
tests/result.c (added)
-
tests/scope.c (added)
-
tests/scopeErrors.c (added)
-
tests/searchsort.c (added)
-
tests/shortCircuit.c (added)
-
tests/simpleGenericTriple.c (added)
-
tests/stdincludes.c (added)
-
tests/structMember.c (added)
-
tests/subrange.c (added)
-
tests/sum.c (added)
-
tests/swap.c (added)
-
tests/switch.c (added)
-
tests/test.py (added)
-
tests/time.c (added)
-
tests/tuple/.expect/tupleAssign.txt (added)
-
tests/tuple/.expect/tupleCast.txt (added)
-
tests/tuple/.expect/tupleFunction.txt (added)
-
tests/tuple/.expect/tupleMember.txt (added)
-
tests/tuple/.expect/tuplePolymorphism.txt (added)
-
tests/tuple/.expect/tupleVariadic.txt (added)
-
tests/tuple/tupleAssign.c (added)
-
tests/tuple/tupleCast.c (added)
-
tests/tuple/tupleFunction.c (added)
-
tests/tuple/tupleMember.c (added)
-
tests/tuple/tuplePolymorphism.c (added)
-
tests/tuple/tupleVariadic.c (added)
-
tests/tuple/tuples.c (added)
-
tests/typeGenerator.c (added)
-
tests/typedef.c (added)
-
tests/typedefDeclarator.c (added)
-
tests/typedefRedef.c (added)
-
tests/typeof.c (added)
-
tests/user_literals.c (added)
-
tests/variableDeclarator.c (added)
-
tests/vector.c (added)
-
tests/virtualCast.c (added)
-
tests/voidPtr.c (added)
-
tests/warnings/.expect/self-assignment.txt (added)
-
tests/warnings/self-assignment.c (added)
-
tests/with-statement.c (added)
-
tools/Makefile.am (modified) (1 diff)
-
tools/Makefile.in (modified) (16 diffs)
-
tools/PrettyGitLogs.sh (added)
-
tools/busy (added)
-
tools/busy.c (added)
-
tools/error (added)
-
tools/error.c (added)
-
tools/prettyprinter/Makefile.am (modified) (1 diff)
-
tools/prettyprinter/Makefile.in (modified) (12 diffs)
-
tools/prettyprinter/lex.ll (modified) (5 diffs)
-
tools/prettyprinter/parser.hh (deleted)
-
tools/prettyprinter/parser.yy (modified) (3 diffs)
-
tools/prettyprinter/test.y (modified) (1 diff)
-
tools/repeat.c (modified) (6 diffs)
-
tools/watchdog (added)
-
tools/watchdog.c (added)
Legend:
- Unmodified
- Added
- Removed
-
.gitignore
rf9feab8 r90152a4 8 8 config.status 9 9 config.log 10 config.py 10 11 stamp-h1 11 Makefile 12 driver/Makefile 13 libcfa/Makefile 14 src/Makefile 12 /Makefile 13 **/Makefile 15 14 /version 16 15 … … 25 24 include 26 25 share 26 build 27 27 *.class 28 28 29 29 # src executables, for lib and bin 30 src/driver/cc1 31 src/driver/cfa 32 src/driver/cfa-cpp 30 driver/as 31 driver/cfa 32 driver/cfa-cpp 33 driver/cc1 33 34 34 src/prelude/builtins.cf 35 src/prelude/gcc-builtins.cf 36 src/prelude/gcc-builtins.c 37 src/prelude/extras.cf 38 src/prelude/bootloader.c 39 src/libcfa/libcfa-prelude.c 35 libcfa/prelude/bootloader.c 36 libcfa/prelude/builtins.cf 37 libcfa/prelude/extras.cf 38 libcfa/prelude/gcc-builtins.cf 39 libcfa/prelude/gcc-builtins.c 40 libcfa/prelude/prelude.cf 41 libcfa/x64-debug/ 42 libcfa/x64-nodebug/ 43 libcfa/x64-nolib/ 44 libcfa/x86-debug/ 45 libcfa/x86-nodebug/ 46 libcfa/x86-nolib/ 47 libcfa/arm-debug/ 48 libcfa/arm-nodebug/ 49 libcfa/arm-nolib/ 50 40 51 41 52 # generated by bison and lex from parser.yy and lex.ll -
Jenkins/FullBuild
rf9feab8 r90152a4 21 21 gcc_5_x64: { trigger_build( 'gcc-5', 'x64', false ) }, 22 22 gcc_5_x86: { trigger_build( 'gcc-5', 'x86', false ) }, 23 gcc_4_x64: { trigger_build( 'gcc-4.9', 'x64', false ) },24 gcc_4_x86: { trigger_build( 'gcc-4.9', 'x86', false ) },25 23 clang_x64: { trigger_build( 'clang', 'x64', false ) }, 26 24 clang_x86: { trigger_build( 'clang', 'x86', false ) }, … … 63 61 parameters: [ \ 64 62 [$class: 'StringParameterValue', \ 65 name: ' pCompiler', \63 name: 'Compiler', \ 66 64 value: cc], \ 67 65 [$class: 'StringParameterValue', \ 68 name: ' pArchitecture', \66 name: 'Architecture', \ 69 67 value: arch], \ 70 68 [$class: 'BooleanParameterValue', \ 71 name: ' pRunAllTests',\69 name: 'RunAllTests', \ 72 70 value: true], \ 73 71 [$class: 'BooleanParameterValue', \ 74 name: ' pRunBenchmark', \72 name: 'RunBenchmark', \ 75 73 value: true], \ 76 74 [$class: 'BooleanParameterValue', \ 77 name: ' pBuildDocumentation', \75 name: 'BuildDocumentation', \ 78 76 value: true], \ 79 77 [$class: 'BooleanParameterValue', \ 80 name: ' pPublish', \81 value: publish], \78 name: 'Publish', \ 79 value: publish], \ 82 80 [$class: 'BooleanParameterValue', \ 83 name: ' pSilent', \81 name: 'Silent', \ 84 82 value: true], \ 85 83 ], \ … … 89 87 90 88 if(result.result != 'SUCCESS') { 91 sh("wget -q -O - ${result.absoluteUrl}/consoleText")89 sh("wget -q -O - http://localhost:8084/jenkins/job/Cforall/job/master/${result.number}/consoleText") 92 90 error(result.result) 93 91 } -
Jenkins/TestRegen
rf9feab8 r90152a4 33 33 email() 34 34 } 35 } 35 } 36 36 catch (Exception caughtError) { 37 37 email_error() … … 65 65 66 66 def install_dir = pwd tmp: true 67 67 68 68 //Configure the conpilation (Output is not relevant) 69 69 //Use the current directory as the installation target so nothing … … 101 101 def email_subject = "[cforall dashboard][TEST REGEN# ${env.BUILD_NUMBER}] - Result" 102 102 def email_body = """This is an automated email from the Jenkins build machine. It was 103 generated http ://plg2:8082/dashboard.103 generated https://cforall.uwaterloo.ca:8082/dashboard.html. 104 104 105 105 Please apply the required changes using the following method : … … 118 118 def email_subject = "[cforall dashboard][TEST REGEN# ${env.BUILD_NUMBER}] - FAILURE" 119 119 def email_body = """This is an automated email from the Jenkins build machine. It was 120 generated http ://plg2:8082/dashboard.120 generated https://cforall.uwaterloo.ca:8082/dashboard.html. 121 121 122 122 Test generation encoutered an error please see attached logs -
Jenkinsfile
rf9feab8 r90152a4 6 6 node ('master'){ 7 7 8 boolean bIsSandbox = env.BRANCH_NAME == "jenkins-sandbox" 8 // Globals 9 BuildDir = pwd tmp: true 10 SrcDir = pwd tmp: false 11 Settings = null 12 StageName = '' 13 14 // Local variables 9 15 def err = null 10 16 def log_needed = false 11 12 stage_name = ''13 14 compiler = null15 arch_name = ''16 architecture = ''17 18 do_alltests = false19 do_benchmark = false20 do_doc = false21 do_publish = false22 do_sendemail = true23 17 24 18 currentBuild.result = "SUCCESS" … … 30 24 notify_server(0) 31 25 32 prepare_build() 26 Settings = prepare_build() 27 28 clean() 33 29 34 30 checkout() … … 41 37 42 38 benchmark() 43 44 clean()45 39 46 40 build_doc() … … 58 52 err = caughtError 59 53 54 echo err.toString() 55 60 56 //An error has occured, the build log is relevent 61 57 log_needed = true 62 58 63 59 //Store the result of the build log 64 currentBuild.result = "${ stage_name} FAILURE".trim()60 currentBuild.result = "${StageName} FAILURE".trim() 65 61 } 66 62 67 63 finally { 68 64 //Send email with final results if this is not a full build 69 if( do_sendemail && !bIsSandbox ) { 70 echo 'Notifying users of result' 71 email(currentBuild.result, log_needed) 65 if( Settings && !Settings.Silent ) { 66 email(log_needed, Settings.IsSandbox) 72 67 } 73 68 … … 82 77 83 78 //=========================================================================================================== 84 // Helper classes/variables/routines85 //===========================================================================================================86 //Helper routine to collect information about the git history87 def collect_git_info() {88 89 checkout scm90 91 //create the temporary output directory in case it doesn't already exist92 def out_dir = pwd tmp: true93 sh "mkdir -p ${out_dir}"94 95 //parse git logs to find what changed96 gitRefName = env.BRANCH_NAME97 sh "git reflog > ${out_dir}/GIT_COMMIT"98 git_reflog = readFile("${out_dir}/GIT_COMMIT")99 gitRefOldValue = (git_reflog =~ /moving from (.+) to (.+)/)[0][1]100 gitRefNewValue = (git_reflog =~ /moving from (.+) to (.+)/)[0][2]101 }102 103 def prepare_build() {104 properties ([ \105 [$class: 'ParametersDefinitionProperty', \106 parameterDefinitions: [ \107 [$class: 'ChoiceParameterDefinition', \108 description: 'Which compiler to use', \109 name: 'pCompiler', \110 choices: 'gcc-6\ngcc-5\ngcc-4.9\nclang', \111 defaultValue: 'gcc-6', \112 ], \113 [$class: 'ChoiceParameterDefinition', \114 description: 'The target architecture', \115 name: 'pArchitecture', \116 choices: 'x64\nx86', \117 defaultValue: 'x64', \118 ], \119 [$class: 'BooleanParameterDefinition', \120 description: 'If false, only the quick test suite is ran', \121 name: 'pRunAllTests', \122 defaultValue: false, \123 ], \124 [$class: 'BooleanParameterDefinition', \125 description: 'If true, jenkins also runs benchmarks', \126 name: 'pRunBenchmark', \127 defaultValue: true, \128 ], \129 [$class: 'BooleanParameterDefinition', \130 description: 'If true, jenkins also builds documentation', \131 name: 'pBuildDocumentation', \132 defaultValue: true, \133 ], \134 [$class: 'BooleanParameterDefinition', \135 description: 'If true, jenkins also publishes results', \136 name: 'pPublish', \137 defaultValue: false, \138 ], \139 [$class: 'BooleanParameterDefinition', \140 description: 'If true, jenkins will not send emails', \141 name: 'pSilent', \142 defaultValue: false, \143 ], \144 ],145 ]])146 147 compiler = compiler_from_params( pCompiler )148 arch_name = pArchitecture149 architecture = architecture_from_params( arch_name )150 151 do_alltests = (pRunAllTests == 'true')152 do_benchmark = (pRunBenchmark == 'true')153 do_doc = (pBuildDocumentation == 'true')154 do_publish = (pPublish == 'true')155 do_sendemail = ! (pSilent == 'true')156 157 echo """Compiler : ${compiler.cc_name} (${compiler.cpp_cc}/${compiler.cfa_cc})158 Architecture : ${arch_name}159 Arc Flags : ${architecture}160 Run All Tests : ${ pRunAllTests.toString() }161 Run Benchmark : ${ pRunBenchmark.toString() }162 Build Documentation : ${ pBuildDocumentation.toString() }163 Publish : ${ pPublish.toString() }164 Silent : ${ pSilent.toString() }165 """166 167 collect_git_info()168 }169 170 def build_stage(String name, Closure block ) {171 stage_name = name172 stage(name, block)173 }174 175 def notify_server(int wait) {176 sh """curl --silent --data "wait=${wait}" -X POST http://plg2:8082/jenkins/notify > /dev/null || true"""177 return178 }179 180 def make_doc() {181 def err = null182 try {183 sh 'make clean > /dev/null'184 sh 'make > /dev/null 2>&1'185 }186 catch (Exception caughtError) {187 err = caughtError //rethrow error later188 sh 'cat *.log'189 }190 finally {191 if (err) throw err // Must re-throw exception to propagate error192 }193 }194 195 //Description of a compiler (Must be serializable since pipelines are persistent)196 class CC_Desc implements Serializable {197 public String cc_name198 public String cpp_cc199 public String cfa_cc200 201 CC_Desc(String cc_name, String cpp_cc, String cfa_cc) {202 this.cc_name = cc_name203 this.cpp_cc = cpp_cc204 this.cfa_cc = cfa_cc205 }206 }207 208 def compiler_from_params(cc) {209 switch( cc ) {210 case 'gcc-6':211 return new CC_Desc('gcc-6', 'g++-6', 'gcc-6')212 break213 case 'gcc-5':214 return new CC_Desc('gcc-5', 'g++-5', 'gcc-5')215 break216 case 'gcc-4.9':217 return new CC_Desc('gcc-4.9', 'g++-4.9', 'gcc-4.9')218 break219 case 'clang':220 return new CC_Desc('clang', 'clang++', 'gcc-6')221 break222 default :223 error "Unhandled compiler : ${cc}"224 }225 }226 227 def architecture_from_params( arch ) {228 switch( arch ) {229 case 'x64':230 return '--host=x86_64'231 break232 case 'x86':233 return '--host=i386'234 break235 default :236 error "Unhandled architecture : ${arch}"237 }238 }239 240 //===========================================================================================================241 79 // Main compilation routines 242 80 //=========================================================================================================== 81 def clean() { 82 build_stage('Cleanup') { 83 // clean the build by wipping the build directory 84 dir(BuildDir) { 85 deleteDir() 86 } 87 } 88 } 89 243 90 //Compilation script is done here but environnement set-up and error handling is done in main loop 244 91 def checkout() { 245 92 build_stage('Checkout') { 246 93 //checkout the source code and clean the repo 247 checkout scm 248 249 //Clean all temporary files to make sure no artifacts of the previous build remain 250 sh 'git clean -fdqx' 251 252 //Reset the git repo so no local changes persist 253 sh 'git reset --hard' 94 final scmVars = checkout scm 95 Settings.GitNewRef = scmVars.GIT_COMMIT 96 Settings.GitOldRef = scmVars.GIT_PREVIOUS_COMMIT 97 98 echo GitLogMessage() 254 99 } 255 100 } … … 257 102 def build() { 258 103 build_stage('Build') { 259 260 def install_dir = pwd tmp: true 261 262 //Configure the conpilation (Output is not relevant) 263 //Use the current directory as the installation target so nothing 264 //escapes the sandbox 265 //Also specify the compiler by hand 266 sh "./configure CXX=${compiler.cpp_cc} ${architecture} --with-backend-compiler=${compiler.cfa_cc} --prefix=${install_dir} --enable-silent-rules --quiet" 267 268 //Compile the project 269 sh 'make -j 8 --no-print-directory V=0 install' 104 // Build outside of the src tree to ease cleaning 105 dir (BuildDir) { 106 //Configure the conpilation (Output is not relevant) 107 //Use the current directory as the installation target so nothing escapes the sandbox 108 //Also specify the compiler by hand 109 targets="" 110 if( Settings.RunAllTests ) { 111 targets="--with-target-hosts='host:debug,host:nodebug'" 112 } else { 113 targets="--with-target-hosts='host:debug'" 114 } 115 116 sh "${SrcDir}/configure CXX=${Settings.Compiler.cpp_cc} ${Settings.Architecture.flags} ${targets} --with-backend-compiler=${Settings.Compiler.cfa_cc} --quiet" 117 118 //Compile the project 119 sh 'make -j 8 --no-print-directory' 120 } 270 121 } 271 122 } … … 274 125 build_stage('Test') { 275 126 276 //Run the tests from the tests directory 277 if ( do_alltests ) { 278 sh 'make -C src/tests all-tests debug=yes --no-print-directory' 279 sh 'make -C src/tests all-tests debug=no --no-print-directory' 280 } 281 else { 282 sh 'make -C src/tests --no-print-directory' 127 dir (BuildDir) { 128 //Run the tests from the tests directory 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 ' 132 } 133 else { 134 sh 'make --no-print-directory -C tests' 135 } 283 136 } 284 137 } … … 288 141 build_stage('Benchmark') { 289 142 290 if( !do_benchmark ) return 291 292 //Append bench results 293 sh 'make -C src/benchmark --no-print-directory jenkins githash=' + gitRefNewValue + ' arch=' + arch_name + ' | tee bench.json' 294 } 295 } 296 297 def clean() { 298 build_stage('Cleanup') { 299 300 //do a maintainer-clean to make sure we need to remake from scratch 301 sh 'make maintainer-clean > /dev/null' 143 if( !Settings.RunBenchmark ) return 144 145 dir (BuildDir) { 146 //Append bench results 147 sh "make --no-print-directory -C benchmark jenkins githash=${Settings.GitNewRef} arch=${Settings.Architecture} | tee ${SrcDir}/bench.json" 148 } 302 149 } 303 150 } … … 306 153 build_stage('Documentation') { 307 154 308 if( ! do_doc) return155 if( !Settings.BuildDocumentation ) return 309 156 310 157 dir ('doc/user') { … … 321 168 build_stage('Publish') { 322 169 323 if( ! do_publish ) return170 if( !Settings.Publish ) return 324 171 325 172 //Then publish the results 326 sh 'curl - H "Content-Type: application/json" --silent --data @bench.json http://plg2:8082/jenkins/publish > /dev/null || true'173 sh 'curl --silent --show-error -H \'Content-Type: application/json\' --data @bench.json https://cforall.uwaterloo.ca:8082/jenkins/publish > /dev/null || true' 327 174 } 328 175 } … … 331 178 //Routine responsible of sending the email notification once the build is completed 332 179 //=========================================================================================================== 333 //Standard build email notification 334 def email(String status, boolean log) { 335 //Since tokenizer doesn't work, figure stuff out from the environnement variables and command line 336 //Configurations for email format 337 def project_name = (env.JOB_NAME =~ /(.+)\/.+/)[0][1].toLowerCase() 338 339 def gitLog = 'Error retrieving git logs' 340 def gitDiff = 'Error retrieving git diff' 341 342 try { 343 344 sh "git rev-list --format=short ${gitRefOldValue}...${gitRefNewValue} > GIT_LOG" 345 gitLog = readFile('GIT_LOG') 346 347 sh "git diff --stat ${gitRefNewValue} ${gitRefOldValue} > GIT_DIFF" 348 gitDiff = readFile('GIT_DIFF') 349 } 350 catch (Exception error) {} 351 352 def email_subject = "[${project_name} git][BUILD# ${env.BUILD_NUMBER} - ${status}] - branch ${env.BRANCH_NAME}" 353 def email_body = """This is an automated email from the Jenkins build machine. It was 354 generated because of a git hooks/post-receive script following 355 a ref change was pushed to the repository containing 356 the project "UNNAMED PROJECT". 357 180 def GitLogMessage() { 181 if (!Settings || !Settings.GitOldRef || !Settings.GitNewRef) return "\nERROR retrieveing git information!\n" 182 183 sh "${SrcDir}/tools/PrettyGitLogs.sh ${BuildDir} ${Settings.GitOldRef} ${Settings.GitNewRef}" 184 185 def gitUpdate = readFile("${BuildDir}/GIT_UPDATE") 186 def gitLog = readFile("${BuildDir}/GIT_LOG") 187 def gitDiff = readFile("${BuildDir}/GIT_DIFF") 188 189 return """ 358 190 The branch ${env.BRANCH_NAME} has been updated. 359 via ${gitRefOldValue} (commit) 360 from ${gitRefNewValue} (commit) 191 ${gitUpdate} 361 192 362 193 Check console output at ${env.BUILD_URL} to view the results. … … 364 195 - Status -------------------------------------------------------------- 365 196 366 BUILD# ${env.BUILD_NUMBER} - ${ status}197 BUILD# ${env.BUILD_NUMBER} - ${currentBuild.result} 367 198 368 199 - Log ----------------------------------------------------------------- … … 372 203 ${gitDiff} 373 204 """ 205 } 206 207 //Standard build email notification 208 def email(boolean log, boolean bIsSandbox) { 209 //Since tokenizer doesn't work, figure stuff out from the environnement variables and command line 210 //Configurations for email format 211 echo 'Notifying users of result' 212 213 def project_name = (env.JOB_NAME =~ /(.+)\/.+/)[0][1].toLowerCase() 214 def email_subject = "[${project_name} git][BUILD# ${env.BUILD_NUMBER} - ${currentBuild.result}] - branch ${env.BRANCH_NAME}" 215 def email_body = """This is an automated email from the Jenkins build machine. It was 216 generated because of a git hooks/post-receive script following 217 a ref change which was pushed to the Cforall repository. 218 """ + GitLogMessage() 374 219 375 220 def email_to = "cforall@lists.uwaterloo.ca" 376 221 377 //send email notification 378 emailext body: email_body, subject: email_subject, to: email_to, attachLog: log 379 } 222 if( Settings && !Settings.IsSandbox ) { 223 //send email notification 224 emailext body: email_body, subject: email_subject, to: email_to, attachLog: log 225 } else { 226 echo "Would send email to: ${email_to}" 227 echo "With title: ${email_subject}" 228 echo "Content: \n${email_body}" 229 } 230 } 231 232 //=========================================================================================================== 233 // Helper classes/variables/routines 234 //=========================================================================================================== 235 //Description of a compiler (Must be serializable since pipelines are persistent) 236 class CC_Desc implements Serializable { 237 public String cc_name 238 public String cpp_cc 239 public String cfa_cc 240 241 CC_Desc(String cc_name, String cpp_cc, String cfa_cc) { 242 this.cc_name = cc_name 243 this.cpp_cc = cpp_cc 244 this.cfa_cc = cfa_cc 245 } 246 } 247 248 //Description of an architecture (Must be serializable since pipelines are persistent) 249 class Arch_Desc implements Serializable { 250 public String name 251 public String flags 252 253 Arch_Desc(String name, String flags) { 254 this.name = name 255 this.flags = flags 256 } 257 } 258 259 class BuildSettings implements Serializable { 260 public final CC_Desc Compiler 261 public final Arch_Desc Architecture 262 public final Boolean RunAllTests 263 public final Boolean RunBenchmark 264 public final Boolean BuildDocumentation 265 public final Boolean Publish 266 public final Boolean Silent 267 public final Boolean IsSandbox 268 public final String DescLong 269 public final String DescShort 270 271 public String GitNewRef 272 public String GitOldRef 273 274 BuildSettings(java.util.Collections$UnmodifiableMap param, String branch) { 275 switch( param.Compiler ) { 276 case 'gcc-6': 277 this.Compiler = new CC_Desc('gcc-6', 'g++-6', 'gcc-6') 278 break 279 case 'gcc-5': 280 this.Compiler = new CC_Desc('gcc-5', 'g++-5', 'gcc-5') 281 break 282 case 'gcc-4.9': 283 this.Compiler = new CC_Desc('gcc-4.9', 'g++-4.9', 'gcc-4.9') 284 break 285 case 'clang': 286 this.Compiler = new CC_Desc('clang', 'clang++', 'gcc-6') 287 break 288 default : 289 error "Unhandled compiler : ${cc}" 290 } 291 292 switch( param.Architecture ) { 293 case 'x64': 294 this.Architecture = new Arch_Desc('x64', '--host=x86_64') 295 break 296 case 'x86': 297 this.Architecture = new Arch_Desc('x86', '--host=i386') 298 break 299 default : 300 error "Unhandled architecture : ${arch}" 301 } 302 303 this.RunAllTests = param.RunAllTests 304 this.RunBenchmark = param.RunBenchmark 305 this.BuildDocumentation = param.BuildDocumentation 306 this.Publish = param.Publish 307 this.Silent = param.Silent 308 this.IsSandbox = (branch == "jenkins-sandbox") 309 310 def full = param.RunAllTests ? " (Full)" : "" 311 this.DescShort = "${ this.Compiler.cc_name }:${ this.Architecture.name }${full}" 312 313 this.DescLong = """Compiler : ${ this.Compiler.cc_name } (${ this.Compiler.cpp_cc }/${ this.Compiler.cfa_cc }) 314 Architecture : ${ this.Architecture.name } 315 Arc Flags : ${ this.Architecture.flags } 316 Run All Tests : ${ this.RunAllTests.toString() } 317 Run Benchmark : ${ this.RunBenchmark.toString() } 318 Build Documentation : ${ this.BuildDocumentation.toString() } 319 Publish : ${ this.Publish.toString() } 320 Silent : ${ this.Silent.toString() } 321 """ 322 323 this.GitNewRef = '' 324 this.GitOldRef = '' 325 } 326 } 327 328 def prepare_build() { 329 // prepare the properties 330 properties ([ \ 331 [$class: 'ParametersDefinitionProperty', \ 332 parameterDefinitions: [ \ 333 [$class: 'ChoiceParameterDefinition', \ 334 description: 'Which compiler to use', \ 335 name: 'Compiler', \ 336 choices: 'gcc-6\ngcc-5\ngcc-4.9\nclang', \ 337 defaultValue: 'gcc-6', \ 338 ], \ 339 [$class: 'ChoiceParameterDefinition', \ 340 description: 'The target architecture', \ 341 name: 'Architecture', \ 342 choices: 'x64\nx86', \ 343 defaultValue: 'x64', \ 344 ], \ 345 [$class: 'BooleanParameterDefinition', \ 346 description: 'If false, only the quick test suite is ran', \ 347 name: 'RunAllTests', \ 348 defaultValue: false, \ 349 ], \ 350 [$class: 'BooleanParameterDefinition', \ 351 description: 'If true, jenkins also runs benchmarks', \ 352 name: 'RunBenchmark', \ 353 defaultValue: false, \ 354 ], \ 355 [$class: 'BooleanParameterDefinition', \ 356 description: 'If true, jenkins also builds documentation', \ 357 name: 'BuildDocumentation', \ 358 defaultValue: true, \ 359 ], \ 360 [$class: 'BooleanParameterDefinition', \ 361 description: 'If true, jenkins also publishes results', \ 362 name: 'Publish', \ 363 defaultValue: false, \ 364 ], \ 365 [$class: 'BooleanParameterDefinition', \ 366 description: 'If true, jenkins will not send emails', \ 367 name: 'Silent', \ 368 defaultValue: false, \ 369 ], \ 370 ], 371 ]]) 372 373 final settings = new BuildSettings(params, env.BRANCH_NAME) 374 375 currentBuild.description = settings.DescShort 376 echo settings.DescLong 377 378 return settings 379 } 380 381 def build_stage(String name, Closure block ) { 382 StageName = name 383 echo " -------- ${StageName} -------- " 384 stage(name, block) 385 } 386 387 def notify_server(int wait) { 388 sh """curl --silent --show-error --data "wait=${wait}" -X POST https://cforall.uwaterloo.ca:8082/jenkins/notify > /dev/null || true""" 389 return 390 } 391 392 def make_doc() { 393 def err = null 394 try { 395 sh 'make clean > /dev/null' 396 sh 'make > /dev/null 2>&1' 397 } 398 catch (Exception caughtError) { 399 err = caughtError //rethrow error later 400 sh 'cat *.log' 401 } 402 finally { 403 if (err) throw err // Must re-throw exception to propagate error 404 } 405 } -
Makefile.am
rf9feab8 r90152a4 6 6 ## file "LICENCE" distributed with Cforall. 7 7 ## 8 ## Makefile.am -- 8 ## Makefile.am -- 9 9 ## 10 10 ## Author : Peter A. Buhr … … 15 15 ############################################################################### 16 16 17 AUTOMAKE_OPTIONS = foreign # do not require all the GNU file names 18 SUBDIRS = src/driver src src/prelude src/libcfa # order important, src before prelude because cfa-cpp used to build prelude 19 EXTRA_DIST = Docs # non-source files 20 BACKEND_CC = @BACKEND_CC@ # C compiler used to compile Cforall programs, versus C++ compiler used to build cfa command 17 AUTOMAKE_OPTIONS = foreign # do not require all the GNU file names 18 BACKEND_CC = @BACKEND_CC@ # C compiler used to compile Cforall programs, versus C++ compiler used to build cfa command 21 19 22 MAINTAINERCLEANFILES = lib/* bin/* src/examples/.deps/* src/tests/.deps/* src/tests/.out/* 20 MAINTAINERCLEANFILES = lib/* bin/* tests/.deps/* tests/.out/* 21 # order important 22 23 SUBDIRS = driver src . @LIBCFA_TARGET_DIRS@ 24 25 @LIBCFA_TARGET_MAKEFILES@ : Makefile $(srcdir)/libcfa/configure 26 @$(eval config_file = $(dir $@)config.data) 27 @ls $(config_file) || (echo "Missing config.data, re-run configure script again" && false) 28 @$(eval config_data = $(shell cat $(config_file))) 29 @echo "Configuring libcfa with '$(config_data)''" 30 @cd $(dir $@) && $(abs_top_srcdir)/libcfa/configure $(config_data) 31 32 noinst_DATA = @LIBCFA_TARGET_MAKEFILES@ 23 33 24 34 man1_MANS = doc/man/cfa.1 35 36 debug=yes 37 check: 38 $(MAKE) -C tests all-tests installed=no debug=${debug} 39 40 installcheck: 41 $(MAKE) -C tests all-tests installed=yes debug=${debug} 42 43 status: @LIBCFA_TARGET_MAKEFILES@ 44 @echo -ne "translator\n\t" 45 @./config.status --config | sed "s/ /\n\t/g; s/\t'/\t/g; s/'\n/\n/g; s/^'//g; s/'$$//g" 46 @find libcfa -name config.status -printf "\n%h\n\t" -exec {} --config \; | sed "s/ /\n\t/g; s/\t'/\t/g; s/'\n/\n/g; s/^'//g; s/'$$//g" -
Makefile.in
rf9feab8 r90152a4 17 17 ######################## -*- Mode: Makefile-Automake -*- ###################### 18 18 ############################################################################### 19 19 20 VPATH = @srcdir@ 20 21 am__is_gnu_make = { \ … … 93 94 subdir = . 94 95 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 95 am__aclocal_m4_deps = $(top_srcdir)/configure.ac 96 am__aclocal_m4_deps = $(top_srcdir)/automake/cfa.m4 \ 97 $(top_srcdir)/configure.ac 96 98 am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ 97 99 $(ACLOCAL_M4) … … 162 164 NROFF = nroff 163 165 MANS = $(man1_MANS) 166 DATA = $(noinst_DATA) 164 167 RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \ 165 168 distclean-recursive maintainer-clean-recursive … … 170 173 AM_RECURSIVE_TARGETS = $(am__recursive_targets:-recursive=) TAGS CTAGS \ 171 174 cscope distdir dist dist-all distcheck 172 am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) \ 173 $(LISP)config.h.in 175 am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) 174 176 # Read a list of newline-separated strings from the standard input, 175 177 # and print each of them once, without duplicates. Input order is … … 192 194 CSCOPE = cscope 193 195 DIST_SUBDIRS = $(SUBDIRS) 194 am__DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/config.h.in \ 195 $(top_srcdir)/automake/compile \ 196 am__DIST_COMMON = $(srcdir)/Makefile.in $(top_srcdir)/automake/compile \ 196 197 $(top_srcdir)/automake/config.guess \ 197 198 $(top_srcdir)/automake/config.sub \ 198 199 $(top_srcdir)/automake/install-sh \ 199 $(top_srcdir)/automake/missing INSTALL README automake/compile \ 200 automake/config.guess automake/config.sub automake/depcomp \ 201 automake/install-sh automake/missing automake/ylwrap 200 $(top_srcdir)/automake/missing $(top_srcdir)/src/config.h.in \ 201 INSTALL README automake/compile automake/config.guess \ 202 automake/config.sub automake/depcomp automake/install-sh \ 203 automake/missing automake/ylwrap 202 204 DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) 203 205 distdir = $(PACKAGE)-$(VERSION) … … 250 252 AUTOMAKE = @AUTOMAKE@ 251 253 AWK = @AWK@ 252 BACKEND_CC = @BACKEND_CC@ # C compiler used to compile Cforall programs, versus C++ compiler used to build cfa command 254 BACKEND_CC = @BACKEND_CC@ # C compiler used to compile Cforall programs, versus C++ compiler used to build cfa command 255 BUILD_IN_TREE_FLAGS = @BUILD_IN_TREE_FLAGS@ 253 256 CC = @CC@ 254 257 CCAS = @CCAS@ … … 256 259 CCASFLAGS = @CCASFLAGS@ 257 260 CCDEPMODE = @CCDEPMODE@ 261 CFACC = @CFACC@ 262 CFACPP = @CFACPP@ 258 263 CFA_BACKEND_CC = @CFA_BACKEND_CC@ 259 264 CFA_BINDIR = @CFA_BINDIR@ … … 272 277 DEFS = @DEFS@ 273 278 DEPDIR = @DEPDIR@ 279 DRIVER_DIR = @DRIVER_DIR@ 274 280 ECHO_C = @ECHO_C@ 275 281 ECHO_N = @ECHO_N@ … … 278 284 EXEEXT = @EXEEXT@ 279 285 GREP = @GREP@ 286 HOST_FLAGS = @HOST_FLAGS@ 280 287 INSTALL = @INSTALL@ 281 288 INSTALL_DATA = @INSTALL_DATA@ … … 287 294 LEXLIB = @LEXLIB@ 288 295 LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@ 296 LIBCFA_TARGET_DIRS = @LIBCFA_TARGET_DIRS@ 297 LIBCFA_TARGET_MAKEFILES = @LIBCFA_TARGET_MAKEFILES@ 289 298 LIBOBJS = @LIBOBJS@ 290 299 LIBS = @LIBS@ 291 300 LTLIBOBJS = @LTLIBOBJS@ 292 MACHINE_TYPE = @MACHINE_TYPE@293 MAINT = @MAINT@294 301 MAKEINFO = @MAKEINFO@ 295 302 MKDIR_P = @MKDIR_P@ … … 307 314 SHELL = @SHELL@ 308 315 STRIP = @STRIP@ 316 TARGET_HOSTS = @TARGET_HOSTS@ 309 317 VERSION = @VERSION@ 310 318 YACC = @YACC@ … … 362 370 top_builddir = @top_builddir@ 363 371 top_srcdir = @top_srcdir@ 364 AUTOMAKE_OPTIONS = foreign # do not require all the GNU file names365 SUBDIRS = src/driver src src/prelude src/libcfa # order important, src before prelude because cfa-cpp used to build prelude 366 EXTRA_DIST = Docs # non-source files 367 MAINTAINERCLEANFILES = lib/* bin/* src/examples/.deps/* src/tests/.deps/* src/tests/.out/* 372 AUTOMAKE_OPTIONS = foreign # do not require all the GNU file names 373 MAINTAINERCLEANFILES = lib/* bin/* tests/.deps/* tests/.out/* 374 SUBDIRS = driver src . @LIBCFA_TARGET_DIRS@ 375 noinst_DATA = @LIBCFA_TARGET_MAKEFILES@ 368 376 man1_MANS = doc/man/cfa.1 377 debug = yes 369 378 all: config.h 370 379 $(MAKE) $(AM_MAKEFLAGS) all-recursive … … 373 382 am--refresh: Makefile 374 383 @: 375 $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@$(srcdir)/Makefile.am $(am__configure_deps)384 $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) 376 385 @for dep in $?; do \ 377 386 case '$(am__configure_deps)' in \ … … 399 408 $(SHELL) ./config.status --recheck 400 409 401 $(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@$(am__configure_deps)410 $(top_srcdir)/configure: $(am__configure_deps) 402 411 $(am__cd) $(srcdir) && $(AUTOCONF) 403 $(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@$(am__aclocal_m4_deps)412 $(ACLOCAL_M4): $(am__aclocal_m4_deps) 404 413 $(am__cd) $(srcdir) && $(ACLOCAL) $(ACLOCAL_AMFLAGS) 405 414 $(am__aclocal_m4_deps): … … 409 418 @test -f $@ || $(MAKE) $(AM_MAKEFLAGS) stamp-h1 410 419 411 stamp-h1: $( srcdir)/config.h.in $(top_builddir)/config.status420 stamp-h1: $(top_srcdir)/src/config.h.in $(top_builddir)/config.status 412 421 @rm -f stamp-h1 413 422 cd $(top_builddir) && $(SHELL) ./config.status config.h 414 $( srcdir)/config.h.in: @MAINTAINER_MODE_TRUE@$(am__configure_deps)423 $(top_srcdir)/src/config.h.in: $(am__configure_deps) 415 424 ($(am__cd) $(top_srcdir) && $(AUTOHEADER)) 416 425 rm -f stamp-h1 … … 757 766 check-am: all-am 758 767 check: check-recursive 759 all-am: Makefile $(MANS) config.h768 all-am: Makefile $(MANS) $(DATA) config.h 760 769 installdirs: installdirs-recursive 761 770 installdirs-am: … … 770 779 install-am: all-am 771 780 @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am 772 773 installcheck: installcheck-recursive774 781 install-strip: 775 782 if test -z '$(STRIP)'; then \ … … 885 892 .PRECIOUS: Makefile 886 893 894 # order important 895 896 @LIBCFA_TARGET_MAKEFILES@ : Makefile $(srcdir)/libcfa/configure 897 @$(eval config_file = $(dir $@)config.data) 898 @ls $(config_file) || (echo "Missing config.data, re-run configure script again" && false) 899 @$(eval config_data = $(shell cat $(config_file))) 900 @echo "Configuring libcfa with '$(config_data)''" 901 @cd $(dir $@) && $(abs_top_srcdir)/libcfa/configure $(config_data) 902 check: 903 $(MAKE) -C tests all-tests installed=no debug=${debug} 904 905 installcheck: 906 $(MAKE) -C tests all-tests installed=yes debug=${debug} 907 908 status: @LIBCFA_TARGET_MAKEFILES@ 909 @echo -ne "translator\n\t" 910 @./config.status --config | sed "s/ /\n\t/g; s/\t'/\t/g; s/'\n/\n/g; s/^'//g; s/'$$//g" 911 @find libcfa -name config.status -printf "\n%h\n\t" -exec {} --config \; | sed "s/ /\n\t/g; s/\t'/\t/g; s/'\n/\n/g; s/^'//g; s/'$$//g" 887 912 888 913 # Tell versions [3.59,3.63) of GNU make to not export all variables. -
README
rf9feab8 r90152a4 107 107 - the implicit coercion of structure types to the type of their first member is 108 108 not implemented 109 109 110 110 Who is responsible for cfa-cc? 111 111 ------------------------------ … … 115 115 The Cforall project maintains a web page: 116 116 117 http ://plg.uwaterloo.ca/~cforall117 https://cforall.uwaterloo.ca -
aclocal.m4
rf9feab8 r90152a4 127 127 # Expand $ac_aux_dir to an absolute path. 128 128 am_aux_dir=`cd "$ac_aux_dir" && pwd` 129 ])130 131 # AM_COND_IF -*- Autoconf -*-132 133 # Copyright (C) 2008-2014 Free Software Foundation, Inc.134 #135 # This file is free software; the Free Software Foundation136 # gives unlimited permission to copy and/or distribute it,137 # with or without modifications, as long as this notice is preserved.138 139 # _AM_COND_IF140 # _AM_COND_ELSE141 # _AM_COND_ENDIF142 # --------------143 # These macros are only used for tracing.144 m4_define([_AM_COND_IF])145 m4_define([_AM_COND_ELSE])146 m4_define([_AM_COND_ENDIF])147 148 # AM_COND_IF(COND, [IF-TRUE], [IF-FALSE])149 # ---------------------------------------150 # If the shell condition COND is true, execute IF-TRUE, otherwise execute151 # IF-FALSE. Allow automake to learn about conditional instantiating macros152 # (the AC_CONFIG_FOOS).153 AC_DEFUN([AM_COND_IF],154 [m4_ifndef([_AM_COND_VALUE_$1],155 [m4_fatal([$0: no such condition "$1"])])dnl156 _AM_COND_IF([$1])dnl157 if test -z "$$1_TRUE"; then :158 m4_n([$2])[]dnl159 m4_ifval([$3],160 [_AM_COND_ELSE([$1])dnl161 else162 $3163 ])dnl164 _AM_COND_ENDIF([$1])dnl165 fi[]dnl166 129 ]) 167 130 … … 703 666 AC_SUBST([am__leading_dot])]) 704 667 705 # Add --enable-maintainer-mode option to configure. -*- Autoconf -*-706 # From Jim Meyering707 708 # Copyright (C) 1996-2014 Free Software Foundation, Inc.709 #710 # This file is free software; the Free Software Foundation711 # gives unlimited permission to copy and/or distribute it,712 # with or without modifications, as long as this notice is preserved.713 714 # AM_MAINTAINER_MODE([DEFAULT-MODE])715 # ----------------------------------716 # Control maintainer-specific portions of Makefiles.717 # Default is to disable them, unless 'enable' is passed literally.718 # For symmetry, 'disable' may be passed as well. Anyway, the user719 # can override the default with the --enable/--disable switch.720 AC_DEFUN([AM_MAINTAINER_MODE],721 [m4_case(m4_default([$1], [disable]),722 [enable], [m4_define([am_maintainer_other], [disable])],723 [disable], [m4_define([am_maintainer_other], [enable])],724 [m4_define([am_maintainer_other], [enable])725 m4_warn([syntax], [unexpected argument to AM@&t@_MAINTAINER_MODE: $1])])726 AC_MSG_CHECKING([whether to enable maintainer-specific portions of Makefiles])727 dnl maintainer-mode's default is 'disable' unless 'enable' is passed728 AC_ARG_ENABLE([maintainer-mode],729 [AS_HELP_STRING([--]am_maintainer_other[-maintainer-mode],730 am_maintainer_other[ make rules and dependencies not useful731 (and sometimes confusing) to the casual installer])],732 [USE_MAINTAINER_MODE=$enableval],733 [USE_MAINTAINER_MODE=]m4_if(am_maintainer_other, [enable], [no], [yes]))734 AC_MSG_RESULT([$USE_MAINTAINER_MODE])735 AM_CONDITIONAL([MAINTAINER_MODE], [test $USE_MAINTAINER_MODE = yes])736 MAINT=$MAINTAINER_MODE_TRUE737 AC_SUBST([MAINT])dnl738 ]739 )740 741 668 # Check to see how 'make' treats includes. -*- Autoconf -*- 742 669 -
automake/compile
-
Property mode
changed from
100755to120000
rf9feab8 r90152a4 1 #! /bin/sh 2 # Wrapper for compilers which do not understand '-c -o'. 3 4 scriptversion=2012-10-14.11; # UTC 5 6 # Copyright (C) 1999-2014 Free Software Foundation, Inc. 7 # Written by Tom Tromey <tromey@cygnus.com>. 8 # 9 # This program is free software; you can redistribute it and/or modify 10 # it under the terms of the GNU General Public License as published by 11 # the Free Software Foundation; either version 2, or (at your option) 12 # any later version. 13 # 14 # This program is distributed in the hope that it will be useful, 15 # but WITHOUT ANY WARRANTY; without even the implied warranty of 16 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 17 # GNU General Public License for more details. 18 # 19 # You should have received a copy of the GNU General Public License 20 # along with this program. If not, see <http://www.gnu.org/licenses/>. 21 22 # As a special exception to the GNU General Public License, if you 23 # distribute this file as part of a program that contains a 24 # configuration script generated by Autoconf, you may include it under 25 # the same distribution terms that you use for the rest of that program. 26 27 # This file is maintained in Automake, please report 28 # bugs to <bug-automake@gnu.org> or send patches to 29 # <automake-patches@gnu.org>. 30 31 nl=' 32 ' 33 34 # We need space, tab and new line, in precisely that order. Quoting is 35 # there to prevent tools from complaining about whitespace usage. 36 IFS=" "" $nl" 37 38 file_conv= 39 40 # func_file_conv build_file lazy 41 # Convert a $build file to $host form and store it in $file 42 # Currently only supports Windows hosts. If the determined conversion 43 # type is listed in (the comma separated) LAZY, no conversion will 44 # take place. 45 func_file_conv () 46 { 47 file=$1 48 case $file in 49 / | /[!/]*) # absolute file, and not a UNC file 50 if test -z "$file_conv"; then 51 # lazily determine how to convert abs files 52 case `uname -s` in 53 MINGW*) 54 file_conv=mingw 55 ;; 56 CYGWIN*) 57 file_conv=cygwin 58 ;; 59 *) 60 file_conv=wine 61 ;; 62 esac 63 fi 64 case $file_conv/,$2, in 65 *,$file_conv,*) 66 ;; 67 mingw/*) 68 file=`cmd //C echo "$file " | sed -e 's/"\(.*\) " *$/\1/'` 69 ;; 70 cygwin/*) 71 file=`cygpath -m "$file" || echo "$file"` 72 ;; 73 wine/*) 74 file=`winepath -w "$file" || echo "$file"` 75 ;; 76 esac 77 ;; 78 esac 79 } 80 81 # func_cl_dashL linkdir 82 # Make cl look for libraries in LINKDIR 83 func_cl_dashL () 84 { 85 func_file_conv "$1" 86 if test -z "$lib_path"; then 87 lib_path=$file 88 else 89 lib_path="$lib_path;$file" 90 fi 91 linker_opts="$linker_opts -LIBPATH:$file" 92 } 93 94 # func_cl_dashl library 95 # Do a library search-path lookup for cl 96 func_cl_dashl () 97 { 98 lib=$1 99 found=no 100 save_IFS=$IFS 101 IFS=';' 102 for dir in $lib_path $LIB 103 do 104 IFS=$save_IFS 105 if $shared && test -f "$dir/$lib.dll.lib"; then 106 found=yes 107 lib=$dir/$lib.dll.lib 108 break 109 fi 110 if test -f "$dir/$lib.lib"; then 111 found=yes 112 lib=$dir/$lib.lib 113 break 114 fi 115 if test -f "$dir/lib$lib.a"; then 116 found=yes 117 lib=$dir/lib$lib.a 118 break 119 fi 120 done 121 IFS=$save_IFS 122 123 if test "$found" != yes; then 124 lib=$lib.lib 125 fi 126 } 127 128 # func_cl_wrapper cl arg... 129 # Adjust compile command to suit cl 130 func_cl_wrapper () 131 { 132 # Assume a capable shell 133 lib_path= 134 shared=: 135 linker_opts= 136 for arg 137 do 138 if test -n "$eat"; then 139 eat= 140 else 141 case $1 in 142 -o) 143 # configure might choose to run compile as 'compile cc -o foo foo.c'. 144 eat=1 145 case $2 in 146 *.o | *.[oO][bB][jJ]) 147 func_file_conv "$2" 148 set x "$@" -Fo"$file" 149 shift 150 ;; 151 *) 152 func_file_conv "$2" 153 set x "$@" -Fe"$file" 154 shift 155 ;; 156 esac 157 ;; 158 -I) 159 eat=1 160 func_file_conv "$2" mingw 161 set x "$@" -I"$file" 162 shift 163 ;; 164 -I*) 165 func_file_conv "${1#-I}" mingw 166 set x "$@" -I"$file" 167 shift 168 ;; 169 -l) 170 eat=1 171 func_cl_dashl "$2" 172 set x "$@" "$lib" 173 shift 174 ;; 175 -l*) 176 func_cl_dashl "${1#-l}" 177 set x "$@" "$lib" 178 shift 179 ;; 180 -L) 181 eat=1 182 func_cl_dashL "$2" 183 ;; 184 -L*) 185 func_cl_dashL "${1#-L}" 186 ;; 187 -static) 188 shared=false 189 ;; 190 -Wl,*) 191 arg=${1#-Wl,} 192 save_ifs="$IFS"; IFS=',' 193 for flag in $arg; do 194 IFS="$save_ifs" 195 linker_opts="$linker_opts $flag" 196 done 197 IFS="$save_ifs" 198 ;; 199 -Xlinker) 200 eat=1 201 linker_opts="$linker_opts $2" 202 ;; 203 -*) 204 set x "$@" "$1" 205 shift 206 ;; 207 *.cc | *.CC | *.cxx | *.CXX | *.[cC]++) 208 func_file_conv "$1" 209 set x "$@" -Tp"$file" 210 shift 211 ;; 212 *.c | *.cpp | *.CPP | *.lib | *.LIB | *.Lib | *.OBJ | *.obj | *.[oO]) 213 func_file_conv "$1" mingw 214 set x "$@" "$file" 215 shift 216 ;; 217 *) 218 set x "$@" "$1" 219 shift 220 ;; 221 esac 222 fi 223 shift 224 done 225 if test -n "$linker_opts"; then 226 linker_opts="-link$linker_opts" 227 fi 228 exec "$@" $linker_opts 229 exit 1 230 } 231 232 eat= 233 234 case $1 in 235 '') 236 echo "$0: No command. Try '$0 --help' for more information." 1>&2 237 exit 1; 238 ;; 239 -h | --h*) 240 cat <<\EOF 241 Usage: compile [--help] [--version] PROGRAM [ARGS] 242 243 Wrapper for compilers which do not understand '-c -o'. 244 Remove '-o dest.o' from ARGS, run PROGRAM with the remaining 245 arguments, and rename the output as expected. 246 247 If you are trying to build a whole package this is not the 248 right script to run: please start by reading the file 'INSTALL'. 249 250 Report bugs to <bug-automake@gnu.org>. 251 EOF 252 exit $? 253 ;; 254 -v | --v*) 255 echo "compile $scriptversion" 256 exit $? 257 ;; 258 cl | *[/\\]cl | cl.exe | *[/\\]cl.exe ) 259 func_cl_wrapper "$@" # Doesn't return... 260 ;; 261 esac 262 263 ofile= 264 cfile= 265 266 for arg 267 do 268 if test -n "$eat"; then 269 eat= 270 else 271 case $1 in 272 -o) 273 # configure might choose to run compile as 'compile cc -o foo foo.c'. 274 # So we strip '-o arg' only if arg is an object. 275 eat=1 276 case $2 in 277 *.o | *.obj) 278 ofile=$2 279 ;; 280 *) 281 set x "$@" -o "$2" 282 shift 283 ;; 284 esac 285 ;; 286 *.c) 287 cfile=$1 288 set x "$@" "$1" 289 shift 290 ;; 291 *) 292 set x "$@" "$1" 293 shift 294 ;; 295 esac 296 fi 297 shift 298 done 299 300 if test -z "$ofile" || test -z "$cfile"; then 301 # If no '-o' option was seen then we might have been invoked from a 302 # pattern rule where we don't need one. That is ok -- this is a 303 # normal compilation that the losing compiler can handle. If no 304 # '.c' file was seen then we are probably linking. That is also 305 # ok. 306 exec "$@" 307 fi 308 309 # Name of file we expect compiler to create. 310 cofile=`echo "$cfile" | sed 's|^.*[\\/]||; s|^[a-zA-Z]:||; s/\.c$/.o/'` 311 312 # Create the lock directory. 313 # Note: use '[/\\:.-]' here to ensure that we don't use the same name 314 # that we are using for the .o file. Also, base the name on the expected 315 # object file name, since that is what matters with a parallel build. 316 lockdir=`echo "$cofile" | sed -e 's|[/\\:.-]|_|g'`.d 317 while true; do 318 if mkdir "$lockdir" >/dev/null 2>&1; then 319 break 320 fi 321 sleep 1 322 done 323 # FIXME: race condition here if user kills between mkdir and trap. 324 trap "rmdir '$lockdir'; exit 1" 1 2 15 325 326 # Run the compile. 327 "$@" 328 ret=$? 329 330 if test -f "$cofile"; then 331 test "$cofile" = "$ofile" || mv "$cofile" "$ofile" 332 elif test -f "${cofile}bj"; then 333 test "${cofile}bj" = "$ofile" || mv "${cofile}bj" "$ofile" 334 fi 335 336 rmdir "$lockdir" 337 exit $ret 338 339 # Local Variables: 340 # mode: shell-script 341 # sh-indentation: 2 342 # eval: (add-hook 'write-file-hooks 'time-stamp) 343 # time-stamp-start: "scriptversion=" 344 # time-stamp-format: "%:y-%02m-%02d.%02H" 345 # time-stamp-time-zone: "UTC" 346 # time-stamp-end: "; # UTC" 347 # End: 1 /usr/share/automake-1.15/compile -
Property mode
changed from
-
automake/config.guess
-
Property mode
changed from
100755to120000
rf9feab8 r90152a4 1 #! /bin/sh 2 # Attempt to guess a canonical system name. 3 # Copyright 1992-2015 Free Software Foundation, Inc. 4 5 timestamp='2015-08-20' 6 7 # This file is free software; you can redistribute it and/or modify it 8 # under the terms of the GNU General Public License as published by 9 # the Free Software Foundation; either version 3 of the License, or 10 # (at your option) any later version. 11 # 12 # This program is distributed in the hope that it will be useful, but 13 # WITHOUT ANY WARRANTY; without even the implied warranty of 14 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 15 # General Public License for more details. 16 # 17 # You should have received a copy of the GNU General Public License 18 # along with this program; if not, see <http://www.gnu.org/licenses/>. 19 # 20 # As a special exception to the GNU General Public License, if you 21 # distribute this file as part of a program that contains a 22 # configuration script generated by Autoconf, you may include it under 23 # the same distribution terms that you use for the rest of that 24 # program. This Exception is an additional permission under section 7 25 # of the GNU General Public License, version 3 ("GPLv3"). 26 # 27 # Originally written by Per Bothner; maintained since 2000 by Ben Elliston. 28 # 29 # You can get the latest version of this script from: 30 # http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess;hb=HEAD 31 # 32 # Please send patches to <config-patches@gnu.org>. 33 34 35 me=`echo "$0" | sed -e 's,.*/,,'` 36 37 usage="\ 38 Usage: $0 [OPTION] 39 40 Output the configuration name of the system \`$me' is run on. 41 42 Operation modes: 43 -h, --help print this help, then exit 44 -t, --time-stamp print date of last modification, then exit 45 -v, --version print version number, then exit 46 47 Report bugs and patches to <config-patches@gnu.org>." 48 49 version="\ 50 GNU config.guess ($timestamp) 51 52 Originally written by Per Bothner. 53 Copyright 1992-2015 Free Software Foundation, Inc. 54 55 This is free software; see the source for copying conditions. There is NO 56 warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." 57 58 help=" 59 Try \`$me --help' for more information." 60 61 # Parse command line 62 while test $# -gt 0 ; do 63 case $1 in 64 --time-stamp | --time* | -t ) 65 echo "$timestamp" ; exit ;; 66 --version | -v ) 67 echo "$version" ; exit ;; 68 --help | --h* | -h ) 69 echo "$usage"; exit ;; 70 -- ) # Stop option processing 71 shift; break ;; 72 - ) # Use stdin as input. 73 break ;; 74 -* ) 75 echo "$me: invalid option $1$help" >&2 76 exit 1 ;; 77 * ) 78 break ;; 79 esac 80 done 81 82 if test $# != 0; then 83 echo "$me: too many arguments$help" >&2 84 exit 1 85 fi 86 87 trap 'exit 1' 1 2 15 88 89 # CC_FOR_BUILD -- compiler used by this script. Note that the use of a 90 # compiler to aid in system detection is discouraged as it requires 91 # temporary files to be created and, as you can see below, it is a 92 # headache to deal with in a portable fashion. 93 94 # Historically, `CC_FOR_BUILD' used to be named `HOST_CC'. We still 95 # use `HOST_CC' if defined, but it is deprecated. 96 97 # Portable tmp directory creation inspired by the Autoconf team. 98 99 set_cc_for_build=' 100 trap "exitcode=\$?; (rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null) && exit \$exitcode" 0 ; 101 trap "rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null; exit 1" 1 2 13 15 ; 102 : ${TMPDIR=/tmp} ; 103 { tmp=`(umask 077 && mktemp -d "$TMPDIR/cgXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" ; } || 104 { test -n "$RANDOM" && tmp=$TMPDIR/cg$$-$RANDOM && (umask 077 && mkdir $tmp) ; } || 105 { tmp=$TMPDIR/cg-$$ && (umask 077 && mkdir $tmp) && echo "Warning: creating insecure temp directory" >&2 ; } || 106 { echo "$me: cannot create a temporary directory in $TMPDIR" >&2 ; exit 1 ; } ; 107 dummy=$tmp/dummy ; 108 tmpfiles="$dummy.c $dummy.o $dummy.rel $dummy" ; 109 case $CC_FOR_BUILD,$HOST_CC,$CC in 110 ,,) echo "int x;" > $dummy.c ; 111 for c in cc gcc c89 c99 ; do 112 if ($c -c -o $dummy.o $dummy.c) >/dev/null 2>&1 ; then 113 CC_FOR_BUILD="$c"; break ; 114 fi ; 115 done ; 116 if test x"$CC_FOR_BUILD" = x ; then 117 CC_FOR_BUILD=no_compiler_found ; 118 fi 119 ;; 120 ,,*) CC_FOR_BUILD=$CC ;; 121 ,*,*) CC_FOR_BUILD=$HOST_CC ;; 122 esac ; set_cc_for_build= ;' 123 124 # This is needed to find uname on a Pyramid OSx when run in the BSD universe. 125 # (ghazi@noc.rutgers.edu 1994-08-24) 126 if (test -f /.attbin/uname) >/dev/null 2>&1 ; then 127 PATH=$PATH:/.attbin ; export PATH 128 fi 129 130 UNAME_MACHINE=`(uname -m) 2>/dev/null` || UNAME_MACHINE=unknown 131 UNAME_RELEASE=`(uname -r) 2>/dev/null` || UNAME_RELEASE=unknown 132 UNAME_SYSTEM=`(uname -s) 2>/dev/null` || UNAME_SYSTEM=unknown 133 UNAME_VERSION=`(uname -v) 2>/dev/null` || UNAME_VERSION=unknown 134 135 case "${UNAME_SYSTEM}" in 136 Linux|GNU|GNU/*) 137 # If the system lacks a compiler, then just pick glibc. 138 # We could probably try harder. 139 LIBC=gnu 140 141 eval $set_cc_for_build 142 cat <<-EOF > $dummy.c 143 #include <features.h> 144 #if defined(__UCLIBC__) 145 LIBC=uclibc 146 #elif defined(__dietlibc__) 147 LIBC=dietlibc 148 #else 149 LIBC=gnu 150 #endif 151 EOF 152 eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^LIBC' | sed 's, ,,g'` 153 ;; 154 esac 155 156 # Note: order is significant - the case branches are not exclusive. 157 158 case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in 159 *:NetBSD:*:*) 160 # NetBSD (nbsd) targets should (where applicable) match one or 161 # more of the tuples: *-*-netbsdelf*, *-*-netbsdaout*, 162 # *-*-netbsdecoff* and *-*-netbsd*. For targets that recently 163 # switched to ELF, *-*-netbsd* would select the old 164 # object file format. This provides both forward 165 # compatibility and a consistent mechanism for selecting the 166 # object file format. 167 # 168 # Note: NetBSD doesn't particularly care about the vendor 169 # portion of the name. We always set it to "unknown". 170 sysctl="sysctl -n hw.machine_arch" 171 UNAME_MACHINE_ARCH=`(uname -p 2>/dev/null || \ 172 /sbin/$sysctl 2>/dev/null || \ 173 /usr/sbin/$sysctl 2>/dev/null || \ 174 echo unknown)` 175 case "${UNAME_MACHINE_ARCH}" in 176 armeb) machine=armeb-unknown ;; 177 arm*) machine=arm-unknown ;; 178 sh3el) machine=shl-unknown ;; 179 sh3eb) machine=sh-unknown ;; 180 sh5el) machine=sh5le-unknown ;; 181 earmv*) 182 arch=`echo ${UNAME_MACHINE_ARCH} | sed -e 's,^e\(armv[0-9]\).*$,\1,'` 183 endian=`echo ${UNAME_MACHINE_ARCH} | sed -ne 's,^.*\(eb\)$,\1,p'` 184 machine=${arch}${endian}-unknown 185 ;; 186 *) machine=${UNAME_MACHINE_ARCH}-unknown ;; 187 esac 188 # The Operating System including object format, if it has switched 189 # to ELF recently, or will in the future. 190 case "${UNAME_MACHINE_ARCH}" in 191 arm*|earm*|i386|m68k|ns32k|sh3*|sparc|vax) 192 eval $set_cc_for_build 193 if echo __ELF__ | $CC_FOR_BUILD -E - 2>/dev/null \ 194 | grep -q __ELF__ 195 then 196 # Once all utilities can be ECOFF (netbsdecoff) or a.out (netbsdaout). 197 # Return netbsd for either. FIX? 198 os=netbsd 199 else 200 os=netbsdelf 201 fi 202 ;; 203 *) 204 os=netbsd 205 ;; 206 esac 207 # Determine ABI tags. 208 case "${UNAME_MACHINE_ARCH}" in 209 earm*) 210 expr='s/^earmv[0-9]/-eabi/;s/eb$//' 211 abi=`echo ${UNAME_MACHINE_ARCH} | sed -e "$expr"` 212 ;; 213 esac 214 # The OS release 215 # Debian GNU/NetBSD machines have a different userland, and 216 # thus, need a distinct triplet. However, they do not need 217 # kernel version information, so it can be replaced with a 218 # suitable tag, in the style of linux-gnu. 219 case "${UNAME_VERSION}" in 220 Debian*) 221 release='-gnu' 222 ;; 223 *) 224 release=`echo ${UNAME_RELEASE} | sed -e 's/[-_].*//' | cut -d. -f1,2` 225 ;; 226 esac 227 # Since CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM: 228 # contains redundant information, the shorter form: 229 # CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM is used. 230 echo "${machine}-${os}${release}${abi}" 231 exit ;; 232 *:Bitrig:*:*) 233 UNAME_MACHINE_ARCH=`arch | sed 's/Bitrig.//'` 234 echo ${UNAME_MACHINE_ARCH}-unknown-bitrig${UNAME_RELEASE} 235 exit ;; 236 *:OpenBSD:*:*) 237 UNAME_MACHINE_ARCH=`arch | sed 's/OpenBSD.//'` 238 echo ${UNAME_MACHINE_ARCH}-unknown-openbsd${UNAME_RELEASE} 239 exit ;; 240 *:ekkoBSD:*:*) 241 echo ${UNAME_MACHINE}-unknown-ekkobsd${UNAME_RELEASE} 242 exit ;; 243 *:SolidBSD:*:*) 244 echo ${UNAME_MACHINE}-unknown-solidbsd${UNAME_RELEASE} 245 exit ;; 246 macppc:MirBSD:*:*) 247 echo powerpc-unknown-mirbsd${UNAME_RELEASE} 248 exit ;; 249 *:MirBSD:*:*) 250 echo ${UNAME_MACHINE}-unknown-mirbsd${UNAME_RELEASE} 251 exit ;; 252 *:Sortix:*:*) 253 echo ${UNAME_MACHINE}-unknown-sortix 254 exit ;; 255 alpha:OSF1:*:*) 256 case $UNAME_RELEASE in 257 *4.0) 258 UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $3}'` 259 ;; 260 *5.*) 261 UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $4}'` 262 ;; 263 esac 264 # According to Compaq, /usr/sbin/psrinfo has been available on 265 # OSF/1 and Tru64 systems produced since 1995. I hope that 266 # covers most systems running today. This code pipes the CPU 267 # types through head -n 1, so we only detect the type of CPU 0. 268 ALPHA_CPU_TYPE=`/usr/sbin/psrinfo -v | sed -n -e 's/^ The alpha \(.*\) processor.*$/\1/p' | head -n 1` 269 case "$ALPHA_CPU_TYPE" in 270 "EV4 (21064)") 271 UNAME_MACHINE="alpha" ;; 272 "EV4.5 (21064)") 273 UNAME_MACHINE="alpha" ;; 274 "LCA4 (21066/21068)") 275 UNAME_MACHINE="alpha" ;; 276 "EV5 (21164)") 277 UNAME_MACHINE="alphaev5" ;; 278 "EV5.6 (21164A)") 279 UNAME_MACHINE="alphaev56" ;; 280 "EV5.6 (21164PC)") 281 UNAME_MACHINE="alphapca56" ;; 282 "EV5.7 (21164PC)") 283 UNAME_MACHINE="alphapca57" ;; 284 "EV6 (21264)") 285 UNAME_MACHINE="alphaev6" ;; 286 "EV6.7 (21264A)") 287 UNAME_MACHINE="alphaev67" ;; 288 "EV6.8CB (21264C)") 289 UNAME_MACHINE="alphaev68" ;; 290 "EV6.8AL (21264B)") 291 UNAME_MACHINE="alphaev68" ;; 292 "EV6.8CX (21264D)") 293 UNAME_MACHINE="alphaev68" ;; 294 "EV6.9A (21264/EV69A)") 295 UNAME_MACHINE="alphaev69" ;; 296 "EV7 (21364)") 297 UNAME_MACHINE="alphaev7" ;; 298 "EV7.9 (21364A)") 299 UNAME_MACHINE="alphaev79" ;; 300 esac 301 # A Pn.n version is a patched version. 302 # A Vn.n version is a released version. 303 # A Tn.n version is a released field test version. 304 # A Xn.n version is an unreleased experimental baselevel. 305 # 1.2 uses "1.2" for uname -r. 306 echo ${UNAME_MACHINE}-dec-osf`echo ${UNAME_RELEASE} | sed -e 's/^[PVTX]//' | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` 307 # Reset EXIT trap before exiting to avoid spurious non-zero exit code. 308 exitcode=$? 309 trap '' 0 310 exit $exitcode ;; 311 Alpha\ *:Windows_NT*:*) 312 # How do we know it's Interix rather than the generic POSIX subsystem? 313 # Should we change UNAME_MACHINE based on the output of uname instead 314 # of the specific Alpha model? 315 echo alpha-pc-interix 316 exit ;; 317 21064:Windows_NT:50:3) 318 echo alpha-dec-winnt3.5 319 exit ;; 320 Amiga*:UNIX_System_V:4.0:*) 321 echo m68k-unknown-sysv4 322 exit ;; 323 *:[Aa]miga[Oo][Ss]:*:*) 324 echo ${UNAME_MACHINE}-unknown-amigaos 325 exit ;; 326 *:[Mm]orph[Oo][Ss]:*:*) 327 echo ${UNAME_MACHINE}-unknown-morphos 328 exit ;; 329 *:OS/390:*:*) 330 echo i370-ibm-openedition 331 exit ;; 332 *:z/VM:*:*) 333 echo s390-ibm-zvmoe 334 exit ;; 335 *:OS400:*:*) 336 echo powerpc-ibm-os400 337 exit ;; 338 arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*) 339 echo arm-acorn-riscix${UNAME_RELEASE} 340 exit ;; 341 arm*:riscos:*:*|arm*:RISCOS:*:*) 342 echo arm-unknown-riscos 343 exit ;; 344 SR2?01:HI-UX/MPP:*:* | SR8000:HI-UX/MPP:*:*) 345 echo hppa1.1-hitachi-hiuxmpp 346 exit ;; 347 Pyramid*:OSx*:*:* | MIS*:OSx*:*:* | MIS*:SMP_DC-OSx*:*:*) 348 # akee@wpdis03.wpafb.af.mil (Earle F. Ake) contributed MIS and NILE. 349 if test "`(/bin/universe) 2>/dev/null`" = att ; then 350 echo pyramid-pyramid-sysv3 351 else 352 echo pyramid-pyramid-bsd 353 fi 354 exit ;; 355 NILE*:*:*:dcosx) 356 echo pyramid-pyramid-svr4 357 exit ;; 358 DRS?6000:unix:4.0:6*) 359 echo sparc-icl-nx6 360 exit ;; 361 DRS?6000:UNIX_SV:4.2*:7* | DRS?6000:isis:4.2*:7*) 362 case `/usr/bin/uname -p` in 363 sparc) echo sparc-icl-nx7; exit ;; 364 esac ;; 365 s390x:SunOS:*:*) 366 echo ${UNAME_MACHINE}-ibm-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` 367 exit ;; 368 sun4H:SunOS:5.*:*) 369 echo sparc-hal-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` 370 exit ;; 371 sun4*:SunOS:5.*:* | tadpole*:SunOS:5.*:*) 372 echo sparc-sun-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` 373 exit ;; 374 i86pc:AuroraUX:5.*:* | i86xen:AuroraUX:5.*:*) 375 echo i386-pc-auroraux${UNAME_RELEASE} 376 exit ;; 377 i86pc:SunOS:5.*:* | i86xen:SunOS:5.*:*) 378 eval $set_cc_for_build 379 SUN_ARCH="i386" 380 # If there is a compiler, see if it is configured for 64-bit objects. 381 # Note that the Sun cc does not turn __LP64__ into 1 like gcc does. 382 # This test works for both compilers. 383 if [ "$CC_FOR_BUILD" != 'no_compiler_found' ]; then 384 if (echo '#ifdef __amd64'; echo IS_64BIT_ARCH; echo '#endif') | \ 385 (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | \ 386 grep IS_64BIT_ARCH >/dev/null 387 then 388 SUN_ARCH="x86_64" 389 fi 390 fi 391 echo ${SUN_ARCH}-pc-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` 392 exit ;; 393 sun4*:SunOS:6*:*) 394 # According to config.sub, this is the proper way to canonicalize 395 # SunOS6. Hard to guess exactly what SunOS6 will be like, but 396 # it's likely to be more like Solaris than SunOS4. 397 echo sparc-sun-solaris3`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` 398 exit ;; 399 sun4*:SunOS:*:*) 400 case "`/usr/bin/arch -k`" in 401 Series*|S4*) 402 UNAME_RELEASE=`uname -v` 403 ;; 404 esac 405 # Japanese Language versions have a version number like `4.1.3-JL'. 406 echo sparc-sun-sunos`echo ${UNAME_RELEASE}|sed -e 's/-/_/'` 407 exit ;; 408 sun3*:SunOS:*:*) 409 echo m68k-sun-sunos${UNAME_RELEASE} 410 exit ;; 411 sun*:*:4.2BSD:*) 412 UNAME_RELEASE=`(sed 1q /etc/motd | awk '{print substr($5,1,3)}') 2>/dev/null` 413 test "x${UNAME_RELEASE}" = "x" && UNAME_RELEASE=3 414 case "`/bin/arch`" in 415 sun3) 416 echo m68k-sun-sunos${UNAME_RELEASE} 417 ;; 418 sun4) 419 echo sparc-sun-sunos${UNAME_RELEASE} 420 ;; 421 esac 422 exit ;; 423 aushp:SunOS:*:*) 424 echo sparc-auspex-sunos${UNAME_RELEASE} 425 exit ;; 426 # The situation for MiNT is a little confusing. The machine name 427 # can be virtually everything (everything which is not 428 # "atarist" or "atariste" at least should have a processor 429 # > m68000). The system name ranges from "MiNT" over "FreeMiNT" 430 # to the lowercase version "mint" (or "freemint"). Finally 431 # the system name "TOS" denotes a system which is actually not 432 # MiNT. But MiNT is downward compatible to TOS, so this should 433 # be no problem. 434 atarist[e]:*MiNT:*:* | atarist[e]:*mint:*:* | atarist[e]:*TOS:*:*) 435 echo m68k-atari-mint${UNAME_RELEASE} 436 exit ;; 437 atari*:*MiNT:*:* | atari*:*mint:*:* | atarist[e]:*TOS:*:*) 438 echo m68k-atari-mint${UNAME_RELEASE} 439 exit ;; 440 *falcon*:*MiNT:*:* | *falcon*:*mint:*:* | *falcon*:*TOS:*:*) 441 echo m68k-atari-mint${UNAME_RELEASE} 442 exit ;; 443 milan*:*MiNT:*:* | milan*:*mint:*:* | *milan*:*TOS:*:*) 444 echo m68k-milan-mint${UNAME_RELEASE} 445 exit ;; 446 hades*:*MiNT:*:* | hades*:*mint:*:* | *hades*:*TOS:*:*) 447 echo m68k-hades-mint${UNAME_RELEASE} 448 exit ;; 449 *:*MiNT:*:* | *:*mint:*:* | *:*TOS:*:*) 450 echo m68k-unknown-mint${UNAME_RELEASE} 451 exit ;; 452 m68k:machten:*:*) 453 echo m68k-apple-machten${UNAME_RELEASE} 454 exit ;; 455 powerpc:machten:*:*) 456 echo powerpc-apple-machten${UNAME_RELEASE} 457 exit ;; 458 RISC*:Mach:*:*) 459 echo mips-dec-mach_bsd4.3 460 exit ;; 461 RISC*:ULTRIX:*:*) 462 echo mips-dec-ultrix${UNAME_RELEASE} 463 exit ;; 464 VAX*:ULTRIX*:*:*) 465 echo vax-dec-ultrix${UNAME_RELEASE} 466 exit ;; 467 2020:CLIX:*:* | 2430:CLIX:*:*) 468 echo clipper-intergraph-clix${UNAME_RELEASE} 469 exit ;; 470 mips:*:*:UMIPS | mips:*:*:RISCos) 471 eval $set_cc_for_build 472 sed 's/^ //' << EOF >$dummy.c 473 #ifdef __cplusplus 474 #include <stdio.h> /* for printf() prototype */ 475 int main (int argc, char *argv[]) { 476 #else 477 int main (argc, argv) int argc; char *argv[]; { 478 #endif 479 #if defined (host_mips) && defined (MIPSEB) 480 #if defined (SYSTYPE_SYSV) 481 printf ("mips-mips-riscos%ssysv\n", argv[1]); exit (0); 482 #endif 483 #if defined (SYSTYPE_SVR4) 484 printf ("mips-mips-riscos%ssvr4\n", argv[1]); exit (0); 485 #endif 486 #if defined (SYSTYPE_BSD43) || defined(SYSTYPE_BSD) 487 printf ("mips-mips-riscos%sbsd\n", argv[1]); exit (0); 488 #endif 489 #endif 490 exit (-1); 491 } 492 EOF 493 $CC_FOR_BUILD -o $dummy $dummy.c && 494 dummyarg=`echo "${UNAME_RELEASE}" | sed -n 's/\([0-9]*\).*/\1/p'` && 495 SYSTEM_NAME=`$dummy $dummyarg` && 496 { echo "$SYSTEM_NAME"; exit; } 497 echo mips-mips-riscos${UNAME_RELEASE} 498 exit ;; 499 Motorola:PowerMAX_OS:*:*) 500 echo powerpc-motorola-powermax 501 exit ;; 502 Motorola:*:4.3:PL8-*) 503 echo powerpc-harris-powermax 504 exit ;; 505 Night_Hawk:*:*:PowerMAX_OS | Synergy:PowerMAX_OS:*:*) 506 echo powerpc-harris-powermax 507 exit ;; 508 Night_Hawk:Power_UNIX:*:*) 509 echo powerpc-harris-powerunix 510 exit ;; 511 m88k:CX/UX:7*:*) 512 echo m88k-harris-cxux7 513 exit ;; 514 m88k:*:4*:R4*) 515 echo m88k-motorola-sysv4 516 exit ;; 517 m88k:*:3*:R3*) 518 echo m88k-motorola-sysv3 519 exit ;; 520 AViiON:dgux:*:*) 521 # DG/UX returns AViiON for all architectures 522 UNAME_PROCESSOR=`/usr/bin/uname -p` 523 if [ $UNAME_PROCESSOR = mc88100 ] || [ $UNAME_PROCESSOR = mc88110 ] 524 then 525 if [ ${TARGET_BINARY_INTERFACE}x = m88kdguxelfx ] || \ 526 [ ${TARGET_BINARY_INTERFACE}x = x ] 527 then 528 echo m88k-dg-dgux${UNAME_RELEASE} 529 else 530 echo m88k-dg-dguxbcs${UNAME_RELEASE} 531 fi 532 else 533 echo i586-dg-dgux${UNAME_RELEASE} 534 fi 535 exit ;; 536 M88*:DolphinOS:*:*) # DolphinOS (SVR3) 537 echo m88k-dolphin-sysv3 538 exit ;; 539 M88*:*:R3*:*) 540 # Delta 88k system running SVR3 541 echo m88k-motorola-sysv3 542 exit ;; 543 XD88*:*:*:*) # Tektronix XD88 system running UTekV (SVR3) 544 echo m88k-tektronix-sysv3 545 exit ;; 546 Tek43[0-9][0-9]:UTek:*:*) # Tektronix 4300 system running UTek (BSD) 547 echo m68k-tektronix-bsd 548 exit ;; 549 *:IRIX*:*:*) 550 echo mips-sgi-irix`echo ${UNAME_RELEASE}|sed -e 's/-/_/g'` 551 exit ;; 552 ????????:AIX?:[12].1:2) # AIX 2.2.1 or AIX 2.1.1 is RT/PC AIX. 553 echo romp-ibm-aix # uname -m gives an 8 hex-code CPU id 554 exit ;; # Note that: echo "'`uname -s`'" gives 'AIX ' 555 i*86:AIX:*:*) 556 echo i386-ibm-aix 557 exit ;; 558 ia64:AIX:*:*) 559 if [ -x /usr/bin/oslevel ] ; then 560 IBM_REV=`/usr/bin/oslevel` 561 else 562 IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE} 563 fi 564 echo ${UNAME_MACHINE}-ibm-aix${IBM_REV} 565 exit ;; 566 *:AIX:2:3) 567 if grep bos325 /usr/include/stdio.h >/dev/null 2>&1; then 568 eval $set_cc_for_build 569 sed 's/^ //' << EOF >$dummy.c 570 #include <sys/systemcfg.h> 571 572 main() 573 { 574 if (!__power_pc()) 575 exit(1); 576 puts("powerpc-ibm-aix3.2.5"); 577 exit(0); 578 } 579 EOF 580 if $CC_FOR_BUILD -o $dummy $dummy.c && SYSTEM_NAME=`$dummy` 581 then 582 echo "$SYSTEM_NAME" 583 else 584 echo rs6000-ibm-aix3.2.5 585 fi 586 elif grep bos324 /usr/include/stdio.h >/dev/null 2>&1; then 587 echo rs6000-ibm-aix3.2.4 588 else 589 echo rs6000-ibm-aix3.2 590 fi 591 exit ;; 592 *:AIX:*:[4567]) 593 IBM_CPU_ID=`/usr/sbin/lsdev -C -c processor -S available | sed 1q | awk '{ print $1 }'` 594 if /usr/sbin/lsattr -El ${IBM_CPU_ID} | grep ' POWER' >/dev/null 2>&1; then 595 IBM_ARCH=rs6000 596 else 597 IBM_ARCH=powerpc 598 fi 599 if [ -x /usr/bin/lslpp ] ; then 600 IBM_REV=`/usr/bin/lslpp -Lqc bos.rte.libc | 601 awk -F: '{ print $3 }' | sed s/[0-9]*$/0/` 602 else 603 IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE} 604 fi 605 echo ${IBM_ARCH}-ibm-aix${IBM_REV} 606 exit ;; 607 *:AIX:*:*) 608 echo rs6000-ibm-aix 609 exit ;; 610 ibmrt:4.4BSD:*|romp-ibm:BSD:*) 611 echo romp-ibm-bsd4.4 612 exit ;; 613 ibmrt:*BSD:*|romp-ibm:BSD:*) # covers RT/PC BSD and 614 echo romp-ibm-bsd${UNAME_RELEASE} # 4.3 with uname added to 615 exit ;; # report: romp-ibm BSD 4.3 616 *:BOSX:*:*) 617 echo rs6000-bull-bosx 618 exit ;; 619 DPX/2?00:B.O.S.:*:*) 620 echo m68k-bull-sysv3 621 exit ;; 622 9000/[34]??:4.3bsd:1.*:*) 623 echo m68k-hp-bsd 624 exit ;; 625 hp300:4.4BSD:*:* | 9000/[34]??:4.3bsd:2.*:*) 626 echo m68k-hp-bsd4.4 627 exit ;; 628 9000/[34678]??:HP-UX:*:*) 629 HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'` 630 case "${UNAME_MACHINE}" in 631 9000/31? ) HP_ARCH=m68000 ;; 632 9000/[34]?? ) HP_ARCH=m68k ;; 633 9000/[678][0-9][0-9]) 634 if [ -x /usr/bin/getconf ]; then 635 sc_cpu_version=`/usr/bin/getconf SC_CPU_VERSION 2>/dev/null` 636 sc_kernel_bits=`/usr/bin/getconf SC_KERNEL_BITS 2>/dev/null` 637 case "${sc_cpu_version}" in 638 523) HP_ARCH="hppa1.0" ;; # CPU_PA_RISC1_0 639 528) HP_ARCH="hppa1.1" ;; # CPU_PA_RISC1_1 640 532) # CPU_PA_RISC2_0 641 case "${sc_kernel_bits}" in 642 32) HP_ARCH="hppa2.0n" ;; 643 64) HP_ARCH="hppa2.0w" ;; 644 '') HP_ARCH="hppa2.0" ;; # HP-UX 10.20 645 esac ;; 646 esac 647 fi 648 if [ "${HP_ARCH}" = "" ]; then 649 eval $set_cc_for_build 650 sed 's/^ //' << EOF >$dummy.c 651 652 #define _HPUX_SOURCE 653 #include <stdlib.h> 654 #include <unistd.h> 655 656 int main () 657 { 658 #if defined(_SC_KERNEL_BITS) 659 long bits = sysconf(_SC_KERNEL_BITS); 660 #endif 661 long cpu = sysconf (_SC_CPU_VERSION); 662 663 switch (cpu) 664 { 665 case CPU_PA_RISC1_0: puts ("hppa1.0"); break; 666 case CPU_PA_RISC1_1: puts ("hppa1.1"); break; 667 case CPU_PA_RISC2_0: 668 #if defined(_SC_KERNEL_BITS) 669 switch (bits) 670 { 671 case 64: puts ("hppa2.0w"); break; 672 case 32: puts ("hppa2.0n"); break; 673 default: puts ("hppa2.0"); break; 674 } break; 675 #else /* !defined(_SC_KERNEL_BITS) */ 676 puts ("hppa2.0"); break; 677 #endif 678 default: puts ("hppa1.0"); break; 679 } 680 exit (0); 681 } 682 EOF 683 (CCOPTS= $CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null) && HP_ARCH=`$dummy` 684 test -z "$HP_ARCH" && HP_ARCH=hppa 685 fi ;; 686 esac 687 if [ ${HP_ARCH} = "hppa2.0w" ] 688 then 689 eval $set_cc_for_build 690 691 # hppa2.0w-hp-hpux* has a 64-bit kernel and a compiler generating 692 # 32-bit code. hppa64-hp-hpux* has the same kernel and a compiler 693 # generating 64-bit code. GNU and HP use different nomenclature: 694 # 695 # $ CC_FOR_BUILD=cc ./config.guess 696 # => hppa2.0w-hp-hpux11.23 697 # $ CC_FOR_BUILD="cc +DA2.0w" ./config.guess 698 # => hppa64-hp-hpux11.23 699 700 if echo __LP64__ | (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | 701 grep -q __LP64__ 702 then 703 HP_ARCH="hppa2.0w" 704 else 705 HP_ARCH="hppa64" 706 fi 707 fi 708 echo ${HP_ARCH}-hp-hpux${HPUX_REV} 709 exit ;; 710 ia64:HP-UX:*:*) 711 HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'` 712 echo ia64-hp-hpux${HPUX_REV} 713 exit ;; 714 3050*:HI-UX:*:*) 715 eval $set_cc_for_build 716 sed 's/^ //' << EOF >$dummy.c 717 #include <unistd.h> 718 int 719 main () 720 { 721 long cpu = sysconf (_SC_CPU_VERSION); 722 /* The order matters, because CPU_IS_HP_MC68K erroneously returns 723 true for CPU_PA_RISC1_0. CPU_IS_PA_RISC returns correct 724 results, however. */ 725 if (CPU_IS_PA_RISC (cpu)) 726 { 727 switch (cpu) 728 { 729 case CPU_PA_RISC1_0: puts ("hppa1.0-hitachi-hiuxwe2"); break; 730 case CPU_PA_RISC1_1: puts ("hppa1.1-hitachi-hiuxwe2"); break; 731 case CPU_PA_RISC2_0: puts ("hppa2.0-hitachi-hiuxwe2"); break; 732 default: puts ("hppa-hitachi-hiuxwe2"); break; 733 } 734 } 735 else if (CPU_IS_HP_MC68K (cpu)) 736 puts ("m68k-hitachi-hiuxwe2"); 737 else puts ("unknown-hitachi-hiuxwe2"); 738 exit (0); 739 } 740 EOF 741 $CC_FOR_BUILD -o $dummy $dummy.c && SYSTEM_NAME=`$dummy` && 742 { echo "$SYSTEM_NAME"; exit; } 743 echo unknown-hitachi-hiuxwe2 744 exit ;; 745 9000/7??:4.3bsd:*:* | 9000/8?[79]:4.3bsd:*:* ) 746 echo hppa1.1-hp-bsd 747 exit ;; 748 9000/8??:4.3bsd:*:*) 749 echo hppa1.0-hp-bsd 750 exit ;; 751 *9??*:MPE/iX:*:* | *3000*:MPE/iX:*:*) 752 echo hppa1.0-hp-mpeix 753 exit ;; 754 hp7??:OSF1:*:* | hp8?[79]:OSF1:*:* ) 755 echo hppa1.1-hp-osf 756 exit ;; 757 hp8??:OSF1:*:*) 758 echo hppa1.0-hp-osf 759 exit ;; 760 i*86:OSF1:*:*) 761 if [ -x /usr/sbin/sysversion ] ; then 762 echo ${UNAME_MACHINE}-unknown-osf1mk 763 else 764 echo ${UNAME_MACHINE}-unknown-osf1 765 fi 766 exit ;; 767 parisc*:Lites*:*:*) 768 echo hppa1.1-hp-lites 769 exit ;; 770 C1*:ConvexOS:*:* | convex:ConvexOS:C1*:*) 771 echo c1-convex-bsd 772 exit ;; 773 C2*:ConvexOS:*:* | convex:ConvexOS:C2*:*) 774 if getsysinfo -f scalar_acc 775 then echo c32-convex-bsd 776 else echo c2-convex-bsd 777 fi 778 exit ;; 779 C34*:ConvexOS:*:* | convex:ConvexOS:C34*:*) 780 echo c34-convex-bsd 781 exit ;; 782 C38*:ConvexOS:*:* | convex:ConvexOS:C38*:*) 783 echo c38-convex-bsd 784 exit ;; 785 C4*:ConvexOS:*:* | convex:ConvexOS:C4*:*) 786 echo c4-convex-bsd 787 exit ;; 788 CRAY*Y-MP:*:*:*) 789 echo ymp-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' 790 exit ;; 791 CRAY*[A-Z]90:*:*:*) 792 echo ${UNAME_MACHINE}-cray-unicos${UNAME_RELEASE} \ 793 | sed -e 's/CRAY.*\([A-Z]90\)/\1/' \ 794 -e y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/ \ 795 -e 's/\.[^.]*$/.X/' 796 exit ;; 797 CRAY*TS:*:*:*) 798 echo t90-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' 799 exit ;; 800 CRAY*T3E:*:*:*) 801 echo alphaev5-cray-unicosmk${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' 802 exit ;; 803 CRAY*SV1:*:*:*) 804 echo sv1-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' 805 exit ;; 806 *:UNICOS/mp:*:*) 807 echo craynv-cray-unicosmp${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' 808 exit ;; 809 F30[01]:UNIX_System_V:*:* | F700:UNIX_System_V:*:*) 810 FUJITSU_PROC=`uname -m | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` 811 FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'` 812 FUJITSU_REL=`echo ${UNAME_RELEASE} | sed -e 's/ /_/'` 813 echo "${FUJITSU_PROC}-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}" 814 exit ;; 815 5000:UNIX_System_V:4.*:*) 816 FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'` 817 FUJITSU_REL=`echo ${UNAME_RELEASE} | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/ /_/'` 818 echo "sparc-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}" 819 exit ;; 820 i*86:BSD/386:*:* | i*86:BSD/OS:*:* | *:Ascend\ Embedded/OS:*:*) 821 echo ${UNAME_MACHINE}-pc-bsdi${UNAME_RELEASE} 822 exit ;; 823 sparc*:BSD/OS:*:*) 824 echo sparc-unknown-bsdi${UNAME_RELEASE} 825 exit ;; 826 *:BSD/OS:*:*) 827 echo ${UNAME_MACHINE}-unknown-bsdi${UNAME_RELEASE} 828 exit ;; 829 *:FreeBSD:*:*) 830 UNAME_PROCESSOR=`/usr/bin/uname -p` 831 case ${UNAME_PROCESSOR} in 832 amd64) 833 echo x86_64-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;; 834 *) 835 echo ${UNAME_PROCESSOR}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;; 836 esac 837 exit ;; 838 i*:CYGWIN*:*) 839 echo ${UNAME_MACHINE}-pc-cygwin 840 exit ;; 841 *:MINGW64*:*) 842 echo ${UNAME_MACHINE}-pc-mingw64 843 exit ;; 844 *:MINGW*:*) 845 echo ${UNAME_MACHINE}-pc-mingw32 846 exit ;; 847 *:MSYS*:*) 848 echo ${UNAME_MACHINE}-pc-msys 849 exit ;; 850 i*:windows32*:*) 851 # uname -m includes "-pc" on this system. 852 echo ${UNAME_MACHINE}-mingw32 853 exit ;; 854 i*:PW*:*) 855 echo ${UNAME_MACHINE}-pc-pw32 856 exit ;; 857 *:Interix*:*) 858 case ${UNAME_MACHINE} in 859 x86) 860 echo i586-pc-interix${UNAME_RELEASE} 861 exit ;; 862 authenticamd | genuineintel | EM64T) 863 echo x86_64-unknown-interix${UNAME_RELEASE} 864 exit ;; 865 IA64) 866 echo ia64-unknown-interix${UNAME_RELEASE} 867 exit ;; 868 esac ;; 869 [345]86:Windows_95:* | [345]86:Windows_98:* | [345]86:Windows_NT:*) 870 echo i${UNAME_MACHINE}-pc-mks 871 exit ;; 872 8664:Windows_NT:*) 873 echo x86_64-pc-mks 874 exit ;; 875 i*:Windows_NT*:* | Pentium*:Windows_NT*:*) 876 # How do we know it's Interix rather than the generic POSIX subsystem? 877 # It also conflicts with pre-2.0 versions of AT&T UWIN. Should we 878 # UNAME_MACHINE based on the output of uname instead of i386? 879 echo i586-pc-interix 880 exit ;; 881 i*:UWIN*:*) 882 echo ${UNAME_MACHINE}-pc-uwin 883 exit ;; 884 amd64:CYGWIN*:*:* | x86_64:CYGWIN*:*:*) 885 echo x86_64-unknown-cygwin 886 exit ;; 887 p*:CYGWIN*:*) 888 echo powerpcle-unknown-cygwin 889 exit ;; 890 prep*:SunOS:5.*:*) 891 echo powerpcle-unknown-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` 892 exit ;; 893 *:GNU:*:*) 894 # the GNU system 895 echo `echo ${UNAME_MACHINE}|sed -e 's,[-/].*$,,'`-unknown-${LIBC}`echo ${UNAME_RELEASE}|sed -e 's,/.*$,,'` 896 exit ;; 897 *:GNU/*:*:*) 898 # other systems with GNU libc and userland 899 echo ${UNAME_MACHINE}-unknown-`echo ${UNAME_SYSTEM} | sed 's,^[^/]*/,,' | tr '[A-Z]' '[a-z]'``echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`-${LIBC} 900 exit ;; 901 i*86:Minix:*:*) 902 echo ${UNAME_MACHINE}-pc-minix 903 exit ;; 904 aarch64:Linux:*:*) 905 echo ${UNAME_MACHINE}-unknown-linux-${LIBC} 906 exit ;; 907 aarch64_be:Linux:*:*) 908 UNAME_MACHINE=aarch64_be 909 echo ${UNAME_MACHINE}-unknown-linux-${LIBC} 910 exit ;; 911 alpha:Linux:*:*) 912 case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' < /proc/cpuinfo` in 913 EV5) UNAME_MACHINE=alphaev5 ;; 914 EV56) UNAME_MACHINE=alphaev56 ;; 915 PCA56) UNAME_MACHINE=alphapca56 ;; 916 PCA57) UNAME_MACHINE=alphapca56 ;; 917 EV6) UNAME_MACHINE=alphaev6 ;; 918 EV67) UNAME_MACHINE=alphaev67 ;; 919 EV68*) UNAME_MACHINE=alphaev68 ;; 920 esac 921 objdump --private-headers /bin/sh | grep -q ld.so.1 922 if test "$?" = 0 ; then LIBC="gnulibc1" ; fi 923 echo ${UNAME_MACHINE}-unknown-linux-${LIBC} 924 exit ;; 925 arc:Linux:*:* | arceb:Linux:*:*) 926 echo ${UNAME_MACHINE}-unknown-linux-${LIBC} 927 exit ;; 928 arm*:Linux:*:*) 929 eval $set_cc_for_build 930 if echo __ARM_EABI__ | $CC_FOR_BUILD -E - 2>/dev/null \ 931 | grep -q __ARM_EABI__ 932 then 933 echo ${UNAME_MACHINE}-unknown-linux-${LIBC} 934 else 935 if echo __ARM_PCS_VFP | $CC_FOR_BUILD -E - 2>/dev/null \ 936 | grep -q __ARM_PCS_VFP 937 then 938 echo ${UNAME_MACHINE}-unknown-linux-${LIBC}eabi 939 else 940 echo ${UNAME_MACHINE}-unknown-linux-${LIBC}eabihf 941 fi 942 fi 943 exit ;; 944 avr32*:Linux:*:*) 945 echo ${UNAME_MACHINE}-unknown-linux-${LIBC} 946 exit ;; 947 cris:Linux:*:*) 948 echo ${UNAME_MACHINE}-axis-linux-${LIBC} 949 exit ;; 950 crisv32:Linux:*:*) 951 echo ${UNAME_MACHINE}-axis-linux-${LIBC} 952 exit ;; 953 e2k:Linux:*:*) 954 echo ${UNAME_MACHINE}-unknown-linux-${LIBC} 955 exit ;; 956 frv:Linux:*:*) 957 echo ${UNAME_MACHINE}-unknown-linux-${LIBC} 958 exit ;; 959 hexagon:Linux:*:*) 960 echo ${UNAME_MACHINE}-unknown-linux-${LIBC} 961 exit ;; 962 i*86:Linux:*:*) 963 echo ${UNAME_MACHINE}-pc-linux-${LIBC} 964 exit ;; 965 ia64:Linux:*:*) 966 echo ${UNAME_MACHINE}-unknown-linux-${LIBC} 967 exit ;; 968 m32r*:Linux:*:*) 969 echo ${UNAME_MACHINE}-unknown-linux-${LIBC} 970 exit ;; 971 m68*:Linux:*:*) 972 echo ${UNAME_MACHINE}-unknown-linux-${LIBC} 973 exit ;; 974 mips:Linux:*:* | mips64:Linux:*:*) 975 eval $set_cc_for_build 976 sed 's/^ //' << EOF >$dummy.c 977 #undef CPU 978 #undef ${UNAME_MACHINE} 979 #undef ${UNAME_MACHINE}el 980 #if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL) 981 CPU=${UNAME_MACHINE}el 982 #else 983 #if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB) 984 CPU=${UNAME_MACHINE} 985 #else 986 CPU= 987 #endif 988 #endif 989 EOF 990 eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^CPU'` 991 test x"${CPU}" != x && { echo "${CPU}-unknown-linux-${LIBC}"; exit; } 992 ;; 993 openrisc*:Linux:*:*) 994 echo or1k-unknown-linux-${LIBC} 995 exit ;; 996 or32:Linux:*:* | or1k*:Linux:*:*) 997 echo ${UNAME_MACHINE}-unknown-linux-${LIBC} 998 exit ;; 999 padre:Linux:*:*) 1000 echo sparc-unknown-linux-${LIBC} 1001 exit ;; 1002 parisc64:Linux:*:* | hppa64:Linux:*:*) 1003 echo hppa64-unknown-linux-${LIBC} 1004 exit ;; 1005 parisc:Linux:*:* | hppa:Linux:*:*) 1006 # Look for CPU level 1007 case `grep '^cpu[^a-z]*:' /proc/cpuinfo 2>/dev/null | cut -d' ' -f2` in 1008 PA7*) echo hppa1.1-unknown-linux-${LIBC} ;; 1009 PA8*) echo hppa2.0-unknown-linux-${LIBC} ;; 1010 *) echo hppa-unknown-linux-${LIBC} ;; 1011 esac 1012 exit ;; 1013 ppc64:Linux:*:*) 1014 echo powerpc64-unknown-linux-${LIBC} 1015 exit ;; 1016 ppc:Linux:*:*) 1017 echo powerpc-unknown-linux-${LIBC} 1018 exit ;; 1019 ppc64le:Linux:*:*) 1020 echo powerpc64le-unknown-linux-${LIBC} 1021 exit ;; 1022 ppcle:Linux:*:*) 1023 echo powerpcle-unknown-linux-${LIBC} 1024 exit ;; 1025 s390:Linux:*:* | s390x:Linux:*:*) 1026 echo ${UNAME_MACHINE}-ibm-linux-${LIBC} 1027 exit ;; 1028 sh64*:Linux:*:*) 1029 echo ${UNAME_MACHINE}-unknown-linux-${LIBC} 1030 exit ;; 1031 sh*:Linux:*:*) 1032 echo ${UNAME_MACHINE}-unknown-linux-${LIBC} 1033 exit ;; 1034 sparc:Linux:*:* | sparc64:Linux:*:*) 1035 echo ${UNAME_MACHINE}-unknown-linux-${LIBC} 1036 exit ;; 1037 tile*:Linux:*:*) 1038 echo ${UNAME_MACHINE}-unknown-linux-${LIBC} 1039 exit ;; 1040 vax:Linux:*:*) 1041 echo ${UNAME_MACHINE}-dec-linux-${LIBC} 1042 exit ;; 1043 x86_64:Linux:*:*) 1044 echo ${UNAME_MACHINE}-pc-linux-${LIBC} 1045 exit ;; 1046 xtensa*:Linux:*:*) 1047 echo ${UNAME_MACHINE}-unknown-linux-${LIBC} 1048 exit ;; 1049 i*86:DYNIX/ptx:4*:*) 1050 # ptx 4.0 does uname -s correctly, with DYNIX/ptx in there. 1051 # earlier versions are messed up and put the nodename in both 1052 # sysname and nodename. 1053 echo i386-sequent-sysv4 1054 exit ;; 1055 i*86:UNIX_SV:4.2MP:2.*) 1056 # Unixware is an offshoot of SVR4, but it has its own version 1057 # number series starting with 2... 1058 # I am not positive that other SVR4 systems won't match this, 1059 # I just have to hope. -- rms. 1060 # Use sysv4.2uw... so that sysv4* matches it. 1061 echo ${UNAME_MACHINE}-pc-sysv4.2uw${UNAME_VERSION} 1062 exit ;; 1063 i*86:OS/2:*:*) 1064 # If we were able to find `uname', then EMX Unix compatibility 1065 # is probably installed. 1066 echo ${UNAME_MACHINE}-pc-os2-emx 1067 exit ;; 1068 i*86:XTS-300:*:STOP) 1069 echo ${UNAME_MACHINE}-unknown-stop 1070 exit ;; 1071 i*86:atheos:*:*) 1072 echo ${UNAME_MACHINE}-unknown-atheos 1073 exit ;; 1074 i*86:syllable:*:*) 1075 echo ${UNAME_MACHINE}-pc-syllable 1076 exit ;; 1077 i*86:LynxOS:2.*:* | i*86:LynxOS:3.[01]*:* | i*86:LynxOS:4.[02]*:*) 1078 echo i386-unknown-lynxos${UNAME_RELEASE} 1079 exit ;; 1080 i*86:*DOS:*:*) 1081 echo ${UNAME_MACHINE}-pc-msdosdjgpp 1082 exit ;; 1083 i*86:*:4.*:* | i*86:SYSTEM_V:4.*:*) 1084 UNAME_REL=`echo ${UNAME_RELEASE} | sed 's/\/MP$//'` 1085 if grep Novell /usr/include/link.h >/dev/null 2>/dev/null; then 1086 echo ${UNAME_MACHINE}-univel-sysv${UNAME_REL} 1087 else 1088 echo ${UNAME_MACHINE}-pc-sysv${UNAME_REL} 1089 fi 1090 exit ;; 1091 i*86:*:5:[678]*) 1092 # UnixWare 7.x, OpenUNIX and OpenServer 6. 1093 case `/bin/uname -X | grep "^Machine"` in 1094 *486*) UNAME_MACHINE=i486 ;; 1095 *Pentium) UNAME_MACHINE=i586 ;; 1096 *Pent*|*Celeron) UNAME_MACHINE=i686 ;; 1097 esac 1098 echo ${UNAME_MACHINE}-unknown-sysv${UNAME_RELEASE}${UNAME_SYSTEM}${UNAME_VERSION} 1099 exit ;; 1100 i*86:*:3.2:*) 1101 if test -f /usr/options/cb.name; then 1102 UNAME_REL=`sed -n 's/.*Version //p' </usr/options/cb.name` 1103 echo ${UNAME_MACHINE}-pc-isc$UNAME_REL 1104 elif /bin/uname -X 2>/dev/null >/dev/null ; then 1105 UNAME_REL=`(/bin/uname -X|grep Release|sed -e 's/.*= //')` 1106 (/bin/uname -X|grep i80486 >/dev/null) && UNAME_MACHINE=i486 1107 (/bin/uname -X|grep '^Machine.*Pentium' >/dev/null) \ 1108 && UNAME_MACHINE=i586 1109 (/bin/uname -X|grep '^Machine.*Pent *II' >/dev/null) \ 1110 && UNAME_MACHINE=i686 1111 (/bin/uname -X|grep '^Machine.*Pentium Pro' >/dev/null) \ 1112 && UNAME_MACHINE=i686 1113 echo ${UNAME_MACHINE}-pc-sco$UNAME_REL 1114 else 1115 echo ${UNAME_MACHINE}-pc-sysv32 1116 fi 1117 exit ;; 1118 pc:*:*:*) 1119 # Left here for compatibility: 1120 # uname -m prints for DJGPP always 'pc', but it prints nothing about 1121 # the processor, so we play safe by assuming i586. 1122 # Note: whatever this is, it MUST be the same as what config.sub 1123 # prints for the "djgpp" host, or else GDB configury will decide that 1124 # this is a cross-build. 1125 echo i586-pc-msdosdjgpp 1126 exit ;; 1127 Intel:Mach:3*:*) 1128 echo i386-pc-mach3 1129 exit ;; 1130 paragon:*:*:*) 1131 echo i860-intel-osf1 1132 exit ;; 1133 i860:*:4.*:*) # i860-SVR4 1134 if grep Stardent /usr/include/sys/uadmin.h >/dev/null 2>&1 ; then 1135 echo i860-stardent-sysv${UNAME_RELEASE} # Stardent Vistra i860-SVR4 1136 else # Add other i860-SVR4 vendors below as they are discovered. 1137 echo i860-unknown-sysv${UNAME_RELEASE} # Unknown i860-SVR4 1138 fi 1139 exit ;; 1140 mini*:CTIX:SYS*5:*) 1141 # "miniframe" 1142 echo m68010-convergent-sysv 1143 exit ;; 1144 mc68k:UNIX:SYSTEM5:3.51m) 1145 echo m68k-convergent-sysv 1146 exit ;; 1147 M680?0:D-NIX:5.3:*) 1148 echo m68k-diab-dnix 1149 exit ;; 1150 M68*:*:R3V[5678]*:*) 1151 test -r /sysV68 && { echo 'm68k-motorola-sysv'; exit; } ;; 1152 3[345]??:*:4.0:3.0 | 3[34]??A:*:4.0:3.0 | 3[34]??,*:*:4.0:3.0 | 3[34]??/*:*:4.0:3.0 | 4400:*:4.0:3.0 | 4850:*:4.0:3.0 | SKA40:*:4.0:3.0 | SDS2:*:4.0:3.0 | SHG2:*:4.0:3.0 | S7501*:*:4.0:3.0) 1153 OS_REL='' 1154 test -r /etc/.relid \ 1155 && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid` 1156 /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ 1157 && { echo i486-ncr-sysv4.3${OS_REL}; exit; } 1158 /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \ 1159 && { echo i586-ncr-sysv4.3${OS_REL}; exit; } ;; 1160 3[34]??:*:4.0:* | 3[34]??,*:*:4.0:*) 1161 /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ 1162 && { echo i486-ncr-sysv4; exit; } ;; 1163 NCR*:*:4.2:* | MPRAS*:*:4.2:*) 1164 OS_REL='.3' 1165 test -r /etc/.relid \ 1166 && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid` 1167 /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ 1168 && { echo i486-ncr-sysv4.3${OS_REL}; exit; } 1169 /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \ 1170 && { echo i586-ncr-sysv4.3${OS_REL}; exit; } 1171 /bin/uname -p 2>/dev/null | /bin/grep pteron >/dev/null \ 1172 && { echo i586-ncr-sysv4.3${OS_REL}; exit; } ;; 1173 m68*:LynxOS:2.*:* | m68*:LynxOS:3.0*:*) 1174 echo m68k-unknown-lynxos${UNAME_RELEASE} 1175 exit ;; 1176 mc68030:UNIX_System_V:4.*:*) 1177 echo m68k-atari-sysv4 1178 exit ;; 1179 TSUNAMI:LynxOS:2.*:*) 1180 echo sparc-unknown-lynxos${UNAME_RELEASE} 1181 exit ;; 1182 rs6000:LynxOS:2.*:*) 1183 echo rs6000-unknown-lynxos${UNAME_RELEASE} 1184 exit ;; 1185 PowerPC:LynxOS:2.*:* | PowerPC:LynxOS:3.[01]*:* | PowerPC:LynxOS:4.[02]*:*) 1186 echo powerpc-unknown-lynxos${UNAME_RELEASE} 1187 exit ;; 1188 SM[BE]S:UNIX_SV:*:*) 1189 echo mips-dde-sysv${UNAME_RELEASE} 1190 exit ;; 1191 RM*:ReliantUNIX-*:*:*) 1192 echo mips-sni-sysv4 1193 exit ;; 1194 RM*:SINIX-*:*:*) 1195 echo mips-sni-sysv4 1196 exit ;; 1197 *:SINIX-*:*:*) 1198 if uname -p 2>/dev/null >/dev/null ; then 1199 UNAME_MACHINE=`(uname -p) 2>/dev/null` 1200 echo ${UNAME_MACHINE}-sni-sysv4 1201 else 1202 echo ns32k-sni-sysv 1203 fi 1204 exit ;; 1205 PENTIUM:*:4.0*:*) # Unisys `ClearPath HMP IX 4000' SVR4/MP effort 1206 # says <Richard.M.Bartel@ccMail.Census.GOV> 1207 echo i586-unisys-sysv4 1208 exit ;; 1209 *:UNIX_System_V:4*:FTX*) 1210 # From Gerald Hewes <hewes@openmarket.com>. 1211 # How about differentiating between stratus architectures? -djm 1212 echo hppa1.1-stratus-sysv4 1213 exit ;; 1214 *:*:*:FTX*) 1215 # From seanf@swdc.stratus.com. 1216 echo i860-stratus-sysv4 1217 exit ;; 1218 i*86:VOS:*:*) 1219 # From Paul.Green@stratus.com. 1220 echo ${UNAME_MACHINE}-stratus-vos 1221 exit ;; 1222 *:VOS:*:*) 1223 # From Paul.Green@stratus.com. 1224 echo hppa1.1-stratus-vos 1225 exit ;; 1226 mc68*:A/UX:*:*) 1227 echo m68k-apple-aux${UNAME_RELEASE} 1228 exit ;; 1229 news*:NEWS-OS:6*:*) 1230 echo mips-sony-newsos6 1231 exit ;; 1232 R[34]000:*System_V*:*:* | R4000:UNIX_SYSV:*:* | R*000:UNIX_SV:*:*) 1233 if [ -d /usr/nec ]; then 1234 echo mips-nec-sysv${UNAME_RELEASE} 1235 else 1236 echo mips-unknown-sysv${UNAME_RELEASE} 1237 fi 1238 exit ;; 1239 BeBox:BeOS:*:*) # BeOS running on hardware made by Be, PPC only. 1240 echo powerpc-be-beos 1241 exit ;; 1242 BeMac:BeOS:*:*) # BeOS running on Mac or Mac clone, PPC only. 1243 echo powerpc-apple-beos 1244 exit ;; 1245 BePC:BeOS:*:*) # BeOS running on Intel PC compatible. 1246 echo i586-pc-beos 1247 exit ;; 1248 BePC:Haiku:*:*) # Haiku running on Intel PC compatible. 1249 echo i586-pc-haiku 1250 exit ;; 1251 x86_64:Haiku:*:*) 1252 echo x86_64-unknown-haiku 1253 exit ;; 1254 SX-4:SUPER-UX:*:*) 1255 echo sx4-nec-superux${UNAME_RELEASE} 1256 exit ;; 1257 SX-5:SUPER-UX:*:*) 1258 echo sx5-nec-superux${UNAME_RELEASE} 1259 exit ;; 1260 SX-6:SUPER-UX:*:*) 1261 echo sx6-nec-superux${UNAME_RELEASE} 1262 exit ;; 1263 SX-7:SUPER-UX:*:*) 1264 echo sx7-nec-superux${UNAME_RELEASE} 1265 exit ;; 1266 SX-8:SUPER-UX:*:*) 1267 echo sx8-nec-superux${UNAME_RELEASE} 1268 exit ;; 1269 SX-8R:SUPER-UX:*:*) 1270 echo sx8r-nec-superux${UNAME_RELEASE} 1271 exit ;; 1272 Power*:Rhapsody:*:*) 1273 echo powerpc-apple-rhapsody${UNAME_RELEASE} 1274 exit ;; 1275 *:Rhapsody:*:*) 1276 echo ${UNAME_MACHINE}-apple-rhapsody${UNAME_RELEASE} 1277 exit ;; 1278 *:Darwin:*:*) 1279 UNAME_PROCESSOR=`uname -p` || UNAME_PROCESSOR=unknown 1280 eval $set_cc_for_build 1281 if test "$UNAME_PROCESSOR" = unknown ; then 1282 UNAME_PROCESSOR=powerpc 1283 fi 1284 if test `echo "$UNAME_RELEASE" | sed -e 's/\..*//'` -le 10 ; then 1285 if [ "$CC_FOR_BUILD" != 'no_compiler_found' ]; then 1286 if (echo '#ifdef __LP64__'; echo IS_64BIT_ARCH; echo '#endif') | \ 1287 (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | \ 1288 grep IS_64BIT_ARCH >/dev/null 1289 then 1290 case $UNAME_PROCESSOR in 1291 i386) UNAME_PROCESSOR=x86_64 ;; 1292 powerpc) UNAME_PROCESSOR=powerpc64 ;; 1293 esac 1294 fi 1295 fi 1296 elif test "$UNAME_PROCESSOR" = i386 ; then 1297 # Avoid executing cc on OS X 10.9, as it ships with a stub 1298 # that puts up a graphical alert prompting to install 1299 # developer tools. Any system running Mac OS X 10.7 or 1300 # later (Darwin 11 and later) is required to have a 64-bit 1301 # processor. This is not true of the ARM version of Darwin 1302 # that Apple uses in portable devices. 1303 UNAME_PROCESSOR=x86_64 1304 fi 1305 echo ${UNAME_PROCESSOR}-apple-darwin${UNAME_RELEASE} 1306 exit ;; 1307 *:procnto*:*:* | *:QNX:[0123456789]*:*) 1308 UNAME_PROCESSOR=`uname -p` 1309 if test "$UNAME_PROCESSOR" = "x86"; then 1310 UNAME_PROCESSOR=i386 1311 UNAME_MACHINE=pc 1312 fi 1313 echo ${UNAME_PROCESSOR}-${UNAME_MACHINE}-nto-qnx${UNAME_RELEASE} 1314 exit ;; 1315 *:QNX:*:4*) 1316 echo i386-pc-qnx 1317 exit ;; 1318 NEO-?:NONSTOP_KERNEL:*:*) 1319 echo neo-tandem-nsk${UNAME_RELEASE} 1320 exit ;; 1321 NSE-*:NONSTOP_KERNEL:*:*) 1322 echo nse-tandem-nsk${UNAME_RELEASE} 1323 exit ;; 1324 NSR-?:NONSTOP_KERNEL:*:*) 1325 echo nsr-tandem-nsk${UNAME_RELEASE} 1326 exit ;; 1327 *:NonStop-UX:*:*) 1328 echo mips-compaq-nonstopux 1329 exit ;; 1330 BS2000:POSIX*:*:*) 1331 echo bs2000-siemens-sysv 1332 exit ;; 1333 DS/*:UNIX_System_V:*:*) 1334 echo ${UNAME_MACHINE}-${UNAME_SYSTEM}-${UNAME_RELEASE} 1335 exit ;; 1336 *:Plan9:*:*) 1337 # "uname -m" is not consistent, so use $cputype instead. 386 1338 # is converted to i386 for consistency with other x86 1339 # operating systems. 1340 if test "$cputype" = "386"; then 1341 UNAME_MACHINE=i386 1342 else 1343 UNAME_MACHINE="$cputype" 1344 fi 1345 echo ${UNAME_MACHINE}-unknown-plan9 1346 exit ;; 1347 *:TOPS-10:*:*) 1348 echo pdp10-unknown-tops10 1349 exit ;; 1350 *:TENEX:*:*) 1351 echo pdp10-unknown-tenex 1352 exit ;; 1353 KS10:TOPS-20:*:* | KL10:TOPS-20:*:* | TYPE4:TOPS-20:*:*) 1354 echo pdp10-dec-tops20 1355 exit ;; 1356 XKL-1:TOPS-20:*:* | TYPE5:TOPS-20:*:*) 1357 echo pdp10-xkl-tops20 1358 exit ;; 1359 *:TOPS-20:*:*) 1360 echo pdp10-unknown-tops20 1361 exit ;; 1362 *:ITS:*:*) 1363 echo pdp10-unknown-its 1364 exit ;; 1365 SEI:*:*:SEIUX) 1366 echo mips-sei-seiux${UNAME_RELEASE} 1367 exit ;; 1368 *:DragonFly:*:*) 1369 echo ${UNAME_MACHINE}-unknown-dragonfly`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` 1370 exit ;; 1371 *:*VMS:*:*) 1372 UNAME_MACHINE=`(uname -p) 2>/dev/null` 1373 case "${UNAME_MACHINE}" in 1374 A*) echo alpha-dec-vms ; exit ;; 1375 I*) echo ia64-dec-vms ; exit ;; 1376 V*) echo vax-dec-vms ; exit ;; 1377 esac ;; 1378 *:XENIX:*:SysV) 1379 echo i386-pc-xenix 1380 exit ;; 1381 i*86:skyos:*:*) 1382 echo ${UNAME_MACHINE}-pc-skyos`echo ${UNAME_RELEASE}` | sed -e 's/ .*$//' 1383 exit ;; 1384 i*86:rdos:*:*) 1385 echo ${UNAME_MACHINE}-pc-rdos 1386 exit ;; 1387 i*86:AROS:*:*) 1388 echo ${UNAME_MACHINE}-pc-aros 1389 exit ;; 1390 x86_64:VMkernel:*:*) 1391 echo ${UNAME_MACHINE}-unknown-esx 1392 exit ;; 1393 esac 1394 1395 cat >&2 <<EOF 1396 $0: unable to guess system type 1397 1398 This script, last modified $timestamp, has failed to recognize 1399 the operating system you are using. It is advised that you 1400 download the most up to date version of the config scripts from 1401 1402 http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess;hb=HEAD 1403 and 1404 http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub;hb=HEAD 1405 1406 If the version you run ($0) is already up to date, please 1407 send the following data and any information you think might be 1408 pertinent to <config-patches@gnu.org> in order to provide the needed 1409 information to handle your system. 1410 1411 config.guess timestamp = $timestamp 1412 1413 uname -m = `(uname -m) 2>/dev/null || echo unknown` 1414 uname -r = `(uname -r) 2>/dev/null || echo unknown` 1415 uname -s = `(uname -s) 2>/dev/null || echo unknown` 1416 uname -v = `(uname -v) 2>/dev/null || echo unknown` 1417 1418 /usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null` 1419 /bin/uname -X = `(/bin/uname -X) 2>/dev/null` 1420 1421 hostinfo = `(hostinfo) 2>/dev/null` 1422 /bin/universe = `(/bin/universe) 2>/dev/null` 1423 /usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null` 1424 /bin/arch = `(/bin/arch) 2>/dev/null` 1425 /usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null` 1426 /usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null` 1427 1428 UNAME_MACHINE = ${UNAME_MACHINE} 1429 UNAME_RELEASE = ${UNAME_RELEASE} 1430 UNAME_SYSTEM = ${UNAME_SYSTEM} 1431 UNAME_VERSION = ${UNAME_VERSION} 1432 EOF 1433 1434 exit 1 1435 1436 # Local variables: 1437 # eval: (add-hook 'write-file-hooks 'time-stamp) 1438 # time-stamp-start: "timestamp='" 1439 # time-stamp-format: "%:y-%02m-%02d" 1440 # time-stamp-end: "'" 1441 # End: 1 /usr/share/automake-1.15/config.guess -
Property mode
changed from
-
automake/config.sub
-
Property mode
changed from
100755to120000
rf9feab8 r90152a4 1 #! /bin/sh 2 # Configuration validation subroutine script. 3 # Copyright 1992-2015 Free Software Foundation, Inc. 4 5 timestamp='2015-08-20' 6 7 # This file is free software; you can redistribute it and/or modify it 8 # under the terms of the GNU General Public License as published by 9 # the Free Software Foundation; either version 3 of the License, or 10 # (at your option) any later version. 11 # 12 # This program is distributed in the hope that it will be useful, but 13 # WITHOUT ANY WARRANTY; without even the implied warranty of 14 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 15 # General Public License for more details. 16 # 17 # You should have received a copy of the GNU General Public License 18 # along with this program; if not, see <http://www.gnu.org/licenses/>. 19 # 20 # As a special exception to the GNU General Public License, if you 21 # distribute this file as part of a program that contains a 22 # configuration script generated by Autoconf, you may include it under 23 # the same distribution terms that you use for the rest of that 24 # program. This Exception is an additional permission under section 7 25 # of the GNU General Public License, version 3 ("GPLv3"). 26 27 28 # Please send patches to <config-patches@gnu.org>. 29 # 30 # Configuration subroutine to validate and canonicalize a configuration type. 31 # Supply the specified configuration type as an argument. 32 # If it is invalid, we print an error message on stderr and exit with code 1. 33 # Otherwise, we print the canonical config type on stdout and succeed. 34 35 # You can get the latest version of this script from: 36 # http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub;hb=HEAD 37 38 # This file is supposed to be the same for all GNU packages 39 # and recognize all the CPU types, system types and aliases 40 # that are meaningful with *any* GNU software. 41 # Each package is responsible for reporting which valid configurations 42 # it does not support. The user should be able to distinguish 43 # a failure to support a valid configuration from a meaningless 44 # configuration. 45 46 # The goal of this file is to map all the various variations of a given 47 # machine specification into a single specification in the form: 48 # CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM 49 # or in some cases, the newer four-part form: 50 # CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM 51 # It is wrong to echo any other type of specification. 52 53 me=`echo "$0" | sed -e 's,.*/,,'` 54 55 usage="\ 56 Usage: $0 [OPTION] CPU-MFR-OPSYS 57 $0 [OPTION] ALIAS 58 59 Canonicalize a configuration name. 60 61 Operation modes: 62 -h, --help print this help, then exit 63 -t, --time-stamp print date of last modification, then exit 64 -v, --version print version number, then exit 65 66 Report bugs and patches to <config-patches@gnu.org>." 67 68 version="\ 69 GNU config.sub ($timestamp) 70 71 Copyright 1992-2015 Free Software Foundation, Inc. 72 73 This is free software; see the source for copying conditions. There is NO 74 warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." 75 76 help=" 77 Try \`$me --help' for more information." 78 79 # Parse command line 80 while test $# -gt 0 ; do 81 case $1 in 82 --time-stamp | --time* | -t ) 83 echo "$timestamp" ; exit ;; 84 --version | -v ) 85 echo "$version" ; exit ;; 86 --help | --h* | -h ) 87 echo "$usage"; exit ;; 88 -- ) # Stop option processing 89 shift; break ;; 90 - ) # Use stdin as input. 91 break ;; 92 -* ) 93 echo "$me: invalid option $1$help" 94 exit 1 ;; 95 96 *local*) 97 # First pass through any local machine types. 98 echo $1 99 exit ;; 100 101 * ) 102 break ;; 103 esac 104 done 105 106 case $# in 107 0) echo "$me: missing argument$help" >&2 108 exit 1;; 109 1) ;; 110 *) echo "$me: too many arguments$help" >&2 111 exit 1;; 112 esac 113 114 # Separate what the user gave into CPU-COMPANY and OS or KERNEL-OS (if any). 115 # Here we must recognize all the valid KERNEL-OS combinations. 116 maybe_os=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'` 117 case $maybe_os in 118 nto-qnx* | linux-gnu* | linux-android* | linux-dietlibc | linux-newlib* | \ 119 linux-musl* | linux-uclibc* | uclinux-uclibc* | uclinux-gnu* | kfreebsd*-gnu* | \ 120 knetbsd*-gnu* | netbsd*-gnu* | netbsd*-eabi* | \ 121 kopensolaris*-gnu* | \ 122 storm-chaos* | os2-emx* | rtmk-nova*) 123 os=-$maybe_os 124 basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'` 125 ;; 126 android-linux) 127 os=-linux-android 128 basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'`-unknown 129 ;; 130 *) 131 basic_machine=`echo $1 | sed 's/-[^-]*$//'` 132 if [ $basic_machine != $1 ] 133 then os=`echo $1 | sed 's/.*-/-/'` 134 else os=; fi 135 ;; 136 esac 137 138 ### Let's recognize common machines as not being operating systems so 139 ### that things like config.sub decstation-3100 work. We also 140 ### recognize some manufacturers as not being operating systems, so we 141 ### can provide default operating systems below. 142 case $os in 143 -sun*os*) 144 # Prevent following clause from handling this invalid input. 145 ;; 146 -dec* | -mips* | -sequent* | -encore* | -pc532* | -sgi* | -sony* | \ 147 -att* | -7300* | -3300* | -delta* | -motorola* | -sun[234]* | \ 148 -unicom* | -ibm* | -next | -hp | -isi* | -apollo | -altos* | \ 149 -convergent* | -ncr* | -news | -32* | -3600* | -3100* | -hitachi* |\ 150 -c[123]* | -convex* | -sun | -crds | -omron* | -dg | -ultra | -tti* | \ 151 -harris | -dolphin | -highlevel | -gould | -cbm | -ns | -masscomp | \ 152 -apple | -axis | -knuth | -cray | -microblaze*) 153 os= 154 basic_machine=$1 155 ;; 156 -bluegene*) 157 os=-cnk 158 ;; 159 -sim | -cisco | -oki | -wec | -winbond) 160 os= 161 basic_machine=$1 162 ;; 163 -scout) 164 ;; 165 -wrs) 166 os=-vxworks 167 basic_machine=$1 168 ;; 169 -chorusos*) 170 os=-chorusos 171 basic_machine=$1 172 ;; 173 -chorusrdb) 174 os=-chorusrdb 175 basic_machine=$1 176 ;; 177 -hiux*) 178 os=-hiuxwe2 179 ;; 180 -sco6) 181 os=-sco5v6 182 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` 183 ;; 184 -sco5) 185 os=-sco3.2v5 186 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` 187 ;; 188 -sco4) 189 os=-sco3.2v4 190 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` 191 ;; 192 -sco3.2.[4-9]*) 193 os=`echo $os | sed -e 's/sco3.2./sco3.2v/'` 194 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` 195 ;; 196 -sco3.2v[4-9]*) 197 # Don't forget version if it is 3.2v4 or newer. 198 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` 199 ;; 200 -sco5v6*) 201 # Don't forget version if it is 3.2v4 or newer. 202 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` 203 ;; 204 -sco*) 205 os=-sco3.2v2 206 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` 207 ;; 208 -udk*) 209 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` 210 ;; 211 -isc) 212 os=-isc2.2 213 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` 214 ;; 215 -clix*) 216 basic_machine=clipper-intergraph 217 ;; 218 -isc*) 219 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` 220 ;; 221 -lynx*178) 222 os=-lynxos178 223 ;; 224 -lynx*5) 225 os=-lynxos5 226 ;; 227 -lynx*) 228 os=-lynxos 229 ;; 230 -ptx*) 231 basic_machine=`echo $1 | sed -e 's/86-.*/86-sequent/'` 232 ;; 233 -windowsnt*) 234 os=`echo $os | sed -e 's/windowsnt/winnt/'` 235 ;; 236 -psos*) 237 os=-psos 238 ;; 239 -mint | -mint[0-9]*) 240 basic_machine=m68k-atari 241 os=-mint 242 ;; 243 esac 244 245 # Decode aliases for certain CPU-COMPANY combinations. 246 case $basic_machine in 247 # Recognize the basic CPU types without company name. 248 # Some are omitted here because they have special meanings below. 249 1750a | 580 \ 250 | a29k \ 251 | aarch64 | aarch64_be \ 252 | alpha | alphaev[4-8] | alphaev56 | alphaev6[78] | alphapca5[67] \ 253 | alpha64 | alpha64ev[4-8] | alpha64ev56 | alpha64ev6[78] | alpha64pca5[67] \ 254 | am33_2.0 \ 255 | arc | arceb \ 256 | arm | arm[bl]e | arme[lb] | armv[2-8] | armv[3-8][lb] | armv7[arm] \ 257 | avr | avr32 \ 258 | ba \ 259 | be32 | be64 \ 260 | bfin \ 261 | c4x | c8051 | clipper \ 262 | d10v | d30v | dlx | dsp16xx \ 263 | e2k | epiphany \ 264 | fido | fr30 | frv | ft32 \ 265 | h8300 | h8500 | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \ 266 | hexagon \ 267 | i370 | i860 | i960 | ia64 \ 268 | ip2k | iq2000 \ 269 | k1om \ 270 | le32 | le64 \ 271 | lm32 \ 272 | m32c | m32r | m32rle | m68000 | m68k | m88k \ 273 | maxq | mb | microblaze | microblazeel | mcore | mep | metag \ 274 | mips | mipsbe | mipseb | mipsel | mipsle \ 275 | mips16 \ 276 | mips64 | mips64el \ 277 | mips64octeon | mips64octeonel \ 278 | mips64orion | mips64orionel \ 279 | mips64r5900 | mips64r5900el \ 280 | mips64vr | mips64vrel \ 281 | mips64vr4100 | mips64vr4100el \ 282 | mips64vr4300 | mips64vr4300el \ 283 | mips64vr5000 | mips64vr5000el \ 284 | mips64vr5900 | mips64vr5900el \ 285 | mipsisa32 | mipsisa32el \ 286 | mipsisa32r2 | mipsisa32r2el \ 287 | mipsisa32r6 | mipsisa32r6el \ 288 | mipsisa64 | mipsisa64el \ 289 | mipsisa64r2 | mipsisa64r2el \ 290 | mipsisa64r6 | mipsisa64r6el \ 291 | mipsisa64sb1 | mipsisa64sb1el \ 292 | mipsisa64sr71k | mipsisa64sr71kel \ 293 | mipsr5900 | mipsr5900el \ 294 | mipstx39 | mipstx39el \ 295 | mn10200 | mn10300 \ 296 | moxie \ 297 | mt \ 298 | msp430 \ 299 | nds32 | nds32le | nds32be \ 300 | nios | nios2 | nios2eb | nios2el \ 301 | ns16k | ns32k \ 302 | open8 | or1k | or1knd | or32 \ 303 | pdp10 | pdp11 | pj | pjl \ 304 | powerpc | powerpc64 | powerpc64le | powerpcle \ 305 | pyramid \ 306 | riscv32 | riscv64 \ 307 | rl78 | rx \ 308 | score \ 309 | sh | sh[1234] | sh[24]a | sh[24]aeb | sh[23]e | sh[234]eb | sheb | shbe | shle | sh[1234]le | sh3ele \ 310 | sh64 | sh64le \ 311 | sparc | sparc64 | sparc64b | sparc64v | sparc86x | sparclet | sparclite \ 312 | sparcv8 | sparcv9 | sparcv9b | sparcv9v \ 313 | spu \ 314 | tahoe | tic4x | tic54x | tic55x | tic6x | tic80 | tron \ 315 | ubicom32 \ 316 | v850 | v850e | v850e1 | v850e2 | v850es | v850e2v3 \ 317 | visium \ 318 | we32k \ 319 | x86 | xc16x | xstormy16 | xtensa \ 320 | z8k | z80) 321 basic_machine=$basic_machine-unknown 322 ;; 323 c54x) 324 basic_machine=tic54x-unknown 325 ;; 326 c55x) 327 basic_machine=tic55x-unknown 328 ;; 329 c6x) 330 basic_machine=tic6x-unknown 331 ;; 332 leon|leon[3-9]) 333 basic_machine=sparc-$basic_machine 334 ;; 335 m6811 | m68hc11 | m6812 | m68hc12 | m68hcs12x | nvptx | picochip) 336 basic_machine=$basic_machine-unknown 337 os=-none 338 ;; 339 m88110 | m680[12346]0 | m683?2 | m68360 | m5200 | v70 | w65 | z8k) 340 ;; 341 ms1) 342 basic_machine=mt-unknown 343 ;; 344 345 strongarm | thumb | xscale) 346 basic_machine=arm-unknown 347 ;; 348 xgate) 349 basic_machine=$basic_machine-unknown 350 os=-none 351 ;; 352 xscaleeb) 353 basic_machine=armeb-unknown 354 ;; 355 356 xscaleel) 357 basic_machine=armel-unknown 358 ;; 359 360 # We use `pc' rather than `unknown' 361 # because (1) that's what they normally are, and 362 # (2) the word "unknown" tends to confuse beginning users. 363 i*86 | x86_64) 364 basic_machine=$basic_machine-pc 365 ;; 366 # Object if more than one company name word. 367 *-*-*) 368 echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2 369 exit 1 370 ;; 371 # Recognize the basic CPU types with company name. 372 580-* \ 373 | a29k-* \ 374 | aarch64-* | aarch64_be-* \ 375 | alpha-* | alphaev[4-8]-* | alphaev56-* | alphaev6[78]-* \ 376 | alpha64-* | alpha64ev[4-8]-* | alpha64ev56-* | alpha64ev6[78]-* \ 377 | alphapca5[67]-* | alpha64pca5[67]-* | arc-* | arceb-* \ 378 | arm-* | armbe-* | armle-* | armeb-* | armv*-* \ 379 | avr-* | avr32-* \ 380 | ba-* \ 381 | be32-* | be64-* \ 382 | bfin-* | bs2000-* \ 383 | c[123]* | c30-* | [cjt]90-* | c4x-* \ 384 | c8051-* | clipper-* | craynv-* | cydra-* \ 385 | d10v-* | d30v-* | dlx-* \ 386 | e2k-* | elxsi-* \ 387 | f30[01]-* | f700-* | fido-* | fr30-* | frv-* | fx80-* \ 388 | h8300-* | h8500-* \ 389 | hppa-* | hppa1.[01]-* | hppa2.0-* | hppa2.0[nw]-* | hppa64-* \ 390 | hexagon-* \ 391 | i*86-* | i860-* | i960-* | ia64-* \ 392 | ip2k-* | iq2000-* \ 393 | k1om-* \ 394 | le32-* | le64-* \ 395 | lm32-* \ 396 | m32c-* | m32r-* | m32rle-* \ 397 | m68000-* | m680[012346]0-* | m68360-* | m683?2-* | m68k-* \ 398 | m88110-* | m88k-* | maxq-* | mcore-* | metag-* \ 399 | microblaze-* | microblazeel-* \ 400 | mips-* | mipsbe-* | mipseb-* | mipsel-* | mipsle-* \ 401 | mips16-* \ 402 | mips64-* | mips64el-* \ 403 | mips64octeon-* | mips64octeonel-* \ 404 | mips64orion-* | mips64orionel-* \ 405 | mips64r5900-* | mips64r5900el-* \ 406 | mips64vr-* | mips64vrel-* \ 407 | mips64vr4100-* | mips64vr4100el-* \ 408 | mips64vr4300-* | mips64vr4300el-* \ 409 | mips64vr5000-* | mips64vr5000el-* \ 410 | mips64vr5900-* | mips64vr5900el-* \ 411 | mipsisa32-* | mipsisa32el-* \ 412 | mipsisa32r2-* | mipsisa32r2el-* \ 413 | mipsisa32r6-* | mipsisa32r6el-* \ 414 | mipsisa64-* | mipsisa64el-* \ 415 | mipsisa64r2-* | mipsisa64r2el-* \ 416 | mipsisa64r6-* | mipsisa64r6el-* \ 417 | mipsisa64sb1-* | mipsisa64sb1el-* \ 418 | mipsisa64sr71k-* | mipsisa64sr71kel-* \ 419 | mipsr5900-* | mipsr5900el-* \ 420 | mipstx39-* | mipstx39el-* \ 421 | mmix-* \ 422 | mt-* \ 423 | msp430-* \ 424 | nds32-* | nds32le-* | nds32be-* \ 425 | nios-* | nios2-* | nios2eb-* | nios2el-* \ 426 | none-* | np1-* | ns16k-* | ns32k-* \ 427 | open8-* \ 428 | or1k*-* \ 429 | orion-* \ 430 | pdp10-* | pdp11-* | pj-* | pjl-* | pn-* | power-* \ 431 | powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* \ 432 | pyramid-* \ 433 | riscv32-* | riscv64-* \ 434 | rl78-* | romp-* | rs6000-* | rx-* \ 435 | sh-* | sh[1234]-* | sh[24]a-* | sh[24]aeb-* | sh[23]e-* | sh[34]eb-* | sheb-* | shbe-* \ 436 | shle-* | sh[1234]le-* | sh3ele-* | sh64-* | sh64le-* \ 437 | sparc-* | sparc64-* | sparc64b-* | sparc64v-* | sparc86x-* | sparclet-* \ 438 | sparclite-* \ 439 | sparcv8-* | sparcv9-* | sparcv9b-* | sparcv9v-* | sv1-* | sx*-* \ 440 | tahoe-* \ 441 | tic30-* | tic4x-* | tic54x-* | tic55x-* | tic6x-* | tic80-* \ 442 | tile*-* \ 443 | tron-* \ 444 | ubicom32-* \ 445 | v850-* | v850e-* | v850e1-* | v850es-* | v850e2-* | v850e2v3-* \ 446 | vax-* \ 447 | visium-* \ 448 | we32k-* \ 449 | x86-* | x86_64-* | xc16x-* | xps100-* \ 450 | xstormy16-* | xtensa*-* \ 451 | ymp-* \ 452 | z8k-* | z80-*) 453 ;; 454 # Recognize the basic CPU types without company name, with glob match. 455 xtensa*) 456 basic_machine=$basic_machine-unknown 457 ;; 458 # Recognize the various machine names and aliases which stand 459 # for a CPU type and a company and sometimes even an OS. 460 386bsd) 461 basic_machine=i386-unknown 462 os=-bsd 463 ;; 464 3b1 | 7300 | 7300-att | att-7300 | pc7300 | safari | unixpc) 465 basic_machine=m68000-att 466 ;; 467 3b*) 468 basic_machine=we32k-att 469 ;; 470 a29khif) 471 basic_machine=a29k-amd 472 os=-udi 473 ;; 474 abacus) 475 basic_machine=abacus-unknown 476 ;; 477 adobe68k) 478 basic_machine=m68010-adobe 479 os=-scout 480 ;; 481 alliant | fx80) 482 basic_machine=fx80-alliant 483 ;; 484 altos | altos3068) 485 basic_machine=m68k-altos 486 ;; 487 am29k) 488 basic_machine=a29k-none 489 os=-bsd 490 ;; 491 amd64) 492 basic_machine=x86_64-pc 493 ;; 494 amd64-*) 495 basic_machine=x86_64-`echo $basic_machine | sed 's/^[^-]*-//'` 496 ;; 497 amdahl) 498 basic_machine=580-amdahl 499 os=-sysv 500 ;; 501 amiga | amiga-*) 502 basic_machine=m68k-unknown 503 ;; 504 amigaos | amigados) 505 basic_machine=m68k-unknown 506 os=-amigaos 507 ;; 508 amigaunix | amix) 509 basic_machine=m68k-unknown 510 os=-sysv4 511 ;; 512 apollo68) 513 basic_machine=m68k-apollo 514 os=-sysv 515 ;; 516 apollo68bsd) 517 basic_machine=m68k-apollo 518 os=-bsd 519 ;; 520 aros) 521 basic_machine=i386-pc 522 os=-aros 523 ;; 524 asmjs) 525 basic_machine=asmjs-unknown 526 ;; 527 aux) 528 basic_machine=m68k-apple 529 os=-aux 530 ;; 531 balance) 532 basic_machine=ns32k-sequent 533 os=-dynix 534 ;; 535 blackfin) 536 basic_machine=bfin-unknown 537 os=-linux 538 ;; 539 blackfin-*) 540 basic_machine=bfin-`echo $basic_machine | sed 's/^[^-]*-//'` 541 os=-linux 542 ;; 543 bluegene*) 544 basic_machine=powerpc-ibm 545 os=-cnk 546 ;; 547 c54x-*) 548 basic_machine=tic54x-`echo $basic_machine | sed 's/^[^-]*-//'` 549 ;; 550 c55x-*) 551 basic_machine=tic55x-`echo $basic_machine | sed 's/^[^-]*-//'` 552 ;; 553 c6x-*) 554 basic_machine=tic6x-`echo $basic_machine | sed 's/^[^-]*-//'` 555 ;; 556 c90) 557 basic_machine=c90-cray 558 os=-unicos 559 ;; 560 cegcc) 561 basic_machine=arm-unknown 562 os=-cegcc 563 ;; 564 convex-c1) 565 basic_machine=c1-convex 566 os=-bsd 567 ;; 568 convex-c2) 569 basic_machine=c2-convex 570 os=-bsd 571 ;; 572 convex-c32) 573 basic_machine=c32-convex 574 os=-bsd 575 ;; 576 convex-c34) 577 basic_machine=c34-convex 578 os=-bsd 579 ;; 580 convex-c38) 581 basic_machine=c38-convex 582 os=-bsd 583 ;; 584 cray | j90) 585 basic_machine=j90-cray 586 os=-unicos 587 ;; 588 craynv) 589 basic_machine=craynv-cray 590 os=-unicosmp 591 ;; 592 cr16 | cr16-*) 593 basic_machine=cr16-unknown 594 os=-elf 595 ;; 596 crds | unos) 597 basic_machine=m68k-crds 598 ;; 599 crisv32 | crisv32-* | etraxfs*) 600 basic_machine=crisv32-axis 601 ;; 602 cris | cris-* | etrax*) 603 basic_machine=cris-axis 604 ;; 605 crx) 606 basic_machine=crx-unknown 607 os=-elf 608 ;; 609 da30 | da30-*) 610 basic_machine=m68k-da30 611 ;; 612 decstation | decstation-3100 | pmax | pmax-* | pmin | dec3100 | decstatn) 613 basic_machine=mips-dec 614 ;; 615 decsystem10* | dec10*) 616 basic_machine=pdp10-dec 617 os=-tops10 618 ;; 619 decsystem20* | dec20*) 620 basic_machine=pdp10-dec 621 os=-tops20 622 ;; 623 delta | 3300 | motorola-3300 | motorola-delta \ 624 | 3300-motorola | delta-motorola) 625 basic_machine=m68k-motorola 626 ;; 627 delta88) 628 basic_machine=m88k-motorola 629 os=-sysv3 630 ;; 631 dicos) 632 basic_machine=i686-pc 633 os=-dicos 634 ;; 635 djgpp) 636 basic_machine=i586-pc 637 os=-msdosdjgpp 638 ;; 639 dpx20 | dpx20-*) 640 basic_machine=rs6000-bull 641 os=-bosx 642 ;; 643 dpx2* | dpx2*-bull) 644 basic_machine=m68k-bull 645 os=-sysv3 646 ;; 647 ebmon29k) 648 basic_machine=a29k-amd 649 os=-ebmon 650 ;; 651 elxsi) 652 basic_machine=elxsi-elxsi 653 os=-bsd 654 ;; 655 encore | umax | mmax) 656 basic_machine=ns32k-encore 657 ;; 658 es1800 | OSE68k | ose68k | ose | OSE) 659 basic_machine=m68k-ericsson 660 os=-ose 661 ;; 662 fx2800) 663 basic_machine=i860-alliant 664 ;; 665 genix) 666 basic_machine=ns32k-ns 667 ;; 668 gmicro) 669 basic_machine=tron-gmicro 670 os=-sysv 671 ;; 672 go32) 673 basic_machine=i386-pc 674 os=-go32 675 ;; 676 h3050r* | hiux*) 677 basic_machine=hppa1.1-hitachi 678 os=-hiuxwe2 679 ;; 680 h8300hms) 681 basic_machine=h8300-hitachi 682 os=-hms 683 ;; 684 h8300xray) 685 basic_machine=h8300-hitachi 686 os=-xray 687 ;; 688 h8500hms) 689 basic_machine=h8500-hitachi 690 os=-hms 691 ;; 692 harris) 693 basic_machine=m88k-harris 694 os=-sysv3 695 ;; 696 hp300-*) 697 basic_machine=m68k-hp 698 ;; 699 hp300bsd) 700 basic_machine=m68k-hp 701 os=-bsd 702 ;; 703 hp300hpux) 704 basic_machine=m68k-hp 705 os=-hpux 706 ;; 707 hp3k9[0-9][0-9] | hp9[0-9][0-9]) 708 basic_machine=hppa1.0-hp 709 ;; 710 hp9k2[0-9][0-9] | hp9k31[0-9]) 711 basic_machine=m68000-hp 712 ;; 713 hp9k3[2-9][0-9]) 714 basic_machine=m68k-hp 715 ;; 716 hp9k6[0-9][0-9] | hp6[0-9][0-9]) 717 basic_machine=hppa1.0-hp 718 ;; 719 hp9k7[0-79][0-9] | hp7[0-79][0-9]) 720 basic_machine=hppa1.1-hp 721 ;; 722 hp9k78[0-9] | hp78[0-9]) 723 # FIXME: really hppa2.0-hp 724 basic_machine=hppa1.1-hp 725 ;; 726 hp9k8[67]1 | hp8[67]1 | hp9k80[24] | hp80[24] | hp9k8[78]9 | hp8[78]9 | hp9k893 | hp893) 727 # FIXME: really hppa2.0-hp 728 basic_machine=hppa1.1-hp 729 ;; 730 hp9k8[0-9][13679] | hp8[0-9][13679]) 731 basic_machine=hppa1.1-hp 732 ;; 733 hp9k8[0-9][0-9] | hp8[0-9][0-9]) 734 basic_machine=hppa1.0-hp 735 ;; 736 hppa-next) 737 os=-nextstep3 738 ;; 739 hppaosf) 740 basic_machine=hppa1.1-hp 741 os=-osf 742 ;; 743 hppro) 744 basic_machine=hppa1.1-hp 745 os=-proelf 746 ;; 747 i370-ibm* | ibm*) 748 basic_machine=i370-ibm 749 ;; 750 i*86v32) 751 basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` 752 os=-sysv32 753 ;; 754 i*86v4*) 755 basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` 756 os=-sysv4 757 ;; 758 i*86v) 759 basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` 760 os=-sysv 761 ;; 762 i*86sol2) 763 basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` 764 os=-solaris2 765 ;; 766 i386mach) 767 basic_machine=i386-mach 768 os=-mach 769 ;; 770 i386-vsta | vsta) 771 basic_machine=i386-unknown 772 os=-vsta 773 ;; 774 iris | iris4d) 775 basic_machine=mips-sgi 776 case $os in 777 -irix*) 778 ;; 779 *) 780 os=-irix4 781 ;; 782 esac 783 ;; 784 isi68 | isi) 785 basic_machine=m68k-isi 786 os=-sysv 787 ;; 788 leon-*|leon[3-9]-*) 789 basic_machine=sparc-`echo $basic_machine | sed 's/-.*//'` 790 ;; 791 m68knommu) 792 basic_machine=m68k-unknown 793 os=-linux 794 ;; 795 m68knommu-*) 796 basic_machine=m68k-`echo $basic_machine | sed 's/^[^-]*-//'` 797 os=-linux 798 ;; 799 m88k-omron*) 800 basic_machine=m88k-omron 801 ;; 802 magnum | m3230) 803 basic_machine=mips-mips 804 os=-sysv 805 ;; 806 merlin) 807 basic_machine=ns32k-utek 808 os=-sysv 809 ;; 810 microblaze*) 811 basic_machine=microblaze-xilinx 812 ;; 813 mingw64) 814 basic_machine=x86_64-pc 815 os=-mingw64 816 ;; 817 mingw32) 818 basic_machine=i686-pc 819 os=-mingw32 820 ;; 821 mingw32ce) 822 basic_machine=arm-unknown 823 os=-mingw32ce 824 ;; 825 miniframe) 826 basic_machine=m68000-convergent 827 ;; 828 *mint | -mint[0-9]* | *MiNT | *MiNT[0-9]*) 829 basic_machine=m68k-atari 830 os=-mint 831 ;; 832 mips3*-*) 833 basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'` 834 ;; 835 mips3*) 836 basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'`-unknown 837 ;; 838 monitor) 839 basic_machine=m68k-rom68k 840 os=-coff 841 ;; 842 morphos) 843 basic_machine=powerpc-unknown 844 os=-morphos 845 ;; 846 moxiebox) 847 basic_machine=moxie-unknown 848 os=-moxiebox 849 ;; 850 msdos) 851 basic_machine=i386-pc 852 os=-msdos 853 ;; 854 ms1-*) 855 basic_machine=`echo $basic_machine | sed -e 's/ms1-/mt-/'` 856 ;; 857 msys) 858 basic_machine=i686-pc 859 os=-msys 860 ;; 861 mvs) 862 basic_machine=i370-ibm 863 os=-mvs 864 ;; 865 nacl) 866 basic_machine=le32-unknown 867 os=-nacl 868 ;; 869 ncr3000) 870 basic_machine=i486-ncr 871 os=-sysv4 872 ;; 873 netbsd386) 874 basic_machine=i386-unknown 875 os=-netbsd 876 ;; 877 netwinder) 878 basic_machine=armv4l-rebel 879 os=-linux 880 ;; 881 news | news700 | news800 | news900) 882 basic_machine=m68k-sony 883 os=-newsos 884 ;; 885 news1000) 886 basic_machine=m68030-sony 887 os=-newsos 888 ;; 889 news-3600 | risc-news) 890 basic_machine=mips-sony 891 os=-newsos 892 ;; 893 necv70) 894 basic_machine=v70-nec 895 os=-sysv 896 ;; 897 next | m*-next ) 898 basic_machine=m68k-next 899 case $os in 900 -nextstep* ) 901 ;; 902 -ns2*) 903 os=-nextstep2 904 ;; 905 *) 906 os=-nextstep3 907 ;; 908 esac 909 ;; 910 nh3000) 911 basic_machine=m68k-harris 912 os=-cxux 913 ;; 914 nh[45]000) 915 basic_machine=m88k-harris 916 os=-cxux 917 ;; 918 nindy960) 919 basic_machine=i960-intel 920 os=-nindy 921 ;; 922 mon960) 923 basic_machine=i960-intel 924 os=-mon960 925 ;; 926 nonstopux) 927 basic_machine=mips-compaq 928 os=-nonstopux 929 ;; 930 np1) 931 basic_machine=np1-gould 932 ;; 933 neo-tandem) 934 basic_machine=neo-tandem 935 ;; 936 nse-tandem) 937 basic_machine=nse-tandem 938 ;; 939 nsr-tandem) 940 basic_machine=nsr-tandem 941 ;; 942 op50n-* | op60c-*) 943 basic_machine=hppa1.1-oki 944 os=-proelf 945 ;; 946 openrisc | openrisc-*) 947 basic_machine=or32-unknown 948 ;; 949 os400) 950 basic_machine=powerpc-ibm 951 os=-os400 952 ;; 953 OSE68000 | ose68000) 954 basic_machine=m68000-ericsson 955 os=-ose 956 ;; 957 os68k) 958 basic_machine=m68k-none 959 os=-os68k 960 ;; 961 pa-hitachi) 962 basic_machine=hppa1.1-hitachi 963 os=-hiuxwe2 964 ;; 965 paragon) 966 basic_machine=i860-intel 967 os=-osf 968 ;; 969 parisc) 970 basic_machine=hppa-unknown 971 os=-linux 972 ;; 973 parisc-*) 974 basic_machine=hppa-`echo $basic_machine | sed 's/^[^-]*-//'` 975 os=-linux 976 ;; 977 pbd) 978 basic_machine=sparc-tti 979 ;; 980 pbb) 981 basic_machine=m68k-tti 982 ;; 983 pc532 | pc532-*) 984 basic_machine=ns32k-pc532 985 ;; 986 pc98) 987 basic_machine=i386-pc 988 ;; 989 pc98-*) 990 basic_machine=i386-`echo $basic_machine | sed 's/^[^-]*-//'` 991 ;; 992 pentium | p5 | k5 | k6 | nexgen | viac3) 993 basic_machine=i586-pc 994 ;; 995 pentiumpro | p6 | 6x86 | athlon | athlon_*) 996 basic_machine=i686-pc 997 ;; 998 pentiumii | pentium2 | pentiumiii | pentium3) 999 basic_machine=i686-pc 1000 ;; 1001 pentium4) 1002 basic_machine=i786-pc 1003 ;; 1004 pentium-* | p5-* | k5-* | k6-* | nexgen-* | viac3-*) 1005 basic_machine=i586-`echo $basic_machine | sed 's/^[^-]*-//'` 1006 ;; 1007 pentiumpro-* | p6-* | 6x86-* | athlon-*) 1008 basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'` 1009 ;; 1010 pentiumii-* | pentium2-* | pentiumiii-* | pentium3-*) 1011 basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'` 1012 ;; 1013 pentium4-*) 1014 basic_machine=i786-`echo $basic_machine | sed 's/^[^-]*-//'` 1015 ;; 1016 pn) 1017 basic_machine=pn-gould 1018 ;; 1019 power) basic_machine=power-ibm 1020 ;; 1021 ppc | ppcbe) basic_machine=powerpc-unknown 1022 ;; 1023 ppc-* | ppcbe-*) 1024 basic_machine=powerpc-`echo $basic_machine | sed 's/^[^-]*-//'` 1025 ;; 1026 ppcle | powerpclittle | ppc-le | powerpc-little) 1027 basic_machine=powerpcle-unknown 1028 ;; 1029 ppcle-* | powerpclittle-*) 1030 basic_machine=powerpcle-`echo $basic_machine | sed 's/^[^-]*-//'` 1031 ;; 1032 ppc64) basic_machine=powerpc64-unknown 1033 ;; 1034 ppc64-*) basic_machine=powerpc64-`echo $basic_machine | sed 's/^[^-]*-//'` 1035 ;; 1036 ppc64le | powerpc64little | ppc64-le | powerpc64-little) 1037 basic_machine=powerpc64le-unknown 1038 ;; 1039 ppc64le-* | powerpc64little-*) 1040 basic_machine=powerpc64le-`echo $basic_machine | sed 's/^[^-]*-//'` 1041 ;; 1042 ps2) 1043 basic_machine=i386-ibm 1044 ;; 1045 pw32) 1046 basic_machine=i586-unknown 1047 os=-pw32 1048 ;; 1049 rdos | rdos64) 1050 basic_machine=x86_64-pc 1051 os=-rdos 1052 ;; 1053 rdos32) 1054 basic_machine=i386-pc 1055 os=-rdos 1056 ;; 1057 rom68k) 1058 basic_machine=m68k-rom68k 1059 os=-coff 1060 ;; 1061 rm[46]00) 1062 basic_machine=mips-siemens 1063 ;; 1064 rtpc | rtpc-*) 1065 basic_machine=romp-ibm 1066 ;; 1067 s390 | s390-*) 1068 basic_machine=s390-ibm 1069 ;; 1070 s390x | s390x-*) 1071 basic_machine=s390x-ibm 1072 ;; 1073 sa29200) 1074 basic_machine=a29k-amd 1075 os=-udi 1076 ;; 1077 sb1) 1078 basic_machine=mipsisa64sb1-unknown 1079 ;; 1080 sb1el) 1081 basic_machine=mipsisa64sb1el-unknown 1082 ;; 1083 sde) 1084 basic_machine=mipsisa32-sde 1085 os=-elf 1086 ;; 1087 sei) 1088 basic_machine=mips-sei 1089 os=-seiux 1090 ;; 1091 sequent) 1092 basic_machine=i386-sequent 1093 ;; 1094 sh) 1095 basic_machine=sh-hitachi 1096 os=-hms 1097 ;; 1098 sh5el) 1099 basic_machine=sh5le-unknown 1100 ;; 1101 sh64) 1102 basic_machine=sh64-unknown 1103 ;; 1104 sparclite-wrs | simso-wrs) 1105 basic_machine=sparclite-wrs 1106 os=-vxworks 1107 ;; 1108 sps7) 1109 basic_machine=m68k-bull 1110 os=-sysv2 1111 ;; 1112 spur) 1113 basic_machine=spur-unknown 1114 ;; 1115 st2000) 1116 basic_machine=m68k-tandem 1117 ;; 1118 stratus) 1119 basic_machine=i860-stratus 1120 os=-sysv4 1121 ;; 1122 strongarm-* | thumb-*) 1123 basic_machine=arm-`echo $basic_machine | sed 's/^[^-]*-//'` 1124 ;; 1125 sun2) 1126 basic_machine=m68000-sun 1127 ;; 1128 sun2os3) 1129 basic_machine=m68000-sun 1130 os=-sunos3 1131 ;; 1132 sun2os4) 1133 basic_machine=m68000-sun 1134 os=-sunos4 1135 ;; 1136 sun3os3) 1137 basic_machine=m68k-sun 1138 os=-sunos3 1139 ;; 1140 sun3os4) 1141 basic_machine=m68k-sun 1142 os=-sunos4 1143 ;; 1144 sun4os3) 1145 basic_machine=sparc-sun 1146 os=-sunos3 1147 ;; 1148 sun4os4) 1149 basic_machine=sparc-sun 1150 os=-sunos4 1151 ;; 1152 sun4sol2) 1153 basic_machine=sparc-sun 1154 os=-solaris2 1155 ;; 1156 sun3 | sun3-*) 1157 basic_machine=m68k-sun 1158 ;; 1159 sun4) 1160 basic_machine=sparc-sun 1161 ;; 1162 sun386 | sun386i | roadrunner) 1163 basic_machine=i386-sun 1164 ;; 1165 sv1) 1166 basic_machine=sv1-cray 1167 os=-unicos 1168 ;; 1169 symmetry) 1170 basic_machine=i386-sequent 1171 os=-dynix 1172 ;; 1173 t3e) 1174 basic_machine=alphaev5-cray 1175 os=-unicos 1176 ;; 1177 t90) 1178 basic_machine=t90-cray 1179 os=-unicos 1180 ;; 1181 tile*) 1182 basic_machine=$basic_machine-unknown 1183 os=-linux-gnu 1184 ;; 1185 tx39) 1186 basic_machine=mipstx39-unknown 1187 ;; 1188 tx39el) 1189 basic_machine=mipstx39el-unknown 1190 ;; 1191 toad1) 1192 basic_machine=pdp10-xkl 1193 os=-tops20 1194 ;; 1195 tower | tower-32) 1196 basic_machine=m68k-ncr 1197 ;; 1198 tpf) 1199 basic_machine=s390x-ibm 1200 os=-tpf 1201 ;; 1202 udi29k) 1203 basic_machine=a29k-amd 1204 os=-udi 1205 ;; 1206 ultra3) 1207 basic_machine=a29k-nyu 1208 os=-sym1 1209 ;; 1210 v810 | necv810) 1211 basic_machine=v810-nec 1212 os=-none 1213 ;; 1214 vaxv) 1215 basic_machine=vax-dec 1216 os=-sysv 1217 ;; 1218 vms) 1219 basic_machine=vax-dec 1220 os=-vms 1221 ;; 1222 vpp*|vx|vx-*) 1223 basic_machine=f301-fujitsu 1224 ;; 1225 vxworks960) 1226 basic_machine=i960-wrs 1227 os=-vxworks 1228 ;; 1229 vxworks68) 1230 basic_machine=m68k-wrs 1231 os=-vxworks 1232 ;; 1233 vxworks29k) 1234 basic_machine=a29k-wrs 1235 os=-vxworks 1236 ;; 1237 w65*) 1238 basic_machine=w65-wdc 1239 os=-none 1240 ;; 1241 w89k-*) 1242 basic_machine=hppa1.1-winbond 1243 os=-proelf 1244 ;; 1245 xbox) 1246 basic_machine=i686-pc 1247 os=-mingw32 1248 ;; 1249 xps | xps100) 1250 basic_machine=xps100-honeywell 1251 ;; 1252 xscale-* | xscalee[bl]-*) 1253 basic_machine=`echo $basic_machine | sed 's/^xscale/arm/'` 1254 ;; 1255 ymp) 1256 basic_machine=ymp-cray 1257 os=-unicos 1258 ;; 1259 z8k-*-coff) 1260 basic_machine=z8k-unknown 1261 os=-sim 1262 ;; 1263 z80-*-coff) 1264 basic_machine=z80-unknown 1265 os=-sim 1266 ;; 1267 none) 1268 basic_machine=none-none 1269 os=-none 1270 ;; 1271 1272 # Here we handle the default manufacturer of certain CPU types. It is in 1273 # some cases the only manufacturer, in others, it is the most popular. 1274 w89k) 1275 basic_machine=hppa1.1-winbond 1276 ;; 1277 op50n) 1278 basic_machine=hppa1.1-oki 1279 ;; 1280 op60c) 1281 basic_machine=hppa1.1-oki 1282 ;; 1283 romp) 1284 basic_machine=romp-ibm 1285 ;; 1286 mmix) 1287 basic_machine=mmix-knuth 1288 ;; 1289 rs6000) 1290 basic_machine=rs6000-ibm 1291 ;; 1292 vax) 1293 basic_machine=vax-dec 1294 ;; 1295 pdp10) 1296 # there are many clones, so DEC is not a safe bet 1297 basic_machine=pdp10-unknown 1298 ;; 1299 pdp11) 1300 basic_machine=pdp11-dec 1301 ;; 1302 we32k) 1303 basic_machine=we32k-att 1304 ;; 1305 sh[1234] | sh[24]a | sh[24]aeb | sh[34]eb | sh[1234]le | sh[23]ele) 1306 basic_machine=sh-unknown 1307 ;; 1308 sparc | sparcv8 | sparcv9 | sparcv9b | sparcv9v) 1309 basic_machine=sparc-sun 1310 ;; 1311 cydra) 1312 basic_machine=cydra-cydrome 1313 ;; 1314 orion) 1315 basic_machine=orion-highlevel 1316 ;; 1317 orion105) 1318 basic_machine=clipper-highlevel 1319 ;; 1320 mac | mpw | mac-mpw) 1321 basic_machine=m68k-apple 1322 ;; 1323 pmac | pmac-mpw) 1324 basic_machine=powerpc-apple 1325 ;; 1326 *-unknown) 1327 # Make sure to match an already-canonicalized machine name. 1328 ;; 1329 *) 1330 echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2 1331 exit 1 1332 ;; 1333 esac 1334 1335 # Here we canonicalize certain aliases for manufacturers. 1336 case $basic_machine in 1337 *-digital*) 1338 basic_machine=`echo $basic_machine | sed 's/digital.*/dec/'` 1339 ;; 1340 *-commodore*) 1341 basic_machine=`echo $basic_machine | sed 's/commodore.*/cbm/'` 1342 ;; 1343 *) 1344 ;; 1345 esac 1346 1347 # Decode manufacturer-specific aliases for certain operating systems. 1348 1349 if [ x"$os" != x"" ] 1350 then 1351 case $os in 1352 # First match some system type aliases 1353 # that might get confused with valid system types. 1354 # -solaris* is a basic system type, with this one exception. 1355 -auroraux) 1356 os=-auroraux 1357 ;; 1358 -solaris1 | -solaris1.*) 1359 os=`echo $os | sed -e 's|solaris1|sunos4|'` 1360 ;; 1361 -solaris) 1362 os=-solaris2 1363 ;; 1364 -svr4*) 1365 os=-sysv4 1366 ;; 1367 -unixware*) 1368 os=-sysv4.2uw 1369 ;; 1370 -gnu/linux*) 1371 os=`echo $os | sed -e 's|gnu/linux|linux-gnu|'` 1372 ;; 1373 # First accept the basic system types. 1374 # The portable systems comes first. 1375 # Each alternative MUST END IN A *, to match a version number. 1376 # -sysv* is not here because it comes later, after sysvr4. 1377 -gnu* | -bsd* | -mach* | -minix* | -genix* | -ultrix* | -irix* \ 1378 | -*vms* | -sco* | -esix* | -isc* | -aix* | -cnk* | -sunos | -sunos[34]*\ 1379 | -hpux* | -unos* | -osf* | -luna* | -dgux* | -auroraux* | -solaris* \ 1380 | -sym* | -kopensolaris* | -plan9* \ 1381 | -amigaos* | -amigados* | -msdos* | -newsos* | -unicos* | -aof* \ 1382 | -aos* | -aros* | -cloudabi* | -sortix* \ 1383 | -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \ 1384 | -clix* | -riscos* | -uniplus* | -iris* | -rtu* | -xenix* \ 1385 | -hiux* | -386bsd* | -knetbsd* | -mirbsd* | -netbsd* \ 1386 | -bitrig* | -openbsd* | -solidbsd* \ 1387 | -ekkobsd* | -kfreebsd* | -freebsd* | -riscix* | -lynxos* \ 1388 | -bosx* | -nextstep* | -cxux* | -aout* | -elf* | -oabi* \ 1389 | -ptx* | -coff* | -ecoff* | -winnt* | -domain* | -vsta* \ 1390 | -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \ 1391 | -chorusos* | -chorusrdb* | -cegcc* \ 1392 | -cygwin* | -msys* | -pe* | -psos* | -moss* | -proelf* | -rtems* \ 1393 | -mingw32* | -mingw64* | -linux-gnu* | -linux-android* \ 1394 | -linux-newlib* | -linux-musl* | -linux-uclibc* \ 1395 | -uxpv* | -beos* | -mpeix* | -udk* | -moxiebox* \ 1396 | -interix* | -uwin* | -mks* | -rhapsody* | -darwin* | -opened* \ 1397 | -openstep* | -oskit* | -conix* | -pw32* | -nonstopux* \ 1398 | -storm-chaos* | -tops10* | -tenex* | -tops20* | -its* \ 1399 | -os2* | -vos* | -palmos* | -uclinux* | -nucleus* \ 1400 | -morphos* | -superux* | -rtmk* | -rtmk-nova* | -windiss* \ 1401 | -powermax* | -dnix* | -nx6 | -nx7 | -sei* | -dragonfly* \ 1402 | -skyos* | -haiku* | -rdos* | -toppers* | -drops* | -es* | -tirtos*) 1403 # Remember, each alternative MUST END IN *, to match a version number. 1404 ;; 1405 -qnx*) 1406 case $basic_machine in 1407 x86-* | i*86-*) 1408 ;; 1409 *) 1410 os=-nto$os 1411 ;; 1412 esac 1413 ;; 1414 -nto-qnx*) 1415 ;; 1416 -nto*) 1417 os=`echo $os | sed -e 's|nto|nto-qnx|'` 1418 ;; 1419 -sim | -es1800* | -hms* | -xray | -os68k* | -none* | -v88r* \ 1420 | -windows* | -osx | -abug | -netware* | -os9* | -beos* | -haiku* \ 1421 | -macos* | -mpw* | -magic* | -mmixware* | -mon960* | -lnews*) 1422 ;; 1423 -mac*) 1424 os=`echo $os | sed -e 's|mac|macos|'` 1425 ;; 1426 -linux-dietlibc) 1427 os=-linux-dietlibc 1428 ;; 1429 -linux*) 1430 os=`echo $os | sed -e 's|linux|linux-gnu|'` 1431 ;; 1432 -sunos5*) 1433 os=`echo $os | sed -e 's|sunos5|solaris2|'` 1434 ;; 1435 -sunos6*) 1436 os=`echo $os | sed -e 's|sunos6|solaris3|'` 1437 ;; 1438 -opened*) 1439 os=-openedition 1440 ;; 1441 -os400*) 1442 os=-os400 1443 ;; 1444 -wince*) 1445 os=-wince 1446 ;; 1447 -osfrose*) 1448 os=-osfrose 1449 ;; 1450 -osf*) 1451 os=-osf 1452 ;; 1453 -utek*) 1454 os=-bsd 1455 ;; 1456 -dynix*) 1457 os=-bsd 1458 ;; 1459 -acis*) 1460 os=-aos 1461 ;; 1462 -atheos*) 1463 os=-atheos 1464 ;; 1465 -syllable*) 1466 os=-syllable 1467 ;; 1468 -386bsd) 1469 os=-bsd 1470 ;; 1471 -ctix* | -uts*) 1472 os=-sysv 1473 ;; 1474 -nova*) 1475 os=-rtmk-nova 1476 ;; 1477 -ns2 ) 1478 os=-nextstep2 1479 ;; 1480 -nsk*) 1481 os=-nsk 1482 ;; 1483 # Preserve the version number of sinix5. 1484 -sinix5.*) 1485 os=`echo $os | sed -e 's|sinix|sysv|'` 1486 ;; 1487 -sinix*) 1488 os=-sysv4 1489 ;; 1490 -tpf*) 1491 os=-tpf 1492 ;; 1493 -triton*) 1494 os=-sysv3 1495 ;; 1496 -oss*) 1497 os=-sysv3 1498 ;; 1499 -svr4) 1500 os=-sysv4 1501 ;; 1502 -svr3) 1503 os=-sysv3 1504 ;; 1505 -sysvr4) 1506 os=-sysv4 1507 ;; 1508 # This must come after -sysvr4. 1509 -sysv*) 1510 ;; 1511 -ose*) 1512 os=-ose 1513 ;; 1514 -es1800*) 1515 os=-ose 1516 ;; 1517 -xenix) 1518 os=-xenix 1519 ;; 1520 -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*) 1521 os=-mint 1522 ;; 1523 -aros*) 1524 os=-aros 1525 ;; 1526 -zvmoe) 1527 os=-zvmoe 1528 ;; 1529 -dicos*) 1530 os=-dicos 1531 ;; 1532 -nacl*) 1533 ;; 1534 -none) 1535 ;; 1536 *) 1537 # Get rid of the `-' at the beginning of $os. 1538 os=`echo $os | sed 's/[^-]*-//'` 1539 echo Invalid configuration \`$1\': system \`$os\' not recognized 1>&2 1540 exit 1 1541 ;; 1542 esac 1543 else 1544 1545 # Here we handle the default operating systems that come with various machines. 1546 # The value should be what the vendor currently ships out the door with their 1547 # machine or put another way, the most popular os provided with the machine. 1548 1549 # Note that if you're going to try to match "-MANUFACTURER" here (say, 1550 # "-sun"), then you have to tell the case statement up towards the top 1551 # that MANUFACTURER isn't an operating system. Otherwise, code above 1552 # will signal an error saying that MANUFACTURER isn't an operating 1553 # system, and we'll never get to this point. 1554 1555 case $basic_machine in 1556 score-*) 1557 os=-elf 1558 ;; 1559 spu-*) 1560 os=-elf 1561 ;; 1562 *-acorn) 1563 os=-riscix1.2 1564 ;; 1565 arm*-rebel) 1566 os=-linux 1567 ;; 1568 arm*-semi) 1569 os=-aout 1570 ;; 1571 c4x-* | tic4x-*) 1572 os=-coff 1573 ;; 1574 c8051-*) 1575 os=-elf 1576 ;; 1577 hexagon-*) 1578 os=-elf 1579 ;; 1580 tic54x-*) 1581 os=-coff 1582 ;; 1583 tic55x-*) 1584 os=-coff 1585 ;; 1586 tic6x-*) 1587 os=-coff 1588 ;; 1589 # This must come before the *-dec entry. 1590 pdp10-*) 1591 os=-tops20 1592 ;; 1593 pdp11-*) 1594 os=-none 1595 ;; 1596 *-dec | vax-*) 1597 os=-ultrix4.2 1598 ;; 1599 m68*-apollo) 1600 os=-domain 1601 ;; 1602 i386-sun) 1603 os=-sunos4.0.2 1604 ;; 1605 m68000-sun) 1606 os=-sunos3 1607 ;; 1608 m68*-cisco) 1609 os=-aout 1610 ;; 1611 mep-*) 1612 os=-elf 1613 ;; 1614 mips*-cisco) 1615 os=-elf 1616 ;; 1617 mips*-*) 1618 os=-elf 1619 ;; 1620 or32-*) 1621 os=-coff 1622 ;; 1623 *-tti) # must be before sparc entry or we get the wrong os. 1624 os=-sysv3 1625 ;; 1626 sparc-* | *-sun) 1627 os=-sunos4.1.1 1628 ;; 1629 *-be) 1630 os=-beos 1631 ;; 1632 *-haiku) 1633 os=-haiku 1634 ;; 1635 *-ibm) 1636 os=-aix 1637 ;; 1638 *-knuth) 1639 os=-mmixware 1640 ;; 1641 *-wec) 1642 os=-proelf 1643 ;; 1644 *-winbond) 1645 os=-proelf 1646 ;; 1647 *-oki) 1648 os=-proelf 1649 ;; 1650 *-hp) 1651 os=-hpux 1652 ;; 1653 *-hitachi) 1654 os=-hiux 1655 ;; 1656 i860-* | *-att | *-ncr | *-altos | *-motorola | *-convergent) 1657 os=-sysv 1658 ;; 1659 *-cbm) 1660 os=-amigaos 1661 ;; 1662 *-dg) 1663 os=-dgux 1664 ;; 1665 *-dolphin) 1666 os=-sysv3 1667 ;; 1668 m68k-ccur) 1669 os=-rtu 1670 ;; 1671 m88k-omron*) 1672 os=-luna 1673 ;; 1674 *-next ) 1675 os=-nextstep 1676 ;; 1677 *-sequent) 1678 os=-ptx 1679 ;; 1680 *-crds) 1681 os=-unos 1682 ;; 1683 *-ns) 1684 os=-genix 1685 ;; 1686 i370-*) 1687 os=-mvs 1688 ;; 1689 *-next) 1690 os=-nextstep3 1691 ;; 1692 *-gould) 1693 os=-sysv 1694 ;; 1695 *-highlevel) 1696 os=-bsd 1697 ;; 1698 *-encore) 1699 os=-bsd 1700 ;; 1701 *-sgi) 1702 os=-irix 1703 ;; 1704 *-siemens) 1705 os=-sysv4 1706 ;; 1707 *-masscomp) 1708 os=-rtu 1709 ;; 1710 f30[01]-fujitsu | f700-fujitsu) 1711 os=-uxpv 1712 ;; 1713 *-rom68k) 1714 os=-coff 1715 ;; 1716 *-*bug) 1717 os=-coff 1718 ;; 1719 *-apple) 1720 os=-macos 1721 ;; 1722 *-atari*) 1723 os=-mint 1724 ;; 1725 *) 1726 os=-none 1727 ;; 1728 esac 1729 fi 1730 1731 # Here we handle the case where we know the os, and the CPU type, but not the 1732 # manufacturer. We pick the logical manufacturer. 1733 vendor=unknown 1734 case $basic_machine in 1735 *-unknown) 1736 case $os in 1737 -riscix*) 1738 vendor=acorn 1739 ;; 1740 -sunos*) 1741 vendor=sun 1742 ;; 1743 -cnk*|-aix*) 1744 vendor=ibm 1745 ;; 1746 -beos*) 1747 vendor=be 1748 ;; 1749 -hpux*) 1750 vendor=hp 1751 ;; 1752 -mpeix*) 1753 vendor=hp 1754 ;; 1755 -hiux*) 1756 vendor=hitachi 1757 ;; 1758 -unos*) 1759 vendor=crds 1760 ;; 1761 -dgux*) 1762 vendor=dg 1763 ;; 1764 -luna*) 1765 vendor=omron 1766 ;; 1767 -genix*) 1768 vendor=ns 1769 ;; 1770 -mvs* | -opened*) 1771 vendor=ibm 1772 ;; 1773 -os400*) 1774 vendor=ibm 1775 ;; 1776 -ptx*) 1777 vendor=sequent 1778 ;; 1779 -tpf*) 1780 vendor=ibm 1781 ;; 1782 -vxsim* | -vxworks* | -windiss*) 1783 vendor=wrs 1784 ;; 1785 -aux*) 1786 vendor=apple 1787 ;; 1788 -hms*) 1789 vendor=hitachi 1790 ;; 1791 -mpw* | -macos*) 1792 vendor=apple 1793 ;; 1794 -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*) 1795 vendor=atari 1796 ;; 1797 -vos*) 1798 vendor=stratus 1799 ;; 1800 esac 1801 basic_machine=`echo $basic_machine | sed "s/unknown/$vendor/"` 1802 ;; 1803 esac 1804 1805 echo $basic_machine$os 1806 exit 1807 1808 # Local variables: 1809 # eval: (add-hook 'write-file-hooks 'time-stamp) 1810 # time-stamp-start: "timestamp='" 1811 # time-stamp-format: "%:y-%02m-%02d" 1812 # time-stamp-end: "'" 1813 # End: 1 /usr/share/automake-1.15/config.sub -
Property mode
changed from
-
automake/depcomp
-
Property mode
changed from
100755to120000
rf9feab8 r90152a4 1 #! /bin/sh 2 # depcomp - compile a program generating dependencies as side-effects 3 4 scriptversion=2013-05-30.07; # UTC 5 6 # Copyright (C) 1999-2014 Free Software Foundation, Inc. 7 8 # This program is free software; you can redistribute it and/or modify 9 # it under the terms of the GNU General Public License as published by 10 # the Free Software Foundation; either version 2, or (at your option) 11 # any later version. 12 13 # This program is distributed in the hope that it will be useful, 14 # but WITHOUT ANY WARRANTY; without even the implied warranty of 15 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 # GNU General Public License for more details. 17 18 # You should have received a copy of the GNU General Public License 19 # along with this program. If not, see <http://www.gnu.org/licenses/>. 20 21 # As a special exception to the GNU General Public License, if you 22 # distribute this file as part of a program that contains a 23 # configuration script generated by Autoconf, you may include it under 24 # the same distribution terms that you use for the rest of that program. 25 26 # Originally written by Alexandre Oliva <oliva@dcc.unicamp.br>. 27 28 case $1 in 29 '') 30 echo "$0: No command. Try '$0 --help' for more information." 1>&2 31 exit 1; 32 ;; 33 -h | --h*) 34 cat <<\EOF 35 Usage: depcomp [--help] [--version] PROGRAM [ARGS] 36 37 Run PROGRAMS ARGS to compile a file, generating dependencies 38 as side-effects. 39 40 Environment variables: 41 depmode Dependency tracking mode. 42 source Source file read by 'PROGRAMS ARGS'. 43 object Object file output by 'PROGRAMS ARGS'. 44 DEPDIR directory where to store dependencies. 45 depfile Dependency file to output. 46 tmpdepfile Temporary file to use when outputting dependencies. 47 libtool Whether libtool is used (yes/no). 48 49 Report bugs to <bug-automake@gnu.org>. 50 EOF 51 exit $? 52 ;; 53 -v | --v*) 54 echo "depcomp $scriptversion" 55 exit $? 56 ;; 57 esac 58 59 # Get the directory component of the given path, and save it in the 60 # global variables '$dir'. Note that this directory component will 61 # be either empty or ending with a '/' character. This is deliberate. 62 set_dir_from () 63 { 64 case $1 in 65 */*) dir=`echo "$1" | sed -e 's|/[^/]*$|/|'`;; 66 *) dir=;; 67 esac 68 } 69 70 # Get the suffix-stripped basename of the given path, and save it the 71 # global variable '$base'. 72 set_base_from () 73 { 74 base=`echo "$1" | sed -e 's|^.*/||' -e 's/\.[^.]*$//'` 75 } 76 77 # If no dependency file was actually created by the compiler invocation, 78 # we still have to create a dummy depfile, to avoid errors with the 79 # Makefile "include basename.Plo" scheme. 80 make_dummy_depfile () 81 { 82 echo "#dummy" > "$depfile" 83 } 84 85 # Factor out some common post-processing of the generated depfile. 86 # Requires the auxiliary global variable '$tmpdepfile' to be set. 87 aix_post_process_depfile () 88 { 89 # If the compiler actually managed to produce a dependency file, 90 # post-process it. 91 if test -f "$tmpdepfile"; then 92 # Each line is of the form 'foo.o: dependency.h'. 93 # Do two passes, one to just change these to 94 # $object: dependency.h 95 # and one to simply output 96 # dependency.h: 97 # which is needed to avoid the deleted-header problem. 98 { sed -e "s,^.*\.[$lower]*:,$object:," < "$tmpdepfile" 99 sed -e "s,^.*\.[$lower]*:[$tab ]*,," -e 's,$,:,' < "$tmpdepfile" 100 } > "$depfile" 101 rm -f "$tmpdepfile" 102 else 103 make_dummy_depfile 104 fi 105 } 106 107 # A tabulation character. 108 tab=' ' 109 # A newline character. 110 nl=' 111 ' 112 # Character ranges might be problematic outside the C locale. 113 # These definitions help. 114 upper=ABCDEFGHIJKLMNOPQRSTUVWXYZ 115 lower=abcdefghijklmnopqrstuvwxyz 116 digits=0123456789 117 alpha=${upper}${lower} 118 119 if test -z "$depmode" || test -z "$source" || test -z "$object"; then 120 echo "depcomp: Variables source, object and depmode must be set" 1>&2 121 exit 1 122 fi 123 124 # Dependencies for sub/bar.o or sub/bar.obj go into sub/.deps/bar.Po. 125 depfile=${depfile-`echo "$object" | 126 sed 's|[^\\/]*$|'${DEPDIR-.deps}'/&|;s|\.\([^.]*\)$|.P\1|;s|Pobj$|Po|'`} 127 tmpdepfile=${tmpdepfile-`echo "$depfile" | sed 's/\.\([^.]*\)$/.T\1/'`} 128 129 rm -f "$tmpdepfile" 130 131 # Avoid interferences from the environment. 132 gccflag= dashmflag= 133 134 # Some modes work just like other modes, but use different flags. We 135 # parameterize here, but still list the modes in the big case below, 136 # to make depend.m4 easier to write. Note that we *cannot* use a case 137 # here, because this file can only contain one case statement. 138 if test "$depmode" = hp; then 139 # HP compiler uses -M and no extra arg. 140 gccflag=-M 141 depmode=gcc 142 fi 143 144 if test "$depmode" = dashXmstdout; then 145 # This is just like dashmstdout with a different argument. 146 dashmflag=-xM 147 depmode=dashmstdout 148 fi 149 150 cygpath_u="cygpath -u -f -" 151 if test "$depmode" = msvcmsys; then 152 # This is just like msvisualcpp but w/o cygpath translation. 153 # Just convert the backslash-escaped backslashes to single forward 154 # slashes to satisfy depend.m4 155 cygpath_u='sed s,\\\\,/,g' 156 depmode=msvisualcpp 157 fi 158 159 if test "$depmode" = msvc7msys; then 160 # This is just like msvc7 but w/o cygpath translation. 161 # Just convert the backslash-escaped backslashes to single forward 162 # slashes to satisfy depend.m4 163 cygpath_u='sed s,\\\\,/,g' 164 depmode=msvc7 165 fi 166 167 if test "$depmode" = xlc; then 168 # IBM C/C++ Compilers xlc/xlC can output gcc-like dependency information. 169 gccflag=-qmakedep=gcc,-MF 170 depmode=gcc 171 fi 172 173 case "$depmode" in 174 gcc3) 175 ## gcc 3 implements dependency tracking that does exactly what 176 ## we want. Yay! Note: for some reason libtool 1.4 doesn't like 177 ## it if -MD -MP comes after the -MF stuff. Hmm. 178 ## Unfortunately, FreeBSD c89 acceptance of flags depends upon 179 ## the command line argument order; so add the flags where they 180 ## appear in depend2.am. Note that the slowdown incurred here 181 ## affects only configure: in makefiles, %FASTDEP% shortcuts this. 182 for arg 183 do 184 case $arg in 185 -c) set fnord "$@" -MT "$object" -MD -MP -MF "$tmpdepfile" "$arg" ;; 186 *) set fnord "$@" "$arg" ;; 187 esac 188 shift # fnord 189 shift # $arg 190 done 191 "$@" 192 stat=$? 193 if test $stat -ne 0; then 194 rm -f "$tmpdepfile" 195 exit $stat 196 fi 197 mv "$tmpdepfile" "$depfile" 198 ;; 199 200 gcc) 201 ## Note that this doesn't just cater to obsosete pre-3.x GCC compilers. 202 ## but also to in-use compilers like IMB xlc/xlC and the HP C compiler. 203 ## (see the conditional assignment to $gccflag above). 204 ## There are various ways to get dependency output from gcc. Here's 205 ## why we pick this rather obscure method: 206 ## - Don't want to use -MD because we'd like the dependencies to end 207 ## up in a subdir. Having to rename by hand is ugly. 208 ## (We might end up doing this anyway to support other compilers.) 209 ## - The DEPENDENCIES_OUTPUT environment variable makes gcc act like 210 ## -MM, not -M (despite what the docs say). Also, it might not be 211 ## supported by the other compilers which use the 'gcc' depmode. 212 ## - Using -M directly means running the compiler twice (even worse 213 ## than renaming). 214 if test -z "$gccflag"; then 215 gccflag=-MD, 216 fi 217 "$@" -Wp,"$gccflag$tmpdepfile" 218 stat=$? 219 if test $stat -ne 0; then 220 rm -f "$tmpdepfile" 221 exit $stat 222 fi 223 rm -f "$depfile" 224 echo "$object : \\" > "$depfile" 225 # The second -e expression handles DOS-style file names with drive 226 # letters. 227 sed -e 's/^[^:]*: / /' \ 228 -e 's/^['$alpha']:\/[^:]*: / /' < "$tmpdepfile" >> "$depfile" 229 ## This next piece of magic avoids the "deleted header file" problem. 230 ## The problem is that when a header file which appears in a .P file 231 ## is deleted, the dependency causes make to die (because there is 232 ## typically no way to rebuild the header). We avoid this by adding 233 ## dummy dependencies for each header file. Too bad gcc doesn't do 234 ## this for us directly. 235 ## Some versions of gcc put a space before the ':'. On the theory 236 ## that the space means something, we add a space to the output as 237 ## well. hp depmode also adds that space, but also prefixes the VPATH 238 ## to the object. Take care to not repeat it in the output. 239 ## Some versions of the HPUX 10.20 sed can't process this invocation 240 ## correctly. Breaking it into two sed invocations is a workaround. 241 tr ' ' "$nl" < "$tmpdepfile" \ 242 | sed -e 's/^\\$//' -e '/^$/d' -e "s|.*$object$||" -e '/:$/d' \ 243 | sed -e 's/$/ :/' >> "$depfile" 244 rm -f "$tmpdepfile" 245 ;; 246 247 hp) 248 # This case exists only to let depend.m4 do its work. It works by 249 # looking at the text of this script. This case will never be run, 250 # since it is checked for above. 251 exit 1 252 ;; 253 254 sgi) 255 if test "$libtool" = yes; then 256 "$@" "-Wp,-MDupdate,$tmpdepfile" 257 else 258 "$@" -MDupdate "$tmpdepfile" 259 fi 260 stat=$? 261 if test $stat -ne 0; then 262 rm -f "$tmpdepfile" 263 exit $stat 264 fi 265 rm -f "$depfile" 266 267 if test -f "$tmpdepfile"; then # yes, the sourcefile depend on other files 268 echo "$object : \\" > "$depfile" 269 # Clip off the initial element (the dependent). Don't try to be 270 # clever and replace this with sed code, as IRIX sed won't handle 271 # lines with more than a fixed number of characters (4096 in 272 # IRIX 6.2 sed, 8192 in IRIX 6.5). We also remove comment lines; 273 # the IRIX cc adds comments like '#:fec' to the end of the 274 # dependency line. 275 tr ' ' "$nl" < "$tmpdepfile" \ 276 | sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' \ 277 | tr "$nl" ' ' >> "$depfile" 278 echo >> "$depfile" 279 # The second pass generates a dummy entry for each header file. 280 tr ' ' "$nl" < "$tmpdepfile" \ 281 | sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' -e 's/$/:/' \ 282 >> "$depfile" 283 else 284 make_dummy_depfile 285 fi 286 rm -f "$tmpdepfile" 287 ;; 288 289 xlc) 290 # This case exists only to let depend.m4 do its work. It works by 291 # looking at the text of this script. This case will never be run, 292 # since it is checked for above. 293 exit 1 294 ;; 295 296 aix) 297 # The C for AIX Compiler uses -M and outputs the dependencies 298 # in a .u file. In older versions, this file always lives in the 299 # current directory. Also, the AIX compiler puts '$object:' at the 300 # start of each line; $object doesn't have directory information. 301 # Version 6 uses the directory in both cases. 302 set_dir_from "$object" 303 set_base_from "$object" 304 if test "$libtool" = yes; then 305 tmpdepfile1=$dir$base.u 306 tmpdepfile2=$base.u 307 tmpdepfile3=$dir.libs/$base.u 308 "$@" -Wc,-M 309 else 310 tmpdepfile1=$dir$base.u 311 tmpdepfile2=$dir$base.u 312 tmpdepfile3=$dir$base.u 313 "$@" -M 314 fi 315 stat=$? 316 if test $stat -ne 0; then 317 rm -f "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" 318 exit $stat 319 fi 320 321 for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" 322 do 323 test -f "$tmpdepfile" && break 324 done 325 aix_post_process_depfile 326 ;; 327 328 tcc) 329 # tcc (Tiny C Compiler) understand '-MD -MF file' since version 0.9.26 330 # FIXME: That version still under development at the moment of writing. 331 # Make that this statement remains true also for stable, released 332 # versions. 333 # It will wrap lines (doesn't matter whether long or short) with a 334 # trailing '\', as in: 335 # 336 # foo.o : \ 337 # foo.c \ 338 # foo.h \ 339 # 340 # It will put a trailing '\' even on the last line, and will use leading 341 # spaces rather than leading tabs (at least since its commit 0394caf7 342 # "Emit spaces for -MD"). 343 "$@" -MD -MF "$tmpdepfile" 344 stat=$? 345 if test $stat -ne 0; then 346 rm -f "$tmpdepfile" 347 exit $stat 348 fi 349 rm -f "$depfile" 350 # Each non-empty line is of the form 'foo.o : \' or ' dep.h \'. 351 # We have to change lines of the first kind to '$object: \'. 352 sed -e "s|.*:|$object :|" < "$tmpdepfile" > "$depfile" 353 # And for each line of the second kind, we have to emit a 'dep.h:' 354 # dummy dependency, to avoid the deleted-header problem. 355 sed -n -e 's|^ *\(.*\) *\\$|\1:|p' < "$tmpdepfile" >> "$depfile" 356 rm -f "$tmpdepfile" 357 ;; 358 359 ## The order of this option in the case statement is important, since the 360 ## shell code in configure will try each of these formats in the order 361 ## listed in this file. A plain '-MD' option would be understood by many 362 ## compilers, so we must ensure this comes after the gcc and icc options. 363 pgcc) 364 # Portland's C compiler understands '-MD'. 365 # Will always output deps to 'file.d' where file is the root name of the 366 # source file under compilation, even if file resides in a subdirectory. 367 # The object file name does not affect the name of the '.d' file. 368 # pgcc 10.2 will output 369 # foo.o: sub/foo.c sub/foo.h 370 # and will wrap long lines using '\' : 371 # foo.o: sub/foo.c ... \ 372 # sub/foo.h ... \ 373 # ... 374 set_dir_from "$object" 375 # Use the source, not the object, to determine the base name, since 376 # that's sadly what pgcc will do too. 377 set_base_from "$source" 378 tmpdepfile=$base.d 379 380 # For projects that build the same source file twice into different object 381 # files, the pgcc approach of using the *source* file root name can cause 382 # problems in parallel builds. Use a locking strategy to avoid stomping on 383 # the same $tmpdepfile. 384 lockdir=$base.d-lock 385 trap " 386 echo '$0: caught signal, cleaning up...' >&2 387 rmdir '$lockdir' 388 exit 1 389 " 1 2 13 15 390 numtries=100 391 i=$numtries 392 while test $i -gt 0; do 393 # mkdir is a portable test-and-set. 394 if mkdir "$lockdir" 2>/dev/null; then 395 # This process acquired the lock. 396 "$@" -MD 397 stat=$? 398 # Release the lock. 399 rmdir "$lockdir" 400 break 401 else 402 # If the lock is being held by a different process, wait 403 # until the winning process is done or we timeout. 404 while test -d "$lockdir" && test $i -gt 0; do 405 sleep 1 406 i=`expr $i - 1` 407 done 408 fi 409 i=`expr $i - 1` 410 done 411 trap - 1 2 13 15 412 if test $i -le 0; then 413 echo "$0: failed to acquire lock after $numtries attempts" >&2 414 echo "$0: check lockdir '$lockdir'" >&2 415 exit 1 416 fi 417 418 if test $stat -ne 0; then 419 rm -f "$tmpdepfile" 420 exit $stat 421 fi 422 rm -f "$depfile" 423 # Each line is of the form `foo.o: dependent.h', 424 # or `foo.o: dep1.h dep2.h \', or ` dep3.h dep4.h \'. 425 # Do two passes, one to just change these to 426 # `$object: dependent.h' and one to simply `dependent.h:'. 427 sed "s,^[^:]*:,$object :," < "$tmpdepfile" > "$depfile" 428 # Some versions of the HPUX 10.20 sed can't process this invocation 429 # correctly. Breaking it into two sed invocations is a workaround. 430 sed 's,^[^:]*: \(.*\)$,\1,;s/^\\$//;/^$/d;/:$/d' < "$tmpdepfile" \ 431 | sed -e 's/$/ :/' >> "$depfile" 432 rm -f "$tmpdepfile" 433 ;; 434 435 hp2) 436 # The "hp" stanza above does not work with aCC (C++) and HP's ia64 437 # compilers, which have integrated preprocessors. The correct option 438 # to use with these is +Maked; it writes dependencies to a file named 439 # 'foo.d', which lands next to the object file, wherever that 440 # happens to be. 441 # Much of this is similar to the tru64 case; see comments there. 442 set_dir_from "$object" 443 set_base_from "$object" 444 if test "$libtool" = yes; then 445 tmpdepfile1=$dir$base.d 446 tmpdepfile2=$dir.libs/$base.d 447 "$@" -Wc,+Maked 448 else 449 tmpdepfile1=$dir$base.d 450 tmpdepfile2=$dir$base.d 451 "$@" +Maked 452 fi 453 stat=$? 454 if test $stat -ne 0; then 455 rm -f "$tmpdepfile1" "$tmpdepfile2" 456 exit $stat 457 fi 458 459 for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" 460 do 461 test -f "$tmpdepfile" && break 462 done 463 if test -f "$tmpdepfile"; then 464 sed -e "s,^.*\.[$lower]*:,$object:," "$tmpdepfile" > "$depfile" 465 # Add 'dependent.h:' lines. 466 sed -ne '2,${ 467 s/^ *// 468 s/ \\*$// 469 s/$/:/ 470 p 471 }' "$tmpdepfile" >> "$depfile" 472 else 473 make_dummy_depfile 474 fi 475 rm -f "$tmpdepfile" "$tmpdepfile2" 476 ;; 477 478 tru64) 479 # The Tru64 compiler uses -MD to generate dependencies as a side 480 # effect. 'cc -MD -o foo.o ...' puts the dependencies into 'foo.o.d'. 481 # At least on Alpha/Redhat 6.1, Compaq CCC V6.2-504 seems to put 482 # dependencies in 'foo.d' instead, so we check for that too. 483 # Subdirectories are respected. 484 set_dir_from "$object" 485 set_base_from "$object" 486 487 if test "$libtool" = yes; then 488 # Libtool generates 2 separate objects for the 2 libraries. These 489 # two compilations output dependencies in $dir.libs/$base.o.d and 490 # in $dir$base.o.d. We have to check for both files, because 491 # one of the two compilations can be disabled. We should prefer 492 # $dir$base.o.d over $dir.libs/$base.o.d because the latter is 493 # automatically cleaned when .libs/ is deleted, while ignoring 494 # the former would cause a distcleancheck panic. 495 tmpdepfile1=$dir$base.o.d # libtool 1.5 496 tmpdepfile2=$dir.libs/$base.o.d # Likewise. 497 tmpdepfile3=$dir.libs/$base.d # Compaq CCC V6.2-504 498 "$@" -Wc,-MD 499 else 500 tmpdepfile1=$dir$base.d 501 tmpdepfile2=$dir$base.d 502 tmpdepfile3=$dir$base.d 503 "$@" -MD 504 fi 505 506 stat=$? 507 if test $stat -ne 0; then 508 rm -f "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" 509 exit $stat 510 fi 511 512 for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" 513 do 514 test -f "$tmpdepfile" && break 515 done 516 # Same post-processing that is required for AIX mode. 517 aix_post_process_depfile 518 ;; 519 520 msvc7) 521 if test "$libtool" = yes; then 522 showIncludes=-Wc,-showIncludes 523 else 524 showIncludes=-showIncludes 525 fi 526 "$@" $showIncludes > "$tmpdepfile" 527 stat=$? 528 grep -v '^Note: including file: ' "$tmpdepfile" 529 if test $stat -ne 0; then 530 rm -f "$tmpdepfile" 531 exit $stat 532 fi 533 rm -f "$depfile" 534 echo "$object : \\" > "$depfile" 535 # The first sed program below extracts the file names and escapes 536 # backslashes for cygpath. The second sed program outputs the file 537 # name when reading, but also accumulates all include files in the 538 # hold buffer in order to output them again at the end. This only 539 # works with sed implementations that can handle large buffers. 540 sed < "$tmpdepfile" -n ' 541 /^Note: including file: *\(.*\)/ { 542 s//\1/ 543 s/\\/\\\\/g 544 p 545 }' | $cygpath_u | sort -u | sed -n ' 546 s/ /\\ /g 547 s/\(.*\)/'"$tab"'\1 \\/p 548 s/.\(.*\) \\/\1:/ 549 H 550 $ { 551 s/.*/'"$tab"'/ 552 G 553 p 554 }' >> "$depfile" 555 echo >> "$depfile" # make sure the fragment doesn't end with a backslash 556 rm -f "$tmpdepfile" 557 ;; 558 559 msvc7msys) 560 # This case exists only to let depend.m4 do its work. It works by 561 # looking at the text of this script. This case will never be run, 562 # since it is checked for above. 563 exit 1 564 ;; 565 566 #nosideeffect) 567 # This comment above is used by automake to tell side-effect 568 # dependency tracking mechanisms from slower ones. 569 570 dashmstdout) 571 # Important note: in order to support this mode, a compiler *must* 572 # always write the preprocessed file to stdout, regardless of -o. 573 "$@" || exit $? 574 575 # Remove the call to Libtool. 576 if test "$libtool" = yes; then 577 while test "X$1" != 'X--mode=compile'; do 578 shift 579 done 580 shift 581 fi 582 583 # Remove '-o $object'. 584 IFS=" " 585 for arg 586 do 587 case $arg in 588 -o) 589 shift 590 ;; 591 $object) 592 shift 593 ;; 594 *) 595 set fnord "$@" "$arg" 596 shift # fnord 597 shift # $arg 598 ;; 599 esac 600 done 601 602 test -z "$dashmflag" && dashmflag=-M 603 # Require at least two characters before searching for ':' 604 # in the target name. This is to cope with DOS-style filenames: 605 # a dependency such as 'c:/foo/bar' could be seen as target 'c' otherwise. 606 "$@" $dashmflag | 607 sed "s|^[$tab ]*[^:$tab ][^:][^:]*:[$tab ]*|$object: |" > "$tmpdepfile" 608 rm -f "$depfile" 609 cat < "$tmpdepfile" > "$depfile" 610 # Some versions of the HPUX 10.20 sed can't process this sed invocation 611 # correctly. Breaking it into two sed invocations is a workaround. 612 tr ' ' "$nl" < "$tmpdepfile" \ 613 | sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' \ 614 | sed -e 's/$/ :/' >> "$depfile" 615 rm -f "$tmpdepfile" 616 ;; 617 618 dashXmstdout) 619 # This case only exists to satisfy depend.m4. It is never actually 620 # run, as this mode is specially recognized in the preamble. 621 exit 1 622 ;; 623 624 makedepend) 625 "$@" || exit $? 626 # Remove any Libtool call 627 if test "$libtool" = yes; then 628 while test "X$1" != 'X--mode=compile'; do 629 shift 630 done 631 shift 632 fi 633 # X makedepend 634 shift 635 cleared=no eat=no 636 for arg 637 do 638 case $cleared in 639 no) 640 set ""; shift 641 cleared=yes ;; 642 esac 643 if test $eat = yes; then 644 eat=no 645 continue 646 fi 647 case "$arg" in 648 -D*|-I*) 649 set fnord "$@" "$arg"; shift ;; 650 # Strip any option that makedepend may not understand. Remove 651 # the object too, otherwise makedepend will parse it as a source file. 652 -arch) 653 eat=yes ;; 654 -*|$object) 655 ;; 656 *) 657 set fnord "$@" "$arg"; shift ;; 658 esac 659 done 660 obj_suffix=`echo "$object" | sed 's/^.*\././'` 661 touch "$tmpdepfile" 662 ${MAKEDEPEND-makedepend} -o"$obj_suffix" -f"$tmpdepfile" "$@" 663 rm -f "$depfile" 664 # makedepend may prepend the VPATH from the source file name to the object. 665 # No need to regex-escape $object, excess matching of '.' is harmless. 666 sed "s|^.*\($object *:\)|\1|" "$tmpdepfile" > "$depfile" 667 # Some versions of the HPUX 10.20 sed can't process the last invocation 668 # correctly. Breaking it into two sed invocations is a workaround. 669 sed '1,2d' "$tmpdepfile" \ 670 | tr ' ' "$nl" \ 671 | sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' \ 672 | sed -e 's/$/ :/' >> "$depfile" 673 rm -f "$tmpdepfile" "$tmpdepfile".bak 674 ;; 675 676 cpp) 677 # Important note: in order to support this mode, a compiler *must* 678 # always write the preprocessed file to stdout. 679 "$@" || exit $? 680 681 # Remove the call to Libtool. 682 if test "$libtool" = yes; then 683 while test "X$1" != 'X--mode=compile'; do 684 shift 685 done 686 shift 687 fi 688 689 # Remove '-o $object'. 690 IFS=" " 691 for arg 692 do 693 case $arg in 694 -o) 695 shift 696 ;; 697 $object) 698 shift 699 ;; 700 *) 701 set fnord "$@" "$arg" 702 shift # fnord 703 shift # $arg 704 ;; 705 esac 706 done 707 708 "$@" -E \ 709 | sed -n -e '/^# [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' \ 710 -e '/^#line [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' \ 711 | sed '$ s: \\$::' > "$tmpdepfile" 712 rm -f "$depfile" 713 echo "$object : \\" > "$depfile" 714 cat < "$tmpdepfile" >> "$depfile" 715 sed < "$tmpdepfile" '/^$/d;s/^ //;s/ \\$//;s/$/ :/' >> "$depfile" 716 rm -f "$tmpdepfile" 717 ;; 718 719 msvisualcpp) 720 # Important note: in order to support this mode, a compiler *must* 721 # always write the preprocessed file to stdout. 722 "$@" || exit $? 723 724 # Remove the call to Libtool. 725 if test "$libtool" = yes; then 726 while test "X$1" != 'X--mode=compile'; do 727 shift 728 done 729 shift 730 fi 731 732 IFS=" " 733 for arg 734 do 735 case "$arg" in 736 -o) 737 shift 738 ;; 739 $object) 740 shift 741 ;; 742 "-Gm"|"/Gm"|"-Gi"|"/Gi"|"-ZI"|"/ZI") 743 set fnord "$@" 744 shift 745 shift 746 ;; 747 *) 748 set fnord "$@" "$arg" 749 shift 750 shift 751 ;; 752 esac 753 done 754 "$@" -E 2>/dev/null | 755 sed -n '/^#line [0-9][0-9]* "\([^"]*\)"/ s::\1:p' | $cygpath_u | sort -u > "$tmpdepfile" 756 rm -f "$depfile" 757 echo "$object : \\" > "$depfile" 758 sed < "$tmpdepfile" -n -e 's% %\\ %g' -e '/^\(.*\)$/ s::'"$tab"'\1 \\:p' >> "$depfile" 759 echo "$tab" >> "$depfile" 760 sed < "$tmpdepfile" -n -e 's% %\\ %g' -e '/^\(.*\)$/ s::\1\::p' >> "$depfile" 761 rm -f "$tmpdepfile" 762 ;; 763 764 msvcmsys) 765 # This case exists only to let depend.m4 do its work. It works by 766 # looking at the text of this script. This case will never be run, 767 # since it is checked for above. 768 exit 1 769 ;; 770 771 none) 772 exec "$@" 773 ;; 774 775 *) 776 echo "Unknown depmode $depmode" 1>&2 777 exit 1 778 ;; 779 esac 780 781 exit 0 782 783 # Local Variables: 784 # mode: shell-script 785 # sh-indentation: 2 786 # eval: (add-hook 'write-file-hooks 'time-stamp) 787 # time-stamp-start: "scriptversion=" 788 # time-stamp-format: "%:y-%02m-%02d.%02H" 789 # time-stamp-time-zone: "UTC" 790 # time-stamp-end: "; # UTC" 791 # End: 1 /usr/share/automake-1.15/depcomp -
Property mode
changed from
-
automake/install-sh
-
Property mode
changed from
100755to120000
rf9feab8 r90152a4 1 #!/bin/sh 2 # install - install a program, script, or datafile 3 4 scriptversion=2014-09-12.12; # UTC 5 6 # This originates from X11R5 (mit/util/scripts/install.sh), which was 7 # later released in X11R6 (xc/config/util/install.sh) with the 8 # following copyright and license. 9 # 10 # Copyright (C) 1994 X Consortium 11 # 12 # Permission is hereby granted, free of charge, to any person obtaining a copy 13 # of this software and associated documentation files (the "Software"), to 14 # deal in the Software without restriction, including without limitation the 15 # rights to use, copy, modify, merge, publish, distribute, sublicense, and/or 16 # sell copies of the Software, and to permit persons to whom the Software is 17 # furnished to do so, subject to the following conditions: 18 # 19 # The above copyright notice and this permission notice shall be included in 20 # all copies or substantial portions of the Software. 21 # 22 # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 23 # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 24 # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 25 # X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN 26 # AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNEC- 27 # TION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 28 # 29 # Except as contained in this notice, the name of the X Consortium shall not 30 # be used in advertising or otherwise to promote the sale, use or other deal- 31 # ings in this Software without prior written authorization from the X Consor- 32 # tium. 33 # 34 # 35 # FSF changes to this file are in the public domain. 36 # 37 # Calling this script install-sh is preferred over install.sh, to prevent 38 # 'make' implicit rules from creating a file called install from it 39 # when there is no Makefile. 40 # 41 # This script is compatible with the BSD install script, but was written 42 # from scratch. 43 44 tab=' ' 45 nl=' 46 ' 47 IFS=" $tab$nl" 48 49 # Set DOITPROG to "echo" to test this script. 50 51 doit=${DOITPROG-} 52 doit_exec=${doit:-exec} 53 54 # Put in absolute file names if you don't have them in your path; 55 # or use environment vars. 56 57 chgrpprog=${CHGRPPROG-chgrp} 58 chmodprog=${CHMODPROG-chmod} 59 chownprog=${CHOWNPROG-chown} 60 cmpprog=${CMPPROG-cmp} 61 cpprog=${CPPROG-cp} 62 mkdirprog=${MKDIRPROG-mkdir} 63 mvprog=${MVPROG-mv} 64 rmprog=${RMPROG-rm} 65 stripprog=${STRIPPROG-strip} 66 67 posix_mkdir= 68 69 # Desired mode of installed file. 70 mode=0755 71 72 chgrpcmd= 73 chmodcmd=$chmodprog 74 chowncmd= 75 mvcmd=$mvprog 76 rmcmd="$rmprog -f" 77 stripcmd= 78 79 src= 80 dst= 81 dir_arg= 82 dst_arg= 83 84 copy_on_change=false 85 is_target_a_directory=possibly 86 87 usage="\ 88 Usage: $0 [OPTION]... [-T] SRCFILE DSTFILE 89 or: $0 [OPTION]... SRCFILES... DIRECTORY 90 or: $0 [OPTION]... -t DIRECTORY SRCFILES... 91 or: $0 [OPTION]... -d DIRECTORIES... 92 93 In the 1st form, copy SRCFILE to DSTFILE. 94 In the 2nd and 3rd, copy all SRCFILES to DIRECTORY. 95 In the 4th, create DIRECTORIES. 96 97 Options: 98 --help display this help and exit. 99 --version display version info and exit. 100 101 -c (ignored) 102 -C install only if different (preserve the last data modification time) 103 -d create directories instead of installing files. 104 -g GROUP $chgrpprog installed files to GROUP. 105 -m MODE $chmodprog installed files to MODE. 106 -o USER $chownprog installed files to USER. 107 -s $stripprog installed files. 108 -t DIRECTORY install into DIRECTORY. 109 -T report an error if DSTFILE is a directory. 110 111 Environment variables override the default commands: 112 CHGRPPROG CHMODPROG CHOWNPROG CMPPROG CPPROG MKDIRPROG MVPROG 113 RMPROG STRIPPROG 114 " 115 116 while test $# -ne 0; do 117 case $1 in 118 -c) ;; 119 120 -C) copy_on_change=true;; 121 122 -d) dir_arg=true;; 123 124 -g) chgrpcmd="$chgrpprog $2" 125 shift;; 126 127 --help) echo "$usage"; exit $?;; 128 129 -m) mode=$2 130 case $mode in 131 *' '* | *"$tab"* | *"$nl"* | *'*'* | *'?'* | *'['*) 132 echo "$0: invalid mode: $mode" >&2 133 exit 1;; 134 esac 135 shift;; 136 137 -o) chowncmd="$chownprog $2" 138 shift;; 139 140 -s) stripcmd=$stripprog;; 141 142 -t) 143 is_target_a_directory=always 144 dst_arg=$2 145 # Protect names problematic for 'test' and other utilities. 146 case $dst_arg in 147 -* | [=\(\)!]) dst_arg=./$dst_arg;; 148 esac 149 shift;; 150 151 -T) is_target_a_directory=never;; 152 153 --version) echo "$0 $scriptversion"; exit $?;; 154 155 --) shift 156 break;; 157 158 -*) echo "$0: invalid option: $1" >&2 159 exit 1;; 160 161 *) break;; 162 esac 163 shift 164 done 165 166 # We allow the use of options -d and -T together, by making -d 167 # take the precedence; this is for compatibility with GNU install. 168 169 if test -n "$dir_arg"; then 170 if test -n "$dst_arg"; then 171 echo "$0: target directory not allowed when installing a directory." >&2 172 exit 1 173 fi 174 fi 175 176 if test $# -ne 0 && test -z "$dir_arg$dst_arg"; then 177 # When -d is used, all remaining arguments are directories to create. 178 # When -t is used, the destination is already specified. 179 # Otherwise, the last argument is the destination. Remove it from $@. 180 for arg 181 do 182 if test -n "$dst_arg"; then 183 # $@ is not empty: it contains at least $arg. 184 set fnord "$@" "$dst_arg" 185 shift # fnord 186 fi 187 shift # arg 188 dst_arg=$arg 189 # Protect names problematic for 'test' and other utilities. 190 case $dst_arg in 191 -* | [=\(\)!]) dst_arg=./$dst_arg;; 192 esac 193 done 194 fi 195 196 if test $# -eq 0; then 197 if test -z "$dir_arg"; then 198 echo "$0: no input file specified." >&2 199 exit 1 200 fi 201 # It's OK to call 'install-sh -d' without argument. 202 # This can happen when creating conditional directories. 203 exit 0 204 fi 205 206 if test -z "$dir_arg"; then 207 if test $# -gt 1 || test "$is_target_a_directory" = always; then 208 if test ! -d "$dst_arg"; then 209 echo "$0: $dst_arg: Is not a directory." >&2 210 exit 1 211 fi 212 fi 213 fi 214 215 if test -z "$dir_arg"; then 216 do_exit='(exit $ret); exit $ret' 217 trap "ret=129; $do_exit" 1 218 trap "ret=130; $do_exit" 2 219 trap "ret=141; $do_exit" 13 220 trap "ret=143; $do_exit" 15 221 222 # Set umask so as not to create temps with too-generous modes. 223 # However, 'strip' requires both read and write access to temps. 224 case $mode in 225 # Optimize common cases. 226 *644) cp_umask=133;; 227 *755) cp_umask=22;; 228 229 *[0-7]) 230 if test -z "$stripcmd"; then 231 u_plus_rw= 232 else 233 u_plus_rw='% 200' 234 fi 235 cp_umask=`expr '(' 777 - $mode % 1000 ')' $u_plus_rw`;; 236 *) 237 if test -z "$stripcmd"; then 238 u_plus_rw= 239 else 240 u_plus_rw=,u+rw 241 fi 242 cp_umask=$mode$u_plus_rw;; 243 esac 244 fi 245 246 for src 247 do 248 # Protect names problematic for 'test' and other utilities. 249 case $src in 250 -* | [=\(\)!]) src=./$src;; 251 esac 252 253 if test -n "$dir_arg"; then 254 dst=$src 255 dstdir=$dst 256 test -d "$dstdir" 257 dstdir_status=$? 258 else 259 260 # Waiting for this to be detected by the "$cpprog $src $dsttmp" command 261 # might cause directories to be created, which would be especially bad 262 # if $src (and thus $dsttmp) contains '*'. 263 if test ! -f "$src" && test ! -d "$src"; then 264 echo "$0: $src does not exist." >&2 265 exit 1 266 fi 267 268 if test -z "$dst_arg"; then 269 echo "$0: no destination specified." >&2 270 exit 1 271 fi 272 dst=$dst_arg 273 274 # If destination is a directory, append the input filename; won't work 275 # if double slashes aren't ignored. 276 if test -d "$dst"; then 277 if test "$is_target_a_directory" = never; then 278 echo "$0: $dst_arg: Is a directory" >&2 279 exit 1 280 fi 281 dstdir=$dst 282 dst=$dstdir/`basename "$src"` 283 dstdir_status=0 284 else 285 dstdir=`dirname "$dst"` 286 test -d "$dstdir" 287 dstdir_status=$? 288 fi 289 fi 290 291 obsolete_mkdir_used=false 292 293 if test $dstdir_status != 0; then 294 case $posix_mkdir in 295 '') 296 # Create intermediate dirs using mode 755 as modified by the umask. 297 # This is like FreeBSD 'install' as of 1997-10-28. 298 umask=`umask` 299 case $stripcmd.$umask in 300 # Optimize common cases. 301 *[2367][2367]) mkdir_umask=$umask;; 302 .*0[02][02] | .[02][02] | .[02]) mkdir_umask=22;; 303 304 *[0-7]) 305 mkdir_umask=`expr $umask + 22 \ 306 - $umask % 100 % 40 + $umask % 20 \ 307 - $umask % 10 % 4 + $umask % 2 308 `;; 309 *) mkdir_umask=$umask,go-w;; 310 esac 311 312 # With -d, create the new directory with the user-specified mode. 313 # Otherwise, rely on $mkdir_umask. 314 if test -n "$dir_arg"; then 315 mkdir_mode=-m$mode 316 else 317 mkdir_mode= 318 fi 319 320 posix_mkdir=false 321 case $umask in 322 *[123567][0-7][0-7]) 323 # POSIX mkdir -p sets u+wx bits regardless of umask, which 324 # is incompatible with FreeBSD 'install' when (umask & 300) != 0. 325 ;; 326 *) 327 # $RANDOM is not portable (e.g. dash); use it when possible to 328 # lower collision chance 329 tmpdir=${TMPDIR-/tmp}/ins$RANDOM-$$ 330 trap 'ret=$?; rmdir "$tmpdir/a/b" "$tmpdir/a" "$tmpdir" 2>/dev/null; exit $ret' 0 331 332 # As "mkdir -p" follows symlinks and we work in /tmp possibly; so 333 # create the $tmpdir first (and fail if unsuccessful) to make sure 334 # that nobody tries to guess the $tmpdir name. 335 if (umask $mkdir_umask && 336 $mkdirprog $mkdir_mode "$tmpdir" && 337 exec $mkdirprog $mkdir_mode -p -- "$tmpdir/a/b") >/dev/null 2>&1 338 then 339 if test -z "$dir_arg" || { 340 # Check for POSIX incompatibilities with -m. 341 # HP-UX 11.23 and IRIX 6.5 mkdir -m -p sets group- or 342 # other-writable bit of parent directory when it shouldn't. 343 # FreeBSD 6.1 mkdir -m -p sets mode of existing directory. 344 test_tmpdir="$tmpdir/a" 345 ls_ld_tmpdir=`ls -ld "$test_tmpdir"` 346 case $ls_ld_tmpdir in 347 d????-?r-*) different_mode=700;; 348 d????-?--*) different_mode=755;; 349 *) false;; 350 esac && 351 $mkdirprog -m$different_mode -p -- "$test_tmpdir" && { 352 ls_ld_tmpdir_1=`ls -ld "$test_tmpdir"` 353 test "$ls_ld_tmpdir" = "$ls_ld_tmpdir_1" 354 } 355 } 356 then posix_mkdir=: 357 fi 358 rmdir "$tmpdir/a/b" "$tmpdir/a" "$tmpdir" 359 else 360 # Remove any dirs left behind by ancient mkdir implementations. 361 rmdir ./$mkdir_mode ./-p ./-- "$tmpdir" 2>/dev/null 362 fi 363 trap '' 0;; 364 esac;; 365 esac 366 367 if 368 $posix_mkdir && ( 369 umask $mkdir_umask && 370 $doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir" 371 ) 372 then : 373 else 374 375 # The umask is ridiculous, or mkdir does not conform to POSIX, 376 # or it failed possibly due to a race condition. Create the 377 # directory the slow way, step by step, checking for races as we go. 378 379 case $dstdir in 380 /*) prefix='/';; 381 [-=\(\)!]*) prefix='./';; 382 *) prefix='';; 383 esac 384 385 oIFS=$IFS 386 IFS=/ 387 set -f 388 set fnord $dstdir 389 shift 390 set +f 391 IFS=$oIFS 392 393 prefixes= 394 395 for d 396 do 397 test X"$d" = X && continue 398 399 prefix=$prefix$d 400 if test -d "$prefix"; then 401 prefixes= 402 else 403 if $posix_mkdir; then 404 (umask=$mkdir_umask && 405 $doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir") && break 406 # Don't fail if two instances are running concurrently. 407 test -d "$prefix" || exit 1 408 else 409 case $prefix in 410 *\'*) qprefix=`echo "$prefix" | sed "s/'/'\\\\\\\\''/g"`;; 411 *) qprefix=$prefix;; 412 esac 413 prefixes="$prefixes '$qprefix'" 414 fi 415 fi 416 prefix=$prefix/ 417 done 418 419 if test -n "$prefixes"; then 420 # Don't fail if two instances are running concurrently. 421 (umask $mkdir_umask && 422 eval "\$doit_exec \$mkdirprog $prefixes") || 423 test -d "$dstdir" || exit 1 424 obsolete_mkdir_used=true 425 fi 426 fi 427 fi 428 429 if test -n "$dir_arg"; then 430 { test -z "$chowncmd" || $doit $chowncmd "$dst"; } && 431 { test -z "$chgrpcmd" || $doit $chgrpcmd "$dst"; } && 432 { test "$obsolete_mkdir_used$chowncmd$chgrpcmd" = false || 433 test -z "$chmodcmd" || $doit $chmodcmd $mode "$dst"; } || exit 1 434 else 435 436 # Make a couple of temp file names in the proper directory. 437 dsttmp=$dstdir/_inst.$$_ 438 rmtmp=$dstdir/_rm.$$_ 439 440 # Trap to clean up those temp files at exit. 441 trap 'ret=$?; rm -f "$dsttmp" "$rmtmp" && exit $ret' 0 442 443 # Copy the file name to the temp name. 444 (umask $cp_umask && $doit_exec $cpprog "$src" "$dsttmp") && 445 446 # and set any options; do chmod last to preserve setuid bits. 447 # 448 # If any of these fail, we abort the whole thing. If we want to 449 # ignore errors from any of these, just make sure not to ignore 450 # errors from the above "$doit $cpprog $src $dsttmp" command. 451 # 452 { test -z "$chowncmd" || $doit $chowncmd "$dsttmp"; } && 453 { test -z "$chgrpcmd" || $doit $chgrpcmd "$dsttmp"; } && 454 { test -z "$stripcmd" || $doit $stripcmd "$dsttmp"; } && 455 { test -z "$chmodcmd" || $doit $chmodcmd $mode "$dsttmp"; } && 456 457 # If -C, don't bother to copy if it wouldn't change the file. 458 if $copy_on_change && 459 old=`LC_ALL=C ls -dlL "$dst" 2>/dev/null` && 460 new=`LC_ALL=C ls -dlL "$dsttmp" 2>/dev/null` && 461 set -f && 462 set X $old && old=:$2:$4:$5:$6 && 463 set X $new && new=:$2:$4:$5:$6 && 464 set +f && 465 test "$old" = "$new" && 466 $cmpprog "$dst" "$dsttmp" >/dev/null 2>&1 467 then 468 rm -f "$dsttmp" 469 else 470 # Rename the file to the real destination. 471 $doit $mvcmd -f "$dsttmp" "$dst" 2>/dev/null || 472 473 # The rename failed, perhaps because mv can't rename something else 474 # to itself, or perhaps because mv is so ancient that it does not 475 # support -f. 476 { 477 # Now remove or move aside any old file at destination location. 478 # We try this two ways since rm can't unlink itself on some 479 # systems and the destination file might be busy for other 480 # reasons. In this case, the final cleanup might fail but the new 481 # file should still install successfully. 482 { 483 test ! -f "$dst" || 484 $doit $rmcmd -f "$dst" 2>/dev/null || 485 { $doit $mvcmd -f "$dst" "$rmtmp" 2>/dev/null && 486 { $doit $rmcmd -f "$rmtmp" 2>/dev/null; :; } 487 } || 488 { echo "$0: cannot unlink or rename $dst" >&2 489 (exit 1); exit 1 490 } 491 } && 492 493 # Now rename the file to the real destination. 494 $doit $mvcmd "$dsttmp" "$dst" 495 } 496 fi || exit 1 497 498 trap '' 0 499 fi 500 done 501 502 # Local variables: 503 # eval: (add-hook 'write-file-hooks 'time-stamp) 504 # time-stamp-start: "scriptversion=" 505 # time-stamp-format: "%:y-%02m-%02d.%02H" 506 # time-stamp-time-zone: "UTC" 507 # time-stamp-end: "; # UTC" 508 # End: 1 /usr/share/automake-1.15/install-sh -
Property mode
changed from
-
automake/missing
-
Property mode
changed from
100755to120000
rf9feab8 r90152a4 1 #! /bin/sh 2 # Common wrapper for a few potentially missing GNU programs. 3 4 scriptversion=2013-10-28.13; # UTC 5 6 # Copyright (C) 1996-2014 Free Software Foundation, Inc. 7 # Originally written by Fran,cois Pinard <pinard@iro.umontreal.ca>, 1996. 8 9 # This program is free software; you can redistribute it and/or modify 10 # it under the terms of the GNU General Public License as published by 11 # the Free Software Foundation; either version 2, or (at your option) 12 # any later version. 13 14 # This program is distributed in the hope that it will be useful, 15 # but WITHOUT ANY WARRANTY; without even the implied warranty of 16 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 17 # GNU General Public License for more details. 18 19 # You should have received a copy of the GNU General Public License 20 # along with this program. If not, see <http://www.gnu.org/licenses/>. 21 22 # As a special exception to the GNU General Public License, if you 23 # distribute this file as part of a program that contains a 24 # configuration script generated by Autoconf, you may include it under 25 # the same distribution terms that you use for the rest of that program. 26 27 if test $# -eq 0; then 28 echo 1>&2 "Try '$0 --help' for more information" 29 exit 1 30 fi 31 32 case $1 in 33 34 --is-lightweight) 35 # Used by our autoconf macros to check whether the available missing 36 # script is modern enough. 37 exit 0 38 ;; 39 40 --run) 41 # Back-compat with the calling convention used by older automake. 42 shift 43 ;; 44 45 -h|--h|--he|--hel|--help) 46 echo "\ 47 $0 [OPTION]... PROGRAM [ARGUMENT]... 48 49 Run 'PROGRAM [ARGUMENT]...', returning a proper advice when this fails due 50 to PROGRAM being missing or too old. 51 52 Options: 53 -h, --help display this help and exit 54 -v, --version output version information and exit 55 56 Supported PROGRAM values: 57 aclocal autoconf autoheader autom4te automake makeinfo 58 bison yacc flex lex help2man 59 60 Version suffixes to PROGRAM as well as the prefixes 'gnu-', 'gnu', and 61 'g' are ignored when checking the name. 62 63 Send bug reports to <bug-automake@gnu.org>." 64 exit $? 65 ;; 66 67 -v|--v|--ve|--ver|--vers|--versi|--versio|--version) 68 echo "missing $scriptversion (GNU Automake)" 69 exit $? 70 ;; 71 72 -*) 73 echo 1>&2 "$0: unknown '$1' option" 74 echo 1>&2 "Try '$0 --help' for more information" 75 exit 1 76 ;; 77 78 esac 79 80 # Run the given program, remember its exit status. 81 "$@"; st=$? 82 83 # If it succeeded, we are done. 84 test $st -eq 0 && exit 0 85 86 # Also exit now if we it failed (or wasn't found), and '--version' was 87 # passed; such an option is passed most likely to detect whether the 88 # program is present and works. 89 case $2 in --version|--help) exit $st;; esac 90 91 # Exit code 63 means version mismatch. This often happens when the user 92 # tries to use an ancient version of a tool on a file that requires a 93 # minimum version. 94 if test $st -eq 63; then 95 msg="probably too old" 96 elif test $st -eq 127; then 97 # Program was missing. 98 msg="missing on your system" 99 else 100 # Program was found and executed, but failed. Give up. 101 exit $st 102 fi 103 104 perl_URL=http://www.perl.org/ 105 flex_URL=http://flex.sourceforge.net/ 106 gnu_software_URL=http://www.gnu.org/software 107 108 program_details () 109 { 110 case $1 in 111 aclocal|automake) 112 echo "The '$1' program is part of the GNU Automake package:" 113 echo "<$gnu_software_URL/automake>" 114 echo "It also requires GNU Autoconf, GNU m4 and Perl in order to run:" 115 echo "<$gnu_software_URL/autoconf>" 116 echo "<$gnu_software_URL/m4/>" 117 echo "<$perl_URL>" 118 ;; 119 autoconf|autom4te|autoheader) 120 echo "The '$1' program is part of the GNU Autoconf package:" 121 echo "<$gnu_software_URL/autoconf/>" 122 echo "It also requires GNU m4 and Perl in order to run:" 123 echo "<$gnu_software_URL/m4/>" 124 echo "<$perl_URL>" 125 ;; 126 esac 127 } 128 129 give_advice () 130 { 131 # Normalize program name to check for. 132 normalized_program=`echo "$1" | sed ' 133 s/^gnu-//; t 134 s/^gnu//; t 135 s/^g//; t'` 136 137 printf '%s\n' "'$1' is $msg." 138 139 configure_deps="'configure.ac' or m4 files included by 'configure.ac'" 140 case $normalized_program in 141 autoconf*) 142 echo "You should only need it if you modified 'configure.ac'," 143 echo "or m4 files included by it." 144 program_details 'autoconf' 145 ;; 146 autoheader*) 147 echo "You should only need it if you modified 'acconfig.h' or" 148 echo "$configure_deps." 149 program_details 'autoheader' 150 ;; 151 automake*) 152 echo "You should only need it if you modified 'Makefile.am' or" 153 echo "$configure_deps." 154 program_details 'automake' 155 ;; 156 aclocal*) 157 echo "You should only need it if you modified 'acinclude.m4' or" 158 echo "$configure_deps." 159 program_details 'aclocal' 160 ;; 161 autom4te*) 162 echo "You might have modified some maintainer files that require" 163 echo "the 'autom4te' program to be rebuilt." 164 program_details 'autom4te' 165 ;; 166 bison*|yacc*) 167 echo "You should only need it if you modified a '.y' file." 168 echo "You may want to install the GNU Bison package:" 169 echo "<$gnu_software_URL/bison/>" 170 ;; 171 lex*|flex*) 172 echo "You should only need it if you modified a '.l' file." 173 echo "You may want to install the Fast Lexical Analyzer package:" 174 echo "<$flex_URL>" 175 ;; 176 help2man*) 177 echo "You should only need it if you modified a dependency" \ 178 "of a man page." 179 echo "You may want to install the GNU Help2man package:" 180 echo "<$gnu_software_URL/help2man/>" 181 ;; 182 makeinfo*) 183 echo "You should only need it if you modified a '.texi' file, or" 184 echo "any other file indirectly affecting the aspect of the manual." 185 echo "You might want to install the Texinfo package:" 186 echo "<$gnu_software_URL/texinfo/>" 187 echo "The spurious makeinfo call might also be the consequence of" 188 echo "using a buggy 'make' (AIX, DU, IRIX), in which case you might" 189 echo "want to install GNU make:" 190 echo "<$gnu_software_URL/make/>" 191 ;; 192 *) 193 echo "You might have modified some files without having the proper" 194 echo "tools for further handling them. Check the 'README' file, it" 195 echo "often tells you about the needed prerequisites for installing" 196 echo "this package. You may also peek at any GNU archive site, in" 197 echo "case some other package contains this missing '$1' program." 198 ;; 199 esac 200 } 201 202 give_advice "$1" | sed -e '1s/^/WARNING: /' \ 203 -e '2,$s/^/ /' >&2 204 205 # Propagate the correct exit status (expected to be 127 for a program 206 # not found, 63 for a program that failed due to version mismatch). 207 exit $st 208 209 # Local variables: 210 # eval: (add-hook 'write-file-hooks 'time-stamp) 211 # time-stamp-start: "scriptversion=" 212 # time-stamp-format: "%:y-%02m-%02d.%02H" 213 # time-stamp-time-zone: "UTC" 214 # time-stamp-end: "; # UTC" 215 # End: 1 /usr/share/automake-1.15/missing -
Property mode
changed from
-
automake/test-driver
-
Property mode
changed from
100755to120000
rf9feab8 r90152a4 1 #! /bin/sh 2 # test-driver - basic testsuite driver script. 3 4 scriptversion=2013-07-13.22; # UTC 5 6 # Copyright (C) 2011-2014 Free Software Foundation, Inc. 7 # 8 # This program is free software; you can redistribute it and/or modify 9 # it under the terms of the GNU General Public License as published by 10 # the Free Software Foundation; either version 2, or (at your option) 11 # any later version. 12 # 13 # This program is distributed in the hope that it will be useful, 14 # but WITHOUT ANY WARRANTY; without even the implied warranty of 15 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 # GNU General Public License for more details. 17 # 18 # You should have received a copy of the GNU General Public License 19 # along with this program. If not, see <http://www.gnu.org/licenses/>. 20 21 # As a special exception to the GNU General Public License, if you 22 # distribute this file as part of a program that contains a 23 # configuration script generated by Autoconf, you may include it under 24 # the same distribution terms that you use for the rest of that program. 25 26 # This file is maintained in Automake, please report 27 # bugs to <bug-automake@gnu.org> or send patches to 28 # <automake-patches@gnu.org>. 29 30 # Make unconditional expansion of undefined variables an error. This 31 # helps a lot in preventing typo-related bugs. 32 set -u 33 34 usage_error () 35 { 36 echo "$0: $*" >&2 37 print_usage >&2 38 exit 2 39 } 40 41 print_usage () 42 { 43 cat <<END 44 Usage: 45 test-driver --test-name=NAME --log-file=PATH --trs-file=PATH 46 [--expect-failure={yes|no}] [--color-tests={yes|no}] 47 [--enable-hard-errors={yes|no}] [--] 48 TEST-SCRIPT [TEST-SCRIPT-ARGUMENTS] 49 The '--test-name', '--log-file' and '--trs-file' options are mandatory. 50 END 51 } 52 53 test_name= # Used for reporting. 54 log_file= # Where to save the output of the test script. 55 trs_file= # Where to save the metadata of the test run. 56 expect_failure=no 57 color_tests=no 58 enable_hard_errors=yes 59 while test $# -gt 0; do 60 case $1 in 61 --help) print_usage; exit $?;; 62 --version) echo "test-driver $scriptversion"; exit $?;; 63 --test-name) test_name=$2; shift;; 64 --log-file) log_file=$2; shift;; 65 --trs-file) trs_file=$2; shift;; 66 --color-tests) color_tests=$2; shift;; 67 --expect-failure) expect_failure=$2; shift;; 68 --enable-hard-errors) enable_hard_errors=$2; shift;; 69 --) shift; break;; 70 -*) usage_error "invalid option: '$1'";; 71 *) break;; 72 esac 73 shift 74 done 75 76 missing_opts= 77 test x"$test_name" = x && missing_opts="$missing_opts --test-name" 78 test x"$log_file" = x && missing_opts="$missing_opts --log-file" 79 test x"$trs_file" = x && missing_opts="$missing_opts --trs-file" 80 if test x"$missing_opts" != x; then 81 usage_error "the following mandatory options are missing:$missing_opts" 82 fi 83 84 if test $# -eq 0; then 85 usage_error "missing argument" 86 fi 87 88 if test $color_tests = yes; then 89 # Keep this in sync with 'lib/am/check.am:$(am__tty_colors)'. 90 red='[0;31m' # Red. 91 grn='[0;32m' # Green. 92 lgn='[1;32m' # Light green. 93 blu='[1;34m' # Blue. 94 mgn='[0;35m' # Magenta. 95 std='[m' # No color. 96 else 97 red= grn= lgn= blu= mgn= std= 98 fi 99 100 do_exit='rm -f $log_file $trs_file; (exit $st); exit $st' 101 trap "st=129; $do_exit" 1 102 trap "st=130; $do_exit" 2 103 trap "st=141; $do_exit" 13 104 trap "st=143; $do_exit" 15 105 106 # Test script is run here. 107 "$@" >$log_file 2>&1 108 estatus=$? 109 110 if test $enable_hard_errors = no && test $estatus -eq 99; then 111 tweaked_estatus=1 112 else 113 tweaked_estatus=$estatus 114 fi 115 116 case $tweaked_estatus:$expect_failure in 117 0:yes) col=$red res=XPASS recheck=yes gcopy=yes;; 118 0:*) col=$grn res=PASS recheck=no gcopy=no;; 119 77:*) col=$blu res=SKIP recheck=no gcopy=yes;; 120 99:*) col=$mgn res=ERROR recheck=yes gcopy=yes;; 121 *:yes) col=$lgn res=XFAIL recheck=no gcopy=yes;; 122 *:*) col=$red res=FAIL recheck=yes gcopy=yes;; 123 esac 124 125 # Report the test outcome and exit status in the logs, so that one can 126 # know whether the test passed or failed simply by looking at the '.log' 127 # file, without the need of also peaking into the corresponding '.trs' 128 # file (automake bug#11814). 129 echo "$res $test_name (exit status: $estatus)" >>$log_file 130 131 # Report outcome to console. 132 echo "${col}${res}${std}: $test_name" 133 134 # Register the test result, and other relevant metadata. 135 echo ":test-result: $res" > $trs_file 136 echo ":global-test-result: $res" >> $trs_file 137 echo ":recheck: $recheck" >> $trs_file 138 echo ":copy-in-global-log: $gcopy" >> $trs_file 139 140 # Local Variables: 141 # mode: shell-script 142 # sh-indentation: 2 143 # eval: (add-hook 'write-file-hooks 'time-stamp) 144 # time-stamp-start: "scriptversion=" 145 # time-stamp-format: "%:y-%02m-%02d.%02H" 146 # time-stamp-time-zone: "UTC" 147 # time-stamp-end: "; # UTC" 148 # End: 1 /usr/share/automake-1.15/test-driver -
Property mode
changed from
-
automake/ylwrap
-
Property mode
changed from
100755to120000
rf9feab8 r90152a4 1 #! /bin/sh 2 # ylwrap - wrapper for lex/yacc invocations. 3 4 scriptversion=2013-01-12.17; # UTC 5 6 # Copyright (C) 1996-2014 Free Software Foundation, Inc. 7 # 8 # Written by Tom Tromey <tromey@cygnus.com>. 9 # 10 # This program is free software; you can redistribute it and/or modify 11 # it under the terms of the GNU General Public License as published by 12 # the Free Software Foundation; either version 2, or (at your option) 13 # any later version. 14 # 15 # This program is distributed in the hope that it will be useful, 16 # but WITHOUT ANY WARRANTY; without even the implied warranty of 17 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 18 # GNU General Public License for more details. 19 # 20 # You should have received a copy of the GNU General Public License 21 # along with this program. If not, see <http://www.gnu.org/licenses/>. 22 23 # As a special exception to the GNU General Public License, if you 24 # distribute this file as part of a program that contains a 25 # configuration script generated by Autoconf, you may include it under 26 # the same distribution terms that you use for the rest of that program. 27 28 # This file is maintained in Automake, please report 29 # bugs to <bug-automake@gnu.org> or send patches to 30 # <automake-patches@gnu.org>. 31 32 get_dirname () 33 { 34 case $1 in 35 */*|*\\*) printf '%s\n' "$1" | sed -e 's|\([\\/]\)[^\\/]*$|\1|';; 36 # Otherwise, we want the empty string (not "."). 37 esac 38 } 39 40 # guard FILE 41 # ---------- 42 # The CPP macro used to guard inclusion of FILE. 43 guard () 44 { 45 printf '%s\n' "$1" \ 46 | sed \ 47 -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/' \ 48 -e 's/[^ABCDEFGHIJKLMNOPQRSTUVWXYZ]/_/g' \ 49 -e 's/__*/_/g' 50 } 51 52 # quote_for_sed [STRING] 53 # ---------------------- 54 # Return STRING (or stdin) quoted to be used as a sed pattern. 55 quote_for_sed () 56 { 57 case $# in 58 0) cat;; 59 1) printf '%s\n' "$1";; 60 esac \ 61 | sed -e 's|[][\\.*]|\\&|g' 62 } 63 64 case "$1" in 65 '') 66 echo "$0: No files given. Try '$0 --help' for more information." 1>&2 67 exit 1 68 ;; 69 --basedir) 70 basedir=$2 71 shift 2 72 ;; 73 -h|--h*) 74 cat <<\EOF 75 Usage: ylwrap [--help|--version] INPUT [OUTPUT DESIRED]... -- PROGRAM [ARGS]... 76 77 Wrapper for lex/yacc invocations, renaming files as desired. 78 79 INPUT is the input file 80 OUTPUT is one file PROG generates 81 DESIRED is the file we actually want instead of OUTPUT 82 PROGRAM is program to run 83 ARGS are passed to PROG 84 85 Any number of OUTPUT,DESIRED pairs may be used. 86 87 Report bugs to <bug-automake@gnu.org>. 88 EOF 89 exit $? 90 ;; 91 -v|--v*) 92 echo "ylwrap $scriptversion" 93 exit $? 94 ;; 95 esac 96 97 98 # The input. 99 input=$1 100 shift 101 # We'll later need for a correct munging of "#line" directives. 102 input_sub_rx=`get_dirname "$input" | quote_for_sed` 103 case $input in 104 [\\/]* | ?:[\\/]*) 105 # Absolute path; do nothing. 106 ;; 107 *) 108 # Relative path. Make it absolute. 109 input=`pwd`/$input 110 ;; 111 esac 112 input_rx=`get_dirname "$input" | quote_for_sed` 113 114 # Since DOS filename conventions don't allow two dots, 115 # the DOS version of Bison writes out y_tab.c instead of y.tab.c 116 # and y_tab.h instead of y.tab.h. Test to see if this is the case. 117 y_tab_nodot=false 118 if test -f y_tab.c || test -f y_tab.h; then 119 y_tab_nodot=true 120 fi 121 122 # The parser itself, the first file, is the destination of the .y.c 123 # rule in the Makefile. 124 parser=$1 125 126 # A sed program to s/FROM/TO/g for all the FROM/TO so that, for 127 # instance, we rename #include "y.tab.h" into #include "parse.h" 128 # during the conversion from y.tab.c to parse.c. 129 sed_fix_filenames= 130 131 # Also rename header guards, as Bison 2.7 for instance uses its header 132 # guard in its implementation file. 133 sed_fix_header_guards= 134 135 while test $# -ne 0; do 136 if test x"$1" = x"--"; then 137 shift 138 break 139 fi 140 from=$1 141 # Handle y_tab.c and y_tab.h output by DOS 142 if $y_tab_nodot; then 143 case $from in 144 "y.tab.c") from=y_tab.c;; 145 "y.tab.h") from=y_tab.h;; 146 esac 147 fi 148 shift 149 to=$1 150 shift 151 sed_fix_filenames="${sed_fix_filenames}s|"`quote_for_sed "$from"`"|$to|g;" 152 sed_fix_header_guards="${sed_fix_header_guards}s|"`guard "$from"`"|"`guard "$to"`"|g;" 153 done 154 155 # The program to run. 156 prog=$1 157 shift 158 # Make any relative path in $prog absolute. 159 case $prog in 160 [\\/]* | ?:[\\/]*) ;; 161 *[\\/]*) prog=`pwd`/$prog ;; 162 esac 163 164 dirname=ylwrap$$ 165 do_exit="cd '`pwd`' && rm -rf $dirname > /dev/null 2>&1;"' (exit $ret); exit $ret' 166 trap "ret=129; $do_exit" 1 167 trap "ret=130; $do_exit" 2 168 trap "ret=141; $do_exit" 13 169 trap "ret=143; $do_exit" 15 170 mkdir $dirname || exit 1 171 172 cd $dirname 173 174 case $# in 175 0) "$prog" "$input" ;; 176 *) "$prog" "$@" "$input" ;; 177 esac 178 ret=$? 179 180 if test $ret -eq 0; then 181 for from in * 182 do 183 to=`printf '%s\n' "$from" | sed "$sed_fix_filenames"` 184 if test -f "$from"; then 185 # If $2 is an absolute path name, then just use that, 186 # otherwise prepend '../'. 187 case $to in 188 [\\/]* | ?:[\\/]*) target=$to;; 189 *) target=../$to;; 190 esac 191 192 # Do not overwrite unchanged header files to avoid useless 193 # recompilations. Always update the parser itself: it is the 194 # destination of the .y.c rule in the Makefile. Divert the 195 # output of all other files to a temporary file so we can 196 # compare them to existing versions. 197 if test $from != $parser; then 198 realtarget=$target 199 target=tmp-`printf '%s\n' "$target" | sed 's|.*[\\/]||g'` 200 fi 201 202 # Munge "#line" or "#" directives. Don't let the resulting 203 # debug information point at an absolute srcdir. Use the real 204 # output file name, not yy.lex.c for instance. Adjust the 205 # include guards too. 206 sed -e "/^#/!b" \ 207 -e "s|$input_rx|$input_sub_rx|" \ 208 -e "$sed_fix_filenames" \ 209 -e "$sed_fix_header_guards" \ 210 "$from" >"$target" || ret=$? 211 212 # Check whether files must be updated. 213 if test "$from" != "$parser"; then 214 if test -f "$realtarget" && cmp -s "$realtarget" "$target"; then 215 echo "$to is unchanged" 216 rm -f "$target" 217 else 218 echo "updating $to" 219 mv -f "$target" "$realtarget" 220 fi 221 fi 222 else 223 # A missing file is only an error for the parser. This is a 224 # blatant hack to let us support using "yacc -d". If -d is not 225 # specified, don't fail when the header file is "missing". 226 if test "$from" = "$parser"; then 227 ret=1 228 fi 229 fi 230 done 231 fi 232 233 # Remove the directory. 234 cd .. 235 rm -rf $dirname 236 237 exit $ret 238 239 # Local Variables: 240 # mode: shell-script 241 # sh-indentation: 2 242 # eval: (add-hook 'write-file-hooks 'time-stamp) 243 # time-stamp-start: "scriptversion=" 244 # time-stamp-format: "%:y-%02m-%02d.%02H" 245 # time-stamp-time-zone: "UTC" 246 # time-stamp-end: "; # UTC" 247 # End: 1 /usr/share/automake-1.15/ylwrap -
Property mode
changed from
-
configure
rf9feab8 r90152a4 665 665 CXX 666 666 CFA_FLAGS 667 MACHINE_TYPE 667 LIBCFA_TARGET_MAKEFILES 668 LIBCFA_TARGET_DIRS 669 TARGET_HOSTS 670 HOST_FLAGS 668 671 host_os 669 672 host_vendor … … 674 677 build_cpu 675 678 build 679 BUILD_IN_TREE_FLAGS 680 CFACPP 681 CFACC 682 DRIVER_DIR 676 683 CFA_LIBDIR 677 684 CFA_BINDIR 678 685 CFA_INCDIR 679 686 CFA_PREFIX 680 BUILD_CONCURRENCY_FALSE681 BUILD_CONCURRENCY_TRUE682 BUILD_NO_LIB_FALSE683 BUILD_NO_LIB_TRUE684 BUILD_DEBUG_FALSE685 BUILD_DEBUG_TRUE686 BUILD_RELEASE_FALSE687 BUILD_RELEASE_TRUE688 687 CFA_BACKEND_CC 689 688 BACKEND_CC 689 DOendif 690 DOifskipcompile 690 691 CFA_NAME 691 MAINT692 MAINTAINER_MODE_FALSE693 MAINTAINER_MODE_TRUE694 692 am__untar 695 693 am__tar … … 762 760 enable_option_checking 763 761 enable_silent_rules 764 enable_maintainer_mode765 762 with_cfa_name 766 763 with_backend_compiler 767 enable_target_release 768 enable_target_debug 769 enable_threading 764 with_target_hosts 770 765 enable_dependency_tracking 771 766 ' … … 1417 1412 --enable-silent-rules less verbose build output (undo: "make V=1") 1418 1413 --disable-silent-rules verbose build output (undo: "make V=0") 1419 --disable-maintainer-mode1420 disable make rules and dependencies not useful (and1421 sometimes confusing) to the casual installer1422 --enable-target-release Build and install the release target1423 --enable-target-debug Build and install the debug target1424 --enable-threading Build and install libcfa with threading support1425 (Enabled by default)1426 1414 --enable-dependency-tracking 1427 1415 do not reject slow dependency extractors … … 1434 1422 --with-cfa-name=NAME NAME too which cfa will be installed 1435 1423 --with-backend-compiler=PROGRAM PROGRAM that performs the final code compilation (must be gcc-compatible) 1424 --with-target-hosts=HOSTS HOSTS comma seperated list of hosts to build for, format ARCH:debug|nodebug|nolib 1436 1425 1437 1426 Some influential environment variables: … … 2490 2479 2491 2480 #AC_CONFIG_SRCDIR([src/main.cc]) 2492 ac_config_headers="$ac_config_headers config.h "2481 ac_config_headers="$ac_config_headers config.h:src/config.h.in" 2493 2482 2494 2483 # Check whether --enable-silent-rules was given. … … 2500 2489 yes) AM_DEFAULT_VERBOSITY=0;; 2501 2490 no) AM_DEFAULT_VERBOSITY=1;; 2502 *) AM_DEFAULT_VERBOSITY= 1;;2491 *) AM_DEFAULT_VERBOSITY=0;; 2503 2492 esac 2504 2493 am_make=${MAKE-make} … … 2531 2520 AM_BACKSLASH='\' 2532 2521 2522 2523 2524 2525 2526 2527 2528 2529 2530 2531 # don't use the default CFLAGS as they unconditonnaly add -O2 2532 : ${CFLAGS=""} 2533 2533 2534 2534 am__api_version='1.15' … … 3073 3073 3074 3074 3075 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to enable maintainer-specific portions of Makefiles" >&53076 $as_echo_n "checking whether to enable maintainer-specific portions of Makefiles... " >&6; }3077 # Check whether --enable-maintainer-mode was given.3078 if test "${enable_maintainer_mode+set}" = set; then :3079 enableval=$enable_maintainer_mode; USE_MAINTAINER_MODE=$enableval3080 else3081 USE_MAINTAINER_MODE=yes3082 fi3083 3084 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $USE_MAINTAINER_MODE" >&53085 $as_echo "$USE_MAINTAINER_MODE" >&6; }3086 if test $USE_MAINTAINER_MODE = yes; then3087 MAINTAINER_MODE_TRUE=3088 MAINTAINER_MODE_FALSE='#'3089 else3090 MAINTAINER_MODE_TRUE='#'3091 MAINTAINER_MODE_FALSE=3092 fi3093 3094 MAINT=$MAINTAINER_MODE_TRUE3095 3096 # may require auto* software to be installed3097 3098 3075 # Allow program name tansformation 3099 3076 # will fill program_transform_name with appropriate sed regex 3100 3077 3101 3078 3079 #============================================================================== 3102 3080 #Trasforming cc1 will break compilation 3103 if test "${program_transform_name}" = ""; then 3104 as_fn_error $? "Program transform not supported. 3105 Use --with-cfa-name='[Desired name here]' instead" "$LINENO" 5 3106 fi 3107 3081 3082 if test "${program_transform_name}" = ""; then 3083 as_fn_error $? "Program transform not supported. 3084 Use --with-cfa-name='[Desired name here]' instead" "$LINENO" 5 3085 fi 3086 3087 #Define the new name of the installed command 3108 3088 3109 3089 # Check whether --with-cfa-name was given. … … 3115 3095 3116 3096 3117 #Define the new name of the installed command 3118 CFA_NAME=${cfa_name} 3119 3097 CFA_NAME=${cfa_name} 3098 3099 3100 3101 #============================================================================== 3102 # version information 3120 3103 3121 3104 rm -f version … … 3169 3152 3170 3153 3171 # Installation paths 3172 3154 #============================================================================== 3155 # HACK to be able to use conditionnals inside makefiles 3156 DOifskipcompile='ifeq ($(skipcompile),yes) 3157 else' 3158 3159 3160 3161 DOendif='endif' 3162 3163 3164 3165 #============================================================================== 3166 # backend compiler implementation 3173 3167 3174 3168 # Check whether --with-backend-compiler was given. … … 3180 3174 3181 3175 if test "x$backendcompiler" != "x"; then 3182 BACKEND_CC=${backendcompiler}3183 else 3184 # Extract the first word of "gcc", so it can be a program name with args.3176 BACKEND_CC=${backendcompiler} 3177 else 3178 # Extract the first word of "gcc", so it can be a program name with args. 3185 3179 set dummy gcc; ac_word=$2 3186 3180 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 … … 3221 3215 fi 3222 3216 3223 # check gcc installed3224 if test "x$BACKEND_CC" = "x"; then3225 as_fn_error $? "some version of gcc is needed. Get it at ftp://ftp.gnu.org" "$LINENO" 53226 exit 13227 fi3217 # check gcc installed 3218 if test "x$BACKEND_CC" = "x"; then 3219 as_fn_error $? "some version of gcc is needed. Get it at ftp://ftp.gnu.org" "$LINENO" 5 3220 exit 1 3221 fi 3228 3222 fi 3229 3223 … … 3234 3228 3235 3229 3236 3237 3238 # Check whether --enable-target-release was given. 3239 if test "${enable_target_release+set}" = set; then : 3240 enableval=$enable_target_release; 3241 fi 3242 3243 # Check whether --enable-target-debug was given. 3244 if test "${enable_target_debug+set}" = set; then : 3245 enableval=$enable_target_debug; 3246 fi 3247 3248 # Check whether --enable-threading was given. 3249 if test "${enable_threading+set}" = set; then : 3250 enableval=$enable_threading; case "${enableval}" in 3251 yes) build_threading="yes" ;; 3252 no) build_threading="no" ;; 3253 *) as_fn_error $? "bad value ${enableval} for --enable-debug" "$LINENO" 5 ;; 3254 esac 3255 else 3256 build_threading="yes" 3257 fi 3258 3259 3260 case "$enable_target_release" in 3261 yes) 3262 case "$enable_target_debug" in 3263 yes) 3264 build_release="yes" 3265 build_debug="yes" 3266 ;; 3267 no) 3268 build_release="yes" 3269 build_debug="no" 3270 ;; 3271 *) 3272 build_release="yes" 3273 build_debug="no" 3274 ;; 3275 esac 3276 ;; 3277 no) 3278 case "$enable_target_debug" in 3279 yes) 3280 build_release="no" 3281 build_debug="yes" 3282 ;; 3283 no) 3284 build_release="no" 3285 build_debug="no" 3286 ;; 3287 *) 3288 build_release="no" 3289 build_debug="yes" 3290 ;; 3291 esac 3292 ;; 3293 *) 3294 case "$enable_target_debug" in 3295 yes) 3296 build_release="no" 3297 build_debug="yes" 3298 ;; 3299 no) 3300 build_release="yes" 3301 build_debug="no" 3302 ;; 3303 *) 3304 build_release="yes" 3305 build_debug="yes" 3306 ;; 3307 esac 3308 ;; 3309 esac 3310 3311 if test "x$build_release" = "xyes"; then 3312 BUILD_RELEASE_TRUE= 3313 BUILD_RELEASE_FALSE='#' 3314 else 3315 BUILD_RELEASE_TRUE='#' 3316 BUILD_RELEASE_FALSE= 3317 fi 3318 3319 if test "x$build_debug" = "xyes"; then 3320 BUILD_DEBUG_TRUE= 3321 BUILD_DEBUG_FALSE='#' 3322 else 3323 BUILD_DEBUG_TRUE='#' 3324 BUILD_DEBUG_FALSE= 3325 fi 3326 3327 if test "x$build_release$build_debug" = "xnono"; then 3328 BUILD_NO_LIB_TRUE= 3329 BUILD_NO_LIB_FALSE='#' 3330 else 3331 BUILD_NO_LIB_TRUE='#' 3332 BUILD_NO_LIB_FALSE= 3333 fi 3334 3335 if test "x$build_threading" = "xyes"; then 3336 BUILD_CONCURRENCY_TRUE= 3337 BUILD_CONCURRENCY_FALSE='#' 3338 else 3339 BUILD_CONCURRENCY_TRUE='#' 3340 BUILD_CONCURRENCY_FALSE= 3341 fi 3342 3343 3344 if test "x$prefix" = "xNONE"; then 3345 cfa_prefix=${ac_default_prefix} 3346 else 3347 cfa_prefix=${prefix} 3348 fi 3230 #============================================================================== 3231 # Installation paths 3232 3233 if test "x$prefix" = "xNONE"; then 3234 cfa_prefix=${ac_default_prefix} 3235 else 3236 cfa_prefix=${prefix} 3237 fi 3238 cfa_prefix="$(readlink -m ${cfa_prefix})/" 3349 3239 3350 3240 cat >>confdefs.h <<_ACEOF … … 3352 3242 _ACEOF 3353 3243 3354 CFA_PREFIX=${cfa_prefix} 3355 3356 3357 if test "$includedir" = '${prefix}/include'; then 3358 cfa_incdir="${cfa_prefix}/include/${cfa_name}" 3359 else 3360 cfa_incdir=${includedir} 3361 fi 3244 CFA_PREFIX=${cfa_prefix} 3245 3246 3247 if test "$includedir" = '${prefix}/include'; then 3248 cfa_incdir="${cfa_prefix}include/${cfa_name}" 3249 else 3250 cfa_incdir=${includedir} 3251 fi 3252 cfa_incdir="$(readlink -m ${cfa_incdir})/" 3362 3253 3363 3254 cat >>confdefs.h <<_ACEOF … … 3365 3256 _ACEOF 3366 3257 3367 CFA_INCDIR=${cfa_incdir} 3368 3369 3370 if test "$bindir" = '${exec_prefix}/bin'; then 3371 cfa_bindir="${cfa_prefix}/bin" 3372 else 3373 cfa_bindir=${bindir} 3374 fi 3258 CFA_INCDIR=${cfa_incdir} 3259 3260 3261 if test "$bindir" = '${exec_prefix}/bin'; then 3262 cfa_bindir="${cfa_prefix}bin" 3263 else 3264 cfa_bindir=${bindir} 3265 fi 3266 cfa_bindir="$(readlink -m ${cfa_bindir})/" 3375 3267 3376 3268 cat >>confdefs.h <<_ACEOF … … 3378 3270 _ACEOF 3379 3271 3380 CFA_BINDIR=${cfa_bindir} 3381 3382 3383 if test "$libdir" = '${exec_prefix}/lib'; then 3384 cfa_libdir="${cfa_prefix}/lib/${cfa_name}" 3385 else 3386 cfa_libdir=${libdir} 3387 fi 3272 CFA_BINDIR=${cfa_bindir} 3273 3274 3275 if test "$libdir" = '${exec_prefix}/lib'; then 3276 if test "${ARCHITECTURE}" != ""; then 3277 cfa_libdir="${cfa_prefix}lib/${cfa_name}/${ARCHITECTURE}-${CONFIGURATION}/" 3278 else 3279 cfa_libdir="${cfa_prefix}lib/${cfa_name}/" 3280 fi 3281 else 3282 cfa_libdir="${libdir}/${ARCHITECTURE}${CONFIGURATION}" 3283 fi 3284 cfa_libdir="$(readlink -m ${cfa_libdir})/" 3388 3285 3389 3286 cat >>confdefs.h <<_ACEOF … … 3391 3288 _ACEOF 3392 3289 3393 CFA_LIBDIR=${cfa_libdir} 3394 3395 3290 CFA_LIBDIR=${cfa_libdir} 3291 3292 3293 3294 #============================================================================== 3295 # Create variables for commonly used targets 3296 3297 TOP_SRCDIR="$(readlink -m $ac_confdir/)/" 3298 TOP_BUILDDIR="$(readlink -m $ac_pwd/)/" 3299 3300 3301 cat >>confdefs.h <<_ACEOF 3302 #define TOP_SRCDIR "$TOP_SRCDIR" 3303 _ACEOF 3304 3305 3306 cat >>confdefs.h <<_ACEOF 3307 #define TOP_BUILDDIR "$TOP_BUILDDIR" 3308 _ACEOF 3309 3310 3311 DRIVER_DIR=${TOP_BUILDDIR}driver/ 3312 CFACC=${DRIVER_DIR}cfa 3313 CFACPP=${DRIVER_DIR}cfa-cpp 3314 3315 3316 3317 3318 #============================================================================== 3319 # Flag variables needed to build in tree 3320 LIBCFA_SRC='${TOP_SRCDIR}/libcfa/src' 3321 BUILD_IN_TREE_FLAGS="-XCFA -t -B${DRIVER_DIR}" 3322 3323 3324 #============================================================================== 3325 # handle the list of hosts to build for 3326 for var in $ac_configure_args 3327 do 3328 #strip quotes surrouding values 3329 case $var in 3330 # skip cross compilation related arguments 3331 \'--host=*) ;; \'host_alias=*) ;; \'--build=*) ;; \'build_alias=*) ;; \'--target=*) ;; \'target_alias=*) ;; 3332 3333 # skip the target hosts 3334 \'--with-target-hosts=*) ;; 3335 3336 # append all other arguments to the sub configure arguments 3337 *) LIBCFA_GENERAL_ARGS="${LIBCFA_GENERAL_ARGS} $var";; 3338 esac 3339 done 3340 3341 #============================================================================== 3342 # handle the list of hosts to build for 3396 3343 # Make sure we can run config.sub. 3397 3344 $SHELL "$ac_aux_dir/config.sub" sun4 >/dev/null 2>&1 || … … 3465 3412 3466 3413 3467 MACHINE_TYPE=$host_cpu3468 3469 3414 3470 3415 if ! test "$host_cpu" = "$build_cpu"; then 3471 3416 case $host_cpu in 3472 3417 i386) 3473 CFLAGS+=" -m32 " 3474 CXXFLAGS+=" -m32 " 3475 CFAFLAGS+=" -m32 " 3476 LDFLAGS+=" -m32 " 3418 HOST_FLAGS="-m32" 3477 3419 ;; 3478 3420 i686) 3479 CFLAGS+=" -m32 " 3480 CXXFLAGS+=" -m32 " 3481 CFAFLAGS+=" -m32 " 3482 LDFLAGS+=" -m32 " 3421 HOST_FLAGS="-m32" 3483 3422 ;; 3484 3423 x86_64) 3485 CFLAGS+=" -m64 " 3486 CXXFLAGS+=" -m64 " 3487 CFAFLAGS+=" -m64 " 3488 LDFLAGS+=" -m64 " 3424 HOST_FLAGS="-m64" 3489 3425 ;; 3490 3426 esac … … 3492 3428 3493 3429 3430 default_target="${host_cpu}:debug, ${host_cpu}:nodebug" 3431 3432 # Check whether --with-target-hosts was given. 3433 if test "${with_target_hosts+set}" = set; then : 3434 withval=$with_target_hosts; target_hosts=$withval 3435 else 3436 target_hosts=${default_target} 3437 fi 3438 3439 3440 TARGET_HOSTS=${target_hosts} 3441 3442 3443 LIBCFA_PATHS="DRIVER_DIR=${DRIVER_DIR}" 3444 3445 for i in $(echo $target_hosts | sed "s/,/ /g") 3446 do 3447 # call your procedure/other scripts here below 3448 arch_name=$(echo $i | sed -r "s/:(.*)//g") 3449 lib_config=$(echo $i | sed -r "s/(.*)://g") 3450 3451 case $lib_config in 3452 "nodebug") ;; 3453 "debug") ;; 3454 "nolib") ;; 3455 *) 3456 >&2 echo "Configuration must be 'debug', 'nodebug' or 'nolib'" 3457 exit 1 3458 ;; 3459 esac 3460 3461 3462 case ${arch_name} in 3463 "host") arch_name=${host_cpu};; 3464 *) arch_name=${arch_name};; 3465 esac 3466 3467 case $arch_name in 3468 "x64" ) cannon_arch_name="x64";; 3469 "x86-64" ) cannon_arch_name="x64";; 3470 "x86_64" ) cannon_arch_name="x64";; 3471 "x86" ) cannon_arch_name="x86";; 3472 "i386" ) cannon_arch_name="x86";; 3473 "i486" ) cannon_arch_name="x86";; 3474 "i686" ) cannon_arch_name="x86";; 3475 "Intel 80386") cannon_arch_name="x86";; 3476 "arm" ) cannon_arch_name="arm";; 3477 "ARM" ) cannon_arch_name="arm";; 3478 *) 3479 >&2 echo "Unkown architecture " $arch_name; 3480 exit 1 3481 ;; 3482 esac 3483 3484 lib_arch=${cannon_arch_name} 3485 lib_dir="libcfa/${lib_arch}-${lib_config}" 3486 3487 LIBCFA_TARGET_DIRS="${LIBCFA_TARGET_DIRS} ${lib_dir}" 3488 LIBCFA_TARGET_MAKEFILES="${LIBCFA_TARGET_MAKEFILES} ${lib_dir}/Makefile" 3489 3490 mkdir -p ${lib_dir} 3491 echo -n "${LIBCFA_GENERAL_ARGS} " > ${lib_dir}/config.data 3492 echo -n "${LIBCFA_PATHS} " >> ${lib_dir}/config.data 3493 echo -n "ARCHITECTURE=${lib_arch} " >> ${lib_dir}/config.data 3494 echo -n "CONFIGURATION=${lib_config}" >> ${lib_dir}/config.data 3495 done 3496 3497 3498 3499 3500 3501 case ${host_cpu} in 3502 "host") arch_name=${host_cpu};; 3503 *) arch_name=${host_cpu};; 3504 esac 3505 3506 case $arch_name in 3507 "x64" ) cannon_arch_name="x64";; 3508 "x86-64" ) cannon_arch_name="x64";; 3509 "x86_64" ) cannon_arch_name="x64";; 3510 "x86" ) cannon_arch_name="x86";; 3511 "i386" ) cannon_arch_name="x86";; 3512 "i486" ) cannon_arch_name="x86";; 3513 "i686" ) cannon_arch_name="x86";; 3514 "Intel 80386") cannon_arch_name="x86";; 3515 "arm" ) cannon_arch_name="arm";; 3516 "ARM" ) cannon_arch_name="arm";; 3517 *) 3518 >&2 echo "Unkown architecture " $arch_name; 3519 exit 1 3520 ;; 3521 esac 3522 3523 3524 cat >>confdefs.h <<_ACEOF 3525 #define CFA_DEFAULT_CPU "$cannon_arch_name" 3526 _ACEOF 3527 3528 3529 cat >>confdefs.h <<_ACEOF 3530 #define CFA_64_CPU "x64" 3531 _ACEOF 3532 3533 3534 cat >>confdefs.h <<_ACEOF 3535 #define CFA_32_CPU "x86" 3536 _ACEOF 3537 3538 3539 #============================================================================== 3540 # CAFLAGS 3541 3494 3542 cat >>confdefs.h <<_ACEOF 3495 3543 #define CFA_FLAGS "${CFAFLAGS}" … … 3499 3547 3500 3548 3549 #============================================================================== 3501 3550 # Checks for programs. 3502 3551 ac_ext=cpp … … 6281 6330 6282 6331 6283 ac_config_files="$ac_config_files Makefile src/driver/Makefile src/Makefile src/benchmark/Makefile src/examples/Makefile src/tests/Makefile src/tests/preempt_longrun/Makefile src/prelude/Makefile src/libcfa/Makefile tools/Makefile tools/prettyprinter/Makefile" 6284 6332 #============================================================================== 6333 ac_config_files="$ac_config_files Makefile driver/Makefile src/Makefile benchmark/Makefile tests/Makefile tests/preempt_longrun/Makefile tools/Makefile tools/prettyprinter/Makefile" 6334 6335 6336 ac_config_links="$ac_config_links tests/test.py:tests/test.py" 6337 6338 6339 ac_config_files="$ac_config_files tests/config.py" 6285 6340 6286 6341 cat >confcache <<\_ACEOF … … 6409 6464 fi 6410 6465 6411 if test -z "${MAINTAINER_MODE_TRUE}" && test -z "${MAINTAINER_MODE_FALSE}"; then6412 as_fn_error $? "conditional \"MAINTAINER_MODE\" was never defined.6413 Usually this means the macro was only invoked conditionally." "$LINENO" 56414 fi6415 if test -z "${BUILD_RELEASE_TRUE}" && test -z "${BUILD_RELEASE_FALSE}"; then6416 as_fn_error $? "conditional \"BUILD_RELEASE\" was never defined.6417 Usually this means the macro was only invoked conditionally." "$LINENO" 56418 fi6419 if test -z "${BUILD_DEBUG_TRUE}" && test -z "${BUILD_DEBUG_FALSE}"; then6420 as_fn_error $? "conditional \"BUILD_DEBUG\" was never defined.6421 Usually this means the macro was only invoked conditionally." "$LINENO" 56422 fi6423 if test -z "${BUILD_NO_LIB_TRUE}" && test -z "${BUILD_NO_LIB_FALSE}"; then6424 as_fn_error $? "conditional \"BUILD_NO_LIB\" was never defined.6425 Usually this means the macro was only invoked conditionally." "$LINENO" 56426 fi6427 if test -z "${BUILD_CONCURRENCY_TRUE}" && test -z "${BUILD_CONCURRENCY_FALSE}"; then6428 as_fn_error $? "conditional \"BUILD_CONCURRENCY\" was never defined.6429 Usually this means the macro was only invoked conditionally." "$LINENO" 56430 fi6431 6466 if test -z "${AMDEP_TRUE}" && test -z "${AMDEP_FALSE}"; then 6432 6467 as_fn_error $? "conditional \"AMDEP\" was never defined. … … 6869 6904 config_files="$ac_config_files" 6870 6905 config_headers="$ac_config_headers" 6906 config_links="$ac_config_links" 6871 6907 config_commands="$ac_config_commands" 6872 6908 … … 6898 6934 Configuration headers: 6899 6935 $config_headers 6936 6937 Configuration links: 6938 $config_links 6900 6939 6901 6940 Configuration commands: … … 7037 7076 do 7038 7077 case $ac_config_target in 7039 "config.h") CONFIG_HEADERS="$CONFIG_HEADERS config.h " ;;7078 "config.h") CONFIG_HEADERS="$CONFIG_HEADERS config.h:src/config.h.in" ;; 7040 7079 "depfiles") CONFIG_COMMANDS="$CONFIG_COMMANDS depfiles" ;; 7041 7080 "Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;; 7042 " src/driver/Makefile") CONFIG_FILES="$CONFIG_FILES src/driver/Makefile" ;;7081 "driver/Makefile") CONFIG_FILES="$CONFIG_FILES driver/Makefile" ;; 7043 7082 "src/Makefile") CONFIG_FILES="$CONFIG_FILES src/Makefile" ;; 7044 "src/benchmark/Makefile") CONFIG_FILES="$CONFIG_FILES src/benchmark/Makefile" ;; 7045 "src/examples/Makefile") CONFIG_FILES="$CONFIG_FILES src/examples/Makefile" ;; 7046 "src/tests/Makefile") CONFIG_FILES="$CONFIG_FILES src/tests/Makefile" ;; 7047 "src/tests/preempt_longrun/Makefile") CONFIG_FILES="$CONFIG_FILES src/tests/preempt_longrun/Makefile" ;; 7048 "src/prelude/Makefile") CONFIG_FILES="$CONFIG_FILES src/prelude/Makefile" ;; 7049 "src/libcfa/Makefile") CONFIG_FILES="$CONFIG_FILES src/libcfa/Makefile" ;; 7083 "benchmark/Makefile") CONFIG_FILES="$CONFIG_FILES benchmark/Makefile" ;; 7084 "tests/Makefile") CONFIG_FILES="$CONFIG_FILES tests/Makefile" ;; 7085 "tests/preempt_longrun/Makefile") CONFIG_FILES="$CONFIG_FILES tests/preempt_longrun/Makefile" ;; 7050 7086 "tools/Makefile") CONFIG_FILES="$CONFIG_FILES tools/Makefile" ;; 7051 7087 "tools/prettyprinter/Makefile") CONFIG_FILES="$CONFIG_FILES tools/prettyprinter/Makefile" ;; 7088 "tests/test.py") CONFIG_LINKS="$CONFIG_LINKS tests/test.py:tests/test.py" ;; 7089 "tests/config.py") CONFIG_FILES="$CONFIG_FILES tests/config.py" ;; 7052 7090 7053 7091 *) as_fn_error $? "invalid argument: \`$ac_config_target'" "$LINENO" 5;; … … 7063 7101 test "${CONFIG_FILES+set}" = set || CONFIG_FILES=$config_files 7064 7102 test "${CONFIG_HEADERS+set}" = set || CONFIG_HEADERS=$config_headers 7103 test "${CONFIG_LINKS+set}" = set || CONFIG_LINKS=$config_links 7065 7104 test "${CONFIG_COMMANDS+set}" = set || CONFIG_COMMANDS=$config_commands 7066 7105 fi … … 7360 7399 7361 7400 7362 eval set X " :F $CONFIG_FILES :H $CONFIG_HEADERS :C $CONFIG_COMMANDS"7401 eval set X " :F $CONFIG_FILES :H $CONFIG_HEADERS :L $CONFIG_LINKS :C $CONFIG_COMMANDS" 7363 7402 shift 7364 7403 for ac_tag … … 7637 7676 s/.*/./; q'`/stamp-h$_am_stamp_count 7638 7677 ;; 7639 7678 :L) 7679 # 7680 # CONFIG_LINK 7681 # 7682 7683 if test "$ac_source" = "$ac_file" && test "$srcdir" = '.'; then 7684 : 7685 else 7686 # Prefer the file from the source tree if names are identical. 7687 if test "$ac_source" = "$ac_file" || test ! -r "$ac_source"; then 7688 ac_source=$srcdir/$ac_source 7689 fi 7690 7691 { $as_echo "$as_me:${as_lineno-$LINENO}: linking $ac_source to $ac_file" >&5 7692 $as_echo "$as_me: linking $ac_source to $ac_file" >&6;} 7693 7694 if test ! -r "$ac_source"; then 7695 as_fn_error $? "$ac_source: file not found" "$LINENO" 5 7696 fi 7697 rm -f "$ac_file" 7698 7699 # Try a relative symlink, then a hard link, then a copy. 7700 case $ac_source in 7701 [\\/$]* | ?:[\\/]* ) ac_rel_source=$ac_source ;; 7702 *) ac_rel_source=$ac_top_build_prefix$ac_source ;; 7703 esac 7704 ln -s "$ac_rel_source" "$ac_file" 2>/dev/null || 7705 ln "$ac_source" "$ac_file" 2>/dev/null || 7706 cp -p "$ac_source" "$ac_file" || 7707 as_fn_error $? "cannot link or copy $ac_source to $ac_file" "$LINENO" 5 7708 fi 7709 ;; 7640 7710 :C) { $as_echo "$as_me:${as_lineno-$LINENO}: executing $ac_file commands" >&5 7641 7711 $as_echo "$as_me: executing $ac_file commands" >&6;} … … 7777 7847 7778 7848 7779 if test -z "$BUILD_RELEASE_TRUE"; then :7780 if test -z "$BUILD_DEBUG_TRUE"; then :7781 { $as_echo "$as_me:${as_lineno-$LINENO}: Building libcfa for target: release & debug" >&57782 $as_echo "$as_me: Building libcfa for target: release & debug" >&6;}7783 else7784 { $as_echo "$as_me:${as_lineno-$LINENO}: Building libcfa for target: release" >&57785 $as_echo "$as_me: Building libcfa for target: release" >&6;}7786 fi7787 else7788 if test -z "$BUILD_DEBUG_TRUE"; then :7789 { $as_echo "$as_me:${as_lineno-$LINENO}: Building libcfa for target: debug" >&57790 $as_echo "$as_me: Building libcfa for target: debug" >&6;}7791 else7792 { $as_echo "$as_me:${as_lineno-$LINENO}: Running cfa without libcfa" >&57793 $as_echo "$as_me: Running cfa without libcfa" >&6;}7794 fi7795 fi7796 7797 7849 # Final text 7798 7850 { $as_echo "$as_me:${as_lineno-$LINENO}: result: Cforall configuraton completed. Type \"make -j 8 install\"." >&5 -
configure.ac
rf9feab8 r90152a4 6 6 AC_CONFIG_AUX_DIR([automake]) 7 7 #AC_CONFIG_SRCDIR([src/main.cc]) 8 AC_CONFIG_HEADERS([config.h]) 9 AM_SILENT_RULES([no]) 8 AC_CONFIG_HEADERS([config.h:src/config.h.in]) 9 AM_SILENT_RULES([yes]) 10 11 m4_include([automake/cfa.m4]) 12 13 # don't use the default CFLAGS as they unconditonnaly add -O2 14 : ${CFLAGS=""} 10 15 11 16 AM_INIT_AUTOMAKE([subdir-objects]) 12 AM_MAINTAINER_MODE(enable) # may require auto* software to be installed13 17 14 18 # Allow program name tansformation … … 16 20 AC_ARG_PROGRAM 17 21 22 #============================================================================== 18 23 #Trasforming cc1 will break compilation 19 if test "${program_transform_name}" = ""; then 20 AC_MSG_ERROR([Program transform not supported. 21 Use --with-cfa-name='[[Desired name here]]' instead]) 22 fi 23 24 AC_ARG_WITH(cfa-name, 25 [ --with-cfa-name=NAME NAME too which cfa will be installed], 26 cfa_name=$withval, cfa_name="cfa") 27 28 #Define the new name of the installed command 29 AC_SUBST(CFA_NAME, ${cfa_name}) 24 M4CFA_PROGRAM_NAME 25 26 #============================================================================== 27 # version information 30 28 31 29 rm -f version … … 47 45 AC_DEFINE_UNQUOTED(CFA_VERSION_FULL, ["${ver_major}.${ver_minor}.${ver_patch}.${ver_build}"], [Major.Minor.Patch.Build]) 48 46 49 # Installation paths 50 47 #============================================================================== 48 # HACK to be able to use conditionnals inside makefiles 49 DOifskipcompile='ifeq ($(skipcompile),yes) 50 else' 51 AC_SUBST([DOifskipcompile]) 52 AM_SUBST_NOTMAKE([DOifskipcompile]) 53 54 DOendif='endif' 55 AC_SUBST([DOendif]) 56 AM_SUBST_NOTMAKE([DOendif]) 57 58 #============================================================================== 59 # backend compiler implementation 51 60 AC_ARG_WITH(backend-compiler, 52 [ --with-backend-compiler=PROGRAM PROGRAM that performs the final code compilation (must be gcc-compatible) ],53 backendcompiler=$withval, backendcompiler="")61 [ --with-backend-compiler=PROGRAM PROGRAM that performs the final code compilation (must be gcc-compatible) ], 62 backendcompiler=$withval, backendcompiler="") 54 63 if test "x$backendcompiler" != "x"; then 55 BACKEND_CC=${backendcompiler}64 BACKEND_CC=${backendcompiler} 56 65 else 57 AC_PATH_PROG(BACKEND_CC, gcc, [])# check gcc installed58 if test "x$BACKEND_CC" = "x"; then59 AC_MSG_ERROR(some version of gcc is needed. Get it at ftp://ftp.gnu.org)60 exit 161 fi66 AC_PATH_PROG(BACKEND_CC, gcc, []) # check gcc installed 67 if test "x$BACKEND_CC" = "x"; then 68 AC_MSG_ERROR(some version of gcc is needed. Get it at ftp://ftp.gnu.org) 69 exit 1 70 fi 62 71 fi 63 72 AC_DEFINE_UNQUOTED(CFA_BACKEND_CC, "${BACKEND_CC}", [Location of include files.]) 64 73 AC_SUBST(CFA_BACKEND_CC) 65 74 66 67 68 AC_ARG_ENABLE(target-release, AS_HELP_STRING([--enable-target-release], [Build and install the release target])) 69 AC_ARG_ENABLE(target-debug, AS_HELP_STRING([--enable-target-debug], [Build and install the debug target])) 70 AC_ARG_ENABLE(threading, AS_HELP_STRING([--enable-threading], [Build and install libcfa with threading support (Enabled by default)]), 71 [case "${enableval}" in 72 yes) build_threading="yes" ;; 73 no) build_threading="no" ;; 74 *) AC_MSG_ERROR([bad value ${enableval} for --enable-debug]) ;; 75 esac],[build_threading="yes"]) 76 77 case "$enable_target_release" in 78 yes) 79 case "$enable_target_debug" in 80 yes) 81 build_release="yes" 82 build_debug="yes" 83 ;; 84 no) 85 build_release="yes" 86 build_debug="no" 87 ;; 88 *) 89 build_release="yes" 90 build_debug="no" 91 ;; 92 esac 93 ;; 94 no) 95 case "$enable_target_debug" in 96 yes) 97 build_release="no" 98 build_debug="yes" 99 ;; 100 no) 101 build_release="no" 102 build_debug="no" 103 ;; 104 *) 105 build_release="no" 106 build_debug="yes" 107 ;; 108 esac 109 ;; 110 *) 111 case "$enable_target_debug" in 112 yes) 113 build_release="no" 114 build_debug="yes" 115 ;; 116 no) 117 build_release="yes" 118 build_debug="no" 119 ;; 120 *) 121 build_release="yes" 122 build_debug="yes" 123 ;; 124 esac 125 ;; 126 esac 127 128 AM_CONDITIONAL([BUILD_RELEASE], [test "x$build_release" = "xyes"]) 129 AM_CONDITIONAL([BUILD_DEBUG], [test "x$build_debug" = "xyes"]) 130 AM_CONDITIONAL([BUILD_NO_LIB], [test "x$build_release$build_debug" = "xnono"]) 131 AM_CONDITIONAL([BUILD_CONCURRENCY], [test "x$build_threading" = "xyes"]) 132 133 if test "x$prefix" = "xNONE"; then 134 cfa_prefix=${ac_default_prefix} 135 else 136 cfa_prefix=${prefix} 137 fi 138 AC_DEFINE_UNQUOTED(CFA_PREFIX, "${cfa_prefix}", [Location of cfa install.]) 139 AC_SUBST(CFA_PREFIX, ${cfa_prefix}) 140 141 if test "$includedir" = '${prefix}/include'; then 142 cfa_incdir="${cfa_prefix}/include/${cfa_name}" 143 else 144 cfa_incdir=${includedir} 145 fi 146 AC_DEFINE_UNQUOTED(CFA_INCDIR, "${cfa_incdir}", [Location of include files.]) 147 AC_SUBST(CFA_INCDIR, ${cfa_incdir}) 148 149 if test "$bindir" = '${exec_prefix}/bin'; then 150 cfa_bindir="${cfa_prefix}/bin" 151 else 152 cfa_bindir=${bindir} 153 fi 154 AC_DEFINE_UNQUOTED(CFA_BINDIR, "${cfa_bindir}", [Location of cfa command.]) 155 AC_SUBST(CFA_BINDIR, ${cfa_bindir}) 156 157 if test "$libdir" = '${exec_prefix}/lib'; then 158 cfa_libdir="${cfa_prefix}/lib/${cfa_name}" 159 else 160 cfa_libdir=${libdir} 161 fi 162 AC_DEFINE_UNQUOTED(CFA_LIBDIR, "${cfa_libdir}", [Location of cc1 and cfa-cpp commands.]) 163 AC_SUBST(CFA_LIBDIR, ${cfa_libdir}) 164 75 #============================================================================== 76 # Installation paths 77 M4CFA_PARSE_PREFIX 78 79 #============================================================================== 80 # Create variables for commonly used targets 81 82 TOP_SRCDIR="$(readlink -m $ac_confdir/)/" 83 TOP_BUILDDIR="$(readlink -m $ac_pwd/)/" 84 85 AC_DEFINE_UNQUOTED(TOP_SRCDIR, "$TOP_SRCDIR", [Top src directory]) 86 AC_DEFINE_UNQUOTED(TOP_BUILDDIR, "$TOP_BUILDDIR", [Top build directory]) 87 88 DRIVER_DIR=${TOP_BUILDDIR}driver/ 89 CFACC=${DRIVER_DIR}cfa 90 CFACPP=${DRIVER_DIR}cfa-cpp 91 AC_SUBST(DRIVER_DIR) 92 AC_SUBST(CFACC) 93 AC_SUBST(CFACPP) 94 95 #============================================================================== 96 # Flag variables needed to build in tree 97 LIBCFA_SRC='${TOP_SRCDIR}/libcfa/src' 98 BUILD_IN_TREE_FLAGS="-XCFA -t -B${DRIVER_DIR}" 99 AC_SUBST(BUILD_IN_TREE_FLAGS) 100 101 #============================================================================== 102 # handle the list of hosts to build for 103 for var in $ac_configure_args 104 do 105 #strip quotes surrouding values 106 case $var in 107 # skip cross compilation related arguments 108 \'--host=*) ;; \'host_alias=*) ;; \'--build=*) ;; \'build_alias=*) ;; \'--target=*) ;; \'target_alias=*) ;; 109 110 # skip the target hosts 111 \'--with-target-hosts=*) ;; 112 113 # append all other arguments to the sub configure arguments 114 *) LIBCFA_GENERAL_ARGS="${LIBCFA_GENERAL_ARGS} $var";; 115 esac 116 done 117 118 #============================================================================== 119 # handle the list of hosts to build for 165 120 AC_CANONICAL_BUILD 166 121 AC_CANONICAL_HOST 167 AC_SUBST([MACHINE_TYPE],[$host_cpu])168 122 169 123 if ! test "$host_cpu" = "$build_cpu"; then 170 124 case $host_cpu in 171 125 i386) 172 CFLAGS+=" -m32 " 173 CXXFLAGS+=" -m32 " 174 CFAFLAGS+=" -m32 " 175 LDFLAGS+=" -m32 " 126 HOST_FLAGS="-m32" 176 127 ;; 177 128 i686) 178 CFLAGS+=" -m32 " 179 CXXFLAGS+=" -m32 " 180 CFAFLAGS+=" -m32 " 181 LDFLAGS+=" -m32 " 129 HOST_FLAGS="-m32" 182 130 ;; 183 131 x86_64) 184 CFLAGS+=" -m64 " 185 CXXFLAGS+=" -m64 " 186 CFAFLAGS+=" -m64 " 187 LDFLAGS+=" -m64 " 132 HOST_FLAGS="-m64" 188 133 ;; 189 134 esac 190 135 fi 191 136 AC_SUBST(HOST_FLAGS) 137 138 default_target="${host_cpu}:debug, ${host_cpu}:nodebug" 139 AC_ARG_WITH(target-hosts, 140 [ --with-target-hosts=HOSTS HOSTS comma seperated list of hosts to build for, format ARCH:[debug|nodebug|nolib]], 141 target_hosts=$withval, target_hosts=${default_target}) 142 143 AC_SUBST(TARGET_HOSTS, ${target_hosts}) 144 145 LIBCFA_PATHS="DRIVER_DIR=${DRIVER_DIR}" 146 147 for i in $(echo $target_hosts | sed "s/,/ /g") 148 do 149 # call your procedure/other scripts here below 150 arch_name=$(echo $i | sed -r "s/:(.*)//g") 151 lib_config=$(echo $i | sed -r "s/(.*)://g") 152 153 case $lib_config in 154 "nodebug") ;; 155 "debug") ;; 156 "nolib") ;; 157 *) 158 >&2 echo "Configuration must be 'debug', 'nodebug' or 'nolib'" 159 exit 1 160 ;; 161 esac 162 163 M4CFA_CANNON_CPU([${arch_name}]) 164 lib_arch=${cannon_arch_name} 165 lib_dir="libcfa/${lib_arch}-${lib_config}" 166 167 LIBCFA_TARGET_DIRS="${LIBCFA_TARGET_DIRS} ${lib_dir}" 168 LIBCFA_TARGET_MAKEFILES="${LIBCFA_TARGET_MAKEFILES} ${lib_dir}/Makefile" 169 170 mkdir -p ${lib_dir} 171 echo -n "${LIBCFA_GENERAL_ARGS} " > ${lib_dir}/config.data 172 echo -n "${LIBCFA_PATHS} " >> ${lib_dir}/config.data 173 echo -n "ARCHITECTURE=${lib_arch} " >> ${lib_dir}/config.data 174 echo -n "CONFIGURATION=${lib_config}" >> ${lib_dir}/config.data 175 done 176 177 AC_SUBST(LIBCFA_TARGET_DIRS) 178 AC_SUBST(LIBCFA_TARGET_MAKEFILES) 179 180 M4CFA_CANNON_CPU([${host_cpu}]) 181 AC_DEFINE_UNQUOTED(CFA_DEFAULT_CPU, "$cannon_arch_name", [Default cpu to use if neither -m32 or -m64 are defined.]) 182 AC_DEFINE_UNQUOTED(CFA_64_CPU, "x64", [CPU to use if the -m64 flags is given.]) 183 AC_DEFINE_UNQUOTED(CFA_32_CPU, "x86", [CPU to use if the -m32 flags is given.]) 184 185 #============================================================================== 186 # CAFLAGS 192 187 AC_DEFINE_UNQUOTED(CFA_FLAGS, "${CFAFLAGS}", [compilation flags for cfa libraries and test programs.]) 193 188 AC_SUBST(CFA_FLAGS, ${CFAFLAGS}) 194 189 190 #============================================================================== 195 191 # Checks for programs. 196 192 AC_PROG_CXX … … 228 224 AC_CHECK_FUNCS([memset putenv strchr strtol]) 229 225 226 #============================================================================== 230 227 AC_CONFIG_FILES([ 231 228 Makefile 232 src/driver/Makefile229 driver/Makefile 233 230 src/Makefile 234 src/benchmark/Makefile 235 src/examples/Makefile 236 src/tests/Makefile 237 src/tests/preempt_longrun/Makefile 238 src/prelude/Makefile 239 src/libcfa/Makefile 231 benchmark/Makefile 232 tests/Makefile 233 tests/preempt_longrun/Makefile 240 234 tools/Makefile 241 235 tools/prettyprinter/Makefile 242 236 ]) 243 237 244 AC_OUTPUT 245 246 AM_COND_IF([BUILD_RELEASE], 247 [AM_COND_IF([BUILD_DEBUG], 248 [AC_MSG_NOTICE(Building libcfa for target: release & debug)], 249 [AC_MSG_NOTICE(Building libcfa for target: release)])], 250 [AM_COND_IF([BUILD_DEBUG], 251 [AC_MSG_NOTICE(Building libcfa for target: debug)], 252 [AC_MSG_NOTICE(Running cfa without libcfa)])]) 238 AC_CONFIG_LINKS([tests/test.py:tests/test.py]) 239 240 AC_OUTPUT(tests/config.py) 253 241 254 242 # Final text -
doc/LaTeXmacros/common.tex
rf9feab8 r90152a4 11 11 %% Created On : Sat Apr 9 10:06:17 2016 12 12 %% Last Modified By : Peter A. Buhr 13 %% Last Modified On : Mon Aug 28 20:18:42 201714 %% Update Count : 3 5513 %% Last Modified On : Mon Jul 9 08:28:05 2018 14 %% Update Count : 380 15 15 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 16 16 … … 37 37 38 38 \newcommand{\CFAIcon}{\textsf{C}\raisebox{\depth}{\rotatebox{180}{\textsf{A}}}\xspace} % Cforall symbolic name 39 \newcommand{\CFA}{\protect\CFAIcon} % safe for section/caption39 \newcommand{\CFA}{\protect\CFAIcon} % safe for section/caption 40 40 \newcommand{\CFL}{\textrm{Cforall}\xspace} % Cforall symbolic name 41 41 \newcommand{\Celeven}{\textrm{C11}\xspace} % C11 symbolic name … … 55 55 \setlength{\parindentlnth}{\parindent} 56 56 57 \newcommand{\LstBasicStyle}[1]{{\lst@basicstyle{#1}}} 57 58 \newcommand{\LstKeywordStyle}[1]{{\lst@basicstyle{\lst@keywordstyle{#1}}}} 58 59 \newcommand{\LstCommentStyle}[1]{{\lst@basicstyle{\lst@commentstyle{#1}}}} … … 101 102 % index macros 102 103 \newcommand{\italic}[1]{\emph{\hyperpage{#1}}} 103 \newcommand{\ definition}[1]{\textbf{\hyperpage{#1}}}104 \newcommand{\Definition}[1]{\textbf{\hyperpage{#1}}} 104 105 \newcommand{\see}[1]{\emph{see}~#1} 105 106 … … 114 115 \def\impl{\@bsphack\begingroup 115 116 \def\protect##1{\string##1\space}\@sanitize 116 \@wrxref{| definition}}117 \@wrxref{|Definition}} 117 118 \newcommand{\indexcode}[1]{{\lstinline$#1$}} 118 119 \def\use{\@bsphack\begingroup … … 124 125 \if@nobreak \ifvmode\nobreak\fi\fi\@esphack} 125 126 %\newcommand{\use}[1]{\index{#1@{\lstinline$#1$}}} 126 %\newcommand{\impl}[1]{\index{\protect#1@{\lstinline$\protect#1$}| definition}}127 %\newcommand{\impl}[1]{\index{\protect#1@{\lstinline$\protect#1$}|Definition}} 127 128 128 129 % inline text and lowercase index: \Index{inline and lowercase index text} … … 147 148 148 149 % Latin abbreviation 149 \newcommand{\abbrevFont}{\textit} % set empty for no italics 150 \newcommand{\abbrevFont}{\textit} % set empty for no italics 151 \@ifundefined{eg}{ 150 152 \newcommand{\EG}{\abbrevFont{e}.\abbrevFont{g}.} 151 153 \newcommand*{\eg}{% … … 153 155 {\@ifnextchar{:}{\EG}% 154 156 {\EG,\xspace}}% 155 }% 157 }}{}% 158 \@ifundefined{ie}{ 156 159 \newcommand{\IE}{\abbrevFont{i}.\abbrevFont{e}.} 157 160 \newcommand*{\ie}{% … … 159 162 {\@ifnextchar{:}{\IE}% 160 163 {\IE,\xspace}}% 161 }% 164 }}{}% 165 \@ifundefined{etc}{ 162 166 \newcommand{\ETC}{\abbrevFont{etc}} 163 167 \newcommand*{\etc}{% 164 168 \@ifnextchar{.}{\ETC}% 165 {\ETC\xspace}% 166 }% 167 \newcommand{\ETAL}{\abbrevFont{et\:al}} 168 \newcommand{\etal}{% 169 \@ifnextchar{.}{\ETAL}% 170 {\abbrevFont{\ETAL}.\xspace}% 171 }% 169 {\ETC.\xspace}% 170 }}{}% 171 \@ifundefined{etal}{ 172 \newcommand{\ETAL}{\abbrevFont{et}~\abbrevFont{al}} 173 \newcommand*{\etal}{% 174 \@ifnextchar{.}{\protect\ETAL}% 175 {\protect\ETAL.\xspace}% 176 }}{}% 177 \@ifundefined{viz}{ 172 178 \newcommand{\VIZ}{\abbrevFont{viz}} 173 \newcommand {\viz}{%179 \newcommand*{\viz}{% 174 180 \@ifnextchar{.}{\VIZ}% 175 {\ abbrevFont{\VIZ}.\xspace}%176 } %181 {\VIZ.\xspace}% 182 }}{}% 177 183 \makeatother 178 184 179 \newenvironment{ quote2}{%180 \list{}{\lstset{resetmargins=true,aboveskip=0pt,belowskip=0pt}\topsep=4pt\parsep=0pt\leftmargin=\parindent \rightmargin\leftmargin}%185 \newenvironment{cquote}{% 186 \list{}{\lstset{resetmargins=true,aboveskip=0pt,belowskip=0pt}\topsep=4pt\parsep=0pt\leftmargin=\parindentlnth\rightmargin\leftmargin}% 181 187 \item\relax 182 188 }{% 183 189 \endlist 184 }% quote2190 }% cquote 185 191 186 192 \newenvironment{rationale}{% 187 \begin{ quote2}\noindent$\Box$\enspace193 \begin{cquote}\noindent$\Box$\enspace 188 194 }{% 189 \hfill\enspace$\Box$\end{ quote2}195 \hfill\enspace$\Box$\end{cquote} 190 196 }% 191 197 … … 201 207 \newenvironment{syntax}{ 202 208 \paragraph{Syntax} 203 \begin{ quote2}209 \begin{cquote} 204 210 \begin{description}[noitemsep,leftmargin=\parindentlnth] 205 211 }{ 206 212 \end{description} 207 \end{ quote2}213 \end{cquote} 208 214 } 209 215 % \def\syntax{\paragraph{Syntax}\trivlist\parindent=.5in\item[\hskip.5in]} … … 215 221 \newcommand{\opt}{$_{opt}$\ } 216 222 217 \usepackage{varioref} % extended references223 \usepackage{varioref} % extended references 218 224 % adjust varioref package with default "section" and "page" titles, and optional title with faraway page numbers 219 225 % \VRef{label} => Section 2.7, \VPageref{label} => page 17 … … 241 247 language=CFA, 242 248 columns=fullflexible, 243 basicstyle=\linespread{0.9}\sf, % reduce line spacing and use sanserif font244 stringstyle=\tt, % use typewriter font245 tabsize=5, % N space tabbing246 xleftmargin=\parindentlnth, % indent code to paragraph indentation247 extendedchars=true, % allow ASCII characters in the range 128-255248 escapechar=§, % LaTeX escape in CFA code §...§ (section symbol), emacs: C-q M-'249 mathescape=true, % LaTeX math escape in CFA code $...$250 keepspaces=true, %251 showstringspaces=false, % do not show spaces with cup252 showlines=true, % show blank lines at end of code253 aboveskip=4pt, % spacing above/below code block249 basicstyle=\linespread{0.9}\sf, % reduce line spacing and use sanserif font 250 stringstyle=\tt, % use typewriter font 251 tabsize=5, % N space tabbing 252 xleftmargin=\parindentlnth, % indent code to paragraph indentation 253 extendedchars=true, % allow ASCII characters in the range 128-255 254 escapechar=§, % LaTeX escape in CFA code §...§ (section symbol), emacs: C-q M-' 255 mathescape=true, % LaTeX math escape in CFA code $...$ 256 keepspaces=true, % 257 showstringspaces=false, % do not show spaces with cup 258 showlines=true, % show blank lines at end of code 259 aboveskip=4pt, % spacing above/below code block 254 260 belowskip=3pt, 255 261 % replace/adjust listing characters that look bad in sanserif … … 257 263 {~}{\raisebox{0.3ex}{$\scriptstyle\sim\,$}}1 {`}{\ttfamily\upshape\hspace*{-0.1ex}`}1 258 264 {<-}{$\leftarrow$}2 {=>}{$\Rightarrow$}2 {->}{\makebox[1ex][c]{\raisebox{0.4ex}{\rule{0.8ex}{0.075ex}}}\kern-0.2ex\textgreater}2, 259 moredelim=**[is][\color{red}]{®}{®}, % red highlighting ®...® (registered trademark symbol) emacs: C-q M-.260 moredelim=**[is][\color{blue}]{ß}{ß}, % blue highlighting ß...ß (sharp s symbol) emacs: C-q M-_261 moredelim=**[is][\color{OliveGreen}]{¢}{¢}, % green highlighting ¢...¢ (cent symbol) emacs: C-q M-"262 moredelim=[is][\lstset{keywords={}}]{¶}{¶}, % keyword escape ¶...¶ (pilcrow symbol) emacs: C-q M-^265 moredelim=**[is][\color{red}]{®}{®}, % red highlighting ®...® (registered trademark symbol) emacs: C-q M-. 266 moredelim=**[is][\color{blue}]{ß}{ß}, % blue highlighting ß...ß (sharp s symbol) emacs: C-q M-_ 267 moredelim=**[is][\color{OliveGreen}]{¢}{¢}, % green highlighting ¢...¢ (cent symbol) emacs: C-q M-" 268 moredelim=[is][\lstset{keywords={}}]{¶}{¶}, % keyword escape ¶...¶ (pilcrow symbol) emacs: C-q M-^ 263 269 }% lstset 264 270 }% CFADefaults … … 266 272 \CFADefaults 267 273 % inline code ©...© (copyright symbol) emacs: C-q M-) 268 \lstMakeShortInline© % single-character for \lstinline274 \lstMakeShortInline© % single-character for \lstinline 269 275 }% CFAStyle 270 276 -
doc/LaTeXmacros/lstlang.sty
rf9feab8 r90152a4 8 8 %% Created On : Sat May 13 16:34:42 2017 9 9 %% Last Modified By : Peter A. Buhr 10 %% Last Modified On : Wed Aug 30 22:11:14 201711 %% Update Count : 1410 %% Last Modified On : Fri Apr 6 23:44:50 2018 11 %% Update Count : 20 12 12 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 13 13 … … 31 31 \lstdefinelanguage{sml} { 32 32 morekeywords= { 33 EQUAL, GREATER, LESS, NONE, SOME, abstraction, abstype, and, andalso, array, as, before, bool, 34 case, char, datatype, do, else, end, eqtype, exception, exn, false, fn, fun, functor, handle, 35 if, in, include, infix, infixr, int, let, list, local, nil, nonfix, not, o, of, op, open, 36 option, orelse, overload, print, raise, real, rec, ref, sharing, sig, signature, string, struct, 37 structure, substring, then, true, type, unit, val, vector, where, while, with, withtype, word 38 }, 39 morestring=[b]", 40 morecomment=[s]{(*}{*)}, 33 EQUAL, GREATER, LESS, NONE, SOME, abstraction, abstype, and, andalso, array, as, before, 34 bool, case, char, datatype, do, else, end, eqtype, exception, exn, false, fn, fun, functor, 35 handle, if, in, include, infix, infixr, int, let, list, local, nil, nonfix, not, o, of, op, 36 open, option, orelse, overload, print, raise, real, rec, ref, sharing, sig, signature, 37 string, struct, structure, substring, then, true, type, unit, val, vector, where, while, 38 with, withtype, word 39 }, 40 morestring=[b]", 41 morecomment=[s]{(*}{*)}, 41 42 } 42 43 … … 82 83 83 84 \lstdefinelanguage{rust}{ 85 % Keywords 84 86 morekeywords=[1]{ 85 87 abstract, alignof, as, become, box, break, const, continue, crate, do, else, enum, extern, 86 false, final, fn, for, if, impl, in, let, loop, macro, match, mod, move, mut, offsetof,87 override, priv, proc, pub, pure, ref, return, Self, self, sizeof, static, struct, super,88 trait, true, type, typeof, unsafe, unsized, use, virtual, where, while, yield88 false, final, fn, for, if, impl, in, let, loop, macro, match, mod, move, mut, offsetof, 89 override, priv, proc, pub, pure, ref, return, Self, self, sizeof, static, struct, super, 90 trait, true, type, typeof, unsafe, unsized, use, virtual, where, while, yield 89 91 }, 92 % Strings 90 93 morestring=[b]{"}, 94 % Comments 91 95 comment=[l]{//}, 92 96 morecomment=[s]{/*}{*/}, 97 % Options 93 98 sensitive=true 94 99 } 95 100 96 \lstdefinelanguage{ Pseudo}{101 \lstdefinelanguage{pseudo}{ 97 102 morekeywords={string,uint,int,bool,float}, 98 103 sensitive=true, … … 107 112 \lstdefinelanguage{CFA}[ANSI]{C}{ 108 113 morekeywords={ 109 _Alignas, _Alignof, __alignof, __alignof__, asm, __asm, __asm__, _ At, __attribute,110 __attribute__, auto, _Bool, catch, catchResume, choose, _Complex, __complex, __complex__,111 __const, __const__, disable, dtype, enable, __extension__, fallthrough, fallthru,112 finally, forall, ftype, _Generic, _Imaginary, inline, __label__, lvalue, _Noreturn, one_t,113 otype, restrict, _Static_assert, throw, throwResume, trait, try, ttype, typeof, __typeof,114 __typeof__, virtual, with, zero_t},115 morekeywords=[2]{116 _Atomic, coroutine, is_coroutine, is_monitor, is_thread, monitor, mutex, nomutex, or,117 resume, suspend, thread, _Thread_local, waitfor, when, yield},114 _Alignas, _Alignof, __alignof, __alignof__, asm, __asm, __asm__, __attribute, __attribute__, 115 auto, _Bool, catch, catchResume, choose, _Complex, __complex, __complex__, __const, __const__, 116 coroutine, disable, dtype, enable, __extension__, exception, fallthrough, fallthru, finally, 117 __float80, float80, __float128, float128, forall, ftype, _Generic, _Imaginary, __imag, __imag__, 118 inline, __inline, __inline__, __int128, int128, __label__, monitor, mutex, _Noreturn, one_t, or, 119 otype, restrict, __restrict, __restrict__, __signed, __signed__, _Static_assert, thread, 120 _Thread_local, throw, throwResume, timeout, trait, try, ttype, typeof, __typeof, __typeof__, 121 virtual, __volatile, __volatile__, waitfor, when, with, zero_t, 122 }, 118 123 moredirectives={defined,include_next}% 119 124 } -
doc/proposals/ctordtor/Makefile
rf9feab8 r90152a4 1 ## Define the appropriateconfiguration variables.1 ## Define the configuration variables. 2 2 3 MACROS = ../../LaTeXmacros 4 BIB = ../../bibliography 3 Build = build 4 Figures = figures 5 Macros = ../../LaTeXmacros 6 Bib = ../../bibliography 5 7 6 TeXLIB = .:$ (MACROS):$(MACROS)/listings:$(MACROS)/enumitem:$(BIB)/:7 LaTeX = TEXINPUTS=${TeXLIB} && export TEXINPUTS && latex -halt-on-error 8 TeXLIB = .:${Macros}:${MACROS}/listings:${MACROS}/enumitem:${Bib}/: 9 LaTeX = TEXINPUTS=${TeXLIB} && export TEXINPUTS && latex -halt-on-error -output-directory=${Build} 8 10 BibTeX = BIBINPUTS=${TeXLIB} && export BIBINPUTS && bibtex 11 12 MAKEFLAGS = --no-print-directory # --silent 13 VPATH = ${Build} ${Figures} 9 14 10 15 ## Define the text source files. … … 29 34 30 35 DOCUMENT = ctor.pdf 36 BASE = ${basename ${DOCUMENT}} 31 37 32 38 # Directives # 39 40 .PHONY : all clean # not file names 33 41 34 42 all : ${DOCUMENT} 35 43 36 44 clean : 37 rm -f *.bbl *.aux *.dvi *.idx *.ilg *.ind *.brf *.out *.log *.toc *.blg *.pstex_t *.cf \ 38 ${FIGURES} ${PICTURES} ${PROGRAMS} ${GRAPHS} ${basename ${DOCUMENT}}.ps ${DOCUMENT} 45 @rm -frv ${DOCUMENT} ${BASE}.ps ${Build} 39 46 40 47 # File Dependencies # 41 48 42 ${DOCUMENT} : ${ basename ${DOCUMENT}}.ps49 ${DOCUMENT} : ${BASE}.ps 43 50 ps2pdf $< 44 51 45 ${ basename ${DOCUMENT}}.ps : ${basename ${DOCUMENT}}.dvi46 dvips $ < -o $@52 ${BASE}.ps : ${BASE}.dvi 53 dvips ${Build}/$< -o $@ 47 54 48 ${ basename ${DOCUMENT}}.dvi : Makefile ${GRAPHS} ${PROGRAMS} ${PICTURES} ${FIGURES} ${SOURCES} ${basename ${DOCUMENT}}.tex\49 $ (MACROS)/common.tex $(MACROS)/indexstyle $(BIB)/cfa.bib55 ${BASE}.dvi : Makefile ${GRAPHS} ${PROGRAMS} ${PICTURES} ${FIGURES} ${SOURCES} \ 56 ${Macros}/common.tex ${Macros}/indexstyle ${Bib}/pl.bib | ${Build} 50 57 # Conditionally create an empty *.ind (index) file for inclusion until makeindex is run. 51 if [ ! -r ${basename $@}.ind ] ; then touch${basename $@}.ind ; fi58 #if [ ! -r ${basename $@}.ind ] ; then touch ${Build}/${basename $@}.ind ; fi 52 59 # Must have *.aux file containing citations for bibtex 53 60 if [ ! -r ${basename $@}.aux ] ; then ${LaTeX} ${basename $@}.tex ; fi 54 -${BibTeX} ${ basename $@}55 # Some citations reference others so run stepsagain to resolve these citations61 -${BibTeX} ${Build}/${basename $@} 62 # Some citations reference others so run again to resolve these citations 56 63 ${LaTeX} ${basename $@}.tex 57 -${BibTeX} ${ basename $@}64 -${BibTeX} ${Build}/${basename $@} 58 65 # Make index from *.aux entries and input index at end of document 59 makeindex -s $(MACROS)/indexstyle ${basename $@}.idx 66 #makeindex -s ${Macros}/indexstyle ${Build}/${basename $@}.idx 67 # Run again to finish citations 60 68 ${LaTeX} ${basename $@}.tex 61 69 # Run again to get index title into table of contents … … 67 75 ## Define the default recipes. 68 76 69 %.tex : %.fig 70 fig2dev -L eepic $< > $@77 ${Build}: 78 mkdir -p ${Build} 71 79 72 %. ps : %.fig73 fig2dev -L ps $< >$@80 %.tex : %.fig | ${Build} 81 fig2dev -L eepic $< > ${Build}/$@ 74 82 75 %.pstex : %.fig 76 fig2dev -L pstex $< > $@ 77 fig2dev -L pstex_t -p $@ $< > $@_t 83 %.ps : %.fig | ${Build} 84 fig2dev -L ps $< > ${Build}/$@ 85 86 %.pstex : %.fig | ${Build} 87 fig2dev -L pstex $< > ${Build}/$@ 88 fig2dev -L pstex_t -p ${Build}/$@ $< > ${Build}/$@_t 78 89 79 90 # Local Variables: # -
doc/proposals/ctordtor/ctor.tex
rf9feab8 r90152a4 1 % inline code ©...© (copyright symbol) emacs: C-q M-)2 % red highlighting ®...® (registered trademark symbol) emacs: C-q M-.3 % blue highlighting ß...ß (sharp s symbol) emacs: C-q M-_4 % green highlighting ¢...¢ (cent symbol) emacs: C-q M-"5 % LaTex escape §...§ (section symbol) emacs: C-q M-'6 % keyword escape ¶...¶ (pilcrow symbol) emacs: C-q M-^7 % math escape $...$ (dollar symbol)8 9 1 \documentclass[twoside,11pt]{article} 10 2 … … 15 7 \usepackage{textcomp} 16 8 \usepackage[latin1]{inputenc} 9 17 10 \usepackage{fullpage,times,comment} 18 11 \usepackage{epic,eepic} 19 \usepackage{upquote} % switch curled `'" to straight12 \usepackage{upquote} % switch curled `'" to straight 20 13 \usepackage{calc} 21 14 \usepackage{xspace} 22 15 \usepackage{graphicx} 23 \usepackage{varioref} % extended references24 \usepackage{listings} % format program code25 \usepackage[flushmargin]{footmisc} % support label/reference in footnote16 \usepackage{varioref} % extended references 17 \usepackage{listings} % format program code 18 \usepackage[flushmargin]{footmisc} % support label/reference in footnote 26 19 \usepackage{latexsym} % \Box glyph 27 20 \usepackage{mathptmx} % better math font with "times" … … 34 27 \renewcommand{\UrlFont}{\small\sf} 35 28 36 \setlength{\topmargin}{-0.45in} % move running title into header29 \setlength{\topmargin}{-0.45in} % move running title into header 37 30 \setlength{\headsep}{0.25in} 38 31 … … 43 36 44 37 \interfootnotelinepenalty=10000 38 39 \CFAStyle % use default CFA format-style 40 % inline code ©...© (copyright symbol) emacs: C-q M-) 41 % red highlighting ®...® (registered trademark symbol) emacs: C-q M-. 42 % blue highlighting ß...ß (sharp s symbol) emacs: C-q M-_ 43 % green highlighting ¢...¢ (cent symbol) emacs: C-q M-" 44 % LaTex escape §...§ (section symbol) emacs: C-q M-' 45 % keyword escape ¶...¶ (pilcrow symbol) emacs: C-q M-^ 46 % math escape $...$ (dollar symbol) 47 45 48 46 49 \title{ … … 83 86 \thispagestyle{plain} 84 87 \pagenumbering{arabic} 85 86 88 87 89 -
doc/proposals/tuples/Makefile
rf9feab8 r90152a4 1 ## Define the appropriateconfiguration variables.1 ## Define the configuration variables. 2 2 3 MACROS = ../../LaTeXmacros 4 BIB = ../../bibliography 3 Build = build 4 Figures = figures 5 Macros = ../../LaTeXmacros 6 Bib = ../../bibliography 5 7 6 TeXLIB = .:$ (MACROS):$(MACROS)/listings:$(MACROS)/enumitem:$(BIB)/:7 LaTeX = TEXINPUTS=${TeXLIB} && export TEXINPUTS && latex -halt-on-error 8 TeXLIB = .:${Macros}:${MACROS}/listings:${MACROS}/enumitem:${Bib}/: 9 LaTeX = TEXINPUTS=${TeXLIB} && export TEXINPUTS && latex -halt-on-error -output-directory=${Build} 8 10 BibTeX = BIBINPUTS=${TeXLIB} && export BIBINPUTS && bibtex 11 12 MAKEFLAGS = --no-print-directory --silent # 13 VPATH = ${Build} ${Figures} 9 14 10 15 ## Define the text source files. … … 29 34 30 35 DOCUMENT = tuples.pdf 36 BASE = ${basename ${DOCUMENT}} 31 37 32 38 # Directives # 39 40 .PHONY : all clean # not file names 33 41 34 42 all : ${DOCUMENT} 35 43 36 44 clean : 37 rm -f *.bbl *.aux *.dvi *.idx *.ilg *.ind *.brf *.out *.log *.toc *.blg *.pstex_t *.cf \ 38 ${FIGURES} ${PICTURES} ${PROGRAMS} ${GRAPHS} ${basename ${DOCUMENT}}.ps ${DOCUMENT} 45 @rm -frv ${DOCUMENT} ${BASE}.ps ${Build} 39 46 40 47 # File Dependencies # 41 48 42 ${DOCUMENT} : ${ basename ${DOCUMENT}}.ps49 ${DOCUMENT} : ${BASE}.ps 43 50 ps2pdf $< 44 51 45 ${ basename ${DOCUMENT}}.ps : ${basename ${DOCUMENT}}.dvi46 dvips $ < -o $@52 ${BASE}.ps : ${BASE}.dvi 53 dvips ${Build}/$< -o $@ 47 54 48 ${ basename ${DOCUMENT}}.dvi : Makefile ${GRAPHS} ${PROGRAMS} ${PICTURES} ${FIGURES} ${SOURCES} ${basename ${DOCUMENT}}.tex\49 $ (MACROS)/common.tex $(MACROS)/indexstyle $(BIB)/cfa.bib55 ${BASE}.dvi : Makefile ${GRAPHS} ${PROGRAMS} ${PICTURES} ${FIGURES} ${SOURCES} \ 56 ${Macros}/common.tex ${Macros}/indexstyle ${Bib}/pl.bib | ${Build} 50 57 # Conditionally create an empty *.ind (index) file for inclusion until makeindex is run. 51 if [ ! -r ${basename $@}.ind ] ; then touch${basename $@}.ind ; fi58 #if [ ! -r ${basename $@}.ind ] ; then touch ${Build}/${basename $@}.ind ; fi 52 59 # Must have *.aux file containing citations for bibtex 53 60 if [ ! -r ${basename $@}.aux ] ; then ${LaTeX} ${basename $@}.tex ; fi 54 -${BibTeX} ${ basename $@}55 # Some citations reference others so run stepsagain to resolve these citations61 -${BibTeX} ${Build}/${basename $@} 62 # Some citations reference others so run again to resolve these citations 56 63 ${LaTeX} ${basename $@}.tex 57 -${BibTeX} ${ basename $@}64 -${BibTeX} ${Build}/${basename $@} 58 65 # Make index from *.aux entries and input index at end of document 59 makeindex -s $(MACROS)/indexstyle ${basename $@}.idx 66 #makeindex -s ${Macros}/indexstyle ${Build}/${basename $@}.idx 67 # Run again to finish citations 60 68 ${LaTeX} ${basename $@}.tex 61 69 # Run again to get index title into table of contents … … 67 75 ## Define the default recipes. 68 76 69 %.tex : %.fig 70 fig2dev -L eepic $< > $@77 ${Build}: 78 mkdir -p ${Build} 71 79 72 %. ps : %.fig73 fig2dev -L ps $< >$@80 %.tex : %.fig | ${Build} 81 fig2dev -L eepic $< > ${Build}/$@ 74 82 75 %.pstex : %.fig 76 fig2dev -L pstex $< > $@ 77 fig2dev -L pstex_t -p $@ $< > $@_t 83 %.ps : %.fig | ${Build} 84 fig2dev -L ps $< > ${Build}/$@ 85 86 %.pstex : %.fig | ${Build} 87 fig2dev -L pstex $< > ${Build}/$@ 88 fig2dev -L pstex_t -p ${Build}/$@ $< > ${Build}/$@_t 78 89 79 90 # Local Variables: # -
doc/proposals/tuples/tuples.tex
rf9feab8 r90152a4 1 % inline code ©...© (copyright symbol) emacs: C-q M-)2 % red highlighting ®...® (registered trademark symbol) emacs: C-q M-.3 % blue highlighting ß...ß (sharp s symbol) emacs: C-q M-_4 % green highlighting ¢...¢ (cent symbol) emacs: C-q M-"5 % LaTex escape §...§ (section symbol) emacs: C-q M-'6 % keyword escape ¶...¶ (pilcrow symbol) emacs: C-q M-^7 % math escape $...$ (dollar symbol)8 9 1 \documentclass[twoside,11pt]{article} 10 2 … … 15 7 \usepackage{textcomp} 16 8 \usepackage[latin1]{inputenc} 9 17 10 \usepackage{fullpage,times,comment} 18 11 \usepackage{epic,eepic} 19 \usepackage{upquote} % switch curled `'" to straight12 \usepackage{upquote} % switch curled `'" to straight 20 13 \usepackage{calc} 21 14 \usepackage{xspace} 22 15 \usepackage{graphicx} 23 \usepackage{varioref} % extended references24 \usepackage{listings} % format program code25 \usepackage[flushmargin]{footmisc} % support label/reference in footnote16 \usepackage{varioref} % extended references 17 \usepackage{listings} % format program code 18 \usepackage[flushmargin]{footmisc} % support label/reference in footnote 26 19 \usepackage{latexsym} % \Box glyph 27 20 \usepackage{mathptmx} % better math font with "times" … … 34 27 \renewcommand{\UrlFont}{\small\sf} 35 28 36 \setlength{\topmargin}{-0.45in} % move running title into header29 \setlength{\topmargin}{-0.45in} % move running title into header 37 30 \setlength{\headsep}{0.25in} 38 31 … … 42 35 43 36 \interfootnotelinepenalty=10000 37 38 \CFAStyle % use default CFA format-style 39 % inline code ©...© (copyright symbol) emacs: C-q M-) 40 % red highlighting ®...® (registered trademark symbol) emacs: C-q M-. 41 % blue highlighting ß...ß (sharp s symbol) emacs: C-q M-_ 42 % green highlighting ¢...¢ (cent symbol) emacs: C-q M-" 43 % LaTex escape §...§ (section symbol) emacs: C-q M-' 44 % keyword escape ¶...¶ (pilcrow symbol) emacs: C-q M-^ 45 % math escape $...$ (dollar symbol) 46 44 47 45 48 \title{ … … 322 325 \addcontentsline{toc}{section}{\refname} 323 326 \bibliographystyle{plain} 324 \bibliography{ cfa}327 \bibliography{pl} 325 328 326 329 %\addcontentsline{toc}{section}{\indexname} % add index name to table of contents -
doc/proposals/user_conversions.md
rf9feab8 r90152a4 5 5 There is also a set of _explicit_ conversions that are only allowed through a 6 6 cast expression. 7 Based on Glen's notes on conversions [1], I propose that safe and unsafe 8 conversions be expressed as constructor variants, though I make explicit 9 (cast) conversions a constructor variant as well rather than a dedicated 10 operator. 7 I propose that safe, unsafe, and explicit (cast) conversions be expressed as 8 constructor variants. 11 9 Throughout this article, I will use the following operator names for 12 10 constructors and conversion functions from `From` to `To`: 13 11 14 void ?{} ( To*, To ); // copy constructor 15 void ?{} ( To*, From ); // explicit constructor 16 void ?{explicit} ( To*, From ); // explicit cast conversion 17 void ?{safe} ( To*, From ); // implicit safe conversion 18 void ?{unsafe} ( To*, From ); // implicit unsafe conversion 19 20 [1] http://plg.uwaterloo.ca/~cforall/Conversions/index.html 21 22 Glen's design made no distinction between constructors and unsafe implicit 12 void ?{} ( To&, To ); // copy constructor 13 void ?{} ( To&, From ); // explicit constructor 14 void ?{explicit} ( To&, From ); // explicit cast conversion 15 void ?{safe} ( To&, From ); // implicit safe conversion 16 void ?{unsafe} ( To&, From ); // implicit unsafe conversion 17 18 It has been suggested that all constructors would define unsafe implicit 23 19 conversions; this is elegant, but interacts poorly with tuples. 24 20 Essentially, without making this distinction, a constructor like the following … … 26 22 multiplying the space of possible interpretations of all functions: 27 23 28 void ?{}( Coord *this, int x, int y );24 void ?{}( Coord& this, int x, int y ); 29 25 30 26 That said, it would certainly be possible to make a multiple-argument implicit … … 32 28 used infrequently: 33 29 34 void ?{unsafe}( Coord *this, int x, int y );30 void ?{unsafe}( Coord& this, int x, int y ); 35 31 36 32 An alternate possibility would be to only count two-arg constructors 37 `void ?{} ( To *, From )` as unsafe conversions; under this semantics, safe and33 `void ?{} ( To&, From )` as unsafe conversions; under this semantics, safe and 38 34 explicit conversions should also have a compiler-enforced restriction to 39 35 ensure that they are two-arg functions (this restriction may be valuable … … 43 39 is convertable to `To`. 44 40 If user-defined conversions are not added to the language, 45 `void ?{} ( To *, From )` may be a suitable representation, relying on41 `void ?{} ( To&, From )` may be a suitable representation, relying on 46 42 conversions on the argument types to account for transitivity. 47 On the other hand, `To*` should perhaps match its target type exactly, so 48 another assertion syntax specific to conversions may be required, e.g. 49 `From -> To`. 43 Since `To&` should be an exact match on `To`, this should put all the implicit 44 conversions on the RHS. 45 On the other hand, under some models (like [1]), implicit conversions are not 46 allowed in assertion parameters, so another assertion syntax specific to 47 conversions may be required, e.g. `From -> To`. 48 It has also been suggested that, for programmer control, no implicit 49 conversions (except, possibly, for polymorphic specialization) should be 50 allowed in resolution of cast operators. 51 52 [1] ../working/assertion_resolution.md 50 53 51 54 ### Constructor Idiom ### … … 53 56 that we can use the full range of Cforall features for conversions, including 54 57 polymorphism. 55 Glen [1] defines a _constructor idiom_ that can be used to create chains of 56 safe conversions without duplicating code; given a type `Safe` which members 57 of another type `From` can be directly converted to, the constructor idiom 58 allows us to write a conversion for any type `To` which `Safe` converts to: 59 60 forall(otype To | { void ?{safe}( To*, Safe ) }) 61 void ?{safe}( To *this, From that ) { 58 In an earlier version of this proposal, Glen Ditchfield defines a 59 _constructor idiom_ that can be used to create chains of safe conversions 60 without duplicating code; given a type `Safe` which members of another type 61 `From` can be directly converted to, the constructor idiom allows us to write 62 a conversion for any type `To` which `Safe` converts to: 63 64 forall(otype To | { void ?{safe}( To&, Safe ) }) 65 void ?{safe}( To& this, From that ) { 62 66 Safe tmp = /* some expression involving that */; 63 *this = tmp; // usesassertion parameter67 this{ tmp }; // initialize from assertion parameter 64 68 } 65 69 … … 67 71 unsafe conversions. 68 72 73 Glen's original suggestion said the copy constructor for `To` should also be 74 accepted as a resolution for `void ?{safe}( To&, Safe )` (`Safe` == `To`), 75 allowing this same code to be used for the single-step conversion as well. 76 This proposal does come at the cost of an extra copy initialization of the 77 target value, though. 78 79 Contrariwise, if a monomorphic conversion from `From` to `Safe` is written, 80 e.g: 81 82 void ?{safe}( Safe& this, From that ) { 83 this{ /* some parameters involving that */ }; 84 } 85 86 Then the code for a transitive conversion from `From` to any `To` type 87 convertable from `Safe` is written: 88 89 forall(otype To | { void ?{safe}( To&, Safe ) }) 90 void ?{safe}( To& this, From that ) { 91 Safe tmp = that; // uses monomorphic conversion 92 this{ tmp }; // initialize from assertion parameter 93 } 94 95 Given the entirely-boilerplate nature of this code, but negative performance 96 implications of the unmodified constructor idiom, it might be fruitful to have 97 transitive and single step conversion operators, and let CFA build the 98 transitive conversions; some possible names: 99 100 void ?{safe} (To&, From); void ?{final safe} (To&, From); // single-step 101 void ?{safe*} (To&, From); void ?{safe} (To&, From); // transitive 102 69 103 What selective non-use of the constructor idiom gives us is the ability to 70 104 define a conversion that may only be the *last* conversion in a chain of such. 71 Constructing a conversion graph able to unambiguously represent the full 72 hierarchy of implicit conversions in C is provably impossible using only 73 single-step conversions with no additional information (see Appendix A), but 74 this mechanism is sufficiently powerful (see [1], though the design there has 75 some minor bugs; the general idea is to use the constructor idiom to define 76 two chains of conversions, one among the signed integral types, another among 77 the unsigned, and to use monomorphic conversions to allow conversions between 78 signed and unsigned integer types). 105 One use for this is to solve the problem that `explicit` conversions were 106 added to C++ for, that of conversions to `bool` chaining to become conversions 107 to any arithmetic type. 108 Another use is to unambiguously represent the full hierarchy of implicit 109 conversions in C by making sign conversions non-transitive, allowing the 110 compiler to resolve e.g. `int -> unsigned long` as 111 `int -> long -> unsigned long` over `int -> unsigned int -> unsigned long`. 112 See [2] for more details. 113 114 [2] ../working/glen_conversions/index.html#usual 79 115 80 116 ### Appendix A: Partial and Total Orders ### … … 153 189 convert from `int` to `unsigned long`, so we just put in a direct conversion 154 190 and make the compiler smart enough to figure out the costs" - this is the 155 approach taken by the existing compi pler, but given that in a user-defined191 approach taken by the existing compiler, but given that in a user-defined 156 192 conversion proposal the users can build an arbitrary graph of conversions, 157 193 this case still needs to be handled. … … 160 196 exists a chain of conversions from `a` to `b` (see Appendix A for description 161 197 of preorders and related constructs). 162 This preorder corresponds roughlyto a more usual type-theoretic concept of198 This preorder roughly corresponds to a more usual type-theoretic concept of 163 199 subtyping ("if I can convert `a` to `b`, `a` is a more specific type than 164 200 `b`"); however, since this graph is arbitrary, it may contain cycles, so if … … 192 228 and so is considered to be the nearer type. 193 229 By transitivity, then, the conversion from `X` to `Y2` should be cheaper than 194 the conversion from `X` to `W`, but in this case the ` X` and `W` are230 the conversion from `X` to `W`, but in this case the `Y2` and `W` are 195 231 incomparable by the conversion preorder, so the tie is broken by the shorter 196 232 path from `X` to `W` in favour of `W`, contradicting the transitivity property -
doc/refrat/.gitignore
rf9feab8 r90152a4 1 1 # generated by latex 2 *.aux 3 *.bbl 4 *.blg 5 *.brf 6 *.dvi 7 *.idx 8 *.ilg 9 *.ind 10 *.log 11 *.out 2 build/* 12 3 *.pdf 13 4 *.ps 14 *.toc -
doc/refrat/Makefile
rf9feab8 r90152a4 1 ## Define the appropriateconfiguration variables.1 ## Define the configuration variables. 2 2 3 TeXLIB = .:../LaTeXmacros:../LaTeXmacros/listings:../LaTeXmacros/enumitem:../bibliography/: 4 LaTeX = TEXINPUTS=${TeXLIB} && export TEXINPUTS && latex -halt-on-error 3 Build = build 4 Figures = figures 5 Macros = ../LaTeXmacros 6 TeXLIB = .:${Macros}:${Build}:../bibliography: 7 LaTeX = TEXINPUTS=${TeXLIB} && export TEXINPUTS && latex -halt-on-error -output-directory=${Build} 5 8 BibTeX = BIBINPUTS=${TeXLIB} && export BIBINPUTS && bibtex 9 10 MAKEFLAGS = --no-print-directory --silent # 11 VPATH = ${Build} ${Figures} 6 12 7 13 ## Define the text source files. … … 28 34 29 35 DOCUMENT = refrat.pdf 36 BASE = ${basename ${DOCUMENT}} 30 37 31 38 # Directives # 39 40 .PHONY : all clean # not file names 32 41 33 42 all : ${DOCUMENT} 34 43 35 44 clean : 36 rm -f *.bbl *.aux *.dvi *.idx *.ilg *.ind *.brf *.out *.log *.toc *.blg *.pstex_t *.cf \ 37 ${FIGURES} ${PICTURES} ${PROGRAMS} ${GRAPHS} ${basename ${DOCUMENT}}.ps ${DOCUMENT} 45 @rm -frv ${DOCUMENT} ${BASE}.ps ${Build} 38 46 39 47 # File Dependencies # 40 48 41 ${DOCUMENT} : ${ basename ${DOCUMENT}}.ps49 ${DOCUMENT} : ${BASE}.ps 42 50 ps2pdf $< 43 51 44 ${ basename ${DOCUMENT}}.ps : ${basename ${DOCUMENT}}.dvi45 dvips $ < -o $@52 ${BASE}.ps : ${BASE}.dvi 53 dvips ${Build}/$< -o $@ 46 54 47 ${ basename ${DOCUMENT}}.dvi : Makefile ${GRAPHS} ${PROGRAMS} ${PICTURES} ${FIGURES} ${SOURCES} ${basename ${DOCUMENT}}.tex\48 ../LaTeXmacros/common.tex ../LaTeXmacros/lstlang.sty ../LaTeXmacros/indexstyle ../bibliography/cfa.bib55 ${BASE}.dvi : Makefile ${GRAPHS} ${PROGRAMS} ${PICTURES} ${FIGURES} ${SOURCES} \ 56 ${Macros}/common.tex ${Macros}/lstlang.sty ${Macros}/indexstyle ../bibliography/pl.bib | ${Build} 49 57 # Conditionally create an empty *.ind (index) file for inclusion until makeindex is run. 50 if [ ! -r ${basename $@}.ind ] ; then touch ${ basename $@}.ind ; fi58 if [ ! -r ${basename $@}.ind ] ; then touch ${Build}/${basename $@}.ind ; fi 51 59 # Must have *.aux file containing citations for bibtex 52 60 if [ ! -r ${basename $@}.aux ] ; then ${LaTeX} ${basename $@}.tex ; fi 53 -${BibTeX} ${ basename $@}54 # Some citations reference others so run stepsagain to resolve these citations61 -${BibTeX} ${Build}/${basename $@} 62 # Some citations reference others so run again to resolve these citations 55 63 ${LaTeX} ${basename $@}.tex 56 -${BibTeX} ${ basename $@}64 -${BibTeX} ${Build}/${basename $@} 57 65 # Make index from *.aux entries and input index at end of document 58 makeindex -s ../LaTeXmacros/indexstyle ${basename $@}.idx 66 makeindex -s ${Macros}/indexstyle ${Build}/${basename $@}.idx 67 # Run again to finish citations 59 68 ${LaTeX} ${basename $@}.tex 60 69 # Run again to get index title into table of contents … … 62 71 63 72 predefined : 64 sed -f predefined.sed ${ basename ${DOCUMENT}}.tex > ${basename $@}.cf73 sed -f predefined.sed ${BASE}.tex > ${basename $@}.cf 65 74 66 75 ## Define the default recipes. 67 76 68 %.tex : %.fig 69 fig2dev -L eepic $< > $@77 ${Build}: 78 mkdir -p ${Build} 70 79 71 %. ps : %.fig72 fig2dev -L ps $< >$@80 %.tex : %.fig | ${Build} 81 fig2dev -L eepic $< > ${Build}/$@ 73 82 74 %.pstex : %.fig 75 fig2dev -L pstex $< > $@ 76 fig2dev -L pstex_t -p $@ $< > $@_t 83 %.ps : %.fig | ${Build} 84 fig2dev -L ps $< > ${Build}/$@ 85 86 %.pstex : %.fig | ${Build} 87 fig2dev -L pstex $< > ${Build}/$@ 88 fig2dev -L pstex_t -p ${Build}/$@ $< > ${Build}/$@_t 77 89 78 90 # Local Variables: # -
doc/refrat/keywords.tex
rf9feab8 r90152a4 11 11 %% Created On : Sun Aug 6 08:17:27 2017 12 12 %% Last Modified By : Peter A. Buhr 13 %% Last Modified On : Wed Aug 30 22:10:10 201714 %% Update Count : 513 %% Last Modified On : Fri Apr 6 15:16:11 2018 14 %% Update Count : 7 15 15 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 16 16 \begin{tabular}{@{}llllll@{}} 17 17 \begin{tabular}{@{}l@{}} 18 ©_At© \\19 18 ©catch© \\ 20 19 ©catchResume© \\ 21 20 ©choose© \\ 22 21 ©coroutine© \\ 22 ©disable© \\ 23 23 \end{tabular} 24 24 & 25 25 \begin{tabular}{@{}l@{}} 26 ©disable© \\27 26 ©dtype© \\ 28 27 ©enable© \\ 28 ©exception© \\ 29 29 ©fallthrough© \\ 30 30 ©fallthru© \\ … … 35 35 ©forall© \\ 36 36 ©ftype© \\ 37 ©lvalue© \\38 37 ©monitor© \\ 38 ©mutex© \\ 39 39 \end{tabular} 40 40 & 41 41 \begin{tabular}{@{}l@{}} 42 ©mutex© \\43 42 ©one_t© \\ 44 43 ©otype© \\ 45 44 ©throw© \\ 46 45 ©throwResume© \\ 46 ©trait© \\ 47 47 \end{tabular} 48 48 & 49 49 \begin{tabular}{@{}l@{}} 50 ©trait© \\51 50 ©try© \\ 52 51 ©ttype© \\ 53 52 ©virtual© \\ 54 53 ©waitfor© \\ 54 ©when© \\ 55 55 \end{tabular} 56 56 & 57 57 \begin{tabular}{@{}l@{}} 58 ©when© \\59 58 ©with© \\ 60 59 ©zero_t© \\ 60 \\ 61 61 \\ 62 62 \\ -
doc/refrat/refrat.tex
rf9feab8 r90152a4 11 11 %% Created On : Wed Apr 6 14:52:25 2016 12 12 %% Last Modified By : Peter A. Buhr 13 %% Last Modified On : Tue Aug 15 18:46:31 201714 %% Update Count : 10 613 %% Last Modified On : Wed Jan 31 17:30:23 2018 14 %% Update Count : 108 15 15 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 16 16 … … 141 141 The manual deliberately imitates the ordering of the \Celeven standard (although the section numbering differs). 142 142 Unfortunately, this means the manual contains more ``forward references'' than usual, making it harder to follow if the reader does not have a copy of the \Celeven standard. 143 For a simple introduction to \CFA, see the companion document ``An Overview of \CFA'' 144 \cite{Ditchfield96:Overview}. 143 For a simple introduction to \CFA, see~\cite{Cforall}. 145 144 146 145 \begin{rationale} … … 596 595 \begin{rationale} 597 596 Since each subsection describes the interpretations of an expression in terms of the interpretations of its subexpressions, this chapter can be taken as describing an overload resolution algorithm that uses one bottom-up pass over an expression tree. 598 Such an algorithm was first described (for Ada) by Baker~\cite{Bak :overload}.597 Such an algorithm was first described (for Ada) by Baker~\cite{Baker82}. 599 598 It is extended here to handle polymorphic functions and arithmetic conversions. 600 599 The overload resolution rules and the predefined functions have been chosen so that, in programs that do not introduce overloaded declarations, expressions will have the same meaning in C and in \CFA. … … 3775 3774 3776 3775 \bibliographystyle{plain} 3777 \bibliography{ cfa}3776 \bibliography{pl} 3778 3777 3779 3778 -
doc/user/.gitignore
rf9feab8 r90152a4 1 1 # generated by latex 2 *.aux 3 *.bbl 4 *.blg 5 *.brf 6 *.dvi 7 *.idx 8 *.ilg 9 *.ind 10 *.log 11 *.out 2 build/* 12 3 *.pdf 13 4 *.ps 14 *.toc -
doc/user/Makefile
rf9feab8 r90152a4 1 ## Define the appropriateconfiguration variables.1 ## Define the configuration variables. 2 2 3 TeXLIB = .:../LaTeXmacros:../bibliography/: 4 LaTeX = TEXINPUTS=${TeXLIB} && export TEXINPUTS && latex -halt-on-error 3 Build = build 4 Figures = figures 5 Macros = ../LaTeXmacros 6 TeXLIB = .:${Macros}:${Build}:../bibliography: 7 LaTeX = TEXINPUTS=${TeXLIB} && export TEXINPUTS && latex -halt-on-error -output-directory=${Build} 5 8 BibTeX = BIBINPUTS=${TeXLIB} && export BIBINPUTS && bibtex 9 10 MAKEFLAGS = --no-print-directory --silent # 11 VPATH = ${Build} ${Figures} 6 12 7 13 ## Define the text source files. … … 32 38 33 39 DOCUMENT = user.pdf 40 BASE = ${basename ${DOCUMENT}} 34 41 35 42 # Directives # 43 44 .PHONY : all clean # not file names 36 45 37 46 all : ${DOCUMENT} 38 47 39 48 clean : 40 rm -f *.bbl *.aux *.dvi *.idx *.ilg *.ind *.brf *.out *.log *.toc *.blg *.pstex_t *.cf \ 41 ${FIGURES} ${PICTURES} ${PROGRAMS} ${GRAPHS} ${basename ${DOCUMENT}}.ps ${DOCUMENT} 49 @rm -frv ${DOCUMENT} ${BASE}.ps ${Build} 42 50 43 51 # File Dependencies # 44 52 45 ${DOCUMENT} : ${basename ${DOCUMENT}}.ps 53 build/version: ../../configure | ${Build} 54 ../../configure --version | grep "cfa-cc configure" | grep -oEe "([0-9]+\.)+[0-9]+" > $@ 55 56 ${DOCUMENT} : ${BASE}.ps 46 57 ps2pdf $< 47 58 48 ${ basename ${DOCUMENT}}.ps : ${basename ${DOCUMENT}}.dvi49 dvips $ < -o $@59 ${BASE}.ps : ${BASE}.dvi 60 dvips ${Build}/$< -o $@ 50 61 51 ${ basename ${DOCUMENT}}.dvi : Makefile ${GRAPHS} ${PROGRAMS} ${PICTURES} ${FIGURES} ${SOURCES} ${basename ${DOCUMENT}}.tex\52 ../LaTeXmacros/common.tex ../LaTeXmacros/lstlang.sty ../LaTeXmacros/indexstyle ../bibliography/cfa.bib62 ${BASE}.dvi : Makefile ${GRAPHS} ${PROGRAMS} ${PICTURES} ${FIGURES} ${SOURCES} \ 63 ${Macros}/common.tex ${Macros}/lstlang.sty ${Macros}/indexstyle ../bibliography/pl.bib build/version | ${Build} 53 64 # Conditionally create an empty *.ind (index) file for inclusion until makeindex is run. 54 if [ ! -r ${basename $@}.ind ] ; then touch ${ basename $@}.ind ; fi65 if [ ! -r ${basename $@}.ind ] ; then touch ${Build}/${basename $@}.ind ; fi 55 66 # Must have *.aux file containing citations for bibtex 56 67 if [ ! -r ${basename $@}.aux ] ; then ${LaTeX} ${basename $@}.tex ; fi 57 -${BibTeX} ${ basename $@}58 # Some citations reference others so run stepsagain to resolve these citations68 -${BibTeX} ${Build}/${basename $@} 69 # Some citations reference others so run again to resolve these citations 59 70 ${LaTeX} ${basename $@}.tex 60 -${BibTeX} ${ basename $@}71 -${BibTeX} ${Build}/${basename $@} 61 72 # Make index from *.aux entries and input index at end of document 62 makeindex -s ../LaTeXmacros/indexstyle ${basename $@}.idx 73 makeindex -s ${Macros}/indexstyle ${Build}/${basename $@}.idx 74 # Run again to finish citations 63 75 ${LaTeX} ${basename $@}.tex 64 76 # Run again to get index title into table of contents 65 77 ${LaTeX} ${basename $@}.tex 66 78 67 predefined :68 sed -f predefined.sed ${basename ${DOCUMENT}}.tex > ${basename $@}.cf69 70 79 ## Define the default recipes. 71 80 72 %.tex : %.fig 73 fig2dev -L eepic $< > $@81 ${Build}: 82 mkdir -p ${Build} 74 83 75 %. ps : %.fig76 fig2dev -L ps $< >$@84 %.tex : %.fig | ${Build} 85 fig2dev -L eepic $< > ${Build}/$@ 77 86 78 %.pstex : %.fig 79 fig2dev -L pstex $< > $@ 80 fig2dev -L pstex_t -p $@ $< > $@_t 87 %.ps : %.fig | ${Build} 88 fig2dev -L ps $< > ${Build}/$@ 89 90 %.pstex : %.fig | ${Build} 91 fig2dev -L pstex $< > ${Build}/$@ 92 fig2dev -L pstex_t -p ${Build}/$@ $< > ${Build}/$@_t 81 93 82 94 # Local Variables: # -
doc/user/user.tex
rf9feab8 r90152a4 1 1 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -*- Mode: Latex -*- %%%%%%%%%%%%%%%%%%%%%%%%%%%% 2 %% 2 %% 3 3 %% Cforall Version 1.0.0 Copyright (C) 2016 University of Waterloo 4 4 %% 5 5 %% The contents of this file are covered under the licence agreement in the 6 6 %% file "LICENCE" distributed with Cforall. 7 %% 8 %% user.tex -- 9 %% 7 %% 8 %% user.tex -- 9 %% 10 10 %% Author : Peter A. Buhr 11 11 %% Created On : Wed Apr 6 14:53:29 2016 12 12 %% Last Modified By : Peter A. Buhr 13 %% Last Modified On : Mon Nov 27 18:09:59 201714 %% Update Count : 3 14313 %% Last Modified On : Thu Jul 26 17:29:05 2018 14 %% Update Count : 3366 15 15 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 16 16 … … 40 40 \usepackage[dvips,plainpages=false,pdfpagelabels,pdfpagemode=UseNone,colorlinks=true,pagebackref=true,linkcolor=blue,citecolor=blue,urlcolor=blue,pagebackref=true,breaklinks=true]{hyperref} 41 41 \usepackage{breakurl} 42 \renewcommand{\UrlFont}{\small\sf}43 42 44 43 \usepackage[pagewise]{lineno} … … 73 72 74 73 % Names used in the document. 75 \newcommand{\Version}{\input{ ../../version}}74 \newcommand{\Version}{\input{build/version}} 76 75 \newcommand{\Textbf}[2][red]{{\color{#1}{\textbf{#2}}}} 77 76 \newcommand{\Emph}[2][red]{{\color{#1}\textbf{\emph{#2}}}} … … 147 146 \CFA adds many modern programming-language features that directly lead to increased \emph{\Index{safety}} and \emph{\Index{productivity}}, while maintaining interoperability with existing C programs and achieving similar performance. 148 147 Like C, \CFA is a statically typed, procedural (non-\Index{object-oriented}) language with a low-overhead runtime, meaning there is no global \Index{garbage-collection}, but \Index{regional garbage-collection}\index{garbage-collection!regional} is possible. 149 The primary new features include p arametric-polymorphic routines and types, exceptions, concurrency, and modules.148 The primary new features include polymorphic routines and types, exceptions, concurrency, and modules. 150 149 151 150 One of the main design philosophies of \CFA is to ``\Index{describe not prescribe}'', which means \CFA tries to provide a pathway from low-level C programming to high-level \CFA programming, but it does not force programmers to ``do the right thing''. … … 156 155 As well, new programs can be written in \CFA using a combination of C and \CFA features. 157 156 158 \Index*[C++]{\CC{}} had a similar goal 30 years ago, allowing object-oriented programming to be incrementally added to C.159 However, \CC currently has the disadvantages of a strong object-oriented bias, multiple legacy design-choices that cannot be updated, and active divergence of the language model from C, all of which requiressignificant effort and training to incrementally add \CC to a C-based project.157 \Index*[C++]{\CC{}}~\cite{c++:v1} had a similar goal 30 years ago, allowing object-oriented programming to be incrementally added to C. 158 However, \CC currently has the disadvantages of a strong object-oriented bias, multiple legacy design-choices that cannot be updated, and active divergence of the language model from C, requiring significant effort and training to incrementally add \CC to a C-based project. 160 159 In contrast, \CFA has 30 years of hindsight and a clean starting point. 161 160 162 161 Like \Index*[C++]{\CC{}}, there may be both an old and new ways to achieve the same effect. 163 For example, the following programs compare the \CFA, C, and \CC I/O mechanisms, where the programs output the same result.164 \begin{ quote2}162 For example, the following programs compare the C, \CFA, and \CC I/O mechanisms, where the programs output the same result. 163 \begin{center} 165 164 \begin{tabular}{@{}l@{\hspace{1.5em}}l@{\hspace{1.5em}}l@{}} 166 165 \multicolumn{1}{c@{\hspace{1.5em}}}{\textbf{C}} & \multicolumn{1}{c}{\textbf{\CFA}} & \multicolumn{1}{c}{\textbf{\CC}} \\ … … 192 191 \end{cfa} 193 192 \end{tabular} 194 \end{ quote2}193 \end{center} 195 194 While the \CFA I/O looks similar to the \Index*[C++]{\CC{}} output style, there are important differences, such as automatic spacing between variables as in \Index*{Python} (see~\VRef{s:IOLibrary}). 196 195 … … 198 197 199 198 This document is a programmer reference-manual for the \CFA programming language. 200 The manual covers the core features of the language and runtime-system, with simple examples illustrating syntax and semantics of each feature.199 The manual covers the core features of the language and runtime-system, with simple examples illustrating syntax and semantics of features. 201 200 The manual does not teach programming, \ie how to combine the new constructs to build complex programs. 202 A reader should alreadyhave an intermediate knowledge of control flow, data structures, and concurrency issues to understand the ideas presented, as well as some experience programming in C/\CC.201 The reader must have an intermediate knowledge of control flow, data structures, and concurrency issues to understand the ideas presented, as well as some experience programming in C/\CC. 203 202 Implementers should refer to the \CFA Programming Language Specification for details about the language syntax and semantics. 204 203 Changes to the syntax and additional features are expected to be included in later revisions. … … 207 206 \section{Why fix C?} 208 207 209 The C programming language is a foundational technology for modern computing with millions of lines of code implementing everything from commercial operating-systems (especially UNIX systems) to hobby projects.208 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. 210 209 This installation base and the programmers producing it represent a massive software-engineering investment spanning decades and likely to continue for decades more. 211 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. 212 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. 213 The TIOBE index~\cite{TIOBE} for March 2016 showed the following programming-language popularity: \Index*{Java} 20.5\%, C 14.5\%, \Index*[C++]{\CC{}} 6.7\%, \Csharp 4.3\%, \Index*{Python} 4.3\%, where the next 50 languages are less than 3\% eachwith a long tail.214 As well, for 30 years, C has been the number 1 and 2 most popular programming language: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. 213 The top 3 rankings over the past 30 years are: 215 214 \begin{center} 216 \setlength{\tabcolsep}{1.5ex} 217 \begin{tabular}{@{}r|c|c|c|c|c|c|c@{}} 218 Ranking & 2016 & 2011 & 2006 & 2001 & 1996 & 1991 & 1986 \\ 219 \hline 220 Java & 1 & 1 & 1 & 3 & 29 & - & - \\ 221 \hline 222 \R{C} & \R{2} & \R{2} & \R{2} & \R{1} & \R{1} & \R{1} & \R{1} \\ 223 \hline 224 \CC & 3 & 3 & 3 & 2 & 2 & 2 & 7 \\ 215 \setlength{\tabcolsep}{10pt} 216 \begin{tabular}{@{}rccccccc@{}} 217 & 2018 & 2013 & 2008 & 2003 & 1998 & 1993 & 1988 \\ \hline 218 Java & 1 & 2 & 1 & 1 & 16 & - & - \\ 219 \R{C} & \R{2} & \R{1} & \R{2} & \R{2} & \R{1} & \R{1} & \R{1} \\ 220 \CC & 3 & 4 & 3 & 3 & 2 & 2 & 5 \\ 225 221 \end{tabular} 226 222 \end{center} 227 223 Hence, C is still an extremely important programming language, with double the usage of \Index*[C++]{\CC{}}; in many cases, \CC is often used solely as a better C. 228 224 Love it or hate it, C has been an important and influential part of computer science for 40 years and its appeal is not diminishing. 229 Unfortunately, C has many problems and omissions that make it an unacceptable programming language for modern needs.225 Nevertheless, C has many problems and omissions that make it an unacceptable programming language for modern needs. 230 226 231 227 As stated, the goal of the \CFA project is to engineer modern language-features into C in an evolutionary rather than revolutionary way. … … 237 233 These languages have different syntax and semantics from C, do not interoperate directly with C, and are not systems languages because of restrictive memory-management or garbage collection. 238 234 As a result, there is a significant learning curve to move to these languages, and C legacy-code must be rewritten. 239 These costs can be prohibitive for many companies with a large software-base in C/\CC, and a significant number of programmers require retraining to the new programming language. 240 241 The result of this project is a language that is largely backwards compatible with \Index*[C11]{\Celeven{}}~\cite{C11}, but fixes many of the well known C problems while containing modern language-features. 242 Without significant extension to the C programming language, it is becoming unable to cope with the needs of modern programming problems and programmers; 235 These costs can be prohibitive for many companies with a large software-base in C/\CC, and a significant number of programmers require retraining in the new programming language. 236 237 The result of this project is a language that is largely backwards compatible with \Index*[C11]{\Celeven{}}~\cite{C11}, but fixes many of the well known C problems while adding modern language-features. 238 To achieve these goals required a significant engineering exercise, where we had to ``think inside the existing C box''. 239 Without these significant extension to C, it is unable to cope with the needs of modern programming problems and programmers; 243 240 as a result, it will fade into disuse. 244 241 Considering the large body of existing C code and programmers, there is significant impetus to ensure C is transformed into a modern programming language. … … 256 253 \begin{lstlisting} 257 254 ®forall( otype T )® T identity( T val ) { return val; } 258 int forty_two = identity( 42 ); §\C{// T is bound to int, forty\_two == 42}§255 int forty_two = identity( 42 ); §\C{// T is bound to int, forty\_two == 42}§ 259 256 \end{lstlisting} 260 257 % extending the C type system with parametric polymorphism and overloading, as opposed to the \Index*[C++]{\CC{}} approach of object-oriented extensions. … … 275 272 276 273 \begin{comment} 277 A simple example is leveraging the existing type-unsafe (©void *©) C ©bsearch© to binary search a sorted floating -pointarray:274 A simple example is leveraging the existing type-unsafe (©void *©) C ©bsearch© to binary search a sorted floating array: 278 275 \begin{lstlisting} 279 276 void * bsearch( const void * key, const void * base, size_t dim, size_t size, … … 283 280 *(double *)t2 < *(double *)t1 ? 1 : 0; } 284 281 285 double key = 5.0, vals[10] = { /* 10 sorted floating -pointvalues */ };286 double * val = (double *)bsearch( &key, vals, 10, sizeof(vals[0]), comp ); $\C{// search sorted array}$282 double key = 5.0, vals[10] = { /* 10 sorted floating values */ }; 283 double * val = (double *)bsearch( &key, vals, 10, sizeof(vals[0]), comp ); §\C{// search sorted array}§ 287 284 \end{lstlisting} 288 285 which can be augmented simply with a polymorphic, type-safe, \CFA-overloaded wrappers: … … 293 290 294 291 forall( otype T | { int ?<?( T, T ); } ) unsigned int bsearch( T key, const T * arr, size_t size ) { 295 T * result = bsearch( key, arr, size ); $\C{// call first version}$296 return result ? result - arr : size; } $\C{// pointer subtraction includes sizeof(T)}$297 298 double * val = bsearch( 5.0, vals, 10 ); $\C{// selection based on return type}$292 T * result = bsearch( key, arr, size ); §\C{// call first version}§ 293 return result ? result - arr : size; } §\C{// pointer subtraction includes sizeof(T)}§ 294 295 double * val = bsearch( 5.0, vals, 10 ); §\C{// selection based on return type}§ 299 296 int posn = bsearch( 5.0, vals, 10 ); 300 297 \end{lstlisting} … … 308 305 \begin{lstlisting} 309 306 forall( dtype T | sized(T) ) T * malloc( void ) { return (T *)malloc( sizeof(T) ); } 310 int * ip = malloc(); §\C{// select type and size from left-hand side}§307 int * ip = malloc(); §\C{// select type and size from left-hand side}§ 311 308 double * dp = malloc(); 312 309 struct S {...} * sp = malloc(); … … 319 316 Whereas, \CFA wraps each of these routines into ones with the overloaded name ©abs©: 320 317 \begin{cfa} 321 char abs( char );322 ®extern "C" {® int abs( int ); ®}®§\C{// use default C routine for int}§323 long int abs( long int );324 long long int abs( long long int );325 float abs( float );326 double abs( double );327 long double abs( long double );328 float _Complex abs( float _Complex );329 double _Complex abs( double _Complex );330 long double _Complex abs( long double _Complex );318 char ®abs®( char ); 319 extern "C" { int ®abs®( int ); } §\C{// use default C routine for int}§ 320 long int ®abs®( long int ); 321 long long int ®abs®( long long int ); 322 float ®abs®( float ); 323 double ®abs®( double ); 324 long double ®abs®( long double ); 325 float _Complex ®abs®( float _Complex ); 326 double _Complex ®abs®( double _Complex ); 327 long double _Complex ®abs®( long double _Complex ); 331 328 \end{cfa} 332 329 The problem is the name clash between the library routine ©abs© and the \CFA names ©abs©. 333 330 Hence, names appearing in an ©extern "C"© block have \newterm*{C linkage}. 334 331 Then overloading polymorphism uses a mechanism called \newterm{name mangling}\index{mangling!name} to create unique names that are different from C names, which are not mangled. 335 Hence, there is the same need as in \CC, to know if a name is a C or \CFA name, so it can be correctly formed.336 There is no way around this problem, other than C's approach of creating unique names for each pairing of operation and type .332 Hence, there is the same need, as in \CC, to know if a name is a C or \CFA name, so it can be correctly formed. 333 There is no way around this problem, other than C's approach of creating unique names for each pairing of operation and types. 337 334 338 335 This example strongly illustrates a core idea in \CFA: \emph{the \Index{power of a name}}. … … 351 348 \begin{description} 352 349 \item 353 \Indexc{-std=gnu 99}\index{compilation option!-std=gnu99@{©-std=gnu99©}}354 The 1999C standard plus GNU extensions.355 \item 356 \Indexc[deletekeywords=inline]{-fgnu89-inline}\index{compilation option!-fgnu89-inline@{\lstinline[deletekeywords=inline] $-fgnu89-inline$}}357 Use the traditional GNU semantics for inline routines in C 99mode, which allows inline routines in header files.350 \Indexc{-std=gnu11}\index{compilation option!-std=gnu11@{©-std=gnu11©}} 351 The 2011 C standard plus GNU extensions. 352 \item 353 \Indexc[deletekeywords=inline]{-fgnu89-inline}\index{compilation option!-fgnu89-inline@{\lstinline[deletekeywords=inline]@-fgnu89-inline@}} 354 Use the traditional GNU semantics for inline routines in C11 mode, which allows inline routines in header files. 358 355 \end{description} 359 356 The following new \CFA options are available: … … 428 425 \begin{cfa} 429 426 #ifndef __CFORALL__ 430 #include <stdio.h>§\indexc{stdio.h}§ §\C{// C header file}§427 #include <stdio.h>§\indexc{stdio.h}§ §\C{// C header file}§ 431 428 #else 432 #include <fstream>§\indexc{fstream}§ §\C{// \CFA header file}§429 #include <fstream>§\indexc{fstream}§ §\C{// \CFA header file}§ 433 430 #endif 434 431 \end{cfa} 435 which conditionally includes the correct header file, if the program is compiled using \Indexc{gcc} or \Indexc{cfa}. 432 which conditionally includes the correct header file, if the program is compiled using \Indexc{gcc} or \Indexc{cfa}. 433 434 435 \section{Backquote Identifiers} 436 \label{s:BackquoteIdentifiers} 437 438 \CFA introduces several new keywords (see \VRef{s:CFAKeywords}) that can clash with existing C variable-names in legacy code. 439 Keyword clashes are accommodated by syntactic transformations using the \CFA backquote escape-mechanism: 440 \begin{cfa} 441 int ®`®otype®`® = 3; §\C{// make keyword an identifier}§ 442 double ®`®forall®`® = 3.5; 443 \end{cfa} 444 445 Existing C programs with keyword clashes can be converted by enclosing keyword identifiers in backquotes, and eventually the identifier name can be changed to a non-keyword name. 446 \VRef[Figure]{f:HeaderFileInterposition} shows how clashes in existing C header-files (see~\VRef{s:StandardHeaders}) can be handled using preprocessor \newterm{interposition}: ©#include_next© and ©-I filename©. 447 Several common C header-files with keyword clashes are fixed in the standard \CFA header-library, so there is a seamless programming-experience. 448 449 \begin{figure} 450 \begin{cfa} 451 // include file uses the CFA keyword "with". 452 #if ! defined( with ) §\C{// nesting ?}§ 453 #define with ®`®with®`® §\C{// make keyword an identifier}§ 454 #define __CFA_BFD_H__ 455 #endif 456 457 ®#include_next <bfdlink.h> §\C{// must have internal check for multiple expansion}§ 458 ® 459 #if defined( with ) && defined( __CFA_BFD_H__ ) §\C{// reset only if set}§ 460 #undef with 461 #undef __CFA_BFD_H__ 462 #endif 463 \end{cfa} 464 \caption{Header-File Interposition} 465 \label{f:HeaderFileInterposition} 466 \end{figure} 436 467 437 468 … … 440 471 Numeric constants are extended to allow \Index{underscore}s\index{constant!underscore}, \eg: 441 472 \begin{cfa} 442 2®_®147®_®483®_®648; §\C{// decimal constant}§443 56®_®ul; §\C{// decimal unsigned long constant}§444 0®_®377; §\C{// octal constant}§445 0x®_®ff®_®ff; §\C{// hexadecimal constant}§446 0x®_®ef3d®_®aa5c; §\C{// hexadecimal constant}§447 3.141®_®592®_®654; §\C{// floating pointconstant}§448 10®_®e®_®+1®_®00; §\C{// floating pointconstant}§449 0x®_®ff®_®ff®_®p®_®3; §\C{// hexadecimal floating point}§450 0x®_®1.ffff®_®ffff®_®p®_®128®_®l; §\C{// hexadecimal floating pointlong constant}§473 2®_®147®_®483®_®648; §\C{// decimal constant}§ 474 56®_®ul; §\C{// decimal unsigned long constant}§ 475 0®_®377; §\C{// octal constant}§ 476 0x®_®ff®_®ff; §\C{// hexadecimal constant}§ 477 0x®_®ef3d®_®aa5c; §\C{// hexadecimal constant}§ 478 3.141®_®592®_®654; §\C{// floating constant}§ 479 10®_®e®_®+1®_®00; §\C{// floating constant}§ 480 0x®_®ff®_®ff®_®p®_®3; §\C{// hexadecimal floating}§ 481 0x®_®1.ffff®_®ffff®_®p®_®128®_®l; §\C{// hexadecimal floating long constant}§ 451 482 L®_®§"\texttt{\textbackslash{x}}§®_®§\texttt{ff}§®_®§\texttt{ee}"§; §\C{// wide character constant}§ 452 483 \end{cfa} … … 470 501 471 502 472 \section{Backquote Identifiers} 473 \label{s:BackquoteIdentifiers} 474 475 \CFA introduces several new keywords (see \VRef{s:CFAKeywords}) that can clash with existing C variable-names in legacy code. 476 Keyword clashes are accommodated by syntactic transformations using the \CFA backquote escape-mechanism: 477 \begin{cfa} 478 int ®`®otype®`® = 3; §\C{// make keyword an identifier}§ 479 double ®`®forall®`® = 3.5; 480 \end{cfa} 481 482 Existing C programs with keyword clashes can be converted by enclosing keyword identifiers in backquotes, and eventually the identifier name can be changed to a non-keyword name. 483 \VRef[Figure]{f:HeaderFileInterposition} shows how clashes in existing C header-files (see~\VRef{s:StandardHeaders}) can be handled using preprocessor \newterm{interposition}: ©#include_next© and ©-I filename©. 484 Several common C header-files with keyword clashes are fixed in the standard \CFA header-library, so there is a seamless programming-experience. 485 486 \begin{figure} 487 \begin{cfa} 488 // include file uses the CFA keyword "with". 489 #if ! defined( with ) §\C{// nesting ?}§ 490 #define with ®`®with®`® §\C{// make keyword an identifier}§ 491 #define __CFA_BFD_H__ 492 #endif 493 494 ®#include_next <bfdlink.h> §\C{// must have internal check for multiple expansion}§ 495 ® 496 #if defined( with ) && defined( __CFA_BFD_H__ ) §\C{// reset only if set}§ 497 #undef with 498 #undef __CFA_BFD_H__ 499 #endif 500 \end{cfa} 501 \caption{Header-File Interposition} 502 \label{f:HeaderFileInterposition} 503 \end{figure} 504 505 506 \section{\texorpdfstring{Labelled \LstKeywordStyle{continue} / \LstKeywordStyle{break}}{Labelled continue / break}} 503 \section{Exponentiation Operator} 504 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$. 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 509 As for \Index{division}, there are exponentiation operators for integral and floating types, including the builtin \Index{complex} types. 510 Unsigned integral exponentiation\index{exponentiation!unsigned integral} is performed with repeated multiplication\footnote{The multiplication computation is $O(\log y)$.} (or shifting if the base is 2). 511 Signed integral exponentiation\index{exponentiation!signed integral} is performed with repeated multiplication (or shifting if the base is 2), but yields a floating result because $x^{-y}=1/x^y$. 512 Hence, it is important to designate exponent integral-constants as unsigned or signed: ©3 \ 3u© return an integral result, while ©3 \ 3© returns a floating result. 513 Floating exponentiation\index{exponentiation!floating} is performed using \Index{logarithm}s\index{exponentiation!logarithm}, so the base cannot be negative. 514 \begin{cfa} 515 sout | 2 ®\® 8u | 4 ®\® 3u | -4 ®\® 3u | 4 ®\® -3 | -4 ®\® -3 | 4.0 ®\® 2.1 | (1.0f+2.0fi) ®\® (3.0f+2.0fi) | endl; 516 256 64 -64 0.015625 -0.015625 18.3791736799526 0.264715-1.1922i 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©. 519 The exponentiation operator is available for all the basic types, but for user-defined types, only the integral-computation versions are available. 520 For returning an integral value, the user type ©T© must define multiplication, ©*©, and one, ©1©; 521 for returning a floating value, an additional divide of type ©T© into a ©double© returning a ©double© (©double ?/?( double, T )©) is necessary for negative exponents. 522 523 524 \section{Control Structures} 525 526 \CFA identifies inconsistent, problematic, and missing control structures in C, and extends, modifies, and adds control structures to increase functionality and safety. 527 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.} 539 The scope of the declaration(s) is local to the @if@ statement but exist within both the ``then'' and ``else'' clauses. 540 541 542 %\section{\texorpdfstring{\protect\lstinline@switch@ Statement}{switch Statement}} 543 \subsection{\texorpdfstring{\LstKeywordStyle{switch} Statement}{switch Statement}} 544 545 C allows a number of questionable forms for the ©switch© statement: 546 \begin{enumerate} 547 \item 548 By default, the end of a ©case© clause\footnote{ 549 In this section, the term \emph{case clause} refers to either a ©case© or ©default© clause.} 550 \emph{falls through} to the next ©case© clause in the ©switch© statement; 551 to exit a ©switch© statement from a ©case© clause requires explicitly terminating the clause with a transfer statement, most commonly ©break©: 552 \begin{cfa} 553 switch ( i ) { 554 case 1: 555 ... 556 // fall-through 557 case 2: 558 ... 559 break; // exit switch statement 560 } 561 \end{cfa} 562 The ability to fall-through to the next clause \emph{is} a useful form of control flow, specifically when a sequence of case actions compound: 563 \begin{cquote} 564 \begin{tabular}{@{}l@{\hspace{3em}}l@{}} 565 \begin{cfa} 566 switch ( argc ) { 567 case 3: 568 // open output file 569 // fall-through 570 case 2: 571 // open input file 572 break; // exit switch statement 573 default: 574 // usage message 575 } 576 \end{cfa} 577 & 578 \begin{cfa} 579 580 if ( argc == 3 ) { 581 // open output file 582 ®// open input file 583 ®} else if ( argc == 2 ) { 584 ®// open input file (duplicate) 585 586 ®} else { 587 // usage message 588 } 589 \end{cfa} 590 \end{tabular} 591 \end{cquote} 592 In this example, case 2 is always done if case 3 is done. 593 This control flow is difficult to simulate with if statements or a ©switch© statement without fall-through as code must be duplicated or placed in a separate routine. 594 C also uses fall-through to handle multiple case-values resulting in the same action: 595 \begin{cfa} 596 switch ( i ) { 597 ®case 1: case 3: case 5:® // odd values 598 // odd action 599 break; 600 ®case 2: case 4: case 6:® // even values 601 // even action 602 break; 603 } 604 \end{cfa} 605 However, this situation is handled in other languages without fall-through by allowing a list of case values. 606 While fall-through itself is not a problem, the problem occurs when fall-through is the default, as this semantics is unintuitive to many programmers and is different from virtually all other programming languages with a ©switch© statement. 607 Hence, default fall-through semantics results in a large number of programming errors as programmers often \emph{forget} the ©break© statement at the end of a ©case© clause, resulting in inadvertent fall-through. 608 609 \item 610 It is possible to place ©case© clauses on statements nested \emph{within} the body of the ©switch© statement: 611 \begin{cfa} 612 switch ( i ) { 613 case 0: 614 if ( j < k ) { 615 ... 616 ®case 1:® // transfer into "if" statement 617 ... 618 } // if 619 case 2: 620 while ( j < 5 ) { 621 ... 622 ®case 3:® // transfer into "while" statement 623 ... 624 } // while 625 } // switch 626 \end{cfa} 627 The problem with this usage is branching into control structures, which is known to cause both comprehension and technical difficulties. 628 The comprehension problem occurs from the inability to determine how control reaches a particular point due to the number of branches leading to it. 629 The technical problem results from the inability to ensure declaration and initialization of variables when blocks are not entered at the beginning. 630 There are no positive arguments for this kind of control flow, and therefore, there is a strong impetus to eliminate it. 631 Nevertheless, C does have an idiom where this capability is used, known as ``\Index*{Duff's device}''~\cite{Duff83}: 632 \begin{cfa} 633 register int n = (count + 7) / 8; 634 switch ( count % 8 ) { 635 case 0: do{ *to = *from++; 636 case 7: *to = *from++; 637 case 6: *to = *from++; 638 case 5: *to = *from++; 639 case 4: *to = *from++; 640 case 3: *to = *from++; 641 case 2: *to = *from++; 642 case 1: *to = *from++; 643 } while ( --n > 0 ); 644 } 645 \end{cfa} 646 which unrolls a loop N times (N = 8 above) and uses the ©switch© statement to deal with any iterations not a multiple of N. 647 While efficient, this sort of special purpose usage is questionable: 648 \begin{quote} 649 Disgusting, no? But it compiles and runs just fine. I feel a combination of pride and revulsion at this 650 discovery.~\cite{Duff83} 651 \end{quote} 652 \item 653 It is possible to place the ©default© clause anywhere in the list of labelled clauses for a ©switch© statement, rather than only at the end. 654 Virtually all programming languages with a ©switch© statement require the ©default© clause to appear last in the case-clause list. 655 The logic for this semantics is that after checking all the ©case© clauses without success, the ©default© clause is selected; 656 hence, physically placing the ©default© clause at the end of the ©case© clause list matches with this semantics. 657 This physical placement can be compared to the physical placement of an ©else© clause at the end of a series of connected ©if©/©else© statements. 658 659 \item 660 It is possible to place unreachable code at the start of a ©switch© statement, as in: 661 \begin{cfa} 662 switch ( x ) { 663 ®int y = 1;® §\C{// unreachable initialization}§ 664 ®x = 7;® §\C{// unreachable code without label/branch}§ 665 case 0: ... 666 ... 667 ®int z = 0;® §\C{// unreachable initialization, cannot appear after case}§ 668 z = 2; 669 case 1: 670 ®x = z;® §\C{// without fall through, z is uninitialized}§ 671 } 672 \end{cfa} 673 While the declaration of the local variable ©y© is useful with a scope across all ©case© clauses, the initialization for such a variable is defined to never be executed because control always transfers over it. 674 Furthermore, any statements before the first ©case© clause can only be executed if labelled and transferred to using a ©goto©, either from outside or inside of the ©switch©, both of which are problematic. 675 As well, the declaration of ©z© cannot occur after the ©case© because a label can only be attached to a statement, and without a fall through to case 3, ©z© is uninitialized. 676 The key observation is that the ©switch© statement branches into control structure, \ie there are multiple entry points into its statement body. 677 \end{enumerate} 678 679 Before discussing potential language changes to deal with these problems, it is worth observing that in a typical C program: 680 \begin{itemize} 681 \item 682 the number of ©switch© statements is small, 683 \item 684 most ©switch© statements are well formed (\ie no \Index*{Duff's device}), 685 \item 686 the ©default© clause is usually written as the last case-clause, 687 \item 688 and there is only a medium amount of fall-through from one ©case© clause to the next, and most of these result from a list of case values executing common code, rather than a sequence of case actions that compound. 689 \end{itemize} 690 These observations put into perspective the \CFA changes to the ©switch©. 691 \begin{enumerate} 692 \item 693 Eliminating default fall-through has the greatest potential for affecting existing code. 694 However, even if fall-through is removed, most ©switch© statements would continue to work because of the explicit transfers already present at the end of each ©case© clause, the common placement of the ©default© clause at the end of the case list, and the most common use of fall-through, \ie a list of ©case© clauses executing common code, \eg: 695 \begin{cfa} 696 case 1: case 2: case 3: ... 697 \end{cfa} 698 still works. 699 Nevertheless, reversing the default action would have a non-trivial effect on case actions that compound, such as the above example of processing shell arguments. 700 Therefore, to preserve backwards compatibility, it is necessary to introduce a new kind of ©switch© statement, called ©choose©, with no implicit fall-through semantics and an explicit fall-through if the last statement of a case-clause ends with the new keyword ©fallthrough©/©fallthru©, \eg: 701 \begin{cfa} 702 ®choose® ( i ) { 703 case 1: case 2: case 3: 704 ... 705 ®// implicit end of switch (break) 706 ®case 5: 707 ... 708 ®fallthru®; §\C{// explicit fall through}§ 709 case 7: 710 ... 711 ®break® §\C{// explicit end of switch (redundant)}§ 712 default: 713 j = 3; 714 } 715 \end{cfa} 716 Like the ©switch© statement, the ©choose© statement retains the fall-through semantics for a list of ©case© clauses; 717 An implicit ©break© is applied only at the end of the \emph{statements} following a ©case© clause. 718 An explicit ©fallthru© is retained because it is a C-idiom most C programmers expect, and its absence might discourage programmers from using the ©choose© statement. 719 As well, allowing an explicit ©break© from the ©choose© is a carry over from the ©switch© statement, and expected by C programmers. 720 \item 721 \Index*{Duff's device} is eliminated from both ©switch© and ©choose© statements, and only invalidates a small amount of very questionable code. 722 Hence, the ©case© clause must appear at the same nesting level as the ©switch©/©choose© body, as is done in most other programming languages with ©switch© statements. 723 \item 724 The issue of ©default© at locations other than at the end of the cause clause can be solved by using good programming style, and there are a few reasonable situations involving fall-through where the ©default© clause needs to appear is locations other than at the end. 725 Therefore, no change is made for this issue. 726 \item 727 Dealing with unreachable code in a ©switch©/©choose© body is solved by restricting declarations and associated initialization to the start of statement body, which is executed \emph{before} the transfer to the appropriate ©case© clause\footnote{ 728 Essentially, these declarations are hoisted before the ©switch©/©choose© statement and both declarations and statement are surrounded by a compound statement.} and precluding statements before the first ©case© clause. 729 Further declarations at the same nesting level as the statement body are disallowed to ensure every transfer into the body is sound. 730 \begin{cfa} 731 switch ( x ) { 732 ®int i = 0;® §\C{// allowed only at start}§ 733 case 0: 734 ... 735 ®int j = 0;® §\C{// disallowed}§ 736 case 1: 737 { 738 ®int k = 0;® §\C{// allowed at different nesting levels}§ 739 ... 740 ®case 2:® §\C{// disallow case in nested statements}§ 741 } 742 ... 743 } 744 \end{cfa} 745 \end{enumerate} 746 747 748 %\section{\texorpdfstring{\protect\lstinline@case@ Clause}{case Clause}} 749 \subsection{\texorpdfstring{\LstKeywordStyle{case} Statement}{case Statement}} 750 751 C restricts the ©case© clause of a ©switch© statement to a single value. 752 For multiple ©case© clauses associated with the same statement, it is necessary to have multiple ©case© clauses rather than multiple values. 753 Requiring a ©case© clause for each value does not seem to be in the spirit of brevity normally associated with C. 754 Therefore, the ©case© clause is extended with a list of values, as in: 755 \begin{cquote} 756 \begin{tabular}{@{}l@{\hspace{3em}}l@{\hspace{2em}}l@{}} 757 \multicolumn{1}{c@{\hspace{3em}}}{\textbf{\CFA}} & \multicolumn{1}{c@{\hspace{2em}}}{\textbf{C}} \\ 758 \begin{cfa} 759 switch ( i ) { 760 case ®1, 3, 5®: 761 ... 762 case ®2, 4, 6®: 763 ... 764 } 765 \end{cfa} 766 & 767 \begin{cfa} 768 switch ( i ) { 769 case 1: case 3 : case 5: 770 ... 771 case 2: case 4 : case 6: 772 ... 773 } 774 \end{cfa} 775 & 776 \begin{cfa} 777 778 // odd values 779 780 // even values 781 782 783 \end{cfa} 784 \end{tabular} 785 \end{cquote} 786 In addition, subranges are allowed to specify case values.\footnote{ 787 gcc has the same mechanism but awkward syntax, \lstinline@2 ...42@, because a space is required after a number, otherwise the period is a decimal point.} 788 \begin{cfa} 789 switch ( i ) { 790 case ®1~5:® §\C{// 1, 2, 3, 4, 5}§ 791 ... 792 case ®10~15:® §\C{// 10, 11, 12, 13, 14, 15}§ 793 ... 794 } 795 \end{cfa} 796 Lists of subranges are also allowed. 797 \begin{cfa} 798 case ®1~5, 12~21, 35~42®: 799 \end{cfa} 800 801 802 %\subsection{\texorpdfstring{Labelled \protect\lstinline@continue@ / \protect\lstinline@break@}{Labelled continue / break}} 803 \subsection{\texorpdfstring{Labelled \LstKeywordStyle{continue} / \LstKeywordStyle{break} Statement}{Labelled continue / break Statement}} 507 804 508 805 While C provides ©continue© and ©break© statements for altering control flow, both are restricted to one level of nesting for a particular control structure. 509 806 Unfortunately, this restriction forces programmers to use \Indexc{goto} to achieve the equivalent control-flow for more than one level of nesting. 510 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.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. 511 808 For both ©continue© and ©break©, the target label must be directly associated with a ©for©, ©while© or ©do© statement; 512 809 for ©break©, the target label can also be associated with a ©switch©, ©if© or compound (©{}©) statement. … … 593 890 \end{figure} 594 891 595 Both labelled ©continue© and ©break© are a ©goto©\index{goto@\lstinline $goto$!restricted} restricted in the following ways:892 Both labelled ©continue© and ©break© are a ©goto©\index{goto@\lstinline@goto@!restricted} restricted in the following ways: 596 893 \begin{itemize} 597 894 \item … … 606 903 With ©goto©, the label is at the end of the control structure, which fails to convey this important clue early enough to the reader. 607 904 Finally, using an explicit target for the transfer instead of an implicit target allows new constructs to be added or removed without affecting existing constructs. 608 The implicit targets of the current ©continue© and ©break©, \ie the closest enclosing loop or ©switch©, change as certain constructs are added or removed. 609 610 611 \section{\texorpdfstring{\LstKeywordStyle{switch} Statement}{switch Statement}} 612 613 C allows a number of questionable forms for the ©switch© statement: 614 \begin{enumerate} 615 \item 616 By default, the end of a ©case© clause\footnote{ 617 In this section, the term \emph{case clause} refers to either a ©case© or ©default© clause.} 618 \emph{falls through} to the next ©case© clause in the ©switch© statement; 619 to exit a ©switch© statement from a ©case© clause requires explicitly terminating the clause with a transfer statement, most commonly ©break©: 620 \begin{cfa} 621 switch ( i ) { 622 case 1: 623 ... 624 // fall-through 625 case 2: 626 ... 627 break; // exit switch statement 628 } 629 \end{cfa} 630 The ability to fall-through to the next clause \emph{is} a useful form of control flow, specifically when a sequence of case actions compound: 631 \begin{quote2} 632 \begin{tabular}{@{}l@{\hspace{3em}}l@{}} 633 \begin{cfa} 634 switch ( argc ) { 635 case 3: 636 // open output file 637 // fall-through 638 case 2: 639 // open input file 640 break; // exit switch statement 641 default: 642 // usage message 643 } 644 \end{cfa} 645 & 646 \begin{cfa} 647 648 if ( argc == 3 ) { 649 // open output file 650 ®// open input file 651 ®} else if ( argc == 2 ) { 652 ®// open input file (duplicate) 653 654 ®} else { 655 // usage message 656 } 657 \end{cfa} 658 \end{tabular} 659 \end{quote2} 660 In this example, case 2 is always done if case 3 is done. 661 This control flow is difficult to simulate with if statements or a ©switch© statement without fall-through as code must be duplicated or placed in a separate routine. 662 C also uses fall-through to handle multiple case-values resulting in the same action: 663 \begin{cfa} 664 switch ( i ) { 665 ®case 1: case 3: case 5:® // odd values 666 // odd action 667 break; 668 ®case 2: case 4: case 6:® // even values 669 // even action 670 break; 671 } 672 \end{cfa} 673 However, this situation is handled in other languages without fall-through by allowing a list of case values. 674 While fall-through itself is not a problem, the problem occurs when fall-through is the default, as this semantics is unintuitive to many programmers and is different from virtually all other programming languages with a ©switch© statement. 675 Hence, default fall-through semantics results in a large number of programming errors as programmers often \emph{forget} the ©break© statement at the end of a ©case© clause, resulting in inadvertent fall-through. 676 677 \item 678 It is possible to place ©case© clauses on statements nested \emph{within} the body of the ©switch© statement: 679 \begin{cfa} 680 switch ( i ) { 681 case 0: 682 if ( j < k ) { 683 ... 684 ®case 1:® // transfer into "if" statement 685 ... 686 } // if 687 case 2: 688 while ( j < 5 ) { 689 ... 690 ®case 3:® // transfer into "while" statement 691 ... 692 } // while 693 } // switch 694 \end{cfa} 695 The problem with this usage is branching into control structures, which is known to cause both comprehension and technical difficulties. 696 The comprehension problem occurs from the inability to determine how control reaches a particular point due to the number of branches leading to it. 697 The technical problem results from the inability to ensure declaration and initialization of variables when blocks are not entered at the beginning. 698 There are no positive arguments for this kind of control flow, and therefore, there is a strong impetus to eliminate it. 699 Nevertheless, C does have an idiom where this capability is used, known as ``\Index*{Duff's device}''~\cite{Duff83}: 700 \begin{cfa} 701 register int n = (count + 7) / 8; 702 switch ( count % 8 ) { 703 case 0: do{ *to = *from++; 704 case 7: *to = *from++; 705 case 6: *to = *from++; 706 case 5: *to = *from++; 707 case 4: *to = *from++; 708 case 3: *to = *from++; 709 case 2: *to = *from++; 710 case 1: *to = *from++; 711 } while ( --n > 0 ); 712 } 713 \end{cfa} 714 which unrolls a loop N times (N = 8 above) and uses the ©switch© statement to deal with any iterations not a multiple of N. 715 While efficient, this sort of special purpose usage is questionable: 716 \begin{quote} 717 Disgusting, no? But it compiles and runs just fine. I feel a combination of pride and revulsion at this 718 discovery.~\cite{Duff83} 719 \end{quote} 720 \item 721 It is possible to place the ©default© clause anywhere in the list of labelled clauses for a ©switch© statement, rather than only at the end. 722 Virtually all programming languages with a ©switch© statement require the ©default© clause to appear last in the case-clause list. 723 The logic for this semantics is that after checking all the ©case© clauses without success, the ©default© clause is selected; 724 hence, physically placing the ©default© clause at the end of the ©case© clause list matches with this semantics. 725 This physical placement can be compared to the physical placement of an ©else© clause at the end of a series of connected ©if©/©else© statements. 726 727 \item 728 It is possible to place unreachable code at the start of a ©switch© statement, as in: 729 \begin{cfa} 730 switch ( x ) { 731 ®int y = 1;® §\C{// unreachable initialization}§ 732 ®x = 7;® §\C{// unreachable code without label/branch}§ 733 case 3: ... 734 ... 735 ®int z = 0;® §\C{// unreachable initialization, cannot appear after case}§ 736 z = 2; 737 case 3: 738 ®x = z;® §\C{// without fall through, z is uninitialized}§ 739 } 740 \end{cfa} 741 While the declaration of the local variable ©y© is useful with a scope across all ©case© clauses, the initialization for such a variable is defined to never be executed because control always transfers over it. 742 Furthermore, any statements before the first ©case© clause can only be executed if labelled and transferred to using a ©goto©, either from outside or inside of the ©switch©, both of which are problematic. 743 As well, the declaration of ©z© cannot occur after the ©case© because a label can only be attached to a statement, and without a fall through to case 3, ©z© is uninitialized. 744 The key observation is that the ©switch© statement branches into control structure, \ie there are multiple entry points into its statement body. 745 \end{enumerate} 746 747 Before discussing potential language changes to deal with these problems, it is worth observing that in a typical C program: 748 \begin{itemize} 749 \item 750 the number of ©switch© statements is small, 751 \item 752 most ©switch© statements are well formed (\ie no \Index*{Duff's device}), 753 \item 754 the ©default© clause is usually written as the last case-clause, 755 \item 756 and there is only a medium amount of fall-through from one ©case© clause to the next, and most of these result from a list of case values executing common code, rather than a sequence of case actions that compound. 757 \end{itemize} 758 These observations put into perspective the \CFA changes to the ©switch©. 759 \begin{enumerate} 760 \item 761 Eliminating default fall-through has the greatest potential for affecting existing code. 762 However, even if fall-through is removed, most ©switch© statements would continue to work because of the explicit transfers already present at the end of each ©case© clause, the common placement of the ©default© clause at the end of the case list, and the most common use of fall-through, \ie a list of ©case© clauses executing common code, \eg: 763 \begin{cfa} 764 case 1: case 2: case 3: ... 765 \end{cfa} 766 still works. 767 Nevertheless, reversing the default action would have a non-trivial effect on case actions that compound, such as the above example of processing shell arguments. 768 Therefore, to preserve backwards compatibility, it is necessary to introduce a new kind of ©switch© statement, called ©choose©, with no implicit fall-through semantics and an explicit fall-through if the last statement of a case-clause ends with the new keyword ©fallthrough©/©fallthru©, \eg: 769 \begin{cfa} 770 ®choose® ( i ) { 771 case 1: case 2: case 3: 772 ... 773 ®// implicit end of switch (break) 774 ®case 5: 775 ... 776 ®fallthru®; §\C{// explicit fall through}§ 777 case 7: 778 ... 779 ®break® §\C{// explicit end of switch (redundant)}§ 780 default: 781 j = 3; 782 } 783 \end{cfa} 784 Like the ©switch© statement, the ©choose© statement retains the fall-through semantics for a list of ©case© clauses; 785 An implicit ©break© is applied only at the end of the \emph{statements} following a ©case© clause. 786 An explicit ©fallthru© is retained because it is a C-idiom most C programmers expect, and its absence might discourage programmers from using the ©choose© statement. 787 As well, allowing an explicit ©break© from the ©choose© is a carry over from the ©switch© statement, and expected by C programmers. 788 \item 789 \Index*{Duff's device} is eliminated from both ©switch© and ©choose© statements, and only invalidates a small amount of very questionable code. 790 Hence, the ©case© clause must appear at the same nesting level as the ©switch©/©choose© body, as is done in most other programming languages with ©switch© statements. 791 \item 792 The issue of ©default© at locations other than at the end of the cause clause can be solved by using good programming style, and there are a few reasonable situations involving fall-through where the ©default© clause needs to appear is locations other than at the end. 793 Therefore, no change is made for this issue. 794 \item 795 Dealing with unreachable code in a ©switch©/©choose© body is solved by restricting declarations and associated initialization to the start of statement body, which is executed \emph{before} the transfer to the appropriate ©case© clause\footnote{ 796 Essentially, these declarations are hoisted before the ©switch©/©choose© statement and both declarations and statement are surrounded by a compound statement.} and precluding statements before the first ©case© clause. 797 Further declarations at the same nesting level as the statement body are disallowed to ensure every transfer into the body is sound. 798 \begin{cfa} 799 switch ( x ) { 800 ®int i = 0;® §\C{// allowed only at start}§ 801 case 0: 802 ... 803 ®int j = 0;® §\C{// disallowed}§ 804 case 1: 805 { 806 ®int k = 0;® §\C{// allowed at different nesting levels}§ 807 ... 808 ®case 2:® §\C{// disallow case in nested statements}§ 905 Otherwise, the implicit targets of the current ©continue© and ©break©, \ie the closest enclosing loop or ©switch©, change as certain constructs are added or removed. 906 907 908 %\section{\texorpdfstring{\protect\lstinline@with@ Statement}{with Statement}} 909 \section{\texorpdfstring{\LstKeywordStyle{with} Statement}{with Statement}} 910 \label{s:WithStatement} 911 912 Grouping heterogeneous data into \newterm{aggregate}s (structure/union) is a common programming practice, and an aggregate can be further organized into more complex structures, such as arrays and containers: 913 \begin{cfa} 914 struct S { §\C{// aggregate}§ 915 char c; §\C{// fields}§ 916 int i; 917 double d; 918 }; 919 S s, as[10]; 920 \end{cfa} 921 However, functions manipulating aggregates must repeat the aggregate name to access its containing fields: 922 \begin{cfa} 923 void f( S s ) { 924 ®s.®c; ®s.®i; ®s.®d; §\C{// access containing fields}§ 925 } 926 \end{cfa} 927 which extends to multiple levels of qualification for nested aggregates. 928 A similar situation occurs in object-oriented programming, \eg \CC: 929 \begin{C++} 930 struct S { 931 char c; §\C{// fields}§ 932 int i; 933 double d; 934 void f() { §\C{// implicit ``this'' aggregate}§ 935 ®this->®c; ®this->®i; ®this->®d; §\C{// access containing fields}§ 809 936 } 810 ... 811 } 812 \end{cfa} 813 \end{enumerate} 814 815 816 \section{\texorpdfstring{\LstKeywordStyle{case} Clause}{case Clause}} 817 818 C restricts the ©case© clause of a ©switch© statement to a single value. 819 For multiple ©case© clauses associated with the same statement, it is necessary to have multiple ©case© clauses rather than multiple values. 820 Requiring a ©case© clause for each value does not seem to be in the spirit of brevity normally associated with C. 821 Therefore, the ©case© clause is extended with a list of values, as in: 822 \begin{quote2} 823 \begin{tabular}{@{}l@{\hspace{3em}}l@{\hspace{2em}}l@{}} 824 \multicolumn{1}{c@{\hspace{3em}}}{\textbf{\CFA}} & \multicolumn{1}{c@{\hspace{2em}}}{\textbf{C}} \\ 825 \begin{cfa} 826 switch ( i ) { 827 case ®1, 3, 5®: 828 ... 829 case ®2, 4, 6®: 830 ... 831 } 832 \end{cfa} 833 & 834 \begin{cfa} 835 switch ( i ) { 836 case 1: case 3 : case 5: 837 ... 838 case 2: case 4 : case 6: 839 ... 840 } 841 \end{cfa} 842 & 843 \begin{cfa} 844 845 // odd values 846 847 // even values 848 849 850 \end{cfa} 851 \end{tabular} 852 \end{quote2} 853 In addition, two forms of subranges are allowed to specify case values: a new \CFA form and an existing GNU C form.\footnote{ 854 The GNU C form \emph{requires} spaces around the ellipse.} 855 \begin{quote2} 856 \begin{tabular}{@{}l@{\hspace{3em}}l@{\hspace{2em}}l@{}} 857 \multicolumn{1}{c@{\hspace{3em}}}{\textbf{\CFA}} & \multicolumn{1}{c@{\hspace{2em}}}{\textbf{GNU C}} \\ 858 \begin{cfa} 859 switch ( i ) { 860 case ®1~5:® 861 ... 862 case ®10~15:® 863 ... 864 } 865 \end{cfa} 866 & 867 \begin{cfa} 868 switch ( i ) 869 case ®1 ... 5®: 870 ... 871 case ®10 ... 15®: 872 ... 873 } 874 \end{cfa} 875 & 876 \begin{cfa} 877 878 // 1, 2, 3, 4, 5 879 880 // 10, 11, 12, 13, 14, 15 881 882 883 \end{cfa} 884 \end{tabular} 885 \end{quote2} 886 Lists of subranges are also allowed. 887 \begin{cfa} 888 case ®1~5, 12~21, 35~42®: 889 \end{cfa} 890 891 892 \section{\texorpdfstring{\LstKeywordStyle{with} Clause / Statement}{with Clause / Statement}} 893 \label{s:WithClauseStatement} 937 } 938 \end{C++} 939 Object-oriented nesting of member functions in a \lstinline[language=C++]@class/struct@ allows eliding \lstinline[language=C++]@this->@ because of lexical scoping. 940 However, for other aggregate parameters, qualification is necessary: 941 \begin{cfa} 942 struct T { double m, n; }; 943 int S::f( T & t ) { §\C{// multiple aggregate parameters}§ 944 c; i; d; §\C{\color{red}// this--{\textgreater}.c, this--{\textgreater}.i, this--{\textgreater}.d}§ 945 ®t.®m; ®t.®n; §\C{// must qualify}§ 946 } 947 \end{cfa} 948 949 To simplify the programmer experience, \CFA provides a ©with© statement (see Pascal~\cite[\S~4.F]{Pascal}) to elide aggregate qualification to fields by opening a scope containing the field identifiers. 950 Hence, the qualified fields become variables with the side-effect that it is easier to optimizing field references in a block. 951 \begin{cfa} 952 void f( S & this ) ®with ( this )® { §\C{// with statement}§ 953 c; i; d; §\C{\color{red}// this.c, this.i, this.d}§ 954 } 955 \end{cfa} 956 with the generality of opening multiple aggregate-parameters: 957 \begin{cfa} 958 void f( S & s, T & t ) ®with ( s, t )® { §\C{// multiple aggregate parameters}§ 959 c; i; d; §\C{\color{red}// s.c, s.i, s.d}§ 960 m; n; §\C{\color{red}// t.m, t.n}§ 961 } 962 \end{cfa} 963 964 In detail, the ©with© statement has the form: 965 \begin{cfa} 966 §\emph{with-statement}§: 967 'with' '(' §\emph{expression-list}§ ')' §\emph{compound-statement}§ 968 \end{cfa} 969 and may appear as the body of a function or nested within a function body. 970 Each expression in the expression-list provides a type and object. 971 The type must be an aggregate type. 972 (Enumerations are already opened.) 973 The object is the implicit qualifier for the open structure-fields. 974 975 All expressions in the expression list are open in parallel within the compound statement. 976 This semantic is different from Pascal, which nests the openings from left to right. 977 The difference between parallel and nesting occurs for fields with the same name and type: 978 \begin{cfa} 979 struct S { int ®i®; int j; double m; } s, w; 980 struct T { int ®i®; int k; int m; } t, w; 981 with ( s, t ) { 982 j + k; §\C{// unambiguous, s.j + t.k}§ 983 m = 5.0; §\C{// unambiguous, t.m = 5.0}§ 984 m = 1; §\C{// unambiguous, s.m = 1}§ 985 int a = m; §\C{// unambiguous, a = s.i }§ 986 double b = m; §\C{// unambiguous, b = t.m}§ 987 int c = s.i + t.i; §\C{// unambiguous, qualification}§ 988 (double)m; §\C{// unambiguous, cast}§ 989 } 990 \end{cfa} 991 For parallel semantics, both ©s.i© and ©t.i© are visible, so ©i© is ambiguous without qualification; 992 for nested semantics, ©t.i© hides ©s.i©, so ©i© implies ©t.i©. 993 \CFA's ability to overload variables means fields with the same name but different types are automatically disambiguated, eliminating most qualification when opening multiple aggregates. 994 Qualification or a cast is used to disambiguate. 995 996 There is an interesting problem between parameters and the function-body ©with©, \eg: 997 \begin{cfa} 998 void ?{}( S & s, int i ) with ( s ) { §\C{// constructor}§ 999 ®s.i = i;® j = 3; m = 5.5; §\C{// initialize fields}§ 1000 } 1001 \end{cfa} 1002 Here, the assignment ©s.i = i© means ©s.i = s.i©, which is meaningless, and there is no mechanism to qualify the parameter ©i©, making the assignment impossible using the function-body ©with©. 1003 To solve this problem, parameters are treated like an initialized aggregate: 1004 \begin{cfa} 1005 struct Params { 1006 S & s; 1007 int i; 1008 } params; 1009 \end{cfa} 1010 and implicitly opened \emph{after} a function-body open, to give them higher priority: 1011 \begin{cfa} 1012 void ?{}( S & s, int ®i® ) with ( s ) ®with( §\emph{\color{red}params}§ )® { 1013 s.i = ®i®; j = 3; m = 5.5; 1014 } 1015 \end{cfa} 1016 Finally, a cast may be used to disambiguate among overload variables in a ©with© expression: 1017 \begin{cfa} 1018 with ( w ) { ... } §\C{// ambiguous, same name and no context}§ 1019 with ( (S)w ) { ... } §\C{// unambiguous, cast}§ 1020 \end{cfa} 1021 and ©with© expressions may be complex expressions with type reference (see Section~\ref{s:References}) to aggregate: 1022 % \begin{cfa} 1023 % struct S { int i, j; } sv; 1024 % with ( sv ) { §\C{// implicit reference}§ 1025 % S & sr = sv; 1026 % with ( sr ) { §\C{// explicit reference}§ 1027 % S * sp = &sv; 1028 % with ( *sp ) { §\C{// computed reference}§ 1029 % i = 3; j = 4; §\C{\color{red}// sp--{\textgreater}i, sp--{\textgreater}j}§ 1030 % } 1031 % i = 2; j = 3; §\C{\color{red}// sr.i, sr.j}§ 1032 % } 1033 % i = 1; j = 2; §\C{\color{red}// sv.i, sv.j}§ 1034 % } 1035 % \end{cfa} 894 1036 895 1037 In \Index{object-oriented} programming, there is an implicit first parameter, often names \textbf{©self©} or \textbf{©this©}, which is elided. … … 897 1039 class C { 898 1040 int i, j; 899 int mem() { §\C{\color{red}// implicit "this" parameter}§900 i = 1; §\C{\color{red}// this->i}§901 j = 2; §\C{\color{red}// this->j}§1041 int mem() { §\C{\color{red}// implicit "this" parameter}§ 1042 i = 1; §\C{\color{red}// this->i}§ 1043 j = 2; §\C{\color{red}// this->j}§ 902 1044 } 903 1045 } 904 1046 \end{C++} 905 Since CFA is non-object-oriented, the equivalent object-oriented program looks like:1047 Since \CFA is non-object-oriented, the equivalent object-oriented program looks like: 906 1048 \begin{cfa} 907 1049 struct S { int i, j; }; 908 int mem( S & ®this® ) {§\C{// explicit "this" parameter}§909 ®this.®i = 1; §\C{// "this" is not elided}§1050 int mem( S & ®this® ) { §\C{// explicit "this" parameter}§ 1051 ®this.®i = 1; §\C{// "this" is not elided}§ 910 1052 ®this.®j = 2; 911 1053 } 912 1054 \end{cfa} 913 but it is cumbersome having to write "©this.©"many times in a member.1055 but it is cumbersome having to write ``©this.©'' many times in a member. 914 1056 915 1057 \CFA provides a ©with© clause/statement (see Pascal~\cite[\S~4.F]{Pascal}) to elided the "©this.©" by opening a scope containing field identifiers, changing the qualified fields into variables and giving an opportunity for optimizing qualified references. 916 1058 \begin{cfa} 917 int mem( S & this ) ®with this® {§\C{// with clause}§918 i = 1; §\C{\color{red}// this->i}§919 j = 2; §\C{\color{red}// this->j}§1059 int mem( S & this ) ®with( this )® { §\C{// with clause}§ 1060 i = 1; §\C{\color{red}// this.i}§ 1061 j = 2; §\C{\color{red}// this.j}§ 920 1062 } 921 1063 \end{cfa} … … 923 1065 \begin{cfa} 924 1066 struct T { double m, n; }; 925 int mem2( S & this1, T &this2 ) ®with this1, this2® {1067 int mem2( S & this1, T & this2 ) ®with( this1, this2 )® { 926 1068 i = 1; j = 2; 927 1069 m = 1.0; n = 2.0; … … 934 1076 struct S1 { ... } s1; 935 1077 struct S2 { ... } s2; 936 ®with s1® { // with statement1078 ®with( s1 )® { §\C{// with statement}§ 937 1079 // access fields of s1 without qualification 938 ®with s2® { // nesting1080 ®with s2® { §\C{// nesting}§ 939 1081 // access fields of s1 and s2 without qualification 940 1082 } … … 951 1093 struct S { int i; int j; double m; } a, c; 952 1094 struct T { int i; int k; int m } b, c; 953 ®with a, b® { 954 j + k; §\C{// unambiguous, unique names define unique types}§ 955 i; §\C{// ambiguous, same name and type}§ 956 a.i + b.i; §\C{// unambiguous, qualification defines unique names}§ 957 m; §\C{// ambiguous, same name and no context to define unique type}§ 958 m = 5.0; §\C{// unambiguous, same name and context defines unique type}§ 959 m = 1; §\C{// unambiguous, same name and context defines unique type}§ 960 } 961 ®with c® { ... } §\C{// ambiguous, same name and no context}§ 962 ®with (S)c® { ... } §\C{// unambiguous, same name and cast defines unique type}§ 963 \end{cfa} 964 1095 with( a, b ) 1096 { 1097 } 1098 \end{cfa} 1099 1100 \begin{comment} 965 1101 The components in the "with" clause 966 1102 … … 987 1123 the "with" to be implemented because I hate having to type all those object 988 1124 names for fields. It's a great way to drive people away from the language. 1125 \end{comment} 989 1126 990 1127 … … 996 1133 Non-local transfer can cause stack unwinding, \ie non-local routine termination, depending on the kind of raise. 997 1134 \begin{cfa} 998 exception_t E {}; §\C{// exception type}§1135 exception_t E {}; §\C{// exception type}§ 999 1136 void f(...) { 1000 ... throw E{}; ... §\C{// termination}§1001 ... throwResume E{}; ... §\C{// resumption}§1137 ... throw E{}; ... §\C{// termination}§ 1138 ... throwResume E{}; ... §\C{// resumption}§ 1002 1139 } 1003 1140 try { 1004 1141 f(...); 1005 } catch( E e ; §boolean-predicate§ ) { §\C[8cm]{// termination handler}§1142 } catch( E e ; §boolean-predicate§ ) { §\C[8cm]{// termination handler}§ 1006 1143 // recover and continue 1007 } catchResume( E e ; §boolean-predicate§ ) { §\C{// resumption handler}\CRT§1144 } catchResume( E e ; §boolean-predicate§ ) { §\C{// resumption handler}\CRT§ 1008 1145 // repair and return 1009 1146 } finally { … … 1046 1183 1047 1184 1048 \section{ Declarations}1049 \label{s: Declarations}1185 \section{Alternative Declarations} 1186 \label{s:AlternativeDeclarations} 1050 1187 1051 1188 C declaration syntax is notoriously confusing and error prone. 1052 1189 For example, many C programmers are confused by a declaration as simple as: 1053 \begin{ quote2}1190 \begin{cquote} 1054 1191 \begin{tabular}{@{}ll@{}} 1055 1192 \begin{cfa} … … 1059 1196 \raisebox{-0.75\totalheight}{\input{Cdecl}} 1060 1197 \end{tabular} 1061 \end{ quote2}1198 \end{cquote} 1062 1199 Is this an array of 5 pointers to integers or a \Index{pointer} to an array of 5 integers? 1063 The fact this declaration is unclear to many C programmers means there are\Index{productivity} and \Index{safety} issues even for basic programs.1200 If there is any doubt, it implies \Index{productivity} and \Index{safety} issues even for basic programs. 1064 1201 Another example of confusion results from the fact that a routine name and its parameters are embedded within the return type, mimicking the way the return value is used at the routine's call site. 1065 1202 For example, a routine returning a \Index{pointer} to an array of integers is defined and used in the following way: 1066 1203 \begin{cfa} 1067 int ®(*®f®())[®5®]® {...}; §\C{ definition}§1068 ... ®(*®f®())[®3®]® += 1; §\C{ usage}§1204 int ®(*®f®())[®5®]® {...}; §\C{// definition}§ 1205 ... ®(*®f®())[®3®]® += 1; §\C{// usage}§ 1069 1206 \end{cfa} 1070 1207 Essentially, the return type is wrapped around the routine name in successive layers (like an \Index{onion}). … … 1075 1212 In the following example, \R{red} is the base type and \B{blue} is qualifiers. 1076 1213 The \CFA declarations move the qualifiers to the left of the base type, \ie move the blue to the left of the red, while the qualifiers have the same meaning but are ordered left to right to specify a variable's type. 1077 \begin{ quote2}1214 \begin{cquote} 1078 1215 \begin{tabular}{@{}l@{\hspace{3em}}l@{}} 1079 1216 \multicolumn{1}{c@{\hspace{3em}}}{\textbf{\CFA}} & \multicolumn{1}{c}{\textbf{C}} \\ … … 1090 1227 \end{cfa} 1091 1228 \end{tabular} 1092 \end{ quote2}1229 \end{cquote} 1093 1230 The only exception is \Index{bit field} specification, which always appear to the right of the base type. 1094 1231 % 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 routine parameter. 1095 1232 However, unlike C, \CFA type declaration tokens are distributed across all variables in the declaration list. 1096 1233 For instance, variables ©x© and ©y© of type \Index{pointer} to integer are defined in \CFA as follows: 1097 \begin{ quote2}1234 \begin{cquote} 1098 1235 \begin{tabular}{@{}l@{\hspace{3em}}l@{}} 1099 1236 \multicolumn{1}{c@{\hspace{3em}}}{\textbf{\CFA}} & \multicolumn{1}{c}{\textbf{C}} \\ … … 1106 1243 \end{cfa} 1107 1244 \end{tabular} 1108 \end{ quote2}1245 \end{cquote} 1109 1246 The downside of this semantics is the need to separate regular and \Index{pointer} declarations: 1110 \begin{ quote2}1247 \begin{cquote} 1111 1248 \begin{tabular}{@{}l@{\hspace{3em}}l@{}} 1112 1249 \multicolumn{1}{c@{\hspace{3em}}}{\textbf{\CFA}} & \multicolumn{1}{c}{\textbf{C}} \\ … … 1121 1258 \end{cfa} 1122 1259 \end{tabular} 1123 \end{ quote2}1260 \end{cquote} 1124 1261 which is \Index{prescribing} a safety benefit. 1125 1262 Other examples are: 1126 \begin{ quote2}1263 \begin{cquote} 1127 1264 \begin{tabular}{@{}l@{\hspace{3em}}l@{\hspace{2em}}l@{}} 1128 1265 \multicolumn{1}{c@{\hspace{3em}}}{\textbf{\CFA}} & \multicolumn{1}{c@{\hspace{2em}}}{\textbf{C}} \\ … … 1160 1297 \end{cfa} 1161 1298 \end{tabular} 1162 \end{ quote2}1299 \end{cquote} 1163 1300 1164 1301 All type qualifiers, \eg ©const©, ©volatile©, etc., are used in the normal way with the new declarations and also appear left to right, \eg: 1165 \begin{ quote2}1302 \begin{cquote} 1166 1303 \begin{tabular}{@{}l@{\hspace{1em}}l@{\hspace{1em}}l@{}} 1167 1304 \multicolumn{1}{c@{\hspace{1em}}}{\textbf{\CFA}} & \multicolumn{1}{c@{\hspace{1em}}}{\textbf{C}} \\ … … 1181 1318 \end{cfa} 1182 1319 \end{tabular} 1183 \end{ quote2}1320 \end{cquote} 1184 1321 All declaration qualifiers, \eg ©extern©, ©static©, etc., are used in the normal way with the new declarations but can only appear at the start of a \CFA routine declaration,\footnote{\label{StorageClassSpecifier} 1185 1322 The placement of a storage-class specifier other than at the beginning of the declaration specifiers in a declaration is an obsolescent feature.~\cite[\S~6.11.5(1)]{C11}} \eg: 1186 \begin{ quote2}1323 \begin{cquote} 1187 1324 \begin{tabular}{@{}l@{\hspace{3em}}l@{\hspace{2em}}l@{}} 1188 1325 \multicolumn{1}{c@{\hspace{3em}}}{\textbf{\CFA}} & \multicolumn{1}{c@{\hspace{2em}}}{\textbf{C}} \\ … … 1202 1339 \end{cfa} 1203 1340 \end{tabular} 1204 \end{ quote2}1341 \end{cquote} 1205 1342 1206 1343 The new declaration syntax can be used in other contexts where types are required, \eg casts and the pseudo-routine ©sizeof©: 1207 \begin{ quote2}1344 \begin{cquote} 1208 1345 \begin{tabular}{@{}l@{\hspace{3em}}l@{}} 1209 1346 \multicolumn{1}{c@{\hspace{3em}}}{\textbf{\CFA}} & \multicolumn{1}{c}{\textbf{C}} \\ 1210 1347 \begin{cfa} 1211 y = ( ®* int®)x;1212 i = sizeof( ®[ 5 ] * int®);1348 y = (* int)x; 1349 i = sizeof([ 5 ] * int); 1213 1350 \end{cfa} 1214 1351 & 1215 1352 \begin{cfa} 1216 y = ( ®int *®)x;1217 i = sizeof( ®int * [ 5 ]®);1353 y = (int *)x; 1354 i = sizeof(int * [ 5 ]); 1218 1355 \end{cfa} 1219 1356 \end{tabular} 1220 \end{ quote2}1357 \end{cquote} 1221 1358 1222 1359 Finally, new \CFA declarations may appear together with C declarations in the same program block, but cannot be mixed within a specific declaration. 1223 1360 Therefore, a programmer has the option of either continuing to use traditional C declarations or take advantage of the new style. 1224 Clearly, both styles need to be supported for some time due to existing C-style header-files, particularly for UNIX systems. 1225 1226 1227 \section{Exponentiation Operator} 1228 1229 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. 1230 \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$. 1231 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)©. 1232 1233 As for \Index{division}, there are exponentiation operators for integral and floating-point types, including the builtin \Index{complex} types. 1234 Unsigned integral exponentiation\index{exponentiation!unsigned integral} is performed with repeated multiplication\footnote{The multiplication computation is optimized to $O(\log y)$.} (or shifting if the base is 2). 1235 Signed integral exponentiation\index{exponentiation!signed integral} is performed with repeated multiplication (or shifting if the base is 2), but yields a floating-point result because $x^{-y}=1/x^y$. 1236 Hence, it is important to designate exponent integral-constants as unsigned or signed: ©3 \ 3u© return an integral result, while ©3 \ 3© returns a floating-point result. 1237 Floating-point exponentiation\index{exponentiation!floating point} is performed using \Index{logarithm}s\index{exponentiation!logarithm}, so the base cannot be negative. 1238 \begin{cfa} 1239 sout | 2 ®\® 8u | 4 ®\® 3u | -4 ®\® 3u | 4 ®\® -3 | -4 ®\® -3 | 4.0 ®\® 2.1 | (1.0f+2.0fi) ®\® (3.0f+2.0fi) | endl; 1240 256 64 -64 0.015625 -0.015625 18.3791736799526 0.264715-1.1922i 1241 \end{cfa} 1242 Parenthesis are necessary for the complex constants or the expresion is parsed as ©1.0f+(2.0fi \ 3.0f)+2.0fi©. 1243 The exponentiation operator is available for all the basic types, but for user-defined types, only the integral-computation versions are available. 1244 For returning an integral value, the user type ©T© must define multiplication, ©*©, and one, ©1©; 1245 for returning a floating-point value, an additional divide of type ©T© into a ©double© returning a ©double© (©double ?/?( double, T )©) is necessary for negative exponents. 1361 Clearly, both styles need to be supported for some time due to existing C-style header-files, particularly for UNIX-like systems. 1246 1362 1247 1363 … … 1261 1377 A program \newterm{object} is a region of data storage in the execution environment, the contents of which can represent values. 1262 1378 In most cases, objects are located in memory at an address, and the variable name for an object is an implicit address to the object generated by the compiler and automatically dereferenced, as in: 1263 \begin{ quote2}1379 \begin{cquote} 1264 1380 \begin{tabular}{@{}ll@{\hspace{2em}}l@{}} 1265 1381 \begin{cfa} … … 1279 1395 \end{cfa} 1280 1396 \end{tabular} 1281 \end{ quote2}1397 \end{cquote} 1282 1398 where the right example is how the compiler logically interprets the variables in the left example. 1283 1399 Since a variable name only points to one address during its lifetime, it is an \Index{immutable} \Index{pointer}; … … 1285 1401 In general, variable addresses are stored in instructions instead of loaded from memory, and hence may not occupy storage. 1286 1402 These approaches are contrasted in the following: 1287 \begin{ quote2}1403 \begin{cquote} 1288 1404 \begin{tabular}{@{}l|l@{}} 1289 1405 \multicolumn{1}{c|}{explicit variable address} & \multicolumn{1}{c}{implicit variable address} \\ … … 1303 1419 \end{cfa} 1304 1420 \end{tabular} 1305 \end{ quote2}1421 \end{cquote} 1306 1422 Finally, the immutable nature of a variable's address and the fact that there is no storage for the variable pointer means pointer assignment\index{pointer!assignment}\index{assignment!pointer} is impossible. 1307 1423 Therefore, the expression ©x = y© has only one meaning, ©*x = *y©, \ie manipulate values, which is why explicitly writing the dereferences is unnecessary even though it occurs implicitly as part of \Index{instruction decoding}. … … 1310 1426 (Similarly, an integer variable can contain multiple integer literals during its lifetime versus an integer constant representing a single literal during its lifetime, and like a variable name, may not occupy storage if the literal is embedded directly into instructions.) 1311 1427 Hence, a pointer occupies memory to store its current address, and the pointer's value is loaded by dereferencing, \eg: 1312 \begin{ quote2}1428 \begin{cquote} 1313 1429 \begin{tabular}{@{}l@{\hspace{2em}}l@{}} 1314 1430 \begin{cfa} … … 1322 1438 \raisebox{-0.5\totalheight}{\input{pointer2.pstex_t}} 1323 1439 \end{tabular} 1324 \end{ quote2}1440 \end{cquote} 1325 1441 1326 1442 Notice, an address has a \Index{duality}\index{address!duality}: a location in memory or the value at that location. … … 1331 1447 \end{cfa} 1332 1448 Algol68 infers the following dereferencing ©*p2 = *p1 + x©, because adding the arbitrary integer value in ©x© to the address of ©p1© and storing the resulting address into ©p2© is an unlikely operation. 1333 Unfortunately, automatic dereferencing does not work in all cases, and so some mechanism is necessary to fix incorrect choices. 1449 Unfortunately, automatic dereferencing does not work in all cases, and so some mechanism is necessary to fix incorrect choices. 1334 1450 1335 1451 Rather than inferring dereference, most programming languages pick one implicit dereferencing semantics, and the programmer explicitly indicates the other to resolve address-duality. … … 1427 1543 The position of the ©const© qualifier \emph{after} the pointer/reference qualifier causes confuse for C programmers. 1428 1544 The ©const© qualifier cannot be moved before the pointer/reference qualifier for C style-declarations; 1429 \CFA-style declarations (see \VRef{s: Declarations}) attempt to address this issue:1430 \begin{ quote2}1545 \CFA-style declarations (see \VRef{s:AlternativeDeclarations}) attempt to address this issue: 1546 \begin{cquote} 1431 1547 \begin{tabular}{@{}l@{\hspace{3em}}l@{}} 1432 1548 \multicolumn{1}{c@{\hspace{3em}}}{\textbf{\CFA}} & \multicolumn{1}{c}{\textbf{C}} \\ … … 1441 1557 \end{cfa} 1442 1558 \end{tabular} 1443 \end{ quote2}1559 \end{cquote} 1444 1560 where the \CFA declaration is read left-to-right. 1445 1561 … … 1519 1635 \begin{cfa} 1520 1636 void f( int i ); 1521 void (* fp)( int ); §\C{// routine pointer}§1637 void (* fp)( int ); §\C{// routine pointer}§ 1522 1638 fp = f; §\C{// reference initialization}§ 1523 1639 fp = &f; §\C{// pointer initialization}§ … … 1546 1662 \begin{itemize} 1547 1663 \item 1548 if ©R© is an \Index{rvalue} of type ©T & $_1$...&$_r$© where $r \ge 1$ references (©&© symbols) than ©&R© has type ©T ®*®&$_{\color{red}2}$...&$_{\color{red}r}$©, \ie ©T© pointer with $r-1$ references (©&© symbols).1549 1550 \item 1551 if ©L© is an \Index{lvalue} of type ©T & $_1$...&$_l$© where $l \ge 0$ references (©&© symbols) then ©&L© has type ©T ®*®&$_{\color{red}1}$...&$_{\color{red}l}$©, \ie ©T© pointer with $l$ references (©&© symbols).1664 if ©R© is an \Index{rvalue} of type ©T &©$_1\cdots$ ©&©$_r$, where $r \ge 1$ references (©&© symbols), than ©&R© has type ©T ®*®&©$_{\color{red}2}\cdots$ ©&©$_{\color{red}r}$, \ie ©T© pointer with $r-1$ references (©&© symbols). 1665 1666 \item 1667 if ©L© is an \Index{lvalue} of type ©T &©$_1\cdots$ ©&©$_l$, where $l \ge 0$ references (©&© symbols), than ©&L© has type ©T ®*®&©$_{\color{red}1}\cdots$ ©&©$_{\color{red}l}$, \ie ©T© pointer with $l$ references (©&© symbols). 1552 1668 \end{itemize} 1553 1669 The following example shows the first rule applied to different \Index{rvalue} contexts: … … 1596 1712 1597 1713 \item 1598 lvalue to reference conversion: \lstinline[deletekeywords=lvalue] $lvalue-type cv1 T$converts to ©cv2 T &©, which allows implicitly converting variables to references.1714 lvalue to reference conversion: \lstinline[deletekeywords=lvalue]@lvalue-type cv1 T@ converts to ©cv2 T &©, which allows implicitly converting variables to references. 1599 1715 \begin{cfa} 1600 1716 int x, &r = ®x®, f( int & p ); // lvalue variable (int) convert to reference (int &) … … 1898 2014 \end{cfa} 1899 2015 This syntax allows a prototype declaration to be created by cutting and pasting source text from the routine definition header (or vice versa). 1900 Like C, it is possible to declare multiple routine-prototypes in a single declaration, where the return type is distributed across \emph{all} routine names in the declaration list (see~\VRef{s: Declarations}), \eg:2016 Like C, it is possible to declare multiple routine-prototypes in a single declaration, where the return type is distributed across \emph{all} routine names in the declaration list (see~\VRef{s:AlternativeDeclarations}), \eg: 1901 2017 \begin{cfa} 1902 2018 C : const double bar1(), bar2( int ), bar3( double ); … … 2073 2189 Default arguments and overloading (see Section 24) are complementary. 2074 2190 While in theory default arguments can be simulated with overloading, as in: 2075 \begin{ quote2}2191 \begin{cquote} 2076 2192 \begin{tabular}{@{}l@{\hspace{3em}}l@{}} 2077 2193 \multicolumn{1}{c@{\hspace{3em}}}{\textbf{default arguments}} & \multicolumn{1}{c}{\textbf{overloading}} \\ … … 2088 2204 \end{cfa} 2089 2205 \end{tabular} 2090 \end{ quote2}2206 \end{cquote} 2091 2207 the number of required overloaded routines is linear in the number of default values, which is unacceptable growth. 2092 2208 In general, overloading should only be used over default arguments if the body of the routine is significantly different. … … 2166 2282 struct T t; 2167 2283 } s; 2168 2284 2169 2285 2170 2286 … … 2225 2341 The following program in undefined in \CFA (and Indexc{gcc}) 2226 2342 \begin{cfa} 2227 [* [int]( int )] foo() { §\C{// int (* foo())( int )}§2343 [* [int]( int )] foo() { §\C{// int (* foo())( int )}§ 2228 2344 int ®i® = 7; 2229 2345 int bar( int p ) { … … 2234 2350 } 2235 2351 int main() { 2236 * [int]( int ) fp = foo(); §\C{// int (* fp)( int )}§2352 * [int]( int ) fp = foo(); §\C{// int (* fp)( int )}§ 2237 2353 sout | fp( 3 ) | endl; 2238 2354 } 2239 2355 \end{cfa} 2240 because 2356 because 2241 2357 2242 2358 Currently, there are no \Index{lambda} expressions, \ie unnamed routines because routine names are very important to properly select the correct routine. … … 2273 2389 In the latter approach, additional return values are passed as pointer parameters. 2274 2390 A pointer parameter is assigned inside the routine to emulate a return. 2275 For example, consider C's \Indexc{modf} function, which returns the integral and fractional part of a floating -pointvalue.2391 For example, consider C's \Indexc{modf} function, which returns the integral and fractional part of a floating value. 2276 2392 \begin{cfa} 2277 2393 double modf( double x, double * i ); §\C{// from include math.h}§ … … 2996 3112 2997 3113 The common case is printing out a sequence of variables separated by whitespace. 2998 \begin{ quote2}3114 \begin{cquote} 2999 3115 \begin{tabular}{@{}l@{\hspace{3em}}l@{}} 3000 3116 \multicolumn{1}{c@{\hspace{3em}}}{\textbf{\CFA}} & \multicolumn{1}{c}{\textbf{\CC}} \\ … … 3017 3133 \end{cfa} 3018 3134 \end{tabular} 3019 \end{ quote2}3135 \end{cquote} 3020 3136 The \CFA form has half the characters of the \CC form, and is similar to \Index*{Python} I/O with respect to implicit separators. 3021 3137 Similar simplification occurs for \Index{tuple} I/O, which prints all tuple values separated by ``\lstinline[showspaces=true]@, @''. … … 3029 3145 Finally, \CFA uses the logical-or operator for I/O as it is the lowest-priority overloadable operator, other than assignment. 3030 3146 Therefore, fewer output expressions require parenthesis. 3031 \begin{ quote2}3147 \begin{cquote} 3032 3148 \begin{tabular}{@{}ll@{}} 3033 3149 \textbf{\CFA:} … … 3048 3164 \end{cfa} 3049 3165 \end{tabular} 3050 \end{ quote2}3166 \end{cquote} 3051 3167 There is a weak similarity between the \CFA logical-or operator and the Shell pipe-operator for moving data, where data flows in the correct direction for input but the opposite direction for output. 3052 3168 … … 3278 3394 sout | sepDisable | 1 | 2 | 3 | endl; // globally turn off implicit separator 3279 3395 sout | sepEnable | 1 | 2 | 3 | endl; // globally turn on implicit separator 3280 3396 3281 3397 sout | 1 | sepOff | 2 | 3 | endl; // locally turn on implicit separator 3282 3398 sout | sepDisable | 1 | sepOn | 2 | 3 | endl; // globally turn off implicit separator … … 3421 3537 int id; 3422 3538 float size; 3423 Parts * optionalParts;3539 Parts * optionalParts; 3424 3540 }; 3425 3541 … … 3635 3751 3636 3752 Auto type-inferencing occurs in a declaration where a variable's type is inferred from its initialization ex\-pression type. 3637 \begin{ quote2}3753 \begin{cquote} 3638 3754 \begin{tabular}{@{}l@{\hspace{3em}}ll@{}} 3639 3755 \multicolumn{1}{c@{\hspace{3em}}}{\textbf{\CC}} & \multicolumn{1}{c}{\textbf{\Indexc{gcc}}} \\ … … 3659 3775 \end{cfa} 3660 3776 \end{tabular} 3661 \end{ quote2}3777 \end{cquote} 3662 3778 The two important capabilities are: 3663 3779 \begin{itemize} … … 3807 3923 3808 3924 generic(type T) 3809 typedef int (* predicate)(T);3925 typedef int (* predicate)(T); 3810 3926 generic(type Captured, type T) 3811 typedef void (* callback)(Captured, T);3927 typedef void (* callback)(Captured, T); 3812 3928 3813 3929 generic(type T) 3814 void find(int length, T * array,3930 void find(int length, T * array, 3815 3931 predicate(T) p, callback(void *, T)f) { 3816 3932 int i; … … 3836 3952 struct LinkedListElem { 3837 3953 T elem; 3838 LinkedListElem(T) * next;3954 LinkedListElem(T) * next; 3839 3955 }; 3840 3956 3841 LinkedListElem *++?(LinkedListElem ** elem) {3842 return * elem = elem->next;3957 LinkedListElem *++?(LinkedListElem ** elem) { 3958 return * elem = elem->next; 3843 3959 } 3844 3960 3845 3961 generic (type T) 3846 3962 struct LinkedList { 3847 LinkedListElem(T) * head;3963 LinkedListElem(T) * head; 3848 3964 unsigned int size; 3849 3965 } 3850 3966 3851 3967 generic (type T | bool ?==?(T, T)) 3852 bool contains(LinkedList(T) * list, T elem) {3853 for(LinkedListElem * iter = list->head; iter != 0; ++iter) {3968 bool contains(LinkedList(T) * list, T elem) { 3969 for(LinkedListElem * iter = list->head; iter != 0; ++iter) { 3854 3970 if (iter->elem == elem) return true; 3855 3971 } … … 4064 4180 // transferring requires mutual exclusion and calls deleteJob 4065 4181 4066 void transferJob(mutex Worker & from, Worker &to) {4182 void transferJob(mutex Worker & from, Worker & to) { 4067 4183 ... 4068 4184 deleteJob(j); … … 5002 5118 #include <unistd.h> 5003 5119 } 5004 size_t fileSize( const char * path ) {5120 size_t fileSize( const char * path ) { 5005 5121 struct stat s; 5006 5122 stat(path, &s); … … 5039 5155 #[link(name = "libc")] 5040 5156 extern { 5041 fn stat(path: * const u8,5042 buf: * mut stat_t) -> c_int;5043 } 5044 fn fileSize(path: * const u8) -> size_t5157 fn stat(path: * const u8, 5158 buf: * mut stat_t) -> c_int; 5159 } 5160 fn fileSize(path: * const u8) -> size_t 5045 5161 { 5046 5162 unsafe { … … 5064 5180 generic(type T, type N | 5065 5181 { int ?<?(N, N); }) 5066 T * maximize(N (*f)(const T&),5182 T * maximize(N (*f)(const T&), 5067 5183 int n, T *a) { 5068 T * bestX = NULL;5184 T * bestX = NULL; 5069 5185 N bestN; 5070 5186 for (int i = 0; i < n; i++) { … … 5078 5194 } 5079 5195 5080 string * longest(int n, string *p)5196 string * longest(int n, string *p) 5081 5197 { 5082 5198 return maximize(length, n, p); … … 5086 5202 \begin{cfa} 5087 5203 template<typename T, typename F> 5088 T * maximize(const F &f,5204 T * maximize(const F &f, 5089 5205 int n, T *a) { 5090 5206 typedef decltype(f(a[0])) N; 5091 T * bestX = NULL;5207 T * bestX = NULL; 5092 5208 N bestN; 5093 5209 for (int i = 0; i < n; i++) { … … 5101 5217 } 5102 5218 5103 string * longest(int n, string *p) {5219 string * longest(int n, string *p) { 5104 5220 return maximize( 5105 5221 [](const string &s) { … … 5259 5375 \begin{cfa} 5260 5376 task Nonzero { 5261 int * data;5377 int * data; 5262 5378 int start; 5263 5379 int end; … … 5722 5838 \CFA introduces the following new keywords. 5723 5839 5724 \begin{ quote2}5840 \begin{cquote} 5725 5841 \input{../refrat/keywords} 5726 \end{ quote2}5842 \end{cquote} 5727 5843 5728 5844 … … 5731 5847 5732 5848 \Celeven prescribes the following standard header-files~\cite[\S~7.1.2]{C11} and \CFA adds to this list: 5733 \begin{ quote2}5849 \begin{cquote} 5734 5850 \begin{tabular}{@{}llllll|l@{}} 5735 5851 \multicolumn{6}{c|}{C11} & \multicolumn{1}{c}{\CFA} \\ … … 5791 5907 \end{tabular} 5792 5908 \end{tabular} 5793 \end{ quote2}5909 \end{cquote} 5794 5910 For the prescribed head-files, \CFA uses header interposition to wraps these includes in an ©extern "C"©; 5795 5911 hence, names in these include files are not mangled\index{mangling!name} (see~\VRef{s:Interoperability}). … … 5851 5967 void * memalign( size_t align, size_t size );§\indexc{memalign}§ 5852 5968 int posix_memalign( void ** ptr, size_t align, size_t size );§\indexc{posix_memalign}§ 5853 }5854 5855 // §\CFA§ safe equivalents, i.e., implicit size specification5856 forall( dtype T | sized(T) ) T * malloc( void );5857 forall( dtype T | sized(T) ) T * calloc( size_t dim );5858 forall( dtype T | sized(T) ) T * realloc( T * ptr, size_t size );5859 forall( dtype T | sized(T) ) T * memalign( size_t align );5860 forall( dtype T | sized(T) ) T * aligned_alloc( size_t align );5861 forall( dtype T | sized(T) ) int posix_memalign( T ** ptr, size_t align );5862 5863 // §\CFA§ safe general allocation, fill, resize, array5864 forall( dtype T | sized(T) ) T * alloc( void );§\indexc{alloc}§5865 forall( dtype T | sized(T) ) T * alloc( char fill );5866 forall( dtype T | sized(T) ) T * alloc( size_t dim );5867 forall( dtype T | sized(T) ) T * alloc( size_t dim, char fill );5868 forall( dtype T | sized(T) ) T * alloc( T ptr[], size_t dim );5869 forall( dtype T | sized(T) ) T * alloc( T ptr[], size_t dim, char fill );5870 5871 // §\CFA§ safe general allocation, align, fill, array5872 forall( dtype T | sized(T) ) T * align_alloc( size_t align );5873 forall( dtype T | sized(T) ) T * align_alloc( size_t align, char fill );5874 forall( dtype T | sized(T) ) T * align_alloc( size_t align, size_t dim );5875 forall( dtype T | sized(T) ) T * align_alloc( size_t align, size_t dim, char fill );5876 5969 5877 5970 // C unsafe initialization/copy 5878 extern "C" {5879 5971 void * memset( void * dest, int c, size_t size ); 5880 5972 void * memcpy( void * dest, const void * src, size_t size ); 5881 5973 } 5882 5974 5975 forall( dtype T | sized(T) ) { 5976 // §\CFA§ safe equivalents, i.e., implicit size specification 5977 T * malloc( void ); 5978 T * calloc( size_t dim ); 5979 T * realloc( T * ptr, size_t size ); 5980 T * memalign( size_t align ); 5981 T * aligned_alloc( size_t align ); 5982 int posix_memalign( T ** ptr, size_t align ); 5983 5984 // §\CFA§ safe general allocation, fill, resize, array 5985 T * alloc( void );§\indexc{alloc}§ 5986 T * alloc( char fill ); 5987 T * alloc( size_t dim ); 5988 T * alloc( size_t dim, char fill ); 5989 T * alloc( T ptr[], size_t dim ); 5990 T * alloc( T ptr[], size_t dim, char fill ); 5991 5992 // §\CFA§ safe general allocation, align, fill, array 5993 T * align_alloc( size_t align ); 5994 T * align_alloc( size_t align, char fill ); 5995 T * align_alloc( size_t align, size_t dim ); 5996 T * align_alloc( size_t align, size_t dim, char fill ); 5997 5883 5998 // §\CFA§ safe initialization/copy, i.e., implicit size specification 5884 forall( dtype T | sized(T) )T * memset( T * dest, char c );§\indexc{memset}§5885 forall( dtype T | sized(T) )T * memcpy( T * dest, const T * src );§\indexc{memcpy}§5999 T * memset( T * dest, char c );§\indexc{memset}§ 6000 T * memcpy( T * dest, const T * src );§\indexc{memcpy}§ 5886 6001 5887 6002 // §\CFA§ safe initialization/copy array 5888 forall( dtype T | sized(T) ) T * memset( T dest[], size_t dim, char c ); 5889 forall( dtype T | sized(T) ) T * memcpy( T dest[], const T src[], size_t dim ); 6003 T * amemset( T dest[], char c, size_t dim ); 6004 T * amemcpy( T dest[], const T src[], size_t dim ); 6005 } 5890 6006 5891 6007 // §\CFA§ allocation/deallocation and constructor/destructor … … 5903 6019 5904 6020 5905 \subsection{ Conversion}6021 \subsection{String to Value Conversion} 5906 6022 5907 6023 \leavevmode … … 5947 6063 forall( otype T | { int ?<?( T, T ); } ) 5948 6064 void qsort( const T * arr, size_t dim );§\indexc{qsort}§ 6065 6066 forall( otype E | { int ?<?( E, E ); } ) { 6067 E * bsearch( E key, const E * vals, size_t dim );§\indexc{bsearch}§ §\C{// location}§ 6068 size_t bsearch( E key, const E * vals, size_t dim );§\C{// position}§ 6069 E * bsearchl( E key, const E * vals, size_t dim );§\indexc{bsearchl}§ 6070 size_t bsearchl( E key, const E * vals, size_t dim ); 6071 E * bsearchu( E key, const E * vals, size_t dim );§\indexc{bsearchu}§ 6072 size_t bsearchu( E key, const E * vals, size_t dim ); 6073 } 6074 6075 forall( otype K, otype E | { int ?<?( K, K ); K getKey( const E & ); } ) { 6076 E * bsearch( K key, const E * vals, size_t dim ); 6077 size_t bsearch( K key, const E * vals, size_t dim ); 6078 E * bsearchl( K key, const E * vals, size_t dim ); 6079 size_t bsearchl( K key, const E * vals, size_t dim ); 6080 E * bsearchu( K key, const E * vals, size_t dim ); 6081 size_t bsearchu( K key, const E * vals, size_t dim ); 6082 } 6083 6084 forall( otype E | { int ?<?( E, E ); } ) { 6085 void qsort( E * vals, size_t dim );§\indexc{qsort}§ 6086 } 5949 6087 \end{cfa} 5950 6088 … … 5973 6111 \leavevmode 5974 6112 \begin{cfa}[aboveskip=0pt,belowskip=0pt] 5975 void rand48seed( long int s );§\indexc{rand48seed}§ 5976 char rand48();§\indexc{rand48}§ 5977 int rand48(); 5978 unsigned int rand48(); 5979 long int rand48(); 5980 unsigned long int rand48(); 5981 float rand48(); 5982 double rand48(); 5983 float _Complex rand48(); 5984 double _Complex rand48(); 5985 long double _Complex rand48(); 6113 void srandom( unsigned int seed );§\indexc{srandom}§ 6114 char random( void );§\indexc{random}§ 6115 char random( char u ); §\C{// [0,u)}§ 6116 char random( char l, char u ); §\C{// [l,u)}§ 6117 int random( void ); 6118 int random( int u ); §\C{// [0,u)}§ 6119 int random( int l, int u ); §\C{// [l,u)}§ 6120 unsigned int random( void ); 6121 unsigned int random( unsigned int u ); §\C{// [0,u)}§ 6122 unsigned int random( unsigned int l, unsigned int u ); §\C{// [l,u)}§ 6123 long int random( void ); 6124 long int random( long int u ); §\C{// [0,u)}§ 6125 long int random( long int l, long int u ); §\C{// [l,u)}§ 6126 unsigned long int random( void ); 6127 unsigned long int random( unsigned long int u ); §\C{// [0,u)}§ 6128 unsigned long int random( unsigned long int l, unsigned long int u ); §\C{// [l,u)}§ 6129 float random( void ); §\C{// [0.0, 1.0)}§ 6130 double random( void ); §\C{// [0.0, 1.0)}§ 6131 float _Complex random( void ); §\C{// [0.0, 1.0)+[0.0, 1.0)i}§ 6132 double _Complex random( void ); §\C{// [0.0, 1.0)+[0.0, 1.0)i}§ 6133 long double _Complex random( void ); §\C{// [0.0, 1.0)+[0.0, 1.0)i}§ 5986 6134 \end{cfa} 5987 6135 … … 6359 6507 double scalbln( double, long int ); 6360 6508 long double scalbln( long double, long int ); 6509 \end{cfa} 6510 6511 6512 \section{Time Keeping} 6513 \label{s:TimeKeeping} 6514 6515 6516 %\subsection{\texorpdfstring{\protect\lstinline@Duration@}{Duration}} 6517 \subsection{\texorpdfstring{\LstBasicStyle{Duration}}{Duration}} 6518 \label{s:Duration} 6519 6520 \leavevmode 6521 \begin{cfa}[aboveskip=0pt,belowskip=0pt] 6522 struct Duration { 6523 int64_t tv; §\C{// nanoseconds}§ 6524 }; 6525 6526 void ?{}( Duration & dur ); 6527 void ?{}( Duration & dur, zero_t ); 6528 6529 Duration ?=?( Duration & dur, zero_t ); 6530 6531 Duration +?( Duration rhs ); 6532 Duration ?+?( Duration & lhs, Duration rhs ); 6533 Duration ?+=?( Duration & lhs, Duration rhs ); 6534 6535 Duration -?( Duration rhs ); 6536 Duration ?-?( Duration & lhs, Duration rhs ); 6537 Duration ?-=?( Duration & lhs, Duration rhs ); 6538 6539 Duration ?*?( Duration lhs, int64_t rhs ); 6540 Duration ?*?( int64_t lhs, Duration rhs ); 6541 Duration ?*=?( Duration & lhs, int64_t rhs ); 6542 6543 int64_t ?/?( Duration lhs, Duration rhs ); 6544 Duration ?/?( Duration lhs, int64_t rhs ); 6545 Duration ?/=?( Duration & lhs, int64_t rhs ); 6546 double div( Duration lhs, Duration rhs ); 6547 6548 Duration ?%?( Duration lhs, Duration rhs ); 6549 Duration ?%=?( Duration & lhs, Duration rhs ); 6550 6551 _Bool ?==?( Duration lhs, Duration rhs ); 6552 _Bool ?!=?( Duration lhs, Duration rhs ); 6553 _Bool ?<? ( Duration lhs, Duration rhs ); 6554 _Bool ?<=?( Duration lhs, Duration rhs ); 6555 _Bool ?>? ( Duration lhs, Duration rhs ); 6556 _Bool ?>=?( Duration lhs, Duration rhs ); 6557 6558 _Bool ?==?( Duration lhs, zero_t ); 6559 _Bool ?!=?( Duration lhs, zero_t ); 6560 _Bool ?<? ( Duration lhs, zero_t ); 6561 _Bool ?<=?( Duration lhs, zero_t ); 6562 _Bool ?>? ( Duration lhs, zero_t ); 6563 _Bool ?>=?( Duration lhs, zero_t ); 6564 6565 Duration abs( Duration rhs ); 6566 6567 Duration ?`ns( int64_t nsec ); 6568 Duration ?`us( int64_t usec ); 6569 Duration ?`ms( int64_t msec ); 6570 Duration ?`s( int64_t sec ); 6571 Duration ?`s( double sec ); 6572 Duration ?`m( int64_t min ); 6573 Duration ?`m( double min ); 6574 Duration ?`h( int64_t hours ); 6575 Duration ?`h( double hours ); 6576 Duration ?`d( int64_t days ); 6577 Duration ?`d( double days ); 6578 Duration ?`w( int64_t weeks ); 6579 Duration ?`w( double weeks ); 6580 6581 int64_t ?`ns( Duration dur ); 6582 int64_t ?`us( Duration dur ); 6583 int64_t ?`ms( Duration dur ); 6584 int64_t ?`s( Duration dur ); 6585 int64_t ?`m( Duration dur ); 6586 int64_t ?`h( Duration dur ); 6587 int64_t ?`d( Duration dur ); 6588 int64_t ?`w( Duration dur ); 6589 6590 Duration max( Duration lhs, Duration rhs ); 6591 Duration min( Duration lhs, Duration rhs ); 6592 \end{cfa} 6593 6594 6595 %\subsection{\texorpdfstring{\protect\lstinline@\timeval@}{timeval}} 6596 \subsection{\texorpdfstring{\LstBasicStyle{timeval}}{timeval}} 6597 \label{s:timeval} 6598 6599 \leavevmode 6600 \begin{cfa}[aboveskip=0pt,belowskip=0pt] 6601 void ?{}( timeval & t ); 6602 void ?{}( timeval & t, time_t sec, suseconds_t usec ); 6603 void ?{}( timeval & t, time_t sec ); 6604 void ?{}( timeval & t, zero_t ); 6605 void ?{}( timeval & t, Time time ); 6606 6607 timeval ?=?( timeval & t, zero_t ); 6608 timeval ?+?( timeval & lhs, timeval rhs ); 6609 timeval ?-?( timeval & lhs, timeval rhs ); 6610 _Bool ?==?( timeval lhs, timeval rhs ); 6611 _Bool ?!=?( timeval lhs, timeval rhs ); 6612 \end{cfa} 6613 6614 6615 %\subsection{\texorpdfstring{\protect\lstinline@timespec@}{timespec}} 6616 \subsection{\texorpdfstring{\LstBasicStyle{timespec}}{timespec}} 6617 \label{s:timespec} 6618 6619 \leavevmode 6620 \begin{cfa}[aboveskip=0pt,belowskip=0pt] 6621 void ?{}( timespec & t ); 6622 void ?{}( timespec & t, time_t sec, __syscall_slong_t nsec ); 6623 void ?{}( timespec & t, time_t sec ); 6624 void ?{}( timespec & t, zero_t ); 6625 void ?{}( timespec & t, Time time ); 6626 6627 timespec ?=?( timespec & t, zero_t ); 6628 timespec ?+?( timespec & lhs, timespec rhs ); 6629 timespec ?-?( timespec & lhs, timespec rhs ); 6630 _Bool ?==?( timespec lhs, timespec rhs ); 6631 _Bool ?!=?( timespec lhs, timespec rhs ); 6632 \end{cfa} 6633 6634 6635 %\subsection{\texorpdfstring{\protect\lstinline@itimerval@}{itimerval}} 6636 \subsection{\texorpdfstring{\LstBasicStyle{itimerval}}{itimerval}} 6637 \label{s:itimerval} 6638 6639 \leavevmode 6640 \begin{cfa}[aboveskip=0pt,belowskip=0pt] 6641 void ?{}( itimerval & itv, Duration alarm ); 6642 void ?{}( itimerval & itv, Duration alarm, Duration interval ); 6643 \end{cfa} 6644 6645 6646 %\subsection{\texorpdfstring{\protect\lstinline@Time@}{Time}} 6647 \subsection{\texorpdfstring{\LstBasicStyle{Time}}{Time}} 6648 \label{s:Time} 6649 6650 \leavevmode 6651 \begin{cfa}[aboveskip=0pt,belowskip=0pt] 6652 struct Time { 6653 uint64_t tv; §\C{// nanoseconds since UNIX epoch}§ 6654 }; 6655 6656 void ?{}( Time & time ); 6657 void ?{}( Time & time, zero_t ); 6658 6659 Time ?=?( Time & time, zero_t ); 6660 6661 void ?{}( Time & time, timeval t ); 6662 Time ?=?( Time & time, timeval t ); 6663 6664 void ?{}( Time & time, timespec t ); 6665 Time ?=?( Time & time, timespec t ); 6666 6667 Time ?+?( Time & lhs, Duration rhs ); 6668 Time ?+?( Duration lhs, Time rhs ); 6669 Time ?+=?( Time & lhs, Duration rhs ); 6670 6671 Duration ?-?( Time lhs, Time rhs ); 6672 Time ?-?( Time lhs, Duration rhs ); 6673 Time ?-=?( Time & lhs, Duration rhs ); 6674 _Bool ?==?( Time lhs, Time rhs ); 6675 _Bool ?!=?( Time lhs, Time rhs ); 6676 _Bool ?<?( Time lhs, Time rhs ); 6677 _Bool ?<=?( Time lhs, Time rhs ); 6678 _Bool ?>?( Time lhs, Time rhs ); 6679 _Bool ?>=?( Time lhs, Time rhs ); 6680 6681 char * yy_mm_dd( Time time, char * buf ); 6682 char * ?`ymd( Time time, char * buf ) { // short form 6683 return yy_mm_dd( time, buf ); 6684 } // ymd 6685 6686 char * mm_dd_yy( Time time, char * buf ); 6687 char * ?`mdy( Time time, char * buf ) { // short form 6688 return mm_dd_yy( time, buf ); 6689 } // mdy 6690 6691 char * dd_mm_yy( Time time, char * buf ); 6692 char * ?`dmy( Time time, char * buf ) { // short form 6693 return dd_mm_yy( time, buf );; 6694 } // dmy 6695 6696 size_t strftime( char * buf, size_t size, const char * fmt, Time time ); 6697 forall( dtype ostype | ostream( ostype ) ) ostype & ?|?( ostype & os, Time time ); 6698 \end{cfa} 6699 6700 6701 \section{Clock} 6702 6703 \subsection{C time} 6704 \label{s:Ctime} 6705 6706 \leavevmode 6707 \begin{cfa}[aboveskip=0pt,belowskip=0pt] 6708 char * ctime( time_t tp ); 6709 char * ctime_r( time_t tp, char * buf ); 6710 tm * gmtime( time_t tp ); 6711 tm * gmtime_r( time_t tp, tm * result ); 6712 tm * localtime( time_t tp ); 6713 tm * localtime_r( time_t tp, tm * result ); 6714 \end{cfa} 6715 6716 6717 %\subsection{\texorpdfstring{\protect\lstinline@Clock@}{Clock}} 6718 \subsection{\texorpdfstring{\LstBasicStyle{Clock}}{Clock}} 6719 \label{s:Clock} 6720 6721 \leavevmode 6722 \begin{cfa}[aboveskip=0pt,belowskip=0pt] 6723 struct Clock { 6724 Duration offset; §\C{// for virtual clock: contains offset from real-time}§ 6725 int clocktype; §\C{// implementation only -1 (virtual), CLOCK\_REALTIME}§ 6726 }; 6727 6728 void resetClock( Clock & clk ); 6729 void resetClock( Clock & clk, Duration adj ); 6730 void ?{}( Clock & clk ); 6731 void ?{}( Clock & clk, Duration adj ); 6732 6733 Duration getResNsec(); §\C{// with nanoseconds}§ 6734 Duration getRes(); §\C{// without nanoseconds}§ 6735 6736 Time getTimeNsec(); §\C{// with nanoseconds}§ 6737 Time getTime(); §\C{// without nanoseconds}§ 6738 Time getTime( Clock & clk ); 6739 Time ?()( Clock & clk ); 6740 timeval getTime( Clock & clk ); 6741 tm getTime( Clock & clk ); 6361 6742 \end{cfa} 6362 6743 … … 6532 6913 The following factorial programs contrast using GMP with the \CFA and C interfaces, where the output from these programs appears in \VRef[Figure]{f:MultiPrecisionFactorials}. 6533 6914 (Compile with flag \Indexc{-lgmp} to link with the GMP library.) 6534 \begin{ quote2}6915 \begin{cquote} 6535 6916 \begin{tabular}{@{}l@{\hspace{\parindentlnth}}|@{\hspace{\parindentlnth}}l@{}} 6536 6917 \multicolumn{1}{c|@{\hspace{\parindentlnth}}}{\textbf{\CFA}} & \multicolumn{1}{@{\hspace{\parindentlnth}}c}{\textbf{C}} \\ … … 6564 6945 \end{cfa} 6565 6946 \end{tabular} 6566 \end{ quote2}6947 \end{cquote} 6567 6948 6568 6949 \begin{figure} … … 6659 7040 \end{cfa} 6660 7041 6661 6662 7042 \bibliographystyle{plain} 6663 \bibliography{ cfa}7043 \bibliography{pl} 6664 7044 6665 7045 -
src/CodeGen/CodeGenerator.cc
rf9feab8 r90152a4 10 10 // Created On : Mon May 18 07:44:20 2015 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : S un Sep 3 20:42:52 201713 // Update Count : 49 012 // Last Modified On : Sat May 5 09:08:32 2018 13 // Update Count : 494 14 14 // 15 15 #include "CodeGenerator.h" … … 18 18 #include <list> // for _List_iterator, list, list<>::it... 19 19 20 #include "Common/SemanticError.h" // for SemanticError21 20 #include "Common/UniqueName.h" // for UniqueName 22 21 #include "Common/utility.h" // for CodeLocation, toString … … 117 116 } 118 117 119 CodeGenerator::CodeGenerator( std::ostream & os, bool pretty, bool genC, bool lineMarks ) : indent( CodeGenerator::tabsize ), output( os ), printLabels( *this ), pretty( pretty ), genC( genC ), lineMarks( lineMarks ), endl( *this ) {}118 CodeGenerator::CodeGenerator( std::ostream & os, bool pretty, bool genC, bool lineMarks, bool printExprTypes ) : indent( CodeGenerator::tabsize ), output( os ), printLabels( *this ), pretty( pretty ), genC( genC ), lineMarks( lineMarks ), printExprTypes( printExprTypes ), endl( *this ) {} 120 119 121 120 string CodeGenerator::mangleName( DeclarationWithType * decl ) { 122 if ( pretty ) return decl->get_name(); 123 if ( decl->get_mangleName() != "" ) { 121 // GCC builtins should always be printed unmangled 122 if ( pretty || decl->linkage.is_gcc_builtin ) return decl->name; 123 if ( decl->mangleName != "" ) { 124 124 // need to incorporate scope level in order to differentiate names for destructors 125 125 return decl->get_scopedMangleName(); 126 126 } else { 127 return decl-> get_name();127 return decl->name; 128 128 } // if 129 129 } … … 133 133 output << "__attribute__ (("; 134 134 for ( list< Attribute * >::iterator attr( attributes.begin() );; ) { 135 output << (*attr)-> get_name();136 if ( ! (*attr)-> get_parameters().empty() ) {135 output << (*attr)->name; 136 if ( ! (*attr)->parameters.empty() ) { 137 137 output << "("; 138 genCommaList( (*attr)-> get_parameters().begin(), (*attr)->get_parameters().end() );138 genCommaList( (*attr)->parameters.begin(), (*attr)->parameters.end() ); 139 139 output << ")"; 140 140 } // if … … 160 160 } 161 161 162 // *** Expression 163 void CodeGenerator::previsit( Expression * node ) { 164 previsit( (BaseSyntaxNode *)node ); 165 GuardAction( [this, node](){ 166 if ( printExprTypes && node->result ) { 167 output << " /* " << genType( node->result, "", pretty, genC ) << " */ "; 168 } 169 } ); 170 } 171 162 172 // *** Declarations 163 173 void CodeGenerator::postvisit( FunctionDecl * functionDecl ) { 174 // deleted decls should never be used, so don't print them 175 if ( functionDecl->isDeleted && genC ) return; 164 176 extension( functionDecl ); 165 177 genAttributes( functionDecl->get_attributes() ); … … 175 187 functionDecl->get_statements()->accept( *visitor ); 176 188 } // if 189 if ( functionDecl->isDeleted ) { 190 output << " = void"; 191 } 177 192 } 178 193 179 194 void CodeGenerator::postvisit( ObjectDecl * objectDecl ) { 195 // deleted decls should never be used, so don't print them 196 if ( objectDecl->isDeleted && genC ) return; 180 197 if (objectDecl->get_name().empty() && genC ) { 181 198 // only generate an anonymous name when generating C code, otherwise it clutters the output too much … … 196 213 objectDecl->get_init()->accept( *visitor ); 197 214 } // if 215 if ( objectDecl->isDeleted ) { 216 output << " = void"; 217 } 198 218 199 219 if ( objectDecl->get_bitfieldWidth() ) { … … 204 224 205 225 void CodeGenerator::handleAggregate( AggregateDecl * aggDecl, const std::string & kind ) { 206 genAttributes( aggDecl->get_attributes() ); 207 208 if( ! aggDecl->get_parameters().empty() && ! genC ) { 226 if( ! aggDecl->parameters.empty() && ! genC ) { 209 227 // assertf( ! genC, "Aggregate type parameters should not reach code generation." ); 210 228 output << "forall("; 211 genCommaList( aggDecl-> get_parameters().begin(), aggDecl->get_parameters().end() );229 genCommaList( aggDecl->parameters.begin(), aggDecl->parameters.end() ); 212 230 output << ")" << endl; 213 231 output << indent; 214 232 } 215 233 216 output << kind << aggDecl->get_name(); 234 output << kind; 235 genAttributes( aggDecl->attributes ); 236 output << aggDecl->name; 217 237 218 238 if ( aggDecl->has_body() ) { 219 std::list< Declaration * > & memb = aggDecl-> get_members();239 std::list< Declaration * > & memb = aggDecl->members; 220 240 output << " {" << endl; 221 241 … … 299 319 output << " }"; 300 320 } 321 } 322 323 void CodeGenerator::postvisit( StaticAssertDecl * assertDecl ) { 324 output << "_Static_assert("; 325 assertDecl->condition->accept( *visitor ); 326 output << ", "; 327 assertDecl->message->accept( *visitor ); 328 output << ")"; 301 329 } 302 330 … … 353 381 354 382 void CodeGenerator::postvisit( Constant * constant ) { 355 output << constant->get_value() ;383 output << constant->get_value(); 356 384 } 357 385 … … 570 598 output << "("; 571 599 if ( castExpr->get_result()->isVoid() ) { 572 output << "(void)" ;600 output << "(void)"; 573 601 } else { 574 602 // at least one result type of cast. … … 579 607 output << ")"; 580 608 } // if 581 castExpr->get_arg()->accept( *visitor ); 609 castExpr->arg->accept( *visitor ); 610 output << ")"; 611 } 612 613 void CodeGenerator::postvisit( KeywordCastExpr * castExpr ) { 614 assertf( ! genC, "KeywordCast should not reach code generation." ); 615 extension( castExpr ); 616 output << "((" << castExpr->targetString() << " &)"; 617 castExpr->arg->accept( *visitor ); 582 618 output << ")"; 583 619 } … … 764 800 765 801 void CodeGenerator::postvisit( StmtExpr * stmtExpr ) { 766 std::list< Statement * > & stmts = stmtExpr-> get_statements()->get_kids();802 std::list< Statement * > & stmts = stmtExpr->statements->kids; 767 803 output << "({" << endl; 768 804 ++indent; … … 775 811 // cannot cast to void, otherwise the expression statement has no value 776 812 if ( ExprStmt * exprStmt = dynamic_cast< ExprStmt * >( stmt ) ) { 777 exprStmt-> get_expr()->accept( *visitor );813 exprStmt->expr->accept( *visitor ); 778 814 output << ";" << endl; 779 815 ++i; … … 796 832 expr->callExpr->accept( *visitor ); 797 833 } 834 835 void CodeGenerator::postvisit( DeletedExpr * expr ) { 836 assertf( ! genC, "Deleted expressions should not reach code generation." ); 837 expr->expr->accept( *visitor ); 838 } 839 840 void CodeGenerator::postvisit( DefaultArgExpr * arg ) { 841 assertf( ! genC, "Default argument expressions should not reach code generation." ); 842 arg->expr->accept( *visitor ); 843 } 844 845 void CodeGenerator::postvisit( GenericExpr * expr ) { 846 assertf( ! genC, "C11 _Generic expressions should not reach code generation." ); 847 output << "_Generic("; 848 expr->control->accept( *visitor ); 849 output << ", "; 850 unsigned int numAssocs = expr->associations.size(); 851 unsigned int i = 0; 852 for ( GenericExpr::Association & assoc : expr->associations ) { 853 if (assoc.isDefault) { 854 output << "default: "; 855 } else { 856 output << genType( assoc.type, "", pretty, genC ) << ": "; 857 } 858 assoc.expr->accept( *visitor ); 859 if ( i+1 != numAssocs ) { 860 output << ", "; 861 } 862 i++; 863 } 864 output << ")"; 865 } 866 798 867 799 868 // *** Statements … … 848 917 } // for 849 918 } // if 850 output << " );" ;919 output << " );"; 851 920 } 852 921 … … 856 925 output << "( "; 857 926 if ( asmStmt->get_instruction() ) asmStmt->get_instruction()->accept( *visitor ); 858 output << " )" ; 927 output << " )"; 928 } 929 930 void CodeGenerator::postvisit( DirectiveStmt * dirStmt ) { 931 output << endl << dirStmt->directive; // endl prevents spaces before directive 859 932 } 860 933 … … 873 946 874 947 void CodeGenerator::postvisit( SwitchStmt * switchStmt ) { 875 output << "switch ( " ;948 output << "switch ( "; 876 949 switchStmt->get_condition()->accept( *visitor ); 877 950 output << " ) "; … … 899 972 ++indent; 900 973 for ( std::list<Statement *>::iterator i = sts.begin(); i != sts.end(); i++) { 901 output << indent << printLabels( (*i)->get_labels() ) ;974 output << indent << printLabels( (*i)->get_labels() ) ; 902 975 (*i)->accept( *visitor ); 903 976 output << endl; … … 924 997 output << "continue"; 925 998 break; 999 case BranchStmt::FallThrough: 1000 case BranchStmt::FallThroughDefault: 1001 assertf( ! genC, "fallthru should not reach code generation." ); 1002 output << "fallthru"; 1003 break; 926 1004 } // switch 1005 // print branch target for labelled break/continue/fallthru in debug mode 1006 if ( ! genC && branchStmt->get_type() != BranchStmt::Goto ) { 1007 if ( ! branchStmt->get_target().empty() ) { 1008 output << " " << branchStmt->get_target(); 1009 } else if ( branchStmt->get_type() == BranchStmt::FallThrough ) { 1010 output << " default"; 1011 } 1012 } 927 1013 output << ";"; 928 1014 } … … 1023 1109 void CodeGenerator::postvisit( WhileStmt * whileStmt ) { 1024 1110 if ( whileStmt->get_isDoWhile() ) { 1025 output << "do" ;1111 output << "do"; 1026 1112 } else { 1027 output << "while (" ;1113 output << "while ("; 1028 1114 whileStmt->get_condition()->accept( *visitor ); 1029 1115 output << ")"; … … 1037 1123 1038 1124 if ( whileStmt->get_isDoWhile() ) { 1039 output << " while (" ;1125 output << " while ("; 1040 1126 whileStmt->get_condition()->accept( *visitor ); 1041 1127 output << ");"; -
src/CodeGen/CodeGenerator.h
rf9feab8 r90152a4 27 27 28 28 namespace CodeGen { 29 struct CodeGenerator : public WithShortCircuiting, public With VisitorRef<CodeGenerator> {29 struct CodeGenerator : public WithShortCircuiting, public WithGuards, public WithVisitorRef<CodeGenerator> { 30 30 static int tabsize; 31 31 32 CodeGenerator( std::ostream &os, bool pretty = false, bool genC = false, bool lineMarks = false );32 CodeGenerator( std::ostream &os, bool pretty = false, bool genC = false, bool lineMarks = false, bool printExprTypes = false ); 33 33 34 34 //*** Turn off visit_children for all nodes … … 38 38 void postvisit( BaseSyntaxNode * ); 39 39 40 //*** print type for all expressions 41 void previsit( Expression * node ); 42 40 43 //*** Declaration 41 44 void postvisit( StructDecl * ); 42 45 void postvisit( FunctionDecl * ); 43 46 void postvisit( ObjectDecl * ); 44 void postvisit( UnionDecl *aggregateDecl ); 45 void postvisit( EnumDecl *aggregateDecl ); 46 void postvisit( TraitDecl *aggregateDecl ); 47 void postvisit( TypedefDecl *typeDecl ); 48 void postvisit( TypeDecl *typeDecl ); 47 void postvisit( UnionDecl * aggregateDecl ); 48 void postvisit( EnumDecl * aggregateDecl ); 49 void postvisit( TraitDecl * aggregateDecl ); 50 void postvisit( TypedefDecl * typeDecl ); 51 void postvisit( TypeDecl * typeDecl ); 52 void postvisit( StaticAssertDecl * assertDecl ); 49 53 50 54 //*** Initializer … … 65 69 void postvisit( LabelAddressExpr *addressExpr ); 66 70 void postvisit( CastExpr *castExpr ); 71 void postvisit( KeywordCastExpr * castExpr ); 67 72 void postvisit( VirtualCastExpr *castExpr ); 68 73 void postvisit( UntypedMemberExpr *memberExpr ); … … 88 93 void postvisit( StmtExpr * ); 89 94 void postvisit( ConstructorExpr * ); 95 void postvisit( DeletedExpr * ); 96 void postvisit( DefaultArgExpr * ); 97 void postvisit( GenericExpr * ); 90 98 91 99 //*** Statements … … 93 101 void postvisit( ExprStmt * ); 94 102 void postvisit( AsmStmt * ); 103 void postvisit( DirectiveStmt * ); 95 104 void postvisit( AsmDecl * ); // special: statement in declaration context 96 105 void postvisit( IfStmt * ); … … 138 147 bool genC = false; // true if output has to be C code 139 148 bool lineMarks = false; 149 bool printExprTypes = false; 140 150 public: 141 151 LineEnder endl; -
src/CodeGen/FixMain.cc
rf9feab8 r90152a4 23 23 24 24 #include "Common/SemanticError.h" // for SemanticError 25 #include "CodeGen/GenType.h" // for GenType 25 26 #include "SynTree/Declaration.h" // for FunctionDecl, operator<< 26 27 #include "SynTree/Type.h" // for FunctionType … … 30 31 std::unique_ptr<FunctionDecl> FixMain::main_signature = nullptr; 31 32 33 template<typename container> 34 std::string genTypeAt(const container& p, size_t idx) { 35 return genType((*std::next(p.begin(), idx))->get_type(), ""); 36 } 37 32 38 void FixMain::registerMain(FunctionDecl* functionDecl) 33 39 { 34 40 if(main_signature) { 35 throw SemanticError("Multiple definition of main routine\n", functionDecl);41 SemanticError(functionDecl, "Multiple definition of main routine\n"); 36 42 } 37 43 main_signature.reset( functionDecl->clone() ); … … 43 49 44 50 os << main_signature->get_scopedMangleName() << "("; 45 switch(main_signature->get_functionType()->get_parameters().size()) { 46 case 3: os << "argc, argv, envp"; break; 47 case 2: os << "argc, argv"; break; 51 const auto& params = main_signature->get_functionType()->get_parameters(); 52 switch(params.size()) { 53 case 3: os << "(" << genTypeAt(params, 0) << ")argc, (" << genTypeAt(params, 1) << ")argv, (" << genTypeAt(params, 2) << ")envp"; break; 54 case 2: os << "(" << genTypeAt(params, 0) << ")argc, (" << genTypeAt(params, 1) << ")argv"; break; 48 55 case 0: break; 49 56 default : assert(false); -
src/CodeGen/FixNames.cc
rf9feab8 r90152a4 56 56 auto && name = SymTab::Mangler::mangle( mainDecl.get() ); 57 57 // std::cerr << name << std::endl; 58 return name;58 return std::move(name); 59 59 } 60 60 std::string mangle_main_args() { … … 79 79 auto&& name = SymTab::Mangler::mangle( mainDecl.get() ); 80 80 // std::cerr << name << std::endl; 81 return name;81 return std::move(name); 82 82 } 83 83 … … 118 118 int nargs = functionDecl->get_functionType()->get_parameters().size(); 119 119 if( !(nargs == 0 || nargs == 2 || nargs == 3) ) { 120 throw SemanticError("Main expected to have 0, 2 or 3 arguments\n", functionDecl);120 SemanticError(functionDecl, "Main expected to have 0, 2 or 3 arguments\n"); 121 121 } 122 122 functionDecl->get_statements()->get_kids().push_back( new ReturnStmt( new ConstantExpr( Constant::from_int( 0 ) ) ) ); -
src/CodeGen/GenType.cc
rf9feab8 r90152a4 26 26 27 27 namespace CodeGen { 28 class GenType : public Visitor { 29 public: 30 GenType( const std::string &typeString, bool pretty = false, bool genC = false, bool lineMarks = false ); 31 std::string get_typeString() const { return typeString; } 32 void set_typeString( const std::string &newValue ) { typeString = newValue; } 33 34 virtual void visit( FunctionType *funcType ); 35 virtual void visit( VoidType *voidType ); 36 virtual void visit( BasicType *basicType ); 37 virtual void visit( PointerType *pointerType ); 38 virtual void visit( ArrayType *arrayType ); 39 virtual void visit( ReferenceType *refType ); 40 virtual void visit( StructInstType *structInst ); 41 virtual void visit( UnionInstType *unionInst ); 42 virtual void visit( EnumInstType *enumInst ); 43 virtual void visit( TypeInstType *typeInst ); 44 virtual void visit( TupleType * tupleType ); 45 virtual void visit( VarArgsType *varArgsType ); 46 virtual void visit( ZeroType *zeroType ); 47 virtual void visit( OneType *oneType ); 28 struct GenType : public WithVisitorRef<GenType>, public WithShortCircuiting { 29 std::string typeString; 30 GenType( const std::string &typeString, bool pretty, bool genC, bool lineMarks ); 31 32 void previsit( BaseSyntaxNode * ); 33 void postvisit( BaseSyntaxNode * ); 34 35 void postvisit( FunctionType * funcType ); 36 void postvisit( VoidType * voidType ); 37 void postvisit( BasicType * basicType ); 38 void postvisit( PointerType * pointerType ); 39 void postvisit( ArrayType * arrayType ); 40 void postvisit( ReferenceType * refType ); 41 void postvisit( StructInstType * structInst ); 42 void postvisit( UnionInstType * unionInst ); 43 void postvisit( EnumInstType * enumInst ); 44 void postvisit( TypeInstType * typeInst ); 45 void postvisit( TupleType * tupleType ); 46 void postvisit( VarArgsType * varArgsType ); 47 void postvisit( ZeroType * zeroType ); 48 void postvisit( OneType * oneType ); 49 void postvisit( GlobalScopeType * globalType ); 50 void postvisit( TraitInstType * inst ); 51 void postvisit( TypeofType * typeof ); 52 void postvisit( QualifiedType * qualType ); 48 53 49 54 private: … … 52 57 void genArray( const Type::Qualifiers &qualifiers, Type *base, Expression *dimension, bool isVarLen, bool isStatic ); 53 58 54 std::string typeString; 55 bool pretty = false; // pretty print 56 bool genC = false; // generating C code? 57 bool lineMarks = false; 59 bool pretty = false; // pretty print 60 bool genC = false; // generating C code? 61 bool lineMarks = false; // lineMarks on for CodeGenerator? 58 62 }; 59 63 60 64 std::string genType( Type *type, const std::string &baseString, bool pretty, bool genC , bool lineMarks ) { 61 GenTypegt( baseString, pretty, genC, lineMarks );65 PassVisitor<GenType> gt( baseString, pretty, genC, lineMarks ); 62 66 std::ostringstream os; 63 67 … … 68 72 69 73 type->accept( gt ); 70 return os.str() + gt. get_typeString();74 return os.str() + gt.pass.typeString; 71 75 } 72 76 … … 77 81 GenType::GenType( const std::string &typeString, bool pretty, bool genC, bool lineMarks ) : typeString( typeString ), pretty( pretty ), genC( genC ), lineMarks( lineMarks ) {} 78 82 79 void GenType::visit( VoidType *voidType ) { 83 // *** BaseSyntaxNode 84 void GenType::previsit( BaseSyntaxNode * ) { 85 // turn off automatic recursion for all nodes, to allow each visitor to 86 // precisely control the order in which its children are visited. 87 visit_children = false; 88 } 89 90 void GenType::postvisit( BaseSyntaxNode * node ) { 91 std::stringstream ss; 92 node->print( ss ); 93 assertf( false, "Unhandled node reached in GenType: %s", ss.str().c_str() ); 94 } 95 96 void GenType::postvisit( VoidType * voidType ) { 80 97 typeString = "void " + typeString; 81 98 handleQualifiers( voidType ); 82 99 } 83 100 84 void GenType:: visit( BasicType *basicType ) {85 BasicType::Kind kind = basicType-> get_kind();101 void GenType::postvisit( BasicType * basicType ) { 102 BasicType::Kind kind = basicType->kind; 86 103 assert( 0 <= kind && kind < BasicType::NUMBER_OF_BASIC_TYPES ); 87 104 typeString = std::string( BasicType::typeNames[kind] ) + " " + typeString; … … 89 106 } 90 107 91 void GenType::genArray( const Type::Qualifiers & qualifiers, Type *base, Expression *dimension, bool isVarLen, bool isStatic ) {108 void GenType::genArray( const Type::Qualifiers & qualifiers, Type * base, Expression *dimension, bool isVarLen, bool isStatic ) { 92 109 std::ostringstream os; 93 110 if ( typeString != "" ) { … … 126 143 typeString = os.str(); 127 144 128 base->accept( * this);129 } 130 131 void GenType:: visit( PointerType *pointerType ) {132 assert( pointerType-> get_base()!= 0);133 if ( pointerType->get_isStatic() || pointerType->get_isVarLen() || pointerType-> get_dimension()) {134 genArray( pointerType->get_qualifiers(), pointerType-> get_base(), pointerType->get_dimension(), pointerType->get_isVarLen(), pointerType->get_isStatic() );145 base->accept( *visitor ); 146 } 147 148 void GenType::postvisit( PointerType * pointerType ) { 149 assert( pointerType->base != 0); 150 if ( pointerType->get_isStatic() || pointerType->get_isVarLen() || pointerType->dimension ) { 151 genArray( pointerType->get_qualifiers(), pointerType->base, pointerType->dimension, pointerType->get_isVarLen(), pointerType->get_isStatic() ); 135 152 } else { 136 153 handleQualifiers( pointerType ); … … 140 157 typeString = "*" + typeString; 141 158 } // if 142 pointerType-> get_base()->accept( *this);143 } // if 144 } 145 146 void GenType:: visit( ArrayType *arrayType ) {147 genArray( arrayType->get_qualifiers(), arrayType-> get_base(), arrayType->get_dimension(), arrayType->get_isVarLen(), arrayType->get_isStatic() );148 } 149 150 void GenType:: visit( ReferenceType *refType ) {151 assert( refType-> get_base()!= 0);159 pointerType->base->accept( *visitor ); 160 } // if 161 } 162 163 void GenType::postvisit( ArrayType * arrayType ) { 164 genArray( arrayType->get_qualifiers(), arrayType->base, arrayType->dimension, arrayType->get_isVarLen(), arrayType->get_isStatic() ); 165 } 166 167 void GenType::postvisit( ReferenceType * refType ) { 168 assert( refType->base != 0); 152 169 assertf( ! genC, "Reference types should not reach code generation." ); 153 170 handleQualifiers( refType ); 154 171 typeString = "&" + typeString; 155 refType-> get_base()->accept( *this);156 } 157 158 void GenType:: visit( FunctionType *funcType ) {172 refType->base->accept( *visitor ); 173 } 174 175 void GenType::postvisit( FunctionType * funcType ) { 159 176 std::ostringstream os; 160 177 … … 169 186 /************* parameters ***************/ 170 187 171 const std::list<DeclarationWithType *> &pars = funcType-> get_parameters();188 const std::list<DeclarationWithType *> &pars = funcType->parameters; 172 189 173 190 if ( pars.empty() ) { … … 191 208 typeString = os.str(); 192 209 193 if ( funcType-> get_returnVals().size() == 0 ) {210 if ( funcType->returnVals.size() == 0 ) { 194 211 typeString = "void " + typeString; 195 212 } else { 196 funcType-> get_returnVals().front()->get_type()->accept( *this);213 funcType->returnVals.front()->get_type()->accept( *visitor ); 197 214 } // if 198 215 199 216 // add forall 200 if( ! funcType-> get_forall().empty() && ! genC ) {217 if( ! funcType->forall.empty() && ! genC ) { 201 218 // assertf( ! genC, "Aggregate type parameters should not reach code generation." ); 202 219 std::ostringstream os; 203 220 PassVisitor<CodeGenerator> cg( os, pretty, genC, lineMarks ); 204 221 os << "forall("; 205 cg.pass.genCommaList( funcType-> get_forall().begin(), funcType->get_forall().end() );222 cg.pass.genCommaList( funcType->forall.begin(), funcType->forall.end() ); 206 223 os << ")" << std::endl; 207 224 typeString = os.str() + typeString; … … 221 238 } 222 239 223 void GenType:: visit( StructInstType *structInst ) {224 typeString = structInst-> get_name()+ handleGeneric( structInst ) + " " + typeString;240 void GenType::postvisit( StructInstType * structInst ) { 241 typeString = structInst->name + handleGeneric( structInst ) + " " + typeString; 225 242 if ( genC ) typeString = "struct " + typeString; 226 243 handleQualifiers( structInst ); 227 244 } 228 245 229 void GenType:: visit( UnionInstType *unionInst ) {230 typeString = unionInst-> get_name()+ handleGeneric( unionInst ) + " " + typeString;246 void GenType::postvisit( UnionInstType * unionInst ) { 247 typeString = unionInst->name + handleGeneric( unionInst ) + " " + typeString; 231 248 if ( genC ) typeString = "union " + typeString; 232 249 handleQualifiers( unionInst ); 233 250 } 234 251 235 void GenType:: visit( EnumInstType *enumInst ) {236 typeString = enumInst-> get_name()+ " " + typeString;252 void GenType::postvisit( EnumInstType * enumInst ) { 253 typeString = enumInst->name + " " + typeString; 237 254 if ( genC ) typeString = "enum " + typeString; 238 255 handleQualifiers( enumInst ); 239 256 } 240 257 241 void GenType:: visit( TypeInstType *typeInst ) {242 typeString = typeInst-> get_name()+ " " + typeString;258 void GenType::postvisit( TypeInstType * typeInst ) { 259 typeString = typeInst->name + " " + typeString; 243 260 handleQualifiers( typeInst ); 244 261 } 245 262 246 void GenType:: visit( TupleType * tupleType ) {263 void GenType::postvisit( TupleType * tupleType ) { 247 264 assertf( ! genC, "Tuple types should not reach code generation." ); 248 265 unsigned int i = 0; … … 257 274 } 258 275 259 void GenType:: visit( VarArgsType *varArgsType ) {276 void GenType::postvisit( VarArgsType * varArgsType ) { 260 277 typeString = "__builtin_va_list " + typeString; 261 278 handleQualifiers( varArgsType ); 262 279 } 263 280 264 void GenType:: visit( ZeroType *zeroType ) {281 void GenType::postvisit( ZeroType * zeroType ) { 265 282 // ideally these wouldn't hit codegen at all, but should be safe to make them ints 266 283 typeString = (pretty ? "zero_t " : "long int ") + typeString; … … 268 285 } 269 286 270 void GenType:: visit( OneType *oneType ) {287 void GenType::postvisit( OneType * oneType ) { 271 288 // ideally these wouldn't hit codegen at all, but should be safe to make them ints 272 289 typeString = (pretty ? "one_t " : "long int ") + typeString; … … 274 291 } 275 292 276 void GenType::handleQualifiers( Type *type ) { 293 void GenType::postvisit( GlobalScopeType * globalType ) { 294 assertf( ! genC, "Global scope type should not reach code generation." ); 295 handleQualifiers( globalType ); 296 } 297 298 void GenType::postvisit( TraitInstType * inst ) { 299 assertf( ! genC, "Trait types should not reach code generation." ); 300 typeString = inst->name + " " + typeString; 301 handleQualifiers( inst ); 302 } 303 304 void GenType::postvisit( TypeofType * typeof ) { 305 std::ostringstream os; 306 PassVisitor<CodeGenerator> cg( os, pretty, genC, lineMarks ); 307 os << "typeof("; 308 typeof->expr->accept( cg ); 309 os << ") " << typeString; 310 typeString = os.str(); 311 handleQualifiers( typeof ); 312 } 313 314 void GenType::postvisit( QualifiedType * qualType ) { 315 assertf( ! genC, "Qualified types should not reach code generation." ); 316 std::ostringstream os; 317 os << genType( qualType->parent, "", pretty, genC, lineMarks ) << "." << genType( qualType->child, "", pretty, genC, lineMarks ) << typeString; 318 typeString = os.str(); 319 handleQualifiers( qualType ); 320 } 321 322 void GenType::handleQualifiers( Type * type ) { 277 323 if ( type->get_const() ) { 278 324 typeString = "const " + typeString; -
src/CodeGen/Generate.cc
rf9feab8 r90152a4 46 46 } // namespace 47 47 48 void generate( std::list< Declaration* > translationUnit, std::ostream &os, bool doIntrinsics, bool pretty, bool generateC, bool lineMarks ) {48 void generate( std::list< Declaration* > translationUnit, std::ostream &os, bool doIntrinsics, bool pretty, bool generateC, bool lineMarks, bool printExprTypes ) { 49 49 cleanTree( translationUnit ); 50 50 51 PassVisitor<CodeGenerator> cgv( os, pretty, generateC, lineMarks );51 PassVisitor<CodeGenerator> cgv( os, pretty, generateC, lineMarks, printExprTypes ); 52 52 for ( auto & dcl : translationUnit ) { 53 53 if ( LinkageSpec::isGeneratable( dcl->get_linkage() ) && (doIntrinsics || ! LinkageSpec::isBuiltin( dcl->get_linkage() ) ) ) { … … 66 66 os << CodeGen::genPrettyType( type, "" ); 67 67 } else { 68 PassVisitor<CodeGenerator> cgv( os, true, false, false );68 PassVisitor<CodeGenerator> cgv( os, true, false, false, false ); 69 69 node->accept( cgv ); 70 70 } -
src/CodeGen/Generate.h
rf9feab8 r90152a4 24 24 namespace CodeGen { 25 25 /// Generates code. doIntrinsics determines if intrinsic functions are printed, pretty formats output nicely (e.g., uses unmangled names, etc.), generateC is true when the output must consist only of C code (allows some assertions, etc.) 26 void generate( std::list< Declaration* > translationUnit, std::ostream &os, bool doIntrinsics, bool pretty, bool generateC = false , bool lineMarks = false );26 void generate( std::list< Declaration* > translationUnit, std::ostream &os, bool doIntrinsics, bool pretty, bool generateC = false , bool lineMarks = false, bool printTypeExpr = false ); 27 27 28 28 /// Generate code for a single node -- helpful for debugging in gdb -
src/CodeGen/OperatorTable.cc
rf9feab8 r90152a4 79 79 } // namespace 80 80 81 bool operatorLookup( std::string funcName, OperatorInfo &info ) {81 bool operatorLookup( const std::string & funcName, OperatorInfo & info ) { 82 82 static bool init = false; 83 83 if ( ! init ) { … … 100 100 return true; 101 101 } // if 102 } 103 104 bool isOperator( const std::string & funcName ) { 105 OperatorInfo info; 106 return operatorLookup( funcName, info ); 102 107 } 103 108 -
src/CodeGen/OperatorTable.h
rf9feab8 r90152a4 41 41 }; 42 42 43 bool operatorLookup( std::string funcName, OperatorInfo &info ); 43 bool isOperator( const std::string & funcName ); 44 bool operatorLookup( const std::string & funcName, OperatorInfo & info ); 44 45 45 46 bool isConstructor( const std::string & ); -
src/CodeTools/DeclStats.cc
rf9feab8 r90152a4 23 23 #include <utility> // for pair, make_pair 24 24 25 #include "Common/ SemanticError.h" // for SemanticError25 #include "Common/PassVisitor.h" 26 26 #include "Common/VectorMap.h" // for VectorMap 27 27 #include "GenPoly/GenPoly.h" // for hasPolyBase … … 35 35 namespace CodeTools { 36 36 37 class DeclStats : public Visitor{37 struct DeclStats : public WithShortCircuiting { 38 38 template<typename T> 39 39 static void sum(T& a, const T& b) { a += b; } … … 61 61 62 62 struct ArgPackStats { 63 VectorMap<unsigned> n; ///< Count of decls with each number of elements 64 VectorMap<unsigned> n_basic; ///< Count of decls with each number of basic type elements 65 VectorMap<unsigned> n_poly; ///< Count of decls with each number of polymorphic elements 66 std::map<unsigned, unsigned> p_basic; ///< Count of decls with each percentage of basic type elements 67 std::map<unsigned, unsigned> p_poly; ///< Count of decls with each percentage of polymorphic elements 68 VectorMap<unsigned> n_types; ///< Count of decls with each number of distinct types in the pack 63 VectorMap<unsigned> n; ///< Count of decls with each number of elements 64 VectorMap<unsigned> n_basic; ///< Count of decls with each number of basic type elements 65 VectorMap<unsigned> n_generic; ///< Count of decls with each number of generic type elements 66 VectorMap<unsigned> n_poly; ///< Count of decls with each number of polymorphic elements 67 VectorMap<unsigned> n_compound; ///< Count of decls with each number of non-generic compound types 68 std::map<unsigned, unsigned> p_basic; ///< Count of decls with each percentage of basic type elements 69 std::map<unsigned, unsigned> p_generic; ///< Count of decls with each percentage of generic type elements 70 std::map<unsigned, unsigned> p_poly; ///< Count of decls with each percentage of polymorphic elements 71 std::map<unsigned, unsigned> p_compound; ///< Count of decls with each percentage of non-generic compound type elements 72 VectorMap<unsigned> n_types; ///< Count of decls with each number of distinct types in the pack 69 73 /// Count of decls with each percentage of new types in lists. 70 74 /// Types used in the parameter list that recur in the return list are not considered to be new. … … 74 78 sum(n, o.n); 75 79 sum(n_basic, o.n_basic); 80 sum(n_generic, o.n_generic); 76 81 sum(n_poly, o.n_poly); 82 sum(n_compound, o.n_compound); 77 83 sum(p_basic, o.p_basic); 84 sum(p_generic, o.p_generic); 78 85 sum(p_poly, o.p_poly); 86 sum(p_compound, o.p_compound); 79 87 sum(n_types, o.n_types); 80 88 sum(p_new, o.p_new); … … 88 96 /// Count of declarations with each number of assertion parameters 89 97 VectorMap<unsigned> n_type_params; 98 /// Count of generic types with each number of type parameters 99 VectorMap<unsigned> n_generic_params; 100 /// Count of maximum nesting depth of types 101 VectorMap<unsigned> n_generic_nesting; 90 102 /// Count of declarations with each name 91 103 std::unordered_map<std::string, unsigned> by_name; 92 104 /// Count of uses of each basic type 93 105 std::unordered_map<std::string, unsigned> basic_type_names; 94 /// Count of uses of each non-basic type 106 /// Count of uses of each generic type name (includes "*", "[]", "(*)", "[,]") 107 std::unordered_map<std::string, unsigned> generic_type_names; 108 /// Count of uses of each non-generic aggregate type 95 109 std::unordered_map<std::string, unsigned> compound_type_names; 96 110 /// Count of decls using each basic type 97 111 std::unordered_map<std::string, unsigned> basic_type_decls; 112 /// Count of decls using each generic type (includes "*", "[]", "(*)", "[,]") 113 std::unordered_map<std::string, unsigned> generic_type_decls; 98 114 /// Count of decls using each compound type 99 115 std::unordered_map<std::string, unsigned> compound_type_decls; … … 110 126 ArgPackStats assn_returns; 111 127 112 Stats() : n_decls(0), n_type_params(), by_name(), basic_type_names(), compound_type_names(), basic_type_decls(), compound_type_decls(), params(), returns(), n_assns(), assn_params(), assn_returns() {} 128 Stats() : n_decls(0), n_type_params(), n_generic_params(), n_generic_nesting(), 129 by_name(), basic_type_names(), generic_type_names(), compound_type_names(), 130 basic_type_decls(), generic_type_decls(), compound_type_decls(), params(), 131 returns(), n_assns(), assn_params(), assn_returns() {} 113 132 114 133 public: … … 116 135 sum( n_decls, o.n_decls ); 117 136 sum( n_type_params, o.n_type_params ); 137 sum( n_generic_params, o.n_generic_params ); 138 sum( n_generic_nesting, o.n_generic_nesting ); 118 139 sum( by_name, o.by_name ); 119 140 sum( basic_type_names, o.basic_type_names ); 141 sum( generic_type_names, o.generic_type_names ); 120 142 sum( compound_type_names, o.compound_type_names ); 121 143 sum( basic_type_decls, o.basic_type_decls ); 144 sum( generic_type_decls, o.generic_type_decls ); 122 145 sum( compound_type_decls, o.compound_type_decls ); 123 146 sum( params, o.params ); … … 131 154 }; 132 155 133 Stats for_linkage[LinkageSpec::NoOfSpecs]; ///< Stores separate stats per linkage 156 /// number of counting bins for linkages 157 static const unsigned n_named_specs = 8; 158 /// map from total number of specs to bins 159 static const unsigned ind_for_linkage[16]; 160 161 Stats for_linkage[n_named_specs]; ///< Stores separate stats per linkage 134 162 std::unordered_set<std::string> seen_names; ///< Stores manglenames already seen to avoid double-counting 135 163 Stats total; … … 137 165 std::map<std::pair<unsigned, unsigned>, unsigned> exprs_by_fanout_at_depth; 138 166 167 void countType( const std::string& name, unsigned& n, std::unordered_map<std::string, 168 unsigned>& names, std::unordered_map<std::string, unsigned>& decls, 169 std::unordered_set<std::string>& elSeen ) { 170 ++n; 171 ++names[ name ]; 172 if ( elSeen.insert( name ).second ) { ++decls[ name ]; } 173 } 174 175 void update_max( unsigned& max, unsigned crnt ) { 176 if ( crnt > max ) max = crnt; 177 } 178 179 void analyzeSubtype( Type* ty, Stats& stats, std::unordered_set<std::string>& elSeen, 180 unsigned& n_poly, bool& seen_poly, unsigned& max_depth, unsigned depth ) { 181 unsigned x; 182 analyzeType( ty, stats, elSeen, x, x, n_poly, x, seen_poly, max_depth, depth + 1 ); 183 } 184 185 void analyzeSubtypes( std::list<DeclarationWithType*>& tys, Stats& stats, 186 std::unordered_set<std::string>& elSeen, unsigned& n_poly, bool& seen_poly, 187 unsigned& max_depth, unsigned depth, unsigned& n_subs ) { 188 for ( DeclarationWithType* dwt : tys ) { 189 Type* ty = dwt->get_type(); 190 n_subs += (unsigned)( dynamic_cast<VoidType*>(ty) != nullptr ); 191 analyzeSubtype( ty, stats, elSeen, n_poly, seen_poly, max_depth, depth ); 192 } 193 } 194 195 void analyzeSubtypes( std::list<Expression*>& tys, Stats& stats, 196 std::unordered_set<std::string>& elSeen, unsigned& n_poly, bool& seen_poly, 197 unsigned& max_depth, unsigned depth ) { 198 for ( Expression* expr : tys ) { 199 TypeExpr* texpr = dynamic_cast<TypeExpr*>(expr); 200 if ( ! texpr ) continue; 201 Type* ty = texpr->get_type(); 202 analyzeSubtype( ty, stats, elSeen, n_poly, seen_poly, max_depth, depth ); 203 } 204 } 205 206 void analyzeSubtypes( std::list<Type*>& tys, Stats& stats, 207 std::unordered_set<std::string>& elSeen, unsigned& n_poly, bool& seen_poly, 208 unsigned& max_depth, unsigned depth ) { 209 for ( Type* ty : tys ) { 210 analyzeSubtype( ty, stats, elSeen, n_poly, seen_poly, max_depth, depth ); 211 } 212 } 213 214 void analyzeType( Type* ty, Stats& stats, std::unordered_set<std::string>& elSeen, 215 unsigned& n_basic, unsigned& n_generic, unsigned& n_poly, unsigned& n_agg, 216 bool& seen_poly, unsigned& max_depth, unsigned depth = 0 ) { 217 if ( BasicType* bt = dynamic_cast<BasicType*>(ty) ) { 218 std::string name = BasicType::typeNames[ bt->get_kind() ]; 219 countType( name, n_basic, stats.basic_type_names, stats.basic_type_decls, elSeen ); 220 update_max( max_depth, depth ); 221 } else if ( PointerType* pt = dynamic_cast<PointerType*>(ty) ) { 222 std::string name = "*"; 223 countType( 224 name, n_generic, stats.generic_type_names, stats.generic_type_decls, elSeen); 225 analyzeSubtype( 226 pt->get_base(), stats, elSeen, n_poly, seen_poly, max_depth, depth ); 227 ++stats.n_generic_params.at( 1 ); 228 } else if ( ArrayType* at = dynamic_cast<ArrayType*>(ty) ) { 229 std::string name = "[]"; 230 countType( 231 name, n_generic, stats.generic_type_names, stats.generic_type_decls, elSeen); 232 analyzeSubtype( 233 at->get_base(), stats, elSeen, n_poly, seen_poly, max_depth, depth ); 234 ++stats.n_generic_params.at( 1 ); 235 } else if ( ReferenceType* rt = dynamic_cast<ReferenceType*>(ty) ) { 236 std::string name = "&"; 237 countType( 238 name, n_generic, stats.generic_type_names, stats.generic_type_decls, elSeen); 239 analyzeSubtype( 240 rt->get_base(), stats, elSeen, n_poly, seen_poly, max_depth, depth ); 241 ++stats.n_generic_params.at( 1 ); 242 } else if ( FunctionType* ft = dynamic_cast<FunctionType*>(ty) ) { 243 std::string name = "(*)"; 244 countType( 245 name, n_generic, stats.generic_type_names, stats.generic_type_decls, elSeen); 246 unsigned n_subs = 0; 247 analyzeSubtypes( 248 ft->get_returnVals(), stats, elSeen, n_poly, seen_poly, max_depth, depth, 249 n_subs ); 250 analyzeSubtypes( 251 ft->get_parameters(), stats, elSeen, n_poly, seen_poly, max_depth, depth, 252 n_subs ); 253 ++stats.n_generic_params.at( n_subs ); 254 } else if ( TypeInstType* vt = dynamic_cast<TypeInstType*>(ty) ) { 255 if ( ! seen_poly ) { 256 ++n_poly; 257 seen_poly = true; 258 } 259 countType( 260 vt->get_name(), n_agg, stats.compound_type_names, stats.compound_type_decls, 261 elSeen ); 262 update_max( max_depth, depth ); 263 } else if ( ReferenceToType* st = dynamic_cast<ReferenceToType*>(ty) ) { 264 std::list<Expression*>& params = st->get_parameters(); 265 if ( params.empty() ) { 266 countType( 267 st->get_name(), n_agg, stats.compound_type_names, 268 stats.compound_type_decls, elSeen ); 269 update_max( max_depth, depth ); 270 } else { 271 countType( 272 st->get_name(), n_generic, stats.generic_type_names, 273 stats.generic_type_decls, elSeen); 274 analyzeSubtypes( params, stats, elSeen, n_poly, seen_poly, max_depth, depth ); 275 ++stats.n_generic_params.at( params.size() ); 276 } 277 } else if ( TupleType* tt = dynamic_cast<TupleType*>(ty) ) { 278 std::string name = "[,]"; 279 countType( 280 name, n_generic, stats.generic_type_names, stats.generic_type_decls, elSeen); 281 analyzeSubtypes( 282 tt->get_types(), stats, elSeen, n_poly, seen_poly, max_depth, depth ); 283 ++stats.n_generic_params.at( tt->size() ); 284 } else if ( dynamic_cast<VarArgsType*>(ty) ) { 285 std::string name = "..."; 286 countType( 287 name, n_agg, stats.compound_type_names, stats.compound_type_decls, elSeen ); 288 update_max( max_depth, depth ); 289 } else if ( dynamic_cast<ZeroType*>(ty) ) { 290 std::string name = "0"; 291 countType( name, n_basic, stats.basic_type_names, stats.basic_type_decls, elSeen ); 292 update_max( max_depth, depth ); 293 } else if ( dynamic_cast<OneType*>(ty) ) { 294 std::string name = "1"; 295 countType( name, n_basic, stats.basic_type_names, stats.basic_type_decls, elSeen ); 296 update_max( max_depth, depth ); 297 } 298 } 299 139 300 /// Update arg pack stats based on a declaration list 140 void analyze( Stats& stats, std::unordered_set<std::string>& seen, ArgPackStats& pstats, std::list<DeclarationWithType*>& decls ) { 301 void analyze( Stats& stats, std::unordered_set<std::string>& seen, 302 std::unordered_set<std::string>& elSeen, ArgPackStats& pstats, 303 std::list<DeclarationWithType*>& decls ) { 141 304 std::unordered_set<std::string> types; 142 unsigned n = 0; ///< number of args/returns 143 unsigned n_basic = 0; ///< number of basic types 144 unsigned n_poly = 0; ///< number of polymorphic types 145 unsigned n_new = 0; ///< number of new types 305 unsigned n = 0; ///< number of args/returns 306 unsigned n_basic = 0; ///< number of basic types 307 unsigned n_generic = 0; ///< number of generic types (includes "*", "&", "[]", "(*)", "[,]") 308 unsigned n_poly = 0; ///< number of polymorphic types 309 unsigned n_agg = 0; ///< number of non-generic aggregate types 310 unsigned n_new = 0; ///< number of new types 311 146 312 for ( auto decl : decls ) { 147 313 Type* dt = decl->get_type(); … … 152 318 dt->print( ss ); 153 319 types.insert( ss.str() ); 154 bool this_new = seen.insert( ss.str() ).second; 155 if ( this_new ) { ++n_new; } 156 157 if ( dynamic_cast<BasicType*>( dt ) ) { 158 ++n_basic; 159 ++stats.basic_type_names[ ss.str() ]; 160 if ( this_new ) { 161 ++stats.basic_type_decls[ ss.str() ]; 162 } 163 } else if ( GenPoly::hasPolyBase( dt ) ) { 164 ++n_poly; 165 } else { 166 ++stats.compound_type_names[ ss.str() ]; 167 if ( this_new ) { 168 ++stats.compound_type_decls[ ss.str() ]; 169 } 170 } 171 } 320 if ( seen.insert( ss.str() ).second ) { ++n_new; } 321 322 bool seen_poly = false; 323 unsigned max_depth = 0; 324 analyzeType( 325 dt, stats, elSeen, n_basic, n_generic, n_poly, n_agg, seen_poly, max_depth ); 326 ++stats.n_generic_nesting.at( max_depth ); 327 } 328 172 329 ++pstats.n.at( n ); 173 330 ++pstats.n_basic.at( n_basic ); 331 ++pstats.n_generic.at( n_generic ); 174 332 ++pstats.n_poly.at( n_poly ); 333 ++pstats.n_compound.at( n_agg ); 175 334 if ( n > 0 ) { 176 335 ++pstats.p_basic[ n_basic*100/n ]; 336 ++pstats.p_generic[ n_generic*100/n ]; 177 337 ++pstats.p_poly[ n_poly*100/n ]; 178 ++pstats.p_new[ n_new*100/n ]; 338 ++pstats.p_compound[ n_agg*100/n ]; 339 if ( n > 1 ) ++pstats.p_new[ (n_new-1)*100/(n-1) ]; 179 340 } 180 341 ++pstats.n_types.at( types.size() ); … … 183 344 void analyzeFunc( FunctionType* fnTy, Stats& stats, ArgPackStats& params, ArgPackStats& returns ) { 184 345 std::unordered_set<std::string> seen; 185 analyze( stats, seen, params, fnTy->get_parameters() ); 186 analyze( stats, seen, returns, fnTy->get_returnVals() ); 346 std::unordered_set<std::string> elSeen; 347 analyze( stats, seen, elSeen, params, fnTy->get_parameters() ); 348 analyze( stats, seen, elSeen, returns, fnTy->get_returnVals() ); 187 349 } 188 350 … … 200 362 201 363 public: 202 using Visitor::visit; 203 204 virtual void visit( FunctionDecl *decl ) { 364 void previsit( FunctionDecl *decl ) { 205 365 // skip if already seen declaration for this function 206 const std::string& mangleName = decl->get_mangleName().empty() ? decl->get_name() : decl->get_mangleName(); 207 if ( ! seen_names.insert( mangleName ).second ) { 208 maybeAccept( decl->get_statements(), *this ); 209 return; 210 } 211 212 Stats& stats = for_linkage[ decl->get_linkage() ]; 213 214 ++stats.n_decls; 215 FunctionType* fnTy = decl->get_functionType(); 216 const Type::ForallList& forall = fnTy->get_forall(); 217 ++stats.n_type_params.at( forall.size() ); 218 unsigned n_assns = 0; 219 for ( TypeDecl* fdecl : forall ) { 220 n_assns += fdecl->get_assertions().size(); 221 for ( DeclarationWithType* assn : fdecl->get_assertions() ) { 222 FunctionType *assnTy = 0; 223 if ( ObjectDecl *assnObj = dynamic_cast<ObjectDecl*>(assn) ) { 224 if ( PointerType *ptrTy = dynamic_cast<PointerType*>(assnObj->get_type()) ) { 225 assnTy = dynamic_cast<FunctionType*>(ptrTy->get_base()); 226 } else assnTy = dynamic_cast<FunctionType*>(assnObj->get_type()); 227 } else if ( FunctionDecl *assnDecl = dynamic_cast<FunctionDecl*>(assn) ) { 228 assnTy = assnDecl->get_functionType(); 366 const std::string& mangleName = decl->get_mangleName().empty() ? decl->name : decl->get_mangleName(); 367 if ( seen_names.insert( mangleName ).second ) { 368 Stats& stats = for_linkage[ ind_for_linkage[ decl->linkage ] ]; 369 370 ++stats.n_decls; 371 FunctionType* fnTy = decl->type; 372 const Type::ForallList& forall = fnTy->forall; 373 ++stats.n_type_params.at( forall.size() ); 374 unsigned n_assns = 0; 375 for ( TypeDecl* fdecl : forall ) { 376 n_assns += fdecl->assertions.size(); 377 for ( DeclarationWithType* assn : fdecl->assertions ) { 378 FunctionType *assnTy = nullptr; 379 if ( ObjectDecl *assnObj = dynamic_cast<ObjectDecl*>(assn) ) { 380 if ( PointerType *ptrTy = dynamic_cast<PointerType*>(assnObj->get_type()) ) { 381 assnTy = dynamic_cast<FunctionType*>(ptrTy->base); 382 } else assnTy = dynamic_cast<FunctionType*>(assnObj->get_type()); 383 } else if ( FunctionDecl *assnDecl = dynamic_cast<FunctionDecl*>(assn) ) { 384 assnTy = assnDecl->type; 385 } 386 if ( assnTy ) analyzeFunc( assnTy, stats, stats.assn_params, stats.assn_returns ); 229 387 } 230 if ( assnTy ) analyzeFunc( assnTy, stats, stats.assn_params, stats.assn_returns ); 231 } 232 } 233 ++stats.n_assns[ n_assns ]; 234 235 ++stats.by_name[ decl->get_name() ]; 236 237 analyzeFunc( fnTy, stats, stats.params, stats.returns ); 238 239 // analyze expressions in decl statements 240 maybeAccept( decl->get_statements(), *this ); 241 } 242 243 virtual void visit( UntypedExpr *expr ) { 388 } 389 ++stats.n_assns[ n_assns ]; 390 ++stats.by_name[ decl->name ]; 391 analyzeFunc( fnTy, stats, stats.params, stats.returns ); 392 } 393 } 394 395 void previsit( UntypedExpr *expr ) { 396 visit_children = false; 244 397 analyzeExpr( expr, 0 ); 245 398 } … … 272 425 template<typename F> 273 426 void printAllHisto( const std::string& name, F extract ) { 274 VectorMap<unsigned> histos[ LinkageSpec::NoOfSpecs];427 VectorMap<unsigned> histos[n_named_specs]; 275 428 VectorMap<unsigned> thisto; 276 429 277 430 for ( const auto& entry : extract(total) ) { ++thisto.at( entry.second ); } 278 431 279 for ( unsigned i = 0; i < LinkageSpec::NoOfSpecs; ++i ) {432 for ( unsigned i = 0; i < n_named_specs; ++i ) { 280 433 // can't be a higher count in one of the sub-histograms than the total 281 434 histos[i].reserve( thisto.size() ); … … 295 448 template<typename F> 296 449 void printAllSparseHisto( const std::string& name, F extract ) { 297 std::map<unsigned, unsigned> histos[ LinkageSpec::NoOfSpecs];450 std::map<unsigned, unsigned> histos[n_named_specs]; 298 451 std::map<unsigned, unsigned> thisto; 299 452 300 453 for ( const auto& entry : extract(total) ) { ++thisto[ entry.second ]; } 301 454 302 for ( unsigned i = 0; i < LinkageSpec::NoOfSpecs; ++i ) {455 for ( unsigned i = 0; i < n_named_specs; ++i ) { 303 456 for ( const auto& entry : extract(for_linkage[i]) ) { ++histos[i][entry.second]; } 304 457 } … … 307 460 const auto& key = entry.first; 308 461 std::cout << "\"" << name << "\"," << key; 309 for ( unsigned i = 0; i < LinkageSpec::NoOfSpecs; ++i ) {462 for ( unsigned i = 0; i < n_named_specs; ++i ) { 310 463 auto it = histos[i].find( key ); 311 464 if ( it == histos[i].end() ) std::cout << ",0"; … … 319 472 void printAllPack( const std::string& name, F extract ) { 320 473 printAllMap("n_basic_" + name, [&extract](const Stats& stats) { return extract(stats).n_basic; }); 474 printAllMap("n_generic_" + name, [&extract](const Stats& stats) { return extract(stats).n_generic; }); 321 475 printAllMap("n_poly_" + name, [&extract](const Stats& stats) { return extract(stats).n_poly; }); 476 printAllMap("n_compound_" + name, [&extract](const Stats& stats) { return extract(stats).n_compound; }); 322 477 printAllMap("n_" + name, [&extract](const Stats& stats) { return extract(stats).n; }); 323 478 printAllMap("%_basic_" + name, [&extract](const Stats& stats) { return extract(stats).p_basic; }); 479 printAllMap("%_generic_" + name, [&extract](const Stats& stats) { return extract(stats).p_generic; }); 324 480 printAllMap("%_poly_" + name, [&extract](const Stats& stats) { return extract(stats).p_poly; }); 481 printAllMap("%_compound_" + name, [&extract](const Stats& stats) { return extract(stats).p_compound; }); 325 482 printAllMap("n_distinct_types_" + name, [&extract](const Stats& stats) { return extract(stats).n_types; }); 326 483 printAllMap("%_new_types_in_" + name, [&extract](const Stats& stats) { return extract(stats).p_new; }); … … 342 499 } 343 500 344 std::cout << ",,\"intrinsic\",\"Cforall\",\"C\",\"autogen\",\" builtin\",\"TOTAL\"" << std::endl;501 std::cout << ",,\"intrinsic\",\"Cforall\",\"C\",\"autogen\",\"compiler\",\"builtinCFA\",\"builtinC\",\"other\",\"TOTAL\"" << std::endl; 345 502 346 503 printAllMap("n_type_params", [](const Stats& stats) { return stats.n_type_params; }); 504 printAllMap("n_generic_params", [](const Stats& stats) { return stats.n_generic_params; }); 505 printAllMap("n_generic_nesting", [](const Stats& stats) { return stats.n_generic_nesting; }); 347 506 printAll("n_decls", [](const Stats& stats) { return stats.n_decls; }); 348 507 printAll("unique_names", [](const Stats& stats) { return stats.by_name.size(); }); … … 351 510 printAllSparseHisto("basic_type_uses", [](const Stats& stats) { return stats.basic_type_names; }); 352 511 printAllSparseHisto("decls_using_basic_type", [](const Stats& stats) { return stats.basic_type_decls; }); 512 printAll("generic_type_names", [](const Stats& stats) { return stats.generic_type_names.size(); }); 513 printAllSparseHisto("generic_type_uses", [](const Stats& stats) { return stats.generic_type_names; }); 514 printAllSparseHisto("decls_using_generic_type", [](const Stats& stats) { return stats.generic_type_decls; }); 353 515 printAll("compound_type_names", [](const Stats& stats) { return stats.compound_type_names.size(); }); 354 516 printAllSparseHisto("compound_type_uses", [](const Stats& stats) { return stats.compound_type_names; }); … … 365 527 }; 366 528 529 const unsigned DeclStats::ind_for_linkage[] 530 = { 7, 7, 2, 1, 7, 7, 7, 3, 4, 7, 6, 5, 7, 7, 7, 0 }; 531 367 532 void printDeclStats( std::list< Declaration * > &translationUnit ) { 368 DeclStatsstats;533 PassVisitor<DeclStats> stats; 369 534 acceptAll( translationUnit, stats ); 370 stats.p rint();535 stats.pass.print(); 371 536 } 372 537 -
src/CodeTools/TrackLoc.cc
rf9feab8 r90152a4 24 24 25 25 #include "Common/PassVisitor.h" // for PassVisitor 26 #include "Common/SemanticError.h" // for SemanticError27 26 #include "Common/utility.h" // for CodeLocation 28 27 #include "SynTree/BaseSyntaxNode.h" // for BaseSyntaxNode … … 64 63 } 65 64 else { 66 assertf( false, "Top level node has no CodeLocation %s", name.c_str() );65 assertf( false, "Top level node has no CodeLocation %s", toString( node ).c_str() ); 67 66 } 68 67 } -
src/Common/Debug.h
rf9feab8 r90152a4 28 28 namespace Debug { 29 29 /// debug codegen a translation unit 30 static inline void codeGen( __attribute__((unused)) const std::list< Declaration * > & translationUnit, __attribute__((unused)) const std::string & label ) {30 static inline void codeGen( __attribute__((unused)) const std::list< Declaration * > & translationUnit, __attribute__((unused)) const std::string & label, __attribute__((unused)) LinkageSpec::Spec linkageFilter = LinkageSpec::Builtin ) { 31 31 #ifdef DEBUG 32 32 std::list< Declaration * > decls; 33 33 34 filter( translationUnit.begin(), translationUnit.end(), back_inserter( decls ), [ ]( Declaration * decl ) {35 return ! LinkageSpec::isBuiltin( decl->get_linkage());34 filter( translationUnit.begin(), translationUnit.end(), back_inserter( decls ), [linkageFilter]( Declaration * decl ) { 35 return ! (decl->linkage & linkageFilter); 36 36 }); 37 37 38 38 std::cerr << "======" << label << "======" << std::endl; 39 CodeGen::generate( decls, std::cerr, false, true ); 39 CodeGen::generate( 40 decls, 41 std::cerr, 42 true /* doIntrinsics */, 43 true /* pretty */, 44 false /* generateC */, 45 false /* lineMarks */, 46 true /* printTypeExpr */ 47 ); 40 48 #endif 41 49 } // dump 42 50 43 static inline void treeDump( __attribute__((unused)) const std::list< Declaration * > & translationUnit, __attribute__((unused)) const std::string & label ) {51 static inline void treeDump( __attribute__((unused)) const std::list< Declaration * > & translationUnit, __attribute__((unused)) const std::string & label, __attribute__((unused)) LinkageSpec::Spec linkageFilter = LinkageSpec::Compiler ) { 44 52 #ifdef DEBUG 45 53 std::list< Declaration * > decls; 46 54 47 filter( translationUnit.begin(), translationUnit.end(), back_inserter( decls ), [ ]( Declaration * decl ) {48 return ! LinkageSpec::isBuiltin( decl->get_linkage());55 filter( translationUnit.begin(), translationUnit.end(), back_inserter( decls ), [linkageFilter]( Declaration * decl ) { 56 return ! (decl->linkage & linkageFilter); 49 57 }); 50 58 -
src/Common/PassVisitor.h
rf9feab8 r90152a4 19 19 #include "SynTree/Expression.h" 20 20 #include "SynTree/Constant.h" 21 #include "SynTree/TypeSubstitution.h" 21 22 class TypeSubstitution; 22 23 23 24 #include "PassVisitor.proto.h" … … 65 66 virtual void visit( TypedefDecl * typeDecl ) override final; 66 67 virtual void visit( AsmDecl * asmDecl ) override final; 68 virtual void visit( StaticAssertDecl * assertDecl ) override final; 67 69 68 70 virtual void visit( CompoundStmt * compoundStmt ) override final; 69 71 virtual void visit( ExprStmt * exprStmt ) override final; 70 72 virtual void visit( AsmStmt * asmStmt ) override final; 73 virtual void visit( DirectiveStmt * dirStmt ) override final; 71 74 virtual void visit( IfStmt * ifStmt ) override final; 72 75 virtual void visit( WhileStmt * whileStmt ) override final; … … 90 93 virtual void visit( NameExpr * nameExpr ) override final; 91 94 virtual void visit( CastExpr * castExpr ) override final; 95 virtual void visit( KeywordCastExpr * castExpr ) override final; 92 96 virtual void visit( VirtualCastExpr * castExpr ) override final; 93 97 virtual void visit( AddressExpr * addressExpr ) override final; … … 118 122 virtual void visit( StmtExpr * stmtExpr ) override final; 119 123 virtual void visit( UniqueExpr * uniqueExpr ) override final; 124 virtual void visit( UntypedInitExpr * initExpr ) override final; 125 virtual void visit( InitExpr * initExpr ) override final; 126 virtual void visit( DeletedExpr * delExpr ) override final; 127 virtual void visit( DefaultArgExpr * argExpr ) override final; 128 virtual void visit( GenericExpr * genExpr ) override final; 120 129 121 130 virtual void visit( VoidType * basicType ) override final; … … 124 133 virtual void visit( ArrayType * arrayType ) override final; 125 134 virtual void visit( ReferenceType * referenceType ) override final; 135 virtual void visit( QualifiedType * qualType ) override final; 126 136 virtual void visit( FunctionType * functionType ) override final; 127 137 virtual void visit( StructInstType * aggregateUseType ) override final; … … 136 146 virtual void visit( ZeroType * zeroType ) override final; 137 147 virtual void visit( OneType * oneType ) override final; 148 virtual void visit( GlobalScopeType * globalType ) override final; 138 149 139 150 virtual void visit( Designation * designation ) override final; … … 157 168 virtual Declaration * mutate( TypedefDecl * typeDecl ) override final; 158 169 virtual AsmDecl * mutate( AsmDecl * asmDecl ) override final; 170 virtual StaticAssertDecl * mutate( StaticAssertDecl * assertDecl ) override final; 159 171 160 172 virtual CompoundStmt * mutate( CompoundStmt * compoundStmt ) override final; 161 173 virtual Statement * mutate( ExprStmt * exprStmt ) override final; 162 174 virtual Statement * mutate( AsmStmt * asmStmt ) override final; 175 virtual Statement * mutate( DirectiveStmt * dirStmt ) override final; 163 176 virtual Statement * mutate( IfStmt * ifStmt ) override final; 164 177 virtual Statement * mutate( WhileStmt * whileStmt ) override final; … … 181 194 virtual Expression * mutate( UntypedExpr * untypedExpr ) override final; 182 195 virtual Expression * mutate( NameExpr * nameExpr ) override final; 183 virtual Expression * mutate( AddressExpr * castExpr ) override final;196 virtual Expression * mutate( AddressExpr * addrExpr ) override final; 184 197 virtual Expression * mutate( LabelAddressExpr * labAddressExpr ) override final; 185 198 virtual Expression * mutate( CastExpr * castExpr ) override final; 199 virtual Expression * mutate( KeywordCastExpr * castExpr ) override final; 186 200 virtual Expression * mutate( VirtualCastExpr * castExpr ) override final; 187 201 virtual Expression * mutate( UntypedMemberExpr * memberExpr ) override final; … … 210 224 virtual Expression * mutate( StmtExpr * stmtExpr ) override final; 211 225 virtual Expression * mutate( UniqueExpr * uniqueExpr ) override final; 226 virtual Expression * mutate( UntypedInitExpr * initExpr ) override final; 227 virtual Expression * mutate( InitExpr * initExpr ) override final; 228 virtual Expression * mutate( DeletedExpr * delExpr ) override final; 229 virtual Expression * mutate( DefaultArgExpr * argExpr ) override final; 230 virtual Expression * mutate( GenericExpr * genExpr ) override final; 212 231 213 232 virtual Type * mutate( VoidType * basicType ) override final; … … 216 235 virtual Type * mutate( ArrayType * arrayType ) override final; 217 236 virtual Type * mutate( ReferenceType * referenceType ) override final; 237 virtual Type * mutate( QualifiedType * qualType ) override final; 218 238 virtual Type * mutate( FunctionType * functionType ) override final; 219 239 virtual Type * mutate( StructInstType * aggregateUseType ) override final; … … 228 248 virtual Type * mutate( ZeroType * zeroType ) override final; 229 249 virtual Type * mutate( OneType * oneType ) override final; 250 virtual Type * mutate( GlobalScopeType * globalType ) override final; 230 251 231 252 virtual Designation * mutate( Designation * designation ) override final; … … 243 264 244 265 private: 266 bool inFunction = false; 267 245 268 template<typename pass_t> friend void acceptAll( std::list< Declaration* > &decls, PassVisitor< pass_t >& visitor ); 246 269 template<typename pass_t> friend void mutateAll( std::list< Declaration* > &decls, PassVisitor< pass_t >& visitor ); … … 286 309 bool_ref * get_visit_children_ptr() { return visit_children_impl(pass, 0); } 287 310 288 void indexerScopeEnter () { indexer_impl_enterScope ( pass, 0 ); }289 void indexerScopeLeave () { indexer_impl_leaveScope ( pass, 0 ); }290 void indexerAddId ( DeclarationWithType * node) { indexer_impl_addId ( pass, 0, node ); }291 void indexerAddType ( NamedTypeDecl * node) { indexer_impl_addType ( pass, 0, node ); }292 void indexerAddStruct ( const std::string & id) { indexer_impl_addStruct ( pass, 0, id ); }293 void indexerAddStruct ( StructDecl * node) { indexer_impl_addStruct ( pass, 0, node ); }294 void indexerAddStructFwd( StructDecl * node) { indexer_impl_addStructFwd( pass, 0, node ); }295 void indexerAddEnum ( EnumDecl * node) { indexer_impl_addEnum ( pass, 0, node ); }296 void indexerAddUnion ( const std::string & id) { indexer_impl_addUnion ( pass, 0, id ); }297 void indexerAddUnion ( UnionDecl * node) { indexer_impl_addUnion ( pass, 0, node ); }298 void indexerAddUnionFwd ( UnionDecl * node) { indexer_impl_addUnionFwd ( pass, 0, node ); }299 void indexerAddTrait ( TraitDecl * node) { indexer_impl_addTrait ( pass, 0, node ); }300 void indexerAddWith ( WithStmt * node ) { indexer_impl_addWith ( pass, 0, node); }311 void indexerScopeEnter () { indexer_impl_enterScope ( pass, 0 ); } 312 void indexerScopeLeave () { indexer_impl_leaveScope ( pass, 0 ); } 313 void indexerAddId ( DeclarationWithType * node ) { indexer_impl_addId ( pass, 0, node ); } 314 void indexerAddType ( NamedTypeDecl * node ) { indexer_impl_addType ( pass, 0, node ); } 315 void indexerAddStruct ( const std::string & id ) { indexer_impl_addStruct ( pass, 0, id ); } 316 void indexerAddStruct ( StructDecl * node ) { indexer_impl_addStruct ( pass, 0, node ); } 317 void indexerAddStructFwd( StructDecl * node ) { indexer_impl_addStructFwd( pass, 0, node ); } 318 void indexerAddEnum ( EnumDecl * node ) { indexer_impl_addEnum ( pass, 0, node ); } 319 void indexerAddUnion ( const std::string & id ) { indexer_impl_addUnion ( pass, 0, id ); } 320 void indexerAddUnion ( UnionDecl * node ) { indexer_impl_addUnion ( pass, 0, node ); } 321 void indexerAddUnionFwd ( UnionDecl * node ) { indexer_impl_addUnionFwd ( pass, 0, node ); } 322 void indexerAddTrait ( TraitDecl * node ) { indexer_impl_addTrait ( pass, 0, node ); } 323 void indexerAddWith ( std::list< Expression * > & exprs, BaseSyntaxNode * withStmt ) { indexer_impl_addWith( pass, 0, exprs, withStmt ); } 301 324 302 325 … … 403 426 }; 404 427 428 #include "SynTree/TypeSubstitution.h" 405 429 #include "PassVisitor.impl.h" -
src/Common/PassVisitor.impl.h
rf9feab8 r90152a4 62 62 63 63 template< typename pass_type > 64 staticinline void acceptAll( std::list< Declaration* > &decls, PassVisitor< pass_type >& visitor ) {64 inline void acceptAll( std::list< Declaration* > &decls, PassVisitor< pass_type >& visitor ) { 65 65 DeclList_t* beforeDecls = visitor.get_beforeDecls(); 66 66 DeclList_t* afterDecls = visitor.get_afterDecls(); 67 SemanticError errors;67 SemanticErrorException errors; 68 68 69 69 for ( std::list< Declaration* >::iterator i = decls.begin(); ; ++i ) { … … 76 76 // run visitor on declaration 77 77 maybeAccept_impl( *i, visitor ); 78 } catch( SemanticError &e ) { 79 e.set_location( (*i)->location ); 78 } catch( SemanticErrorException &e ) { 80 79 errors.append( e ); 81 80 } … … 90 89 91 90 template< typename pass_type > 92 staticinline void mutateAll( std::list< Declaration* > &decls, PassVisitor< pass_type >& mutator ) {91 inline void mutateAll( std::list< Declaration* > &decls, PassVisitor< pass_type >& mutator ) { 93 92 DeclList_t* beforeDecls = mutator.get_beforeDecls(); 94 93 DeclList_t* afterDecls = mutator.get_afterDecls(); 95 SemanticError errors;94 SemanticErrorException errors; 96 95 97 96 for ( std::list< Declaration* >::iterator i = decls.begin(); ; ++i ) { … … 103 102 // run mutator on declaration 104 103 maybeMutate_impl( *i, mutator ); 105 } catch( SemanticError &e ) { 106 e.set_location( (*i)->location ); 104 } catch( SemanticErrorException &e ) { 107 105 errors.append( e ); 108 106 } … … 127 125 inline void maybeAccept_impl( Container & container, PassVisitor< pass_type > & visitor ) { 128 126 if ( ! visitor.get_visit_children() ) return; 129 SemanticError errors;127 SemanticErrorException errors; 130 128 for ( typename Container::iterator i = container.begin(); i != container.end(); ++i ) { 131 129 try { … … 133 131 (*i)->accept( visitor ); 134 132 } 135 } catch( SemanticError &e ) { 136 e.set_location( (*i)->location ); 133 } catch( SemanticErrorException &e ) { 137 134 errors.append( e ); 138 135 } … … 155 152 inline void maybeMutate_impl( Container & container, PassVisitor< pass_type > & mutator ) { 156 153 if ( ! mutator.get_visit_children() ) return; 157 SemanticError errors;154 SemanticErrorException errors; 158 155 for ( typename Container::iterator i = container.begin(); i != container.end(); ++i ) { 159 156 try { … … 162 159 assert( *i ); 163 160 } // if 164 } catch( SemanticError &e ) { 165 e.set_location( (*i)->location ); 161 } catch( SemanticErrorException &e ) { 166 162 errors.append( e ); 167 163 } // try … … 176 172 void PassVisitor< pass_type >::handleStatementList( std::list< Statement * > & statements, func_t func ) { 177 173 if ( ! get_visit_children() ) return; 178 SemanticError errors;174 SemanticErrorException errors; 179 175 180 176 // don't want statements from outer CompoundStmts to be added to this CompoundStmt … … 199 195 || ( empty( beforeDecls ) && empty( afterDecls )) ); 200 196 201 } catch ( SemanticError &e ) { 202 e.set_location( (*i)->location ); 197 } catch ( SemanticErrorException &e ) { 203 198 errors.append( e ); 204 199 } … … 365 360 maybeAccept_impl ( node->attributes , *this ); 366 361 367 if ( node->name != "" ) { 368 indexerAddId( node ); 369 } 362 indexerAddId( node ); 370 363 371 364 VISIT_END( node ); … … 381 374 maybeMutate_impl ( node->attributes , *this ); 382 375 383 if ( node->name != "" ) { 384 indexerAddId( node ); 385 } 376 indexerAddId( node ); 386 377 387 378 MUTATE_END( DeclarationWithType, node ); … … 394 385 VISIT_START( node ); 395 386 396 if ( node->name != "" ) { 397 indexerAddId( node ); 398 } 399 387 indexerAddId( node ); 388 389 maybeAccept_impl( node->withExprs, *this ); 400 390 { 391 // with clause introduces a level of scope (for the with expression members). 392 // with clause exprs are added to the indexer before parameters so that parameters 393 // shadow with exprs and not the other way around. 401 394 auto guard = makeFuncGuard( [this]() { indexerScopeEnter(); }, [this]() { indexerScopeLeave(); } ); 402 // implicit add __func__ identifier as specified in the C manual 6.4.2.2 403 static ObjectDecl func( 404 "__func__", noStorageClasses, LinkageSpec::C, nullptr, 405 new ArrayType( Type::Qualifiers(), new BasicType( Type::Qualifiers( Type::Const ), BasicType::Char ), nullptr, true, false ), 406 nullptr 407 ); 408 indexerAddId( &func ); 409 maybeAccept_impl( node->type, *this ); 410 maybeAccept_impl( node->statements, *this ); 411 maybeAccept_impl( node->attributes, *this ); 395 indexerAddWith( node->withExprs, node ); 396 { 397 auto guard = makeFuncGuard( [this]() { indexerScopeEnter(); }, [this]() { indexerScopeLeave(); } ); 398 // implicit add __func__ identifier as specified in the C manual 6.4.2.2 399 static ObjectDecl func( 400 "__func__", noStorageClasses, LinkageSpec::C, nullptr, 401 new ArrayType( Type::Qualifiers(), new BasicType( Type::Qualifiers( Type::Const ), BasicType::Char ), nullptr, true, false ), 402 nullptr 403 ); 404 indexerAddId( &func ); 405 maybeAccept_impl( node->type, *this ); 406 // function body needs to have the same scope as parameters - CompoundStmt will not enter 407 // a new scope if inFunction is true 408 ValueGuard< bool > oldInFunction( inFunction ); 409 inFunction = true; 410 maybeAccept_impl( node->statements, *this ); 411 maybeAccept_impl( node->attributes, *this ); 412 } 412 413 } 413 414 … … 419 420 MUTATE_START( node ); 420 421 421 if ( node->name != "" ) { 422 indexerAddId( node ); 423 } 422 indexerAddId( node ); 424 423 425 424 { 425 // with clause introduces a level of scope (for the with expression members). 426 // with clause exprs are added to the indexer before parameters so that parameters 427 // shadow with exprs and not the other way around. 426 428 auto guard = makeFuncGuard( [this]() { indexerScopeEnter(); }, [this]() { indexerScopeLeave(); } ); 427 // implicit add __func__ identifier as specified in the C manual 6.4.2.2 428 static ObjectDecl func( 429 "__func__", noStorageClasses, LinkageSpec::C, nullptr, 430 new ArrayType( Type::Qualifiers(), new BasicType( Type::Qualifiers( Type::Const ), BasicType::Char ), nullptr, true, false ), 431 nullptr 432 ); 433 indexerAddId( &func ); 434 maybeMutate_impl( node->type, *this ); 435 maybeMutate_impl( node->statements, *this ); 436 maybeMutate_impl( node->attributes, *this ); 429 indexerAddWith( node->withExprs, node ); 430 { 431 auto guard = makeFuncGuard( [this]() { indexerScopeEnter(); }, [this]() { indexerScopeLeave(); } ); 432 // implicit add __func__ identifier as specified in the C manual 6.4.2.2 433 static ObjectDecl func( 434 "__func__", noStorageClasses, LinkageSpec::C, nullptr, 435 new ArrayType( Type::Qualifiers(), new BasicType( Type::Qualifiers( Type::Const ), BasicType::Char ), nullptr, true, false ), 436 nullptr 437 ); 438 indexerAddId( &func ); 439 maybeMutate_impl( node->type, *this ); 440 // function body needs to have the same scope as parameters - CompoundStmt will not enter 441 // a new scope if inFunction is true 442 ValueGuard< bool > oldInFunction( inFunction ); 443 inFunction = true; 444 maybeMutate_impl( node->statements, *this ); 445 maybeMutate_impl( node->attributes, *this ); 446 } 437 447 } 438 448 … … 683 693 684 694 //-------------------------------------------------------------------------- 695 // StaticAssertDecl 696 template< typename pass_type > 697 void PassVisitor< pass_type >::visit( StaticAssertDecl * node ) { 698 VISIT_START( node ); 699 700 node->condition = visitExpression( node->condition ); 701 maybeAccept_impl( node->message, *this ); 702 703 VISIT_END( node ); 704 } 705 706 template< typename pass_type > 707 StaticAssertDecl * PassVisitor< pass_type >::mutate( StaticAssertDecl * node ) { 708 MUTATE_START( node ); 709 710 node->condition = mutateExpression( node->condition ); 711 maybeMutate_impl( node->message, *this ); 712 713 MUTATE_END( StaticAssertDecl, node ); 714 } 715 716 //-------------------------------------------------------------------------- 685 717 // CompoundStmt 686 718 template< typename pass_type > … … 688 720 VISIT_START( node ); 689 721 { 690 auto guard1 = makeFuncGuard( [this]() { indexerScopeEnter(); }, [this]() { indexerScopeLeave(); } ); 722 // do not enter a new scope if inFunction is true - needs to check old state before the assignment 723 ValueGuard< bool > oldInFunction( inFunction ); 724 auto guard1 = makeFuncGuard( [this, &oldInFunction]() { if ( ! oldInFunction.old ) indexerScopeEnter(); }, [this, &oldInFunction]() { if ( ! oldInFunction.old ) indexerScopeLeave(); } ); 691 725 auto guard2 = makeFuncGuard( [this]() { call_beginScope(); }, [this]() { call_endScope(); } ); 726 inFunction = false; 692 727 visitStatementList( node->kids ); 693 728 } … … 699 734 MUTATE_START( node ); 700 735 { 701 auto guard1 = makeFuncGuard( [this]() { indexerScopeEnter(); }, [this]() { indexerScopeLeave(); } ); 736 // do not enter a new scope if inFunction is true - needs to check old state before the assignment 737 ValueGuard< bool > oldInFunction( inFunction ); 738 auto guard1 = makeFuncGuard( [this, &oldInFunction]() { if ( ! oldInFunction.old ) indexerScopeEnter(); }, [this, &oldInFunction]() { if ( ! oldInFunction.old ) indexerScopeLeave(); } ); 702 739 auto guard2 = makeFuncGuard( [this]() { call_beginScope(); }, [this]() { call_endScope(); } ); 740 inFunction = false; 703 741 mutateStatementList( node->kids ); 704 742 } … … 730 768 template< typename pass_type > 731 769 void PassVisitor< pass_type >::visit( AsmStmt * node ) { 732 VISIT_BODY( node ); 770 VISIT_START( node ) 771 772 maybeAccept_impl( node->instruction, *this ); 773 maybeAccept_impl( node->output, *this ); 774 maybeAccept_impl( node->input, *this ); 775 maybeAccept_impl( node->clobber, *this ); 776 777 VISIT_END( node ); 733 778 } 734 779 735 780 template< typename pass_type > 736 781 Statement * PassVisitor< pass_type >::mutate( AsmStmt * node ) { 737 MUTATE_BODY( Statement, node ); 782 MUTATE_START( node ); 783 784 maybeMutate_impl( node->instruction, *this ); 785 maybeMutate_impl( node->output, *this ); 786 maybeMutate_impl( node->input, *this ); 787 maybeMutate_impl( node->clobber, *this ); 788 789 MUTATE_END( Statement, node ); 790 } 791 792 //-------------------------------------------------------------------------- 793 // AsmStmt 794 template< typename pass_type > 795 void PassVisitor< pass_type >::visit( DirectiveStmt * node ) { 796 VISIT_START( node ) 797 798 VISIT_END( node ); 799 } 800 801 template< typename pass_type > 802 Statement * PassVisitor< pass_type >::mutate( DirectiveStmt * node ) { 803 MUTATE_START( node ); 804 805 MUTATE_END( Statement, node ); 738 806 } 739 807 … … 774 842 VISIT_START( node ); 775 843 776 visitExpression( node->condition ); 777 node->body = visitStatement( node->body ); 844 { 845 // while statements introduce a level of scope (for the initialization) 846 auto guard = makeFuncGuard( [this]() { indexerScopeEnter(); }, [this]() { indexerScopeLeave(); } ); 847 maybeAccept_impl( node->initialization, *this ); 848 visitExpression ( node->condition ); 849 node->body = visitStatement( node->body ); 850 } 778 851 779 852 VISIT_END( node ); … … 784 857 MUTATE_START( node ); 785 858 786 node->condition = mutateExpression( node->condition ); 787 node->body = mutateStatement ( node->body ); 859 { 860 // while statements introduce a level of scope (for the initialization) 861 auto guard = makeFuncGuard( [this]() { indexerScopeEnter(); }, [this]() { indexerScopeLeave(); } ); 862 maybeMutate_impl( node->initialization, *this ); 863 node->condition = mutateExpression( node->condition ); 864 node->body = mutateStatement ( node->body ); 865 } 866 788 867 789 868 MUTATE_END( Statement, node ); … … 868 947 template< typename pass_type > 869 948 void PassVisitor< pass_type >::visit( BranchStmt * node ) { 870 VISIT_BODY( node ); 949 VISIT_START( node ); 950 VISIT_END( node ); 871 951 } 872 952 873 953 template< typename pass_type > 874 954 Statement * PassVisitor< pass_type >::mutate( BranchStmt * node ) { 875 MUTATE_BODY( Statement, node ); 955 MUTATE_START( node ); 956 MUTATE_END( Statement, node ); 876 957 } 877 958 … … 901 982 template< typename pass_type > 902 983 void PassVisitor< pass_type >::visit( ThrowStmt * node ) { 903 VISIT_BODY( node ); 984 VISIT_START( node ); 985 986 maybeAccept_impl( node->expr, *this ); 987 maybeAccept_impl( node->target, *this ); 988 989 VISIT_END( node ); 904 990 } 905 991 906 992 template< typename pass_type > 907 993 Statement * PassVisitor< pass_type >::mutate( ThrowStmt * node ) { 908 MUTATE_BODY( Statement, node ); 994 MUTATE_START( node ); 995 996 maybeMutate_impl( node->expr, *this ); 997 maybeMutate_impl( node->target, *this ); 998 999 MUTATE_END( Statement, node ); 909 1000 } 910 1001 … … 965 1056 template< typename pass_type > 966 1057 void PassVisitor< pass_type >::visit( FinallyStmt * node ) { 967 VISIT_BODY( node ); 1058 VISIT_START( node ); 1059 1060 maybeAccept_impl( node->block, *this ); 1061 1062 VISIT_END( node ); 968 1063 } 969 1064 970 1065 template< typename pass_type > 971 1066 Statement * PassVisitor< pass_type >::mutate( FinallyStmt * node ) { 972 MUTATE_BODY( Statement, node ); 1067 MUTATE_START( node ); 1068 1069 maybeMutate_impl( node->block, *this ); 1070 1071 MUTATE_END( Statement, node ); 973 1072 } 974 1073 … … 977 1076 template< typename pass_type > 978 1077 void PassVisitor< pass_type >::visit( WaitForStmt * node ) { 979 VISIT_BODY( node ); 1078 VISIT_START( node ); 1079 1080 for( auto & clause : node->clauses ) { 1081 maybeAccept_impl( clause.target.function, *this ); 1082 maybeAccept_impl( clause.target.arguments, *this ); 1083 1084 maybeAccept_impl( clause.statement, *this ); 1085 maybeAccept_impl( clause.condition, *this ); 1086 } 1087 1088 maybeAccept_impl( node->timeout.time, *this ); 1089 maybeAccept_impl( node->timeout.statement, *this ); 1090 maybeAccept_impl( node->timeout.condition, *this ); 1091 maybeAccept_impl( node->orelse.statement, *this ); 1092 maybeAccept_impl( node->orelse.condition, *this ); 1093 1094 VISIT_END( node ); 980 1095 } 981 1096 982 1097 template< typename pass_type > 983 1098 Statement * PassVisitor< pass_type >::mutate( WaitForStmt * node ) { 984 MUTATE_BODY( Statement, node ); 1099 MUTATE_START( node ); 1100 1101 for( auto & clause : node->clauses ) { 1102 maybeMutate_impl( clause.target.function, *this ); 1103 maybeMutate_impl( clause.target.arguments, *this ); 1104 1105 maybeMutate_impl( clause.statement, *this ); 1106 maybeMutate_impl( clause.condition, *this ); 1107 } 1108 1109 maybeMutate_impl( node->timeout.time, *this ); 1110 maybeMutate_impl( node->timeout.statement, *this ); 1111 maybeMutate_impl( node->timeout.condition, *this ); 1112 maybeMutate_impl( node->orelse.statement, *this ); 1113 maybeMutate_impl( node->orelse.condition, *this ); 1114 1115 MUTATE_END( Statement, node ); 985 1116 } 986 1117 … … 996 1127 // catch statements introduce a level of scope (for the caught exception) 997 1128 auto guard = makeFuncGuard( [this]() { indexerScopeEnter(); }, [this]() { indexerScopeLeave(); } ); 998 indexerAddWith( node );1129 indexerAddWith( node->exprs, node ); 999 1130 maybeAccept_impl( node->stmt, *this ); 1000 1131 } … … 1009 1140 // catch statements introduce a level of scope (for the caught exception) 1010 1141 auto guard = makeFuncGuard( [this]() { indexerScopeEnter(); }, [this]() { indexerScopeLeave(); } ); 1011 indexerAddWith( node );1142 indexerAddWith( node->exprs, node ); 1012 1143 maybeMutate_impl( node->stmt, *this ); 1013 1144 } … … 1019 1150 template< typename pass_type > 1020 1151 void PassVisitor< pass_type >::visit( NullStmt * node ) { 1021 VISIT_BODY( node ); 1152 VISIT_START( node ); 1153 VISIT_END( node ); 1022 1154 } 1023 1155 1024 1156 template< typename pass_type > 1025 1157 NullStmt * PassVisitor< pass_type >::mutate( NullStmt * node ) { 1026 MUTATE_BODY( NullStmt, node ); 1158 MUTATE_START( node ); 1159 MUTATE_END( NullStmt, node ); 1027 1160 } 1028 1161 … … 1031 1164 template< typename pass_type > 1032 1165 void PassVisitor< pass_type >::visit( DeclStmt * node ) { 1033 VISIT_BODY( node ); 1166 VISIT_START( node ); 1167 1168 maybeAccept_impl( node->decl, *this ); 1169 1170 VISIT_END( node ); 1034 1171 } 1035 1172 1036 1173 template< typename pass_type > 1037 1174 Statement * PassVisitor< pass_type >::mutate( DeclStmt * node ) { 1038 MUTATE_BODY( Statement, node ); 1175 MUTATE_START( node ); 1176 1177 maybeMutate_impl( node->decl, *this ); 1178 1179 MUTATE_END( Statement, node ); 1039 1180 } 1040 1181 … … 1043 1184 template< typename pass_type > 1044 1185 void PassVisitor< pass_type >::visit( ImplicitCtorDtorStmt * node ) { 1045 VISIT_BODY( node ); 1186 VISIT_START( node ); 1187 1188 maybeAccept_impl( node->callStmt, *this ); 1189 1190 VISIT_END( node ); 1046 1191 } 1047 1192 1048 1193 template< typename pass_type > 1049 1194 Statement * PassVisitor< pass_type >::mutate( ImplicitCtorDtorStmt * node ) { 1050 MUTATE_BODY( Statement, node ); 1195 MUTATE_START( node ); 1196 1197 maybeMutate_impl( node->callStmt, *this ); 1198 1199 MUTATE_END( Statement, node ); 1051 1200 } 1052 1201 … … 1141 1290 template< typename pass_type > 1142 1291 Expression * PassVisitor< pass_type >::mutate( CastExpr * node ) { 1292 MUTATE_START( node ); 1293 1294 indexerScopedMutate( node->env , *this ); 1295 indexerScopedMutate( node->result, *this ); 1296 maybeMutate_impl ( node->arg , *this ); 1297 1298 MUTATE_END( Expression, node ); 1299 } 1300 1301 //-------------------------------------------------------------------------- 1302 // KeywordCastExpr 1303 template< typename pass_type > 1304 void PassVisitor< pass_type >::visit( KeywordCastExpr * node ) { 1305 VISIT_START( node ); 1306 1307 indexerScopedAccept( node->result, *this ); 1308 maybeAccept_impl ( node->arg , *this ); 1309 1310 VISIT_END( node ); 1311 } 1312 1313 template< typename pass_type > 1314 Expression * PassVisitor< pass_type >::mutate( KeywordCastExpr * node ) { 1143 1315 MUTATE_START( node ); 1144 1316 … … 1404 1576 indexerScopedAccept( node->result, *this ); 1405 1577 maybeAccept_impl ( node->type , *this ); 1406 maybeAccept_impl ( node->member, *this );1407 1578 1408 1579 VISIT_END( node ); … … 1416 1587 indexerScopedMutate( node->result, *this ); 1417 1588 maybeMutate_impl ( node->type , *this ); 1418 maybeMutate_impl ( node->member, *this );1419 1589 1420 1590 MUTATE_END( Expression, node ); … … 1853 2023 } 1854 2024 2025 //-------------------------------------------------------------------------- 2026 // UntypedInitExpr 2027 template< typename pass_type > 2028 void PassVisitor< pass_type >::visit( UntypedInitExpr * node ) { 2029 VISIT_START( node ); 2030 2031 indexerScopedAccept( node->result, *this ); 2032 maybeAccept_impl ( node->expr , *this ); 2033 // not currently visiting initAlts, but this doesn't matter since this node is only used in the resolver. 2034 2035 VISIT_END( node ); 2036 } 2037 2038 template< typename pass_type > 2039 Expression * PassVisitor< pass_type >::mutate( UntypedInitExpr * node ) { 2040 MUTATE_START( node ); 2041 2042 indexerScopedMutate( node->env , *this ); 2043 indexerScopedMutate( node->result, *this ); 2044 maybeMutate_impl ( node->expr , *this ); 2045 // not currently visiting initAlts, but this doesn't matter since this node is only used in the resolver. 2046 2047 MUTATE_END( Expression, node ); 2048 } 2049 2050 //-------------------------------------------------------------------------- 2051 // InitExpr 2052 template< typename pass_type > 2053 void PassVisitor< pass_type >::visit( InitExpr * node ) { 2054 VISIT_START( node ); 2055 2056 indexerScopedAccept( node->result, *this ); 2057 maybeAccept_impl ( node->expr , *this ); 2058 maybeAccept_impl ( node->designation, *this ); 2059 2060 VISIT_END( node ); 2061 } 2062 2063 template< typename pass_type > 2064 Expression * PassVisitor< pass_type >::mutate( InitExpr * node ) { 2065 MUTATE_START( node ); 2066 2067 indexerScopedMutate( node->env , *this ); 2068 indexerScopedMutate( node->result, *this ); 2069 maybeMutate_impl ( node->expr , *this ); 2070 maybeMutate_impl ( node->designation, *this ); 2071 2072 MUTATE_END( Expression, node ); 2073 } 2074 2075 //-------------------------------------------------------------------------- 2076 // DeletedExpr 2077 template< typename pass_type > 2078 void PassVisitor< pass_type >::visit( DeletedExpr * node ) { 2079 VISIT_START( node ); 2080 2081 indexerScopedAccept( node->result, *this ); 2082 maybeAccept_impl( node->expr, *this ); 2083 // don't visit deleteStmt, because it is a pointer to somewhere else in the tree. 2084 2085 VISIT_END( node ); 2086 } 2087 2088 template< typename pass_type > 2089 Expression * PassVisitor< pass_type >::mutate( DeletedExpr * node ) { 2090 MUTATE_START( node ); 2091 2092 indexerScopedMutate( node->env, *this ); 2093 indexerScopedMutate( node->result, *this ); 2094 maybeMutate_impl( node->expr, *this ); 2095 2096 MUTATE_END( Expression, node ); 2097 } 2098 2099 //-------------------------------------------------------------------------- 2100 // DefaultArgExpr 2101 template< typename pass_type > 2102 void PassVisitor< pass_type >::visit( DefaultArgExpr * node ) { 2103 VISIT_START( node ); 2104 2105 indexerScopedAccept( node->result, *this ); 2106 maybeAccept_impl( node->expr, *this ); 2107 2108 VISIT_END( node ); 2109 } 2110 2111 template< typename pass_type > 2112 Expression * PassVisitor< pass_type >::mutate( DefaultArgExpr * node ) { 2113 MUTATE_START( node ); 2114 2115 indexerScopedMutate( node->env, *this ); 2116 indexerScopedMutate( node->result, *this ); 2117 maybeMutate_impl( node->expr, *this ); 2118 2119 MUTATE_END( Expression, node ); 2120 } 2121 2122 //-------------------------------------------------------------------------- 2123 // GenericExpr 2124 template< typename pass_type > 2125 void PassVisitor< pass_type >::visit( GenericExpr * node ) { 2126 VISIT_START( node ); 2127 2128 indexerScopedAccept( node->result, *this ); 2129 maybeAccept_impl( node->control, *this ); 2130 for ( GenericExpr::Association & assoc : node->associations ) { 2131 indexerScopedAccept( assoc.type, *this ); 2132 maybeAccept_impl( assoc.expr, *this ); 2133 } 2134 2135 VISIT_END( node ); 2136 } 2137 2138 template< typename pass_type > 2139 Expression * PassVisitor< pass_type >::mutate( GenericExpr * node ) { 2140 MUTATE_START( node ); 2141 2142 indexerScopedMutate( node->env, *this ); 2143 indexerScopedMutate( node->result, *this ); 2144 maybeMutate_impl( node->control, *this ); 2145 for ( GenericExpr::Association & assoc : node->associations ) { 2146 indexerScopedMutate( assoc.type, *this ); 2147 maybeMutate_impl( assoc.expr, *this ); 2148 } 2149 2150 MUTATE_END( Expression, node ); 2151 } 2152 2153 //-------------------------------------------------------------------------- 2154 // VoidType 1855 2155 template< typename pass_type > 1856 2156 void PassVisitor< pass_type >::visit( VoidType * node ) { 1857 VISIT_BODY( node ); 1858 } 1859 2157 VISIT_START( node ); 2158 2159 maybeAccept_impl( node->forall, *this ); 2160 2161 VISIT_END( node ); 2162 } 2163 2164 template< typename pass_type > 2165 Type * PassVisitor< pass_type >::mutate( VoidType * node ) { 2166 MUTATE_START( node ); 2167 2168 maybeMutate_impl( node->forall, *this ); 2169 2170 MUTATE_END( Type, node ); 2171 } 2172 2173 //-------------------------------------------------------------------------- 2174 // BasicType 1860 2175 template< typename pass_type > 1861 2176 void PassVisitor< pass_type >::visit( BasicType * node ) { 1862 VISIT_BODY( node ); 1863 } 1864 2177 VISIT_START( node ); 2178 2179 maybeAccept_impl( node->forall, *this ); 2180 2181 VISIT_END( node ); 2182 } 2183 2184 template< typename pass_type > 2185 Type * PassVisitor< pass_type >::mutate( BasicType * node ) { 2186 MUTATE_START( node ); 2187 2188 maybeMutate_impl( node->forall, *this ); 2189 2190 MUTATE_END( Type, node ); 2191 } 2192 2193 //-------------------------------------------------------------------------- 2194 // PointerType 1865 2195 template< typename pass_type > 1866 2196 void PassVisitor< pass_type >::visit( PointerType * node ) { 1867 VISIT_BODY( node ); 1868 } 1869 2197 VISIT_START( node ); 2198 2199 maybeAccept_impl( node->forall, *this ); 2200 // xxx - should PointerType visit/mutate dimension? 2201 maybeAccept_impl( node->base, *this ); 2202 2203 VISIT_END( node ); 2204 } 2205 2206 template< typename pass_type > 2207 Type * PassVisitor< pass_type >::mutate( PointerType * node ) { 2208 MUTATE_START( node ); 2209 2210 maybeMutate_impl( node->forall, *this ); 2211 // xxx - should PointerType visit/mutate dimension? 2212 maybeMutate_impl( node->base, *this ); 2213 2214 MUTATE_END( Type, node ); 2215 } 2216 2217 //-------------------------------------------------------------------------- 2218 // ArrayType 1870 2219 template< typename pass_type > 1871 2220 void PassVisitor< pass_type >::visit( ArrayType * node ) { 1872 VISIT_BODY( node ); 1873 } 1874 2221 VISIT_START( node ); 2222 2223 maybeAccept_impl( node->forall, *this ); 2224 maybeAccept_impl( node->dimension, *this ); 2225 maybeAccept_impl( node->base, *this ); 2226 2227 VISIT_END( node ); 2228 } 2229 2230 template< typename pass_type > 2231 Type * PassVisitor< pass_type >::mutate( ArrayType * node ) { 2232 MUTATE_START( node ); 2233 2234 maybeMutate_impl( node->forall, *this ); 2235 maybeMutate_impl( node->dimension, *this ); 2236 maybeMutate_impl( node->base, *this ); 2237 2238 MUTATE_END( Type, node ); 2239 } 2240 2241 //-------------------------------------------------------------------------- 2242 // ReferenceType 1875 2243 template< typename pass_type > 1876 2244 void PassVisitor< pass_type >::visit( ReferenceType * node ) { 1877 VISIT_BODY( node ); 1878 } 1879 2245 VISIT_START( node ); 2246 2247 maybeAccept_impl( node->forall, *this ); 2248 maybeAccept_impl( node->base, *this ); 2249 2250 VISIT_END( node ); 2251 } 2252 2253 template< typename pass_type > 2254 Type * PassVisitor< pass_type >::mutate( ReferenceType * node ) { 2255 MUTATE_START( node ); 2256 2257 maybeMutate_impl( node->forall, *this ); 2258 maybeMutate_impl( node->base, *this ); 2259 2260 MUTATE_END( Type, node ); 2261 } 2262 2263 //-------------------------------------------------------------------------- 2264 // QualifiedType 2265 template< typename pass_type > 2266 void PassVisitor< pass_type >::visit( QualifiedType * node ) { 2267 VISIT_START( node ); 2268 2269 maybeAccept_impl( node->forall, *this ); 2270 maybeAccept_impl( node->parent, *this ); 2271 maybeAccept_impl( node->child, *this ); 2272 2273 VISIT_END( node ); 2274 } 2275 2276 template< typename pass_type > 2277 Type * PassVisitor< pass_type >::mutate( QualifiedType * node ) { 2278 MUTATE_START( node ); 2279 2280 maybeMutate_impl( node->forall, *this ); 2281 maybeMutate_impl( node->parent, *this ); 2282 maybeMutate_impl( node->child, *this ); 2283 2284 MUTATE_END( Type, node ); 2285 } 2286 2287 //-------------------------------------------------------------------------- 2288 // FunctionType 1880 2289 template< typename pass_type > 1881 2290 void PassVisitor< pass_type >::visit( FunctionType * node ) { 1882 VISIT_BODY( node ); 2291 VISIT_START( node ); 2292 2293 maybeAccept_impl( node->forall, *this ); 2294 maybeAccept_impl( node->returnVals, *this ); 2295 maybeAccept_impl( node->parameters, *this ); 2296 2297 VISIT_END( node ); 2298 } 2299 2300 template< typename pass_type > 2301 Type * PassVisitor< pass_type >::mutate( FunctionType * node ) { 2302 MUTATE_START( node ); 2303 2304 maybeMutate_impl( node->forall, *this ); 2305 maybeMutate_impl( node->returnVals, *this ); 2306 maybeMutate_impl( node->parameters, *this ); 2307 2308 MUTATE_END( Type, node ); 1883 2309 } 1884 2310 … … 1951 2377 template< typename pass_type > 1952 2378 void PassVisitor< pass_type >::visit( EnumInstType * node ) { 1953 VISIT_BODY( node ); 2379 VISIT_START( node ); 2380 2381 maybeAccept_impl( node->forall, *this ); 2382 maybeAccept_impl( node->parameters, *this ); 2383 2384 VISIT_END( node ); 1954 2385 } 1955 2386 1956 2387 template< typename pass_type > 1957 2388 Type * PassVisitor< pass_type >::mutate( EnumInstType * node ) { 1958 MUTATE_BODY( Type, node ); 2389 MUTATE_START( node ); 2390 2391 maybeMutate_impl( node->forall, *this ); 2392 maybeMutate_impl( node->parameters, *this ); 2393 2394 MUTATE_END( Type, node ); 1959 2395 } 1960 2396 … … 1985 2421 template< typename pass_type > 1986 2422 void PassVisitor< pass_type >::visit( TypeInstType * node ) { 1987 VISIT_BODY( node ); 1988 } 1989 2423 VISIT_START( node ); 2424 2425 maybeAccept_impl( node->forall , *this ); 2426 maybeAccept_impl( node->parameters, *this ); 2427 2428 VISIT_END( node ); 2429 } 2430 2431 template< typename pass_type > 2432 Type * PassVisitor< pass_type >::mutate( TypeInstType * node ) { 2433 MUTATE_START( node ); 2434 2435 maybeMutate_impl( node->forall , *this ); 2436 maybeMutate_impl( node->parameters, *this ); 2437 2438 MUTATE_END( Type, node ); 2439 } 2440 2441 //-------------------------------------------------------------------------- 2442 // TupleType 1990 2443 template< typename pass_type > 1991 2444 void PassVisitor< pass_type >::visit( TupleType * node ) { 1992 VISIT_BODY( node ); 1993 } 1994 2445 VISIT_START( node ); 2446 2447 maybeAccept_impl( node->forall, *this ); 2448 maybeAccept_impl( node->types, *this ); 2449 maybeAccept_impl( node->members, *this ); 2450 2451 VISIT_END( node ); 2452 } 2453 2454 template< typename pass_type > 2455 Type * PassVisitor< pass_type >::mutate( TupleType * node ) { 2456 MUTATE_START( node ); 2457 2458 maybeMutate_impl( node->forall, *this ); 2459 maybeMutate_impl( node->types, *this ); 2460 maybeMutate_impl( node->members, *this ); 2461 2462 MUTATE_END( Type, node ); 2463 } 2464 2465 //-------------------------------------------------------------------------- 2466 // TypeofType 1995 2467 template< typename pass_type > 1996 2468 void PassVisitor< pass_type >::visit( TypeofType * node ) { 1997 VISIT_BODY( node ); 1998 } 1999 2469 VISIT_START( node ); 2470 2471 assert( node->expr ); 2472 maybeAccept_impl( node->expr, *this ); 2473 2474 VISIT_END( node ); 2475 } 2476 2477 template< typename pass_type > 2478 Type * PassVisitor< pass_type >::mutate( TypeofType * node ) { 2479 MUTATE_START( node ); 2480 2481 assert( node->expr ); 2482 maybeMutate_impl( node->expr, *this ); 2483 2484 MUTATE_END( Type, node ); 2485 } 2486 2487 //-------------------------------------------------------------------------- 2488 // AttrType 2000 2489 template< typename pass_type > 2001 2490 void PassVisitor< pass_type >::visit( AttrType * node ) { 2002 VISIT_BODY( node ); 2003 } 2004 2491 VISIT_START( node ); 2492 2493 if ( node->isType ) { 2494 assert( node->type ); 2495 maybeAccept_impl( node->type, *this ); 2496 } else { 2497 assert( node->expr ); 2498 maybeAccept_impl( node->expr, *this ); 2499 } // if 2500 2501 VISIT_END( node ); 2502 } 2503 2504 template< typename pass_type > 2505 Type * PassVisitor< pass_type >::mutate( AttrType * node ) { 2506 MUTATE_START( node ); 2507 2508 if ( node->isType ) { 2509 assert( node->type ); 2510 maybeMutate_impl( node->type, *this ); 2511 } else { 2512 assert( node->expr ); 2513 maybeMutate_impl( node->expr, *this ); 2514 } // if 2515 2516 MUTATE_END( Type, node ); 2517 } 2518 2519 //-------------------------------------------------------------------------- 2520 // VarArgsType 2005 2521 template< typename pass_type > 2006 2522 void PassVisitor< pass_type >::visit( VarArgsType * node ) { 2007 VISIT_BODY( node ); 2008 } 2009 2523 VISIT_START( node ); 2524 2525 maybeAccept_impl( node->forall, *this ); 2526 2527 VISIT_END( node ); 2528 } 2529 2530 template< typename pass_type > 2531 Type * PassVisitor< pass_type >::mutate( VarArgsType * node ) { 2532 MUTATE_START( node ); 2533 2534 maybeMutate_impl( node->forall, *this ); 2535 2536 MUTATE_END( Type, node ); 2537 } 2538 2539 //-------------------------------------------------------------------------- 2540 // ZeroType 2010 2541 template< typename pass_type > 2011 2542 void PassVisitor< pass_type >::visit( ZeroType * node ) { 2012 VISIT_BODY( node ); 2013 } 2014 2543 VISIT_START( node ); 2544 2545 maybeAccept_impl( node->forall, *this ); 2546 2547 VISIT_END( node ); 2548 } 2549 2550 template< typename pass_type > 2551 Type * PassVisitor< pass_type >::mutate( ZeroType * node ) { 2552 MUTATE_START( node ); 2553 2554 maybeMutate_impl( node->forall, *this ); 2555 2556 MUTATE_END( Type, node ); 2557 } 2558 2559 //-------------------------------------------------------------------------- 2560 // OneType 2015 2561 template< typename pass_type > 2016 2562 void PassVisitor< pass_type >::visit( OneType * node ) { 2017 VISIT_BODY( node ); 2018 } 2019 2563 VISIT_START( node ); 2564 2565 maybeAccept_impl( node->forall, *this ); 2566 2567 VISIT_END( node ); 2568 } 2569 2570 template< typename pass_type > 2571 Type * PassVisitor< pass_type >::mutate( OneType * node ) { 2572 MUTATE_START( node ); 2573 2574 maybeMutate_impl( node->forall, *this ); 2575 2576 MUTATE_END( Type, node ); 2577 } 2578 2579 //-------------------------------------------------------------------------- 2580 // GlobalScopeType 2581 template< typename pass_type > 2582 void PassVisitor< pass_type >::visit( GlobalScopeType * node ) { 2583 VISIT_START( node ); 2584 2585 maybeAccept_impl( node->forall, *this ); 2586 2587 VISIT_END( node ); 2588 } 2589 2590 template< typename pass_type > 2591 Type * PassVisitor< pass_type >::mutate( GlobalScopeType * node ) { 2592 MUTATE_START( node ); 2593 2594 maybeMutate_impl( node->forall, *this ); 2595 2596 MUTATE_END( Type, node ); 2597 } 2598 2599 //-------------------------------------------------------------------------- 2600 // Designation 2020 2601 template< typename pass_type > 2021 2602 void PassVisitor< pass_type >::visit( Designation * node ) { 2022 2603 VISIT_START( node ); 2023 2604 2024 maybeAccept_impl( node-> get_designators(), *this );2605 maybeAccept_impl( node->designators, *this ); 2025 2606 2026 2607 VISIT_END( node ); … … 2031 2612 MUTATE_START( node ); 2032 2613 2033 maybeMutate_impl( node-> get_designators(), *this );2614 maybeMutate_impl( node->designators, *this ); 2034 2615 2035 2616 MUTATE_END( Designation, node ); … … 2042 2623 VISIT_START( node ); 2043 2624 2044 visitExpression( node-> get_value());2625 visitExpression( node->value ); 2045 2626 2046 2627 VISIT_END( node ); … … 2051 2632 MUTATE_START( node ); 2052 2633 2053 node-> set_value( mutateExpression( node->get_value() ));2634 node->value = mutateExpression( node->value ); 2054 2635 2055 2636 MUTATE_END( Initializer, node ); 2056 2637 } 2057 2638 2639 //-------------------------------------------------------------------------- 2640 // ListInit 2058 2641 template< typename pass_type > 2059 2642 void PassVisitor< pass_type >::visit( ListInit * node ) { 2060 VISIT_BODY( node ); 2061 } 2062 2643 VISIT_START( node ); 2644 2645 maybeAccept_impl( node->designations, *this ); 2646 maybeAccept_impl( node->initializers, *this ); 2647 2648 VISIT_END( node ); 2649 } 2650 2651 template< typename pass_type > 2652 Initializer * PassVisitor< pass_type >::mutate( ListInit * node ) { 2653 MUTATE_START( node ); 2654 2655 maybeMutate_impl( node->designations, *this ); 2656 maybeMutate_impl( node->initializers, *this ); 2657 2658 MUTATE_END( Initializer, node ); 2659 } 2660 2661 //-------------------------------------------------------------------------- 2662 // ConstructorInit 2063 2663 template< typename pass_type > 2064 2664 void PassVisitor< pass_type >::visit( ConstructorInit * node ) { 2065 VISIT_BODY( node ); 2066 } 2067 2665 VISIT_START( node ); 2666 2667 maybeAccept_impl( node->ctor, *this ); 2668 maybeAccept_impl( node->dtor, *this ); 2669 maybeAccept_impl( node->init, *this ); 2670 2671 VISIT_END( node ); 2672 } 2673 2674 template< typename pass_type > 2675 Initializer * PassVisitor< pass_type >::mutate( ConstructorInit * node ) { 2676 MUTATE_START( node ); 2677 2678 maybeMutate_impl( node->ctor, *this ); 2679 maybeMutate_impl( node->dtor, *this ); 2680 maybeMutate_impl( node->init, *this ); 2681 2682 MUTATE_END( Initializer, node ); 2683 } 2684 2685 //-------------------------------------------------------------------------- 2686 // Subrange 2068 2687 template< typename pass_type > 2069 2688 void PassVisitor< pass_type >::visit( Subrange * node ) { 2070 VISIT_BODY( node ); 2071 } 2072 2689 VISIT_START( node ); 2690 2691 VISIT_END( node ); 2692 } 2693 2694 template< typename pass_type > 2695 Subrange * PassVisitor< pass_type >::mutate( Subrange * node ) { 2696 MUTATE_START( node ); 2697 2698 MUTATE_END( Subrange, node ); 2699 } 2700 2701 //-------------------------------------------------------------------------- 2702 // Attribute 2073 2703 template< typename pass_type > 2074 2704 void PassVisitor< pass_type >::visit( Constant * node ) { 2075 VISIT_BODY( node ); 2076 } 2077 2705 VISIT_START( node ); 2706 2707 VISIT_END( node ); 2708 } 2709 2710 template< typename pass_type > 2711 Constant * PassVisitor< pass_type >::mutate( Constant * node ) { 2712 MUTATE_START( node ); 2713 2714 MUTATE_END( Constant, node ); 2715 } 2716 2717 //-------------------------------------------------------------------------- 2718 // Attribute 2078 2719 template< typename pass_type > 2079 2720 void PassVisitor< pass_type >::visit( Attribute * node ) { 2080 VISIT_BODY( node ); 2081 } 2082 2083 //--------------------------------------------------------------------------------------------------------------- 2084 template< typename pass_type > 2085 Type * PassVisitor< pass_type >::mutate( VoidType * node ) { 2086 MUTATE_BODY( Type, node ); 2087 } 2088 2089 template< typename pass_type > 2090 Type * PassVisitor< pass_type >::mutate( BasicType * node ) { 2091 MUTATE_BODY( Type, node ); 2092 } 2093 2094 template< typename pass_type > 2095 Type * PassVisitor< pass_type >::mutate( PointerType * node ) { 2096 MUTATE_BODY( Type, node ); 2097 } 2098 2099 template< typename pass_type > 2100 Type * PassVisitor< pass_type >::mutate( ArrayType * node ) { 2101 MUTATE_BODY( Type, node ); 2102 } 2103 2104 template< typename pass_type > 2105 Type * PassVisitor< pass_type >::mutate( ReferenceType * node ) { 2106 MUTATE_BODY( Type, node ); 2107 } 2108 2109 template< typename pass_type > 2110 Type * PassVisitor< pass_type >::mutate( FunctionType * node ) { 2111 MUTATE_BODY( Type, node ); 2112 } 2113 2114 template< typename pass_type > 2115 Type * PassVisitor< pass_type >::mutate( TypeInstType * node ) { 2116 MUTATE_BODY( Type, node ); 2117 } 2118 2119 template< typename pass_type > 2120 Type * PassVisitor< pass_type >::mutate( TupleType * node ) { 2121 MUTATE_BODY( Type, node ); 2122 } 2123 2124 template< typename pass_type > 2125 Type * PassVisitor< pass_type >::mutate( TypeofType * node ) { 2126 MUTATE_BODY( Type, node ); 2127 } 2128 2129 template< typename pass_type > 2130 Type * PassVisitor< pass_type >::mutate( AttrType * node ) { 2131 MUTATE_BODY( Type, node ); 2132 } 2133 2134 template< typename pass_type > 2135 Type * PassVisitor< pass_type >::mutate( VarArgsType * node ) { 2136 MUTATE_BODY( Type, node ); 2137 } 2138 2139 template< typename pass_type > 2140 Type * PassVisitor< pass_type >::mutate( ZeroType * node ) { 2141 MUTATE_BODY( Type, node ); 2142 } 2143 2144 template< typename pass_type > 2145 Type * PassVisitor< pass_type >::mutate( OneType * node ) { 2146 MUTATE_BODY( Type, node ); 2147 } 2148 2149 template< typename pass_type > 2150 Initializer * PassVisitor< pass_type >::mutate( ListInit * node ) { 2151 MUTATE_BODY( Initializer, node ); 2152 } 2153 2154 template< typename pass_type > 2155 Initializer * PassVisitor< pass_type >::mutate( ConstructorInit * node ) { 2156 MUTATE_BODY( Initializer, node ); 2157 } 2158 2159 template< typename pass_type > 2160 Subrange * PassVisitor< pass_type >::mutate( Subrange * node ) { 2161 MUTATE_BODY( Subrange, node ); 2162 } 2163 2164 template< typename pass_type > 2165 Constant * PassVisitor< pass_type >::mutate( Constant * node ) { 2166 MUTATE_BODY( Constant, node ); 2721 VISIT_START( node ); 2722 2723 maybeAccept_impl( node->parameters, *this ); 2724 2725 VISIT_END( node ); 2167 2726 } 2168 2727 2169 2728 template< typename pass_type > 2170 2729 Attribute * PassVisitor< pass_type >::mutate( Attribute * node ) { 2171 MUTATE_BODY( Attribute, node ); 2172 } 2173 2730 MUTATE_START( node ); 2731 2732 maybeMutate_impl( node->parameters, *this ); 2733 2734 MUTATE_END( Attribute, node ); 2735 } 2736 2737 //-------------------------------------------------------------------------- 2738 // TypeSubstitution 2174 2739 template< typename pass_type > 2175 2740 TypeSubstitution * PassVisitor< pass_type >::mutate( TypeSubstitution * node ) { -
src/Common/PassVisitor.proto.h
rf9feab8 r90152a4 47 47 48 48 operator bool() { return m_ref ? *m_ref : true; } 49 bool operator=( bool val ) { return *m_ref = val; }49 bool operator=( bool val ) { assert(m_ref); return *m_ref = val; } 50 50 51 51 private: … … 53 53 friend class ChildrenGuard; 54 54 55 bool * set( bool &val ) {55 bool * set( bool * val ) { 56 56 bool * prev = m_ref; 57 m_ref = &val;57 m_ref = val; 58 58 return prev; 59 59 } … … 67 67 ChildrenGuard( bool_ref * ref ) 68 68 : m_val ( true ) 69 , m_prev( ref ? ref->set( m_val ) : nullptr )69 , m_prev( ref ? ref->set( &m_val ) : nullptr ) 70 70 , m_ref ( ref ) 71 71 {} … … 73 73 ~ChildrenGuard() { 74 74 if( m_ref ) { 75 m_ref->set( *m_prev );75 m_ref->set( m_prev ); 76 76 } 77 77 } … … 193 193 194 194 195 #define INDEXER_FUNC ( func, type ) \195 #define INDEXER_FUNC1( func, type ) \ 196 196 template<typename pass_type> \ 197 197 static inline auto indexer_impl_##func ( pass_type & pass, int, type arg ) -> decltype( pass.indexer.func( arg ), void() ) { \ … … 202 202 static inline void indexer_impl_##func ( pass_type &, long, type ) { } \ 203 203 204 INDEXER_FUNC( addId , DeclarationWithType * ); 205 INDEXER_FUNC( addType , NamedTypeDecl * ); 206 INDEXER_FUNC( addStruct , StructDecl * ); 207 INDEXER_FUNC( addEnum , EnumDecl * ); 208 INDEXER_FUNC( addUnion , UnionDecl * ); 209 INDEXER_FUNC( addTrait , TraitDecl * ); 210 INDEXER_FUNC( addWith , WithStmt * ); 204 #define INDEXER_FUNC2( func, type1, type2 ) \ 205 template<typename pass_type> \ 206 static inline auto indexer_impl_##func ( pass_type & pass, int, type1 arg1, type2 arg2 ) -> decltype( pass.indexer.func( arg1, arg2 ), void() ) { \ 207 pass.indexer.func( arg1, arg2 ); \ 208 } \ 209 \ 210 template<typename pass_type> \ 211 static inline void indexer_impl_##func ( pass_type &, long, type1, type2 ) { } 212 213 214 INDEXER_FUNC1( addId , DeclarationWithType * ); 215 INDEXER_FUNC1( addType , NamedTypeDecl * ); 216 INDEXER_FUNC1( addStruct , StructDecl * ); 217 INDEXER_FUNC1( addEnum , EnumDecl * ); 218 INDEXER_FUNC1( addUnion , UnionDecl * ); 219 INDEXER_FUNC1( addTrait , TraitDecl * ); 220 INDEXER_FUNC2( addWith , std::list< Expression * > &, BaseSyntaxNode * ); 211 221 212 222 -
src/Common/ScopedMap.h
rf9feab8 r90152a4 10 10 // Created On : Wed Dec 2 11:37:00 2015 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Fri Jul 21 22:18:24 201713 // Update Count : 212 // Last Modified On : Mon May 21 15:22:40 2018 13 // Update Count : 3 14 14 // 15 15 … … 22 22 #include <vector> 23 23 24 /// Default (empty) ScopedMap note type 25 struct EmptyNote {}; 26 24 27 /// A map where the items are placed into nested scopes; 25 /// inserted items are placed into the innermost scope, lookup looks from the innermost scope outward 26 template<typename Key, typename Value> 28 /// inserted items are placed into the innermost scope, lookup looks from the innermost scope outward. 29 /// Scopes may be annotated with a value; the annotation defaults to empty 30 template<typename Key, typename Value, typename Note = EmptyNote> 27 31 class ScopedMap { 28 typedef std::map< Key, Value > Scope; 32 typedef std::map< Key, Value > MapType; 33 struct Scope { 34 MapType map; 35 Note note; 36 37 template<typename N> 38 Scope(N&& n) : map(), note(std::forward<N>(n)) {} 39 40 Scope() = default; 41 Scope(const Scope&) = default; 42 Scope(Scope&&) = default; 43 Scope& operator= (const Scope&) = default; 44 Scope& operator= (Scope&&) = default; 45 }; 29 46 typedef std::vector< Scope > ScopeList; 30 47 31 48 ScopeList scopes; ///< scoped list of maps 32 49 public: 33 typedef typename Scope::key_type key_type;34 typedef typename Scope::mapped_type mapped_type;35 typedef typename Scope::value_type value_type;50 typedef typename MapType::key_type key_type; 51 typedef typename MapType::mapped_type mapped_type; 52 typedef typename MapType::value_type value_type; 36 53 typedef typename ScopeList::size_type size_type; 37 54 typedef typename ScopeList::difference_type difference_type; 38 typedef typename Scope::reference reference;39 typedef typename Scope::const_reference const_reference;40 typedef typename Scope::pointer pointer;41 typedef typename Scope::const_pointer const_pointer;55 typedef typename MapType::reference reference; 56 typedef typename MapType::const_reference const_reference; 57 typedef typename MapType::pointer pointer; 58 typedef typename MapType::const_pointer const_pointer; 42 59 43 60 class iterator : public std::iterator< std::bidirectional_iterator_tag, … … 45 62 friend class ScopedMap; 46 63 friend class const_iterator; 47 typedef typename std::map< Key, Value >::iterator wrapped_iterator;48 typedef typename std::vector< std::map< Key, Value > >scope_list;64 typedef typename ScopedMap::MapType::iterator wrapped_iterator; 65 typedef typename ScopedMap::ScopeList scope_list; 49 66 typedef typename scope_list::size_type size_type; 50 67 51 68 /// Checks if this iterator points to a valid item 52 69 bool is_valid() const { 53 return it != (*scopes)[level]. end();70 return it != (*scopes)[level].map.end(); 54 71 } 55 72 … … 79 96 80 97 iterator& operator++ () { 81 if ( it == (*scopes)[level]. end() ) {98 if ( it == (*scopes)[level].map.end() ) { 82 99 if ( level == 0 ) return *this; 83 100 --level; 84 it = (*scopes)[level]. begin();101 it = (*scopes)[level].map.begin(); 85 102 } else { 86 103 ++it; … … 92 109 iterator& operator-- () { 93 110 // may fail if this is the begin iterator; allowed by STL spec 94 if ( it == (*scopes)[level]. begin() ) {111 if ( it == (*scopes)[level].map.begin() ) { 95 112 ++level; 96 it = (*scopes)[level]. end();113 it = (*scopes)[level].map.end(); 97 114 } 98 115 --it; … … 107 124 108 125 size_type get_level() const { return level; } 126 127 Note& get_note() { return (*scopes)[level].note; } 128 const Note& get_note() const { return (*scopes)[level].note; } 109 129 110 130 private: … … 117 137 value_type > { 118 138 friend class ScopedMap; 119 typedef typename std::map< Key, Value >::iterator wrapped_iterator;120 typedef typename std::map< Key, Value >::const_iterator wrapped_const_iterator;121 typedef typename std::vector< std::map< Key, Value > >scope_list;139 typedef typename ScopedMap::MapType::iterator wrapped_iterator; 140 typedef typename ScopedMap::MapType::const_iterator wrapped_const_iterator; 141 typedef typename ScopedMap::ScopeList scope_list; 122 142 typedef typename scope_list::size_type size_type; 123 143 124 144 /// Checks if this iterator points to a valid item 125 145 bool is_valid() const { 126 return it != (*scopes)[level]. end();146 return it != (*scopes)[level].map.end(); 127 147 } 128 148 … … 157 177 158 178 const_iterator& operator++ () { 159 if ( it == (*scopes)[level]. end() ) {179 if ( it == (*scopes)[level].map.end() ) { 160 180 if ( level == 0 ) return *this; 161 181 --level; 162 it = (*scopes)[level]. begin();182 it = (*scopes)[level].map.begin(); 163 183 } else { 164 184 ++it; … … 170 190 const_iterator& operator-- () { 171 191 // may fail if this is the begin iterator; allowed by STL spec 172 if ( it == (*scopes)[level]. begin() ) {192 if ( it == (*scopes)[level].map.begin() ) { 173 193 ++level; 174 it = (*scopes)[level]. end();194 it = (*scopes)[level].map.end(); 175 195 } 176 196 --it; … … 185 205 186 206 size_type get_level() const { return level; } 207 208 const Note& get_note() const { return (*scopes)[level].note; } 187 209 188 210 private: … … 197 219 } 198 220 221 // Starts a new scope with the given note 222 template<typename N> 223 void beginScope( N&& n ) { 224 scopes.emplace_back( std::forward<N>(n) ); 225 } 226 199 227 /// Ends a scope; invalidates any iterators pointing to elements of that scope 200 228 void endScope() { … … 204 232 205 233 /// Default constructor initializes with one scope 206 ScopedMap() { beginScope(); } 207 208 iterator begin() { return iterator(scopes, scopes.back().begin(), currentScope()).next_valid(); } 209 const_iterator begin() const { return const_iterator(scopes, scopes.back().begin(), currentScope()).next_valid(); } 210 const_iterator cbegin() const { return const_iterator(scopes, scopes.back().begin(), currentScope()).next_valid(); } 211 iterator end() { return iterator(scopes, scopes[0].end(), 0); } 212 const_iterator end() const { return const_iterator(scopes, scopes[0].end(), 0); } 213 const_iterator cend() const { return const_iterator(scopes, scopes[0].end(), 0); } 234 ScopedMap() : scopes() { beginScope(); } 235 236 /// Constructs with a given note on the outermost scope 237 template<typename N> 238 ScopedMap( N&& n ) : scopes() { beginScope(std::forward<N>(n)); } 239 240 iterator begin() { return iterator(scopes, scopes.back().map.begin(), currentScope()).next_valid(); } 241 const_iterator begin() const { return const_iterator(scopes, scopes.back().map.begin(), currentScope()).next_valid(); } 242 const_iterator cbegin() const { return const_iterator(scopes, scopes.back().map.begin(), currentScope()).next_valid(); } 243 iterator end() { return iterator(scopes, scopes[0].map.end(), 0); } 244 const_iterator end() const { return const_iterator(scopes, scopes[0].map.end(), 0); } 245 const_iterator cend() const { return const_iterator(scopes, scopes[0].map.end(), 0); } 214 246 215 247 /// Gets the index of the current scope (counted from 1) 216 248 size_type currentScope() const { return scopes.size() - 1; } 249 250 /// Gets the note at the given scope 251 Note& getNote( size_type i ) { return scopes[i].note; } 252 const Note& getNote( size_type i ) const { return scopes[i].note; } 217 253 218 254 /// Finds the given key in the outermost scope it occurs; returns end() for none such 219 255 iterator find( const Key &key ) { 220 256 for ( size_type i = scopes.size() - 1; ; --i ) { 221 typename Scope::iterator val = scopes[i].find( key );222 if ( val != scopes[i]. end() ) return iterator( scopes, val, i );257 typename MapType::iterator val = scopes[i].map.find( key ); 258 if ( val != scopes[i].map.end() ) return iterator( scopes, val, i ); 223 259 if ( i == 0 ) break; 224 260 } … … 226 262 } 227 263 const_iterator find( const Key &key ) const { 228 return const_iterator( const_cast< ScopedMap< Key, Value >* >(this)->find( key ) );264 return const_iterator( const_cast< ScopedMap< Key, Value, Note >* >(this)->find( key ) ); 229 265 } 230 266 231 267 /// Finds the given key in the provided scope; returns end() for none such 232 268 iterator findAt( size_type scope, const Key& key ) { 233 typename Scope::iterator val = scopes[scope].find( key );234 if ( val != scopes[scope]. end() ) return iterator( scopes, val, scope );269 typename MapType::iterator val = scopes[scope].map.find( key ); 270 if ( val != scopes[scope].map.end() ) return iterator( scopes, val, scope ); 235 271 return end(); 236 272 } 237 273 const_iterator findAt( size_type scope, const Key& key ) const { 238 return const_iterator( const_cast< ScopedMap< Key, Value >* >(this)->findAt( scope, key ) );274 return const_iterator( const_cast< ScopedMap< Key, Value, Note >* >(this)->findAt( scope, key ) ); 239 275 } 240 276 … … 243 279 if ( it.level == 0 ) return end(); 244 280 for ( size_type i = it.level - 1; ; --i ) { 245 typename Scope::iterator val = scopes[i].find( key );246 if ( val != scopes[i]. end() ) return iterator( scopes, val, i );281 typename MapType::iterator val = scopes[i].map.find( key ); 282 if ( val != scopes[i].map.end() ) return iterator( scopes, val, i ); 247 283 if ( i == 0 ) break; 248 284 } … … 250 286 } 251 287 const_iterator findNext( const_iterator &it, const Key &key ) const { 252 return const_iterator( const_cast< ScopedMap< Key, Value >* >(this)->findNext( it, key ) );288 return const_iterator( const_cast< ScopedMap< Key, Value, Note >* >(this)->findNext( it, key ) ); 253 289 } 254 290 … … 256 292 template< typename value_type_t > 257 293 std::pair< iterator, bool > insert( value_type_t&& value ) { 258 std::pair< typename Scope::iterator, bool > res = scopes.back().insert( std::forward<value_type_t>( value ) );294 std::pair< typename MapType::iterator, bool > res = scopes.back().map.insert( std::forward<value_type_t>( value ) ); 259 295 return std::make_pair( iterator(scopes, std::move( res.first ), scopes.size()-1), std::move( res.second ) ); 260 296 } … … 262 298 template< typename value_type_t > 263 299 std::pair< iterator, bool > insert( iterator at, value_type_t&& value ) { 264 Scope& scope = (*at.scopes) [ at.level ];265 std::pair< typename Scope::iterator, bool > res = scope.insert( std::forward<value_type_t>( value ) );300 MapType& scope = (*at.scopes)[ at.level ].map; 301 std::pair< typename MapType::iterator, bool > res = scope.insert( std::forward<value_type_t>( value ) ); 266 302 return std::make_pair( iterator(scopes, std::move( res.first ), at.level), std::move( res.second ) ); 267 303 } … … 272 308 template< typename value_type_t > 273 309 std::pair< iterator, bool > insertAt( size_type scope, value_type_t&& value ) { 274 std::pair< typename Scope::iterator, bool > res = scopes.at(scope).insert( std::forward<value_type_t>( value ) );310 std::pair< typename MapType::iterator, bool > res = scopes.at(scope).map.insert( std::forward<value_type_t>( value ) ); 275 311 return std::make_pair( iterator(scopes, std::move( res.first ), scope), std::move( res.second ) ); 312 } 313 314 template< typename value_t > 315 std::pair< iterator, bool > insertAt( size_type scope, const Key& key, value_t&& value ) { 316 return insertAt( scope, std::make_pair( key, std::forward<value_t>( value ) ) ); 276 317 } 277 318 … … 283 324 284 325 iterator erase( iterator pos ) { 285 Scope& scope = (*pos.scopes) [ pos.level ];326 MapType& scope = (*pos.scopes)[ pos.level ].map; 286 327 const typename iterator::wrapped_iterator& new_it = scope.erase( pos.it ); 287 328 iterator it( *pos.scopes, new_it, pos.level ); -
src/Common/SemanticError.cc
rf9feab8 r90152a4 7 7 // SemanticError.cc -- 8 8 // 9 // Author : Richard C. Bilson9 // Author : Thierry Delisle 10 10 // Created On : Mon May 18 07:44:20 2015 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : T ue Aug 29 18:17:35 201713 // Update Count : 312 // Last Modified On : Thu Jun 7 08:05:26 2018 13 // Update Count : 10 14 14 // 15 15 16 #include <cstdarg> 16 17 #include <cstdio> // for fileno, stderr 18 #include <cstring> 17 19 #include <unistd.h> // for isatty 18 20 #include <iostream> // for basic_ostream, operator<<, ostream 19 21 #include <list> // for list, _List_iterator 20 22 #include <string> // for string, operator<<, operator+, to_string 23 #include <vector> 21 24 22 25 #include "Common/utility.h" // for to_string, CodeLocation (ptr only) 23 26 #include "SemanticError.h" 24 27 25 SemanticError::SemanticError() { 28 //----------------------------------------------------------------------------- 29 // Severity Handling 30 std::vector<Severity> & get_severities() { 31 static std::vector<Severity> severities; 32 if(severities.empty()) { 33 severities.reserve((size_t)Warning::NUMBER_OF_WARNINGS); 34 for ( const auto w : WarningFormats ) { 35 severities.push_back( w.default_severity ); 36 } // for 37 } 38 return severities; 26 39 } 27 40 28 SemanticError::SemanticError( std::string error ) { 29 append( error ); 41 void SemanticWarning_SuppressAll() { 42 for( auto & s : get_severities() ) { 43 s = Severity::Suppress; 44 } 30 45 } 31 46 32 void SemanticError::append( SemanticError &other ) { 47 void SemanticWarning_EnableAll() { 48 for( auto & s : get_severities() ) { 49 s = Severity::Warn; 50 } 51 } 52 53 void SemanticWarning_WarningAsError() { 54 for( auto & s : get_severities() ) { 55 if(s == Severity::Warn) s = Severity::Error; 56 } 57 } 58 59 void SemanticWarning_Set(const char * const name, Severity s) { 60 size_t idx = 0; 61 for ( const auto & w : WarningFormats ) { 62 if ( std::strcmp( name, w.name ) == 0 ) { 63 get_severities()[idx] = s; 64 break; 65 } 66 idx++; 67 } 68 } 69 70 //----------------------------------------------------------------------------- 71 // Semantic Error 72 bool SemanticErrorThrow = false; 73 74 SemanticErrorException::SemanticErrorException( CodeLocation location, std::string error ) { 75 append( location, error ); 76 } 77 78 void SemanticErrorException::append( SemanticErrorException &other ) { 33 79 errors.splice( errors.end(), other.errors ); 34 80 } 35 81 36 void SemanticError ::append(const std::string & msg ) {37 errors.emplace_back( error_str() +msg );82 void SemanticErrorException::append( CodeLocation location, const std::string & msg ) { 83 errors.emplace_back( location, msg ); 38 84 } 39 85 40 bool SemanticError ::isEmpty() const {86 bool SemanticErrorException::isEmpty() const { 41 87 return errors.empty(); 42 88 } 43 89 44 void SemanticError ::print( std::ostream &os) {90 void SemanticErrorException::print() { 45 91 using std::to_string; 46 92 for( auto err : errors ) { 47 os << err.location<< err.description << std::endl;93 std::cerr << ErrorHelpers::bold() << err.location << ErrorHelpers::error_str() << ErrorHelpers::reset_font() << err.description << std::endl; 48 94 } 49 95 } 50 96 51 void SemanticError::set_location( const CodeLocation& location ) { 52 errors.begin()->maybeSet( location ); 97 void SemanticError( CodeLocation location, std::string error ) { 98 SemanticErrorThrow = true; 99 throw SemanticErrorException( location, error ); 100 } 101 102 namespace { 103 // convert format string and arguments into a single string 104 std::string fmtToString(const char * fmt, va_list ap) { 105 int size = 128; 106 while ( true ) { 107 char buf[size]; 108 va_list args; 109 va_copy( args, ap ); 110 int n = vsnprintf(&buf[0], size, fmt, args); 111 va_end( args ); 112 if ( n < size && n >= 0 ) return buf; 113 size *= 2; 114 } 115 assert( false ); 116 } 117 } 118 119 void SemanticWarningImpl( CodeLocation location, Warning warning, const char * const fmt, ... ) { 120 Severity severity = get_severities()[(int)warning]; 121 switch(severity) { 122 case Severity::Suppress : 123 break; 124 case Severity::Warn : 125 { 126 va_list args; 127 va_start(args, fmt); 128 std::string msg = fmtToString( fmt, args ); 129 va_end(args); 130 std::cerr << ErrorHelpers::bold() << location << ErrorHelpers::warning_str() << ErrorHelpers::reset_font() << msg << std::endl; 131 } 132 break; 133 case Severity::Error : 134 { 135 va_list args; 136 va_start(args, fmt); 137 std::string msg = fmtToString( fmt, args ); 138 va_end(args); 139 SemanticError(location, msg); 140 } 141 break; 142 case Severity::Critical : 143 assertf(false, "Critical errors not implemented yet"); 144 break; 145 } 146 } 147 148 //----------------------------------------------------------------------------- 149 // Helpers 150 namespace ErrorHelpers { 151 const std::string & error_str() { 152 static std::string str = isatty( STDERR_FILENO ) ? "\e[31merror:\e[39m " : "error: "; 153 return str; 154 } 155 156 const std::string & warning_str() { 157 static std::string str = isatty( STDERR_FILENO ) ? "\e[95mwarning:\e[39m " : "warning: "; 158 return str; 159 } 160 161 const std::string & bold_ttycode() { 162 static std::string str = isatty( STDERR_FILENO ) ? "\e[1m" : ""; 163 return str; 164 } 165 166 const std::string & reset_font_ttycode() { 167 static std::string str = isatty( STDERR_FILENO ) ? "\e[0m" : ""; 168 return str; 169 } 170 171 std::string make_bold( const std::string & str ) { 172 return bold_ttycode() + str + reset_font_ttycode(); 173 } 174 175 std::ostream & operator<<(std::ostream & os, bold) { 176 os << bold_ttycode(); 177 return os; 178 } 179 180 std::ostream & operator<<(std::ostream & os, reset_font) { 181 os << reset_font_ttycode(); 182 return os; 183 } 53 184 } 54 185 -
src/Common/SemanticError.h
rf9feab8 r90152a4 7 7 // SemanticError.h -- 8 8 // 9 // Author : Richard C. Bilson9 // Author : Thierry Delisle 10 10 // Created On : Mon May 18 07:44:20 2015 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : T ue Aug 29 22:03:36 201713 // Update Count : 1712 // Last Modified On : Thu Jul 19 10:09:17 2018 13 // Update Count : 31 14 14 // 15 15 16 16 #pragma once 17 17 18 #include <exception> // for exception 19 #include <iostream> // for ostream 20 #include <list> // for list 21 #include <string> // for string 22 #include <unistd.h> // for isatty 18 #include "ErrorObjects.h" 19 #include <cstring> 23 20 24 #include "CodeLocation.h" // for CodeLocation, toString 21 //----------------------------------------------------------------------------- 22 // Errors 25 23 26 struct error { 27 std::string description; 28 CodeLocation location; 24 extern bool SemanticErrorThrow; 29 25 30 error() = default; 31 error( const std::string & str ) : description( str ) {} 26 __attribute__((noreturn)) void SemanticError( CodeLocation location, std::string error ); 32 27 33 void maybeSet( const CodeLocation & location ) { 34 if( this->location.isUnset() ) { 35 this->location = location; 36 } 37 } 28 template< typename T > 29 __attribute__((noreturn)) static inline void SemanticError( const T * obj, const std::string & error ) { 30 SemanticError( obj->location, toString( error, obj ) ); 31 } 32 33 template< typename T > 34 __attribute__((noreturn)) static inline void SemanticError( CodeLocation location, const T * obj, const std::string & error ) { 35 SemanticError( location, toString( error, obj ) ); 36 } 37 38 //----------------------------------------------------------------------------- 39 // Warnings 40 41 enum class Severity { 42 Suppress, 43 Warn, 44 Error, 45 Critical 38 46 }; 39 47 40 class SemanticError : public std::exception { 41 public: 42 SemanticError(); 43 SemanticError( std::string error ); 44 template< typename T > SemanticError( const std::string & error, const T * obj ); 45 ~SemanticError() throw() {} 46 47 static inline const std::string & error_str() { 48 static std::string str = isatty( STDERR_FILENO ) ? "\e[31merror:\e[39m " : "error: "; 49 return str; 50 } 51 52 void append( SemanticError & other ); 53 void append( const std::string & ); 54 bool isEmpty() const; 55 void print( std::ostream & os ); 56 57 void set_location( const CodeLocation & location ); 58 // constructs an exception using the given message and the printed representation of the obj (T must have a print 59 // method) 60 private: 61 std::list< error > errors; 48 struct WarningData { 49 const char * const name; 50 const char * const message; 51 const Severity default_severity; 62 52 }; 63 53 64 template< typename T > 65 SemanticError::SemanticError( const std::string & error, const T * obj ) { 66 append( toString( error, obj ) ); 54 constexpr WarningData WarningFormats[] = { 55 {"self-assign" , "self assignment of expression: %s" , Severity::Warn}, 56 {"reference-conversion" , "rvalue to reference conversion of rvalue: %s" , Severity::Warn}, 57 {"qualifiers-zero_t-one_t", "questionable use of type qualifier %s with %s", Severity::Warn}, 58 {"aggregate-forward-decl" , "forward declaration of nested aggregate: %s" , Severity::Warn}, 59 {"superfluous-decl" , "declaration does not allocate storage: %s" , Severity::Warn}, 60 {"gcc-attributes" , "invalid attribute: %s" , Severity::Warn}, 61 }; 62 63 enum class Warning { 64 SelfAssignment, 65 RvalueToReferenceConversion, 66 BadQualifiersZeroOne, 67 AggrForwardDecl, 68 SuperfluousDecl, 69 GccAttributes, 70 NUMBER_OF_WARNINGS, // This MUST be the last warning 71 }; 72 73 static_assert( 74 (sizeof(WarningFormats) / sizeof(WarningFormats[0])) == ((unsigned long)Warning::NUMBER_OF_WARNINGS), 75 "Each warning format should have a corresponding warning enum value" 76 ); 77 78 #define SemanticWarning(loc, id, ...) SemanticWarningImpl(loc, id, WarningFormats[(int)id].message, __VA_ARGS__) 79 80 void SemanticWarningImpl (CodeLocation loc, Warning warn, const char * const fmt, ...) __attribute__((format(printf, 3, 4))); 81 82 void SemanticWarning_SuppressAll (); 83 void SemanticWarning_EnableAll (); 84 void SemanticWarning_WarningAsError(); 85 void SemanticWarning_Set (const char * const name, Severity s); 86 87 // SKULLDUGGERY: cfa.cc is built before SemanticError.cc but needs this routine. 88 static inline bool SemanticWarning_Exist(const char * const name) { 89 for ( const auto & w : WarningFormats ) { 90 if ( std::strcmp( name, w.name ) == 0 ) return true; 91 } 92 return false; 93 } 94 95 //----------------------------------------------------------------------------- 96 // Helpers 97 namespace ErrorHelpers { 98 const std::string & error_str(); 99 const std::string & warning_str(); 100 const std::string & bold_ttycode(); 101 const std::string & reset_font_ttycode(); 102 103 std::string make_bold( const std::string & str ); 104 105 struct bold {}; 106 std::ostream & operator<<(std::ostream & os, bold); 107 108 struct reset_font {}; 109 std::ostream & operator<<(std::ostream & os, reset_font); 67 110 } 68 111 -
src/Common/module.mk
rf9feab8 r90152a4 6 6 ## file "LICENCE" distributed with Cforall. 7 7 ## 8 ## module.mk -- 8 ## module.mk -- 9 9 ## 10 10 ## Author : Richard C. Bilson … … 18 18 Common/UniqueName.cc \ 19 19 Common/DebugMalloc.cc \ 20 Common/Assert.cc 20 Common/Assert.cc \ 21 Common/Heap.cc \ 22 Common/Eval.cc -
src/Common/utility.h
rf9feab8 r90152a4 9 9 // Author : Richard C. Bilson 10 10 // Created On : Mon May 18 07:44:20 2015 11 // Last Modified By : Andrew Beach12 // Last Modified On : Thr Aug 17 11:38:00 201713 // Update Count : 3411 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Sun May 6 22:24:16 2018 13 // Update Count : 40 14 14 // 15 15 … … 31 31 #include "Common/Indenter.h" 32 32 33 class Expression; 34 33 35 template< typename T > 34 36 static inline T * maybeClone( const T *orig ) { … … 98 100 } 99 101 102 template< typename SrcContainer, typename DestContainer, typename Predicate > 103 void cloneAll_if( const SrcContainer &src, DestContainer &dest, Predicate pred ) { 104 std::back_insert_iterator< DestContainer > out( dest ); 105 for ( auto x : src ) { 106 if ( pred(x) ) { 107 *out++ = x->clone(); 108 } 109 } // while 110 } 111 100 112 template< typename Container > 101 113 void assertAll( const Container &container ) { … … 151 163 return os.str(); 152 164 } 165 166 #define toCString( ... ) toString( __VA_ARGS__ ).c_str() 153 167 154 168 // replace element of list with all elements of another list … … 424 438 } 425 439 426 440 // ----------------------------------------------------------------------------- 441 // O(1) polymorphic integer ilog2, using clz, which returns the number of leading 0-bits, starting at the most 442 // significant bit (single instruction on x86) 443 444 template<typename T> 445 inline 446 #if defined(__GNUC__) && __GNUC__ > 4 447 constexpr 448 #endif 449 T ilog2(const T & t) { 450 if(std::is_integral<T>::value) { 451 const constexpr int r = sizeof(t) * __CHAR_BIT__ - 1; 452 if( sizeof(T) == sizeof(unsigned int) ) return r - __builtin_clz ( t ); 453 if( sizeof(T) == sizeof(unsigned long) ) return r - __builtin_clzl ( t ); 454 if( sizeof(T) == sizeof(unsigned long long) ) return r - __builtin_clzll( t ); 455 } 456 assert(false); 457 return -1; 458 } // ilog2 459 460 // ----------------------------------------------------------------------------- 461 /// evaluates expr as a long long int. If second is false, expr could not be evaluated 462 std::pair<long long int, bool> eval(Expression * expr); 427 463 428 464 // Local Variables: // -
src/Concurrency/Keywords.cc
rf9feab8 r90152a4 25 25 #include "InitTweak/InitTweak.h" // for getPointerBase 26 26 #include "Parser/LinkageSpec.h" // for Cforall 27 #include "SymTab/AddVisit.h" // for acceptAndAdd28 27 #include "SynTree/Constant.h" // for Constant 29 28 #include "SynTree/Declaration.h" // for StructDecl, FunctionDecl, ObjectDecl … … 54 53 public: 55 54 56 ConcurrentSueKeyword( std::string&& type_name, std::string&& field_name, std::string&& getter_name, std::string&& context_error, bool needs_main ) :57 type_name( type_name ), field_name( field_name ), getter_name( getter_name ), context_error( context_error ), needs_main( needs_main ) {}55 ConcurrentSueKeyword( std::string&& type_name, std::string&& field_name, std::string&& getter_name, std::string&& context_error, bool needs_main, KeywordCastExpr::Target cast_target ) : 56 type_name( type_name ), field_name( field_name ), getter_name( getter_name ), context_error( context_error ), needs_main( needs_main ), cast_target( cast_target ) {} 58 57 59 58 virtual ~ConcurrentSueKeyword() {} 60 59 61 void postvisit( StructDecl * decl );60 Declaration * postmutate( StructDecl * decl ); 62 61 63 62 void handle( StructDecl * ); … … 67 66 68 67 virtual bool is_target( StructDecl * decl ) = 0; 68 69 Expression * postmutate( KeywordCastExpr * cast ); 69 70 70 71 private: … … 74 75 const std::string context_error; 75 76 bool needs_main; 77 KeywordCastExpr::Target cast_target; 76 78 77 79 StructDecl* type_decl = nullptr; … … 95 97 "__thrd", 96 98 "get_thread", 97 "thread keyword requires threads to be in scope, add #include <thread>", 98 true 99 "thread keyword requires threads to be in scope, add #include <thread.hfa>", 100 true, 101 KeywordCastExpr::Thread 99 102 ) 100 103 {} … … 106 109 static void implement( std::list< Declaration * > & translationUnit ) { 107 110 PassVisitor< ThreadKeyword > impl; 108 acceptAll( translationUnit, impl );111 mutateAll( translationUnit, impl ); 109 112 } 110 113 }; … … 126 129 "__cor", 127 130 "get_coroutine", 128 "coroutine keyword requires coroutines to be in scope, add #include <coroutine>", 129 true 131 "coroutine keyword requires coroutines to be in scope, add #include <coroutine.hfa>", 132 true, 133 KeywordCastExpr::Coroutine 130 134 ) 131 135 {} … … 137 141 static void implement( std::list< Declaration * > & translationUnit ) { 138 142 PassVisitor< CoroutineKeyword > impl; 139 acceptAll( translationUnit, impl );143 mutateAll( translationUnit, impl ); 140 144 } 141 145 }; … … 157 161 "__mon", 158 162 "get_monitor", 159 "monitor keyword requires monitors to be in scope, add #include <monitor>", 160 false 163 "monitor keyword requires monitors to be in scope, add #include <monitor.hfa>", 164 false, 165 KeywordCastExpr::Monitor 161 166 ) 162 167 {} … … 168 173 static void implement( std::list< Declaration * > & translationUnit ) { 169 174 PassVisitor< MonitorKeyword > impl; 170 acceptAll( translationUnit, impl );175 mutateAll( translationUnit, impl ); 171 176 } 172 177 }; … … 186 191 void postvisit( StructDecl * decl ); 187 192 188 std::list<DeclarationWithType*> findMutexArgs( FunctionDecl* );193 std::list<DeclarationWithType*> findMutexArgs( FunctionDecl*, bool & first ); 189 194 void validate( DeclarationWithType * ); 190 195 void addDtorStatments( FunctionDecl* func, CompoundStmt *, const std::list<DeclarationWithType * > &); … … 257 262 // Generic keyword implementation 258 263 //============================================================================================= 259 void ConcurrentSueKeyword::postvisit(StructDecl * decl) { 264 void fixupGenerics(FunctionType * func, StructDecl * decl) { 265 cloneAll(decl->parameters, func->forall); 266 for ( TypeDecl * td : func->forall ) { 267 strict_dynamic_cast<StructInstType*>( 268 func->parameters.front()->get_type()->stripReferences() 269 )->parameters.push_back( 270 new TypeExpr( new TypeInstType( noQualifiers, td->name, td ) ) 271 ); 272 } 273 } 274 275 Declaration * ConcurrentSueKeyword::postmutate(StructDecl * decl) { 260 276 if( decl->name == type_name && decl->body ) { 261 277 assert( !type_decl ); … … 265 281 handle( decl ); 266 282 } 267 268 } 283 return decl; 284 } 285 286 Expression * ConcurrentSueKeyword::postmutate( KeywordCastExpr * cast ) { 287 if ( cast_target == cast->target ) { 288 // convert (thread &)t to (thread_desc &)*get_thread(t), etc. 289 if( !type_decl ) SemanticError( cast, context_error ); 290 Expression * arg = cast->arg; 291 cast->arg = nullptr; 292 delete cast; 293 return new CastExpr( 294 UntypedExpr::createDeref( 295 new UntypedExpr( new NameExpr( getter_name ), { arg } ) 296 ), 297 new ReferenceType( 298 noQualifiers, 299 new StructInstType( noQualifiers, type_decl ) ) 300 ); 301 } 302 return cast; 303 } 304 269 305 270 306 void ConcurrentSueKeyword::handle( StructDecl * decl ) { 271 307 if( ! decl->body ) return; 272 308 273 if( !type_decl ) throw SemanticError( context_error, decl);309 if( !type_decl ) SemanticError( decl, context_error ); 274 310 275 311 FunctionDecl * func = forwardDeclare( decl ); … … 301 337 ); 302 338 303 get_type->get_parameters().push_back( this_decl );339 get_type->get_parameters().push_back( this_decl->clone() ); 304 340 get_type->get_returnVals().push_back( 305 341 new ObjectDecl( … … 318 354 ) 319 355 ); 356 fixupGenerics(get_type, decl); 320 357 321 358 FunctionDecl * get_decl = new FunctionDecl( … … 343 380 nullptr 344 381 ); 345 } 382 fixupGenerics(main_type, decl); 383 } 384 385 delete this_decl; 346 386 347 387 declsToAddBefore.push_back( forward ); … … 377 417 new MemberExpr( 378 418 field, 379 UntypedExpr::createDeref( new VariableExpr( func->get_functionType()->get_parameters().front() ) ) 419 new CastExpr( 420 new VariableExpr( func->get_functionType()->get_parameters().front() ), 421 func->get_functionType()->get_parameters().front()->get_type()->stripReferences()->clone() 422 ) 380 423 ) 381 424 ) … … 398 441 void MutexKeyword::postvisit(FunctionDecl* decl) { 399 442 400 std::list<DeclarationWithType*> mutexArgs = findMutexArgs( decl ); 401 if( mutexArgs.empty() ) return; 402 403 if( CodeGen::isConstructor(decl->name) ) throw SemanticError( "constructors cannot have mutex parameters", decl ); 404 443 bool first = false; 444 std::list<DeclarationWithType*> mutexArgs = findMutexArgs( decl, first ); 405 445 bool isDtor = CodeGen::isDestructor( decl->name ); 406 446 407 if( isDtor && mutexArgs.size() != 1 ) throw SemanticError( "destructors can only have 1 mutex argument", decl ); 408 447 // Is this function relevant to monitors 448 if( mutexArgs.empty() ) { 449 // If this is the destructor for a monitor it must be mutex 450 if(isDtor) { 451 Type* ty = decl->get_functionType()->get_parameters().front()->get_type(); 452 453 // If it's a copy, it's not a mutex 454 ReferenceType* rty = dynamic_cast< ReferenceType * >( ty ); 455 if( ! rty ) return; 456 457 // If we are not pointing directly to a type, it's not a mutex 458 Type* base = rty->get_base(); 459 if( dynamic_cast< ReferenceType * >( base ) ) return; 460 if( dynamic_cast< PointerType * >( base ) ) return; 461 462 // Check if its a struct 463 StructInstType * baseStruct = dynamic_cast< StructInstType * >( base ); 464 if( !baseStruct ) return; 465 466 // Check if its a monitor 467 if(baseStruct->baseStruct->is_monitor() || baseStruct->baseStruct->is_thread()) 468 SemanticError( decl, "destructors for structures declared as \"monitor\" must use mutex parameters\n" ); 469 } 470 return; 471 } 472 473 // Monitors can't be constructed with mutual exclusion 474 if( CodeGen::isConstructor(decl->name) && !first ) SemanticError( decl, "constructors cannot have mutex parameters" ); 475 476 // It makes no sense to have multiple mutex parameters for the destructor 477 if( isDtor && mutexArgs.size() != 1 ) SemanticError( decl, "destructors can only have 1 mutex argument" ); 478 479 // Make sure all the mutex arguments are monitors 409 480 for(auto arg : mutexArgs) { 410 481 validate( arg ); 411 482 } 412 483 484 // Check if we need to instrument the body 413 485 CompoundStmt* body = decl->get_statements(); 414 486 if( ! body ) return; 415 487 416 if( !monitor_decl ) throw SemanticError( "mutex keyword requires monitors to be in scope, add #include <monitor>", decl ); 417 if( !guard_decl ) throw SemanticError( "mutex keyword requires monitors to be in scope, add #include <monitor>", decl ); 418 if( !dtor_guard_decl ) throw SemanticError( "mutex keyword requires monitors to be in scope, add #include <monitor>", decl ); 419 488 // Do we have the required headers 489 if( !monitor_decl || !guard_decl || !dtor_guard_decl ) 490 SemanticError( decl, "mutex keyword requires monitors to be in scope, add #include <monitor.hfa>\n" ); 491 492 // Instrument the body 420 493 if( isDtor ) { 421 494 addDtorStatments( decl, body, mutexArgs ); … … 428 501 void MutexKeyword::postvisit(StructDecl* decl) { 429 502 430 if( decl->name == "monitor_desc" ) {503 if( decl->name == "monitor_desc" && decl->body ) { 431 504 assert( !monitor_decl ); 432 505 monitor_decl = decl; 433 506 } 434 else if( decl->name == "monitor_guard_t" ) {507 else if( decl->name == "monitor_guard_t" && decl->body ) { 435 508 assert( !guard_decl ); 436 509 guard_decl = decl; 437 510 } 438 else if( decl->name == "monitor_dtor_guard_t" ) {511 else if( decl->name == "monitor_dtor_guard_t" && decl->body ) { 439 512 assert( !dtor_guard_decl ); 440 513 dtor_guard_decl = decl; … … 442 515 } 443 516 444 std::list<DeclarationWithType*> MutexKeyword::findMutexArgs( FunctionDecl* decl ) {517 std::list<DeclarationWithType*> MutexKeyword::findMutexArgs( FunctionDecl* decl, bool & first ) { 445 518 std::list<DeclarationWithType*> mutexArgs; 446 519 520 bool once = true; 447 521 for( auto arg : decl->get_functionType()->get_parameters()) { 448 522 //Find mutex arguments … … 450 524 if( ! ty->get_mutex() ) continue; 451 525 526 if(once) {first = true;} 527 once = false; 528 452 529 //Append it to the list 453 530 mutexArgs.push_back( arg ); … … 462 539 //Makes sure it's not a copy 463 540 ReferenceType* rty = dynamic_cast< ReferenceType * >( ty ); 464 if( ! rty ) throw SemanticError( "Mutex argument must be of reference type ", arg);541 if( ! rty ) SemanticError( arg, "Mutex argument must be of reference type " ); 465 542 466 543 //Make sure the we are pointing directly to a type 467 544 Type* base = rty->get_base(); 468 if( dynamic_cast< ReferenceType * >( base ) ) throw SemanticError( "Mutex argument have exactly one level of indirection ", arg);469 if( dynamic_cast< PointerType * >( base ) ) throw SemanticError( "Mutex argument have exactly one level of indirection ", arg);545 if( dynamic_cast< ReferenceType * >( base ) ) SemanticError( arg, "Mutex argument have exactly one level of indirection " ); 546 if( dynamic_cast< PointerType * >( base ) ) SemanticError( arg, "Mutex argument have exactly one level of indirection " ); 470 547 471 548 //Make sure that typed isn't mutex 472 if( base->get_mutex() ) throw SemanticError( "mutex keyword may only appear once per argument ", arg);549 if( base->get_mutex() ) SemanticError( arg, "mutex keyword may only appear once per argument " ); 473 550 } 474 551 … … 608 685 if( type && type->get_baseStruct()->is_thread() ) { 609 686 if( !thread_decl || !thread_ctor_seen ) { 610 throw SemanticError("thread keyword requires threads to be in scope, add #include <thread>");687 SemanticError( type->get_baseStruct()->location, "thread keyword requires threads to be in scope, add #include <thread.hfa>"); 611 688 } 612 689 -
src/Concurrency/Waitfor.cc
rf9feab8 r90152a4 249 249 250 250 Statement * GenerateWaitForPass::postmutate( WaitForStmt * waitfor ) { 251 if( !decl_monitor || !decl_acceptable || !decl_mask ) throw SemanticError( "waitfor keyword requires monitors to be in scope, add #include <monitor>", waitfor ); 251 if( !decl_monitor || !decl_acceptable || !decl_mask ) 252 SemanticError( waitfor, "waitfor keyword requires monitors to be in scope, add #include <monitor.hfa>" ); 252 253 253 254 CompoundStmt * stmt = new CompoundStmt(); … … 507 508 new ListInit({ 508 509 new SingleInit( new AddressExpr( new VariableExpr( index ) ) ), 509 new SingleInit( new VariableExpr( acceptables ) ), 510 new SingleInit( new ConstantExpr( Constant::from_ulong( count ) ) ) 510 new ListInit({ 511 new SingleInit( new VariableExpr( acceptables ) ), 512 new SingleInit( new ConstantExpr( Constant::from_ulong( count ) ) ) 513 }) 511 514 }) 512 515 ); -
src/ControlStruct/ExceptTranslate.cc
rf9feab8 r90152a4 34 34 #include "SynTree/Statement.h" // for CompoundStmt, CatchStmt, ThrowStmt 35 35 #include "SynTree/Type.h" // for FunctionType, Type, noQualifiers 36 #include "SynTree/ VarExprReplacer.h" // for VarExprReplacer, VarExprReplace...36 #include "SynTree/DeclReplacer.h" // for DeclReplacer 37 37 #include "SynTree/Visitor.h" // for acceptAll 38 38 … … 314 314 // Update variables in the body to point to this local copy. 315 315 { 316 VarExprReplacer::DeclMap mapping; 317 mapping[ handler_decl ] = new VariableExpr( local_except ); 318 VarExprReplacer mapper( mapping ); 319 handler->body->acceptMutator( mapper ); 316 DeclReplacer::DeclMap mapping; 317 mapping[ handler_decl ] = local_except; 318 DeclReplacer::replace( handler->body, mapping ); 320 319 } 321 320 … … 573 572 // Pass. 574 573 } else if ( CatchStmt::Terminate == catchStmt->get_kind() ) { 575 throw SemanticError("catch must have exception type");574 SemanticError(catchStmt->location, "catch must have exception type"); 576 575 } else { 577 throw SemanticError("catchResume must have exception type");576 SemanticError(catchStmt->location, "catchResume must have exception type"); 578 577 } 579 578 -
src/ControlStruct/ForExprMutator.cc
rf9feab8 r90152a4 45 45 return hoist( forStmt, forStmt->initialization ); 46 46 } 47 Statement *ForExprMutator::postmutate( WhileStmt *whileStmt ) { 48 return hoist( whileStmt, whileStmt->initialization ); 49 } 47 50 } // namespace ControlStruct 48 51 -
src/ControlStruct/ForExprMutator.h
rf9feab8 r90152a4 18 18 class IfStmt; 19 19 class ForStmt; 20 class WhileStmt; 20 21 class Statement; 21 22 … … 25 26 Statement *postmutate( IfStmt * ); 26 27 Statement *postmutate( ForStmt * ); 28 Statement *postmutate( WhileStmt * ); 27 29 }; 28 30 } // namespace ControlStruct -
src/ControlStruct/LabelFixer.cc
rf9feab8 r90152a4 44 44 45 45 void LabelFixer::postvisit( FunctionDecl * functionDecl ) { 46 MLEMutatormlemut( resolveJumps(), generator );46 PassVisitor<MLEMutator> mlemut( resolveJumps(), generator ); 47 47 functionDecl->acceptMutator( mlemut ); 48 48 } … … 92 92 } else if ( labelTable[ l ]->defined() ) { 93 93 // defined twice, error 94 throw SemanticError("Duplicate definition of label: " + l.get_name() );94 SemanticError( l.get_statement()->location, "Duplicate definition of label: " + l.get_name() ); 95 95 } else { 96 96 // used previously, but undefined until now -> link with this entry … … 117 117 118 118 // Builds a table that maps a label to its defining statement. 119 std::map<Label, Statement * > *LabelFixer::resolveJumps() throw ( SemanticError ) {119 std::map<Label, Statement * > *LabelFixer::resolveJumps() throw ( SemanticErrorException ) { 120 120 std::map< Label, Statement * > *ret = new std::map< Label, Statement * >(); 121 121 for ( std::map< Label, Entry * >::iterator i = labelTable.begin(); i != labelTable.end(); ++i ) { 122 122 if ( ! i->second->defined() ) { 123 throw SemanticError("Use of undefined label: " + i->first.get_name() );123 SemanticError( i->first.get_statement()->location, "Use of undefined label: " + i->first.get_name() ); 124 124 } 125 125 (*ret)[ i->first ] = i->second->get_definition(); -
src/ControlStruct/LabelFixer.h
rf9feab8 r90152a4 33 33 LabelFixer( LabelGenerator *gen = 0 ); 34 34 35 std::map < Label, Statement * > *resolveJumps() throw ( SemanticError );35 std::map < Label, Statement * > *resolveJumps() throw ( SemanticErrorException ); 36 36 37 37 // Declarations -
src/ControlStruct/MLEMutator.cc
rf9feab8 r90152a4 10 10 // Created On : Mon May 18 07:44:20 2015 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Thu Aug 4 11:21:32 201613 // Update Count : 2 0212 // Last Modified On : Thu Mar 8 17:08:25 2018 13 // Update Count : 219 14 14 // 15 15 … … 38 38 } 39 39 namespace { 40 Statement * isLoop( Statement * stmt ) { return dynamic_cast< WhileStmt * >( stmt ) ? stmt : dynamic_cast< ForStmt * >( stmt ) ? stmt : 0; } 41 } 40 bool isLoop( const MLEMutator::Entry & e ) { return dynamic_cast< WhileStmt * >( e.get_controlStructure() ) || dynamic_cast< ForStmt * >( e.get_controlStructure() ); } 41 bool isSwitch( const MLEMutator::Entry & e ) { return dynamic_cast< SwitchStmt *>( e.get_controlStructure() ); } 42 43 bool isBreakTarget( const MLEMutator::Entry & e ) { return isLoop( e ) || isSwitch( e ) || dynamic_cast< CompoundStmt *>( e.get_controlStructure() ); } 44 bool isContinueTarget( const MLEMutator::Entry & e ) { return isLoop( e ); } 45 bool isFallthroughTarget( const MLEMutator::Entry & e ) { return dynamic_cast< CaseStmt *>( e.get_controlStructure() );; } 46 bool isFallthroughDefaultTarget( const MLEMutator::Entry & e ) { return isSwitch( e ); } 47 } // namespace 42 48 43 49 // break labels have to come after the statement they break out of, so mutate a statement, then if they inform us 44 50 // through the breakLabel field tha they need a place to jump to on a break statement, add the break label to the 45 51 // body of statements 46 void MLEMutator::fixBlock( std::list< Statement * > &kids ) { 52 void MLEMutator::fixBlock( std::list< Statement * > &kids, bool caseClause ) { 53 SemanticErrorException errors; 54 47 55 for ( std::list< Statement * >::iterator k = kids.begin(); k != kids.end(); k++ ) { 48 *k = (*k)->acceptMutator(*this); 56 if ( caseClause ) { 57 // once a label is seen, it's no longer a valid fallthrough target 58 for ( Label & l : (*k)->labels ) { 59 fallthroughLabels.erase( l ); 60 } 61 } 62 63 // aggregate errors since the PassVisitor mutate loop was unrollled 64 try { 65 *k = (*k)->acceptMutator(*visitor); 66 } catch( SemanticErrorException &e ) { 67 errors.append( e ); 68 } 49 69 50 70 if ( ! get_breakLabel().empty() ) { … … 55 75 } // if 56 76 } // for 57 } 58 59 CompoundStmt* MLEMutator::mutate( CompoundStmt *cmpndStmt ) { 60 bool labeledBlock = !(cmpndStmt->get_labels().empty()); 77 78 if ( ! errors.isEmpty() ) { 79 throw errors; 80 } 81 } 82 83 void MLEMutator::premutate( CompoundStmt *cmpndStmt ) { 84 visit_children = false; 85 bool labeledBlock = !(cmpndStmt->labels.empty()); 61 86 if ( labeledBlock ) { 62 87 Label brkLabel = generator->newLabel("blockBreak", cmpndStmt); 63 88 enclosingControlStructures.push_back( Entry( cmpndStmt, brkLabel ) ); 89 GuardAction( [this]() { enclosingControlStructures.pop_back(); } ); 64 90 } // if 65 91 66 92 // a child statement may set the break label - if they do, attach it to the next statement 67 std::list< Statement * > &kids = cmpndStmt-> get_kids();93 std::list< Statement * > &kids = cmpndStmt->kids; 68 94 fixBlock( kids ); 69 95 … … 73 99 set_breakLabel( enclosingControlStructures.back().useBreakExit() ); 74 100 } // if 75 enclosingControlStructures.pop_back(); 76 } // if 77 78 return cmpndStmt; 79 } 80 81 template< typename LoopClass > 82 Statement *MLEMutator::handleLoopStmt( LoopClass *loopStmt ) { 83 // remember this as the most recent enclosing loop, then mutate the body of the loop -- this will determine 84 // whether brkLabel and contLabel are used with branch statements and will recursively do the same to nested 85 // loops 86 Label brkLabel = generator->newLabel("loopBreak", loopStmt); 87 Label contLabel = generator->newLabel("loopContinue", loopStmt); 88 enclosingControlStructures.push_back( Entry( loopStmt, brkLabel, contLabel ) ); 89 loopStmt->set_body ( loopStmt->get_body()->acceptMutator( *this ) ); 90 91 assert( ! enclosingControlStructures.empty() ); 92 Entry &e = enclosingControlStructures.back(); 93 // sanity check that the enclosing loops have been popped correctly 94 assert ( e == loopStmt ); 95 96 // this will take the necessary steps to add definitions of the previous two labels, if they are used. 97 loopStmt->set_body( mutateLoop( loopStmt->get_body(), e ) ); 98 enclosingControlStructures.pop_back(); 99 100 return loopStmt; 101 } 102 103 Statement *MLEMutator::mutate( CaseStmt *caseStmt ) { 104 caseStmt->set_condition( maybeMutate( caseStmt->get_condition(), *this ) ); 105 fixBlock( caseStmt->get_statements() ); 106 107 return caseStmt; 108 } 109 110 template< typename IfClass > 111 Statement *MLEMutator::handleIfStmt( IfClass *ifStmt ) { 112 // generate a label for breaking out of a labeled if 113 bool labeledBlock = !(ifStmt->get_labels().empty()); 114 if ( labeledBlock ) { 115 Label brkLabel = generator->newLabel("blockBreak", ifStmt); 116 enclosingControlStructures.push_back( Entry( ifStmt, brkLabel ) ); 117 } // if 118 119 Parent::mutate( ifStmt ); 120 121 if ( labeledBlock ) { 122 if ( ! enclosingControlStructures.back().useBreakExit().empty() ) { 123 set_breakLabel( enclosingControlStructures.back().useBreakExit() ); 124 } // if 125 enclosingControlStructures.pop_back(); 126 } // if 127 return ifStmt; 128 } 129 130 template< typename SwitchClass > 131 Statement *MLEMutator::handleSwitchStmt( SwitchClass *switchStmt ) { 132 // generate a label for breaking out of a labeled switch 133 Label brkLabel = generator->newLabel("switchBreak", switchStmt); 134 enclosingControlStructures.push_back( Entry(switchStmt, brkLabel) ); 135 mutateAll( switchStmt->get_statements(), *this ); 136 137 Entry &e = enclosingControlStructures.back(); 138 assert ( e == switchStmt ); 139 140 // only generate break label if labeled break is used 141 if ( e.isBreakUsed() ) { 142 // for the purposes of keeping switch statements uniform (i.e. all statements that are direct children of a 143 // switch should be CastStmts), append the exit label + break to the last case statement; create a default 144 // case if there are no cases 145 std::list< Statement * > &statements = switchStmt->get_statements(); 146 if ( statements.empty() ) { 147 statements.push_back( CaseStmt::makeDefault() ); 148 } // if 149 150 if ( CaseStmt * c = dynamic_cast< CaseStmt * >( statements.back() ) ) { 151 Statement * stmt = new BranchStmt( Label("brkLabel"), BranchStmt::Break ); 152 stmt->labels.push_back( brkLabel ); 153 c->get_statements().push_back( stmt ); 154 } else assert(0); // as of this point, all statements of a switch are still CaseStmts 155 } // if 156 157 assert ( enclosingControlStructures.back() == switchStmt ); 158 enclosingControlStructures.pop_back(); 159 return switchStmt; 160 } 101 } // if 102 } 103 161 104 162 105 void addUnused( Statement * stmt, const Label & originalTarget ) { … … 179 122 180 123 181 Statement *MLEMutator:: mutate( BranchStmt *branchStmt ) throw ( SemanticError) {182 std::string originalTarget = branchStmt-> get_originalTarget();124 Statement *MLEMutator::postmutate( BranchStmt *branchStmt ) throw ( SemanticErrorException ) { 125 std::string originalTarget = branchStmt->originalTarget; 183 126 184 127 std::list< Entry >::reverse_iterator targetEntry; … … 193 136 if ( isContinue ) { 194 137 // continue target is outermost loop 195 targetEntry = std::find_if( enclosingControlStructures.rbegin(), enclosingControlStructures.rend(), [](Entry &e) { return isLoop( e.get_controlStructure() ); });138 targetEntry = std::find_if( enclosingControlStructures.rbegin(), enclosingControlStructures.rend(), isContinueTarget ); 196 139 } else { 197 // break target is out mostcontrol structure198 if ( enclosingControlStructures.empty() ) throw SemanticError( "'break' outside a loop, switch, or labelled block" );199 targetEntry = enclosingControlStructures.rbegin();140 // break target is outermost loop, switch, or block control structure 141 if ( enclosingControlStructures.empty() ) SemanticError( branchStmt->location, "'break' outside a loop, 'switch', or labelled block" ); 142 targetEntry = std::find_if( enclosingControlStructures.rbegin(), enclosingControlStructures.rend(), isBreakTarget ); 200 143 } // if 201 144 } else { … … 204 147 } // if 205 148 // ensure that selected target is valid 206 if ( targetEntry == enclosingControlStructures.rend() || (isContinue && ! is Loop( targetEntry->get_controlStructure()) ) ) {207 throw SemanticError(toString( (isContinue ? "'continue'" : "'break'"), " target must be an enclosing ", (isContinue ? "loop: " : "control structure: "), originalTarget ) );149 if ( targetEntry == enclosingControlStructures.rend() || (isContinue && ! isContinueTarget( *targetEntry ) ) ) { 150 SemanticError( branchStmt->location, toString( (isContinue ? "'continue'" : "'break'"), " target must be an enclosing ", (isContinue ? "loop: " : "control structure: "), originalTarget ) ); 208 151 } // if 209 152 break; 210 153 } 154 case BranchStmt::FallThrough: 155 targetEntry = std::find_if( enclosingControlStructures.rbegin(), enclosingControlStructures.rend(), isFallthroughTarget ); 156 // ensure that selected target is valid 157 if ( targetEntry == enclosingControlStructures.rend() ) { 158 SemanticError( branchStmt->location, "'fallthrough' must be enclosed in a 'switch' or 'choose'" ); 159 } // if 160 if ( branchStmt->get_target() != "" ) { 161 // labelled fallthrough 162 // target must be in the set of valid fallthrough labels 163 if ( ! fallthroughLabels.count( branchStmt->get_target() ) ) { 164 SemanticError( branchStmt->location, toString( "'fallthrough' target must be a later case statement: ", originalTarget ) ); 165 } 166 return new BranchStmt( originalTarget, BranchStmt::Goto ); 167 } 168 break; 169 case BranchStmt::FallThroughDefault: { 170 // fallthrough default 171 targetEntry = std::find_if( enclosingControlStructures.rbegin(), enclosingControlStructures.rend(), isFallthroughDefaultTarget ); 172 173 // ensure that fallthrough is within a switch or choose 174 if ( targetEntry == enclosingControlStructures.rend() ) { 175 SemanticError( branchStmt->location, "'fallthrough' must be enclosed in a 'switch' or 'choose'" ); 176 } // if 177 178 // ensure that switch or choose has a default clause 179 SwitchStmt * switchStmt = strict_dynamic_cast< SwitchStmt * >( targetEntry->get_controlStructure() ); 180 bool foundDefault = false; 181 for ( Statement * stmt : switchStmt->statements ) { 182 CaseStmt * caseStmt = strict_dynamic_cast< CaseStmt * >( stmt ); 183 if ( caseStmt->isDefault() ) { 184 foundDefault = true; 185 } // if 186 } // for 187 if ( ! foundDefault ) { 188 SemanticError( branchStmt->location, "'fallthrough default' must be enclosed in a 'switch' or 'choose' control structure with a 'default' clause" ); 189 } 190 break; 191 } 192 211 193 default: 212 194 assert( false ); … … 215 197 // branch error checks, get the appropriate label name and create a goto 216 198 Label exitLabel; 217 switch ( branchStmt-> get_type()) {199 switch ( branchStmt->type ) { 218 200 case BranchStmt::Break: 219 201 assert( targetEntry->useBreakExit() != ""); … … 224 206 exitLabel = targetEntry->useContExit(); 225 207 break; 208 case BranchStmt::FallThrough: 209 assert( targetEntry->useFallExit() != ""); 210 exitLabel = targetEntry->useFallExit(); 211 break; 212 case BranchStmt::FallThroughDefault: 213 assert( targetEntry->useFallDefaultExit() != ""); 214 exitLabel = targetEntry->useFallDefaultExit(); 215 // check that fallthrough default comes before the default clause 216 if ( ! targetEntry->isFallDefaultValid() ) { 217 SemanticError( branchStmt->location, "'fallthrough default' must precede the 'default' clause" ); 218 } 219 break; 226 220 default: 227 221 assert(0); // shouldn't be here … … 229 223 230 224 // add unused attribute to label to silence warnings 231 addUnused( targetEntry->get_controlStructure(), branchStmt-> get_originalTarget());225 addUnused( targetEntry->get_controlStructure(), branchStmt->originalTarget ); 232 226 233 227 // transform break/continue statements into goto to simplify later handling of branches … … 260 254 } 261 255 262 Statement *MLEMutator::mutate( WhileStmt *whileStmt ) { 263 return handleLoopStmt( whileStmt ); 264 } 265 266 Statement *MLEMutator::mutate( ForStmt *forStmt ) { 267 return handleLoopStmt( forStmt ); 268 } 269 270 Statement *MLEMutator::mutate( IfStmt *ifStmt ) { 271 return handleIfStmt( ifStmt ); 272 } 273 274 Statement *MLEMutator::mutate( SwitchStmt *switchStmt ) { 275 return handleSwitchStmt( switchStmt ); 256 template< typename LoopClass > 257 void MLEMutator::prehandleLoopStmt( LoopClass * loopStmt ) { 258 // remember this as the most recent enclosing loop, then mutate the body of the loop -- this will determine 259 // whether brkLabel and contLabel are used with branch statements and will recursively do the same to nested 260 // loops 261 Label brkLabel = generator->newLabel("loopBreak", loopStmt); 262 Label contLabel = generator->newLabel("loopContinue", loopStmt); 263 enclosingControlStructures.push_back( Entry( loopStmt, brkLabel, contLabel ) ); 264 GuardAction( [this]() { enclosingControlStructures.pop_back(); } ); 265 } 266 267 template< typename LoopClass > 268 Statement * MLEMutator::posthandleLoopStmt( LoopClass * loopStmt ) { 269 assert( ! enclosingControlStructures.empty() ); 270 Entry &e = enclosingControlStructures.back(); 271 // sanity check that the enclosing loops have been popped correctly 272 assert ( e == loopStmt ); 273 274 // this will take the necessary steps to add definitions of the previous two labels, if they are used. 275 loopStmt->body = mutateLoop( loopStmt->get_body(), e ); 276 return loopStmt; 277 } 278 279 void MLEMutator::premutate( WhileStmt * whileStmt ) { 280 return prehandleLoopStmt( whileStmt ); 281 } 282 283 void MLEMutator::premutate( ForStmt * forStmt ) { 284 return prehandleLoopStmt( forStmt ); 285 } 286 287 Statement * MLEMutator::postmutate( WhileStmt * whileStmt ) { 288 return posthandleLoopStmt( whileStmt ); 289 } 290 291 Statement * MLEMutator::postmutate( ForStmt * forStmt ) { 292 return posthandleLoopStmt( forStmt ); 293 } 294 295 void MLEMutator::premutate( IfStmt * ifStmt ) { 296 // generate a label for breaking out of a labeled if 297 bool labeledBlock = !(ifStmt->get_labels().empty()); 298 if ( labeledBlock ) { 299 Label brkLabel = generator->newLabel("blockBreak", ifStmt); 300 enclosingControlStructures.push_back( Entry( ifStmt, brkLabel ) ); 301 GuardAction( [this]() { enclosingControlStructures.pop_back(); } ); 302 } // if 303 } 304 305 Statement * MLEMutator::postmutate( IfStmt * ifStmt ) { 306 bool labeledBlock = !(ifStmt->get_labels().empty()); 307 if ( labeledBlock ) { 308 if ( ! enclosingControlStructures.back().useBreakExit().empty() ) { 309 set_breakLabel( enclosingControlStructures.back().useBreakExit() ); 310 } // if 311 } // if 312 return ifStmt; 313 } 314 315 void MLEMutator::premutate( CaseStmt *caseStmt ) { 316 visit_children = false; 317 318 // mark default as seen before visiting its statements to catch default loops 319 if ( caseStmt->isDefault() ) { 320 enclosingControlStructures.back().seenDefault(); 321 } // if 322 323 caseStmt->condition = maybeMutate( caseStmt->condition, *visitor ); 324 Label fallLabel = generator->newLabel( "fallThrough", caseStmt ); 325 { 326 // ensure that stack isn't corrupted by exceptions in fixBlock 327 auto guard = makeFuncGuard( [&]() { enclosingControlStructures.push_back( Entry( caseStmt, fallLabel ) ); }, [this]() { enclosingControlStructures.pop_back(); } ); 328 329 // empty case statement 330 if( ! caseStmt->stmts.empty() ) { 331 // the parser ensures that all statements in a case are grouped into a block 332 CompoundStmt * block = strict_dynamic_cast< CompoundStmt * >( caseStmt->stmts.front() ); 333 fixBlock( block->kids, true ); 334 335 // add fallthrough label if necessary 336 assert( ! enclosingControlStructures.empty() ); 337 if ( enclosingControlStructures.back().isFallUsed() ) { 338 std::list<Label> ls{ enclosingControlStructures.back().useFallExit() }; 339 caseStmt->stmts.push_back( new NullStmt( ls ) ); 340 } // if 341 } // if 342 } 343 assert( ! enclosingControlStructures.empty() ); 344 assertf( dynamic_cast<SwitchStmt *>( enclosingControlStructures.back().get_controlStructure() ), "Control structure enclosing a case clause must be a switch, but is: %s", toCString( enclosingControlStructures.back().get_controlStructure() ) ); 345 if ( caseStmt->isDefault() ) { 346 if ( enclosingControlStructures.back().isFallDefaultUsed() ) { 347 // add fallthrough default label if necessary 348 std::list<Label> ls{ enclosingControlStructures.back().useFallDefaultExit() }; 349 caseStmt->stmts.push_front( new NullStmt( ls ) ); 350 } // if 351 } // if 352 } 353 354 void MLEMutator::premutate( SwitchStmt *switchStmt ) { 355 // generate a label for breaking out of a labeled switch 356 Label brkLabel = generator->newLabel("switchBreak", switchStmt); 357 auto it = std::find_if( switchStmt->statements.rbegin(), switchStmt->statements.rend(), [](Statement * stmt) { 358 CaseStmt * caseStmt = strict_dynamic_cast< CaseStmt * >( stmt ); 359 return caseStmt->isDefault(); 360 }); 361 CaseStmt * defaultCase = it != switchStmt->statements.rend() ? strict_dynamic_cast<CaseStmt *>( *it ) : nullptr; 362 Label fallDefaultLabel = defaultCase ? generator->newLabel( "fallThroughDefault", defaultCase ) : ""; 363 enclosingControlStructures.push_back( Entry(switchStmt, brkLabel, fallDefaultLabel) ); 364 GuardAction( [this]() { enclosingControlStructures.pop_back(); } ); 365 366 // Collect valid labels for fallthrough. This is initially all labels at the same level as a case statement. 367 // As labels are seen during traversal, they are removed, since fallthrough is not allowed to jump backwards. 368 for ( Statement * stmt : switchStmt->statements ) { 369 CaseStmt * caseStmt = strict_dynamic_cast< CaseStmt * >( stmt ); 370 if ( caseStmt->stmts.empty() ) continue; 371 CompoundStmt * block = dynamic_cast< CompoundStmt * >( caseStmt->stmts.front() ); 372 for ( Statement * stmt : block->kids ) { 373 for ( Label & l : stmt->labels ) { 374 fallthroughLabels.insert( l ); 375 } 376 } 377 } 378 } 379 380 Statement * MLEMutator::postmutate( SwitchStmt * switchStmt ) { 381 Entry &e = enclosingControlStructures.back(); 382 assert ( e == switchStmt ); 383 384 // only generate break label if labeled break is used 385 if ( e.isBreakUsed() ) { 386 // for the purposes of keeping switch statements uniform (i.e. all statements that are direct children of a 387 // switch should be CastStmts), append the exit label + break to the last case statement; create a default 388 // case if there are no cases 389 std::list< Statement * > &statements = switchStmt->statements; 390 if ( statements.empty() ) { 391 statements.push_back( CaseStmt::makeDefault() ); 392 } // if 393 394 if ( CaseStmt * c = dynamic_cast< CaseStmt * >( statements.back() ) ) { 395 Statement * stmt = new BranchStmt( Label("brkLabel"), BranchStmt::Break ); 396 stmt->labels.push_back( e.useBreakExit() ); 397 c->stmts.push_back( stmt ); 398 } else assert(0); // as of this point, all statements of a switch are still CaseStmts 399 } // if 400 401 assert ( enclosingControlStructures.back() == switchStmt ); 402 return switchStmt; 276 403 } 277 404 } // namespace ControlStruct -
src/ControlStruct/MLEMutator.h
rf9feab8 r90152a4 10 10 // Created On : Mon May 18 07:44:20 2015 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Sat Jul 22 09:19:59 201713 // Update Count : 3512 // Last Modified On : Thu Mar 8 16:42:32 2018 13 // Update Count : 41 14 14 // 15 15 … … 19 19 #include <map> // for map 20 20 #include <string> // for string 21 #include <set> // for unordered_set 21 22 23 #include "Common/PassVisitor.h" 22 24 #include "Common/SemanticError.h" // for SemanticError 23 25 #include "SynTree/Label.h" // for Label … … 26 28 27 29 namespace ControlStruct { 28 class LabelGenerator;30 class LabelGenerator; 29 31 30 class MLEMutator : public Mutator { 32 class MLEMutator : public WithVisitorRef<MLEMutator>, public WithShortCircuiting, public WithGuards { 33 public: 31 34 class Entry; 32 33 typedef Mutator Parent;34 public:35 35 MLEMutator( std::map<Label, Statement *> *t, LabelGenerator *gen = 0 ) : targetTable( t ), breakLabel(std::string("")), generator( gen ) {} 36 36 ~MLEMutator(); 37 37 38 virtual CompoundStmt *mutate( CompoundStmt *cmpndStmt ) override; 39 virtual Statement *mutate( WhileStmt *whileStmt ) override; 40 virtual Statement *mutate( ForStmt *forStmt ) override; 41 virtual Statement *mutate( BranchStmt *branchStmt ) throw ( SemanticError ) override; 42 virtual Statement *mutate( CaseStmt *caseStmt ) override; 43 virtual Statement *mutate( IfStmt *ifStmt ) override; 44 virtual Statement *mutate( SwitchStmt *switchStmt ) override; 38 void premutate( CompoundStmt *cmpndStmt ); 39 Statement * postmutate( BranchStmt *branchStmt ) throw ( SemanticErrorException ); 40 void premutate( WhileStmt *whileStmt ); 41 Statement * postmutate( WhileStmt *whileStmt ); 42 void premutate( ForStmt *forStmt ); 43 Statement * postmutate( ForStmt *forStmt ); 44 void premutate( CaseStmt *caseStmt ); 45 void premutate( IfStmt *ifStmt ); 46 Statement * postmutate( IfStmt *ifStmt ); 47 void premutate( SwitchStmt *switchStmt ); 48 Statement * postmutate( SwitchStmt *switchStmt ); 45 49 46 50 Statement *mutateLoop( Statement *bodyLoop, Entry &e ); … … 48 52 Label &get_breakLabel() { return breakLabel; } 49 53 void set_breakLabel( Label newValue ) { breakLabel = newValue; } 50 private: 54 51 55 class Entry { 52 56 public: 53 explicit Entry( Statement *_loop, Label _breakExit, Label _contExit = Label("") ) : 54 loop( _loop ), breakExit( _breakExit ), contExit( _contExit ), breakUsed(false), contUsed(false) {} 57 // specialized constructors for each combination of statement with labelled break/continue/fallthrough that is valid to cleanup the use cases 58 explicit Entry( ForStmt *stmt, Label breakExit, Label contExit ) : 59 stmt( stmt ), breakExit( breakExit ), contExit( contExit ) {} 55 60 56 bool operator==( const Statement *stmt ) { return ( loop == stmt ); }57 bool operator!=( const Statement *stmt ) { return ( loop != stmt );}61 explicit Entry( WhileStmt *stmt, Label breakExit, Label contExit ) : 62 stmt( stmt ), breakExit( breakExit ), contExit( contExit ) {} 58 63 59 bool operator==( const Entry &other ) { return ( loop == other.get_controlStructure() ); } 64 explicit Entry( CompoundStmt *stmt, Label breakExit ) : 65 stmt( stmt ), breakExit( breakExit ) {} 60 66 61 Statement *get_controlStructure() const { return loop; } 67 explicit Entry( IfStmt *stmt, Label breakExit ) : 68 stmt( stmt ), breakExit( breakExit ) {} 69 70 explicit Entry( CaseStmt *stmt, Label fallExit ) : 71 stmt( stmt ), fallExit( fallExit ) {} 72 73 explicit Entry( SwitchStmt *stmt, Label breakExit, Label fallDefaultExit ) : 74 stmt( stmt ), breakExit( breakExit ), fallDefaultExit( fallDefaultExit ) {} 75 76 bool operator==( const Statement *other ) { return stmt == other; } 77 bool operator!=( const Statement *other ) { return stmt != other; } 78 79 bool operator==( const Entry &other ) { return stmt == other.get_controlStructure(); } 80 81 Statement *get_controlStructure() const { return stmt; } 62 82 63 83 Label useContExit() { contUsed = true; return contExit; } 64 84 Label useBreakExit() { breakUsed = true; return breakExit; } 85 Label useFallExit() { fallUsed = true; return fallExit; } 86 Label useFallDefaultExit() { fallDefaultUsed = true; return fallDefaultExit; } 65 87 66 88 bool isContUsed() const { return contUsed; } 67 89 bool isBreakUsed() const { return breakUsed; } 90 bool isFallUsed() const { return fallUsed; } 91 bool isFallDefaultUsed() const { return fallDefaultUsed; } 92 void seenDefault() { fallDefaultValid = false; } 93 bool isFallDefaultValid() const { return fallDefaultValid; } 68 94 private: 69 Statement *loop; 70 Label breakExit, contExit; 71 bool breakUsed, contUsed; 95 Statement *stmt; 96 Label breakExit, contExit, fallExit, fallDefaultExit; 97 bool breakUsed = false, contUsed = false, fallUsed = false, fallDefaultUsed = false; 98 bool fallDefaultValid = true; 72 99 }; 73 100 101 private: 74 102 std::map< Label, Statement * > *targetTable; 103 std::set< Label > fallthroughLabels; 75 104 std::list< Entry > enclosingControlStructures; 76 105 Label breakLabel; … … 78 107 79 108 template< typename LoopClass > 80 Statement *handleLoopStmt( LoopClass *loopStmt );109 void prehandleLoopStmt( LoopClass * loopStmt ); 81 110 82 template< typename IfClass >83 Statement * handleIfStmt( IfClass *switchStmt );111 template< typename LoopClass > 112 Statement * posthandleLoopStmt( LoopClass * loopStmt ); 84 113 85 template< typename SwitchClass > 86 Statement *handleSwitchStmt( SwitchClass *switchStmt ); 87 88 void fixBlock( std::list< Statement * > &kids ); 114 void fixBlock( std::list< Statement * > &kids, bool caseClause = false ); 89 115 }; 90 116 } // namespace ControlStruct -
src/ControlStruct/Mutate.cc
rf9feab8 r90152a4 18 18 19 19 #include "Common/PassVisitor.h" // for mutateAll 20 #include "Common/SemanticError.h" // for SemanticError21 20 #include "ForExprMutator.h" // for ForExprMutator 22 21 #include "LabelFixer.h" // for LabelFixer … … 28 27 #include "SynTree/Visitor.h" // for acceptAll 29 28 30 using namespace std; 29 namespace ControlStruct { 30 void fixLabels( std::list< Declaration * > & translationUnit ) { 31 PassVisitor<LabelFixer> lfix; 32 acceptAll( translationUnit, lfix ); 33 } 31 34 32 namespace ControlStruct { 33 void mutate( std::list< Declaration * > translationUnit ) { 34 // hoist initialization out of for statements 35 void hoistControlDecls( std::list< Declaration * > & translationUnit ) { 35 36 PassVisitor<ForExprMutator> formut; 36 37 // normalizes label definitions and generates multi-level exit labels38 PassVisitor<LabelFixer> lfix;39 40 37 mutateAll( translationUnit, formut ); 41 acceptAll( translationUnit, lfix );42 38 } 43 39 } // namespace CodeGen -
src/ControlStruct/Mutate.h
rf9feab8 r90152a4 5 5 // file "LICENCE" distributed with Cforall. 6 6 // 7 // Mutate.h -- 7 // Mutate.h -- 8 8 // 9 9 // Author : Rodolfo G. Esteves … … 20 20 class Declaration; 21 21 22 /// Desugars Cforall control structures 22 23 namespace ControlStruct { 23 /// Desugars Cforall control structures 24 void mutate( std::list< Declaration* > translationUnit ); 24 /// normalizes label definitions and generates multi-level exit labels 25 void fixLabels( std::list< Declaration * > & translationUnit ); 26 27 /// hoist initialization out of for statements 28 void hoistControlDecls( std::list< Declaration * > & translationUnit ); 25 29 } // namespace ControlStruct 26 30 -
src/GenPoly/Box.cc
rf9feab8 r90152a4 163 163 void premutate( DeclStmt *declStmt ); 164 164 Expression *postmutate( MemberExpr *memberExpr ); 165 void premutate( AddressExpr *addrExpr ); 166 Expression *postmutate( AddressExpr *addrExpr ); 165 167 Expression *postmutate( SizeofExpr *sizeofExpr ); 166 168 Expression *postmutate( AlignofExpr *alignofExpr ); … … 182 184 /// change the type of generic aggregate members to char[] 183 185 void mutateMembers( AggregateDecl * aggrDecl ); 186 /// returns the calculated sizeof expression for ty, or nullptr for use C sizeof() 187 Expression* genSizeof( Type* ty ); 184 188 185 189 /// Enters a new scope for type-variables, adding the type variables from ty … … 193 197 ScopedSet< std::string > knownOffsets; ///< Set of non-generic types for which the offset array exists in the current scope, indexed by offsetofName 194 198 UniqueName bufNamer; ///< Namer for VLA buffers 199 Expression * addrMember = nullptr; ///< AddressExpr argument is MemberExpr? 195 200 }; 196 201 … … 215 220 inline void mutateTranslationUnit( std::list< Declaration* > &translationUnit, MutatorType &mutator ) { 216 221 bool seenIntrinsic = false; 217 SemanticError errors;222 SemanticErrorException errors; 218 223 for ( typename std::list< Declaration* >::iterator i = translationUnit.begin(); i != translationUnit.end(); ++i ) { 219 224 try { … … 228 233 assert( *i ); 229 234 } // if 230 } catch( SemanticError &e ) { 231 e.set_location( (*i)->location ); 235 } catch( SemanticErrorException &e ) { 232 236 errors.append( e ); 233 237 } // try … … 302 306 Expression *makeOp( const std::string &name, Expression *arg ) { 303 307 UntypedExpr *expr = new UntypedExpr( new NameExpr( name ) ); 304 expr-> get_args().push_back( arg );308 expr->args.push_back( arg ); 305 309 return expr; 306 310 } … … 309 313 Expression *makeOp( const std::string &name, Expression *lhs, Expression *rhs ) { 310 314 UntypedExpr *expr = new UntypedExpr( new NameExpr( name ) ); 311 expr-> get_args().push_back( lhs );312 expr-> get_args().push_back( rhs );315 expr->args.push_back( lhs ); 316 expr->args.push_back( rhs ); 313 317 return expr; 314 318 } … … 316 320 /// Returns the dereference of a local pointer variable 317 321 Expression *derefVar( ObjectDecl *var ) { 318 return makeOp( "*?",new VariableExpr( var ) );322 return UntypedExpr::createDeref( new VariableExpr( var ) ); 319 323 } 320 324 … … 380 384 unsigned long n_members = 0; 381 385 bool firstMember = true; 382 for ( std::list< Declaration* >::const_iterator member = structDecl->get_members().begin(); member != structDecl->get_members().end(); ++member) {383 DeclarationWithType *dwt = dynamic_cast< DeclarationWithType * >( *member );386 for ( Declaration* member : structDecl->get_members() ) { 387 DeclarationWithType *dwt = dynamic_cast< DeclarationWithType * >( member ); 384 388 assert( dwt ); 385 389 Type *memberType = dwt->get_type(); … … 576 580 } 577 581 } else { 578 throw SemanticError( "Cannot pass non-struct type for generic struct: ", argBaseType);582 SemanticError( argBaseType, "Cannot pass non-struct type for generic struct: " ); 579 583 } 580 584 } … … 598 602 } else { 599 603 // xxx - should this be an assertion? 600 throw SemanticError( toString( *env, "\nunbound type variable: ", tyParm->first, " in application " ), appExpr);604 SemanticError( appExpr, toString( *env, "\nunbound type variable: ", tyParm->first, " in application " ) ); 601 605 } // if 602 606 } // if … … 831 835 if ( ! isPolyType( arg->get_type() ) ) { 832 836 UntypedExpr *deref = new UntypedExpr( new NameExpr( "*?" ) ); 833 deref->get_args().push_back( new CastExpr( new VariableExpr( param ), new PointerType( Type::Qualifiers(), arg->get_type()->clone() ) ) ); 834 deref->set_result( arg->get_type()->clone() ); 837 deref->args.push_back( new CastExpr( new VariableExpr( param ), new PointerType( Type::Qualifiers(), arg->get_type()->clone() ) ) ); 838 deref->result = arg->get_type()->clone(); 839 deref->result->set_lvalue( true ); 835 840 return deref; 836 841 } // if … … 987 992 988 993 Expression *Pass1::handleIntrinsics( ApplicationExpr *appExpr ) { 989 if ( VariableExpr *varExpr = dynamic_cast< VariableExpr *>( appExpr-> get_function()) ) {990 if ( varExpr-> get_var()->get_linkage()== LinkageSpec::Intrinsic ) {991 if ( varExpr-> get_var()->get_name()== "?[?]" ) {994 if ( VariableExpr *varExpr = dynamic_cast< VariableExpr *>( appExpr->function ) ) { 995 if ( varExpr->var->linkage == LinkageSpec::Intrinsic ) { 996 if ( varExpr->var->name == "?[?]" ) { 992 997 assert( appExpr->result ); 993 998 assert( appExpr->get_args().size() == 2 ); 994 Type *baseType1 = isPolyPtr( appExpr-> get_args().front()->get_result(), scopeTyVars, env );995 Type *baseType2 = isPolyPtr( appExpr-> get_args().back()->get_result(), scopeTyVars, env );999 Type *baseType1 = isPolyPtr( appExpr->args.front()->result, scopeTyVars, env ); 1000 Type *baseType2 = isPolyPtr( appExpr->args.back()->result, scopeTyVars, env ); 996 1001 assert( ! baseType1 || ! baseType2 ); // the arguments cannot both be polymorphic pointers 997 1002 UntypedExpr *ret = 0; … … 1174 1179 if ( expr->result && isPolyType( expr->result, scopeTyVars, env ) ) { 1175 1180 if ( NameExpr *name = dynamic_cast< NameExpr *>( expr->function ) ) { 1176 if ( name-> get_name()== "*?" ) {1181 if ( name->name == "*?" ) { 1177 1182 Expression *ret = expr->args.front(); 1178 1183 expr->args.clear(); … … 1187 1192 void Pass1::premutate( AddressExpr * ) { visit_children = false; } 1188 1193 Expression * Pass1::postmutate( AddressExpr * addrExpr ) { 1189 assert( addrExpr-> get_arg()->result && ! addrExpr->get_arg()->get_result()->isVoid() );1194 assert( addrExpr->arg->result && ! addrExpr->arg->result->isVoid() ); 1190 1195 1191 1196 bool needs = false; 1192 if ( UntypedExpr *expr = dynamic_cast< UntypedExpr *>( addrExpr-> get_arg()) ) {1193 if ( expr->result && isPolyType( expr-> get_result(), scopeTyVars, env ) ) {1194 if ( NameExpr *name = dynamic_cast< NameExpr *>( expr-> get_function()) ) {1195 if ( name-> get_name()== "*?" ) {1196 if ( ApplicationExpr * appExpr = dynamic_cast< ApplicationExpr * >( expr-> get_args().front() ) ) {1197 assert( appExpr-> get_function()->result );1198 FunctionType *function = getFunctionType( appExpr-> get_function()->get_result());1197 if ( UntypedExpr *expr = dynamic_cast< UntypedExpr *>( addrExpr->arg ) ) { 1198 if ( expr->result && isPolyType( expr->result, scopeTyVars, env ) ) { 1199 if ( NameExpr *name = dynamic_cast< NameExpr *>( expr->function ) ) { 1200 if ( name->name == "*?" ) { 1201 if ( ApplicationExpr * appExpr = dynamic_cast< ApplicationExpr * >( expr->args.front() ) ) { 1202 assert( appExpr->function->result ); 1203 FunctionType *function = getFunctionType( appExpr->function->result ); 1199 1204 assert( function ); 1200 1205 needs = needsAdapter( function, scopeTyVars ); … … 1206 1211 // isPolyType check needs to happen before mutating addrExpr arg, so pull it forward 1207 1212 // out of the if condition. 1208 addrExpr->arg = addrExpr-> get_arg()->acceptMutator( *visitor );1213 addrExpr->arg = addrExpr->arg->acceptMutator( *visitor ); 1209 1214 // ... but must happen after mutate, since argument might change (e.g. intrinsic *?, ?[?]) - re-evaluate above comment 1210 bool polytype = isPolyType( addrExpr-> get_arg()->get_result(), scopeTyVars, env );1215 bool polytype = isPolyType( addrExpr->arg->result, scopeTyVars, env ); 1211 1216 if ( polytype || needs ) { 1212 Expression *ret = addrExpr-> get_arg();1213 delete ret-> get_result();1214 ret-> set_result( addrExpr->get_result()->clone());1215 addrExpr-> set_arg( 0 );1217 Expression *ret = addrExpr->arg; 1218 delete ret->result; 1219 ret->result = addrExpr->result->clone(); 1220 addrExpr->arg = nullptr; 1216 1221 delete addrExpr; 1217 1222 return ret; … … 1250 1255 1251 1256 void Pass2::addAdapters( FunctionType *functionType ) { 1252 std::list< DeclarationWithType *> ¶mList = functionType-> get_parameters();1257 std::list< DeclarationWithType *> ¶mList = functionType->parameters; 1253 1258 std::list< FunctionType *> functions; 1254 1259 for ( std::list< DeclarationWithType *>::iterator arg = paramList.begin(); arg != paramList.end(); ++arg ) { … … 1271 1276 1272 1277 DeclarationWithType * Pass2::postmutate( FunctionDecl *functionDecl ) { 1273 FunctionType * ftype = functionDecl-> get_functionType();1274 if ( ! ftype-> get_returnVals().empty() && functionDecl->get_statements()) {1275 if ( ! isPrefix( functionDecl-> get_name(), "_thunk" ) && ! isPrefix( functionDecl->get_name(), "_adapter" ) ) { // xxx - remove check for prefix once thunks properly use ctor/dtors1276 assert( ftype-> get_returnVals().size() == 1 );1277 DeclarationWithType * retval = ftype-> get_returnVals().front();1278 if ( retval-> get_name()== "" ) {1279 retval-> set_name( "_retval" );1278 FunctionType * ftype = functionDecl->type; 1279 if ( ! ftype->returnVals.empty() && functionDecl->statements ) { 1280 if ( ! isPrefix( functionDecl->name, "_thunk" ) && ! isPrefix( functionDecl->name, "_adapter" ) ) { // xxx - remove check for prefix once thunks properly use ctor/dtors 1281 assert( ftype->returnVals.size() == 1 ); 1282 DeclarationWithType * retval = ftype->returnVals.front(); 1283 if ( retval->name == "" ) { 1284 retval->name = "_retval"; 1280 1285 } 1281 functionDecl-> get_statements()->get_kids().push_front( new DeclStmt( retval ) );1286 functionDecl->statements->kids.push_front( new DeclStmt( retval ) ); 1282 1287 DeclarationWithType * newRet = retval->clone(); // for ownership purposes 1283 ftype-> get_returnVals().front() = newRet;1288 ftype->returnVals.front() = newRet; 1284 1289 } 1285 1290 } 1286 1291 // errors should have been caught by this point, remove initializers from parameters to allow correct codegen of default arguments 1287 for ( Declaration * param : functionDecl-> get_functionType()->get_parameters()) {1292 for ( Declaration * param : functionDecl->type->parameters ) { 1288 1293 if ( ObjectDecl * obj = dynamic_cast< ObjectDecl * >( param ) ) { 1289 delete obj-> get_init();1290 obj-> set_init( nullptr );1294 delete obj->init; 1295 obj->init = nullptr; 1291 1296 } 1292 1297 } … … 1554 1559 // only mutate member expressions for polymorphic types 1555 1560 int tyDepth; 1556 Type *objectType = hasPolyBase( memberExpr-> get_aggregate()->get_result(), scopeTyVars, &tyDepth );1561 Type *objectType = hasPolyBase( memberExpr->aggregate->result, scopeTyVars, &tyDepth ); 1557 1562 if ( ! objectType ) return memberExpr; 1558 1563 findGeneric( objectType ); // ensure layout for this type is available 1559 1564 1560 1565 // replace member expression with dynamically-computed layout expression 1561 Expression *newMemberExpr = 0;1566 Expression *newMemberExpr = nullptr; 1562 1567 if ( StructInstType *structType = dynamic_cast< StructInstType* >( objectType ) ) { 1563 1568 // look up offset index 1564 long i = findMember( memberExpr-> get_member(), structType->get_baseStruct()->get_members());1569 long i = findMember( memberExpr->member, structType->baseStruct->members ); 1565 1570 if ( i == -1 ) return memberExpr; 1566 1571 1567 1572 // replace member expression with pointer to base plus offset 1568 1573 UntypedExpr *fieldLoc = new UntypedExpr( new NameExpr( "?+?" ) ); 1569 Expression * aggr = memberExpr-> get_aggregate()->clone();1570 delete aggr-> get_env(); // xxx - there's a problem with keeping the env for some reason, so for now just get rid of it1571 aggr-> set_env( nullptr );1574 Expression * aggr = memberExpr->aggregate->clone(); 1575 delete aggr->env; // xxx - there's a problem with keeping the env for some reason, so for now just get rid of it 1576 aggr->env = nullptr; 1572 1577 fieldLoc->get_args().push_back( aggr ); 1573 1578 fieldLoc->get_args().push_back( makeOffsetIndex( objectType, i ) ); 1574 fieldLoc->set_result( memberExpr-> get_result()->clone() );1579 fieldLoc->set_result( memberExpr->result->clone() ); 1575 1580 newMemberExpr = fieldLoc; 1576 1581 } else if ( dynamic_cast< UnionInstType* >( objectType ) ) { 1577 1582 // union members are all at offset zero, so just use the aggregate expr 1578 Expression * aggr = memberExpr-> get_aggregate()->clone();1579 delete aggr-> get_env(); // xxx - there's a problem with keeping the env for some reason, so for now just get rid of it1580 aggr-> set_env( nullptr );1583 Expression * aggr = memberExpr->aggregate->clone(); 1584 delete aggr->env; // xxx - there's a problem with keeping the env for some reason, so for now just get rid of it 1585 aggr->env= nullptr; 1581 1586 newMemberExpr = aggr; 1582 newMemberExpr-> set_result( memberExpr->get_result()->clone());1587 newMemberExpr->result = memberExpr->result->clone(); 1583 1588 } else return memberExpr; 1584 1589 assert( newMemberExpr ); 1585 1590 1586 Type *memberType = memberExpr->get_member()->get_type(); 1591 // Must apply the generic substitution to the member type to handle cases where the member is a generic parameter substituted by a known concrete type, e.g. 1592 // forall(otype T) struct Box { T x; } 1593 // forall(otype T) f() { 1594 // Box(T *) b; b.x; 1595 // } 1596 // TODO: memberExpr->result should be exactly memberExpr->member->get_type() after substitution, so it doesn't seem like it should be necessary to apply the substitution manually. For some reason this is not currently the case. This requires more investigation. 1597 Type *memberType = memberExpr->member->get_type()->clone(); 1598 TypeSubstitution sub = objectType->genericSubstitution(); 1599 sub.apply( memberType ); 1587 1600 if ( ! isPolyType( memberType, scopeTyVars ) ) { 1588 1601 // Not all members of a polymorphic type are themselves of polymorphic type; in this case the member expression should be wrapped and dereferenced to form an lvalue … … 1592 1605 } 1593 1606 1607 delete memberType; 1594 1608 delete memberExpr; 1595 1609 return newMemberExpr; 1596 1610 } 1597 1611 1612 void PolyGenericCalculator::premutate( AddressExpr * addrExpr ) { 1613 GuardValue( addrMember ); 1614 // is the argument a MemberExpr before mutating? 1615 addrMember = dynamic_cast< MemberExpr * >( addrExpr->arg ); 1616 } 1617 1618 Expression * PolyGenericCalculator::postmutate( AddressExpr * addrExpr ) { 1619 if ( addrMember && addrMember != addrExpr->arg ) { 1620 // arg was a MemberExpr and has been mutated 1621 if ( UntypedExpr * untyped = dynamic_cast< UntypedExpr * >( addrExpr->arg ) ) { 1622 if ( InitTweak::getFunctionName( untyped ) == "?+?" ) { 1623 // MemberExpr was converted to pointer+offset, and it is not valid C to take the address of an addition, so strip the address-of 1624 // TODO: should addrExpr->arg->result be changed to addrExpr->result? 1625 Expression * ret = addrExpr->arg; 1626 addrExpr->arg = nullptr; 1627 std::swap( addrExpr->env, ret->env ); 1628 delete addrExpr; 1629 return ret; 1630 } 1631 } 1632 } 1633 return addrExpr; 1634 } 1635 1598 1636 ObjectDecl *PolyGenericCalculator::makeVar( const std::string &name, Type *type, Initializer *init ) { 1599 ObjectDecl *newObj = new ObjectDecl( name, Type::StorageClasses(), LinkageSpec::C, 0, type, init );1637 ObjectDecl *newObj = new ObjectDecl( name, Type::StorageClasses(), LinkageSpec::C, nullptr, type, init ); 1600 1638 stmtsToAddBefore.push_back( new DeclStmt( newObj ) ); 1601 1639 return newObj; … … 1711 1749 } 1712 1750 1751 Expression * PolyGenericCalculator::genSizeof( Type* ty ) { 1752 if ( ArrayType * aty = dynamic_cast<ArrayType *>(ty) ) { 1753 // generate calculated size for possibly generic array 1754 Expression * sizeofBase = genSizeof( aty->get_base() ); 1755 if ( ! sizeofBase ) return nullptr; 1756 Expression * dim = aty->get_dimension(); 1757 aty->set_dimension( nullptr ); 1758 return makeOp( "?*?", sizeofBase, dim ); 1759 } else if ( findGeneric( ty ) ) { 1760 // generate calculated size for generic type 1761 return new NameExpr( sizeofName( mangleType( ty ) ) ); 1762 } else return nullptr; 1763 } 1764 1713 1765 Expression *PolyGenericCalculator::postmutate( SizeofExpr *sizeofExpr ) { 1714 Type *ty = sizeofExpr->get_isType() ? sizeofExpr->get_type() : sizeofExpr->get_expr()->get_result(); 1715 if ( findGeneric( ty ) ) { 1716 Expression *ret = new NameExpr( sizeofName( mangleType( ty ) ) ); 1766 Type *ty = sizeofExpr->get_isType() ? 1767 sizeofExpr->get_type() : sizeofExpr->get_expr()->get_result(); 1768 1769 Expression * gen = genSizeof( ty ); 1770 if ( gen ) { 1717 1771 delete sizeofExpr; 1718 return ret; 1719 } 1720 return sizeofExpr; 1772 return gen; 1773 } else return sizeofExpr; 1721 1774 } 1722 1775 -
src/GenPoly/FindFunction.cc
rf9feab8 r90152a4 19 19 20 20 #include "Common/PassVisitor.h" // for PassVisitor 21 #include "Common/SemanticError.h" // for SemanticError22 21 #include "GenPoly/ErasableScopedMap.h" // for ErasableScopedMap<>::iterator 23 22 #include "GenPoly/GenPoly.h" // for TyVarMap -
src/GenPoly/GenPoly.cc
rf9feab8 r90152a4 100 100 if ( dynamic_cast< TypeInstType * >( type ) ) { 101 101 return type; 102 } else if ( ArrayType * arrayType = dynamic_cast< ArrayType * >( type ) ) { 103 return isPolyType( arrayType->base, env ); 102 104 } else if ( StructInstType *structType = dynamic_cast< StructInstType* >( type ) ) { 103 105 if ( hasPolyParams( structType->get_parameters(), env ) ) return type; … … 115 117 return type; 116 118 } 119 } else if ( ArrayType * arrayType = dynamic_cast< ArrayType * >( type ) ) { 120 return isPolyType( arrayType->base, tyVars, env ); 117 121 } else if ( StructInstType *structType = dynamic_cast< StructInstType* >( type ) ) { 118 122 if ( hasPolyParams( structType->get_parameters(), tyVars, env ) ) return type; … … 367 371 return is<VoidType>( ap->get_base() ) || is<VoidType>( bp->get_base() ) 368 372 || typesPolyCompatible( ap->get_base(), bp->get_base() ); 373 } else if ( aid == type_index{typeid(ReferenceType)} ) { 374 ReferenceType *ap = as<ReferenceType>(a), *bp = as<ReferenceType>(b); 375 return is<VoidType>( ap->get_base() ) || is<VoidType>( bp->get_base() ) 376 || typesPolyCompatible( ap->get_base(), bp->get_base() ); 369 377 } else if ( aid == type_index{typeid(ArrayType)} ) { 370 378 ArrayType *aa = as<ArrayType>(a), *ba = as<ArrayType>(b); -
src/GenPoly/InstantiateGeneric.cc
rf9feab8 r90152a4 24 24 #include "Common/PassVisitor.h" // for PassVisitor, WithDeclsToAdd 25 25 #include "Common/ScopedMap.h" // for ScopedMap 26 #include "Common/SemanticError.h" // for SemanticError27 26 #include "Common/UniqueName.h" // for UniqueName 28 27 #include "Common/utility.h" // for deleteAll, cloneAll … … 476 475 DeclarationWithType * field = strict_dynamic_cast< DeclarationWithType * >( member ); 477 476 MemberExpr * ret = new MemberExpr( field, memberExpr->aggregate->clone() ); 477 ResolvExpr::adjustExprType( ret->result ); // pointer decay 478 478 std::swap( ret->env, memberExpr->env ); 479 479 delete memberExpr; … … 496 496 Expression * FixDtypeStatic::fixMemberExpr( AggrInst * inst, MemberExpr * memberExpr ) { 497 497 // need to cast dtype-static member expressions to their actual type before that type is erased. 498 // NOTE: the casts here have the third argument (isGenerated) set to false so that these casts persist until Box, where they are needed. 498 499 auto & baseParams = *inst->get_baseParameters(); 499 500 if ( isDtypeStatic( baseParams ) ) { … … 515 516 // Note: this currently creates more temporaries than is strictly necessary, since it does not check for duplicate uses of the same member expression. 516 517 static UniqueName tmpNamer( "_dtype_static_member_" ); 517 Expression * init = new CastExpr( new AddressExpr( memberExpr ), new PointerType( Type::Qualifiers(), concType->clone() ) );518 Expression * init = new CastExpr( new AddressExpr( memberExpr ), new PointerType( Type::Qualifiers(), concType->clone() ), false ); 518 519 ObjectDecl * tmp = ObjectDecl::newObject( tmpNamer.newName(), new ReferenceType( Type::Qualifiers(), concType ), new SingleInit( init ) ); 519 520 stmtsToAddBefore.push_back( new DeclStmt( tmp ) ); … … 521 522 } else { 522 523 // can simply add a cast to actual type 523 return new CastExpr( memberExpr, concType );524 return new CastExpr( memberExpr, concType, false ); 524 525 } 525 526 } -
src/GenPoly/Lvalue.cc
rf9feab8 r90152a4 18 18 19 19 #include "Common/PassVisitor.h" 20 #include "Common/SemanticError.h" // for SemanticError21 20 #include "GenPoly.h" // for isPolyType 22 21 #include "Lvalue.h" … … 46 45 Expression * mkDeref( Expression * arg ) { 47 46 if ( SymTab::dereferenceOperator ) { 47 // note: reference depth can be arbitrarily deep here, so peel off the outermost pointer/reference, not just pointer because they are effecitvely equivalent in this pass 48 48 VariableExpr * deref = new VariableExpr( SymTab::dereferenceOperator ); 49 deref-> set_result( new PointerType( Type::Qualifiers(), deref->get_result() ));50 Type * base = InitTweak::getPointerBase( arg-> get_result());51 assertf( base, "expected pointer type in dereference (type was %s)", toString( arg-> get_result()).c_str() );49 deref->result = new PointerType( Type::Qualifiers(), deref->result ); 50 Type * base = InitTweak::getPointerBase( arg->result ); 51 assertf( base, "expected pointer type in dereference (type was %s)", toString( arg->result ).c_str() ); 52 52 ApplicationExpr * ret = new ApplicationExpr( deref, { arg } ); 53 delete ret-> get_result();54 ret-> set_result( base->clone());55 ret-> get_result()->set_lvalue( true );53 delete ret->result; 54 ret->result = base->clone(); 55 ret->result->set_lvalue( true ); 56 56 return ret; 57 57 } else { … … 60 60 } 61 61 62 struct ReferenceConversions final {62 struct ReferenceConversions final : public WithStmtsToAdd { 63 63 Expression * postmutate( CastExpr * castExpr ); 64 64 Expression * postmutate( AddressExpr * addrExpr ); … … 98 98 }; 99 99 100 struct AddrRef final : public WithGuards {100 struct AddrRef final : public WithGuards, public WithVisitorRef<AddrRef>, public WithShortCircuiting { 101 101 void premutate( AddressExpr * addrExpr ); 102 102 Expression * postmutate( AddressExpr * addrExpr ); 103 103 void premutate( Expression * expr ); 104 void premutate( ApplicationExpr * appExpr ); 105 void premutate( SingleInit * init ); 106 107 void handleNonAddr( Expression * ); 104 108 105 109 bool first = true; 106 110 bool current = false; 107 111 int refDepth = 0; 112 bool addCast = false; 108 113 }; 109 114 } // namespace … … 115 120 } 116 121 117 void convertLvalue( std::list< Declaration* > & translationUnit ) {122 void convertLvalue( std::list< Declaration* > & translationUnit ) { 118 123 PassVisitor<ReferenceConversions> refCvt; 119 124 PassVisitor<ReferenceTypeElimination> elim; … … 141 146 142 147 namespace { 143 // true for intrinsic function calls that return a reference148 // true for intrinsic function calls that return an lvalue in C 144 149 bool isIntrinsicReference( Expression * expr ) { 150 // known intrinsic-reference prelude functions 151 static std::set<std::string> lvalueFunctions = { "*?", "?[?]" }; 145 152 if ( UntypedExpr * untyped = dynamic_cast< UntypedExpr * >( expr ) ) { 146 153 std::string fname = InitTweak::getFunctionName( untyped ); 147 // known intrinsic-reference prelude functions 148 return fname == "*?" || fname == "?[?]"; 154 return lvalueFunctions.count(fname); 149 155 } else if ( ApplicationExpr * appExpr = dynamic_cast< ApplicationExpr * > ( expr ) ) { 150 156 if ( DeclarationWithType * func = InitTweak::getFunction( appExpr ) ) { 151 // use type of return variable rather than expr result type, since it may have been changed to a pointer type 152 FunctionType * ftype = GenPoly::getFunctionType( func->get_type() ); 153 Type * ret = ftype->get_returnVals().empty() ? nullptr : ftype->get_returnVals().front()->get_type(); 154 return func->get_linkage() == LinkageSpec::Intrinsic && dynamic_cast<ReferenceType *>( ret ); 157 return func->linkage == LinkageSpec::Intrinsic && lvalueFunctions.count(func->name); 155 158 } 156 159 } … … 161 164 if ( isIntrinsicReference( appExpr ) ) { 162 165 // eliminate reference types from intrinsic applications - now they return lvalues 163 Type * result = appExpr->get_result();164 appExpr-> set_result( result->stripReferences()->clone());165 appExpr-> get_result()->set_lvalue( true );166 ReferenceType * result = strict_dynamic_cast< ReferenceType * >( appExpr->result ); 167 appExpr->result = result->base->clone(); 168 appExpr->result->set_lvalue( true ); 166 169 if ( ! inIntrinsic ) { 167 170 // when not in an intrinsic function, add a cast to 168 171 // don't add cast when in an intrinsic function, since they already have the cast 169 172 Expression * ret = new CastExpr( appExpr, result ); 170 ret->set_env( appExpr->get_env() ); 171 appExpr->set_env( nullptr ); 173 std::swap( ret->env, appExpr->env ); 172 174 return ret; 173 175 } … … 179 181 void FixIntrinsicResult::premutate( FunctionDecl * funcDecl ) { 180 182 GuardValue( inIntrinsic ); 181 inIntrinsic = funcDecl->linkage == LinkageSpec::Intrinsic;183 inIntrinsic = funcDecl->linkage == LinkageSpec::Intrinsic; 182 184 } 183 185 … … 188 190 assertf( ftype, "Function declaration does not have function type." ); 189 191 // can be of differing lengths only when function is variadic 190 assertf( ftype-> get_parameters().size() == appExpr->get_args().size() || ftype->get_isVarArgs(), "ApplicationExpr args do not match formal parameter type." );192 assertf( ftype->parameters.size() == appExpr->args.size() || ftype->isVarArgs, "ApplicationExpr args do not match formal parameter type." ); 191 193 192 194 193 195 unsigned int i = 0; 194 const unsigned int end = ftype-> get_parameters().size();195 for ( auto p : unsafe_group_iterate( appExpr-> get_args(), ftype->get_parameters()) ) {196 const unsigned int end = ftype->parameters.size(); 197 for ( auto p : unsafe_group_iterate( appExpr->args, ftype->parameters ) ) { 196 198 if (i == end) break; 197 199 Expression *& arg = std::get<0>( p ); … … 199 201 PRINT( 200 202 std::cerr << "pair<0>: " << arg << std::endl; 203 std::cerr << " -- " << arg->result << std::endl; 201 204 std::cerr << "pair<1>: " << formal << std::endl; 202 205 ) 203 206 if ( dynamic_cast<ReferenceType*>( formal ) ) { 204 if ( isIntrinsicReference( arg ) ) { // do not combine conditions, because that changes the meaning of the else if 205 if ( function->get_linkage() != LinkageSpec::Intrinsic ) { // intrinsic functions that turn pointers into references 206 // if argument is dereference or array subscript, the result isn't REALLY a reference, so it's not necessary to fix the argument 207 PRINT( 208 std::cerr << "===is intrinsic arg in non-intrinsic call - adding address" << std::endl; 209 ) 210 arg = new AddressExpr( arg ); 211 } 212 } else if ( function->get_linkage() == LinkageSpec::Intrinsic ) { 213 // std::cerr << "===adding deref to arg" << std::endl; 214 // if the parameter is a reference, add a dereference to the reference-typed argument. 215 Type * baseType = InitTweak::getPointerBase( arg->get_result() ); 216 assertf( baseType, "parameter is reference, arg must be pointer or reference: %s", toString( arg->get_result() ).c_str() ); 207 PRINT( 208 std::cerr << "===formal is reference" << std::endl; 209 ) 210 // TODO: it's likely that the second condition should be ... && ! isIntrinsicReference( arg ), but this requires investigation. 211 212 if ( function->linkage != LinkageSpec::Intrinsic && isIntrinsicReference( arg ) ) { 213 // needed for definition of prelude functions, etc. 214 // if argument is dereference or array subscript, the result isn't REALLY a reference, but non-intrinsic functions expect a reference: take address 215 216 // NOTE: previously, this condition fixed 217 // void f(int *&); 218 // int & x = ...; 219 // f(&x); 220 // But now this is taken care of by a reference cast added by AddrRef. Need to find a new 221 // example or remove this branch. 222 223 PRINT( 224 std::cerr << "===is intrinsic arg in non-intrinsic call - adding address" << std::endl; 225 ) 226 arg = new AddressExpr( arg ); 227 // } else if ( function->get_linkage() == LinkageSpec::Intrinsic && InitTweak::getPointerBase( arg->result ) ) { 228 } else if ( function->linkage == LinkageSpec::Intrinsic && arg->result->referenceDepth() != 0 ) { 229 // argument is a 'real' reference, but function expects a C lvalue: add a dereference to the reference-typed argument 230 PRINT( 231 std::cerr << "===is non-intrinsic arg in intrinsic call - adding deref to arg" << std::endl; 232 ) 233 Type * baseType = InitTweak::getPointerBase( arg->result ); 234 assertf( baseType, "parameter is reference, arg must be pointer or reference: %s", toString( arg->result ).c_str() ); 217 235 PointerType * ptrType = new PointerType( Type::Qualifiers(), baseType->clone() ); 218 delete arg-> get_result();219 arg-> set_result( ptrType );236 delete arg->result; 237 arg->result = ptrType; 220 238 arg = mkDeref( arg ); 239 // assertf( arg->result->referenceDepth() == 0, "Reference types should have been eliminated from intrinsic function calls, but weren't: %s", toCString( arg->result ) ); 221 240 } 222 241 } … … 228 247 229 248 // idea: &&&E: get outer &, inner & 230 // at inner &, record depth D of reference type 249 // at inner &, record depth D of reference type of argument of & 231 250 // at outer &, add D derefs. 232 void AddrRef::premutate( Expression * ) { 251 void AddrRef::handleNonAddr( Expression * ) { 252 // non-address-of: reset status variables: 253 // * current expr is NOT the first address-of expr in an address-of chain 254 // * next seen address-of expr IS the first in the chain. 233 255 GuardValue( current ); 234 256 GuardValue( first ); … … 237 259 } 238 260 261 void AddrRef::premutate( Expression * expr ) { 262 handleNonAddr( expr ); 263 GuardValue( addCast ); 264 addCast = false; 265 } 266 239 267 void AddrRef::premutate( AddressExpr * ) { 240 268 GuardValue( current ); 241 269 GuardValue( first ); 242 current = first; 243 first = false; 244 if ( current ) { 270 current = first; // is this the first address-of in the chain? 271 first = false; // from here out, no longer possible for next address-of to be first in chain 272 if ( current ) { // this is the outermost address-of in a chain 245 273 GuardValue( refDepth ); 246 refDepth = 0; 274 refDepth = 0; // set depth to 0 so that postmutate can find the innermost address-of easily 247 275 } 248 276 } 249 277 250 278 Expression * AddrRef::postmutate( AddressExpr * addrExpr ) { 279 PRINT( std::cerr << "addr ref at " << addrExpr << std::endl; ) 251 280 if ( refDepth == 0 ) { 252 if ( ! isIntrinsicReference( addrExpr->get_arg() ) ) { 281 PRINT( std::cerr << "depth 0, get new depth..." << std::endl; ) 282 // this is the innermost address-of in a chain, record depth D 283 if ( ! isIntrinsicReference( addrExpr->arg ) ) { 253 284 // try to avoid ?[?] 254 refDepth = addrExpr->get_arg()->get_result()->referenceDepth(); 255 } 256 } 257 if ( current ) { 285 // xxx - is this condition still necessary? intrinsicReferences should have a cast around them at this point, so I don't think this condition ever fires. 286 refDepth = addrExpr->arg->result->referenceDepth(); 287 PRINT( std::cerr << "arg not intrinsic reference, new depth is: " << refDepth << std::endl; ) 288 } else { 289 assertf( false, "AddrRef : address-of should not have intrinsic reference argument: %s", toCString( addrExpr->arg ) ); 290 } 291 } 292 if ( current ) { // this is the outermost address-of in a chain 293 PRINT( std::cerr << "current, depth is: " << refDepth << std::endl; ) 258 294 Expression * ret = addrExpr; 259 295 while ( refDepth ) { 296 // add one dereference for each 260 297 ret = mkDeref( ret ); 261 298 refDepth--; 262 299 } 300 301 // if addrExpr depth is 0, then the result is a pointer because the arg was depth 1 and not lvalue. 302 // This means the dereference result is not a reference, is lvalue, and one less pointer depth than 303 // the addrExpr. Thus the cast is meaningless. 304 // TODO: One thing to double check is whether it is possible for the types to differ outside of the single 305 // pointer level (i.e. can the base type of addrExpr differ from the type of addrExpr-arg?). 306 // If so then the cast might need to be added, conditional on a more sophisticated check. 307 if ( addCast && addrExpr->result->referenceDepth() != 0 ) { 308 PRINT( std::cerr << "adding cast to " << addrExpr->result << std::endl; ) 309 return new CastExpr( ret, addrExpr->result->clone() ); 310 } 263 311 return ret; 264 312 } 313 PRINT( std::cerr << "not current..." << std::endl; ) 265 314 return addrExpr; 266 315 } 316 317 void AddrRef::premutate( ApplicationExpr * appExpr ) { 318 visit_children = false; 319 GuardValue( addCast ); 320 handleNonAddr( appExpr ); 321 for ( Expression *& arg : appExpr->args ) { 322 // each argument with address-of requires a cast 323 addCast = true; 324 arg = arg->acceptMutator( *visitor ); 325 } 326 } 327 328 void AddrRef::premutate( SingleInit * ) { 329 GuardValue( addCast ); 330 // each initialization context with address-of requires a cast 331 addCast = true; 332 } 333 267 334 268 335 Expression * ReferenceConversions::postmutate( AddressExpr * addrExpr ) { … … 281 348 // pointer casts in the right places. 282 349 283 // conversion to reference type 284 if ( ReferenceType * refType = dynamic_cast< ReferenceType * >( castExpr->get_result() ) ) { 285 (void)refType; 286 if ( ReferenceType * otherRef = dynamic_cast< ReferenceType * >( castExpr->get_arg()->get_result() ) ) { 287 // nothing to do if casting from reference to reference. 288 (void)otherRef; 289 PRINT( std::cerr << "convert reference to reference -- nop" << std::endl; ) 290 if ( isIntrinsicReference( castExpr->get_arg() ) ) { 291 Expression * callExpr = castExpr->get_arg(); 292 PRINT( 293 std::cerr << "but arg is deref -- &" << std::endl; 294 std::cerr << callExpr << std::endl; 295 ) 296 callExpr = new AddressExpr( callExpr ); // this doesn't work properly for multiple casts 297 delete callExpr->get_result(); 298 callExpr->set_result( refType->clone() ); 299 // move environment out to new top-level 300 callExpr->set_env( castExpr->get_env() ); 301 castExpr->set_arg( nullptr ); 302 castExpr->set_env( nullptr ); 303 delete castExpr; 304 return callExpr; 305 } 306 int depth1 = refType->referenceDepth(); 307 int depth2 = otherRef->referenceDepth(); 308 int diff = depth1-depth2; 309 if ( diff == 0 ) { 310 assertf( depth1 == depth2, "non-intrinsic reference with cast of reference to reference not yet supported: %d %d %s", depth1, depth2, toString( castExpr ).c_str() ); 311 PRINT( std::cerr << castExpr << std::endl; ) 312 return castExpr; 313 } else if ( diff < 0 ) { 314 Expression * ret = castExpr->get_arg(); 315 for ( int i = 0; i < diff; ++i ) { 316 ret = mkDeref( ret ); 317 } 318 ret->set_env( castExpr->get_env() ); 319 delete ret->get_result(); 320 ret->set_result( castExpr->get_result() ); 321 castExpr->set_env( nullptr ); 322 castExpr->set_arg( nullptr ); 323 castExpr->set_result( nullptr ); 324 delete castExpr; 325 return ret; 326 } else if ( diff > 0 ) { 327 Expression * ret = castExpr->get_arg(); 328 for ( int i = 0; i < diff; ++i ) { 329 ret = new AddressExpr( ret ); 330 } 331 ret->set_env( castExpr->get_env() ); 332 delete ret->get_result(); 333 ret->set_result( castExpr->get_result() ); 334 castExpr->set_env( nullptr ); 335 castExpr->set_arg( nullptr ); 336 castExpr->set_result( nullptr ); 337 delete castExpr; 338 return ret; 339 } 340 341 assertf( depth1 == depth2, "non-intrinsic reference with cast of reference to reference not yet supported: %d %d %s", depth1, depth2, toString( castExpr ).c_str() ); 342 PRINT( std::cerr << castExpr << std::endl; ) 350 // Note: reference depth difference is the determining factor in what code is run, rather than whether something is 351 // reference type or not, since conversion still needs to occur when both types are references that differ in depth. 352 353 Type * destType = castExpr->result; 354 Type * srcType = castExpr->arg->result; 355 int depth1 = destType->referenceDepth(); 356 int depth2 = srcType->referenceDepth(); 357 int diff = depth1 - depth2; 358 359 if ( diff > 0 && ! srcType->get_lvalue() ) { 360 // rvalue to reference conversion -- introduce temporary 361 // know that reference depth of cast argument is 0, need to introduce n temporaries for reference depth of n, e.g. 362 // (int &&&)3; 363 // becomes 364 // int __ref_tmp_0 = 3; 365 // int & __ref_tmp_1 = _&_ref_tmp_0; 366 // int && __ref_tmp_2 = &__ref_tmp_1; 367 // &__ref_tmp_2; 368 // the last & comes from the remaining reference conversion code 369 SemanticWarning( castExpr->arg->location, Warning::RvalueToReferenceConversion, toCString( castExpr->arg ) ); 370 371 static UniqueName tempNamer( "__ref_tmp_" ); 372 ObjectDecl * temp = ObjectDecl::newObject( tempNamer.newName(), castExpr->arg->result->clone(), new SingleInit( castExpr->arg ) ); 373 PRINT( std::cerr << "made temp: " << temp << std::endl; ) 374 stmtsToAddBefore.push_back( new DeclStmt( temp ) ); 375 for ( int i = 0; i < depth1-1; i++ ) { // xxx - maybe this should be diff-1? check how this works with reference type for srcType 376 ObjectDecl * newTemp = ObjectDecl::newObject( tempNamer.newName(), new ReferenceType( Type::Qualifiers(), temp->type->clone() ), new SingleInit( new AddressExpr( new VariableExpr( temp ) ) ) ); 377 PRINT( std::cerr << "made temp" << i << ": " << newTemp << std::endl; ) 378 stmtsToAddBefore.push_back( new DeclStmt( newTemp ) ); 379 temp = newTemp; 380 } 381 // update diff so that remaining code works out correctly 382 castExpr->arg = new VariableExpr( temp ); 383 PRINT( std::cerr << "update cast to: " << castExpr << std::endl; ) 384 srcType = castExpr->arg->result; 385 depth2 = srcType->referenceDepth(); 386 diff = depth1 - depth2; 387 assert( diff == 1 ); 388 } 389 390 // handle conversion between different depths 391 PRINT ( 392 if ( depth1 || depth2 ) { 393 std::cerr << "destType: " << destType << " / srcType: " << srcType << std::endl; 394 std::cerr << "depth: " << depth1 << " / " << depth2 << std::endl; 395 } 396 ) 397 if ( diff > 0 ) { 398 // conversion to type with more depth (e.g. int & -> int &&): add address-of for each level of difference 399 Expression * ret = castExpr->arg; 400 for ( int i = 0; i < diff; ++i ) { 401 ret = new AddressExpr( ret ); 402 } 403 if ( srcType->get_lvalue() && ! ResolvExpr::typesCompatible( srcType, strict_dynamic_cast<ReferenceType *>( destType )->base, SymTab::Indexer() ) ) { 404 // must keep cast if cast-to type is different from the actual type 405 castExpr->arg = ret; 343 406 return castExpr; 344 } else if ( castExpr->get_arg()->get_result()->get_lvalue() ) { 345 // conversion from lvalue to reference 346 // xxx - keep cast, but turn into pointer cast?? 347 // xxx - memory 407 } 408 ret->env = castExpr->env; 409 delete ret->result; 410 ret->result = castExpr->result; 411 castExpr->env = nullptr; 412 castExpr->arg = nullptr; 413 castExpr->result = nullptr; 414 delete castExpr; 415 return ret; 416 } else if ( diff < 0 ) { 417 // conversion to type with less depth (e.g. int && -> int &): add dereferences for each level of difference 418 diff = -diff; // care only about magnitude now 419 Expression * ret = castExpr->arg; 420 for ( int i = 0; i < diff; ++i ) { 421 ret = mkDeref( ret ); 422 // xxx - try removing one reference here? actually, looks like mkDeref already does this, so more closely look at the types generated. 423 } 424 if ( ! ResolvExpr::typesCompatibleIgnoreQualifiers( destType->stripReferences(), srcType->stripReferences(), SymTab::Indexer() ) ) { 425 // must keep cast if types are different 426 castExpr->arg = ret; 427 return castExpr; 428 } 429 ret->env = castExpr->env; 430 delete ret->result; 431 ret->result = castExpr->result; 432 ret->result->set_lvalue( true ); // ensure result is lvalue 433 castExpr->env = nullptr; 434 castExpr->arg = nullptr; 435 castExpr->result = nullptr; 436 delete castExpr; 437 return ret; 438 } else { 439 assert( diff == 0 ); 440 // conversion between references of the same depth 441 if ( ResolvExpr::typesCompatible( castExpr->result, castExpr->arg->result, SymTab::Indexer() ) && castExpr->isGenerated ) { 442 // Remove useless generated casts 348 443 PRINT( 349 std::cerr << "convert lvalue to reference -- &" << std::endl; 350 std::cerr << castExpr->get_arg() << std::endl; 444 std::cerr << "types are compatible, removing cast: " << castExpr << std::endl; 445 std::cerr << "-- " << castExpr->result << std::endl; 446 std::cerr << "-- " << castExpr->arg->result << std::endl; 351 447 ) 352 AddressExpr * ret = new AddressExpr( castExpr->get_arg() ); 353 if ( refType->get_base()->get_qualifiers() != castExpr->get_arg()->get_result()->get_qualifiers() ) { 354 // must keep cast if cast-to type is different from the actual type 355 castExpr->set_arg( ret ); 356 return castExpr; 357 } 358 ret->set_env( castExpr->get_env() ); 359 delete ret->get_result(); 360 ret->set_result( castExpr->get_result() ); 361 castExpr->set_env( nullptr ); 362 castExpr->set_arg( nullptr ); 363 castExpr->set_result( nullptr ); 448 Expression * ret = castExpr->arg; 449 castExpr->arg = nullptr; 450 std::swap( castExpr->env, ret->env ); 364 451 delete castExpr; 365 452 return ret; 366 } else { 367 // rvalue to reference conversion -- introduce temporary 368 } 369 assertf( false, "Only conversions to reference from lvalue are currently supported: %s", toString( castExpr ).c_str() ); 370 } else if ( ReferenceType * refType = dynamic_cast< ReferenceType * >( castExpr->get_arg()->get_result() ) ) { 371 (void)refType; 372 // conversion from reference to rvalue 373 PRINT( 374 std::cerr << "convert reference to rvalue -- *" << std::endl; 375 std::cerr << "was = " << castExpr << std::endl; 376 ) 377 Expression * ret = castExpr->get_arg(); 378 TypeSubstitution * env = castExpr->get_env(); 379 castExpr->set_env( nullptr ); 380 if ( ! isIntrinsicReference( ret ) ) { 381 // dereference if not already dereferenced 382 ret = mkDeref( ret ); 383 } 384 if ( ResolvExpr::typesCompatibleIgnoreQualifiers( castExpr->get_result(), castExpr->get_arg()->get_result()->stripReferences(), SymTab::Indexer() ) ) { 385 // can remove cast if types are compatible, changing expression type to value type 386 ret->set_result( castExpr->get_result()->clone() ); 387 castExpr->set_arg( nullptr ); 388 delete castExpr; 389 } else { 390 // must keep cast if types are different 391 castExpr->set_arg( ret ); 392 ret = castExpr; 393 } 394 ret->set_env( env ); 395 PRINT( std::cerr << "now: " << ret << std::endl; ) 396 return ret; 397 } 398 return castExpr; 453 } 454 return castExpr; 455 } 399 456 } 400 457 401 458 Type * ReferenceTypeElimination::postmutate( ReferenceType * refType ) { 402 Type * base = refType-> get_base();459 Type * base = refType->base; 403 460 Type::Qualifiers qualifiers = refType->get_qualifiers(); 404 refType-> set_base( nullptr );461 refType->base = nullptr; 405 462 delete refType; 406 463 return new PointerType( qualifiers, base ); … … 410 467 Expression * GeneralizedLvalue::applyTransformation( Expression * expr, Expression * arg, Func mkExpr ) { 411 468 if ( CommaExpr * commaExpr = dynamic_cast< CommaExpr * >( arg ) ) { 412 Expression * arg1 = commaExpr-> get_arg1()->clone();413 Expression * arg2 = commaExpr-> get_arg2()->clone();469 Expression * arg1 = commaExpr->arg1->clone(); 470 Expression * arg2 = commaExpr->arg2->clone(); 414 471 Expression * ret = new CommaExpr( arg1, mkExpr( arg2 )->acceptMutator( *visitor ) ); 415 ret-> set_env( expr->get_env() );416 expr-> set_env( nullptr );472 ret->env = expr->env; 473 expr->env = nullptr; 417 474 delete expr; 418 475 return ret; 419 476 } else if ( ConditionalExpr * condExpr = dynamic_cast< ConditionalExpr * >( arg ) ) { 420 Expression * arg1 = condExpr-> get_arg1()->clone();421 Expression * arg2 = condExpr-> get_arg2()->clone();422 Expression * arg3 = condExpr-> get_arg3()->clone();477 Expression * arg1 = condExpr->arg1->clone(); 478 Expression * arg2 = condExpr->arg2->clone(); 479 Expression * arg3 = condExpr->arg3->clone(); 423 480 ConditionalExpr * ret = new ConditionalExpr( arg1, mkExpr( arg2 )->acceptMutator( *visitor ), mkExpr( arg3 )->acceptMutator( *visitor ) ); 424 ret-> set_env( expr->get_env() );425 expr-> set_env( nullptr );481 ret->env = expr->env; 482 expr->env = nullptr; 426 483 delete expr; 427 484 … … 432 489 AssertionSet needAssertions, haveAssertions; 433 490 OpenVarSet openVars; 434 unify( ret-> get_arg2()->get_result(), ret->get_arg3()->get_result(), newEnv, needAssertions, haveAssertions, openVars, SymTab::Indexer(), commonType );435 ret-> set_result( commonType ? commonType : ret->get_arg2()->get_result()->clone());491 unify( ret->arg2->result, ret->arg3->result, newEnv, needAssertions, haveAssertions, openVars, SymTab::Indexer(), commonType ); 492 ret->result = commonType ? commonType : ret->arg2->result->clone(); 436 493 return ret; 437 494 } … … 440 497 441 498 Expression * GeneralizedLvalue::postmutate( MemberExpr * memExpr ) { 442 return applyTransformation( memExpr, memExpr-> get_aggregate(), [=]( Expression * aggr ) { return new MemberExpr( memExpr->get_member(), aggr ); } );499 return applyTransformation( memExpr, memExpr->aggregate, [=]( Expression * aggr ) { return new MemberExpr( memExpr->member, aggr ); } ); 443 500 } 444 501 445 502 Expression * GeneralizedLvalue::postmutate( AddressExpr * addrExpr ) { 446 return applyTransformation( addrExpr, addrExpr-> get_arg(), []( Expression * arg ) { return new AddressExpr( arg ); } );503 return applyTransformation( addrExpr, addrExpr->arg, []( Expression * arg ) { return new AddressExpr( arg ); } ); 447 504 } 448 505 449 506 Expression * CollapseAddrDeref::postmutate( AddressExpr * addrExpr ) { 450 Expression * arg = addrExpr-> get_arg();507 Expression * arg = addrExpr->arg; 451 508 if ( isIntrinsicReference( arg ) ) { 452 509 std::string fname = InitTweak::getFunctionName( arg ); … … 454 511 Expression *& arg0 = InitTweak::getCallArg( arg, 0 ); 455 512 Expression * ret = arg0; 456 ret->set_env( addrExpr-> get_env());513 ret->set_env( addrExpr->env ); 457 514 arg0 = nullptr; 458 addrExpr-> set_env( nullptr );515 addrExpr->env = nullptr; 459 516 delete addrExpr; 460 517 return ret; 518 } 519 } else if ( CastExpr * castExpr = dynamic_cast< CastExpr * > ( arg ) ) { 520 // need to move cast to pointer type out a level since address of pointer 521 // is not valid C code (can be introduced in prior passes, e.g., InstantiateGeneric) 522 if ( InitTweak::getPointerBase( castExpr->result ) ) { 523 addrExpr->arg = castExpr->arg; 524 castExpr->arg = addrExpr; 525 castExpr->result = new PointerType( Type::Qualifiers(), castExpr->result ); 526 return castExpr; 461 527 } 462 528 } … … 474 540 // } 475 541 if ( AddressExpr * addrExpr = dynamic_cast< AddressExpr * >( arg ) ) { 476 Expression * ret = addrExpr-> get_arg();477 ret-> set_env( appExpr->get_env() );478 addrExpr-> set_arg( nullptr );479 appExpr-> set_env( nullptr );542 Expression * ret = addrExpr->arg; 543 ret->env = appExpr->env; 544 addrExpr->arg = nullptr; 545 appExpr->env = nullptr; 480 546 delete appExpr; 481 547 return ret; -
src/GenPoly/ScrubTyVars.cc
rf9feab8 r90152a4 25 25 26 26 namespace GenPoly { 27 Type * ScrubTyVars:: mutate( TypeInstType *typeInst ) {27 Type * ScrubTyVars::postmutate( TypeInstType * typeInst ) { 28 28 if ( ! tyVars ) { 29 29 if ( typeInst->get_isFtype() ) { … … 31 31 return new PointerType( Type::Qualifiers(), new FunctionType( Type::Qualifiers(), true ) ); 32 32 } else { 33 PointerType * ret = new PointerType( Type::Qualifiers(), new VoidType( typeInst->get_qualifiers() ) );33 PointerType * ret = new PointerType( Type::Qualifiers(), new VoidType( typeInst->get_qualifiers() ) ); 34 34 delete typeInst; 35 35 return ret; … … 37 37 } 38 38 39 TyVarMap::const_iterator tyVar = tyVars->find( typeInst-> get_name());39 TyVarMap::const_iterator tyVar = tyVars->find( typeInst->name ); 40 40 if ( tyVar != tyVars->end() ) { 41 41 switch ( tyVar->second.kind ) { … … 43 43 case TypeDecl::Ttype: 44 44 { 45 PointerType * ret = new PointerType( Type::Qualifiers(), new VoidType( typeInst->get_qualifiers() ) );45 PointerType * ret = new PointerType( Type::Qualifiers(), new VoidType( typeInst->get_qualifiers() ) ); 46 46 delete typeInst; 47 47 return ret; … … 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 … … 55 57 } 56 58 57 Type * ScrubTyVars::mutateAggregateType( Type * ty ) {59 Type * ScrubTyVars::mutateAggregateType( Type * ty ) { 58 60 if ( shouldScrub( ty ) ) { 59 PointerType * ret = new PointerType( Type::Qualifiers(), new VoidType( ty->get_qualifiers() ) );61 PointerType * ret = new PointerType( Type::Qualifiers(), new VoidType( ty->get_qualifiers() ) ); 60 62 delete ty; 61 63 return ret; … … 64 66 } 65 67 66 Type * ScrubTyVars:: mutate( StructInstType *structInst ) {68 Type * ScrubTyVars::postmutate( StructInstType * structInst ) { 67 69 return mutateAggregateType( structInst ); 68 70 } 69 71 70 Type * ScrubTyVars:: mutate( UnionInstType *unionInst ) {72 Type * ScrubTyVars::postmutate( UnionInstType * unionInst ) { 71 73 return mutateAggregateType( unionInst ); 72 74 } 73 75 74 Expression * ScrubTyVars::mutate( SizeofExpr *szeof ) { 76 void ScrubTyVars::primeBaseScrub( Type * type ) { 77 // need to determine whether type needs to be scrubbed to determine whether 78 // automatic recursion is necessary 79 if ( Type * t = shouldScrub( type ) ) { 80 visit_children = false; 81 GuardValue( dynType ); 82 dynType = t; 83 } 84 } 85 86 Expression * ScrubTyVars::postmutate( SizeofExpr * szeof ) { 75 87 // sizeof( T ) => _sizeof_T parameter, which is the size of T 76 if ( Type *dynType = shouldScrub( szeof->get_type() )) {88 if ( dynType ) { 77 89 Expression *expr = new NameExpr( sizeofName( mangleType( dynType ) ) ); 78 90 return expr; 79 } else {80 return Mutator::mutate( szeof );81 91 } // if 92 return szeof; 82 93 } 83 94 84 Expression * ScrubTyVars:: mutate( AlignofExpr *algnof ) {95 Expression * ScrubTyVars::postmutate( AlignofExpr * algnof ) { 85 96 // alignof( T ) => _alignof_T parameter, which is the alignment of T 86 if ( Type *dynType = shouldScrub( algnof->get_type() )) {97 if ( dynType ) { 87 98 Expression *expr = new NameExpr( alignofName( mangleType( dynType ) ) ); 88 99 return expr; 89 } else {90 return Mutator::mutate( algnof );91 100 } // if 101 return algnof; 92 102 } 93 103 94 Type * ScrubTyVars::mutate( PointerType *pointer ) { 95 // // special case of shouldScrub that takes all TypeInstType pointer bases, even if they're not dynamic 96 // Type *base = pointer->get_base(); 97 // Type *dynType = 0; 98 // if ( dynamicOnly ) { 99 // if ( TypeInstType *typeInst = dynamic_cast< TypeInstType* >( base ) ) { 100 // if ( tyVars.find( typeInst->get_name() ) != tyVars.end() ) { dynType = typeInst; } 101 // } else { 102 // dynType = isDynType( base, tyVars ); 103 // } 104 // } else { 105 // dynType = isPolyType( base, tyVars ); 106 // } 107 // if ( dynType ) { 108 if ( Type *dynType = shouldScrub( pointer->get_base() ) ) { 109 Type *ret = dynType->acceptMutator( *this ); 104 Type * ScrubTyVars::postmutate( PointerType * pointer ) { 105 if ( dynType ) { 106 Type * ret = dynType->acceptMutator( *visitor ); 110 107 ret->get_qualifiers() |= pointer->get_qualifiers(); 111 pointer-> set_base( 0 );108 pointer->base = nullptr; 112 109 delete pointer; 113 110 return ret; 114 111 } 115 return Mutator::mutate( pointer );112 return pointer; 116 113 } 117 114 } // namespace GenPoly -
src/GenPoly/ScrubTyVars.h
rf9feab8 r90152a4 18 18 #include <cassert> // for assert 19 19 20 #include "Common/PassVisitor.h" 20 21 #include "GenPoly.h" // for TyVarMap, isPolyType, isDynType 21 22 #include "SynTree/Mutator.h" // for Mutator … … 27 28 28 29 namespace GenPoly { 29 class ScrubTyVars : public Mutator{30 struct ScrubTyVars : public WithVisitorRef<ScrubTyVars>, public WithShortCircuiting, public WithGuards { 30 31 /// Whether to scrub all type variables from the provided map, dynamic type variables from the provided map, or all type variables 31 32 enum ScrubMode { FromMap, DynamicFromMap, All }; … … 51 52 static SynTreeClass *scrubAll( SynTreeClass *target ); 52 53 53 virtual Type* mutate( TypeInstType *typeInst ); 54 virtual Type* mutate( StructInstType *structInst ); 55 virtual Type* mutate( UnionInstType *unionInst ); 56 virtual Expression* mutate( SizeofExpr *szeof ); 57 virtual Expression* mutate( AlignofExpr *algnof ); 58 virtual Type* mutate( PointerType *pointer ); 54 /// determine if children should be visited based on whether base type should be scrubbed. 55 void primeBaseScrub( Type * ); 56 57 void premutate( TypeInstType * ) { visit_children = false; } 58 void premutate( StructInstType * ) { visit_children = false; } 59 void premutate( UnionInstType * ) { visit_children = false; } 60 void premutate( SizeofExpr * szeof ) { primeBaseScrub( szeof->type ); } 61 void premutate( AlignofExpr * algnof ) { primeBaseScrub( algnof->type ); } 62 void premutate( PointerType * pointer ) { primeBaseScrub( pointer->base ); } 63 64 Type * postmutate( TypeInstType * typeInst ); 65 Type * postmutate( StructInstType * structInst ); 66 Type * postmutate( UnionInstType * unionInst ); 67 Expression * postmutate( SizeofExpr * szeof ); 68 Expression * postmutate( AlignofExpr * algnof ); 69 Type * postmutate( PointerType * pointer ); 59 70 60 71 private: … … 75 86 const TyVarMap *tyVars; ///< Type variables to scrub 76 87 ScrubMode mode; ///< which type variables to scrub? [FromMap] 88 89 Type * dynType = nullptr; ///< result of shouldScrub 77 90 }; 78 91 79 92 template< typename SynTreeClass > 80 93 SynTreeClass * ScrubTyVars::scrub( SynTreeClass *target, const TyVarMap &tyVars ) { 81 ScrubTyVarsscrubber( tyVars );94 PassVisitor<ScrubTyVars> scrubber( tyVars ); 82 95 return static_cast< SynTreeClass * >( target->acceptMutator( scrubber ) ); 83 96 } … … 85 98 template< typename SynTreeClass > 86 99 SynTreeClass * ScrubTyVars::scrubDynamic( SynTreeClass *target, const TyVarMap &tyVars ) { 87 ScrubTyVarsscrubber( tyVars, ScrubTyVars::DynamicFromMap );100 PassVisitor<ScrubTyVars> scrubber( tyVars, ScrubTyVars::DynamicFromMap ); 88 101 return static_cast< SynTreeClass * >( target->acceptMutator( scrubber ) ); 89 102 } … … 91 104 template< typename SynTreeClass > 92 105 SynTreeClass * ScrubTyVars::scrubAll( SynTreeClass *target ) { 93 ScrubTyVarsscrubber;106 PassVisitor<ScrubTyVars> scrubber; 94 107 return static_cast< SynTreeClass * >( target->acceptMutator( scrubber ) ); 95 108 } -
src/GenPoly/Specialize.cc
rf9feab8 r90152a4 23 23 24 24 #include "Common/PassVisitor.h" 25 #include "Common/SemanticError.h" // for SemanticError26 25 #include "Common/UniqueName.h" // for UniqueName 27 26 #include "Common/utility.h" // for group_iterate … … 201 200 } 202 201 203 struct EnvTrimmer {204 TypeSubstitution * env, * newEnv;205 EnvTrimmer( TypeSubstitution * env, TypeSubstitution * newEnv ) : env( env ), newEnv( newEnv ){}206 void previsit( TypeDecl * tyDecl ) {207 // transfer known bindings for seen type variables208 if ( Type * t = env->lookup( tyDecl->name ) ) {209 newEnv->add( tyDecl->name, t );210 }211 }212 };213 214 /// reduce environment to just the parts that are referenced in a given expression215 TypeSubstitution * trimEnv( ApplicationExpr * expr, TypeSubstitution * env ) {216 if ( env ) {217 TypeSubstitution * newEnv = new TypeSubstitution();218 PassVisitor<EnvTrimmer> trimmer( env, newEnv );219 expr->accept( trimmer );220 return newEnv;221 }222 return nullptr;223 }224 225 202 /// Generates a thunk that calls `actual` with type `funType` and returns its address 226 203 Expression * Specialize::createThunkFunction( FunctionType *funType, Expression *actual, InferredParams *inferParams ) { … … 266 243 } 267 244 268 appExpr-> set_env( trimEnv( appExpr, env ));245 appExpr->env = TypeSubstitution::newFromExpr( appExpr, env ); 269 246 if ( inferParams ) { 270 247 appExpr->get_inferParams() = *inferParams; -
src/InitTweak/FixGlobalInit.cc
rf9feab8 r90152a4 21 21 22 22 #include "Common/PassVisitor.h" 23 #include "Common/SemanticError.h" // for SemanticError24 23 #include "Common/UniqueName.h" // for UniqueName 25 24 #include "InitTweak.h" // for isIntrinsicSingleArgCallStmt … … 38 37 class GlobalFixer : public WithShortCircuiting { 39 38 public: 40 GlobalFixer( const std::string & name,bool inLibrary );39 GlobalFixer( bool inLibrary ); 41 40 42 41 void previsit( ObjectDecl *objDecl ); … … 53 52 }; 54 53 55 void fixGlobalInit( std::list< Declaration * > & translationUnit, const std::string & name,bool inLibrary ) {56 PassVisitor<GlobalFixer> visitor( name,inLibrary );54 void fixGlobalInit( std::list< Declaration * > & translationUnit, bool inLibrary ) { 55 PassVisitor<GlobalFixer> visitor( inLibrary ); 57 56 acceptAll( translationUnit, visitor ); 58 57 GlobalFixer & fixer = visitor.pass; … … 71 70 } 72 71 73 std::string globalFunctionName( const std::string & name ) { 74 // get basename 75 std::string ret = name.substr( 0, name.find( '.' ) ); 76 // replace invalid characters with _ 77 static std::string invalid = "/-"; 78 replace_if( ret.begin(), ret.end(), []( char c ) { return invalid.find(c) != std::string::npos; }, '_' ); 79 return ret; 80 } 81 82 GlobalFixer::GlobalFixer( const std::string & name, bool inLibrary ) : tempNamer( "_global_init" ) { 83 std::string fixedName = globalFunctionName( name ); 72 GlobalFixer::GlobalFixer( bool inLibrary ) : tempNamer( "_global_init" ) { 84 73 std::list< Expression * > ctorParameters; 85 74 std::list< Expression * > dtorParameters; … … 91 80 // for library code are run before constructors and destructors for user code, 92 81 // specify a priority when building the library. Priorities 0-100 are reserved by gcc. 93 ctorParameters.push_back( new ConstantExpr( Constant::from_int( 102 ) ) ); 94 dtorParameters.push_back( new ConstantExpr( Constant::from_int( 102 ) ) ); 82 // Priorities 101-200 are reserved by cfa, so use priority 200 for CFA library globals, 83 // allowing room for overriding with a higher priority. 84 ctorParameters.push_back( new ConstantExpr( Constant::from_int( 200 ) ) ); 85 dtorParameters.push_back( new ConstantExpr( Constant::from_int( 200 ) ) ); 95 86 } 96 initFunction = new FunctionDecl( "_ init_" + fixedName, Type::StorageClasses( Type::Static ), LinkageSpec::C, new FunctionType( Type::Qualifiers(), false ), new CompoundStmt() );87 initFunction = new FunctionDecl( "__global_init__", Type::StorageClasses( Type::Static ), LinkageSpec::C, new FunctionType( Type::Qualifiers(), false ), new CompoundStmt() ); 97 88 initFunction->get_attributes().push_back( new Attribute( "constructor", ctorParameters ) ); 98 destroyFunction = new FunctionDecl( "_ destroy_" + fixedName, Type::StorageClasses( Type::Static ), LinkageSpec::C, new FunctionType( Type::Qualifiers(), false ), new CompoundStmt() );89 destroyFunction = new FunctionDecl( "__global_destroy__", Type::StorageClasses( Type::Static ), LinkageSpec::C, new FunctionType( Type::Qualifiers(), false ), new CompoundStmt() ); 99 90 destroyFunction->get_attributes().push_back( new Attribute( "destructor", dtorParameters ) ); 100 91 } … … 111 102 if ( ConstructorInit * ctorInit = dynamic_cast< ConstructorInit * >( objDecl->get_init() ) ) { 112 103 // a decision should have been made by the resolver, so ctor and init are not both non-NULL 113 assert( ! ctorInit-> get_ctor() || ! ctorInit->get_init());104 assert( ! ctorInit->ctor || ! ctorInit->init ); 114 105 115 Statement * dtor = ctorInit-> get_dtor();106 Statement * dtor = ctorInit->dtor; 116 107 if ( dtor && ! isIntrinsicSingleArgCallStmt( dtor ) ) { 117 108 // don't need to call intrinsic dtor, because it does nothing, but 118 109 // non-intrinsic dtors must be called 119 110 destroyStatements.push_front( dtor ); 120 ctorInit-> set_dtor( NULL );111 ctorInit->dtor = nullptr; 121 112 } // if 122 if ( Statement * ctor = ctorInit-> get_ctor()) {113 if ( Statement * ctor = ctorInit->ctor ) { 123 114 initStatements.push_back( ctor ); 124 objDecl-> set_init( NULL );125 ctorInit-> set_ctor( NULL );126 } else if ( Initializer * init = ctorInit-> get_init()) {127 objDecl-> set_init( init );128 ctorInit-> set_init( NULL );115 objDecl->init = nullptr; 116 ctorInit->ctor = nullptr; 117 } else if ( Initializer * init = ctorInit->init ) { 118 objDecl->init = init; 119 ctorInit->init = nullptr; 129 120 } else { 130 121 // no constructor and no initializer, which is okay 131 objDecl-> set_init( NULL );122 objDecl->init = nullptr; 132 123 } // if 133 124 delete ctorInit; -
src/InitTweak/FixGlobalInit.h
rf9feab8 r90152a4 22 22 23 23 namespace InitTweak { 24 /// Moves global initialization into an _init function that is unique to the translation unit. 25 /// Sets the priority of the initialization function depending on whether the initialization 26 /// function is for library code. 27 void fixGlobalInit( std::list< Declaration * > & translationUnit, const std::string & name, bool inLibrary ); 28 29 /// Apply transformations to a file name to get a valid C identifier which will be used as 30 /// the name of the generated initializer function. 31 std::string globalFunctionName( const std::string & name ); 24 /// Moves global initialization into an _init function that is unique to the translation unit. 25 /// Sets the priority of the initialization function depending on whether the initialization 26 /// function is for library code. 27 void fixGlobalInit( std::list< Declaration * > & translationUnit, bool inLibrary ); 32 28 } // namespace 33 29 -
src/InitTweak/FixInit.cc
rf9feab8 r90152a4 5 5 // file "LICENCE" distributed with Cforall. 6 6 // 7 // FixInit. h--7 // FixInit.cc -- 8 8 // 9 9 // Author : Rob Schluntz … … 54 54 #include "SynTree/Type.h" // for Type, Type::StorageClasses 55 55 #include "SynTree/TypeSubstitution.h" // for TypeSubstitution, operator<< 56 #include "SynTree/ VarExprReplacer.h" // for VarExprReplacer56 #include "SynTree/DeclReplacer.h" // for DeclReplacer 57 57 #include "SynTree/Visitor.h" // for acceptAll, maybeAccept 58 58 … … 68 68 namespace { 69 69 typedef std::unordered_map< int, int > UnqCount; 70 71 struct SelfAssignChecker { 72 void previsit( ApplicationExpr * appExpr ); 73 }; 70 74 71 75 struct InsertImplicitCalls : public WithTypeSubstitution { … … 180 184 }; 181 185 182 class FixCopyCtors final : public WithStmtsToAdd, public WithShortCircuiting, public WithVisitorRef<FixCopyCtors> {186 class FixCopyCtors final : public WithStmtsToAdd, public WithShortCircuiting, public WithVisitorRef<FixCopyCtors>, public WithTypeSubstitution { 183 187 public: 184 188 FixCopyCtors( UnqCount & unqCount ) : unqCount( unqCount ){} … … 194 198 }; 195 199 196 struct GenStructMemberCalls final : public WithGuards, public WithShortCircuiting, public WithIndexer {200 struct GenStructMemberCalls final : public WithGuards, public WithShortCircuiting, public WithIndexer, public WithVisitorRef<GenStructMemberCalls> { 197 201 /// generate default/copy ctor and dtor calls for user-defined struct ctor/dtors 198 202 /// for any member that is missing a corresponding ctor/dtor call. … … 200 204 static void generate( std::list< Declaration * > & translationUnit ); 201 205 202 void previsit( StructDecl * structDecl ); 203 204 void previsit( FunctionDecl * funcDecl ); 205 void postvisit( FunctionDecl * funcDecl ); 206 207 void previsit( MemberExpr * memberExpr ); 208 void previsit( ApplicationExpr * appExpr ); 209 210 SemanticError errors; 206 void premutate( StructDecl * structDecl ); 207 208 void premutate( FunctionDecl * funcDecl ); 209 DeclarationWithType * postmutate( FunctionDecl * funcDecl ); 210 211 void premutate( MemberExpr * memberExpr ); 212 void premutate( ApplicationExpr * appExpr ); 213 214 /// Note: this post mutate used to be in a separate visitor. If this pass breaks, one place to examine is whether it is 215 /// okay for this part of the recursion to occur alongside the rest. 216 Expression * postmutate( UntypedExpr * expr ); 217 218 SemanticErrorException errors; 211 219 private: 212 220 template< typename... Params > … … 225 233 }; 226 234 227 // very simple resolver-like mutator class - used to228 // resolve UntypedExprs that are found within newly229 // generated constructor/destructor calls230 class MutatingResolver final : public Mutator {231 public:232 MutatingResolver( SymTab::Indexer & indexer ) : indexer( indexer ) {}233 234 using Mutator::mutate;235 virtual DeclarationWithType* mutate( ObjectDecl *objectDecl ) override;236 virtual Expression* mutate( UntypedExpr *untypedExpr ) override;237 238 private:239 SymTab::Indexer & indexer;240 };241 242 235 struct FixCtorExprs final : public WithDeclsToAdd, public WithIndexer { 243 236 /// expands ConstructorExpr nodes into comma expressions, using a temporary for the first argument … … 248 241 } // namespace 249 242 250 void fix( std::list< Declaration * > & translationUnit, const std::string & filename, bool inLibrary ) { 243 void fix( std::list< Declaration * > & translationUnit, bool inLibrary ) { 244 PassVisitor<SelfAssignChecker> checker; 245 acceptAll( translationUnit, checker ); 246 251 247 // fixes ConstructorInit for global variables. should happen before fixInitializers. 252 InitTweak::fixGlobalInit( translationUnit, filename,inLibrary );248 InitTweak::fixGlobalInit( translationUnit, inLibrary ); 253 249 254 250 UnqCount unqCount; … … 290 286 // can't use mutateAll, because need to insert declarations at top-level 291 287 // can't use DeclMutator, because sometimes need to insert IfStmt, etc. 292 SemanticError errors;288 SemanticErrorException errors; 293 289 for ( std::list< Declaration * >::iterator i = translationUnit.begin(); i != translationUnit.end(); ++i ) { 294 290 try { 295 291 maybeMutate( *i, fixer ); 296 292 translationUnit.splice( i, fixer.pass.staticDtorDecls ); 297 } catch( SemanticError &e ) { 298 e.set_location( (*i)->location ); 293 } catch( SemanticErrorException &e ) { 299 294 errors.append( e ); 300 295 } // try … … 318 313 void GenStructMemberCalls::generate( std::list< Declaration * > & translationUnit ) { 319 314 PassVisitor<GenStructMemberCalls> warner; 320 acceptAll( translationUnit, warner );315 mutateAll( translationUnit, warner ); 321 316 } 322 317 … … 324 319 PassVisitor<FixCtorExprs> fixer; 325 320 mutateAll( translationUnit, fixer ); 321 } 322 323 namespace { 324 // Relatively simple structural comparison for expressions, needed to determine 325 // if two expressions are "the same" (used to determine if self assignment occurs) 326 struct StructuralChecker { 327 Expression * stripCasts( Expression * expr ) { 328 // this might be too permissive. It's possible that only particular casts are relevant. 329 while ( CastExpr * cast = dynamic_cast< CastExpr * >( expr ) ) { 330 expr = cast->arg; 331 } 332 return expr; 333 } 334 335 void previsit( Expression * ) { 336 // anything else does not qualify 337 isSimilar = false; 338 } 339 340 template<typename T> 341 T * cast( Expression * node ) { 342 // all expressions need to ignore casts, so this bit has been factored out 343 return dynamic_cast< T * >( stripCasts( node ) ); 344 } 345 346 // ignore casts 347 void previsit( CastExpr * ) {} 348 349 void previsit( MemberExpr * memExpr ) { 350 if ( MemberExpr * otherMember = cast< MemberExpr >( other ) ) { 351 if ( otherMember->member == memExpr->member ) { 352 other = otherMember->aggregate; 353 return; 354 } 355 } 356 isSimilar = false; 357 } 358 359 void previsit( VariableExpr * varExpr ) { 360 if ( VariableExpr * otherVar = cast< VariableExpr >( other ) ) { 361 if ( otherVar->var == varExpr->var ) { 362 return; 363 } 364 } 365 isSimilar = false; 366 } 367 368 void previsit( AddressExpr * ) { 369 if ( AddressExpr * addrExpr = cast< AddressExpr >( other ) ) { 370 other = addrExpr->arg; 371 return; 372 } 373 isSimilar = false; 374 } 375 376 Expression * other = nullptr; 377 bool isSimilar = true; 378 }; 379 380 bool structurallySimilar( Expression * e1, Expression * e2 ) { 381 PassVisitor<StructuralChecker> checker; 382 checker.pass.other = e2; 383 e1->accept( checker ); 384 return checker.pass.isSimilar; 385 } 386 } 387 388 void SelfAssignChecker::previsit( ApplicationExpr * appExpr ) { 389 DeclarationWithType * function = getFunction( appExpr ); 390 if ( function->name == "?=?" ) { // doesn't use isAssignment, because ?+=?, etc. should not count as self-assignment 391 if ( appExpr->args.size() == 2 ) { 392 // check for structural similarity (same variable use, ignore casts, etc. - but does not look too deeply, anything looking like a function is off limits) 393 if ( structurallySimilar( appExpr->args.front(), appExpr->args.back() ) ) { 394 SemanticWarning( appExpr->location, Warning::SelfAssignment, toCString( appExpr->args.front() ) ); 395 } 396 } 397 } 326 398 } 327 399 … … 368 440 // arrays are not copy constructed, so this should always be an ExprStmt 369 441 ImplicitCtorDtorStmt * stmt = genCtorDtor( fname, var, cpArg ); 370 ExprStmt * exprStmt = strict_dynamic_cast< ExprStmt * >( stmt->get_callStmt() ); 442 assertf( stmt, "ResolveCopyCtors: genCtorDtor returned nullptr: %s / %s / %s", fname.c_str(), toString( var ).c_str(), toString( cpArg ).c_str() ); 443 ExprStmt * exprStmt = strict_dynamic_cast< ExprStmt * >( stmt->callStmt ); 371 444 Expression * resolved = exprStmt->expr; 372 445 exprStmt->expr = nullptr; // take ownership of expr … … 378 451 ResolvExpr::findVoidExpression( resolved, indexer ); 379 452 assert( resolved ); 380 if ( resolved-> get_env()) {453 if ( resolved->env ) { 381 454 // Extract useful information and discard new environments. Keeping them causes problems in PolyMutator passes. 382 env->add( *resolved-> get_env());383 delete resolved-> get_env();384 resolved-> set_env( nullptr );455 env->add( *resolved->env ); 456 delete resolved->env; 457 resolved->env = nullptr; 385 458 } // if 386 459 delete stmt; 460 if ( TupleAssignExpr * assign = dynamic_cast< TupleAssignExpr * >( resolved ) ) { 461 // fix newly generated StmtExpr 462 postvisit( assign->stmtExpr ); 463 } 387 464 return resolved; 388 465 } … … 478 555 static UniqueName retNamer("_tmp_stmtexpr_ret"); 479 556 480 // create variable that will hold the result of the stmt expr481 557 result = result->clone(); 482 558 env->apply( result ); 559 if ( ! InitTweak::isConstructable( result ) ) { 560 delete result; 561 return; 562 } 563 564 // create variable that will hold the result of the stmt expr 483 565 ObjectDecl * ret = ObjectDecl::newObject( retNamer.newName(), result, nullptr ); 484 ret-> get_type()->set_const( false );485 stmtExpr-> get_returnDecls().push_front( ret );566 ret->type->set_const( false ); 567 stmtExpr->returnDecls.push_front( ret ); 486 568 487 569 // must have a non-empty body, otherwise it wouldn't have a result 488 CompoundStmt * body = stmtExpr-> get_statements();570 CompoundStmt * body = stmtExpr->statements; 489 571 assert( ! body->get_kids().empty() ); 490 572 // must be an ExprStmt, otherwise it wouldn't have a result 491 573 ExprStmt * last = strict_dynamic_cast< ExprStmt * >( body->get_kids().back() ); 492 last-> set_expr( makeCtorDtor( "?{}", ret, last->get_expr()) );493 494 stmtExpr-> get_dtors().push_front( makeCtorDtor( "^?{}", ret ) );574 last->expr = makeCtorDtor( "?{}", ret, last->get_expr() ); 575 576 stmtExpr->dtors.push_front( makeCtorDtor( "^?{}", ret ) ); 495 577 } // if 496 578 } … … 555 637 // add destructors after current statement 556 638 for ( Expression * dtor : dtors ) { 639 // take relevant bindings from environment 640 assert( ! dtor->env ); 641 dtor->env = maybeClone( env ); 557 642 stmtsToAddAfter.push_back( new ExprStmt( dtor ) ); 558 643 } // for … … 593 678 // to the outer context, rather than inside of the statement expression. 594 679 visit_children = false; 595 std::list< Statement * > & stmts = stmtExpr-> get_statements()->get_kids();680 std::list< Statement * > & stmts = stmtExpr->statements->get_kids(); 596 681 for ( Statement *& stmt : stmts ) { 597 682 stmt = stmt->acceptMutator( *visitor ); 598 683 } // for 599 assert( stmtExpr-> get_result());600 Type * result = stmtExpr-> get_result();684 assert( stmtExpr->result ); 685 Type * result = stmtExpr->result; 601 686 if ( ! result->isVoid() ) { 602 for ( ObjectDecl * obj : stmtExpr-> get_returnDecls()) {687 for ( ObjectDecl * obj : stmtExpr->returnDecls ) { 603 688 stmtsToAddBefore.push_back( new DeclStmt( obj ) ); 604 689 } // for 605 690 // add destructors after current statement 606 for ( Expression * dtor : stmtExpr-> get_dtors()) {691 for ( Expression * dtor : stmtExpr->dtors ) { 607 692 stmtsToAddAfter.push_back( new ExprStmt( dtor ) ); 608 693 } // for 609 694 // must have a non-empty body, otherwise it wouldn't have a result 610 695 assert( ! stmts.empty() ); 611 assert( ! stmtExpr->get_returnDecls().empty() ); 612 stmts.push_back( new ExprStmt( new VariableExpr( stmtExpr->get_returnDecls().front() ) ) ); 613 stmtExpr->get_returnDecls().clear(); 614 stmtExpr->get_dtors().clear(); 615 } 616 assert( stmtExpr->get_returnDecls().empty() ); 617 assert( stmtExpr->get_dtors().empty() ); 696 assertf( ! stmtExpr->returnDecls.empty() || stmtExpr->dtors.empty(), "StmtExpr returns non-void, but no return decls: %s", toString( stmtExpr ).c_str() ); 697 // if there is a return decl, add a use as the last statement; will not have return decl on non-constructable returns 698 if ( ! stmtExpr->returnDecls.empty() ) { 699 stmts.push_back( new ExprStmt( new VariableExpr( stmtExpr->returnDecls.front() ) ) ); 700 } 701 stmtExpr->returnDecls.clear(); 702 stmtExpr->dtors.clear(); 703 } 704 assert( stmtExpr->returnDecls.empty() ); 705 assert( stmtExpr->dtors.empty() ); 618 706 } 619 707 … … 692 780 replacement = new CastExpr( replacement, base->clone() ); 693 781 } 694 VarExprReplacer::replace( dtor, { std::make_pair( objDecl, replacement ) } );695 dtorFunc->statements->push_back( dtor);782 DeclReplacer::replace( dtor, { std::make_pair( objDecl, replacement ) } ); 783 dtorFunc->statements->push_back( strict_dynamic_cast<Statement *>( dtor ) ); 696 784 697 785 return dtorFunc; … … 905 993 ) 906 994 if ( ! diff.empty() ) { 907 throw SemanticError( std::string("jump to label '") + stmt->get_target().get_name() + "' crosses initialization of " + (*diff.begin())->get_name() + " ", stmt);995 SemanticError( stmt, std::string("jump to label '") + stmt->get_target().get_name() + "' crosses initialization of " + (*diff.begin())->get_name() + " " ); 908 996 } // if 909 997 } … … 931 1019 } 932 1020 933 void GenStructMemberCalls::pre visit( StructDecl * structDecl ) {1021 void GenStructMemberCalls::premutate( StructDecl * structDecl ) { 934 1022 if ( ! dtorStruct && structDecl->name == "__Destructor" ) { 935 1023 dtorStruct = structDecl; … … 937 1025 } 938 1026 939 void GenStructMemberCalls::pre visit( FunctionDecl * funcDecl ) {1027 void GenStructMemberCalls::premutate( FunctionDecl * funcDecl ) { 940 1028 GuardValue( function ); 941 1029 GuardValue( unhandled ); … … 944 1032 GuardValue( isCtor ); 945 1033 GuardValue( structDecl ); 946 errors = SemanticError (); // clear previous errors1034 errors = SemanticErrorException(); // clear previous errors 947 1035 948 1036 // need to start with fresh sets … … 977 1065 } 978 1066 979 void GenStructMemberCalls::postvisit( FunctionDecl * funcDecl ) {1067 DeclarationWithType * GenStructMemberCalls::postmutate( FunctionDecl * funcDecl ) { 980 1068 // remove the unhandled objects from usedUninit, because a call is inserted 981 1069 // to handle them - only objects that are later constructed are used uninitialized. … … 1031 1119 Statement * callStmt = stmt.front(); 1032 1120 1033 MutatingResolver resolver( indexer );1034 1121 try { 1035 callStmt->acceptMutator( resolver );1122 callStmt->acceptMutator( *visitor ); 1036 1123 if ( isCtor ) { 1037 1124 function->statements->push_front( callStmt ); … … 1061 1148 function->statements->kids.splice( function->statements->kids.begin(), stmtsToAdd ); 1062 1149 } 1063 } catch ( SemanticError & error ) {1150 } catch ( SemanticErrorException & error ) { 1064 1151 emit( funcDecl->location, "in ", CodeGen::genPrettyType( function->get_functionType(), function->get_name() ), ", field ", field->get_name(), " not explicitly ", isCtor ? "constructed" : "destructed", " and no ", isCtor ? "default constructor" : "destructor", " found" ); 1065 1152 } … … 1070 1157 throw errors; 1071 1158 } 1159 return funcDecl; 1072 1160 } 1073 1161 … … 1095 1183 } 1096 1184 1097 void GenStructMemberCalls::pre visit( ApplicationExpr * appExpr ) {1185 void GenStructMemberCalls::premutate( ApplicationExpr * appExpr ) { 1098 1186 if ( ! checkWarnings( function ) ) { 1099 1187 visit_children = false; … … 1102 1190 1103 1191 std::string fname = getFunctionName( appExpr ); 1104 if ( fname == function-> get_name()) {1192 if ( fname == function->name ) { 1105 1193 // call to same kind of function 1106 Expression * firstParam = appExpr-> get_args().front();1194 Expression * firstParam = appExpr->args.front(); 1107 1195 1108 1196 if ( isThisExpression( firstParam, thisParam ) ) { … … 1113 1201 // if first parameter is a member expression on the this parameter, 1114 1202 // then remove the member from unhandled set. 1115 if ( isThisExpression( memberExpr-> get_aggregate(), thisParam ) ) {1116 unhandled.erase( memberExpr-> get_member());1203 if ( isThisExpression( memberExpr->aggregate, thisParam ) ) { 1204 unhandled.erase( memberExpr->member ); 1117 1205 } 1118 1206 } … … 1120 1208 } 1121 1209 1122 void GenStructMemberCalls::pre visit( MemberExpr * memberExpr ) {1210 void GenStructMemberCalls::premutate( MemberExpr * memberExpr ) { 1123 1211 if ( ! checkWarnings( function ) || ! isCtor ) { 1124 1212 visit_children = false; … … 1136 1224 template< typename Visitor, typename... Params > 1137 1225 void error( Visitor & v, CodeLocation loc, const Params &... params ) { 1138 SemanticError err( toString( params... ) ); 1139 err.set_location( loc ); 1226 SemanticErrorException err( loc, toString( params... ) ); 1140 1227 v.errors.append( err ); 1141 1228 } … … 1148 1235 } 1149 1236 1150 DeclarationWithType * MutatingResolver::mutate( ObjectDecl * objectDecl ) { 1151 // add object to the indexer assumes that there will be no name collisions 1152 // in generated code. If this changes, add mutate methods for entities with 1153 // scope and call {enter,leave}Scope explicitly. 1154 indexer.addId( objectDecl ); 1155 return objectDecl; 1156 } 1157 1158 Expression * MutatingResolver::mutate( UntypedExpr * untypedExpr ) { 1237 Expression * GenStructMemberCalls::postmutate( UntypedExpr * untypedExpr ) { 1159 1238 Expression * newExpr = untypedExpr; 1160 1239 ResolvExpr::findVoidExpression( newExpr, indexer ); -
src/InitTweak/FixInit.h
rf9feab8 r90152a4 24 24 /// replace constructor initializers with expression statements 25 25 /// and unwrap basic C-style initializers 26 void fix( std::list< Declaration * > & translationUnit, const std::string & name,bool inLibrary );26 void fix( std::list< Declaration * > & translationUnit, bool inLibrary ); 27 27 } // namespace 28 28 -
src/InitTweak/GenInit.cc
rf9feab8 r90152a4 30 30 #include "InitTweak.h" // for isConstExpr, InitExpander, checkIn... 31 31 #include "Parser/LinkageSpec.h" // for isOverridable, C 32 #include "ResolvExpr/Resolver.h" 32 33 #include "SymTab/Autogen.h" // for genImplicitCall, SizeType 33 34 #include "SymTab/Mangler.h" // for Mangler … … 40 41 #include "SynTree/Type.h" // for Type, ArrayType, Type::Qualifiers 41 42 #include "SynTree/Visitor.h" // for acceptAll, maybeAccept 43 #include "Tuples/Tuples.h" // for maybeImpure 42 44 43 45 namespace InitTweak { … … 89 91 }; 90 92 91 struct HoistArrayDimension final : public WithDeclsToAdd, public WithShortCircuiting, public WithGuards {93 struct HoistArrayDimension final : public WithDeclsToAdd, public WithShortCircuiting, public WithGuards, public WithIndexer { 92 94 /// hoist dimension from array types in object declaration so that it uses a single 93 95 /// const variable of type size_t, so that side effecting array dimensions are only … … 104 106 void premutate( FunctionType * ) { visit_children = false; } 105 107 108 // need this so that enumerators are added to the indexer, due to premutate(AggregateDecl *) 109 void premutate( EnumDecl * ) {} 110 106 111 void hoist( Type * type ); 107 112 … … 135 140 if ( varExpr->var == retVal ) return; 136 141 } 137 stmtsToAddBefore.push_back( genCtorDtor( "?{}", retVal, returnStmt->get_expr() ) ); 142 Statement * stmt = genCtorDtor( "?{}", retVal, returnStmt->expr ); 143 assertf( stmt, "ReturnFixer: genCtorDtor returned nullptr: %s / %s", toString( retVal ).c_str(), toString( returnStmt->expr ).c_str() ); 144 stmtsToAddBefore.push_back( stmt ); 138 145 139 146 // return the retVal object … … 178 185 if ( ! arrayType->get_dimension() ) return; // xxx - recursive call to hoist? 179 186 180 // don't need to hoist dimension if it's a constexpr - only need to if there's potential for side effects. 181 if ( isConstExpr( arrayType->get_dimension() ) ) return; 187 // need to resolve array dimensions in order to accurately determine if constexpr 188 ResolvExpr::findSingleExpression( arrayType->dimension, SymTab::SizeType->clone(), indexer ); 189 // array is variable-length when the dimension is not constexpr 190 arrayType->isVarLen = ! isConstExpr( arrayType->dimension ); 191 // don't need to hoist dimension if it's definitely pure - only need to if there's potential for side effects. 192 if ( ! Tuples::maybeImpure( arrayType->dimension ) ) return; 182 193 183 194 ObjectDecl * arrayDimension = new ObjectDecl( dimensionName.newName(), storageClasses, LinkageSpec::C, 0, SymTab::SizeType->clone(), new SingleInit( arrayType->get_dimension() ) ); … … 194 205 void HoistArrayDimension::premutate( FunctionDecl * ) { 195 206 GuardValue( inFunction ); 207 inFunction = true; 196 208 } 197 209 … … 220 232 Type * type = objDecl->get_type(); 221 233 while ( ArrayType * at = dynamic_cast< ArrayType * >( type ) ) { 234 // must always construct VLAs with an initializer, since this is an error in C 235 if ( at->isVarLen && objDecl->init ) return true; 222 236 type = at->get_base(); 223 237 } … … 303 317 if ( tryConstruct( objDecl ) && ( managedTypes.isManaged( objDecl ) || ((! inFunction || objDecl->get_storageClasses().is_static ) && ! isConstExpr( objDecl->get_init() ) ) ) ) { 304 318 // constructed objects cannot be designated 305 if ( isDesignated( objDecl->get_init() ) ) throw SemanticError( "Cannot include designations in the initializer for a managed Object. If this is really what you want, then initialize with @=.\n", objDecl);319 if ( isDesignated( objDecl->get_init() ) ) SemanticError( objDecl, "Cannot include designations in the initializer for a managed Object. If this is really what you want, then initialize with @=.\n" ); 306 320 // constructed objects should not have initializers nested too deeply 307 if ( ! checkInitDepth( objDecl ) ) throw SemanticError( "Managed object's initializer is too deep ", objDecl);321 if ( ! checkInitDepth( objDecl ) ) SemanticError( objDecl, "Managed object's initializer is too deep " ); 308 322 309 323 objDecl->set_init( genCtorInit( objDecl ) ); -
src/InitTweak/InitTweak.cc
rf9feab8 r90152a4 225 225 // xxx - this shouldn't be an error, but need a way to 226 226 // terminate without creating output, so should catch this error 227 throw SemanticError("unbalanced list initializers" );227 SemanticError( init->location, "unbalanced list initializers" ); 228 228 } 229 229 … … 296 296 ObjectDecl * objDecl = dynamic_cast< ObjectDecl * >( dwt ); 297 297 if ( ! objDecl ) return false; 298 return ! LinkageSpec::isBuiltin( objDecl->get_linkage() ) && 299 (objDecl->get_init() == nullptr || 298 return (objDecl->get_init() == nullptr || 300 299 ( objDecl->get_init() != nullptr && objDecl->get_init()->get_maybeConstructed() )) 301 300 && ! objDecl->get_storageClasses().is_extern … … 409 408 return allofCtorDtor( stmt, []( Expression * callExpr ){ 410 409 if ( ApplicationExpr * appExpr = isIntrinsicCallExpr( callExpr ) ) { 411 FunctionType *funcType = GenPoly::getFunctionType( appExpr-> get_function()->get_result());410 FunctionType *funcType = GenPoly::getFunctionType( appExpr->function->result ); 412 411 assert( funcType ); 413 412 return funcType->get_parameters().size() == 1; … … 529 528 } 530 529 if ( dynamic_cast< ReferenceType * >( dst->result ) ) { 531 dst = new AddressExpr( dst ); 530 for (int depth = dst->result->referenceDepth(); depth > 0; depth--) { 531 dst = new AddressExpr( dst ); 532 } 532 533 } else { 533 534 dst = new CastExpr( dst, new ReferenceType( noQualifiers, dst->result->clone() ) ); 534 535 } 535 536 if ( dynamic_cast< ReferenceType * >( src->result ) ) { 536 src = new CastExpr( src, new ReferenceType( noQualifiers, src->result->stripReferences()->clone() ) ); 537 for (int depth = src->result->referenceDepth(); depth > 0; depth--) { 538 src = new AddressExpr( src ); 539 } 540 // src = new CastExpr( src, new ReferenceType( noQualifiers, src->result->stripReferences()->clone() ) ); 537 541 } 538 542 return new ApplicationExpr( VariableExpr::functionPointer( assign ), { dst, src } ); … … 564 568 void previsit( ConstantExpr * ) {} 565 569 570 void previsit( VariableExpr * varExpr ) { 571 visit_children = false; 572 573 if ( EnumInstType * inst = dynamic_cast< EnumInstType * >( varExpr->result ) ) { 574 long long int value; 575 if ( inst->baseEnum->valueOf( varExpr->var, value ) ) { 576 // enumerators are const expr 577 return; 578 } 579 } 580 isConstExpr = false; 581 } 582 566 583 bool isConstExpr = true; 567 584 }; -
src/Makefile.am
rf9feab8 r90152a4 16 16 17 17 # create object files in directory with source files 18 AUTOMAKE_OPTIONS = subdir-objects18 AUTOMAKE_OPTIONS = foreign subdir-objects 19 19 20 20 SRC = main.cc \ 21 MakeLibCfa.cc 21 MakeLibCfa.cc \ 22 CompilationState.cc 22 23 23 24 MAINTAINERCLEANFILES = 25 MOSTLYCLEANFILES = 24 26 25 27 # Is there a way to use a variable for the directory names? … … 37 39 include SynTree/module.mk 38 40 include Tuples/module.mk 41 include Validate/module.mk 39 42 include Virtual/module.mk 40 43 41 44 # put into lib for now 42 cfa_cpplibdir = ${CFA_LIBDIR} 43 cfa_cpplib_PROGRAMS = driver/cfa-cpp 44 driver_cfa_cpp_SOURCES = ${SRC} 45 driver_cfa_cpp_LDADD = -ldl # yywrap 46 driver_cfa_cpp_CXXFLAGS = -Wno-deprecated -Wall -Wextra -DDEBUG_ALL -I${abs_top_srcdir}/src/include -DYY_NO_INPUT -O2 -g -std=c++14 47 driver_cfa_cpp_LDFLAGS = -Xlinker -export-dynamic 45 cfa_cpplibdir = $(CFA_LIBDIR) 46 cfa_cpplib_PROGRAMS = ../driver/cfa-cpp demangler 47 ___driver_cfa_cpp_SOURCES = $(SRC) 48 ___driver_cfa_cpp_LDADD = -ldl # yywrap 49 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 AM_LDFLAGS = @HOST_FLAGS@ -Xlinker -export-dynamic 52 53 demangler_SOURCES = SymTab/demangler.cc 54 55 demangler_LDADD = libdemangle.a # yywrap 56 57 noinst_LIBRARIES = libdemangle.a 58 libdemangle_a_SOURCES = SymTab/Demangle.cc SymTab/ManglerCommon.cc \ 59 SynTree/Type.cc \ 60 SynTree/VoidType.cc \ 61 SynTree/BasicType.cc \ 62 SynTree/PointerType.cc \ 63 SynTree/ArrayType.cc \ 64 SynTree/ReferenceType.cc \ 65 SynTree/FunctionType.cc \ 66 SynTree/ReferenceToType.cc \ 67 SynTree/TupleType.cc \ 68 SynTree/TypeofType.cc \ 69 SynTree/AttrType.cc \ 70 SynTree/VarArgsType.cc \ 71 SynTree/ZeroOneType.cc \ 72 SynTree/Constant.cc \ 73 SynTree/Expression.cc \ 74 SynTree/TupleExpr.cc \ 75 SynTree/CommaExpr.cc \ 76 SynTree/TypeExpr.cc \ 77 SynTree/ApplicationExpr.cc \ 78 SynTree/AddressExpr.cc \ 79 SynTree/Statement.cc \ 80 SynTree/CompoundStmt.cc \ 81 SynTree/DeclStmt.cc \ 82 SynTree/Declaration.cc \ 83 SynTree/DeclarationWithType.cc \ 84 SynTree/ObjectDecl.cc \ 85 SynTree/FunctionDecl.cc \ 86 SynTree/AggregateDecl.cc \ 87 SynTree/NamedTypeDecl.cc \ 88 SynTree/TypeDecl.cc \ 89 SynTree/Initializer.cc \ 90 SynTree/TypeSubstitution.cc \ 91 SynTree/Attribute.cc \ 92 SynTree/DeclReplacer.cc \ 93 CompilationState.cc \ 94 CodeGen/CodeGenerator.cc \ 95 CodeGen/FixMain.cc \ 96 CodeGen/GenType.cc \ 97 CodeGen/OperatorTable.cc \ 98 Common/Assert.cc \ 99 Common/Eval.cc \ 100 Common/SemanticError.cc \ 101 Common/UniqueName.cc \ 102 Concurrency/Keywords.cc \ 103 ControlStruct/ForExprMutator.cc \ 104 ControlStruct/LabelFixer.cc \ 105 ControlStruct/LabelGenerator.cc \ 106 ControlStruct/MLEMutator.cc \ 107 ControlStruct/Mutate.cc \ 108 GenPoly/GenPoly.cc \ 109 GenPoly/Lvalue.cc \ 110 InitTweak/GenInit.cc \ 111 InitTweak/InitTweak.cc \ 112 Parser/LinkageSpec.cc \ 113 ResolvExpr/AdjustExprType.cc \ 114 ResolvExpr/Alternative.cc \ 115 ResolvExpr/AlternativeFinder.cc \ 116 ResolvExpr/ExplodedActual.cc \ 117 ResolvExpr/CastCost.cc \ 118 ResolvExpr/CommonType.cc \ 119 ResolvExpr/ConversionCost.cc \ 120 ResolvExpr/CurrentObject.cc \ 121 ResolvExpr/FindOpenVars.cc \ 122 ResolvExpr/Occurs.cc \ 123 ResolvExpr/PolyCost.cc \ 124 ResolvExpr/PtrsAssignable.cc \ 125 ResolvExpr/PtrsCastable.cc \ 126 ResolvExpr/RenameVars.cc \ 127 ResolvExpr/Resolver.cc \ 128 ResolvExpr/ResolveTypeof.cc \ 129 ResolvExpr/TypeEnvironment.cc \ 130 ResolvExpr/Unify.cc \ 131 SymTab/Autogen.cc \ 132 SymTab/FixFunction.cc \ 133 SymTab/Indexer.cc \ 134 SymTab/Mangler.cc \ 135 SymTab/Validate.cc \ 136 Tuples/Explode.cc \ 137 Tuples/TupleAssignment.cc \ 138 Tuples/TupleExpansion.cc \ 139 Validate/HandleAttributes.cc 48 140 49 141 MAINTAINERCLEANFILES += ${libdir}/${notdir ${cfa_cpplib_PROGRAMS}} -
src/Makefile.in
rf9feab8 r90152a4 59 59 ######################### -*- Mode: Makefile-Gmake -*- ######################## 60 60 ############################################################################### 61 62 ######################### -*- Mode: Makefile-Gmake -*- ######################## 63 ############################################################################### 64 61 65 62 66 VPATH = @srcdir@ … … 134 138 build_triplet = @build@ 135 139 host_triplet = @host@ 136 cfa_cpplib_PROGRAMS = driver/cfa-cpp$(EXEEXT)140 cfa_cpplib_PROGRAMS = ../driver/cfa-cpp$(EXEEXT) demangler$(EXEEXT) 137 141 subdir = src 138 142 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 139 am__aclocal_m4_deps = $(top_srcdir)/configure.ac 143 am__aclocal_m4_deps = $(top_srcdir)/automake/cfa.m4 \ 144 $(top_srcdir)/configure.ac 140 145 am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ 141 146 $(ACLOCAL_M4) … … 145 150 CONFIG_CLEAN_FILES = 146 151 CONFIG_CLEAN_VPATH_FILES = 152 LIBRARIES = $(noinst_LIBRARIES) 153 AR = ar 154 ARFLAGS = cru 155 AM_V_AR = $(am__v_AR_@AM_V@) 156 am__v_AR_ = $(am__v_AR_@AM_DEFAULT_V@) 157 am__v_AR_0 = @echo " AR " $@; 158 am__v_AR_1 = 159 libdemangle_a_AR = $(AR) $(ARFLAGS) 160 libdemangle_a_LIBADD = 161 am__dirstamp = $(am__leading_dot)dirstamp 162 am_libdemangle_a_OBJECTS = SymTab/Demangle.$(OBJEXT) \ 163 SymTab/ManglerCommon.$(OBJEXT) SynTree/Type.$(OBJEXT) \ 164 SynTree/VoidType.$(OBJEXT) SynTree/BasicType.$(OBJEXT) \ 165 SynTree/PointerType.$(OBJEXT) SynTree/ArrayType.$(OBJEXT) \ 166 SynTree/ReferenceType.$(OBJEXT) SynTree/FunctionType.$(OBJEXT) \ 167 SynTree/ReferenceToType.$(OBJEXT) SynTree/TupleType.$(OBJEXT) \ 168 SynTree/TypeofType.$(OBJEXT) SynTree/AttrType.$(OBJEXT) \ 169 SynTree/VarArgsType.$(OBJEXT) SynTree/ZeroOneType.$(OBJEXT) \ 170 SynTree/Constant.$(OBJEXT) SynTree/Expression.$(OBJEXT) \ 171 SynTree/TupleExpr.$(OBJEXT) SynTree/CommaExpr.$(OBJEXT) \ 172 SynTree/TypeExpr.$(OBJEXT) SynTree/ApplicationExpr.$(OBJEXT) \ 173 SynTree/AddressExpr.$(OBJEXT) SynTree/Statement.$(OBJEXT) \ 174 SynTree/CompoundStmt.$(OBJEXT) SynTree/DeclStmt.$(OBJEXT) \ 175 SynTree/Declaration.$(OBJEXT) \ 176 SynTree/DeclarationWithType.$(OBJEXT) \ 177 SynTree/ObjectDecl.$(OBJEXT) SynTree/FunctionDecl.$(OBJEXT) \ 178 SynTree/AggregateDecl.$(OBJEXT) \ 179 SynTree/NamedTypeDecl.$(OBJEXT) SynTree/TypeDecl.$(OBJEXT) \ 180 SynTree/Initializer.$(OBJEXT) \ 181 SynTree/TypeSubstitution.$(OBJEXT) SynTree/Attribute.$(OBJEXT) \ 182 SynTree/DeclReplacer.$(OBJEXT) CompilationState.$(OBJEXT) \ 183 CodeGen/CodeGenerator.$(OBJEXT) CodeGen/FixMain.$(OBJEXT) \ 184 CodeGen/GenType.$(OBJEXT) CodeGen/OperatorTable.$(OBJEXT) \ 185 Common/Assert.$(OBJEXT) Common/Eval.$(OBJEXT) \ 186 Common/SemanticError.$(OBJEXT) Common/UniqueName.$(OBJEXT) \ 187 Concurrency/Keywords.$(OBJEXT) \ 188 ControlStruct/ForExprMutator.$(OBJEXT) \ 189 ControlStruct/LabelFixer.$(OBJEXT) \ 190 ControlStruct/LabelGenerator.$(OBJEXT) \ 191 ControlStruct/MLEMutator.$(OBJEXT) \ 192 ControlStruct/Mutate.$(OBJEXT) GenPoly/GenPoly.$(OBJEXT) \ 193 GenPoly/Lvalue.$(OBJEXT) InitTweak/GenInit.$(OBJEXT) \ 194 InitTweak/InitTweak.$(OBJEXT) Parser/LinkageSpec.$(OBJEXT) \ 195 ResolvExpr/AdjustExprType.$(OBJEXT) \ 196 ResolvExpr/Alternative.$(OBJEXT) \ 197 ResolvExpr/AlternativeFinder.$(OBJEXT) \ 198 ResolvExpr/ExplodedActual.$(OBJEXT) \ 199 ResolvExpr/CastCost.$(OBJEXT) ResolvExpr/CommonType.$(OBJEXT) \ 200 ResolvExpr/ConversionCost.$(OBJEXT) \ 201 ResolvExpr/CurrentObject.$(OBJEXT) \ 202 ResolvExpr/FindOpenVars.$(OBJEXT) ResolvExpr/Occurs.$(OBJEXT) \ 203 ResolvExpr/PolyCost.$(OBJEXT) \ 204 ResolvExpr/PtrsAssignable.$(OBJEXT) \ 205 ResolvExpr/PtrsCastable.$(OBJEXT) \ 206 ResolvExpr/RenameVars.$(OBJEXT) ResolvExpr/Resolver.$(OBJEXT) \ 207 ResolvExpr/ResolveTypeof.$(OBJEXT) \ 208 ResolvExpr/TypeEnvironment.$(OBJEXT) \ 209 ResolvExpr/Unify.$(OBJEXT) SymTab/Autogen.$(OBJEXT) \ 210 SymTab/FixFunction.$(OBJEXT) SymTab/Indexer.$(OBJEXT) \ 211 SymTab/Mangler.$(OBJEXT) SymTab/Validate.$(OBJEXT) \ 212 Tuples/Explode.$(OBJEXT) Tuples/TupleAssignment.$(OBJEXT) \ 213 Tuples/TupleExpansion.$(OBJEXT) \ 214 Validate/HandleAttributes.$(OBJEXT) 215 libdemangle_a_OBJECTS = $(am_libdemangle_a_OBJECTS) 147 216 am__installdirs = "$(DESTDIR)$(cfa_cpplibdir)" 148 217 PROGRAMS = $(cfa_cpplib_PROGRAMS) 149 am__dirstamp = $(am__leading_dot)dirstamp 150 am__objects_1 = driver_cfa_cpp-main.$(OBJEXT) \ 151 driver_cfa_cpp-MakeLibCfa.$(OBJEXT) \ 152 CodeGen/driver_cfa_cpp-Generate.$(OBJEXT) \ 153 CodeGen/driver_cfa_cpp-CodeGenerator.$(OBJEXT) \ 154 CodeGen/driver_cfa_cpp-GenType.$(OBJEXT) \ 155 CodeGen/driver_cfa_cpp-FixNames.$(OBJEXT) \ 156 CodeGen/driver_cfa_cpp-FixMain.$(OBJEXT) \ 157 CodeGen/driver_cfa_cpp-OperatorTable.$(OBJEXT) \ 158 CodeTools/driver_cfa_cpp-DeclStats.$(OBJEXT) \ 159 CodeTools/driver_cfa_cpp-TrackLoc.$(OBJEXT) \ 160 Concurrency/driver_cfa_cpp-Keywords.$(OBJEXT) \ 161 Concurrency/driver_cfa_cpp-Waitfor.$(OBJEXT) \ 162 Common/driver_cfa_cpp-SemanticError.$(OBJEXT) \ 163 Common/driver_cfa_cpp-UniqueName.$(OBJEXT) \ 164 Common/driver_cfa_cpp-DebugMalloc.$(OBJEXT) \ 165 Common/driver_cfa_cpp-Assert.$(OBJEXT) \ 166 ControlStruct/driver_cfa_cpp-LabelGenerator.$(OBJEXT) \ 167 ControlStruct/driver_cfa_cpp-LabelFixer.$(OBJEXT) \ 168 ControlStruct/driver_cfa_cpp-MLEMutator.$(OBJEXT) \ 169 ControlStruct/driver_cfa_cpp-Mutate.$(OBJEXT) \ 170 ControlStruct/driver_cfa_cpp-ForExprMutator.$(OBJEXT) \ 171 ControlStruct/driver_cfa_cpp-ExceptTranslate.$(OBJEXT) \ 172 GenPoly/driver_cfa_cpp-Box.$(OBJEXT) \ 173 GenPoly/driver_cfa_cpp-GenPoly.$(OBJEXT) \ 174 GenPoly/driver_cfa_cpp-ScrubTyVars.$(OBJEXT) \ 175 GenPoly/driver_cfa_cpp-Lvalue.$(OBJEXT) \ 176 GenPoly/driver_cfa_cpp-Specialize.$(OBJEXT) \ 177 GenPoly/driver_cfa_cpp-FindFunction.$(OBJEXT) \ 178 GenPoly/driver_cfa_cpp-InstantiateGeneric.$(OBJEXT) \ 179 InitTweak/driver_cfa_cpp-GenInit.$(OBJEXT) \ 180 InitTweak/driver_cfa_cpp-FixInit.$(OBJEXT) \ 181 InitTweak/driver_cfa_cpp-FixGlobalInit.$(OBJEXT) \ 182 InitTweak/driver_cfa_cpp-InitTweak.$(OBJEXT) \ 183 Parser/driver_cfa_cpp-parser.$(OBJEXT) \ 184 Parser/driver_cfa_cpp-lex.$(OBJEXT) \ 185 Parser/driver_cfa_cpp-TypedefTable.$(OBJEXT) \ 186 Parser/driver_cfa_cpp-ParseNode.$(OBJEXT) \ 187 Parser/driver_cfa_cpp-DeclarationNode.$(OBJEXT) \ 188 Parser/driver_cfa_cpp-ExpressionNode.$(OBJEXT) \ 189 Parser/driver_cfa_cpp-StatementNode.$(OBJEXT) \ 190 Parser/driver_cfa_cpp-InitializerNode.$(OBJEXT) \ 191 Parser/driver_cfa_cpp-TypeData.$(OBJEXT) \ 192 Parser/driver_cfa_cpp-LinkageSpec.$(OBJEXT) \ 193 Parser/driver_cfa_cpp-parserutility.$(OBJEXT) \ 194 ResolvExpr/driver_cfa_cpp-AlternativeFinder.$(OBJEXT) \ 195 ResolvExpr/driver_cfa_cpp-Alternative.$(OBJEXT) \ 196 ResolvExpr/driver_cfa_cpp-Unify.$(OBJEXT) \ 197 ResolvExpr/driver_cfa_cpp-PtrsAssignable.$(OBJEXT) \ 198 ResolvExpr/driver_cfa_cpp-CommonType.$(OBJEXT) \ 199 ResolvExpr/driver_cfa_cpp-ConversionCost.$(OBJEXT) \ 200 ResolvExpr/driver_cfa_cpp-CastCost.$(OBJEXT) \ 201 ResolvExpr/driver_cfa_cpp-PtrsCastable.$(OBJEXT) \ 202 ResolvExpr/driver_cfa_cpp-AdjustExprType.$(OBJEXT) \ 203 ResolvExpr/driver_cfa_cpp-AlternativePrinter.$(OBJEXT) \ 204 ResolvExpr/driver_cfa_cpp-Resolver.$(OBJEXT) \ 205 ResolvExpr/driver_cfa_cpp-ResolveTypeof.$(OBJEXT) \ 206 ResolvExpr/driver_cfa_cpp-RenameVars.$(OBJEXT) \ 207 ResolvExpr/driver_cfa_cpp-FindOpenVars.$(OBJEXT) \ 208 ResolvExpr/driver_cfa_cpp-PolyCost.$(OBJEXT) \ 209 ResolvExpr/driver_cfa_cpp-Occurs.$(OBJEXT) \ 210 ResolvExpr/driver_cfa_cpp-TypeEnvironment.$(OBJEXT) \ 211 ResolvExpr/driver_cfa_cpp-CurrentObject.$(OBJEXT) \ 212 ResolvExpr/driver_cfa_cpp-ExplodedActual.$(OBJEXT) \ 213 SymTab/driver_cfa_cpp-Indexer.$(OBJEXT) \ 214 SymTab/driver_cfa_cpp-Mangler.$(OBJEXT) \ 215 SymTab/driver_cfa_cpp-Validate.$(OBJEXT) \ 216 SymTab/driver_cfa_cpp-FixFunction.$(OBJEXT) \ 217 SymTab/driver_cfa_cpp-Autogen.$(OBJEXT) \ 218 SynTree/driver_cfa_cpp-Type.$(OBJEXT) \ 219 SynTree/driver_cfa_cpp-VoidType.$(OBJEXT) \ 220 SynTree/driver_cfa_cpp-BasicType.$(OBJEXT) \ 221 SynTree/driver_cfa_cpp-PointerType.$(OBJEXT) \ 222 SynTree/driver_cfa_cpp-ArrayType.$(OBJEXT) \ 223 SynTree/driver_cfa_cpp-ReferenceType.$(OBJEXT) \ 224 SynTree/driver_cfa_cpp-FunctionType.$(OBJEXT) \ 225 SynTree/driver_cfa_cpp-ReferenceToType.$(OBJEXT) \ 226 SynTree/driver_cfa_cpp-TupleType.$(OBJEXT) \ 227 SynTree/driver_cfa_cpp-TypeofType.$(OBJEXT) \ 228 SynTree/driver_cfa_cpp-AttrType.$(OBJEXT) \ 229 SynTree/driver_cfa_cpp-VarArgsType.$(OBJEXT) \ 230 SynTree/driver_cfa_cpp-ZeroOneType.$(OBJEXT) \ 231 SynTree/driver_cfa_cpp-Constant.$(OBJEXT) \ 232 SynTree/driver_cfa_cpp-Expression.$(OBJEXT) \ 233 SynTree/driver_cfa_cpp-TupleExpr.$(OBJEXT) \ 234 SynTree/driver_cfa_cpp-CommaExpr.$(OBJEXT) \ 235 SynTree/driver_cfa_cpp-TypeExpr.$(OBJEXT) \ 236 SynTree/driver_cfa_cpp-ApplicationExpr.$(OBJEXT) \ 237 SynTree/driver_cfa_cpp-AddressExpr.$(OBJEXT) \ 238 SynTree/driver_cfa_cpp-Statement.$(OBJEXT) \ 239 SynTree/driver_cfa_cpp-CompoundStmt.$(OBJEXT) \ 240 SynTree/driver_cfa_cpp-DeclStmt.$(OBJEXT) \ 241 SynTree/driver_cfa_cpp-Declaration.$(OBJEXT) \ 242 SynTree/driver_cfa_cpp-DeclarationWithType.$(OBJEXT) \ 243 SynTree/driver_cfa_cpp-ObjectDecl.$(OBJEXT) \ 244 SynTree/driver_cfa_cpp-FunctionDecl.$(OBJEXT) \ 245 SynTree/driver_cfa_cpp-AggregateDecl.$(OBJEXT) \ 246 SynTree/driver_cfa_cpp-NamedTypeDecl.$(OBJEXT) \ 247 SynTree/driver_cfa_cpp-TypeDecl.$(OBJEXT) \ 248 SynTree/driver_cfa_cpp-Initializer.$(OBJEXT) \ 249 SynTree/driver_cfa_cpp-Visitor.$(OBJEXT) \ 250 SynTree/driver_cfa_cpp-Mutator.$(OBJEXT) \ 251 SynTree/driver_cfa_cpp-TypeSubstitution.$(OBJEXT) \ 252 SynTree/driver_cfa_cpp-Attribute.$(OBJEXT) \ 253 SynTree/driver_cfa_cpp-VarExprReplacer.$(OBJEXT) \ 254 Tuples/driver_cfa_cpp-TupleAssignment.$(OBJEXT) \ 255 Tuples/driver_cfa_cpp-TupleExpansion.$(OBJEXT) \ 256 Tuples/driver_cfa_cpp-Explode.$(OBJEXT) \ 257 Virtual/driver_cfa_cpp-ExpandCasts.$(OBJEXT) 258 am_driver_cfa_cpp_OBJECTS = $(am__objects_1) 259 driver_cfa_cpp_OBJECTS = $(am_driver_cfa_cpp_OBJECTS) 260 driver_cfa_cpp_DEPENDENCIES = 261 driver_cfa_cpp_LINK = $(CXXLD) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) \ 262 $(driver_cfa_cpp_LDFLAGS) $(LDFLAGS) -o $@ 218 am__objects_1 = main.$(OBJEXT) MakeLibCfa.$(OBJEXT) \ 219 CompilationState.$(OBJEXT) CodeGen/Generate.$(OBJEXT) \ 220 CodeGen/CodeGenerator.$(OBJEXT) CodeGen/GenType.$(OBJEXT) \ 221 CodeGen/FixNames.$(OBJEXT) CodeGen/FixMain.$(OBJEXT) \ 222 CodeGen/OperatorTable.$(OBJEXT) CodeTools/DeclStats.$(OBJEXT) \ 223 CodeTools/TrackLoc.$(OBJEXT) Concurrency/Keywords.$(OBJEXT) \ 224 Concurrency/Waitfor.$(OBJEXT) Common/SemanticError.$(OBJEXT) \ 225 Common/UniqueName.$(OBJEXT) Common/DebugMalloc.$(OBJEXT) \ 226 Common/Assert.$(OBJEXT) Common/Heap.$(OBJEXT) \ 227 Common/Eval.$(OBJEXT) ControlStruct/LabelGenerator.$(OBJEXT) \ 228 ControlStruct/LabelFixer.$(OBJEXT) \ 229 ControlStruct/MLEMutator.$(OBJEXT) \ 230 ControlStruct/Mutate.$(OBJEXT) \ 231 ControlStruct/ForExprMutator.$(OBJEXT) \ 232 ControlStruct/ExceptTranslate.$(OBJEXT) GenPoly/Box.$(OBJEXT) \ 233 GenPoly/GenPoly.$(OBJEXT) GenPoly/ScrubTyVars.$(OBJEXT) \ 234 GenPoly/Lvalue.$(OBJEXT) GenPoly/Specialize.$(OBJEXT) \ 235 GenPoly/FindFunction.$(OBJEXT) \ 236 GenPoly/InstantiateGeneric.$(OBJEXT) \ 237 InitTweak/GenInit.$(OBJEXT) InitTweak/FixInit.$(OBJEXT) \ 238 InitTweak/FixGlobalInit.$(OBJEXT) \ 239 InitTweak/InitTweak.$(OBJEXT) Parser/parser.$(OBJEXT) \ 240 Parser/lex.$(OBJEXT) Parser/TypedefTable.$(OBJEXT) \ 241 Parser/ParseNode.$(OBJEXT) Parser/DeclarationNode.$(OBJEXT) \ 242 Parser/ExpressionNode.$(OBJEXT) Parser/StatementNode.$(OBJEXT) \ 243 Parser/InitializerNode.$(OBJEXT) Parser/TypeData.$(OBJEXT) \ 244 Parser/LinkageSpec.$(OBJEXT) Parser/parserutility.$(OBJEXT) \ 245 ResolvExpr/AlternativeFinder.$(OBJEXT) \ 246 ResolvExpr/Alternative.$(OBJEXT) ResolvExpr/Unify.$(OBJEXT) \ 247 ResolvExpr/PtrsAssignable.$(OBJEXT) \ 248 ResolvExpr/CommonType.$(OBJEXT) \ 249 ResolvExpr/ConversionCost.$(OBJEXT) \ 250 ResolvExpr/CastCost.$(OBJEXT) \ 251 ResolvExpr/PtrsCastable.$(OBJEXT) \ 252 ResolvExpr/AdjustExprType.$(OBJEXT) \ 253 ResolvExpr/AlternativePrinter.$(OBJEXT) \ 254 ResolvExpr/Resolver.$(OBJEXT) \ 255 ResolvExpr/ResolveTypeof.$(OBJEXT) \ 256 ResolvExpr/RenameVars.$(OBJEXT) \ 257 ResolvExpr/FindOpenVars.$(OBJEXT) \ 258 ResolvExpr/PolyCost.$(OBJEXT) ResolvExpr/Occurs.$(OBJEXT) \ 259 ResolvExpr/TypeEnvironment.$(OBJEXT) \ 260 ResolvExpr/CurrentObject.$(OBJEXT) \ 261 ResolvExpr/ExplodedActual.$(OBJEXT) SymTab/Indexer.$(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) \ 268 SynTree/ReferenceToType.$(OBJEXT) SynTree/TupleType.$(OBJEXT) \ 269 SynTree/TypeofType.$(OBJEXT) SynTree/AttrType.$(OBJEXT) \ 270 SynTree/VarArgsType.$(OBJEXT) SynTree/ZeroOneType.$(OBJEXT) \ 271 SynTree/Constant.$(OBJEXT) SynTree/Expression.$(OBJEXT) \ 272 SynTree/TupleExpr.$(OBJEXT) SynTree/CommaExpr.$(OBJEXT) \ 273 SynTree/TypeExpr.$(OBJEXT) SynTree/ApplicationExpr.$(OBJEXT) \ 274 SynTree/AddressExpr.$(OBJEXT) SynTree/Statement.$(OBJEXT) \ 275 SynTree/CompoundStmt.$(OBJEXT) SynTree/DeclStmt.$(OBJEXT) \ 276 SynTree/Declaration.$(OBJEXT) \ 277 SynTree/DeclarationWithType.$(OBJEXT) \ 278 SynTree/ObjectDecl.$(OBJEXT) SynTree/FunctionDecl.$(OBJEXT) \ 279 SynTree/AggregateDecl.$(OBJEXT) \ 280 SynTree/NamedTypeDecl.$(OBJEXT) SynTree/TypeDecl.$(OBJEXT) \ 281 SynTree/Initializer.$(OBJEXT) \ 282 SynTree/TypeSubstitution.$(OBJEXT) SynTree/Attribute.$(OBJEXT) \ 283 SynTree/DeclReplacer.$(OBJEXT) \ 284 Tuples/TupleAssignment.$(OBJEXT) \ 285 Tuples/TupleExpansion.$(OBJEXT) Tuples/Explode.$(OBJEXT) \ 286 Validate/HandleAttributes.$(OBJEXT) \ 287 Virtual/ExpandCasts.$(OBJEXT) 288 am____driver_cfa_cpp_OBJECTS = $(am__objects_1) 289 ___driver_cfa_cpp_OBJECTS = $(am____driver_cfa_cpp_OBJECTS) 290 ___driver_cfa_cpp_DEPENDENCIES = 291 am_demangler_OBJECTS = SymTab/demangler.$(OBJEXT) 292 demangler_OBJECTS = $(am_demangler_OBJECTS) 293 demangler_DEPENDENCIES = libdemangle.a 263 294 AM_V_P = $(am__v_P_@AM_V@) 264 295 am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) … … 277 308 am__depfiles_maybe = depfiles 278 309 am__mv = mv -f 279 AM_V_lt = $(am__v_lt_@AM_V@)280 am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@)281 am__v_lt_0 = --silent282 am__v_lt_1 =283 310 CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ 284 311 $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) … … 294 321 am__v_CXXLD_0 = @echo " CXXLD " $@; 295 322 am__v_CXXLD_1 = 296 @MAINTAINER_MODE_FALSE@am__skiplex = test -f $@ ||297 323 LEXCOMPILE = $(LEX) $(AM_LFLAGS) $(LFLAGS) 298 324 AM_V_LEX = $(am__v_LEX_@AM_V@) … … 301 327 am__v_LEX_1 = 302 328 YLWRAP = $(top_srcdir)/automake/ylwrap 303 @MAINTAINER_MODE_FALSE@am__skipyacc = test -f $@ ||304 329 am__yacc_c2h = sed -e s/cc$$/hh/ -e s/cpp$$/hpp/ -e s/cxx$$/hxx/ \ 305 330 -e s/c++$$/h++/ -e s/c$$/h/ … … 321 346 am__v_CCLD_0 = @echo " CCLD " $@; 322 347 am__v_CCLD_1 = 323 SOURCES = $(driver_cfa_cpp_SOURCES) 324 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) 325 352 am__can_run_installinfo = \ 326 353 case $$AM_UPDATE_INFO_DIR in \ … … 328 355 *) (install-info --version) >/dev/null 2>&1;; \ 329 356 esac 330 am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) 357 am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) \ 358 $(LISP)config.h.in 331 359 # Read a list of newline-separated strings from the standard input, 332 360 # and print each of them once, without duplicates. Input order is … … 354 382 $(srcdir)/Parser/module.mk $(srcdir)/ResolvExpr/module.mk \ 355 383 $(srcdir)/SymTab/module.mk $(srcdir)/SynTree/module.mk \ 356 $(srcdir)/Tuples/module.mk $(srcdir)/Virtual/module.mk \ 357 $(top_srcdir)/automake/depcomp $(top_srcdir)/automake/ylwrap \ 358 Parser/lex.cc Parser/parser.cc Parser/parser.hh 384 $(srcdir)/Tuples/module.mk $(srcdir)/Validate/module.mk \ 385 $(srcdir)/Virtual/module.mk $(top_srcdir)/automake/depcomp \ 386 $(top_srcdir)/automake/ylwrap Parser/lex.cc Parser/parser.cc \ 387 Parser/parser.hh 359 388 DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) 360 389 ACLOCAL = @ACLOCAL@ … … 367 396 AWK = @AWK@ 368 397 BACKEND_CC = @BACKEND_CC@ 398 BUILD_IN_TREE_FLAGS = @BUILD_IN_TREE_FLAGS@ 369 399 CC = @CC@ 370 400 CCAS = @CCAS@ … … 372 402 CCASFLAGS = @CCASFLAGS@ 373 403 CCDEPMODE = @CCDEPMODE@ 404 CFACC = @CFACC@ 405 CFACPP = @CFACPP@ 374 406 CFA_BACKEND_CC = @CFA_BACKEND_CC@ 375 407 CFA_BINDIR = @CFA_BINDIR@ … … 388 420 DEFS = @DEFS@ 389 421 DEPDIR = @DEPDIR@ 422 DRIVER_DIR = @DRIVER_DIR@ 390 423 ECHO_C = @ECHO_C@ 391 424 ECHO_N = @ECHO_N@ … … 394 427 EXEEXT = @EXEEXT@ 395 428 GREP = @GREP@ 429 HOST_FLAGS = @HOST_FLAGS@ 396 430 INSTALL = @INSTALL@ 397 431 INSTALL_DATA = @INSTALL_DATA@ … … 403 437 LEXLIB = @LEXLIB@ 404 438 LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@ 439 LIBCFA_TARGET_DIRS = @LIBCFA_TARGET_DIRS@ 440 LIBCFA_TARGET_MAKEFILES = @LIBCFA_TARGET_MAKEFILES@ 405 441 LIBOBJS = @LIBOBJS@ 406 442 LIBS = @LIBS@ 407 443 LTLIBOBJS = @LTLIBOBJS@ 408 MACHINE_TYPE = @MACHINE_TYPE@409 MAINT = @MAINT@410 444 MAKEINFO = @MAKEINFO@ 411 445 MKDIR_P = @MKDIR_P@ … … 423 457 SHELL = @SHELL@ 424 458 STRIP = @STRIP@ 459 TARGET_HOSTS = @TARGET_HOSTS@ 425 460 VERSION = @VERSION@ 426 461 YACC = @YACC@ … … 480 515 481 516 # create object files in directory with source files 482 AUTOMAKE_OPTIONS = subdir-objects483 SRC = main.cc MakeLibCfa.cc Co deGen/Generate.cc \517 AUTOMAKE_OPTIONS = foreign subdir-objects 518 SRC = main.cc MakeLibCfa.cc CompilationState.cc CodeGen/Generate.cc \ 484 519 CodeGen/CodeGenerator.cc CodeGen/GenType.cc \ 485 520 CodeGen/FixNames.cc CodeGen/FixMain.cc \ … … 488 523 Concurrency/Waitfor.cc Common/SemanticError.cc \ 489 524 Common/UniqueName.cc Common/DebugMalloc.cc Common/Assert.cc \ 490 Co ntrolStruct/LabelGenerator.cc ControlStruct/LabelFixer.cc \491 ControlStruct/ MLEMutator.cc ControlStruct/Mutate.cc \492 ControlStruct/ ForExprMutator.cc \525 Common/Heap.cc Common/Eval.cc ControlStruct/LabelGenerator.cc \ 526 ControlStruct/LabelFixer.cc ControlStruct/MLEMutator.cc \ 527 ControlStruct/Mutate.cc ControlStruct/ForExprMutator.cc \ 493 528 ControlStruct/ExceptTranslate.cc GenPoly/Box.cc \ 494 529 GenPoly/GenPoly.cc GenPoly/ScrubTyVars.cc GenPoly/Lvalue.cc \ … … 511 546 ResolvExpr/Occurs.cc ResolvExpr/TypeEnvironment.cc \ 512 547 ResolvExpr/CurrentObject.cc ResolvExpr/ExplodedActual.cc \ 513 SymTab/Indexer.cc SymTab/Mangler.cc SymTab/ Validate.cc \514 SymTab/ FixFunction.cc SymTab/Autogen.cc SynTree/Type.cc \515 SynTree/ VoidType.cc SynTree/BasicType.cc \548 SymTab/Indexer.cc SymTab/Mangler.cc SymTab/ManglerCommon.cc \ 549 SymTab/Validate.cc SymTab/FixFunction.cc SymTab/Autogen.cc \ 550 SynTree/Type.cc SynTree/VoidType.cc SynTree/BasicType.cc \ 516 551 SynTree/PointerType.cc SynTree/ArrayType.cc \ 517 552 SynTree/ReferenceType.cc SynTree/FunctionType.cc \ … … 527 562 SynTree/FunctionDecl.cc SynTree/AggregateDecl.cc \ 528 563 SynTree/NamedTypeDecl.cc SynTree/TypeDecl.cc \ 529 SynTree/Initializer.cc SynTree/ Visitor.cc SynTree/Mutator.cc \530 SynTree/ TypeSubstitution.cc SynTree/Attribute.cc \531 SynTree/VarExprReplacer.cc Tuples/TupleAssignment.cc \532 Tuples/ TupleExpansion.cc Tuples/Explode.cc \564 SynTree/Initializer.cc SynTree/TypeSubstitution.cc \ 565 SynTree/Attribute.cc SynTree/DeclReplacer.cc \ 566 Tuples/TupleAssignment.cc Tuples/TupleExpansion.cc \ 567 Tuples/Explode.cc Validate/HandleAttributes.cc \ 533 568 Virtual/ExpandCasts.cc 534 MAINTAINERCLEANFILES = Parser/parser.output ${libdir}/${notdir \535 ${cfa_cpplib_PROGRAMS}} 569 MAINTAINERCLEANFILES = ${libdir}/${notdir ${cfa_cpplib_PROGRAMS}} 570 MOSTLYCLEANFILES = Parser/parser.hh Parser/parser.output 536 571 BUILT_SOURCES = Parser/parser.hh 537 572 AM_YFLAGS = -d -t -v … … 540 575 541 576 # put into lib for now 542 cfa_cpplibdir = ${CFA_LIBDIR} 543 driver_cfa_cpp_SOURCES = ${SRC} 544 driver_cfa_cpp_LDADD = -ldl # yywrap 545 driver_cfa_cpp_CXXFLAGS = -Wno-deprecated -Wall -Wextra -DDEBUG_ALL -I${abs_top_srcdir}/src/include -DYY_NO_INPUT -O2 -g -std=c++14 546 driver_cfa_cpp_LDFLAGS = -Xlinker -export-dynamic 577 cfa_cpplibdir = $(CFA_LIBDIR) 578 ___driver_cfa_cpp_SOURCES = $(SRC) 579 ___driver_cfa_cpp_LDADD = -ldl # yywrap 580 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 581 AM_LDFLAGS = @HOST_FLAGS@ -Xlinker -export-dynamic 582 demangler_SOURCES = SymTab/demangler.cc 583 demangler_LDADD = libdemangle.a # yywrap 584 noinst_LIBRARIES = libdemangle.a 585 libdemangle_a_SOURCES = SymTab/Demangle.cc SymTab/ManglerCommon.cc \ 586 SynTree/Type.cc \ 587 SynTree/VoidType.cc \ 588 SynTree/BasicType.cc \ 589 SynTree/PointerType.cc \ 590 SynTree/ArrayType.cc \ 591 SynTree/ReferenceType.cc \ 592 SynTree/FunctionType.cc \ 593 SynTree/ReferenceToType.cc \ 594 SynTree/TupleType.cc \ 595 SynTree/TypeofType.cc \ 596 SynTree/AttrType.cc \ 597 SynTree/VarArgsType.cc \ 598 SynTree/ZeroOneType.cc \ 599 SynTree/Constant.cc \ 600 SynTree/Expression.cc \ 601 SynTree/TupleExpr.cc \ 602 SynTree/CommaExpr.cc \ 603 SynTree/TypeExpr.cc \ 604 SynTree/ApplicationExpr.cc \ 605 SynTree/AddressExpr.cc \ 606 SynTree/Statement.cc \ 607 SynTree/CompoundStmt.cc \ 608 SynTree/DeclStmt.cc \ 609 SynTree/Declaration.cc \ 610 SynTree/DeclarationWithType.cc \ 611 SynTree/ObjectDecl.cc \ 612 SynTree/FunctionDecl.cc \ 613 SynTree/AggregateDecl.cc \ 614 SynTree/NamedTypeDecl.cc \ 615 SynTree/TypeDecl.cc \ 616 SynTree/Initializer.cc \ 617 SynTree/TypeSubstitution.cc \ 618 SynTree/Attribute.cc \ 619 SynTree/DeclReplacer.cc \ 620 CompilationState.cc \ 621 CodeGen/CodeGenerator.cc \ 622 CodeGen/FixMain.cc \ 623 CodeGen/GenType.cc \ 624 CodeGen/OperatorTable.cc \ 625 Common/Assert.cc \ 626 Common/Eval.cc \ 627 Common/SemanticError.cc \ 628 Common/UniqueName.cc \ 629 Concurrency/Keywords.cc \ 630 ControlStruct/ForExprMutator.cc \ 631 ControlStruct/LabelFixer.cc \ 632 ControlStruct/LabelGenerator.cc \ 633 ControlStruct/MLEMutator.cc \ 634 ControlStruct/Mutate.cc \ 635 GenPoly/GenPoly.cc \ 636 GenPoly/Lvalue.cc \ 637 InitTweak/GenInit.cc \ 638 InitTweak/InitTweak.cc \ 639 Parser/LinkageSpec.cc \ 640 ResolvExpr/AdjustExprType.cc \ 641 ResolvExpr/Alternative.cc \ 642 ResolvExpr/AlternativeFinder.cc \ 643 ResolvExpr/ExplodedActual.cc \ 644 ResolvExpr/CastCost.cc \ 645 ResolvExpr/CommonType.cc \ 646 ResolvExpr/ConversionCost.cc \ 647 ResolvExpr/CurrentObject.cc \ 648 ResolvExpr/FindOpenVars.cc \ 649 ResolvExpr/Occurs.cc \ 650 ResolvExpr/PolyCost.cc \ 651 ResolvExpr/PtrsAssignable.cc \ 652 ResolvExpr/PtrsCastable.cc \ 653 ResolvExpr/RenameVars.cc \ 654 ResolvExpr/Resolver.cc \ 655 ResolvExpr/ResolveTypeof.cc \ 656 ResolvExpr/TypeEnvironment.cc \ 657 ResolvExpr/Unify.cc \ 658 SymTab/Autogen.cc \ 659 SymTab/FixFunction.cc \ 660 SymTab/Indexer.cc \ 661 SymTab/Mangler.cc \ 662 SymTab/Validate.cc \ 663 Tuples/Explode.cc \ 664 Tuples/TupleAssignment.cc \ 665 Tuples/TupleExpansion.cc \ 666 Validate/HandleAttributes.cc 667 547 668 all: $(BUILT_SOURCES) 548 669 $(MAKE) $(AM_MAKEFLAGS) all-am … … 550 671 .SUFFIXES: 551 672 .SUFFIXES: .cc .ll .o .obj .yy 552 $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(srcdir)/CodeGen/module.mk $(srcdir)/CodeTools/module.mk $(srcdir)/Concurrency/module.mk $(srcdir)/Common/module.mk $(srcdir)/ControlStruct/module.mk $(srcdir)/GenPoly/module.mk $(srcdir)/InitTweak/module.mk $(srcdir)/Parser/module.mk $(srcdir)/ResolvExpr/module.mk $(srcdir)/SymTab/module.mk $(srcdir)/SynTree/module.mk $(srcdir)/Tuples/module.mk $(srcdir)/Virtual/module.mk $(am__configure_deps)673 $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(srcdir)/CodeGen/module.mk $(srcdir)/CodeTools/module.mk $(srcdir)/Concurrency/module.mk $(srcdir)/Common/module.mk $(srcdir)/ControlStruct/module.mk $(srcdir)/GenPoly/module.mk $(srcdir)/InitTweak/module.mk $(srcdir)/Parser/module.mk $(srcdir)/ResolvExpr/module.mk $(srcdir)/SymTab/module.mk $(srcdir)/SynTree/module.mk $(srcdir)/Tuples/module.mk $(srcdir)/Validate/module.mk $(srcdir)/Virtual/module.mk $(am__configure_deps) 553 674 @for dep in $?; do \ 554 675 case '$(am__configure_deps)' in \ … … 570 691 cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ 571 692 esac; 572 $(srcdir)/CodeGen/module.mk $(srcdir)/CodeTools/module.mk $(srcdir)/Concurrency/module.mk $(srcdir)/Common/module.mk $(srcdir)/ControlStruct/module.mk $(srcdir)/GenPoly/module.mk $(srcdir)/InitTweak/module.mk $(srcdir)/Parser/module.mk $(srcdir)/ResolvExpr/module.mk $(srcdir)/SymTab/module.mk $(srcdir)/SynTree/module.mk $(srcdir)/Tuples/module.mk $(srcdir)/V irtual/module.mk $(am__empty):693 $(srcdir)/CodeGen/module.mk $(srcdir)/CodeTools/module.mk $(srcdir)/Concurrency/module.mk $(srcdir)/Common/module.mk $(srcdir)/ControlStruct/module.mk $(srcdir)/GenPoly/module.mk $(srcdir)/InitTweak/module.mk $(srcdir)/Parser/module.mk $(srcdir)/ResolvExpr/module.mk $(srcdir)/SymTab/module.mk $(srcdir)/SynTree/module.mk $(srcdir)/Tuples/module.mk $(srcdir)/Validate/module.mk $(srcdir)/Virtual/module.mk $(am__empty): 573 694 574 695 $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) 575 696 cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh 576 697 577 $(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@$(am__configure_deps)698 $(top_srcdir)/configure: $(am__configure_deps) 578 699 cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh 579 $(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@$(am__aclocal_m4_deps)700 $(ACLOCAL_M4): $(am__aclocal_m4_deps) 580 701 cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh 581 702 $(am__aclocal_m4_deps): 703 704 clean-noinstLIBRARIES: 705 -test -z "$(noinst_LIBRARIES)" || rm -f $(noinst_LIBRARIES) 706 SymTab/$(am__dirstamp): 707 @$(MKDIR_P) SymTab 708 @: > SymTab/$(am__dirstamp) 709 SymTab/$(DEPDIR)/$(am__dirstamp): 710 @$(MKDIR_P) SymTab/$(DEPDIR) 711 @: > SymTab/$(DEPDIR)/$(am__dirstamp) 712 SymTab/Demangle.$(OBJEXT): SymTab/$(am__dirstamp) \ 713 SymTab/$(DEPDIR)/$(am__dirstamp) 714 SymTab/ManglerCommon.$(OBJEXT): SymTab/$(am__dirstamp) \ 715 SymTab/$(DEPDIR)/$(am__dirstamp) 716 SynTree/$(am__dirstamp): 717 @$(MKDIR_P) SynTree 718 @: > SynTree/$(am__dirstamp) 719 SynTree/$(DEPDIR)/$(am__dirstamp): 720 @$(MKDIR_P) SynTree/$(DEPDIR) 721 @: > SynTree/$(DEPDIR)/$(am__dirstamp) 722 SynTree/Type.$(OBJEXT): SynTree/$(am__dirstamp) \ 723 SynTree/$(DEPDIR)/$(am__dirstamp) 724 SynTree/VoidType.$(OBJEXT): SynTree/$(am__dirstamp) \ 725 SynTree/$(DEPDIR)/$(am__dirstamp) 726 SynTree/BasicType.$(OBJEXT): SynTree/$(am__dirstamp) \ 727 SynTree/$(DEPDIR)/$(am__dirstamp) 728 SynTree/PointerType.$(OBJEXT): SynTree/$(am__dirstamp) \ 729 SynTree/$(DEPDIR)/$(am__dirstamp) 730 SynTree/ArrayType.$(OBJEXT): SynTree/$(am__dirstamp) \ 731 SynTree/$(DEPDIR)/$(am__dirstamp) 732 SynTree/ReferenceType.$(OBJEXT): SynTree/$(am__dirstamp) \ 733 SynTree/$(DEPDIR)/$(am__dirstamp) 734 SynTree/FunctionType.$(OBJEXT): SynTree/$(am__dirstamp) \ 735 SynTree/$(DEPDIR)/$(am__dirstamp) 736 SynTree/ReferenceToType.$(OBJEXT): SynTree/$(am__dirstamp) \ 737 SynTree/$(DEPDIR)/$(am__dirstamp) 738 SynTree/TupleType.$(OBJEXT): SynTree/$(am__dirstamp) \ 739 SynTree/$(DEPDIR)/$(am__dirstamp) 740 SynTree/TypeofType.$(OBJEXT): SynTree/$(am__dirstamp) \ 741 SynTree/$(DEPDIR)/$(am__dirstamp) 742 SynTree/AttrType.$(OBJEXT): SynTree/$(am__dirstamp) \ 743 SynTree/$(DEPDIR)/$(am__dirstamp) 744 SynTree/VarArgsType.$(OBJEXT): SynTree/$(am__dirstamp) \ 745 SynTree/$(DEPDIR)/$(am__dirstamp) 746 SynTree/ZeroOneType.$(OBJEXT): SynTree/$(am__dirstamp) \ 747 SynTree/$(DEPDIR)/$(am__dirstamp) 748 SynTree/Constant.$(OBJEXT): SynTree/$(am__dirstamp) \ 749 SynTree/$(DEPDIR)/$(am__dirstamp) 750 SynTree/Expression.$(OBJEXT): SynTree/$(am__dirstamp) \ 751 SynTree/$(DEPDIR)/$(am__dirstamp) 752 SynTree/TupleExpr.$(OBJEXT): SynTree/$(am__dirstamp) \ 753 SynTree/$(DEPDIR)/$(am__dirstamp) 754 SynTree/CommaExpr.$(OBJEXT): SynTree/$(am__dirstamp) \ 755 SynTree/$(DEPDIR)/$(am__dirstamp) 756 SynTree/TypeExpr.$(OBJEXT): SynTree/$(am__dirstamp) \ 757 SynTree/$(DEPDIR)/$(am__dirstamp) 758 SynTree/ApplicationExpr.$(OBJEXT): SynTree/$(am__dirstamp) \ 759 SynTree/$(DEPDIR)/$(am__dirstamp) 760 SynTree/AddressExpr.$(OBJEXT): SynTree/$(am__dirstamp) \ 761 SynTree/$(DEPDIR)/$(am__dirstamp) 762 SynTree/Statement.$(OBJEXT): SynTree/$(am__dirstamp) \ 763 SynTree/$(DEPDIR)/$(am__dirstamp) 764 SynTree/CompoundStmt.$(OBJEXT): SynTree/$(am__dirstamp) \ 765 SynTree/$(DEPDIR)/$(am__dirstamp) 766 SynTree/DeclStmt.$(OBJEXT): SynTree/$(am__dirstamp) \ 767 SynTree/$(DEPDIR)/$(am__dirstamp) 768 SynTree/Declaration.$(OBJEXT): SynTree/$(am__dirstamp) \ 769 SynTree/$(DEPDIR)/$(am__dirstamp) 770 SynTree/DeclarationWithType.$(OBJEXT): SynTree/$(am__dirstamp) \ 771 SynTree/$(DEPDIR)/$(am__dirstamp) 772 SynTree/ObjectDecl.$(OBJEXT): SynTree/$(am__dirstamp) \ 773 SynTree/$(DEPDIR)/$(am__dirstamp) 774 SynTree/FunctionDecl.$(OBJEXT): SynTree/$(am__dirstamp) \ 775 SynTree/$(DEPDIR)/$(am__dirstamp) 776 SynTree/AggregateDecl.$(OBJEXT): SynTree/$(am__dirstamp) \ 777 SynTree/$(DEPDIR)/$(am__dirstamp) 778 SynTree/NamedTypeDecl.$(OBJEXT): SynTree/$(am__dirstamp) \ 779 SynTree/$(DEPDIR)/$(am__dirstamp) 780 SynTree/TypeDecl.$(OBJEXT): SynTree/$(am__dirstamp) \ 781 SynTree/$(DEPDIR)/$(am__dirstamp) 782 SynTree/Initializer.$(OBJEXT): SynTree/$(am__dirstamp) \ 783 SynTree/$(DEPDIR)/$(am__dirstamp) 784 SynTree/TypeSubstitution.$(OBJEXT): SynTree/$(am__dirstamp) \ 785 SynTree/$(DEPDIR)/$(am__dirstamp) 786 SynTree/Attribute.$(OBJEXT): SynTree/$(am__dirstamp) \ 787 SynTree/$(DEPDIR)/$(am__dirstamp) 788 SynTree/DeclReplacer.$(OBJEXT): SynTree/$(am__dirstamp) \ 789 SynTree/$(DEPDIR)/$(am__dirstamp) 790 CodeGen/$(am__dirstamp): 791 @$(MKDIR_P) CodeGen 792 @: > CodeGen/$(am__dirstamp) 793 CodeGen/$(DEPDIR)/$(am__dirstamp): 794 @$(MKDIR_P) CodeGen/$(DEPDIR) 795 @: > CodeGen/$(DEPDIR)/$(am__dirstamp) 796 CodeGen/CodeGenerator.$(OBJEXT): CodeGen/$(am__dirstamp) \ 797 CodeGen/$(DEPDIR)/$(am__dirstamp) 798 CodeGen/FixMain.$(OBJEXT): CodeGen/$(am__dirstamp) \ 799 CodeGen/$(DEPDIR)/$(am__dirstamp) 800 CodeGen/GenType.$(OBJEXT): CodeGen/$(am__dirstamp) \ 801 CodeGen/$(DEPDIR)/$(am__dirstamp) 802 CodeGen/OperatorTable.$(OBJEXT): CodeGen/$(am__dirstamp) \ 803 CodeGen/$(DEPDIR)/$(am__dirstamp) 804 Common/$(am__dirstamp): 805 @$(MKDIR_P) Common 806 @: > Common/$(am__dirstamp) 807 Common/$(DEPDIR)/$(am__dirstamp): 808 @$(MKDIR_P) Common/$(DEPDIR) 809 @: > Common/$(DEPDIR)/$(am__dirstamp) 810 Common/Assert.$(OBJEXT): Common/$(am__dirstamp) \ 811 Common/$(DEPDIR)/$(am__dirstamp) 812 Common/Eval.$(OBJEXT): Common/$(am__dirstamp) \ 813 Common/$(DEPDIR)/$(am__dirstamp) 814 Common/SemanticError.$(OBJEXT): Common/$(am__dirstamp) \ 815 Common/$(DEPDIR)/$(am__dirstamp) 816 Common/UniqueName.$(OBJEXT): Common/$(am__dirstamp) \ 817 Common/$(DEPDIR)/$(am__dirstamp) 818 Concurrency/$(am__dirstamp): 819 @$(MKDIR_P) Concurrency 820 @: > Concurrency/$(am__dirstamp) 821 Concurrency/$(DEPDIR)/$(am__dirstamp): 822 @$(MKDIR_P) Concurrency/$(DEPDIR) 823 @: > Concurrency/$(DEPDIR)/$(am__dirstamp) 824 Concurrency/Keywords.$(OBJEXT): Concurrency/$(am__dirstamp) \ 825 Concurrency/$(DEPDIR)/$(am__dirstamp) 826 ControlStruct/$(am__dirstamp): 827 @$(MKDIR_P) ControlStruct 828 @: > ControlStruct/$(am__dirstamp) 829 ControlStruct/$(DEPDIR)/$(am__dirstamp): 830 @$(MKDIR_P) ControlStruct/$(DEPDIR) 831 @: > ControlStruct/$(DEPDIR)/$(am__dirstamp) 832 ControlStruct/ForExprMutator.$(OBJEXT): ControlStruct/$(am__dirstamp) \ 833 ControlStruct/$(DEPDIR)/$(am__dirstamp) 834 ControlStruct/LabelFixer.$(OBJEXT): ControlStruct/$(am__dirstamp) \ 835 ControlStruct/$(DEPDIR)/$(am__dirstamp) 836 ControlStruct/LabelGenerator.$(OBJEXT): ControlStruct/$(am__dirstamp) \ 837 ControlStruct/$(DEPDIR)/$(am__dirstamp) 838 ControlStruct/MLEMutator.$(OBJEXT): ControlStruct/$(am__dirstamp) \ 839 ControlStruct/$(DEPDIR)/$(am__dirstamp) 840 ControlStruct/Mutate.$(OBJEXT): ControlStruct/$(am__dirstamp) \ 841 ControlStruct/$(DEPDIR)/$(am__dirstamp) 842 GenPoly/$(am__dirstamp): 843 @$(MKDIR_P) GenPoly 844 @: > GenPoly/$(am__dirstamp) 845 GenPoly/$(DEPDIR)/$(am__dirstamp): 846 @$(MKDIR_P) GenPoly/$(DEPDIR) 847 @: > GenPoly/$(DEPDIR)/$(am__dirstamp) 848 GenPoly/GenPoly.$(OBJEXT): GenPoly/$(am__dirstamp) \ 849 GenPoly/$(DEPDIR)/$(am__dirstamp) 850 GenPoly/Lvalue.$(OBJEXT): GenPoly/$(am__dirstamp) \ 851 GenPoly/$(DEPDIR)/$(am__dirstamp) 852 InitTweak/$(am__dirstamp): 853 @$(MKDIR_P) InitTweak 854 @: > InitTweak/$(am__dirstamp) 855 InitTweak/$(DEPDIR)/$(am__dirstamp): 856 @$(MKDIR_P) InitTweak/$(DEPDIR) 857 @: > InitTweak/$(DEPDIR)/$(am__dirstamp) 858 InitTweak/GenInit.$(OBJEXT): InitTweak/$(am__dirstamp) \ 859 InitTweak/$(DEPDIR)/$(am__dirstamp) 860 InitTweak/InitTweak.$(OBJEXT): InitTweak/$(am__dirstamp) \ 861 InitTweak/$(DEPDIR)/$(am__dirstamp) 862 Parser/$(am__dirstamp): 863 @$(MKDIR_P) Parser 864 @: > Parser/$(am__dirstamp) 865 Parser/$(DEPDIR)/$(am__dirstamp): 866 @$(MKDIR_P) Parser/$(DEPDIR) 867 @: > Parser/$(DEPDIR)/$(am__dirstamp) 868 Parser/LinkageSpec.$(OBJEXT): Parser/$(am__dirstamp) \ 869 Parser/$(DEPDIR)/$(am__dirstamp) 870 ResolvExpr/$(am__dirstamp): 871 @$(MKDIR_P) ResolvExpr 872 @: > ResolvExpr/$(am__dirstamp) 873 ResolvExpr/$(DEPDIR)/$(am__dirstamp): 874 @$(MKDIR_P) ResolvExpr/$(DEPDIR) 875 @: > ResolvExpr/$(DEPDIR)/$(am__dirstamp) 876 ResolvExpr/AdjustExprType.$(OBJEXT): ResolvExpr/$(am__dirstamp) \ 877 ResolvExpr/$(DEPDIR)/$(am__dirstamp) 878 ResolvExpr/Alternative.$(OBJEXT): ResolvExpr/$(am__dirstamp) \ 879 ResolvExpr/$(DEPDIR)/$(am__dirstamp) 880 ResolvExpr/AlternativeFinder.$(OBJEXT): ResolvExpr/$(am__dirstamp) \ 881 ResolvExpr/$(DEPDIR)/$(am__dirstamp) 882 ResolvExpr/ExplodedActual.$(OBJEXT): ResolvExpr/$(am__dirstamp) \ 883 ResolvExpr/$(DEPDIR)/$(am__dirstamp) 884 ResolvExpr/CastCost.$(OBJEXT): ResolvExpr/$(am__dirstamp) \ 885 ResolvExpr/$(DEPDIR)/$(am__dirstamp) 886 ResolvExpr/CommonType.$(OBJEXT): ResolvExpr/$(am__dirstamp) \ 887 ResolvExpr/$(DEPDIR)/$(am__dirstamp) 888 ResolvExpr/ConversionCost.$(OBJEXT): ResolvExpr/$(am__dirstamp) \ 889 ResolvExpr/$(DEPDIR)/$(am__dirstamp) 890 ResolvExpr/CurrentObject.$(OBJEXT): ResolvExpr/$(am__dirstamp) \ 891 ResolvExpr/$(DEPDIR)/$(am__dirstamp) 892 ResolvExpr/FindOpenVars.$(OBJEXT): ResolvExpr/$(am__dirstamp) \ 893 ResolvExpr/$(DEPDIR)/$(am__dirstamp) 894 ResolvExpr/Occurs.$(OBJEXT): ResolvExpr/$(am__dirstamp) \ 895 ResolvExpr/$(DEPDIR)/$(am__dirstamp) 896 ResolvExpr/PolyCost.$(OBJEXT): ResolvExpr/$(am__dirstamp) \ 897 ResolvExpr/$(DEPDIR)/$(am__dirstamp) 898 ResolvExpr/PtrsAssignable.$(OBJEXT): ResolvExpr/$(am__dirstamp) \ 899 ResolvExpr/$(DEPDIR)/$(am__dirstamp) 900 ResolvExpr/PtrsCastable.$(OBJEXT): ResolvExpr/$(am__dirstamp) \ 901 ResolvExpr/$(DEPDIR)/$(am__dirstamp) 902 ResolvExpr/RenameVars.$(OBJEXT): ResolvExpr/$(am__dirstamp) \ 903 ResolvExpr/$(DEPDIR)/$(am__dirstamp) 904 ResolvExpr/Resolver.$(OBJEXT): ResolvExpr/$(am__dirstamp) \ 905 ResolvExpr/$(DEPDIR)/$(am__dirstamp) 906 ResolvExpr/ResolveTypeof.$(OBJEXT): ResolvExpr/$(am__dirstamp) \ 907 ResolvExpr/$(DEPDIR)/$(am__dirstamp) 908 ResolvExpr/TypeEnvironment.$(OBJEXT): ResolvExpr/$(am__dirstamp) \ 909 ResolvExpr/$(DEPDIR)/$(am__dirstamp) 910 ResolvExpr/Unify.$(OBJEXT): ResolvExpr/$(am__dirstamp) \ 911 ResolvExpr/$(DEPDIR)/$(am__dirstamp) 912 SymTab/Autogen.$(OBJEXT): SymTab/$(am__dirstamp) \ 913 SymTab/$(DEPDIR)/$(am__dirstamp) 914 SymTab/FixFunction.$(OBJEXT): SymTab/$(am__dirstamp) \ 915 SymTab/$(DEPDIR)/$(am__dirstamp) 916 SymTab/Indexer.$(OBJEXT): SymTab/$(am__dirstamp) \ 917 SymTab/$(DEPDIR)/$(am__dirstamp) 918 SymTab/Mangler.$(OBJEXT): SymTab/$(am__dirstamp) \ 919 SymTab/$(DEPDIR)/$(am__dirstamp) 920 SymTab/Validate.$(OBJEXT): SymTab/$(am__dirstamp) \ 921 SymTab/$(DEPDIR)/$(am__dirstamp) 922 Tuples/$(am__dirstamp): 923 @$(MKDIR_P) Tuples 924 @: > Tuples/$(am__dirstamp) 925 Tuples/$(DEPDIR)/$(am__dirstamp): 926 @$(MKDIR_P) Tuples/$(DEPDIR) 927 @: > Tuples/$(DEPDIR)/$(am__dirstamp) 928 Tuples/Explode.$(OBJEXT): Tuples/$(am__dirstamp) \ 929 Tuples/$(DEPDIR)/$(am__dirstamp) 930 Tuples/TupleAssignment.$(OBJEXT): Tuples/$(am__dirstamp) \ 931 Tuples/$(DEPDIR)/$(am__dirstamp) 932 Tuples/TupleExpansion.$(OBJEXT): Tuples/$(am__dirstamp) \ 933 Tuples/$(DEPDIR)/$(am__dirstamp) 934 Validate/$(am__dirstamp): 935 @$(MKDIR_P) Validate 936 @: > Validate/$(am__dirstamp) 937 Validate/$(DEPDIR)/$(am__dirstamp): 938 @$(MKDIR_P) Validate/$(DEPDIR) 939 @: > Validate/$(DEPDIR)/$(am__dirstamp) 940 Validate/HandleAttributes.$(OBJEXT): Validate/$(am__dirstamp) \ 941 Validate/$(DEPDIR)/$(am__dirstamp) 942 943 libdemangle.a: $(libdemangle_a_OBJECTS) $(libdemangle_a_DEPENDENCIES) $(EXTRA_libdemangle_a_DEPENDENCIES) 944 $(AM_V_at)-rm -f libdemangle.a 945 $(AM_V_AR)$(libdemangle_a_AR) libdemangle.a $(libdemangle_a_OBJECTS) $(libdemangle_a_LIBADD) 946 $(AM_V_at)$(RANLIB) libdemangle.a 582 947 install-cfa_cpplibPROGRAMS: $(cfa_cpplib_PROGRAMS) 583 948 @$(NORMAL_INSTALL) … … 622 987 clean-cfa_cpplibPROGRAMS: 623 988 -test -z "$(cfa_cpplib_PROGRAMS)" || rm -f $(cfa_cpplib_PROGRAMS) 624 CodeGen/$(am__dirstamp): 625 @$(MKDIR_P) CodeGen 626 @: > CodeGen/$(am__dirstamp) 627 CodeGen/$(DEPDIR)/$(am__dirstamp): 628 @$(MKDIR_P) CodeGen/$(DEPDIR) 629 @: > CodeGen/$(DEPDIR)/$(am__dirstamp) 630 CodeGen/driver_cfa_cpp-Generate.$(OBJEXT): CodeGen/$(am__dirstamp) \ 989 CodeGen/Generate.$(OBJEXT): CodeGen/$(am__dirstamp) \ 631 990 CodeGen/$(DEPDIR)/$(am__dirstamp) 632 CodeGen/driver_cfa_cpp-CodeGenerator.$(OBJEXT): \ 633 CodeGen/$(am__dirstamp) CodeGen/$(DEPDIR)/$(am__dirstamp) 634 CodeGen/driver_cfa_cpp-GenType.$(OBJEXT): CodeGen/$(am__dirstamp) \ 991 CodeGen/FixNames.$(OBJEXT): CodeGen/$(am__dirstamp) \ 635 992 CodeGen/$(DEPDIR)/$(am__dirstamp) 636 CodeGen/driver_cfa_cpp-FixNames.$(OBJEXT): CodeGen/$(am__dirstamp) \637 CodeGen/$(DEPDIR)/$(am__dirstamp)638 CodeGen/driver_cfa_cpp-FixMain.$(OBJEXT): CodeGen/$(am__dirstamp) \639 CodeGen/$(DEPDIR)/$(am__dirstamp)640 CodeGen/driver_cfa_cpp-OperatorTable.$(OBJEXT): \641 CodeGen/$(am__dirstamp) CodeGen/$(DEPDIR)/$(am__dirstamp)642 993 CodeTools/$(am__dirstamp): 643 994 @$(MKDIR_P) CodeTools … … 646 997 @$(MKDIR_P) CodeTools/$(DEPDIR) 647 998 @: > CodeTools/$(DEPDIR)/$(am__dirstamp) 648 CodeTools/driver_cfa_cpp-DeclStats.$(OBJEXT): \ 649 CodeTools/$(am__dirstamp) CodeTools/$(DEPDIR)/$(am__dirstamp) 650 CodeTools/driver_cfa_cpp-TrackLoc.$(OBJEXT): \ 651 CodeTools/$(am__dirstamp) CodeTools/$(DEPDIR)/$(am__dirstamp) 652 Concurrency/$(am__dirstamp): 653 @$(MKDIR_P) Concurrency 654 @: > Concurrency/$(am__dirstamp) 655 Concurrency/$(DEPDIR)/$(am__dirstamp): 656 @$(MKDIR_P) Concurrency/$(DEPDIR) 657 @: > Concurrency/$(DEPDIR)/$(am__dirstamp) 658 Concurrency/driver_cfa_cpp-Keywords.$(OBJEXT): \ 659 Concurrency/$(am__dirstamp) \ 999 CodeTools/DeclStats.$(OBJEXT): CodeTools/$(am__dirstamp) \ 1000 CodeTools/$(DEPDIR)/$(am__dirstamp) 1001 CodeTools/TrackLoc.$(OBJEXT): CodeTools/$(am__dirstamp) \ 1002 CodeTools/$(DEPDIR)/$(am__dirstamp) 1003 Concurrency/Waitfor.$(OBJEXT): Concurrency/$(am__dirstamp) \ 660 1004 Concurrency/$(DEPDIR)/$(am__dirstamp) 661 Concurrency/driver_cfa_cpp-Waitfor.$(OBJEXT): \ 662 Concurrency/$(am__dirstamp) \ 663 Concurrency/$(DEPDIR)/$(am__dirstamp) 664 Common/$(am__dirstamp): 665 @$(MKDIR_P) Common 666 @: > Common/$(am__dirstamp) 667 Common/$(DEPDIR)/$(am__dirstamp): 668 @$(MKDIR_P) Common/$(DEPDIR) 669 @: > Common/$(DEPDIR)/$(am__dirstamp) 670 Common/driver_cfa_cpp-SemanticError.$(OBJEXT): Common/$(am__dirstamp) \ 1005 Common/DebugMalloc.$(OBJEXT): Common/$(am__dirstamp) \ 671 1006 Common/$(DEPDIR)/$(am__dirstamp) 672 Common/ driver_cfa_cpp-UniqueName.$(OBJEXT): Common/$(am__dirstamp) \1007 Common/Heap.$(OBJEXT): Common/$(am__dirstamp) \ 673 1008 Common/$(DEPDIR)/$(am__dirstamp) 674 Common/driver_cfa_cpp-DebugMalloc.$(OBJEXT): Common/$(am__dirstamp) \ 675 Common/$(DEPDIR)/$(am__dirstamp) 676 Common/driver_cfa_cpp-Assert.$(OBJEXT): Common/$(am__dirstamp) \ 677 Common/$(DEPDIR)/$(am__dirstamp) 678 ControlStruct/$(am__dirstamp): 679 @$(MKDIR_P) ControlStruct 680 @: > ControlStruct/$(am__dirstamp) 681 ControlStruct/$(DEPDIR)/$(am__dirstamp): 682 @$(MKDIR_P) ControlStruct/$(DEPDIR) 683 @: > ControlStruct/$(DEPDIR)/$(am__dirstamp) 684 ControlStruct/driver_cfa_cpp-LabelGenerator.$(OBJEXT): \ 1009 ControlStruct/ExceptTranslate.$(OBJEXT): \ 685 1010 ControlStruct/$(am__dirstamp) \ 686 1011 ControlStruct/$(DEPDIR)/$(am__dirstamp) 687 ControlStruct/driver_cfa_cpp-LabelFixer.$(OBJEXT): \ 688 ControlStruct/$(am__dirstamp) \ 689 ControlStruct/$(DEPDIR)/$(am__dirstamp) 690 ControlStruct/driver_cfa_cpp-MLEMutator.$(OBJEXT): \ 691 ControlStruct/$(am__dirstamp) \ 692 ControlStruct/$(DEPDIR)/$(am__dirstamp) 693 ControlStruct/driver_cfa_cpp-Mutate.$(OBJEXT): \ 694 ControlStruct/$(am__dirstamp) \ 695 ControlStruct/$(DEPDIR)/$(am__dirstamp) 696 ControlStruct/driver_cfa_cpp-ForExprMutator.$(OBJEXT): \ 697 ControlStruct/$(am__dirstamp) \ 698 ControlStruct/$(DEPDIR)/$(am__dirstamp) 699 ControlStruct/driver_cfa_cpp-ExceptTranslate.$(OBJEXT): \ 700 ControlStruct/$(am__dirstamp) \ 701 ControlStruct/$(DEPDIR)/$(am__dirstamp) 702 GenPoly/$(am__dirstamp): 703 @$(MKDIR_P) GenPoly 704 @: > GenPoly/$(am__dirstamp) 705 GenPoly/$(DEPDIR)/$(am__dirstamp): 706 @$(MKDIR_P) GenPoly/$(DEPDIR) 707 @: > GenPoly/$(DEPDIR)/$(am__dirstamp) 708 GenPoly/driver_cfa_cpp-Box.$(OBJEXT): GenPoly/$(am__dirstamp) \ 1012 GenPoly/Box.$(OBJEXT): GenPoly/$(am__dirstamp) \ 709 1013 GenPoly/$(DEPDIR)/$(am__dirstamp) 710 GenPoly/ driver_cfa_cpp-GenPoly.$(OBJEXT): GenPoly/$(am__dirstamp) \1014 GenPoly/ScrubTyVars.$(OBJEXT): GenPoly/$(am__dirstamp) \ 711 1015 GenPoly/$(DEPDIR)/$(am__dirstamp) 712 GenPoly/ driver_cfa_cpp-ScrubTyVars.$(OBJEXT): GenPoly/$(am__dirstamp) \1016 GenPoly/Specialize.$(OBJEXT): GenPoly/$(am__dirstamp) \ 713 1017 GenPoly/$(DEPDIR)/$(am__dirstamp) 714 GenPoly/ driver_cfa_cpp-Lvalue.$(OBJEXT): GenPoly/$(am__dirstamp) \1018 GenPoly/FindFunction.$(OBJEXT): GenPoly/$(am__dirstamp) \ 715 1019 GenPoly/$(DEPDIR)/$(am__dirstamp) 716 GenPoly/ driver_cfa_cpp-Specialize.$(OBJEXT): GenPoly/$(am__dirstamp) \1020 GenPoly/InstantiateGeneric.$(OBJEXT): GenPoly/$(am__dirstamp) \ 717 1021 GenPoly/$(DEPDIR)/$(am__dirstamp) 718 GenPoly/driver_cfa_cpp-FindFunction.$(OBJEXT): \ 719 GenPoly/$(am__dirstamp) GenPoly/$(DEPDIR)/$(am__dirstamp) 720 GenPoly/driver_cfa_cpp-InstantiateGeneric.$(OBJEXT): \ 721 GenPoly/$(am__dirstamp) GenPoly/$(DEPDIR)/$(am__dirstamp) 722 InitTweak/$(am__dirstamp): 723 @$(MKDIR_P) InitTweak 724 @: > InitTweak/$(am__dirstamp) 725 InitTweak/$(DEPDIR)/$(am__dirstamp): 726 @$(MKDIR_P) InitTweak/$(DEPDIR) 727 @: > InitTweak/$(DEPDIR)/$(am__dirstamp) 728 InitTweak/driver_cfa_cpp-GenInit.$(OBJEXT): InitTweak/$(am__dirstamp) \ 1022 InitTweak/FixInit.$(OBJEXT): InitTweak/$(am__dirstamp) \ 729 1023 InitTweak/$(DEPDIR)/$(am__dirstamp) 730 InitTweak/ driver_cfa_cpp-FixInit.$(OBJEXT): InitTweak/$(am__dirstamp) \1024 InitTweak/FixGlobalInit.$(OBJEXT): InitTweak/$(am__dirstamp) \ 731 1025 InitTweak/$(DEPDIR)/$(am__dirstamp) 732 InitTweak/driver_cfa_cpp-FixGlobalInit.$(OBJEXT): \733 InitTweak/$(am__dirstamp) InitTweak/$(DEPDIR)/$(am__dirstamp)734 InitTweak/driver_cfa_cpp-InitTweak.$(OBJEXT): \735 InitTweak/$(am__dirstamp) InitTweak/$(DEPDIR)/$(am__dirstamp)736 1026 Parser/parser.hh: Parser/parser.cc 737 1027 @if test ! -f $@; then rm -f Parser/parser.cc; else :; fi 738 1028 @if test ! -f $@; then $(MAKE) $(AM_MAKEFLAGS) Parser/parser.cc; else :; fi 739 Parser/$(am__dirstamp): 740 @$(MKDIR_P) Parser 741 @: > Parser/$(am__dirstamp) 742 Parser/$(DEPDIR)/$(am__dirstamp): 743 @$(MKDIR_P) Parser/$(DEPDIR) 744 @: > Parser/$(DEPDIR)/$(am__dirstamp) 745 Parser/driver_cfa_cpp-parser.$(OBJEXT): Parser/$(am__dirstamp) \ 1029 Parser/parser.$(OBJEXT): Parser/$(am__dirstamp) \ 746 1030 Parser/$(DEPDIR)/$(am__dirstamp) 747 Parser/ driver_cfa_cpp-lex.$(OBJEXT): Parser/$(am__dirstamp) \1031 Parser/lex.$(OBJEXT): Parser/$(am__dirstamp) \ 748 1032 Parser/$(DEPDIR)/$(am__dirstamp) 749 Parser/ driver_cfa_cpp-TypedefTable.$(OBJEXT): Parser/$(am__dirstamp) \1033 Parser/TypedefTable.$(OBJEXT): Parser/$(am__dirstamp) \ 750 1034 Parser/$(DEPDIR)/$(am__dirstamp) 751 Parser/ driver_cfa_cpp-ParseNode.$(OBJEXT): Parser/$(am__dirstamp) \1035 Parser/ParseNode.$(OBJEXT): Parser/$(am__dirstamp) \ 752 1036 Parser/$(DEPDIR)/$(am__dirstamp) 753 Parser/driver_cfa_cpp-DeclarationNode.$(OBJEXT): \ 754 Parser/$(am__dirstamp) Parser/$(DEPDIR)/$(am__dirstamp) 755 Parser/driver_cfa_cpp-ExpressionNode.$(OBJEXT): \ 756 Parser/$(am__dirstamp) Parser/$(DEPDIR)/$(am__dirstamp) 757 Parser/driver_cfa_cpp-StatementNode.$(OBJEXT): Parser/$(am__dirstamp) \ 1037 Parser/DeclarationNode.$(OBJEXT): Parser/$(am__dirstamp) \ 758 1038 Parser/$(DEPDIR)/$(am__dirstamp) 759 Parser/driver_cfa_cpp-InitializerNode.$(OBJEXT): \ 760 Parser/$(am__dirstamp) Parser/$(DEPDIR)/$(am__dirstamp) 761 Parser/driver_cfa_cpp-TypeData.$(OBJEXT): Parser/$(am__dirstamp) \ 1039 Parser/ExpressionNode.$(OBJEXT): Parser/$(am__dirstamp) \ 762 1040 Parser/$(DEPDIR)/$(am__dirstamp) 763 Parser/ driver_cfa_cpp-LinkageSpec.$(OBJEXT): Parser/$(am__dirstamp) \1041 Parser/StatementNode.$(OBJEXT): Parser/$(am__dirstamp) \ 764 1042 Parser/$(DEPDIR)/$(am__dirstamp) 765 Parser/ driver_cfa_cpp-parserutility.$(OBJEXT): Parser/$(am__dirstamp) \1043 Parser/InitializerNode.$(OBJEXT): Parser/$(am__dirstamp) \ 766 1044 Parser/$(DEPDIR)/$(am__dirstamp) 767 ResolvExpr/$(am__dirstamp): 768 @$(MKDIR_P) ResolvExpr 769 @: > ResolvExpr/$(am__dirstamp) 770 ResolvExpr/$(DEPDIR)/$(am__dirstamp): 771 @$(MKDIR_P) ResolvExpr/$(DEPDIR) 772 @: > ResolvExpr/$(DEPDIR)/$(am__dirstamp) 773 ResolvExpr/driver_cfa_cpp-AlternativeFinder.$(OBJEXT): \ 774 ResolvExpr/$(am__dirstamp) \ 775 ResolvExpr/$(DEPDIR)/$(am__dirstamp) 776 ResolvExpr/driver_cfa_cpp-Alternative.$(OBJEXT): \ 777 ResolvExpr/$(am__dirstamp) \ 778 ResolvExpr/$(DEPDIR)/$(am__dirstamp) 779 ResolvExpr/driver_cfa_cpp-Unify.$(OBJEXT): ResolvExpr/$(am__dirstamp) \ 780 ResolvExpr/$(DEPDIR)/$(am__dirstamp) 781 ResolvExpr/driver_cfa_cpp-PtrsAssignable.$(OBJEXT): \ 782 ResolvExpr/$(am__dirstamp) \ 783 ResolvExpr/$(DEPDIR)/$(am__dirstamp) 784 ResolvExpr/driver_cfa_cpp-CommonType.$(OBJEXT): \ 785 ResolvExpr/$(am__dirstamp) \ 786 ResolvExpr/$(DEPDIR)/$(am__dirstamp) 787 ResolvExpr/driver_cfa_cpp-ConversionCost.$(OBJEXT): \ 788 ResolvExpr/$(am__dirstamp) \ 789 ResolvExpr/$(DEPDIR)/$(am__dirstamp) 790 ResolvExpr/driver_cfa_cpp-CastCost.$(OBJEXT): \ 791 ResolvExpr/$(am__dirstamp) \ 792 ResolvExpr/$(DEPDIR)/$(am__dirstamp) 793 ResolvExpr/driver_cfa_cpp-PtrsCastable.$(OBJEXT): \ 794 ResolvExpr/$(am__dirstamp) \ 795 ResolvExpr/$(DEPDIR)/$(am__dirstamp) 796 ResolvExpr/driver_cfa_cpp-AdjustExprType.$(OBJEXT): \ 797 ResolvExpr/$(am__dirstamp) \ 798 ResolvExpr/$(DEPDIR)/$(am__dirstamp) 799 ResolvExpr/driver_cfa_cpp-AlternativePrinter.$(OBJEXT): \ 800 ResolvExpr/$(am__dirstamp) \ 801 ResolvExpr/$(DEPDIR)/$(am__dirstamp) 802 ResolvExpr/driver_cfa_cpp-Resolver.$(OBJEXT): \ 803 ResolvExpr/$(am__dirstamp) \ 804 ResolvExpr/$(DEPDIR)/$(am__dirstamp) 805 ResolvExpr/driver_cfa_cpp-ResolveTypeof.$(OBJEXT): \ 806 ResolvExpr/$(am__dirstamp) \ 807 ResolvExpr/$(DEPDIR)/$(am__dirstamp) 808 ResolvExpr/driver_cfa_cpp-RenameVars.$(OBJEXT): \ 809 ResolvExpr/$(am__dirstamp) \ 810 ResolvExpr/$(DEPDIR)/$(am__dirstamp) 811 ResolvExpr/driver_cfa_cpp-FindOpenVars.$(OBJEXT): \ 812 ResolvExpr/$(am__dirstamp) \ 813 ResolvExpr/$(DEPDIR)/$(am__dirstamp) 814 ResolvExpr/driver_cfa_cpp-PolyCost.$(OBJEXT): \ 815 ResolvExpr/$(am__dirstamp) \ 816 ResolvExpr/$(DEPDIR)/$(am__dirstamp) 817 ResolvExpr/driver_cfa_cpp-Occurs.$(OBJEXT): \ 818 ResolvExpr/$(am__dirstamp) \ 819 ResolvExpr/$(DEPDIR)/$(am__dirstamp) 820 ResolvExpr/driver_cfa_cpp-TypeEnvironment.$(OBJEXT): \ 821 ResolvExpr/$(am__dirstamp) \ 822 ResolvExpr/$(DEPDIR)/$(am__dirstamp) 823 ResolvExpr/driver_cfa_cpp-CurrentObject.$(OBJEXT): \ 824 ResolvExpr/$(am__dirstamp) \ 825 ResolvExpr/$(DEPDIR)/$(am__dirstamp) 826 ResolvExpr/driver_cfa_cpp-ExplodedActual.$(OBJEXT): \ 827 ResolvExpr/$(am__dirstamp) \ 828 ResolvExpr/$(DEPDIR)/$(am__dirstamp) 829 SymTab/$(am__dirstamp): 830 @$(MKDIR_P) SymTab 831 @: > SymTab/$(am__dirstamp) 832 SymTab/$(DEPDIR)/$(am__dirstamp): 833 @$(MKDIR_P) SymTab/$(DEPDIR) 834 @: > SymTab/$(DEPDIR)/$(am__dirstamp) 835 SymTab/driver_cfa_cpp-Indexer.$(OBJEXT): SymTab/$(am__dirstamp) \ 836 SymTab/$(DEPDIR)/$(am__dirstamp) 837 SymTab/driver_cfa_cpp-Mangler.$(OBJEXT): SymTab/$(am__dirstamp) \ 838 SymTab/$(DEPDIR)/$(am__dirstamp) 839 SymTab/driver_cfa_cpp-Validate.$(OBJEXT): SymTab/$(am__dirstamp) \ 840 SymTab/$(DEPDIR)/$(am__dirstamp) 841 SymTab/driver_cfa_cpp-FixFunction.$(OBJEXT): SymTab/$(am__dirstamp) \ 842 SymTab/$(DEPDIR)/$(am__dirstamp) 843 SymTab/driver_cfa_cpp-Autogen.$(OBJEXT): SymTab/$(am__dirstamp) \ 844 SymTab/$(DEPDIR)/$(am__dirstamp) 845 SynTree/$(am__dirstamp): 846 @$(MKDIR_P) SynTree 847 @: > SynTree/$(am__dirstamp) 848 SynTree/$(DEPDIR)/$(am__dirstamp): 849 @$(MKDIR_P) SynTree/$(DEPDIR) 850 @: > SynTree/$(DEPDIR)/$(am__dirstamp) 851 SynTree/driver_cfa_cpp-Type.$(OBJEXT): SynTree/$(am__dirstamp) \ 852 SynTree/$(DEPDIR)/$(am__dirstamp) 853 SynTree/driver_cfa_cpp-VoidType.$(OBJEXT): SynTree/$(am__dirstamp) \ 854 SynTree/$(DEPDIR)/$(am__dirstamp) 855 SynTree/driver_cfa_cpp-BasicType.$(OBJEXT): SynTree/$(am__dirstamp) \ 856 SynTree/$(DEPDIR)/$(am__dirstamp) 857 SynTree/driver_cfa_cpp-PointerType.$(OBJEXT): SynTree/$(am__dirstamp) \ 858 SynTree/$(DEPDIR)/$(am__dirstamp) 859 SynTree/driver_cfa_cpp-ArrayType.$(OBJEXT): SynTree/$(am__dirstamp) \ 860 SynTree/$(DEPDIR)/$(am__dirstamp) 861 SynTree/driver_cfa_cpp-ReferenceType.$(OBJEXT): \ 862 SynTree/$(am__dirstamp) SynTree/$(DEPDIR)/$(am__dirstamp) 863 SynTree/driver_cfa_cpp-FunctionType.$(OBJEXT): \ 864 SynTree/$(am__dirstamp) SynTree/$(DEPDIR)/$(am__dirstamp) 865 SynTree/driver_cfa_cpp-ReferenceToType.$(OBJEXT): \ 866 SynTree/$(am__dirstamp) SynTree/$(DEPDIR)/$(am__dirstamp) 867 SynTree/driver_cfa_cpp-TupleType.$(OBJEXT): SynTree/$(am__dirstamp) \ 868 SynTree/$(DEPDIR)/$(am__dirstamp) 869 SynTree/driver_cfa_cpp-TypeofType.$(OBJEXT): SynTree/$(am__dirstamp) \ 870 SynTree/$(DEPDIR)/$(am__dirstamp) 871 SynTree/driver_cfa_cpp-AttrType.$(OBJEXT): SynTree/$(am__dirstamp) \ 872 SynTree/$(DEPDIR)/$(am__dirstamp) 873 SynTree/driver_cfa_cpp-VarArgsType.$(OBJEXT): SynTree/$(am__dirstamp) \ 874 SynTree/$(DEPDIR)/$(am__dirstamp) 875 SynTree/driver_cfa_cpp-ZeroOneType.$(OBJEXT): SynTree/$(am__dirstamp) \ 876 SynTree/$(DEPDIR)/$(am__dirstamp) 877 SynTree/driver_cfa_cpp-Constant.$(OBJEXT): SynTree/$(am__dirstamp) \ 878 SynTree/$(DEPDIR)/$(am__dirstamp) 879 SynTree/driver_cfa_cpp-Expression.$(OBJEXT): SynTree/$(am__dirstamp) \ 880 SynTree/$(DEPDIR)/$(am__dirstamp) 881 SynTree/driver_cfa_cpp-TupleExpr.$(OBJEXT): SynTree/$(am__dirstamp) \ 882 SynTree/$(DEPDIR)/$(am__dirstamp) 883 SynTree/driver_cfa_cpp-CommaExpr.$(OBJEXT): SynTree/$(am__dirstamp) \ 884 SynTree/$(DEPDIR)/$(am__dirstamp) 885 SynTree/driver_cfa_cpp-TypeExpr.$(OBJEXT): SynTree/$(am__dirstamp) \ 886 SynTree/$(DEPDIR)/$(am__dirstamp) 887 SynTree/driver_cfa_cpp-ApplicationExpr.$(OBJEXT): \ 888 SynTree/$(am__dirstamp) SynTree/$(DEPDIR)/$(am__dirstamp) 889 SynTree/driver_cfa_cpp-AddressExpr.$(OBJEXT): SynTree/$(am__dirstamp) \ 890 SynTree/$(DEPDIR)/$(am__dirstamp) 891 SynTree/driver_cfa_cpp-Statement.$(OBJEXT): SynTree/$(am__dirstamp) \ 892 SynTree/$(DEPDIR)/$(am__dirstamp) 893 SynTree/driver_cfa_cpp-CompoundStmt.$(OBJEXT): \ 894 SynTree/$(am__dirstamp) SynTree/$(DEPDIR)/$(am__dirstamp) 895 SynTree/driver_cfa_cpp-DeclStmt.$(OBJEXT): SynTree/$(am__dirstamp) \ 896 SynTree/$(DEPDIR)/$(am__dirstamp) 897 SynTree/driver_cfa_cpp-Declaration.$(OBJEXT): SynTree/$(am__dirstamp) \ 898 SynTree/$(DEPDIR)/$(am__dirstamp) 899 SynTree/driver_cfa_cpp-DeclarationWithType.$(OBJEXT): \ 900 SynTree/$(am__dirstamp) SynTree/$(DEPDIR)/$(am__dirstamp) 901 SynTree/driver_cfa_cpp-ObjectDecl.$(OBJEXT): SynTree/$(am__dirstamp) \ 902 SynTree/$(DEPDIR)/$(am__dirstamp) 903 SynTree/driver_cfa_cpp-FunctionDecl.$(OBJEXT): \ 904 SynTree/$(am__dirstamp) SynTree/$(DEPDIR)/$(am__dirstamp) 905 SynTree/driver_cfa_cpp-AggregateDecl.$(OBJEXT): \ 906 SynTree/$(am__dirstamp) SynTree/$(DEPDIR)/$(am__dirstamp) 907 SynTree/driver_cfa_cpp-NamedTypeDecl.$(OBJEXT): \ 908 SynTree/$(am__dirstamp) SynTree/$(DEPDIR)/$(am__dirstamp) 909 SynTree/driver_cfa_cpp-TypeDecl.$(OBJEXT): SynTree/$(am__dirstamp) \ 910 SynTree/$(DEPDIR)/$(am__dirstamp) 911 SynTree/driver_cfa_cpp-Initializer.$(OBJEXT): SynTree/$(am__dirstamp) \ 912 SynTree/$(DEPDIR)/$(am__dirstamp) 913 SynTree/driver_cfa_cpp-Visitor.$(OBJEXT): SynTree/$(am__dirstamp) \ 914 SynTree/$(DEPDIR)/$(am__dirstamp) 915 SynTree/driver_cfa_cpp-Mutator.$(OBJEXT): SynTree/$(am__dirstamp) \ 916 SynTree/$(DEPDIR)/$(am__dirstamp) 917 SynTree/driver_cfa_cpp-TypeSubstitution.$(OBJEXT): \ 918 SynTree/$(am__dirstamp) SynTree/$(DEPDIR)/$(am__dirstamp) 919 SynTree/driver_cfa_cpp-Attribute.$(OBJEXT): SynTree/$(am__dirstamp) \ 920 SynTree/$(DEPDIR)/$(am__dirstamp) 921 SynTree/driver_cfa_cpp-VarExprReplacer.$(OBJEXT): \ 922 SynTree/$(am__dirstamp) SynTree/$(DEPDIR)/$(am__dirstamp) 923 Tuples/$(am__dirstamp): 924 @$(MKDIR_P) Tuples 925 @: > Tuples/$(am__dirstamp) 926 Tuples/$(DEPDIR)/$(am__dirstamp): 927 @$(MKDIR_P) Tuples/$(DEPDIR) 928 @: > Tuples/$(DEPDIR)/$(am__dirstamp) 929 Tuples/driver_cfa_cpp-TupleAssignment.$(OBJEXT): \ 930 Tuples/$(am__dirstamp) Tuples/$(DEPDIR)/$(am__dirstamp) 931 Tuples/driver_cfa_cpp-TupleExpansion.$(OBJEXT): \ 932 Tuples/$(am__dirstamp) Tuples/$(DEPDIR)/$(am__dirstamp) 933 Tuples/driver_cfa_cpp-Explode.$(OBJEXT): Tuples/$(am__dirstamp) \ 934 Tuples/$(DEPDIR)/$(am__dirstamp) 1045 Parser/TypeData.$(OBJEXT): Parser/$(am__dirstamp) \ 1046 Parser/$(DEPDIR)/$(am__dirstamp) 1047 Parser/parserutility.$(OBJEXT): Parser/$(am__dirstamp) \ 1048 Parser/$(DEPDIR)/$(am__dirstamp) 1049 ResolvExpr/AlternativePrinter.$(OBJEXT): ResolvExpr/$(am__dirstamp) \ 1050 ResolvExpr/$(DEPDIR)/$(am__dirstamp) 935 1051 Virtual/$(am__dirstamp): 936 1052 @$(MKDIR_P) Virtual … … 939 1055 @$(MKDIR_P) Virtual/$(DEPDIR) 940 1056 @: > Virtual/$(DEPDIR)/$(am__dirstamp) 941 Virtual/ driver_cfa_cpp-ExpandCasts.$(OBJEXT): Virtual/$(am__dirstamp) \1057 Virtual/ExpandCasts.$(OBJEXT): Virtual/$(am__dirstamp) \ 942 1058 Virtual/$(DEPDIR)/$(am__dirstamp) 943 driver/$(am__dirstamp): 944 @$(MKDIR_P) driver 945 @: > driver/$(am__dirstamp) 946 947 driver/cfa-cpp$(EXEEXT): $(driver_cfa_cpp_OBJECTS) $(driver_cfa_cpp_DEPENDENCIES) $(EXTRA_driver_cfa_cpp_DEPENDENCIES) driver/$(am__dirstamp) 948 @rm -f driver/cfa-cpp$(EXEEXT) 949 $(AM_V_CXXLD)$(driver_cfa_cpp_LINK) $(driver_cfa_cpp_OBJECTS) $(driver_cfa_cpp_LDADD) $(LIBS) 1059 ../driver/$(am__dirstamp): 1060 @$(MKDIR_P) ../driver 1061 @: > ../driver/$(am__dirstamp) 1062 1063 ../driver/cfa-cpp$(EXEEXT): $(___driver_cfa_cpp_OBJECTS) $(___driver_cfa_cpp_DEPENDENCIES) $(EXTRA____driver_cfa_cpp_DEPENDENCIES) ../driver/$(am__dirstamp) 1064 @rm -f ../driver/cfa-cpp$(EXEEXT) 1065 $(AM_V_CXXLD)$(CXXLINK) $(___driver_cfa_cpp_OBJECTS) $(___driver_cfa_cpp_LDADD) $(LIBS) 1066 SymTab/demangler.$(OBJEXT): SymTab/$(am__dirstamp) \ 1067 SymTab/$(DEPDIR)/$(am__dirstamp) 1068 1069 demangler$(EXEEXT): $(demangler_OBJECTS) $(demangler_DEPENDENCIES) $(EXTRA_demangler_DEPENDENCIES) 1070 @rm -f demangler$(EXEEXT) 1071 $(AM_V_CXXLD)$(CXXLINK) $(demangler_OBJECTS) $(demangler_LDADD) $(LIBS) 950 1072 951 1073 mostlyclean-compile: … … 963 1085 -rm -f SynTree/*.$(OBJEXT) 964 1086 -rm -f Tuples/*.$(OBJEXT) 1087 -rm -f Validate/*.$(OBJEXT) 965 1088 -rm -f Virtual/*.$(OBJEXT) 966 1089 … … 968 1091 -rm -f *.tab.c 969 1092 970 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/driver_cfa_cpp-MakeLibCfa.Po@am__quote@ 971 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/driver_cfa_cpp-main.Po@am__quote@ 972 @AMDEP_TRUE@@am__include@ @am__quote@CodeGen/$(DEPDIR)/driver_cfa_cpp-CodeGenerator.Po@am__quote@ 973 @AMDEP_TRUE@@am__include@ @am__quote@CodeGen/$(DEPDIR)/driver_cfa_cpp-FixMain.Po@am__quote@ 974 @AMDEP_TRUE@@am__include@ @am__quote@CodeGen/$(DEPDIR)/driver_cfa_cpp-FixNames.Po@am__quote@ 975 @AMDEP_TRUE@@am__include@ @am__quote@CodeGen/$(DEPDIR)/driver_cfa_cpp-GenType.Po@am__quote@ 976 @AMDEP_TRUE@@am__include@ @am__quote@CodeGen/$(DEPDIR)/driver_cfa_cpp-Generate.Po@am__quote@ 977 @AMDEP_TRUE@@am__include@ @am__quote@CodeGen/$(DEPDIR)/driver_cfa_cpp-OperatorTable.Po@am__quote@ 978 @AMDEP_TRUE@@am__include@ @am__quote@CodeTools/$(DEPDIR)/driver_cfa_cpp-DeclStats.Po@am__quote@ 979 @AMDEP_TRUE@@am__include@ @am__quote@CodeTools/$(DEPDIR)/driver_cfa_cpp-TrackLoc.Po@am__quote@ 980 @AMDEP_TRUE@@am__include@ @am__quote@Common/$(DEPDIR)/driver_cfa_cpp-Assert.Po@am__quote@ 981 @AMDEP_TRUE@@am__include@ @am__quote@Common/$(DEPDIR)/driver_cfa_cpp-DebugMalloc.Po@am__quote@ 982 @AMDEP_TRUE@@am__include@ @am__quote@Common/$(DEPDIR)/driver_cfa_cpp-SemanticError.Po@am__quote@ 983 @AMDEP_TRUE@@am__include@ @am__quote@Common/$(DEPDIR)/driver_cfa_cpp-UniqueName.Po@am__quote@ 984 @AMDEP_TRUE@@am__include@ @am__quote@Concurrency/$(DEPDIR)/driver_cfa_cpp-Keywords.Po@am__quote@ 985 @AMDEP_TRUE@@am__include@ @am__quote@Concurrency/$(DEPDIR)/driver_cfa_cpp-Waitfor.Po@am__quote@ 986 @AMDEP_TRUE@@am__include@ @am__quote@ControlStruct/$(DEPDIR)/driver_cfa_cpp-ExceptTranslate.Po@am__quote@ 987 @AMDEP_TRUE@@am__include@ @am__quote@ControlStruct/$(DEPDIR)/driver_cfa_cpp-ForExprMutator.Po@am__quote@ 988 @AMDEP_TRUE@@am__include@ @am__quote@ControlStruct/$(DEPDIR)/driver_cfa_cpp-LabelFixer.Po@am__quote@ 989 @AMDEP_TRUE@@am__include@ @am__quote@ControlStruct/$(DEPDIR)/driver_cfa_cpp-LabelGenerator.Po@am__quote@ 990 @AMDEP_TRUE@@am__include@ @am__quote@ControlStruct/$(DEPDIR)/driver_cfa_cpp-MLEMutator.Po@am__quote@ 991 @AMDEP_TRUE@@am__include@ @am__quote@ControlStruct/$(DEPDIR)/driver_cfa_cpp-Mutate.Po@am__quote@ 992 @AMDEP_TRUE@@am__include@ @am__quote@GenPoly/$(DEPDIR)/driver_cfa_cpp-Box.Po@am__quote@ 993 @AMDEP_TRUE@@am__include@ @am__quote@GenPoly/$(DEPDIR)/driver_cfa_cpp-FindFunction.Po@am__quote@ 994 @AMDEP_TRUE@@am__include@ @am__quote@GenPoly/$(DEPDIR)/driver_cfa_cpp-GenPoly.Po@am__quote@ 995 @AMDEP_TRUE@@am__include@ @am__quote@GenPoly/$(DEPDIR)/driver_cfa_cpp-InstantiateGeneric.Po@am__quote@ 996 @AMDEP_TRUE@@am__include@ @am__quote@GenPoly/$(DEPDIR)/driver_cfa_cpp-Lvalue.Po@am__quote@ 997 @AMDEP_TRUE@@am__include@ @am__quote@GenPoly/$(DEPDIR)/driver_cfa_cpp-ScrubTyVars.Po@am__quote@ 998 @AMDEP_TRUE@@am__include@ @am__quote@GenPoly/$(DEPDIR)/driver_cfa_cpp-Specialize.Po@am__quote@ 999 @AMDEP_TRUE@@am__include@ @am__quote@InitTweak/$(DEPDIR)/driver_cfa_cpp-FixGlobalInit.Po@am__quote@ 1000 @AMDEP_TRUE@@am__include@ @am__quote@InitTweak/$(DEPDIR)/driver_cfa_cpp-FixInit.Po@am__quote@ 1001 @AMDEP_TRUE@@am__include@ @am__quote@InitTweak/$(DEPDIR)/driver_cfa_cpp-GenInit.Po@am__quote@ 1002 @AMDEP_TRUE@@am__include@ @am__quote@InitTweak/$(DEPDIR)/driver_cfa_cpp-InitTweak.Po@am__quote@ 1003 @AMDEP_TRUE@@am__include@ @am__quote@Parser/$(DEPDIR)/driver_cfa_cpp-DeclarationNode.Po@am__quote@ 1004 @AMDEP_TRUE@@am__include@ @am__quote@Parser/$(DEPDIR)/driver_cfa_cpp-ExpressionNode.Po@am__quote@ 1005 @AMDEP_TRUE@@am__include@ @am__quote@Parser/$(DEPDIR)/driver_cfa_cpp-InitializerNode.Po@am__quote@ 1006 @AMDEP_TRUE@@am__include@ @am__quote@Parser/$(DEPDIR)/driver_cfa_cpp-LinkageSpec.Po@am__quote@ 1007 @AMDEP_TRUE@@am__include@ @am__quote@Parser/$(DEPDIR)/driver_cfa_cpp-ParseNode.Po@am__quote@ 1008 @AMDEP_TRUE@@am__include@ @am__quote@Parser/$(DEPDIR)/driver_cfa_cpp-StatementNode.Po@am__quote@ 1009 @AMDEP_TRUE@@am__include@ @am__quote@Parser/$(DEPDIR)/driver_cfa_cpp-TypeData.Po@am__quote@ 1010 @AMDEP_TRUE@@am__include@ @am__quote@Parser/$(DEPDIR)/driver_cfa_cpp-TypedefTable.Po@am__quote@ 1011 @AMDEP_TRUE@@am__include@ @am__quote@Parser/$(DEPDIR)/driver_cfa_cpp-lex.Po@am__quote@ 1012 @AMDEP_TRUE@@am__include@ @am__quote@Parser/$(DEPDIR)/driver_cfa_cpp-parser.Po@am__quote@ 1013 @AMDEP_TRUE@@am__include@ @am__quote@Parser/$(DEPDIR)/driver_cfa_cpp-parserutility.Po@am__quote@ 1014 @AMDEP_TRUE@@am__include@ @am__quote@ResolvExpr/$(DEPDIR)/driver_cfa_cpp-AdjustExprType.Po@am__quote@ 1015 @AMDEP_TRUE@@am__include@ @am__quote@ResolvExpr/$(DEPDIR)/driver_cfa_cpp-Alternative.Po@am__quote@ 1016 @AMDEP_TRUE@@am__include@ @am__quote@ResolvExpr/$(DEPDIR)/driver_cfa_cpp-AlternativeFinder.Po@am__quote@ 1017 @AMDEP_TRUE@@am__include@ @am__quote@ResolvExpr/$(DEPDIR)/driver_cfa_cpp-AlternativePrinter.Po@am__quote@ 1018 @AMDEP_TRUE@@am__include@ @am__quote@ResolvExpr/$(DEPDIR)/driver_cfa_cpp-CastCost.Po@am__quote@ 1019 @AMDEP_TRUE@@am__include@ @am__quote@ResolvExpr/$(DEPDIR)/driver_cfa_cpp-CommonType.Po@am__quote@ 1020 @AMDEP_TRUE@@am__include@ @am__quote@ResolvExpr/$(DEPDIR)/driver_cfa_cpp-ConversionCost.Po@am__quote@ 1021 @AMDEP_TRUE@@am__include@ @am__quote@ResolvExpr/$(DEPDIR)/driver_cfa_cpp-CurrentObject.Po@am__quote@ 1022 @AMDEP_TRUE@@am__include@ @am__quote@ResolvExpr/$(DEPDIR)/driver_cfa_cpp-ExplodedActual.Po@am__quote@ 1023 @AMDEP_TRUE@@am__include@ @am__quote@ResolvExpr/$(DEPDIR)/driver_cfa_cpp-FindOpenVars.Po@am__quote@ 1024 @AMDEP_TRUE@@am__include@ @am__quote@ResolvExpr/$(DEPDIR)/driver_cfa_cpp-Occurs.Po@am__quote@ 1025 @AMDEP_TRUE@@am__include@ @am__quote@ResolvExpr/$(DEPDIR)/driver_cfa_cpp-PolyCost.Po@am__quote@ 1026 @AMDEP_TRUE@@am__include@ @am__quote@ResolvExpr/$(DEPDIR)/driver_cfa_cpp-PtrsAssignable.Po@am__quote@ 1027 @AMDEP_TRUE@@am__include@ @am__quote@ResolvExpr/$(DEPDIR)/driver_cfa_cpp-PtrsCastable.Po@am__quote@ 1028 @AMDEP_TRUE@@am__include@ @am__quote@ResolvExpr/$(DEPDIR)/driver_cfa_cpp-RenameVars.Po@am__quote@ 1029 @AMDEP_TRUE@@am__include@ @am__quote@ResolvExpr/$(DEPDIR)/driver_cfa_cpp-ResolveTypeof.Po@am__quote@ 1030 @AMDEP_TRUE@@am__include@ @am__quote@ResolvExpr/$(DEPDIR)/driver_cfa_cpp-Resolver.Po@am__quote@ 1031 @AMDEP_TRUE@@am__include@ @am__quote@ResolvExpr/$(DEPDIR)/driver_cfa_cpp-TypeEnvironment.Po@am__quote@ 1032 @AMDEP_TRUE@@am__include@ @am__quote@ResolvExpr/$(DEPDIR)/driver_cfa_cpp-Unify.Po@am__quote@ 1033 @AMDEP_TRUE@@am__include@ @am__quote@SymTab/$(DEPDIR)/driver_cfa_cpp-Autogen.Po@am__quote@ 1034 @AMDEP_TRUE@@am__include@ @am__quote@SymTab/$(DEPDIR)/driver_cfa_cpp-FixFunction.Po@am__quote@ 1035 @AMDEP_TRUE@@am__include@ @am__quote@SymTab/$(DEPDIR)/driver_cfa_cpp-Indexer.Po@am__quote@ 1036 @AMDEP_TRUE@@am__include@ @am__quote@SymTab/$(DEPDIR)/driver_cfa_cpp-Mangler.Po@am__quote@ 1037 @AMDEP_TRUE@@am__include@ @am__quote@SymTab/$(DEPDIR)/driver_cfa_cpp-Validate.Po@am__quote@ 1038 @AMDEP_TRUE@@am__include@ @am__quote@SynTree/$(DEPDIR)/driver_cfa_cpp-AddressExpr.Po@am__quote@ 1039 @AMDEP_TRUE@@am__include@ @am__quote@SynTree/$(DEPDIR)/driver_cfa_cpp-AggregateDecl.Po@am__quote@ 1040 @AMDEP_TRUE@@am__include@ @am__quote@SynTree/$(DEPDIR)/driver_cfa_cpp-ApplicationExpr.Po@am__quote@ 1041 @AMDEP_TRUE@@am__include@ @am__quote@SynTree/$(DEPDIR)/driver_cfa_cpp-ArrayType.Po@am__quote@ 1042 @AMDEP_TRUE@@am__include@ @am__quote@SynTree/$(DEPDIR)/driver_cfa_cpp-AttrType.Po@am__quote@ 1043 @AMDEP_TRUE@@am__include@ @am__quote@SynTree/$(DEPDIR)/driver_cfa_cpp-Attribute.Po@am__quote@ 1044 @AMDEP_TRUE@@am__include@ @am__quote@SynTree/$(DEPDIR)/driver_cfa_cpp-BasicType.Po@am__quote@ 1045 @AMDEP_TRUE@@am__include@ @am__quote@SynTree/$(DEPDIR)/driver_cfa_cpp-CommaExpr.Po@am__quote@ 1046 @AMDEP_TRUE@@am__include@ @am__quote@SynTree/$(DEPDIR)/driver_cfa_cpp-CompoundStmt.Po@am__quote@ 1047 @AMDEP_TRUE@@am__include@ @am__quote@SynTree/$(DEPDIR)/driver_cfa_cpp-Constant.Po@am__quote@ 1048 @AMDEP_TRUE@@am__include@ @am__quote@SynTree/$(DEPDIR)/driver_cfa_cpp-DeclStmt.Po@am__quote@ 1049 @AMDEP_TRUE@@am__include@ @am__quote@SynTree/$(DEPDIR)/driver_cfa_cpp-Declaration.Po@am__quote@ 1050 @AMDEP_TRUE@@am__include@ @am__quote@SynTree/$(DEPDIR)/driver_cfa_cpp-DeclarationWithType.Po@am__quote@ 1051 @AMDEP_TRUE@@am__include@ @am__quote@SynTree/$(DEPDIR)/driver_cfa_cpp-Expression.Po@am__quote@ 1052 @AMDEP_TRUE@@am__include@ @am__quote@SynTree/$(DEPDIR)/driver_cfa_cpp-FunctionDecl.Po@am__quote@ 1053 @AMDEP_TRUE@@am__include@ @am__quote@SynTree/$(DEPDIR)/driver_cfa_cpp-FunctionType.Po@am__quote@ 1054 @AMDEP_TRUE@@am__include@ @am__quote@SynTree/$(DEPDIR)/driver_cfa_cpp-Initializer.Po@am__quote@ 1055 @AMDEP_TRUE@@am__include@ @am__quote@SynTree/$(DEPDIR)/driver_cfa_cpp-Mutator.Po@am__quote@ 1056 @AMDEP_TRUE@@am__include@ @am__quote@SynTree/$(DEPDIR)/driver_cfa_cpp-NamedTypeDecl.Po@am__quote@ 1057 @AMDEP_TRUE@@am__include@ @am__quote@SynTree/$(DEPDIR)/driver_cfa_cpp-ObjectDecl.Po@am__quote@ 1058 @AMDEP_TRUE@@am__include@ @am__quote@SynTree/$(DEPDIR)/driver_cfa_cpp-PointerType.Po@am__quote@ 1059 @AMDEP_TRUE@@am__include@ @am__quote@SynTree/$(DEPDIR)/driver_cfa_cpp-ReferenceToType.Po@am__quote@ 1060 @AMDEP_TRUE@@am__include@ @am__quote@SynTree/$(DEPDIR)/driver_cfa_cpp-ReferenceType.Po@am__quote@ 1061 @AMDEP_TRUE@@am__include@ @am__quote@SynTree/$(DEPDIR)/driver_cfa_cpp-Statement.Po@am__quote@ 1062 @AMDEP_TRUE@@am__include@ @am__quote@SynTree/$(DEPDIR)/driver_cfa_cpp-TupleExpr.Po@am__quote@ 1063 @AMDEP_TRUE@@am__include@ @am__quote@SynTree/$(DEPDIR)/driver_cfa_cpp-TupleType.Po@am__quote@ 1064 @AMDEP_TRUE@@am__include@ @am__quote@SynTree/$(DEPDIR)/driver_cfa_cpp-Type.Po@am__quote@ 1065 @AMDEP_TRUE@@am__include@ @am__quote@SynTree/$(DEPDIR)/driver_cfa_cpp-TypeDecl.Po@am__quote@ 1066 @AMDEP_TRUE@@am__include@ @am__quote@SynTree/$(DEPDIR)/driver_cfa_cpp-TypeExpr.Po@am__quote@ 1067 @AMDEP_TRUE@@am__include@ @am__quote@SynTree/$(DEPDIR)/driver_cfa_cpp-TypeSubstitution.Po@am__quote@ 1068 @AMDEP_TRUE@@am__include@ @am__quote@SynTree/$(DEPDIR)/driver_cfa_cpp-TypeofType.Po@am__quote@ 1069 @AMDEP_TRUE@@am__include@ @am__quote@SynTree/$(DEPDIR)/driver_cfa_cpp-VarArgsType.Po@am__quote@ 1070 @AMDEP_TRUE@@am__include@ @am__quote@SynTree/$(DEPDIR)/driver_cfa_cpp-VarExprReplacer.Po@am__quote@ 1071 @AMDEP_TRUE@@am__include@ @am__quote@SynTree/$(DEPDIR)/driver_cfa_cpp-Visitor.Po@am__quote@ 1072 @AMDEP_TRUE@@am__include@ @am__quote@SynTree/$(DEPDIR)/driver_cfa_cpp-VoidType.Po@am__quote@ 1073 @AMDEP_TRUE@@am__include@ @am__quote@SynTree/$(DEPDIR)/driver_cfa_cpp-ZeroOneType.Po@am__quote@ 1074 @AMDEP_TRUE@@am__include@ @am__quote@Tuples/$(DEPDIR)/driver_cfa_cpp-Explode.Po@am__quote@ 1075 @AMDEP_TRUE@@am__include@ @am__quote@Tuples/$(DEPDIR)/driver_cfa_cpp-TupleAssignment.Po@am__quote@ 1076 @AMDEP_TRUE@@am__include@ @am__quote@Tuples/$(DEPDIR)/driver_cfa_cpp-TupleExpansion.Po@am__quote@ 1077 @AMDEP_TRUE@@am__include@ @am__quote@Virtual/$(DEPDIR)/driver_cfa_cpp-ExpandCasts.Po@am__quote@ 1093 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/CompilationState.Po@am__quote@ 1094 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/MakeLibCfa.Po@am__quote@ 1095 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/main.Po@am__quote@ 1096 @AMDEP_TRUE@@am__include@ @am__quote@CodeGen/$(DEPDIR)/CodeGenerator.Po@am__quote@ 1097 @AMDEP_TRUE@@am__include@ @am__quote@CodeGen/$(DEPDIR)/FixMain.Po@am__quote@ 1098 @AMDEP_TRUE@@am__include@ @am__quote@CodeGen/$(DEPDIR)/FixNames.Po@am__quote@ 1099 @AMDEP_TRUE@@am__include@ @am__quote@CodeGen/$(DEPDIR)/GenType.Po@am__quote@ 1100 @AMDEP_TRUE@@am__include@ @am__quote@CodeGen/$(DEPDIR)/Generate.Po@am__quote@ 1101 @AMDEP_TRUE@@am__include@ @am__quote@CodeGen/$(DEPDIR)/OperatorTable.Po@am__quote@ 1102 @AMDEP_TRUE@@am__include@ @am__quote@CodeTools/$(DEPDIR)/DeclStats.Po@am__quote@ 1103 @AMDEP_TRUE@@am__include@ @am__quote@CodeTools/$(DEPDIR)/TrackLoc.Po@am__quote@ 1104 @AMDEP_TRUE@@am__include@ @am__quote@Common/$(DEPDIR)/Assert.Po@am__quote@ 1105 @AMDEP_TRUE@@am__include@ @am__quote@Common/$(DEPDIR)/DebugMalloc.Po@am__quote@ 1106 @AMDEP_TRUE@@am__include@ @am__quote@Common/$(DEPDIR)/Eval.Po@am__quote@ 1107 @AMDEP_TRUE@@am__include@ @am__quote@Common/$(DEPDIR)/Heap.Po@am__quote@ 1108 @AMDEP_TRUE@@am__include@ @am__quote@Common/$(DEPDIR)/SemanticError.Po@am__quote@ 1109 @AMDEP_TRUE@@am__include@ @am__quote@Common/$(DEPDIR)/UniqueName.Po@am__quote@ 1110 @AMDEP_TRUE@@am__include@ @am__quote@Concurrency/$(DEPDIR)/Keywords.Po@am__quote@ 1111 @AMDEP_TRUE@@am__include@ @am__quote@Concurrency/$(DEPDIR)/Waitfor.Po@am__quote@ 1112 @AMDEP_TRUE@@am__include@ @am__quote@ControlStruct/$(DEPDIR)/ExceptTranslate.Po@am__quote@ 1113 @AMDEP_TRUE@@am__include@ @am__quote@ControlStruct/$(DEPDIR)/ForExprMutator.Po@am__quote@ 1114 @AMDEP_TRUE@@am__include@ @am__quote@ControlStruct/$(DEPDIR)/LabelFixer.Po@am__quote@ 1115 @AMDEP_TRUE@@am__include@ @am__quote@ControlStruct/$(DEPDIR)/LabelGenerator.Po@am__quote@ 1116 @AMDEP_TRUE@@am__include@ @am__quote@ControlStruct/$(DEPDIR)/MLEMutator.Po@am__quote@ 1117 @AMDEP_TRUE@@am__include@ @am__quote@ControlStruct/$(DEPDIR)/Mutate.Po@am__quote@ 1118 @AMDEP_TRUE@@am__include@ @am__quote@GenPoly/$(DEPDIR)/Box.Po@am__quote@ 1119 @AMDEP_TRUE@@am__include@ @am__quote@GenPoly/$(DEPDIR)/FindFunction.Po@am__quote@ 1120 @AMDEP_TRUE@@am__include@ @am__quote@GenPoly/$(DEPDIR)/GenPoly.Po@am__quote@ 1121 @AMDEP_TRUE@@am__include@ @am__quote@GenPoly/$(DEPDIR)/InstantiateGeneric.Po@am__quote@ 1122 @AMDEP_TRUE@@am__include@ @am__quote@GenPoly/$(DEPDIR)/Lvalue.Po@am__quote@ 1123 @AMDEP_TRUE@@am__include@ @am__quote@GenPoly/$(DEPDIR)/ScrubTyVars.Po@am__quote@ 1124 @AMDEP_TRUE@@am__include@ @am__quote@GenPoly/$(DEPDIR)/Specialize.Po@am__quote@ 1125 @AMDEP_TRUE@@am__include@ @am__quote@InitTweak/$(DEPDIR)/FixGlobalInit.Po@am__quote@ 1126 @AMDEP_TRUE@@am__include@ @am__quote@InitTweak/$(DEPDIR)/FixInit.Po@am__quote@ 1127 @AMDEP_TRUE@@am__include@ @am__quote@InitTweak/$(DEPDIR)/GenInit.Po@am__quote@ 1128 @AMDEP_TRUE@@am__include@ @am__quote@InitTweak/$(DEPDIR)/InitTweak.Po@am__quote@ 1129 @AMDEP_TRUE@@am__include@ @am__quote@Parser/$(DEPDIR)/DeclarationNode.Po@am__quote@ 1130 @AMDEP_TRUE@@am__include@ @am__quote@Parser/$(DEPDIR)/ExpressionNode.Po@am__quote@ 1131 @AMDEP_TRUE@@am__include@ @am__quote@Parser/$(DEPDIR)/InitializerNode.Po@am__quote@ 1132 @AMDEP_TRUE@@am__include@ @am__quote@Parser/$(DEPDIR)/LinkageSpec.Po@am__quote@ 1133 @AMDEP_TRUE@@am__include@ @am__quote@Parser/$(DEPDIR)/ParseNode.Po@am__quote@ 1134 @AMDEP_TRUE@@am__include@ @am__quote@Parser/$(DEPDIR)/StatementNode.Po@am__quote@ 1135 @AMDEP_TRUE@@am__include@ @am__quote@Parser/$(DEPDIR)/TypeData.Po@am__quote@ 1136 @AMDEP_TRUE@@am__include@ @am__quote@Parser/$(DEPDIR)/TypedefTable.Po@am__quote@ 1137 @AMDEP_TRUE@@am__include@ @am__quote@Parser/$(DEPDIR)/lex.Po@am__quote@ 1138 @AMDEP_TRUE@@am__include@ @am__quote@Parser/$(DEPDIR)/parser.Po@am__quote@ 1139 @AMDEP_TRUE@@am__include@ @am__quote@Parser/$(DEPDIR)/parserutility.Po@am__quote@ 1140 @AMDEP_TRUE@@am__include@ @am__quote@ResolvExpr/$(DEPDIR)/AdjustExprType.Po@am__quote@ 1141 @AMDEP_TRUE@@am__include@ @am__quote@ResolvExpr/$(DEPDIR)/Alternative.Po@am__quote@ 1142 @AMDEP_TRUE@@am__include@ @am__quote@ResolvExpr/$(DEPDIR)/AlternativeFinder.Po@am__quote@ 1143 @AMDEP_TRUE@@am__include@ @am__quote@ResolvExpr/$(DEPDIR)/AlternativePrinter.Po@am__quote@ 1144 @AMDEP_TRUE@@am__include@ @am__quote@ResolvExpr/$(DEPDIR)/CastCost.Po@am__quote@ 1145 @AMDEP_TRUE@@am__include@ @am__quote@ResolvExpr/$(DEPDIR)/CommonType.Po@am__quote@ 1146 @AMDEP_TRUE@@am__include@ @am__quote@ResolvExpr/$(DEPDIR)/ConversionCost.Po@am__quote@ 1147 @AMDEP_TRUE@@am__include@ @am__quote@ResolvExpr/$(DEPDIR)/CurrentObject.Po@am__quote@ 1148 @AMDEP_TRUE@@am__include@ @am__quote@ResolvExpr/$(DEPDIR)/ExplodedActual.Po@am__quote@ 1149 @AMDEP_TRUE@@am__include@ @am__quote@ResolvExpr/$(DEPDIR)/FindOpenVars.Po@am__quote@ 1150 @AMDEP_TRUE@@am__include@ @am__quote@ResolvExpr/$(DEPDIR)/Occurs.Po@am__quote@ 1151 @AMDEP_TRUE@@am__include@ @am__quote@ResolvExpr/$(DEPDIR)/PolyCost.Po@am__quote@ 1152 @AMDEP_TRUE@@am__include@ @am__quote@ResolvExpr/$(DEPDIR)/PtrsAssignable.Po@am__quote@ 1153 @AMDEP_TRUE@@am__include@ @am__quote@ResolvExpr/$(DEPDIR)/PtrsCastable.Po@am__quote@ 1154 @AMDEP_TRUE@@am__include@ @am__quote@ResolvExpr/$(DEPDIR)/RenameVars.Po@am__quote@ 1155 @AMDEP_TRUE@@am__include@ @am__quote@ResolvExpr/$(DEPDIR)/ResolveTypeof.Po@am__quote@ 1156 @AMDEP_TRUE@@am__include@ @am__quote@ResolvExpr/$(DEPDIR)/Resolver.Po@am__quote@ 1157 @AMDEP_TRUE@@am__include@ @am__quote@ResolvExpr/$(DEPDIR)/TypeEnvironment.Po@am__quote@ 1158 @AMDEP_TRUE@@am__include@ @am__quote@ResolvExpr/$(DEPDIR)/Unify.Po@am__quote@ 1159 @AMDEP_TRUE@@am__include@ @am__quote@SymTab/$(DEPDIR)/Autogen.Po@am__quote@ 1160 @AMDEP_TRUE@@am__include@ @am__quote@SymTab/$(DEPDIR)/Demangle.Po@am__quote@ 1161 @AMDEP_TRUE@@am__include@ @am__quote@SymTab/$(DEPDIR)/FixFunction.Po@am__quote@ 1162 @AMDEP_TRUE@@am__include@ @am__quote@SymTab/$(DEPDIR)/Indexer.Po@am__quote@ 1163 @AMDEP_TRUE@@am__include@ @am__quote@SymTab/$(DEPDIR)/Mangler.Po@am__quote@ 1164 @AMDEP_TRUE@@am__include@ @am__quote@SymTab/$(DEPDIR)/ManglerCommon.Po@am__quote@ 1165 @AMDEP_TRUE@@am__include@ @am__quote@SymTab/$(DEPDIR)/Validate.Po@am__quote@ 1166 @AMDEP_TRUE@@am__include@ @am__quote@SymTab/$(DEPDIR)/demangler.Po@am__quote@ 1167 @AMDEP_TRUE@@am__include@ @am__quote@SynTree/$(DEPDIR)/AddressExpr.Po@am__quote@ 1168 @AMDEP_TRUE@@am__include@ @am__quote@SynTree/$(DEPDIR)/AggregateDecl.Po@am__quote@ 1169 @AMDEP_TRUE@@am__include@ @am__quote@SynTree/$(DEPDIR)/ApplicationExpr.Po@am__quote@ 1170 @AMDEP_TRUE@@am__include@ @am__quote@SynTree/$(DEPDIR)/ArrayType.Po@am__quote@ 1171 @AMDEP_TRUE@@am__include@ @am__quote@SynTree/$(DEPDIR)/AttrType.Po@am__quote@ 1172 @AMDEP_TRUE@@am__include@ @am__quote@SynTree/$(DEPDIR)/Attribute.Po@am__quote@ 1173 @AMDEP_TRUE@@am__include@ @am__quote@SynTree/$(DEPDIR)/BasicType.Po@am__quote@ 1174 @AMDEP_TRUE@@am__include@ @am__quote@SynTree/$(DEPDIR)/CommaExpr.Po@am__quote@ 1175 @AMDEP_TRUE@@am__include@ @am__quote@SynTree/$(DEPDIR)/CompoundStmt.Po@am__quote@ 1176 @AMDEP_TRUE@@am__include@ @am__quote@SynTree/$(DEPDIR)/Constant.Po@am__quote@ 1177 @AMDEP_TRUE@@am__include@ @am__quote@SynTree/$(DEPDIR)/DeclReplacer.Po@am__quote@ 1178 @AMDEP_TRUE@@am__include@ @am__quote@SynTree/$(DEPDIR)/DeclStmt.Po@am__quote@ 1179 @AMDEP_TRUE@@am__include@ @am__quote@SynTree/$(DEPDIR)/Declaration.Po@am__quote@ 1180 @AMDEP_TRUE@@am__include@ @am__quote@SynTree/$(DEPDIR)/DeclarationWithType.Po@am__quote@ 1181 @AMDEP_TRUE@@am__include@ @am__quote@SynTree/$(DEPDIR)/Expression.Po@am__quote@ 1182 @AMDEP_TRUE@@am__include@ @am__quote@SynTree/$(DEPDIR)/FunctionDecl.Po@am__quote@ 1183 @AMDEP_TRUE@@am__include@ @am__quote@SynTree/$(DEPDIR)/FunctionType.Po@am__quote@ 1184 @AMDEP_TRUE@@am__include@ @am__quote@SynTree/$(DEPDIR)/Initializer.Po@am__quote@ 1185 @AMDEP_TRUE@@am__include@ @am__quote@SynTree/$(DEPDIR)/NamedTypeDecl.Po@am__quote@ 1186 @AMDEP_TRUE@@am__include@ @am__quote@SynTree/$(DEPDIR)/ObjectDecl.Po@am__quote@ 1187 @AMDEP_TRUE@@am__include@ @am__quote@SynTree/$(DEPDIR)/PointerType.Po@am__quote@ 1188 @AMDEP_TRUE@@am__include@ @am__quote@SynTree/$(DEPDIR)/ReferenceToType.Po@am__quote@ 1189 @AMDEP_TRUE@@am__include@ @am__quote@SynTree/$(DEPDIR)/ReferenceType.Po@am__quote@ 1190 @AMDEP_TRUE@@am__include@ @am__quote@SynTree/$(DEPDIR)/Statement.Po@am__quote@ 1191 @AMDEP_TRUE@@am__include@ @am__quote@SynTree/$(DEPDIR)/TupleExpr.Po@am__quote@ 1192 @AMDEP_TRUE@@am__include@ @am__quote@SynTree/$(DEPDIR)/TupleType.Po@am__quote@ 1193 @AMDEP_TRUE@@am__include@ @am__quote@SynTree/$(DEPDIR)/Type.Po@am__quote@ 1194 @AMDEP_TRUE@@am__include@ @am__quote@SynTree/$(DEPDIR)/TypeDecl.Po@am__quote@ 1195 @AMDEP_TRUE@@am__include@ @am__quote@SynTree/$(DEPDIR)/TypeExpr.Po@am__quote@ 1196 @AMDEP_TRUE@@am__include@ @am__quote@SynTree/$(DEPDIR)/TypeSubstitution.Po@am__quote@ 1197 @AMDEP_TRUE@@am__include@ @am__quote@SynTree/$(DEPDIR)/TypeofType.Po@am__quote@ 1198 @AMDEP_TRUE@@am__include@ @am__quote@SynTree/$(DEPDIR)/VarArgsType.Po@am__quote@ 1199 @AMDEP_TRUE@@am__include@ @am__quote@SynTree/$(DEPDIR)/VoidType.Po@am__quote@ 1200 @AMDEP_TRUE@@am__include@ @am__quote@SynTree/$(DEPDIR)/ZeroOneType.Po@am__quote@ 1201 @AMDEP_TRUE@@am__include@ @am__quote@Tuples/$(DEPDIR)/Explode.Po@am__quote@ 1202 @AMDEP_TRUE@@am__include@ @am__quote@Tuples/$(DEPDIR)/TupleAssignment.Po@am__quote@ 1203 @AMDEP_TRUE@@am__include@ @am__quote@Tuples/$(DEPDIR)/TupleExpansion.Po@am__quote@ 1204 @AMDEP_TRUE@@am__include@ @am__quote@Validate/$(DEPDIR)/HandleAttributes.Po@am__quote@ 1205 @AMDEP_TRUE@@am__include@ @am__quote@Virtual/$(DEPDIR)/ExpandCasts.Po@am__quote@ 1078 1206 1079 1207 .cc.o: … … 1092 1220 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ 1093 1221 @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXXCOMPILE) -c -o $@ `$(CYGPATH_W) '$<'` 1094 1095 driver_cfa_cpp-main.o: main.cc1096 @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -MT driver_cfa_cpp-main.o -MD -MP -MF $(DEPDIR)/driver_cfa_cpp-main.Tpo -c -o driver_cfa_cpp-main.o `test -f 'main.cc' || echo '$(srcdir)/'`main.cc1097 @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/driver_cfa_cpp-main.Tpo $(DEPDIR)/driver_cfa_cpp-main.Po1098 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='main.cc' object='driver_cfa_cpp-main.o' libtool=no @AMDEPBACKSLASH@1099 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@1100 @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -c -o driver_cfa_cpp-main.o `test -f 'main.cc' || echo '$(srcdir)/'`main.cc1101 1102 driver_cfa_cpp-main.obj: main.cc1103 @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -MT driver_cfa_cpp-main.obj -MD -MP -MF $(DEPDIR)/driver_cfa_cpp-main.Tpo -c -o driver_cfa_cpp-main.obj `if test -f 'main.cc'; then $(CYGPATH_W) 'main.cc'; else $(CYGPATH_W) '$(srcdir)/main.cc'; fi`1104 @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/driver_cfa_cpp-main.Tpo $(DEPDIR)/driver_cfa_cpp-main.Po1105 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='main.cc' object='driver_cfa_cpp-main.obj' libtool=no @AMDEPBACKSLASH@1106 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@1107 @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -c -o driver_cfa_cpp-main.obj `if test -f 'main.cc'; then $(CYGPATH_W) 'main.cc'; else $(CYGPATH_W) '$(srcdir)/main.cc'; fi`1108 1109 driver_cfa_cpp-MakeLibCfa.o: MakeLibCfa.cc1110 @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -MT driver_cfa_cpp-MakeLibCfa.o -MD -MP -MF $(DEPDIR)/driver_cfa_cpp-MakeLibCfa.Tpo -c -o driver_cfa_cpp-MakeLibCfa.o `test -f 'MakeLibCfa.cc' || echo '$(srcdir)/'`MakeLibCfa.cc1111 @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/driver_cfa_cpp-MakeLibCfa.Tpo $(DEPDIR)/driver_cfa_cpp-MakeLibCfa.Po1112 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='MakeLibCfa.cc' object='driver_cfa_cpp-MakeLibCfa.o' libtool=no @AMDEPBACKSLASH@1113 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@1114 @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -c -o driver_cfa_cpp-MakeLibCfa.o `test -f 'MakeLibCfa.cc' || echo '$(srcdir)/'`MakeLibCfa.cc1115 1116 driver_cfa_cpp-MakeLibCfa.obj: MakeLibCfa.cc1117 @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -MT driver_cfa_cpp-MakeLibCfa.obj -MD -MP -MF $(DEPDIR)/driver_cfa_cpp-MakeLibCfa.Tpo -c -o driver_cfa_cpp-MakeLibCfa.obj `if test -f 'MakeLibCfa.cc'; then $(CYGPATH_W) 'MakeLibCfa.cc'; else $(CYGPATH_W) '$(srcdir)/MakeLibCfa.cc'; fi`1118 @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/driver_cfa_cpp-MakeLibCfa.Tpo $(DEPDIR)/driver_cfa_cpp-MakeLibCfa.Po1119 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='MakeLibCfa.cc' object='driver_cfa_cpp-MakeLibCfa.obj' libtool=no @AMDEPBACKSLASH@1120 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@1121 @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -c -o driver_cfa_cpp-MakeLibCfa.obj `if test -f 'MakeLibCfa.cc'; then $(CYGPATH_W) 'MakeLibCfa.cc'; else $(CYGPATH_W) '$(srcdir)/MakeLibCfa.cc'; fi`1122 1123 CodeGen/driver_cfa_cpp-Generate.o: CodeGen/Generate.cc1124 @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -MT CodeGen/driver_cfa_cpp-Generate.o -MD -MP -MF CodeGen/$(DEPDIR)/driver_cfa_cpp-Generate.Tpo -c -o CodeGen/driver_cfa_cpp-Generate.o `test -f 'CodeGen/Generate.cc' || echo '$(srcdir)/'`CodeGen/Generate.cc1125 @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) CodeGen/$(DEPDIR)/driver_cfa_cpp-Generate.Tpo CodeGen/$(DEPDIR)/driver_cfa_cpp-Generate.Po1126 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='CodeGen/Generate.cc' object='CodeGen/driver_cfa_cpp-Generate.o' libtool=no @AMDEPBACKSLASH@1127 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@1128 @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -c -o CodeGen/driver_cfa_cpp-Generate.o `test -f 'CodeGen/Generate.cc' || echo '$(srcdir)/'`CodeGen/Generate.cc1129 1130 CodeGen/driver_cfa_cpp-Generate.obj: CodeGen/Generate.cc1131 @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -MT CodeGen/driver_cfa_cpp-Generate.obj -MD -MP -MF CodeGen/$(DEPDIR)/driver_cfa_cpp-Generate.Tpo -c -o CodeGen/driver_cfa_cpp-Generate.obj `if test -f 'CodeGen/Generate.cc'; then $(CYGPATH_W) 'CodeGen/Generate.cc'; else $(CYGPATH_W) '$(srcdir)/CodeGen/Generate.cc'; fi`1132 @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) CodeGen/$(DEPDIR)/driver_cfa_cpp-Generate.Tpo CodeGen/$(DEPDIR)/driver_cfa_cpp-Generate.Po1133 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='CodeGen/Generate.cc' object='CodeGen/driver_cfa_cpp-Generate.obj' libtool=no @AMDEPBACKSLASH@1134 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@1135 @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -c -o CodeGen/driver_cfa_cpp-Generate.obj `if test -f 'CodeGen/Generate.cc'; then $(CYGPATH_W) 'CodeGen/Generate.cc'; else $(CYGPATH_W) '$(srcdir)/CodeGen/Generate.cc'; fi`1136 1137 CodeGen/driver_cfa_cpp-CodeGenerator.o: CodeGen/CodeGenerator.cc1138 @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -MT CodeGen/driver_cfa_cpp-CodeGenerator.o -MD -MP -MF CodeGen/$(DEPDIR)/driver_cfa_cpp-CodeGenerator.Tpo -c -o CodeGen/driver_cfa_cpp-CodeGenerator.o `test -f 'CodeGen/CodeGenerator.cc' || echo '$(srcdir)/'`CodeGen/CodeGenerator.cc1139 @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) CodeGen/$(DEPDIR)/driver_cfa_cpp-CodeGenerator.Tpo CodeGen/$(DEPDIR)/driver_cfa_cpp-CodeGenerator.Po1140 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='CodeGen/CodeGenerator.cc' object='CodeGen/driver_cfa_cpp-CodeGenerator.o' libtool=no @AMDEPBACKSLASH@1141 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@1142 @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -c -o CodeGen/driver_cfa_cpp-CodeGenerator.o `test -f 'CodeGen/CodeGenerator.cc' || echo '$(srcdir)/'`CodeGen/CodeGenerator.cc1143 1144 CodeGen/driver_cfa_cpp-CodeGenerator.obj: CodeGen/CodeGenerator.cc1145 @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -MT CodeGen/driver_cfa_cpp-CodeGenerator.obj -MD -MP -MF CodeGen/$(DEPDIR)/driver_cfa_cpp-CodeGenerator.Tpo -c -o CodeGen/driver_cfa_cpp-CodeGenerator.obj `if test -f 'CodeGen/CodeGenerator.cc'; then $(CYGPATH_W) 'CodeGen/CodeGenerator.cc'; else $(CYGPATH_W) '$(srcdir)/CodeGen/CodeGenerator.cc'; fi`1146 @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) CodeGen/$(DEPDIR)/driver_cfa_cpp-CodeGenerator.Tpo CodeGen/$(DEPDIR)/driver_cfa_cpp-CodeGenerator.Po1147 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='CodeGen/CodeGenerator.cc' object='CodeGen/driver_cfa_cpp-CodeGenerator.obj' libtool=no @AMDEPBACKSLASH@1148 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@1149 @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -c -o CodeGen/driver_cfa_cpp-CodeGenerator.obj `if test -f 'CodeGen/CodeGenerator.cc'; then $(CYGPATH_W) 'CodeGen/CodeGenerator.cc'; else $(CYGPATH_W) '$(srcdir)/CodeGen/CodeGenerator.cc'; fi`1150 1151 CodeGen/driver_cfa_cpp-GenType.o: CodeGen/GenType.cc1152 @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -MT CodeGen/driver_cfa_cpp-GenType.o -MD -MP -MF CodeGen/$(DEPDIR)/driver_cfa_cpp-GenType.Tpo -c -o CodeGen/driver_cfa_cpp-GenType.o `test -f 'CodeGen/GenType.cc' || echo '$(srcdir)/'`CodeGen/GenType.cc1153 @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) CodeGen/$(DEPDIR)/driver_cfa_cpp-GenType.Tpo CodeGen/$(DEPDIR)/driver_cfa_cpp-GenType.Po1154 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='CodeGen/GenType.cc' object='CodeGen/driver_cfa_cpp-GenType.o' libtool=no @AMDEPBACKSLASH@1155 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@1156 @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -c -o CodeGen/driver_cfa_cpp-GenType.o `test -f 'CodeGen/GenType.cc' || echo '$(srcdir)/'`CodeGen/GenType.cc1157 1158 CodeGen/driver_cfa_cpp-GenType.obj: CodeGen/GenType.cc1159 @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -MT CodeGen/driver_cfa_cpp-GenType.obj -MD -MP -MF CodeGen/$(DEPDIR)/driver_cfa_cpp-GenType.Tpo -c -o CodeGen/driver_cfa_cpp-GenType.obj `if test -f 'CodeGen/GenType.cc'; then $(CYGPATH_W) 'CodeGen/GenType.cc'; else $(CYGPATH_W) '$(srcdir)/CodeGen/GenType.cc'; fi`1160 @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) CodeGen/$(DEPDIR)/driver_cfa_cpp-GenType.Tpo CodeGen/$(DEPDIR)/driver_cfa_cpp-GenType.Po1161 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='CodeGen/GenType.cc' object='CodeGen/driver_cfa_cpp-GenType.obj' libtool=no @AMDEPBACKSLASH@1162 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@1163 @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -c -o CodeGen/driver_cfa_cpp-GenType.obj `if test -f 'CodeGen/GenType.cc'; then $(CYGPATH_W) 'CodeGen/GenType.cc'; else $(CYGPATH_W) '$(srcdir)/CodeGen/GenType.cc'; fi`1164 1165 CodeGen/driver_cfa_cpp-FixNames.o: CodeGen/FixNames.cc1166 @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -MT CodeGen/driver_cfa_cpp-FixNames.o -MD -MP -MF CodeGen/$(DEPDIR)/driver_cfa_cpp-FixNames.Tpo -c -o CodeGen/driver_cfa_cpp-FixNames.o `test -f 'CodeGen/FixNames.cc' || echo '$(srcdir)/'`CodeGen/FixNames.cc1167 @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) CodeGen/$(DEPDIR)/driver_cfa_cpp-FixNames.Tpo CodeGen/$(DEPDIR)/driver_cfa_cpp-FixNames.Po1168 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='CodeGen/FixNames.cc' object='CodeGen/driver_cfa_cpp-FixNames.o' libtool=no @AMDEPBACKSLASH@1169 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@1170 @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -c -o CodeGen/driver_cfa_cpp-FixNames.o `test -f 'CodeGen/FixNames.cc' || echo '$(srcdir)/'`CodeGen/FixNames.cc1171 1172 CodeGen/driver_cfa_cpp-FixNames.obj: CodeGen/FixNames.cc1173 @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -MT CodeGen/driver_cfa_cpp-FixNames.obj -MD -MP -MF CodeGen/$(DEPDIR)/driver_cfa_cpp-FixNames.Tpo -c -o CodeGen/driver_cfa_cpp-FixNames.obj `if test -f 'CodeGen/FixNames.cc'; then $(CYGPATH_W) 'CodeGen/FixNames.cc'; else $(CYGPATH_W) '$(srcdir)/CodeGen/FixNames.cc'; fi`1174 @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) CodeGen/$(DEPDIR)/driver_cfa_cpp-FixNames.Tpo CodeGen/$(DEPDIR)/driver_cfa_cpp-FixNames.Po1175 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='CodeGen/FixNames.cc' object='CodeGen/driver_cfa_cpp-FixNames.obj' libtool=no @AMDEPBACKSLASH@1176 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@1177 @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -c -o CodeGen/driver_cfa_cpp-FixNames.obj `if test -f 'CodeGen/FixNames.cc'; then $(CYGPATH_W) 'CodeGen/FixNames.cc'; else $(CYGPATH_W) '$(srcdir)/CodeGen/FixNames.cc'; fi`1178 1179 CodeGen/driver_cfa_cpp-FixMain.o: CodeGen/FixMain.cc1180 @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -MT CodeGen/driver_cfa_cpp-FixMain.o -MD -MP -MF CodeGen/$(DEPDIR)/driver_cfa_cpp-FixMain.Tpo -c -o CodeGen/driver_cfa_cpp-FixMain.o `test -f 'CodeGen/FixMain.cc' || echo '$(srcdir)/'`CodeGen/FixMain.cc1181 @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) CodeGen/$(DEPDIR)/driver_cfa_cpp-FixMain.Tpo CodeGen/$(DEPDIR)/driver_cfa_cpp-FixMain.Po1182 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='CodeGen/FixMain.cc' object='CodeGen/driver_cfa_cpp-FixMain.o' libtool=no @AMDEPBACKSLASH@1183 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@1184 @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -c -o CodeGen/driver_cfa_cpp-FixMain.o `test -f 'CodeGen/FixMain.cc' || echo '$(srcdir)/'`CodeGen/FixMain.cc1185 1186 CodeGen/driver_cfa_cpp-FixMain.obj: CodeGen/FixMain.cc1187 @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -MT CodeGen/driver_cfa_cpp-FixMain.obj -MD -MP -MF CodeGen/$(DEPDIR)/driver_cfa_cpp-FixMain.Tpo -c -o CodeGen/driver_cfa_cpp-FixMain.obj `if test -f 'CodeGen/FixMain.cc'; then $(CYGPATH_W) 'CodeGen/FixMain.cc'; else $(CYGPATH_W) '$(srcdir)/CodeGen/FixMain.cc'; fi`1188 @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) CodeGen/$(DEPDIR)/driver_cfa_cpp-FixMain.Tpo CodeGen/$(DEPDIR)/driver_cfa_cpp-FixMain.Po1189 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='CodeGen/FixMain.cc' object='CodeGen/driver_cfa_cpp-FixMain.obj' libtool=no @AMDEPBACKSLASH@1190 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@1191 @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -c -o CodeGen/driver_cfa_cpp-FixMain.obj `if test -f 'CodeGen/FixMain.cc'; then $(CYGPATH_W) 'CodeGen/FixMain.cc'; else $(CYGPATH_W) '$(srcdir)/CodeGen/FixMain.cc'; fi`1192 1193 CodeGen/driver_cfa_cpp-OperatorTable.o: CodeGen/OperatorTable.cc1194 @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -MT CodeGen/driver_cfa_cpp-OperatorTable.o -MD -MP -MF CodeGen/$(DEPDIR)/driver_cfa_cpp-OperatorTable.Tpo -c -o CodeGen/driver_cfa_cpp-OperatorTable.o `test -f 'CodeGen/OperatorTable.cc' || echo '$(srcdir)/'`CodeGen/OperatorTable.cc1195 @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) CodeGen/$(DEPDIR)/driver_cfa_cpp-OperatorTable.Tpo CodeGen/$(DEPDIR)/driver_cfa_cpp-OperatorTable.Po1196 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='CodeGen/OperatorTable.cc' object='CodeGen/driver_cfa_cpp-OperatorTable.o' libtool=no @AMDEPBACKSLASH@1197 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@1198 @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -c -o CodeGen/driver_cfa_cpp-OperatorTable.o `test -f 'CodeGen/OperatorTable.cc' || echo '$(srcdir)/'`CodeGen/OperatorTable.cc1199 1200 CodeGen/driver_cfa_cpp-OperatorTable.obj: CodeGen/OperatorTable.cc1201 @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -MT CodeGen/driver_cfa_cpp-OperatorTable.obj -MD -MP -MF CodeGen/$(DEPDIR)/driver_cfa_cpp-OperatorTable.Tpo -c -o CodeGen/driver_cfa_cpp-OperatorTable.obj `if test -f 'CodeGen/OperatorTable.cc'; then $(CYGPATH_W) 'CodeGen/OperatorTable.cc'; else $(CYGPATH_W) '$(srcdir)/CodeGen/OperatorTable.cc'; fi`1202 @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) CodeGen/$(DEPDIR)/driver_cfa_cpp-OperatorTable.Tpo CodeGen/$(DEPDIR)/driver_cfa_cpp-OperatorTable.Po1203 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='CodeGen/OperatorTable.cc' object='CodeGen/driver_cfa_cpp-OperatorTable.obj' libtool=no @AMDEPBACKSLASH@1204 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@1205 @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -c -o CodeGen/driver_cfa_cpp-OperatorTable.obj `if test -f 'CodeGen/OperatorTable.cc'; then $(CYGPATH_W) 'CodeGen/OperatorTable.cc'; else $(CYGPATH_W) '$(srcdir)/CodeGen/OperatorTable.cc'; fi`1206 1207 CodeTools/driver_cfa_cpp-DeclStats.o: CodeTools/DeclStats.cc1208 @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -MT CodeTools/driver_cfa_cpp-DeclStats.o -MD -MP -MF CodeTools/$(DEPDIR)/driver_cfa_cpp-DeclStats.Tpo -c -o CodeTools/driver_cfa_cpp-DeclStats.o `test -f 'CodeTools/DeclStats.cc' || echo '$(srcdir)/'`CodeTools/DeclStats.cc1209 @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) CodeTools/$(DEPDIR)/driver_cfa_cpp-DeclStats.Tpo CodeTools/$(DEPDIR)/driver_cfa_cpp-DeclStats.Po1210 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='CodeTools/DeclStats.cc' object='CodeTools/driver_cfa_cpp-DeclStats.o' libtool=no @AMDEPBACKSLASH@1211 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@1212 @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -c -o CodeTools/driver_cfa_cpp-DeclStats.o `test -f 'CodeTools/DeclStats.cc' || echo '$(srcdir)/'`CodeTools/DeclStats.cc1213 1214 CodeTools/driver_cfa_cpp-DeclStats.obj: CodeTools/DeclStats.cc1215 @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -MT CodeTools/driver_cfa_cpp-DeclStats.obj -MD -MP -MF CodeTools/$(DEPDIR)/driver_cfa_cpp-DeclStats.Tpo -c -o CodeTools/driver_cfa_cpp-DeclStats.obj `if test -f 'CodeTools/DeclStats.cc'; then $(CYGPATH_W) 'CodeTools/DeclStats.cc'; else $(CYGPATH_W) '$(srcdir)/CodeTools/DeclStats.cc'; fi`1216 @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) CodeTools/$(DEPDIR)/driver_cfa_cpp-DeclStats.Tpo CodeTools/$(DEPDIR)/driver_cfa_cpp-DeclStats.Po1217 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='CodeTools/DeclStats.cc' object='CodeTools/driver_cfa_cpp-DeclStats.obj' libtool=no @AMDEPBACKSLASH@1218 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@1219 @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -c -o CodeTools/driver_cfa_cpp-DeclStats.obj `if test -f 'CodeTools/DeclStats.cc'; then $(CYGPATH_W) 'CodeTools/DeclStats.cc'; else $(CYGPATH_W) '$(srcdir)/CodeTools/DeclStats.cc'; fi`1220 1221 CodeTools/driver_cfa_cpp-TrackLoc.o: CodeTools/TrackLoc.cc1222 @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -MT CodeTools/driver_cfa_cpp-TrackLoc.o -MD -MP -MF CodeTools/$(DEPDIR)/driver_cfa_cpp-TrackLoc.Tpo -c -o CodeTools/driver_cfa_cpp-TrackLoc.o `test -f 'CodeTools/TrackLoc.cc' || echo '$(srcdir)/'`CodeTools/TrackLoc.cc1223 @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) CodeTools/$(DEPDIR)/driver_cfa_cpp-TrackLoc.Tpo CodeTools/$(DEPDIR)/driver_cfa_cpp-TrackLoc.Po1224 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='CodeTools/TrackLoc.cc' object='CodeTools/driver_cfa_cpp-TrackLoc.o' libtool=no @AMDEPBACKSLASH@1225 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@1226 @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -c -o CodeTools/driver_cfa_cpp-TrackLoc.o `test -f 'CodeTools/TrackLoc.cc' || echo '$(srcdir)/'`CodeTools/TrackLoc.cc1227 1228 CodeTools/driver_cfa_cpp-TrackLoc.obj: CodeTools/TrackLoc.cc1229 @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -MT CodeTools/driver_cfa_cpp-TrackLoc.obj -MD -MP -MF CodeTools/$(DEPDIR)/driver_cfa_cpp-TrackLoc.Tpo -c -o CodeTools/driver_cfa_cpp-TrackLoc.obj `if test -f 'CodeTools/TrackLoc.cc'; then $(CYGPATH_W) 'CodeTools/TrackLoc.cc'; else $(CYGPATH_W) '$(srcdir)/CodeTools/TrackLoc.cc'; fi`1230 @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) CodeTools/$(DEPDIR)/driver_cfa_cpp-TrackLoc.Tpo CodeTools/$(DEPDIR)/driver_cfa_cpp-TrackLoc.Po1231 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='CodeTools/TrackLoc.cc' object='CodeTools/driver_cfa_cpp-TrackLoc.obj' libtool=no @AMDEPBACKSLASH@1232 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@1233 @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -c -o CodeTools/driver_cfa_cpp-TrackLoc.obj `if test -f 'CodeTools/TrackLoc.cc'; then $(CYGPATH_W) 'CodeTools/TrackLoc.cc'; else $(CYGPATH_W) '$(srcdir)/CodeTools/TrackLoc.cc'; fi`1234 1235 Concurrency/driver_cfa_cpp-Keywords.o: Concurrency/Keywords.cc1236 @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -MT Concurrency/driver_cfa_cpp-Keywords.o -MD -MP -MF Concurrency/$(DEPDIR)/driver_cfa_cpp-Keywords.Tpo -c -o Concurrency/driver_cfa_cpp-Keywords.o `test -f 'Concurrency/Keywords.cc' || echo '$(srcdir)/'`Concurrency/Keywords.cc1237 @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) Concurrency/$(DEPDIR)/driver_cfa_cpp-Keywords.Tpo Concurrency/$(DEPDIR)/driver_cfa_cpp-Keywords.Po1238 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='Concurrency/Keywords.cc' object='Concurrency/driver_cfa_cpp-Keywords.o' libtool=no @AMDEPBACKSLASH@1239 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@1240 @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -c -o Concurrency/driver_cfa_cpp-Keywords.o `test -f 'Concurrency/Keywords.cc' || echo '$(srcdir)/'`Concurrency/Keywords.cc1241 1242 Concurrency/driver_cfa_cpp-Keywords.obj: Concurrency/Keywords.cc1243 @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -MT Concurrency/driver_cfa_cpp-Keywords.obj -MD -MP -MF Concurrency/$(DEPDIR)/driver_cfa_cpp-Keywords.Tpo -c -o Concurrency/driver_cfa_cpp-Keywords.obj `if test -f 'Concurrency/Keywords.cc'; then $(CYGPATH_W) 'Concurrency/Keywords.cc'; else $(CYGPATH_W) '$(srcdir)/Concurrency/Keywords.cc'; fi`1244 @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) Concurrency/$(DEPDIR)/driver_cfa_cpp-Keywords.Tpo Concurrency/$(DEPDIR)/driver_cfa_cpp-Keywords.Po1245 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='Concurrency/Keywords.cc' object='Concurrency/driver_cfa_cpp-Keywords.obj' libtool=no @AMDEPBACKSLASH@1246 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@1247 @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -c -o Concurrency/driver_cfa_cpp-Keywords.obj `if test -f 'Concurrency/Keywords.cc'; then $(CYGPATH_W) 'Concurrency/Keywords.cc'; else $(CYGPATH_W) '$(srcdir)/Concurrency/Keywords.cc'; fi`1248 1249 Concurrency/driver_cfa_cpp-Waitfor.o: Concurrency/Waitfor.cc1250 @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -MT Concurrency/driver_cfa_cpp-Waitfor.o -MD -MP -MF Concurrency/$(DEPDIR)/driver_cfa_cpp-Waitfor.Tpo -c -o Concurrency/driver_cfa_cpp-Waitfor.o `test -f 'Concurrency/Waitfor.cc' || echo '$(srcdir)/'`Concurrency/Waitfor.cc1251 @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) Concurrency/$(DEPDIR)/driver_cfa_cpp-Waitfor.Tpo Concurrency/$(DEPDIR)/driver_cfa_cpp-Waitfor.Po1252 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='Concurrency/Waitfor.cc' object='Concurrency/driver_cfa_cpp-Waitfor.o' libtool=no @AMDEPBACKSLASH@1253 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@1254 @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -c -o Concurrency/driver_cfa_cpp-Waitfor.o `test -f 'Concurrency/Waitfor.cc' || echo '$(srcdir)/'`Concurrency/Waitfor.cc1255 1256 Concurrency/driver_cfa_cpp-Waitfor.obj: Concurrency/Waitfor.cc1257 @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -MT Concurrency/driver_cfa_cpp-Waitfor.obj -MD -MP -MF Concurrency/$(DEPDIR)/driver_cfa_cpp-Waitfor.Tpo -c -o Concurrency/driver_cfa_cpp-Waitfor.obj `if test -f 'Concurrency/Waitfor.cc'; then $(CYGPATH_W) 'Concurrency/Waitfor.cc'; else $(CYGPATH_W) '$(srcdir)/Concurrency/Waitfor.cc'; fi`1258 @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) Concurrency/$(DEPDIR)/driver_cfa_cpp-Waitfor.Tpo Concurrency/$(DEPDIR)/driver_cfa_cpp-Waitfor.Po1259 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='Concurrency/Waitfor.cc' object='Concurrency/driver_cfa_cpp-Waitfor.obj' libtool=no @AMDEPBACKSLASH@1260 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@1261 @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -c -o Concurrency/driver_cfa_cpp-Waitfor.obj `if test -f 'Concurrency/Waitfor.cc'; then $(CYGPATH_W) 'Concurrency/Waitfor.cc'; else $(CYGPATH_W) '$(srcdir)/Concurrency/Waitfor.cc'; fi`1262 1263 Common/driver_cfa_cpp-SemanticError.o: Common/SemanticError.cc1264 @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -MT Common/driver_cfa_cpp-SemanticError.o -MD -MP -MF Common/$(DEPDIR)/driver_cfa_cpp-SemanticError.Tpo -c -o Common/driver_cfa_cpp-SemanticError.o `test -f 'Common/SemanticError.cc' || echo '$(srcdir)/'`Common/SemanticError.cc1265 @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) Common/$(DEPDIR)/driver_cfa_cpp-SemanticError.Tpo Common/$(DEPDIR)/driver_cfa_cpp-SemanticError.Po1266 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='Common/SemanticError.cc' object='Common/driver_cfa_cpp-SemanticError.o' libtool=no @AMDEPBACKSLASH@1267 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@1268 @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -c -o Common/driver_cfa_cpp-SemanticError.o `test -f 'Common/SemanticError.cc' || echo '$(srcdir)/'`Common/SemanticError.cc1269 1270 Common/driver_cfa_cpp-SemanticError.obj: Common/SemanticError.cc1271 @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -MT Common/driver_cfa_cpp-SemanticError.obj -MD -MP -MF Common/$(DEPDIR)/driver_cfa_cpp-SemanticError.Tpo -c -o Common/driver_cfa_cpp-SemanticError.obj `if test -f 'Common/SemanticError.cc'; then $(CYGPATH_W) 'Common/SemanticError.cc'; else $(CYGPATH_W) '$(srcdir)/Common/SemanticError.cc'; fi`1272 @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) Common/$(DEPDIR)/driver_cfa_cpp-SemanticError.Tpo Common/$(DEPDIR)/driver_cfa_cpp-SemanticError.Po1273 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='Common/SemanticError.cc' object='Common/driver_cfa_cpp-SemanticError.obj' libtool=no @AMDEPBACKSLASH@1274 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@1275 @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -c -o Common/driver_cfa_cpp-SemanticError.obj `if test -f 'Common/SemanticError.cc'; then $(CYGPATH_W) 'Common/SemanticError.cc'; else $(CYGPATH_W) '$(srcdir)/Common/SemanticError.cc'; fi`1276 1277 Common/driver_cfa_cpp-UniqueName.o: Common/UniqueName.cc1278 @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -MT Common/driver_cfa_cpp-UniqueName.o -MD -MP -MF Common/$(DEPDIR)/driver_cfa_cpp-UniqueName.Tpo -c -o Common/driver_cfa_cpp-UniqueName.o `test -f 'Common/UniqueName.cc' || echo '$(srcdir)/'`Common/UniqueName.cc1279 @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) Common/$(DEPDIR)/driver_cfa_cpp-UniqueName.Tpo Common/$(DEPDIR)/driver_cfa_cpp-UniqueName.Po1280 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='Common/UniqueName.cc' object='Common/driver_cfa_cpp-UniqueName.o' libtool=no @AMDEPBACKSLASH@1281 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@1282 @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -c -o Common/driver_cfa_cpp-UniqueName.o `test -f 'Common/UniqueName.cc' || echo '$(srcdir)/'`Common/UniqueName.cc1283 1284 Common/driver_cfa_cpp-UniqueName.obj: Common/UniqueName.cc1285 @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -MT Common/driver_cfa_cpp-UniqueName.obj -MD -MP -MF Common/$(DEPDIR)/driver_cfa_cpp-UniqueName.Tpo -c -o Common/driver_cfa_cpp-UniqueName.obj `if test -f 'Common/UniqueName.cc'; then $(CYGPATH_W) 'Common/UniqueName.cc'; else $(CYGPATH_W) '$(srcdir)/Common/UniqueName.cc'; fi`1286 @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) Common/$(DEPDIR)/driver_cfa_cpp-UniqueName.Tpo Common/$(DEPDIR)/driver_cfa_cpp-UniqueName.Po1287 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='Common/UniqueName.cc' object='Common/driver_cfa_cpp-UniqueName.obj' libtool=no @AMDEPBACKSLASH@1288 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@1289 @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -c -o Common/driver_cfa_cpp-UniqueName.obj `if test -f 'Common/UniqueName.cc'; then $(CYGPATH_W) 'Common/UniqueName.cc'; else $(CYGPATH_W) '$(srcdir)/Common/UniqueName.cc'; fi`1290 1291 Common/driver_cfa_cpp-DebugMalloc.o: Common/DebugMalloc.cc1292 @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -MT Common/driver_cfa_cpp-DebugMalloc.o -MD -MP -MF Common/$(DEPDIR)/driver_cfa_cpp-DebugMalloc.Tpo -c -o Common/driver_cfa_cpp-DebugMalloc.o `test -f 'Common/DebugMalloc.cc' || echo '$(srcdir)/'`Common/DebugMalloc.cc1293 @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) Common/$(DEPDIR)/driver_cfa_cpp-DebugMalloc.Tpo Common/$(DEPDIR)/driver_cfa_cpp-DebugMalloc.Po1294 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='Common/DebugMalloc.cc' object='Common/driver_cfa_cpp-DebugMalloc.o' libtool=no @AMDEPBACKSLASH@1295 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@1296 @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -c -o Common/driver_cfa_cpp-DebugMalloc.o `test -f 'Common/DebugMalloc.cc' || echo '$(srcdir)/'`Common/DebugMalloc.cc1297 1298 Common/driver_cfa_cpp-DebugMalloc.obj: Common/DebugMalloc.cc1299 @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -MT Common/driver_cfa_cpp-DebugMalloc.obj -MD -MP -MF Common/$(DEPDIR)/driver_cfa_cpp-DebugMalloc.Tpo -c -o Common/driver_cfa_cpp-DebugMalloc.obj `if test -f 'Common/DebugMalloc.cc'; then $(CYGPATH_W) 'Common/DebugMalloc.cc'; else $(CYGPATH_W) '$(srcdir)/Common/DebugMalloc.cc'; fi`1300 @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) Common/$(DEPDIR)/driver_cfa_cpp-DebugMalloc.Tpo Common/$(DEPDIR)/driver_cfa_cpp-DebugMalloc.Po1301 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='Common/DebugMalloc.cc' object='Common/driver_cfa_cpp-DebugMalloc.obj' libtool=no @AMDEPBACKSLASH@1302 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@1303 @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -c -o Common/driver_cfa_cpp-DebugMalloc.obj `if test -f 'Common/DebugMalloc.cc'; then $(CYGPATH_W) 'Common/DebugMalloc.cc'; else $(CYGPATH_W) '$(srcdir)/Common/DebugMalloc.cc'; fi`1304 1305 Common/driver_cfa_cpp-Assert.o: Common/Assert.cc1306 @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -MT Common/driver_cfa_cpp-Assert.o -MD -MP -MF Common/$(DEPDIR)/driver_cfa_cpp-Assert.Tpo -c -o Common/driver_cfa_cpp-Assert.o `test -f 'Common/Assert.cc' || echo '$(srcdir)/'`Common/Assert.cc1307 @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) Common/$(DEPDIR)/driver_cfa_cpp-Assert.Tpo Common/$(DEPDIR)/driver_cfa_cpp-Assert.Po1308 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='Common/Assert.cc' object='Common/driver_cfa_cpp-Assert.o' libtool=no @AMDEPBACKSLASH@1309 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@1310 @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -c -o Common/driver_cfa_cpp-Assert.o `test -f 'Common/Assert.cc' || echo '$(srcdir)/'`Common/Assert.cc1311 1312 Common/driver_cfa_cpp-Assert.obj: Common/Assert.cc1313 @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -MT Common/driver_cfa_cpp-Assert.obj -MD -MP -MF Common/$(DEPDIR)/driver_cfa_cpp-Assert.Tpo -c -o Common/driver_cfa_cpp-Assert.obj `if test -f 'Common/Assert.cc'; then $(CYGPATH_W) 'Common/Assert.cc'; else $(CYGPATH_W) '$(srcdir)/Common/Assert.cc'; fi`1314 @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) Common/$(DEPDIR)/driver_cfa_cpp-Assert.Tpo Common/$(DEPDIR)/driver_cfa_cpp-Assert.Po1315 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='Common/Assert.cc' object='Common/driver_cfa_cpp-Assert.obj' libtool=no @AMDEPBACKSLASH@1316 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@1317 @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -c -o Common/driver_cfa_cpp-Assert.obj `if test -f 'Common/Assert.cc'; then $(CYGPATH_W) 'Common/Assert.cc'; else $(CYGPATH_W) '$(srcdir)/Common/Assert.cc'; fi`1318 1319 ControlStruct/driver_cfa_cpp-LabelGenerator.o: ControlStruct/LabelGenerator.cc1320 @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -MT ControlStruct/driver_cfa_cpp-LabelGenerator.o -MD -MP -MF ControlStruct/$(DEPDIR)/driver_cfa_cpp-LabelGenerator.Tpo -c -o ControlStruct/driver_cfa_cpp-LabelGenerator.o `test -f 'ControlStruct/LabelGenerator.cc' || echo '$(srcdir)/'`ControlStruct/LabelGenerator.cc1321 @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) ControlStruct/$(DEPDIR)/driver_cfa_cpp-LabelGenerator.Tpo ControlStruct/$(DEPDIR)/driver_cfa_cpp-LabelGenerator.Po1322 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='ControlStruct/LabelGenerator.cc' object='ControlStruct/driver_cfa_cpp-LabelGenerator.o' libtool=no @AMDEPBACKSLASH@1323 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@1324 @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -c -o ControlStruct/driver_cfa_cpp-LabelGenerator.o `test -f 'ControlStruct/LabelGenerator.cc' || echo '$(srcdir)/'`ControlStruct/LabelGenerator.cc1325 1326 ControlStruct/driver_cfa_cpp-LabelGenerator.obj: ControlStruct/LabelGenerator.cc1327 @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -MT ControlStruct/driver_cfa_cpp-LabelGenerator.obj -MD -MP -MF ControlStruct/$(DEPDIR)/driver_cfa_cpp-LabelGenerator.Tpo -c -o ControlStruct/driver_cfa_cpp-LabelGenerator.obj `if test -f 'ControlStruct/LabelGenerator.cc'; then $(CYGPATH_W) 'ControlStruct/LabelGenerator.cc'; else $(CYGPATH_W) '$(srcdir)/ControlStruct/LabelGenerator.cc'; fi`1328 @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) ControlStruct/$(DEPDIR)/driver_cfa_cpp-LabelGenerator.Tpo ControlStruct/$(DEPDIR)/driver_cfa_cpp-LabelGenerator.Po1329 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='ControlStruct/LabelGenerator.cc' object='ControlStruct/driver_cfa_cpp-LabelGenerator.obj' libtool=no @AMDEPBACKSLASH@1330 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@1331 @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -c -o ControlStruct/driver_cfa_cpp-LabelGenerator.obj `if test -f 'ControlStruct/LabelGenerator.cc'; then $(CYGPATH_W) 'ControlStruct/LabelGenerator.cc'; else $(CYGPATH_W) '$(srcdir)/ControlStruct/LabelGenerator.cc'; fi`1332 1333 ControlStruct/driver_cfa_cpp-LabelFixer.o: ControlStruct/LabelFixer.cc1334 @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -MT ControlStruct/driver_cfa_cpp-LabelFixer.o -MD -MP -MF ControlStruct/$(DEPDIR)/driver_cfa_cpp-LabelFixer.Tpo -c -o ControlStruct/driver_cfa_cpp-LabelFixer.o `test -f 'ControlStruct/LabelFixer.cc' || echo '$(srcdir)/'`ControlStruct/LabelFixer.cc1335 @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) ControlStruct/$(DEPDIR)/driver_cfa_cpp-LabelFixer.Tpo ControlStruct/$(DEPDIR)/driver_cfa_cpp-LabelFixer.Po1336 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='ControlStruct/LabelFixer.cc' object='ControlStruct/driver_cfa_cpp-LabelFixer.o' libtool=no @AMDEPBACKSLASH@1337 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@1338 @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -c -o ControlStruct/driver_cfa_cpp-LabelFixer.o `test -f 'ControlStruct/LabelFixer.cc' || echo '$(srcdir)/'`ControlStruct/LabelFixer.cc1339 1340 ControlStruct/driver_cfa_cpp-LabelFixer.obj: ControlStruct/LabelFixer.cc1341 @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -MT ControlStruct/driver_cfa_cpp-LabelFixer.obj -MD -MP -MF ControlStruct/$(DEPDIR)/driver_cfa_cpp-LabelFixer.Tpo -c -o ControlStruct/driver_cfa_cpp-LabelFixer.obj `if test -f 'ControlStruct/LabelFixer.cc'; then $(CYGPATH_W) 'ControlStruct/LabelFixer.cc'; else $(CYGPATH_W) '$(srcdir)/ControlStruct/LabelFixer.cc'; fi`1342 @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) ControlStruct/$(DEPDIR)/driver_cfa_cpp-LabelFixer.Tpo ControlStruct/$(DEPDIR)/driver_cfa_cpp-LabelFixer.Po1343 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='ControlStruct/LabelFixer.cc' object='ControlStruct/driver_cfa_cpp-LabelFixer.obj' libtool=no @AMDEPBACKSLASH@1344 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@1345 @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -c -o ControlStruct/driver_cfa_cpp-LabelFixer.obj `if test -f 'ControlStruct/LabelFixer.cc'; then $(CYGPATH_W) 'ControlStruct/LabelFixer.cc'; else $(CYGPATH_W) '$(srcdir)/ControlStruct/LabelFixer.cc'; fi`1346 1347 ControlStruct/driver_cfa_cpp-MLEMutator.o: ControlStruct/MLEMutator.cc1348 @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -MT ControlStruct/driver_cfa_cpp-MLEMutator.o -MD -MP -MF ControlStruct/$(DEPDIR)/driver_cfa_cpp-MLEMutator.Tpo -c -o ControlStruct/driver_cfa_cpp-MLEMutator.o `test -f 'ControlStruct/MLEMutator.cc' || echo '$(srcdir)/'`ControlStruct/MLEMutator.cc1349 @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) ControlStruct/$(DEPDIR)/driver_cfa_cpp-MLEMutator.Tpo ControlStruct/$(DEPDIR)/driver_cfa_cpp-MLEMutator.Po1350 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='ControlStruct/MLEMutator.cc' object='ControlStruct/driver_cfa_cpp-MLEMutator.o' libtool=no @AMDEPBACKSLASH@1351 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@1352 @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -c -o ControlStruct/driver_cfa_cpp-MLEMutator.o `test -f 'ControlStruct/MLEMutator.cc' || echo '$(srcdir)/'`ControlStruct/MLEMutator.cc1353 1354 ControlStruct/driver_cfa_cpp-MLEMutator.obj: ControlStruct/MLEMutator.cc1355 @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -MT ControlStruct/driver_cfa_cpp-MLEMutator.obj -MD -MP -MF ControlStruct/$(DEPDIR)/driver_cfa_cpp-MLEMutator.Tpo -c -o ControlStruct/driver_cfa_cpp-MLEMutator.obj `if test -f 'ControlStruct/MLEMutator.cc'; then $(CYGPATH_W) 'ControlStruct/MLEMutator.cc'; else $(CYGPATH_W) '$(srcdir)/ControlStruct/MLEMutator.cc'; fi`1356 @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) ControlStruct/$(DEPDIR)/driver_cfa_cpp-MLEMutator.Tpo ControlStruct/$(DEPDIR)/driver_cfa_cpp-MLEMutator.Po1357 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='ControlStruct/MLEMutator.cc' object='ControlStruct/driver_cfa_cpp-MLEMutator.obj' libtool=no @AMDEPBACKSLASH@1358 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@1359 @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -c -o ControlStruct/driver_cfa_cpp-MLEMutator.obj `if test -f 'ControlStruct/MLEMutator.cc'; then $(CYGPATH_W) 'ControlStruct/MLEMutator.cc'; else $(CYGPATH_W) '$(srcdir)/ControlStruct/MLEMutator.cc'; fi`1360 1361 ControlStruct/driver_cfa_cpp-Mutate.o: ControlStruct/Mutate.cc1362 @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -MT ControlStruct/driver_cfa_cpp-Mutate.o -MD -MP -MF ControlStruct/$(DEPDIR)/driver_cfa_cpp-Mutate.Tpo -c -o ControlStruct/driver_cfa_cpp-Mutate.o `test -f 'ControlStruct/Mutate.cc' || echo '$(srcdir)/'`ControlStruct/Mutate.cc1363 @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) ControlStruct/$(DEPDIR)/driver_cfa_cpp-Mutate.Tpo ControlStruct/$(DEPDIR)/driver_cfa_cpp-Mutate.Po1364 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='ControlStruct/Mutate.cc' object='ControlStruct/driver_cfa_cpp-Mutate.o' libtool=no @AMDEPBACKSLASH@1365 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@1366 @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -c -o ControlStruct/driver_cfa_cpp-Mutate.o `test -f 'ControlStruct/Mutate.cc' || echo '$(srcdir)/'`ControlStruct/Mutate.cc1367 1368 ControlStruct/driver_cfa_cpp-Mutate.obj: ControlStruct/Mutate.cc1369 @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -MT ControlStruct/driver_cfa_cpp-Mutate.obj -MD -MP -MF ControlStruct/$(DEPDIR)/driver_cfa_cpp-Mutate.Tpo -c -o ControlStruct/driver_cfa_cpp-Mutate.obj `if test -f 'ControlStruct/Mutate.cc'; then $(CYGPATH_W) 'ControlStruct/Mutate.cc'; else $(CYGPATH_W) '$(srcdir)/ControlStruct/Mutate.cc'; fi`1370 @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) ControlStruct/$(DEPDIR)/driver_cfa_cpp-Mutate.Tpo ControlStruct/$(DEPDIR)/driver_cfa_cpp-Mutate.Po1371 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='ControlStruct/Mutate.cc' object='ControlStruct/driver_cfa_cpp-Mutate.obj' libtool=no @AMDEPBACKSLASH@1372 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@1373 @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -c -o ControlStruct/driver_cfa_cpp-Mutate.obj `if test -f 'ControlStruct/Mutate.cc'; then $(CYGPATH_W) 'ControlStruct/Mutate.cc'; else $(CYGPATH_W) '$(srcdir)/ControlStruct/Mutate.cc'; fi`1374 1375 ControlStruct/driver_cfa_cpp-ForExprMutator.o: ControlStruct/ForExprMutator.cc1376 @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -MT ControlStruct/driver_cfa_cpp-ForExprMutator.o -MD -MP -MF ControlStruct/$(DEPDIR)/driver_cfa_cpp-ForExprMutator.Tpo -c -o ControlStruct/driver_cfa_cpp-ForExprMutator.o `test -f 'ControlStruct/ForExprMutator.cc' || echo '$(srcdir)/'`ControlStruct/ForExprMutator.cc1377 @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) ControlStruct/$(DEPDIR)/driver_cfa_cpp-ForExprMutator.Tpo ControlStruct/$(DEPDIR)/driver_cfa_cpp-ForExprMutator.Po1378 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='ControlStruct/ForExprMutator.cc' object='ControlStruct/driver_cfa_cpp-ForExprMutator.o' libtool=no @AMDEPBACKSLASH@1379 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@1380 @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -c -o ControlStruct/driver_cfa_cpp-ForExprMutator.o `test -f 'ControlStruct/ForExprMutator.cc' || echo '$(srcdir)/'`ControlStruct/ForExprMutator.cc1381 1382 ControlStruct/driver_cfa_cpp-ForExprMutator.obj: ControlStruct/ForExprMutator.cc1383 @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -MT ControlStruct/driver_cfa_cpp-ForExprMutator.obj -MD -MP -MF ControlStruct/$(DEPDIR)/driver_cfa_cpp-ForExprMutator.Tpo -c -o ControlStruct/driver_cfa_cpp-ForExprMutator.obj `if test -f 'ControlStruct/ForExprMutator.cc'; then $(CYGPATH_W) 'ControlStruct/ForExprMutator.cc'; else $(CYGPATH_W) '$(srcdir)/ControlStruct/ForExprMutator.cc'; fi`1384 @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) ControlStruct/$(DEPDIR)/driver_cfa_cpp-ForExprMutator.Tpo ControlStruct/$(DEPDIR)/driver_cfa_cpp-ForExprMutator.Po1385 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='ControlStruct/ForExprMutator.cc' object='ControlStruct/driver_cfa_cpp-ForExprMutator.obj' libtool=no @AMDEPBACKSLASH@1386 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@1387 @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -c -o ControlStruct/driver_cfa_cpp-ForExprMutator.obj `if test -f 'ControlStruct/ForExprMutator.cc'; then $(CYGPATH_W) 'ControlStruct/ForExprMutator.cc'; else $(CYGPATH_W) '$(srcdir)/ControlStruct/ForExprMutator.cc'; fi`1388 1389 ControlStruct/driver_cfa_cpp-ExceptTranslate.o: ControlStruct/ExceptTranslate.cc1390 @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -MT ControlStruct/driver_cfa_cpp-ExceptTranslate.o -MD -MP -MF ControlStruct/$(DEPDIR)/driver_cfa_cpp-ExceptTranslate.Tpo -c -o ControlStruct/driver_cfa_cpp-ExceptTranslate.o `test -f 'ControlStruct/ExceptTranslate.cc' || echo '$(srcdir)/'`ControlStruct/ExceptTranslate.cc1391 @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) ControlStruct/$(DEPDIR)/driver_cfa_cpp-ExceptTranslate.Tpo ControlStruct/$(DEPDIR)/driver_cfa_cpp-ExceptTranslate.Po1392 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='ControlStruct/ExceptTranslate.cc' object='ControlStruct/driver_cfa_cpp-ExceptTranslate.o' libtool=no @AMDEPBACKSLASH@1393 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@1394 @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -c -o ControlStruct/driver_cfa_cpp-ExceptTranslate.o `test -f 'ControlStruct/ExceptTranslate.cc' || echo '$(srcdir)/'`ControlStruct/ExceptTranslate.cc1395 1396 ControlStruct/driver_cfa_cpp-ExceptTranslate.obj: ControlStruct/ExceptTranslate.cc1397 @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -MT ControlStruct/driver_cfa_cpp-ExceptTranslate.obj -MD -MP -MF ControlStruct/$(DEPDIR)/driver_cfa_cpp-ExceptTranslate.Tpo -c -o ControlStruct/driver_cfa_cpp-ExceptTranslate.obj `if test -f 'ControlStruct/ExceptTranslate.cc'; then $(CYGPATH_W) 'ControlStruct/ExceptTranslate.cc'; else $(CYGPATH_W) '$(srcdir)/ControlStruct/ExceptTranslate.cc'; fi`1398 @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) ControlStruct/$(DEPDIR)/driver_cfa_cpp-ExceptTranslate.Tpo ControlStruct/$(DEPDIR)/driver_cfa_cpp-ExceptTranslate.Po1399 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='ControlStruct/ExceptTranslate.cc' object='ControlStruct/driver_cfa_cpp-ExceptTranslate.obj' libtool=no @AMDEPBACKSLASH@1400 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@1401 @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -c -o ControlStruct/driver_cfa_cpp-ExceptTranslate.obj `if test -f 'ControlStruct/ExceptTranslate.cc'; then $(CYGPATH_W) 'ControlStruct/ExceptTranslate.cc'; else $(CYGPATH_W) '$(srcdir)/ControlStruct/ExceptTranslate.cc'; fi`1402 1403 GenPoly/driver_cfa_cpp-Box.o: GenPoly/Box.cc1404 @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -MT GenPoly/driver_cfa_cpp-Box.o -MD -MP -MF GenPoly/$(DEPDIR)/driver_cfa_cpp-Box.Tpo -c -o GenPoly/driver_cfa_cpp-Box.o `test -f 'GenPoly/Box.cc' || echo '$(srcdir)/'`GenPoly/Box.cc1405 @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) GenPoly/$(DEPDIR)/driver_cfa_cpp-Box.Tpo GenPoly/$(DEPDIR)/driver_cfa_cpp-Box.Po1406 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='GenPoly/Box.cc' object='GenPoly/driver_cfa_cpp-Box.o' libtool=no @AMDEPBACKSLASH@1407 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@1408 @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -c -o GenPoly/driver_cfa_cpp-Box.o `test -f 'GenPoly/Box.cc' || echo '$(srcdir)/'`GenPoly/Box.cc1409 1410 GenPoly/driver_cfa_cpp-Box.obj: GenPoly/Box.cc1411 @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -MT GenPoly/driver_cfa_cpp-Box.obj -MD -MP -MF GenPoly/$(DEPDIR)/driver_cfa_cpp-Box.Tpo -c -o GenPoly/driver_cfa_cpp-Box.obj `if test -f 'GenPoly/Box.cc'; then $(CYGPATH_W) 'GenPoly/Box.cc'; else $(CYGPATH_W) '$(srcdir)/GenPoly/Box.cc'; fi`1412 @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) GenPoly/$(DEPDIR)/driver_cfa_cpp-Box.Tpo GenPoly/$(DEPDIR)/driver_cfa_cpp-Box.Po1413 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='GenPoly/Box.cc' object='GenPoly/driver_cfa_cpp-Box.obj' libtool=no @AMDEPBACKSLASH@1414 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@1415 @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -c -o GenPoly/driver_cfa_cpp-Box.obj `if test -f 'GenPoly/Box.cc'; then $(CYGPATH_W) 'GenPoly/Box.cc'; else $(CYGPATH_W) '$(srcdir)/GenPoly/Box.cc'; fi`1416 1417 GenPoly/driver_cfa_cpp-GenPoly.o: GenPoly/GenPoly.cc1418 @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -MT GenPoly/driver_cfa_cpp-GenPoly.o -MD -MP -MF GenPoly/$(DEPDIR)/driver_cfa_cpp-GenPoly.Tpo -c -o GenPoly/driver_cfa_cpp-GenPoly.o `test -f 'GenPoly/GenPoly.cc' || echo '$(srcdir)/'`GenPoly/GenPoly.cc1419 @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) GenPoly/$(DEPDIR)/driver_cfa_cpp-GenPoly.Tpo GenPoly/$(DEPDIR)/driver_cfa_cpp-GenPoly.Po1420 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='GenPoly/GenPoly.cc' object='GenPoly/driver_cfa_cpp-GenPoly.o' libtool=no @AMDEPBACKSLASH@1421 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@1422 @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -c -o GenPoly/driver_cfa_cpp-GenPoly.o `test -f 'GenPoly/GenPoly.cc' || echo '$(srcdir)/'`GenPoly/GenPoly.cc1423 1424 GenPoly/driver_cfa_cpp-GenPoly.obj: GenPoly/GenPoly.cc1425 @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -MT GenPoly/driver_cfa_cpp-GenPoly.obj -MD -MP -MF GenPoly/$(DEPDIR)/driver_cfa_cpp-GenPoly.Tpo -c -o GenPoly/driver_cfa_cpp-GenPoly.obj `if test -f 'GenPoly/GenPoly.cc'; then $(CYGPATH_W) 'GenPoly/GenPoly.cc'; else $(CYGPATH_W) '$(srcdir)/GenPoly/GenPoly.cc'; fi`1426 @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) GenPoly/$(DEPDIR)/driver_cfa_cpp-GenPoly.Tpo GenPoly/$(DEPDIR)/driver_cfa_cpp-GenPoly.Po1427 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='GenPoly/GenPoly.cc' object='GenPoly/driver_cfa_cpp-GenPoly.obj' libtool=no @AMDEPBACKSLASH@1428 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@1429 @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -c -o GenPoly/driver_cfa_cpp-GenPoly.obj `if test -f 'GenPoly/GenPoly.cc'; then $(CYGPATH_W) 'GenPoly/GenPoly.cc'; else $(CYGPATH_W) '$(srcdir)/GenPoly/GenPoly.cc'; fi`1430 1431 GenPoly/driver_cfa_cpp-ScrubTyVars.o: GenPoly/ScrubTyVars.cc1432 @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -MT GenPoly/driver_cfa_cpp-ScrubTyVars.o -MD -MP -MF GenPoly/$(DEPDIR)/driver_cfa_cpp-ScrubTyVars.Tpo -c -o GenPoly/driver_cfa_cpp-ScrubTyVars.o `test -f 'GenPoly/ScrubTyVars.cc' || echo '$(srcdir)/'`GenPoly/ScrubTyVars.cc1433 @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) GenPoly/$(DEPDIR)/driver_cfa_cpp-ScrubTyVars.Tpo GenPoly/$(DEPDIR)/driver_cfa_cpp-ScrubTyVars.Po1434 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='GenPoly/ScrubTyVars.cc' object='GenPoly/driver_cfa_cpp-ScrubTyVars.o' libtool=no @AMDEPBACKSLASH@1435 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@1436 @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -c -o GenPoly/driver_cfa_cpp-ScrubTyVars.o `test -f 'GenPoly/ScrubTyVars.cc' || echo '$(srcdir)/'`GenPoly/ScrubTyVars.cc1437 1438 GenPoly/driver_cfa_cpp-ScrubTyVars.obj: GenPoly/ScrubTyVars.cc1439 @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -MT GenPoly/driver_cfa_cpp-ScrubTyVars.obj -MD -MP -MF GenPoly/$(DEPDIR)/driver_cfa_cpp-ScrubTyVars.Tpo -c -o GenPoly/driver_cfa_cpp-ScrubTyVars.obj `if test -f 'GenPoly/ScrubTyVars.cc'; then $(CYGPATH_W) 'GenPoly/ScrubTyVars.cc'; else $(CYGPATH_W) '$(srcdir)/GenPoly/ScrubTyVars.cc'; fi`1440 @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) GenPoly/$(DEPDIR)/driver_cfa_cpp-ScrubTyVars.Tpo GenPoly/$(DEPDIR)/driver_cfa_cpp-ScrubTyVars.Po1441 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='GenPoly/ScrubTyVars.cc' object='GenPoly/driver_cfa_cpp-ScrubTyVars.obj' libtool=no @AMDEPBACKSLASH@1442 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@1443 @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -c -o GenPoly/driver_cfa_cpp-ScrubTyVars.obj `if test -f 'GenPoly/ScrubTyVars.cc'; then $(CYGPATH_W) 'GenPoly/ScrubTyVars.cc'; else $(CYGPATH_W) '$(srcdir)/GenPoly/ScrubTyVars.cc'; fi`1444 1445 GenPoly/driver_cfa_cpp-Lvalue.o: GenPoly/Lvalue.cc1446 @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -MT GenPoly/driver_cfa_cpp-Lvalue.o -MD -MP -MF GenPoly/$(DEPDIR)/driver_cfa_cpp-Lvalue.Tpo -c -o GenPoly/driver_cfa_cpp-Lvalue.o `test -f 'GenPoly/Lvalue.cc' || echo '$(srcdir)/'`GenPoly/Lvalue.cc1447 @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) GenPoly/$(DEPDIR)/driver_cfa_cpp-Lvalue.Tpo GenPoly/$(DEPDIR)/driver_cfa_cpp-Lvalue.Po1448 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='GenPoly/Lvalue.cc' object='GenPoly/driver_cfa_cpp-Lvalue.o' libtool=no @AMDEPBACKSLASH@1449 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@1450 @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -c -o GenPoly/driver_cfa_cpp-Lvalue.o `test -f 'GenPoly/Lvalue.cc' || echo '$(srcdir)/'`GenPoly/Lvalue.cc1451 1452 GenPoly/driver_cfa_cpp-Lvalue.obj: GenPoly/Lvalue.cc1453 @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -MT GenPoly/driver_cfa_cpp-Lvalue.obj -MD -MP -MF GenPoly/$(DEPDIR)/driver_cfa_cpp-Lvalue.Tpo -c -o GenPoly/driver_cfa_cpp-Lvalue.obj `if test -f 'GenPoly/Lvalue.cc'; then $(CYGPATH_W) 'GenPoly/Lvalue.cc'; else $(CYGPATH_W) '$(srcdir)/GenPoly/Lvalue.cc'; fi`1454 @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) GenPoly/$(DEPDIR)/driver_cfa_cpp-Lvalue.Tpo GenPoly/$(DEPDIR)/driver_cfa_cpp-Lvalue.Po1455 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='GenPoly/Lvalue.cc' object='GenPoly/driver_cfa_cpp-Lvalue.obj' libtool=no @AMDEPBACKSLASH@1456 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@1457 @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -c -o GenPoly/driver_cfa_cpp-Lvalue.obj `if test -f 'GenPoly/Lvalue.cc'; then $(CYGPATH_W) 'GenPoly/Lvalue.cc'; else $(CYGPATH_W) '$(srcdir)/GenPoly/Lvalue.cc'; fi`1458 1459 GenPoly/driver_cfa_cpp-Specialize.o: GenPoly/Specialize.cc1460 @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -MT GenPoly/driver_cfa_cpp-Specialize.o -MD -MP -MF GenPoly/$(DEPDIR)/driver_cfa_cpp-Specialize.Tpo -c -o GenPoly/driver_cfa_cpp-Specialize.o `test -f 'GenPoly/Specialize.cc' || echo '$(srcdir)/'`GenPoly/Specialize.cc1461 @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) GenPoly/$(DEPDIR)/driver_cfa_cpp-Specialize.Tpo GenPoly/$(DEPDIR)/driver_cfa_cpp-Specialize.Po1462 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='GenPoly/Specialize.cc' object='GenPoly/driver_cfa_cpp-Specialize.o' libtool=no @AMDEPBACKSLASH@1463 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@1464 @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -c -o GenPoly/driver_cfa_cpp-Specialize.o `test -f 'GenPoly/Specialize.cc' || echo '$(srcdir)/'`GenPoly/Specialize.cc1465 1466 GenPoly/driver_cfa_cpp-Specialize.obj: GenPoly/Specialize.cc1467 @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -MT GenPoly/driver_cfa_cpp-Specialize.obj -MD -MP -MF GenPoly/$(DEPDIR)/driver_cfa_cpp-Specialize.Tpo -c -o GenPoly/driver_cfa_cpp-Specialize.obj `if test -f 'GenPoly/Specialize.cc'; then $(CYGPATH_W) 'GenPoly/Specialize.cc'; else $(CYGPATH_W) '$(srcdir)/GenPoly/Specialize.cc'; fi`1468 @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) GenPoly/$(DEPDIR)/driver_cfa_cpp-Specialize.Tpo GenPoly/$(DEPDIR)/driver_cfa_cpp-Specialize.Po1469 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='GenPoly/Specialize.cc' object='GenPoly/driver_cfa_cpp-Specialize.obj' libtool=no @AMDEPBACKSLASH@1470 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@1471 @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -c -o GenPoly/driver_cfa_cpp-Specialize.obj `if test -f 'GenPoly/Specialize.cc'; then $(CYGPATH_W) 'GenPoly/Specialize.cc'; else $(CYGPATH_W) '$(srcdir)/GenPoly/Specialize.cc'; fi`1472 1473 GenPoly/driver_cfa_cpp-FindFunction.o: GenPoly/FindFunction.cc1474 @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -MT GenPoly/driver_cfa_cpp-FindFunction.o -MD -MP -MF GenPoly/$(DEPDIR)/driver_cfa_cpp-FindFunction.Tpo -c -o GenPoly/driver_cfa_cpp-FindFunction.o `test -f 'GenPoly/FindFunction.cc' || echo '$(srcdir)/'`GenPoly/FindFunction.cc1475 @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) GenPoly/$(DEPDIR)/driver_cfa_cpp-FindFunction.Tpo GenPoly/$(DEPDIR)/driver_cfa_cpp-FindFunction.Po1476 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='GenPoly/FindFunction.cc' object='GenPoly/driver_cfa_cpp-FindFunction.o' libtool=no @AMDEPBACKSLASH@1477 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@1478 @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -c -o GenPoly/driver_cfa_cpp-FindFunction.o `test -f 'GenPoly/FindFunction.cc' || echo '$(srcdir)/'`GenPoly/FindFunction.cc1479 1480 GenPoly/driver_cfa_cpp-FindFunction.obj: GenPoly/FindFunction.cc1481 @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -MT GenPoly/driver_cfa_cpp-FindFunction.obj -MD -MP -MF GenPoly/$(DEPDIR)/driver_cfa_cpp-FindFunction.Tpo -c -o GenPoly/driver_cfa_cpp-FindFunction.obj `if test -f 'GenPoly/FindFunction.cc'; then $(CYGPATH_W) 'GenPoly/FindFunction.cc'; else $(CYGPATH_W) '$(srcdir)/GenPoly/FindFunction.cc'; fi`1482 @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) GenPoly/$(DEPDIR)/driver_cfa_cpp-FindFunction.Tpo GenPoly/$(DEPDIR)/driver_cfa_cpp-FindFunction.Po1483 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='GenPoly/FindFunction.cc' object='GenPoly/driver_cfa_cpp-FindFunction.obj' libtool=no @AMDEPBACKSLASH@1484 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@1485 @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -c -o GenPoly/driver_cfa_cpp-FindFunction.obj `if test -f 'GenPoly/FindFunction.cc'; then $(CYGPATH_W) 'GenPoly/FindFunction.cc'; else $(CYGPATH_W) '$(srcdir)/GenPoly/FindFunction.cc'; fi`1486 1487 GenPoly/driver_cfa_cpp-InstantiateGeneric.o: GenPoly/InstantiateGeneric.cc1488 @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -MT GenPoly/driver_cfa_cpp-InstantiateGeneric.o -MD -MP -MF GenPoly/$(DEPDIR)/driver_cfa_cpp-InstantiateGeneric.Tpo -c -o GenPoly/driver_cfa_cpp-InstantiateGeneric.o `test -f 'GenPoly/InstantiateGeneric.cc' || echo '$(srcdir)/'`GenPoly/InstantiateGeneric.cc1489 @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) GenPoly/$(DEPDIR)/driver_cfa_cpp-InstantiateGeneric.Tpo GenPoly/$(DEPDIR)/driver_cfa_cpp-InstantiateGeneric.Po1490 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='GenPoly/InstantiateGeneric.cc' object='GenPoly/driver_cfa_cpp-InstantiateGeneric.o' libtool=no @AMDEPBACKSLASH@1491 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@1492 @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -c -o GenPoly/driver_cfa_cpp-InstantiateGeneric.o `test -f 'GenPoly/InstantiateGeneric.cc' || echo '$(srcdir)/'`GenPoly/InstantiateGeneric.cc1493 1494 GenPoly/driver_cfa_cpp-InstantiateGeneric.obj: GenPoly/InstantiateGeneric.cc1495 @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -MT GenPoly/driver_cfa_cpp-InstantiateGeneric.obj -MD -MP -MF GenPoly/$(DEPDIR)/driver_cfa_cpp-InstantiateGeneric.Tpo -c -o GenPoly/driver_cfa_cpp-InstantiateGeneric.obj `if test -f 'GenPoly/InstantiateGeneric.cc'; then $(CYGPATH_W) 'GenPoly/InstantiateGeneric.cc'; else $(CYGPATH_W) '$(srcdir)/GenPoly/InstantiateGeneric.cc'; fi`1496 @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) GenPoly/$(DEPDIR)/driver_cfa_cpp-InstantiateGeneric.Tpo GenPoly/$(DEPDIR)/driver_cfa_cpp-InstantiateGeneric.Po1497 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='GenPoly/InstantiateGeneric.cc' object='GenPoly/driver_cfa_cpp-InstantiateGeneric.obj' libtool=no @AMDEPBACKSLASH@1498 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@1499 @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -c -o GenPoly/driver_cfa_cpp-InstantiateGeneric.obj `if test -f 'GenPoly/InstantiateGeneric.cc'; then $(CYGPATH_W) 'GenPoly/InstantiateGeneric.cc'; else $(CYGPATH_W) '$(srcdir)/GenPoly/InstantiateGeneric.cc'; fi`1500 1501 InitTweak/driver_cfa_cpp-GenInit.o: InitTweak/GenInit.cc1502 @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -MT InitTweak/driver_cfa_cpp-GenInit.o -MD -MP -MF InitTweak/$(DEPDIR)/driver_cfa_cpp-GenInit.Tpo -c -o InitTweak/driver_cfa_cpp-GenInit.o `test -f 'InitTweak/GenInit.cc' || echo '$(srcdir)/'`InitTweak/GenInit.cc1503 @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) InitTweak/$(DEPDIR)/driver_cfa_cpp-GenInit.Tpo InitTweak/$(DEPDIR)/driver_cfa_cpp-GenInit.Po1504 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='InitTweak/GenInit.cc' object='InitTweak/driver_cfa_cpp-GenInit.o' libtool=no @AMDEPBACKSLASH@1505 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@1506 @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -c -o InitTweak/driver_cfa_cpp-GenInit.o `test -f 'InitTweak/GenInit.cc' || echo '$(srcdir)/'`InitTweak/GenInit.cc1507 1508 InitTweak/driver_cfa_cpp-GenInit.obj: InitTweak/GenInit.cc1509 @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -MT InitTweak/driver_cfa_cpp-GenInit.obj -MD -MP -MF InitTweak/$(DEPDIR)/driver_cfa_cpp-GenInit.Tpo -c -o InitTweak/driver_cfa_cpp-GenInit.obj `if test -f 'InitTweak/GenInit.cc'; then $(CYGPATH_W) 'InitTweak/GenInit.cc'; else $(CYGPATH_W) '$(srcdir)/InitTweak/GenInit.cc'; fi`1510 @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) InitTweak/$(DEPDIR)/driver_cfa_cpp-GenInit.Tpo InitTweak/$(DEPDIR)/driver_cfa_cpp-GenInit.Po1511 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='InitTweak/GenInit.cc' object='InitTweak/driver_cfa_cpp-GenInit.obj' libtool=no @AMDEPBACKSLASH@1512 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@1513 @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -c -o InitTweak/driver_cfa_cpp-GenInit.obj `if test -f 'InitTweak/GenInit.cc'; then $(CYGPATH_W) 'InitTweak/GenInit.cc'; else $(CYGPATH_W) '$(srcdir)/InitTweak/GenInit.cc'; fi`1514 1515 InitTweak/driver_cfa_cpp-FixInit.o: InitTweak/FixInit.cc1516 @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -MT InitTweak/driver_cfa_cpp-FixInit.o -MD -MP -MF InitTweak/$(DEPDIR)/driver_cfa_cpp-FixInit.Tpo -c -o InitTweak/driver_cfa_cpp-FixInit.o `test -f 'InitTweak/FixInit.cc' || echo '$(srcdir)/'`InitTweak/FixInit.cc1517 @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) InitTweak/$(DEPDIR)/driver_cfa_cpp-FixInit.Tpo InitTweak/$(DEPDIR)/driver_cfa_cpp-FixInit.Po1518 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='InitTweak/FixInit.cc' object='InitTweak/driver_cfa_cpp-FixInit.o' libtool=no @AMDEPBACKSLASH@1519 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@1520 @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -c -o InitTweak/driver_cfa_cpp-FixInit.o `test -f 'InitTweak/FixInit.cc' || echo '$(srcdir)/'`InitTweak/FixInit.cc1521 1522 InitTweak/driver_cfa_cpp-FixInit.obj: InitTweak/FixInit.cc1523 @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -MT InitTweak/driver_cfa_cpp-FixInit.obj -MD -MP -MF InitTweak/$(DEPDIR)/driver_cfa_cpp-FixInit.Tpo -c -o InitTweak/driver_cfa_cpp-FixInit.obj `if test -f 'InitTweak/FixInit.cc'; then $(CYGPATH_W) 'InitTweak/FixInit.cc'; else $(CYGPATH_W) '$(srcdir)/InitTweak/FixInit.cc'; fi`1524 @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) InitTweak/$(DEPDIR)/driver_cfa_cpp-FixInit.Tpo InitTweak/$(DEPDIR)/driver_cfa_cpp-FixInit.Po1525 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='InitTweak/FixInit.cc' object='InitTweak/driver_cfa_cpp-FixInit.obj' libtool=no @AMDEPBACKSLASH@1526 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@1527 @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -c -o InitTweak/driver_cfa_cpp-FixInit.obj `if test -f 'InitTweak/FixInit.cc'; then $(CYGPATH_W) 'InitTweak/FixInit.cc'; else $(CYGPATH_W) '$(srcdir)/InitTweak/FixInit.cc'; fi`1528 1529 InitTweak/driver_cfa_cpp-FixGlobalInit.o: InitTweak/FixGlobalInit.cc1530 @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -MT InitTweak/driver_cfa_cpp-FixGlobalInit.o -MD -MP -MF InitTweak/$(DEPDIR)/driver_cfa_cpp-FixGlobalInit.Tpo -c -o InitTweak/driver_cfa_cpp-FixGlobalInit.o `test -f 'InitTweak/FixGlobalInit.cc' || echo '$(srcdir)/'`InitTweak/FixGlobalInit.cc1531 @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) InitTweak/$(DEPDIR)/driver_cfa_cpp-FixGlobalInit.Tpo InitTweak/$(DEPDIR)/driver_cfa_cpp-FixGlobalInit.Po1532 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='InitTweak/FixGlobalInit.cc' object='InitTweak/driver_cfa_cpp-FixGlobalInit.o' libtool=no @AMDEPBACKSLASH@1533 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@1534 @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -c -o InitTweak/driver_cfa_cpp-FixGlobalInit.o `test -f 'InitTweak/FixGlobalInit.cc' || echo '$(srcdir)/'`InitTweak/FixGlobalInit.cc1535 1536 InitTweak/driver_cfa_cpp-FixGlobalInit.obj: InitTweak/FixGlobalInit.cc1537 @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -MT InitTweak/driver_cfa_cpp-FixGlobalInit.obj -MD -MP -MF InitTweak/$(DEPDIR)/driver_cfa_cpp-FixGlobalInit.Tpo -c -o InitTweak/driver_cfa_cpp-FixGlobalInit.obj `if test -f 'InitTweak/FixGlobalInit.cc'; then $(CYGPATH_W) 'InitTweak/FixGlobalInit.cc'; else $(CYGPATH_W) '$(srcdir)/InitTweak/FixGlobalInit.cc'; fi`1538 @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) InitTweak/$(DEPDIR)/driver_cfa_cpp-FixGlobalInit.Tpo InitTweak/$(DEPDIR)/driver_cfa_cpp-FixGlobalInit.Po1539 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='InitTweak/FixGlobalInit.cc' object='InitTweak/driver_cfa_cpp-FixGlobalInit.obj' libtool=no @AMDEPBACKSLASH@1540 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@1541 @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -c -o InitTweak/driver_cfa_cpp-FixGlobalInit.obj `if test -f 'InitTweak/FixGlobalInit.cc'; then $(CYGPATH_W) 'InitTweak/FixGlobalInit.cc'; else $(CYGPATH_W) '$(srcdir)/InitTweak/FixGlobalInit.cc'; fi`1542 1543 InitTweak/driver_cfa_cpp-InitTweak.o: InitTweak/InitTweak.cc1544 @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -MT InitTweak/driver_cfa_cpp-InitTweak.o -MD -MP -MF InitTweak/$(DEPDIR)/driver_cfa_cpp-InitTweak.Tpo -c -o InitTweak/driver_cfa_cpp-InitTweak.o `test -f 'InitTweak/InitTweak.cc' || echo '$(srcdir)/'`InitTweak/InitTweak.cc1545 @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) InitTweak/$(DEPDIR)/driver_cfa_cpp-InitTweak.Tpo InitTweak/$(DEPDIR)/driver_cfa_cpp-InitTweak.Po1546 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='InitTweak/InitTweak.cc' object='InitTweak/driver_cfa_cpp-InitTweak.o' libtool=no @AMDEPBACKSLASH@1547 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@1548 @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -c -o InitTweak/driver_cfa_cpp-InitTweak.o `test -f 'InitTweak/InitTweak.cc' || echo '$(srcdir)/'`InitTweak/InitTweak.cc1549 1550 InitTweak/driver_cfa_cpp-InitTweak.obj: InitTweak/InitTweak.cc1551 @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -MT InitTweak/driver_cfa_cpp-InitTweak.obj -MD -MP -MF InitTweak/$(DEPDIR)/driver_cfa_cpp-InitTweak.Tpo -c -o InitTweak/driver_cfa_cpp-InitTweak.obj `if test -f 'InitTweak/InitTweak.cc'; then $(CYGPATH_W) 'InitTweak/InitTweak.cc'; else $(CYGPATH_W) '$(srcdir)/InitTweak/InitTweak.cc'; fi`1552 @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) InitTweak/$(DEPDIR)/driver_cfa_cpp-InitTweak.Tpo InitTweak/$(DEPDIR)/driver_cfa_cpp-InitTweak.Po1553 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='InitTweak/InitTweak.cc' object='InitTweak/driver_cfa_cpp-InitTweak.obj' libtool=no @AMDEPBACKSLASH@1554 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@1555 @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -c -o InitTweak/driver_cfa_cpp-InitTweak.obj `if test -f 'InitTweak/InitTweak.cc'; then $(CYGPATH_W) 'InitTweak/InitTweak.cc'; else $(CYGPATH_W) '$(srcdir)/InitTweak/InitTweak.cc'; fi`1556 1557 Parser/driver_cfa_cpp-parser.o: Parser/parser.cc1558 @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -MT Parser/driver_cfa_cpp-parser.o -MD -MP -MF Parser/$(DEPDIR)/driver_cfa_cpp-parser.Tpo -c -o Parser/driver_cfa_cpp-parser.o `test -f 'Parser/parser.cc' || echo '$(srcdir)/'`Parser/parser.cc1559 @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) Parser/$(DEPDIR)/driver_cfa_cpp-parser.Tpo Parser/$(DEPDIR)/driver_cfa_cpp-parser.Po1560 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='Parser/parser.cc' object='Parser/driver_cfa_cpp-parser.o' libtool=no @AMDEPBACKSLASH@1561 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@1562 @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -c -o Parser/driver_cfa_cpp-parser.o `test -f 'Parser/parser.cc' || echo '$(srcdir)/'`Parser/parser.cc1563 1564 Parser/driver_cfa_cpp-parser.obj: Parser/parser.cc1565 @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -MT Parser/driver_cfa_cpp-parser.obj -MD -MP -MF Parser/$(DEPDIR)/driver_cfa_cpp-parser.Tpo -c -o Parser/driver_cfa_cpp-parser.obj `if test -f 'Parser/parser.cc'; then $(CYGPATH_W) 'Parser/parser.cc'; else $(CYGPATH_W) '$(srcdir)/Parser/parser.cc'; fi`1566 @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) Parser/$(DEPDIR)/driver_cfa_cpp-parser.Tpo Parser/$(DEPDIR)/driver_cfa_cpp-parser.Po1567 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='Parser/parser.cc' object='Parser/driver_cfa_cpp-parser.obj' libtool=no @AMDEPBACKSLASH@1568 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@1569 @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -c -o Parser/driver_cfa_cpp-parser.obj `if test -f 'Parser/parser.cc'; then $(CYGPATH_W) 'Parser/parser.cc'; else $(CYGPATH_W) '$(srcdir)/Parser/parser.cc'; fi`1570 1571 Parser/driver_cfa_cpp-lex.o: Parser/lex.cc1572 @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -MT Parser/driver_cfa_cpp-lex.o -MD -MP -MF Parser/$(DEPDIR)/driver_cfa_cpp-lex.Tpo -c -o Parser/driver_cfa_cpp-lex.o `test -f 'Parser/lex.cc' || echo '$(srcdir)/'`Parser/lex.cc1573 @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) Parser/$(DEPDIR)/driver_cfa_cpp-lex.Tpo Parser/$(DEPDIR)/driver_cfa_cpp-lex.Po1574 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='Parser/lex.cc' object='Parser/driver_cfa_cpp-lex.o' libtool=no @AMDEPBACKSLASH@1575 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@1576 @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -c -o Parser/driver_cfa_cpp-lex.o `test -f 'Parser/lex.cc' || echo '$(srcdir)/'`Parser/lex.cc1577 1578 Parser/driver_cfa_cpp-lex.obj: Parser/lex.cc1579 @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -MT Parser/driver_cfa_cpp-lex.obj -MD -MP -MF Parser/$(DEPDIR)/driver_cfa_cpp-lex.Tpo -c -o Parser/driver_cfa_cpp-lex.obj `if test -f 'Parser/lex.cc'; then $(CYGPATH_W) 'Parser/lex.cc'; else $(CYGPATH_W) '$(srcdir)/Parser/lex.cc'; fi`1580 @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) Parser/$(DEPDIR)/driver_cfa_cpp-lex.Tpo Parser/$(DEPDIR)/driver_cfa_cpp-lex.Po1581 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='Parser/lex.cc' object='Parser/driver_cfa_cpp-lex.obj' libtool=no @AMDEPBACKSLASH@1582 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@1583 @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -c -o Parser/driver_cfa_cpp-lex.obj `if test -f 'Parser/lex.cc'; then $(CYGPATH_W) 'Parser/lex.cc'; else $(CYGPATH_W) '$(srcdir)/Parser/lex.cc'; fi`1584 1585 Parser/driver_cfa_cpp-TypedefTable.o: Parser/TypedefTable.cc1586 @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -MT Parser/driver_cfa_cpp-TypedefTable.o -MD -MP -MF Parser/$(DEPDIR)/driver_cfa_cpp-TypedefTable.Tpo -c -o Parser/driver_cfa_cpp-TypedefTable.o `test -f 'Parser/TypedefTable.cc' || echo '$(srcdir)/'`Parser/TypedefTable.cc1587 @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) Parser/$(DEPDIR)/driver_cfa_cpp-TypedefTable.Tpo Parser/$(DEPDIR)/driver_cfa_cpp-TypedefTable.Po1588 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='Parser/TypedefTable.cc' object='Parser/driver_cfa_cpp-TypedefTable.o' libtool=no @AMDEPBACKSLASH@1589 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@1590 @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -c -o Parser/driver_cfa_cpp-TypedefTable.o `test -f 'Parser/TypedefTable.cc' || echo '$(srcdir)/'`Parser/TypedefTable.cc1591 1592 Parser/driver_cfa_cpp-TypedefTable.obj: Parser/TypedefTable.cc1593 @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -MT Parser/driver_cfa_cpp-TypedefTable.obj -MD -MP -MF Parser/$(DEPDIR)/driver_cfa_cpp-TypedefTable.Tpo -c -o Parser/driver_cfa_cpp-TypedefTable.obj `if test -f 'Parser/TypedefTable.cc'; then $(CYGPATH_W) 'Parser/TypedefTable.cc'; else $(CYGPATH_W) '$(srcdir)/Parser/TypedefTable.cc'; fi`1594 @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) Parser/$(DEPDIR)/driver_cfa_cpp-TypedefTable.Tpo Parser/$(DEPDIR)/driver_cfa_cpp-TypedefTable.Po1595 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='Parser/TypedefTable.cc' object='Parser/driver_cfa_cpp-TypedefTable.obj' libtool=no @AMDEPBACKSLASH@1596 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@1597 @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -c -o Parser/driver_cfa_cpp-TypedefTable.obj `if test -f 'Parser/TypedefTable.cc'; then $(CYGPATH_W) 'Parser/TypedefTable.cc'; else $(CYGPATH_W) '$(srcdir)/Parser/TypedefTable.cc'; fi`1598 1599 Parser/driver_cfa_cpp-ParseNode.o: Parser/ParseNode.cc1600 @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -MT Parser/driver_cfa_cpp-ParseNode.o -MD -MP -MF Parser/$(DEPDIR)/driver_cfa_cpp-ParseNode.Tpo -c -o Parser/driver_cfa_cpp-ParseNode.o `test -f 'Parser/ParseNode.cc' || echo '$(srcdir)/'`Parser/ParseNode.cc1601 @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) Parser/$(DEPDIR)/driver_cfa_cpp-ParseNode.Tpo Parser/$(DEPDIR)/driver_cfa_cpp-ParseNode.Po1602 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='Parser/ParseNode.cc' object='Parser/driver_cfa_cpp-ParseNode.o' libtool=no @AMDEPBACKSLASH@1603 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@1604 @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -c -o Parser/driver_cfa_cpp-ParseNode.o `test -f 'Parser/ParseNode.cc' || echo '$(srcdir)/'`Parser/ParseNode.cc1605 1606 Parser/driver_cfa_cpp-ParseNode.obj: Parser/ParseNode.cc1607 @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -MT Parser/driver_cfa_cpp-ParseNode.obj -MD -MP -MF Parser/$(DEPDIR)/driver_cfa_cpp-ParseNode.Tpo -c -o Parser/driver_cfa_cpp-ParseNode.obj `if test -f 'Parser/ParseNode.cc'; then $(CYGPATH_W) 'Parser/ParseNode.cc'; else $(CYGPATH_W) '$(srcdir)/Parser/ParseNode.cc'; fi`1608 @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) Parser/$(DEPDIR)/driver_cfa_cpp-ParseNode.Tpo Parser/$(DEPDIR)/driver_cfa_cpp-ParseNode.Po1609 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='Parser/ParseNode.cc' object='Parser/driver_cfa_cpp-ParseNode.obj' libtool=no @AMDEPBACKSLASH@1610 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@1611 @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -c -o Parser/driver_cfa_cpp-ParseNode.obj `if test -f 'Parser/ParseNode.cc'; then $(CYGPATH_W) 'Parser/ParseNode.cc'; else $(CYGPATH_W) '$(srcdir)/Parser/ParseNode.cc'; fi`1612 1613 Parser/driver_cfa_cpp-DeclarationNode.o: Parser/DeclarationNode.cc1614 @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -MT Parser/driver_cfa_cpp-DeclarationNode.o -MD -MP -MF Parser/$(DEPDIR)/driver_cfa_cpp-DeclarationNode.Tpo -c -o Parser/driver_cfa_cpp-DeclarationNode.o `test -f 'Parser/DeclarationNode.cc' || echo '$(srcdir)/'`Parser/DeclarationNode.cc1615 @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) Parser/$(DEPDIR)/driver_cfa_cpp-DeclarationNode.Tpo Parser/$(DEPDIR)/driver_cfa_cpp-DeclarationNode.Po1616 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='Parser/DeclarationNode.cc' object='Parser/driver_cfa_cpp-DeclarationNode.o' libtool=no @AMDEPBACKSLASH@1617 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@1618 @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -c -o Parser/driver_cfa_cpp-DeclarationNode.o `test -f 'Parser/DeclarationNode.cc' || echo '$(srcdir)/'`Parser/DeclarationNode.cc1619 1620 Parser/driver_cfa_cpp-DeclarationNode.obj: Parser/DeclarationNode.cc1621 @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -MT Parser/driver_cfa_cpp-DeclarationNode.obj -MD -MP -MF Parser/$(DEPDIR)/driver_cfa_cpp-DeclarationNode.Tpo -c -o Parser/driver_cfa_cpp-DeclarationNode.obj `if test -f 'Parser/DeclarationNode.cc'; then $(CYGPATH_W) 'Parser/DeclarationNode.cc'; else $(CYGPATH_W) '$(srcdir)/Parser/DeclarationNode.cc'; fi`1622 @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) Parser/$(DEPDIR)/driver_cfa_cpp-DeclarationNode.Tpo Parser/$(DEPDIR)/driver_cfa_cpp-DeclarationNode.Po1623 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='Parser/DeclarationNode.cc' object='Parser/driver_cfa_cpp-DeclarationNode.obj' libtool=no @AMDEPBACKSLASH@1624 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@1625 @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -c -o Parser/driver_cfa_cpp-DeclarationNode.obj `if test -f 'Parser/DeclarationNode.cc'; then $(CYGPATH_W) 'Parser/DeclarationNode.cc'; else $(CYGPATH_W) '$(srcdir)/Parser/DeclarationNode.cc'; fi`1626 1627 Parser/driver_cfa_cpp-ExpressionNode.o: Parser/ExpressionNode.cc1628 @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -MT Parser/driver_cfa_cpp-ExpressionNode.o -MD -MP -MF Parser/$(DEPDIR)/driver_cfa_cpp-ExpressionNode.Tpo -c -o Parser/driver_cfa_cpp-ExpressionNode.o `test -f 'Parser/ExpressionNode.cc' || echo '$(srcdir)/'`Parser/ExpressionNode.cc1629 @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) Parser/$(DEPDIR)/driver_cfa_cpp-ExpressionNode.Tpo Parser/$(DEPDIR)/driver_cfa_cpp-ExpressionNode.Po1630 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='Parser/ExpressionNode.cc' object='Parser/driver_cfa_cpp-ExpressionNode.o' libtool=no @AMDEPBACKSLASH@1631 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@1632 @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -c -o Parser/driver_cfa_cpp-ExpressionNode.o `test -f 'Parser/ExpressionNode.cc' || echo '$(srcdir)/'`Parser/ExpressionNode.cc1633 1634 Parser/driver_cfa_cpp-ExpressionNode.obj: Parser/ExpressionNode.cc1635 @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -MT Parser/driver_cfa_cpp-ExpressionNode.obj -MD -MP -MF Parser/$(DEPDIR)/driver_cfa_cpp-ExpressionNode.Tpo -c -o Parser/driver_cfa_cpp-ExpressionNode.obj `if test -f 'Parser/ExpressionNode.cc'; then $(CYGPATH_W) 'Parser/ExpressionNode.cc'; else $(CYGPATH_W) '$(srcdir)/Parser/ExpressionNode.cc'; fi`1636 @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) Parser/$(DEPDIR)/driver_cfa_cpp-ExpressionNode.Tpo Parser/$(DEPDIR)/driver_cfa_cpp-ExpressionNode.Po1637 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='Parser/ExpressionNode.cc' object='Parser/driver_cfa_cpp-ExpressionNode.obj' libtool=no @AMDEPBACKSLASH@1638 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@1639 @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -c -o Parser/driver_cfa_cpp-ExpressionNode.obj `if test -f 'Parser/ExpressionNode.cc'; then $(CYGPATH_W) 'Parser/ExpressionNode.cc'; else $(CYGPATH_W) '$(srcdir)/Parser/ExpressionNode.cc'; fi`1640 1641 Parser/driver_cfa_cpp-StatementNode.o: Parser/StatementNode.cc1642 @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -MT Parser/driver_cfa_cpp-StatementNode.o -MD -MP -MF Parser/$(DEPDIR)/driver_cfa_cpp-StatementNode.Tpo -c -o Parser/driver_cfa_cpp-StatementNode.o `test -f 'Parser/StatementNode.cc' || echo '$(srcdir)/'`Parser/StatementNode.cc1643 @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) Parser/$(DEPDIR)/driver_cfa_cpp-StatementNode.Tpo Parser/$(DEPDIR)/driver_cfa_cpp-StatementNode.Po1644 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='Parser/StatementNode.cc' object='Parser/driver_cfa_cpp-StatementNode.o' libtool=no @AMDEPBACKSLASH@1645 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@1646 @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -c -o Parser/driver_cfa_cpp-StatementNode.o `test -f 'Parser/StatementNode.cc' || echo '$(srcdir)/'`Parser/StatementNode.cc1647 1648 Parser/driver_cfa_cpp-StatementNode.obj: Parser/StatementNode.cc1649 @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -MT Parser/driver_cfa_cpp-StatementNode.obj -MD -MP -MF Parser/$(DEPDIR)/driver_cfa_cpp-StatementNode.Tpo -c -o Parser/driver_cfa_cpp-StatementNode.obj `if test -f 'Parser/StatementNode.cc'; then $(CYGPATH_W) 'Parser/StatementNode.cc'; else $(CYGPATH_W) '$(srcdir)/Parser/StatementNode.cc'; fi`1650 @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) Parser/$(DEPDIR)/driver_cfa_cpp-StatementNode.Tpo Parser/$(DEPDIR)/driver_cfa_cpp-StatementNode.Po1651 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='Parser/StatementNode.cc' object='Parser/driver_cfa_cpp-StatementNode.obj' libtool=no @AMDEPBACKSLASH@1652 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@1653 @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -c -o Parser/driver_cfa_cpp-StatementNode.obj `if test -f 'Parser/StatementNode.cc'; then $(CYGPATH_W) 'Parser/StatementNode.cc'; else $(CYGPATH_W) '$(srcdir)/Parser/StatementNode.cc'; fi`1654 1655 Parser/driver_cfa_cpp-InitializerNode.o: Parser/InitializerNode.cc1656 @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -MT Parser/driver_cfa_cpp-InitializerNode.o -MD -MP -MF Parser/$(DEPDIR)/driver_cfa_cpp-InitializerNode.Tpo -c -o Parser/driver_cfa_cpp-InitializerNode.o `test -f 'Parser/InitializerNode.cc' || echo '$(srcdir)/'`Parser/InitializerNode.cc1657 @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) Parser/$(DEPDIR)/driver_cfa_cpp-InitializerNode.Tpo Parser/$(DEPDIR)/driver_cfa_cpp-InitializerNode.Po1658 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='Parser/InitializerNode.cc' object='Parser/driver_cfa_cpp-InitializerNode.o' libtool=no @AMDEPBACKSLASH@1659 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@1660 @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -c -o Parser/driver_cfa_cpp-InitializerNode.o `test -f 'Parser/InitializerNode.cc' || echo '$(srcdir)/'`Parser/InitializerNode.cc1661 1662 Parser/driver_cfa_cpp-InitializerNode.obj: Parser/InitializerNode.cc1663 @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -MT Parser/driver_cfa_cpp-InitializerNode.obj -MD -MP -MF Parser/$(DEPDIR)/driver_cfa_cpp-InitializerNode.Tpo -c -o Parser/driver_cfa_cpp-InitializerNode.obj `if test -f 'Parser/InitializerNode.cc'; then $(CYGPATH_W) 'Parser/InitializerNode.cc'; else $(CYGPATH_W) '$(srcdir)/Parser/InitializerNode.cc'; fi`1664 @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) Parser/$(DEPDIR)/driver_cfa_cpp-InitializerNode.Tpo Parser/$(DEPDIR)/driver_cfa_cpp-InitializerNode.Po1665 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='Parser/InitializerNode.cc' object='Parser/driver_cfa_cpp-InitializerNode.obj' libtool=no @AMDEPBACKSLASH@1666 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@1667 @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -c -o Parser/driver_cfa_cpp-InitializerNode.obj `if test -f 'Parser/InitializerNode.cc'; then $(CYGPATH_W) 'Parser/InitializerNode.cc'; else $(CYGPATH_W) '$(srcdir)/Parser/InitializerNode.cc'; fi`1668 1669 Parser/driver_cfa_cpp-TypeData.o: Parser/TypeData.cc1670 @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -MT Parser/driver_cfa_cpp-TypeData.o -MD -MP -MF Parser/$(DEPDIR)/driver_cfa_cpp-TypeData.Tpo -c -o Parser/driver_cfa_cpp-TypeData.o `test -f 'Parser/TypeData.cc' || echo '$(srcdir)/'`Parser/TypeData.cc1671 @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) Parser/$(DEPDIR)/driver_cfa_cpp-TypeData.Tpo Parser/$(DEPDIR)/driver_cfa_cpp-TypeData.Po1672 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='Parser/TypeData.cc' object='Parser/driver_cfa_cpp-TypeData.o' libtool=no @AMDEPBACKSLASH@1673 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@1674 @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -c -o Parser/driver_cfa_cpp-TypeData.o `test -f 'Parser/TypeData.cc' || echo '$(srcdir)/'`Parser/TypeData.cc1675 1676 Parser/driver_cfa_cpp-TypeData.obj: Parser/TypeData.cc1677 @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -MT Parser/driver_cfa_cpp-TypeData.obj -MD -MP -MF Parser/$(DEPDIR)/driver_cfa_cpp-TypeData.Tpo -c -o Parser/driver_cfa_cpp-TypeData.obj `if test -f 'Parser/TypeData.cc'; then $(CYGPATH_W) 'Parser/TypeData.cc'; else $(CYGPATH_W) '$(srcdir)/Parser/TypeData.cc'; fi`1678 @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) Parser/$(DEPDIR)/driver_cfa_cpp-TypeData.Tpo Parser/$(DEPDIR)/driver_cfa_cpp-TypeData.Po1679 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='Parser/TypeData.cc' object='Parser/driver_cfa_cpp-TypeData.obj' libtool=no @AMDEPBACKSLASH@1680 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@1681 @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -c -o Parser/driver_cfa_cpp-TypeData.obj `if test -f 'Parser/TypeData.cc'; then $(CYGPATH_W) 'Parser/TypeData.cc'; else $(CYGPATH_W) '$(srcdir)/Parser/TypeData.cc'; fi`1682 1683 Parser/driver_cfa_cpp-LinkageSpec.o: Parser/LinkageSpec.cc1684 @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -MT Parser/driver_cfa_cpp-LinkageSpec.o -MD -MP -MF Parser/$(DEPDIR)/driver_cfa_cpp-LinkageSpec.Tpo -c -o Parser/driver_cfa_cpp-LinkageSpec.o `test -f 'Parser/LinkageSpec.cc' || echo '$(srcdir)/'`Parser/LinkageSpec.cc1685 @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) Parser/$(DEPDIR)/driver_cfa_cpp-LinkageSpec.Tpo Parser/$(DEPDIR)/driver_cfa_cpp-LinkageSpec.Po1686 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='Parser/LinkageSpec.cc' object='Parser/driver_cfa_cpp-LinkageSpec.o' libtool=no @AMDEPBACKSLASH@1687 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@1688 @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -c -o Parser/driver_cfa_cpp-LinkageSpec.o `test -f 'Parser/LinkageSpec.cc' || echo '$(srcdir)/'`Parser/LinkageSpec.cc1689 1690 Parser/driver_cfa_cpp-LinkageSpec.obj: Parser/LinkageSpec.cc1691 @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -MT Parser/driver_cfa_cpp-LinkageSpec.obj -MD -MP -MF Parser/$(DEPDIR)/driver_cfa_cpp-LinkageSpec.Tpo -c -o Parser/driver_cfa_cpp-LinkageSpec.obj `if test -f 'Parser/LinkageSpec.cc'; then $(CYGPATH_W) 'Parser/LinkageSpec.cc'; else $(CYGPATH_W) '$(srcdir)/Parser/LinkageSpec.cc'; fi`1692 @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) Parser/$(DEPDIR)/driver_cfa_cpp-LinkageSpec.Tpo Parser/$(DEPDIR)/driver_cfa_cpp-LinkageSpec.Po1693 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='Parser/LinkageSpec.cc' object='Parser/driver_cfa_cpp-LinkageSpec.obj' libtool=no @AMDEPBACKSLASH@1694 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@1695 @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -c -o Parser/driver_cfa_cpp-LinkageSpec.obj `if test -f 'Parser/LinkageSpec.cc'; then $(CYGPATH_W) 'Parser/LinkageSpec.cc'; else $(CYGPATH_W) '$(srcdir)/Parser/LinkageSpec.cc'; fi`1696 1697 Parser/driver_cfa_cpp-parserutility.o: Parser/parserutility.cc1698 @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -MT Parser/driver_cfa_cpp-parserutility.o -MD -MP -MF Parser/$(DEPDIR)/driver_cfa_cpp-parserutility.Tpo -c -o Parser/driver_cfa_cpp-parserutility.o `test -f 'Parser/parserutility.cc' || echo '$(srcdir)/'`Parser/parserutility.cc1699 @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) Parser/$(DEPDIR)/driver_cfa_cpp-parserutility.Tpo Parser/$(DEPDIR)/driver_cfa_cpp-parserutility.Po1700 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='Parser/parserutility.cc' object='Parser/driver_cfa_cpp-parserutility.o' libtool=no @AMDEPBACKSLASH@1701 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@1702 @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -c -o Parser/driver_cfa_cpp-parserutility.o `test -f 'Parser/parserutility.cc' || echo '$(srcdir)/'`Parser/parserutility.cc1703 1704 Parser/driver_cfa_cpp-parserutility.obj: Parser/parserutility.cc1705 @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -MT Parser/driver_cfa_cpp-parserutility.obj -MD -MP -MF Parser/$(DEPDIR)/driver_cfa_cpp-parserutility.Tpo -c -o Parser/driver_cfa_cpp-parserutility.obj `if test -f 'Parser/parserutility.cc'; then $(CYGPATH_W) 'Parser/parserutility.cc'; else $(CYGPATH_W) '$(srcdir)/Parser/parserutility.cc'; fi`1706 @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) Parser/$(DEPDIR)/driver_cfa_cpp-parserutility.Tpo Parser/$(DEPDIR)/driver_cfa_cpp-parserutility.Po1707 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='Parser/parserutility.cc' object='Parser/driver_cfa_cpp-parserutility.obj' libtool=no @AMDEPBACKSLASH@1708 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@1709 @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -c -o Parser/driver_cfa_cpp-parserutility.obj `if test -f 'Parser/parserutility.cc'; then $(CYGPATH_W) 'Parser/parserutility.cc'; else $(CYGPATH_W) '$(srcdir)/Parser/parserutility.cc'; fi`1710 1711 ResolvExpr/driver_cfa_cpp-AlternativeFinder.o: ResolvExpr/AlternativeFinder.cc1712 @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -MT ResolvExpr/driver_cfa_cpp-AlternativeFinder.o -MD -MP -MF ResolvExpr/$(DEPDIR)/driver_cfa_cpp-AlternativeFinder.Tpo -c -o ResolvExpr/driver_cfa_cpp-AlternativeFinder.o `test -f 'ResolvExpr/AlternativeFinder.cc' || echo '$(srcdir)/'`ResolvExpr/AlternativeFinder.cc1713 @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) ResolvExpr/$(DEPDIR)/driver_cfa_cpp-AlternativeFinder.Tpo ResolvExpr/$(DEPDIR)/driver_cfa_cpp-AlternativeFinder.Po1714 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='ResolvExpr/AlternativeFinder.cc' object='ResolvExpr/driver_cfa_cpp-AlternativeFinder.o' libtool=no @AMDEPBACKSLASH@1715 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@1716 @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -c -o ResolvExpr/driver_cfa_cpp-AlternativeFinder.o `test -f 'ResolvExpr/AlternativeFinder.cc' || echo '$(srcdir)/'`ResolvExpr/AlternativeFinder.cc1717 1718 ResolvExpr/driver_cfa_cpp-AlternativeFinder.obj: ResolvExpr/AlternativeFinder.cc1719 @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -MT ResolvExpr/driver_cfa_cpp-AlternativeFinder.obj -MD -MP -MF ResolvExpr/$(DEPDIR)/driver_cfa_cpp-AlternativeFinder.Tpo -c -o ResolvExpr/driver_cfa_cpp-AlternativeFinder.obj `if test -f 'ResolvExpr/AlternativeFinder.cc'; then $(CYGPATH_W) 'ResolvExpr/AlternativeFinder.cc'; else $(CYGPATH_W) '$(srcdir)/ResolvExpr/AlternativeFinder.cc'; fi`1720 @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) ResolvExpr/$(DEPDIR)/driver_cfa_cpp-AlternativeFinder.Tpo ResolvExpr/$(DEPDIR)/driver_cfa_cpp-AlternativeFinder.Po1721 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='ResolvExpr/AlternativeFinder.cc' object='ResolvExpr/driver_cfa_cpp-AlternativeFinder.obj' libtool=no @AMDEPBACKSLASH@1722 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@1723 @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -c -o ResolvExpr/driver_cfa_cpp-AlternativeFinder.obj `if test -f 'ResolvExpr/AlternativeFinder.cc'; then $(CYGPATH_W) 'ResolvExpr/AlternativeFinder.cc'; else $(CYGPATH_W) '$(srcdir)/ResolvExpr/AlternativeFinder.cc'; fi`1724 1725 ResolvExpr/driver_cfa_cpp-Alternative.o: ResolvExpr/Alternative.cc1726 @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -MT ResolvExpr/driver_cfa_cpp-Alternative.o -MD -MP -MF ResolvExpr/$(DEPDIR)/driver_cfa_cpp-Alternative.Tpo -c -o ResolvExpr/driver_cfa_cpp-Alternative.o `test -f 'ResolvExpr/Alternative.cc' || echo '$(srcdir)/'`ResolvExpr/Alternative.cc1727 @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) ResolvExpr/$(DEPDIR)/driver_cfa_cpp-Alternative.Tpo ResolvExpr/$(DEPDIR)/driver_cfa_cpp-Alternative.Po1728 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='ResolvExpr/Alternative.cc' object='ResolvExpr/driver_cfa_cpp-Alternative.o' libtool=no @AMDEPBACKSLASH@1729 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@1730 @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -c -o ResolvExpr/driver_cfa_cpp-Alternative.o `test -f 'ResolvExpr/Alternative.cc' || echo '$(srcdir)/'`ResolvExpr/Alternative.cc1731 1732 ResolvExpr/driver_cfa_cpp-Alternative.obj: ResolvExpr/Alternative.cc1733 @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -MT ResolvExpr/driver_cfa_cpp-Alternative.obj -MD -MP -MF ResolvExpr/$(DEPDIR)/driver_cfa_cpp-Alternative.Tpo -c -o ResolvExpr/driver_cfa_cpp-Alternative.obj `if test -f 'ResolvExpr/Alternative.cc'; then $(CYGPATH_W) 'ResolvExpr/Alternative.cc'; else $(CYGPATH_W) '$(srcdir)/ResolvExpr/Alternative.cc'; fi`1734 @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) ResolvExpr/$(DEPDIR)/driver_cfa_cpp-Alternative.Tpo ResolvExpr/$(DEPDIR)/driver_cfa_cpp-Alternative.Po1735 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='ResolvExpr/Alternative.cc' object='ResolvExpr/driver_cfa_cpp-Alternative.obj' libtool=no @AMDEPBACKSLASH@1736 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@1737 @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -c -o ResolvExpr/driver_cfa_cpp-Alternative.obj `if test -f 'ResolvExpr/Alternative.cc'; then $(CYGPATH_W) 'ResolvExpr/Alternative.cc'; else $(CYGPATH_W) '$(srcdir)/ResolvExpr/Alternative.cc'; fi`1738 1739 ResolvExpr/driver_cfa_cpp-Unify.o: ResolvExpr/Unify.cc1740 @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -MT ResolvExpr/driver_cfa_cpp-Unify.o -MD -MP -MF ResolvExpr/$(DEPDIR)/driver_cfa_cpp-Unify.Tpo -c -o ResolvExpr/driver_cfa_cpp-Unify.o `test -f 'ResolvExpr/Unify.cc' || echo '$(srcdir)/'`ResolvExpr/Unify.cc1741 @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) ResolvExpr/$(DEPDIR)/driver_cfa_cpp-Unify.Tpo ResolvExpr/$(DEPDIR)/driver_cfa_cpp-Unify.Po1742 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='ResolvExpr/Unify.cc' object='ResolvExpr/driver_cfa_cpp-Unify.o' libtool=no @AMDEPBACKSLASH@1743 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@1744 @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -c -o ResolvExpr/driver_cfa_cpp-Unify.o `test -f 'ResolvExpr/Unify.cc' || echo '$(srcdir)/'`ResolvExpr/Unify.cc1745 1746 ResolvExpr/driver_cfa_cpp-Unify.obj: ResolvExpr/Unify.cc1747 @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -MT ResolvExpr/driver_cfa_cpp-Unify.obj -MD -MP -MF ResolvExpr/$(DEPDIR)/driver_cfa_cpp-Unify.Tpo -c -o ResolvExpr/driver_cfa_cpp-Unify.obj `if test -f 'ResolvExpr/Unify.cc'; then $(CYGPATH_W) 'ResolvExpr/Unify.cc'; else $(CYGPATH_W) '$(srcdir)/ResolvExpr/Unify.cc'; fi`1748 @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) ResolvExpr/$(DEPDIR)/driver_cfa_cpp-Unify.Tpo ResolvExpr/$(DEPDIR)/driver_cfa_cpp-Unify.Po1749 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='ResolvExpr/Unify.cc' object='ResolvExpr/driver_cfa_cpp-Unify.obj' libtool=no @AMDEPBACKSLASH@1750 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@1751 @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -c -o ResolvExpr/driver_cfa_cpp-Unify.obj `if test -f 'ResolvExpr/Unify.cc'; then $(CYGPATH_W) 'ResolvExpr/Unify.cc'; else $(CYGPATH_W) '$(srcdir)/ResolvExpr/Unify.cc'; fi`1752 1753 ResolvExpr/driver_cfa_cpp-PtrsAssignable.o: ResolvExpr/PtrsAssignable.cc1754 @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -MT ResolvExpr/driver_cfa_cpp-PtrsAssignable.o -MD -MP -MF ResolvExpr/$(DEPDIR)/driver_cfa_cpp-PtrsAssignable.Tpo -c -o ResolvExpr/driver_cfa_cpp-PtrsAssignable.o `test -f 'ResolvExpr/PtrsAssignable.cc' || echo '$(srcdir)/'`ResolvExpr/PtrsAssignable.cc1755 @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) ResolvExpr/$(DEPDIR)/driver_cfa_cpp-PtrsAssignable.Tpo ResolvExpr/$(DEPDIR)/driver_cfa_cpp-PtrsAssignable.Po1756 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='ResolvExpr/PtrsAssignable.cc' object='ResolvExpr/driver_cfa_cpp-PtrsAssignable.o' libtool=no @AMDEPBACKSLASH@1757 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@1758 @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -c -o ResolvExpr/driver_cfa_cpp-PtrsAssignable.o `test -f 'ResolvExpr/PtrsAssignable.cc' || echo '$(srcdir)/'`ResolvExpr/PtrsAssignable.cc1759 1760 ResolvExpr/driver_cfa_cpp-PtrsAssignable.obj: ResolvExpr/PtrsAssignable.cc1761 @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -MT ResolvExpr/driver_cfa_cpp-PtrsAssignable.obj -MD -MP -MF ResolvExpr/$(DEPDIR)/driver_cfa_cpp-PtrsAssignable.Tpo -c -o ResolvExpr/driver_cfa_cpp-PtrsAssignable.obj `if test -f 'ResolvExpr/PtrsAssignable.cc'; then $(CYGPATH_W) 'ResolvExpr/PtrsAssignable.cc'; else $(CYGPATH_W) '$(srcdir)/ResolvExpr/PtrsAssignable.cc'; fi`1762 @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) ResolvExpr/$(DEPDIR)/driver_cfa_cpp-PtrsAssignable.Tpo ResolvExpr/$(DEPDIR)/driver_cfa_cpp-PtrsAssignable.Po1763 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='ResolvExpr/PtrsAssignable.cc' object='ResolvExpr/driver_cfa_cpp-PtrsAssignable.obj' libtool=no @AMDEPBACKSLASH@1764 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@1765 @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -c -o ResolvExpr/driver_cfa_cpp-PtrsAssignable.obj `if test -f 'ResolvExpr/PtrsAssignable.cc'; then $(CYGPATH_W) 'ResolvExpr/PtrsAssignable.cc'; else $(CYGPATH_W) '$(srcdir)/ResolvExpr/PtrsAssignable.cc'; fi`1766 1767 ResolvExpr/driver_cfa_cpp-CommonType.o: ResolvExpr/CommonType.cc1768 @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -MT ResolvExpr/driver_cfa_cpp-CommonType.o -MD -MP -MF ResolvExpr/$(DEPDIR)/driver_cfa_cpp-CommonType.Tpo -c -o ResolvExpr/driver_cfa_cpp-CommonType.o `test -f 'ResolvExpr/CommonType.cc' || echo '$(srcdir)/'`ResolvExpr/CommonType.cc1769 @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) ResolvExpr/$(DEPDIR)/driver_cfa_cpp-CommonType.Tpo ResolvExpr/$(DEPDIR)/driver_cfa_cpp-CommonType.Po1770 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='ResolvExpr/CommonType.cc' object='ResolvExpr/driver_cfa_cpp-CommonType.o' libtool=no @AMDEPBACKSLASH@1771 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@1772 @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -c -o ResolvExpr/driver_cfa_cpp-CommonType.o `test -f 'ResolvExpr/CommonType.cc' || echo '$(srcdir)/'`ResolvExpr/CommonType.cc1773 1774 ResolvExpr/driver_cfa_cpp-CommonType.obj: ResolvExpr/CommonType.cc1775 @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -MT ResolvExpr/driver_cfa_cpp-CommonType.obj -MD -MP -MF ResolvExpr/$(DEPDIR)/driver_cfa_cpp-CommonType.Tpo -c -o ResolvExpr/driver_cfa_cpp-CommonType.obj `if test -f 'ResolvExpr/CommonType.cc'; then $(CYGPATH_W) 'ResolvExpr/CommonType.cc'; else $(CYGPATH_W) '$(srcdir)/ResolvExpr/CommonType.cc'; fi`1776 @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) ResolvExpr/$(DEPDIR)/driver_cfa_cpp-CommonType.Tpo ResolvExpr/$(DEPDIR)/driver_cfa_cpp-CommonType.Po1777 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='ResolvExpr/CommonType.cc' object='ResolvExpr/driver_cfa_cpp-CommonType.obj' libtool=no @AMDEPBACKSLASH@1778 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@1779 @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -c -o ResolvExpr/driver_cfa_cpp-CommonType.obj `if test -f 'ResolvExpr/CommonType.cc'; then $(CYGPATH_W) 'ResolvExpr/CommonType.cc'; else $(CYGPATH_W) '$(srcdir)/ResolvExpr/CommonType.cc'; fi`1780 1781 ResolvExpr/driver_cfa_cpp-ConversionCost.o: ResolvExpr/ConversionCost.cc1782 @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -MT ResolvExpr/driver_cfa_cpp-ConversionCost.o -MD -MP -MF ResolvExpr/$(DEPDIR)/driver_cfa_cpp-ConversionCost.Tpo -c -o ResolvExpr/driver_cfa_cpp-ConversionCost.o `test -f 'ResolvExpr/ConversionCost.cc' || echo '$(srcdir)/'`ResolvExpr/ConversionCost.cc1783 @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) ResolvExpr/$(DEPDIR)/driver_cfa_cpp-ConversionCost.Tpo ResolvExpr/$(DEPDIR)/driver_cfa_cpp-ConversionCost.Po1784 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='ResolvExpr/ConversionCost.cc' object='ResolvExpr/driver_cfa_cpp-ConversionCost.o' libtool=no @AMDEPBACKSLASH@1785 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@1786 @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -c -o ResolvExpr/driver_cfa_cpp-ConversionCost.o `test -f 'ResolvExpr/ConversionCost.cc' || echo '$(srcdir)/'`ResolvExpr/ConversionCost.cc1787 1788 ResolvExpr/driver_cfa_cpp-ConversionCost.obj: ResolvExpr/ConversionCost.cc1789 @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -MT ResolvExpr/driver_cfa_cpp-ConversionCost.obj -MD -MP -MF ResolvExpr/$(DEPDIR)/driver_cfa_cpp-ConversionCost.Tpo -c -o ResolvExpr/driver_cfa_cpp-ConversionCost.obj `if test -f 'ResolvExpr/ConversionCost.cc'; then $(CYGPATH_W) 'ResolvExpr/ConversionCost.cc'; else $(CYGPATH_W) '$(srcdir)/ResolvExpr/ConversionCost.cc'; fi`1790 @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) ResolvExpr/$(DEPDIR)/driver_cfa_cpp-ConversionCost.Tpo ResolvExpr/$(DEPDIR)/driver_cfa_cpp-ConversionCost.Po1791 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='ResolvExpr/ConversionCost.cc' object='ResolvExpr/driver_cfa_cpp-ConversionCost.obj' libtool=no @AMDEPBACKSLASH@1792 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@1793 @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -c -o ResolvExpr/driver_cfa_cpp-ConversionCost.obj `if test -f 'ResolvExpr/ConversionCost.cc'; then $(CYGPATH_W) 'ResolvExpr/ConversionCost.cc'; else $(CYGPATH_W) '$(srcdir)/ResolvExpr/ConversionCost.cc'; fi`1794 1795 ResolvExpr/driver_cfa_cpp-CastCost.o: ResolvExpr/CastCost.cc1796 @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -MT ResolvExpr/driver_cfa_cpp-CastCost.o -MD -MP -MF ResolvExpr/$(DEPDIR)/driver_cfa_cpp-CastCost.Tpo -c -o ResolvExpr/driver_cfa_cpp-CastCost.o `test -f 'ResolvExpr/CastCost.cc' || echo '$(srcdir)/'`ResolvExpr/CastCost.cc1797 @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) ResolvExpr/$(DEPDIR)/driver_cfa_cpp-CastCost.Tpo ResolvExpr/$(DEPDIR)/driver_cfa_cpp-CastCost.Po1798 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='ResolvExpr/CastCost.cc' object='ResolvExpr/driver_cfa_cpp-CastCost.o' libtool=no @AMDEPBACKSLASH@1799 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@1800 @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -c -o ResolvExpr/driver_cfa_cpp-CastCost.o `test -f 'ResolvExpr/CastCost.cc' || echo '$(srcdir)/'`ResolvExpr/CastCost.cc1801 1802 ResolvExpr/driver_cfa_cpp-CastCost.obj: ResolvExpr/CastCost.cc1803 @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -MT ResolvExpr/driver_cfa_cpp-CastCost.obj -MD -MP -MF ResolvExpr/$(DEPDIR)/driver_cfa_cpp-CastCost.Tpo -c -o ResolvExpr/driver_cfa_cpp-CastCost.obj `if test -f 'ResolvExpr/CastCost.cc'; then $(CYGPATH_W) 'ResolvExpr/CastCost.cc'; else $(CYGPATH_W) '$(srcdir)/ResolvExpr/CastCost.cc'; fi`1804 @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) ResolvExpr/$(DEPDIR)/driver_cfa_cpp-CastCost.Tpo ResolvExpr/$(DEPDIR)/driver_cfa_cpp-CastCost.Po1805 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='ResolvExpr/CastCost.cc' object='ResolvExpr/driver_cfa_cpp-CastCost.obj' libtool=no @AMDEPBACKSLASH@1806 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@1807 @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -c -o ResolvExpr/driver_cfa_cpp-CastCost.obj `if test -f 'ResolvExpr/CastCost.cc'; then $(CYGPATH_W) 'ResolvExpr/CastCost.cc'; else $(CYGPATH_W) '$(srcdir)/ResolvExpr/CastCost.cc'; fi`1808 1809 ResolvExpr/driver_cfa_cpp-PtrsCastable.o: ResolvExpr/PtrsCastable.cc1810 @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -MT ResolvExpr/driver_cfa_cpp-PtrsCastable.o -MD -MP -MF ResolvExpr/$(DEPDIR)/driver_cfa_cpp-PtrsCastable.Tpo -c -o ResolvExpr/driver_cfa_cpp-PtrsCastable.o `test -f 'ResolvExpr/PtrsCastable.cc' || echo '$(srcdir)/'`ResolvExpr/PtrsCastable.cc1811 @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) ResolvExpr/$(DEPDIR)/driver_cfa_cpp-PtrsCastable.Tpo ResolvExpr/$(DEPDIR)/driver_cfa_cpp-PtrsCastable.Po1812 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='ResolvExpr/PtrsCastable.cc' object='ResolvExpr/driver_cfa_cpp-PtrsCastable.o' libtool=no @AMDEPBACKSLASH@1813 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@1814 @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -c -o ResolvExpr/driver_cfa_cpp-PtrsCastable.o `test -f 'ResolvExpr/PtrsCastable.cc' || echo '$(srcdir)/'`ResolvExpr/PtrsCastable.cc1815 1816 ResolvExpr/driver_cfa_cpp-PtrsCastable.obj: ResolvExpr/PtrsCastable.cc1817 @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -MT ResolvExpr/driver_cfa_cpp-PtrsCastable.obj -MD -MP -MF ResolvExpr/$(DEPDIR)/driver_cfa_cpp-PtrsCastable.Tpo -c -o ResolvExpr/driver_cfa_cpp-PtrsCastable.obj `if test -f 'ResolvExpr/PtrsCastable.cc'; then $(CYGPATH_W) 'ResolvExpr/PtrsCastable.cc'; else $(CYGPATH_W) '$(srcdir)/ResolvExpr/PtrsCastable.cc'; fi`1818 @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) ResolvExpr/$(DEPDIR)/driver_cfa_cpp-PtrsCastable.Tpo ResolvExpr/$(DEPDIR)/driver_cfa_cpp-PtrsCastable.Po1819 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='ResolvExpr/PtrsCastable.cc' object='ResolvExpr/driver_cfa_cpp-PtrsCastable.obj' libtool=no @AMDEPBACKSLASH@1820 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@1821 @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -c -o ResolvExpr/driver_cfa_cpp-PtrsCastable.obj `if test -f 'ResolvExpr/PtrsCastable.cc'; then $(CYGPATH_W) 'ResolvExpr/PtrsCastable.cc'; else $(CYGPATH_W) '$(srcdir)/ResolvExpr/PtrsCastable.cc'; fi`1822 1823 ResolvExpr/driver_cfa_cpp-AdjustExprType.o: ResolvExpr/AdjustExprType.cc1824 @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -MT ResolvExpr/driver_cfa_cpp-AdjustExprType.o -MD -MP -MF ResolvExpr/$(DEPDIR)/driver_cfa_cpp-AdjustExprType.Tpo -c -o ResolvExpr/driver_cfa_cpp-AdjustExprType.o `test -f 'ResolvExpr/AdjustExprType.cc' || echo '$(srcdir)/'`ResolvExpr/AdjustExprType.cc1825 @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) ResolvExpr/$(DEPDIR)/driver_cfa_cpp-AdjustExprType.Tpo ResolvExpr/$(DEPDIR)/driver_cfa_cpp-AdjustExprType.Po1826 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='ResolvExpr/AdjustExprType.cc' object='ResolvExpr/driver_cfa_cpp-AdjustExprType.o' libtool=no @AMDEPBACKSLASH@1827 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@1828 @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -c -o ResolvExpr/driver_cfa_cpp-AdjustExprType.o `test -f 'ResolvExpr/AdjustExprType.cc' || echo '$(srcdir)/'`ResolvExpr/AdjustExprType.cc1829 1830 ResolvExpr/driver_cfa_cpp-AdjustExprType.obj: ResolvExpr/AdjustExprType.cc1831 @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -MT ResolvExpr/driver_cfa_cpp-AdjustExprType.obj -MD -MP -MF ResolvExpr/$(DEPDIR)/driver_cfa_cpp-AdjustExprType.Tpo -c -o ResolvExpr/driver_cfa_cpp-AdjustExprType.obj `if test -f 'ResolvExpr/AdjustExprType.cc'; then $(CYGPATH_W) 'ResolvExpr/AdjustExprType.cc'; else $(CYGPATH_W) '$(srcdir)/ResolvExpr/AdjustExprType.cc'; fi`1832 @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) ResolvExpr/$(DEPDIR)/driver_cfa_cpp-AdjustExprType.Tpo ResolvExpr/$(DEPDIR)/driver_cfa_cpp-AdjustExprType.Po1833 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='ResolvExpr/AdjustExprType.cc' object='ResolvExpr/driver_cfa_cpp-AdjustExprType.obj' libtool=no @AMDEPBACKSLASH@1834 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@1835 @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -c -o ResolvExpr/driver_cfa_cpp-AdjustExprType.obj `if test -f 'ResolvExpr/AdjustExprType.cc'; then $(CYGPATH_W) 'ResolvExpr/AdjustExprType.cc'; else $(CYGPATH_W) '$(srcdir)/ResolvExpr/AdjustExprType.cc'; fi`1836 1837 ResolvExpr/driver_cfa_cpp-AlternativePrinter.o: ResolvExpr/AlternativePrinter.cc1838 @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -MT ResolvExpr/driver_cfa_cpp-AlternativePrinter.o -MD -MP -MF ResolvExpr/$(DEPDIR)/driver_cfa_cpp-AlternativePrinter.Tpo -c -o ResolvExpr/driver_cfa_cpp-AlternativePrinter.o `test -f 'ResolvExpr/AlternativePrinter.cc' || echo '$(srcdir)/'`ResolvExpr/AlternativePrinter.cc1839 @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) ResolvExpr/$(DEPDIR)/driver_cfa_cpp-AlternativePrinter.Tpo ResolvExpr/$(DEPDIR)/driver_cfa_cpp-AlternativePrinter.Po1840 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='ResolvExpr/AlternativePrinter.cc' object='ResolvExpr/driver_cfa_cpp-AlternativePrinter.o' libtool=no @AMDEPBACKSLASH@1841 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@1842 @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -c -o ResolvExpr/driver_cfa_cpp-AlternativePrinter.o `test -f 'ResolvExpr/AlternativePrinter.cc' || echo '$(srcdir)/'`ResolvExpr/AlternativePrinter.cc1843 1844 ResolvExpr/driver_cfa_cpp-AlternativePrinter.obj: ResolvExpr/AlternativePrinter.cc1845 @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -MT ResolvExpr/driver_cfa_cpp-AlternativePrinter.obj -MD -MP -MF ResolvExpr/$(DEPDIR)/driver_cfa_cpp-AlternativePrinter.Tpo -c -o ResolvExpr/driver_cfa_cpp-AlternativePrinter.obj `if test -f 'ResolvExpr/AlternativePrinter.cc'; then $(CYGPATH_W) 'ResolvExpr/AlternativePrinter.cc'; else $(CYGPATH_W) '$(srcdir)/ResolvExpr/AlternativePrinter.cc'; fi`1846 @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) ResolvExpr/$(DEPDIR)/driver_cfa_cpp-AlternativePrinter.Tpo ResolvExpr/$(DEPDIR)/driver_cfa_cpp-AlternativePrinter.Po1847 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='ResolvExpr/AlternativePrinter.cc' object='ResolvExpr/driver_cfa_cpp-AlternativePrinter.obj' libtool=no @AMDEPBACKSLASH@1848 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@1849 @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -c -o ResolvExpr/driver_cfa_cpp-AlternativePrinter.obj `if test -f 'ResolvExpr/AlternativePrinter.cc'; then $(CYGPATH_W) 'ResolvExpr/AlternativePrinter.cc'; else $(CYGPATH_W) '$(srcdir)/ResolvExpr/AlternativePrinter.cc'; fi`1850 1851 ResolvExpr/driver_cfa_cpp-Resolver.o: ResolvExpr/Resolver.cc1852 @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -MT ResolvExpr/driver_cfa_cpp-Resolver.o -MD -MP -MF ResolvExpr/$(DEPDIR)/driver_cfa_cpp-Resolver.Tpo -c -o ResolvExpr/driver_cfa_cpp-Resolver.o `test -f 'ResolvExpr/Resolver.cc' || echo '$(srcdir)/'`ResolvExpr/Resolver.cc1853 @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) ResolvExpr/$(DEPDIR)/driver_cfa_cpp-Resolver.Tpo ResolvExpr/$(DEPDIR)/driver_cfa_cpp-Resolver.Po1854 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='ResolvExpr/Resolver.cc' object='ResolvExpr/driver_cfa_cpp-Resolver.o' libtool=no @AMDEPBACKSLASH@1855 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@1856 @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -c -o ResolvExpr/driver_cfa_cpp-Resolver.o `test -f 'ResolvExpr/Resolver.cc' || echo '$(srcdir)/'`ResolvExpr/Resolver.cc1857 1858 ResolvExpr/driver_cfa_cpp-Resolver.obj: ResolvExpr/Resolver.cc1859 @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -MT ResolvExpr/driver_cfa_cpp-Resolver.obj -MD -MP -MF ResolvExpr/$(DEPDIR)/driver_cfa_cpp-Resolver.Tpo -c -o ResolvExpr/driver_cfa_cpp-Resolver.obj `if test -f 'ResolvExpr/Resolver.cc'; then $(CYGPATH_W) 'ResolvExpr/Resolver.cc'; else $(CYGPATH_W) '$(srcdir)/ResolvExpr/Resolver.cc'; fi`1860 @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) ResolvExpr/$(DEPDIR)/driver_cfa_cpp-Resolver.Tpo ResolvExpr/$(DEPDIR)/driver_cfa_cpp-Resolver.Po1861 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='ResolvExpr/Resolver.cc' object='ResolvExpr/driver_cfa_cpp-Resolver.obj' libtool=no @AMDEPBACKSLASH@1862 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@1863 @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -c -o ResolvExpr/driver_cfa_cpp-Resolver.obj `if test -f 'ResolvExpr/Resolver.cc'; then $(CYGPATH_W) 'ResolvExpr/Resolver.cc'; else $(CYGPATH_W) '$(srcdir)/ResolvExpr/Resolver.cc'; fi`1864 1865 ResolvExpr/driver_cfa_cpp-ResolveTypeof.o: ResolvExpr/ResolveTypeof.cc1866 @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -MT ResolvExpr/driver_cfa_cpp-ResolveTypeof.o -MD -MP -MF ResolvExpr/$(DEPDIR)/driver_cfa_cpp-ResolveTypeof.Tpo -c -o ResolvExpr/driver_cfa_cpp-ResolveTypeof.o `test -f 'ResolvExpr/ResolveTypeof.cc' || echo '$(srcdir)/'`ResolvExpr/ResolveTypeof.cc1867 @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) ResolvExpr/$(DEPDIR)/driver_cfa_cpp-ResolveTypeof.Tpo ResolvExpr/$(DEPDIR)/driver_cfa_cpp-ResolveTypeof.Po1868 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='ResolvExpr/ResolveTypeof.cc' object='ResolvExpr/driver_cfa_cpp-ResolveTypeof.o' libtool=no @AMDEPBACKSLASH@1869 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@1870 @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -c -o ResolvExpr/driver_cfa_cpp-ResolveTypeof.o `test -f 'ResolvExpr/ResolveTypeof.cc' || echo '$(srcdir)/'`ResolvExpr/ResolveTypeof.cc1871 1872 ResolvExpr/driver_cfa_cpp-ResolveTypeof.obj: ResolvExpr/ResolveTypeof.cc1873 @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -MT ResolvExpr/driver_cfa_cpp-ResolveTypeof.obj -MD -MP -MF ResolvExpr/$(DEPDIR)/driver_cfa_cpp-ResolveTypeof.Tpo -c -o ResolvExpr/driver_cfa_cpp-ResolveTypeof.obj `if test -f 'ResolvExpr/ResolveTypeof.cc'; then $(CYGPATH_W) 'ResolvExpr/ResolveTypeof.cc'; else $(CYGPATH_W) '$(srcdir)/ResolvExpr/ResolveTypeof.cc'; fi`1874 @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) ResolvExpr/$(DEPDIR)/driver_cfa_cpp-ResolveTypeof.Tpo ResolvExpr/$(DEPDIR)/driver_cfa_cpp-ResolveTypeof.Po1875 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='ResolvExpr/ResolveTypeof.cc' object='ResolvExpr/driver_cfa_cpp-ResolveTypeof.obj' libtool=no @AMDEPBACKSLASH@1876 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@1877 @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -c -o ResolvExpr/driver_cfa_cpp-ResolveTypeof.obj `if test -f 'ResolvExpr/ResolveTypeof.cc'; then $(CYGPATH_W) 'ResolvExpr/ResolveTypeof.cc'; else $(CYGPATH_W) '$(srcdir)/ResolvExpr/ResolveTypeof.cc'; fi`1878 1879 ResolvExpr/driver_cfa_cpp-RenameVars.o: ResolvExpr/RenameVars.cc1880 @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -MT ResolvExpr/driver_cfa_cpp-RenameVars.o -MD -MP -MF ResolvExpr/$(DEPDIR)/driver_cfa_cpp-RenameVars.Tpo -c -o ResolvExpr/driver_cfa_cpp-RenameVars.o `test -f 'ResolvExpr/RenameVars.cc' || echo '$(srcdir)/'`ResolvExpr/RenameVars.cc1881 @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) ResolvExpr/$(DEPDIR)/driver_cfa_cpp-RenameVars.Tpo ResolvExpr/$(DEPDIR)/driver_cfa_cpp-RenameVars.Po1882 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='ResolvExpr/RenameVars.cc' object='ResolvExpr/driver_cfa_cpp-RenameVars.o' libtool=no @AMDEPBACKSLASH@1883 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@1884 @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -c -o ResolvExpr/driver_cfa_cpp-RenameVars.o `test -f 'ResolvExpr/RenameVars.cc' || echo '$(srcdir)/'`ResolvExpr/RenameVars.cc1885 1886 ResolvExpr/driver_cfa_cpp-RenameVars.obj: ResolvExpr/RenameVars.cc1887 @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -MT ResolvExpr/driver_cfa_cpp-RenameVars.obj -MD -MP -MF ResolvExpr/$(DEPDIR)/driver_cfa_cpp-RenameVars.Tpo -c -o ResolvExpr/driver_cfa_cpp-RenameVars.obj `if test -f 'ResolvExpr/RenameVars.cc'; then $(CYGPATH_W) 'ResolvExpr/RenameVars.cc'; else $(CYGPATH_W) '$(srcdir)/ResolvExpr/RenameVars.cc'; fi`1888 @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) ResolvExpr/$(DEPDIR)/driver_cfa_cpp-RenameVars.Tpo ResolvExpr/$(DEPDIR)/driver_cfa_cpp-RenameVars.Po1889 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='ResolvExpr/RenameVars.cc' object='ResolvExpr/driver_cfa_cpp-RenameVars.obj' libtool=no @AMDEPBACKSLASH@1890 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@1891 @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -c -o ResolvExpr/driver_cfa_cpp-RenameVars.obj `if test -f 'ResolvExpr/RenameVars.cc'; then $(CYGPATH_W) 'ResolvExpr/RenameVars.cc'; else $(CYGPATH_W) '$(srcdir)/ResolvExpr/RenameVars.cc'; fi`1892 1893 ResolvExpr/driver_cfa_cpp-FindOpenVars.o: ResolvExpr/FindOpenVars.cc1894 @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -MT ResolvExpr/driver_cfa_cpp-FindOpenVars.o -MD -MP -MF ResolvExpr/$(DEPDIR)/driver_cfa_cpp-FindOpenVars.Tpo -c -o ResolvExpr/driver_cfa_cpp-FindOpenVars.o `test -f 'ResolvExpr/FindOpenVars.cc' || echo '$(srcdir)/'`ResolvExpr/FindOpenVars.cc1895 @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) ResolvExpr/$(DEPDIR)/driver_cfa_cpp-FindOpenVars.Tpo ResolvExpr/$(DEPDIR)/driver_cfa_cpp-FindOpenVars.Po1896 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='ResolvExpr/FindOpenVars.cc' object='ResolvExpr/driver_cfa_cpp-FindOpenVars.o' libtool=no @AMDEPBACKSLASH@1897 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@1898 @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -c -o ResolvExpr/driver_cfa_cpp-FindOpenVars.o `test -f 'ResolvExpr/FindOpenVars.cc' || echo '$(srcdir)/'`ResolvExpr/FindOpenVars.cc1899 1900 ResolvExpr/driver_cfa_cpp-FindOpenVars.obj: ResolvExpr/FindOpenVars.cc1901 @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -MT ResolvExpr/driver_cfa_cpp-FindOpenVars.obj -MD -MP -MF ResolvExpr/$(DEPDIR)/driver_cfa_cpp-FindOpenVars.Tpo -c -o ResolvExpr/driver_cfa_cpp-FindOpenVars.obj `if test -f 'ResolvExpr/FindOpenVars.cc'; then $(CYGPATH_W) 'ResolvExpr/FindOpenVars.cc'; else $(CYGPATH_W) '$(srcdir)/ResolvExpr/FindOpenVars.cc'; fi`1902 @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) ResolvExpr/$(DEPDIR)/driver_cfa_cpp-FindOpenVars.Tpo ResolvExpr/$(DEPDIR)/driver_cfa_cpp-FindOpenVars.Po1903 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='ResolvExpr/FindOpenVars.cc' object='ResolvExpr/driver_cfa_cpp-FindOpenVars.obj' libtool=no @AMDEPBACKSLASH@1904 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@1905 @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -c -o ResolvExpr/driver_cfa_cpp-FindOpenVars.obj `if test -f 'ResolvExpr/FindOpenVars.cc'; then $(CYGPATH_W) 'ResolvExpr/FindOpenVars.cc'; else $(CYGPATH_W) '$(srcdir)/ResolvExpr/FindOpenVars.cc'; fi`1906 1907 ResolvExpr/driver_cfa_cpp-PolyCost.o: ResolvExpr/PolyCost.cc1908 @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -MT ResolvExpr/driver_cfa_cpp-PolyCost.o -MD -MP -MF ResolvExpr/$(DEPDIR)/driver_cfa_cpp-PolyCost.Tpo -c -o ResolvExpr/driver_cfa_cpp-PolyCost.o `test -f 'ResolvExpr/PolyCost.cc' || echo '$(srcdir)/'`ResolvExpr/PolyCost.cc1909 @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) ResolvExpr/$(DEPDIR)/driver_cfa_cpp-PolyCost.Tpo ResolvExpr/$(DEPDIR)/driver_cfa_cpp-PolyCost.Po1910 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='ResolvExpr/PolyCost.cc' object='ResolvExpr/driver_cfa_cpp-PolyCost.o' libtool=no @AMDEPBACKSLASH@1911 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@1912 @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -c -o ResolvExpr/driver_cfa_cpp-PolyCost.o `test -f 'ResolvExpr/PolyCost.cc' || echo '$(srcdir)/'`ResolvExpr/PolyCost.cc1913 1914 ResolvExpr/driver_cfa_cpp-PolyCost.obj: ResolvExpr/PolyCost.cc1915 @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -MT ResolvExpr/driver_cfa_cpp-PolyCost.obj -MD -MP -MF ResolvExpr/$(DEPDIR)/driver_cfa_cpp-PolyCost.Tpo -c -o ResolvExpr/driver_cfa_cpp-PolyCost.obj `if test -f 'ResolvExpr/PolyCost.cc'; then $(CYGPATH_W) 'ResolvExpr/PolyCost.cc'; else $(CYGPATH_W) '$(srcdir)/ResolvExpr/PolyCost.cc'; fi`1916 @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) ResolvExpr/$(DEPDIR)/driver_cfa_cpp-PolyCost.Tpo ResolvExpr/$(DEPDIR)/driver_cfa_cpp-PolyCost.Po1917 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='ResolvExpr/PolyCost.cc' object='ResolvExpr/driver_cfa_cpp-PolyCost.obj' libtool=no @AMDEPBACKSLASH@1918 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@1919 @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -c -o ResolvExpr/driver_cfa_cpp-PolyCost.obj `if test -f 'ResolvExpr/PolyCost.cc'; then $(CYGPATH_W) 'ResolvExpr/PolyCost.cc'; else $(CYGPATH_W) '$(srcdir)/ResolvExpr/PolyCost.cc'; fi`1920 1921 ResolvExpr/driver_cfa_cpp-Occurs.o: ResolvExpr/Occurs.cc1922 @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -MT ResolvExpr/driver_cfa_cpp-Occurs.o -MD -MP -MF ResolvExpr/$(DEPDIR)/driver_cfa_cpp-Occurs.Tpo -c -o ResolvExpr/driver_cfa_cpp-Occurs.o `test -f 'ResolvExpr/Occurs.cc' || echo '$(srcdir)/'`ResolvExpr/Occurs.cc1923 @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) ResolvExpr/$(DEPDIR)/driver_cfa_cpp-Occurs.Tpo ResolvExpr/$(DEPDIR)/driver_cfa_cpp-Occurs.Po1924 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='ResolvExpr/Occurs.cc' object='ResolvExpr/driver_cfa_cpp-Occurs.o' libtool=no @AMDEPBACKSLASH@1925 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@1926 @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -c -o ResolvExpr/driver_cfa_cpp-Occurs.o `test -f 'ResolvExpr/Occurs.cc' || echo '$(srcdir)/'`ResolvExpr/Occurs.cc1927 1928 ResolvExpr/driver_cfa_cpp-Occurs.obj: ResolvExpr/Occurs.cc1929 @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -MT ResolvExpr/driver_cfa_cpp-Occurs.obj -MD -MP -MF ResolvExpr/$(DEPDIR)/driver_cfa_cpp-Occurs.Tpo -c -o ResolvExpr/driver_cfa_cpp-Occurs.obj `if test -f 'ResolvExpr/Occurs.cc'; then $(CYGPATH_W) 'ResolvExpr/Occurs.cc'; else $(CYGPATH_W) '$(srcdir)/ResolvExpr/Occurs.cc'; fi`1930 @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) ResolvExpr/$(DEPDIR)/driver_cfa_cpp-Occurs.Tpo ResolvExpr/$(DEPDIR)/driver_cfa_cpp-Occurs.Po1931 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='ResolvExpr/Occurs.cc' object='ResolvExpr/driver_cfa_cpp-Occurs.obj' libtool=no @AMDEPBACKSLASH@1932 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@1933 @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -c -o ResolvExpr/driver_cfa_cpp-Occurs.obj `if test -f 'ResolvExpr/Occurs.cc'; then $(CYGPATH_W) 'ResolvExpr/Occurs.cc'; else $(CYGPATH_W) '$(srcdir)/ResolvExpr/Occurs.cc'; fi`1934 1935 ResolvExpr/driver_cfa_cpp-TypeEnvironment.o: ResolvExpr/TypeEnvironment.cc1936 @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -MT ResolvExpr/driver_cfa_cpp-TypeEnvironment.o -MD -MP -MF ResolvExpr/$(DEPDIR)/driver_cfa_cpp-TypeEnvironment.Tpo -c -o ResolvExpr/driver_cfa_cpp-TypeEnvironment.o `test -f 'ResolvExpr/TypeEnvironment.cc' || echo '$(srcdir)/'`ResolvExpr/TypeEnvironment.cc1937 @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) ResolvExpr/$(DEPDIR)/driver_cfa_cpp-TypeEnvironment.Tpo ResolvExpr/$(DEPDIR)/driver_cfa_cpp-TypeEnvironment.Po1938 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='ResolvExpr/TypeEnvironment.cc' object='ResolvExpr/driver_cfa_cpp-TypeEnvironment.o' libtool=no @AMDEPBACKSLASH@1939 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@1940 @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -c -o ResolvExpr/driver_cfa_cpp-TypeEnvironment.o `test -f 'ResolvExpr/TypeEnvironment.cc' || echo '$(srcdir)/'`ResolvExpr/TypeEnvironment.cc1941 1942 ResolvExpr/driver_cfa_cpp-TypeEnvironment.obj: ResolvExpr/TypeEnvironment.cc1943 @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -MT ResolvExpr/driver_cfa_cpp-TypeEnvironment.obj -MD -MP -MF ResolvExpr/$(DEPDIR)/driver_cfa_cpp-TypeEnvironment.Tpo -c -o ResolvExpr/driver_cfa_cpp-TypeEnvironment.obj `if test -f 'ResolvExpr/TypeEnvironment.cc'; then $(CYGPATH_W) 'ResolvExpr/TypeEnvironment.cc'; else $(CYGPATH_W) '$(srcdir)/ResolvExpr/TypeEnvironment.cc'; fi`1944 @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) ResolvExpr/$(DEPDIR)/driver_cfa_cpp-TypeEnvironment.Tpo ResolvExpr/$(DEPDIR)/driver_cfa_cpp-TypeEnvironment.Po1945 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='ResolvExpr/TypeEnvironment.cc' object='ResolvExpr/driver_cfa_cpp-TypeEnvironment.obj' libtool=no @AMDEPBACKSLASH@1946 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@1947 @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -c -o ResolvExpr/driver_cfa_cpp-TypeEnvironment.obj `if test -f 'ResolvExpr/TypeEnvironment.cc'; then $(CYGPATH_W) 'ResolvExpr/TypeEnvironment.cc'; else $(CYGPATH_W) '$(srcdir)/ResolvExpr/TypeEnvironment.cc'; fi`1948 1949 ResolvExpr/driver_cfa_cpp-CurrentObject.o: ResolvExpr/CurrentObject.cc1950 @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -MT ResolvExpr/driver_cfa_cpp-CurrentObject.o -MD -MP -MF ResolvExpr/$(DEPDIR)/driver_cfa_cpp-CurrentObject.Tpo -c -o ResolvExpr/driver_cfa_cpp-CurrentObject.o `test -f 'ResolvExpr/CurrentObject.cc' || echo '$(srcdir)/'`ResolvExpr/CurrentObject.cc1951 @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) ResolvExpr/$(DEPDIR)/driver_cfa_cpp-CurrentObject.Tpo ResolvExpr/$(DEPDIR)/driver_cfa_cpp-CurrentObject.Po1952 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='ResolvExpr/CurrentObject.cc' object='ResolvExpr/driver_cfa_cpp-CurrentObject.o' libtool=no @AMDEPBACKSLASH@1953 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@1954 @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -c -o ResolvExpr/driver_cfa_cpp-CurrentObject.o `test -f 'ResolvExpr/CurrentObject.cc' || echo '$(srcdir)/'`ResolvExpr/CurrentObject.cc1955 1956 ResolvExpr/driver_cfa_cpp-CurrentObject.obj: ResolvExpr/CurrentObject.cc1957 @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -MT ResolvExpr/driver_cfa_cpp-CurrentObject.obj -MD -MP -MF ResolvExpr/$(DEPDIR)/driver_cfa_cpp-CurrentObject.Tpo -c -o ResolvExpr/driver_cfa_cpp-CurrentObject.obj `if test -f 'ResolvExpr/CurrentObject.cc'; then $(CYGPATH_W) 'ResolvExpr/CurrentObject.cc'; else $(CYGPATH_W) '$(srcdir)/ResolvExpr/CurrentObject.cc'; fi`1958 @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) ResolvExpr/$(DEPDIR)/driver_cfa_cpp-CurrentObject.Tpo ResolvExpr/$(DEPDIR)/driver_cfa_cpp-CurrentObject.Po1959 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='ResolvExpr/CurrentObject.cc' object='ResolvExpr/driver_cfa_cpp-CurrentObject.obj' libtool=no @AMDEPBACKSLASH@1960 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@1961 @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -c -o ResolvExpr/driver_cfa_cpp-CurrentObject.obj `if test -f 'ResolvExpr/CurrentObject.cc'; then $(CYGPATH_W) 'ResolvExpr/CurrentObject.cc'; else $(CYGPATH_W) '$(srcdir)/ResolvExpr/CurrentObject.cc'; fi`1962 1963 ResolvExpr/driver_cfa_cpp-ExplodedActual.o: ResolvExpr/ExplodedActual.cc1964 @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -MT ResolvExpr/driver_cfa_cpp-ExplodedActual.o -MD -MP -MF ResolvExpr/$(DEPDIR)/driver_cfa_cpp-ExplodedActual.Tpo -c -o ResolvExpr/driver_cfa_cpp-ExplodedActual.o `test -f 'ResolvExpr/ExplodedActual.cc' || echo '$(srcdir)/'`ResolvExpr/ExplodedActual.cc1965 @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) ResolvExpr/$(DEPDIR)/driver_cfa_cpp-ExplodedActual.Tpo ResolvExpr/$(DEPDIR)/driver_cfa_cpp-ExplodedActual.Po1966 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='ResolvExpr/ExplodedActual.cc' object='ResolvExpr/driver_cfa_cpp-ExplodedActual.o' libtool=no @AMDEPBACKSLASH@1967 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@1968 @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -c -o ResolvExpr/driver_cfa_cpp-ExplodedActual.o `test -f 'ResolvExpr/ExplodedActual.cc' || echo '$(srcdir)/'`ResolvExpr/ExplodedActual.cc1969 1970 ResolvExpr/driver_cfa_cpp-ExplodedActual.obj: ResolvExpr/ExplodedActual.cc1971 @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -MT ResolvExpr/driver_cfa_cpp-ExplodedActual.obj -MD -MP -MF ResolvExpr/$(DEPDIR)/driver_cfa_cpp-ExplodedActual.Tpo -c -o ResolvExpr/driver_cfa_cpp-ExplodedActual.obj `if test -f 'ResolvExpr/ExplodedActual.cc'; then $(CYGPATH_W) 'ResolvExpr/ExplodedActual.cc'; else $(CYGPATH_W) '$(srcdir)/ResolvExpr/ExplodedActual.cc'; fi`1972 @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) ResolvExpr/$(DEPDIR)/driver_cfa_cpp-ExplodedActual.Tpo ResolvExpr/$(DEPDIR)/driver_cfa_cpp-ExplodedActual.Po1973 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='ResolvExpr/ExplodedActual.cc' object='ResolvExpr/driver_cfa_cpp-ExplodedActual.obj' libtool=no @AMDEPBACKSLASH@1974 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@1975 @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -c -o ResolvExpr/driver_cfa_cpp-ExplodedActual.obj `if test -f 'ResolvExpr/ExplodedActual.cc'; then $(CYGPATH_W) 'ResolvExpr/ExplodedActual.cc'; else $(CYGPATH_W) '$(srcdir)/ResolvExpr/ExplodedActual.cc'; fi`1976 1977 SymTab/driver_cfa_cpp-Indexer.o: SymTab/Indexer.cc1978 @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -MT SymTab/driver_cfa_cpp-Indexer.o -MD -MP -MF SymTab/$(DEPDIR)/driver_cfa_cpp-Indexer.Tpo -c -o SymTab/driver_cfa_cpp-Indexer.o `test -f 'SymTab/Indexer.cc' || echo '$(srcdir)/'`SymTab/Indexer.cc1979 @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) SymTab/$(DEPDIR)/driver_cfa_cpp-Indexer.Tpo SymTab/$(DEPDIR)/driver_cfa_cpp-Indexer.Po1980 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='SymTab/Indexer.cc' object='SymTab/driver_cfa_cpp-Indexer.o' libtool=no @AMDEPBACKSLASH@1981 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@1982 @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -c -o SymTab/driver_cfa_cpp-Indexer.o `test -f 'SymTab/Indexer.cc' || echo '$(srcdir)/'`SymTab/Indexer.cc1983 1984 SymTab/driver_cfa_cpp-Indexer.obj: SymTab/Indexer.cc1985 @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -MT SymTab/driver_cfa_cpp-Indexer.obj -MD -MP -MF SymTab/$(DEPDIR)/driver_cfa_cpp-Indexer.Tpo -c -o SymTab/driver_cfa_cpp-Indexer.obj `if test -f 'SymTab/Indexer.cc'; then $(CYGPATH_W) 'SymTab/Indexer.cc'; else $(CYGPATH_W) '$(srcdir)/SymTab/Indexer.cc'; fi`1986 @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) SymTab/$(DEPDIR)/driver_cfa_cpp-Indexer.Tpo SymTab/$(DEPDIR)/driver_cfa_cpp-Indexer.Po1987 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='SymTab/Indexer.cc' object='SymTab/driver_cfa_cpp-Indexer.obj' libtool=no @AMDEPBACKSLASH@1988 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@1989 @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -c -o SymTab/driver_cfa_cpp-Indexer.obj `if test -f 'SymTab/Indexer.cc'; then $(CYGPATH_W) 'SymTab/Indexer.cc'; else $(CYGPATH_W) '$(srcdir)/SymTab/Indexer.cc'; fi`1990 1991 SymTab/driver_cfa_cpp-Mangler.o: SymTab/Mangler.cc1992 @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -MT SymTab/driver_cfa_cpp-Mangler.o -MD -MP -MF SymTab/$(DEPDIR)/driver_cfa_cpp-Mangler.Tpo -c -o SymTab/driver_cfa_cpp-Mangler.o `test -f 'SymTab/Mangler.cc' || echo '$(srcdir)/'`SymTab/Mangler.cc1993 @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) SymTab/$(DEPDIR)/driver_cfa_cpp-Mangler.Tpo SymTab/$(DEPDIR)/driver_cfa_cpp-Mangler.Po1994 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='SymTab/Mangler.cc' object='SymTab/driver_cfa_cpp-Mangler.o' libtool=no @AMDEPBACKSLASH@1995 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@1996 @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -c -o SymTab/driver_cfa_cpp-Mangler.o `test -f 'SymTab/Mangler.cc' || echo '$(srcdir)/'`SymTab/Mangler.cc1997 1998 SymTab/driver_cfa_cpp-Mangler.obj: SymTab/Mangler.cc1999 @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -MT SymTab/driver_cfa_cpp-Mangler.obj -MD -MP -MF SymTab/$(DEPDIR)/driver_cfa_cpp-Mangler.Tpo -c -o SymTab/driver_cfa_cpp-Mangler.obj `if test -f 'SymTab/Mangler.cc'; then $(CYGPATH_W) 'SymTab/Mangler.cc'; else $(CYGPATH_W) '$(srcdir)/SymTab/Mangler.cc'; fi`2000 @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) SymTab/$(DEPDIR)/driver_cfa_cpp-Mangler.Tpo SymTab/$(DEPDIR)/driver_cfa_cpp-Mangler.Po2001 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='SymTab/Mangler.cc' object='SymTab/driver_cfa_cpp-Mangler.obj' libtool=no @AMDEPBACKSLASH@2002 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@2003 @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -c -o SymTab/driver_cfa_cpp-Mangler.obj `if test -f 'SymTab/Mangler.cc'; then $(CYGPATH_W) 'SymTab/Mangler.cc'; else $(CYGPATH_W) '$(srcdir)/SymTab/Mangler.cc'; fi`2004 2005 SymTab/driver_cfa_cpp-Validate.o: SymTab/Validate.cc2006 @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -MT SymTab/driver_cfa_cpp-Validate.o -MD -MP -MF SymTab/$(DEPDIR)/driver_cfa_cpp-Validate.Tpo -c -o SymTab/driver_cfa_cpp-Validate.o `test -f 'SymTab/Validate.cc' || echo '$(srcdir)/'`SymTab/Validate.cc2007 @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) SymTab/$(DEPDIR)/driver_cfa_cpp-Validate.Tpo SymTab/$(DEPDIR)/driver_cfa_cpp-Validate.Po2008 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='SymTab/Validate.cc' object='SymTab/driver_cfa_cpp-Validate.o' libtool=no @AMDEPBACKSLASH@2009 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@2010 @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -c -o SymTab/driver_cfa_cpp-Validate.o `test -f 'SymTab/Validate.cc' || echo '$(srcdir)/'`SymTab/Validate.cc2011 2012 SymTab/driver_cfa_cpp-Validate.obj: SymTab/Validate.cc2013 @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -MT SymTab/driver_cfa_cpp-Validate.obj -MD -MP -MF SymTab/$(DEPDIR)/driver_cfa_cpp-Validate.Tpo -c -o SymTab/driver_cfa_cpp-Validate.obj `if test -f 'SymTab/Validate.cc'; then $(CYGPATH_W) 'SymTab/Validate.cc'; else $(CYGPATH_W) '$(srcdir)/SymTab/Validate.cc'; fi`2014 @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) SymTab/$(DEPDIR)/driver_cfa_cpp-Validate.Tpo SymTab/$(DEPDIR)/driver_cfa_cpp-Validate.Po2015 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='SymTab/Validate.cc' object='SymTab/driver_cfa_cpp-Validate.obj' libtool=no @AMDEPBACKSLASH@2016 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@2017 @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -c -o SymTab/driver_cfa_cpp-Validate.obj `if test -f 'SymTab/Validate.cc'; then $(CYGPATH_W) 'SymTab/Validate.cc'; else $(CYGPATH_W) '$(srcdir)/SymTab/Validate.cc'; fi`2018 2019 SymTab/driver_cfa_cpp-FixFunction.o: SymTab/FixFunction.cc2020 @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -MT SymTab/driver_cfa_cpp-FixFunction.o -MD -MP -MF SymTab/$(DEPDIR)/driver_cfa_cpp-FixFunction.Tpo -c -o SymTab/driver_cfa_cpp-FixFunction.o `test -f 'SymTab/FixFunction.cc' || echo '$(srcdir)/'`SymTab/FixFunction.cc2021 @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) SymTab/$(DEPDIR)/driver_cfa_cpp-FixFunction.Tpo SymTab/$(DEPDIR)/driver_cfa_cpp-FixFunction.Po2022 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='SymTab/FixFunction.cc' object='SymTab/driver_cfa_cpp-FixFunction.o' libtool=no @AMDEPBACKSLASH@2023 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@2024 @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -c -o SymTab/driver_cfa_cpp-FixFunction.o `test -f 'SymTab/FixFunction.cc' || echo '$(srcdir)/'`SymTab/FixFunction.cc2025 2026 SymTab/driver_cfa_cpp-FixFunction.obj: SymTab/FixFunction.cc2027 @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -MT SymTab/driver_cfa_cpp-FixFunction.obj -MD -MP -MF SymTab/$(DEPDIR)/driver_cfa_cpp-FixFunction.Tpo -c -o SymTab/driver_cfa_cpp-FixFunction.obj `if test -f 'SymTab/FixFunction.cc'; then $(CYGPATH_W) 'SymTab/FixFunction.cc'; else $(CYGPATH_W) '$(srcdir)/SymTab/FixFunction.cc'; fi`2028 @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) SymTab/$(DEPDIR)/driver_cfa_cpp-FixFunction.Tpo SymTab/$(DEPDIR)/driver_cfa_cpp-FixFunction.Po2029 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='SymTab/FixFunction.cc' object='SymTab/driver_cfa_cpp-FixFunction.obj' libtool=no @AMDEPBACKSLASH@2030 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@2031 @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -c -o SymTab/driver_cfa_cpp-FixFunction.obj `if test -f 'SymTab/FixFunction.cc'; then $(CYGPATH_W) 'SymTab/FixFunction.cc'; else $(CYGPATH_W) '$(srcdir)/SymTab/FixFunction.cc'; fi`2032 2033 SymTab/driver_cfa_cpp-Autogen.o: SymTab/Autogen.cc2034 @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -MT SymTab/driver_cfa_cpp-Autogen.o -MD -MP -MF SymTab/$(DEPDIR)/driver_cfa_cpp-Autogen.Tpo -c -o SymTab/driver_cfa_cpp-Autogen.o `test -f 'SymTab/Autogen.cc' || echo '$(srcdir)/'`SymTab/Autogen.cc2035 @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) SymTab/$(DEPDIR)/driver_cfa_cpp-Autogen.Tpo SymTab/$(DEPDIR)/driver_cfa_cpp-Autogen.Po2036 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='SymTab/Autogen.cc' object='SymTab/driver_cfa_cpp-Autogen.o' libtool=no @AMDEPBACKSLASH@2037 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@2038 @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -c -o SymTab/driver_cfa_cpp-Autogen.o `test -f 'SymTab/Autogen.cc' || echo '$(srcdir)/'`SymTab/Autogen.cc2039 2040 SymTab/driver_cfa_cpp-Autogen.obj: SymTab/Autogen.cc2041 @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -MT SymTab/driver_cfa_cpp-Autogen.obj -MD -MP -MF SymTab/$(DEPDIR)/driver_cfa_cpp-Autogen.Tpo -c -o SymTab/driver_cfa_cpp-Autogen.obj `if test -f 'SymTab/Autogen.cc'; then $(CYGPATH_W) 'SymTab/Autogen.cc'; else $(CYGPATH_W) '$(srcdir)/SymTab/Autogen.cc'; fi`2042 @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) SymTab/$(DEPDIR)/driver_cfa_cpp-Autogen.Tpo SymTab/$(DEPDIR)/driver_cfa_cpp-Autogen.Po2043 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='SymTab/Autogen.cc' object='SymTab/driver_cfa_cpp-Autogen.obj' libtool=no @AMDEPBACKSLASH@2044 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@2045 @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -c -o SymTab/driver_cfa_cpp-Autogen.obj `if test -f 'SymTab/Autogen.cc'; then $(CYGPATH_W) 'SymTab/Autogen.cc'; else $(CYGPATH_W) '$(srcdir)/SymTab/Autogen.cc'; fi`2046 2047 SynTree/driver_cfa_cpp-Type.o: SynTree/Type.cc2048 @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -MT SynTree/driver_cfa_cpp-Type.o -MD -MP -MF SynTree/$(DEPDIR)/driver_cfa_cpp-Type.Tpo -c -o SynTree/driver_cfa_cpp-Type.o `test -f 'SynTree/Type.cc' || echo '$(srcdir)/'`SynTree/Type.cc2049 @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) SynTree/$(DEPDIR)/driver_cfa_cpp-Type.Tpo SynTree/$(DEPDIR)/driver_cfa_cpp-Type.Po2050 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='SynTree/Type.cc' object='SynTree/driver_cfa_cpp-Type.o' libtool=no @AMDEPBACKSLASH@2051 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@2052 @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -c -o SynTree/driver_cfa_cpp-Type.o `test -f 'SynTree/Type.cc' || echo '$(srcdir)/'`SynTree/Type.cc2053 2054 SynTree/driver_cfa_cpp-Type.obj: SynTree/Type.cc2055 @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -MT SynTree/driver_cfa_cpp-Type.obj -MD -MP -MF SynTree/$(DEPDIR)/driver_cfa_cpp-Type.Tpo -c -o SynTree/driver_cfa_cpp-Type.obj `if test -f 'SynTree/Type.cc'; then $(CYGPATH_W) 'SynTree/Type.cc'; else $(CYGPATH_W) '$(srcdir)/SynTree/Type.cc'; fi`2056 @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) SynTree/$(DEPDIR)/driver_cfa_cpp-Type.Tpo SynTree/$(DEPDIR)/driver_cfa_cpp-Type.Po2057 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='SynTree/Type.cc' object='SynTree/driver_cfa_cpp-Type.obj' libtool=no @AMDEPBACKSLASH@2058 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@2059 @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -c -o SynTree/driver_cfa_cpp-Type.obj `if test -f 'SynTree/Type.cc'; then $(CYGPATH_W) 'SynTree/Type.cc'; else $(CYGPATH_W) '$(srcdir)/SynTree/Type.cc'; fi`2060 2061 SynTree/driver_cfa_cpp-VoidType.o: SynTree/VoidType.cc2062 @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -MT SynTree/driver_cfa_cpp-VoidType.o -MD -MP -MF SynTree/$(DEPDIR)/driver_cfa_cpp-VoidType.Tpo -c -o SynTree/driver_cfa_cpp-VoidType.o `test -f 'SynTree/VoidType.cc' || echo '$(srcdir)/'`SynTree/VoidType.cc2063 @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) SynTree/$(DEPDIR)/driver_cfa_cpp-VoidType.Tpo SynTree/$(DEPDIR)/driver_cfa_cpp-VoidType.Po2064 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='SynTree/VoidType.cc' object='SynTree/driver_cfa_cpp-VoidType.o' libtool=no @AMDEPBACKSLASH@2065 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@2066 @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -c -o SynTree/driver_cfa_cpp-VoidType.o `test -f 'SynTree/VoidType.cc' || echo '$(srcdir)/'`SynTree/VoidType.cc2067 2068 SynTree/driver_cfa_cpp-VoidType.obj: SynTree/VoidType.cc2069 @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -MT SynTree/driver_cfa_cpp-VoidType.obj -MD -MP -MF SynTree/$(DEPDIR)/driver_cfa_cpp-VoidType.Tpo -c -o SynTree/driver_cfa_cpp-VoidType.obj `if test -f 'SynTree/VoidType.cc'; then $(CYGPATH_W) 'SynTree/VoidType.cc'; else $(CYGPATH_W) '$(srcdir)/SynTree/VoidType.cc'; fi`2070 @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) SynTree/$(DEPDIR)/driver_cfa_cpp-VoidType.Tpo SynTree/$(DEPDIR)/driver_cfa_cpp-VoidType.Po2071 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='SynTree/VoidType.cc' object='SynTree/driver_cfa_cpp-VoidType.obj' libtool=no @AMDEPBACKSLASH@2072 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@2073 @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -c -o SynTree/driver_cfa_cpp-VoidType.obj `if test -f 'SynTree/VoidType.cc'; then $(CYGPATH_W) 'SynTree/VoidType.cc'; else $(CYGPATH_W) '$(srcdir)/SynTree/VoidType.cc'; fi`2074 2075 SynTree/driver_cfa_cpp-BasicType.o: SynTree/BasicType.cc2076 @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -MT SynTree/driver_cfa_cpp-BasicType.o -MD -MP -MF SynTree/$(DEPDIR)/driver_cfa_cpp-BasicType.Tpo -c -o SynTree/driver_cfa_cpp-BasicType.o `test -f 'SynTree/BasicType.cc' || echo '$(srcdir)/'`SynTree/BasicType.cc2077 @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) SynTree/$(DEPDIR)/driver_cfa_cpp-BasicType.Tpo SynTree/$(DEPDIR)/driver_cfa_cpp-BasicType.Po2078 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='SynTree/BasicType.cc' object='SynTree/driver_cfa_cpp-BasicType.o' libtool=no @AMDEPBACKSLASH@2079 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@2080 @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -c -o SynTree/driver_cfa_cpp-BasicType.o `test -f 'SynTree/BasicType.cc' || echo '$(srcdir)/'`SynTree/BasicType.cc2081 2082 SynTree/driver_cfa_cpp-BasicType.obj: SynTree/BasicType.cc2083 @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -MT SynTree/driver_cfa_cpp-BasicType.obj -MD -MP -MF SynTree/$(DEPDIR)/driver_cfa_cpp-BasicType.Tpo -c -o SynTree/driver_cfa_cpp-BasicType.obj `if test -f 'SynTree/BasicType.cc'; then $(CYGPATH_W) 'SynTree/BasicType.cc'; else $(CYGPATH_W) '$(srcdir)/SynTree/BasicType.cc'; fi`2084 @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) SynTree/$(DEPDIR)/driver_cfa_cpp-BasicType.Tpo SynTree/$(DEPDIR)/driver_cfa_cpp-BasicType.Po2085 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='SynTree/BasicType.cc' object='SynTree/driver_cfa_cpp-BasicType.obj' libtool=no @AMDEPBACKSLASH@2086 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@2087 @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -c -o SynTree/driver_cfa_cpp-BasicType.obj `if test -f 'SynTree/BasicType.cc'; then $(CYGPATH_W) 'SynTree/BasicType.cc'; else $(CYGPATH_W) '$(srcdir)/SynTree/BasicType.cc'; fi`2088 2089 SynTree/driver_cfa_cpp-PointerType.o: SynTree/PointerType.cc2090 @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -MT SynTree/driver_cfa_cpp-PointerType.o -MD -MP -MF SynTree/$(DEPDIR)/driver_cfa_cpp-PointerType.Tpo -c -o SynTree/driver_cfa_cpp-PointerType.o `test -f 'SynTree/PointerType.cc' || echo '$(srcdir)/'`SynTree/PointerType.cc2091 @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) SynTree/$(DEPDIR)/driver_cfa_cpp-PointerType.Tpo SynTree/$(DEPDIR)/driver_cfa_cpp-PointerType.Po2092 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='SynTree/PointerType.cc' object='SynTree/driver_cfa_cpp-PointerType.o' libtool=no @AMDEPBACKSLASH@2093 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@2094 @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -c -o SynTree/driver_cfa_cpp-PointerType.o `test -f 'SynTree/PointerType.cc' || echo '$(srcdir)/'`SynTree/PointerType.cc2095 2096 SynTree/driver_cfa_cpp-PointerType.obj: SynTree/PointerType.cc2097 @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -MT SynTree/driver_cfa_cpp-PointerType.obj -MD -MP -MF SynTree/$(DEPDIR)/driver_cfa_cpp-PointerType.Tpo -c -o SynTree/driver_cfa_cpp-PointerType.obj `if test -f 'SynTree/PointerType.cc'; then $(CYGPATH_W) 'SynTree/PointerType.cc'; else $(CYGPATH_W) '$(srcdir)/SynTree/PointerType.cc'; fi`2098 @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) SynTree/$(DEPDIR)/driver_cfa_cpp-PointerType.Tpo SynTree/$(DEPDIR)/driver_cfa_cpp-PointerType.Po2099 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='SynTree/PointerType.cc' object='SynTree/driver_cfa_cpp-PointerType.obj' libtool=no @AMDEPBACKSLASH@2100 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@2101 @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -c -o SynTree/driver_cfa_cpp-PointerType.obj `if test -f 'SynTree/PointerType.cc'; then $(CYGPATH_W) 'SynTree/PointerType.cc'; else $(CYGPATH_W) '$(srcdir)/SynTree/PointerType.cc'; fi`2102 2103 SynTree/driver_cfa_cpp-ArrayType.o: SynTree/ArrayType.cc2104 @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -MT SynTree/driver_cfa_cpp-ArrayType.o -MD -MP -MF SynTree/$(DEPDIR)/driver_cfa_cpp-ArrayType.Tpo -c -o SynTree/driver_cfa_cpp-ArrayType.o `test -f 'SynTree/ArrayType.cc' || echo '$(srcdir)/'`SynTree/ArrayType.cc2105 @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) SynTree/$(DEPDIR)/driver_cfa_cpp-ArrayType.Tpo SynTree/$(DEPDIR)/driver_cfa_cpp-ArrayType.Po2106 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='SynTree/ArrayType.cc' object='SynTree/driver_cfa_cpp-ArrayType.o' libtool=no @AMDEPBACKSLASH@2107 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@2108 @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -c -o SynTree/driver_cfa_cpp-ArrayType.o `test -f 'SynTree/ArrayType.cc' || echo '$(srcdir)/'`SynTree/ArrayType.cc2109 2110 SynTree/driver_cfa_cpp-ArrayType.obj: SynTree/ArrayType.cc2111 @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -MT SynTree/driver_cfa_cpp-ArrayType.obj -MD -MP -MF SynTree/$(DEPDIR)/driver_cfa_cpp-ArrayType.Tpo -c -o SynTree/driver_cfa_cpp-ArrayType.obj `if test -f 'SynTree/ArrayType.cc'; then $(CYGPATH_W) 'SynTree/ArrayType.cc'; else $(CYGPATH_W) '$(srcdir)/SynTree/ArrayType.cc'; fi`2112 @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) SynTree/$(DEPDIR)/driver_cfa_cpp-ArrayType.Tpo SynTree/$(DEPDIR)/driver_cfa_cpp-ArrayType.Po2113 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='SynTree/ArrayType.cc' object='SynTree/driver_cfa_cpp-ArrayType.obj' libtool=no @AMDEPBACKSLASH@2114 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@2115 @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -c -o SynTree/driver_cfa_cpp-ArrayType.obj `if test -f 'SynTree/ArrayType.cc'; then $(CYGPATH_W) 'SynTree/ArrayType.cc'; else $(CYGPATH_W) '$(srcdir)/SynTree/ArrayType.cc'; fi`2116 2117 SynTree/driver_cfa_cpp-ReferenceType.o: SynTree/ReferenceType.cc2118 @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -MT SynTree/driver_cfa_cpp-ReferenceType.o -MD -MP -MF SynTree/$(DEPDIR)/driver_cfa_cpp-ReferenceType.Tpo -c -o SynTree/driver_cfa_cpp-ReferenceType.o `test -f 'SynTree/ReferenceType.cc' || echo '$(srcdir)/'`SynTree/ReferenceType.cc2119 @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) SynTree/$(DEPDIR)/driver_cfa_cpp-ReferenceType.Tpo SynTree/$(DEPDIR)/driver_cfa_cpp-ReferenceType.Po2120 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='SynTree/ReferenceType.cc' object='SynTree/driver_cfa_cpp-ReferenceType.o' libtool=no @AMDEPBACKSLASH@2121 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@2122 @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -c -o SynTree/driver_cfa_cpp-ReferenceType.o `test -f 'SynTree/ReferenceType.cc' || echo '$(srcdir)/'`SynTree/ReferenceType.cc2123 2124 SynTree/driver_cfa_cpp-ReferenceType.obj: SynTree/ReferenceType.cc2125 @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -MT SynTree/driver_cfa_cpp-ReferenceType.obj -MD -MP -MF SynTree/$(DEPDIR)/driver_cfa_cpp-ReferenceType.Tpo -c -o SynTree/driver_cfa_cpp-ReferenceType.obj `if test -f 'SynTree/ReferenceType.cc'; then $(CYGPATH_W) 'SynTree/ReferenceType.cc'; else $(CYGPATH_W) '$(srcdir)/SynTree/ReferenceType.cc'; fi`2126 @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) SynTree/$(DEPDIR)/driver_cfa_cpp-ReferenceType.Tpo SynTree/$(DEPDIR)/driver_cfa_cpp-ReferenceType.Po2127 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='SynTree/ReferenceType.cc' object='SynTree/driver_cfa_cpp-ReferenceType.obj' libtool=no @AMDEPBACKSLASH@2128 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@2129 @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -c -o SynTree/driver_cfa_cpp-ReferenceType.obj `if test -f 'SynTree/ReferenceType.cc'; then $(CYGPATH_W) 'SynTree/ReferenceType.cc'; else $(CYGPATH_W) '$(srcdir)/SynTree/ReferenceType.cc'; fi`2130 2131 SynTree/driver_cfa_cpp-FunctionType.o: SynTree/FunctionType.cc2132 @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -MT SynTree/driver_cfa_cpp-FunctionType.o -MD -MP -MF SynTree/$(DEPDIR)/driver_cfa_cpp-FunctionType.Tpo -c -o SynTree/driver_cfa_cpp-FunctionType.o `test -f 'SynTree/FunctionType.cc' || echo '$(srcdir)/'`SynTree/FunctionType.cc2133 @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) SynTree/$(DEPDIR)/driver_cfa_cpp-FunctionType.Tpo SynTree/$(DEPDIR)/driver_cfa_cpp-FunctionType.Po2134 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='SynTree/FunctionType.cc' object='SynTree/driver_cfa_cpp-FunctionType.o' libtool=no @AMDEPBACKSLASH@2135 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@2136 @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -c -o SynTree/driver_cfa_cpp-FunctionType.o `test -f 'SynTree/FunctionType.cc' || echo '$(srcdir)/'`SynTree/FunctionType.cc2137 2138 SynTree/driver_cfa_cpp-FunctionType.obj: SynTree/FunctionType.cc2139 @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -MT SynTree/driver_cfa_cpp-FunctionType.obj -MD -MP -MF SynTree/$(DEPDIR)/driver_cfa_cpp-FunctionType.Tpo -c -o SynTree/driver_cfa_cpp-FunctionType.obj `if test -f 'SynTree/FunctionType.cc'; then $(CYGPATH_W) 'SynTree/FunctionType.cc'; else $(CYGPATH_W) '$(srcdir)/SynTree/FunctionType.cc'; fi`2140 @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) SynTree/$(DEPDIR)/driver_cfa_cpp-FunctionType.Tpo SynTree/$(DEPDIR)/driver_cfa_cpp-FunctionType.Po2141 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='SynTree/FunctionType.cc' object='SynTree/driver_cfa_cpp-FunctionType.obj' libtool=no @AMDEPBACKSLASH@2142 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@2143 @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -c -o SynTree/driver_cfa_cpp-FunctionType.obj `if test -f 'SynTree/FunctionType.cc'; then $(CYGPATH_W) 'SynTree/FunctionType.cc'; else $(CYGPATH_W) '$(srcdir)/SynTree/FunctionType.cc'; fi`2144 2145 SynTree/driver_cfa_cpp-ReferenceToType.o: SynTree/ReferenceToType.cc2146 @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -MT SynTree/driver_cfa_cpp-ReferenceToType.o -MD -MP -MF SynTree/$(DEPDIR)/driver_cfa_cpp-ReferenceToType.Tpo -c -o SynTree/driver_cfa_cpp-ReferenceToType.o `test -f 'SynTree/ReferenceToType.cc' || echo '$(srcdir)/'`SynTree/ReferenceToType.cc2147 @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) SynTree/$(DEPDIR)/driver_cfa_cpp-ReferenceToType.Tpo SynTree/$(DEPDIR)/driver_cfa_cpp-ReferenceToType.Po2148 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='SynTree/ReferenceToType.cc' object='SynTree/driver_cfa_cpp-ReferenceToType.o' libtool=no @AMDEPBACKSLASH@2149 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@2150 @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -c -o SynTree/driver_cfa_cpp-ReferenceToType.o `test -f 'SynTree/ReferenceToType.cc' || echo '$(srcdir)/'`SynTree/ReferenceToType.cc2151 2152 SynTree/driver_cfa_cpp-ReferenceToType.obj: SynTree/ReferenceToType.cc2153 @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -MT SynTree/driver_cfa_cpp-ReferenceToType.obj -MD -MP -MF SynTree/$(DEPDIR)/driver_cfa_cpp-ReferenceToType.Tpo -c -o SynTree/driver_cfa_cpp-ReferenceToType.obj `if test -f 'SynTree/ReferenceToType.cc'; then $(CYGPATH_W) 'SynTree/ReferenceToType.cc'; else $(CYGPATH_W) '$(srcdir)/SynTree/ReferenceToType.cc'; fi`2154 @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) SynTree/$(DEPDIR)/driver_cfa_cpp-ReferenceToType.Tpo SynTree/$(DEPDIR)/driver_cfa_cpp-ReferenceToType.Po2155 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='SynTree/ReferenceToType.cc' object='SynTree/driver_cfa_cpp-ReferenceToType.obj' libtool=no @AMDEPBACKSLASH@2156 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@2157 @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -c -o SynTree/driver_cfa_cpp-ReferenceToType.obj `if test -f 'SynTree/ReferenceToType.cc'; then $(CYGPATH_W) 'SynTree/ReferenceToType.cc'; else $(CYGPATH_W) '$(srcdir)/SynTree/ReferenceToType.cc'; fi`2158 2159 SynTree/driver_cfa_cpp-TupleType.o: SynTree/TupleType.cc2160 @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -MT SynTree/driver_cfa_cpp-TupleType.o -MD -MP -MF SynTree/$(DEPDIR)/driver_cfa_cpp-TupleType.Tpo -c -o SynTree/driver_cfa_cpp-TupleType.o `test -f 'SynTree/TupleType.cc' || echo '$(srcdir)/'`SynTree/TupleType.cc2161 @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) SynTree/$(DEPDIR)/driver_cfa_cpp-TupleType.Tpo SynTree/$(DEPDIR)/driver_cfa_cpp-TupleType.Po2162 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='SynTree/TupleType.cc' object='SynTree/driver_cfa_cpp-TupleType.o' libtool=no @AMDEPBACKSLASH@2163 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@2164 @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -c -o SynTree/driver_cfa_cpp-TupleType.o `test -f 'SynTree/TupleType.cc' || echo '$(srcdir)/'`SynTree/TupleType.cc2165 2166 SynTree/driver_cfa_cpp-TupleType.obj: SynTree/TupleType.cc2167 @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -MT SynTree/driver_cfa_cpp-TupleType.obj -MD -MP -MF SynTree/$(DEPDIR)/driver_cfa_cpp-TupleType.Tpo -c -o SynTree/driver_cfa_cpp-TupleType.obj `if test -f 'SynTree/TupleType.cc'; then $(CYGPATH_W) 'SynTree/TupleType.cc'; else $(CYGPATH_W) '$(srcdir)/SynTree/TupleType.cc'; fi`2168 @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) SynTree/$(DEPDIR)/driver_cfa_cpp-TupleType.Tpo SynTree/$(DEPDIR)/driver_cfa_cpp-TupleType.Po2169 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='SynTree/TupleType.cc' object='SynTree/driver_cfa_cpp-TupleType.obj' libtool=no @AMDEPBACKSLASH@2170 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@2171 @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -c -o SynTree/driver_cfa_cpp-TupleType.obj `if test -f 'SynTree/TupleType.cc'; then $(CYGPATH_W) 'SynTree/TupleType.cc'; else $(CYGPATH_W) '$(srcdir)/SynTree/TupleType.cc'; fi`2172 2173 SynTree/driver_cfa_cpp-TypeofType.o: SynTree/TypeofType.cc2174 @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -MT SynTree/driver_cfa_cpp-TypeofType.o -MD -MP -MF SynTree/$(DEPDIR)/driver_cfa_cpp-TypeofType.Tpo -c -o SynTree/driver_cfa_cpp-TypeofType.o `test -f 'SynTree/TypeofType.cc' || echo '$(srcdir)/'`SynTree/TypeofType.cc2175 @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) SynTree/$(DEPDIR)/driver_cfa_cpp-TypeofType.Tpo SynTree/$(DEPDIR)/driver_cfa_cpp-TypeofType.Po2176 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='SynTree/TypeofType.cc' object='SynTree/driver_cfa_cpp-TypeofType.o' libtool=no @AMDEPBACKSLASH@2177 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@2178 @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -c -o SynTree/driver_cfa_cpp-TypeofType.o `test -f 'SynTree/TypeofType.cc' || echo '$(srcdir)/'`SynTree/TypeofType.cc2179 2180 SynTree/driver_cfa_cpp-TypeofType.obj: SynTree/TypeofType.cc2181 @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -MT SynTree/driver_cfa_cpp-TypeofType.obj -MD -MP -MF SynTree/$(DEPDIR)/driver_cfa_cpp-TypeofType.Tpo -c -o SynTree/driver_cfa_cpp-TypeofType.obj `if test -f 'SynTree/TypeofType.cc'; then $(CYGPATH_W) 'SynTree/TypeofType.cc'; else $(CYGPATH_W) '$(srcdir)/SynTree/TypeofType.cc'; fi`2182 @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) SynTree/$(DEPDIR)/driver_cfa_cpp-TypeofType.Tpo SynTree/$(DEPDIR)/driver_cfa_cpp-TypeofType.Po2183 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='SynTree/TypeofType.cc' object='SynTree/driver_cfa_cpp-TypeofType.obj' libtool=no @AMDEPBACKSLASH@2184 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@2185 @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -c -o SynTree/driver_cfa_cpp-TypeofType.obj `if test -f 'SynTree/TypeofType.cc'; then $(CYGPATH_W) 'SynTree/TypeofType.cc'; else $(CYGPATH_W) '$(srcdir)/SynTree/TypeofType.cc'; fi`2186 2187 SynTree/driver_cfa_cpp-AttrType.o: SynTree/AttrType.cc2188 @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -MT SynTree/driver_cfa_cpp-AttrType.o -MD -MP -MF SynTree/$(DEPDIR)/driver_cfa_cpp-AttrType.Tpo -c -o SynTree/driver_cfa_cpp-AttrType.o `test -f 'SynTree/AttrType.cc' || echo '$(srcdir)/'`SynTree/AttrType.cc2189 @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) SynTree/$(DEPDIR)/driver_cfa_cpp-AttrType.Tpo SynTree/$(DEPDIR)/driver_cfa_cpp-AttrType.Po2190 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='SynTree/AttrType.cc' object='SynTree/driver_cfa_cpp-AttrType.o' libtool=no @AMDEPBACKSLASH@2191 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@2192 @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -c -o SynTree/driver_cfa_cpp-AttrType.o `test -f 'SynTree/AttrType.cc' || echo '$(srcdir)/'`SynTree/AttrType.cc2193 2194 SynTree/driver_cfa_cpp-AttrType.obj: SynTree/AttrType.cc2195 @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -MT SynTree/driver_cfa_cpp-AttrType.obj -MD -MP -MF SynTree/$(DEPDIR)/driver_cfa_cpp-AttrType.Tpo -c -o SynTree/driver_cfa_cpp-AttrType.obj `if test -f 'SynTree/AttrType.cc'; then $(CYGPATH_W) 'SynTree/AttrType.cc'; else $(CYGPATH_W) '$(srcdir)/SynTree/AttrType.cc'; fi`2196 @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) SynTree/$(DEPDIR)/driver_cfa_cpp-AttrType.Tpo SynTree/$(DEPDIR)/driver_cfa_cpp-AttrType.Po2197 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='SynTree/AttrType.cc' object='SynTree/driver_cfa_cpp-AttrType.obj' libtool=no @AMDEPBACKSLASH@2198 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@2199 @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -c -o SynTree/driver_cfa_cpp-AttrType.obj `if test -f 'SynTree/AttrType.cc'; then $(CYGPATH_W) 'SynTree/AttrType.cc'; else $(CYGPATH_W) '$(srcdir)/SynTree/AttrType.cc'; fi`2200 2201 SynTree/driver_cfa_cpp-VarArgsType.o: SynTree/VarArgsType.cc2202 @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -MT SynTree/driver_cfa_cpp-VarArgsType.o -MD -MP -MF SynTree/$(DEPDIR)/driver_cfa_cpp-VarArgsType.Tpo -c -o SynTree/driver_cfa_cpp-VarArgsType.o `test -f 'SynTree/VarArgsType.cc' || echo '$(srcdir)/'`SynTree/VarArgsType.cc2203 @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) SynTree/$(DEPDIR)/driver_cfa_cpp-VarArgsType.Tpo SynTree/$(DEPDIR)/driver_cfa_cpp-VarArgsType.Po2204 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='SynTree/VarArgsType.cc' object='SynTree/driver_cfa_cpp-VarArgsType.o' libtool=no @AMDEPBACKSLASH@2205 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@2206 @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -c -o SynTree/driver_cfa_cpp-VarArgsType.o `test -f 'SynTree/VarArgsType.cc' || echo '$(srcdir)/'`SynTree/VarArgsType.cc2207 2208 SynTree/driver_cfa_cpp-VarArgsType.obj: SynTree/VarArgsType.cc2209 @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -MT SynTree/driver_cfa_cpp-VarArgsType.obj -MD -MP -MF SynTree/$(DEPDIR)/driver_cfa_cpp-VarArgsType.Tpo -c -o SynTree/driver_cfa_cpp-VarArgsType.obj `if test -f 'SynTree/VarArgsType.cc'; then $(CYGPATH_W) 'SynTree/VarArgsType.cc'; else $(CYGPATH_W) '$(srcdir)/SynTree/VarArgsType.cc'; fi`2210 @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) SynTree/$(DEPDIR)/driver_cfa_cpp-VarArgsType.Tpo SynTree/$(DEPDIR)/driver_cfa_cpp-VarArgsType.Po2211 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='SynTree/VarArgsType.cc' object='SynTree/driver_cfa_cpp-VarArgsType.obj' libtool=no @AMDEPBACKSLASH@2212 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@2213 @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -c -o SynTree/driver_cfa_cpp-VarArgsType.obj `if test -f 'SynTree/VarArgsType.cc'; then $(CYGPATH_W) 'SynTree/VarArgsType.cc'; else $(CYGPATH_W) '$(srcdir)/SynTree/VarArgsType.cc'; fi`2214 2215 SynTree/driver_cfa_cpp-ZeroOneType.o: SynTree/ZeroOneType.cc2216 @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -MT SynTree/driver_cfa_cpp-ZeroOneType.o -MD -MP -MF SynTree/$(DEPDIR)/driver_cfa_cpp-ZeroOneType.Tpo -c -o SynTree/driver_cfa_cpp-ZeroOneType.o `test -f 'SynTree/ZeroOneType.cc' || echo '$(srcdir)/'`SynTree/ZeroOneType.cc2217 @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) SynTree/$(DEPDIR)/driver_cfa_cpp-ZeroOneType.Tpo SynTree/$(DEPDIR)/driver_cfa_cpp-ZeroOneType.Po2218 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='SynTree/ZeroOneType.cc' object='SynTree/driver_cfa_cpp-ZeroOneType.o' libtool=no @AMDEPBACKSLASH@2219 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@2220 @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -c -o SynTree/driver_cfa_cpp-ZeroOneType.o `test -f 'SynTree/ZeroOneType.cc' || echo '$(srcdir)/'`SynTree/ZeroOneType.cc2221 2222 SynTree/driver_cfa_cpp-ZeroOneType.obj: SynTree/ZeroOneType.cc2223 @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -MT SynTree/driver_cfa_cpp-ZeroOneType.obj -MD -MP -MF SynTree/$(DEPDIR)/driver_cfa_cpp-ZeroOneType.Tpo -c -o SynTree/driver_cfa_cpp-ZeroOneType.obj `if test -f 'SynTree/ZeroOneType.cc'; then $(CYGPATH_W) 'SynTree/ZeroOneType.cc'; else $(CYGPATH_W) '$(srcdir)/SynTree/ZeroOneType.cc'; fi`2224 @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) SynTree/$(DEPDIR)/driver_cfa_cpp-ZeroOneType.Tpo SynTree/$(DEPDIR)/driver_cfa_cpp-ZeroOneType.Po2225 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='SynTree/ZeroOneType.cc' object='SynTree/driver_cfa_cpp-ZeroOneType.obj' libtool=no @AMDEPBACKSLASH@2226 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@2227 @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -c -o SynTree/driver_cfa_cpp-ZeroOneType.obj `if test -f 'SynTree/ZeroOneType.cc'; then $(CYGPATH_W) 'SynTree/ZeroOneType.cc'; else $(CYGPATH_W) '$(srcdir)/SynTree/ZeroOneType.cc'; fi`2228 2229 SynTree/driver_cfa_cpp-Constant.o: SynTree/Constant.cc2230 @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -MT SynTree/driver_cfa_cpp-Constant.o -MD -MP -MF SynTree/$(DEPDIR)/driver_cfa_cpp-Constant.Tpo -c -o SynTree/driver_cfa_cpp-Constant.o `test -f 'SynTree/Constant.cc' || echo '$(srcdir)/'`SynTree/Constant.cc2231 @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) SynTree/$(DEPDIR)/driver_cfa_cpp-Constant.Tpo SynTree/$(DEPDIR)/driver_cfa_cpp-Constant.Po2232 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='SynTree/Constant.cc' object='SynTree/driver_cfa_cpp-Constant.o' libtool=no @AMDEPBACKSLASH@2233 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@2234 @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -c -o SynTree/driver_cfa_cpp-Constant.o `test -f 'SynTree/Constant.cc' || echo '$(srcdir)/'`SynTree/Constant.cc2235 2236 SynTree/driver_cfa_cpp-Constant.obj: SynTree/Constant.cc2237 @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -MT SynTree/driver_cfa_cpp-Constant.obj -MD -MP -MF SynTree/$(DEPDIR)/driver_cfa_cpp-Constant.Tpo -c -o SynTree/driver_cfa_cpp-Constant.obj `if test -f 'SynTree/Constant.cc'; then $(CYGPATH_W) 'SynTree/Constant.cc'; else $(CYGPATH_W) '$(srcdir)/SynTree/Constant.cc'; fi`2238 @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) SynTree/$(DEPDIR)/driver_cfa_cpp-Constant.Tpo SynTree/$(DEPDIR)/driver_cfa_cpp-Constant.Po2239 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='SynTree/Constant.cc' object='SynTree/driver_cfa_cpp-Constant.obj' libtool=no @AMDEPBACKSLASH@2240 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@2241 @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -c -o SynTree/driver_cfa_cpp-Constant.obj `if test -f 'SynTree/Constant.cc'; then $(CYGPATH_W) 'SynTree/Constant.cc'; else $(CYGPATH_W) '$(srcdir)/SynTree/Constant.cc'; fi`2242 2243 SynTree/driver_cfa_cpp-Expression.o: SynTree/Expression.cc2244 @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -MT SynTree/driver_cfa_cpp-Expression.o -MD -MP -MF SynTree/$(DEPDIR)/driver_cfa_cpp-Expression.Tpo -c -o SynTree/driver_cfa_cpp-Expression.o `test -f 'SynTree/Expression.cc' || echo '$(srcdir)/'`SynTree/Expression.cc2245 @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) SynTree/$(DEPDIR)/driver_cfa_cpp-Expression.Tpo SynTree/$(DEPDIR)/driver_cfa_cpp-Expression.Po2246 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='SynTree/Expression.cc' object='SynTree/driver_cfa_cpp-Expression.o' libtool=no @AMDEPBACKSLASH@2247 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@2248 @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -c -o SynTree/driver_cfa_cpp-Expression.o `test -f 'SynTree/Expression.cc' || echo '$(srcdir)/'`SynTree/Expression.cc2249 2250 SynTree/driver_cfa_cpp-Expression.obj: SynTree/Expression.cc2251 @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -MT SynTree/driver_cfa_cpp-Expression.obj -MD -MP -MF SynTree/$(DEPDIR)/driver_cfa_cpp-Expression.Tpo -c -o SynTree/driver_cfa_cpp-Expression.obj `if test -f 'SynTree/Expression.cc'; then $(CYGPATH_W) 'SynTree/Expression.cc'; else $(CYGPATH_W) '$(srcdir)/SynTree/Expression.cc'; fi`2252 @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) SynTree/$(DEPDIR)/driver_cfa_cpp-Expression.Tpo SynTree/$(DEPDIR)/driver_cfa_cpp-Expression.Po2253 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='SynTree/Expression.cc' object='SynTree/driver_cfa_cpp-Expression.obj' libtool=no @AMDEPBACKSLASH@2254 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@2255 @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -c -o SynTree/driver_cfa_cpp-Expression.obj `if test -f 'SynTree/Expression.cc'; then $(CYGPATH_W) 'SynTree/Expression.cc'; else $(CYGPATH_W) '$(srcdir)/SynTree/Expression.cc'; fi`2256 2257 SynTree/driver_cfa_cpp-TupleExpr.o: SynTree/TupleExpr.cc2258 @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -MT SynTree/driver_cfa_cpp-TupleExpr.o -MD -MP -MF SynTree/$(DEPDIR)/driver_cfa_cpp-TupleExpr.Tpo -c -o SynTree/driver_cfa_cpp-TupleExpr.o `test -f 'SynTree/TupleExpr.cc' || echo '$(srcdir)/'`SynTree/TupleExpr.cc2259 @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) SynTree/$(DEPDIR)/driver_cfa_cpp-TupleExpr.Tpo SynTree/$(DEPDIR)/driver_cfa_cpp-TupleExpr.Po2260 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='SynTree/TupleExpr.cc' object='SynTree/driver_cfa_cpp-TupleExpr.o' libtool=no @AMDEPBACKSLASH@2261 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@2262 @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -c -o SynTree/driver_cfa_cpp-TupleExpr.o `test -f 'SynTree/TupleExpr.cc' || echo '$(srcdir)/'`SynTree/TupleExpr.cc2263 2264 SynTree/driver_cfa_cpp-TupleExpr.obj: SynTree/TupleExpr.cc2265 @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -MT SynTree/driver_cfa_cpp-TupleExpr.obj -MD -MP -MF SynTree/$(DEPDIR)/driver_cfa_cpp-TupleExpr.Tpo -c -o SynTree/driver_cfa_cpp-TupleExpr.obj `if test -f 'SynTree/TupleExpr.cc'; then $(CYGPATH_W) 'SynTree/TupleExpr.cc'; else $(CYGPATH_W) '$(srcdir)/SynTree/TupleExpr.cc'; fi`2266 @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) SynTree/$(DEPDIR)/driver_cfa_cpp-TupleExpr.Tpo SynTree/$(DEPDIR)/driver_cfa_cpp-TupleExpr.Po2267 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='SynTree/TupleExpr.cc' object='SynTree/driver_cfa_cpp-TupleExpr.obj' libtool=no @AMDEPBACKSLASH@2268 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@2269 @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -c -o SynTree/driver_cfa_cpp-TupleExpr.obj `if test -f 'SynTree/TupleExpr.cc'; then $(CYGPATH_W) 'SynTree/TupleExpr.cc'; else $(CYGPATH_W) '$(srcdir)/SynTree/TupleExpr.cc'; fi`2270 2271 SynTree/driver_cfa_cpp-CommaExpr.o: SynTree/CommaExpr.cc2272 @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -MT SynTree/driver_cfa_cpp-CommaExpr.o -MD -MP -MF SynTree/$(DEPDIR)/driver_cfa_cpp-CommaExpr.Tpo -c -o SynTree/driver_cfa_cpp-CommaExpr.o `test -f 'SynTree/CommaExpr.cc' || echo '$(srcdir)/'`SynTree/CommaExpr.cc2273 @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) SynTree/$(DEPDIR)/driver_cfa_cpp-CommaExpr.Tpo SynTree/$(DEPDIR)/driver_cfa_cpp-CommaExpr.Po2274 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='SynTree/CommaExpr.cc' object='SynTree/driver_cfa_cpp-CommaExpr.o' libtool=no @AMDEPBACKSLASH@2275 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@2276 @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -c -o SynTree/driver_cfa_cpp-CommaExpr.o `test -f 'SynTree/CommaExpr.cc' || echo '$(srcdir)/'`SynTree/CommaExpr.cc2277 2278 SynTree/driver_cfa_cpp-CommaExpr.obj: SynTree/CommaExpr.cc2279 @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -MT SynTree/driver_cfa_cpp-CommaExpr.obj -MD -MP -MF SynTree/$(DEPDIR)/driver_cfa_cpp-CommaExpr.Tpo -c -o SynTree/driver_cfa_cpp-CommaExpr.obj `if test -f 'SynTree/CommaExpr.cc'; then $(CYGPATH_W) 'SynTree/CommaExpr.cc'; else $(CYGPATH_W) '$(srcdir)/SynTree/CommaExpr.cc'; fi`2280 @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) SynTree/$(DEPDIR)/driver_cfa_cpp-CommaExpr.Tpo SynTree/$(DEPDIR)/driver_cfa_cpp-CommaExpr.Po2281 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='SynTree/CommaExpr.cc' object='SynTree/driver_cfa_cpp-CommaExpr.obj' libtool=no @AMDEPBACKSLASH@2282 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@2283 @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -c -o SynTree/driver_cfa_cpp-CommaExpr.obj `if test -f 'SynTree/CommaExpr.cc'; then $(CYGPATH_W) 'SynTree/CommaExpr.cc'; else $(CYGPATH_W) '$(srcdir)/SynTree/CommaExpr.cc'; fi`2284 2285 SynTree/driver_cfa_cpp-TypeExpr.o: SynTree/TypeExpr.cc2286 @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -MT SynTree/driver_cfa_cpp-TypeExpr.o -MD -MP -MF SynTree/$(DEPDIR)/driver_cfa_cpp-TypeExpr.Tpo -c -o SynTree/driver_cfa_cpp-TypeExpr.o `test -f 'SynTree/TypeExpr.cc' || echo '$(srcdir)/'`SynTree/TypeExpr.cc2287 @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) SynTree/$(DEPDIR)/driver_cfa_cpp-TypeExpr.Tpo SynTree/$(DEPDIR)/driver_cfa_cpp-TypeExpr.Po2288 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='SynTree/TypeExpr.cc' object='SynTree/driver_cfa_cpp-TypeExpr.o' libtool=no @AMDEPBACKSLASH@2289 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@2290 @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -c -o SynTree/driver_cfa_cpp-TypeExpr.o `test -f 'SynTree/TypeExpr.cc' || echo '$(srcdir)/'`SynTree/TypeExpr.cc2291 2292 SynTree/driver_cfa_cpp-TypeExpr.obj: SynTree/TypeExpr.cc2293 @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -MT SynTree/driver_cfa_cpp-TypeExpr.obj -MD -MP -MF SynTree/$(DEPDIR)/driver_cfa_cpp-TypeExpr.Tpo -c -o SynTree/driver_cfa_cpp-TypeExpr.obj `if test -f 'SynTree/TypeExpr.cc'; then $(CYGPATH_W) 'SynTree/TypeExpr.cc'; else $(CYGPATH_W) '$(srcdir)/SynTree/TypeExpr.cc'; fi`2294 @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) SynTree/$(DEPDIR)/driver_cfa_cpp-TypeExpr.Tpo SynTree/$(DEPDIR)/driver_cfa_cpp-TypeExpr.Po2295 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='SynTree/TypeExpr.cc' object='SynTree/driver_cfa_cpp-TypeExpr.obj' libtool=no @AMDEPBACKSLASH@2296 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@2297 @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -c -o SynTree/driver_cfa_cpp-TypeExpr.obj `if test -f 'SynTree/TypeExpr.cc'; then $(CYGPATH_W) 'SynTree/TypeExpr.cc'; else $(CYGPATH_W) '$(srcdir)/SynTree/TypeExpr.cc'; fi`2298 2299 SynTree/driver_cfa_cpp-ApplicationExpr.o: SynTree/ApplicationExpr.cc2300 @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -MT SynTree/driver_cfa_cpp-ApplicationExpr.o -MD -MP -MF SynTree/$(DEPDIR)/driver_cfa_cpp-ApplicationExpr.Tpo -c -o SynTree/driver_cfa_cpp-ApplicationExpr.o `test -f 'SynTree/ApplicationExpr.cc' || echo '$(srcdir)/'`SynTree/ApplicationExpr.cc2301 @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) SynTree/$(DEPDIR)/driver_cfa_cpp-ApplicationExpr.Tpo SynTree/$(DEPDIR)/driver_cfa_cpp-ApplicationExpr.Po2302 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='SynTree/ApplicationExpr.cc' object='SynTree/driver_cfa_cpp-ApplicationExpr.o' libtool=no @AMDEPBACKSLASH@2303 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@2304 @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -c -o SynTree/driver_cfa_cpp-ApplicationExpr.o `test -f 'SynTree/ApplicationExpr.cc' || echo '$(srcdir)/'`SynTree/ApplicationExpr.cc2305 2306 SynTree/driver_cfa_cpp-ApplicationExpr.obj: SynTree/ApplicationExpr.cc2307 @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -MT SynTree/driver_cfa_cpp-ApplicationExpr.obj -MD -MP -MF SynTree/$(DEPDIR)/driver_cfa_cpp-ApplicationExpr.Tpo -c -o SynTree/driver_cfa_cpp-ApplicationExpr.obj `if test -f 'SynTree/ApplicationExpr.cc'; then $(CYGPATH_W) 'SynTree/ApplicationExpr.cc'; else $(CYGPATH_W) '$(srcdir)/SynTree/ApplicationExpr.cc'; fi`2308 @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) SynTree/$(DEPDIR)/driver_cfa_cpp-ApplicationExpr.Tpo SynTree/$(DEPDIR)/driver_cfa_cpp-ApplicationExpr.Po2309 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='SynTree/ApplicationExpr.cc' object='SynTree/driver_cfa_cpp-ApplicationExpr.obj' libtool=no @AMDEPBACKSLASH@2310 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@2311 @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -c -o SynTree/driver_cfa_cpp-ApplicationExpr.obj `if test -f 'SynTree/ApplicationExpr.cc'; then $(CYGPATH_W) 'SynTree/ApplicationExpr.cc'; else $(CYGPATH_W) '$(srcdir)/SynTree/ApplicationExpr.cc'; fi`2312 2313 SynTree/driver_cfa_cpp-AddressExpr.o: SynTree/AddressExpr.cc2314 @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -MT SynTree/driver_cfa_cpp-AddressExpr.o -MD -MP -MF SynTree/$(DEPDIR)/driver_cfa_cpp-AddressExpr.Tpo -c -o SynTree/driver_cfa_cpp-AddressExpr.o `test -f 'SynTree/AddressExpr.cc' || echo '$(srcdir)/'`SynTree/AddressExpr.cc2315 @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) SynTree/$(DEPDIR)/driver_cfa_cpp-AddressExpr.Tpo SynTree/$(DEPDIR)/driver_cfa_cpp-AddressExpr.Po2316 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='SynTree/AddressExpr.cc' object='SynTree/driver_cfa_cpp-AddressExpr.o' libtool=no @AMDEPBACKSLASH@2317 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@2318 @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -c -o SynTree/driver_cfa_cpp-AddressExpr.o `test -f 'SynTree/AddressExpr.cc' || echo '$(srcdir)/'`SynTree/AddressExpr.cc2319 2320 SynTree/driver_cfa_cpp-AddressExpr.obj: SynTree/AddressExpr.cc2321 @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -MT SynTree/driver_cfa_cpp-AddressExpr.obj -MD -MP -MF SynTree/$(DEPDIR)/driver_cfa_cpp-AddressExpr.Tpo -c -o SynTree/driver_cfa_cpp-AddressExpr.obj `if test -f 'SynTree/AddressExpr.cc'; then $(CYGPATH_W) 'SynTree/AddressExpr.cc'; else $(CYGPATH_W) '$(srcdir)/SynTree/AddressExpr.cc'; fi`2322 @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) SynTree/$(DEPDIR)/driver_cfa_cpp-AddressExpr.Tpo SynTree/$(DEPDIR)/driver_cfa_cpp-AddressExpr.Po2323 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='SynTree/AddressExpr.cc' object='SynTree/driver_cfa_cpp-AddressExpr.obj' libtool=no @AMDEPBACKSLASH@2324 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@2325 @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -c -o SynTree/driver_cfa_cpp-AddressExpr.obj `if test -f 'SynTree/AddressExpr.cc'; then $(CYGPATH_W) 'SynTree/AddressExpr.cc'; else $(CYGPATH_W) '$(srcdir)/SynTree/AddressExpr.cc'; fi`2326 2327 SynTree/driver_cfa_cpp-Statement.o: SynTree/Statement.cc2328 @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -MT SynTree/driver_cfa_cpp-Statement.o -MD -MP -MF SynTree/$(DEPDIR)/driver_cfa_cpp-Statement.Tpo -c -o SynTree/driver_cfa_cpp-Statement.o `test -f 'SynTree/Statement.cc' || echo '$(srcdir)/'`SynTree/Statement.cc2329 @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) SynTree/$(DEPDIR)/driver_cfa_cpp-Statement.Tpo SynTree/$(DEPDIR)/driver_cfa_cpp-Statement.Po2330 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='SynTree/Statement.cc' object='SynTree/driver_cfa_cpp-Statement.o' libtool=no @AMDEPBACKSLASH@2331 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@2332 @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -c -o SynTree/driver_cfa_cpp-Statement.o `test -f 'SynTree/Statement.cc' || echo '$(srcdir)/'`SynTree/Statement.cc2333 2334 SynTree/driver_cfa_cpp-Statement.obj: SynTree/Statement.cc2335 @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -MT SynTree/driver_cfa_cpp-Statement.obj -MD -MP -MF SynTree/$(DEPDIR)/driver_cfa_cpp-Statement.Tpo -c -o SynTree/driver_cfa_cpp-Statement.obj `if test -f 'SynTree/Statement.cc'; then $(CYGPATH_W) 'SynTree/Statement.cc'; else $(CYGPATH_W) '$(srcdir)/SynTree/Statement.cc'; fi`2336 @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) SynTree/$(DEPDIR)/driver_cfa_cpp-Statement.Tpo SynTree/$(DEPDIR)/driver_cfa_cpp-Statement.Po2337 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='SynTree/Statement.cc' object='SynTree/driver_cfa_cpp-Statement.obj' libtool=no @AMDEPBACKSLASH@2338 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@2339 @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -c -o SynTree/driver_cfa_cpp-Statement.obj `if test -f 'SynTree/Statement.cc'; then $(CYGPATH_W) 'SynTree/Statement.cc'; else $(CYGPATH_W) '$(srcdir)/SynTree/Statement.cc'; fi`2340 2341 SynTree/driver_cfa_cpp-CompoundStmt.o: SynTree/CompoundStmt.cc2342 @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -MT SynTree/driver_cfa_cpp-CompoundStmt.o -MD -MP -MF SynTree/$(DEPDIR)/driver_cfa_cpp-CompoundStmt.Tpo -c -o SynTree/driver_cfa_cpp-CompoundStmt.o `test -f 'SynTree/CompoundStmt.cc' || echo '$(srcdir)/'`SynTree/CompoundStmt.cc2343 @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) SynTree/$(DEPDIR)/driver_cfa_cpp-CompoundStmt.Tpo SynTree/$(DEPDIR)/driver_cfa_cpp-CompoundStmt.Po2344 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='SynTree/CompoundStmt.cc' object='SynTree/driver_cfa_cpp-CompoundStmt.o' libtool=no @AMDEPBACKSLASH@2345 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@2346 @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -c -o SynTree/driver_cfa_cpp-CompoundStmt.o `test -f 'SynTree/CompoundStmt.cc' || echo '$(srcdir)/'`SynTree/CompoundStmt.cc2347 2348 SynTree/driver_cfa_cpp-CompoundStmt.obj: SynTree/CompoundStmt.cc2349 @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -MT SynTree/driver_cfa_cpp-CompoundStmt.obj -MD -MP -MF SynTree/$(DEPDIR)/driver_cfa_cpp-CompoundStmt.Tpo -c -o SynTree/driver_cfa_cpp-CompoundStmt.obj `if test -f 'SynTree/CompoundStmt.cc'; then $(CYGPATH_W) 'SynTree/CompoundStmt.cc'; else $(CYGPATH_W) '$(srcdir)/SynTree/CompoundStmt.cc'; fi`2350 @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) SynTree/$(DEPDIR)/driver_cfa_cpp-CompoundStmt.Tpo SynTree/$(DEPDIR)/driver_cfa_cpp-CompoundStmt.Po2351 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='SynTree/CompoundStmt.cc' object='SynTree/driver_cfa_cpp-CompoundStmt.obj' libtool=no @AMDEPBACKSLASH@2352 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@2353 @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -c -o SynTree/driver_cfa_cpp-CompoundStmt.obj `if test -f 'SynTree/CompoundStmt.cc'; then $(CYGPATH_W) 'SynTree/CompoundStmt.cc'; else $(CYGPATH_W) '$(srcdir)/SynTree/CompoundStmt.cc'; fi`2354 2355 SynTree/driver_cfa_cpp-DeclStmt.o: SynTree/DeclStmt.cc2356 @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -MT SynTree/driver_cfa_cpp-DeclStmt.o -MD -MP -MF SynTree/$(DEPDIR)/driver_cfa_cpp-DeclStmt.Tpo -c -o SynTree/driver_cfa_cpp-DeclStmt.o `test -f 'SynTree/DeclStmt.cc' || echo '$(srcdir)/'`SynTree/DeclStmt.cc2357 @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) SynTree/$(DEPDIR)/driver_cfa_cpp-DeclStmt.Tpo SynTree/$(DEPDIR)/driver_cfa_cpp-DeclStmt.Po2358 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='SynTree/DeclStmt.cc' object='SynTree/driver_cfa_cpp-DeclStmt.o' libtool=no @AMDEPBACKSLASH@2359 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@2360 @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -c -o SynTree/driver_cfa_cpp-DeclStmt.o `test -f 'SynTree/DeclStmt.cc' || echo '$(srcdir)/'`SynTree/DeclStmt.cc2361 2362 SynTree/driver_cfa_cpp-DeclStmt.obj: SynTree/DeclStmt.cc2363 @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -MT SynTree/driver_cfa_cpp-DeclStmt.obj -MD -MP -MF SynTree/$(DEPDIR)/driver_cfa_cpp-DeclStmt.Tpo -c -o SynTree/driver_cfa_cpp-DeclStmt.obj `if test -f 'SynTree/DeclStmt.cc'; then $(CYGPATH_W) 'SynTree/DeclStmt.cc'; else $(CYGPATH_W) '$(srcdir)/SynTree/DeclStmt.cc'; fi`2364 @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) SynTree/$(DEPDIR)/driver_cfa_cpp-DeclStmt.Tpo SynTree/$(DEPDIR)/driver_cfa_cpp-DeclStmt.Po2365 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='SynTree/DeclStmt.cc' object='SynTree/driver_cfa_cpp-DeclStmt.obj' libtool=no @AMDEPBACKSLASH@2366 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@2367 @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -c -o SynTree/driver_cfa_cpp-DeclStmt.obj `if test -f 'SynTree/DeclStmt.cc'; then $(CYGPATH_W) 'SynTree/DeclStmt.cc'; else $(CYGPATH_W) '$(srcdir)/SynTree/DeclStmt.cc'; fi`2368 2369 SynTree/driver_cfa_cpp-Declaration.o: SynTree/Declaration.cc2370 @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -MT SynTree/driver_cfa_cpp-Declaration.o -MD -MP -MF SynTree/$(DEPDIR)/driver_cfa_cpp-Declaration.Tpo -c -o SynTree/driver_cfa_cpp-Declaration.o `test -f 'SynTree/Declaration.cc' || echo '$(srcdir)/'`SynTree/Declaration.cc2371 @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) SynTree/$(DEPDIR)/driver_cfa_cpp-Declaration.Tpo SynTree/$(DEPDIR)/driver_cfa_cpp-Declaration.Po2372 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='SynTree/Declaration.cc' object='SynTree/driver_cfa_cpp-Declaration.o' libtool=no @AMDEPBACKSLASH@2373 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@2374 @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -c -o SynTree/driver_cfa_cpp-Declaration.o `test -f 'SynTree/Declaration.cc' || echo '$(srcdir)/'`SynTree/Declaration.cc2375 2376 SynTree/driver_cfa_cpp-Declaration.obj: SynTree/Declaration.cc2377 @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -MT SynTree/driver_cfa_cpp-Declaration.obj -MD -MP -MF SynTree/$(DEPDIR)/driver_cfa_cpp-Declaration.Tpo -c -o SynTree/driver_cfa_cpp-Declaration.obj `if test -f 'SynTree/Declaration.cc'; then $(CYGPATH_W) 'SynTree/Declaration.cc'; else $(CYGPATH_W) '$(srcdir)/SynTree/Declaration.cc'; fi`2378 @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) SynTree/$(DEPDIR)/driver_cfa_cpp-Declaration.Tpo SynTree/$(DEPDIR)/driver_cfa_cpp-Declaration.Po2379 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='SynTree/Declaration.cc' object='SynTree/driver_cfa_cpp-Declaration.obj' libtool=no @AMDEPBACKSLASH@2380 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@2381 @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -c -o SynTree/driver_cfa_cpp-Declaration.obj `if test -f 'SynTree/Declaration.cc'; then $(CYGPATH_W) 'SynTree/Declaration.cc'; else $(CYGPATH_W) '$(srcdir)/SynTree/Declaration.cc'; fi`2382 2383 SynTree/driver_cfa_cpp-DeclarationWithType.o: SynTree/DeclarationWithType.cc2384 @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -MT SynTree/driver_cfa_cpp-DeclarationWithType.o -MD -MP -MF SynTree/$(DEPDIR)/driver_cfa_cpp-DeclarationWithType.Tpo -c -o SynTree/driver_cfa_cpp-DeclarationWithType.o `test -f 'SynTree/DeclarationWithType.cc' || echo '$(srcdir)/'`SynTree/DeclarationWithType.cc2385 @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) SynTree/$(DEPDIR)/driver_cfa_cpp-DeclarationWithType.Tpo SynTree/$(DEPDIR)/driver_cfa_cpp-DeclarationWithType.Po2386 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='SynTree/DeclarationWithType.cc' object='SynTree/driver_cfa_cpp-DeclarationWithType.o' libtool=no @AMDEPBACKSLASH@2387 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@2388 @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -c -o SynTree/driver_cfa_cpp-DeclarationWithType.o `test -f 'SynTree/DeclarationWithType.cc' || echo '$(srcdir)/'`SynTree/DeclarationWithType.cc2389 2390 SynTree/driver_cfa_cpp-DeclarationWithType.obj: SynTree/DeclarationWithType.cc2391 @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -MT SynTree/driver_cfa_cpp-DeclarationWithType.obj -MD -MP -MF SynTree/$(DEPDIR)/driver_cfa_cpp-DeclarationWithType.Tpo -c -o SynTree/driver_cfa_cpp-DeclarationWithType.obj `if test -f 'SynTree/DeclarationWithType.cc'; then $(CYGPATH_W) 'SynTree/DeclarationWithType.cc'; else $(CYGPATH_W) '$(srcdir)/SynTree/DeclarationWithType.cc'; fi`2392 @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) SynTree/$(DEPDIR)/driver_cfa_cpp-DeclarationWithType.Tpo SynTree/$(DEPDIR)/driver_cfa_cpp-DeclarationWithType.Po2393 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='SynTree/DeclarationWithType.cc' object='SynTree/driver_cfa_cpp-DeclarationWithType.obj' libtool=no @AMDEPBACKSLASH@2394 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@2395 @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -c -o SynTree/driver_cfa_cpp-DeclarationWithType.obj `if test -f 'SynTree/DeclarationWithType.cc'; then $(CYGPATH_W) 'SynTree/DeclarationWithType.cc'; else $(CYGPATH_W) '$(srcdir)/SynTree/DeclarationWithType.cc'; fi`2396 2397 SynTree/driver_cfa_cpp-ObjectDecl.o: SynTree/ObjectDecl.cc2398 @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -MT SynTree/driver_cfa_cpp-ObjectDecl.o -MD -MP -MF SynTree/$(DEPDIR)/driver_cfa_cpp-ObjectDecl.Tpo -c -o SynTree/driver_cfa_cpp-ObjectDecl.o `test -f 'SynTree/ObjectDecl.cc' || echo '$(srcdir)/'`SynTree/ObjectDecl.cc2399 @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) SynTree/$(DEPDIR)/driver_cfa_cpp-ObjectDecl.Tpo SynTree/$(DEPDIR)/driver_cfa_cpp-ObjectDecl.Po2400 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='SynTree/ObjectDecl.cc' object='SynTree/driver_cfa_cpp-ObjectDecl.o' libtool=no @AMDEPBACKSLASH@2401 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@2402 @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -c -o SynTree/driver_cfa_cpp-ObjectDecl.o `test -f 'SynTree/ObjectDecl.cc' || echo '$(srcdir)/'`SynTree/ObjectDecl.cc2403 2404 SynTree/driver_cfa_cpp-ObjectDecl.obj: SynTree/ObjectDecl.cc2405 @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -MT SynTree/driver_cfa_cpp-ObjectDecl.obj -MD -MP -MF SynTree/$(DEPDIR)/driver_cfa_cpp-ObjectDecl.Tpo -c -o SynTree/driver_cfa_cpp-ObjectDecl.obj `if test -f 'SynTree/ObjectDecl.cc'; then $(CYGPATH_W) 'SynTree/ObjectDecl.cc'; else $(CYGPATH_W) '$(srcdir)/SynTree/ObjectDecl.cc'; fi`2406 @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) SynTree/$(DEPDIR)/driver_cfa_cpp-ObjectDecl.Tpo SynTree/$(DEPDIR)/driver_cfa_cpp-ObjectDecl.Po2407 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='SynTree/ObjectDecl.cc' object='SynTree/driver_cfa_cpp-ObjectDecl.obj' libtool=no @AMDEPBACKSLASH@2408 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@2409 @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -c -o SynTree/driver_cfa_cpp-ObjectDecl.obj `if test -f 'SynTree/ObjectDecl.cc'; then $(CYGPATH_W) 'SynTree/ObjectDecl.cc'; else $(CYGPATH_W) '$(srcdir)/SynTree/ObjectDecl.cc'; fi`2410 2411 SynTree/driver_cfa_cpp-FunctionDecl.o: SynTree/FunctionDecl.cc2412 @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -MT SynTree/driver_cfa_cpp-FunctionDecl.o -MD -MP -MF SynTree/$(DEPDIR)/driver_cfa_cpp-FunctionDecl.Tpo -c -o SynTree/driver_cfa_cpp-FunctionDecl.o `test -f 'SynTree/FunctionDecl.cc' || echo '$(srcdir)/'`SynTree/FunctionDecl.cc2413 @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) SynTree/$(DEPDIR)/driver_cfa_cpp-FunctionDecl.Tpo SynTree/$(DEPDIR)/driver_cfa_cpp-FunctionDecl.Po2414 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='SynTree/FunctionDecl.cc' object='SynTree/driver_cfa_cpp-FunctionDecl.o' libtool=no @AMDEPBACKSLASH@2415 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@2416 @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -c -o SynTree/driver_cfa_cpp-FunctionDecl.o `test -f 'SynTree/FunctionDecl.cc' || echo '$(srcdir)/'`SynTree/FunctionDecl.cc2417 2418 SynTree/driver_cfa_cpp-FunctionDecl.obj: SynTree/FunctionDecl.cc2419 @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -MT SynTree/driver_cfa_cpp-FunctionDecl.obj -MD -MP -MF SynTree/$(DEPDIR)/driver_cfa_cpp-FunctionDecl.Tpo -c -o SynTree/driver_cfa_cpp-FunctionDecl.obj `if test -f 'SynTree/FunctionDecl.cc'; then $(CYGPATH_W) 'SynTree/FunctionDecl.cc'; else $(CYGPATH_W) '$(srcdir)/SynTree/FunctionDecl.cc'; fi`2420 @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) SynTree/$(DEPDIR)/driver_cfa_cpp-FunctionDecl.Tpo SynTree/$(DEPDIR)/driver_cfa_cpp-FunctionDecl.Po2421 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='SynTree/FunctionDecl.cc' object='SynTree/driver_cfa_cpp-FunctionDecl.obj' libtool=no @AMDEPBACKSLASH@2422 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@2423 @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -c -o SynTree/driver_cfa_cpp-FunctionDecl.obj `if test -f 'SynTree/FunctionDecl.cc'; then $(CYGPATH_W) 'SynTree/FunctionDecl.cc'; else $(CYGPATH_W) '$(srcdir)/SynTree/FunctionDecl.cc'; fi`2424 2425 SynTree/driver_cfa_cpp-AggregateDecl.o: SynTree/AggregateDecl.cc2426 @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -MT SynTree/driver_cfa_cpp-AggregateDecl.o -MD -MP -MF SynTree/$(DEPDIR)/driver_cfa_cpp-AggregateDecl.Tpo -c -o SynTree/driver_cfa_cpp-AggregateDecl.o `test -f 'SynTree/AggregateDecl.cc' || echo '$(srcdir)/'`SynTree/AggregateDecl.cc2427 @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) SynTree/$(DEPDIR)/driver_cfa_cpp-AggregateDecl.Tpo SynTree/$(DEPDIR)/driver_cfa_cpp-AggregateDecl.Po2428 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='SynTree/AggregateDecl.cc' object='SynTree/driver_cfa_cpp-AggregateDecl.o' libtool=no @AMDEPBACKSLASH@2429 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@2430 @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -c -o SynTree/driver_cfa_cpp-AggregateDecl.o `test -f 'SynTree/AggregateDecl.cc' || echo '$(srcdir)/'`SynTree/AggregateDecl.cc2431 2432 SynTree/driver_cfa_cpp-AggregateDecl.obj: SynTree/AggregateDecl.cc2433 @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -MT SynTree/driver_cfa_cpp-AggregateDecl.obj -MD -MP -MF SynTree/$(DEPDIR)/driver_cfa_cpp-AggregateDecl.Tpo -c -o SynTree/driver_cfa_cpp-AggregateDecl.obj `if test -f 'SynTree/AggregateDecl.cc'; then $(CYGPATH_W) 'SynTree/AggregateDecl.cc'; else $(CYGPATH_W) '$(srcdir)/SynTree/AggregateDecl.cc'; fi`2434 @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) SynTree/$(DEPDIR)/driver_cfa_cpp-AggregateDecl.Tpo SynTree/$(DEPDIR)/driver_cfa_cpp-AggregateDecl.Po2435 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='SynTree/AggregateDecl.cc' object='SynTree/driver_cfa_cpp-AggregateDecl.obj' libtool=no @AMDEPBACKSLASH@2436 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@2437 @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -c -o SynTree/driver_cfa_cpp-AggregateDecl.obj `if test -f 'SynTree/AggregateDecl.cc'; then $(CYGPATH_W) 'SynTree/AggregateDecl.cc'; else $(CYGPATH_W) '$(srcdir)/SynTree/AggregateDecl.cc'; fi`2438 2439 SynTree/driver_cfa_cpp-NamedTypeDecl.o: SynTree/NamedTypeDecl.cc2440 @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -MT SynTree/driver_cfa_cpp-NamedTypeDecl.o -MD -MP -MF SynTree/$(DEPDIR)/driver_cfa_cpp-NamedTypeDecl.Tpo -c -o SynTree/driver_cfa_cpp-NamedTypeDecl.o `test -f 'SynTree/NamedTypeDecl.cc' || echo '$(srcdir)/'`SynTree/NamedTypeDecl.cc2441 @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) SynTree/$(DEPDIR)/driver_cfa_cpp-NamedTypeDecl.Tpo SynTree/$(DEPDIR)/driver_cfa_cpp-NamedTypeDecl.Po2442 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='SynTree/NamedTypeDecl.cc' object='SynTree/driver_cfa_cpp-NamedTypeDecl.o' libtool=no @AMDEPBACKSLASH@2443 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@2444 @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -c -o SynTree/driver_cfa_cpp-NamedTypeDecl.o `test -f 'SynTree/NamedTypeDecl.cc' || echo '$(srcdir)/'`SynTree/NamedTypeDecl.cc2445 2446 SynTree/driver_cfa_cpp-NamedTypeDecl.obj: SynTree/NamedTypeDecl.cc2447 @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -MT SynTree/driver_cfa_cpp-NamedTypeDecl.obj -MD -MP -MF SynTree/$(DEPDIR)/driver_cfa_cpp-NamedTypeDecl.Tpo -c -o SynTree/driver_cfa_cpp-NamedTypeDecl.obj `if test -f 'SynTree/NamedTypeDecl.cc'; then $(CYGPATH_W) 'SynTree/NamedTypeDecl.cc'; else $(CYGPATH_W) '$(srcdir)/SynTree/NamedTypeDecl.cc'; fi`2448 @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) SynTree/$(DEPDIR)/driver_cfa_cpp-NamedTypeDecl.Tpo SynTree/$(DEPDIR)/driver_cfa_cpp-NamedTypeDecl.Po2449 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='SynTree/NamedTypeDecl.cc' object='SynTree/driver_cfa_cpp-NamedTypeDecl.obj' libtool=no @AMDEPBACKSLASH@2450 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@2451 @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -c -o SynTree/driver_cfa_cpp-NamedTypeDecl.obj `if test -f 'SynTree/NamedTypeDecl.cc'; then $(CYGPATH_W) 'SynTree/NamedTypeDecl.cc'; else $(CYGPATH_W) '$(srcdir)/SynTree/NamedTypeDecl.cc'; fi`2452 2453 SynTree/driver_cfa_cpp-TypeDecl.o: SynTree/TypeDecl.cc2454 @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -MT SynTree/driver_cfa_cpp-TypeDecl.o -MD -MP -MF SynTree/$(DEPDIR)/driver_cfa_cpp-TypeDecl.Tpo -c -o SynTree/driver_cfa_cpp-TypeDecl.o `test -f 'SynTree/TypeDecl.cc' || echo '$(srcdir)/'`SynTree/TypeDecl.cc2455 @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) SynTree/$(DEPDIR)/driver_cfa_cpp-TypeDecl.Tpo SynTree/$(DEPDIR)/driver_cfa_cpp-TypeDecl.Po2456 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='SynTree/TypeDecl.cc' object='SynTree/driver_cfa_cpp-TypeDecl.o' libtool=no @AMDEPBACKSLASH@2457 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@2458 @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -c -o SynTree/driver_cfa_cpp-TypeDecl.o `test -f 'SynTree/TypeDecl.cc' || echo '$(srcdir)/'`SynTree/TypeDecl.cc2459 2460 SynTree/driver_cfa_cpp-TypeDecl.obj: SynTree/TypeDecl.cc2461 @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -MT SynTree/driver_cfa_cpp-TypeDecl.obj -MD -MP -MF SynTree/$(DEPDIR)/driver_cfa_cpp-TypeDecl.Tpo -c -o SynTree/driver_cfa_cpp-TypeDecl.obj `if test -f 'SynTree/TypeDecl.cc'; then $(CYGPATH_W) 'SynTree/TypeDecl.cc'; else $(CYGPATH_W) '$(srcdir)/SynTree/TypeDecl.cc'; fi`2462 @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) SynTree/$(DEPDIR)/driver_cfa_cpp-TypeDecl.Tpo SynTree/$(DEPDIR)/driver_cfa_cpp-TypeDecl.Po2463 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='SynTree/TypeDecl.cc' object='SynTree/driver_cfa_cpp-TypeDecl.obj' libtool=no @AMDEPBACKSLASH@2464 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@2465 @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -c -o SynTree/driver_cfa_cpp-TypeDecl.obj `if test -f 'SynTree/TypeDecl.cc'; then $(CYGPATH_W) 'SynTree/TypeDecl.cc'; else $(CYGPATH_W) '$(srcdir)/SynTree/TypeDecl.cc'; fi`2466 2467 SynTree/driver_cfa_cpp-Initializer.o: SynTree/Initializer.cc2468 @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -MT SynTree/driver_cfa_cpp-Initializer.o -MD -MP -MF SynTree/$(DEPDIR)/driver_cfa_cpp-Initializer.Tpo -c -o SynTree/driver_cfa_cpp-Initializer.o `test -f 'SynTree/Initializer.cc' || echo '$(srcdir)/'`SynTree/Initializer.cc2469 @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) SynTree/$(DEPDIR)/driver_cfa_cpp-Initializer.Tpo SynTree/$(DEPDIR)/driver_cfa_cpp-Initializer.Po2470 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='SynTree/Initializer.cc' object='SynTree/driver_cfa_cpp-Initializer.o' libtool=no @AMDEPBACKSLASH@2471 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@2472 @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -c -o SynTree/driver_cfa_cpp-Initializer.o `test -f 'SynTree/Initializer.cc' || echo '$(srcdir)/'`SynTree/Initializer.cc2473 2474 SynTree/driver_cfa_cpp-Initializer.obj: SynTree/Initializer.cc2475 @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -MT SynTree/driver_cfa_cpp-Initializer.obj -MD -MP -MF SynTree/$(DEPDIR)/driver_cfa_cpp-Initializer.Tpo -c -o SynTree/driver_cfa_cpp-Initializer.obj `if test -f 'SynTree/Initializer.cc'; then $(CYGPATH_W) 'SynTree/Initializer.cc'; else $(CYGPATH_W) '$(srcdir)/SynTree/Initializer.cc'; fi`2476 @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) SynTree/$(DEPDIR)/driver_cfa_cpp-Initializer.Tpo SynTree/$(DEPDIR)/driver_cfa_cpp-Initializer.Po2477 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='SynTree/Initializer.cc' object='SynTree/driver_cfa_cpp-Initializer.obj' libtool=no @AMDEPBACKSLASH@2478 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@2479 @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -c -o SynTree/driver_cfa_cpp-Initializer.obj `if test -f 'SynTree/Initializer.cc'; then $(CYGPATH_W) 'SynTree/Initializer.cc'; else $(CYGPATH_W) '$(srcdir)/SynTree/Initializer.cc'; fi`2480 2481 SynTree/driver_cfa_cpp-Visitor.o: SynTree/Visitor.cc2482 @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -MT SynTree/driver_cfa_cpp-Visitor.o -MD -MP -MF SynTree/$(DEPDIR)/driver_cfa_cpp-Visitor.Tpo -c -o SynTree/driver_cfa_cpp-Visitor.o `test -f 'SynTree/Visitor.cc' || echo '$(srcdir)/'`SynTree/Visitor.cc2483 @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) SynTree/$(DEPDIR)/driver_cfa_cpp-Visitor.Tpo SynTree/$(DEPDIR)/driver_cfa_cpp-Visitor.Po2484 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='SynTree/Visitor.cc' object='SynTree/driver_cfa_cpp-Visitor.o' libtool=no @AMDEPBACKSLASH@2485 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@2486 @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -c -o SynTree/driver_cfa_cpp-Visitor.o `test -f 'SynTree/Visitor.cc' || echo '$(srcdir)/'`SynTree/Visitor.cc2487 2488 SynTree/driver_cfa_cpp-Visitor.obj: SynTree/Visitor.cc2489 @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -MT SynTree/driver_cfa_cpp-Visitor.obj -MD -MP -MF SynTree/$(DEPDIR)/driver_cfa_cpp-Visitor.Tpo -c -o SynTree/driver_cfa_cpp-Visitor.obj `if test -f 'SynTree/Visitor.cc'; then $(CYGPATH_W) 'SynTree/Visitor.cc'; else $(CYGPATH_W) '$(srcdir)/SynTree/Visitor.cc'; fi`2490 @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) SynTree/$(DEPDIR)/driver_cfa_cpp-Visitor.Tpo SynTree/$(DEPDIR)/driver_cfa_cpp-Visitor.Po2491 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='SynTree/Visitor.cc' object='SynTree/driver_cfa_cpp-Visitor.obj' libtool=no @AMDEPBACKSLASH@2492 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@2493 @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -c -o SynTree/driver_cfa_cpp-Visitor.obj `if test -f 'SynTree/Visitor.cc'; then $(CYGPATH_W) 'SynTree/Visitor.cc'; else $(CYGPATH_W) '$(srcdir)/SynTree/Visitor.cc'; fi`2494 2495 SynTree/driver_cfa_cpp-Mutator.o: SynTree/Mutator.cc2496 @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -MT SynTree/driver_cfa_cpp-Mutator.o -MD -MP -MF SynTree/$(DEPDIR)/driver_cfa_cpp-Mutator.Tpo -c -o SynTree/driver_cfa_cpp-Mutator.o `test -f 'SynTree/Mutator.cc' || echo '$(srcdir)/'`SynTree/Mutator.cc2497 @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) SynTree/$(DEPDIR)/driver_cfa_cpp-Mutator.Tpo SynTree/$(DEPDIR)/driver_cfa_cpp-Mutator.Po2498 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='SynTree/Mutator.cc' object='SynTree/driver_cfa_cpp-Mutator.o' libtool=no @AMDEPBACKSLASH@2499 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@2500 @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -c -o SynTree/driver_cfa_cpp-Mutator.o `test -f 'SynTree/Mutator.cc' || echo '$(srcdir)/'`SynTree/Mutator.cc2501 2502 SynTree/driver_cfa_cpp-Mutator.obj: SynTree/Mutator.cc2503 @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -MT SynTree/driver_cfa_cpp-Mutator.obj -MD -MP -MF SynTree/$(DEPDIR)/driver_cfa_cpp-Mutator.Tpo -c -o SynTree/driver_cfa_cpp-Mutator.obj `if test -f 'SynTree/Mutator.cc'; then $(CYGPATH_W) 'SynTree/Mutator.cc'; else $(CYGPATH_W) '$(srcdir)/SynTree/Mutator.cc'; fi`2504 @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) SynTree/$(DEPDIR)/driver_cfa_cpp-Mutator.Tpo SynTree/$(DEPDIR)/driver_cfa_cpp-Mutator.Po2505 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='SynTree/Mutator.cc' object='SynTree/driver_cfa_cpp-Mutator.obj' libtool=no @AMDEPBACKSLASH@2506 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@2507 @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -c -o SynTree/driver_cfa_cpp-Mutator.obj `if test -f 'SynTree/Mutator.cc'; then $(CYGPATH_W) 'SynTree/Mutator.cc'; else $(CYGPATH_W) '$(srcdir)/SynTree/Mutator.cc'; fi`2508 2509 SynTree/driver_cfa_cpp-TypeSubstitution.o: SynTree/TypeSubstitution.cc2510 @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -MT SynTree/driver_cfa_cpp-TypeSubstitution.o -MD -MP -MF SynTree/$(DEPDIR)/driver_cfa_cpp-TypeSubstitution.Tpo -c -o SynTree/driver_cfa_cpp-TypeSubstitution.o `test -f 'SynTree/TypeSubstitution.cc' || echo '$(srcdir)/'`SynTree/TypeSubstitution.cc2511 @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) SynTree/$(DEPDIR)/driver_cfa_cpp-TypeSubstitution.Tpo SynTree/$(DEPDIR)/driver_cfa_cpp-TypeSubstitution.Po2512 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='SynTree/TypeSubstitution.cc' object='SynTree/driver_cfa_cpp-TypeSubstitution.o' libtool=no @AMDEPBACKSLASH@2513 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@2514 @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -c -o SynTree/driver_cfa_cpp-TypeSubstitution.o `test -f 'SynTree/TypeSubstitution.cc' || echo '$(srcdir)/'`SynTree/TypeSubstitution.cc2515 2516 SynTree/driver_cfa_cpp-TypeSubstitution.obj: SynTree/TypeSubstitution.cc2517 @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -MT SynTree/driver_cfa_cpp-TypeSubstitution.obj -MD -MP -MF SynTree/$(DEPDIR)/driver_cfa_cpp-TypeSubstitution.Tpo -c -o SynTree/driver_cfa_cpp-TypeSubstitution.obj `if test -f 'SynTree/TypeSubstitution.cc'; then $(CYGPATH_W) 'SynTree/TypeSubstitution.cc'; else $(CYGPATH_W) '$(srcdir)/SynTree/TypeSubstitution.cc'; fi`2518 @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) SynTree/$(DEPDIR)/driver_cfa_cpp-TypeSubstitution.Tpo SynTree/$(DEPDIR)/driver_cfa_cpp-TypeSubstitution.Po2519 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='SynTree/TypeSubstitution.cc' object='SynTree/driver_cfa_cpp-TypeSubstitution.obj' libtool=no @AMDEPBACKSLASH@2520 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@2521 @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -c -o SynTree/driver_cfa_cpp-TypeSubstitution.obj `if test -f 'SynTree/TypeSubstitution.cc'; then $(CYGPATH_W) 'SynTree/TypeSubstitution.cc'; else $(CYGPATH_W) '$(srcdir)/SynTree/TypeSubstitution.cc'; fi`2522 2523 SynTree/driver_cfa_cpp-Attribute.o: SynTree/Attribute.cc2524 @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -MT SynTree/driver_cfa_cpp-Attribute.o -MD -MP -MF SynTree/$(DEPDIR)/driver_cfa_cpp-Attribute.Tpo -c -o SynTree/driver_cfa_cpp-Attribute.o `test -f 'SynTree/Attribute.cc' || echo '$(srcdir)/'`SynTree/Attribute.cc2525 @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) SynTree/$(DEPDIR)/driver_cfa_cpp-Attribute.Tpo SynTree/$(DEPDIR)/driver_cfa_cpp-Attribute.Po2526 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='SynTree/Attribute.cc' object='SynTree/driver_cfa_cpp-Attribute.o' libtool=no @AMDEPBACKSLASH@2527 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@2528 @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -c -o SynTree/driver_cfa_cpp-Attribute.o `test -f 'SynTree/Attribute.cc' || echo '$(srcdir)/'`SynTree/Attribute.cc2529 2530 SynTree/driver_cfa_cpp-Attribute.obj: SynTree/Attribute.cc2531 @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -MT SynTree/driver_cfa_cpp-Attribute.obj -MD -MP -MF SynTree/$(DEPDIR)/driver_cfa_cpp-Attribute.Tpo -c -o SynTree/driver_cfa_cpp-Attribute.obj `if test -f 'SynTree/Attribute.cc'; then $(CYGPATH_W) 'SynTree/Attribute.cc'; else $(CYGPATH_W) '$(srcdir)/SynTree/Attribute.cc'; fi`2532 @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) SynTree/$(DEPDIR)/driver_cfa_cpp-Attribute.Tpo SynTree/$(DEPDIR)/driver_cfa_cpp-Attribute.Po2533 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='SynTree/Attribute.cc' object='SynTree/driver_cfa_cpp-Attribute.obj' libtool=no @AMDEPBACKSLASH@2534 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@2535 @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -c -o SynTree/driver_cfa_cpp-Attribute.obj `if test -f 'SynTree/Attribute.cc'; then $(CYGPATH_W) 'SynTree/Attribute.cc'; else $(CYGPATH_W) '$(srcdir)/SynTree/Attribute.cc'; fi`2536 2537 SynTree/driver_cfa_cpp-VarExprReplacer.o: SynTree/VarExprReplacer.cc2538 @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -MT SynTree/driver_cfa_cpp-VarExprReplacer.o -MD -MP -MF SynTree/$(DEPDIR)/driver_cfa_cpp-VarExprReplacer.Tpo -c -o SynTree/driver_cfa_cpp-VarExprReplacer.o `test -f 'SynTree/VarExprReplacer.cc' || echo '$(srcdir)/'`SynTree/VarExprReplacer.cc2539 @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) SynTree/$(DEPDIR)/driver_cfa_cpp-VarExprReplacer.Tpo SynTree/$(DEPDIR)/driver_cfa_cpp-VarExprReplacer.Po2540 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='SynTree/VarExprReplacer.cc' object='SynTree/driver_cfa_cpp-VarExprReplacer.o' libtool=no @AMDEPBACKSLASH@2541 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@2542 @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -c -o SynTree/driver_cfa_cpp-VarExprReplacer.o `test -f 'SynTree/VarExprReplacer.cc' || echo '$(srcdir)/'`SynTree/VarExprReplacer.cc2543 2544 SynTree/driver_cfa_cpp-VarExprReplacer.obj: SynTree/VarExprReplacer.cc2545 @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -MT SynTree/driver_cfa_cpp-VarExprReplacer.obj -MD -MP -MF SynTree/$(DEPDIR)/driver_cfa_cpp-VarExprReplacer.Tpo -c -o SynTree/driver_cfa_cpp-VarExprReplacer.obj `if test -f 'SynTree/VarExprReplacer.cc'; then $(CYGPATH_W) 'SynTree/VarExprReplacer.cc'; else $(CYGPATH_W) '$(srcdir)/SynTree/VarExprReplacer.cc'; fi`2546 @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) SynTree/$(DEPDIR)/driver_cfa_cpp-VarExprReplacer.Tpo SynTree/$(DEPDIR)/driver_cfa_cpp-VarExprReplacer.Po2547 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='SynTree/VarExprReplacer.cc' object='SynTree/driver_cfa_cpp-VarExprReplacer.obj' libtool=no @AMDEPBACKSLASH@2548 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@2549 @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -c -o SynTree/driver_cfa_cpp-VarExprReplacer.obj `if test -f 'SynTree/VarExprReplacer.cc'; then $(CYGPATH_W) 'SynTree/VarExprReplacer.cc'; else $(CYGPATH_W) '$(srcdir)/SynTree/VarExprReplacer.cc'; fi`2550 2551 Tuples/driver_cfa_cpp-TupleAssignment.o: Tuples/TupleAssignment.cc2552 @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -MT Tuples/driver_cfa_cpp-TupleAssignment.o -MD -MP -MF Tuples/$(DEPDIR)/driver_cfa_cpp-TupleAssignment.Tpo -c -o Tuples/driver_cfa_cpp-TupleAssignment.o `test -f 'Tuples/TupleAssignment.cc' || echo '$(srcdir)/'`Tuples/TupleAssignment.cc2553 @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) Tuples/$(DEPDIR)/driver_cfa_cpp-TupleAssignment.Tpo Tuples/$(DEPDIR)/driver_cfa_cpp-TupleAssignment.Po2554 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='Tuples/TupleAssignment.cc' object='Tuples/driver_cfa_cpp-TupleAssignment.o' libtool=no @AMDEPBACKSLASH@2555 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@2556 @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -c -o Tuples/driver_cfa_cpp-TupleAssignment.o `test -f 'Tuples/TupleAssignment.cc' || echo '$(srcdir)/'`Tuples/TupleAssignment.cc2557 2558 Tuples/driver_cfa_cpp-TupleAssignment.obj: Tuples/TupleAssignment.cc2559 @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -MT Tuples/driver_cfa_cpp-TupleAssignment.obj -MD -MP -MF Tuples/$(DEPDIR)/driver_cfa_cpp-TupleAssignment.Tpo -c -o Tuples/driver_cfa_cpp-TupleAssignment.obj `if test -f 'Tuples/TupleAssignment.cc'; then $(CYGPATH_W) 'Tuples/TupleAssignment.cc'; else $(CYGPATH_W) '$(srcdir)/Tuples/TupleAssignment.cc'; fi`2560 @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) Tuples/$(DEPDIR)/driver_cfa_cpp-TupleAssignment.Tpo Tuples/$(DEPDIR)/driver_cfa_cpp-TupleAssignment.Po2561 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='Tuples/TupleAssignment.cc' object='Tuples/driver_cfa_cpp-TupleAssignment.obj' libtool=no @AMDEPBACKSLASH@2562 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@2563 @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -c -o Tuples/driver_cfa_cpp-TupleAssignment.obj `if test -f 'Tuples/TupleAssignment.cc'; then $(CYGPATH_W) 'Tuples/TupleAssignment.cc'; else $(CYGPATH_W) '$(srcdir)/Tuples/TupleAssignment.cc'; fi`2564 2565 Tuples/driver_cfa_cpp-TupleExpansion.o: Tuples/TupleExpansion.cc2566 @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -MT Tuples/driver_cfa_cpp-TupleExpansion.o -MD -MP -MF Tuples/$(DEPDIR)/driver_cfa_cpp-TupleExpansion.Tpo -c -o Tuples/driver_cfa_cpp-TupleExpansion.o `test -f 'Tuples/TupleExpansion.cc' || echo '$(srcdir)/'`Tuples/TupleExpansion.cc2567 @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) Tuples/$(DEPDIR)/driver_cfa_cpp-TupleExpansion.Tpo Tuples/$(DEPDIR)/driver_cfa_cpp-TupleExpansion.Po2568 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='Tuples/TupleExpansion.cc' object='Tuples/driver_cfa_cpp-TupleExpansion.o' libtool=no @AMDEPBACKSLASH@2569 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@2570 @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -c -o Tuples/driver_cfa_cpp-TupleExpansion.o `test -f 'Tuples/TupleExpansion.cc' || echo '$(srcdir)/'`Tuples/TupleExpansion.cc2571 2572 Tuples/driver_cfa_cpp-TupleExpansion.obj: Tuples/TupleExpansion.cc2573 @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -MT Tuples/driver_cfa_cpp-TupleExpansion.obj -MD -MP -MF Tuples/$(DEPDIR)/driver_cfa_cpp-TupleExpansion.Tpo -c -o Tuples/driver_cfa_cpp-TupleExpansion.obj `if test -f 'Tuples/TupleExpansion.cc'; then $(CYGPATH_W) 'Tuples/TupleExpansion.cc'; else $(CYGPATH_W) '$(srcdir)/Tuples/TupleExpansion.cc'; fi`2574 @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) Tuples/$(DEPDIR)/driver_cfa_cpp-TupleExpansion.Tpo Tuples/$(DEPDIR)/driver_cfa_cpp-TupleExpansion.Po2575 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='Tuples/TupleExpansion.cc' object='Tuples/driver_cfa_cpp-TupleExpansion.obj' libtool=no @AMDEPBACKSLASH@2576 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@2577 @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -c -o Tuples/driver_cfa_cpp-TupleExpansion.obj `if test -f 'Tuples/TupleExpansion.cc'; then $(CYGPATH_W) 'Tuples/TupleExpansion.cc'; else $(CYGPATH_W) '$(srcdir)/Tuples/TupleExpansion.cc'; fi`2578 2579 Tuples/driver_cfa_cpp-Explode.o: Tuples/Explode.cc2580 @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -MT Tuples/driver_cfa_cpp-Explode.o -MD -MP -MF Tuples/$(DEPDIR)/driver_cfa_cpp-Explode.Tpo -c -o Tuples/driver_cfa_cpp-Explode.o `test -f 'Tuples/Explode.cc' || echo '$(srcdir)/'`Tuples/Explode.cc2581 @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) Tuples/$(DEPDIR)/driver_cfa_cpp-Explode.Tpo Tuples/$(DEPDIR)/driver_cfa_cpp-Explode.Po2582 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='Tuples/Explode.cc' object='Tuples/driver_cfa_cpp-Explode.o' libtool=no @AMDEPBACKSLASH@2583 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@2584 @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -c -o Tuples/driver_cfa_cpp-Explode.o `test -f 'Tuples/Explode.cc' || echo '$(srcdir)/'`Tuples/Explode.cc2585 2586 Tuples/driver_cfa_cpp-Explode.obj: Tuples/Explode.cc2587 @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -MT Tuples/driver_cfa_cpp-Explode.obj -MD -MP -MF Tuples/$(DEPDIR)/driver_cfa_cpp-Explode.Tpo -c -o Tuples/driver_cfa_cpp-Explode.obj `if test -f 'Tuples/Explode.cc'; then $(CYGPATH_W) 'Tuples/Explode.cc'; else $(CYGPATH_W) '$(srcdir)/Tuples/Explode.cc'; fi`2588 @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) Tuples/$(DEPDIR)/driver_cfa_cpp-Explode.Tpo Tuples/$(DEPDIR)/driver_cfa_cpp-Explode.Po2589 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='Tuples/Explode.cc' object='Tuples/driver_cfa_cpp-Explode.obj' libtool=no @AMDEPBACKSLASH@2590 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@2591 @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -c -o Tuples/driver_cfa_cpp-Explode.obj `if test -f 'Tuples/Explode.cc'; then $(CYGPATH_W) 'Tuples/Explode.cc'; else $(CYGPATH_W) '$(srcdir)/Tuples/Explode.cc'; fi`2592 2593 Virtual/driver_cfa_cpp-ExpandCasts.o: Virtual/ExpandCasts.cc2594 @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -MT Virtual/driver_cfa_cpp-ExpandCasts.o -MD -MP -MF Virtual/$(DEPDIR)/driver_cfa_cpp-ExpandCasts.Tpo -c -o Virtual/driver_cfa_cpp-ExpandCasts.o `test -f 'Virtual/ExpandCasts.cc' || echo '$(srcdir)/'`Virtual/ExpandCasts.cc2595 @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) Virtual/$(DEPDIR)/driver_cfa_cpp-ExpandCasts.Tpo Virtual/$(DEPDIR)/driver_cfa_cpp-ExpandCasts.Po2596 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='Virtual/ExpandCasts.cc' object='Virtual/driver_cfa_cpp-ExpandCasts.o' libtool=no @AMDEPBACKSLASH@2597 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@2598 @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -c -o Virtual/driver_cfa_cpp-ExpandCasts.o `test -f 'Virtual/ExpandCasts.cc' || echo '$(srcdir)/'`Virtual/ExpandCasts.cc2599 2600 Virtual/driver_cfa_cpp-ExpandCasts.obj: Virtual/ExpandCasts.cc2601 @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -MT Virtual/driver_cfa_cpp-ExpandCasts.obj -MD -MP -MF Virtual/$(DEPDIR)/driver_cfa_cpp-ExpandCasts.Tpo -c -o Virtual/driver_cfa_cpp-ExpandCasts.obj `if test -f 'Virtual/ExpandCasts.cc'; then $(CYGPATH_W) 'Virtual/ExpandCasts.cc'; else $(CYGPATH_W) '$(srcdir)/Virtual/ExpandCasts.cc'; fi`2602 @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) Virtual/$(DEPDIR)/driver_cfa_cpp-ExpandCasts.Tpo Virtual/$(DEPDIR)/driver_cfa_cpp-ExpandCasts.Po2603 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='Virtual/ExpandCasts.cc' object='Virtual/driver_cfa_cpp-ExpandCasts.obj' libtool=no @AMDEPBACKSLASH@2604 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@2605 @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -c -o Virtual/driver_cfa_cpp-ExpandCasts.obj `if test -f 'Virtual/ExpandCasts.cc'; then $(CYGPATH_W) 'Virtual/ExpandCasts.cc'; else $(CYGPATH_W) '$(srcdir)/Virtual/ExpandCasts.cc'; fi`2606 1222 2607 1223 .ll.cc: … … 2696 1312 check: $(BUILT_SOURCES) 2697 1313 $(MAKE) $(AM_MAKEFLAGS) check-am 2698 all-am: Makefile $( PROGRAMS)1314 all-am: Makefile $(LIBRARIES) $(PROGRAMS) 2699 1315 installdirs: 2700 1316 for dir in "$(DESTDIR)$(cfa_cpplibdir)"; do \ … … 2722 1338 fi 2723 1339 mostlyclean-generic: 1340 -test -z "$(MOSTLYCLEANFILES)" || rm -f $(MOSTLYCLEANFILES) 2724 1341 2725 1342 clean-generic: … … 2728 1345 -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) 2729 1346 -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) 1347 -rm -f ../driver/$(am__dirstamp) 2730 1348 -rm -f CodeGen/$(DEPDIR)/$(am__dirstamp) 2731 1349 -rm -f CodeGen/$(am__dirstamp) … … 2752 1370 -rm -f Tuples/$(DEPDIR)/$(am__dirstamp) 2753 1371 -rm -f Tuples/$(am__dirstamp) 1372 -rm -f Validate/$(DEPDIR)/$(am__dirstamp) 1373 -rm -f Validate/$(am__dirstamp) 2754 1374 -rm -f Virtual/$(DEPDIR)/$(am__dirstamp) 2755 1375 -rm -f Virtual/$(am__dirstamp) 2756 -rm -f driver/$(am__dirstamp)2757 1376 2758 1377 maintainer-clean-generic: … … 2766 1385 clean: clean-am 2767 1386 2768 clean-am: clean-cfa_cpplibPROGRAMS clean-generic mostlyclean-am 1387 clean-am: clean-cfa_cpplibPROGRAMS clean-generic clean-noinstLIBRARIES \ 1388 mostlyclean-am 2769 1389 2770 1390 distclean: distclean-am 2771 -rm -rf ./$(DEPDIR) CodeGen/$(DEPDIR) CodeTools/$(DEPDIR) Common/$(DEPDIR) Concurrency/$(DEPDIR) ControlStruct/$(DEPDIR) GenPoly/$(DEPDIR) InitTweak/$(DEPDIR) Parser/$(DEPDIR) ResolvExpr/$(DEPDIR) SymTab/$(DEPDIR) SynTree/$(DEPDIR) Tuples/$(DEPDIR) V irtual/$(DEPDIR)1391 -rm -rf ./$(DEPDIR) CodeGen/$(DEPDIR) CodeTools/$(DEPDIR) Common/$(DEPDIR) Concurrency/$(DEPDIR) ControlStruct/$(DEPDIR) GenPoly/$(DEPDIR) InitTweak/$(DEPDIR) Parser/$(DEPDIR) ResolvExpr/$(DEPDIR) SymTab/$(DEPDIR) SynTree/$(DEPDIR) Tuples/$(DEPDIR) Validate/$(DEPDIR) Virtual/$(DEPDIR) 2772 1392 -rm -f Makefile 2773 1393 distclean-am: clean-am distclean-compile distclean-generic \ … … 2815 1435 2816 1436 maintainer-clean: maintainer-clean-am 2817 -rm -rf ./$(DEPDIR) CodeGen/$(DEPDIR) CodeTools/$(DEPDIR) Common/$(DEPDIR) Concurrency/$(DEPDIR) ControlStruct/$(DEPDIR) GenPoly/$(DEPDIR) InitTweak/$(DEPDIR) Parser/$(DEPDIR) ResolvExpr/$(DEPDIR) SymTab/$(DEPDIR) SynTree/$(DEPDIR) Tuples/$(DEPDIR) V irtual/$(DEPDIR)1437 -rm -rf ./$(DEPDIR) CodeGen/$(DEPDIR) CodeTools/$(DEPDIR) Common/$(DEPDIR) Concurrency/$(DEPDIR) ControlStruct/$(DEPDIR) GenPoly/$(DEPDIR) InitTweak/$(DEPDIR) Parser/$(DEPDIR) ResolvExpr/$(DEPDIR) SymTab/$(DEPDIR) SynTree/$(DEPDIR) Tuples/$(DEPDIR) Validate/$(DEPDIR) Virtual/$(DEPDIR) 2818 1438 -rm -f Makefile 2819 1439 maintainer-clean-am: distclean-am maintainer-clean-generic … … 2836 1456 2837 1457 .PHONY: CTAGS GTAGS TAGS all all-am check check-am clean \ 2838 clean-cfa_cpplibPROGRAMS clean-generic cscopelist-am ctags \ 2839 ctags-am distclean distclean-compile distclean-generic \ 2840 distclean-tags distdir dvi dvi-am html html-am info info-am \ 2841 install install-am install-cfa_cpplibPROGRAMS install-data \ 2842 install-data-am install-dvi install-dvi-am install-exec \ 2843 install-exec-am install-html install-html-am install-info \ 2844 install-info-am install-man install-pdf install-pdf-am \ 2845 install-ps install-ps-am install-strip installcheck \ 2846 installcheck-am installdirs maintainer-clean \ 2847 maintainer-clean-generic mostlyclean mostlyclean-compile \ 2848 mostlyclean-generic pdf pdf-am ps ps-am tags tags-am uninstall \ 2849 uninstall-am uninstall-cfa_cpplibPROGRAMS 1458 clean-cfa_cpplibPROGRAMS clean-generic clean-noinstLIBRARIES \ 1459 cscopelist-am ctags ctags-am distclean distclean-compile \ 1460 distclean-generic distclean-tags distdir dvi dvi-am html \ 1461 html-am info info-am install install-am \ 1462 install-cfa_cpplibPROGRAMS install-data install-data-am \ 1463 install-dvi install-dvi-am install-exec install-exec-am \ 1464 install-html install-html-am install-info install-info-am \ 1465 install-man install-pdf install-pdf-am install-ps \ 1466 install-ps-am install-strip installcheck installcheck-am \ 1467 installdirs maintainer-clean maintainer-clean-generic \ 1468 mostlyclean mostlyclean-compile mostlyclean-generic pdf pdf-am \ 1469 ps ps-am tags tags-am uninstall uninstall-am \ 1470 uninstall-cfa_cpplibPROGRAMS 2850 1471 2851 1472 .PRECIOUS: Makefile -
src/Parser/DeclarationNode.cc
rf9feab8 r90152a4 10 10 // Created On : Sat May 16 12:34:05 2015 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Mon Nov 20 09:21:52 201713 // Update Count : 1 03112 // Last Modified On : Fri Jul 20 14:56:54 2018 13 // Update Count : 1107 14 14 // 15 15 … … 32 32 #include "SynTree/Type.h" // for Type, Type::StorageClasses, Type::... 33 33 #include "TypeData.h" // for TypeData, TypeData::Aggregate_t 34 #include "TypedefTable.h" // for TypedefTable , TypedefTable::kind_t...34 #include "TypedefTable.h" // for TypedefTable 35 35 36 36 class Initializer; … … 47 47 const char * DeclarationNode::aggregateNames[] = { "struct", "union", "trait", "coroutine", "monitor", "thread", "NoAggregateNames" }; 48 48 const char * DeclarationNode::typeClassNames[] = { "otype", "dtype", "ftype", "NoTypeClassNames" }; 49 const char * DeclarationNode::builtinTypeNames[] = { "__builtin_va_list", " NoBuiltinTypeNames" };49 const char * DeclarationNode::builtinTypeNames[] = { "__builtin_va_list", "zero_t", "one_t", "NoBuiltinTypeNames" }; 50 50 51 51 UniqueName DeclarationNode::anonymous( "__anonymous" ); … … 54 54 55 55 DeclarationNode::DeclarationNode() : 56 type( nullptr ), 57 bitfieldWidth( nullptr ), 58 hasEllipsis( false ), 59 linkage( ::linkage ), 60 asmName( nullptr ), 61 initializer( nullptr ), 62 extension( false ), 63 asmStmt( nullptr ) { 56 linkage( ::linkage ) { 64 57 65 58 // variable.name = nullptr; … … 71 64 attr.expr = nullptr; 72 65 attr.type = nullptr; 66 67 assert.condition = nullptr; 68 assert.message = nullptr; 73 69 } 74 70 … … 88 84 // asmName, no delete, passed to next stage 89 85 delete initializer; 86 87 delete assert.condition; 88 delete assert.message; 90 89 } 91 90 … … 95 94 newnode->name = name ? new string( *name ) : nullptr; 96 95 96 newnode->builtin = NoBuiltinType; 97 97 newnode->type = maybeClone( type ); 98 newnode->inLine = inLine; 98 99 newnode->storageClasses = storageClasses; 99 100 newnode->funcSpecs = funcSpecs; … … 117 118 newnode->attr.expr = maybeClone( attr.expr ); 118 119 newnode->attr.type = maybeClone( attr.type ); 120 121 newnode->assert.condition = maybeClone( assert.condition ); 122 newnode->assert.message = maybeClone( assert.message ); 119 123 return newnode; 120 124 } // DeclarationNode::clone 121 125 122 bool DeclarationNode::get_hasEllipsis() const { 123 return hasEllipsis; 124 } 125 126 void DeclarationNode::print( std::ostream &os, int indent ) const { 126 void DeclarationNode::print( std::ostream & os, int indent ) const { 127 127 os << string( indent, ' ' ); 128 128 if ( name ) { … … 160 160 } 161 161 162 void DeclarationNode::printList( std::ostream & os, int indent ) const {162 void DeclarationNode::printList( std::ostream & os, int indent ) const { 163 163 ParseNode::printList( os, indent ); 164 164 if ( hasEllipsis ) { … … 167 167 } 168 168 169 DeclarationNode * DeclarationNode::newFunction( string * name, DeclarationNode * ret, DeclarationNode * param, StatementNode * body, bool newStyle) {169 DeclarationNode * DeclarationNode::newFunction( const string * name, DeclarationNode * ret, DeclarationNode * param, StatementNode * body ) { 170 170 DeclarationNode * newnode = new DeclarationNode; 171 171 newnode->name = name; 172 172 newnode->type = new TypeData( TypeData::Function ); 173 173 newnode->type->function.params = param; 174 newnode->type->function.newStyle = newStyle;175 174 newnode->type->function.body = body; 176 177 // ignore unnamed routine declarations: void p( int (*)(int) );178 if ( newnode->name ) {179 typedefTable.addToEnclosingScope( *newnode->name, TypedefTable::ID );180 } // if181 175 182 176 if ( ret ) { … … 244 238 } // DeclarationNode::newForall 245 239 246 DeclarationNode * DeclarationNode::newFromTypedef( string * name ) {240 DeclarationNode * DeclarationNode::newFromTypedef( const string * name ) { 247 241 DeclarationNode * newnode = new DeclarationNode; 248 242 newnode->type = new TypeData( TypeData::SymbolicInst ); … … 253 247 } // DeclarationNode::newFromTypedef 254 248 249 DeclarationNode * DeclarationNode::newFromGlobalScope() { 250 DeclarationNode * newnode = new DeclarationNode; 251 newnode->type = new TypeData( TypeData::GlobalScope ); 252 return newnode; 253 } 254 255 DeclarationNode * DeclarationNode::newQualifiedType( DeclarationNode * parent, DeclarationNode * child) { 256 DeclarationNode * newnode = new DeclarationNode; 257 newnode->type = new TypeData( TypeData::Qualified ); 258 newnode->type->qualified.parent = parent->type; 259 newnode->type->qualified.child = child->type; 260 parent->type = nullptr; 261 child->type = nullptr; 262 delete parent; 263 delete child; 264 return newnode; 265 } 266 255 267 DeclarationNode * DeclarationNode::newAggregate( Aggregate kind, const string * name, ExpressionNode * actuals, DeclarationNode * fields, bool body ) { 256 assert( name );257 268 DeclarationNode * newnode = new DeclarationNode; 258 269 newnode->type = new TypeData( TypeData::Aggregate ); 259 270 newnode->type->aggregate.kind = kind; 260 newnode->type->aggregate.name = name;271 newnode->type->aggregate.name = name == nullptr ? new string( DeclarationNode::anonymous.newName() ) : name; 261 272 newnode->type->aggregate.actuals = actuals; 262 273 newnode->type->aggregate.fields = fields; … … 264 275 newnode->type->aggregate.tagged = false; 265 276 newnode->type->aggregate.parent = nullptr; 277 newnode->type->aggregate.anon = name == nullptr; 266 278 return newnode; 267 279 } // DeclarationNode::newAggregate 268 280 269 DeclarationNode * DeclarationNode::newEnum( string * name, DeclarationNode * constants, bool body ) { 270 assert( name ); 281 DeclarationNode * DeclarationNode::newEnum( const string * name, DeclarationNode * constants, bool body ) { 271 282 DeclarationNode * newnode = new DeclarationNode; 272 283 newnode->type = new TypeData( TypeData::Enum ); 273 newnode->type->enumeration.name = name ;284 newnode->type->enumeration.name = name == nullptr ? new string( DeclarationNode::anonymous.newName() ) : name; 274 285 newnode->type->enumeration.constants = constants; 275 286 newnode->type->enumeration.body = body; 287 newnode->type->enumeration.anon = name == nullptr; 276 288 return newnode; 277 289 } // DeclarationNode::newEnum 278 290 279 DeclarationNode * DeclarationNode::newEnumConstant( string * name, ExpressionNode * constant ) {291 DeclarationNode * DeclarationNode::newEnumConstant( const string * name, ExpressionNode * constant ) { 280 292 DeclarationNode * newnode = new DeclarationNode; 281 293 newnode->name = name; 282 294 newnode->enumeratorValue.reset( constant ); 283 typedefTable.addToEnclosingScope( *newnode->name, TypedefTable::ID );284 295 return newnode; 285 296 } // DeclarationNode::newEnumConstant 286 297 287 DeclarationNode * DeclarationNode::newName( string * name ) {298 DeclarationNode * DeclarationNode::newName( const string * name ) { 288 299 DeclarationNode * newnode = new DeclarationNode; 289 300 newnode->name = name; … … 291 302 } // DeclarationNode::newName 292 303 293 DeclarationNode * DeclarationNode::newFromTypeGen( string * name, ExpressionNode * params ) {304 DeclarationNode * DeclarationNode::newFromTypeGen( const string * name, ExpressionNode * params ) { 294 305 DeclarationNode * newnode = new DeclarationNode; 295 306 newnode->type = new TypeData( TypeData::SymbolicInst ); … … 300 311 } // DeclarationNode::newFromTypeGen 301 312 302 DeclarationNode * DeclarationNode::newTypeParam( TypeClass tc, string * name ) {313 DeclarationNode * DeclarationNode::newTypeParam( TypeClass tc, const string * name ) { 303 314 DeclarationNode * newnode = new DeclarationNode; 304 315 newnode->type = nullptr; … … 331 342 } // DeclarationNode::newTraitUse 332 343 333 DeclarationNode * DeclarationNode::newTypeDecl( string * name, DeclarationNode * typeParams ) {344 DeclarationNode * DeclarationNode::newTypeDecl( const string * name, DeclarationNode * typeParams ) { 334 345 DeclarationNode * newnode = new DeclarationNode; 335 346 newnode->name = name; … … 343 354 DeclarationNode * newnode = new DeclarationNode; 344 355 newnode->type = new TypeData( kind == OperKinds::PointTo ? TypeData::Pointer : TypeData::Reference ); 356 if ( kind == OperKinds::And ) { 357 // T && is parsed as 'And' operator rather than two references => add a second reference type 358 TypeData * td = new TypeData( TypeData::Reference ); 359 td->base = newnode->type; 360 newnode->type = td; 361 } 345 362 if ( qualifiers ) { 346 363 return newnode->addQualifiers( qualifiers ); … … 400 417 } // DeclarationNode::newBuiltinType 401 418 402 DeclarationNode * DeclarationNode::newAttr( string * name, ExpressionNode * expr ) {419 DeclarationNode * DeclarationNode::newAttr( const string * name, ExpressionNode * expr ) { 403 420 DeclarationNode * newnode = new DeclarationNode; 404 421 newnode->type = nullptr; … … 409 426 } 410 427 411 DeclarationNode * DeclarationNode::newAttr( string * name, DeclarationNode * type ) {428 DeclarationNode * DeclarationNode::newAttr( const string * name, DeclarationNode * type ) { 412 429 DeclarationNode * newnode = new DeclarationNode; 413 430 newnode->type = nullptr; … … 418 435 } 419 436 420 DeclarationNode * DeclarationNode::newAttribute( string * name, ExpressionNode * expr ) {437 DeclarationNode * DeclarationNode::newAttribute( const string * name, ExpressionNode * expr ) { 421 438 DeclarationNode * newnode = new DeclarationNode; 422 439 newnode->type = nullptr; … … 433 450 return newnode; 434 451 } 452 453 DeclarationNode * DeclarationNode::newStaticAssert( ExpressionNode * condition, Expression * message ) { 454 DeclarationNode * newnode = new DeclarationNode; 455 newnode->assert.condition = condition; 456 newnode->assert.message = message; 457 return newnode; 458 } 459 435 460 436 461 void appendError( string & dst, const string & src ) { … … 489 514 } // DeclarationNode::copySpecifiers 490 515 491 static void addQualifiersToType( TypeData *&src, TypeData * dst ) { 492 if ( src->forall && dst->kind == TypeData::Function ) { 493 if ( dst->forall ) { 494 dst->forall->appendList( src->forall ); 495 } else { 496 dst->forall = src->forall; 497 } // if 498 src->forall = nullptr; 499 } // if 516 static void addQualifiersToType( TypeData *& src, TypeData * dst ) { 500 517 if ( dst->base ) { 501 518 addQualifiersToType( src, dst->base ); … … 509 526 510 527 DeclarationNode * DeclarationNode::addQualifiers( DeclarationNode * q ) { 511 if ( ! q ) { delete q; return this; }// empty qualifier528 if ( ! q ) { return this; } // empty qualifier 512 529 513 530 checkSpecifiers( q ); … … 531 548 type->aggregate.params->appendList( q->type->forall ); // augment forall qualifier 532 549 } else { // not polymorphic 533 type->aggregate.params = q->type->forall; // make polymorphic type 534 // change implicit typedef from TYPEDEFname to TYPEGENname 535 typedefTable.changeKind( *type->aggregate.name, TypedefTable::TG ); 550 type->aggregate.params = q->type->forall; // set forall qualifier 536 551 } // if 537 552 } else { // not polymorphic … … 543 558 544 559 checkQualifiers( type, q->type ); 560 if ( (builtin == Zero || builtin == One) && q->type->qualifiers.val != 0 && error.length() == 0 ) { 561 SemanticWarning( yylloc, Warning::BadQualifiersZeroOne, Type::QualifiersNames[ilog2( q->type->qualifiers.val )], builtinTypeNames[builtin] ); 562 } // if 545 563 addQualifiersToType( q->type, type ); 546 564 … … 549 567 } // addQualifiers 550 568 551 static void addTypeToType( TypeData *& src, TypeData *&dst ) {569 static void addTypeToType( TypeData *& src, TypeData *& dst ) { 552 570 if ( src->forall && dst->kind == TypeData::Function ) { 553 571 if ( dst->forall ) { … … 575 593 dst->basictype = src->basictype; 576 594 } else if ( src->basictype != DeclarationNode::NoBasicType ) 577 throw SemanticError( string( "conflicting type specifier " ) + DeclarationNode::basicTypeNames[ src->basictype ] + " in type: ", src);595 SemanticError( yylloc, src, string( "conflicting type specifier " ) + DeclarationNode::basicTypeNames[ src->basictype ] + " in type: " ); 578 596 579 597 if ( dst->complextype == DeclarationNode::NoComplexType ) { 580 598 dst->complextype = src->complextype; 581 599 } else if ( src->complextype != DeclarationNode::NoComplexType ) 582 throw SemanticError( string( "conflicting type specifier " ) + DeclarationNode::complexTypeNames[ src->complextype ] + " in type: ", src);600 SemanticError( yylloc, src, string( "conflicting type specifier " ) + DeclarationNode::complexTypeNames[ src->complextype ] + " in type: " ); 583 601 584 602 if ( dst->signedness == DeclarationNode::NoSignedness ) { 585 603 dst->signedness = src->signedness; 586 604 } else if ( src->signedness != DeclarationNode::NoSignedness ) 587 throw SemanticError( string( "conflicting type specifier " ) + DeclarationNode::signednessNames[ src->signedness ] + " in type: ", src);605 SemanticError( yylloc, src, string( "conflicting type specifier " ) + DeclarationNode::signednessNames[ src->signedness ] + " in type: " ); 588 606 589 607 if ( dst->length == DeclarationNode::NoLength ) { … … 592 610 dst->length = DeclarationNode::LongLong; 593 611 } else if ( src->length != DeclarationNode::NoLength ) 594 throw SemanticError( string( "conflicting type specifier " ) + DeclarationNode::lengthNames[ src->length ] + " in type: ", src);612 SemanticError( yylloc, src, string( "conflicting type specifier " ) + DeclarationNode::lengthNames[ src->length ] + " in type: " ); 595 613 } // if 596 614 break; … … 717 735 } 718 736 719 DeclarationNode * DeclarationNode::addFunctionBody( StatementNode * body, StatementNode * with) {737 DeclarationNode * DeclarationNode::addFunctionBody( StatementNode * body, ExpressionNode * withExprs ) { 720 738 assert( type ); 721 739 assert( type->kind == TypeData::Function ); 722 740 assert( ! type->function.body ); 723 if ( with ) {724 // convert725 // void f(S s) with (s) { x = 0; }726 // to727 // void f(S s) { with(s) { x = 0; } }728 WithStmt * withStmt = strict_dynamic_cast< WithStmt * >( with->build() );729 withStmt->stmt = body->build();730 delete body;731 delete with;732 body = new StatementNode( new CompoundStmt( { withStmt } ) );733 }734 741 type->function.body = body; 742 type->function.withExprs = withExprs; 735 743 return this; 736 744 } … … 771 779 DeclarationNode * DeclarationNode::addPointer( DeclarationNode * p ) { 772 780 if ( p ) { 773 assert( p->type->kind == TypeData::Pointer || TypeData::Reference );781 assert( p->type->kind == TypeData::Pointer || p->type->kind == TypeData::Reference ); 774 782 setBase( p->type ); 775 783 p->type = nullptr; … … 916 924 delete newType->aggInst.aggregate->enumeration.constants; 917 925 newType->aggInst.aggregate->enumeration.constants = nullptr; 926 newType->aggInst.aggregate->enumeration.body = false; 918 927 } else { 919 928 assert( newType->aggInst.aggregate->kind == TypeData::Aggregate ); 920 929 delete newType->aggInst.aggregate->aggregate.fields; 921 930 newType->aggInst.aggregate->aggregate.fields = nullptr; 931 newType->aggInst.aggregate->aggregate.body = false; 922 932 } // if 923 933 // don't hoist twice … … 948 958 } 949 959 950 void buildList( const DeclarationNode * firstNode, std::list< Declaration * > & outputList ) {951 SemanticError errors;960 void buildList( const DeclarationNode * firstNode, std::list< Declaration * > & outputList ) { 961 SemanticErrorException errors; 952 962 std::back_insert_iterator< std::list< Declaration * > > out( outputList ); 953 963 954 964 for ( const DeclarationNode * cur = firstNode; cur; cur = dynamic_cast< DeclarationNode * >( cur->get_next() ) ) { 955 965 try { 966 bool extracted = false; 967 bool anon = false; 956 968 if ( DeclarationNode * extr = cur->extractAggregate() ) { 957 969 // handle the case where a structure declaration is contained within an object or type declaration 958 970 Declaration * decl = extr->build(); 959 971 if ( decl ) { 972 // hoist the structure declaration 960 973 decl->location = cur->location; 961 974 * out++ = decl; 975 976 // need to remember the cases where a declaration contains an anonymous aggregate definition 977 extracted = true; 978 assert( extr->type ); 979 if ( extr->type->kind == TypeData::Aggregate ) { 980 anon = extr->type->aggregate.anon; 981 } else if ( extr->type->kind == TypeData::Enum ) { 982 // xxx - is it useful to have an implicit anonymous enum member? 983 anon = extr->type->enumeration.anon; 984 } 962 985 } // if 963 986 delete extr; … … 966 989 Declaration * decl = cur->build(); 967 990 if ( decl ) { 968 decl->location = cur->location; 969 * out++ = decl; 991 // don't include anonymous declaration for named aggregates, but do include them for anonymous aggregates, e.g.: 992 // struct S { 993 // struct T { int x; }; // no anonymous member 994 // struct { int y; }; // anonymous member 995 // struct T; // anonymous member 996 // }; 997 if ( ! (extracted && decl->name == "" && ! anon && ! cur->get_inLine()) ) { 998 if ( decl->name == "" ) { 999 if ( DeclarationWithType * dwt = dynamic_cast<DeclarationWithType *>( decl ) ) { 1000 if ( ReferenceToType * aggr = dynamic_cast<ReferenceToType *>( dwt->get_type() ) ) { 1001 if ( aggr->name.find("anonymous") == std::string::npos ) { 1002 if ( ! cur->get_inLine() ) { 1003 // temporary: warn about anonymous member declarations of named types, since 1004 // this conflicts with the syntax for the forward declaration of an anonymous type 1005 SemanticWarning( cur->location, Warning::AggrForwardDecl, aggr->name.c_str() ); 1006 } // if 1007 } // if 1008 } // if 1009 } // if 1010 } // if 1011 decl->location = cur->location; 1012 *out++ = decl; 1013 } // if 970 1014 } // if 971 } catch( SemanticError &e ) { 972 e.set_location( cur->location ); 1015 } catch( SemanticErrorException & e ) { 973 1016 errors.append( e ); 974 1017 } // try 975 } // while1018 } // for 976 1019 977 1020 if ( ! errors.isEmpty() ) { … … 980 1023 } // buildList 981 1024 982 void buildList( const DeclarationNode * firstNode, std::list< DeclarationWithType * > &outputList ) { 983 SemanticError errors; 1025 // currently only builds assertions, function parameters, and return values 1026 void buildList( const DeclarationNode * firstNode, std::list< DeclarationWithType * > & outputList ) { 1027 SemanticErrorException errors; 984 1028 std::back_insert_iterator< std::list< DeclarationWithType * > > out( outputList ); 985 1029 … … 987 1031 try { 988 1032 Declaration * decl = cur->build(); 989 if ( decl ) { 990 if ( DeclarationWithType * dwt = dynamic_cast< DeclarationWithType * >( decl ) ) { 991 dwt->location = cur->location; 992 * out++ = dwt; 993 } else if ( StructDecl * agg = dynamic_cast< StructDecl * >( decl ) ) { 994 StructInstType * inst = new StructInstType( Type::Qualifiers(), agg->get_name() ); 995 auto obj = new ObjectDecl( "", Type::StorageClasses(), linkage, nullptr, inst, nullptr ); 996 obj->location = cur->location; 997 * out++ = obj; 998 delete agg; 999 } else if ( UnionDecl * agg = dynamic_cast< UnionDecl * >( decl ) ) { 1000 UnionInstType * inst = new UnionInstType( Type::Qualifiers(), agg->get_name() ); 1001 auto obj = new ObjectDecl( "", Type::StorageClasses(), linkage, nullptr, inst, nullptr ); 1002 obj->location = cur->location; 1003 * out++ = obj; 1004 } // if 1033 assert( decl ); 1034 if ( DeclarationWithType * dwt = dynamic_cast< DeclarationWithType * >( decl ) ) { 1035 dwt->location = cur->location; 1036 * out++ = dwt; 1037 } else if ( StructDecl * agg = dynamic_cast< StructDecl * >( decl ) ) { 1038 // e.g., int foo(struct S) {} 1039 StructInstType * inst = new StructInstType( Type::Qualifiers(), agg->name ); 1040 auto obj = new ObjectDecl( "", Type::StorageClasses(), linkage, nullptr, inst, nullptr ); 1041 obj->location = cur->location; 1042 * out++ = obj; 1043 delete agg; 1044 } else if ( UnionDecl * agg = dynamic_cast< UnionDecl * >( decl ) ) { 1045 // e.g., int foo(union U) {} 1046 UnionInstType * inst = new UnionInstType( Type::Qualifiers(), agg->name ); 1047 auto obj = new ObjectDecl( "", Type::StorageClasses(), linkage, nullptr, inst, nullptr ); 1048 obj->location = cur->location; 1049 * out++ = obj; 1050 } else if ( EnumDecl * agg = dynamic_cast< EnumDecl * >( decl ) ) { 1051 // e.g., int foo(enum E) {} 1052 EnumInstType * inst = new EnumInstType( Type::Qualifiers(), agg->name ); 1053 auto obj = new ObjectDecl( "", Type::StorageClasses(), linkage, nullptr, inst, nullptr ); 1054 obj->location = cur->location; 1055 * out++ = obj; 1005 1056 } // if 1006 } catch( SemanticError &e ) { 1007 e.set_location( cur->location ); 1057 } catch( SemanticErrorException & e ) { 1008 1058 errors.append( e ); 1009 1059 } // try … … 1015 1065 } // buildList 1016 1066 1017 void buildTypeList( const DeclarationNode * firstNode, std::list< Type * > & outputList ) {1018 SemanticError errors;1067 void buildTypeList( const DeclarationNode * firstNode, std::list< Type * > & outputList ) { 1068 SemanticErrorException errors; 1019 1069 std::back_insert_iterator< std::list< Type * > > out( outputList ); 1020 1070 const DeclarationNode * cur = firstNode; … … 1023 1073 try { 1024 1074 * out++ = cur->buildType(); 1025 } catch( SemanticError &e ) { 1026 e.set_location( cur->location ); 1075 } catch( SemanticErrorException & e ) { 1027 1076 errors.append( e ); 1028 1077 } // try … … 1036 1085 1037 1086 Declaration * DeclarationNode::build() const { 1038 if ( ! error.empty() ) throw SemanticError( error + " in declaration of ", this);1087 if ( ! error.empty() ) SemanticError( this, error + " in declaration of " ); 1039 1088 1040 1089 if ( asmStmt ) { … … 1059 1108 // inline _Noreturn int i; // disallowed 1060 1109 if ( type->kind != TypeData::Function && funcSpecs.any() ) { 1061 throw SemanticError( "invalid function specifier for ", this ); 1062 } // if 1063 return buildDecl( type, name ? *name : string( "" ), storageClasses, maybeBuild< Expression >( bitfieldWidth ), funcSpecs, linkage, asmName, maybeBuild< Initializer >(initializer), attributes )->set_extension( extension ); 1064 } // if 1110 SemanticError( this, "invalid function specifier for " ); 1111 } // if 1112 // Forall qualifier can only appear on a function/aggregate definition/declaration. 1113 // 1114 // forall int f(); // allowed 1115 // forall int g( int i ); // allowed 1116 // forall int i; // disallowed 1117 if ( type->kind != TypeData::Function && type->forall ) { 1118 SemanticError( this, "invalid type qualifier for " ); 1119 } // if 1120 bool isDelete = initializer && initializer->get_isDelete(); 1121 Declaration * decl = buildDecl( type, name ? *name : string( "" ), storageClasses, maybeBuild< Expression >( bitfieldWidth ), funcSpecs, linkage, asmName, isDelete ? nullptr : maybeBuild< Initializer >(initializer), attributes )->set_extension( extension ); 1122 if ( isDelete ) { 1123 DeclarationWithType * dwt = strict_dynamic_cast<DeclarationWithType *>( decl ); 1124 dwt->isDeleted = true; 1125 } 1126 return decl; 1127 } // if 1128 1129 if ( assert.condition ) { 1130 return new StaticAssertDecl( maybeBuild< Expression >( assert.condition ), strict_dynamic_cast< ConstantExpr * >( maybeClone( assert.message ) ) ); 1131 } 1065 1132 1066 1133 // SUE's cannot have function specifiers, either … … 1069 1136 // inlne _Noreturn enum E { ... }; // disallowed 1070 1137 if ( funcSpecs.any() ) { 1071 throw SemanticError( "invalid function specifier for ", this);1138 SemanticError( this, "invalid function specifier for " ); 1072 1139 } // if 1073 1140 assertf( name, "ObjectDecl must a have name\n" ); -
src/Parser/ExpressionNode.cc
rf9feab8 r90152a4 10 10 // Created On : Sat May 16 13:17:07 2015 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Wed Sep 27 22:51:55 201713 // Update Count : 78112 // Last Modified On : Mon Jun 4 21:24:45 2018 13 // Update Count : 802 14 14 // 15 15 … … 58 58 static inline bool checkD( char c ) { return c == 'd' || c == 'D'; } 59 59 static inline bool checkI( char c ) { return c == 'i' || c == 'I'; } 60 static inline bool checkB( char c ) { return c == 'b' || c == 'B'; } 60 61 static inline bool checkX( char c ) { return c == 'x' || c == 'X'; } 61 62 … … 93 94 } // checkLNInt 94 95 95 static void sepNumeric( string & str, string & units ) {96 string::size_type posn = str.find_first_of( "`" );97 if ( posn != string::npos ) {98 units = "?" + str.substr( posn ); // extract units99 str.erase( posn ); // remove units100 } // if101 } // sepNumeric102 103 96 Expression * build_constantInteger( string & str ) { 104 97 static const BasicType::Kind kind[2][6] = { … … 108 101 }; 109 102 110 string units;111 sepNumeric( str, units ); // separate constant from units112 113 103 bool dec = true, Unsigned = false; // decimal, unsigned constant 114 104 int size; // 0 => short, 1 => char, 2 => int, 3 => long int, 4 => long long int, 5 => int128 … … 116 106 117 107 unsigned long long int v; // converted integral value 118 size_t last = str.length() - 1; // last characterof constant108 size_t last = str.length() - 1; // last subscript of constant 119 109 Expression * ret; 120 110 … … 129 119 } // if 130 120 131 if ( str[0] == '0' ) { // octal/hex constant ? 121 // Cannot be "0" 122 123 if ( str[0] == '0' ) { // radix character ? 132 124 dec = false; 133 if ( last != 0 && checkX( str[1] ) ) {// hex constant ?125 if ( checkX( str[1] ) ) { // hex constant ? 134 126 sscanf( (char *)str.c_str(), "%llx", &v ); 127 //printf( "%llx %llu\n", v, v ); 128 } else if ( checkB( str[1] ) ) { // binary constant ? 129 v = 0; 130 for ( unsigned int i = 2;; i += 1 ) { // compute value 131 if ( str[i] == '1' ) v |= 1; 132 if ( i == last ) break; 133 v <<= 1; 134 } // for 135 135 //printf( "%llx %llu\n", v, v ); 136 136 } else { // octal constant … … 211 211 if ( Unsigned && size < 2 ) { // hh or h, less than int ? 212 212 // int i = -1uh => 65535 not -1, so cast is necessary for unsigned, which unfortunately eliminates warnings for large values. 213 ret = new CastExpr( ret, new BasicType( Type::Qualifiers(), kind[Unsigned][size] ) );213 ret = new CastExpr( ret, new BasicType( Type::Qualifiers(), kind[Unsigned][size] ), false ); 214 214 } else if ( lnth != -1 ) { // explicit length ? 215 215 if ( lnth == 5 ) { // int128 ? 216 216 size = 5; 217 ret = new CastExpr( ret, new BasicType( Type::Qualifiers(), kind[Unsigned][size] ) );217 ret = new CastExpr( ret, new BasicType( Type::Qualifiers(), kind[Unsigned][size] ), false ); 218 218 } else { 219 ret = new CastExpr( ret, new TypeInstType( Type::Qualifiers(), lnthsInt[Unsigned][lnth], false ) );219 ret = new CastExpr( ret, new TypeInstType( Type::Qualifiers(), lnthsInt[Unsigned][lnth], false ), false ); 220 220 } // if 221 221 } // if 222 222 CLEANUP: 223 if ( units.length() != 0 ) {224 ret = new UntypedExpr( new NameExpr( units ), { ret } );225 } // if226 223 227 224 delete &str; // created by lex … … 257 254 }; 258 255 259 string units;260 sepNumeric( str, units ); // separate constant from units261 262 256 bool complx = false; // real, complex 263 257 int size = 1; // 0 => float, 1 => double, 2 => long double … … 291 285 Expression * ret = new ConstantExpr( Constant( new BasicType( noQualifiers, kind[complx][size] ), str, v ) ); 292 286 if ( lnth != -1 ) { // explicit length ? 293 ret = new CastExpr( ret, new BasicType( Type::Qualifiers(), kind[complx][size] ) ); 294 } // if 295 if ( units.length() != 0 ) { 296 ret = new UntypedExpr( new NameExpr( units ), { ret } ); 287 ret = new CastExpr( ret, new BasicType( Type::Qualifiers(), kind[complx][size] ), false ); 297 288 } // if 298 289 … … 323 314 324 315 Expression * build_constantStr( string & str ) { 316 assert( str.length() > 0 ); 325 317 string units; // units 326 318 sepString( str, units, '"' ); // separate constant from units … … 356 348 357 349 Expression * build_field_name_FLOATING_FRACTIONconstant( const string & str ) { 358 if ( str.find_first_not_of( "0123456789", 1 ) != string::npos ) throw SemanticError("invalid tuple index " + str );350 if ( str.find_first_not_of( "0123456789", 1 ) != string::npos ) SemanticError( yylloc, "invalid tuple index " + str ); 359 351 Expression * ret = build_constantInteger( *new string( str.substr(1) ) ); 360 352 delete &str; … … 363 355 364 356 Expression * build_field_name_FLOATING_DECIMALconstant( const string & str ) { 365 if ( str[str.size()-1] != '.' ) throw SemanticError("invalid tuple index " + str );357 if ( str[str.size()-1] != '.' ) SemanticError( yylloc, "invalid tuple index " + str ); 366 358 Expression * ret = build_constantInteger( *new string( str.substr( 0, str.size()-1 ) ) ); 367 359 delete &str; … … 417 409 if ( dynamic_cast< VoidType * >( targetType ) ) { 418 410 delete targetType; 419 return new CastExpr( maybeMoveBuild< Expression >(expr_node) );411 return new CastExpr( maybeMoveBuild< Expression >(expr_node), false ); 420 412 } else { 421 return new CastExpr( maybeMoveBuild< Expression >(expr_node), targetType );413 return new CastExpr( maybeMoveBuild< Expression >(expr_node), targetType, false ); 422 414 } // if 423 415 } // build_cast 416 417 Expression * build_keyword_cast( KeywordCastExpr::Target target, ExpressionNode * expr_node ) { 418 return new KeywordCastExpr( maybeMoveBuild< Expression >(expr_node), target ); 419 } 424 420 425 421 Expression * build_virtual_cast( DeclarationNode * decl_node, ExpressionNode * expr_node ) { -
src/Parser/InitializerNode.cc
rf9feab8 r90152a4 27 27 28 28 InitializerNode::InitializerNode( ExpressionNode * _expr, bool aggrp, ExpressionNode * des ) 29 : expr( _expr ), aggregate( aggrp ), designator( des ), kids( nullptr ), maybeConstructed( true ) {29 : expr( _expr ), aggregate( aggrp ), designator( des ), kids( nullptr ), maybeConstructed( true ), isDelete( false ) { 30 30 if ( aggrp ) 31 31 kids = dynamic_cast< InitializerNode * >( get_next() ); … … 36 36 37 37 InitializerNode::InitializerNode( InitializerNode * init, bool aggrp, ExpressionNode * des ) 38 : expr( nullptr ), aggregate( aggrp ), designator( des ), kids( nullptr ), maybeConstructed( true ) {38 : expr( nullptr ), aggregate( aggrp ), designator( des ), kids( nullptr ), maybeConstructed( true ), isDelete( false ) { 39 39 if ( init ) 40 40 set_last( init ); … … 46 46 set_next( nullptr ); 47 47 } // InitializerNode::InitializerNode 48 49 InitializerNode::InitializerNode( bool isDelete ) : expr( nullptr ), aggregate( false ), designator( nullptr ), kids( nullptr ), maybeConstructed( false ), isDelete( isDelete ) {} 48 50 49 51 InitializerNode::~InitializerNode() { … … 84 86 85 87 Initializer * InitializerNode::build() const { 88 assertf( ! isDelete, "Should not build delete stmt InitializerNode" ); 86 89 if ( aggregate ) { 87 90 // steal designators from children -
src/Parser/LinkageSpec.cc
rf9feab8 r90152a4 24 24 namespace LinkageSpec { 25 25 26 Spec linkageCheck( const string * spec ) {26 Spec linkageCheck( CodeLocation location, const string * spec ) { 27 27 assert( spec ); 28 28 unique_ptr<const string> guard( spec ); // allocated by lexer … … 34 34 return BuiltinC; 35 35 } else { 36 throw SemanticError("Invalid linkage specifier " + *spec );36 SemanticError( location, "Invalid linkage specifier " + *spec ); 37 37 } // if 38 38 } 39 39 40 Spec linkageUpdate( Spec old_spec, const string * cmd ) {40 Spec linkageUpdate( CodeLocation location, Spec old_spec, const string * cmd ) { 41 41 assert( cmd ); 42 42 unique_ptr<const string> guard( cmd ); // allocated by lexer … … 48 48 return old_spec; 49 49 } else { 50 throw SemanticError("Invalid linkage specifier " + *cmd );50 SemanticError( location, "Invalid linkage specifier " + *cmd ); 51 51 } // if 52 52 } -
src/Parser/LinkageSpec.h
rf9feab8 r90152a4 10 10 // Created On : Sat May 16 13:24:28 2015 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Sat Jul 22 09:32:16 201713 // Update Count : 1 412 // Last Modified On : Mon Jul 2 07:46:49 2018 13 // Update Count : 16 14 14 // 15 15 … … 18 18 #include <string> 19 19 20 #include "Common/CodeLocation.h" 21 20 22 namespace LinkageSpec { 21 23 // All linkage specs are some combination of these flags: 22 enum { 23 Mangle = 1 << 0, 24 Generate = 1 << 1, 25 Overrideable = 1 << 2, 26 Builtin = 1 << 3, 27 28 NoOfSpecs = 1 << 4, 29 }; 24 enum { Mangle = 1 << 0, Generate = 1 << 1, Overrideable = 1 << 2, Builtin = 1 << 3, GccBuiltin = 1 << 4, NoOfSpecs = 1 << 5, }; 30 25 31 26 union Spec { … … 36 31 bool is_overridable : 1; 37 32 bool is_builtin : 1; 33 bool is_gcc_builtin : 1; 38 34 }; 39 35 constexpr Spec( unsigned int val ) : val( val ) {} 40 constexpr Spec( Spec const & other ) : val( other.val ) {}36 constexpr Spec( Spec const & other ) : val( other.val ) {} 41 37 // Operators may go here. 42 38 // Supports == and != 43 constexpr operator unsigned int () const { return val; }39 constexpr operator unsigned int() const { return val; } 44 40 }; 45 41 46 42 47 Spec linkageCheck( const std::string * );43 Spec linkageCheck( CodeLocation location, const std::string * ); 48 44 // Returns the Spec with the given name (limited to C, Cforall & BuiltinC) 49 Spec linkageUpdate( Spec old_spec, const std::string * cmd );45 Spec linkageUpdate( CodeLocation location, Spec old_spec, const std::string * cmd ); 50 46 /* If cmd = "C" returns a Spec that is old_spec with is_mangled = false 51 47 * If cmd = "Cforall" returns old_spec Spec with is_mangled = true … … 59 55 inline bool isOverridable( Spec spec ) { return spec.is_overridable; } 60 56 inline bool isBuiltin( Spec spec ) { return spec.is_builtin; } 57 inline bool isGccBuiltin( Spec spec ) { return spec.is_gcc_builtin; } 61 58 62 59 // Pre-defined flag combinations: … … 70 67 constexpr Spec const AutoGen = { Mangle | Generate | Overrideable }; 71 68 // gcc internal 72 constexpr Spec const Compiler = { Builtin };69 constexpr Spec const Compiler = { Mangle | Builtin | GccBuiltin }; 73 70 // mangled builtins 74 71 constexpr Spec const BuiltinCFA = { Mangle | Generate | Builtin }; -
src/Parser/ParseNode.h
rf9feab8 r90152a4 10 10 // Created On : Sat May 16 13:28:16 2015 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Mon Nov 27 17:33:35 201713 // Update Count : 8 2412 // Last Modified On : Sat Aug 4 09:39:40 2018 13 // Update Count : 853 14 14 // 15 15 … … 68 68 } 69 69 70 virtual void print( __attribute__((unused)) std::ostream & os, __attribute__((unused)) int indent = 0 ) const {}71 virtual void printList( std::ostream & os, int indent = 0 ) const {70 virtual void print( __attribute__((unused)) std::ostream & os, __attribute__((unused)) int indent = 0 ) const {} 71 virtual void printList( std::ostream & os, int indent = 0 ) const { 72 72 print( os, indent ); 73 73 if ( next ) next->print( os, indent ); … … 77 77 78 78 ParseNode * next = nullptr; 79 std::string * name = nullptr;79 const std::string * name = nullptr; 80 80 CodeLocation location = yylloc; 81 81 }; // ParseNode … … 87 87 InitializerNode( ExpressionNode *, bool aggrp = false, ExpressionNode * des = nullptr ); 88 88 InitializerNode( InitializerNode *, bool aggrp = false, ExpressionNode * des = nullptr ); 89 InitializerNode( bool isDelete ); 89 90 ~InitializerNode(); 90 91 virtual InitializerNode * clone() const { assert( false ); return nullptr; } … … 98 99 bool get_maybeConstructed() const { return maybeConstructed; } 99 100 101 bool get_isDelete() const { return isDelete; } 102 100 103 InitializerNode * next_init() const { return kids; } 101 104 102 void print( std::ostream & os, int indent = 0 ) const;105 void print( std::ostream & os, int indent = 0 ) const; 103 106 void printOneLine( std::ostream & ) const; 104 107 … … 110 113 InitializerNode * kids; 111 114 bool maybeConstructed; 115 bool isDelete; 112 116 }; // InitializerNode 113 117 … … 123 127 ExpressionNode * set_extension( bool exten ) { extension = exten; return this; } 124 128 125 virtual void print( std::ostream &os, __attribute__((unused)) int indent = 0 ) const override { 126 os << expr.get() << std::endl; 127 } 128 void printOneLine( __attribute__((unused)) std::ostream &os, __attribute__((unused)) int indent = 0 ) const {} 129 129 virtual void print( std::ostream & os, __attribute__((unused)) int indent = 0 ) const override { 130 os << expr.get(); 131 } 132 void printOneLine( __attribute__((unused)) std::ostream & os, __attribute__((unused)) int indent = 0 ) const {} 133 134 Expression *get_expr() const { return expr.get(); } 130 135 template<typename T> 131 136 bool isExpressionType() const { return nullptr != dynamic_cast<T>(expr.get()); } … … 167 172 }; 168 173 169 Expression * build_constantInteger( std::string & str );170 Expression * build_constantFloat( std::string & str );171 Expression * build_constantChar( std::string & str );172 Expression * build_constantStr( std::string & str );174 Expression * build_constantInteger( std::string & str ); // these 4 routines modify the string 175 Expression * build_constantFloat( std::string & str ); 176 Expression * build_constantChar( std::string & str ); 177 Expression * build_constantStr( std::string & str ); 173 178 Expression * build_field_name_FLOATING_FRACTIONconstant( const std::string & str ); 174 179 Expression * build_field_name_FLOATING_DECIMALconstant( const std::string & str ); … … 179 184 180 185 Expression * build_cast( DeclarationNode * decl_node, ExpressionNode * expr_node ); 186 Expression * build_keyword_cast( KeywordCastExpr::Target target, ExpressionNode * expr_node ); 181 187 Expression * build_virtual_cast( DeclarationNode * decl_node, ExpressionNode * expr_node ); 182 188 Expression * build_fieldSel( ExpressionNode * expr_node, Expression * member ); … … 209 215 enum Length { Short, Long, LongLong, NoLength }; 210 216 static const char * lengthNames[]; 211 enum Aggregate { Struct, Union, Trait, Coroutine, Monitor, Thread, NoAggregate };217 enum Aggregate { Struct, Union, Exception, Trait, Coroutine, Monitor, Thread, NoAggregate }; 212 218 static const char * aggregateNames[]; 213 219 enum TypeClass { Otype, Dtype, Ftype, Ttype, NoTypeClass }; … … 225 231 static DeclarationNode * newBuiltinType( BuiltinType ); 226 232 static DeclarationNode * newForall( DeclarationNode * ); 227 static DeclarationNode * newFromTypedef( std::string * ); 228 static DeclarationNode * newFunction( std::string * name, DeclarationNode * ret, DeclarationNode * param, StatementNode * body, bool newStyle = false ); 233 static DeclarationNode * newFromTypedef( const std::string * ); 234 static DeclarationNode * newFromGlobalScope(); 235 static DeclarationNode * newQualifiedType( DeclarationNode *, DeclarationNode * ); 236 static DeclarationNode * newFunction( const std::string * name, DeclarationNode * ret, DeclarationNode * param, StatementNode * body ); 229 237 static DeclarationNode * newAggregate( Aggregate kind, const std::string * name, ExpressionNode * actuals, DeclarationNode * fields, bool body ); 230 static DeclarationNode * newEnum( std::string * name, DeclarationNode * constants, bool body );231 static DeclarationNode * newEnumConstant( std::string * name, ExpressionNode * constant );232 static DeclarationNode * newName( std::string * );233 static DeclarationNode * newFromTypeGen( std::string *, ExpressionNode * params );234 static DeclarationNode * newTypeParam( TypeClass, std::string * );238 static DeclarationNode * newEnum( const std::string * name, DeclarationNode * constants, bool body ); 239 static DeclarationNode * newEnumConstant( const std::string * name, ExpressionNode * constant ); 240 static DeclarationNode * newName( const std::string * ); 241 static DeclarationNode * newFromTypeGen( const std::string *, ExpressionNode * params ); 242 static DeclarationNode * newTypeParam( TypeClass, const std::string * ); 235 243 static DeclarationNode * newTrait( const std::string * name, DeclarationNode * params, DeclarationNode * asserts ); 236 244 static DeclarationNode * newTraitUse( const std::string * name, ExpressionNode * params ); 237 static DeclarationNode * newTypeDecl( std::string * name, DeclarationNode * typeParams );245 static DeclarationNode * newTypeDecl( const std::string * name, DeclarationNode * typeParams ); 238 246 static DeclarationNode * newPointer( DeclarationNode * qualifiers, OperKinds kind ); 239 247 static DeclarationNode * newArray( ExpressionNode * size, DeclarationNode * qualifiers, bool isStatic ); … … 242 250 static DeclarationNode * newTuple( DeclarationNode * members ); 243 251 static DeclarationNode * newTypeof( ExpressionNode * expr ); 244 static DeclarationNode * newAttr( std::string *, ExpressionNode * expr ); // @ attributes245 static DeclarationNode * newAttr( std::string *, DeclarationNode * type ); // @ attributes246 static DeclarationNode * newAttribute( std::string *, ExpressionNode * expr = nullptr ); // gcc attributes252 static DeclarationNode * newAttr( const std::string *, ExpressionNode * expr ); // @ attributes 253 static DeclarationNode * newAttr( const std::string *, DeclarationNode * type ); // @ attributes 254 static DeclarationNode * newAttribute( const std::string *, ExpressionNode * expr = nullptr ); // gcc attributes 247 255 static DeclarationNode * newAsmStmt( StatementNode * stmt ); // gcc external asm statement 256 static DeclarationNode * newStaticAssert( ExpressionNode * condition, Expression * message ); 248 257 249 258 DeclarationNode(); … … 262 271 DeclarationNode * addBitfield( ExpressionNode * size ); 263 272 DeclarationNode * addVarArgs(); 264 DeclarationNode * addFunctionBody( StatementNode * body, StatementNode * with = nullptr );273 DeclarationNode * addFunctionBody( StatementNode * body, ExpressionNode * with = nullptr ); 265 274 DeclarationNode * addOldDeclList( DeclarationNode * list ); 266 275 DeclarationNode * setBase( TypeData * newType ); … … 282 291 } 283 292 284 virtual void print( __attribute__((unused)) std::ostream & os, __attribute__((unused)) int indent = 0 ) const override;285 virtual void printList( __attribute__((unused)) std::ostream & os, __attribute__((unused)) int indent = 0 ) const override;293 virtual void print( __attribute__((unused)) std::ostream & os, __attribute__((unused)) int indent = 0 ) const override; 294 virtual void printList( __attribute__((unused)) std::ostream & os, __attribute__((unused)) int indent = 0 ) const override; 286 295 287 296 Declaration * build() const; 288 297 Type * buildType() const; 289 298 290 bool get_hasEllipsis() const;291 299 LinkageSpec::Spec get_linkage() const { return linkage; } 292 300 DeclarationNode * extractAggregate() const; … … 296 304 bool get_extension() const { return extension; } 297 305 DeclarationNode * set_extension( bool exten ) { extension = exten; return this; } 306 307 bool get_inLine() const { return inLine; } 308 DeclarationNode * set_inLine( bool inL ) { inLine = inL; return this; } 298 309 public: 299 310 DeclarationNode * get_last() { return (DeclarationNode *)ParseNode::get_last(); } … … 314 325 Attr_t attr; 315 326 316 BuiltinType builtin; 317 318 TypeData * type; 319 327 struct StaticAssert_t { 328 ExpressionNode * condition; 329 Expression * message; 330 }; 331 StaticAssert_t assert; 332 333 BuiltinType builtin = NoBuiltinType; 334 335 TypeData * type = nullptr; 336 337 bool inLine = false; 320 338 Type::FuncSpecifiers funcSpecs; 321 339 Type::StorageClasses storageClasses; 322 340 323 ExpressionNode * bitfieldWidth ;341 ExpressionNode * bitfieldWidth = nullptr; 324 342 std::unique_ptr<ExpressionNode> enumeratorValue; 325 bool hasEllipsis ;343 bool hasEllipsis = false; 326 344 LinkageSpec::Spec linkage; 327 Expression * asmName;345 Expression * asmName = nullptr; 328 346 std::list< Attribute * > attributes; 329 InitializerNode * initializer ;347 InitializerNode * initializer = nullptr; 330 348 bool extension = false; 331 349 std::string error; 332 StatementNode * asmStmt ;350 StatementNode * asmStmt = nullptr; 333 351 334 352 static UniqueName anonymous; … … 364 382 virtual StatementNode * append_last_case( StatementNode * ); 365 383 366 virtual void print( std::ostream & os, __attribute__((unused)) int indent = 0 ) const override {384 virtual void print( std::ostream & os, __attribute__((unused)) int indent = 0 ) const override { 367 385 os << stmt.get() << std::endl; 368 386 } … … 373 391 Statement * build_expr( ExpressionNode * ctl ); 374 392 375 struct IfCt l {376 IfCt l( DeclarationNode * decl, ExpressionNode * condition ) :393 struct IfCtrl { 394 IfCtrl( DeclarationNode * decl, ExpressionNode * condition ) : 377 395 init( decl ? new StatementNode( decl ) : nullptr ), condition( condition ) {} 378 396 … … 381 399 }; 382 400 383 struct ForCt l {384 ForCt l( ExpressionNode * expr, ExpressionNode * condition, ExpressionNode * change ) :401 struct ForCtrl { 402 ForCtrl( ExpressionNode * expr, ExpressionNode * condition, ExpressionNode * change ) : 385 403 init( new StatementNode( build_expr( expr ) ) ), condition( condition ), change( change ) {} 386 ForCt l( DeclarationNode * decl, ExpressionNode * condition, ExpressionNode * change ) :404 ForCtrl( DeclarationNode * decl, ExpressionNode * condition, ExpressionNode * change ) : 387 405 init( new StatementNode( decl ) ), condition( condition ), change( change ) {} 388 406 … … 392 410 }; 393 411 394 Statement * build_if( IfCtl * ctl, StatementNode * then_stmt, StatementNode * else_stmt ); 395 Statement * build_switch( ExpressionNode * ctl, StatementNode * stmt ); 412 Expression * build_if_control( IfCtrl * ctl, std::list< Statement * > & init ); 413 Statement * build_if( IfCtrl * ctl, StatementNode * then_stmt, StatementNode * else_stmt ); 414 Statement * build_switch( bool isSwitch, ExpressionNode * ctl, StatementNode * stmt ); 396 415 Statement * build_case( ExpressionNode * ctl ); 397 416 Statement * build_default(); 398 Statement * build_while( ExpressionNode * ctl, StatementNode * stmt, bool kind = false ); 399 Statement * build_for( ForCtl * forctl, StatementNode * stmt ); 417 Statement * build_while( IfCtrl * ctl, StatementNode * stmt ); 418 Statement * build_do_while( ExpressionNode * ctl, StatementNode * stmt ); 419 Statement * build_for( ForCtrl * forctl, StatementNode * stmt ); 400 420 Statement * build_branch( BranchStmt::Type kind ); 401 421 Statement * build_branch( std::string * identifier, BranchStmt::Type kind ); … … 409 429 Statement * build_finally( StatementNode * stmt ); 410 430 Statement * build_compound( StatementNode * first ); 411 Statement * build_asmstmt( bool voltile, Expression * instruction, ExpressionNode * output = nullptr, ExpressionNode * input = nullptr, ExpressionNode * clobber = nullptr, LabelNode * gotolabels = nullptr ); 431 Statement * build_asm( bool voltile, Expression * instruction, ExpressionNode * output = nullptr, ExpressionNode * input = nullptr, ExpressionNode * clobber = nullptr, LabelNode * gotolabels = nullptr ); 432 Statement * build_directive( std::string * directive ); 412 433 WaitForStmt * build_waitfor( ExpressionNode * target, StatementNode * stmt, ExpressionNode * when ); 413 434 WaitForStmt * build_waitfor( ExpressionNode * target, StatementNode * stmt, ExpressionNode * when, WaitForStmt * existing ); … … 419 440 420 441 template< typename SynTreeType, typename NodeType, template< typename, typename...> class Container, typename... Args > 421 void buildList( const NodeType * firstNode, Container< SynTreeType *, Args... > & outputList ) {422 SemanticError errors;442 void buildList( const NodeType * firstNode, Container< SynTreeType *, Args... > & outputList ) { 443 SemanticErrorException errors; 423 444 std::back_insert_iterator< Container< SynTreeType *, Args... > > out( outputList ); 424 445 const NodeType * cur = firstNode; … … 433 454 assertf(false, "buildList unknown type"); 434 455 } // if 435 } catch( SemanticError &e ) { 436 e.set_location( cur->location ); 456 } catch( SemanticErrorException & e ) { 437 457 errors.append( e ); 438 458 } // try … … 445 465 446 466 // in DeclarationNode.cc 447 void buildList( const DeclarationNode * firstNode, std::list< Declaration * > & outputList );448 void buildList( const DeclarationNode * firstNode, std::list< DeclarationWithType * > & outputList );449 void buildTypeList( const DeclarationNode * firstNode, std::list< Type * > & outputList );467 void buildList( const DeclarationNode * firstNode, std::list< Declaration * > & outputList ); 468 void buildList( const DeclarationNode * firstNode, std::list< DeclarationWithType * > & outputList ); 469 void buildTypeList( const DeclarationNode * firstNode, std::list< Type * > & outputList ); 450 470 451 471 template< typename SynTreeType, typename NodeType > 452 void buildMoveList( const NodeType * firstNode, std::list< SynTreeType * > & outputList ) {472 void buildMoveList( const NodeType * firstNode, std::list< SynTreeType * > & outputList ) { 453 473 buildList( firstNode, outputList ); 454 474 delete firstNode; -
src/Parser/StatementNode.cc
rf9feab8 r90152a4 10 10 // Created On : Sat May 16 14:59:41 2015 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Fri Sep 1 23:25:23 201713 // Update Count : 3 4612 // Last Modified On : Sat Aug 4 09:39:25 2018 13 // Update Count : 363 14 14 // 15 15 … … 33 33 34 34 35 StatementNode::StatementNode( DeclarationNode * decl ) {35 StatementNode::StatementNode( DeclarationNode * decl ) { 36 36 assert( decl ); 37 DeclarationNode * agg = decl->extractAggregate();37 DeclarationNode * agg = decl->extractAggregate(); 38 38 if ( agg ) { 39 StatementNode * nextStmt = new StatementNode( new DeclStmt( maybeBuild< Declaration >( decl ) ) );39 StatementNode * nextStmt = new StatementNode( new DeclStmt( maybeBuild< Declaration >( decl ) ) ); 40 40 set_next( nextStmt ); 41 41 if ( decl->get_next() ) { … … 53 53 } // StatementNode::StatementNode 54 54 55 StatementNode * StatementNode::append_last_case( StatementNode *stmt ) {56 StatementNode * prev = this;55 StatementNode * StatementNode::append_last_case( StatementNode * stmt ) { 56 StatementNode * prev = this; 57 57 // find end of list and maintain previous pointer 58 58 for ( StatementNode * curr = prev; curr != nullptr; curr = (StatementNode *)curr->get_next() ) { 59 StatementNode * node = strict_dynamic_cast< StatementNode * >(curr);59 StatementNode * node = strict_dynamic_cast< StatementNode * >(curr); 60 60 assert( dynamic_cast< CaseStmt * >(node->stmt.get()) ); 61 61 prev = curr; 62 62 } // for 63 63 // convert from StatementNode list to Statement list 64 StatementNode * node = dynamic_cast< StatementNode * >(prev);64 StatementNode * node = dynamic_cast< StatementNode * >(prev); 65 65 std::list< Statement * > stmts; 66 66 buildMoveList( stmt, stmts ); … … 69 69 caseStmt->get_statements().splice( caseStmt->get_statements().end(), stmts ); 70 70 return this; 71 } 72 73 Statement *build_expr( ExpressionNode *ctl ) { 74 Expression *e = maybeMoveBuild< Expression >( ctl ); 75 76 if ( e ) 77 return new ExprStmt( e ); 78 else 79 return new NullStmt(); 80 } 81 82 Statement *build_if( IfCtl * ctl, StatementNode *then_stmt, StatementNode *else_stmt ) { 83 Statement *thenb, *elseb = 0; 84 std::list< Statement * > branches; 85 buildMoveList< Statement, StatementNode >( then_stmt, branches ); 86 assert( branches.size() == 1 ); 87 thenb = branches.front(); 88 89 if ( else_stmt ) { 90 std::list< Statement * > branches; 91 buildMoveList< Statement, StatementNode >( else_stmt, branches ); 92 assert( branches.size() == 1 ); 93 elseb = branches.front(); 94 } // if 95 96 std::list< Statement * > init; 71 } // StatementNode::append_last_case 72 73 Statement * build_expr( ExpressionNode * ctl ) { 74 Expression * e = maybeMoveBuild< Expression >( ctl ); 75 76 if ( e ) return new ExprStmt( e ); 77 else return new NullStmt(); 78 } // build_expr 79 80 Expression * build_if_control( IfCtrl * ctl, std::list< Statement * > & init ) { 97 81 if ( ctl->init != 0 ) { 98 82 buildMoveList( ctl->init, init ); … … 102 86 if ( ctl->condition ) { 103 87 // compare the provided condition against 0 104 cond = notZeroExpr( maybeMoveBuild< Expression >(ctl->condition) );88 cond = notZeroExpr( maybeMoveBuild< Expression >(ctl->condition) ); 105 89 } else { 106 90 for ( Statement * stmt : init ) { … … 113 97 } 114 98 delete ctl; 99 return cond; 100 } // build_if_control 101 102 Statement * build_if( IfCtrl * ctl, StatementNode * then_stmt, StatementNode * else_stmt ) { 103 Statement * thenb, * elseb = nullptr; 104 std::list< Statement * > branches; 105 buildMoveList< Statement, StatementNode >( then_stmt, branches ); 106 assert( branches.size() == 1 ); 107 thenb = branches.front(); 108 109 if ( else_stmt ) { 110 std::list< Statement * > branches; 111 buildMoveList< Statement, StatementNode >( else_stmt, branches ); 112 assert( branches.size() == 1 ); 113 elseb = branches.front(); 114 } // if 115 116 std::list< Statement * > init; 117 Expression * cond = build_if_control( ctl, init ); 115 118 return new IfStmt( cond, thenb, elseb, init ); 116 } 117 118 Statement *build_switch( ExpressionNode *ctl, StatementNode *stmt ) { 119 std::list< Statement * > branches; 120 buildMoveList< Statement, StatementNode >( stmt, branches ); 119 } // build_if 120 121 Statement * build_switch( bool isSwitch, ExpressionNode * ctl, StatementNode * stmt ) { 122 std::list< Statement * > branches; 123 buildMoveList< Statement, StatementNode >( stmt, branches ); 124 if ( ! isSwitch ) { // choose statement 125 for ( Statement * stmt : branches ) { 126 CaseStmt * caseStmt = strict_dynamic_cast< CaseStmt * >( stmt ); 127 if ( ! caseStmt->stmts.empty() ) { // code after "case" => end of case list 128 CompoundStmt * block = strict_dynamic_cast< CompoundStmt * >( caseStmt->stmts.front() ); 129 block->kids.push_back( new BranchStmt( "", BranchStmt::Break ) ); 130 } // if 131 } // for 132 } // if 121 133 // branches.size() == 0 for switch (...) {}, i.e., no declaration or statements 122 134 return new SwitchStmt( maybeMoveBuild< Expression >(ctl), branches ); 123 } 124 Statement *build_case( ExpressionNode *ctl ) { 135 } // build_switch 136 137 Statement * build_case( ExpressionNode * ctl ) { 125 138 std::list< Statement * > branches; 126 139 return new CaseStmt( maybeMoveBuild< Expression >(ctl), branches ); 127 } 128 Statement *build_default() { 140 } // build_case 141 142 Statement * build_default() { 129 143 std::list< Statement * > branches; 130 144 return new CaseStmt( nullptr, branches, true ); 131 } 132 133 Statement *build_while( ExpressionNode *ctl, StatementNode *stmt, bool kind ) { 134 std::list< Statement * > branches; 135 buildMoveList< Statement, StatementNode >( stmt, branches ); 136 assert( branches.size() == 1 ); 137 return new WhileStmt( notZeroExpr( maybeMoveBuild< Expression >(ctl) ), branches.front(), kind ); 138 } 139 140 Statement *build_for( ForCtl *forctl, StatementNode *stmt ) { 145 } // build_default 146 147 Statement * build_while( IfCtrl * ctl, StatementNode * stmt ) { 148 std::list< Statement * > branches; 149 buildMoveList< Statement, StatementNode >( stmt, branches ); 150 assert( branches.size() == 1 ); 151 152 std::list< Statement * > init; 153 Expression * cond = build_if_control( ctl, init ); 154 return new WhileStmt( cond, branches.front(), init, false ); 155 } // build_while 156 157 Statement * build_do_while( ExpressionNode * ctl, StatementNode * stmt ) { 158 std::list< Statement * > branches; 159 buildMoveList< Statement, StatementNode >( stmt, branches ); 160 assert( branches.size() == 1 ); 161 162 std::list< Statement * > init; 163 return new WhileStmt( notZeroExpr( maybeMoveBuild< Expression >(ctl) ), branches.front(), init, true ); 164 } // build_do_while 165 166 Statement * build_for( ForCtrl * forctl, StatementNode * stmt ) { 141 167 std::list< Statement * > branches; 142 168 buildMoveList< Statement, StatementNode >( stmt, branches ); … … 148 174 } // if 149 175 150 Expression * cond = 0;176 Expression * cond = 0; 151 177 if ( forctl->condition != 0 ) 152 178 cond = notZeroExpr( maybeMoveBuild< Expression >(forctl->condition) ); 153 179 154 Expression * incr = 0;180 Expression * incr = 0; 155 181 if ( forctl->change != 0 ) 156 182 incr = maybeMoveBuild< Expression >(forctl->change); … … 158 184 delete forctl; 159 185 return new ForStmt( init, cond, incr, branches.front() ); 160 } 161 162 Statement * build_branch( BranchStmt::Type kind ) {186 } // build_for 187 188 Statement * build_branch( BranchStmt::Type kind ) { 163 189 Statement * ret = new BranchStmt( "", kind ); 164 190 return ret; 165 } 166 Statement *build_branch( std::string *identifier, BranchStmt::Type kind ) { 167 Statement * ret = new BranchStmt( *identifier, kind ); 191 } // build_branch 192 193 Statement * build_branch( std::string * identifier, BranchStmt::Type kind ) { 194 Statement * ret = new BranchStmt( * identifier, kind ); 168 195 delete identifier; // allocated by lexer 169 196 return ret; 170 } 171 Statement *build_computedgoto( ExpressionNode *ctl ) { 197 } // build_branch 198 199 Statement * build_computedgoto( ExpressionNode * ctl ) { 172 200 return new BranchStmt( maybeMoveBuild< Expression >(ctl), BranchStmt::Goto ); 173 } 174 175 Statement * build_return( ExpressionNode *ctl ) {201 } // build_computedgoto 202 203 Statement * build_return( ExpressionNode * ctl ) { 176 204 std::list< Expression * > exps; 177 205 buildMoveList( ctl, exps ); 178 206 return new ReturnStmt( exps.size() > 0 ? exps.back() : nullptr ); 179 } 180 181 Statement * build_throw( ExpressionNode *ctl ) {207 } // build_return 208 209 Statement * build_throw( ExpressionNode * ctl ) { 182 210 std::list< Expression * > exps; 183 211 buildMoveList( ctl, exps ); 184 212 assertf( exps.size() < 2, "This means we are leaking memory"); 185 213 return new ThrowStmt( ThrowStmt::Terminate, !exps.empty() ? exps.back() : nullptr ); 186 } 187 188 Statement * build_resume( ExpressionNode *ctl ) {214 } // build_throw 215 216 Statement * build_resume( ExpressionNode * ctl ) { 189 217 std::list< Expression * > exps; 190 218 buildMoveList( ctl, exps ); 191 219 assertf( exps.size() < 2, "This means we are leaking memory"); 192 220 return new ThrowStmt( ThrowStmt::Resume, !exps.empty() ? exps.back() : nullptr ); 193 } 194 195 Statement * build_resume_at( ExpressionNode *ctl, ExpressionNode *target ) {221 } // build_resume 222 223 Statement * build_resume_at( ExpressionNode * ctl, ExpressionNode * target ) { 196 224 (void)ctl; 197 225 (void)target; 198 226 assertf( false, "resume at (non-local throw) is not yet supported," ); 199 } 200 201 Statement * build_try( StatementNode *try_stmt, StatementNode *catch_stmt, StatementNode *finally_stmt ) {227 } // build_resume_at 228 229 Statement * build_try( StatementNode * try_stmt, StatementNode * catch_stmt, StatementNode * finally_stmt ) { 202 230 std::list< CatchStmt * > branches; 203 231 buildMoveList< CatchStmt, StatementNode >( catch_stmt, branches ); 204 CompoundStmt * tryBlock = strict_dynamic_cast< CompoundStmt * >(maybeMoveBuild< Statement >(try_stmt));205 FinallyStmt * finallyBlock = dynamic_cast< FinallyStmt * >(maybeMoveBuild< Statement >(finally_stmt) );232 CompoundStmt * tryBlock = strict_dynamic_cast< CompoundStmt * >(maybeMoveBuild< Statement >(try_stmt)); 233 FinallyStmt * finallyBlock = dynamic_cast< FinallyStmt * >(maybeMoveBuild< Statement >(finally_stmt) ); 206 234 return new TryStmt( tryBlock, branches, finallyBlock ); 207 } 208 Statement *build_catch( CatchStmt::Kind kind, DeclarationNode *decl, ExpressionNode *cond, StatementNode *body ) { 235 } // build_try 236 237 Statement * build_catch( CatchStmt::Kind kind, DeclarationNode * decl, ExpressionNode * cond, StatementNode * body ) { 209 238 std::list< Statement * > branches; 210 239 buildMoveList< Statement, StatementNode >( body, branches ); 211 240 assert( branches.size() == 1 ); 212 241 return new CatchStmt( kind, maybeMoveBuild< Declaration >(decl), maybeMoveBuild< Expression >(cond), branches.front() ); 213 } 214 Statement *build_finally( StatementNode *stmt ) { 242 } // build_catch 243 244 Statement * build_finally( StatementNode * stmt ) { 215 245 std::list< Statement * > branches; 216 246 buildMoveList< Statement, StatementNode >( stmt, branches ); 217 247 assert( branches.size() == 1 ); 218 248 return new FinallyStmt( dynamic_cast< CompoundStmt * >( branches.front() ) ); 219 } 249 } // build_finally 220 250 221 251 WaitForStmt * build_waitfor( ExpressionNode * targetExpr, StatementNode * stmt, ExpressionNode * when ) { … … 238 268 239 269 return node; 240 } 270 } // build_waitfor 241 271 242 272 WaitForStmt * build_waitfor( ExpressionNode * targetExpr, StatementNode * stmt, ExpressionNode * when, WaitForStmt * node ) { … … 257 287 258 288 return node; 259 } 289 } // build_waitfor 260 290 261 291 WaitForStmt * build_waitfor_timeout( ExpressionNode * timeout, StatementNode * stmt, ExpressionNode * when ) { … … 266 296 node->timeout.statement = maybeMoveBuild<Statement >( stmt ); 267 297 node->timeout.condition = notZeroExpr( maybeMoveBuild<Expression>( when ) ); 268 } 269 else { 298 } else { 270 299 node->orelse.statement = maybeMoveBuild<Statement >( stmt ); 271 300 node->orelse.condition = notZeroExpr( maybeMoveBuild<Expression>( when ) ); 272 } 301 } // if 273 302 274 303 return node; 275 } 304 } // build_waitfor_timeout 276 305 277 306 WaitForStmt * build_waitfor_timeout( ExpressionNode * timeout, StatementNode * stmt, ExpressionNode * when, StatementNode * else_stmt, ExpressionNode * else_when ) { … … 286 315 287 316 return node; 288 } 317 } // build_waitfor_timeout 289 318 290 319 WithStmt * build_with( ExpressionNode * exprs, StatementNode * stmt ) { … … 293 322 Statement * s = maybeMoveBuild<Statement>( stmt ); 294 323 return new WithStmt( e, s ); 295 } 296 297 Statement * build_compound( StatementNode *first ) {298 CompoundStmt * cs = new CompoundStmt();324 } // build_with 325 326 Statement * build_compound( StatementNode * first ) { 327 CompoundStmt * cs = new CompoundStmt(); 299 328 buildMoveList( first, cs->get_kids() ); 300 329 return cs; 301 } 302 303 Statement * build_asmstmt( bool voltile, Expression *instruction, ExpressionNode *output, ExpressionNode *input, ExpressionNode *clobber, LabelNode *gotolabels ) {330 } // build_compound 331 332 Statement * build_asm( bool voltile, Expression * instruction, ExpressionNode * output, ExpressionNode * input, ExpressionNode * clobber, LabelNode * gotolabels ) { 304 333 std::list< Expression * > out, in; 305 334 std::list< ConstantExpr * > clob; … … 309 338 buildMoveList( clobber, clob ); 310 339 return new AsmStmt( voltile, instruction, out, in, clob, gotolabels ? gotolabels->labels : noLabels ); 311 } 340 } // build_asm 341 342 Statement * build_directive( string * directive ) { 343 return new DirectiveStmt( *directive ); 344 } // build_directive 312 345 313 346 // Local Variables: // -
src/Parser/TypeData.cc
rf9feab8 r90152a4 10 10 // Created On : Sat May 16 15:12:51 2015 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Mon Sep 25 18:33:41 201713 // Update Count : 58712 // Last Modified On : Fri Jul 20 14:39:31 2018 13 // Update Count : 622 14 14 // 15 15 … … 31 31 using namespace std; 32 32 33 TypeData::TypeData( Kind k ) : kind( k ), base( nullptr ), forall( nullptr ) /*, PTR1( (void*)(0xdeadbeefdeadbeef)), PTR2( (void*)(0xdeadbeefdeadbeef) ) */ {33 TypeData::TypeData( Kind k ) : location( yylloc ), kind( k ), base( nullptr ), forall( nullptr ) /*, PTR1( (void*)(0xdeadbeefdeadbeef)), PTR2( (void*)(0xdeadbeefdeadbeef) ) */ { 34 34 switch ( kind ) { 35 35 case Unknown: … … 37 37 case Reference: 38 38 case EnumConstant: 39 case GlobalScope: 39 40 // nothing else to initialize 40 41 break; … … 54 55 function.oldDeclList = nullptr; 55 56 function.body = nullptr; 56 function. newStyle = false;57 function.withExprs = nullptr; 57 58 break; 58 59 // Enum is an Aggregate, so both structures are initialized together. … … 62 63 enumeration.constants = nullptr; 63 64 enumeration.body = false; 65 enumeration.anon = false; 66 break; 64 67 case Aggregate: 65 68 // aggregate = new Aggregate_t; 69 aggregate.kind = DeclarationNode::NoAggregate; 66 70 aggregate.name = nullptr; 67 71 aggregate.params = nullptr; … … 69 73 aggregate.fields = nullptr; 70 74 aggregate.body = false; 75 aggregate.tagged = false; 76 aggregate.parent = nullptr; 77 aggregate.anon = false; 71 78 break; 72 79 case AggregateInst: … … 74 81 aggInst.aggregate = nullptr; 75 82 aggInst.params = nullptr; 76 aggInst.hoistType = false; ;83 aggInst.hoistType = false; 77 84 break; 78 85 case Symbolic: … … 94 101 case Builtin: 95 102 // builtin = new Builtin_t; 103 case Qualified: 104 qualified.parent = nullptr; 105 qualified.child = nullptr; 96 106 break; 97 107 } // switch … … 108 118 case Reference: 109 119 case EnumConstant: 120 case GlobalScope: 110 121 // nothing to destroy 111 122 break; … … 122 133 delete function.oldDeclList; 123 134 delete function.body; 135 delete function.withExprs; 124 136 // delete function; 125 137 break; … … 160 172 // delete builtin; 161 173 break; 174 case Qualified: 175 delete qualified.parent; 176 delete qualified.child; 162 177 } // switch 163 178 } // TypeData::~TypeData … … 175 190 case Pointer: 176 191 case Reference: 192 case GlobalScope: 177 193 // nothing else to copy 178 194 break; … … 193 209 newtype->function.oldDeclList = maybeClone( function.oldDeclList ); 194 210 newtype->function.body = maybeClone( function.body ); 195 newtype->function. newStyle = function.newStyle;211 newtype->function.withExprs = maybeClone( function.withExprs ); 196 212 break; 197 213 case Aggregate: 214 newtype->aggregate.kind = aggregate.kind; 198 215 newtype->aggregate.name = aggregate.name ? new string( *aggregate.name ) : nullptr; 199 216 newtype->aggregate.params = maybeClone( aggregate.params ); 200 217 newtype->aggregate.actuals = maybeClone( aggregate.actuals ); 201 218 newtype->aggregate.fields = maybeClone( aggregate.fields ); 202 newtype->aggregate.kind = aggregate.kind;203 219 newtype->aggregate.body = aggregate.body; 220 newtype->aggregate.anon = aggregate.anon; 204 221 newtype->aggregate.tagged = aggregate.tagged; 205 222 newtype->aggregate.parent = aggregate.parent ? new string( *aggregate.parent ) : nullptr; … … 214 231 newtype->enumeration.constants = maybeClone( enumeration.constants ); 215 232 newtype->enumeration.body = enumeration.body; 233 newtype->enumeration.anon = enumeration.anon; 216 234 break; 217 235 case Symbolic: … … 233 251 newtype->builtintype = builtintype; 234 252 break; 253 case Qualified: 254 newtype->qualified.parent = maybeClone( qualified.parent ); 255 newtype->qualified.child = maybeClone( qualified.child ); 256 break; 235 257 } // switch 236 258 return newtype; … … 249 271 250 272 switch ( kind ) { 251 case Unknown: 252 os << "entity of unknown type "; 273 case Basic: 274 if ( signedness != DeclarationNode::NoSignedness ) os << DeclarationNode::signednessNames[ signedness ] << " "; 275 if ( length != DeclarationNode::NoLength ) os << DeclarationNode::lengthNames[ length ] << " "; 276 if ( complextype == DeclarationNode::NoComplexType ) { // basic type 277 assert( basictype != DeclarationNode::NoBasicType ); 278 os << DeclarationNode::basicTypeNames[ basictype ] << " "; 279 } else { // complex type 280 // handle double _Complex 281 if ( basictype != DeclarationNode::NoBasicType ) os << DeclarationNode::basicTypeNames[ basictype ] << " "; 282 os << DeclarationNode::complexTypeNames[ complextype ] << " "; 283 } // if 253 284 break; 254 285 case Pointer: … … 259 290 } // if 260 291 break; 261 case EnumConstant: 262 os << "enumeration constant "; 263 break; 264 case Basic: 265 if ( signedness != DeclarationNode::NoSignedness ) os << DeclarationNode::signednessNames[ signedness ] << " "; 266 if ( length != DeclarationNode::NoLength ) os << DeclarationNode::lengthNames[ length ] << " "; 267 assert( basictype != DeclarationNode::NoBasicType ); 268 os << DeclarationNode::basicTypeNames[ basictype ] << " "; 269 if ( complextype != DeclarationNode::NoComplexType ) os << DeclarationNode::complexTypeNames[ complextype ] << " "; 292 case Reference: 293 os << "reference "; 294 if ( base ) { 295 os << "to "; 296 base->print( os, indent ); 297 } // if 270 298 break; 271 299 case Array: … … 353 381 } // if 354 382 break; 355 case SymbolicInst: 356 os << "instance of type " << *symbolic.name; 357 if ( symbolic.actuals ) { 358 os << " with parameters" << endl; 359 symbolic.actuals->printList( os, indent + 2 ); 360 } // if 383 case EnumConstant: 384 os << "enumeration constant "; 361 385 break; 362 386 case Symbolic: … … 380 404 } // if 381 405 break; 406 case SymbolicInst: 407 os << *symbolic.name; 408 if ( symbolic.actuals ) { 409 os << "("; 410 symbolic.actuals->printList( os, indent + 2 ); 411 os << ")"; 412 } // if 413 break; 382 414 case Tuple: 383 415 os << "tuple "; … … 394 426 break; 395 427 case Builtin: 396 os << "gcc builtin type"; 428 os << DeclarationNode::builtinTypeNames[builtintype]; 429 break; 430 case GlobalScope: 431 break; 432 case Qualified: 433 qualified.parent->print( os ); 434 os << "."; 435 qualified.child->print( os ); 436 break; 437 case Unknown: 438 os << "entity of unknown type "; 397 439 break; 398 440 default: … … 401 443 } // switch 402 444 } // TypeData::print 445 446 const std::string * TypeData::leafName() const { 447 switch ( kind ) { 448 case Unknown: 449 case Pointer: 450 case Reference: 451 case EnumConstant: 452 case GlobalScope: 453 case Array: 454 case Basic: 455 case Function: 456 case AggregateInst: 457 case Tuple: 458 case Typeof: 459 case Builtin: 460 assertf(false, "Tried to get leaf name from kind without a name: %d", kind); 461 break; 462 case Aggregate: 463 return aggregate.name; 464 case Enum: 465 return enumeration.name; 466 case Symbolic: 467 case SymbolicInst: 468 return symbolic.name; 469 case Qualified: 470 return qualified.child->leafName(); 471 } // switch 472 assert(false); 473 } 403 474 404 475 … … 460 531 return new EnumInstType( buildQualifiers( td ), "" ); 461 532 case TypeData::SymbolicInst: 462 return buildSymbolicInst( td ); ;533 return buildSymbolicInst( td ); 463 534 case TypeData::Tuple: 464 535 return buildTuple( td ); … … 475 546 return new VarArgsType( buildQualifiers( td ) ); 476 547 } 548 case TypeData::GlobalScope: 549 return new GlobalScopeType(); 550 case TypeData::Qualified: 551 return new QualifiedType( buildQualifiers( td ), typebuild( td->qualified.parent ), typebuild( td->qualified.child ) ); 477 552 case TypeData::Symbolic: 478 553 case TypeData::Enum: … … 480 555 assert( false ); 481 556 } // switch 557 482 558 return nullptr; 483 559 } // typebuild … … 489 565 switch ( td->kind ) { 490 566 case TypeData::Aggregate: 491 if ( ! toplevel && td->aggregate. fields) {567 if ( ! toplevel && td->aggregate.body ) { 492 568 ret = td->clone(); 493 569 } // if 494 570 break; 495 571 case TypeData::Enum: 496 if ( ! toplevel && td->enumeration. constants) {572 if ( ! toplevel && td->enumeration.body ) { 497 573 ret = td->clone(); 498 574 } // if … … 518 594 519 595 static string genTSError( string msg, DeclarationNode::BasicType basictype ) { 520 throw SemanticError(string( "invalid type specifier \"" ) + msg + "\" for type \"" + DeclarationNode::basicTypeNames[basictype] + "\"." );596 SemanticError( yylloc, string( "invalid type specifier \"" ) + msg + "\" for type \"" + DeclarationNode::basicTypeNames[basictype] + "\"." ); 521 597 } // genTSError 522 598 … … 573 649 574 650 case DeclarationNode::Int128: 575 ret = td->signedness == 1? BasicType::UnsignedInt128 : BasicType::SignedInt128;651 ret = td->signedness == DeclarationNode::Unsigned ? BasicType::UnsignedInt128 : BasicType::SignedInt128; 576 652 if ( td->length != DeclarationNode::NoLength ) { 577 653 genTSError( DeclarationNode::lengthNames[ td->length ], td->basictype ); … … 597 673 genTSError( DeclarationNode::lengthNames[ td->length ], td->basictype ); 598 674 } // if 599 if ( td->basictype == DeclarationNode::Float&& td->length == DeclarationNode::Long ) {675 if ( td->basictype != DeclarationNode::Double && td->length == DeclarationNode::Long ) { 600 676 genTSError( DeclarationNode::lengthNames[ td->length ], td->basictype ); 601 677 } // if … … 603 679 const_cast<TypeData *>(td)->basictype = DeclarationNode::LongDouble; 604 680 } // if 681 682 if ( td->basictype == DeclarationNode::Float80 || td->basictype == DeclarationNode::Float128 ) { 683 // if ( td->complextype != DeclarationNode::NoComplexType ) { 684 // genTSError( DeclarationNode::complexTypeNames[ td->complextype ], td->basictype ); 685 // } 686 if ( td->basictype == DeclarationNode::Float80 ) ret = BasicType::Float80; 687 else ret = BasicType::Float128; 688 break; 689 } 605 690 606 691 ret = floattype[ td->complextype ][ td->basictype - DeclarationNode::Float ]; … … 797 882 assert( td->base ); 798 883 if ( td->symbolic.isTypedef ) { 799 ret = new TypedefDecl( name, scs, typebuild( td->base ), linkage );884 ret = new TypedefDecl( name, td->location, scs, typebuild( td->base ), linkage ); 800 885 } else { 801 886 ret = new TypeDecl( name, scs, typebuild( td->base ), TypeDecl::Dtype, true ); … … 861 946 CompoundStmt * body = dynamic_cast< CompoundStmt * >( stmt ); 862 947 decl = new FunctionDecl( name, scs, linkage, buildFunction( td ), body, attributes, funcSpec ); 948 buildList( td->function.withExprs, decl->withExprs ); 863 949 return decl->set_asmName( asmName ); 864 950 } else if ( td->kind == TypeData::Aggregate ) { … … 877 963 FunctionType * buildFunction( const TypeData * td ) { 878 964 assert( td->kind == TypeData::Function ); 879 bool hasEllipsis = td->function.params ? td->function.params->get_hasEllipsis() : true; 880 if ( ! td->function.params ) hasEllipsis = ! td->function.newStyle; 881 FunctionType * ft = new FunctionType( buildQualifiers( td ), hasEllipsis ); 882 buildList( td->function.params, ft->get_parameters() ); 883 buildForall( td->forall, ft->get_forall() ); 965 FunctionType * ft = new FunctionType( buildQualifiers( td ), ! td->function.params || td->function.params->hasEllipsis ); 966 buildList( td->function.params, ft->parameters ); 967 buildForall( td->forall, ft->forall ); 884 968 if ( td->base ) { 885 969 switch ( td->base->kind ) { 886 970 case TypeData::Tuple: 887 buildList( td->base->tuple, ft-> get_returnVals());971 buildList( td->base->tuple, ft->returnVals ); 888 972 break; 889 973 default: … … 919 1003 // type set => parameter name already transformed by a declaration names so there is a duplicate 920 1004 // declaration name attempting a second transformation 921 if ( param->type ) throw SemanticError(string( "duplicate declaration name " ) + *param->name );1005 if ( param->type ) SemanticError( param->location, string( "duplicate declaration name " ) + *param->name ); 922 1006 // declaration type reset => declaration already transformed by a parameter name so there is a duplicate 923 1007 // parameter name attempting a second transformation 924 if ( ! decl->type ) throw SemanticError(string( "duplicate parameter name " ) + *param->name );1008 if ( ! decl->type ) SemanticError( param->location, string( "duplicate parameter name " ) + *param->name ); 925 1009 param->type = decl->type; // set copy declaration type to parameter type 926 1010 decl->type = nullptr; // reset declaration type … … 929 1013 } // for 930 1014 // declaration type still set => type not moved to a matching parameter so there is a missing parameter name 931 if ( decl->type ) throw SemanticError(string( "missing name in parameter list " ) + *decl->name );1015 if ( decl->type ) SemanticError( decl->location, string( "missing name in parameter list " ) + *decl->name ); 932 1016 } // for 933 1017 -
src/Parser/TypeData.h
rf9feab8 r90152a4 10 10 // Created On : Sat May 16 15:18:36 2015 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Fri Sep 1 23:33:45 201713 // Update Count : 19 012 // Last Modified On : Fri Jul 20 13:56:40 2018 13 // Update Count : 195 14 14 // 15 15 … … 26 26 27 27 struct TypeData { 28 enum Kind { Basic, Pointer, Array, Reference, Function, Aggregate, AggregateInst, Enum, EnumConstant, Symbolic,29 SymbolicInst, Tuple, Typeof, Builtin, Unknown };28 enum Kind { Basic, Pointer, Reference, Array, Function, Aggregate, AggregateInst, Enum, EnumConstant, Symbolic, 29 SymbolicInst, Tuple, Typeof, Builtin, GlobalScope, Qualified, Unknown }; 30 30 31 31 struct Aggregate_t { … … 36 36 DeclarationNode * fields; 37 37 bool body; 38 bool anon; 38 39 39 40 bool tagged; … … 57 58 DeclarationNode * constants; 58 59 bool body; 60 bool anon; 59 61 }; 60 62 … … 64 66 mutable DeclarationNode * oldDeclList; 65 67 StatementNode * body; 66 bool newStyle;68 ExpressionNode * withExprs; // expressions from function's with_clause 67 69 }; 68 70 … … 74 76 DeclarationNode * assertions; 75 77 }; 78 79 struct Qualified_t { // qualified type S.T 80 TypeData * parent; 81 TypeData * child; 82 }; 83 84 CodeLocation location; 76 85 77 86 Kind kind; … … 86 95 DeclarationNode * forall; 87 96 88 // Basic_t basic;89 97 Aggregate_t aggregate; 90 98 AggInst_t aggInst; 91 99 Array_t array; 92 100 Enumeration_t enumeration; 93 // Variable_t variable;94 101 Function_t function; 95 102 Symbolic_t symbolic; 103 Qualified_t qualified; 96 104 DeclarationNode * tuple; 97 105 ExpressionNode * typeexpr; … … 101 109 void print( std::ostream &, int indent = 0 ) const; 102 110 TypeData * clone() const; 111 112 const std::string * leafName() const; 103 113 }; 104 114 … … 118 128 TupleType * buildTuple( const TypeData * ); 119 129 TypeofType * buildTypeof( const TypeData * ); 120 Declaration * buildDecl( const TypeData *, const std::string &, Type::StorageClasses, Expression *, Type::FuncSpecifiers funcSpec, LinkageSpec::Spec, Expression * asmName, Initializer * init = nullptr, std::list< class Attribute * > attributes = std::list< class Attribute * >() ); 130 Declaration * buildDecl( const TypeData *, const std::string &, Type::StorageClasses, Expression *, Type::FuncSpecifiers funcSpec, LinkageSpec::Spec, Expression * asmName, 131 Initializer * init = nullptr, std::list< class Attribute * > attributes = std::list< class Attribute * >() ); 121 132 FunctionType * buildFunction( const TypeData * ); 122 133 void buildKRFunction( const TypeData::Function_t & function ); -
src/Parser/TypedefTable.cc
rf9feab8 r90152a4 5 5 // file "LICENCE" distributed with Cforall. 6 6 // 7 // TypedefTable.cc -- 7 // TypedefTable.cc -- 8 8 // 9 // Author : Rodolfo G. Esteves9 // Author : Peter A. Buhr 10 10 // Created On : Sat May 16 15:20:13 2015 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Mon Aug 15 18:24:42 201613 // Update Count : 25 12 // Last Modified On : Wed Jul 25 15:32:35 2018 13 // Update Count : 258 14 14 // 15 15 16 #include <ext/alloc_traits.h> // for __alloc_traits<>::value_type17 #include <cassert> // for assert18 #include <list> // for list, _List_iterator, list<>::iterator19 #include <map> // for _Rb_tree_iterator, _Rb_tree_const_it...20 #include <memory> // for allocator_traits<>::value_type21 #include <utility> // for pair22 16 23 #include "Parser/ParserTypes.h" // for typedefTable24 #include "Parser/parser.hh" // for IDENTIFIER25 17 #include "TypedefTable.h" 26 27 using namespace std; 18 #include <cassert> // for assert 19 #include <iostream> 28 20 29 21 #if 0 30 #include <iostream> 31 32 #define debugPrint( x ) cerr << x 22 #define debugPrint( code ) code 33 23 #else 34 #define debugPrint( x)24 #define debugPrint( code ) 35 25 #endif 36 26 37 TypedefTable::TypedefTable() : currentScope( 0 ) {} 27 using namespace std; // string, iostream 38 28 39 bool TypedefTable::exists( const string &identifier ) { 40 return table.count( identifier ) > 0; 41 } 29 debugPrint( 30 static const char *kindName( int kind ) { 31 switch ( kind ) { 32 case IDENTIFIER: return "identifier"; 33 case TYPEDEFname: return "typedef"; 34 case TYPEGENname: return "typegen"; 35 default: 36 cerr << "Error: cfa-cpp internal error, invalid kind of identifier" << endl; 37 abort(); 38 } // switch 39 } // kindName 40 ) 42 41 43 int TypedefTable::isKind( const string &identifier ) const { 44 tableType::const_iterator id_pos = table.find( identifier ); 42 TypedefTable::~TypedefTable() { 43 if ( ! SemanticErrorThrow && kindTable.currentScope() != 0 ) { 44 cerr << "Error: cfa-cpp internal error, scope failure " << kindTable.currentScope() << endl; 45 abort(); 46 } // if 47 } // TypedefTable::~TypedefTable 48 49 bool TypedefTable::exists( const string & identifier ) { 50 return kindTable.find( identifier ) != kindTable.end(); 51 } // TypedefTable::exists 52 53 bool TypedefTable::existsCurr( const string & identifier ) { 54 return kindTable.findAt( kindTable.currentScope() - 1, identifier ) != kindTable.end(); 55 } // TypedefTable::exists 56 57 int TypedefTable::isKind( const string & identifier ) const { 58 KindTable::const_iterator posn = kindTable.find( identifier ); 45 59 // Name lookup defaults to identifier, and then the identifier's kind is set by the parser. 46 if ( id_pos == table.end() ) return IDENTIFIER; 47 return id_pos->second.begin()->kind; 48 } 49 50 void TypedefTable::changeKind( const string &identifier, kind_t kind ) { 51 tableType::iterator id_pos = table.find( identifier ); 52 if ( id_pos == table.end() ) return; 53 id_pos->second.begin()->kind = kind; 54 } 60 if ( posn == kindTable.end() ) return IDENTIFIER; 61 return posn->second; 62 } // TypedefTable::isKind 55 63 56 64 // SKULLDUGGERY: Generate a typedef for the aggregate name so the aggregate does not have to be qualified by 57 // "struct". Only generate the typedef, if the name is not in use. The typedef is implicitly (silently) removed 58 // if the name is explicitly used. 59 void TypedefTable::makeTypedef( const string &name ) { 65 // "struct". Only generate the typedef, if the name is not in use. The typedef is implicitly (silently) removed if the 66 // name is explicitly used. 67 void TypedefTable::makeTypedef( const string & name, int kind ) { 68 // Check for existence is necessary to handle: 69 // struct Fred {}; 70 // void Fred(); 71 // void fred() { 72 // struct Fred act; // do not add as type in this scope 73 // Fred(); 74 // } 60 75 if ( ! typedefTable.exists( name ) ) { 61 typedefTable.addToEnclosingScope( name, TypedefTable::TD);76 typedefTable.addToEnclosingScope( name, kind, "MTD" ); 62 77 } // if 63 } 78 } // TypedefTable::makeTypedef 64 79 65 void TypedefTable::addToScope( const std::string &identifier, kind_t kind, int scope ) { 66 if ( currentTrait != "" && scope == contextScope ) { 67 DeferredEntry entry = { identifier, kind }; 68 contexts[currentTrait].push_back( entry ); 69 } else { 70 debugPrint( "Adding " << identifier << " as kind " << kind << " scope " << scope << " from scope " << currentScope << endl ); 71 Entry newEntry = { scope, kind }; 72 tableType::iterator curPos = table.find( identifier ); 73 if ( curPos == table.end()) { 74 list< Entry > newList; 75 newList.push_front( newEntry ); 76 table[identifier] = newList; 77 } else { 78 list< Entry >::iterator listPos = (*curPos ).second.begin(); 79 while ( listPos != (*curPos ).second.end() && listPos->scope > scope ) { 80 listPos++; 81 } // while 82 (*curPos ).second.insert( listPos, newEntry ); 83 } // if 84 } // if 85 } 80 void TypedefTable::addToScope( const string & identifier, int kind, const char * locn __attribute__((unused)) ) { 81 auto scope = kindTable.currentScope(); 82 debugPrint( cerr << "Adding current at " << locn << " " << identifier << " as " << kindName( kind ) << " scope " << scope << endl ); 83 kindTable.insertAt( scope, identifier, kind ); 84 } // TypedefTable::addToScope 86 85 87 void TypedefTable::addToCurrentScope( const std::string &identifier, kind_t kind ) { 88 addToScope( identifier, kind, currentScope ); 89 } 90 91 void TypedefTable::addToCurrentScope( kind_t kind ) { 92 addToCurrentScope( nextIdentifiers.top(), kind ); 93 } 94 95 void TypedefTable::addToEnclosingScope( const std::string &identifier, kind_t kind ) { 96 assert( currentScope >= 1 ); 97 addToScope( identifier, kind, currentScope - 1 ); 98 } 99 100 void TypedefTable::addToEnclosingScope( kind_t kind ) { 101 addToEnclosingScope( nextIdentifiers.top(), kind ); 102 } 103 104 void TypedefTable::addToEnclosingScope2( const std::string &identifier, kind_t kind ) { 105 assert( currentScope >= 2 ); 106 addToScope( identifier, kind, currentScope - 2 ); 107 } 108 109 void TypedefTable::addToEnclosingScope2( kind_t kind ) { 110 addToEnclosingScope2( nextIdentifiers.top(), kind ); 111 } 112 113 void TypedefTable::setNextIdentifier( const std::string &identifier ) { 114 nextIdentifiers.top() = identifier; 115 } 116 117 void TypedefTable::openTrait( const std::string &contextName ) { 118 map< string, deferListType >::iterator i = contexts.find( contextName ); 119 if ( i != contexts.end() ) { 120 deferListType &entries = i->second; 121 for ( deferListType::iterator i = entries.begin(); i != entries.end(); i++) { 122 addToEnclosingScope( i->identifier, i->kind ); 123 } // for 124 } // if 125 } 86 void TypedefTable::addToEnclosingScope( const string & identifier, int kind, const char * locn __attribute__((unused)) ) { 87 auto scope = kindTable.currentScope() - 1 - kindTable.getNote( kindTable.currentScope() - 1 ).level; 88 // auto scope = level - kindTable.getNote( kindTable.currentScope() - 1 ).level; 89 debugPrint( cerr << "Adding enclosing at " << locn << " " << identifier << " as " << kindName( kind ) << " scope " << scope << " level " << level << " note " << kindTable.getNote( kindTable.currentScope() - 1 ).level << endl ); 90 auto ret = kindTable.insertAt( scope, identifier, kind ); 91 if ( ! ret.second ) ret.first->second = kind; // exists => update 92 } // TypedefTable::addToEnclosingScope 126 93 127 94 void TypedefTable::enterScope() { 128 currentScope += 1; 129 deferListStack.push( deferListType() ); 130 nextIdentifiers.push( "" ); 131 debugPrint( "Entering scope " << currentScope << ", nextIdentifiers size is " << nextIdentifiers.size() << endl ); 132 } 95 kindTable.beginScope( (Note){ 0, false } ); 96 debugPrint( cerr << "Entering scope " << kindTable.currentScope() << " level " << level << endl; print() ); 97 } // TypedefTable::enterScope 133 98 134 99 void TypedefTable::leaveScope() { 135 debugPrint( "Leaving scope " << currentScope << endl ); 136 for ( tableType::iterator i = table.begin(); i != table.end(); ) { 137 list< Entry > &declList = (*i).second; 138 while ( ! declList.empty() && declList.front().scope == currentScope ) { 139 declList.pop_front(); 140 } 141 if ( declList.empty() ) { // standard idom for erasing during traversal 142 table.erase( i++ ); 143 } else 144 ++i; 145 } // for 146 currentScope -= 1; 147 for ( deferListType::iterator i = deferListStack.top().begin(); i != deferListStack.top().end(); i++ ) { 148 addToCurrentScope( i->identifier, i->kind ); 149 } // for 150 deferListStack.pop(); 151 debugPrint( "nextIdentifiers size is " << nextIdentifiers.size() << " top is " << nextIdentifiers.top() << endl ); 152 nextIdentifiers.pop(); 153 } 100 debugPrint( cerr << "Leaving scope " << kindTable.currentScope() << endl; print() ); 101 kindTable.endScope(); 102 } // TypedefTable::leaveScope 154 103 155 void TypedefTable::enterTrait( const std::string &contextName ) { 156 currentTrait = contextName; 157 contextScope = currentScope; 158 } 104 void TypedefTable::up( bool forall ) { 105 level += 1; 106 kindTable.getNote( kindTable.currentScope() ) = (Note){ level, forall || getEnclForall() }; 107 debugPrint( cerr << "Up " << " level " << level << " note " << kindTable.getNote( level ).level << ", " << kindTable.getNote( level ).forall << endl; ); 108 } // TypedefTable::up 159 109 160 void TypedefTable::leaveTrait() { 161 currentTrait = ""; 162 } 110 void TypedefTable::down() { 111 level -= 1; 112 debugPrint( cerr << "Down " << " level " << level << " note " << kindTable.getNote( level ).level << endl; ); 113 } // TypedefTable::down 163 114 164 115 void TypedefTable::print( void ) const { 165 for ( tableType::const_iterator i = table.begin(); i != table.end(); i++) { 166 debugPrint( (*i ).first << ": " ); 167 list< Entry > declList = (*i).second; 168 for ( list< Entry >::const_iterator j = declList.begin(); j != declList.end(); j++ ) { 169 debugPrint( "(" << (*j).scope << " " << (*j).kind << ") " ); 170 } 171 debugPrint( endl ); 116 KindTable::size_type scope = kindTable.currentScope(); 117 debugPrint( cerr << "[" << scope << "] " << kindTable.getNote( scope ).level << ", " << kindTable.getNote( scope ).forall << ":" ); 118 for ( KindTable::const_iterator i = kindTable.begin(); i != kindTable.end(); i++ ) { 119 while ( i.get_level() != scope ) { 120 --scope; 121 debugPrint( cerr << endl << "[" << scope << "] " << kindTable.getNote( scope ).level << ", " << kindTable.getNote( scope ).forall << ":" ); 122 } // while 123 debugPrint( cerr << " " << (*i).first << ":" << kindName( (*i).second ) ); 172 124 } // for 173 } 125 while ( scope > 0 ) { 126 --scope; 127 debugPrint( cerr << endl << "[" << scope << "] " << kindTable.getNote( scope ).level << ", " << kindTable.getNote( scope ).forall << ":" ); 128 } // while 129 debugPrint( cerr << endl ); 130 } // TypedefTable::print 174 131 175 132 // Local Variables: // -
src/Parser/TypedefTable.h
rf9feab8 r90152a4 7 7 // TypedefTable.h -- 8 8 // 9 // Author : Rodolfo G. Esteves9 // Author : Peter A. Buhr 10 10 // Created On : Sat May 16 15:24:36 2015 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Sat Jul 22 09:33:14 201713 // Update Count : 3412 // Last Modified On : Wed Jul 25 15:33:55 2018 13 // Update Count : 114 14 14 // 15 15 16 16 #pragma once 17 17 18 #include <list> // for list 19 #include <map> // for map, map<>::value_compare 20 #include <stack> // for stack 21 #include <string> // for string 18 #include <string> // for string 22 19 20 #include "Common/ScopedMap.h" // for ScopedMap 23 21 #include "ParserTypes.h" 24 #include "parser.hh" // for IDENTIFIER, TYPEDEFname, TYPEGENname22 #include "parser.hh" // for IDENTIFIER, TYPEDEFname, TYPEGENname 25 23 26 24 class TypedefTable { 25 struct Note { size_t level; bool forall; }; 26 typedef ScopedMap< std::string, int, Note > KindTable; 27 KindTable kindTable; 28 unsigned int level = 0; 27 29 public: 28 enum kind_t { ID = IDENTIFIER, TD = TYPEDEFname, TG = TYPEGENname }; 29 private: 30 struct Entry { 31 int scope; 32 kind_t kind; 33 }; 30 ~TypedefTable(); 34 31 35 struct DeferredEntry { 36 std::string identifier; 37 kind_t kind; 38 }; 39 40 typedef std::map< std::string, std::list< Entry > > tableType; 41 tableType table; 42 43 int currentScope; 44 std::string currentTrait; 45 int contextScope; 46 47 typedef std::list< DeferredEntry > deferListType; 48 std::stack< deferListType > deferListStack; 49 std::map< std::string, deferListType > contexts; 50 51 std::stack< std::string > nextIdentifiers; 52 53 void addToScope( const std::string &identifier, kind_t kind, int scope ); 54 public: 55 TypedefTable(); 56 57 bool exists( const std::string &identifier ); 58 int isKind( const std::string &identifier ) const; 59 void changeKind( const std::string &identifier, kind_t kind ); 60 61 void makeTypedef( const std::string &name ); 62 63 // "addToCurrentScope" adds the identifier/type pair to the current scope. This does less than you think it does, 64 // since each declaration is within its own scope. Mostly useful for type parameters. 65 void addToCurrentScope( const std::string &identifier, kind_t kind ); 66 void addToCurrentScope( kind_t kind ); // use nextIdentifiers.top() 67 68 // "addToEnclosingScope" adds the identifier/type pair to the scope that encloses the current one. This is the 69 // right way to handle type and typedef names 70 void addToEnclosingScope( const std::string &identifier, kind_t kind ); 71 void addToEnclosingScope( kind_t kind ); // use nextIdentifiers.top() 72 73 // "addToEnclosingScope2" adds the identifier/type pair to the scope that encloses the scope enclosing the the 74 // current one. This is the right way to handle assertion names 75 void addToEnclosingScope2( const std::string &identifier, kind_t kind ); 76 void addToEnclosingScope2( kind_t kind ); // use nextIdentifiers.top() 77 78 // set the next identifier to be used by an "add" operation without an identifier parameter within the current scope 79 void setNextIdentifier( const std::string &identifier ); 80 81 // dump the definitions from a pre-defined context into the current scope 82 void openTrait( const std::string &contextName ); 32 bool exists( const std::string & identifier ); 33 bool existsCurr( const std::string & identifier ); 34 int isKind( const std::string & identifier ) const; 35 void makeTypedef( const std::string & name, int kind = TYPEDEFname ); 36 void addToScope( const std::string & identifier, int kind, const char * ); 37 void addToEnclosingScope( const std::string & identifier, int kind, const char * ); 38 bool getEnclForall() { return kindTable.getNote( kindTable.currentScope() - 1 ).forall; } 83 39 84 40 void enterScope(); 85 41 void leaveScope(); 86 void enterTrait( const std::string &contextName );87 void leaveTrait();88 42 89 void print() const; 90 }; 43 void up( bool ); 44 void down(); 45 46 void print( void ) const; 47 }; // TypedefTable 91 48 92 49 // Local Variables: // -
src/Parser/lex.ll
rf9feab8 r90152a4 10 10 * Created On : Sat Sep 22 08:58:10 2001 11 11 * Last Modified By : Peter A. Buhr 12 * Last Modified On : Wed Oct 25 13:53:56 201713 * Update Count : 6 3412 * Last Modified On : Wed Aug 8 17:23:17 2018 13 * Update Count : 685 14 14 */ 15 15 … … 25 25 //**************************** Includes and Defines **************************** 26 26 27 // trigger before each matching rule's action 28 #define YY_USER_ACTION \ 29 yylloc.first_line = yylineno; \ 30 yylloc.first_column = column; \ 31 column += yyleng; \ 32 yylloc.last_column = column; \ 33 yylloc.last_line = yylineno; \ 34 yylloc.filename = yyfilename ? yyfilename : ""; 27 35 unsigned int column = 0; // position of the end of the last token parsed 28 #define YY_USER_ACTION yylloc.first_line = yylineno; yylloc.first_column = column; column += yyleng; yylloc.last_column = column; yylloc.last_line = yylineno; yylloc.filename = yyfilename ? yyfilename : ""; // trigger before each matching rule's action29 36 30 37 #include <string> … … 49 56 #define NUMERIC_RETURN(x) rm_underscore(); RETURN_VAL( x ) // numeric constant 50 57 #define KEYWORD_RETURN(x) RETURN_CHAR( x ) // keyword 51 #define QKEYWORD_RETURN(x) typedefTable.isKind( yytext ); RETURN_VAL(x);// quasi-keyword58 #define QKEYWORD_RETURN(x) RETURN_VAL(x); // quasi-keyword 52 59 #define IDENTIFIER_RETURN() RETURN_VAL( typedefTable.isKind( yytext ) ) 53 60 #define ATTRIBUTE_RETURN() RETURN_VAL( ATTR_IDENTIFIER ) 54 61 55 62 void rm_underscore() { 56 // Remove underscores in numeric constant by copying the non-underscore characters to the front of the string.63 // SKULLDUGGERY: remove underscores (ok to shorten?) 57 64 yyleng = 0; 58 for ( int i = 0; yytext[i] != '\0'; i += 1 ) { 59 if ( yytext[i] == '`' ) { 60 // copy user suffix 61 for ( ; yytext[i] != '\0'; i += 1 ) { 62 yytext[yyleng] = yytext[i]; 63 yyleng += 1; 64 } // for 65 break; 66 } // if 65 for ( int i = 0; yytext[i] != '\0'; i += 1 ) { // copying non-underscore characters to front of string 67 66 if ( yytext[i] != '_' ) { 68 67 yytext[yyleng] = yytext[i]; … … 71 70 } // for 72 71 yytext[yyleng] = '\0'; 73 } 72 } // rm_underscore 74 73 75 74 // Stop warning due to incorrectly generated flex code. … … 77 76 %} 78 77 78 binary [0-1] 79 79 octal [0-7] 80 80 nonzero [1-9] … … 89 89 attr_identifier "@"{identifier} 90 90 91 user_suffix_opt ("`"{identifier})?92 93 91 // numeric constants, CFA: '_' in constant 94 92 hex_quad {hex}("_"?{hex}){3} 95 93 size_opt (8|16|32|64|128)? 96 94 length ("ll"|"LL"|[lL]{size_opt})|("hh"|"HH"|[hH]) 97 integer_suffix_opt ("_"?(([uU]({length}?[iI]?)|([iI]{length}))|([iI]({length}?[uU]?)|([uU]{length}))|({length}([iI]?[uU]?)|([uU][iI]))|[zZ]))? {user_suffix_opt}95 integer_suffix_opt ("_"?(([uU]({length}?[iI]?)|([iI]{length}))|([iI]({length}?[uU]?)|([uU]{length}))|({length}([iI]?[uU]?)|([uU][iI]))|[zZ]))? 98 96 99 97 octal_digits ({octal})|({octal}({octal}|"_")*{octal}) … … 103 101 nonzero_digits ({nonzero})|({nonzero}({decimal}|"_")*{decimal}) 104 102 decimal_constant {nonzero_digits}{integer_suffix_opt} 103 104 binary_digits ({binary})|({binary}({binary}|"_")*{binary}) 105 binary_prefix "0"[bB]"_"? 106 binary_constant {binary_prefix}{binary_digits}{integer_suffix_opt} 105 107 106 108 hex_digits ({hex})|({hex}({hex}|"_")*{hex}) … … 113 115 floating_length ([fFdDlL]|[lL]{floating_size}) 114 116 floating_suffix ({floating_length}?[iI]?)|([iI]{floating_length}) 115 floating_suffix_opt ("_"?({floating_suffix}|"DL"))? {user_suffix_opt}117 floating_suffix_opt ("_"?({floating_suffix}|"DL"))? 116 118 decimal_digits ({decimal})|({decimal}({decimal}|"_")*{decimal}) 117 119 floating_decimal {decimal_digits}"."{exponent}?{floating_suffix_opt} … … 120 122 121 123 binary_exponent "_"?[pP]"_"?[+-]?{decimal_digits} 122 hex_floating_suffix_opt ("_"?({floating_suffix}))? {user_suffix_opt}124 hex_floating_suffix_opt ("_"?({floating_suffix}))? 123 125 hex_floating_fraction ({hex_digits}?"."{hex_digits})|({hex_digits}".") 124 126 hex_floating_constant {hex_prefix}(({hex_floating_fraction}{binary_exponent})|({hex_digits}{binary_exponent})){hex_floating_suffix_opt} … … 179 181 } 180 182 181 /* ignore preprocessor directives (for now)*/182 ^{h_white}*"#"[^\n]*"\n" ;183 /* preprocessor-style directives */ 184 ^{h_white}*"#"[^\n]*"\n" { RETURN_VAL( DIRECTIVE ); } 183 185 184 186 /* ignore C style comments (ALSO HANDLED BY CPP) */ … … 203 205 __asm { KEYWORD_RETURN(ASM); } // GCC 204 206 __asm__ { KEYWORD_RETURN(ASM); } // GCC 205 _At { KEYWORD_RETURN(AT); } // CFA206 207 _Atomic { KEYWORD_RETURN(ATOMIC); } // C11 207 208 __attribute { KEYWORD_RETURN(ATTRIBUTE); } // GCC … … 232 233 enum { KEYWORD_RETURN(ENUM); } 233 234 __extension__ { KEYWORD_RETURN(EXTENSION); } // GCC 235 exception { KEYWORD_RETURN(EXCEPTION); } // CFA 234 236 extern { KEYWORD_RETURN(EXTERN); } 237 fallthrough { KEYWORD_RETURN(FALLTHROUGH); } // CFA 235 238 fallthru { KEYWORD_RETURN(FALLTHRU); } // CFA 236 fallthrough { KEYWORD_RETURN(FALLTHROUGH); } // CFA237 239 finally { KEYWORD_RETURN(FINALLY); } // CFA 238 240 float { KEYWORD_RETURN(FLOAT); } 241 _Float32 { KEYWORD_RETURN(FLOAT); } // GCC 242 _Float32x { KEYWORD_RETURN(FLOAT); } // GCC 243 _Float64 { KEYWORD_RETURN(DOUBLE); } // GCC 244 _Float64x { KEYWORD_RETURN(DOUBLE); } // GCC 239 245 __float80 { KEYWORD_RETURN(FLOAT80); } // GCC 240 246 float80 { KEYWORD_RETURN(FLOAT80); } // GCC 247 _Float128 { KEYWORD_RETURN(FLOAT128); } // GCC 248 _Float128x { KEYWORD_RETURN(FLOAT128); } // GCC 241 249 __float128 { KEYWORD_RETURN(FLOAT128); } // GCC 242 250 float128 { KEYWORD_RETURN(FLOAT128); } // GCC … … 264 272 __builtin_offsetof { KEYWORD_RETURN(OFFSETOF); } // GCC 265 273 one_t { NUMERIC_RETURN(ONE_T); } // CFA 274 or { QKEYWORD_RETURN(WOR); } // CFA 266 275 otype { KEYWORD_RETURN(OTYPE); } // CFA 267 276 register { KEYWORD_RETURN(REGISTER); } … … 300 309 __volatile__ { KEYWORD_RETURN(VOLATILE); } // GCC 301 310 waitfor { KEYWORD_RETURN(WAITFOR); } 302 or { QKEYWORD_RETURN(WOR); } // CFA303 311 when { KEYWORD_RETURN(WHEN); } 304 312 while { KEYWORD_RETURN(WHILE); } … … 308 316 /* identifier */ 309 317 {identifier} { IDENTIFIER_RETURN(); } 318 "`"{identifier}"`" { // CFA 319 yytext[yyleng - 1] = '\0'; yytext += 1; // SKULLDUGGERY: remove backquotes (ok to shorten?) 320 IDENTIFIER_RETURN(); 321 } 310 322 {attr_identifier} { ATTRIBUTE_RETURN(); } 311 "`" { BEGIN BKQUOTE; }312 <BKQUOTE>{identifier} { IDENTIFIER_RETURN(); }313 <BKQUOTE>"`" { BEGIN 0; }314 323 315 324 /* numeric constants */ 325 {binary_constant} { NUMERIC_RETURN(INTEGERconstant); } 326 {octal_constant} { NUMERIC_RETURN(INTEGERconstant); } 316 327 {decimal_constant} { NUMERIC_RETURN(INTEGERconstant); } 317 {octal_constant} { NUMERIC_RETURN(INTEGERconstant); }318 328 {hex_constant} { NUMERIC_RETURN(INTEGERconstant); } 319 329 {floating_decimal} { NUMERIC_RETURN(FLOATING_DECIMALconstant); } // must appear before floating_constant … … 325 335 ({cwide_prefix}[_]?)?['] { BEGIN QUOTE; rm_underscore(); strtext = new string( yytext, yyleng ); } 326 336 <QUOTE>[^'\\\n]* { strtext->append( yytext, yyleng ); } 327 <QUOTE>['\n] {user_suffix_opt}{ BEGIN 0; strtext->append( yytext, yyleng ); RETURN_STR(CHARACTERconstant); }337 <QUOTE>['\n] { BEGIN 0; strtext->append( yytext, yyleng ); RETURN_STR(CHARACTERconstant); } 328 338 /* ' stop editor highlighting */ 329 339 … … 331 341 ({swide_prefix}[_]?)?["] { BEGIN STRING; rm_underscore(); strtext = new string( yytext, yyleng ); } 332 342 <STRING>[^"\\\n]* { strtext->append( yytext, yyleng ); } 333 <STRING>["\n] {user_suffix_opt}{ BEGIN 0; strtext->append( yytext, yyleng ); RETURN_STR(STRINGliteral); }343 <STRING>["\n] { BEGIN 0; strtext->append( yytext, yyleng ); RETURN_STR(STRINGliteral); } 334 344 /* " stop editor highlighting */ 335 345 … … 341 351 /* punctuation */ 342 352 "@" { ASCIIOP_RETURN(); } 353 "`" { ASCIIOP_RETURN(); } 343 354 "[" { ASCIIOP_RETURN(); } 344 355 "]" { ASCIIOP_RETURN(); } … … 399 410 ">>=" { NAMEDOP_RETURN(RSassign); } 400 411 412 "~=" { NAMEDOP_RETURN(Erange); } // CFA 401 413 "@=" { NAMEDOP_RETURN(ATassign); } // CFA 402 414 … … 405 417 "?"({op_unary_pre_post}|"()"|"[?]"|"{}") { IDENTIFIER_RETURN(); } 406 418 "^?{}" { IDENTIFIER_RETURN(); } 407 "?`"{identifier} { IDENTIFIER_RETURN(); } // unitoperator419 "?`"{identifier} { IDENTIFIER_RETURN(); } // postfix operator 408 420 "?"{op_binary_over}"?" { IDENTIFIER_RETURN(); } // binary 409 421 /* … … 448 460 449 461 %% 462 450 463 // ----end of lexer---- 451 464 452 465 void yyerror( const char * errmsg ) { 453 cout << (yyfilename ? yyfilename : "*unknown file*") << ':' << yylineno << ':' << column - yyleng + 1 454 << ": " << SemanticError::error_str() << errmsg << " at token \"" << (yytext[0] == '\0' ? "EOF" : yytext) << '"' << endl; 466 SemanticErrorThrow = true; 467 cerr << (yyfilename ? yyfilename : "*unknown file*") << ':' << yylineno << ':' << column - yyleng + 1 468 << ": " << ErrorHelpers::error_str() << errmsg << " at token \"" << (yytext[0] == '\0' ? "EOF" : yytext) << '"' << endl; 455 469 } 456 470 -
src/Parser/module.mk
rf9feab8 r90152a4 6 6 ## file "LICENCE" distributed with Cforall. 7 7 ## 8 ## module.mk -- 8 ## module.mk -- 9 9 ## 10 10 ## Author : Peter A. Buhr … … 31 31 Parser/parserutility.cc 32 32 33 M AINTAINERCLEANFILES +=Parser/parser.output33 MOSTLYCLEANFILES += Parser/parser.hh Parser/parser.output -
src/Parser/parser.yy
rf9feab8 r90152a4 10 10 // Created On : Sat Sep 1 20:22:55 2001 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Mon Nov 27 17:23:35 201713 // Update Count : 299212 // Last Modified On : Wed Aug 8 17:50:07 2018 13 // Update Count : 3998 14 14 // 15 15 … … 115 115 } // distExt 116 116 117 void distInl( DeclarationNode * declaration ) { 118 // distribute EXTENSION across all declarations 119 for ( DeclarationNode *iter = declaration; iter != nullptr; iter = (DeclarationNode *)iter->get_next() ) { 120 iter->set_inLine( true ); 121 } // for 122 } // distInl 123 124 void distQual( DeclarationNode * declaration, DeclarationNode * qualifiers ) { 125 // distribute qualifiers across all non-variable declarations in a distribution statemement 126 for ( DeclarationNode * iter = declaration; iter != nullptr; iter = (DeclarationNode *)iter->get_next() ) { 127 // SKULLDUGGERY: Distributions are parsed inside out, so qualifiers are added to declarations inside out. Since 128 // addQualifiers appends to the back of the list, the forall clauses are in the wrong order (right to left). To 129 // get the qualifiers in the correct order and still use addQualifiers (otherwise, 90% of addQualifiers has to 130 // be copied to add to front), the appropriate forall pointers are interchanged before calling addQualifiers. 131 DeclarationNode * clone = qualifiers->clone(); 132 if ( qualifiers->type ) { // forall clause ? (handles SC) 133 if ( iter->type->kind == TypeData::Aggregate ) { // struct/union ? 134 swap( clone->type->forall, iter->type->aggregate.params ); 135 iter->addQualifiers( clone ); 136 } else if ( iter->type->kind == TypeData::AggregateInst && iter->type->aggInst.aggregate->aggregate.body ) { // struct/union ? 137 // Create temporary node to hold aggregate, call addQualifiers as above, then put nodes back together. 138 DeclarationNode newnode; 139 swap( newnode.type, iter->type->aggInst.aggregate ); 140 swap( clone->type->forall, newnode.type->aggregate.params ); 141 newnode.addQualifiers( clone ); 142 swap( newnode.type, iter->type->aggInst.aggregate ); 143 } else if ( iter->type->kind == TypeData::Function ) { // routines ? 144 swap( clone->type->forall, iter->type->forall ); 145 iter->addQualifiers( clone ); 146 } // if 147 } else { // just SC qualifiers 148 iter->addQualifiers( clone ); 149 } // if 150 } // for 151 delete qualifiers; 152 } // distQual 153 117 154 // There is an ambiguity for inline generic-routine return-types and generic routines. 118 155 // forall( otype T ) struct S { int i; } bar( T ) {} 119 156 // Does the forall bind to the struct or the routine, and how would it be possible to explicitly specify the binding. 120 157 // forall( otype T ) struct S { int T; } forall( otype W ) bar( W ) {} 158 // Currently, the forall is associated with the routine, and the generic type has to be separately defined: 159 // forall( otype T ) struct S { int T; }; 160 // forall( otype W ) bar( W ) {} 121 161 122 162 void rebindForall( DeclarationNode * declSpec, DeclarationNode * funcDecl ) { 123 if ( declSpec->type->kind == TypeData::Aggregate ) { // return isaggregate definition163 if ( declSpec->type->kind == TypeData::Aggregate ) { // ignore aggregate definition 124 164 funcDecl->type->forall = declSpec->type->aggregate.params; // move forall from aggregate to function type 125 165 declSpec->type->aggregate.params = nullptr; … … 127 167 } // rebindForall 128 168 129 bool forall = false; // aggregate have one or more forall qualifiers ? 169 NameExpr * build_postfix_name( const string * name ) { 170 NameExpr * new_name = build_varref( new string( "?`" + *name ) ); 171 delete name; 172 return new_name; 173 } // build_postfix_name 174 175 DeclarationNode * fieldDecl( DeclarationNode * typeSpec, DeclarationNode * fieldList ) { 176 if ( ! fieldList ) { // field declarator ? 177 if ( ! ( typeSpec->type && typeSpec->type->kind == TypeData::Aggregate ) ) { 178 stringstream ss; 179 typeSpec->type->print( ss ); 180 SemanticWarning( yylloc, Warning::SuperfluousDecl, ss.str().c_str() ); 181 return nullptr; 182 } // if 183 fieldList = DeclarationNode::newName( nullptr ); 184 } // if 185 return distAttr( typeSpec, fieldList ); // mark all fields in list 186 } // fieldDecl 187 188 ForCtrl * forCtrl( ExpressionNode * type, string * index, ExpressionNode * start, enum OperKinds compop, ExpressionNode * comp, ExpressionNode * inc ) { 189 return new ForCtrl( 190 distAttr( DeclarationNode::newTypeof( type ), DeclarationNode::newName( index )->addInitializer( new InitializerNode( start ) ) ), 191 new ExpressionNode( build_binary_val( compop, new ExpressionNode( build_varref( new string( *index ) ) ), comp ) ), 192 new ExpressionNode( build_binary_val( OperKinds::PlusAssn, new ExpressionNode( build_varref( new string( *index ) ) ), inc ) ) ); 193 } // forCtrl 194 195 196 bool forall = false, yyy = false; // aggregate have one or more forall qualifiers ? 130 197 131 198 // https://www.gnu.org/software/bison/manual/bison.html#Location-Type … … 158 225 WaitForStmt * wfs; 159 226 Expression * constant; 160 IfCtl * ifctl; 161 ForCtl * fctl; 227 IfCtrl * ifctl; 228 ForCtrl * fctl; 229 enum OperKinds compop; 162 230 LabelNode * label; 163 231 InitializerNode * in; … … 166 234 bool flag; 167 235 CatchStmt::Kind catch_kind; 236 GenericExpr * genexpr; 168 237 } 169 238 … … 187 256 %token TYPEOF LABEL // GCC 188 257 %token ENUM STRUCT UNION 258 %token EXCEPTION // CFA 189 259 %token COROUTINE MONITOR THREAD // CFA 190 260 %token OTYPE FTYPE DTYPE TTYPE TRAIT // CFA … … 201 271 %token<tok> ATTR_IDENTIFIER ATTR_TYPEDEFname ATTR_TYPEGENname 202 272 %token<tok> INTEGERconstant CHARACTERconstant STRINGliteral 273 %token<tok> DIRECTIVE 203 274 // Floating point constant is broken into three kinds of tokens because of the ambiguity with tuple indexing and 204 275 // overloading constants 0/1, e.g., x.1 is lexed as (x)(.1), where (.1) is a factional constant, but is semantically … … 219 290 %token ANDassign ERassign ORassign // &= ^= |= 220 291 292 %token Erange // ~= 221 293 %token ATassign // @= 222 294 … … 241 313 %type<ifctl> if_control_expression 242 314 %type<fctl> for_control_expression 315 %type<compop> inclexcl 243 316 %type<en> subrange 244 317 %type<decl> asm_name_opt … … 248 321 %type<flag> asm_volatile_opt 249 322 %type<en> handler_predicate_opt 323 %type<genexpr> generic_association generic_assoc_list 250 324 251 325 // statements 252 326 %type<sn> statement labeled_statement compound_statement 253 327 %type<sn> statement_decl statement_decl_list statement_list_nodecl 254 %type<sn> selection_statement 255 %type<sn> switch_clause_list_opt switch_clause_list choose_clause_list_opt choose_clause_list328 %type<sn> selection_statement if_statement 329 %type<sn> switch_clause_list_opt switch_clause_list 256 330 %type<en> case_value 257 331 %type<sn> case_clause case_value_list case_label case_label_list 258 %type<sn> fall_through fall_through_opt259 332 %type<sn> iteration_statement jump_statement 260 333 %type<sn> expression_statement asm_statement 261 %type<sn> with_statement with_clause_opt 334 %type<sn> with_statement 335 %type<en> with_clause_opt 262 336 %type<sn> exception_statement handler_clause finally_clause 263 337 %type<catch_kind> handler_key … … 275 349 %type<decl> aggregate_type aggregate_type_nobody 276 350 277 %type<decl> assertion assertion_list _opt351 %type<decl> assertion assertion_list assertion_list_opt 278 352 279 353 %type<en> bit_subrange_size_opt bit_subrange_size … … 291 365 %type<en> enumerator_value_opt 292 366 293 %type<decl> exception_declaration external_definition external_definition_list external_definition_list_opt 294 295 %type<decl> field_declaration field_declaration_list field_declarator field_declaring_list 296 %type<en> field field_list field_name fraction_constants 367 %type<decl> external_definition external_definition_list external_definition_list_opt 368 369 %type<decl> exception_declaration 370 371 %type<decl> field_declaration_list_opt field_declaration field_declaring_list_opt field_declarator field_abstract_list_opt field_abstract 372 %type<en> field field_name_list field_name fraction_constants_opt 297 373 298 374 %type<decl> external_function_definition function_definition function_array function_declarator function_no_ptr function_ptr … … 307 383 %type<decl> cfa_array_parameter_1st_dimension 308 384 309 %type<decl> cfa_trait_declaring_list cfa_declaration cfa_field_declaring_list 385 %type<decl> cfa_trait_declaring_list cfa_declaration cfa_field_declaring_list cfa_field_abstract_list 310 386 %type<decl> cfa_function_declaration cfa_function_return cfa_function_specifier 311 387 … … 313 389 %type<decl> cfa_identifier_parameter_declarator_tuple cfa_identifier_parameter_ptr 314 390 315 %type<decl> cfa_parameter_declaration cfa_parameter_list cfa_parameter_ type_list cfa_parameter_type_list_opt391 %type<decl> cfa_parameter_declaration cfa_parameter_list cfa_parameter_ellipsis_list_opt 316 392 317 393 %type<decl> cfa_typedef_declaration cfa_variable_declaration cfa_variable_specifier 318 394 319 %type<decl> c_declaration 395 %type<decl> c_declaration static_assert 320 396 %type<decl> KR_function_declarator KR_function_no_ptr KR_function_ptr KR_function_array 321 %type<decl> KR_declaration_list KR_declaration_list_opt 322 323 %type<decl> parameter_declaration parameter_list parameter_type_list 324 %type<decl> parameter_type_list_opt 397 %type<decl> KR_parameter_list KR_parameter_list_opt 398 399 %type<decl> parameter_declaration parameter_list parameter_type_list_opt 325 400 326 401 %type<decl> paren_identifier paren_type … … 343 418 %type<decl> type_parameter type_parameter_list type_initializer_opt 344 419 345 %type<en> type_ list420 %type<en> type_parameters_opt type_list 346 421 347 422 %type<decl> type_qualifier type_qualifier_name forall type_qualifier_list_opt type_qualifier_list … … 354 429 355 430 // initializers 356 %type<in> initializer initializer_list initializer_opt431 %type<in> initializer initializer_list_opt initializer_opt 357 432 358 433 // designators … … 378 453 // Foo ( *fp )( int ); 379 454 // `---' matches start of TYPEGENname '(' 380 // Must be:455 // must be: 381 456 // Foo( int ) ( *fp )( int ); 457 // The same problem occurs here: 458 // forall( otype T ) struct Foo { T v; } ( *fp )( int ); 459 // must be: 460 // forall( otype T ) struct Foo { T v; } ( int ) ( *fp )( int ); 382 461 383 462 // Order of these lines matters (low-to-high precedence). 384 463 %precedence TYPEGENname 464 %precedence '}' 385 465 %precedence '(' 386 466 387 %locations // support location tracking for error messages467 %locations // support location tracking for error messages 388 468 389 469 %start translation_unit // parse-tree root … … 392 472 //************************* Namespace Management ******************************** 393 473 394 // The grammar in the ANSI C standard is not strictly context-free, since it relies upon the distinct terminal symbols395 // "identifier", "TYPEDEFname", and "TYPEGENname" that are lexically identical. While it is possible to write a purely396 // context-free grammar, such a grammar would obscure the relationship between syntactic and semantic constructs.397 // Hence, this grammar uses the ANSI style.398 // 399 // Cforall compounds this problem by introducing type names local to the scope of a declaration (for instance, those400 // introduced through "forall" qualifiers), and by introducing "type generators" -- parameterized types. This latter401 // type name creates a third class of identifiers that must be distinguished by the scanner.402 // 403 // Since the scanner cannot distinguish among the different classes of identifiers without some context information, it404 // accesses a data structure (TypedefTable) to allow classification of an identifier that it has just read. Semantic405 // actions during the parser update this data structure when the class of identifiers change.406 // 407 // Because the Cforall language is block-scoped, there is the possibility that an identifier can change its class in a408 // local scope; it must revert to its original class at the end of the block. Since type names can be local to a409 // particular declaration, each declaration is itself a scope. This requires distinguishing between type names that are410 // local to the current declaration scope and those that persist past the end of the declaration (i.e., names defined in411 // "typedef" or "otype" declarations).412 // 413 // The non-terminals "push" and "pop" derive the empty string; their only use is to denote the opening and closing of414 // scopes. Every push must have a matching pop, although it is regrettable the matching pairs do not always occur415 // within the same rule. These non-terminals may appear in more contexts than strictly necessary from a semantic point416 // of view. Unfortunately, these extra rules are necessary to prevent parsing conflicts -- the parser may not have417 // enough context and look-ahead information to decide whether a new scope is necessary, so the effect of these extra418 // rules is to open a new scope unconditionally. As the grammar evolves, it may be neccesary to add or move around419 // "push" and "pop" nonterminals to resolve conflicts of this sort.474 // The C grammar is not context free because it relies on the distinct terminal symbols "identifier" and "TYPEDEFname", 475 // which are lexically identical. 476 // 477 // typedef int foo; // identifier foo must now be scanned as TYPEDEFname 478 // foo f; // to allow it to appear in this context 479 // 480 // While it may be possible to write a purely context-free grammar, such a grammar would obscure the relationship 481 // between syntactic and semantic constructs. Cforall compounds this problem by introducing type names local to the 482 // scope of a declaration (for instance, those introduced through "forall" qualifiers), and by introducing "type 483 // generators" -- parameterized types. This latter type name creates a third class of identifiers, "TYPEGENname", which 484 // must be distinguished by the lexical scanner. 485 // 486 // Since the scanner cannot distinguish among the different classes of identifiers without some context information, 487 // there is a type table (typedefTable), which holds type names and identifiers that override type names, for each named 488 // scope. During parsing, semantic actions update the type table by adding new identifiers in the current scope. For 489 // each context that introduces a name scope, a new level is created in the type table and that level is popped on 490 // exiting the scope. Since type names can be local to a particular declaration, each declaration is itself a scope. 491 // This requires distinguishing between type names that are local to the current declaration scope and those that 492 // persist past the end of the declaration (i.e., names defined in "typedef" or "otype" declarations). 493 // 494 // The non-terminals "push" and "pop" denote the opening and closing of named scopes. Every push has a matching pop in 495 // the production rule. There are multiple lists of declarations, where each declaration is a named scope, so pop/push 496 // around the list separator. 497 // 498 // int f( forall(T) T (*f1) T , forall( S ) S (*f2)( S ) ); 499 // push pop push pop 420 500 421 501 push: … … 443 523 ; 444 524 445 identifier:446 IDENTIFIER447 | ATTR_IDENTIFIER // CFA448 | quasi_keyword449 ;450 451 525 no_attr_identifier: 452 526 IDENTIFIER 453 527 | quasi_keyword 528 | '@' // CFA 529 { Token tok = { new string( DeclarationNode::anonymous.newName() ), yylval.tok.loc }; $$ = tok; } 530 ; 531 532 identifier: 533 no_attr_identifier 534 | ATTR_IDENTIFIER // CFA 454 535 ; 455 536 … … 480 561 | '(' compound_statement ')' // GCC, lambda expression 481 562 { $$ = new ExpressionNode( new StmtExpr( dynamic_cast< CompoundStmt * >(maybeMoveBuild< Statement >($2) ) ) ); } 563 | constant '`' IDENTIFIER // CFA, postfix call 564 { $$ = new ExpressionNode( build_func( new ExpressionNode( build_postfix_name( $3 ) ), $1 ) ); } 565 | string_literal '`' IDENTIFIER // CFA, postfix call 566 { $$ = new ExpressionNode( build_func( new ExpressionNode( build_postfix_name( $3 ) ), new ExpressionNode( $1 ) ) ); } 567 | IDENTIFIER '`' IDENTIFIER // CFA, postfix call 568 { $$ = new ExpressionNode( build_func( new ExpressionNode( build_postfix_name( $3 ) ), new ExpressionNode( build_varref( $1 ) ) ) ); } 569 | tuple '`' IDENTIFIER // CFA, postfix call 570 { $$ = new ExpressionNode( build_func( new ExpressionNode( build_postfix_name( $3 ) ), $1 ) ); } 571 | '(' comma_expression ')' '`' IDENTIFIER // CFA, postfix call 572 { $$ = new ExpressionNode( build_func( new ExpressionNode( build_postfix_name( $5 ) ), $2 ) ); } 482 573 | type_name '.' no_attr_identifier // CFA, nested type 483 { throw SemanticError("Qualified names are currently unimplemented."); $$ = nullptr; } // FIX ME 484 | type_name '.' '[' push field_list pop ']' // CFA, nested type / tuple field selector 485 { throw SemanticError("Qualified names are currently unimplemented."); $$ = nullptr; } // FIX ME 574 { SemanticError( yylloc, "Qualified name is currently unimplemented." ); $$ = nullptr; } 575 | type_name '.' '[' field_name_list ']' // CFA, nested type / tuple field selector 576 { SemanticError( yylloc, "Qualified name is currently unimplemented." ); $$ = nullptr; } 577 | GENERIC '(' assignment_expression ',' generic_assoc_list ')' // C11 578 { 579 // add the missing control expression to the GenericExpr and return it 580 $5->control = maybeMoveBuild<Expression>( $3 ); 581 $$ = new ExpressionNode( $5 ); 582 } 583 ; 584 585 generic_assoc_list: // C11 586 generic_association 587 | generic_assoc_list ',' generic_association 588 { 589 // steal the association node from the singleton and delete the wrapper 590 $1->associations.splice($1->associations.end(), $3->associations); 591 delete $3; 592 $$ = $1; 593 } 594 ; 595 596 generic_association: // C11 597 type_no_function ':' assignment_expression 598 { 599 // create a GenericExpr wrapper with one association pair 600 $$ = new GenericExpr( nullptr, { { maybeMoveBuildType($1), maybeMoveBuild<Expression>($3) } } ); 601 } 602 | DEFAULT ':' assignment_expression 603 { $$ = new GenericExpr( nullptr, { { maybeMoveBuild<Expression>($3) } } ); } 486 604 ; 487 605 488 606 postfix_expression: 489 607 primary_expression 490 | postfix_expression '[' push assignment_expression pop']'608 | postfix_expression '[' assignment_expression ']' 491 609 // CFA, comma_expression disallowed in this context because it results in a common user error: subscripting a 492 610 // matrix with x[i,j] instead of x[i][j]. While this change is not backwards compatible, there seems to be 493 611 // little advantage to this feature and many disadvantages. It is possible to write x[(i,j)] in CFA, which is 494 612 // equivalent to the old x[i,j]. 495 { $$ = new ExpressionNode( build_binary_val( OperKinds::Index, $1, $ 4) ); }613 { $$ = new ExpressionNode( build_binary_val( OperKinds::Index, $1, $3 ) ); } 496 614 | postfix_expression '{' argument_expression_list '}' // CFA, constructor call 497 615 { … … 504 622 | postfix_expression '.' no_attr_identifier 505 623 { $$ = new ExpressionNode( build_fieldSel( $1, build_varref( $3 ) ) ); } 506 | postfix_expression '.' '[' push field_list pop ']' // CFA, tuple field selector507 { $$ = new ExpressionNode( build_fieldSel( $1, build_ tuple( $5) ) ); }624 | postfix_expression '.' INTEGERconstant // CFA, tuple index 625 { $$ = new ExpressionNode( build_fieldSel( $1, build_constantInteger( *$3 ) ) ); } 508 626 | postfix_expression FLOATING_FRACTIONconstant // CFA, tuple index 509 627 { $$ = new ExpressionNode( build_fieldSel( $1, build_field_name_FLOATING_FRACTIONconstant( *$2 ) ) ); } 628 | postfix_expression '.' '[' field_name_list ']' // CFA, tuple field selector 629 { $$ = new ExpressionNode( build_fieldSel( $1, build_tuple( $4 ) ) ); } 510 630 | postfix_expression ARROW no_attr_identifier 511 631 { 512 632 $$ = new ExpressionNode( build_pfieldSel( $1, *$3 == "0" || *$3 == "1" ? build_constantInteger( *$3 ) : build_varref( $3 ) ) ); 513 633 } 514 | postfix_expression ARROW '[' push field_list pop ']' // CFA, tuple field selector515 { $$ = new ExpressionNode( build_pfieldSel( $1, build_tuple( $5 ) ) ); }516 634 | postfix_expression ARROW INTEGERconstant // CFA, tuple index 517 635 { $$ = new ExpressionNode( build_pfieldSel( $1, build_constantInteger( *$3 ) ) ); } 636 | postfix_expression ARROW '[' field_name_list ']' // CFA, tuple field selector 637 { $$ = new ExpressionNode( build_pfieldSel( $1, build_tuple( $4 ) ) ); } 518 638 | postfix_expression ICR 519 639 { $$ = new ExpressionNode( build_unary_ptr( OperKinds::IncrPost, $1 ) ); } 520 640 | postfix_expression DECR 521 641 { $$ = new ExpressionNode( build_unary_ptr( OperKinds::DecrPost, $1 ) ); } 522 | '(' type_no_function ')' '{' initializer_list comma_opt '}' // C99, compound-literal642 | '(' type_no_function ')' '{' initializer_list_opt comma_opt '}' // C99, compound-literal 523 643 { $$ = new ExpressionNode( build_compoundLiteral( $2, new InitializerNode( $5, true ) ) ); } 644 | '(' type_no_function ')' '@' '{' initializer_list_opt comma_opt '}' // CFA, explicit C compound-literal 645 { $$ = new ExpressionNode( build_compoundLiteral( $2, (new InitializerNode( $6, true ))->set_maybeConstructed( false ) ) ); } 524 646 | '^' primary_expression '{' argument_expression_list '}' // CFA 525 647 { … … 539 661 // empty 540 662 { $$ = nullptr; } 541 // | '@' // use default argument 542 // { $$ = new ExpressionNode( build_constantInteger( *new string( "2" ) ) ); } 663 | '?' // CFA, default parameter 664 { SemanticError( yylloc, "Default parameter for argument is currently unimplemented." ); $$ = nullptr; } 665 // { $$ = new ExpressionNode( build_constantInteger( *new string( "2" ) ) ); } 543 666 | assignment_expression 544 667 ; 545 668 546 field_ list:// CFA, tuple field selector669 field_name_list: // CFA, tuple field selector 547 670 field 548 | field_ list ',' field{ $$ = (ExpressionNode *)$1->set_last( $3 ); }671 | field_name_list ',' field { $$ = (ExpressionNode *)$1->set_last( $3 ); } 549 672 ; 550 673 … … 553 676 | FLOATING_DECIMALconstant field 554 677 { $$ = new ExpressionNode( build_fieldSel( new ExpressionNode( build_field_name_FLOATING_DECIMALconstant( *$1 ) ), maybeMoveBuild<Expression>( $2 ) ) ); } 555 | FLOATING_DECIMALconstant '[' push field_list pop']'556 { $$ = new ExpressionNode( build_fieldSel( new ExpressionNode( build_field_name_FLOATING_DECIMALconstant( *$1 ) ), build_tuple( $ 4) ) ); }678 | FLOATING_DECIMALconstant '[' field_name_list ']' 679 { $$ = new ExpressionNode( build_fieldSel( new ExpressionNode( build_field_name_FLOATING_DECIMALconstant( *$1 ) ), build_tuple( $3 ) ) ); } 557 680 | field_name '.' field 558 681 { $$ = new ExpressionNode( build_fieldSel( $1, maybeMoveBuild<Expression>( $3 ) ) ); } 559 | field_name '.' '[' push field_list pop']'560 { $$ = new ExpressionNode( build_fieldSel( $1, build_tuple( $ 5) ) ); }682 | field_name '.' '[' field_name_list ']' 683 { $$ = new ExpressionNode( build_fieldSel( $1, build_tuple( $4 ) ) ); } 561 684 | field_name ARROW field 562 685 { $$ = new ExpressionNode( build_pfieldSel( $1, maybeMoveBuild<Expression>( $3 ) ) ); } 563 | field_name ARROW '[' push field_list pop']'564 { $$ = new ExpressionNode( build_pfieldSel( $1, build_tuple( $ 5) ) ); }686 | field_name ARROW '[' field_name_list ']' 687 { $$ = new ExpressionNode( build_pfieldSel( $1, build_tuple( $4 ) ) ); } 565 688 ; 566 689 567 690 field_name: 568 INTEGERconstant fraction_constants 691 INTEGERconstant fraction_constants_opt 569 692 { $$ = new ExpressionNode( build_field_name_fraction_constants( build_constantInteger( *$1 ), $2 ) ); } 570 | FLOATINGconstant fraction_constants 693 | FLOATINGconstant fraction_constants_opt 571 694 { $$ = new ExpressionNode( build_field_name_fraction_constants( build_field_name_FLOATINGconstant( *$1 ), $2 ) ); } 572 | no_attr_identifier fraction_constants 695 | no_attr_identifier fraction_constants_opt 573 696 { 574 697 $$ = new ExpressionNode( build_field_name_fraction_constants( build_varref( $1 ), $2 ) ); … … 576 699 ; 577 700 578 fraction_constants :701 fraction_constants_opt: 579 702 // empty 580 703 { $$ = nullptr; } 581 | fraction_constants FLOATING_FRACTIONconstant704 | fraction_constants_opt FLOATING_FRACTIONconstant 582 705 { 583 706 Expression * constant = build_field_name_FLOATING_FRACTIONconstant( *$2 ); … … 591 714 // semantics checks, e.g., ++3, 3--, *3, &&3 592 715 | constant 593 { $$ = $1; }594 716 | string_literal 595 717 { $$ = new ExpressionNode( $1 ); } … … 657 779 | '(' type_no_function ')' cast_expression 658 780 { $$ = new ExpressionNode( build_cast( $2, $4 ) ); } 781 | '(' COROUTINE '&' ')' cast_expression // CFA 782 { $$ = new ExpressionNode( build_keyword_cast( KeywordCastExpr::Coroutine, $5 ) ); } 783 | '(' THREAD '&' ')' cast_expression // CFA 784 { $$ = new ExpressionNode( build_keyword_cast( KeywordCastExpr::Thread, $5 ) ); } 785 | '(' MONITOR '&' ')' cast_expression // CFA 786 { $$ = new ExpressionNode( build_keyword_cast( KeywordCastExpr::Monitor, $5 ) ); } 659 787 // VIRTUAL cannot be opt because of look ahead issues 660 | '(' VIRTUAL ')' cast_expression 788 | '(' VIRTUAL ')' cast_expression // CFA 661 789 { $$ = new ExpressionNode( new VirtualCastExpr( maybeMoveBuild< Expression >( $4 ), maybeMoveBuildType( nullptr ) ) ); } 662 | '(' VIRTUAL type_no_function ')' cast_expression 790 | '(' VIRTUAL type_no_function ')' cast_expression // CFA 663 791 { $$ = new ExpressionNode( new VirtualCastExpr( maybeMoveBuild< Expression >( $5 ), maybeMoveBuildType( $3 ) ) ); } 664 792 // | '(' type_no_function ')' tuple … … 752 880 | logical_OR_expression '?' comma_expression ':' conditional_expression 753 881 { $$ = new ExpressionNode( build_cond( $1, $3, $5 ) ); } 754 // FIX ME: this hackcomputes $1 twice882 // FIX ME: computes $1 twice 755 883 | logical_OR_expression '?' /* empty */ ':' conditional_expression // GCC, omitted first operand 756 884 { $$ = new ExpressionNode( build_cond( $1, $1, $4 ) ); } … … 766 894 | unary_expression assignment_operator assignment_expression 767 895 { $$ = new ExpressionNode( build_binary_val( $2, $1, $3 ) ); } 896 | unary_expression '=' '{' initializer_list_opt comma_opt '}' 897 { SemanticError( yylloc, "Initializer assignment is currently unimplemented." ); $$ = nullptr; } 768 898 ; 769 899 … … 795 925 // '[' ']' 796 926 // { $$ = new ExpressionNode( build_tuple() ); } 797 // '[' push assignment_expression pop ']'927 // | '[' push assignment_expression pop ']' 798 928 // { $$ = new ExpressionNode( build_tuple( $3 ) ); } 799 '[' push ',' tuple_expression_list pop']'800 { $$ = new ExpressionNode( build_tuple( (ExpressionNode *)(new ExpressionNode( nullptr ) )->set_last( $ 4) ) ); }801 | '[' push assignment_expression ',' tuple_expression_list pop']'802 { $$ = new ExpressionNode( build_tuple( (ExpressionNode *)$3->set_last( $ 5) ) ); }929 '[' ',' tuple_expression_list ']' 930 { $$ = new ExpressionNode( build_tuple( (ExpressionNode *)(new ExpressionNode( nullptr ) )->set_last( $3 ) ) ); } 931 | '[' push assignment_expression pop ',' tuple_expression_list ']' 932 { $$ = new ExpressionNode( build_tuple( (ExpressionNode *)$3->set_last( $6 ) ) ); } 803 933 ; 804 934 … … 826 956 labeled_statement 827 957 | compound_statement 828 | expression_statement { $$ = $1; }958 | expression_statement 829 959 | selection_statement 830 960 | iteration_statement … … 834 964 | waitfor_statement 835 965 | exception_statement 966 | enable_disable_statement 967 { SemanticError( yylloc, "enable/disable statement is currently unimplemented." ); $$ = nullptr; } 836 968 | asm_statement 969 | DIRECTIVE 970 { $$ = new StatementNode( build_directive( $1 ) ); } 971 ; 837 972 838 973 labeled_statement: … … 847 982 '{' '}' 848 983 { $$ = new StatementNode( build_compound( (StatementNode *)0 ) ); } 849 | '{' 850 // Two scopes are necessary because the block itself has a scope, but every declaration within the block also 851 // requires its own scope. 852 push push 984 | '{' push 853 985 local_label_declaration_opt // GCC, local labels 854 986 statement_decl_list // C99, intermix declarations and statements 855 987 pop '}' 856 { $$ = new StatementNode( build_compound( $ 5) ); }988 { $$ = new StatementNode( build_compound( $4 ) ); } 857 989 ; 858 990 859 991 statement_decl_list: // C99 860 992 statement_decl 861 | statement_decl_list pushstatement_decl862 { if ( $1 != 0 ) { $1->set_last( $ 3); $$ = $1; } }993 | statement_decl_list statement_decl 994 { if ( $1 != 0 ) { $1->set_last( $2 ); $$ = $1; } } 863 995 ; 864 996 … … 878 1010 $$ = new StatementNode( $2 ); 879 1011 } 880 | statement pop1012 | statement 881 1013 ; 882 1014 … … 893 1025 894 1026 selection_statement: 895 IF '(' push if_control_expression ')' statement %prec THEN 896 // explicitly deal with the shift/reduce conflict on if/else 897 { $$ = new StatementNode( build_if( $4, $6, nullptr ) ); } 898 | IF '(' push if_control_expression ')' statement ELSE statement 899 { $$ = new StatementNode( build_if( $4, $6, $8 ) ); } 1027 // pop causes a S/R conflict without separating the IF statement into a non-terminal even after resolving 1028 // the inherent S/R conflict with THEN/ELSE. 1029 push if_statement pop 1030 { $$ = $2; } 900 1031 | SWITCH '(' comma_expression ')' case_clause 901 { $$ = new StatementNode( build_switch( $3, $5 ) ); }902 | SWITCH '(' comma_expression ')' '{' push declaration_list_opt switch_clause_list_opt '}' // CFA903 { 904 StatementNode *sw = new StatementNode( build_switch( $3, $8 ) );1032 { $$ = new StatementNode( build_switch( true, $3, $5 ) ); } 1033 | SWITCH '(' comma_expression ')' '{' push declaration_list_opt switch_clause_list_opt pop '}' // CFA 1034 { 1035 StatementNode *sw = new StatementNode( build_switch( true, $3, $8 ) ); 905 1036 // The semantics of the declaration list is changed to include associated initialization, which is performed 906 1037 // *before* the transfer to the appropriate case clause by hoisting the declarations into a compound … … 911 1042 } 912 1043 | CHOOSE '(' comma_expression ')' case_clause // CFA 913 { $$ = new StatementNode( build_switch( $3, $5 ) ); }914 | CHOOSE '(' comma_expression ')' '{' push declaration_list_opt choose_clause_list_opt'}' // CFA915 { 916 StatementNode *sw = new StatementNode( build_switch( $3, $8 ) );1044 { $$ = new StatementNode( build_switch( false, $3, $5 ) ); } 1045 | CHOOSE '(' comma_expression ')' '{' push declaration_list_opt switch_clause_list_opt pop '}' // CFA 1046 { 1047 StatementNode *sw = new StatementNode( build_switch( false, $3, $8 ) ); 917 1048 $$ = $7 ? new StatementNode( build_compound( (StatementNode *)((new StatementNode( $7 ))->set_last( sw )) ) ) : sw; 918 1049 } 919 1050 ; 920 1051 1052 if_statement: 1053 IF '(' if_control_expression ')' statement %prec THEN 1054 // explicitly deal with the shift/reduce conflict on if/else 1055 { $$ = new StatementNode( build_if( $3, $5, nullptr ) ); } 1056 | IF '(' if_control_expression ')' statement ELSE statement 1057 { $$ = new StatementNode( build_if( $3, $5, $7 ) ); } 1058 ; 1059 921 1060 if_control_expression: 922 comma_expression pop923 { $$ = new IfCt l( nullptr, $1 ); }924 | c_declaration pop// no semi-colon925 { $$ = new IfCt l( $1, nullptr ); }926 | cfa_declaration pop// no semi-colon927 { $$ = new IfCt l( $1, nullptr ); }1061 comma_expression 1062 { $$ = new IfCtrl( nullptr, $1 ); } 1063 | c_declaration // no semi-colon 1064 { $$ = new IfCtrl( $1, nullptr ); } 1065 | cfa_declaration // no semi-colon 1066 { $$ = new IfCtrl( $1, nullptr ); } 928 1067 | declaration comma_expression // semi-colon separated 929 { $$ = new IfCt l( $1, $2 ); }1068 { $$ = new IfCtrl( $1, $2 ); } 930 1069 ; 931 1070 … … 952 1091 ; 953 1092 1093 //label_list_opt: 1094 // // empty 1095 // | identifier_or_type_name ':' 1096 // | label_list_opt identifier_or_type_name ':' 1097 // ; 1098 954 1099 case_label_list: // CFA 955 1100 case_label … … 974 1119 ; 975 1120 976 choose_clause_list_opt: // CFA977 // empty978 { $$ = nullptr; }979 | choose_clause_list980 ;981 982 choose_clause_list: // CFA983 case_label_list fall_through984 { $$ = $1->append_last_case( $2 ); }985 | case_label_list statement_list_nodecl fall_through_opt986 { $$ = $1->append_last_case( new StatementNode( build_compound( (StatementNode *)$2->set_last( $3 ) ) ) ); }987 | choose_clause_list case_label_list fall_through988 { $$ = (StatementNode *)( $1->set_last( $2->append_last_case( $3 ))); }989 | choose_clause_list case_label_list statement_list_nodecl fall_through_opt990 { $$ = (StatementNode *)( $1->set_last( $2->append_last_case( new StatementNode( build_compound( (StatementNode *)$3->set_last( $4 ) ) ) ) ) ); }991 ;992 993 fall_through_opt: // CFA994 // empty995 { $$ = new StatementNode( build_branch( BranchStmt::Break ) ); } // insert implicit break996 | fall_through997 ;998 999 fall_through_name: // CFA1000 FALLTHRU1001 | FALLTHROUGH1002 ;1003 1004 fall_through: // CFA1005 fall_through_name1006 { $$ = nullptr; }1007 | fall_through_name ';'1008 { $$ = nullptr; }1009 ;1010 1011 1121 iteration_statement: 1012 WHILE '(' comma_expression ')' statement 1013 { $$ = new StatementNode( build_while( $3, $5 ) ); } 1122 WHILE '(' push if_control_expression ')' statement pop 1123 { $$ = new StatementNode( build_while( $4, $6 ) ); } 1124 | WHILE '(' ')' statement // CFA => while ( 1 ) 1125 { $$ = new StatementNode( build_while( new IfCtrl( nullptr, new ExpressionNode( build_constantInteger( *new string( "1" ) ) ) ), $4 ) ); } 1014 1126 | DO statement WHILE '(' comma_expression ')' ';' 1015 { $$ = new StatementNode( build_while( $5, $2, true ) ); } 1016 | FOR '(' push for_control_expression ')' statement 1127 { $$ = new StatementNode( build_do_while( $5, $2 ) ); } 1128 | DO statement WHILE '(' ')' ';' // CFA => do while( 1 ) 1129 { $$ = new StatementNode( build_do_while( new ExpressionNode( build_constantInteger( *new string( "1" ) ) ), $2 ) ); } 1130 | FOR '(' push for_control_expression ')' statement pop 1017 1131 { $$ = new StatementNode( build_for( $4, $6 ) ); } 1018 1132 ; 1019 1133 1020 1134 for_control_expression: 1021 comma_expression_opt pop ';' comma_expression_opt ';' comma_expression_opt 1022 { $$ = new ForCtl( $1, $4, $6 ); } 1023 | declaration comma_expression_opt ';' comma_expression_opt // C99 1024 { $$ = new ForCtl( $1, $2, $4 ); } 1135 comma_expression_opt // CFA 1136 { 1137 if ( ! $1 ) { // => for ( ;; ) 1138 $$ = new ForCtrl( (ExpressionNode * )nullptr, (ExpressionNode * )nullptr, (ExpressionNode * )nullptr ); 1139 } 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" ) ) ) ); 1142 } // if 1143 } 1144 | 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" ) ) ) ); } 1146 | constant_expression inclexcl constant_expression '~' constant_expression // CFA 1147 { $$ = forCtrl( $1, new string( DeclarationNode::anonymous.newName() ), $1->clone(), $2, $3, $5 ); } 1148 | comma_expression_opt ';' comma_expression // CFA 1149 { 1150 if ( ! $1 ) { 1151 SemanticError( yylloc, "Missing loop index." ); $$ = nullptr; 1152 } else if ( ! $3 ) { 1153 SemanticError( yylloc, "Missing loop range." ); $$ = nullptr; 1154 } else { 1155 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" ) ) ) ); 1158 } else { 1159 SemanticError( yylloc, "Expression disallowed. Only loop-index name allowed" ); $$ = nullptr; 1160 } // if 1161 } // if 1162 } 1163 | comma_expression_opt ';' constant_expression inclexcl constant_expression // CFA 1164 { 1165 if ( ! $1 ) { 1166 SemanticError( yylloc, "Missing loop index." ); $$ = nullptr; 1167 } else { 1168 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" ) ) ) ); 1170 } else { 1171 SemanticError( yylloc, "Expression disallowed. Only loop-index name allowed" ); $$ = nullptr; 1172 } // if 1173 } // if 1174 } 1175 | comma_expression_opt ';' constant_expression inclexcl constant_expression '~' constant_expression // CFA 1176 { 1177 if ( ! $1 ) { 1178 SemanticError( yylloc, "Missing loop index." ); $$ = nullptr; 1179 } else { 1180 if ( NameExpr *identifier = dynamic_cast<NameExpr *>($1->get_expr()) ) { 1181 $$ = forCtrl( $3, new string( identifier->name ), $3->clone(), $4, $5, $7 ); 1182 } else { 1183 SemanticError( yylloc, "Expression disallowed. Only loop-index name allowed" ); $$ = nullptr; 1184 } // if 1185 } // if 1186 } 1187 | comma_expression_opt ';' comma_expression_opt ';' comma_expression_opt 1188 { $$ = new ForCtrl( $1, $3, $5 ); } 1189 | declaration comma_expression_opt ';' comma_expression_opt // C99, declaration has ';' 1190 { $$ = new ForCtrl( $1, $2, $4 ); } 1191 ; 1192 1193 inclexcl: 1194 '~' 1195 { $$ = OperKinds::LThan; } 1196 | Erange 1197 { $$ = OperKinds::LEThan; } 1025 1198 ; 1026 1199 … … 1032 1205 // whereas normal operator precedence yields goto (*i)+3; 1033 1206 { $$ = new StatementNode( build_computedgoto( $3 ) ); } 1207 // A semantic check is required to ensure fallthru appears only in the body of a choose statement. 1208 | fall_through_name ';' // CFA 1209 { $$ = new StatementNode( build_branch( BranchStmt::FallThrough ) ); } 1210 | fall_through_name identifier_or_type_name ';' // CFA 1211 { $$ = new StatementNode( build_branch( $2, BranchStmt::FallThrough ) ); } 1212 | fall_through_name DEFAULT ';' // CFA 1213 { $$ = new StatementNode( build_branch( BranchStmt::FallThroughDefault ) ); } 1034 1214 | CONTINUE ';' 1035 1215 // A semantic check is required to ensure this statement appears only in the body of an iteration statement. … … 1048 1228 | RETURN comma_expression_opt ';' 1049 1229 { $$ = new StatementNode( build_return( $2 ) ); } 1230 | RETURN '{' initializer_list_opt comma_opt '}' 1231 { SemanticError( yylloc, "Initializer return is currently unimplemented." ); $$ = nullptr; } 1050 1232 | THROW assignment_expression_opt ';' // handles rethrow 1051 1233 { $$ = new StatementNode( build_throw( $2 ) ); } … … 1056 1238 ; 1057 1239 1240 fall_through_name: // CFA 1241 FALLTHRU 1242 | FALLTHROUGH 1243 ; 1244 1058 1245 with_statement: 1059 1246 WITH '(' tuple_expression_list ')' statement … … 1066 1253 mutex_statement: 1067 1254 MUTEX '(' argument_expression_list ')' statement 1068 { throw SemanticError("Mutex statement is currently unimplemented."); $$ = nullptr; } // FIX ME1255 { SemanticError( yylloc, "Mutex statement is currently unimplemented." ); $$ = nullptr; } 1069 1256 ; 1070 1257 1071 1258 when_clause: 1072 WHEN '(' comma_expression ')' 1073 { $$ = $3; } 1259 WHEN '(' comma_expression ')' { $$ = $3; } 1074 1260 ; 1075 1261 … … 1081 1267 1082 1268 waitfor: 1083 WAITFOR '(' identifier ')' 1084 { 1085 $$ = new ExpressionNode( new NameExpr( *$3 ) ); 1086 delete $3; 1087 } 1088 | WAITFOR '(' identifier ',' argument_expression_list ')' 1089 { 1090 $$ = new ExpressionNode( new NameExpr( *$3 ) ); 1091 $$->set_last( $5 ); 1092 delete $3; 1093 } 1269 WAITFOR '(' cast_expression ')' 1270 { $$ = $3; } 1271 | WAITFOR '(' cast_expression ',' argument_expression_list ')' 1272 { $$ = (ExpressionNode *)$3->set_last( $5 ); } 1094 1273 ; 1095 1274 1096 1275 timeout: 1097 TIMEOUT '(' comma_expression ')' 1098 { $$ = $3; } 1276 TIMEOUT '(' comma_expression ')' { $$ = $3; } 1099 1277 ; 1100 1278 … … 1109 1287 { $$ = build_waitfor_timeout( nullptr, $3, $1 ); } 1110 1288 // "else" must be conditional after timeout or timeout is never triggered (i.e., it is meaningless) 1289 | when_clause_opt timeout statement WOR ELSE statement 1290 { SemanticError( yylloc, "else clause must be conditional after timeout or timeout never triggered." ); $$ = nullptr; } 1111 1291 | when_clause_opt timeout statement WOR when_clause ELSE statement 1112 1292 { $$ = build_waitfor_timeout( $2, $3, $1, $7, $5 ); } … … 1130 1310 1131 1311 handler_clause: 1132 handler_key '(' push pushexception_declaration pop handler_predicate_opt ')' compound_statement pop1133 { $$ = new StatementNode( build_catch( $1, $ 5, $7, $9) ); }1134 | handler_clause handler_key '(' push pushexception_declaration pop handler_predicate_opt ')' compound_statement pop1135 { $$ = (StatementNode *)$1->set_last( new StatementNode( build_catch( $2, $ 6, $8, $10) ) ); }1312 handler_key '(' push exception_declaration pop handler_predicate_opt ')' compound_statement pop 1313 { $$ = new StatementNode( build_catch( $1, $4, $6, $8 ) ); } 1314 | handler_clause handler_key '(' push exception_declaration pop handler_predicate_opt ')' compound_statement pop 1315 { $$ = (StatementNode *)$1->set_last( new StatementNode( build_catch( $2, $5, $7, $9 ) ) ); } 1136 1316 ; 1137 1317 1138 1318 handler_predicate_opt: 1139 // empty1319 // empty 1140 1320 { $$ = nullptr; } 1141 | ';' conditional_expression 1142 { $$ = $2; } 1321 | ';' conditional_expression { $$ = $2; } 1143 1322 ; 1144 1323 1145 1324 handler_key: 1146 CATCH 1147 { $$ = CatchStmt::Terminate; } 1148 | CATCHRESUME 1149 { $$ = CatchStmt::Resume; } 1325 CATCH { $$ = CatchStmt::Terminate; } 1326 | CATCHRESUME { $$ = CatchStmt::Resume; } 1150 1327 ; 1151 1328 1152 1329 finally_clause: 1153 FINALLY compound_statement 1154 { 1155 $$ = new StatementNode( build_finally( $2 ) ); 1156 } 1330 FINALLY compound_statement { $$ = new StatementNode( build_finally( $2 ) ); } 1157 1331 ; 1158 1332 … … 1161 1335 type_specifier_nobody 1162 1336 | type_specifier_nobody declarator 1163 { 1164 typedefTable.addToEnclosingScope( TypedefTable::ID ); 1165 $$ = $2->addType( $1 ); 1166 } 1337 { $$ = $2->addType( $1 ); } 1167 1338 | type_specifier_nobody variable_abstract_declarator 1168 1339 { $$ = $2->addType( $1 ); } 1169 1340 | cfa_abstract_declarator_tuple no_attr_identifier // CFA 1170 { 1171 typedefTable.addToEnclosingScope( TypedefTable::ID ); 1172 $$ = $1->addName( $2 ); 1173 } 1341 { $$ = $1->addName( $2 ); } 1174 1342 | cfa_abstract_declarator_tuple // CFA 1343 ; 1344 1345 enable_disable_statement: 1346 enable_disable_key identifier_list compound_statement 1347 ; 1348 1349 enable_disable_key: 1350 ENABLE 1351 | DISABLE 1175 1352 ; 1176 1353 1177 1354 asm_statement: 1178 1355 ASM asm_volatile_opt '(' string_literal ')' ';' 1179 { $$ = new StatementNode( build_asm stmt( $2, $4, 0 ) ); }1356 { $$ = new StatementNode( build_asm( $2, $4, 0 ) ); } 1180 1357 | ASM asm_volatile_opt '(' string_literal ':' asm_operands_opt ')' ';' // remaining GCC 1181 { $$ = new StatementNode( build_asm stmt( $2, $4, $6 ) ); }1358 { $$ = new StatementNode( build_asm( $2, $4, $6 ) ); } 1182 1359 | ASM asm_volatile_opt '(' string_literal ':' asm_operands_opt ':' asm_operands_opt ')' ';' 1183 { $$ = new StatementNode( build_asm stmt( $2, $4, $6, $8 ) ); }1360 { $$ = new StatementNode( build_asm( $2, $4, $6, $8 ) ); } 1184 1361 | ASM asm_volatile_opt '(' string_literal ':' asm_operands_opt ':' asm_operands_opt ':' asm_clobbers_list_opt ')' ';' 1185 { $$ = new StatementNode( build_asm stmt( $2, $4, $6, $8, $10 ) ); }1362 { $$ = new StatementNode( build_asm( $2, $4, $6, $8, $10 ) ); } 1186 1363 | ASM asm_volatile_opt GOTO '(' string_literal ':' ':' asm_operands_opt ':' asm_clobbers_list_opt ':' label_list ')' ';' 1187 { $$ = new StatementNode( build_asm stmt( $2, $5, 0, $8, $10, $12 ) ); }1364 { $$ = new StatementNode( build_asm( $2, $5, 0, $8, $10, $12 ) ); } 1188 1365 ; 1189 1366 … … 1240 1417 1241 1418 declaration_list_opt: // used at beginning of switch statement 1242 pop1419 // empty 1243 1420 { $$ = nullptr; } 1244 1421 | declaration_list … … 1247 1424 declaration_list: 1248 1425 declaration 1249 | declaration_list pushdeclaration1250 { $$ = $1->appendList( $ 3); }1251 ; 1252 1253 KR_ declaration_list_opt:// used to declare parameter types in K&R style functions1426 | declaration_list declaration 1427 { $$ = $1->appendList( $2 ); } 1428 ; 1429 1430 KR_parameter_list_opt: // used to declare parameter types in K&R style functions 1254 1431 // empty 1255 1432 { $$ = nullptr; } 1256 | KR_ declaration_list1257 ; 1258 1259 KR_ declaration_list:1433 | KR_parameter_list 1434 ; 1435 1436 KR_parameter_list: 1260 1437 push c_declaration pop ';' 1261 1438 { $$ = $2; } 1262 | KR_ declaration_list push c_declaration pop ';'1439 | KR_parameter_list push c_declaration pop ';' 1263 1440 { $$ = $1->appendList( $3 ); } 1264 1441 ; … … 1275 1452 1276 1453 local_label_list: // GCC, local label 1277 no_attr_identifier_or_type_name {}1278 | local_label_list ',' no_attr_identifier_or_type_name {}1454 no_attr_identifier_or_type_name 1455 | local_label_list ',' no_attr_identifier_or_type_name 1279 1456 ; 1280 1457 1281 1458 declaration: // old & new style declarations 1282 c_declaration pop ';' 1283 | cfa_declaration pop ';' // CFA 1284 | STATICASSERT '(' constant_expression ',' string_literal ')' ';' // C11 1285 { throw SemanticError("Static assert is currently unimplemented."); $$ = nullptr; } // FIX ME 1286 ; 1459 c_declaration ';' 1460 | cfa_declaration ';' // CFA 1461 | static_assert // C11 1462 ; 1463 1464 static_assert: 1465 STATICASSERT '(' constant_expression ',' string_literal ')' ';' // C11 1466 { $$ = DeclarationNode::newStaticAssert( $3, $5 ); } 1467 | STATICASSERT '(' constant_expression ')' ';' // CFA 1468 { $$ = DeclarationNode::newStaticAssert( $3, build_constantStr( *new string( "\"\"" ) ) ); } 1287 1469 1288 1470 // C declaration syntax is notoriously confusing and error prone. Cforall provides its own type, variable and function … … 1307 1489 cfa_variable_declaration: // CFA 1308 1490 cfa_variable_specifier initializer_opt 1309 { 1310 typedefTable.addToEnclosingScope( TypedefTable::ID ); 1311 $$ = $1->addInitializer( $2 ); 1312 } 1491 { $$ = $1->addInitializer( $2 ); } 1313 1492 | declaration_qualifier_list cfa_variable_specifier initializer_opt 1314 1493 // declaration_qualifier_list also includes type_qualifier_list, so a semantic check is necessary to preclude 1315 1494 // them as a type_qualifier cannot appear in that context. 1316 { 1317 typedefTable.addToEnclosingScope( TypedefTable::ID ); 1318 $$ = $2->addQualifiers( $1 )->addInitializer( $3 );; 1319 } 1495 { $$ = $2->addQualifiers( $1 )->addInitializer( $3 ); } 1320 1496 | cfa_variable_declaration pop ',' push identifier_or_type_name initializer_opt 1321 { 1322 typedefTable.addToEnclosingScope( *$5, TypedefTable::ID ); 1323 $$ = $1->appendList( $1->cloneType( $5 )->addInitializer( $6 ) ); 1324 } 1497 { $$ = $1->appendList( $1->cloneType( $5 )->addInitializer( $6 ) ); } 1325 1498 ; 1326 1499 … … 1329 1502 // storage-class 1330 1503 cfa_abstract_declarator_no_tuple identifier_or_type_name asm_name_opt 1331 { 1332 typedefTable.setNextIdentifier( *$2 ); 1333 $$ = $1->addName( $2 )->addAsmName( $3 ); 1334 } 1504 { $$ = $1->addName( $2 )->addAsmName( $3 ); } 1335 1505 | cfa_abstract_tuple identifier_or_type_name asm_name_opt 1336 { 1337 typedefTable.setNextIdentifier( *$2 ); 1338 $$ = $1->addName( $2 )->addAsmName( $3 ); 1339 } 1506 { $$ = $1->addName( $2 )->addAsmName( $3 ); } 1340 1507 | type_qualifier_list cfa_abstract_tuple identifier_or_type_name asm_name_opt 1341 { 1342 typedefTable.setNextIdentifier( *$3 ); 1343 $$ = $2->addQualifiers( $1 )->addName( $3 )->addAsmName( $4 ); 1344 } 1508 { $$ = $2->addQualifiers( $1 )->addName( $3 )->addAsmName( $4 ); } 1345 1509 ; 1346 1510 1347 1511 cfa_function_declaration: // CFA 1348 1512 cfa_function_specifier 1349 {1350 typedefTable.addToEnclosingScope( TypedefTable::ID );1351 $$ = $1;1352 }1353 1513 | type_qualifier_list cfa_function_specifier 1354 { 1355 typedefTable.addToEnclosingScope( TypedefTable::ID ); 1356 $$ = $2->addQualifiers( $1 ); 1357 } 1514 { $$ = $2->addQualifiers( $1 ); } 1358 1515 | declaration_qualifier_list cfa_function_specifier 1359 { 1360 typedefTable.addToEnclosingScope( TypedefTable::ID ); 1361 $$ = $2->addQualifiers( $1 ); 1362 } 1516 { $$ = $2->addQualifiers( $1 ); } 1363 1517 | declaration_qualifier_list type_qualifier_list cfa_function_specifier 1364 { 1365 typedefTable.addToEnclosingScope( TypedefTable::ID ); 1366 $$ = $3->addQualifiers( $1 )->addQualifiers( $2 ); 1367 } 1368 | cfa_function_declaration pop ',' push identifier_or_type_name '(' push cfa_parameter_type_list_opt pop ')' 1518 { $$ = $3->addQualifiers( $1 )->addQualifiers( $2 ); } 1519 | cfa_function_declaration ',' identifier_or_type_name '(' push cfa_parameter_ellipsis_list_opt pop ')' 1369 1520 { 1370 1521 // Append the return type at the start (left-hand-side) to each identifier in the list. 1371 1522 DeclarationNode * ret = new DeclarationNode; 1372 1523 ret->type = maybeClone( $1->type->base ); 1373 $$ = $1->appendList( DeclarationNode::newFunction( $ 5, ret, $8, nullptr, true) );1524 $$ = $1->appendList( DeclarationNode::newFunction( $3, ret, $6, nullptr ) ); 1374 1525 } 1375 1526 ; 1376 1527 1377 1528 cfa_function_specifier: // CFA 1378 // '[' ']' identifier_or_type_name '(' push cfa_parameter_ type_list_opt pop ')' // S/R conflict1529 // '[' ']' identifier_or_type_name '(' push cfa_parameter_ellipsis_list_opt pop ')' // S/R conflict 1379 1530 // { 1380 1531 // $$ = DeclarationNode::newFunction( $3, DeclarationNode::newTuple( 0 ), $6, 0, true ); 1381 1532 // } 1382 // '[' ']' identifier '(' push cfa_parameter_ type_list_opt pop ')'1533 // '[' ']' identifier '(' push cfa_parameter_ellipsis_list_opt pop ')' 1383 1534 // { 1384 1535 // typedefTable.setNextIdentifier( *$5 ); 1385 1536 // $$ = DeclarationNode::newFunction( $5, DeclarationNode::newTuple( 0 ), $8, 0, true ); 1386 1537 // } 1387 // | '[' ']' TYPEDEFname '(' push cfa_parameter_ type_list_opt pop ')'1538 // | '[' ']' TYPEDEFname '(' push cfa_parameter_ellipsis_list_opt pop ')' 1388 1539 // { 1389 1540 // typedefTable.setNextIdentifier( *$5 ); … … 1393 1544 // identifier_or_type_name must be broken apart because of the sequence: 1394 1545 // 1395 // '[' ']' identifier_or_type_name '(' cfa_parameter_ type_list_opt ')'1546 // '[' ']' identifier_or_type_name '(' cfa_parameter_ellipsis_list_opt ')' 1396 1547 // '[' ']' type_specifier 1397 1548 // 1398 1549 // type_specifier can resolve to just TYPEDEFname (e.g., typedef int T; int f( T );). Therefore this must be 1399 1550 // flattened to allow lookahead to the '(' without having to reduce identifier_or_type_name. 1400 cfa_abstract_tuple identifier_or_type_name '(' push cfa_parameter_ type_list_opt pop ')'1551 cfa_abstract_tuple identifier_or_type_name '(' push cfa_parameter_ellipsis_list_opt pop ')' 1401 1552 // To obtain LR(1 ), this rule must be factored out from function return type (see cfa_abstract_declarator). 1402 { 1403 $$ = DeclarationNode::newFunction( $2, $1, $5, 0, true ); 1404 } 1405 | cfa_function_return identifier_or_type_name '(' push cfa_parameter_type_list_opt pop ')' 1406 { 1407 $$ = DeclarationNode::newFunction( $2, $1, $5, 0, true ); 1408 } 1553 { $$ = DeclarationNode::newFunction( $2, $1, $5, 0 ); } 1554 | cfa_function_return identifier_or_type_name '(' push cfa_parameter_ellipsis_list_opt pop ')' 1555 { $$ = DeclarationNode::newFunction( $2, $1, $5, 0 ); } 1409 1556 ; 1410 1557 … … 1413 1560 { $$ = DeclarationNode::newTuple( $3 ); } 1414 1561 | '[' push cfa_parameter_list pop ',' push cfa_abstract_parameter_list pop ']' 1415 // To obtain LR(1 ), the last cfa_abstract_parameter_list is added into this flattened rule to lookahead to the 1416 // ']'. 1562 // To obtain LR(1 ), the last cfa_abstract_parameter_list is added into this flattened rule to lookahead to the ']'. 1417 1563 { $$ = DeclarationNode::newTuple( $3->appendList( $7 ) ); } 1418 1564 ; … … 1421 1567 TYPEDEF cfa_variable_specifier 1422 1568 { 1423 typedefTable.addToEnclosingScope( TypedefTable::TD);1569 typedefTable.addToEnclosingScope( *$2->name, TYPEDEFname, "1" ); 1424 1570 $$ = $2->addTypedef(); 1425 1571 } 1426 1572 | TYPEDEF cfa_function_specifier 1427 1573 { 1428 typedefTable.addToEnclosingScope( TypedefTable::TD);1574 typedefTable.addToEnclosingScope( *$2->name, TYPEDEFname, "2" ); 1429 1575 $$ = $2->addTypedef(); 1430 1576 } 1431 1577 | cfa_typedef_declaration pop ',' push no_attr_identifier 1432 1578 { 1433 typedefTable.addToEnclosingScope( *$5, T ypedefTable::TD);1579 typedefTable.addToEnclosingScope( *$5, TYPEDEFname, "3" ); 1434 1580 $$ = $1->appendList( $1->cloneType( $5 ) ); 1435 1581 } … … 1442 1588 TYPEDEF type_specifier declarator 1443 1589 { 1444 typedefTable.addToEnclosingScope( TypedefTable::TD);1590 typedefTable.addToEnclosingScope( *$3->name, TYPEDEFname, "4" ); 1445 1591 $$ = $3->addType( $2 )->addTypedef(); 1446 1592 } 1447 1593 | typedef_declaration pop ',' push declarator 1448 1594 { 1449 typedefTable.addToEnclosingScope( TypedefTable::TD);1595 typedefTable.addToEnclosingScope( *$5->name, TYPEDEFname, "5" ); 1450 1596 $$ = $1->appendList( $1->cloneBaseType( $5 )->addTypedef() ); 1451 1597 } 1452 1598 | type_qualifier_list TYPEDEF type_specifier declarator // remaining OBSOLESCENT (see 2 ) 1453 1599 { 1454 typedefTable.addToEnclosingScope( TypedefTable::TD);1600 typedefTable.addToEnclosingScope( *$4->name, TYPEDEFname, "6" ); 1455 1601 $$ = $4->addType( $3 )->addQualifiers( $1 )->addTypedef(); 1456 1602 } 1457 1603 | type_specifier TYPEDEF declarator 1458 1604 { 1459 typedefTable.addToEnclosingScope( TypedefTable::TD);1605 typedefTable.addToEnclosingScope( *$3->name, TYPEDEFname, "7" ); 1460 1606 $$ = $3->addType( $1 )->addTypedef(); 1461 1607 } 1462 1608 | type_specifier TYPEDEF type_qualifier_list declarator 1463 1609 { 1464 typedefTable.addToEnclosingScope( TypedefTable::TD);1610 typedefTable.addToEnclosingScope( *$4->name, TYPEDEFname, "8" ); 1465 1611 $$ = $4->addQualifiers( $1 )->addTypedef()->addType( $1 ); 1466 1612 } … … 1471 1617 TYPEDEF no_attr_identifier '=' assignment_expression 1472 1618 { 1473 typedefTable.addToEnclosingScope( *$2, TypedefTable::TD );1474 $$ = DeclarationNode::newName( 0 ); // unimplemented1619 // $$ = DeclarationNode::newName( 0 ); // unimplemented 1620 SemanticError( yylloc, "Typedef expression is currently unimplemented." ); $$ = nullptr; 1475 1621 } 1476 1622 | typedef_expression pop ',' push no_attr_identifier '=' assignment_expression 1477 1623 { 1478 typedefTable.addToEnclosingScope( *$5, TypedefTable::TD );1479 $$ = DeclarationNode::newName( 0 ); // unimplemented1624 // $$ = DeclarationNode::newName( 0 ); // unimplemented 1625 SemanticError( yylloc, "Typedef expression is currently unimplemented." ); $$ = nullptr; 1480 1626 } 1481 1627 ; … … 1493 1639 // declarator asm_name_opt initializer_opt 1494 1640 // { 1495 // typedefTable.addToEnclosingScope( TypedefTable::ID);1641 // typedefTable.addToEnclosingScope( IDENTIFIER ); 1496 1642 // $$ = ( $2->addType( $1 ))->addAsmName( $3 )->addInitializer( $4 ); 1497 1643 // } 1498 1644 // | declaring_list ',' attribute_list_opt declarator asm_name_opt initializer_opt 1499 1645 // { 1500 // typedefTable.addToEnclosingScope( TypedefTable::ID);1646 // typedefTable.addToEnclosingScope( IDENTIFIER ); 1501 1647 // $$ = $1->appendList( $1->cloneBaseType( $4->addAsmName( $5 )->addInitializer( $6 ) ) ); 1502 1648 // } … … 1505 1651 c_declaration: 1506 1652 declaration_specifier declaring_list 1507 { 1508 $$ = distAttr( $1, $2 ); 1509 } 1653 { $$ = distAttr( $1, $2 ); } 1510 1654 | typedef_declaration 1511 1655 | typedef_expression // GCC, naming expression type … … 1517 1661 // storage-class 1518 1662 declarator asm_name_opt initializer_opt 1519 { 1520 typedefTable.addToEnclosingScope( TypedefTable::ID ); 1521 $$ = $1->addAsmName( $2 )->addInitializer( $3 ); 1522 } 1663 { $$ = $1->addAsmName( $2 )->addInitializer( $3 ); } 1523 1664 | declaring_list ',' attribute_list_opt declarator asm_name_opt initializer_opt 1524 { 1525 typedefTable.addToEnclosingScope( TypedefTable::ID ); 1526 $$ = $1->appendList( $4->addQualifiers( $3 )->addAsmName( $5 )->addInitializer( $6 ) ); 1527 } 1665 { $$ = $1->appendList( $4->addQualifiers( $3 )->addAsmName( $5 )->addInitializer( $6 ) ); } 1528 1666 ; 1529 1667 … … 1597 1735 1598 1736 forall: 1599 FORALL '(' 1600 { 1601 typedefTable.enterScope(); 1602 } 1603 type_parameter_list ')' // CFA 1604 { 1605 typedefTable.leaveScope(); 1606 $$ = DeclarationNode::newForall( $4 ); 1607 } 1737 FORALL '(' type_parameter_list ')' // CFA 1738 { $$ = DeclarationNode::newForall( $3 ); } 1608 1739 ; 1609 1740 … … 1678 1809 | LONG 1679 1810 { $$ = DeclarationNode::newLength( DeclarationNode::Long ); } 1680 | ZERO_T1681 { $$ = DeclarationNode::newBuiltinType( DeclarationNode::Zero ); }1682 | ONE_T1683 { $$ = DeclarationNode::newBuiltinType( DeclarationNode::One ); }1684 1811 | VALIST // GCC, __builtin_va_list 1685 1812 { $$ = DeclarationNode::newBuiltinType( DeclarationNode::Valist ); } … … 1701 1828 basic_type_specifier: 1702 1829 direct_type 1830 // Cannot have type modifiers, e.g., short, long, etc. 1703 1831 | type_qualifier_list_opt indirect_type type_qualifier_list_opt 1704 1832 { $$ = $2->addQualifiers( $1 )->addQualifiers( $3 ); } … … 1706 1834 1707 1835 direct_type: 1708 // A semantic check is necessary for conflicting type qualifiers.1709 1836 basic_type_name 1710 1837 | type_qualifier_list basic_type_name … … 1725 1852 | ATTR_TYPEGENname '(' comma_expression ')' // CFA: e.g., @type(a+b) y; 1726 1853 { $$ = DeclarationNode::newAttr( $1, $3 ); } 1854 | ZERO_T // CFA 1855 { $$ = DeclarationNode::newBuiltinType( DeclarationNode::Zero ); } 1856 | ONE_T // CFA 1857 { $$ = DeclarationNode::newBuiltinType( DeclarationNode::One ); } 1727 1858 ; 1728 1859 … … 1744 1875 { $$ = $3->addQualifiers( $1 ); } 1745 1876 | sue_type_specifier type_qualifier 1746 { $$ = $1->addQualifiers( $2 ); } 1877 { 1878 if ( $2->type != nullptr && $2->type->forall ) forall = true; // remember generic type 1879 $$ = $1->addQualifiers( $2 ); 1880 } 1747 1881 ; 1748 1882 … … 1787 1921 { $$ = DeclarationNode::newFromTypedef( $1 ); } 1788 1922 | '.' TYPEDEFname 1789 { $$ = DeclarationNode::new FromTypedef( $2 ); } // FIX ME1923 { $$ = DeclarationNode::newQualifiedType( DeclarationNode::newFromGlobalScope(), DeclarationNode::newFromTypedef( $2 ) ); } 1790 1924 | type_name '.' TYPEDEFname 1791 { $$ = DeclarationNode::new FromTypedef( $3 ); } // FIX ME1925 { $$ = DeclarationNode::newQualifiedType( $1, DeclarationNode::newFromTypedef( $3 ) ); } 1792 1926 | typegen_name 1793 1927 | '.' typegen_name 1794 { $$ = $2; } // FIX ME1928 { $$ = DeclarationNode::newQualifiedType( DeclarationNode::newFromGlobalScope(), $2 ); } 1795 1929 | type_name '.' typegen_name 1796 { $$ = $3; } // FIX ME1930 { $$ = DeclarationNode::newQualifiedType( $1, $3 ); } 1797 1931 ; 1798 1932 … … 1816 1950 ; 1817 1951 1952 fred: 1953 // empty 1954 { yyy = false; } 1955 ; 1956 1818 1957 aggregate_type: // struct, union 1819 aggregate_key attribute_list_opt '{' field_declaration_list '}' 1820 { $$ = DeclarationNode::newAggregate( $1, new string( DeclarationNode::anonymous.newName() ), nullptr, $4, true )->addQualifiers( $2 ); } 1821 | aggregate_key attribute_list_opt no_attr_identifier_or_type_name 1822 { 1823 typedefTable.makeTypedef( *$3 ); // create typedef 1824 if ( forall ) typedefTable.changeKind( *$3, TypedefTable::TG ); // possibly update 1958 aggregate_key attribute_list_opt 1959 { forall = false; } // reset 1960 '{' field_declaration_list_opt '}' type_parameters_opt 1961 { $$ = DeclarationNode::newAggregate( $1, nullptr, $7, $5, true )->addQualifiers( $2 ); } 1962 | aggregate_key attribute_list_opt no_attr_identifier fred 1963 { 1964 typedefTable.makeTypedef( *$3, forall || typedefTable.getEnclForall() ? TYPEGENname : TYPEDEFname ); // create typedef 1825 1965 forall = false; // reset 1826 1966 } 1827 '{' field_declaration_list '}' 1828 { $$ = DeclarationNode::newAggregate( $1, $3, nullptr, $6, true )->addQualifiers( $2 ); } 1829 | aggregate_key attribute_list_opt '(' type_list ')' '{' field_declaration_list '}' // CFA 1830 { $$ = DeclarationNode::newAggregate( $1, new string( DeclarationNode::anonymous.newName() ), $4, $7, false )->addQualifiers( $2 ); } 1967 '{' field_declaration_list_opt '}' type_parameters_opt 1968 { $$ = DeclarationNode::newAggregate( $1, $3, $9, $7, true )->addQualifiers( $2 ); } 1969 | aggregate_key attribute_list_opt type_name fred 1970 { 1971 // for type_name can be a qualified type name S.T, in which case only the last name in the chain needs a typedef (other names in the chain should already have one) 1972 typedefTable.makeTypedef( *$3->type->leafName(), forall || typedefTable.getEnclForall() ? TYPEGENname : TYPEDEFname ); // create typedef 1973 forall = false; // reset 1974 } 1975 '{' field_declaration_list_opt '}' type_parameters_opt 1976 { $$ = DeclarationNode::newAggregate( $1, $3->type->symbolic.name, $9, $7, true )->addQualifiers( $2 ); } 1831 1977 | aggregate_type_nobody 1832 1978 ; 1833 1979 1980 type_parameters_opt: 1981 // empty 1982 { $$ = nullptr; } %prec '}' 1983 | '(' type_list ')' 1984 { $$ = $2; } 1985 ; 1986 1834 1987 aggregate_type_nobody: // struct, union - {...} 1835 aggregate_key attribute_list_opt no_attr_identifier 1836 { 1837 typedefTable.makeTypedef( *$3 ); 1988 aggregate_key attribute_list_opt no_attr_identifier fred 1989 { 1990 typedefTable.makeTypedef( *$3, forall || typedefTable.getEnclForall() ? TYPEGENname : TYPEDEFname ); 1991 forall = false; // reset 1838 1992 $$ = DeclarationNode::newAggregate( $1, $3, nullptr, nullptr, false )->addQualifiers( $2 ); 1839 1993 } 1840 | aggregate_key attribute_list_opt TYPEDEFname 1841 { 1842 typedefTable.makeTypedef( *$3 ); 1843 $$ = DeclarationNode::newAggregate( $1, $3, nullptr, nullptr, false )->addQualifiers( $2 ); 1844 } 1845 | aggregate_key attribute_list_opt typegen_name // CFA 1846 { 1994 | aggregate_key attribute_list_opt type_name fred 1995 { 1996 forall = false; // reset 1847 1997 // Create new generic declaration with same name as previous forward declaration, where the IDENTIFIER is 1848 1998 // switched to a TYPEGENname. Link any generic arguments from typegen_name to new generic declaration and … … 1857 2007 aggregate_key: 1858 2008 STRUCT 1859 { $$ = DeclarationNode::Struct; }2009 { yyy = true; $$ = DeclarationNode::Struct; } 1860 2010 | UNION 1861 { $$ = DeclarationNode::Union; } 2011 { yyy = true; $$ = DeclarationNode::Union; } 2012 | EXCEPTION 2013 { yyy = true; $$ = DeclarationNode::Exception; } 1862 2014 | COROUTINE 1863 { $$ = DeclarationNode::Coroutine; }2015 { yyy = true; $$ = DeclarationNode::Coroutine; } 1864 2016 | MONITOR 1865 { $$ = DeclarationNode::Monitor; }2017 { yyy = true; $$ = DeclarationNode::Monitor; } 1866 2018 | THREAD 1867 { $$ = DeclarationNode::Thread; }1868 ; 1869 1870 field_declaration_list :2019 { yyy = true; $$ = DeclarationNode::Thread; } 2020 ; 2021 2022 field_declaration_list_opt: 1871 2023 // empty 1872 2024 { $$ = nullptr; } 1873 | field_declaration_list field_declaration2025 | field_declaration_list_opt field_declaration 1874 2026 { $$ = $1 ? $1->appendList( $2 ) : $2; } 1875 2027 ; 1876 2028 1877 2029 field_declaration: 1878 cfa_field_declaring_list ';' // CFA, new style field declaration 2030 type_specifier field_declaring_list_opt ';' 2031 { $$ = fieldDecl( $1, $2 ); } 2032 | EXTENSION type_specifier field_declaring_list_opt ';' // GCC 2033 { $$ = fieldDecl( $2, $3 ); distExt( $$ ); } 2034 | INLINE type_specifier field_abstract_list_opt ';' // CFA 2035 { 2036 if ( ! $3 ) { // field declarator ? 2037 $3 = DeclarationNode::newName( nullptr ); 2038 } // if 2039 $3->inLine = true; 2040 $$ = distAttr( $2, $3 ); // mark all fields in list 2041 distInl( $3 ); 2042 } 2043 | typedef_declaration ';' // CFA 2044 | cfa_field_declaring_list ';' // CFA, new style field declaration 1879 2045 | EXTENSION cfa_field_declaring_list ';' // GCC 1880 { 1881 distExt( $2 ); // mark all fields in list 1882 $$ = $2; 1883 } 1884 | type_specifier field_declaring_list ';' 1885 { 1886 $$ = distAttr( $1, $2 ); } 1887 | EXTENSION type_specifier field_declaring_list ';' // GCC 1888 { 1889 distExt( $3 ); // mark all fields in list 1890 $$ = distAttr( $2, $3 ); 1891 } 2046 { distExt( $2 ); $$ = $2; } // mark all fields in list 2047 | INLINE cfa_field_abstract_list ';' // CFA, new style field declaration 2048 { $$ = $2; } // mark all fields in list 2049 | cfa_typedef_declaration ';' // CFA 2050 | static_assert // C11 2051 ; 2052 2053 field_declaring_list_opt: 2054 // empty 2055 { $$ = nullptr; } 2056 | field_declarator 2057 | field_declaring_list_opt ',' attribute_list_opt field_declarator 2058 { $$ = $1->appendList( $4->addQualifiers( $3 ) ); } 2059 ; 2060 2061 field_declarator: 2062 bit_subrange_size // C special case, no field name 2063 { $$ = DeclarationNode::newBitfield( $1 ); } 2064 | variable_declarator bit_subrange_size_opt 2065 // A semantic check is required to ensure bit_subrange only appears on integral types. 2066 { $$ = $1->addBitfield( $2 ); } 2067 | variable_type_redeclarator bit_subrange_size_opt 2068 // A semantic check is required to ensure bit_subrange only appears on integral types. 2069 { $$ = $1->addBitfield( $2 ); } 2070 ; 2071 2072 field_abstract_list_opt: 2073 // empty 2074 { $$ = nullptr; } 2075 | field_abstract 2076 | field_abstract_list_opt ',' attribute_list_opt field_abstract 2077 { $$ = $1->appendList( $4->addQualifiers( $3 ) ); } 2078 ; 2079 2080 field_abstract: 2081 // no bit fields 2082 variable_abstract_declarator 1892 2083 ; 1893 2084 1894 2085 cfa_field_declaring_list: // CFA, new style field declaration 1895 cfa_abstract_declarator_tuple // CFA, no field name1896 |cfa_abstract_declarator_tuple no_attr_identifier_or_type_name2086 // bit-fields are handled by C declarations 2087 cfa_abstract_declarator_tuple no_attr_identifier_or_type_name 1897 2088 { $$ = $1->addName( $2 ); } 1898 2089 | cfa_field_declaring_list ',' no_attr_identifier_or_type_name 1899 2090 { $$ = $1->appendList( $1->cloneType( $3 ) ); } 1900 | cfa_field_declaring_list ',' // CFA, no field name 2091 ; 2092 2093 cfa_field_abstract_list: // CFA, new style field declaration 2094 // bit-fields are handled by C declarations 2095 cfa_abstract_declarator_tuple 2096 | cfa_field_abstract_list ',' 1901 2097 { $$ = $1->appendList( $1->cloneType( 0 ) ); } 1902 ;1903 1904 field_declaring_list:1905 field_declarator1906 | field_declaring_list ',' attribute_list_opt field_declarator1907 { $$ = $1->appendList( $4->addQualifiers( $3 ) ); }1908 ;1909 1910 field_declarator:1911 // empty1912 { $$ = DeclarationNode::newName( 0 ); /* XXX */ } // CFA, no field name1913 // '@'1914 // { $$ = DeclarationNode::newName( new string( DeclarationNode::anonymous.newName() ) ); } // CFA, no field name1915 | bit_subrange_size // no field name1916 { $$ = DeclarationNode::newBitfield( $1 ); }1917 | variable_declarator bit_subrange_size_opt1918 // A semantic check is required to ensure bit_subrange only appears on base type int.1919 { $$ = $1->addBitfield( $2 ); }1920 | variable_type_redeclarator bit_subrange_size_opt1921 // A semantic check is required to ensure bit_subrange only appears on base type int.1922 { $$ = $1->addBitfield( $2 ); }1923 | variable_abstract_declarator // CFA, no field name1924 2098 ; 1925 2099 … … 1928 2102 { $$ = nullptr; } 1929 2103 | bit_subrange_size 1930 { $$ = $1; }1931 2104 ; 1932 2105 … … 1938 2111 enum_type: // enum 1939 2112 ENUM attribute_list_opt '{' enumerator_list comma_opt '}' 1940 { $$ = DeclarationNode::newEnum( n ew string( DeclarationNode::anonymous.newName() ), $4, true )->addQualifiers( $2 ); }1941 | ENUM attribute_list_opt no_attr_identifier _or_type_name2113 { $$ = DeclarationNode::newEnum( nullptr, $4, true )->addQualifiers( $2 ); } 2114 | ENUM attribute_list_opt no_attr_identifier 1942 2115 { typedefTable.makeTypedef( *$3 ); } 1943 2116 '{' enumerator_list comma_opt '}' 1944 2117 { $$ = DeclarationNode::newEnum( $3, $6, true )->addQualifiers( $2 ); } 2118 | ENUM attribute_list_opt type_name 2119 '{' enumerator_list comma_opt '}' 2120 { $$ = DeclarationNode::newEnum( $3->type->symbolic.name, $5, true )->addQualifiers( $2 ); } 1945 2121 | enum_type_nobody 1946 2122 ; 1947 2123 1948 2124 enum_type_nobody: // enum - {...} 1949 ENUM attribute_list_opt no_attr_identifier _or_type_name2125 ENUM attribute_list_opt no_attr_identifier 1950 2126 { 1951 2127 typedefTable.makeTypedef( *$3 ); 1952 2128 $$ = DeclarationNode::newEnum( $3, 0, false )->addQualifiers( $2 ); 2129 } 2130 | ENUM attribute_list_opt type_name 2131 { 2132 typedefTable.makeTypedef( *$3->type->symbolic.name ); 2133 $$ = DeclarationNode::newEnum( $3->type->symbolic.name, 0, false )->addQualifiers( $2 ); 1953 2134 } 1954 2135 ; … … 1968 2149 ; 1969 2150 1970 // Minimum of one parameter after which ellipsis is allowed only at the end. 1971 1972 cfa_parameter_type_list_opt: // CFA 2151 cfa_parameter_ellipsis_list_opt: // CFA, abstract + real 1973 2152 // empty 2153 { $$ = DeclarationNode::newBasicType( DeclarationNode::Void ); } 2154 | ELLIPSIS 1974 2155 { $$ = nullptr; } 1975 | cfa_parameter_type_list 1976 ; 1977 1978 cfa_parameter_type_list: // CFA, abstract + real 1979 cfa_abstract_parameter_list 2156 | cfa_abstract_parameter_list 1980 2157 | cfa_parameter_list 1981 2158 | cfa_parameter_list pop ',' push cfa_abstract_parameter_list … … 2008 2185 // empty 2009 2186 { $$ = nullptr; } 2010 | parameter_type_list 2011 ; 2012 2013 parameter_type_list: 2014 parameter_list 2187 | ELLIPSIS 2188 { $$ = nullptr; } 2189 | parameter_list 2015 2190 | parameter_list pop ',' push ELLIPSIS 2016 2191 { $$ = $1->addVarArgs(); } … … 2054 2229 // No SUE declaration in parameter list. 2055 2230 declaration_specifier_nobody identifier_parameter_declarator default_initialize_opt 2056 { 2057 typedefTable.addToEnclosingScope( TypedefTable::ID ); 2058 $$ = $2->addType( $1 )->addInitializer( $3 ? new InitializerNode( $3 ) : nullptr ); 2059 } 2231 { $$ = $2->addType( $1 )->addInitializer( $3 ? new InitializerNode( $3 ) : nullptr ); } 2060 2232 | declaration_specifier_nobody type_parameter_redeclarator default_initialize_opt 2061 { 2062 typedefTable.addToEnclosingScope( TypedefTable::ID ); 2063 $$ = $2->addType( $1 )->addInitializer( $3 ? new InitializerNode( $3 ) : nullptr ); 2064 } 2233 { $$ = $2->addType( $1 )->addInitializer( $3 ? new InitializerNode( $3 ) : nullptr ); } 2065 2234 ; 2066 2235 … … 2113 2282 { $$ = $2; } 2114 2283 | '=' VOID 2115 { $$ = n ullptr; }2284 { $$ = new InitializerNode( true ); } 2116 2285 | ATassign initializer 2117 2286 { $$ = $2->set_maybeConstructed( false ); } … … 2120 2289 initializer: 2121 2290 assignment_expression { $$ = new InitializerNode( $1 ); } 2122 | '{' initializer_list comma_opt '}'{ $$ = new InitializerNode( $2, true ); }2123 ; 2124 2125 initializer_list :2291 | '{' initializer_list_opt comma_opt '}' { $$ = new InitializerNode( $2, true ); } 2292 ; 2293 2294 initializer_list_opt: 2126 2295 // empty 2127 2296 { $$ = nullptr; } 2128 2297 | initializer 2129 2298 | designation initializer { $$ = $2->set_designators( $1 ); } 2130 | initializer_list ',' initializer{ $$ = (InitializerNode *)( $1->set_last( $3 ) ); }2131 | initializer_list ',' designation initializer2299 | initializer_list_opt ',' initializer { $$ = (InitializerNode *)( $1->set_last( $3 ) ); } 2300 | initializer_list_opt ',' designation initializer 2132 2301 { $$ = (InitializerNode *)( $1->set_last( $4->set_designators( $3 ) ) ); } 2133 2302 ; … … 2166 2335 | '[' push constant_expression ELLIPSIS constant_expression pop ']' // GCC, multiple array elements 2167 2336 { $$ = new ExpressionNode( new RangeExpr( maybeMoveBuild< Expression >( $3 ), maybeMoveBuild< Expression >( $5 ) ) ); } 2168 | '.' '[' push field_ list pop ']'// CFA, tuple field selector2337 | '.' '[' push field_name_list pop ']' // CFA, tuple field selector 2169 2338 { $$ = $4; } 2170 2339 ; … … 2190 2359 type_parameter_list: // CFA 2191 2360 type_parameter 2192 { $$ = $1; }2193 2361 | type_parameter_list ',' type_parameter 2194 2362 { $$ = $1->appendList( $3 ); } … … 2204 2372 type_parameter: // CFA 2205 2373 type_class no_attr_identifier_or_type_name 2206 { typedefTable.addTo EnclosingScope( *$2, TypedefTable::TD); }2374 { typedefTable.addToScope( *$2, TYPEDEFname, "9" ); } 2207 2375 type_initializer_opt assertion_list_opt 2208 2376 { $$ = DeclarationNode::newTypeParam( $1, $2 )->addTypeInitializer( $4 )->addAssertions( $5 ); } 2209 2377 | type_specifier identifier_parameter_declarator 2378 | assertion_list 2379 { $$ = DeclarationNode::newTypeParam( DeclarationNode::Dtype, new string( DeclarationNode::anonymous.newName() ) )->addAssertions( $1 ); } 2210 2380 ; 2211 2381 … … 2224 2394 // empty 2225 2395 { $$ = nullptr; } 2226 | assertion_list_opt assertion 2396 | assertion_list 2397 ; 2398 2399 assertion_list: // CFA 2400 assertion 2401 | assertion_list assertion 2227 2402 { $$ = $1 ? $1->appendList( $2 ) : $2; } 2228 2403 ; … … 2230 2405 assertion: // CFA 2231 2406 '|' no_attr_identifier_or_type_name '(' type_list ')' 2232 { 2233 typedefTable.openTrait( *$2 ); 2234 $$ = DeclarationNode::newTraitUse( $2, $4 ); 2235 } 2236 | '|' '{' push trait_declaration_list '}' 2407 { $$ = DeclarationNode::newTraitUse( $2, $4 ); } 2408 | '|' '{' push trait_declaration_list pop '}' 2237 2409 { $$ = $4; } 2238 | '|' '(' push type_parameter_list pop ')' '{' push trait_declaration_list'}' '(' type_list ')'2239 {$$ = nullptr; }2410 // | '|' '(' push type_parameter_list pop ')' '{' push trait_declaration_list pop '}' '(' type_list ')' 2411 // { SemanticError( yylloc, "Generic data-type assertion is currently unimplemented." ); $$ = nullptr; } 2240 2412 ; 2241 2413 … … 2244 2416 { $$ = new ExpressionNode( new TypeExpr( maybeMoveBuildType( $1 ) ) ); } 2245 2417 | assignment_expression 2418 { SemanticError( yylloc, toString("Expression generic parameters are currently unimplemented: ", $1->build()) ); $$ = nullptr; } 2246 2419 | type_list ',' type 2247 2420 { $$ = (ExpressionNode *)( $1->set_last( new ExpressionNode( new TypeExpr( maybeMoveBuildType( $3 ) ) ) ) ); } 2248 2421 | type_list ',' assignment_expression 2249 { $$ = (ExpressionNode *)( $1->set_last( $3 )); } 2422 { SemanticError( yylloc, toString("Expression generic parameters are currently unimplemented: ", $3->build()) ); $$ = nullptr; } 2423 // { $$ = (ExpressionNode *)( $1->set_last( $3 )); } 2250 2424 ; 2251 2425 … … 2269 2443 no_attr_identifier_or_type_name 2270 2444 { 2271 typedefTable.addToEnclosingScope( *$1, T ypedefTable::TD);2445 typedefTable.addToEnclosingScope( *$1, TYPEDEFname, "10" ); 2272 2446 $$ = DeclarationNode::newTypeDecl( $1, 0 ); 2273 2447 } 2274 | no_attr_identifier_or_type_name '(' push type_parameter_list pop')'2275 { 2276 typedefTable.addToEnclosingScope( *$1, T ypedefTable::TG);2277 $$ = DeclarationNode::newTypeDecl( $1, $ 4);2448 | no_attr_identifier_or_type_name '(' type_parameter_list ')' 2449 { 2450 typedefTable.addToEnclosingScope( *$1, TYPEGENname, "11" ); 2451 $$ = DeclarationNode::newTypeDecl( $1, $3 ); 2278 2452 } 2279 2453 ; 2280 2454 2281 2455 trait_specifier: // CFA 2282 TRAIT no_attr_identifier_or_type_name '(' push type_parameter_list pop ')' '{' '}' 2283 { 2284 typedefTable.addToEnclosingScope( *$2, TypedefTable::ID ); 2285 $$ = DeclarationNode::newTrait( $2, $5, 0 ); 2286 } 2287 | TRAIT no_attr_identifier_or_type_name '(' push type_parameter_list pop ')' '{' 2288 { 2289 typedefTable.enterTrait( *$2 ); 2290 typedefTable.enterScope(); 2291 } 2292 trait_declaration_list '}' 2293 { 2294 typedefTable.leaveTrait(); 2295 typedefTable.addToEnclosingScope( *$2, TypedefTable::ID ); 2296 $$ = DeclarationNode::newTrait( $2, $5, $10 ); 2297 } 2456 TRAIT no_attr_identifier_or_type_name '(' type_parameter_list ')' '{' '}' 2457 { $$ = DeclarationNode::newTrait( $2, $4, 0 ); } 2458 | TRAIT no_attr_identifier_or_type_name '(' type_parameter_list ')' '{' push trait_declaration_list pop '}' 2459 { $$ = DeclarationNode::newTrait( $2, $4, $8 ); } 2298 2460 ; 2299 2461 2300 2462 trait_declaration_list: // CFA 2301 2463 trait_declaration 2302 | trait_declaration_list p ush trait_declaration2303 { $$ = $1->appendList( $ 3); }2464 | trait_declaration_list pop push trait_declaration 2465 { $$ = $1->appendList( $4 ); } 2304 2466 ; 2305 2467 2306 2468 trait_declaration: // CFA 2307 cfa_trait_declaring_list pop';'2308 | trait_declaring_list pop';'2469 cfa_trait_declaring_list ';' 2470 | trait_declaring_list ';' 2309 2471 ; 2310 2472 2311 2473 cfa_trait_declaring_list: // CFA 2312 2474 cfa_variable_specifier 2313 {2314 typedefTable.addToEnclosingScope2( TypedefTable::ID );2315 $$ = $1;2316 }2317 2475 | cfa_function_specifier 2318 {2319 typedefTable.addToEnclosingScope2( TypedefTable::ID );2320 $$ = $1;2321 }2322 2476 | cfa_trait_declaring_list pop ',' push identifier_or_type_name 2323 { 2324 typedefTable.addToEnclosingScope2( *$5, TypedefTable::ID ); 2325 $$ = $1->appendList( $1->cloneType( $5 ) ); 2326 } 2477 { $$ = $1->appendList( $1->cloneType( $5 ) ); } 2327 2478 ; 2328 2479 2329 2480 trait_declaring_list: // CFA 2330 2481 type_specifier declarator 2331 { 2332 typedefTable.addToEnclosingScope2( TypedefTable::ID ); 2333 $$ = $2->addType( $1 ); 2334 } 2482 { $$ = $2->addType( $1 ); } 2335 2483 | trait_declaring_list pop ',' push declarator 2336 { 2337 typedefTable.addToEnclosingScope2( TypedefTable::ID ); 2338 $$ = $1->appendList( $1->cloneBaseType( $5 ) ); 2339 } 2484 { $$ = $1->appendList( $1->cloneBaseType( $5 ) ); } 2340 2485 ; 2341 2486 … … 2343 2488 2344 2489 translation_unit: 2345 // empty 2346 {} // empty input file 2490 // empty, input file 2347 2491 | external_definition_list 2348 2492 { parseTree = parseTree ? parseTree->appendList( $1 ) : $1; } … … 2350 2494 2351 2495 external_definition_list: 2352 external_definition 2353 | external_definition_list push external_definition 2496 push external_definition pop 2497 { $$ = $2; } 2498 | external_definition_list push external_definition pop 2354 2499 { $$ = $1 ? $1->appendList( $3 ) : $3; } 2355 2500 ; … … 2361 2506 ; 2362 2507 2508 up: 2509 { typedefTable.up( forall ); forall = false; } 2510 ; 2511 2512 down: 2513 { typedefTable.down(); } 2514 ; 2515 2363 2516 external_definition: 2364 2517 declaration 2365 2518 | external_function_definition 2519 | EXTENSION external_definition // GCC, multiple __extension__ allowed, meaning unknown 2520 { 2521 distExt( $2 ); // mark all fields in list 2522 $$ = $2; 2523 } 2366 2524 | ASM '(' string_literal ')' ';' // GCC, global assembler statement 2367 2525 { 2368 $$ = DeclarationNode::newAsmStmt( new StatementNode( build_asm stmt( false, $3, 0 ) ) );2526 $$ = DeclarationNode::newAsmStmt( new StatementNode( build_asm( false, $3, 0 ) ) ); 2369 2527 } 2370 2528 | EXTERN STRINGliteral // C++-style linkage specifier 2371 2529 { 2372 2530 linkageStack.push( linkage ); // handle nested extern "C"/"Cforall" 2373 linkage = LinkageSpec::linkageUpdate( linkage, $2 );2374 } 2375 '{' external_definition_list_opt'}'2531 linkage = LinkageSpec::linkageUpdate( yylloc, linkage, $2 ); 2532 } 2533 '{' up external_definition_list_opt down '}' 2376 2534 { 2377 2535 linkage = linkageStack.top(); 2378 2536 linkageStack.pop(); 2537 $$ = $6; 2538 } 2539 | type_qualifier_list 2540 { 2541 if ( $1->type->qualifiers.val ) { SemanticError( yylloc, "CV qualifiers cannot be distributed; only storage-class and forall qualifiers." ); } 2542 if ( $1->type->forall ) forall = true; // remember generic type 2543 } 2544 '{' up external_definition_list_opt down '}' // CFA, namespace 2545 { 2546 distQual( $5, $1 ); 2547 forall = false; 2379 2548 $$ = $5; 2380 2549 } 2381 | EXTENSION external_definition // GCC, multiple __extension__ allowed, meaning unknown 2382 { 2383 distExt( $2 ); // mark all fields in list 2384 $$ = $2; 2385 } 2386 | forall '{' external_definition_list '}' // CFA, namespace 2550 | declaration_qualifier_list 2551 { 2552 if ( $1->type && $1->type->qualifiers.val ) { SemanticError( yylloc, "CV qualifiers cannot be distributed; only storage-class and forall qualifiers." ); } 2553 if ( $1->type && $1->type->forall ) forall = true; // remember generic type 2554 } 2555 '{' up external_definition_list_opt down '}' // CFA, namespace 2556 { 2557 distQual( $5, $1 ); 2558 forall = false; 2559 $$ = $5; 2560 } 2561 | declaration_qualifier_list type_qualifier_list 2562 { 2563 if ( ($1->type && $1->type->qualifiers.val) || $2->type->qualifiers.val ) { SemanticError( yylloc, "CV qualifiers cannot be distributed; only storage-class and forall qualifiers." ); } 2564 if ( ($1->type && $1->type->forall) || $2->type->forall ) forall = true; // remember generic type 2565 } 2566 '{' up external_definition_list_opt down '}' // CFA, namespace 2567 { 2568 distQual( $6, $1->addQualifiers( $2 ) ); 2569 forall = false; 2570 $$ = $6; 2571 } 2387 2572 ; 2388 2573 … … 2395 2580 // declaration must still have a type_specifier. OBSOLESCENT (see 1) 2396 2581 | function_declarator compound_statement 2397 { 2398 typedefTable.addToEnclosingScope( TypedefTable::ID ); 2399 typedefTable.leaveScope(); 2400 $$ = $1->addFunctionBody( $2 ); 2401 } 2402 | KR_function_declarator KR_declaration_list_opt compound_statement 2403 { 2404 typedefTable.addToEnclosingScope( TypedefTable::ID ); 2405 typedefTable.leaveScope(); 2406 $$ = $1->addOldDeclList( $2 )->addFunctionBody( $3 ); 2407 } 2582 { $$ = $1->addFunctionBody( $2 ); } 2583 | KR_function_declarator KR_parameter_list_opt compound_statement 2584 { $$ = $1->addOldDeclList( $2 )->addFunctionBody( $3 ); } 2408 2585 ; 2409 2586 2410 2587 with_clause_opt: 2411 2588 // empty 2412 { $$ = nullptr; }2589 { $$ = nullptr; forall = false; } 2413 2590 | WITH '(' tuple_expression_list ')' 2414 { $$ = new StatementNode( build_with( $3, nullptr ) ); }2591 { $$ = $3; forall = false; } 2415 2592 ; 2416 2593 … … 2418 2595 cfa_function_declaration with_clause_opt compound_statement // CFA 2419 2596 { 2420 typedefTable.addToEnclosingScope( TypedefTable::ID );2421 typedefTable.leaveScope();2422 2597 // Add the function body to the last identifier in the function definition list, i.e., foo3: 2423 2598 // [const double] foo1(), foo2( int ), foo3( double ) { return 3.0; } … … 2428 2603 { 2429 2604 rebindForall( $1, $2 ); 2430 typedefTable.addToEnclosingScope( TypedefTable::ID ); 2431 typedefTable.leaveScope(); 2605 $$ = $2->addFunctionBody( $4, $3 )->addType( $1 ); 2606 } 2607 | declaration_specifier variable_type_redeclarator with_clause_opt compound_statement 2608 { 2609 rebindForall( $1, $2 ); 2432 2610 $$ = $2->addFunctionBody( $4, $3 )->addType( $1 ); 2433 2611 } 2434 2612 // handles default int return type, OBSOLESCENT (see 1) 2435 2613 | type_qualifier_list function_declarator with_clause_opt compound_statement 2436 { 2437 typedefTable.addToEnclosingScope( TypedefTable::ID ); 2438 typedefTable.leaveScope(); 2439 $$ = $2->addFunctionBody( $4, $3 )->addQualifiers( $1 ); 2440 } 2614 { $$ = $2->addFunctionBody( $4, $3 )->addQualifiers( $1 ); } 2441 2615 // handles default int return type, OBSOLESCENT (see 1) 2442 2616 | declaration_qualifier_list function_declarator with_clause_opt compound_statement 2443 { 2444 typedefTable.addToEnclosingScope( TypedefTable::ID ); 2445 typedefTable.leaveScope(); 2446 $$ = $2->addFunctionBody( $4, $3 )->addQualifiers( $1 ); 2447 } 2617 { $$ = $2->addFunctionBody( $4, $3 )->addQualifiers( $1 ); } 2448 2618 // handles default int return type, OBSOLESCENT (see 1) 2449 2619 | declaration_qualifier_list type_qualifier_list function_declarator with_clause_opt compound_statement 2450 { 2451 typedefTable.addToEnclosingScope( TypedefTable::ID ); 2452 typedefTable.leaveScope(); 2453 $$ = $3->addFunctionBody( $5, $4 )->addQualifiers( $2 )->addQualifiers( $1 ); 2454 } 2620 { $$ = $3->addFunctionBody( $5, $4 )->addQualifiers( $2 )->addQualifiers( $1 ); } 2455 2621 2456 2622 // Old-style K&R function definition, OBSOLESCENT (see 4) 2457 | declaration_specifier KR_function_declarator KR_ declaration_list_opt with_clause_opt compound_statement2623 | declaration_specifier KR_function_declarator KR_parameter_list_opt with_clause_opt compound_statement 2458 2624 { 2459 2625 rebindForall( $1, $2 ); 2460 typedefTable.addToEnclosingScope( TypedefTable::ID );2461 typedefTable.leaveScope();2462 2626 $$ = $2->addOldDeclList( $3 )->addFunctionBody( $5, $4 )->addType( $1 ); 2463 2627 } 2464 2628 // handles default int return type, OBSOLESCENT (see 1) 2465 | type_qualifier_list KR_function_declarator KR_declaration_list_opt with_clause_opt compound_statement 2466 { 2467 typedefTable.addToEnclosingScope( TypedefTable::ID ); 2468 typedefTable.leaveScope(); 2469 $$ = $2->addOldDeclList( $3 )->addFunctionBody( $5, $4 )->addQualifiers( $1 ); 2470 } 2629 | type_qualifier_list KR_function_declarator KR_parameter_list_opt with_clause_opt compound_statement 2630 { $$ = $2->addOldDeclList( $3 )->addFunctionBody( $5, $4 )->addQualifiers( $1 ); } 2471 2631 // handles default int return type, OBSOLESCENT (see 1) 2472 | declaration_qualifier_list KR_function_declarator KR_declaration_list_opt with_clause_opt compound_statement 2473 { 2474 typedefTable.addToEnclosingScope( TypedefTable::ID ); 2475 typedefTable.leaveScope(); 2476 $$ = $2->addOldDeclList( $3 )->addFunctionBody( $5, $4 )->addQualifiers( $1 ); 2477 } 2632 | declaration_qualifier_list KR_function_declarator KR_parameter_list_opt with_clause_opt compound_statement 2633 { $$ = $2->addOldDeclList( $3 )->addFunctionBody( $5, $4 )->addQualifiers( $1 ); } 2478 2634 // handles default int return type, OBSOLESCENT (see 1) 2479 | declaration_qualifier_list type_qualifier_list KR_function_declarator KR_declaration_list_opt with_clause_opt compound_statement 2480 { 2481 typedefTable.addToEnclosingScope( TypedefTable::ID ); 2482 typedefTable.leaveScope(); 2483 $$ = $3->addOldDeclList( $4 )->addFunctionBody( $6, $5 )->addQualifiers( $2 )->addQualifiers( $1 ); 2484 } 2635 | declaration_qualifier_list type_qualifier_list KR_function_declarator KR_parameter_list_opt with_clause_opt compound_statement 2636 { $$ = $3->addOldDeclList( $4 )->addFunctionBody( $6, $5 )->addQualifiers( $2 )->addQualifiers( $1 ); } 2485 2637 ; 2486 2638 … … 2592 2744 paren_identifier: 2593 2745 identifier 2594 { 2595 typedefTable.setNextIdentifier( *$1 ); 2596 $$ = DeclarationNode::newName( $1 ); 2597 } 2746 { $$ = DeclarationNode::newName( $1 ); } 2598 2747 | '(' paren_identifier ')' // redundant parenthesis 2599 2748 { $$ = $2; } … … 2728 2877 paren_type: 2729 2878 typedef 2879 // hide type name in enclosing scope by variable name 2880 { 2881 // if ( ! typedefTable.existsCurr( *$1->name ) ) { 2882 typedefTable.addToEnclosingScope( *$1->name, IDENTIFIER, "ID" ); 2883 // } else { 2884 // SemanticError( yylloc, string("'") + *$1->name + "' redeclared as different kind of symbol." ); $$ = nullptr; 2885 // } // if 2886 } 2730 2887 | '(' paren_type ')' 2731 2888 { $$ = $2; } … … 2738 2895 { $$ = $3->addPointer( DeclarationNode::newPointer( $2, $1 ) ); } 2739 2896 | '(' type_ptr ')' attribute_list_opt 2740 { $$ = $2->addQualifiers( $4 ); } 2897 { $$ = $2->addQualifiers( $4 ); } // redundant parenthesis 2741 2898 ; 2742 2899 … … 2830 2987 typedef: 2831 2988 TYPEDEFname 2832 { 2833 typedefTable.setNextIdentifier( *$1 ); 2834 $$ = DeclarationNode::newName( $1 ); 2835 } 2989 { $$ = DeclarationNode::newName( $1 ); } 2836 2990 | TYPEGENname 2837 { 2838 typedefTable.setNextIdentifier( *$1 ); 2839 $$ = DeclarationNode::newName( $1 ); 2840 } 2991 { $$ = DeclarationNode::newName( $1 ); } 2841 2992 ; 2842 2993 … … 3023 3174 '[' ']' 3024 3175 { $$ = DeclarationNode::newArray( 0, 0, false ); } 3025 // multi_array_dimension handles the '[' '*' ']' case3176 // multi_array_dimension handles the '[' '*' ']' case 3026 3177 | '[' push type_qualifier_list '*' pop ']' // remaining C99 3027 3178 { $$ = DeclarationNode::newVarArray( $3 ); } 3028 3179 | '[' push type_qualifier_list pop ']' 3029 3180 { $$ = DeclarationNode::newArray( 0, $3, false ); } 3030 // multi_array_dimension handles the '[' assignment_expression ']' case3181 // multi_array_dimension handles the '[' assignment_expression ']' case 3031 3182 | '[' push type_qualifier_list assignment_expression pop ']' 3032 3183 { $$ = DeclarationNode::newArray( $4, $3, false ); } … … 3164 3315 // 3165 3316 // cfa_abstract_tuple identifier_or_type_name 3166 // '[' cfa_parameter_list ']' identifier_or_type_name '(' cfa_parameter_ type_list_opt ')'3317 // '[' cfa_parameter_list ']' identifier_or_type_name '(' cfa_parameter_ellipsis_list_opt ')' 3167 3318 // 3168 3319 // since a function return type can be syntactically identical to a tuple type: … … 3223 3374 '[' push cfa_abstract_parameter_list pop ']' 3224 3375 { $$ = DeclarationNode::newTuple( $3 ); } 3376 | '[' push type_specifier_nobody ELLIPSIS pop ']' 3377 { SemanticError( yylloc, "Tuple array currently unimplemented." ); $$ = nullptr; } 3378 | '[' push type_specifier_nobody ELLIPSIS constant_expression pop ']' 3379 { SemanticError( yylloc, "Tuple array currently unimplemented." ); $$ = nullptr; } 3225 3380 ; 3226 3381 3227 3382 cfa_abstract_function: // CFA 3228 // '[' ']' '(' cfa_parameter_ type_list_opt ')'3383 // '[' ']' '(' cfa_parameter_ellipsis_list_opt ')' 3229 3384 // { $$ = DeclarationNode::newFunction( nullptr, DeclarationNode::newTuple( nullptr ), $4, nullptr ); } 3230 cfa_abstract_tuple '(' push cfa_parameter_ type_list_opt pop ')'3385 cfa_abstract_tuple '(' push cfa_parameter_ellipsis_list_opt pop ')' 3231 3386 { $$ = DeclarationNode::newFunction( nullptr, $1, $4, nullptr ); } 3232 | cfa_function_return '(' push cfa_parameter_ type_list_opt pop ')'3387 | cfa_function_return '(' push cfa_parameter_ellipsis_list_opt pop ')' 3233 3388 { $$ = DeclarationNode::newFunction( nullptr, $1, $4, nullptr ); } 3234 3389 ; … … 3261 3416 3262 3417 %% 3418 3263 3419 // ----end of grammar---- 3264 3420 -
src/ResolvExpr/AdjustExprType.cc
rf9feab8 r90152a4 24 24 class AdjustExprType : public WithShortCircuiting { 25 25 public: 26 AdjustExprType( const TypeEnvironment & env, const SymTab::Indexer &indexer );26 AdjustExprType( const TypeEnvironment & env, const SymTab::Indexer & indexer ); 27 27 void premutate( VoidType * ) { visit_children = false; } 28 28 void premutate( BasicType * ) { visit_children = false; } … … 45 45 46 46 private: 47 const TypeEnvironment & env;48 const SymTab::Indexer & indexer;47 const TypeEnvironment & env; 48 const SymTab::Indexer & indexer; 49 49 }; 50 50 … … 55 55 } 56 56 57 void adjustExprType( Type *& type ) { 58 TypeEnvironment env; 59 SymTab::Indexer indexer; 60 adjustExprType( type, env, indexer ); 61 } 62 57 63 AdjustExprType::AdjustExprType( const TypeEnvironment &env, const SymTab::Indexer &indexer ) 58 64 : env( env ), indexer( indexer ) { … … 60 66 61 67 Type * AdjustExprType::postmutate( ArrayType * arrayType ) { 62 PointerType *pointerType = new PointerType ( arrayType->get_qualifiers(), arrayType->base );68 PointerType *pointerType = new PointerType{ arrayType->get_qualifiers(), arrayType->base }; 63 69 arrayType->base = nullptr; 64 70 delete arrayType; … … 67 73 68 74 Type * AdjustExprType::postmutate( FunctionType * functionType ) { 69 return new PointerType ( Type::Qualifiers(), functionType );75 return new PointerType{ Type::Qualifiers(), functionType }; 70 76 } 71 77 72 78 Type * AdjustExprType::postmutate( TypeInstType * typeInst ) { 73 EqvClass eqvClass; 74 if ( env.lookup( typeInst->get_name(), eqvClass ) ) { 75 if ( eqvClass.data.kind == TypeDecl::Ftype ) { 76 PointerType *pointerType = new PointerType( Type::Qualifiers(), typeInst ); 77 return pointerType; 79 if ( const EqvClass* eqvClass = env.lookup( typeInst->get_name() ) ) { 80 if ( eqvClass->data.kind == TypeDecl::Ftype ) { 81 return new PointerType{ Type::Qualifiers(), typeInst }; 78 82 } 79 83 } else if ( NamedTypeDecl *ntDecl = indexer.lookupType( typeInst->get_name() ) ) { 80 84 if ( TypeDecl *tyDecl = dynamic_cast< TypeDecl* >( ntDecl ) ) { 81 85 if ( tyDecl->get_kind() == TypeDecl::Ftype ) { 82 PointerType *pointerType = new PointerType( Type::Qualifiers(), typeInst ); 83 return pointerType; 86 return new PointerType{ Type::Qualifiers(), typeInst }; 84 87 } // if 85 88 } // if -
src/ResolvExpr/Alternative.cc
rf9feab8 r90152a4 27 27 28 28 namespace ResolvExpr { 29 Alternative::Alternative() : cost( Cost::zero ), cvtCost( Cost::zero ), expr( 0) {}29 Alternative::Alternative() : cost( Cost::zero ), cvtCost( Cost::zero ), expr( nullptr ) {} 30 30 31 31 Alternative::Alternative( Expression *expr, const TypeEnvironment &env, const Cost& cost ) … … 48 48 } 49 49 50 Alternative::Alternative( Alternative && other ) : cost( other.cost ), cvtCost( other.cvtCost ), expr( other.expr ), env( other.env) {50 Alternative::Alternative( Alternative && other ) : cost( other.cost ), cvtCost( other.cvtCost ), expr( other.expr ), env( std::move( other.env ) ) { 51 51 other.expr = nullptr; 52 52 } … … 58 58 cvtCost = other.cvtCost; 59 59 expr = other.expr; 60 env = other.env;60 env = std::move( other.env ); 61 61 other.expr = nullptr; 62 62 return *this; -
src/ResolvExpr/Alternative.h
rf9feab8 r90152a4 57 57 /// Moves all elements from src to the beginning of dst 58 58 void spliceBegin( AltList& dst, AltList& src ); 59 60 static inline std::ostream & operator<<(std::ostream & os, const ResolvExpr::Alternative & alt) { 61 alt.print( os ); 62 return os; 63 } 59 64 } // namespace ResolvExpr 60 65 -
src/ResolvExpr/AlternativeFinder.cc
rf9feab8 r90152a4 10 10 // Created On : Sat May 16 23:52:08 2015 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Mon Aug 28 13:47:24 201713 // Update Count : 3 212 // Last Modified On : Sat Feb 17 11:19:39 2018 13 // Update Count : 33 14 14 // 15 15 … … 25 25 #include <vector> // for vector 26 26 27 #include "CompilationState.h" // for resolvep 27 28 #include "Alternative.h" // for AltList, Alternative 28 29 #include "AlternativeFinder.h" … … 49 50 #include "typeops.h" // for adjustExprType, polyCost, castCost 50 51 51 extern bool resolvep;52 52 #define PRINT( text ) if ( resolvep ) { text } 53 53 //#define DEBUG_COST … … 60 60 61 61 namespace ResolvExpr { 62 Expression *resolveInVoidContext( Expression *expr, const SymTab::Indexer &indexer, TypeEnvironment &env ) { 63 CastExpr *castToVoid = new CastExpr( expr ); 64 65 AlternativeFinder finder( indexer, env ); 66 finder.findWithAdjustment( castToVoid ); 67 68 // it's a property of the language that a cast expression has either 1 or 0 interpretations; if it has 0 69 // interpretations, an exception has already been thrown. 70 assert( finder.get_alternatives().size() == 1 ); 71 CastExpr *newExpr = dynamic_cast< CastExpr* >( finder.get_alternatives().front().expr ); 72 assert( newExpr ); 73 env = finder.get_alternatives().front().env; 74 return newExpr->get_arg()->clone(); 75 } 62 struct AlternativeFinder::Finder : public WithShortCircuiting { 63 Finder( AlternativeFinder & altFinder ) : altFinder( altFinder ), indexer( altFinder.indexer ), alternatives( altFinder.alternatives ), env( altFinder.env ), targetType( altFinder.targetType ) {} 64 65 void previsit( BaseSyntaxNode * ) { visit_children = false; } 66 67 void postvisit( ApplicationExpr * applicationExpr ); 68 void postvisit( UntypedExpr * untypedExpr ); 69 void postvisit( AddressExpr * addressExpr ); 70 void postvisit( LabelAddressExpr * labelExpr ); 71 void postvisit( CastExpr * castExpr ); 72 void postvisit( VirtualCastExpr * castExpr ); 73 void postvisit( UntypedMemberExpr * memberExpr ); 74 void postvisit( MemberExpr * memberExpr ); 75 void postvisit( NameExpr * variableExpr ); 76 void postvisit( VariableExpr * variableExpr ); 77 void postvisit( ConstantExpr * constantExpr ); 78 void postvisit( SizeofExpr * sizeofExpr ); 79 void postvisit( AlignofExpr * alignofExpr ); 80 void postvisit( UntypedOffsetofExpr * offsetofExpr ); 81 void postvisit( OffsetofExpr * offsetofExpr ); 82 void postvisit( OffsetPackExpr * offsetPackExpr ); 83 void postvisit( AttrExpr * attrExpr ); 84 void postvisit( LogicalExpr * logicalExpr ); 85 void postvisit( ConditionalExpr * conditionalExpr ); 86 void postvisit( CommaExpr * commaExpr ); 87 void postvisit( ImplicitCopyCtorExpr * impCpCtorExpr ); 88 void postvisit( ConstructorExpr * ctorExpr ); 89 void postvisit( RangeExpr * rangeExpr ); 90 void postvisit( UntypedTupleExpr * tupleExpr ); 91 void postvisit( TupleExpr * tupleExpr ); 92 void postvisit( TupleIndexExpr * tupleExpr ); 93 void postvisit( TupleAssignExpr * tupleExpr ); 94 void postvisit( UniqueExpr * unqExpr ); 95 void postvisit( StmtExpr * stmtExpr ); 96 void postvisit( UntypedInitExpr * initExpr ); 97 void postvisit( InitExpr * initExpr ); 98 void postvisit( DeletedExpr * delExpr ); 99 void postvisit( GenericExpr * genExpr ); 100 101 /// Adds alternatives for anonymous members 102 void addAnonConversions( const Alternative & alt ); 103 /// Adds alternatives for member expressions, given the aggregate, conversion cost for that aggregate, and name of the member 104 template< typename StructOrUnionType > void addAggMembers( StructOrUnionType *aggInst, Expression *expr, const Cost &newCost, const TypeEnvironment & env, const std::string & name ); 105 /// Adds alternatives for member expressions where the left side has tuple type 106 void addTupleMembers( TupleType * tupleType, Expression *expr, const Cost &newCost, const TypeEnvironment & env, Expression * member ); 107 /// Adds alternatives for offsetof expressions, given the base type and name of the member 108 template< typename StructOrUnionType > void addOffsetof( StructOrUnionType *aggInst, const std::string &name ); 109 /// Takes a final result and checks if its assertions can be satisfied 110 template<typename OutputIterator> 111 void validateFunctionAlternative( const Alternative &func, ArgPack& result, const std::vector<ArgPack>& results, OutputIterator out ); 112 /// Finds matching alternatives for a function, given a set of arguments 113 template<typename OutputIterator> 114 void makeFunctionAlternatives( const Alternative &func, FunctionType *funcType, const ExplodedArgs& args, OutputIterator out ); 115 /// Checks if assertion parameters match for a new alternative 116 template< typename OutputIterator > 117 void inferParameters( const AssertionSet &need, AssertionSet &have, const Alternative &newAlt, OpenVarSet &openVars, OutputIterator out ); 118 private: 119 AlternativeFinder & altFinder; 120 const SymTab::Indexer &indexer; 121 AltList & alternatives; 122 const TypeEnvironment &env; 123 Type *& targetType; 124 }; 76 125 77 126 Cost sumCost( const AltList &in ) { … … 127 176 selected[ mangleName ] = current; 128 177 } else if ( candidate->cost == mapPlace->second.candidate->cost ) { 129 PRINT( 130 std::cerr << "marking ambiguous" << std::endl; 131 ) 132 mapPlace->second.isAmbiguous = true; 178 // if one of the candidates contains a deleted identifier, can pick the other, since 179 // deleted expressions should not be ambiguous if there is another option that is at least as good 180 if ( findDeletedExpr( candidate->expr ) ) { 181 // do nothing 182 PRINT( std::cerr << "candidate is deleted" << std::endl; ) 183 } else if ( findDeletedExpr( mapPlace->second.candidate->expr ) ) { 184 PRINT( std::cerr << "current is deleted" << std::endl; ) 185 selected[ mangleName ] = current; 186 } else { 187 PRINT( 188 std::cerr << "marking ambiguous" << std::endl; 189 ) 190 mapPlace->second.isAmbiguous = true; 191 } 133 192 } else { 134 193 PRINT( … … 152 211 153 212 void renameTypes( Expression *expr ) { 154 expr->get_result()->accept( global_renamer);213 renameTyVars( expr->result ); 155 214 } 156 215 } // namespace 157 216 158 void referenceToRvalueConversion( Expression *& expr ) {217 void referenceToRvalueConversion( Expression *& expr, Cost & cost ) { 159 218 if ( dynamic_cast< ReferenceType * >( expr->get_result() ) ) { 160 219 // cast away reference from expr 161 220 expr = new CastExpr( expr, expr->get_result()->stripReferences()->clone() ); 221 cost.incReference(); 162 222 } 163 223 } … … 185 245 186 246 void AlternativeFinder::find( Expression *expr, bool adjust, bool prune, bool failFast ) { 187 expr->accept( *this ); 247 PassVisitor<Finder> finder( *this ); 248 expr->accept( finder ); 188 249 if ( failFast && alternatives.empty() ) { 189 250 PRINT( 190 251 std::cerr << "No reasonable alternatives for expression " << expr << std::endl; 191 252 ) 192 throw SemanticError( "No reasonable alternatives for expression ", expr);253 SemanticError( expr, "No reasonable alternatives for expression " ); 193 254 } 194 255 if ( prune ) { … … 206 267 stream << "Cannot choose between " << winners.size() << " alternatives for expression\n"; 207 268 expr->print( stream ); 208 stream << " Alternatives are:\n";269 stream << " Alternatives are:\n"; 209 270 printAlts( winners, stream, 1 ); 210 throw SemanticError(stream.str() );271 SemanticError( expr->location, stream.str() ); 211 272 } 212 273 alternatives = move(pruned); … … 244 305 } 245 306 246 void AlternativeFinder:: addAnonConversions( const Alternative & alt ) {307 void AlternativeFinder::Finder::addAnonConversions( const Alternative & alt ) { 247 308 // adds anonymous member interpretations whenever an aggregate value type is seen. 248 309 // it's okay for the aggregate expression to have reference type -- cast it to the base type to treat the aggregate as the referenced value 249 310 std::unique_ptr<Expression> aggrExpr( alt.expr->clone() ); 250 alt.env.apply( aggrExpr-> get_result());251 Type * aggrType = aggrExpr-> get_result();311 alt.env.apply( aggrExpr->result ); 312 Type * aggrType = aggrExpr->result; 252 313 if ( dynamic_cast< ReferenceType * >( aggrType ) ) { 253 314 aggrType = aggrType->stripReferences(); … … 255 316 } 256 317 257 if ( StructInstType *structInst = dynamic_cast< StructInstType* >( aggrExpr->get_result() ) ) { 258 NameExpr nameExpr( "" ); 259 addAggMembers( structInst, aggrExpr.get(), alt.cost+Cost::safe, alt.env, &nameExpr ); 260 } else if ( UnionInstType *unionInst = dynamic_cast< UnionInstType* >( aggrExpr->get_result() ) ) { 261 NameExpr nameExpr( "" ); 262 addAggMembers( unionInst, aggrExpr.get(), alt.cost+Cost::safe, alt.env, &nameExpr ); 318 if ( StructInstType *structInst = dynamic_cast< StructInstType* >( aggrExpr->result ) ) { 319 addAggMembers( structInst, aggrExpr.get(), alt.cost+Cost::safe, alt.env, "" ); 320 } else if ( UnionInstType *unionInst = dynamic_cast< UnionInstType* >( aggrExpr->result ) ) { 321 addAggMembers( unionInst, aggrExpr.get(), alt.cost+Cost::safe, alt.env, "" ); 263 322 } // if 264 323 } 265 324 266 325 template< typename StructOrUnionType > 267 void AlternativeFinder::addAggMembers( StructOrUnionType *aggInst, Expression *expr, const Cost &newCost, const TypeEnvironment & env, Expression * member ) { 268 // by this point, member must be a name expr 269 NameExpr * nameExpr = dynamic_cast< NameExpr * >( member ); 270 if ( ! nameExpr ) return; 271 const std::string & name = nameExpr->get_name(); 326 void AlternativeFinder::Finder::addAggMembers( StructOrUnionType *aggInst, Expression *expr, const Cost &newCost, const TypeEnvironment & env, const std::string & name ) { 272 327 std::list< Declaration* > members; 273 328 aggInst->lookup( name, members ); 274 329 275 for ( std::list< Declaration* >::const_iterator i = members.begin(); i != members.end(); ++i ) { 276 if ( DeclarationWithType *dwt = dynamic_cast< DeclarationWithType* >( *i ) ) { 277 alternatives.push_back( Alternative( new MemberExpr( dwt, expr->clone() ), env, newCost ) ); 278 renameTypes( alternatives.back().expr ); 279 addAnonConversions( alternatives.back() ); // add anonymous member interpretations whenever an aggregate value type is seen as a member expression. 330 for ( Declaration * decl : members ) { 331 if ( DeclarationWithType *dwt = dynamic_cast< DeclarationWithType* >( decl ) ) { 332 // addAnonAlternatives uses vector::push_back, which invalidates references to existing elements, so 333 // can't construct in place and use vector::back 334 Alternative newAlt( new MemberExpr( dwt, expr->clone() ), env, newCost ); 335 renameTypes( newAlt.expr ); 336 addAnonConversions( newAlt ); // add anonymous member interpretations whenever an aggregate value type is seen as a member expression. 337 alternatives.push_back( std::move(newAlt) ); 280 338 } else { 281 339 assert( false ); … … 284 342 } 285 343 286 void AlternativeFinder:: addTupleMembers( TupleType * tupleType, Expression *expr, const Cost &newCost, const TypeEnvironment & env, Expression * member ) {344 void AlternativeFinder::Finder::addTupleMembers( TupleType * tupleType, Expression *expr, const Cost &newCost, const TypeEnvironment & env, Expression * member ) { 287 345 if ( ConstantExpr * constantExpr = dynamic_cast< ConstantExpr * >( member ) ) { 288 346 // get the value of the constant expression as an int, must be between 0 and the length of the tuple type to have meaning 289 // xxx - this should be improved by memoizing the value of constant exprs 290 // during parsing and reusing that information here. 291 std::stringstream ss( constantExpr->get_constant()->get_value() ); 292 int val = 0; 347 auto val = constantExpr->intValue(); 293 348 std::string tmp; 294 if ( ss >> val && ! (ss >> tmp) ) { 295 if ( val >= 0 && (unsigned int)val < tupleType->size() ) { 296 alternatives.push_back( Alternative( new TupleIndexExpr( expr->clone(), val ), env, newCost ) ); 297 } // if 349 if ( val >= 0 && (unsigned long long)val < tupleType->size() ) { 350 alternatives.push_back( Alternative( new TupleIndexExpr( expr->clone(), val ), env, newCost ) ); 298 351 } // if 299 } else if ( NameExpr * nameExpr = dynamic_cast< NameExpr * >( member ) ) {300 // xxx - temporary hack until 0/1 are int constants301 if ( nameExpr->get_name() == "0" || nameExpr->get_name() == "1" ) {302 std::stringstream ss( nameExpr->get_name() );303 int val;304 ss >> val;305 alternatives.push_back( Alternative( new TupleIndexExpr( expr->clone(), val ), env, newCost ) );306 }307 352 } // if 308 353 } 309 354 310 void AlternativeFinder:: visit( ApplicationExpr *applicationExpr ) {355 void AlternativeFinder::Finder::postvisit( ApplicationExpr *applicationExpr ) { 311 356 alternatives.push_back( Alternative( applicationExpr->clone(), env, Cost::zero ) ); 312 357 } … … 386 431 PRINT( std::cerr << "end of formals with varargs function: inc unsafe: " << convCost << std::endl; ; ) 387 432 // convert reference-typed expressions to value-typed expressions 388 referenceToRvalueConversion( *actualExpr );433 referenceToRvalueConversion( *actualExpr, convCost ); 389 434 continue; 390 435 } else { … … 392 437 } 393 438 } 439 if ( DefaultArgExpr * def = dynamic_cast< DefaultArgExpr * >( *actualExpr ) ) { 440 // default arguments should be free - don't include conversion cost. 441 // Unwrap them here because they are not relevant to the rest of the system. 442 *actualExpr = def->expr; 443 ++formal; 444 continue; 445 } 394 446 Type * formalType = (*formal)->get_type(); 395 447 convCost += computeExpressionConversionCost( *actualExpr, formalType, indexer, alt.env ); … … 409 461 /// Adds type variables to the open variable set and marks their assertions 410 462 void makeUnifiableVars( Type *type, OpenVarSet &unifiableVars, AssertionSet &needAssertions ) { 411 for ( Type::ForallList::const_iterator tyvar = type-> get_forall().begin(); tyvar != type->get_forall().end(); ++tyvar ) {463 for ( Type::ForallList::const_iterator tyvar = type->forall.begin(); tyvar != type->forall.end(); ++tyvar ) { 412 464 unifiableVars[ (*tyvar)->get_name() ] = TypeDecl::Data{ *tyvar }; 413 for ( std::list< DeclarationWithType* >::iterator assert = (*tyvar)-> get_assertions().begin(); assert != (*tyvar)->get_assertions().end(); ++assert ) {465 for ( std::list< DeclarationWithType* >::iterator assert = (*tyvar)->assertions.begin(); assert != (*tyvar)->assertions.end(); ++assert ) { 414 466 needAssertions[ *assert ].isUsed = true; 415 467 } … … 418 470 } 419 471 420 // /// Map of declaration uniqueIds (intended to be the assertions in an AssertionSet) to their parents and the number of times they've been included421 //typedef std::unordered_map< UniqueId, std::unordered_map< UniqueId, unsigned > > AssertionParentSet;422 423 472 static const int recursionLimit = /*10*/ 4; ///< Limit to depth of recursion satisfaction 424 //static const unsigned recursionParentLimit = 1; ///< Limit to the number of times an assertion can recursively use itself425 473 426 474 void addToIndexer( AssertionSet &assertSet, SymTab::Indexer &indexer ) { … … 433 481 434 482 template< typename ForwardIterator, typename OutputIterator > 435 void inferRecursive( ForwardIterator begin, ForwardIterator end, const Alternative &newAlt, OpenVarSet &openVars, const SymTab::Indexer &decls, const AssertionSet &newNeed, /*const AssertionParentSet &needParents,*/436 int level, const SymTab::Indexer &indexer, OutputIterator out ) {483 void inferRecursive( ForwardIterator begin, ForwardIterator end, const Alternative &newAlt, OpenVarSet &openVars, const SymTab::Indexer &decls, const AssertionSet &newNeed, int level, const SymTab::Indexer &indexer, OutputIterator out ) { 484 if ( newAlt.cost == Cost::infinity ) return; // don't proceed down this dead end 437 485 if ( begin == end ) { 438 486 if ( newNeed.empty() ) { … … 445 493 return; 446 494 } else if ( level >= recursionLimit ) { 447 throw SemanticError("Too many recursive assertions" );495 SemanticError( newAlt.expr->location, "Too many recursive assertions" ); 448 496 } else { 449 497 AssertionSet newerNeed; … … 452 500 printAssertionSet( newNeed, std::cerr, 8 ); 453 501 ) 454 inferRecursive( newNeed.begin(), newNeed.end(), newAlt, openVars, decls, newerNeed, /*needParents,*/level+1, indexer, out );502 inferRecursive( newNeed.begin(), newNeed.end(), newAlt, openVars, decls, newerNeed, level+1, indexer, out ); 455 503 return; 456 504 } … … 459 507 ForwardIterator cur = begin++; 460 508 if ( ! cur->second.isUsed ) { 461 inferRecursive( begin, end, newAlt, openVars, decls, newNeed, /*needParents,*/level, indexer, out );509 inferRecursive( begin, end, newAlt, openVars, decls, newNeed, level, indexer, out ); 462 510 return; // xxx - should this continue? previously this wasn't here, and it looks like it should be 463 511 } … … 485 533 Type *adjType = candidate->get_type()->clone(); 486 534 adjustExprType( adjType, newEnv, indexer ); 487 adjType->accept( global_renamer);535 renameTyVars( adjType ); 488 536 PRINT( 489 537 std::cerr << "unifying "; … … 512 560 } 513 561 514 //AssertionParentSet newNeedParents( needParents ); 515 // skip repeatingly-self-recursive assertion satisfaction 516 // DOESN'T WORK: grandchild nodes conflict with their cousins 517 //if ( newNeedParents[ curDecl->get_uniqueId() ][ candDecl->get_uniqueId() ]++ > recursionParentLimit ) continue; 518 Expression *varExpr = data.combine(); 562 Expression *varExpr = data.combine( newerAlt.cvtCost ); 519 563 delete varExpr->get_result(); 520 564 varExpr->set_result( adjType->clone() ); … … 533 577 // XXX: this is a memory leak, but adjType can't be deleted because it might contain assertions 534 578 (*inferParameters)[ curDecl->get_uniqueId() ] = ParamEntry( candidate->get_uniqueId(), adjType->clone(), curDecl->get_type()->clone(), varExpr ); 535 inferRecursive( begin, end, newerAlt, newOpenVars, newDecls, newerNeed, /*newNeedParents,*/level, indexer, out );579 inferRecursive( begin, end, newerAlt, newOpenVars, newDecls, newerNeed, level, indexer, out ); 536 580 } else { 537 581 delete adjType; … … 541 585 542 586 template< typename OutputIterator > 543 void AlternativeFinder:: inferParameters( const AssertionSet &need, AssertionSet &have, const Alternative &newAlt, OpenVarSet &openVars, OutputIterator out ) {587 void AlternativeFinder::Finder::inferParameters( const AssertionSet &need, AssertionSet &have, const Alternative &newAlt, OpenVarSet &openVars, OutputIterator out ) { 544 588 // PRINT( 545 589 // std::cerr << "inferParameters: assertions needed are" << std::endl; … … 555 599 addToIndexer( have, decls ); 556 600 AssertionSet newNeed; 557 //AssertionParentSet needParents;558 601 PRINT( 559 602 std::cerr << "env is: " << std::endl; … … 562 605 ) 563 606 564 inferRecursive( need.begin(), need.end(), newAlt, openVars, decls, newNeed, /*needParents,*/0, indexer, out );607 inferRecursive( need.begin(), need.end(), newAlt, openVars, decls, newNeed, 0, indexer, out ); 565 608 // PRINT( 566 609 // std::cerr << "declaration 14 is "; … … 573 616 ConstantExpr* getDefaultValue( Initializer* init ) { 574 617 if ( SingleInit* si = dynamic_cast<SingleInit*>( init ) ) { 575 if ( CastExpr* ce = dynamic_cast<CastExpr*>( si->get_value() ) ) { 576 return dynamic_cast<ConstantExpr*>( ce->get_arg() ); 618 if ( CastExpr* ce = dynamic_cast<CastExpr*>( si->value ) ) { 619 return dynamic_cast<ConstantExpr*>( ce->arg ); 620 } else { 621 return dynamic_cast<ConstantExpr*>( si->value ); 577 622 } 578 623 } … … 596 641 ArgPack() 597 642 : parent(0), expr(), cost(Cost::zero), env(), need(), have(), openVars(), nextArg(0), 598 599 643 tupleStart(0), nextExpl(0), explAlt(0) {} 600 644 … … 648 692 const ExplodedArgs& args, std::vector<ArgPack>& results, std::size_t& genStart, 649 693 const SymTab::Indexer& indexer, unsigned nTuples = 0 ) { 650 if ( TupleType * tupleType = dynamic_cast<TupleType*>( formalType ) ) {694 if ( TupleType * tupleType = dynamic_cast<TupleType*>( formalType ) ) { 651 695 // formalType is a TupleType - group actuals into a TupleExpr 652 696 ++nTuples; 653 697 for ( Type* type : *tupleType ) { 654 698 // xxx - dropping initializer changes behaviour from previous, but seems correct 699 // ^^^ need to handle the case where a tuple has a default argument 655 700 if ( ! instantiateArgument( 656 701 type, nullptr, args, results, genStart, indexer, nTuples ) ) … … 663 708 } 664 709 return true; 665 } else if ( TypeInstType * ttype = Tuples::isTtype( formalType ) ) {710 } else if ( TypeInstType * ttype = Tuples::isTtype( formalType ) ) { 666 711 // formalType is a ttype, consumes all remaining arguments 667 712 // xxx - mixing default arguments with variadic?? … … 706 751 Type* argType; 707 752 708 if ( nTuples > 0 ) { 709 // first iteration, push empty tuple expression 753 if ( nTuples > 0 || ! results[i].expr ) { 754 // first iteration or no expression to clone, 755 // push empty tuple expression 710 756 newResult.parent = i; 711 757 std::list<Expression*> emptyList; … … 834 880 indexer ) ) { 835 881 results.emplace_back( 836 i, cnstExpr, move(env), move(need), move(have),882 i, new DefaultArgExpr( cnstExpr ), move(env), move(need), move(have), 837 883 move(openVars), nextArg, nTuples ); 838 884 } … … 865 911 // consider only first exploded actual 866 912 Expression* expr = expl.exprs.front().get(); 867 Type* actualType = expr-> get_result()->clone();913 Type* actualType = expr->result->clone(); 868 914 869 915 PRINT( … … 892 938 893 939 template<typename OutputIterator> 894 void AlternativeFinder:: validateFunctionAlternative( const Alternative &func, ArgPack& result,940 void AlternativeFinder::Finder::validateFunctionAlternative( const Alternative &func, ArgPack& result, 895 941 const std::vector<ArgPack>& results, OutputIterator out ) { 896 942 ApplicationExpr *appExpr = new ApplicationExpr( func.expr->clone() ); 897 943 // sum cost and accumulate actuals 898 std::list<Expression*>& args = appExpr-> get_args();944 std::list<Expression*>& args = appExpr->args; 899 945 Cost cost = func.cost; 900 946 const ArgPack* pack = &result; … … 915 961 916 962 template<typename OutputIterator> 917 void AlternativeFinder:: makeFunctionAlternatives( const Alternative &func,963 void AlternativeFinder::Finder::makeFunctionAlternatives( const Alternative &func, 918 964 FunctionType *funcType, const ExplodedArgs &args, OutputIterator out ) { 919 965 OpenVarSet funcOpenVars; … … 923 969 // add all type variables as open variables now so that those not used in the parameter 924 970 // list are still considered open. 925 funcEnv.add( funcType-> get_forall());926 927 if ( targetType && ! targetType->isVoid() && ! funcType-> get_returnVals().empty() ) {971 funcEnv.add( funcType->forall ); 972 973 if ( targetType && ! targetType->isVoid() && ! funcType->returnVals.empty() ) { 928 974 // attempt to narrow based on expected target type 929 Type * returnType = funcType-> get_returnVals().front()->get_type();975 Type * returnType = funcType->returnVals.front()->get_type(); 930 976 if ( ! unify( returnType, targetType, funcEnv, funcNeed, funcHave, funcOpenVars, 931 977 indexer ) ) { … … 940 986 std::size_t genStart = 0; 941 987 942 for ( DeclarationWithType* formal : funcType-> get_parameters()) {988 for ( DeclarationWithType* formal : funcType->parameters ) { 943 989 ObjectDecl* obj = strict_dynamic_cast< ObjectDecl* >( formal ); 944 990 if ( ! instantiateArgument( 945 obj-> get_type(), obj->get_init(), args, results, genStart, indexer ) )991 obj->type, obj->init, args, results, genStart, indexer ) ) 946 992 return; 947 993 } … … 1022 1068 } 1023 1069 1024 void AlternativeFinder:: visit( UntypedExpr *untypedExpr ) {1070 void AlternativeFinder::Finder::postvisit( UntypedExpr *untypedExpr ) { 1025 1071 AlternativeFinder funcFinder( indexer, env ); 1026 funcFinder.findWithAdjustment( untypedExpr-> get_function());1072 funcFinder.findWithAdjustment( untypedExpr->function ); 1027 1073 // if there are no function alternatives, then proceeding is a waste of time. 1074 // xxx - findWithAdjustment throws, so this check and others like it shouldn't be necessary. 1028 1075 if ( funcFinder.alternatives.empty() ) return; 1029 1076 1030 1077 std::vector< AlternativeFinder > argAlternatives; 1031 findSubExprs( untypedExpr->begin_args(), untypedExpr->end_args(),1078 altFinder.findSubExprs( untypedExpr->begin_args(), untypedExpr->end_args(), 1032 1079 back_inserter( argAlternatives ) ); 1033 1080 1034 1081 // take care of possible tuple assignments 1035 1082 // if not tuple assignment, assignment is taken care of as a normal function call 1036 Tuples::handleTupleAssignment( *this, untypedExpr, argAlternatives );1083 Tuples::handleTupleAssignment( altFinder, untypedExpr, argAlternatives ); 1037 1084 1038 1085 // find function operators … … 1040 1087 AlternativeFinder funcOpFinder( indexer, env ); 1041 1088 // it's ok if there aren't any defined function ops 1042 funcOpFinder.maybeFind( opExpr );1089 funcOpFinder.maybeFind( opExpr ); 1043 1090 PRINT( 1044 1091 std::cerr << "known function ops:" << std::endl; … … 1053 1100 argExpansions.emplace_back(); 1054 1101 auto& argE = argExpansions.back(); 1055 argE.reserve( arg.alternatives.size() );1102 // argE.reserve( arg.alternatives.size() ); 1056 1103 1057 1104 for ( const Alternative& actual : arg ) { … … 1061 1108 1062 1109 AltList candidates; 1063 SemanticError errors;1110 SemanticErrorException errors; 1064 1111 for ( AltList::iterator func = funcFinder.alternatives.begin(); func != funcFinder.alternatives.end(); ++func ) { 1065 1112 try { … … 1069 1116 ) 1070 1117 // check if the type is pointer to function 1071 if ( PointerType *pointer = dynamic_cast< PointerType* >( func->expr-> get_result()->stripReferences() ) ) {1072 if ( FunctionType *function = dynamic_cast< FunctionType* >( pointer-> get_base()) ) {1118 if ( PointerType *pointer = dynamic_cast< PointerType* >( func->expr->result->stripReferences() ) ) { 1119 if ( FunctionType *function = dynamic_cast< FunctionType* >( pointer->base ) ) { 1073 1120 Alternative newFunc( *func ); 1074 referenceToRvalueConversion( newFunc.expr );1121 referenceToRvalueConversion( newFunc.expr, newFunc.cost ); 1075 1122 makeFunctionAlternatives( newFunc, function, argExpansions, 1076 1123 std::back_inserter( candidates ) ); 1077 1124 } 1078 } else if ( TypeInstType *typeInst = dynamic_cast< TypeInstType* >( func->expr->get_result()->stripReferences() ) ) { // handle ftype (e.g. *? on function pointer) 1079 EqvClass eqvClass; 1080 if ( func->env.lookup( typeInst->get_name(), eqvClass ) && eqvClass.type ) { 1081 if ( FunctionType *function = dynamic_cast< FunctionType* >( eqvClass.type ) ) { 1125 } else if ( TypeInstType *typeInst = dynamic_cast< TypeInstType* >( func->expr->result->stripReferences() ) ) { // handle ftype (e.g. *? on function pointer) 1126 if ( const EqvClass *eqvClass = func->env.lookup( typeInst->name ) ) { 1127 if ( FunctionType *function = dynamic_cast< FunctionType* >( eqvClass->type ) ) { 1082 1128 Alternative newFunc( *func ); 1083 referenceToRvalueConversion( newFunc.expr );1129 referenceToRvalueConversion( newFunc.expr, newFunc.cost ); 1084 1130 makeFunctionAlternatives( newFunc, function, argExpansions, 1085 1131 std::back_inserter( candidates ) ); … … 1087 1133 } // if 1088 1134 } 1089 } catch ( SemanticError &e ) {1135 } catch ( SemanticErrorException &e ) { 1090 1136 errors.append( e ); 1091 1137 } … … 1107 1153 // check if type is a pointer to function 1108 1154 if ( PointerType* pointer = dynamic_cast<PointerType*>( 1109 funcOp->expr-> get_result()->stripReferences() ) ) {1155 funcOp->expr->result->stripReferences() ) ) { 1110 1156 if ( FunctionType* function = 1111 dynamic_cast<FunctionType*>( pointer-> get_base()) ) {1157 dynamic_cast<FunctionType*>( pointer->base ) ) { 1112 1158 Alternative newFunc( *funcOp ); 1113 referenceToRvalueConversion( newFunc.expr );1159 referenceToRvalueConversion( newFunc.expr, newFunc.cost ); 1114 1160 makeFunctionAlternatives( newFunc, function, argExpansions, 1115 1161 std::back_inserter( candidates ) ); 1116 1162 } 1117 1163 } 1118 } catch ( SemanticError &e ) {1164 } catch ( SemanticErrorException &e ) { 1119 1165 errors.append( e ); 1120 1166 } … … 1131 1177 PRINT( 1132 1178 ApplicationExpr *appExpr = strict_dynamic_cast< ApplicationExpr* >( withFunc.expr ); 1133 PointerType *pointer = strict_dynamic_cast< PointerType* >( appExpr-> get_function()->get_result());1134 FunctionType *function = strict_dynamic_cast< FunctionType* >( pointer-> get_base());1135 std::cerr << "Case +++++++++++++ " << appExpr-> get_function()<< std::endl;1179 PointerType *pointer = strict_dynamic_cast< PointerType* >( appExpr->function->result ); 1180 FunctionType *function = strict_dynamic_cast< FunctionType* >( pointer->base ); 1181 std::cerr << "Case +++++++++++++ " << appExpr->function << std::endl; 1136 1182 std::cerr << "formals are:" << std::endl; 1137 printAll( function-> get_parameters(), std::cerr, 8 );1183 printAll( function->parameters, std::cerr, 8 ); 1138 1184 std::cerr << "actuals are:" << std::endl; 1139 printAll( appExpr-> get_args(), std::cerr, 8 );1185 printAll( appExpr->args, std::cerr, 8 ); 1140 1186 std::cerr << "bindings are:" << std::endl; 1141 1187 withFunc.env.print( std::cerr, 8 ); 1188 std::cerr << "cost is: " << withFunc.cost << std::endl; 1142 1189 std::cerr << "cost of conversion is:" << cvtCost << std::endl; 1143 1190 ) … … 1172 1219 // fix this issue in a more robust way. 1173 1220 targetType = nullptr; 1174 visit( untypedExpr );1221 postvisit( untypedExpr ); 1175 1222 } 1176 1223 } … … 1178 1225 bool isLvalue( Expression *expr ) { 1179 1226 // xxx - recurse into tuples? 1180 return expr->result && ( expr-> get_result()->get_lvalue() || dynamic_cast< ReferenceType * >( expr->get_result()) );1181 } 1182 1183 void AlternativeFinder:: visit( AddressExpr *addressExpr ) {1227 return expr->result && ( expr->result->get_lvalue() || dynamic_cast< ReferenceType * >( expr->result ) ); 1228 } 1229 1230 void AlternativeFinder::Finder::postvisit( AddressExpr *addressExpr ) { 1184 1231 AlternativeFinder finder( indexer, env ); 1185 1232 finder.find( addressExpr->get_arg() ); … … 1192 1239 } 1193 1240 1194 void AlternativeFinder:: visit( LabelAddressExpr * expr ) {1241 void AlternativeFinder::Finder::postvisit( LabelAddressExpr * expr ) { 1195 1242 alternatives.push_back( Alternative{ expr->clone(), env, Cost::zero } ); 1196 1243 } 1197 1244 1198 Expression * restructureCast( Expression * argExpr, Type * toType ) {1245 Expression * restructureCast( Expression * argExpr, Type * toType, bool isGenerated ) { 1199 1246 if ( argExpr->get_result()->size() > 1 && ! toType->isVoid() && ! dynamic_cast<ReferenceType *>( toType ) ) { 1200 1247 // Argument expression is a tuple and the target type is not void and not a reference type. … … 1211 1258 // cast each component 1212 1259 TupleIndexExpr * idx = new TupleIndexExpr( argExpr->clone(), i ); 1213 componentExprs.push_back( restructureCast( idx, toType->getComponent( i ) ) );1260 componentExprs.push_back( restructureCast( idx, toType->getComponent( i ), isGenerated ) ); 1214 1261 } 1215 1262 delete argExpr; … … 1219 1266 } else { 1220 1267 // handle normally 1221 return new CastExpr( argExpr, toType->clone() ); 1222 } 1223 } 1224 1225 void AlternativeFinder::visit( CastExpr *castExpr ) { 1268 CastExpr * ret = new CastExpr( argExpr, toType->clone() ); 1269 ret->isGenerated = isGenerated; 1270 return ret; 1271 } 1272 } 1273 1274 void AlternativeFinder::Finder::postvisit( CastExpr *castExpr ) { 1226 1275 Type *& toType = castExpr->get_result(); 1227 1276 assert( toType ); … … 1232 1281 AlternativeFinder finder( indexer, env ); 1233 1282 finder.targetType = toType; 1234 finder.findWithAdjustment( castExpr-> get_arg());1283 finder.findWithAdjustment( castExpr->arg ); 1235 1284 1236 1285 AltList candidates; … … 1239 1288 OpenVarSet openVars; 1240 1289 1290 alt.env.extractOpenVars( openVars ); 1291 1241 1292 // It's possible that a cast can throw away some values in a multiply-valued expression. (An example is a 1242 1293 // cast-to-void, which casts from one value to zero.) Figure out the prefix of the subexpression results 1243 1294 // that are cast directly. The candidate is invalid if it has fewer results than there are types to cast 1244 1295 // to. 1245 int discardedValues = alt.expr-> get_result()->size() - castExpr->get_result()->size();1296 int discardedValues = alt.expr->result->size() - castExpr->result->size(); 1246 1297 if ( discardedValues < 0 ) continue; 1247 1298 // xxx - may need to go into tuple types and extract relevant types and use unifyList. Note that currently, this does not 1248 1299 // allow casting a tuple to an atomic type (e.g. (int)([1, 2, 3])) 1249 1300 // unification run for side-effects 1250 unify( castExpr-> get_result(), alt.expr->get_result(), alt.env, needAssertions,1301 unify( castExpr->result, alt.expr->result, alt.env, needAssertions, 1251 1302 haveAssertions, openVars, indexer ); 1252 Cost thisCost = castCost( alt.expr-> get_result(), castExpr->get_result(), indexer,1303 Cost thisCost = castCost( alt.expr->result, castExpr->result, indexer, 1253 1304 alt.env ); 1254 1305 PRINT( … … 1263 1314 // count one safe conversion for each value that is thrown away 1264 1315 thisCost.incSafe( discardedValues ); 1265 Alternative newAlt( restructureCast( alt.expr->clone(), toType ), alt.env,1316 Alternative newAlt( restructureCast( alt.expr->clone(), toType, castExpr->isGenerated ), alt.env, 1266 1317 alt.cost, thisCost ); 1267 1318 inferParameters( needAssertions, haveAssertions, newAlt, openVars, … … 1278 1329 } 1279 1330 1280 void AlternativeFinder:: visit( VirtualCastExpr * castExpr ) {1331 void AlternativeFinder::Finder::postvisit( VirtualCastExpr * castExpr ) { 1281 1332 assertf( castExpr->get_result(), "Implicate virtual cast targets not yet supported." ); 1282 1333 AlternativeFinder finder( indexer, env ); … … 1290 1341 } 1291 1342 1292 void AlternativeFinder::visit( UntypedMemberExpr *memberExpr ) { 1343 namespace { 1344 /// Gets name from untyped member expression (member must be NameExpr) 1345 const std::string& get_member_name( UntypedMemberExpr *memberExpr ) { 1346 NameExpr * nameExpr = dynamic_cast< NameExpr * >( memberExpr->get_member() ); 1347 assert( nameExpr ); 1348 return nameExpr->get_name(); 1349 } 1350 } 1351 1352 void AlternativeFinder::Finder::postvisit( UntypedMemberExpr *memberExpr ) { 1293 1353 AlternativeFinder funcFinder( indexer, env ); 1294 1354 funcFinder.findWithAdjustment( memberExpr->get_aggregate() ); 1295 1355 for ( AltList::const_iterator agg = funcFinder.alternatives.begin(); agg != funcFinder.alternatives.end(); ++agg ) { 1296 1356 // it's okay for the aggregate expression to have reference type -- cast it to the base type to treat the aggregate as the referenced value 1297 std::unique_ptr<Expression> aggrExpr( agg->expr->clone() ); 1298 Type * aggrType = aggrExpr->get_result(); 1299 if ( dynamic_cast< ReferenceType * >( aggrType ) ) { 1300 aggrType = aggrType->stripReferences(); 1301 aggrExpr.reset( new CastExpr( aggrExpr.release(), aggrType->clone() ) ); 1302 } 1357 Cost cost = agg->cost; 1358 Expression * aggrExpr = agg->expr->clone(); 1359 referenceToRvalueConversion( aggrExpr, cost ); 1360 std::unique_ptr<Expression> guard( aggrExpr ); 1361 1303 1362 // find member of the given type 1304 1363 if ( StructInstType *structInst = dynamic_cast< StructInstType* >( aggrExpr->get_result() ) ) { 1305 addAggMembers( structInst, aggrExpr .get(), agg->cost, agg->env, memberExpr->get_member() );1364 addAggMembers( structInst, aggrExpr, cost, agg->env, get_member_name(memberExpr) ); 1306 1365 } else if ( UnionInstType *unionInst = dynamic_cast< UnionInstType* >( aggrExpr->get_result() ) ) { 1307 addAggMembers( unionInst, aggrExpr .get(), agg->cost, agg->env, memberExpr->get_member() );1366 addAggMembers( unionInst, aggrExpr, cost, agg->env, get_member_name(memberExpr) ); 1308 1367 } else if ( TupleType * tupleType = dynamic_cast< TupleType * >( aggrExpr->get_result() ) ) { 1309 addTupleMembers( tupleType, aggrExpr .get(), agg->cost, agg->env, memberExpr->get_member() );1368 addTupleMembers( tupleType, aggrExpr, cost, agg->env, memberExpr->get_member() ); 1310 1369 } // if 1311 1370 } // for 1312 1371 } 1313 1372 1314 void AlternativeFinder:: visit( MemberExpr *memberExpr ) {1373 void AlternativeFinder::Finder::postvisit( MemberExpr *memberExpr ) { 1315 1374 alternatives.push_back( Alternative( memberExpr->clone(), env, Cost::zero ) ); 1316 1375 } 1317 1376 1318 void AlternativeFinder:: visit( NameExpr *nameExpr ) {1377 void AlternativeFinder::Finder::postvisit( NameExpr *nameExpr ) { 1319 1378 std::list< SymTab::Indexer::IdData > declList; 1320 indexer.lookupId( nameExpr-> get_name(), declList );1321 PRINT( std::cerr << "nameExpr is " << nameExpr-> get_name()<< std::endl; )1379 indexer.lookupId( nameExpr->name, declList ); 1380 PRINT( std::cerr << "nameExpr is " << nameExpr->name << std::endl; ) 1322 1381 for ( auto & data : declList ) { 1323 Expression * newExpr = data.combine(); 1324 // xxx - add in extra cost for with-statement exprs? 1325 alternatives.push_back( Alternative( newExpr, env, Cost::zero ) ); 1382 Cost cost = Cost::zero; 1383 Expression * newExpr = data.combine( cost ); 1384 1385 // addAnonAlternatives uses vector::push_back, which invalidates references to existing elements, so 1386 // can't construct in place and use vector::back 1387 Alternative newAlt( newExpr, env, Cost::zero, cost ); 1326 1388 PRINT( 1327 1389 std::cerr << "decl is "; … … 1332 1394 std::cerr << std::endl; 1333 1395 ) 1334 renameTypes( alternatives.back().expr ); 1335 addAnonConversions( alternatives.back() ); // add anonymous member interpretations whenever an aggregate value type is seen as a name expression. 1396 renameTypes( newAlt.expr ); 1397 addAnonConversions( newAlt ); // add anonymous member interpretations whenever an aggregate value type is seen as a name expression. 1398 alternatives.push_back( std::move(newAlt) ); 1336 1399 } // for 1337 1400 } 1338 1401 1339 void AlternativeFinder:: visit( VariableExpr *variableExpr ) {1402 void AlternativeFinder::Finder::postvisit( VariableExpr *variableExpr ) { 1340 1403 // not sufficient to clone here, because variable's type may have changed 1341 1404 // since the VariableExpr was originally created. 1342 alternatives.push_back( Alternative( new VariableExpr( variableExpr-> get_var()), env, Cost::zero ) );1343 } 1344 1345 void AlternativeFinder:: visit( ConstantExpr *constantExpr ) {1405 alternatives.push_back( Alternative( new VariableExpr( variableExpr->var ), env, Cost::zero ) ); 1406 } 1407 1408 void AlternativeFinder::Finder::postvisit( ConstantExpr *constantExpr ) { 1346 1409 alternatives.push_back( Alternative( constantExpr->clone(), env, Cost::zero ) ); 1347 1410 } 1348 1411 1349 void AlternativeFinder:: visit( SizeofExpr *sizeofExpr ) {1412 void AlternativeFinder::Finder::postvisit( SizeofExpr *sizeofExpr ) { 1350 1413 if ( sizeofExpr->get_isType() ) { 1351 1414 Type * newType = sizeofExpr->get_type()->clone(); … … 1359 1422 findMinCost( finder.alternatives.begin(), finder.alternatives.end(), back_inserter( winners ) ); 1360 1423 if ( winners.size() != 1 ) { 1361 throw SemanticError( "Ambiguous expression in sizeof operand: ", sizeofExpr->get_expr());1424 SemanticError( sizeofExpr->get_expr(), "Ambiguous expression in sizeof operand: " ); 1362 1425 } // if 1363 1426 // return the lowest cost alternative for the argument 1364 1427 Alternative &choice = winners.front(); 1365 referenceToRvalueConversion( choice.expr );1428 referenceToRvalueConversion( choice.expr, choice.cost ); 1366 1429 alternatives.push_back( Alternative( new SizeofExpr( choice.expr->clone() ), choice.env, Cost::zero ) ); 1367 1430 } // if 1368 1431 } 1369 1432 1370 void AlternativeFinder:: visit( AlignofExpr *alignofExpr ) {1433 void AlternativeFinder::Finder::postvisit( AlignofExpr *alignofExpr ) { 1371 1434 if ( alignofExpr->get_isType() ) { 1372 1435 Type * newType = alignofExpr->get_type()->clone(); … … 1380 1443 findMinCost( finder.alternatives.begin(), finder.alternatives.end(), back_inserter( winners ) ); 1381 1444 if ( winners.size() != 1 ) { 1382 throw SemanticError( "Ambiguous expression in alignof operand: ", alignofExpr->get_expr());1445 SemanticError( alignofExpr->get_expr(), "Ambiguous expression in alignof operand: " ); 1383 1446 } // if 1384 1447 // return the lowest cost alternative for the argument 1385 1448 Alternative &choice = winners.front(); 1386 referenceToRvalueConversion( choice.expr );1449 referenceToRvalueConversion( choice.expr, choice.cost ); 1387 1450 alternatives.push_back( Alternative( new AlignofExpr( choice.expr->clone() ), choice.env, Cost::zero ) ); 1388 1451 } // if … … 1390 1453 1391 1454 template< typename StructOrUnionType > 1392 void AlternativeFinder:: addOffsetof( StructOrUnionType *aggInst, const std::string &name ) {1455 void AlternativeFinder::Finder::addOffsetof( StructOrUnionType *aggInst, const std::string &name ) { 1393 1456 std::list< Declaration* > members; 1394 1457 aggInst->lookup( name, members ); … … 1403 1466 } 1404 1467 1405 void AlternativeFinder:: visit( UntypedOffsetofExpr *offsetofExpr ) {1468 void AlternativeFinder::Finder::postvisit( UntypedOffsetofExpr *offsetofExpr ) { 1406 1469 AlternativeFinder funcFinder( indexer, env ); 1407 1470 // xxx - resolveTypeof? 1408 1471 if ( StructInstType *structInst = dynamic_cast< StructInstType* >( offsetofExpr->get_type() ) ) { 1409 addOffsetof( structInst, offsetofExpr-> get_member());1472 addOffsetof( structInst, offsetofExpr->member ); 1410 1473 } else if ( UnionInstType *unionInst = dynamic_cast< UnionInstType* >( offsetofExpr->get_type() ) ) { 1411 addOffsetof( unionInst, offsetofExpr-> get_member());1412 } 1413 } 1414 1415 void AlternativeFinder:: visit( OffsetofExpr *offsetofExpr ) {1474 addOffsetof( unionInst, offsetofExpr->member ); 1475 } 1476 } 1477 1478 void AlternativeFinder::Finder::postvisit( OffsetofExpr *offsetofExpr ) { 1416 1479 alternatives.push_back( Alternative( offsetofExpr->clone(), env, Cost::zero ) ); 1417 1480 } 1418 1481 1419 void AlternativeFinder:: visit( OffsetPackExpr *offsetPackExpr ) {1482 void AlternativeFinder::Finder::postvisit( OffsetPackExpr *offsetPackExpr ) { 1420 1483 alternatives.push_back( Alternative( offsetPackExpr->clone(), env, Cost::zero ) ); 1421 1484 } … … 1436 1499 AltList & alternatives = finder.get_alternatives(); 1437 1500 if ( typesCompatibleIgnoreQualifiers( argType, function->get_parameters().front()->get_type(), indexer, env ) ) { 1438 alternatives.push_back( Alternative( new AttrExpr( data.combine(), argType->clone() ), env, Cost::zero ) ); 1501 Cost cost = Cost::zero; 1502 Expression * newExpr = data.combine( cost ); 1503 alternatives.push_back( Alternative( new AttrExpr( newExpr, argType->clone() ), env, Cost::zero, cost ) ); 1439 1504 for ( DeclarationWithType * retVal : function->returnVals ) { 1440 1505 alternatives.back().expr->result = retVal->get_type()->clone(); … … 1444 1509 } 1445 1510 1446 void AlternativeFinder:: visit( AttrExpr *attrExpr ) {1511 void AlternativeFinder::Finder::postvisit( AttrExpr *attrExpr ) { 1447 1512 // assume no 'pointer-to-attribute' 1448 1513 NameExpr *nameExpr = dynamic_cast< NameExpr* >( attrExpr->get_attr() ); … … 1458 1523 if ( function->get_parameters().size() == 1 ) { 1459 1524 if ( attrExpr->get_isType() ) { 1460 resolveAttr( data, function, attrExpr->get_type(), env, *this);1525 resolveAttr( data, function, attrExpr->get_type(), env, altFinder); 1461 1526 } else { 1462 1527 AlternativeFinder finder( indexer, env ); … … 1464 1529 for ( AltList::iterator choice = finder.alternatives.begin(); choice != finder.alternatives.end(); ++choice ) { 1465 1530 if ( choice->expr->get_result()->size() == 1 ) { 1466 resolveAttr(data, function, choice->expr->get_result(), choice->env, *this);1531 resolveAttr(data, function, choice->expr->get_result(), choice->env, altFinder ); 1467 1532 } // fi 1468 1533 } // for … … 1473 1538 } else { 1474 1539 for ( auto & data : attrList ) { 1475 alternatives.push_back( Alternative( data.combine(), env, Cost::zero ) ); 1540 Cost cost = Cost::zero; 1541 Expression * newExpr = data.combine( cost ); 1542 alternatives.push_back( Alternative( newExpr, env, Cost::zero, cost ) ); 1476 1543 renameTypes( alternatives.back().expr ); 1477 1544 } // for … … 1479 1546 } 1480 1547 1481 void AlternativeFinder:: visit( LogicalExpr *logicalExpr ) {1548 void AlternativeFinder::Finder::postvisit( LogicalExpr *logicalExpr ) { 1482 1549 AlternativeFinder firstFinder( indexer, env ); 1483 1550 firstFinder.findWithAdjustment( logicalExpr->get_arg1() ); 1484 for ( AltList::const_iterator first = firstFinder.alternatives.begin(); first != firstFinder.alternatives.end(); ++first ) { 1485 AlternativeFinder secondFinder( indexer, first->env ); 1486 secondFinder.findWithAdjustment( logicalExpr->get_arg2() ); 1487 for ( AltList::const_iterator second = secondFinder.alternatives.begin(); second != secondFinder.alternatives.end(); ++second ) { 1488 LogicalExpr *newExpr = new LogicalExpr( first->expr->clone(), second->expr->clone(), logicalExpr->get_isAnd() ); 1489 alternatives.push_back( Alternative( newExpr, second->env, first->cost + second->cost ) ); 1490 } 1491 } 1492 } 1493 1494 void AlternativeFinder::visit( ConditionalExpr *conditionalExpr ) { 1551 if ( firstFinder.alternatives.empty() ) return; 1552 AlternativeFinder secondFinder( indexer, env ); 1553 secondFinder.findWithAdjustment( logicalExpr->get_arg2() ); 1554 if ( secondFinder.alternatives.empty() ) return; 1555 for ( const Alternative & first : firstFinder.alternatives ) { 1556 for ( const Alternative & second : secondFinder.alternatives ) { 1557 TypeEnvironment compositeEnv; 1558 compositeEnv.simpleCombine( first.env ); 1559 compositeEnv.simpleCombine( second.env ); 1560 1561 LogicalExpr *newExpr = new LogicalExpr( first.expr->clone(), second.expr->clone(), logicalExpr->get_isAnd() ); 1562 alternatives.push_back( Alternative( newExpr, compositeEnv, first.cost + second.cost ) ); 1563 } 1564 } 1565 } 1566 1567 void AlternativeFinder::Finder::postvisit( ConditionalExpr *conditionalExpr ) { 1495 1568 // find alternatives for condition 1496 1569 AlternativeFinder firstFinder( indexer, env ); 1497 firstFinder.findWithAdjustment( conditionalExpr->get_arg1() ); 1498 for ( AltList::const_iterator first = firstFinder.alternatives.begin(); first != firstFinder.alternatives.end(); ++first ) { 1499 // find alternatives for true expression 1500 AlternativeFinder secondFinder( indexer, first->env ); 1501 secondFinder.findWithAdjustment( conditionalExpr->get_arg2() ); 1502 for ( AltList::const_iterator second = secondFinder.alternatives.begin(); second != secondFinder.alternatives.end(); ++second ) { 1503 // find alterantives for false expression 1504 AlternativeFinder thirdFinder( indexer, second->env ); 1505 thirdFinder.findWithAdjustment( conditionalExpr->get_arg3() ); 1506 for ( AltList::const_iterator third = thirdFinder.alternatives.begin(); third != thirdFinder.alternatives.end(); ++third ) { 1570 firstFinder.findWithAdjustment( conditionalExpr->arg1 ); 1571 if ( firstFinder.alternatives.empty() ) return; 1572 // find alternatives for true expression 1573 AlternativeFinder secondFinder( indexer, env ); 1574 secondFinder.findWithAdjustment( conditionalExpr->arg2 ); 1575 if ( secondFinder.alternatives.empty() ) return; 1576 // find alterantives for false expression 1577 AlternativeFinder thirdFinder( indexer, env ); 1578 thirdFinder.findWithAdjustment( conditionalExpr->arg3 ); 1579 if ( thirdFinder.alternatives.empty() ) return; 1580 for ( const Alternative & first : firstFinder.alternatives ) { 1581 for ( const Alternative & second : secondFinder.alternatives ) { 1582 for ( const Alternative & third : thirdFinder.alternatives ) { 1583 TypeEnvironment compositeEnv; 1584 compositeEnv.simpleCombine( first.env ); 1585 compositeEnv.simpleCombine( second.env ); 1586 compositeEnv.simpleCombine( third.env ); 1587 1507 1588 // unify true and false types, then infer parameters to produce new alternatives 1508 1589 OpenVarSet openVars; 1509 1590 AssertionSet needAssertions, haveAssertions; 1510 Alternative newAlt( 0, third->env, first->cost + second->cost + third->cost );1591 Alternative newAlt( 0, compositeEnv, first.cost + second.cost + third.cost ); 1511 1592 Type* commonType = nullptr; 1512 if ( unify( second ->expr->get_result(), third->expr->get_result(), newAlt.env, needAssertions, haveAssertions, openVars, indexer, commonType ) ) {1513 ConditionalExpr *newExpr = new ConditionalExpr( first ->expr->clone(), second->expr->clone(), third->expr->clone() );1514 newExpr-> set_result( commonType ? commonType : second->expr->get_result()->clone());1593 if ( unify( second.expr->result, third.expr->result, newAlt.env, needAssertions, haveAssertions, openVars, indexer, commonType ) ) { 1594 ConditionalExpr *newExpr = new ConditionalExpr( first.expr->clone(), second.expr->clone(), third.expr->clone() ); 1595 newExpr->result = commonType ? commonType : second.expr->result->clone(); 1515 1596 // convert both options to the conditional result type 1516 1597 newAlt.cost += computeExpressionConversionCost( newExpr->arg2, newExpr->result, indexer, newAlt.env ); … … 1524 1605 } 1525 1606 1526 void AlternativeFinder:: visit( CommaExpr *commaExpr ) {1607 void AlternativeFinder::Finder::postvisit( CommaExpr *commaExpr ) { 1527 1608 TypeEnvironment newEnv( env ); 1528 1609 Expression *newFirstArg = resolveInVoidContext( commaExpr->get_arg1(), indexer, newEnv ); 1529 1610 AlternativeFinder secondFinder( indexer, newEnv ); 1530 1611 secondFinder.findWithAdjustment( commaExpr->get_arg2() ); 1531 for ( AltList::const_iterator alt = secondFinder.alternatives.begin(); alt != secondFinder.alternatives.end(); ++alt) {1532 alternatives.push_back( Alternative( new CommaExpr( newFirstArg->clone(), alt ->expr->clone() ), alt->env, alt->cost ) );1612 for ( const Alternative & alt : secondFinder.alternatives ) { 1613 alternatives.push_back( Alternative( new CommaExpr( newFirstArg->clone(), alt.expr->clone() ), alt.env, alt.cost ) ); 1533 1614 } // for 1534 1615 delete newFirstArg; 1535 1616 } 1536 1617 1537 void AlternativeFinder:: visit( RangeExpr * rangeExpr ) {1618 void AlternativeFinder::Finder::postvisit( RangeExpr * rangeExpr ) { 1538 1619 // resolve low and high, accept alternatives whose low and high types unify 1539 1620 AlternativeFinder firstFinder( indexer, env ); 1540 firstFinder.findWithAdjustment( rangeExpr->get_low() ); 1541 for ( AltList::const_iterator first = firstFinder.alternatives.begin(); first != firstFinder.alternatives.end(); ++first ) { 1542 AlternativeFinder secondFinder( indexer, first->env ); 1543 secondFinder.findWithAdjustment( rangeExpr->get_high() ); 1544 for ( AltList::const_iterator second = secondFinder.alternatives.begin(); second != secondFinder.alternatives.end(); ++second ) { 1621 firstFinder.findWithAdjustment( rangeExpr->low ); 1622 if ( firstFinder.alternatives.empty() ) return; 1623 AlternativeFinder secondFinder( indexer, env ); 1624 secondFinder.findWithAdjustment( rangeExpr->high ); 1625 if ( secondFinder.alternatives.empty() ) return; 1626 for ( const Alternative & first : firstFinder.alternatives ) { 1627 for ( const Alternative & second : secondFinder.alternatives ) { 1628 TypeEnvironment compositeEnv; 1629 compositeEnv.simpleCombine( first.env ); 1630 compositeEnv.simpleCombine( second.env ); 1545 1631 OpenVarSet openVars; 1546 1632 AssertionSet needAssertions, haveAssertions; 1547 Alternative newAlt( 0, second->env, first->cost + second->cost );1633 Alternative newAlt( 0, compositeEnv, first.cost + second.cost ); 1548 1634 Type* commonType = nullptr; 1549 if ( unify( first ->expr->get_result(), second->expr->get_result(), newAlt.env, needAssertions, haveAssertions, openVars, indexer, commonType ) ) {1550 RangeExpr * newExpr = new RangeExpr( first->expr->clone(), second->expr->clone() );1551 newExpr-> set_result( commonType ? commonType : first->expr->get_result()->clone());1635 if ( unify( first.expr->result, second.expr->result, newAlt.env, needAssertions, haveAssertions, openVars, indexer, commonType ) ) { 1636 RangeExpr * newExpr = new RangeExpr( first.expr->clone(), second.expr->clone() ); 1637 newExpr->result = commonType ? commonType : first.expr->result->clone(); 1552 1638 newAlt.expr = newExpr; 1553 1639 inferParameters( needAssertions, haveAssertions, newAlt, openVars, back_inserter( alternatives ) ); … … 1557 1643 } 1558 1644 1559 void AlternativeFinder:: visit( UntypedTupleExpr *tupleExpr ) {1645 void AlternativeFinder::Finder::postvisit( UntypedTupleExpr *tupleExpr ) { 1560 1646 std::vector< AlternativeFinder > subExprAlternatives; 1561 findSubExprs( tupleExpr->get_exprs().begin(), tupleExpr->get_exprs().end(),1647 altFinder.findSubExprs( tupleExpr->get_exprs().begin(), tupleExpr->get_exprs().end(), 1562 1648 back_inserter( subExprAlternatives ) ); 1563 1649 std::vector< AltList > possibilities; … … 1575 1661 } 1576 1662 1577 void AlternativeFinder:: visit( TupleExpr *tupleExpr ) {1663 void AlternativeFinder::Finder::postvisit( TupleExpr *tupleExpr ) { 1578 1664 alternatives.push_back( Alternative( tupleExpr->clone(), env, Cost::zero ) ); 1579 1665 } 1580 1666 1581 void AlternativeFinder:: visit( ImplicitCopyCtorExpr * impCpCtorExpr ) {1667 void AlternativeFinder::Finder::postvisit( ImplicitCopyCtorExpr * impCpCtorExpr ) { 1582 1668 alternatives.push_back( Alternative( impCpCtorExpr->clone(), env, Cost::zero ) ); 1583 1669 } 1584 1670 1585 void AlternativeFinder:: visit( ConstructorExpr * ctorExpr ) {1671 void AlternativeFinder::Finder::postvisit( ConstructorExpr * ctorExpr ) { 1586 1672 AlternativeFinder finder( indexer, env ); 1587 1673 // don't prune here, since it's guaranteed all alternatives will have the same type … … 1593 1679 } 1594 1680 1595 void AlternativeFinder:: visit( TupleIndexExpr *tupleExpr ) {1681 void AlternativeFinder::Finder::postvisit( TupleIndexExpr *tupleExpr ) { 1596 1682 alternatives.push_back( Alternative( tupleExpr->clone(), env, Cost::zero ) ); 1597 1683 } 1598 1684 1599 void AlternativeFinder:: visit( TupleAssignExpr *tupleAssignExpr ) {1685 void AlternativeFinder::Finder::postvisit( TupleAssignExpr *tupleAssignExpr ) { 1600 1686 alternatives.push_back( Alternative( tupleAssignExpr->clone(), env, Cost::zero ) ); 1601 1687 } 1602 1688 1603 void AlternativeFinder:: visit( UniqueExpr *unqExpr ) {1689 void AlternativeFinder::Finder::postvisit( UniqueExpr *unqExpr ) { 1604 1690 AlternativeFinder finder( indexer, env ); 1605 1691 finder.findWithAdjustment( unqExpr->get_expr() ); … … 1611 1697 } 1612 1698 1613 void AlternativeFinder:: visit( StmtExpr *stmtExpr ) {1699 void AlternativeFinder::Finder::postvisit( StmtExpr *stmtExpr ) { 1614 1700 StmtExpr * newStmtExpr = stmtExpr->clone(); 1615 1701 ResolvExpr::resolveStmtExpr( newStmtExpr, indexer ); … … 1618 1704 } 1619 1705 1620 void AlternativeFinder:: visit( UntypedInitExpr *initExpr ) {1706 void AlternativeFinder::Finder::postvisit( UntypedInitExpr *initExpr ) { 1621 1707 // handle each option like a cast 1622 1708 AltList candidates; 1623 PRINT( std::cerr << "untyped init expr: " << initExpr << std::endl; ) 1709 PRINT( 1710 std::cerr << "untyped init expr: " << initExpr << std::endl; 1711 ) 1624 1712 // O(N^2) checks of d-types with e-types 1625 1713 for ( InitAlternative & initAlt : initExpr->get_initAlts() ) { … … 1632 1720 AlternativeFinder finder( indexer, env ); 1633 1721 finder.targetType = toType; 1634 finder.findWithAdjustment( initExpr-> get_expr());1722 finder.findWithAdjustment( initExpr->expr ); 1635 1723 for ( Alternative & alt : finder.get_alternatives() ) { 1636 1724 TypeEnvironment newEnv( alt.env ); 1637 1725 AssertionSet needAssertions, haveAssertions; 1638 1726 OpenVarSet openVars; // find things in env that don't have a "representative type" and claim those are open vars? 1639 PRINT( std::cerr << " @ " << toType << " " << initAlt.designation << std::endl; ) 1727 PRINT( 1728 std::cerr << " @ " << toType << " " << initAlt.designation << std::endl; 1729 ) 1640 1730 // It's possible that a cast can throw away some values in a multiply-valued expression. (An example is a 1641 1731 // cast-to-void, which casts from one value to zero.) Figure out the prefix of the subexpression results 1642 1732 // that are cast directly. The candidate is invalid if it has fewer results than there are types to cast 1643 1733 // to. 1644 int discardedValues = alt.expr-> get_result()->size() - toType->size();1734 int discardedValues = alt.expr->result->size() - toType->size(); 1645 1735 if ( discardedValues < 0 ) continue; 1646 1736 // xxx - may need to go into tuple types and extract relevant types and use unifyList. Note that currently, this does not 1647 1737 // allow casting a tuple to an atomic type (e.g. (int)([1, 2, 3])) 1648 1738 // unification run for side-effects 1649 unify( toType, alt.expr-> get_result(), newEnv, needAssertions, haveAssertions, openVars, indexer ); // xxx - do some inspecting on this line... why isn't result bound to initAlt.type??1650 1651 Cost thisCost = castCost( alt.expr-> get_result(), toType, indexer, newEnv );1739 unify( toType, alt.expr->result, newEnv, needAssertions, haveAssertions, openVars, indexer ); // xxx - do some inspecting on this line... why isn't result bound to initAlt.type?? 1740 1741 Cost thisCost = castCost( alt.expr->result, toType, indexer, newEnv ); 1652 1742 if ( thisCost != Cost::infinity ) { 1653 1743 // count one safe conversion for each value that is thrown away 1654 1744 thisCost.incSafe( discardedValues ); 1655 Alternative newAlt( new InitExpr( restructureCast( alt.expr->clone(), toType ), initAlt.designation->clone() ), newEnv, alt.cost, thisCost );1745 Alternative newAlt( new InitExpr( restructureCast( alt.expr->clone(), toType, true ), initAlt.designation->clone() ), newEnv, alt.cost, thisCost ); 1656 1746 inferParameters( needAssertions, haveAssertions, newAlt, openVars, back_inserter( candidates ) ); 1657 1747 } … … 1666 1756 findMinCost( minArgCost.begin(), minArgCost.end(), std::back_inserter( alternatives ) ); 1667 1757 } 1758 1759 void AlternativeFinder::Finder::postvisit( InitExpr * ) { 1760 assertf( false, "AlternativeFinder should never see a resolved InitExpr." ); 1761 } 1762 1763 void AlternativeFinder::Finder::postvisit( DeletedExpr * ) { 1764 assertf( false, "AlternativeFinder should never see a DeletedExpr." ); 1765 } 1766 1767 void AlternativeFinder::Finder::postvisit( GenericExpr * ) { 1768 assertf( false, "_Generic is not yet supported." ); 1769 } 1668 1770 } // namespace ResolvExpr 1669 1771 -
src/ResolvExpr/AlternativeFinder.h
rf9feab8 r90152a4 38 38 using ExplodedArgs = std::vector< std::vector< ExplodedActual > >; 39 39 40 class AlternativeFinder : public Visitor{40 class AlternativeFinder { 41 41 public: 42 42 AlternativeFinder( const SymTab::Indexer &indexer, const TypeEnvironment &env ); … … 94 94 void findSubExprs( InputIterator begin, InputIterator end, OutputIterator out ); 95 95 private: 96 virtual void visit( ApplicationExpr *applicationExpr ); 97 virtual void visit( UntypedExpr *untypedExpr ); 98 virtual void visit( AddressExpr *addressExpr ); 99 virtual void visit( LabelAddressExpr *labelExpr ); 100 virtual void visit( CastExpr *castExpr ); 101 virtual void visit( VirtualCastExpr *castExpr ); 102 virtual void visit( UntypedMemberExpr *memberExpr ); 103 virtual void visit( MemberExpr *memberExpr ); 104 virtual void visit( NameExpr *variableExpr ); 105 virtual void visit( VariableExpr *variableExpr ); 106 virtual void visit( ConstantExpr *constantExpr ); 107 virtual void visit( SizeofExpr *sizeofExpr ); 108 virtual void visit( AlignofExpr *alignofExpr ); 109 virtual void visit( UntypedOffsetofExpr *offsetofExpr ); 110 virtual void visit( OffsetofExpr *offsetofExpr ); 111 virtual void visit( OffsetPackExpr *offsetPackExpr ); 112 virtual void visit( AttrExpr *attrExpr ); 113 virtual void visit( LogicalExpr *logicalExpr ); 114 virtual void visit( ConditionalExpr *conditionalExpr ); 115 virtual void visit( CommaExpr *commaExpr ); 116 virtual void visit( ImplicitCopyCtorExpr * impCpCtorExpr ); 117 virtual void visit( ConstructorExpr * ctorExpr ); 118 virtual void visit( RangeExpr * rangeExpr ); 119 virtual void visit( UntypedTupleExpr *tupleExpr ); 120 virtual void visit( TupleExpr *tupleExpr ); 121 virtual void visit( TupleIndexExpr *tupleExpr ); 122 virtual void visit( TupleAssignExpr *tupleExpr ); 123 virtual void visit( UniqueExpr *unqExpr ); 124 virtual void visit( StmtExpr *stmtExpr ); 125 virtual void visit( UntypedInitExpr *initExpr ); 126 127 /// Adds alternatives for anonymous members 128 void addAnonConversions( const Alternative & alt ); 129 /// Adds alternatives for member expressions, given the aggregate, conversion cost for that aggregate, and name of the member 130 template< typename StructOrUnionType > void addAggMembers( StructOrUnionType *aggInst, Expression *expr, const Cost &newCost, const TypeEnvironment & env, Expression * member ); 131 /// Adds alternatives for member expressions where the left side has tuple type 132 void addTupleMembers( TupleType * tupleType, Expression *expr, const Cost &newCost, const TypeEnvironment & env, Expression * member ); 133 /// Adds alternatives for offsetof expressions, given the base type and name of the member 134 template< typename StructOrUnionType > void addOffsetof( StructOrUnionType *aggInst, const std::string &name ); 135 /// Takes a final result and checks if its assertions can be satisfied 136 template<typename OutputIterator> 137 void validateFunctionAlternative( const Alternative &func, ArgPack& result, const std::vector<ArgPack>& results, OutputIterator out ); 138 /// Finds matching alternatives for a function, given a set of arguments 139 template<typename OutputIterator> 140 void makeFunctionAlternatives( const Alternative &func, FunctionType *funcType, const ExplodedArgs& args, OutputIterator out ); 141 /// Checks if assertion parameters match for a new alternative 142 template< typename OutputIterator > 143 void inferParameters( const AssertionSet &need, AssertionSet &have, const Alternative &newAlt, OpenVarSet &openVars, OutputIterator out ); 144 96 struct Finder; 145 97 const SymTab::Indexer &indexer; 146 98 AltList alternatives; … … 174 126 void printAlts( const AltList &list, std::ostream &os, unsigned int indentAmt = 0 ); 175 127 128 /// Adds type variables to the open variable set and marks their assertions 129 void makeUnifiableVars( Type *type, OpenVarSet &unifiableVars, AssertionSet &needAssertions ); 130 176 131 template< typename InputIterator > 177 132 void simpleCombineEnvironments( InputIterator begin, InputIterator end, TypeEnvironment &result ) { -
src/ResolvExpr/CastCost.cc
rf9feab8 r90152a4 31 31 32 32 namespace ResolvExpr { 33 classCastCost : public ConversionCost {33 struct CastCost : public ConversionCost { 34 34 public: 35 CastCost( Type *dest, const SymTab::Indexer &indexer, const TypeEnvironment &env );35 CastCost( Type *dest, const SymTab::Indexer &indexer, const TypeEnvironment &env, CostFunction costFunc ); 36 36 37 virtual void visit( BasicType *basicType ); 38 virtual void visit( PointerType *pointerType ); 37 using ConversionCost::previsit; 38 using ConversionCost::postvisit; 39 void postvisit( BasicType * basicType ); 40 void postvisit( PointerType * pointerType ); 39 41 }; 40 42 41 43 Cost castCost( Type *src, Type *dest, const SymTab::Indexer &indexer, const TypeEnvironment &env ) { 42 44 if ( TypeInstType *destAsTypeInst = dynamic_cast< TypeInstType* >( dest ) ) { 43 EqvClass eqvClass; 44 NamedTypeDecl *namedType; 45 if ( env.lookup( destAsTypeInst->get_name(), eqvClass ) ) { 46 if ( eqvClass.type ) { 47 return castCost( src, eqvClass.type, indexer, env ); 45 if ( const EqvClass* eqvClass = env.lookup( destAsTypeInst->get_name() ) ) { 46 if ( eqvClass->type ) { 47 return castCost( src, eqvClass->type, indexer, env ); 48 48 } else { 49 49 return Cost::infinity; 50 50 } 51 } else if ( ( namedType = indexer.lookupType( destAsTypeInst->get_name()) ) ) {51 } else if ( NamedTypeDecl *namedType = indexer.lookupType( destAsTypeInst->get_name() ) ) { 52 52 // all typedefs should be gone by this point 53 53 TypeDecl *type = strict_dynamic_cast< TypeDecl* >( namedType ); 54 if ( type-> get_base()) {55 return castCost( src, type-> get_base(), indexer, env ) + Cost::safe;54 if ( type->base ) { 55 return castCost( src, type->base, indexer, env ) + Cost::safe; 56 56 } // if 57 57 } // if … … 74 74 } else if ( ReferenceType * refType = dynamic_cast< ReferenceType * > ( dest ) ) { 75 75 PRINT( std::cerr << "conversionCost: dest is reference" << std::endl; ) 76 return convertToReferenceCost( src, refType, indexer, env, [](Type * t1, Type * t2, const TypeEnvironment & env, const SymTab::Indexer & indexer) {76 return convertToReferenceCost( src, refType, indexer, env, [](Type * t1, Type * t2, const SymTab::Indexer & indexer, const TypeEnvironment & env ) { 77 77 return ptrsCastable( t1, t2, env, indexer ); 78 78 }); 79 79 } else { 80 CastCost converter( dest, indexer, env);80 PassVisitor<CastCost> converter( dest, indexer, env, castCost ); 81 81 src->accept( converter ); 82 if ( converter. get_cost() == Cost::infinity ) {82 if ( converter.pass.get_cost() == Cost::infinity ) { 83 83 return Cost::infinity; 84 84 } else { 85 85 // xxx - why are we adding cost 0 here? 86 return converter. get_cost() + Cost::zero;86 return converter.pass.get_cost() + Cost::zero; 87 87 } // if 88 88 } // if 89 89 } 90 90 91 CastCost::CastCost( Type *dest, const SymTab::Indexer &indexer, const TypeEnvironment &env )92 : ConversionCost( dest, indexer, env ) {91 CastCost::CastCost( Type *dest, const SymTab::Indexer &indexer, const TypeEnvironment &env, CostFunction costFunc ) 92 : ConversionCost( dest, indexer, env, costFunc ) { 93 93 } 94 94 95 void CastCost:: visit( BasicType *basicType ) {95 void CastCost::postvisit( BasicType *basicType ) { 96 96 PointerType *destAsPointer = dynamic_cast< PointerType* >( dest ); 97 97 if ( destAsPointer && basicType->isInteger() ) { … … 103 103 } 104 104 105 void CastCost:: visit( PointerType *pointerType ) {105 void CastCost::postvisit( PointerType *pointerType ) { 106 106 if ( PointerType *destAsPtr = dynamic_cast< PointerType* >( dest ) ) { 107 if ( pointerType->get_qualifiers() <= destAsPtr->get_qualifiers() && typesCompatibleIgnoreQualifiers( pointerType-> get_base(), destAsPtr->get_base(), indexer, env ) ) {107 if ( pointerType->get_qualifiers() <= destAsPtr->get_qualifiers() && typesCompatibleIgnoreQualifiers( pointerType->base, destAsPtr->base, indexer, env ) ) { 108 108 cost = Cost::safe; 109 109 } else { 110 110 TypeEnvironment newEnv( env ); 111 newEnv.add( pointerType-> get_forall());112 newEnv.add( pointerType-> get_base()->get_forall());113 int castResult = ptrsCastable( pointerType-> get_base(), destAsPtr->get_base(), newEnv, indexer );111 newEnv.add( pointerType->forall ); 112 newEnv.add( pointerType->base->forall ); 113 int castResult = ptrsCastable( pointerType->base, destAsPtr->base, newEnv, indexer ); 114 114 if ( castResult > 0 ) { 115 115 cost = Cost::safe; -
src/ResolvExpr/CommonType.cc
rf9feab8 r90152a4 18 18 #include <utility> // for pair 19 19 20 #include "Common/PassVisitor.h" 20 21 #include "ResolvExpr/TypeEnvironment.h" // for OpenVarSet, AssertionSet 21 22 #include "SymTab/Indexer.h" // for Indexer … … 23 24 #include "SynTree/Type.h" // for BasicType, BasicType::Kind::... 24 25 #include "SynTree/Visitor.h" // for Visitor 25 #include "Unify.h" // for unifyExact, bindVar,WidenMode26 #include "Unify.h" // for unifyExact, WidenMode 26 27 #include "typeops.h" // for isFtype 27 28 28 29 // #define DEBUG 30 #ifdef DEBUG 31 #define PRINT(x) x 32 #else 33 #define PRINT(x) 34 #endif 29 35 30 36 namespace ResolvExpr { 31 class CommonType : public Visitor { 32 public: 37 struct CommonType : public WithShortCircuiting { 33 38 CommonType( Type *type2, bool widenFirst, bool widenSecond, const SymTab::Indexer &indexer, TypeEnvironment &env, const OpenVarSet &openVars ); 34 39 Type *get_result() const { return result; } 40 41 void previsit( BaseSyntaxNode * ) { visit_children = false; } 42 43 void postvisit( VoidType * voidType ); 44 void postvisit( BasicType * basicType ); 45 void postvisit( PointerType * pointerType ); 46 void postvisit( ArrayType * arrayType ); 47 void postvisit( ReferenceType * refType ); 48 void postvisit( FunctionType * functionType ); 49 void postvisit( StructInstType * aggregateUseType ); 50 void postvisit( UnionInstType * aggregateUseType ); 51 void postvisit( EnumInstType * aggregateUseType ); 52 void postvisit( TraitInstType * aggregateUseType ); 53 void postvisit( TypeInstType * aggregateUseType ); 54 void postvisit( TupleType * tupleType ); 55 void postvisit( VarArgsType * varArgsType ); 56 void postvisit( ZeroType * zeroType ); 57 void postvisit( OneType * oneType ); 58 35 59 private: 36 virtual void visit( VoidType *voidType );37 virtual void visit( BasicType *basicType );38 virtual void visit( PointerType *pointerType );39 virtual void visit( ArrayType *arrayType );40 virtual void visit( ReferenceType *refType );41 virtual void visit( FunctionType *functionType );42 virtual void visit( StructInstType *aggregateUseType );43 virtual void visit( UnionInstType *aggregateUseType );44 virtual void visit( EnumInstType *aggregateUseType );45 virtual void visit( TraitInstType *aggregateUseType );46 virtual void visit( TypeInstType *aggregateUseType );47 virtual void visit( TupleType *tupleType );48 virtual void visit( VarArgsType *varArgsType );49 virtual void visit( ZeroType *zeroType );50 virtual void visit( OneType *oneType );51 52 60 template< typename Pointer > void getCommonWithVoidPointer( Pointer* voidPointer, Pointer* otherPointer ); 53 61 template< typename RefType > void handleRefType( RefType *inst, Type *other ); … … 67 75 // need unify to bind type variables 68 76 if ( unify( t1, t2, env, have, need, newOpen, indexer, common ) ) { 69 // std::cerr << "unify success: " << widenFirst << " " << widenSecond << std::endl; 77 PRINT( 78 std::cerr << "unify success: " << widenFirst << " " << widenSecond << std::endl; 79 ) 70 80 if ( (widenFirst || t2->get_qualifiers() <= t1->get_qualifiers()) && (widenSecond || t1->get_qualifiers() <= t2->get_qualifiers()) ) { 71 // std::cerr << "widen okay" << std::endl; 81 PRINT( 82 std::cerr << "widen okay" << std::endl; 83 ) 72 84 common->get_qualifiers() |= t1->get_qualifiers(); 73 85 common->get_qualifiers() |= t2->get_qualifiers(); … … 75 87 } 76 88 } 77 // std::cerr << "exact unify failed: " << t1 << " " << t2 << std::endl; 89 PRINT( 90 std::cerr << "exact unify failed: " << t1 << " " << t2 << std::endl; 91 ) 78 92 return nullptr; 79 93 } 80 94 81 95 Type *commonType( Type *type1, Type *type2, bool widenFirst, bool widenSecond, const SymTab::Indexer &indexer, TypeEnvironment &env, const OpenVarSet &openVars ) { 82 CommonTypevisitor( type2, widenFirst, widenSecond, indexer, env, openVars );96 PassVisitor<CommonType> visitor( type2, widenFirst, widenSecond, indexer, env, openVars ); 83 97 84 98 int depth1 = type1->referenceDepth(); … … 87 101 int diff = depth1-depth2; 88 102 // TODO: should it be possible for commonType to generate complicated conversions? I would argue no, only conversions that involve types of the same reference level or a difference of 1 should be allowed. 89 if ( diff > 1 || diff < -1 ) return nullptr;103 // if ( diff > 1 || diff < -1 ) return nullptr; 90 104 91 105 // special case where one type has a reference depth of 1 larger than the other 92 106 if ( diff > 0 || diff < 0 ) { 107 PRINT( 108 std::cerr << "reference depth diff: " << diff << std::endl; 109 ) 93 110 Type * result = nullptr; 94 if ( ReferenceType * ref1 = dynamic_cast< ReferenceType * >( type1 ) ) { 95 // formal is reference, so result should be reference 111 ReferenceType * ref1 = dynamic_cast< ReferenceType * >( type1 ); 112 ReferenceType * ref2 = dynamic_cast< ReferenceType * >( type2 ); 113 if ( diff > 0 ) { 114 // deeper on the left 115 assert( ref1 ); 96 116 result = handleReference( ref1->base, type2, widenFirst, widenSecond, indexer, env, openVars ); 97 if ( result ) result = new ReferenceType( ref1->get_qualifiers(), result );98 117 } else { 99 // formal is value, so result should be value100 ReferenceType * ref2 = strict_dynamic_cast< ReferenceType * > ( type2 );118 // deeper on the right 119 assert( ref2 ); 101 120 result = handleReference( type1, ref2->base, widenFirst, widenSecond, indexer, env, openVars ); 102 121 } 103 // std::cerr << "common type of reference [" << type1 << "] and [" << type2 << "] is [" << result << "]" << std::endl; 122 if ( result && ref1 ) { 123 // formal is reference, so result should be reference 124 PRINT( 125 std::cerr << "formal is reference; result should be reference" << std::endl; 126 ) 127 result = new ReferenceType( ref1->get_qualifiers(), result ); 128 } 129 PRINT( 130 std::cerr << "common type of reference [" << type1 << "] and [" << type2 << "] is [" << result << "]" << std::endl; 131 ) 104 132 return result; 105 133 } … … 108 136 109 137 type1->accept( visitor ); 110 Type *result = visitor. get_result();138 Type *result = visitor.pass.get_result(); 111 139 if ( ! result ) { 112 140 // this appears to be handling for opaque type declarations … … 148 176 } 149 177 150 static const BasicType::Kind combinedType[ BasicType::NUMBER_OF_BASIC_TYPES][ BasicType::NUMBER_OF_BASIC_TYPES ] =178 static const BasicType::Kind combinedType[][ BasicType::NUMBER_OF_BASIC_TYPES ] = 151 179 { 152 /* Bool Char SignedChar UnsignedChar ShortSignedInt ShortUnsignedInt SignedInt UnsignedInt LongSignedInt LongUnsignedInt LongLongSignedInt LongLongUnsignedInt Float Double LongDouble FloatComplex DoubleComplex LongDoubleComplex FloatImaginary DoubleImaginary LongDoubleImaginary SignedInt128 UnsignedInt128 */ 153 /* Bool */ { BasicType::Bool, BasicType::Char, BasicType::SignedChar, BasicType::UnsignedChar, BasicType::ShortSignedInt, BasicType::ShortUnsignedInt, BasicType::SignedInt, BasicType::UnsignedInt, BasicType::LongSignedInt, BasicType::LongUnsignedInt, BasicType::LongLongSignedInt, BasicType::LongLongUnsignedInt, BasicType::Float, BasicType::Double, BasicType::LongDouble, BasicType::FloatComplex, BasicType::DoubleComplex, BasicType::LongDoubleComplex, BasicType::FloatComplex, BasicType::DoubleComplex, BasicType::LongDoubleComplex, BasicType::SignedInt128, BasicType::UnsignedInt128, }, 154 /* Char */ { BasicType::Char, BasicType::Char, BasicType::UnsignedChar, BasicType::UnsignedChar, BasicType::ShortSignedInt, BasicType::ShortUnsignedInt, BasicType::SignedInt, BasicType::UnsignedInt, BasicType::LongSignedInt, BasicType::LongUnsignedInt, BasicType::LongLongSignedInt, BasicType::LongLongUnsignedInt, BasicType::Float, BasicType::Double, BasicType::LongDouble, BasicType::FloatComplex, BasicType::DoubleComplex, BasicType::LongDoubleComplex, BasicType::FloatComplex, BasicType::DoubleComplex, BasicType::LongDoubleComplex, BasicType::SignedInt128, BasicType::UnsignedInt128, }, 155 /* SignedChar */ { BasicType::SignedChar, BasicType::UnsignedChar, BasicType::SignedChar, BasicType::UnsignedChar, BasicType::ShortSignedInt, BasicType::ShortUnsignedInt, BasicType::SignedInt, BasicType::UnsignedInt, BasicType::LongSignedInt, BasicType::LongUnsignedInt, BasicType::LongLongSignedInt, BasicType::LongLongUnsignedInt, BasicType::Float, BasicType::Double, BasicType::LongDouble, BasicType::FloatComplex, BasicType::DoubleComplex, BasicType::LongDoubleComplex, BasicType::FloatComplex, BasicType::DoubleComplex, BasicType::LongDoubleComplex, BasicType::SignedInt128, BasicType::UnsignedInt128, }, 156 /* UnsignedChar */ { BasicType::UnsignedChar, BasicType::UnsignedChar, BasicType::UnsignedChar, BasicType::UnsignedChar, BasicType::ShortSignedInt, BasicType::ShortUnsignedInt, BasicType::SignedInt, BasicType::UnsignedInt, BasicType::LongSignedInt, BasicType::LongUnsignedInt, BasicType::LongLongSignedInt, BasicType::LongLongUnsignedInt, BasicType::Float, BasicType::Double, BasicType::LongDouble, BasicType::FloatComplex, BasicType::DoubleComplex, BasicType::LongDoubleComplex, BasicType::FloatComplex, BasicType::DoubleComplex, BasicType::LongDoubleComplex, BasicType::SignedInt128, BasicType::UnsignedInt128, }, 157 /* ShortSignedInt */ { BasicType::ShortSignedInt, BasicType::ShortSignedInt, BasicType::ShortSignedInt, BasicType::ShortSignedInt, BasicType::ShortSignedInt, BasicType::ShortUnsignedInt, BasicType::SignedInt, BasicType::UnsignedInt, BasicType::LongSignedInt, BasicType::LongUnsignedInt, BasicType::LongLongSignedInt, BasicType::LongLongUnsignedInt, BasicType::Float, BasicType::Double, BasicType::LongDouble, BasicType::FloatComplex, BasicType::DoubleComplex, BasicType::LongDoubleComplex, BasicType::FloatComplex, BasicType::DoubleComplex, BasicType::LongDoubleComplex, BasicType::SignedInt128, BasicType::UnsignedInt128, }, 158 /* ShortUnsignedInt */ { BasicType::ShortUnsignedInt, BasicType::ShortUnsignedInt, BasicType::ShortUnsignedInt, BasicType::ShortUnsignedInt, BasicType::ShortUnsignedInt, BasicType::ShortUnsignedInt, BasicType::SignedInt, BasicType::UnsignedInt, BasicType::LongSignedInt, BasicType::LongUnsignedInt, BasicType::LongLongSignedInt, BasicType::LongLongUnsignedInt, BasicType::Float, BasicType::Double, BasicType::LongDouble, BasicType::FloatComplex, BasicType::DoubleComplex, BasicType::LongDoubleComplex, BasicType::FloatComplex, BasicType::DoubleComplex, BasicType::LongDoubleComplex, BasicType::SignedInt128, BasicType::UnsignedInt128, }, 159 /* SignedInt */ { BasicType::SignedInt, BasicType::SignedInt, BasicType::SignedInt, BasicType::SignedInt, BasicType::SignedInt, BasicType::SignedInt, BasicType::SignedInt, BasicType::UnsignedInt, BasicType::LongSignedInt, BasicType::LongUnsignedInt, BasicType::LongLongSignedInt, BasicType::LongLongUnsignedInt, BasicType::Float, BasicType::Double, BasicType::LongDouble, BasicType::FloatComplex, BasicType::DoubleComplex, BasicType::LongDoubleComplex, BasicType::FloatComplex, BasicType::DoubleComplex, BasicType::LongDoubleComplex, BasicType::SignedInt128, BasicType::UnsignedInt128, }, 160 /* UnsignedInt */ { BasicType::UnsignedInt, BasicType::UnsignedInt, BasicType::UnsignedInt, BasicType::UnsignedInt, BasicType::UnsignedInt, BasicType::UnsignedInt, BasicType::UnsignedInt, BasicType::UnsignedInt, BasicType::LongUnsignedInt, BasicType::LongUnsignedInt, BasicType::LongLongSignedInt, BasicType::LongLongUnsignedInt, BasicType::Float, BasicType::Double, BasicType::LongDouble, BasicType::FloatComplex, BasicType::DoubleComplex, BasicType::LongDoubleComplex, BasicType::FloatComplex, BasicType::DoubleComplex, BasicType::LongDoubleComplex, BasicType::SignedInt128, BasicType::UnsignedInt128, }, 161 /* LongSignedInt */ { BasicType::LongSignedInt, BasicType::LongSignedInt, BasicType::LongSignedInt, BasicType::LongSignedInt, BasicType::LongSignedInt, BasicType::LongSignedInt, BasicType::LongSignedInt, BasicType::LongUnsignedInt, BasicType::LongSignedInt, BasicType::LongUnsignedInt, BasicType::LongLongSignedInt, BasicType::LongLongUnsignedInt, BasicType::Float, BasicType::Double, BasicType::LongDouble, BasicType::FloatComplex, BasicType::DoubleComplex, BasicType::LongDoubleComplex, BasicType::FloatComplex, BasicType::DoubleComplex, BasicType::LongDoubleComplex, BasicType::SignedInt128, BasicType::UnsignedInt128, }, 162 /* LongUnsignedInt */ { BasicType::LongUnsignedInt, BasicType::LongUnsignedInt, BasicType::LongUnsignedInt, BasicType::LongUnsignedInt, BasicType::LongUnsignedInt, BasicType::LongUnsignedInt, BasicType::LongUnsignedInt, BasicType::LongUnsignedInt, BasicType::LongUnsignedInt, BasicType::LongUnsignedInt, BasicType::LongLongSignedInt, BasicType::LongLongUnsignedInt, BasicType::Float, BasicType::Double, BasicType::LongDouble, BasicType::FloatComplex, BasicType::DoubleComplex, BasicType::LongDoubleComplex, BasicType::FloatComplex, BasicType::DoubleComplex, BasicType::LongDoubleComplex, BasicType::SignedInt128, BasicType::UnsignedInt128, }, 163 /* LongLongSignedInt */ { BasicType::LongLongSignedInt, BasicType::LongLongSignedInt, BasicType::LongLongSignedInt, BasicType::LongLongSignedInt, BasicType::LongLongSignedInt, BasicType::LongLongSignedInt, BasicType::LongLongSignedInt, BasicType::LongLongSignedInt, BasicType::LongLongSignedInt, BasicType::LongLongSignedInt, BasicType::LongLongSignedInt, BasicType::LongLongUnsignedInt, BasicType::Float, BasicType::Double, BasicType::LongDouble, BasicType::FloatComplex, BasicType::DoubleComplex, BasicType::LongDoubleComplex, BasicType::FloatComplex, BasicType::DoubleComplex, BasicType::LongDoubleComplex, BasicType::SignedInt128, BasicType::UnsignedInt128, }, 164 /* LongLongUnsignedInt */ { BasicType::LongLongUnsignedInt, BasicType::LongLongUnsignedInt, BasicType::LongLongUnsignedInt, BasicType::LongLongUnsignedInt, BasicType::LongLongUnsignedInt, BasicType::LongLongUnsignedInt, BasicType::LongLongUnsignedInt, BasicType::LongLongUnsignedInt, BasicType::LongLongUnsignedInt, BasicType::LongLongUnsignedInt, BasicType::LongLongUnsignedInt, BasicType::LongLongUnsignedInt, BasicType::Float, BasicType::Double, BasicType::LongDouble, BasicType::FloatComplex, BasicType::DoubleComplex, BasicType::LongDoubleComplex, BasicType::FloatComplex, BasicType::DoubleComplex, BasicType::LongDoubleComplex, BasicType::SignedInt128, BasicType::UnsignedInt128, }, 165 /* Float */ { BasicType::Float, BasicType::Float, BasicType::Float, BasicType::Float, BasicType::Float, BasicType::Float, BasicType::Float, BasicType::Float, BasicType::Float, BasicType::Float, BasicType::Float, BasicType::Float, BasicType::Float, BasicType::Double, BasicType::LongDouble, BasicType::FloatComplex, BasicType::DoubleComplex, BasicType::LongDoubleComplex, BasicType::FloatComplex, BasicType::DoubleComplex, BasicType::LongDoubleComplex, BasicType::Float, BasicType::Float, }, 166 /* Double */ { BasicType::Double, BasicType::Double, BasicType::Double, BasicType::Double, BasicType::Double, BasicType::Double, BasicType::Double, BasicType::Double, BasicType::Double, BasicType::Double, BasicType::Double, BasicType::Double, BasicType::Double, BasicType::Double, BasicType::LongDouble, BasicType::DoubleComplex, BasicType::DoubleComplex, BasicType::LongDoubleComplex, BasicType::DoubleComplex, BasicType::DoubleComplex, BasicType::LongDoubleComplex, BasicType::Double, BasicType::Double, }, 167 /* LongDouble */ { BasicType::LongDouble, BasicType::LongDouble, BasicType::LongDouble, BasicType::LongDouble, BasicType::LongDouble, BasicType::LongDouble, BasicType::LongDouble, BasicType::LongDouble, BasicType::LongDouble, BasicType::LongDouble, BasicType::LongDouble, BasicType::LongDouble, BasicType::LongDouble, BasicType::LongDouble, BasicType::LongDouble, BasicType::LongDoubleComplex, BasicType::LongDoubleComplex, BasicType::LongDoubleComplex, BasicType::LongDoubleComplex, BasicType::LongDoubleComplex, BasicType::LongDoubleComplex, BasicType::LongDouble, BasicType::LongDouble, }, 168 /* FloatComplex */ { BasicType::FloatComplex, BasicType::FloatComplex, BasicType::FloatComplex, BasicType::FloatComplex, BasicType::FloatComplex, BasicType::FloatComplex, BasicType::FloatComplex, BasicType::FloatComplex, BasicType::FloatComplex, BasicType::FloatComplex, BasicType::FloatComplex, BasicType::FloatComplex, BasicType::FloatComplex, BasicType::DoubleComplex, BasicType::LongDoubleComplex, BasicType::FloatComplex, BasicType::DoubleComplex, BasicType::LongDoubleComplex, BasicType::FloatComplex, BasicType::DoubleComplex, BasicType::LongDoubleComplex, BasicType::FloatComplex, BasicType::FloatComplex, }, 169 /* DoubleComplex */ { BasicType::DoubleComplex, BasicType::DoubleComplex, BasicType::DoubleComplex, BasicType::DoubleComplex, BasicType::DoubleComplex, BasicType::DoubleComplex, BasicType::DoubleComplex, BasicType::DoubleComplex, BasicType::DoubleComplex, BasicType::DoubleComplex, BasicType::DoubleComplex, BasicType::DoubleComplex, BasicType::DoubleComplex, BasicType::DoubleComplex, BasicType::LongDoubleComplex, BasicType::DoubleComplex, BasicType::DoubleComplex, BasicType::LongDoubleComplex, BasicType::DoubleComplex, BasicType::DoubleComplex, BasicType::LongDoubleComplex, BasicType::DoubleComplex, BasicType::DoubleComplex, }, 170 /* LongDoubleComplex */ { BasicType::LongDoubleComplex, BasicType::LongDoubleComplex, BasicType::LongDoubleComplex, BasicType::LongDoubleComplex, BasicType::LongDoubleComplex, BasicType::LongDoubleComplex, BasicType::LongDoubleComplex, BasicType::LongDoubleComplex, BasicType::LongDoubleComplex, BasicType::LongDoubleComplex, BasicType::LongDoubleComplex, BasicType::LongDoubleComplex, BasicType::LongDoubleComplex, BasicType::LongDoubleComplex, BasicType::LongDoubleComplex, BasicType::LongDoubleComplex, BasicType::LongDoubleComplex, BasicType::LongDoubleComplex, BasicType::LongDoubleComplex, BasicType::LongDoubleComplex, BasicType::LongDoubleComplex, BasicType::LongDoubleComplex, BasicType::LongDoubleComplex, }, 171 /* FloatImaginary */ { BasicType::FloatComplex, BasicType::FloatComplex, BasicType::FloatComplex, BasicType::FloatComplex, BasicType::FloatComplex, BasicType::FloatComplex, BasicType::FloatComplex, BasicType::FloatComplex, BasicType::FloatComplex, BasicType::FloatComplex, BasicType::FloatComplex, BasicType::FloatComplex, BasicType::FloatComplex, BasicType::DoubleComplex, BasicType::LongDoubleComplex, BasicType::FloatComplex, BasicType::DoubleComplex, BasicType::LongDoubleComplex, BasicType::FloatImaginary, BasicType::DoubleImaginary, BasicType::LongDoubleImaginary, BasicType::FloatImaginary, BasicType::FloatImaginary, }, 172 /* DoubleImaginary */ { BasicType::DoubleComplex, BasicType::DoubleComplex, BasicType::DoubleComplex, BasicType::DoubleComplex, BasicType::DoubleComplex, BasicType::DoubleComplex, BasicType::DoubleComplex, BasicType::DoubleComplex, BasicType::DoubleComplex, BasicType::DoubleComplex, BasicType::DoubleComplex, BasicType::DoubleComplex, BasicType::DoubleComplex, BasicType::DoubleComplex, BasicType::LongDoubleComplex, BasicType::DoubleComplex, BasicType::DoubleComplex, BasicType::LongDoubleComplex, BasicType::DoubleImaginary, BasicType::DoubleImaginary, BasicType::LongDoubleImaginary, BasicType::DoubleImaginary, BasicType::DoubleImaginary, }, 173 /* LongDoubleImaginary */ { BasicType::LongDoubleComplex, BasicType::LongDoubleComplex, BasicType::LongDoubleComplex, BasicType::LongDoubleComplex, BasicType::LongDoubleComplex, BasicType::LongDoubleComplex, BasicType::LongDoubleComplex, BasicType::LongDoubleComplex, BasicType::LongDoubleComplex, BasicType::LongDoubleComplex, BasicType::LongDoubleComplex, BasicType::LongDoubleComplex, BasicType::LongDoubleComplex, BasicType::LongDoubleComplex, BasicType::LongDoubleComplex, BasicType::LongDoubleComplex, BasicType::LongDoubleComplex, BasicType::LongDoubleComplex, BasicType::LongDoubleImaginary, BasicType::LongDoubleImaginary, BasicType::LongDoubleImaginary }, 174 /* SignedInt128 */ { BasicType::SignedInt128, BasicType::SignedInt128, BasicType::SignedInt128, BasicType::SignedInt128, BasicType::SignedInt128, BasicType::SignedInt128, BasicType::SignedInt128, BasicType::SignedInt128, BasicType::SignedInt128, BasicType::SignedInt128, BasicType::SignedInt128, BasicType::SignedInt128, BasicType::Float, BasicType::Double, BasicType::LongDouble, BasicType::FloatComplex, BasicType::DoubleComplex, BasicType::LongDoubleComplex, BasicType::FloatComplex, BasicType::DoubleComplex, BasicType::LongDoubleComplex, BasicType::SignedInt128, BasicType::UnsignedInt128, }, 175 /* UnsignedInt128 */ { BasicType::UnsignedInt128, BasicType::UnsignedInt128, BasicType::UnsignedInt128, BasicType::UnsignedInt128, BasicType::UnsignedInt128, BasicType::UnsignedInt128, BasicType::UnsignedInt128, BasicType::UnsignedInt128, BasicType::UnsignedInt128, BasicType::UnsignedInt128, BasicType::UnsignedInt128, BasicType::UnsignedInt128, BasicType::Float, BasicType::Double, BasicType::LongDouble, BasicType::FloatComplex, BasicType::DoubleComplex, BasicType::LongDoubleComplex, BasicType::FloatComplex, BasicType::DoubleComplex, BasicType::LongDoubleComplex, BasicType::UnsignedInt128, BasicType::UnsignedInt128, }, 180 /* Bool Char SignedChar UnsignedChar ShortSignedInt ShortUnsignedInt SignedInt UnsignedInt LongSignedInt LongUnsignedInt LongLongSignedInt LongLongUnsignedInt Float Double LongDouble FloatComplex DoubleComplex LongDoubleComplex FloatImaginary DoubleImaginary LongDoubleImaginary SignedInt128 UnsignedInt128 Float80 Float128 */ 181 /* Bool */ { BasicType::Bool, BasicType::Char, BasicType::SignedChar, BasicType::UnsignedChar, BasicType::ShortSignedInt, BasicType::ShortUnsignedInt, BasicType::SignedInt, BasicType::UnsignedInt, BasicType::LongSignedInt, BasicType::LongUnsignedInt, BasicType::LongLongSignedInt, BasicType::LongLongUnsignedInt, BasicType::Float, BasicType::Double, BasicType::LongDouble, BasicType::FloatComplex, BasicType::DoubleComplex, BasicType::LongDoubleComplex, BasicType::FloatComplex, BasicType::DoubleComplex, BasicType::LongDoubleComplex, BasicType::SignedInt128, BasicType::UnsignedInt128, BasicType::Float80, BasicType::Float128 }, 182 /* Char */ { BasicType::Char, BasicType::Char, BasicType::UnsignedChar, BasicType::UnsignedChar, BasicType::ShortSignedInt, BasicType::ShortUnsignedInt, BasicType::SignedInt, BasicType::UnsignedInt, BasicType::LongSignedInt, BasicType::LongUnsignedInt, BasicType::LongLongSignedInt, BasicType::LongLongUnsignedInt, BasicType::Float, BasicType::Double, BasicType::LongDouble, BasicType::FloatComplex, BasicType::DoubleComplex, BasicType::LongDoubleComplex, BasicType::FloatComplex, BasicType::DoubleComplex, BasicType::LongDoubleComplex, BasicType::SignedInt128, BasicType::UnsignedInt128, BasicType::Float80, BasicType::Float128 }, 183 /* SignedChar */ { BasicType::SignedChar, BasicType::UnsignedChar, BasicType::SignedChar, BasicType::UnsignedChar, BasicType::ShortSignedInt, BasicType::ShortUnsignedInt, BasicType::SignedInt, BasicType::UnsignedInt, BasicType::LongSignedInt, BasicType::LongUnsignedInt, BasicType::LongLongSignedInt, BasicType::LongLongUnsignedInt, BasicType::Float, BasicType::Double, BasicType::LongDouble, BasicType::FloatComplex, BasicType::DoubleComplex, BasicType::LongDoubleComplex, BasicType::FloatComplex, BasicType::DoubleComplex, BasicType::LongDoubleComplex, BasicType::SignedInt128, BasicType::UnsignedInt128, BasicType::Float80, BasicType::Float128 }, 184 /* UnsignedChar */ { BasicType::UnsignedChar, BasicType::UnsignedChar, BasicType::UnsignedChar, BasicType::UnsignedChar, BasicType::ShortSignedInt, BasicType::ShortUnsignedInt, BasicType::SignedInt, BasicType::UnsignedInt, BasicType::LongSignedInt, BasicType::LongUnsignedInt, BasicType::LongLongSignedInt, BasicType::LongLongUnsignedInt, BasicType::Float, BasicType::Double, BasicType::LongDouble, BasicType::FloatComplex, BasicType::DoubleComplex, BasicType::LongDoubleComplex, BasicType::FloatComplex, BasicType::DoubleComplex, BasicType::LongDoubleComplex, BasicType::SignedInt128, BasicType::UnsignedInt128, BasicType::Float80, BasicType::Float128 }, 185 /* ShortSignedInt */ { BasicType::ShortSignedInt, BasicType::ShortSignedInt, BasicType::ShortSignedInt, BasicType::ShortSignedInt, BasicType::ShortSignedInt, BasicType::ShortUnsignedInt, BasicType::SignedInt, BasicType::UnsignedInt, BasicType::LongSignedInt, BasicType::LongUnsignedInt, BasicType::LongLongSignedInt, BasicType::LongLongUnsignedInt, BasicType::Float, BasicType::Double, BasicType::LongDouble, BasicType::FloatComplex, BasicType::DoubleComplex, BasicType::LongDoubleComplex, BasicType::FloatComplex, BasicType::DoubleComplex, BasicType::LongDoubleComplex, BasicType::SignedInt128, BasicType::UnsignedInt128, BasicType::Float80, BasicType::Float128 }, 186 /* ShortUnsignedInt */ { BasicType::ShortUnsignedInt, BasicType::ShortUnsignedInt, BasicType::ShortUnsignedInt, BasicType::ShortUnsignedInt, BasicType::ShortUnsignedInt, BasicType::ShortUnsignedInt, BasicType::SignedInt, BasicType::UnsignedInt, BasicType::LongSignedInt, BasicType::LongUnsignedInt, BasicType::LongLongSignedInt, BasicType::LongLongUnsignedInt, BasicType::Float, BasicType::Double, BasicType::LongDouble, BasicType::FloatComplex, BasicType::DoubleComplex, BasicType::LongDoubleComplex, BasicType::FloatComplex, BasicType::DoubleComplex, BasicType::LongDoubleComplex, BasicType::SignedInt128, BasicType::UnsignedInt128, BasicType::Float80, BasicType::Float128 }, 187 /* SignedInt */ { BasicType::SignedInt, BasicType::SignedInt, BasicType::SignedInt, BasicType::SignedInt, BasicType::SignedInt, BasicType::SignedInt, BasicType::SignedInt, BasicType::UnsignedInt, BasicType::LongSignedInt, BasicType::LongUnsignedInt, BasicType::LongLongSignedInt, BasicType::LongLongUnsignedInt, BasicType::Float, BasicType::Double, BasicType::LongDouble, BasicType::FloatComplex, BasicType::DoubleComplex, BasicType::LongDoubleComplex, BasicType::FloatComplex, BasicType::DoubleComplex, BasicType::LongDoubleComplex, BasicType::SignedInt128, BasicType::UnsignedInt128, BasicType::Float80, BasicType::Float128 }, 188 /* UnsignedInt */ { BasicType::UnsignedInt, BasicType::UnsignedInt, BasicType::UnsignedInt, BasicType::UnsignedInt, BasicType::UnsignedInt, BasicType::UnsignedInt, BasicType::UnsignedInt, BasicType::UnsignedInt, BasicType::LongUnsignedInt, BasicType::LongUnsignedInt, BasicType::LongLongSignedInt, BasicType::LongLongUnsignedInt, BasicType::Float, BasicType::Double, BasicType::LongDouble, BasicType::FloatComplex, BasicType::DoubleComplex, BasicType::LongDoubleComplex, BasicType::FloatComplex, BasicType::DoubleComplex, BasicType::LongDoubleComplex, BasicType::SignedInt128, BasicType::UnsignedInt128, BasicType::Float80, BasicType::Float128 }, 189 /* LongSignedInt */ { BasicType::LongSignedInt, BasicType::LongSignedInt, BasicType::LongSignedInt, BasicType::LongSignedInt, BasicType::LongSignedInt, BasicType::LongSignedInt, BasicType::LongSignedInt, BasicType::LongUnsignedInt, BasicType::LongSignedInt, BasicType::LongUnsignedInt, BasicType::LongLongSignedInt, BasicType::LongLongUnsignedInt, BasicType::Float, BasicType::Double, BasicType::LongDouble, BasicType::FloatComplex, BasicType::DoubleComplex, BasicType::LongDoubleComplex, BasicType::FloatComplex, BasicType::DoubleComplex, BasicType::LongDoubleComplex, BasicType::SignedInt128, BasicType::UnsignedInt128, BasicType::Float80, BasicType::Float128 }, 190 /* LongUnsignedInt */ { BasicType::LongUnsignedInt, BasicType::LongUnsignedInt, BasicType::LongUnsignedInt, BasicType::LongUnsignedInt, BasicType::LongUnsignedInt, BasicType::LongUnsignedInt, BasicType::LongUnsignedInt, BasicType::LongUnsignedInt, BasicType::LongUnsignedInt, BasicType::LongUnsignedInt, BasicType::LongLongSignedInt, BasicType::LongLongUnsignedInt, BasicType::Float, BasicType::Double, BasicType::LongDouble, BasicType::FloatComplex, BasicType::DoubleComplex, BasicType::LongDoubleComplex, BasicType::FloatComplex, BasicType::DoubleComplex, BasicType::LongDoubleComplex, BasicType::SignedInt128, BasicType::UnsignedInt128, BasicType::Float80, BasicType::Float128 }, 191 /* LongLongSignedInt */ { BasicType::LongLongSignedInt, BasicType::LongLongSignedInt, BasicType::LongLongSignedInt, BasicType::LongLongSignedInt, BasicType::LongLongSignedInt, BasicType::LongLongSignedInt, BasicType::LongLongSignedInt, BasicType::LongLongSignedInt, BasicType::LongLongSignedInt, BasicType::LongLongSignedInt, BasicType::LongLongSignedInt, BasicType::LongLongUnsignedInt, BasicType::Float, BasicType::Double, BasicType::LongDouble, BasicType::FloatComplex, BasicType::DoubleComplex, BasicType::LongDoubleComplex, BasicType::FloatComplex, BasicType::DoubleComplex, BasicType::LongDoubleComplex, BasicType::SignedInt128, BasicType::UnsignedInt128, BasicType::Float80, BasicType::Float128 }, 192 /* LongLongUnsignedInt */ { BasicType::LongLongUnsignedInt, BasicType::LongLongUnsignedInt, BasicType::LongLongUnsignedInt, BasicType::LongLongUnsignedInt, BasicType::LongLongUnsignedInt, BasicType::LongLongUnsignedInt, BasicType::LongLongUnsignedInt, BasicType::LongLongUnsignedInt, BasicType::LongLongUnsignedInt, BasicType::LongLongUnsignedInt, BasicType::LongLongUnsignedInt, BasicType::LongLongUnsignedInt, BasicType::Float, BasicType::Double, BasicType::LongDouble, BasicType::FloatComplex, BasicType::DoubleComplex, BasicType::LongDoubleComplex, BasicType::FloatComplex, BasicType::DoubleComplex, BasicType::LongDoubleComplex, BasicType::SignedInt128, BasicType::UnsignedInt128, BasicType::Float80, BasicType::Float128 }, 193 /* Float */ { BasicType::Float, BasicType::Float, BasicType::Float, BasicType::Float, BasicType::Float, BasicType::Float, BasicType::Float, BasicType::Float, BasicType::Float, BasicType::Float, BasicType::Float, BasicType::Float, BasicType::Float, BasicType::Double, BasicType::LongDouble, BasicType::FloatComplex, BasicType::DoubleComplex, BasicType::LongDoubleComplex, BasicType::FloatComplex, BasicType::DoubleComplex, BasicType::LongDoubleComplex, BasicType::Float, BasicType::Float, BasicType::Float80, BasicType::Float128 }, 194 /* Double */ { BasicType::Double, BasicType::Double, BasicType::Double, BasicType::Double, BasicType::Double, BasicType::Double, BasicType::Double, BasicType::Double, BasicType::Double, BasicType::Double, BasicType::Double, BasicType::Double, BasicType::Double, BasicType::Double, BasicType::LongDouble, BasicType::DoubleComplex, BasicType::DoubleComplex, BasicType::LongDoubleComplex, BasicType::DoubleComplex, BasicType::DoubleComplex, BasicType::LongDoubleComplex, BasicType::Double, BasicType::Double, BasicType::Float80, BasicType::Float128 }, 195 /* LongDouble */ { BasicType::LongDouble, BasicType::LongDouble, BasicType::LongDouble, BasicType::LongDouble, BasicType::LongDouble, BasicType::LongDouble, BasicType::LongDouble, BasicType::LongDouble, BasicType::LongDouble, BasicType::LongDouble, BasicType::LongDouble, BasicType::LongDouble, BasicType::LongDouble, BasicType::LongDouble, BasicType::LongDouble, BasicType::LongDoubleComplex, BasicType::LongDoubleComplex, BasicType::LongDoubleComplex, BasicType::LongDoubleComplex, BasicType::LongDoubleComplex, BasicType::LongDoubleComplex, BasicType::LongDouble, BasicType::LongDouble, BasicType::BasicType::LongDouble, BasicType::Float128 }, 196 /* FloatComplex */ { BasicType::FloatComplex, BasicType::FloatComplex, BasicType::FloatComplex, BasicType::FloatComplex, BasicType::FloatComplex, BasicType::FloatComplex, BasicType::FloatComplex, BasicType::FloatComplex, BasicType::FloatComplex, BasicType::FloatComplex, BasicType::FloatComplex, BasicType::FloatComplex, BasicType::FloatComplex, BasicType::DoubleComplex, BasicType::LongDoubleComplex, BasicType::FloatComplex, BasicType::DoubleComplex, BasicType::LongDoubleComplex, BasicType::FloatComplex, BasicType::DoubleComplex, BasicType::LongDoubleComplex, BasicType::FloatComplex, BasicType::FloatComplex, BasicType::LongDoubleComplex, BasicType::LongDoubleComplex, }, 197 /* DoubleComplex */ { BasicType::DoubleComplex, BasicType::DoubleComplex, BasicType::DoubleComplex, BasicType::DoubleComplex, BasicType::DoubleComplex, BasicType::DoubleComplex, BasicType::DoubleComplex, BasicType::DoubleComplex, BasicType::DoubleComplex, BasicType::DoubleComplex, BasicType::DoubleComplex, BasicType::DoubleComplex, BasicType::DoubleComplex, BasicType::DoubleComplex, BasicType::LongDoubleComplex, BasicType::DoubleComplex, BasicType::DoubleComplex, BasicType::LongDoubleComplex, BasicType::DoubleComplex, BasicType::DoubleComplex, BasicType::LongDoubleComplex, BasicType::DoubleComplex, BasicType::DoubleComplex, BasicType::LongDoubleComplex, BasicType::LongDoubleComplex }, 198 /* LongDoubleComplex */ { BasicType::LongDoubleComplex, BasicType::LongDoubleComplex, BasicType::LongDoubleComplex, BasicType::LongDoubleComplex, BasicType::LongDoubleComplex, BasicType::LongDoubleComplex, BasicType::LongDoubleComplex, BasicType::LongDoubleComplex, BasicType::LongDoubleComplex, BasicType::LongDoubleComplex, BasicType::LongDoubleComplex, BasicType::LongDoubleComplex, BasicType::LongDoubleComplex, BasicType::LongDoubleComplex, BasicType::LongDoubleComplex, BasicType::LongDoubleComplex, BasicType::LongDoubleComplex, BasicType::LongDoubleComplex, BasicType::LongDoubleComplex, BasicType::LongDoubleComplex, BasicType::LongDoubleComplex, BasicType::LongDoubleComplex, BasicType::LongDoubleComplex, BasicType::LongDoubleComplex, BasicType::LongDoubleComplex, }, 199 /* FloatImaginary */ { BasicType::FloatComplex, BasicType::FloatComplex, BasicType::FloatComplex, BasicType::FloatComplex, BasicType::FloatComplex, BasicType::FloatComplex, BasicType::FloatComplex, BasicType::FloatComplex, BasicType::FloatComplex, BasicType::FloatComplex, BasicType::FloatComplex, BasicType::FloatComplex, BasicType::FloatComplex, BasicType::DoubleComplex, BasicType::LongDoubleComplex, BasicType::FloatComplex, BasicType::DoubleComplex, BasicType::LongDoubleComplex, BasicType::FloatImaginary, BasicType::DoubleImaginary, BasicType::LongDoubleImaginary, BasicType::FloatImaginary, BasicType::FloatImaginary, BasicType::LongDoubleImaginary, BasicType::LongDoubleImaginary, }, 200 /* DoubleImaginary */ { BasicType::DoubleComplex, BasicType::DoubleComplex, BasicType::DoubleComplex, BasicType::DoubleComplex, BasicType::DoubleComplex, BasicType::DoubleComplex, BasicType::DoubleComplex, BasicType::DoubleComplex, BasicType::DoubleComplex, BasicType::DoubleComplex, BasicType::DoubleComplex, BasicType::DoubleComplex, BasicType::DoubleComplex, BasicType::DoubleComplex, BasicType::LongDoubleComplex, BasicType::DoubleComplex, BasicType::DoubleComplex, BasicType::LongDoubleComplex, BasicType::DoubleImaginary, BasicType::DoubleImaginary, BasicType::LongDoubleImaginary, BasicType::DoubleImaginary, BasicType::DoubleImaginary, BasicType::LongDoubleImaginary, BasicType::LongDoubleImaginary, }, 201 /* LongDoubleImaginary */ { BasicType::LongDoubleComplex, BasicType::LongDoubleComplex, BasicType::LongDoubleComplex, BasicType::LongDoubleComplex, BasicType::LongDoubleComplex, BasicType::LongDoubleComplex, BasicType::LongDoubleComplex, BasicType::LongDoubleComplex, BasicType::LongDoubleComplex, BasicType::LongDoubleComplex, BasicType::LongDoubleComplex, BasicType::LongDoubleComplex, BasicType::LongDoubleComplex, BasicType::LongDoubleComplex, BasicType::LongDoubleComplex, BasicType::LongDoubleComplex, BasicType::LongDoubleComplex, BasicType::LongDoubleComplex, BasicType::LongDoubleImaginary, BasicType::LongDoubleImaginary, BasicType::LongDoubleImaginary, BasicType::LongDoubleImaginary, BasicType::LongDoubleImaginary, }, 202 /* SignedInt128 */ { BasicType::SignedInt128, BasicType::SignedInt128, BasicType::SignedInt128, BasicType::SignedInt128, BasicType::SignedInt128, BasicType::SignedInt128, BasicType::SignedInt128, BasicType::SignedInt128, BasicType::SignedInt128, BasicType::SignedInt128, BasicType::SignedInt128, BasicType::SignedInt128, BasicType::Float, BasicType::Double, BasicType::LongDouble, BasicType::FloatComplex, BasicType::DoubleComplex, BasicType::LongDoubleComplex, BasicType::FloatComplex, BasicType::DoubleComplex, BasicType::LongDoubleComplex, BasicType::SignedInt128, BasicType::UnsignedInt128, BasicType::Float80, BasicType::Float128, }, 203 /* UnsignedInt128 */ { BasicType::UnsignedInt128, BasicType::UnsignedInt128, BasicType::UnsignedInt128, BasicType::UnsignedInt128, BasicType::UnsignedInt128, BasicType::UnsignedInt128, BasicType::UnsignedInt128, BasicType::UnsignedInt128, BasicType::UnsignedInt128, BasicType::UnsignedInt128, BasicType::UnsignedInt128, BasicType::UnsignedInt128, BasicType::Float, BasicType::Double, BasicType::LongDouble, BasicType::FloatComplex, BasicType::DoubleComplex, BasicType::LongDoubleComplex, BasicType::FloatComplex, BasicType::DoubleComplex, BasicType::LongDoubleComplex, BasicType::UnsignedInt128, BasicType::UnsignedInt128, BasicType::Float80, BasicType::Float128, }, 204 /* Float80 */ { BasicType::Float80, BasicType::Float80, BasicType::Float80, BasicType::Float80, BasicType::Float80, BasicType::Float80, BasicType::Float80, BasicType::Float80, BasicType::Float80, BasicType::Float80, BasicType::Float80, BasicType::Float80, BasicType::Float80, BasicType::Float80, BasicType::LongDouble, BasicType::LongDoubleComplex, BasicType::LongDoubleComplex, BasicType::LongDoubleComplex, BasicType::LongDoubleComplex, BasicType::LongDoubleComplex, BasicType::LongDoubleComplex, BasicType::Float80, BasicType::Float80, BasicType::Float80, BasicType::Float128 }, 205 /* Float128 */ { BasicType::Float128, BasicType::Float128, BasicType::Float128, BasicType::Float128, BasicType::Float128, BasicType::Float128, BasicType::Float128, BasicType::Float128, BasicType::Float128, BasicType::Float128, BasicType::Float128, BasicType::Float128, BasicType::Float128, BasicType::Float128, BasicType::Float128, BasicType::LongDoubleComplex, BasicType::LongDoubleComplex, BasicType::LongDoubleComplex, BasicType::LongDoubleComplex, BasicType::LongDoubleComplex, BasicType::LongDoubleComplex, BasicType::Float128, BasicType::Float128, BasicType::Float128, BasicType::Float128 }, 176 206 }; 207 static_assert( 208 sizeof(combinedType)/sizeof(combinedType[0][0]) == BasicType::NUMBER_OF_BASIC_TYPES*BasicType::NUMBER_OF_BASIC_TYPES, 209 "Each basic type kind should have a corresponding row in the combined type matrix" 210 ); 177 211 178 212 CommonType::CommonType( Type *type2, bool widenFirst, bool widenSecond, const SymTab::Indexer &indexer, TypeEnvironment &env, const OpenVarSet &openVars ) … … 180 214 } 181 215 182 void CommonType:: visit( __attribute((unused)) VoidType *voidType) {}183 184 void CommonType:: visit( BasicType *basicType ) {216 void CommonType::postvisit( VoidType * ) {} 217 218 void CommonType::postvisit( BasicType *basicType ) { 185 219 if ( BasicType *otherBasic = dynamic_cast< BasicType* >( type2 ) ) { 186 220 BasicType::Kind newType = combinedType[ basicType->get_kind() ][ otherBasic->get_kind() ]; … … 204 238 AssertionSet need, have; 205 239 WidenMode widen( widenFirst, widenSecond ); 206 if ( entry != openVars.end() && ! bindVar(var, voidPointer->get_base(), entry->second, env, need, have, openVars, widen, indexer ) ) return;240 if ( entry != openVars.end() && ! env.bindVar(var, voidPointer->get_base(), entry->second, need, have, openVars, widen, indexer ) ) return; 207 241 } 208 242 } … … 211 245 } 212 246 213 void CommonType:: visit( PointerType *pointerType ) {247 void CommonType::postvisit( PointerType *pointerType ) { 214 248 if ( PointerType *otherPointer = dynamic_cast< PointerType* >( type2 ) ) { 215 249 // std::cerr << "commonType: two pointers: " << pointerType << " / " << otherPointer << std::endl; … … 233 267 result = otherPointer->clone(); 234 268 } // if 235 result->get_qualifiers() = tq1 | tq2;269 strict_dynamic_cast<PointerType*>(result)->base->get_qualifiers() = tq1 | tq2; 236 270 } else { 237 271 /// std::cerr << "place for ptr-to-type" << std::endl; … … 246 280 } 247 281 248 void CommonType:: visit( __attribute((unused)) ArrayType *arrayType) {}249 250 void CommonType:: visit( ReferenceType *refType ) {282 void CommonType::postvisit( ArrayType * ) {} 283 284 void CommonType::postvisit( ReferenceType *refType ) { 251 285 if ( ReferenceType *otherRef = dynamic_cast< ReferenceType* >( type2 ) ) { 252 286 // std::cerr << "commonType: both references: " << refType << " / " << otherRef << std::endl; … … 270 304 result = otherRef->clone(); 271 305 } // if 272 result->get_qualifiers() = tq1 | tq2;306 strict_dynamic_cast<ReferenceType*>(result)->base->get_qualifiers() = tq1 | tq2; 273 307 } else { 274 308 /// std::cerr << "place for ptr-to-type" << std::endl; … … 283 317 } 284 318 285 void CommonType:: visit( __attribute((unused)) FunctionType *functionType) {}286 void CommonType:: visit( __attribute((unused)) StructInstType *aggregateUseType) {}287 void CommonType:: visit( __attribute((unused)) UnionInstType *aggregateUseType) {}288 289 void CommonType:: visit( EnumInstType *enumInstType ) {319 void CommonType::postvisit( FunctionType * ) {} 320 void CommonType::postvisit( StructInstType * ) {} 321 void CommonType::postvisit( UnionInstType * ) {} 322 323 void CommonType::postvisit( EnumInstType *enumInstType ) { 290 324 if ( dynamic_cast< BasicType * >( type2 ) || dynamic_cast< ZeroType* >( type2 ) || dynamic_cast< OneType* >( type2 ) ) { 291 325 // reuse BasicType, EnumInstType code by swapping type2 with enumInstType 292 ValueGuard< Type * > temp( type2 ); 293 type2 = enumInstType; 294 temp.old->accept( *this ); 295 } // if 296 } 297 298 void CommonType::visit( __attribute((unused)) TraitInstType *aggregateUseType ) { 299 } 300 301 void CommonType::visit( TypeInstType *inst ) { 326 result = commonType( type2, enumInstType, widenSecond, widenFirst, indexer, env, openVars ); 327 } // if 328 } 329 330 void CommonType::postvisit( TraitInstType * ) { 331 } 332 333 void CommonType::postvisit( TypeInstType *inst ) { 302 334 if ( widenFirst ) { 303 335 NamedTypeDecl *nt = indexer.lookupType( inst->get_name() ); … … 321 353 } 322 354 323 void CommonType:: visit( __attribute((unused)) TupleType *tupleType) {}324 void CommonType:: visit( __attribute((unused)) VarArgsType *varArgsType) {}325 326 void CommonType:: visit( ZeroType *zeroType ) {355 void CommonType::postvisit( TupleType * ) {} 356 void CommonType::postvisit( VarArgsType * ) {} 357 358 void CommonType::postvisit( ZeroType *zeroType ) { 327 359 if ( widenFirst ) { 328 360 if ( dynamic_cast< BasicType* >( type2 ) || dynamic_cast< PointerType* >( type2 ) || dynamic_cast< EnumInstType* >( type2 ) ) { … … 338 370 } 339 371 340 void CommonType:: visit( OneType *oneType ) {372 void CommonType::postvisit( OneType *oneType ) { 341 373 if ( widenFirst ) { 342 374 if ( dynamic_cast< BasicType* >( type2 ) || dynamic_cast< EnumInstType* >( type2 ) ) { -
src/ResolvExpr/ConversionCost.cc
rf9feab8 r90152a4 42 42 Cost conversionCost( Type *src, Type *dest, const SymTab::Indexer &indexer, const TypeEnvironment &env ) { 43 43 if ( TypeInstType *destAsTypeInst = dynamic_cast< TypeInstType* >( dest ) ) { 44 EqvClass eqvClass; 45 NamedTypeDecl *namedType; 46 PRINT( std::cerr << "type inst " << destAsTypeInst->get_name(); ) 47 if ( env.lookup( destAsTypeInst->get_name(), eqvClass ) ) { 48 if ( eqvClass.type ) { 49 return conversionCost( src, eqvClass.type, indexer, env ); 44 PRINT( std::cerr << "type inst " << destAsTypeInst->name; ) 45 if ( const EqvClass* eqvClass = env.lookup( destAsTypeInst->name ) ) { 46 if ( eqvClass->type ) { 47 return conversionCost( src, eqvClass->type, indexer, env ); 50 48 } else { 51 49 return Cost::infinity; 52 50 } 53 } else if ( ( namedType = indexer.lookupType( destAsTypeInst->get_name() )) ) {51 } else if ( NamedTypeDecl *namedType = indexer.lookupType( destAsTypeInst->name ) ) { 54 52 PRINT( std::cerr << " found" << std::endl; ) 55 53 TypeDecl *type = dynamic_cast< TypeDecl* >( namedType ); 56 54 // all typedefs should be gone by this point 57 55 assert( type ); 58 if ( type-> get_base()) {59 return conversionCost( src, type-> get_base(), indexer, env ) + Cost::safe;56 if ( type->base ) { 57 return conversionCost( src, type->base, indexer, env ) + Cost::safe; 60 58 } // if 61 59 } // if … … 77 75 } else if ( ReferenceType * refType = dynamic_cast< ReferenceType * > ( dest ) ) { 78 76 PRINT( std::cerr << "conversionCost: dest is reference" << std::endl; ) 79 return convertToReferenceCost( src, refType, indexer, env, [](Type * t1, Type * t2, const TypeEnvironment & env, const SymTab::Indexer &){77 return convertToReferenceCost( src, refType, indexer, env, [](Type * t1, Type * t2, const SymTab::Indexer &, const TypeEnvironment & env ){ 80 78 return ptrsAssignable( t1, t2, env ); 81 79 }); 82 80 } else { 83 ConversionCost converter( dest, indexer, env);81 PassVisitor<ConversionCost> converter( dest, indexer, env, conversionCost ); 84 82 src->accept( converter ); 85 if ( converter. get_cost() == Cost::infinity ) {83 if ( converter.pass.get_cost() == Cost::infinity ) { 86 84 return Cost::infinity; 87 85 } else { 88 return converter. get_cost() + Cost::zero;86 return converter.pass.get_cost() + Cost::zero; 89 87 } // if 90 88 } // if … … 92 90 93 91 Cost convertToReferenceCost( Type * src, Type * dest, int diff, const SymTab::Indexer & indexer, const TypeEnvironment & env, PtrsFunction func ) { 94 PRINT( std::cerr << "convert to reference cost... diff " << diff << std::endl; )92 PRINT( std::cerr << "convert to reference cost... diff " << diff << " " << src << " / " << dest << std::endl; ) 95 93 if ( diff > 0 ) { 96 94 // TODO: document this 97 Cost cost = convertToReferenceCost( strict_dynamic_cast< ReferenceType * >( src )-> get_base(), dest, diff-1, indexer, env, func );95 Cost cost = convertToReferenceCost( strict_dynamic_cast< ReferenceType * >( src )->base, dest, diff-1, indexer, env, func ); 98 96 cost.incReference(); 99 97 return cost; 100 98 } else if ( diff < -1 ) { 101 99 // TODO: document this 102 Cost cost = convertToReferenceCost( src, strict_dynamic_cast< ReferenceType * >( dest )-> get_base(), diff+1, indexer, env, func );100 Cost cost = convertToReferenceCost( src, strict_dynamic_cast< ReferenceType * >( dest )->base, diff+1, indexer, env, func ); 103 101 cost.incReference(); 104 102 return cost; … … 108 106 if ( srcAsRef && destAsRef ) { // pointer-like conversions between references 109 107 PRINT( std::cerr << "converting between references" << std::endl; ) 110 if ( srcAsRef->get_base()->get_qualifiers() <= destAsRef->get_base()->get_qualifiers() && typesCompatibleIgnoreQualifiers( srcAsRef->get_base(), destAsRef->get_base(), indexer, env ) ) { 111 return Cost::safe; 108 Type::Qualifiers tq1 = srcAsRef->base->get_qualifiers(); 109 Type::Qualifiers tq2 = destAsRef->base->get_qualifiers(); 110 if ( tq1 <= tq2 && typesCompatibleIgnoreQualifiers( srcAsRef->base, destAsRef->base, indexer, env ) ) { 111 PRINT( std::cerr << " :: compatible and good qualifiers" << std::endl; ) 112 if ( tq1 == tq2 ) { 113 // types are the same 114 return Cost::zero; 115 } else { 116 // types are the same, except otherPointer has more qualifiers 117 return Cost::safe; 118 } 112 119 } else { // xxx - this discards reference qualifiers from consideration -- reducing qualifiers is a safe conversion; is this right? 113 int assignResult = func( srcAsRef-> get_base(), destAsRef->get_base(), env, indexer);120 int assignResult = func( srcAsRef->base, destAsRef->base, indexer, env ); 114 121 PRINT( std::cerr << "comparing references: " << assignResult << " " << srcAsRef << " " << destAsRef << std::endl; ) 115 122 if ( assignResult > 0 ) { … … 121 128 } else { 122 129 PRINT( std::cerr << "reference to rvalue conversion" << std::endl; ) 123 ConversionCost converter( dest, indexer, env);130 PassVisitor<ConversionCost> converter( dest, indexer, env, conversionCost ); 124 131 src->accept( converter ); 125 return converter. get_cost();132 return converter.pass.get_cost(); 126 133 } // if 127 134 } else { … … 129 136 assert( diff == -1 && destAsRef ); 130 137 PRINT( std::cerr << "dest is: " << dest << " / src is: " << src << std::endl; ) 131 if ( typesCompatibleIgnoreQualifiers( src, destAsRef-> get_base(), indexer, env ) ) {138 if ( typesCompatibleIgnoreQualifiers( src, destAsRef->base, indexer, env ) ) { 132 139 PRINT( std::cerr << "converting compatible base type" << std::endl; ) 133 140 if ( src->get_lvalue() ) { … … 137 144 ) 138 145 // lvalue-to-reference conversion: cv lvalue T => cv T & 139 if ( src->get_qualifiers() == destAsRef-> get_base()->get_qualifiers() ) {146 if ( src->get_qualifiers() == destAsRef->base->get_qualifiers() ) { 140 147 return Cost::reference; // cost needs to be non-zero to add cast 141 } if ( src->get_qualifiers() < destAsRef-> get_base()->get_qualifiers() ) {148 } if ( src->get_qualifiers() < destAsRef->base->get_qualifiers() ) { 142 149 return Cost::safe; // cost needs to be higher than previous cast to differentiate adding qualifiers vs. keeping same 143 150 } else { 144 151 return Cost::unsafe; 145 152 } // if 146 } else if ( destAsRef-> get_base()->get_const() ) {153 } else if ( destAsRef->base->get_const() ) { 147 154 PRINT( std::cerr << "rvalue to const ref conversion" << std::endl; ) 148 155 // rvalue-to-const-reference conversion: T => const T & … … 161 168 Cost convertToReferenceCost( Type * src, ReferenceType * dest, const SymTab::Indexer & indexer, const TypeEnvironment & env, PtrsFunction func ) { 162 169 int sdepth = src->referenceDepth(), ddepth = dest->referenceDepth(); 163 return convertToReferenceCost( src, dest, sdepth-ddepth, indexer, env, func ); 164 } 165 166 ConversionCost::ConversionCost( Type *dest, const SymTab::Indexer &indexer, const TypeEnvironment &env ) 167 : dest( dest ), indexer( indexer ), cost( Cost::infinity ), env( env ) { 170 Cost cost = convertToReferenceCost( src, dest, sdepth-ddepth, indexer, env, func ); 171 PRINT( std::cerr << "convertToReferenceCost result: " << cost << std::endl; ) 172 return cost; 173 } 174 175 ConversionCost::ConversionCost( Type *dest, const SymTab::Indexer &indexer, const TypeEnvironment &env, CostFunction costFunc ) 176 : dest( dest ), indexer( indexer ), cost( Cost::infinity ), env( env ), costFunc( costFunc ) { 168 177 } 169 178 … … 219 228 */ 220 229 221 static const int costMatrix[ BasicType::NUMBER_OF_BASIC_TYPES ][ BasicType::NUMBER_OF_BASIC_TYPES ] = { 222 /* Src \ Dest: Bool Char SChar UChar Short UShort Int UInt Long ULong LLong ULLong Float Double LDbl FCplex DCplex LDCplex FImag DImag LDImag I128, U128 */ 223 /* Bool */ { 0, 1, 1, 2, 3, 4, 5, 6, 6, 7, 8, 9, 12, 13, 14, 12, 13, 14, -1, -1, -1, 10, 11, }, 224 /* Char */ { -1, 0, -1, 1, 2, 3, 4, 5, 5, 6, 7, 8, 11, 12, 13, 11, 12, 13, -1, -1, -1, 9, 10, }, 225 /* SChar */ { -1, -1, 0, 1, 2, 3, 4, 5, 5, 6, 7, 8, 11, 12, 13, 11, 12, 13, -1, -1, -1, 9, 10, }, 226 /* UChar */ { -1, -1, -1, 0, 1, 2, 3, 4, 4, 5, 6, 7, 10, 11, 12, 10, 11, 12, -1, -1, -1, 8, 9, }, 227 /* Short */ { -1, -1, -1, -1, 0, 1, 2, 3, 3, 4, 5, 6, 9, 10, 11, 9, 10, 11, -1, -1, -1, 7, 8, }, 228 /* UShort */{ -1, -1, -1, -1, -1, 0, 1, 2, 2, 3, 4, 5, 8, 9, 10, 8, 9, 10, -1, -1, -1, 6, 7, }, 229 /* Int */ { -1, -1, -1, -1, -1, -1, 0, 1, 1, 2, 3, 4, 7, 8, 9, 7, 8, 9, -1, -1, -1, 5, 6, }, 230 /* UInt */ { -1, -1, -1, -1, -1, -1, -1, 0, -1, 1, 2, 3, 6, 7, 8, 6, 7, 8, -1, -1, -1, 4, 5, }, 231 /* Long */ { -1, -1, -1, -1, -1, -1, -1, -1, 0, 1, 2, 3, 6, 7, 8, 6, 7, 8, -1, -1, -1, 4, 5, }, 232 /* ULong */ { -1, -1, -1, -1, -1, -1, -1, -1, -1, 0, 1, 2, 5, 6, 7, 5, 6, 7, -1, -1, -1, 3, 4, }, 233 /* LLong */ { -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 0, 1, 4, 5, 6, 4, 5, 6, -1, -1, -1, 2, 3, }, 234 /* ULLong */{ -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 0, 3, 4, 5, 3, 4, 5, -1, -1, -1, 1, 2, }, 235 236 /* Float */ { -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 0, 1, 2, 1, 2, 3, -1, -1, -1, -1, -1, }, 237 /* Double */{ -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 0, 1, -1, 1, 2, -1, -1, -1, -1, -1, }, 238 /* LDbl */ { -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 0, -1, -1, 1, -1, -1, -1, -1, -1, }, 239 /* FCplex */{ -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 0, 1, 2, -1, -1, -1, -1, -1, }, 240 /* DCplex */{ -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 0, 1, -1, -1, -1, -1, -1, }, 241 /* LDCplex */{ -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 0, -1, -1, -1, -1, -1, }, 242 /* FImag */ { -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 1, 2, 3, 0, 1, 2, -1, -1, }, 243 /* DImag */ { -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 1, 2, -1, 0, 1, -1, -1, }, 244 /* LDImag */{ -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 1, -1, -1, 0, -1, -1, }, 245 246 /* I128 */ { -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 2, 3, 4, 3, 4, 5, -1, -1, -1, 0, 1, }, 247 /* U128 */ { -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 1, 2, 3, 2, 3, 4, -1, -1, -1, -1, 0, }, 230 static const int costMatrix[][ BasicType::NUMBER_OF_BASIC_TYPES ] = { 231 /* Src \ Dest: Bool Char SChar UChar Short UShort Int UInt Long ULong LLong ULLong Float Double LDbl FCplex DCplex LDCplex FImag DImag LDImag I128, U128, F80, F128 */ 232 /* Bool */ { 0, 1, 1, 2, 3, 4, 5, 6, 6, 7, 8, 9, 12, 13, 14, 12, 13, 14, -1, -1, -1, 10, 11, 14, 15}, 233 /* Char */ { -1, 0, -1, 1, 2, 3, 4, 5, 5, 6, 7, 8, 11, 12, 13, 11, 12, 13, -1, -1, -1, 9, 10, 13, 14}, 234 /* SChar */ { -1, -1, 0, 1, 2, 3, 4, 5, 5, 6, 7, 8, 11, 12, 13, 11, 12, 13, -1, -1, -1, 9, 10, 13, 14}, 235 /* UChar */ { -1, -1, -1, 0, 1, 2, 3, 4, 4, 5, 6, 7, 10, 11, 12, 10, 11, 12, -1, -1, -1, 8, 9, 12, 13}, 236 /* Short */ { -1, -1, -1, -1, 0, 1, 2, 3, 3, 4, 5, 6, 9, 10, 11, 9, 10, 11, -1, -1, -1, 7, 8, 11, 12}, 237 /* UShort */{ -1, -1, -1, -1, -1, 0, 1, 2, 2, 3, 4, 5, 8, 9, 10, 8, 9, 10, -1, -1, -1, 6, 7, 10, 11}, 238 /* Int */ { -1, -1, -1, -1, -1, -1, 0, 1, 1, 2, 3, 4, 7, 8, 9, 7, 8, 9, -1, -1, -1, 5, 6, 9, 10}, 239 /* UInt */ { -1, -1, -1, -1, -1, -1, -1, 0, -1, 1, 2, 3, 6, 7, 8, 6, 7, 8, -1, -1, -1, 4, 5, 8, 9}, 240 /* Long */ { -1, -1, -1, -1, -1, -1, -1, -1, 0, 1, 2, 3, 6, 7, 8, 6, 7, 8, -1, -1, -1, 4, 5, 8, 9}, 241 /* ULong */ { -1, -1, -1, -1, -1, -1, -1, -1, -1, 0, 1, 2, 5, 6, 7, 5, 6, 7, -1, -1, -1, 3, 4, 7, 8}, 242 /* LLong */ { -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 0, 1, 4, 5, 6, 4, 5, 6, -1, -1, -1, 2, 3, 6, 7}, 243 /* ULLong */{ -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 0, 3, 4, 5, 3, 4, 5, -1, -1, -1, 1, 2, 5, 6}, 244 245 /* Float */ { -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 0, 1, 2, 1, 2, 3, -1, -1, -1, -1, -1, 2, 3}, 246 /* Double */{ -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 0, 1, -1, 1, 2, -1, -1, -1, -1, -1, 1, 2}, 247 /* LDbl */ { -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 0, -1, -1, 1, -1, -1, -1, -1, -1, -1, 1}, 248 /* FCplex */{ -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 0, 1, 2, -1, -1, -1, -1, -1, -1, -1}, 249 /* DCplex */{ -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 0, 1, -1, -1, -1, -1, -1, -1, -1}, 250 /* LDCplex */{ -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 0, -1, -1, -1, -1, -1, -1, -1}, 251 /* FImag */ { -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 1, 2, 3, 0, 1, 2, -1, -1, -1, -1}, 252 /* DImag */ { -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 1, 2, -1, 0, 1, -1, -1, -1, -1}, 253 /* LDImag */{ -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 1, -1, -1, 0, -1, -1, -1, -1}, 254 255 /* I128 */ { -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 2, 3, 4, 3, 4, 5, -1, -1, -1, 0, 1, 4, 4}, 256 /* U128 */ { -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 1, 2, 3, 2, 3, 4, -1, -1, -1, -1, 0, 3, 3}, 257 258 /* F80 */ { -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 1, -1, -1, 1, -1, -1, -1, -1, -1, 0, 1}, 259 /* F128 */ { -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 1, -1, -1, -1, -1, -1, -1, 0}, 248 260 }; 249 250 void ConversionCost::visit( __attribute((unused)) VoidType *voidType ) { 261 static_assert( 262 sizeof(costMatrix)/sizeof(costMatrix[0][0]) == BasicType::NUMBER_OF_BASIC_TYPES*BasicType::NUMBER_OF_BASIC_TYPES, 263 "Each basic type kind should have a corresponding row in the cost matrix" 264 ); 265 266 267 void ConversionCost::postvisit( VoidType * ) { 251 268 cost = Cost::infinity; 252 269 } 253 270 254 void ConversionCost:: visit(BasicType *basicType) {271 void ConversionCost::postvisit(BasicType *basicType) { 255 272 if ( BasicType *destAsBasic = dynamic_cast< BasicType* >( dest ) ) { 256 273 int tableResult = costMatrix[ basicType->get_kind() ][ destAsBasic->get_kind() ]; … … 264 281 // xxx - not positive this is correct, but appears to allow casting int => enum 265 282 cost = Cost::unsafe; 266 } else if ( dynamic_cast< ZeroType* >( dest ) != nullptr || dynamic_cast< OneType* >( dest ) != nullptr ) { 267 cost = Cost::unsafe; 268 } // if 269 } 270 271 void ConversionCost::visit( PointerType * pointerType ) { 283 } // if 284 // no cases for zero_t/one_t because it should not be possible to convert int, etc. to zero_t/one_t. 285 } 286 287 void ConversionCost::postvisit( PointerType * pointerType ) { 272 288 if ( PointerType *destAsPtr = dynamic_cast< PointerType* >( dest ) ) { 273 PRINT( std::cerr << pointerType << " ===> " << destAsPtr; ) 274 Type::Qualifiers tq1 = pointerType->get_base()->get_qualifiers(); 275 Type::Qualifiers tq2 = destAsPtr->get_base()->get_qualifiers(); 276 if ( tq1 <= tq2 && typesCompatibleIgnoreQualifiers( pointerType->get_base(), destAsPtr->get_base(), indexer, env ) ) { 289 PRINT( std::cerr << pointerType << " ===> " << destAsPtr << std::endl; ) 290 Type::Qualifiers tq1 = pointerType->base->get_qualifiers(); 291 Type::Qualifiers tq2 = destAsPtr->base->get_qualifiers(); 292 if ( tq1 <= tq2 && typesCompatibleIgnoreQualifiers( pointerType->base, destAsPtr->base, indexer, env ) ) { 293 PRINT( std::cerr << " :: compatible and good qualifiers" << std::endl; ) 277 294 if ( tq1 == tq2 ) { 278 295 // types are the same … … 280 297 } else { 281 298 // types are the same, except otherPointer has more qualifiers 282 PRINT( std::cerr << " :: compatible and good qualifiers" << std::endl; )283 299 cost = Cost::safe; 284 300 } 285 } else { // xxx - this discards qualifiers from consideration -- reducing qualifiers is a safe conversion; is this right?301 } else { 286 302 int assignResult = ptrsAssignable( pointerType->base, destAsPtr->base, env ); 287 303 PRINT( std::cerr << " :: " << assignResult << std::endl; ) 288 if ( assignResult > 0 && pointerType->get_base()->get_qualifiers() <= destAsPtr->get_qualifiers() ) { 289 cost = Cost::safe; 304 if ( assignResult > 0 && tq1 <= tq2 ) { 305 // xxx - want the case where qualifiers are added to be more expensive than the case where qualifiers are the same. Is 1 safe vs. 2 safe correct? 306 if ( tq1 == tq2 ) { 307 cost = Cost::safe; 308 } else if ( tq1 < tq2 ) { 309 cost = Cost::safe+Cost::safe; 310 } 290 311 } else if ( assignResult < 0 ) { 291 312 cost = Cost::unsafe; … … 293 314 // assignResult == 0 means Cost::Infinity 294 315 } // if 295 } else if ( dynamic_cast< ZeroType * >( dest ) ) { 296 cost = Cost::unsafe; 297 } // if 298 } 299 300 void ConversionCost::visit( ArrayType * ) {} 301 302 void ConversionCost::visit( ReferenceType * refType ) { 316 // case case for zero_t because it should not be possible to convert pointers to zero_t. 317 } // if 318 } 319 320 void ConversionCost::postvisit( ArrayType * ) {} 321 322 void ConversionCost::postvisit( ReferenceType * refType ) { 303 323 // Note: dest can never be a reference, since it would have been caught in an earlier check 304 324 assert( ! dynamic_cast< ReferenceType * >( dest ) ); … … 306 326 // recursively compute conversion cost from T1 to T2. 307 327 // cv can be safely dropped because of 'implicit dereference' behavior. 308 refType->base->accept( *this);328 cost = costFunc( refType->base, dest, indexer, env ); 309 329 if ( refType->base->get_qualifiers() == dest->get_qualifiers() ) { 310 330 cost.incReference(); // prefer exact qualifiers … … 317 337 } 318 338 319 void ConversionCost:: visit( FunctionType * ) {}320 321 void ConversionCost:: visit( StructInstType * inst ) {339 void ConversionCost::postvisit( FunctionType * ) {} 340 341 void ConversionCost::postvisit( StructInstType * inst ) { 322 342 if ( StructInstType *destAsInst = dynamic_cast< StructInstType* >( dest ) ) { 323 343 if ( inst->name == destAsInst->name ) { … … 327 347 } 328 348 329 void ConversionCost:: visit( UnionInstType * inst ) {349 void ConversionCost::postvisit( UnionInstType * inst ) { 330 350 if ( UnionInstType *destAsInst = dynamic_cast< UnionInstType* >( dest ) ) { 331 351 if ( inst->name == destAsInst->name ) { … … 335 355 } 336 356 337 void ConversionCost:: visit( EnumInstType * ) {357 void ConversionCost::postvisit( EnumInstType * ) { 338 358 static Type::Qualifiers q; 339 359 static BasicType integer( q, BasicType::SignedInt ); 340 integer.accept( *this); // safe if dest >= int360 cost = costFunc( &integer, dest, indexer, env ); // safe if dest >= int 341 361 if ( cost < Cost::unsafe ) { 342 362 cost.incSafe(); … … 344 364 } 345 365 346 void ConversionCost::visit( TraitInstType * ) {} 347 348 void ConversionCost::visit( TypeInstType *inst ) { 349 EqvClass eqvClass; 350 NamedTypeDecl *namedType; 351 if ( env.lookup( inst->get_name(), eqvClass ) ) { 352 cost = conversionCost( eqvClass.type, dest, indexer, env ); 366 void ConversionCost::postvisit( TraitInstType * ) {} 367 368 void ConversionCost::postvisit( TypeInstType *inst ) { 369 if ( const EqvClass *eqvClass = env.lookup( inst->name ) ) { 370 cost = costFunc( eqvClass->type, dest, indexer, env ); 353 371 } else if ( TypeInstType *destAsInst = dynamic_cast< TypeInstType* >( dest ) ) { 354 if ( inst-> get_name() == destAsInst->get_name()) {372 if ( inst->name == destAsInst->name ) { 355 373 cost = Cost::zero; 356 374 } 357 } else if ( ( namedType = indexer.lookupType( inst->get_name() )) ) {375 } else if ( NamedTypeDecl *namedType = indexer.lookupType( inst->name ) ) { 358 376 TypeDecl *type = dynamic_cast< TypeDecl* >( namedType ); 359 377 // all typedefs should be gone by this point 360 378 assert( type ); 361 if ( type-> get_base()) {362 cost = co nversionCost( type->get_base(), dest, indexer, env ) + Cost::safe;363 } // if 364 } // if 365 } 366 367 void ConversionCost:: visit( TupleType * tupleType ) {379 if ( type->base ) { 380 cost = costFunc( type->base, dest, indexer, env ) + Cost::safe; 381 } // if 382 } // if 383 } 384 385 void ConversionCost::postvisit( TupleType * tupleType ) { 368 386 Cost c = Cost::zero; 369 387 if ( TupleType * destAsTuple = dynamic_cast< TupleType * >( dest ) ) { 370 std::list< Type * >::const_iterator srcIt = tupleType-> get_types().begin();371 std::list< Type * >::const_iterator destIt = destAsTuple-> get_types().begin();372 while ( srcIt != tupleType-> get_types().end() && destIt != destAsTuple->get_types().end() ) {373 Cost newCost = co nversionCost( *srcIt++, *destIt++, indexer, env );388 std::list< Type * >::const_iterator srcIt = tupleType->types.begin(); 389 std::list< Type * >::const_iterator destIt = destAsTuple->types.begin(); 390 while ( srcIt != tupleType->types.end() && destIt != destAsTuple->types.end() ) { 391 Cost newCost = costFunc( *srcIt++, *destIt++, indexer, env ); 374 392 if ( newCost == Cost::infinity ) { 375 393 return; … … 377 395 c += newCost; 378 396 } // while 379 if ( destIt != destAsTuple-> get_types().end() ) {397 if ( destIt != destAsTuple->types.end() ) { 380 398 cost = Cost::infinity; 381 399 } else { … … 385 403 } 386 404 387 void ConversionCost:: visit( VarArgsType * ) {405 void ConversionCost::postvisit( VarArgsType * ) { 388 406 if ( dynamic_cast< VarArgsType* >( dest ) ) { 389 407 cost = Cost::zero; … … 391 409 } 392 410 393 void ConversionCost:: visit( ZeroType * ) {411 void ConversionCost::postvisit( ZeroType * ) { 394 412 if ( dynamic_cast< ZeroType * >( dest ) ) { 395 413 cost = Cost::zero; … … 408 426 } 409 427 410 void ConversionCost:: visit( OneType * ) {428 void ConversionCost::postvisit( OneType * ) { 411 429 if ( dynamic_cast< OneType * >( dest ) ) { 412 430 cost = Cost::zero; -
src/ResolvExpr/ConversionCost.h
rf9feab8 r90152a4 19 19 20 20 #include "Cost.h" // for Cost 21 22 #include "Common/PassVisitor.h" 21 23 #include "SynTree/Visitor.h" // for Visitor 22 24 #include "SynTree/SynTree.h" // for Visitor Nodes … … 29 31 class TypeEnvironment; 30 32 31 class ConversionCost : public Visitor { 33 typedef std::function<Cost(Type *, Type *, const SymTab::Indexer &, const TypeEnvironment &)> CostFunction; 34 struct ConversionCost : public WithShortCircuiting { 32 35 public: 33 ConversionCost( Type *dest, const SymTab::Indexer &indexer, const TypeEnvironment &env );36 ConversionCost( Type *dest, const SymTab::Indexer &indexer, const TypeEnvironment &env, CostFunction ); 34 37 35 38 Cost get_cost() const { return cost; } 36 39 37 virtual void visit(VoidType *voidType); 38 virtual void visit(BasicType *basicType); 39 virtual void visit(PointerType *pointerType); 40 virtual void visit(ArrayType *arrayType); 41 virtual void visit(ReferenceType *refType); 42 virtual void visit(FunctionType *functionType); 43 virtual void visit(StructInstType *aggregateUseType); 44 virtual void visit(UnionInstType *aggregateUseType); 45 virtual void visit(EnumInstType *aggregateUseType); 46 virtual void visit(TraitInstType *aggregateUseType); 47 virtual void visit(TypeInstType *aggregateUseType); 48 virtual void visit(TupleType *tupleType); 49 virtual void visit(VarArgsType *varArgsType); 50 virtual void visit(ZeroType *zeroType); 51 virtual void visit(OneType *oneType); 40 void previsit( BaseSyntaxNode * ) { visit_children = false; } 41 42 void postvisit( VoidType * voidType ); 43 void postvisit( BasicType * basicType ); 44 void postvisit( PointerType * pointerType ); 45 void postvisit( ArrayType * arrayType ); 46 void postvisit( ReferenceType * refType ); 47 void postvisit( FunctionType * functionType ); 48 void postvisit( StructInstType * aggregateUseType ); 49 void postvisit( UnionInstType * aggregateUseType ); 50 void postvisit( EnumInstType * aggregateUseType ); 51 void postvisit( TraitInstType * aggregateUseType ); 52 void postvisit( TypeInstType * aggregateUseType ); 53 void postvisit( TupleType * tupleType ); 54 void postvisit( VarArgsType * varArgsType ); 55 void postvisit( ZeroType * zeroType ); 56 void postvisit( OneType * oneType ); 52 57 protected: 53 58 Type *dest; … … 55 60 Cost cost; 56 61 const TypeEnvironment &env; 62 CostFunction costFunc; 57 63 }; 58 64 59 typedef std::function<int(Type *, Type *, const TypeEnvironment &, const SymTab::Indexer&)> PtrsFunction;65 typedef std::function<int(Type *, Type *, const SymTab::Indexer &, const TypeEnvironment &)> PtrsFunction; 60 66 Cost convertToReferenceCost( Type * src, ReferenceType * dest, const SymTab::Indexer & indexer, const TypeEnvironment & env, PtrsFunction func ); 61 67 } // namespace ResolvExpr -
src/ResolvExpr/CurrentObject.cc
rf9feab8 r90152a4 38 38 39 39 namespace ResolvExpr { 40 long long int getConstValue( ConstantExpr * constExpr ) {41 if ( BasicType * basicType = dynamic_cast< BasicType * >( constExpr->get_result() ) ) {42 if ( basicType->isInteger() ) {43 return constExpr->get_constant()->get_ival();44 } else {45 assertf( false, "Non-integer constant expression in getConstValue %s", toString( constExpr ).c_str() ); // xxx - might be semantic error46 }47 } else if ( dynamic_cast< OneType * >( constExpr->get_result() ) ) {48 return 1;49 } else if ( dynamic_cast< ZeroType * >( constExpr->get_result() ) ) {50 return 0;51 } else {52 assertf( false, "unhandled type on getConstValue %s", toString( constExpr->get_result() ).c_str() ); // xxx - might be semantic error53 }54 }55 56 40 template< typename AggrInst > 57 41 TypeSubstitution makeGenericSubstitution( AggrInst * inst ) { … … 78 62 virtual ~MemberIterator() {} 79 63 64 /// walks the current object using the given designators as a guide 80 65 virtual void setPosition( std::list< Expression * > & designators ) = 0; 66 67 /// retrieve the list of possible Type/Designaton pairs for the current position in the currect object 81 68 virtual std::list<InitAlternative> operator*() const = 0; 69 70 /// true if the iterator is not currently at the end 82 71 virtual operator bool() const = 0; 72 73 /// moves the iterator by one member in the current object 83 74 virtual MemberIterator & bigStep() = 0; 75 76 /// moves the iterator by one member in the current subobject 84 77 virtual MemberIterator & smallStep() = 0; 78 79 /// the type of the current object 85 80 virtual Type * getType() = 0; 81 82 /// the type of the current subobject 86 83 virtual Type * getNext() = 0; 87 84 85 /// printing for debug 88 86 virtual void print( std::ostream & out, Indenter indent ) const = 0; 89 87 88 /// helper for operator*; aggregates must add designator to each init alternative, but 89 /// adding designators in operator* creates duplicates. 90 90 virtual std::list<InitAlternative> first() const = 0; // should be protected 91 91 }; … … 139 139 ArrayIterator( ArrayType * at ) : array( at ) { 140 140 PRINT( std::cerr << "Creating array iterator: " << at << std::endl; ) 141 base = at-> get_base();141 base = at->base; 142 142 memberIter = createMemberIterator( base ); 143 setSize( at->get_dimension() ); 143 if ( at->isVarLen ) SemanticError( at, "VLA initialization does not support @=: " ); 144 setSize( at->dimension ); 144 145 } 145 146 … … 149 150 150 151 private: 151 void setSize( Expression * expr ) { 152 if ( ConstantExpr * constExpr = dynamic_cast< ConstantExpr * >( expr ) ) { 153 size = getConstValue( constExpr ); 154 PRINT( std::cerr << "array type with size: " << size << std::endl; ) 155 } else if ( CastExpr * castExpr = dynamic_cast< CastExpr * >( expr ) ) { 156 setSize( castExpr->get_arg() ); // xxx - need to perform the conversion specified by the cast 152 void setSize( Expression * expr ) { // replace this logic with an eval call 153 auto res = eval(expr); 154 if (res.second) { 155 size = res.first; 157 156 } else { 158 assertf( false, "unhandled expression in setSize: %s", toString( expr ).c_str() ); // xxx - if not a constant expression, it's not simple to determine how long the array actually is, which is necessary for initialization to be done correctly -- fix this157 SemanticError( expr->location, toString("Array designator must be a constant expression: ", expr) ); 159 158 } 160 159 } … … 164 163 // need to permit integer-constant-expressions, including: integer constants, enumeration constants, character constants, sizeof expressions, _Alignof expressions, cast expressions 165 164 if ( ConstantExpr * constExpr = dynamic_cast< ConstantExpr * >( expr ) ) { 166 index = getConstValue( constExpr ); 165 try { 166 index = constExpr->intValue(); 167 } catch( SemanticErrorException & ) { 168 SemanticError( expr, "Constant expression of non-integral type in array designator: " ); 169 } 167 170 } else if ( CastExpr * castExpr = dynamic_cast< CastExpr * >( expr ) ) { 168 171 setPosition( castExpr->get_arg() ); 169 172 } else if ( VariableExpr * varExpr = dynamic_cast< VariableExpr * >( expr ) ) { 170 assertf( dynamic_cast<EnumInstType *> ( varExpr->get_result() ), "ArrayIterator given variable that isn't an enum constant : %s", toString( expr ).c_str() ); 171 index = 0; // xxx - get actual value of enum constant 173 EnumInstType * inst = dynamic_cast<EnumInstType *>( varExpr->get_result() ); 174 assertf( inst, "ArrayIterator given variable that isn't an enum constant : %s", toString( expr ).c_str() ); 175 long long int value; 176 if ( inst->baseEnum->valueOf( varExpr->var, value ) ) { 177 index = value; 178 } 172 179 } else if ( dynamic_cast< SizeofExpr * >( expr ) || dynamic_cast< AlignofExpr * >( expr ) ) { 173 180 index = 0; // xxx - get actual sizeof/alignof value? … … 350 357 } 351 358 } 352 // if ( curMember == std::next( decl->get_members().begin(), 1 ) ) { // xxx - this never triggers because curMember is incremented immediately on construction 353 if ( atbegin ) { // xxx - this never triggers because curMember is incremented immediately on construction 359 if ( atbegin ) { 354 360 // xxx - what about case of empty struct?? 355 361 // only add self if at the very beginning of the structure … … 385 391 return *this; 386 392 } 387 virtual std::list<InitAlternative> first() const { return std::list<InitAlternative>{}; }388 393 }; 389 394 … … 439 444 return new UnionIterator( uit ); 440 445 } else { 441 assertf( dynamic_cast< TypeInstType * >( type ), "some other reftotype");446 assertf( dynamic_cast< EnumInstType * >( type ) || dynamic_cast< TypeInstType * >( type ), "Encountered unhandled ReferenceToType in createMemberIterator: %s", toString( type ).c_str() ); 442 447 return new SimpleIterator( type ); 443 448 } … … 514 519 } // for 515 520 if ( desigAlts.size() > 1 ) { 516 throw SemanticError( toString("Too many alternatives (", desigAlts.size(), ") for designation: "), designation);521 SemanticError( designation, toString("Too many alternatives (", desigAlts.size(), ") for designation: ") ); 517 522 } else if ( desigAlts.size() == 0 ) { 518 throw SemanticError( "No reasonable alternatives for designation: ", designation);523 SemanticError( designation, "No reasonable alternatives for designation: " ); 519 524 } 520 525 DesignatorChain & d = desigAlts.back(); -
src/ResolvExpr/ExplodedActual.h
rf9feab8 r90152a4 32 32 33 33 ExplodedActual() : env(), cost(Cost::zero), exprs() {} 34 35 34 ExplodedActual( const Alternative& actual, const SymTab::Indexer& indexer ); 35 ExplodedActual(ExplodedActual&&) = default; 36 ExplodedActual& operator= (ExplodedActual&&) = default; 36 37 }; 37 38 } -
src/ResolvExpr/FindOpenVars.cc
rf9feab8 r90152a4 19 19 #include <map> // for map<>::mapped_type 20 20 21 #include "Common/PassVisitor.h" 21 22 #include "SynTree/Declaration.h" // for TypeDecl, DeclarationWithType (ptr ... 22 23 #include "SynTree/Type.h" // for Type, Type::ForallList, ArrayType 23 #include "SynTree/Visitor.h" // for Visitor24 24 25 25 namespace ResolvExpr { 26 class FindOpenVars : public Visitor { 27 public: 26 struct FindOpenVars : public WithGuards { 28 27 FindOpenVars( OpenVarSet &openVars, OpenVarSet &closedVars, AssertionSet &needAssertions, AssertionSet &haveAssertions, bool firstIsOpen ); 29 28 30 private: 31 virtual void visit(PointerType *pointerType); 32 virtual void visit(ArrayType *arrayType); 33 virtual void visit(FunctionType *functionType); 34 virtual void visit(TupleType *tupleType); 29 void previsit( PointerType * pointerType ); 30 void previsit( ArrayType * arrayType ); 31 void previsit( FunctionType * functionType ); 32 void previsit( TupleType * tupleType ); 35 33 36 34 void common_action( Type *type ); … … 42 40 43 41 void findOpenVars( Type *type, OpenVarSet &openVars, OpenVarSet &closedVars, AssertionSet &needAssertions, AssertionSet &haveAssertions, bool firstIsOpen ) { 44 FindOpenVarsfinder( openVars, closedVars, needAssertions, haveAssertions, firstIsOpen );42 PassVisitor<FindOpenVars> finder( openVars, closedVars, needAssertions, haveAssertions, firstIsOpen ); 45 43 type->accept( finder ); 46 44 } … … 70 68 } // for 71 69 } // if 72 /// std::c out<< "type is ";73 /// type->print( std::c out);74 /// std::c out<< std::endl << "need is" << std::endl;75 /// printAssertionSet( needAssertions, std::c out);76 /// std::c out<< std::endl << "have is" << std::endl;77 /// printAssertionSet( haveAssertions, std::c out);70 /// std::cerr << "type is "; 71 /// type->print( std::cerr ); 72 /// std::cerr << std::endl << "need is" << std::endl; 73 /// printAssertionSet( needAssertions, std::cerr ); 74 /// std::cerr << std::endl << "have is" << std::endl; 75 /// printAssertionSet( haveAssertions, std::cerr ); 78 76 } 79 77 80 void FindOpenVars:: visit(PointerType *pointerType) {78 void FindOpenVars::previsit(PointerType *pointerType) { 81 79 common_action( pointerType ); 82 Visitor::visit( pointerType );83 80 } 84 81 85 void FindOpenVars:: visit(ArrayType *arrayType) {82 void FindOpenVars::previsit(ArrayType *arrayType) { 86 83 common_action( arrayType ); 87 Visitor::visit( arrayType );88 84 } 89 85 90 void FindOpenVars:: visit(FunctionType *functionType) {86 void FindOpenVars::previsit(FunctionType *functionType) { 91 87 common_action( functionType ); 92 88 nextIsOpen = ! nextIsOpen; 93 Visitor::visit( functionType ); 94 nextIsOpen = ! nextIsOpen; 89 GuardAction( [this](){ nextIsOpen = ! nextIsOpen; } ); 95 90 } 96 91 97 void FindOpenVars:: visit(TupleType *tupleType) {92 void FindOpenVars::previsit(TupleType *tupleType) { 98 93 common_action( tupleType ); 99 Visitor::visit( tupleType );100 94 } 101 95 } // namespace ResolvExpr -
src/ResolvExpr/Occurs.cc
rf9feab8 r90152a4 5 5 // file "LICENCE" distributed with Cforall. 6 6 // 7 // Occurs.cc -- 7 // Occurs.cc -- 8 8 // 9 9 // Author : Richard C. Bilson … … 17 17 #include <string> // for string 18 18 19 #include "Common/PassVisitor.h" 19 20 #include "SynTree/Type.h" // for TypeInstType, Type 20 #include "SynTree/Visitor.h" // for Visitor21 21 #include "TypeEnvironment.h" // for EqvClass, TypeEnvironment 22 22 23 23 namespace ResolvExpr { 24 class Occurs : public Visitor { 25 public: 24 struct Occurs : public WithVisitorRef<Occurs> { 26 25 Occurs( std::string varName, const TypeEnvironment &env ); 27 bool get_result() const { return result; } 28 virtual void visit( TypeInstType *typeInst ); 29 private: 26 void previsit( TypeInstType * typeInst ); 27 30 28 bool result; 31 29 std::set< std::string > eqvVars; 32 const TypeEnvironment & env;30 const TypeEnvironment &tenv; 33 31 }; 34 32 35 33 bool occurs( Type *type, std::string varName, const TypeEnvironment &env ) { 36 Occursoccur( varName, env );34 PassVisitor<Occurs> occur( varName, env ); 37 35 type->accept( occur ); 38 return occur. get_result();36 return occur.pass.result; 39 37 } 40 38 41 Occurs::Occurs( std::string varName, const TypeEnvironment &env ) : result( false ), env( env ) { 42 EqvClass eqvClass; 43 if ( env.lookup( varName, eqvClass ) ) { 44 eqvVars = eqvClass.vars; 39 Occurs::Occurs( std::string varName, const TypeEnvironment & env ) : result( false ), tenv( env ) { 40 if ( const EqvClass *eqvClass = tenv.lookup( varName ) ) { 41 eqvVars = eqvClass->vars; 45 42 } else { 46 43 eqvVars.insert( varName ); … … 48 45 } 49 46 50 void Occurs::visit( TypeInstType *typeInst ) { 51 EqvClass eqvClass; 52 /// std::cout << "searching for vars: "; 53 /// std::copy( eqvVars.begin(), eqvVars.end(), std::ostream_iterator< std::string >( std::cout, " " ) ); 54 /// std::cout << std::endl; 47 void Occurs::previsit( TypeInstType * typeInst ) { 48 /// std::cerr << "searching for vars: "; 49 /// std::copy( eqvVars.begin(), eqvVars.end(), std::ostream_iterator< std::string >( std::cerr, " " ) ); 50 /// std::cerr << std::endl; 55 51 if ( eqvVars.find( typeInst->get_name() ) != eqvVars.end() ) { 56 52 result = true; 57 } else if ( env.lookup( typeInst->get_name(), eqvClass) ) {58 if ( eqvClass .type ) {59 /// std::c out<< typeInst->get_name() << " is bound to";60 /// eqvClass.type->print( std::c out);61 /// std::c out<< std::endl;62 eqvClass .type->accept( *this);53 } else if ( const EqvClass *eqvClass = tenv.lookup( typeInst->get_name() ) ) { 54 if ( eqvClass->type ) { 55 /// std::cerr << typeInst->get_name() << " is bound to"; 56 /// eqvClass.type->print( std::cerr ); 57 /// std::cerr << std::endl; 58 eqvClass->type->accept( *visitor ); 63 59 } // if 64 60 } // if -
src/ResolvExpr/PolyCost.cc
rf9feab8 r90152a4 14 14 // 15 15 16 #include "Common/PassVisitor.h" 16 17 #include "SymTab/Indexer.h" // for Indexer 17 18 #include "SynTree/Type.h" // for TypeInstType, Type 18 #include "SynTree/Visitor.h" // for Visitor19 19 #include "TypeEnvironment.h" // for EqvClass, TypeEnvironment 20 20 21 21 namespace ResolvExpr { 22 class PolyCost : public Visitor { 23 public: 22 struct PolyCost { 24 23 PolyCost( const TypeEnvironment &env, const SymTab::Indexer &indexer ); 25 int get_result() const { return result; } 26 private: 27 virtual void visit(TypeInstType *aggregateUseType); 24 25 void previsit( TypeInstType * aggregateUseType ); 28 26 int result; 29 const TypeEnvironment & env;27 const TypeEnvironment &tenv; 30 28 const SymTab::Indexer &indexer; 31 29 }; 32 30 33 31 int polyCost( Type *type, const TypeEnvironment & env, const SymTab::Indexer &indexer ) { 34 P olyCostcoster( env, indexer );32 PassVisitor<PolyCost> coster( env, indexer ); 35 33 type->accept( coster ); 36 return coster. get_result();34 return coster.pass.result; 37 35 } 38 36 39 PolyCost::PolyCost( const TypeEnvironment & env, const SymTab::Indexer & indexer ) : result( 0 ), env( env ), indexer( indexer ) {37 PolyCost::PolyCost( const TypeEnvironment & env, const SymTab::Indexer & indexer ) : result( 0 ), tenv( env ), indexer( indexer ) { 40 38 } 41 39 42 void PolyCost::visit(TypeInstType * typeInst) { 43 EqvClass eqvClass; 44 if ( env.lookup( typeInst->name, eqvClass ) ) { 45 if ( eqvClass.type ) { 46 if ( TypeInstType * otherTypeInst = dynamic_cast< TypeInstType* >( eqvClass.type ) ) { 40 void PolyCost::previsit(TypeInstType * typeInst) { 41 if ( const EqvClass *eqvClass = tenv.lookup( typeInst->name ) ) { 42 if ( eqvClass->type ) { 43 if ( TypeInstType * otherTypeInst = dynamic_cast< TypeInstType* >( eqvClass->type ) ) { 47 44 if ( indexer.lookupType( otherTypeInst->name ) ) { 48 45 // bound to opaque type -
src/ResolvExpr/PtrsAssignable.cc
rf9feab8 r90152a4 14 14 // 15 15 16 #include "Common/PassVisitor.h" 16 17 #include "ResolvExpr/TypeEnvironment.h" // for EqvClass, TypeEnvironment 17 18 #include "SynTree/Type.h" // for TypeInstType, Type, BasicType … … 20 21 21 22 namespace ResolvExpr { 22 class PtrsAssignable : public Visitor { 23 public: 23 struct PtrsAssignable : public WithShortCircuiting { 24 24 PtrsAssignable( Type *dest, const TypeEnvironment &env ); 25 25 26 26 int get_result() const { return result; } 27 27 28 virtual void visit( VoidType *voidType ); 29 virtual void visit( BasicType *basicType ); 30 virtual void visit( PointerType *pointerType ); 31 virtual void visit( ArrayType *arrayType ); 32 virtual void visit( FunctionType *functionType ); 33 virtual void visit( StructInstType *inst ); 34 virtual void visit( UnionInstType *inst ); 35 virtual void visit( EnumInstType *inst ); 36 virtual void visit( TraitInstType *inst ); 37 virtual void visit( TypeInstType *inst ); 38 virtual void visit( TupleType *tupleType ); 39 virtual void visit( VarArgsType *varArgsType ); 40 virtual void visit( ZeroType *zeroType ); 41 virtual void visit( OneType *oneType ); 28 void previsit( Type * ) { visit_children = false; } 29 30 void postvisit( VoidType * voidType ); 31 void postvisit( BasicType * basicType ); 32 void postvisit( PointerType * pointerType ); 33 void postvisit( ArrayType * arrayType ); 34 void postvisit( FunctionType * functionType ); 35 void postvisit( StructInstType * inst ); 36 void postvisit( UnionInstType * inst ); 37 void postvisit( EnumInstType * inst ); 38 void postvisit( TraitInstType * inst ); 39 void postvisit( TypeInstType * inst ); 40 void postvisit( TupleType * tupleType ); 41 void postvisit( VarArgsType * varArgsType ); 42 void postvisit( ZeroType * zeroType ); 43 void postvisit( OneType * oneType ); 42 44 private: 43 45 Type *dest; … … 49 51 // std::cerr << "assignable: " << src << " | " << dest << std::endl; 50 52 if ( TypeInstType *destAsTypeInst = dynamic_cast< TypeInstType* >( dest ) ) { 51 EqvClass eqvClass; 52 if ( env.lookup( destAsTypeInst->get_name(), eqvClass ) ) { 53 return ptrsAssignable( src, eqvClass.type, env ); 53 if ( const EqvClass *eqvClass = env.lookup( destAsTypeInst->get_name() ) ) { 54 return ptrsAssignable( src, eqvClass->type, env ); 54 55 } // if 55 56 } // if … … 59 60 return -1; 60 61 } else { 61 P trsAssignableptrs( dest, env );62 PassVisitor<PtrsAssignable> ptrs( dest, env ); 62 63 src->accept( ptrs ); 63 return ptrs. get_result();64 return ptrs.pass.get_result(); 64 65 } // if 65 66 } … … 67 68 PtrsAssignable::PtrsAssignable( Type *dest, const TypeEnvironment &env ) : dest( dest ), result( 0 ), env( env ) {} 68 69 69 void PtrsAssignable:: visit( __attribute((unused)) VoidType *voidType) {70 void PtrsAssignable::postvisit( VoidType * ) { 70 71 // T * = void * is disallowed - this is a change from C, where any 71 72 // void * can be assigned or passed to a non-void pointer without a cast. 72 73 } 73 74 74 void PtrsAssignable:: visit( __attribute__((unused)) BasicType *basicType ) {}75 void PtrsAssignable:: visit( __attribute__((unused)) PointerType *pointerType ) {}76 void PtrsAssignable:: visit( __attribute__((unused)) ArrayType *arrayType ) {}77 void PtrsAssignable:: visit( __attribute__((unused)) FunctionType *functionType ) {}75 void PtrsAssignable::postvisit( __attribute__((unused)) BasicType *basicType ) {} 76 void PtrsAssignable::postvisit( __attribute__((unused)) PointerType *pointerType ) {} 77 void PtrsAssignable::postvisit( __attribute__((unused)) ArrayType *arrayType ) {} 78 void PtrsAssignable::postvisit( __attribute__((unused)) FunctionType *functionType ) {} 78 79 79 void PtrsAssignable:: visit( __attribute__((unused)) StructInstType *inst ) {}80 void PtrsAssignable:: visit( __attribute__((unused)) UnionInstType *inst ) {}80 void PtrsAssignable::postvisit( __attribute__((unused)) StructInstType *inst ) {} 81 void PtrsAssignable::postvisit( __attribute__((unused)) UnionInstType *inst ) {} 81 82 82 void PtrsAssignable:: visit( EnumInstType * ) {83 void PtrsAssignable::postvisit( EnumInstType * ) { 83 84 if ( dynamic_cast< BasicType* >( dest ) ) { 84 85 // int * = E *, etc. is safe. This isn't technically correct, as each … … 91 92 } 92 93 93 void PtrsAssignable::visit( __attribute__((unused)) TraitInstType *inst ) {} 94 void PtrsAssignable::visit( TypeInstType *inst ) { 95 EqvClass eqvClass; 96 if ( env.lookup( inst->get_name(), eqvClass ) && eqvClass.type ) { 97 // T * = S * for any S depends on the type bound to T 98 result = ptrsAssignable( eqvClass.type, dest, env ); 94 void PtrsAssignable::postvisit( __attribute__((unused)) TraitInstType *inst ) {} 95 void PtrsAssignable::postvisit( TypeInstType *inst ) { 96 if ( const EqvClass *eqvClass = env.lookup( inst->get_name() ) ) { 97 if ( eqvClass->type ) { 98 // T * = S * for any S depends on the type bound to T 99 result = ptrsAssignable( eqvClass->type, dest, env ); 100 } 99 101 } // if 100 102 } 101 103 102 void PtrsAssignable:: visit( __attribute__((unused)) TupleType *tupleType ) {}103 void PtrsAssignable:: visit( __attribute__((unused)) VarArgsType *varArgsType ) {}104 void PtrsAssignable:: visit( __attribute__((unused)) ZeroType *zeroType ) {}105 void PtrsAssignable:: visit( __attribute__((unused)) OneType *oneType ) {}104 void PtrsAssignable::postvisit( __attribute__((unused)) TupleType *tupleType ) {} 105 void PtrsAssignable::postvisit( __attribute__((unused)) VarArgsType *varArgsType ) {} 106 void PtrsAssignable::postvisit( __attribute__((unused)) ZeroType *zeroType ) {} 107 void PtrsAssignable::postvisit( __attribute__((unused)) OneType *oneType ) {} 106 108 107 109 } // namespace ResolvExpr -
src/ResolvExpr/PtrsCastable.cc
rf9feab8 r90152a4 14 14 // 15 15 16 #include "Common/PassVisitor.h" 16 17 #include "ResolvExpr/TypeEnvironment.h" // for EqvClass, TypeEnvironment 17 18 #include "SymTab/Indexer.h" // for Indexer … … 21 22 #include "typeops.h" // for ptrsAssignable 22 23 23 24 24 namespace ResolvExpr { 25 class PtrsCastable : public Visitor{25 struct PtrsCastable : public WithShortCircuiting { 26 26 public: 27 27 PtrsCastable( Type *dest, const TypeEnvironment &env, const SymTab::Indexer &indexer ); … … 29 29 int get_result() const { return result; } 30 30 31 virtual void visit(VoidType *voidType); 32 virtual void visit(BasicType *basicType); 33 virtual void visit(PointerType *pointerType); 34 virtual void visit(ArrayType *arrayType); 35 virtual void visit(FunctionType *functionType); 36 virtual void visit(StructInstType *inst); 37 virtual void visit(UnionInstType *inst); 38 virtual void visit(EnumInstType *inst); 39 virtual void visit(TraitInstType *inst); 40 virtual void visit(TypeInstType *inst); 41 virtual void visit(TupleType *tupleType); 42 virtual void visit(VarArgsType *varArgsType); 43 virtual void visit(ZeroType *zeroType); 44 virtual void visit(OneType *oneType); 31 void previsit( Type * ) { visit_children = false; } 32 33 void postvisit( VoidType * voidType ); 34 void postvisit( BasicType * basicType ); 35 void postvisit( PointerType * pointerType ); 36 void postvisit( ArrayType * arrayType ); 37 void postvisit( FunctionType * functionType ); 38 void postvisit( StructInstType * inst ); 39 void postvisit( UnionInstType * inst ); 40 void postvisit( EnumInstType * inst ); 41 void postvisit( TraitInstType * inst ); 42 void postvisit( TypeInstType * inst ); 43 void postvisit( TupleType * tupleType ); 44 void postvisit( VarArgsType * varArgsType ); 45 void postvisit( ZeroType * zeroType ); 46 void postvisit( OneType * oneType ); 45 47 private: 46 48 Type *dest; … … 55 57 return -1; 56 58 } else if ( TypeInstType *typeInst = dynamic_cast< TypeInstType* >( src ) ) { 57 EqvClass eqvClass;58 59 if ( NamedTypeDecl *ntDecl = indexer.lookupType( typeInst->get_name() ) ) { 59 60 if ( TypeDecl *tyDecl = dynamic_cast< TypeDecl* >( ntDecl ) ) { … … 62 63 } // if 63 64 } //if 64 } else if ( env.lookup( typeInst->get_name(), eqvClass) ) {65 if ( eqvClass .data.kind == TypeDecl::Ftype ) {65 } else if ( const EqvClass *eqvClass = env.lookup( typeInst->get_name() ) ) { 66 if ( eqvClass->data.kind == TypeDecl::Ftype ) { 66 67 return -1; 67 68 } // if … … 77 78 int ptrsCastable( Type *src, Type *dest, const TypeEnvironment &env, const SymTab::Indexer &indexer ) { 78 79 if ( TypeInstType *destAsTypeInst = dynamic_cast< TypeInstType* >( dest ) ) { 79 EqvClass eqvClass;80 if ( env.lookup( destAsTypeInst->get_name(), eqvClass ) ) {81 return ptrsAssignable( src, eqvClass .type, env );80 if ( const EqvClass *eqvClass = env.lookup( destAsTypeInst->get_name() ) ) { 81 // xxx - should this be ptrsCastable? 82 return ptrsAssignable( src, eqvClass->type, env ); 82 83 } // if 83 84 } // if … … 85 86 return objectCast( src, env, indexer ); 86 87 } else { 87 P trsCastableptrs( dest, env, indexer );88 PassVisitor<PtrsCastable> ptrs( dest, env, indexer ); 88 89 src->accept( ptrs ); 89 return ptrs. get_result();90 return ptrs.pass.get_result(); 90 91 } // if 91 92 } … … 95 96 } 96 97 97 void PtrsCastable:: visit( VoidType * ) {98 void PtrsCastable::postvisit( VoidType * ) { 98 99 result = objectCast( dest, env, indexer ); 99 100 } 100 101 101 void PtrsCastable:: visit( BasicType * ) {102 void PtrsCastable::postvisit( BasicType * ) { 102 103 result = objectCast( dest, env, indexer ); 103 104 } 104 105 105 void PtrsCastable:: visit( PointerType * ) {106 void PtrsCastable::postvisit( PointerType * ) { 106 107 result = objectCast( dest, env, indexer ); 107 108 } 108 109 109 void PtrsCastable:: visit( ArrayType * ) {110 void PtrsCastable::postvisit( ArrayType * ) { 110 111 result = objectCast( dest, env, indexer ); 111 112 } 112 113 113 void PtrsCastable:: visit( FunctionType * ) {114 void PtrsCastable::postvisit( FunctionType * ) { 114 115 // result = -1; 115 116 result = functionCast( dest, env, indexer ); 116 117 } 117 118 118 void PtrsCastable:: visit( StructInstType * ) {119 void PtrsCastable::postvisit( StructInstType * ) { 119 120 result = objectCast( dest, env, indexer ); 120 121 } 121 122 122 void PtrsCastable:: visit( UnionInstType * ) {123 void PtrsCastable::postvisit( UnionInstType * ) { 123 124 result = objectCast( dest, env, indexer ); 124 125 } 125 126 126 void PtrsCastable:: visit( EnumInstType * ) {127 void PtrsCastable::postvisit( EnumInstType * ) { 127 128 if ( dynamic_cast< EnumInstType* >( dest ) ) { 128 129 result = 1; … … 138 139 } 139 140 140 void PtrsCastable:: visit( TraitInstType * ) {}141 void PtrsCastable::postvisit( TraitInstType * ) {} 141 142 142 void PtrsCastable:: visit(TypeInstType *inst) {143 void PtrsCastable::postvisit(TypeInstType *inst) { 143 144 //result = objectCast( inst, env, indexer ) > 0 && objectCast( dest, env, indexer ) > 0 ? 1 : -1; 144 145 result = objectCast( inst, env, indexer ) == objectCast( dest, env, indexer ) ? 1 : -1; 145 146 } 146 147 147 void PtrsCastable:: visit( TupleType * ) {148 void PtrsCastable::postvisit( TupleType * ) { 148 149 result = objectCast( dest, env, indexer ); 149 150 } 150 151 151 void PtrsCastable:: visit( VarArgsType * ) {152 void PtrsCastable::postvisit( VarArgsType * ) { 152 153 result = objectCast( dest, env, indexer ); 153 154 } 154 155 155 void PtrsCastable:: visit( ZeroType * ) {156 void PtrsCastable::postvisit( ZeroType * ) { 156 157 result = objectCast( dest, env, indexer ); 157 158 } 158 159 159 void PtrsCastable:: visit( OneType * ) {160 void PtrsCastable::postvisit( OneType * ) { 160 161 result = objectCast( dest, env, indexer ); 161 162 } -
src/ResolvExpr/RenameVars.cc
rf9feab8 r90152a4 19 19 #include <utility> // for pair 20 20 21 #include "Common/PassVisitor.h" 21 22 #include "Common/SemanticError.h" // for SemanticError 22 23 #include "RenameVars.h" … … 27 28 28 29 namespace ResolvExpr { 29 RenameVars global_renamer; 30 namespace { 31 struct RenameVars { 32 RenameVars(); 33 void reset(); 30 34 31 RenameVars::RenameVars() : level( 0 ), resetCount( 0 ) { 32 mapStack.push_front( std::map< std::string, std::string >() ); 35 void previsit( TypeInstType * instType ); 36 void previsit( Type * ); 37 void postvisit( Type * ); 38 39 private: 40 int level, resetCount; 41 std::list< std::map< std::string, std::string > > mapStack; 42 }; 43 44 PassVisitor<RenameVars> global_renamer; 45 } // namespace 46 47 void renameTyVars( Type * t ) { 48 t->accept( global_renamer ); 33 49 } 34 50 35 void RenameVars::reset() { 36 level = 0; 37 resetCount++; 51 void resetTyVarRenaming() { 52 global_renamer.pass.reset(); 38 53 } 39 54 40 void RenameVars::visit( VoidType *voidType ){41 typeBefore( voidType );42 typeAfter( voidType);43 }55 namespace { 56 RenameVars::RenameVars() : level( 0 ), resetCount( 0 ) { 57 mapStack.push_front( std::map< std::string, std::string >() ); 58 } 44 59 45 void RenameVars::visit( BasicType *basicType) {46 typeBefore( basicType );47 typeAfter( basicType );48 }60 void RenameVars::reset() { 61 level = 0; 62 resetCount++; 63 } 49 64 50 void RenameVars::visit( PointerType *pointerType ) { 51 typeBefore( pointerType ); 52 maybeAccept( pointerType->get_base(), *this ); 53 typeAfter( pointerType ); 54 } 65 void RenameVars::previsit( TypeInstType * instType ) { 66 previsit( (Type *)instType ); 67 std::map< std::string, std::string >::const_iterator i = mapStack.front().find( instType->name ); 68 if ( i != mapStack.front().end() ) { 69 instType->name = i->second; 70 } // if 71 } 55 72 56 void RenameVars::visit( ArrayType *arrayType ) { 57 typeBefore( arrayType ); 58 maybeAccept( arrayType->get_dimension(), *this ); 59 maybeAccept( arrayType->get_base(), *this ); 60 typeAfter( arrayType ); 61 } 73 void RenameVars::previsit( Type * type ) { 74 if ( ! type->forall.empty() ) { 75 // copies current name mapping into new mapping 76 mapStack.push_front( mapStack.front() ); 77 // renames all "forall" type names to `_${level}_${name}' 78 for ( auto td : type->forall ) { 79 std::ostringstream output; 80 output << "_" << resetCount << "_" << level << "_" << td->name; 81 std::string newname( output.str() ); 82 mapStack.front()[ td->get_name() ] = newname; 83 td->name = newname; 84 // ditto for assertion names, the next level in 85 level++; 86 // acceptAll( td->assertions, *this ); 87 } // for 88 } // if 89 } 62 90 63 void RenameVars::visit( FunctionType *functionType ) { 64 typeBefore( functionType ); 65 acceptAll( functionType->get_returnVals(), *this ); 66 acceptAll( functionType->get_parameters(), *this ); 67 typeAfter( functionType ); 68 } 69 70 void RenameVars::visit( StructInstType *aggregateUseType ) { 71 typeBefore( aggregateUseType ); 72 acceptAll( aggregateUseType->get_parameters(), *this ); 73 typeAfter( aggregateUseType ); 74 } 75 76 void RenameVars::visit( UnionInstType *aggregateUseType ) { 77 typeBefore( aggregateUseType ); 78 acceptAll( aggregateUseType->get_parameters(), *this ); 79 typeAfter( aggregateUseType ); 80 } 81 82 void RenameVars::visit( EnumInstType *aggregateUseType ) { 83 typeBefore( aggregateUseType ); 84 acceptAll( aggregateUseType->get_parameters(), *this ); 85 typeAfter( aggregateUseType ); 86 } 87 88 void RenameVars::visit( TraitInstType *aggregateUseType ) { 89 typeBefore( aggregateUseType ); 90 acceptAll( aggregateUseType->get_parameters(), *this ); 91 typeAfter( aggregateUseType ); 92 } 93 94 void RenameVars::visit( TypeInstType *instType ) { 95 typeBefore( instType ); 96 std::map< std::string, std::string >::const_iterator i = mapStack.front().find( instType->get_name() ); 97 if ( i != mapStack.front().end() ) { 98 instType->set_name( i->second ); 99 } else { 100 } // if 101 acceptAll( instType->get_parameters(), *this ); 102 typeAfter( instType ); 103 } 104 105 void RenameVars::visit( TupleType *tupleType ) { 106 typeBefore( tupleType ); 107 acceptAll( tupleType->get_types(), *this ); 108 typeAfter( tupleType ); 109 } 110 111 void RenameVars::visit( VarArgsType *varArgsType ) { 112 typeBefore( varArgsType ); 113 typeAfter( varArgsType ); 114 } 115 116 void RenameVars::visit( ZeroType *zeroType ) { 117 typeBefore( zeroType ); 118 typeAfter( zeroType ); 119 } 120 121 void RenameVars::visit( OneType *oneType ) { 122 typeBefore( oneType ); 123 typeAfter( oneType ); 124 } 125 126 void RenameVars::typeBefore( Type *type ) { 127 if ( ! type->get_forall().empty() ) { 128 // copies current name mapping into new mapping 129 mapStack.push_front( mapStack.front() ); 130 // renames all "forall" type names to `_${level}_${name}' 131 for ( Type::ForallList::iterator i = type->get_forall().begin(); i != type->get_forall().end(); ++i ) { 132 std::ostringstream output; 133 output << "_" << resetCount << "_" << level << "_" << (*i)->get_name(); 134 std::string newname( output.str() ); 135 mapStack.front()[ (*i)->get_name() ] = newname; 136 (*i)->set_name( newname ); 137 // ditto for assertion names, the next level in 138 level++; 139 acceptAll( (*i)->get_assertions(), *this ); 140 } // for 141 } // if 142 } 143 144 void RenameVars::typeAfter( Type *type ) { 145 // clears name mapping added by typeBefore() 146 if ( ! type->get_forall().empty() ) { 147 mapStack.pop_front(); 148 } // if 149 } 150 91 void RenameVars::postvisit( Type * type ) { 92 // clears name mapping added by typeBefore() 93 if ( ! type->forall.empty() ) { 94 mapStack.pop_front(); 95 } // if 96 } 97 } // namespace 151 98 } // namespace ResolvExpr 152 99 -
src/ResolvExpr/RenameVars.h
rf9feab8 r90152a4 24 24 25 25 namespace ResolvExpr { 26 /// Provides a consistent renaming of forall type names in a hierarchy by prefixing them with a unique "level" ID 27 void renameTyVars( Type * ); 26 28 27 /// Provides a consistent renaming of forall type names in a hierarchy by prefixing them with a unique "level" ID 28 class RenameVars : public Visitor { 29 public: 30 RenameVars(); 31 void reset(); 32 private: 33 virtual void visit( VoidType *basicType ); 34 virtual void visit( BasicType *basicType ); 35 virtual void visit( PointerType *pointerType ); 36 virtual void visit( ArrayType *arrayType ); 37 virtual void visit( FunctionType *functionType ); 38 virtual void visit( StructInstType *aggregateUseType ); 39 virtual void visit( UnionInstType *aggregateUseType ); 40 virtual void visit( EnumInstType *aggregateUseType ); 41 virtual void visit( TraitInstType *aggregateUseType ); 42 virtual void visit( TypeInstType *aggregateUseType ); 43 virtual void visit( TupleType *tupleType ); 44 virtual void visit( VarArgsType *varArgsType ); 45 virtual void visit( ZeroType *zeroType ); 46 virtual void visit( OneType *oneType ); 47 48 void typeBefore( Type *type ); 49 void typeAfter( Type *type ); 50 int level, resetCount; 51 std::list< std::map< std::string, std::string > > mapStack; 52 }; 53 54 extern RenameVars global_renamer; 29 /// resets internal state of renamer to avoid overflow 30 void resetTyVarRenaming(); 55 31 } // namespace ResolvExpr 56 32 -
src/ResolvExpr/Resolver.cc
rf9feab8 r90152a4 9 9 // Author : Richard C. Bilson 10 10 // Created On : Sun May 17 12:17:01 2015 11 // Last Modified By : Andrew Beach12 // Last Modified On : Tus Aug 8 16:06:00 201713 // Update Count : 21 211 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Sat Feb 17 11:19:40 2018 13 // Update Count : 213 14 14 // 15 15 … … 30 30 #include "RenameVars.h" // for RenameVars, global_renamer 31 31 #include "ResolvExpr/TypeEnvironment.h" // for TypeEnvironment 32 #include "ResolveTypeof.h" // for resolveTypeof33 32 #include "Resolver.h" 34 33 #include "SymTab/Autogen.h" // for SizeType … … 57 56 void postvisit( FunctionDecl *functionDecl ); 58 57 void previsit( ObjectDecl *objectDecll ); 59 void previsit( TypeDecl *typeDecl );60 58 void previsit( EnumDecl * enumDecl ); 59 void previsit( StaticAssertDecl * assertDecl ); 61 60 62 61 void previsit( ArrayType * at ); … … 76 75 void previsit( CatchStmt *catchStmt ); 77 76 void previsit( WaitForStmt * stmt ); 78 void previsit( WithStmt * withStmt );79 77 80 78 void previsit( SingleInit *singleInit ); … … 82 80 void previsit( ConstructorInit *ctorInit ); 83 81 private: 84 typedef std::list< Initializer * >::iterator InitIterator;82 typedef std::list< Initializer * >::iterator InitIterator; 85 83 86 84 template< typename PtrType > 87 85 void handlePtrType( PtrType * type ); 88 86 89 void resolveAggrInit( ReferenceToType *, InitIterator &, InitIterator & ); 90 void resolveSingleAggrInit( Declaration *, InitIterator &, InitIterator &, TypeSubstitution sub ); 91 void fallbackInit( ConstructorInit * ctorInit ); 87 void fallbackInit( ConstructorInit * ctorInit ); 92 88 93 89 Type * functionReturn = nullptr; … … 96 92 }; 97 93 94 struct ResolveWithExprs : public WithIndexer, public WithGuards, public WithVisitorRef<ResolveWithExprs>, public WithShortCircuiting, public WithStmtsToAdd { 95 void previsit( FunctionDecl * ); 96 void previsit( WithStmt * ); 97 98 void resolveWithExprs( std::list< Expression * > & withExprs, std::list< Statement * > & newStmts ); 99 }; 100 98 101 void resolve( std::list< Declaration * > translationUnit ) { 99 102 PassVisitor<Resolver> resolver; … … 106 109 } 107 110 108 // used in resolveTypeof109 Expression *resolveInVoidContext( Expression *expr, const SymTab::Indexer &indexer ) {110 TypeEnvironment env;111 return resolveInVoidContext( expr, indexer, env );112 }113 114 111 namespace { 115 void finishExpr( Expression *expr, const TypeEnvironment &env, TypeSubstitution * oldenv = nullptr ) { 112 struct DeleteFinder : public WithShortCircuiting { 113 DeletedExpr * delExpr = nullptr; 114 void previsit( DeletedExpr * expr ) { 115 if ( delExpr ) visit_children = false; 116 else delExpr = expr; 117 } 118 119 void previsit( Expression * ) { 120 if ( delExpr ) visit_children = false; 121 } 122 }; 123 } 124 125 DeletedExpr * findDeletedExpr( Expression * expr ) { 126 PassVisitor<DeleteFinder> finder; 127 expr->accept( finder ); 128 return finder.pass.delExpr; 129 } 130 131 namespace { 132 struct StripCasts { 133 Expression * postmutate( CastExpr * castExpr ) { 134 if ( castExpr->isGenerated && ResolvExpr::typesCompatible( castExpr->arg->result, castExpr->result, SymTab::Indexer() ) ) { 135 // generated cast is to the same type as its argument, so it's unnecessary -- remove it 136 Expression * expr = castExpr->arg; 137 castExpr->arg = nullptr; 138 std::swap( expr->env, castExpr->env ); 139 return expr; 140 } 141 return castExpr; 142 } 143 144 static void strip( Expression *& expr ) { 145 PassVisitor<StripCasts> stripper; 146 expr = expr->acceptMutator( stripper ); 147 } 148 }; 149 150 void finishExpr( Expression *&expr, const TypeEnvironment &env, TypeSubstitution * oldenv = nullptr ) { 116 151 expr->env = oldenv ? oldenv->clone() : new TypeSubstitution; 117 env.makeSubstitution( *expr->get_env() ); 152 env.makeSubstitution( *expr->env ); 153 StripCasts::strip( expr ); // remove unnecessary casts that may be buried in an expression 118 154 } 119 155 … … 131 167 } // namespace 132 168 169 namespace { 170 void findUnfinishedKindExpression(Expression * untyped, Alternative & alt, const SymTab::Indexer & indexer, const std::string & kindStr, std::function<bool(const Alternative &)> pred, bool adjust = false, bool prune = true, bool failFast = true) { 171 assertf( untyped, "expected a non-null expression." ); 172 TypeEnvironment env; 173 AlternativeFinder finder( indexer, env ); 174 finder.find( untyped, adjust, prune, failFast ); 175 176 #if 0 177 if ( finder.get_alternatives().size() != 1 ) { 178 std::cerr << "untyped expr is "; 179 untyped->print( std::cerr ); 180 std::cerr << std::endl << "alternatives are:"; 181 for ( const Alternative & alt : finder.get_alternatives() ) { 182 alt.print( std::cerr ); 183 } // for 184 } // if 185 #endif 186 187 AltList candidates; 188 for ( Alternative & alt : finder.get_alternatives() ) { 189 if ( pred( alt ) ) { 190 candidates.push_back( std::move( alt ) ); 191 } 192 } 193 194 // xxx - if > 1 alternative with same cost, ignore deleted and pick from remaining 195 // choose the lowest cost expression among the candidates 196 AltList winners; 197 findMinCost( candidates.begin(), candidates.end(), back_inserter( winners ) ); 198 if ( winners.size() == 0 ) { 199 SemanticError( untyped, toString( "No reasonable alternatives for ", kindStr, (kindStr != "" ? " " : ""), "expression: ") ); 200 } else if ( winners.size() != 1 ) { 201 std::ostringstream stream; 202 stream << "Cannot choose between " << winners.size() << " alternatives for " << kindStr << (kindStr != "" ? " " : "") << "expression\n"; 203 untyped->print( stream ); 204 stream << " Alternatives are:\n"; 205 printAlts( winners, stream, 1 ); 206 SemanticError( untyped->location, stream.str() ); 207 } 208 209 // there is one unambiguous interpretation - move the expression into the with statement 210 Alternative & choice = winners.front(); 211 if ( findDeletedExpr( choice.expr ) ) { 212 SemanticError( untyped->location, choice.expr, "Unique best alternative includes deleted identifier in " ); 213 } 214 alt = std::move( choice ); 215 } 216 217 /// resolve `untyped` to the expression whose alternative satisfies `pred` with the lowest cost; kindStr is used for providing better error messages 218 void findKindExpression(Expression *& untyped, const SymTab::Indexer & indexer, const std::string & kindStr, std::function<bool(const Alternative &)> pred, bool adjust = false, bool prune = true, bool failFast = true) { 219 if ( ! untyped ) return; 220 Alternative choice; 221 findUnfinishedKindExpression( untyped, choice, indexer, kindStr, pred, adjust, prune, failFast ); 222 finishExpr( choice.expr, choice.env, untyped->env ); 223 delete untyped; 224 untyped = choice.expr; 225 choice.expr = nullptr; 226 } 227 228 bool standardAlternativeFilter( const Alternative & ) { 229 // currently don't need to filter, under normal circumstances. 230 // in the future, this may be useful for removing deleted expressions 231 return true; 232 } 233 } // namespace 234 235 // used in resolveTypeof 236 Expression * resolveInVoidContext( Expression *expr, const SymTab::Indexer &indexer ) { 237 TypeEnvironment env; 238 return resolveInVoidContext( expr, indexer, env ); 239 } 240 241 Expression * resolveInVoidContext( Expression *expr, const SymTab::Indexer &indexer, TypeEnvironment &env ) { 242 // it's a property of the language that a cast expression has either 1 or 0 interpretations; if it has 0 243 // interpretations, an exception has already been thrown. 244 assertf( expr, "expected a non-null expression." ); 245 246 static CastExpr untyped( nullptr ); // cast to void 247 untyped.location = expr->location; 248 249 // set up and resolve expression cast to void 250 untyped.arg = expr; 251 Alternative choice; 252 findUnfinishedKindExpression( &untyped, choice, indexer, "", standardAlternativeFilter, true ); 253 CastExpr * castExpr = strict_dynamic_cast< CastExpr * >( choice.expr ); 254 env = std::move( choice.env ); 255 256 // clean up resolved expression 257 Expression * ret = castExpr->arg; 258 castExpr->arg = nullptr; 259 260 // unlink the arg so that it isn't deleted twice at the end of the program 261 untyped.arg = nullptr; 262 return ret; 263 } 264 133 265 void findVoidExpression( Expression *& untyped, const SymTab::Indexer &indexer ) { 134 global_renamer.reset();266 resetTyVarRenaming(); 135 267 TypeEnvironment env; 136 Expression * newExpr = resolveInVoidContext( untyped, indexer, env );268 Expression * newExpr = resolveInVoidContext( untyped, indexer, env ); 137 269 finishExpr( newExpr, env, untyped->env ); 138 270 delete untyped; … … 141 273 142 274 void findSingleExpression( Expression *&untyped, const SymTab::Indexer &indexer ) { 143 if ( ! untyped ) return; 144 TypeEnvironment env; 145 AlternativeFinder finder( indexer, env ); 146 finder.find( untyped ); 147 #if 0 148 if ( finder.get_alternatives().size() != 1 ) { 149 std::cerr << "untyped expr is "; 150 untyped->print( std::cerr ); 151 std::cerr << std::endl << "alternatives are:"; 152 for ( const Alternative & alt : finder.get_alternatives() ) { 153 alt.print( std::cerr ); 154 } // for 155 } // if 156 #endif 157 assertf( finder.get_alternatives().size() == 1, "findSingleExpression: must have exactly one alternative at the end." ); 158 Alternative &choice = finder.get_alternatives().front(); 159 Expression *newExpr = choice.expr->clone(); 160 finishExpr( newExpr, choice.env, untyped->env ); 161 delete untyped; 162 untyped = newExpr; 275 findKindExpression( untyped, indexer, "", standardAlternativeFilter ); 163 276 } 164 277 165 278 void findSingleExpression( Expression *& untyped, Type * type, const SymTab::Indexer & indexer ) { 166 279 assert( untyped && type ); 280 // transfer location to generated cast for error purposes 281 CodeLocation location = untyped->location; 167 282 untyped = new CastExpr( untyped, type ); 283 untyped->location = location; 168 284 findSingleExpression( untyped, indexer ); 169 285 removeExtraneousCast( untyped, indexer ); … … 171 287 172 288 namespace { 173 bool isIntegralType( Type *type ) { 289 bool isIntegralType( const Alternative & alt ) { 290 Type * type = alt.expr->result; 174 291 if ( dynamic_cast< EnumInstType * >( type ) ) { 175 292 return true; … … 184 301 185 302 void findIntegralExpression( Expression *& untyped, const SymTab::Indexer &indexer ) { 186 TypeEnvironment env; 187 AlternativeFinder finder( indexer, env ); 188 finder.find( untyped ); 189 #if 0 190 if ( finder.get_alternatives().size() != 1 ) { 191 std::cout << "untyped expr is "; 192 untyped->print( std::cout ); 193 std::cout << std::endl << "alternatives are:"; 194 for ( std::list< Alternative >::const_iterator i = finder.get_alternatives().begin(); i != finder.get_alternatives().end(); ++i ) { 195 i->print( std::cout ); 196 } // for 197 } // if 198 #endif 199 Expression *newExpr = 0; 200 const TypeEnvironment *newEnv = 0; 201 for ( AltList::const_iterator i = finder.get_alternatives().begin(); i != finder.get_alternatives().end(); ++i ) { 202 if ( i->expr->get_result()->size() == 1 && isIntegralType( i->expr->get_result() ) ) { 203 if ( newExpr ) { 204 throw SemanticError( "Too many interpretations for case control expression", untyped ); 205 } else { 206 newExpr = i->expr->clone(); 207 newEnv = &i->env; 208 } // if 209 } // if 210 } // for 211 if ( ! newExpr ) { 212 throw SemanticError( "No interpretations for case control expression", untyped ); 213 } // if 214 finishExpr( newExpr, *newEnv, untyped->env ); 215 delete untyped; 216 untyped = newExpr; 217 } 218 303 findKindExpression( untyped, indexer, "condition", isIntegralType ); 304 } 305 } 306 307 308 bool isStructOrUnion( const Alternative & alt ) { 309 Type * t = alt.expr->result->stripReferences(); 310 return dynamic_cast< StructInstType * >( t ) || dynamic_cast< UnionInstType * >( t ); 311 } 312 313 void resolveWithExprs( std::list< Declaration * > & translationUnit ) { 314 PassVisitor<ResolveWithExprs> resolver; 315 acceptAll( translationUnit, resolver ); 316 } 317 318 void ResolveWithExprs::resolveWithExprs( std::list< Expression * > & withExprs, std::list< Statement * > & newStmts ) { 319 for ( Expression *& expr : withExprs ) { 320 // only struct- and union-typed expressions are viable candidates 321 findKindExpression( expr, indexer, "with statement", isStructOrUnion ); 322 323 // if with expression might be impure, create a temporary so that it is evaluated once 324 if ( Tuples::maybeImpure( expr ) ) { 325 static UniqueName tmpNamer( "_with_tmp_" ); 326 ObjectDecl * tmp = ObjectDecl::newObject( tmpNamer.newName(), expr->result->clone(), new SingleInit( expr ) ); 327 expr = new VariableExpr( tmp ); 328 newStmts.push_back( new DeclStmt( tmp ) ); 329 if ( InitTweak::isConstructable( tmp->type ) ) { 330 // generate ctor/dtor and resolve them 331 tmp->init = InitTweak::genCtorInit( tmp ); 332 tmp->accept( *visitor ); 333 } 334 } 335 } 336 } 337 338 void ResolveWithExprs::previsit( WithStmt * withStmt ) { 339 resolveWithExprs( withStmt->exprs, stmtsToAddBefore ); 340 } 341 342 void ResolveWithExprs::previsit( FunctionDecl * functionDecl ) { 343 { 344 // resolve with-exprs with parameters in scope and add any newly generated declarations to the 345 // front of the function body. 346 auto guard = makeFuncGuard( [this]() { indexer.enterScope(); }, [this](){ indexer.leaveScope(); } ); 347 indexer.addFunctionType( functionDecl->type ); 348 std::list< Statement * > newStmts; 349 resolveWithExprs( functionDecl->withExprs, newStmts ); 350 if ( functionDecl->statements ) { 351 functionDecl->statements->kids.splice( functionDecl->statements->kids.begin(), newStmts ); 352 } else { 353 assertf( functionDecl->withExprs.empty() && newStmts.empty(), "Function %s without a body has with-clause and/or generated with declarations.", functionDecl->name.c_str() ); 354 } 355 } 219 356 } 220 357 221 358 void Resolver::previsit( ObjectDecl *objectDecl ) { 222 Type *new_type = resolveTypeof( objectDecl->get_type(), indexer );223 objectDecl->set_type( new_type );224 359 // To handle initialization of routine pointers, e.g., int (*fp)(int) = foo(), means that class-variable 225 360 // initContext is changed multiple time because the LHS is analysed twice. The second analysis changes … … 251 386 } 252 387 253 void Resolver::previsit( TypeDecl *typeDecl ) {254 if ( typeDecl->get_base() ) {255 Type *new_type = resolveTypeof( typeDecl->get_base(), indexer );256 typeDecl->set_base( new_type );257 } // if258 }259 260 388 void Resolver::previsit( FunctionDecl *functionDecl ) { 261 389 #if 0 … … 264 392 std::cerr << std::endl; 265 393 #endif 266 Type *new_type = resolveTypeof( functionDecl->get_type(), indexer );267 functionDecl->set_type( new_type );268 394 GuardValue( functionReturn ); 269 functionReturn = ResolvExpr::extractResultType( functionDecl-> get_functionType());395 functionReturn = ResolvExpr::extractResultType( functionDecl->type ); 270 396 } 271 397 … … 274 400 // xxx - it might be necessary to somehow keep the information from this environment, but I can't currently 275 401 // see how it's useful. 276 for ( Declaration * d : functionDecl-> get_functionType()->get_parameters()) {402 for ( Declaration * d : functionDecl->type->parameters ) { 277 403 if ( ObjectDecl * obj = dynamic_cast< ObjectDecl * >( d ) ) { 278 if ( SingleInit * init = dynamic_cast< SingleInit * >( obj-> get_init()) ) {279 delete init-> get_value()->get_env();280 init-> get_value()->set_env( nullptr );404 if ( SingleInit * init = dynamic_cast< SingleInit * >( obj->init ) ) { 405 delete init->value->env; 406 init->value->env = nullptr; 281 407 } 282 408 } … … 290 416 } 291 417 418 void Resolver::previsit( StaticAssertDecl * assertDecl ) { 419 findIntegralExpression( assertDecl->condition, indexer ); 420 } 421 292 422 void Resolver::previsit( ExprStmt *exprStmt ) { 293 423 visit_children = false; … … 311 441 312 442 void Resolver::previsit( IfStmt *ifStmt ) { 313 find SingleExpression( ifStmt->condition, indexer );443 findIntegralExpression( ifStmt->condition, indexer ); 314 444 } 315 445 316 446 void Resolver::previsit( WhileStmt *whileStmt ) { 317 find SingleExpression( whileStmt->condition, indexer );447 findIntegralExpression( whileStmt->condition, indexer ); 318 448 } 319 449 320 450 void Resolver::previsit( ForStmt *forStmt ) { 321 451 if ( forStmt->condition ) { 322 find SingleExpression( forStmt->condition, indexer );452 findIntegralExpression( forStmt->condition, indexer ); 323 453 } // if 324 454 … … 336 466 337 467 void Resolver::previsit( CaseStmt *caseStmt ) { 338 if ( caseStmt-> get_condition()) {468 if ( caseStmt->condition ) { 339 469 std::list< InitAlternative > initAlts = currentObject.getOptions(); 340 470 assertf( initAlts.size() == 1, "SwitchStmt did not correctly resolve an integral expression." ); … … 342 472 Expression * newExpr = new CastExpr( caseStmt->condition, initAlts.front().type->clone() ); 343 473 findSingleExpression( newExpr, indexer ); 344 CastExpr * castExpr = strict_dynamic_cast< CastExpr * >( newExpr ); 345 caseStmt->condition = castExpr->arg; 346 castExpr->arg = nullptr; 347 delete castExpr; 474 // case condition cannot have a cast in C, so it must be removed, regardless of whether it performs a conversion. 475 // Ideally we would perform the conversion internally here. 476 if ( CastExpr * castExpr = dynamic_cast< CastExpr * >( newExpr ) ) { 477 newExpr = castExpr->arg; 478 castExpr->arg = nullptr; 479 std::swap( newExpr->env, castExpr->env ); 480 delete castExpr; 481 } 482 caseStmt->condition = newExpr; 348 483 } 349 484 } … … 411 546 ss << strict_dynamic_cast<NameExpr*>( clause.target.function )->name; 412 547 ss << "' in call to waitfor"; 413 throw SemanticError( ss.str() ); 548 SemanticError( stmt->location, ss.str() ); 549 } 550 551 if(clause.target.arguments.empty()) { 552 SemanticError( stmt->location, "Waitfor clause must have at least one mutex parameter"); 414 553 } 415 554 … … 428 567 // try matching the arguments to the parameters 429 568 // not the other way around because we have more arguments than parameters 430 SemanticError errors;569 SemanticErrorException errors; 431 570 for ( Alternative & func : funcFinder.get_alternatives() ) { 432 571 try { 433 572 PointerType * pointer = dynamic_cast< PointerType* >( func.expr->get_result()->stripReferences() ); 434 573 if( !pointer ) { 435 throw SemanticError( "candidate not viable: not a pointer type\n", func.expr->get_result());574 SemanticError( func.expr->get_result(), "candidate not viable: not a pointer type\n" ); 436 575 } 437 576 438 577 FunctionType * function = dynamic_cast< FunctionType* >( pointer->get_base() ); 439 578 if( !function ) { 440 throw SemanticError( "candidate not viable: not a function type\n", pointer->get_base());579 SemanticError( pointer->get_base(), "candidate not viable: not a function type\n" ); 441 580 } 442 581 … … 447 586 448 587 if( !advance_to_mutex( param, param_end ) ) { 449 throw SemanticError("candidate function not viable: no mutex parameters\n", function);588 SemanticError(function, "candidate function not viable: no mutex parameters\n"); 450 589 } 451 590 } … … 453 592 Alternative newFunc( func ); 454 593 // Strip reference from function 455 referenceToRvalueConversion( newFunc.expr );594 referenceToRvalueConversion( newFunc.expr, newFunc.cost ); 456 595 457 596 // For all the set of arguments we have try to match it with the parameter of the current function alternative … … 462 601 OpenVarSet openVars; 463 602 AssertionSet resultNeed, resultHave; 464 TypeEnvironment resultEnv; 603 TypeEnvironment resultEnv( func.env ); 604 makeUnifiableVars( function, openVars, resultNeed ); 605 // add all type variables as open variables now so that those not used in the parameter 606 // list are still considered open. 607 resultEnv.add( function->forall ); 465 608 466 609 // Load type variables from arguemnts into one shared space … … 468 611 469 612 // Make sure we don't widen any existing bindings 470 for ( auto & i : resultEnv ) { 471 i.allowWidening = false; 472 } 613 resultEnv.forbidWidening(); 473 614 474 615 // Find any unbound type variables … … 477 618 auto param = function->parameters.begin(); 478 619 auto param_end = function->parameters.end(); 620 621 int n_mutex_param = 0; 479 622 480 623 // For every arguments of its set, check if it matches one of the parameter … … 486 629 // We ran out of parameters but still have arguments 487 630 // this function doesn't match 488 throw SemanticError("candidate function not viable: too many mutex arguments\n", function);631 SemanticError( function, toString("candidate function not viable: too many mutex arguments, expected ", n_mutex_param, "\n" )); 489 632 } 490 633 634 n_mutex_param++; 635 491 636 // Check if the argument matches the parameter type in the current scope 492 if( ! unify( (*param)->get_type(), arg.expr->get_result(), resultEnv, resultNeed, resultHave, openVars, this->indexer ) ) {637 if( ! unify( arg.expr->get_result(), (*param)->get_type(), resultEnv, resultNeed, resultHave, openVars, this->indexer ) ) { 493 638 // Type doesn't match 494 639 stringstream ss; 495 640 ss << "candidate function not viable: no known convertion from '"; 641 (*param)->get_type()->print( ss ); 642 ss << "' to '"; 496 643 arg.expr->get_result()->print( ss ); 497 ss << "' to'";498 (*param)->get_type()->print( ss);644 ss << "' with env '"; 645 resultEnv.print(ss); 499 646 ss << "'\n"; 500 throw SemanticError(ss.str(), function);647 SemanticError( function, ss.str() ); 501 648 } 502 649 … … 508 655 // Check if parameters are missing 509 656 if( advance_to_mutex( param, param_end ) ) { 657 do { 658 n_mutex_param++; 659 param++; 660 } while( advance_to_mutex( param, param_end ) ); 661 510 662 // We ran out of arguments but still have parameters left 511 663 // this function doesn't match 512 throw SemanticError("candidate function not viable: too few mutex arguments\n", function);664 SemanticError( function, toString("candidate function not viable: too few mutex arguments, expected ", n_mutex_param, "\n" )); 513 665 } 514 666 … … 526 678 527 679 } 528 catch( SemanticError &e ) {680 catch( SemanticErrorException &e ) { 529 681 errors.append( e ); 530 682 } 531 683 } 532 684 } 533 catch( SemanticError &e ) {685 catch( SemanticErrorException &e ) { 534 686 errors.append( e ); 535 687 } … … 537 689 538 690 // Make sure we got the right number of arguments 539 if( func_candidates.empty() ) { SemanticError top("No alternatives for function in call to waitfor" ); top.append( errors ); throw top; }540 if( args_candidates.empty() ) { SemanticError top("No alternatives for arguments in call to waitfor" ); top.append( errors ); throw top; }541 if( func_candidates.size() > 1 ) { SemanticError top("Ambiguous function in call to waitfor" ); top.append( errors ); throw top; }542 if( args_candidates.size() > 1 ) { SemanticError top("Ambiguous arguments in call to waitfor" ); top.append( errors ); throw top; }543 691 if( func_candidates.empty() ) { SemanticErrorException top( stmt->location, "No alternatives for function in call to waitfor" ); top.append( errors ); throw top; } 692 if( args_candidates.empty() ) { SemanticErrorException top( stmt->location, "No alternatives for arguments in call to waitfor" ); top.append( errors ); throw top; } 693 if( func_candidates.size() > 1 ) { SemanticErrorException top( stmt->location, "Ambiguous function in call to waitfor" ); top.append( errors ); throw top; } 694 if( args_candidates.size() > 1 ) { SemanticErrorException top( stmt->location, "Ambiguous arguments in call to waitfor" ); top.append( errors ); throw top; } 695 // TODO: need to use findDeletedExpr to ensure no deleted identifiers are used. 544 696 545 697 // Swap the results from the alternative with the unresolved values. … … 574 726 } 575 727 576 bool isStructOrUnion( Type * t ) {577 t = t->stripReferences();578 return dynamic_cast< StructInstType * >( t ) || dynamic_cast< UnionInstType * >( t );579 }580 581 void Resolver::previsit( WithStmt * withStmt ) {582 for ( Expression *& expr : withStmt->exprs ) {583 TypeEnvironment env;584 AlternativeFinder finder( indexer, env );585 finder.findWithAdjustment( expr );586 587 // only struct- and union-typed expressions are viable candidates588 AltList candidates;589 for ( Alternative & alt : finder.get_alternatives() ) {590 if ( isStructOrUnion( alt.expr->result ) ) {591 candidates.push_back( std::move( alt ) );592 }593 }594 595 // choose the lowest cost expression among the candidates596 AltList winners;597 findMinCost( candidates.begin(), candidates.end(), back_inserter( winners ) );598 if ( winners.size() == 0 ) {599 throw SemanticError( "No reasonable alternatives for with statement expression: ", expr );600 } else if ( winners.size() != 1 ) {601 std::ostringstream stream;602 stream << "Cannot choose between " << winners.size() << " alternatives for with statement expression\n";603 expr->print( stream );604 stream << "Alternatives are:\n";605 printAlts( winners, stream, 1 );606 throw SemanticError( stream.str() );607 }608 609 // there is one unambiguous interpretation - move the expression into the with statement610 Alternative & alt = winners.front();611 finishExpr( alt.expr, alt.env, expr->env );612 delete expr;613 expr = alt.expr;614 alt.expr = nullptr;615 616 // if with expression might be impure, create a temporary so that it is evaluated once617 if ( Tuples::maybeImpure( expr ) ) {618 static UniqueName tmpNamer( "_with_tmp_" );619 ObjectDecl * tmp = ObjectDecl::newObject( tmpNamer.newName(), expr->result->clone(), new SingleInit( expr ) );620 expr = new VariableExpr( tmp );621 stmtsToAddBefore.push_back( new DeclStmt( tmp ) );622 if ( InitTweak::isConstructable( tmp->type ) ) {623 // generate ctor/dtor and resolve them624 tmp->init = InitTweak::genCtorInit( tmp );625 tmp->accept( *visitor );626 }627 }628 }629 }630 631 728 template< typename T > 632 729 bool isCharType( T t ) { … … 652 749 initExpr->expr = nullptr; 653 750 std::swap( initExpr->env, newExpr->env ); 654 std::swap( initExpr->inferParams, newExpr->inferParams ) ; 751 // InitExpr may have inferParams in the case where the expression specializes a function pointer, 752 // and newExpr may already have inferParams of its own, so a simple swap is not sufficient. 753 newExpr->spliceInferParams( initExpr ); 655 754 delete initExpr; 656 755 … … 740 839 PassVisitor<Resolver> resolver( indexer ); 741 840 stmtExpr->accept( resolver ); 841 stmtExpr->computeResult(); 842 // xxx - aggregate the environments from all statements? Possibly in AlternativeFinder instead? 742 843 } 743 844 … … 745 846 visit_children = false; 746 847 // xxx - fallback init has been removed => remove fallbackInit function and remove complexity from FixInit and remove C-init from ConstructorInit 747 maybeAccept( ctorInit-> get_ctor(), *visitor );748 maybeAccept( ctorInit-> get_dtor(), *visitor );848 maybeAccept( ctorInit->ctor, *visitor ); 849 maybeAccept( ctorInit->dtor, *visitor ); 749 850 750 851 // found a constructor - can get rid of C-style initializer 751 delete ctorInit-> get_init();752 ctorInit-> set_init( NULL );852 delete ctorInit->init; 853 ctorInit->init = nullptr; 753 854 754 855 // intrinsic single parameter constructors and destructors do nothing. Since this was 755 856 // implicitly generated, there's no way for it to have side effects, so get rid of it 756 857 // to clean up generated code. 757 if ( InitTweak::isIntrinsicSingleArgCallStmt( ctorInit-> get_ctor()) ) {758 delete ctorInit-> get_ctor();759 ctorInit-> set_ctor( NULL );760 } 761 762 if ( InitTweak::isIntrinsicSingleArgCallStmt( ctorInit-> get_dtor()) ) {763 delete ctorInit-> get_dtor();764 ctorInit-> set_dtor( NULL );858 if ( InitTweak::isIntrinsicSingleArgCallStmt( ctorInit->ctor ) ) { 859 delete ctorInit->ctor; 860 ctorInit->ctor = nullptr; 861 } 862 863 if ( InitTweak::isIntrinsicSingleArgCallStmt( ctorInit->dtor ) ) { 864 delete ctorInit->dtor; 865 ctorInit->dtor = nullptr; 765 866 } 766 867 -
src/ResolvExpr/Resolver.h
rf9feab8 r90152a4 33 33 void findVoidExpression( Expression *& untyped, const SymTab::Indexer &indexer ); 34 34 void findSingleExpression( Expression *& untyped, const SymTab::Indexer &indexer ); 35 void findSingleExpression( Expression *& untyped, Type * type, const SymTab::Indexer &indexer ); 35 36 void resolveCtorInit( ConstructorInit * ctorInit, const SymTab::Indexer & indexer ); 36 37 void resolveStmtExpr( StmtExpr * stmtExpr, const SymTab::Indexer & indexer ); 38 /// Searches expr and returns the first DeletedExpr found, otherwise nullptr 39 DeletedExpr * findDeletedExpr( Expression * expr ); 40 /// Resolves with-stmts and with-clauses on functions 41 void resolveWithExprs( std::list< Declaration * > & translationUnit ); 37 42 } // namespace ResolvExpr 38 43 -
src/ResolvExpr/TypeEnvironment.cc
rf9feab8 r90152a4 9 9 // Author : Richard C. Bilson 10 10 // Created On : Sun May 17 12:19:47 2015 11 // Last Modified By : Peter A. Buhr12 // Last Modified On : Sun May 17 12:23:36 201513 // Update Count : 311 // Last Modified By : Aaron B. Moss 12 // Last Modified On : Mon Jun 18 11:58:00 2018 13 // Update Count : 4 14 14 // 15 15 … … 17 17 #include <algorithm> // for copy, set_intersection 18 18 #include <iterator> // for ostream_iterator, insert_iterator 19 #include <utility> // for pair 19 #include <memory> // for unique_ptr 20 #include <utility> // for pair, move 20 21 21 22 #include "Common/utility.h" // for maybeClone 22 23 #include "SynTree/Type.h" // for Type, FunctionType, Type::Fora... 23 24 #include "SynTree/TypeSubstitution.h" // for TypeSubstitution 25 #include "Tuples/Tuples.h" // for isTtype 24 26 #include "TypeEnvironment.h" 27 #include "typeops.h" // for occurs 28 #include "Unify.h" // for unifyInexact 25 29 26 30 namespace ResolvExpr { … … 44 48 45 49 void EqvClass::initialize( const EqvClass &src, EqvClass &dest ) { 50 initialize( src, dest, src.type ); 51 } 52 53 void EqvClass::initialize( const EqvClass &src, EqvClass &dest, const Type *ty ) { 46 54 dest.vars = src.vars; 47 dest.type = maybeClone( src.type);55 dest.type = maybeClone( ty ); 48 56 dest.allowWidening = src.allowWidening; 49 57 dest.data = src.data; 50 58 } 51 59 52 EqvClass::EqvClass() : type( 0), allowWidening( true ) {60 EqvClass::EqvClass() : type( nullptr ), allowWidening( true ) { 53 61 } 54 62 55 63 EqvClass::EqvClass( const EqvClass &other ) { 56 64 initialize( other, *this ); 65 } 66 67 EqvClass::EqvClass( const EqvClass &other, const Type *ty ) { 68 initialize( other, *this, ty ); 69 } 70 71 EqvClass::EqvClass( EqvClass &&other ) 72 : vars{std::move(other.vars)}, type{other.type}, 73 allowWidening{std::move(other.allowWidening)}, data{std::move(other.data)} { 74 other.type = nullptr; 57 75 } 58 76 … … 64 82 } 65 83 84 EqvClass &EqvClass::operator=( EqvClass &&other ) { 85 if ( this == &other ) return *this; 86 delete type; 87 88 vars = std::move(other.vars); 89 type = other.type; 90 other.type = nullptr; 91 allowWidening = std::move(other.allowWidening); 92 data = std::move(other.data); 93 94 return *this; 95 } 96 66 97 EqvClass::~EqvClass() { 67 98 delete type; 99 } 100 101 void EqvClass::set_type( Type* ty ) { 102 if ( ty == type ) return; 103 delete type; 104 type = ty; 68 105 } 69 106 … … 82 119 } 83 120 84 bool TypeEnvironment::lookup( const std::string &var, EqvClass &eqvClass) const {121 const EqvClass* TypeEnvironment::lookup( const std::string &var ) const { 85 122 for ( std::list< EqvClass >::const_iterator i = env.begin(); i != env.end(); ++i ) { 86 if ( i->vars.find( var ) != i->vars.end() ) { 87 /// std::cout << var << " is in class "; 88 /// i->print( std::cout ); 89 eqvClass = *i; 90 return true; 91 } 92 /// std::cout << var << " is not in class "; 93 /// i->print( std::cout ); 94 } // for 95 return false; 96 } 97 98 void TypeEnvironment::add( const EqvClass &eqvClass ) { 99 std::list< EqvClass >::iterator i = env.begin(); 100 while ( i != env.end() ) { 101 std::list< EqvClass >::iterator next = i; 102 next++; 103 std::set< std::string > intersection; 104 std::set_intersection( i->vars.begin(), i->vars.end(), eqvClass.vars.begin(), eqvClass.vars.end(), std::inserter( intersection, intersection.begin() ) ); 105 if ( ! intersection.empty() ) { 106 env.erase( i ); 107 } // if 123 if ( i->vars.find( var ) != i->vars.end() ) return &*i; 124 } // for 125 return nullptr; 126 } 127 128 /// Removes any class from env that intersects eqvClass 129 void filterOverlappingClasses( std::list<EqvClass> &env, const EqvClass &eqvClass ) { 130 for ( auto i = env.begin(); i != env.end(); ) { 131 auto next = i; 132 ++next; 133 std::set<std::string> intersection; 134 std::set_intersection( i->vars.begin(), i->vars.end(), eqvClass.vars.begin(), eqvClass.vars.end(), 135 std::inserter( intersection, intersection.begin() ) ); 136 if ( ! intersection.empty() ) { env.erase( i ); } 108 137 i = next; 109 } // while 110 env.insert( env.end(), eqvClass ); 138 } 139 } 140 141 void TypeEnvironment::add( EqvClass &&eqvClass ) { 142 filterOverlappingClasses( env, eqvClass ); 143 env.push_back( std::move(eqvClass) ); 111 144 } 112 145 … … 116 149 newClass.vars.insert( (*i)->get_name() ); 117 150 newClass.data = TypeDecl::Data{ (*i) }; 118 env.push_back( newClass ); 119 } // for 151 env.push_back( std::move(newClass) ); 152 } // for 153 } 154 155 void TypeEnvironment::add( const TypeSubstitution & sub ) { 156 EqvClass newClass; 157 for ( auto p : sub ) { 158 newClass.vars.insert( p.first ); 159 newClass.type = p.second->clone(); 160 newClass.allowWidening = false; 161 // Minimal assumptions. Not technically correct, but might be good enough, and 162 // is the best we can do at the moment since information is lost in the 163 // transition to TypeSubstitution 164 newClass.data = TypeDecl::Data{ TypeDecl::Dtype, false }; 165 add( std::move(newClass) ); 166 } 120 167 } 121 168 … … 123 170 for ( std::list< EqvClass >::const_iterator theClass = env.begin(); theClass != env.end(); ++theClass ) { 124 171 for ( std::set< std::string >::const_iterator theVar = theClass->vars.begin(); theVar != theClass->vars.end(); ++theVar ) { 125 /// std::cerr << "adding " << *theVar;126 172 if ( theClass->type ) { 127 /// std::cerr << " bound to ";128 /// theClass->type->print( std::cerr );129 /// std::cerr << std::endl;130 173 sub.add( *theVar, theClass->type ); 131 174 } else if ( theVar != theClass->vars.begin() ) { 132 175 TypeInstType *newTypeInst = new TypeInstType( Type::Qualifiers(), *theClass->vars.begin(), theClass->data.kind == TypeDecl::Ftype ); 133 /// std::cerr << " bound to variable " << *theClass->vars.begin() << std::endl;134 176 sub.add( *theVar, newTypeInst ); 135 177 delete newTypeInst; … … 137 179 } // for 138 180 } // for 139 /// std::cerr << "input env is:" << std::endl;140 /// print( std::cerr, 8 );141 /// std::cerr << "sub is:" << std::endl;142 /// sub.print( std::cerr, 8 );143 181 sub.normalize(); 144 182 } 145 183 146 184 void TypeEnvironment::print( std::ostream &os, Indenter indent ) const { 147 for ( std::list< EqvClass >::const_iterator i = env.begin(); i != env.end(); ++i) {148 i->print( os, indent );185 for ( const EqvClass & theClass : env ) { 186 theClass.print( os, indent ); 149 187 } // for 150 188 } … … 152 190 std::list< EqvClass >::iterator TypeEnvironment::internal_lookup( const std::string &var ) { 153 191 for ( std::list< EqvClass >::iterator i = env.begin(); i != env.end(); ++i ) { 154 if ( i->vars.find( var ) == i->vars.end() ) { 155 return i; 156 } // if 192 if ( i->vars.count( var ) ) return i; 157 193 } // for 158 194 return env.end(); … … 161 197 void TypeEnvironment::simpleCombine( const TypeEnvironment &second ) { 162 198 env.insert( env.end(), second.env.begin(), second.env.end() ); 163 }164 165 void TypeEnvironment::combine( const TypeEnvironment &second, Type *(*combineFunc)( Type*, Type* ) ) {166 TypeEnvironment secondCopy( second );167 for ( std::list< EqvClass >::iterator firstClass = env.begin(); firstClass != env.end(); ++firstClass ) {168 EqvClass &newClass = *firstClass;169 std::set< std::string > newVars;170 for ( std::set< std::string >::const_iterator var = firstClass->vars.begin(); var != firstClass->vars.end(); ++var ) {171 std::list< EqvClass >::iterator secondClass = secondCopy.internal_lookup( *var );172 if ( secondClass != secondCopy.env.end() ) {173 newVars.insert( secondClass->vars.begin(), secondClass->vars.end() );174 if ( secondClass->type ) {175 if ( newClass.type ) {176 Type *newType = combineFunc( newClass.type, secondClass->type );177 delete newClass.type;178 newClass.type = newType;179 newClass.allowWidening = newClass.allowWidening && secondClass->allowWidening;180 } else {181 newClass.type = secondClass->type->clone();182 newClass.allowWidening = secondClass->allowWidening;183 } // if184 } // if185 secondCopy.env.erase( secondClass );186 } // if187 } // for188 newClass.vars.insert( newVars.begin(), newVars.end() );189 } // for190 for ( std::list< EqvClass >::iterator secondClass = secondCopy.env.begin(); secondClass != secondCopy.env.end(); ++secondClass ) {191 env.push_back( *secondClass );192 } // for193 199 } 194 200 … … 212 218 } 213 219 220 bool isFtype( Type *type ) { 221 if ( dynamic_cast< FunctionType* >( type ) ) { 222 return true; 223 } else if ( TypeInstType *typeInst = dynamic_cast< TypeInstType* >( type ) ) { 224 return typeInst->get_isFtype(); 225 } // if 226 return false; 227 } 228 229 bool tyVarCompatible( const TypeDecl::Data & data, Type *type ) { 230 switch ( data.kind ) { 231 case TypeDecl::Dtype: 232 // to bind to an object type variable, the type must not be a function type. 233 // if the type variable is specified to be a complete type then the incoming 234 // type must also be complete 235 // xxx - should this also check that type is not a tuple type and that it's not a ttype? 236 return ! isFtype( type ) && (! data.isComplete || type->isComplete() ); 237 case TypeDecl::Ftype: 238 return isFtype( type ); 239 case TypeDecl::Ttype: 240 // ttype unifies with any tuple type 241 return dynamic_cast< TupleType * >( type ) || Tuples::isTtype( type ); 242 default: 243 assertf(false, "Unhandled tyvar kind: %d", data.kind); 244 } // switch 245 return false; 246 } 247 248 bool TypeEnvironment::bindVar( TypeInstType *typeInst, Type *bindTo, const TypeDecl::Data & data, AssertionSet &need, AssertionSet &have, const OpenVarSet &openVars, WidenMode widenMode, const SymTab::Indexer &indexer ) { 249 250 // remove references from other, so that type variables can only bind to value types 251 bindTo = bindTo->stripReferences(); 252 OpenVarSet::const_iterator tyvar = openVars.find( typeInst->get_name() ); 253 assert( tyvar != openVars.end() ); 254 if ( ! tyVarCompatible( tyvar->second, bindTo ) ) { 255 return false; 256 } // if 257 if ( occurs( bindTo, typeInst->get_name(), *this ) ) { 258 return false; 259 } // if 260 auto curClass = internal_lookup( typeInst->get_name() ); 261 if ( curClass != env.end() ) { 262 if ( curClass->type ) { 263 Type *common = 0; 264 // attempt to unify equivalence class type (which has qualifiers stripped, so they must be restored) with the type to bind to 265 std::unique_ptr< Type > newType( curClass->type->clone() ); 266 newType->get_qualifiers() = typeInst->get_qualifiers(); 267 if ( unifyInexact( newType.get(), bindTo, *this, need, have, openVars, widenMode & WidenMode( curClass->allowWidening, true ), indexer, common ) ) { 268 if ( common ) { 269 common->get_qualifiers() = Type::Qualifiers{}; 270 curClass->set_type( common ); 271 } // if 272 } else return false; 273 } else { 274 Type* newType = bindTo->clone(); 275 newType->get_qualifiers() = Type::Qualifiers{}; 276 curClass->set_type( newType ); 277 curClass->allowWidening = widenMode.widenFirst && widenMode.widenSecond; 278 } // if 279 } else { 280 EqvClass newClass; 281 newClass.vars.insert( typeInst->get_name() ); 282 newClass.type = bindTo->clone(); 283 newClass.type->get_qualifiers() = Type::Qualifiers(); 284 newClass.allowWidening = widenMode.widenFirst && widenMode.widenSecond; 285 newClass.data = data; 286 env.push_back( std::move(newClass) ); 287 } // if 288 return true; 289 } 290 291 bool TypeEnvironment::bindVarToVar( TypeInstType *var1, TypeInstType *var2, const TypeDecl::Data & data, AssertionSet &need, AssertionSet &have, const OpenVarSet &openVars, WidenMode widenMode, const SymTab::Indexer &indexer ) { 292 293 auto class1 = internal_lookup( var1->get_name() ); 294 auto class2 = internal_lookup( var2->get_name() ); 295 296 // exit early if variables already bound together 297 if ( class1 != env.end() && class1 == class2 ) { 298 class1->allowWidening &= widenMode; 299 return true; 300 } 301 302 bool widen1 = false, widen2 = false; 303 const Type *type1 = nullptr, *type2 = nullptr; 304 305 // check for existing bindings, perform occurs check 306 if ( class1 != env.end() ) { 307 if ( class1->type ) { 308 if ( occurs( class1->type, var2->get_name(), *this ) ) return false; 309 type1 = class1->type; 310 } // if 311 widen1 = widenMode.widenFirst && class1->allowWidening; 312 } // if 313 if ( class2 != env.end() ) { 314 if ( class2->type ) { 315 if ( occurs( class2->type, var1->get_name(), *this ) ) return false; 316 type2 = class2->type; 317 } // if 318 widen2 = widenMode.widenSecond && class2->allowWidening; 319 } // if 320 321 if ( type1 && type2 ) { 322 // both classes bound, merge if bound types can be unified 323 std::unique_ptr<Type> newType1{ type1->clone() }, newType2{ type2->clone() }; 324 WidenMode newWidenMode{ widen1, widen2 }; 325 Type *common = 0; 326 if ( unifyInexact( newType1.get(), newType2.get(), *this, need, have, openVars, newWidenMode, indexer, common ) ) { 327 class1->vars.insert( class2->vars.begin(), class2->vars.end() ); 328 class1->allowWidening = widen1 && widen2; 329 if ( common ) { 330 common->get_qualifiers() = Type::Qualifiers{}; 331 class1->set_type( common ); 332 } 333 env.erase( class2 ); 334 } else return false; 335 } else if ( class1 != env.end() && class2 != env.end() ) { 336 // both classes exist, at least one unbound, merge unconditionally 337 if ( type1 ) { 338 class1->vars.insert( class2->vars.begin(), class2->vars.end() ); 339 class1->allowWidening = widen1; 340 env.erase( class2 ); 341 } else { 342 class2->vars.insert( class1->vars.begin(), class1->vars.end() ); 343 class2->allowWidening = widen2; 344 env.erase( class1 ); 345 } // if 346 } else if ( class1 != env.end() ) { 347 // var2 unbound, add to class1 348 class1->vars.insert( var2->get_name() ); 349 class1->allowWidening = widen1; 350 } else if ( class2 != env.end() ) { 351 // var1 unbound, add to class2 352 class2->vars.insert( var1->get_name() ); 353 class2->allowWidening = widen2; 354 } else { 355 // neither var bound, create new class 356 EqvClass newClass; 357 newClass.vars.insert( var1->get_name() ); 358 newClass.vars.insert( var2->get_name() ); 359 newClass.allowWidening = widen1 && widen2; 360 newClass.data = data; 361 env.push_back( std::move(newClass) ); 362 } // if 363 return true; 364 } 365 366 void TypeEnvironment::forbidWidening() { 367 for ( EqvClass& c : env ) c.allowWidening = false; 368 } 369 214 370 std::ostream & operator<<( std::ostream & out, const TypeEnvironment & env ) { 215 371 env.print( out ); -
src/ResolvExpr/TypeEnvironment.h
rf9feab8 r90152a4 9 9 // Author : Richard C. Bilson 10 10 // Created On : Sun May 17 12:24:58 2015 11 // Last Modified By : Peter A. Buhr12 // Last Modified On : Sat Jul 22 09:35:45 201713 // Update Count : 311 // Last Modified By : Aaron B. Moss 12 // Last Modified On : Mon Jun 18 11:58:00 2018 13 // Update Count : 4 14 14 // 15 15 … … 21 21 #include <set> // for set 22 22 #include <string> // for string 23 #include <utility> // for move, swap 24 25 #include "WidenMode.h" // for WidenMode 23 26 24 27 #include "SynTree/Declaration.h" // for TypeDecl::Data, DeclarationWit... … … 37 40 // 38 41 // I've seen a TU go from 54 minutes to 1 minute 34 seconds with the addition of this comparator. 42 // 43 // Note: since this compares pointers for position, minor changes in the source file that affect 44 // memory layout can alter compilation time in unpredictable ways. For example, the placement 45 // of a line directive can reorder type pointers with respect to each other so that assertions 46 // are seen in different orders, causing a potentially different number of unification calls when 47 // resolving assertions. I've seen a TU go from 36 seconds to 27 seconds by reordering line directives 48 // alone, so it would be nice to fix this comparison so that assertions compare more consistently. 49 // I've tried to modify this to compare on mangle name instead of type as the second comparator, but 50 // this causes some assertions to never be recorded. More investigation is needed. 39 51 struct AssertCompare { 40 52 bool operator()( DeclarationWithType * d1, DeclarationWithType * d2 ) const { … … 64 76 65 77 void initialize( const EqvClass &src, EqvClass &dest ); 78 void initialize( const EqvClass &src, EqvClass &dest, const Type *ty ); 66 79 EqvClass(); 67 80 EqvClass( const EqvClass &other ); 81 EqvClass( const EqvClass &other, const Type *ty ); 82 EqvClass( EqvClass &&other ); 68 83 EqvClass &operator=( const EqvClass &other ); 84 EqvClass &operator=( EqvClass &&other ); 69 85 ~EqvClass(); 70 86 void print( std::ostream &os, Indenter indent = {} ) const; 87 88 /// Takes ownership of `ty`, freeing old `type` 89 void set_type(Type* ty); 71 90 }; 72 91 73 92 class TypeEnvironment { 74 93 public: 75 bool lookup( const std::string &var, EqvClass &eqvClass ) const; 76 void add( const EqvClass &eqvClass ); 94 const EqvClass* lookup( const std::string &var ) const; 95 private: 96 void add( EqvClass &&eqvClass ); 97 public: 77 98 void add( const Type::ForallList &tyDecls ); 99 void add( const TypeSubstitution & sub ); 78 100 template< typename SynTreeClass > int apply( SynTreeClass *&type ) const; 79 101 template< typename SynTreeClass > int applyFree( SynTreeClass *&type ) const; … … 81 103 bool isEmpty() const { return env.empty(); } 82 104 void print( std::ostream &os, Indenter indent = {} ) const; 83 void combine( const TypeEnvironment &second, Type *(*combineFunc)( Type*, Type* ) );105 // void combine( const TypeEnvironment &second, Type *(*combineFunc)( Type*, Type* ) ); 84 106 void simpleCombine( const TypeEnvironment &second ); 85 107 void extractOpenVars( OpenVarSet &openVars ) const; … … 90 112 void addActual( const TypeEnvironment& actualEnv, OpenVarSet& openVars ); 91 113 92 typedef std::list< EqvClass >::iterator iterator; 93 iterator begin() { return env.begin(); } 94 iterator end() { return env.end(); } 95 typedef std::list< EqvClass >::const_iterator const_iterator; 96 const_iterator begin() const { return env.begin(); } 97 const_iterator end() const { return env.end(); } 114 /// Binds the type class represented by `typeInst` to the type `bindTo`; will add 115 /// the class if needed. Returns false on failure. 116 bool bindVar( TypeInstType *typeInst, Type *bindTo, const TypeDecl::Data & data, AssertionSet &need, AssertionSet &have, const OpenVarSet &openVars, WidenMode widenMode, const SymTab::Indexer &indexer ); 117 118 /// Binds the type classes represented by `var1` and `var2` together; will add 119 /// one or both classes if needed. Returns false on failure. 120 bool bindVarToVar( TypeInstType *var1, TypeInstType *var2, const TypeDecl::Data & data, AssertionSet &need, AssertionSet &have, const OpenVarSet &openVars, WidenMode widenMode, const SymTab::Indexer &indexer ); 121 122 /// Disallows widening for all bindings in the environment 123 void forbidWidening(); 124 125 using iterator = std::list< EqvClass >::const_iterator; 126 iterator begin() const { return env.begin(); } 127 iterator end() const { return env.end(); } 128 98 129 private: 99 130 std::list< EqvClass > env; 131 100 132 std::list< EqvClass >::iterator internal_lookup( const std::string &var ); 101 133 }; -
src/ResolvExpr/Unify.cc
rf9feab8 r90152a4 9 9 // Author : Richard C. Bilson 10 10 // Created On : Sun May 17 12:27:10 2015 11 // Last Modified By : Peter A. Buhr12 // Last Modified On : Thu Mar 16 16:22:54 201713 // Update Count : 4 211 // Last Modified By : Aaron B. Moss 12 // Last Modified On : Mon Jun 18 11:58:00 2018 13 // Update Count : 43 14 14 // 15 15 … … 20 20 #include <set> // for set 21 21 #include <string> // for string, operator==, operator!=, bas... 22 #include <utility> // for pair 22 #include <utility> // for pair, move 23 23 24 24 #include "Common/PassVisitor.h" // for PassVisitor … … 44 44 namespace ResolvExpr { 45 45 46 class Unify : public Visitor { 47 public: 46 struct Unify : public WithShortCircuiting { 48 47 Unify( Type *type2, TypeEnvironment &env, AssertionSet &needAssertions, AssertionSet &haveAssertions, const OpenVarSet &openVars, WidenMode widenMode, const SymTab::Indexer &indexer ); 49 48 50 49 bool get_result() const { return result; } 50 51 void previsit( BaseSyntaxNode * ) { visit_children = false; } 52 53 void postvisit( VoidType * voidType ); 54 void postvisit( BasicType * basicType ); 55 void postvisit( PointerType * pointerType ); 56 void postvisit( ArrayType * arrayType ); 57 void postvisit( ReferenceType * refType ); 58 void postvisit( FunctionType * functionType ); 59 void postvisit( StructInstType * aggregateUseType ); 60 void postvisit( UnionInstType * aggregateUseType ); 61 void postvisit( EnumInstType * aggregateUseType ); 62 void postvisit( TraitInstType * aggregateUseType ); 63 void postvisit( TypeInstType * aggregateUseType ); 64 void postvisit( TupleType * tupleType ); 65 void postvisit( VarArgsType * varArgsType ); 66 void postvisit( ZeroType * zeroType ); 67 void postvisit( OneType * oneType ); 68 51 69 private: 52 virtual void visit(VoidType *voidType);53 virtual void visit(BasicType *basicType);54 virtual void visit(PointerType *pointerType);55 virtual void visit(ArrayType *arrayType);56 virtual void visit(ReferenceType *refType);57 virtual void visit(FunctionType *functionType);58 virtual void visit(StructInstType *aggregateUseType);59 virtual void visit(UnionInstType *aggregateUseType);60 virtual void visit(EnumInstType *aggregateUseType);61 virtual void visit(TraitInstType *aggregateUseType);62 virtual void visit(TypeInstType *aggregateUseType);63 virtual void visit(TupleType *tupleType);64 virtual void visit(VarArgsType *varArgsType);65 virtual void visit(ZeroType *zeroType);66 virtual void visit(OneType *oneType);67 68 70 template< typename RefType > void handleRefType( RefType *inst, Type *other ); 69 71 template< typename RefType > void handleGenericRefType( RefType *inst, Type *other ); … … 127 129 } 128 130 129 bool isFtype( Type *type ) {130 if ( dynamic_cast< FunctionType* >( type ) ) {131 return true;132 } else if ( TypeInstType *typeInst = dynamic_cast< TypeInstType* >( type ) ) {133 return typeInst->get_isFtype();134 } // if135 return false;136 }137 138 bool tyVarCompatible( const TypeDecl::Data & data, Type *type ) {139 switch ( data.kind ) {140 case TypeDecl::Dtype:141 // to bind to an object type variable, the type must not be a function type.142 // if the type variable is specified to be a complete type then the incoming143 // type must also be complete144 // xxx - should this also check that type is not a tuple type and that it's not a ttype?145 return ! isFtype( type ) && (! data.isComplete || type->isComplete() );146 case TypeDecl::Ftype:147 return isFtype( type );148 case TypeDecl::Ttype:149 // ttype unifies with any tuple type150 return dynamic_cast< TupleType * >( type ) || Tuples::isTtype( type );151 } // switch152 return false;153 }154 155 bool bindVar( TypeInstType *typeInst, Type *other, const TypeDecl::Data & data, TypeEnvironment &env, AssertionSet &needAssertions, AssertionSet &haveAssertions, const OpenVarSet &openVars, WidenMode widenMode, const SymTab::Indexer &indexer ) {156 // remove references from other, so that type variables can only bind to value types157 other = other->stripReferences();158 OpenVarSet::const_iterator tyvar = openVars.find( typeInst->get_name() );159 assert( tyvar != openVars.end() );160 if ( ! tyVarCompatible( tyvar->second, other ) ) {161 return false;162 } // if163 if ( occurs( other, typeInst->get_name(), env ) ) {164 return false;165 } // if166 EqvClass curClass;167 if ( env.lookup( typeInst->get_name(), curClass ) ) {168 if ( curClass.type ) {169 Type *common = 0;170 // attempt to unify equivalence class type (which has qualifiers stripped, so they must be restored) with the type to bind to171 std::unique_ptr< Type > newType( curClass.type->clone() );172 newType->get_qualifiers() = typeInst->get_qualifiers();173 if ( unifyInexact( newType.get(), other, env, needAssertions, haveAssertions, openVars, widenMode & WidenMode( curClass.allowWidening, true ), indexer, common ) ) {174 if ( common ) {175 common->get_qualifiers() = Type::Qualifiers();176 delete curClass.type;177 curClass.type = common;178 env.add( curClass );179 } // if180 return true;181 } else {182 return false;183 } // if184 } else {185 curClass.type = other->clone();186 curClass.type->get_qualifiers() = Type::Qualifiers();187 curClass.allowWidening = widenMode.widenFirst && widenMode.widenSecond;188 env.add( curClass );189 } // if190 } else {191 EqvClass newClass;192 newClass.vars.insert( typeInst->get_name() );193 newClass.type = other->clone();194 newClass.type->get_qualifiers() = Type::Qualifiers();195 newClass.allowWidening = widenMode.widenFirst && widenMode.widenSecond;196 newClass.data = data;197 env.add( newClass );198 } // if199 return true;200 }201 202 bool bindVarToVar( TypeInstType *var1, TypeInstType *var2, const TypeDecl::Data & data, TypeEnvironment &env, AssertionSet &needAssertions, AssertionSet &haveAssertions, const OpenVarSet &openVars, WidenMode widenMode, const SymTab::Indexer &indexer ) {203 bool result = true;204 EqvClass class1, class2;205 bool hasClass1 = false, hasClass2 = false;206 bool widen1 = false, widen2 = false;207 Type *type1 = 0, *type2 = 0;208 209 if ( env.lookup( var1->get_name(), class1 ) ) {210 hasClass1 = true;211 if ( class1.type ) {212 if ( occurs( class1.type, var2->get_name(), env ) ) {213 return false;214 } // if215 type1 = class1.type->clone();216 } // if217 widen1 = widenMode.widenFirst && class1.allowWidening;218 } // if219 if ( env.lookup( var2->get_name(), class2 ) ) {220 hasClass2 = true;221 if ( class2.type ) {222 if ( occurs( class2.type, var1->get_name(), env ) ) {223 return false;224 } // if225 type2 = class2.type->clone();226 } // if227 widen2 = widenMode.widenSecond && class2.allowWidening;228 } // if229 230 if ( type1 && type2 ) {231 // std::cerr << "has type1 && type2" << std::endl;232 WidenMode newWidenMode ( widen1, widen2 );233 Type *common = 0;234 if ( unifyInexact( type1, type2, env, needAssertions, haveAssertions, openVars, newWidenMode, indexer, common ) ) {235 class1.vars.insert( class2.vars.begin(), class2.vars.end() );236 class1.allowWidening = widen1 && widen2;237 if ( common ) {238 common->get_qualifiers() = Type::Qualifiers();239 delete class1.type;240 class1.type = common;241 } // if242 env.add( class1 );243 } else {244 result = false;245 } // if246 } else if ( hasClass1 && hasClass2 ) {247 if ( type1 ) {248 class1.vars.insert( class2.vars.begin(), class2.vars.end() );249 class1.allowWidening = widen1;250 env.add( class1 );251 } else {252 class2.vars.insert( class1.vars.begin(), class1.vars.end() );253 class2.allowWidening = widen2;254 env.add( class2 );255 } // if256 } else if ( hasClass1 ) {257 class1.vars.insert( var2->get_name() );258 class1.allowWidening = widen1;259 env.add( class1 );260 } else if ( hasClass2 ) {261 class2.vars.insert( var1->get_name() );262 class2.allowWidening = widen2;263 env.add( class2 );264 } else {265 EqvClass newClass;266 newClass.vars.insert( var1->get_name() );267 newClass.vars.insert( var2->get_name() );268 newClass.allowWidening = widen1 && widen2;269 newClass.data = data;270 env.add( newClass );271 } // if272 delete type1;273 delete type2;274 return result;275 }276 277 131 bool unify( Type *type1, Type *type2, TypeEnvironment &env, AssertionSet &needAssertions, AssertionSet &haveAssertions, OpenVarSet &openVars, const SymTab::Indexer &indexer ) { 278 132 OpenVarSet closedVars; … … 319 173 320 174 if ( isopen1 && isopen2 && entry1->second == entry2->second ) { 321 result = bindVarToVar( var1, var2, entry1->second, env, needAssertions, haveAssertions, openVars, widenMode, indexer );175 result = env.bindVarToVar( var1, var2, entry1->second, needAssertions, haveAssertions, openVars, widenMode, indexer ); 322 176 } else if ( isopen1 ) { 323 result = bindVar( var1, type2, entry1->second, env, needAssertions, haveAssertions, openVars, widenMode, indexer );324 } else if ( isopen2 ) { 325 result = bindVar( var2, type1, entry2->second, env, needAssertions, haveAssertions, openVars, widenMode, indexer );177 result = env.bindVar( var1, type2, entry1->second, needAssertions, haveAssertions, openVars, widenMode, indexer ); 178 } else if ( isopen2 ) { // TODO: swap widenMode values in call, since type positions are flipped? 179 result = env.bindVar( var2, type1, entry2->second, needAssertions, haveAssertions, openVars, widenMode, indexer ); 326 180 } else { 327 Unifycomparator( type2, env, needAssertions, haveAssertions, openVars, widenMode, indexer );181 PassVisitor<Unify> comparator( type2, env, needAssertions, haveAssertions, openVars, widenMode, indexer ); 328 182 type1->accept( comparator ); 329 result = comparator. get_result();183 result = comparator.pass.get_result(); 330 184 } // if 331 185 #ifdef DEBUG … … 404 258 } 405 259 406 void Unify:: visit( __attribute__((unused)) VoidType *voidType) {260 void Unify::postvisit( __attribute__((unused)) VoidType *voidType) { 407 261 result = dynamic_cast< VoidType* >( type2 ); 408 262 } 409 263 410 void Unify:: visit(BasicType *basicType) {264 void Unify::postvisit(BasicType *basicType) { 411 265 if ( BasicType *otherBasic = dynamic_cast< BasicType* >( type2 ) ) { 412 266 result = basicType->get_kind() == otherBasic->get_kind(); … … 436 290 } 437 291 438 void Unify:: visit(PointerType *pointerType) {292 void Unify::postvisit(PointerType *pointerType) { 439 293 if ( PointerType *otherPointer = dynamic_cast< PointerType* >( type2 ) ) { 440 294 result = unifyExact( pointerType->get_base(), otherPointer->get_base(), env, needAssertions, haveAssertions, openVars, WidenMode( false, false ), indexer ); … … 444 298 } 445 299 446 void Unify:: visit(ReferenceType *refType) {300 void Unify::postvisit(ReferenceType *refType) { 447 301 if ( ReferenceType *otherRef = dynamic_cast< ReferenceType* >( type2 ) ) { 448 302 result = unifyExact( refType->get_base(), otherRef->get_base(), env, needAssertions, haveAssertions, openVars, WidenMode( false, false ), indexer ); … … 452 306 } 453 307 454 void Unify:: visit(ArrayType *arrayType) {308 void Unify::postvisit(ArrayType *arrayType) { 455 309 ArrayType *otherArray = dynamic_cast< ArrayType* >( type2 ); 456 310 // to unify, array types must both be VLA or both not VLA … … 537 391 void premutate( TypeInstType * ) { visit_children = false; } 538 392 Type * postmutate( TypeInstType * typeInst ) { 539 EqvClass eqvClass; 540 if ( tenv.lookup( typeInst->get_name(), eqvClass ) ) { 541 if ( eqvClass.data.kind == TypeDecl::Ttype ) { 542 // expand ttype parameter into its actual type 543 if ( eqvClass.type ) { 544 delete typeInst; 545 return eqvClass.type->clone(); 546 } 393 if ( const EqvClass *eqvClass = tenv.lookup( typeInst->get_name() ) ) { 394 // expand ttype parameter into its actual type 395 if ( eqvClass->data.kind == TypeDecl::Ttype && eqvClass->type ) { 396 delete typeInst; 397 return eqvClass->type->clone(); 547 398 } 548 399 } … … 561 412 flatten( dcl->get_type(), back_inserter( types ) ); 562 413 for ( Type * t : types ) { 414 // outermost const, volatile, _Atomic qualifiers in parameters should not play a role in the unification of function types, since they do not determine whether a function is callable. 415 // Note: MUST consider at least mutex qualifier, since functions can be overloaded on outermost mutex and a mutex function has different requirements than a non-mutex function. 416 t->get_qualifiers() -= Type::Qualifiers(Type::Const | Type::Volatile | Type::Atomic); 417 563 418 dst.push_back( new ObjectDecl( "", Type::StorageClasses(), LinkageSpec::C, nullptr, t, nullptr ) ); 564 419 } … … 567 422 } 568 423 569 void Unify:: visit(FunctionType *functionType) {424 void Unify::postvisit(FunctionType *functionType) { 570 425 FunctionType *otherFunction = dynamic_cast< FunctionType* >( type2 ); 571 426 if ( otherFunction && functionType->get_isVarArgs() == otherFunction->get_isVarArgs() ) { … … 578 433 579 434 // sizes don't have to match if ttypes are involved; need to be more precise wrt where the ttype is to prevent errors 580 if ( (flatFunc-> get_parameters().size() == flatOther->get_parameters().size() && flatFunc->get_returnVals().size() == flatOther->get_returnVals().size()) || flatFunc->isTtype() || flatOther->isTtype() ) {581 if ( unifyDeclList( flatFunc-> get_parameters().begin(), flatFunc->get_parameters().end(), flatOther->get_parameters().begin(), flatOther->get_parameters().end(), env, needAssertions, haveAssertions, openVars, indexer ) ) {582 if ( unifyDeclList( flatFunc-> get_returnVals().begin(), flatFunc->get_returnVals().end(), flatOther->get_returnVals().begin(), flatOther->get_returnVals().end(), env, needAssertions, haveAssertions, openVars, indexer ) ) {435 if ( (flatFunc->parameters.size() == flatOther->parameters.size() && flatFunc->returnVals.size() == flatOther->returnVals.size()) || flatFunc->isTtype() || flatOther->isTtype() ) { 436 if ( unifyDeclList( flatFunc->parameters.begin(), flatFunc->parameters.end(), flatOther->parameters.begin(), flatOther->parameters.end(), env, needAssertions, haveAssertions, openVars, indexer ) ) { 437 if ( unifyDeclList( flatFunc->returnVals.begin(), flatFunc->returnVals.end(), flatOther->returnVals.begin(), flatOther->returnVals.end(), env, needAssertions, haveAssertions, openVars, indexer ) ) { 583 438 584 439 // the original types must be used in mark assertions, since pointer comparisons are used … … 597 452 // check that other type is compatible and named the same 598 453 RefType *otherStruct = dynamic_cast< RefType* >( other ); 599 result = otherStruct && inst-> get_name() == otherStruct->get_name();454 result = otherStruct && inst->name == otherStruct->name; 600 455 } 601 456 … … 606 461 if ( ! result ) return; 607 462 // Check that parameters of types unify, if any 608 std::list< Expression* > params = inst-> get_parameters();609 std::list< Expression* > otherParams = ((RefType*)other)-> get_parameters();463 std::list< Expression* > params = inst->parameters; 464 std::list< Expression* > otherParams = ((RefType*)other)->parameters; 610 465 611 466 std::list< Expression* >::const_iterator it = params.begin(), jt = otherParams.begin(); … … 669 524 } 670 525 671 void Unify:: visit(StructInstType *structInst) {526 void Unify::postvisit(StructInstType *structInst) { 672 527 handleGenericRefType( structInst, type2 ); 673 528 } 674 529 675 void Unify:: visit(UnionInstType *unionInst) {530 void Unify::postvisit(UnionInstType *unionInst) { 676 531 handleGenericRefType( unionInst, type2 ); 677 532 } 678 533 679 void Unify:: visit(EnumInstType *enumInst) {534 void Unify::postvisit(EnumInstType *enumInst) { 680 535 handleRefType( enumInst, type2 ); 681 536 } 682 537 683 void Unify:: visit(TraitInstType *contextInst) {538 void Unify::postvisit(TraitInstType *contextInst) { 684 539 handleRefType( contextInst, type2 ); 685 540 } 686 541 687 void Unify:: visit(TypeInstType *typeInst) {542 void Unify::postvisit(TypeInstType *typeInst) { 688 543 assert( openVars.find( typeInst->get_name() ) == openVars.end() ); 689 544 TypeInstType *otherInst = dynamic_cast< TypeInstType* >( type2 ); … … 740 595 } 741 596 742 void Unify:: visit(TupleType *tupleType) {597 void Unify::postvisit(TupleType *tupleType) { 743 598 if ( TupleType *otherTuple = dynamic_cast< TupleType* >( type2 ) ) { 744 599 std::unique_ptr<TupleType> flat1( tupleType->clone() ); … … 757 612 } 758 613 759 void Unify:: visit( __attribute__((unused)) VarArgsType *varArgsType ) {614 void Unify::postvisit( __attribute__((unused)) VarArgsType *varArgsType ) { 760 615 result = dynamic_cast< VarArgsType* >( type2 ); 761 616 } 762 617 763 void Unify:: visit( __attribute__((unused)) ZeroType *zeroType ) {618 void Unify::postvisit( __attribute__((unused)) ZeroType *zeroType ) { 764 619 result = dynamic_cast< ZeroType* >( type2 ); 765 620 } 766 621 767 void Unify:: visit( __attribute__((unused)) OneType *oneType ) {622 void Unify::postvisit( __attribute__((unused)) OneType *oneType ) { 768 623 result = dynamic_cast< OneType* >( type2 ); 769 624 } -
src/ResolvExpr/Unify.h
rf9feab8 r90152a4 9 9 // Author : Richard C. Bilson 10 10 // Created On : Sun May 17 13:09:04 2015 11 // Last Modified By : Peter A. Buhr12 // Last Modified On : Fri Jul 21 23:09:34 201713 // Update Count : 311 // Last Modified By : Aaron B. Moss 12 // Last Modified On : Mon Jun 18 11:58:00 2018 13 // Update Count : 4 14 14 // 15 15 … … 21 21 #include "SynTree/Declaration.h" // for TypeDecl, TypeDecl::Data 22 22 #include "TypeEnvironment.h" // for AssertionSet, OpenVarSet 23 #include "WidenMode.h" // for WidenMode 23 24 24 25 class Type; … … 29 30 30 31 namespace ResolvExpr { 31 struct WidenMode {32 WidenMode( bool widenFirst, bool widenSecond ): widenFirst( widenFirst ), widenSecond( widenSecond ) {}33 WidenMode &operator|=( const WidenMode &other ) { widenFirst |= other.widenFirst; widenSecond |= other.widenSecond; return *this; }34 WidenMode &operator&=( const WidenMode &other ) { widenFirst &= other.widenFirst; widenSecond &= other.widenSecond; return *this; }35 WidenMode operator|( const WidenMode &other ) { WidenMode newWM( *this ); newWM |= other; return newWM; }36 WidenMode operator&( const WidenMode &other ) { WidenMode newWM( *this ); newWM &= other; return newWM; }37 operator bool() { return widenFirst && widenSecond; }38 39 bool widenFirst : 1, widenSecond : 1;40 };41 42 bool bindVar( TypeInstType *typeInst, Type *other, const TypeDecl::Data & data, TypeEnvironment &env, AssertionSet &needAssertions, AssertionSet &haveAssertions, const OpenVarSet &openVars, WidenMode widenMode, const SymTab::Indexer &indexer );43 32 bool unify( Type *type1, Type *type2, TypeEnvironment &env, AssertionSet &needAssertions, AssertionSet &haveAssertions, OpenVarSet &openVars, const SymTab::Indexer &indexer ); 44 33 bool unify( Type *type1, Type *type2, TypeEnvironment &env, AssertionSet &needAssertions, AssertionSet &haveAssertions, OpenVarSet &openVars, const SymTab::Indexer &indexer, Type *&commonType ); 45 34 bool unifyExact( Type *type1, Type *type2, TypeEnvironment &env, AssertionSet &needAssertions, AssertionSet &haveAssertions, OpenVarSet &openVars, const SymTab::Indexer &indexer ); 35 bool unifyInexact( Type *type1, Type *type2, TypeEnvironment &env, AssertionSet &needAssertions, AssertionSet &haveAssertions, const OpenVarSet &openVars, WidenMode widenMode, const SymTab::Indexer &indexer, Type *&common ); 46 36 47 37 template< typename Iterator1, typename Iterator2 > -
src/ResolvExpr/typeops.h
rf9feab8 r90152a4 56 56 void adjustExprType( Type *&type, const TypeEnvironment &env, const SymTab::Indexer &indexer ); 57 57 58 /// Replaces array types with the equivalent pointer, and function types with a pointer-to-function using empty TypeEnvironment and Indexer 59 void adjustExprType( Type *& type ); 60 58 61 template< typename ForwardIterator > 59 62 void adjustExprTypeList( ForwardIterator begin, ForwardIterator end, const TypeEnvironment &env, const SymTab::Indexer &indexer ) { … … 103 106 104 107 // in AlternativeFinder.cc 105 void referenceToRvalueConversion( Expression *& expr );108 void referenceToRvalueConversion( Expression *& expr, Cost & cost ); 106 109 107 110 // flatten tuple type into list of types -
src/SymTab/Autogen.cc
rf9feab8 r90152a4 9 9 // Author : Rob Schluntz 10 10 // Created On : Thu Mar 03 15:45:56 2016 11 // Last Modified By : Andrew Beach12 // Last Modified On : Fri Jul 14 16:41:00 201713 // Update Count : 6 211 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Fri Apr 27 14:39:06 2018 13 // Update Count : 63 14 14 // 15 15 … … 24 24 #include <vector> // for vector 25 25 26 #include "AddVisit.h" // for addVisit27 26 #include "CodeGen/OperatorTable.h" // for isCtorDtor, isCtorDtorAssign 28 27 #include "Common/PassVisitor.h" // for PassVisitor … … 335 334 definitions.push_back( dcl ); 336 335 indexer.addId( dcl ); 337 } catch ( SemanticError err) {336 } catch ( SemanticErrorException & ) { 338 337 // okay if decl does not resolve - that means the function should not be generated 339 338 delete dcl; … … 380 379 paramType->attributes.clear(); 381 380 // add a parameter corresponding to this field 382 memCtorType->parameters.push_back( new ObjectDecl( field->name, Type::StorageClasses(), LinkageSpec::Cforall, nullptr, paramType, nullptr ) ); 381 ObjectDecl * param = new ObjectDecl( field->name, Type::StorageClasses(), LinkageSpec::Cforall, nullptr, paramType, nullptr ); 382 cloneAll_if( field->attributes, param->attributes, [](Attribute * attr) { return attr->isValidOnFuncParam(); } ); 383 memCtorType->parameters.push_back( param ); 383 384 FunctionDecl * ctor = genFunc( "?{}", memCtorType->clone(), functionNesting ); 384 385 makeFieldCtorBody( aggregateDecl->members.begin(), aggregateDecl->members.end(), ctor ); -
src/SymTab/FixFunction.cc
rf9feab8 r90152a4 30 30 // can't delete function type because it may contain assertions, so transfer ownership to new object 31 31 ObjectDecl *pointer = new ObjectDecl( functionDecl->name, functionDecl->get_storageClasses(), functionDecl->linkage, nullptr, new PointerType( Type::Qualifiers(), functionDecl->type ), nullptr, functionDecl->attributes ); 32 pointer->location = functionDecl->location; 32 33 functionDecl->attributes.clear(); 33 34 functionDecl->type = nullptr; … … 36 37 } 37 38 39 // xxx - this passes on void[], e.g. 40 // void foo(void [10]); 41 // does not cause an error 42 38 43 Type * FixFunction::postmutate(ArrayType *arrayType) { 39 44 // need to recursively mutate the base type in order for multi-dimensional arrays to work. 40 45 PointerType *pointerType = new PointerType( arrayType->get_qualifiers(), arrayType->base, arrayType->dimension, arrayType->isVarLen, arrayType->isStatic ); 46 pointerType->location = arrayType->location; 41 47 arrayType->base = nullptr; 42 48 arrayType->dimension = nullptr; … … 62 68 void FixFunction::premutate(ZeroType *) { visit_children = false; } 63 69 void FixFunction::premutate(OneType *) { visit_children = false; } 70 71 bool fixFunction( DeclarationWithType *& dwt ) { 72 PassVisitor<FixFunction> fixer; 73 dwt = dwt->acceptMutator( fixer ); 74 return fixer.pass.isVoid; 75 } 64 76 } // namespace SymTab 65 77 -
src/SymTab/FixFunction.h
rf9feab8 r90152a4 47 47 bool isVoid; 48 48 }; 49 50 bool fixFunction( DeclarationWithType *& ); 49 51 } // namespace SymTab 50 52 -
src/SymTab/Indexer.cc
rf9feab8 r90152a4 26 26 #include "Common/SemanticError.h" // for SemanticError 27 27 #include "Common/utility.h" // for cloneAll 28 #include "GenPoly/GenPoly.h" 28 29 #include "InitTweak/InitTweak.h" // for isConstructor, isCopyFunction, isC... 29 30 #include "Mangler.h" // for Mangler … … 105 106 if ( ! CodeGen::isCtorDtorAssign( id ) ) return; 106 107 107 // helpful data structure 108 // helpful data structure to organize properties for a type 108 109 struct ValueType { 109 struct DeclBall { 110 struct DeclBall { // properties for this particular decl 110 111 IdData decl; 111 bool isUserDefinedFunc; // properties for this particular decl 112 bool isDefaultCtor; 113 bool isDtor; 112 bool isUserDefinedFunc; 114 113 bool isCopyFunc; 115 114 }; 116 115 // properties for this type 117 bool existsUserDefinedFunc = false; // any user-defined function found118 bool existsUserDefinedCtor = false; // any user-defined constructor found119 bool existsUserDefinedDtor = false; // any user-defined destructor found120 116 bool existsUserDefinedCopyFunc = false; // user-defined copy ctor found 121 bool existsUserDefinedDefaultCtor = false; // user-defined default ctorfound117 BaseSyntaxNode * deleteStmt = nullptr; // non-null if a user-defined function is found 122 118 std::list< DeclBall > decls; 123 119 … … 126 122 ValueType & operator+=( IdData data ) { 127 123 DeclarationWithType * function = data.id; 128 bool isUserDefinedFunc = ! LinkageSpec::isOverridable( function->get_linkage() ); 129 bool isDefaultCtor = InitTweak::isDefaultConstructor( function ); 130 bool isDtor = InitTweak::isDestructor( function ); 131 bool isCopyFunc = InitTweak::isCopyFunction( function, function->get_name() ); 132 decls.push_back( DeclBall{ data, isUserDefinedFunc, isDefaultCtor, isDtor, isCopyFunc } ); 133 existsUserDefinedFunc = existsUserDefinedFunc || isUserDefinedFunc; 134 existsUserDefinedCtor = existsUserDefinedCtor || (isUserDefinedFunc && CodeGen::isConstructor( function->get_name() ) ); 135 existsUserDefinedDtor = existsUserDefinedDtor || (isUserDefinedFunc && isDtor); 124 bool isUserDefinedFunc = ! LinkageSpec::isOverridable( function->linkage ); 125 bool isCopyFunc = InitTweak::isCopyFunction( function, function->name ); 126 decls.push_back( DeclBall{ data, isUserDefinedFunc, isCopyFunc } ); 136 127 existsUserDefinedCopyFunc = existsUserDefinedCopyFunc || (isUserDefinedFunc && isCopyFunc); 137 existsUserDefinedDefaultCtor = existsUserDefinedDefaultCtor || (isUserDefinedFunc && isDefaultCtor); 128 if ( isUserDefinedFunc && ! deleteStmt ) { 129 // any user-defined function can act as an implicit delete statement for generated constructors. 130 // a delete stmt should not act as an implicit delete statement. 131 deleteStmt = data.id; 132 } 138 133 return *this; 139 134 } … … 147 142 for ( auto decl : copy ) { 148 143 if ( FunctionDecl * function = dynamic_cast< FunctionDecl * >( decl.id ) ) { 149 std::list< DeclarationWithType * > & params = function-> get_functionType()->get_parameters();144 std::list< DeclarationWithType * > & params = function->type->parameters; 150 145 assert( ! params.empty() ); 151 146 // use base type of pointer, so that qualifiers on the pointer type aren't considered. … … 159 154 160 155 // if a type contains user defined ctor/dtor/assign, then special rules trigger, which determine 161 // the set of ctor/dtor/assign that are seen by the requester. In particular, if the user defines 162 // a default ctor, then the generated default ctor should never be seen, likewise for copy ctor 163 // and dtor. If the user defines any ctor/dtor, then no generated field ctors should be seen. 164 // If the user defines any ctor then the generated default ctor should not be seen (intrinsic default 165 // ctor must be overridden exactly). 156 // the set of ctor/dtor/assign that can be used by the requester. In particular, if the user defines 157 // a default ctor, then the generated default ctor is unavailable, likewise for copy ctor 158 // and dtor. If the user defines any ctor/dtor, then no generated field ctors are available. 159 // If the user defines any ctor then the generated default ctor is unavailable (intrinsic default 160 // ctor must be overridden exactly). If the user defines anything that looks like a copy constructor, 161 // then the generated copy constructor is unavailable, and likewise for the assignment operator. 166 162 for ( std::pair< const std::string, ValueType > & pair : funcMap ) { 167 163 ValueType & val = pair.second; 168 164 for ( ValueType::DeclBall ball : val.decls ) { 169 bool noUserDefinedFunc = ! val.existsUserDefinedFunc; 170 bool isUserDefinedFunc = ball.isUserDefinedFunc; 171 bool isAcceptableDefaultCtor = (! val.existsUserDefinedCtor || (! val.existsUserDefinedDefaultCtor && ball.decl.id->get_linkage() == LinkageSpec::Intrinsic)) && ball.isDefaultCtor; // allow default constructors only when no user-defined constructors exist, except in the case of intrinsics, which require exact overrides 172 bool isAcceptableCopyFunc = ! val.existsUserDefinedCopyFunc && ball.isCopyFunc; // handles copy ctor and assignment operator 173 bool isAcceptableDtor = ! val.existsUserDefinedDtor && ball.isDtor; 174 if ( noUserDefinedFunc || isUserDefinedFunc || isAcceptableDefaultCtor || isAcceptableCopyFunc || isAcceptableDtor ) { 175 // decl conforms to the rules described above, so it should be seen by the requester 176 out.push_back( ball.decl ); 165 bool isNotUserDefinedFunc = ! ball.isUserDefinedFunc && ball.decl.id->linkage != LinkageSpec::Intrinsic; 166 bool isCopyFunc = ball.isCopyFunc; 167 bool existsUserDefinedCopyFunc = val.existsUserDefinedCopyFunc; 168 169 // only implicitly delete non-user defined functions that are not intrinsic, and are 170 // not copy functions (assignment or copy constructor). If a user-defined copy function exists, 171 // do not pass along the non-user-defined copy functions since signatures do not have to match, 172 // and the generated functions will often be cheaper. 173 if ( isNotUserDefinedFunc ) { 174 if ( isCopyFunc ) { 175 // Skip over non-user-defined copy functions when there is a user-defined copy function. 176 // Since their signatures do not have to be exact, deleting them is the wrong choice. 177 if ( existsUserDefinedCopyFunc ) continue; 178 } else { 179 // delete non-user-defined non-copy functions if applicable. 180 // deleteStmt will be non-null only if a user-defined function is found. 181 ball.decl.deleteStmt = val.deleteStmt; 182 } 177 183 } 184 out.push_back( ball.decl ); 178 185 } 179 186 } … … 265 272 } 266 273 274 NamedTypeDecl *Indexer::globalLookupType( const std::string &id ) const { 275 return lookupTypeAtScope( id, 0 ); 276 } 277 278 StructDecl *Indexer::globalLookupStruct( const std::string &id ) const { 279 return lookupStructAtScope( id, 0 ); 280 } 281 282 UnionDecl *Indexer::globalLookupUnion( const std::string &id ) const { 283 return lookupUnionAtScope( id, 0 ); 284 } 285 286 EnumDecl *Indexer::globalLookupEnum( const std::string &id ) const { 287 return lookupEnumAtScope( id, 0 ); 288 } 289 267 290 EnumDecl *Indexer::lookupEnum( const std::string &id ) const { 268 291 if ( ! tables ) return 0; … … 286 309 } 287 310 288 DeclarationWithType *Indexer::lookupIdAtScope( const std::string &id, const std::string &mangleName, unsigned long scope ) const {289 if ( ! tables ) return 0;290 if ( tables->scope < scope ) return 0;311 const Indexer::IdData * Indexer::lookupIdAtScope( const std::string &id, const std::string &mangleName, unsigned long scope ) const { 312 if ( ! tables ) return nullptr; 313 if ( tables->scope < scope ) return nullptr; 291 314 292 315 IdTable::const_iterator decls = tables->idTable.find( id ); … … 294 317 const MangleTable &mangleTable = decls->second; 295 318 MangleTable::const_iterator decl = mangleTable.find( mangleName ); 296 if ( decl != mangleTable.end() ) return decl->second.id;319 if ( decl != mangleTable.end() ) return &decl->second; 297 320 } 298 321 299 322 return tables->base.lookupIdAtScope( id, mangleName, scope ); 323 } 324 325 Indexer::IdData * Indexer::lookupIdAtScope( const std::string &id, const std::string &mangleName, unsigned long scope ) { 326 return const_cast<IdData *>(const_cast<const Indexer *>(this)->lookupIdAtScope( id, mangleName, scope )); 300 327 } 301 328 … … 336 363 if ( ! tables ) return 0; 337 364 if ( tables->scope < scope ) return 0; 365 if ( tables->scope > scope ) return tables->base.lookupTypeAtScope( id, scope ); 338 366 339 367 TypeTable::const_iterator ret = tables->typeTable.find( id ); … … 344 372 if ( ! tables ) return 0; 345 373 if ( tables->scope < scope ) return 0; 374 if ( tables->scope > scope ) return tables->base.lookupStructAtScope( id, scope ); 346 375 347 376 StructTable::const_iterator ret = tables->structTable.find( id ); … … 352 381 if ( ! tables ) return 0; 353 382 if ( tables->scope < scope ) return 0; 383 if ( tables->scope > scope ) return tables->base.lookupEnumAtScope( id, scope ); 354 384 355 385 EnumTable::const_iterator ret = tables->enumTable.find( id ); … … 360 390 if ( ! tables ) return 0; 361 391 if ( tables->scope < scope ) return 0; 392 if ( tables->scope > scope ) return tables->base.lookupUnionAtScope( id, scope ); 362 393 363 394 UnionTable::const_iterator ret = tables->unionTable.find( id ); … … 368 399 if ( ! tables ) return 0; 369 400 if ( tables->scope < scope ) return 0; 401 if ( tables->scope > scope ) return tables->base.lookupTraitAtScope( id, scope ); 370 402 371 403 TraitTable::const_iterator ret = tables->traitTable.find( id ); … … 373 405 } 374 406 375 bool addedIdConflicts( DeclarationWithType *existing, DeclarationWithType *added ) { 407 bool isFunction( DeclarationWithType * decl ) { 408 return GenPoly::getFunctionType( decl->get_type() ); 409 } 410 411 bool isObject( DeclarationWithType * decl ) { 412 return ! isFunction( decl ); 413 } 414 415 bool isDefinition( DeclarationWithType * decl ) { 416 if ( FunctionDecl * func = dynamic_cast< FunctionDecl * >( decl ) ) { 417 // a function is a definition if it has a body 418 return func->statements; 419 } else { 420 // an object is a definition if it is not marked extern. 421 // both objects must be marked extern 422 return ! decl->get_storageClasses().is_extern; 423 } 424 } 425 426 bool addedIdConflicts( Indexer::IdData & existing, DeclarationWithType *added, BaseSyntaxNode * deleteStmt, Indexer::ConflictFunction handleConflicts ) { 376 427 // if we're giving the same name mangling to things of different types then there is something wrong 377 assert( ( dynamic_cast<ObjectDecl*>( added ) && dynamic_cast<ObjectDecl*>( existing) )378 || ( dynamic_cast<FunctionDecl*>( added ) && dynamic_cast<FunctionDecl*>( existing) ) );379 380 if ( LinkageSpec::isOverridable( existing ->get_linkage() ) ) {428 assert( (isObject( added ) && isObject( existing.id ) ) 429 || ( isFunction( added ) && isFunction( existing.id ) ) ); 430 431 if ( LinkageSpec::isOverridable( existing.id->get_linkage() ) ) { 381 432 // new definition shadows the autogenerated one, even at the same scope 382 433 return false; 383 } else if ( LinkageSpec::isMangled( added->get_linkage() ) || ResolvExpr::typesCompatible( added->get_type(), existing->get_type(), Indexer() ) ) { 384 // typesCompatible doesn't really do the right thing here. When checking compatibility of function types, 385 // we should ignore outermost pointer qualifiers, except _Atomic? 386 FunctionDecl *newentry = dynamic_cast< FunctionDecl* >( added ); 387 FunctionDecl *oldentry = dynamic_cast< FunctionDecl* >( existing ); 388 if ( newentry && oldentry ) { 389 if ( newentry->get_statements() && oldentry->get_statements() ) { 390 throw SemanticError( "duplicate function definition for ", added ); 391 } // if 392 } else { 393 // two objects with the same mangled name defined in the same scope. 394 // both objects must be marked extern or both must be intrinsic for this to be okay 395 // xxx - perhaps it's actually if either is intrinsic then this is okay? 396 // might also need to be same storage class? 397 ObjectDecl *newobj = dynamic_cast< ObjectDecl* >( added ); 398 ObjectDecl *oldobj = dynamic_cast< ObjectDecl* >( existing ); 399 if ( ! newobj->get_storageClasses().is_extern && ! oldobj->get_storageClasses().is_extern ) { 400 throw SemanticError( "duplicate object definition for ", added ); 434 } else if ( LinkageSpec::isMangled( added->get_linkage() ) || ResolvExpr::typesCompatible( added->get_type(), existing.id->get_type(), Indexer() ) ) { 435 436 // it is a conflict if one declaration is deleted and the other is not 437 if ( deleteStmt && ! existing.deleteStmt ) { 438 return handleConflicts( existing, "deletion of defined identifier " ); 439 } else if ( ! deleteStmt && existing.deleteStmt ) { 440 return handleConflicts( existing, "definition of deleted identifier " ); 441 } 442 443 if ( isDefinition( added ) && isDefinition( existing.id ) ) { 444 if ( isFunction( added ) ) { 445 return handleConflicts( existing, "duplicate function definition for " ); 446 } else { 447 return handleConflicts( existing, "duplicate object definition for " ); 401 448 } // if 402 449 } // if 403 450 } else { 404 throw SemanticError( "duplicate definition for ", added);451 return handleConflicts( existing, "duplicate definition for " ); 405 452 } // if 406 453 … … 408 455 } 409 456 410 void Indexer::addId( DeclarationWithType *decl, Expression * baseExpr ) { 457 void Indexer::addId( DeclarationWithType *decl, ConflictFunction handleConflicts, Expression * baseExpr, BaseSyntaxNode * deleteStmt ) { 458 if ( decl->name == "" ) return; 411 459 debugPrint( "Adding Id " << decl->name << std::endl ); 412 460 makeWritable(); … … 430 478 // isomorphic to C type-compatibility, which it may not be. 431 479 if ( hasIncompatibleCDecl( name, mangleName, scope ) ) { 432 throw SemanticError( "conflicting overload of C function ", decl);433 } 434 } else { 435 // Check that a Cforall declaration doesn't over loadany C declaration480 SemanticError( decl, "conflicting overload of C function " ); 481 } 482 } else { 483 // Check that a Cforall declaration doesn't override any C declaration 436 484 if ( hasCompatibleCDecl( name, mangleName, scope ) ) { 437 throw SemanticError( "Cforall declaration hides C function ", decl);485 SemanticError( decl, "Cforall declaration hides C function " ); 438 486 } 439 487 } 440 488 441 489 // Skip repeat declarations of the same identifier 442 DeclarationWithType *existing = lookupIdAtScope( name, mangleName, scope );443 if ( existing && addedIdConflicts( existing, decl) ) return;490 IdData * existing = lookupIdAtScope( name, mangleName, scope ); 491 if ( existing && existing->id && addedIdConflicts( *existing, decl, deleteStmt, handleConflicts ) ) return; 444 492 445 493 // add to indexer 446 tables->idTable[ name ][ mangleName ] = { decl, baseExpr};494 tables->idTable[ name ][ mangleName ] = IdData{ decl, baseExpr, deleteStmt }; 447 495 ++tables->size; 448 496 } 449 497 498 void Indexer::addId( DeclarationWithType * decl, Expression * baseExpr ) { 499 // default handling of conflicts is to raise an error 500 addId( decl, [decl](IdData &, const std::string & msg) { SemanticError( decl, msg ); return true; }, baseExpr, decl->isDeleted ? decl : nullptr ); 501 } 502 503 void Indexer::addDeletedId( DeclarationWithType * decl, BaseSyntaxNode * deleteStmt ) { 504 // default handling of conflicts is to raise an error 505 addId( decl, [decl](IdData &, const std::string & msg) { SemanticError( decl, msg ); return true; }, nullptr, deleteStmt ); 506 } 507 450 508 bool addedTypeConflicts( NamedTypeDecl *existing, NamedTypeDecl *added ) { 451 if ( existing-> get_base() == 0) {509 if ( existing->base == nullptr ) { 452 510 return false; 453 } else if ( added-> get_base() == 0) {511 } else if ( added->base == nullptr ) { 454 512 return true; 455 513 } else { 456 throw SemanticError( "redeclaration of ", added ); 457 } 514 assert( existing->base && added->base ); 515 // typedef redeclarations are errors only if types are different 516 if ( ! ResolvExpr::typesCompatible( existing->base, added->base, Indexer() ) ) { 517 SemanticError( added->location, "redeclaration of " + added->name ); 518 } 519 } 520 // does not need to be added to the table if both existing and added have a base that are the same 521 return true; 458 522 } 459 523 … … 462 526 makeWritable(); 463 527 464 const std::string &id = decl-> get_name();528 const std::string &id = decl->name; 465 529 TypeTable::iterator existing = tables->typeTable.find( id ); 466 530 if ( existing == tables->typeTable.end() ) { … … 478 542 479 543 bool addedDeclConflicts( AggregateDecl *existing, AggregateDecl *added ) { 480 if ( existing->get_members().empty()) {544 if ( ! existing->body ) { 481 545 return false; 482 } else if ( ! added->get_members().empty()) {483 throw SemanticError( "redeclaration of ", added);546 } else if ( added->body ) { 547 SemanticError( added, "redeclaration of " ); 484 548 } // if 485 549 return true; … … 495 559 makeWritable(); 496 560 497 const std::string &id = decl-> get_name();561 const std::string &id = decl->name; 498 562 StructTable::iterator existing = tables->structTable.find( id ); 499 563 if ( existing == tables->structTable.end() ) { … … 514 578 makeWritable(); 515 579 516 const std::string &id = decl-> get_name();580 const std::string &id = decl->name; 517 581 EnumTable::iterator existing = tables->enumTable.find( id ); 518 582 if ( existing == tables->enumTable.end() ) { … … 538 602 makeWritable(); 539 603 540 const std::string &id = decl-> get_name();604 const std::string &id = decl->name; 541 605 UnionTable::iterator existing = tables->unionTable.find( id ); 542 606 if ( existing == tables->unionTable.end() ) { … … 557 621 makeWritable(); 558 622 559 const std::string &id = decl-> get_name();623 const std::string &id = decl->name; 560 624 TraitTable::iterator existing = tables->traitTable.find( id ); 561 625 if ( existing == tables->traitTable.end() ) { … … 572 636 } 573 637 574 void Indexer::addWith( WithStmt * stmt ) { 575 for ( Expression * expr : stmt->exprs ) { 638 void Indexer::addMembers( AggregateDecl * aggr, Expression * expr, ConflictFunction handleConflicts ) { 639 for ( Declaration * decl : aggr->members ) { 640 if ( DeclarationWithType * dwt = dynamic_cast< DeclarationWithType * >( decl ) ) { 641 addId( dwt, handleConflicts, expr ); 642 if ( dwt->name == "" ) { 643 Type * t = dwt->get_type()->stripReferences(); 644 if ( dynamic_cast< StructInstType * >( t ) || dynamic_cast< UnionInstType * >( t ) ) { 645 Expression * base = expr->clone(); 646 ResolvExpr::Cost cost = ResolvExpr::Cost::zero; // xxx - carry this cost into the indexer as a base cost? 647 ResolvExpr::referenceToRvalueConversion( base, cost ); 648 addMembers( t->getAggr(), new MemberExpr( dwt, base ), handleConflicts ); 649 } 650 } 651 } 652 } 653 } 654 655 void Indexer::addWith( std::list< Expression * > & withExprs, BaseSyntaxNode * withStmt ) { 656 for ( Expression * expr : withExprs ) { 576 657 if ( expr->result ) { 577 658 AggregateDecl * aggr = expr->result->stripReferences()->getAggr(); 578 659 assertf( aggr, "WithStmt expr has non-aggregate type: %s", toString( expr->result ).c_str() ); 579 660 580 for ( Declaration * decl : aggr->members) {581 if ( DeclarationWithType * dwt = dynamic_cast< DeclarationWithType * >( decl ) ) {582 addId( dwt, expr );583 }584 } 661 addMembers( aggr, expr, [withStmt](IdData & existing, const std::string &) { 662 // on conflict, delete the identifier 663 existing.deleteStmt = withStmt; 664 return true; 665 }); 585 666 } 586 667 } … … 641 722 642 723 void Indexer::print( std::ostream &os, int indent ) const { 643 using std::cerr;724 using std::cerr; 644 725 645 726 if ( tables ) { … … 666 747 } 667 748 668 Expression * Indexer::IdData::combine() const { 749 Expression * Indexer::IdData::combine( ResolvExpr::Cost & cost ) const { 750 Expression * ret = nullptr; 669 751 if ( baseExpr ) { 670 752 Expression * base = baseExpr->clone(); 671 ResolvExpr::referenceToRvalueConversion( base );672 Expression *ret = new MemberExpr( id, base );753 ResolvExpr::referenceToRvalueConversion( base, cost ); 754 ret = new MemberExpr( id, base ); 673 755 // xxx - this introduces hidden environments, for now remove them. 674 756 // std::swap( base->env, ret->env ); 675 757 delete base->env; 676 758 base->env = nullptr; 677 return ret; 678 } else { 679 return new VariableExpr( id ); 680 } 759 } else { 760 ret = new VariableExpr( id ); 761 } 762 if ( deleteStmt ) ret = new DeletedExpr( ret, deleteStmt ); 763 return ret; 681 764 } 682 765 } // namespace SymTab -
src/SymTab/Indexer.h
rf9feab8 r90152a4 19 19 #include <list> // for list 20 20 #include <string> // for string 21 #include <functional> // for function 21 22 22 23 #include "SynTree/Visitor.h" // for Visitor 23 24 #include "SynTree/SynTree.h" // for AST nodes 25 26 namespace ResolvExpr { 27 class Cost; 28 } 24 29 25 30 namespace SymTab { … … 40 45 41 46 struct IdData { 42 DeclarationWithType * id ;43 Expression * baseExpr ; // WithExpr47 DeclarationWithType * id = nullptr; 48 Expression * baseExpr = nullptr; // WithExpr 44 49 45 Expression * combine() const; 50 /// non-null if this declaration is deleted 51 BaseSyntaxNode * deleteStmt = nullptr; 52 53 // NOTE: shouldn't need either of these constructors, but gcc-4 does not properly support initializer lists with default members. 54 IdData() = default; 55 IdData( DeclarationWithType * id, Expression * baseExpr, BaseSyntaxNode * deleteStmt ) : id( id ), baseExpr( baseExpr ), deleteStmt( deleteStmt ) {} 56 57 Expression * combine( ResolvExpr::Cost & cost ) const; 46 58 }; 47 59 … … 59 71 TraitDecl *lookupTrait( const std::string &id ) const; 60 72 73 /// Gets the type declaration with the given ID at global scope 74 NamedTypeDecl *globalLookupType( const std::string &id ) const; 75 /// Gets the struct declaration with the given ID at global scope 76 StructDecl *globalLookupStruct( const std::string &id ) const; 77 /// Gets the union declaration with the given ID at global scope 78 UnionDecl *globalLookupUnion( const std::string &id ) const; 79 /// Gets the enum declaration with the given ID at global scope 80 EnumDecl *globalLookupEnum( const std::string &id ) const; 81 61 82 void print( std::ostream &os, int indent = 0 ) const; 62 83 63 84 /// looks up a specific mangled ID at the given scope 64 DeclarationWithType *lookupIdAtScope( const std::string &id, const std::string &mangleName, unsigned long scope ) const; 85 IdData * lookupIdAtScope( const std::string &id, const std::string &mangleName, unsigned long scope ); 86 const IdData * lookupIdAtScope( const std::string &id, const std::string &mangleName, unsigned long scope ) const; 65 87 /// returns true if there exists a declaration with C linkage and the given name with a different mangled name 66 88 bool hasIncompatibleCDecl( const std::string &id, const std::string &mangleName, unsigned long scope ) const; … … 74 96 TraitDecl *lookupTraitAtScope( const std::string &id, unsigned long scope ) const; 75 97 76 void addId( DeclarationWithType *decl, Expression * baseExpr = nullptr ); 98 typedef std::function<bool(IdData &, const std::string &)> ConflictFunction; 99 100 void addId( DeclarationWithType * decl, Expression * baseExpr = nullptr ); 101 void addDeletedId( DeclarationWithType * decl, BaseSyntaxNode * deleteStmt ); 102 77 103 void addType( NamedTypeDecl *decl ); 78 104 void addStruct( const std::string &id ); … … 84 110 85 111 /// adds all of the IDs from WithStmt exprs 86 void addWith( WithStmt * ); 112 void addWith( std::list< Expression * > & withExprs, BaseSyntaxNode * withStmt ); 113 114 /// adds all of the members of the Aggregate (addWith helper) 115 void addMembers( AggregateDecl * aggr, Expression * expr, ConflictFunction ); 87 116 88 117 /// convenience function for adding a list of Ids to the indexer … … 114 143 /// Ensures that tables variable is writable (i.e. allocated, uniquely owned by this Indexer, and at the current scope) 115 144 void makeWritable(); 145 146 /// common code for addId, addDeletedId, etc. 147 void addId( DeclarationWithType * decl, ConflictFunction, Expression * baseExpr = nullptr, BaseSyntaxNode * deleteStmt = nullptr ); 116 148 }; 117 149 } // namespace SymTab -
src/SymTab/Mangler.cc
rf9feab8 r90152a4 23 23 24 24 #include "CodeGen/OperatorTable.h" // for OperatorInfo, operatorLookup 25 #include "Common/PassVisitor.h" 25 26 #include "Common/SemanticError.h" // for SemanticError 26 27 #include "Common/utility.h" // for toString … … 31 32 32 33 namespace SymTab { 33 std::string Mangler::mangleType( Type * ty ) { 34 Mangler mangler( false, true, true ); 35 maybeAccept( ty, mangler ); 36 return mangler.get_mangleName(); 37 } 38 39 std::string Mangler::mangleConcrete( Type* ty ) { 40 Mangler mangler( false, false, false ); 41 maybeAccept( ty, mangler ); 42 return mangler.get_mangleName(); 43 } 44 45 Mangler::Mangler( bool mangleOverridable, bool typeMode, bool mangleGenericParams ) 46 : nextVarNum( 0 ), isTopLevel( true ), mangleOverridable( mangleOverridable ), typeMode( typeMode ), mangleGenericParams( mangleGenericParams ) {} 47 48 Mangler::Mangler( const Mangler &rhs ) : mangleName() { 49 varNums = rhs.varNums; 50 nextVarNum = rhs.nextVarNum; 51 isTopLevel = rhs.isTopLevel; 52 mangleOverridable = rhs.mangleOverridable; 53 typeMode = rhs.typeMode; 54 } 55 56 void Mangler::mangleDecl( DeclarationWithType * declaration ) { 57 bool wasTopLevel = isTopLevel; 58 if ( isTopLevel ) { 59 varNums.clear(); 60 nextVarNum = 0; 61 isTopLevel = false; 62 } // if 63 mangleName << "__"; 64 CodeGen::OperatorInfo opInfo; 65 if ( operatorLookup( declaration->get_name(), opInfo ) ) { 66 mangleName << opInfo.outputName; 67 } else { 68 mangleName << declaration->get_name(); 69 } // if 70 mangleName << "__"; 71 maybeAccept( declaration->get_type(), *this ); 72 if ( mangleOverridable && LinkageSpec::isOverridable( declaration->get_linkage() ) ) { 73 // want to be able to override autogenerated and intrinsic routines, 74 // so they need a different name mangling 75 if ( declaration->get_linkage() == LinkageSpec::AutoGen ) { 76 mangleName << "autogen__"; 77 } else if ( declaration->get_linkage() == LinkageSpec::Intrinsic ) { 78 mangleName << "intrinsic__"; 79 } else { 80 // if we add another kind of overridable function, this has to change 81 assert( false && "unknown overrideable linkage" ); 82 } // if 34 namespace Mangler { 35 namespace { 36 /// Mangles names to a unique C identifier 37 struct Mangler : public WithShortCircuiting, public WithVisitorRef<Mangler>, public WithGuards { 38 Mangler( bool mangleOverridable, bool typeMode, bool mangleGenericParams ); 39 Mangler( const Mangler & ) = delete; 40 41 void previsit( BaseSyntaxNode * ) { visit_children = false; } 42 43 void postvisit( ObjectDecl * declaration ); 44 void postvisit( FunctionDecl * declaration ); 45 void postvisit( TypeDecl * declaration ); 46 47 void postvisit( VoidType * voidType ); 48 void postvisit( BasicType * basicType ); 49 void postvisit( PointerType * pointerType ); 50 void postvisit( ArrayType * arrayType ); 51 void postvisit( ReferenceType * refType ); 52 void postvisit( FunctionType * functionType ); 53 void postvisit( StructInstType * aggregateUseType ); 54 void postvisit( UnionInstType * aggregateUseType ); 55 void postvisit( EnumInstType * aggregateUseType ); 56 void postvisit( TypeInstType * aggregateUseType ); 57 void postvisit( TraitInstType * inst ); 58 void postvisit( TupleType * tupleType ); 59 void postvisit( VarArgsType * varArgsType ); 60 void postvisit( ZeroType * zeroType ); 61 void postvisit( OneType * oneType ); 62 void postvisit( QualifiedType * qualType ); 63 64 std::string get_mangleName() { return mangleName.str(); } 65 private: 66 std::ostringstream mangleName; ///< Mangled name being constructed 67 typedef std::map< std::string, std::pair< int, int > > VarMapType; 68 VarMapType varNums; ///< Map of type variables to indices 69 int nextVarNum; ///< Next type variable index 70 bool isTopLevel; ///< Is the Mangler at the top level 71 bool mangleOverridable; ///< Specially mangle overridable built-in methods 72 bool typeMode; ///< Produce a unique mangled name for a type 73 bool mangleGenericParams; ///< Include generic parameters in name mangling if true 74 bool inFunctionType = false; ///< Include type qualifiers if false. 75 bool inQualifiedType = false; ///< Add start/end delimiters around qualified type 76 77 void mangleDecl( DeclarationWithType *declaration ); 78 void mangleRef( ReferenceToType *refType, std::string prefix ); 79 80 void printQualifiers( Type *type ); 81 }; // Mangler 82 } // namespace 83 84 std::string mangle( BaseSyntaxNode * decl, bool mangleOverridable, bool typeMode, bool mangleGenericParams ) { 85 PassVisitor<Mangler> mangler( mangleOverridable, typeMode, mangleGenericParams ); 86 maybeAccept( decl, mangler ); 87 return mangler.pass.get_mangleName(); 83 88 } 84 isTopLevel = wasTopLevel; 85 } 86 87 void Mangler::visit( ObjectDecl * declaration ) { 88 mangleDecl( declaration ); 89 } 90 91 void Mangler::visit( FunctionDecl * declaration ) { 92 mangleDecl( declaration ); 93 } 94 95 void Mangler::visit( VoidType * voidType ) { 96 printQualifiers( voidType ); 97 mangleName << "v"; 98 } 99 100 void Mangler::visit( BasicType * basicType ) { 101 static const char *btLetter[] = { 102 "b", // Bool 103 "c", // Char 104 "Sc", // SignedChar 105 "Uc", // UnsignedChar 106 "s", // ShortSignedInt 107 "Us", // ShortUnsignedInt 108 "i", // SignedInt 109 "Ui", // UnsignedInt 110 "l", // LongSignedInt 111 "Ul", // LongUnsignedInt 112 "q", // LongLongSignedInt 113 "Uq", // LongLongUnsignedInt 114 "f", // Float 115 "d", // Double 116 "r", // LongDouble 117 "Xf", // FloatComplex 118 "Xd", // DoubleComplex 119 "Xr", // LongDoubleComplex 120 "If", // FloatImaginary 121 "Id", // DoubleImaginary 122 "Ir", // LongDoubleImaginary 123 "w", // SignedInt128 124 "Uw", // UnsignedInt128 125 }; 126 127 printQualifiers( basicType ); 128 mangleName << btLetter[ basicType->get_kind() ]; 129 } 130 131 void Mangler::visit( PointerType * pointerType ) { 132 printQualifiers( pointerType ); 133 mangleName << "P"; 134 maybeAccept( pointerType->get_base(), *this ); 135 } 136 137 void Mangler::visit( ArrayType * arrayType ) { 138 // TODO: encode dimension 139 printQualifiers( arrayType ); 140 mangleName << "A0"; 141 maybeAccept( arrayType->get_base(), *this ); 142 } 143 144 void Mangler::visit( ReferenceType * refType ) { 145 printQualifiers( refType ); 146 mangleName << "R"; 147 maybeAccept( refType->get_base(), *this ); 148 } 149 150 namespace { 151 inline std::list< Type* > getTypes( const std::list< DeclarationWithType* > decls ) { 152 std::list< Type* > ret; 153 std::transform( decls.begin(), decls.end(), std::back_inserter( ret ), 154 std::mem_fun( &DeclarationWithType::get_type ) ); 155 return ret; 89 90 std::string mangleType( Type * ty ) { 91 PassVisitor<Mangler> mangler( false, true, true ); 92 maybeAccept( ty, mangler ); 93 return mangler.pass.get_mangleName(); 156 94 } 157 } 158 159 void Mangler::visit( FunctionType * functionType ) { 160 printQualifiers( functionType ); 161 mangleName << "F"; 162 std::list< Type* > returnTypes = getTypes( functionType->get_returnVals() ); 163 acceptAll( returnTypes, *this ); 164 mangleName << "_"; 165 std::list< Type* > paramTypes = getTypes( functionType->get_parameters() ); 166 acceptAll( paramTypes, *this ); 167 mangleName << "_"; 168 } 169 170 void Mangler::mangleRef( ReferenceToType * refType, std::string prefix ) { 171 printQualifiers( refType ); 172 173 mangleName << ( refType->get_name().length() + prefix.length() ) << prefix << refType->get_name(); 174 175 if ( mangleGenericParams ) { 176 std::list< Expression* >& params = refType->get_parameters(); 177 if ( ! params.empty() ) { 95 96 std::string mangleConcrete( Type * ty ) { 97 PassVisitor<Mangler> mangler( false, false, false ); 98 maybeAccept( ty, mangler ); 99 return mangler.pass.get_mangleName(); 100 } 101 102 namespace { 103 Mangler::Mangler( bool mangleOverridable, bool typeMode, bool mangleGenericParams ) 104 : nextVarNum( 0 ), isTopLevel( true ), mangleOverridable( mangleOverridable ), typeMode( typeMode ), mangleGenericParams( mangleGenericParams ) {} 105 106 void Mangler::mangleDecl( DeclarationWithType * declaration ) { 107 bool wasTopLevel = isTopLevel; 108 if ( isTopLevel ) { 109 varNums.clear(); 110 nextVarNum = 0; 111 isTopLevel = false; 112 } // if 113 mangleName << Encoding::manglePrefix; 114 CodeGen::OperatorInfo opInfo; 115 if ( operatorLookup( declaration->get_name(), opInfo ) ) { 116 mangleName << opInfo.outputName.size() << opInfo.outputName; 117 } else { 118 mangleName << declaration->name.size() << declaration->name; 119 } // if 120 maybeAccept( declaration->get_type(), *visitor ); 121 if ( mangleOverridable && LinkageSpec::isOverridable( declaration->get_linkage() ) ) { 122 // want to be able to override autogenerated and intrinsic routines, 123 // so they need a different name mangling 124 if ( declaration->get_linkage() == LinkageSpec::AutoGen ) { 125 mangleName << Encoding::autogen; 126 } else if ( declaration->get_linkage() == LinkageSpec::Intrinsic ) { 127 mangleName << Encoding::intrinsic; 128 } else { 129 // if we add another kind of overridable function, this has to change 130 assert( false && "unknown overrideable linkage" ); 131 } // if 132 } 133 isTopLevel = wasTopLevel; 134 } 135 136 void Mangler::postvisit( ObjectDecl * declaration ) { 137 mangleDecl( declaration ); 138 } 139 140 void Mangler::postvisit( FunctionDecl * declaration ) { 141 mangleDecl( declaration ); 142 } 143 144 void Mangler::postvisit( VoidType * voidType ) { 145 printQualifiers( voidType ); 146 mangleName << Encoding::void_t; 147 } 148 149 void Mangler::postvisit( BasicType * basicType ) { 150 printQualifiers( basicType ); 151 assertf( basicType->get_kind() < BasicType::NUMBER_OF_BASIC_TYPES, "Unhandled basic type: %d", basicType->get_kind() ); 152 mangleName << Encoding::basicTypes[ basicType->get_kind() ]; 153 } 154 155 void Mangler::postvisit( PointerType * pointerType ) { 156 printQualifiers( pointerType ); 157 // mangle void (*f)() and void f() to the same name to prevent overloading on functions and function pointers 158 if ( ! dynamic_cast<FunctionType *>( pointerType->base ) ) mangleName << Encoding::pointer; 159 maybeAccept( pointerType->base, *visitor ); 160 } 161 162 void Mangler::postvisit( ArrayType * arrayType ) { 163 // TODO: encode dimension 164 printQualifiers( arrayType ); 165 mangleName << Encoding::array << "0"; 166 maybeAccept( arrayType->base, *visitor ); 167 } 168 169 void Mangler::postvisit( ReferenceType * refType ) { 170 // don't print prefix (e.g. 'R') for reference types so that references and non-references do not overload. 171 // Further, do not print the qualifiers for a reference type (but do run printQualifers because of TypeDecls, etc.), 172 // by pretending every reference type is a function parameter. 173 GuardValue( inFunctionType ); 174 inFunctionType = true; 175 printQualifiers( refType ); 176 maybeAccept( refType->base, *visitor ); 177 } 178 179 namespace { 180 inline std::list< Type* > getTypes( const std::list< DeclarationWithType* > decls ) { 181 std::list< Type* > ret; 182 std::transform( decls.begin(), decls.end(), std::back_inserter( ret ), 183 std::mem_fun( &DeclarationWithType::get_type ) ); 184 return ret; 185 } 186 } 187 188 void Mangler::postvisit( FunctionType * functionType ) { 189 printQualifiers( functionType ); 190 mangleName << Encoding::function; 191 // turn on inFunctionType so that printQualifiers does not print most qualifiers for function parameters, 192 // since qualifiers on outermost parameter type do not differentiate function types, e.g., 193 // void (*)(const int) and void (*)(int) are the same type, but void (*)(const int *) and void (*)(int *) are different 194 GuardValue( inFunctionType ); 195 inFunctionType = true; 196 std::list< Type* > returnTypes = getTypes( functionType->returnVals ); 197 if (returnTypes.empty()) mangleName << Encoding::void_t; 198 else acceptAll( returnTypes, *visitor ); 178 199 mangleName << "_"; 179 for ( std::list< Expression* >::const_iterator param = params.begin(); param != params.end(); ++param ) { 180 TypeExpr *paramType = dynamic_cast< TypeExpr* >( *param ); 181 assertf(paramType, "Aggregate parameters should be type expressions: %s", toString(*param).c_str()); 182 maybeAccept( paramType->get_type(), *this ); 183 } 200 std::list< Type* > paramTypes = getTypes( functionType->parameters ); 201 acceptAll( paramTypes, *visitor ); 184 202 mangleName << "_"; 185 203 } 186 } 187 } 188 189 void Mangler::visit( StructInstType * aggregateUseType ) { 190 mangleRef( aggregateUseType, "s" ); 191 } 192 193 void Mangler::visit( UnionInstType * aggregateUseType ) { 194 mangleRef( aggregateUseType, "u" ); 195 } 196 197 void Mangler::visit( EnumInstType * aggregateUseType ) { 198 mangleRef( aggregateUseType, "e" ); 199 } 200 201 void Mangler::visit( TypeInstType * typeInst ) { 202 VarMapType::iterator varNum = varNums.find( typeInst->get_name() ); 203 if ( varNum == varNums.end() ) { 204 mangleRef( typeInst, "t" ); 205 } else { 206 printQualifiers( typeInst ); 207 std::ostringstream numStream; 208 numStream << varNum->second.first; 209 switch ( (TypeDecl::Kind )varNum->second.second ) { 210 case TypeDecl::Dtype: 211 mangleName << "d"; 212 break; 213 case TypeDecl::Ftype: 214 mangleName << "f"; 215 break; 216 case TypeDecl::Ttype: 217 mangleName << "tVARGS"; 218 break; 219 default: 220 assert( false ); 221 } // switch 222 mangleName << numStream.str(); 223 } // if 224 } 225 226 void Mangler::visit( TupleType * tupleType ) { 227 printQualifiers( tupleType ); 228 mangleName << "T"; 229 acceptAll( tupleType->types, *this ); 230 mangleName << "_"; 231 } 232 233 void Mangler::visit( VarArgsType * varArgsType ) { 234 printQualifiers( varArgsType ); 235 mangleName << "VARGS"; 236 } 237 238 void Mangler::visit( ZeroType * ) { 239 mangleName << "Z"; 240 } 241 242 void Mangler::visit( OneType * ) { 243 mangleName << "O"; 244 } 245 246 void Mangler::visit( TypeDecl * decl ) { 247 static const char *typePrefix[] = { "BT", "BD", "BF" }; 248 mangleName << typePrefix[ decl->get_kind() ] << ( decl->name.length() + 1 ) << decl->name; 249 } 250 251 void printVarMap( const std::map< std::string, std::pair< int, int > > &varMap, std::ostream &os ) { 252 for ( std::map< std::string, std::pair< int, int > >::const_iterator i = varMap.begin(); i != varMap.end(); ++i ) { 253 os << i->first << "(" << i->second.first << "/" << i->second.second << ")" << std::endl; 254 } // for 255 } 256 257 void Mangler::printQualifiers( Type * type ) { 258 // skip if not including qualifiers 259 if ( typeMode ) return; 260 261 if ( ! type->get_forall().empty() ) { 262 std::list< std::string > assertionNames; 263 int tcount = 0, dcount = 0, fcount = 0, vcount = 0; 264 mangleName << "A"; 265 for ( Type::ForallList::iterator i = type->forall.begin(); i != type->forall.end(); ++i ) { 266 switch ( (*i)->get_kind() ) { 267 case TypeDecl::Dtype: 268 dcount++; 269 break; 270 case TypeDecl::Ftype: 271 fcount++; 272 break; 273 case TypeDecl::Ttype: 274 vcount++; 275 break; 276 default: 277 assert( false ); 278 } // switch 279 varNums[ (*i)->name ] = std::pair< int, int >( nextVarNum++, (int)(*i)->get_kind() ); 280 for ( std::list< DeclarationWithType* >::iterator assert = (*i)->assertions.begin(); assert != (*i)->assertions.end(); ++assert ) { 281 Mangler sub_mangler( mangleOverridable, typeMode, mangleGenericParams ); 282 sub_mangler.nextVarNum = nextVarNum; 283 sub_mangler.isTopLevel = false; 284 sub_mangler.varNums = varNums; 285 (*assert)->accept( sub_mangler ); 286 assertionNames.push_back( sub_mangler.mangleName.str() ); 204 205 void Mangler::mangleRef( ReferenceToType * refType, std::string prefix ) { 206 printQualifiers( refType ); 207 208 mangleName << prefix << refType->name.length() << refType->name; 209 210 if ( mangleGenericParams ) { 211 std::list< Expression* >& params = refType->parameters; 212 if ( ! params.empty() ) { 213 mangleName << "_"; 214 for ( std::list< Expression* >::const_iterator param = params.begin(); param != params.end(); ++param ) { 215 TypeExpr *paramType = dynamic_cast< TypeExpr* >( *param ); 216 assertf(paramType, "Aggregate parameters should be type expressions: %s", toCString(*param)); 217 maybeAccept( paramType->type, *visitor ); 218 } 219 mangleName << "_"; 220 } 221 } 222 } 223 224 void Mangler::postvisit( StructInstType * aggregateUseType ) { 225 mangleRef( aggregateUseType, Encoding::struct_t ); 226 } 227 228 void Mangler::postvisit( UnionInstType * aggregateUseType ) { 229 mangleRef( aggregateUseType, Encoding::union_t ); 230 } 231 232 void Mangler::postvisit( EnumInstType * aggregateUseType ) { 233 mangleRef( aggregateUseType, Encoding::enum_t ); 234 } 235 236 void Mangler::postvisit( TypeInstType * typeInst ) { 237 VarMapType::iterator varNum = varNums.find( typeInst->get_name() ); 238 if ( varNum == varNums.end() ) { 239 mangleRef( typeInst, Encoding::type ); 240 } else { 241 printQualifiers( typeInst ); 242 // Note: Can't use name here, since type variable names do not actually disambiguate a function, e.g. 243 // forall(dtype T) void f(T); 244 // forall(dtype S) void f(S); 245 // are equivalent and should mangle the same way. This is accomplished by numbering the type variables when they 246 // are first found and prefixing with the appropriate encoding for the type class. 247 assertf( varNum->second.second < TypeDecl::NUMBER_OF_KINDS, "Unhandled type variable kind: %d", varNum->second.second ); 248 mangleName << Encoding::typeVariables[varNum->second.second] << varNum->second.first; 249 } // if 250 } 251 252 void Mangler::postvisit( TraitInstType * inst ) { 253 printQualifiers( inst ); 254 mangleName << inst->name.size() << inst->name; 255 } 256 257 void Mangler::postvisit( TupleType * tupleType ) { 258 printQualifiers( tupleType ); 259 mangleName << Encoding::tuple << tupleType->types.size(); 260 acceptAll( tupleType->types, *visitor ); 261 } 262 263 void Mangler::postvisit( VarArgsType * varArgsType ) { 264 printQualifiers( varArgsType ); 265 static const std::string vargs = "__builtin_va_list"; 266 mangleName << Encoding::type << vargs.size() << vargs; 267 } 268 269 void Mangler::postvisit( ZeroType * ) { 270 mangleName << Encoding::zero; 271 } 272 273 void Mangler::postvisit( OneType * ) { 274 mangleName << Encoding::one; 275 } 276 277 void Mangler::postvisit( QualifiedType * qualType ) { 278 bool inqual = inQualifiedType; 279 if (! inqual ) { 280 // N marks the start of a qualified type 281 inQualifiedType = true; 282 mangleName << Encoding::qualifiedTypeStart; 283 } 284 maybeAccept( qualType->parent, *visitor ); 285 maybeAccept( qualType->child, *visitor ); 286 if ( ! inqual ) { 287 // E marks the end of a qualified type 288 inQualifiedType = false; 289 mangleName << Encoding::qualifiedTypeEnd; 290 } 291 } 292 293 void Mangler::postvisit( TypeDecl * decl ) { 294 // TODO: is there any case where mangling a TypeDecl makes sense? If so, this code needs to be 295 // fixed to ensure that two TypeDecls mangle to the same name when they are the same type and vice versa. 296 // Note: The current scheme may already work correctly for this case, I have not thought about this deeply 297 // and the case has not yet come up in practice. Alternatively, if not then this code can be removed 298 // aside from the assert false. 299 assertf(false, "Mangler should not visit typedecl: %s", toCString(decl)); 300 assertf( decl->get_kind() < TypeDecl::NUMBER_OF_KINDS, "Unhandled type variable kind: %d", decl->get_kind() ); 301 mangleName << Encoding::typeVariables[ decl->get_kind() ] << ( decl->name.length() ) << decl->name; 302 } 303 304 __attribute__((unused)) void printVarMap( const std::map< std::string, std::pair< int, int > > &varMap, std::ostream &os ) { 305 for ( std::map< std::string, std::pair< int, int > >::const_iterator i = varMap.begin(); i != varMap.end(); ++i ) { 306 os << i->first << "(" << i->second.first << "/" << i->second.second << ")" << std::endl; 287 307 } // for 288 } // for 289 mangleName << tcount << "_" << dcount << "_" << fcount << "_" << vcount << "_"; 290 std::copy( assertionNames.begin(), assertionNames.end(), std::ostream_iterator< std::string >( mangleName, "" ) ); 291 mangleName << "_"; 292 } // if 293 if ( type->get_const() ) { 294 mangleName << "C"; 295 } // if 296 if ( type->get_volatile() ) { 297 mangleName << "V"; 298 } // if 299 if ( type->get_mutex() ) { 300 mangleName << "M"; 301 } // if 302 // Removed due to restrict not affecting function compatibility in GCC 303 // if ( type->get_isRestrict() ) { 304 // mangleName << "E"; 305 // } // if 306 if ( type->get_lvalue() ) { 307 // mangle based on whether the type is lvalue, so that the resolver can differentiate lvalues and rvalues 308 mangleName << "L"; 309 } 310 if ( type->get_atomic() ) { 311 mangleName << "A"; 312 } // if 313 } 308 } 309 310 void Mangler::printQualifiers( Type * type ) { 311 // skip if not including qualifiers 312 if ( typeMode ) return; 313 if ( ! type->get_forall().empty() ) { 314 std::list< std::string > assertionNames; 315 int dcount = 0, fcount = 0, vcount = 0, acount = 0; 316 mangleName << Encoding::forall; 317 for ( Type::ForallList::iterator i = type->forall.begin(); i != type->forall.end(); ++i ) { 318 switch ( (*i)->get_kind() ) { 319 case TypeDecl::Dtype: 320 dcount++; 321 break; 322 case TypeDecl::Ftype: 323 fcount++; 324 break; 325 case TypeDecl::Ttype: 326 vcount++; 327 break; 328 default: 329 assert( false ); 330 } // switch 331 varNums[ (*i)->name ] = std::pair< int, int >( nextVarNum++, (int)(*i)->get_kind() ); 332 for ( std::list< DeclarationWithType* >::iterator assert = (*i)->assertions.begin(); assert != (*i)->assertions.end(); ++assert ) { 333 PassVisitor<Mangler> sub_mangler( mangleOverridable, typeMode, mangleGenericParams ); 334 sub_mangler.pass.nextVarNum = nextVarNum; 335 sub_mangler.pass.isTopLevel = false; 336 sub_mangler.pass.varNums = varNums; 337 (*assert)->accept( sub_mangler ); 338 assertionNames.push_back( sub_mangler.pass.mangleName.str() ); 339 acount++; 340 } // for 341 } // for 342 mangleName << dcount << "_" << fcount << "_" << vcount << "_" << acount << "_"; 343 std::copy( assertionNames.begin(), assertionNames.end(), std::ostream_iterator< std::string >( mangleName, "" ) ); 344 mangleName << "_"; 345 } // if 346 if ( ! inFunctionType ) { 347 // these qualifiers do not distinguish the outermost type of a function parameter 348 if ( type->get_const() ) { 349 mangleName << Encoding::qualifiers.at(Type::Const); 350 } // if 351 if ( type->get_volatile() ) { 352 mangleName << Encoding::qualifiers.at(Type::Volatile); 353 } // if 354 // Removed due to restrict not affecting function compatibility in GCC 355 // if ( type->get_isRestrict() ) { 356 // mangleName << "E"; 357 // } // if 358 if ( type->get_atomic() ) { 359 mangleName << Encoding::qualifiers.at(Type::Atomic); 360 } // if 361 } 362 if ( type->get_mutex() ) { 363 mangleName << Encoding::qualifiers.at(Type::Mutex); 364 } // if 365 if ( type->get_lvalue() ) { 366 // mangle based on whether the type is lvalue, so that the resolver can differentiate lvalues and rvalues 367 mangleName << Encoding::qualifiers.at(Type::Lvalue); 368 } 369 370 if ( inFunctionType ) { 371 // turn off inFunctionType so that types can be differentiated for nested qualifiers 372 GuardValue( inFunctionType ); 373 inFunctionType = false; 374 } 375 } 376 } // namespace 377 } // namespace Mangler 314 378 } // namespace SymTab 315 379 -
src/SymTab/Mangler.h
rf9feab8 r90152a4 24 24 #include "SynTree/Visitor.h" // for Visitor, maybeAccept 25 25 26 // https://itanium-cxx-abi.github.io/cxx-abi/abi.html#mangling 27 // The CFA name mangling scheme is based closely on the itanium C++ name mangling scheme, with the following key differences: 28 // * Variable names are also mangled to include type information, not just functions 29 // * CFA does not have template expansion, so the rules for function specialization do not apply. 30 // * CFA instead has to handle type parameters and assertion parameters. 31 // * Currently name compression is not implemented. 32 26 33 namespace SymTab { 27 /// Mangles names to a unique C identifier 28 class Mangler : public Visitor { 29 public: 34 namespace Mangler { 30 35 /// Mangle syntax tree object; primary interface to clients 31 template< typename SynTreeClass >32 static std::string mangle( SynTreeClass *decl, bool mangleOverridable = true, bool typeMode = false, bool mangleGenericParams = true ); 36 std::string mangle( BaseSyntaxNode * decl, bool mangleOverridable = true, bool typeMode = false, bool mangleGenericParams = true ); 37 33 38 /// Mangle a type name; secondary interface 34 st atic std::string mangleType( Type* ty );39 std::string mangleType( Type* ty ); 35 40 /// Mangle ignoring generic type parameters 36 st atic std::string mangleConcrete( Type* ty );41 std::string mangleConcrete( Type* ty ); 37 42 43 namespace Encoding { 44 extern const std::string manglePrefix; 45 extern const std::string basicTypes[]; 46 extern const std::map<int, std::string> qualifiers; 38 47 39 virtual void visit( ObjectDecl *declaration );40 virtual void visit( FunctionDecl *declaration );41 virtual void visit( TypeDecl *declaration );48 extern const std::string void_t; 49 extern const std::string zero; 50 extern const std::string one; 42 51 43 virtual void visit( VoidType *voidType ); 44 virtual void visit( BasicType *basicType ); 45 virtual void visit( PointerType *pointerType ); 46 virtual void visit( ArrayType *arrayType ); 47 virtual void visit( ReferenceType *refType ); 48 virtual void visit( FunctionType *functionType ); 49 virtual void visit( StructInstType *aggregateUseType ); 50 virtual void visit( UnionInstType *aggregateUseType ); 51 virtual void visit( EnumInstType *aggregateUseType ); 52 virtual void visit( TypeInstType *aggregateUseType ); 53 virtual void visit( TupleType *tupleType ); 54 virtual void visit( VarArgsType *varArgsType ); 55 virtual void visit( ZeroType *zeroType ); 56 virtual void visit( OneType *oneType ); 52 extern const std::string function; 53 extern const std::string tuple; 54 extern const std::string pointer; 55 extern const std::string array; 56 extern const std::string qualifiedTypeStart; 57 extern const std::string qualifiedTypeEnd; 57 58 58 std::string get_mangleName() { return mangleName.str(); } 59 private: 60 std::ostringstream mangleName; ///< Mangled name being constructed 61 typedef std::map< std::string, std::pair< int, int > > VarMapType; 62 VarMapType varNums; ///< Map of type variables to indices 63 int nextVarNum; ///< Next type variable index 64 bool isTopLevel; ///< Is the Mangler at the top level 65 bool mangleOverridable; ///< Specially mangle overridable built-in methods 66 bool typeMode; ///< Produce a unique mangled name for a type 67 bool mangleGenericParams; ///< Include generic parameters in name mangling if true 59 extern const std::string forall; 60 extern const std::string typeVariables[]; 68 61 69 Mangler( bool mangleOverridable, bool typeMode, bool mangleGenericParams ); 70 Mangler( const Mangler & ); 62 extern const std::string struct_t; 63 extern const std::string union_t; 64 extern const std::string enum_t; 65 extern const std::string type; 71 66 72 void mangleDecl( DeclarationWithType *declaration ); 73 void mangleRef( ReferenceToType *refType, std::string prefix ); 67 extern const std::string autogen; 68 extern const std::string intrinsic; 69 }; 70 } // Mangler 71 } // SymTab 74 72 75 void printQualifiers( Type *type ); 76 }; // Mangler 77 78 template< typename SynTreeClass > 79 std::string Mangler::mangle( SynTreeClass *decl, bool mangleOverridable, bool typeMode, bool mangleGenericParams ) { 80 Mangler mangler( mangleOverridable, typeMode, mangleGenericParams ); 81 maybeAccept( decl, mangler ); 82 return mangler.get_mangleName(); 83 } 84 } // SymTab 73 extern "C" { 74 char * cforall_demangle(const char *, int); 75 } 85 76 86 77 // Local Variables: // -
src/SymTab/Validate.cc
rf9feab8 r90152a4 48 48 #include "CodeGen/CodeGenerator.h" // for genName 49 49 #include "CodeGen/OperatorTable.h" // for isCtorDtor, isCtorDtorAssign 50 #include "ControlStruct/Mutate.h" // for ForExprMutator 50 51 #include "Common/PassVisitor.h" // for PassVisitor, WithDeclsToAdd 51 52 #include "Common/ScopedMap.h" // for ScopedMap … … 60 61 #include "Parser/LinkageSpec.h" // for C 61 62 #include "ResolvExpr/typeops.h" // for typesCompatible 62 #include "SymTab/AddVisit.h" // for addVisit 63 #include "ResolvExpr/Resolver.h" // for findSingleExpression 64 #include "ResolvExpr/ResolveTypeof.h" // for resolveTypeof 63 65 #include "SymTab/Autogen.h" // for SizeType 64 66 #include "SynTree/Attribute.h" // for noAttributes, Attribute … … 72 74 #include "SynTree/TypeSubstitution.h" // for TypeSubstitution 73 75 #include "SynTree/Visitor.h" // for Visitor 76 #include "Validate/HandleAttributes.h" // for handleAttributes 74 77 75 78 class CompoundStmt; … … 77 80 class SwitchStmt; 78 81 79 80 #define debugPrint( x ) if ( doDebug ) { std::cout << x; } 82 #define debugPrint( x ) if ( doDebug ) x 81 83 82 84 namespace SymTab { 85 /// hoists declarations that are difficult to hoist while parsing 86 struct HoistTypeDecls final : public WithDeclsToAdd { 87 void previsit( SizeofExpr * ); 88 void previsit( AlignofExpr * ); 89 void previsit( UntypedOffsetofExpr * ); 90 void previsit( CompoundLiteralExpr * ); 91 void handleType( Type * ); 92 }; 93 94 struct FixQualifiedTypes final : public WithIndexer { 95 Type * postmutate( QualifiedType * ); 96 }; 97 83 98 struct HoistStruct final : public WithDeclsToAdd, public WithGuards { 84 99 /// Flattens nested struct types 85 100 static void hoistStruct( std::list< Declaration * > &translationUnit ); 86 101 87 void previsit( EnumInstType * enumInstType );88 void previsit( StructInstType * structInstType );89 void previsit( UnionInstType * unionInstType );90 102 void previsit( StructDecl * aggregateDecl ); 91 103 void previsit( UnionDecl * aggregateDecl ); 104 void previsit( StaticAssertDecl * assertDecl ); 105 void previsit( StructInstType * type ); 106 void previsit( UnionInstType * type ); 107 void previsit( EnumInstType * type ); 92 108 93 109 private: 94 110 template< typename AggDecl > void handleAggregate( AggDecl *aggregateDecl ); 95 111 96 bool inStruct = false;112 AggregateDecl * parentAggr = nullptr; 97 113 }; 98 114 … … 112 128 113 129 /// Associates forward declarations of aggregates with their definitions 114 struct LinkReferenceToTypes final : public WithIndexer, public WithGuards {130 struct LinkReferenceToTypes final : public WithIndexer, public WithGuards, public WithVisitorRef<LinkReferenceToTypes>, public WithShortCircuiting { 115 131 LinkReferenceToTypes( const Indexer *indexer ); 116 132 void postvisit( TypeInstType *typeInst ); … … 120 136 void postvisit( UnionInstType *unionInst ); 121 137 void postvisit( TraitInstType *traitInst ); 138 void previsit( QualifiedType * qualType ); 139 void postvisit( QualifiedType * qualType ); 122 140 123 141 void postvisit( EnumDecl *enumDecl ); … … 148 166 void previsit( ObjectDecl * object ); 149 167 void previsit( FunctionDecl * func ); 168 void previsit( FunctionType * ftype ); 150 169 void previsit( StructDecl * aggrDecl ); 151 170 void previsit( UnionDecl * aggrDecl ); … … 164 183 }; 165 184 166 struct EliminateTypedef final : public WithVisitorRef<EliminateTypedef>, public WithGuards{167 EliminateTypedef() : scopeLevel( 0 ) {}185 struct ReplaceTypedef final : public WithVisitorRef<ReplaceTypedef>, public WithGuards, public WithShortCircuiting, public WithDeclsToAdd { 186 ReplaceTypedef() : scopeLevel( 0 ) {} 168 187 /// Replaces typedefs by forward declarations 169 static void eliminateTypedef( std::list< Declaration * > &translationUnit ); 170 188 static void replaceTypedef( std::list< Declaration * > &translationUnit ); 189 190 void premutate( QualifiedType * ); 191 Type * postmutate( QualifiedType * qualType ); 171 192 Type * postmutate( TypeInstType * aggregateUseType ); 172 193 Declaration * postmutate( TypedefDecl * typeDecl ); … … 179 200 180 201 void premutate( CompoundStmt * compoundStmt ); 181 CompoundStmt * postmutate( CompoundStmt * compoundStmt );182 202 183 203 void premutate( StructDecl * structDecl ); 184 Declaration * postmutate( StructDecl * structDecl );185 204 void premutate( UnionDecl * unionDecl ); 186 Declaration * postmutate( UnionDecl * unionDecl );187 205 void premutate( EnumDecl * enumDecl ); 188 Declaration * postmutate( EnumDecl * enumDecl ); 189 Declaration * postmutate( TraitDecl * contextDecl ); 206 void premutate( TraitDecl * ); 190 207 191 208 void premutate( FunctionType * ftype ); … … 193 210 private: 194 211 template<typename AggDecl> 195 AggDecl *handleAggregate( AggDecl * aggDecl );196 197 template<typename AggDecl>198 212 void addImplicitTypedef( AggDecl * aggDecl ); 213 template< typename AggDecl > 214 void handleAggregate( AggDecl * aggr ); 199 215 200 216 typedef std::unique_ptr<TypedefDecl> TypedefDeclPtr; 201 217 typedef ScopedMap< std::string, std::pair< TypedefDeclPtr, int > > TypedefMap; 202 typedef std::map< std::string, TypeDecl * > TypeDeclMap;218 typedef ScopedMap< std::string, TypeDecl * > TypeDeclMap; 203 219 TypedefMap typedefNames; 204 220 TypeDeclMap typedeclNames; 205 221 int scopeLevel; 206 222 bool inFunctionType = false; 223 }; 224 225 struct EliminateTypedef { 226 /// removes TypedefDecls from the AST 227 static void eliminateTypedef( std::list< Declaration * > &translationUnit ); 228 229 template<typename AggDecl> 230 void handleAggregate( AggDecl *aggregateDecl ); 231 232 void previsit( StructDecl * aggregateDecl ); 233 void previsit( UnionDecl * aggregateDecl ); 234 void previsit( CompoundStmt * compoundStmt ); 207 235 }; 208 236 … … 222 250 }; 223 251 224 struct ArrayLength { 252 struct FixObjectType : public WithIndexer { 253 /// resolves typeof type in object, function, and type declarations 254 static void fix( std::list< Declaration * > & translationUnit ); 255 256 void previsit( ObjectDecl * ); 257 void previsit( FunctionDecl * ); 258 void previsit( TypeDecl * ); 259 }; 260 261 struct ArrayLength : public WithIndexer { 225 262 /// for array types without an explicit length, compute the length and store it so that it 226 263 /// is known to the rest of the phases. For example, … … 233 270 234 271 void previsit( ObjectDecl * objDecl ); 272 void previsit( ArrayType * arrayType ); 235 273 }; 236 274 … … 262 300 PassVisitor<FindSpecialDeclarations> finder; 263 301 PassVisitor<LabelAddressFixer> labelAddrFixer; 264 265 EliminateTypedef::eliminateTypedef( translationUnit ); 266 HoistStruct::hoistStruct( translationUnit ); // must happen after EliminateTypedef, so that aggregate typedefs occur in the correct order 302 PassVisitor<HoistTypeDecls> hoistDecls; 303 PassVisitor<FixQualifiedTypes> fixQual; 304 305 acceptAll( translationUnit, hoistDecls ); 306 ReplaceTypedef::replaceTypedef( translationUnit ); 267 307 ReturnTypeFixer::fix( translationUnit ); // must happen before autogen 268 308 acceptAll( translationUnit, epc ); // must happen before VerifyCtorDtorAssign, because void return objects should not exist; before LinkReferenceToTypes because it is an indexer and needs correct types for mangling 269 309 acceptAll( translationUnit, lrt ); // must happen before autogen, because sized flag needs to propagate to generated functions 310 mutateAll( translationUnit, fixQual ); // must happen after LinkReferenceToTypes, because aggregate members are accessed 311 HoistStruct::hoistStruct( translationUnit ); // must happen after EliminateTypedef, so that aggregate typedefs occur in the correct order 312 EliminateTypedef::eliminateTypedef( translationUnit ); // 270 313 acceptAll( translationUnit, genericParams ); // check as early as possible - can't happen before LinkReferenceToTypes 271 314 VerifyCtorDtorAssign::verify( translationUnit ); // must happen before autogen, because autogen examines existing ctor/dtors … … 274 317 Concurrency::applyKeywords( translationUnit ); 275 318 acceptAll( translationUnit, fpd ); // must happen before autogenerateRoutines, after Concurrency::applyKeywords because uniqueIds must be set on declaration before resolution 319 ControlStruct::hoistControlDecls( translationUnit ); // hoist initialization out of for statements; must happen before autogenerateRoutines 276 320 autogenerateRoutines( translationUnit ); // moved up, used to be below compoundLiteral - currently needs EnumAndPointerDecay 277 321 Concurrency::implementMutexFuncs( translationUnit ); 278 322 Concurrency::implementThreadStarter( translationUnit ); 279 323 mutateAll( translationUnit, compoundliteral ); 324 ResolvExpr::resolveWithExprs( translationUnit ); // must happen before FixObjectType because user-code is resolved and may contain with variables 325 FixObjectType::fix( translationUnit ); 280 326 ArrayLength::computeLength( translationUnit ); 281 327 acceptAll( translationUnit, finder ); // xxx - remove this pass soon 282 328 mutateAll( translationUnit, labelAddrFixer ); 329 Validate::handleAttributes( translationUnit ); 283 330 } 284 331 … … 292 339 } 293 340 341 342 void HoistTypeDecls::handleType( Type * type ) { 343 // some type declarations are buried in expressions and not easy to hoist during parsing; hoist them here 344 AggregateDecl * aggr = nullptr; 345 if ( StructInstType * inst = dynamic_cast< StructInstType * >( type ) ) { 346 aggr = inst->baseStruct; 347 } else if ( UnionInstType * inst = dynamic_cast< UnionInstType * >( type ) ) { 348 aggr = inst->baseUnion; 349 } else if ( EnumInstType * inst = dynamic_cast< EnumInstType * >( type ) ) { 350 aggr = inst->baseEnum; 351 } 352 if ( aggr && aggr->body ) { 353 declsToAddBefore.push_front( aggr ); 354 } 355 } 356 357 void HoistTypeDecls::previsit( SizeofExpr * expr ) { 358 handleType( expr->type ); 359 } 360 361 void HoistTypeDecls::previsit( AlignofExpr * expr ) { 362 handleType( expr->type ); 363 } 364 365 void HoistTypeDecls::previsit( UntypedOffsetofExpr * expr ) { 366 handleType( expr->type ); 367 } 368 369 void HoistTypeDecls::previsit( CompoundLiteralExpr * expr ) { 370 handleType( expr->result ); 371 } 372 373 374 Type * FixQualifiedTypes::postmutate( QualifiedType * qualType ) { 375 Type * parent = qualType->parent; 376 Type * child = qualType->child; 377 if ( dynamic_cast< GlobalScopeType * >( qualType->parent ) ) { 378 // .T => lookup T at global scope 379 if ( TypeInstType * inst = dynamic_cast< TypeInstType * >( child ) ) { 380 auto td = indexer.globalLookupType( inst->name ); 381 if ( ! td ) { 382 SemanticError( qualType->location, toString("Use of undefined global type ", inst->name) ); 383 } 384 auto base = td->base; 385 assert( base ); 386 Type * ret = base->clone(); 387 ret->get_qualifiers() = qualType->get_qualifiers(); 388 return ret; 389 } else { 390 // .T => T is not a type name 391 assertf( false, "unhandled global qualified child type: %s", toCString(child) ); 392 } 393 } else { 394 // S.T => S must be an aggregate type, find the declaration for T in S. 395 AggregateDecl * aggr = nullptr; 396 if ( StructInstType * inst = dynamic_cast< StructInstType * >( parent ) ) { 397 aggr = inst->baseStruct; 398 } else if ( UnionInstType * inst = dynamic_cast< UnionInstType * > ( parent ) ) { 399 aggr = inst->baseUnion; 400 } else { 401 SemanticError( qualType->location, toString("Qualified type requires an aggregate on the left, but has: ", parent) ); 402 } 403 assert( aggr ); // TODO: need to handle forward declarations 404 for ( Declaration * member : aggr->members ) { 405 if ( StructInstType * inst = dynamic_cast< StructInstType * >( child ) ) { 406 if ( StructDecl * aggr = dynamic_cast< StructDecl * >( member ) ) { 407 if ( aggr->name == inst->name ) { 408 // TODO: is this case, and other non-TypeInstType cases, necessary? 409 return new StructInstType( qualType->get_qualifiers(), aggr ); 410 } 411 } 412 } else if ( UnionInstType * inst = dynamic_cast< UnionInstType * >( child ) ) { 413 if ( UnionDecl * aggr = dynamic_cast< UnionDecl * > ( member ) ) { 414 if ( aggr->name == inst->name ) { 415 return new UnionInstType( qualType->get_qualifiers(), aggr ); 416 } 417 } 418 } else if ( EnumInstType * inst = dynamic_cast< EnumInstType * >( child ) ) { 419 if ( EnumDecl * aggr = dynamic_cast< EnumDecl * > ( member ) ) { 420 if ( aggr->name == inst->name ) { 421 return new EnumInstType( qualType->get_qualifiers(), aggr ); 422 } 423 } 424 } else if ( TypeInstType * inst = dynamic_cast< TypeInstType * >( child ) ) { 425 // name on the right is a typedef 426 if ( NamedTypeDecl * aggr = dynamic_cast< NamedTypeDecl * > ( member ) ) { 427 if ( aggr->name == inst->name ) { 428 assert( aggr->base ); 429 Type * ret = aggr->base->clone(); 430 ret->get_qualifiers() = qualType->get_qualifiers(); 431 return ret; 432 } 433 } 434 } else { 435 // S.T - S is not an aggregate => error 436 assertf( false, "unhandled qualified child type: %s", toCString(qualType) ); 437 } 438 } 439 // failed to find a satisfying definition of type 440 SemanticError( qualType->location, toString("Undefined type in qualified type: ", qualType) ); 441 } 442 443 // ... may want to link canonical SUE definition to each forward decl so that it becomes easier to lookup? 444 } 445 446 294 447 void HoistStruct::hoistStruct( std::list< Declaration * > &translationUnit ) { 295 448 PassVisitor<HoistStruct> hoister; … … 297 450 } 298 451 299 bool isStructOrUnion( Declaration *decl ) { 300 return dynamic_cast< StructDecl * >( decl ) || dynamic_cast< UnionDecl * >( decl ); 452 bool shouldHoist( Declaration *decl ) { 453 return dynamic_cast< StructDecl * >( decl ) || dynamic_cast< UnionDecl * >( decl ) || dynamic_cast< StaticAssertDecl * >( decl ); 454 } 455 456 namespace { 457 void qualifiedName( AggregateDecl * aggr, std::ostringstream & ss ) { 458 if ( aggr->parent ) qualifiedName( aggr->parent, ss ); 459 ss << "__" << aggr->name; 460 } 461 462 // mangle nested type names using entire parent chain 463 std::string qualifiedName( AggregateDecl * aggr ) { 464 std::ostringstream ss; 465 qualifiedName( aggr, ss ); 466 return ss.str(); 467 } 301 468 } 302 469 303 470 template< typename AggDecl > 304 471 void HoistStruct::handleAggregate( AggDecl *aggregateDecl ) { 305 if ( inStruct ) { 472 if ( parentAggr ) { 473 aggregateDecl->parent = parentAggr; 474 aggregateDecl->name = qualifiedName( aggregateDecl ); 306 475 // Add elements in stack order corresponding to nesting structure. 307 476 declsToAddBefore.push_front( aggregateDecl ); 308 477 } else { 309 GuardValue( inStruct);310 inStruct = true;478 GuardValue( parentAggr ); 479 parentAggr = aggregateDecl; 311 480 } // if 312 481 // Always remove the hoisted aggregate from the inner structure. 313 GuardAction( [aggregateDecl]() { filter( aggregateDecl->members, isStructOrUnion, false ); } ); 314 } 315 316 void HoistStruct::previsit( EnumInstType * inst ) { 317 if ( inst->baseEnum ) { 318 declsToAddBefore.push_front( inst->baseEnum ); 319 } 320 } 321 322 void HoistStruct::previsit( StructInstType * inst ) { 323 if ( inst->baseStruct ) { 324 declsToAddBefore.push_front( inst->baseStruct ); 325 } 326 } 327 328 void HoistStruct::previsit( UnionInstType * inst ) { 329 if ( inst->baseUnion ) { 330 declsToAddBefore.push_front( inst->baseUnion ); 482 GuardAction( [aggregateDecl]() { filter( aggregateDecl->members, shouldHoist, false ); } ); 483 } 484 485 void HoistStruct::previsit( StaticAssertDecl * assertDecl ) { 486 if ( parentAggr ) { 487 declsToAddBefore.push_back( assertDecl ); 331 488 } 332 489 } … … 340 497 } 341 498 499 void HoistStruct::previsit( StructInstType * type ) { 500 // need to reset type name after expanding to qualified name 501 assert( type->baseStruct ); 502 type->name = type->baseStruct->name; 503 } 504 505 void HoistStruct::previsit( UnionInstType * type ) { 506 assert( type->baseUnion ); 507 type->name = type->baseUnion->name; 508 } 509 510 void HoistStruct::previsit( EnumInstType * type ) { 511 assert( type->baseEnum ); 512 type->name = type->baseEnum->name; 513 } 514 515 516 bool isTypedef( Declaration *decl ) { 517 return dynamic_cast< TypedefDecl * >( decl ); 518 } 519 520 void EliminateTypedef::eliminateTypedef( std::list< Declaration * > &translationUnit ) { 521 PassVisitor<EliminateTypedef> eliminator; 522 acceptAll( translationUnit, eliminator ); 523 filter( translationUnit, isTypedef, true ); 524 } 525 526 template< typename AggDecl > 527 void EliminateTypedef::handleAggregate( AggDecl *aggregateDecl ) { 528 filter( aggregateDecl->members, isTypedef, true ); 529 } 530 531 void EliminateTypedef::previsit( StructDecl * aggregateDecl ) { 532 handleAggregate( aggregateDecl ); 533 } 534 535 void EliminateTypedef::previsit( UnionDecl * aggregateDecl ) { 536 handleAggregate( aggregateDecl ); 537 } 538 539 void EliminateTypedef::previsit( CompoundStmt * compoundStmt ) { 540 // remove and delete decl stmts 541 filter( compoundStmt->kids, [](Statement * stmt) { 542 if ( DeclStmt *declStmt = dynamic_cast< DeclStmt * >( stmt ) ) { 543 if ( dynamic_cast< TypedefDecl * >( declStmt->decl ) ) { 544 return true; 545 } // if 546 } // if 547 return false; 548 }, true); 549 } 550 342 551 void EnumAndPointerDecay::previsit( EnumDecl *enumDecl ) { 343 552 // Set the type of each member of the enumeration to be EnumConstant 344 for ( std::list< Declaration * >::iterator i = enumDecl-> get_members().begin(); i != enumDecl->get_members().end(); ++i ) {553 for ( std::list< Declaration * >::iterator i = enumDecl->members.begin(); i != enumDecl->members.end(); ++i ) { 345 554 ObjectDecl * obj = dynamic_cast< ObjectDecl * >( *i ); 346 555 assert( obj ); 347 obj->set_type( new EnumInstType( Type::Qualifiers( Type::Const ), enumDecl-> get_name()) );556 obj->set_type( new EnumInstType( Type::Qualifiers( Type::Const ), enumDecl->name ) ); 348 557 } // for 349 558 } … … 351 560 namespace { 352 561 template< typename DWTList > 353 void fixFunctionList( DWTList & dwts, FunctionType * func ) { 354 // the only case in which "void" is valid is where it is the only one in the list; then it should be removed 355 // entirely. other fix ups are handled by the FixFunction class 356 typedef typename DWTList::iterator DWTIterator; 357 DWTIterator begin( dwts.begin() ), end( dwts.end() ); 358 if ( begin == end ) return; 359 PassVisitor<FixFunction> fixer; 360 DWTIterator i = begin; 361 *i = (*i)->acceptMutator( fixer ); 362 if ( fixer.pass.isVoid ) { 363 DWTIterator j = i; 364 ++i; 365 delete *j; 366 dwts.erase( j ); 367 if ( i != end ) { 368 throw SemanticError( "invalid type void in function type ", func ); 369 } // if 370 } else { 371 ++i; 372 for ( ; i != end; ++i ) { 373 PassVisitor<FixFunction> fixer; 374 *i = (*i)->acceptMutator( fixer ); 375 if ( fixer.pass.isVoid ) { 376 throw SemanticError( "invalid type void in function type ", func ); 377 } // if 378 } // for 379 } // if 562 void fixFunctionList( DWTList & dwts, bool isVarArgs, FunctionType * func ) { 563 auto nvals = dwts.size(); 564 bool containsVoid = false; 565 for ( auto & dwt : dwts ) { 566 // fix each DWT and record whether a void was found 567 containsVoid |= fixFunction( dwt ); 568 } 569 570 // the only case in which "void" is valid is where it is the only one in the list 571 if ( containsVoid && ( nvals > 1 || isVarArgs ) ) { 572 SemanticError( func, "invalid type void in function type " ); 573 } 574 575 // one void is the only thing in the list; remove it. 576 if ( containsVoid ) { 577 delete dwts.front(); 578 dwts.clear(); 579 } 380 580 } 381 581 } … … 383 583 void EnumAndPointerDecay::previsit( FunctionType *func ) { 384 584 // Fix up parameters and return types 385 fixFunctionList( func-> get_parameters(), func );386 fixFunctionList( func-> get_returnVals(), func );585 fixFunctionList( func->parameters, func->isVarArgs, func ); 586 fixFunctionList( func->returnVals, false, func ); 387 587 } 388 588 … … 396 596 397 597 void LinkReferenceToTypes::postvisit( EnumInstType *enumInst ) { 398 EnumDecl *st = local_indexer->lookupEnum( enumInst-> get_name());598 EnumDecl *st = local_indexer->lookupEnum( enumInst->name ); 399 599 // it's not a semantic error if the enum is not found, just an implicit forward declaration 400 600 if ( st ) { 401 //assert( ! enumInst->get_baseEnum() || enumInst->get_baseEnum()->get_members().empty() || ! st->get_members().empty() ); 402 enumInst->set_baseEnum( st ); 403 } // if 404 if ( ! st || st->get_members().empty() ) { 601 enumInst->baseEnum = st; 602 } // if 603 if ( ! st || ! st->body ) { 405 604 // use of forward declaration 406 forwardEnums[ enumInst-> get_name()].push_back( enumInst );605 forwardEnums[ enumInst->name ].push_back( enumInst ); 407 606 } // if 408 607 } … … 411 610 for ( Expression * param : inst->parameters ) { 412 611 if ( ! dynamic_cast< TypeExpr * >( param ) ) { 413 throw SemanticError( "Expression parameters for generic types are currently unsupported: ", inst);612 SemanticError( inst, "Expression parameters for generic types are currently unsupported: " ); 414 613 } 415 614 } … … 417 616 418 617 void LinkReferenceToTypes::postvisit( StructInstType *structInst ) { 419 StructDecl *st = local_indexer->lookupStruct( structInst-> get_name());618 StructDecl *st = local_indexer->lookupStruct( structInst->name ); 420 619 // it's not a semantic error if the struct is not found, just an implicit forward declaration 421 620 if ( st ) { 422 //assert( ! structInst->get_baseStruct() || structInst->get_baseStruct()->get_members().empty() || ! st->get_members().empty() ); 423 structInst->set_baseStruct( st ); 424 } // if 425 if ( ! st || st->get_members().empty() ) { 621 structInst->baseStruct = st; 622 } // if 623 if ( ! st || ! st->body ) { 426 624 // use of forward declaration 427 forwardStructs[ structInst-> get_name()].push_back( structInst );625 forwardStructs[ structInst->name ].push_back( structInst ); 428 626 } // if 429 627 checkGenericParameters( structInst ); … … 431 629 432 630 void LinkReferenceToTypes::postvisit( UnionInstType *unionInst ) { 433 UnionDecl *un = local_indexer->lookupUnion( unionInst-> get_name());631 UnionDecl *un = local_indexer->lookupUnion( unionInst->name ); 434 632 // it's not a semantic error if the union is not found, just an implicit forward declaration 435 633 if ( un ) { 436 unionInst-> set_baseUnion( un );437 } // if 438 if ( ! un || un->get_members().empty()) {634 unionInst->baseUnion = un; 635 } // if 636 if ( ! un || ! un->body ) { 439 637 // use of forward declaration 440 forwardUnions[ unionInst-> get_name()].push_back( unionInst );638 forwardUnions[ unionInst->name ].push_back( unionInst ); 441 639 } // if 442 640 checkGenericParameters( unionInst ); 641 } 642 643 void LinkReferenceToTypes::previsit( QualifiedType * ) { 644 visit_children = false; 645 } 646 647 void LinkReferenceToTypes::postvisit( QualifiedType * qualType ) { 648 // linking only makes sense for the 'oldest ancestor' of the qualified type 649 qualType->parent->accept( *visitor ); 443 650 } 444 651 … … 451 658 DeclarationWithType * dwt2 = dynamic_cast<DeclarationWithType *>( d2 ); 452 659 if ( dwt1 && dwt2 ) { 453 if ( dwt1-> get_name() == dwt2->get_name()&& ResolvExpr::typesCompatible( dwt1->get_type(), dwt2->get_type(), SymTab::Indexer() ) ) {660 if ( dwt1->name == dwt2->name && ResolvExpr::typesCompatible( dwt1->get_type(), dwt2->get_type(), SymTab::Indexer() ) ) { 454 661 // std::cerr << "=========== equal:" << std::endl; 455 662 // std::cerr << "d1: " << d1 << std::endl; … … 476 683 template< typename Iterator > 477 684 void expandAssertions( TraitInstType * inst, Iterator out ) { 478 assertf( inst->baseTrait, "Trait instance not linked to base trait: %s", to String( inst ).c_str() );685 assertf( inst->baseTrait, "Trait instance not linked to base trait: %s", toCString( inst ) ); 479 686 std::list< DeclarationWithType * > asserts; 480 687 for ( Declaration * decl : inst->baseTrait->members ) { … … 511 718 TraitDecl *traitDecl = local_indexer->lookupTrait( traitInst->name ); 512 719 if ( ! traitDecl ) { 513 throw SemanticError("use of undeclared trait " + traitInst->name );514 } // if 515 if ( traitDecl-> get_parameters().size() != traitInst->get_parameters().size() ) {516 throw SemanticError( "incorrect number of trait parameters: ", traitInst);720 SemanticError( traitInst->location, "use of undeclared trait " + traitInst->name ); 721 } // if 722 if ( traitDecl->parameters.size() != traitInst->parameters.size() ) { 723 SemanticError( traitInst, "incorrect number of trait parameters: " ); 517 724 } // if 518 725 traitInst->baseTrait = traitDecl; 519 726 520 727 // need to carry over the 'sized' status of each decl in the instance 521 for ( auto p : group_iterate( traitDecl-> get_parameters(), traitInst->get_parameters()) ) {728 for ( auto p : group_iterate( traitDecl->parameters, traitInst->parameters ) ) { 522 729 TypeExpr * expr = dynamic_cast< TypeExpr * >( std::get<1>(p) ); 523 730 if ( ! expr ) { 524 throw SemanticError( "Expression parameters for trait instances are currently unsupported: ", std::get<1>(p));731 SemanticError( std::get<1>(p), "Expression parameters for trait instances are currently unsupported: " ); 525 732 } 526 733 if ( TypeInstType * inst = dynamic_cast< TypeInstType * >( expr->get_type() ) ) { 527 734 TypeDecl * formalDecl = std::get<0>(p); 528 TypeDecl * instDecl = inst-> get_baseType();735 TypeDecl * instDecl = inst->baseType; 529 736 if ( formalDecl->get_sized() ) instDecl->set_sized( true ); 530 737 } … … 535 742 void LinkReferenceToTypes::postvisit( EnumDecl *enumDecl ) { 536 743 // visit enum members first so that the types of self-referencing members are updated properly 537 if ( ! enumDecl->get_members().empty()) {538 ForwardEnumsType::iterator fwds = forwardEnums.find( enumDecl-> get_name());744 if ( enumDecl->body ) { 745 ForwardEnumsType::iterator fwds = forwardEnums.find( enumDecl->name ); 539 746 if ( fwds != forwardEnums.end() ) { 540 747 for ( std::list< EnumInstType * >::iterator inst = fwds->second.begin(); inst != fwds->second.end(); ++inst ) { 541 (*inst )->set_baseEnum( enumDecl );748 (*inst)->baseEnum = enumDecl; 542 749 } // for 543 750 forwardEnums.erase( fwds ); 544 751 } // if 752 753 for ( Declaration * member : enumDecl->members ) { 754 ObjectDecl * field = strict_dynamic_cast<ObjectDecl *>( member ); 755 if ( field->init ) { 756 // need to resolve enumerator initializers early so that other passes that determine if an expression is constexpr have the appropriate information. 757 SingleInit * init = strict_dynamic_cast<SingleInit *>( field->init ); 758 ResolvExpr::findSingleExpression( init->value, new BasicType( Type::Qualifiers(), BasicType::SignedInt ), indexer ); 759 } 760 } 545 761 } // if 546 762 } … … 575 791 // visit struct members first so that the types of self-referencing members are updated properly 576 792 // xxx - need to ensure that type parameters match up between forward declarations and definition (most importantly, number of type parameters and their defaults) 577 if ( ! structDecl->get_members().empty()) {578 ForwardStructsType::iterator fwds = forwardStructs.find( structDecl-> get_name());793 if ( structDecl->body ) { 794 ForwardStructsType::iterator fwds = forwardStructs.find( structDecl->name ); 579 795 if ( fwds != forwardStructs.end() ) { 580 796 for ( std::list< StructInstType * >::iterator inst = fwds->second.begin(); inst != fwds->second.end(); ++inst ) { 581 (*inst )->set_baseStruct( structDecl );797 (*inst)->baseStruct = structDecl; 582 798 } // for 583 799 forwardStructs.erase( fwds ); … … 587 803 588 804 void LinkReferenceToTypes::postvisit( UnionDecl *unionDecl ) { 589 if ( ! unionDecl->get_members().empty()) {590 ForwardUnionsType::iterator fwds = forwardUnions.find( unionDecl-> get_name());805 if ( unionDecl->body ) { 806 ForwardUnionsType::iterator fwds = forwardUnions.find( unionDecl->name ); 591 807 if ( fwds != forwardUnions.end() ) { 592 808 for ( std::list< UnionInstType * >::iterator inst = fwds->second.begin(); inst != fwds->second.end(); ++inst ) { 593 (*inst )->set_baseUnion( unionDecl );809 (*inst)->baseUnion = unionDecl; 594 810 } // for 595 811 forwardUnions.erase( fwds ); … … 601 817 // ensure generic parameter instances are renamed like the base type 602 818 if ( inGeneric && typeInst->baseType ) typeInst->name = typeInst->baseType->name; 603 if ( NamedTypeDecl *namedTypeDecl = local_indexer->lookupType( typeInst-> get_name()) ) {819 if ( NamedTypeDecl *namedTypeDecl = local_indexer->lookupType( typeInst->name ) ) { 604 820 if ( TypeDecl *typeDecl = dynamic_cast< TypeDecl * >( namedTypeDecl ) ) { 605 821 typeInst->set_isFtype( typeDecl->get_kind() == TypeDecl::Ftype ); … … 626 842 // apply FixFunction to every assertion to check for invalid void type 627 843 for ( DeclarationWithType *& assertion : type->assertions ) { 628 PassVisitor<FixFunction> fixer; 629 assertion = assertion->acceptMutator( fixer ); 630 if ( fixer.pass.isVoid ) { 631 throw SemanticError( "invalid type void in assertion of function ", node ); 844 bool isVoid = fixFunction( assertion ); 845 if ( isVoid ) { 846 SemanticError( node, "invalid type void in assertion of function " ); 632 847 } // if 633 848 } // for … … 637 852 638 853 void ForallPointerDecay::previsit( ObjectDecl *object ) { 639 forallFixer( object->type->forall, object );640 if ( PointerType *pointer = dynamic_cast< PointerType * >( object->type) ) {641 forallFixer( pointer->base->forall, object);642 } // if854 // ensure that operator names only apply to functions or function pointers 855 if ( CodeGen::isOperator( object->name ) && ! dynamic_cast< FunctionType * >( object->type->stripDeclarator() ) ) { 856 SemanticError( object->location, toCString( "operator ", object->name.c_str(), " is not a function or function pointer." ) ); 857 } 643 858 object->fixUniqueId(); 644 859 } 645 860 646 861 void ForallPointerDecay::previsit( FunctionDecl *func ) { 647 forallFixer( func->type->forall, func );648 862 func->fixUniqueId(); 863 } 864 865 void ForallPointerDecay::previsit( FunctionType * ftype ) { 866 forallFixer( ftype->forall, ftype ); 649 867 } 650 868 … … 673 891 // were cast to void. 674 892 if ( ! returnStmt->get_expr() && returnVals.size() != 0 ) { 675 throw SemanticError( "Non-void function returns no values: " , returnStmt ); 676 } 677 } 678 679 680 bool isTypedef( Declaration *decl ) { 681 return dynamic_cast< TypedefDecl * >( decl ); 682 } 683 684 void EliminateTypedef::eliminateTypedef( std::list< Declaration * > &translationUnit ) { 685 PassVisitor<EliminateTypedef> eliminator; 893 SemanticError( returnStmt, "Non-void function returns no values: " ); 894 } 895 } 896 897 898 void ReplaceTypedef::replaceTypedef( std::list< Declaration * > &translationUnit ) { 899 PassVisitor<ReplaceTypedef> eliminator; 686 900 mutateAll( translationUnit, eliminator ); 687 901 if ( eliminator.pass.typedefNames.count( "size_t" ) ) { 688 902 // grab and remember declaration of size_t 689 SizeType = eliminator.pass.typedefNames["size_t"].first-> get_base()->clone();903 SizeType = eliminator.pass.typedefNames["size_t"].first->base->clone(); 690 904 } else { 691 905 // xxx - missing global typedef for size_t - default to long unsigned int, even though that may be wrong … … 693 907 SizeType = new BasicType( Type::Qualifiers(), BasicType::LongUnsignedInt ); 694 908 } 695 filter( translationUnit, isTypedef, true ); 696 } 697 698 Type * EliminateTypedef::postmutate( TypeInstType * typeInst ) { 909 } 910 911 void ReplaceTypedef::premutate( QualifiedType * ) { 912 visit_children = false; 913 } 914 915 Type * ReplaceTypedef::postmutate( QualifiedType * qualType ) { 916 // replacing typedefs only makes sense for the 'oldest ancestor' of the qualified type 917 qualType->parent = qualType->parent->acceptMutator( *visitor ); 918 return qualType; 919 } 920 921 Type * ReplaceTypedef::postmutate( TypeInstType * typeInst ) { 699 922 // instances of typedef types will come here. If it is an instance 700 923 // of a typdef type, link the instance to its actual type. 701 TypedefMap::const_iterator def = typedefNames.find( typeInst-> get_name());924 TypedefMap::const_iterator def = typedefNames.find( typeInst->name ); 702 925 if ( def != typedefNames.end() ) { 703 926 Type *ret = def->second.first->base->clone(); 927 ret->location = typeInst->location; 704 928 ret->get_qualifiers() |= typeInst->get_qualifiers(); 705 929 // attributes are not carried over from typedef to function parameters/return values … … 714 938 ReferenceToType *rtt = dynamic_cast<ReferenceToType*>(ret); 715 939 if ( ! rtt ) { 716 throw SemanticError("Cannot apply type parameters to base type of " + typeInst->name);940 SemanticError( typeInst->location, "Cannot apply type parameters to base type of " + typeInst->name ); 717 941 } 718 rtt-> get_parameters().clear();942 rtt->parameters.clear(); 719 943 cloneAll( typeInst->parameters, rtt->parameters ); 720 944 mutateAll( rtt->parameters, *visitor ); // recursively fix typedefs on parameters … … 723 947 return ret; 724 948 } else { 725 TypeDeclMap::const_iterator base = typedeclNames.find( typeInst->get_name() ); 726 assertf( base != typedeclNames.end(), "Cannot find typedecl name %s", typeInst->name.c_str() ); 949 TypeDeclMap::const_iterator base = typedeclNames.find( typeInst->name ); 950 if ( base == typedeclNames.end() ) { 951 SemanticError( typeInst->location, toString("Use of undefined type ", typeInst->name) ); 952 } 727 953 typeInst->set_baseType( base->second ); 728 } // if 729 return typeInst; 954 return typeInst; 955 } // if 956 assert( false ); 730 957 } 731 958 … … 744 971 } 745 972 746 Declaration * EliminateTypedef::postmutate( TypedefDecl * tyDecl ) {747 if ( typedefNames.count( tyDecl-> get_name() ) == 1 && typedefNames[ tyDecl->get_name()].second == scopeLevel ) {973 Declaration * ReplaceTypedef::postmutate( TypedefDecl * tyDecl ) { 974 if ( typedefNames.count( tyDecl->name ) == 1 && typedefNames[ tyDecl->name ].second == scopeLevel ) { 748 975 // typedef to the same name from the same scope 749 976 // must be from the same type 750 977 751 Type * t1 = tyDecl-> get_base();752 Type * t2 = typedefNames[ tyDecl-> get_name() ].first->get_base();978 Type * t1 = tyDecl->base; 979 Type * t2 = typedefNames[ tyDecl->name ].first->base; 753 980 if ( ! ResolvExpr::typesCompatible( t1, t2, Indexer() ) ) { 754 throw SemanticError( "Cannot redefine typedef: " + tyDecl->name ); 755 } 756 // cannot redefine VLA typedefs 981 SemanticError( tyDecl->location, "Cannot redefine typedef: " + tyDecl->name ); 982 } 983 // Cannot redefine VLA typedefs. Note: this is slightly incorrect, because our notion of VLAs 984 // at this point in the translator is imprecise. In particular, this will disallow redefining typedefs 985 // with arrays whose dimension is an enumerator or a cast of a constant/enumerator. The effort required 986 // to fix this corner case likely outweighs the utility of allowing it. 757 987 if ( isVariableLength( t1 ) || isVariableLength( t2 ) ) { 758 throw SemanticError("Cannot redefine typedef: " + tyDecl->name );988 SemanticError( tyDecl->location, "Cannot redefine typedef: " + tyDecl->name ); 759 989 } 760 990 } else { 761 typedefNames[ tyDecl-> get_name()] = std::make_pair( TypedefDeclPtr( tyDecl ), scopeLevel );991 typedefNames[ tyDecl->name ] = std::make_pair( TypedefDeclPtr( tyDecl ), scopeLevel ); 762 992 } // if 763 993 … … 771 1001 // Note, qualifiers on the typedef are superfluous for the forward declaration. 772 1002 773 Type *designatorType = tyDecl-> get_base()->stripDeclarator();1003 Type *designatorType = tyDecl->base->stripDeclarator(); 774 1004 if ( StructInstType *aggDecl = dynamic_cast< StructInstType * >( designatorType ) ) { 775 return new StructDecl( aggDecl->get_name(), DeclarationNode::Struct, noAttributes, tyDecl->get_linkage() );1005 declsToAddBefore.push_back( new StructDecl( aggDecl->name, DeclarationNode::Struct, noAttributes, tyDecl->linkage ) ); 776 1006 } else if ( UnionInstType *aggDecl = dynamic_cast< UnionInstType * >( designatorType ) ) { 777 return new UnionDecl( aggDecl->get_name(), noAttributes, tyDecl->get_linkage() );1007 declsToAddBefore.push_back( new UnionDecl( aggDecl->name, noAttributes, tyDecl->linkage ) ); 778 1008 } else if ( EnumInstType *enumDecl = dynamic_cast< EnumInstType * >( designatorType ) ) { 779 return new EnumDecl( enumDecl->get_name(), noAttributes, tyDecl->get_linkage() ); 780 } else { 781 return tyDecl->clone(); 782 } // if 783 } 784 785 void EliminateTypedef::premutate( TypeDecl * typeDecl ) { 786 TypedefMap::iterator i = typedefNames.find( typeDecl->get_name() ); 1009 declsToAddBefore.push_back( new EnumDecl( enumDecl->name, noAttributes, tyDecl->linkage ) ); 1010 } // if 1011 return tyDecl->clone(); 1012 } 1013 1014 void ReplaceTypedef::premutate( TypeDecl * typeDecl ) { 1015 TypedefMap::iterator i = typedefNames.find( typeDecl->name ); 787 1016 if ( i != typedefNames.end() ) { 788 1017 typedefNames.erase( i ) ; 789 1018 } // if 790 1019 791 typedeclNames [ typeDecl->get_name() ] = typeDecl;792 } 793 794 void EliminateTypedef::premutate( FunctionDecl * ) {1020 typedeclNames.insert( typeDecl->name, typeDecl ); 1021 } 1022 1023 void ReplaceTypedef::premutate( FunctionDecl * ) { 795 1024 GuardScope( typedefNames ); 796 } 797 798 void EliminateTypedef::premutate( ObjectDecl * ) { 1025 GuardScope( typedeclNames ); 1026 } 1027 1028 void ReplaceTypedef::premutate( ObjectDecl * ) { 799 1029 GuardScope( typedefNames ); 800 } 801 802 DeclarationWithType *EliminateTypedef::postmutate( ObjectDecl * objDecl ) { 803 if ( FunctionType *funtype = dynamic_cast<FunctionType *>( objDecl->get_type() ) ) { // function type? 1030 GuardScope( typedeclNames ); 1031 } 1032 1033 DeclarationWithType * ReplaceTypedef::postmutate( ObjectDecl * objDecl ) { 1034 if ( FunctionType *funtype = dynamic_cast<FunctionType *>( objDecl->type ) ) { // function type? 804 1035 // replace the current object declaration with a function declaration 805 FunctionDecl * newDecl = new FunctionDecl( objDecl-> get_name(), objDecl->get_storageClasses(), objDecl->get_linkage(), funtype, 0, objDecl->get_attributes(), objDecl->get_funcSpec() );806 objDecl-> get_attributes().clear();1036 FunctionDecl * newDecl = new FunctionDecl( objDecl->name, objDecl->get_storageClasses(), objDecl->linkage, funtype, 0, objDecl->attributes, objDecl->get_funcSpec() ); 1037 objDecl->attributes.clear(); 807 1038 objDecl->set_type( nullptr ); 808 1039 delete objDecl; … … 812 1043 } 813 1044 814 void EliminateTypedef::premutate( CastExpr * ) {1045 void ReplaceTypedef::premutate( CastExpr * ) { 815 1046 GuardScope( typedefNames ); 816 } 817 818 void EliminateTypedef::premutate( CompoundStmt * ) { 1047 GuardScope( typedeclNames ); 1048 } 1049 1050 void ReplaceTypedef::premutate( CompoundStmt * ) { 819 1051 GuardScope( typedefNames ); 1052 GuardScope( typedeclNames ); 820 1053 scopeLevel += 1; 821 1054 GuardAction( [this](){ scopeLevel -= 1; } ); 822 1055 } 823 1056 824 CompoundStmt *EliminateTypedef::postmutate( CompoundStmt * compoundStmt ) {825 // remove and delete decl stmts826 filter( compoundStmt->kids, [](Statement * stmt) {827 if ( DeclStmt *declStmt = dynamic_cast< DeclStmt * >( stmt ) ) {828 if ( dynamic_cast< TypedefDecl * >( declStmt->get_decl() ) ) {829 return true;830 } // if831 } // if832 return false;833 }, true);834 return compoundStmt;835 }836 837 // there may be typedefs nested within aggregates. in order for everything to work properly, these should be removed838 // as well839 1057 template<typename AggDecl> 840 AggDecl *EliminateTypedef::handleAggregate( AggDecl * aggDecl ) { 841 filter( aggDecl->members, isTypedef, true ); 842 return aggDecl; 843 } 844 845 template<typename AggDecl> 846 void EliminateTypedef::addImplicitTypedef( AggDecl * aggDecl ) { 1058 void ReplaceTypedef::addImplicitTypedef( AggDecl * aggDecl ) { 847 1059 if ( typedefNames.count( aggDecl->get_name() ) == 0 ) { 848 1060 Type *type = nullptr; … … 854 1066 type = new EnumInstType( Type::Qualifiers(), newDeclEnumDecl->get_name() ); 855 1067 } // if 856 TypedefDeclPtr tyDecl( new TypedefDecl( aggDecl->get_name(), Type::StorageClasses(), type, aggDecl->get_linkage() ) );1068 TypedefDeclPtr tyDecl( new TypedefDecl( aggDecl->get_name(), aggDecl->location, Type::StorageClasses(), type, aggDecl->get_linkage() ) ); 857 1069 typedefNames[ aggDecl->get_name() ] = std::make_pair( std::move( tyDecl ), scopeLevel ); 858 } // if 859 } 860 861 void EliminateTypedef::premutate( StructDecl * structDecl ) { 1070 // add the implicit typedef to the AST 1071 declsToAddBefore.push_back( new TypedefDecl( aggDecl->get_name(), aggDecl->location, Type::StorageClasses(), type->clone(), aggDecl->get_linkage() ) ); 1072 } // if 1073 } 1074 1075 template< typename AggDecl > 1076 void ReplaceTypedef::handleAggregate( AggDecl * aggr ) { 1077 SemanticErrorException errors; 1078 1079 ValueGuard< std::list<Declaration * > > oldBeforeDecls( declsToAddBefore ); 1080 ValueGuard< std::list<Declaration * > > oldAfterDecls ( declsToAddAfter ); 1081 declsToAddBefore.clear(); 1082 declsToAddAfter.clear(); 1083 1084 GuardScope( typedefNames ); 1085 GuardScope( typedeclNames ); 1086 mutateAll( aggr->parameters, *visitor ); 1087 1088 // unroll mutateAll for aggr->members so that implicit typedefs for nested types are added to the aggregate body. 1089 for ( std::list< Declaration * >::iterator i = aggr->members.begin(); i != aggr->members.end(); ++i ) { 1090 if ( !declsToAddAfter.empty() ) { aggr->members.splice( i, declsToAddAfter ); } 1091 1092 try { 1093 *i = maybeMutate( *i, *visitor ); 1094 } catch ( SemanticErrorException &e ) { 1095 errors.append( e ); 1096 } 1097 1098 if ( !declsToAddBefore.empty() ) { aggr->members.splice( i, declsToAddBefore ); } 1099 } 1100 1101 if ( !declsToAddAfter.empty() ) { aggr->members.splice( aggr->members.end(), declsToAddAfter ); } 1102 if ( !errors.isEmpty() ) { throw errors; } 1103 } 1104 1105 void ReplaceTypedef::premutate( StructDecl * structDecl ) { 1106 visit_children = false; 862 1107 addImplicitTypedef( structDecl ); 863 } 864 865 866 Declaration *EliminateTypedef::postmutate( StructDecl * structDecl ) { 867 return handleAggregate( structDecl ); 868 } 869 870 void EliminateTypedef::premutate( UnionDecl * unionDecl ) { 1108 handleAggregate( structDecl ); 1109 } 1110 1111 void ReplaceTypedef::premutate( UnionDecl * unionDecl ) { 1112 visit_children = false; 871 1113 addImplicitTypedef( unionDecl ); 872 } 873 874 Declaration *EliminateTypedef::postmutate( UnionDecl * unionDecl ) { 875 return handleAggregate( unionDecl ); 876 } 877 878 void EliminateTypedef::premutate( EnumDecl * enumDecl ) { 1114 handleAggregate( unionDecl ); 1115 } 1116 1117 void ReplaceTypedef::premutate( EnumDecl * enumDecl ) { 879 1118 addImplicitTypedef( enumDecl ); 880 1119 } 881 1120 882 Declaration *EliminateTypedef::postmutate( EnumDecl * enumDecl ) { 883 return handleAggregate( enumDecl ); 884 } 885 886 Declaration *EliminateTypedef::postmutate( TraitDecl * traitDecl ) { 887 return handleAggregate( traitDecl ); 888 } 889 890 void EliminateTypedef::premutate( FunctionType * ) { 1121 void ReplaceTypedef::premutate( FunctionType * ) { 891 1122 GuardValue( inFunctionType ); 892 1123 inFunctionType = true; 1124 } 1125 1126 void ReplaceTypedef::premutate( TraitDecl * ) { 1127 GuardScope( typedefNames ); 1128 GuardScope( typedeclNames); 893 1129 } 894 1130 … … 905 1141 if ( CodeGen::isCtorDtorAssign( funcDecl->get_name() ) ) { // TODO: also check /=, etc. 906 1142 if ( params.size() == 0 ) { 907 throw SemanticError( "Constructors, destructors, and assignment functions require at least one parameter ", funcDecl);1143 SemanticError( funcDecl, "Constructors, destructors, and assignment functions require at least one parameter " ); 908 1144 } 909 1145 ReferenceType * refType = dynamic_cast< ReferenceType * >( params.front()->get_type() ); 910 1146 if ( ! refType ) { 911 throw SemanticError( "First parameter of a constructor, destructor, or assignment function must be a reference ", funcDecl);1147 SemanticError( funcDecl, "First parameter of a constructor, destructor, or assignment function must be a reference " ); 912 1148 } 913 1149 if ( CodeGen::isCtorDtor( funcDecl->get_name() ) && returnVals.size() != 0 ) { 914 throw SemanticError( "Constructors and destructors cannot have explicit return values ", funcDecl);1150 SemanticError( funcDecl, "Constructors and destructors cannot have explicit return values " ); 915 1151 } 916 1152 } … … 947 1183 948 1184 sub.apply( inst ); 949 if ( args.size() < params->size() ) throw SemanticError( "Too few type arguments in generic type ", inst);950 if ( args.size() > params->size() ) throw SemanticError( "Too many type arguments in generic type ", inst);1185 if ( args.size() < params->size() ) SemanticError( inst, "Too few type arguments in generic type " ); 1186 if ( args.size() > params->size() ) SemanticError( inst, "Too many type arguments in generic type " ); 951 1187 } 952 1188 } … … 1014 1250 } 1015 1251 1252 void FixObjectType::fix( std::list< Declaration * > & translationUnit ) { 1253 PassVisitor<FixObjectType> fixer; 1254 acceptAll( translationUnit, fixer ); 1255 } 1256 1257 void FixObjectType::previsit( ObjectDecl * objDecl ) { 1258 Type *new_type = ResolvExpr::resolveTypeof( objDecl->get_type(), indexer ); 1259 new_type->get_qualifiers() -= Type::Lvalue; // even if typeof is lvalue, variable can never have lvalue-qualified type 1260 objDecl->set_type( new_type ); 1261 } 1262 1263 void FixObjectType::previsit( FunctionDecl * funcDecl ) { 1264 Type *new_type = ResolvExpr::resolveTypeof( funcDecl->type, indexer ); 1265 new_type->get_qualifiers() -= Type::Lvalue; // even if typeof is lvalue, variable can never have lvalue-qualified type 1266 funcDecl->set_type( new_type ); 1267 } 1268 1269 void FixObjectType::previsit( TypeDecl *typeDecl ) { 1270 if ( typeDecl->get_base() ) { 1271 Type *new_type = ResolvExpr::resolveTypeof( typeDecl->get_base(), indexer ); 1272 new_type->get_qualifiers() -= Type::Lvalue; // even if typeof is lvalue, variable can never have lvalue-qualified type 1273 typeDecl->set_base( new_type ); 1274 } // if 1275 } 1276 1016 1277 void ArrayLength::computeLength( std::list< Declaration * > & translationUnit ) { 1017 1278 PassVisitor<ArrayLength> len; … … 1020 1281 1021 1282 void ArrayLength::previsit( ObjectDecl * objDecl ) { 1022 if ( ArrayType * at = dynamic_cast< ArrayType * >( objDecl->get_type() ) ) { 1023 if ( at->get_dimension() ) return; 1024 if ( ListInit * init = dynamic_cast< ListInit * >( objDecl->get_init() ) ) { 1025 at->set_dimension( new ConstantExpr( Constant::from_ulong( init->get_initializers().size() ) ) ); 1026 } 1283 if ( ArrayType * at = dynamic_cast< ArrayType * >( objDecl->type ) ) { 1284 if ( at->dimension ) return; 1285 if ( ListInit * init = dynamic_cast< ListInit * >( objDecl->init ) ) { 1286 at->dimension = new ConstantExpr( Constant::from_ulong( init->initializers.size() ) ); 1287 } 1288 } 1289 } 1290 1291 void ArrayLength::previsit( ArrayType * type ) { 1292 if ( type->dimension ) { 1293 // need to resolve array dimensions early so that constructor code can correctly determine 1294 // if a type is a VLA (and hence whether its elements need to be constructed) 1295 ResolvExpr::findSingleExpression( type->dimension, SymTab::SizeType->clone(), indexer ); 1296 1297 // must re-evaluate whether a type is a VLA, now that more information is available 1298 // (e.g. the dimension may have been an enumerator, which was unknown prior to this step) 1299 type->isVarLen = ! InitTweak::isConstExpr( type->dimension ); 1027 1300 } 1028 1301 } -
src/SymTab/module.mk
rf9feab8 r90152a4 17 17 SRC += SymTab/Indexer.cc \ 18 18 SymTab/Mangler.cc \ 19 SymTab/ManglerCommon.cc \ 19 20 SymTab/Validate.cc \ 20 21 SymTab/FixFunction.cc \ -
src/SynTree/AggregateDecl.cc
rf9feab8 r90152a4 86 86 std::string TraitDecl::typeString() const { return "trait"; } 87 87 88 bool EnumDecl::valueOf( Declaration * enumerator, long long int & value ) { 89 if ( enumValues.empty() ) { 90 long long int currentValue = 0; 91 for ( Declaration * member : members ) { 92 ObjectDecl * field = strict_dynamic_cast< ObjectDecl * >( member ); 93 if ( field->init ) { 94 SingleInit * init = strict_dynamic_cast< SingleInit * >( field->init ); 95 auto result = eval( init->value ); 96 if ( ! result.second ) SemanticError( init->location, toString( "Non-constexpr in initialization of enumerator: ", field ) ); 97 currentValue = result.first; 98 } 99 assertf( enumValues.count( field->name ) == 0, "Enum %s has multiple members with the name %s", name.c_str(), field->name.c_str() ); 100 enumValues[ field->name ] = currentValue; 101 ++currentValue; 102 } 103 } 104 if ( enumValues.count( enumerator->name ) ) { 105 value = enumValues[ enumerator->name ]; 106 return true; 107 } 108 return false; 109 } 110 88 111 // Local Variables: // 89 112 // tab-width: 4 // -
src/SynTree/ApplicationExpr.cc
rf9feab8 r90152a4 49 49 } 50 50 51 ParamEntry::ParamEntry( ParamEntry && other ) : 52 decl( other.decl ), actualType( other.actualType ), formalType( other.formalType ), expr( other.expr ), inferParams( std::move( other.inferParams ) ) { 53 other.actualType = nullptr; 54 other.formalType = nullptr; 55 other.expr = nullptr; 56 } 57 58 ParamEntry & ParamEntry::operator=( ParamEntry && other ) { 59 if ( &other == this ) return *this; 60 delete actualType; 61 delete formalType; 62 delete expr; 63 decl = other.decl; 64 actualType = other.actualType; 65 formalType = other.formalType; 66 expr = other.expr; 67 other.actualType = nullptr; 68 other.formalType = nullptr; 69 other.expr = nullptr; 70 inferParams = std::move( other.inferParams ); 71 return *this; 72 } 73 51 74 ApplicationExpr::ApplicationExpr( Expression *funcExpr, const std::list<Expression *> & args ) : function( funcExpr ), args( args ) { 52 75 PointerType *pointer = strict_dynamic_cast< PointerType* >( funcExpr->get_result() ); -
src/SynTree/Attribute.cc
rf9feab8 r90152a4 15 15 16 16 #include <ostream> // for operator<<, ostream, basic_ostream, endl 17 #include <set> 17 18 18 19 #include "Attribute.h" … … 21 22 22 23 Attribute::Attribute( const Attribute &other ) : name( other.name ) { 23 cloneAll( other.parameters, parameters );24 cloneAll( other.parameters, parameters ); 24 25 } 25 26 26 27 Attribute::~Attribute() { 27 deleteAll( parameters ); 28 deleteAll( parameters ); 29 } 30 31 bool Attribute::isValidOnFuncParam() const { 32 // attributes such as aligned, cleanup, etc. produce GCC errors when they appear 33 // on function parameters. Maintain here a whitelist of attribute names that are 34 // allowed to appear on parameters. 35 static std::set< std::string > valid = { 36 "noreturn", "unused" 37 }; 38 return valid.count( normalizedName() ); 39 } 40 41 std::string Attribute::normalizedName() const { 42 // trim beginning/ending _, convert to lowercase 43 auto begin = name.find_first_not_of('_'); 44 auto end = name.find_last_not_of('_'); 45 if (begin == std::string::npos || end == std::string::npos) return ""; 46 std::string ret; 47 ret.reserve( end-begin+1 ); 48 std::transform( &name[begin], &name[end+1], back_inserter( ret ), tolower ); 49 return ret; 28 50 } 29 51 30 52 void Attribute::print( std::ostream &os, Indenter indent ) const { 31 using std::endl;32 using std::string;53 using std::endl; 54 using std::string; 33 55 34 if ( ! empty() ) {35 os << "Attribute with name: " << name;36 if ( ! parameters.empty() ) {37 os << " with parameters: " << endl;38 printAll( parameters, os, indent+1 );39 }40 }56 if ( ! empty() ) { 57 os << "Attribute with name: " << name; 58 if ( ! parameters.empty() ) { 59 os << " with parameters: " << endl; 60 printAll( parameters, os, indent+1 ); 61 } 62 } 41 63 } 42 64 -
src/SynTree/Attribute.h
rf9feab8 r90152a4 43 43 bool empty() const { return name == ""; } 44 44 45 std::string normalizedName() const; 46 47 /// true if this attribute is allowed to appear attached to a function parameter 48 bool isValidOnFuncParam() const; 49 45 50 Attribute * clone() const override { return new Attribute( *this ); } 46 51 virtual void accept( Visitor & v ) override { v.visit( this ); } -
src/SynTree/BasicType.cc
rf9feab8 r90152a4 55 55 case DoubleImaginary: 56 56 case LongDoubleImaginary: 57 case Float80: 58 case Float128: 57 59 return false; 58 60 case NUMBER_OF_BASIC_TYPES: -
src/SynTree/CompoundStmt.cc
rf9feab8 r90152a4 23 23 #include "Statement.h" // for CompoundStmt, Statement, DeclStmt 24 24 #include "SynTree/Label.h" // for Label 25 #include "SynTree/ VarExprReplacer.h" // for VarExprReplacer, VarExprReplace...25 #include "SynTree/DeclReplacer.h" // for DeclReplacer 26 26 27 27 using std::string; … … 49 49 // recursively execute this routine. There may be more efficient ways of doing 50 50 // this. 51 VarExprReplacer::DeclMap declMap;51 DeclReplacer::DeclMap declMap; 52 52 std::list< Statement * >::const_iterator origit = other.kids.begin(); 53 53 for ( Statement * s : kids ) { … … 59 59 DeclarationWithType * origdwt = strict_dynamic_cast< DeclarationWithType * > ( origDeclStmt->get_decl() ); 60 60 assert( dwt->get_name() == origdwt->get_name() ); 61 declMap[ origdwt ] = new VariableExpr( dwt );61 declMap[ origdwt ] = dwt; 62 62 } else assert( ! dynamic_cast< DeclarationWithType * > ( origDeclStmt->get_decl() ) ); 63 63 } else assert( ! dynamic_cast< DeclStmt * > ( s ) ); 64 64 } 65 65 if ( ! declMap.empty() ) { 66 VarExprReplacer replacer( declMap ); 67 acceptMutator( replacer ); 66 DeclReplacer::replace( this, declMap ); 68 67 } 69 68 } -
src/SynTree/Declaration.cc
rf9feab8 r90152a4 81 81 82 82 83 StaticAssertDecl::StaticAssertDecl( Expression * condition, ConstantExpr * message ) : Declaration( "", Type::StorageClasses(), LinkageSpec::C ), condition( condition ), message( message ) { 84 } 85 86 StaticAssertDecl::StaticAssertDecl( const StaticAssertDecl & other ) : Declaration( other ), condition( maybeClone( other.condition ) ), message( maybeClone( other.message ) ) { 87 } 88 89 StaticAssertDecl::~StaticAssertDecl() { 90 delete condition; 91 delete message; 92 } 93 94 void StaticAssertDecl::print( std::ostream &os, Indenter indent ) const { 95 os << "Static Assert with condition: "; 96 condition->print( os, indent+1 ); 97 os << std::endl << indent << "and message: "; 98 message->print( os, indent+1 ); 99 os << std::endl; 100 } 101 102 void StaticAssertDecl::printShort( std::ostream &os, Indenter indent ) const { 103 print( os, indent ); 104 } 105 106 83 107 // Local Variables: // 84 108 // tab-width: 4 // -
src/SynTree/Declaration.h
rf9feab8 r90152a4 84 84 Expression *asmName; 85 85 std::list< Attribute * > attributes; 86 bool isDeleted = false; 86 87 87 88 DeclarationWithType( const std::string &name, Type::StorageClasses scs, LinkageSpec::Spec linkage, const std::list< Attribute * > & attributes, Type::FuncSpecifiers fs ); … … 151 152 FunctionType *type; 152 153 CompoundStmt *statements; 154 std::list< Expression * > withExprs; 153 155 154 156 FunctionDecl( const std::string &name, Type::StorageClasses scs, LinkageSpec::Spec linkage, FunctionType *type, CompoundStmt *statements, … … 200 202 typedef NamedTypeDecl Parent; 201 203 public: 202 enum Kind { Dtype, Ftype, Ttype };204 enum Kind { Dtype, Ftype, Ttype, NUMBER_OF_KINDS }; 203 205 204 206 Type * init; … … 244 246 typedef NamedTypeDecl Parent; 245 247 public: 246 TypedefDecl( const std::string &name, Type::StorageClasses scs, Type *type, LinkageSpec::Spec spec = LinkageSpec::Cforall ) : Parent( name, scs, type ) { set_linkage( spec ); } 248 TypedefDecl( const std::string &name, CodeLocation location, Type::StorageClasses scs, Type *type, LinkageSpec::Spec spec = LinkageSpec::Cforall ) 249 : Parent( name, scs, type ) { set_linkage( spec ); this->location = location; } 250 247 251 TypedefDecl( const TypedefDecl &other ) : Parent( other ) {} 248 252 … … 262 266 bool body; 263 267 std::list< Attribute * > attributes; 268 AggregateDecl * parent = nullptr; 264 269 265 270 AggregateDecl( const std::string &name, const std::list< Attribute * > & attributes = std::list< class Attribute * >(), LinkageSpec::Spec linkage = LinkageSpec::Cforall ); … … 319 324 EnumDecl( const EnumDecl &other ) : Parent( other ) {} 320 325 326 bool valueOf( Declaration * enumerator, long long int & value ); 327 321 328 virtual EnumDecl *clone() const override { return new EnumDecl( *this ); } 322 329 virtual void accept( Visitor &v ) override { v.visit( this ); } 323 330 virtual Declaration *acceptMutator( Mutator &m ) override { return m.mutate( this ); } 324 331 private: 332 std::map< std::string, long long int > enumValues; 325 333 virtual std::string typeString() const override; 326 334 }; … … 355 363 virtual void accept( Visitor &v ) override { v.visit( this ); } 356 364 virtual AsmDecl *acceptMutator( Mutator &m ) override { return m.mutate( this ); } 365 virtual void print( std::ostream &os, Indenter indent = {} ) const override; 366 virtual void printShort( std::ostream &os, Indenter indent = {} ) const override; 367 }; 368 369 class StaticAssertDecl : public Declaration { 370 public: 371 Expression * condition; 372 ConstantExpr * message; // string literal 373 374 StaticAssertDecl( Expression * condition, ConstantExpr * message ); 375 StaticAssertDecl( const StaticAssertDecl & other ); 376 virtual ~StaticAssertDecl(); 377 378 virtual StaticAssertDecl * clone() const override { return new StaticAssertDecl( *this ); } 379 virtual void accept( Visitor &v ) override { v.visit( this ); } 380 virtual StaticAssertDecl * acceptMutator( Mutator &m ) override { return m.mutate( this ); } 357 381 virtual void print( std::ostream &os, Indenter indent = {} ) const override; 358 382 virtual void printShort( std::ostream &os, Indenter indent = {} ) const override; -
src/SynTree/Expression.cc
rf9feab8 r90152a4 50 50 } 51 51 52 void Expression::spliceInferParams( Expression * other ) { 53 if ( ! other ) return; 54 for ( auto p : other->inferParams ) { 55 inferParams[p.first] = std::move( p.second ); 56 } 57 } 58 52 59 Expression::~Expression() { 53 60 delete env; … … 81 88 constant.print( os ); 82 89 Expression::print( os, indent ); 90 } 91 92 long long int ConstantExpr::intValue() const { 93 if ( BasicType * basicType = dynamic_cast< BasicType * >( result ) ) { 94 if ( basicType->isInteger() ) { 95 return get_constant()->get_ival(); 96 } 97 } else if ( dynamic_cast< OneType * >( result ) ) { 98 return 1; 99 } else if ( dynamic_cast< ZeroType * >( result ) ) { 100 return 0; 101 } 102 SemanticError( this, "Constant expression of non-integral type " ); 83 103 } 84 104 … … 95 115 // assert( inst->baseEnum ); 96 116 // EnumDecl * decl = inst->baseEnum; 97 // for ( Declaration * member : decl->members ) { 98 // if ( member == _var ) { 99 // type->set_lvalue( false ); 100 // } 117 // long long int value; 118 // if ( decl->valueOf( var, value ) ) { 119 // type->set_lvalue( false ); 101 120 // } 102 121 // } … … 259 278 } 260 279 261 CastExpr::CastExpr( Expression *arg _, Type *toType ) : Expression(), arg(arg_) {280 CastExpr::CastExpr( Expression *arg, Type *toType, bool isGenerated ) : Expression(), arg(arg), isGenerated( isGenerated ) { 262 281 set_result(toType); 263 282 } 264 283 265 CastExpr::CastExpr( Expression *arg _ ) : Expression(), arg(arg_) {284 CastExpr::CastExpr( Expression *arg, bool isGenerated ) : Expression(), arg(arg), isGenerated( isGenerated ) { 266 285 set_result( new VoidType( Type::Qualifiers() ) ); 267 286 } 268 287 269 CastExpr::CastExpr( const CastExpr &other ) : Expression( other ), arg( maybeClone( other.arg ) ) {288 CastExpr::CastExpr( const CastExpr &other ) : Expression( other ), arg( maybeClone( other.arg ) ), isGenerated( other.isGenerated ) { 270 289 } 271 290 … … 287 306 } 288 307 308 KeywordCastExpr::KeywordCastExpr( Expression *arg, Target target ) : Expression(), arg(arg), target( target ) { 309 } 310 311 KeywordCastExpr::KeywordCastExpr( const KeywordCastExpr &other ) : Expression( other ), arg( maybeClone( other.arg ) ), target( other.target ) { 312 } 313 314 KeywordCastExpr::~KeywordCastExpr() { 315 delete arg; 316 } 317 318 const std::string & KeywordCastExpr::targetString() const { 319 static const std::string targetStrs[] = { 320 "coroutine", "thread", "monitor" 321 }; 322 static_assert( 323 (sizeof(targetStrs) / sizeof(targetStrs[0])) == ((unsigned long)NUMBER_OF_TARGETS), 324 "Each KeywordCastExpr::Target should have a corresponding string representation" 325 ); 326 return targetStrs[(unsigned long)target]; 327 } 328 329 void KeywordCastExpr::print( std::ostream &os, Indenter indent ) const { 330 os << "Keyword Cast of:" << std::endl << indent+1; 331 arg->print(os, indent+1); 332 os << std::endl << indent << "... to: "; 333 os << targetString(); 334 Expression::print( os, indent ); 335 } 336 289 337 VirtualCastExpr::VirtualCastExpr( Expression *arg_, Type *toType ) : Expression(), arg(arg_) { 290 338 set_result(toType); … … 333 381 } 334 382 335 namespace {336 TypeSubstitution makeSub( Type * t ) {337 if ( ReferenceType * refType = dynamic_cast< ReferenceType * >( t ) ) {338 return makeSub( refType->get_base() );339 } else if ( StructInstType * aggInst = dynamic_cast< StructInstType * >( t ) ) {340 return TypeSubstitution( aggInst->get_baseParameters()->begin(), aggInst->get_baseParameters()->end(), aggInst->parameters.begin() );341 } else if ( UnionInstType * aggInst = dynamic_cast< UnionInstType * >( t ) ) {342 return TypeSubstitution( aggInst->get_baseParameters()->begin(), aggInst->get_baseParameters()->end(), aggInst->parameters.begin() );343 } else {344 assertf( false, "makeSub expects struct or union type for aggregate, but got: %s", toString( t ).c_str() );345 }346 }347 }348 349 350 383 MemberExpr::MemberExpr( DeclarationWithType *member, Expression *aggregate ) : 351 384 Expression(), member(member), aggregate(aggregate) { 352 385 assert( member ); 353 386 assert( aggregate ); 354 355 TypeSubstitution sub( makeSub( aggregate->get_result() ) ); 387 assert( aggregate->result ); 388 389 TypeSubstitution sub = aggregate->result->genericSubstitution(); 356 390 Type * res = member->get_type()->clone(); 357 391 sub.apply( res ); … … 403 437 } else { 404 438 // references have been removed, in which case dereference returns an lvalue of the base type. 405 ret-> get_result()->set_lvalue( true );439 ret->result->set_lvalue( true ); 406 440 } 407 441 } … … 585 619 586 620 StmtExpr::StmtExpr( CompoundStmt *statements ) : statements( statements ) { 587 assert( statements ); 588 std::list< Statement * > & body = statements->get_kids(); 589 if ( ! body.empty() ) { 590 if ( ExprStmt * exprStmt = dynamic_cast< ExprStmt * >( body.back() ) ) { 591 set_result( maybeClone( exprStmt->get_expr()->get_result() ) ); 592 } 593 } 594 // ensure that StmtExpr has a result type 595 if ( ! result ) { 596 set_result( new VoidType( Type::Qualifiers() ) ); 597 } 621 computeResult(); 598 622 } 599 623 StmtExpr::StmtExpr( const StmtExpr &other ) : Expression( other ), statements( other.statements->clone() ) { … … 605 629 deleteAll( dtors ); 606 630 deleteAll( returnDecls ); 631 } 632 void StmtExpr::computeResult() { 633 assert( statements ); 634 std::list< Statement * > & body = statements->kids; 635 delete result; 636 result = nullptr; 637 if ( ! returnDecls.empty() ) { 638 // prioritize return decl for result type, since if a return decl exists, then 639 // the StmtExpr is currently in an intermediate state where the body will always 640 // give a void result type. 641 result = returnDecls.front()->get_type()->clone(); 642 } else if ( ! body.empty() ) { 643 if ( ExprStmt * exprStmt = dynamic_cast< ExprStmt * >( body.back() ) ) { 644 result = maybeClone( exprStmt->expr->result ); 645 } 646 } 647 // ensure that StmtExpr has a result type 648 if ( ! result ) { 649 result = new VoidType( Type::Qualifiers() ); 650 } 607 651 } 608 652 void StmtExpr::print( std::ostream &os, Indenter indent ) const { … … 688 732 } 689 733 734 DeletedExpr::DeletedExpr( Expression * expr, BaseSyntaxNode * deleteStmt ) : expr( expr ), deleteStmt( deleteStmt ) { 735 assert( expr->result ); 736 result = expr->result->clone(); 737 } 738 DeletedExpr::DeletedExpr( const DeletedExpr & other ) : Expression( other ), expr( maybeClone( other.expr ) ), deleteStmt( other.deleteStmt ) {} 739 DeletedExpr::~DeletedExpr() { 740 delete expr; 741 } 742 743 void DeletedExpr::print( std::ostream & os, Indenter indent ) const { 744 os << "Deleted Expression" << std::endl << indent+1; 745 expr->print( os, indent+1 ); 746 os << std::endl << indent+1 << "... deleted by: "; 747 deleteStmt->print( os, indent+1 ); 748 } 749 750 751 DefaultArgExpr::DefaultArgExpr( Expression * expr ) : expr( expr ) { 752 assert( expr->result ); 753 result = expr->result->clone(); 754 } 755 DefaultArgExpr::DefaultArgExpr( const DefaultArgExpr & other ) : Expression( other ), expr( maybeClone( other.expr ) ) {} 756 DefaultArgExpr::~DefaultArgExpr() { 757 delete expr; 758 } 759 760 void DefaultArgExpr::print( std::ostream & os, Indenter indent ) const { 761 os << "Default Argument Expression" << std::endl << indent+1; 762 expr->print( os, indent+1 ); 763 } 764 765 GenericExpr::Association::Association( Type * type, Expression * expr ) : type( type ), expr( expr ), isDefault( false ) {} 766 GenericExpr::Association::Association( Expression * expr ) : type( nullptr ), expr( expr ), isDefault( true ) {} 767 GenericExpr::Association::Association( const Association & other ) : type( maybeClone( other.type ) ), expr( maybeClone( other.expr ) ), isDefault( other.isDefault ) {} 768 GenericExpr::Association::~Association() { 769 delete type; 770 delete expr; 771 } 772 773 GenericExpr::GenericExpr( Expression * control, const std::list<Association> & assoc ) : Expression(), control( control ), associations( assoc ) {} 774 GenericExpr::GenericExpr( const GenericExpr & other ) : Expression(other), control( maybeClone( other.control ) ), associations( other.associations ) { 775 } 776 GenericExpr::~GenericExpr() { 777 delete control; 778 } 779 780 void GenericExpr::print( std::ostream & os, Indenter indent ) const { 781 os << "C11 _Generic Expression" << std::endl << indent+1; 782 control->print( os, indent+1 ); 783 os << std::endl << indent+1 << "... with associations: " << std::endl; 784 for ( const Association & assoc : associations ) { 785 os << indent+1; 786 if (assoc.isDefault) { 787 os << "... default: "; 788 assoc.expr->print( os, indent+1 ); 789 } else { 790 os << "... type: "; 791 assoc.type->print( os, indent+1 ); 792 os << std::endl << indent+1 << "... expression: "; 793 assoc.expr->print( os, indent+1 ); 794 os << std::endl; 795 } 796 os << std::endl; 797 } 798 } 799 690 800 // Local Variables: // 691 801 // tab-width: 4 // -
src/SynTree/Expression.h
rf9feab8 r90152a4 41 41 ParamEntry( UniqueId decl, Type * actualType, Type * formalType, Expression* expr ): decl( decl ), actualType( actualType ), formalType( formalType ), expr( expr ), inferParams( new InferredParams ) {} 42 42 ParamEntry( const ParamEntry & other ); 43 ParamEntry( ParamEntry && other ); 43 44 ~ParamEntry(); 44 45 ParamEntry & operator=( const ParamEntry & other ); 46 ParamEntry & operator=( ParamEntry && other ); 45 47 46 48 UniqueId decl; … … 74 76 InferredParams & get_inferParams() { return inferParams; } 75 77 78 // move other's inferParams to this 79 void spliceInferParams( Expression * other ); 80 76 81 virtual Expression * clone() const override = 0; 77 82 virtual void accept( Visitor & v ) override = 0; … … 188 193 public: 189 194 Expression * arg; 190 191 CastExpr( Expression * arg ); 192 CastExpr( Expression * arg, Type * toType ); 195 bool isGenerated = true; // whether this cast appeared in the source program 196 197 CastExpr( Expression * arg, bool isGenerated = true ); 198 CastExpr( Expression * arg, Type * toType, bool isGenerated = true ); 199 CastExpr( Expression * arg, void * ) = delete; // prevent accidentally passing pointers for isGenerated in the first constructor 193 200 CastExpr( const CastExpr & other ); 194 201 virtual ~CastExpr(); … … 198 205 199 206 virtual CastExpr * clone() const { return new CastExpr( * this ); } 207 virtual void accept( Visitor & v ) { v.visit( this ); } 208 virtual Expression * acceptMutator( Mutator & m ) { return m.mutate( this ); } 209 virtual void print( std::ostream & os, Indenter indent = {} ) const; 210 }; 211 212 /// KeywordCastExpr represents a cast to 'keyword types', e.g. (thread &)t 213 class KeywordCastExpr : public Expression { 214 public: 215 Expression * arg; 216 enum Target { 217 Coroutine, Thread, Monitor, NUMBER_OF_TARGETS 218 } target; 219 220 KeywordCastExpr( Expression * arg, Target target ); 221 KeywordCastExpr( const KeywordCastExpr & other ); 222 virtual ~KeywordCastExpr(); 223 224 const std::string & targetString() const; 225 226 virtual KeywordCastExpr * clone() const { return new KeywordCastExpr( * this ); } 200 227 virtual void accept( Visitor & v ) { v.visit( this ); } 201 228 virtual Expression * acceptMutator( Mutator & m ) { return m.mutate( this ); } … … 295 322 296 323 Constant * get_constant() { return & constant; } 324 const Constant * get_constant() const { return & constant; } 297 325 void set_constant( const Constant & newValue ) { constant = newValue; } 326 327 long long int intValue() const; 298 328 299 329 virtual ConstantExpr * clone() const { return new ConstantExpr( * this ); } … … 725 755 StmtExpr * set_statements( CompoundStmt * newValue ) { statements = newValue; return this; } 726 756 757 // call to set the result type of this StmtExpr based on its body 758 void computeResult(); 759 727 760 std::list< ObjectDecl * > & get_returnDecls() { return returnDecls; } 728 761 std::list< Expression * > & get_dtors() { return dtors; } … … 816 849 }; 817 850 851 /// expression that contains a deleted identifier - should never make it past the resolver. 852 class DeletedExpr : public Expression { 853 public: 854 Expression * expr; 855 BaseSyntaxNode * deleteStmt; 856 857 DeletedExpr( Expression * expr, BaseSyntaxNode * deleteStmt ); 858 DeletedExpr( const DeletedExpr & other ); 859 ~DeletedExpr(); 860 861 virtual DeletedExpr * clone() const { return new DeletedExpr( * this ); } 862 virtual void accept( Visitor & v ) { v.visit( this ); } 863 virtual Expression * acceptMutator( Mutator & m ) { return m.mutate( this ); } 864 virtual void print( std::ostream & os, Indenter indent = {} ) const; 865 }; 866 867 /// expression wrapping the use of a default argument - should never make it past the resolver. 868 class DefaultArgExpr : public Expression { 869 public: 870 Expression * expr; 871 872 DefaultArgExpr( Expression * expr ); 873 DefaultArgExpr( const DefaultArgExpr & other ); 874 ~DefaultArgExpr(); 875 876 virtual DefaultArgExpr * clone() const { return new DefaultArgExpr( * this ); } 877 virtual void accept( Visitor & v ) { v.visit( this ); } 878 virtual Expression * acceptMutator( Mutator & m ) { return m.mutate( this ); } 879 virtual void print( std::ostream & os, Indenter indent = {} ) const; 880 }; 881 882 /// C11 _Generic expression 883 class GenericExpr : public Expression { 884 public: 885 struct Association { 886 Type * type = nullptr; 887 Expression * expr = nullptr; 888 bool isDefault = false; 889 890 Association( Type * type, Expression * expr ); 891 Association( Expression * expr ); 892 Association( const Association & other ); 893 Association & operator=( const Association & other ) = delete; // at the moment this isn't used, and I don't want to implement it 894 ~Association(); 895 }; 896 897 Expression * control; 898 std::list<Association> associations; 899 900 GenericExpr( Expression * control, const std::list<Association> & assoc ); 901 GenericExpr( const GenericExpr & other ); 902 virtual ~GenericExpr(); 903 904 virtual GenericExpr * clone() const { return new GenericExpr( * this ); } 905 virtual void accept( Visitor & v ) { v.visit( this ); } 906 virtual Expression * acceptMutator( Mutator & m ) { return m.mutate( this ); } 907 virtual void print( std::ostream & os, Indenter indent = {} ) const; 908 }; 909 818 910 // Local Variables: // 819 911 // tab-width: 4 // -
src/SynTree/FunctionDecl.cc
rf9feab8 r90152a4 26 26 #include "Statement.h" // for CompoundStmt 27 27 #include "Type.h" // for Type, FunctionType, Type::FuncSpecif... 28 #include " VarExprReplacer.h"28 #include "DeclReplacer.h" 29 29 30 30 extern bool translation_unit_nomain; … … 41 41 : Parent( other ), type( maybeClone( other.type ) ), statements( maybeClone( other.statements ) ) { 42 42 43 VarExprReplacer::DeclMap declMap;43 DeclReplacer::DeclMap declMap; 44 44 for ( auto p : group_iterate( other.type->parameters, type->parameters ) ) { 45 declMap[ std::get<0>(p) ] = new VariableExpr( std::get<1>(p));45 declMap[ std::get<0>(p) ] = std::get<1>(p); 46 46 } 47 47 for ( auto p : group_iterate( other.type->returnVals, type->returnVals ) ) { 48 declMap[ std::get<0>(p) ] = new VariableExpr( std::get<1>(p));48 declMap[ std::get<0>(p) ] = std::get<1>(p); 49 49 } 50 50 if ( ! declMap.empty() ) { 51 VarExprReplacer replacer( declMap ); 52 acceptMutator( replacer ); 51 DeclReplacer::replace( this, declMap ); 53 52 } 53 cloneAll( other.withExprs, withExprs ); 54 54 } 55 55 … … 57 57 delete type; 58 58 delete statements; 59 deleteAll( withExprs ); 59 60 } 60 61 -
src/SynTree/Label.h
rf9feab8 r90152a4 33 33 std::list< Attribute * >& get_attributes() { return attributes; } 34 34 35 operator std::string() { return name; }35 operator std::string() const { return name; } 36 36 bool empty() { return name.empty(); } 37 37 private: -
src/SynTree/Mutator.h
rf9feab8 r90152a4 22 22 class Mutator { 23 23 protected: 24 Mutator() ;25 virtual ~Mutator() ;24 Mutator() = default; 25 virtual ~Mutator() = default; 26 26 public: 27 virtual DeclarationWithType * mutate( ObjectDecl * objectDecl ); 28 virtual DeclarationWithType * mutate( FunctionDecl * functionDecl ); 29 virtual Declaration * mutate( StructDecl * aggregateDecl ); 30 virtual Declaration * mutate( UnionDecl * aggregateDecl ); 31 virtual Declaration * mutate( EnumDecl * aggregateDecl ); 32 virtual Declaration * mutate( TraitDecl * aggregateDecl ); 33 virtual Declaration * mutate( TypeDecl * typeDecl ); 34 virtual Declaration * mutate( TypedefDecl * typeDecl ); 35 virtual AsmDecl * mutate( AsmDecl * asmDecl ); 27 virtual DeclarationWithType * mutate( ObjectDecl * objectDecl ) = 0; 28 virtual DeclarationWithType * mutate( FunctionDecl * functionDecl ) = 0; 29 virtual Declaration * mutate( StructDecl * aggregateDecl ) = 0; 30 virtual Declaration * mutate( UnionDecl * aggregateDecl ) = 0; 31 virtual Declaration * mutate( EnumDecl * aggregateDecl ) = 0; 32 virtual Declaration * mutate( TraitDecl * aggregateDecl ) = 0; 33 virtual Declaration * mutate( TypeDecl * typeDecl ) = 0; 34 virtual Declaration * mutate( TypedefDecl * typeDecl ) = 0; 35 virtual AsmDecl * mutate( AsmDecl * asmDecl ) = 0; 36 virtual StaticAssertDecl * mutate( StaticAssertDecl * assertDecl ) = 0; 36 37 37 virtual CompoundStmt * mutate( CompoundStmt * compoundStmt ); 38 virtual Statement * mutate( ExprStmt * exprStmt ); 39 virtual Statement * mutate( AsmStmt * asmStmt ); 40 virtual Statement * mutate( IfStmt * ifStmt ); 41 virtual Statement * mutate( WhileStmt * whileStmt ); 42 virtual Statement * mutate( ForStmt * forStmt ); 43 virtual Statement * mutate( SwitchStmt * switchStmt ); 44 virtual Statement * mutate( CaseStmt * caseStmt ); 45 virtual Statement * mutate( BranchStmt * branchStmt ); 46 virtual Statement * mutate( ReturnStmt * returnStmt ); 47 virtual Statement * mutate( ThrowStmt * throwStmt ); 48 virtual Statement * mutate( TryStmt * tryStmt ); 49 virtual Statement * mutate( CatchStmt * catchStmt ); 50 virtual Statement * mutate( FinallyStmt * catchStmt ); 51 virtual Statement * mutate( WaitForStmt * waitforStmt ); 52 virtual Statement * mutate( WithStmt * withStmt ); 53 virtual NullStmt * mutate( NullStmt * nullStmt ); 54 virtual Statement * mutate( DeclStmt * declStmt ); 55 virtual Statement * mutate( ImplicitCtorDtorStmt * impCtorDtorStmt ); 38 virtual CompoundStmt * mutate( CompoundStmt * compoundStmt ) = 0; 39 virtual Statement * mutate( ExprStmt * exprStmt ) = 0; 40 virtual Statement * mutate( AsmStmt * asmStmt ) = 0; 41 virtual Statement * mutate( DirectiveStmt * dirStmt ) = 0; 42 virtual Statement * mutate( IfStmt * ifStmt ) = 0; 43 virtual Statement * mutate( WhileStmt * whileStmt ) = 0; 44 virtual Statement * mutate( ForStmt * forStmt ) = 0; 45 virtual Statement * mutate( SwitchStmt * switchStmt ) = 0; 46 virtual Statement * mutate( CaseStmt * caseStmt ) = 0; 47 virtual Statement * mutate( BranchStmt * branchStmt ) = 0; 48 virtual Statement * mutate( ReturnStmt * returnStmt ) = 0; 49 virtual Statement * mutate( ThrowStmt * throwStmt ) = 0; 50 virtual Statement * mutate( TryStmt * tryStmt ) = 0; 51 virtual Statement * mutate( CatchStmt * catchStmt ) = 0; 52 virtual Statement * mutate( FinallyStmt * catchStmt ) = 0; 53 virtual Statement * mutate( WaitForStmt * waitforStmt ) = 0; 54 virtual Statement * mutate( WithStmt * withStmt ) = 0; 55 virtual NullStmt * mutate( NullStmt * nullStmt ) = 0; 56 virtual Statement * mutate( DeclStmt * declStmt ) = 0; 57 virtual Statement * mutate( ImplicitCtorDtorStmt * impCtorDtorStmt ) = 0; 56 58 57 virtual Expression* mutate( ApplicationExpr * applicationExpr ); 58 virtual Expression* mutate( UntypedExpr * untypedExpr ); 59 virtual Expression* mutate( NameExpr * nameExpr ); 60 virtual Expression* mutate( AddressExpr * castExpr ); 61 virtual Expression* mutate( LabelAddressExpr * labAddressExpr ); 62 virtual Expression* mutate( CastExpr * castExpr ); 63 virtual Expression* mutate( VirtualCastExpr * castExpr ); 64 virtual Expression* mutate( UntypedMemberExpr * memberExpr ); 65 virtual Expression* mutate( MemberExpr * memberExpr ); 66 virtual Expression* mutate( VariableExpr * variableExpr ); 67 virtual Expression* mutate( ConstantExpr * constantExpr ); 68 virtual Expression* mutate( SizeofExpr * sizeofExpr ); 69 virtual Expression* mutate( AlignofExpr * alignofExpr ); 70 virtual Expression* mutate( UntypedOffsetofExpr * offsetofExpr ); 71 virtual Expression* mutate( OffsetofExpr * offsetofExpr ); 72 virtual Expression* mutate( OffsetPackExpr * offsetPackExpr ); 73 virtual Expression* mutate( AttrExpr * attrExpr ); 74 virtual Expression* mutate( LogicalExpr * logicalExpr ); 75 virtual Expression* mutate( ConditionalExpr * conditionalExpr ); 76 virtual Expression* mutate( CommaExpr * commaExpr ); 77 virtual Expression* mutate( TypeExpr * typeExpr ); 78 virtual Expression* mutate( AsmExpr * asmExpr ); 79 virtual Expression* mutate( ImplicitCopyCtorExpr * impCpCtorExpr ); 80 virtual Expression* mutate( ConstructorExpr * ctorExpr ); 81 virtual Expression* mutate( CompoundLiteralExpr * compLitExpr ); 82 virtual Expression* mutate( RangeExpr * rangeExpr ); 83 virtual Expression* mutate( UntypedTupleExpr * tupleExpr ); 84 virtual Expression* mutate( TupleExpr * tupleExpr ); 85 virtual Expression* mutate( TupleIndexExpr * tupleExpr ); 86 virtual Expression* mutate( TupleAssignExpr * assignExpr ); 87 virtual Expression* mutate( StmtExpr * stmtExpr ); 88 virtual Expression* mutate( UniqueExpr * uniqueExpr ); 89 virtual Expression* mutate( UntypedInitExpr * initExpr ); 90 virtual Expression* mutate( InitExpr * initExpr ); 59 virtual Expression * mutate( ApplicationExpr * applicationExpr ) = 0; 60 virtual Expression * mutate( UntypedExpr * untypedExpr ) = 0; 61 virtual Expression * mutate( NameExpr * nameExpr ) = 0; 62 virtual Expression * mutate( AddressExpr * addrExpr ) = 0; 63 virtual Expression * mutate( LabelAddressExpr * labAddressExpr ) = 0; 64 virtual Expression * mutate( CastExpr * castExpr ) = 0; 65 virtual Expression * mutate( KeywordCastExpr * castExpr ) = 0; 66 virtual Expression * mutate( VirtualCastExpr * castExpr ) = 0; 67 virtual Expression * mutate( UntypedMemberExpr * memberExpr ) = 0; 68 virtual Expression * mutate( MemberExpr * memberExpr ) = 0; 69 virtual Expression * mutate( VariableExpr * variableExpr ) = 0; 70 virtual Expression * mutate( ConstantExpr * constantExpr ) = 0; 71 virtual Expression * mutate( SizeofExpr * sizeofExpr ) = 0; 72 virtual Expression * mutate( AlignofExpr * alignofExpr ) = 0; 73 virtual Expression * mutate( UntypedOffsetofExpr * offsetofExpr ) = 0; 74 virtual Expression * mutate( OffsetofExpr * offsetofExpr ) = 0; 75 virtual Expression * mutate( OffsetPackExpr * offsetPackExpr ) = 0; 76 virtual Expression * mutate( AttrExpr * attrExpr ) = 0; 77 virtual Expression * mutate( LogicalExpr * logicalExpr ) = 0; 78 virtual Expression * mutate( ConditionalExpr * conditionalExpr ) = 0; 79 virtual Expression * mutate( CommaExpr * commaExpr ) = 0; 80 virtual Expression * mutate( TypeExpr * typeExpr ) = 0; 81 virtual Expression * mutate( AsmExpr * asmExpr ) = 0; 82 virtual Expression * mutate( ImplicitCopyCtorExpr * impCpCtorExpr ) = 0; 83 virtual Expression * mutate( ConstructorExpr * ctorExpr ) = 0; 84 virtual Expression * mutate( CompoundLiteralExpr * compLitExpr ) = 0; 85 virtual Expression * mutate( RangeExpr * rangeExpr ) = 0; 86 virtual Expression * mutate( UntypedTupleExpr * tupleExpr ) = 0; 87 virtual Expression * mutate( TupleExpr * tupleExpr ) = 0; 88 virtual Expression * mutate( TupleIndexExpr * tupleExpr ) = 0; 89 virtual Expression * mutate( TupleAssignExpr * assignExpr ) = 0; 90 virtual Expression * mutate( StmtExpr * stmtExpr ) = 0; 91 virtual Expression * mutate( UniqueExpr * uniqueExpr ) = 0; 92 virtual Expression * mutate( UntypedInitExpr * initExpr ) = 0; 93 virtual Expression * mutate( InitExpr * initExpr ) = 0; 94 virtual Expression * mutate( DeletedExpr * delExpr ) = 0; 95 virtual Expression * mutate( DefaultArgExpr * argExpr ) = 0; 96 virtual Expression * mutate( GenericExpr * genExpr ) = 0; 91 97 92 virtual Type * mutate( VoidType * basicType ); 93 virtual Type * mutate( BasicType * basicType ); 94 virtual Type * mutate( PointerType * pointerType ); 95 virtual Type * mutate( ArrayType * arrayType ); 96 virtual Type * mutate( ReferenceType * refType ); 97 virtual Type * mutate( FunctionType * functionType ); 98 virtual Type * mutate( StructInstType * aggregateUseType ); 99 virtual Type * mutate( UnionInstType * aggregateUseType ); 100 virtual Type * mutate( EnumInstType * aggregateUseType ); 101 virtual Type * mutate( TraitInstType * aggregateUseType ); 102 virtual Type * mutate( TypeInstType * aggregateUseType ); 103 virtual Type * mutate( TupleType * tupleType ); 104 virtual Type * mutate( TypeofType * typeofType ); 105 virtual Type * mutate( AttrType * attrType ); 106 virtual Type * mutate( VarArgsType * varArgsType ); 107 virtual Type * mutate( ZeroType * zeroType ); 108 virtual Type * mutate( OneType * oneType ); 98 virtual Type * mutate( VoidType * basicType ) = 0; 99 virtual Type * mutate( BasicType * basicType ) = 0; 100 virtual Type * mutate( PointerType * pointerType ) = 0; 101 virtual Type * mutate( ArrayType * arrayType ) = 0; 102 virtual Type * mutate( ReferenceType * refType ) = 0; 103 virtual Type * mutate( QualifiedType * qualType ) = 0; 104 virtual Type * mutate( FunctionType * functionType ) = 0; 105 virtual Type * mutate( StructInstType * aggregateUseType ) = 0; 106 virtual Type * mutate( UnionInstType * aggregateUseType ) = 0; 107 virtual Type * mutate( EnumInstType * aggregateUseType ) = 0; 108 virtual Type * mutate( TraitInstType * aggregateUseType ) = 0; 109 virtual Type * mutate( TypeInstType * aggregateUseType ) = 0; 110 virtual Type * mutate( TupleType * tupleType ) = 0; 111 virtual Type * mutate( TypeofType * typeofType ) = 0; 112 virtual Type * mutate( AttrType * attrType ) = 0; 113 virtual Type * mutate( VarArgsType * varArgsType ) = 0; 114 virtual Type * mutate( ZeroType * zeroType ) = 0; 115 virtual Type * mutate( OneType * oneType ) = 0; 116 virtual Type * mutate( GlobalScopeType * globalType ) = 0; 109 117 110 virtual Designation * mutate( Designation * designation ) ;111 virtual Initializer * mutate( SingleInit * singleInit ) ;112 virtual Initializer * mutate( ListInit * listInit ) ;113 virtual Initializer * mutate( ConstructorInit * ctorInit ) ;118 virtual Designation * mutate( Designation * designation ) = 0 ; 119 virtual Initializer * mutate( SingleInit * singleInit ) = 0 ; 120 virtual Initializer * mutate( ListInit * listInit ) = 0 ; 121 virtual Initializer * mutate( ConstructorInit * ctorInit ) = 0 ; 114 122 115 virtual Subrange * mutate( Subrange * subrange ) ;123 virtual Subrange * mutate( Subrange * subrange ) = 0; 116 124 117 virtual Constant * mutate( Constant * constant ) ;125 virtual Constant * mutate( Constant * constant ) = 0; 118 126 119 virtual Attribute * mutate( Attribute * attribute ) ;127 virtual Attribute * mutate( Attribute * attribute ) = 0; 120 128 121 virtual TypeSubstitution * mutate( TypeSubstitution * sub ); 122 123 private: 124 virtual Declaration * handleAggregateDecl(AggregateDecl * aggregateDecl ); 125 virtual Declaration * handleNamedTypeDecl(NamedTypeDecl * typeDecl ); 126 virtual Type * handleReferenceToType(ReferenceToType * aggregateUseType ); 129 virtual TypeSubstitution * mutate( TypeSubstitution * sub ) = 0; 127 130 }; 128 131 … … 140 143 template< typename Container, typename MutatorType > 141 144 inline void mutateAll( Container &container, MutatorType &mutator ) { 142 SemanticError errors;145 SemanticErrorException errors; 143 146 for ( typename Container::iterator i = container.begin(); i != container.end(); ++i ) { 144 147 try { … … 148 151 assert( *i ); 149 152 } // if 150 } catch( SemanticError &e ) { 151 e.set_location( (*i)->location ); 153 } catch( SemanticErrorException &e ) { 152 154 errors.append( e ); 153 155 } // try -
src/SynTree/ReferenceToType.cc
rf9feab8 r90152a4 14 14 // 15 15 16 #include <cassert> // for assert 17 #include <list> // for list, _List_const_iterator, list<>::cons... 18 #include <ostream> // for operator<<, basic_ostream, ostream, endl 19 #include <string> // for string, operator<<, char_traits, operator== 20 21 #include "Common/utility.h" // for printAll, cloneAll, deleteAll 22 #include "Declaration.h" // for StructDecl, UnionDecl, EnumDecl, Declara... 23 #include "Expression.h" // for Expression 24 #include "Type.h" // for TypeInstType, StructInstType, UnionInstType 16 #include <cassert> // for assert 17 #include <list> // for list, _List_const_iterator, list<>::cons... 18 #include <ostream> // for operator<<, basic_ostream, ostream, endl 19 #include <string> // for string, operator<<, char_traits, operator== 20 21 #include "Common/utility.h" // for printAll, cloneAll, deleteAll 22 #include "Declaration.h" // for StructDecl, UnionDecl, EnumDecl, Declara... 23 #include "Expression.h" // for Expression 24 #include "Type.h" // for TypeInstType, StructInstType, UnionInstType 25 #include "TypeSubstitution.h" // for TypeSubstitution 25 26 26 27 class Attribute; … … 49 50 50 51 namespace { 51 void doLookup( const std::list< Declaration * > &members, const std::string &name, std::list< Declaration* > &foundDecls ) {52 for ( std::list< Declaration* >::const_iterator i = members.begin(); i != members.end(); ++i) {53 if ( (*i)->get_name()== name ) {54 foundDecls.push_back( *i);52 void doLookup( const std::list< Declaration * > & members, const std::string & name, std::list< Declaration* > & foundDecls ) { 53 for ( Declaration * decl : members ) { 54 if ( decl->name == name ) { 55 foundDecls.push_back( decl ); 55 56 } // if 56 57 } // for … … 59 60 60 61 StructInstType::StructInstType( const Type::Qualifiers & tq, StructDecl * baseStruct, const std::list< Attribute * > & attributes ) : 61 Parent( tq, baseStruct-> get_name(), attributes ), baseStruct( baseStruct ) {}62 Parent( tq, baseStruct->name, attributes ), baseStruct( baseStruct ) {} 62 63 63 64 std::string StructInstType::typeString() const { return "struct"; } 65 66 const std::list<TypeDecl*>* StructInstType::get_baseParameters() const { 67 if ( ! baseStruct ) return nullptr; 68 return &baseStruct->get_parameters(); 69 } 64 70 65 71 std::list<TypeDecl*>* StructInstType::get_baseParameters() { … … 70 76 bool StructInstType::isComplete() const { return baseStruct ? baseStruct->has_body() : false; } 71 77 72 AggregateDecl * StructInstType::getAggr() { return baseStruct; } 78 AggregateDecl * StructInstType::getAggr() const { return baseStruct; } 79 80 TypeSubstitution StructInstType::genericSubstitution() const { 81 return TypeSubstitution( get_baseParameters()->begin(), get_baseParameters()->end(), parameters.begin() ); 82 } 73 83 74 84 void StructInstType::lookup( const std::string &name, std::list< Declaration* > &foundDecls ) const { 75 85 assert( baseStruct ); 76 doLookup( baseStruct-> get_members(), name, foundDecls );86 doLookup( baseStruct->members, name, foundDecls ); 77 87 } 78 88 … … 93 103 94 104 UnionInstType::UnionInstType( const Type::Qualifiers & tq, UnionDecl * baseUnion, const std::list< Attribute * > & attributes ) : 95 Parent( tq, baseUnion-> get_name(), attributes ), baseUnion( baseUnion ) {}105 Parent( tq, baseUnion->name, attributes ), baseUnion( baseUnion ) {} 96 106 97 107 std::string UnionInstType::typeString() const { return "union"; } … … 102 112 } 103 113 114 const std::list< TypeDecl * > * UnionInstType::get_baseParameters() const { 115 if ( ! baseUnion ) return nullptr; 116 return &baseUnion->get_parameters(); 117 } 118 104 119 bool UnionInstType::isComplete() const { return baseUnion ? baseUnion->has_body() : false; } 105 120 106 AggregateDecl * UnionInstType::getAggr() { return baseUnion; } 121 AggregateDecl * UnionInstType::getAggr() const { return baseUnion; } 122 123 TypeSubstitution UnionInstType::genericSubstitution() const { 124 return TypeSubstitution( get_baseParameters()->begin(), get_baseParameters()->end(), parameters.begin() ); 125 } 107 126 108 127 void UnionInstType::lookup( const std::string &name, std::list< Declaration* > &foundDecls ) const { 109 128 assert( baseUnion ); 110 doLookup( baseUnion-> get_members(), name, foundDecls );129 doLookup( baseUnion->members, name, foundDecls ); 111 130 } 112 131 … … 133 152 bool EnumInstType::isComplete() const { return baseEnum ? baseEnum->has_body() : false; } 134 153 154 AggregateDecl * EnumInstType::getAggr() const { return baseEnum; } 155 135 156 void EnumInstType::print( std::ostream &os, Indenter indent ) const { 136 157 using std::endl; -
src/SynTree/ReferenceType.cc
rf9feab8 r90152a4 16 16 #include "Type.h" 17 17 #include "Expression.h" 18 #include "TypeSubstitution.h" 18 19 #include "Common/utility.h" 19 20 … … 35 36 } 36 37 38 TypeSubstitution ReferenceType::genericSubstitution() const { return base->genericSubstitution(); } 39 37 40 void ReferenceType::print( std::ostream &os, Indenter indent ) const { 38 41 Type::print( os, indent ); -
src/SynTree/Statement.cc
rf9feab8 r90152a4 34 34 Statement::Statement( const std::list<Label> & labels ) : labels( labels ) {} 35 35 36 void Statement::print( std::ostream & os, Indenter ) const {36 void Statement::print( std::ostream & os, Indenter indent ) const { 37 37 if ( ! labels.empty() ) { 38 os << "Labels: {";38 os << indent << "... Labels: {"; 39 39 for ( const Label & l : labels ) { 40 40 os << l << ","; … … 94 94 95 95 96 DirectiveStmt::DirectiveStmt( const std::string & directive ) : Statement(), directive( directive ) {} 97 98 void DirectiveStmt::print( std::ostream &os, Indenter ) const { 99 os << "GCC Directive:" << directive << endl; 100 } 101 102 96 103 const char *BranchStmt::brType[] = { "Goto", "Break", "Continue" }; 97 104 98 BranchStmt::BranchStmt( Label target, Type type ) throw ( SemanticError ) :105 BranchStmt::BranchStmt( Label target, Type type ) throw ( SemanticErrorException ) : 99 106 Statement(), originalTarget( target ), target( target ), computedTarget( nullptr ), type( type ) { 100 107 //actually this is a syntactic error signaled by the parser 101 108 if ( type == BranchStmt::Goto && target.empty() ) { 102 throw SemanticError("goto without target");103 } 104 } 105 106 BranchStmt::BranchStmt( Expression *computedTarget, Type type ) throw ( SemanticError ) :109 SemanticError( target.get_statement()->location, "goto without target"); 110 } 111 } 112 113 BranchStmt::BranchStmt( Expression *computedTarget, Type type ) throw ( SemanticErrorException ) : 107 114 Statement(), computedTarget( computedTarget ), type( type ) { 108 115 if ( type != BranchStmt::Goto || computedTarget == nullptr ) { 109 throw SemanticError("Computed target not valid in branch statement");116 SemanticError( computedTarget->location, "Computed target not valid in branch statement"); 110 117 } 111 118 } … … 201 208 } 202 209 203 CaseStmt::CaseStmt( Expression *condition, const std::list<Statement *> &statements, bool deflt ) throw ( SemanticError ) :210 CaseStmt::CaseStmt( Expression *condition, const std::list<Statement *> &statements, bool deflt ) throw ( SemanticErrorException ) : 204 211 Statement(), condition( condition ), stmts( statements ), _isDefault( deflt ) { 205 if ( isDefault() && condition != 0 ) throw SemanticError("default case with condition: ", condition);212 if ( isDefault() && condition != 0 ) SemanticError( condition, "default case with condition: " ); 206 213 } 207 214 … … 223 230 224 231 void CaseStmt::print( std::ostream &os, Indenter indent ) const { 225 if ( isDefault() ) os << "Default ";232 if ( isDefault() ) os << indent << "Default "; 226 233 else { 227 os << "Case ";234 os << indent << "Case "; 228 235 condition->print( os, indent ); 229 236 } // if … … 231 238 232 239 for ( Statement * stmt : stmts ) { 240 os << indent+1; 233 241 stmt->print( os, indent+1 ); 234 242 } 235 243 } 236 244 237 WhileStmt::WhileStmt( Expression *condition, Statement *body, bool isDoWhile ):238 Statement(), condition( condition), body( body), i sDoWhile( isDoWhile) {245 WhileStmt::WhileStmt( Expression *condition, Statement *body, std::list< Statement * > & initialization, bool isDoWhile ): 246 Statement(), condition( condition), body( body), initialization( initialization ), isDoWhile( isDoWhile) { 239 247 } 240 248 … … 452 460 void WaitForStmt::print( std::ostream &os, Indenter indent ) const { 453 461 os << "Waitfor Statement" << endl; 454 os << indent << "... with block:" << endl << indent+1; 455 // block->print( os, indent + 4 ); 462 indent += 1; 463 for( auto & clause : clauses ) { 464 os << indent << "target function :"; 465 if(clause.target.function) { clause.target.function->print(os, indent + 1); } 466 os << endl << indent << "with arguments :" << endl; 467 for( auto & thing : clause.target.arguments) { 468 if(thing) { thing->print(os, indent + 1); } 469 } 470 os << indent << " with statment :" << endl; 471 if(clause.statement) { clause.statement->print(os, indent + 1); } 472 473 os << indent << " with condition :" << endl; 474 if(clause.condition) { clause.condition->print(os, indent + 1); } 475 } 476 477 os << indent << " timeout of :" << endl; 478 if(timeout.time) { timeout.time->print(os, indent + 1); } 479 480 os << indent << " with statment :" << endl; 481 if(timeout.statement) { timeout.statement->print(os, indent + 1); } 482 483 os << indent << " with condition :" << endl; 484 if(timeout.condition) { timeout.condition->print(os, indent + 1); } 485 486 487 os << indent << " else :" << endl; 488 if(orelse.statement) { orelse.statement->print(os, indent + 1); } 489 490 os << indent << " with condition :" << endl; 491 if(orelse.condition) { orelse.condition->print(os, indent + 1); } 456 492 } 457 493 … … 468 504 void WithStmt::print( std::ostream & os, Indenter indent ) const { 469 505 os << "With statement" << endl; 506 os << indent << "... with expressions: " << endl; 507 printAll( exprs, os, indent+1 ); 470 508 os << indent << "... with statement:" << endl << indent+1; 471 509 stmt->print( os, indent+1 ); … … 476 514 } 477 515 478 void NullStmt::print( std::ostream &os, Indenter ) const {516 void NullStmt::print( std::ostream &os, Indenter indent ) const { 479 517 os << "Null Statement" << endl; 518 Statement::print( os, indent ); 480 519 } 481 520 -
src/SynTree/Statement.h
rf9feab8 r90152a4 10 10 // Created On : Mon May 18 07:44:20 2015 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Sun Sep 3 20:46:46 201713 // Update Count : 7 712 // Last Modified On : Thu Mar 8 14:53:02 2018 13 // Update Count : 78 14 14 // 15 15 … … 126 126 }; 127 127 128 class DirectiveStmt : public Statement { 129 public: 130 std::string directive; 131 132 DirectiveStmt( const std::string & ); 133 virtual ~DirectiveStmt(){} 134 135 virtual DirectiveStmt * clone() const { return new DirectiveStmt( *this ); } 136 virtual void accept( Visitor & v ) { v.visit( this ); } 137 virtual Statement * acceptMutator( Mutator & m ) { return m.mutate( this ); } 138 virtual void print( std::ostream & os, Indenter indent = {} ) const; 139 }; 140 128 141 class IfStmt : public Statement { 129 142 public: … … 179 192 std::list<Statement *> stmts; 180 193 181 CaseStmt( Expression *conditions, const std::list<Statement *> &stmts, bool isdef = false ) throw (SemanticError);194 CaseStmt( Expression *conditions, const std::list<Statement *> &stmts, bool isdef = false ) throw (SemanticErrorException); 182 195 CaseStmt( const CaseStmt &other ); 183 196 virtual ~CaseStmt(); … … 207 220 Expression *condition; 208 221 Statement *body; 222 std::list<Statement *> initialization; 209 223 bool isDoWhile; 210 224 211 225 WhileStmt( Expression *condition, 212 Statement *body, bool isDoWhile = false );226 Statement *body, std::list<Statement *> & initialization, bool isDoWhile = false ); 213 227 WhileStmt( const WhileStmt &other ); 214 228 virtual ~WhileStmt(); … … 255 269 class BranchStmt : public Statement { 256 270 public: 257 enum Type { Goto = 0, Break, Continue };271 enum Type { Goto = 0, Break, Continue, FallThrough, FallThroughDefault }; 258 272 259 273 // originalTarget kept for error messages. … … 263 277 Type type; 264 278 265 BranchStmt( Label target, Type ) throw (SemanticError );266 BranchStmt( Expression *computedTarget, Type ) throw (SemanticError );279 BranchStmt( Label target, Type ) throw (SemanticErrorException); 280 BranchStmt( Expression *computedTarget, Type ) throw (SemanticErrorException); 267 281 268 282 Label get_originalTarget() { return originalTarget; } -
src/SynTree/SynTree.h
rf9feab8 r90152a4 38 38 class TypedefDecl; 39 39 class AsmDecl; 40 class StaticAssertDecl; 40 41 41 42 class Statement; … … 43 44 class ExprStmt; 44 45 class AsmStmt; 46 class DirectiveStmt; 45 47 class IfStmt; 46 48 class WhileStmt; … … 68 70 class LabelAddressExpr; 69 71 class CastExpr; 72 class KeywordCastExpr; 70 73 class VirtualCastExpr; 71 74 class MemberExpr; … … 97 100 class UntypedInitExpr; 98 101 class InitExpr; 102 class DeletedExpr; 103 class DefaultArgExpr; 104 class GenericExpr; 99 105 100 106 class Type; … … 104 110 class ArrayType; 105 111 class ReferenceType; 112 class QualifiedType; 106 113 class FunctionType; 107 114 class ReferenceToType; … … 117 124 class ZeroType; 118 125 class OneType; 126 class GlobalScopeType; 119 127 120 128 class Designation; -
src/SynTree/Type.cc
rf9feab8 r90152a4 10 10 // Created On : Mon May 18 07:44:20 2015 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Mon Sep 25 15:16:32 201713 // Update Count : 3 812 // Last Modified On : Fri Jun 22 10:17:19 2018 13 // Update Count : 39 14 14 // 15 15 #include "Type.h" 16 16 17 #include "Attribute.h" // for Attribute 18 #include "Common/utility.h" // for cloneAll, deleteAll, printAll 19 #include "InitTweak/InitTweak.h" // for getPointerBase 20 #include "SynTree/BaseSyntaxNode.h" // for BaseSyntaxNode 21 #include "SynTree/Declaration.h" // for TypeDecl 17 #include "Attribute.h" // for Attribute 18 #include "Common/utility.h" // for cloneAll, deleteAll, printAll 19 #include "InitTweak/InitTweak.h" // for getPointerBase 20 #include "SynTree/BaseSyntaxNode.h" // for BaseSyntaxNode 21 #include "SynTree/Declaration.h" // for TypeDecl 22 #include "SynTree/TypeSubstitution.h" // for TypeSubstitution 22 23 23 24 using namespace std; 24 25 25 const char *BasicType::typeNames[ BasicType::NUMBER_OF_BASIC_TYPES] = {26 const char *BasicType::typeNames[] = { 26 27 "_Bool", 27 28 "char", … … 47 48 "__int128", 48 49 "unsigned __int128", 50 "__float80", 51 "__float128" 49 52 }; 53 static_assert( 54 sizeof(BasicType::typeNames)/sizeof(BasicType::typeNames[0]) == BasicType::NUMBER_OF_BASIC_TYPES, 55 "Each basic type name should have a corresponding kind enum value" 56 ); 50 57 51 58 Type::Type( const Qualifiers &tq, const std::list< Attribute * > & attributes ) : tq( tq ), attributes( attributes ) {} … … 62 69 63 70 // These must remain in the same order as the corresponding bit fields. 64 const char * Type::FuncSpecifiersNames[] = { "inline", " fortran", "_Noreturn" };71 const char * Type::FuncSpecifiersNames[] = { "inline", "_Noreturn", "fortran" }; 65 72 const char * Type::StorageClassesNames[] = { "extern", "static", "auto", "register", "_Thread_local" }; 66 73 const char * Type::QualifiersNames[] = { "const", "restrict", "volatile", "lvalue", "mutex", "_Atomic" }; … … 81 88 int Type::referenceDepth() const { return 0; } 82 89 90 TypeSubstitution Type::genericSubstitution() const { assertf( false, "Non-aggregate type: %s", toCString( this ) ); } 91 83 92 void Type::print( std::ostream &os, Indenter indent ) const { 84 93 if ( ! forall.empty() ) { … … 96 105 } 97 106 107 108 QualifiedType::QualifiedType( const Type::Qualifiers & tq, Type * parent, Type * child ) : Type( tq, {} ), parent( parent ), child( child ) { 109 } 110 111 QualifiedType::QualifiedType( const QualifiedType & other ) : Type( other ), parent( maybeClone( other.parent ) ), child( maybeClone( other.child ) ) { 112 } 113 114 QualifiedType::~QualifiedType() { 115 delete parent; 116 delete child; 117 } 118 119 void QualifiedType::print( std::ostream & os, Indenter indent ) const { 120 os << "Qualified Type: " << endl; 121 os << indent+1; 122 parent->print( os, indent+1 ); 123 os << endl << indent+1; 124 child->print( os, indent+1 ); 125 os << endl; 126 Type::print( os, indent+1 ); 127 } 128 129 GlobalScopeType::GlobalScopeType() : Type( Type::Qualifiers(), {} ) {} 130 131 void GlobalScopeType::print( std::ostream & os, Indenter ) const { 132 os << "Global Scope Type" << endl; 133 } 134 135 98 136 // Empty Variable declarations: 99 137 const Type::FuncSpecifiers noFuncSpecifiers; -
src/SynTree/Type.h
rf9feab8 r90152a4 178 178 virtual bool isComplete() const { return true; } 179 179 180 virtual AggregateDecl * getAggr() { assertf( false, "Non-aggregate type: %s", toString( this ).c_str() ); } 180 virtual AggregateDecl * getAggr() const { assertf( false, "Non-aggregate type: %s", toCString( this ) ); } 181 182 virtual TypeSubstitution genericSubstitution() const; 181 183 182 184 virtual Type *clone() const = 0; … … 229 231 SignedInt128, 230 232 UnsignedInt128, 233 Float80, 234 Float128, 231 235 NUMBER_OF_BASIC_TYPES 232 236 } kind; … … 311 315 }; 312 316 317 class QualifiedType : public Type { 318 public: 319 Type * parent; 320 Type * child; 321 322 QualifiedType( const Type::Qualifiers & tq, Type * parent, Type * child ); 323 QualifiedType( const QualifiedType & tq ); 324 virtual ~QualifiedType(); 325 326 virtual QualifiedType *clone() const override { return new QualifiedType( *this ); } 327 virtual void accept( Visitor & v ) override { v.visit( this ); } 328 virtual Type *acceptMutator( Mutator & m ) override { return m.mutate( this ); } 329 virtual void print( std::ostream & os, Indenter indent = {} ) const override; 330 }; 331 313 332 class ReferenceType : public Type { 314 333 public: … … 328 347 // the number of values are disallowed. 329 348 virtual unsigned size() const override { return base->size(); } 349 350 virtual TypeSubstitution genericSubstitution() const override; 330 351 331 352 virtual ReferenceType *clone() const override { return new ReferenceType( *this ); } … … 356 377 bool isTtype() const; 357 378 379 bool isUnprototyped() const { return isVarArgs && parameters.size() == 0; } 380 358 381 virtual FunctionType *clone() const override { return new FunctionType( *this ); } 359 382 virtual void accept( Visitor & v ) override { v.visit( this ); } … … 404 427 /// Accesses generic parameters of base struct (NULL if none such) 405 428 std::list<TypeDecl*> * get_baseParameters(); 429 const std::list<TypeDecl*> * get_baseParameters() const; 406 430 407 431 virtual bool isComplete() const override; 408 432 409 virtual AggregateDecl * getAggr() override; 433 virtual AggregateDecl * getAggr() const override; 434 435 virtual TypeSubstitution genericSubstitution() const override; 410 436 411 437 /// Looks up the members of this struct named "name" and places them into "foundDecls". … … 437 463 438 464 /// Accesses generic parameters of base union (NULL if none such) 439 std::list< TypeDecl * > * get_baseParameters(); 465 std::list<TypeDecl*> * get_baseParameters(); 466 const std::list<TypeDecl*> * get_baseParameters() const; 440 467 441 468 virtual bool isComplete() const override; 442 469 443 virtual AggregateDecl * getAggr() override; 470 virtual AggregateDecl * getAggr() const override; 471 472 virtual TypeSubstitution genericSubstitution() const override; 444 473 445 474 /// looks up the members of this union named "name" and places them into "foundDecls" … … 471 500 472 501 virtual bool isComplete() const override; 502 503 virtual AggregateDecl * getAggr() const override; 473 504 474 505 virtual EnumInstType *clone() const override { return new EnumInstType( *this ); } … … 651 682 }; 652 683 684 class GlobalScopeType : public Type { 685 public: 686 GlobalScopeType(); 687 688 virtual GlobalScopeType *clone() const override { return new GlobalScopeType( *this ); } 689 virtual void accept( Visitor & v ) override { v.visit( this ); } 690 virtual Type *acceptMutator( Mutator & m ) override { return m.mutate( this ); } 691 virtual void print( std::ostream & os, Indenter indent = {} ) const override; 692 }; 693 653 694 // Local Variables: // 654 695 // tab-width: 4 // -
src/SynTree/TypeSubstitution.cc
rf9feab8 r90152a4 106 106 } 107 107 108 namespace { 109 struct EnvTrimmer { 110 TypeSubstitution * env, * newEnv; 111 EnvTrimmer( TypeSubstitution * env, TypeSubstitution * newEnv ) : env( env ), newEnv( newEnv ){} 112 void previsit( TypeDecl * tyDecl ) { 113 // transfer known bindings for seen type variables 114 if ( Type * t = env->lookup( tyDecl->name ) ) { 115 newEnv->add( tyDecl->name, t ); 116 } 117 } 118 }; 119 } // namespace 120 121 /// reduce environment to just the parts that are referenced in a given expression 122 TypeSubstitution * TypeSubstitution::newFromExpr( Expression * expr, TypeSubstitution * env ) { 123 if ( env ) { 124 TypeSubstitution * newEnv = new TypeSubstitution(); 125 PassVisitor<EnvTrimmer> trimmer( env, newEnv ); 126 expr->accept( trimmer ); 127 return newEnv; 128 } 129 return nullptr; 130 } 131 108 132 void TypeSubstitution::normalize() { 133 PassVisitor<Substituter> sub( *this, true ); 109 134 do { 110 sub Count = 0;111 freeOnly = true;135 sub.pass.subCount = 0; 136 sub.pass.freeOnly = true; 112 137 for ( TypeEnvType::iterator i = typeEnv.begin(); i != typeEnv.end(); ++i ) { 113 i->second = i->second->acceptMutator( *this);138 i->second = i->second->acceptMutator( sub ); 114 139 } 115 } while ( sub Count );116 } 117 118 Type * TypeSubstitution:: mutate( TypeInstType *inst ) {119 BoundVarsType::const_iterator bound = boundVars.find( inst-> get_name());140 } while ( sub.pass.subCount ); 141 } 142 143 Type * TypeSubstitution::Substituter::postmutate( TypeInstType *inst ) { 144 BoundVarsType::const_iterator bound = boundVars.find( inst->name ); 120 145 if ( bound != boundVars.end() ) return inst; 121 146 122 TypeEnvType::const_iterator i = typeEnv.find( inst->get_name() );123 if ( i == typeEnv.end() ) {147 TypeEnvType::const_iterator i = sub.typeEnv.find( inst->get_name() ); 148 if ( i == sub.typeEnv.end() ) { 124 149 return inst; 125 150 } else { 126 /// std::cout << "found " << inst->get_name() << ", replacing with "; 127 /// i->second->print( std::cout ); 128 /// std::cout << std::endl; 151 // cut off infinite loop for the case where a type is bound to itself. 152 // Note: this does not prevent cycles in the general case, so it may be necessary to do something more sophisticated here. 153 // TODO: investigate preventing type variables from being bound to themselves in the first place. 154 if ( TypeInstType * replacement = dynamic_cast< TypeInstType * >( i->second ) ) { 155 if ( inst->name == replacement->name ) { 156 return inst; 157 } 158 } 159 // std::cerr << "found " << inst->name << ", replacing with " << i->second << std::endl; 129 160 subCount++; 130 Type * newtype = i->second->clone();161 Type * newtype = i->second->clone(); 131 162 newtype->get_qualifiers() |= inst->get_qualifiers(); 132 163 delete inst; 133 return newtype; 134 } // if 135 } 136 137 Expression * TypeSubstitution::mutate( NameExpr *nameExpr ) { 138 VarEnvType::const_iterator i = varEnv.find( nameExpr->get_name() ); 139 if ( i == varEnv.end() ) { 164 // Note: need to recursively apply substitution to the new type because normalize does not substitute bound vars, but bound vars must be substituted when not in freeOnly mode. 165 return newtype->acceptMutator( *visitor ); 166 } // if 167 } 168 169 Expression * TypeSubstitution::Substituter::postmutate( NameExpr * nameExpr ) { 170 VarEnvType::const_iterator i = sub.varEnv.find( nameExpr->name ); 171 if ( i == sub.varEnv.end() ) { 140 172 return nameExpr; 141 173 } else { … … 146 178 } 147 179 148 template< typename TypeClass > 149 Type *TypeSubstitution::handleType( TypeClass *type ) { 150 ValueGuard<BoundVarsType> oldBoundVars( boundVars ); 180 void TypeSubstitution::Substituter::premutate( Type * type ) { 181 GuardValue( boundVars ); 151 182 // bind type variables from forall-qualifiers 152 183 if ( freeOnly ) { 153 for ( Type::ForallList::const_iterator tyvar = type-> get_forall().begin(); tyvar != type->get_forall().end(); ++tyvar ) {154 boundVars.insert( (*tyvar )->get_name());184 for ( Type::ForallList::const_iterator tyvar = type->forall.begin(); tyvar != type->forall.end(); ++tyvar ) { 185 boundVars.insert( (*tyvar)->name ); 155 186 } // for 156 187 } // if 157 Type *ret = Mutator::mutate( type );158 return ret;159 188 } 160 189 161 190 template< typename TypeClass > 162 Type *TypeSubstitution::handleAggregateType( TypeClass *type ) {163 ValueGuard<BoundVarsType> oldBoundVars( boundVars );191 void TypeSubstitution::Substituter::handleAggregateType( TypeClass * type ) { 192 GuardValue( boundVars ); 164 193 // bind type variables from forall-qualifiers 165 194 if ( freeOnly ) { 166 for ( Type::ForallList::const_iterator tyvar = type-> get_forall().begin(); tyvar != type->get_forall().end(); ++tyvar ) {167 boundVars.insert( (*tyvar )->get_name());195 for ( Type::ForallList::const_iterator tyvar = type->forall.begin(); tyvar != type->forall.end(); ++tyvar ) { 196 boundVars.insert( (*tyvar)->name ); 168 197 } // for 169 198 // bind type variables from generic type instantiations 170 199 std::list< TypeDecl* > *baseParameters = type->get_baseParameters(); 171 if ( baseParameters && ! type-> get_parameters().empty() ) {200 if ( baseParameters && ! type->parameters.empty() ) { 172 201 for ( std::list< TypeDecl* >::const_iterator tyvar = baseParameters->begin(); tyvar != baseParameters->end(); ++tyvar ) { 173 boundVars.insert( (*tyvar)-> get_name());202 boundVars.insert( (*tyvar)->name ); 174 203 } // for 175 204 } // if 176 205 } // if 177 Type *ret = Mutator::mutate( type ); 178 return ret; 179 } 180 181 Type * TypeSubstitution::mutate( VoidType *voidType ) { 182 return handleType( voidType ); 183 } 184 185 Type * TypeSubstitution::mutate( BasicType *basicType ) { 186 return handleType( basicType ); 187 } 188 189 Type * TypeSubstitution::mutate( PointerType *pointerType ) { 190 return handleType( pointerType ); 191 } 192 193 Type * TypeSubstitution::mutate( ArrayType *arrayType ) { 194 return handleType( arrayType ); 195 } 196 197 Type * TypeSubstitution::mutate( FunctionType *functionType ) { 198 return handleType( functionType ); 199 } 200 201 Type * TypeSubstitution::mutate( StructInstType *aggregateUseType ) { 202 return handleAggregateType( aggregateUseType ); 203 } 204 205 Type * TypeSubstitution::mutate( UnionInstType *aggregateUseType ) { 206 return handleAggregateType( aggregateUseType ); 207 } 208 209 Type * TypeSubstitution::mutate( EnumInstType *aggregateUseType ) { 210 return handleType( aggregateUseType ); 211 } 212 213 Type * TypeSubstitution::mutate( TraitInstType *aggregateUseType ) { 214 return handleType( aggregateUseType ); 215 } 216 217 Type * TypeSubstitution::mutate( TupleType *tupleType ) { 218 return handleType( tupleType ); 219 } 220 221 Type * TypeSubstitution::mutate( VarArgsType *varArgsType ) { 222 return handleType( varArgsType ); 223 } 224 225 Type * TypeSubstitution::mutate( ZeroType *zeroType ) { 226 return handleType( zeroType ); 227 } 228 229 Type * TypeSubstitution::mutate( OneType *oneType ) { 230 return handleType( oneType ); 206 } 207 208 void TypeSubstitution::Substituter::premutate( StructInstType * aggregateUseType ) { 209 handleAggregateType( aggregateUseType ); 210 } 211 212 void TypeSubstitution::Substituter::premutate( UnionInstType *aggregateUseType ) { 213 handleAggregateType( aggregateUseType ); 231 214 } 232 215 -
src/SynTree/TypeSubstitution.h
rf9feab8 r90152a4 27 27 #include "SynTree/Declaration.h" // for TypeDecl, Declaration (ptr only) 28 28 #include "SynTree/Expression.h" // for Expression (ptr only), NameExpr (p... 29 #include "SynTree/Mutator.h" // for Mutator30 29 #include "SynTree/Type.h" // for Type, ArrayType (ptr only), BasicT... 31 30 32 class TypeSubstitution : public Mutator { 33 typedef Mutator Parent; 31 class TypeSubstitution { 34 32 public: 35 33 TypeSubstitution(); … … 57 55 void extract( TypeInstListIterator begin, TypeInstListIterator end, TypeSubstitution &result ); 58 56 57 /// create a new TypeSubstitution using bindings from env containing all of the type variables in expr 58 static TypeSubstitution * newFromExpr( Expression * expr, TypeSubstitution * env ); 59 59 60 void normalize(); 60 61 … … 64 65 TypeSubstitution *clone() const { return new TypeSubstitution( *this ); } 65 66 private: 66 virtual Type* mutate(TypeInstType *aggregateUseType); 67 virtual Expression* mutate(NameExpr *nameExpr); 68 69 /// Records type variable bindings from forall-statements 70 template< typename TypeClass > Type *handleType( TypeClass *type ); 71 /// Records type variable bindings from forall-statements and instantiations of generic types 72 template< typename TypeClass > Type *handleAggregateType( TypeClass *type ); 73 74 virtual Type* mutate(VoidType *basicType); 75 virtual Type* mutate(BasicType *basicType); 76 virtual Type* mutate(PointerType *pointerType); 77 virtual Type* mutate(ArrayType *arrayType); 78 virtual Type* mutate(FunctionType *functionType); 79 virtual Type* mutate(StructInstType *aggregateUseType); 80 virtual Type* mutate(UnionInstType *aggregateUseType); 81 virtual Type* mutate(EnumInstType *aggregateUseType); 82 virtual Type* mutate(TraitInstType *aggregateUseType); 83 virtual Type* mutate(TupleType *tupleType); 84 virtual Type* mutate(VarArgsType *varArgsType); 85 virtual Type* mutate(ZeroType *zeroType); 86 virtual Type* mutate(OneType *oneType); 67 68 // Mutator that performs the substitution 69 struct Substituter; 87 70 88 71 // TODO: worry about traversing into a forall-qualified function type or type decl with assertions … … 97 80 typedef std::map< std::string, Type* > TypeEnvType; 98 81 typedef std::map< std::string, Expression* > VarEnvType; 99 typedef std::set< std::string > BoundVarsType;100 82 TypeEnvType typeEnv; 101 83 VarEnvType varEnv; 102 BoundVarsType boundVars; 103 int subCount; 104 bool freeOnly; 84 85 public: 86 // has to come after declaration of typeEnv 87 auto begin() -> decltype( typeEnv.begin() ) { return typeEnv.begin(); } 88 auto end() -> decltype( typeEnv. end() ) { return typeEnv. end(); } 89 auto begin() const -> decltype( typeEnv.begin() ) { return typeEnv.begin(); } 90 auto end() const -> decltype( typeEnv. end() ) { return typeEnv. end(); } 105 91 }; 106 92 … … 122 108 } // if 123 109 } else { 124 throw SemanticError( toString( "Attempt to provide non-type parameter: ", toString( *actualIt ).c_str(), " for type parameter " ), formal);110 SemanticError( formal, toString( "Attempt to provide non-type parameter: ", toString( *actualIt ).c_str(), " for type parameter " ) ); 125 111 } // if 126 112 } else { … … 134 120 135 121 template< typename FormalIterator, typename ActualIterator > 136 TypeSubstitution::TypeSubstitution( FormalIterator formalBegin, FormalIterator formalEnd, ActualIterator actualBegin ) 137 { 122 TypeSubstitution::TypeSubstitution( FormalIterator formalBegin, FormalIterator formalEnd, ActualIterator actualBegin ) { 138 123 add( formalBegin, formalEnd, actualBegin ); 139 124 } 125 126 // include needs to happen after TypeSubstitution is defined so that both TypeSubstitution and 127 // PassVisitor are defined before PassVisitor implementation accesses TypeSubstitution internals. 128 #include "Common/PassVisitor.h" 129 130 // definitition must happen after PassVisitor is included so that WithGuards can be used 131 struct TypeSubstitution::Substituter : public WithGuards, public WithVisitorRef<Substituter> { 132 Substituter( TypeSubstitution & sub, bool freeOnly ) : sub( sub ), freeOnly( freeOnly ) {} 133 134 Type * postmutate( TypeInstType * aggregateUseType ); 135 Expression * postmutate( NameExpr * nameExpr ); 136 137 /// Records type variable bindings from forall-statements 138 void premutate( Type * type ); 139 /// Records type variable bindings from forall-statements and instantiations of generic types 140 template< typename TypeClass > void handleAggregateType( TypeClass * type ); 141 142 void premutate( StructInstType * aggregateUseType ); 143 void premutate( UnionInstType * aggregateUseType ); 144 145 TypeSubstitution & sub; 146 int subCount = 0; 147 bool freeOnly; 148 typedef std::set< std::string > BoundVarsType; 149 BoundVarsType boundVars; 150 }; 140 151 141 152 template< typename SynTreeClass > 142 153 int TypeSubstitution::apply( SynTreeClass *&input ) { 143 154 assert( input ); 144 subCount = 0; 145 freeOnly = false; 146 input = dynamic_cast< SynTreeClass *>( input->acceptMutator( *this ) ); 147 assert( input ); 148 /// std::cout << "substitution result is: "; 149 /// newType->print( std::cout ); 150 /// std::cout << std::endl; 151 return subCount; 155 PassVisitor<Substituter> sub( *this, false ); 156 input = dynamic_cast< SynTreeClass * >( input->acceptMutator( sub ) ); 157 assert( input ); 158 /// std::cerr << "substitution result is: "; 159 /// newType->print( std::cerr ); 160 /// std::cerr << std::endl; 161 return sub.pass.subCount; 152 162 } 153 163 … … 155 165 int TypeSubstitution::applyFree( SynTreeClass *&input ) { 156 166 assert( input ); 157 subCount = 0; 158 freeOnly = true; 159 input = dynamic_cast< SynTreeClass *>( input->acceptMutator( *this ) ); 160 assert( input ); 161 /// std::cout << "substitution result is: "; 162 /// newType->print( std::cout ); 163 /// std::cout << std::endl; 164 return subCount; 167 PassVisitor<Substituter> sub( *this, true ); 168 input = dynamic_cast< SynTreeClass * >( input->acceptMutator( sub ) ); 169 assert( input ); 170 /// std::cerr << "substitution result is: "; 171 /// newType->print( std::cerr ); 172 /// std::cerr << std::endl; 173 return sub.pass.subCount; 165 174 } 166 175 -
src/SynTree/Visitor.h
rf9feab8 r90152a4 21 21 class Visitor { 22 22 protected: 23 Visitor() ;24 virtual ~Visitor() ;23 Visitor() = default; 24 virtual ~Visitor() = default; 25 25 public: 26 26 // visit: Default implementation of all functions visits the children 27 27 // of the given syntax node, but performs no other action. 28 28 29 virtual void visit( ObjectDecl * objectDecl ); 30 virtual void visit( FunctionDecl * functionDecl ); 31 virtual void visit( StructDecl * aggregateDecl ); 32 virtual void visit( UnionDecl * aggregateDecl ); 33 virtual void visit( EnumDecl * aggregateDecl ); 34 virtual void visit( TraitDecl * aggregateDecl ); 35 virtual void visit( TypeDecl * typeDecl ); 36 virtual void visit( TypedefDecl * typeDecl ); 37 virtual void visit( AsmDecl * asmDecl ); 29 virtual void visit( ObjectDecl * objectDecl ) = 0; 30 virtual void visit( FunctionDecl * functionDecl ) = 0; 31 virtual void visit( StructDecl * aggregateDecl ) = 0; 32 virtual void visit( UnionDecl * aggregateDecl ) = 0; 33 virtual void visit( EnumDecl * aggregateDecl ) = 0; 34 virtual void visit( TraitDecl * aggregateDecl ) = 0; 35 virtual void visit( TypeDecl * typeDecl ) = 0; 36 virtual void visit( TypedefDecl * typeDecl ) = 0; 37 virtual void visit( AsmDecl * asmDecl ) = 0; 38 virtual void visit( StaticAssertDecl * assertDecl ) = 0; 38 39 39 virtual void visit( CompoundStmt * compoundStmt ); 40 virtual void visit( ExprStmt * exprStmt ); 41 virtual void visit( AsmStmt * asmStmt ); 42 virtual void visit( IfStmt * ifStmt ); 43 virtual void visit( WhileStmt * whileStmt ); 44 virtual void visit( ForStmt * forStmt ); 45 virtual void visit( SwitchStmt * switchStmt ); 46 virtual void visit( CaseStmt * caseStmt ); 47 virtual void visit( BranchStmt * branchStmt ); 48 virtual void visit( ReturnStmt * returnStmt ); 49 virtual void visit( ThrowStmt * throwStmt ); 50 virtual void visit( TryStmt * tryStmt ); 51 virtual void visit( CatchStmt * catchStmt ); 52 virtual void visit( FinallyStmt * finallyStmt ); 53 virtual void visit( WaitForStmt * waitforStmt ); 54 virtual void visit( WithStmt * withStmt ); 55 virtual void visit( NullStmt * nullStmt ); 56 virtual void visit( DeclStmt * declStmt ); 57 virtual void visit( ImplicitCtorDtorStmt * impCtorDtorStmt ); 40 virtual void visit( CompoundStmt * compoundStmt ) = 0; 41 virtual void visit( ExprStmt * exprStmt ) = 0; 42 virtual void visit( AsmStmt * asmStmt ) = 0; 43 virtual void visit( DirectiveStmt * directiveStmt ) = 0; 44 virtual void visit( IfStmt * ifStmt ) = 0; 45 virtual void visit( WhileStmt * whileStmt ) = 0; 46 virtual void visit( ForStmt * forStmt ) = 0; 47 virtual void visit( SwitchStmt * switchStmt ) = 0; 48 virtual void visit( CaseStmt * caseStmt ) = 0; 49 virtual void visit( BranchStmt * branchStmt ) = 0; 50 virtual void visit( ReturnStmt * returnStmt ) = 0; 51 virtual void visit( ThrowStmt * throwStmt ) = 0; 52 virtual void visit( TryStmt * tryStmt ) = 0; 53 virtual void visit( CatchStmt * catchStmt ) = 0; 54 virtual void visit( FinallyStmt * finallyStmt ) = 0; 55 virtual void visit( WaitForStmt * waitforStmt ) = 0; 56 virtual void visit( WithStmt * withStmt ) = 0; 57 virtual void visit( NullStmt * nullStmt ) = 0; 58 virtual void visit( DeclStmt * declStmt ) = 0; 59 virtual void visit( ImplicitCtorDtorStmt * impCtorDtorStmt ) = 0; 58 60 59 virtual void visit( ApplicationExpr * applicationExpr ); 60 virtual void visit( UntypedExpr * untypedExpr ); 61 virtual void visit( NameExpr * nameExpr ); 62 virtual void visit( CastExpr * castExpr ); 63 virtual void visit( VirtualCastExpr * castExpr ); 64 virtual void visit( AddressExpr * addressExpr ); 65 virtual void visit( LabelAddressExpr * labAddressExpr ); 66 virtual void visit( UntypedMemberExpr * memberExpr ); 67 virtual void visit( MemberExpr * memberExpr ); 68 virtual void visit( VariableExpr * variableExpr ); 69 virtual void visit( ConstantExpr * constantExpr ); 70 virtual void visit( SizeofExpr * sizeofExpr ); 71 virtual void visit( AlignofExpr * alignofExpr ); 72 virtual void visit( UntypedOffsetofExpr * offsetofExpr ); 73 virtual void visit( OffsetofExpr * offsetofExpr ); 74 virtual void visit( OffsetPackExpr * offsetPackExpr ); 75 virtual void visit( AttrExpr * attrExpr ); 76 virtual void visit( LogicalExpr * logicalExpr ); 77 virtual void visit( ConditionalExpr * conditionalExpr ); 78 virtual void visit( CommaExpr * commaExpr ); 79 virtual void visit( TypeExpr * typeExpr ); 80 virtual void visit( AsmExpr * asmExpr ); 81 virtual void visit( ImplicitCopyCtorExpr * impCpCtorExpr ); 82 virtual void visit( ConstructorExpr * ctorExpr ); 83 virtual void visit( CompoundLiteralExpr * compLitExpr ); 84 virtual void visit( RangeExpr * rangeExpr ); 85 virtual void visit( UntypedTupleExpr * tupleExpr ); 86 virtual void visit( TupleExpr * tupleExpr ); 87 virtual void visit( TupleIndexExpr * tupleExpr ); 88 virtual void visit( TupleAssignExpr * assignExpr ); 89 virtual void visit( StmtExpr * stmtExpr ); 90 virtual void visit( UniqueExpr * uniqueExpr ); 91 virtual void visit( UntypedInitExpr * initExpr ); 92 virtual void visit( InitExpr * initExpr ); 61 virtual void visit( ApplicationExpr * applicationExpr ) = 0; 62 virtual void visit( UntypedExpr * untypedExpr ) = 0; 63 virtual void visit( NameExpr * nameExpr ) = 0; 64 virtual void visit( CastExpr * castExpr ) = 0; 65 virtual void visit( KeywordCastExpr * castExpr ) = 0; 66 virtual void visit( VirtualCastExpr * castExpr ) = 0; 67 virtual void visit( AddressExpr * addressExpr ) = 0; 68 virtual void visit( LabelAddressExpr * labAddressExpr ) = 0; 69 virtual void visit( UntypedMemberExpr * memberExpr ) = 0; 70 virtual void visit( MemberExpr * memberExpr ) = 0; 71 virtual void visit( VariableExpr * variableExpr ) = 0; 72 virtual void visit( ConstantExpr * constantExpr ) = 0; 73 virtual void visit( SizeofExpr * sizeofExpr ) = 0; 74 virtual void visit( AlignofExpr * alignofExpr ) = 0; 75 virtual void visit( UntypedOffsetofExpr * offsetofExpr ) = 0; 76 virtual void visit( OffsetofExpr * offsetofExpr ) = 0; 77 virtual void visit( OffsetPackExpr * offsetPackExpr ) = 0; 78 virtual void visit( AttrExpr * attrExpr ) = 0; 79 virtual void visit( LogicalExpr * logicalExpr ) = 0; 80 virtual void visit( ConditionalExpr * conditionalExpr ) = 0; 81 virtual void visit( CommaExpr * commaExpr ) = 0; 82 virtual void visit( TypeExpr * typeExpr ) = 0; 83 virtual void visit( AsmExpr * asmExpr ) = 0; 84 virtual void visit( ImplicitCopyCtorExpr * impCpCtorExpr ) = 0; 85 virtual void visit( ConstructorExpr * ctorExpr ) = 0; 86 virtual void visit( CompoundLiteralExpr * compLitExpr ) = 0; 87 virtual void visit( RangeExpr * rangeExpr ) = 0; 88 virtual void visit( UntypedTupleExpr * tupleExpr ) = 0; 89 virtual void visit( TupleExpr * tupleExpr ) = 0; 90 virtual void visit( TupleIndexExpr * tupleExpr ) = 0; 91 virtual void visit( TupleAssignExpr * assignExpr ) = 0; 92 virtual void visit( StmtExpr * stmtExpr ) = 0; 93 virtual void visit( UniqueExpr * uniqueExpr ) = 0; 94 virtual void visit( UntypedInitExpr * initExpr ) = 0; 95 virtual void visit( InitExpr * initExpr ) = 0; 96 virtual void visit( DeletedExpr * delExpr ) = 0; 97 virtual void visit( DefaultArgExpr * argExpr ) = 0; 98 virtual void visit( GenericExpr * genExpr ) = 0; 93 99 94 virtual void visit( VoidType * basicType ); 95 virtual void visit( BasicType * basicType ); 96 virtual void visit( PointerType * pointerType ); 97 virtual void visit( ArrayType * arrayType ); 98 virtual void visit( ReferenceType * refType ); 99 virtual void visit( FunctionType * functionType ); 100 virtual void visit( StructInstType * aggregateUseType ); 101 virtual void visit( UnionInstType * aggregateUseType ); 102 virtual void visit( EnumInstType * aggregateUseType ); 103 virtual void visit( TraitInstType * aggregateUseType ); 104 virtual void visit( TypeInstType * aggregateUseType ); 105 virtual void visit( TupleType * tupleType ); 106 virtual void visit( TypeofType * typeofType ); 107 virtual void visit( AttrType * attrType ); 108 virtual void visit( VarArgsType * varArgsType ); 109 virtual void visit( ZeroType * zeroType ); 110 virtual void visit( OneType * oneType ); 100 virtual void visit( VoidType * basicType ) = 0; 101 virtual void visit( BasicType * basicType ) = 0; 102 virtual void visit( PointerType * pointerType ) = 0; 103 virtual void visit( ArrayType * arrayType ) = 0; 104 virtual void visit( ReferenceType * refType ) = 0; 105 virtual void visit( QualifiedType * qualType ) = 0; 106 virtual void visit( FunctionType * functionType ) = 0; 107 virtual void visit( StructInstType * aggregateUseType ) = 0; 108 virtual void visit( UnionInstType * aggregateUseType ) = 0; 109 virtual void visit( EnumInstType * aggregateUseType ) = 0; 110 virtual void visit( TraitInstType * aggregateUseType ) = 0; 111 virtual void visit( TypeInstType * aggregateUseType ) = 0; 112 virtual void visit( TupleType * tupleType ) = 0; 113 virtual void visit( TypeofType * typeofType ) = 0; 114 virtual void visit( AttrType * attrType ) = 0; 115 virtual void visit( VarArgsType * varArgsType ) = 0; 116 virtual void visit( ZeroType * zeroType ) = 0; 117 virtual void visit( OneType * oneType ) = 0; 118 virtual void visit( GlobalScopeType * globalType ) = 0; 111 119 112 virtual void visit( Designation * designation ) ;113 virtual void visit( SingleInit * singleInit ) ;114 virtual void visit( ListInit * listInit ) ;115 virtual void visit( ConstructorInit * ctorInit ) ;120 virtual void visit( Designation * designation ) = 0; 121 virtual void visit( SingleInit * singleInit ) = 0; 122 virtual void visit( ListInit * listInit ) = 0; 123 virtual void visit( ConstructorInit * ctorInit ) = 0; 116 124 117 virtual void visit( Subrange * subrange ) ;125 virtual void visit( Subrange * subrange ) = 0; 118 126 119 virtual void visit( Constant * constant ) ;127 virtual void visit( Constant * constant ) = 0; 120 128 121 virtual void visit( Attribute * attribute ); 122 private: 123 virtual void handleAggregateDecl( AggregateDecl *aggregateDecl ); 124 virtual void handleNamedTypeDecl( NamedTypeDecl *typeDecl ); 125 virtual void handleReferenceToType( ReferenceToType *aggregateUseType ); 129 virtual void visit( Attribute * attribute ) = 0; 126 130 }; 127 131 … … 135 139 template< typename Container, typename VisitorType > 136 140 inline void acceptAll( Container &container, VisitorType &visitor ) { 137 SemanticError errors;141 SemanticErrorException errors; 138 142 for ( typename Container::iterator i = container.begin(); i != container.end(); ++i ) { 139 143 try { … … 141 145 (*i)->accept( visitor ); 142 146 } 143 } catch( SemanticError &e ) { 144 e.set_location( (*i)->location ); 147 } catch( SemanticErrorException &e ) { 145 148 errors.append( e ); 146 149 } -
src/SynTree/module.mk
rf9feab8 r90152a4 46 46 SynTree/TypeDecl.cc \ 47 47 SynTree/Initializer.cc \ 48 SynTree/Visitor.cc \49 SynTree/Mutator.cc \50 48 SynTree/TypeSubstitution.cc \ 51 49 SynTree/Attribute.cc \ 52 SynTree/ VarExprReplacer.cc50 SynTree/DeclReplacer.cc 53 51 -
src/Tuples/Explode.h
rf9feab8 r90152a4 43 43 /// Append alternative to an OutputIterator of Alternatives 44 44 template<typename OutputIterator> 45 void append( OutputIterator out, Expression* expr, const ResolvExpr::TypeEnvironment& env, 45 void append( OutputIterator out, Expression* expr, const ResolvExpr::TypeEnvironment& env, 46 46 const ResolvExpr::Cost& cost, const ResolvExpr::Cost& cvtCost ) { 47 47 *out++ = ResolvExpr::Alternative{ expr, env, cost, cvtCost }; … … 49 49 50 50 /// Append alternative to an ExplodedActual 51 static inline void append( ResolvExpr::ExplodedActual& ea, Expression* expr, 51 static inline void append( ResolvExpr::ExplodedActual& ea, Expression* expr, 52 52 const ResolvExpr::TypeEnvironment&, const ResolvExpr::Cost&, const ResolvExpr::Cost& ) { 53 53 ea.exprs.emplace_back( expr ); … … 57 57 /// helper function used by explode 58 58 template< typename Output > 59 void explodeUnique( Expression * expr, const ResolvExpr::Alternative & alt, 59 void explodeUnique( Expression * expr, const ResolvExpr::Alternative & alt, 60 60 const SymTab::Indexer & indexer, Output&& out, bool isTupleAssign ) { 61 61 if ( isTupleAssign ) { … … 63 63 if ( CastExpr * castExpr = isReferenceCast( expr ) ) { 64 64 ResolvExpr::AltList alts; 65 explodeUnique( 65 explodeUnique( 66 66 castExpr->get_arg(), alt, indexer, back_inserter( alts ), isTupleAssign ); 67 67 for ( ResolvExpr::Alternative & alt : alts ) { 68 68 // distribute reference cast over all components 69 append( std::forward<Output>(out), distributeReference( alt.release_expr() ), 69 append( std::forward<Output>(out), distributeReference( alt.release_expr() ), 70 70 alt.env, alt.cost, alt.cvtCost ); 71 71 } … … 108 108 /// expands a tuple-valued alternative into multiple alternatives, each with a non-tuple-type 109 109 template< typename Output > 110 void explode( const ResolvExpr::Alternative &alt, const SymTab::Indexer & indexer, 110 void explode( const ResolvExpr::Alternative &alt, const SymTab::Indexer & indexer, 111 111 Output&& out, bool isTupleAssign = false ) { 112 112 explodeUnique( alt.expr, alt, indexer, std::forward<Output>(out), isTupleAssign ); … … 115 115 // explode list of alternatives 116 116 template< typename AltIterator, typename Output > 117 void explode( AltIterator altBegin, AltIterator altEnd, const SymTab::Indexer & indexer, 117 void explode( AltIterator altBegin, AltIterator altEnd, const SymTab::Indexer & indexer, 118 118 Output&& out, bool isTupleAssign = false ) { 119 119 for ( ; altBegin != altEnd; ++altBegin ) { … … 123 123 124 124 template< typename Output > 125 void explode( const ResolvExpr::AltList & alts, const SymTab::Indexer & indexer, Output&& out, 125 void explode( const ResolvExpr::AltList & alts, const SymTab::Indexer & indexer, Output&& out, 126 126 bool isTupleAssign = false ) { 127 127 explode( alts.begin(), alts.end(), indexer, std::forward<Output>(out), isTupleAssign ); -
src/Tuples/TupleAssignment.cc
rf9feab8 r90152a4 154 154 lhsAlt.expr = new CastExpr( lhsAlt.expr, 155 155 new ReferenceType( Type::Qualifiers(), 156 lhsAlt.expr-> get_result()->clone() ) );156 lhsAlt.expr->result->clone() ) ); 157 157 } 158 158 … … 231 231 232 232 ResolvExpr::AlternativeFinder finder{ currentFinder.get_indexer(), 233 currentFinder.get_environ() }; 233 matcher->compositeEnv }; 234 234 235 try { 235 236 finder.findWithAdjustment(*i); … … 272 273 // args.push_back( new AddressExpr( new VariableExpr( left ) ) ); 273 274 if ( right ) args.push_back( new VariableExpr( right ) ); 274 return new UntypedExpr( new NameExpr( fname ), args ); 275 } 276 277 // removes environments from subexpressions within statement exprs, which could throw off later passes like those in Box which rely on PolyMutator. 275 if ( left->type->referenceDepth() > 1 && CodeGen::isConstructor( fname ) ) { 276 args.front() = new AddressExpr( args.front() ); 277 if ( right ) args.back() = new AddressExpr( args.back() ); 278 return new UntypedExpr( new NameExpr( "?=?" ), args ); 279 } else { 280 return new UntypedExpr( new NameExpr( fname ), args ); 281 } 282 } 283 284 // removes environments from subexpressions within statement exprs, which could throw off later passes like those in Box which rely on PolyMutator, and adds the bindings to the compositeEnv 278 285 // xxx - maybe this should happen in alternative finder for every StmtExpr? 279 // xxx - it's possible that these environments could contain some useful information. Maybe the right thing to do is aggregate the environments and pass the aggregate back to be added into the compositeEnv280 286 struct EnvRemover { 281 287 void previsit( ExprStmt * stmt ) { 282 delete stmt->expr->env; 283 stmt->expr->env = nullptr; 284 } 288 assert( compositeEnv ); 289 if ( stmt->expr->env ) { 290 compositeEnv->add( *stmt->expr->env ); 291 delete stmt->expr->env; 292 stmt->expr->env = nullptr; 293 } 294 } 295 296 ResolvExpr::TypeEnvironment * compositeEnv = nullptr; 285 297 }; 286 298 287 299 ObjectDecl * TupleAssignSpotter::Matcher::newObject( UniqueName & namer, Expression * expr ) { 288 300 assert( expr->result && ! expr->get_result()->isVoid() ); 289 ObjectDecl * ret = new ObjectDecl( namer.newName(), Type::StorageClasses(), LinkageSpec::Cforall, nullptr, expr-> get_result()->clone(), new SingleInit( expr->clone() ) );301 ObjectDecl * ret = new ObjectDecl( namer.newName(), Type::StorageClasses(), LinkageSpec::Cforall, nullptr, expr->result->clone(), new SingleInit( expr->clone() ) ); 290 302 // if expression type is a reference, don't need to construct anything, a simple initializer is sufficient. 291 if ( ! dynamic_cast< ReferenceType * >( expr-> get_result()) ) {303 if ( ! dynamic_cast< ReferenceType * >( expr->result ) ) { 292 304 ConstructorInit * ctorInit = InitTweak::genCtorInit( ret ); 293 ret-> set_init( ctorInit );305 ret->init = ctorInit; 294 306 ResolvExpr::resolveCtorInit( ctorInit, spotter.currentFinder.get_indexer() ); // resolve ctor/dtors for the new object 295 307 PassVisitor<EnvRemover> rm; // remove environments from subexpressions of StmtExprs 308 rm.pass.compositeEnv = &compositeEnv; 296 309 ctorInit->accept( rm ); 297 310 } … … 306 319 assert( (! lhs.empty() && rhs.size() <= 1) || (lhs.empty() && rhs.empty()) ); 307 320 321 // xxx - may need to split this up into multiple declarations, because potential conversion to references 322 // probably should not reference local variable - see MultipleAssignMatcher::match 308 323 ObjectDecl * rtmp = rhs.size() == 1 ? newObject( rhsNamer, rhs.front().expr ) : nullptr; 309 324 for ( ResolvExpr::Alternative & lhsAlt : lhs ) { … … 324 339 std::list< ObjectDecl * > ltmp; 325 340 std::list< ObjectDecl * > rtmp; 326 std::transform( lhs.begin(), lhs.end(), back_inserter( ltmp ), [&]( ResolvExpr::Alternative & alt ){ 327 return newObject( lhsNamer, alt.expr ); 328 }); 329 std::transform( rhs.begin(), rhs.end(), back_inserter( rtmp ), [&]( ResolvExpr::Alternative & alt ){ 330 return newObject( rhsNamer, alt.expr ); 331 }); 332 zipWith( ltmp.begin(), ltmp.end(), rtmp.begin(), rtmp.end(), back_inserter(out), [&](ObjectDecl * obj1, ObjectDecl * obj2 ) { return createFunc(spotter.fname, obj1, obj2); } ); 341 for ( auto p : group_iterate( lhs, rhs ) ) { 342 ResolvExpr::Alternative & lhsAlt = std::get<0>(p); 343 ResolvExpr::Alternative & rhsAlt = std::get<1>(p); 344 // convert RHS to LHS type minus one reference -- important for the case where LHS is && and RHS is lvalue, etc. 345 ReferenceType * lhsType = strict_dynamic_cast<ReferenceType *>( lhsAlt.expr->result ); 346 rhsAlt.expr = new CastExpr( rhsAlt.expr, lhsType->base->clone() ); 347 ObjectDecl * lobj = newObject( lhsNamer, lhsAlt.expr ); 348 ObjectDecl * robj = newObject( rhsNamer, rhsAlt.expr ); 349 out.push_back( createFunc(spotter.fname, lobj, robj) ); 350 ltmp.push_back( lobj ); 351 rtmp.push_back( robj ); 352 353 // resolve the cast expression so that rhsAlt return type is bound by the cast type as needed, and transfer the resulting environment 354 ResolvExpr::AlternativeFinder finder{ spotter.currentFinder.get_indexer(), compositeEnv }; 355 finder.findWithAdjustment( rhsAlt.expr ); 356 assert( finder.get_alternatives().size() == 1 ); 357 compositeEnv = std::move( finder.get_alternatives().front().env ); 358 } 333 359 tmpDecls.splice( tmpDecls.end(), ltmp ); 334 360 tmpDecls.splice( tmpDecls.end(), rtmp ); -
src/Tuples/TupleExpansion.cc
rf9feab8 r90152a4 30 30 #include "SynTree/Type.h" // for Type, Type::Qualifiers, TupleType 31 31 #include "SynTree/Visitor.h" // for Visitor 32 #include "Tuples.h" 32 33 33 34 class CompoundStmt; … … 36 37 namespace Tuples { 37 38 namespace { 38 struct MemberTupleExpander final : public Mutator { 39 typedef Mutator Parent; 40 using Parent::mutate; 41 42 virtual Expression * mutate( UntypedMemberExpr * memberExpr ) override; 39 struct MemberTupleExpander final : public WithShortCircuiting, public WithVisitorRef<MemberTupleExpander> { 40 void premutate( UntypedMemberExpr * ) { visit_children = false; } 41 Expression * postmutate( UntypedMemberExpr * memberExpr ); 43 42 }; 44 43 … … 79 78 80 79 void expandMemberTuples( std::list< Declaration * > & translationUnit ) { 81 MemberTupleExpanderexpander;80 PassVisitor<MemberTupleExpander> expander; 82 81 mutateAll( translationUnit, expander ); 83 82 } … … 109 108 // construct a new UntypedMemberExpr with the correct structure , and recursively 110 109 // expand that member expression. 111 MemberTupleExpanderexpander;112 UntypedMemberExpr * inner = new UntypedMemberExpr( memberExpr-> get_aggregate(), aggr->clone() );113 UntypedMemberExpr * newMemberExpr = new UntypedMemberExpr( memberExpr-> get_member(), inner );110 PassVisitor<MemberTupleExpander> expander; 111 UntypedMemberExpr * inner = new UntypedMemberExpr( memberExpr->aggregate, aggr->clone() ); 112 UntypedMemberExpr * newMemberExpr = new UntypedMemberExpr( memberExpr->member, inner ); 114 113 inner->location = newMemberExpr->location = loc; 115 memberExpr-> set_member(nullptr);116 memberExpr-> set_aggregate(nullptr);114 memberExpr->member = nullptr; 115 memberExpr->aggregate = nullptr; 117 116 delete memberExpr; 118 117 return newMemberExpr->acceptMutator( expander ); … … 126 125 } 127 126 128 Expression * MemberTupleExpander:: mutate( UntypedMemberExpr * memberExpr ) {129 if ( UntypedTupleExpr * tupleExpr = dynamic_cast< UntypedTupleExpr * > ( memberExpr-> get_member()) ) {130 Expression * aggr = memberExpr-> get_aggregate()->clone()->acceptMutator( *this);127 Expression * MemberTupleExpander::postmutate( UntypedMemberExpr * memberExpr ) { 128 if ( UntypedTupleExpr * tupleExpr = dynamic_cast< UntypedTupleExpr * > ( memberExpr->member ) ) { 129 Expression * aggr = memberExpr->aggregate->clone()->acceptMutator( *visitor ); 131 130 // aggregate expressions which might be impure must be wrapped in unique expressions 132 // xxx - if there's a member-tuple expression nested in the aggregate, this currently generates the wrong code if a UniqueExpr is not used, and it's purely an optimization to remove the UniqueExpr 133 // if ( Tuples::maybeImpureIgnoreUnique( memberExpr->get_aggregate() ) ) aggr = new UniqueExpr( aggr ); 134 aggr = new UniqueExpr( aggr ); 135 for ( Expression *& expr : tupleExpr->get_exprs() ) { 131 if ( Tuples::maybeImpureIgnoreUnique( memberExpr->aggregate ) ) aggr = new UniqueExpr( aggr ); 132 for ( Expression *& expr : tupleExpr->exprs ) { 136 133 expr = reconstructMemberExpr( expr, aggr, memberExpr->location ); 137 134 expr->location = memberExpr->location; … … 143 140 // there may be a tuple expr buried in the aggregate 144 141 // xxx - this is a memory leak 145 UntypedMemberExpr * newMemberExpr = new UntypedMemberExpr( memberExpr-> get_member()->clone(), memberExpr->get_aggregate()->acceptMutator( *this) );142 UntypedMemberExpr * newMemberExpr = new UntypedMemberExpr( memberExpr->member->clone(), memberExpr->aggregate->acceptMutator( *visitor ) ); 146 143 newMemberExpr->location = memberExpr->location; 147 144 return newMemberExpr; … … 202 199 // generate struct type to replace tuple type based on the number of components in the tuple 203 200 StructDecl * decl = new StructDecl( toString( "_tuple", tupleSize, "_" ) ); 201 decl->location = tupleType->location; 204 202 decl->set_body( true ); 205 203 for ( size_t i = 0; i < tupleSize; ++i ) { … … 228 226 229 227 Expression * TupleIndexExpander::postmutate( TupleIndexExpr * tupleExpr ) { 230 Expression * tuple = tupleExpr-> get_tuple();228 Expression * tuple = tupleExpr->tuple; 231 229 assert( tuple ); 232 tupleExpr-> set_tuple( nullptr );233 unsigned int idx = tupleExpr-> get_index();234 TypeSubstitution * env = tupleExpr-> get_env();235 tupleExpr-> set_env( nullptr );230 tupleExpr->tuple = nullptr; 231 unsigned int idx = tupleExpr->index; 232 TypeSubstitution * env = tupleExpr->env; 233 tupleExpr->env = nullptr; 236 234 delete tupleExpr; 237 235 238 StructInstType * type = strict_dynamic_cast< StructInstType * >( tuple->get_result() ); 239 StructDecl * structDecl = type->get_baseStruct(); 240 assert( structDecl->get_members().size() > idx ); 241 Declaration * member = *std::next(structDecl->get_members().begin(), idx); 236 if ( TupleExpr * tupleExpr = dynamic_cast< TupleExpr * > ( tuple ) ) { 237 if ( ! maybeImpureIgnoreUnique( tupleExpr ) ) { 238 // optimization: definitely pure tuple expr => can reduce to the only relevant component. 239 assert( tupleExpr->exprs.size() > idx ); 240 Expression *& expr = *std::next(tupleExpr->exprs.begin(), idx); 241 Expression * ret = expr; 242 ret->env = env; 243 expr = nullptr; // remove from list so it can safely be deleted 244 delete tupleExpr; 245 return ret; 246 } 247 } 248 249 StructInstType * type = strict_dynamic_cast< StructInstType * >( tuple->result ); 250 StructDecl * structDecl = type->baseStruct; 251 assert( structDecl->members.size() > idx ); 252 Declaration * member = *std::next(structDecl->members.begin(), idx); 242 253 MemberExpr * memExpr = new MemberExpr( strict_dynamic_cast< DeclarationWithType * >( member ), tuple ); 243 memExpr-> set_env( env );254 memExpr->env = env; 244 255 return memExpr; 245 256 } -
src/main.cc
rf9feab8 r90152a4 1 2 1 // 3 2 // Cforall Version 1.0.0 Copyright (C) 2015 University of Waterloo … … 11 10 // Created On : Fri May 15 23:12:02 2015 12 11 // Last Modified By : Peter A. Buhr 13 // Last Modified On : Tue Oct 31 12:22:40 201714 // Update Count : 4 4512 // Last Modified On : Wed Jun 6 15:51:47 2018 13 // Update Count : 498 15 14 // 16 15 … … 29 28 #include <string> // for char_traits, operator<< 30 29 30 #include "CompilationState.h" 31 31 #include "../config.h" // for CFA_LIBDIR 32 32 #include "CodeGen/FixMain.h" // for FixMain … … 35 35 #include "CodeTools/DeclStats.h" // for printDeclStats 36 36 #include "CodeTools/TrackLoc.h" // for fillLocations 37 #include "Common/CompilerError.h" // for CompilerError 38 #include "Common/Heap.h" 37 39 #include "Common/PassVisitor.h" 38 #include "Common/CompilerError.h" // for CompilerError39 40 #include "Common/SemanticError.h" // for SemanticError 40 41 #include "Common/UnimplementedError.h" // for UnimplementedError … … 63 64 using namespace std; 64 65 65 #define OPTPRINT(x) if ( errorp ) cerr << x << endl; 66 66 #define PASS(name, pass) \ 67 if ( errorp ) { cerr << name << endl; } \ 68 HeapStats::newPass(name); \ 69 pass; 67 70 68 71 LinkageSpec::Spec linkage = LinkageSpec::Cforall; … … 70 73 DeclarationNode * parseTree = nullptr; // program parse tree 71 74 72 extern int yydebug; // set for -g flag (Grammar) 73 bool 74 astp = false, 75 bresolvep = false, 76 bboxp = false, 77 bcodegenp = false, 78 ctorinitp = false, 79 declstatsp = false, 80 exprp = false, 81 expraltp = false, 82 libcfap = false, 83 nopreludep = false, 84 noprotop = false, 85 nomainp = false, 86 parsep = false, 87 resolvep = false, // used in AlternativeFinder 88 symtabp = false, 89 treep = false, 90 tuplep = false, 91 validp = false, 92 errorp = false, 93 codegenp = false, 94 prettycodegenp = false, 95 linemarks = false; 75 std::string PreludeDirector = ""; 96 76 97 77 static void parse_cmdline( int argc, char *argv[], const char *& filename ); … … 154 134 << "." << endl; 155 135 backtrace( 2 ); // skip first 2 stack frames 156 exit( EXIT_FAILURE ); 136 //_exit( EXIT_FAILURE ); 137 abort(); 157 138 } // sigSegvBusHandler 158 139 … … 173 154 signal( SIGBUS, sigSegvBusHandler ); 174 155 signal( SIGABRT, sigAbortHandler ); 156 157 // std::cout << "main" << std::endl; 158 // for ( int i = 0; i < argc; i += 1 ) { 159 // std::cout << '\t' << argv[i] << std::endl; 160 // } // for 175 161 176 162 parse_cmdline( argc, argv, filename ); // process command-line arguments … … 198 184 // -l is for initial build ONLY and builtins.cf is not in the lib directory so access it here. 199 185 186 assertf( !PreludeDirector.empty(), "Can't find prelude without option --prelude-dir must be used." ); 187 200 188 // Read to gcc builtins, if not generating the cfa library 201 FILE * gcc_builtins = fopen( libcfap | treep ? "../prelude/gcc-builtins.cf" : CFA_LIBDIR "/gcc-builtins.cf", "r" );189 FILE * gcc_builtins = fopen( (PreludeDirector + "/gcc-builtins.cf").c_str(), "r" ); 202 190 assertf( gcc_builtins, "cannot open gcc-builtins.cf\n" ); 203 191 parse( gcc_builtins, LinkageSpec::Compiler ); 204 192 205 193 // read the extra prelude in, if not generating the cfa library 206 FILE * extras = fopen( libcfap | treep ? "../prelude/extras.cf" : CFA_LIBDIR "/extras.cf", "r" );194 FILE * extras = fopen( (PreludeDirector + "/extras.cf").c_str(), "r" ); 207 195 assertf( extras, "cannot open extras.cf\n" ); 208 196 parse( extras, LinkageSpec::BuiltinC ); … … 210 198 if ( ! libcfap ) { 211 199 // read the prelude in, if not generating the cfa library 212 FILE * prelude = fopen( treep ? "../prelude/prelude.cf" : CFA_LIBDIR "/prelude.cf", "r" );200 FILE * prelude = fopen( (PreludeDirector + "/prelude.cf").c_str(), "r" ); 213 201 assertf( prelude, "cannot open prelude.cf\n" ); 214 202 parse( prelude, LinkageSpec::Intrinsic ); 215 203 216 204 // Read to cfa builtins, if not generating the cfa library 217 FILE * builtins = fopen( libcfap | treep ? "../prelude/builtins.cf" : CFA_LIBDIR "/builtins.cf", "r" );205 FILE * builtins = fopen( (PreludeDirector + "/builtins.cf").c_str(), "r" ); 218 206 assertf( builtins, "cannot open builtins.cf\n" ); 219 207 parse( builtins, LinkageSpec::BuiltinCFA ); … … 238 226 } // if 239 227 228 // Temporary: fill locations after parsing so that every node has a location, for early error messages. 229 // Eventually we should pass the locations from the parser to every node, but this quick and dirty solution 230 // works okay for now. 231 CodeTools::fillLocations( translationUnit ); 232 240 233 // add the assignment statement after the initialization of a type parameter 241 OPTPRINT( "validate" ) 242 SymTab::validate( translationUnit, symtabp ); 234 PASS( "validate", SymTab::validate( translationUnit, symtabp ) ); 243 235 if ( symtabp ) { 244 236 deleteAll( translationUnit ); … … 257 249 } // if 258 250 259 OPTPRINT( "mutate" ) 260 ControlStruct::mutate( translationUnit ); 261 OPTPRINT( "fixNames" ) 262 CodeGen::fixNames( translationUnit ); 263 OPTPRINT( "genInit" ) 264 InitTweak::genInit( translationUnit ); 265 OPTPRINT( "expandMemberTuples" ); 266 Tuples::expandMemberTuples( translationUnit ); 251 PASS( "fixLabels", ControlStruct::fixLabels( translationUnit ) ); 252 PASS( "fixNames", CodeGen::fixNames( translationUnit ) ); 253 PASS( "genInit", InitTweak::genInit( translationUnit ) ); 254 PASS( "expandMemberTuples" , Tuples::expandMemberTuples( translationUnit ) ); 267 255 if ( libcfap ) { 268 256 // generate the bodies of cfa library functions … … 281 269 } // if 282 270 283 OPTPRINT( "resolve" ) 284 ResolvExpr::resolve( translationUnit ); 271 CodeTools::fillLocations( translationUnit ); 272 273 PASS( "resolve", ResolvExpr::resolve( translationUnit ) ); 285 274 if ( exprp ) { 286 275 dump( translationUnit ); … … 289 278 290 279 // fix ObjectDecl - replaces ConstructorInit nodes 291 OPTPRINT( "fixInit" ) 292 InitTweak::fix( translationUnit, filename, libcfap || treep ); 280 PASS( "fixInit", InitTweak::fix( translationUnit, buildingLibrary() ) ); 293 281 if ( ctorinitp ) { 294 282 dump ( translationUnit ); … … 296 284 } // if 297 285 298 OPTPRINT( "expandUniqueExpr" ); // xxx - is this the right place for this? want to expand ASAP so that subsequent passes don't need to worry about double-visiting a unique expr - needs to go after InitTweak::fix so that copy constructed return declarations are reused 299 Tuples::expandUniqueExpr( translationUnit ); 300 301 OPTPRINT( "translateEHM" ); 302 ControlStruct::translateEHM( translationUnit ); 303 304 OPTPRINT( "generateWaitfor" ); 305 Concurrency::generateWaitFor( translationUnit ); 306 307 OPTPRINT( "convertSpecializations" ) // needs to happen before tuple types are expanded 308 GenPoly::convertSpecializations( translationUnit ); 309 310 OPTPRINT( "expandTuples" ); // xxx - is this the right place for this? 311 Tuples::expandTuples( translationUnit ); 286 PASS( "expandUniqueExpr", Tuples::expandUniqueExpr( translationUnit ) ); // xxx - is this the right place for this? want to expand ASAP so tha, sequent passes don't need to worry about double-visiting a unique expr - needs to go after InitTweak::fix so that copy constructed return declarations are reused 287 288 PASS( "translateEHM" , ControlStruct::translateEHM( translationUnit ) ); 289 290 PASS( "generateWaitfor" , Concurrency::generateWaitFor( translationUnit ) ); 291 292 PASS( "convertSpecializations", GenPoly::convertSpecializations( translationUnit ) ); // needs to happen before tuple types are expanded 293 294 PASS( "expandTuples", Tuples::expandTuples( translationUnit ) ); // xxx - is this the right place for this? 295 312 296 if ( tuplep ) { 313 297 dump( translationUnit ); … … 315 299 } 316 300 317 OPTPRINT( "virtual expandCasts" ) // Must come after translateEHM 318 Virtual::expandCasts( translationUnit ); 319 320 OPTPRINT("instantiateGenerics") 321 GenPoly::instantiateGeneric( translationUnit ); 322 OPTPRINT( "convertLvalue" ) 323 GenPoly::convertLvalue( translationUnit ); 301 PASS( "virtual expandCasts", Virtual::expandCasts( translationUnit ) ); // Must come after translateEHM 302 303 PASS( "instantiateGenerics", GenPoly::instantiateGeneric( translationUnit ) ); 304 if ( genericsp ) { 305 dump( translationUnit ); 306 return 0; 307 } 308 PASS( "convertLvalue", GenPoly::convertLvalue( translationUnit ) ); 309 324 310 325 311 if ( bboxp ) { … … 327 313 return 0; 328 314 } // if 329 OPTPRINT( "box" ) 330 GenPoly::box( translationUnit ); 315 PASS( "box", GenPoly::box( translationUnit ) ); 331 316 332 317 if ( bcodegenp ) { … … 340 325 341 326 CodeTools::fillLocations( translationUnit ); 342 CodeGen::generate( translationUnit, *output, ! noprotop, prettycodegenp, true, linemarks ); 343 344 CodeGen::FixMain::fix( *output, treep ? "../prelude/bootloader.c" : CFA_LIBDIR "/bootloader.c" ); 345 327 PASS( "codegen", CodeGen::generate( translationUnit, *output, ! noprotop, prettycodegenp, true, linemarks ) ); 328 329 CodeGen::FixMain::fix( *output, (PreludeDirector + "/bootloader.c").c_str() ); 346 330 if ( output != &cout ) { 347 331 delete output; 348 332 } // if 349 } catch ( SemanticError &e ) {333 } catch ( SemanticErrorException &e ) { 350 334 if ( errorp ) { 351 335 cerr << "---AST at error:---" << endl; … … 353 337 cerr << endl << "---End of AST, begin error message:---\n" << endl; 354 338 } // if 355 e.print( cerr);339 e.print(); 356 340 if ( output != &cout ) { 357 341 delete output; … … 371 355 } // if 372 356 return 1; 373 } // try 357 } catch(...) { 358 std::exception_ptr eptr = std::current_exception(); 359 try { 360 if (eptr) { 361 std::rethrow_exception(eptr); 362 } 363 else { 364 std::cerr << "Exception Uncaught and Unkown" << std::endl; 365 } 366 } catch(const std::exception& e) { 367 std::cerr << "Unaught Exception \"" << e.what() << "\"\n"; 368 } 369 return 1; 370 }// try 374 371 375 372 deleteAll( translationUnit ); 373 if(!libcfap && !treep) HeapStats::printStats(); 376 374 return 0; 377 375 } // main 378 376 379 377 void parse_cmdline( int argc, char * argv[], const char *& filename ) { 380 enum { Ast, Bbox, Bresolver, CtorInitFix, DeclStats, Expr, ExprAlt, Grammar, LibCFA, Linemarks, Nolinemarks, Nopreamble, Parse, Pr ototypes, Resolver, Symbol, Tree, TupleExpansion, Validate, };378 enum { Ast, Bbox, Bresolver, CtorInitFix, DeclStats, Expr, ExprAlt, Grammar, LibCFA, Linemarks, Nolinemarks, Nopreamble, Parse, PreludeDir, Prototypes, Resolver, Symbol, Tree, TupleExpansion, Validate, }; 381 379 382 380 static struct option long_opts[] = { … … 394 392 { "no-preamble", no_argument, 0, Nopreamble }, 395 393 { "parse", no_argument, 0, Parse }, 394 { "prelude-dir", required_argument, 0, PreludeDir }, 396 395 { "no-prototypes", no_argument, 0, Prototypes }, 397 396 { "resolver", no_argument, 0, Resolver }, … … 406 405 opterr = 0; // (global) prevent getopt from printing error messages 407 406 407 bool Wsuppress = false, Werror = false; 408 408 int c; 409 while ( (c = getopt_long( argc, argv, "abBcCdefg lLmnNpqrstTvyzZD:F:", long_opts, &long_index )) != -1 ) {409 while ( (c = getopt_long( argc, argv, "abBcCdefgGlLmnNpqrstTvwW:yzZD:F:", long_opts, &long_index )) != -1 ) { 410 410 switch ( c ) { 411 411 case Ast: … … 443 443 yydebug = true; 444 444 break; 445 case 'G': // dump AST after instantiate generics 446 genericsp = true; 447 break; 445 448 case LibCFA: 446 449 case 'l': // generate libcfa.c … … 463 466 noprotop = true; 464 467 break; 468 case PreludeDir: 469 PreludeDirector = optarg; 470 break; 465 471 case 'm': // don't replace the main 466 472 nomainp = true; … … 488 494 case 'v': // dump AST after decl validation pass 489 495 validp = true; 496 break; 497 case 'w': 498 Wsuppress = true; 499 break; 500 case 'W': 501 if ( strcmp( optarg, "all" ) == 0 ) { 502 SemanticWarning_EnableAll(); 503 } else if ( strcmp( optarg, "error" ) == 0 ) { 504 Werror = true; 505 } else { 506 char * warning = optarg; 507 Severity s; 508 if ( strncmp( optarg, "no-", 3 ) == 0 ) { 509 warning += 3; 510 s = Severity::Suppress; 511 } else { 512 s = Severity::Warn; 513 } // if 514 SemanticWarning_Set( warning, s ); 515 } // if 490 516 break; 491 517 case 'y': // dump AST on error … … 509 535 assertf( false, "Unknown option: %s\n", argv[optind - 1] ); 510 536 } // if 511 #if __GNUC__ < 7 512 #else 537 #if defined(__GNUC__) && __GNUC__ >= 7 513 538 __attribute__((fallthrough)); 514 539 #endif … … 517 542 } // switch 518 543 } // while 544 545 if ( Werror ) { 546 SemanticWarning_WarningAsError(); 547 } // if 548 if ( Wsuppress ) { 549 SemanticWarning_SuppressAll(); 550 } // if 551 // for ( const auto w : WarningFormats ) { 552 // cout << w.name << ' ' << (int)w.severity << endl; 553 // } // for 519 554 } // parse_cmdline 520 555 … … 527 562 yyin = input; 528 563 yylineno = 1; 529 typedefTable.enterScope();530 564 int parseStatus = yyparse(); 531 565 -
tools/Makefile.am
rf9feab8 r90152a4 15 15 ############################################################################### 16 16 17 AUTOMAKE_OPTIONS = foreign # do not require all the GNU file names 18 17 19 CC = @BACKEND_CC@ 18 CFLAGS = -Wall -Wextra -O2 -g20 AM_CFLAGS = -Wall -Wextra -O2 -g 19 21 20 noinst_PROGRAMS = catchsig repeat22 noinst_PROGRAMS = busy catchsig repeat watchdog 21 23 24 busy_SOURCES = busy.c 25 busy_LDFLAGS = -pthread 22 26 catchsig_SOURCES = catchsig.c 23 27 repeat_SOURCES = repeat.c 28 watchdog_SOURCES = watchdog.c -
tools/Makefile.in
rf9feab8 r90152a4 92 92 build_triplet = @build@ 93 93 host_triplet = @host@ 94 noinst_PROGRAMS = catchsig$(EXEEXT) repeat$(EXEEXT) 94 noinst_PROGRAMS = busy$(EXEEXT) catchsig$(EXEEXT) repeat$(EXEEXT) \ 95 watchdog$(EXEEXT) 95 96 subdir = tools 96 97 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 97 am__aclocal_m4_deps = $(top_srcdir)/configure.ac 98 am__aclocal_m4_deps = $(top_srcdir)/automake/cfa.m4 \ 99 $(top_srcdir)/configure.ac 98 100 am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ 99 101 $(ACLOCAL_M4) … … 104 106 CONFIG_CLEAN_VPATH_FILES = 105 107 PROGRAMS = $(noinst_PROGRAMS) 108 am_busy_OBJECTS = busy.$(OBJEXT) 109 busy_OBJECTS = $(am_busy_OBJECTS) 110 busy_LDADD = $(LDADD) 111 busy_LINK = $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(busy_LDFLAGS) $(LDFLAGS) \ 112 -o $@ 106 113 am_catchsig_OBJECTS = catchsig.$(OBJEXT) 107 114 catchsig_OBJECTS = $(am_catchsig_OBJECTS) … … 110 117 repeat_OBJECTS = $(am_repeat_OBJECTS) 111 118 repeat_LDADD = $(LDADD) 119 am_watchdog_OBJECTS = watchdog.$(OBJEXT) 120 watchdog_OBJECTS = $(am_watchdog_OBJECTS) 121 watchdog_LDADD = $(LDADD) 112 122 AM_V_P = $(am__v_P_@AM_V@) 113 123 am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) … … 138 148 am__v_CCLD_0 = @echo " CCLD " $@; 139 149 am__v_CCLD_1 = 140 SOURCES = $(catchsig_SOURCES) $(repeat_SOURCES) 141 DIST_SOURCES = $(catchsig_SOURCES) $(repeat_SOURCES) 150 SOURCES = $(busy_SOURCES) $(catchsig_SOURCES) $(repeat_SOURCES) \ 151 $(watchdog_SOURCES) 152 DIST_SOURCES = $(busy_SOURCES) $(catchsig_SOURCES) $(repeat_SOURCES) \ 153 $(watchdog_SOURCES) 142 154 am__can_run_installinfo = \ 143 155 case $$AM_UPDATE_INFO_DIR in \ … … 175 187 AWK = @AWK@ 176 188 BACKEND_CC = @BACKEND_CC@ 189 BUILD_IN_TREE_FLAGS = @BUILD_IN_TREE_FLAGS@ 177 190 CC = @BACKEND_CC@ 178 191 CCAS = @CCAS@ … … 180 193 CCASFLAGS = @CCASFLAGS@ 181 194 CCDEPMODE = @CCDEPMODE@ 195 CFACC = @CFACC@ 196 CFACPP = @CFACPP@ 182 197 CFA_BACKEND_CC = @CFA_BACKEND_CC@ 183 198 CFA_BINDIR = @CFA_BINDIR@ … … 187 202 CFA_NAME = @CFA_NAME@ 188 203 CFA_PREFIX = @CFA_PREFIX@ 189 CFLAGS = -Wall -Wextra -O2 -g204 CFLAGS = @CFLAGS@ 190 205 CPP = @CPP@ 191 206 CPPFLAGS = @CPPFLAGS@ … … 196 211 DEFS = @DEFS@ 197 212 DEPDIR = @DEPDIR@ 213 DRIVER_DIR = @DRIVER_DIR@ 198 214 ECHO_C = @ECHO_C@ 199 215 ECHO_N = @ECHO_N@ … … 202 218 EXEEXT = @EXEEXT@ 203 219 GREP = @GREP@ 220 HOST_FLAGS = @HOST_FLAGS@ 204 221 INSTALL = @INSTALL@ 205 222 INSTALL_DATA = @INSTALL_DATA@ … … 211 228 LEXLIB = @LEXLIB@ 212 229 LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@ 230 LIBCFA_TARGET_DIRS = @LIBCFA_TARGET_DIRS@ 231 LIBCFA_TARGET_MAKEFILES = @LIBCFA_TARGET_MAKEFILES@ 213 232 LIBOBJS = @LIBOBJS@ 214 233 LIBS = @LIBS@ 215 234 LTLIBOBJS = @LTLIBOBJS@ 216 MACHINE_TYPE = @MACHINE_TYPE@217 MAINT = @MAINT@218 235 MAKEINFO = @MAKEINFO@ 219 236 MKDIR_P = @MKDIR_P@ … … 231 248 SHELL = @SHELL@ 232 249 STRIP = @STRIP@ 250 TARGET_HOSTS = @TARGET_HOSTS@ 233 251 VERSION = @VERSION@ 234 252 YACC = @YACC@ … … 286 304 top_builddir = @top_builddir@ 287 305 top_srcdir = @top_srcdir@ 306 AUTOMAKE_OPTIONS = foreign # do not require all the GNU file names 307 AM_CFLAGS = -Wall -Wextra -O2 -g 308 busy_SOURCES = busy.c 309 busy_LDFLAGS = -pthread 288 310 catchsig_SOURCES = catchsig.c 289 311 repeat_SOURCES = repeat.c 312 watchdog_SOURCES = watchdog.c 290 313 all: all-am 291 314 292 315 .SUFFIXES: 293 316 .SUFFIXES: .c .o .obj 294 $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@$(srcdir)/Makefile.am $(am__configure_deps)317 $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) 295 318 @for dep in $?; do \ 296 319 case '$(am__configure_deps)' in \ … … 316 339 cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh 317 340 318 $(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@$(am__configure_deps)341 $(top_srcdir)/configure: $(am__configure_deps) 319 342 cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh 320 $(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@$(am__aclocal_m4_deps)343 $(ACLOCAL_M4): $(am__aclocal_m4_deps) 321 344 cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh 322 345 $(am__aclocal_m4_deps): … … 324 347 clean-noinstPROGRAMS: 325 348 -test -z "$(noinst_PROGRAMS)" || rm -f $(noinst_PROGRAMS) 349 350 busy$(EXEEXT): $(busy_OBJECTS) $(busy_DEPENDENCIES) $(EXTRA_busy_DEPENDENCIES) 351 @rm -f busy$(EXEEXT) 352 $(AM_V_CCLD)$(busy_LINK) $(busy_OBJECTS) $(busy_LDADD) $(LIBS) 326 353 327 354 catchsig$(EXEEXT): $(catchsig_OBJECTS) $(catchsig_DEPENDENCIES) $(EXTRA_catchsig_DEPENDENCIES) … … 333 360 $(AM_V_CCLD)$(LINK) $(repeat_OBJECTS) $(repeat_LDADD) $(LIBS) 334 361 362 watchdog$(EXEEXT): $(watchdog_OBJECTS) $(watchdog_DEPENDENCIES) $(EXTRA_watchdog_DEPENDENCIES) 363 @rm -f watchdog$(EXEEXT) 364 $(AM_V_CCLD)$(LINK) $(watchdog_OBJECTS) $(watchdog_LDADD) $(LIBS) 365 335 366 mostlyclean-compile: 336 367 -rm -f *.$(OBJEXT) … … 339 370 -rm -f *.tab.c 340 371 372 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/busy.Po@am__quote@ 341 373 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/catchsig.Po@am__quote@ 342 374 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/repeat.Po@am__quote@ 375 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/watchdog.Po@am__quote@ 343 376 344 377 .c.o: -
tools/prettyprinter/Makefile.am
rf9feab8 r90152a4 1 1 ######################## -*- Mode: Makefile-Automake -*- ###################### 2 ## 2 ## 3 3 ## Cforall Version 1.0.0 Copyright (C) 2015 University of Waterloo 4 4 ## 5 5 ## The contents of this file are covered under the licence agreement in the 6 6 ## file "LICENCE" distributed with Cforall. 7 ## 8 ## Makefile.am -- 9 ## 7 ## 8 ## Makefile.am -- 9 ## 10 10 ## Author : Peter A. Buhr 11 11 ## Created On : Wed Jun 28 12:07:10 2017 12 12 ## Last Modified By : Peter A. Buhr 13 ## Last Modified On : Wed Jun 28 23:11:56 201714 ## Update Count : 1513 ## Last Modified On : Mon Apr 16 09:43:23 2018 14 ## Update Count : 20 15 15 ############################################################################### 16 17 AUTOMAKE_OPTIONS = foreign # do not require all the GNU file names 16 18 17 19 BUILT_SOURCES = parser.hh -
tools/prettyprinter/Makefile.in
rf9feab8 r90152a4 95 95 subdir = tools/prettyprinter 96 96 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 97 am__aclocal_m4_deps = $(top_srcdir)/configure.ac 97 am__aclocal_m4_deps = $(top_srcdir)/automake/cfa.m4 \ 98 $(top_srcdir)/configure.ac 98 99 am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ 99 100 $(ACLOCAL_M4) … … 147 148 am__v_CXXLD_0 = @echo " CXXLD " $@; 148 149 am__v_CXXLD_1 = 149 @MAINTAINER_MODE_FALSE@am__skiplex = test -f $@ ||150 150 LEXCOMPILE = $(LEX) $(AM_LFLAGS) $(LFLAGS) 151 151 AM_V_LEX = $(am__v_LEX_@AM_V@) … … 154 154 am__v_LEX_1 = 155 155 YLWRAP = $(top_srcdir)/automake/ylwrap 156 @MAINTAINER_MODE_FALSE@am__skipyacc = test -f $@ ||157 156 am__yacc_c2h = sed -e s/cc$$/hh/ -e s/cpp$$/hpp/ -e s/cxx$$/hxx/ \ 158 157 -e s/c++$$/h++/ -e s/c$$/h/ … … 212 211 AWK = @AWK@ 213 212 BACKEND_CC = @BACKEND_CC@ 213 BUILD_IN_TREE_FLAGS = @BUILD_IN_TREE_FLAGS@ 214 214 CC = @CC@ 215 215 CCAS = @CCAS@ … … 217 217 CCASFLAGS = @CCASFLAGS@ 218 218 CCDEPMODE = @CCDEPMODE@ 219 CFACC = @CFACC@ 220 CFACPP = @CFACPP@ 219 221 CFA_BACKEND_CC = @CFA_BACKEND_CC@ 220 222 CFA_BINDIR = @CFA_BINDIR@ … … 233 235 DEFS = @DEFS@ 234 236 DEPDIR = @DEPDIR@ 237 DRIVER_DIR = @DRIVER_DIR@ 235 238 ECHO_C = @ECHO_C@ 236 239 ECHO_N = @ECHO_N@ … … 239 242 EXEEXT = @EXEEXT@ 240 243 GREP = @GREP@ 244 HOST_FLAGS = @HOST_FLAGS@ 241 245 INSTALL = @INSTALL@ 242 246 INSTALL_DATA = @INSTALL_DATA@ … … 248 252 LEXLIB = @LEXLIB@ 249 253 LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@ 254 LIBCFA_TARGET_DIRS = @LIBCFA_TARGET_DIRS@ 255 LIBCFA_TARGET_MAKEFILES = @LIBCFA_TARGET_MAKEFILES@ 250 256 LIBOBJS = @LIBOBJS@ 251 257 LIBS = @LIBS@ 252 258 LTLIBOBJS = @LTLIBOBJS@ 253 MACHINE_TYPE = @MACHINE_TYPE@254 MAINT = @MAINT@255 259 MAKEINFO = @MAKEINFO@ 256 260 MKDIR_P = @MKDIR_P@ … … 268 272 SHELL = @SHELL@ 269 273 STRIP = @STRIP@ 274 TARGET_HOSTS = @TARGET_HOSTS@ 270 275 VERSION = @VERSION@ 271 276 YACC = @YACC@ … … 323 328 top_builddir = @top_builddir@ 324 329 top_srcdir = @top_srcdir@ 330 AUTOMAKE_OPTIONS = foreign # do not require all the GNU file names 325 331 BUILT_SOURCES = parser.hh 326 332 AM_YFLAGS = -d -t -v … … 341 347 .SUFFIXES: 342 348 .SUFFIXES: .cc .ll .o .obj .yy 343 $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@$(srcdir)/Makefile.am $(am__configure_deps)349 $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) 344 350 @for dep in $?; do \ 345 351 case '$(am__configure_deps)' in \ … … 365 371 cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh 366 372 367 $(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@$(am__configure_deps)373 $(top_srcdir)/configure: $(am__configure_deps) 368 374 cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh 369 $(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@$(am__aclocal_m4_deps)375 $(ACLOCAL_M4): $(am__aclocal_m4_deps) 370 376 cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh 371 377 $(am__aclocal_m4_deps): -
tools/prettyprinter/lex.ll
rf9feab8 r90152a4 10 10 * Created On : Sat Dec 15 11:45:59 2001 11 11 * Last Modified By : Peter A. Buhr 12 * Last Modified On : T ue Aug 29 17:33:36 201713 * Update Count : 2 6812 * Last Modified On : Thu May 31 08:49:58 2018 13 * Update Count : 274 14 14 */ 15 15 … … 50 50 <INITIAL,C_CODE>"/*" { // C style comments */ 51 51 #if defined(DEBUG_ALL) | defined(DEBUG_COMMENT) 52 cerr << "\"/*\" : " << yytext << endl;52 cerr << "\"/*\" : " << yytext << endl; 53 53 #endif 54 if ( YYSTATE == C_CODE ) code_str += yytext;55 else comment_str += yytext;56 yy_push_state(C_COMMENT);54 if ( YYSTATE == C_CODE ) code_str += yytext; 55 else comment_str += yytext; 56 yy_push_state(C_COMMENT); 57 57 } 58 58 <C_COMMENT>(.|"\n") { // C style comments 59 59 #if defined(DEBUG_ALL) | defined(DEBUG_COMMENT) 60 cerr << "<C_COMMENT>(.|\\n) : " << yytext << endl;60 cerr << "<C_COMMENT>(.|\\n) : " << yytext << endl; 61 61 #endif 62 if ( yy_top_state() == C_CODE ) code_str += yytext;63 else comment_str += yytext;62 if ( yy_top_state() == C_CODE ) code_str += yytext; 63 else comment_str += yytext; 64 64 } 65 65 <C_COMMENT>"*/" { // C style comments … … 77 77 } 78 78 79 <INITIAL,C_CODE>"//"[^\n]* "\n" {// C++ style comments79 <INITIAL,C_CODE>"//"[^\n]* { // C++ style comments 80 80 #if defined(DEBUG_ALL) | defined(DEBUG_COMMENT) 81 81 cerr << "\"//\"[^\\n]*\"\n\" : " << yytext << endl; … … 123 123 <C_CODE>"%}" { RETURN_TOKEN( RCURL ) } 124 124 125 ^"%union" { RETURN_TOKEN( UNION ) } 126 ^"%start" { RETURN_TOKEN( START ) } 127 ^"%token" { RETURN_TOKEN( TOKEN ) } 128 ^"%type" { RETURN_TOKEN( TYPE ) } 129 ^"%left" { RETURN_TOKEN( LEFT ) } 130 ^"%right" { RETURN_TOKEN( RIGHT ) } 131 ^"%nonassoc" { RETURN_TOKEN( NONASSOC ) } 132 ^"%precedence" { RETURN_TOKEN( PRECEDENCE ) } 125 ^"%define"[^\n]*"\n" { RETURN_TOKEN( DEFINE ) } 126 ^"%expect" { RETURN_TOKEN( EXPECT ) } 127 ^"%left" { RETURN_TOKEN( LEFT ) } 128 ^"%locations" { RETURN_TOKEN( LOCATIONS ) } 129 ^"%nonassoc" { RETURN_TOKEN( NONASSOC ) } 130 ^"%precedence" { RETURN_TOKEN( PRECEDENCE ) } 133 131 ^"%pure_parser" { RETURN_TOKEN( PURE_PARSER ) } 132 ^"%right" { RETURN_TOKEN( RIGHT ) } 134 133 ^"%semantic_parser" { RETURN_TOKEN( SEMANTIC_PARSER ) } 135 ^"%expect" { RETURN_TOKEN( EXPECT ) } 136 ^"%thong" { RETURN_TOKEN( THONG ) } 134 ^"%start" { RETURN_TOKEN( START ) } 135 ^"%thong" { RETURN_TOKEN( THONG ) } 136 ^"%token" { RETURN_TOKEN( TOKEN ) } 137 ^"%type" { RETURN_TOKEN( TYPE ) } 138 ^"%union" { RETURN_TOKEN( UNION ) } 137 139 138 "%prec" { RETURN_TOKEN( PREC ) }140 "%prec" { RETURN_TOKEN( PREC ) } 139 141 140 {integer} { RETURN_TOKEN( INTEGER ); }141 [']{c_char}['] { RETURN_TOKEN( CHARACTER ); }142 {identifier} { RETURN_TOKEN( IDENTIFIER ); }142 {integer} { RETURN_TOKEN( INTEGER ); } 143 [']{c_char}['] { RETURN_TOKEN( CHARACTER ); } 144 {identifier} { RETURN_TOKEN( IDENTIFIER ); } 143 145 144 146 <C_CODE>["]{s_char}*["] { // hide braces "{}" in strings … … 160 162 %% 161 163 void lexC(void) { 162 BEGIN(C_CODE);164 BEGIN(C_CODE); 163 165 } 164 166 165 167 string lexYacc(void) { 166 BEGIN(INITIAL);167 //cerr << "CODE: " << endl << code_str << endl;168 string temp( code_str );169 code_str = "";170 return temp;168 BEGIN(INITIAL); 169 //cerr << "CODE: " << endl << code_str << endl; 170 string temp( code_str ); 171 code_str = ""; 172 return temp; 171 173 } 172 174 -
tools/prettyprinter/parser.yy
rf9feab8 r90152a4 10 10 // Created On : Sat Dec 15 13:44:21 2001 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Tue Aug 29 16:34:10 201713 // Update Count : 10 4712 // Last Modified On : Sun Apr 15 21:40:30 2018 13 // Update Count : 1052 14 14 // 15 15 … … 61 61 %token<tokenp> CODE // C code 62 62 63 %token<tokenp> START // %start 64 %token<tokenp> UNION // %union 65 %token<tokenp> TOKEN // %token 63 %token<tokenp> DEFINE // %define 64 %token<tokenp> EXPECT // %expect 66 65 %token<tokenp> LEFT // %left 67 %token<tokenp> RIGHT // %right66 %token<tokenp> LOCATIONS // %locations 68 67 %token<tokenp> NONASSOC // %nonassoc 69 68 %token<tokenp> PRECEDENCE // %precedence 69 %token<tokenp> PURE_PARSER // %pure_parser 70 %token<tokenp> RIGHT // %right 71 %token<tokenp> SEMANTIC_PARSER // %semantic_parser 72 %token<tokenp> START // %start 73 %token<tokenp> THONG // %thong 74 %token<tokenp> TOKEN // %token 70 75 %token<tokenp> TYPE // %type 71 %token<tokenp> PURE_PARSER // %pure_parser 72 %token<tokenp> SEMANTIC_PARSER // %semantic_parser 73 %token<tokenp> EXPECT // %expect 74 %token<tokenp> THONG // %thong 76 %token<tokenp> UNION // %union 75 77 76 78 %token<tokenp> PREC // %prec 77 79 78 %token END_TERMINALS// ALL TERMINAL TOKEN NAMES MUST APPEAR BEFORE THIS80 %token END_TERMINALS // ALL TERMINAL TOKEN NAMES MUST APPEAR BEFORE THIS 79 81 80 82 %type<tokenp> sections 81 %token _SECTIONS83 %token _SECTIONS 82 84 %type<tokenp> mark 83 85 %type<tokenp> defsection_opt 84 %token _DEFSECTION_OPT86 %token _DEFSECTION_OPT 85 87 %type<tokenp> declarations 86 88 %type<tokenp> literalblock 87 %token _LITERALBLOCK89 %token _LITERALBLOCK 88 90 %type<tokenp> declaration 89 %token _DECLARATION91 %token _DECLARATION 90 92 %type<tokenp> union 91 93 %type<tokenp> rword 92 94 %type<tokenp> tag_opt 93 %token _TAG_OPT95 %token _TAG_OPT 94 96 %type<tokenp> namenolist 95 %token _NAMENOLIST97 %token _NAMENOLIST 96 98 %type<tokenp> nameno 97 %token _NAMENO99 %token _NAMENO 98 100 %type<tokenp> namelist 99 %token _NAMELIST101 %token _NAMELIST 100 102 %type<tokenp> name 101 103 %type<tokenp> rulesection 102 %token _RULESECTION104 %token _RULESECTION 103 105 %type<tokenp> rules 104 %token _RULE106 %token _RULE 105 107 %type<tokenp> lhs 106 %token _LHS108 %token _LHS 107 109 %type<tokenp> rhs 108 %token _RHS110 %token _RHS 109 111 %type<tokenp> prod 110 112 %type<tokenp> prec 111 %token _PREC113 %token _PREC 112 114 %type<tokenp> action 113 %token _ACTION115 %token _ACTION 114 116 %type<tokenp> usersection_opt 115 %token _USERSECTION_OPT117 %token _USERSECTION_OPT 116 118 %type<tokenp> ccode_opt 117 119 %type<tokenp> blocks … … 234 236 $$ = $1; 235 237 } 238 | DEFINE // bison 239 | LOCATIONS 236 240 | THONG // bison 237 241 ; -
tools/prettyprinter/test.y
rf9feab8 r90152a4 6 6 7 7 /* adsad2 */ 8 8 %locations 9 %define parse.error verbose 9 10 %% 10 11 -
tools/repeat.c
rf9feab8 r90152a4 26 26 if(print_iterations) { 27 27 printf("\r%d / %d", i, repetitions); 28 fflush(stdout); 28 29 } 29 30 int retcode = run(); … … 47 48 fprintf(out, "Repeat CMD N times\n\n"); 48 49 fprintf(out, "\t-h,--help\tprint this usage message\n"); 49 fprintf(out, "\t-s\tstop on error\n"); 50 fprintf(out, "\t-i\toutput iterations instead of CMD stdout\n"); 51 fprintf(out, "\t-x\tprint CMD before running it\n"); 50 fprintf(out, "\t-s\t\tstop on error\n"); 51 fprintf(out, "\t-i\t\toutput iterations instead of CMD stdout\n"); 52 fprintf(out, "\t-x\t\tprint CMD before running it\n"); 53 fprintf(out, "\t-a FILE\t\tredirect output of command to append to FILE\n"); 54 fprintf(out, "\t-r FILE\t\tredirect output of command to FILE\n"); 52 55 exit(code); 53 56 } … … 55 58 char ** cmd_to_run = NULL; 56 59 bool print_cmd = false; 60 bool redirect = false; 61 bool redirect_append = false; 62 char * redirect_to = "/dev/null"; 57 63 pid_t child_pid = 0; 58 64 … … 73 79 74 80 int c; 75 while ( (c = getopt_long( argc, argv, " hsxi", long_opts, &long_index)) != -1 ) {81 while ( (c = getopt_long( argc, argv, "ahirsx", long_opts, &long_index)) != -1 ) { 76 82 switch ( c ) { 77 83 case Help: … … 87 93 case 'i': 88 94 print_iterations = true; 95 break; 96 case 'a': 97 if(redirect) { fprintf(stderr, "Cannot have -a and -r\n"); error(); } 98 redirect_append = true; 99 redirect_to = argv[optind]; 100 optind++; 101 break; 102 case 'r': 103 if(redirect_append) { fprintf(stderr, "Cannot have -a and -r\n"); error(); } 104 redirect = true; 105 redirect_to = argv[optind]; 106 optind++; 89 107 break; 90 108 default: … … 142 160 printf("\n"); 143 161 } 144 if(print_iterations ) {162 if(print_iterations || redirect || redirect_append) { 145 163 __attribute__((unused)) FILE * ignore = 146 freopen( "/dev/null", "w", stdout);164 freopen(redirect_to, redirect_append ? "a" : "w" , stdout); 147 165 } 148 166 execvp ( *cmd_to_run, cmd_to_run);
Note:
See TracChangeset
for help on using the changeset viewer.