MAINTAINERS: Remove chill maintainers.

* MAINTAINERS: Remove chill maintainers.
	* Makefile.in (CHILLFLAGS): Remove.
	(CHILL_LIB): Remove.
	(TARGET_CONFIGDIRS): Remove libchill.
	(CHILL_FOR_TARGET): Remove.
	(BASE_FLAGS_TO_PASS): Don't pass CHILLFLAGS, CHILL_FOR_TARGET, or
	CHILL_LIB.
	(CONFIGURE_TARGET_MODULES): Remove configure-target-libchill.
	(CHECK_TARGET_MODULES): Likewise.
	(INSTALL_TARGET_MODULES): Likewise.
	(CLEAN_TARGET_MODULES): Likewise.
	(configure-target-libchill): Remove.
	(all-target-libchill): Remove.
	* configure.in (target_libs): Remove target-libchill.
	Do not compute CHILL_FOR_TARGET.
	* libchill: Remove directory.

	Remove Chill front end.
	* gcc.c (default_compilers): Remove Chill entries.
	* ch: Remove directory.
	* doc/frontends.texi: Remove information about Chill.
	* doc/sourcebuild.texi: Likewise.
	* doc/standards.texi: Likewise.

	* testsuite/lib/chill.exp: Remove.

	* g77.texi: Remove Chill reference.

	* gcc_release (build_tarfiles): Do not build Chill tarfiles.
	(CHILL_DIRS): Remove.

From-SVN: r52327
This commit is contained in:
Mark Mitchell 2002-04-15 20:19:23 +00:00 committed by Mark Mitchell
parent 41823c5eb7
commit 07cdae91c9
50 changed files with 47 additions and 57079 deletions

View File

@ -1,4 +1,22 @@
2002-04-15 Mark Mitchell <mark@codesourcery.com>
* MAINTAINERS: Remove chill maintainers.
* Makefile.in (CHILLFLAGS): Remove.
(CHILL_LIB): Remove.
(TARGET_CONFIGDIRS): Remove libchill.
(CHILL_FOR_TARGET): Remove.
(BASE_FLAGS_TO_PASS): Don't pass CHILLFLAGS, CHILL_FOR_TARGET, or
CHILL_LIB.
(CONFIGURE_TARGET_MODULES): Remove configure-target-libchill.
(CHECK_TARGET_MODULES): Likewise.
(INSTALL_TARGET_MODULES): Likewise.
(CLEAN_TARGET_MODULES): Likewise.
(configure-target-libchill): Remove.
(all-target-libchill): Remove.
* configure.in (target_libs): Remove target-libchill.
Do not compute CHILL_FOR_TARGET.
* libchill: Remove directory.
2002-04-11 DJ Delorie <dj@redhat.com>
* Makefile.in, configure.in: Sync with binutils, entries

View File

@ -77,8 +77,6 @@ fortran Richard Henderson rth@redhat.com
fortran Toon Moene toon@moene.indiv.nluug.nl
c++ Jason Merrill jason@redhat.com
c++ Mark Mitchell mark@codesourcery.com
chill Dave Brolley brolley@redhat.com
chill Per Bothner per@bothner.com
cpplib Dave Brolley brolley@redhat.com
cpplib Per Bothner per@bothner.com
cpplib Zack Weinberg zack@codesourcery.com

View File

@ -100,8 +100,6 @@ LIBCFLAGS_FOR_TARGET = $(CFLAGS_FOR_TARGET)
PICFLAG =
PICFLAG_FOR_TARGET =
CHILLFLAGS = $(CFLAGS)
CHILL_LIB = -lchill
CXX = c++
# Use -O2 to stress test the compiler.
@ -178,7 +176,7 @@ OTHERS =
# This is set by the configure script to the list of directories which
# should be built using the target tools.
TARGET_CONFIGDIRS = libiberty libgloss $(SPECIAL_LIBS) newlib librx winsup opcodes bsp libstub cygmon libf2c libchill libobjc
TARGET_CONFIGDIRS = libiberty libgloss $(SPECIAL_LIBS) newlib librx winsup opcodes bsp libstub cygmon libf2c libobjc
# Target libraries are put under this directory:
# Changed by configure to $(target_alias) if cross.
@ -235,7 +233,6 @@ INSTALL_TARGET_CROSS = installdirs \
# Should be substed by configure.in
FLAGS_FOR_TARGET =
CC_FOR_TARGET =
CHILL_FOR_TARGET =
CXX_FOR_TARGET =
CXX_FOR_TARGET_FOR_RECURSIVE_MAKE =
GCJ_FOR_TARGET =
@ -359,9 +356,6 @@ BASE_FLAGS_TO_PASS = \
"CC_FOR_TARGET=$(CC_FOR_TARGET)" \
"CFLAGS=$(CFLAGS)" \
"CFLAGS_FOR_TARGET=$(CFLAGS_FOR_TARGET)" \
"CHILLFLAGS=$(CHILLFLAGS)" \
"CHILL_FOR_TARGET=$(CHILL_FOR_TARGET)" \
"CHILL_LIB=$(CHILL_LIB)" \
"GCJ_FOR_TARGET=$(GCJ_FOR_TARGET)" \
"CXX_FOR_BUILD=$(CXX_FOR_BUILD)" \
"CXXFLAGS=$(CXXFLAGS)" \
@ -789,7 +783,6 @@ ALL_TARGET_MODULES = \
all-target-librx \
all-target-newlib \
all-target-libf2c \
all-target-libchill \
all-target-libobjc \
all-target-libtermcap \
all-target-winsup \
@ -813,7 +806,6 @@ CONFIGURE_TARGET_MODULES = \
configure-target-librx \
configure-target-newlib \
configure-target-libf2c \
configure-target-libchill \
configure-target-libobjc \
configure-target-libtermcap \
configure-target-winsup \
@ -836,7 +828,6 @@ CHECK_TARGET_MODULES = \
check-target-libstdc++-v3 \
check-target-newlib \
check-target-libf2c \
check-target-libchill \
check-target-libobjc \
check-target-winsup \
check-target-libiberty \
@ -853,7 +844,6 @@ INSTALL_TARGET_MODULES = \
install-target-libstdc++-v3 \
install-target-newlib \
install-target-libf2c \
install-target-libchill \
install-target-libobjc \
install-target-libtermcap \
install-target-winsup \
@ -942,7 +932,6 @@ CLEAN_TARGET_MODULES = \
clean-target-librx \
clean-target-newlib \
clean-target-libf2c \
clean-target-libchill \
clean-target-libobjc \
clean-target-winsup \
clean-target-libgloss \
@ -1787,8 +1776,6 @@ all-target-libstub: configure-target-libstub
all-libtool:
configure-target-libf2c: $(ALL_GCC_C)
all-target-libf2c: configure-target-libf2c all-target-libiberty
configure-target-libchill: $(ALL_GCC_C)
all-target-libchill: configure-target-libchill all-target-libiberty
configure-target-libobjc: $(ALL_GCC_C)
all-target-libobjc: configure-target-libobjc all-target-libiberty
all-m4: all-libiberty all-texinfo

View File

@ -73,7 +73,6 @@ target_libs="target-libiberty \
target-librx \
${libstdcxx_version} \
target-libf2c \
target-libchill \
${libgcj}
target-libobjc"
@ -1526,20 +1525,6 @@ case $CC_FOR_TARGET in
*) CC_FOR_TARGET=$CC_FOR_TARGET' $(FLAGS_FOR_TARGET)' ;;
esac
if test "x${CHILL_FOR_TARGET+set}" = xset; then
:
elif test -d ${topsrcdir}/gcc; then
CHILL_FOR_TARGET='$$r/gcc/xgcc -B$$r/gcc/ -L$$r/gcc/ch/runtime/'
elif test "$host" = "$target"; then
CHILL_FOR_TARGET='$(CC)'
else
CHILL_FOR_TARGET=`echo gcc | sed -e 's/x/x/' ${program_transform_name}`
fi
case $CHILL_FOR_TARGET in
*' $(FLAGS_FOR_TARGET)') ;;
*) CHILL_FOR_TARGET=$CHILL_FOR_TARGET' $(FLAGS_FOR_TARGET)' ;;
esac
if test "x${GCJ_FOR_TARGET+set}" = xset; then
:
elif test -d ${topsrcdir}/gcc; then
@ -1586,7 +1571,6 @@ s:^TARGET_CONFIGDIRS[ ]*=.*$:TARGET_CONFIGDIRS = ${target_configdirs}:
s%^TARGET_CONFIGARGS[ ]*=.*$%TARGET_CONFIGARGS = ${targargs}%
s%^FLAGS_FOR_TARGET[ ]*=.*$%FLAGS_FOR_TARGET = ${FLAGS_FOR_TARGET}%
s%^CC_FOR_TARGET[ ]*=.*$%CC_FOR_TARGET = ${CC_FOR_TARGET}%
s%^CHILL_FOR_TARGET[ ]*=.*$%CHILL_FOR_TARGET = ${CHILL_FOR_TARGET}%
s%^GCJ_FOR_TARGET[ ]*=.*$%GCJ_FOR_TARGET = ${GCJ_FOR_TARGET}%
s%^CXX_FOR_TARGET[ ]*=.*$%CXX_FOR_TARGET = ${qCXX_FOR_TARGET}%
s%^CXX_FOR_TARGET_FOR_RECURSIVE_MAKE[ ]*=.*$%CXX_FOR_TARGET_FOR_RECURSIVE_MAKE = ${qqCXX_FOR_TARGET}%

View File

@ -1,3 +1,12 @@
2002-04-15 Mark Mitchell <mark@codesourcery.com>
Remove Chill front end.
* gcc.c (default_compilers): Remove Chill entries.
* ch: Remove directory.
* doc/frontends.texi: Remove information about Chill.
* doc/sourcebuild.texi: Likewise.
* doc/standards.texi: Likewise.
2002-04-15 Douglas B Rupp <rupp@gnat.com>
* config/alpha/vms.h (INCLUDE_DEFAULTS): Add /gnu/lib/gcc-lib/include.

File diff suppressed because it is too large Load Diff

View File

@ -1,184 +0,0 @@
# Top level Makefile fragment for GNU CHILL.
# Copyright (C) 1994, 1998, 2000 Free Software Foundation, Inc.
#This file is part of GNU CC.
#GNU CC is free software; you can redistribute it and/or modify
#it under the terms of the GNU General Public License as published by
#the Free Software Foundation; either version 2, or (at your option)
#any later version.
#GNU CC is distributed in the hope that it will be useful,
#but WITHOUT ANY WARRANTY; without even the implied warranty of
#MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
#GNU General Public License for more details.
#You should have received a copy of the GNU General Public License
#along with GNU CC; see the file COPYING. If not, write to
#the Free Software Foundation, 59 Temple Place - Suite 330,
#Boston, MA 02111-1307, USA. */
# This file provides the language dependent support in the main Makefile.
# Each language makefile fragment must provide the following targets:
#
# foo.all.build, foo.all.cross, foo.start.encap, foo.rest.encap,
# foo.info, foo.dvi,
# foo.install-normal, foo.install-common, foo.install-info, foo.install-man,
# foo.uninstall,
# foo.mostlyclean, foo.clean, foo.distclean, foo.extraclean,
# foo.maintainer-clean, foo.stage1, foo.stage2, foo.stage3, foo.stage4
#
# where `foo' is the name of the language.
#
# It should also provide rules for:
#
# - making any compiler driver (eg: g++)
# - the compiler proper (eg: cc1plus)
# - define the names for selecting the language in LANGUAGES.
#
# define version of GNUCHILL compiler. Note: maybe we have to change the
# mechanism
GNUCHILL_VERSION = 1.5.2
# Actual names to use when installing a native compiler.
# (Cygnus configure overrides these when using -program-transform-name).
CHILL_INSTALL_NAME = chill
# Actual names to use when installing a cross-compiler.
# (Cygnus configure overrides these when using -program-transform-name).
CHILL_CROSS_NAME = $(target_alias)-chill
CHILL_SRCS = $(srcdir)/ch/actions.c $(srcdir)/ch/convert.c \
$(srcdir)/ch/decl.c $(srcdir)/ch/except.c $(srcdir)/ch/expr.c \
$(srcdir)/ch/grant.c $(srcdir)/ch/inout.c $(srcdir)/ch/lang.c \
$(srcdir)/ch/lex.c $(srcdir)/ch/loop.c \
$(srcdir)/ch/parse.c $(srcdir)/ch/satisfy.c \
$(srcdir)/ch/tasking.c $(srcdir)/ch/timing.c $(srcdir)/ch/tree.c \
$(srcdir)/ch/typeck.c
# Extra flags to pass to recursive makes.
CHILL_FLAGS_TO_PASS = \
"CHILLFLAGS=$(CHILLFLAGS)" \
"CHILL_FOR_TARGET=$(CHILL_FOR_TARGET)" \
"CHILL_LIB=$(CHILL_LIB)" \
"GNUCHILL_VERSION=$(GNUCHILL_VERSION)"
#
# Define the names for selecting languages in LANGUAGES.
CHILL: chill cc1chill$(exeext)
# handle startfile in chill script and build script to install
chill: $(srcdir)/ch/chill.in Makefile
thisdir=`pwd` ; \
sed -e "s:startfile=chillrt0:startfile=$${thisdir}/ch/runtime/chillrt0.o:" \
-e "s:libpath=chillrt:libpath=-L$${thisdir}/ch/runtime/:" \
-e "s:whatgcc=gcc:whatgcc=\"$${thisdir}/xgcc$(exeext) -B$${thisdir}/\":" \
-e "s:gnuchill_version=unknown:gnuchill_version=$(GNUCHILL_VERSION):" \
-e "s:gnuchill_script_flags=:gnuchill_script_flags=\"$(GNUCHILL_SCRIPT_FLAGS)\":" $(srcdir)/ch/chill.in > chill ; \
chmod a+x chill ; \
if [ -f ../gcc-cross$(exeext) ]; then \
whatgcc=$(GCC_CROSS_NAME) ; \
else \
whatgcc=$(GCC_INSTALL_NAME) ; \
fi; \
sed -e "s:startfile=chillrt0:startfile=$(libsubdir)/chillrt0.o:" \
-e "s:whatgcc=gcc:whatgcc=$(bindir)/$${whatgcc}:" \
-e "s:gnuchill_version=unknown:gnuchill_version=$(GNUCHILL_VERSION):" \
-e "s:libpath=chillrt:libpath=:" \
-e "s:gnuchill_script_flags=:gnuchill_script_flags=\"$(GNUCHILL_SCRIPT_FLAGS)\":" $(srcdir)/ch/chill.in > chill.install ; \
chmod a+x chill.install
# Don't depend on cc1chill$(exeext), because chill-cross is always built for cross,
# and thus a cc1chill$(exeext) dependence would force cc1chill$(exeext) to always be built.
# Note that gcc-cross and g++-cross do not have cc1 or cc1plus dependencies.
chill-cross: $(srcdir)/ch/chill.in
touch $@
cc1chill$(exeext): $(P) $(CHILL_SRCS) $(LIBDEPS) $(BACKEND) \
insn-config.h insn-flags.h insn-attr.h insn-codes.h \
attribs.o c-typeck.o c-aux-info.o c-common.o \
ggc-callbacks.o
cd ch; $(MAKE) $(LANG_FLAGS_TO_PASS) $(CHILL_FLAGS_TO_PASS) ../cc1chill$(exeext)
#
# Build hooks:
CHILL.all.build: chill
CHILL.all.cross: chill-cross
CHILL.start.encap: chill
CHILL.rest.encap:
CHILL.dvi: ch/chill.dvi
CHILL.generated-manpages:
CHILL.info: $(srcdir)/ch/chill.info
$(srcdir)/ch/chill.info: $(srcdir)/ch/chill.texi
cd $(srcdir)/ch && $(MAKEINFO) -o chill.info chill.texi
ch/chill.dvi: $(srcdir)/ch/chill.texi
s=`cd $(srcdir); pwd`; export s; \
cd ch && $(TEXI2DVI) $$s/ch/chill.texi
#
# Install hooks:
# cc1chill is installed elsewhere as part of $(COMPILERS).
CHILL.install-normal:
# Install the driver program
CHILL.install-common: installdirs
-if [ -f cc1chill$(exeext) ] ; then \
if [ -f chill.install ] ; then \
if [ -f gcc-cross$(exeext) ]; then \
rm -f $(bindir)/$(CHILL_CROSS_NAME); \
$(INSTALL_SCRIPT) chill.install $(bindir)/$(CHILL_CROSS_NAME); \
chmod a+x $(bindir)/$(CHILL_CROSS_NAME); \
else \
rm -f $(bindir)/$(CHILL_INSTALL_NAME); \
$(INSTALL_SCRIPT) chill.install $(bindir)/$(CHILL_INSTALL_NAME); \
chmod a+x $(bindir)/$(CHILL_INSTALL_NAME); \
fi ; \
fi ; \
fi
# Don't delete $(infodir)/ch.info* unless there's actually new
# docs to install (in case LANGUAGES didn't contain chill earlier).
CHILL.install-info: installdirs
-cd $(srcdir)/ch; for i in chill.info*; do \
rm -f $(infodir)/chill.info*; \
realfile=`echo $$i | sed -e 's|.*/\([^/]*\)$$|\1|'`; \
$(INSTALL_DATA) $$i $(infodir)/$$realfile; \
done
CHILL.install-man:
CHILL.uninstall:
-rm -rf $(bindir)/$(CHILL_INSTALL_NAME)
-rm -rf $(bindir)/$(CHILL_CROSS_NAME)
#
# Clean hooks:
# A lot of the ancillary files are deleted by the main makefile.
# We just have to delete files specific to us.
CHILL.mostlyclean:
-rm -f chill.install ch/*.o ch/ch-version.c
CHILL.clean:
CHILL.distclean:
-rm -f ch/config.status ch/Makefile
CHILL.extraclean:
CHILL.maintainer-clean:
-rm -f ch/TAGS
-rm -f $(srcdir)/ch/chill.info* ch/chill.dvi ch/chill.??s ch/chill.*aux
# Delete locally created file.
-rm -f ch/hash.h
#
# Stage hooks:
# The main makefile has already created stage?/ch.
CHILL.stage1: stage1-start
-mv ch/*.o stage1/ch
CHILL.stage2: stage2-start
-mv ch/*.o stage2/ch
CHILL.stage3: stage3-start
-mv ch/*.o stage3/ch
CHILL.stage4: stage4-start
-mv ch/*.o stage4/ch

View File

@ -1,324 +0,0 @@
# Makefile for GNU CHILL compiler.
# Copyright (C) 1987, 1988, 1990, 1991, 1992, 1993, 1994, 1998,
# 1999, 2000, 2001 Free Software Foundation, Inc.
#This file is part of GNU CC.
#GNU CC is free software; you can redistribute it and/or modify
#it under the terms of the GNU General Public License as published by
#the Free Software Foundation; either version 2, or (at your option)
#any later version.
#GNU CC is distributed in the hope that it will be useful,
#but WITHOUT ANY WARRANTY; without even the implied warranty of
#MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
#GNU General Public License for more details.
#You should have received a copy of the GNU General Public License
#along with GNU CC; see the file COPYING. If not, write to
#the Free Software Foundation, 59 Temple Place - Suite 330,
#Boston, MA 02111-1307, USA. */
# The makefile built from this file lives in the language subdirectory.
# It's purpose is to provide support for:
#
# 1) recursion where necessary, and only then (building .o's), and
# 2) building and debugging cc1 from the language subdirectory, and
# 3) nothing else.
#
# The parent makefile handles all other chores, with help from the
# language makefile fragment, of course.
#
# The targets for external use are:
# all, TAGS, ???mostlyclean, ???clean.
# Suppress smart makes who think they know how to automake Yacc files
.y.c:
# Variables that exist for you to override.
# See below for how to change them for certain systems.
# Various ways of specifying flags for compilations:
# CFLAGS is for the user to override to, e.g., do a bootstrap with -O2.
# BOOT_CFLAGS is the value of CFLAGS to pass
# to the stage2 and stage3 compilations
# XCFLAGS is used for most compilations but not when using the GCC just built.
XCFLAGS =
CFLAGS = -g
BOOT_CFLAGS = -O $(CFLAGS)
# These exists to be overridden by the x-* and t-* files, respectively.
X_CFLAGS =
T_CFLAGS =
X_CPPFLAGS =
T_CPPFLAGS =
CC = @CC@
AR = ar
AR_FLAGS = rc
SHELL = /bin/sh
MAKEINFO = makeinfo
TEXI2DVI = texi2dvi
# Define this as & to perform parallel make on a Sequent.
# Note that this has some bugs, and it seems currently necessary
# to compile all the gen* files first by hand to avoid erroneous results.
P =
# This is used instead of ALL_CFLAGS when compiling with GCC_FOR_TARGET.
# It omits XCFLAGS, and specifies -B./.
# It also specifies -B$(tooldir)/ to find as and ld for a cross compiler.
GCC_CFLAGS=$(INTERNAL_CFLAGS) $(X_CFLAGS) $(T_CFLAGS) $(CFLAGS)
# Tools to use when building a cross-compiler.
# These are used because `configure' appends `cross-make'
# to the makefile when making a cross-compiler.
# We don't use cross-make. Instead we use the tools
# from the build tree, if they are available.
# program_transform_name and objdir are set by configure.in.
program_transform_name =
objdir = .
target=@target@
xmake_file=@dep_host_xmake_file@
tmake_file=@dep_tmake_file@
#version=`sed -e 's/.*\"\([^ \"]*\)[ \"].*/\1/' < $(srcdir)/version.c`
#mainversion=`sed -e 's/.*\"\([0-9]*\.[0-9]*\).*/\1/' < $(srcdir)/version.c`
# Directory where sources are, from where we are.
srcdir = @srcdir@
VPATH = @srcdir@
# Directory where texinfo.tex lives
# texidir = $(srcdir)/../../texinfo
# Top build directory, relative to here.
top_builddir = ..
# Internationalization library.
INTLLIBS = @INTLLIBS@
# Additional system libraries to link with.
CLIB=
# End of variables for you to override.
# Definition of `all' is here so that new rules inserted by sed
# do not specify the default target.
all: all.indirect
# This tells GNU Make version 3 not to put all variables in the environment.
.NOEXPORT:
# sed inserts variable overrides after the following line.
####target overrides
@target_overrides@
####host overrides
@host_overrides@
#
# Now figure out from those variables how to compile and link.
all.indirect: Makefile ../chill ../cc1chill$(exeext)
# IN_GCC distinguishes between code compiled into GCC itself and other
# programs built during a bootstrap.
# autoconf inserts -DCROSS_COMPILE if we are building a cross compiler.
INTERNAL_CFLAGS = -DIN_GCC @CROSS@
# This is the variable actually used when we compile.
ALL_CFLAGS = $(INTERNAL_CFLAGS) $(X_CFLAGS) $(T_CFLAGS) $(CFLAGS) $(XCFLAGS)
# Likewise.
ALL_CPPFLAGS = $(CPPFLAGS) $(X_CPPFLAGS) $(T_CPPFLAGS)
# This is where we get libiberty.a from.
LIBIBERTY = ../../libiberty/libiberty.a
# How to link with both our special library facilities
# and the system's installed libraries.
LIBS = $(LIBIBERTY) $(CLIB) $(INTLLIBS)
LIBDEPS = $(INTLLIBS) $(LIBIBERTY)
# Specify the directories to be searched for header files.
# Both . and srcdir are used, in that order,
# so that tm.h and config.h will be found in the compilation
# subdirectory rather than in the source directory.
INCLUDES = -I. -I.. -I$(srcdir) -I$(srcdir)/.. -I$(srcdir)/../config -I$(srcdir)/../../include
# Flags to pass to recursive makes.
# ??? $(CC) may need some work to handle stage[123].
# ??? The choices here will need some experimenting with.
FLAGS_TO_PASS = \
"AR_FLAGS=$(AR_FLAGS)" \
"AR_FOR_TARGET=$(AR_FOR_TARGET)" \
"BISON=$(BISON)" \
"BISONFLAGS=$(BISONFLAGS)" \
"CC=$(CC)" \
"CFLAGS=$(CFLAGS)" \
"GCC_FOR_TARGET=$(CC_FOR_TARGET)" \
"LDFLAGS=$(LDFLAGS)" \
"LEX=$(LEX)" \
"LEXFLAGS=$(LEXFLAGS)" \
"MAKEINFO=$(MAKEINFO)" \
"MAKEINFOFLAGS=$(MAKEINFOFLAGS)" \
"RANLIB_FOR_TARGET=$(RANLIB_FOR_TARGET)" \
"RANLIB_TEST_FOR_TARGET=$(RANLIB_TEST_FOR_TARGET)" \
"SHELL=$(SHELL)" \
"exec_prefix=$(exec_prefix)" \
"prefix=$(prefix)" \
"tooldir=$(tooldir)" \
"bindir=$(bindir)" \
"libsubdir=$(libsubdir)"
# Always use -I$(srcdir)/config when compiling.
.c.o:
$(CC) -c $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) $<
# This tells GNU make version 3 not to export all the variables
# defined in this file into the environment.
.NOEXPORT:
#
# Lists of files for various purposes.
# Language-specific object files for CHILL
CHILL_OBJS = parse.o actions.o except.o grant.o lang.o \
tree.o lex.o decl.o typeck.o convert.o expr.o loop.o \
tasking.o timing.o inout.o satisfy.o ch-version.o \
../ggc-callbacks.o
BACKEND = ../toplev.o ../libbackend.a
../cc1chill$(exeext): $(P) $(CHILL_OBJS) $(BACKEND) $(LIBDEPS)
$(CC) $(ALL_CFLAGS) $(LDFLAGS) -o $@ $(CHILL_OBJS) \
$(BACKEND) $(LIBS)
# This executable is used in the CHILL regression
# test script
utils/printf : $(srcdir)/utils/printf.c
$(CC) $(ALL_CFLAGS) $(LDFLAGS) -o $@ $<
#
# This is the top-level trigger for a CHILL regression test.
# It also builds those tools needed for CHILL regression testing.
#
check: ../cc1chill$(exeext) utils/printf
cd ..; $(MAKE) $(FLAGS_TO_PASS) xgcc gcov cpp cc1 ld
$(srcdir)/regression.sh -d -p
clean-tests:
cd testsuite/execute; $(MAKE) clean
cd testsuite/execute/oe; $(MAKE) clean
cd testsuite/compile/elektra; $(MAKE) clean
cd testsuite/compile/votrics; $(MAKE) clean
cd testsuite/compile; $(MAKE) clean
cd testsuite/noncompile; $(MAKE) clean
cd testsuite/examples; $(MAKE) clean
mostlyclean:
test -d testsuite && $(MAKE) clean-tests
rm -f *.o
clean: mostlyclean
#
Makefile: $(srcdir)/Makefile.in $(srcdir)/../configure
cd ..; $(SHELL) config.status
native: config.status ../cc1chill$(exeext) ../chill
#
# Compiling object files from source files.
# Note that dependencies on obstack.h are not written
# because that file is not part of GCC.
# CHILL language specific files.
EXPR_H = $(srcdir)/../expr.h ../insn-codes.h
RTL_H = $(srcdir)/../rtl.h $(srcdir)/../rtl.def \
$(srcdir)/../machmode.h $(srcdir)/../machmode.def
TREE_H = $(srcdir)/../tree.h $(srcdir)/../real.h $(srcdir)/../tree.def \
$(srcdir)/../machmode.h $(srcdir)/../machmode.def
CHILL_TREE_H = $(TREE_H) ch-tree.h ch-tree.def
# hash.h really depends on $(srcdir)/gperf.
# But this would screw things for people that don't have gperf,
# if gperf got touched, say.
# Thus you have to remove hash.h to force it to be re-made.
# Note: CHILL requires two sets of keywords, one all uppercase and
# one all lowercase. The hash table ends up with both sets in it.
$(srcdir)/hash.h:
sed -e '1,/^%%/d' < $(srcdir)/gperf | \
sed '/^[^a-zA-Z]/d' | tr "[a-z]" "[A-Z]" > gperf.tmp2
cat $(srcdir)/gperf gperf.tmp2 > gperf.tmp
gperf -L C -F ', 0, 0, 0' -D -E -S1 -p -j1 -i 1 -g -o -t -k'*' \
gperf.tmp > $(srcdir)/hash.h || ( \
echo "Please update your 'gperf' from ftp://ftp.gnu.org/pub/gnu/gperf/" >&2 ; \
exit 1 )
$(RM) gperf.tmp gperf.tmp2
actions.o : actions.c $(CONFIG_H) $(CHILL_TREE_H) actions.h $(RTL_H) \
lex.h $(srcdir)/../flags.h $(srcdir)/../input.h \
$(EXPR_H) $(srcdir)/../system.h $(srcdir)/../toplev.h diagnostic.h
convert.o : convert.c $(CONFIG_H) $(CHILL_TREE_H) $(srcdir)/../flags.h \
$(srcdir)/../tree.h $(srcdir)/../system.h $(srcdir)/../toplev.h \
$(srcdir)/../convert.h
decl.o : decl.c $(CONFIG_H) $(CHILL_TREE_H) $(srcdir)/../flags.h lex.h \
$(srcdir)/../system.h $(srcdir)/../toplev.h diagnostic.h
except.o : except.c $(CONFIG_H) $(srcdir)/../tree.h $(RTL_H) $(CHILL_TREE_H) \
$(srcdir)/../system.h $(srcdir)/../toplev.h
expr.o : expr.c $(CONFIG_H) $(RTL_H) $(CHILL_TREE_H) $(srcdir)/../flags.h \
$(EXPR_H) $(srcdir)/../tree.h lex.h $(srcdir)/../system.h \
$(srcdir)/../toplev.h
grant.o: grant.c $(CONFIG_H) $(CHILL_TREE_H) $(RTL_H) $(srcdir)/../flags.h \
$(srcdir)/../input.h lex.h actions.h $(srcdir)/../system.h \
$(srcdir)/../toplev.h $(srcdir)/../output.h
inout.o : inout.c $(CONFIG_H) $(CHILL_TREE_H) $(srcdir)/../flags.h \
$(srcdir)/../input.h $(srcdir)/../system.h $(srcdir)/../toplev.h
lang.o : lang.c $(CONFIG_H) $(CHILL_TREE_H) $(srcdir)/../input.h lex.h \
$(srcdir)/../system.h $(srcdir)/../toplev.h $(EXPR_H) $(RTL_H) \
$(srcdir)/../diagnostic.h
lex.o : lex.c $(CONFIG_H) $(CHILL_TREE_H) $(RTL_H) $(srcdir)/../flags.h \
$(srcdir)/../input.h $(srcdir)/parse.h $(srcdir)/../system.h \
$(srcdir)/../toplev.h lex.h hash.h
loop.o : loop.c $(CONFIG_H) $(RTL_H) $(CHILL_TREE_H) lex.h \
$(srcdir)/../flags.h $(srcdir)/../input.h \
$(srcdir)/../tree.h $(srcdir)/../system.h $(srcdir)/../toplev.h
parse.o : parse.c $(CONFIG_H) $(CHILL_TREE_H) parse.h \
lex.h actions.h tasking.h $(srcdir)/../system.h $(srcdir)/../toplev.h
satisfy.o : satisfy.c $(CONFIG_H) $(CHILL_TREE_H) $(srcdir)/../tree.h \
$(srcdir)/../flags.h lex.h $(srcdir)/../system.h $(srcdir)/../toplev.h
timing.o : timing.c $(CONFIG_H) $(CHILL_TREE_H) $(RTL_H) $(srcdir)/../flags.h \
$(srcdir)/../input.h lex.h $(srcdir)/../system.h $(srcdir)/../toplev.h
tasking.o : tasking.c $(CONFIG_H) $(CHILL_TREE_H) $(RTL_H) \
$(srcdir)/../flags.h $(srcdir)/../input.h \
lex.h $(srcdir)/../system.h $(srcdir)/../toplev.h
tree.o : tree.c $(CONFIG_H) $(CHILL_TREE_H) $(srcdir)/../system.h \
$(srcdir)/../toplev.h
typeck.o : typeck.c $(CONFIG_H) $(CHILL_TREE_H) ../insn-codes.h \
$(srcdir)/../expr.h ../insn-codes.h $(srcdir)/../flags.h lex.h \
$(srcdir)/../system.h $(srcdir)/../toplev.h $(srcdir)/../output.h
ch-version.o : ch-version.c
ch-version.c : Makefile
echo 'const char * const gnuchill_version = "$(GNUCHILL_VERSION)";' > $@
## This is ugly, but I don't want GNU make to put these variables in
## the environment. Older makes will see this as a set of targets
## with no dependencies and no actions.
unexport CHILLFLAGS CHILL_LIB CHILL_FOR_TARGET :
#
# These exist for maintenance purposes.
# Update the tags table.
TAGS: force
cd $(srcdir); \
etags *.y *.h *.c *.l ../*.h ../*.c; \
.PHONY: TAGS
force:

View File

@ -1,43 +0,0 @@
This directory contains the GNU front-end for the Chill language,
contributed by Cygnus Solutions.
Chill is the "CCITT High-Level Language", where CCITT is the old
name for what is now ITU, the International Telecommunications Union.
It is is language in the Modula2 family, and targets many of the
same applications as Ada (especially large embedded systems).
Chill was never used much in the United States, but is still
being used in Europe, Brazil, Korea, and other places.
Chill has been standardized by a series of reports/standards.
The GNU implementation mostly follows the 1988 version of
the language, with some backwards compatibility options for
the 1984 version, and some other extensions. However, it
does not implement all of the features of any standard.
The most recent standard is Z.200 (11/93), available from
http://www.itu.int/itudoc/itu-t/rec/z.html.
The GNU Chill implementation is not being actively developed.
Cygnus has one customer we are maintaining Chill for,
but we are not planning on putting major work into Chill.
This Net release is for educational purposes (as an example
of a different Gcc front-end), and for those who find it useful.
It is an unsupported hacker release. Bug reports without
patches are likely to get ignored. Questions may get answered or
ignored depending on our mood! If you want to try your luck,
you can send a note to David Brolley <brolley@cygnus.com> or
Per Bothner <bothner@cygnus.com>.
One known problem is that we only support native builds of GNU Chill.
If you need a cross-compiler, you will find various problems,
including the directory structure, and the setjmp-based exception
handling mechanism.
The Chill run-time system is in the runtime sub-directory.
Notice rts.c contains a poor main's implementation of Chill
"processes" (threads). It is not added to libchill.a.
We only use it for testing. (Our customer uses a different
implementation for production work.)
The GNU Chill implementation was primarily written by
Per Bothner, along with Bill Cox, Wilfried Moser, Michael
Tiemann, and David Brolley.

File diff suppressed because it is too large Load Diff

View File

@ -1,34 +0,0 @@
/* Declarations for ch-actions.c.
Copyright (C) 1992, 1993, 1994, 1998, 2000 Free Software Foundation, Inc.
This file is part of GNU CC.
GNU CC is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2, or (at your option)
any later version.
GNU CC is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with GNU CC; see the file COPYING. If not, write to
the Free Software Foundation, 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. */
/* used by compile_file */
void init_chill PARAMS ((void));
extern int grant_count;
extern void push_handler PARAMS ((void));
extern void pop_handler PARAMS ((int));
extern void push_action PARAMS ((void));
extern int chill_handle_single_dimension_case_label PARAMS ((tree, tree, int *, int *));
extern tree build_chill_multi_dimension_case_expr PARAMS ((tree, tree, tree));
extern tree build_multi_case_selector_expression PARAMS ((tree, tree));
extern void compute_else_ranges PARAMS ((tree, tree));

View File

@ -1,114 +0,0 @@
/* This file contains the definitions and documentation for the
additional tree codes used in the CHILL front end (see tree.def
for the standard codes).
Copyright (C) 1992, 1993 Free Software Foundation, Inc.
This file is part of GNU CC.
GNU CC is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2, or (at your option)
any later version.
GNU CC is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with GNU CC; see the file COPYING. If not, write to
the Free Software Foundation, 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. */
/*
* CHILL types.
*/
DEFTREECODE (GRANT_TYPE, "grant_type", 't', 0)
DEFTREECODE (SEIZE_TYPE, "seize_type", 't', 0)
/*
* CHILL decls.
*/
DEFTREECODE (KEYWORD_DECL, "keyword_decl", 'd', 0)
DEFTREECODE (INSTANCE_METHOD_DECL, "instance_method_decl", 'd', 0)
DEFTREECODE (CLASS_METHOD_DECL, "class_method_decl", 'd', 0)
/* A 'SEIZE (OLD->NEW)!POSTFIX' or 'GRANT (OLD->NEW)!POSTFIX' is
represented as an ALIAS_DECL where DECL_OLD_PREFIX, DECL_NEW_PREFIX,
and DECL_POSTFIX points to OLD, NEW, and POSTFIX, respectively.
These are IDENTIFIER_NODEs, or NULL if empty.
DECL_NAME is NEW!POSTFIX. After binding, DECL_ABSTRACT_ORIGIN
(if not an error_mark) points to a decl whose DECL_NAME is OLD!POSTFIX.
and which this name is linked to.
For SEIZE, DECL_SEIZEFILE names the most recent use_seize_file directive.
For GRANT, DECL_SEIZEFILE names the seizefile doing the granting. */
DEFTREECODE (ALIAS_DECL, "alias_decl", 'd', 0)
/* A variable, which is BASED on a pointer variable in DECL_ABSTRACT_ORIGIN. */
DEFTREECODE (BASED_DECL, "based_decl", 'd', 0)
/* A pseudo-variable declared by a DO WITH. */
DEFTREECODE (WITH_DECL, "with_decl", 'd', 0)
/*
* CHILL exprs.
*/
DEFTREECODE (CONCAT_EXPR, "concat_expr", '2', 2)
/* A slice (sub-array or sub-string) of operand 0, where
operand 1 is the start of the slice, and operand 2 is its length.
Currently, only used for bitstring sclices. */
DEFTREECODE (SLICE_EXPR, "slice_expr", 'e', 3)
/* Later, SET_IN_EXPR might be replaced by BIT_FIELD_REF or IN_EXPR. */
DEFTREECODE (SET_IN_EXPR, "set_in_expr", '2', 2)
/* A CASE_EXPR EX implements Chill CASE expression.
TREE_OPERAND (EX, 0) is a TREE_LIST representing the <case selector list>,
with one node for each expression. (Only one is supported by the
current implementation.)
TREE_OPERAND (EX, 1) is also a TREE_LIST, with one node for each
<value case alternative>. The TREE_VALUE of these node is the
<sub expression> (case element body); the TREE_PURPOSE contains
the <case label specification>. (The TREE_PURPOSE for the
optional ELSE (default) branch is NULL_TREE.) Each <case label
specification> is also represented as a list with one TREE_LIST
node for each <case label list> (though only length==1 is currently
supported). And finally: each <case label list> is again a list
with one TREE_LIST node for each <case label>. */
DEFTREECODE (CASE_EXPR, "case_expr", 'e', 2)
/* Powerset and static bit array operations.
Operands have same mode as result. */
DEFTREECODE (SET_NOT_EXPR, "set_not_expr", '1', 1)
DEFTREECODE (SET_IOR_EXPR, "set_ior_expr", '2', 2)
DEFTREECODE (SET_XOR_EXPR, "set_xor_expr", '2', 2)
DEFTREECODE (SET_AND_EXPR, "set_and_expr", '2', 2)
DEFTREECODE (SET_DIFF_EXPR, "set_diff_expr", '2', 2)
DEFTREECODE (PAREN_EXPR, "paren_expr", '1', 1)
DEFTREECODE (STRING_EQ_EXPR, "string_eq_expr", '2', 2)
DEFTREECODE (STRING_LT_EXPR, "string_lt_expr", '2', 2)
/* Used to represent a string repetition expression, until
we have a type for it; a SET_TYPE replicator needs a
TYPE_DOMAIN even if it represents the empty set */
DEFTREECODE (REPLICATE_EXPR, "replicate_expr", 'e', 2)
/* An undefined value. Used for the Chill operator '*',
and sometimes for padding. */
DEFTREECODE (UNDEFINED_EXPR, "undefined_expr", 'e', 0)
/* Used to represent a process instance */
DEFTREECODE (INSTANCE_TYPE, "instance_type", 't', 0)
/* Used to represent a reference to an array of bitfields. Currently restricted
to fields which are 1 bit wide. */
DEFTREECODE (PACKED_ARRAY_REF, "packed_array_ref", 'r', 2)
/* ALSO NOTE: LANG_TYPE is used for two things during pass 1;
such a node is converted to some other type node during satisfy.
If CH_NOVELTY_FLAG is set, then this node is a logical copy of
its TREE_TYPE, but with a different novelty.
If TYPE_READONLY is set, then the node stands for 'READ M'
where M is the TREE_TYPE. */

File diff suppressed because it is too large Load Diff

View File

@ -1,130 +0,0 @@
#!/bin/sh
# Compile GNU Chill programs.
: || exec /bin/sh -f $0 $argv:q
# The compiler name might be different when doing cross-compilation
# (this should be configured)
gcc_name=gcc
whatgcc=gcc
speclang=-xnone
startfile=chillrt0
gnuchill_script_flags=
gnuchill_version=unknown
extraflags=
# replace the command name by the name of the new command
progname=`basename $0`
case "$0" in
*/*)
gcc=`echo $0 | sed -e "s;/[^/]*$;;"`/$gcc_name
;;
*)
gcc=$gcc_name
;;
esac
# $first is yes for first arg, no afterwards.
first=yes
# If next arg is the argument of an option, $quote is non-empty.
# More precisely, it is the option that wants an argument.
quote=
# $library is made empty to disable use of libchill.
library="-lchill"
libpath=chillrt
numargs=$#
for arg
do
if [ $first = yes ]
then
# Need some 1st arg to `set' which does not begin with `-'.
# We get rid of it after the loop ends.
set gcc
first=no
fi
# If you have to ask what this does, you should not edit this file. :-)
# The ``S'' at the start is so that echo -nostdinc does not eat the
# -nostdinc.
arg=`echo "S$arg" | sed "s/^S//; s/'/'\\\\\\\\''/g"`
if [ x$quote != x ]
then
quote=
else
quote=
case $arg in
-nostdlib)
# Inhibit linking with -lchill.
library=
libpath=
startfile=
;;
-B*)
gcc=`echo $arg | sed -e "s/^-B//"`$gcc_name
;;
-[bBVDUoeTuIYmLiA] | -Tdata | -Xlinker)
# these switches take following word as argument,
# so don't treat it as a file name.
quote=$arg
;;
-[cSEM] | -MM)
# Don't specify libraries if we won't link,
# since that would cause a warning.
library=
libpath=
startfile=
;;
-x*)
speclang=$arg
;;
-v)
# catch `chill -v'
if [ $numargs = 1 ] ; then
library=
libpath=
startfile=
fi
echo "GNUCHILL version $gnuchill_version"
;;
-fgrant-only | -fchill-grant-only)
#inhibit production of an object file
extraflags="-S -o /dev/null"
library=
libpath=
startfile=
;;
-*)
# Pass other options through; they don't need -x and aren't inputs.
;;
*)
# If file ends in .i, put options around it.
# But not if a specified -x option is currently active.
case "$speclang $arg" in -xnone\ *.[i])
set "$@" -xchill "'$arg'" -xnone
continue
esac
;;
esac
fi
set "$@" "'$arg'"
done
# Get rid of that initial 1st arg
if [ $first = no ]; then
shift
else
echo "$0: No input files specified."
exit 1
fi
if [ x$quote != x ]
then
echo "$0: argument to \`$quote' missing"
exit 1
fi
# The '-ansi' flag prevents cpp from changing this:
# NEWMODE x = SET (sun, mon, thu, wed, thu, fri, sat);
#to this:
# NEWMODE x = SET (1, mon, thu, wed, thu, fri, sat);
#which is a CHILL syntax error.
eval $whatgcc -ansi $gnuchill_script_flags $startfile "$@" $libpath $library $extraflags

File diff suppressed because it is too large Load Diff

View File

@ -1,38 +0,0 @@
# Top level configure fragment for GNU CHILL.
# Copyright (C) 1994, 2000, 2001 Free Software Foundation, Inc.
#This file is part of GNU CC.
#GNU CC is free software; you can redistribute it and/or modify
#it under the terms of the GNU General Public License as published by
#the Free Software Foundation; either version 2, or (at your option)
#any later version.
#GNU CC is distributed in the hope that it will be useful,
#but WITHOUT ANY WARRANTY; without even the implied warranty of
#MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
#GNU General Public License for more details.
#You should have received a copy of the GNU General Public License
#along with GNU CC; see the file COPYING. If not, write to
#the Free Software Foundation, 59 Temple Place - Suite 330,
#Boston, MA 02111-1307, USA. */
# Configure looks for the existence of this file to auto-config each language.
# We define several parameters used by configure:
#
# language - name of language as it would appear in $(LANGUAGES)
# compilers - value to add to $(COMPILERS)
# stagestuff - files to add to $(STAGESTUFF)
language="CHILL"
compilers="cc1chill\$(exeext)"
stagestuff="chill chill-cross\$(exeext) cc1chill\$(exeext)"
outputs=ch/Makefile
target_libs=target-libchill
build_by_default=no

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -1,707 +0,0 @@
/* Exception support for GNU CHILL.
WARNING: Only works for native (needs setjmp.h)! FIXME!
Copyright (C) 1992, 1993, 1994, 1998, 1999, 2000, 2001
Free Software Foundation, Inc.
This file is part of GNU CC.
GNU CC is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2, or (at your option)
any later version.
GNU CC is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with GNU CC; see the file COPYING. If not, write to
the Free Software Foundation, 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. */
#include "config.h"
#include "system.h"
/* On Suns this can get you to the right definition if you
set the right value for TARGET. */
#include <setjmp.h>
#ifdef sequent
/* Can you believe they forgot this? */
#ifndef _JBLEN
#define _JBLEN 11
#endif
#endif
#ifndef _JBLEN
#define _JBLEN (sizeof(jmp_buf)/sizeof(int))
#define _JBLEN_2 _JBLEN+20
#else
/* if we use i.e. posix threads, this buffer must be longer */
#define _JBLEN_2 _JBLEN+20
#endif
/* On Linux setjmp is __setjmp FIXME: what is for CROSS */
#ifndef SETJMP_LIBRARY_NAME
#ifdef __linux__
#define SETJMP_LIBRARY_NAME "__setjmp"
#else
#define SETJMP_LIBRARY_NAME "setjmp"
#endif
#endif
#include "tree.h"
#include "ch-tree.h"
#include "rtl.h"
#include "toplev.h"
extern int expand_exit_needed;
static tree link_handler_decl;
static tree handler_link_pointer_type;
static tree unlink_handler_decl;
static int exceptions_initialized = 0;
static void emit_setup_handler PARAMS ((void));
static void initialize_exceptions PARAMS ((void));
static tree start_handler_array PARAMS ((void));
static void finish_handler_array PARAMS ((void));
static tree char_pointer_type_for_handler;
/* If this is 1, operations to push and pop on the __exceptionStack
are inline. The default is is to use a function call, to
allow for a per-thread exception stack. */
static int inline_exception_stack_ops = 0;
struct handler_state
{
struct handler_state *next;
/* Starts at 0, then incremented for every <on-alternative>. */
int prev_on_alternative;
/* If > 0: handler number for ELSE handler. */
int else_handler;
int action_number;
char do_pushlevel;
tree on_alt_list;
tree setjmp_expr;
/* A decl for the static handler array (used to map exception name to int).*/
tree handler_array_decl;
rtx end_label;
/* Used to pass a tree from emit_setup_handler to chill_start_on. */
tree handler_ref;
tree unlink_cleanup;
tree function;
/* flag to indicate that we are currently compiling this handler.
is_handled will need this to determine an unhandled exception */
int compiling;
};
/* This is incremented by one each time we start an action which
might have an ON-handler. It is reset between passes. */
static int action_number = 0;
int action_nesting_level = 0;
/* The global_handler_list is constructed in pass 1. It is not sorted.
It contains one element for each action that actually had an ON-handler.
An element's ACTION_NUMBER matches the action_number
of that action. The global_handler_list is eaten up during pass 2. */
#define ACTION_NUMBER(HANDLER) ((HANDLER)->action_number)
struct handler_state *global_handler_list = NULL;
/* This is a stack of handlers, one for each nested ON-handler. */
static struct handler_state *current_handler = NULL;
static struct handler_state *free_handlers = NULL; /* freelist */
static tree handler_element_type;
static tree handler_link_type;
static tree BISJ;
static tree jbuf_ident, prev_ident, handlers_ident;
static tree exception_stack_decl = 0;
/* Chain of cleanups associated with exception handlers.
The TREE_PURPOSE is an INTEGER_CST whose value is the
DECL_ACTION_NESTING_LEVEL (when the handled actions was entered).
The TREE_VALUE is an expression to expand when we exit that action. */
static tree cleanup_chain = NULL_TREE;
#if 0
/* Merge the current sequence onto the tail of the previous one. */
void
pop_sequence ()
{
rtx sequence_first = get_insns ();
end_sequence ();
emit_insns (sequence_first);
}
#endif
/* Things we need to do at the beginning of pass 2. */
void
except_init_pass_2 ()
{
/* First sort the global_handler_list on ACTION_NUMBER.
This will already be in close to reverse order (the exception being
nested ON-handlers), so insertion sort should essentially linear. */
register struct handler_state *old_list = global_handler_list;
/* First add a dummy final element. */
if (free_handlers)
global_handler_list = free_handlers;
else
global_handler_list
= (struct handler_state*) permalloc (sizeof (struct handler_state));
/* Make the final dummy "larger" than any other element. */
ACTION_NUMBER (global_handler_list) = action_number + 1;
/* Now move all the elements in old_list over to global_handler_list. */
while (old_list != NULL)
{
register struct handler_state **ptr = &global_handler_list;
/* Unlink from old_list. */
register struct handler_state *current = old_list;
old_list = old_list->next;
while (ACTION_NUMBER (current) > ACTION_NUMBER (*ptr))
ptr = &(*ptr)->next;
/* Link into proper place in global_handler_list (new list). */
current->next = *ptr;
*ptr = current;
}
/* Don't forget to reset action_number. */
action_number = 0;
}
/* This function is called at the beginning of an action that might be
followed by an ON-handler. Chill syntax doesn't let us know if
we actually have an ON-handler until we see the ON, so we save
away during pass 1 that information for use during pass 2. */
void
push_handler ()
{
register struct handler_state *hstate;
action_number++;
action_nesting_level++;
if (pass == 1)
{
if (free_handlers)
{
hstate = free_handlers;
free_handlers = hstate->next;
}
else
{
hstate =
(struct handler_state*) permalloc (sizeof (struct handler_state));
}
hstate->next = current_handler;
current_handler = hstate;
hstate->prev_on_alternative = 0;
hstate->else_handler = 0;
hstate->on_alt_list = NULL_TREE;
hstate->compiling = 0;
ACTION_NUMBER (hstate) = action_number;
return;
}
if (ACTION_NUMBER (global_handler_list) != action_number)
return;
/* OK. This action actually has an ON-handler.
Pop it from global_handler_list, and use it. */
hstate = global_handler_list;
global_handler_list = hstate->next;
/* Since this is pass 2, let's generate prologue code for that. */
hstate->next = current_handler;
current_handler = hstate;
hstate->prev_on_alternative = 0;
hstate->function = current_function_decl;
emit_setup_handler ();
}
static tree
start_handler_array ()
{
tree handler_array_type, decl;
push_obstacks_nochange ();
end_temporary_allocation ();
handler_array_type = build_array_type (handler_element_type, NULL_TREE);
decl = build_lang_decl (VAR_DECL,
get_unique_identifier ("handler_table"),
handler_array_type);
/* TREE_TYPE (decl) = handler_array_type;*/
TREE_READONLY (decl) = 1;
TREE_STATIC (decl) = 1;
DECL_INITIAL (decl) = error_mark_node;
pushdecl (decl);
make_decl_rtl (decl, NULL_PTR, 0);
current_handler->handler_array_decl = decl;
return decl;
}
static void
finish_handler_array ()
{
tree decl = current_handler->handler_array_decl;
tree t;
tree handler_array_init = NULL_TREE;
int handlers_count = 1;
int nelts;
/* Build the table mapping exceptions to handler(-number)s.
This is done in reverse order. */
/* First push the end of the list. This is either the ELSE
handler (current_handler->else_handler>0) or NULL handler to indicate
the end of the list (if current_handler->else-handler == 0).
The following works either way. */
handler_array_init = build_tree_list
(NULL_TREE, chill_expand_tuple
(handler_element_type,
build_nt (CONSTRUCTOR, NULL_TREE,
tree_cons (NULL_TREE,
null_pointer_node,
build_tree_list (NULL_TREE,
build_int_2 (current_handler->else_handler,
0))))));
for (t = current_handler->on_alt_list; t != NULL_TREE; t = TREE_CHAIN (t))
{ tree handler_number = TREE_PURPOSE(t);
tree elist = TREE_VALUE (t);
for ( ; elist != NULL_TREE; elist = TREE_CHAIN (elist))
{
tree ex_decl =
build_chill_exception_decl (IDENTIFIER_POINTER(TREE_VALUE(elist)));
tree ex_addr = build1 (ADDR_EXPR,
char_pointer_type_for_handler,
ex_decl);
tree el = build_nt (CONSTRUCTOR, NULL_TREE,
tree_cons (NULL_TREE,
ex_addr,
build_tree_list (NULL_TREE,
handler_number)));
mark_addressable (ex_decl);
TREE_CONSTANT (ex_addr) = 1;
handler_array_init =
tree_cons (NULL_TREE,
chill_expand_tuple (handler_element_type, el),
handler_array_init);
handlers_count++;
}
}
#if 1
nelts = list_length (handler_array_init);
TYPE_DOMAIN (TREE_TYPE (decl))
= build_index_type (build_int_2 (nelts - 1, - (nelts == 0)));
layout_type (TREE_TYPE (decl));
DECL_INITIAL (decl)
= convert (TREE_TYPE (decl),
build_nt (CONSTRUCTOR, NULL_TREE, handler_array_init));
/* Pop back to the obstack that is current for this binding level.
This is because MAXINDEX, rtl, etc. to be made below
must go in the permanent obstack. But don't discard the
temporary data yet. */
pop_obstacks ();
layout_decl (decl, 0);
/* To prevent make_decl_rtl (called indiectly by rest_of_decl_compilation)
throwing the existing RTL (which has already been used). */
PUT_MODE (DECL_RTL (decl), DECL_MODE (decl));
rest_of_decl_compilation (decl, (char*)0, 0, 0);
expand_decl_init (decl);
#else
/* To prevent make_decl_rtl (called indirectly by finish_decl)
altering the existing RTL. */
GET_MODE (DECL_RTL (current_handler->handler_array_decl)) =
DECL_MODE (current_handler->handler_array_decl);
finish_decl (current_handler->handler_array_decl,
build_nt (CONSTRUCTOR, NULL_TREE, handler_array_init),
NULL_TREE);
#endif
}
void
pop_handler (used)
int used;
{
action_nesting_level--;
if (pass == 1)
{
struct handler_state *old = current_handler;
if (old == NULL)
abort ();
current_handler = old->next;
if (used)
{ /* Push unto global_handler_list. */
old->next = global_handler_list;
global_handler_list = old;
}
else
{
/* Push onto free_handlers free list. */
old->next = free_handlers;
free_handlers = old;
}
}
else if (used)
{
current_handler = current_handler->next;
}
}
/* Emit code before an action that has an ON-handler. */
static void
emit_setup_handler ()
{
tree handler_decl, handler_addr, t;
/* Field references. */
tree jbuf_ref, handlers_ref,prev_ref;
if (!exceptions_initialized)
{
/* We temporarily reset the maximum_field_alignment to zero so the
compiler's exception data structures can be compatible with the
run-time system, even when we're compiling with -fpack. */
unsigned int save_maximum_field_alignment = maximum_field_alignment;
maximum_field_alignment = 0;
push_obstacks_nochange ();
end_temporary_allocation ();
initialize_exceptions ();
pop_obstacks ();
maximum_field_alignment = save_maximum_field_alignment;
}
push_momentary ();
handler_decl = build_lang_decl (VAR_DECL,
get_unique_identifier ("handler"),
handler_link_type);
push_obstacks_nochange ();
pushdecl(handler_decl);
expand_decl (handler_decl);
finish_decl (handler_decl);
jbuf_ref = build_component_ref (handler_decl, jbuf_ident);
jbuf_ref = build_chill_arrow_expr (jbuf_ref, 1);
handlers_ref = build_component_ref (handler_decl, handlers_ident);
prev_ref = build_component_ref (handler_decl, prev_ident);
/* Emit code to link in handler in __exceptionStack chain. */
mark_addressable (handler_decl);
handler_addr = build1 (ADDR_EXPR, handler_link_pointer_type, handler_decl);
if (inline_exception_stack_ops)
{
expand_expr_stmt (build_chill_modify_expr (prev_ref,
exception_stack_decl));
expand_expr_stmt (build_chill_modify_expr (exception_stack_decl,
handler_addr));
current_handler->handler_ref = prev_ref;
}
else
{
expand_expr_stmt (build_chill_function_call (link_handler_decl,
build_tree_list (NULL_TREE,
handler_addr)));
current_handler->handler_ref = handler_addr;
}
/* Expand: handler->__handlers = { <<array mapping names to ints } */
t = build1 (NOP_EXPR, build_pointer_type (handler_element_type),
build_chill_arrow_expr (start_handler_array (), 1));
expand_expr_stmt (build_chill_modify_expr (handlers_ref, t));
/* Emit code to unlink handler. */
if (inline_exception_stack_ops)
current_handler->unlink_cleanup
= build_chill_modify_expr (exception_stack_decl,
current_handler->handler_ref);
else
current_handler->unlink_cleanup
= build_chill_function_call (unlink_handler_decl,
build_tree_list(NULL_TREE,
current_handler->handler_ref));
cleanup_chain = tree_cons (build_int_2 (action_nesting_level, 0),
current_handler->unlink_cleanup,
cleanup_chain);
/* Emit code for setjmp. */
current_handler->setjmp_expr =
build_chill_function_call (BISJ, build_tree_list (NULL_TREE, jbuf_ref));
expand_start_case (1, current_handler->setjmp_expr,
integer_type_node, "on handler");
chill_handle_case_label (integer_zero_node, current_handler->setjmp_expr);
}
/* Start emitting code for: <actions> ON <handlers> END.
Assume we've parsed <actions>, and the setup needed for it. */
void
chill_start_on ()
{
expand_expr_stmt (current_handler->unlink_cleanup);
/* Emit code to jump past the handlers. */
current_handler->end_label = gen_label_rtx ();
current_handler->compiling = 1;
emit_jump (current_handler->end_label);
}
void
chill_finish_on ()
{
expand_end_case (current_handler->setjmp_expr);
finish_handler_array ();
emit_label (current_handler->end_label);
pop_momentary ();
cleanup_chain = TREE_CHAIN (cleanup_chain);
}
void
chill_handle_on_labels (labels)
tree labels;
{
unsigned int alternative = ++current_handler->prev_on_alternative;
if (pass == 1)
{
tree handler_number = build_int_2 (alternative, 0);
current_handler->on_alt_list =
tree_cons (handler_number, labels, current_handler->on_alt_list);
}
else
{
/* Find handler_number saved in pass 1. */
tree tmp;
for (tmp = current_handler->on_alt_list;
compare_tree_int (TREE_PURPOSE (tmp), alternative) != 0;
tmp = TREE_CHAIN (tmp))
;
if (expand_exit_needed)
expand_exit_something (), expand_exit_needed = 0;
chill_handle_case_label (TREE_PURPOSE (tmp),
current_handler->setjmp_expr);
}
}
void
chill_start_default_handler ()
{
current_handler->else_handler = ++current_handler->prev_on_alternative;
if (!ignoring)
{
chill_handle_case_default ();
}
}
void
chill_check_no_handlers ()
{
if (current_handler != NULL)
abort ();
}
static void
initialize_exceptions ()
{
tree jmp_buf_type = build_array_type (integer_type_node,
build_index_type (build_int_2 (_JBLEN_2-1, 0)));
tree setjmp_fndecl, link_ftype;
tree parmtypes
= tree_cons (NULL_TREE, build_pointer_type (jmp_buf_type), void_list_node);
setjmp_fndecl = builtin_function ("setjmp",
build_function_type (integer_type_node,
parmtypes),
0, NOT_BUILT_IN,
SETJMP_LIBRARY_NAME);
BISJ = build1 (ADDR_EXPR, build_pointer_type (TREE_TYPE (setjmp_fndecl)),
setjmp_fndecl);
char_pointer_type_for_handler
= build_pointer_type (build_type_variant (char_type_node, 1, 0));
handler_element_type =
build_chill_struct_type (chainon
(build_decl (FIELD_DECL,
get_identifier("__exceptid"),
char_pointer_type_for_handler),
build_decl (FIELD_DECL,
get_identifier("__handlerno"),
integer_type_node)));
jbuf_ident = get_identifier("__jbuf");
prev_ident = get_identifier("__prev");
handlers_ident = get_identifier("__handlers");
handler_link_type =
build_chill_struct_type
(chainon
(build_decl (FIELD_DECL, prev_ident, ptr_type_node),
chainon
(build_decl (FIELD_DECL, handlers_ident,
build_pointer_type (handler_element_type)),
build_decl (FIELD_DECL, jbuf_ident, jmp_buf_type))));
handler_link_pointer_type = build_pointer_type (handler_link_type);
if (inline_exception_stack_ops)
{
exception_stack_decl =
build_lang_decl (VAR_DECL,
get_identifier("__exceptionStack"),
handler_link_pointer_type);
TREE_STATIC (exception_stack_decl) = 1;
TREE_PUBLIC (exception_stack_decl) = 1;
DECL_EXTERNAL (exception_stack_decl) = 1;
push_obstacks_nochange ();
pushdecl(exception_stack_decl);
make_decl_rtl (exception_stack_decl, NULL_PTR, 1);
finish_decl (exception_stack_decl);
}
link_ftype = build_function_type (void_type_node,
tree_cons (NULL_TREE,
handler_link_pointer_type,
void_list_node));
link_handler_decl = builtin_function ("__ch_link_handler", link_ftype,
0, NOT_BUILT_IN, NULL_PTR);
unlink_handler_decl = builtin_function ("__ch_unlink_handler", link_ftype,
0, NOT_BUILT_IN, NULL_PTR);
exceptions_initialized = 1;
}
/* Do the cleanup(s) needed for a GOTO label.
We only need to do the last of the cleanups. */
void
expand_goto_except_cleanup (label_level)
int label_level;
{
tree list = cleanup_chain;
tree last = NULL_TREE;
for ( ; list != NULL_TREE; list = TREE_CHAIN (list))
{
if (compare_tree_int (TREE_PURPOSE (list), label_level) > 0)
last = list;
else
break;
}
if (last)
expand_expr_stmt (TREE_VALUE (last));
}
/* Returns true if there is a valid handler for EXCEPT_NAME
in the current static scope.
0 ... no handler found
1 ... local handler available
2 ... function may propagate this exception
*/
int
is_handled (except_name)
tree except_name;
{
tree t;
struct handler_state *h = current_handler;
/* if we are are currently compiling this handler
we have to start at the next level */
if (h && h->compiling)
h = h->next;
while (h != NULL)
{
if (h->function != current_function_decl)
break;
if (h->else_handler > 0)
return 1;
for (t = h->on_alt_list; t != NULL_TREE; t = TREE_CHAIN (t))
{
if (value_member (except_name, TREE_VALUE (t)))
return 1;
}
h = h->next;
}
t = TYPE_RAISES_EXCEPTIONS (TREE_TYPE (current_function_decl));
if (value_member (except_name, t))
return 2;
return 0;
}
/* function generates code to reraise exceptions
for PROC's propagating exceptions. */
void
chill_reraise_exceptions (exceptions)
tree exceptions;
{
tree wrk;
if (exceptions == NULL_TREE)
return; /* just in case */
if (pass == 1)
{
for (wrk = exceptions; wrk != NULL_TREE; wrk = TREE_CHAIN (wrk))
chill_handle_on_labels (build_tree_list (NULL_TREE, TREE_VALUE (wrk)));
}
else /* pass == 2 */
{
chill_start_on ();
expand_exit_needed = 0;
for (wrk = exceptions; wrk != NULL_TREE; wrk = TREE_CHAIN (wrk))
{
chill_handle_on_labels (TREE_VALUE (wrk));
/* do a CAUSE exception */
expand_expr_stmt (build_cause_exception (TREE_VALUE (wrk), 0));
expand_exit_needed = 1;
}
chill_finish_on ();
}
pop_handler (1);
}

File diff suppressed because it is too large Load Diff

View File

@ -1,166 +0,0 @@
struct resword {
const char *name;
short token;
enum rid rid;
enum toktype { RESERVED, DIRECTIVE, PREDEF } flags;
};
extern tree ridpointers [];
#ifdef __GNUC__
__inline
#endif
static unsigned int hash PARAMS ((const char *, unsigned int));
#ifdef __GNUC__
__inline
#endif
struct resword *in_word_set PARAMS ((const char *, unsigned int));
%%
access, ACCESS, NORID, RESERVED
after, AFTER, NORID, RESERVED
all, ALL, NORID, RESERVED
all_static_off, ALL_STATIC_OFF, NORID, DIRECTIVE
all_static_on, ALL_STATIC_ON, NORID, DIRECTIVE
and, AND, NORID, RESERVED
andif, ANDIF, NORID, RESERVED
array, ARRAY, NORID, RESERVED
asm, ASM_KEYWORD, NORID, RESERVED
assert, ASSERT, NORID, RESERVED
at, AT, NORID, RESERVED
based, BASED, NORID, RESERVED
begin, BEGINTOKEN, NORID, RESERVED
bin, BIN, NORID, RESERVED
bit, BOOLS, RID_BOOLS, PREDEF
body, BODY, NORID, RESERVED
bools, BOOLS, RID_BOOLS, RESERVED
buffer, BUFFER, NORID, RESERVED
buffer_code, IGNORED_DIRECTIVE, NORID, DIRECTIVE
by, BY, NORID, RESERVED
call, CALL, NORID, RESERVED
case, CASE, NORID, RESERVED
cause, CAUSE, NORID, RESERVED
ccitt_os, IGNORED_DIRECTIVE, NORID, DIRECTIVE
chars, CHARS, NORID, RESERVED
context, CONTEXT, NORID, RESERVED
continue, CONTINUE, NORID, RESERVED
cycle, CYCLE, NORID, RESERVED
dcl, DCL, NORID, RESERVED
debug_lines, IGNORED_DIRECTIVE, NORID, DIRECTIVE
debug_symbols, IGNORED_DIRECTIVE, NORID, DIRECTIVE
debug_types, IGNORED_DIRECTIVE, NORID, DIRECTIVE
delay, DELAY, NORID, RESERVED
do, DO, NORID, RESERVED
down, DOWN, NORID, RESERVED
dynamic, DYNAMIC, RID_DYNAMIC, RESERVED
else, ELSE, NORID, RESERVED
elsif, ELSIF, NORID, RESERVED
empty_off, EMPTY_OFF, NORID, DIRECTIVE
empty_on, EMPTY_ON, NORID, DIRECTIVE
end, END, NORID, RESERVED
esac, ESAC, NORID, RESERVED
even, IGNORED_DIRECTIVE, NORID, DIRECTIVE
event, EVENT, NORID, RESERVED
event_code, IGNORED_DIRECTIVE, NORID, DIRECTIVE
ever, EVER, NORID, RESERVED
exceptions, EXCEPTIONS, NORID, RESERVED
exit, EXIT, NORID, RESERVED
extra_const_seg, IGNORED_DIRECTIVE, NORID, DIRECTIVE
far, IGNORED_DIRECTIVE, NORID, DIRECTIVE
fi, FI, NORID, RESERVED
for, FOR, NORID, RESERVED
forbid, FORBID, NORID, RESERVED
general, GENERAL, NORID, RESERVED
generate_all_set_names, IGNORED_DIRECTIVE, NORID, DIRECTIVE
generate_set_names, IGNORED_DIRECTIVE, NORID, DIRECTIVE
goto, GOTO, NORID, RESERVED
grant, GRANT, NORID, RESERVED
grant_file_size, IGNORED_DIRECTIVE, NORID, DIRECTIVE
if, IF, NORID, RESERVED
in, IN, RID_IN, RESERVED
init, INIT, NORID, RESERVED
inline, INLINE, RID_INLINE, RESERVED
inout, PARAMATTR, RID_INOUT, RESERVED
large, IGNORED_DIRECTIVE, NORID, DIRECTIVE
list, IGNORED_DIRECTIVE, NORID, DIRECTIVE
loc, LOC, NORID, RESERVED
make_publics_for_discrete_syns, IGNORED_DIRECTIVE, NORID, DIRECTIVE
medium, IGNORED_DIRECTIVE, NORID, DIRECTIVE
mod, MOD, NORID, RESERVED
module, MODULE, NORID, RESERVED
multiple_const_segs, IGNORED_DIRECTIVE, NORID, DIRECTIVE
multiple_data_segs, IGNORED_DIRECTIVE, NORID, DIRECTIVE
newmode, NEWMODE, NORID, RESERVED
nolist, IGNORED_DIRECTIVE, NORID, DIRECTIVE
no_overlap_check, IGNORED_DIRECTIVE, NORID, DIRECTIVE
nonref, NONREF, NORID, RESERVED
nopack, NOPACK, NORID, RESERVED
not, NOT, NORID, RESERVED
od, OD, NORID, RESERVED
of, OF, NORID, RESERVED
on, ON, NORID, RESERVED
only_for_simulation, IGNORED_DIRECTIVE, NORID, DIRECTIVE
only_for_target, IGNORED_DIRECTIVE, NORID, DIRECTIVE
optimize, IGNORED_DIRECTIVE, NORID, DIRECTIVE
optimize_runtime, IGNORED_DIRECTIVE, NORID, DIRECTIVE
optimization_window, IGNORED_DIRECTIVE, NORID, DIRECTIVE
or, OR, NORID, RESERVED
orif, ORIF, NORID, RESERVED
out, PARAMATTR, RID_OUT, RESERVED
pack, PACK, NORID, RESERVED
page, IGNORED_DIRECTIVE, NORID, DIRECTIVE
pos, POS, NORID, RESERVED
powerset, POWERSET, NORID, RESERVED
prefixed, PREFIXED, NORID, RESERVED
print_o_code, IGNORED_DIRECTIVE, NORID, DIRECTIVE
print_symbol_table, IGNORED_DIRECTIVE, NORID, DIRECTIVE
priority, PRIORITY, NORID, RESERVED
proc, PROC, NORID, RESERVED
process, PROCESS, NORID, RESERVED
process_type, PROCESS_TYPE_TOKEN, NORID, DIRECTIVE
range, RANGE, NORID, RESERVED
range_off, RANGE_OFF, NORID, DIRECTIVE
range_on, RANGE_ON, NORID, DIRECTIVE
read, READ, RID_READ, RESERVED
receive, RECEIVE, NORID, RESERVED
recursive, RECURSIVE, NORID, RESERVED
reentrant, IGNORED_DIRECTIVE, NORID, DIRECTIVE
reentrant_all, IGNORED_DIRECTIVE, NORID, DIRECTIVE
ref, REF, NORID, RESERVED
region, REGION, NORID, RESERVED
rem, REM, NORID, RESERVED
remote, REMOTE, NORID, RESERVED
result, RESULT, NORID, RESERVED
return, RETURN, NORID, RESERVED
returns, RETURNS, NORID, RESERVED
row, ROW, NORID, RESERVED
seize, SEIZE, NORID, RESERVED
send, SEND, NORID, RESERVED
send_buffer_default_priority, SEND_BUFFER_DEFAULT_PRIORITY, NORID, DIRECTIVE
send_signal_default_priority, SEND_SIGNAL_DEFAULT_PRIORITY, NORID, DIRECTIVE
set, SET, NORID, RESERVED
short_pred_succ, IGNORED_DIRECTIVE, NORID, DIRECTIVE
signal, SIGNAL, NORID, RESERVED
signal_code, SIGNAL_CODE, NORID, DIRECTIVE
signal_max_length, IGNORED_DIRECTIVE, NORID, DIRECTIVE
simple, SIMPLE, NORID, RESERVED
small, IGNORED_DIRECTIVE, NORID, DIRECTIVE
spec, SPEC, NORID, RESERVED
start, START, NORID, RESERVED
state_routine, IGNORED_DIRECTIVE, NORID, DIRECTIVE
static, STATIC, NORID, RESERVED
step, STEP, NORID, RESERVED
stop, STOP, NORID, RESERVED
struct, STRUCT, NORID, RESERVED
support_causing_address, IGNORED_DIRECTIVE, NORID, DIRECTIVE
syn, SYN, NORID, RESERVED
synmode, SYNMODE, NORID, RESERVED
text, TEXT, NORID, RESERVED
then, THEN, NORID, RESERVED
this, THIS, NORID, RESERVED
timeout, TIMEOUT, NORID, RESERVED
to, TO, NORID, RESERVED
up, UP, NORID, RESERVED
use_seize_file, USE_SEIZE_FILE, NORID, DIRECTIVE
use_seize_file_restricted, USE_SEIZE_FILE_RESTRICTED, NORID, DIRECTIVE
varying, VARYING, NORID, RESERVED
while, WHILE, NORID, RESERVED
with, WITH, NORID, RESERVED
xor, XOR, NORID, RESERVED

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -1,40 +0,0 @@
/* Definitions for switches for GNU CHILL.
Copyright (C) 1995, 1998 Free Software Foundation, Inc.
This file is part of GNU CC.
GNU CC is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2, or (at your option)
any later version.
GNU CC is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with GNU CC; see the file COPYING. If not, write to
the Free Software Foundation, 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. */
/* This is the contribution to the `documented_lang_options' array in
toplev.c for CHILL. */
DEFINE_LANG_NAME ("Chill")
{ "-lang-chill", "" },
{ "-flocal-loop-counter", "" },
{ "-fno-local-loop-counter", "Do not make separate scopes for every 'for' loop"},
{ "-fgrant-only", "Stop after successfully generating a grant file" },
{ "-fchill-grant-only", "" },
{ "-fold-strings", "Implement the 1984 Chill string semantics" },
{ "-fno-old-strings", "" },
{ "-fignore-case", "convert all idenitifers to lower case" },
{ "-fno-ignore-case", "" },
{ "-fpack", "Pack structures into available space"},
{ "-fno-pack", "" },
{ "-fspecial_UC", "Make special words be in uppercase" },
{ "-fspecial_LC", "" },
{ "-fruntime-checking", "" },
{ "-fno-runtime-checking", "Disable runtime checking of parameters" },

View File

@ -1,30 +0,0 @@
/* Definitions for specs for GNU CHILL.
Copyright (C) 1995, 1998, 1999 Free Software Foundation, Inc..
This file is part of GNU CC.
GNU CC is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2, or (at your option)
any later version.
GNU CC is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with GNU CC; see the file COPYING. If not, write to
the Free Software Foundation, 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. */
/* This is the contribution to the `default_compilers' array in gcc.c for
CHILL. */
{".ch", "@chill"},
{".chi", "@chill"},
{"@chill",
"tradcpp0 -lang-chill %{!no-gcc:-D__GNUCHILL__=%v1} %(cpp_options)\
%{!M:%{!MM:%{!E:%{!pipe:%g.i} |\n\
cc1chill %{!pipe:%g.i} %(cc1_options)\
%{!fsyntax-only:%(invoke_as)}}}}\n"},

View File

@ -1,308 +0,0 @@
/* Language-specific hook definitions for CHILL front end.
Copyright (C) 1992, 1993, 1994, 1998, 1999, 2000, 2001
Free Software Foundation, Inc.
This file is part of GNU CC.
GNU CC is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2, or (at your option)
any later version.
GNU CC is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with GNU CC; see the file COPYING. If not, write to
the Free Software Foundation, 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. */
#include "config.h"
#include "system.h"
#include "tree.h"
#include "ch-tree.h"
#include "lex.h"
#include "input.h"
#include "toplev.h"
#include "rtl.h"
#include "expr.h"
#include "diagnostic.h"
/* Type node for boolean types. */
tree boolean_type_node;
/* True if STRING(INDEX) yields a CHARS(1) (or BOOLS(1)) rather than
a CHAR (or BOOL). Also, makes CHARS(1) similar for CHAR,
and BOOLS(1) similar to BOOL. This is for compatibility
for the 1984 version of Z.200.*/
int flag_old_strings = 0;
/* This is set non-zero to force user input tokens to lower case.
This is non-standard. See Z.200, page 8. */
int ignore_case = 1;
/* True if reserved and predefined words ('special' words in the Z.200
terminology) are in uppercase. Obviously, this had better not be
true if we're ignoring input case. */
int special_UC = 0;
/* The actual name of the input file, regardless of any #line directives */
const char* chill_real_input_filename;
extern FILE* finput;
static int deep_const_expr PARAMS ((tree));
static void chill_print_error_function PARAMS ((diagnostic_context *,
const char *));
/* Return 1 if the expression tree given has all
constant nodes as its leaves,otherwise. */
static int
deep_const_expr (exp)
tree exp;
{
enum chill_tree_code code;
int length;
int i;
if (exp == NULL_TREE)
return 0;
code = TREE_CODE (exp);
length = first_rtl_op (TREE_CODE (exp));
/* constant leaf? return TRUE */
if (TREE_CODE_CLASS (code) == 'c')
return 1;
/* Recursively check next level down. */
for (i = 0; i < length; i++)
if (! deep_const_expr (TREE_OPERAND (exp, i)))
return 0;
return 1;
}
tree
const_expr (exp)
tree exp;
{
if (TREE_CODE (exp) == INTEGER_CST)
return exp;
if (TREE_CODE (exp) == CONST_DECL)
return const_expr (DECL_INITIAL (exp));
if (TREE_CODE_CLASS (TREE_CODE (exp)) == 'd'
&& DECL_INITIAL (exp) != NULL_TREE
&& TREE_READONLY (exp))
return DECL_INITIAL (exp);
if (deep_const_expr (exp))
return exp;
if (TREE_CODE (exp) != ERROR_MARK)
error ("non-constant expression");
return error_mark_node;
}
/* Each of the functions defined here
is an alternative to a function in objc-actions.c. */
/* Used by c-lex.c, but only for objc. */
tree
lookup_interface (arg)
tree arg ATTRIBUTE_UNUSED;
{
return 0;
}
int
maybe_objc_comptypes (lhs, rhs)
tree lhs ATTRIBUTE_UNUSED, rhs ATTRIBUTE_UNUSED;
{
return -1;
}
tree
maybe_building_objc_message_expr ()
{
return 0;
}
int
recognize_objc_keyword ()
{
return 0;
}
void
lang_init_options ()
{
}
/* used by print-tree.c */
void
lang_print_xnode (file, node, indent)
FILE *file ATTRIBUTE_UNUSED;
tree node ATTRIBUTE_UNUSED;
int indent ATTRIBUTE_UNUSED;
{
}
/*
* process chill-specific compiler command-line options
* do not complain if the option is not recognised
*/
int
lang_decode_option (argc, argv)
int argc;
char **argv;
{
char *p = argv[0];
static int explicit_ignore_case = 0;
if (!strcmp(p, "-lang-chill"))
; /* do nothing */
else if (!strcmp (p, "-fruntime-checking"))
{
range_checking = 1;
empty_checking = 1;
}
else if (!strcmp (p, "-fno-runtime-checking"))
{
range_checking = 0;
empty_checking = 0;
runtime_checking_flag = 0;
}
else if (!strcmp (p, "-flocal-loop-counter"))
flag_local_loop_counter = 1;
else if (!strcmp (p, "-fno-local-loop-counter"))
flag_local_loop_counter = 0;
else if (!strcmp (p, "-fold-strings"))
flag_old_strings = 1;
else if (!strcmp (p, "-fno-old-strings"))
flag_old_strings = 0;
else if (!strcmp (p, "-fignore-case"))
{
explicit_ignore_case = 1;
if (special_UC)
{
error ("ignoring case upon input and");
error ("making special words uppercase wouldn't work");
}
else
ignore_case = 1;
}
else if (!strcmp (p, "-fno-ignore-case"))
ignore_case = 0;
else if (!strcmp (p, "-fspecial_UC"))
{
if (explicit_ignore_case)
{
error ("making special words uppercase and");
error (" ignoring case upon input wouldn't work");
}
else
special_UC = 1, ignore_case = 0;
}
else if (!strcmp (p, "-fspecial_LC"))
special_UC = 0;
else if (!strcmp (p, "-fpack"))
maximum_field_alignment = BITS_PER_UNIT;
else if (!strcmp (p, "-fno-pack"))
maximum_field_alignment = 0;
else if (!strcmp (p, "-fchill-grant-only"))
grant_only_flag = 1;
else if (!strcmp (p, "-fgrant-only"))
grant_only_flag = 1;
/* user has specified a seize-file path */
else if (p[0] == '-' && p[1] == 'I')
register_seize_path (&p[2]);
if (!strcmp(p, "-itu")) /* Force Z.200 semantics */
{
pedantic = 1; /* FIXME: new flag name? */
flag_local_loop_counter = 1;
}
else
return c_decode_option (argc, argv);
return 1;
}
static void
chill_print_error_function (context, file)
diagnostic_context *buffer __attribute__((__unused__));
const char *file;
{
static tree last_error_function = NULL_TREE;
static struct module *last_error_module = NULL;
if (last_error_function == current_function_decl
&& last_error_module == current_module)
return;
last_error_function = current_function_decl;
last_error_module = current_module;
if (file)
fprintf (stderr, "%s: ", file);
if (current_function_decl == global_function_decl
|| current_function_decl == NULL_TREE)
{
if (current_module == NULL)
fprintf (stderr, "At top level:\n");
else
fprintf (stderr, "In module %s:\n",
IDENTIFIER_POINTER (current_module->name));
}
else
{
const char *kind = "function";
const char *name = (*decl_printable_name) (current_function_decl, 2);
fprintf (stderr, "In %s `%s':\n", kind, name);
}
}
/* Print an error message for invalid use of an incomplete type.
VALUE is the expression that was used (or 0 if that isn't known)
and TYPE is the type that was invalid. */
void
incomplete_type_error (value, type)
tree value ATTRIBUTE_UNUSED;
tree type ATTRIBUTE_UNUSED;
{
error ("internal error - use of undefined type");
}
/* Return the typed-based alias set for T, which may be an expression
or a type. Return -1 if we don't do anything special. */
HOST_WIDE_INT
lang_get_alias_set (t)
tree t ATTRIBUTE_UNUSED;
{
/* ??? Need to figure out what the rules are. Certainly we'd need
to handle union-like things, and probably variant records.
Until then, turn off type-based aliasing completely. */
return 0;
}
void
lang_init ()
{
chill_real_input_filename = input_filename;
/* the beginning of the file is a new line; check for # */
/* With luck, we discover the real source file's name from that
and put it in input_filename. */
ungetc (check_newline (), finput);
/* set default grant file */
set_default_grant_file ();
print_error_function = chill_print_error_function;
}

File diff suppressed because it is too large Load Diff

View File

@ -1,98 +0,0 @@
/* Define constants for communication with the CHILL parser.
Copyright (C) 1992, 1993, 1994, 1995, 1996, 1999, 2000
Free Software Foundation, Inc.
This file is part of GNU CC.
GNU CC is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2, or (at your option)
any later version.
GNU CC is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with GNU CC; see the file COPYING. If not, write to
the Free Software Foundation, 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. */
enum rid
{
RID_UNUSED, /* keep this one first, please */
RID_ALL,
RID_ASSERTFAIL,
RID_ASSOCIATION,
RID_BIN,
RID_BIT,
RID_BOOL,
RID_BOOLS,
RID_BYTE,
RID_CHAR,
RID_CHARS,
RID_DOUBLE,
RID_DURATION,
RID_DYNAMIC,
RID_ELSE,
RID_EMPTY,
RID_FALSE,
RID_FLOAT,
RID_GENERAL,
RID_IN,
RID_INLINE,
RID_INOUT,
RID_INSTANCE,
RID_INT,
RID_LOC,
RID_LONG,
RID_LONG_REAL,
RID_NULL,
RID_OUT,
RID_OVERFLOW,
RID_PTR,
RID_RANGE,
RID_RANGEFAIL,
RID_READ,
RID_REAL,
RID_RECURSIVE,
RID_SHORT,
RID_SIMPLE,
RID_TIME,
RID_TRUE,
RID_UBYTE,
RID_UINT,
RID_ULONG,
RID_UNSIGNED,
RID_USHORT,
RID_VOID,
RID_MAX /* Last element */
};
#define NORID RID_UNUSED
#define RID_FIRST_MODIFIER RID_UNSIGNED
/* The elements of `ridpointers' are identifier nodes
for the reserved type names and storage classes.
It is indexed by a RID_... value. */
extern tree ridpointers[(int) RID_MAX];
extern char *token_buffer; /* Pointer to token buffer. */
extern tree make_pointer_declarator PARAMS ((tree, tree));
extern void reinit_parse_for_function PARAMS ((void));
extern int yylex PARAMS ((void));
extern tree default_grant_file;
extern tree current_grant_file;
extern tree current_seize_file;
extern int chill_at_module_level;
extern tree chill_initializer_name;
extern void prepare_paren_colon PARAMS ((void));

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -1,70 +0,0 @@
typedef union {
long itype;
tree ttype;
enum tree_code code;
char *filename;
int lineno;
} YYSTYPE;
extern YYSTYPE yylval;
/* DELAY is defined in the standard headers on some platforms like
SunOS 4.1.4. */
#ifdef DELAY
#undef DELAY
#endif
enum terminal
{
/*EOF = 0,*/
last_char_nonterminal = 256,
/* Please keep these in alphabetic order, for easier reference and updating.
*/
ABSOLUTE, ACCESS, AFTER, ALL, ALLOCATE, AND, ANDIF, ARRAY,
ARROW, ASGN, ASM_KEYWORD, ASSERT, ASSOCIATION, AT,
BASED, BEGINTOKEN, BIN, BIT, BITSTRING, BODY, BOOLS, BUFFER,
BUFFERNAME, BUFFER_CODE, BY,
CALL, CASE, CAUSE, CDDEL, CHAR, CHARS, COLON, COMMA, CONCAT, CONST,
CONTINUE, CYCLE,
DCL, DELAY, DIV, DO, DOT, DOWN, DYNAMIC,
ELSE, ELSIF, END, ENTRY, EQL, ESAC, EVENT, EVENT_CODE, EVER,
EXCEPTIONS, EXIT,
EXPR, /* an expression that has been pushed back */
FI, FLOATING, FOR, FORBID,
GENERAL, GOTO, GRANT, GT, GTE,
HEADEREL,
IF, IGNORED_DIRECTIVE, IN, INIT, INOUT, INLINE,
LC, LOC, LPC, LPRN, LT, LTE,
MOD, MODULE, MUL,
NAME, NE, NEW, NEWMODE, NONREF, NOPACK, NOT, NUMBER,
OD, OF, ON, OR, ORIF,
PACK, PARAMATTR, PERVASIVE, PLUS, POS, POWERSET,
PREFIXED, PRIORITY, PROC, PROCESS,
RANGE, RC, READ, READTEXT, RECEIVE, RECURSIVE, REF, REGION, REM,
RESULT, RETURN, RETURNS, ROUND, ROW, RPC, RPRN, RPRN_COLON,
SAME, SC, SEIZE, SEND, SET, SHARED, SIGNAL, SIGNALNAME, SIMPLE,
SINGLECHAR, SPEC, START, STATIC, STEP, STOP, STREAM, STRING,
STRUCT, SUB, SYN, SYNMODE,
TERMINATE, TEXT, THEN, THIS, TIMEOUT, TO, TRUNC, TYPENAME,
UP, USAGE,
VARYING,
WHERE, WHILE, WITH,
XOR,
/* These tokens only used within ch-lex.l to process compiler directives */
ALL_STATIC_OFF, ALL_STATIC_ON, EMPTY_OFF, EMPTY_ON,
GRANT_FILE_SIZE, PROCESS_TYPE_TOKEN, RANGE_OFF, RANGE_ON,
SEND_BUFFER_DEFAULT_PRIORITY, SEND_SIGNAL_DEFAULT_PRIORITY,
SIGNAL_CODE, SIGNAL_MAX_LENGTH, USE_SEIZE_FILE, USE_SEIZE_FILE_RESTRICTED,
USE_GRANT_FILE,
/* These tokens are recognized, and reported as errors, by the lexer. */
CONTEXT, REMOTE,
/* This token is passed back to the parser when an the main
input file (not a seize file) has reached end-of-file. */
END_PASS_1,
EMPTY, UMINUS,
dummy_last_terminal
};

View File

@ -1,629 +0,0 @@
/* Name-satisfaction for GNU Chill compiler.
Copyright (C) 1993, 1998, 1999, 2000 Free Software Foundation, Inc.
This file is part of GNU CC.
GNU CC is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2, or (at your option)
any later version.
GNU CC is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with GNU CC; see the file COPYING. If not, write to
the Free Software Foundation, 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. */
#include "config.h"
#include "system.h"
#include "tree.h"
#include "flags.h"
#include "ch-tree.h"
#include "lex.h"
#include "toplev.h"
#define SATISFY(ARG) ((ARG) = satisfy(ARG, chain))
struct decl_chain
{
struct decl_chain *prev;
/* DECL can be a decl, or a POINTER_TYPE or a REFERENCE_TYPE. */
tree decl;
};
/* forward declarations */
static tree satisfy PARAMS ((tree, struct decl_chain *));
static void cycle_error_print PARAMS ((struct decl_chain *, tree));
static tree safe_satisfy_decl PARAMS ((tree, struct decl_chain *));
static void satisfy_list PARAMS ((tree, struct decl_chain *));
static void satisfy_list_values PARAMS ((tree, struct decl_chain *));
static struct decl_chain dummy_chain;
#define LOOKUP_ONLY (chain==&dummy_chain)
/* Recursive helper routine to logically reverse the chain. */
static void
cycle_error_print (chain, decl)
struct decl_chain *chain;
tree decl;
{
if (chain->decl != decl)
{
cycle_error_print (chain->prev, decl);
if (TREE_CODE_CLASS (TREE_CODE (chain->decl)) == 'd')
error_with_decl (chain->decl, " `%s', which depends on ...");
}
}
static tree
safe_satisfy_decl (decl, prev_chain)
tree decl;
struct decl_chain *prev_chain;
{
struct decl_chain new_link;
struct decl_chain *link;
struct decl_chain *chain = prev_chain;
const char *save_filename = input_filename;
int save_lineno = lineno;
tree result = decl;
if (decl == NULL_TREE)
return decl;
if (!LOOKUP_ONLY)
{
int pointer_type_breaks_cycle = 0;
/* Look for a cycle.
We could do this test more efficiently by setting a flag. FIXME */
for (link = prev_chain; link != NULL; link = link->prev)
{
if (TREE_CODE_CLASS (TREE_CODE (link->decl)) != 'd')
pointer_type_breaks_cycle = 1;
if (link->decl == decl)
{
if (!pointer_type_breaks_cycle)
{
error_with_decl (decl, "cycle: `%s' depends on ...");
cycle_error_print (prev_chain, decl);
error_with_decl (decl, " `%s'");
return error_mark_node;
}
/* There is a cycle, but it includes a pointer type,
so we're OK. However, we still have to continue
the satisfy (for example in case this is a TYPE_DECL
that points to a LANG_DECL). The cycle-check for
POINTER_TYPE/REFERENCE_TYPE should stop the recursion. */
break;
}
}
new_link.decl = decl;
new_link.prev = prev_chain;
chain = &new_link;
}
input_filename = DECL_SOURCE_FILE (decl);
lineno = DECL_SOURCE_LINE (decl);
switch ((enum chill_tree_code)TREE_CODE (decl))
{
case ALIAS_DECL:
if (!LOOKUP_ONLY && !DECL_POSTFIX_ALL(decl))
result = safe_satisfy_decl (DECL_ABSTRACT_ORIGIN (decl), chain);
break;
case BASED_DECL:
SATISFY (TREE_TYPE (decl));
SATISFY (DECL_ABSTRACT_ORIGIN (decl));
break;
case CONST_DECL:
SATISFY (TREE_TYPE (decl));
SATISFY (DECL_INITIAL (decl));
if (!LOOKUP_ONLY)
{
if (DECL_SIZE (decl) == 0)
{
tree init_expr = DECL_INITIAL (decl);
tree init_type;
tree specified_mode = TREE_TYPE (decl);
if (init_expr == NULL_TREE
|| TREE_CODE (init_expr) == ERROR_MARK)
goto bad_const;
init_type = TREE_TYPE (init_expr);
if (specified_mode == NULL_TREE)
{
if (init_type == NULL_TREE)
{
check_have_mode (init_expr, "SYN without mode");
goto bad_const;
}
TREE_TYPE (decl) = init_type;
CH_DERIVED_FLAG (decl) = CH_DERIVED_FLAG (init_expr);
}
else if (CH_IS_ASSOCIATION_MODE (specified_mode) ||
CH_IS_ACCESS_MODE (specified_mode) || CH_IS_TEXT_MODE (specified_mode) ||
CH_IS_BUFFER_MODE (specified_mode) || CH_IS_EVENT_MODE (specified_mode))
{
error ("SYN of this mode not allowed");
goto bad_const;
}
else if (!CH_COMPATIBLE (init_expr, specified_mode))
{
error ("mode of SYN incompatible with value");
goto bad_const;
}
else if (discrete_type_p (specified_mode)
&& TREE_CODE (init_expr) == INTEGER_CST
&& (compare_int_csts (LT_EXPR, init_expr,
TYPE_MIN_VALUE (specified_mode))
|| compare_int_csts (GT_EXPR, init_expr,
TYPE_MAX_VALUE(specified_mode))
))
{
error ("SYN value outside range of its mode");
/* set an always-valid initial value to prevent
other errors. */
DECL_INITIAL (decl) = TYPE_MIN_VALUE (specified_mode);
}
else if (CH_STRING_TYPE_P (specified_mode)
&& (init_type && CH_STRING_TYPE_P (init_type))
&& integer_zerop (string_assignment_condition (specified_mode, init_expr)))
{
error ("INIT string too large for mode");
DECL_INITIAL (decl) = error_mark_node;
}
else
{
struct ch_class class;
class.mode = TREE_TYPE (decl);
class.kind = CH_VALUE_CLASS;
DECL_INITIAL (decl)
= convert_to_class (class, DECL_INITIAL (decl));
}
/* DECL_SIZE is set to prevent re-doing this stuff. */
DECL_SIZE (decl) = TYPE_SIZE (TREE_TYPE (decl));
DECL_SIZE_UNIT (decl) = TYPE_SIZE_UNIT (TREE_TYPE (decl));
if (! TREE_CONSTANT (DECL_INITIAL (decl))
&& TREE_CODE (DECL_INITIAL (decl)) != ERROR_MARK)
{
error_with_decl (decl,
"value of %s is not a valid constant");
DECL_INITIAL (decl) = error_mark_node;
}
}
result = DECL_INITIAL (decl);
}
break;
bad_const:
DECL_INITIAL (decl) = error_mark_node;
TREE_TYPE (decl) = error_mark_node;
return error_mark_node;
case FUNCTION_DECL:
SATISFY (TREE_TYPE (decl));
if (CH_DECL_PROCESS (decl))
safe_satisfy_decl ((tree) DECL_TASKING_CODE_DECL (decl), prev_chain);
break;
case PARM_DECL:
SATISFY (TREE_TYPE (decl));
break;
/* RESULT_DECL doesn't need to be satisfied;
it's only built internally in pass 2 */
case TYPE_DECL:
SATISFY (TREE_TYPE (decl));
if (CH_DECL_SIGNAL (decl))
safe_satisfy_decl ((tree) DECL_TASKING_CODE_DECL (decl), prev_chain);
if (!LOOKUP_ONLY)
{
if (TYPE_NAME (TREE_TYPE (decl)) == NULL_TREE)
TYPE_NAME (TREE_TYPE (decl)) = decl;
layout_decl (decl, 0);
if (CH_DECL_SIGNAL (decl) && CH_TYPE_NONVALUE_P (TREE_TYPE (decl)))
error ("mode with non-value property in signal definition");
result = TREE_TYPE (decl);
}
break;
case VAR_DECL:
SATISFY (TREE_TYPE (decl));
if (!LOOKUP_ONLY)
{
layout_decl (decl, 0);
if (TREE_READONLY (TREE_TYPE (decl)))
TREE_READONLY (decl) = 1;
}
break;
default:
;
}
/* Now set the DECL_RTL, if needed. */
if (!LOOKUP_ONLY && DECL_RTL (decl) == 0
&& (TREE_CODE (decl) == VAR_DECL || TREE_CODE (decl) == FUNCTION_DECL
|| TREE_CODE (decl) == CONST_DECL))
{
if (TREE_CODE (decl) == FUNCTION_DECL && decl_function_context (decl))
make_function_rtl (decl);
else if (!TREE_STATIC (decl) && !DECL_EXTERNAL (decl))
expand_decl (decl);
else
{ char * asm_name;
if (current_module == 0 || TREE_PUBLIC (decl)
|| current_function_decl)
asm_name = NULL;
else
{
asm_name = (char*)
alloca (IDENTIFIER_LENGTH (current_module->prefix_name)
+ IDENTIFIER_LENGTH (DECL_NAME (decl)) + 3);
sprintf (asm_name, "%s__%s",
IDENTIFIER_POINTER (current_module->prefix_name),
IDENTIFIER_POINTER (DECL_NAME (decl)));
}
make_decl_rtl (decl, asm_name, TREE_PUBLIC (decl));
}
}
input_filename = save_filename;
lineno = save_lineno;
return result;
}
tree
satisfy_decl (decl, lookup_only)
tree decl;
int lookup_only;
{
return safe_satisfy_decl (decl, lookup_only ? &dummy_chain : NULL);
}
static void
satisfy_list (exp, chain)
register tree exp;
struct decl_chain *chain;
{
for (; exp != NULL_TREE; exp = TREE_CHAIN (exp))
{
SATISFY (TREE_VALUE (exp));
SATISFY (TREE_PURPOSE (exp));
}
}
static void
satisfy_list_values (exp, chain)
register tree exp;
struct decl_chain *chain;
{
for (; exp != NULL_TREE; exp = TREE_CHAIN (exp))
{
SATISFY (TREE_VALUE (exp));
}
}
static tree
satisfy (exp, chain)
tree exp;
struct decl_chain *chain;
{
int arg_length;
int i;
tree decl;
if (exp == NULL_TREE)
return NULL_TREE;
#if 0
if (!UNSATISFIED (exp))
return exp;
#endif
switch (TREE_CODE_CLASS (TREE_CODE (exp)))
{
case 'd':
if (!LOOKUP_ONLY)
return safe_satisfy_decl (exp, chain);
break;
case 'r':
case 's':
case '<':
case 'e':
switch ((enum chill_tree_code)TREE_CODE (exp))
{
case REPLICATE_EXPR:
goto binary_op;
case TRUTH_NOT_EXPR:
goto unary_op;
case COMPONENT_REF:
SATISFY (TREE_OPERAND (exp, 0));
if (!LOOKUP_ONLY && TREE_TYPE (exp) == NULL_TREE)
return resolve_component_ref (exp);
return exp;
case CALL_EXPR:
SATISFY (TREE_OPERAND (exp, 0));
SATISFY (TREE_OPERAND (exp, 1));
if (!LOOKUP_ONLY && TREE_TYPE (exp) == NULL_TREE)
return build_generalized_call (TREE_OPERAND (exp, 0),
TREE_OPERAND (exp, 1));
return exp;
case CONSTRUCTOR:
{ tree link = TREE_OPERAND (exp, 1);
int expand_needed = TREE_TYPE (exp)
&& TREE_CODE_CLASS (TREE_CODE (TREE_TYPE (exp))) != 't';
for (; link != NULL_TREE; link = TREE_CHAIN (link))
{
SATISFY (TREE_VALUE (link));
if (!TUPLE_NAMED_FIELD (link))
SATISFY (TREE_PURPOSE (link));
}
SATISFY (TREE_TYPE (exp));
if (expand_needed && !LOOKUP_ONLY)
{
tree type = TREE_TYPE (exp);
TREE_TYPE (exp) = NULL_TREE; /* To force expansion. */
return chill_expand_tuple (type, exp);
}
return exp;
}
default:
;
}
arg_length = TREE_CODE_LENGTH (TREE_CODE (exp));
for (i = 0; i < arg_length; i++)
SATISFY (TREE_OPERAND (exp, i));
return exp;
case '1':
unary_op:
SATISFY (TREE_OPERAND (exp, 0));
if ((enum chill_tree_code)TREE_CODE (exp) == PAREN_EXPR)
return TREE_OPERAND (exp, 0);
if (!LOOKUP_ONLY)
return finish_chill_unary_op (exp);
break;
case '2':
binary_op:
SATISFY (TREE_OPERAND (exp, 0));
SATISFY (TREE_OPERAND (exp, 1));
if (!LOOKUP_ONLY && TREE_CODE (exp) != RANGE_EXPR)
return finish_chill_binary_op (exp);
break;
case 'x':
switch ((enum chill_tree_code)TREE_CODE (exp))
{
case IDENTIFIER_NODE:
decl = lookup_name (exp);
if (decl == NULL)
{
if (LOOKUP_ONLY)
return exp;
error ("undeclared identifier `%s'", IDENTIFIER_POINTER (exp));
return error_mark_node;
}
if (LOOKUP_ONLY)
return decl;
return safe_satisfy_decl (decl, chain);
case TREE_LIST:
satisfy_list (exp, chain);
break;
default:
;
}
break;
case 't':
/* If TYPE_SIZE is non-NULL, exp and its subfields has already been
satified and laid out. The exception is pointer and reference types,
which we layout before we lay out their TREE_TYPE. */
if (TYPE_SIZE (exp) && TREE_CODE (exp) != POINTER_TYPE
&& TREE_CODE (exp) != REFERENCE_TYPE)
return exp;
if (TYPE_MAIN_VARIANT (exp) != exp)
SATISFY (TYPE_MAIN_VARIANT (exp));
switch ((enum chill_tree_code)TREE_CODE (exp))
{
case LANG_TYPE:
{
tree d = TYPE_DOMAIN (exp);
tree t = satisfy (TREE_TYPE (exp), chain);
SATISFY (d);
/* It is possible that one of the above satisfy calls recursively
caused exp to be satisfied, in which case we're done. */
if (TREE_CODE (exp) != LANG_TYPE)
return exp;
TREE_TYPE (exp) = t;
TYPE_DOMAIN (exp) = d;
if (!LOOKUP_ONLY)
exp = smash_dummy_type (exp);
}
break;
case ARRAY_TYPE:
SATISFY (TREE_TYPE (exp));
SATISFY (TYPE_DOMAIN (exp));
SATISFY (TYPE_ATTRIBUTES (exp));
if (!LOOKUP_ONLY)
CH_TYPE_NONVALUE_P (exp) = CH_TYPE_NONVALUE_P (TREE_TYPE (exp));
if (!TYPE_SIZE (exp) && !LOOKUP_ONLY)
exp = layout_chill_array_type (exp);
break;
case FUNCTION_TYPE:
SATISFY (TREE_TYPE (exp));
if (TREE_CODE_CLASS (TREE_CODE (TREE_TYPE (exp))) != 't'
&& !LOOKUP_ONLY && TREE_CODE (TREE_TYPE (exp)) != ERROR_MARK)
{
error ("RETURNS spec with invalid mode");
TREE_TYPE (exp) = error_mark_node;
}
satisfy_list_values (TYPE_ARG_TYPES (exp), chain);
if (!TYPE_SIZE (exp) && !LOOKUP_ONLY)
layout_type (exp);
break;
case ENUMERAL_TYPE:
if (TYPE_SIZE (exp) == NULL_TREE && !LOOKUP_ONLY)
{ tree pair;
/* FIXME: Should this use satisfy_decl? */
for (pair = TYPE_VALUES (exp); pair; pair = TREE_CHAIN (pair))
SATISFY (DECL_INITIAL (TREE_VALUE (pair)));
layout_enum (exp);
}
break;
case INTEGER_TYPE:
SATISFY (TYPE_MIN_VALUE (exp));
SATISFY (TYPE_MAX_VALUE (exp));
if (TREE_TYPE (exp) != NULL_TREE)
{ /* A range type */
if (TREE_TYPE (exp) != ridpointers[(int) RID_RANGE]
&& TREE_TYPE (exp) != ridpointers[(int) RID_BIN]
&& TREE_TYPE (exp) != string_index_type_dummy)
SATISFY (TREE_TYPE (exp));
if (!TYPE_SIZE (exp) && !LOOKUP_ONLY)
exp = layout_chill_range_type (exp, 1);
}
break;
case POINTER_TYPE:
case REFERENCE_TYPE:
if (LOOKUP_ONLY)
SATISFY (TREE_TYPE (exp));
else
{
struct decl_chain *link;
int already_seen = 0;
for (link = chain; ; link = link->prev)
{
if (link == NULL)
{
struct decl_chain new_link;
new_link.decl = exp;
new_link.prev = chain;
TREE_TYPE (exp) = satisfy (TREE_TYPE (exp), &new_link);
break;
}
else if (link->decl == exp)
{
already_seen = 1;
break;
}
}
if (!TYPE_SIZE (exp))
{
layout_type (exp);
if (TREE_CODE (exp) == REFERENCE_TYPE)
CH_NOVELTY (exp) = CH_NOVELTY (TREE_TYPE (exp));
if (! already_seen)
{
tree valtype = TREE_TYPE (exp);
if (TREE_CODE_CLASS (TREE_CODE (valtype)) != 't')
{
if (TREE_CODE (valtype) != ERROR_MARK)
error ("operand to REF is not a mode");
TREE_TYPE (exp) = error_mark_node;
return error_mark_node;
}
else if (TREE_CODE (exp) == POINTER_TYPE
&& TYPE_POINTER_TO (valtype) == NULL)
TYPE_POINTER_TO (valtype) = exp;
}
}
}
break;
case RECORD_TYPE:
{
/* FIXME: detected errors in here will be printed as
often as this sequence runs. Find another way or
place to print the errors. */
/* if we have an ACCESS or TEXT mode we have to set
maximum_field_alignment to 0 to fit with runtime
system, even when we compile with -fpack. */
unsigned int save_maximum_field_alignment = maximum_field_alignment;
if (CH_IS_ACCESS_MODE (exp) || CH_IS_TEXT_MODE (exp))
maximum_field_alignment = 0;
for (decl = TYPE_FIELDS (exp); decl; decl = TREE_CHAIN (decl))
{
SATISFY (TREE_TYPE (decl));
if (!LOOKUP_ONLY)
{
/* if we have a UNION_TYPE here (variant structure), check for
non-value mode in it. This is not allowed (Z.200/pg. 33) */
if (TREE_CODE (TREE_TYPE (decl)) == UNION_TYPE &&
CH_TYPE_NONVALUE_P (TREE_TYPE (decl)))
{
error ("field with non-value mode in variant structure not allowed");
TREE_TYPE (decl) = error_mark_node;
}
/* RECORD_TYPE gets the non-value property if one of the
fields has the non-value property */
CH_TYPE_NONVALUE_P (exp) |= CH_TYPE_NONVALUE_P (TREE_TYPE (decl));
}
if (TREE_CODE (decl) == CONST_DECL)
{
SATISFY (DECL_INITIAL (decl));
if (!LOOKUP_ONLY)
{
if (CH_IS_BUFFER_MODE (exp) || CH_IS_EVENT_MODE (exp))
DECL_INITIAL (decl)
= check_queue_size (DECL_INITIAL (decl));
else if (CH_IS_TEXT_MODE (exp) &&
DECL_NAME (decl) == get_identifier ("__textlength"))
DECL_INITIAL (decl)
= check_text_length (DECL_INITIAL (decl));
}
}
else if (TREE_CODE (decl) == FIELD_DECL)
{
SATISFY (DECL_INITIAL (decl));
}
}
satisfy_list (TYPE_TAG_VALUES (exp), chain);
if (!TYPE_SIZE (exp) && !LOOKUP_ONLY)
exp = layout_chill_struct_type (exp);
maximum_field_alignment = save_maximum_field_alignment;
/* perform some checks on nonvalue modes, they are record_mode's */
if (!LOOKUP_ONLY)
{
if (CH_IS_BUFFER_MODE (exp))
{
tree elemmode = buffer_element_mode (exp);
if (elemmode != NULL_TREE && CH_TYPE_NONVALUE_P (elemmode))
{
error ("buffer element mode must not have non-value property");
invalidate_buffer_element_mode (exp);
}
}
else if (CH_IS_ACCESS_MODE (exp))
{
tree recordmode = access_recordmode (exp);
if (recordmode != NULL_TREE && CH_TYPE_NONVALUE_P (recordmode))
{
error ("recordmode must not have the non-value property");
invalidate_access_recordmode (exp);
}
}
}
}
break;
case SET_TYPE:
SATISFY (TYPE_DOMAIN (exp));
if (!TYPE_SIZE (exp) && !LOOKUP_ONLY)
exp = layout_powerset_type (exp);
break;
case UNION_TYPE:
for (decl = TYPE_FIELDS (exp); decl; decl = TREE_CHAIN (decl))
{
SATISFY (TREE_TYPE (decl));
if (!LOOKUP_ONLY)
CH_TYPE_NONVALUE_P (exp) |= CH_TYPE_NONVALUE_P (TREE_TYPE (decl));
}
if (!TYPE_SIZE (exp) && !LOOKUP_ONLY)
exp = layout_chill_variants (exp);
break;
default:
;
}
}
return exp;
}

File diff suppressed because it is too large Load Diff

View File

@ -1,27 +0,0 @@
/* Implement process-related declarations for CHILL.
Copyright (C) 1992, 1993, 1994 Free Software Foundation, Inc.
This file is part of GNU CC.
GNU CC is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2, or (at your option)
any later version.
GNU CC is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with GNU CC; see the file COPYING. If not, write to
the Free Software Foundation, 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. */
#ifndef GCC_TASKING_H
#define GCC_TASKING_H
/* list of this module's process, buffer, etc. decls */
extern tree tasking_list;
#endif /* ! GCC_TASKING_H */

View File

@ -1,491 +0,0 @@
/* Implement timing-related actions for CHILL.
Copyright (C) 1992, 1993, 1994, 1998, 2000, 2001
Free Software Foundation, Inc.
This file is part of GNU CC.
GNU CC is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2, or (at your option)
any later version.
GNU CC is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with GNU CC; see the file COPYING. If not, write to
the Free Software Foundation, 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. */
#include "config.h"
#include "system.h"
#include "tree.h"
#include "rtl.h"
#include "ch-tree.h"
#include "flags.h"
#include "input.h"
#include "obstack.h"
#include "lex.h"
#include "toplev.h"
/* set non-zero if input text is forced to lowercase */
extern int ignore_case;
/* set non-zero if special words are to be entered in uppercase */
extern int special_UC;
/* timing modes */
tree abs_timing_type_node;
tree duration_timing_type_node;
/* rts time type */
static tree rtstime_type_node = NULL_TREE;
/* the stack for AFTER primval [ DELAY ] IN
and has following layout
TREE_VALUE (TREE_VALUE (after_stack)) = current time or NULL_TREE (if DELAY specified)
TREE_PURPOSE (TREE_VALUE (after_stack)) = the duration location
TREE_VALUE (TREE_PURPOSE (after_stack)) = label at TIMEOUT
TREE_PURPOSE (TREE_PURPOSE (after_stack)) = label at the end of AFTER action
*/
tree after_stack = NULL_TREE;
/* in pass 1 we need a separate list for the labels */
static tree after_stack_pass_1 = NULL_TREE;
static tree after_help;
void
timing_init ()
{
tree ptr_ftype_durt_ptr_int;
tree int_ftype_abst_ptr_int;
tree void_ftype_ptr;
tree long_ftype_int_int_int_int_int_int_int_ptr_int;
tree void_ftype_abstime_ptr;
tree int_ftype_ptr_durt_ptr;
tree void_ftype_durt_ptr;
tree void_ftype_ptr_durt_ptr_int;
tree temp;
tree endlink;
tree ulong_type;
ulong_type = TREE_TYPE (lookup_name (
get_identifier ((ignore_case || ! special_UC ) ?
"ulong" : "ULONG")));
/* build modes for TIME and DURATION */
duration_timing_type_node = make_unsigned_type (LONG_TYPE_SIZE);
temp = pushdecl (build_decl (TYPE_DECL, ridpointers[(int)RID_DURATION],
duration_timing_type_node));
SET_CH_NOVELTY_NONNIL (duration_timing_type_node, temp);
abs_timing_type_node = make_unsigned_type (LONG_TYPE_SIZE);
temp = pushdecl (build_decl (TYPE_DECL, ridpointers[(int)RID_TIME],
abs_timing_type_node));
SET_CH_NOVELTY_NONNIL (abs_timing_type_node, temp);
/* the mode of time the runtimesystem returns */
if (rtstime_type_node == NULL_TREE)
{
tree decl1, decl2, result;
decl1 = build_decl (FIELD_DECL,
get_identifier ("secs"),
ulong_type);
DECL_INITIAL (decl1) = NULL_TREE;
decl2 = build_decl (FIELD_DECL,
get_identifier ("nsecs"),
ulong_type);
DECL_INITIAL (decl2) = NULL_TREE;
TREE_CHAIN (decl2) = NULL_TREE;
TREE_CHAIN (decl1) = decl2;
result = build_chill_struct_type (decl1);
pushdecl (temp = build_decl (TYPE_DECL,
get_identifier ("__tmp_rtstime"), result));
DECL_SOURCE_LINE (temp) = 0;
satisfy_decl (temp, 0);
rtstime_type_node = TREE_TYPE (temp);
}
endlink = void_list_node;
ptr_ftype_durt_ptr_int
= build_function_type (ptr_type_node,
tree_cons (NULL_TREE, duration_timing_type_node,
tree_cons (NULL_TREE, ptr_type_node,
tree_cons (NULL_TREE, integer_type_node,
endlink))));
int_ftype_abst_ptr_int
= build_function_type (integer_type_node,
tree_cons (NULL_TREE, abs_timing_type_node,
tree_cons (NULL_TREE, ptr_type_node,
tree_cons (NULL_TREE, integer_type_node,
endlink))));
void_ftype_ptr
= build_function_type (void_type_node,
tree_cons (NULL_TREE, ptr_type_node,
endlink));
long_ftype_int_int_int_int_int_int_int_ptr_int
= build_function_type (abs_timing_type_node,
tree_cons (NULL_TREE, integer_type_node,
tree_cons (NULL_TREE, integer_type_node,
tree_cons (NULL_TREE, integer_type_node,
tree_cons (NULL_TREE, integer_type_node,
tree_cons (NULL_TREE, integer_type_node,
tree_cons (NULL_TREE, integer_type_node,
tree_cons (NULL_TREE, integer_type_node,
tree_cons (NULL_TREE, ptr_type_node,
tree_cons (NULL_TREE, integer_type_node,
endlink))))))))));
void_ftype_abstime_ptr
= build_function_type (void_type_node,
tree_cons (NULL_TREE, abs_timing_type_node,
tree_cons (NULL_TREE, ptr_type_node,
endlink)));
int_ftype_ptr_durt_ptr
= build_function_type (integer_type_node,
tree_cons (NULL_TREE, ptr_type_node,
tree_cons (NULL_TREE, duration_timing_type_node,
tree_cons (NULL_TREE, ptr_type_node,
endlink))));
void_ftype_durt_ptr
= build_function_type (void_type_node,
tree_cons (NULL_TREE, duration_timing_type_node,
tree_cons (NULL_TREE, ptr_type_node,
endlink)));
void_ftype_ptr_durt_ptr_int
= build_function_type (void_type_node,
tree_cons (NULL_TREE, ptr_type_node,
tree_cons (NULL_TREE, duration_timing_type_node,
tree_cons (NULL_TREE, ptr_type_node,
tree_cons (NULL_TREE, integer_type_node,
endlink)))));
builtin_function ("_abstime", long_ftype_int_int_int_int_int_int_int_ptr_int,
0, NOT_BUILT_IN, NULL_PTR);
builtin_function ("__check_cycle", void_ftype_ptr_durt_ptr_int,
0, NOT_BUILT_IN, NULL_PTR);
builtin_function ("__convert_duration_rtstime", void_ftype_durt_ptr,
0, NOT_BUILT_IN, NULL_PTR);
builtin_function ("__define_timeout", ptr_ftype_durt_ptr_int,
0, NOT_BUILT_IN, NULL_PTR);
builtin_function ("_inttime", void_ftype_abstime_ptr,
0, NOT_BUILT_IN, NULL_PTR);
builtin_function ("__remaintime", int_ftype_ptr_durt_ptr,
0, NOT_BUILT_IN, NULL_PTR);
builtin_function ("__rtstime", void_ftype_ptr,
0, NOT_BUILT_IN, NULL_PTR);
builtin_function ("__wait_until", int_ftype_abst_ptr_int,
0, NOT_BUILT_IN, NULL_PTR);
}
/*
*
* build AT action
*
* AT primval IN
* ok-actionlist
* TIMEOUT
* to-actionlist
* END;
*
* gets translated to
*
* if (__wait_until (primval) == 0)
* ok-actionlist
* else
* to-action-list
*
*/
void
build_at_action (t)
tree t;
{
tree abstime, expr, filename, fcall;
if (t == NULL_TREE || TREE_CODE (t) == ERROR_MARK)
abstime = convert (abs_timing_type_node, build_int_2 (0, 0));
else
abstime = t;
if (TREE_TYPE (abstime) != abs_timing_type_node)
{
error ("absolute time value must be of mode TIME");
abstime = convert (abs_timing_type_node, build_int_2 (0, 0));
}
filename = force_addr_of (get_chill_filename ());
fcall = build_chill_function_call (
lookup_name (get_identifier ("__wait_until")),
tree_cons (NULL_TREE, abstime,
tree_cons (NULL_TREE, filename,
tree_cons (NULL_TREE, get_chill_linenumber (), NULL_TREE))));
expr = build (EQ_EXPR, integer_type_node, fcall, integer_zero_node);
expand_start_cond (expr, 0);
emit_line_note (input_filename, lineno);
}
/*
*
* build CYCLE action
*
* CYCLE primval IN
* actionlist
* END;
*
* gets translated to
*
* {
* RtsTime now;
* label:
* __rtstime (&now);
* actionlist
* __check_cycle (&now, primval, filename, lineno);
* goto label;
* }
*
*/
tree
build_cycle_start (t)
tree t;
{
tree purpose = build_tree_list (NULL_TREE, NULL_TREE);
tree toid = build_tree_list (purpose, NULL_TREE);
/* define the label. Note: define_label needs to be called in
pass 1 and pass 2. */
TREE_VALUE (toid) = define_label (input_filename, lineno,
get_unique_identifier ("CYCLE_label"));
if (! ignoring)
{
tree duration_value, now_location;
if (t == NULL_TREE || TREE_CODE (t) == ERROR_MARK)
duration_value = convert (duration_timing_type_node, build_int_2 (0,0));
else
duration_value = t;
if (TREE_TYPE (duration_value) != duration_timing_type_node)
{
error ("duration primitive value must be of mode DURATION");
duration_value = convert (duration_timing_type_node, build_int_2 (0,0));
}
TREE_PURPOSE (TREE_PURPOSE (toid)) = duration_value;
/* define the variable */
now_location = decl_temp1 (get_unique_identifier ("CYCLE_var"),
rtstime_type_node, 0,
NULL_TREE, 0, 0);
TREE_VALUE (TREE_PURPOSE (toid)) = force_addr_of (now_location);
/* build the call to __rtstime */
expand_expr_stmt (
build_chill_function_call (lookup_name (get_identifier ("__rtstime")),
build_tree_list (NULL_TREE, TREE_VALUE (TREE_PURPOSE (toid)))));
}
return toid;
}
void
build_cycle_end (toid)
tree toid;
{
tree filename, linenumber;
/* here we call __check_cycle and then jump to beginning of this
action */
filename = force_addr_of (get_chill_filename ());
linenumber = get_chill_linenumber ();
expand_expr_stmt (
build_chill_function_call (
lookup_name (get_identifier ("__check_cycle")),
tree_cons (NULL_TREE, TREE_VALUE (TREE_PURPOSE (toid)),
tree_cons (NULL_TREE, TREE_PURPOSE (TREE_PURPOSE (toid)),
tree_cons (NULL_TREE, filename,
tree_cons (NULL_TREE, linenumber, NULL_TREE))))));
expand_goto (TREE_VALUE (toid));
}
/*
*
* build AFTER ACTION
*
* AFTER primval [ DELAY ] IN
* action-list
* TIMEOUT
* to-action-list
* END
*
* gets translated to
*
* {
* struct chill_time __now;
* duration dur = primval;
* if (! delay_spceified)
* __rts_time (&__now);
* .
* .
* goto end-label;
* to-label:
* .
* .
* end-label:
* }
*
*/
void
build_after_start (duration, delay_flag)
tree duration;
int delay_flag;
{
tree value, purpose;
if (! ignoring)
{
value = tree_cons (NULL_TREE, NULL_TREE, NULL_TREE);
purpose = after_stack_pass_1;
after_stack_pass_1 = TREE_CHAIN (after_stack_pass_1);
after_stack = tree_cons (purpose, value, after_stack);
if (TREE_TYPE (duration) != duration_timing_type_node)
{
error ("duration primitive value must be of mode DURATION");
duration = convert (duration_timing_type_node, build_int_2 (0,0));
}
TREE_PURPOSE (value) = decl_temp1 (get_identifier ("AFTER_duration"),
duration_timing_type_node, 0,
duration, 0, 0);
if (! delay_flag)
{
/* in this case we have to get the current time */
TREE_VALUE (value) = decl_temp1 (get_unique_identifier ("AFTER_now"),
rtstime_type_node, 0,
NULL_TREE, 0, 0);
/* build the function call to initialize the variable */
expand_expr_stmt (
build_chill_function_call (lookup_name (get_identifier ("__rtstime")),
build_tree_list (NULL_TREE, force_addr_of (TREE_VALUE (value)))));
}
}
else
{
/* in pass 1 we just save the labels */
after_help = tree_cons (NULL_TREE, NULL_TREE, after_help);
after_stack_pass_1 = chainon (after_stack_pass_1, after_help);
}
}
void
build_after_timeout_start ()
{
tree label_name;
if (! ignoring)
{
/* jump to the end of AFTER action */
lookup_and_expand_goto (TREE_PURPOSE (TREE_PURPOSE (after_stack)));
label_name = TREE_VALUE (TREE_PURPOSE (after_stack));
/* mark we are in TIMEOUT part of AFTER action */
TREE_VALUE (TREE_PURPOSE (after_stack)) = NULL_TREE;
}
else
{
label_name = get_unique_identifier ("AFTER_tolabel");
TREE_VALUE (after_help) = label_name;
}
define_label (input_filename, lineno, label_name);
}
void
build_after_end ()
{
tree label_name;
/* define the end label */
if (! ignoring)
{
label_name = TREE_PURPOSE (TREE_PURPOSE (after_stack));
after_stack = TREE_CHAIN (after_stack);
}
else
{
label_name = get_unique_identifier ("AFTER_endlabel");
TREE_PURPOSE (after_help) = label_name;
after_help = TREE_CHAIN (after_help);
}
define_label (input_filename, lineno, label_name);
}
tree
build_timeout_preface ()
{
tree timeout_value = null_pointer_node;
if (after_stack != NULL_TREE &&
TREE_VALUE (TREE_PURPOSE (after_stack)) != NULL_TREE)
{
tree to_loc;
to_loc = decl_temp1 (get_unique_identifier ("TOloc"),
rtstime_type_node, 0, NULL_TREE, 0, 0);
timeout_value = force_addr_of (to_loc);
if (TREE_VALUE (TREE_VALUE (after_stack)) == NULL_TREE)
{
/* DELAY specified -- just call __convert_duration_rtstime for
given duration value */
expand_expr_stmt (
build_chill_function_call (
lookup_name (get_identifier ("__convert_duration_rtstime")),
tree_cons (NULL_TREE, TREE_PURPOSE (TREE_VALUE (after_stack)),
tree_cons (NULL_TREE, timeout_value, NULL_TREE))));
}
else
{
/* delay not specified -- call __remaintime which returns the
remaining time of duration in rtstime format and check the
result */
tree fcall =
build_chill_function_call (
lookup_name (get_identifier ("__remaintime")),
tree_cons (NULL_TREE, force_addr_of (TREE_VALUE (TREE_VALUE (after_stack))),
tree_cons (NULL_TREE, TREE_PURPOSE (TREE_VALUE (after_stack)),
tree_cons (NULL_TREE, timeout_value, NULL_TREE))));
tree expr = build (NE_EXPR, integer_type_node,
fcall, integer_zero_node);
expand_start_cond (expr, 0);
lookup_and_expand_goto (TREE_VALUE (TREE_PURPOSE (after_stack)));
expand_end_cond ();
}
}
return timeout_value;
}
void
build_timesupervised_call (fcall, to_loc)
tree fcall;
tree to_loc;
{
if (to_loc == null_pointer_node)
expand_expr_stmt (fcall);
else
{
tree expr = build (NE_EXPR, integer_type_node, fcall, integer_zero_node);
expand_start_cond (expr, 0);
lookup_and_expand_goto (TREE_VALUE (TREE_PURPOSE (after_stack)));
expand_end_cond ();
}
}

View File

@ -1,294 +0,0 @@
/* Language-dependent node constructors for parse phase of GNU compiler.
Copyright (C) 1992, 1993, 1994, 1998, 1999, 2000
Free Software Foundation, Inc.
This file is part of GNU CC.
GNU CC is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2, or (at your option)
any later version.
GNU CC is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with GNU CC; see the file COPYING. If not, write to
the Free Software Foundation, 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. */
#include "config.h"
#include "system.h"
#include "obstack.h"
#include "tree.h"
#include "ch-tree.h"
#include "toplev.h"
extern struct obstack permanent_obstack;
/* This is special sentinel used to communicate from build_string_type
to layout_chill_range_type for the index range of a string. */
tree string_index_type_dummy;
static tree make_powerset_type PARAMS ((tree));
/* Build a chill string type.
For a character string, ELT_TYPE==char_type_node;
for a bit-string, ELT_TYPE==boolean_type_node. */
tree
build_string_type (elt_type, length)
tree elt_type;
tree length;
{
register tree t;
if (TREE_CODE (elt_type) == ERROR_MARK || TREE_CODE (length) == ERROR_MARK)
return error_mark_node;
/* Allocate the array after the pointer type,
in case we free it in type_hash_canon. */
if (pass > 0 && TREE_CODE (length) == INTEGER_CST
&& ! tree_int_cst_equal (length, integer_zero_node)
&& compare_int_csts (LT_EXPR, TYPE_MAX_VALUE (chill_unsigned_type_node),
length))
{
error ("string length > UPPER (UINT)");
length = integer_one_node;
}
/* Subtract 1 from length to get max index value.
Note we cannot use size_binop for pass 1 expressions. */
if (TREE_CODE (length) == INTEGER_CST || pass != 1)
length = size_binop (MINUS_EXPR, length, size_one_node);
else
length = build (MINUS_EXPR, sizetype, length, size_one_node);
t = make_node (elt_type == boolean_type_node ? SET_TYPE : ARRAY_TYPE);
TREE_TYPE (t) = elt_type;
MARK_AS_STRING_TYPE (t);
TYPE_DOMAIN (t) = build_chill_range_type (string_index_type_dummy,
integer_zero_node, length);
if (pass == 1 && TREE_CODE (length) == INTEGER_CST)
TYPE_DOMAIN (t) = layout_chill_range_type (TYPE_DOMAIN (t), 0);
if (pass != 1
|| (TREE_CODE (length) == INTEGER_CST && TYPE_SIZE (elt_type)))
{
if (TREE_CODE (t) == SET_TYPE)
t = layout_powerset_type (t);
else
t = layout_chill_array_type (t);
}
return t;
}
static tree
make_powerset_type (domain)
tree domain;
{
tree t = make_node (SET_TYPE);
TREE_TYPE (t) = boolean_type_node;
TYPE_DOMAIN (t) = domain;
return t;
}
/* Used to layout both bitstring and powerset types. */
tree
layout_powerset_type (type)
tree type;
{
tree domain = TYPE_DOMAIN (type);
if (! discrete_type_p (domain))
{
error ("can only build a powerset from a discrete mode");
return error_mark_node;
}
if (TREE_CODE (TYPE_MAX_VALUE (domain)) == ERROR_MARK ||
TREE_CODE (TYPE_MIN_VALUE (domain)) == ERROR_MARK)
return error_mark_node;
if (TREE_CODE (TYPE_MAX_VALUE (domain)) != INTEGER_CST
|| TREE_CODE (TYPE_MIN_VALUE (domain)) != INTEGER_CST)
{
if (CH_BOOLS_TYPE_P (type))
error ("non-constant bitstring size invalid");
else
error ("non-constant powerset size invalid");
return error_mark_node;
}
if (TYPE_SIZE (type) == 0)
layout_type (type);
return type;
}
/* Build a SET_TYPE node whose elements are from the set of values
in TYPE. TYPE must be a discrete mode; we check for that here. */
tree
build_powerset_type (type)
tree type;
{
tree t = make_powerset_type (type);
if (pass != 1)
t = layout_powerset_type (t);
return t;
}
tree
build_bitstring_type (size_in_bits)
tree size_in_bits;
{
return build_string_type (boolean_type_node, size_in_bits);
}
/* Return get_identifier (the concatenations of part1, part2, and part3). */
tree
get_identifier3 (part1, part2, part3)
const char *part1, *part2, *part3;
{
char *buf = (char*)
alloca (strlen(part1) + strlen(part2) + strlen(part3) + 1);
sprintf (buf, "%s%s%s", part1, part2, part3);
return get_identifier (buf);
}
/* Build an ALIAS_DECL for the prefix renamed clause:
(OLD_PREFIX -> NEW_PREFIX) ! POSTFIX. */
tree
build_alias_decl (old_prefix, new_prefix, postfix)
tree old_prefix, new_prefix, postfix;
{
tree decl = make_node (ALIAS_DECL);
const char *postfix_pointer = IDENTIFIER_POINTER (postfix);
int postfix_length = IDENTIFIER_LENGTH (postfix);
int old_length = old_prefix ? IDENTIFIER_LENGTH(old_prefix) : 0;
int new_length = new_prefix ? IDENTIFIER_LENGTH(new_prefix) : 0;
char *buf = (char*) alloca (old_length + new_length + postfix_length + 3);
/* Convert (OP->NP)!P!ALL to (OP!P->NP!P)!ALL */
if (postfix_length > 1 && postfix_pointer[postfix_length-1] == '*')
{
int chopped_length = postfix_length - 2; /* Without final "!*" */
if (old_prefix)
sprintf (buf, "%s!%.*s", IDENTIFIER_POINTER (old_prefix),
chopped_length, postfix_pointer);
else
sprintf (buf, "%.*s", chopped_length, postfix_pointer);
old_prefix = get_identifier (buf);
if (new_prefix)
sprintf (buf, "%s!%.*s", IDENTIFIER_POINTER (new_prefix),
chopped_length, postfix_pointer);
else
sprintf (buf, "%.*s", chopped_length, postfix_pointer);
new_prefix = get_identifier (buf);
postfix = ALL_POSTFIX;
}
DECL_OLD_PREFIX (decl) = old_prefix;
DECL_NEW_PREFIX (decl) = new_prefix;
DECL_POSTFIX (decl) = postfix;
if (DECL_POSTFIX_ALL (decl))
DECL_NAME (decl) = NULL_TREE;
else if (new_prefix == NULL_TREE)
DECL_NAME (decl) = postfix;
else
DECL_NAME (decl) = get_identifier3 (IDENTIFIER_POINTER (new_prefix),
"!", IDENTIFIER_POINTER (postfix));
return decl;
}
/* Return the "old name string" of an ALIAS_DECL. */
tree
decl_old_name (decl)
tree decl;
{
if (DECL_OLD_PREFIX (decl) == NULL_TREE)
return DECL_POSTFIX (decl);
return get_identifier3 (IDENTIFIER_POINTER (DECL_OLD_PREFIX (decl)),
"!", IDENTIFIER_POINTER (DECL_POSTFIX (decl)));
}
/* See if OLD_NAME (an identifier) matches the OLD_PREFIX!POSTFIX
of ALIAS. If so, return the corresponding NEW_NEW!POSTFIX. */
tree
decl_check_rename (alias, old_name)
tree alias, old_name;
{
const char *old_pointer = IDENTIFIER_POINTER (old_name);
int old_len = IDENTIFIER_LENGTH (old_name);
if (DECL_OLD_PREFIX (alias))
{
int old_prefix_len = IDENTIFIER_LENGTH (DECL_OLD_PREFIX (alias));
if (old_prefix_len >= old_len
|| old_pointer[old_prefix_len] != '!'
|| strncmp (old_pointer, IDENTIFIER_POINTER (DECL_OLD_PREFIX (alias)), old_prefix_len) != 0)
return NULL_TREE;
/* Skip the old prefix. */
old_pointer += old_prefix_len + 1; /* Also skip the '!', */
}
if (DECL_POSTFIX_ALL (alias)
|| strcmp (IDENTIFIER_POINTER (DECL_POSTFIX (alias)), old_pointer) == 0)
{
if (DECL_NEW_PREFIX (alias))
return get_identifier3 (IDENTIFIER_POINTER (DECL_NEW_PREFIX (alias)),
"!", old_pointer);
else if (old_pointer == IDENTIFIER_POINTER (old_name))
return old_name;
else
return get_identifier (old_pointer);
}
else
return NULL_TREE;
}
/* 'EXIT foo' is treated like 'GOTO EXIT!foo'.
This function converts LABEL into a labal name for EXIT. */
tree
munge_exit_label (label)
tree label;
{
return get_identifier3 ("EXIT", "!", IDENTIFIER_POINTER (label));
}
/* Make SAVE_EXPRs as needed, but don't turn a location into a non-location. */
tree
save_if_needed (exp)
tree exp;
{
return CH_REFERABLE (exp) ? stabilize_reference (exp) : save_expr (exp);
}
/* Return the number of elements in T, which must be a discrete type. */
tree
discrete_count (t)
tree t;
{
tree hi = convert (sizetype, TYPE_MAX_VALUE (t));
if (TYPE_MIN_VALUE (t))
hi = size_binop (MINUS_EXPR, hi, convert (sizetype, TYPE_MIN_VALUE (t)));
return size_binop (PLUS_EXPR, hi, integer_one_node);
}

File diff suppressed because it is too large Load Diff

View File

@ -1,272 +0,0 @@
/* Copyright (C) 1992, 1993, 1994, 1998 Free Software Foundation, Inc.
This file is part of GNU CC.
GNU CC is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2, or (at your option)
any later version.
GNU CC is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with GNU CC; see the file COPYING. If not, write to
the Free Software Foundation, 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. */
#if 0
tree
build_component_ref (datum, field_name)
tree datum, field_name;
{
return build_chill_component_ref (datum, field_name);
}
/* Mark EXP saying that we need to be able to take the
address of it; it should not be allocated in a register.
Value is 1 if successful. */
int
mark_addressable (exp)
tree exp;
{
register tree x = exp;
while (1)
switch (TREE_CODE (x))
{
case ADDR_EXPR:
case COMPONENT_REF:
case ARRAY_REF:
case REALPART_EXPR:
case IMAGPART_EXPR:
x = TREE_OPERAND (x, 0);
break;
case CONSTRUCTOR:
TREE_ADDRESSABLE (x) = 1;
return 1;
case VAR_DECL:
case CONST_DECL:
case PARM_DECL:
case RESULT_DECL:
if (DECL_REGISTER (x) && !TREE_ADDRESSABLE (x)
&& DECL_NONLOCAL (x))
{
if (TREE_PUBLIC (x))
{
error ("global register variable `%s' used in nested function",
IDENTIFIER_POINTER (DECL_NAME (x)));
return 0;
}
pedwarn ("register variable `%s' used in nested function",
IDENTIFIER_POINTER (DECL_NAME (x)));
}
else if (DECL_REGISTER (x) && !TREE_ADDRESSABLE (x))
{
if (TREE_PUBLIC (x))
{
error ("address of global register variable `%s' requested",
IDENTIFIER_POINTER (DECL_NAME (x)));
return 0;
}
/* If we are making this addressable due to its having
volatile components, give a different error message. Also
handle the case of an unnamed parameter by not trying
to give the name. */
else if (C_TYPE_FIELDS_VOLATILE (TREE_TYPE (x)))
{
error ("cannot put object with volatile field into register");
return 0;
}
pedwarn ("address of register variable `%s' requested",
IDENTIFIER_POINTER (DECL_NAME (x)));
}
put_var_into_stack (x);
/* drops in */
case FUNCTION_DECL:
TREE_ADDRESSABLE (x) = 1;
#if 0 /* poplevel deals with this now. */
if (DECL_CONTEXT (x) == 0)
TREE_ADDRESSABLE (DECL_ASSEMBLER_NAME (x)) = 1;
#endif
default:
return 1;
}
}
/* Return an unsigned type the same as TYPE in other respects. */
tree
unsigned_type (type)
tree type;
{
tree type1 = TYPE_MAIN_VARIANT (type);
if (type1 == signed_char_type_node || type1 == char_type_node)
return unsigned_char_type_node;
if (type1 == integer_type_node)
return unsigned_type_node;
if (type1 == short_integer_type_node)
return short_unsigned_type_node;
if (type1 == long_integer_type_node)
return long_unsigned_type_node;
if (type1 == long_long_integer_type_node)
return long_long_unsigned_type_node;
return type;
}
/* Return a signed type the same as TYPE in other respects. */
tree
signed_type (type)
tree type;
{
tree type1 = TYPE_MAIN_VARIANT (type);
if (type1 == unsigned_char_type_node || type1 == char_type_node)
return signed_char_type_node;
if (type1 == unsigned_type_node)
return integer_type_node;
if (type1 == short_unsigned_type_node)
return short_integer_type_node;
if (type1 == long_unsigned_type_node)
return long_integer_type_node;
if (type1 == long_long_unsigned_type_node)
return long_long_integer_type_node;
return type;
}
/* Return a type the same as TYPE except unsigned or
signed according to UNSIGNEDP. */
tree
signed_or_unsigned_type (unsignedp, type)
int unsignedp;
tree type;
{
if (! INTEGRAL_TYPE_P (type))
return type;
if (TYPE_PRECISION (type) == TYPE_PRECISION (signed_char_type_node))
return unsignedp ? unsigned_char_type_node : signed_char_type_node;
if (TYPE_PRECISION (type) == TYPE_PRECISION (integer_type_node))
return unsignedp ? unsigned_type_node : integer_type_node;
if (TYPE_PRECISION (type) == TYPE_PRECISION (short_integer_type_node))
return unsignedp ? short_unsigned_type_node : short_integer_type_node;
if (TYPE_PRECISION (type) == TYPE_PRECISION (long_integer_type_node))
return unsignedp ? long_unsigned_type_node : long_integer_type_node;
if (TYPE_PRECISION (type) == TYPE_PRECISION (long_long_integer_type_node))
return (unsignedp ? long_long_unsigned_type_node
: long_long_integer_type_node);
return type;
}
extern tree intHI_type_node;
extern tree intSI_type_node;
extern tree intDI_type_node;
extern tree unsigned_intHI_type_node;
extern tree unsigned_intSI_type_node;
extern tree unsigned_intDI_type_node;
/* Return an integer type with BITS bits of precision,
that is unsigned if UNSIGNEDP is nonzero, otherwise signed. */
tree
type_for_size (bits, unsignedp)
unsigned bits;
int unsignedp;
{
if (bits == TYPE_PRECISION (signed_char_type_node))
return unsignedp ? unsigned_char_type_node : signed_char_type_node;
if (bits == TYPE_PRECISION (short_integer_type_node))
return unsignedp ? short_unsigned_type_node : short_integer_type_node;
if (bits == TYPE_PRECISION (integer_type_node))
return unsignedp ? unsigned_type_node : integer_type_node;
if (bits == TYPE_PRECISION (long_integer_type_node))
return unsignedp ? long_unsigned_type_node : long_integer_type_node;
if (bits == TYPE_PRECISION (long_long_integer_type_node))
return (unsignedp ? long_long_unsigned_type_node
: long_long_integer_type_node);
if (bits <= TYPE_PRECISION (intHI_type_node))
return unsignedp ? unsigned_intHI_type_node : intHI_type_node;
if (bits <= TYPE_PRECISION (intSI_type_node))
return unsignedp ? unsigned_intSI_type_node : intSI_type_node;
if (bits <= TYPE_PRECISION (intDI_type_node))
return unsignedp ? unsigned_intDI_type_node : intDI_type_node;
return 0;
}
/* Return a data type that has machine mode MODE.
If the mode is an integer,
then UNSIGNEDP selects between signed and unsigned types. */
tree
type_for_mode (mode, unsignedp)
enum machine_mode mode;
int unsignedp;
{
if (mode == TYPE_MODE (signed_char_type_node))
return unsignedp ? unsigned_char_type_node : signed_char_type_node;
if (mode == TYPE_MODE (short_integer_type_node))
return unsignedp ? short_unsigned_type_node : short_integer_type_node;
if (mode == TYPE_MODE (integer_type_node))
return unsignedp ? unsigned_type_node : integer_type_node;
if (mode == TYPE_MODE (long_integer_type_node))
return unsignedp ? long_unsigned_type_node : long_integer_type_node;
if (mode == TYPE_MODE (long_long_integer_type_node))
return unsignedp ? long_long_unsigned_type_node : long_long_integer_type_node;
if (mode == TYPE_MODE (intHI_type_node))
return unsignedp ? unsigned_intHI_type_node : intHI_type_node;
if (mode == TYPE_MODE (intSI_type_node))
return unsignedp ? unsigned_intSI_type_node : intSI_type_node;
if (mode == TYPE_MODE (intDI_type_node))
return unsignedp ? unsigned_intDI_type_node : intDI_type_node;
if (mode == TYPE_MODE (float_type_node))
return float_type_node;
if (mode == TYPE_MODE (double_type_node))
return double_type_node;
if (mode == TYPE_MODE (long_double_type_node))
return long_double_type_node;
if (mode == TYPE_MODE (build_pointer_type (char_type_node)))
return build_pointer_type (char_type_node);
if (mode == TYPE_MODE (build_pointer_type (integer_type_node)))
return build_pointer_type (integer_type_node);
return 0;
}
tree
truthvalue_conversion (expr)
tree expr;
{
return chill_truthvalue_conversion (expr);
}
#endif

View File

@ -4,17 +4,16 @@
@c For copying conditions, see the file gcc.texi.
@node G++ and GCC
@chapter Compile C, C++, Objective-C, Ada, CHILL, Fortran, or Java
@chapter Compile C, C++, Objective-C, Ada, Fortran, or Java
@cindex Objective-C
@cindex Fortran
@cindex Java
@cindex CHILL
@cindex Ada
Several versions of the compiler (C, C++, Objective-C, Ada, CHILL,
Several versions of the compiler (C, C++, Objective-C, Ada,
Fortran, and Java) are integrated; this is why we use the name
``GNU Compiler Collection''. GCC can compile programs written in any of these
languages. The Ada, CHILL, Fortran, and Java compilers are described in
languages. The Ada, Fortran, and Java compilers are described in
separate manuals.
@cindex GCC

View File

@ -50,9 +50,6 @@ language front ends, and test suites. @xref{gcc Directory, , The
@item include
Headers for the @code{libiberty} library.
@item libchill
The CHILL runtime library.
@item libf2c
The Fortran runtime library.

View File

@ -1,4 +1,4 @@
@c Copyright (C) 2000, 2001 Free Software Foundation, Inc.
@c Copyright (C) 2000, 2001, 2002 Free Software Foundation, Inc.
@c This is part of the GCC manual.
@c For copying conditions, see the file gcc.texi.
@ -171,9 +171,6 @@ information as well.
GNAT Reference Manual}, for information on standard
conformance and compatibility of the Ada compiler.
@xref{References,,Language Definition References, chill, GNU Chill},
for details of the CHILL standard.
@xref{Language,,The GNU Fortran Language, g77, Using and Porting GNU
Fortran}, for details of the Fortran language supported by GCC@.

View File

@ -1,3 +1,7 @@
Mon Apr 15 10:59:14 2002 Mark Mitchell <mark@codesourcery.com>
* g77.texi: Remove Chill reference.
2002-04-13 Toon Moene <toon@moene.indiv.nluug.nl>
* news.texi: Deprecate frontend version number;

View File

@ -841,7 +841,7 @@ files and accepts Fortran-specific command-line options, plus some
command-line options that are designed to cater to Fortran users
but apply to other languages as well.
@xref{G++ and GCC,,Compile C; C++; Objective-C; Ada; CHILL; Fortran;
@xref{G++ and GCC,,Compile C; C++; Objective-C; Ada; Fortran;
or Java,gcc,Using the GNU Compiler Collection (GCC)},
for information on the way different languages are handled
by the GNU CC compiler (@command{gcc}).

View File

@ -825,7 +825,6 @@ static const struct compiler default_compilers[] =
{".F", "#Fortran", 0}, {".FOR", "#Fortran", 0}, {".FPP", "#Fortran", 0},
{".r", "#Ratfor", 0},
{".p", "#Pascal", 0}, {".pas", "#Pascal", 0},
{".ch", "#Chill", 0}, {".chi", "#Chill", 0},
{".java", "#Java", 0}, {".class", "#Java", 0},
{".zip", "#Java", 0}, {".jar", "#Java", 0},
/* Next come the entries for C. */

View File

@ -1,3 +1,7 @@
2002-04-15 Mark Mitchell <mark@codesourcery.com>
* testsuite/lib/chill.exp: Remove.
2002-04-14 Jakub Jelinek <jakub@redhat.com>
* g++.dg/other/big-struct.C: New test.

View File

@ -1,365 +0,0 @@
#
# Expect script for Chill Regression Tests
# Copyright (C) 1993, 1996, 1997 Free Software Foundation
#
# This file is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#
# Written by Jeffrey Wheat (cassidy@cygnus.com)
#
#
# chill support library procedures and testsuite specific instructions
#
#
# default_chill_version
# extract and print the version number of the chill compiler
# exits if compiler does not exist
#
proc default_chill_version { } {
global GCC_UNDER_TEST
# ignore any arguments after the command
set compiler [lindex $GCC_UNDER_TEST 0]
# verify that the compiler exists
if {[which $compiler] != 0} then {
set tmp [ exec $compiler -v ]
regexp "version.*$" $tmp version
if [info exists version] then {
clone_output "[which $compiler] $version\n"
}
} else {
warning "$compiler does not exist"
exit -1
}
}
#
# chill_compile
# compile the specified file
#
# returns values:
# return 0 on success
# return 1 on failure with $result containing compiler output
# exit with -1 if compiler doesn't exist
#
# verbosity output:
# 1 - indicate compile in progress
# 2 - indicate compile, target name
# 3 - indicate compile, target name, exec command, and result
#
proc chill_compile { src obj } {
global GCC_UNDER_TEST
global CFLAGS
global errno
global result
global verbose
global subdir
global tmpdir
set errno 0
set cflags $CFLAGS
set dumpfile [file rootname $obj].cmp ;# name of file to dump stderr in
# verify that the compiler exists
if { [which $GCC_UNDER_TEST] == 0 } then {
warning "$GCC_UNDER_TEST does not exist"
exit -1
}
if { $verbose == 1 } then {
send_user "Compiling... "
} else {
verbose " - CMPL: Compiling [file tail $src]" 2
}
# if object type is a grt file, then only build a grant file
if [string match "*.grt" $obj] then {
set cflags [concat $cflags -fgrant-only]
}
# build command line
set commandline "$GCC_UNDER_TEST $cflags -I$subdir -c $src"
# write command line to logfile
send_log "\n### EXEC: $commandline\n"
# tell us whats going on if verbose
verbose "### EXEC: $commandline" 3
# exec the compiler with the appropriate flags
set errno [catch "exec $commandline" result]
# dump compiler's stderr output into $dumpfile - this is a gross hack
set dumpfile [open $dumpfile w+]; puts $dumpfile $result; close $dumpfile
# log any compiler output unless its null
if ![string match "" $result] then { send_log "\n$result\n" }
unset cflags
return
}
#
# chill_link
# link the specified files
#
# returns values:
# return 0 on success
# return 1 on failure with $result containing compiler output
# exit with -1 if compiler doesn't exist
#
# verbosity output:
# 1 - indicate linking in progress
# 2 - indicate linking, target name
# 3 - indicate linking, target name, exec command, and result
#
proc chill_link { target } {
global GCC_UNDER_TEST
global CFLAGS
global errno
global result
global verbose
global tmptarget
global crt0
global libs
global objs
set errno 0
# verify that the compiler exists
if { [which $GCC_UNDER_TEST] == 0 } then {
warning "$GCC_UNDER_TEST does not exist"
exit -1
}
if { $verbose == 1 } then {
send_user "Linking... "
} else {
verbose " - LINK: Linking [file tail $target]" 2
}
# verify that the object exists
if ![file exists $target.o] then {
set errno 1
set result "file $target.o doesn't exist"
return
}
# build command line
set commandline "$GCC_UNDER_TEST $CFLAGS -o $target $target.o $objs $crt0 $libs"
# write command line to logfile
send_log "\n### EXEC: $commandline\n"
# tell us whats going on if we are verbose
verbose "### EXEC: $commandline" 3
# link the objects, sending any linker output to $result
set errno [catch "exec $commandline > $tmptarget.lnk" result]
# log any linker output unless its null
if ![string match "" $result] then { send_log "\n$result\n" }
return
}
#
# default_chill_start
#
proc default_chill_start { } {
global srcdir
global subdir
global tmpdir
global verbose
if { $verbose > 1 } then { send_user "Configuring testsuite... " }
# tmpdir is obtained from $objdir/site.exp. if not, set it to /tmp
if ![info exists tmpdir] then { set tmpdir /tmp }
# save and convert $srcdir to an absolute pathname, stomp on the old value
# stomp on $subdir and set to the absolute path to the subdirectory
global osrcdir; set osrcdir $srcdir; set srcdir [cd $srcdir; pwd]
global osubdir; set osubdir $subdir; set subdir $srcdir/$subdir
# cd the temporary directory, $tmpdir
cd $tmpdir; verbose "### PWD: [pwd]" 5
# copy init files to the tmpdir
foreach initfile [glob -nocomplain $subdir/*.init] {
set targfile $tmpdir/[file tail [file rootname $initfile]]
verbose "### EXEC: cp $initfile $targfile" 5
if [catch "exec cp $initfile $targfile"] then {
send_user "\nConfigure failed.\n"
exit -1
}
}
if { $verbose > 1 } then { send_user "Configuring finished.\n" }
}
#
# default_chill_exit
#
#
proc default_chill_exit { } {
global srcdir
global objdir
global tmpdir
global osrcdir
global osubdir
# reset directory variables
set srcdir $osrcdir; set subdir $osubdir
# remove all generated targets and objects
verbose "### EXEC: rm -f $tmpdir/*" 3
catch "exec rm -f $tmpdir/*" result
# change back to the main object directory
cd $objdir
verbose "### SANITY: [pwd]" 5
}
#
# chill_diff
# compare two files line-by-line
#
# returns values:
# return 0 on success
# return 1 if different
# return -1 if output file doesn't exist
#
# verbosity output:
# 1 - indicate diffing in progress
# 2 - indicate diffing, target names
# 3 - indicate diffing, target names, and result
#
proc chill_diff { file_1 file_2 } {
global errno
global result
global target
global tmptarget
global verbose
set eof -1
set errno 0
set differences 0
if { $verbose == 1 } then {
send_user "Diffing... "
} else {
verbose " - DIFF: Diffing [file tail $file_1] [file tail $file_2]" 2
}
# write command line to logfile
send_log "### EXEC: diff $file_1 $file_2\n"
# tell us whats going on if we are verbose
verbose "### EXEC: diff $file_1 $file_2" 3
# verify file exists and open it
if [file exists $file_1] then {
set file_a [open $file_1 r]
} else {
set errno -1; set result "$file_1 doesn't exist"
return
}
# verify file exists and is not zero length, and then open it
if [file exists $file_2] then {
if [file size $file_2]!=0 then {
set file_b [open $file_2 r]
} else {
set errno -1; set result "$file_2 is zero bytes"; return
}
} else {
set errno -1; set result "$file_2 doesn't exist"; return
}
# spoof the diff routine
lappend list_a $target
while { [gets $file_a line] != $eof } {
if [regexp "^#.*$" $line] then {
continue
} else {
lappend list_a $line
}
}
close $file_a
# spoof the diff routine
lappend list_b $target
while { [gets $file_b line] != $eof } {
if [regexp "^#.*$" $line] then {
continue
} else {
# use [file tail $line] to strip off pathname
lappend list_b [file tail $line]
}
}
close $file_b
for { set i 0 } { $i < [llength $list_a] } { incr i } {
set line_a [lindex $list_a $i]
set line_b [lindex $list_b $i]
if [string compare $line_a $line_b] then {
set errno 1
set count [expr $i+1]
set linenum [format %dc%d $count $count]
verbose "$linenum" 3
verbose "< $line_a" 3
verbose "---" 3
verbose "> $line_b" 3
send_log "$file_1: < $count: $line_a\n"
send_log "$file_2: > $count: $line_b\n"
set result "differences found"
}
}
return
}
#
# chill_fail
# a wrapper around the framework fail proc
#
proc chill_fail { target result } {
global verbose
if { $verbose == 1 } then { send_user "\n" }
fail $target
verbose "--------------------------------------------------" 3
verbose "### RESULT: $result" 3
}
#
# chill_pass
# a wrapper around the framework fail proc
#
proc chill_pass { target } {
global verbose
if { $verbose == 1 } then { send_user "\n" }
pass $target
}

View File

@ -1,3 +1,8 @@
2002-04-15 Mark Mitchell <mark@codesourcery.com>
* gcc_release (build_tarfiles): Do not build Chill tarfiles.
(CHILL_DIRS): Remove.
2002-03-10 Joseph S. Myers <jsm28@cam.ac.uk>
* gcc_release: Build diffs for ada and chill. Make "bzip2" a new

View File

@ -268,7 +268,6 @@ build_tarfiles() {
# Now, build one for each of the languages.
build_tarfile gcc-ada-${RELEASE} ${ADA_DIRS}
build_tarfile gcc-chill-${RELEASE} ${CHILL_DIRS}
build_tarfile gcc-g++-${RELEASE} ${CPLUSPLUS_DIRS}
build_tarfile gcc-g77-${RELEASE} ${FORTRAN_DIRS}
build_tarfile gcc-java-${RELEASE} ${JAVA_DIRS}
@ -277,7 +276,7 @@ build_tarfiles() {
# The core is everything else.
EXCLUDES=""
for x in ${ADA_DIRS} ${CHILL_DIRS} ${CPLUSPLUS_DIRS} ${FORTRAN_DIRS} \
for x in ${ADA_DIRS} ${CPLUSPLUS_DIRS} ${FORTRAN_DIRS} \
${JAVA_DIRS} ${OBJECTIVEC_DIRS} ${TESTSUITE_DIRS}; do
EXCLUDES="${EXCLUDES} --exclude $x"
done
@ -410,7 +409,6 @@ SOURCE_DIRECTORY=""
# The directories that should be part of the various language-specific
# tar files. These are all relative to the top of the source tree.
ADA_DIRS="gcc/ada"
CHILL_DIRS="gcc/ch libchill"
CPLUSPLUS_DIRS="gcc/cp libstdc++-v3"
FORTRAN_DIRS="gcc/f libf2c"
JAVA_DIRS="gcc/java libjava libffi fastjar zlib boehm-gc"
@ -540,7 +538,6 @@ SOURCE_DIRECTORY="${WORKING_DIRECTORY}/gcc-${RELEASE}"
# Recompute the names of all the language-specific directories,
# relative to the WORKING_DIRECTORY.
ADA_DIRS=`adjust_dirs ${ADA_DIRS}`
CHILL_DIRS=`adjust_dirs ${CHILL_DIRS}`
CPLUSPLUS_DIRS=`adjust_dirs ${CPLUSPLUS_DIRS}`
FORTRAN_DIRS=`adjust_dirs ${FORTRAN_DIRS}`
JAVA_DIRS=`adjust_dirs ${JAVA_DIRS}`